Revision: 201017
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 14 May 2010 15:41:10 +0300
changeset 23 2dc6caa42ec3
parent 20 ecc8def7944a
child 25 61b206842ac4
child 27 9ba4404ef423
child 38 b4618f2cf6ac
Revision: 201017 Kit: 201019
email_plat/email_services_api/email_services_api.h
email_plat/nmail_client_api/nmail_client_api.pri
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/nmapimessagebody.h
email_plat/nmail_client_api/nmapimessageenvelope.h
email_plat/nmail_client_api/nmapimessagetask.h
email_plat/nmail_client_api/nmcommon_api.h
email_plat/nmail_client_api/nmenginedef.h
emailservices/emailcommon/inc/CFSMailCommon.h
emailservices/emailcommon/src/CFSMailMessage.cpp
emailservices/emailcommon/src/CFSMailMessageBase.cpp
emailservices/emailcommon/src/CFSMailMessagePart.cpp
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/inc/baseplugindelayedopsprivate.h
emailservices/emailstore/base_plugin/src/baseplugindelayedops.cpp
emailservices/emailstore/base_plugin/src/basepluginparts.cpp
emailservices/nmailagent/inc/nmmailagent.h
emailservices/nmailagent/inc/nmmailagentheaders.h
emailservices/nmailagent/inc/ssastartupwatcher.h
emailservices/nmailagent/nmailagent.pro
emailservices/nmailagent/src/main.cpp
emailservices/nmailagent/src/nmmailagent.cpp
emailservices/nmailagent/src/ssastartupwatcher.cpp
emailservices/nmailbase/bwins/nmailbaseu.def
emailservices/nmailbase/eabi/nmailbaseu.def
emailservices/nmailbase/inc/nmcommon.h
emailservices/nmailbase/inc/nmmailbox.h
emailservices/nmailbase/inc/nmmessage.h
emailservices/nmailbase/inc/nmmessageenvelope.h
emailservices/nmailbase/inc/nmmessagepart.h
emailservices/nmailbase/src/nmmailbox.cpp
emailservices/nmailbase/src/nmmessage.cpp
emailservices/nmailbase/src/nmmessageenvelope.cpp
emailservices/nmailbase/src/nmmessagepart.cpp
emailservices/nmclientapi/bwins/nmailclientapiu.def
emailservices/nmclientapi/eabi/nmailclientapiu.def
emailservices/nmclientapi/inc/nmapicommonheader.h
emailservices/nmclientapi/inc/nmapiconverterheader.h
emailservices/nmclientapi/inc/nmapidatapluginfactory.h
emailservices/nmclientapi/inc/nmapidataplugininterface.h
emailservices/nmclientapi/inc/nmapiemailaddress_p.h
emailservices/nmclientapi/inc/nmapiengine.h
emailservices/nmclientapi/inc/nmapienvelopelisting_p.h
emailservices/nmclientapi/inc/nmapieventnotifier_p.h
emailservices/nmclientapi/inc/nmapifolder_p.h
emailservices/nmclientapi/inc/nmapifolderlisting_p.h
emailservices/nmclientapi/inc/nmapimailbox_p.h
emailservices/nmclientapi/inc/nmapimailboxlisting_p.h
emailservices/nmclientapi/inc/nmapimessagebody_p.h
emailservices/nmclientapi/inc/nmapimessageenvelope_p.h
emailservices/nmclientapi/inc/nmapiprivateclasses.h
emailservices/nmclientapi/inc/nmapiprivateheaders.h
emailservices/nmclientapi/inc/nmapitypesconverter.h
emailservices/nmclientapi/inc/nmprivateclasses.h
emailservices/nmclientapi/nmclientapi.pro
emailservices/nmclientapi/src/nmapidatapluginfactory.cpp
emailservices/nmclientapi/src/nmapiemailaddress.cpp
emailservices/nmclientapi/src/nmapiemailservice.cpp
emailservices/nmclientapi/src/nmapiengine.cpp
emailservices/nmclientapi/src/nmapienvelopelisting.cpp
emailservices/nmclientapi/src/nmapienvelopelisting_p.cpp
emailservices/nmclientapi/src/nmapieventnotifier.cpp
emailservices/nmclientapi/src/nmapieventnotifier_p.cpp
emailservices/nmclientapi/src/nmapifolder.cpp
emailservices/nmclientapi/src/nmapifolderlisting.cpp
emailservices/nmclientapi/src/nmapifolderlisting_p.cpp
emailservices/nmclientapi/src/nmapimailbox.cpp
emailservices/nmclientapi/src/nmapimailboxlisting.cpp
emailservices/nmclientapi/src/nmapimailboxlisting_p.cpp
emailservices/nmclientapi/src/nmapimessagebody.cpp
emailservices/nmclientapi/src/nmapimessageenvelope.cpp
emailservices/nmclientapi/src/nmapimessagetask.cpp
emailservices/nmclientapi/src/nmapitypesconverter.cpp
emailservices/nmregister/inc/nmmailboxregisterinterface.h
emailservices/nmregister/inc/nmmailboxregisterinterface_p.h
emailservices/nmregister/nmregister.pro
emailservices/nmregister/rom/nmregisterlanguage.iby
emailservices/nmregister/src/nmmailboxregisterinterface.cpp
emailservices/nmregister/translations/nmregister.ts
emailservices/nmutilities/bwins/nmutilitiesu.def
emailservices/nmutilities/data/2001E277.txt
emailservices/nmutilities/data/email_brand.qrc
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/nmutilities.confml
emailservices/nmutilities/data/nmutilities_200255BA.crml
emailservices/nmutilities/eabi/nmutilitiesu.def
emailservices/nmutilities/inc/emailmailboxinfo.h
emailservices/nmutilities/inc/emailmailboxinfo_p.h
emailservices/nmutilities/inc/emailutilitiesdef.h
emailservices/nmutilities/inc/nmcenrepkeys.h
emailservices/nmutilities/inc/nmutilitiescommonheaders.h
emailservices/nmutilities/nmutilities.pro
emailservices/nmutilities/rom/nmutilities.iby
emailservices/nmutilities/src/emailmailboxinfo.cpp
emailservices/nmutilities/src/emailmailboxinfo_p.cpp
emailuis/nmailcpplugin/nmailcpplugin.pro
emailuis/nmailui/conf/nmeditorview.docml
emailuis/nmailui/conf/nmmailboxlistview.docml
emailuis/nmailui/conf/nmmailboxselectiondialog.docml
emailuis/nmailui/conf/nmmailviewer.docml
emailuis/nmailui/conf/nmmessagelistview.docml
emailuis/nmailui/conf/nmmessagesearchlistview.docml
emailuis/nmailui/conf/nmviewerheader.css
emailuis/nmailui/conf/nmviewerheader.widgetml
emailuis/nmailui/inc/nmaction.h
emailuis/nmailui/inc/nmactionrequest.h
emailuis/nmailui/inc/nmactionresponse.h
emailuis/nmailui/inc/nmapplication.h
emailuis/nmailui/inc/nmattachmentfetchobserver.h
emailuis/nmailui/inc/nmattachmentmanager.h
emailuis/nmailui/inc/nmattachmentpicker.h
emailuis/nmailui/inc/nmbaseview.h
emailuis/nmailui/inc/nmeditorview.h
emailuis/nmailui/inc/nmmailboxlistview.h
emailuis/nmailui/inc/nmmailboxlistviewitem.h
emailuis/nmailui/inc/nmmailboxselectiondialog.h
emailuis/nmailui/inc/nmmessagelistview.h
emailuis/nmailui/inc/nmmessagelistviewitem.h
emailuis/nmailui/inc/nmmessagesearchlistview.h
emailuis/nmailui/inc/nmrecipientfield.h
emailuis/nmailui/inc/nmsendserviceinterface.h
emailuis/nmailui/inc/nmuieffects.h
emailuis/nmailui/inc/nmuiextensionmanager.h
emailuis/nmailui/inc/nmuiheaders.h
emailuis/nmailui/inc/nmuiviewids.h
emailuis/nmailui/inc/nmutilities.h
emailuis/nmailui/inc/nmviewerview.h
emailuis/nmailui/nmailui.pro
emailuis/nmailui/nmailui.qrc
emailuis/nmailui/resources/mail_send.fxml
emailuis/nmailui/service_conf.xml
emailuis/nmailui/src/nmapplication.cpp
emailuis/nmailui/src/nmattachmentlist.cpp
emailuis/nmailui/src/nmattachmentmanager.cpp
emailuis/nmailui/src/nmattachmentpicker.cpp
emailuis/nmailui/src/nmbaseview.cpp
emailuis/nmailui/src/nmeditorcontent.cpp
emailuis/nmailui/src/nmeditorheader.cpp
emailuis/nmailui/src/nmeditortextdocument.cpp
emailuis/nmailui/src/nmeditorview.cpp
emailuis/nmailui/src/nmmailboxlistview.cpp
emailuis/nmailui/src/nmmailboxlistviewitem.cpp
emailuis/nmailui/src/nmmailboxselectiondialog.cpp
emailuis/nmailui/src/nmmailboxserviceinterface.cpp
emailuis/nmailui/src/nmmessagelistview.cpp
emailuis/nmailui/src/nmmessagelistviewitem.cpp
emailuis/nmailui/src/nmmessagesearchlistview.cpp
emailuis/nmailui/src/nmsendserviceinterface.cpp
emailuis/nmailui/src/nmuieffects.cpp
emailuis/nmailui/src/nmuiextensionmanager.cpp
emailuis/nmailui/src/nmutilities.cpp
emailuis/nmailui/src/nmviewerserviceinterface.cpp
emailuis/nmailui/src/nmviewerview.cpp
emailuis/nmailui/src/nmviewerviewnetmanager.cpp
emailuis/nmailui/translations/mail.qm
emailuis/nmailui/translations/mail.ts
emailuis/nmailuiengine/bwins/nmailuiengineu.def
emailuis/nmailuiengine/eabi/nmailuiengineu.def
emailuis/nmailuiengine/inc/nmaddattachmentsoperation.h
emailuis/nmailuiengine/inc/nmbaseclientplugin.h
emailuis/nmailuiengine/inc/nmcheckoutboxoperation.h
emailuis/nmailuiengine/inc/nmdatamanager.h
emailuis/nmailuiengine/inc/nmdataplugininterface.h
emailuis/nmailuiengine/inc/nmmessagecreationoperation.h
emailuis/nmailuiengine/inc/nmmessagelistmodel.h
emailuis/nmailuiengine/inc/nmmessagesearchlistmodel.h
emailuis/nmailuiengine/inc/nmmessagesendingoperation.h
emailuis/nmailuiengine/inc/nmoperation.h
emailuis/nmailuiengine/inc/nmstoreenvelopesoperation.h
emailuis/nmailuiengine/inc/nmuiengine.h
emailuis/nmailuiengine/inc/nmuiengineheaders.h
emailuis/nmailuiengine/nmailuiengine.pro
emailuis/nmailuiengine/src/nmaddattachmentoperation.cpp
emailuis/nmailuiengine/src/nmbaseclientplugin.cpp
emailuis/nmailuiengine/src/nmdatamanager.cpp
emailuis/nmailuiengine/src/nmmessagelistmodel.cpp
emailuis/nmailuiengine/src/nmmessagesearchlistmodel.cpp
emailuis/nmailuiengine/src/nmoperation.cpp
emailuis/nmailuiengine/src/nmuiengine.cpp
emailuis/nmailuiwidgets/bwins/nmailuiwidgetsu.def
emailuis/nmailuiwidgets/eabi/nmailuiwidgetsu.def
emailuis/nmailuiwidgets/inc/nmailuiwidgetsheaders.h
emailuis/nmailuiwidgets/inc/nmattachmentlistitem.h
emailuis/nmailuiwidgets/inc/nmattachmentlistwidget.h
emailuis/nmailuiwidgets/inc/nmeditortextedit.h
emailuis/nmailuiwidgets/nmailuiwidgets.pro
emailuis/nmailuiwidgets/src/nmattachmentlistitem.cpp
emailuis/nmailuiwidgets/src/nmattachmentlistwidget.cpp
emailuis/nmailuiwidgets/src/nmeditortextedit.cpp
emailuis/nmailuiwidgets/src/nmrecipientlineedit.cpp
emailuis/nmailuiwidgetsplugin/nmailuiwidgetsplugin.pro
emailuis/nmailuiwidgetsplugin/src/nmailuiwidgetsplugin.cpp
emailuis/nmframeworkadapter/inc/nmframeworkadapter.h
emailuis/nmframeworkadapter/inc/nmframeworkadapterheaders.h
emailuis/nmframeworkadapter/inc/nmfwaaddattachmentsoperation.h
emailuis/nmframeworkadapter/inc/nmfwacheckoutboxoperation.h
emailuis/nmframeworkadapter/inc/nmfwaforwardmessagecreationoperation.h
emailuis/nmframeworkadapter/inc/nmfwamessagecreationoperation.h
emailuis/nmframeworkadapter/inc/nmfwamessagefetchingoperation.h
emailuis/nmframeworkadapter/inc/nmfwamessagepartfetchingoperation.h
emailuis/nmframeworkadapter/inc/nmfwamessagesendingoperation.h
emailuis/nmframeworkadapter/inc/nmfwaremoveattachmentoperation.h
emailuis/nmframeworkadapter/inc/nmfwareplymessagecreationoperation.h
emailuis/nmframeworkadapter/inc/nmfwastoreenvelopesoperation.h
emailuis/nmframeworkadapter/inc/nmfwastoremessageoperation.h
emailuis/nmframeworkadapter/inc/nmmailboxsearchobserver.h
emailuis/nmframeworkadapter/nmframeworkadapter.pro
emailuis/nmframeworkadapter/src/nmframeworkadapter.cpp
emailuis/nmframeworkadapter/src/nmfwaaddattachmentsoperation.cpp
emailuis/nmframeworkadapter/src/nmfwacheckoutboxoperation.cpp
emailuis/nmframeworkadapter/src/nmfwamessagecreationoperation.cpp
emailuis/nmframeworkadapter/src/nmfwamessagefetchingoperation.cpp
emailuis/nmframeworkadapter/src/nmfwamessagepartfetchingoperation.cpp
emailuis/nmframeworkadapter/src/nmfwamessagesendingoperation.cpp
emailuis/nmframeworkadapter/src/nmfwaremoveattachmentoperation.cpp
emailuis/nmframeworkadapter/src/nmfwareplymessagecreationoperation.cpp
emailuis/nmframeworkadapter/src/nmfwastoreenvelopesoperation.cpp
emailuis/nmframeworkadapter/src/nmfwastoremessageoperation.cpp
emailuis/nmframeworkadapter/src/nmmailboxsearchobserver.cpp
emailuis/nmhswidget/conf/nmhswidgetmail.docml
emailuis/nmhswidget/conf/nmhswidgettitle.docml
emailuis/nmhswidget/inc/nmhswidget.h
emailuis/nmhswidget/inc/nmhswidgetconsts.h
emailuis/nmhswidget/inc/nmhswidgetdatetimeobserver.h
emailuis/nmhswidget/inc/nmhswidgetdatetimeobserver_p.h
emailuis/nmhswidget/inc/nmhswidgetemailengine.h
emailuis/nmhswidget/inc/nmhswidgetemailrow.h
emailuis/nmhswidget/inc/nmhswidgettitlerow.h
emailuis/nmhswidget/nmhswidget.pro
emailuis/nmhswidget/rom/nmhswidgetlanguage.iby
emailuis/nmhswidget/src/nmhswidget.cpp
emailuis/nmhswidget/src/nmhswidgetdatetimeobserver.cpp
emailuis/nmhswidget/src/nmhswidgetdatetimeobserver_p.cpp
emailuis/nmhswidget/src/nmhswidgetemailengine.cpp
emailuis/nmhswidget/src/nmhswidgetemailrow.cpp
emailuis/nmhswidget/src/nmhswidgettitlerow.cpp
emailuis/nmhswidget/translations/mailwidget.ts
emailuis/nmindicatorplugin/inc/nmindicator.h
emailuis/nmindicatorplugin/inc/nmindicatorplugin.h
emailuis/nmindicatorplugin/nmindicatorplugin.pro
emailuis/nmindicatorplugin/src/nmindicator.cpp
emailuis/nmindicatorplugin/src/nmindicatorplugin.cpp
emailuis/nmsettingui/bwins/nmsettinguiu.def
emailuis/nmsettingui/conf/nmmailboxsettingview.docml
emailuis/nmsettingui/eabi/nmsettinguiu.def
emailuis/nmsettingui/inc/nmmailboxselectionview.h
emailuis/nmsettingui/inc/nmsettingsviewfactory.h
emailuis/nmsettingui/nmsettingui.pro
emailuis/nmsettingui/src/nmmailboxselectionview.cpp
emailuis/nmsettingui/src/nmmailboxsettingview.cpp
emailuis/nmsettingui/src/nmsettingsviewfactory.cpp
emailuis/rom/nmail.iby
inc/emailmailboxinfo.h
inc/ipssettingkeys.h
inc/nmailuiwidgetsdef.h
inc/nmattachmentlistwidget.h
inc/nmbaseviewscrollarea.h
inc/nmdatamanager.h
inc/nmdatapluginfactory.h
inc/nmeditortextedit.h
inc/nmhtmllineedit.h
inc/nmmessagesearchlistmodel.h
inc/nmrecipientlineedit.h
inc/nmsettingsviewfactory.h
inc/nmsettingsviewlauncher.h
inc/nmsettinguidef.h
ipsservices/ipssosaoplugin/data/200100BA.rss
ipsservices/ipssosaoplugin/inc/IpsSosAOBaseAgent.h
ipsservices/ipssosaoplugin/inc/IpsSosAOEMNResolver.h
ipsservices/ipssosaoplugin/inc/IpsSosAOImapAgent.h
ipsservices/ipssosaoplugin/inc/IpsSosAOImapPopLogic.h
ipsservices/ipssosaoplugin/inc/IpsSosAOMboxLogic.h
ipsservices/ipssosaoplugin/inc/IpsSosAOPlugin.hrh
ipsservices/ipssosaoplugin/inc/IpsSosAOPluginEComInterface.h
ipsservices/ipssosaoplugin/inc/IpsSosAOPluginTimer.h
ipsservices/ipssosaoplugin/inc/IpsSosAOPopAgent.h
ipsservices/ipssosaoplugin/inc/IpsSosAOSchedulerUtils.h
ipsservices/ipssosaoplugin/inc/IpsSosAOSettingsHandler.h
ipsservices/ipssosaoplugin/inc/IpsSosAOSmtpAgent.h
ipsservices/ipssosaoplugin/inc/IpsSosAOSmtpSendWatcher.h
ipsservices/ipssosaoplugin/inc/IpsSosAoExtendedSettingsManager.h
ipsservices/ipssosaoplugin/ipssosaoplugin.pro
ipsservices/ipssosaoplugin/src/IpsSosAOImapAgent.cpp
ipsservices/ipssosaoplugin/src/IpsSosAOImapPopLogic.cpp
ipsservices/ipssosaoplugin/src/IpsSosAOMboxLogic.cpp
ipsservices/ipssosaoplugin/src/IpsSosAOPluginTimer.cpp
ipsservices/ipssosaoplugin/src/IpsSosAOPopAgent.cpp
ipsservices/ipssosaoplugin/src/IpsSosAOSchedulerUtils.cpp
ipsservices/ipssosaoplugin/src/IpsSosAOSettingsHandler.cpp
ipsservices/ipssosaoplugin/src/IpsSosAOSmtpAgent.cpp
ipsservices/ipssosaoplugin/src/IpsSosAoExtendedSettingsManager.cpp
ipsservices/ipssosplugin/data/2000E53D.rss
ipsservices/ipssosplugin/inc/ipsplgbaseoperation.h
ipsservices/ipssosplugin/inc/ipsplgcommon.h
ipsservices/ipssosplugin/inc/ipsplgconnectandrefreshfolderlist.h
ipsservices/ipssosplugin/inc/ipsplgcreateforwardmessageoperation.h
ipsservices/ipssosplugin/inc/ipsplgcreatemessageoperation.h
ipsservices/ipssosplugin/inc/ipsplgcreatereplymessageoperation.h
ipsservices/ipssosplugin/inc/ipsplgdeletelocal.h
ipsservices/ipssosplugin/inc/ipsplgdeleteoperation.h
ipsservices/ipssosplugin/inc/ipsplgdeleteremote.h
ipsservices/ipssosplugin/inc/ipsplgdisconnectop.h
ipsservices/ipssosplugin/inc/ipsplgeventhandler.h
ipsservices/ipssosplugin/inc/ipsplgheaders.h
ipsservices/ipssosplugin/inc/ipsplgimap4connectop.h
ipsservices/ipssosplugin/inc/ipsplgimap4fetchattachmentop.h
ipsservices/ipssosplugin/inc/ipsplgimap4moveremoteop.h
ipsservices/ipssosplugin/inc/ipsplgimap4plugin.h
ipsservices/ipssosplugin/inc/ipsplgimap4populateop.h
ipsservices/ipssosplugin/inc/ipsplgmsgkey.h
ipsservices/ipssosplugin/inc/ipsplgmsgmapper.h
ipsservices/ipssosplugin/inc/ipsplgnewchildpartfromfileoperation.h
ipsservices/ipssosplugin/inc/ipsplgonlineoperation.h
ipsservices/ipssosplugin/inc/ipsplgpanic.h
ipsservices/ipssosplugin/inc/ipsplgpop3connectop.h
ipsservices/ipssosplugin/inc/ipsplgpop3fetchoperation.h
ipsservices/ipssosplugin/inc/ipsplgsearch.h
ipsservices/ipssosplugin/inc/ipsplgsearch.inl
ipsservices/ipssosplugin/inc/ipsplgsearchop.h
ipsservices/ipssosplugin/inc/ipsplgsingleopwatcher.h
ipsservices/ipssosplugin/inc/ipsplgsmtpoperation.h
ipsservices/ipssosplugin/inc/ipsplgsmtpservice.h
ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.h
ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.hrh
ipsservices/ipssosplugin/inc/ipsplgsyncstatehandler.h
ipsservices/ipssosplugin/ipssosplugin.pro
ipsservices/ipssosplugin/src/ipsplgbaseoperation.cpp
ipsservices/ipssosplugin/src/ipsplgconnectandrefreshfolderlist.cpp
ipsservices/ipssosplugin/src/ipsplgcreateforwardmessageoperation.cpp
ipsservices/ipssosplugin/src/ipsplgcreatemessageoperation.cpp
ipsservices/ipssosplugin/src/ipsplgcreatereplymessageoperation.cpp
ipsservices/ipssosplugin/src/ipsplgdeletelocal.cpp
ipsservices/ipssosplugin/src/ipsplgdeleteoperation.cpp
ipsservices/ipssosplugin/src/ipsplgdeleteremote.cpp
ipsservices/ipssosplugin/src/ipsplgdisconnectop.cpp
ipsservices/ipssosplugin/src/ipsplgeventhandler.cpp
ipsservices/ipssosplugin/src/ipsplgimap4connectop.cpp
ipsservices/ipssosplugin/src/ipsplgimap4fetchattachmentop.cpp
ipsservices/ipssosplugin/src/ipsplgimap4moveremoteop.cpp
ipsservices/ipssosplugin/src/ipsplgimap4plugin.cpp
ipsservices/ipssosplugin/src/ipsplgimap4populateop.cpp
ipsservices/ipssosplugin/src/ipsplgmrulist.cpp
ipsservices/ipssosplugin/src/ipsplgmsgkey.cpp
ipsservices/ipssosplugin/src/ipsplgmsgmapper.cpp
ipsservices/ipssosplugin/src/ipsplgonlineoperation.cpp
ipsservices/ipssosplugin/src/ipsplgpop3connectop.cpp
ipsservices/ipssosplugin/src/ipsplgpop3fetchoperation.cpp
ipsservices/ipssosplugin/src/ipsplgpop3plugin.cpp
ipsservices/ipssosplugin/src/ipsplgsearch.cpp
ipsservices/ipssosplugin/src/ipsplgsearchop.cpp
ipsservices/ipssosplugin/src/ipsplgsingleopwatcher.cpp
ipsservices/ipssosplugin/src/ipsplgsmtpoperation.cpp
ipsservices/ipssosplugin/src/ipsplgsmtpservice.cpp
ipsservices/ipssosplugin/src/ipsplgsosbaseplugin.cpp
ipsservices/ipssosplugin/src/ipsplgsyncstatehandler.cpp
ipsservices/nmimapclientplugin/inc/nmimapclientplugin.h
ipsservices/nmimapclientplugin/inc/nmimapclientpluginheaders.h
ipsservices/nmimapclientplugin/nmimapclientplugin.pro
ipsservices/nmimapclientplugin/src/nmimapclientplugin.cpp
ipsservices/nmipssettings/inc/ipssettingkeys.h
ipsservices/nmipssettings/inc/nmipssettingitems.h
ipsservices/nmipssettings/inc/nmipssettingscustomitem.h
ipsservices/nmipssettings/inc/nmipssettingshelper.h
ipsservices/nmipssettings/inc/nmipssettingsmultiselectionitem.h
ipsservices/nmipssettings/inc/nmipssettingsplugin.h
ipsservices/nmipssettings/inc/nmipssettingstimeeditor.h
ipsservices/nmipssettings/nmipssettings.pro
ipsservices/nmipssettings/src/nmipssettingscustomitem.cpp
ipsservices/nmipssettings/src/nmipssettingshelper.cpp
ipsservices/nmipssettings/src/nmipssettingslabeledcombobox.cpp
ipsservices/nmipssettings/src/nmipssettingsmanagerbase.cpp
ipsservices/nmipssettings/src/nmipssettingsmultiselectionitem.cpp
ipsservices/nmipssettings/src/nmipssettingsplugin.cpp
ipsservices/nmipssettings/src/nmipssettingstimeeditor.cpp
ipsservices/nmipssettings/translations/mailips.qm
ipsservices/nmipssettings/translations/mailips.ts
ipsservices/nmpopclientplugin/inc/nmpopclientplugin.h
ipsservices/nmpopclientplugin/inc/nmpopclientpluginheaders.h
ipsservices/nmpopclientplugin/nmpopclientplugin.pro
ipsservices/nmpopclientplugin/src/nmpopclientplugin.cpp
ipsservices/rom/FreestyleIpsServices.iby
ipsservices/rom/nmimapclientplugin.iby
ipsservices/rom/nmpopclientplugin.iby
nmail.pro
--- a/email_plat/email_services_api/email_services_api.h	Mon May 03 12:23:15 2010 +0300
+++ b/email_plat/email_services_api/email_services_api.h	Fri May 14 15:41:10 2010 +0300
@@ -26,12 +26,21 @@
 static const QString emailSendCcKey = "cc";
 static const QString emailSendBccKey = "bcc";
 
+/*!
+    Mail service name
+*/
+static const QString emailServiceName("nmail");
 
 /*!
     Mail send service interface name.
 */
 static const QString emailInterfaceNameSend = "com.nokia.symbian.IEmailMessageSend";
 
+/*!
+    Mail send service interface name.
+*/
+static const QString emailFullServiceNameSend = emailServiceName + "." + emailInterfaceNameSend;
+
 
 /*!
     \fn send(QVariant data)
@@ -55,7 +64,7 @@
 
         bool syncronous;
 
-        XQServiceRequest request(emailInterfaceNameSend,
+        XQServiceRequest request(emailFullServiceNameSend,
                                  emailOperationSendMail,
                                  syncronous);
 
@@ -84,12 +93,22 @@
 */
 static const QString emailInterfaceNameMailbox = "com.nokia.symbian.IEmailInboxView";
 
+/*!
+    Mailbox service full name.
+*/
+static const QString emailFullServiceNameMailbox = emailServiceName + "." + emailInterfaceNameMailbox;
+
 
 /*!
     Message service interface name.
 */
 static const QString emailInterfaceNameMessage = "com.nokia.symbian.IEmailMessageView";
 
+/*!
+    Message service full name.
+*/
+static const QString emailFullServiceNameMessage = emailServiceName + "." + emailInterfaceNameMessage;
+
 
 /*!
     \fn displayInboxByMailboxId(QVariant data)
@@ -102,7 +121,7 @@
     Usage example:
 
     XQServiceRequest request(
-        emailInterfaceNameMailbox,
+        emailFullServiceNameMailbox,
         emailOperationViewInbox,
         syncronous);
 
@@ -129,7 +148,7 @@
     Usage example:
 
     XQServiceRequest request(
-       emailInterfaceNameMessage,
+       emailFullServiceNameMessage,
        emailOperationViewMessage,
        syncronous);
 
--- a/email_plat/nmail_client_api/nmail_client_api.pri	Mon May 03 12:23:15 2010 +0300
+++ b/email_plat/nmail_client_api/nmail_client_api.pri	Fri May 14 15:41:10 2010 +0300
@@ -18,10 +18,10 @@
 symbian*: {
     # Build.inf rules
     BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
-            "nmail_client_api/nmcommon_api.h           APP_LAYER_PLATFORM_EXPORT_PATH(nmcommon_api.h)" \
+            "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/nmenginedef.h            APP_LAYER_PLATFORM_EXPORT_PATH(nmenginedef.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)" \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_client_api/nmapicommon.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,65 @@
+/*
+ * 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
+    };
+    
+    /*!
+       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
+    };
+    
+    /*!
+       Enum to describe error types
+     */
+    enum NmApiError
+    {
+        GeneralError = -1, NotSupportedError
+    };
+    
+}
+Q_DECLARE_METATYPE (EmailClientApi::NmApiMailboxEvent)
+Q_DECLARE_METATYPE(EmailClientApi::NmApiMessageEvent)
+Q_DECLARE_METATYPE (EmailClientApi::NmApiEmailFolderType)
+Q_DECLARE_METATYPE (EmailClientApi::NmApiError)
+
+#endif /* NMAPICOMMON_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_client_api/nmapidef.h	Fri May 14 15:41:10 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_ */
--- a/email_plat/nmail_client_api/nmapiemailaddress.h	Mon May 03 12:23:15 2010 +0300
+++ b/email_plat/nmail_client_api/nmapiemailaddress.h	Fri May 14 15:41:10 2010 +0300
@@ -18,53 +18,64 @@
 #ifndef NMAPIEMAILADDRESS_H
 #define NMAPIEMAILADDRESS_H
 
-#include <QString>
 #include <QExplicitlySharedDataPointer>
-#include "nmenginedef.h"
-/**
- * Email addres
+#include <nmapidef.h>
+/*!
+   Email addres
  */
 
+class QString;
+
 namespace EmailClientApi
 {
-class NmEmailAddressPrivate : public QSharedData
+
+class NmApiEmailAddressPrivate;
+
+class NMAPI_EXPORT NmApiEmailAddress
 {
 public:
-    NmEmailAddressPrivate();
-    virtual ~NmEmailAddressPrivate();
-    QString displayName;
-    QString address;
-};
+    /*!
+       Constructor for NmApiEmailAddress class
+     */
+    NmApiEmailAddress();
+    virtual ~NmApiEmailAddress();
+
+    /*!
+       copying constructor for nmmessageenvelope
+     */
+    NmApiEmailAddress(const NmApiEmailAddress &addr);
 
-class NMENGINE_EXPORT NmEmailAddress
-{
-public:
+    /*!
+       Assignment operator
+     */
+    NmApiEmailAddress &operator=(const NmApiEmailAddress &addr);
+
+    /*!
+       Compares data from \a addr
+     */
+    bool operator==(const NmApiEmailAddress &addr);
+
     /*
-     * Constructor for NmEmailAddress class
-     */
-    NmEmailAddress();
-    virtual ~NmEmailAddress();
-    /*
-     * getter for displayname
+       getter for displayname
      */
     QString displayName() const;
 
-    /*
-     * getter for address
+    /*!
+       getter for address
      */
     QString address() const;
 
-    /*
-     * setter for displayname 
+    /*!
+       setter for displayname 
      */
     void setDisplayName(const QString &displayName);
 
-    /*
-     * setter for address
+    /*!
+       setter for address
      */
     void setAddress(const QString &address);
 private:
-    QExplicitlySharedDataPointer<NmEmailAddressPrivate> d;
+    QExplicitlySharedDataPointer<NmApiEmailAddressPrivate> d;
 };
 }
 
--- a/email_plat/nmail_client_api/nmapiemailservice.h	Mon May 03 12:23:15 2010 +0300
+++ b/email_plat/nmail_client_api/nmapiemailservice.h	Fri May 14 15:41:10 2010 +0300
@@ -18,71 +18,75 @@
 #ifndef NMAPIEMAILSERVICE_H
 #define NMAPIEMAILSERVICE_H
 
+#include <nmapidef.h>
 #include <QObject>
 
-#include "nmenginedef.h"
-#include "nmapimailbox.h"
-#include "nmapimessageenvelope.h"
+class NmApiEngine;
 
-class NmEngine;
-
-/**
- * Client that wants to access mailboxes, messages and receive related events
- * use this class as "entry point". 
+/*!
+   Client that wants to access mailboxes, messages and receive related events
+   use this class as "entry point". 
  */
 
 namespace EmailClientApi
 {
-class NMENGINE_EXPORT NmEmailService : public QObject
+
+class NmApiMessageEnvelope;
+class NmApiMailbox;
+
+class NMAPI_EXPORT NmApiEmailService : public QObject
 {
     Q_OBJECT
 public:
 
-    /*
-     * constructor for NmEmailService
+    /*!
+       constructor for NmApiEmailService
      */
-    NmEmailService(QObject* parent);
+    NmApiEmailService(QObject* parent);
 
-    /*
-     * destructor for NmEmailService
+    /*!
+       destructor for NmApiEmailService
      */
-    virtual ~NmEmailService();
+    virtual ~NmApiEmailService();
 
-    /*
-     * Initialises email service. this must be called and initialised signal received 
-     * before services of the library are used.
+    /*!
+       Initialises email service. this must be called and initialised signal received 
+       before services of the library are used.
      */
     void initialise();
 
-    /*
-     *  frees resources.
+    /*!
+        frees resources.
      */
     void uninitialise();
 
-    /*
-     *gets mail message envelope by id (see also NmEventNotifier)
+    /*!
+       gets mail message envelope by id (see also NmApiEventNotifier)
      */
-    bool getEnvelope( const quint64 mailboxId, const quint64 folderId, const quint64 envelopeId, NmMessageEnvelope &envelope );
+    bool getEnvelope(const quint64 mailboxId, 
+                     const quint64 folderId, 
+                     const quint64 envelopeId, 
+                     EmailClientApi::NmApiMessageEnvelope &envelope);
 
-    /*
-     *  gets mailbox info by id (see also NmEventNotifier)
+    /*!
+        gets mailbox info by id (see also NmApiEventNotifier)
      */
-    bool getMailbox( const quint64 mailboxId, NmMailbox &mailboxInfo );
+    bool getMailbox(const quint64 mailboxId, EmailClientApi::NmApiMailbox &mailboxInfo);
 
-    /*
-     * returns isrunning flag value
+    /*!
+       returns isrunning flag value
      */
     bool isRunning() const;
     signals:
-    /*
-     * this signal is emitted when initialisation is completed
-     * boolean argument tells if initialisation succeeded
+    /*!
+       this signal is emitted when initialisation is completed
+       boolean argument tells if initialisation succeeded
      */
     void initialized(bool);
 
 private:
-    NmEngine* mEngine;
+    NmApiEngine *mEngine;
     bool mIsRunning;
 };
 }
-#endif /* NMEMAILSERVICE_H_ */
+#endif /* NMAPIEMAILSERVICE_H */
--- a/email_plat/nmail_client_api/nmapienvelopelisting.h	Mon May 03 12:23:15 2010 +0300
+++ b/email_plat/nmail_client_api/nmapienvelopelisting.h	Fri May 14 15:41:10 2010 +0300
@@ -18,86 +18,88 @@
 #ifndef NMAPIENVELOPELISTING_H_
 #define NMAPIENVELOPELISTING_H_
 
-#include <QObject>
 #include <QList>
 
-#include "nmapimessagetask.h"
-#include "nmapimessageenvelope.h"
-#include "nmenginedef.h"
+#include <nmapimessagetask.h>
+#include <nmapidef.h>
 
-class NmEngine;
+class QObject;
+
+class NmApiEngine;
 
 // list messages in particular folder.
 namespace EmailClientApi
 {
-class NmEnvelopeListingPrivate;
+class NmApiEnvelopeListingPrivate;
+class NmApiMessageEnvelope;
 
-class NMENGINE_EXPORT NmEnvelopeListing : public NmMessageTask
+class NMAPI_EXPORT NmApiEnvelopeListing : public NmApiMessageTask
 {
     Q_OBJECT
 public:
     /*!
-     * Constructor of class. It set start values.
+       Constructor of class. It set start values.
      */
-    NmEnvelopeListing( QObject *parent, const quint64 folderId, const quint64 mailboxId );
+    NmApiEnvelopeListing(QObject *parent, const quint64 folderId, const quint64 mailboxId);
 
     /*!
-     * Destructor of class. It release engine to be safe if manual releasing won't work.
+       Destructor of class. It release engine to be safe if manual releasing won't work.
      */
-    virtual ~NmEnvelopeListing();
+    ~NmApiEnvelopeListing();
 
     enum {EnvelopeListingFailed = -1};
 
     /*! 
-     * \brief Returns results after envelopesListed signal is received.
-     * 
-     *  Caller gets ownership of envelopes. Returns true if results were available.
-     *  It clears list of envelopes after be called.
-     *  It also at start clear inputlist of NmMessageEnvelope.
-     *  
-     *  \arg envelopes 
+       \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::NmMessageEnvelope> &envelopes );
+    bool getEnvelopes(QList<EmailClientApi::NmApiMessageEnvelope> &envelopes);
 
     /*!
-     * \brief Return info if listing is running
+       \brief Return info if listing is running
      */
     bool isRunning() const;
     signals:
     /*!
-     * Emitted when listing is available, count is number of mailboxes found
-     * or EnvelopeListingFailed if listing failed
+       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());
-     * </code>
-     * 
+       \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
+       
      */
-    virtual bool start();
+    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 NmMessageTask::canceled() signal.
+       \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.
      */
-    virtual void cancel();
+    void cancel();
 
 private:
-    NmEnvelopeListingPrivate* mListingPrivate;
+    NmApiEnvelopeListingPrivate *mListingPrivate;
 };
 }
 
-#endif /* NMENVELOPELISTING_H_ */
+#endif /* NMAPIENVELOPELISTING_H_ */
--- a/email_plat/nmail_client_api/nmapieventnotifier.h	Mon May 03 12:23:15 2010 +0300
+++ b/email_plat/nmail_client_api/nmapieventnotifier.h	Fri May 14 15:41:10 2010 +0300
@@ -18,102 +18,104 @@
 #ifndef NMAPIEVENTNOTIFIER_H
 #define NMAPIEVENTNOTIFIER_H
 
-#include <QtCore>
-#include "nmapimessagetask.h"
-#include "nmenginedef.h"
-#include "nmcommon_api.h"
+#include <nmapimessagetask.h>
+#include <nmapidef.h>
+#include <nmapicommon.h>
 
 struct NmApiMessage;
 
 namespace EmailClientApi
 {
-class NmEventNotifierPrivate;
+class NmApiEventNotifierPrivate;
 
-/*
- * Notifier for mailbox and message events
- * 
- * Example of use:
- * NmEventNotifier *notifier = new NmEventNotifier(this);
- * notifier->start();
- * connect(notifier,SIGNAL(messageEvent(MessageEvent,quint64,quint64,QList<quint64>)),this,
- *                  SLOT(processMessage(MessageEvent,quint64,quint64,QList<quint64>)),Qt::QueuedConnection);
- * 
- * And then when want to end need to do:
- * notifier->cancel();
- * delete notifier; // or notifier->deleteLater();
+/*!
+   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 NMENGINE_EXPORT NmEventNotifier : public NmMessageTask
+class NMAPI_EXPORT NmApiEventNotifier : public NmApiMessageTask
 {
     Q_OBJECT
 public:
     /*!
-     * Constructor
+       Constructor
      */
-    NmEventNotifier(QObject *parent);
+    NmApiEventNotifier(QObject *parent);
 
     /*!
-     * Destructor
+       Destructor
      */
-    virtual ~NmEventNotifier();
+    virtual ~NmApiEventNotifier();
 
     /*!
-     * Start monitoring email events
-     * 
-     * Return value tells about monitoring system running
+       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 NmMessageTask::canceled() signal.
+       Cancels monitoring.
+       
+       In user responsibility is to cancel monitoring.
+       On end it clear buffer events and emits \sa NmApiMessageTask::canceled() signal.
      */
     virtual void cancel();
 
     /*!
-     * It check if if event notifier is running.
+       Checks if event notifier is running.
      */
     bool isRunning() const;
 
     signals:
     /*!
-     * This signal is emited when buffer of maiblox 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.
-     * \arg Event of mailbox
-     * \arg List of mailbox ids where event occur.
+       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(MailboxEvent event,QList<quint64> id);
+    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.
+       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::NmEmailService::getEnvelope to get object.
-     * 
-     * \arg Event of messages
-     * \arg Message mailbox
-     * \arg Message folder
-     * \arg List of messages ids where event occur
+       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(MessageEvent event,quint64 mailboxId,quint64 folderId,QList<quint64> envelopeIdList);
+    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.
+       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:
-    NmEventNotifierPrivate *mNmEventNotifierPrivate;
+    NmApiEventNotifierPrivate *mNmApiEventNotifierPrivate;
 };
 
 }
--- a/email_plat/nmail_client_api/nmapifolder.h	Mon May 03 12:23:15 2010 +0300
+++ b/email_plat/nmail_client_api/nmapifolder.h	Fri May 14 15:41:10 2010 +0300
@@ -18,106 +18,101 @@
 #ifndef NMAPIFOLDERINFO_H
 #define NMAPIFOLDERINFO_H
 
-#include <QString>
 #include <QExplicitlySharedDataPointer>
 #include <QList>
-#include "nmenginedef.h"
+#include <nmapidef.h>
+#include <nmapicommon.h>
 
-/**
- * Mailbox metadata class
+/*!
+   Mailbox metadata class
  */
 namespace EmailClientApi
 {
 
-enum EmailFolderType
-{
-    Inbox, Drafts, Outbox, Sent, Deleted, EOther
-};
+class NmApiFolderPrivate;
 
-enum
-{
-    GeneralError = -1, NotSupportedError
-};
-
-class NmFolderPrivate : public QSharedData
+class NMAPI_EXPORT NmApiFolder
 {
 public:
-    NmFolderPrivate();
-    virtual ~NmFolderPrivate();
-
-    quint64 id;
-    QString name;
-    EmailFolderType folderType;
-    quint64 parentId;
-    QList<quint64> childFolderIds;
-};
+    /*!
+       constructor for NmApiFolder class
+     */
+    NmApiFolder();
+    
+    /*!
+        Copy constructor for NmApiFolder 
+     */
+    NmApiFolder(const NmApiFolder &nmApiFolder);
+    
+    /*!
+       destructor for NmApiFolder class
+     */
+    virtual ~NmApiFolder();
 
-class NMENGINE_EXPORT NmFolder
-{
-public:
-    /*
-     * constructor for NmFolder class
+    /*!
+       Assigns data from \a folder
      */
-    NmFolder();
-    /*
-     * destructor for NmFolder class
+    NmApiFolder &operator=(const NmApiFolder &folder);
+    
+    /*!
+       Compares data from \a folder
      */
-    ~NmFolder();
-
-    /*
-     * getter for id
+    bool operator==(const NmApiFolder &folder);
+    
+    /*!
+       getter for id
      */
     quint64 id() const;
 
-    /*
-     * getter for name 
+    /*!
+       getter for name 
      */
     QString name() const;
 
-    /*
-     * getter for foldertype
+    /*!
+       getter for foldertype
      */
-    EmailFolderType folderType() const;
+    EmailClientApi::NmApiEmailFolderType folderType() const;
 
-    /*
-     * setter for id
+    /*!
+       setter for id
      */
     void setId(quint64 id);
 
-    /*
-     * setter for name
+    /*!
+       setter for name
      */
-    void setName(const QString& name);
+    void setName(const QString &name);
 
-    /*
-     * setter for foldertype
+    /*!
+       setter for foldertype
      */
-    void setFolderType(EmailFolderType folderType);
+    void setFolderType(EmailClientApi::NmApiEmailFolderType folderType);
 
-    /*
-     * seter for childfolder ids
+    /*!
+       setter for childfolder ids
      */
     void setChildFolderIds(QList<quint64> &childFolderIds);
 
-    /*
-     * seter for childfolder ids
+    /*!
+       setter for childfolder ids
      */
     void setParentFolderId(quint64 parentId);
 
-    /*
-     * returns child folder ids.
-     * to be implemented later when nmail functionality is available
+    /*!
+       returns child folder ids.
+       to be implemented later when nmail functionality is available
      */
     void getChildFolderIds(QList<quint64> &childFolderIds);
 
-    /*
-     * returns parent folder id.
-     * 
+    /*!
+       returns parent folder id.
+       
      */
     quint64 parentFolderId() const;
 
 private:
-    QExplicitlySharedDataPointer<NmFolderPrivate> d;
+    QExplicitlySharedDataPointer<NmApiFolderPrivate> d;
 };
 
 }
--- a/email_plat/nmail_client_api/nmapifolderlisting.h	Mon May 03 12:23:15 2010 +0300
+++ b/email_plat/nmail_client_api/nmapifolderlisting.h	Fri May 14 15:41:10 2010 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * 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"
@@ -18,88 +18,85 @@
 #ifndef NMAPIFOLDERLISTING_H_
 #define NMAPIFOLDERLISTING_H_
 
-#include <QObject>
+#include <nmapimessagetask.h>
+#include <nmapidef.h>
 
-#include "nmapimessagetask.h"
-#include "nmapimailbox.h"
-#include "nmenginedef.h"
-#include "nmapifolder.h"
-
-class NmEngine;
+class NmApiEngine;
 
 namespace EmailClientApi
 {
 
-class NmFolderListingPrivate;
-
+class NmApiFolderListingPrivate;
+class NmApiMailbox;
+class NmApiFolder;
 /*!
- * \class Class for creating list of all folders
+   \class Class for creating list of all folders
  */
-class NMENGINE_EXPORT NmFolderListing : public NmMessageTask
+class NMAPI_EXPORT NmApiFolderListing : public NmApiMessageTask
 {
     Q_OBJECT
 public:
     /*!
-     * Constructor of class. It set start values.
+       Constructor of class. It set start values.
      */
-    NmFolderListing( QObject *parent, const quint64 &nmMailboxId );
+    NmApiFolderListing(QObject *parent, const quint64 &nmMailboxId);
     /*!
-     * Destructor of class. It release engine to be safe if manual releasing won't work.
+       Destructor of class. It release engine to be safe if manual releasing won't work.
      */
-    ~NmFolderListing();
+    ~NmApiFolderListing();
 
     enum {FolderListingFailed = -1};
 
     /*! 
-     * \brief Returns results after foldersListed signal is received.
-     * 
-     *  Caller gets ownership of messages. Returns true if results were available.
-     *  It clears list of folders after be called.
-     *  It also at start clear inputlist of NmFolder.
+       \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::NmFolder> &folders);
+    bool getFolders(QList<EmailClientApi::NmApiFolder> &folders);
 
     /*!
-     * \brief Return info if listing is running
+       \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
+       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>
-     * 
+       \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>
+       
      */
-    virtual bool start();
+    bool start();
 
     /*!
-     * \brief Stop gathering folder list.
-     * 
-     * In first it change state of listing.
-     * Then it release engine.
-     * On end it clears list of folders and emits \sa NmMessageTask::canceled() signal.
+       \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.
      */
-    virtual void cancel();
+    void cancel();
 
 private:
-    NmFolderListingPrivate* mFolderListing;
+    NmApiFolderListingPrivate *mFolderListing;
 };
 }
 
-#endif /* NMFOLDERLISTING_H_ */
+#endif /* NMAPIFOLDERLISTING_H_ */
--- a/email_plat/nmail_client_api/nmapimailbox.h	Mon May 03 12:23:15 2010 +0300
+++ b/email_plat/nmail_client_api/nmapimailbox.h	Fri May 14 15:41:10 2010 +0300
@@ -18,69 +18,79 @@
 #ifndef NMAPIMAILBOX_H
 #define NMAPIMAILBOX_H
 
-#include <QString>
 #include <QExplicitlySharedDataPointer>
-#include "nmenginedef.h"
-/**
- * Mailbox metadata class
+#include <nmapidef.h>
+
+class QString;
+
+/*!
+   Mailbox metadata class
  */
 
 namespace EmailClientApi
 {
-class NmMailboxPrivate : public QSharedData
+
+class NmApiMailboxPrivate;
+
+class NMAPI_EXPORT NmApiMailbox
 {
 public:
-    NmMailboxPrivate();
-    virtual ~NmMailboxPrivate();
-
-    quint64 id;
-    QString name;
-    QString address;
-};
-
-class NMENGINE_EXPORT NmMailbox
-{
-public:
-    /*
-     *  constructor for nmmailbox 
+    /*!
+        constructor for NmApiMailbox 
+     */
+    NmApiMailbox();
+    
+    /*!
+        Copy constructor for NmApiMailbox 
+     */
+   NmApiMailbox(const NmApiMailbox &nmApiMailbox);
+    
+    /*!
+       destructor for NmApiMailbox
      */
-    NmMailbox();
-    /*
-     * destructor for nmmailbox
+    virtual ~NmApiMailbox();
+    
+    /*!
+       Assign data from \a mailbox
      */
-    virtual ~NmMailbox();
-    NmMailbox &operator=(const NmMailbox &mailbox);
-    /*
-     * getter for id
+    NmApiMailbox &operator=(const NmApiMailbox &mailbox);
+    
+    /*!
+       Compare data from \a mailbox
+     */
+    bool operator==(const NmApiMailbox &mailbox);
+    
+    /*!
+       getter for id
      */
     quint64 id() const;
 
-    /*
-     * getter for name
+    /*!
+       getter for name
      */
     QString name() const;
 
-    /*
-     * getter for address
+    /*!
+       getter for address
      */
     QString address() const;
 
-    /*
-     * setter for id
+    /*!
+       setter for id
      */
     void setId(quint64 id);
 
-    /* 
-     * setter for name
+    /*! 
+       setter for name
      */
     void setName(const QString &name);
 
-    /*
-     * setter for address
+    /*!
+       setter for address
      */
     void setAddress(const QString &address);
 private:
-    QExplicitlySharedDataPointer<NmMailboxPrivate> d;
+    QExplicitlySharedDataPointer<NmApiMailboxPrivate> d;
 };
 }
 #endif
--- a/email_plat/nmail_client_api/nmapimailboxlisting.h	Mon May 03 12:23:15 2010 +0300
+++ b/email_plat/nmail_client_api/nmapimailboxlisting.h	Fri May 14 15:41:10 2010 +0300
@@ -18,94 +18,96 @@
 #ifndef NMAPIMAILBOXLISTING_H_
 #define NMAPIMAILBOXLISTING_H_
 
-#include <QObject>
 
-#include "nmapimessagetask.h"
-#include "nmapimailbox.h"
-#include "nmenginedef.h"
+#include <nmapimessagetask.h>
+#include <nmapidef.h>
+
+class QObject;
 
 namespace EmailClientApi
 {
-class NmMailboxListingPrivate;
+class NmApiMailboxListingPrivate;
+class NmApiMailbox;
 
 /*!
- * \class Class for creating list of all mailboxes
+   \class Class for creating list of all mailboxes
  */
-class NMENGINE_EXPORT NmMailboxListing : public NmMessageTask
+class NMAPI_EXPORT NmApiMailboxListing : public NmApiMessageTask
 {
     Q_OBJECT
 public:
     /*!
-     * Constructor of class. It set start values.
+       Constructor of class. It set start values.
      */
-    NmMailboxListing( QObject *parent );
+    NmApiMailboxListing(QObject *parent);
     /*!
-     * Destructor of class. It release engine to be safe if manual releasing won't work.
+       Destructor of class. It release engine to be safe if manual releasing won't work.
      */
-    virtual ~NmMailboxListing();
+    ~NmApiMailboxListing();
 
     enum {MailboxListingFailed = -1};
 
     /*! 
-     * \brief Returns results after mailboxesListed signal is received.
-     * 
-     *  Caller gets ownership of mailboxes. Returns true if results were available.
-     *  It clears list of mailboxes (in private members) after be called.
-     *  At start it clear inputlist of mailboxes.
-     *  
-     *  \return Return true if results were avaible
-     *  \arg List of mailboxes to filled. On start is cleared. 
+       \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::NmMailbox> &mailboxes);
+    bool getMailboxes(QList<EmailClientApi::NmApiMailbox> &mailboxes);
 
     /*!
-     * \brief Return info if listing is running
-     * 
-     * \return Return true if listing is running
+       \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
-     * 
-     * \arg Count of mailboxes inside class.
+       
+       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.
-     * 
+       \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.
+       
      */
-    virtual bool start();
+    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 NmMessageTask::canceled() signal.
+       \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.
      */
-    virtual void cancel();
+    void cancel();
 
 private:
-    NmMailboxListingPrivate *mNmMailboxListingPrivate;
+    NmApiMailboxListingPrivate *mNmApiMailboxListingPrivate;
 };
 
 }
 
-#endif /* NMMAILBOXLISTING_H_ */
+#endif /* NMAPIMAILBOXLISTING_H_ */
--- a/email_plat/nmail_client_api/nmapimessagebody.h	Mon May 03 12:23:15 2010 +0300
+++ b/email_plat/nmail_client_api/nmapimessagebody.h	Fri May 14 15:41:10 2010 +0300
@@ -18,66 +18,72 @@
 #ifndef NMAPIMESSAGEBODY_H
 #define NMAPIMESSAGEBODY_H
 
-#include <QString>
 #include <QExplicitlySharedDataPointer>
-#include "nmenginedef.h"
+#include <nmapidef.h>
+
+class QString;
 
 namespace EmailClientApi
 {
 
-class NmMessageBodyPrivate : public QSharedData
+class NmApiMessageBodyPrivate;
+
+class NMAPI_EXPORT NmApiMessageBody
 {
 public:
-    NmMessageBodyPrivate();
-    virtual ~NmMessageBodyPrivate();
-
-    quint64 totalSize;
-    quint64 fetchedSize;
-    QString content;
-};
-
-class NMENGINE_EXPORT NmMessageBody
-{
-public:
-    /*
-     * constructor for nmmessagebody
+    /*!
+       constructor for NmApiMessageBody
+     */
+    NmApiMessageBody();
+    /*!
+       copying constructor for NmApiMessageBody
      */
-    NmMessageBody();
-
-    virtual ~NmMessageBody();
+    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
+       getter for total size of message body in bytes
      */
     quint64 totalSize() const;
 
     /*!
-     * getter for bytes available in local mailbox store
+       getter for bytes available in local mailbox store
      */
     quint64 fetchedSize() const;
 
     /*!
-     * getter for fetched content
+       getter for fetched content
      */
     QString content() const;
 
-    /*
-     * setter for total size of message body in bytes
+    /*!
+       setter for total size of message body in bytes
      */
     void setTotalSize(quint64 size);
 
-    /*
-     * setter for bytes available on local mailbox store
+    /*!
+       setter for bytes available on local mailbox store
      */
     void setFetchedSize(quint64 size);
 
-    /*
-     * setter for content
+    /*!
+       setter for content
      */
-    void setContent(const QString& content);
+    void setContent(const QString &content);
 
 private:
-    QExplicitlySharedDataPointer<NmMessageBodyPrivate> d;
+    QExplicitlySharedDataPointer<NmApiMessageBodyPrivate> d;
 };
 }
 #endif
--- a/email_plat/nmail_client_api/nmapimessageenvelope.h	Mon May 03 12:23:15 2010 +0300
+++ b/email_plat/nmail_client_api/nmapimessageenvelope.h	Fri May 14 15:41:10 2010 +0300
@@ -15,218 +15,209 @@
  *
  */
 
-#ifndef NMAPIMESSAGEENVELOPEINFO_H
-#define NMAPIMESSAGEENVELOPEINFO_H
+#ifndef NMAPIMESSAGEENVELOPE_H
+#define NMAPIMESSAGEENVELOPE_H
+
 
-#include <QString>
-#include <QDateTime>
 #include <QExplicitlySharedDataPointer>
+#include <QList>
 
-#include "nmenginedef.h"
-#include "nmapiemailaddress.h"
-#include "nmapimessagebody.h"
+#include <nmapidef.h>
+
+class QString;
+class QDateTime;
 
 namespace EmailClientApi
 {
-class NmMessageEnvelopePrivate : public QSharedData
+class NmApiMessageEnvelopePrivate;
+class NmApiEmailAddress;
+class NmApiMessageBody;
+
+// read-only envelope
+class NMAPI_EXPORT NmApiMessageEnvelope
 {
 public:
-    NmMessageEnvelopePrivate();
-    virtual ~NmMessageEnvelopePrivate();
-
-    bool read;
-    bool attachments;
-    bool forwarded;
-    bool replied;
-
-    QList<EmailClientApi::NmEmailAddress> ccRecipients;
-    QList<EmailClientApi::NmEmailAddress> toRecipients;
-
-    quint64 id;
-    quint64 parentFolder;
-
-    QString contentType;
-    QString subject;
-    QString sender;
+    /*!
+       constructor for NmApiMessageEnvelope
+     */
+    NmApiMessageEnvelope();
+    
+    /*!
+       destructor for NmApiMessageEnvelope
+     */
+    virtual ~NmApiMessageEnvelope();
+    
+    /*!
+       copying constructor for NmApiMessageEnvelope
+     */
+    NmApiMessageEnvelope(const NmApiMessageEnvelope &envelope);
 
-    QString plainText;
-    quint64 totalSize;
-    quint64 fetchedSize;
-
-    QDateTime sentTime;
-};
+    /*!
+       Assignment operator
+     */
+    NmApiMessageEnvelope &operator=(const NmApiMessageEnvelope &envelope);
 
-// read-only envelope
-class NMENGINE_EXPORT NmMessageEnvelope
-{
-public:
-    /*
-     * constructor for nmmessageenvelope
+    /*!
+       Comapre data from \a envelope
      */
-    NmMessageEnvelope();
-    /*
-     * destructor for nmmessageenvelope
-     */
-    virtual ~NmMessageEnvelope();
-    NmMessageEnvelope &operator=(const NmMessageEnvelope &envelope);
-
+    bool operator==(const NmApiMessageEnvelope &envelope);
     /*!        
-     * getter for id
+       getter for id
      */
     quint64 id() const;
 
-    /*
-     * getter for id of parent folder
+    /*!
+       getter for id of parent folder
      */
     quint64 parentFolder() const;
 
-    /*
-     * getter for subject
+    /*!
+       getter for subject
      */
     QString subject() const;
 
-    /*
-     * getter for sender
+    /*!
+       getter for sender
      */
     QString sender() const;
 
-    /*
-     * getter for to recipients
+    /*!
+       getter for to recipients
      */
-    void getToRecipients( QList<EmailClientApi::NmEmailAddress> &toRecipients );
+    void getToRecipients(QList<EmailClientApi::NmApiEmailAddress> &toRecipients);
 
-    /*
-     * getter for cc recipients
+    /*!
+       getter for cc recipients
      */
-    void getCcRecipients( QList<EmailClientApi::NmEmailAddress> &ccRecipients );
+    void getCcRecipients(QList<EmailClientApi::NmApiEmailAddress> &ccRecipients);
 
-    /*
-     * getter for sent time
+    /*!
+       getter for sent time
      */
     QDateTime sentTime() const;
 
-    /*
-     * getter for is read flag
+    /*!
+       getter for is read flag
      */
     bool isRead() const;
 
-    /*
-     * getter for has attachments flag
+    /*!
+       getter for has attachments flag
      */
     bool hasAttachments() const;
 
-    /*
-     * getter for is forwarded flag
+    /*!
+       getter for is forwarded flag
      */
     bool isForwarded() const;
 
-    /*
-     * getter for is replied flag
+    /*!
+       getter for is replied flag
      */
     bool isReplied() const;
 
-    /*
-     * getter for content type
+    /*!
+       getter for content type
      */
     QString contentType() const;
 
-    /*
-     * getter for plaintext body
+    /*!
+       getter for plaintext body
      */
-    void getPlainTextBody( EmailClientApi::NmMessageBody &body );
+    void getPlainTextBody(EmailClientApi::NmApiMessageBody &body);
 
-    /*
-     * getter for plaintext body
+    /*!
+       getter for plaintext body
      */
     QString plainText() const;
 
-    /*
-     * getter for messages fetched size 
+    /*!
+       getter for messages fetched size 
      */
     quint64 totalSize() const;
 
-    /*
-     * getter for messages fetched size 
+    /*!
+       getter for messages fetched size 
      */
     quint64 fetchedSize() const;
 
-    /*
-     * setter for id 
+    /*!
+       setter for id 
      */
     void setId(quint64 id);
 
-    /*
-     * setter for parent folder 
+    /*!
+       setter for parent folder 
      */
     void setParentFolder(quint64 parentFolder);
 
-    /*
-     * setter for subject 
+    /*!
+       setter for subject 
      */
-    void setSubject(const QString& subject);
+    void setSubject(const QString &subject);
 
-    /*
-     * setter for sender  
+    /*!
+       setter for sender  
      */
-    void setSender(const QString& sender);
+    void setSender(const QString &sender);
 
-    /*
-     * setter for to recipients 
+    /*!
+       setter for to recipients 
      */
-    void setToRecipients(const QList<EmailClientApi::NmEmailAddress>& toRecipients);
+    void setToRecipients(const QList<EmailClientApi::NmApiEmailAddress> &toRecipients);
 
-    /*
-     * setter for cc recipients 
+    /*!
+       setter for cc recipients 
      */
-    void setCcRecipients(const QList<EmailClientApi::NmEmailAddress> &ccRecipients);
+    void setCcRecipients(const QList<EmailClientApi::NmApiEmailAddress> &ccRecipients);
 
-    /*
-     * setter for sent time 
+    /*!
+       setter for sent time 
      */
     void setSentTime(QDateTime sentTime);
 
-    /*
-     * setter for is read flag
+    /*!
+       setter for is read flag
      */
     void setIsRead(bool isRead);
 
-    /*
-     * setter for has attachments flag 
+    /*!
+       setter for has attachments flag 
      */
     void setHasAttachments(bool hasAttachments);
 
-    /*
-     * setter for is forwarded flag 
+    /*!
+       setter for is forwarded flag 
      */
     void setIsForwarded(bool isForwarded);
 
-    /*
-     * setter for is replied flag 
+    /*!
+       setter for is replied flag 
      */
     void setIsReplied(bool isReplied);
 
-    /*
-     * setter for content type 
+    /*!
+       setter for content type 
      */
     void setContentType(const QString &contentType);
 
-    /*
-     * getter for messages plain text 
+    /*!
+       getter for messages plain text 
      */
     void setPlainText(const QString &plainText);
 
-    /*
-     * getter for messages fetched size 
+    /*!
+       getter for messages fetched size 
      */
     void setTotalSize(quint64 totalSize);
 
-    /*
-     * getter for messages fetched size 
+    /*!
+       getter for messages fetched size 
      */
     void setFetchedSize(quint64 fetchedSize);
 
 private:
-    QExplicitlySharedDataPointer<NmMessageEnvelopePrivate> d;
+    QExplicitlySharedDataPointer<NmApiMessageEnvelopePrivate> d;
 };
 }
 #endif
--- a/email_plat/nmail_client_api/nmapimessagetask.h	Mon May 03 12:23:15 2010 +0300
+++ b/email_plat/nmail_client_api/nmapimessagetask.h	Fri May 14 15:41:10 2010 +0300
@@ -20,41 +20,41 @@
 
 #include <QObject>
 
-#include "nmenginedef.h"
+#include <nmapidef.h>
 
-/**
- * base class for async tasks
+/*!
+   base class for async tasks
  */
-class NMENGINE_EXPORT NmMessageTask : public QObject
+class NMAPI_EXPORT NmApiMessageTask : public QObject
 {
     Q_OBJECT
 protected:
-    NmMessageTask( QObject *parent );
+    NmApiMessageTask(QObject *parent);
 
 public:
-    virtual ~NmMessageTask();
+    virtual ~NmApiMessageTask();
 
 public slots:
     /*!
-     * Starts task and returns true if starting succeeded.
+       Starts task and returns true if starting succeeded.
      */
-    virtual bool start()=0;
+    virtual bool start() = 0;
 
     /*!
-     * Cancels started but not yet completed task. may not be applicable
-     * in all tasks.
+       Cancels started but not yet completed task. may not be applicable
+       in all tasks.
      */
-    virtual void cancel() =0;
+    virtual void cancel() = 0;
 
     signals:
     /*!
-     * task failed, error code is specific to concrete task
+       task failed, error code is specific to concrete task
      */
-    void failed(int error);
+    void failed (int error);
     /*!
-     * task canceled
+       task canceled
      */
     void canceled();
 };
 
-#endif /* NMMESSAGETASK_H_ */
+#endif /*NMAPIMESSAGETASK_H_ */
--- a/email_plat/nmail_client_api/nmcommon_api.h	Mon May 03 12:23:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +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_API_H_
-#define NMAPICOMMON_API_H_
-
-#include <QtCore>
-
-/*!
- * Enum to describe mailbox events
- */
-enum MailboxEvent
-{
-    MailboxCreated, MailboxDeleted
-};
-Q_DECLARE_METATYPE ( MailboxEvent)
-/*!
- * Enum to describe message events.
- */
-enum MessageEvent {
-    MessageCreated,
-    MessageDeleted,
-    MessageChanged    
-};
-
-Q_DECLARE_METATYPE(MessageEvent)
-#endif /* NMCOMMON_API_H_ */
--- a/email_plat/nmail_client_api/nmenginedef.h	Mon May 03 12:23:15 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 NMENGINE_EXPORT __declspec(dllexport)
-#else
-
-#if defined(BUILD_ENGINE_DLL)
-#define NMENGINE_EXPORT Q_DECL_EXPORT
-#else
-#define NMENGINE_EXPORT Q_DECL_IMPORT
-#endif
-
-#endif
-
-#endif /* NMENGINEDEF_H_ */
--- a/emailservices/emailcommon/inc/CFSMailCommon.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/emailcommon/inc/CFSMailCommon.h	Fri May 14 15:41:10 2010 +0300
@@ -312,6 +312,9 @@
 
 
 _LIT(KFSMailContentDispAttachment, " attachment");
+//<qmail>
+_LIT(KFSMailContentDispInline, "inline");
+//</qmail>
 _LIT(KFSMailContentDispParamFilename, " filename=");
 
 /** mailbox synchronization states */
@@ -339,7 +342,8 @@
     PushChannelOff,
     PushChannelEstablished,
     PushChannelOffBecauseBatteryIsLow,
-    OutOfDiskSpace
+    OutOfDiskSpace,
+    ServerConnectionError // <qmail> new error code for sync
     };
 
 /**
@@ -438,7 +442,12 @@
         TFSEventMailboxOnline,
 
         // Mailbox went offline
-        // aParam1: NULL
+        // <qmail>
+        // aParam1: TInt possible errorCode.
+        //          Plugin may specify an error code here if it sees that connection was cut off unexpectedly;
+        //          Client can then have a separate handling for this exception.
+        //          KErrDisconnected should be used in situations where network coverage was dropped off unexpectedly.
+        // </qmail>
         // aParam2: NULL
         // aParam3: NULL
         TFSEventMailboxOffline,
--- a/emailservices/emailcommon/src/CFSMailMessage.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/emailcommon/src/CFSMailMessage.cpp	Fri May 14 15:41:10 2010 +0300
@@ -487,8 +487,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C NmMessage* CFSMailMessage::GetNmMessage()
 {
-	NmMessage* message = new NmMessage(iNmPrivateMessagePart);
-	message->setEnvelope(iNmPrivateMessageEnvelope);
+	NmMessage* message = new NmMessage(iNmPrivateMessageEnvelope, iNmPrivateMessagePart);
 	return message;
 }
 //</qmail>
--- a/emailservices/emailcommon/src/CFSMailMessageBase.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/emailcommon/src/CFSMailMessageBase.cpp	Fri May 14 15:41:10 2010 +0300
@@ -75,10 +75,10 @@
     iNmPrivateMessageEnvelope = new NmMessageEnvelopePrivate();
 
 	// typedef long int TInt32 -> typedef unsigned int quint32
-    iNmPrivateMessageEnvelope->mId.setId32((quint32)aMessageId.Id() );
+    iNmPrivateMessageEnvelope->mMessageId.setId32((quint32)aMessageId.Id() );
 
 	// typedef unsigned int TUint -> typedef unsigned int quint32
-    iNmPrivateMessageEnvelope->mId.setPluginId32((quint32)aMessageId.PluginId().iUid);
+    iNmPrivateMessageEnvelope->mMessageId.setPluginId32((quint32)aMessageId.PluginId().iUid);
 
     // construct the CFSMailAddress object and connect it with NmAddress private data
     iSender = CFSMailAddress::NewL(iNmPrivateMessageEnvelope->mSender);
@@ -120,11 +120,11 @@
     FUNC_LOG;
 // <qmail>
     //For message  
-    TFSMailMsgId id = TFSMailMsgId(iNmPrivateMessageEnvelope->mId);
+    TFSMailMsgId id = TFSMailMsgId(iNmPrivateMessageEnvelope->mMessageId);
     
     //For message part
     if(id.IsNullId()){
-        id = TFSMailMsgId(iNmPrivateMessageEnvelope->mParentId);
+        id = TFSMailMsgId(iNmPrivateMessageEnvelope->mFolderId);
     }
 	
     return id;
@@ -138,10 +138,11 @@
 EXPORT_C void CFSMailMessageBase::SetMessageId( const TFSMailMsgId aMessageId )
 {
     // typedef long int TInt32 -> typedef unsigned int quint32
-    iNmPrivateMessageEnvelope->mId.setId32( aMessageId.Id() );
+    iNmPrivateMessageEnvelope->mMessageId.setId32( aMessageId.Id() );
 
     // typedef unsigned int TUint -> typedef unsigned int quint32
-    iNmPrivateMessageEnvelope->mId.setPluginId32((unsigned int)aMessageId.PluginId().iUid);
+    iNmPrivateMessageEnvelope->mMessageId.setPluginId32(
+            (unsigned int)aMessageId.PluginId().iUid);
 }
 //</qmail>
 
@@ -152,7 +153,7 @@
 {
     FUNC_LOG;
 // <qmail>
-    return TFSMailMsgId(iNmPrivateMessageEnvelope->mParentId);
+    return TFSMailMsgId(iNmPrivateMessageEnvelope->mFolderId);
 // </qmail>
 }
 
@@ -163,7 +164,7 @@
 {
     FUNC_LOG;
 // <qmail>
-    iNmPrivateMessageEnvelope->mParentId = NmConverter::mailMsgIdToNmId(aFolderId);
+    iNmPrivateMessageEnvelope->mFolderId = NmConverter::mailMsgIdToNmId(aFolderId);
 // </qmail>
 }
 
@@ -483,7 +484,7 @@
     {
     FUNC_LOG;
     if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(
-		iNmPrivateMessageEnvelope->mId ) )
+		iNmPrivateMessageEnvelope->mMessageId ) )
         {
         // If plugin has created the extension, let it handle destruction.
         plugin->ReleaseExtension( aExtension );
@@ -508,7 +509,7 @@
         // check that plugin supports requested extension.
 // <qmail>
         if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(
-			iNmPrivateMessageEnvelope->mId ) )
+			iNmPrivateMessageEnvelope->mMessageId ) )
 // </qmail>
             {
             // request extension from plugin, leaves if not supported
--- a/emailservices/emailcommon/src/CFSMailMessagePart.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/emailcommon/src/CFSMailMessagePart.cpp	Fri May 14 15:41:10 2010 +0300
@@ -91,8 +91,8 @@
 	
 	iNmPrivateMessagePart = new NmMessagePartPrivate();
 	
-	iNmPrivateMessagePart->mOwnId.setId32(aMessagePartId.Id());
-	iNmPrivateMessagePart->mOwnId.setPluginId32((quint32)aMessagePartId.PluginId().iUid);
+	iNmPrivateMessagePart->mPartId.setId32(aMessagePartId.Id());
+	iNmPrivateMessagePart->mPartId.setPluginId32((quint32)aMessagePartId.PluginId().iUid);
 		
 	iMessagePartsStatus = EFSDefault;
 
@@ -231,7 +231,7 @@
 {
     FUNC_LOG;
 //<qmail>
-    return TFSMailMsgId(iNmPrivateMessagePart->mOwnId);
+    return TFSMailMsgId(iNmPrivateMessagePart->mPartId);
 //</qmail>	
 }
 
@@ -1030,7 +1030,15 @@
 		
 //<qmail>
 	    buffer = HBufC::NewL(length);
-	    buffer->Des().Append(KFSMailContentDispAttachment);
+	    if (ContentDisposition().FindF(KFSMailContentDispInline) != KErrNotFound)
+	        {
+            buffer->Des().Append(KFSMailContentDispInline);
+	        }
+	    else
+	        {
+            buffer->Des().Append(KFSMailContentDispAttachment);
+	        }
+	    
 	    buffer->Des().Append(_L("; "));
 	    buffer->Des().Append(KFSMailContentDispParamFilename);
 	    buffer->Des().Append('"');
--- a/emailservices/emailstore/base_plugin/BWINS/basepluginU.DEF	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/emailstore/base_plugin/BWINS/basepluginU.DEF	Fri May 14 15:41:10 2010 +0300
@@ -220,4 +220,6 @@
 	?ExtensionL@CBaseMrInfoObject@@UAEPAXVTUid@@@Z @ 219 NONAME ; void * CBaseMrInfoObject::ExtensionL(class TUid)
 	?TranslateMsgStorePropsL@CBasePlugin@@MAEXABVTFSMailMsgId@@AAVCMsgStorePropertyContainer@@AAVCFSMailMessagePart@@W4TFSMailDetails@@@Z @ 220 NONAME ; void CBasePlugin::TranslateMsgStorePropsL(class TFSMailMsgId const &, class CMsgStorePropertyContainer &, class CFSMailMessagePart &, enum TFSMailDetails)
 	?GetMailboxDisplayNameL@CBasePlugin@@IAEXIAAVRBuf16@@@Z @ 221 NONAME ; void CBasePlugin::GetMailboxDisplayNameL(unsigned int, class RBuf16 &)
+	?NewChildPartFromFileL@CBasePlugin@@UAEXABVTFSMailMsgId@@000ABVTDesC16@@1AAVMFSMailRequestObserver@@H@Z @ 222 NONAME ; void CBasePlugin::NewChildPartFromFileL(class TFSMailMsgId const &, class TFSMailMsgId const &, class TFSMailMsgId const &, class TFSMailMsgId const &, class TDesC16 const &, class TDesC16 const &, class MFSMailRequestObserver &, int)
+	?RemoveChildPartL@CBasePlugin@@UAEXABVTFSMailMsgId@@0000AAVMFSMailRequestObserver@@H@Z @ 223 NONAME ; void CBasePlugin::RemoveChildPartL(class TFSMailMsgId const &, class TFSMailMsgId const &, class TFSMailMsgId const &, class TFSMailMsgId const &, class TFSMailMsgId const &, class MFSMailRequestObserver &, int)
 
--- a/emailservices/emailstore/base_plugin/EABI/basepluginU.DEF	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/emailstore/base_plugin/EABI/basepluginU.DEF	Fri May 14 15:41:10 2010 +0300
@@ -307,4 +307,6 @@
 	_ZThn4_NK21CBaseMrRecurrenceRule19RecurrenceStartTimeEv @ 306 NONAME
 	_ZThn4_NK21CBaseMrRecurrenceRule20RecurrentDaysofMonthEv @ 307 NONAME
 	_ZThn4_NK21CBaseMrRecurrenceRule4TypeEv @ 308 NONAME
+	_ZN11CBasePlugin21NewChildPartFromFileLERK12TFSMailMsgIdS2_S2_S2_RK7TDesC16S5_R22MFSMailRequestObserveri @ 309 NONAME
+	_ZN11CBasePlugin16RemoveChildPartLERK12TFSMailMsgIdS2_S2_S2_S2_R22MFSMailRequestObserveri @ 310 NONAME
 
--- a/emailservices/emailstore/base_plugin/inc/BasePlugin.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/emailstore/base_plugin/inc/BasePlugin.h	Fri May 14 15:41:10 2010 +0300
@@ -83,7 +83,9 @@
     friend class CDelayedDeleteMessagesOp;
     friend class CDelayedSetContentOp;
     friend class CDelayedMessageStorerOp;
-
+	// <qmail>
+    friend class CDelayedAddNewOrRemoveChildPartOp;
+	// </qmail>
 	protected:
     struct TOngoingFetchInfo;
     struct TCacheLine
@@ -293,6 +295,16 @@
         	const TFSMailMsgId& aMessageId,
             const TFSMailMsgId& aParentPartId,
             const TFSMailMsgId& aPartId );
+         // <qmail>
+         virtual void RemoveChildPartL(
+             const TFSMailMsgId& aMailBoxId,
+             const TFSMailMsgId& aParentFolderId,
+             const TFSMailMsgId& aMessageId,
+             const TFSMailMsgId& aParentPartId,
+             const TFSMailMsgId& aPartId,
+             MFSMailRequestObserver& aOperationObserver,
+             const TInt aRequestId );
+         // </qmail>
 
          virtual void SetPartContentFromFileL(
             const TFSMailMsgId& aMailBoxId,
@@ -420,7 +432,17 @@
 		    const TFSMailMsgId& aParentPartId,
 			const TDesC& aContentType,
 		    RFile& aFile );
-
+	     // <qmail>
+	     virtual void NewChildPartFromFileL(
+	         const TFSMailMsgId& aMailBoxId,
+	         const TFSMailMsgId& aParentFolderId,
+	         const TFSMailMsgId& aMessageId,
+	         const TFSMailMsgId& aParentPartId,
+	         const TDesC& aContentType,
+	         const TDesC& aFilePath, 
+	         MFSMailRequestObserver& aOperationObserver,
+	         const TInt aRequestId );
+	     // </qmail>
          virtual TInt WizardDataAvailableL();
 
          virtual void AuthenticateL(
--- a/emailservices/emailstore/base_plugin/inc/baseplugindelayedopsprivate.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/emailstore/base_plugin/inc/baseplugindelayedopsprivate.h	Fri May 14 15:41:10 2010 +0300
@@ -278,6 +278,75 @@
 
     __LOG_DECLARATION
     };
+/**
+ * 
+ */
+NONSHARABLE_CLASS( CDelayedAddNewOrRemoveChildPartOp ) : public CDelayedOp
+    {
+
+public:
+
+    static CDelayedAddNewOrRemoveChildPartOp* NewLC( const TFSMailMsgId& aMailBoxId,
+            const TFSMailMsgId& aParentFolderId ,
+            const TFSMailMsgId& aMessageId,
+            const TFSMailMsgId& aParentPartId ,
+            const TDesC& aContentType,
+            const TDesC& aFilePath,
+            MFSMailRequestObserver& aOperationObserver,
+            const TInt aRequestId);
+    
+    static CDelayedAddNewOrRemoveChildPartOp* NewLC( const TFSMailMsgId& aMailBoxId,
+               const TFSMailMsgId& aParentFolderId ,
+               const TFSMailMsgId& aMessageId,
+               const TFSMailMsgId& aParentPartId ,
+               const TFSMailMsgId& aPartId,
+               MFSMailRequestObserver& aOperationObserver,
+               const TInt aRequestId);
+
+    virtual ~CDelayedAddNewOrRemoveChildPartOp();
+
+    //CDelayedOp::ExecuteOpL
+    virtual void ExecuteOpL();
+    
+private:
+
+    void ConstructL( const TDesC& aContentType, const TDesC& aFilePath );
+       
+    CDelayedAddNewOrRemoveChildPartOp( const TFSMailMsgId& aMailBoxId,
+            const TFSMailMsgId& aParentFolderId ,
+            const TFSMailMsgId& aMessageId,
+            const TFSMailMsgId& aParentPartId ,
+            MFSMailRequestObserver& aOperationObserver,
+            const TInt aRequestId);
+    
+    CDelayedAddNewOrRemoveChildPartOp( const TFSMailMsgId& aMailBoxId,
+                const TFSMailMsgId& aParentFolderId ,
+                const TFSMailMsgId& aMessageId,
+                const TFSMailMsgId& aParentPartId ,
+                const TFSMailMsgId& aPartId ,
+                MFSMailRequestObserver& aOperationObserver,
+                const TInt aRequestId);
+        
+    CDelayedAddNewOrRemoveChildPartOp& operator= ( const CDelayedAddNewOrRemoveChildPartOp& );    
+    
+private:
+    enum TActionType 
+          {
+          AddNewChild = 0,
+          RemoveChild
+          };
+    TFSMailMsgId iMailBoxId;
+    TFSMailMsgId iParentFolderId;
+    TFSMailMsgId iMessageId;
+    TFSMailMsgId iParentPartId;
+    TFSMailMsgId iPartId;
+    HBufC* iContentType;
+    HBufC* iFilePath;
+    MFSMailRequestObserver& iOperationObserver;
+    TInt iRequestId;
+    TInt iActionType;
+    __LOG_DECLARATION
+    };
 //</qmail>
 
 #endif // BASEPLUGINDELAYEDOPSPRIVATE_H
--- a/emailservices/emailstore/base_plugin/src/baseplugindelayedops.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/emailstore/base_plugin/src/baseplugindelayedops.cpp	Fri May 14 15:41:10 2010 +0300
@@ -794,4 +794,161 @@
     
     __LOG_EXIT;
     }
+
+
+///////////////////////////////////////////////////
+// CDelayedAddNewOrRemoveChildPartOp             //
+///////////////////////////////////////////////////
+
+/**
+ * 
+ */
+/*public static */ CDelayedAddNewOrRemoveChildPartOp* CDelayedAddNewOrRemoveChildPartOp::NewLC(
+    const TFSMailMsgId& aMailBoxId,
+    const TFSMailMsgId& aParentFolderId ,
+    const TFSMailMsgId& aMessageId,
+    const TFSMailMsgId& aParentPartId ,
+    const TDesC& aContentType,
+    const TDesC& aFilePath,
+    MFSMailRequestObserver& aOperationObserver,
+    const TInt aRequestId)
+    {
+    CDelayedAddNewOrRemoveChildPartOp* self = new (ELeave) CDelayedAddNewOrRemoveChildPartOp(
+            aMailBoxId, aParentFolderId, aMessageId,aParentPartId,
+            aOperationObserver,aRequestId);
+    CleanupStack::PushL( self );
+    self->ConstructL( aContentType, aFilePath );
+    return self;
+    }
+
+/**
+ * 
+ */
+/*public static */ CDelayedAddNewOrRemoveChildPartOp* CDelayedAddNewOrRemoveChildPartOp::NewLC(
+    const TFSMailMsgId& aMailBoxId,
+    const TFSMailMsgId& aParentFolderId ,
+    const TFSMailMsgId& aMessageId,
+    const TFSMailMsgId& aParentPartId ,
+    const TFSMailMsgId& aPartId ,
+    MFSMailRequestObserver& aOperationObserver,
+    const TInt aRequestId)
+    {
+    CDelayedAddNewOrRemoveChildPartOp* self = new (ELeave) CDelayedAddNewOrRemoveChildPartOp(
+            aMailBoxId, aParentFolderId, aMessageId,aParentPartId,
+            aPartId,aOperationObserver, aRequestId);
+    CleanupStack::PushL( self );
+    return self;
+    }
+
+/**
+ * 
+ */
+/*public virtual*/ CDelayedAddNewOrRemoveChildPartOp::CDelayedAddNewOrRemoveChildPartOp(
+    const TFSMailMsgId& aMailBoxId,
+    const TFSMailMsgId& aParentFolderId ,
+    const TFSMailMsgId& aMessageId,
+    const TFSMailMsgId& aParentPartId ,
+    MFSMailRequestObserver& aOperationObserver,
+    const TInt aRequestId) :
+    iMailBoxId( aMailBoxId ),
+    iParentFolderId( aParentFolderId ),
+    iMessageId( aMessageId ),
+    iParentPartId( aParentPartId ),
+    iOperationObserver( aOperationObserver ),
+    iRequestId( aRequestId ),
+    iActionType( AddNewChild)
+    {
+    }
+
+/**
+ * 
+ */
+/*public virtual*/ CDelayedAddNewOrRemoveChildPartOp::CDelayedAddNewOrRemoveChildPartOp(
+    const TFSMailMsgId& aMailBoxId,
+    const TFSMailMsgId& aParentFolderId ,
+    const TFSMailMsgId& aMessageId,
+    const TFSMailMsgId& aParentPartId ,
+    const TFSMailMsgId& aPartId ,
+    MFSMailRequestObserver& aOperationObserver,
+    const TInt aRequestId) :
+    iMailBoxId( aMailBoxId ),
+    iParentFolderId( aParentFolderId ),
+    iMessageId( aMessageId ),
+    iParentPartId( aParentPartId ),
+    iPartId( aPartId ),
+    iOperationObserver( aOperationObserver ),
+    iRequestId( aRequestId ),
+    iActionType( RemoveChild)
+    {
+    }
+
+/**
+ * 
+ */
+/*public virtual*/ CDelayedAddNewOrRemoveChildPartOp::~CDelayedAddNewOrRemoveChildPartOp()
+    {
+    __LOG_DESTRUCT
+    if ( iContentType )
+        {
+        delete iContentType;
+        }
+    if ( iFilePath )
+        {
+        delete iFilePath;
+        } 
+    }
+	
+/**
+ * 
+ */
+/*private*/
+void CDelayedAddNewOrRemoveChildPartOp::ConstructL( const TDesC& aContentType, const TDesC& aFilePath )
+    {
+    __LOG_CONSTRUCT( "baseplugin", "CDelayedAddNewOrRemoveChildPartOp" );      
+    iContentType = aContentType.AllocL();
+    iFilePath = aFilePath.AllocL();                 
+    }
+
+/**
+ * 
+ */
+/*private*/ void CDelayedAddNewOrRemoveChildPartOp::ExecuteOpL()
+    {
+    __LOG_ENTER( "ExecuteOpL" );
+    
+    TFSProgress progress = { TFSProgress::EFSStatus_RequestCancelled, 0, 0, 0 };
+    progress.iError = KErrNotFound;
+    TInt err(KErrNone);
+    
+    if( iActionType == AddNewChild)
+        {
+        CFSMailMessagePart* tmp = NULL;
+        TRAP(err, tmp = GetPlugin().NewChildPartFromFileL(iMailBoxId,iParentFolderId,
+                    iMessageId,iParentPartId,iContentType->Des(),iFilePath->Des()));
+        if(err == KErrNone )
+            {
+            tmp->SetAttachmentNameL( iFilePath->Des() );
+            tmp->SaveL();
+            }
+        //iOperationObserver will make a copy of pointer "tmp" and will own the memory.
+        progress.iParam = tmp;
+        }
+    else
+        {
+        TRAP(err, GetPlugin().RemoveChildPartL(iMailBoxId,iParentFolderId,
+                    iMessageId,iParentPartId,iPartId)); 
+        }
+
+    if( err == KErrNone )
+        {
+        //clear plugin cache so that childparts of message can be updated next time with proper count
+        GetPlugin().ResetCache();
+        progress.iError = KErrNone;
+        progress.iProgressStatus = TFSProgress::EFSStatus_RequestComplete;
+        }
+		
+    iOperationObserver.RequestResponseL( progress, iRequestId );
+    
+    __LOG_EXIT;
+    }
 //</qmail>
--- a/emailservices/emailstore/base_plugin/src/basepluginparts.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/emailstore/base_plugin/src/basepluginparts.cpp	Fri May 14 15:41:10 2010 +0300
@@ -107,6 +107,28 @@
     CleanupStack::PopAndDestroy( message );
     }
 
+// <qmail>
+/**
+ *
+ */
+EXPORT_C void CBasePlugin::RemoveChildPartL(
+    const TFSMailMsgId&  aMailBoxId ,
+    const TFSMailMsgId&  aParentFolderId ,
+    const TFSMailMsgId&  aMessageId,
+    const TFSMailMsgId&  aParentPartId ,
+    const TFSMailMsgId&  aPartId,
+    MFSMailRequestObserver& aOperationObserver,
+    const TInt aRequestId )
+    {
+    //Asynchronous operation to remove child part.
+    //CDelayedAddNewOrRemoveChildPartOp::ExecuteOpL will eventually delete childpart 
+    CDelayedAddNewOrRemoveChildPartOp* op = CDelayedAddNewOrRemoveChildPartOp::NewLC(
+            aMailBoxId, aParentFolderId , aMessageId, aParentPartId,  aPartId,
+            aOperationObserver, aRequestId);
+    iDelayedOpsManager->EnqueueOpL( op );
+    CleanupStack::Pop( op );
+    }
+// </qmail>
 
 /**
  *
@@ -432,6 +454,31 @@
     } //NewChildPartFromFileL.
 
 
+// <qmail>
+/**
+ *
+ */
+EXPORT_C void CBasePlugin::NewChildPartFromFileL(
+    const TFSMailMsgId& aMailBoxId,
+    const TFSMailMsgId& aParentFolderId ,
+    const TFSMailMsgId& aMessageId,
+    const TFSMailMsgId& aParentPartId ,
+    const TDesC& aContentType,
+    const TDesC& aFilePath,
+    MFSMailRequestObserver& aOperationObserver,
+    const TInt aRequestId )
+    {
+    //Asynchronous operation to add child part.
+    //CDelayedAddNewOrRemoveChildPartOp::ExecuteOpL will eventually add childpart 
+    CDelayedAddNewOrRemoveChildPartOp* op = CDelayedAddNewOrRemoveChildPartOp::NewLC(
+            aMailBoxId, aParentFolderId , aMessageId, aParentPartId,  aContentType,
+            aFilePath, aOperationObserver, aRequestId);
+    iDelayedOpsManager->EnqueueOpL( op );
+    CleanupStack::Pop( op );
+
+    }
+
+// </qmail> 
 /**
  *
  */
--- a/emailservices/nmailagent/inc/nmmailagent.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmailagent/inc/nmmailagent.h	Fri May 14 15:41:10 2010 +0300
@@ -30,6 +30,7 @@
     NmId mId;
     int mIndicatorIndex;
     QString mName;
+    QString mIconName;
     NmId mInboxFolderId;
     NmId mOutboxFolderId;
     NmSyncState mSyncState;
@@ -37,7 +38,7 @@
     int mInboxCreatedMessages;
     int mInboxChangedMessages;
     int mInboxDeletedMessages;
-    int mUnreadMails;
+    QList<NmId> mUnreadMailIdList;
     int mOutboxMails;
     bool mActive;
 
@@ -74,19 +75,19 @@
     void handleConnectionEvent(NmConnectState state, const NmId mailboxId);
 
     void delayedStart();
+    
+    void enableAlertTone();
 
 private:
 
     void initMailboxStatus();
 
-    int getUnreadCount(const NmId& mailboxId, int maxCount);
+    bool updateUnreadCount(const NmId &mailboxId, NmMailboxInfo &mailboxInfo);
 
     int getOutboxCount(const NmId& mailboxId);
 
     int getIndicatorIndex();
 
-    bool isMailboxActive(const NmMailboxInfo& mailboxInfo);
-
     bool updateIndicator(bool active,
         const NmMailboxInfo& mailboxInfo);
 
@@ -103,12 +104,18 @@
         bool active, bool refreshAlways);
 
     static QStringList pluginFolders();
-
+    
+    bool getMessageUnreadInfo(const NmId &folderId, 
+        const NmId &messageId, const NmId &mailboxId, bool &unreadMessage);
+    
+    void playAlertTone();
+    
 private: // data
 
     NmDataPluginFactory *mPluginFactory;
     QList<NmMailboxInfo*> mMailboxes;
     bool mSendingState;
+    bool mAlertToneAllowed;
 };
 
 
--- a/emailservices/nmailagent/inc/nmmailagentheaders.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmailagent/inc/nmmailagentheaders.h	Fri May 14 15:41:10 2010 +0300
@@ -29,5 +29,7 @@
 #include <nmdataplugininterface.h>
 #include <nmmailbox.h>
 #include <nmmessageenvelope.h>
+#include <nmmessage.h>
+#include <emailmailboxinfo.h>
 
 #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmailagent/inc/ssastartupwatcher.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef __SSASTARTUPWATCHER_H__
+#define __SSASTARTUPWATCHER_H__
+
+#include <e32base.h>
+#include <startup.hrh>          // For start-up states
+#include <startupdomaindefs.h>  // For start-up domains
+#include <domaindefs.h>
+#include <domainmember.h>       // For CDmDomain
+
+typedef void (*TStartupCallBack)(TInt aValue);
+
+/*!
+    This class interacts with the Domain Manager to be kept aware of the current
+    system startup state.
+*/
+class CSSAStartupWatcher : public CDmDomain
+{
+
+public:
+	static CSSAStartupWatcher* NewL(TStartupCallBack aCallback);
+	static CSSAStartupWatcher* New(TStartupCallBack aCallback);
+	virtual ~CSSAStartupWatcher();
+
+private:
+	CSSAStartupWatcher(TDmHierarchyId aHierarchyId, 
+	    TDmDomainId aDomainId,TStartupCallBack aCallback);
+	void ConstructL();
+	
+	virtual void RunL();                   // from CActive
+	
+	void NotifyState(TInt aValue); 
+
+private:
+	
+	TStartupCallBack iCallback; 
+};
+
+#endif // __SSASTARTUPWATCHER_H__
--- a/emailservices/nmailagent/nmailagent.pro	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmailagent/nmailagent.pro	Fri May 14 15:41:10 2010 +0300
@@ -26,36 +26,37 @@
 
 MOC_DIR = moc
 
-INCLUDEPATH += . \
-               ../../inc \
-               ../nmclientapi/inc \
-               ../../emailuis/nmframeworkadapter/inc \
-               ../../emailuis/nmailuiengine/inc
+INCLUDEPATH += ../../inc
 
 HEADERS   += inc/nmmailagent.h \
-             inc/nmmailagentheaders.h
+             inc/nmmailagentheaders.h \
+             inc/ssastartupwatcher.h
     
 SOURCES   += src/main.cpp \
-             src/nmmailagent.cpp
+             src/nmmailagent.cpp \
+             src/ssastartupwatcher.cpp
 
 LIBS += -lnmailbase
 LIBS += -lnmailuiengine
+LIBS += -lnmutilities
 LIBS += -llibc
 
 symbian*: { 
     INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-
+    INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
     BLD_INF_RULES.prj_exports += "rom/nmailagent.iby $$CORE_APP_LAYER_IBY_EXPORT_PATH(nmailagent.iby)"
 
     TARGET.EPOCHEAPSIZE = 0x1000 0x100000 // MAX 1MB
 
+    LIBS += -ldomaincli
+
     TARGET.UID2 = 0x100039CE
     TARGET.UID3 = 0x2002C326
     TARGET.CAPABILITY = CAP_APPLICATION
 }
 
 win32 {
-   DESTDIR = ../../bin
+    DESTDIR = ../../bin
 }
 
 
--- a/emailservices/nmailagent/src/main.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmailagent/src/main.cpp	Fri May 14 15:41:10 2010 +0300
@@ -14,10 +14,9 @@
 * Description:
 *
 */
-
-
 #include "nmmailagentheaders.h"
 #include "nmmailagent.h"
+#include "ssastartupwatcher.h"
 
 #ifdef __WINSCW__
 const int NmStartupDelay = 14000; // 14s
@@ -25,17 +24,38 @@
 const int NmStartupDelay = 4000; // 4s
 #endif
 
+NmMailAgent *agent = NULL;
 
 /*!
-	int main
+    Callback for reporting startup state
+*/
+static void startupCallback(int status)
+{
+    NMLOG(QString("nmailagent: startupCallback %1").arg(status));
+    Q_UNUSED(status);
+
+    // either it is an error or 'non critical startup' state has been reached
+    // Start the agent in both cases
+    QTimer::singleShot(NmStartupDelay, agent, SLOT(delayedStart()));
+}
+
+/*!
+	main
 */
 int main(int argc, char *argv[])
 {
     QCoreApplication app(argc, argv);
-    NmMailAgent agent;
+
+    agent = new NmMailAgent;
 
-    // Agent will be initialised with a delay to avoid startup problems
-    QTimer::singleShot(NmStartupDelay, &agent, SLOT(delayedStart()));
+    CSSAStartupWatcher *startupWatcher = CSSAStartupWatcher::New(startupCallback);
+    if (!startupWatcher) {
+        NMLOG("nmmailagent - watcher start failed");
+        QTimer::singleShot(NmStartupDelay, agent, SLOT(delayedStart()));
+    }
 
-    return app.exec();
+    int retValue = app.exec();
+    delete startupWatcher;
+    delete agent;
+    return retValue;
 }
--- a/emailservices/nmailagent/src/nmmailagent.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmailagent/src/nmmailagent.cpp	Fri May 14 15:41:10 2010 +0300
@@ -19,8 +19,8 @@
 #include "nmmailagent.h"
 
 // CONSTS
-const int NmAgentMaxUnreadCount = 1; // 1 is enough
 const int NmAgentIndicatorNotSet = -1;
+const int NmAgentAlertToneTimer = 60000; // 60s
 
 
 /*!
@@ -35,7 +35,6 @@
     mIndicatorIndex = NmAgentIndicatorNotSet;
     mSyncState = SyncComplete;
     mConnectState = Disconnected;
-    mUnreadMails = 0;
     mOutboxMails = 0;
     mInboxFolderId = 0;
     mOutboxFolderId = 0;
@@ -47,7 +46,8 @@
 
 NmMailAgent::NmMailAgent() :
  mPluginFactory(NULL),
- mSendingState(false)
+ mSendingState(false),
+ mAlertToneAllowed(true)
 {
     NMLOG("NmMailAgent::NmMailAgent");
 }
@@ -139,13 +139,15 @@
             if (mailbox) {
                 NmMailboxInfo *mailboxInfo = createMailboxInfo(*mailbox,plugin);
                 if (mailboxInfo) {
-                    mailboxInfo->mUnreadMails = getUnreadCount(mailbox->id(),NmAgentMaxUnreadCount);
+                    bool activate = updateUnreadCount(mailbox->id(), *mailboxInfo);
                     mailboxInfo->mOutboxMails = getOutboxCount(mailbox->id());
+                    if (mailboxInfo->mOutboxMails > 0) {
+                        activate = true;
+                    }
 
                     // Create indicator for visible mailboxes
                     updateMailboxState(mailbox->id(),
-                        isMailboxActive(*mailboxInfo),
-                        false);
+                        activate, false);
                 }
             }
         }
@@ -156,13 +158,13 @@
 /*!
     Get mailbox unread count in inbox folder
     \param mailboxId id of the mailbox
-    \param maxCount max number of unread mails that is needed
-    \return number of unread mails in the mailbox
+    \param mailboxInfo contains the list of unread messages
+    \return true if new unread mails was found
 */
-int NmMailAgent::getUnreadCount(const NmId &mailboxId, int maxCount)
+bool NmMailAgent::updateUnreadCount(const NmId &mailboxId, NmMailboxInfo &mailboxInfo)
 {
     NMLOG("NmMailAgent::getUnreadCount");
-    int count(0);
+    int newUnreadMessages(0);
 
     NmDataPluginInterface *plugin = mPluginFactory->interfaceInstance(mailboxId);
 
@@ -175,22 +177,35 @@
 		QList<NmMessageEnvelope*> messageList;
 		plugin->listMessages(mailboxId, inboxId, messageList);
 
+		QList<NmId> newUnreadMessageIdList;
 		foreach (const NmMessageEnvelope* envelope, messageList) {
-			// if the message is not read, it is "unread"
+		    // if the message is not read, it is "unread"
 			if (!envelope->isRead()) {
-				count++;
+		        quint64 messageId = envelope->messageId().id();
+			    newUnreadMessageIdList.append(envelope->messageId());
+			    bool found(false);
+			    // Iterate through all known ids. If the id can't be found the mail is new.
+			    foreach (const NmId id, mailboxInfo.mUnreadMailIdList) {
+			        if (id.id() == messageId) {
+			            found = true;
+			            break;
+			        }
+			    }
 
-				// No more unread mails are needed
-				if (count >= maxCount) {
-					break;
-				}
+			    if (!found) {
+			        newUnreadMessages++;
+			    }
 			}
 		}
 		qDeleteAll(messageList);
+
+		// Save updated list of unread message IDs
+        mailboxInfo.mUnreadMailIdList = newUnreadMessageIdList;
     }
-	NMLOG(QString("NmMailAgent::getUnreadCount count=%1").arg(count));
+	NMLOG(QString("NmMailAgent::getUnreadCount count=%1 new=%2").
+	    arg(mailboxInfo.mUnreadMailIdList.count()).arg(newUnreadMessages));
 
-    return count;
+    return (newUnreadMessages > 0);
 }
 
 /*!
@@ -266,19 +281,6 @@
 }
 
 /*!
-    Check if the mailbox indicator should be active, according to current state
-    \param mailboxInfo information of the mailbox
-    \return true if indicator should be now active
-*/
-bool NmMailAgent::isMailboxActive(const NmMailboxInfo& mailboxInfo)
-{
-    if (mailboxInfo.mUnreadMails>0 || mailboxInfo.mOutboxMails>0) {
-        return true;
-    }
-    return false;
-}
-
-/*!
     Updates indicator status
     \param mailboxIndex index of the item shown in indicator menu
     \param active indicator visibility state
@@ -288,8 +290,8 @@
 bool NmMailAgent::updateIndicator(bool active,
     const NmMailboxInfo& mailboxInfo)
 {
-    NMLOG(QString("NmMailAgent::updateIndicator index=%1 active=%2 unread=%3").
-        arg(mailboxInfo.mIndicatorIndex).arg(active).arg(mailboxInfo.mUnreadMails));
+    NMLOG(QString("NmMailAgent::updateIndicator index=%1 active=%2").
+        arg(mailboxInfo.mIndicatorIndex).arg(active));
 
     bool ok = false;
     QString name = QString("com.nokia.nmail.indicatorplugin_%1/1.0").
@@ -298,10 +300,11 @@
     QList<QVariant> list;
     list.append(mailboxInfo.mId.id());
     list.append(mailboxInfo.mName);
-    list.append(mailboxInfo.mUnreadMails);
+    list.append(mailboxInfo.mUnreadMailIdList.count());
     list.append(mailboxInfo.mSyncState);
     list.append(mailboxInfo.mConnectState);
     list.append(mailboxInfo.mOutboxMails);
+    list.append(mailboxInfo.mIconName);
     list.append(mSendingState);
 
     HbIndicator indicator;
@@ -396,15 +399,41 @@
 {
     NMLOG(QString("NmMailAgent::handleMessageEvent %1 %2").arg(event).arg(mailboxId.id()));
     bool updateNeeded = false;
+    bool activate = false;
 
     switch (event) {
         case NmMessageCreated: {
             NmMailboxInfo *mailboxInfo = getMailboxInfo(mailboxId);
-            
+
+            // Check the new messages to make the indicator appear earlier
+            if (mailboxInfo->mSyncState == Synchronizing &&
+                mailboxInfo->mUnreadMailIdList.count()==0) {
+
+                // Inbox folder ID may be still unknown
+                if (mailboxInfo->mInboxFolderId.id()==0) {
+                    NmDataPluginInterface *plugin = mPluginFactory->interfaceInstance(mailboxId);
+                    if (plugin) {
+                        mailboxInfo->mInboxFolderId =
+                            plugin->getStandardFolderId(mailboxId, NmFolderInbox);
+                    }
+                }
+
+                if (folderId == mailboxInfo->mInboxFolderId) {
+                    bool messageUnread = false;
+                    foreach (NmId messageId, messageIds) {
+                        if (getMessageUnreadInfo(folderId, messageId, mailboxId, messageUnread)) {
+                            if (messageUnread) {
+                                mailboxInfo->mUnreadMailIdList.append(messageId);
+                                updateMailboxState(mailboxId, true, false);
+                            }
+                        }
+                    }
+                }
+            }
             if (folderId==mailboxInfo->mInboxFolderId) {
                 mailboxInfo->mInboxCreatedMessages++;
             }
-            
+
             // When created a new mail in the outbox, we are in sending state
             if (mailboxInfo->mOutboxFolderId == folderId) {
                 // The first mail created in the outbox
@@ -417,17 +446,22 @@
         }
         case NmMessageChanged: {
             NmMailboxInfo *mailboxInfo = getMailboxInfo(mailboxId);
-            
+
             if (folderId==mailboxInfo->mInboxFolderId) {
                 mailboxInfo->mInboxChangedMessages++;
             }
-            
+
             // If not currently syncronizing the mailbox, this may mean
             // that a message was read/unread
             if (mailboxInfo && mailboxInfo->mSyncState==SyncComplete) {
                 // check the unread status again
-                mailboxInfo->mUnreadMails = getUnreadCount(mailboxId,NmAgentMaxUnreadCount);
-                updateNeeded = true;
+                int oldCount = mailboxInfo->mUnreadMailIdList.count();
+                activate = updateUnreadCount(mailboxId, *mailboxInfo);
+
+                // new unread mails found or no more unread mails in the mailbox
+                if (activate || (oldCount>0 && mailboxInfo->mUnreadMailIdList.count()==0)) {
+                    updateNeeded = true;
+                }
             }
 			break;
 		}
@@ -437,7 +471,7 @@
             if (folderId==mailboxInfo->mInboxFolderId) {
                 mailboxInfo->mInboxDeletedMessages++;
             }
-            
+
             // Deleted mails from the outbox
             if (mailboxInfo->mOutboxFolderId == folderId) {
                 mailboxInfo->mOutboxMails -= messageIds.count();
@@ -449,6 +483,8 @@
 
                 // The last mail was now deleted
                 if (mailboxInfo->mOutboxMails == 0) {
+                    // Keep it active if there is unread mails
+                    activate = mailboxInfo->mUnreadMailIdList.count() > 0;
                     updateNeeded = true;
                 }
             }
@@ -461,7 +497,7 @@
     if (updateNeeded) {
         NmMailboxInfo *mailboxInfo = getMailboxInfo(mailboxId);
         updateMailboxState(mailboxId,
-            isMailboxActive(*mailboxInfo), true /* force refresh */);
+            activate, true /* force refresh */);
     }
 }
 
@@ -477,25 +513,35 @@
     NmMailboxInfo *info = getMailboxInfo(event.mMailboxId);
     if (info) {
         info->mSyncState = state;
-        
+
         if (state==Synchronizing) {
             // Reset counters when sync is started
             info->mInboxCreatedMessages = 0;
             info->mInboxChangedMessages = 0;
             info->mInboxDeletedMessages = 0;
-        } 
+        }
         else if (state==SyncComplete) {
             // Check the unread status here again
-            info->mUnreadMails = getUnreadCount(event.mMailboxId,NmAgentMaxUnreadCount);
+            bool activate = updateUnreadCount(event.mMailboxId, *info);
+            int oldOutboxCount = info->mOutboxMails;
+            info->mOutboxMails = getOutboxCount(event.mMailboxId);
+            if (info->mOutboxMails > oldOutboxCount) {
+                // new mails in outbox
+                activate = true;
+            }
+            bool active = info->mUnreadMailIdList.count() ||
+                info->mOutboxMails;
 
             // Refresh the indicator if messages created or changed
-            NMLOG(QString(" created=%1, changed=%1, deleted=%1").
+            NMLOG(QString(" created=%1, changed=%2, deleted=%3").
                 arg(info->mInboxCreatedMessages).
                 arg(info->mInboxChangedMessages).
                 arg(info->mInboxDeletedMessages));
             bool refresh = (info->mInboxCreatedMessages > 0) || (info->mInboxChangedMessages > 0);
 
-            updateMailboxState(event.mMailboxId, isMailboxActive(*info), refresh);
+            if (activate) {
+                updateMailboxState(event.mMailboxId, active, refresh);
+            }
         }
     }
 }
@@ -559,7 +605,7 @@
     Create a new mailbox info with given parameters
     \return new mailbox info object
 */
-NmMailboxInfo *NmMailAgent::createMailboxInfo(const NmMailbox& mailbox,NmDataPluginInterface *plugin)
+NmMailboxInfo *NmMailAgent::createMailboxInfo(const NmMailbox &mailbox, NmDataPluginInterface *plugin)
 {
     NmMailboxInfo *mailboxInfo = new NmMailboxInfo();
     mailboxInfo->mId = mailbox.id();
@@ -570,7 +616,7 @@
     // Subscribe to get all mailbox events
     plugin->subscribeMailboxEvents(mailboxInfo->mId);
 
-    // get inbox folder ID
+    // get inbox folder ID. It might be still unknown (=0).
     mailboxInfo->mInboxFolderId = plugin->getStandardFolderId(
         mailbox.id(), NmFolderInbox );
 
@@ -578,6 +624,18 @@
     mailboxInfo->mOutboxFolderId = plugin->getStandardFolderId(
         mailbox.id(), NmFolderOutbox );
 
+    // Get branded mailbox icon
+    NmMailbox mailbox2( mailbox );
+    QString domainName = mailbox2.address().address();
+    int delimIndex = domainName.indexOf('@');
+    if( delimIndex >= 0 ) {
+        domainName = domainName.mid(delimIndex+1);
+        NMLOG(QString("Mailbox domain name: %1").arg(domainName));
+    }
+    EmailMailboxInfo emailMailboxInfo;
+    mailboxInfo->mIconName =
+        emailMailboxInfo.mailboxIcon(domainName);
+    
     return mailboxInfo;
 }
 
@@ -597,5 +655,56 @@
     return createMailboxInfo(id);
 }
 
+/*!
+    Finds out if the message is unread.
+    \param folderId the id of the folder that includes the message
+    \param messageIds the message ids that are checked
+    \param mailboxId the id of the mailbox that includes the message
+    \param unreadMessage true if there was unread messages
+    \return true if info fetching was successful
+*/
+bool NmMailAgent::getMessageUnreadInfo(const NmId &folderId,
+    const NmId &messageId, const NmId &mailboxId, bool &unreadMessage)
+{
+    NMLOG("NmMailAgent::messageInfo");
+
+    NmDataPluginInterface *plugin = mPluginFactory->interfaceInstance(mailboxId);
+    bool ok = false;
+
+    if (plugin) {
+        NmMessage *message=NULL;
+        plugin->getMessageById(mailboxId, folderId, messageId, message);
+        if (message) {
+            ok = true;
+            NmMessageEnvelope envelope = message->envelope();
+            if (!envelope.isRead()) {
+                unreadMessage = true;
+            }
+            delete message;
+        }
+    }
+    return ok;
+}
+
+/*!
+    Plays email alert tune when new messages arrive
+*/
+void NmMailAgent::playAlertTone()
+{
+    if (mAlertToneAllowed) {
+        // play alert
+        mAlertToneAllowed = false;
+        QTimer::singleShot(NmAgentAlertToneTimer, this, SLOT(enableAlertTone()));
+    }
+}
+
+/*!
+    Allows alert tune to be played again
+*/
+void NmMailAgent::enableAlertTone()
+{
+    mAlertToneAllowed = true;
+}
+
 // End of file
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmailagent/src/ssastartupwatcher.cpp	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,126 @@
+// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+#include "ssastartupwatcher.h"
+
+/*!
+    Factory function to create a new instance of the CSSAStartupWatcher
+    \return new CSSAStartupWatcher object
+*/
+CSSAStartupWatcher* CSSAStartupWatcher::NewL(TStartupCallBack aCallback)
+{
+	CSSAStartupWatcher* self = new (ELeave) CSSAStartupWatcher(KDmHierarchyIdStartup, 
+	    KSM2AppServicesDomain3, aCallback);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+}
+
+/*!
+    Factory function to create a new instance of the CSSAStartupWatcher
+    \return new CSSAStartupWatcher object
+*/
+CSSAStartupWatcher* CSSAStartupWatcher::New(TStartupCallBack aCallback)
+{
+    CSSAStartupWatcher* self = NULL;
+    TRAP_IGNORE( self = NewL(aCallback); );
+    return self;
+}
+
+/*!
+    Constructor of CWatcherSSAStartupMgr
+
+    \param aHierarchyId The Id of the domain hierarchy to connect to
+    \param aDomainId The Id of the domain to connect to
+*/
+CSSAStartupWatcher::CSSAStartupWatcher(TDmHierarchyId aHierarchyId, 
+    TDmDomainId aDomainId, TStartupCallBack aCallback)
+: CDmDomain(aHierarchyId,aDomainId), 
+  iCallback(aCallback)
+{
+}
+
+/*!
+    Destructor
+*/
+CSSAStartupWatcher::~CSSAStartupWatcher()
+{
+	Cancel();
+}
+
+/**
+Second-stage constructor.
+
+This method indicates how the CWatcherSSAStartupMgr interacts with the
+Domain manager to keep aware of the startup state change.
+*/
+void CSSAStartupWatcher::ConstructL()
+{
+	// Connect to the Domain Manager
+	CDmDomain::ConstructL();
+
+	// Get the start-up state from the Domain Manager.
+	TDmDomainState state = GetState();
+
+	// Something wrong with the Domain Manager
+	if( state <= EStartupStateUndefined ) {
+	    User::Leave(KErrNotReady);
+	}
+
+	// Already passed the non critical state
+	if( state >= EStartupStateNonCritical ) {
+	    NotifyState(state);
+	}
+	else {
+	    RequestTransitionNotification();
+	}
+}
+
+/*!
+    Notify state change
+*/
+void CSSAStartupWatcher::NotifyState(TInt aValue) 
+{
+    (*iCallback)(aValue);
+}
+
+/*!
+    Executed when the startup state change is done, it does the same thing
+    as the method InitialiseL().
+*/
+void CSSAStartupWatcher::RunL()
+{
+	// Leave if our previous request to be notified a state change has
+	// returned an error and let RunError handle this.
+	if (iStatus.Int()!=KErrNone) {
+	    NotifyState( iStatus.Int() );
+	}
+	else {
+	    // Get the start-up state from the Domain Manager.
+	    TDmDomainState state = GetState();
+
+	    // Reached the non critical startup state
+	    if( state >= EStartupStateNonCritical ) {
+	        NotifyState(state);
+	    }
+	    else {
+	        AcknowledgeLastState(KErrNone);
+	        RequestTransitionNotification();
+	    }
+	}
+}
+
+// End of file
--- a/emailservices/nmailbase/bwins/nmailbaseu.def	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmailbase/bwins/nmailbaseu.def	Fri May 14 15:41:10 2010 +0300
@@ -1,36 +1,36 @@
 EXPORTS
 	??0NmMailboxPrivate@@QAE@XZ @ 1 NONAME ; NmMailboxPrivate::NmMailboxPrivate(void)
-	??0NmMessagePart@@QAE@V?$QExplicitlySharedDataPointer@VNmMessagePartPrivate@@@@@Z @ 2 NONAME ; NmMessagePart::NmMessagePart(class QExplicitlySharedDataPointer<class NmMessagePartPrivate>)
-	?setParentId@NmFolder@@QAEXVNmId@@@Z @ 3 NONAME ; void NmFolder::setParentId(class NmId)
-	?lastUpdated@NmFolder@@QBE?AVQDateTime@@XZ @ 4 NONAME ; class QDateTime NmFolder::lastUpdated(void) const
-	?messageCount@NmFolder@@QBEIXZ @ 5 NONAME ; unsigned int NmFolder::messageCount(void) const
+	?setParentId@NmFolder@@QAEXVNmId@@@Z @ 2 NONAME ; void NmFolder::setParentId(class NmId)
+	?lastUpdated@NmFolder@@QBE?AVQDateTime@@XZ @ 3 NONAME ; class QDateTime NmFolder::lastUpdated(void) const
+	?messageCount@NmFolder@@QBEIXZ @ 4 NONAME ; unsigned int NmFolder::messageCount(void) const
+	?folderId@NmMessageEnvelope@@QBE?AVNmId@@XZ @ 5 NONAME ; class NmId NmMessageEnvelope::folderId(void) const
 	?clearCcRecipients@NmMessageEnvelope@@QAEXXZ @ 6 NONAME ; void NmMessageEnvelope::clearCcRecipients(void)
-	?htmlBodyPart@NmMessage@@QBEPBVNmMessagePart@@XZ @ 7 NONAME ; class NmMessagePart const * NmMessage::htmlBodyPart(void) const
-	?findContentPart@NmMessagePart@@IBEPBV1@ABVQString@@@Z @ 8 NONAME ; class NmMessagePart const * NmMessagePart::findContentPart(class QString const &) const
-	?subFolderCount@NmFolder@@QBEIXZ @ 9 NONAME ; unsigned int NmFolder::subFolderCount(void) const
-	?isMessage@NmMessagePart@@QBE_NXZ @ 10 NONAME ; bool NmMessagePart::isMessage(void) const
-	?setSender@NmMessageEnvelope@@QAEXABVNmAddress@@@Z @ 11 NONAME ; void NmMessageEnvelope::setSender(class NmAddress const &)
-	?priority@NmMessageEnvelope@@QBE?AW4NmMessagePriority@@XZ @ 12 NONAME ; enum NmMessagePriority NmMessageEnvelope::priority(void) const
-	?attachmentName@NmMessagePart@@QBE?AVQString@@XZ @ 13 NONAME ; class QString NmMessagePart::attachmentName(void) const
-	??1NmFolder@@UAE@XZ @ 14 NONAME ; NmFolder::~NmFolder(void)
-	??4NmFolder@@QAEAAV0@ABV0@@Z @ 15 NONAME ; class NmFolder & NmFolder::operator=(class NmFolder const &)
-	?setMailboxId@NmMessagePart@@QAEXABVNmId@@@Z @ 16 NONAME ; void NmMessagePart::setMailboxId(class NmId const &)
-	?setContentType@NmMessagePart@@QAEXABVQString@@@Z @ 17 NONAME ; void NmMessagePart::setContentType(class QString const &)
-	?setParentId@NmMessagePart@@QAEXABVNmId@@@Z @ 18 NONAME ; void NmMessagePart::setParentId(class NmId const &)
-	??_ENmMessageEnvelopePrivate@@UAE@I@Z @ 19 NONAME ; NmMessageEnvelopePrivate::~NmMessageEnvelopePrivate(unsigned int)
-	?setFlag@NmMessageEnvelopePrivate@@QAEXW4NmMessageFlag@@_N@Z @ 20 NONAME ; void NmMessageEnvelopePrivate::setFlag(enum NmMessageFlag, bool)
-	?setLastUpdated@NmFolder@@QAEXVQDateTime@@@Z @ 21 NONAME ; void NmFolder::setLastUpdated(class QDateTime)
-	?setCcRecipients@NmMessageEnvelope@@QAEXV?$QList@VNmAddress@@@@@Z @ 22 NONAME ; void NmMessageEnvelope::setCcRecipients(class QList<class NmAddress>)
-	?binaryContent@NmMessagePart@@QBEABVQByteArray@@XZ @ 23 NONAME ; class QByteArray const & NmMessagePart::binaryContent(void) const
-	?flags@NmMessageEnvelopePrivate@@QBE?AV?$QFlags@W4NmMessageFlag@@@@XZ @ 24 NONAME ; class QFlags<enum NmMessageFlag> NmMessageEnvelopePrivate::flags(void) const
-	?toRecipients@NmMessageEnvelope@@QBEAAV?$QList@VNmAddress@@@@XZ @ 25 NONAME ; class QList<class NmAddress> & NmMessageEnvelope::toRecipients(void) const
-	??0NmAddress@@QAE@XZ @ 26 NONAME ; NmAddress::NmAddress(void)
-	?setSubject@NmMessageEnvelope@@QAEXABVQString@@@Z @ 27 NONAME ; void NmMessageEnvelope::setSubject(class QString const &)
-	?envelope@NmMessage@@QBEABVNmMessageEnvelope@@XZ @ 28 NONAME ; class NmMessageEnvelope const & NmMessage::envelope(void) const
-	??0NmMessagePart@@QAE@ABVNmId@@@Z @ 29 NONAME ; NmMessagePart::NmMessagePart(class NmId const &)
-	?textContent@NmMessagePart@@QBEABVQString@@XZ @ 30 NONAME ; class QString const & NmMessagePart::textContent(void) const
-	?clearToRecipients@NmMessageEnvelope@@QAEXXZ @ 31 NONAME ; void NmMessageEnvelope::clearToRecipients(void)
-	?address@NmMailbox@@QAE?AVNmAddress@@XZ @ 32 NONAME ; class NmAddress NmMailbox::address(void)
+	??1NmMessagePrivate@@UAE@XZ @ 7 NONAME ; NmMessagePrivate::~NmMessagePrivate(void)
+	??0NmMessagePart@@IAE@V?$QExplicitlySharedDataPointer@VNmMessagePartPrivate@@@@@Z @ 8 NONAME ; NmMessagePart::NmMessagePart(class QExplicitlySharedDataPointer<class NmMessagePartPrivate>)
+	?htmlBodyPart@NmMessage@@QBEPBVNmMessagePart@@XZ @ 9 NONAME ; class NmMessagePart const * NmMessage::htmlBodyPart(void) const
+	?findContentPart@NmMessagePart@@IBEPBV1@ABVQString@@@Z @ 10 NONAME ; class NmMessagePart const * NmMessagePart::findContentPart(class QString const &) const
+	?subFolderCount@NmFolder@@QBEIXZ @ 11 NONAME ; unsigned int NmFolder::subFolderCount(void) const
+	?isMessage@NmMessagePart@@QBE_NXZ @ 12 NONAME ; bool NmMessagePart::isMessage(void) const
+	?setSender@NmMessageEnvelope@@QAEXABVNmAddress@@@Z @ 13 NONAME ; void NmMessageEnvelope::setSender(class NmAddress const &)
+	?priority@NmMessageEnvelope@@QBE?AW4NmMessagePriority@@XZ @ 14 NONAME ; enum NmMessagePriority NmMessageEnvelope::priority(void) const
+	??0NmMessage@@AAE@ABVNmMessageEnvelope@@V?$QExplicitlySharedDataPointer@VNmMessagePartPrivate@@@@@Z @ 15 NONAME ; NmMessage::NmMessage(class NmMessageEnvelope const &, class QExplicitlySharedDataPointer<class NmMessagePartPrivate>)
+	?attachmentName@NmMessagePart@@QBE?AVQString@@XZ @ 16 NONAME ; class QString NmMessagePart::attachmentName(void) const
+	??1NmFolder@@UAE@XZ @ 17 NONAME ; NmFolder::~NmFolder(void)
+	??4NmFolder@@QAEAAV0@ABV0@@Z @ 18 NONAME ; class NmFolder & NmFolder::operator=(class NmFolder const &)
+	?setContentType@NmMessagePart@@QAEXABVQString@@@Z @ 19 NONAME ; void NmMessagePart::setContentType(class QString const &)
+	??_ENmMessageEnvelopePrivate@@UAE@I@Z @ 20 NONAME ; NmMessageEnvelopePrivate::~NmMessageEnvelopePrivate(unsigned int)
+	?setFlag@NmMessageEnvelopePrivate@@QAEXW4NmMessageFlag@@_N@Z @ 21 NONAME ; void NmMessageEnvelopePrivate::setFlag(enum NmMessageFlag, bool)
+	?setLastUpdated@NmFolder@@QAEXVQDateTime@@@Z @ 22 NONAME ; void NmFolder::setLastUpdated(class QDateTime)
+	?setCcRecipients@NmMessageEnvelope@@QAEXV?$QList@VNmAddress@@@@@Z @ 23 NONAME ; void NmMessageEnvelope::setCcRecipients(class QList<class NmAddress>)
+	?binaryContent@NmMessagePart@@QBEABVQByteArray@@XZ @ 24 NONAME ; class QByteArray const & NmMessagePart::binaryContent(void) const
+	?flags@NmMessageEnvelopePrivate@@QBE?AV?$QFlags@W4NmMessageFlag@@@@XZ @ 25 NONAME ; class QFlags<enum NmMessageFlag> NmMessageEnvelopePrivate::flags(void) const
+	?toRecipients@NmMessageEnvelope@@QBEAAV?$QList@VNmAddress@@@@XZ @ 26 NONAME ; class QList<class NmAddress> & NmMessageEnvelope::toRecipients(void) const
+	??0NmAddress@@QAE@XZ @ 27 NONAME ; NmAddress::NmAddress(void)
+	?setSubject@NmMessageEnvelope@@QAEXABVQString@@@Z @ 28 NONAME ; void NmMessageEnvelope::setSubject(class QString const &)
+	?envelope@NmMessage@@QBEABVNmMessageEnvelope@@XZ @ 29 NONAME ; class NmMessageEnvelope const & NmMessage::envelope(void) const
+	??0NmMessagePart@@QAE@ABVNmId@@@Z @ 30 NONAME ; NmMessagePart::NmMessagePart(class NmId const &)
+	?textContent@NmMessagePart@@QBEABVQString@@XZ @ 31 NONAME ; class QString const & NmMessagePart::textContent(void) const
+	?clearToRecipients@NmMessageEnvelope@@QAEXXZ @ 32 NONAME ; void NmMessageEnvelope::clearToRecipients(void)
 	??0NmMessageEnvelopePrivate@@QAE@XZ @ 33 NONAME ; NmMessageEnvelopePrivate::NmMessageEnvelopePrivate(void)
 	??4NmAddress@@QAEAAV0@ABV0@@Z @ 34 NONAME ; class NmAddress & NmAddress::operator=(class NmAddress const &)
 	??0NmMessage@@QAE@ABVNmMessagePart@@@Z @ 35 NONAME ; NmMessage::NmMessage(class NmMessagePart const &)
@@ -46,42 +46,42 @@
 	?isTextContent@NmMessagePartPrivate@@QBE_NXZ @ 45 NONAME ; bool NmMessagePartPrivate::isTextContent(void) const
 	??0NmMessage@@QAE@ABVNmMessageEnvelope@@@Z @ 46 NONAME ; NmMessage::NmMessage(class NmMessageEnvelope const &)
 	?setDisplayName@NmAddress@@QAEXABVQString@@@Z @ 47 NONAME ; void NmAddress::setDisplayName(class QString const &)
-	?id@NmMessagePart@@UBE?AVNmId@@XZ @ 48 NONAME ; class NmId NmMessagePart::id(void) const
-	?folderType@NmFolder@@QBE?AW4NmFolderType@@XZ @ 49 NONAME ; enum NmFolderType NmFolder::folderType(void) const
-	??_ENmAddressPrivate@@UAE@I@Z @ 50 NONAME ; NmAddressPrivate::~NmAddressPrivate(unsigned int)
-	??0NmMessageEnvelope@@QAE@V?$QExplicitlySharedDataPointer@VNmMessageEnvelopePrivate@@@@@Z @ 51 NONAME ; NmMessageEnvelope::NmMessageEnvelope(class QExplicitlySharedDataPointer<class NmMessageEnvelopePrivate>)
-	??0NmMessage@@QAE@ABV0@@Z @ 52 NONAME ; NmMessage::NmMessage(class NmMessage const &)
-	?setBccRecipients@NmMessageEnvelope@@QAEXV?$QList@VNmAddress@@@@@Z @ 53 NONAME ; void NmMessageEnvelope::setBccRecipients(class QList<class NmAddress>)
-	??1NmMessageEnvelope@@UAE@XZ @ 54 NONAME ; NmMessageEnvelope::~NmMessageEnvelope(void)
-	?plainTextBodyPart@NmMessage@@QAEPAVNmMessagePart@@XZ @ 55 NONAME ; class NmMessagePart * NmMessage::plainTextBodyPart(void)
-	??0NmMessagePart@@QAE@XZ @ 56 NONAME ; NmMessagePart::NmMessagePart(void)
-	?id@NmMailbox@@QBE?AVNmId@@XZ @ 57 NONAME ; class NmId NmMailbox::id(void) const
-	??0NmMessagePartPrivate@@QAE@XZ @ 58 NONAME ; NmMessagePartPrivate::NmMessagePartPrivate(void)
-	??0NmFolderPrivate@@QAE@XZ @ 59 NONAME ; NmFolderPrivate::NmFolderPrivate(void)
-	?setUnseenCount@NmFolder@@QAEXI@Z @ 60 NONAME ; void NmFolder::setUnseenCount(unsigned int)
-	??9NmAddress@@QBE_NABV0@@Z @ 61 NONAME ; bool NmAddress::operator!=(class NmAddress const &) const
-	?setFlags@NmMessageEnvelopePrivate@@QAEXV?$QFlags@W4NmMessageFlag@@@@_N@Z @ 62 NONAME ; void NmMessageEnvelopePrivate::setFlags(class QFlags<enum NmMessageFlag>, bool)
-	??1NmMailbox@@UAE@XZ @ 63 NONAME ; NmMailbox::~NmMailbox(void)
-	??_ENmFolder@@UAE@I@Z @ 64 NONAME ; NmFolder::~NmFolder(unsigned int)
-	?isRead@NmMessageEnvelope@@QBE_NXZ @ 65 NONAME ; bool NmMessageEnvelope::isRead(void) const
+	?folderType@NmFolder@@QBE?AW4NmFolderType@@XZ @ 48 NONAME ; enum NmFolderType NmFolder::folderType(void) const
+	??_ENmAddressPrivate@@UAE@I@Z @ 49 NONAME ; NmAddressPrivate::~NmAddressPrivate(unsigned int)
+	??0NmMessageEnvelope@@QAE@V?$QExplicitlySharedDataPointer@VNmMessageEnvelopePrivate@@@@@Z @ 50 NONAME ; NmMessageEnvelope::NmMessageEnvelope(class QExplicitlySharedDataPointer<class NmMessageEnvelopePrivate>)
+	??0NmMessage@@QAE@ABV0@@Z @ 51 NONAME ; NmMessage::NmMessage(class NmMessage const &)
+	?setBccRecipients@NmMessageEnvelope@@QAEXV?$QList@VNmAddress@@@@@Z @ 52 NONAME ; void NmMessageEnvelope::setBccRecipients(class QList<class NmAddress>)
+	??1NmMessageEnvelope@@UAE@XZ @ 53 NONAME ; NmMessageEnvelope::~NmMessageEnvelope(void)
+	?plainTextBodyPart@NmMessage@@QAEPAVNmMessagePart@@XZ @ 54 NONAME ; class NmMessagePart * NmMessage::plainTextBodyPart(void)
+	??0NmMessagePart@@QAE@XZ @ 55 NONAME ; NmMessagePart::NmMessagePart(void)
+	?id@NmMailbox@@QBE?AVNmId@@XZ @ 56 NONAME ; class NmId NmMailbox::id(void) const
+	??0NmMessagePartPrivate@@QAE@XZ @ 57 NONAME ; NmMessagePartPrivate::NmMessagePartPrivate(void)
+	??0NmFolderPrivate@@QAE@XZ @ 58 NONAME ; NmFolderPrivate::NmFolderPrivate(void)
+	?setUnseenCount@NmFolder@@QAEXI@Z @ 59 NONAME ; void NmFolder::setUnseenCount(unsigned int)
+	??9NmAddress@@QBE_NABV0@@Z @ 60 NONAME ; bool NmAddress::operator!=(class NmAddress const &) const
+	?setFlags@NmMessageEnvelopePrivate@@QAEXV?$QFlags@W4NmMessageFlag@@@@_N@Z @ 61 NONAME ; void NmMessageEnvelopePrivate::setFlags(class QFlags<enum NmMessageFlag>, bool)
+	??1NmMailbox@@UAE@XZ @ 62 NONAME ; NmMailbox::~NmMailbox(void)
+	??_ENmFolder@@UAE@I@Z @ 63 NONAME ; NmFolder::~NmFolder(unsigned int)
+	?isRead@NmMessageEnvelope@@QBE_NXZ @ 64 NONAME ; bool NmMessageEnvelope::isRead(void) const
+	?address@NmMailbox@@QBE?AVNmAddress@@XZ @ 65 NONAME ; class NmAddress NmMailbox::address(void) const
 	?mailboxId@NmFolder@@QBE?AVNmId@@XZ @ 66 NONAME ; class NmId NmFolder::mailboxId(void) const
 	?clearBccRecipients@NmMessageEnvelope@@QAEXXZ @ 67 NONAME ; void NmMessageEnvelope::clearBccRecipients(void)
 	??0NmAddress@@QAE@ABV0@@Z @ 68 NONAME ; NmAddress::NmAddress(class NmAddress const &)
 	?address@NmAddress@@QBE?AVQString@@XZ @ 69 NONAME ; class QString NmAddress::address(void) const
 	?setRead@NmMessageEnvelope@@QAEX_N@Z @ 70 NONAME ; void NmMessageEnvelope::setRead(bool)
 	?setPriority@NmMessageEnvelope@@QAEXW4NmMessagePriority@@@Z @ 71 NONAME ; void NmMessageEnvelope::setPriority(enum NmMessagePriority)
-	?parentId@NmMessageEnvelope@@QBE?AVNmId@@XZ @ 72 NONAME ; class NmId NmMessageEnvelope::parentId(void) const
-	??4NmMessage@@AAEAAV0@ABV0@@Z @ 73 NONAME ; class NmMessage & NmMessage::operator=(class NmMessage const &)
-	??_ENmMessagePartPrivate@@UAE@I@Z @ 74 NONAME ; NmMessagePartPrivate::~NmMessagePartPrivate(unsigned int)
-	?setUnreadMessageCount@NmFolder@@QAEXI@Z @ 75 NONAME ; void NmFolder::setUnreadMessageCount(unsigned int)
-	?hasAttachments@NmMessageEnvelope@@QBE_NXZ @ 76 NONAME ; bool NmMessageEnvelope::hasAttachments(void) const
-	?contentDescription@NmMessagePart@@QBE?AVQString@@XZ @ 77 NONAME ; class QString NmMessagePart::contentDescription(void) const
-	?flags@NmMessageEnvelope@@QBE?AV?$QFlags@W4NmMessageFlag@@@@XZ @ 78 NONAME ; class QFlags<enum NmMessageFlag> NmMessageEnvelope::flags(void) const
-	?isReplied@NmMessageEnvelope@@QBE_NXZ @ 79 NONAME ; bool NmMessageEnvelope::isReplied(void) const
-	?displayName@NmAddress@@QBE?AVQString@@XZ @ 80 NONAME ; class QString NmAddress::displayName(void) const
-	?setSubFolderCount@NmFolder@@QAEXI@Z @ 81 NONAME ; void NmFolder::setSubFolderCount(unsigned int)
-	?subject@NmMessageEnvelope@@QBE?AVQString@@XZ @ 82 NONAME ; class QString NmMessageEnvelope::subject(void) const
-	?setSize@NmMessagePart@@QAEXI@Z @ 83 NONAME ; void NmMessagePart::setSize(unsigned int)
+	??4NmMessage@@AAEAAV0@ABV0@@Z @ 72 NONAME ; class NmMessage & NmMessage::operator=(class NmMessage const &)
+	??_ENmMessagePartPrivate@@UAE@I@Z @ 73 NONAME ; NmMessagePartPrivate::~NmMessagePartPrivate(unsigned int)
+	?setUnreadMessageCount@NmFolder@@QAEXI@Z @ 74 NONAME ; void NmFolder::setUnreadMessageCount(unsigned int)
+	?hasAttachments@NmMessageEnvelope@@QBE_NXZ @ 75 NONAME ; bool NmMessageEnvelope::hasAttachments(void) const
+	?contentDescription@NmMessagePart@@QBE?AVQString@@XZ @ 76 NONAME ; class QString NmMessagePart::contentDescription(void) const
+	?flags@NmMessageEnvelope@@QBE?AV?$QFlags@W4NmMessageFlag@@@@XZ @ 77 NONAME ; class QFlags<enum NmMessageFlag> NmMessageEnvelope::flags(void) const
+	?isReplied@NmMessageEnvelope@@QBE_NXZ @ 78 NONAME ; bool NmMessageEnvelope::isReplied(void) const
+	?displayName@NmAddress@@QBE?AVQString@@XZ @ 79 NONAME ; class QString NmAddress::displayName(void) const
+	?setSubFolderCount@NmFolder@@QAEXI@Z @ 80 NONAME ; void NmFolder::setSubFolderCount(unsigned int)
+	?subject@NmMessageEnvelope@@QBE?AVQString@@XZ @ 81 NONAME ; class QString NmMessageEnvelope::subject(void) const
+	?setSize@NmMessagePart@@QAEXI@Z @ 82 NONAME ; void NmMessagePart::setSize(unsigned int)
+	?setPartId@NmMessagePart@@UAEXABVNmId@@@Z @ 83 NONAME ; void NmMessagePart::setPartId(class NmId const &)
 	?contentId@NmMessagePart@@QAE?AVQString@@XZ @ 84 NONAME ; class QString NmMessagePart::contentId(void)
 	??_ENmMessagePart@@UAE@I@Z @ 85 NONAME ; NmMessagePart::~NmMessagePart(unsigned int)
 	?setBinaryContent@NmMessagePart@@QAEXABVQByteArray@@ABVQString@@@Z @ 86 NONAME ; void NmMessagePart::setBinaryContent(class QByteArray const &, class QString const &)
@@ -89,8 +89,8 @@
 	?setForwarded@NmMessageEnvelope@@QAEX_N@Z @ 88 NONAME ; void NmMessageEnvelope::setForwarded(bool)
 	??0NmMessage@@QAE@ABVNmId@@00@Z @ 89 NONAME ; NmMessage::NmMessage(class NmId const &, class NmId const &, class NmId const &)
 	??1NmFolderPrivate@@UAE@XZ @ 90 NONAME ; NmFolderPrivate::~NmFolderPrivate(void)
-	?setId@NmMessageEnvelope@@QAEXABVNmId@@@Z @ 91 NONAME ; void NmMessageEnvelope::setId(class NmId const &)
-	?findContentPart@NmMessagePart@@IAEPAV1@ABVQString@@@Z @ 92 NONAME ; class NmMessagePart * NmMessagePart::findContentPart(class QString const &)
+	?findContentPart@NmMessagePart@@IAEPAV1@ABVQString@@@Z @ 91 NONAME ; class NmMessagePart * NmMessagePart::findContentPart(class QString const &)
+	??_ENmMessagePrivate@@UAE@I@Z @ 92 NONAME ; NmMessagePrivate::~NmMessagePrivate(unsigned int)
 	?name@NmMailbox@@QBE?AVQString@@XZ @ 93 NONAME ; class QString NmMailbox::name(void) const
 	?isMessage@NmMessagePartPrivate@@QBE_NXZ @ 94 NONAME ; bool NmMessagePartPrivate::isMessage(void) const
 	?setChildParts@NmMessagePart@@QAEXV?$QList@PAVNmMessagePart@@@@@Z @ 95 NONAME ; void NmMessagePart::setChildParts(class QList<class NmMessagePart *>)
@@ -101,12 +101,12 @@
 	??0NmAddressPrivate@@QAE@XZ @ 100 NONAME ; NmAddressPrivate::NmAddressPrivate(void)
 	?setContentId@NmMessagePart@@QAEXABVQString@@@Z @ 101 NONAME ; void NmMessagePart::setContentId(class QString const &)
 	?setMessageCount@NmFolder@@QAEXI@Z @ 102 NONAME ; void NmFolder::setMessageCount(unsigned int)
-	??0NmMessagePart@@QAE@ABVNmId@@00@Z @ 103 NONAME ; NmMessagePart::NmMessagePart(class NmId const &, class NmId const &, class NmId const &)
+	?setMessageId@NmMessageEnvelope@@QAEXABVNmId@@@Z @ 103 NONAME ; void NmMessageEnvelope::setMessageId(class NmId const &)
 	??0NmMessage@@QAE@ABVNmId@@0@Z @ 104 NONAME ; NmMessage::NmMessage(class NmId const &, class NmId const &)
 	??0NmAddress@@QAE@ABVQString@@0@Z @ 105 NONAME ; NmAddress::NmAddress(class QString const &, class QString const &)
 	??8NmMessageEnvelope@@QBE_NABV0@@Z @ 106 NONAME ; bool NmMessageEnvelope::operator==(class NmMessageEnvelope const &) const
 	?setAttachmentName@NmMessagePart@@QAEXABVQString@@@Z @ 107 NONAME ; void NmMessagePart::setAttachmentName(class QString const &)
-	?setId@NmMessage@@UAEXABVNmId@@@Z @ 108 NONAME ; void NmMessage::setId(class NmId const &)
+	?messageId@NmMessageEnvelope@@QBE?AVNmId@@XZ @ 108 NONAME ; class NmId NmMessageEnvelope::messageId(void) const
 	?setName@NmFolder@@QAEXVQString@@@Z @ 109 NONAME ; void NmFolder::setName(class QString)
 	??0NmFolder@@QAE@V?$QExplicitlySharedDataPointer@VNmFolderPrivate@@@@@Z @ 110 NONAME ; NmFolder::NmFolder(class QExplicitlySharedDataPointer<class NmFolderPrivate>)
 	?setSentTime@NmMessageEnvelope@@QAEXABVQDateTime@@@Z @ 111 NONAME ; void NmMessageEnvelope::setSentTime(class QDateTime const &)
@@ -116,64 +116,59 @@
 	?htmlBodyPart@NmMessage@@QAEPAVNmMessagePart@@XZ @ 115 NONAME ; class NmMessagePart * NmMessage::htmlBodyPart(void)
 	??_ENmFolderPrivate@@UAE@I@Z @ 116 NONAME ; NmFolderPrivate::~NmFolderPrivate(unsigned int)
 	?name@NmFolder@@QBE?AVQString@@XZ @ 117 NONAME ; class QString NmFolder::name(void) const
-	?setAddress@NmMailbox@@QAEXAAVNmAddress@@@Z @ 118 NONAME ; void NmMailbox::setAddress(class NmAddress &)
+	?setFolderId@NmMessageEnvelope@@QAEXABVNmId@@@Z @ 118 NONAME ; void NmMessageEnvelope::setFolderId(class NmId const &)
 	??4NmMailbox@@QAEAAV0@ABV0@@Z @ 119 NONAME ; class NmMailbox & NmMailbox::operator=(class NmMailbox const &)
 	??0NmFolder@@QAE@VNmId@@@Z @ 120 NONAME ; NmFolder::NmFolder(class NmId)
-	?mailboxId@NmMessagePart@@QBE?AVNmId@@XZ @ 121 NONAME ; class NmId NmMessagePart::mailboxId(void) const
-	?setHasAttachments@NmMessageEnvelope@@QAEX_N@Z @ 122 NONAME ; void NmMessageEnvelope::setHasAttachments(bool)
-	?setParentId@NmMessageEnvelope@@QAEXABVNmId@@@Z @ 123 NONAME ; void NmMessageEnvelope::setParentId(class NmId const &)
-	?setMailboxId@NmFolder@@QAEXVNmId@@@Z @ 124 NONAME ; void NmFolder::setMailboxId(class NmId)
-	?envelope@NmMessage@@QAEAAVNmMessageEnvelope@@XZ @ 125 NONAME ; class NmMessageEnvelope & NmMessage::envelope(void)
-	?plainTextBodyPart@NmMessage@@QBEPBVNmMessagePart@@XZ @ 126 NONAME ; class NmMessagePart const * NmMessage::plainTextBodyPart(void) const
-	?setFolderType@NmFolder@@QAEXW4NmFolderType@@@Z @ 127 NONAME ; void NmFolder::setFolderType(enum NmFolderType)
-	?id@NmMessage@@UBE?AVNmId@@XZ @ 128 NONAME ; class NmId NmMessage::id(void) const
-	?setContentDescription@NmMessagePart@@QAEXABVQString@@@Z @ 129 NONAME ; void NmMessagePart::setContentDescription(class QString const &)
-	??8NmAddress@@QBE_NABV0@@Z @ 130 NONAME ; bool NmAddress::operator==(class NmAddress const &) const
-	??9NmMessageEnvelope@@QBE_NABV0@@Z @ 131 NONAME ; bool NmMessageEnvelope::operator!=(class NmMessageEnvelope const &) const
-	?mailboxId@NmMessageEnvelope@@QBE?AVNmId@@XZ @ 132 NONAME ; class NmId NmMessageEnvelope::mailboxId(void) const
-	?setToRecipients@NmMessageEnvelope@@QAEXV?$QList@VNmAddress@@@@@Z @ 133 NONAME ; void NmMessageEnvelope::setToRecipients(class QList<class NmAddress>)
-	??1NmMessage@@UAE@XZ @ 134 NONAME ; NmMessage::~NmMessage(void)
-	?size@NmMessagePart@@QBEIXZ @ 135 NONAME ; unsigned int NmMessagePart::size(void) const
-	??1NmAddressPrivate@@UAE@XZ @ 136 NONAME ; NmAddressPrivate::~NmAddressPrivate(void)
-	?sentTime@NmMessageEnvelope@@QBE?AVQDateTime@@XZ @ 137 NONAME ; class QDateTime NmMessageEnvelope::sentTime(void) const
-	?childParts@NmMessagePart@@QBEAAV?$QList@PAVNmMessagePart@@@@XZ @ 138 NONAME ; class QList<class NmMessagePart *> & NmMessagePart::childParts(void) const
-	??0NmMailbox@@QAE@ABV0@@Z @ 139 NONAME ; NmMailbox::NmMailbox(class NmMailbox const &)
-	??4NmMessageEnvelope@@QAEAAV0@ABV0@@Z @ 140 NONAME ; class NmMessageEnvelope & NmMessageEnvelope::operator=(class NmMessageEnvelope const &)
-	??1NmMessagePartPrivate@@UAE@XZ @ 141 NONAME ; NmMessagePartPrivate::~NmMessagePartPrivate(void)
-	??8NmMailbox@@QBE_NABV0@@Z @ 142 NONAME ; bool NmMailbox::operator==(class NmMailbox const &) const
-	??0NmMailbox@@QAE@V?$QExplicitlySharedDataPointer@VNmMailboxPrivate@@@@@Z @ 143 NONAME ; NmMailbox::NmMailbox(class QExplicitlySharedDataPointer<class NmMailboxPrivate>)
-	?unseenCount@NmFolder@@QBEIXZ @ 144 NONAME ; unsigned int NmFolder::unseenCount(void) const
-	?setEnvelope@NmMessage@@QAEXABVNmMessageEnvelope@@@Z @ 145 NONAME ; void NmMessage::setEnvelope(class NmMessageEnvelope const &)
-	?setId@NmMessagePart@@UAEXABVNmId@@@Z @ 146 NONAME ; void NmMessagePart::setId(class NmId const &)
-	?ccRecipients@NmMessageEnvelope@@QBEAAV?$QList@VNmAddress@@@@XZ @ 147 NONAME ; class QList<class NmAddress> & NmMessageEnvelope::ccRecipients(void) const
-	?sender@NmMessageEnvelope@@QBE?AVNmAddress@@XZ @ 148 NONAME ; class NmAddress NmMessageEnvelope::sender(void) const
-	?setContentDisposition@NmMessagePart@@QAEXABVQString@@@Z @ 149 NONAME ; void NmMessagePart::setContentDisposition(class QString const &)
-	?removeAllChildParts@NmMessagePart@@QAEXXZ @ 150 NONAME ; void NmMessagePart::removeAllChildParts(void)
-	?contentDisposition@NmMessagePart@@QBE?AVQString@@XZ @ 151 NONAME ; class QString NmMessagePart::contentDisposition(void) const
-	??_ENmMailboxPrivate@@UAE@I@Z @ 152 NONAME ; NmMailboxPrivate::~NmMailboxPrivate(unsigned int)
-	?parentId@NmFolder@@QBE?AVNmId@@XZ @ 153 NONAME ; class NmId NmFolder::parentId(void) const
-	?folderId@NmFolder@@QBE?AVNmId@@XZ @ 154 NONAME ; class NmId NmFolder::folderId(void) const
-	??1NmMessagePart@@UAE@XZ @ 155 NONAME ; NmMessagePart::~NmMessagePart(void)
-	??0NmMessagePart@@IAE@ABV0@@Z @ 156 NONAME ; NmMessagePart::NmMessagePart(class NmMessagePart const &)
-	??0NmAddress@@QAE@V?$QExplicitlySharedDataPointer@VNmAddressPrivate@@@@@Z @ 157 NONAME ; NmAddress::NmAddress(class QExplicitlySharedDataPointer<class NmAddressPrivate>)
-	?addChildPart@NmMessagePart@@QAEXPAV1@@Z @ 158 NONAME ; void NmMessagePart::addChildPart(class NmMessagePart *)
-	?isFlagSet@NmMessageEnvelopePrivate@@QBE_NW4NmMessageFlag@@@Z @ 159 NONAME ; bool NmMessageEnvelopePrivate::isFlagSet(enum NmMessageFlag) const
-	??_ENmMessageEnvelope@@UAE@I@Z @ 160 NONAME ; NmMessageEnvelope::~NmMessageEnvelope(unsigned int)
-	??_ENmMessage@@UAE@I@Z @ 161 NONAME ; NmMessage::~NmMessage(unsigned int)
-	?parentId@NmMessagePart@@QBE?AVNmId@@XZ @ 162 NONAME ; class NmId NmMessagePart::parentId(void) const
-	?contentType@NmMessagePart@@QBE?AVQString@@XZ @ 163 NONAME ; class QString NmMessagePart::contentType(void) const
-	?id@NmMessageEnvelope@@QBE?AVNmId@@XZ @ 164 NONAME ; class NmId NmMessageEnvelope::id(void) const
-	??1NmMessageEnvelopePrivate@@UAE@XZ @ 165 NONAME ; NmMessageEnvelopePrivate::~NmMessageEnvelopePrivate(void)
-	?setAddress@NmAddress@@QAEXABVQString@@@Z @ 166 NONAME ; void NmAddress::setAddress(class QString const &)
-	?isForwarded@NmMessageEnvelope@@QBE_NXZ @ 167 NONAME ; bool NmMessageEnvelope::isForwarded(void) const
-	??1NmAddress@@UAE@XZ @ 168 NONAME ; NmAddress::~NmAddress(void)
-	?setReplied@NmMessageEnvelope@@QAEX_N@Z @ 169 NONAME ; void NmMessageEnvelope::setReplied(bool)
-	?attachmentList@NmMessage@@QBEXAAV?$QList@PAVNmMessagePart@@@@@Z @ 170 NONAME ; void NmMessage::attachmentList(class QList<class NmMessagePart *> &) const
-	??0NmMessageEnvelope@@QAE@ABVNmId@@@Z @ 171 NONAME ; NmMessageEnvelope::NmMessageEnvelope(class NmId const &)
-	??0NmFolder@@QAE@ABV0@@Z @ 172 NONAME ; NmFolder::NmFolder(class NmFolder const &)
-	??0NmMessage@@QAE@XZ @ 173 NONAME ; NmMessage::NmMessage(void)
-	??0NmMessagePart@@QAE@ABVNmId@@0@Z @ 174 NONAME ; NmMessagePart::NmMessagePart(class NmId const &, class NmId const &)
-	?setFetchedSize@NmMessagePart@@QAEXI@Z @ 175 NONAME ; void NmMessagePart::setFetchedSize(unsigned int)
-	??0NmMessageEnvelope@@QAE@XZ @ 176 NONAME ; NmMessageEnvelope::NmMessageEnvelope(void)
-	??4NmMessagePart@@AAEAAV0@ABV0@@Z @ 177 NONAME ; class NmMessagePart & NmMessagePart::operator=(class NmMessagePart const &)
+	?setHasAttachments@NmMessageEnvelope@@QAEX_N@Z @ 121 NONAME ; void NmMessageEnvelope::setHasAttachments(bool)
+	?setMailboxId@NmFolder@@QAEXVNmId@@@Z @ 122 NONAME ; void NmFolder::setMailboxId(class NmId)
+	?envelope@NmMessage@@QAEAAVNmMessageEnvelope@@XZ @ 123 NONAME ; class NmMessageEnvelope & NmMessage::envelope(void)
+	?plainTextBodyPart@NmMessage@@QBEPBVNmMessagePart@@XZ @ 124 NONAME ; class NmMessagePart const * NmMessage::plainTextBodyPart(void) const
+	?setFolderType@NmFolder@@QAEXW4NmFolderType@@@Z @ 125 NONAME ; void NmFolder::setFolderType(enum NmFolderType)
+	?setContentDescription@NmMessagePart@@QAEXABVQString@@@Z @ 126 NONAME ; void NmMessagePart::setContentDescription(class QString const &)
+	??8NmAddress@@QBE_NABV0@@Z @ 127 NONAME ; bool NmAddress::operator==(class NmAddress const &) const
+	??9NmMessageEnvelope@@QBE_NABV0@@Z @ 128 NONAME ; bool NmMessageEnvelope::operator!=(class NmMessageEnvelope const &) const
+	?mailboxId@NmMessageEnvelope@@QBE?AVNmId@@XZ @ 129 NONAME ; class NmId NmMessageEnvelope::mailboxId(void) const
+	?setToRecipients@NmMessageEnvelope@@QAEXV?$QList@VNmAddress@@@@@Z @ 130 NONAME ; void NmMessageEnvelope::setToRecipients(class QList<class NmAddress>)
+	??1NmMessage@@UAE@XZ @ 131 NONAME ; NmMessage::~NmMessage(void)
+	?size@NmMessagePart@@QBEIXZ @ 132 NONAME ; unsigned int NmMessagePart::size(void) const
+	??1NmAddressPrivate@@UAE@XZ @ 133 NONAME ; NmAddressPrivate::~NmAddressPrivate(void)
+	?sentTime@NmMessageEnvelope@@QBE?AVQDateTime@@XZ @ 134 NONAME ; class QDateTime NmMessageEnvelope::sentTime(void) const
+	?childParts@NmMessagePart@@QBEAAV?$QList@PAVNmMessagePart@@@@XZ @ 135 NONAME ; class QList<class NmMessagePart *> & NmMessagePart::childParts(void) const
+	?partId@NmMessagePart@@UBE?AVNmId@@XZ @ 136 NONAME ; class NmId NmMessagePart::partId(void) const
+	??0NmMailbox@@QAE@ABV0@@Z @ 137 NONAME ; NmMailbox::NmMailbox(class NmMailbox const &)
+	??4NmMessageEnvelope@@QAEAAV0@ABV0@@Z @ 138 NONAME ; class NmMessageEnvelope & NmMessageEnvelope::operator=(class NmMessageEnvelope const &)
+	??1NmMessagePartPrivate@@UAE@XZ @ 139 NONAME ; NmMessagePartPrivate::~NmMessagePartPrivate(void)
+	??8NmMailbox@@QBE_NABV0@@Z @ 140 NONAME ; bool NmMailbox::operator==(class NmMailbox const &) const
+	??0NmMailbox@@QAE@V?$QExplicitlySharedDataPointer@VNmMailboxPrivate@@@@@Z @ 141 NONAME ; NmMailbox::NmMailbox(class QExplicitlySharedDataPointer<class NmMailboxPrivate>)
+	?unseenCount@NmFolder@@QBEIXZ @ 142 NONAME ; unsigned int NmFolder::unseenCount(void) const
+	?ccRecipients@NmMessageEnvelope@@QBEAAV?$QList@VNmAddress@@@@XZ @ 143 NONAME ; class QList<class NmAddress> & NmMessageEnvelope::ccRecipients(void) const
+	?sender@NmMessageEnvelope@@QBE?AVNmAddress@@XZ @ 144 NONAME ; class NmAddress NmMessageEnvelope::sender(void) const
+	?setContentDisposition@NmMessagePart@@QAEXABVQString@@@Z @ 145 NONAME ; void NmMessagePart::setContentDisposition(class QString const &)
+	?removeAllChildParts@NmMessagePart@@QAEXXZ @ 146 NONAME ; void NmMessagePart::removeAllChildParts(void)
+	?contentDisposition@NmMessagePart@@QBE?AVQString@@XZ @ 147 NONAME ; class QString NmMessagePart::contentDisposition(void) const
+	??0NmMessagePrivate@@QAE@XZ @ 148 NONAME ; NmMessagePrivate::NmMessagePrivate(void)
+	?setAddress@NmMailbox@@QAEXABVNmAddress@@@Z @ 149 NONAME ; void NmMailbox::setAddress(class NmAddress const &)
+	??_ENmMailboxPrivate@@UAE@I@Z @ 150 NONAME ; NmMailboxPrivate::~NmMailboxPrivate(unsigned int)
+	?parentId@NmFolder@@QBE?AVNmId@@XZ @ 151 NONAME ; class NmId NmFolder::parentId(void) const
+	?folderId@NmFolder@@QBE?AVNmId@@XZ @ 152 NONAME ; class NmId NmFolder::folderId(void) const
+	??1NmMessagePart@@UAE@XZ @ 153 NONAME ; NmMessagePart::~NmMessagePart(void)
+	??0NmMessagePart@@IAE@ABV0@@Z @ 154 NONAME ; NmMessagePart::NmMessagePart(class NmMessagePart const &)
+	??0NmAddress@@QAE@V?$QExplicitlySharedDataPointer@VNmAddressPrivate@@@@@Z @ 155 NONAME ; NmAddress::NmAddress(class QExplicitlySharedDataPointer<class NmAddressPrivate>)
+	?addChildPart@NmMessagePart@@QAEXPAV1@@Z @ 156 NONAME ; void NmMessagePart::addChildPart(class NmMessagePart *)
+	?isFlagSet@NmMessageEnvelopePrivate@@QBE_NW4NmMessageFlag@@@Z @ 157 NONAME ; bool NmMessageEnvelopePrivate::isFlagSet(enum NmMessageFlag) const
+	??_ENmMessageEnvelope@@UAE@I@Z @ 158 NONAME ; NmMessageEnvelope::~NmMessageEnvelope(unsigned int)
+	??_ENmMessage@@UAE@I@Z @ 159 NONAME ; NmMessage::~NmMessage(unsigned int)
+	?contentType@NmMessagePart@@QBE?AVQString@@XZ @ 160 NONAME ; class QString NmMessagePart::contentType(void) const
+	??1NmMessageEnvelopePrivate@@UAE@XZ @ 161 NONAME ; NmMessageEnvelopePrivate::~NmMessageEnvelopePrivate(void)
+	?setAddress@NmAddress@@QAEXABVQString@@@Z @ 162 NONAME ; void NmAddress::setAddress(class QString const &)
+	?isForwarded@NmMessageEnvelope@@QBE_NXZ @ 163 NONAME ; bool NmMessageEnvelope::isForwarded(void) const
+	??1NmAddress@@UAE@XZ @ 164 NONAME ; NmAddress::~NmAddress(void)
+	?setReplied@NmMessageEnvelope@@QAEX_N@Z @ 165 NONAME ; void NmMessageEnvelope::setReplied(bool)
+	?attachmentList@NmMessage@@QBEXAAV?$QList@PAVNmMessagePart@@@@@Z @ 166 NONAME ; void NmMessage::attachmentList(class QList<class NmMessagePart *> &) const
+	??0NmMessageEnvelope@@QAE@ABVNmId@@@Z @ 167 NONAME ; NmMessageEnvelope::NmMessageEnvelope(class NmId const &)
+	??0NmFolder@@QAE@ABV0@@Z @ 168 NONAME ; NmFolder::NmFolder(class NmFolder const &)
+	??0NmMessage@@QAE@XZ @ 169 NONAME ; NmMessage::NmMessage(void)
+	?setFetchedSize@NmMessagePart@@QAEXI@Z @ 170 NONAME ; void NmMessagePart::setFetchedSize(unsigned int)
+	??0NmMessageEnvelope@@QAE@XZ @ 171 NONAME ; NmMessageEnvelope::NmMessageEnvelope(void)
+	??4NmMessagePart@@AAEAAV0@ABV0@@Z @ 172 NONAME ; class NmMessagePart & NmMessagePart::operator=(class NmMessagePart const &)
 
--- a/emailservices/nmailbase/eabi/nmailbaseu.def	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmailbase/eabi/nmailbaseu.def	Fri May 14 15:41:10 2010 +0300
@@ -1,60 +1,60 @@
 EXPORTS
-	_ZN13NmMessagePart11setParentIdERK4NmId @ 1 NONAME
-	_ZN13NmMessagePart12addChildPartEPS_ @ 2 NONAME
-	_ZN13NmMessagePart12setContentIdERK7QString @ 3 NONAME
-	_ZN13NmMessagePart12setMailboxIdERK4NmId @ 4 NONAME
-	_ZN13NmMessagePart13setChildPartsE5QListIPS_E @ 5 NONAME
-	_ZN13NmMessagePart14setContentTypeERK7QString @ 6 NONAME
-	_ZN13NmMessagePart14setFetchedSizeEj @ 7 NONAME
-	_ZN13NmMessagePart14setTextContentERK7QStringS2_ @ 8 NONAME
-	_ZN13NmMessagePart15findContentPartERK7QString @ 9 NONAME
-	_ZN13NmMessagePart15removeChildPartERK4NmId @ 10 NONAME
-	_ZN13NmMessagePart16setBinaryContentERK10QByteArrayRK7QString @ 11 NONAME
-	_ZN13NmMessagePart17setAttachmentNameERK7QString @ 12 NONAME
-	_ZN13NmMessagePart19removeAllChildPartsEv @ 13 NONAME
-	_ZN13NmMessagePart21setContentDescriptionERK7QString @ 14 NONAME
-	_ZN13NmMessagePart21setContentDispositionERK7QString @ 15 NONAME
-	_ZN13NmMessagePart5setIdERK4NmId @ 16 NONAME
-	_ZN13NmMessagePart7setSizeEj @ 17 NONAME
-	_ZN13NmMessagePart9contentIdEv @ 18 NONAME
-	_ZN13NmMessagePartC1E28QExplicitlySharedDataPointerI20NmMessagePartPrivateE @ 19 NONAME
-	_ZN13NmMessagePartC1ERK4NmId @ 20 NONAME
-	_ZN13NmMessagePartC1ERK4NmIdS2_ @ 21 NONAME
-	_ZN13NmMessagePartC1ERK4NmIdS2_S2_ @ 22 NONAME
-	_ZN13NmMessagePartC1ERKS_ @ 23 NONAME
-	_ZN13NmMessagePartC1Ev @ 24 NONAME
-	_ZN13NmMessagePartC2E28QExplicitlySharedDataPointerI20NmMessagePartPrivateE @ 25 NONAME
-	_ZN13NmMessagePartC2ERK4NmId @ 26 NONAME
-	_ZN13NmMessagePartC2ERK4NmIdS2_ @ 27 NONAME
-	_ZN13NmMessagePartC2ERK4NmIdS2_S2_ @ 28 NONAME
-	_ZN13NmMessagePartC2ERKS_ @ 29 NONAME
-	_ZN13NmMessagePartC2Ev @ 30 NONAME
-	_ZN13NmMessagePartD0Ev @ 31 NONAME
-	_ZN13NmMessagePartD1Ev @ 32 NONAME
-	_ZN13NmMessagePartD2Ev @ 33 NONAME
-	_ZN13NmMessagePartaSERKS_ @ 34 NONAME
-	_ZN15NmFolderPrivateC1Ev @ 35 NONAME
-	_ZN15NmFolderPrivateC2Ev @ 36 NONAME
-	_ZN15NmFolderPrivateD0Ev @ 37 NONAME
-	_ZN15NmFolderPrivateD1Ev @ 38 NONAME
-	_ZN15NmFolderPrivateD2Ev @ 39 NONAME
-	_ZN16NmAddressPrivateC1Ev @ 40 NONAME
-	_ZN16NmAddressPrivateC2Ev @ 41 NONAME
-	_ZN16NmAddressPrivateD0Ev @ 42 NONAME
-	_ZN16NmAddressPrivateD1Ev @ 43 NONAME
-	_ZN16NmAddressPrivateD2Ev @ 44 NONAME
-	_ZN16NmMailboxPrivateC1Ev @ 45 NONAME
-	_ZN16NmMailboxPrivateC2Ev @ 46 NONAME
-	_ZN16NmMailboxPrivateD0Ev @ 47 NONAME
-	_ZN16NmMailboxPrivateD1Ev @ 48 NONAME
-	_ZN16NmMailboxPrivateD2Ev @ 49 NONAME
-	_ZN17NmMessageEnvelope10setRepliedEb @ 50 NONAME
-	_ZN17NmMessageEnvelope10setSubjectERK7QString @ 51 NONAME
-	_ZN17NmMessageEnvelope11setParentIdERK4NmId @ 52 NONAME
-	_ZN17NmMessageEnvelope11setPriorityE17NmMessagePriority @ 53 NONAME
-	_ZN17NmMessageEnvelope11setSentTimeERK9QDateTime @ 54 NONAME
-	_ZN17NmMessageEnvelope12setForwardedEb @ 55 NONAME
-	_ZN17NmMessageEnvelope12setMailboxIdERK4NmId @ 56 NONAME
+	_ZN13NmMessagePart12addChildPartEPS_ @ 1 NONAME
+	_ZN13NmMessagePart12setContentIdERK7QString @ 2 NONAME
+	_ZN13NmMessagePart13setChildPartsE5QListIPS_E @ 3 NONAME
+	_ZN13NmMessagePart14setContentTypeERK7QString @ 4 NONAME
+	_ZN13NmMessagePart14setFetchedSizeEj @ 5 NONAME
+	_ZN13NmMessagePart14setTextContentERK7QStringS2_ @ 6 NONAME
+	_ZN13NmMessagePart15findContentPartERK7QString @ 7 NONAME
+	_ZN13NmMessagePart15removeChildPartERK4NmId @ 8 NONAME
+	_ZN13NmMessagePart16setBinaryContentERK10QByteArrayRK7QString @ 9 NONAME
+	_ZN13NmMessagePart17setAttachmentNameERK7QString @ 10 NONAME
+	_ZN13NmMessagePart19removeAllChildPartsEv @ 11 NONAME
+	_ZN13NmMessagePart21setContentDescriptionERK7QString @ 12 NONAME
+	_ZN13NmMessagePart21setContentDispositionERK7QString @ 13 NONAME
+	_ZN13NmMessagePart7setSizeEj @ 14 NONAME
+	_ZN13NmMessagePart9contentIdEv @ 15 NONAME
+	_ZN13NmMessagePart9setPartIdERK4NmId @ 16 NONAME
+	_ZN13NmMessagePartC1E28QExplicitlySharedDataPointerI20NmMessagePartPrivateE @ 17 NONAME
+	_ZN13NmMessagePartC1ERK4NmId @ 18 NONAME
+	_ZN13NmMessagePartC1ERKS_ @ 19 NONAME
+	_ZN13NmMessagePartC1Ev @ 20 NONAME
+	_ZN13NmMessagePartC2E28QExplicitlySharedDataPointerI20NmMessagePartPrivateE @ 21 NONAME
+	_ZN13NmMessagePartC2ERK4NmId @ 22 NONAME
+	_ZN13NmMessagePartC2ERKS_ @ 23 NONAME
+	_ZN13NmMessagePartC2Ev @ 24 NONAME
+	_ZN13NmMessagePartD0Ev @ 25 NONAME
+	_ZN13NmMessagePartD1Ev @ 26 NONAME
+	_ZN13NmMessagePartD2Ev @ 27 NONAME
+	_ZN13NmMessagePartaSERKS_ @ 28 NONAME
+	_ZN15NmFolderPrivateC1Ev @ 29 NONAME
+	_ZN15NmFolderPrivateC2Ev @ 30 NONAME
+	_ZN15NmFolderPrivateD0Ev @ 31 NONAME
+	_ZN15NmFolderPrivateD1Ev @ 32 NONAME
+	_ZN15NmFolderPrivateD2Ev @ 33 NONAME
+	_ZN16NmAddressPrivateC1Ev @ 34 NONAME
+	_ZN16NmAddressPrivateC2Ev @ 35 NONAME
+	_ZN16NmAddressPrivateD0Ev @ 36 NONAME
+	_ZN16NmAddressPrivateD1Ev @ 37 NONAME
+	_ZN16NmAddressPrivateD2Ev @ 38 NONAME
+	_ZN16NmMailboxPrivateC1Ev @ 39 NONAME
+	_ZN16NmMailboxPrivateC2Ev @ 40 NONAME
+	_ZN16NmMailboxPrivateD0Ev @ 41 NONAME
+	_ZN16NmMailboxPrivateD1Ev @ 42 NONAME
+	_ZN16NmMailboxPrivateD2Ev @ 43 NONAME
+	_ZN16NmMessagePrivateC1Ev @ 44 NONAME
+	_ZN16NmMessagePrivateC2Ev @ 45 NONAME
+	_ZN16NmMessagePrivateD0Ev @ 46 NONAME
+	_ZN16NmMessagePrivateD1Ev @ 47 NONAME
+	_ZN16NmMessagePrivateD2Ev @ 48 NONAME
+	_ZN17NmMessageEnvelope10setRepliedEb @ 49 NONAME
+	_ZN17NmMessageEnvelope10setSubjectERK7QString @ 50 NONAME
+	_ZN17NmMessageEnvelope11setFolderIdERK4NmId @ 51 NONAME
+	_ZN17NmMessageEnvelope11setPriorityE17NmMessagePriority @ 52 NONAME
+	_ZN17NmMessageEnvelope11setSentTimeERK9QDateTime @ 53 NONAME
+	_ZN17NmMessageEnvelope12setForwardedEb @ 54 NONAME
+	_ZN17NmMessageEnvelope12setMailboxIdERK4NmId @ 55 NONAME
+	_ZN17NmMessageEnvelope12setMessageIdERK4NmId @ 56 NONAME
 	_ZN17NmMessageEnvelope15setCcRecipientsE5QListI9NmAddressE @ 57 NONAME
 	_ZN17NmMessageEnvelope15setToRecipientsE5QListI9NmAddressE @ 58 NONAME
 	_ZN17NmMessageEnvelope16setBccRecipientsE5QListI9NmAddressE @ 59 NONAME
@@ -62,184 +62,182 @@
 	_ZN17NmMessageEnvelope17clearToRecipientsEv @ 61 NONAME
 	_ZN17NmMessageEnvelope17setHasAttachmentsEb @ 62 NONAME
 	_ZN17NmMessageEnvelope18clearBccRecipientsEv @ 63 NONAME
-	_ZN17NmMessageEnvelope5setIdERK4NmId @ 64 NONAME
-	_ZN17NmMessageEnvelope7setReadEb @ 65 NONAME
-	_ZN17NmMessageEnvelope9setSenderERK9NmAddress @ 66 NONAME
-	_ZN17NmMessageEnvelopeC1E28QExplicitlySharedDataPointerI24NmMessageEnvelopePrivateE @ 67 NONAME
-	_ZN17NmMessageEnvelopeC1ERK4NmId @ 68 NONAME
-	_ZN17NmMessageEnvelopeC1ERKS_ @ 69 NONAME
-	_ZN17NmMessageEnvelopeC1Ev @ 70 NONAME
-	_ZN17NmMessageEnvelopeC2E28QExplicitlySharedDataPointerI24NmMessageEnvelopePrivateE @ 71 NONAME
-	_ZN17NmMessageEnvelopeC2ERK4NmId @ 72 NONAME
-	_ZN17NmMessageEnvelopeC2ERKS_ @ 73 NONAME
-	_ZN17NmMessageEnvelopeC2Ev @ 74 NONAME
-	_ZN17NmMessageEnvelopeD0Ev @ 75 NONAME
-	_ZN17NmMessageEnvelopeD1Ev @ 76 NONAME
-	_ZN17NmMessageEnvelopeD2Ev @ 77 NONAME
-	_ZN17NmMessageEnvelopeaSERKS_ @ 78 NONAME
-	_ZN20NmMessagePartPrivateC1Ev @ 79 NONAME
-	_ZN20NmMessagePartPrivateC2Ev @ 80 NONAME
-	_ZN20NmMessagePartPrivateD0Ev @ 81 NONAME
-	_ZN20NmMessagePartPrivateD1Ev @ 82 NONAME
-	_ZN20NmMessagePartPrivateD2Ev @ 83 NONAME
-	_ZN24NmMessageEnvelopePrivate7setFlagE13NmMessageFlagb @ 84 NONAME
-	_ZN24NmMessageEnvelopePrivate8setFlagsE6QFlagsI13NmMessageFlagEb @ 85 NONAME
-	_ZN24NmMessageEnvelopePrivateC1Ev @ 86 NONAME
-	_ZN24NmMessageEnvelopePrivateC2Ev @ 87 NONAME
-	_ZN24NmMessageEnvelopePrivateD0Ev @ 88 NONAME
-	_ZN24NmMessageEnvelopePrivateD1Ev @ 89 NONAME
-	_ZN24NmMessageEnvelopePrivateD2Ev @ 90 NONAME
-	_ZN8NmFolder11setFolderIdE4NmId @ 91 NONAME
-	_ZN8NmFolder11setParentIdE4NmId @ 92 NONAME
-	_ZN8NmFolder12setMailboxIdE4NmId @ 93 NONAME
-	_ZN8NmFolder13setFolderTypeE12NmFolderType @ 94 NONAME
-	_ZN8NmFolder14setLastUpdatedE9QDateTime @ 95 NONAME
-	_ZN8NmFolder14setUnseenCountEj @ 96 NONAME
-	_ZN8NmFolder15setMessageCountEj @ 97 NONAME
-	_ZN8NmFolder17setSubFolderCountEj @ 98 NONAME
-	_ZN8NmFolder21setUnreadMessageCountEj @ 99 NONAME
-	_ZN8NmFolder7setNameE7QString @ 100 NONAME
-	_ZN8NmFolderC1E28QExplicitlySharedDataPointerI15NmFolderPrivateE @ 101 NONAME
-	_ZN8NmFolderC1E4NmId @ 102 NONAME
-	_ZN8NmFolderC1ERKS_ @ 103 NONAME
-	_ZN8NmFolderC2E28QExplicitlySharedDataPointerI15NmFolderPrivateE @ 104 NONAME
-	_ZN8NmFolderC2E4NmId @ 105 NONAME
-	_ZN8NmFolderC2ERKS_ @ 106 NONAME
-	_ZN8NmFolderD0Ev @ 107 NONAME
-	_ZN8NmFolderD1Ev @ 108 NONAME
-	_ZN8NmFolderD2Ev @ 109 NONAME
-	_ZN8NmFolderaSERKS_ @ 110 NONAME
-	_ZN9NmAddress10setAddressERK7QString @ 111 NONAME
-	_ZN9NmAddress14setDisplayNameERK7QString @ 112 NONAME
-	_ZN9NmAddressC1E28QExplicitlySharedDataPointerI16NmAddressPrivateE @ 113 NONAME
-	_ZN9NmAddressC1ERK7QString @ 114 NONAME
-	_ZN9NmAddressC1ERK7QStringS2_ @ 115 NONAME
-	_ZN9NmAddressC1ERKS_ @ 116 NONAME
-	_ZN9NmAddressC1Ev @ 117 NONAME
-	_ZN9NmAddressC2E28QExplicitlySharedDataPointerI16NmAddressPrivateE @ 118 NONAME
-	_ZN9NmAddressC2ERK7QString @ 119 NONAME
-	_ZN9NmAddressC2ERK7QStringS2_ @ 120 NONAME
-	_ZN9NmAddressC2ERKS_ @ 121 NONAME
-	_ZN9NmAddressC2Ev @ 122 NONAME
-	_ZN9NmAddressD0Ev @ 123 NONAME
-	_ZN9NmAddressD1Ev @ 124 NONAME
-	_ZN9NmAddressD2Ev @ 125 NONAME
-	_ZN9NmAddressaSERKS_ @ 126 NONAME
-	_ZN9NmMailbox10setAddressER9NmAddress @ 127 NONAME
-	_ZN9NmMailbox5setIdERK4NmId @ 128 NONAME
-	_ZN9NmMailbox7addressEv @ 129 NONAME
-	_ZN9NmMailbox7setNameERK7QString @ 130 NONAME
-	_ZN9NmMailboxC1E28QExplicitlySharedDataPointerI16NmMailboxPrivateE @ 131 NONAME
-	_ZN9NmMailboxC1ERKS_ @ 132 NONAME
-	_ZN9NmMailboxC1Ev @ 133 NONAME
-	_ZN9NmMailboxC2E28QExplicitlySharedDataPointerI16NmMailboxPrivateE @ 134 NONAME
-	_ZN9NmMailboxC2ERKS_ @ 135 NONAME
-	_ZN9NmMailboxC2Ev @ 136 NONAME
-	_ZN9NmMailboxD0Ev @ 137 NONAME
-	_ZN9NmMailboxD1Ev @ 138 NONAME
-	_ZN9NmMailboxD2Ev @ 139 NONAME
-	_ZN9NmMailboxaSERKS_ @ 140 NONAME
-	_ZN9NmMessage11setEnvelopeERK17NmMessageEnvelope @ 141 NONAME
-	_ZN9NmMessage12htmlBodyPartEv @ 142 NONAME
-	_ZN9NmMessage17plainTextBodyPartEv @ 143 NONAME
-	_ZN9NmMessage5setIdERK4NmId @ 144 NONAME
-	_ZN9NmMessage8envelopeEv @ 145 NONAME
-	_ZN9NmMessageC1ERK13NmMessagePart @ 146 NONAME
-	_ZN9NmMessageC1ERK17NmMessageEnvelope @ 147 NONAME
-	_ZN9NmMessageC1ERK4NmId @ 148 NONAME
-	_ZN9NmMessageC1ERK4NmIdS2_ @ 149 NONAME
-	_ZN9NmMessageC1ERK4NmIdS2_S2_ @ 150 NONAME
-	_ZN9NmMessageC1ERKS_ @ 151 NONAME
-	_ZN9NmMessageC1Ev @ 152 NONAME
-	_ZN9NmMessageC2ERK13NmMessagePart @ 153 NONAME
-	_ZN9NmMessageC2ERK17NmMessageEnvelope @ 154 NONAME
-	_ZN9NmMessageC2ERK4NmId @ 155 NONAME
-	_ZN9NmMessageC2ERK4NmIdS2_ @ 156 NONAME
-	_ZN9NmMessageC2ERK4NmIdS2_S2_ @ 157 NONAME
-	_ZN9NmMessageC2ERKS_ @ 158 NONAME
-	_ZN9NmMessageC2Ev @ 159 NONAME
-	_ZN9NmMessageD0Ev @ 160 NONAME
-	_ZN9NmMessageD1Ev @ 161 NONAME
-	_ZN9NmMessageD2Ev @ 162 NONAME
-	_ZN9NmMessageaSERKS_ @ 163 NONAME
-	_ZNK13NmMessagePart10childPartsEv @ 164 NONAME
-	_ZNK13NmMessagePart11contentTypeEv @ 165 NONAME
-	_ZNK13NmMessagePart11fetchedSizeEv @ 166 NONAME
-	_ZNK13NmMessagePart11textContentEv @ 167 NONAME
-	_ZNK13NmMessagePart13binaryContentEv @ 168 NONAME
-	_ZNK13NmMessagePart14attachmentNameEv @ 169 NONAME
-	_ZNK13NmMessagePart15findContentPartERK7QString @ 170 NONAME
-	_ZNK13NmMessagePart17appendAttachmentsER5QListIPS_E @ 171 NONAME
-	_ZNK13NmMessagePart18contentDescriptionEv @ 172 NONAME
-	_ZNK13NmMessagePart18contentDispositionEv @ 173 NONAME
-	_ZNK13NmMessagePart2idEv @ 174 NONAME
-	_ZNK13NmMessagePart4sizeEv @ 175 NONAME
-	_ZNK13NmMessagePart8parentIdEv @ 176 NONAME
-	_ZNK13NmMessagePart9isMessageEv @ 177 NONAME
-	_ZNK13NmMessagePart9mailboxIdEv @ 178 NONAME
-	_ZNK17NmMessageEnvelope11isForwardedEv @ 179 NONAME
-	_ZNK17NmMessageEnvelope12ccRecipientsEv @ 180 NONAME
-	_ZNK17NmMessageEnvelope12toRecipientsEv @ 181 NONAME
-	_ZNK17NmMessageEnvelope13bccRecipientsEv @ 182 NONAME
-	_ZNK17NmMessageEnvelope14hasAttachmentsEv @ 183 NONAME
-	_ZNK17NmMessageEnvelope2idEv @ 184 NONAME
-	_ZNK17NmMessageEnvelope5flagsEv @ 185 NONAME
-	_ZNK17NmMessageEnvelope6isReadEv @ 186 NONAME
-	_ZNK17NmMessageEnvelope6senderEv @ 187 NONAME
-	_ZNK17NmMessageEnvelope7subjectEv @ 188 NONAME
-	_ZNK17NmMessageEnvelope8parentIdEv @ 189 NONAME
-	_ZNK17NmMessageEnvelope8priorityEv @ 190 NONAME
-	_ZNK17NmMessageEnvelope8sentTimeEv @ 191 NONAME
-	_ZNK17NmMessageEnvelope9isRepliedEv @ 192 NONAME
-	_ZNK17NmMessageEnvelope9mailboxIdEv @ 193 NONAME
-	_ZNK17NmMessageEnvelopeeqERKS_ @ 194 NONAME
-	_ZNK17NmMessageEnvelopeneERKS_ @ 195 NONAME
-	_ZNK20NmMessagePartPrivate13isTextContentEv @ 196 NONAME
-	_ZNK20NmMessagePartPrivate9isMessageEv @ 197 NONAME
-	_ZNK24NmMessageEnvelopePrivate5flagsEv @ 198 NONAME
-	_ZNK24NmMessageEnvelopePrivate9isFlagSetE13NmMessageFlag @ 199 NONAME
-	_ZNK8NmFolder10folderTypeEv @ 200 NONAME
-	_ZNK8NmFolder11lastUpdatedEv @ 201 NONAME
-	_ZNK8NmFolder11unseenCountEv @ 202 NONAME
-	_ZNK8NmFolder12messageCountEv @ 203 NONAME
-	_ZNK8NmFolder14subFolderCountEv @ 204 NONAME
-	_ZNK8NmFolder18unreadMessageCountEv @ 205 NONAME
-	_ZNK8NmFolder4nameEv @ 206 NONAME
-	_ZNK8NmFolder8folderIdEv @ 207 NONAME
-	_ZNK8NmFolder8parentIdEv @ 208 NONAME
-	_ZNK8NmFolder9mailboxIdEv @ 209 NONAME
-	_ZNK9NmAddress11displayNameEv @ 210 NONAME
-	_ZNK9NmAddress7addressEv @ 211 NONAME
-	_ZNK9NmAddresseqERKS_ @ 212 NONAME
-	_ZNK9NmAddressneERKS_ @ 213 NONAME
-	_ZNK9NmMailbox2idEv @ 214 NONAME
-	_ZNK9NmMailbox4nameEv @ 215 NONAME
-	_ZNK9NmMailboxeqERKS_ @ 216 NONAME
-	_ZNK9NmMessage12htmlBodyPartEv @ 217 NONAME
-	_ZNK9NmMessage14attachmentListER5QListIP13NmMessagePartE @ 218 NONAME
-	_ZNK9NmMessage17plainTextBodyPartEv @ 219 NONAME
-	_ZNK9NmMessage2idEv @ 220 NONAME
-	_ZNK9NmMessage8envelopeEv @ 221 NONAME
-	_ZTI13NmMessagePart @ 222 NONAME
-	_ZTI15NmFolderPrivate @ 223 NONAME
-	_ZTI16NmAddressPrivate @ 224 NONAME
-	_ZTI16NmMailboxPrivate @ 225 NONAME
-	_ZTI17NmMessageEnvelope @ 226 NONAME
-	_ZTI20NmMessagePartPrivate @ 227 NONAME
-	_ZTI24NmMessageEnvelopePrivate @ 228 NONAME
-	_ZTI8NmFolder @ 229 NONAME
-	_ZTI9NmAddress @ 230 NONAME
-	_ZTI9NmMailbox @ 231 NONAME
-	_ZTI9NmMessage @ 232 NONAME
-	_ZTV13NmMessagePart @ 233 NONAME
-	_ZTV15NmFolderPrivate @ 234 NONAME
-	_ZTV16NmAddressPrivate @ 235 NONAME
-	_ZTV16NmMailboxPrivate @ 236 NONAME
-	_ZTV17NmMessageEnvelope @ 237 NONAME
-	_ZTV20NmMessagePartPrivate @ 238 NONAME
-	_ZTV24NmMessageEnvelopePrivate @ 239 NONAME
-	_ZTV8NmFolder @ 240 NONAME
-	_ZTV9NmAddress @ 241 NONAME
-	_ZTV9NmMailbox @ 242 NONAME
-	_ZTV9NmMessage @ 243 NONAME
+	_ZN17NmMessageEnvelope7setReadEb @ 64 NONAME
+	_ZN17NmMessageEnvelope9setSenderERK9NmAddress @ 65 NONAME
+	_ZN17NmMessageEnvelopeC1E28QExplicitlySharedDataPointerI24NmMessageEnvelopePrivateE @ 66 NONAME
+	_ZN17NmMessageEnvelopeC1ERK4NmId @ 67 NONAME
+	_ZN17NmMessageEnvelopeC1ERKS_ @ 68 NONAME
+	_ZN17NmMessageEnvelopeC1Ev @ 69 NONAME
+	_ZN17NmMessageEnvelopeC2E28QExplicitlySharedDataPointerI24NmMessageEnvelopePrivateE @ 70 NONAME
+	_ZN17NmMessageEnvelopeC2ERK4NmId @ 71 NONAME
+	_ZN17NmMessageEnvelopeC2ERKS_ @ 72 NONAME
+	_ZN17NmMessageEnvelopeC2Ev @ 73 NONAME
+	_ZN17NmMessageEnvelopeD0Ev @ 74 NONAME
+	_ZN17NmMessageEnvelopeD1Ev @ 75 NONAME
+	_ZN17NmMessageEnvelopeD2Ev @ 76 NONAME
+	_ZN17NmMessageEnvelopeaSERKS_ @ 77 NONAME
+	_ZN20NmMessagePartPrivateC1Ev @ 78 NONAME
+	_ZN20NmMessagePartPrivateC2Ev @ 79 NONAME
+	_ZN20NmMessagePartPrivateD0Ev @ 80 NONAME
+	_ZN20NmMessagePartPrivateD1Ev @ 81 NONAME
+	_ZN20NmMessagePartPrivateD2Ev @ 82 NONAME
+	_ZN24NmMessageEnvelopePrivate7setFlagE13NmMessageFlagb @ 83 NONAME
+	_ZN24NmMessageEnvelopePrivate8setFlagsE6QFlagsI13NmMessageFlagEb @ 84 NONAME
+	_ZN24NmMessageEnvelopePrivateC1Ev @ 85 NONAME
+	_ZN24NmMessageEnvelopePrivateC2Ev @ 86 NONAME
+	_ZN24NmMessageEnvelopePrivateD0Ev @ 87 NONAME
+	_ZN24NmMessageEnvelopePrivateD1Ev @ 88 NONAME
+	_ZN24NmMessageEnvelopePrivateD2Ev @ 89 NONAME
+	_ZN8NmFolder11setFolderIdE4NmId @ 90 NONAME
+	_ZN8NmFolder11setParentIdE4NmId @ 91 NONAME
+	_ZN8NmFolder12setMailboxIdE4NmId @ 92 NONAME
+	_ZN8NmFolder13setFolderTypeE12NmFolderType @ 93 NONAME
+	_ZN8NmFolder14setLastUpdatedE9QDateTime @ 94 NONAME
+	_ZN8NmFolder14setUnseenCountEj @ 95 NONAME
+	_ZN8NmFolder15setMessageCountEj @ 96 NONAME
+	_ZN8NmFolder17setSubFolderCountEj @ 97 NONAME
+	_ZN8NmFolder21setUnreadMessageCountEj @ 98 NONAME
+	_ZN8NmFolder7setNameE7QString @ 99 NONAME
+	_ZN8NmFolderC1E28QExplicitlySharedDataPointerI15NmFolderPrivateE @ 100 NONAME
+	_ZN8NmFolderC1E4NmId @ 101 NONAME
+	_ZN8NmFolderC1ERKS_ @ 102 NONAME
+	_ZN8NmFolderC2E28QExplicitlySharedDataPointerI15NmFolderPrivateE @ 103 NONAME
+	_ZN8NmFolderC2E4NmId @ 104 NONAME
+	_ZN8NmFolderC2ERKS_ @ 105 NONAME
+	_ZN8NmFolderD0Ev @ 106 NONAME
+	_ZN8NmFolderD1Ev @ 107 NONAME
+	_ZN8NmFolderD2Ev @ 108 NONAME
+	_ZN8NmFolderaSERKS_ @ 109 NONAME
+	_ZN9NmAddress10setAddressERK7QString @ 110 NONAME
+	_ZN9NmAddress14setDisplayNameERK7QString @ 111 NONAME
+	_ZN9NmAddressC1E28QExplicitlySharedDataPointerI16NmAddressPrivateE @ 112 NONAME
+	_ZN9NmAddressC1ERK7QString @ 113 NONAME
+	_ZN9NmAddressC1ERK7QStringS2_ @ 114 NONAME
+	_ZN9NmAddressC1ERKS_ @ 115 NONAME
+	_ZN9NmAddressC1Ev @ 116 NONAME
+	_ZN9NmAddressC2E28QExplicitlySharedDataPointerI16NmAddressPrivateE @ 117 NONAME
+	_ZN9NmAddressC2ERK7QString @ 118 NONAME
+	_ZN9NmAddressC2ERK7QStringS2_ @ 119 NONAME
+	_ZN9NmAddressC2ERKS_ @ 120 NONAME
+	_ZN9NmAddressC2Ev @ 121 NONAME
+	_ZN9NmAddressD0Ev @ 122 NONAME
+	_ZN9NmAddressD1Ev @ 123 NONAME
+	_ZN9NmAddressD2Ev @ 124 NONAME
+	_ZN9NmAddressaSERKS_ @ 125 NONAME
+	_ZN9NmMailbox10setAddressERK9NmAddress @ 126 NONAME
+	_ZN9NmMailbox5setIdERK4NmId @ 127 NONAME
+	_ZN9NmMailbox7setNameERK7QString @ 128 NONAME
+	_ZN9NmMailboxC1E28QExplicitlySharedDataPointerI16NmMailboxPrivateE @ 129 NONAME
+	_ZN9NmMailboxC1ERKS_ @ 130 NONAME
+	_ZN9NmMailboxC1Ev @ 131 NONAME
+	_ZN9NmMailboxC2E28QExplicitlySharedDataPointerI16NmMailboxPrivateE @ 132 NONAME
+	_ZN9NmMailboxC2ERKS_ @ 133 NONAME
+	_ZN9NmMailboxC2Ev @ 134 NONAME
+	_ZN9NmMailboxD0Ev @ 135 NONAME
+	_ZN9NmMailboxD1Ev @ 136 NONAME
+	_ZN9NmMailboxD2Ev @ 137 NONAME
+	_ZN9NmMailboxaSERKS_ @ 138 NONAME
+	_ZN9NmMessage12htmlBodyPartEv @ 139 NONAME
+	_ZN9NmMessage17plainTextBodyPartEv @ 140 NONAME
+	_ZN9NmMessage8envelopeEv @ 141 NONAME
+	_ZN9NmMessageC1ERK13NmMessagePart @ 142 NONAME
+	_ZN9NmMessageC1ERK17NmMessageEnvelope @ 143 NONAME
+	_ZN9NmMessageC1ERK17NmMessageEnvelope28QExplicitlySharedDataPointerI20NmMessagePartPrivateE @ 144 NONAME
+	_ZN9NmMessageC1ERK4NmId @ 145 NONAME
+	_ZN9NmMessageC1ERK4NmIdS2_ @ 146 NONAME
+	_ZN9NmMessageC1ERK4NmIdS2_S2_ @ 147 NONAME
+	_ZN9NmMessageC1ERKS_ @ 148 NONAME
+	_ZN9NmMessageC1Ev @ 149 NONAME
+	_ZN9NmMessageC2ERK13NmMessagePart @ 150 NONAME
+	_ZN9NmMessageC2ERK17NmMessageEnvelope @ 151 NONAME
+	_ZN9NmMessageC2ERK17NmMessageEnvelope28QExplicitlySharedDataPointerI20NmMessagePartPrivateE @ 152 NONAME
+	_ZN9NmMessageC2ERK4NmId @ 153 NONAME
+	_ZN9NmMessageC2ERK4NmIdS2_ @ 154 NONAME
+	_ZN9NmMessageC2ERK4NmIdS2_S2_ @ 155 NONAME
+	_ZN9NmMessageC2ERKS_ @ 156 NONAME
+	_ZN9NmMessageC2Ev @ 157 NONAME
+	_ZN9NmMessageD0Ev @ 158 NONAME
+	_ZN9NmMessageD1Ev @ 159 NONAME
+	_ZN9NmMessageD2Ev @ 160 NONAME
+	_ZN9NmMessageaSERKS_ @ 161 NONAME
+	_ZNK13NmMessagePart10childPartsEv @ 162 NONAME
+	_ZNK13NmMessagePart11contentTypeEv @ 163 NONAME
+	_ZNK13NmMessagePart11fetchedSizeEv @ 164 NONAME
+	_ZNK13NmMessagePart11textContentEv @ 165 NONAME
+	_ZNK13NmMessagePart13binaryContentEv @ 166 NONAME
+	_ZNK13NmMessagePart14attachmentNameEv @ 167 NONAME
+	_ZNK13NmMessagePart15findContentPartERK7QString @ 168 NONAME
+	_ZNK13NmMessagePart17appendAttachmentsER5QListIPS_E @ 169 NONAME
+	_ZNK13NmMessagePart18contentDescriptionEv @ 170 NONAME
+	_ZNK13NmMessagePart18contentDispositionEv @ 171 NONAME
+	_ZNK13NmMessagePart4sizeEv @ 172 NONAME
+	_ZNK13NmMessagePart6partIdEv @ 173 NONAME
+	_ZNK13NmMessagePart9isMessageEv @ 174 NONAME
+	_ZNK17NmMessageEnvelope11isForwardedEv @ 175 NONAME
+	_ZNK17NmMessageEnvelope12ccRecipientsEv @ 176 NONAME
+	_ZNK17NmMessageEnvelope12toRecipientsEv @ 177 NONAME
+	_ZNK17NmMessageEnvelope13bccRecipientsEv @ 178 NONAME
+	_ZNK17NmMessageEnvelope14hasAttachmentsEv @ 179 NONAME
+	_ZNK17NmMessageEnvelope5flagsEv @ 180 NONAME
+	_ZNK17NmMessageEnvelope6isReadEv @ 181 NONAME
+	_ZNK17NmMessageEnvelope6senderEv @ 182 NONAME
+	_ZNK17NmMessageEnvelope7subjectEv @ 183 NONAME
+	_ZNK17NmMessageEnvelope8folderIdEv @ 184 NONAME
+	_ZNK17NmMessageEnvelope8priorityEv @ 185 NONAME
+	_ZNK17NmMessageEnvelope8sentTimeEv @ 186 NONAME
+	_ZNK17NmMessageEnvelope9isRepliedEv @ 187 NONAME
+	_ZNK17NmMessageEnvelope9mailboxIdEv @ 188 NONAME
+	_ZNK17NmMessageEnvelope9messageIdEv @ 189 NONAME
+	_ZNK17NmMessageEnvelopeeqERKS_ @ 190 NONAME
+	_ZNK17NmMessageEnvelopeneERKS_ @ 191 NONAME
+	_ZNK20NmMessagePartPrivate13isTextContentEv @ 192 NONAME
+	_ZNK20NmMessagePartPrivate9isMessageEv @ 193 NONAME
+	_ZNK24NmMessageEnvelopePrivate5flagsEv @ 194 NONAME
+	_ZNK24NmMessageEnvelopePrivate9isFlagSetE13NmMessageFlag @ 195 NONAME
+	_ZNK8NmFolder10folderTypeEv @ 196 NONAME
+	_ZNK8NmFolder11lastUpdatedEv @ 197 NONAME
+	_ZNK8NmFolder11unseenCountEv @ 198 NONAME
+	_ZNK8NmFolder12messageCountEv @ 199 NONAME
+	_ZNK8NmFolder14subFolderCountEv @ 200 NONAME
+	_ZNK8NmFolder18unreadMessageCountEv @ 201 NONAME
+	_ZNK8NmFolder4nameEv @ 202 NONAME
+	_ZNK8NmFolder8folderIdEv @ 203 NONAME
+	_ZNK8NmFolder8parentIdEv @ 204 NONAME
+	_ZNK8NmFolder9mailboxIdEv @ 205 NONAME
+	_ZNK9NmAddress11displayNameEv @ 206 NONAME
+	_ZNK9NmAddress7addressEv @ 207 NONAME
+	_ZNK9NmAddresseqERKS_ @ 208 NONAME
+	_ZNK9NmAddressneERKS_ @ 209 NONAME
+	_ZNK9NmMailbox2idEv @ 210 NONAME
+	_ZNK9NmMailbox4nameEv @ 211 NONAME
+	_ZNK9NmMailbox7addressEv @ 212 NONAME
+	_ZNK9NmMailboxeqERKS_ @ 213 NONAME
+	_ZNK9NmMessage12htmlBodyPartEv @ 214 NONAME
+	_ZNK9NmMessage14attachmentListER5QListIP13NmMessagePartE @ 215 NONAME
+	_ZNK9NmMessage17plainTextBodyPartEv @ 216 NONAME
+	_ZNK9NmMessage8envelopeEv @ 217 NONAME
+	_ZTI13NmMessagePart @ 218 NONAME
+	_ZTI15NmFolderPrivate @ 219 NONAME
+	_ZTI16NmAddressPrivate @ 220 NONAME
+	_ZTI16NmMailboxPrivate @ 221 NONAME
+	_ZTI16NmMessagePrivate @ 222 NONAME
+	_ZTI17NmMessageEnvelope @ 223 NONAME
+	_ZTI20NmMessagePartPrivate @ 224 NONAME
+	_ZTI24NmMessageEnvelopePrivate @ 225 NONAME
+	_ZTI8NmFolder @ 226 NONAME
+	_ZTI9NmAddress @ 227 NONAME
+	_ZTI9NmMailbox @ 228 NONAME
+	_ZTI9NmMessage @ 229 NONAME
+	_ZTV13NmMessagePart @ 230 NONAME
+	_ZTV15NmFolderPrivate @ 231 NONAME
+	_ZTV16NmAddressPrivate @ 232 NONAME
+	_ZTV16NmMailboxPrivate @ 233 NONAME
+	_ZTV16NmMessagePrivate @ 234 NONAME
+	_ZTV17NmMessageEnvelope @ 235 NONAME
+	_ZTV20NmMessagePartPrivate @ 236 NONAME
+	_ZTV24NmMessageEnvelopePrivate @ 237 NONAME
+	_ZTV8NmFolder @ 238 NONAME
+	_ZTV9NmAddress @ 239 NONAME
+	_ZTV9NmMailbox @ 240 NONAME
+	_ZTV9NmMessage @ 241 NONAME
 
--- a/emailservices/nmailbase/inc/nmcommon.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmailbase/inc/nmcommon.h	Fri May 14 15:41:10 2010 +0300
@@ -82,6 +82,12 @@
 };
 Q_DECLARE_METATYPE(NmSyncState)
 
+enum NmOperationType
+{
+    NoOp,
+    Synch
+};
+
 enum NmEnvelopeProperties
 {
 	MarkAsRead,
@@ -153,6 +159,7 @@
 const int NmCancelError = -3;
 const int NmAuthenticationError = -200;
 const int NmServerConnectionError = -201;
+const int NmConnectionError = -202;
 
 /*!
 	Predefined constants for ContentTypes and parameters
@@ -174,6 +181,12 @@
 
 const QString NmContentDescrAttachmentHtml = "Attachment.html";
 
+/*!
+   It keep info about maximum messages in message list.
+   
+   It is used in NmFrameworkAdapter and NmDataPluginInterface
+ */
+static const int NmMaxItemsInMessageList = 1000;
 
 /*!
     \class NmId
@@ -350,7 +363,7 @@
 class NmOperationCompletionEvent
 {
 public:
-    int  mOperationType;
+    NmOperationType  mOperationType;
     int  mCompletionCode;
     NmId mMailboxId;
     NmId mFolderId;
--- a/emailservices/nmailbase/inc/nmmailbox.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmailbase/inc/nmmailbox.h	Fri May 14 15:41:10 2010 +0300
@@ -48,8 +48,8 @@
     void setId(const NmId &id);
     QString name() const;
     void setName(const QString &name);
-    NmAddress address();
-    void setAddress(NmAddress& address);
+    NmAddress address() const;
+    void setAddress(const NmAddress& address);
     
     bool operator==(const NmMailbox &mailbox) const;
 
--- a/emailservices/nmailbase/inc/nmmessage.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmailbase/inc/nmmessage.h	Fri May 14 15:41:10 2010 +0300
@@ -23,39 +23,54 @@
 #include "nmbasedef.h"
 #include "nmcommon.h"
 #include "nmmessagepart.h"
+#include "nmmessageenvelope.h"
 
 class CFSMailMessage;
 
+class NMBASE_EXPORT NmMessagePrivate : public QSharedData
+{
+public:
+    NmMessagePrivate();
+    virtual ~NmMessagePrivate();
+public:
+    NmMessageEnvelope mEnvelope;
+};
+
 class NMBASE_EXPORT NmMessage : public NmMessagePart
 {
 public:
     NmMessage();
-    NmMessage(const NmId &id);
-    NmMessage(const NmId &id, const NmId &parentId);
-    NmMessage(const NmId &id, const NmId &parentId, const NmId &mailboxId);
+    NmMessage(const NmId &messageId);
+    NmMessage(const NmId &messageId, const NmId &folderId);
+    NmMessage(const NmId &messageId, const NmId &folderId, const NmId &mailboxId);
     NmMessage(const NmMessageEnvelope &envelope);
+
     NmMessage(const NmMessage &message);
     virtual ~NmMessage();
     NmMessage(const NmMessagePart& message);
 
-    virtual NmId id() const;
-    virtual void setId(const NmId &id);
-
     const NmMessagePart *plainTextBodyPart() const;
     NmMessagePart *plainTextBodyPart();
     const NmMessagePart *htmlBodyPart() const;
     NmMessagePart *htmlBodyPart();
 
-    void setEnvelope(const NmMessageEnvelope &envelope);
     NmMessageEnvelope &envelope();
     const NmMessageEnvelope &envelope() const;
 
-    CFSMailMessage* getCFSMailMessage();
-
     void attachmentList(QList<NmMessagePart*> &parts) const;
     
 private:
+    // prohibited
     NmMessage &operator=(const NmMessage &message);
+    
+    // for CFSMailMessage
+    NmMessage(const NmMessageEnvelope &envelope,
+            QExplicitlySharedDataPointer<NmMessagePartPrivate> nmPrivateMessagePart);
+    
+    friend class CFSMailMessage;
+
+private:
+    QExplicitlySharedDataPointer<NmMessagePrivate> d;
 
 };
 
--- a/emailservices/nmailbase/inc/nmmessageenvelope.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmailbase/inc/nmmessageenvelope.h	Fri May 14 15:41:10 2010 +0300
@@ -38,8 +38,8 @@
     bool isFlagSet(const NmMessageFlag flag) const;
 
 public:
-    NmId mId;
-    NmId mParentId; // id for top-level message/messageId for message parts
+    NmId mMessageId;
+    NmId mFolderId; // id for top-level message/messageId for message parts
     NmId mMailboxId;
     QString mSubject;
     NmAddress mSender;
@@ -58,7 +58,7 @@
 
 public:
     NmMessageEnvelope();
-    NmMessageEnvelope(const NmId &id);
+    NmMessageEnvelope(const NmId &messageId);
     NmMessageEnvelope(const NmMessageEnvelope &envelope);
     NmMessageEnvelope(QExplicitlySharedDataPointer<NmMessageEnvelopePrivate> nmPrivateMessageEnvelope);
     NmMessageEnvelope &operator=(const NmMessageEnvelope &envelope);
@@ -66,14 +66,14 @@
     bool operator!=(const NmMessageEnvelope &envelope) const;
     virtual ~NmMessageEnvelope();
 
-    void setId(const NmId &id);
-    NmId id() const;
+    void setMessageId(const NmId &messageId);
+    NmId messageId() const;
 
-    NmId parentId() const;
-    void setParentId(const NmId &id);
+    NmId folderId() const;
+    void setFolderId(const NmId &folderId);
 
     NmId mailboxId() const;
-    void setMailboxId(const NmId &id);
+    void setMailboxId(const NmId &mailboxId);
 
     void setSubject(const QString &subject);
     QString subject() const;
--- a/emailservices/nmailbase/inc/nmmessagepart.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmailbase/inc/nmmessagepart.h	Fri May 14 15:41:10 2010 +0300
@@ -34,7 +34,7 @@
 	bool isMessage() const;
 	bool isTextContent() const;
 
-	NmId mOwnId;	// message part id
+	NmId mPartId;
 
 	quint32 mSize;
 	quint32 mFetchedSize;
@@ -55,20 +55,14 @@
 public:
 
 	NmMessagePart();
-	NmMessagePart(const NmId &id);
-	NmMessagePart(const NmId &id, const NmId &parentId);
-	NmMessagePart(const NmId &id, const NmId &parentId, const NmId &mailboxId);
-	NmMessagePart(QExplicitlySharedDataPointer<NmMessagePartPrivate> nmPrivateMessagePart);
+	NmMessagePart(const NmId &partId);
+	
+	
 	virtual ~NmMessagePart();
 
-	virtual NmId id() const;
-	virtual void setId(const NmId &id);
-
-	NmId parentId() const;
-	void setParentId(const NmId &id);
-
-	NmId mailboxId() const;
-	void setMailboxId(const NmId &id);
+	virtual NmId partId() const;
+	virtual void setPartId(const NmId &id);
+	
 
 	quint32 size() const;
 	void setSize(quint32 size);
@@ -116,9 +110,9 @@
 	// this cannot be private, must be usable from derived class
     NmMessagePart(const NmMessagePart &part);
 
-    // NmMessageEnvelope for inherited classes
-    NmMessageEnvelope mEnvelope;
-
+    // for CFSMailMessagePart and NmMessage
+    NmMessagePart(QExplicitlySharedDataPointer<NmMessagePartPrivate> nmPrivateMessagePart);
+    
 private:
 	// prohibited
 	NmMessagePart &operator=(const NmMessagePart &part);
--- a/emailservices/nmailbase/src/nmmailbox.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmailbase/src/nmmailbox.cpp	Fri May 14 15:41:10 2010 +0300
@@ -122,13 +122,13 @@
 }
 
 
-NmAddress NmMailbox::address()
+NmAddress NmMailbox::address() const
 {
     return d->mAddress;
 }
 
 
-void NmMailbox::setAddress(NmAddress& address)
+void NmMailbox::setAddress(const NmAddress& address)
 {
     d->mAddress = address;
 }
--- a/emailservices/nmailbase/src/nmmessage.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmailbase/src/nmmessage.cpp	Fri May 14 15:41:10 2010 +0300
@@ -18,6 +18,21 @@
 #include "nmmessage.h"
 #include "nmmessageenvelope.h"
 
+/*!
+
+ */
+NmMessagePrivate::NmMessagePrivate() : mEnvelope(0)
+{
+    
+}
+
+/*!
+
+ */
+NmMessagePrivate::~NmMessagePrivate()
+{
+    
+}
 
 /*!
     \class NmMessage
@@ -29,46 +44,67 @@
  */
 NmMessage::NmMessage()
 {
+    d = new NmMessagePrivate();
 }
 
 /*!
     Constructs message with id \a id, parent id and mailbox id is set to null id
  */
-NmMessage::NmMessage(const NmId &id):NmMessagePart(id)
+NmMessage::NmMessage(const NmId &messageId) : NmMessagePart(0)
 {
-    mEnvelope.setId(id);
+    d = new NmMessagePrivate();
+    d->mEnvelope.setMessageId(messageId);
 }
 
 /*!
     Constructs message part with id \a id and with parent id \a parentId,
     mailbox id is set to null id
  */
-NmMessage::NmMessage(const NmId &id, const NmId &parentId)
-:NmMessagePart(id, parentId)
+NmMessage::NmMessage(const NmId &messageId, const NmId &folderId)
+: NmMessagePart(0)
 {
-	mEnvelope.setId(id);
+    d = new NmMessagePrivate();
+	d->mEnvelope.setMessageId(messageId);
+	d->mEnvelope.setFolderId(folderId);
 }
 
 /*!
     Constructs message with id \a id, with parent id \a parentId and
     with mailbox id \a mailboxId
  */
-NmMessage::NmMessage(const NmId &id,
-                     const NmId &parentId,
+NmMessage::NmMessage(const NmId &messageId,
+                     const NmId &folderId,
                      const NmId &mailboxId)
-:NmMessagePart(id, parentId, mailboxId)
+:NmMessagePart(0)
 {
-	mEnvelope.setId(id);
+    d = new NmMessagePrivate();
+	d->mEnvelope.setMessageId(messageId);
+	d->mEnvelope.setFolderId(folderId);
+	d->mEnvelope.setMailboxId(mailboxId);
 }
 
 /*!
-    Constructs message with meta data
+    Constructs message from envelope
  */
 NmMessage::NmMessage(const NmMessageEnvelope &envelope)
 {
-	mEnvelope = envelope;
-    // set message id same as meta data id
-    this->setId(envelope.id());
+    d = new NmMessagePrivate();
+    d->mEnvelope = envelope;
+    // set message id same as envelope id
+    //this->setMessageId(envelope.messageId());
+}
+
+/*!
+    Constructs message from envelope and message part private
+ */
+NmMessage::NmMessage(const NmMessageEnvelope &envelope,
+        QExplicitlySharedDataPointer<NmMessagePartPrivate> nmPrivateMessagePart)
+        : NmMessagePart(nmPrivateMessagePart)
+{
+    d = new NmMessagePrivate();
+	d->mEnvelope = envelope;
+    // set message id same as envelope id
+    //this->setMessageId(envelope.messageId());
 }
 
 /*!
@@ -76,12 +112,11 @@
  */
 NmMessage::NmMessage(const NmMessagePart& message):NmMessagePart(message)
 {
-	mEnvelope.setId( message.id() );
+    d = new NmMessagePrivate();
 }
 
-NmMessage::NmMessage(const NmMessage& message):NmMessagePart(message)
+NmMessage::NmMessage(const NmMessage& message):NmMessagePart(message), d(message.d)
 {
-	mEnvelope.setId( message.id() );
 }
 
 /*!
@@ -90,7 +125,7 @@
 NmMessage &NmMessage::operator=(const NmMessage &message)
 {
 	if (this != &message) {
-		mEnvelope.setId( message.id() );
+		d = message.d;
 	}
 	return *this;
 }
@@ -103,24 +138,6 @@
 }
 
 /*!
-    returns id of envelope
- */
-NmId NmMessage::id() const
-{
-    return mEnvelope.id();
-}
-
-
-/*!
-    Sets id to envelope
- */
-void NmMessage::setId(const NmId &id)
-{
-    //NmMessagePart::setId(id);
-    mEnvelope.setId(id);
-}
-
-/*!
     Returns pointer to plain text body, if plain text body is not found
     returns null pointer. Ownership of message part object is not transferred.
     Do not delete returned pointer. Non-modifying version.
@@ -169,25 +186,11 @@
 }
 
 /*!
-    Sets message meta data. If meta data id is different than null id, messages
-    id is set to \a envelope's id
- */
-void NmMessage::setEnvelope(const NmMessageEnvelope &envelope)
-{
-    mEnvelope = envelope;
-    if (envelope.id() != 0) {
-        this->setId(envelope.id());
-    } else {
-        mEnvelope.setId(this->id());
-    }
-}
-
-/*!
     Returns reference to message envelope
  */
 NmMessageEnvelope &NmMessage::envelope()
 {
-    return mEnvelope;
+    return d->mEnvelope;
 }
 
 /*!
@@ -195,7 +198,7 @@
  */
 const NmMessageEnvelope &NmMessage::envelope() const
 {
-    return mEnvelope;
+    return d->mEnvelope;
 }
 
 /**
@@ -221,7 +224,7 @@
         if ( txtPart ) {
             // remove plain text body part from attachment list
             for ( int i = parts.count() - 1; i >= 0; --i ) {
-                if ( parts.at(i)->id() == txtPart->id() ) {
+                if ( parts.at(i)->partId() == txtPart->partId() ) {
                     parts.removeAt(i);
                     break;
                 }
@@ -232,7 +235,7 @@
         if ( htmlPart ) {
             // remove html body part from attachment list
             for ( int i = parts.count() - 1; i >= 0; --i ) {
-                if ( parts.at(i)->id() == htmlPart->id() ) {
+                if ( parts.at(i)->partId() == htmlPart->partId() ) {
                     parts.removeAt(i);
                     break;
                 }
--- a/emailservices/nmailbase/src/nmmessageenvelope.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmailbase/src/nmmessageenvelope.cpp	Fri May 14 15:41:10 2010 +0300
@@ -24,7 +24,8 @@
     Constructor of NmMessageEnvelopePrivate object
  */
 NmMessageEnvelopePrivate::NmMessageEnvelopePrivate()
-:mId(0),
+:mMessageId(0),
+mFolderId(0),
 mMailboxId(0),
 mMessageFlags(0)
 {
@@ -84,10 +85,10 @@
 /*!
     Constructor with id
  */
-NmMessageEnvelope::NmMessageEnvelope(const NmId &id)
+NmMessageEnvelope::NmMessageEnvelope(const NmId &messageId)
 {
     d = new NmMessageEnvelopePrivate();
-    d->mId = id;
+    d->mMessageId = messageId;
 }
 
 /*!
@@ -129,7 +130,7 @@
         && sentTime() == envelope.sentTime()
         && flags() == envelope.flags()
         && mailboxId() == envelope.mailboxId()
-        && parentId() == envelope.parentId()) {
+        && folderId() == envelope.folderId()) {
         ret = true;
     }
     return ret;
@@ -154,33 +155,33 @@
 /*!
     Sets message id
  */
-void NmMessageEnvelope::setId(const NmId &id)
+void NmMessageEnvelope::setMessageId(const NmId &messageId)
 {
-    d->mId = id;
+    d->mMessageId = messageId;
 }
 
 /*!
     Returns id of message
  */
-NmId NmMessageEnvelope::id() const
+NmId NmMessageEnvelope::messageId() const
 {
-    return d->mId;
+    return d->mMessageId;
 }
 
 /*!
     Returns parent id of this envelope
  */
-NmId NmMessageEnvelope::parentId() const
+NmId NmMessageEnvelope::folderId() const
 {
-    return d->mParentId;
+    return d->mFolderId;
 }
 
 /*!
     Sets the parent id for this envelope
  */
-void NmMessageEnvelope::setParentId(const NmId &id)
+void NmMessageEnvelope::setFolderId(const NmId &folderId)
 {
-    d->mParentId = id;
+    d->mFolderId = folderId;
 }
 
 /*!
@@ -194,9 +195,9 @@
 /*!
     Sets the mailbox id for this envelope
  */
-void NmMessageEnvelope::setMailboxId(const NmId &id)
+void NmMessageEnvelope::setMailboxId(const NmId &mailboxId)
 {
-    d->mMailboxId = id;
+    d->mMailboxId = mailboxId;
 }
 
 /*!
--- a/emailservices/nmailbase/src/nmmessagepart.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmailbase/src/nmmessagepart.cpp	Fri May 14 15:41:10 2010 +0300
@@ -23,7 +23,7 @@
     Constructs message part private with null id
  */
 NmMessagePartPrivate::NmMessagePartPrivate()
-		: mOwnId(0), mSize(0), mFetchedSize(0),
+		: mPartId(0), mSize(0), mFetchedSize(0),
 		mTextContent(0)
 {
 }
@@ -83,36 +83,10 @@
 /*!
     Constructs message part with id \a id, parent id and mailbox id is set null
  */
-NmMessagePart::NmMessagePart(const NmId &id)
-{
-    d = new NmMessagePartPrivate();
-    d->mOwnId = id;
-}
-
-/*!
-    Constructs message part with id \a id and with parent id \a parentId,
-    mailbox id is set to null
- */
-NmMessagePart::NmMessagePart(const NmId &id, const NmId &parentId)
+NmMessagePart::NmMessagePart(const NmId &partId)
 {
     d = new NmMessagePartPrivate();
-    d->mOwnId = id;
-    mEnvelope.setParentId(parentId);
-}
-
-/*!
-    Constructs message part with id \a id, with parent id \a parentId and
-    with mailbox id \a mailboxId
- */
-NmMessagePart::NmMessagePart(
-    const NmId &id,
-    const NmId &parentId,
-    const NmId &mailboxId)
-{
-	d = new NmMessagePartPrivate();
-	d->mOwnId = id;
-    mEnvelope.setParentId(parentId);
-	mEnvelope.setMailboxId(mailboxId);
+    d->mPartId = partId;
 }
 
 /*!
@@ -129,8 +103,6 @@
  */
 NmMessagePart::NmMessagePart(const NmMessagePart &part) : d(part.d)
 {
-    mEnvelope.setParentId(part.mEnvelope.parentId());
-    mEnvelope.setMailboxId(part.mEnvelope.mailboxId());
 }
 
 /*!
@@ -140,8 +112,6 @@
 {
 	if (this != &part) {
 		d = part.d;
-	    mEnvelope.setParentId(part.mEnvelope.parentId());
-	    mEnvelope.setMailboxId(part.mEnvelope.mailboxId());
 	}
 	return *this;
 }
@@ -160,49 +130,17 @@
 /*!
     Retruns id of message part
  */
-NmId NmMessagePart::id() const
+NmId NmMessagePart::partId() const
 {
-    return d->mOwnId;
+    return d->mPartId;
 }
 
 /*!
     Sets id of message part from \a id
  */
-void NmMessagePart::setId(const NmId &id)
-{
-    d->mOwnId = id;
-}
-
-/*!
-    Returns parts parent id
- */
-NmId NmMessagePart::parentId() const
-{
-    return mEnvelope.parentId();
-}
-
-/*!
-    Sets message part parent id from \a id
- */
-void NmMessagePart::setParentId(const NmId &id)
+void NmMessagePart::setPartId(const NmId &id)
 {
-    mEnvelope.setParentId(id);
-}
-
-/*!
-    Returns mailbox id where part belong to
- */
-NmId NmMessagePart::mailboxId() const
-{
-    return mEnvelope.mailboxId();
-}
-
-/*!
-    Sets mailbox id from \a id
- */
-void NmMessagePart::setMailboxId(const NmId &id)
-{
-    mEnvelope.setMailboxId(id);
+    d->mPartId = id;
 }
 
 /*!
@@ -346,8 +284,6 @@
     }
     for (int i = 0; i < parts.count(); i++) {
         if (parts[i] != NULL) {
-            parts[i]->setParentId(this->id());
-            parts[i]->setMailboxId(this->mailboxId());
             d->mChildParts.append(parts[i]);
         }
     }
@@ -372,8 +308,6 @@
     if (!part) {
         return;
     }
-    part->setParentId(this->id());
-    part->setMailboxId(this->mailboxId());
     d->mChildParts.append(part);
 }
 
@@ -384,7 +318,7 @@
 void NmMessagePart::removeChildPart(const NmId &partId)
 {
     for (int i = 0; i < d->mChildParts.count(); i++) {
-        if (d->mChildParts[i]->id() == partId) {
+        if (d->mChildParts[i]->partId() == partId) {
             delete d->mChildParts[i];
             d->mChildParts.removeAt(i);
             return;
--- a/emailservices/nmclientapi/bwins/nmailclientapiu.def	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/bwins/nmailclientapiu.def	Fri May 14 15:41:10 2010 +0300
@@ -1,181 +1,190 @@
 EXPORTS
-	?getFolders@NmFolderListing@EmailClientApi@@QAE_NAAV?$QList@VNmFolder@EmailClientApi@@@@@Z @ 1 NONAME ; bool EmailClientApi::NmFolderListing::getFolders(class QList<class EmailClientApi::NmFolder> &)
-	?setId@NmMessageEnvelope@EmailClientApi@@QAEX_K@Z @ 2 NONAME ; void EmailClientApi::NmMessageEnvelope::setId(unsigned long long)
-	?qt_metacall@NmEnvelopeListing@EmailClientApi@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 3 NONAME ; int EmailClientApi::NmEnvelopeListing::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?metaObject@NmEnvelopeListing@EmailClientApi@@UBEPBUQMetaObject@@XZ @ 4 NONAME ; struct QMetaObject const * EmailClientApi::NmEnvelopeListing::metaObject(void) const
-	?setCcRecipients@NmMessageEnvelope@EmailClientApi@@QAEXABV?$QList@VNmEmailAddress@EmailClientApi@@@@@Z @ 5 NONAME ; void EmailClientApi::NmMessageEnvelope::setCcRecipients(class QList<class EmailClientApi::NmEmailAddress> const &)
-	?trUtf8@NmMailboxListing@EmailClientApi@@SA?AVQString@@PBD0@Z @ 6 NONAME ; class QString EmailClientApi::NmMailboxListing::trUtf8(char const *, char const *)
-	?trUtf8@NmFolderListing@EmailClientApi@@SA?AVQString@@PBD0@Z @ 7 NONAME ; class QString EmailClientApi::NmFolderListing::trUtf8(char const *, char const *)
-	?uninitialise@NmEmailService@EmailClientApi@@QAEXXZ @ 8 NONAME ; void EmailClientApi::NmEmailService::uninitialise(void)
-	?trUtf8@NmEnvelopeListing@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 9 NONAME ; class QString EmailClientApi::NmEnvelopeListing::trUtf8(char const *, char const *, int)
-	?foldersListed@NmFolderListing@EmailClientApi@@IAEXH@Z @ 10 NONAME ; void EmailClientApi::NmFolderListing::foldersListed(int)
-	?start@NmFolderListing@EmailClientApi@@UAE_NXZ @ 11 NONAME ; bool EmailClientApi::NmFolderListing::start(void)
-	?qt_metacall@NmEmailService@EmailClientApi@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 12 NONAME ; int EmailClientApi::NmEmailService::qt_metacall(enum QMetaObject::Call, int, void * *)
-	??0NmFolder@EmailClientApi@@QAE@ABV01@@Z @ 13 NONAME ; EmailClientApi::NmFolder::NmFolder(class EmailClientApi::NmFolder const &)
-	?isReplied@NmMessageEnvelope@EmailClientApi@@QBE_NXZ @ 14 NONAME ; bool EmailClientApi::NmMessageEnvelope::isReplied(void) const
-	?setName@NmMailbox@EmailClientApi@@QAEXABVQString@@@Z @ 15 NONAME ; void EmailClientApi::NmMailbox::setName(class QString const &)
-	?isRead@NmMessageEnvelope@EmailClientApi@@QBE_NXZ @ 16 NONAME ; bool EmailClientApi::NmMessageEnvelope::isRead(void) const
-	?qt_metacall@NmEventNotifier@EmailClientApi@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 17 NONAME ; int EmailClientApi::NmEventNotifier::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?cancel@NmEnvelopeListing@EmailClientApi@@UAEXXZ @ 18 NONAME ; void EmailClientApi::NmEnvelopeListing::cancel(void)
-	?setHasAttachments@NmMessageEnvelope@EmailClientApi@@QAEX_N@Z @ 19 NONAME ; void EmailClientApi::NmMessageEnvelope::setHasAttachments(bool)
-	??0NmMailboxListing@EmailClientApi@@QAE@PAVQObject@@@Z @ 20 NONAME ; EmailClientApi::NmMailboxListing::NmMailboxListing(class QObject *)
-	?sendEventsFromBuffer@NmEventNotifier@EmailClientApi@@QAEXXZ @ 21 NONAME ; void EmailClientApi::NmEventNotifier::sendEventsFromBuffer(void)
-	?mailboxEvent@NmEventNotifier@EmailClientApi@@IAEXW4MailboxEvent@@V?$QList@_K@@@Z @ 22 NONAME ; void EmailClientApi::NmEventNotifier::mailboxEvent(enum MailboxEvent, class QList<unsigned long long>)
-	?hasAttachments@NmMessageEnvelope@EmailClientApi@@QBE_NXZ @ 23 NONAME ; bool EmailClientApi::NmMessageEnvelope::hasAttachments(void) const
-	??_ENmEventNotifier@EmailClientApi@@UAE@I@Z @ 24 NONAME ; EmailClientApi::NmEventNotifier::~NmEventNotifier(unsigned int)
-	??0NmMessageEnvelope@EmailClientApi@@QAE@XZ @ 25 NONAME ; EmailClientApi::NmMessageEnvelope::NmMessageEnvelope(void)
-	?setSender@NmMessageEnvelope@EmailClientApi@@QAEXABVQString@@@Z @ 26 NONAME ; void EmailClientApi::NmMessageEnvelope::setSender(class QString const &)
-	?qt_metacast@NmMessageTask@@UAEPAXPBD@Z @ 27 NONAME ; void * NmMessageTask::qt_metacast(char const *)
-	?qt_metacast@NmEmailService@EmailClientApi@@UAEPAXPBD@Z @ 28 NONAME ; void * EmailClientApi::NmEmailService::qt_metacast(char const *)
-	??0NmMessageEnvelope@EmailClientApi@@QAE@ABV01@@Z @ 29 NONAME ; EmailClientApi::NmMessageEnvelope::NmMessageEnvelope(class EmailClientApi::NmMessageEnvelope const &)
-	?totalSize@NmMessageBody@EmailClientApi@@QBE_KXZ @ 30 NONAME ; unsigned long long EmailClientApi::NmMessageBody::totalSize(void) const
-	?qt_metacast@NmFolderListing@EmailClientApi@@UAEPAXPBD@Z @ 31 NONAME ; void * EmailClientApi::NmFolderListing::qt_metacast(char const *)
-	?trUtf8@NmEventNotifier@EmailClientApi@@SA?AVQString@@PBD0@Z @ 32 NONAME ; class QString EmailClientApi::NmEventNotifier::trUtf8(char const *, char const *)
-	?initialized@NmEmailService@EmailClientApi@@IAEX_N@Z @ 33 NONAME ; void EmailClientApi::NmEmailService::initialized(bool)
-	??0NmMessageTask@@IAE@PAVQObject@@@Z @ 34 NONAME ; NmMessageTask::NmMessageTask(class QObject *)
-	??0NmFolderListing@EmailClientApi@@QAE@PAVQObject@@AB_K@Z @ 35 NONAME ; EmailClientApi::NmFolderListing::NmFolderListing(class QObject *, unsigned long long const &)
-	?setToRecipients@NmMessageEnvelope@EmailClientApi@@QAEXABV?$QList@VNmEmailAddress@EmailClientApi@@@@@Z @ 36 NONAME ; void EmailClientApi::NmMessageEnvelope::setToRecipients(class QList<class EmailClientApi::NmEmailAddress> const &)
-	?cancel@NmMailboxListing@EmailClientApi@@UAEXXZ @ 37 NONAME ; void EmailClientApi::NmMailboxListing::cancel(void)
-	?staticMetaObject@NmFolderListing@EmailClientApi@@2UQMetaObject@@B @ 38 NONAME ; struct QMetaObject const EmailClientApi::NmFolderListing::staticMetaObject
-	??1NmEmailService@EmailClientApi@@UAE@XZ @ 39 NONAME ; EmailClientApi::NmEmailService::~NmEmailService(void)
-	?setDisplayName@NmEmailAddress@EmailClientApi@@QAEXABVQString@@@Z @ 40 NONAME ; void EmailClientApi::NmEmailAddress::setDisplayName(class QString const &)
-	??4NmMessageEnvelope@EmailClientApi@@QAEAAV01@ABV01@@Z @ 41 NONAME ; class EmailClientApi::NmMessageEnvelope & EmailClientApi::NmMessageEnvelope::operator=(class EmailClientApi::NmMessageEnvelope const &)
-	?getStaticMetaObject@NmMailboxListing@EmailClientApi@@SAABUQMetaObject@@XZ @ 42 NONAME ; struct QMetaObject const & EmailClientApi::NmMailboxListing::getStaticMetaObject(void)
-	?setIsForwarded@NmMessageEnvelope@EmailClientApi@@QAEX_N@Z @ 43 NONAME ; void EmailClientApi::NmMessageEnvelope::setIsForwarded(bool)
-	?getEnvelope@NmEmailService@EmailClientApi@@QAE_N_K00AAVNmMessageEnvelope@2@@Z @ 44 NONAME ; bool EmailClientApi::NmEmailService::getEnvelope(unsigned long long, unsigned long long, unsigned long long, class EmailClientApi::NmMessageEnvelope &)
-	??_ENmEnvelopeListing@EmailClientApi@@UAE@I@Z @ 45 NONAME ; EmailClientApi::NmEnvelopeListing::~NmEnvelopeListing(unsigned int)
-	?tr@NmEnvelopeListing@EmailClientApi@@SA?AVQString@@PBD0@Z @ 46 NONAME ; class QString EmailClientApi::NmEnvelopeListing::tr(char const *, char const *)
-	??_ENmMailboxListing@EmailClientApi@@UAE@I@Z @ 47 NONAME ; EmailClientApi::NmMailboxListing::~NmMailboxListing(unsigned int)
-	?isForwarded@NmMessageEnvelope@EmailClientApi@@QBE_NXZ @ 48 NONAME ; bool EmailClientApi::NmMessageEnvelope::isForwarded(void) const
-	?getStaticMetaObject@NmEnvelopeListing@EmailClientApi@@SAABUQMetaObject@@XZ @ 49 NONAME ; struct QMetaObject const & EmailClientApi::NmEnvelopeListing::getStaticMetaObject(void)
-	?staticMetaObject@NmMessageTask@@2UQMetaObject@@B @ 50 NONAME ; struct QMetaObject const NmMessageTask::staticMetaObject
-	?trUtf8@NmEmailService@EmailClientApi@@SA?AVQString@@PBD0@Z @ 51 NONAME ; class QString EmailClientApi::NmEmailService::trUtf8(char const *, char const *)
-	??0NmEnvelopeListing@EmailClientApi@@QAE@PAVQObject@@_K1@Z @ 52 NONAME ; EmailClientApi::NmEnvelopeListing::NmEnvelopeListing(class QObject *, unsigned long long, unsigned long long)
-	?setAddress@NmEmailAddress@EmailClientApi@@QAEXABVQString@@@Z @ 53 NONAME ; void EmailClientApi::NmEmailAddress::setAddress(class QString const &)
-	?parentFolderId@NmFolder@EmailClientApi@@QBE_KXZ @ 54 NONAME ; unsigned long long EmailClientApi::NmFolder::parentFolderId(void) const
-	?getMailboxes@NmMailboxListing@EmailClientApi@@QAE_NAAV?$QList@VNmMailbox@EmailClientApi@@@@@Z @ 55 NONAME ; bool EmailClientApi::NmMailboxListing::getMailboxes(class QList<class EmailClientApi::NmMailbox> &)
-	?setParentFolderId@NmFolder@EmailClientApi@@QAEX_K@Z @ 56 NONAME ; void EmailClientApi::NmFolder::setParentFolderId(unsigned long long)
-	?id@NmFolder@EmailClientApi@@QBE_KXZ @ 57 NONAME ; unsigned long long EmailClientApi::NmFolder::id(void) const
-	?qt_metacall@NmMessageTask@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 58 NONAME ; int NmMessageTask::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?trUtf8@NmEnvelopeListing@EmailClientApi@@SA?AVQString@@PBD0@Z @ 59 NONAME ; class QString EmailClientApi::NmEnvelopeListing::trUtf8(char const *, char const *)
-	?setFetchedSize@NmMessageEnvelope@EmailClientApi@@QAEX_K@Z @ 60 NONAME ; void EmailClientApi::NmMessageEnvelope::setFetchedSize(unsigned long long)
-	?name@NmMailbox@EmailClientApi@@QBE?AVQString@@XZ @ 61 NONAME ; class QString EmailClientApi::NmMailbox::name(void) const
-	?getStaticMetaObject@NmMessageTask@@SAABUQMetaObject@@XZ @ 62 NONAME ; struct QMetaObject const & NmMessageTask::getStaticMetaObject(void)
-	?initialise@NmEmailService@EmailClientApi@@QAEXXZ @ 63 NONAME ; void EmailClientApi::NmEmailService::initialise(void)
-	?id@NmMessageEnvelope@EmailClientApi@@QBE_KXZ @ 64 NONAME ; unsigned long long EmailClientApi::NmMessageEnvelope::id(void) const
-	?setIsReplied@NmMessageEnvelope@EmailClientApi@@QAEX_N@Z @ 65 NONAME ; void EmailClientApi::NmMessageEnvelope::setIsReplied(bool)
-	??_ENmMessageEnvelope@EmailClientApi@@UAE@I@Z @ 66 NONAME ; EmailClientApi::NmMessageEnvelope::~NmMessageEnvelope(unsigned int)
-	?isRunning@NmEnvelopeListing@EmailClientApi@@QBE_NXZ @ 67 NONAME ; bool EmailClientApi::NmEnvelopeListing::isRunning(void) const
-	?tr@NmFolderListing@EmailClientApi@@SA?AVQString@@PBD0@Z @ 68 NONAME ; class QString EmailClientApi::NmFolderListing::tr(char const *, char const *)
-	?sender@NmMessageEnvelope@EmailClientApi@@QBE?AVQString@@XZ @ 69 NONAME ; class QString EmailClientApi::NmMessageEnvelope::sender(void) const
-	?canceled@NmMessageTask@@IAEXXZ @ 70 NONAME ; void NmMessageTask::canceled(void)
-	?isRunning@NmMailboxListing@EmailClientApi@@QBE_NXZ @ 71 NONAME ; bool EmailClientApi::NmMailboxListing::isRunning(void) const
-	?address@NmEmailAddress@EmailClientApi@@QBE?AVQString@@XZ @ 72 NONAME ; class QString EmailClientApi::NmEmailAddress::address(void) const
-	?staticMetaObject@NmMailboxListing@EmailClientApi@@2UQMetaObject@@B @ 73 NONAME ; struct QMetaObject const EmailClientApi::NmMailboxListing::staticMetaObject
-	?tr@NmFolderListing@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 74 NONAME ; class QString EmailClientApi::NmFolderListing::tr(char const *, char const *, int)
-	??1NmMessageEnvelope@EmailClientApi@@UAE@XZ @ 75 NONAME ; EmailClientApi::NmMessageEnvelope::~NmMessageEnvelope(void)
-	?setContent@NmMessageBody@EmailClientApi@@QAEXABVQString@@@Z @ 76 NONAME ; void EmailClientApi::NmMessageBody::setContent(class QString const &)
-	?getStaticMetaObject@NmEmailService@EmailClientApi@@SAABUQMetaObject@@XZ @ 77 NONAME ; struct QMetaObject const & EmailClientApi::NmEmailService::getStaticMetaObject(void)
-	?tr@NmEnvelopeListing@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 78 NONAME ; class QString EmailClientApi::NmEnvelopeListing::tr(char const *, char const *, int)
-	?folderType@NmFolder@EmailClientApi@@QBE?AW4EmailFolderType@2@XZ @ 79 NONAME ; enum EmailClientApi::EmailFolderType EmailClientApi::NmFolder::folderType(void) const
-	?tr@NmMailboxListing@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 80 NONAME ; class QString EmailClientApi::NmMailboxListing::tr(char const *, char const *, int)
-	??4NmMailbox@EmailClientApi@@QAEAAV01@ABV01@@Z @ 81 NONAME ; class EmailClientApi::NmMailbox & EmailClientApi::NmMailbox::operator=(class EmailClientApi::NmMailbox const &)
-	??_ENmMessageBody@EmailClientApi@@UAE@I@Z @ 82 NONAME ; EmailClientApi::NmMessageBody::~NmMessageBody(unsigned int)
-	?tr@NmMessageTask@@SA?AVQString@@PBD0@Z @ 83 NONAME ; class QString NmMessageTask::tr(char const *, char const *)
-	?setId@NmMailbox@EmailClientApi@@QAEX_K@Z @ 84 NONAME ; void EmailClientApi::NmMailbox::setId(unsigned long long)
-	?qt_metacast@NmEnvelopeListing@EmailClientApi@@UAEPAXPBD@Z @ 85 NONAME ; void * EmailClientApi::NmEnvelopeListing::qt_metacast(char const *)
-	?trUtf8@NmEmailService@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 86 NONAME ; class QString EmailClientApi::NmEmailService::trUtf8(char const *, char const *, int)
-	?tr@NmEventNotifier@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 87 NONAME ; class QString EmailClientApi::NmEventNotifier::tr(char const *, char const *, int)
-	??1NmMailboxListing@EmailClientApi@@UAE@XZ @ 88 NONAME ; EmailClientApi::NmMailboxListing::~NmMailboxListing(void)
-	??1NmEmailAddress@EmailClientApi@@UAE@XZ @ 89 NONAME ; EmailClientApi::NmEmailAddress::~NmEmailAddress(void)
-	??_ENmFolderListing@EmailClientApi@@UAE@I@Z @ 90 NONAME ; EmailClientApi::NmFolderListing::~NmFolderListing(unsigned int)
-	??1NmMailbox@EmailClientApi@@UAE@XZ @ 91 NONAME ; EmailClientApi::NmMailbox::~NmMailbox(void)
-	?failed@NmMessageTask@@IAEXH@Z @ 92 NONAME ; void NmMessageTask::failed(int)
-	?messageEvent@NmEventNotifier@EmailClientApi@@IAEXW4MessageEvent@@_K1V?$QList@_K@@@Z @ 93 NONAME ; void EmailClientApi::NmEventNotifier::messageEvent(enum MessageEvent, unsigned long long, unsigned long long, class QList<unsigned long long>)
-	?tr@NmMessageTask@@SA?AVQString@@PBD0H@Z @ 94 NONAME ; class QString NmMessageTask::tr(char const *, char const *, int)
-	??0NmEmailAddress@EmailClientApi@@QAE@ABV01@@Z @ 95 NONAME ; EmailClientApi::NmEmailAddress::NmEmailAddress(class EmailClientApi::NmEmailAddress const &)
-	?totalSize@NmMessageEnvelope@EmailClientApi@@QBE_KXZ @ 96 NONAME ; unsigned long long EmailClientApi::NmMessageEnvelope::totalSize(void) const
-	??_ENmEmailAddress@EmailClientApi@@UAE@I@Z @ 97 NONAME ; EmailClientApi::NmEmailAddress::~NmEmailAddress(unsigned int)
-	?trUtf8@NmMailboxListing@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 98 NONAME ; class QString EmailClientApi::NmMailboxListing::trUtf8(char const *, char const *, int)
-	?setSentTime@NmMessageEnvelope@EmailClientApi@@QAEXVQDateTime@@@Z @ 99 NONAME ; void EmailClientApi::NmMessageEnvelope::setSentTime(class QDateTime)
-	?address@NmMailbox@EmailClientApi@@QBE?AVQString@@XZ @ 100 NONAME ; class QString EmailClientApi::NmMailbox::address(void) const
-	?sentTime@NmMessageEnvelope@EmailClientApi@@QBE?AVQDateTime@@XZ @ 101 NONAME ; class QDateTime EmailClientApi::NmMessageEnvelope::sentTime(void) const
-	?tr@NmEventNotifier@EmailClientApi@@SA?AVQString@@PBD0@Z @ 102 NONAME ; class QString EmailClientApi::NmEventNotifier::tr(char const *, char const *)
-	?setName@NmFolder@EmailClientApi@@QAEXABVQString@@@Z @ 103 NONAME ; void EmailClientApi::NmFolder::setName(class QString const &)
-	?qt_metacast@NmEventNotifier@EmailClientApi@@UAEPAXPBD@Z @ 104 NONAME ; void * EmailClientApi::NmEventNotifier::qt_metacast(char const *)
-	?metaObject@NmFolderListing@EmailClientApi@@UBEPBUQMetaObject@@XZ @ 105 NONAME ; struct QMetaObject const * EmailClientApi::NmFolderListing::metaObject(void) const
-	?tr@NmEmailService@EmailClientApi@@SA?AVQString@@PBD0@Z @ 106 NONAME ; class QString EmailClientApi::NmEmailService::tr(char const *, char const *)
-	?staticMetaObject@NmEnvelopeListing@EmailClientApi@@2UQMetaObject@@B @ 107 NONAME ; struct QMetaObject const EmailClientApi::NmEnvelopeListing::staticMetaObject
-	?displayName@NmEmailAddress@EmailClientApi@@QBE?AVQString@@XZ @ 108 NONAME ; class QString EmailClientApi::NmEmailAddress::displayName(void) const
-	?getMailbox@NmEmailService@EmailClientApi@@QAE_N_KAAVNmMailbox@2@@Z @ 109 NONAME ; bool EmailClientApi::NmEmailService::getMailbox(unsigned long long, class EmailClientApi::NmMailbox &)
-	?id@NmMailbox@EmailClientApi@@QBE_KXZ @ 110 NONAME ; unsigned long long EmailClientApi::NmMailbox::id(void) const
-	?plainText@NmMessageEnvelope@EmailClientApi@@QBE?AVQString@@XZ @ 111 NONAME ; class QString EmailClientApi::NmMessageEnvelope::plainText(void) const
-	??_ENmFolder@EmailClientApi@@QAE@I@Z @ 112 NONAME ; EmailClientApi::NmFolder::~NmFolder(unsigned int)
-	?mailboxesListed@NmMailboxListing@EmailClientApi@@IAEXH@Z @ 113 NONAME ; void EmailClientApi::NmMailboxListing::mailboxesListed(int)
-	?isRunning@NmEventNotifier@EmailClientApi@@QBE_NXZ @ 114 NONAME ; bool EmailClientApi::NmEventNotifier::isRunning(void) const
-	?tr@NmMailboxListing@EmailClientApi@@SA?AVQString@@PBD0@Z @ 115 NONAME ; class QString EmailClientApi::NmMailboxListing::tr(char const *, char const *)
-	??0NmFolder@EmailClientApi@@QAE@XZ @ 116 NONAME ; EmailClientApi::NmFolder::NmFolder(void)
-	?start@NmMailboxListing@EmailClientApi@@UAE_NXZ @ 117 NONAME ; bool EmailClientApi::NmMailboxListing::start(void)
-	?setPlainText@NmMessageEnvelope@EmailClientApi@@QAEXABVQString@@@Z @ 118 NONAME ; void EmailClientApi::NmMessageEnvelope::setPlainText(class QString const &)
-	?fetchedSize@NmMessageBody@EmailClientApi@@QBE_KXZ @ 119 NONAME ; unsigned long long EmailClientApi::NmMessageBody::fetchedSize(void) const
-	?cancel@NmEventNotifier@EmailClientApi@@UAEXXZ @ 120 NONAME ; void EmailClientApi::NmEventNotifier::cancel(void)
-	??1NmEventNotifier@EmailClientApi@@UAE@XZ @ 121 NONAME ; EmailClientApi::NmEventNotifier::~NmEventNotifier(void)
-	??_ENmMessageTask@@UAE@I@Z @ 122 NONAME ; NmMessageTask::~NmMessageTask(unsigned int)
-	?metaObject@NmEventNotifier@EmailClientApi@@UBEPBUQMetaObject@@XZ @ 123 NONAME ; struct QMetaObject const * EmailClientApi::NmEventNotifier::metaObject(void) const
-	??0NmEmailService@EmailClientApi@@QAE@PAVQObject@@@Z @ 124 NONAME ; EmailClientApi::NmEmailService::NmEmailService(class QObject *)
-	??1NmMessageBody@EmailClientApi@@UAE@XZ @ 125 NONAME ; EmailClientApi::NmMessageBody::~NmMessageBody(void)
-	?subject@NmMessageEnvelope@EmailClientApi@@QBE?AVQString@@XZ @ 126 NONAME ; class QString EmailClientApi::NmMessageEnvelope::subject(void) const
-	??0NmMessageBody@EmailClientApi@@QAE@XZ @ 127 NONAME ; EmailClientApi::NmMessageBody::NmMessageBody(void)
-	?getStaticMetaObject@NmFolderListing@EmailClientApi@@SAABUQMetaObject@@XZ @ 128 NONAME ; struct QMetaObject const & EmailClientApi::NmFolderListing::getStaticMetaObject(void)
-	?setContentType@NmMessageEnvelope@EmailClientApi@@QAEXABVQString@@@Z @ 129 NONAME ; void EmailClientApi::NmMessageEnvelope::setContentType(class QString const &)
-	?setFolderType@NmFolder@EmailClientApi@@QAEXW4EmailFolderType@2@@Z @ 130 NONAME ; void EmailClientApi::NmFolder::setFolderType(enum EmailClientApi::EmailFolderType)
-	?getEnvelopes@NmEnvelopeListing@EmailClientApi@@QAE_NAAV?$QList@VNmMessageEnvelope@EmailClientApi@@@@@Z @ 131 NONAME ; bool EmailClientApi::NmEnvelopeListing::getEnvelopes(class QList<class EmailClientApi::NmMessageEnvelope> &)
-	?name@NmFolder@EmailClientApi@@QBE?AVQString@@XZ @ 132 NONAME ; class QString EmailClientApi::NmFolder::name(void) const
-	?staticMetaObject@NmEventNotifier@EmailClientApi@@2UQMetaObject@@B @ 133 NONAME ; struct QMetaObject const EmailClientApi::NmEventNotifier::staticMetaObject
-	?setIsRead@NmMessageEnvelope@EmailClientApi@@QAEX_N@Z @ 134 NONAME ; void EmailClientApi::NmMessageEnvelope::setIsRead(bool)
-	?envelopesListed@NmEnvelopeListing@EmailClientApi@@IAEXH@Z @ 135 NONAME ; void EmailClientApi::NmEnvelopeListing::envelopesListed(int)
-	?start@NmEventNotifier@EmailClientApi@@UAE_NXZ @ 136 NONAME ; bool EmailClientApi::NmEventNotifier::start(void)
-	??1NmFolder@EmailClientApi@@QAE@XZ @ 137 NONAME ; EmailClientApi::NmFolder::~NmFolder(void)
-	?trUtf8@NmMessageTask@@SA?AVQString@@PBD0H@Z @ 138 NONAME ; class QString NmMessageTask::trUtf8(char const *, char const *, int)
-	?getCcRecipients@NmMessageEnvelope@EmailClientApi@@QAEXAAV?$QList@VNmEmailAddress@EmailClientApi@@@@@Z @ 139 NONAME ; void EmailClientApi::NmMessageEnvelope::getCcRecipients(class QList<class EmailClientApi::NmEmailAddress> &)
-	?content@NmMessageBody@EmailClientApi@@QBE?AVQString@@XZ @ 140 NONAME ; class QString EmailClientApi::NmMessageBody::content(void) const
-	?metaObject@NmEmailService@EmailClientApi@@UBEPBUQMetaObject@@XZ @ 141 NONAME ; struct QMetaObject const * EmailClientApi::NmEmailService::metaObject(void) const
-	?start@NmEnvelopeListing@EmailClientApi@@UAE_NXZ @ 142 NONAME ; bool EmailClientApi::NmEnvelopeListing::start(void)
-	?qt_metacast@NmMailboxListing@EmailClientApi@@UAEPAXPBD@Z @ 143 NONAME ; void * EmailClientApi::NmMailboxListing::qt_metacast(char const *)
-	?setFetchedSize@NmMessageBody@EmailClientApi@@QAEX_K@Z @ 144 NONAME ; void EmailClientApi::NmMessageBody::setFetchedSize(unsigned long long)
-	??0NmMailbox@EmailClientApi@@QAE@XZ @ 145 NONAME ; EmailClientApi::NmMailbox::NmMailbox(void)
-	?trUtf8@NmMessageTask@@SA?AVQString@@PBD0@Z @ 146 NONAME ; class QString NmMessageTask::trUtf8(char const *, char const *)
-	?setSubject@NmMessageEnvelope@EmailClientApi@@QAEXABVQString@@@Z @ 147 NONAME ; void EmailClientApi::NmMessageEnvelope::setSubject(class QString const &)
-	?metaObject@NmMailboxListing@EmailClientApi@@UBEPBUQMetaObject@@XZ @ 148 NONAME ; struct QMetaObject const * EmailClientApi::NmMailboxListing::metaObject(void) const
-	?getStaticMetaObject@NmEventNotifier@EmailClientApi@@SAABUQMetaObject@@XZ @ 149 NONAME ; struct QMetaObject const & EmailClientApi::NmEventNotifier::getStaticMetaObject(void)
-	?setAddress@NmMailbox@EmailClientApi@@QAEXABVQString@@@Z @ 150 NONAME ; void EmailClientApi::NmMailbox::setAddress(class QString const &)
-	?staticMetaObject@NmEmailService@EmailClientApi@@2UQMetaObject@@B @ 151 NONAME ; struct QMetaObject const EmailClientApi::NmEmailService::staticMetaObject
-	?setTotalSize@NmMessageBody@EmailClientApi@@QAEX_K@Z @ 152 NONAME ; void EmailClientApi::NmMessageBody::setTotalSize(unsigned long long)
-	?trUtf8@NmFolderListing@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 153 NONAME ; class QString EmailClientApi::NmFolderListing::trUtf8(char const *, char const *, int)
-	?tr@NmEmailService@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 154 NONAME ; class QString EmailClientApi::NmEmailService::tr(char const *, char const *, int)
-	?isRunning@NmEmailService@EmailClientApi@@QBE_NXZ @ 155 NONAME ; bool EmailClientApi::NmEmailService::isRunning(void) const
-	?qt_metacall@NmMailboxListing@EmailClientApi@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 156 NONAME ; int EmailClientApi::NmMailboxListing::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?cancel@NmFolderListing@EmailClientApi@@UAEXXZ @ 157 NONAME ; void EmailClientApi::NmFolderListing::cancel(void)
-	??1NmFolderListing@EmailClientApi@@UAE@XZ @ 158 NONAME ; EmailClientApi::NmFolderListing::~NmFolderListing(void)
-	??1NmMessageTask@@UAE@XZ @ 159 NONAME ; NmMessageTask::~NmMessageTask(void)
-	??0NmMailbox@EmailClientApi@@QAE@ABV01@@Z @ 160 NONAME ; EmailClientApi::NmMailbox::NmMailbox(class EmailClientApi::NmMailbox const &)
-	??0NmEmailAddress@EmailClientApi@@QAE@XZ @ 161 NONAME ; EmailClientApi::NmEmailAddress::NmEmailAddress(void)
-	?setId@NmFolder@EmailClientApi@@QAEX_K@Z @ 162 NONAME ; void EmailClientApi::NmFolder::setId(unsigned long long)
-	?getPlainTextBody@NmMessageEnvelope@EmailClientApi@@QAEXAAVNmMessageBody@2@@Z @ 163 NONAME ; void EmailClientApi::NmMessageEnvelope::getPlainTextBody(class EmailClientApi::NmMessageBody &)
-	?qt_metacall@NmFolderListing@EmailClientApi@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 164 NONAME ; int EmailClientApi::NmFolderListing::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?contentType@NmMessageEnvelope@EmailClientApi@@QBE?AVQString@@XZ @ 165 NONAME ; class QString EmailClientApi::NmMessageEnvelope::contentType(void) const
-	??_ENmEmailService@EmailClientApi@@UAE@I@Z @ 166 NONAME ; EmailClientApi::NmEmailService::~NmEmailService(unsigned int)
-	??_ENmMailbox@EmailClientApi@@UAE@I@Z @ 167 NONAME ; EmailClientApi::NmMailbox::~NmMailbox(unsigned int)
-	?parentFolder@NmMessageEnvelope@EmailClientApi@@QBE_KXZ @ 168 NONAME ; unsigned long long EmailClientApi::NmMessageEnvelope::parentFolder(void) const
-	?getToRecipients@NmMessageEnvelope@EmailClientApi@@QAEXAAV?$QList@VNmEmailAddress@EmailClientApi@@@@@Z @ 169 NONAME ; void EmailClientApi::NmMessageEnvelope::getToRecipients(class QList<class EmailClientApi::NmEmailAddress> &)
-	?setTotalSize@NmMessageEnvelope@EmailClientApi@@QAEX_K@Z @ 170 NONAME ; void EmailClientApi::NmMessageEnvelope::setTotalSize(unsigned long long)
-	?metaObject@NmMessageTask@@UBEPBUQMetaObject@@XZ @ 171 NONAME ; struct QMetaObject const * NmMessageTask::metaObject(void) const
-	?trUtf8@NmEventNotifier@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 172 NONAME ; class QString EmailClientApi::NmEventNotifier::trUtf8(char const *, char const *, int)
-	?isRunning@NmFolderListing@EmailClientApi@@QBE_NXZ @ 173 NONAME ; bool EmailClientApi::NmFolderListing::isRunning(void) const
-	?fetchedSize@NmMessageEnvelope@EmailClientApi@@QBE_KXZ @ 174 NONAME ; unsigned long long EmailClientApi::NmMessageEnvelope::fetchedSize(void) const
-	??0NmEventNotifier@EmailClientApi@@QAE@PAVQObject@@@Z @ 175 NONAME ; EmailClientApi::NmEventNotifier::NmEventNotifier(class QObject *)
-	?setParentFolder@NmMessageEnvelope@EmailClientApi@@QAEX_K@Z @ 176 NONAME ; void EmailClientApi::NmMessageEnvelope::setParentFolder(unsigned long long)
-	??1NmEnvelopeListing@EmailClientApi@@UAE@XZ @ 177 NONAME ; EmailClientApi::NmEnvelopeListing::~NmEnvelopeListing(void)
-	?getChildFolderIds@NmFolder@EmailClientApi@@QAEXAAV?$QList@_K@@@Z @ 178 NONAME ; void EmailClientApi::NmFolder::getChildFolderIds(class QList<unsigned long long> &)
-	?setChildFolderIds@NmFolder@EmailClientApi@@QAEXAAV?$QList@_K@@@Z @ 179 NONAME ; void EmailClientApi::NmFolder::setChildFolderIds(class QList<unsigned long long> &)
+	?totalSize@NmApiMessageBody@EmailClientApi@@QBE_KXZ @ 1 NONAME ; unsigned long long EmailClientApi::NmApiMessageBody::totalSize(void) const
+	?isRunning@NmApiEmailService@EmailClientApi@@QBE_NXZ @ 2 NONAME ; bool EmailClientApi::NmApiEmailService::isRunning(void) const
+	??4NmApiMessageBody@EmailClientApi@@QAEAAV01@ABV01@@Z @ 3 NONAME ; class EmailClientApi::NmApiMessageBody & EmailClientApi::NmApiMessageBody::operator=(class EmailClientApi::NmApiMessageBody const &)
+	?qt_metacall@NmApiEventNotifier@EmailClientApi@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 4 NONAME ; int EmailClientApi::NmApiEventNotifier::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?setPlainText@NmApiMessageEnvelope@EmailClientApi@@QAEXABVQString@@@Z @ 5 NONAME ; void EmailClientApi::NmApiMessageEnvelope::setPlainText(class QString const &)
+	?id@NmApiMailbox@EmailClientApi@@QBE_KXZ @ 6 NONAME ; unsigned long long EmailClientApi::NmApiMailbox::id(void) const
+	?id@NmApiFolder@EmailClientApi@@QBE_KXZ @ 7 NONAME ; unsigned long long EmailClientApi::NmApiFolder::id(void) const
+	?foldersListed@NmApiFolderListing@EmailClientApi@@IAEXH@Z @ 8 NONAME ; void EmailClientApi::NmApiFolderListing::foldersListed(int)
+	??8NmApiFolder@EmailClientApi@@QAE_NABV01@@Z @ 9 NONAME ; bool EmailClientApi::NmApiFolder::operator==(class EmailClientApi::NmApiFolder const &)
+	??0NmApiFolder@EmailClientApi@@QAE@ABV01@@Z @ 10 NONAME ; EmailClientApi::NmApiFolder::NmApiFolder(class EmailClientApi::NmApiFolder const &)
+	??0NmApiMailboxListing@EmailClientApi@@QAE@PAVQObject@@@Z @ 11 NONAME ; EmailClientApi::NmApiMailboxListing::NmApiMailboxListing(class QObject *)
+	?subject@NmApiMessageEnvelope@EmailClientApi@@QBE?AVQString@@XZ @ 12 NONAME ; class QString EmailClientApi::NmApiMessageEnvelope::subject(void) const
+	?setIsRead@NmApiMessageEnvelope@EmailClientApi@@QAEX_N@Z @ 13 NONAME ; void EmailClientApi::NmApiMessageEnvelope::setIsRead(bool)
+	?qt_metacall@NmApiEnvelopeListing@EmailClientApi@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 14 NONAME ; int EmailClientApi::NmApiEnvelopeListing::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?metaObject@NmApiFolderListing@EmailClientApi@@UBEPBUQMetaObject@@XZ @ 15 NONAME ; struct QMetaObject const * EmailClientApi::NmApiFolderListing::metaObject(void) const
+	?fetchedSize@NmApiMessageBody@EmailClientApi@@QBE_KXZ @ 16 NONAME ; unsigned long long EmailClientApi::NmApiMessageBody::fetchedSize(void) const
+	?setChildFolderIds@NmApiFolder@EmailClientApi@@QAEXAAV?$QList@_K@@@Z @ 17 NONAME ; void EmailClientApi::NmApiFolder::setChildFolderIds(class QList<unsigned long long> &)
+	??0NmApiMessageEnvelope@EmailClientApi@@QAE@XZ @ 18 NONAME ; EmailClientApi::NmApiMessageEnvelope::NmApiMessageEnvelope(void)
+	??1NmApiMessageEnvelope@EmailClientApi@@UAE@XZ @ 19 NONAME ; EmailClientApi::NmApiMessageEnvelope::~NmApiMessageEnvelope(void)
+	??4NmApiMailbox@EmailClientApi@@QAEAAV01@ABV01@@Z @ 20 NONAME ; class EmailClientApi::NmApiMailbox & EmailClientApi::NmApiMailbox::operator=(class EmailClientApi::NmApiMailbox const &)
+	?setSentTime@NmApiMessageEnvelope@EmailClientApi@@QAEXVQDateTime@@@Z @ 21 NONAME ; void EmailClientApi::NmApiMessageEnvelope::setSentTime(class QDateTime)
+	?setFetchedSize@NmApiMessageBody@EmailClientApi@@QAEX_K@Z @ 22 NONAME ; void EmailClientApi::NmApiMessageBody::setFetchedSize(unsigned long long)
+	?name@NmApiFolder@EmailClientApi@@QBE?AVQString@@XZ @ 23 NONAME ; class QString EmailClientApi::NmApiFolder::name(void) const
+	??1NmApiEmailAddress@EmailClientApi@@UAE@XZ @ 24 NONAME ; EmailClientApi::NmApiEmailAddress::~NmApiEmailAddress(void)
+	?setIsForwarded@NmApiMessageEnvelope@EmailClientApi@@QAEX_N@Z @ 25 NONAME ; void EmailClientApi::NmApiMessageEnvelope::setIsForwarded(bool)
+	?qt_metacast@NmApiMessageTask@@UAEPAXPBD@Z @ 26 NONAME ; void * NmApiMessageTask::qt_metacast(char const *)
+	?staticMetaObject@NmApiMailboxListing@EmailClientApi@@2UQMetaObject@@B @ 27 NONAME ; struct QMetaObject const EmailClientApi::NmApiMailboxListing::staticMetaObject
+	?address@NmApiMailbox@EmailClientApi@@QBE?AVQString@@XZ @ 28 NONAME ; class QString EmailClientApi::NmApiMailbox::address(void) const
+	??0NmApiMessageBody@EmailClientApi@@QAE@XZ @ 29 NONAME ; EmailClientApi::NmApiMessageBody::NmApiMessageBody(void)
+	?metaObject@NmApiEventNotifier@EmailClientApi@@UBEPBUQMetaObject@@XZ @ 30 NONAME ; struct QMetaObject const * EmailClientApi::NmApiEventNotifier::metaObject(void) const
+	?tr@NmApiFolderListing@EmailClientApi@@SA?AVQString@@PBD0@Z @ 31 NONAME ; class QString EmailClientApi::NmApiFolderListing::tr(char const *, char const *)
+	?metaObject@NmApiEmailService@EmailClientApi@@UBEPBUQMetaObject@@XZ @ 32 NONAME ; struct QMetaObject const * EmailClientApi::NmApiEmailService::metaObject(void) const
+	?parentFolder@NmApiMessageEnvelope@EmailClientApi@@QBE_KXZ @ 33 NONAME ; unsigned long long EmailClientApi::NmApiMessageEnvelope::parentFolder(void) const
+	??_ENmApiMessageBody@EmailClientApi@@UAE@I@Z @ 34 NONAME ; EmailClientApi::NmApiMessageBody::~NmApiMessageBody(unsigned int)
+	?qt_metacall@NmApiMailboxListing@EmailClientApi@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 35 NONAME ; int EmailClientApi::NmApiMailboxListing::qt_metacall(enum QMetaObject::Call, int, void * *)
+	??_ENmApiMailbox@EmailClientApi@@UAE@I@Z @ 36 NONAME ; EmailClientApi::NmApiMailbox::~NmApiMailbox(unsigned int)
+	?setId@NmApiMessageEnvelope@EmailClientApi@@QAEX_K@Z @ 37 NONAME ; void EmailClientApi::NmApiMessageEnvelope::setId(unsigned long long)
+	?trUtf8@NmApiEmailService@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 38 NONAME ; class QString EmailClientApi::NmApiEmailService::trUtf8(char const *, char const *, int)
+	?getStaticMetaObject@NmApiMailboxListing@EmailClientApi@@SAABUQMetaObject@@XZ @ 39 NONAME ; struct QMetaObject const & EmailClientApi::NmApiMailboxListing::getStaticMetaObject(void)
+	?setName@NmApiFolder@EmailClientApi@@QAEXABVQString@@@Z @ 40 NONAME ; void EmailClientApi::NmApiFolder::setName(class QString const &)
+	?isRunning@NmApiMailboxListing@EmailClientApi@@QBE_NXZ @ 41 NONAME ; bool EmailClientApi::NmApiMailboxListing::isRunning(void) const
+	?setName@NmApiMailbox@EmailClientApi@@QAEXABVQString@@@Z @ 42 NONAME ; void EmailClientApi::NmApiMailbox::setName(class QString const &)
+	?tr@NmApiEnvelopeListing@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 43 NONAME ; class QString EmailClientApi::NmApiEnvelopeListing::tr(char const *, char const *, int)
+	?isRunning@NmApiFolderListing@EmailClientApi@@QBE_NXZ @ 44 NONAME ; bool EmailClientApi::NmApiFolderListing::isRunning(void) const
+	?staticMetaObject@NmApiEventNotifier@EmailClientApi@@2UQMetaObject@@B @ 45 NONAME ; struct QMetaObject const EmailClientApi::NmApiEventNotifier::staticMetaObject
+	?tr@NmApiFolderListing@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 46 NONAME ; class QString EmailClientApi::NmApiFolderListing::tr(char const *, char const *, int)
+	?trUtf8@NmApiFolderListing@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 47 NONAME ; class QString EmailClientApi::NmApiFolderListing::trUtf8(char const *, char const *, int)
+	?envelopesListed@NmApiEnvelopeListing@EmailClientApi@@IAEXH@Z @ 48 NONAME ; void EmailClientApi::NmApiEnvelopeListing::envelopesListed(int)
+	?fetchedSize@NmApiMessageEnvelope@EmailClientApi@@QBE_KXZ @ 49 NONAME ; unsigned long long EmailClientApi::NmApiMessageEnvelope::fetchedSize(void) const
+	?tr@NmApiEventNotifier@EmailClientApi@@SA?AVQString@@PBD0@Z @ 50 NONAME ; class QString EmailClientApi::NmApiEventNotifier::tr(char const *, char const *)
+	?sentTime@NmApiMessageEnvelope@EmailClientApi@@QBE?AVQDateTime@@XZ @ 51 NONAME ; class QDateTime EmailClientApi::NmApiMessageEnvelope::sentTime(void) const
+	?setSubject@NmApiMessageEnvelope@EmailClientApi@@QAEXABVQString@@@Z @ 52 NONAME ; void EmailClientApi::NmApiMessageEnvelope::setSubject(class QString const &)
+	?folderType@NmApiFolder@EmailClientApi@@QBE?AW4NmApiEmailFolderType@2@XZ @ 53 NONAME ; enum EmailClientApi::NmApiEmailFolderType EmailClientApi::NmApiFolder::folderType(void) const
+	?setToRecipients@NmApiMessageEnvelope@EmailClientApi@@QAEXABV?$QList@VNmApiEmailAddress@EmailClientApi@@@@@Z @ 54 NONAME ; void EmailClientApi::NmApiMessageEnvelope::setToRecipients(class QList<class EmailClientApi::NmApiEmailAddress> const &)
+	??1NmApiEventNotifier@EmailClientApi@@UAE@XZ @ 55 NONAME ; EmailClientApi::NmApiEventNotifier::~NmApiEventNotifier(void)
+	?isRead@NmApiMessageEnvelope@EmailClientApi@@QBE_NXZ @ 56 NONAME ; bool EmailClientApi::NmApiMessageEnvelope::isRead(void) const
+	?failed@NmApiMessageTask@@IAEXH@Z @ 57 NONAME ; void NmApiMessageTask::failed(int)
+	?qt_metacast@NmApiFolderListing@EmailClientApi@@UAEPAXPBD@Z @ 58 NONAME ; void * EmailClientApi::NmApiFolderListing::qt_metacast(char const *)
+	?messageEvent@NmApiEventNotifier@EmailClientApi@@IAEXW4NmApiMessageEvent@2@_K1V?$QList@_K@@@Z @ 59 NONAME ; void EmailClientApi::NmApiEventNotifier::messageEvent(enum EmailClientApi::NmApiMessageEvent, unsigned long long, unsigned long long, class QList<unsigned long long>)
+	?setTotalSize@NmApiMessageEnvelope@EmailClientApi@@QAEX_K@Z @ 60 NONAME ; void EmailClientApi::NmApiMessageEnvelope::setTotalSize(unsigned long long)
+	?qt_metacall@NmApiMessageTask@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 61 NONAME ; int NmApiMessageTask::qt_metacall(enum QMetaObject::Call, int, void * *)
+	??1NmApiMailbox@EmailClientApi@@UAE@XZ @ 62 NONAME ; EmailClientApi::NmApiMailbox::~NmApiMailbox(void)
+	?tr@NmApiEventNotifier@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 63 NONAME ; class QString EmailClientApi::NmApiEventNotifier::tr(char const *, char const *, int)
+	??8NmApiMessageBody@EmailClientApi@@QAE_NABV01@@Z @ 64 NONAME ; bool EmailClientApi::NmApiMessageBody::operator==(class EmailClientApi::NmApiMessageBody const &)
+	?start@NmApiMailboxListing@EmailClientApi@@UAE_NXZ @ 65 NONAME ; bool EmailClientApi::NmApiMailboxListing::start(void)
+	??_ENmApiEnvelopeListing@EmailClientApi@@UAE@I@Z @ 66 NONAME ; EmailClientApi::NmApiEnvelopeListing::~NmApiEnvelopeListing(unsigned int)
+	?uninitialise@NmApiEmailService@EmailClientApi@@QAEXXZ @ 67 NONAME ; void EmailClientApi::NmApiEmailService::uninitialise(void)
+	?trUtf8@NmApiEventNotifier@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 68 NONAME ; class QString EmailClientApi::NmApiEventNotifier::trUtf8(char const *, char const *, int)
+	??0NmApiMessageBody@EmailClientApi@@QAE@ABV01@@Z @ 69 NONAME ; EmailClientApi::NmApiMessageBody::NmApiMessageBody(class EmailClientApi::NmApiMessageBody const &)
+	??1NmApiMessageBody@EmailClientApi@@UAE@XZ @ 70 NONAME ; EmailClientApi::NmApiMessageBody::~NmApiMessageBody(void)
+	?hasAttachments@NmApiMessageEnvelope@EmailClientApi@@QBE_NXZ @ 71 NONAME ; bool EmailClientApi::NmApiMessageEnvelope::hasAttachments(void) const
+	?setSender@NmApiMessageEnvelope@EmailClientApi@@QAEXABVQString@@@Z @ 72 NONAME ; void EmailClientApi::NmApiMessageEnvelope::setSender(class QString const &)
+	??_ENmApiMailboxListing@EmailClientApi@@UAE@I@Z @ 73 NONAME ; EmailClientApi::NmApiMailboxListing::~NmApiMailboxListing(unsigned int)
+	?trUtf8@NmApiMessageTask@@SA?AVQString@@PBD0@Z @ 74 NONAME ; class QString NmApiMessageTask::trUtf8(char const *, char const *)
+	?staticMetaObject@NmApiMessageTask@@2UQMetaObject@@B @ 75 NONAME ; struct QMetaObject const NmApiMessageTask::staticMetaObject
+	?getChildFolderIds@NmApiFolder@EmailClientApi@@QAEXAAV?$QList@_K@@@Z @ 76 NONAME ; void EmailClientApi::NmApiFolder::getChildFolderIds(class QList<unsigned long long> &)
+	?parentFolderId@NmApiFolder@EmailClientApi@@QBE_KXZ @ 77 NONAME ; unsigned long long EmailClientApi::NmApiFolder::parentFolderId(void) const
+	??_ENmApiEmailAddress@EmailClientApi@@UAE@I@Z @ 78 NONAME ; EmailClientApi::NmApiEmailAddress::~NmApiEmailAddress(unsigned int)
+	??0NmApiFolder@EmailClientApi@@QAE@XZ @ 79 NONAME ; EmailClientApi::NmApiFolder::NmApiFolder(void)
+	?tr@NmApiMailboxListing@EmailClientApi@@SA?AVQString@@PBD0@Z @ 80 NONAME ; class QString EmailClientApi::NmApiMailboxListing::tr(char const *, char const *)
+	?tr@NmApiEmailService@EmailClientApi@@SA?AVQString@@PBD0@Z @ 81 NONAME ; class QString EmailClientApi::NmApiEmailService::tr(char const *, char const *)
+	?getFolders@NmApiFolderListing@EmailClientApi@@QAE_NAAV?$QList@VNmApiFolder@EmailClientApi@@@@@Z @ 82 NONAME ; bool EmailClientApi::NmApiFolderListing::getFolders(class QList<class EmailClientApi::NmApiFolder> &)
+	?plainText@NmApiMessageEnvelope@EmailClientApi@@QBE?AVQString@@XZ @ 83 NONAME ; class QString EmailClientApi::NmApiMessageEnvelope::plainText(void) const
+	?getStaticMetaObject@NmApiEmailService@EmailClientApi@@SAABUQMetaObject@@XZ @ 84 NONAME ; struct QMetaObject const & EmailClientApi::NmApiEmailService::getStaticMetaObject(void)
+	?metaObject@NmApiEnvelopeListing@EmailClientApi@@UBEPBUQMetaObject@@XZ @ 85 NONAME ; struct QMetaObject const * EmailClientApi::NmApiEnvelopeListing::metaObject(void) const
+	?trUtf8@NmApiMailboxListing@EmailClientApi@@SA?AVQString@@PBD0@Z @ 86 NONAME ; class QString EmailClientApi::NmApiMailboxListing::trUtf8(char const *, char const *)
+	?tr@NmApiEnvelopeListing@EmailClientApi@@SA?AVQString@@PBD0@Z @ 87 NONAME ; class QString EmailClientApi::NmApiEnvelopeListing::tr(char const *, char const *)
+	?canceled@NmApiMessageTask@@IAEXXZ @ 88 NONAME ; void NmApiMessageTask::canceled(void)
+	?setHasAttachments@NmApiMessageEnvelope@EmailClientApi@@QAEX_N@Z @ 89 NONAME ; void EmailClientApi::NmApiMessageEnvelope::setHasAttachments(bool)
+	??_ENmApiMessageEnvelope@EmailClientApi@@UAE@I@Z @ 90 NONAME ; EmailClientApi::NmApiMessageEnvelope::~NmApiMessageEnvelope(unsigned int)
+	?displayName@NmApiEmailAddress@EmailClientApi@@QBE?AVQString@@XZ @ 91 NONAME ; class QString EmailClientApi::NmApiEmailAddress::displayName(void) const
+	??0NmApiFolderListing@EmailClientApi@@QAE@PAVQObject@@AB_K@Z @ 92 NONAME ; EmailClientApi::NmApiFolderListing::NmApiFolderListing(class QObject *, unsigned long long const &)
+	??_ENmApiFolder@EmailClientApi@@UAE@I@Z @ 93 NONAME ; EmailClientApi::NmApiFolder::~NmApiFolder(unsigned int)
+	?getStaticMetaObject@NmApiFolderListing@EmailClientApi@@SAABUQMetaObject@@XZ @ 94 NONAME ; struct QMetaObject const & EmailClientApi::NmApiFolderListing::getStaticMetaObject(void)
+	?name@NmApiMailbox@EmailClientApi@@QBE?AVQString@@XZ @ 95 NONAME ; class QString EmailClientApi::NmApiMailbox::name(void) const
+	?trUtf8@NmApiEmailService@EmailClientApi@@SA?AVQString@@PBD0@Z @ 96 NONAME ; class QString EmailClientApi::NmApiEmailService::trUtf8(char const *, char const *)
+	??1NmApiMailboxListing@EmailClientApi@@UAE@XZ @ 97 NONAME ; EmailClientApi::NmApiMailboxListing::~NmApiMailboxListing(void)
+	??1NmApiFolder@EmailClientApi@@UAE@XZ @ 98 NONAME ; EmailClientApi::NmApiFolder::~NmApiFolder(void)
+	??0NmApiMailbox@EmailClientApi@@QAE@ABV01@@Z @ 99 NONAME ; EmailClientApi::NmApiMailbox::NmApiMailbox(class EmailClientApi::NmApiMailbox const &)
+	?setCcRecipients@NmApiMessageEnvelope@EmailClientApi@@QAEXABV?$QList@VNmApiEmailAddress@EmailClientApi@@@@@Z @ 100 NONAME ; void EmailClientApi::NmApiMessageEnvelope::setCcRecipients(class QList<class EmailClientApi::NmApiEmailAddress> const &)
+	??_ENmApiEventNotifier@EmailClientApi@@UAE@I@Z @ 101 NONAME ; EmailClientApi::NmApiEventNotifier::~NmApiEventNotifier(unsigned int)
+	?staticMetaObject@NmApiEmailService@EmailClientApi@@2UQMetaObject@@B @ 102 NONAME ; struct QMetaObject const EmailClientApi::NmApiEmailService::staticMetaObject
+	??1NmApiFolderListing@EmailClientApi@@UAE@XZ @ 103 NONAME ; EmailClientApi::NmApiFolderListing::~NmApiFolderListing(void)
+	?getPlainTextBody@NmApiMessageEnvelope@EmailClientApi@@QAEXAAVNmApiMessageBody@2@@Z @ 104 NONAME ; void EmailClientApi::NmApiMessageEnvelope::getPlainTextBody(class EmailClientApi::NmApiMessageBody &)
+	?id@NmApiMessageEnvelope@EmailClientApi@@QBE_KXZ @ 105 NONAME ; unsigned long long EmailClientApi::NmApiMessageEnvelope::id(void) const
+	?setFetchedSize@NmApiMessageEnvelope@EmailClientApi@@QAEX_K@Z @ 106 NONAME ; void EmailClientApi::NmApiMessageEnvelope::setFetchedSize(unsigned long long)
+	??0NmApiEnvelopeListing@EmailClientApi@@QAE@PAVQObject@@_K1@Z @ 107 NONAME ; EmailClientApi::NmApiEnvelopeListing::NmApiEnvelopeListing(class QObject *, unsigned long long, unsigned long long)
+	??0NmApiEmailAddress@EmailClientApi@@QAE@ABV01@@Z @ 108 NONAME ; EmailClientApi::NmApiEmailAddress::NmApiEmailAddress(class EmailClientApi::NmApiEmailAddress const &)
+	?getToRecipients@NmApiMessageEnvelope@EmailClientApi@@QAEXAAV?$QList@VNmApiEmailAddress@EmailClientApi@@@@@Z @ 109 NONAME ; void EmailClientApi::NmApiMessageEnvelope::getToRecipients(class QList<class EmailClientApi::NmApiEmailAddress> &)
+	?setParentFolder@NmApiMessageEnvelope@EmailClientApi@@QAEX_K@Z @ 110 NONAME ; void EmailClientApi::NmApiMessageEnvelope::setParentFolder(unsigned long long)
+	??4NmApiFolder@EmailClientApi@@QAEAAV01@ABV01@@Z @ 111 NONAME ; class EmailClientApi::NmApiFolder & EmailClientApi::NmApiFolder::operator=(class EmailClientApi::NmApiFolder const &)
+	?qt_metacast@NmApiEnvelopeListing@EmailClientApi@@UAEPAXPBD@Z @ 112 NONAME ; void * EmailClientApi::NmApiEnvelopeListing::qt_metacast(char const *)
+	?tr@NmApiEmailService@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 113 NONAME ; class QString EmailClientApi::NmApiEmailService::tr(char const *, char const *, int)
+	??4NmApiEmailAddress@EmailClientApi@@QAEAAV01@ABV01@@Z @ 114 NONAME ; class EmailClientApi::NmApiEmailAddress & EmailClientApi::NmApiEmailAddress::operator=(class EmailClientApi::NmApiEmailAddress const &)
+	?getStaticMetaObject@NmApiEnvelopeListing@EmailClientApi@@SAABUQMetaObject@@XZ @ 115 NONAME ; struct QMetaObject const & EmailClientApi::NmApiEnvelopeListing::getStaticMetaObject(void)
+	?staticMetaObject@NmApiEnvelopeListing@EmailClientApi@@2UQMetaObject@@B @ 116 NONAME ; struct QMetaObject const EmailClientApi::NmApiEnvelopeListing::staticMetaObject
+	?sender@NmApiMessageEnvelope@EmailClientApi@@QBE?AVQString@@XZ @ 117 NONAME ; class QString EmailClientApi::NmApiMessageEnvelope::sender(void) const
+	?setFolderType@NmApiFolder@EmailClientApi@@QAEXW4NmApiEmailFolderType@2@@Z @ 118 NONAME ; void EmailClientApi::NmApiFolder::setFolderType(enum EmailClientApi::NmApiEmailFolderType)
+	?getEnvelope@NmApiEmailService@EmailClientApi@@QAE_N_K00AAVNmApiMessageEnvelope@2@@Z @ 119 NONAME ; bool EmailClientApi::NmApiEmailService::getEnvelope(unsigned long long, unsigned long long, unsigned long long, class EmailClientApi::NmApiMessageEnvelope &)
+	?start@NmApiEventNotifier@EmailClientApi@@UAE_NXZ @ 120 NONAME ; bool EmailClientApi::NmApiEventNotifier::start(void)
+	?start@NmApiEnvelopeListing@EmailClientApi@@UAE_NXZ @ 121 NONAME ; bool EmailClientApi::NmApiEnvelopeListing::start(void)
+	?getEnvelopes@NmApiEnvelopeListing@EmailClientApi@@QAE_NAAV?$QList@VNmApiMessageEnvelope@EmailClientApi@@@@@Z @ 122 NONAME ; bool EmailClientApi::NmApiEnvelopeListing::getEnvelopes(class QList<class EmailClientApi::NmApiMessageEnvelope> &)
+	??1NmApiEnvelopeListing@EmailClientApi@@UAE@XZ @ 123 NONAME ; EmailClientApi::NmApiEnvelopeListing::~NmApiEnvelopeListing(void)
+	?setDisplayName@NmApiEmailAddress@EmailClientApi@@QAEXABVQString@@@Z @ 124 NONAME ; void EmailClientApi::NmApiEmailAddress::setDisplayName(class QString const &)
+	?tr@NmApiMessageTask@@SA?AVQString@@PBD0H@Z @ 125 NONAME ; class QString NmApiMessageTask::tr(char const *, char const *, int)
+	??4NmApiMessageEnvelope@EmailClientApi@@QAEAAV01@ABV01@@Z @ 126 NONAME ; class EmailClientApi::NmApiMessageEnvelope & EmailClientApi::NmApiMessageEnvelope::operator=(class EmailClientApi::NmApiMessageEnvelope const &)
+	?initialise@NmApiEmailService@EmailClientApi@@QAEXXZ @ 127 NONAME ; void EmailClientApi::NmApiEmailService::initialise(void)
+	?metaObject@NmApiMailboxListing@EmailClientApi@@UBEPBUQMetaObject@@XZ @ 128 NONAME ; struct QMetaObject const * EmailClientApi::NmApiMailboxListing::metaObject(void) const
+	?tr@NmApiMailboxListing@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 129 NONAME ; class QString EmailClientApi::NmApiMailboxListing::tr(char const *, char const *, int)
+	?isReplied@NmApiMessageEnvelope@EmailClientApi@@QBE_NXZ @ 130 NONAME ; bool EmailClientApi::NmApiMessageEnvelope::isReplied(void) const
+	?setContent@NmApiMessageBody@EmailClientApi@@QAEXABVQString@@@Z @ 131 NONAME ; void EmailClientApi::NmApiMessageBody::setContent(class QString const &)
+	?cancel@NmApiEnvelopeListing@EmailClientApi@@UAEXXZ @ 132 NONAME ; void EmailClientApi::NmApiEnvelopeListing::cancel(void)
+	?getStaticMetaObject@NmApiEventNotifier@EmailClientApi@@SAABUQMetaObject@@XZ @ 133 NONAME ; struct QMetaObject const & EmailClientApi::NmApiEventNotifier::getStaticMetaObject(void)
+	??0NmApiMessageEnvelope@EmailClientApi@@QAE@ABV01@@Z @ 134 NONAME ; EmailClientApi::NmApiMessageEnvelope::NmApiMessageEnvelope(class EmailClientApi::NmApiMessageEnvelope const &)
+	?trUtf8@NmApiEnvelopeListing@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 135 NONAME ; class QString EmailClientApi::NmApiEnvelopeListing::trUtf8(char const *, char const *, int)
+	?initialized@NmApiEmailService@EmailClientApi@@IAEX_N@Z @ 136 NONAME ; void EmailClientApi::NmApiEmailService::initialized(bool)
+	?setContentType@NmApiMessageEnvelope@EmailClientApi@@QAEXABVQString@@@Z @ 137 NONAME ; void EmailClientApi::NmApiMessageEnvelope::setContentType(class QString const &)
+	?qt_metacast@NmApiEventNotifier@EmailClientApi@@UAEPAXPBD@Z @ 138 NONAME ; void * EmailClientApi::NmApiEventNotifier::qt_metacast(char const *)
+	?cancel@NmApiEventNotifier@EmailClientApi@@UAEXXZ @ 139 NONAME ; void EmailClientApi::NmApiEventNotifier::cancel(void)
+	?qt_metacall@NmApiEmailService@EmailClientApi@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 140 NONAME ; int EmailClientApi::NmApiEmailService::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?totalSize@NmApiMessageEnvelope@EmailClientApi@@QBE_KXZ @ 141 NONAME ; unsigned long long EmailClientApi::NmApiMessageEnvelope::totalSize(void) const
+	?metaObject@NmApiMessageTask@@UBEPBUQMetaObject@@XZ @ 142 NONAME ; struct QMetaObject const * NmApiMessageTask::metaObject(void) const
+	?qt_metacast@NmApiEmailService@EmailClientApi@@UAEPAXPBD@Z @ 143 NONAME ; void * EmailClientApi::NmApiEmailService::qt_metacast(char const *)
+	?content@NmApiMessageBody@EmailClientApi@@QBE?AVQString@@XZ @ 144 NONAME ; class QString EmailClientApi::NmApiMessageBody::content(void) const
+	?trUtf8@NmApiFolderListing@EmailClientApi@@SA?AVQString@@PBD0@Z @ 145 NONAME ; class QString EmailClientApi::NmApiFolderListing::trUtf8(char const *, char const *)
+	??0NmApiMessageTask@@IAE@PAVQObject@@@Z @ 146 NONAME ; NmApiMessageTask::NmApiMessageTask(class QObject *)
+	?qt_metacall@NmApiFolderListing@EmailClientApi@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 147 NONAME ; int EmailClientApi::NmApiFolderListing::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?setAddress@NmApiMailbox@EmailClientApi@@QAEXABVQString@@@Z @ 148 NONAME ; void EmailClientApi::NmApiMailbox::setAddress(class QString const &)
+	?trUtf8@NmApiEnvelopeListing@EmailClientApi@@SA?AVQString@@PBD0@Z @ 149 NONAME ; class QString EmailClientApi::NmApiEnvelopeListing::trUtf8(char const *, char const *)
+	?tr@NmApiMessageTask@@SA?AVQString@@PBD0@Z @ 150 NONAME ; class QString NmApiMessageTask::tr(char const *, char const *)
+	?getStaticMetaObject@NmApiMessageTask@@SAABUQMetaObject@@XZ @ 151 NONAME ; struct QMetaObject const & NmApiMessageTask::getStaticMetaObject(void)
+	?address@NmApiEmailAddress@EmailClientApi@@QBE?AVQString@@XZ @ 152 NONAME ; class QString EmailClientApi::NmApiEmailAddress::address(void) const
+	?setAddress@NmApiEmailAddress@EmailClientApi@@QAEXABVQString@@@Z @ 153 NONAME ; void EmailClientApi::NmApiEmailAddress::setAddress(class QString const &)
+	?isForwarded@NmApiMessageEnvelope@EmailClientApi@@QBE_NXZ @ 154 NONAME ; bool EmailClientApi::NmApiMessageEnvelope::isForwarded(void) const
+	??8NmApiMailbox@EmailClientApi@@QAE_NABV01@@Z @ 155 NONAME ; bool EmailClientApi::NmApiMailbox::operator==(class EmailClientApi::NmApiMailbox const &)
+	?qt_metacast@NmApiMailboxListing@EmailClientApi@@UAEPAXPBD@Z @ 156 NONAME ; void * EmailClientApi::NmApiMailboxListing::qt_metacast(char const *)
+	?mailboxesListed@NmApiMailboxListing@EmailClientApi@@IAEXH@Z @ 157 NONAME ; void EmailClientApi::NmApiMailboxListing::mailboxesListed(int)
+	?setId@NmApiFolder@EmailClientApi@@QAEX_K@Z @ 158 NONAME ; void EmailClientApi::NmApiFolder::setId(unsigned long long)
+	??0NmApiEmailService@EmailClientApi@@QAE@PAVQObject@@@Z @ 159 NONAME ; EmailClientApi::NmApiEmailService::NmApiEmailService(class QObject *)
+	?staticMetaObject@NmApiFolderListing@EmailClientApi@@2UQMetaObject@@B @ 160 NONAME ; struct QMetaObject const EmailClientApi::NmApiFolderListing::staticMetaObject
+	??1NmApiEmailService@EmailClientApi@@UAE@XZ @ 161 NONAME ; EmailClientApi::NmApiEmailService::~NmApiEmailService(void)
+	?trUtf8@NmApiMessageTask@@SA?AVQString@@PBD0H@Z @ 162 NONAME ; class QString NmApiMessageTask::trUtf8(char const *, char const *, int)
+	??_ENmApiEmailService@EmailClientApi@@UAE@I@Z @ 163 NONAME ; EmailClientApi::NmApiEmailService::~NmApiEmailService(unsigned int)
+	?getMailbox@NmApiEmailService@EmailClientApi@@QAE_N_KAAVNmApiMailbox@2@@Z @ 164 NONAME ; bool EmailClientApi::NmApiEmailService::getMailbox(unsigned long long, class EmailClientApi::NmApiMailbox &)
+	?setTotalSize@NmApiMessageBody@EmailClientApi@@QAEX_K@Z @ 165 NONAME ; void EmailClientApi::NmApiMessageBody::setTotalSize(unsigned long long)
+	??0NmApiEmailAddress@EmailClientApi@@QAE@XZ @ 166 NONAME ; EmailClientApi::NmApiEmailAddress::NmApiEmailAddress(void)
+	??8NmApiEmailAddress@EmailClientApi@@QAE_NABV01@@Z @ 167 NONAME ; bool EmailClientApi::NmApiEmailAddress::operator==(class EmailClientApi::NmApiEmailAddress const &)
+	??1NmApiMessageTask@@UAE@XZ @ 168 NONAME ; NmApiMessageTask::~NmApiMessageTask(void)
+	?getCcRecipients@NmApiMessageEnvelope@EmailClientApi@@QAEXAAV?$QList@VNmApiEmailAddress@EmailClientApi@@@@@Z @ 169 NONAME ; void EmailClientApi::NmApiMessageEnvelope::getCcRecipients(class QList<class EmailClientApi::NmApiEmailAddress> &)
+	??8NmApiMessageEnvelope@EmailClientApi@@QAE_NABV01@@Z @ 170 NONAME ; bool EmailClientApi::NmApiMessageEnvelope::operator==(class EmailClientApi::NmApiMessageEnvelope const &)
+	?mailboxEvent@NmApiEventNotifier@EmailClientApi@@IAEXW4NmApiMailboxEvent@2@V?$QList@_K@@@Z @ 171 NONAME ; void EmailClientApi::NmApiEventNotifier::mailboxEvent(enum EmailClientApi::NmApiMailboxEvent, class QList<unsigned long long>)
+	??0NmApiMailbox@EmailClientApi@@QAE@XZ @ 172 NONAME ; EmailClientApi::NmApiMailbox::NmApiMailbox(void)
+	??0NmApiEventNotifier@EmailClientApi@@QAE@PAVQObject@@@Z @ 173 NONAME ; EmailClientApi::NmApiEventNotifier::NmApiEventNotifier(class QObject *)
+	?setId@NmApiMailbox@EmailClientApi@@QAEX_K@Z @ 174 NONAME ; void EmailClientApi::NmApiMailbox::setId(unsigned long long)
+	?cancel@NmApiMailboxListing@EmailClientApi@@UAEXXZ @ 175 NONAME ; void EmailClientApi::NmApiMailboxListing::cancel(void)
+	?getMailboxes@NmApiMailboxListing@EmailClientApi@@QAE_NAAV?$QList@VNmApiMailbox@EmailClientApi@@@@@Z @ 176 NONAME ; bool EmailClientApi::NmApiMailboxListing::getMailboxes(class QList<class EmailClientApi::NmApiMailbox> &)
+	?trUtf8@NmApiEventNotifier@EmailClientApi@@SA?AVQString@@PBD0@Z @ 177 NONAME ; class QString EmailClientApi::NmApiEventNotifier::trUtf8(char const *, char const *)
+	??_ENmApiFolderListing@EmailClientApi@@UAE@I@Z @ 178 NONAME ; EmailClientApi::NmApiFolderListing::~NmApiFolderListing(unsigned int)
+	??_ENmApiMessageTask@@UAE@I@Z @ 179 NONAME ; NmApiMessageTask::~NmApiMessageTask(unsigned int)
+	?isRunning@NmApiEnvelopeListing@EmailClientApi@@QBE_NXZ @ 180 NONAME ; bool EmailClientApi::NmApiEnvelopeListing::isRunning(void) const
+	?isRunning@NmApiEventNotifier@EmailClientApi@@QBE_NXZ @ 181 NONAME ; bool EmailClientApi::NmApiEventNotifier::isRunning(void) const
+	?setIsReplied@NmApiMessageEnvelope@EmailClientApi@@QAEX_N@Z @ 182 NONAME ; void EmailClientApi::NmApiMessageEnvelope::setIsReplied(bool)
+	?contentType@NmApiMessageEnvelope@EmailClientApi@@QBE?AVQString@@XZ @ 183 NONAME ; class QString EmailClientApi::NmApiMessageEnvelope::contentType(void) const
+	?sendEventsFromBuffer@NmApiEventNotifier@EmailClientApi@@QAEXXZ @ 184 NONAME ; void EmailClientApi::NmApiEventNotifier::sendEventsFromBuffer(void)
+	?trUtf8@NmApiMailboxListing@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 185 NONAME ; class QString EmailClientApi::NmApiMailboxListing::trUtf8(char const *, char const *, int)
+	?setParentFolderId@NmApiFolder@EmailClientApi@@QAEX_K@Z @ 186 NONAME ; void EmailClientApi::NmApiFolder::setParentFolderId(unsigned long long)
+	?start@NmApiFolderListing@EmailClientApi@@UAE_NXZ @ 187 NONAME ; bool EmailClientApi::NmApiFolderListing::start(void)
+	?cancel@NmApiFolderListing@EmailClientApi@@UAEXXZ @ 188 NONAME ; void EmailClientApi::NmApiFolderListing::cancel(void)
 
--- a/emailservices/nmclientapi/eabi/nmailclientapiu.def	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/eabi/nmailclientapiu.def	Fri May 14 15:41:10 2010 +0300
@@ -1,193 +1,214 @@
 EXPORTS
-	_ZN13NmMessageTask11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME
-	_ZN13NmMessageTask11qt_metacastEPKc @ 2 NONAME
-	_ZN13NmMessageTask16staticMetaObjectE @ 3 NONAME DATA 16
-	_ZN13NmMessageTask19getStaticMetaObjectEv @ 4 NONAME
-	_ZN13NmMessageTask6failedEi @ 5 NONAME
-	_ZN13NmMessageTask8canceledEv @ 6 NONAME
-	_ZN13NmMessageTaskC2EP7QObject @ 7 NONAME
-	_ZN13NmMessageTaskD0Ev @ 8 NONAME
-	_ZN13NmMessageTaskD1Ev @ 9 NONAME
-	_ZN13NmMessageTaskD2Ev @ 10 NONAME
-	_ZN14EmailClientApi13NmMessageBody10setContentERK7QString @ 11 NONAME
-	_ZN14EmailClientApi13NmMessageBody12setTotalSizeEy @ 12 NONAME
-	_ZN14EmailClientApi13NmMessageBody14setFetchedSizeEy @ 13 NONAME
-	_ZN14EmailClientApi13NmMessageBodyC1Ev @ 14 NONAME
-	_ZN14EmailClientApi13NmMessageBodyC2Ev @ 15 NONAME
-	_ZN14EmailClientApi13NmMessageBodyD0Ev @ 16 NONAME
-	_ZN14EmailClientApi13NmMessageBodyD1Ev @ 17 NONAME
-	_ZN14EmailClientApi13NmMessageBodyD2Ev @ 18 NONAME
-	_ZN14EmailClientApi14NmEmailAddress10setAddressERK7QString @ 19 NONAME
-	_ZN14EmailClientApi14NmEmailAddress14setDisplayNameERK7QString @ 20 NONAME
-	_ZN14EmailClientApi14NmEmailAddressC1Ev @ 21 NONAME
-	_ZN14EmailClientApi14NmEmailAddressC2Ev @ 22 NONAME
-	_ZN14EmailClientApi14NmEmailAddressD0Ev @ 23 NONAME
-	_ZN14EmailClientApi14NmEmailAddressD1Ev @ 24 NONAME
-	_ZN14EmailClientApi14NmEmailAddressD2Ev @ 25 NONAME
-	_ZN14EmailClientApi14NmEmailService10getMailboxEyRNS_9NmMailboxE @ 26 NONAME
-	_ZN14EmailClientApi14NmEmailService10initialiseEv @ 27 NONAME
-	_ZN14EmailClientApi14NmEmailService11getEnvelopeEyyyRNS_17NmMessageEnvelopeE @ 28 NONAME
-	_ZN14EmailClientApi14NmEmailService11initializedEb @ 29 NONAME
-	_ZN14EmailClientApi14NmEmailService11qt_metacallEN11QMetaObject4CallEiPPv @ 30 NONAME
-	_ZN14EmailClientApi14NmEmailService11qt_metacastEPKc @ 31 NONAME
-	_ZN14EmailClientApi14NmEmailService12uninitialiseEv @ 32 NONAME
-	_ZN14EmailClientApi14NmEmailService16staticMetaObjectE @ 33 NONAME DATA 16
-	_ZN14EmailClientApi14NmEmailService19getStaticMetaObjectEv @ 34 NONAME
-	_ZN14EmailClientApi14NmEmailServiceC1EP7QObject @ 35 NONAME
-	_ZN14EmailClientApi14NmEmailServiceC2EP7QObject @ 36 NONAME
-	_ZN14EmailClientApi14NmEmailServiceD0Ev @ 37 NONAME
-	_ZN14EmailClientApi14NmEmailServiceD1Ev @ 38 NONAME
-	_ZN14EmailClientApi14NmEmailServiceD2Ev @ 39 NONAME
-	_ZN14EmailClientApi15NmEventNotifier11qt_metacallEN11QMetaObject4CallEiPPv @ 40 NONAME
-	_ZN14EmailClientApi15NmEventNotifier11qt_metacastEPKc @ 41 NONAME
-	_ZN14EmailClientApi15NmEventNotifier12mailboxEventE12MailboxEvent5QListIyE @ 42 NONAME
-	_ZN14EmailClientApi15NmEventNotifier12messageEventE12MessageEventyy5QListIyE @ 43 NONAME
-	_ZN14EmailClientApi15NmEventNotifier16staticMetaObjectE @ 44 NONAME DATA 16
-	_ZN14EmailClientApi15NmEventNotifier19getStaticMetaObjectEv @ 45 NONAME
-	_ZN14EmailClientApi15NmEventNotifier20sendEventsFromBufferEv @ 46 NONAME
-	_ZN14EmailClientApi15NmEventNotifier5startEv @ 47 NONAME
-	_ZN14EmailClientApi15NmEventNotifier6cancelEv @ 48 NONAME
-	_ZN14EmailClientApi15NmEventNotifierC1EP7QObject @ 49 NONAME
-	_ZN14EmailClientApi15NmEventNotifierC2EP7QObject @ 50 NONAME
-	_ZN14EmailClientApi15NmEventNotifierD0Ev @ 51 NONAME
-	_ZN14EmailClientApi15NmEventNotifierD1Ev @ 52 NONAME
-	_ZN14EmailClientApi15NmEventNotifierD2Ev @ 53 NONAME
-	_ZN14EmailClientApi15NmFolderListing10getFoldersER5QListINS_8NmFolderEE @ 54 NONAME
-	_ZN14EmailClientApi15NmFolderListing11qt_metacallEN11QMetaObject4CallEiPPv @ 55 NONAME
-	_ZN14EmailClientApi15NmFolderListing11qt_metacastEPKc @ 56 NONAME
-	_ZN14EmailClientApi15NmFolderListing13foldersListedEi @ 57 NONAME
-	_ZN14EmailClientApi15NmFolderListing16staticMetaObjectE @ 58 NONAME DATA 16
-	_ZN14EmailClientApi15NmFolderListing19getStaticMetaObjectEv @ 59 NONAME
-	_ZN14EmailClientApi15NmFolderListing5startEv @ 60 NONAME
-	_ZN14EmailClientApi15NmFolderListing6cancelEv @ 61 NONAME
-	_ZN14EmailClientApi15NmFolderListingC1EP7QObjectRKy @ 62 NONAME
-	_ZN14EmailClientApi15NmFolderListingC2EP7QObjectRKy @ 63 NONAME
-	_ZN14EmailClientApi15NmFolderListingD0Ev @ 64 NONAME
-	_ZN14EmailClientApi15NmFolderListingD1Ev @ 65 NONAME
-	_ZN14EmailClientApi15NmFolderListingD2Ev @ 66 NONAME
-	_ZN14EmailClientApi16NmMailboxListing11qt_metacallEN11QMetaObject4CallEiPPv @ 67 NONAME
-	_ZN14EmailClientApi16NmMailboxListing11qt_metacastEPKc @ 68 NONAME
-	_ZN14EmailClientApi16NmMailboxListing12getMailboxesER5QListINS_9NmMailboxEE @ 69 NONAME
-	_ZN14EmailClientApi16NmMailboxListing15mailboxesListedEi @ 70 NONAME
-	_ZN14EmailClientApi16NmMailboxListing16staticMetaObjectE @ 71 NONAME DATA 16
-	_ZN14EmailClientApi16NmMailboxListing19getStaticMetaObjectEv @ 72 NONAME
-	_ZN14EmailClientApi16NmMailboxListing5startEv @ 73 NONAME
-	_ZN14EmailClientApi16NmMailboxListing6cancelEv @ 74 NONAME
-	_ZN14EmailClientApi16NmMailboxListingC1EP7QObject @ 75 NONAME
-	_ZN14EmailClientApi16NmMailboxListingC2EP7QObject @ 76 NONAME
-	_ZN14EmailClientApi16NmMailboxListingD0Ev @ 77 NONAME
-	_ZN14EmailClientApi16NmMailboxListingD1Ev @ 78 NONAME
-	_ZN14EmailClientApi16NmMailboxListingD2Ev @ 79 NONAME
-	_ZN14EmailClientApi17NmEnvelopeListing11qt_metacallEN11QMetaObject4CallEiPPv @ 80 NONAME
-	_ZN14EmailClientApi17NmEnvelopeListing11qt_metacastEPKc @ 81 NONAME
-	_ZN14EmailClientApi17NmEnvelopeListing12getEnvelopesER5QListINS_17NmMessageEnvelopeEE @ 82 NONAME
-	_ZN14EmailClientApi17NmEnvelopeListing15envelopesListedEi @ 83 NONAME
-	_ZN14EmailClientApi17NmEnvelopeListing16staticMetaObjectE @ 84 NONAME DATA 16
-	_ZN14EmailClientApi17NmEnvelopeListing19getStaticMetaObjectEv @ 85 NONAME
-	_ZN14EmailClientApi17NmEnvelopeListing5startEv @ 86 NONAME
-	_ZN14EmailClientApi17NmEnvelopeListing6cancelEv @ 87 NONAME
-	_ZN14EmailClientApi17NmEnvelopeListingC1EP7QObjectyy @ 88 NONAME
-	_ZN14EmailClientApi17NmEnvelopeListingC2EP7QObjectyy @ 89 NONAME
-	_ZN14EmailClientApi17NmEnvelopeListingD0Ev @ 90 NONAME
-	_ZN14EmailClientApi17NmEnvelopeListingD1Ev @ 91 NONAME
-	_ZN14EmailClientApi17NmEnvelopeListingD2Ev @ 92 NONAME
-	_ZN14EmailClientApi17NmMessageEnvelope10setSubjectERK7QString @ 93 NONAME
-	_ZN14EmailClientApi17NmMessageEnvelope11setSentTimeE9QDateTime @ 94 NONAME
-	_ZN14EmailClientApi17NmMessageEnvelope12setIsRepliedEb @ 95 NONAME
-	_ZN14EmailClientApi17NmMessageEnvelope12setPlainTextERK7QString @ 96 NONAME
-	_ZN14EmailClientApi17NmMessageEnvelope12setTotalSizeEy @ 97 NONAME
-	_ZN14EmailClientApi17NmMessageEnvelope14setContentTypeERK7QString @ 98 NONAME
-	_ZN14EmailClientApi17NmMessageEnvelope14setFetchedSizeEy @ 99 NONAME
-	_ZN14EmailClientApi17NmMessageEnvelope14setIsForwardedEb @ 100 NONAME
-	_ZN14EmailClientApi17NmMessageEnvelope15getCcRecipientsER5QListINS_14NmEmailAddressEE @ 101 NONAME
-	_ZN14EmailClientApi17NmMessageEnvelope15getToRecipientsER5QListINS_14NmEmailAddressEE @ 102 NONAME
-	_ZN14EmailClientApi17NmMessageEnvelope15setCcRecipientsERK5QListINS_14NmEmailAddressEE @ 103 NONAME
-	_ZN14EmailClientApi17NmMessageEnvelope15setParentFolderEy @ 104 NONAME
-	_ZN14EmailClientApi17NmMessageEnvelope15setToRecipientsERK5QListINS_14NmEmailAddressEE @ 105 NONAME
-	_ZN14EmailClientApi17NmMessageEnvelope16getPlainTextBodyERNS_13NmMessageBodyE @ 106 NONAME
-	_ZN14EmailClientApi17NmMessageEnvelope17setHasAttachmentsEb @ 107 NONAME
-	_ZN14EmailClientApi17NmMessageEnvelope5setIdEy @ 108 NONAME
-	_ZN14EmailClientApi17NmMessageEnvelope9setIsReadEb @ 109 NONAME
-	_ZN14EmailClientApi17NmMessageEnvelope9setSenderERK7QString @ 110 NONAME
-	_ZN14EmailClientApi17NmMessageEnvelopeC1Ev @ 111 NONAME
-	_ZN14EmailClientApi17NmMessageEnvelopeC2Ev @ 112 NONAME
-	_ZN14EmailClientApi17NmMessageEnvelopeD0Ev @ 113 NONAME
-	_ZN14EmailClientApi17NmMessageEnvelopeD1Ev @ 114 NONAME
-	_ZN14EmailClientApi17NmMessageEnvelopeD2Ev @ 115 NONAME
-	_ZN14EmailClientApi17NmMessageEnvelopeaSERKS0_ @ 116 NONAME
-	_ZN14EmailClientApi8NmFolder13setFolderTypeENS_15EmailFolderTypeE @ 117 NONAME
-	_ZN14EmailClientApi8NmFolder17getChildFolderIdsER5QListIyE @ 118 NONAME
-	_ZN14EmailClientApi8NmFolder17setChildFolderIdsER5QListIyE @ 119 NONAME
-	_ZN14EmailClientApi8NmFolder17setParentFolderIdEy @ 120 NONAME
-	_ZN14EmailClientApi8NmFolder5setIdEy @ 121 NONAME
-	_ZN14EmailClientApi8NmFolder7setNameERK7QString @ 122 NONAME
-	_ZN14EmailClientApi8NmFolderC1Ev @ 123 NONAME
-	_ZN14EmailClientApi8NmFolderC2Ev @ 124 NONAME
-	_ZN14EmailClientApi8NmFolderD1Ev @ 125 NONAME
-	_ZN14EmailClientApi8NmFolderD2Ev @ 126 NONAME
-	_ZN14EmailClientApi9NmMailbox10setAddressERK7QString @ 127 NONAME
-	_ZN14EmailClientApi9NmMailbox5setIdEy @ 128 NONAME
-	_ZN14EmailClientApi9NmMailbox7setNameERK7QString @ 129 NONAME
-	_ZN14EmailClientApi9NmMailboxC1Ev @ 130 NONAME
-	_ZN14EmailClientApi9NmMailboxC2Ev @ 131 NONAME
-	_ZN14EmailClientApi9NmMailboxD0Ev @ 132 NONAME
-	_ZN14EmailClientApi9NmMailboxD1Ev @ 133 NONAME
-	_ZN14EmailClientApi9NmMailboxD2Ev @ 134 NONAME
-	_ZN14EmailClientApi9NmMailboxaSERKS0_ @ 135 NONAME
-	_ZNK13NmMessageTask10metaObjectEv @ 136 NONAME
-	_ZNK14EmailClientApi13NmMessageBody11fetchedSizeEv @ 137 NONAME
-	_ZNK14EmailClientApi13NmMessageBody7contentEv @ 138 NONAME
-	_ZNK14EmailClientApi13NmMessageBody9totalSizeEv @ 139 NONAME
-	_ZNK14EmailClientApi14NmEmailAddress11displayNameEv @ 140 NONAME
-	_ZNK14EmailClientApi14NmEmailAddress7addressEv @ 141 NONAME
-	_ZNK14EmailClientApi14NmEmailService10metaObjectEv @ 142 NONAME
-	_ZNK14EmailClientApi14NmEmailService9isRunningEv @ 143 NONAME
-	_ZNK14EmailClientApi15NmEventNotifier10metaObjectEv @ 144 NONAME
-	_ZNK14EmailClientApi15NmEventNotifier9isRunningEv @ 145 NONAME
-	_ZNK14EmailClientApi15NmFolderListing10metaObjectEv @ 146 NONAME
-	_ZNK14EmailClientApi15NmFolderListing9isRunningEv @ 147 NONAME
-	_ZNK14EmailClientApi16NmMailboxListing10metaObjectEv @ 148 NONAME
-	_ZNK14EmailClientApi16NmMailboxListing9isRunningEv @ 149 NONAME
-	_ZNK14EmailClientApi17NmEnvelopeListing10metaObjectEv @ 150 NONAME
-	_ZNK14EmailClientApi17NmEnvelopeListing9isRunningEv @ 151 NONAME
-	_ZNK14EmailClientApi17NmMessageEnvelope11contentTypeEv @ 152 NONAME
-	_ZNK14EmailClientApi17NmMessageEnvelope11fetchedSizeEv @ 153 NONAME
-	_ZNK14EmailClientApi17NmMessageEnvelope11isForwardedEv @ 154 NONAME
-	_ZNK14EmailClientApi17NmMessageEnvelope12parentFolderEv @ 155 NONAME
-	_ZNK14EmailClientApi17NmMessageEnvelope14hasAttachmentsEv @ 156 NONAME
-	_ZNK14EmailClientApi17NmMessageEnvelope2idEv @ 157 NONAME
-	_ZNK14EmailClientApi17NmMessageEnvelope6isReadEv @ 158 NONAME
-	_ZNK14EmailClientApi17NmMessageEnvelope6senderEv @ 159 NONAME
-	_ZNK14EmailClientApi17NmMessageEnvelope7subjectEv @ 160 NONAME
-	_ZNK14EmailClientApi17NmMessageEnvelope8sentTimeEv @ 161 NONAME
-	_ZNK14EmailClientApi17NmMessageEnvelope9isRepliedEv @ 162 NONAME
-	_ZNK14EmailClientApi17NmMessageEnvelope9plainTextEv @ 163 NONAME
-	_ZNK14EmailClientApi17NmMessageEnvelope9totalSizeEv @ 164 NONAME
-	_ZNK14EmailClientApi8NmFolder10folderTypeEv @ 165 NONAME
-	_ZNK14EmailClientApi8NmFolder14parentFolderIdEv @ 166 NONAME
-	_ZNK14EmailClientApi8NmFolder2idEv @ 167 NONAME
-	_ZNK14EmailClientApi8NmFolder4nameEv @ 168 NONAME
-	_ZNK14EmailClientApi9NmMailbox2idEv @ 169 NONAME
-	_ZNK14EmailClientApi9NmMailbox4nameEv @ 170 NONAME
-	_ZNK14EmailClientApi9NmMailbox7addressEv @ 171 NONAME
-	_ZTI13NmMessageTask @ 172 NONAME
-	_ZTIN14EmailClientApi13NmMessageBodyE @ 173 NONAME
-	_ZTIN14EmailClientApi14NmEmailAddressE @ 174 NONAME
-	_ZTIN14EmailClientApi14NmEmailServiceE @ 175 NONAME
-	_ZTIN14EmailClientApi15NmEventNotifierE @ 176 NONAME
-	_ZTIN14EmailClientApi15NmFolderListingE @ 177 NONAME
-	_ZTIN14EmailClientApi16NmMailboxListingE @ 178 NONAME
-	_ZTIN14EmailClientApi17NmEnvelopeListingE @ 179 NONAME
-	_ZTIN14EmailClientApi17NmMessageEnvelopeE @ 180 NONAME
-	_ZTIN14EmailClientApi9NmMailboxE @ 181 NONAME
-	_ZTV13NmMessageTask @ 182 NONAME
-	_ZTVN14EmailClientApi13NmMessageBodyE @ 183 NONAME
-	_ZTVN14EmailClientApi14NmEmailAddressE @ 184 NONAME
-	_ZTVN14EmailClientApi14NmEmailServiceE @ 185 NONAME
-	_ZTVN14EmailClientApi15NmEventNotifierE @ 186 NONAME
-	_ZTVN14EmailClientApi15NmFolderListingE @ 187 NONAME
-	_ZTVN14EmailClientApi16NmMailboxListingE @ 188 NONAME
-	_ZTVN14EmailClientApi17NmEnvelopeListingE @ 189 NONAME
-	_ZTVN14EmailClientApi17NmMessageEnvelopeE @ 190 NONAME
-	_ZTVN14EmailClientApi9NmMailboxE @ 191 NONAME
+	_ZN14EmailClientApi11NmApiFolder13setFolderTypeENS_20NmApiEmailFolderTypeE @ 1 NONAME
+	_ZN14EmailClientApi11NmApiFolder17getChildFolderIdsER5QListIyE @ 2 NONAME
+	_ZN14EmailClientApi11NmApiFolder17setChildFolderIdsER5QListIyE @ 3 NONAME
+	_ZN14EmailClientApi11NmApiFolder17setParentFolderIdEy @ 4 NONAME
+	_ZN14EmailClientApi11NmApiFolder5setIdEy @ 5 NONAME
+	_ZN14EmailClientApi11NmApiFolder7setNameERK7QString @ 6 NONAME
+	_ZN14EmailClientApi11NmApiFolderC1ERKS0_ @ 7 NONAME
+	_ZN14EmailClientApi11NmApiFolderC1Ev @ 8 NONAME
+	_ZN14EmailClientApi11NmApiFolderC2ERKS0_ @ 9 NONAME
+	_ZN14EmailClientApi11NmApiFolderC2Ev @ 10 NONAME
+	_ZN14EmailClientApi11NmApiFolderD0Ev @ 11 NONAME
+	_ZN14EmailClientApi11NmApiFolderD1Ev @ 12 NONAME
+	_ZN14EmailClientApi11NmApiFolderD2Ev @ 13 NONAME
+	_ZN14EmailClientApi11NmApiFolderaSERKS0_ @ 14 NONAME
+	_ZN14EmailClientApi11NmApiFoldereqERKS0_ @ 15 NONAME
+	_ZN14EmailClientApi12NmApiMailbox10setAddressERK7QString @ 16 NONAME
+	_ZN14EmailClientApi12NmApiMailbox5setIdEy @ 17 NONAME
+	_ZN14EmailClientApi12NmApiMailbox7setNameERK7QString @ 18 NONAME
+	_ZN14EmailClientApi12NmApiMailboxC1ERKS0_ @ 19 NONAME
+	_ZN14EmailClientApi12NmApiMailboxC1Ev @ 20 NONAME
+	_ZN14EmailClientApi12NmApiMailboxC2ERKS0_ @ 21 NONAME
+	_ZN14EmailClientApi12NmApiMailboxC2Ev @ 22 NONAME
+	_ZN14EmailClientApi12NmApiMailboxD0Ev @ 23 NONAME
+	_ZN14EmailClientApi12NmApiMailboxD1Ev @ 24 NONAME
+	_ZN14EmailClientApi12NmApiMailboxD2Ev @ 25 NONAME
+	_ZN14EmailClientApi12NmApiMailboxaSERKS0_ @ 26 NONAME
+	_ZN14EmailClientApi12NmApiMailboxeqERKS0_ @ 27 NONAME
+	_ZN14EmailClientApi16NmApiMessageBody10setContentERK7QString @ 28 NONAME
+	_ZN14EmailClientApi16NmApiMessageBody12setTotalSizeEy @ 29 NONAME
+	_ZN14EmailClientApi16NmApiMessageBody14setFetchedSizeEy @ 30 NONAME
+	_ZN14EmailClientApi16NmApiMessageBodyC1ERKS0_ @ 31 NONAME
+	_ZN14EmailClientApi16NmApiMessageBodyC1Ev @ 32 NONAME
+	_ZN14EmailClientApi16NmApiMessageBodyC2ERKS0_ @ 33 NONAME
+	_ZN14EmailClientApi16NmApiMessageBodyC2Ev @ 34 NONAME
+	_ZN14EmailClientApi16NmApiMessageBodyD0Ev @ 35 NONAME
+	_ZN14EmailClientApi16NmApiMessageBodyD1Ev @ 36 NONAME
+	_ZN14EmailClientApi16NmApiMessageBodyD2Ev @ 37 NONAME
+	_ZN14EmailClientApi16NmApiMessageBodyaSERKS0_ @ 38 NONAME
+	_ZN14EmailClientApi16NmApiMessageBodyeqERKS0_ @ 39 NONAME
+	_ZN14EmailClientApi17NmApiEmailAddress10setAddressERK7QString @ 40 NONAME
+	_ZN14EmailClientApi17NmApiEmailAddress14setDisplayNameERK7QString @ 41 NONAME
+	_ZN14EmailClientApi17NmApiEmailAddressC1ERKS0_ @ 42 NONAME
+	_ZN14EmailClientApi17NmApiEmailAddressC1Ev @ 43 NONAME
+	_ZN14EmailClientApi17NmApiEmailAddressC2ERKS0_ @ 44 NONAME
+	_ZN14EmailClientApi17NmApiEmailAddressC2Ev @ 45 NONAME
+	_ZN14EmailClientApi17NmApiEmailAddressD0Ev @ 46 NONAME
+	_ZN14EmailClientApi17NmApiEmailAddressD1Ev @ 47 NONAME
+	_ZN14EmailClientApi17NmApiEmailAddressD2Ev @ 48 NONAME
+	_ZN14EmailClientApi17NmApiEmailAddressaSERKS0_ @ 49 NONAME
+	_ZN14EmailClientApi17NmApiEmailAddresseqERKS0_ @ 50 NONAME
+	_ZN14EmailClientApi17NmApiEmailService10getMailboxEyRNS_12NmApiMailboxE @ 51 NONAME
+	_ZN14EmailClientApi17NmApiEmailService10initialiseEv @ 52 NONAME
+	_ZN14EmailClientApi17NmApiEmailService11getEnvelopeEyyyRNS_20NmApiMessageEnvelopeE @ 53 NONAME
+	_ZN14EmailClientApi17NmApiEmailService11initializedEb @ 54 NONAME
+	_ZN14EmailClientApi17NmApiEmailService11qt_metacallEN11QMetaObject4CallEiPPv @ 55 NONAME
+	_ZN14EmailClientApi17NmApiEmailService11qt_metacastEPKc @ 56 NONAME
+	_ZN14EmailClientApi17NmApiEmailService12uninitialiseEv @ 57 NONAME
+	_ZN14EmailClientApi17NmApiEmailService16staticMetaObjectE @ 58 NONAME DATA 16
+	_ZN14EmailClientApi17NmApiEmailService19getStaticMetaObjectEv @ 59 NONAME
+	_ZN14EmailClientApi17NmApiEmailServiceC1EP7QObject @ 60 NONAME
+	_ZN14EmailClientApi17NmApiEmailServiceC2EP7QObject @ 61 NONAME
+	_ZN14EmailClientApi17NmApiEmailServiceD0Ev @ 62 NONAME
+	_ZN14EmailClientApi17NmApiEmailServiceD1Ev @ 63 NONAME
+	_ZN14EmailClientApi17NmApiEmailServiceD2Ev @ 64 NONAME
+	_ZN14EmailClientApi18NmApiEventNotifier11qt_metacallEN11QMetaObject4CallEiPPv @ 65 NONAME
+	_ZN14EmailClientApi18NmApiEventNotifier11qt_metacastEPKc @ 66 NONAME
+	_ZN14EmailClientApi18NmApiEventNotifier12mailboxEventENS_17NmApiMailboxEventE5QListIyE @ 67 NONAME
+	_ZN14EmailClientApi18NmApiEventNotifier12messageEventENS_17NmApiMessageEventEyy5QListIyE @ 68 NONAME
+	_ZN14EmailClientApi18NmApiEventNotifier16staticMetaObjectE @ 69 NONAME DATA 16
+	_ZN14EmailClientApi18NmApiEventNotifier19getStaticMetaObjectEv @ 70 NONAME
+	_ZN14EmailClientApi18NmApiEventNotifier20sendEventsFromBufferEv @ 71 NONAME
+	_ZN14EmailClientApi18NmApiEventNotifier5startEv @ 72 NONAME
+	_ZN14EmailClientApi18NmApiEventNotifier6cancelEv @ 73 NONAME
+	_ZN14EmailClientApi18NmApiEventNotifierC1EP7QObject @ 74 NONAME
+	_ZN14EmailClientApi18NmApiEventNotifierC2EP7QObject @ 75 NONAME
+	_ZN14EmailClientApi18NmApiEventNotifierD0Ev @ 76 NONAME
+	_ZN14EmailClientApi18NmApiEventNotifierD1Ev @ 77 NONAME
+	_ZN14EmailClientApi18NmApiEventNotifierD2Ev @ 78 NONAME
+	_ZN14EmailClientApi18NmApiFolderListing10getFoldersER5QListINS_11NmApiFolderEE @ 79 NONAME
+	_ZN14EmailClientApi18NmApiFolderListing11qt_metacallEN11QMetaObject4CallEiPPv @ 80 NONAME
+	_ZN14EmailClientApi18NmApiFolderListing11qt_metacastEPKc @ 81 NONAME
+	_ZN14EmailClientApi18NmApiFolderListing13foldersListedEi @ 82 NONAME
+	_ZN14EmailClientApi18NmApiFolderListing16staticMetaObjectE @ 83 NONAME DATA 16
+	_ZN14EmailClientApi18NmApiFolderListing19getStaticMetaObjectEv @ 84 NONAME
+	_ZN14EmailClientApi18NmApiFolderListing5startEv @ 85 NONAME
+	_ZN14EmailClientApi18NmApiFolderListing6cancelEv @ 86 NONAME
+	_ZN14EmailClientApi18NmApiFolderListingC1EP7QObjectRKy @ 87 NONAME
+	_ZN14EmailClientApi18NmApiFolderListingC2EP7QObjectRKy @ 88 NONAME
+	_ZN14EmailClientApi18NmApiFolderListingD0Ev @ 89 NONAME
+	_ZN14EmailClientApi18NmApiFolderListingD1Ev @ 90 NONAME
+	_ZN14EmailClientApi18NmApiFolderListingD2Ev @ 91 NONAME
+	_ZN14EmailClientApi19NmApiMailboxListing11qt_metacallEN11QMetaObject4CallEiPPv @ 92 NONAME
+	_ZN14EmailClientApi19NmApiMailboxListing11qt_metacastEPKc @ 93 NONAME
+	_ZN14EmailClientApi19NmApiMailboxListing12getMailboxesER5QListINS_12NmApiMailboxEE @ 94 NONAME
+	_ZN14EmailClientApi19NmApiMailboxListing15mailboxesListedEi @ 95 NONAME
+	_ZN14EmailClientApi19NmApiMailboxListing16staticMetaObjectE @ 96 NONAME DATA 16
+	_ZN14EmailClientApi19NmApiMailboxListing19getStaticMetaObjectEv @ 97 NONAME
+	_ZN14EmailClientApi19NmApiMailboxListing5startEv @ 98 NONAME
+	_ZN14EmailClientApi19NmApiMailboxListing6cancelEv @ 99 NONAME
+	_ZN14EmailClientApi19NmApiMailboxListingC1EP7QObject @ 100 NONAME
+	_ZN14EmailClientApi19NmApiMailboxListingC2EP7QObject @ 101 NONAME
+	_ZN14EmailClientApi19NmApiMailboxListingD0Ev @ 102 NONAME
+	_ZN14EmailClientApi19NmApiMailboxListingD1Ev @ 103 NONAME
+	_ZN14EmailClientApi19NmApiMailboxListingD2Ev @ 104 NONAME
+	_ZN14EmailClientApi20NmApiEnvelopeListing11qt_metacallEN11QMetaObject4CallEiPPv @ 105 NONAME
+	_ZN14EmailClientApi20NmApiEnvelopeListing11qt_metacastEPKc @ 106 NONAME
+	_ZN14EmailClientApi20NmApiEnvelopeListing12getEnvelopesER5QListINS_20NmApiMessageEnvelopeEE @ 107 NONAME
+	_ZN14EmailClientApi20NmApiEnvelopeListing15envelopesListedEi @ 108 NONAME
+	_ZN14EmailClientApi20NmApiEnvelopeListing16staticMetaObjectE @ 109 NONAME DATA 16
+	_ZN14EmailClientApi20NmApiEnvelopeListing19getStaticMetaObjectEv @ 110 NONAME
+	_ZN14EmailClientApi20NmApiEnvelopeListing5startEv @ 111 NONAME
+	_ZN14EmailClientApi20NmApiEnvelopeListing6cancelEv @ 112 NONAME
+	_ZN14EmailClientApi20NmApiEnvelopeListingC1EP7QObjectyy @ 113 NONAME
+	_ZN14EmailClientApi20NmApiEnvelopeListingC2EP7QObjectyy @ 114 NONAME
+	_ZN14EmailClientApi20NmApiEnvelopeListingD0Ev @ 115 NONAME
+	_ZN14EmailClientApi20NmApiEnvelopeListingD1Ev @ 116 NONAME
+	_ZN14EmailClientApi20NmApiEnvelopeListingD2Ev @ 117 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelope10setSubjectERK7QString @ 118 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelope11setSentTimeE9QDateTime @ 119 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelope12setIsRepliedEb @ 120 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelope12setPlainTextERK7QString @ 121 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelope12setTotalSizeEy @ 122 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelope14setContentTypeERK7QString @ 123 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelope14setFetchedSizeEy @ 124 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelope14setIsForwardedEb @ 125 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelope15getCcRecipientsER5QListINS_17NmApiEmailAddressEE @ 126 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelope15getToRecipientsER5QListINS_17NmApiEmailAddressEE @ 127 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelope15setCcRecipientsERK5QListINS_17NmApiEmailAddressEE @ 128 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelope15setParentFolderEy @ 129 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelope15setToRecipientsERK5QListINS_17NmApiEmailAddressEE @ 130 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelope16getPlainTextBodyERNS_16NmApiMessageBodyE @ 131 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelope17setHasAttachmentsEb @ 132 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelope5setIdEy @ 133 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelope9setIsReadEb @ 134 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelope9setSenderERK7QString @ 135 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelopeC1ERKS0_ @ 136 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelopeC1Ev @ 137 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelopeC2ERKS0_ @ 138 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelopeC2Ev @ 139 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelopeD0Ev @ 140 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelopeD1Ev @ 141 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelopeD2Ev @ 142 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelopeaSERKS0_ @ 143 NONAME
+	_ZN14EmailClientApi20NmApiMessageEnvelopeeqERKS0_ @ 144 NONAME
+	_ZN16NmApiMessageTask11qt_metacallEN11QMetaObject4CallEiPPv @ 145 NONAME
+	_ZN16NmApiMessageTask11qt_metacastEPKc @ 146 NONAME
+	_ZN16NmApiMessageTask16staticMetaObjectE @ 147 NONAME DATA 16
+	_ZN16NmApiMessageTask19getStaticMetaObjectEv @ 148 NONAME
+	_ZN16NmApiMessageTask6failedEi @ 149 NONAME
+	_ZN16NmApiMessageTask8canceledEv @ 150 NONAME
+	_ZN16NmApiMessageTaskC2EP7QObject @ 151 NONAME
+	_ZN16NmApiMessageTaskD0Ev @ 152 NONAME
+	_ZN16NmApiMessageTaskD1Ev @ 153 NONAME
+	_ZN16NmApiMessageTaskD2Ev @ 154 NONAME
+	_ZNK14EmailClientApi11NmApiFolder10folderTypeEv @ 155 NONAME
+	_ZNK14EmailClientApi11NmApiFolder14parentFolderIdEv @ 156 NONAME
+	_ZNK14EmailClientApi11NmApiFolder2idEv @ 157 NONAME
+	_ZNK14EmailClientApi11NmApiFolder4nameEv @ 158 NONAME
+	_ZNK14EmailClientApi12NmApiMailbox2idEv @ 159 NONAME
+	_ZNK14EmailClientApi12NmApiMailbox4nameEv @ 160 NONAME
+	_ZNK14EmailClientApi12NmApiMailbox7addressEv @ 161 NONAME
+	_ZNK14EmailClientApi16NmApiMessageBody11fetchedSizeEv @ 162 NONAME
+	_ZNK14EmailClientApi16NmApiMessageBody7contentEv @ 163 NONAME
+	_ZNK14EmailClientApi16NmApiMessageBody9totalSizeEv @ 164 NONAME
+	_ZNK14EmailClientApi17NmApiEmailAddress11displayNameEv @ 165 NONAME
+	_ZNK14EmailClientApi17NmApiEmailAddress7addressEv @ 166 NONAME
+	_ZNK14EmailClientApi17NmApiEmailService10metaObjectEv @ 167 NONAME
+	_ZNK14EmailClientApi17NmApiEmailService9isRunningEv @ 168 NONAME
+	_ZNK14EmailClientApi18NmApiEventNotifier10metaObjectEv @ 169 NONAME
+	_ZNK14EmailClientApi18NmApiEventNotifier9isRunningEv @ 170 NONAME
+	_ZNK14EmailClientApi18NmApiFolderListing10metaObjectEv @ 171 NONAME
+	_ZNK14EmailClientApi18NmApiFolderListing9isRunningEv @ 172 NONAME
+	_ZNK14EmailClientApi19NmApiMailboxListing10metaObjectEv @ 173 NONAME
+	_ZNK14EmailClientApi19NmApiMailboxListing9isRunningEv @ 174 NONAME
+	_ZNK14EmailClientApi20NmApiEnvelopeListing10metaObjectEv @ 175 NONAME
+	_ZNK14EmailClientApi20NmApiEnvelopeListing9isRunningEv @ 176 NONAME
+	_ZNK14EmailClientApi20NmApiMessageEnvelope11contentTypeEv @ 177 NONAME
+	_ZNK14EmailClientApi20NmApiMessageEnvelope11fetchedSizeEv @ 178 NONAME
+	_ZNK14EmailClientApi20NmApiMessageEnvelope11isForwardedEv @ 179 NONAME
+	_ZNK14EmailClientApi20NmApiMessageEnvelope12parentFolderEv @ 180 NONAME
+	_ZNK14EmailClientApi20NmApiMessageEnvelope14hasAttachmentsEv @ 181 NONAME
+	_ZNK14EmailClientApi20NmApiMessageEnvelope2idEv @ 182 NONAME
+	_ZNK14EmailClientApi20NmApiMessageEnvelope6isReadEv @ 183 NONAME
+	_ZNK14EmailClientApi20NmApiMessageEnvelope6senderEv @ 184 NONAME
+	_ZNK14EmailClientApi20NmApiMessageEnvelope7subjectEv @ 185 NONAME
+	_ZNK14EmailClientApi20NmApiMessageEnvelope8sentTimeEv @ 186 NONAME
+	_ZNK14EmailClientApi20NmApiMessageEnvelope9isRepliedEv @ 187 NONAME
+	_ZNK14EmailClientApi20NmApiMessageEnvelope9plainTextEv @ 188 NONAME
+	_ZNK14EmailClientApi20NmApiMessageEnvelope9totalSizeEv @ 189 NONAME
+	_ZNK16NmApiMessageTask10metaObjectEv @ 190 NONAME
+	_ZTI16NmApiMessageTask @ 191 NONAME
+	_ZTIN14EmailClientApi11NmApiFolderE @ 192 NONAME
+	_ZTIN14EmailClientApi12NmApiMailboxE @ 193 NONAME
+	_ZTIN14EmailClientApi16NmApiMessageBodyE @ 194 NONAME
+	_ZTIN14EmailClientApi17NmApiEmailAddressE @ 195 NONAME
+	_ZTIN14EmailClientApi17NmApiEmailServiceE @ 196 NONAME
+	_ZTIN14EmailClientApi18NmApiEventNotifierE @ 197 NONAME
+	_ZTIN14EmailClientApi18NmApiFolderListingE @ 198 NONAME
+	_ZTIN14EmailClientApi19NmApiMailboxListingE @ 199 NONAME
+	_ZTIN14EmailClientApi20NmApiEnvelopeListingE @ 200 NONAME
+	_ZTIN14EmailClientApi20NmApiMessageEnvelopeE @ 201 NONAME
+	_ZTV16NmApiMessageTask @ 202 NONAME
+	_ZTVN14EmailClientApi11NmApiFolderE @ 203 NONAME
+	_ZTVN14EmailClientApi12NmApiMailboxE @ 204 NONAME
+	_ZTVN14EmailClientApi16NmApiMessageBodyE @ 205 NONAME
+	_ZTVN14EmailClientApi17NmApiEmailAddressE @ 206 NONAME
+	_ZTVN14EmailClientApi17NmApiEmailServiceE @ 207 NONAME
+	_ZTVN14EmailClientApi18NmApiEventNotifierE @ 208 NONAME
+	_ZTVN14EmailClientApi18NmApiFolderListingE @ 209 NONAME
+	_ZTVN14EmailClientApi19NmApiMailboxListingE @ 210 NONAME
+	_ZTVN14EmailClientApi20NmApiEnvelopeListingE @ 211 NONAME
+	_ZTVN14EmailClientApi20NmApiMessageEnvelopeE @ 212 NONAME
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmclientapi/inc/nmapicommonheader.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef NMAPICOMMONHEADER_H
+#define NMAPICOMMONHEADER_H
+
+#include <nmapiemailaddress.h>
+#include <nmapimessagebody.h>
+#include <nmapidef.h>
+#include <nmapimailbox.h>
+#include <nmapifolder.h>
+#include <nmapimessageenvelope.h>
+
+#endif /* NMAPICOMMONHEADER_H */
--- a/emailservices/nmclientapi/inc/nmapiconverterheader.h	Mon May 03 12:23:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +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 NMAPICONVERTERHEADER_H
-#define NMAPICONVERTERHEADER_H
-
-#include "nmapimailbox.h"
-#include "nmapifolder.h"
-#include "nmapimessageenvelope.h"
-#include "../../../inc/nmmailbox.h"
-#include "../../../inc/nmfolder.h"
-#include "../../../inc/nmmessageenvelope.h"
-#include "nmmessage.h"
-
-#endif /* NMCONVERTERHEADER_H_ */
--- a/emailservices/nmclientapi/inc/nmapidatapluginfactory.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/inc/nmapidatapluginfactory.h	Fri May 14 15:41:10 2010 +0300
@@ -18,35 +18,39 @@
 #ifndef NMAPIDATAPLUGINFACTORY_H
 #define NMAPIDATAPLUGINFACTORY_H
 
-
-#include "nmenginedef.h"
+#include <QList>
 
 class NmDataPluginInterface;
 class QDir;
 class QPluginLoader;
+class QObject;
+
+
+class NmId;
 
 /*!
- \class NmDataPluginFactory
- \brief The class NmDataPluginFactory provides interface to create NmDataPluginInterface
+ \class NmApiDataPluginFactory
+ \brief The class NmApiDataPluginFactory provides interface to create NmDataPluginInterface
  instance.
  */
-class NmDataPluginFactory
+class NmApiDataPluginFactory
 {
 public:
-    static NmDataPluginFactory *instance();
-    static void releaseInstance(NmDataPluginFactory *&instance);
-    NmDataPluginInterface *interfaceInstance(QObject *plugin);
-    NmDataPluginInterface *interfaceInstance(NmId mailboxId);
-    QObject *pluginInstance(NmId mailboxId);
-    QList<QObject*>* pluginInstances();
-    QObject *loadPlugin(const QDir &pluginDir, const QString& pluginName);
+    static NmApiDataPluginFactory *instance();
+    static void releaseInstance(NmApiDataPluginFactory *&instance);
+    NmDataPluginInterface *interfaceInstance();
+    QObject *plugin();
+    
 private:
-    NmDataPluginFactory();
-    virtual ~NmDataPluginFactory();
-    static NmDataPluginFactory *mInstance;
+    NmApiDataPluginFactory();
+    virtual ~NmApiDataPluginFactory();
+    
+    QObject *loadPlugin();
+    
+    static NmApiDataPluginFactory *mInstance;
     static int mReferenceCount;
-    static QList<QObject*> *mPluginArray;
-    static QList<QPluginLoader*> mPluginLoaderArray;
+    static QObject *mPlugin;
+    static QPluginLoader *mPluginLoader;
 };
 
-#endif /* NMDATAPLUGINFACTORY_H_ */
+#endif /* NMAPIDATAPLUGINFACTORY_H */
--- a/emailservices/nmclientapi/inc/nmapidataplugininterface.h	Mon May 03 12:23:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +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 NMAPIDATAPLUGININTERFACE_H_
-#define NMAPIDATAPLUGININTERFACE_H_
-
-#include <QList>
-#include "nmcommon.h"
-
-class NmMailbox;
-class NmMessage;
-class NmMessagePart;
-class NmFolder;
-class NmMessageEnvelope;
-class NmOperation;
-class NmMessageCreationOperation;
-class NmStoreEnvelopesOperation;
-
-/*!
- \class NmDataPluginInterface
- \brief The class NmDataPluginInterface provides an interface to access email data from
- protocol plugins.
- Implementation classes of this interface are expected to emit following signals:
- void mailboxEvent(NmMailboxEvent event,
- const QList<NmId> &mailboxIds);
- void messageEvent(NmMessageEvent event,
- const NmId &folderId,
- const QList<NmId> &messageIds,
- const NmId&);
- */
-class NmDataPluginInterface
-{
-public:
-
-    virtual ~NmDataPluginInterface()
-    {
-    }
-    ;
-    virtual int listMailboxIds(QList<NmId> &mailboxIdList) = 0;
-    virtual int listMailboxes(QList<NmMailbox*> &mailboxList) = 0;
-    virtual int getMailboxById(const NmId &id, NmMailbox *&mailbox) = 0;
-    virtual int deleteMailboxById(const NmId &id) = 0;
-    virtual int getMessageById(
-        const NmId &mailboxId,
-        const NmId &folderId,
-        const NmId &messageId,
-        NmMessage *&message) = 0;
-    virtual int listFolders(const NmId &mailboxId, QList<NmFolder*> &folderList) = 0;
-    virtual int listMessages(
-        const NmId &mailboxId,
-        const NmId &folderId,
-        QList<NmMessageEnvelope*> &messageEnvelopeList) = 0;
-
-    virtual NmOperation *fetchMessage(
-        const NmId &mailboxId,
-        const NmId &folderId,
-        const NmId &messageId) = 0;
-
-    /*!
-     Get standard folder. Returns NmId.getId() == 0 if not found.
-     */
-    virtual NmId getStandardFolderId(const NmId &mailbox, NmFolderType folderType) = 0;
-    virtual int refreshMailbox(NmId mailboxId) = 0;
-    virtual int contentToMessagePart(
-        const NmId &mailboxId,
-        const NmId &folderId,
-        const NmId &messageId,
-        NmMessagePart &messagePart) = 0;
-
-    virtual int deleteMessages(
-        const NmId &mailboxId,
-        const NmId &folderId,
-        const QList<NmId> &messageIdList) = 0;
-
-    virtual NmStoreEnvelopesOperation *storeEnvelopes(
-        const NmId &mailboxId,
-        const NmId &folderId,
-        const QList<const NmMessageEnvelope*> &envelopeList) = 0;
-
-    /*!
-     Creates a new message into the drafts folder of the given mailbox.
-     */
-    virtual NmMessageCreationOperation *createNewMessage(const NmId &mailboxId) = 0;
-
-    /*!
-     Creates a new forward message into the drafts folder of the given mailbox.
-     */
-    virtual NmMessageCreationOperation *createForwardMessage(
-        const NmId &mailboxId,
-        const NmId &originalMessageId) = 0;
-
-    /*!
-     Creates a new reply message into the drafts folder of the given mailbox.
-     */
-    virtual NmMessageCreationOperation *createReplyMessage(
-        const NmId &mailboxId,
-        const NmId &originalMessageId,
-        const bool replyAll) = 0;
-
-    virtual int saveMessage(const NmMessage &message) = 0;
-
-    /*!
-     Removes the message from mailbox.
-     */
-    virtual int
-        removeMessage(const NmId& mailboxId, const NmId& folderId, const NmId& messageId) = 0;
-
-    /*!
-     To get any events from plugins mailboxes must subscribe events first.
-     */
-    virtual void subscribeMailboxEvents(const NmId& mailboxId) = 0;
-
-    /*!
-     When events are no longer needed for mailbox, subscription must be stopped.
-     */
-    virtual void unsubscribeMailboxEvents(const NmId& mailboxId) = 0;
-
-    virtual NmOperation *sendMessage(const NmMessage &message) = 0;
-};
-
-Q_DECLARE_INTERFACE(NmDataPluginInterface, "sf.app.commonmail.emailuis.nmailuiengine.NmDataPluginInterface/1.0")
-
-#endif /* NMDATAPLUGININTERFACE_H_ */
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmclientapi/inc/nmapiemailaddress_p.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,42 @@
+/*
+ * 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 NMAPIEMAILADDRESS_P_H
+#define NMAPIEMAILADDRESS_P_H
+
+#include <QSharedData>
+
+#include <QString>
+
+namespace EmailClientApi
+{
+
+class NmApiEmailAddressPrivate : public QSharedData
+{
+public:
+    NmApiEmailAddressPrivate()
+    {
+    }
+    
+    virtual ~NmApiEmailAddressPrivate()
+    {
+    }
+    
+    QString displayName;
+    QString address;
+};
+}
+#endif /* NMAPIEMAILADDRESS_P_H_ */
--- a/emailservices/nmclientapi/inc/nmapiengine.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/inc/nmapiengine.h	Fri May 14 15:41:10 2010 +0300
@@ -18,45 +18,50 @@
 #ifndef NMAPIENGINE_H
 #define NMAPIENGINE_H
 
-#include "nmenginedef.h"
 #include "nmcommon.h"
-#include "nmapimailbox.h"
-#include "nmapifolder.h"
-#include "nmprivateclasses.h"
-#include "nmapimessageenvelope.h"
+#include "nmapiprivateclasses.h"
+
+class NmApiDataPluginFactory;
 
-class NmDataPluginFactory;
+namespace EmailClientApi
+{
+class NmApiMailbox;
+class NmApiFolder;
+class NmApiMessageEnvelope;
+}
 
-class NmEngine : public QObject
+class NmApiEngine : public QObject
 {
     Q_OBJECT
 public:
-    static NmEngine* instance();
-    static void releaseInstance(NmEngine *&engine);
+    static NmApiEngine* instance();
+    static void releaseInstance(NmApiEngine *&engine);
 
-    void listMailboxes(QList<EmailClientApi::NmMailbox> &mailboxList);
+    void listMailboxes(QList<EmailClientApi::NmApiMailbox> &mailboxList);
 
-    void listFolders(const quint64 mailboxId, QList<EmailClientApi::NmFolder> &folderList);
-    void listEnvelopes(const quint64 mailboxId, const quint64 folderId, QList<
-        EmailClientApi::NmMessageEnvelope> &messageEnvelopeList);
+    void listFolders(const quint64 mailboxId, QList<EmailClientApi::NmApiFolder> &folderList);
+    void listEnvelopes(const quint64 mailboxId, const quint64 folderId, 
+	                   QList<EmailClientApi::NmApiMessageEnvelope> &messageEnvelopeList);
 
-    bool envelopeById(
+    bool getEnvelopeById(
         const quint64 mailboxId,
         const quint64 folderId,
         const quint64 envelopeId,
-        EmailClientApi::NmMessageEnvelope &envelope);
-    bool mailboxById(const quint64 mailboxId, EmailClientApi::NmMailbox &mailbox);
+        EmailClientApi::NmApiMessageEnvelope &envelope);
+		
+    bool getMailboxById(const quint64 mailboxId, EmailClientApi::NmApiMailbox &mailbox);
 
     void startCollectingEvents();
+    
     signals:
     /*!
-     * It contains info about event in emailstore.
-     * 
-     * \arg Contains info about event and related object (message or mailbox list)
+       It contains info about event in emailstore.
+       
+       \arg Contains info about event and related object (message or mailbox list)
      */
     void emailStoreEvent(NmApiMessage message);
 
-public slots:
+private slots:
     void mailboxChangedArrived(NmMailboxEvent, const QList<NmId> &mailboxIds);
     void messageChangedArrived(
         NmMessageEvent messageEvent,
@@ -65,14 +70,14 @@
         const NmId &mailboxId);
 
 private:
-    NmEngine();
-    virtual ~NmEngine();
+    NmApiEngine();
+    virtual ~NmApiEngine();
 
 private:
-    static NmEngine *mInstance;//!<Static instance of NmEngine. There can be only one instance of engine
+    static NmApiEngine *mInstance;//!<Static instance of NmApiEngine. There can be only one instance of engine
     static quint32 mReferenceCount;//!<Count of refences to engine instance
 
-    NmDataPluginFactory *mFactory;//!<Plugin factory. Is needed to get plugins for emails
+    NmApiDataPluginFactory *mFactory;//!<Plugin factory. Is needed to get plugins for emails
 };
 
-#endif /* NMENGINE_H_ */
+#endif /* NMAPIENGINE_H */
--- a/emailservices/nmclientapi/inc/nmapienvelopelisting_p.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/inc/nmapienvelopelisting_p.h	Fri May 14 15:41:10 2010 +0300
@@ -20,19 +20,19 @@
 
 #include <QObject>
 
-#include "nmapimessageenvelope.h"
+class NmApiEngine;
 
-class NmEngine;
 
 namespace EmailClientApi
 {
+class NmApiMessageEnvelope;
 
-class NmEnvelopeListingPrivate : public QObject
+class NmApiEnvelopeListingPrivate : public QObject
 {
 public:
 
-    NmEnvelopeListingPrivate(QObject *parent = 0);
-    virtual ~NmEnvelopeListingPrivate();
+    NmApiEnvelopeListingPrivate(QObject *parent = 0);
+    virtual ~NmApiEnvelopeListingPrivate();
 
     bool initializeEngine();
     void releaseEngine();
@@ -41,9 +41,9 @@
     bool mIsRunning;
     quint64 folderId;
     quint64 mailboxId;
-    NmEngine* mEngine;
+    NmApiEngine *mEngine;
 
-    QList<EmailClientApi::NmMessageEnvelope> mEnvelopes;
+    QList<EmailClientApi::NmApiMessageEnvelope> mEnvelopes;
 };
 }
-#endif /* NMENVELOPELISTINGPRIVATE_H_ */
+#endif /* NMAPIENVELOPELISTINGPRIVATE_H */
--- a/emailservices/nmclientapi/inc/nmapieventnotifier_p.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/inc/nmapieventnotifier_p.h	Fri May 14 15:41:10 2010 +0300
@@ -18,19 +18,21 @@
 #ifndef NMAPIEVENTNOTIFIERPRIVATE_H
 #define NMAPIEVENTNOTIFIERPRIVATE_H
 
-#include "nmprivateclasses.h"
-#include "nmcommon_api.h"
+#include "nmapiprivateclasses.h"
+#include <nmapicommon.h>
 
-class NmEngine;
+class QTimer;
+
+class NmApiEngine;
 
 namespace EmailClientApi
 {
-class NmEventNotifierPrivate : public QObject
+class NmApiEventNotifierPrivate : public QObject
 {
     Q_OBJECT
 public:
-    NmEventNotifierPrivate(QObject *parent = 0);
-    virtual ~NmEventNotifierPrivate();
+    NmApiEventNotifierPrivate(QObject *parent = 0);
+    virtual ~NmApiEventNotifierPrivate();
 
     bool initializeEngine();
     void releaseEngine();
@@ -41,11 +43,11 @@
 
 public:
     QTimer *mEmitSignals;
-    NmEngine *mEngine;
+    NmApiEngine *mEngine;
     QList<NmApiMessage> mBufferOfEvents;
     bool mIsRunning;
 };
 
 }
 
-#endif
+#endif /* NMAPIEVENTNOTIFIERPRIVATE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmclientapi/inc/nmapifolder_p.h	Fri May 14 15:41:10 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:
+ *
+ */
+
+#ifndef NMAPIMAILBOX_P_H
+#define NMAPIMAILBOX_P_H
+
+#include <nmapicommon.h>
+
+
+namespace EmailClientApi
+{
+
+class NmApiFolderPrivate : public QSharedData
+{
+public:
+    NmApiFolderPrivate() 
+    {
+        
+    }
+    virtual ~NmApiFolderPrivate()
+    {
+        
+    }
+
+    quint64 id;
+    QString name;
+    EmailClientApi::NmApiEmailFolderType folderType;
+    quint64 parentId;
+    QList<quint64> childFolderIds;
+};
+
+}
+
+#endif /* NMAPIMAILBOX_P_H_ */
--- a/emailservices/nmclientapi/inc/nmapifolderlisting_p.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/inc/nmapifolderlisting_p.h	Fri May 14 15:41:10 2010 +0300
@@ -17,29 +17,28 @@
 #ifndef NMAPIFOLDERLISTINGPRIVATE_H
 #define NMAPIFOLDERLISTINGPRIVATE_H
 
-#include "nmapifolder.h"
-#include <QObject>
-
-class NmEngine;
+class NmApiEngine;
 
 namespace EmailClientApi
 {
 
-class NmFolderListingPrivate : public QObject
+class NmApiFolder;
+
+class NmApiFolderListingPrivate : public QObject
 {
 public:
 
-    NmFolderListingPrivate(QObject *parent = 0);
-    virtual ~NmFolderListingPrivate();
+    NmApiFolderListingPrivate(QObject *parent = 0);
+    virtual ~NmApiFolderListingPrivate();
 
     bool initializeEngine();
     void releaseEngine();
     qint32 grabFolders();
 
-    QList<EmailClientApi::NmFolder> mFolders;//!<List of folders \sa getFolder \sa QSharedData \sa EmailClientApi::NmFolder
-    NmEngine* mEngine;//!<Pointer to engine instance \sa NmUiEngine
+    QList<EmailClientApi::NmApiFolder> mFolders;//!<List of folders \sa getFolder \sa QSharedData \sa EmailClientApi::NmApiFolder
+    NmApiEngine *mEngine;//!<Pointer to engine instance \sa NmUiEngine
     bool mIsRunning;//!<Keep info if folder listing is running \sa isRunning
     quint64 mMailboxId;//!<Keep info about mailbox id for foler
 };
 }
-#endif /* NMFOLDERLISTINGPRIVATE_H_ */
+#endif /* NMAPIFOLDERLISTINGPRIVATE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmclientapi/inc/nmapimailbox_p.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,47 @@
+/*
+ * 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_P_H
+#define NMAPIMAILBOX_P_H
+
+#include <nmapicommon.h>
+
+
+namespace EmailClientApi
+{
+
+class NmApiMailboxPrivate : public QSharedData
+{
+public:
+    NmApiMailboxPrivate()
+    {
+
+    }
+
+    virtual ~NmApiMailboxPrivate()
+    {
+
+    }
+
+    quint64 id;
+    QString name;
+    QString address;
+};
+
+}
+
+#endif /* NMAPIMAILBOX_P_H */
--- a/emailservices/nmclientapi/inc/nmapimailboxlisting_p.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/inc/nmapimailboxlisting_p.h	Fri May 14 15:41:10 2010 +0300
@@ -17,21 +17,19 @@
 #ifndef NMAPIMAILBOXLISTINGPRIVATE_H
 #define NMAPIMAILBOXLISTINGPRIVATE_H
 
-#include "nmapimailbox.h"
-#include <QObject>
-#include <QList>
-
-class NmEngine;
+class NmApiEngine;
 
 namespace EmailClientApi
 {
-class NmMailboxListingPrivate : public QObject
+
+class NmApiMailbox;
+
+class NmApiMailboxListingPrivate : public QObject
 {
-
 public:
 
-    NmMailboxListingPrivate(QObject *parent = 0);
-    virtual ~NmMailboxListingPrivate();
+    NmApiMailboxListingPrivate(QObject *parent = 0);
+    virtual ~NmApiMailboxListingPrivate();
 
     bool initializeEngine();
 
@@ -39,9 +37,11 @@
 
     qint32 grabMailboxes();
 
-    QList<EmailClientApi::NmMailbox> mMailboxes;//!<List of mailboxes \sa getMailboxInfo \sa QSharedData \sa EmailClientApi::NmMailbox
-    NmEngine* mNmEngine;//!<Pointer to engine instance \sa NmUiEngine
+    QList<EmailClientApi::NmApiMailbox> mMailboxes;//!<List of mailboxes \sa getMailboxInfo \sa QSharedData \sa EmailClientApi::NmApiMailbox
+    NmApiEngine *mNmApiEngine;//!<Pointer to engine instance \sa NmUiEngine
     bool mIsRunning;//!<Keep info if mailbox listing is running \sa isRunning
 };
+
 }
-#endif /* NMMAILBOXLISTINGPRIVATE_H_ */
+
+#endif /* NMAPIMAILBOXLISTINGPRIVATE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmclientapi/inc/nmapimessagebody_p.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,37 @@
+/*
+ * 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_P_H_
+#define NMAPIMESSAGEBODY_P_H_
+
+#include <QString>;
+
+namespace EmailClientApi
+{
+
+class NmApiMessageBodyPrivate : public QSharedData
+{
+public:
+    NmApiMessageBodyPrivate(){};
+    virtual ~NmApiMessageBodyPrivate(){};
+	
+    quint64 totalSize;
+    quint64 fetchedSize;
+    QString content;
+};
+
+}
+#endif /* NMAPIMESSAGEBODY_P_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmclientapi/inc/nmapimessageenvelope_p.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors: 
+ *
+ * Description: 
+ *
+ */
+
+#ifndef NMAPIMESSAGEENVELOPE_P_H_
+#define NMAPIMESSAGEENVELOPE_P_H_
+
+namespace EmailClientApi
+{
+
+class NmApiMessageEnvelopePrivate : public QSharedData
+{
+public:
+    NmApiMessageEnvelopePrivate()
+    {
+    }
+
+    virtual ~NmApiMessageEnvelopePrivate()
+    {
+    }
+
+    bool read;
+    bool attachments;
+    bool forwarded;
+    bool replied;
+
+    QList<EmailClientApi::NmApiEmailAddress> ccRecipients;
+    QList<EmailClientApi::NmApiEmailAddress> toRecipients;
+
+    quint64 id;
+    quint64 parentFolder;
+
+    QString contentType;
+    QString subject;
+    QString sender;
+
+    QString plainText;
+    quint64 totalSize;
+    quint64 fetchedSize;
+
+    QDateTime sentTime;
+};
+}
+
+#endif /* NMAPIMESSAGEENVELOPE_P_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmclientapi/inc/nmapiprivateclasses.h	Fri May 14 15:41:10 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 NMAPIPRIVATECLASSES_H
+#define NMAPIPRIVATECLASSES_H
+
+#include <nmapidef.h>
+#include <QList>
+#include <QMetaType>
+
+/*!
+   Enum for internal info about changes in emial store
+ */
+enum NmApiAction
+{
+    ENew, EChange, EDeleted
+};
+
+/*!
+   Enum for internal info about object type when change in email store is done.
+ */
+enum NmApiObjectType
+{
+    EMailbox, EFolder, EMessage
+};
+
+/*!
+   It keeps data with information about change in email store.
+   
+   It is grouped in list of object by event when mailbox change and by
+   event, mailboxId anf folderId when messages change.
+ */
+struct NmApiMessage
+{
+    NmApiAction action;
+    NmApiObjectType objectType;
+
+    QList<quint64> objectIds;
+
+    quint64 mailboxId;
+    quint64 folderId;
+
+};
+Q_DECLARE_METATYPE(NmApiMessage)
+
+#endif /* NMAPIPRIVATECLASSES_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmclientapi/inc/nmapiprivateheaders.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef NMAPIPRIVATEHEADERS_H
+#define NMAPIPRIVATEHEADERS_H
+
+#include "nmmailbox.h"
+#include "nmmessage.h"
+#include "nmfolder.h"
+#include "nmmessagePart.h"
+
+#endif // NMAPIPRIVATEHEADERS_H
--- a/emailservices/nmclientapi/inc/nmapitypesconverter.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/inc/nmapitypesconverter.h	Fri May 14 15:41:10 2010 +0300
@@ -18,22 +18,32 @@
 #ifndef NMTOAPICONVERTER_H
 #define NMTOAPICONVERTER_H
 
-#include "nmenginedef.h"
-#include "nmapiconverterheader.h"
+#include <QList>
 
+class NmMailbox;
+class NmFolder;
+class NmMessageEnvelope;
+class NmAddress;
 /*!
- * 
+   
  */
+namespace EmailClientApi
+{
+class NmApiMailbox;
+class NmApiFolder;
+class NmApiMessageEnvelope;
+class NmApiEmailAddress;
+}
+
+
 class NmToApiConverter
 {
 public:
-    static EmailClientApi::NmMailbox NmMailbox2ApiNmMailbox(const NmMailbox &mailbox);
-    static EmailClientApi::NmFolder NmFolder2ApiNmFolder(const NmFolder &folder);
-    static EmailClientApi::NmMessageEnvelope NmMessageEnvelope2ApiEnvelope(
+    static EmailClientApi::NmApiMailbox NmMailbox2NmApiMailbox(const NmMailbox &mailbox);
+    static EmailClientApi::NmApiFolder NmFolder2NmApiFolder(const NmFolder &folder);
+    static EmailClientApi::NmApiMessageEnvelope NmMessageEnvelope2NmApiMessageEnvelope(
         const NmMessageEnvelope &envelope);
-
-private:
-    static QList<EmailClientApi::NmEmailAddress> NmAddress2QString(
+    static QList<EmailClientApi::NmApiEmailAddress> NmAddress2QString(
         const QList<NmAddress> &addresses);
 };
 
--- a/emailservices/nmclientapi/inc/nmprivateclasses.h	Mon May 03 12:23:15 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 PRIVATECLASSES_H
-#define PRIVATECLASSES_H
-
-#include "nmenginedef.h"
-#include <QtCore>
-#include <QMetaType>
-
-/*!
- * Enum for internal info about changes in emial store
- */
-enum EApiAction
-{
-    ENew, EChange, EDeleted
-};
-
-/*!
- * Enum for internal info about object type when change in email store is done.
- */
-enum EApiObjectType
-{
-    EMailbox, EFolder, EMessage
-};
-
-/*!
- * It keeps data with information about change in email store.
- * 
- * It is grouped in list of object by event when mailbox change and by
- * event, mailboxId anf folderId when messages change.
- */
-struct NmApiMessage
-{
-    EApiAction action;
-    EApiObjectType objectType;
-
-    QList<quint64> objectIds;
-
-    quint64 mailboxId;
-    quint64 folderId;
-
-};
-Q_DECLARE_METATYPE(NmApiMessage)
-
-#endif /* PRIVATECLASSES_H_ */
--- a/emailservices/nmclientapi/nmclientapi.pro	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/nmclientapi.pro	Fri May 14 15:41:10 2010 +0300
@@ -21,7 +21,7 @@
 QT += core
 
 # BUILD_DLL
-DEFINES += BUILD_ENGINE_DLL
+DEFINES += BUILD_EMAIL_API_DLL
 
 
 INCLUDEPATH +=  inc \
@@ -37,14 +37,14 @@
 
 
 #headers  and sources outside api
-HEADERS   += nmapitypesconverter.h \ 
-             nmprivateclasses.h \
-             nmapidataplugininterface.h \
+HEADERS   += nmapiprivateheaders.h \
+             nmapitypesconverter.h \ 
+             nmapiprivateclasses.h \
+             nmdataplugininterface.h \
              nmapidatapluginfactory.h \
              nmapiengine.h \
-             nmapiconverterheader.h \
              nmmessagepart.h  \
-             nmcommon_api.h
+             nmapicommon.h
              
 #headers  and sources from api             
 SOURCES   += nmapitypesconverter.cpp \
@@ -54,7 +54,8 @@
 
 
 
-HEADERS   += nmapiemailservice.h \
+HEADERS   += nmapicommonheader.h \
+             nmapiemailservice.h \
              nmapimessagetask.h \
              nmapimailboxlisting_p.h \
              nmapimailboxlisting.h \
@@ -62,12 +63,17 @@
              nmapifolderlisting.h \
              nmapienvelopelisting_p.h \
              nmapienvelopelisting.h \
+	     nmapiemailaddress_p.h \
 	     nmapiemailaddress.h \
 	     nmapieventnotifier_p.h \
 	     nmapieventnotifier.h \
+	     nmapifolder_p.h \
 	     nmapifolder.h \
+	     nmapimailbox_p.h \
 	     nmapimailbox.h \
+	     nmapimessagebody_p.h \
 	     nmapimessagebody.h \
+	     nmapimessageenvelope_p.h \
 	     nmapimessageenvelope.h
 			 
 LIBS += -leuser
--- a/emailservices/nmclientapi/src/nmapidatapluginfactory.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapidatapluginfactory.cpp	Fri May 14 15:41:10 2010 +0300
@@ -15,38 +15,38 @@
  *
  */
 
-#include "nmapidataplugininterface.h"
+#include "nmdataplugininterface.h"
 #include "nmapidatapluginfactory.h"
+
 // Qt
-#include <QList>
 #include <QPluginLoader>
 #include <QDir>
 #include <QApplication>
 #include <QLocale>
+#include <QObject>
 
 // nmailbase
 #include "nmcommon.h"
 #include "nmmailbox.h"
-#include "../../../inc/nmmessageenvelope.h"
+#include "nmmessageenvelope.h"
 #include "nmmessage.h"
 #include "nmmessagepart.h"
 #include "nmfolder.h"
 
 /*!
- \class NmDataPluginFactory
- \brief The NmDataPluginFactory class creates NmDataPlugin instance.
+ \class NmApiDataPluginFactory
+ \brief The NmApiDataPluginFactory class creates NmDataPlugin instance.
 
  */
-NmDataPluginFactory *NmDataPluginFactory::mInstance = NULL;
-int NmDataPluginFactory::mReferenceCount = 0;
-QList<QObject*> *NmDataPluginFactory::mPluginArray = NULL;
-QList<QPluginLoader*> NmDataPluginFactory::mPluginLoaderArray = QList<QPluginLoader*> ();
-const int INTERFACEPLUGININDEX = 0;
+NmApiDataPluginFactory *NmApiDataPluginFactory::mInstance = NULL;
+int NmApiDataPluginFactory::mReferenceCount = 0;
+QObject *NmApiDataPluginFactory::mPlugin = NULL;
+QPluginLoader *NmApiDataPluginFactory::mPluginLoader = NULL;
 
 /*!
 
  */
-NmDataPluginFactory::NmDataPluginFactory()
+NmApiDataPluginFactory::NmApiDataPluginFactory()
 {
 
 }
@@ -54,26 +54,26 @@
 /*!
 
  */
-NmDataPluginFactory::~NmDataPluginFactory()
+NmApiDataPluginFactory::~NmApiDataPluginFactory()
 {
-    if (mPluginArray) {
-        qDeleteAll(mPluginArray->begin(), mPluginArray->end());
-        mPluginArray->clear();
-        delete mPluginArray;
-        mPluginArray = NULL;
+    if (mPlugin) {
+        delete mPlugin;
+        mPlugin = NULL;
     }
-
-    qDeleteAll(mPluginLoaderArray.constBegin(), mPluginLoaderArray.constEnd());
-    mPluginLoaderArray.clear();
+    
+    if(mPluginLoader){
+        delete mPluginLoader;
+        mPluginLoader = NULL;
+    }
 }
 
 /*!
 
  */
-NmDataPluginFactory *NmDataPluginFactory::instance()
+NmApiDataPluginFactory *NmApiDataPluginFactory::instance()
 {
     if (!mInstance) {
-        mInstance = new NmDataPluginFactory();
+        mInstance = new NmApiDataPluginFactory();
     }
     mReferenceCount++;
     return mInstance;
@@ -82,7 +82,7 @@
 /*!
 
  */
-void NmDataPluginFactory::releaseInstance(NmDataPluginFactory *&instance)
+void NmApiDataPluginFactory::releaseInstance(NmApiDataPluginFactory *&instance)
 {
     //can't have passed out instances if we don't have any
     if (mInstance) {
@@ -97,83 +97,46 @@
     }
 }
 
-/*!
-
- */
-NmDataPluginInterface *NmDataPluginFactory::interfaceInstance(QObject *plugin)
-{
-    NmDataPluginInterface *pluginInterface = NULL;
-    if (plugin) {
-        pluginInterface = qobject_cast<NmDataPluginInterface*> (plugin);
-    }
-    return pluginInterface;
-}
 
 /*!
 
  */
-NmDataPluginInterface *NmDataPluginFactory::interfaceInstance(NmId mailboxId)
+NmDataPluginInterface *NmApiDataPluginFactory::interfaceInstance()
 {
-    return interfaceInstance(pluginInstance(mailboxId));
-}
-
-/*!
-
- */
-QObject *NmDataPluginFactory::pluginInstance(NmId mailboxId)
-{
-    Q_UNUSED(mailboxId);
-    return pluginInstances()->at(INTERFACEPLUGININDEX);
+    if (!mPlugin) {
+        mPlugin = loadPlugin();
+    }
+    return qobject_cast<NmDataPluginInterface*> (mPlugin);
 }
 
 /*!
 
  */
-QList<QObject*> *NmDataPluginFactory::pluginInstances()
+QObject *NmApiDataPluginFactory::loadPlugin()
 {
-    //if plugins have not been already created, do it now.
-    if (!mPluginArray) {
-        mPluginArray = new QList<QObject*> ();
-    }
-    if (mPluginArray->count() == 0) {
-#ifdef Q_OS_SYMBIAN
-
+    if (!mPluginLoader) {
         const QString KPluginDirectory = "c:\\resource\\plugins";
         QDir pluginDir = QDir(KPluginDirectory);
         const QString KFrameworkPluginName = "nmframeworkadapter.qtplugin";
-        QObject *frameworkPlugin = loadPlugin(pluginDir, KFrameworkPluginName);
-        mPluginArray->append(frameworkPlugin);
+        /*!
+         This creates plugin entity.
+         */
+        mPluginLoader = new QPluginLoader(pluginDir.absoluteFilePath(KFrameworkPluginName));
 
-#endif
+        mPlugin = mPluginLoader->instance();
+        if(!mPlugin){
+            // We don't have proper plugin instance, so we don't need it's loader.
+            delete mPluginLoader;
+            mPluginLoader = NULL;
+        }
     }
-
-    return mPluginArray;
+    return mPlugin;
 }
 
-/*!
-
- */
-QObject *NmDataPluginFactory::loadPlugin(const QDir& pluginDir, const QString& pluginName)
+QObject *NmApiDataPluginFactory::plugin()
 {
-    /*!
-     This creates plugin entity.
-     */
-    QPluginLoader *loader = new QPluginLoader(pluginDir.absoluteFilePath(pluginName));
-
-    QObject *pluginInstance = loader->instance();
-
-    if (pluginInstance) {
-        // Store QPluginLoader instances to keep plugins alive.
-        // If QPluginLoader instance for a plugin is deleted, then there
-        // is a risk that some component outside will load and unload
-        // plugin, which will lead into situation where plugin is deleted.
-        // This means that instance in mPluginArray will be invalid.
-        mPluginLoaderArray.append(loader);
+    if (!mPlugin) {
+        mPlugin = loadPlugin();
     }
-    else {
-        // We don't have proper plugin instance, so we don't need it's loader.
-        delete loader;
-        loader = NULL;
-    }
-    return pluginInstance;
+    return mPlugin;
 }
--- a/emailservices/nmclientapi/src/nmapiemailaddress.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapiemailaddress.cpp	Fri May 14 15:41:10 2010 +0300
@@ -15,58 +15,87 @@
  *
  */
 
-#include "nmapiemailaddress.h"
+#include <nmapiemailaddress.h>
+#include "nmapiemailaddress_p.h"
+
 namespace EmailClientApi
 {
-NmEmailAddressPrivate::NmEmailAddressPrivate()
+/*!
+   copying constructor for nmmessageenvelope
+ */
+NmApiEmailAddress::NmApiEmailAddress(const NmApiEmailAddress &envelope) :
+    d(envelope.d)
 {
+
 }
 
-NmEmailAddressPrivate::~NmEmailAddressPrivate()
+/*!
+   Constructor for NmApiEmailAddress class
+ */
+NmApiEmailAddress::NmApiEmailAddress()
 {
+    d = new NmApiEmailAddressPrivate();
 }
 
-/*
- * Constructor for NmEmailAddress class
+/*!
+   destructor
  */
-NmEmailAddress::NmEmailAddress()
-{
-    d = new NmEmailAddressPrivate();
-}
-
-NmEmailAddress::~NmEmailAddress()
+NmApiEmailAddress::~NmApiEmailAddress()
 {
 
 }
 
-/*
- * getter for displayname
+/*!
+   Assignment operator
+ */
+NmApiEmailAddress &NmApiEmailAddress::operator=(const NmApiEmailAddress &addr)
+{
+    if (this != &addr) {
+        d = addr.d;
+    }
+    return *this;
+}
+
+/*!
+   Compare data from \a addr
  */
-QString NmEmailAddress::displayName() const
+bool NmApiEmailAddress::operator==(const NmApiEmailAddress &addr)
+{
+    bool retVal = false;
+    if (this->d == addr.d) {
+        retVal = true;
+    }
+    return retVal;
+}
+
+/*!
+   getter for displayname
+ */
+QString NmApiEmailAddress::displayName() const
 {
     return d->displayName;
 }
 
-/*
- * getter for address
+/*!
+   getter for address
  */
-QString NmEmailAddress::address() const
+QString NmApiEmailAddress::address() const
 {
     return d->address;
 }
 
-/*
- * setter for displayname 
+/*!
+   setter for displayname 
  */
-void NmEmailAddress::setDisplayName(const QString& displayName)
+void NmApiEmailAddress::setDisplayName(const QString &displayName)
 {
     d->displayName = displayName;
 }
 
-/*
- * setter for address
+/*!
+   setter for address
  */
-void NmEmailAddress::setAddress(const QString& address)
+void NmApiEmailAddress::setAddress(const QString &address)
 {
     d->address = address;
 }
--- a/emailservices/nmclientapi/src/nmapiemailservice.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapiemailservice.cpp	Fri May 14 15:41:10 2010 +0300
@@ -15,47 +15,68 @@
  *
  */
 
-#include "nmapiemailservice.h"
+#include <nmapiemailservice.h>
 #include "nmapiengine.h"
+
+#include <nmapimailbox.h>
+#include <nmapimessageenvelope.h>
+
 namespace EmailClientApi
 {
-NmEmailService::NmEmailService(QObject *parent) :
-    QObject(parent), mEngine(NULL)
+
+/*!
+   constructor for NmEmailService
+ */
+NmApiEmailService::NmApiEmailService(QObject *parent) :
+    QObject(parent), mEngine(NULL), mIsRunning(false)
 {
 
 }
 
-NmEmailService::~NmEmailService()
+/*!
+   destructor for NmApiEmailService
+ */
+NmApiEmailService::~NmApiEmailService()
 {
     if (mEngine) {
         uninitialise();
     }
 }
 
-bool NmEmailService::getEnvelope(
+/*!
+   gets mail message envelope by id (see also NmEventNotifier)
+ */
+bool NmApiEmailService::getEnvelope(
     const quint64 mailboxId,
     const quint64 folderId,
     const quint64 envelopeId,
-    NmMessageEnvelope &envelope)
+    EmailClientApi::NmApiMessageEnvelope &envelope)
 {
     if (!mEngine) {
         return false;
     }
-    return mEngine->envelopeById(mailboxId, folderId, envelopeId, envelope);
+    return mEngine->getEnvelopeById(mailboxId, folderId, envelopeId, envelope);
 }
 
-bool NmEmailService::getMailbox(const quint64 mailboxId, NmMailbox &mailboxInfo)
+/*!
+    gets mailbox info by id (see also NmEventNotifier)
+ */
+bool NmApiEmailService::getMailbox(const quint64 mailboxId, EmailClientApi::NmApiMailbox &mailboxInfo)
 {
     if (!mEngine) {
         return false;
     }
-    return mEngine->mailboxById(mailboxId, mailboxInfo);
+    return mEngine->getMailboxById(mailboxId, mailboxInfo);
 }
 
-void NmEmailService::initialise()
+/*!
+   Initialises email service. this must be called and initialised signal received 
+   before services of the library are used.
+ */
+void NmApiEmailService::initialise()
 {
     if (!mEngine) {
-        mEngine = NmEngine::instance();
+        mEngine = NmApiEngine::instance();
     }
 
     if (mEngine) {
@@ -67,15 +88,22 @@
     }
 }
 
-void NmEmailService::uninitialise()
+/*!
+    frees resources.
+ */
+void NmApiEmailService::uninitialise()
 {
-    NmEngine::releaseInstance(mEngine);
+    NmApiEngine::releaseInstance(mEngine);
     mIsRunning = false;
 }
 
-bool NmEmailService::isRunning() const
+/*!
+   returns isrunning flag value
+ */
+bool NmApiEmailService::isRunning() const
 {
     return mIsRunning;
 }
 
 }
+
--- a/emailservices/nmclientapi/src/nmapiengine.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapiengine.cpp	Fri May 14 15:41:10 2010 +0300
@@ -16,84 +16,83 @@
  */
 
 
+#include <nmapicommonheader.h>
+
 #include "nmapitypesconverter.h"
-#include "nmapidataplugininterface.h"
+#include "nmdataplugininterface.h"
 #include "nmapidatapluginfactory.h"
 #include "nmapiengine.h"
 
+/*!
+    from nmailbase
+*/
+#include "nmapiprivateheaders.h"
 
-NmEngine *NmEngine::mInstance = NULL;
-quint32 NmEngine::mReferenceCount = 0;
+NmApiEngine *NmApiEngine::mInstance = NULL;
+quint32 NmApiEngine::mReferenceCount = 0;
 
 /*!
- \class NmEngine
- \brief The NmEngine class provides access to data for
- mailboxes, folders and messages. If the dataplugin can't be loaded, fatal assert is called.
-
+   \class NmApiEngine
+   \brief The NmEngine class provides access to data for
+   mailboxes, folders and messages.
  */
 
 /*!
- Private constructor
+   Private constructor
  */
-NmEngine::NmEngine() :
+NmApiEngine::NmApiEngine() :
     mFactory(NULL)
 {
-    mFactory = NmDataPluginFactory::instance();
-    Q_ASSERT(mFactory->pluginInstances()->count() > 0);
+    mFactory = NmApiDataPluginFactory::instance();
 }
 
 /*!
- Destructor
+  Destructor
  */
-NmEngine::~NmEngine()
+NmApiEngine::~NmApiEngine()
 {
-    NmDataPluginFactory::releaseInstance(mFactory);
+    NmApiDataPluginFactory::releaseInstance(mFactory);
 }
 
 /*!
- * Creates instance of NmEngine and prvide pointer to it.
- * 
- * If engine exist, it increase references count and provide pointer to it.
- * 
- * \return Instance of engine
+   Creates instance of NmApiEngine and provide pointer to it.
+   
+   If engine exist, it increase references count and provide pointer to it.
+   
+   \return Instance of engine
  */
-NmEngine* NmEngine::instance()
+NmApiEngine *NmApiEngine::instance()
 {
     if (!mInstance) {
-        mInstance = new NmEngine();
+        mInstance = new NmApiEngine();
     }
     mReferenceCount++;
     return mInstance;
 }
 
 /*!
- * Creates connections for events from email store.
+   Creates connections for events from email store.
  */
-void NmEngine::startCollectingEvents()
+void NmApiEngine::startCollectingEvents()
 {
-    QList<QObject*>* pluginList = mFactory->pluginInstances();
-    for (int i = 0; i < pluginList->count(); i++) {
-        QObject* plugin = pluginList->at(i);
-
-        QObject::connect(plugin, SIGNAL(messageEvent(NmMessageEvent, NmId, QList<NmId> , NmId)),
-            this, SLOT(messageChangedArrived(NmMessageEvent, NmId, QList<NmId> , NmId)),
-            Qt::UniqueConnection);
+    QObject *plugin = mFactory->plugin();
+    if(plugin){
+        connect(plugin, SIGNAL(messageEvent(NmMessageEvent, NmId, QList<NmId> , NmId)), this,
+            SLOT(messageChangedArrived(NmMessageEvent, NmId, QList<NmId> , NmId)), Qt::UniqueConnection);
 
         connect(plugin, SIGNAL(mailboxEvent(NmMailboxEvent, QList<NmId> )), this, SLOT(
             mailboxChangedArrived(NmMailboxEvent, QList<NmId> )), Qt::UniqueConnection);
-
     }
-
 }
 
 /*!
- * It process mailbox ids from email store for given event.
- * On end it emit \sa emailStoreEvent
- * 
- * \arg Event of mailbox change
- * \arg List of mailbox ids for that event 
+   It process mailbox ids from email store for given event.
+   On end it emit \sa emailStoreEvent
+   
+   \arg Event of mailbox change
+   \arg List of mailbox ids for that event 
  */
-void NmEngine::mailboxChangedArrived(NmMailboxEvent mailboxEvent, const QList<NmId> &mailboxIds)
+void NmApiEngine::mailboxChangedArrived(NmMailboxEvent mailboxEvent, const QList<NmId> &mailboxIds)
 {
     NmApiMessage message;
     message.objectType = EMailbox;
@@ -125,13 +124,15 @@
 }
 
 /*!
- * It process message ids from email store for given event.
- * On end it emit \sa emailStoreEvent
- * 
- * \arg Event of message change
- * \arg List of message ids for that event 
+   It process message ids from email store for given event.
+   On end it emit \sa emailStoreEvent
+   
+   \param messageEvent Event of message change
+   \param folderId Id of folder from where are messages
+   \param messageIds List of message ids for that event 
+   \param mailboxId Id of mailbox from where are messages
  */
-void NmEngine::messageChangedArrived(
+void NmApiEngine::messageChangedArrived(
     NmMessageEvent messageEvent,
     const NmId &folderId,
     const QList<NmId> &messageIds,
@@ -167,12 +168,12 @@
 }
 
 /*!
- * Release instance of engine if there are not referenced objects. 
- * If there are refenced objects it only decrease refenced count.
- * 
- * \arg Instance of engine
+   Release instance of engine if there are not referenced objects. 
+   If there are refenced objects it only decrease refenced count.
+   
+   \param instance Instance of engine
  */
-void NmEngine::releaseInstance(NmEngine *&instance)
+void NmApiEngine::releaseInstance(NmApiEngine *&instance)
 {
     //can't have passed out instances if we don't have any
     if (mInstance) {
@@ -188,79 +189,77 @@
 }
 
 /*!
- *    It get all mailboxes from email store
- *    
- *    \sa EmailClientApi::NmMailbox
- *    \arg List of mailboxes to be filled.
+      It get all mailboxes from email store
+      
+      \sa EmailClientApi::NmMailbox
+      \param mailboxList List of mailboxes to be filled.
  */
-void NmEngine::listMailboxes(QList<EmailClientApi::NmMailbox> &mailboxList)
+void NmApiEngine::listMailboxes(QList<EmailClientApi::NmApiMailbox> &mailboxList)
 {
     QList<NmMailbox*> mailboxFromPlugin;
-    int count = mFactory->pluginInstances()->count();
-    for (int i = 0; i < count; i++) {
-        NmDataPluginInterface *instance = mFactory->interfaceInstance(
-            mFactory->pluginInstances()->at(i));
-        if (instance) {
-            instance->listMailboxes(mailboxFromPlugin);
-        }
+
+    NmDataPluginInterface *instance =  mFactory->interfaceInstance();
+    if (instance) {
+        instance->listMailboxes(mailboxFromPlugin);
     }
+
     while (mailboxFromPlugin.isEmpty() == false) {
-        NmMailbox* tempNmMailbox = mailboxFromPlugin.takeFirst();
-        mailboxList << NmToApiConverter::NmMailbox2ApiNmMailbox(*tempNmMailbox);
+        NmMailbox* tempNmMailbox = mailboxFromPlugin.takeLast();
+        mailboxList << NmToApiConverter::NmMailbox2NmApiMailbox(*tempNmMailbox);
         delete tempNmMailbox;
     }
 }
 
 /*!
- *    It get all folders from email store for given mailbox
- *    
- *    \sa EmailClientApi::NmFolder
- *    \arg Mailbox id from where folders should be returned
- *    \arg List of folders to be filled.
+      It get all folders from email store for given mailbox
+      
+      \sa EmailClientApi::NmApiFolder
+      \param mailboxId Mailbox id from where folders should be returned
+      \param folderList  of folders to be filled.
  */
-void NmEngine::listFolders(const quint64 mailboxId, QList<EmailClientApi::NmFolder> &folderList)
+void NmApiEngine::listFolders(const quint64 mailboxId, QList<EmailClientApi::NmApiFolder> &folderList)
 {
     QList<NmFolder*> folderFromPlugin;
-    NmDataPluginInterface *instance = mFactory->interfaceInstance(mailboxId);
+    NmDataPluginInterface *instance = mFactory->interfaceInstance();
     if (instance) {
         instance->listFolders(mailboxId, folderFromPlugin);
     }
 
     while (folderFromPlugin.isEmpty() == false) {
-        NmFolder* tempNmFolder = folderFromPlugin.takeFirst();
-        folderList << NmToApiConverter::NmFolder2ApiNmFolder(*tempNmFolder);
+        NmFolder* tempNmFolder = folderFromPlugin.takeLast();
+        folderList << NmToApiConverter::NmFolder2NmApiFolder(*tempNmFolder);
         delete tempNmFolder;
     }
 }
 
 /*!
- *    It get all envelopes from email store for given mailbox and folder
- *    
- *    \sa EmailClientApi::NmMessageEnvelope
- *    \arg Mailbox id from where envelope should be returned
- *    \arg Folder id from where envelope should be returned
- *    \arg List of envelopes to be filled.
+      It get all envelopes from email store for given mailbox and folder
+      
+      \sa EmailClientApi::NmApiMessageEnvelope
+      \param mailboxId Mailbox id from where envelope should be returned
+      \param folderId Folder id from where envelope should be returned
+      \param messageEnvelopeList List of envelopes to be filled.
  */
-void NmEngine::listEnvelopes(const quint64 mailboxId, const quint64 folderId, QList<
-    EmailClientApi::NmMessageEnvelope> &messageEnvelopeList)
+void NmApiEngine::listEnvelopes(const quint64 mailboxId, const quint64 folderId, 
+                    QList<EmailClientApi::NmApiMessageEnvelope> &messageEnvelopeList)
 {
-    QList<NmMessageEnvelope*> envelopes;
-    NmDataPluginInterface *instance = mFactory->interfaceInstance(folderId);
+    QList<NmMessage*> messages;
+    NmDataPluginInterface *instance = mFactory->interfaceInstance();
     if (instance) {
-        instance->listMessages(mailboxId, folderId, envelopes);
+        instance->listMessages(mailboxId, folderId, messages);
     }
 
-    while (!envelopes.isEmpty()) {
-        NmMessageEnvelope* env = envelopes.takeFirst();
-
-        EmailClientApi::NmMessageEnvelope nmEnvelope =
-            NmToApiConverter::NmMessageEnvelope2ApiEnvelope(*env);
-        NmMessage* message = new NmMessage();
-        instance->getMessageById(mailboxId, folderId, nmEnvelope.id(), message);
-
+    while (!messages.isEmpty()) {
+        NmMessage* message = messages.takeFirst();
+            
+        EmailClientApi::NmApiMessageEnvelope nmEnvelope =
+            NmToApiConverter::NmMessageEnvelope2NmApiMessageEnvelope(message->envelope());
+        
+        NmMessagePart *plainTextPart = message->plainTextBodyPart();
+        
         QString plainText = QString();
-        if (message->plainTextBodyPart()) {
-            plainText = message->plainTextBodyPart()->textContent();
+        if (plainTextPart) {
+            plainText = plainTextPart->textContent();
         }
 
         nmEnvelope.setPlainText(plainText);
@@ -268,69 +267,80 @@
         nmEnvelope.setTotalSize(message->size());
 
         messageEnvelopeList << nmEnvelope;
-        delete env;
+        delete message;
     }
 }
 
 /*!
- * Return envelope given by mailbox, folder and envelope id.
- * 
- * \arg Mailbox id from where envlope should come
- * \arg Folder id from where envlope should come
- * \arg Id of envelope which should be returned
- * \arg Envelope to fill.
- * 
- * \return Return true if it will find any envelope
+   Return envelope given by mailbox, folder and envelope id.
+   
+   \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 envelope Envelope to fill.
+   
+   \return Return true if it will find any envelope
  */
-bool NmEngine::envelopeById(
+bool NmApiEngine::getEnvelopeById(
     const quint64 mailboxId,
     const quint64 folderId,
     const quint64 envelopeId,
-    EmailClientApi::NmMessageEnvelope& envelope)
+    EmailClientApi::NmApiMessageEnvelope &envelope)
 {
-    QList<EmailClientApi::NmMessageEnvelope> envelopes;
-    listEnvelopes(mailboxId, folderId, envelopes);
-
     //flag indicating that envelope with given id was found
     bool found = false;
+    NmDataPluginInterface *instance = mFactory->interfaceInstance();
+    if (instance) {
+        NmMessage *message(NULL);
+        instance->getMessageById(mailboxId, folderId, envelopeId, message);
+        if(message){
+            NmMessageEnvelope env = message->envelope();
 
-    for (int i = 0; i < envelopes.count(); i++) {
-        if (envelopes.at(i).id() == envelopeId) {
-            envelope = envelopes.at(i);
+            envelope = NmToApiConverter::NmMessageEnvelope2NmApiMessageEnvelope(env);
+            QString plainText = QString();
+            
+            NmMessagePart *plainTextPart = message->plainTextBodyPart();
+            if (plainTextPart) {
+                instance->contentToMessagePart(mailboxId, folderId, envelopeId, *plainTextPart);
+                plainText = plainTextPart->textContent();
+            }
+
+            envelope.setPlainText(plainText);
+            envelope.setFetchedSize(message->fetchedSize());
+            envelope.setTotalSize(message->size());
+
             found = true;
-            break;
+            delete plainTextPart;
         }
+        delete message;
     }
-
-    return found ? true : false;
+    return found;
 }
 
 /*!
- * Return mailbox given by mailbox id.
- * 
- * \arg Id of Mailbox which should be returned
- * \arg Mailbox to fill.
- * 
- * \return Return true if it will find any envelope
+   Return mailbox given by mailbox id.
+   
+   \param mailboxId Id of Mailbox which should be returned
+   \param mailbox Mailbox to fill.
+   
+   \return Return true if it will find any envelope
  */
-bool NmEngine::mailboxById(const quint64 mailboxId, EmailClientApi::NmMailbox &mailbox)
+bool NmApiEngine::getMailboxById(const quint64 mailboxId, EmailClientApi::NmApiMailbox &mailbox)
 {
-    NmDataPluginInterface *instance = mFactory->interfaceInstance(mailboxId);
+    //flag indicating that mailbox with given id was found
+    bool found = false;
+    NmDataPluginInterface *instance = mFactory->interfaceInstance();
 
-    if (!instance) {
-        return false;
+    if (instance) {    
+        NmMailbox *nmmailbox = NULL;
+        instance->getMailboxById(NmId(mailboxId), nmmailbox);
+    
+        if (nmmailbox) {
+            mailbox = NmToApiConverter::NmMailbox2NmApiMailbox(*nmmailbox);
+            found = true;
+            delete nmmailbox;
+        }
     }
-
-    NmMailbox *nmmailbox;
-    instance->getMailboxById(NmId(mailboxId), nmmailbox);
-
-    if (!nmmailbox) {
-        return false;
-    }
-
-    mailbox = NmToApiConverter::NmMailbox2ApiNmMailbox(*nmmailbox);
-
-    return true;
-
+    
+    return found;
 }
-
--- a/emailservices/nmclientapi/src/nmapienvelopelisting.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapienvelopelisting.cpp	Fri May 14 15:41:10 2010 +0300
@@ -15,31 +15,37 @@
  *
  */
 
+
+#include <nmapienvelopelisting.h>
 #include "nmapienvelopelisting_p.h"
-#include "nmapienvelopelisting.h"
+
+#include <nmapicommonheader.h>
+
 #include "nmapiengine.h"
 
+
+
 namespace EmailClientApi
 {
 /*!
- * Constructor of class. It set start values.
+   Constructor of class. It set start values.
  */
-NmEnvelopeListing::NmEnvelopeListing(
+NmApiEnvelopeListing::NmApiEnvelopeListing(
     QObject *parent,
     const quint64 folderId,
     const quint64 mailboxId) :
-    NmMessageTask(parent)
+    NmApiMessageTask(parent)
 {
-    mListingPrivate = new NmEnvelopeListingPrivate(this);
+    mListingPrivate = new NmApiEnvelopeListingPrivate(this);
     mListingPrivate->mailboxId = mailboxId;
     mListingPrivate->folderId = folderId;
     mListingPrivate->mIsRunning = false;
 }
 
 /*!
- * Destructor of class. It release engine to be safe if manual releasing won't work.
+   Destructor of class. It release engine to be safe if manual releasing won't work.
  */
-NmEnvelopeListing::~NmEnvelopeListing()
+NmApiEnvelopeListing::~NmApiEnvelopeListing()
 {
     if (mListingPrivate->mIsRunning) {
         mListingPrivate->releaseEngine();
@@ -47,19 +53,19 @@
 }
 
 /*!
- * \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());
- * </code>
- * 
+   \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());
+   </code>
+   
  */
-bool NmEnvelopeListing::start()
+bool NmApiEnvelopeListing::start()
 {
     bool result = false;
 
@@ -87,13 +93,13 @@
 }
 
 /*!
- * \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 NmMessageTask::canceled() signal.
+   \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 NmEnvelopeListing::cancel()
+void NmApiEnvelopeListing::cancel()
 {
     if (mListingPrivate->mIsRunning) {
         mListingPrivate->mIsRunning = false;
@@ -105,13 +111,14 @@
 }
 
 /*! 
- * \brief Returns results after envelopesListed signal is received.
- * 
- *  Caller gets ownership of envelopes. Returns true if results were available.
- *  It clears list of envelopes after be called.
- *  It also at start clear inputlist of NmMessageEnvelope.
+   \brief Returns results after envelopesListed signal is received.
+   
+    Caller gets ownership of envelopes. Returns true if results were available.
+    Before calling cancel and start should be called,
+    because after second calling it return empty list.
+    It also at start clear inputlist of NmMessageEnvelope.
  */
-bool NmEnvelopeListing::getEnvelopes(QList<EmailClientApi::NmMessageEnvelope> &envelopes)
+bool NmApiEnvelopeListing::getEnvelopes(QList<EmailClientApi::NmApiMessageEnvelope> &envelopes)
 {
     envelopes.clear();
 
@@ -129,12 +136,11 @@
 }
 
 /*!
- * \brief Return info if listing is running
+   \brief Return info if listing is running
  */
-bool NmEnvelopeListing::isRunning() const
+bool NmApiEnvelopeListing::isRunning() const
 {
     return mListingPrivate->mIsRunning;
 }
+
 }
-
-#include "moc_nmapienvelopelisting.cpp"
--- a/emailservices/nmclientapi/src/nmapienvelopelisting_p.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapienvelopelisting_p.cpp	Fri May 14 15:41:10 2010 +0300
@@ -17,56 +17,61 @@
 #include "nmapiengine.h"
 #include "nmapienvelopelisting_p.h"
 
+#include <nmapimailbox.h>
+#include <nmapimessageenvelope.h>
+
+
+
 namespace EmailClientApi
 {
-NmEnvelopeListingPrivate::NmEnvelopeListingPrivate(QObject* parent) :
+NmApiEnvelopeListingPrivate::NmApiEnvelopeListingPrivate(QObject *parent) :
     QObject(parent), mEngine(NULL)
 {
 
 }
 
-NmEnvelopeListingPrivate::~NmEnvelopeListingPrivate()
+NmApiEnvelopeListingPrivate::~NmApiEnvelopeListingPrivate()
 {
     releaseEngine();
 }
 
 /*!
- * \brief It initialize engine for email operations. 
- * 
- * When use initializeEngine need to remember release it.
- * It return value if initialization go good.
- * \sa releaseEngine 
+   \brief It initialize engine for email operations. 
+   
+   When use initializeEngine need to remember release it.
+   It return value if initialization go good.
+   \sa releaseEngine 
  */
-bool NmEnvelopeListingPrivate::initializeEngine()
+bool NmApiEnvelopeListingPrivate::initializeEngine()
 {
-    mEngine = NmEngine::instance();
+    mEngine = NmApiEngine::instance();
     return mEngine ? true : false;
 }
 
 /*!
- * \brief It release engine for email operations.
- * 
- * It release Engine and return value if release go good.
- * 
- * \arg engine Is used to get info if engine was released, if yes, then argument have value 0.
- * 
- * \sa initializeEngine
+   \brief It release engine for email operations.
+   
+   \sa initializeEngine
  */
-void NmEnvelopeListingPrivate::releaseEngine()
+void NmApiEnvelopeListingPrivate::releaseEngine()
 {
-    NmEngine::releaseInstance(mEngine);
+    NmApiEngine::releaseInstance(mEngine);
 }
 
 /*!
- * \brief It grab envelopes from engine. 
- * 
- * When it start grabing, it release all old.
- * Because it uses NmMessageEnvelope with sharedData we don't need care about release memory.
- * 
- * \return Count of envelopes
+   \brief It grab envelopes from engine. 
+   
+   When it start grabing, it release all old.
+   Because it uses NmApiMessageEnvelope with sharedData we don't need care about release memory.
+   
+   \return Count of envelopes or "-1" if there is no engine initialised
  */
-qint32 NmEnvelopeListingPrivate::grabEnvelopes()
+qint32 NmApiEnvelopeListingPrivate::grabEnvelopes()
 {
+    if(!mEngine){
+        return -1;
+    }
+    
     mEnvelopes.clear();
     mEngine->listEnvelopes(mailboxId, folderId, mEnvelopes);
     return mEnvelopes.count();
--- a/emailservices/nmclientapi/src/nmapieventnotifier.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapieventnotifier.cpp	Fri May 14 15:41:10 2010 +0300
@@ -18,120 +18,106 @@
 #include <QList>
 #include <QVariant>
 #include <QString>
+#include <QTimer>
 
 #include "nmapiengine.h"
+#include <nmapieventnotifier.h>
 #include "nmapieventnotifier_p.h"
-#include "nmapieventnotifier.h"
 
-
-quint32 IntervalEmitingSignals = 10000;
+const quint32 IntervalEmitingSignals = 10000;
 
 namespace EmailClientApi
 {
 /*!
- * Constructor
+   Constructor
  */
-NmEventNotifier::NmEventNotifier(QObject *parent) :
-    NmMessageTask(parent)
+NmApiEventNotifier::NmApiEventNotifier(QObject *parent) :
+    NmApiMessageTask(parent)
 
 {
     //set timer
-    mNmEventNotifierPrivate = new NmEventNotifierPrivate(this);
-    mNmEventNotifierPrivate->mEmitSignals = new QTimer(this);
-    mNmEventNotifierPrivate->mEmitSignals->setInterval(IntervalEmitingSignals);
-    connect(mNmEventNotifierPrivate->mEmitSignals, SIGNAL(timeout()), this, SLOT(
+    mNmApiEventNotifierPrivate = new NmApiEventNotifierPrivate(this);
+    mNmApiEventNotifierPrivate->mEmitSignals = new QTimer(this);
+    mNmApiEventNotifierPrivate->mEmitSignals->setInterval(IntervalEmitingSignals);
+    connect(mNmApiEventNotifierPrivate->mEmitSignals, SIGNAL(timeout()), this, SLOT(
         sendEventsFromBuffer()), Qt::QueuedConnection);
 
 }
 
 /*!
- * Destructor
+   Destructor
  */
-NmEventNotifier::~NmEventNotifier()
+NmApiEventNotifier::~NmApiEventNotifier()
 {
-    if (mNmEventNotifierPrivate->mIsRunning) {
-        mNmEventNotifierPrivate->releaseEngine();
+    if (mNmApiEventNotifierPrivate->mIsRunning) {
+        mNmApiEventNotifierPrivate->releaseEngine();
     }
-
-    delete mNmEventNotifierPrivate;
 }
 
 /*!
- * Start monitoring email events
- * 
- * \return Value tells about monitoring system running
+   Start monitoring email events
+   
+   \return Value tells about monitoring system running
  */
-bool NmEventNotifier::start()
+bool NmApiEventNotifier::start()
 {
     bool result = false;
 
-    if (mNmEventNotifierPrivate->mIsRunning) {
+    if (mNmApiEventNotifierPrivate->mIsRunning) {
         result = true;
     }
     else
-        if (!mNmEventNotifierPrivate->initializeEngine()) {
-            mNmEventNotifierPrivate->mIsRunning = false;
+        if (!mNmApiEventNotifierPrivate->initializeEngine()) {
+            mNmApiEventNotifierPrivate->mIsRunning = false;
             result = false;
         }
         else {
             qRegisterMetaType<QList<quint64> > ("QList<quint64>");
             qRegisterMetaType<NmApiMessage> ("NmApiMessage");
 
-            connect(mNmEventNotifierPrivate->mEngine, SIGNAL(emailStoreEvent(NmApiMessage)), this,
+            connect(mNmApiEventNotifierPrivate->mEngine, SIGNAL(emailStoreEvent(NmApiMessage)), mNmApiEventNotifierPrivate,
                 SLOT(emailStoreEvent(NmApiMessage)), Qt::QueuedConnection);
 
-            mNmEventNotifierPrivate->mEmitSignals->start();
-            mNmEventNotifierPrivate->mIsRunning = true;
+            mNmApiEventNotifierPrivate->mEmitSignals->start();
+            mNmApiEventNotifierPrivate->mIsRunning = true;
             result = true;
         }
     return result;
 }
 
 /*!
- * Cancels monitoring.
- * 
- * In user responsibility is to cancel monitoring.
- * On end it clear buffer events and emits \sa NmMessageTask::canceled() signal.
+   Cancels monitoring.
+   
+   In user responsibility is to cancel monitoring.
+   On end it clear buffer events and emits \sa NmApiMessageTask::canceled() signal.
  */
-void NmEventNotifier::cancel()
+void NmApiEventNotifier::cancel()
 {
-    if (!mNmEventNotifierPrivate->mIsRunning) {
-        return;
-    }
-
-    mNmEventNotifierPrivate->mIsRunning = false;
-    mNmEventNotifierPrivate->mEmitSignals->stop();
-
-    if (mNmEventNotifierPrivate->mEngine) {
-        disconnect(mNmEventNotifierPrivate->mEngine, SIGNAL(emailStoreEvent(NmApiMessage)), this,
-            SLOT(emailStoreEvent(NmApiMessage)));
-    }
-
-    mNmEventNotifierPrivate->releaseEngine();
-
-    mNmEventNotifierPrivate->mBufferOfEvents.clear();
-
+    mNmApiEventNotifierPrivate->cancel();
     emit canceled();
 }
 
-bool NmEventNotifier::isRunning() const
+/*!
+   Informs if event notifier is running
+ */
+bool NmApiEventNotifier::isRunning() const
 {
-    return mNmEventNotifierPrivate->mIsRunning;
+    return mNmApiEventNotifierPrivate->mIsRunning;
 }
 
 /*!
- * 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.
+   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 NmEventNotifier::sendEventsFromBuffer()
+void NmApiEventNotifier::sendEventsFromBuffer()
 {
-    qRegisterMetaType<MailboxEvent> ("MailboxEvent");
-    qRegisterMetaType<MailboxEvent> ("MessageEvent");
+    qRegisterMetaType<EmailClientApi::NmApiMailboxEvent> ("EmailClientApi::NmApiMailboxEvent");
+    qRegisterMetaType<EmailClientApi::NmApiMessageEvent> ("EmailClientApi::NmApiMessageEvent");
     NmApiMessage events;
-    while (!mNmEventNotifierPrivate->mBufferOfEvents.isEmpty()) {
-        events = mNmEventNotifierPrivate->mBufferOfEvents.takeFirst();
+    while (!mNmApiEventNotifierPrivate->mBufferOfEvents.isEmpty()) {
+        events = mNmApiEventNotifierPrivate->mBufferOfEvents.takeFirst();
         switch (events.objectType) {
             case EMailbox:
                 switch (events.action) {
@@ -189,4 +175,3 @@
 
 } //End of EmailClientApi
 
-#include "moc_nmapieventnotifier.cpp"
--- a/emailservices/nmclientapi/src/nmapieventnotifier_p.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapieventnotifier_p.cpp	Fri May 14 15:41:10 2010 +0300
@@ -18,76 +18,88 @@
 #include "nmapiengine.h"
 #include "nmapieventnotifier_p.h"
 
+#include <QTimer>
+
 namespace EmailClientApi
 {
 /*!
- * Constructor
+   Constructor
  */
-NmEventNotifierPrivate::NmEventNotifierPrivate(QObject *parent) :
+NmApiEventNotifierPrivate::NmApiEventNotifierPrivate(QObject *parent) :
     QObject(parent), mEmitSignals(NULL), mEngine(NULL), mIsRunning(false)
 {
 
 }
 
 /*!
- * Destructor
+   Destructor
  */
-NmEventNotifierPrivate::~NmEventNotifierPrivate()
+NmApiEventNotifierPrivate::~NmApiEventNotifierPrivate()
 {
 
 }
 
 /*!
- * \brief It initialize engine for email operations. 
- * 
- * When use initializeEngine need to remember release it.
- * It return value if initialization go good.
- * \sa releaseEngine 
- * \return Return true if engine works.
+   \brief It initialize engine for email operations. 
+   
+   When use initializeEngine need to remember release it.
+   It return value if initialization go good.
+   \sa releaseEngine 
+   \return Return true if engine works.
  */
-bool NmEventNotifierPrivate::initializeEngine()
+bool NmApiEventNotifierPrivate::initializeEngine()
 {
     if (!mEngine) {
-        mEngine = NmEngine::instance();
+        mEngine = NmApiEngine::instance();
     }
 
     return mEngine ? true : false;
 }
 
 /*!
- * \brief It release engine for email operations.
- * 
- * It release Engine and return value if release go good.
- * 
- * \arg engine Is used to get info if engine was released, if yes, then argument have value 0.
- * 
- * \sa initializeEngine
+   \brief It release engine for email operations.
+   
+   \sa initializeEngine
  */
-void NmEventNotifierPrivate::releaseEngine()
+void NmApiEventNotifierPrivate::releaseEngine()
 {
     if (mIsRunning) {
         cancel();
     }
     else {
-        NmEngine::releaseInstance(mEngine);
+        NmApiEngine::releaseInstance(mEngine);
     }
 }
 
 /*!
- * Add one email event into buffer.
- * 
- * It is run by \sa NmEngine::emailStoreEvent signal.
- * \sa NmApiMessage
- * \arg It contains full info about object and it event.
+   Add one email event into buffer.
+   
+   It is run by \sa NmApiEngine::emailStoreEvent signal.
+   \sa NmApiMessage
+   \param events It contains full info about object and it event.
  */
-void NmEventNotifierPrivate::emailStoreEvent(const NmApiMessage &events)
+void NmApiEventNotifierPrivate::emailStoreEvent(const NmApiMessage &events)
 {
     mBufferOfEvents << events;
 }
 
-void NmEventNotifierPrivate::cancel()
+void NmApiEventNotifierPrivate::cancel()
 {
+    if (!mIsRunning) {
+        return;
+    }
 
+    mIsRunning = false;
+    mEmitSignals->stop();
+
+    if (mEngine) {
+        disconnect(mEngine, SIGNAL(emailStoreEvent(NmApiMessage)), this,
+            SLOT(emailStoreEvent(NmApiMessage)));
+    }
+
+    releaseEngine();
+
+    mBufferOfEvents.clear();
 }
 
 }
--- a/emailservices/nmclientapi/src/nmapifolder.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapifolder.cpp	Fri May 14 15:41:10 2010 +0300
@@ -15,111 +15,138 @@
  *
  */
 
-#include "nmapifolder.h"
+#include <nmapifolder.h>
+#include "nmapifolder_p.h"
 
 namespace EmailClientApi
 {
-NmFolderPrivate::NmFolderPrivate()
+
+/*!
+   constructor for NmFolder class
+ */
+NmApiFolder::NmApiFolder()
 {
-
+    d = new NmApiFolderPrivate();
 }
 
-NmFolderPrivate::~NmFolderPrivate()
+/*!
+    Copy constructor for NmApiMailbox 
+ */
+NmApiFolder::NmApiFolder(const NmApiFolder &nmApiFolder)
+: d(nmApiFolder.d)
+{
+    
+}
+
+/*!
+   destructor for NmApiFolder class
+ */
+NmApiFolder::~NmApiFolder()
 {
 
 }
 
-/*
- * constructor for NmFolder class
+/*!
+   Assign data from \a folder
  */
-NmFolder::NmFolder()
+NmApiFolder &NmApiFolder::operator=(const NmApiFolder &folder)
 {
-    d = new NmFolderPrivate();
+    if (this != &folder) {
+        d = folder.d;
+    }
+    return *this;
 }
 
-/*
- * destructor for NmFolder class
+/*!
+   Compare data from \a folder
  */
-NmFolder::~NmFolder()
+bool NmApiFolder::operator==(const NmApiFolder &folder)
 {
-
+    bool returnValue = false;
+    if (d == folder.d) {
+        returnValue = true;
+    }
+    return returnValue;
 }
 
-/*
- * getter for id
+/*!
+   getter for id
  */
-quint64 NmFolder::id() const
+quint64 NmApiFolder::id() const
 {
     return d->id;
 }
 
-/*
- * getter for name 
+/*!
+   getter for name 
  */
-QString NmFolder::name() const
+QString NmApiFolder::name() const
 {
     return d->name;
 }
 
-/*
- * getter for foldertype
+/*!
+   getter for foldertype
  */
-EmailFolderType NmFolder::folderType() const
+EmailClientApi::NmApiEmailFolderType NmApiFolder::folderType() const
 {
     return d->folderType;
 }
 
-/*
- * setter for name
+/*!
+   setter for name
  */
-void NmFolder::setName(const QString& name)
+void NmApiFolder::setName(const QString& name)
 {
     d->name = name;
 }
 
-/*
- * setter for id
+/*!
+   setter for id
  */
-void NmFolder::setId(quint64 id)
+void NmApiFolder::setId(quint64 id)
 {
     d->id = id;
 }
 
-/*
- * setter for foldertype
+/*!
+   setter for foldertype
  */
-void NmFolder::setFolderType(EmailFolderType folderType)
+void NmApiFolder::setFolderType(EmailClientApi::NmApiEmailFolderType folderType)
 {
     d->folderType = folderType;
 }
 
-/*
- * setter for parent folder id
+/*!
+   setter for parent folder id
  */
-void NmFolder::setParentFolderId(quint64 parentId)
+void NmApiFolder::setParentFolderId(quint64 parentId)
 {
     d->parentId = parentId;
 }
 
-/*
- * seter for childfolder ids
+/*!
+   seter for childfolder ids
  */
-void NmFolder::setChildFolderIds(QList<quint64> &childFolderIds)
+void NmApiFolder::setChildFolderIds(QList<quint64> &childFolderIds)
 {
     d->childFolderIds = childFolderIds;
 }
 
-/*
- * Returns count of child folder ids.
- * to be implemented later when nmail functionality is available
+/*!
+   Returns count of child folder ids.
+   to be implemented later when nmail functionality is available
  */
-void NmFolder::getChildFolderIds(QList<quint64> &childFolderIds)
+void NmApiFolder::getChildFolderIds(QList<quint64> &childFolderIds)
 {
     childFolderIds = d->childFolderIds;
 }
-;
+
 
-quint64 NmFolder::parentFolderId() const
+/*!
+   Returns id of parent folder.
+ */
+quint64 NmApiFolder::parentFolderId() const
 {
     return d->parentId;
 }
--- a/emailservices/nmclientapi/src/nmapifolderlisting.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapifolderlisting.cpp	Fri May 14 15:41:10 2010 +0300
@@ -15,32 +15,35 @@
  *
  */
 
+
+#include <nmapifolderlisting.h>
 #include "nmapifolderlisting_p.h"
-#include "nmapifolderlisting.h"
-#include <QtCore>
+
+#include <nmapimailbox.h>
+#include <nmapifolder.h>
 
 namespace EmailClientApi
 {
 
 /*!
- * \class Class for creating list of all folders
+   \class Class for creating list of all folders
  */
 
 /*!
- * Constructor of class. It set start values.
+   Constructor of class. It set start values.
  */
-NmFolderListing::NmFolderListing(QObject *parent, const quint64 &nmMailboxId) :
-    NmMessageTask(parent)
+NmApiFolderListing::NmApiFolderListing(QObject *parent, const quint64 &nmMailboxId) :
+    NmApiMessageTask(parent)
 {
-    mFolderListing = new NmFolderListingPrivate(this);
+    mFolderListing = new NmApiFolderListingPrivate(this);
     mFolderListing->mIsRunning = false;
     mFolderListing->mMailboxId = nmMailboxId;
 }
 
 /*!
- * Destructor of class. It release engine to be safe if manual releasing won't work.
+   Destructor of class. It release engine to be safe if manual releasing won't work.
  */
-NmFolderListing::~NmFolderListing()
+NmApiFolderListing::~NmApiFolderListing()
 {
     if (mFolderListing->mIsRunning) {
         mFolderListing->releaseEngine();
@@ -48,13 +51,13 @@
 }
 
 /*! 
- * \brief Returns results after foldersListed signal is received.
- * 
- *  Caller gets ownership of messages. Returns true if results were available.
- *  It clears list of folders after be called.
- *  It also at start clear inputlist of NmFolder.
+   \brief Returns results after foldersListed signal is received.
+   
+    Caller gets ownership of messages. Returns true if results were available.
+    It clears list of folders after be called.
+    It also at start clear inputlist of NmFolder.
  */
-bool NmFolderListing::getFolders(QList<EmailClientApi::NmFolder> &folders)
+bool NmApiFolderListing::getFolders(QList<EmailClientApi::NmApiFolder> &folders)
 {
     folders.clear();
     if (!mFolderListing->mIsRunning || mFolderListing->mFolders.isEmpty()) {
@@ -66,19 +69,19 @@
 }
 
 /*!
- * \brief Starts gathering folders list.
- * 
- * In first turn it will get whole folderlist. and then
- * it emits information signal \sa folderListed 
- * 
- * To asynchronous operation ce be used \sa QTimer::singleShot on this method.
- * Example:
- * <code> 
- * QTimer::singleShot(0,nmFolderListing,SLOT(start());
- * </code>
- * 
+   \brief Starts gathering folders list.
+   
+   In first turn it will get whole folderlist. and then
+   it emits information signal \sa folderListed 
+   
+   To asynchronous operation ce be used \sa QTimer::singleShot on this method.
+   Example:
+   <code> 
+   QTimer::singleShot(0,nmFolderListing,SLOT(start());
+   </code>
+   
  */
-bool NmFolderListing::start()
+bool NmApiFolderListing::start()
 {
     if (mFolderListing->mIsRunning) {
         return true;
@@ -100,13 +103,13 @@
 }
 
 /*!
- * \brief Stop gathering folder list.
- * 
- * In first it change state of listing.
- * Then it release engine.
- * On end it clears list of folders and emits \sa NmMessageTask::canceled() signal.
+   \brief Stop 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 NmFolderListing::cancel()
+void NmApiFolderListing::cancel()
 {
     if (!mFolderListing->mIsRunning) {
         return;
@@ -120,9 +123,9 @@
 }
 
 /*!
- * \brief Return info if listing is running
+   \brief Return info if listing is running
  */
-bool NmFolderListing::isRunning() const
+bool NmApiFolderListing::isRunning() const
 {
     return mFolderListing->mIsRunning;
 }
--- a/emailservices/nmclientapi/src/nmapifolderlisting_p.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapifolderlisting_p.cpp	Fri May 14 15:41:10 2010 +0300
@@ -17,59 +17,68 @@
 #include "nmapiengine.h"
 #include "nmapifolderlisting_p.h"
 
+#include <nmapifolder.h>
+
 namespace EmailClientApi
 {
-NmFolderListingPrivate::NmFolderListingPrivate(QObject* parent) :
+
+/*!
+   Constructor form NmApiFolderListingPrivate
+ */
+NmApiFolderListingPrivate::NmApiFolderListingPrivate(QObject *parent) :
     QObject(parent), mEngine(NULL)
 {
 
 }
 
-NmFolderListingPrivate::~NmFolderListingPrivate()
+/*!
+   Destructor for NmApiFolderListingPrivate 
+ */
+NmApiFolderListingPrivate::~NmApiFolderListingPrivate()
 {
     releaseEngine();
 }
 
 /*!
- * \brief It initialize engine for email operations. 
- * 
- * When use initializeEngine need to remember release it.
- * It return value if initialization go good.
- * \sa releaseEngine 
+   \brief It initialize engine for email operations. 
+   
+   When use initializeEngine need to remember release it.
+   It return value if initialization go good.
+   \sa releaseEngine 
  */
-bool NmFolderListingPrivate::initializeEngine()
+bool NmApiFolderListingPrivate::initializeEngine()
 {
     if (!mEngine) {
-        mEngine = NmEngine::instance();
+        mEngine = NmApiEngine::instance();
     }
 
     return mEngine ? true : false;
 }
 
 /*!
- * \brief It release engine for email operations.
- * 
- * It release Engine and return value if release go good.
- * 
- * \arg engine Is used to get info if engine was released, if yes, then argument have value 0.
- * 
- * \sa initializeEngine
+   \brief It release engine for email operations.
+   
+   \sa initializeEngine
  */
-void NmFolderListingPrivate::releaseEngine()
+void NmApiFolderListingPrivate::releaseEngine()
 {
-    NmEngine::releaseInstance(mEngine);
+    NmApiEngine::releaseInstance(mEngine);
 }
 
 /*!
- * \brief It grab folders from engine. 
- * 
- * When it start grabing, it release all old.
- * Because it uses NmFolder with sharedData we don't need care about release memory.
- * 
- * \return Count of folders
+   \brief It grab folders from engine. 
+   
+   When it start grabing, it release all old.
+   Because it uses NmFolder with sharedData we don't need care about release memory.
+   
+   \return Count of folders or "-1" if there is no engine initialised
  */
-qint32 NmFolderListingPrivate::grabFolders()
+qint32 NmApiFolderListingPrivate::grabFolders()
 {
+    if (!mEngine) {
+        return -1;
+    }
+    
     mFolders.clear();
     mEngine->listFolders(mMailboxId, mFolders);
     return mFolders.count();
--- a/emailservices/nmclientapi/src/nmapimailbox.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapimailbox.cpp	Fri May 14 15:41:10 2010 +0300
@@ -15,40 +15,43 @@
  *
  */
 
-#include "nmapimailbox.h"
+#include <nmapimailbox.h>
+#include "nmapimailbox_p.h"
+
+#include <QString>
 
 namespace EmailClientApi
 {
-NmMailboxPrivate::NmMailboxPrivate()
+
+/*!
+    constructor for NmApiMailbox 
+ */
+NmApiMailbox::NmApiMailbox()
 {
-
-}
-
-NmMailboxPrivate::~NmMailboxPrivate()
-{
-
+    d = new NmApiMailboxPrivate();
 }
 
-/*
- *  constructor for nmmailbox 
+/*!
+    Copy constructor for NmApiMailbox 
  */
-NmMailbox::NmMailbox()
+NmApiMailbox::NmApiMailbox(const NmApiMailbox &nmApiMailbox)
+: d(nmApiMailbox.d)
 {
-    d = new NmMailboxPrivate();
+    
 }
 
-/*
- * destructor for nmmailbox
+/*!
+   destructor for NmApiMailbox
  */
-NmMailbox::~NmMailbox()
+NmApiMailbox::~NmApiMailbox()
 {
 
 }
 
 /*!
- Assign data from \a mailbox
+   Assign data from \a mailbox
  */
-NmMailbox &NmMailbox::operator=(const NmMailbox &mailbox)
+NmApiMailbox &NmApiMailbox::operator=(const NmApiMailbox &mailbox)
 {
     if (this != &mailbox) {
         d = mailbox.d;
@@ -56,50 +59,62 @@
     return *this;
 }
 
-/*
- * getter for id
+/*!
+   Compare data from \a mailbox
  */
-quint64 NmMailbox::id() const
+bool NmApiMailbox::operator==(const NmApiMailbox &mailbox)
+{
+    bool returnValue = false;
+    if (d == mailbox.d) {
+        returnValue = true;
+    }
+    return returnValue;
+}
+
+/*!
+   getter for id
+ */
+quint64 NmApiMailbox::id() const
 {
     return d->id;
 }
 
-/*
- * getter for address
+/*!
+   getter for address
  */
-QString NmMailbox::address() const
+QString NmApiMailbox::address() const
 {
     return d->address;
 }
 
-/*
- * getter for name
+/*!
+   getter for name
  */
-QString NmMailbox::name() const
+QString NmApiMailbox::name() const
 {
     return d->name;
 }
 
-/*
- * setter for id
+/*!
+   setter for id
  */
-void NmMailbox::setId(quint64 id)
+void NmApiMailbox::setId(quint64 id)
 {
     d->id = id;
 }
 
-/*
- * setter for address
+/*!
+   setter for address
  */
-void NmMailbox::setAddress(const QString &address)
+void NmApiMailbox::setAddress(const QString &address)
 {
     d->address = address;
 }
 
-/* 
- * setter for name
+/*!
+   setter for name
  */
-void NmMailbox::setName(const QString &name)
+void NmApiMailbox::setName(const QString &name)
 {
     d->name = name;
 }
--- a/emailservices/nmclientapi/src/nmapimailboxlisting.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapimailboxlisting.cpp	Fri May 14 15:41:10 2010 +0300
@@ -14,65 +14,70 @@
  * Description:
  *
  */
+
+#include <nmapimailboxlisting.h>
+
+#include <QObject>
+
+#include <nmapimailbox.h>
 #include "nmapiengine.h"
 #include "nmapimailboxlisting_p.h"
-#include "nmapimailboxlisting.h"
+
 
 namespace EmailClientApi
 {
 
 /*!
- * \class Class for creating list of all mailboxes
+   \class Class for creating list of all mailboxes
  */
 
 /*!
- * Constructor of class. It set start values.
+   Constructor of class. It set start values.
  */
-NmMailboxListing::NmMailboxListing(QObject *parent) :
-    NmMessageTask(parent)
+NmApiMailboxListing::NmApiMailboxListing(QObject *parent) :
+    NmApiMessageTask(parent)
 {
-    mNmMailboxListingPrivate = new NmMailboxListingPrivate(this);
-    mNmMailboxListingPrivate->mIsRunning = false;
+    mNmApiMailboxListingPrivate = new NmApiMailboxListingPrivate(this);
+    mNmApiMailboxListingPrivate->mIsRunning = false;
 }
 
 /*!
- * Destructor of class. It release engine to be safe if manual releasing won't work.
+   Destructor of class. It release engine to be safe if manual releasing won't work.
  */
-NmMailboxListing::~NmMailboxListing()
+NmApiMailboxListing::~NmApiMailboxListing()
 {
-    if (mNmMailboxListingPrivate->mIsRunning) {
-        mNmMailboxListingPrivate->releaseEngine();
+    if (mNmApiMailboxListingPrivate->mIsRunning) {
+        mNmApiMailboxListingPrivate->releaseEngine();
     }
-    delete mNmMailboxListingPrivate;
 }
 
 /*! 
- * \brief Returns results after mailboxesListed signal is received.
- * 
- *  Caller gets ownership of messages. Returns true if results were available.
- *  It clears list of mailboxes (in private members) after be called.
- *  It also at start clear inputlist of NmMailbox.
- *  
- *  \return Return true if results were avaible
- *  \arg List of mailboxes to filled. On start is cleared. 
+   \brief Returns results after mailboxesListed signal is received.
+   
+    Caller gets ownership of messages. Returns true if results were available.
+    It clears list of mailboxes (in private members) after be called.
+    It also at start clear inputlist of NmApiMailbox.
+    
+    \return Return true if results were avaible
+    \param mailboxes List of mailboxes to filled. On start is cleared. 
  */
-bool NmMailboxListing::getMailboxes(QList<EmailClientApi::NmMailbox> &mailboxes)
+bool NmApiMailboxListing::getMailboxes(QList<EmailClientApi::NmApiMailbox> &mailboxes)
 {
     mailboxes.clear();
 
     bool result = false;
 
-    if (!mNmMailboxListingPrivate->mIsRunning) {
+    if (!mNmApiMailboxListingPrivate->mIsRunning) {
         result = false;
     }
     else
-        if (mNmMailboxListingPrivate->mMailboxes.isEmpty()) {
+        if (mNmApiMailboxListingPrivate->mMailboxes.isEmpty()) {
             result = false;
         }
         else {
-            mailboxes = mNmMailboxListingPrivate->mMailboxes;
+            mailboxes = mNmApiMailboxListingPrivate->mMailboxes;
 
-            mNmMailboxListingPrivate->mMailboxes.clear();
+            mNmApiMailboxListingPrivate->mMailboxes.clear();
 
             result = true;
         }
@@ -80,36 +85,36 @@
 }
 
 /*!
- * \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.
- * 
+   \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 NmMailboxListing::start()
+bool NmApiMailboxListing::start()
 {
     bool result = false;
-    if (mNmMailboxListingPrivate->mIsRunning) {
+    if (mNmApiMailboxListingPrivate->mIsRunning) {
         result = true;
     }
     else
-        if (!mNmMailboxListingPrivate->initializeEngine()) {
+        if (!mNmApiMailboxListingPrivate->initializeEngine()) {
             QMetaObject::invokeMethod(this, "mailboxesListed", Qt::QueuedConnection, Q_ARG(qint32,
                 (qint32) MailboxListingFailed));
             result = false;
         }
         else {
-            quint64 mailboxCount = mNmMailboxListingPrivate->grabMailboxes();
+            qint32 mailboxCount = mNmApiMailboxListingPrivate->grabMailboxes();
 
-            mNmMailboxListingPrivate->mIsRunning = true;
+            mNmApiMailboxListingPrivate->mIsRunning = true;
 
             QMetaObject::invokeMethod(this, "mailboxesListed", Qt::QueuedConnection, Q_ARG(qint32,
                 mailboxCount));
@@ -120,32 +125,32 @@
 }
 
 /*!
- * \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 NmMessageTask::canceled() signal.
+   \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 NmMailboxListing::cancel()
+void NmApiMailboxListing::cancel()
 {
-    if (mNmMailboxListingPrivate->mIsRunning) {
+    if (mNmApiMailboxListingPrivate->mIsRunning) {
 
-        mNmMailboxListingPrivate->mIsRunning = false;
-        mNmMailboxListingPrivate->releaseEngine();
-        mNmMailboxListingPrivate->mMailboxes.clear();
+        mNmApiMailboxListingPrivate->mIsRunning = false;
+        mNmApiMailboxListingPrivate->releaseEngine();
+        mNmApiMailboxListingPrivate->mMailboxes.clear();
 
         QMetaObject::invokeMethod(this, "canceled", Qt::QueuedConnection);
     }
 }
 
 /*!
- * \brief Return info if listing is running
- * 
- * \return Return true if listing is running
+   \brief Return info if listing is running
+   
+   \return Return true if listing is running
  */
-bool NmMailboxListing::isRunning() const
+bool NmApiMailboxListing::isRunning() const
 {
-    return mNmMailboxListingPrivate->mIsRunning;
+    return mNmApiMailboxListingPrivate->mIsRunning;
 }
 
 }
--- a/emailservices/nmclientapi/src/nmapimailboxlisting_p.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapimailboxlisting_p.cpp	Fri May 14 15:41:10 2010 +0300
@@ -17,63 +17,65 @@
 #include "nmapiengine.h"
 #include "nmapimailboxlisting_p.h"
 
+#include <nmapimailbox.h>
+
 namespace EmailClientApi
 {
-NmMailboxListingPrivate::NmMailboxListingPrivate(QObject* parent) :
-    QObject(parent), mNmEngine(NULL)
+NmApiMailboxListingPrivate::NmApiMailboxListingPrivate(QObject *parent) :
+    QObject(parent), mNmApiEngine(NULL)
 {
 
 }
 
-NmMailboxListingPrivate::~NmMailboxListingPrivate()
+NmApiMailboxListingPrivate::~NmApiMailboxListingPrivate()
 {
 
 }
 
 /*!
- * \brief It initialize engine for email operations. 
- * 
- * When use initializeEngine need to remember release it.
- * It return value if initialization go good.
- * \sa releaseEngine 
- * \return Return true if engine is good initilialized.
+   \brief It initialize engine for email operations. 
+   
+   When use initializeEngine need to remember release it.
+   It return value if initialization go good.
+   \sa releaseEngine 
+   \return Return true if engine is good initilialized.
  */
-bool NmMailboxListingPrivate::initializeEngine()
+bool NmApiMailboxListingPrivate::initializeEngine()
 {
-    if (!mNmEngine) {
-        mNmEngine = NmEngine::instance();
+    if (!mNmApiEngine) {
+        mNmApiEngine = NmApiEngine::instance();
     }
 
-    return mNmEngine ? true : false;
+    return mNmApiEngine ? true : false;
 }
 
 /*!
- * \brief It release engine for email operations.
- * 
- * It release Engine and return value if release go good.
- * 
- * \arg engine Is used to get info if engine was released, if yes, then argument have value 0.
- * 
- * \sa initializeEngine
+   \brief It release engine for email operations.
+   
+   \sa initializeEngine
  */
-void NmMailboxListingPrivate::releaseEngine()
+void NmApiMailboxListingPrivate::releaseEngine()
 {
-    NmEngine::releaseInstance(mNmEngine);
+    NmApiEngine::releaseInstance(mNmApiEngine);
 }
 
 /*!
- * \brief It grab mailboxes from engine. 
- * 
- * When it start grabing, it release all old.
- * Because it uses NmMailbox with sharedData we don't need care about release memory.
- * 
- * \return Count of mailboxes
+   \brief It grab mailboxes from engine. 
+   
+   When it start grabing, it release all old.
+   Because it uses NmApiMailbox with sharedData we don't need care about release memory.
+   
+   \return Count of mailboxes or "-1" if there is no engine
  */
-qint32 NmMailboxListingPrivate::grabMailboxes()
+qint32 NmApiMailboxListingPrivate::grabMailboxes()
 {
+    if (!mNmApiEngine) {
+        return -1;
+    }
+    
     mMailboxes.clear();
 
-    mNmEngine->listMailboxes(mMailboxes);
+    mNmApiEngine->listMailboxes(mMailboxes);
     return mMailboxes.count();
 }
 }
--- a/emailservices/nmclientapi/src/nmapimessagebody.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapimessagebody.cpp	Fri May 14 15:41:10 2010 +0300
@@ -15,76 +15,104 @@
  *
  */
 
-#include "nmapimessagebody.h"
+#include <nmapimessagebody.h>
+#include "nmapimessagebody_p.h"
 
 namespace EmailClientApi
 {
-NmMessageBodyPrivate::NmMessageBodyPrivate()
+
+/*!
+   constructor for NmApiMessageBody
+ */
+NmApiMessageBody::NmApiMessageBody()
 {
-
+    d = new NmApiMessageBodyPrivate();
 }
 
-NmMessageBodyPrivate::~NmMessageBodyPrivate()
+/*!
+   copying constructor for NmApiMessageBody
+ */
+NmApiMessageBody::NmApiMessageBody(const NmApiMessageBody &apiMessageBody) : d(apiMessageBody.d)
 {
 
 }
 
-/*
- * constructor for nmmessagebody
+/*!
+   assignment operator for nmapimessagebody
  */
-NmMessageBody::NmMessageBody()
+NmApiMessageBody& NmApiMessageBody::operator=(const NmApiMessageBody &apiMessageBody)
 {
-    d = new NmMessageBodyPrivate();
+	if (this != &apiMessageBody) 
+	{
+		d = apiMessageBody.d;
+	}
+	return *this;
 }
 
-NmMessageBody::~NmMessageBody()
+/*!
+   Compare data from \a apiMessageBody
+ */    
+bool NmApiMessageBody::operator==(const NmApiMessageBody &apiMessageBody)
+{
+    bool retVal = false;
+    if (this->d == apiMessageBody.d)
+    {
+        retVal = true;
+    }
+    return retVal;
+}
+
+/*!
+   Destructor for NmApiMessageBody
+ */
+NmApiMessageBody::~NmApiMessageBody()
 {
 
 }
 /*!
- * getter for total size of message body in bytes
+   getter for total size of message body in bytes
  */
-quint64 NmMessageBody::totalSize() const
+quint64 NmApiMessageBody::totalSize() const
 {
     return d->totalSize;
 }
 
 /*!
- * getter for bytes available in local mailbox store
+   getter for bytes available in local mailbox store
  */
-quint64 NmMessageBody::fetchedSize() const
+quint64 NmApiMessageBody::fetchedSize() const
 {
     return d->fetchedSize;
 }
 
 /*!
- * getter for fetched content
+   getter for fetched content
  */
-QString NmMessageBody::content() const
+QString NmApiMessageBody::content() const
 {
     return d->content;
 }
 
-/*
- * setter for total size of message body in bytes
+/*!
+   setter for total size of message body in bytes
  */
-void NmMessageBody::setTotalSize(quint64 size)
+void NmApiMessageBody::setTotalSize(quint64 size)
 {
     d->totalSize = size;
 }
 
-/*
- * setter for bytes available on local mailbox store
+/*!
+   setter for bytes available on local mailbox store
  */
-void NmMessageBody::setFetchedSize(quint64 size)
+void NmApiMessageBody::setFetchedSize(quint64 size)
 {
     d->fetchedSize = size;
 }
 
-/*
- * setter for content
+/*!
+   setter for content
  */
-void NmMessageBody::setContent(const QString& content)
+void NmApiMessageBody::setContent(const QString& content)
 {
     d->content = content;
 }
--- a/emailservices/nmclientapi/src/nmapimessageenvelope.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapimessageenvelope.cpp	Fri May 14 15:41:10 2010 +0300
@@ -15,40 +15,46 @@
  *
  */
 
-#include "nmapimessageenvelope.h"
+#include <QString>
+#include <QDateTime>
+
+#include <nmapimessageenvelope.h>
+#include "nmapimessageenvelope_p.h"
+
+#include <nmapiemailaddress.h>
+#include <nmapimessagebody.h>
 
 namespace EmailClientApi
 {
-NmMessageEnvelopePrivate::NmMessageEnvelopePrivate()
-{
-
-}
-
-NmMessageEnvelopePrivate::~NmMessageEnvelopePrivate()
-{
-
-}
-
-/*
- * constructor for nmmessageenvelope
+/*!
+   copying constructor for nmmessageenvelope
  */
-NmMessageEnvelope::NmMessageEnvelope()
-{
-    d = new NmMessageEnvelopePrivate();
-}
-
-/*
- * destructor for nmmessageenvelope
- */
-NmMessageEnvelope::~NmMessageEnvelope()
+NmApiMessageEnvelope::NmApiMessageEnvelope(const NmApiMessageEnvelope &envelope) :
+    d(envelope.d)
 {
 
 }
 
 /*!
- Assignment operator
+   constructor for nmmessageenvelope
+ */
+NmApiMessageEnvelope::NmApiMessageEnvelope()
+{
+    d = new NmApiMessageEnvelopePrivate();
+}
+
+/*!
+   destructor for nmmessageenvelope
  */
-NmMessageEnvelope &NmMessageEnvelope::operator=(const NmMessageEnvelope &envelope)
+NmApiMessageEnvelope::~NmApiMessageEnvelope()
+{
+
+}
+
+/*!
+   Assignment operator
+ */
+NmApiMessageEnvelope &NmApiMessageEnvelope::operator=(const NmApiMessageEnvelope &envelope)
 {
     if (this != &envelope) {
         d = envelope.d;
@@ -56,255 +62,268 @@
     return *this;
 }
 
-/*
- * getter for id
+/*!
+   Compare data from \a envelope
  */
-quint64 NmMessageEnvelope::id() const
+bool NmApiMessageEnvelope::operator==(const NmApiMessageEnvelope &envelope)
+{
+    bool retVal = false;
+    if (this->d == envelope.d) {
+        retVal = true;
+    }
+    return retVal;
+}
+
+/*!
+   getter for id
+ */
+quint64 NmApiMessageEnvelope::id() const
 {
     return d->id;
 }
 
-/*
- * getter for id of parent folder
+/*!
+   getter for id of parent folder
  */
-quint64 NmMessageEnvelope::parentFolder() const
+quint64 NmApiMessageEnvelope::parentFolder() const
 {
     return d->parentFolder;
 }
 
-/*
- * getter for subject
+/*!
+   getter for subject
  */
-QString NmMessageEnvelope::subject() const
+QString NmApiMessageEnvelope::subject() const
 {
     return d->subject;
 }
 
-/*
- * getter for sender
+/*!
+   getter for sender
  */
-QString NmMessageEnvelope::sender() const
+QString NmApiMessageEnvelope::sender() const
 {
     return d->sender;
 }
 
-/*
- * getter for to recipients
+/*!
+   getter for to recipients
  */
-void NmMessageEnvelope::getToRecipients(QList<EmailClientApi::NmEmailAddress> &toRecipients)
+void NmApiMessageEnvelope::getToRecipients(QList<EmailClientApi::NmApiEmailAddress> &toRecipients)
 {
     toRecipients = d->toRecipients;
 }
 
-/*
- * getter for cc recipients
+/*!
+   getter for cc recipients
  */
-void NmMessageEnvelope::getCcRecipients(QList<EmailClientApi::NmEmailAddress> &ccRecipients)
+void NmApiMessageEnvelope::getCcRecipients(QList<EmailClientApi::NmApiEmailAddress> &ccRecipients)
 {
     ccRecipients = d->ccRecipients;
 }
 
-/*
- * getter for sent time
+/*!
+   getter for sent time
  */
-QDateTime NmMessageEnvelope::sentTime() const
+QDateTime NmApiMessageEnvelope::sentTime() const
 {
     return d->sentTime;
 }
 
-/*
- * getter for is read flag
+/*!
+   getter for is read flag
  */
-bool NmMessageEnvelope::isRead() const
+bool NmApiMessageEnvelope::isRead() const
 {
     return d->read;
 }
 
-/*
- * getter for has attachments flag
+/*!
+   getter for has attachments flag
  */
-bool NmMessageEnvelope::hasAttachments() const
+bool NmApiMessageEnvelope::hasAttachments() const
 {
     return d->attachments;
 }
 
-/*
- * getter for is forwarded flag
+/*!
+   getter for is forwarded flag
  */
-bool NmMessageEnvelope::isForwarded() const
+bool NmApiMessageEnvelope::isForwarded() const
 {
     return d->forwarded;
 }
 
-/*
- * getter for is replied flag
+/*!
+   getter for is replied flag
  */
-bool NmMessageEnvelope::isReplied() const
+bool NmApiMessageEnvelope::isReplied() const
 {
     return d->replied;
 }
 
-/*
- * getter for content type
+/*!
+   getter for content type
  */
-QString NmMessageEnvelope::contentType() const
+QString NmApiMessageEnvelope::contentType() const
 {
     return d->contentType;
 }
 
-/*
- * getter for plaintext body
+/*!
+   getter for plaintext body
  */
-void NmMessageEnvelope::getPlainTextBody(EmailClientApi::NmMessageBody &body)
+void NmApiMessageEnvelope::getPlainTextBody(EmailClientApi::NmApiMessageBody &body)
 {
     body.setContent(d->plainText);
     body.setFetchedSize(d->fetchedSize);
     body.setTotalSize(d->totalSize);
 }
 
-/*
- * setter for id 
+/*!
+   setter for id 
  */
-void NmMessageEnvelope::setId(quint64 id)
+void NmApiMessageEnvelope::setId(quint64 id)
 {
     d->id = id;
 }
 
-/*
- * setter for parent folder 
+/*!
+   setter for parent folder 
  */
-void NmMessageEnvelope::setParentFolder(quint64 parentFolder)
+void NmApiMessageEnvelope::setParentFolder(quint64 parentFolder)
 {
     d->parentFolder = parentFolder;
 }
 
-/*
- * setter for subject 
+/*!
+   setter for subject 
  */
-void NmMessageEnvelope::setSubject(const QString& subject)
+void NmApiMessageEnvelope::setSubject(const QString &subject)
 {
     d->subject = subject;
 }
 
-/*
- * setter for sender  
+/*!
+   setter for sender  
  */
-void NmMessageEnvelope::setSender(const QString& sender)
+void NmApiMessageEnvelope::setSender(const QString &sender)
 {
     d->sender = sender;
 }
 
-/*
- * setter for to recipients 
+/*!
+   setter for to recipients 
  */
-void NmMessageEnvelope::setToRecipients(
-    const QList<EmailClientApi::NmEmailAddress>& toRecipients)
+void NmApiMessageEnvelope::setToRecipients(
+    const QList<EmailClientApi::NmApiEmailAddress> &toRecipients)
 {
     d->toRecipients = toRecipients;
 }
 
-/*
- * setter for cc recipients 
+/*!
+   setter for cc recipients 
  */
-void NmMessageEnvelope::setCcRecipients(
-    const QList<EmailClientApi::NmEmailAddress> &ccRecipients)
+void NmApiMessageEnvelope::setCcRecipients(
+    const QList<EmailClientApi::NmApiEmailAddress> &ccRecipients)
 {
     d->ccRecipients = ccRecipients;
 }
 
-/*
- * setter for sent time 
+/*!
+   setter for sent time 
  */
-void NmMessageEnvelope::setSentTime(QDateTime sentTime)
+void NmApiMessageEnvelope::setSentTime(QDateTime sentTime)
 {
     d->sentTime = sentTime;
 }
 
-/*
- * setter for si read flag
+/*!
+   setter for is read flag
  */
-void NmMessageEnvelope::setIsRead(bool isRead)
+void NmApiMessageEnvelope::setIsRead(bool isRead)
 {
     d->read = isRead;
 }
 
-/*
- * setter for has attachments flag 
+/*!
+   setter for has attachments flag 
  */
-void NmMessageEnvelope::setHasAttachments(bool hasAttachments)
+void NmApiMessageEnvelope::setHasAttachments(bool hasAttachments)
 {
     d->attachments = hasAttachments;
 }
 
-/*
- * setter for is forwarded flag 
+/*!
+   setter for is forwarded flag 
  */
-void NmMessageEnvelope::setIsForwarded(bool isForwarded)
+void NmApiMessageEnvelope::setIsForwarded(bool isForwarded)
 {
     d->forwarded = isForwarded;
 }
 
-/*
- * setter for is replied flag 
+/*!
+   setter for is replied flag 
  */
-void NmMessageEnvelope::setIsReplied(bool isReplied)
+void NmApiMessageEnvelope::setIsReplied(bool isReplied)
 {
     d->replied = isReplied;
 }
 
-/*
- * setter for content type 
+/*!
+   setter for content type 
  */
-void NmMessageEnvelope::setContentType(const QString &contentType)
+void NmApiMessageEnvelope::setContentType(const QString &contentType)
 {
     d->contentType = contentType;
 }
 
-/*
- * setter for messages plain text 
+/*!
+   setter for messages plain text 
  */
-void NmMessageEnvelope::setPlainText(const QString& plainText)
+void NmApiMessageEnvelope::setPlainText(const QString &plainText)
 {
     d->plainText = plainText;
 }
 
-/*
- * setter for messages total size 
+/*!
+   setter for messages total size 
  */
-void NmMessageEnvelope::setTotalSize(quint64 totalSize)
+void NmApiMessageEnvelope::setTotalSize(quint64 totalSize)
 {
     d->totalSize = totalSize;
 }
 
-/*
- * setter for messages fetched size 
+/*!
+   setter for messages fetched size 
  */
-void NmMessageEnvelope::setFetchedSize(quint64 fetchedSize)
+void NmApiMessageEnvelope::setFetchedSize(quint64 fetchedSize)
 {
     d->fetchedSize = fetchedSize;
 }
 
-/*
- * getter for messages plain text 
+/*!
+   getter for messages plain text 
  */
-QString NmMessageEnvelope::plainText() const
+QString NmApiMessageEnvelope::plainText() const
 {
     return d->plainText;
 }
 
-/*
- * getter for messages fetched size 
+/*!
+   getter for messages fetched size 
  */
-quint64 NmMessageEnvelope::totalSize() const
+quint64 NmApiMessageEnvelope::totalSize() const
 {
     return d->totalSize;
 }
 
-/*
- * getter for messages fetched size 
+/*!
+   getter for messages fetched size 
  */
-quint64 NmMessageEnvelope::fetchedSize() const
+quint64 NmApiMessageEnvelope::fetchedSize() const
 {
     return d->fetchedSize;
 }
 }
+
--- a/emailservices/nmclientapi/src/nmapimessagetask.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapimessagetask.cpp	Fri May 14 15:41:10 2010 +0300
@@ -15,14 +15,21 @@
  *
  */
 
-#include "nmapimessagetask.h"
+#include <nmapimessagetask.h>
 
-NmMessageTask::NmMessageTask(QObject *parent)
+/*!
+   Constructor for NmApiMessageTask
+ */
+NmApiMessageTask::NmApiMessageTask(QObject *parent)
+: QObject(parent)
 {
-    Q_UNUSED(parent);
 }
 
-NmMessageTask::~NmMessageTask()
+/*!
+   Destructor for NmApiMessageTask
+ */
+NmApiMessageTask::~NmApiMessageTask()
 {
 
 }
+
--- a/emailservices/nmclientapi/src/nmapitypesconverter.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapitypesconverter.cpp	Fri May 14 15:41:10 2010 +0300
@@ -17,12 +17,16 @@
 
 #include "nmapitypesconverter.h"
 
-/*
- * converts nmmailbox to client api nmmailbox
+#include <nmapicommonheader.h>
+
+#include <nmapiprivateheaders.h>
+
+/*!
+   converts nmmailbox to client api NmApiMailbox
  */
-EmailClientApi::NmMailbox NmToApiConverter::NmMailbox2ApiNmMailbox(const NmMailbox &mailbox)
+EmailClientApi::NmApiMailbox NmToApiConverter::NmMailbox2NmApiMailbox(const NmMailbox &mailbox)
 {
-    EmailClientApi::NmMailbox api_mailbox;
+    EmailClientApi::NmApiMailbox api_mailbox;
     api_mailbox.setId(mailbox.id().id());
     api_mailbox.setName(mailbox.name());
     NmMailbox tmp(mailbox);
@@ -30,44 +34,42 @@
     return api_mailbox;
 }
 
-/*
- * converts NmFolder to client api NmFolder
+/*!
+   converts NmFolder to client api NmFolder
  */
-EmailClientApi::NmFolder NmToApiConverter::NmFolder2ApiNmFolder(const NmFolder &folder)
+EmailClientApi::NmApiFolder NmToApiConverter::NmFolder2NmApiFolder(const NmFolder &folder)
 {
-    EmailClientApi::NmFolder api_folder;
+    EmailClientApi::NmApiFolder api_folder;
 
     api_folder.setParentFolderId(folder.parentId().id());
     api_folder.setId(folder.folderId().id());
     api_folder.setName(folder.name());
-    api_folder.setFolderType((EmailClientApi::EmailFolderType) folder.folderType());
+    api_folder.setFolderType((EmailClientApi::NmApiEmailFolderType) folder.folderType());
     return api_folder;
 }
 
-/*
- * converts NmMessageEnvelope to client api NmMessageEnvelope
+/*!
+   converts NmMessageEnvelope to client api NmApiMessageEnvelope
  */
-EmailClientApi::NmMessageEnvelope NmToApiConverter::NmMessageEnvelope2ApiEnvelope(
+EmailClientApi::NmApiMessageEnvelope NmToApiConverter::NmMessageEnvelope2NmApiMessageEnvelope(
     const NmMessageEnvelope &envelope)
 {
-    EmailClientApi::NmMessageEnvelope api_env;
-
-    NmMessageEnvelope tmp(envelope);
+    EmailClientApi::NmApiMessageEnvelope api_env;
     
-    QList<NmAddress> to = tmp.toRecipients();
-    QList<NmAddress> cc = tmp.ccRecipients();
-    QList<EmailClientApi::NmEmailAddress> to_api = NmAddress2QString(to);
-    QList<EmailClientApi::NmEmailAddress> cc_api = NmAddress2QString(cc);
+    QList<NmAddress> to = envelope.toRecipients();
+    QList<NmAddress> cc = envelope.ccRecipients();
+    QList<EmailClientApi::NmApiEmailAddress> to_api = NmAddress2QString(to);
+    QList<EmailClientApi::NmApiEmailAddress> cc_api = NmAddress2QString(cc);
 
     api_env.setToRecipients(to_api);
     api_env.setCcRecipients(cc_api);
 
     api_env.setHasAttachments(envelope.hasAttachments());
-    api_env.setId(envelope.id().id());
+    api_env.setId(envelope.messageId().id());
     api_env.setIsForwarded(envelope.isForwarded());
     api_env.setIsRead(envelope.isRead());
     api_env.setIsReplied(envelope.isReplied());
-    api_env.setParentFolder(tmp.parentId().id());
+    api_env.setParentFolder(envelope.folderId().id());
 
     api_env.setSender(envelope.sender().address());
     api_env.setSentTime(envelope.sentTime());
@@ -76,15 +78,15 @@
     return api_env;
 }
 
-/*
- * converts QList of NmAddresses to Qlist of email client apis NmEmailAddresses
+/*!
+   converts QList of NmAddresses to Qlist of email client apis NmApiEmailAddresses
  */
-QList<EmailClientApi::NmEmailAddress> NmToApiConverter::NmAddress2QString(
+QList<EmailClientApi::NmApiEmailAddress> NmToApiConverter::NmAddress2QString(
     const QList<NmAddress> &addresses)
 {
-    QList<EmailClientApi::NmEmailAddress> nmAddresses;
+    QList<EmailClientApi::NmApiEmailAddress> nmAddresses;
     for (int i = 0; i < addresses.count(); i++) {
-        EmailClientApi::NmEmailAddress addr;
+        EmailClientApi::NmApiEmailAddress addr;
         addr.setAddress(addresses[i].address());
         addr.setDisplayName(addresses[i].displayName());
 
--- a/emailservices/nmregister/inc/nmmailboxregisterinterface.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmregister/inc/nmmailboxregisterinterface.h	Fri May 14 15:41:10 2010 +0300
@@ -39,7 +39,7 @@
     \fn bool registerNewMailbox(quint64 accountId, QString accountName, QString accountIconName)
     \param accountId The ID of the mailbox to register
     \param accountName The name of the mailbox to register
-    \param accountIconName The icon of the mailbox to register 
+    \param accountIconName The icon name of the mailbox to register 
     \return true if mailbox registration succeed. false if failed.
 
     This method registers mailbox to application library and to homescreen as an email widget.
@@ -51,15 +51,11 @@
     QList<QServiceInterfaceDescriptor> interfaces = manager.findInterfaces(filter);  
     QObject *widgetObject = manager.loadInterface(interfaces.first());
     
-    const QMetaObject *object = widgetObject->metaObject();       
-    QMetaMethod registerNewMailboxMethod;
-    int index = object->indexOfMethod(
-        QMetaObject::normalizedSignature("registerNewMailbox(quint64, QString, QString)"));
-    registerNewMailboxMethod = object->method(index);   
-    registerNewMailboxMethod.invoke(widgetObject,
+    QMetaObject::invokeMethod(widgetObject,
+            "registerNewMailbox",
             Q_ARG(quint64, accountId),
             Q_ARG(QString, accountName),
-            Q_ARG(QString, accountIconName));
+            Q_ARG(QString, "qtg_large_email"));
      */
     bool registerNewMailbox(quint64 accountId, QString accountName, QString accountIconName);
     
@@ -77,13 +73,9 @@
     QServiceFilter filter("com.nokia.symbian.IEmailRegisterAccount");
     QList<QServiceInterfaceDescriptor> interfaces = manager.findInterfaces(filter);  
     QObject *widgetObject = manager.loadInterface(interfaces.first());
-    
-    const QMetaObject *object = widgetObject->metaObject();       
-    QMetaMethod updateMailboxNameMethod;
-    int index = object->indexOfMethod(
-        QMetaObject::normalizedSignature("updateMailboxName(quint64, QString)"));
-    updateMailboxNameMethod = object->method(index);   
-    updateMailboxNameMethod.invoke(widgetObject,
+     
+    QMetaObject::invoke(widgetObject,
+            "updateMailboxName",
             Q_ARG(quint64, accountId),
             Q_ARG(QString, accountName));
      */
@@ -103,12 +95,8 @@
     QList<QServiceInterfaceDescriptor> interfaces = manager.findInterfaces(filter);  
     QObject *widgetObject = manager.loadInterface(interfaces.first());
 
-    const QMetaObject *object = widgetObject->metaObject();       
-    QMetaMethod unregisterMailboxMethod;
-    int index = object->indexOfMethod(
-        QMetaObject::normalizedSignature("unregisterMailbox(quint64)"));
-    unregisterMailboxMethod = object->method(index);   
-    unregisterMailboxMethod.invoke(widgetObject,
+    QMetaObject::invoke(widgetObject,
+            "unregisterMailbox",
             Q_ARG(quint64, accountId));
      */
     bool unregisterMailbox (quint64 accountId);
--- a/emailservices/nmregister/inc/nmmailboxregisterinterface_p.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmregister/inc/nmmailboxregisterinterface_p.h	Fri May 14 15:41:10 2010 +0300
@@ -32,6 +32,7 @@
 
 //  FORWARD DECLARATIONS
 class QString;
+class QTranslator;
 
 QTM_BEGIN_NAMESPACE
 class QServiceManager;
@@ -64,11 +65,14 @@
 
 private:
    
-    bool pushWidgetToHomescreen(quint64 a);
+    bool pushWidgetToHomescreen(quint64 a, QString accountIconName);
+    
+    QString formLaunchUri(quint64 accountId) const;
 
 private: 
     QServiceManager* mManager;
     QObject* mService;
+    QTranslator *mTranslator;
 };
 
 #endif /* NMMAILBOXREGISTERINTERFACE_H_ */
--- a/emailservices/nmregister/nmregister.pro	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmregister/nmregister.pro	Fri May 14 15:41:10 2010 +0300
@@ -22,8 +22,10 @@
 TARGET = nmregister
 QT += core
 #RESOURCES += nmregister.qrc
-LIBS += -lxqservice
-
+LIBS += -lxqservice \
+        -lnmailuiengine \
+        -leuser \
+        -llibc
 symbian: {
 TARGET.UID3=0x2002DD16
 TARGET.VID = VID_DEFAULT
@@ -39,6 +41,7 @@
 
 BLD_INF_RULES.prj_exports += "resource/nmregister.xml 			z:/private/2002DD16/nmregister.xml"
 BLD_INF_RULES.prj_exports += "rom/nmregister.iby		CORE_APP_LAYER_IBY_EXPORT_PATH(nmregister.iby)"
+BLD_INF_RULES.prj_exports += "rom/nmregisterlanguage.iby 		LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(nmregisterlanguage.iby)"
 TARGET.EPOCALLOWDLLDATA = 1
 }
 
@@ -51,9 +54,8 @@
 					 inc/nmmailboxregisterinterface_p.h \
 					 inc/nmmailboxregisterinterfaceplugin.h
 
-LIBS += -leuser
-LIBS += -llibc
-
-INCLUDEPATH += 
+INCLUDEPATH += ../../inc
 
 DEPENDPATH += .
+#commented out until MCL has nmregister files in place here: epoc32/include/platform/qt/translations/
+#TRANSLATIONS = nmregister.ts
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmregister/rom/nmregisterlanguage.iby	Fri May 14 15:41:10 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 __NMREGISTERLANGUAGE_IBY__
+#define __NMREGISTERLANGUAGE_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+data=DATAZ_\QT_TRANSLATIONS_DIR\nmregister.qm  QT_TRANSLATIONS_DIR\nmregister.qm
+
+#endif
\ No newline at end of file
--- a/emailservices/nmregister/src/nmmailboxregisterinterface.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailservices/nmregister/src/nmmailboxregisterinterface.cpp	Fri May 14 15:41:10 2010 +0300
@@ -17,6 +17,10 @@
 
 #include <qservicemanager.h>
 #include <qserviceinterfacedescriptor.h>
+#include <HbIcon>
+#include <HbApplication>
+#include <QTranslator>
+#include "nmicons.h"
 #include "nmmailboxregisterinterface.h" 
 #include "nmmailboxregisterinterface_p.h" 
 
@@ -33,21 +37,28 @@
 const QString hsIconApplicationId ("icon:applicationid"); // icon from associated application 
 
 //Custom for nmHsWidgets
-//NmHsWidgetParam is used to identify what email account will be monitored by 
+//NmHsWidgetParamAccountId is used to identify what email account will be monitored by 
 //the registered hs widget
-const QString NmHsWidgetParam     ("widgetparam:accountId");
+const QString NmHsWidgetParamAccountId     ("widgetparam:accountId");
 //same as above but for pushing the widget to homescreen
 const QString NmHsAccountId       ("accountId");
+//NmHsWidgetParamAccountIconName is used to identify mailbox icon in application library
+const QString NmHsWidgetParamAccountIconName     ("widgetparam:accountIconName");
+//same as above but for pushing the widget to homescreen
+const QString NmHsAccountIconName  ("accountIconName");
 //This is used to identify nmhswidget in homescreen
 const QString NmHsWidget          ("nmhswidget");
 
 //parameter values
 const QString NmPublisherName     ("NmMailboxRegisterInterface");
-const QString NmLaunchUri         ("application://0x2002DD17");
+const QString NmLaunchUri         ("appto://0x200255BA?activityname=EmailInboxView&accountId=");
 //URI for the defined service
 const QLatin1String interfaceUri("com.nokia.symbian.IEmailRegisterAccount");
 
-
+/** Localization file name*/
+const QString KNmRegisterLocFileName = "nmregister_";
+/** Localization file location*/
+const QString KNmRegisterLocLocation = "z:/resource/qt/translations/";
 
 /*!
     Constructor
@@ -102,8 +113,16 @@
 NmMailboxRegisterInterfacePrivate::NmMailboxRegisterInterfacePrivate(QObject *parent) :
     XQServiceProvider(interfaceUri, parent ), 
     mManager(0),
-    mService(0)
+    mService(0),
+    mTranslator(0)
     {
+    //commented out until MCL has nmregister files in place here: epoc32/include/platform/qt/translations/
+    /*mTranslator = new QTranslator();
+    QString lang = QLocale::system().name();
+    bool loadSucceed = mTranslator->load(KNmRegisterLocFileName + lang, KNmRegisterLocLocation);
+    qDebug() << "NmMailboxRegisterInterfacePrivate mTranslator->load loadSucceed:"<<loadSucceed;
+    QCoreApplication::installTranslator(mTranslator);*/
+    
     mManager = new QServiceManager();
     QServiceFilter filter("com.nokia.symbian.IMenuClient");
     QList<QServiceInterfaceDescriptor> interfaces = mManager->findInterfaces(filter);
@@ -115,6 +134,10 @@
 */
 NmMailboxRegisterInterfacePrivate::~NmMailboxRegisterInterfacePrivate()
     {
+    if(mTranslator){
+        delete mTranslator;
+        mTranslator = NULL;
+    }
     if (mService) 
         {
         delete mService;
@@ -129,16 +152,26 @@
 bool NmMailboxRegisterInterfacePrivate::registerNewMailbox(quint64 accountId,
         QString accountName, QString accountIconName)
     {
+    //check that accountIconName is valid otherwise pass default mailbox icon
+    HbIcon mailBoxIcon(accountIconName);
+    if(mailBoxIcon.pixmap().height() == 0){
+        mailBoxIcon = NmIcons::getIcon(NmIcons::NmIconDefaultMailbox);
+        accountIconName = mailBoxIcon.iconName();
+    }
+    
     QMap<QString, QVariant> map;
     //------------------------------
     map[hsItemName]        = accountName;
-    map[hsitemLaunchUri]   = NmLaunchUri;
+    map[hsitemLaunchUri]   = formLaunchUri(accountId);
     map[hsitemPublisherId] = NmPublisherName;
     map[hsItemWidgetUri]   = NmHsWidget;
-    map[hsItemDescription] = "test description for widget"; //TODO: Localization
+    //commented out until MCL has nmregister files in place here: epoc32/include/platform/qt/translations/
+    //map[hsItemDescription] = hbTrId("txt_mail_widget_dblist_preview_of_recent_mail");
+    map[hsItemDescription] = "test description for widget";
     map[hsIconFileName]    = accountIconName;
     // to add widget params that are mapped to widgets properties
-    map[NmHsWidgetParam]   = QString::number(accountId);
+    map[NmHsWidgetParamAccountId]   = QString::number(accountId);
+    map[NmHsWidgetParamAccountIconName]   = accountIconName;
     //------------------------------
     
     bool retVal(false);
@@ -149,7 +182,7 @@
                     Q_ARG(QVariantMap, map)); 
 
     //Push the registered widget also to homescreen right away
-    bool pushRetVal = pushWidgetToHomescreen(accountId);
+    bool pushRetVal = pushWidgetToHomescreen(accountId, accountIconName);
     
     return (retVal && ret && pushRetVal);
     }
@@ -159,10 +192,10 @@
     {
     QMap<QString, QVariant> map;
      //------------------------------
-     map[hsitemLaunchUri]   = NmLaunchUri;
+     map[hsitemLaunchUri]   = formLaunchUri(accountId);
      map[hsitemPublisherId] = NmPublisherName;
      map[hsItemWidgetUri]   = NmHsWidget;
-     map[NmHsWidgetParam]   = QString::number(accountId);
+     map[NmHsWidgetParamAccountId]   = QString::number(accountId);
      //------------------------------
      
      QList<QVariantMap> list; //list of items that mach the query
@@ -194,10 +227,10 @@
     
     QMap<QString, QVariant> map;
      //------------------------------
-     map[hsitemLaunchUri]   = NmLaunchUri;
+     map[hsitemLaunchUri]   = formLaunchUri(accountId);
      map[hsitemPublisherId] = NmPublisherName;
      map[hsItemWidgetUri]   = NmHsWidget;
-     map[NmHsWidgetParam]     = QString::number(accountId);
+     map[NmHsWidgetParamAccountId]     = QString::number(accountId);
      //------------------------------
      
      QList<QVariantMap> list; //list of items that mach the query
@@ -224,7 +257,7 @@
      return (retVal && ret);
     }
 
-bool NmMailboxRegisterInterfacePrivate::pushWidgetToHomescreen( quint64 accountId )
+bool NmMailboxRegisterInterfacePrivate::pushWidgetToHomescreen( quint64 accountId, QString accountIconName )
     {
     // load plugin
     QServiceManager manager;
@@ -243,6 +276,7 @@
     //--------------------------------
     QVariantHash map;
     map[NmHsAccountId] = QString::number(accountId);
+    map[NmHsAccountIconName] = accountIconName;
     //--------------------------------
     
     // invoke function synchronously
@@ -268,3 +302,7 @@
     return (retVal && ret);
     }
 
+QString NmMailboxRegisterInterfacePrivate::formLaunchUri(quint64 accountId) const
+    {
+    return NmLaunchUri + QString::number(accountId);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmregister/translations/nmregister.ts	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="3.0" sourcelanguage="en_GB">
+<context>
+<message numerus="no" id="txt_mail_widget_l_dblist_preview_of_recent_mail">
+    <comment>Custom layout ID parent (no children). Descriptive text of mail widget in application library, landscape</comment>        
+    <source>Preview of recent mail</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>txt_mail_widget_l_dblist_preview_of_recent_mail</extra-loc-layout_id>    
+    <extra-loc-viewid>Mail Widget_L07</extra-loc-viewid>
+    <extra-loc-positionid>dblist_1_val</extra-loc-positionid>
+    <extra-loc-feature>Mail Widget</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_mail_widget_dblist_preview_of_recent_mail">
+    <comment>Custom layout ID parent (no children). Descriptive text of mail widget in application library, portrait</comment>        
+    <source>Preview of recent mail</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>txt_mail_widget_dblist_preview_of_recent_mail</extra-loc-layout_id>    
+    <extra-loc-viewid>Mail Widget_P07</extra-loc-viewid>
+    <extra-loc-positionid>dblist_1_val</extra-loc-positionid>
+    <extra-loc-feature>Mail Widget</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+</context>
+</TS>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/bwins/nmutilitiesu.def	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,6 @@
+EXPORTS
+	?mailboxName@EmailMailboxInfo@@QBE?AVQString@@ABVQVariant@@@Z @ 1 NONAME ; class QString EmailMailboxInfo::mailboxName(class QVariant const &) const
+	?mailboxIcon@EmailMailboxInfo@@QBE?AVQString@@ABVQVariant@@@Z @ 2 NONAME ; class QString EmailMailboxInfo::mailboxIcon(class QVariant const &) const
+	??0EmailMailboxInfo@@QAE@XZ @ 3 NONAME ; EmailMailboxInfo::EmailMailboxInfo(void)
+	??1EmailMailboxInfo@@QAE@XZ @ 4 NONAME ; EmailMailboxInfo::~EmailMailboxInfo(void)
+
Binary file emailservices/nmutilities/data/2001E277.txt has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/data/email_brand.qrc	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,8 @@
+<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/icons/gmail.svg	Fri May 14 15:41:10 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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/data/icons/microsoft.svg	Fri May 14 15:41:10 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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/data/icons/ovi.svg	Fri May 14 15:41:10 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/icons/yahoo.svg	Fri May 14 15:41:10 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>
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/eabi/nmutilitiesu.def	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,8 @@
+EXPORTS
+	_ZN16EmailMailboxInfoC1Ev @ 1 NONAME
+	_ZN16EmailMailboxInfoC2Ev @ 2 NONAME
+	_ZN16EmailMailboxInfoD1Ev @ 3 NONAME
+	_ZN16EmailMailboxInfoD2Ev @ 4 NONAME
+	_ZNK16EmailMailboxInfo11mailboxIconERK8QVariant @ 5 NONAME
+	_ZNK16EmailMailboxInfo11mailboxNameERK8QVariant @ 6 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/inc/emailmailboxinfo.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,61 @@
+/*
+ * 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:  mailbox branding object
+ *
+ */
+
+#ifndef EMAILMAILBOXINFO_H_
+#define EMAILMAILBOXINFO_H_
+
+#include <QString>
+#include <QVariant>
+
+#include "emailutilitiesdef.h"
+
+class EmailMailboxInfoPrivate;
+
+class EMAIL_UTILITIES_EXPORT EmailMailboxInfo
+{
+public:
+
+    /*!
+        constructs object
+     */
+    EmailMailboxInfo();
+
+    /*!
+        destroys object 
+     */
+    ~EmailMailboxInfo();
+
+    /*!
+        Returns mailbox icon name 
+        \param identifier can be domain name or mailbox id (NmId from nmailbase)
+        \return mailbox icon name that can be used to construct HbIcon
+     */
+    QString mailboxIcon(const QVariant &identifier) const;
+
+    /*!
+        Returns branded mailbox name
+        \param identifier can be domain name or mailbox id (NmId from nmailbase)
+        \return mailbox name
+     */
+    QString mailboxName(const QVariant &identifier) const;
+
+private:
+    EmailMailboxInfoPrivate *d;
+
+};
+
+#endif /* EMAILMAILBOXINFO_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/inc/emailmailboxinfo_p.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,81 @@
+/*
+ * 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:  mailbox branding resource reader
+ *
+ */
+
+#ifndef MAILBOXINFO_P_H_
+#define MAILBOXINFO_P_H_
+
+#include <QObject>
+#include <QMap>
+class XQSettingsManager;
+class XQCentralRepositorySettingsKey;
+
+class EmailMailboxInfoPrivate : public QObject
+{
+Q_OBJECT
+
+private:
+    
+    static EmailMailboxInfoPrivate *getInstance();
+    static void releaseInstance(EmailMailboxInfoPrivate *&instance);
+    
+    EmailMailboxInfoPrivate();
+    ~EmailMailboxInfoPrivate();
+    
+    QString name(const QVariant &identifier);
+    QString icon(const QVariant &identifier);
+    
+    void processCenRepRecords(const QString &brandingId);
+    quint8 getCurrentCountryL() const;
+    bool verifyTimeZone() const;
+    void verifyMailAccountName(QString &brandingName) const;
+
+    static EmailMailboxInfoPrivate *mSelf;
+    static qint32 mReferenceCount;
+
+    XQSettingsManager *mSettingsManager;
+    
+    /*!
+         holds domain name for WLB
+     */
+    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;
+    QString mTempName;
+
+    /*! 
+         information about success or failure during resource file load
+     */
+    bool mIsResourceLoaded;
+    
+    /*!
+         Map of already imported branding keys
+     */
+    QMap<unsigned long int, QString> mBrandingDataMap;
+   
+    friend class EmailMailboxInfo;
+    friend class TestEmailMailboxInfoPrivate;
+};
+
+#endif /* MAILBOXINFO_P_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/inc/emailutilitiesdef.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef EMAILUTILITIESDEF_H_
+#define EMAILUTILITIESDEF_H_
+
+#include <QtGlobal>
+
+#if defined(Q_OS_WIN)
+#define EMAIL_UTILITIES_EXPORT __declspec(dllexport)
+#else
+
+#if defined(BUILD_UTILITIES_DLL)
+#define EMAIL_UTILITIES_EXPORT Q_DECL_EXPORT
+#else
+#define EMAIL_UTILITIES_EXPORT Q_DECL_IMPORT
+#endif /* BUILD_UTILITIES_DLL */
+
+#endif /* Q_OS_WIN */
+
+#endif /* EMAILUTILITIESDEF_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/inc/nmcenrepkeys.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,201 @@
+/*
+* 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*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/inc/nmutilitiescommonheaders.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,28 @@
+/*
+ * 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:  common header for emailmailboxinfo_p 
+ *
+ */
+
+#ifndef NMBRANDINGAPICOMMONHEADERS_H_
+#define NMBRANDINGAPICOMMONHEADERS_H_
+
+#include <QResource>
+#include <XQSettingsManager>
+#include <tzlocalizer.h>
+#include <qsysteminfo.h>
+#include <xqcentralrepositoryutils.h>
+#include <xqcentralrepositorysearchcriteria.h>
+
+#endif /* NMBRANDINGAPICOMMONHEADERS_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/nmutilities.pro	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,92 @@
+#
+# 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:
+#
+#
+
+CONFIG += debug
+
+TEMPLATE = lib
+TARGET = nmutilities
+QT += core
+DEFINES += BUILD_UTILITIES_DLL
+
+CONFIG += mobility
+MOBILITY += systeminfo
+
+INCLUDEPATH += inc \
+               ../../../inc \
+               $$MW_LAYER_SYSTEMINCLUDE 
+
+DEPENDPATH += src \
+              inc \
+              ../../../inc 
+
+MOC_DIR = tmp
+
+HEADERS   += nmcenrepkeys.h \
+			 emailutilitiesdef.h \
+			 emailmailboxinfo_p.h \
+			 emailmailboxinfo.h \
+			 nmutilitiescommonheaders.h
+             
+SOURCES   += emailmailboxinfo_p.cpp \
+			 emailmailboxinfo.cpp
+
+symbian*: { 
+    TARGET.EPOCALLOWDLLDATA = 1
+    TARGET.CAPABILITY = ALL \
+        -TCB
+    TARGET.UID2 = 0x1000008D
+    TARGET.UID3 = 0x2002EA97 
+
+    INCLUDEPATH += /epoc32/include/ecom \ 
+                   $$MW_LAYER_SYSTEMINCLUDE
+                      
+    defBlock = \      
+      "$${LITERAL_HASH}if defined(MARM)" \
+      "DEFFILE  eabi/nmutilities.def" \
+	  "$${LITERAL_HASH}else" \
+      "DEFFILE  bwins/nmutilities.def" \
+      "$${LITERAL_HASH}endif"
+    
+    MMP_RULES += defBlock
+    
+	LIBS +=	-lcentralrepository 
+	LIBS +=	-ltimezonelocalization 
+	LIBS +=	-lxqsettingsmanager 
+}
+
+win32 {
+   DESTDIR = ../../bin
+}
+
+#creating rcc file from qrc
+system(rcc -binary data/email_brand.qrc -o data/email_brand.rcc)
+
+# Build.inf rules  
+BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
+                             "rom/nmutilities.iby $$CORE_APP_LAYER_IBY_EXPORT_PATH(nmutilities.iby)" \
+                             "data/email_brand.rcc                  /epoc32/data/Z/resource/apps/email_brand.rcc" \
+                             "data/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/nmutilities.confml            	APP_LAYER_CONFML(nmutilities.confml)" \
+                             "data/nmutilities_200255BA.crml      	APP_LAYER_CRML(nmutilities_200255BA.crml)" \
+                             "inc/emailmailboxinfo.h				APP_LAYER_PLATFORM_EXPORT_PATH(emailmailboxinfo.h)" \
+                             "inc/nmutilitiescommonheaders.h      	APP_LAYER_PLATFORM_EXPORT_PATH(nmutilitiescommonheaders.h)" \
+                             "inc/emailutilitiesdef.h               APP_LAYER_PLATFORM_EXPORT_PATH(emailutilitiesdef.h)" \
+                             "inc/nmcenrepkeys.h                    APP_LAYER_PLATFORM_EXPORT_PATH(nmcenrepkeys.h)" 
+                             
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/rom/nmutilities.iby	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,24 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef __NMUTILITIES_IBY__
+#define __NMUTILITIES_IBY__
+
+#include <bldvariant.hrh>
+
+file=ABI_DIR\BUILD_DIR\nmutilities.dll SHARED_LIB_DIR\nmutilities.dll   PAGED
+
+#endif // __NMUTILITIES_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/src/emailmailboxinfo.cpp	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,56 @@
+/*
+ * 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:  mailbox branding object
+ *
+ */
+
+#include "emailmailboxinfo.h"
+#include "emailmailboxinfo_p.h"
+
+/*!
+    private constructor of EmailMailboxInfo
+ */
+EmailMailboxInfo::EmailMailboxInfo()
+{
+    d = EmailMailboxInfoPrivate::getInstance();
+}
+
+/*!
+    destructor of EmailMailboxInfo
+ */
+EmailMailboxInfo::~EmailMailboxInfo()
+{
+    EmailMailboxInfoPrivate::releaseInstance(d);
+}
+
+/*!
+    Returns mailbox icon name 
+    \param identifier can be domain name or mailbox id (NmId from nmailbase)
+    \return mailbox icon name that can be used to construct HbIcon
+ */
+QString EmailMailboxInfo::mailboxIcon(const QVariant &identifier) const
+{
+    return d->icon(identifier);
+}
+
+/*!
+    Returns branded mailbox name
+    \param identifier can be domain name or mailbox id (NmId from nmailbase)
+    \return mailbox name
+ */
+QString EmailMailboxInfo::mailboxName(const QVariant &identifier) const
+{
+    return d->name(identifier);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/src/emailmailboxinfo_p.cpp	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,281 @@
+/*
+ * 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:  mailbox branding object
+ *
+ */
+
+#include "emailmailboxinfo_p.h"
+#include "nmutilitiescommonheaders.h"
+#include "nmcenrepkeys.h"
+#include <QRegExp>
+#include <QStringList>
+
+const unsigned long int partialKey = 0x0;
+const unsigned long int bitMask = 0x0F000000;
+
+EmailMailboxInfoPrivate* EmailMailboxInfoPrivate::mSelf = NULL;
+qint32 EmailMailboxInfoPrivate::mReferenceCount = 0;
+
+const QString KBrandNameGmail("Gmail");
+const QString KBrandNameGoogleMail("Google Mail");
+
+const QString KMCCGermany("262");
+const QString KMCCUK1("234");
+const QString KMCCUK2("235");
+
+const quint8 KGermanyTzId = 36;
+const quint8 KUKTzId = 104;
+
+using namespace NmBrandingApi;
+using namespace QtMobility;
+
+/*!
+     private constructor
+ */
+EmailMailboxInfoPrivate::EmailMailboxInfoPrivate() :
+    QObject(NULL), 
+	mIsResourceLoaded(false)
+{
+    XQSettingsManager manager;
+    XQCentralRepositorySettingsKey rccKey(EMAIL_CENREP, RCC_PATH);
+
+    XQCentralRepositorySettingsKey wlbKey(EMAIL_CENREP, WLB_BRAND_NAME);
+
+    mWlbDomainName = manager.readItemValue(wlbKey, XQSettingsManager::TypeString).value<QString> ();
+
+    QString pathToRcc =
+        manager.readItemValue(rccKey, XQSettingsManager::TypeString).value<QString> ();
+    if (!mIsResourceLoaded) {
+        mIsResourceLoaded = QResource::registerResource(pathToRcc);
+    }
+}
+/*!
+     private destructor
+ */
+EmailMailboxInfoPrivate::~EmailMailboxInfoPrivate()
+{
+
+}
+
+/*!
+    gets instance of EmailMailboxInfoPrivate
+    \return instance of EmailMailboxInfoPrivate
+ */
+EmailMailboxInfoPrivate* EmailMailboxInfoPrivate::getInstance()
+{
+    if (!mSelf) {
+        mSelf = new EmailMailboxInfoPrivate();
+    }
+    mReferenceCount++;
+    return mSelf;
+}
+
+/*!
+    releases pointer to instance of EmailMailboxInfoPrivate
+    \param pointer to instance of EmailMailboxInfoPrivate object
+ */
+void EmailMailboxInfoPrivate::releaseInstance(EmailMailboxInfoPrivate *&instance)
+{
+    if (instance) {
+        mReferenceCount--;
+        instance = NULL;
+    }
+    if (mReferenceCount < 1) {
+        delete mSelf;
+        mSelf = NULL;
+    }
+}
+
+/*!
+    returns branding name of given domain
+    \param branding identifier
+    \return branding name
+ */
+QString EmailMailboxInfoPrivate::name(const QVariant &identifier)
+{
+    QString returnValue = "";
+    QString domainName = "";
+    if (identifier.canConvert<QString> ()) {
+        domainName = identifier.value<QString> ();
+    }
+
+    if (domainName.length() > 0) {
+        processCenRepRecords(domainName);
+        returnValue = mTempName;
+    }
+
+    verifyMailAccountName(returnValue);
+
+    return returnValue;
+}
+
+/*!
+    returns branding icon of given domain
+    \param branding identifier
+    \return branding icon
+ */
+QString EmailMailboxInfoPrivate::icon(const QVariant &identifier)
+{
+    QString returnValue = "";
+    QString domainName = "";
+    if (identifier.canConvert<QString> ()) {
+        domainName = identifier.value<QString> ();
+    }
+
+    if (domainName.length() > 0){
+        processCenRepRecords(domainName);
+        returnValue = mTempIcon;
+    }
+
+    return returnValue;
+}
+
+/*!
+    goes through cenrep to find matching branding details
+    \param brandingId (i.e. domain name)
+ */
+void EmailMailboxInfoPrivate::processCenRepRecords(const QString &brandingId)
+{
+    bool found = false;
+    QString name;
+    QString icon;
+
+    XQSettingsManager cenRepManager;
+
+    if (brandingId == mWlbDomainName) {
+        found = true;
+        XQCentralRepositorySettingsKey wlbNameKey(EMAIL_CENREP, WLB_MAILBOX_NAME);
+        XQCentralRepositorySettingsKey wlbIconKey(EMAIL_CENREP, WLB_ICON_PATH);
+
+        icon = cenRepManager.readItemValue(wlbIconKey, XQSettingsManager::TypeString).value<QString> ();
+        name = cenRepManager.readItemValue(wlbNameKey, XQSettingsManager::TypeString).value<QString> ();
+    }
+    else {
+        XQCentralRepositorySearchCriteria sCriteria(EMAIL_CENREP, partialKey, bitMask);
+        XQCentralRepositoryUtils cenrepUtils(cenRepManager);
+        QList<XQCentralRepositorySettingsKey> foundKeys = cenrepUtils.findKeys(sCriteria);
+
+        foreach(XQCentralRepositorySettingsKey key, foundKeys)
+        {
+            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);
+                }
+            }
+
+            // 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;
+            }
+
+            QRegExp regExp(cenRepRecord.at(1));
+            regExp.setCaseSensitivity(Qt::CaseInsensitive);
+
+            if (regExp.exactMatch(brandingId)) { //match
+                found = true;
+                icon = ":/" + cenRepRecord.at(3);
+                name = cenRepRecord.at(2);
+                break;
+            }
+        }
+    }
+    if (!found || !mIsResourceLoaded) {
+        //get default icon and name
+        icon = "qtg_large_email";
+        QStringList domain = brandingId.split(".");
+        if (domain.size() > 0) {
+            name = domain.at(0);
+        }
+    }
+    mTempIcon = icon;
+    mTempName = name;
+}
+
+/*!
+    gets current country code
+    \return current country id
+ */
+quint8 EmailMailboxInfoPrivate::getCurrentCountryL() const
+{
+    CTzLocalizer* localizer = CTzLocalizer::NewLC();
+
+    CTzLocalizedCity* city = localizer->GetFrequentlyUsedZoneCityL(
+        CTzLocalizedTimeZone::ECurrentZone);
+    CleanupStack::PushL(city);
+
+    CTzLocalizedCityGroup* cityGroup = localizer->GetCityGroupL(city->GroupId());
+
+    TUint8 countryId = cityGroup->Id();
+
+    delete cityGroup;
+    cityGroup = NULL;
+
+    CleanupStack::PopAndDestroy(2, localizer);
+
+    return countryId;
+}
+
+/*!
+    verifies if timezone is set for Germany or UK
+    \return true if timezone is UK or Germany, false otherwise
+ */
+bool EmailMailboxInfoPrivate::verifyTimeZone() const
+{
+    quint8 timeZone = 0;
+    bool retVal = false;
+    TRAPD(err, timeZone = getCurrentCountryL());
+
+    if (err == KErrNone && (timeZone == KGermanyTzId || timeZone == KUKTzId)) {
+        retVal = true;
+    }
+    return retVal;
+}
+
+/*!
+    modifies branding name "Gmail" according to UK and Germany law rules
+    \param brandingName name of branding
+ */
+void EmailMailboxInfoPrivate::verifyMailAccountName(QString &brandingName) const
+{
+    QSystemNetworkInfo *networkInfo = new QSystemNetworkInfo();
+    QString currentMCC = networkInfo->currentMobileCountryCode();
+
+    if (brandingName == KBrandNameGmail) {
+        if (currentMCC.size() > 0) {
+            if ((currentMCC == KMCCGermany) || (currentMCC == KMCCUK1) || (currentMCC == KMCCUK2)) {
+                brandingName = KBrandNameGoogleMail;
+            }
+        }
+        else { //if there is information (no sim)
+            if (verifyTimeZone()) {
+                brandingName = KBrandNameGoogleMail;
+            }
+        }
+    }
+}
+
--- a/emailuis/nmailcpplugin/nmailcpplugin.pro	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailcpplugin/nmailcpplugin.pro	Fri May 14 15:41:10 2010 +0300
@@ -23,11 +23,8 @@
 
 DEPENDPATH += .
 
-INCLUDEPATH += .
 INCLUDEPATH += ./inc
 INCLUDEPATH += ../../inc
-INCLUDEPATH += ../nmailuiengine/inc
-INCLUDEPATH += ../nmsettingui/inc
 INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
 
 CONFIG += hb
@@ -39,13 +36,7 @@
 
 # Platforms
 SYMBIAN_PLATFORMS = WINSCW \
-    ARMV5
-LIBS += -lcpframework
-LIBS += -lnmailuiengine
-LIBS += -lnmailbase
-LIBS += -lnmsettingui
-LIBS += -leuser
-LIBS += -llibc
+                    ARMV5
 
 # Input
 HEADERS += inc/nmsettingsplugin.h
@@ -56,20 +47,26 @@
     TARGET.EPOCALLOWDLLDATA = 1
     DEFINES += PLUGINUID3=0x2002BCF6
     TARGET.UID3 = 0x2002BCF6
-}
-symbian { 
+    
+    LIBS += -lcpframework
+    LIBS += -lnmailuiengine
+    LIBS += -lnmailbase
+    LIBS += -lnmsettingui
+    LIBS += -leuser
+    LIBS += -llibc
+    
     deploy.path = C:
     qtplugins.path = /resource/qt/plugins/controlpanel
     qtplugins.sources += qmakepluginstubs/nmailcpplugin.qtplugin
     
     # This is for new exporting system coming in garden
     for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)"
-}
 
-# Build.inf rules
-BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
-"rom/nmailcpplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(nmailcpplugin.iby)"
-#"stub_sis/nmailcpplugin_stub.sis /epoc32/data/z/system/install/nmailcpplugin_stub.sis"
+    # Build.inf rules
+    BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
+    "rom/nmailcpplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(nmailcpplugin.iby)"
+
+}
 
 TARGET.CAPABILITY = All -TCB
 plugin.sources = nmailcpplugin.dll
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailui/conf/nmeditorview.docml	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.0">
+    <widget name="editorview" type="HbView">
+        <widget name="content" role="HbView:widget" type="HbWidget">
+            <widget name="scrollArea" plugin="nmailuiwidgetsplugin" type="NmBaseViewScrollArea">
+                <widget name="scrollAreaContents" role="HbScrollArea:contents" type="HbWidget">
+                    <widget name="container" type="HbWidget">
+                        <widget name="HeaderLayout" type="HbWidget">
+                            <widget name="ToHorizontalLayout" type="HbWidget">
+                                <widget name="EditorHeaderToLabel" type="HbLabel">
+                                    <sizehint height="5un" type="PREFERRED" width="10un"/>
+                                    <sizehint height="5un" type="MINIMUM" width="1.89552un"/>
+                                    <string locid="txt_mail_editor_to" name="plainText" value="To:"/>
+                                    <fontspec name="fontSpec" role="Secondary" textheight="23.45"/>
+                                </widget>
+                                <widget name="EditorHeaderToEdit" plugin="nmailuiwidgetsplugin" type="NmRecipientLineEdit">
+                                    <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                                    <sizehint height="5un" type="PREFERRED" width="8.26269un"/>
+                                    <sizehint height="5un" type="MINIMUM" width="0un"/>
+                                    <fontspec name="fontSpec" role="Secondary" textheight="3.5un"/>
+                                    <integer name="maxRows" value="256"/>
+                                    <string name="alignment" value="AlignAbsolute"/>
+                                    <string name="text" value=""/>
+                                </widget>
+                                <widget name="EditorHeaderToButton" type="HbPushButton">
+                                    <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                                    <sizehint height="5un" type="FIXED" width="9.5un"/>
+                                    <sizehint height="5un" type="MINIMUM" width="9.5un"/>
+                                    <sizehint height="5un" type="MAXIMUM" width="9.5un"/>
+                                    <string name="text" value=""/>
+                                </widget>
+                                <real name="z" value="0"/>
+                                <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Minimum" verticalStretch="0"/>
+                                <sizehint height="5un" type="MINIMUM" width="23.8806un"/>
+                                <layout orientation="Horizontal" spacing="1un" type="linear">
+                                    <contentsmargins bottom="0un" left="var(hb-param-margin-gene-left)" right="var(hb-param-margin-gene-right)" top="0un"/>
+                                    <linearitem itemname="EditorHeaderToLabel"/>
+                                    <linearitem itemname="EditorHeaderToEdit"/>
+                                    <linearitem itemname="EditorHeaderToButton"/>
+                                </layout>
+                            </widget>
+                            <widget name="EditorHeaderRecipientGB" type="HbGroupBox">
+                                <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Minimum" verticalStretch="0"/>
+                                <bool name="collapsable" value="FALSE"/>
+                                <bool name="collapsed" value="FALSE"/>
+                                <fontspec name="fontSpec" role="Secondary" textheight="23.45"/>
+                            </widget>
+                            <widget name="SubjectHorizontalLayout" type="HbWidget">
+                                <widget name="EditorHeaderSubjectLabel" type="HbLabel">
+                                    <sizehint height="5un" type="PREFERRED" width="11un"/>
+                                    <string locid="txt_mail_editor_subject" name="plainText" value="Subject:"/>
+                                    <fontspec name="fontSpec" role="Secondary" textheight="23.45"/>
+                                </widget>
+                                <widget name="EditorHeaderSubjectEdit" plugin="nmailuiwidgetsplugin" type="NmHtmlLineEdit">
+                                    <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                                    <sizehint height="5un" type="PREFERRED" width="8.26269un"/>
+                                    <sizehint height="5un" type="MINIMUM" width="0un"/>
+                                    <fontspec name="fontSpec" role="Secondary" textheight="3.5un"/>
+                                    <integer name="maxRows" value="256"/>
+                                    <string name="alignment" value="AlignAbsolute"/>
+                                    <string name="text" value=""/>
+                                </widget>
+                                <widget name="labelPriorityIcon" type="HbLabel">
+                                    <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                                    <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                                    <sizehint height="5un" type="MINIMUM" width="0un"/>
+                                    <sizehint height="5un" type="MAXIMUM" width="0un"/>
+                                </widget>
+                                <real name="z" value="0"/>
+                                <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Minimum" verticalStretch="0"/>
+                                <sizehint height="5un" type="MINIMUM" width="23.8806un"/>
+                                <layout orientation="Horizontal" spacing="0un" type="linear">
+                                    <contentsmargins bottom="0un" left="var(hb-param-margin-gene-left)" right="var(hb-param-margin-gene-right)" top="0un"/>
+                                    <linearitem itemname="EditorHeaderSubjectLabel"/>
+                                    <linearitem itemname="EditorHeaderSubjectEdit"/>
+                                    <linearitem itemname="labelPriorityIcon"/>
+                                </layout>
+                            </widget>
+                            <widget name="attachmentListWidget" plugin="nmailuiwidgetsplugin" type="NmAttachmentListWidget">
+                                <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="MinimumExpanding" verticalStretch="0"/>
+                                <sizehint height="0.1un" type="MINIMUM" width="25.6194un"/>
+                                <contentsmargins bottom="var(hb-param-margin-gene-middle-vertical)" left="0un" right="0un" top="0un"/>
+                                <sizehint height="0.1un" type="MAXIMUM"/>
+                            </widget>
+                            <real name="z" value="1"/>
+                            <sizepolicy horizontalPolicy="Minimum" horizontalStretch="0" verticalPolicy="Minimum" verticalStretch="0"/>
+                            <sizehint height="18un" type="MINIMUM" width="53.73134un"/>
+                            <sizehint height="200un" type="MAXIMUM" width="2504062.01158un"/>
+                            <layout orientation="Vertical" spacing="1un" type="linear">
+                                <contentsmargins bottom="0un" left="0un" right="0un" top="var(hb-param-margin-gene-top)"/>
+                                <linearitem itemname="ToHorizontalLayout"/>
+                                <linearitem itemname="EditorHeaderRecipientGB"/>
+                                <linearitem itemname="SubjectHorizontalLayout"/>
+                                <linearitem itemname="attachmentListWidget"/>
+                            </layout>
+                        </widget>
+                        <widget name="BodyTextEdit" plugin="nmailuiwidgetsplugin" type="NmEditorTextEdit">
+                            <real name="z" value="2"/>
+                            <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+                            <contentsmargins bottom="0un" left="1un" right="1un" top="0un"/>
+                            <fontspec name="fontSpec" role="Secondary" textheight="3.5un"/>
+                            <string name="plainText" value=""/>
+                        </widget>
+                        <real name="z" value="0"/>
+                        <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
+                        <sizehint height="23.8806un" type="PREFERRED" width="23.8806un"/>
+                        <layout type="anchor">
+                            <anchoritem dst="HeaderLayout" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+                            <anchoritem dst="HeaderLayout" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+                            <anchoritem dst="HeaderLayout" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+                            <anchoritem dst="BodyTextEdit" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+                            <anchoritem dst="BodyTextEdit" dstEdge="TOP" spacing="0un" src="HeaderLayout" srcEdge="BOTTOM"/>
+                            <anchoritem dst="BodyTextEdit" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+                            <anchoritem dst="BodyTextEdit" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+                        </layout>
+                    </widget>
+                    <real name="z" value="0"/>
+                    <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
+                    <sizehint height="88un" type="PREFERRED" width="54un"/>
+                    <layout type="anchor">
+                        <anchoritem dst="container" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+                        <anchoritem dst="container" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+                        <anchoritem dst="container" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+                        <anchoritem dst="container" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+                    </layout>
+                </widget>
+                <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
+            </widget>
+            <layout type="anchor">
+                <anchoritem dst="scrollArea" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+                <anchoritem dst="scrollArea" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+                <anchoritem dst="scrollArea" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+                <anchoritem dst="scrollArea" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+            </layout>
+        </widget>
+        <string name="title" value=""/>
+    </widget>
+    <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+        <uistate name="Common ui state" sections="#common"/>
+    </metadata>
+</hbdocument>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailui/conf/nmmailboxlistview.docml	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="0.4">
+    <widget name="NmMailboxListView" type="HbView">
+        <widget name="content" role="HbView:widget" type="HbWidget">
+            <widget name="MailboxListWidget" type="HbListView">
+                <sizehint height="85.67164422993572un" type="PREFERRED" width="53.7313448132001un"/>
+                <zvalue value="1.0E-4"/>
+            </widget>
+            <layout type="anchor" widget="content">
+                <anchoritem dst="MailboxListWidget" dstEdge="TOP" spacing="0.0un" src="" srcEdge="TOP"/>
+                <anchoritem dst="MailboxListWidget" dstEdge="LEFT" spacing="0.0un" src="" srcEdge="LEFT"/>
+                <anchoritem dst="MailboxListWidget" dstEdge="BOTTOM" spacing="0.0un" src="" srcEdge="BOTTOM"/>
+                <anchoritem dst="MailboxListWidget" dstEdge="RIGHT" spacing="0.0un" src="" srcEdge="RIGHT"/>
+            </layout>
+        </widget>
+        <string name="title" value="View"/>
+    </widget>
+    <metadata display="QHD portrait" unit="un"/>
+</hbdocument>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailui/conf/nmmailboxselectiondialog.docml	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.0">
+    <object name="qtl_dialog_softkey_2_right" type="HbAction">
+        <string name="role" value="HbDialog:primaryAction"/>
+        <string locid="txt_common_button_cancel" name="text" value="Cancel"/>
+    </object>
+    <widget name="mailboxSelectionDialog" type="HbDialog">
+        <widget name="qtl_dialog_pri_heading" role="HbDialog:headingWidget" type="HbLabel">
+            <enums name="alignment" value="AlignLeft|AlignLeading"/>
+            <contentsmargins bottom="var(hb-param-margin-gene-popup)" left="var(hb-param-margin-gene-popup)" right="var(hb-param-margin-gene-popup)" top="var(hb-param-margin-gene-popup)"/>
+            <string locid="txt_mail_dialog_send_via" name="plainText"/>
+            <fontspec name="fontSpec" role="Primary" textheight="var(hb-param-text-height-primary)"/>
+        </widget>
+        <widget name="mailboxListView" role="HbDialog:contentWidget" type="HbListView">
+            <widget name="qtl_list_pri" role="HbAbstractView:prototype" type="HbListViewItem">
+                <string name="state" value="normal"/>
+            </widget>
+            <real name="z" value="1"/>
+        </widget>
+        <contentsmargins bottom="var(hb-param-margin-view-bottom)" left="var(hb-param-margin-view-left)" right="var(hb-param-margin-view-right)" top="var(hb-param-margin-view-top)"/>
+        <ref object="qtl_dialog_softkey_2_right" role="HbDialog:primaryAction"/>
+    </widget>
+    <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+        <uistate name="Common ui state" sections="#common"/>
+        <dummydata objectName="mailboxListView" section="#common" value="6"/>
+    </metadata>
+</hbdocument>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailui/conf/nmmailviewer.docml	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.0">
+    <widget name="nmailViewerView" type="HbView">
+        <widget name="content" role="HbView:widget" type="HbWidget">
+            <widget name="viewerScrollArea" type="NmBaseViewScrollArea">
+                <widget name="viewerScrollAreaContents" role="HbScrollArea:contents" type="HbWidget">
+                    <widget name="viewerHeader" type="NmViewerHeader">
+                        <bool name="visible" value="TRUE"/>
+                    </widget>
+                    <widget name="viewerAttaList" type="NmAttachmentListWidget">
+                        <bool name="visible" value="TRUE"/>
+                    </widget>
+                    <widget name="viewerWebView" type="NmMailViewerWK">
+                        <real name="z" value="2"/>
+                        <bool name="visible" value="TRUE"/>
+                    </widget>
+                    <real name="z" value="0"/>
+                    <layout orientation="Vertical" type="linear">
+                        <linearitem itemname="viewerHeader"/>
+                        <linearitem itemname="viewerAttaList"/>
+                        <linearitem itemname="viewerWebView"/>
+                    </layout>
+                </widget>
+            </widget>
+            <real name="z" value="0"/>
+            <layout type="anchor">
+                <anchoritem dst="viewerScrollArea" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+                <anchoritem dst="viewerScrollArea" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+                <anchoritem dst="viewerScrollArea" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+                <anchoritem dst="viewerScrollArea" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+            </layout>
+        </widget>
+        <string name="title" value=""/>
+    </widget>
+    <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+        <uistate name="Common ui state" sections="#common"/>
+    </metadata>
+</hbdocument>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailui/conf/nmmessagelistview.docml	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.0">
+    <widget name="NmMessageListView" type="HbView">
+        <widget name="content" role="HbView:widget" type="HbWidget">
+            <widget name="MessageTreeList" type="HbTreeView">
+                <real name="z" value="1"/>
+                <sizehint height="76.71642un" type="PREFERRED" width="53.73134un"/>
+                <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
+            </widget>
+            <widget name="MessageListNoMessages" type="HbLabel">
+                <enums name="alignment" value="AlignLeft|AlignVCenter|AlignHCenter|AlignLeading"/>
+                <real name="z" value="2"/>
+                <sizehint height="4.47761un" type="PREFERRED" width="28.65672un"/>
+                <string locid="txt_mail_dblist_no_messages" name="plainText"/>
+                <fontspec name="fontSpec" role="Primary" textheight="var(hb-param-text-height-primary)"/>
+            </widget>
+            <widget name="labelGroupBox" type="HbGroupBox">
+                <real name="z" value="3"/>
+                <sizepolicy horizontalPolicy="MinimumExpanding" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                <sizehint height="6un" type="PREFERRED" width="52un"/>
+                <bool name="collapsable" value="FALSE"/>
+            </widget>
+            <widget name="syncIcon" type="HbLabel">
+                <real name="z" value="6"/>
+                <sizehint type="PREFERRED" width="expr(var(hb-param-graphic-size-primary-small) )"/>
+            </widget>
+            <widget name="folderLabel" type="HbLabel">
+                <real name="z" value="5"/>
+                <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+                <sizehint type="PREFERRED" width="45.97015un"/>
+                <string name="plainText" value="Folder"/>
+                <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
+            </widget>
+            <real name="z" value="0"/>
+            <layout type="anchor">
+                <anchoritem dst="MessageListNoMessages" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+                <anchoritem dst="MessageListNoMessages" dstEdge="TOP" spacing="20un" src="" srcEdge="TOP"/>
+                <anchoritem dst="MessageListNoMessages" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+                <anchoritem dst="labelGroupBox" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+                <anchoritem dst="labelGroupBox" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+                <anchoritem dst="labelGroupBox" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+                <anchoritem dst="MessageTreeList" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+                <anchoritem dst="MessageTreeList" dstEdge="TOP" spacing="0un" src="labelGroupBox" srcEdge="BOTTOM"/>
+                <anchoritem dst="MessageTreeList" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+                <anchoritem dst="MessageTreeList" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+                <anchoritem dst="folderLabel" dstEdge="LEFT" spacing="var(hb-param-margin-gene-left)" src="" srcEdge="LEFT"/>
+                <anchoritem dst="folderLabel" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+                <anchoritem dst="folderLabel" dstEdge="BOTTOM" spacing="0un" src="labelGroupBox" srcEdge="BOTTOM"/>
+                <anchoritem dst="folderLabel" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="syncIcon" srcEdge="LEFT"/>
+                <anchoritem dst="syncIcon" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+                <anchoritem dst="syncIcon" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
+                <anchoritem dst="syncIcon" dstEdge="BOTTOM" spacing="0un" src="labelGroupBox" srcEdge="BOTTOM"/>
+            </layout>
+        </widget>
+        <string name="title" value="View"/>
+    </widget>
+    <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+        <uistate name="Common ui state" sections="#common"/>
+        <dummydata objectName="MessageTreeList" section="#common" value="0"/>
+    </metadata>
+</hbdocument>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailui/conf/nmmessagesearchlistview.docml	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.0">
+    <widget name="NmMessageListView" type="HbView">
+        <widget name="content" role="HbView:widget" type="HbWidget">
+            <widget name="MessageTreeList" type="HbTreeView">
+                <real name="z" value="4"/>
+                <sizehint height="67.7612un" type="PREFERRED"/>
+            </widget>
+            <widget name="MessageListNoMessages" type="HbLabel">
+                <real name="z" value="5"/>
+                <string locid="txt_mail_dblist_no_messages" name="plainText"/>
+            </widget>
+            <widget name="SearchBarContainer" type="HbWidget">
+                <widget name="LineEdit" type="HbLineEdit">
+                    <real name="z" value="10"/>
+                    <sizehint type="PREFERRED" width="51.04478un"/>
+                    <string name="text" value="" />
+                </widget>
+                <widget name="PushButton" type="HbPushButton">
+                    <real name="z" value="11"/>
+                    <sizehint type="PREFERRED" width="18.50746un"/>
+                    <string name="text" locid="txt_mail_list_search" />
+                </widget>
+                <real name="z" value="8"/>
+                <sizehint height="8un" type="PREFERRED" width="54.62687un"/>
+                <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
+                <sizehint height="4un" type="MINIMUM"/>
+                <sizehint height="15un" type="MAXIMUM"/>
+                <layout orientation="Horizontal" type="linear">
+                    <linearitem itemname="LineEdit"/>
+                    <linearitem itemname="PushButton"/>
+                </layout>
+            </widget>
+            <widget name="InfoLabel" type="HbLabel">
+                <real name="z" value="9"/>
+                <string name="plainText" value="Label"/>
+                <sizehint height="4.62687un" type="PREFERRED" width="53.8806un"/>
+                <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Minimum" verticalStretch="0"/>
+            </widget>
+            <real name="z" value="0"/>
+            <layout type="anchor">
+                <anchoritem dst="InfoLabel" dstEdge="LEFT" spacing="0" src="" srcEdge="LEFT"/>
+                <anchoritem dst="InfoLabel" dstEdge="TOP" spacing="0" src="SearchBarContainer" srcEdge="BOTTOM"/>
+                <anchoritem dst="InfoLabel" dstEdge="RIGHT" spacing="0" src="" srcEdge="RIGHT"/>
+                <anchoritem dst="MessageTreeList" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+                <anchoritem dst="MessageTreeList" dstEdge="TOP" spacing="0un" src="InfoLabel" srcEdge="BOTTOM"/>
+                <anchoritem dst="MessageTreeList" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+                <anchoritem dst="MessageTreeList" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+                <anchoritem dst="MessageListNoMessages" dstEdge="LEFT" spacing="12.14925un" src="" srcEdge="LEFT"/>
+                <anchoritem dst="MessageListNoMessages" dstEdge="TOP" spacing="10un" src="MessageTreeList" srcEdge="TOP"/>
+                <anchoritem dst="MessageListNoMessages" dstEdge="RIGHT" spacing="-11.82089un" src="" srcEdge="RIGHT"/>
+                <anchoritem dst="SearchBarContainer" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+                <anchoritem dst="SearchBarContainer" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+                <anchoritem dst="SearchBarContainer" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+            </layout>
+        </widget>
+        <string name="title" value="View"/>
+    </widget>
+    <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+        <uistate name="Common ui state" sections="#common"/>
+        <dummydata objectName="MessageTreeList" section="#common" value="0"/>
+    </metadata>
+</hbdocument>
--- a/emailuis/nmailui/conf/nmviewerheader.css	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/conf/nmviewerheader.css	Fri May 14 15:41:10 2010 +0300
@@ -16,7 +16,7 @@
   text-line-count-max:3;
 }
 
-NmViewerHeader::prioicon::icon{
+NmViewerHeader::prioicon{
   pref-height: var(hb-param-graphic-size-secondary);
   pref-width: var(hb-param-graphic-size-secondary); 
   size-policy: fixed fixed;   
--- a/emailuis/nmailui/conf/nmviewerheader.widgetml	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/conf/nmviewerheader.widgetml	Fri May 14 15:41:10 2010 +0300
@@ -10,7 +10,7 @@
       
       <meshitem src="subject" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-var(hb-param-margin-gene-left)"/>
       <meshitem src="subject" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)"/> 
-      <meshitem src="subject" srcEdge="TOP" dst="sent" dstEdge="BOTTOM" spacing="var(hb-param-margin-middle-vertical)"/>
+      <meshitem src="subject" srcEdge="TOP" dst="sent" dstEdge="BOTTOM" spacing="var(hb-param-margin-gene-middle-vertical)"/>
       <meshitem src="subject" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="var(hb-param-margin-gene-bottom)"/>
       
       <meshitem src="prioicon" srcEdge="CENTERV" dst="sent" dstEdge="CENTERV"/>      
--- a/emailuis/nmailui/inc/nmaction.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/inc/nmaction.h	Fri May 14 15:41:10 2010 +0300
@@ -35,7 +35,8 @@
     enum NmAvailabilityCondition
     {
         NmAlways = 0,   // Action is always available
-        NmSendable      // Action is not available if the related message cannot be send
+        NmSendable,     // Action is not available if the related message cannot be send
+        NmAttachable    // Action is not available if attachment cannot be added        
     };
     
     inline NmAction(int priorityIndex);
--- a/emailuis/nmailui/inc/nmactionrequest.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/inc/nmactionrequest.h	Fri May 14 15:41:10 2010 +0300
@@ -42,6 +42,7 @@
 	NmActionContextViewNone=0,
 	NmActionContextViewMailboxList,
 	NmActionContextViewMessageList,
+	NmActionContextViewMessageSearchList,
 	NmActionContextViewViewer,
 	NmActionContextViewEditor
     // Add more view id's when
--- a/emailuis/nmailui/inc/nmactionresponse.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/inc/nmactionresponse.h	Fri May 14 15:41:10 2010 +0300
@@ -28,7 +28,7 @@
 */
 enum NmActionResponseCommand
 {
-    NmActionResponseCommandNone=0,
+    NmActionResponseCommandNone = 0,
     NmActionResponseCommandOpen,
     NmActionResponseCommandNewMail,
     NmActionResponseCommandSendMail,
@@ -42,7 +42,9 @@
     NmActionResponseCommandUpdateMailboxName,
     NmActionResponseCommandMailboxDeleted,
     NmActionResponseCommandRemoveAttachment,
-    NmActionResponseCommandOpenAttachment
+    NmActionResponseCommandOpenAttachment,
+    NmActionResponseCommandSearch,
+    NmActionResponseCommandSwitchFolder
 };
 
 
--- a/emailuis/nmailui/inc/nmapplication.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/inc/nmapplication.h	Fri May 14 15:41:10 2010 +0300
@@ -34,6 +34,9 @@
 class NmViewerServiceInterface;
 class NmViewerViewNetManager;
 class NmUtilities;
+class NmAttachmentManager;
+class NmSettingsViewLauncher;
+class NmUiEffects;
 
 class NmApplication : public QObject
 {
@@ -46,6 +49,7 @@
     NmUiExtensionManager &extManager();
     NmViewerViewNetManager &networkAccessManager();
     QSize screenSize();
+    bool eventFilter(QObject *obj, QEvent *event);
 
 
 public slots:
@@ -53,11 +57,13 @@
     void exitApplication();
     void delayedExitApplication();
     void handleOperationCompleted(const NmOperationCompletionEvent &event);
-
+    void viewReady();
+    
 private:
     void createMainWindow();
     void pushView(NmBaseView *view);
     void resetViewStack();
+    void launchSettings(const NmId &mailboxId);
 
 private:
     HbMainWindow *mMainWindow;              // Not owned
@@ -66,15 +72,18 @@
     NmUiEngine *mUiEngine;                  // Owned
     HbAction *mBackAction;                  // Owned
     NmUiExtensionManager *mExtensionManager;// Owned
-    NmSendServiceInterface *mSendServiceInterface; // Owned
-    NmSendServiceInterface *mSendServiceInterface2; // Owned
+    NmSendServiceInterface *mSendServiceInterface;       // Owned
+    NmSendServiceInterface *mSendServiceInterface2;      // Owned
     NmMailboxServiceInterface *mMailboxServiceInterface; // Owned
-    NmViewerServiceInterface *mViewerServiceInterface; // Owned
+    NmViewerServiceInterface *mViewerServiceInterface;   // Owned
     NmMailboxListModel *mMbListModel;       // Not owned
     NmUiViewId mServiceViewId;
-    NmViewerViewNetManager *mNetManager;     // Owned
+    NmViewerViewNetManager *mNetManager;    // Owned
     bool mForegroundService;	
-    NmUtilities *mUtilities; // Owned
+    NmUiEffects *mEffects;                  // Owned
+    NmAttachmentManager *mAttaManager;      // Owned
+    NmSettingsViewLauncher* mSettingsViewLauncher; // Owned
+    bool mViewReady;
 };
 
 #endif // NMAPPLICATION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailui/inc/nmattachmentfetchobserver.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,28 @@
+/*
+* 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 NMATTACHMENTFETCHOBSERVER_H_
+#define NMATTACHMENTFETCHOBSERVER_H_
+
+class NmAttachmentFetchObserver 
+{
+public:
+    virtual void progressChanged(int value) = 0;
+    virtual void fetchCompleted(int result) = 0;
+};
+    
+#endif /* NMATTACHMENTFETCHOBSERVER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailui/inc/nmattachmentmanager.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,62 @@
+/*
+* 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 NMATTACHMENTMANAGER_H_
+#define NMATTACHMENTMANAGER_H_
+
+#include <QObject>
+#include <QPointer>
+
+#include <nmcommon.h>
+
+class NmUiEngine;
+class NmOperation;
+class NmAttachmentFetchObserver;
+
+class NmAttachmentManager : public QObject
+{
+    Q_OBJECT
+public:
+    NmAttachmentManager(NmUiEngine &uiEngine);
+    virtual ~NmAttachmentManager();
+    void fetchAttachment(
+            const NmId &mailboxId, 
+            const NmId &folderId, 
+            const NmId &messageId, 
+            const NmId &messagePartId);
+    bool isFetching() const;
+    NmId partIdUnderFetch() const;
+    int progressValue() const;
+    void setObserver(NmAttachmentFetchObserver *observer);
+    void clearObserver();
+    void cancelFetch();
+    
+private slots:
+    void changeProgress(int value);
+    void attachmentFetchCompleted(int result);
+    
+private:
+    NmUiEngine &mUiEngine;
+    QPointer<NmOperation> mFetchOperation;      // Not owned
+    NmAttachmentFetchObserver *mFetchObserver;  // Not owned
+    NmId mAttaId;
+    int mProgressValue;
+    bool mIsFetching;
+};
+
+
+#endif /* NMATTACHMENTMANAGER_H_ */
--- a/emailuis/nmailui/inc/nmattachmentpicker.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/inc/nmattachmentpicker.h	Fri May 14 15:41:10 2010 +0300
@@ -19,7 +19,6 @@
 #define NMATTACHMENTPICKER_H_
 
 #include <QObject>
-#include <xqappmgr.h>
 
 #define IMAGE_FETCHER_INTERFACE "Image"
 #define AUDIO_FETCHER_INTERFACE "com.nokia.services.media.Music"
@@ -27,6 +26,8 @@
 #define IMAGE_FETCHER_OPERATION "fetch(QVariantMap,QVariant)"
 #define AUDIO_FETCHER_OPERATION "fetch(QString)"
 
+class XQAiwRequest;
+
 /**
  * This class manages launching of different attachment pickers 
  * 
@@ -53,8 +54,7 @@
     void fetch(const QString& interface, const QString& operation); 
     
 private:
-    XQApplicationManager mAppmgr;
-    XQAiwRequest *mRequest;
+    XQAiwRequest *mRequest;    
 };
 
 #endif // NMATTACHMENTPICKER_H_
--- a/emailuis/nmailui/inc/nmbaseview.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/inc/nmbaseview.h	Fri May 14 15:41:10 2010 +0300
@@ -41,6 +41,7 @@
     virtual NmUiViewId nmailViewId() const = 0;
     virtual bool okToExitView();
     virtual void aboutToExitView();
+    virtual void viewReady();
     virtual void handleMouseReleaseEvent(QGraphicsSceneMouseEvent *event);
     virtual void handleMousePressEvent(QGraphicsSceneMouseEvent *event);
     virtual void handleMouseMoveEvent(QGraphicsSceneMouseEvent *event);
--- a/emailuis/nmailui/inc/nmeditorview.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/inc/nmeditorview.h	Fri May 14 15:41:10 2010 +0300
@@ -18,6 +18,8 @@
 #ifndef NMEDITORVIEW_H_
 #define NMEDITORVIEW_H_
 
+#include <QPointer>
+
 #include "nmbaseview.h"
 #include "nmactionobserver.h"
 #include "nmactionresponse.h"
@@ -63,6 +65,7 @@
     HbWidget* scrollAreaContents();
     bool okToExitView();
     void aboutToExitView();
+    void viewReady();
 
 public slots:
 
@@ -119,6 +122,7 @@
     void sendMouseReleaseEventToScroll(QGraphicsSceneMouseEvent *event);
     void sendMouseMoveEventToScroll(QGraphicsSceneMouseEvent *event);
     void sendLongPressGesture(const QPointF &point);
+    void contextButton(NmActionResponse &result);
 
 
 private: // Data
@@ -137,10 +141,10 @@
     HbMenu *mAttachmentListContextMenu; // Owned
     NmId mSelectedAttachment;
 
-    NmMessageCreationOperation *mMessageCreationOperation;  // Owned
-    NmAddAttachmentsOperation *mAddAttachmentOperation;     // Owned
-    NmOperation *mRemoveAttachmentOperation;                // Owned
-    NmCheckOutboxOperation *mCheckOutboxOperation;          // Owned
+    QPointer<NmMessageCreationOperation> mMessageCreationOperation;  // Not owned
+    QPointer<NmAddAttachmentsOperation> mAddAttachmentOperation;     // Not owned 
+    QPointer<NmOperation> mRemoveAttachmentOperation;                // Not owned 
+    QPointer<NmCheckOutboxOperation> mCheckOutboxOperation;          // Not owned 
 
     HbProgressDialog *mWaitDialog; // Owned.
     
--- a/emailuis/nmailui/inc/nmmailboxlistview.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/inc/nmmailboxlistview.h	Fri May 14 15:41:10 2010 +0300
@@ -20,10 +20,11 @@
 
 #include "nmbaseview.h"
 #include <nmactionobserver.h>
+#include <QModelIndex>
 
 class HbListView;
 class HbDocumentLoader;
-class NmUiEngine;
+class NmUiEngine; 
 class NmApplication;
 class NmUiStartParam;
 class NmMailboxListModel;
@@ -31,7 +32,6 @@
 class HbMenu;
 class HbAbstractViewItem;
 class NmAction;
-class QModelIndex;
 
 class NmMailboxListView : public NmBaseView, public NmActionObserver
 {
@@ -46,15 +46,20 @@
         QGraphicsItem *parent = 0);
     ~NmMailboxListView();
     void reloadViewContents(NmUiStartParam* startParam);
-    void refreshList();
     NmUiViewId nmailViewId() const;
+    void viewReady();
 
 public: // From NmActionObserver
     void handleActionCommand(NmActionResponse &menuResponse);
 
 public slots:
-    void openSelectedMailBox(const QModelIndex &index);
+    void itemActivated(const QModelIndex &index);
+    void openSelectedMailBox();
     void showItemContextMenu(HbAbstractViewItem *item, const QPointF &coords);
+    void contextButton(NmActionResponse &result);
+
+private slots:
+    void refreshList();
 
 private:
     void loadViewLayout();
@@ -67,6 +72,8 @@
     NmMailboxListModel &mListModel;     // Not owned
     HbMenu *mItemContextMenu;           // Owned
     HbDocumentLoader *mDocumentLoader;  // Owned
+    QModelIndex mActivatedIndex;
+    bool mViewReady;
 };
 
 #endif /* NMMAILBOXLISTVIEW_H_ */
--- a/emailuis/nmailui/inc/nmmailboxlistviewitem.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/inc/nmmailboxlistviewitem.h	Fri May 14 15:41:10 2010 +0300
@@ -28,12 +28,10 @@
 public:
     NmMailboxListViewItem(QGraphicsItem * parent = 0);
     virtual ~NmMailboxListViewItem();
-    enum { ItemType = Hb::ItemType_Last + 1 };
 
 public: // from HbListViewItem
     HbListViewItem *createItem();
     void updateChildItems();
-    int type() const;
     bool canSetModelIndex(const QModelIndex &index);
     void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
 
--- a/emailuis/nmailui/inc/nmmailboxselectiondialog.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/inc/nmmailboxselectiondialog.h	Fri May 14 15:41:10 2010 +0300
@@ -24,6 +24,7 @@
 
 class HbDialog;
 class HbListView;
+class HbAction;
 class QGraphicsItem;
 class QStandardItemModel;
 class NmMailboxListModel;
@@ -38,26 +39,24 @@
 
     NmMailboxSelectionDialog(NmMailboxListModel &mailboxListModel,
                              QGraphicsItem *parent = 0);
-
     virtual ~NmMailboxSelectionDialog();
-
-    bool exec(NmId& mailboxId);
-
+    void open();
 
 private slots:
 
     void itemActivated(QModelIndex index);
+    void dialogClosed(HbAction *action);
 
+signals:
+
+    void selectionDialogClosed(NmId &mailboxId);
 
 private:
 
     bool initializeUi();
-
     bool populateListItems();
-
     NmMailboxMetaData *mailboxMetaData(int index) const;
 
-
 private:
 
     HbListView *mMailboxListView; // Content view, owned
--- a/emailuis/nmailui/inc/nmmessagelistview.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/inc/nmmessagelistview.h	Fri May 14 15:41:10 2010 +0300
@@ -20,6 +20,7 @@
 
 #include "nmbaseview.h"
 #include <nmactionobserver.h>
+#include <QModelIndex>
 
 class HbTreeView;
 class HbLabel;
@@ -33,7 +34,6 @@
 class HbAbstractViewItem;
 class NmActionResponse;
 class NmMessageListModelItem;
-class QModelIndex;
 class HbIconItem;
 
 class NmMessageListView : public NmBaseView, public NmActionObserver
@@ -50,29 +50,34 @@
         QGraphicsItem *parent = 0);
     ~NmMessageListView();
     NmUiViewId nmailViewId() const;
-
+    void viewReady();
+    
 public: // From NmActionObserver
     void handleActionCommand(NmActionResponse &menuResponse);
 
 public slots:
     void reloadViewContents(NmUiStartParam *startParam);
-
+    void refreshList();
+    void contextButton(NmActionResponse &result);
+    
 private slots:
     void showItemContextMenu(HbAbstractViewItem *index, const QPointF &coords);
     void itemActivated(const QModelIndex &index);
+    void handleSelection();
     void createOptionsMenu();
     void itemsAdded(const QModelIndex &parent, int start, int end);
     void itemsRemoved();
     void showNoMessagesText();
     void handleSyncStateEvent(NmSyncState syncState, const NmId & mailboxId);
     void handleConnectionEvent(NmConnectState connectState, const NmId &mailboxId);
-
+    void folderSelected(NmId mailbox, NmId folder);
+    
 private:
-    void refreshList();
     void loadViewLayout();
     void initTreeView();
     void setMailboxName();
     void createToolBar();
+    void setFolderName();
 
 private:
     NmApplication &mApplication;
@@ -87,6 +92,9 @@
     HbLabel *mNoMessagesLabel;              // Not owned
     HbLabel *mFolderLabel;                  // Not owned
     HbLabel *mSyncIcon;                     // Not owned
+    QModelIndex mActivatedIndex;
+    bool mViewReady;
+    NmFolderType mCurrentFolderType;
 };
 
 #endif /* NMMESSAGELISTVIEW_H_ */
--- a/emailuis/nmailui/inc/nmmessagelistviewitem.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/inc/nmmessagelistviewitem.h	Fri May 14 15:41:10 2010 +0300
@@ -40,8 +40,6 @@
 public:
     explicit NmMessageListViewItem(QGraphicsItem *parent = 0);
     virtual ~NmMessageListViewItem();
-    enum { ItemType = Hb::ItemType_Last + 2 };
-    int type() const;
     void updateChildItems();
     HbTreeViewItem *createItem();
     bool canSetModelIndex(const QModelIndex &index) const;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailui/inc/nmmessagesearchlistview.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,125 @@
+/*
+* 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 NMMESSAGESEARCHLISTVIEW_H_
+#define NMMESSAGESEARCHLISTVIEW_H_
+
+#include "nmbaseview.h"
+#include <nmactionobserver.h>
+#include <QModelIndex>
+
+class HbAbstractViewItem;
+class HbDocumentLoader;
+class HbLabel;
+class HbLineEdit;
+class HbMenu;
+class HbPushButton;
+class HbTreeView;
+
+class NmActionResponse;
+class NmApplication;
+class NmMessageListModelItem;
+class NmMessageSearchListModel;
+class NmUiEngine;
+class NmUiStartParam;
+
+
+class NmMessageSearchListView : public NmBaseView, public NmActionObserver
+{
+    Q_OBJECT
+
+public:
+
+    NmMessageSearchListView(NmApplication &application,
+                            NmUiStartParam *startParam,
+                            NmUiEngine &uiEngine,
+                            NmMessageSearchListModel &searchListModel,
+                            HbDocumentLoader *documentLoader,
+                            QGraphicsItem *parent = 0);
+    ~NmMessageSearchListView();
+
+
+public: // From NmBaseView
+
+    NmUiViewId nmailViewId() const;
+    void viewReady();
+
+
+public: // From NmActionObserver
+
+    void handleActionCommand(NmActionResponse &menuResponse);
+
+
+private: // Data types
+
+    enum NmSearchInputMode {
+        NmNormalMode = 0,
+        NmHighlightedMode,
+        NmDimmedMode
+    };
+
+
+private:
+
+    void loadViewLayout();
+    void initTreeView();
+    void setViewTitle();
+    void noMessagesLabelVisibility(bool visible);
+    void setSearchInputMode(NmSearchInputMode mode);
+
+
+public slots:
+
+    void reloadViewContents(NmUiStartParam *startParam);
+    void contextButton(NmActionResponse &result);
+
+
+private slots:
+
+    void showItemContextMenu(HbAbstractViewItem *index, const QPointF &coords);
+    void itemActivated(const QModelIndex &index);
+    void handleSelection();
+    void itemsAdded(const QModelIndex &parent, int start, int end);
+    void itemsRemoved();
+    void refreshList();
+    void toggleSearch();
+    void handleSearchComplete();
+    void criteriaChanged(QString text);
+
+private: // Data
+
+    NmApplication &mApplication;
+    NmUiEngine &mUiEngine;
+    NmMessageSearchListModel &mSearchListModel;
+    HbDocumentLoader *mDocumentLoader; // Owned
+    QObjectList mWidgetList;
+    HbMenu *mItemContextMenu; // Owned
+    HbTreeView *mMessageListWidget; // Not owned
+    HbLabel *mNoMessagesLabel; // Not owned
+    HbLabel *mInfoLabel; // Not owned
+    HbLineEdit *mLineEdit; // Not owned
+    HbPushButton *mPushButton; // Not owned
+    NmMessageListModelItem *mLongPressedItem; // Not owned
+	QModelIndex mActivatedIndex;
+    bool mViewReady;
+    bool mSearchInProgress;
+};
+
+
+#endif /* NMMESSAGESEARCHLISTVIEW_H_ */
+
+// End of file.
--- a/emailuis/nmailui/inc/nmrecipientfield.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/inc/nmrecipientfield.h	Fri May 14 15:41:10 2010 +0300
@@ -25,9 +25,6 @@
 class NmRecipientLineEdit;
 class HbPushButton;
 class HbIconItem;
-#ifdef Q_OS_SYMBIAN
-class XQAiwRequest;
-#endif
 
 class NmRecipientField : public HbWidget
 {
@@ -62,9 +59,9 @@
 
 private:
     QGraphicsLinearLayout *mLayoutHorizontal;
-    HbLabel *mLabel;                  
+    HbLabel *mLabel;
     NmRecipientLineEdit *mRecipientsEditor;
-    HbPushButton *mLaunchContactsPickerButton;       
+    HbPushButton *mLaunchContactsPickerButton;
     HbIconItem *mAddButtonIcon;
     bool mOwned;
 };
--- a/emailuis/nmailui/inc/nmsendserviceinterface.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/inc/nmsendserviceinterface.h	Fri May 14 15:41:10 2010 +0300
@@ -21,12 +21,12 @@
 
 //  INCLUDES
 #include <QObject>
+#include <QVariant>
 
 #ifdef Q_OS_SYMBIAN
 #include <xqserviceprovider.h>
 #else
 #define NM_WINS_ENV
-#include <QVariant>
 #endif
 
 //  FORWARD DECLARATIONS
@@ -34,10 +34,13 @@
 class NmMailboxListModel;
 class NmUiEngine;
 class NmApplication;
+class NmUiStartParam;
+class NmMailboxSelectionDialog;
 class NmId;
+class HbView;
 
 
-class NmSendServiceInterface 
+class NmSendServiceInterface
 #ifndef NM_WINS_ENV
     : public XQServiceProvider
 #else
@@ -52,29 +55,26 @@
                            QObject *parent,
                            NmUiEngine &mailboxListModel,
                            NmApplication* application);
-
-#ifndef NM_WINS_ENV
-    ~NmSendServiceInterface();
-#else
     virtual ~NmSendServiceInterface();
-#endif
-
 
 public slots:
 
     void send(QVariant data);
-
+    void selectionDialogClosed(NmId &mailboxId);
 
 private:
 
-    bool selectMailbox(NmId &mailboxId);
-
+    void launchEditorView(NmId mailboxId);
+    void cancelService();
 
 private: // Data
 
     NmApplication *mApplication; // Not owned
     NmUiEngine &mUiEngine;
     int mAsyncReqId;
+    NmUiStartParam *mStartParam;
+    NmMailboxSelectionDialog *mSelectionDialog;
+    HbView *mCurrentView;
 };
 
 #endif /* NMSENDSERVICEINTERFACE_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailui/inc/nmuieffects.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,62 @@
+/*
+* 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: Graphical effects/animations for nmail ui.
+*
+*/
+
+#ifndef NMUIEFFECTS_H_
+#define NMUIEFFECTS_H_
+
+#include <QObject>
+#include <hbeffect.h>
+
+class QGraphicsPixmapItem;
+class HbMainWindow;
+
+class NmUiEffects : public QObject
+{
+    Q_OBJECT
+
+public:
+    /*!
+     * \enum NmEffectType
+     * \brief Defines effect to be launched
+     */
+    enum NmUiEffectType
+    {
+        NmNoEffect = 0,
+        // Editor 'exiting' effect when message has been sent.
+        NmEditorSendMessageAnimation
+    };
+
+    NmUiEffects(HbMainWindow &mainWindow);
+    ~NmUiEffects();
+
+    void prepareEffect(NmUiEffectType effect);
+    void startEffect(NmUiEffectType effect);
+
+private:
+    QGraphicsPixmapItem *screenShot();
+    void resetSendAnimation();
+    
+private slots:
+    void sendAnimationComplete(HbEffect::EffectStatus status);
+
+private:
+    HbMainWindow &mMainWindow;
+    QGraphicsPixmapItem *mSendAnimationScreenShot; // Owned
+    bool mDoSendAnimation;
+};
+
+#endif /* NMUIEFFECTS_H_ */
--- a/emailuis/nmailui/inc/nmuiextensionmanager.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/inc/nmuiextensionmanager.h	Fri May 14 15:41:10 2010 +0300
@@ -41,6 +41,7 @@
 
 private:
     void loadExtensionPlugins();
+    QStringList pluginFolders();
 
     QList<NmUiExtensionInterface*> mExtensions;
     QList<QPluginLoader *> mPluginLoaders;
--- a/emailuis/nmailui/inc/nmuiheaders.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/inc/nmuiheaders.h	Fri May 14 15:41:10 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -40,6 +40,8 @@
 #include <QCoreApplication>
 #include <QAbstractItemModel>
 #include <QNetworkDiskCache>
+#include <QWebSettings>
+#include <QPointer>
 
 // Orbit
 #include <hbapplication.h>
@@ -79,6 +81,9 @@
 #include <hbdialog.h>
 #include <hbmessagebox.h>
 #include <hbtoolbarextension.h>
+#include <hbinstance.h>
+#include <hbeffect.h>
+#include <hbmodeliterator.h>
 
 #ifdef Q_OS_SYMBIAN
 #include <cntservicescontact.h>
@@ -93,6 +98,7 @@
 #endif
 
 #include <nmcommon.h>
+
 // nmailuiengine
 #include <nmuiengine.h>
 #include <nmmailboxmetadata.h>
@@ -100,6 +106,7 @@
 #include <nmmailboxlistmodel.h>
 #include <nmmessagelistmodel.h>
 #include <nmmessagelistmodelitem.h>
+#include <nmmessagesearchlistmodel.h>
 #include <nmmessage.h>
 #include <nmaddress.h>
 #include <nmoperation.h>
@@ -107,6 +114,8 @@
 #include <nmaddattachmentsoperation.h>
 #include <nmicons.h>
 #include <nmcheckoutboxoperation.h>
+#include <emailmailboxinfo.h>
+#include <email_services_api.h>
 
 // nmailui
 #include "nmhtmllineedit.h"
@@ -123,6 +132,7 @@
 #include "nmmailboxlistviewitem.h"
 #include "nmmessagelistview.h"
 #include "nmmessagelistviewitem.h"
+#include "nmmessagesearchlistview.h"
 #include "nmviewerview.h"
 #include "nmviewerwebview.h"
 #include "nmviewerheader.h"
@@ -145,6 +155,12 @@
 #include "nmattachmentlistwidget.h"
 #include "nmattachmentlist.h"
 #include "nmeditortextdocument.h"
+#include "nmattachmentmanager.h"
 #include "nmattachmentpicker.h"
+#include "nmattachmentfetchobserver.h"
+#include "nmuieffects.h"
+
+// settingui
+#include "nmsettingsviewlauncher.h"
 
 #endif /* NMUIHEADERS_H_ */
--- a/emailuis/nmailui/inc/nmuiviewids.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/inc/nmuiviewids.h	Fri May 14 15:41:10 2010 +0300
@@ -26,11 +26,12 @@
 
 enum NmUiViewId
 {
-    NmUiViewNone = 0,       // Used to reset view stack
-    NmUiViewMailboxList,    // Mailbox list view
-    NmUiViewMessageList,    // Message list view of a folder
-    NmUiViewMessageViewer,  // Message view of an email message
-    NmUiViewMessageEditor   // Message editor
+    NmUiViewNone = 0,          // Used to reset view stack
+    NmUiViewMailboxList,       // Mailbox list view
+    NmUiViewMessageList,       // Message list view of a folder
+    NmUiViewMessageSearchList, // Message search list view
+    NmUiViewMessageViewer,     // Message view of an email message
+    NmUiViewMessageEditor      // Message editor
 };
 
 enum NmUiEditorStartMode
@@ -39,7 +40,8 @@
     NmUiEditorReply,
     NmUiEditorReplyAll,
     NmUiEditorForward,
-    NmUiEditorMailto
+    NmUiEditorMailto,
+    NmUiEditorFromDrafts
 };
 
 
@@ -179,6 +181,10 @@
         return *mBccAddressList;
     }
 
+    inline void setMailboxId(NmId mailboxId) 
+    {
+        mMailboxId = mailboxId;
+    }
 
 private: // Data
 
--- a/emailuis/nmailui/inc/nmutilities.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/inc/nmutilities.h	Fri May 14 15:41:10 2010 +0300
@@ -63,9 +63,12 @@
 
     static void displayErrorNote(QString noteText); 
 
-    // note: this is not static function
-    void displayOperationCompletionNote(const NmOperationCompletionEvent &event);
+    static bool displayQuestionNote(QString noteText);
     
+    static void displayWarningNote(QString noteText);
+
+    static bool displayOperationCompletionNote(const NmOperationCompletionEvent &event);
+
     static QString createReplyHeader(const NmMessageEnvelope &env);
 };
 
--- a/emailuis/nmailui/inc/nmviewerview.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/inc/nmviewerview.h	Fri May 14 15:41:10 2010 +0300
@@ -18,8 +18,11 @@
 #ifndef NMVIEWERVIEW_H_
 #define NMVIEWERVIEW_H_
 
+#include <QPointer>
+
 #include "nmbaseview.h"
 #include "nmactionobserver.h"
+#include "nmattachmentfetchobserver.h"
 
 class QGraphicsLinearLayout;
 class QWebPage;
@@ -27,7 +30,6 @@
 class HbWidget;
 class HbMainWindow;
 
-
 class NmApplication;
 class NmUiEngine;
 class NmUiStartParam;
@@ -41,8 +43,9 @@
 class NmOperation;
 class HbProgressDialog;
 class NmAttachmentListWidget;
+class NmAttachmentManager;
 
-class NmViewerView : public NmBaseView, public NmActionObserver
+class NmViewerView : public NmBaseView, public NmActionObserver, public NmAttachmentFetchObserver
 {
     Q_OBJECT
 public:
@@ -51,12 +54,18 @@
 				NmUiStartParam* startParam,
 				NmUiEngine &uiEngine,
 				HbMainWindow *mainWindow,
-				bool toolbar = false,
+            NmAttachmentManager &attaManager,
+            bool toolbar = false,
 				QGraphicsItem *parent = NULL);
     ~NmViewerView();
     void reloadViewContents(NmUiStartParam* startParam);
     NmUiViewId nmailViewId() const;
     NmMailViewerWK* webView();
+    void viewReady();
+    void aboutToExitView();
+    
+signals:
+    void progressValueChanged(int index, int value);
 
 public slots:
     void orientationChanged(Qt::Orientation orientation);
@@ -67,24 +76,24 @@
     void handleMousePressEvent(QGraphicsSceneMouseEvent *event);
     void fetchMessage();
     void openAttachment(int index);
-    void changeProgress(int progressValue);
-	void externalDelete(const NmId &messageId);
 	void createOptionsMenu();
-    
-private slots: 
+	void deleteButton(HbAction* result);
+
+private slots:
     void setMessageData();
     void messageFetched(int result);
     void waitNoteCancelled();
     void webFrameLoaded(bool loaded);
     void scaleWebViewWhenLoading(const QSize &size);
     void scaleWebViewWhenLoaded();
-    void attachmentFetchCompleted(int result);
-    
+    void messageDeleted(const NmId &mailboxId, const NmId &folderId, const NmId &messageId);
+
 public: // From NmActionObserver
     void handleActionCommand(NmActionResponse &menuResponse);
 
-signals:
-    void progressValueChanged(int index, int value);
+public: // From NmAttachmentFetchObserver
+    void progressChanged(int value);
+    void fetchCompleted(int result);
 
 private:
     void loadMessage();
@@ -100,16 +109,17 @@
     NmApplication &mApplication;
     NmUiEngine &mUiEngine;
     HbMainWindow *mMainWindow;               // Not owned
-    bool mToolbar;							  // is toolbar or options menu in use
+    NmAttachmentManager  &mAttaManager;
+    bool mToolbarEnabled;					 // is toolbar or options menu in use
     NmMessage* mMessage;                     // Owned
-    NmBaseViewScrollArea *mScrollArea;     // Not owned
+    NmBaseViewScrollArea *mScrollArea;       // Not owned
     HbWidget *mViewerContent;                // Not owned
     NmMailViewerWK *mWebView;                // Not owned
     NmViewerHeader *mHeaderWidget;           // Not owned
     NmAttachmentListWidget *mAttaListWidget;  // Not owned
     QPointF mHeaderStartScenePos;
     QGraphicsLinearLayout *mViewerContentLayout; // Not owned
-    NmOperation *mMessageFetchingOperation;   // Not owned
+    QPointer<NmOperation> mMessageFetchingOperation;   // Not owned 
     QPointF mLatestScrollPos;
     bool mDisplayingPlainText;
     QObjectList mWidgetList;
@@ -118,12 +128,15 @@
     HbWidget *mViewerHeaderContainer;
     QSize mScreenSize;
     HbProgressDialog *mWaitDialog;            // owned
-    bool loadingCompleted;
+    bool webFrameloadingCompleted;
     QSize mLatestLoadingSize;
-    QList<NmId> mAttaIdList; 
-    NmOperation *mFetchOperation;             // owned
+    QList<NmId> mAttaIdList;
     int mAttaIndexUnderFetch;
     NmAttachmentListWidget *mAttaWidget;      // Not owned
+    bool mViewReady;
+    bool mWaitNoteCancelled;
+    HbAction* mOkAction;                        //owned
+    HbAction* mCancelAction;                    //owned
 };
 
 #endif /* NMVIEWERVIEW_H_ */
--- a/emailuis/nmailui/nmailui.pro	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/nmailui.pro	Fri May 14 15:41:10 2010 +0300
@@ -20,8 +20,7 @@
 INCLUDEPATH += . \
     ./inc \
     ../../inc \
-    ../nmailuiwidgets/inc \
-    /epoc32/include/app
+    
 DEFINES += UI_EXTENSION_INTERFACE
 QT += webkit
 QT += network
@@ -29,16 +28,15 @@
 
 LIBS += -leuser
 LIBS += -llibc
+LIBS += -lnmailbase
+LIBS += -lnmailuiengine
+LIBS += -lnmailuiwidgets
+LIBS += -lnmsettingui
+LIBS += -lnmutilities
 
 symbian*: {
     INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
     
-    INCLUDEPATH += /epoc32/include \
-    /epoc32/include/app \
-    /epoc32/include/mw \
-    /sf/mw/qtextensions/qthighway/inc \
-    /sf/mw/qtextensions/qtmobileextensions/include 
-    
     TARGET.UID2 = 0x100039CE
     TARGET.UID3 = 0x200255BA
     TARGET.CAPABILITY = CAP_APPLICATION
@@ -46,29 +44,12 @@
     # TARGET.EPOCSTACKSIZE = 0x6000
     TARGET.EPOCHEAPSIZE = 0x20000 \
         0x1000000
-    LIBS += -lnmailbase \
-        -lnmailuiengine \
-        -lnmailuiwidgets \
-        -lxqservice \
+    LIBS += -lxqservice \
         -lxqserviceutil \
         -lqtcontacts \
         -lmobcntmodel
-
-    # Remove following system includes, when qmake is able to generate those
-    MMP_RULES += "SYSTEMINCLUDE /epoc32/include/mw/hb/hbtools"
-    MMP_RULES += "SYSTEMINCLUDE /epoc32/include/mw/hb/hbfeedback"
 }
 
-win32 {
-    INCLUDEPATH += . \
-        ../../emailservices/nmailbase \
-        ../nmailuiengine
-    DESTDIR = ../../bin
-    LIBS += -L../../bin \
-        -lnmailbase \
-        -lnmailuiengine \
-        -lnmailuiwidgets \
-}
 HEADERS += inc/nmeditorcontent.h \
     inc/nmeditorheader.h \
     inc/nmuiheaders.h \
@@ -80,6 +61,7 @@
     inc/nmviewerviewnetmanager.h \
     inc/nmviewerviewnetreply.h \
     inc/nmmessagelistview.h \
+    inc/nmmessagesearchlistview.h \
     inc/nmbaseview.h \
     inc/nmapplication.h \
     inc/nmmailboxlistviewitem.h \
@@ -101,7 +83,10 @@
     inc/nmutilities.h \
     inc/nmattachmentlist.h \
     inc/nmeditortextdocument.h \
-    inc/nmattachmentpicker.h
+    inc/nmattachmentmanager.h \
+    inc/nmattachmentpicker.h \
+    inc/nmattachmentfetchobserver.h \
+    inc/nmuieffects.h
 
 SOURCES += src/nmeditorcontent.cpp \
     src/nmeditorheader.cpp \
@@ -111,6 +96,7 @@
     src/nmviewerviewnetmanager.cpp \
     src/nmviewerviewnetreply.cpp \
     src/nmmessagelistview.cpp \
+    src/nmmessagesearchlistview.cpp \
     src/nmmailboxlistview.cpp \
     src/nmeditorview.cpp \
     src/nmbaseview.cpp \
@@ -128,7 +114,9 @@
     src/nmutilities.cpp \
     src/nmattachmentlist.cpp \
     src/nmeditortextdocument.cpp \
-    src/nmattachmentpicker.cpp    
+    src/nmattachmentmanager.cpp \
+    src/nmattachmentpicker.cpp \
+    src/nmuieffects.cpp    
 
 RESOURCES += nmailui.qrc
 RESOURCES += nmmessagelistviewitem.qrc
--- a/emailuis/nmailui/nmailui.qrc	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/nmailui.qrc	Fri May 14 15:41:10 2010 +0300
@@ -5,5 +5,9 @@
         <file alias="nmmailboxselectiondialog.docml" >conf/nmmailboxselectiondialog.docml</file>
         <file alias="nmmailviewer.docml" >conf/nmmailviewer.docml</file>
         <file alias="nmmessagelistview.docml" >conf/nmmessagelistview.docml</file>
+        <file alias="nmmessagesearchlistview.docml" >conf/nmmessagesearchlistview.docml</file>
+    </qresource>
+    <qresource prefix="/effects" >
+        <file alias="mail_send.fxml" >resources/mail_send.fxml</file>
     </qresource>
 </RCC>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailui/resources/mail_send.fxml	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,49 @@
+<layers>
+	<visual>
+		<param name="opacity" type="anim">
+			<duration>1.5</duration>
+			<keyframe at="0.0">1.0</keyframe>
+			<keyframe at="1.0">0.0</keyframe>
+			<style>linear</style>
+		</param>
+		<param name="rotation_angle" type="anim">
+			<style>outquad</style>
+			<duration>1.5</duration>
+			<keyframe at="0.0">0.0</keyframe>
+			<keyframe at="1.0">60.0</keyframe>
+		</param>
+		<param name="rotation_origin_x" ref="visual.width">0.5</param>
+		<param name="rotation_origin_y" ref="visual.height">0.5</param>
+		<param name="rotation_axis_x">1</param>
+		<param name="scale_x" type="anim">
+			<style>outquad</style>
+			<duration>1.5</duration>
+			<keyframe at="0.0">1.0</keyframe>
+			<keyframe at="1.0">0.5</keyframe>
+		</param>
+		<param name="scale_origin_x" ref="visual.width">0.5</param>
+		<param name="scale_origin_y" ref="visual.height">0.5</param>
+		<param name="scale_y" type="anim">
+			<style>outquad</style>
+			<duration>1.5</duration>
+			<keyframe at="0.0">1.0</keyframe>
+			<keyframe at="1.0">0.5</keyframe>
+		</param>
+	    <param name="translation_y" type="anim">
+	        <duration>1.5</duration>
+    			<style>inoutquad</style>
+	        <keyframe at="0.0">0.0</keyframe>
+	        <keyframe at="1.0">-1.0</keyframe>
+	        <start ref="visual.top">1.0</start>
+	        <end ref="screen.bottom">1.0</end>
+	    </param>
+	    	  <param name="translation_x" type="anim">
+	        <duration>1.5</duration>
+    			<style>outquad</style>
+	        <keyframe at="0.0">0.0</keyframe>
+	        <keyframe at="1.0">1.0</keyframe>
+	        <start ref="visual.left">1.0</start>
+	        <end ref="screen.left">1.0</end>
+	        </param>
+	</visual>
+</layers>
\ No newline at end of file
--- a/emailuis/nmailui/service_conf.xml	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/service_conf.xml	Fri May 14 15:41:10 2010 +0300
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="utf-8" ?>
 <service>
-  <name>com.nokia.symbian</name>
+  <name>nmail</name>
   <filepath>No path</filepath>
   <description>Nmail</description>
   <interface>
-    <name>IMessage.Send</name>
+    <name>com.nokia.symbian.IFileShare</name>
     <version>1.0</version>
     <description>Send interface</description>
     <customproperty key="txt_aiw_action_text">Attach to new email</customproperty>
@@ -13,17 +13,17 @@
     <customproperty key="aiw_action_icon">qtg_large_email</customproperty>
   </interface>
   <interface>
-    <name>IEmailMessageSend</name>
+    <name>com.nokia.symbian.IEmailMessageSend</name>
     <version>1.0</version>
     <description>Send interface</description>
   </interface>
   <interface>
-    <name>IEmailInboxView</name>
+    <name>com.nokia.symbian.IEmailInboxView</name>
     <version>1.0</version>
     <description>Email inbox interface</description>
   </interface>
   <interface>
-    <name>IEmailMessageView</name>
+    <name>com.nokia.symbian.IEmailMessageView</name>
     <version>1.0</version>
     <description>Email message interface</description>
   </interface>
--- a/emailuis/nmailui/src/nmapplication.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/src/nmapplication.cpp	Fri May 14 15:41:10 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -23,9 +23,7 @@
 #define NM_WINS_ENV
 #endif
 
-static const qreal nmCacheSize = 2097152;
-static const char *NMUI_CACHE_DIR = "cache";
-static const QString NmSendServiceName = "com.nokia.symbian.IMessage.Send";
+static const QString NmSendServiceName = "nmail.com.nokia.symbian.IFileShare";
 
 /*!
 	\class NmApplication
@@ -46,13 +44,15 @@
 mMbListModel(NULL),
 mServiceViewId(NmUiViewNone),
 mForegroundService(false),
-mUtilities(NULL)
+mEffects(NULL),
+mAttaManager(NULL),
+mSettingsViewLauncher(NULL),
+mViewReady(false)
 {
     // Create network access manager and cache for application use.
     mNetManager = new NmViewerViewNetManager();
     QNetworkDiskCache *cache = new QNetworkDiskCache();
-    cache->setCacheDirectory(NMUI_CACHE_DIR);
-    cache->setMaximumCacheSize(nmCacheSize);
+    cache->setCacheDirectory(QDesktopServices::storageLocation(QDesktopServices::CacheLocation));
     mNetManager->setCache(cache);
 
     // TEMPORARY WORKAROUND TO PREVENT PANIC User panic 66, where there is
@@ -64,17 +64,21 @@
     #endif
     createMainWindow();
 
+    // attachment manager can be shared between viewer and editor, ownership in application class
+    mAttaManager = new NmAttachmentManager(*mUiEngine);
+
 #ifndef NM_WINS_ENV
     mSendServiceInterface =
             new NmSendServiceInterface(NmSendServiceName, NULL, *mUiEngine, this);
     mSendServiceInterface2 =
-            new NmSendServiceInterface(emailInterfaceNameSend, NULL, *mUiEngine, this);
+            new NmSendServiceInterface(emailFullServiceNameSend, NULL, *mUiEngine, this);
     mMailboxServiceInterface =
             new NmMailboxServiceInterface(NULL, *mUiEngine, this);
     mViewerServiceInterface =
             new NmViewerServiceInterface(NULL, this, *mUiEngine);
 #endif
-    mUtilities = new NmUtilities();
+
+    mEffects = new NmUiEffects(*mMainWindow);
 }
 
 /*!
@@ -103,8 +107,10 @@
     delete mNetManager;
     mNetManager=NULL;
     }
-    delete mUtilities;
     delete mMainWindow;
+    delete mAttaManager;
+    delete mEffects;
+    delete mSettingsViewLauncher;
 }
 
 /*!
@@ -134,6 +140,10 @@
     // Create main window
     mMainWindow = new HbMainWindow();
 
+    // Connect to lazy loading signal
+    QObject::connect(mMainWindow, SIGNAL(viewReady ()),
+                     this, SLOT(viewReady()));
+
     // Create extension manager
     mExtensionManager = new NmUiExtensionManager();
 
@@ -144,7 +154,7 @@
     if (mMainWindow) {
         mBackAction = new HbAction(Hb::BackNaviAction,this);
         connect(mBackAction, SIGNAL(triggered()), this, SLOT(popView()));
-        // Show main window
+        // Show mainwindow
         mMainWindow->show();
     }
 
@@ -161,33 +171,94 @@
         NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMailboxList);
         enterNmUiView(startParam);
     }
+
+    // Start to filter main window events to get "end key" event in all possible situations. Using
+    // event() is not enough to catch the event as it is only called if the view widget has the 
+    // focus. Note: if key capturing (xqkeycapture.h) is required it is probably best to implement 
+    // an own QMainWindow class and do the capturing there, not in the views.
+    mMainWindow->installEventFilter(this);
+}
+
+/*!
+    Slot. React to view ready signal and call
+    current view method.
+*/
+void NmApplication::viewReady()
+{
+    mViewReady = true;
+    if (!mViewStack->isEmpty()) {
+    	NmBaseView *currentView = mViewStack->top();
+        if (currentView){
+            currentView->viewReady();
+        }
+    }
+}
+
+/*!
+    Event filter. End key is filtered from the main window and either the view takes case of the
+	or the app is exited by default.
+*/
+bool NmApplication::eventFilter(QObject *obj, QEvent *event)
+{
+    bool consumed = false;
+    
+    if (obj && obj == mMainWindow && event && event->type() == QEvent::KeyPress) {
+        QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
+        
+        if (keyEvent->key() == Qt::Key_No) { // end key, the "red" key
+            
+            // exit application if no pending operations are on-going
+        }
+    }
+    
+    if (!consumed) {
+        consumed = QObject::eventFilter(obj, event);
+    }
+    
+    return consumed;
 }
 
 /*!
     Push view to view stack
 */
-void NmApplication::pushView(NmBaseView *view)
+void NmApplication::pushView(NmBaseView *newView)
 {
     NMLOG("nmailui: pushView enter");
-    if (view) {
-        view->setNavigationAction(mBackAction);
+    if (newView) {
         NMLOG("nmailui: view exists");
-    	if (!mViewStack->isEmpty()) {
-        	NmBaseView *hideView = mViewStack->top();
-        	NMLOG("nmailui: removeView");
-            mMainWindow->removeView(hideView);
+        newView->setNavigationAction(mBackAction);
+
+        // Store view to be hidden
+        NmBaseView *hideView(NULL);
+        if (!mViewStack->isEmpty()) {
+            hideView = mViewStack->top();
         }
+		else {
+			// viewReady should be informed immediatelly
+			if (mViewReady) {
+				newView->viewReady();
+			}
+		}
+
+        // activate new view
     	NMLOG("nmailui: addView");
-        mMainWindow->addView(view);
-        mViewStack->push(view);
-        mActiveViewId=view->nmailViewId();
+        mMainWindow->addView(newView);
+        mViewStack->push(newView);
+        mMainWindow->setCurrentView(newView);
+        mActiveViewId=newView->nmailViewId();
 
-        //set toolbars orientation
-        HbToolBar *tb = view->toolBar();
+        // Set toolbars orientation
+        HbToolBar *tb = newView->toolBar();
         if(tb){
             tb->setOrientation(Qt::Horizontal);
         }
 
+        // hide old view
+        NMLOG("nmailui: removeView");
+        if (hideView){
+            mMainWindow->removeView(hideView);
+        }
+
         NMLOG("nmailui: pushView done");
     }
 }
@@ -204,10 +275,15 @@
 
         // ask view if it's ok to exit
         if (view->okToExitView()) {
+            NmUiViewId topViewId = view->nmailViewId();
+
+            // Prepare for send animation if returing from editor and message has been sent.
+            if (topViewId == NmUiViewMessageEditor && mUiEngine->isSendingMessage()) {
+                mEffects->prepareEffect(NmUiEffects::NmEditorSendMessageAnimation);
+            }
             mViewStack->pop();
             // Call custom exit function
             view->aboutToExitView();
-            NmUiViewId topViewId = view->nmailViewId();
             // Remove view from stack.
             mMainWindow->removeView(view);
 
@@ -226,8 +302,11 @@
                 // Activate next view in stack
                 NmBaseView *showView = mViewStack->top();
                 mMainWindow->addView(showView);
+                mMainWindow->setCurrentView(showView);
                 // Store activated view id
                 mActiveViewId=showView->nmailViewId();
+                // Perform send animation if requested.
+                mEffects->startEffect(NmUiEffects::NmEditorSendMessageAnimation);
             }
 
             delete view;
@@ -292,11 +371,11 @@
 			// When the message list is started as a service previous views are removed
 			// from the stack. Open editors are not closed.
 			// Also if the view is same than the new one, keep it open (reload the content).
-			
+
 		    // at least one view must remain in the stack
-			while (mViewStack->count()>1) { 
+			while (mViewStack->count()>1) {
 			    NmUiViewId topId = mViewStack->top()->nmailViewId();
-			    if (topId!=NmUiViewMessageEditor && 
+			    if (topId!=NmUiViewMessageEditor &&
 			        topId!=NmUiViewMailboxList &&
 			        topId!=startParam->viewId()) {
 			        popView();
@@ -307,7 +386,7 @@
 			    }
 			}
         }
-        
+
         // Check whether requested view is already active
         // and if so, ask it to reload contents with new start parameter data
         // Do not reuse the view if started as service to editor view (ShareUI)
@@ -329,7 +408,7 @@
                 {
                     // Check the topmost view. If it is an editor, do not open
                     // a new mail list view
-                    if (startParam->service() && !mViewStack->isEmpty() && 
+                    if (startParam->service() && !mViewStack->isEmpty() &&
                         mViewStack->top()->nmailViewId()==NmUiViewMessageEditor) {
                         break;
                     }
@@ -341,8 +420,32 @@
                     pushView(msgList);
                 }
                 break;
+                case NmUiViewMessageSearchList:
+                {
+                    // Check the topmost view. If it is an editor, do not open
+                    // a new mail search list view.
+                    if (startParam->service() && !mViewStack->isEmpty() && 
+                        mViewStack->top()->nmailViewId() == NmUiViewMessageEditor) {
+                        break;
+                    }
+
+                    NmMessageListModel &messageListModel =
+                        mUiEngine->messageListModel(startParam->mailboxId(),
+                                                    startParam->folderId());
+
+                    NmMessageSearchListModel &searchListModel =
+                        mUiEngine->messageSearchListModel(&messageListModel);
+
+                    NmMessageSearchListView *searchListView = new NmMessageSearchListView(
+                        *this, startParam, *mUiEngine, searchListModel,
+                        new HbDocumentLoader(mMainWindow));
+
+                    pushView(searchListView);
+                }
+                break;
                 case NmUiViewMessageViewer:
-                    pushView(new NmViewerView(*this, startParam, *mUiEngine, mMainWindow));
+                    pushView(new NmViewerView(*this, startParam, *mUiEngine, 
+                            mMainWindow, *mAttaManager));
                     break;
                 case NmUiViewMessageEditor:
                     pushView(new NmEditorView(*this, startParam, *mUiEngine));
@@ -458,5 +561,28 @@
 */
 void NmApplication::handleOperationCompleted(const NmOperationCompletionEvent &event)
 {
-    mUtilities->displayOperationCompletionNote(event);
+    bool openSettings = NmUtilities::displayOperationCompletionNote(event);
+    if(openSettings) {
+        launchSettings(event.mMailboxId);
+    }
 }
+
+/*!
+    launches settings view of the specified mailbox
+*/
+void NmApplication::launchSettings(const NmId &mailboxId)
+{
+    // create settingslauncher if doesn't exist
+    if(!mSettingsViewLauncher) {
+        mSettingsViewLauncher = new NmSettingsViewLauncher();
+        }
+
+    if(mSettingsViewLauncher) {
+        // mailboxname required
+        NmMailboxMetaData *mailboxMetaData = mUiEngine->mailboxById(mailboxId); // no ownership
+        if( mailboxMetaData ) {
+            // launch
+            mSettingsViewLauncher->launchSettingsView(mailboxId, mailboxMetaData->name());
+        }
+    }
+}
--- a/emailuis/nmailui/src/nmattachmentlist.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/src/nmattachmentlist.cpp	Fri May 14 15:41:10 2010 +0300
@@ -17,8 +17,6 @@
 
 #include "nmuiheaders.h"
 
-#define AttachmentFileNameMaxLength 17
-
 /*!
 	\class NmAttachmentList
 	\brief Class for handling the attachment list
@@ -56,7 +54,7 @@
     mFileSize.append(fileSize);
     mListWidget.insertAttachment(
         count() - 1,
-        NmUtilities::truncate(displayName, AttachmentFileNameMaxLength), 
+        displayName, 
         NmUtilities::attachmentSizeString(fileSize.toDouble()));  
     updateLayout();
     return count() - 1;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailui/src/nmattachmentmanager.cpp	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,160 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "nmuiheaders.h"
+
+const int NmAttachmentManagerInitialProgressPercent = 5;
+
+/*!
+    \class NmAttachmentManager
+    \brief Attachment download manager, shares attachment download between editor and viewer
+*/
+
+/*!
+
+*/
+NmAttachmentManager::NmAttachmentManager(NmUiEngine &uiEngine) :
+    mUiEngine(uiEngine),
+    mFetchOperation(NULL),
+    mFetchObserver(NULL),
+    mAttaId(0),
+    mProgressValue(0),
+    mIsFetching(false)
+{
+
+}
+
+/*!
+
+*/
+NmAttachmentManager::~NmAttachmentManager()
+{
+    // cancel fetch
+    cancelFetch();
+}
+
+/*!
+    Starts attachment fetch. If earlier fetch operation exist it is cancelled.
+    Set observer with setObserver method to get process and complete events
+*/
+void NmAttachmentManager::fetchAttachment(
+        const NmId &mailboxId, 
+        const NmId &folderId, 
+        const NmId &messageId, 
+        const NmId &messagePartId)
+{
+    // cancel old fetch operation, Does nothing if fetch not ongoing
+    cancelFetch();
+
+    mFetchOperation = mUiEngine.fetchMessagePart(
+            mailboxId, folderId, messageId, messagePartId);
+    
+    if (mFetchOperation) {
+        mAttaId = messagePartId;
+        mIsFetching = true;
+        QObject::connect(mFetchOperation, SIGNAL(operationCompleted(int)),
+                this, SLOT(attachmentFetchCompleted(int)));
+        
+        QObject::connect(mFetchOperation, SIGNAL(operationProgressChanged(int)),
+                this, SLOT(changeProgress(int)));
+        // set progress to 5 % already in start
+        changeProgress(NmAttachmentManagerInitialProgressPercent);
+    }
+}
+
+/*!
+    Retruns true if fetch operation is ongoing
+*/
+bool NmAttachmentManager::isFetching() const
+{
+    return mIsFetching;
+}
+
+/*!
+    Retrunrs part id of attachment if fetch operation is ongoing. Zero id is returned otherwise
+*/
+NmId NmAttachmentManager::partIdUnderFetch() const
+{
+    return mAttaId;
+}
+
+/*!
+    Cancels fetch operation. Does nothing if fetch not ongoing
+*/
+void NmAttachmentManager::cancelFetch()
+{
+    if (mFetchOperation && mFetchOperation->isRunning()) { 
+        mFetchOperation->cancelOperation();
+    }
+    mIsFetching = false;
+    mAttaId = 0;
+    mProgressValue = 0;
+}
+
+/*!
+    Used by message part fetch operation
+*/
+void NmAttachmentManager::changeProgress(int value)
+{
+    if (mFetchObserver && value > mProgressValue) {
+        mProgressValue = value;
+        mFetchObserver->progressChanged(value);
+    }
+}
+
+/*!
+    Used by message part fetch operation
+*/
+void NmAttachmentManager::attachmentFetchCompleted(int result)
+{
+    if (mFetchObserver) {
+        mFetchObserver->fetchCompleted(result);
+    }
+    mAttaId = 0;
+    mProgressValue = 0;
+    mIsFetching = false;
+}
+
+/*!
+    Sets fetch observer
+*/
+void NmAttachmentManager::setObserver(NmAttachmentFetchObserver *observer)
+{
+    mFetchObserver = observer;
+    // send progress event wheng observer changes if fetch ongoing 
+    // to get progress bar updating
+    if (mIsFetching) {
+        changeProgress(mProgressValue);
+    }
+}
+
+/*!
+    Clear observer
+*/
+void NmAttachmentManager::clearObserver()
+{
+    mFetchObserver = NULL;
+}
+
+/*!
+    Returns progress value if fetch ongoing. Otherwise returns 0.
+*/
+int NmAttachmentManager::progressValue() const
+{
+    return mProgressValue;
+}
+
--- a/emailuis/nmailui/src/nmattachmentpicker.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/src/nmattachmentpicker.cpp	Fri May 14 15:41:10 2010 +0300
@@ -78,11 +78,10 @@
 void NmAttachmentPicker::fetch(const QString& interface, 
     const QString& operation)
 {
-    if (mRequest) {
-        delete mRequest;
-        mRequest = NULL;
-    }	
-    mRequest = mAppmgr.create(interface, operation, true);
+    delete mRequest;
+    mRequest = NULL;
+    XQApplicationManager appMgr;
+    mRequest = appMgr.create(interface, operation, true);
 
     if (mRequest) {
         mRequest->setSynchronous(false);
@@ -92,13 +91,6 @@
         connect(mRequest, SIGNAL(requestError(int, const QString&)),
                 this, SIGNAL(attachmentsFetchError(int, const QString&)));
         
-        if (!(mRequest)->send()) {
-            //sending request failed
-            NMLOG("appmgr: send request failed");
-        }
-    }
-    else {
-        //create request failed
-        NMLOG("appmgr: create request failed");
-    }      	  
+        mRequest->send();
+    } 
 }
--- a/emailuis/nmailui/src/nmbaseview.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/src/nmbaseview.cpp	Fri May 14 15:41:10 2010 +0300
@@ -60,6 +60,15 @@
 }
 
 /*!
+    view ready. Function is called after mainwindow has received viewReady
+    lazy loading signal. Views can choose to implement this function
+    if it makes sense to construct items after main view is shown. 
+*/
+void NmBaseView::viewReady()
+{    
+}
+
+/*!
     About to change orientation. View can override this function if special
     handling is needed for the view when orientation is about to change.
 */
--- a/emailuis/nmailui/src/nmeditorcontent.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/src/nmeditorcontent.cpp	Fri May 14 15:41:10 2010 +0300
@@ -51,9 +51,12 @@
     mEditorWidget->setDocument(textDocument); 
     textDocument->setParent(mEditorWidget); // ownership changes
 
-    mEditorWidget->init(this, mBackgroundScrollArea);
-    
-    // Remove the comment to enable style picker menu item.
+    mEditorWidget->init(mBackgroundScrollArea);
+    // we are interested in the editor widget's height changes
+    connect(mEditorWidget, SIGNAL(editorContentHeightChanged()), this,
+        SLOT(setEditorContentHeight()));
+
+    // Enable style picker menu item.
     mEditorWidget->setFormatDialog(new HbFormatDialog());
 
     // Create signal slot connections
@@ -112,7 +115,7 @@
     // Original message text to editor content fiel
     if (replyMsgEnvelope && mEditorWidget) {          
         QTextCursor cursor = mEditorWidget->textCursor();
-        cursor.setPosition(1);
+        cursor.setPosition(0);
         cursor.insertHtml(NmUtilities::createReplyHeader(*replyMsgEnvelope));
     }
 }  
--- a/emailuis/nmailui/src/nmeditorheader.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/src/nmeditorheader.cpp	Fri May 14 15:41:10 2010 +0300
@@ -75,7 +75,6 @@
     // To: field objects
     HbLabel *toLabel = qobject_cast<HbLabel *>
         (mDocumentLoader->findWidget(NMUI_EDITOR_TO_LABEL));
-    toLabel->setPlainText(hbTrId("txt_mail_editor_to"));
     NmRecipientLineEdit *toEdit = qobject_cast<NmRecipientLineEdit *>
         (mDocumentLoader->findWidget(NMUI_EDITOR_TO_EDIT));
     HbPushButton *toButton = qobject_cast<HbPushButton *>
@@ -94,7 +93,6 @@
     // Add Subject: field
     mSubjectLabel = qobject_cast<HbLabel *>
         (mDocumentLoader->findWidget(NMUI_EDITOR_SUBJECT_LABEL));
-    mSubjectLabel->setPlainText(hbTrId("txt_mail_editor_subject"));
     mSubjectEdit = qobject_cast<NmHtmlLineEdit *>
         (mDocumentLoader->findWidget(NMUI_EDITOR_SUBJECT_EDIT));
 
@@ -424,12 +422,9 @@
  */
 void NmEditorHeader::attachmentActivated(int arrayIndex)
 {
-    const char *engineerText="Unable to open. Attachment file type not supported";
-    const char *localizedText="txt_mail_dialog_unable_to_open_attachment_file_ty";
-	
     QFile launchFile(mAttachmentList->getFullFileNameByIndex(arrayIndex));
     if (NmUtilities::openFile( launchFile ) == NmNotFoundError) {
-        NmUtilities::displayErrorNote( QObject::tr(engineerText, localizedText) ); 
+        NmUtilities::displayErrorNote(hbTrId("txt_mail_dialog_unable_to_open_attachment_file_ty")); 
     }
 }
 
--- a/emailuis/nmailui/src/nmeditortextdocument.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/src/nmeditortextdocument.cpp	Fri May 14 15:41:10 2010 +0300
@@ -40,9 +40,11 @@
 */
 NmEditorTextDocument::~NmEditorTextDocument()
 {
-    for(int i = 0; i < mReplyList.count(); i++) {
-        mReplyList.at(i)->abort();
-        mReplyList.at(i)->deleteLater();
+    foreach(QNetworkReply *reply, mReplyList) {
+        if(reply) {
+            reply->abort();
+            reply->deleteLater();
+        }
     }
 }
 
@@ -51,15 +53,17 @@
 */
 void NmEditorTextDocument::replyFinished(QNetworkReply *reply)
 {
-    if(reply->error() == QNetworkReply::NoError) {
-        QPixmap image;
-        if(image.loadFromData(reply->readAll())) { 
-            addResource(QTextDocument::ImageResource, reply->url(), QVariant(image));
-            emit documentLayoutChanged();
+    if(reply) {
+        if(reply->error() == QNetworkReply::NoError) {
+            QPixmap image;
+            if(image.loadFromData(reply->readAll())) { 
+                addResource(QTextDocument::ImageResource, reply->url(), QVariant(image));
+                emit documentLayoutChanged();
+            }
         }
+        mReplyList.removeAll(reply);
+        reply->deleteLater();
     }
-    mReplyList.removeAll(reply);
-    reply->deleteLater();
 }
 
 /*!
--- a/emailuis/nmailui/src/nmeditorview.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/src/nmeditorview.cpp	Fri May 14 15:41:10 2010 +0300
@@ -22,7 +22,7 @@
 static const char *NMUI_EDITOR_SCROLL_AREA = "scrollArea";
 static const char *NMUI_EDITOR_SCROLL_AREA_CONTENTS = "scrollAreaContents";
 
-static const int nmOrientationTimer=100;
+static const int NmOrientationTimer=100;
 
 static const QString Delimiter("; ");
 
@@ -59,12 +59,10 @@
     mDocumentLoader	= new HbDocumentLoader();
     // Set object name
     setObjectName("NmEditorView");
+    // Set mailbox name to title pane
+    setMailboxName();
     // Load view layout
     loadViewLayout();
-    // Set mailbox name to title pane
-    setMailboxName();
-    // Set message data
-    setMessageData();
 }
 
 /*!
@@ -72,12 +70,18 @@
 */
 NmEditorView::~NmEditorView()
 {
-    // It is clearer that the operations are not owned by parent QObject as
-    // they are not allocated in the constructor.
-    delete mRemoveAttachmentOperation;
-    delete mAddAttachmentOperation;
-    delete mMessageCreationOperation;
-    delete mCheckOutboxOperation;
+    if (mRemoveAttachmentOperation && mRemoveAttachmentOperation->isRunning()) {
+        mRemoveAttachmentOperation->cancelOperation();
+    }
+    if (mAddAttachmentOperation && mAddAttachmentOperation->isRunning()) {
+        mAddAttachmentOperation->cancelOperation();
+    }
+    if (mMessageCreationOperation && mMessageCreationOperation->isRunning()) {
+        mMessageCreationOperation->cancelOperation();
+    }
+    if (mCheckOutboxOperation && mCheckOutboxOperation->isRunning()) {
+        mCheckOutboxOperation->cancelOperation();
+    }
     delete mMessage;
     mWidgetList.clear();
     delete mDocumentLoader;
@@ -123,43 +127,11 @@
         // Set default color for user - entered text if editor is in re/reAll/fw mode
         NmUiEditorStartMode mode = mStartParam->editorStartMode();
         if (mode == NmUiEditorReply || mode == NmUiEditorReplyAll || mode == NmUiEditorForward) {
-        mEditWidget->setCustomTextColor(true, Qt::blue);
+            mEditWidget->setCustomTextColor(true, Qt::blue);
         }
-    }
-
-    // Connect signals from background scroll area
-    connect(mScrollArea, SIGNAL(handleMousePressEvent(QGraphicsSceneMouseEvent*)),
-            this, SLOT(sendMousePressEventToScroll(QGraphicsSceneMouseEvent*)));
-    connect(mScrollArea, SIGNAL(handleMouseReleaseEvent(QGraphicsSceneMouseEvent*)),
-            this, SLOT(sendMouseReleaseEventToScroll(QGraphicsSceneMouseEvent*)));
-    connect(mScrollArea, SIGNAL(handleMouseMoveEvent(QGraphicsSceneMouseEvent*)),
-            this, SLOT(sendMouseMoveEventToScroll(QGraphicsSceneMouseEvent*)));
-
-    connect(mScrollArea, SIGNAL(handleLongPressGesture(const QPointF &)),
-                this, SLOT(sendLongPressGesture(const QPointF &)));
 
-    // Connect options menu about to show to create options menu function
-    // Menu needs to be create "just-in-time"
-    connect(menu(), SIGNAL(aboutToShow()), this, SLOT(createOptionsMenu()));
-    NmAction *dummy = new NmAction(0);
-    menu()->addAction(dummy);
-
-    initializeVKB();
-    connect(mContentWidget->header(), SIGNAL(recipientFieldsHaveContent(bool)),
-            this, SLOT(setButtonsDimming(bool)) );
-
-    // call the createToolBar on load view layout
-    createToolBar();
-
-    // Set dimensions
-    adjustViewDimensions();
-	
-    // Connect to observe orientation change events
-    connect(mApplication.mainWindow(), SIGNAL(orientationChanged(Qt::Orientation)),
-            this, SLOT(orientationChanged(Qt::Orientation)));
-    // Signal for handling the attachment list selection
-    connect(mHeaderWidget, SIGNAL(attachmentLongPressed(NmId, QPointF)),
-            this, SLOT(attachmentLongPressed(NmId, QPointF)));
+        // the rest of the view initialization is done in viewReady()
+    }
 }
 
 /*!
@@ -199,8 +171,8 @@
 {
     Q_UNUSED(orientation);
     // Adjust content height
-    QTimer::singleShot(nmOrientationTimer, this, SLOT(adjustViewDimensions()));
-    QTimer::singleShot(nmOrientationTimer, mHeaderWidget, SLOT(sendHeaderHeightChanged()));
+    QTimer::singleShot(NmOrientationTimer, this, SLOT(adjustViewDimensions()));
+    QTimer::singleShot(NmOrientationTimer, mHeaderWidget, SLOT(sendHeaderHeightChanged()));
 }
 
 /*!
@@ -238,11 +210,11 @@
 {
     bool okToExit = true;
 
+    NmEditorHeader *header = mContentWidget->header();
+    
     // show the query if the message has not been sent
-    if (mMessage && mContentWidget->header()) {
+    if (mMessage && header) {
         // see if editor has any content
-        NmEditorHeader *header = mContentWidget->header();
-
         int toTextLength = 0;
         if (header->toField()) {
             toTextLength = header->toField()->text().length();
@@ -263,18 +235,16 @@
             subjectLength = header->subjectField()->text().length();
         }
         
+        QList<NmMessagePart*> attachmentList;
+        mMessage->attachmentList(attachmentList);
+                    
         okToExit = (toTextLength == 0 && ccTextLength == 0 && bccTextLength == 0 && 
-            subjectLength == 0 && mContentWidget->editor()->document()->isEmpty());
+            subjectLength == 0 && mContentWidget->editor()->document()->isEmpty() &&
+            attachmentList.count() < 1);
 
         // content exists, verify exit from user
         if (!okToExit) {
-            HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
-            messageBox->setText(hbTrId("txt_mail_dialog_delete_message"));
-            messageBox->setTimeout(HbMessageBox::NoTimeout);
-        
-            // Read user selection
-            HbAction *action = messageBox->exec(); 
-            okToExit = (action == messageBox->primaryAction());
+            okToExit = NmUtilities::displayQuestionNote(hbTrId("txt_mail_dialog_delete_message"));
         }
     }
 
@@ -314,27 +284,74 @@
         }
 
         // Display the wait dialog.
-        mWaitDialog->exec();
+        mWaitDialog->setModal(false);
+        mWaitDialog->setBackgroundFaded(false);
+        mWaitDialog->show();
         delete mWaitDialog;
         mWaitDialog = NULL;
     }
 
     // These operations need to be stopped before message can be deleted
-    delete mAddAttachmentOperation;
-    mAddAttachmentOperation = NULL;
-    delete mRemoveAttachmentOperation;
-    mRemoveAttachmentOperation = NULL;
+    if (mAddAttachmentOperation && mAddAttachmentOperation->isRunning()) {
+        mAddAttachmentOperation->cancelOperation();
+    }
+    if (mRemoveAttachmentOperation && mRemoveAttachmentOperation->isRunning()) {
+        mRemoveAttachmentOperation->cancelOperation();
+    }
 
     if (mMessage) { // this is NULL if sending is started
         // Delete message from drafts
-        NmId mailboxId = mMessage->mailboxId();
-        NmId folderId = mMessage->parentId();
-        NmId msgId = mMessage->envelope().id();
+        NmId mailboxId = mMessage->envelope().mailboxId();
+        NmId folderId = mMessage->envelope().folderId();
+        NmId msgId = mMessage->envelope().messageId();
         mUiEngine.removeMessage(mailboxId, folderId, msgId);
     }
 }
 
 /*!
+    Lazy loading when view layout has been loaded
+*/
+void NmEditorView::viewReady()
+{
+    // Connect signals from background scroll area
+    connect(mScrollArea, SIGNAL(handleMousePressEvent(QGraphicsSceneMouseEvent*)),
+            this, SLOT(sendMousePressEventToScroll(QGraphicsSceneMouseEvent*)));
+    connect(mScrollArea, SIGNAL(handleMouseReleaseEvent(QGraphicsSceneMouseEvent*)),
+            this, SLOT(sendMouseReleaseEventToScroll(QGraphicsSceneMouseEvent*)));
+    connect(mScrollArea, SIGNAL(handleMouseMoveEvent(QGraphicsSceneMouseEvent*)),
+            this, SLOT(sendMouseMoveEventToScroll(QGraphicsSceneMouseEvent*)));
+
+    connect(mScrollArea, SIGNAL(handleLongPressGesture(const QPointF &)),
+                this, SLOT(sendLongPressGesture(const QPointF &)));
+
+    // Connect options menu about to show to create options menu function
+    // Menu needs to be create "just-in-time"
+    connect(menu(), SIGNAL(aboutToShow()), this, SLOT(createOptionsMenu()));
+    NmAction *dummy = new NmAction(0);
+    menu()->addAction(dummy);
+
+    initializeVKB();
+    connect(mContentWidget->header(), SIGNAL(recipientFieldsHaveContent(bool)),
+            this, SLOT(setButtonsDimming(bool)) );
+
+    // call the createToolBar on load view layout
+    createToolBar();
+
+    // Set dimensions
+    adjustViewDimensions();
+	
+    // Connect to observe orientation change events
+    connect(mApplication.mainWindow(), SIGNAL(orientationChanged(Qt::Orientation)),
+            this, SLOT(orientationChanged(Qt::Orientation)));
+    // Signal for handling the attachment list selection
+    connect(mHeaderWidget, SIGNAL(attachmentLongPressed(NmId, QPointF)),
+            this, SLOT(attachmentLongPressed(NmId, QPointF)));
+    
+    // Set message data
+    setMessageData();
+}
+
+/*!
     Find message data based on start parameters.  Method is called
     when editor is started. If message data is found it means that
     operation is forward or reply message.
@@ -342,8 +359,10 @@
 void NmEditorView::setMessageData()
 {
     // Check the outbox.
-    delete mCheckOutboxOperation;
-    mCheckOutboxOperation = NULL;
+    if (mCheckOutboxOperation && mCheckOutboxOperation->isRunning()) {
+        mCheckOutboxOperation->cancelOperation();
+        NMLOG("NmEditorView::setMessageData old mCheckOutboxOperation running");
+    }
 	
     mCheckOutboxOperation = mUiEngine.checkOutbox(mStartParam->mailboxId());
     
@@ -360,12 +379,14 @@
 */
 void NmEditorView::startMessageCreation(NmUiEditorStartMode startMode)
 {
+    NMLOG("NmEditorView::startMessageCreation ");
     NmId mailboxId = mStartParam->mailboxId();
     NmId folderId = mStartParam->folderId();
     NmId msgId = mStartParam->messageId();
     
-    delete mMessageCreationOperation;
-    mMessageCreationOperation = NULL;
+    if (mMessageCreationOperation && mMessageCreationOperation->isRunning()) {
+        mMessageCreationOperation->cancelOperation();
+    }
 	
     // original message is now fetched so start message creation
     if (startMode == NmUiEditorForward) {
@@ -407,16 +428,10 @@
     if (invalidAddresses.count() > 0) {
         
         // invalid addresses found, verify send from user
-        HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
         QString noteText = hbTrId("txt_mail_dialog_invalid_mail_address_send");
         // set the first failing address to the note
         noteText = noteText.arg(invalidAddresses.at(0).address());
-        messageBox->setText(noteText);
-        messageBox->setTimeout(HbMessageBox::NoTimeout);
-
-        // Read user selection
-        HbAction *action = messageBox->exec();
-        okToSend = (action == messageBox->primaryAction());
+        okToSend = NmUtilities::displayQuestionNote(noteText);
     }
     
     if (okToSend) {
@@ -424,14 +439,11 @@
         preliminaryOperations.append(mAddAttachmentOperation);
         preliminaryOperations.append(mRemoveAttachmentOperation);
         // ownership of mMessage is transferred
-        // ownerships of NmOperations in preliminaryOperations are transferred
+        // NmOperations are automatically deleted after completion
         mUiEngine.sendMessage(mMessage, preliminaryOperations);
         mMessage = NULL;
-        mAddAttachmentOperation = NULL;
-        mRemoveAttachmentOperation = NULL;
         preliminaryOperations.clear();
-        // sending animation should be shown here, then exit
-        QTimer::singleShot(1000, &mApplication, SLOT(popView()));
+        mApplication.popView();
     }
 }
 
@@ -587,9 +599,9 @@
     NmMessagePart *plainPart = mMessage->plainTextBodyPart();
 
     if (plainPart) {
-        mUiEngine.contentToMessagePart(mMessage->mailboxId(),
-                                       mMessage->parentId(),
-                                       mMessage->envelope().id(),
+        mUiEngine.contentToMessagePart(mMessage->envelope().mailboxId(),
+                                       mMessage->envelope().folderId(),
+                                       mMessage->envelope().messageId(),
                                        *plainPart);
     }
 
@@ -597,9 +609,9 @@
     NmMessagePart *htmlPart = mMessage->htmlBodyPart();
 
     if (htmlPart) {
-        mUiEngine.contentToMessagePart(mMessage->mailboxId(),
-                                       mMessage->parentId(),
-                                       mMessage->envelope().id(),
+        mUiEngine.contentToMessagePart(mMessage->envelope().mailboxId(),
+                                       mMessage->envelope().folderId(),
+                                       mMessage->envelope().messageId(),
                                        *htmlPart);
     }
 
@@ -615,9 +627,9 @@
     }
 
     if (attachmentHtml) {
-        mUiEngine.contentToMessagePart(mMessage->mailboxId(),
-                                       mMessage->parentId(),
-                                       mMessage->envelope().id(),
+        mUiEngine.contentToMessagePart(mMessage->envelope().mailboxId(),
+                                       mMessage->envelope().folderId(),
+                                       mMessage->envelope().messageId(),
                                        *attachmentHtml);
     }
 
@@ -645,7 +657,7 @@
         mHeaderWidget->addAttachment(
             attachments[i]->attachmentName(),
             QString::number(attachments[i]->size()),
-            attachments[i]->id());
+            attachments[i]->partId());
     }
 
     if (mStartParam) {
@@ -684,9 +696,7 @@
             if( list[i]->availabilityCondition() == NmAction::NmSendable ) {
                 list[i]->setEnabled(false);
             }
-            //object name set in NmBaseClientPlugin::createEditorViewCommands
-            //temporary solution
-            else if (list[i]->objectName() == "baseclientplugin_attachaction") {
+            else if (list[i]->availabilityCondition() == NmAction::NmAttachable) {
                 HbToolBarExtension* extension = new HbToolBarExtension();
                 mAttachmentPicker = new NmAttachmentPicker(this);
                 
@@ -756,7 +766,7 @@
         case NmActionResponseCommandSendMail: {
             // Just in case send mail would be somehow accessible during message creation or
             // outobox checking
-            if (!mCheckOutboxOperation->isRunning()
+            if ((!mCheckOutboxOperation || !mCheckOutboxOperation->isRunning()) 
                 && (!mMessageCreationOperation || !mMessageCreationOperation->isRunning())) {
                 startSending();
             }
@@ -766,20 +776,6 @@
             break;
         }
     }
-    else if (actionResponse.menuType() == NmActionContextMenu) {
-        switch (responseCommand) {
-        case NmActionResponseCommandRemoveAttachment: {
-            removeAttachmentTriggered();
-            break;
-        }
-        case NmActionResponseCommandOpenAttachment: {
-            openAttachmentTriggered();
-            break;
-        }
-        default:
-        	break;
-        }
-    }
 }
 
 /*!
@@ -937,8 +933,8 @@
     
     if (startMode == NmUiEditorReply || startMode == NmUiEditorReplyAll || 
         startMode == NmUiEditorForward) {
-        QString rePrefix(QObject::tr("Re:", "txt_nmailui_reply_subject_prefix"));
-        QString fwPrefix(QObject::tr("Fw:", "txt_nmailui_forward_subject_prefix"));
+        QString rePrefix(hbTrId("txt_nmailui_reply_subject_prefix"));
+        QString fwPrefix(hbTrId("txt_nmailui_forward_subject_prefix"));
         
         // strip extra prefixes from beginning
         int rePrefixLength(rePrefix.length());
@@ -978,8 +974,13 @@
 */
 void NmEditorView::onAttachmentReqCompleted(const QVariant &value)
 {
-    if (!value.isNull()) {
-        addAttachments(value.toStringList());
+    //temporary fix for music picker back button:
+    //it shouldn't emit requestOk signal when nothing is selected
+	if (value.canConvert<QStringList>()) {
+	    QStringList list = value.toStringList();
+        if (!list.at(0).isEmpty()) {
+            addAttachments(list);
+        }
     }
 }
 
@@ -1012,33 +1013,29 @@
         mHeaderWidget->addAttachment(fileName, QString("0"), NmId(0));
         NMLOG(fileName);
     }
-
-    // Delete previous operation if it's not running.
+    //  Cancel previous operation if it's not running.
     if (mAddAttachmentOperation) {
         if (!mAddAttachmentOperation->isRunning()) {
-            delete mAddAttachmentOperation;
-            mAddAttachmentOperation = NULL;
+            mAddAttachmentOperation->cancelOperation();
         }
     }
-    if (!mAddAttachmentOperation) {
-        // Start operation to attach file or list of files into mail message.
-        // This will also copy files into message store.
-        mAddAttachmentOperation = mUiEngine.addAttachments(*mMessage, fileNames);
+    // Start operation to attach file or list of files into mail message.
+    // This will also copy files into message store.
+    mAddAttachmentOperation = mUiEngine.addAttachments(*mMessage, fileNames);
 
-        if (mAddAttachmentOperation) {
-            enableToolBarAttach(false);
-            // Signal to inform completion of one attachment
-            connect(mAddAttachmentOperation,
-                    SIGNAL(operationPartCompleted(const QString &, const NmId &, int)),
-                    this,
-                    SLOT(oneAttachmentAdded(const QString &, const NmId &, int)));
-        
-            // Signal to inform the completion of the whole operation
-            connect(mAddAttachmentOperation,
-                    SIGNAL(operationCompleted(int)),
-                    this,
-                    SLOT(allAttachmentsAdded(int)));
-        }
+    if (mAddAttachmentOperation) {
+        enableToolBarAttach(false);
+        // Signal to inform completion of one attachment
+        connect(mAddAttachmentOperation,
+                SIGNAL(operationPartCompleted(const QString &, const NmId &, int)),
+                this,
+                SLOT(oneAttachmentAdded(const QString &, const NmId &, int)));
+    
+        // Signal to inform the completion of the whole operation
+        connect(mAddAttachmentOperation,
+                SIGNAL(operationCompleted(int)),
+                this,
+                SLOT(allAttachmentsAdded(int)));
     }
 }
 
@@ -1070,7 +1067,29 @@
 
     // Add menu position check here, so that it does not go outside of the screen
     QPointF menuPos(point.x(),point.y());
-    mAttachmentListContextMenu->exec(menuPos);
+    mAttachmentListContextMenu->setPreferredPos(menuPos);
+    mAttachmentListContextMenu->open(this, SLOT(contextButton(NmActionResponse&)));
+}
+
+/*!
+    Slot. Signaled when menu option is selected
+*/
+void NmEditorView::contextButton(NmActionResponse &result)
+{
+    if (result.menuType() == NmActionContextMenu) {
+        switch (result.responseCommand()) {
+        case NmActionResponseCommandRemoveAttachment: {
+            removeAttachmentTriggered();
+            break;
+        }
+        case NmActionResponseCommandOpenAttachment: {
+            openAttachmentTriggered();
+            break;
+        }
+        default:
+            break;
+        }
+    }
 }
 
 /*!
@@ -1081,9 +1100,9 @@
 {
     if (result == NmNoError && mMessage) {
         // Need to get the message again because new attachment part has been added.
-        NmId mailboxId = mMessage->mailboxId();
-        NmId folderId = mMessage->parentId();
-        NmId msgId = mMessage->envelope().id();
+        NmId mailboxId = mMessage->envelope().mailboxId();
+        NmId folderId = mMessage->envelope().folderId();
+        NmId msgId = mMessage->envelope().messageId();
 
         delete mMessage;
         mMessage = NULL;
@@ -1097,7 +1116,7 @@
         
             // Search newly added attachment from the list
             for (int i=0; i<attachmentList.count(); i++) {
-                if (attachmentList[i]->id() == msgPartId) {
+                if (attachmentList[i]->partId() == msgPartId) {
                     // Get attachment file size and set it into UI
                     mHeaderWidget->setAttachmentParameters(fileName,
                         msgPartId,
@@ -1122,7 +1141,7 @@
 {
     enableToolBarAttach(true);
     if (result != NmNoError) {
-        HbMessageBox::warning(hbTrId("txt_mail_dialog_unable_to_add_attachment"));
+        NmUtilities::displayWarningNote(hbTrId("txt_mail_dialog_unable_to_add_attachment"));
     }
 }
 
@@ -1151,7 +1170,7 @@
             fillEditorWithMessageContents();
             
             if (mMessage) {
-                HbMessageBox::warning(
+                NmUtilities::displayWarningNote(
                     hbTrId("txt_mail_dialog_sending failed").arg(
                         NmUtilities::truncate(
                             mMessage->envelope().subject(), 20)));
@@ -1241,25 +1260,22 @@
 */
 void NmEditorView::removeAttachmentTriggered()
 {
-    // Delete previous operation
+    // Cancel will delete previous operation
     if (mRemoveAttachmentOperation) {
         if (!mRemoveAttachmentOperation->isRunning()) {
-            delete mRemoveAttachmentOperation;
-            mRemoveAttachmentOperation = NULL;
+            mRemoveAttachmentOperation->cancelOperation();
         }
     }
-    if (!mRemoveAttachmentOperation) {
-        // Remove from UI
-        mHeaderWidget->removeAttachment(mSelectedAttachment);
-        // Remove from message store
-        mRemoveAttachmentOperation = mUiEngine.removeAttachment(*mMessage, mSelectedAttachment);
-        if (mRemoveAttachmentOperation) {
-            // Signal to inform the remove operation completion
-            connect(mRemoveAttachmentOperation,
-                    SIGNAL(operationCompleted(int)),
-                    this,
-                    SLOT(attachmentRemoved(int)));
-        }
+    // Remove from UI
+    mHeaderWidget->removeAttachment(mSelectedAttachment);
+    // Remove from message store
+    mRemoveAttachmentOperation = mUiEngine.removeAttachment(*mMessage, mSelectedAttachment);
+    if (mRemoveAttachmentOperation) {
+        // Signal to inform the remove operation completion
+        connect(mRemoveAttachmentOperation,
+                SIGNAL(operationCompleted(int)),
+                this,
+                SLOT(attachmentRemoved(int)));
     }
 }
 
@@ -1274,9 +1290,9 @@
     
     if (mMessage) {
         // Reload message because one attachment has been removed
-        NmId mailboxId = mMessage->mailboxId();
-        NmId folderId = mMessage->parentId();
-        NmId msgId = mMessage->envelope().id();
+        NmId mailboxId = mMessage->envelope().mailboxId();
+        NmId folderId = mMessage->envelope().folderId();
+        NmId msgId = mMessage->envelope().messageId();
 
         delete mMessage;
         mMessage = NULL;
@@ -1304,9 +1320,7 @@
         int count = toolbarList.count();
         for (int i = 0; i < count; i++) {
             NmAction *action = static_cast<NmAction *>(toolbarList[i]);
-            //object name set in NmBaseClientPlugin::createEditorViewCommands
-            //temporary solution
-            if (action->objectName() == "baseclientplugin_attachaction") {
+            if (action->availabilityCondition() == NmAction::NmAttachable) {
                 action->setEnabled(enable);
             }
         }
--- a/emailuis/nmailui/src/nmmailboxlistview.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/src/nmmailboxlistview.cpp	Fri May 14 15:41:10 2010 +0300
@@ -43,10 +43,14 @@
 mUiEngine(uiEngine),
 mListModel(mailboxListModel),
 mItemContextMenu(NULL),
-mDocumentLoader(documentLoader)
+mDocumentLoader(documentLoader),
+mViewReady(false)
 {
+    // Load view layout
     loadViewLayout();
-    refreshList();
+    
+    // Set title
+    setTitle(hbTrId("txt_mail_title_mail"));
 }
 
 /*!
@@ -92,7 +96,7 @@
             mMailboxListWidget->setItemRecycling(true);
             QObject::connect(mMailboxListWidget,
                     SIGNAL(activated(const QModelIndex &)),
-                this, SLOT(openSelectedMailBox(const QModelIndex &)));
+                this, SLOT(itemActivated(const QModelIndex &)));
             QObject::connect(mMailboxListWidget,
                     SIGNAL(longPressed(HbAbstractViewItem*, const QPointF&)),
                 this, SLOT(showItemContextMenu(HbAbstractViewItem*,const QPointF&)));
@@ -106,9 +110,20 @@
     else {
          NMLOG("nmailui: mailboxlistview: Reasource loading failed");
     }
+}
 
-	// set menubar title
-	setTitle(hbTrId("txt_mail_title_mail"));
+/*!
+    Lazy loading when view layout has been loaded
+*/
+void NmMailboxListView::viewReady()
+{
+    if (!mViewReady){
+        // Set title
+        setTitle(hbTrId("txt_mail_title_mail"));
+        // Refresh list
+        QMetaObject::invokeMethod(this, "refreshList", Qt::QueuedConnection); 
+        mViewReady=true;
+    }
 }
 
 /*!
@@ -155,13 +170,23 @@
 }
 
 /*!
+    Item activated slot
+*/
+void NmMailboxListView::itemActivated(const QModelIndex &index)
+{
+    mActivatedIndex = index;
+    QMetaObject::invokeMethod(this, "openSelectedMailBox", Qt::QueuedConnection);
+}
+
+
+/*!
     Open selected mailbox
 */
-void NmMailboxListView::openSelectedMailBox(const QModelIndex &index)
+void NmMailboxListView::openSelectedMailBox()
 {
     // Get mailbox meta data
     NmMailboxMetaData *mailbox =
-        mListModel.data(index, Qt::DisplayRole).value<NmMailboxMetaData*>();
+        mListModel.data(mActivatedIndex, Qt::DisplayRole).value<NmMailboxMetaData*>();
     if (mailbox) {
         // Get standard folder inbox id
         NmId inboxId = mUiEngine.standardFolderId(mailbox->id(), NmFolderInbox);
@@ -200,31 +225,31 @@
         if (mMailboxListWidget){
             mMailboxListWidget->setCurrentIndex(item->modelIndex());
             mItemContextMenu->setObjectName("MailboxItemContextMenu");
-            mItemContextMenu->exec(coords);
+            mItemContextMenu->setPreferredPos(coords);
+            mItemContextMenu->open(this, SLOT(contextButton(NmActionResponse&)));
         }
     }
 }
 
 /*!
-    handleActionCommand. From NmMenuObserver, extension manager calls this
-    call to handle menu command in the UI.
+    Slot. Signaled when menu option is selected
 */
-void NmMailboxListView::handleActionCommand(NmActionResponse &actionResponse)
+void NmMailboxListView::contextButton(NmActionResponse &result)
 {
     // Handle context menu commands here
-    if (actionResponse.menuType()==NmActionContextMenu){
-        switch (actionResponse.responseCommand()){
+    if (result.menuType()==NmActionContextMenu){
+        switch (result.responseCommand()){
             case NmActionResponseCommandOpen:{
                 // Check that given start response has mailbox and folder id's
-                if (actionResponse.mailboxId()!=0){
+                if (result.mailboxId()!=0){
                     // Use standard folder id inbox if folder has not been specified
-                    NmId folderId = actionResponse.folderId();
+                    NmId folderId = result.folderId();
                     if (folderId==0){
-                        folderId=mUiEngine.standardFolderId(actionResponse.mailboxId(),
+                        folderId=mUiEngine.standardFolderId(result.mailboxId(),
                                                             NmFolderInbox);
                     }
                     NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageList,
-                                                                    actionResponse.mailboxId(),
+                                                                    result.mailboxId(),
                                                                     folderId);
                     mApplication.enterNmUiView(startParam);
                     }
@@ -236,4 +261,15 @@
     }
 }
 
+/*!
+    handleActionCommand. From NmMenuObserver, extension manager calls this
+    call to handle menu command in the UI.
+*/
 
+void NmMailboxListView::handleActionCommand(NmActionResponse &actionResponse)
+{
+    // Handle context menu commands here
+    Q_UNUSED(actionResponse);
+}
+
+
--- a/emailuis/nmailui/src/nmmailboxlistviewitem.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/src/nmmailboxlistviewitem.cpp	Fri May 14 15:41:10 2010 +0300
@@ -89,15 +89,6 @@
     return true;
 }
 
-
-/*!
-    item type
-*/
-int NmMailboxListViewItem::type() const
-{
-    return NmMailboxListViewItem::ItemType;
-}
-
 /*!
     polishEvent. Call to base class polish event.
 */
@@ -116,18 +107,5 @@
 {
     Q_UNUSED(option);
     Q_UNUSED(widget);
-    if (painter){
-        painter->setOpacity(0.10);
-        QColor col = HbColorScheme::color("list_item_content_normal");
-        if (col.isValid()) {
-            painter->setPen(col);
-        }
-        QLineF line1( rect().topLeft().x(), rect().bottomRight().y(),
-                     rect().bottomRight().x(), rect().bottomRight().y());
-        painter->drawLine(line1);
-        // Draw line before each item
-        QLineF line2( rect().topLeft().x(), rect().topLeft().y(),
-                     rect().bottomRight().x(), rect().topLeft().y());
-        painter->drawLine(line2);
-    }
+    Q_UNUSED(painter);
 }
--- a/emailuis/nmailui/src/nmmailboxselectiondialog.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/src/nmmailboxselectiondialog.cpp	Fri May 14 15:41:10 2010 +0300
@@ -58,28 +58,35 @@
 
 
 /*!
-    Initializes and displays the dialog.
-
-    \param mailboxId Where the ID of the selected mailbox is stored.
-    \return True if the user selected a mailbox, false otherwise.
+    Initializes and displays the dialog
+    Signal selectionDialogClosed will be emitted when the dialog is closed
 */
-bool NmMailboxSelectionDialog::exec(NmId& mailboxId)
+void NmMailboxSelectionDialog::open()
 {
     NMLOG("NmMailboxSelectionDialog::exec()");
     mMailboxId = 0;
 
     // Initialize the UI and fetch the mailbox items into the list.
     if (initializeUi() && populateListItems()) {
-        // The UI is ready. Do display the dialog.
-        mMailboxSelectionDialog->exec();
-
-        // Store the ID of the selected mailbox into the given argument.
-        mailboxId = mMailboxId;
+		mMailboxSelectionDialog->setModal(true);
+        mMailboxSelectionDialog->open(this,SLOT(dialogClosed(HbAction*)));
+        mMailboxSelectionDialog->show();
     }
-
-    return (mMailboxId != 0);
 }
 
+/*!
+    Slot that is called when dialog is closed
+ */
+void NmMailboxSelectionDialog::dialogClosed(HbAction *action)
+{
+    Q_UNUSED(action);
+    
+    // Store the ID of the selected mailbox into the given argument.
+    NMLOG(QString("NmMailboxSelectionDialog::dialogClosed() return %1").
+        arg(mMailboxId.id()));
+    
+    emit selectionDialogClosed(mMailboxId);
+}
 
 /*!
     Creates the view for the mailbox selection dialog.
--- a/emailuis/nmailui/src/nmmailboxserviceinterface.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/src/nmmailboxserviceinterface.cpp	Fri May 14 15:41:10 2010 +0300
@@ -34,7 +34,7 @@
         NmUiEngine &uiEngine,
         NmApplication *application)
 #ifndef NM_WINS_ENV
-    : XQServiceProvider(QLatin1String("com.nokia.symbian.IEmailInboxView"), parent),
+    : XQServiceProvider(emailFullServiceNameMailbox, parent),
 #else
     : QObject(parent),
 #endif
--- a/emailuis/nmailui/src/nmmessagelistview.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/src/nmmessagelistview.cpp	Fri May 14 15:41:10 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -22,8 +22,6 @@
 static const char *NMUI_MESSAGE_LIST_FOLDER_LABEL = "folderLabel";
 static const char *NMUI_MESSAGE_LIST_SYNC_ICON = "syncIcon";
 
-static const int nmNoMessagesDelay = 200;
-
 #include "nmuiheaders.h"
 
 /*!
@@ -51,16 +49,18 @@
 mDocumentLoader(documentLoader),
 mItemContextMenu(NULL),
 mLongPressedItem(NULL),
-mNoMessagesLabel(NULL)
+mNoMessagesLabel(NULL),
+mFolderLabel(NULL),
+mSyncIcon(NULL),
+mViewReady(false),
+mCurrentFolderType(NmFolderInbox)
 {
     // Load view layout
     loadViewLayout();
-    // Set mailbox name to title pane
-    setMailboxName();
     // Init tree view
     initTreeView();
-    // Refresh list
-    refreshList();
+    // Set folder name
+    setFolderName();
 }
 
 /*!
@@ -74,7 +74,6 @@
         mItemContextMenu->clearActions();
     }
     delete mItemContextMenu;
-    mUiEngine.releaseMessageListModel(mStartParam->mailboxId());
 }
 
 /*!
@@ -114,20 +113,15 @@
         mNoMessagesLabel = qobject_cast<HbLabel *>
             (mDocumentLoader->findWidget(NMUI_MESSAGE_LIST_NO_MESSAGES));
         if (mNoMessagesLabel) {
-            mNoMessagesLabel->setAlignment(Qt::AlignCenter);
-            mNoMessagesLabel->setFontSpec(HbFontSpec(HbFontSpec::Primary));
             mNoMessagesLabel->hide();
-            mNoMessagesLabel->setPlainText(hbTrId("txt_mail_dblist_no_messages"));
         }
         else{
             NMLOG("nmailui: (no messages) object loading failed");
         }
-        
+
+        // Create folder label and set inbox text for it
         mFolderLabel = qobject_cast<HbLabel *>(mDocumentLoader->findWidget(NMUI_MESSAGE_LIST_FOLDER_LABEL));
-        if (mFolderLabel) {
-            mFolderLabel->setPlainText(hbTrId("txt_mail_subhead_inbox"));
-        }
-        
+
         mSyncIcon = qobject_cast<HbLabel *>(mDocumentLoader->findWidget(NMUI_MESSAGE_LIST_SYNC_ICON));
         if (mSyncIcon) {
             mSyncIcon->setIcon(NmIcons::getIcon(NmIcons::NmIconOffline));
@@ -135,14 +129,12 @@
 
         // Connect options menu about to show to create options menu function
         QObject::connect(menu(), SIGNAL(aboutToShow()),
-        		this, SLOT(createOptionsMenu()));
-        
+                         this, SLOT(createOptionsMenu()));
         QObject::connect(&mUiEngine, SIGNAL(syncStateEvent(NmSyncState, const NmId &)),
-                                this, SLOT(handleSyncStateEvent(NmSyncState, const NmId &)));
-        
+                         this, SLOT(handleSyncStateEvent(NmSyncState, const NmId &)));
         QObject::connect(&mUiEngine, SIGNAL(connectionEvent(NmConnectState, const NmId &)),
                                         this, SLOT(handleConnectionEvent(NmConnectState, const NmId &)));
-        
+
         // Menu needs one dummy item so that aboutToShow signal is emitted.
         NmAction *dummy = new NmAction(0);
         menu()->addAction(dummy);
@@ -150,9 +142,22 @@
     else {
         NMLOG("nmailui: Resource loading failed");
     }
+}
 
-    //create toolbar
-    createToolBar();
+/*!
+    Lazy loading when view layout has been loaded
+*/
+void NmMessageListView::viewReady()
+{
+    if (!mViewReady){
+        // Set mailbox name to title pane
+        setMailboxName();
+        //create toolbar
+        createToolBar();
+        // Refresh list
+        QMetaObject::invokeMethod(this, "refreshList", Qt::QueuedConnection);
+        mViewReady=true;
+    }
 }
 
 /*!
@@ -193,8 +198,10 @@
         // Update the model with new parameters
         mUiEngine.messageListModel(startParam->mailboxId(), startParam->folderId());
         refreshList();
-        // Refresh the mailboxname 
+        // Refresh the mailboxname
         setMailboxName();
+        // Show message list if it is hidden
+        mMessageListWidget->show();
     }
     else {
         NMLOG("nmailui: Invalid message list start parameter");
@@ -231,7 +238,7 @@
             }
         }
     }
-    
+
     if (mMessageListWidget) {
         mMessageListWidget->setModel(static_cast<QStandardItemModel*>(&mMessageListModel));
         QObject::connect(&mMessageListModel, SIGNAL(rowsInserted(const QModelIndex&,int,int)),
@@ -240,10 +247,9 @@
                 this, SLOT(itemsRemoved()));
         QObject::connect(&mMessageListModel, SIGNAL(setNewParam(NmUiStartParam*)),
                 this, SLOT(reloadViewContents(NmUiStartParam*)));
-        
+
         if (mMessageListModel.rowCount()==0){
-            // Single shot timer to display text smoothly after layout has been constructed
-            QTimer::singleShot(nmNoMessagesDelay, this, SLOT(showNoMessagesText()));
+            showNoMessagesText();
         }
     }
 }
@@ -265,6 +271,9 @@
     }
 }
 
+/*!
+    Connection event handling
+*/
 void NmMessageListView::handleConnectionEvent(NmConnectState connectState, const NmId &mailboxId)
 {
     if (mSyncIcon && mailboxId == mMessageListModel.currentMailboxId() && mUiEngine.syncState(mailboxId) != Synchronizing) {
@@ -278,6 +287,27 @@
 }
 
 /*!
+    folder selection handling within current mailbox
+*/
+void NmMessageListView::folderSelected(NmId mailbox, NmId folder)
+{
+    // Reloas view contents with new startparams
+    if (mStartParam){
+        NmUiStartParam* startParam = new NmUiStartParam(NmUiViewMessageList,mailbox,folder);
+        // Hide message lis for redraw
+        mMessageListWidget->hide();
+        // Reload view, ownership of the startparams is passed and old startparams
+        // are deleted within reloadViewContents function
+        reloadViewContents(startParam);
+        //Set folder text to status bar
+        setFolderName();
+        // Store active folder type
+        mCurrentFolderType = NmFolderInbox;
+    }
+}
+
+
+/*!
     Long keypress handling
 */
 void NmMessageListView::showItemContextMenu(HbAbstractViewItem *listViewItem, const QPointF &coords)
@@ -297,19 +327,55 @@
         if (envelope){
             NmActionRequest request(this, NmActionContextMenu, NmActionContextViewMessageList,
                     NmActionContextDataMessage, mStartParam->mailboxId(), mStartParam->folderId(),
-                    envelope->id(),QVariant::fromValue(envelope));
+                    envelope->messageId(),QVariant::fromValue(envelope));
             extMngr.getActions(request, list);
         }
         else{
             NmActionRequest request(this, NmActionContextMenu, NmActionContextViewMessageList,
                     NmActionContextDataMessage, mStartParam->mailboxId(), mStartParam->folderId(),
-                    envelope->id());
+                    envelope->messageId());
             extMngr.getActions(request, list);
         }
         for (int i=0;i<list.count();i++) {
             mItemContextMenu->addAction(list[i]);
         }
-        mItemContextMenu->exec(coords);
+        mItemContextMenu->setPreferredPos(coords);
+        mItemContextMenu->open(this, SLOT(contextButton(NmActionResponse&)));
+    }
+}
+
+/*!
+    Slot. Signaled when menu option is selected
+*/
+void NmMessageListView::contextButton(NmActionResponse &result)
+{
+    // Handle context menu commands here
+    if (result.menuType()==NmActionContextMenu){
+        switch (result.responseCommand()){
+           case NmActionResponseCommandOpen:{
+               if (mLongPressedItem){
+                   NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageViewer,
+                       mStartParam->mailboxId(), mStartParam->folderId(),
+                       mLongPressedItem->envelope().messageId());
+                   mApplication.enterNmUiView(startParam);
+                   mLongPressedItem=NULL;
+                   }
+               }
+               break;
+           //temporary solution..
+           case NmActionResponseCommandForward:{
+                if (mLongPressedItem){
+                   NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageEditor,
+                       mStartParam->mailboxId(), mStartParam->folderId(),
+                       mLongPressedItem->envelope().messageId());
+                   mApplication.enterNmUiView(startParam);
+                   mLongPressedItem=NULL;
+                   }
+               }
+               break;
+           default:
+               break;
+        }
     }
 }
 
@@ -317,33 +383,53 @@
     Item activation handling. Expand/collapse for title dividers
     opening for mail items
 */
+void NmMessageListView::itemActivated(const QModelIndex &index)
+{
+    mActivatedIndex = index;
+    QMetaObject::invokeMethod(this, "handleSelection", Qt::QueuedConnection);
+}
 
-void NmMessageListView::itemActivated(const QModelIndex &index)
+/*!
+    Item activation handling. Expand/collapse for title dividers
+    opening for mail items
+*/
+void NmMessageListView::handleSelection()
 {
     // Do expand/collapse for title divider items
-	NmMessageListModelItem* modelItem = mMessageListModel.data(
-        		index, Qt::DisplayRole).value<NmMessageListModelItem*>();
+    NmMessageListModelItem* modelItem = mMessageListModel.data(
+            mActivatedIndex, Qt::DisplayRole).value<NmMessageListModelItem*>();
     if (modelItem && modelItem->itemType()==
         NmMessageListModelItem::NmMessageItemTitleDivider) {
-        if (!mMessageListWidget->isExpanded(index)) {
-            mMessageListWidget->setExpanded(index, true);
+        if (!mMessageListWidget->isExpanded(mActivatedIndex)) {
+            mMessageListWidget->setExpanded(mActivatedIndex, true);
             modelItem->setExpanded(true);
         }
         else {
-            mMessageListWidget->setExpanded(index, false);
+            mMessageListWidget->setExpanded(mActivatedIndex, false);
             modelItem->setExpanded(false);
         }
-    }
+    } 
     if (modelItem && modelItem->itemType() == NmMessageListModelItem::NmMessageItemMessage)
     {
-        NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageViewer,
-            mStartParam->mailboxId(), mStartParam->folderId(),
-            modelItem->envelope().id());
-        mApplication.enterNmUiView(startParam);
-    }
+        NmFolderType folderType = mUiEngine.folderTypeById(mStartParam->mailboxId(),
+                                  mStartParam->folderId());
+        if (folderType==NmFolderDrafts){
+            NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageEditor,
+                mStartParam->mailboxId(), mStartParam->folderId(),
+                modelItem->envelope().messageId(),NmUiEditorFromDrafts);
+            mApplication.enterNmUiView(startParam);            
+        }
+        else if (folderType!=NmFolderOutbox){
+            NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageViewer,
+                mStartParam->mailboxId(), mStartParam->folderId(),
+                modelItem->envelope().messageId());
+            mApplication.enterNmUiView(startParam);        
+        }
+    }    
 }
 
 
+
 /*!
     createOptionsMenu. Functions asks menu commands from extension
     to be added to options menu.
@@ -388,40 +474,15 @@
                 mApplication.popView();
 				break;
             }
+            case NmActionResponseCommandSwitchFolder: {
+                folderSelected(actionResponse.mailboxId(), actionResponse.folderId());
+                break;
+            }
             default: {
                 break;
             }
         }
     }
-
-    // Handle context menu commands here
-    else if (actionResponse.menuType()==NmActionContextMenu){
-        switch (actionResponse.responseCommand()){
-           case NmActionResponseCommandOpen:{
-               if (mLongPressedItem){
-                   NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageViewer,
-                       mStartParam->mailboxId(), mStartParam->folderId(),
-                       mLongPressedItem->envelope().id());
-                   mApplication.enterNmUiView(startParam);
-                   mLongPressedItem=NULL;
-                   }
-               }
-               break;
-           //temporary solution..
-           case NmActionResponseCommandForward:{
-                if (mLongPressedItem){
-                   NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageEditor,
-                       mStartParam->mailboxId(), mStartParam->folderId(),
-                       mLongPressedItem->envelope().id());
-                   mApplication.enterNmUiView(startParam);
-                   mLongPressedItem=NULL;
-                   }
-               }
-               break;
-           default:
-               break;
-        }
-    }
     // Handle toolbar commands here
     else if ( actionResponse.menuType() == NmActionToolbar ) {
         if ( actionResponse.responseCommand() == NmActionResponseCommandNewMail ) {
@@ -446,9 +507,35 @@
                 }
             }
         }
-    }
+        if (actionResponse.responseCommand() == NmActionResponseCommandSearch) {
+            // Check that the given start response has mailbox and folder IDs.
+            if (actionResponse.mailboxId() != 0) {
+                if (mUiEngine.isSendingMessage()) {
+                    // Sending is ongoing so just show a note.
+                    QString noteText = hbTrId("txt_mail_dialog_still_sending");
+
+                    // Get the message subject from the message being sent.
+                    const NmMessage *message = mUiEngine.messageBeingSent();
+
+                    if (message) {
+                        noteText = noteText.arg(
+                            NmUtilities::truncate(message->envelope().subject(), 20));
+                    }
 
+                    HbMessageBox::warning(noteText);
+                }
+                else {
+                    NmUiStartParam *startParam =
+                        new NmUiStartParam(NmUiViewMessageSearchList,
+                                           actionResponse.mailboxId(),
+                                           mStartParam->folderId());
 
+                    // startParam ownership transfers.
+                    mApplication.enterNmUiView(startParam);
+                }
+            }
+        }
+    }
 }
 
 
@@ -491,6 +578,44 @@
 }
 
 /*!
+    setFolderName. Function sets folder name to status bar
+*/
+void NmMessageListView::setFolderName()
+{
+    if (mStartParam && mFolderLabel) {
+        switch (mUiEngine.folderTypeById(mStartParam->mailboxId(),
+                mStartParam->folderId())) {
+        case NmFolderOutbox:
+            {
+            mFolderLabel->setPlainText(hbTrId("txt_mail_subhead_outbox"));
+            }
+            break;
+        case NmFolderDrafts:
+            {
+            mFolderLabel->setPlainText(hbTrId("txt_mail_subhead_drafts"));
+            }
+            break;
+        case NmFolderSent:
+            {
+            mFolderLabel->setPlainText(hbTrId("txt_mail_subhead_sent_items"));
+            }
+            break;
+        case NmFolderDeleted:
+            {
+            mFolderLabel->setPlainText(hbTrId("txt_mail_subhead_deleted_items"));
+            }
+            break;
+        case NmFolderInbox:
+        default:
+            {
+            mFolderLabel->setPlainText(hbTrId("txt_mail_subhead_inbox"));
+            }
+            break;
+        }
+    }
+}
+
+/*!
     Observe items added
 */
 void NmMessageListView::itemsAdded(const QModelIndex &parent, int start, int end)
@@ -507,7 +632,7 @@
         if (items.count()) {
             QModelIndex index = items.at(0)->modelIndex();
             if (1 == index.row()) {
-                QModelIndex previous = mMessageListWidget->previousIndex(index);
+                QModelIndex previous = mMessageListWidget->modelIterator()->previousIndex(index);
                 if (previous.isValid()) {
                     mMessageListWidget->scrollTo(previous);
                 }
--- a/emailuis/nmailui/src/nmmessagelistviewitem.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/src/nmmessagelistviewitem.cpp	Fri May 14 15:41:10 2010 +0300
@@ -50,16 +50,6 @@
 }
 
 /*!
-    type. Returns items type. In this case
-    the item type is custom Hb list item.
-*/
-int NmMessageListViewItem::type() const
-{
-    return NmMessageListViewItem::ItemType;
-}
-
-
-/*!
 */
 HbTreeViewItem *NmMessageListViewItem::createItem()
 {
@@ -202,8 +192,6 @@
             break;
         case NmMessagePriorityNormal:
         default:
-            // Normal priority has no icon so hide the label hide.
-            mIcon1->setObjectName("ListViewItemMessageIconPriorityNormal");
             break;
     }
     // attachments
@@ -211,6 +199,7 @@
     if (envelope.hasAttachments()) {
         HbIcon &icon = NmIcons::getIcon(NmIcons::NmIconAttachment);
         attaIcon->setIcon(icon);
+        attaIcon->setObjectName("ListViewItemMessageIconAttachment");
         attaIcon->show();
     }
     // message read status
@@ -249,33 +238,19 @@
 {
     Q_UNUSED(option);
     Q_UNUSED(widget);
-    if (painter){
-        painter->setOpacity(NmItemLineOpacity);
-        QColor col = HbColorScheme::color("list_item_content_normal");
-        if (col.isValid()) {
-            painter->setPen(col);
-        }
-        QLineF line1( rect().topLeft().x(), rect().bottomRight().y(),
-                     rect().bottomRight().x(), rect().bottomRight().y());
-        painter->drawLine(line1);
-        // Draw line before each item
-        QLineF line2( rect().topLeft().x(), rect().topLeft().y(),
-                     rect().bottomRight().x(), rect().topLeft().y());
-        painter->drawLine(line2);
-
-    }
+    Q_UNUSED(painter);
 }
 
 void  NmMessageListViewItem::setFontsUnread()
 {    
-    static QColor colorRole = HbColorScheme::color("list_item_title");
+    static QColor colorRole = HbColorScheme::color("qtc_list_item_title_normal");
     HbFontSpec spekki(HbFontSpec::Primary);
     setFonts(colorRole, spekki);
 }
 
 void  NmMessageListViewItem::setFontsRead()
 {
-    static QColor colorRole = HbColorScheme::color("list_item_content");
+    static QColor colorRole = HbColorScheme::color("qtc_list_item_content_normal");
     HbFontSpec spekki(HbFontSpec::Secondary);
     setFonts(colorRole, spekki);
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailui/src/nmmessagesearchlistview.cpp	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,673 @@
+/*
+* 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:
+*
+*/
+
+static const char *NMUI_MESSAGE_SEARCH_LIST_VIEW_XML = ":/docml/nmmessagesearchlistview.docml";
+static const char *NMUI_MESSAGE_SEARCH_LIST_VIEW = "NmMessageListView";
+static const char *NMUI_MESSAGE_SEARCH_LIST_TREE_LIST = "MessageTreeList";
+static const char *NMUI_MESSAGE_SEARCH_LIST_NO_MESSAGES = "MessageListNoMessages";
+static const char *NMUI_MESSAGE_SEARCH_LIST_INFO_LABEL = "InfoLabel";
+static const char *NMUI_MESSAGE_SEARCH_LIST_LINE_EDIT = "LineEdit";
+static const char *NMUI_MESSAGE_SEARCH_LIST_PUSH_BUTTON = "PushButton";
+
+
+#include "nmuiheaders.h"
+
+
+/*!
+    \class NmMessageSearchListView
+    \brief The view for searching messages.
+*/
+
+
+/*!
+    Class constructor.
+*/
+NmMessageSearchListView::NmMessageSearchListView(
+    NmApplication &application,
+    NmUiStartParam* startParam,
+    NmUiEngine &uiEngine,
+    NmMessageSearchListModel &searchListModel,
+    HbDocumentLoader *documentLoader,
+    QGraphicsItem *parent)
+: NmBaseView(startParam, parent),
+  mApplication(application),
+  mUiEngine(uiEngine),
+  mSearchListModel(searchListModel),
+  mDocumentLoader(documentLoader),
+  mItemContextMenu(NULL),
+  mMessageListWidget(NULL),
+  mNoMessagesLabel(NULL),
+  mInfoLabel(NULL),
+  mLineEdit(NULL),
+  mPushButton(NULL),
+  mLongPressedItem(NULL),
+  mViewReady(false),
+  mSearchInProgress(false)
+{
+    loadViewLayout();
+    initTreeView();
+}
+
+
+/*!
+    Class destructor.
+*/
+NmMessageSearchListView::~NmMessageSearchListView()
+{
+    delete mDocumentLoader;
+
+    mWidgetList.clear();
+
+    if (mItemContextMenu){
+        mItemContextMenu->clearActions();
+    }
+
+    delete mItemContextMenu;
+}
+
+
+/*!
+    From NmBaseView.
+
+    Returns the view ID.
+
+    \return The view ID.
+*/
+NmUiViewId NmMessageSearchListView::nmailViewId() const
+{
+    return NmUiViewMessageSearchList;
+}
+
+
+/*!
+    From NmBaseView.
+
+    Does the lazy loading after the view layout has been loaded.
+*/
+void NmMessageSearchListView::viewReady()
+{
+    if (!mViewReady){
+        // Set the mailbox name to the title pane.
+        setViewTitle();
+
+        // Refresh the list.
+        QMetaObject::invokeMethod(this, "refreshList", Qt::QueuedConnection);
+
+        // Highlight the search input.
+        setSearchInputMode(NmHighlightedMode);
+
+        mViewReady = true;
+    }
+}
+
+
+/*!
+    From NmMenuObserver.
+
+    Handles action commands which are usually given by the user by selecting
+    menu items.
+
+    \param actionResponse The command details.
+*/
+void NmMessageSearchListView::handleActionCommand(NmActionResponse &actionResponse)
+{
+    // Handle options menu commands here.
+    if (actionResponse.menuType() == NmActionOptionsMenu) {
+        switch (actionResponse.responseCommand()) {
+            case NmActionResponseCommandUpdateMailboxName: {
+                setViewTitle();
+                break;
+            }
+            case NmActionResponseCommandMailboxDeleted: {
+                mApplication.popView();
+                break;
+            }
+            default: {
+                break;
+            }
+        }
+    }
+}
+
+
+/*!
+    From NmBaseView.
+
+    Loads the view layout from the XML file.
+*/
+void NmMessageSearchListView::loadViewLayout()
+{
+    // Use the document loader to load the view layout.
+    bool ok(false);
+    setObjectName(QString(NMUI_MESSAGE_SEARCH_LIST_VIEW));
+    QObjectList objectList;
+    objectList.append(this);
+
+    // Pass the view to the document loader. Instead of creating a new view, the
+    // document loader uses this view when the docml file is parsed.
+    if (mDocumentLoader) {
+        mDocumentLoader->setObjectTree(objectList);
+        mWidgetList = mDocumentLoader->load(NMUI_MESSAGE_SEARCH_LIST_VIEW_XML, &ok);
+    }
+
+    if (ok && mWidgetList.count()) {
+        // Get the message list widget.
+        mMessageListWidget = qobject_cast<HbTreeView *>(
+            mDocumentLoader->findWidget(NMUI_MESSAGE_SEARCH_LIST_TREE_LIST));
+
+        if (mMessageListWidget) {
+            NMLOG("NmMessageSearchListView: Message list widget loaded.");
+
+            // Set the item prototype.
+            mMessageListWidget->setItemPrototype(new NmMessageListViewItem());
+            mMessageListWidget->setItemRecycling(true);
+            mMessageListWidget->contentWidget()->setProperty("indentation", 0);
+            mMessageListWidget->setScrollDirections(Qt::Vertical);
+            mMessageListWidget->setClampingStyle(HbScrollArea::BounceBackClamping);
+            mMessageListWidget->setFrictionEnabled(true);
+        }
+
+        // Load the "no messages" label.
+        mNoMessagesLabel = qobject_cast<HbLabel *>(
+            mDocumentLoader->findWidget(NMUI_MESSAGE_SEARCH_LIST_NO_MESSAGES));
+
+        if (mNoMessagesLabel) {
+            NMLOG("NmMessageSearchListView: \"No messages\" label loaded.");
+            mNoMessagesLabel->hide();
+        }
+
+        // Load the info label.
+        mInfoLabel = qobject_cast<HbLabel *>(
+            mDocumentLoader->findWidget(NMUI_MESSAGE_SEARCH_LIST_INFO_LABEL));
+
+        if (mInfoLabel) {
+            NMLOG("NmMessageSearchListView: Info label loaded.");
+            mInfoLabel->setPlainText(hbTrId("txt_mail_subhead_inbox"));
+            mInfoLabel->hide();
+        }
+
+        // Load the search panel.
+        mLineEdit = qobject_cast<HbLineEdit *>(
+            mDocumentLoader->findWidget(NMUI_MESSAGE_SEARCH_LIST_LINE_EDIT));
+        if (mLineEdit) {
+            connect(mLineEdit, SIGNAL(textChanged(QString)), 
+                this, SLOT(criteriaChanged(QString)));
+        }
+        
+        mPushButton = qobject_cast<HbPushButton *>(
+            mDocumentLoader->findWidget(NMUI_MESSAGE_SEARCH_LIST_PUSH_BUTTON));
+        if (mPushButton) {
+			// button is disabled when line edit is empty
+			mPushButton->setEnabled(false);
+            // The push button both starts and stops the search.
+            connect(mPushButton, SIGNAL(clicked()), this, SLOT(toggleSearch()));
+            mPushButton->setIcon(HbIcon("qtg_mono_search"));
+        }
+    }
+    else {
+        NMLOG("NmMessageSearchListView: Failed to load widgets from XML!");
+    }
+}
+
+
+/*!
+    Initializes the tree view.
+*/
+void NmMessageSearchListView::initTreeView()
+{
+    // Get the mailbox widget pointer and set the parameters.
+    if (mMessageListWidget) {
+        connect(mMessageListWidget, SIGNAL(activated(const QModelIndex &)),
+                this, SLOT(itemActivated(const QModelIndex &)));
+
+        connect(mMessageListWidget, SIGNAL(longPressed(HbAbstractViewItem*, QPointF)),
+                this, SLOT(showItemContextMenu(HbAbstractViewItem*, QPointF)));
+
+        mMessageListWidget->setFocus();
+        mItemContextMenu = new HbMenu();
+    }
+
+    // Clear the previous content if any.
+    mSearchListModel.clearSearchResults();
+}
+
+
+/*!
+    Sets the title according to the name of the current mailbox.
+*/
+void NmMessageSearchListView::setViewTitle()
+{
+    if (mStartParam){
+        NmMailboxMetaData *meta = mUiEngine.mailboxById(mStartParam->mailboxId());
+
+        if (meta){
+            setTitle(meta->name());
+        }
+    }
+}
+
+
+/*!
+    Toggles the visiblity between the message list widget and the "no messages"
+    label.
+
+    \param visible If true, will display the "no messages" label. If false,
+                   will display the message list widget.
+*/
+void NmMessageSearchListView::noMessagesLabelVisibility(bool visible)
+{
+    if (visible) {
+        // Hide the message list widget and display the "no messages" label.
+        if (mMessageListWidget) {
+            mMessageListWidget->hide();
+        }
+
+        if (mNoMessagesLabel && !mNoMessagesLabel->isVisible()) {
+            mNoMessagesLabel->show();
+        }
+    }
+    else {
+        // Hide the "no messages" label and display the message list widget.
+        if (mNoMessagesLabel && mNoMessagesLabel->isVisible()) {
+            mNoMessagesLabel->hide();
+        }
+
+        if (mMessageListWidget) {
+            mMessageListWidget->show();
+        }
+    }
+}
+
+
+/*!
+    Sets the mode for the search input.
+
+    \param mode The mode to set.
+*/
+void NmMessageSearchListView::setSearchInputMode(NmSearchInputMode mode)
+{
+    if (!mLineEdit) {
+        // No line edit widget!
+        return;
+    }
+
+    switch (mode) {
+        case NmNormalMode: {
+            mLineEdit->setEnabled(true);
+            break;
+        }
+        case NmHighlightedMode: {
+            mLineEdit->setEnabled(true);
+            mLineEdit->setFocus();
+            break;
+        }
+        case NmDimmedMode: {
+            mLineEdit->setEnabled(false);
+            break;
+        }
+    }
+}
+
+
+/*!
+    From NmBaseView.
+
+    Reloads the view contents with new start parameters. This method is
+    typically used when the view is already open and an external view activation
+    occurs for this same view.
+*/
+void NmMessageSearchListView::reloadViewContents(NmUiStartParam *startParam)
+{
+    // Check the start parameter's validity; message view cannot be updated if
+    // the given parameter is zero.
+    if (startParam&&startParam->viewId() == NmUiViewMessageSearchList &&
+        startParam->folderId() != 0) {
+        // Delete the existing start parameter data.
+        delete mStartParam;
+        mStartParam = NULL;
+
+        // Store the new start parameter data.
+        mStartParam = startParam;
+
+        // Update the model with new parameters.
+        NmMessageListModel &messageListModel =
+            mUiEngine.messageListModel(startParam->mailboxId(),
+                                       startParam->folderId());
+        mSearchListModel.setSourceModel(&messageListModel);
+        refreshList();
+
+        // Refresh the mailbox name.
+        setViewTitle();
+    }
+    else {
+        // Invalid start parameter data! Unused start parameter needs to be
+        // deleted.
+        NMLOG("NmMessageSearchListView: Invalid message list start parameter!");
+        delete startParam;
+    }
+}
+
+
+/*!
+    Displays the item context menu. This method gets called if an item on the
+    list is long pressed.
+*/
+void NmMessageSearchListView::showItemContextMenu(
+    HbAbstractViewItem *listViewItem, const QPointF &coords)
+{
+    // Store long press item for later use with response.
+    mLongPressedItem = 
+        mSearchListModel.data(listViewItem->modelIndex(),
+                              Qt::DisplayRole).value<NmMessageListModelItem*>();
+
+    if (mItemContextMenu && mLongPressedItem && mLongPressedItem->itemType() ==
+        NmMessageListModelItem::NmMessageItemMessage) {
+        // Clear the previous menu actions.
+        mItemContextMenu->clearActions();
+        NmUiExtensionManager &extMngr = mApplication.extManager();
+        QList<NmAction*> list;
+
+        // Fetch the menu actions based on the selected item.
+        NmMessageEnvelope *envelope = mLongPressedItem->envelopePtr();
+
+        if (envelope){
+            NmActionRequest request(this, NmActionContextMenu, NmActionContextViewMessageList,
+                NmActionContextDataMessage, mStartParam->mailboxId(), mStartParam->folderId(),
+                envelope->messageId(),QVariant::fromValue(envelope));
+
+            extMngr.getActions(request, list);
+        }
+        else{
+            NmActionRequest request(this, NmActionContextMenu, NmActionContextViewMessageList,
+                NmActionContextDataMessage, mStartParam->mailboxId(), mStartParam->folderId(),
+                envelope->messageId());
+
+            extMngr.getActions(request, list);
+        }
+
+        for (int i(0); i < list.count(); ++i) {
+            mItemContextMenu->addAction(list[i]);
+        }
+        mItemContextMenu->setPreferredPos(coords);
+        mItemContextMenu->open(this, SLOT(contextButton(NmActionResponse&)));
+    }
+}
+
+/*!
+    Slot. Signaled when menu option is selected
+*/
+void NmMessageSearchListView::contextButton(NmActionResponse &result)
+{
+// Handle context menu commands here.
+    if (result.menuType() == NmActionContextMenu){
+        switch (result.responseCommand()) {
+           case NmActionResponseCommandOpen: {
+               if (mLongPressedItem){
+                   NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageViewer,
+                       mStartParam->mailboxId(), mStartParam->folderId(),
+                       mLongPressedItem->envelope().messageId());
+
+                   mApplication.enterNmUiView(startParam);
+                   mLongPressedItem = NULL;
+               }
+
+               break;
+           }
+           default: {
+               break;
+           }
+        }
+    }
+}
+
+/*!
+    Stores the given index and forwards the call to handleSelection(). This
+    method gets called when an item on the list is selected.  
+
+    \param index The index of the activated item.
+*/
+void NmMessageSearchListView::itemActivated(const QModelIndex &index)
+{
+    mActivatedIndex = index;
+    QMetaObject::invokeMethod(this, "handleSelection", Qt::QueuedConnection);
+}
+
+/*!
+    Called when text is changed in the edit field
+    
+    \param text new text entered in the field
+ */
+void NmMessageSearchListView::criteriaChanged(QString text) 
+{
+    NMLOG(QString("NmMessageSearchListView::criteriaChanged %1").arg(text));
+    
+    // Check when button should be disabled/enabled
+    bool enabled = mPushButton->isEnabled();
+    if (!enabled && !text.isEmpty()) {
+		mPushButton->setEnabled(true);
+    }
+    else if (enabled && text.isEmpty()) {
+		mPushButton->setEnabled(false);
+    }
+}
+
+/*!
+    If the selected item is a message, will open the message.
+*/
+void NmMessageSearchListView::handleSelection()
+{
+    // Do expand/collapse for title divider items
+    NmMessageListModelItem* modelItem = mSearchListModel.data(
+        mActivatedIndex, Qt::DisplayRole).value<NmMessageListModelItem*>();
+
+    if (modelItem &&
+        modelItem->itemType() == NmMessageListModelItem::NmMessageItemMessage)
+    {
+        if (mSearchInProgress) {
+            // Stop the search.
+            toggleSearch();
+        }
+
+        // Open the message.
+        NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageViewer,
+            mStartParam->mailboxId(), mStartParam->folderId(),
+            modelItem->envelope().messageId());
+
+        mApplication.enterNmUiView(startParam);
+    }
+}
+
+
+/*!
+    Displays the message list widtet if not visible and scrolls to the
+    appropriate point on the list.
+*/
+void NmMessageSearchListView::itemsAdded(const QModelIndex &parent, int start, int end)
+{
+    NMLOG("nmailui: NmMessageSearchListView::itemsAdded()");
+
+    Q_UNUSED(parent);
+    Q_UNUSED(end);
+
+    // Display the message list widget if not visible.
+    noMessagesLabelVisibility(false);
+
+    if (!start && mMessageListWidget) {
+        QList<HbAbstractViewItem*> items = mMessageListWidget->visibleItems();
+
+        if (items.count()) {
+            QModelIndex index = items.at(0)->modelIndex();
+
+            if (1 == index.row()) {
+                QModelIndex previous = mMessageListWidget->modelIterator()->previousIndex(index);
+
+                if (previous.isValid()) {
+                    mMessageListWidget->scrollTo(previous);
+                }
+            }
+        }
+    }
+}
+
+
+/*!
+    This method gets called when an item is removed from the list. If the list
+    contains no items, "no messages" label is displayed.
+*/
+void NmMessageSearchListView::itemsRemoved()
+{
+    if (mSearchListModel.searchResultCount() == 0) {
+        noMessagesLabelVisibility(true);
+    }
+}
+
+
+/*!
+    Refreshes the search list.
+*/
+void NmMessageSearchListView::refreshList()
+{
+    if (mMessageListWidget) {
+        // Set the model.
+        NmMessageListModel &messageListModel =
+            mUiEngine.messageListModel(mStartParam->mailboxId(),
+                                       mStartParam->folderId());
+        mSearchListModel.setSourceModel(&messageListModel);
+        mMessageListWidget->setModel(
+            static_cast<QSortFilterProxyModel*>(&mSearchListModel));
+
+        // Connect the signals.
+        connect(&mSearchListModel, SIGNAL(rowsInserted(const QModelIndex&, int, int)),
+                this, SLOT(itemsAdded(const QModelIndex&, int, int)), Qt::UniqueConnection);
+
+        connect(&mSearchListModel, SIGNAL(rowsRemoved(const QModelIndex&, int, int)),
+                this, SLOT(itemsRemoved()), Qt::UniqueConnection);
+
+        connect(&messageListModel, SIGNAL(setNewParam(NmUiStartParam*)),
+                this, SLOT(reloadViewContents(NmUiStartParam*)), Qt::UniqueConnection);
+
+    }
+}
+
+
+/*!
+    Starts and stops the search according to the current status.
+
+    Starts search: Uses the input given by the user as a search string and
+    starts an asynchronous search. Any previous search results are removed from
+    the search list.
+
+    Stops search: Sets the number of search results into the info label.
+*/
+void NmMessageSearchListView::toggleSearch()
+{
+    if (mSearchInProgress) {
+        // Search is in progress - do cancel.
+        mUiEngine.cancelSearch(mStartParam->mailboxId());
+        handleSearchComplete();
+    }
+    else {
+        // Do start the search.
+        mSearchInProgress = true;
+    
+        // Clear previous results if any.
+        mSearchListModel.clearSearchResults();
+
+        connect(&mUiEngine, SIGNAL(searchComplete()),
+                this, SLOT(handleSearchComplete()), Qt::UniqueConnection);
+    
+        // Get the search input and start the search.
+        QStringList searchStrings;
+
+        if (mLineEdit) {
+            searchStrings.append(mLineEdit->text());
+        }
+
+        mUiEngine.search(mStartParam->mailboxId(), searchStrings);
+
+        // Hide the "no messages" label if visible and dim the search input.
+        noMessagesLabelVisibility(false);
+        setSearchInputMode(NmDimmedMode);
+
+        // Display the info label.
+        if (mInfoLabel) {
+            mInfoLabel->setPlainText(hbTrId("txt_mail_list_searching"));
+            mInfoLabel->show();
+        }
+
+        // Change the push button text.
+        if (mPushButton) {
+            mPushButton->setIcon(HbIcon("qtg_mono_search_stop"));
+        }
+    }
+}
+
+
+/*!
+    If the search matched any messages, displays the search result count in the
+    info label. If no messages were found, the method displays the "no messages"
+    label. In either case, the search panel is updated.
+*/
+void NmMessageSearchListView::handleSearchComplete()
+{
+    NMLOG("NmMessageSearchListView::handleSearchComplete()");
+    mSearchInProgress = false;
+    
+    // Change the push button text.
+    if (mPushButton) {
+        mPushButton->setIcon(HbIcon("qtg_mono_search"));
+    }
+
+    const int resultCount = mSearchListModel.searchResultCount();
+
+    if (resultCount == 1) {
+        // For some reason when the result count is only 1, the search list
+        // will not display the found message. Until the underlying reason for
+        // this bug is found, let us use the following solution to fix this
+        // issue.
+        refreshList();
+    }
+
+    if (resultCount) {
+        if (mInfoLabel) {
+            // Display the result count on the info label.
+            QString resultsString(hbTrId("txt_mail_list_search_results"));
+            resultsString.arg(resultCount);
+            mInfoLabel->setPlainText(resultsString);
+
+            if (!mInfoLabel->isVisible()) {
+                mInfoLabel->show();
+            }
+        }
+
+        // Undim the search input.
+        setSearchInputMode(NmNormalMode);
+    }
+    else {
+        // No search results!
+        if (mInfoLabel && mInfoLabel->isVisible()) {
+            mInfoLabel->hide();
+        }
+
+        // Display the "no messags" label and highlight the search term.
+        noMessagesLabelVisibility(true);
+        setSearchInputMode(NmHighlightedMode);
+    }
+}
+
+
+// End of file.
--- a/emailuis/nmailui/src/nmsendserviceinterface.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/src/nmsendserviceinterface.cpp	Fri May 14 15:41:10 2010 +0300
@@ -19,13 +19,6 @@
 //  INCLUDES
 #include "nmuiheaders.h"
 
-//  CONSTANTS
-static const QString emailSendSubjectKey = "subject";
-static const QString emailSendToKey = "to";
-static const QString emailSendCcKey = "cc";
-static const QString emailSendBccKey = "bcc";
-
-
 /*!
     \class NmStartParamDataHelper
     \brief A helper class for processing the data given to the actual service.
@@ -147,11 +140,11 @@
         QMap<QString, QVariant>::const_iterator i = map.constBegin();
         QString key;
         QVariant value;
-        
+
         while (i != map.constEnd()) {
             key = i.key();
             value = i.value();
-            
+
             if (!key.compare(emailSendSubjectKey, Qt::CaseInsensitive) &&
                 value.type() == QVariant::String) {
                 // Extract the mail subject.
@@ -193,7 +186,7 @@
     inline void addAddressesToList(const QVariant &addresses,
                                    QList<NmAddress*> **list)
     {
-      
+
         if (!list) {
             // Invalid argument!
             return;
@@ -251,13 +244,13 @@
 /*!
     \class NmSendServiceInterface
     \brief NMail application service interface which provides an email sending
-           interface for other application using the Qt Highway. 
+           interface for other application using the Qt Highway.
 */
 
 /*!
     Class constructor.
 */
-NmSendServiceInterface::NmSendServiceInterface(QString interfaceName, 
+NmSendServiceInterface::NmSendServiceInterface(QString interfaceName,
                                                QObject *parent,
                                                NmUiEngine &uiEngine,
                                                NmApplication *application)
@@ -268,7 +261,10 @@
 #endif
       mApplication(application),
       mUiEngine(uiEngine),
-      mAsyncReqId(0)
+      mAsyncReqId(0),
+      mStartParam(NULL),
+      mSelectionDialog(NULL),
+      mCurrentView(NULL)
 {
 #ifndef NM_WINS_ENV
     publishAll();
@@ -281,6 +277,8 @@
 */
 NmSendServiceInterface::~NmSendServiceInterface()
 {
+    delete mStartParam;
+    delete mSelectionDialog;
 }
 
 
@@ -289,13 +287,15 @@
     \param mailboxId Where the ID of the selected mailbox is set.
     \return True if a mailbox was selected, false otherwise.
 */
-bool NmSendServiceInterface::selectMailbox(NmId& mailboxId)
+void NmSendServiceInterface::selectionDialogClosed(NmId &mailboxId)
 {
-	NmMailboxSelectionDialog *dialog =
-	    new NmMailboxSelectionDialog(mUiEngine.mailboxListModel());
-	bool ok = dialog->exec(mailboxId);
-	delete dialog;
-	return ok;
+    NMLOG("NmSendServiceInterface::selectionDialogClosed");
+    if (mailboxId.id()) { // mailbox selected
+        launchEditorView(mailboxId);
+    }
+    else {
+        cancelService();
+    }
 }
 
 
@@ -307,21 +307,19 @@
 
     \param data If used by Share UI, will contain the list of filenames to
                 attach. Can also contain a map with key value pairs containing
-                subject and recipient data. 
+                subject and recipient data.
 */
 void NmSendServiceInterface::send(QVariant data)
 {
     NMLOG("NmSendServiceInterface::send()");
 
 #ifndef NM_WINS_ENV
-    // Make sure the NMail application is on the foreground.
-    XQServiceUtil::toBackground(false);
     HbMainWindow *mainWindow = mApplication->mainWindow();
-    HbView *currentView = mainWindow->currentView();
+    mCurrentView = mainWindow->currentView();
 
     // Hide the current view.
-    if (currentView) {
-        currentView->hide();
+    if (mCurrentView) {
+        mCurrentView->hide();
     }
 
     // Check the given data.
@@ -331,85 +329,124 @@
     NmMailboxListModel &mailboxListModel = mUiEngine.mailboxListModel();
     const int count = mailboxListModel.rowCount();
     NmId mailboxId(0);
-    bool launchEditor(true);
-
-    if (!validData) {
-        // Failed to extract the data!
-        NMLOG("NmSendServiceInterface::send(): Failed to process the given data!");
-        launchEditor = false;
-    }
-    else if (count == 0) {
-        // No mailboxes.
-        HbMessageBox note(hbTrId("txt_mail_dialog_no_mailboxes_defined"),
-                          HbMessageBox::MessageTypeInformation);
-        note.setTimeout(HbMessageBox::NoTimeout);
-        note.exec();
-        launchEditor = false;
-    }
-    else if (count == 1) {
-        // A single mailbox exists.
-        QModelIndex modelIndex = mailboxListModel.index(0, 0);
-        QVariant mailbox(mailboxListModel.data(modelIndex));
-        NmMailboxMetaData *mailboxMetaData = mailbox.value<NmMailboxMetaData*>();
-        mailboxId = mailboxMetaData->id();
-    }
-    else if (count > 1 && !selectMailbox(mailboxId)) {
-        // More than one mailboxes exist but the user cancelled the mailbox
-        // selection dialog.
-        launchEditor = false;
-    }
 
     mAsyncReqId = setCurrentRequestAsync();
     
-    if (launchEditor) {
-        // Make the previous view visible again.
-        if (currentView) {
-            currentView->show();
+    if (!validData) {
+        // Failed to extract the data!
+        NMLOG("NmSendServiceInterface::send(): Failed to process the given data!");
+        cancelService();
+    }
+    else if (count == 0) {
+        // No mailboxes.
+        if (mainWindow) {
+            mainWindow->hide();
+        }
+
+        // Hide the app if it not embedded
+        if (!XQServiceUtil::isEmbedded()) {
+            XQServiceUtil::toBackground(true);
         }
 
-        NmUiStartParam *startParam = new NmUiStartParam(
-            NmUiViewMessageEditor,
-            mailboxId,
-            0, // folder id
-            0, // message id
-            dataHelper.mEditorStartMode, // editor start mode
-            dataHelper.mToAddresses, // address list
-            dataHelper.mAttachmentList, // attachment list
-            true, // start as service
-            dataHelper.mSubject, // message subject
-            dataHelper.mCcAddresses, // list containing cc recipient addresses
-            dataHelper.mBccAddresses // list containing bcc recipient addresses
-        );
+        HbDeviceMessageBox note(hbTrId("txt_mail_dialog_no_mailboxes_defined"),
+                          HbMessageBox::MessageTypeInformation);
+        note.setTimeout(HbMessageBox::NoTimeout);
+        note.exec();
+        if (mainWindow) {
+            mainWindow->show();
+        }
+        cancelService();
+    }
+    else { // count > 0
+        // Make sure the NMail application is in the foreground.
+        XQServiceUtil::toBackground(false);
 
-        mApplication->enterNmUiView(startParam);
-        completeRequest(mAsyncReqId, 1);
-    } 
-    else {
-        // Delete the extracted data since the editor was not launched and thus
-        // NmUiStartParam did not take the ownership of the data.
-        dataHelper.deleteData();
-
-        // If the service was started as embedded, do not hide the app.
-		if (!XQServiceUtil::isEmbedded()) {
-			XQServiceUtil::toBackground(true);
-		}
+    	mStartParam = new NmUiStartParam(
+        	NmUiViewMessageEditor,
+	        0, // account id
+	        0, // folder id
+    	    0, // message id
+        	dataHelper.mEditorStartMode, // editor start mode
+	        dataHelper.mToAddresses, // address list
+    	    dataHelper.mAttachmentList, // attachment list
+        	true, // start as service
+	        dataHelper.mSubject, // message subject
+	        dataHelper.mCcAddresses, // list containing cc recipient addresses
+    	    dataHelper.mBccAddresses // list containing bcc recipient addresses
+	    );
 
-        completeRequest(mAsyncReqId, 0);
+        if (count == 1) {
+            // A single mailbox exists.
+            QModelIndex modelIndex = mailboxListModel.index(0, 0);
+            QVariant mailbox(mailboxListModel.data(modelIndex));
+            NmMailboxMetaData *mailboxMetaData = mailbox.value<NmMailboxMetaData*>();
+            mailboxId = mailboxMetaData->id();
+        	launchEditorView(mailboxId);
+        }
+        else { // count > 1
+            if (!mSelectionDialog) {
+                mSelectionDialog =
+                    new NmMailboxSelectionDialog(mUiEngine.mailboxListModel());
+            }
+            connect(mSelectionDialog,SIGNAL(selectionDialogClosed(NmId&)),
+                this,SLOT(selectionDialogClosed(NmId&)));
+            mSelectionDialog->open();
 
-        // If started as service, the application must be closed now.
-        if (XQServiceUtil::isService()) {
-            connect(this, SIGNAL(returnValueDelivered()),
-                    mApplication, SLOT(delayedExitApplication()));
-        }
-        else {
-            // Make the previous view visible again.
-            if (currentView) {
-                currentView->show();
-            }
+            // launch the editor when the dialog is closed
         }
     }
+}
+
+/*!
+    Called when mailbox id is know and editor can be opened
+    \param mailboxId mailbox using in editor
+ */
+void NmSendServiceInterface::launchEditorView(NmId mailboxId) 
+{
+    NMLOG(QString("NmSendServiceInterface::launchEditorView %1").arg(mailboxId.id()));
+    // Make the previous view visible again.
+    if (mCurrentView) {
+        mCurrentView->show();
+        mCurrentView = NULL;        
+    }
+    
+    if (mStartParam) {
+        mStartParam->setMailboxId(mailboxId);
+        mApplication->enterNmUiView(mStartParam);
+        mStartParam = NULL; // ownership passed
+    }
+    completeRequest(mAsyncReqId, 1);
+}
+
+void NmSendServiceInterface::cancelService() 
+{
+    NMLOG("NmSendServiceInterface::cancelService");
+    delete mStartParam;
+    mStartParam = NULL;
+
+    // If the service was started as embedded, do not hide the app.
+    if (!XQServiceUtil::isEmbedded()) {
+        XQServiceUtil::toBackground(true);
+    }
+
+    completeRequest(mAsyncReqId, 0);
+
+    // If started as service, the application must be closed now.
+    if (XQServiceUtil::isService()) {
+        connect(this, SIGNAL(returnValueDelivered()),
+            mApplication, SLOT(delayedExitApplication()));
+    }
+    else {
+        // Make the previous view visible again
+        if (mCurrentView) {
+            mCurrentView->show();
+            mCurrentView = NULL;
+        }
+    }
+}
+
 #endif /* NM_WINS_ENV */
-}
+
 
 
 // End of file.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailui/src/nmuieffects.cpp	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,141 @@
+/*
+* 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: Graphical effects/animations for nmail ui.
+*
+*/
+
+#include "nmuiheaders.h"
+
+static const char *SendAnimation = ":/effects/mail_send.fxml";
+
+/*!
+    \class NmEffects
+    \brief This class is for launching the effects
+*/
+
+/*!
+    Constructor
+*/
+NmUiEffects::NmUiEffects(HbMainWindow &mainWindow) :
+    mMainWindow(mainWindow),
+    mSendAnimationScreenShot(NULL),
+    mDoSendAnimation(false)
+{
+}
+
+/*!
+    Destructor
+*/
+NmUiEffects::~NmUiEffects()
+{
+    // Clean send animation if sendAnimationComplete slot is not called for some reason.
+    // E.g. red key pressed.
+    resetSendAnimation();
+}
+
+/*!
+    Function will perform needed initializations for selected effect.
+*/
+void NmUiEffects::prepareEffect(NmUiEffectType effect)
+{
+    switch (effect) {
+    case NmEditorSendMessageAnimation:
+        // delete any existing stuff
+        resetSendAnimation();
+        
+        // This effect is for editor send message. Get the screen capture of
+        // editor view for animation which will be lauched soon.
+        mDoSendAnimation = true;
+
+        // take screen shot
+        mSendAnimationScreenShot = screenShot();
+        
+        // Create graphics item based pixmap image but don't show it yet.
+        mSendAnimationScreenShot->hide();
+        mSendAnimationScreenShot->setPos(0,0);
+        mSendAnimationScreenShot->setZValue(0);
+        mMainWindow.scene()->addItem(mSendAnimationScreenShot);
+
+        // Set editor screen capture visible before old view is popped.
+        // New view is drawn under this image.
+        mSendAnimationScreenShot->show();
+
+        HbEffect::add(mSendAnimationScreenShot, SendAnimation, "mail_send");
+        break;
+    }
+}
+
+/*!
+    Function will start the selected effect.
+*/
+void NmUiEffects::startEffect(NmUiEffectType effect)
+{
+    switch (effect) {
+    case NmEditorSendMessageAnimation:
+        // Send message animation for editor view.
+        if (mDoSendAnimation && mSendAnimationScreenShot) {
+            mDoSendAnimation = false;
+            // Start animation and connect completion signal to sendAnimationComplete slot.
+            HbEffect::start(mSendAnimationScreenShot, "mail_send", this, "sendAnimationComplete");
+        }
+        break;
+    }
+}
+
+/*!
+   Generates a screenshot of the current screen. Picture is rotated
+   according to the main window orientation.
+ */
+QGraphicsPixmapItem *NmUiEffects::screenShot()
+{
+    // Grab whole view into pixmap image (also chrome is included)
+    QPixmap screenCapture = QPixmap::grabWindow(mMainWindow.internalWinId());
+
+    QGraphicsPixmapItem *ret = NULL;
+    
+    // for landscape, the screenshot must be rotated
+    if(mMainWindow.orientation() == Qt::Horizontal) {
+        QMatrix mat;
+        mat.rotate(-90); // rotate 90 degrees counter-clockwise
+        ret = new QGraphicsPixmapItem(screenCapture.transformed(mat));
+    }
+    else {
+        ret = new QGraphicsPixmapItem(screenCapture);
+    }
+    
+    return ret;    
+}
+
+/*!
+   Clean up for send animation
+ */
+void NmUiEffects::resetSendAnimation()
+{
+    if (mSendAnimationScreenShot) {
+        // Clean send animation
+        HbEffect::remove(mSendAnimationScreenShot, SendAnimation, "mail_send");
+        delete mSendAnimationScreenShot;
+        mSendAnimationScreenShot = NULL;
+        mDoSendAnimation = false;
+    }
+}
+
+/*!
+    Slot is called when send message animation for editor view has been completed.
+*/
+void NmUiEffects::sendAnimationComplete(HbEffect::EffectStatus status)
+{
+    Q_UNUSED(status);
+    resetSendAnimation();
+}
--- a/emailuis/nmailui/src/nmuiextensionmanager.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/src/nmuiextensionmanager.cpp	Fri May 14 15:41:10 2010 +0300
@@ -17,10 +17,39 @@
 
 #include "nmuiheaders.h"
 
+const QString NmsPluginExtensionName = "nmsclientplugin.qtplugin"; 
 /*!
     \class NmUiExtensionManager
     \brief Handles ui extension plugins
  */
+
+// ======== HELPER FUNCTIONS ========
+
+/*!
+  Creates list of folder paths where plug-ins can be loaded from.
+  \return folder path list.
+*/
+QStringList NmUiExtensionManager::pluginFolders()
+{
+    NMLOG(QString("NmUiExtensionManager - HELPER FUNCTIONS - pluginFolders"));
+
+    const QString NmSettingsPluginFolderPath("/resource/qt/plugins/nmail/uiext");
+    QStringList pluginDirectories;
+    QFileInfoList driveList = QDir::drives();
+
+    foreach(const QFileInfo &driveInfo, driveList) {
+        QString pluginDirectory =
+            driveInfo.absolutePath() + NmSettingsPluginFolderPath;
+        NMLOG(QString("fileInfo.absoluteFilePath() : %1").arg(pluginDirectory)); 
+        if (QFileInfo(pluginDirectory).exists()) {
+            pluginDirectories.append(pluginDirectory);
+        }
+    }
+
+    NMLOG(QString("NmUiExtensionManager - HELPER FUNCTIONS - pluginFolders - OK"));
+    return pluginDirectories;
+}
+
 NmUiExtensionManager::NmUiExtensionManager()
 {
     // load the protocol extension plugins
@@ -52,80 +81,41 @@
         interface->getActions(menuRequest, actionList);
     }
 }
-
 /*!
-    Loads predifened plugins implementing the NmUiExtensionInterface interface
+    Loads plug-ins which implements NmUiExtensionInterface and are registered
+    to <code>/resource/qt/plugins/nmail/uiext</code> folder.
  */
 void NmUiExtensionManager::loadExtensionPlugins()
 {
-
-#ifdef Q_OS_SYMBIAN
-    // Note: In Symbian the plugin stub files (.qtplugin) must be used whenever
-    // a path to plugin is needed - Symbian platform security.
-    const QString KImapPluginExtensionName = "nmimapclientplugin.qtplugin";
-    const QString KPopPluginExtensionName  = "nmpopclientplugin.qtplugin";
-    const QString KEasPluginExtensionName = "nmeasclientplugin.qtplugin";
-    const QString KPluginDirectory = "c:\\resource\\plugins";
-    QDir pluginDir = QDir(KPluginDirectory);
-#else
-    #define NM_WINS_ENV
-    const QString KImapPluginExtensionName = "nmimapclientplugin.dll";
-    const QString KPopPluginExtensionName  = "nmpopclientplugin.dll";
-    QDir pluginDir = QDir(QApplication::applicationDirPath());
-#endif
-
-    QPluginLoader *imapPluginLoader = new QPluginLoader(
-            pluginDir.absoluteFilePath(KImapPluginExtensionName));
-    QObject *imapPluginInstance = imapPluginLoader->instance();
+    NMLOG(QString("NmUiExtensionManager::loadExtensionPlugins -->"));
+    
+    QStringList directories(pluginFolders());
+    foreach (const QString &directoryPath, directories) {
+        QDir directory(directoryPath);
+        QFileInfoList fileList(directory.entryInfoList());
 
-    QPluginLoader *popPluginLoader = new QPluginLoader(
-            pluginDir.absoluteFilePath(KPopPluginExtensionName));
-    QObject *popPluginInstance = popPluginLoader->instance();
-
-#ifndef NM_WINS_ENV
-    QPluginLoader *easPluginLoader = new QPluginLoader(
-            pluginDir.absoluteFilePath(KEasPluginExtensionName));
-    QObject *easPluginInstance = easPluginLoader->instance();
-#endif
-
-    if(imapPluginInstance) {
-        NmUiExtensionInterface *interface = qobject_cast<NmUiExtensionInterface*>(imapPluginInstance);
-        if (interface) {
-            mExtensions.append(interface);
+        foreach (const QFileInfo &fileInfo, fileList) {
+            NMLOG(QString("Plugin absolute FilePath : %1").arg(fileInfo.absoluteFilePath()));  
+            QScopedPointer<QPluginLoader> loader(
+                new QPluginLoader(fileInfo.absoluteFilePath()));
+            mPluginLoaders.append(loader.data());
+            loader.take();
         }
-        mPluginLoaders.append(imapPluginLoader);
-    } else {
-        // We don't have proper plugin instance, so we don't need it's loader.
-        delete imapPluginLoader;
-        imapPluginLoader = NULL;
     }
     
-    if(popPluginInstance) {
-        NmUiExtensionInterface *interface = qobject_cast<NmUiExtensionInterface*>(popPluginInstance);
-        if (interface) {
-            mExtensions.append(interface);
+    NmUiExtensionInterface *interface = NULL;    
+    foreach (QPluginLoader *loader, mPluginLoaders) {      
+        NMLOG(QString("Plugin fileName() : %1").arg(loader->fileName()));
+        QString fileName = loader->fileName();
+        if (fileName.contains(NmsPluginExtensionName, Qt::CaseInsensitive) == false) {
+            QObject *pluginInstance = loader->instance();
+            interface = qobject_cast<NmUiExtensionInterface*>(pluginInstance);
+            if (interface) {
+                mExtensions.append(interface);
+            }
         }
-        mPluginLoaders.append(popPluginLoader);
-    } else {
-        // We don't have proper plugin instance, so we don't need it's loader.
-        delete popPluginLoader;
-        popPluginLoader = NULL;
-    }
-
-#ifndef NM_WINS_ENV
-    if(easPluginInstance) {
-        NmUiExtensionInterface *interface = qobject_cast<NmUiExtensionInterface*>(easPluginInstance);
-        if (interface) {
-            mExtensions.append(interface);
-        }
-        mPluginLoaders.append(easPluginLoader);
-    } else {
-        // We don't have proper plugin instance, so we don't need it's loader.
-        delete easPluginLoader;
-        easPluginLoader = NULL;
-    }
-#endif    
-
+    }            
+    NMLOG(QString("<-- NmUiExtensionManager::loadExtensionPlugins"));
 }
 
 
--- a/emailuis/nmailui/src/nmutilities.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/src/nmutilities.cpp	Fri May 14 15:41:10 2010 +0300
@@ -18,6 +18,7 @@
 #include "nmuiheaders.h"
 
 static const int NmMegabyte = 1048576;
+static const int NmShortInterval = 1000; // 1 sec
 
 // taken from http://www.regular-expressions.info/email.html
 static const QRegExp EmailAddressPattern("[A-Za-z\\d!#$%&'*+/=?^_`{|}~-]+"
@@ -261,29 +262,67 @@
 }
 
 /*!
-    takes care of necessary error/information note displaying
+    takes care of necessary error/information note displaying based on the given operation completion event
+    returns boolean whether settings should be opened or not
 */
-void NmUtilities::displayOperationCompletionNote(const NmOperationCompletionEvent &event)
+bool NmUtilities::displayOperationCompletionNote(const NmOperationCompletionEvent &event)
 {
-    if(event.mCompletionCode != NmNoError) {
-        if(event.mCompletionCode == NmAuthenticationError) {
-            HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeWarning);
-            messageBox->setText(hbTrId("txt_mail_dialog_mail_address_or_password_is_incorr"));
-            // using default timeout
-            HbAction *action = messageBox->exec();
+    bool openSettings(false);
+    // nothing to do in successfull or cancelled case
+    if(event.mCompletionCode != NmNoError && event.mCompletionCode != NmCancelError) {
+        if(event.mOperationType == Synch && event.mCompletionCode == NmAuthenticationError) {
+            openSettings = displayQuestionNote(hbTrId("txt_mail_dialog_address_or_password_incorrect"));
         }
-        if(event.mCompletionCode == NmServerConnectionError) {
-            HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeWarning);
-            messageBox->setText(hbTrId("txt_mail_dialog_server_settings_incorrect_link"));
-            messageBox->setTimeout(HbMessageBox::NoTimeout);
-            HbAction *action = messageBox->exec();
-            if(action == messageBox->primaryAction()) {
-                // Settings to be launched..
-            }
+        if(event.mOperationType == Synch && event.mCompletionCode == NmServerConnectionError) {
+            openSettings = displayQuestionNote(hbTrId("txt_mail_dialog_server_settings_incorrect"));
+        }
+        // following applies to all operation/event types
+        if(event.mCompletionCode == NmConnectionError) {
+            displayWarningNote(hbTrId("txt_mail_dialog_mail_connection_error"));
         }
     }
+    return openSettings;
 }
 
+/*!
+    displays a note with Yes/No buttons. Note has no timeout, i.e. it has to be dismissed manually
+    returns boolean whether primaryaction was taken (Left button ("Yes") pressed)
+*/
+bool NmUtilities::displayQuestionNote(QString noteText)
+{
+	HbMessageBox::warning(noteText);
+	return true;
+	/*
+	 * Commented out because of exec() deprecation. Will be fixed later...
+	 * 
+    bool ret(false);
+    HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
+    messageBox->setText(noteText);
+    messageBox->setTimeout(HbMessageBox::NoTimeout); // note has to be dismissed manually
+    HbAction *action = messageBox->exec();
+    if(action == messageBox->primaryAction()) {
+        ret=true; // primary/left button was pressed
+    }
+    delete messageBox;
+    return ret;
+    */
+}
+
+/*!
+ * displays an error note with no buttons. Note dismisses itself after NmShortInterval.
+ */
+void NmUtilities::displayWarningNote(QString noteText)
+{
+    HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeWarning);
+    messageBox->setText(noteText);
+    messageBox->setTimeout(NmShortInterval);
+    messageBox->clearActions(); // gets rid of buttons from the note
+    messageBox->setModal(false);
+    messageBox->setBackgroundFaded(false);
+    messageBox->show();
+
+    delete messageBox;
+}
 
 /*!
     Function returns localized "Original message" header
@@ -369,5 +408,3 @@
     ret+="<br></body></html>";
     return ret;
 }
-
-
--- a/emailuis/nmailui/src/nmviewerserviceinterface.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/src/nmviewerserviceinterface.cpp	Fri May 14 15:41:10 2010 +0300
@@ -32,7 +32,7 @@
         NmApplication *application,
         NmUiEngine &uiEngine)
 #ifndef NM_WINS_ENV
-    : XQServiceProvider(QLatin1String("com.nokia.symbian.IEmailMessageView"), parent),
+    : XQServiceProvider(emailFullServiceNameMessage, parent),
 #else
     : QObject(parent),
 #endif
--- a/emailuis/nmailui/src/nmviewerview.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/src/nmviewerview.cpp	Fri May 14 15:41:10 2010 +0300
@@ -26,15 +26,15 @@
 static const char *NMUI_MESSAGE_VIEWER_ATTALIST = "viewerAttaList";
 static const char *NMUI_MESSAGE_VIEWER_SCROLL_WEB_VIEW = "viewerWebView";
 
-static const int nmViewLoadTimer=10;
-static const int nmOrientationTimer=100;
+static const int NmOrientationTimer = 100;
+static const int NmHeaderMargin = 3;
 
 static const QString NmParamTextHeightSecondary = "hb-param-text-height-secondary";
 
 /*!
 	\class NmViewerView
 	\brief Mail viewer class
-*/ 
+*/
 
 /*!
     Constructor
@@ -44,13 +44,15 @@
     NmUiStartParam* startParam,
     NmUiEngine &uiEngine,
     HbMainWindow *mainWindow,
-    bool toolbar,
+    NmAttachmentManager &attaManager,
+    bool toolbarEnabled,
     QGraphicsItem *parent)
 :NmBaseView(startParam, parent),
 mApplication(application),
 mUiEngine(uiEngine),
 mMainWindow(mainWindow),
-mToolbar(toolbar),
+mAttaManager(attaManager),
+mToolbarEnabled(toolbarEnabled),
 mMessage(NULL),
 mScrollArea(NULL),
 mViewerContent(NULL),
@@ -64,22 +66,28 @@
 mViewerHeaderContainer(NULL),
 mScreenSize(QSize(0,0)),
 mWaitDialog(NULL),
-loadingCompleted(false),
+webFrameloadingCompleted(false),
 mLatestLoadingSize(QSize(0,0)),
-mFetchOperation(NULL),
 mAttaIndexUnderFetch(NmNotFoundError),
-mAttaWidget(NULL)
+mAttaWidget(NULL),
+mViewReady(false),
+mWaitNoteCancelled(false),
+mOkAction(NULL),
+mCancelAction(NULL)
     {
     // Create documentloader
     mDocumentLoader = new NmUiDocumentLoader(mMainWindow);
     // Get screensize
     mScreenSize = mApplication.screenSize();
+    // Connect external delete handling to uiengine signal
+    connect(&mUiEngine,
+            SIGNAL(messageDeleted(const NmId &, const NmId &, const NmId &)),
+            this, SLOT(messageDeleted(const NmId &, const NmId &, const NmId &)),
+            Qt::UniqueConnection);
     // Fetch message
     loadMessage();
     // Load view layout
     loadViewLayout();
-    // Set message data
-    QTimer::singleShot(nmViewLoadTimer, this, SLOT(fetchMessage()));
 }
 
 /*!
@@ -88,7 +96,7 @@
 NmViewerView::~NmViewerView()
 {
     delete mWebView;
-    mWebView=NULL;
+    mWebView = NULL;
     delete mMessage;
     mMessage = NULL;
     delete mDocumentLoader;
@@ -96,8 +104,28 @@
     mWidgetList.clear();
     delete mWaitDialog;
     mWaitDialog = NULL;
-    delete mFetchOperation;
-    mFetchOperation = NULL;
+    // remove view from osbserving atta manager events
+    mAttaManager.clearObserver();
+    mAttaManager.cancelFetch();
+    delete mOkAction;
+    mOkAction = NULL;
+    delete mCancelAction;
+    mCancelAction = NULL;
+}
+
+/*!
+    View is about to exit
+*/
+void NmViewerView::aboutToExitView()
+{
+    // View is about to exit, for safety, stop 
+    // loading of content before closing the view
+    if (mWebView){
+        mWebView->stop();
+        if (mWebView->page()){
+            mWebView->page()->deleteLater();
+        }
+    }
 }
 
 /*!
@@ -120,12 +148,13 @@
     if (ok == true && widgetCount)
     {
         // Create content and content layout
+        // qobject_cast not work in this case, using reinterpret_cast
         mViewerContent = reinterpret_cast<HbWidget *>(
                 mDocumentLoader->findObject(NMUI_MESSAGE_VIEWER_CONTENT));
         // Find scroll area
         mScrollArea = reinterpret_cast<NmBaseViewScrollArea *>(
                 mDocumentLoader->findObject(NMUI_MESSAGE_VIEWER_SCROLL_AREA));
-        if (mScrollArea){
+        if (mScrollArea) {
             mScrollArea->setParentItem(this);
             mScrollArea->setScrollDirections(Qt::Vertical | Qt::Horizontal);
             connect(mScrollArea, SIGNAL(scrollPositionChanged(QPointF)),
@@ -142,7 +171,7 @@
                 mScrollAreaContents->layout()->setContentsMargins(0,0,0,0);
             }
 
-            // Set white pixmap to backgrounditem
+            // Set white pixmap to backgrounditem 
             QPixmap whitePixmap(10,10);
             whitePixmap.fill(Qt::white);
             QGraphicsPixmapItem *pixmapItem = new QGraphicsPixmapItem(whitePixmap);
@@ -161,43 +190,64 @@
             // Load webview
             mWebView = reinterpret_cast<NmMailViewerWK *>(
                     mDocumentLoader->findObject(QString(NMUI_MESSAGE_VIEWER_SCROLL_WEB_VIEW)));
-            if (mWebView){
+            if (mWebView) {
                 mWebView->setParentView(this);
+                // Set auto load images and private browsing(no history) attributes
+                mWebView->settings()->setAttribute(QWebSettings::AutoLoadImages, true);
+                mWebView->settings()->setAttribute(QWebSettings::PrivateBrowsingEnabled, true);                                
                 HbEditorInterface editorInterface(mWebView);
-                editorInterface.setConstraints(HbEditorConstraintIgnoreFocus);
+                editorInterface.setInputConstraints(HbEditorConstraintIgnoreFocus);
                 mWebView->setAcceptedMouseButtons(Qt::NoButton);
                 if (mWebView->page()){
-                    mWebView->page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, 
+                    mWebView->page()->mainFrame()->setScrollBarPolicy(Qt::Vertical,
+                                                                      Qt::ScrollBarAlwaysOff);
+                    mWebView->page()->mainFrame()->setScrollBarPolicy(Qt::Horizontal,
                                                                       Qt::ScrollBarAlwaysOff);
-                    mWebView->page()->mainFrame()->setScrollBarPolicy(Qt::Horizontal, 
-                                                                      Qt::ScrollBarAlwaysOff);         
-                    bool connectOk = connect(mWebView->page()->mainFrame(), 
+                    connect(mWebView->page()->mainFrame(),
                             SIGNAL(contentsSizeChanged(const QSize&)),
-                        this, SLOT(scaleWebViewWhenLoading(const QSize&)));                                       
+                        this, SLOT(scaleWebViewWhenLoading(const QSize&)));
                 }
              }
-        } 
-        if(!mToolbar) {
-			// Connect options menu about to show to create options menu function
-			QObject::connect(menu(), SIGNAL(aboutToShow()),
-					this, SLOT(createOptionsMenu()));
-			
-			// Menu needs one dummy item so that aboutToShow signal is emitted.
-			NmAction *dummy = new NmAction(0);
-			menu()->addAction(dummy);
         }
     }
-    if(mStartParam){
-        connect(&mUiEngine.messageListModel(mStartParam->mailboxId(), mStartParam->folderId()), 
-                SIGNAL(removeMessage(const NmId&)), this, SLOT(externalDelete(const NmId &)));
+}
+ 
+/*!
+    Lazy loading when view layout has been loaded
+*/
+void NmViewerView::viewReady()
+{
+    if (!mViewReady){
+        // Set mailbox name to title
+        setMailboxName();
+        // Create toolbar if needed
+        if (mToolbarEnabled) {
+            createToolBar();
+        }
+        else {
+            // Connect options menu about to show to create options menu function
+            QObject::connect(menu(), SIGNAL(aboutToShow()),
+                    this, SLOT(createOptionsMenu())); 
+            // Menu needs one dummy item so that aboutToShow signal is emitted.
+            NmAction *dummy = new NmAction(0);
+            menu()->addAction(dummy);
+        }
+        
+        
+        if (mHeaderWidget){
+            QPointF contentWidgetPos = mScrollArea->pos();
+            qreal headerHeight = mHeaderWidget->geometry().height();
+            if(mMainWindow->orientation()==Qt::Horizontal) {
+                const QPointF pointToWebView(contentWidgetPos.x(), headerHeight+NmHeaderMargin);
+                mScrollArea->scrollContentsTo(pointToWebView,0);
+            }
+        }
+        
+        // Run fetchmessage in queue
+        QMetaObject::invokeMethod(this, "fetchMessage", Qt::QueuedConnection);
+        // Set view ready
+        mViewReady=true;
     }
-    
-    if(mToolbar) {
-		// call the createToolBar on load view layout
-		createToolBar(); 
-    }
-    // Set mailbox name to title
-    setMailboxName();
 }
 
 /*!
@@ -241,21 +291,17 @@
         // if body missing it might mean that only header is fetched or message has no body
         if (!body || (body && (body->fetchedSize() < body->size()))) {
             // start fetching operation
-            if (mMessageFetchingOperation) {
+            if (mMessageFetchingOperation && mMessageFetchingOperation->isRunning()) { 
                 mMessageFetchingOperation->cancelOperation();
-                delete mMessageFetchingOperation;
-                mMessageFetchingOperation = NULL;
             }
             mMessageFetchingOperation = mUiEngine.fetchMessage(mailboxId, folderId, msgId);
 
             if (mMessageFetchingOperation) {
-                // QObject handles deletion
-                mMessageFetchingOperation->setParent(this);
                 connect(mMessageFetchingOperation,
                         SIGNAL(operationCompleted(int)),
                         this,
                         SLOT(messageFetched(int)));
-                
+
                 delete mWaitDialog;
                 mWaitDialog = NULL;
                 // Create new wait dialog and set it to me modal with dimmed background
@@ -286,7 +332,7 @@
 {
     delete mWaitDialog;
     mWaitDialog = NULL;
-    
+
     if (result == NmNoError && mMessageFetchingOperation) {
         if (mMessage) {
             delete mMessage;
@@ -296,7 +342,7 @@
         NmId folderId;
         NmId msgId;
         // Read start params and message object
-        if (mStartParam){
+        if (mStartParam) {
             mailboxId = mStartParam->mailboxId();
             folderId = mStartParam->folderId();
             msgId = mStartParam->messageId();
@@ -305,7 +351,7 @@
         setMessageData();
         // Update header message data
 		if (mHeaderWidget){
-        	mHeaderWidget->updateMessageData(mMessage);		
+        	mHeaderWidget->updateMessageData(mMessage);
 		}
     }
 }
@@ -316,10 +362,13 @@
  */
 void NmViewerView::waitNoteCancelled()
 {
-    if (mMessageFetchingOperation) {
-        mMessageFetchingOperation->cancelOperation();
+    if (!mWaitNoteCancelled) {
+        if (mMessageFetchingOperation && mMessageFetchingOperation->isRunning()) { 
+	        mMessageFetchingOperation->cancelOperation();
+        }
+        mWaitNoteCancelled = true;
+        QMetaObject::invokeMethod(&mApplication, "popView", Qt::QueuedConnection);
     }
-    QTimer::singleShot(nmViewLoadTimer, &mApplication, SLOT(popView()));
 }
 
 
@@ -341,8 +390,8 @@
         // Set custom network access manager for embedded image handling
         NmViewerViewNetManager &netMngr = mApplication.networkAccessManager();
         netMngr.setView(this);
-        page->setNetworkAccessManager(&netMngr);        
-            
+        page->setNetworkAccessManager(&netMngr);
+
         connect(page, SIGNAL(loadFinished(bool)),
                     this, SLOT(webFrameLoaded(bool)));
         page->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
@@ -373,37 +422,47 @@
     mAttaWidget = qobject_cast<NmAttachmentListWidget *>(
             mDocumentLoader->findObject(NMUI_MESSAGE_VIEWER_ATTALIST));
     if (mMessage && mAttaWidget) {
+        // connect atta widget to listen progress value events
+        QObject::connect(this, SIGNAL(progressValueChanged(int, int)),
+                mAttaWidget, SLOT(setProgressBarValue(int, int)));
         // Set atta widget text color black since header has static white bg.
         mAttaWidget->setTextColor(Qt::black);
         // Set attawidget minimum & maximum size
         mAttaWidget->setMinimumWidth(mScreenSize.width());
-        mAttaWidget->setMaximumWidth(mScreenSize.width());   
-        bool inserted = false; 
+        mAttaWidget->setMaximumWidth(mScreenSize.width());
+        bool inserted = false;
         QList<NmMessagePart*> messageParts;
         mMessage->attachmentList(messageParts);
         for (int i = 0; i < messageParts.count();i++) {
-            NmMessagePart *part = messageParts[i];           
-            if (part && 
-                part->contentDisposition().compare("inline", Qt::CaseInsensitive) && 
-                !(part->contentType().startsWith("image", Qt::CaseInsensitive))) {
+            NmMessagePart *part = messageParts[i];
+            if (part &&
+                ((part->contentDisposition().trimmed().startsWith("inline", Qt::CaseInsensitive)==false) ||
+                 (part->contentType().trimmed().startsWith("image", Qt::CaseInsensitive)==false))) {
                 QString fileName = part->attachmentName();
                 // index starts from zero, next index is same as count
                 int attaIndex = mAttaWidget->count();
-                mAttaWidget->insertAttachment(attaIndex, fileName, 
+                mAttaWidget->insertAttachment(attaIndex, fileName,
                                               NmUtilities::attachmentSizeString(part->size()));
-                mAttaIdList.insert(attaIndex, part->id());
+                mAttaIdList.insert(attaIndex, part->partId());
+                // check is part under fetch, add progress value to attachment widget
+                if (mAttaManager.isFetching() && 
+                        mAttaManager.partIdUnderFetch() == part->partId()) {
+                    mAttaIndexUnderFetch = attaIndex;
+                }
                 inserted = true;
             }
         }
-        if (inserted) { 
+        if (inserted) {
             QObject::connect(mAttaWidget, SIGNAL(itemActivated(int)),
                     this, SLOT(openAttachment(int)));
         }
         else {
             // No attachments, set height to 0
             mAttaWidget->setMinimumHeight(0);
-            mAttaWidget->setMaximumHeight(0);             
-            }
+            mAttaWidget->setMaximumHeight(0);
+        }
+        // set this as a observer for attachment manager
+        mAttaManager.setObserver(this);
     }
 }
 
@@ -412,82 +471,41 @@
 */
 void NmViewerView::openAttachment(int index)
 {
-    // fetch operation should not be running
-    if (mAttaIndexUnderFetch == NmNotFoundError) {
-        NmId attaId = mAttaIdList.at(index);
-        // reload message to get updates part sizes
-        loadMessage();
-        QList<NmMessagePart*> messageParts;
-        mMessage->attachmentList(messageParts);
-        for (int i = 0; i < messageParts.count(); i++) {
-            // if message part found and its fetched size is smaller than size start part fetch
-            if (messageParts[i]->id() == attaId &&
-                messageParts[i]->size() > messageParts[i]->fetchedSize()) {
-                // delete old message fetch operation
-                if (mFetchOperation) {
-                    delete mFetchOperation;
-                    mFetchOperation = NULL;
-                }
-                // can return null
-                mFetchOperation = mUiEngine.fetchMessagePart(
-                        mMessage->mailboxId(),
-                        mMessage->parentId(),
-                        mMessage->envelope().id(),
+    NmId attaId = mAttaIdList.at(index);
+    // reload message to get updates part sizes
+    loadMessage();
+    QList<NmMessagePart*> messageParts;
+    mMessage->attachmentList(messageParts);
+    for (int i = 0; i < messageParts.count(); i++) {
+        // message part found have to found
+        // and its fetched size is smaller than size, then start part fetch
+        if (messageParts[i]->partId() == attaId &&
+            messageParts[i]->size() > messageParts[i]->fetchedSize()) {
+            // do not start if there's already ongoing fetch
+            if (mAttaIndexUnderFetch == NmNotFoundError) {
+                mAttaIndexUnderFetch = index;
+                mAttaManager.fetchAttachment(
+                        mMessage->envelope().mailboxId(),
+                        mMessage->envelope().folderId(),
+                        mMessage->envelope().messageId(),
                         attaId);
-                if (mFetchOperation) {
-                    mAttaIndexUnderFetch = index;
-                    QObject::connect(mFetchOperation, SIGNAL(operationCompleted(int)),
-                            this, SLOT(attachmentFetchCompleted(int)));
-                    QObject::connect(mFetchOperation, SIGNAL(operationProgressChanged(int)),
-                            this, SLOT(changeProgress(int)));
-                    QObject::connect(this, SIGNAL(progressValueChanged(int, int)),
-                            mAttaWidget, SLOT(setProgressBarValue(int, int)));
-                    // emit signal, set progress to 5% when started
-                    progressValueChanged(index, 5);
-                }
             }
-            // attachment is fetched, open file
-            else if (messageParts[i]->id() == attaId) {
-                XQSharableFile file = mUiEngine.messagePartFile(
-                        mMessage->mailboxId(),
-                        mMessage->parentId(),
-                        mMessage->envelope().id(),
-                        attaId);
-                NmUtilities::openFile(file);
-                file.close();
-            }
+        }
+        // attachment is fetched, open file
+        else if (messageParts[i]->partId() == attaId) {
+            XQSharableFile file = mUiEngine.messagePartFile(
+                    mMessage->envelope().mailboxId(),
+                    mMessage->envelope().folderId(),
+                    mMessage->envelope().messageId(),
+                    attaId);
+            NmUtilities::openFile(file);
+            file.close();
         }
     }
 }
 
 /*!
-
-*/
-void NmViewerView::changeProgress(int progressValue)
-{
-    // find running
-   if (mAttaIndexUnderFetch != NmNotFoundError) {
-       // emit signal
-       if (mAttaWidget && mAttaWidget->progressValue(mAttaIndexUnderFetch) < progressValue) {
-           progressValueChanged(mAttaIndexUnderFetch, progressValue);
-       }
-   }
-}
-
-/*!
-
-*/
-void NmViewerView::attachmentFetchCompleted(int result)
-{
-    Q_UNUSED(result);
-    if (mAttaWidget && mAttaIndexUnderFetch != NmNotFoundError) {
-        mAttaWidget->setProgressBarValue(mAttaIndexUnderFetch, 100);
-        mAttaIndexUnderFetch = NmNotFoundError;
-    }
-}
-
-/*!
-    Function formats message based on actual data 
+    Function formats message based on actual data
 */
 QString NmViewerView::formatMessage()
 {
@@ -503,13 +521,13 @@
             // the web view.
             quint32 fetchedSize = child->fetchedSize();
             quint32 size = child->size();
-            if (fetchedSize >= size && 
+            if (fetchedSize >= size &&
                     child->contentType().startsWith("image", Qt::CaseInsensitive)) {
                 QString contentId = child->contentId();
                 int ret = mUiEngine.contentToMessagePart(
-                        mMessage->mailboxId(),
-                        mMessage->parentId(),
-                        mMessage->envelope().id(),
+                        mMessage->envelope().mailboxId(),
+                        mMessage->envelope().folderId(),
+                        mMessage->envelope().messageId(),
                         *child);
                 if (ret == NmNoError) {
                   mWebView->addContent(contentId, QVariant::fromValue(child->binaryContent()));
@@ -517,9 +535,9 @@
             }
         }
         int ret = mUiEngine.contentToMessagePart(
-                mMessage->mailboxId(),
-                mMessage->parentId(),
-                mMessage->envelope().id(),
+                mMessage->envelope().mailboxId(),
+                mMessage->envelope().folderId(),
+                mMessage->envelope().messageId(),
                 *html);
         if (ret == NmNoError) {
             msg = html->textContent();
@@ -529,11 +547,11 @@
         NmMessagePart *plain = mMessage->plainTextBodyPart();
         if (plain) {
             int ret = mUiEngine.contentToMessagePart(
-                    mMessage->mailboxId(),
-                    mMessage->parentId(),
-                    mMessage->envelope().id(),
+                    mMessage->envelope().mailboxId(),
+                    mMessage->envelope().folderId(),
+                    mMessage->envelope().messageId(),
                     *plain);
-            if (ret == NmNoError) {            
+            if (ret == NmNoError) {
                 QTextDocument doku;
                 // set font
                 QFont currentFont = doku.defaultFont();
@@ -541,19 +559,19 @@
                 qreal secondarySize;
                 HbStyle myStyle;
                 bool found = myStyle.parameter(NmParamTextHeightSecondary, secondarySize);
-                if (found) {                
+                if (found) {
                     HbFontSpec fontSpec(HbFontSpec::Secondary);
                     fontSpec.setTextHeight(secondarySize);
-                    currentFont.setPixelSize(fontSpec.font().pixelSize());                    
+                    currentFont.setPixelSize(fontSpec.font().pixelSize());
                 }
-                doku.setDefaultFont(currentFont);  
+                doku.setDefaultFont(currentFont);
                 // convert to html
-                doku.setPlainText(plain->textContent());                                 
+                doku.setPlainText(plain->textContent());
                 msg = doku.toHtml();
 
-                if (qApp->layoutDirection()==Qt::RightToLeft){                
+                if (qApp->layoutDirection()==Qt::RightToLeft){
                     // add right alignment to document css section
-                    QRegExp rx("(<style type=\"text/css\">)(.+)(</style>)", Qt::CaseInsensitive);                   
+                    QRegExp rx("(<style type=\"text/css\">)(.+)(</style>)", Qt::CaseInsensitive);
                     rx.setMinimal(true);
                     int pos = rx.indexIn(msg);
                     if (pos > -1) {
@@ -611,24 +629,24 @@
 void NmViewerView::webFrameLoaded(bool loaded)
 {
     if (loaded){
-        loadingCompleted = true;
+        webFrameloadingCompleted = true;
         // Scale web view after loading the
         // complete contents, including images
-        QTimer::singleShot(nmViewLoadTimer, this, SLOT(scaleWebViewWhenLoaded()));
+        QMetaObject::invokeMethod(this, "scaleWebViewWhenLoaded", Qt::QueuedConnection);       
     }
-} 
+}
 
 /*!
     Scale web view width when loading is ongoing
 */
 void NmViewerView::scaleWebViewWhenLoading(const QSize &size)
 {
-    // Try to scale web view while mainframe is being loaded. 
+    // Try to scale web view while mainframe is being loaded.
     // So that screen is scrollable even before images are fully loaded
     // First check that new size is different than previous, no need to react if
     // same size value is received more than once.
     if (size!=mLatestLoadingSize){
-        if (!loadingCompleted&&mWebView&&mWebView->page()&&
+        if (!webFrameloadingCompleted&&mWebView&&mWebView->page()&&
             (size.width()>mScreenSize.width()||size.height()>mScreenSize.height())) {
             int width = (int)size.width();
             int height = (int)size.height();
@@ -636,16 +654,16 @@
             if (mDisplayingPlainText){
                 mWebView->setMaximumWidth(mScreenSize.width());
                 mWebView->setMinimumWidth(mScreenSize.width());
-                mWebView->setPreferredWidth(mScreenSize.width()); 
+                mWebView->setPreferredWidth(mScreenSize.width());
             }
             else {
                  mWebView->setMaximumWidth(width);
                  mWebView->setMinimumWidth(width);
-                 mWebView->setPreferredWidth(width);                
+                 mWebView->setPreferredWidth(width);
             }
             mWebView->setMinimumHeight(height);
             mWebView->setPreferredHeight(height);
-        }    
+        }
     }
     mLatestLoadingSize=size;
 }
@@ -656,7 +674,7 @@
 void NmViewerView::scaleWebViewWhenLoaded()
 {
     if (mWebView&&mWebView->page()) {
-        QSizeF contentSize = mWebView->page()->mainFrame()->contentsSize(); 
+        QSizeF contentSize = mWebView->page()->mainFrame()->contentsSize();
         int width = (int)contentSize.width();
         int height = (int)contentSize.height();
         // Set content (webview) width
@@ -686,7 +704,7 @@
                 mWebView->setMinimumHeight(height);
                 mWebView->setMaximumHeight(height);
                 mWebView->setPreferredHeight(height);
-            }                
+            }
         }
     }
 }
@@ -706,15 +724,15 @@
     if (mAttaWidget){
         // Set attawidget minimum & maximum size
         mAttaWidget->setMinimumWidth(mScreenSize.width());
-        mAttaWidget->setMaximumWidth(mScreenSize.width());   
+        mAttaWidget->setMaximumWidth(mScreenSize.width());
     }
- 
+
     // Scale web view and its contens
     if (mWebView){
         if (mDisplayingPlainText){
             mWebView->setMaximumWidth((int)mScreenSize.width());
             mWebView->page()->setPreferredContentsSize(QSize((int)mScreenSize.width(),
-                                           (int)mScreenSize.height()));  
+                                           (int)mScreenSize.height()));
         }
         else{
             // Check whether contentsize fits to screen
@@ -729,11 +747,11 @@
                 mWebView->setMaximumWidth((int)mScreenSize.width());
                 mWebView->page()->setPreferredContentsSize(QSize((int)mScreenSize.width(),
                                                (int)mScreenSize.height()));
-            }        
+            }
         }
     }
 
-    if(mToolbar) {
+    if (mToolbarEnabled) {
 		// Re-create toolbar in orientation switch
 		createToolBar();
     }
@@ -748,7 +766,7 @@
 void NmViewerView::orientationChanged(Qt::Orientation orientation)
 {
     Q_UNUSED(orientation);
-    QTimer::singleShot(nmOrientationTimer, this, SLOT(adjustViewDimensions()));
+    QTimer::singleShot(NmOrientationTimer, this, SLOT(adjustViewDimensions()));
 }
 
 /*!
@@ -851,7 +869,7 @@
 {
     QList<const NmMessageEnvelope*> envelopeList;
     NmMessageEnvelope *envelope = &mMessage->envelope();
-    NmStoreEnvelopesOperation* op = NULL;
+    QPointer<NmStoreEnvelopesOperation> op(NULL);
     if (envelope){
         if ( read != envelope->isRead() ){
             if (read){
@@ -873,9 +891,6 @@
                     envelopeList);
             }
         }
-        if(op){
-            mUiEngine.storeOperation(op);
-            }
     }
 }
 
@@ -946,13 +961,13 @@
 */
 void NmViewerView::createOptionsMenu()
 {
-	HbMenu *optionsMenu = menu(); 
+	HbMenu *optionsMenu = menu();
 	NmUiExtensionManager &extMngr = mApplication.extManager();
 	if (optionsMenu && &extMngr && mStartParam) {
 		optionsMenu->clearActions();
 		NmActionRequest request(this, NmActionOptionsMenu, NmActionContextViewViewer,
 				NmActionContextDataNone, mStartParam->mailboxId(), mStartParam->folderId() );
-		
+
 		QList<NmAction*> list;
 		extMngr.getActions(request, list);
 		for (int i=0;i<list.count();i++) {
@@ -968,9 +983,9 @@
 void NmViewerView::handleActionCommand(NmActionResponse &actionResponse)
 {
     bool showSendInProgressNote = false;
-    
+
     // Handle options menu or toolbar
-    if (actionResponse.menuType() == NmActionOptionsMenu || 
+    if (actionResponse.menuType() == NmActionOptionsMenu ||
     	actionResponse.menuType() == NmActionToolbar) {
         switch (actionResponse.responseCommand()) {
             case NmActionResponseCommandReply: {
@@ -1010,35 +1025,24 @@
                 HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
                 messageBox->setText(hbTrId("txt_mail_dialog_delete_mail"));
                 messageBox->setTimeout(HbMessageBox::NoTimeout);
-                    
+
+                mOkAction = new HbAction(tr("Ok"),messageBox);
+                mCancelAction = new HbAction(tr("Cancel"),messageBox);
+                messageBox->addAction(mOkAction);
+                messageBox->addAction(mCancelAction);
+                
                 // Read user selection
-                HbAction *action = messageBox->exec(); 
-                if((action == messageBox->primaryAction())){
-                    QList<NmId> messageList;
-                    messageList.append(mStartParam->messageId());
-
-                    int err = mUiEngine.deleteMessages(mStartParam->mailboxId(),
-                                                       mStartParam->folderId(),
-                                                       messageList);
-                    
-                    messageList.clear();
-                    if (NmNoError != err) {
-                        // Failed to delete the messages!
-                        NMLOG(QString("NmViewerView::handleActionCommand(): failed err=%1").arg(err));
-                    }
-                }
-                delete messageBox;
-                messageBox = NULL;
-            }
+                messageBox->open(this, SLOT(deleteButton(HbAction*)));
+              }
             break;
             default:
                 break;
         }
     }
-    
+
     if (showSendInProgressNote) {
         QString noteText = hbTrId("txt_mail_dialog_still_sending");
-        
+
         // get message subject from the message being sent
         const NmMessage *message = mUiEngine.messageBeingSent();
         if (message) {
@@ -1049,12 +1053,69 @@
 }
 
 /*!
-    externalDelete. From NmMessageListModel, handles viewer shutdown when current message is deleted. 
+    Slot. Signaled when delete button is pressed
+*/
+void NmViewerView::deleteButton(HbAction* result)
+{
+     if (result == mOkAction ) {
+        QList<NmId> messageList;
+        messageList.append(mStartParam->messageId());
+
+        int err = mUiEngine.deleteMessages(mStartParam->mailboxId(),
+                                           mStartParam->folderId(),
+                                           messageList);
+
+        messageList.clear();
+        if (NmNoError != err) {
+            // Failed to delete the messages!
+            NMLOG(QString("NmViewerView::handleActionCommand(): failed err=%1").arg(err));
+        }
+    }
+
+    mCancelAction = NULL;
+    mOkAction = NULL;
+}
+
+
+/*!
+    Slot. Signaled when attachment fetch progress changes
 */
-void NmViewerView::externalDelete(const NmId &messageId)
+void NmViewerView::progressChanged(int value)
+{
+    if (mAttaIndexUnderFetch != NmNotFoundError) {
+        // emit signal
+        if (mAttaWidget && mAttaWidget->progressValue(mAttaIndexUnderFetch) < value) {
+            progressValueChanged(mAttaIndexUnderFetch, value);
+        }
+    }
+}
+
+/*!
+    Slot. Signaled when attachment fetch is completed
+*/
+void NmViewerView::fetchCompleted(int result)
 {
-    if ((mStartParam->viewId()==NmUiViewMessageViewer) && 
-        (mStartParam->messageId()==messageId)){
+    if (mAttaWidget && mAttaIndexUnderFetch != NmNotFoundError) {
+        if (result == NmNoError) {
+            progressValueChanged(mAttaIndexUnderFetch, 100);
+        }
+        else {
+            mAttaWidget->hideProgressBar(mAttaIndexUnderFetch);
+        }
+    }
+    mAttaIndexUnderFetch = NmNotFoundError;
+}
+
+/*!
+    externalDelete. From NmMessageListModel, handles viewer shutdown when current message is deleted.
+*/
+void NmViewerView::messageDeleted(const NmId &mailboxId, const NmId &folderId, const NmId &messageId)
+{
+    NMLOG("NmViewerView::messageDeleted");
+    if ((mStartParam->viewId() == NmUiViewMessageViewer)
+        && (mStartParam->mailboxId()== mailboxId)
+        && (mStartParam->folderId()== folderId)
+        && (mStartParam->messageId()== messageId)){
         mApplication.popView();
     }
 }
--- a/emailuis/nmailui/src/nmviewerviewnetmanager.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/src/nmviewerviewnetmanager.cpp	Fri May 14 15:41:10 2010 +0300
@@ -55,13 +55,20 @@
 QNetworkReply *NmViewerViewNetManager::createRequest(
     Operation op, const QNetworkRequest &request, QIODevice *outgoingData)
 {
-    const QUrl requestUrl = request.url();
+    QNetworkRequest myRequest(request);
+    // Set request attribute to prefer cachevar  
+    const QVariant cacheControl((int)QNetworkRequest::PreferCache);
+    myRequest.setAttribute(QNetworkRequest::CacheLoadControlAttribute, 
+                         cacheControl);
+    const QUrl requestUrl = myRequest.url();
+    // Check whether request is for embedded image
     if (mMessageView&&mMessageView->webView()&&op==QNetworkAccessManager::GetOperation
         && requestUrl.scheme()==NmViewerViewNetManagerScheme) {
         NmViewerViewNetReply* reply = new NmViewerViewNetReply(
             mMessageView->webView()->loadResource(QTextDocument::ImageResource, requestUrl));
-        reply->setOriginalRequest(request);
+        reply->setOriginalRequest(myRequest);
         return reply;
         }
-    return QNetworkAccessManager::createRequest(op, request, outgoingData);
+    // If request is not for embedded image, forward to base class
+    return QNetworkAccessManager::createRequest(op, myRequest, outgoingData);
 }
Binary file emailuis/nmailui/translations/mail.qm has changed
--- a/emailuis/nmailui/translations/mail.ts	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailui/translations/mail.ts	Fri May 14 15:41:10 2010 +0300
@@ -12,6 +12,16 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mail_viewer_opt_delete">
+    <comment>Options menu item in mail viewer: Shows &quot;Delete mail&quot; confirmation query</comment>        
+    <source>Delete</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_menu_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_02</extra-loc-viewid>
+    <extra-loc-positionid>opt</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mail_dialog_mail_connection_error">
     <comment>Error note. This is shown when the sending, receiving etc. occurs.</comment>        
     <source>Mail connection error.</source>
@@ -42,16 +52,6 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mail_dialog_mail_address_or_password_is_incorr">
-    <comment></comment>        
-    <source>Mail address or password is incorrect, check the settings ( &lt;-link)</source>
-    <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id></extra-loc-layout_id>    
-    <extra-loc-viewid>mail</extra-loc-viewid>
-    <extra-loc-positionid>dialog</extra-loc-positionid>
-    <extra-loc-feature>mail</extra-loc-feature>
-    <extra-loc-blank>False</extra-loc-blank>
-</message>
 <message numerus="no" id="txt_mail_dialog_you_can_not_send_more_than_l1_kb">
     <comment>Information note. %L1 is the maximum size of all attachments the server allows to be sent at once. If the adds  attachments, which overall size exceeds the limit and presses send this note is shown and the mail is not sent. Maximum number of digits replacing the parameter is 4.</comment>        
     <source>You can not send more than %L1 Mb as attachments </source>
@@ -92,16 +92,6 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mail_dialog_server_settings_incorrect_link">
-    <comment></comment>        
-    <source>Server settings are incorrect. (&lt;-link)</source>
-    <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id></extra-loc-layout_id>    
-    <extra-loc-viewid>mail</extra-loc-viewid>
-    <extra-loc-positionid>dialog</extra-loc-positionid>
-    <extra-loc-feature>mail</extra-loc-feature>
-    <extra-loc-blank>False</extra-loc-blank>
-</message>
 <message numerus="no" id="txt_mail_list_cc">
     <comment>Cc label in mail viewer</comment>        
     <source>Cc:</source>
@@ -152,6 +142,26 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mail_viewer_opt_reply_all">
+    <comment>Options menu item in mail viewer: opens editor for replying to all</comment>        
+    <source>Reply all</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_menu_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_02</extra-loc-viewid>
+    <extra-loc-positionid>opt</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_mail_viewer_opt_reply">
+    <comment>Options menu item in mail viewer: opens editor for replying</comment>        
+    <source>Reply</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_menu_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_02</extra-loc-viewid>
+    <extra-loc-positionid>opt</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mail_opt_add_priority_sub_high">
     <comment>Suboption for option &quot;Add priority&quot; to set mail as high priority.</comment>        
     <source>High</source>
@@ -202,12 +212,12 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mail_dpophead _1_deleted">
-    <comment>Confirmation note shown after the mailbox is deleted succesfully.</comment>        
-    <source>Mailbox deleted. </source>
-    <translation variants="yes" type="unfinished"></translation>
-    <extra-loc-layout_id> </extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06</extra-loc-viewid>
+<message numerus="no" id="txt_mail_dialog_sending_failed">
+    <comment>This is error note is shown if sending fails. %[]1 is replaced with the name of mail the sending of which failed.</comment>        
+    <source>Sending mail %[]1 failed. Try to send it again or press back to cancel</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_04</extra-loc-viewid>
     <extra-loc-positionid>dialog</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -292,16 +302,6 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mail_dialog_sending failed">
-    <comment>This is error note is shown if sending fails. %[]1 is replaced with the name of mail the sending of which failed.</comment>        
-    <source>Sending mail %[]1 failed. Try to send it again or press back to cancel</source>
-    <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04</extra-loc-viewid>
-    <extra-loc-positionid>dialog</extra-loc-positionid>
-    <extra-loc-feature>mail</extra-loc-feature>
-    <extra-loc-blank>False</extra-loc-blank>
-</message>
 <message numerus="no" id="txt_mail_list_l1_mb">
     <comment>the size of the attachment. Maximum number of digits replacing the parameter is 3. The file name truncates if needed. Displayed on the same row and after the name of the attachment.</comment>        
     <source>(%L1 Mb)</source>
@@ -322,6 +322,16 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mail_shareui_sending_please_wait">
+    <comment>Text for shared UI component wait note. Shown when the user has sent an email from shared UI.</comment>        
+    <source>Sending, please wait</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_notifdialog_pri2</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_04</extra-loc-viewid>
+    <extra-loc-positionid>dialog</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mail_list_fw">
     <comment>Custom layout ID parent. Prefix in subject field in the editor. This indicates that the mail is forwarded</comment>        
     <source>Fw:</source>
@@ -402,6 +412,16 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mail_dialog_server_settings_incorrect">
+    <comment>Notification shown when the connection fails (e.g. when syncing) due to server settings. </comment>        
+    <source>Server settings are incorrect. Do you want to check the settings?</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>    
+    <extra-loc-viewid>mail</extra-loc-viewid>
+    <extra-loc-positionid>dialog</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mail_dialog_loading_mail_content">
     <comment>Wait note shown until the mail content is loaded </comment>        
     <source>Loading mail content</source>
@@ -422,13 +442,13 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mail_button_delete">
-    <comment>Toolbar button text in landscape: Shows &quot;Delete mail&quot; confirmation query</comment>        
-    <source>Delete</source>
-    <translation variants="yes" type="unfinished"></translation>
-    <extra-loc-layout_id>qtl_toolbar_tiny_4</extra-loc-layout_id>    
+<message numerus="no" id="txt_mail_viewer_opt_forward">
+    <comment>Options menu item in mail viewer: opens editor for forwarding</comment>        
+    <source>Forward</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_menu_pri</extra-loc-layout_id>    
     <extra-loc-viewid>mail_02</extra-loc-viewid>
-    <extra-loc-positionid>button</extra-loc-positionid>
+    <extra-loc-positionid>opt</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
@@ -442,16 +462,6 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mail_button_forward">
-    <comment>Toolbar button text in landscape: opens editor for forwarding</comment>        
-    <source>Forward</source>
-    <translation variants="yes" type="unfinished"></translation>
-    <extra-loc-layout_id>qtl_toolbar_tiny_4</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_02</extra-loc-viewid>
-    <extra-loc-positionid>button</extra-loc-positionid>
-    <extra-loc-feature>mail</extra-loc-feature>
-    <extra-loc-blank>False</extra-loc-blank>
-</message>
 <message numerus="no" id="txt_mail_dialog_delete_message">
     <comment>This conifrmation is shown if the user presses &quot;Back&quot; in the editor. Selecting yes deletes the composed message. &quot;No&quot; returns to the editor.</comment>        
     <source>Delete message?</source>
@@ -462,6 +472,16 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mail_dialog_invalid_mail_address">
+    <comment>Note in editor when the user has typed incorrect mail address (e.g. without @-character). %[]1 is replaced with the name of the invalid mail address.</comment>        
+    <source>Invalid mail address: %[]1</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>    
+    <extra-loc-viewid>mail</extra-loc-viewid>
+    <extra-loc-positionid>dialog</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mail_list_new_video">
     <comment>Attach toolbar extension item in the viewer, opens camera for taking a new video</comment>        
     <source>New video</source>
@@ -472,16 +492,6 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mail_dialog_invalid_mail_address">
-    <comment>Note in editor when the user has typed incorrect mail address (e.g. without @-character). %[]1 is replaced with the name of the invalid mail address.</comment>        
-    <source>Invalid mail address: %[]1</source>
-    <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>    
-    <extra-loc-viewid>mail</extra-loc-viewid>
-    <extra-loc-positionid>dialog</extra-loc-positionid>
-    <extra-loc-feature>mail</extra-loc-feature>
-    <extra-loc-blank>False</extra-loc-blank>
-</message>
 <message numerus="no" id="txt_common_menu_open">
     <comment>Item specific option for opening the highlighted mail. </comment>        
     <source>Open</source>
@@ -622,6 +632,16 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mail_dpophead_1_deleted">
+    <comment>Confirmation note shown after the mailbox is deleted succesfully.</comment>        
+    <source>Mailbox deleted. </source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_notifdialog_pri2</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_06</extra-loc-viewid>
+    <extra-loc-positionid>dialog</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mail_editor_reply_original_msg">
     <comment>Original message header data in the editor. Separates the original mail message from the edit area of the new message the user is typing.</comment>        
     <source>---- Original message ----</source>
@@ -652,6 +672,16 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mail_dialog_no">
+    <comment>Button for notes txt_mail_dialog_server_settings_incorrect and txt_mail_dialog_address_or_password_incorrect.</comment>        
+    <source>No</source>
+    <translation variants="yes" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_softkey_2</extra-loc-layout_id>    
+    <extra-loc-viewid>mail</extra-loc-viewid>
+    <extra-loc-positionid>dialog</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mail_dialog_no_mailboxes_create_new">
     <comment>Confirmation note. If the user opens &quot;Mail&quot; from Control Panel - Accounts and there are no Mail accounts created this note is shown to promote the functionality. Selecting Yes launches Mail Wizard</comment>        
     <source>No mailboxes have been defined. Would you like to create a new mailbox?</source>
@@ -732,6 +762,16 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<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="yes" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_softkey_2</extra-loc-layout_id>    
+    <extra-loc-viewid>mail</extra-loc-viewid>
+    <extra-loc-positionid>dialog</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mail_editor_reply_from">
     <comment>Original message header data in the editor. Followed by the name/mail address of the sender of the message.</comment>        
     <source>From:</source>
@@ -753,8 +793,8 @@
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mail_dialog_do_you_want_to_delete_mfe">
-    <comment>Confirmation note for mailbox deleting. This will delete also contacts, calendar and notes data, which has been synchronized via this account. This MfE protocol only</comment>        
-    <source>Do you want to delete all mail, calendar, contacts and notes data related to this account?</source>
+    <comment>Confirmation note for mailbox deleting. This will delete also contacts, calendar and tasks data, which has been synchronized via this account. This MfE protocol only</comment>        
+    <source>Do you want to delete all mail, calendar, contacts and tasks data related to this account?</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>    
     <extra-loc-viewid>mail</extra-loc-viewid>
@@ -782,16 +822,6 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mail_button_reply">
-    <comment>Toolbar button text in landscape: opens editor for replying</comment>        
-    <source>Reply</source>
-    <translation variants="yes" type="unfinished"></translation>
-    <extra-loc-layout_id>qtl_toolbar_tiny_4</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_02</extra-loc-viewid>
-    <extra-loc-positionid>button</extra-loc-positionid>
-    <extra-loc-feature>mail</extra-loc-feature>
-    <extra-loc-blank>False</extra-loc-blank>
-</message>
 <message numerus="no" id="txt_mail_dialog_sending_mail">
     <comment>Wait note for the case where sending takes some time. </comment>        
     <source>Sending mail</source>
@@ -802,16 +832,6 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mail_list_other">
-    <comment>Attach toolbar extension item in the viewer, opens file fetch for selecting any type of file</comment>        
-    <source>Other</source>
-    <translation variants="yes" type="unfinished"></translation>
-    <extra-loc-layout_id>qtl_list_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04_b</extra-loc-viewid>
-    <extra-loc-positionid>list</extra-loc-positionid>
-    <extra-loc-feature>mail</extra-loc-feature>
-    <extra-loc-blank>False</extra-loc-blank>
-</message>
 <message numerus="no" id="txt_mail_menu_search_from_service">
     <comment>Item specific command for searching number &amp;address from the service</comment>        
     <source>search from service</source>
@@ -832,19 +852,9 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mail_button_reply_all">
-    <comment>Toolbar button text in landscape: opens editor for replying to all</comment>        
-    <source>Reply all</source>
-    <translation variants="yes" type="unfinished"></translation>
-    <extra-loc-layout_id>qtl_toolbar_tiny_4</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_02</extra-loc-viewid>
-    <extra-loc-positionid>button</extra-loc-positionid>
-    <extra-loc-feature>mail</extra-loc-feature>
-    <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_mail_list_new_photo">
-    <comment>Attach toolbar extension item in the viewer, opens camera for taking a new photo</comment>        
-    <source>New photo</source>
+<message numerus="no" id="txt_mail_list_other">
+    <comment>Attach toolbar extension item in the viewer, opens file fetch for selecting any type of file</comment>        
+    <source>Other</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_pri</extra-loc-layout_id>    
     <extra-loc-viewid>mail_04_b</extra-loc-viewid>
@@ -852,6 +862,16 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mail_dialog_address_or_password_incorrect">
+    <comment>Notification shown when the connection fails (e.g. when syncing) due to mail address or password. </comment>        
+    <source>Mail address or password is incorrect. Do you want to check the settings?</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>    
+    <extra-loc-viewid>mail</extra-loc-viewid>
+    <extra-loc-positionid>dialog</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mail_list_music">
     <comment>Attach toolbar extension item in the viewer, opens music fetch for selecting music file. Allows the user to attach a music file to the message.</comment>        
     <source>Music</source>
@@ -862,6 +882,16 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mail_list_new_photo">
+    <comment>Attach toolbar extension item in the viewer, opens camera for taking a new photo</comment>        
+    <source>New photo</source>
+    <translation variants="yes" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_list_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_04_b</extra-loc-viewid>
+    <extra-loc-positionid>list</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mail_dialog_opening_mail_editor">
     <comment>Wait note for the case where opening an editor takes some time, this can happen when replying to or forwarding mail. </comment>        
     <source>Opening mail editor</source>
--- a/emailuis/nmailuiengine/bwins/nmailuiengineu.def	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiengine/bwins/nmailuiengineu.def	Fri May 14 15:41:10 2010 +0300
@@ -3,264 +3,329 @@
 	??0NmUiEngine@@AAE@XZ @ 2 NONAME ; NmUiEngine::NmUiEngine(void)
 	?insertDividerIntoModel@NmMessageListModel@@AAEXPAVNmMessageEnvelope@@H@Z @ 3 NONAME ; void NmMessageListModel::insertDividerIntoModel(class NmMessageEnvelope *, int)
 	?goOnline@NmUiEngine@@QAEHABVNmId@@@Z @ 4 NONAME ; int NmUiEngine::goOnline(class NmId const &)
-	?currentMailboxId@NmMessageListModel@@QAE?AVNmId@@XZ @ 5 NONAME ; class NmId NmMessageListModel::currentMailboxId(void)
-	?folderById@NmDataManager@@QAEPAVNmFolderMetaData@@ABVNmId@@0@Z @ 6 NONAME ; class NmFolderMetaData * NmDataManager::folderById(class NmId const &, class NmId const &)
-	?completeOperationPart@NmAddAttachmentsOperation@@QAEXABVQString@@ABVNmId@@H@Z @ 7 NONAME ; void NmAddAttachmentsOperation::completeOperationPart(class QString const &, class NmId const &, int)
-	?createForwardMessage@NmUiEngine@@QAEPAVNmMessageCreationOperation@@ABVNmId@@0@Z @ 8 NONAME ; class NmMessageCreationOperation * NmUiEngine::createForwardMessage(class NmId const &, class NmId const &)
-	?releaseInstance@NmUiEngine@@SAXAAPAV1@@Z @ 9 NONAME ; void NmUiEngine::releaseInstance(class NmUiEngine * &)
-	?id@NmMailboxMetaData@@QBE?AVNmId@@XZ @ 10 NONAME ; class NmId NmMailboxMetaData::id(void) const
-	?qt_metacast@NmUiEngine@@UAEPAXPBD@Z @ 11 NONAME ; void * NmUiEngine::qt_metacast(char const *)
-	?setName@NmMailboxMetaData@@QAEXABVQString@@@Z @ 12 NONAME ; void NmMailboxMetaData::setName(class QString const &)
-	??1NmAddAttachmentsOperation@@UAE@XZ @ 13 NONAME ; NmAddAttachmentsOperation::~NmAddAttachmentsOperation(void)
-	?fetchMessage@NmUiEngine@@QAEPAVNmOperation@@ABVNmId@@00@Z @ 14 NONAME ; class NmOperation * NmUiEngine::fetchMessage(class NmId const &, class NmId const &, class NmId const &)
-	?isRunning@NmOperation@@QBE_NXZ @ 15 NONAME ; bool NmOperation::isRunning(void) const
-	??0NmOperation@@QAE@PAVQObject@@@Z @ 16 NONAME ; NmOperation::NmOperation(class QObject *)
-	?setPriorityLow@NmBaseClientPlugin@@QAEXXZ @ 17 NONAME ; void NmBaseClientPlugin::setPriorityLow(void)
-	?openMessage@NmBaseClientPlugin@@QAEXXZ @ 18 NONAME ; void NmBaseClientPlugin::openMessage(void)
-	?getStaticMetaObject@NmMailboxListModel@@SAABUQMetaObject@@XZ @ 19 NONAME ; struct QMetaObject const & NmMailboxListModel::getStaticMetaObject(void)
-	?envelope@NmMessageListModelItem@@QBEABVNmMessageEnvelope@@XZ @ 20 NONAME ; class NmMessageEnvelope const & NmMessageListModelItem::envelope(void) const
-	?qt_metacall@NmMailboxListModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 21 NONAME ; int NmMailboxListModel::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?listMailboxIds@NmDataManager@@QAEXAAV?$QList@VNmId@@@@@Z @ 22 NONAME ; void NmDataManager::listMailboxIds(class QList<class NmId> &)
-	??0NmDataManager@@QAE@XZ @ 23 NONAME ; NmDataManager::NmDataManager(void)
-	?trUtf8@NmAddAttachmentsOperation@@SA?AVQString@@PBD0H@Z @ 24 NONAME ; class QString NmAddAttachmentsOperation::trUtf8(char const *, char const *, int)
-	?releaseMessageListModel@NmUiEngine@@QAEXABVNmId@@@Z @ 25 NONAME ; void NmUiEngine::releaseMessageListModel(class NmId const &)
-	?refresh@NmMailboxListModel@@QAEXAAV?$QList@PAVNmMailbox@@@@@Z @ 26 NONAME ; void NmMailboxListModel::refresh(class QList<class NmMailbox *> &)
-	?getStaticMetaObject@NmDataManager@@SAABUQMetaObject@@XZ @ 27 NONAME ; struct QMetaObject const & NmDataManager::getStaticMetaObject(void)
-	??1NmMessageListModel@@UAE@XZ @ 28 NONAME ; NmMessageListModel::~NmMessageListModel(void)
-	?handleCompletedSendOperation@NmUiEngine@@QAEXXZ @ 29 NONAME ; void NmUiEngine::handleCompletedSendOperation(void)
-	??_ENmFolderListModel@@UAE@I@Z @ 30 NONAME ; NmFolderListModel::~NmFolderListModel(unsigned int)
-	?contentToMessagePart@NmDataManager@@QAEHABVNmId@@00AAVNmMessagePart@@@Z @ 31 NONAME ; int NmDataManager::contentToMessagePart(class NmId const &, class NmId const &, class NmId const &, class NmMessagePart &)
-	?setExpanded@NmMessageListModelItem@@QAEX_N@Z @ 32 NONAME ; void NmMessageListModelItem::setExpanded(bool)
-	?setPriorityHigh@NmBaseClientPlugin@@QAEXXZ @ 33 NONAME ; void NmBaseClientPlugin::setPriorityHigh(void)
-	?deleteMessage@NmBaseClientPlugin@@QAEXXZ @ 34 NONAME ; void NmBaseClientPlugin::deleteMessage(void)
-	?getStaticMetaObject@NmAddAttachmentsOperation@@SAABUQMetaObject@@XZ @ 35 NONAME ; struct QMetaObject const & NmAddAttachmentsOperation::getStaticMetaObject(void)
-	?standardFolderId@NmUiEngine@@QAE?AVNmId@@ABV2@W4NmFolderType@@@Z @ 36 NONAME ; class NmId NmUiEngine::standardFolderId(class NmId const &, enum NmFolderType)
-	?settings@NmBaseClientPlugin@@QAEXXZ @ 37 NONAME ; void NmBaseClientPlugin::settings(void)
-	?staticMetaObject@NmUiEngine@@2UQMetaObject@@B @ 38 NONAME ; struct QMetaObject const NmUiEngine::staticMetaObject
-	?deleteMessageFromViewerView@NmBaseClientPlugin@@QAEXXZ @ 39 NONAME ; void NmBaseClientPlugin::deleteMessageFromViewerView(void)
-	?removeMessage@NmMessageListModel@@IAEXABVNmId@@@Z @ 40 NONAME ; void NmMessageListModel::removeMessage(class NmId const &)
-	?getIcon@NmIcons@@SAAAVHbIcon@@W4Icon@1@@Z @ 41 NONAME ; class HbIcon & NmIcons::getIcon(enum NmIcons::Icon)
-	?itemType@NmMessageListModelItem@@QBE?AW4NmMessageItemType@1@XZ @ 42 NONAME ; enum NmMessageListModelItem::NmMessageItemType NmMessageListModelItem::itemType(void) const
-	?removeAttachment@NmUiEngine@@QAEPAVNmOperation@@ABVNmMessage@@ABVNmId@@@Z @ 43 NONAME ; class NmOperation * NmUiEngine::removeAttachment(class NmMessage const &, class NmId const &)
-	?mInstance@NmDataPluginFactory@@0PAV1@A @ 44 NONAME ; class NmDataPluginFactory * NmDataPluginFactory::mInstance
-	?data@NmFolderListModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 45 NONAME ; class QVariant NmFolderListModel::data(class QModelIndex const &, int) const
-	?setName@NmFolderMetaData@@QAEXABVQString@@@Z @ 46 NONAME ; void NmFolderMetaData::setName(class QString const &)
-	?mReferenceCount@NmUiEngine@@0HA @ 47 NONAME ; int NmUiEngine::mReferenceCount
-	?listFolders@NmDataManager@@QAEXVNmId@@AAV?$QList@PAVNmFolder@@@@@Z @ 48 NONAME ; void NmDataManager::listFolders(class NmId, class QList<class NmFolder *> &)
-	?handleCompletedOperation@NmUiEngine@@QAEXXZ @ 49 NONAME ; void NmUiEngine::handleCompletedOperation(void)
-	?data@NmMailboxListModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 50 NONAME ; class QVariant NmMailboxListModel::data(class QModelIndex const &, int) const
-	?handlePreliminaryOperationFinished@NmOperation@@MAEXXZ @ 51 NONAME ; void NmOperation::handlePreliminaryOperationFinished(void)
-	?releaseInstance@NmDataPluginFactory@@SAXAAPAV1@@Z @ 52 NONAME ; void NmDataPluginFactory::releaseInstance(class NmDataPluginFactory * &)
-	?createEditorViewCommands@NmBaseClientPlugin@@AAEXABVNmActionRequest@@AAV?$QList@PAVNmAction@@@@@Z @ 53 NONAME ; void NmBaseClientPlugin::createEditorViewCommands(class NmActionRequest const &, class QList<class NmAction *> &)
-	?operationCancelled@NmOperation@@IAEXXZ @ 54 NONAME ; void NmOperation::operationCancelled(void)
-	??0NmDataPluginFactory@@AAE@XZ @ 55 NONAME ; NmDataPluginFactory::NmDataPluginFactory(void)
-	?refresh@NmBaseClientPlugin@@QAEXXZ @ 56 NONAME ; void NmBaseClientPlugin::refresh(void)
-	??1NmFolderMetaData@@UAE@XZ @ 57 NONAME ; NmFolderMetaData::~NmFolderMetaData(void)
-	?name@NmFolderMetaData@@QBE?AVQString@@XZ @ 58 NONAME ; class QString NmFolderMetaData::name(void) const
-	?sendMail@NmBaseClientPlugin@@QAEXXZ @ 59 NONAME ; void NmBaseClientPlugin::sendMail(void)
-	?insertNewMessageIntoModel@NmMessageListModel@@AAEXABVNmId@@00@Z @ 60 NONAME ; void NmMessageListModel::insertNewMessageIntoModel(class NmId const &, class NmId const &, class NmId const &)
-	?getStaticMetaObject@NmUiEngine@@SAABUQMetaObject@@XZ @ 61 NONAME ; struct QMetaObject const & NmUiEngine::getStaticMetaObject(void)
-	?metaObject@NmMessageListModel@@UBEPBUQMetaObject@@XZ @ 62 NONAME ; struct QMetaObject const * NmMessageListModel::metaObject(void) const
-	?messageBeingSent@NmUiEngine@@QBEPBVNmMessage@@XZ @ 63 NONAME ; class NmMessage const * NmUiEngine::messageBeingSent(void) const
-	?interfaceInstance@NmDataPluginFactory@@QAEPAVNmDataPluginInterface@@VNmId@@@Z @ 64 NONAME ; class NmDataPluginInterface * NmDataPluginFactory::interfaceInstance(class NmId)
-	?goOffline@NmBaseClientPlugin@@AAEXABVNmId@@@Z @ 65 NONAME ; void NmBaseClientPlugin::goOffline(class NmId const &)
-	?sendMessage@NmUiEngine@@QAEXPAVNmMessage@@ABV?$QList@PAVNmOperation@@@@@Z @ 66 NONAME ; void NmUiEngine::sendMessage(class NmMessage *, class QList<class NmOperation *> const &)
-	?tr@NmDataManager@@SA?AVQString@@PBD0H@Z @ 67 NONAME ; class QString NmDataManager::tr(char const *, char const *, int)
-	??0NmMailboxListModel@@QAE@AAVNmDataManager@@PAVQObject@@@Z @ 68 NONAME ; NmMailboxListModel::NmMailboxListModel(class NmDataManager &, class QObject *)
-	?setPriorityNormal@NmBaseClientPlugin@@QAEXXZ @ 69 NONAME ; void NmBaseClientPlugin::setPriorityNormal(void)
-	?changed@NmMessageListModel@@AAE_NABVNmMessageEnvelope@@0@Z @ 70 NONAME ; bool NmMessageListModel::changed(class NmMessageEnvelope const &, class NmMessageEnvelope const &)
-	?handleMailboxEvent@NmMailboxListModel@@QAEXW4NmMailboxEvent@@ABV?$QList@VNmId@@@@@Z @ 71 NONAME ; void NmMailboxListModel::handleMailboxEvent(enum NmMailboxEvent, class QList<class NmId> const &)
-	?trUtf8@NmMailboxListModel@@SA?AVQString@@PBD0H@Z @ 72 NONAME ; class QString NmMailboxListModel::trUtf8(char const *, char const *, int)
-	?mPluginArray@NmDataPluginFactory@@0PAV?$QList@PAVQObject@@@@A @ 73 NONAME ; class QList<class QObject *> * NmDataPluginFactory::mPluginArray
-	?getStaticMetaObject@NmMessageListModel@@SAABUQMetaObject@@XZ @ 74 NONAME ; struct QMetaObject const & NmMessageListModel::getStaticMetaObject(void)
-	?instance@NmDataPluginFactory@@SAPAV1@XZ @ 75 NONAME ; class NmDataPluginFactory * NmDataPluginFactory::instance(void)
-	?tr@NmUiEngine@@SA?AVQString@@PBD0H@Z @ 76 NONAME ; class QString NmUiEngine::tr(char const *, char const *, int)
-	?refresh@NmMessageListModel@@QAEXVNmId@@0ABV?$QList@PAVNmMessageEnvelope@@@@@Z @ 77 NONAME ; void NmMessageListModel::refresh(class NmId, class NmId, class QList<class NmMessageEnvelope *> const &)
-	?mailboxById@NmUiEngine@@QAEPAVNmMailboxMetaData@@ABVNmId@@@Z @ 78 NONAME ; class NmMailboxMetaData * NmUiEngine::mailboxById(class NmId const &)
-	??_ENmMessageListModelItem@@UAE@I@Z @ 79 NONAME ; NmMessageListModelItem::~NmMessageListModelItem(unsigned int)
-	?replyAllMail@NmBaseClientPlugin@@QAEXXZ @ 80 NONAME ; void NmBaseClientPlugin::replyAllMail(void)
-	?syncStateEvent@NmUiEngine@@IAEXW4NmSyncState@@ABVNmId@@@Z @ 81 NONAME ; void NmUiEngine::syncStateEvent(enum NmSyncState, class NmId const &)
-	?trUtf8@NmDataManager@@SA?AVQString@@PBD0@Z @ 82 NONAME ; class QString NmDataManager::trUtf8(char const *, char const *)
-	?setEnvelopeProperties@NmMessageListModel@@QAEXW4NmEnvelopeProperties@@ABV?$QList@VNmId@@@@@Z @ 83 NONAME ; void NmMessageListModel::setEnvelopeProperties(enum NmEnvelopeProperties, class QList<class NmId> const &)
-	?tr@NmUiEngine@@SA?AVQString@@PBD0@Z @ 84 NONAME ; class QString NmUiEngine::tr(char const *, char const *)
-	?mPluginLoaderArray@NmDataPluginFactory@@0V?$QList@PAVQPluginLoader@@@@A @ 85 NONAME ; class QList<class QPluginLoader *> NmDataPluginFactory::mPluginLoaderArray
-	?trUtf8@NmBaseClientPlugin@@SA?AVQString@@PBD0@Z @ 86 NONAME ; class QString NmBaseClientPlugin::trUtf8(char const *, char const *)
-	?trUtf8@NmBaseClientPlugin@@SA?AVQString@@PBD0H@Z @ 87 NONAME ; class QString NmBaseClientPlugin::trUtf8(char const *, char const *, int)
-	?createViewerViewCommands@NmBaseClientPlugin@@AAEXABVNmActionRequest@@AAV?$QList@PAVNmAction@@@@@Z @ 88 NONAME ; void NmBaseClientPlugin::createViewerViewCommands(class NmActionRequest const &, class QList<class NmAction *> &)
-	??1NmOperation@@UAE@XZ @ 89 NONAME ; NmOperation::~NmOperation(void)
-	?tr@NmMailboxListModel@@SA?AVQString@@PBD0H@Z @ 90 NONAME ; class QString NmMailboxListModel::tr(char const *, char const *, int)
-	?trUtf8@NmUiEngine@@SA?AVQString@@PBD0H@Z @ 91 NONAME ; class QString NmUiEngine::trUtf8(char const *, char const *, int)
-	?createMailboxItem@NmMailboxListModel@@AAEPAVNmMailboxListModelItem@@PBVNmMailbox@@@Z @ 92 NONAME ; class NmMailboxListModelItem * NmMailboxListModel::createMailboxItem(class NmMailbox const *)
-	?setTitleDivider@NmMessageListModelItem@@QAEXABVQString@@@Z @ 93 NONAME ; void NmMessageListModelItem::setTitleDivider(class QString const &)
-	?markAsRead@NmBaseClientPlugin@@QAEXXZ @ 94 NONAME ; void NmBaseClientPlugin::markAsRead(void)
-	?getInsertionIndex@NmMessageListModel@@ABEHABVNmMessageEnvelope@@@Z @ 95 NONAME ; int NmMessageListModel::getInsertionIndex(class NmMessageEnvelope const &) const
-	?updateOperationProgress@NmOperation@@QAEXH@Z @ 96 NONAME ; void NmOperation::updateOperationProgress(int)
-	?cleanupSendOperation@NmUiEngine@@QAEXXZ @ 97 NONAME ; void NmUiEngine::cleanupSendOperation(void)
-	??1NmFolderListModel@@UAE@XZ @ 98 NONAME ; NmFolderListModel::~NmFolderListModel(void)
-	??1NmDataManager@@UAE@XZ @ 99 NONAME ; NmDataManager::~NmDataManager(void)
-	?trUtf8@NmAddAttachmentsOperation@@SA?AVQString@@PBD0@Z @ 100 NONAME ; class QString NmAddAttachmentsOperation::trUtf8(char const *, char const *)
-	?name@NmMailboxMetaData@@QBE?AVQString@@XZ @ 101 NONAME ; class QString NmMailboxMetaData::name(void) const
-	?qt_metacall@NmDataManager@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 102 NONAME ; int NmDataManager::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?runAsyncOperation@NmOperation@@MAEXXZ @ 103 NONAME ; void NmOperation::runAsyncOperation(void)
-	??0NmFolderListModel@@QAE@AAVNmDataManager@@PAVQObject@@@Z @ 104 NONAME ; NmFolderListModel::NmFolderListModel(class NmDataManager &, class QObject *)
-	?tr@NmBaseClientPlugin@@SA?AVQString@@PBD0H@Z @ 105 NONAME ; class QString NmBaseClientPlugin::tr(char const *, char const *, int)
-	??0NmMailboxMetaData@@QAE@XZ @ 106 NONAME ; NmMailboxMetaData::NmMailboxMetaData(void)
-	?setEnvelope@NmMessageListModelItem@@QAEXPAVNmMessageEnvelope@@@Z @ 107 NONAME ; void NmMessageListModelItem::setEnvelope(class NmMessageEnvelope *)
-	?saveMessage@NmUiEngine@@QAEHABVNmMessage@@@Z @ 108 NONAME ; int NmUiEngine::saveMessage(class NmMessage const &)
-	?setId@NmMailboxMetaData@@QAEXABVNmId@@@Z @ 109 NONAME ; void NmMailboxMetaData::setId(class NmId const &)
-	?mReferenceCount@NmDataPluginFactory@@0HA @ 110 NONAME ; int NmDataPluginFactory::mReferenceCount
-	?tr@NmOperation@@SA?AVQString@@PBD0@Z @ 111 NONAME ; class QString NmOperation::tr(char const *, char const *)
-	?updateMessageEnvelope@NmMessageListModel@@AAEXABVNmId@@00@Z @ 112 NONAME ; void NmMessageListModel::updateMessageEnvelope(class NmId const &, class NmId const &, class NmId const &)
-	?messagesBelongUnderSameDivider@NmMessageListModel@@ABE_NPBVNmMessageEnvelope@@0@Z @ 113 NONAME ; bool NmMessageListModel::messagesBelongUnderSameDivider(class NmMessageEnvelope const *, class NmMessageEnvelope const *) const
-	?metaObject@NmDataManager@@UBEPBUQMetaObject@@XZ @ 114 NONAME ; struct QMetaObject const * NmDataManager::metaObject(void) const
-	?freeIcons@NmIcons@@SAXXZ @ 115 NONAME ; void NmIcons::freeIcons(void)
-	?isSendingMessage@NmUiEngine@@QBE_NXZ @ 116 NONAME ; bool NmUiEngine::isSendingMessage(void) const
-	?tr@NmAddAttachmentsOperation@@SA?AVQString@@PBD0@Z @ 117 NONAME ; class QString NmAddAttachmentsOperation::tr(char const *, char const *)
-	?instance@NmUiEngine@@SAPAV1@XZ @ 118 NONAME ; class NmUiEngine * NmUiEngine::instance(void)
-	?itemFromModel@NmMessageListModel@@AAEPAVNmMessageListModelItem@@ABVNmId@@@Z @ 119 NONAME ; class NmMessageListModelItem * NmMessageListModel::itemFromModel(class NmId const &)
-	?createMessageListCommands@NmBaseClientPlugin@@AAEXABVNmActionRequest@@AAV?$QList@PAVNmAction@@@@@Z @ 120 NONAME ; void NmBaseClientPlugin::createMessageListCommands(class NmActionRequest const &, class QList<class NmAction *> &)
-	?updateEnvelopeProperty@NmBaseClientPlugin@@AAEXW4NmEnvelopeProperties@@@Z @ 121 NONAME ; void NmBaseClientPlugin::updateEnvelopeProperty(enum NmEnvelopeProperties)
-	?goOffline@NmUiEngine@@QAEHABVNmId@@@Z @ 122 NONAME ; int NmUiEngine::goOffline(class NmId const &)
-	?staticMetaObject@NmDataManager@@2UQMetaObject@@B @ 123 NONAME ; struct QMetaObject const NmDataManager::staticMetaObject
-	?mInstance@NmUiEngine@@0PAV1@A @ 124 NONAME ; class NmUiEngine * NmUiEngine::mInstance
-	?attach@NmBaseClientPlugin@@QAEXXZ @ 125 NONAME ; void NmBaseClientPlugin::attach(void)
-	?metaObject@NmAddAttachmentsOperation@@UBEPBUQMetaObject@@XZ @ 126 NONAME ; struct QMetaObject const * NmAddAttachmentsOperation::metaObject(void) const
-	?refresh@NmFolderListModel@@QAEXAAV?$QList@PAVNmFolder@@@@@Z @ 127 NONAME ; void NmFolderListModel::refresh(class QList<class NmFolder *> &)
-	?trUtf8@NmMailboxListModel@@SA?AVQString@@PBD0@Z @ 128 NONAME ; class QString NmMailboxListModel::trUtf8(char const *, char const *)
-	?envelopeById@NmDataManager@@QAEPAVNmMessageEnvelope@@ABVNmId@@00@Z @ 129 NONAME ; class NmMessageEnvelope * NmDataManager::envelopeById(class NmId const &, class NmId const &, class NmId const &)
-	?getStaticMetaObject@NmOperation@@SAABUQMetaObject@@XZ @ 130 NONAME ; struct QMetaObject const & NmOperation::getStaticMetaObject(void)
-	?trUtf8@NmOperation@@SA?AVQString@@PBD0@Z @ 131 NONAME ; class QString NmOperation::trUtf8(char const *, char const *)
-	?doCancelOperation@NmOperation@@MAEXXZ @ 132 NONAME ; void NmOperation::doCancelOperation(void)
-	?tr@NmOperation@@SA?AVQString@@PBD0H@Z @ 133 NONAME ; class QString NmOperation::tr(char const *, char const *, int)
-	??_ENmOperation@@UAE@I@Z @ 134 NONAME ; NmOperation::~NmOperation(unsigned int)
-	?qt_metacall@NmMessageListModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 135 NONAME ; int NmMessageListModel::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?staticMetaObject@NmOperation@@2UQMetaObject@@B @ 136 NONAME ; struct QMetaObject const NmOperation::staticMetaObject
-	??1NmUiEngine@@EAE@XZ @ 137 NONAME ; NmUiEngine::~NmUiEngine(void)
-	?messagePartFile@NmUiEngine@@QAE?AVXQSharableFile@@ABVNmId@@000@Z @ 138 NONAME ; class XQSharableFile NmUiEngine::messagePartFile(class NmId const &, class NmId const &, class NmId const &, class NmId const &)
-	??_ENmMessageListModel@@UAE@I@Z @ 139 NONAME ; NmMessageListModel::~NmMessageListModel(unsigned int)
-	?addPreliminaryOperation@NmOperation@@QAEXPAV1@@Z @ 140 NONAME ; void NmOperation::addPreliminaryOperation(class NmOperation *)
-	?deleteMessages@NmUiEngine@@QAEHABVNmId@@0ABV?$QList@VNmId@@@@@Z @ 141 NONAME ; int NmUiEngine::deleteMessages(class NmId const &, class NmId const &, class QList<class NmId> const &)
-	?mailboxById@NmDataManager@@QAEPAVNmMailboxMetaData@@ABVNmId@@@Z @ 142 NONAME ; class NmMailboxMetaData * NmDataManager::mailboxById(class NmId const &)
-	?pluginInstances@NmDataPluginFactory@@QAEPAV?$QList@PAVQObject@@@@XZ @ 143 NONAME ; class QList<class QObject *> * NmDataPluginFactory::pluginInstances(void)
-	?addAttachments@NmUiEngine@@QAEPAVNmAddAttachmentsOperation@@ABVNmMessage@@ABV?$QList@VQString@@@@@Z @ 144 NONAME ; class NmAddAttachmentsOperation * NmUiEngine::addAttachments(class NmMessage const &, class QList<class QString> const &)
-	?tr@NmBaseClientPlugin@@SA?AVQString@@PBD0@Z @ 145 NONAME ; class QString NmBaseClientPlugin::tr(char const *, char const *)
-	??0NmAddAttachmentsOperation@@QAE@PAVQObject@@@Z @ 146 NONAME ; NmAddAttachmentsOperation::NmAddAttachmentsOperation(class QObject *)
-	?listMessages@NmDataManager@@QAEXABVNmId@@0AAV?$QList@PAVNmMessageEnvelope@@@@@Z @ 147 NONAME ; void NmDataManager::listMessages(class NmId const &, class NmId const &, class QList<class NmMessageEnvelope *> &)
-	??1NmBaseClientPlugin@@UAE@XZ @ 148 NONAME ; NmBaseClientPlugin::~NmBaseClientPlugin(void)
-	?qt_metacast@NmDataManager@@UAEPAXPBD@Z @ 149 NONAME ; void * NmDataManager::qt_metacast(char const *)
-	?qt_metacall@NmBaseClientPlugin@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 150 NONAME ; int NmBaseClientPlugin::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?envelopePtr@NmMessageListModelItem@@QAEPAVNmMessageEnvelope@@XZ @ 151 NONAME ; class NmMessageEnvelope * NmMessageListModelItem::envelopePtr(void)
-	?messageListModel@NmUiEngine@@QAEAAVNmMessageListModel@@ABVNmId@@0@Z @ 152 NONAME ; class NmMessageListModel & NmUiEngine::messageListModel(class NmId const &, class NmId const &)
-	??1NmMailboxMetaData@@UAE@XZ @ 153 NONAME ; NmMailboxMetaData::~NmMailboxMetaData(void)
-	?connectionEvent@NmUiEngine@@IAEXW4NmConnectState@@ABVNmId@@@Z @ 154 NONAME ; void NmUiEngine::connectionEvent(enum NmConnectState, class NmId const &)
-	?mailbox@NmDataManager@@QAEPAVNmMailbox@@ABVNmId@@@Z @ 155 NONAME ; class NmMailbox * NmDataManager::mailbox(class NmId const &)
-	?interfaceInstance@NmDataPluginFactory@@QAEPAVNmDataPluginInterface@@PAVQObject@@@Z @ 156 NONAME ; class NmDataPluginInterface * NmDataPluginFactory::interfaceInstance(class QObject *)
-	?refreshModelItem@NmMailboxListModel@@QAEXABVNmId@@_N@Z @ 157 NONAME ; void NmMailboxListModel::refreshModelItem(class NmId const &, bool)
-	?metaObject@NmMailboxListModel@@UBEPBUQMetaObject@@XZ @ 158 NONAME ; struct QMetaObject const * NmMailboxListModel::metaObject(void) const
-	?IconId@NmMailboxMetaData@@QBE?AVNmId@@XZ @ 159 NONAME ; class NmId NmMailboxMetaData::IconId(void) const
-	??0NmFolderMetaData@@QAE@XZ @ 160 NONAME ; NmFolderMetaData::NmFolderMetaData(void)
-	?createNewMessage@NmUiEngine@@QAEPAVNmMessageCreationOperation@@ABVNmId@@@Z @ 161 NONAME ; class NmMessageCreationOperation * NmUiEngine::createNewMessage(class NmId const &)
-	?staticMetaObject@NmAddAttachmentsOperation@@2UQMetaObject@@B @ 162 NONAME ; struct QMetaObject const NmAddAttachmentsOperation::staticMetaObject
-	?connectionState@NmUiEngine@@QAE?AW4NmConnectState@@ABVNmId@@@Z @ 163 NONAME ; enum NmConnectState NmUiEngine::connectionState(class NmId const &)
-	?createTitleDividerItem@NmMessageListModel@@AAEPAVNmMessageListModelItem@@PAVNmMessageEnvelope@@@Z @ 164 NONAME ; class NmMessageListModelItem * NmMessageListModel::createTitleDividerItem(class NmMessageEnvelope *)
-	?setId@NmFolderMetaData@@QAEXABVNmId@@@Z @ 165 NONAME ; void NmFolderMetaData::setId(class NmId const &)
-	?cancelOperation@NmOperation@@QAEXXZ @ 166 NONAME ; void NmOperation::cancelOperation(void)
-	??_ENmFolderMetaData@@UAE@I@Z @ 167 NONAME ; NmFolderMetaData::~NmFolderMetaData(unsigned int)
-	?qt_metacast@NmMessageListModel@@UAEPAXPBD@Z @ 168 NONAME ; void * NmMessageListModel::qt_metacast(char const *)
-	?operationProgressChanged@NmOperation@@IAEXH@Z @ 169 NONAME ; void NmOperation::operationProgressChanged(int)
-	?trUtf8@NmOperation@@SA?AVQString@@PBD0H@Z @ 170 NONAME ; class QString NmOperation::trUtf8(char const *, char const *, int)
-	??_ENmMailboxListModel@@UAE@I@Z @ 171 NONAME ; NmMailboxListModel::~NmMailboxListModel(unsigned int)
-	?metaObject@NmUiEngine@@UBEPBUQMetaObject@@XZ @ 172 NONAME ; struct QMetaObject const * NmUiEngine::metaObject(void) const
-	??_ENmBaseClientPlugin@@UAE@I@Z @ 173 NONAME ; NmBaseClientPlugin::~NmBaseClientPlugin(unsigned int)
-	?markAsUnread@NmBaseClientPlugin@@QAEXXZ @ 174 NONAME ; void NmBaseClientPlugin::markAsUnread(void)
-	?metaObject@NmBaseClientPlugin@@UBEPBUQMetaObject@@XZ @ 175 NONAME ; struct QMetaObject const * NmBaseClientPlugin::metaObject(void) const
-	?mailboxListModel@NmUiEngine@@QAEAAVNmMailboxListModel@@XZ @ 176 NONAME ; class NmMailboxListModel & NmUiEngine::mailboxListModel(void)
-	?tr@NmDataManager@@SA?AVQString@@PBD0@Z @ 177 NONAME ; class QString NmDataManager::tr(char const *, char const *)
-	?setIconId@NmMailboxMetaData@@QAEXABVNmId@@@Z @ 178 NONAME ; void NmMailboxMetaData::setIconId(class NmId const &)
-	??1NmDataPluginFactory@@EAE@XZ @ 179 NONAME ; NmDataPluginFactory::~NmDataPluginFactory(void)
-	?refreshMailboxListModel@NmUiEngine@@QAEXXZ @ 180 NONAME ; void NmUiEngine::refreshMailboxListModel(void)
-	?rowCount@NmFolderListModel@@UBEHABVQModelIndex@@@Z @ 181 NONAME ; int NmFolderListModel::rowCount(class QModelIndex const &) const
-	?trUtf8@NmMessageListModel@@SA?AVQString@@PBD0@Z @ 182 NONAME ; class QString NmMessageListModel::trUtf8(char const *, char const *)
-	?doUpdateOperationProgress@NmOperation@@MAEXXZ @ 183 NONAME ; void NmOperation::doUpdateOperationProgress(void)
-	?tr@NmMailboxListModel@@SA?AVQString@@PBD0@Z @ 184 NONAME ; class QString NmMailboxListModel::tr(char const *, char const *)
-	?removeMessage@NmUiEngine@@QAEHABVNmId@@00@Z @ 185 NONAME ; int NmUiEngine::removeMessage(class NmId const &, class NmId const &, class NmId const &)
-	??_ENmUiEngine@@UAE@I@Z @ 186 NONAME ; NmUiEngine::~NmUiEngine(unsigned int)
-	?operationCompleted@NmOperation@@IAEXH@Z @ 187 NONAME ; void NmOperation::operationCompleted(int)
-	?storeOperation@NmUiEngine@@QAEXPAVNmOperation@@@Z @ 188 NONAME ; void NmUiEngine::storeOperation(class NmOperation *)
-	?callEmitDataChanged@NmMessageListModelItem@@QAEXXZ @ 189 NONAME ; void NmMessageListModelItem::callEmitDataChanged(void)
-	??0NmMessageListModel@@QAE@AAVNmDataManager@@PAVQObject@@@Z @ 190 NONAME ; NmMessageListModel::NmMessageListModel(class NmDataManager &, class QObject *)
-	??_ENmAddAttachmentsOperation@@UAE@I@Z @ 191 NONAME ; NmAddAttachmentsOperation::~NmAddAttachmentsOperation(unsigned int)
-	?syncState@NmUiEngine@@QAE?AW4NmSyncState@@ABVNmId@@@Z @ 192 NONAME ; enum NmSyncState NmUiEngine::syncState(class NmId const &)
-	?checkOutbox@NmUiEngine@@QAEPAVNmCheckOutboxOperation@@ABVNmId@@@Z @ 193 NONAME ; class NmCheckOutboxOperation * NmUiEngine::checkOutbox(class NmId const &)
-	?listMailboxes@NmDataManager@@QAEXAAV?$QList@PAVNmMailbox@@@@@Z @ 194 NONAME ; void NmDataManager::listMailboxes(class QList<class NmMailbox *> &)
-	?message@NmUiEngine@@QAEPAVNmMessage@@ABVNmId@@00@Z @ 195 NONAME ; class NmMessage * NmUiEngine::message(class NmId const &, class NmId const &, class NmId const &)
-	?refreshMailbox@NmUiEngine@@QAEHABVNmId@@@Z @ 196 NONAME ; int NmUiEngine::refreshMailbox(class NmId const &)
-	?trUtf8@NmUiEngine@@SA?AVQString@@PBD0@Z @ 197 NONAME ; class QString NmUiEngine::trUtf8(char const *, char const *)
-	?contentToMessagePart@NmUiEngine@@QAEHABVNmId@@00AAVNmMessagePart@@@Z @ 198 NONAME ; int NmUiEngine::contentToMessagePart(class NmId const &, class NmId const &, class NmId const &, class NmMessagePart &)
-	?removeItem@NmMessageListModel@@AAEXHAAVNmMessageListModelItem@@@Z @ 199 NONAME ; void NmMessageListModel::removeItem(int, class NmMessageListModelItem &)
-	??1NmMailboxListModel@@UAE@XZ @ 200 NONAME ; NmMailboxListModel::~NmMailboxListModel(void)
-	??0NmBaseClientPlugin@@QAE@XZ @ 201 NONAME ; NmBaseClientPlugin::NmBaseClientPlugin(void)
-	?forwardMail@NmBaseClientPlugin@@QAEXXZ @ 202 NONAME ; void NmBaseClientPlugin::forwardMail(void)
-	?createReplyMessage@NmUiEngine@@QAEPAVNmMessageCreationOperation@@ABVNmId@@0_N@Z @ 203 NONAME ; class NmMessageCreationOperation * NmUiEngine::createReplyMessage(class NmId const &, class NmId const &, bool)
-	?setItemType@NmMessageListModelItem@@QAEXW4NmMessageItemType@1@@Z @ 204 NONAME ; void NmMessageListModelItem::setItemType(enum NmMessageListModelItem::NmMessageItemType)
-	??_ENmDataPluginFactory@@UAE@I@Z @ 205 NONAME ; NmDataPluginFactory::~NmDataPluginFactory(unsigned int)
-	?mailboxListChanged@NmBaseClientPlugin@@AAEXABVNmId@@W4MailboxEventType@NmSettings@@@Z @ 206 NONAME ; void NmBaseClientPlugin::mailboxListChanged(class NmId const &, enum NmSettings::MailboxEventType)
-	?expanded@NmMessageListModelItem@@QBE_NXZ @ 207 NONAME ; bool NmMessageListModelItem::expanded(void) const
-	?columnCount@NmFolderListModel@@UBEHABVQModelIndex@@@Z @ 208 NONAME ; int NmFolderListModel::columnCount(class QModelIndex const &) const
-	?pluginInstance@NmDataPluginFactory@@QAEPAVQObject@@VNmId@@@Z @ 209 NONAME ; class QObject * NmDataPluginFactory::pluginInstance(class NmId)
-	?setNewParam@NmMessageListModel@@IAEXPAVNmUiStartParam@@@Z @ 210 NONAME ; void NmMessageListModel::setNewParam(class NmUiStartParam *)
-	?data@NmMessageListModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 211 NONAME ; class QVariant NmMessageListModel::data(class QModelIndex const &, int) const
-	?goOnline@NmBaseClientPlugin@@AAEXABVNmId@@@Z @ 212 NONAME ; void NmBaseClientPlugin::goOnline(class NmId const &)
-	?createNewMail@NmBaseClientPlugin@@QAEXXZ @ 213 NONAME ; void NmBaseClientPlugin::createNewMail(void)
-	?qt_metacast@NmBaseClientPlugin@@UAEPAXPBD@Z @ 214 NONAME ; void * NmBaseClientPlugin::qt_metacast(char const *)
-	?staticMetaObject@NmBaseClientPlugin@@2UQMetaObject@@B @ 215 NONAME ; struct QMetaObject const NmBaseClientPlugin::staticMetaObject
-	?setEnvelope@NmMessageListModelItem@@QAEXABVNmMessageEnvelope@@@Z @ 216 NONAME ; void NmMessageListModelItem::setEnvelope(class NmMessageEnvelope const &)
-	?qt_metacast@NmAddAttachmentsOperation@@UAEPAXPBD@Z @ 217 NONAME ; void * NmAddAttachmentsOperation::qt_metacast(char const *)
-	?createNewMailViewerToolBar@NmBaseClientPlugin@@QAEXXZ @ 218 NONAME ; void NmBaseClientPlugin::createNewMailViewerToolBar(void)
-	?setEnvelopes@NmUiEngine@@QAEPAVNmStoreEnvelopesOperation@@ABVNmId@@0W4NmEnvelopeProperties@@ABV?$QList@PB$$CBVNmMessageEnvelope@@@@@Z @ 219 NONAME ; class NmStoreEnvelopesOperation * NmUiEngine::setEnvelopes(class NmId const &, class NmId const &, enum NmEnvelopeProperties, class QList<class NmMessageEnvelope const *> const &)
-	?staticMetaObject@NmMailboxListModel@@2UQMetaObject@@B @ 220 NONAME ; struct QMetaObject const NmMailboxListModel::staticMetaObject
-	?trUtf8@NmDataManager@@SA?AVQString@@PBD0H@Z @ 221 NONAME ; class QString NmDataManager::trUtf8(char const *, char const *, int)
-	?fetchMessagePart@NmUiEngine@@QAEPAVNmOperation@@ABVNmId@@000@Z @ 222 NONAME ; class NmOperation * NmUiEngine::fetchMessagePart(class NmId const &, class NmId const &, class NmId const &, class NmId const &)
-	?completeOperation@NmOperation@@QAEXH@Z @ 223 NONAME ; void NmOperation::completeOperation(int)
-	?parent@NmFolderListModel@@UBE?AVQModelIndex@@ABV2@@Z @ 224 NONAME ; class QModelIndex NmFolderListModel::parent(class QModelIndex const &) const
-	?folder@NmDataManager@@QAEPAVNmFolder@@ABVNmId@@0@Z @ 225 NONAME ; class NmFolder * NmDataManager::folder(class NmId const &, class NmId const &)
-	?replyMail@NmBaseClientPlugin@@QAEXXZ @ 226 NONAME ; void NmBaseClientPlugin::replyMail(void)
-	??1NmMessageListModelItem@@UAE@XZ @ 227 NONAME ; NmMessageListModelItem::~NmMessageListModelItem(void)
-	?mailboxPropertyChanged@NmBaseClientPlugin@@AAEXABVNmId@@VQVariant@@1@Z @ 228 NONAME ; void NmBaseClientPlugin::mailboxPropertyChanged(class NmId const &, class QVariant, class QVariant)
-	?qt_metacall@NmOperation@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 229 NONAME ; int NmOperation::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?removeMessageFromModel@NmMessageListModel@@AAEXABVNmId@@@Z @ 230 NONAME ; void NmMessageListModel::removeMessageFromModel(class NmId const &)
-	?handleRequest@NmBaseClientPlugin@@AAEXW4NmActionResponseCommand@@ABVNmActionRequest@@@Z @ 231 NONAME ; void NmBaseClientPlugin::handleRequest(enum NmActionResponseCommand, class NmActionRequest const &)
-	?trUtf8@NmMessageListModel@@SA?AVQString@@PBD0H@Z @ 232 NONAME ; class QString NmMessageListModel::trUtf8(char const *, char const *, int)
-	?operationPartCompleted@NmAddAttachmentsOperation@@IAEXABVQString@@ABVNmId@@H@Z @ 233 NONAME ; void NmAddAttachmentsOperation::operationPartCompleted(class QString const &, class NmId const &, int)
-	?tr@NmMessageListModel@@SA?AVQString@@PBD0@Z @ 234 NONAME ; class QString NmMessageListModel::tr(char const *, char const *)
-	?doCompleteOperation@NmOperation@@MAEXXZ @ 235 NONAME ; void NmOperation::doCompleteOperation(void)
-	?dividerInsertionIndex@NmMessageListModel@@AAEHH@Z @ 236 NONAME ; int NmMessageListModel::dividerInsertionIndex(int)
-	?id@NmFolderMetaData@@QBE?AVNmId@@XZ @ 237 NONAME ; class NmId NmFolderMetaData::id(void) const
-	?createMessageItem@NmMessageListModel@@AAEPAVNmMessageListModelItem@@PAVNmMessageEnvelope@@@Z @ 238 NONAME ; class NmMessageListModelItem * NmMessageListModel::createMessageItem(class NmMessageEnvelope *)
-	?getStandardFolderId@NmDataManager@@QAE?AVNmId@@ABV2@W4NmFolderType@@@Z @ 239 NONAME ; class NmId NmDataManager::getStandardFolderId(class NmId const &, enum NmFolderType)
-	?dividersActive@NmMessageListModel@@QAE_NXZ @ 240 NONAME ; bool NmMessageListModel::dividersActive(void)
-	?getStaticMetaObject@NmBaseClientPlugin@@SAABUQMetaObject@@XZ @ 241 NONAME ; struct QMetaObject const & NmBaseClientPlugin::getStaticMetaObject(void)
-	?titleDivider@NmMessageListModelItem@@QBE?AVQString@@XZ @ 242 NONAME ; class QString NmMessageListModelItem::titleDivider(void) const
-	??_ENmDataManager@@UAE@I@Z @ 243 NONAME ; NmDataManager::~NmDataManager(unsigned int)
-	?qt_metacast@NmMailboxListModel@@UAEPAXPBD@Z @ 244 NONAME ; void * NmMailboxListModel::qt_metacast(char const *)
-	?updateEnvelope@NmMessageListModel@@AAEXW4NmEnvelopeProperties@@ABVNmId@@@Z @ 245 NONAME ; void NmMessageListModel::updateEnvelope(enum NmEnvelopeProperties, class NmId const &)
-	?getActions@NmBaseClientPlugin@@UAEXABVNmActionRequest@@AAV?$QList@PAVNmAction@@@@@Z @ 246 NONAME ; void NmBaseClientPlugin::getActions(class NmActionRequest const &, class QList<class NmAction *> &)
-	?handleMessageEvent@NmMessageListModel@@QAEXW4NmMessageEvent@@ABVNmId@@ABV?$QList@VNmId@@@@@Z @ 247 NONAME ; void NmMessageListModel::handleMessageEvent(enum NmMessageEvent, class NmId const &, class QList<class NmId> const &)
-	??_ENmMailboxMetaData@@UAE@I@Z @ 248 NONAME ; NmMailboxMetaData::~NmMailboxMetaData(unsigned int)
-	??0NmMessageListModelItem@@QAE@XZ @ 249 NONAME ; NmMessageListModelItem::NmMessageListModelItem(void)
-	?tr@NmAddAttachmentsOperation@@SA?AVQString@@PBD0H@Z @ 250 NONAME ; class QString NmAddAttachmentsOperation::tr(char const *, char const *, int)
-	?setDividers@NmMessageListModel@@QAEX_N@Z @ 251 NONAME ; void NmMessageListModel::setDividers(bool)
-	?loadPlugin@NmDataPluginFactory@@QAEPAVQObject@@ABVQDir@@ABVQString@@@Z @ 252 NONAME ; class QObject * NmDataPluginFactory::loadPlugin(class QDir const &, class QString const &)
-	?qt_metacast@NmOperation@@UAEPAXPBD@Z @ 253 NONAME ; void * NmOperation::qt_metacast(char const *)
-	?tr@NmMessageListModel@@SA?AVQString@@PBD0H@Z @ 254 NONAME ; class QString NmMessageListModel::tr(char const *, char const *, int)
-	?qt_metacall@NmAddAttachmentsOperation@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 255 NONAME ; int NmAddAttachmentsOperation::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?qt_metacall@NmUiEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 256 NONAME ; int NmUiEngine::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?staticMetaObject@NmMessageListModel@@2UQMetaObject@@B @ 257 NONAME ; struct QMetaObject const NmMessageListModel::staticMetaObject
-	?message@NmDataManager@@QAEPAVNmMessage@@ABVNmId@@00@Z @ 258 NONAME ; class NmMessage * NmDataManager::message(class NmId const &, class NmId const &, class NmId const &)
-	?metaObject@NmOperation@@UBEPBUQMetaObject@@XZ @ 259 NONAME ; struct QMetaObject const * NmOperation::metaObject(void) const
-	?sendOperationCompleted@NmUiEngine@@IAEXXZ @ 260 NONAME ; void NmUiEngine::sendOperationCompleted(void)
-	?removeAttachment@NmBaseClientPlugin@@QAEXXZ @ 261 NONAME ; void NmBaseClientPlugin::removeAttachment(void)
-	?openAttachment@NmBaseClientPlugin@@QAEXXZ @ 262 NONAME ; void NmBaseClientPlugin::openAttachment(void)
-	?operationCompleted@NmUiEngine@@IAEXABVNmOperationCompletionEvent@@@Z @ 263 NONAME ; void NmUiEngine::operationCompleted(class NmOperationCompletionEvent const &)
-	?handleSyncStateEvent@NmUiEngine@@QAEXW4NmSyncState@@ABVNmOperationCompletionEvent@@@Z @ 264 NONAME ; void NmUiEngine::handleSyncStateEvent(enum NmSyncState, class NmOperationCompletionEvent const &)
+	??0NmStoreEnvelopesOperation@@QAE@XZ @ 5 NONAME ; NmStoreEnvelopesOperation::NmStoreEnvelopesOperation(void)
+	?currentMailboxId@NmMessageListModel@@QAE?AVNmId@@XZ @ 6 NONAME ; class NmId NmMessageListModel::currentMailboxId(void)
+	?folderById@NmDataManager@@QAEPAVNmFolderMetaData@@ABVNmId@@0@Z @ 7 NONAME ; class NmFolderMetaData * NmDataManager::folderById(class NmId const &, class NmId const &)
+	?removeAttachment@NmBaseClientPlugin@@QAEXXZ @ 8 NONAME ; void NmBaseClientPlugin::removeAttachment(void)
+	?completeOperationPart@NmAddAttachmentsOperation@@QAEXABVQString@@ABVNmId@@H@Z @ 9 NONAME ; void NmAddAttachmentsOperation::completeOperationPart(class QString const &, class NmId const &, int)
+	?data@NmMessageSearchListModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 10 NONAME ; class QVariant NmMessageSearchListModel::data(class QModelIndex const &, int) const
+	?qt_metacast@NmMessageSearchListModel@@UAEPAXPBD@Z @ 11 NONAME ; void * NmMessageSearchListModel::qt_metacast(char const *)
+	?releaseInstance@NmUiEngine@@SAXAAPAV1@@Z @ 12 NONAME ; void NmUiEngine::releaseInstance(class NmUiEngine * &)
+	?id@NmMailboxMetaData@@QBE?AVNmId@@XZ @ 13 NONAME ; class NmId NmMailboxMetaData::id(void) const
+	??1NmMessageCreationOperation@@MAE@XZ @ 14 NONAME ; NmMessageCreationOperation::~NmMessageCreationOperation(void)
+	?qt_metacast@NmUiEngine@@UAEPAXPBD@Z @ 15 NONAME ; void * NmUiEngine::qt_metacast(char const *)
+	?setName@NmMailboxMetaData@@QAEXABVQString@@@Z @ 16 NONAME ; void NmMailboxMetaData::setName(class QString const &)
+	?staticMetaObject@NmStoreEnvelopesOperation@@2UQMetaObject@@B @ 17 NONAME ; struct QMetaObject const NmStoreEnvelopesOperation::staticMetaObject
+	?handleMessageEvent@NmUiEngine@@AAEXW4NmMessageEvent@@ABVNmId@@ABV?$QList@VNmId@@@@1@Z @ 18 NONAME ; void NmUiEngine::handleMessageEvent(enum NmMessageEvent, class NmId const &, class QList<class NmId> const &, class NmId const &)
+	?tr@NmMessageSearchListModel@@SA?AVQString@@PBD0@Z @ 19 NONAME ; class QString NmMessageSearchListModel::tr(char const *, char const *)
+	?isRunning@NmOperation@@QBE_NXZ @ 20 NONAME ; bool NmOperation::isRunning(void) const
+	?setPriorityLow@NmBaseClientPlugin@@QAEXXZ @ 21 NONAME ; void NmBaseClientPlugin::setPriorityLow(void)
+	?tr@NmMessageCreationOperation@@SA?AVQString@@PBD0H@Z @ 22 NONAME ; class QString NmMessageCreationOperation::tr(char const *, char const *, int)
+	?openMessage@NmBaseClientPlugin@@QAEXXZ @ 23 NONAME ; void NmBaseClientPlugin::openMessage(void)
+	?getStaticMetaObject@NmMailboxListModel@@SAABUQMetaObject@@XZ @ 24 NONAME ; struct QMetaObject const & NmMailboxListModel::getStaticMetaObject(void)
+	?envelope@NmMessageListModelItem@@QBEABVNmMessageEnvelope@@XZ @ 25 NONAME ; class NmMessageEnvelope const & NmMessageListModelItem::envelope(void) const
+	?qt_metacall@NmMailboxListModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 26 NONAME ; int NmMailboxListModel::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?listMailboxIds@NmDataManager@@QAEXAAV?$QList@VNmId@@@@@Z @ 27 NONAME ; void NmDataManager::listMailboxIds(class QList<class NmId> &)
+	??0NmDataManager@@QAE@XZ @ 28 NONAME ; NmDataManager::NmDataManager(void)
+	?trUtf8@NmAddAttachmentsOperation@@SA?AVQString@@PBD0H@Z @ 29 NONAME ; class QString NmAddAttachmentsOperation::trUtf8(char const *, char const *, int)
+	?refresh@NmMailboxListModel@@QAEXAAV?$QList@PAVNmMailbox@@@@@Z @ 30 NONAME ; void NmMailboxListModel::refresh(class QList<class NmMailbox *> &)
+	?getStaticMetaObject@NmDataManager@@SAABUQMetaObject@@XZ @ 31 NONAME ; struct QMetaObject const & NmDataManager::getStaticMetaObject(void)
+	??1NmMessageListModel@@UAE@XZ @ 32 NONAME ; NmMessageListModel::~NmMessageListModel(void)
+	?handleCompletedSendOperation@NmUiEngine@@QAEXXZ @ 33 NONAME ; void NmUiEngine::handleCompletedSendOperation(void)
+	??_ENmFolderListModel@@UAE@I@Z @ 34 NONAME ; NmFolderListModel::~NmFolderListModel(unsigned int)
+	?contentToMessagePart@NmDataManager@@QAEHABVNmId@@00AAVNmMessagePart@@@Z @ 35 NONAME ; int NmDataManager::contentToMessagePart(class NmId const &, class NmId const &, class NmId const &, class NmMessagePart &)
+	?setExpanded@NmMessageListModelItem@@QAEX_N@Z @ 36 NONAME ; void NmMessageListModelItem::setExpanded(bool)
+	?qt_metacall@NmMessageSearchListModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 37 NONAME ; int NmMessageSearchListModel::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?staticMetaObject@NmCheckOutboxOperation@@2UQMetaObject@@B @ 38 NONAME ; struct QMetaObject const NmCheckOutboxOperation::staticMetaObject
+	?getStaticMetaObject@NmStoreEnvelopesOperation@@SAABUQMetaObject@@XZ @ 39 NONAME ; struct QMetaObject const & NmStoreEnvelopesOperation::getStaticMetaObject(void)
+	?setPriorityHigh@NmBaseClientPlugin@@QAEXXZ @ 40 NONAME ; void NmBaseClientPlugin::setPriorityHigh(void)
+	??0NmAddAttachmentsOperation@@QAE@XZ @ 41 NONAME ; NmAddAttachmentsOperation::NmAddAttachmentsOperation(void)
+	?deleteMessage@NmBaseClientPlugin@@QAEXXZ @ 42 NONAME ; void NmBaseClientPlugin::deleteMessage(void)
+	?getStaticMetaObject@NmAddAttachmentsOperation@@SAABUQMetaObject@@XZ @ 43 NONAME ; struct QMetaObject const & NmAddAttachmentsOperation::getStaticMetaObject(void)
+	?standardFolderId@NmUiEngine@@QAE?AVNmId@@ABV2@W4NmFolderType@@@Z @ 44 NONAME ; class NmId NmUiEngine::standardFolderId(class NmId const &, enum NmFolderType)
+	?settings@NmBaseClientPlugin@@QAEXXZ @ 45 NONAME ; void NmBaseClientPlugin::settings(void)
+	?staticMetaObject@NmUiEngine@@2UQMetaObject@@B @ 46 NONAME ; struct QMetaObject const NmUiEngine::staticMetaObject
+	?mailboxDeleted@NmUiEngine@@IAEXABVNmId@@@Z @ 47 NONAME ; void NmUiEngine::mailboxDeleted(class NmId const &)
+	?getIcon@NmIcons@@SAAAVHbIcon@@W4Icon@1@@Z @ 48 NONAME ; class HbIcon & NmIcons::getIcon(enum NmIcons::Icon)
+	?itemType@NmMessageListModelItem@@QBE?AW4NmMessageItemType@1@XZ @ 49 NONAME ; enum NmMessageListModelItem::NmMessageItemType NmMessageListModelItem::itemType(void) const
+	?mInstance@NmDataPluginFactory@@0PAV1@A @ 50 NONAME ; class NmDataPluginFactory * NmDataPluginFactory::mInstance
+	?data@NmFolderListModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 51 NONAME ; class QVariant NmFolderListModel::data(class QModelIndex const &, int) const
+	?setName@NmFolderMetaData@@QAEXABVQString@@@Z @ 52 NONAME ; void NmFolderMetaData::setName(class QString const &)
+	?mReferenceCount@NmUiEngine@@0HA @ 53 NONAME ; int NmUiEngine::mReferenceCount
+	?listFolders@NmDataManager@@QAEXVNmId@@AAV?$QList@PAVNmFolder@@@@@Z @ 54 NONAME ; void NmDataManager::listFolders(class NmId, class QList<class NmFolder *> &)
+	?cancelSearch@NmUiEngine@@QAEHABVNmId@@@Z @ 55 NONAME ; int NmUiEngine::cancelSearch(class NmId const &)
+	?data@NmMailboxListModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 56 NONAME ; class QVariant NmMailboxListModel::data(class QModelIndex const &, int) const
+	?metaObject@NmMessageCreationOperation@@UBEPBUQMetaObject@@XZ @ 57 NONAME ; struct QMetaObject const * NmMessageCreationOperation::metaObject(void) const
+	?handlePreliminaryOperationFinished@NmOperation@@MAEXXZ @ 58 NONAME ; void NmOperation::handlePreliminaryOperationFinished(void)
+	?releaseInstance@NmDataPluginFactory@@SAXAAPAV1@@Z @ 59 NONAME ; void NmDataPluginFactory::releaseInstance(class NmDataPluginFactory * &)
+	?createEditorViewCommands@NmBaseClientPlugin@@AAEXABVNmActionRequest@@AAV?$QList@PAVNmAction@@@@@Z @ 60 NONAME ; void NmBaseClientPlugin::createEditorViewCommands(class NmActionRequest const &, class QList<class NmAction *> &)
+	?operationCancelled@NmOperation@@IAEXXZ @ 61 NONAME ; void NmOperation::operationCancelled(void)
+	??0NmDataPluginFactory@@AAE@XZ @ 62 NONAME ; NmDataPluginFactory::NmDataPluginFactory(void)
+	?refresh@NmBaseClientPlugin@@QAEXXZ @ 63 NONAME ; void NmBaseClientPlugin::refresh(void)
+	??1NmFolderMetaData@@UAE@XZ @ 64 NONAME ; NmFolderMetaData::~NmFolderMetaData(void)
+	??1NmMessageSendingOperation@@MAE@XZ @ 65 NONAME ; NmMessageSendingOperation::~NmMessageSendingOperation(void)
+	?staticMetaObject@NmMessageSearchListModel@@2UQMetaObject@@B @ 66 NONAME ; struct QMetaObject const NmMessageSearchListModel::staticMetaObject
+	?name@NmFolderMetaData@@QBE?AVQString@@XZ @ 67 NONAME ; class QString NmFolderMetaData::name(void) const
+	??_ENmMessageCreationOperation@@UAE@I@Z @ 68 NONAME ; NmMessageCreationOperation::~NmMessageCreationOperation(unsigned int)
+	?sendMail@NmBaseClientPlugin@@QAEXXZ @ 69 NONAME ; void NmBaseClientPlugin::sendMail(void)
+	?insertNewMessageIntoModel@NmMessageListModel@@AAEXABVNmId@@00@Z @ 70 NONAME ; void NmMessageListModel::insertNewMessageIntoModel(class NmId const &, class NmId const &, class NmId const &)
+	?getStaticMetaObject@NmUiEngine@@SAABUQMetaObject@@XZ @ 71 NONAME ; struct QMetaObject const & NmUiEngine::getStaticMetaObject(void)
+	?metaObject@NmMessageListModel@@UBEPBUQMetaObject@@XZ @ 72 NONAME ; struct QMetaObject const * NmMessageListModel::metaObject(void) const
+	?messageBeingSent@NmUiEngine@@QBEPBVNmMessage@@XZ @ 73 NONAME ; class NmMessage const * NmUiEngine::messageBeingSent(void) const
+	?handleMailboxEvent@NmUiEngine@@AAEXW4NmMailboxEvent@@ABV?$QList@VNmId@@@@@Z @ 74 NONAME ; void NmUiEngine::handleMailboxEvent(enum NmMailboxEvent, class QList<class NmId> const &)
+	?interfaceInstance@NmDataPluginFactory@@QAEPAVNmDataPluginInterface@@VNmId@@@Z @ 75 NONAME ; class NmDataPluginInterface * NmDataPluginFactory::interfaceInstance(class NmId)
+	?trUtf8@NmMessageSearchListModel@@SA?AVQString@@PBD0@Z @ 76 NONAME ; class QString NmMessageSearchListModel::trUtf8(char const *, char const *)
+	?goOffline@NmBaseClientPlugin@@AAEXABVNmId@@@Z @ 77 NONAME ; void NmBaseClientPlugin::goOffline(class NmId const &)
+	?sendMessage@NmUiEngine@@QAEXPAVNmMessage@@ABV?$QList@PAVNmOperation@@@@@Z @ 78 NONAME ; void NmUiEngine::sendMessage(class NmMessage *, class QList<class NmOperation *> const &)
+	?tr@NmDataManager@@SA?AVQString@@PBD0H@Z @ 79 NONAME ; class QString NmDataManager::tr(char const *, char const *, int)
+	??0NmMailboxListModel@@QAE@AAVNmDataManager@@PAVQObject@@@Z @ 80 NONAME ; NmMailboxListModel::NmMailboxListModel(class NmDataManager &, class QObject *)
+	?trUtf8@NmCheckOutboxOperation@@SA?AVQString@@PBD0@Z @ 81 NONAME ; class QString NmCheckOutboxOperation::trUtf8(char const *, char const *)
+	?setPriorityNormal@NmBaseClientPlugin@@QAEXXZ @ 82 NONAME ; void NmBaseClientPlugin::setPriorityNormal(void)
+	??_ENmMessageSendingOperation@@UAE@I@Z @ 83 NONAME ; NmMessageSendingOperation::~NmMessageSendingOperation(unsigned int)
+	?changed@NmMessageListModel@@AAE_NABVNmMessageEnvelope@@0@Z @ 84 NONAME ; bool NmMessageListModel::changed(class NmMessageEnvelope const &, class NmMessageEnvelope const &)
+	?openAttachment@NmBaseClientPlugin@@QAEXXZ @ 85 NONAME ; void NmBaseClientPlugin::openAttachment(void)
+	?staticMetaObject@NmMessageCreationOperation@@2UQMetaObject@@B @ 86 NONAME ; struct QMetaObject const NmMessageCreationOperation::staticMetaObject
+	?handleMailboxEvent@NmMailboxListModel@@QAEXW4NmMailboxEvent@@ABV?$QList@VNmId@@@@@Z @ 87 NONAME ; void NmMailboxListModel::handleMailboxEvent(enum NmMailboxEvent, class QList<class NmId> const &)
+	?metaObject@NmStoreEnvelopesOperation@@UBEPBUQMetaObject@@XZ @ 88 NONAME ; struct QMetaObject const * NmStoreEnvelopesOperation::metaObject(void) const
+	?trUtf8@NmMailboxListModel@@SA?AVQString@@PBD0H@Z @ 89 NONAME ; class QString NmMailboxListModel::trUtf8(char const *, char const *, int)
+	?mPluginArray@NmDataPluginFactory@@0PAV?$QList@PAVQObject@@@@A @ 90 NONAME ; class QList<class QObject *> * NmDataPluginFactory::mPluginArray
+	?instance@NmDataPluginFactory@@SAPAV1@XZ @ 91 NONAME ; class NmDataPluginFactory * NmDataPluginFactory::instance(void)
+	?getStaticMetaObject@NmMessageListModel@@SAABUQMetaObject@@XZ @ 92 NONAME ; struct QMetaObject const & NmMessageListModel::getStaticMetaObject(void)
+	?deleteMessageFromViewerView@NmBaseClientPlugin@@QAEXXZ @ 93 NONAME ; void NmBaseClientPlugin::deleteMessageFromViewerView(void)
+	?tr@NmUiEngine@@SA?AVQString@@PBD0H@Z @ 94 NONAME ; class QString NmUiEngine::tr(char const *, char const *, int)
+	?refresh@NmMessageListModel@@QAEXVNmId@@0ABV?$QList@PAVNmMessageEnvelope@@@@@Z @ 95 NONAME ; void NmMessageListModel::refresh(class NmId, class NmId, class QList<class NmMessageEnvelope *> const &)
+	?mailboxById@NmUiEngine@@QAEPAVNmMailboxMetaData@@ABVNmId@@@Z @ 96 NONAME ; class NmMailboxMetaData * NmUiEngine::mailboxById(class NmId const &)
+	?createNewMessage@NmUiEngine@@QAE?AV?$QPointer@VNmMessageCreationOperation@@@@ABVNmId@@@Z @ 97 NONAME ; class QPointer<class NmMessageCreationOperation> NmUiEngine::createNewMessage(class NmId const &)
+	?tr@NmCheckOutboxOperation@@SA?AVQString@@PBD0@Z @ 98 NONAME ; class QString NmCheckOutboxOperation::tr(char const *, char const *)
+	??_ENmMessageListModelItem@@UAE@I@Z @ 99 NONAME ; NmMessageListModelItem::~NmMessageListModelItem(unsigned int)
+	?replyAllMail@NmBaseClientPlugin@@QAEXXZ @ 100 NONAME ; void NmBaseClientPlugin::replyAllMail(void)
+	?syncStateEvent@NmUiEngine@@IAEXW4NmSyncState@@ABVNmId@@@Z @ 101 NONAME ; void NmUiEngine::syncStateEvent(enum NmSyncState, class NmId const &)
+	?trUtf8@NmDataManager@@SA?AVQString@@PBD0@Z @ 102 NONAME ; class QString NmDataManager::trUtf8(char const *, char const *)
+	?setEnvelopeProperties@NmMessageListModel@@QAEXW4NmEnvelopeProperties@@ABV?$QList@VNmId@@@@@Z @ 103 NONAME ; void NmMessageListModel::setEnvelopeProperties(enum NmEnvelopeProperties, class QList<class NmId> const &)
+	??1NmStoreEnvelopesOperation@@MAE@XZ @ 104 NONAME ; NmStoreEnvelopesOperation::~NmStoreEnvelopesOperation(void)
+	?tr@NmUiEngine@@SA?AVQString@@PBD0@Z @ 105 NONAME ; class QString NmUiEngine::tr(char const *, char const *)
+	?mPluginLoaderArray@NmDataPluginFactory@@0V?$QList@PAVQPluginLoader@@@@A @ 106 NONAME ; class QList<class QPluginLoader *> NmDataPluginFactory::mPluginLoaderArray
+	?trUtf8@NmBaseClientPlugin@@SA?AVQString@@PBD0@Z @ 107 NONAME ; class QString NmBaseClientPlugin::trUtf8(char const *, char const *)
+	?deleteOperation@NmOperation@@AAEXXZ @ 108 NONAME ; void NmOperation::deleteOperation(void)
+	?trUtf8@NmBaseClientPlugin@@SA?AVQString@@PBD0H@Z @ 109 NONAME ; class QString NmBaseClientPlugin::trUtf8(char const *, char const *, int)
+	?createViewerViewCommands@NmBaseClientPlugin@@AAEXABVNmActionRequest@@AAV?$QList@PAVNmAction@@@@@Z @ 110 NONAME ; void NmBaseClientPlugin::createViewerViewCommands(class NmActionRequest const &, class QList<class NmAction *> &)
+	?fetchMessagePart@NmUiEngine@@QAE?AV?$QPointer@VNmOperation@@@@ABVNmId@@000@Z @ 111 NONAME ; class QPointer<class NmOperation> NmUiEngine::fetchMessagePart(class NmId const &, class NmId const &, class NmId const &, class NmId const &)
+	?tr@NmMailboxListModel@@SA?AVQString@@PBD0H@Z @ 112 NONAME ; class QString NmMailboxListModel::tr(char const *, char const *, int)
+	?trUtf8@NmUiEngine@@SA?AVQString@@PBD0H@Z @ 113 NONAME ; class QString NmUiEngine::trUtf8(char const *, char const *, int)
+	?createMailboxItem@NmMailboxListModel@@AAEPAVNmMailboxListModelItem@@PBVNmMailbox@@@Z @ 114 NONAME ; class NmMailboxListModelItem * NmMailboxListModel::createMailboxItem(class NmMailbox const *)
+	?setTitleDivider@NmMessageListModelItem@@QAEXABVQString@@@Z @ 115 NONAME ; void NmMessageListModelItem::setTitleDivider(class QString const &)
+	?markAsRead@NmBaseClientPlugin@@QAEXXZ @ 116 NONAME ; void NmBaseClientPlugin::markAsRead(void)
+	?getInsertionIndex@NmMessageListModel@@ABEHABVNmMessageEnvelope@@@Z @ 117 NONAME ; int NmMessageListModel::getInsertionIndex(class NmMessageEnvelope const &) const
+	?updateOperationProgress@NmOperation@@QAEXH@Z @ 118 NONAME ; void NmOperation::updateOperationProgress(int)
+	??1NmFolderListModel@@UAE@XZ @ 119 NONAME ; NmFolderListModel::~NmFolderListModel(void)
+	?operationCompleted@NmUiEngine@@IAEXABVNmOperationCompletionEvent@@@Z @ 120 NONAME ; void NmUiEngine::operationCompleted(class NmOperationCompletionEvent const &)
+	??1NmDataManager@@UAE@XZ @ 121 NONAME ; NmDataManager::~NmDataManager(void)
+	?trUtf8@NmStoreEnvelopesOperation@@SA?AVQString@@PBD0@Z @ 122 NONAME ; class QString NmStoreEnvelopesOperation::trUtf8(char const *, char const *)
+	?metaObject@NmMessageSearchListModel@@UBEPBUQMetaObject@@XZ @ 123 NONAME ; struct QMetaObject const * NmMessageSearchListModel::metaObject(void) const
+	??0NmMessageSearchListModel@@QAE@PAVQObject@@@Z @ 124 NONAME ; NmMessageSearchListModel::NmMessageSearchListModel(class QObject *)
+	?getStaticMetaObject@NmMessageCreationOperation@@SAABUQMetaObject@@XZ @ 125 NONAME ; struct QMetaObject const & NmMessageCreationOperation::getStaticMetaObject(void)
+	?trUtf8@NmAddAttachmentsOperation@@SA?AVQString@@PBD0@Z @ 126 NONAME ; class QString NmAddAttachmentsOperation::trUtf8(char const *, char const *)
+	?name@NmMailboxMetaData@@QBE?AVQString@@XZ @ 127 NONAME ; class QString NmMailboxMetaData::name(void) const
+	?qt_metacall@NmDataManager@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 128 NONAME ; int NmDataManager::qt_metacall(enum QMetaObject::Call, int, void * *)
+	??1NmMessageSearchListModel@@UAE@XZ @ 129 NONAME ; NmMessageSearchListModel::~NmMessageSearchListModel(void)
+	?runAsyncOperation@NmOperation@@MAEXXZ @ 130 NONAME ; void NmOperation::runAsyncOperation(void)
+	??0NmFolderListModel@@QAE@AAVNmDataManager@@PAVQObject@@@Z @ 131 NONAME ; NmFolderListModel::NmFolderListModel(class NmDataManager &, class QObject *)
+	?getStaticMetaObject@NmCheckOutboxOperation@@SAABUQMetaObject@@XZ @ 132 NONAME ; struct QMetaObject const & NmCheckOutboxOperation::getStaticMetaObject(void)
+	?metaObject@NmCheckOutboxOperation@@UBEPBUQMetaObject@@XZ @ 133 NONAME ; struct QMetaObject const * NmCheckOutboxOperation::metaObject(void) const
+	?tr@NmBaseClientPlugin@@SA?AVQString@@PBD0H@Z @ 134 NONAME ; class QString NmBaseClientPlugin::tr(char const *, char const *, int)
+	??0NmMailboxMetaData@@QAE@XZ @ 135 NONAME ; NmMailboxMetaData::NmMailboxMetaData(void)
+	?setEnvelope@NmMessageListModelItem@@QAEXPAVNmMessageEnvelope@@@Z @ 136 NONAME ; void NmMessageListModelItem::setEnvelope(class NmMessageEnvelope *)
+	?saveMessage@NmUiEngine@@QAEHABVNmMessage@@@Z @ 137 NONAME ; int NmUiEngine::saveMessage(class NmMessage const &)
+	?setId@NmMailboxMetaData@@QAEXABVNmId@@@Z @ 138 NONAME ; void NmMailboxMetaData::setId(class NmId const &)
+	?mReferenceCount@NmDataPluginFactory@@0HA @ 139 NONAME ; int NmDataPluginFactory::mReferenceCount
+	?tr@NmOperation@@SA?AVQString@@PBD0@Z @ 140 NONAME ; class QString NmOperation::tr(char const *, char const *)
+	?qt_metacast@NmCheckOutboxOperation@@UAEPAXPBD@Z @ 141 NONAME ; void * NmCheckOutboxOperation::qt_metacast(char const *)
+	?clearSearchResults@NmMessageSearchListModel@@QAEXXZ @ 142 NONAME ; void NmMessageSearchListModel::clearSearchResults(void)
+	?updateMessageEnvelope@NmMessageListModel@@AAEXABVNmId@@00@Z @ 143 NONAME ; void NmMessageListModel::updateMessageEnvelope(class NmId const &, class NmId const &, class NmId const &)
+	?filterAcceptsRow@NmMessageSearchListModel@@MBE_NHABVQModelIndex@@@Z @ 144 NONAME ; bool NmMessageSearchListModel::filterAcceptsRow(int, class QModelIndex const &) const
+	?messageSearchListModel@NmUiEngine@@QAEAAVNmMessageSearchListModel@@PAVQAbstractItemModel@@@Z @ 145 NONAME ; class NmMessageSearchListModel & NmUiEngine::messageSearchListModel(class QAbstractItemModel *)
+	?tr@NmStoreEnvelopesOperation@@SA?AVQString@@PBD0@Z @ 146 NONAME ; class QString NmStoreEnvelopesOperation::tr(char const *, char const *)
+	?messagesBelongUnderSameDivider@NmMessageListModel@@ABE_NPBVNmMessageEnvelope@@0@Z @ 147 NONAME ; bool NmMessageListModel::messagesBelongUnderSameDivider(class NmMessageEnvelope const *, class NmMessageEnvelope const *) const
+	?checkOutbox@NmUiEngine@@QAE?AV?$QPointer@VNmCheckOutboxOperation@@@@ABVNmId@@@Z @ 148 NONAME ; class QPointer<class NmCheckOutboxOperation> NmUiEngine::checkOutbox(class NmId const &)
+	?metaObject@NmDataManager@@UBEPBUQMetaObject@@XZ @ 149 NONAME ; struct QMetaObject const * NmDataManager::metaObject(void) const
+	?isSendingMessage@NmUiEngine@@QBE_NXZ @ 150 NONAME ; bool NmUiEngine::isSendingMessage(void) const
+	?freeIcons@NmIcons@@SAXXZ @ 151 NONAME ; void NmIcons::freeIcons(void)
+	?tr@NmAddAttachmentsOperation@@SA?AVQString@@PBD0@Z @ 152 NONAME ; class QString NmAddAttachmentsOperation::tr(char const *, char const *)
+	?itemFromModel@NmMessageListModel@@AAEPAVNmMessageListModelItem@@ABVNmId@@@Z @ 153 NONAME ; class NmMessageListModelItem * NmMessageListModel::itemFromModel(class NmId const &)
+	?instance@NmUiEngine@@SAPAV1@XZ @ 154 NONAME ; class NmUiEngine * NmUiEngine::instance(void)
+	?createMessageListCommands@NmBaseClientPlugin@@AAEXABVNmActionRequest@@AAV?$QList@PAVNmAction@@@@@Z @ 155 NONAME ; void NmBaseClientPlugin::createMessageListCommands(class NmActionRequest const &, class QList<class NmAction *> &)
+	?updateEnvelopeProperty@NmBaseClientPlugin@@AAEXW4NmEnvelopeProperties@@@Z @ 156 NONAME ; void NmBaseClientPlugin::updateEnvelopeProperty(enum NmEnvelopeProperties)
+	??1NmAddAttachmentsOperation@@MAE@XZ @ 157 NONAME ; NmAddAttachmentsOperation::~NmAddAttachmentsOperation(void)
+	?goOffline@NmUiEngine@@QAEHABVNmId@@@Z @ 158 NONAME ; int NmUiEngine::goOffline(class NmId const &)
+	?staticMetaObject@NmDataManager@@2UQMetaObject@@B @ 159 NONAME ; struct QMetaObject const NmDataManager::staticMetaObject
+	?mInstance@NmUiEngine@@0PAV1@A @ 160 NONAME ; class NmUiEngine * NmUiEngine::mInstance
+	?attach@NmBaseClientPlugin@@QAEXXZ @ 161 NONAME ; void NmBaseClientPlugin::attach(void)
+	?metaObject@NmAddAttachmentsOperation@@UBEPBUQMetaObject@@XZ @ 162 NONAME ; struct QMetaObject const * NmAddAttachmentsOperation::metaObject(void) const
+	?refresh@NmFolderListModel@@QAEXAAV?$QList@PAVNmFolder@@@@@Z @ 163 NONAME ; void NmFolderListModel::refresh(class QList<class NmFolder *> &)
+	?qt_metacall@NmCheckOutboxOperation@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 164 NONAME ; int NmCheckOutboxOperation::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?trUtf8@NmMailboxListModel@@SA?AVQString@@PBD0@Z @ 165 NONAME ; class QString NmMailboxListModel::trUtf8(char const *, char const *)
+	?envelopeById@NmDataManager@@QAEPAVNmMessageEnvelope@@ABVNmId@@00@Z @ 166 NONAME ; class NmMessageEnvelope * NmDataManager::envelopeById(class NmId const &, class NmId const &, class NmId const &)
+	?getStaticMetaObject@NmOperation@@SAABUQMetaObject@@XZ @ 167 NONAME ; struct QMetaObject const & NmOperation::getStaticMetaObject(void)
+	?trUtf8@NmOperation@@SA?AVQString@@PBD0@Z @ 168 NONAME ; class QString NmOperation::trUtf8(char const *, char const *)
+	?addAttachments@NmUiEngine@@QAE?AV?$QPointer@VNmAddAttachmentsOperation@@@@ABVNmMessage@@ABV?$QList@VQString@@@@@Z @ 169 NONAME ; class QPointer<class NmAddAttachmentsOperation> NmUiEngine::addAttachments(class NmMessage const &, class QList<class QString> const &)
+	?doCancelOperation@NmOperation@@MAEXXZ @ 170 NONAME ; void NmOperation::doCancelOperation(void)
+	?tr@NmOperation@@SA?AVQString@@PBD0H@Z @ 171 NONAME ; class QString NmOperation::tr(char const *, char const *, int)
+	??_ENmOperation@@UAE@I@Z @ 172 NONAME ; NmOperation::~NmOperation(unsigned int)
+	?tr@NmMessageCreationOperation@@SA?AVQString@@PBD0@Z @ 173 NONAME ; class QString NmMessageCreationOperation::tr(char const *, char const *)
+	?qt_metacall@NmMessageListModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 174 NONAME ; int NmMessageListModel::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?staticMetaObject@NmOperation@@2UQMetaObject@@B @ 175 NONAME ; struct QMetaObject const NmOperation::staticMetaObject
+	??1NmUiEngine@@EAE@XZ @ 176 NONAME ; NmUiEngine::~NmUiEngine(void)
+	?messagePartFile@NmUiEngine@@QAE?AVXQSharableFile@@ABVNmId@@000@Z @ 177 NONAME ; class XQSharableFile NmUiEngine::messagePartFile(class NmId const &, class NmId const &, class NmId const &, class NmId const &)
+	??_ENmMessageListModel@@UAE@I@Z @ 178 NONAME ; NmMessageListModel::~NmMessageListModel(unsigned int)
+	?addPreliminaryOperation@NmOperation@@QAEXPAV1@@Z @ 179 NONAME ; void NmOperation::addPreliminaryOperation(class NmOperation *)
+	?deleteMessages@NmUiEngine@@QAEHABVNmId@@0ABV?$QList@VNmId@@@@@Z @ 180 NONAME ; int NmUiEngine::deleteMessages(class NmId const &, class NmId const &, class QList<class NmId> const &)
+	??_ENmStoreEnvelopesOperation@@UAE@I@Z @ 181 NONAME ; NmStoreEnvelopesOperation::~NmStoreEnvelopesOperation(unsigned int)
+	?mailboxById@NmDataManager@@QAEPAVNmMailboxMetaData@@ABVNmId@@@Z @ 182 NONAME ; class NmMailboxMetaData * NmDataManager::mailboxById(class NmId const &)
+	?search@NmBaseClientPlugin@@QAEXXZ @ 183 NONAME ; void NmBaseClientPlugin::search(void)
+	?pluginInstances@NmDataPluginFactory@@QAEPAV?$QList@PAVQObject@@@@XZ @ 184 NONAME ; class QList<class QObject *> * NmDataPluginFactory::pluginInstances(void)
+	?tr@NmBaseClientPlugin@@SA?AVQString@@PBD0@Z @ 185 NONAME ; class QString NmBaseClientPlugin::tr(char const *, char const *)
+	?listMessages@NmDataManager@@QAEXABVNmId@@0AAV?$QList@PAVNmMessageEnvelope@@@@@Z @ 186 NONAME ; void NmDataManager::listMessages(class NmId const &, class NmId const &, class QList<class NmMessageEnvelope *> &)
+	?getStaticMetaObject@NmMessageSearchListModel@@SAABUQMetaObject@@XZ @ 187 NONAME ; struct QMetaObject const & NmMessageSearchListModel::getStaticMetaObject(void)
+	??1NmBaseClientPlugin@@UAE@XZ @ 188 NONAME ; NmBaseClientPlugin::~NmBaseClientPlugin(void)
+	?qt_metacast@NmDataManager@@UAEPAXPBD@Z @ 189 NONAME ; void * NmDataManager::qt_metacast(char const *)
+	??0NmMessageCreationOperation@@QAE@XZ @ 190 NONAME ; NmMessageCreationOperation::NmMessageCreationOperation(void)
+	?qt_metacall@NmBaseClientPlugin@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 191 NONAME ; int NmBaseClientPlugin::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?envelopePtr@NmMessageListModelItem@@QAEPAVNmMessageEnvelope@@XZ @ 192 NONAME ; class NmMessageEnvelope * NmMessageListModelItem::envelopePtr(void)
+	?messageListModel@NmUiEngine@@QAEAAVNmMessageListModel@@ABVNmId@@0@Z @ 193 NONAME ; class NmMessageListModel & NmUiEngine::messageListModel(class NmId const &, class NmId const &)
+	??1NmMailboxMetaData@@UAE@XZ @ 194 NONAME ; NmMailboxMetaData::~NmMailboxMetaData(void)
+	?trUtf8@NmCheckOutboxOperation@@SA?AVQString@@PBD0H@Z @ 195 NONAME ; class QString NmCheckOutboxOperation::trUtf8(char const *, char const *, int)
+	??0NmCheckOutboxOperation@@QAE@XZ @ 196 NONAME ; NmCheckOutboxOperation::NmCheckOutboxOperation(void)
+	?connectionEvent@NmUiEngine@@IAEXW4NmConnectState@@ABVNmId@@@Z @ 197 NONAME ; void NmUiEngine::connectionEvent(enum NmConnectState, class NmId const &)
+	?mailbox@NmDataManager@@QAEPAVNmMailbox@@ABVNmId@@@Z @ 198 NONAME ; class NmMailbox * NmDataManager::mailbox(class NmId const &)
+	?interfaceInstance@NmDataPluginFactory@@QAEPAVNmDataPluginInterface@@PAVQObject@@@Z @ 199 NONAME ; class NmDataPluginInterface * NmDataPluginFactory::interfaceInstance(class QObject *)
+	?refreshModelItem@NmMailboxListModel@@QAEXABVNmId@@_N@Z @ 200 NONAME ; void NmMailboxListModel::refreshModelItem(class NmId const &, bool)
+	?metaObject@NmMailboxListModel@@UBEPBUQMetaObject@@XZ @ 201 NONAME ; struct QMetaObject const * NmMailboxListModel::metaObject(void) const
+	?IconId@NmMailboxMetaData@@QBE?AVNmId@@XZ @ 202 NONAME ; class NmId NmMailboxMetaData::IconId(void) const
+	?sendOperationCompleted@NmUiEngine@@IAEXXZ @ 203 NONAME ; void NmUiEngine::sendOperationCompleted(void)
+	??0NmFolderMetaData@@QAE@XZ @ 204 NONAME ; NmFolderMetaData::NmFolderMetaData(void)
+	?staticMetaObject@NmAddAttachmentsOperation@@2UQMetaObject@@B @ 205 NONAME ; struct QMetaObject const NmAddAttachmentsOperation::staticMetaObject
+	?connectionState@NmUiEngine@@QAE?AW4NmConnectState@@ABVNmId@@@Z @ 206 NONAME ; enum NmConnectState NmUiEngine::connectionState(class NmId const &)
+	?createTitleDividerItem@NmMessageListModel@@AAEPAVNmMessageListModelItem@@PAVNmMessageEnvelope@@@Z @ 207 NONAME ; class NmMessageListModelItem * NmMessageListModel::createTitleDividerItem(class NmMessageEnvelope *)
+	?setId@NmFolderMetaData@@QAEXABVNmId@@@Z @ 208 NONAME ; void NmFolderMetaData::setId(class NmId const &)
+	??0NmOperation@@QAE@XZ @ 209 NONAME ; NmOperation::NmOperation(void)
+	?cancelOperation@NmOperation@@QAEXXZ @ 210 NONAME ; void NmOperation::cancelOperation(void)
+	??_ENmFolderMetaData@@UAE@I@Z @ 211 NONAME ; NmFolderMetaData::~NmFolderMetaData(unsigned int)
+	?qt_metacast@NmMessageListModel@@UAEPAXPBD@Z @ 212 NONAME ; void * NmMessageListModel::qt_metacast(char const *)
+	?operationProgressChanged@NmOperation@@IAEXH@Z @ 213 NONAME ; void NmOperation::operationProgressChanged(int)
+	?trUtf8@NmOperation@@SA?AVQString@@PBD0H@Z @ 214 NONAME ; class QString NmOperation::trUtf8(char const *, char const *, int)
+	??_ENmMailboxListModel@@UAE@I@Z @ 215 NONAME ; NmMailboxListModel::~NmMailboxListModel(unsigned int)
+	?messageDeleted@NmUiEngine@@IAEXABVNmId@@00@Z @ 216 NONAME ; void NmUiEngine::messageDeleted(class NmId const &, class NmId const &, class NmId const &)
+	?trUtf8@NmMessageCreationOperation@@SA?AVQString@@PBD0@Z @ 217 NONAME ; class QString NmMessageCreationOperation::trUtf8(char const *, char const *)
+	?metaObject@NmUiEngine@@UBEPBUQMetaObject@@XZ @ 218 NONAME ; struct QMetaObject const * NmUiEngine::metaObject(void) const
+	??_ENmBaseClientPlugin@@UAE@I@Z @ 219 NONAME ; NmBaseClientPlugin::~NmBaseClientPlugin(unsigned int)
+	?markAsUnread@NmBaseClientPlugin@@QAEXXZ @ 220 NONAME ; void NmBaseClientPlugin::markAsUnread(void)
+	?metaObject@NmBaseClientPlugin@@UBEPBUQMetaObject@@XZ @ 221 NONAME ; struct QMetaObject const * NmBaseClientPlugin::metaObject(void) const
+	?tr@NmDataManager@@SA?AVQString@@PBD0@Z @ 222 NONAME ; class QString NmDataManager::tr(char const *, char const *)
+	?mailboxListModel@NmUiEngine@@QAEAAVNmMailboxListModel@@XZ @ 223 NONAME ; class NmMailboxListModel & NmUiEngine::mailboxListModel(void)
+	?fetchMessage@NmUiEngine@@QAE?AV?$QPointer@VNmOperation@@@@ABVNmId@@00@Z @ 224 NONAME ; class QPointer<class NmOperation> NmUiEngine::fetchMessage(class NmId const &, class NmId const &, class NmId const &)
+	?setIconId@NmMailboxMetaData@@QAEXABVNmId@@@Z @ 225 NONAME ; void NmMailboxMetaData::setIconId(class NmId const &)
+	??1NmDataPluginFactory@@EAE@XZ @ 226 NONAME ; NmDataPluginFactory::~NmDataPluginFactory(void)
+	?refreshMailboxListModel@NmUiEngine@@QAEXXZ @ 227 NONAME ; void NmUiEngine::refreshMailboxListModel(void)
+	?qt_metacall@NmStoreEnvelopesOperation@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 228 NONAME ; int NmStoreEnvelopesOperation::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?trUtf8@NmMessageListModel@@SA?AVQString@@PBD0@Z @ 229 NONAME ; class QString NmMessageListModel::trUtf8(char const *, char const *)
+	?rowCount@NmFolderListModel@@UBEHABVQModelIndex@@@Z @ 230 NONAME ; int NmFolderListModel::rowCount(class QModelIndex const &) const
+	?doUpdateOperationProgress@NmOperation@@MAEXXZ @ 231 NONAME ; void NmOperation::doUpdateOperationProgress(void)
+	?tr@NmMailboxListModel@@SA?AVQString@@PBD0@Z @ 232 NONAME ; class QString NmMailboxListModel::tr(char const *, char const *)
+	?removeMessage@NmUiEngine@@QAEHABVNmId@@00@Z @ 233 NONAME ; int NmUiEngine::removeMessage(class NmId const &, class NmId const &, class NmId const &)
+	??_ENmUiEngine@@UAE@I@Z @ 234 NONAME ; NmUiEngine::~NmUiEngine(unsigned int)
+	??_ENmMessageSearchListModel@@UAE@I@Z @ 235 NONAME ; NmMessageSearchListModel::~NmMessageSearchListModel(unsigned int)
+	?operationCompleted@NmOperation@@IAEXH@Z @ 236 NONAME ; void NmOperation::operationCompleted(int)
+	?callEmitDataChanged@NmMessageListModelItem@@QAEXXZ @ 237 NONAME ; void NmMessageListModelItem::callEmitDataChanged(void)
+	?matchFound@NmUiEngine@@IAEXABVNmId@@@Z @ 238 NONAME ; void NmUiEngine::matchFound(class NmId const &)
+	?tr@NmCheckOutboxOperation@@SA?AVQString@@PBD0H@Z @ 239 NONAME ; class QString NmCheckOutboxOperation::tr(char const *, char const *, int)
+	?addSearchResult@NmMessageSearchListModel@@QAE_NABVNmId@@@Z @ 240 NONAME ; bool NmMessageSearchListModel::addSearchResult(class NmId const &)
+	??0NmMessageListModel@@QAE@AAVNmDataManager@@PAVQObject@@@Z @ 241 NONAME ; NmMessageListModel::NmMessageListModel(class NmDataManager &, class QObject *)
+	??_ENmAddAttachmentsOperation@@UAE@I@Z @ 242 NONAME ; NmAddAttachmentsOperation::~NmAddAttachmentsOperation(unsigned int)
+	?syncState@NmUiEngine@@QAE?AW4NmSyncState@@ABVNmId@@@Z @ 243 NONAME ; enum NmSyncState NmUiEngine::syncState(class NmId const &)
+	??1NmOperation@@MAE@XZ @ 244 NONAME ; NmOperation::~NmOperation(void)
+	?tr@NmStoreEnvelopesOperation@@SA?AVQString@@PBD0H@Z @ 245 NONAME ; class QString NmStoreEnvelopesOperation::tr(char const *, char const *, int)
+	?listMailboxes@NmDataManager@@QAEXAAV?$QList@PAVNmMailbox@@@@@Z @ 246 NONAME ; void NmDataManager::listMailboxes(class QList<class NmMailbox *> &)
+	?message@NmUiEngine@@QAEPAVNmMessage@@ABVNmId@@00@Z @ 247 NONAME ; class NmMessage * NmUiEngine::message(class NmId const &, class NmId const &, class NmId const &)
+	?refreshMailbox@NmUiEngine@@QAEHABVNmId@@@Z @ 248 NONAME ; int NmUiEngine::refreshMailbox(class NmId const &)
+	?trUtf8@NmUiEngine@@SA?AVQString@@PBD0@Z @ 249 NONAME ; class QString NmUiEngine::trUtf8(char const *, char const *)
+	?contentToMessagePart@NmUiEngine@@QAEHABVNmId@@00AAVNmMessagePart@@@Z @ 250 NONAME ; int NmUiEngine::contentToMessagePart(class NmId const &, class NmId const &, class NmId const &, class NmMessagePart &)
+	?removeItem@NmMessageListModel@@AAEXHAAVNmMessageListModelItem@@@Z @ 251 NONAME ; void NmMessageListModel::removeItem(int, class NmMessageListModelItem &)
+	??1NmMailboxListModel@@UAE@XZ @ 252 NONAME ; NmMailboxListModel::~NmMailboxListModel(void)
+	??0NmBaseClientPlugin@@QAE@XZ @ 253 NONAME ; NmBaseClientPlugin::NmBaseClientPlugin(void)
+	?forwardMail@NmBaseClientPlugin@@QAEXXZ @ 254 NONAME ; void NmBaseClientPlugin::forwardMail(void)
+	?setItemType@NmMessageListModelItem@@QAEXW4NmMessageItemType@1@@Z @ 255 NONAME ; void NmMessageListModelItem::setItemType(enum NmMessageListModelItem::NmMessageItemType)
+	??_ENmDataPluginFactory@@UAE@I@Z @ 256 NONAME ; NmDataPluginFactory::~NmDataPluginFactory(unsigned int)
+	?mailboxListChanged@NmBaseClientPlugin@@AAEXABVNmId@@W4MailboxEventType@NmSettings@@@Z @ 257 NONAME ; void NmBaseClientPlugin::mailboxListChanged(class NmId const &, enum NmSettings::MailboxEventType)
+	?expanded@NmMessageListModelItem@@QBE_NXZ @ 258 NONAME ; bool NmMessageListModelItem::expanded(void) const
+	?columnCount@NmFolderListModel@@UBEHABVQModelIndex@@@Z @ 259 NONAME ; int NmFolderListModel::columnCount(class QModelIndex const &) const
+	?pluginInstance@NmDataPluginFactory@@QAEPAVQObject@@VNmId@@@Z @ 260 NONAME ; class QObject * NmDataPluginFactory::pluginInstance(class NmId)
+	?setNewParam@NmMessageListModel@@IAEXPAVNmUiStartParam@@@Z @ 261 NONAME ; void NmMessageListModel::setNewParam(class NmUiStartParam *)
+	?data@NmMessageListModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 262 NONAME ; class QVariant NmMessageListModel::data(class QModelIndex const &, int) const
+	?goOnline@NmBaseClientPlugin@@AAEXABVNmId@@@Z @ 263 NONAME ; void NmBaseClientPlugin::goOnline(class NmId const &)
+	?createNewMail@NmBaseClientPlugin@@QAEXXZ @ 264 NONAME ; void NmBaseClientPlugin::createNewMail(void)
+	??_ENmCheckOutboxOperation@@UAE@I@Z @ 265 NONAME ; NmCheckOutboxOperation::~NmCheckOutboxOperation(unsigned int)
+	?qt_metacast@NmBaseClientPlugin@@UAEPAXPBD@Z @ 266 NONAME ; void * NmBaseClientPlugin::qt_metacast(char const *)
+	?staticMetaObject@NmBaseClientPlugin@@2UQMetaObject@@B @ 267 NONAME ; struct QMetaObject const NmBaseClientPlugin::staticMetaObject
+	?searchComplete@NmUiEngine@@IAEXXZ @ 268 NONAME ; void NmUiEngine::searchComplete(void)
+	?setEnvelope@NmMessageListModelItem@@QAEXABVNmMessageEnvelope@@@Z @ 269 NONAME ; void NmMessageListModelItem::setEnvelope(class NmMessageEnvelope const &)
+	?qt_metacast@NmAddAttachmentsOperation@@UAEPAXPBD@Z @ 270 NONAME ; void * NmAddAttachmentsOperation::qt_metacast(char const *)
+	?createNewMailViewerToolBar@NmBaseClientPlugin@@QAEXXZ @ 271 NONAME ; void NmBaseClientPlugin::createNewMailViewerToolBar(void)
+	?staticMetaObject@NmMailboxListModel@@2UQMetaObject@@B @ 272 NONAME ; struct QMetaObject const NmMailboxListModel::staticMetaObject
+	?qt_metacall@NmMessageCreationOperation@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 273 NONAME ; int NmMessageCreationOperation::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?trUtf8@NmDataManager@@SA?AVQString@@PBD0H@Z @ 274 NONAME ; class QString NmDataManager::trUtf8(char const *, char const *, int)
+	?trUtf8@NmMessageCreationOperation@@SA?AVQString@@PBD0H@Z @ 275 NONAME ; class QString NmMessageCreationOperation::trUtf8(char const *, char const *, int)
+	?createForwardMessage@NmUiEngine@@QAE?AV?$QPointer@VNmMessageCreationOperation@@@@ABVNmId@@0@Z @ 276 NONAME ; class QPointer<class NmMessageCreationOperation> NmUiEngine::createForwardMessage(class NmId const &, class NmId const &)
+	?handleSyncStateEvent@NmUiEngine@@QAEXW4NmSyncState@@ABVNmOperationCompletionEvent@@@Z @ 277 NONAME ; void NmUiEngine::handleSyncStateEvent(enum NmSyncState, class NmOperationCompletionEvent const &)
+	?completeOperation@NmOperation@@QAEXH@Z @ 278 NONAME ; void NmOperation::completeOperation(int)
+	?parent@NmFolderListModel@@UBE?AVQModelIndex@@ABV2@@Z @ 279 NONAME ; class QModelIndex NmFolderListModel::parent(class QModelIndex const &) const
+	?folder@NmDataManager@@QAEPAVNmFolder@@ABVNmId@@0@Z @ 280 NONAME ; class NmFolder * NmDataManager::folder(class NmId const &, class NmId const &)
+	??0NmMessageSendingOperation@@QAE@XZ @ 281 NONAME ; NmMessageSendingOperation::NmMessageSendingOperation(void)
+	?replyMail@NmBaseClientPlugin@@QAEXXZ @ 282 NONAME ; void NmBaseClientPlugin::replyMail(void)
+	??1NmMessageListModelItem@@UAE@XZ @ 283 NONAME ; NmMessageListModelItem::~NmMessageListModelItem(void)
+	?mailboxPropertyChanged@NmBaseClientPlugin@@AAEXABVNmId@@VQVariant@@1@Z @ 284 NONAME ; void NmBaseClientPlugin::mailboxPropertyChanged(class NmId const &, class QVariant, class QVariant)
+	?qt_metacall@NmOperation@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 285 NONAME ; int NmOperation::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?removeMessageFromModel@NmMessageListModel@@AAEXABVNmId@@@Z @ 286 NONAME ; void NmMessageListModel::removeMessageFromModel(class NmId const &)
+	?trUtf8@NmMessageListModel@@SA?AVQString@@PBD0H@Z @ 287 NONAME ; class QString NmMessageListModel::trUtf8(char const *, char const *, int)
+	?handleRequest@NmBaseClientPlugin@@AAEXW4NmActionResponseCommand@@ABVNmActionRequest@@@Z @ 288 NONAME ; void NmBaseClientPlugin::handleRequest(enum NmActionResponseCommand, class NmActionRequest const &)
+	?operationPartCompleted@NmAddAttachmentsOperation@@IAEXABVQString@@ABVNmId@@H@Z @ 289 NONAME ; void NmAddAttachmentsOperation::operationPartCompleted(class QString const &, class NmId const &, int)
+	?trUtf8@NmStoreEnvelopesOperation@@SA?AVQString@@PBD0H@Z @ 290 NONAME ; class QString NmStoreEnvelopesOperation::trUtf8(char const *, char const *, int)
+	?tr@NmMessageListModel@@SA?AVQString@@PBD0@Z @ 291 NONAME ; class QString NmMessageListModel::tr(char const *, char const *)
+	?doCompleteOperation@NmOperation@@MAEXXZ @ 292 NONAME ; void NmOperation::doCompleteOperation(void)
+	?dividerInsertionIndex@NmMessageListModel@@AAEHH@Z @ 293 NONAME ; int NmMessageListModel::dividerInsertionIndex(int)
+	??1NmCheckOutboxOperation@@MAE@XZ @ 294 NONAME ; NmCheckOutboxOperation::~NmCheckOutboxOperation(void)
+	?createMessageItem@NmMessageListModel@@AAEPAVNmMessageListModelItem@@PAVNmMessageEnvelope@@@Z @ 295 NONAME ; class NmMessageListModelItem * NmMessageListModel::createMessageItem(class NmMessageEnvelope *)
+	?id@NmFolderMetaData@@QBE?AVNmId@@XZ @ 296 NONAME ; class NmId NmFolderMetaData::id(void) const
+	?createReplyMessage@NmUiEngine@@QAE?AV?$QPointer@VNmMessageCreationOperation@@@@ABVNmId@@0_N@Z @ 297 NONAME ; class QPointer<class NmMessageCreationOperation> NmUiEngine::createReplyMessage(class NmId const &, class NmId const &, bool)
+	?getStandardFolderId@NmDataManager@@QAE?AVNmId@@ABV2@W4NmFolderType@@@Z @ 298 NONAME ; class NmId NmDataManager::getStandardFolderId(class NmId const &, enum NmFolderType)
+	?dividersActive@NmMessageListModel@@QAE_NXZ @ 299 NONAME ; bool NmMessageListModel::dividersActive(void)
+	?trUtf8@NmMessageSearchListModel@@SA?AVQString@@PBD0H@Z @ 300 NONAME ; class QString NmMessageSearchListModel::trUtf8(char const *, char const *, int)
+	?titleDivider@NmMessageListModelItem@@QBE?AVQString@@XZ @ 301 NONAME ; class QString NmMessageListModelItem::titleDivider(void) const
+	?getStaticMetaObject@NmBaseClientPlugin@@SAABUQMetaObject@@XZ @ 302 NONAME ; struct QMetaObject const & NmBaseClientPlugin::getStaticMetaObject(void)
+	?qt_metacast@NmMessageCreationOperation@@UAEPAXPBD@Z @ 303 NONAME ; void * NmMessageCreationOperation::qt_metacast(char const *)
+	?updateEnvelope@NmMessageListModel@@AAEXW4NmEnvelopeProperties@@ABVNmId@@@Z @ 304 NONAME ; void NmMessageListModel::updateEnvelope(enum NmEnvelopeProperties, class NmId const &)
+	??_ENmDataManager@@UAE@I@Z @ 305 NONAME ; NmDataManager::~NmDataManager(unsigned int)
+	?qt_metacast@NmMailboxListModel@@UAEPAXPBD@Z @ 306 NONAME ; void * NmMailboxListModel::qt_metacast(char const *)
+	?search@NmUiEngine@@QAEHABVNmId@@ABVQStringList@@@Z @ 307 NONAME ; int NmUiEngine::search(class NmId const &, class QStringList const &)
+	?setEnvelopes@NmUiEngine@@QAE?AV?$QPointer@VNmStoreEnvelopesOperation@@@@ABVNmId@@0W4NmEnvelopeProperties@@ABV?$QList@PB$$CBVNmMessageEnvelope@@@@@Z @ 308 NONAME ; class QPointer<class NmStoreEnvelopesOperation> NmUiEngine::setEnvelopes(class NmId const &, class NmId const &, enum NmEnvelopeProperties, class QList<class NmMessageEnvelope const *> const &)
+	?getActions@NmBaseClientPlugin@@UAEXABVNmActionRequest@@AAV?$QList@PAVNmAction@@@@@Z @ 309 NONAME ; void NmBaseClientPlugin::getActions(class NmActionRequest const &, class QList<class NmAction *> &)
+	?qt_metacast@NmStoreEnvelopesOperation@@UAEPAXPBD@Z @ 310 NONAME ; void * NmStoreEnvelopesOperation::qt_metacast(char const *)
+	?handleMessageEvent@NmMessageListModel@@QAEXW4NmMessageEvent@@ABVNmId@@ABV?$QList@VNmId@@@@@Z @ 311 NONAME ; void NmMessageListModel::handleMessageEvent(enum NmMessageEvent, class NmId const &, class QList<class NmId> const &)
+	??_ENmMailboxMetaData@@UAE@I@Z @ 312 NONAME ; NmMailboxMetaData::~NmMailboxMetaData(unsigned int)
+	??0NmMessageListModelItem@@QAE@XZ @ 313 NONAME ; NmMessageListModelItem::NmMessageListModelItem(void)
+	?tr@NmAddAttachmentsOperation@@SA?AVQString@@PBD0H@Z @ 314 NONAME ; class QString NmAddAttachmentsOperation::tr(char const *, char const *, int)
+	?setDividers@NmMessageListModel@@QAEX_N@Z @ 315 NONAME ; void NmMessageListModel::setDividers(bool)
+	?loadPlugin@NmDataPluginFactory@@QAEPAVQObject@@ABVQDir@@ABVQString@@@Z @ 316 NONAME ; class QObject * NmDataPluginFactory::loadPlugin(class QDir const &, class QString const &)
+	?qt_metacast@NmOperation@@UAEPAXPBD@Z @ 317 NONAME ; void * NmOperation::qt_metacast(char const *)
+	?tr@NmMessageListModel@@SA?AVQString@@PBD0H@Z @ 318 NONAME ; class QString NmMessageListModel::tr(char const *, char const *, int)
+	?removeAttachment@NmUiEngine@@QAE?AV?$QPointer@VNmOperation@@@@ABVNmMessage@@ABVNmId@@@Z @ 319 NONAME ; class QPointer<class NmOperation> NmUiEngine::removeAttachment(class NmMessage const &, class NmId const &)
+	?staticMetaObject@NmMessageListModel@@2UQMetaObject@@B @ 320 NONAME ; struct QMetaObject const NmMessageListModel::staticMetaObject
+	?qt_metacall@NmAddAttachmentsOperation@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 321 NONAME ; int NmAddAttachmentsOperation::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?qt_metacall@NmUiEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 322 NONAME ; int NmUiEngine::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?tr@NmMessageSearchListModel@@SA?AVQString@@PBD0H@Z @ 323 NONAME ; class QString NmMessageSearchListModel::tr(char const *, char const *, int)
+	?message@NmDataManager@@QAEPAVNmMessage@@ABVNmId@@00@Z @ 324 NONAME ; class NmMessage * NmDataManager::message(class NmId const &, class NmId const &, class NmId const &)
+	?metaObject@NmOperation@@UBEPBUQMetaObject@@XZ @ 325 NONAME ; struct QMetaObject const * NmOperation::metaObject(void) const
+	?folderTypeById@NmUiEngine@@QAE?AW4NmFolderType@@VNmId@@0@Z @ 326 NONAME ; enum NmFolderType NmUiEngine::folderTypeById(class NmId, class NmId)
+	?refreshContent@NmMessageSearchListModel@@QAEXXZ @ 327 NONAME ; void NmMessageSearchListModel::refreshContent(void)
+	?searchResultCount@NmMessageSearchListModel@@QBEHXZ @ 328 NONAME ; int NmMessageSearchListModel::searchResultCount(void) const
+	?handleConnectEvent@NmUiEngine@@QAEXW4NmConnectState@@ABVNmId@@H@Z @ 329 NONAME ; void NmUiEngine::handleConnectEvent(enum NmConnectState, class NmId const &, int)
 
--- a/emailuis/nmailuiengine/eabi/nmailuiengineu.def	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiengine/eabi/nmailuiengineu.def	Fri May 14 15:41:10 2010 +0300
@@ -1,286 +1,333 @@
 EXPORTS
-	_ZN10NmUiEngine11checkOutboxERK4NmId @ 1 NONAME
-	_ZN10NmUiEngine11mailboxByIdERK4NmId @ 2 NONAME
-	_ZN10NmUiEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 3 NONAME
-	_ZN10NmUiEngine11qt_metacastEPKc @ 4 NONAME
-	_ZN10NmUiEngine11saveMessageERK9NmMessage @ 5 NONAME
-	_ZN10NmUiEngine11sendMessageEP9NmMessageRK5QListIP11NmOperationE @ 6 NONAME
-	_ZN10NmUiEngine12fetchMessageERK4NmIdS2_S2_ @ 7 NONAME
-	_ZN10NmUiEngine12setEnvelopesERK4NmIdS2_20NmEnvelopePropertiesRK5QListIPK17NmMessageEnvelopeE @ 8 NONAME
-	_ZN10NmUiEngine13removeMessageERK4NmIdS2_S2_ @ 9 NONAME
-	_ZN10NmUiEngine14addAttachmentsERK9NmMessageRK5QListI7QStringE @ 10 NONAME
-	_ZN10NmUiEngine14deleteMessagesERK4NmIdS2_RK5QListIS0_E @ 11 NONAME
-	_ZN10NmUiEngine14refreshMailboxERK4NmId @ 12 NONAME
-	_ZN10NmUiEngine14storeOperationEP11NmOperation @ 13 NONAME
-	_ZN10NmUiEngine14syncStateEventE11NmSyncStateRK4NmId @ 14 NONAME
-	_ZN10NmUiEngine15connectionEventE14NmConnectStateRK4NmId @ 15 NONAME
-	_ZN10NmUiEngine15connectionStateERK4NmId @ 16 NONAME
-	_ZN10NmUiEngine15mReferenceCountE @ 17 NONAME DATA 4
-	_ZN10NmUiEngine15messagePartFileERK4NmIdS2_S2_S2_ @ 18 NONAME
-	_ZN10NmUiEngine15releaseInstanceERPS_ @ 19 NONAME
-	_ZN10NmUiEngine16createNewMessageERK4NmId @ 20 NONAME
-	_ZN10NmUiEngine16fetchMessagePartERK4NmIdS2_S2_S2_ @ 21 NONAME
-	_ZN10NmUiEngine16mailboxListModelEv @ 22 NONAME
-	_ZN10NmUiEngine16messageListModelERK4NmIdS2_ @ 23 NONAME
-	_ZN10NmUiEngine16removeAttachmentERK9NmMessageRK4NmId @ 24 NONAME
-	_ZN10NmUiEngine16standardFolderIdERK4NmId12NmFolderType @ 25 NONAME
-	_ZN10NmUiEngine16staticMetaObjectE @ 26 NONAME DATA 16
-	_ZN10NmUiEngine18createReplyMessageERK4NmIdS2_b @ 27 NONAME
-	_ZN10NmUiEngine19getStaticMetaObjectEv @ 28 NONAME
-	_ZN10NmUiEngine20cleanupSendOperationEv @ 29 NONAME
-	_ZN10NmUiEngine20contentToMessagePartERK4NmIdS2_S2_R13NmMessagePart @ 30 NONAME
-	_ZN10NmUiEngine20createForwardMessageERK4NmIdS2_ @ 31 NONAME
-	_ZN10NmUiEngine23refreshMailboxListModelEv @ 32 NONAME
-	_ZN10NmUiEngine23releaseMessageListModelERK4NmId @ 33 NONAME
-	_ZN10NmUiEngine24handleCompletedOperationEv @ 34 NONAME
-	_ZN10NmUiEngine28handleCompletedSendOperationEv @ 35 NONAME
-	_ZN10NmUiEngine7messageERK4NmIdS2_S2_ @ 36 NONAME
-	_ZN10NmUiEngine8goOnlineERK4NmId @ 37 NONAME
-	_ZN10NmUiEngine8instanceEv @ 38 NONAME
-	_ZN10NmUiEngine9goOfflineERK4NmId @ 39 NONAME
-	_ZN10NmUiEngine9mInstanceE @ 40 NONAME DATA 4
-	_ZN10NmUiEngine9syncStateERK4NmId @ 41 NONAME
-	_ZN10NmUiEngineC1Ev @ 42 NONAME
-	_ZN10NmUiEngineC2Ev @ 43 NONAME
-	_ZN10NmUiEngineD0Ev @ 44 NONAME
-	_ZN10NmUiEngineD1Ev @ 45 NONAME
-	_ZN10NmUiEngineD2Ev @ 46 NONAME
-	_ZN11NmOperation11qt_metacallEN11QMetaObject4CallEiPPv @ 47 NONAME
-	_ZN11NmOperation11qt_metacastEPKc @ 48 NONAME
-	_ZN11NmOperation15cancelOperationEv @ 49 NONAME
-	_ZN11NmOperation16staticMetaObjectE @ 50 NONAME DATA 16
-	_ZN11NmOperation17completeOperationEi @ 51 NONAME
-	_ZN11NmOperation17doCancelOperationEv @ 52 NONAME
-	_ZN11NmOperation17runAsyncOperationEv @ 53 NONAME
-	_ZN11NmOperation18operationCancelledEv @ 54 NONAME
-	_ZN11NmOperation18operationCompletedEi @ 55 NONAME
-	_ZN11NmOperation19doCompleteOperationEv @ 56 NONAME
-	_ZN11NmOperation19getStaticMetaObjectEv @ 57 NONAME
-	_ZN11NmOperation23addPreliminaryOperationEPS_ @ 58 NONAME
-	_ZN11NmOperation23updateOperationProgressEi @ 59 NONAME
-	_ZN11NmOperation24operationProgressChangedEi @ 60 NONAME
-	_ZN11NmOperation25doUpdateOperationProgressEv @ 61 NONAME
-	_ZN11NmOperation34handlePreliminaryOperationFinishedEv @ 62 NONAME
-	_ZN11NmOperationC2EP7QObject @ 63 NONAME
-	_ZN11NmOperationD0Ev @ 64 NONAME
-	_ZN11NmOperationD1Ev @ 65 NONAME
-	_ZN11NmOperationD2Ev @ 66 NONAME
-	_ZN13NmDataManager10folderByIdERK4NmIdS2_ @ 67 NONAME
-	_ZN13NmDataManager11listFoldersE4NmIdR5QListIP8NmFolderE @ 68 NONAME
-	_ZN13NmDataManager11mailboxByIdERK4NmId @ 69 NONAME
-	_ZN13NmDataManager11qt_metacallEN11QMetaObject4CallEiPPv @ 70 NONAME
-	_ZN13NmDataManager11qt_metacastEPKc @ 71 NONAME
-	_ZN13NmDataManager12envelopeByIdERK4NmIdS2_S2_ @ 72 NONAME
-	_ZN13NmDataManager12listMessagesERK4NmIdS2_R5QListIP17NmMessageEnvelopeE @ 73 NONAME
-	_ZN13NmDataManager13listMailboxesER5QListIP9NmMailboxE @ 74 NONAME
-	_ZN13NmDataManager14listMailboxIdsER5QListI4NmIdE @ 75 NONAME
-	_ZN13NmDataManager16staticMetaObjectE @ 76 NONAME DATA 16
-	_ZN13NmDataManager19getStandardFolderIdERK4NmId12NmFolderType @ 77 NONAME
-	_ZN13NmDataManager19getStaticMetaObjectEv @ 78 NONAME
-	_ZN13NmDataManager20contentToMessagePartERK4NmIdS2_S2_R13NmMessagePart @ 79 NONAME
-	_ZN13NmDataManager6folderERK4NmIdS2_ @ 80 NONAME
-	_ZN13NmDataManager7mailboxERK4NmId @ 81 NONAME
-	_ZN13NmDataManager7messageERK4NmIdS2_S2_ @ 82 NONAME
-	_ZN13NmDataManagerC1Ev @ 83 NONAME
-	_ZN13NmDataManagerC2Ev @ 84 NONAME
-	_ZN13NmDataManagerD0Ev @ 85 NONAME
-	_ZN13NmDataManagerD1Ev @ 86 NONAME
-	_ZN13NmDataManagerD2Ev @ 87 NONAME
-	_ZN16NmFolderMetaData5setIdERK4NmId @ 88 NONAME
-	_ZN16NmFolderMetaData7setNameERK7QString @ 89 NONAME
-	_ZN16NmFolderMetaDataC1Ev @ 90 NONAME
-	_ZN16NmFolderMetaDataC2Ev @ 91 NONAME
-	_ZN16NmFolderMetaDataD0Ev @ 92 NONAME
-	_ZN16NmFolderMetaDataD1Ev @ 93 NONAME
-	_ZN16NmFolderMetaDataD2Ev @ 94 NONAME
-	_ZN17NmFolderListModel7refreshER5QListIP8NmFolderE @ 95 NONAME
-	_ZN17NmFolderListModelC1ER13NmDataManagerP7QObject @ 96 NONAME
-	_ZN17NmFolderListModelC2ER13NmDataManagerP7QObject @ 97 NONAME
-	_ZN17NmFolderListModelD0Ev @ 98 NONAME
-	_ZN17NmFolderListModelD1Ev @ 99 NONAME
-	_ZN17NmFolderListModelD2Ev @ 100 NONAME
-	_ZN17NmMailboxMetaData5setIdERK4NmId @ 101 NONAME
-	_ZN17NmMailboxMetaData7setNameERK7QString @ 102 NONAME
-	_ZN17NmMailboxMetaData9setIconIdERK4NmId @ 103 NONAME
-	_ZN17NmMailboxMetaDataC1Ev @ 104 NONAME
-	_ZN17NmMailboxMetaDataC2Ev @ 105 NONAME
-	_ZN17NmMailboxMetaDataD0Ev @ 106 NONAME
-	_ZN17NmMailboxMetaDataD1Ev @ 107 NONAME
-	_ZN17NmMailboxMetaDataD2Ev @ 108 NONAME
-	_ZN18NmBaseClientPlugin10getActionsERK15NmActionRequestR5QListIP8NmActionE @ 109 NONAME
-	_ZN18NmBaseClientPlugin10markAsReadEv @ 110 NONAME
-	_ZN18NmBaseClientPlugin11forwardMailEv @ 111 NONAME
-	_ZN18NmBaseClientPlugin11openMessageEv @ 112 NONAME
-	_ZN18NmBaseClientPlugin11qt_metacallEN11QMetaObject4CallEiPPv @ 113 NONAME
-	_ZN18NmBaseClientPlugin11qt_metacastEPKc @ 114 NONAME
-	_ZN18NmBaseClientPlugin12markAsUnreadEv @ 115 NONAME
-	_ZN18NmBaseClientPlugin12replyAllMailEv @ 116 NONAME
-	_ZN18NmBaseClientPlugin13createNewMailEv @ 117 NONAME
-	_ZN18NmBaseClientPlugin13deleteMessageEv @ 118 NONAME
-	_ZN18NmBaseClientPlugin13handleRequestE23NmActionResponseCommandRK15NmActionRequest @ 119 NONAME
-	_ZN18NmBaseClientPlugin14setPriorityLowEv @ 120 NONAME
-	_ZN18NmBaseClientPlugin15setPriorityHighEv @ 121 NONAME
-	_ZN18NmBaseClientPlugin16staticMetaObjectE @ 122 NONAME DATA 16
-	_ZN18NmBaseClientPlugin17setPriorityNormalEv @ 123 NONAME
-	_ZN18NmBaseClientPlugin18mailboxListChangedERK4NmIdN10NmSettings16MailboxEventTypeE @ 124 NONAME
-	_ZN18NmBaseClientPlugin19getStaticMetaObjectEv @ 125 NONAME
-	_ZN18NmBaseClientPlugin22mailboxPropertyChangedERK4NmId8QVariantS3_ @ 126 NONAME
-	_ZN18NmBaseClientPlugin22updateEnvelopePropertyE20NmEnvelopeProperties @ 127 NONAME
-	_ZN18NmBaseClientPlugin24createEditorViewCommandsERK15NmActionRequestR5QListIP8NmActionE @ 128 NONAME
-	_ZN18NmBaseClientPlugin24createViewerViewCommandsERK15NmActionRequestR5QListIP8NmActionE @ 129 NONAME
-	_ZN18NmBaseClientPlugin25createMessageListCommandsERK15NmActionRequestR5QListIP8NmActionE @ 130 NONAME
-	_ZN18NmBaseClientPlugin26createNewMailViewerToolBarEv @ 131 NONAME
-	_ZN18NmBaseClientPlugin27deleteMessageFromViewerViewEv @ 132 NONAME
-	_ZN18NmBaseClientPlugin6attachEv @ 133 NONAME
-	_ZN18NmBaseClientPlugin7refreshEv @ 134 NONAME
-	_ZN18NmBaseClientPlugin8goOnlineERK4NmId @ 135 NONAME
-	_ZN18NmBaseClientPlugin8sendMailEv @ 136 NONAME
-	_ZN18NmBaseClientPlugin8settingsEv @ 137 NONAME
-	_ZN18NmBaseClientPlugin9goOfflineERK4NmId @ 138 NONAME
-	_ZN18NmBaseClientPlugin9replyMailEv @ 139 NONAME
-	_ZN18NmBaseClientPluginC2Ev @ 140 NONAME
-	_ZN18NmBaseClientPluginD0Ev @ 141 NONAME
-	_ZN18NmBaseClientPluginD1Ev @ 142 NONAME
-	_ZN18NmBaseClientPluginD2Ev @ 143 NONAME
-	_ZN18NmMailboxListModel11qt_metacallEN11QMetaObject4CallEiPPv @ 144 NONAME
-	_ZN18NmMailboxListModel11qt_metacastEPKc @ 145 NONAME
-	_ZN18NmMailboxListModel16refreshModelItemERK4NmIdb @ 146 NONAME
-	_ZN18NmMailboxListModel16staticMetaObjectE @ 147 NONAME DATA 16
-	_ZN18NmMailboxListModel17createMailboxItemEPK9NmMailbox @ 148 NONAME
-	_ZN18NmMailboxListModel18handleMailboxEventE14NmMailboxEventRK5QListI4NmIdE @ 149 NONAME
-	_ZN18NmMailboxListModel19getStaticMetaObjectEv @ 150 NONAME
-	_ZN18NmMailboxListModel7refreshER5QListIP9NmMailboxE @ 151 NONAME
-	_ZN18NmMailboxListModelC1ER13NmDataManagerP7QObject @ 152 NONAME
-	_ZN18NmMailboxListModelC2ER13NmDataManagerP7QObject @ 153 NONAME
-	_ZN18NmMailboxListModelD0Ev @ 154 NONAME
-	_ZN18NmMailboxListModelD1Ev @ 155 NONAME
-	_ZN18NmMailboxListModelD2Ev @ 156 NONAME
-	_ZN18NmMessageListModel10removeItemEiR22NmMessageListModelItem @ 157 NONAME
-	_ZN18NmMessageListModel11qt_metacallEN11QMetaObject4CallEiPPv @ 158 NONAME
-	_ZN18NmMessageListModel11qt_metacastEPKc @ 159 NONAME
-	_ZN18NmMessageListModel11setDividersEb @ 160 NONAME
-	_ZN18NmMessageListModel11setNewParamEP14NmUiStartParam @ 161 NONAME
-	_ZN18NmMessageListModel13itemFromModelERK4NmId @ 162 NONAME
-	_ZN18NmMessageListModel13removeMessageERK4NmId @ 163 NONAME
-	_ZN18NmMessageListModel14dividersActiveEv @ 164 NONAME
-	_ZN18NmMessageListModel14updateEnvelopeE20NmEnvelopePropertiesRK4NmId @ 165 NONAME
-	_ZN18NmMessageListModel16currentMailboxIdEv @ 166 NONAME
-	_ZN18NmMessageListModel16staticMetaObjectE @ 167 NONAME DATA 16
-	_ZN18NmMessageListModel17createMessageItemEP17NmMessageEnvelope @ 168 NONAME
-	_ZN18NmMessageListModel18handleMessageEventE14NmMessageEventRK4NmIdRK5QListIS1_E @ 169 NONAME
-	_ZN18NmMessageListModel19getStaticMetaObjectEv @ 170 NONAME
-	_ZN18NmMessageListModel21dividerInsertionIndexEi @ 171 NONAME
-	_ZN18NmMessageListModel21setEnvelopePropertiesE20NmEnvelopePropertiesRK5QListI4NmIdE @ 172 NONAME
-	_ZN18NmMessageListModel21updateMessageEnvelopeERK4NmIdS2_S2_ @ 173 NONAME
-	_ZN18NmMessageListModel22createTitleDividerItemEP17NmMessageEnvelope @ 174 NONAME
-	_ZN18NmMessageListModel22insertDividerIntoModelEP17NmMessageEnvelopei @ 175 NONAME
-	_ZN18NmMessageListModel22insertMessageIntoModelEP17NmMessageEnvelopeib @ 176 NONAME
-	_ZN18NmMessageListModel22removeMessageFromModelERK4NmId @ 177 NONAME
-	_ZN18NmMessageListModel25insertNewMessageIntoModelERK4NmIdS2_S2_ @ 178 NONAME
-	_ZN18NmMessageListModel7changedERK17NmMessageEnvelopeS2_ @ 179 NONAME
-	_ZN18NmMessageListModel7refreshE4NmIdS0_RK5QListIP17NmMessageEnvelopeE @ 180 NONAME
-	_ZN18NmMessageListModelC1ER13NmDataManagerP7QObject @ 181 NONAME
-	_ZN18NmMessageListModelC2ER13NmDataManagerP7QObject @ 182 NONAME
-	_ZN18NmMessageListModelD0Ev @ 183 NONAME
-	_ZN18NmMessageListModelD1Ev @ 184 NONAME
-	_ZN18NmMessageListModelD2Ev @ 185 NONAME
-	_ZN19NmDataPluginFactory10loadPluginERK4QDirRK7QString @ 186 NONAME
-	_ZN19NmDataPluginFactory12mPluginArrayE @ 187 NONAME DATA 4
-	_ZN19NmDataPluginFactory14pluginInstanceE4NmId @ 188 NONAME
-	_ZN19NmDataPluginFactory15mReferenceCountE @ 189 NONAME DATA 4
-	_ZN19NmDataPluginFactory15pluginInstancesEv @ 190 NONAME
-	_ZN19NmDataPluginFactory15releaseInstanceERPS_ @ 191 NONAME
-	_ZN19NmDataPluginFactory17interfaceInstanceE4NmId @ 192 NONAME
-	_ZN19NmDataPluginFactory17interfaceInstanceEP7QObject @ 193 NONAME
-	_ZN19NmDataPluginFactory18mPluginLoaderArrayE @ 194 NONAME DATA 4
-	_ZN19NmDataPluginFactory8instanceEv @ 195 NONAME
-	_ZN19NmDataPluginFactory9mInstanceE @ 196 NONAME DATA 4
-	_ZN19NmDataPluginFactoryC1Ev @ 197 NONAME
-	_ZN19NmDataPluginFactoryC2Ev @ 198 NONAME
-	_ZN19NmDataPluginFactoryD0Ev @ 199 NONAME
-	_ZN19NmDataPluginFactoryD1Ev @ 200 NONAME
-	_ZN19NmDataPluginFactoryD2Ev @ 201 NONAME
-	_ZN22NmMessageListModelItem11envelopePtrEv @ 202 NONAME
-	_ZN22NmMessageListModelItem11setEnvelopeEP17NmMessageEnvelope @ 203 NONAME
-	_ZN22NmMessageListModelItem11setEnvelopeERK17NmMessageEnvelope @ 204 NONAME
-	_ZN22NmMessageListModelItem11setExpandedEb @ 205 NONAME
-	_ZN22NmMessageListModelItem11setItemTypeENS_17NmMessageItemTypeE @ 206 NONAME
-	_ZN22NmMessageListModelItem15setTitleDividerERK7QString @ 207 NONAME
-	_ZN22NmMessageListModelItem19callEmitDataChangedEv @ 208 NONAME
-	_ZN22NmMessageListModelItemC1Ev @ 209 NONAME
-	_ZN22NmMessageListModelItemC2Ev @ 210 NONAME
-	_ZN22NmMessageListModelItemD0Ev @ 211 NONAME
-	_ZN22NmMessageListModelItemD1Ev @ 212 NONAME
-	_ZN22NmMessageListModelItemD2Ev @ 213 NONAME
-	_ZN25NmAddAttachmentsOperation11qt_metacallEN11QMetaObject4CallEiPPv @ 214 NONAME
-	_ZN25NmAddAttachmentsOperation11qt_metacastEPKc @ 215 NONAME
-	_ZN25NmAddAttachmentsOperation16staticMetaObjectE @ 216 NONAME DATA 16
-	_ZN25NmAddAttachmentsOperation19getStaticMetaObjectEv @ 217 NONAME
-	_ZN25NmAddAttachmentsOperation21completeOperationPartERK7QStringRK4NmIdi @ 218 NONAME
-	_ZN25NmAddAttachmentsOperation22operationPartCompletedERK7QStringRK4NmIdi @ 219 NONAME
-	_ZN25NmAddAttachmentsOperationC2EP7QObject @ 220 NONAME
-	_ZN25NmAddAttachmentsOperationD0Ev @ 221 NONAME
-	_ZN25NmAddAttachmentsOperationD1Ev @ 222 NONAME
-	_ZN25NmAddAttachmentsOperationD2Ev @ 223 NONAME
-	_ZN7NmIcons7getIconENS_4IconE @ 224 NONAME
-	_ZN7NmIcons9freeIconsEv @ 225 NONAME
-	_ZNK10NmUiEngine10metaObjectEv @ 226 NONAME
-	_ZNK10NmUiEngine16isSendingMessageEv @ 227 NONAME
-	_ZNK10NmUiEngine16messageBeingSentEv @ 228 NONAME
-	_ZNK11NmOperation10metaObjectEv @ 229 NONAME
-	_ZNK11NmOperation9isRunningEv @ 230 NONAME
-	_ZNK13NmDataManager10metaObjectEv @ 231 NONAME
-	_ZNK16NmFolderMetaData2idEv @ 232 NONAME
-	_ZNK16NmFolderMetaData4nameEv @ 233 NONAME
-	_ZNK17NmFolderListModel11columnCountERK11QModelIndex @ 234 NONAME
-	_ZNK17NmFolderListModel4dataERK11QModelIndexi @ 235 NONAME
-	_ZNK17NmFolderListModel6parentERK11QModelIndex @ 236 NONAME
-	_ZNK17NmFolderListModel8rowCountERK11QModelIndex @ 237 NONAME
-	_ZNK17NmMailboxMetaData2idEv @ 238 NONAME
-	_ZNK17NmMailboxMetaData4nameEv @ 239 NONAME
-	_ZNK17NmMailboxMetaData6IconIdEv @ 240 NONAME
-	_ZNK18NmBaseClientPlugin10metaObjectEv @ 241 NONAME
-	_ZNK18NmMailboxListModel10metaObjectEv @ 242 NONAME
-	_ZNK18NmMailboxListModel4dataERK11QModelIndexi @ 243 NONAME
-	_ZNK18NmMessageListModel10metaObjectEv @ 244 NONAME
-	_ZNK18NmMessageListModel17getInsertionIndexERK17NmMessageEnvelope @ 245 NONAME
-	_ZNK18NmMessageListModel30messagesBelongUnderSameDividerEPK17NmMessageEnvelopeS2_ @ 246 NONAME
-	_ZNK18NmMessageListModel4dataERK11QModelIndexi @ 247 NONAME
-	_ZNK22NmMessageListModelItem12titleDividerEv @ 248 NONAME
-	_ZNK22NmMessageListModelItem8envelopeEv @ 249 NONAME
-	_ZNK22NmMessageListModelItem8expandedEv @ 250 NONAME
-	_ZNK22NmMessageListModelItem8itemTypeEv @ 251 NONAME
-	_ZNK25NmAddAttachmentsOperation10metaObjectEv @ 252 NONAME
-	_ZTI10NmUiEngine @ 253 NONAME
-	_ZTI11NmOperation @ 254 NONAME
-	_ZTI13NmDataManager @ 255 NONAME
-	_ZTI16NmFolderMetaData @ 256 NONAME
-	_ZTI17NmFolderListModel @ 257 NONAME
-	_ZTI17NmMailboxMetaData @ 258 NONAME
-	_ZTI18NmBaseClientPlugin @ 259 NONAME
-	_ZTI18NmMailboxListModel @ 260 NONAME
-	_ZTI18NmMessageListModel @ 261 NONAME
-	_ZTI19NmDataPluginFactory @ 262 NONAME
-	_ZTI22NmMessageListModelItem @ 263 NONAME
-	_ZTI25NmAddAttachmentsOperation @ 264 NONAME
-	_ZTV10NmUiEngine @ 265 NONAME
-	_ZTV11NmOperation @ 266 NONAME
-	_ZTV13NmDataManager @ 267 NONAME
-	_ZTV16NmFolderMetaData @ 268 NONAME
-	_ZTV17NmFolderListModel @ 269 NONAME
-	_ZTV17NmMailboxMetaData @ 270 NONAME
-	_ZTV18NmBaseClientPlugin @ 271 NONAME
-	_ZTV18NmMailboxListModel @ 272 NONAME
-	_ZTV18NmMessageListModel @ 273 NONAME
-	_ZTV19NmDataPluginFactory @ 274 NONAME
-	_ZTV22NmMessageListModelItem @ 275 NONAME
-	_ZTV25NmAddAttachmentsOperation @ 276 NONAME
-	_ZThn8_N18NmBaseClientPlugin10getActionsERK15NmActionRequestR5QListIP8NmActionE @ 277 NONAME
-	_ZThn8_N18NmBaseClientPluginD0Ev @ 278 NONAME
-	_ZThn8_N18NmBaseClientPluginD1Ev @ 279 NONAME
-	_ZN10NmUiEngine22sendOperationCompletedEv @ 280 NONAME
-	_ZN18NmBaseClientPlugin14openAttachmentEv @ 281 NONAME
-	_ZN18NmBaseClientPlugin16removeAttachmentEv @ 282 NONAME
-	_ZN10NmUiEngine18operationCompletedERK26NmOperationCompletionEvent @ 283 NONAME
-	_ZN10NmUiEngine20handleSyncStateEventE11NmSyncStateRK26NmOperationCompletionEvent @ 284 NONAME
+	_ZN10NmUiEngine10matchFoundERK4NmId @ 1 NONAME
+	_ZN10NmUiEngine11checkOutboxERK4NmId @ 2 NONAME
+	_ZN10NmUiEngine11mailboxByIdERK4NmId @ 3 NONAME
+	_ZN10NmUiEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 4 NONAME
+	_ZN10NmUiEngine11qt_metacastEPKc @ 5 NONAME
+	_ZN10NmUiEngine11saveMessageERK9NmMessage @ 6 NONAME
+	_ZN10NmUiEngine11sendMessageEP9NmMessageRK5QListIP11NmOperationE @ 7 NONAME
+	_ZN10NmUiEngine12cancelSearchERK4NmId @ 8 NONAME
+	_ZN10NmUiEngine12fetchMessageERK4NmIdS2_S2_ @ 9 NONAME
+	_ZN10NmUiEngine12setEnvelopesERK4NmIdS2_20NmEnvelopePropertiesRK5QListIPK17NmMessageEnvelopeE @ 10 NONAME
+	_ZN10NmUiEngine13removeMessageERK4NmIdS2_S2_ @ 11 NONAME
+	_ZN10NmUiEngine14addAttachmentsERK9NmMessageRK5QListI7QStringE @ 12 NONAME
+	_ZN10NmUiEngine14deleteMessagesERK4NmIdS2_RK5QListIS0_E @ 13 NONAME
+	_ZN10NmUiEngine14mailboxDeletedERK4NmId @ 14 NONAME
+	_ZN10NmUiEngine14messageDeletedERK4NmIdS2_S2_ @ 15 NONAME
+	_ZN10NmUiEngine14refreshMailboxERK4NmId @ 16 NONAME
+	_ZN10NmUiEngine14searchCompleteEv @ 17 NONAME
+	_ZN10NmUiEngine14syncStateEventE11NmSyncStateRK4NmId @ 18 NONAME
+	_ZN10NmUiEngine15connectionEventE14NmConnectStateRK4NmId @ 19 NONAME
+	_ZN10NmUiEngine15connectionStateERK4NmId @ 20 NONAME
+	_ZN10NmUiEngine15mReferenceCountE @ 21 NONAME DATA 4
+	_ZN10NmUiEngine15messagePartFileERK4NmIdS2_S2_S2_ @ 22 NONAME
+	_ZN10NmUiEngine15releaseInstanceERPS_ @ 23 NONAME
+	_ZN10NmUiEngine16createNewMessageERK4NmId @ 24 NONAME
+	_ZN10NmUiEngine16fetchMessagePartERK4NmIdS2_S2_S2_ @ 25 NONAME
+	_ZN10NmUiEngine16mailboxListModelEv @ 26 NONAME
+	_ZN10NmUiEngine16messageListModelERK4NmIdS2_ @ 27 NONAME
+	_ZN10NmUiEngine16removeAttachmentERK9NmMessageRK4NmId @ 28 NONAME
+	_ZN10NmUiEngine16standardFolderIdERK4NmId12NmFolderType @ 29 NONAME
+	_ZN10NmUiEngine16staticMetaObjectE @ 30 NONAME DATA 16
+	_ZN10NmUiEngine18createReplyMessageERK4NmIdS2_b @ 31 NONAME
+	_ZN10NmUiEngine18handleMailboxEventE14NmMailboxEventRK5QListI4NmIdE @ 32 NONAME
+	_ZN10NmUiEngine18handleMessageEventE14NmMessageEventRK4NmIdRK5QListIS1_ES3_ @ 33 NONAME
+	_ZN10NmUiEngine18operationCompletedERK26NmOperationCompletionEvent @ 34 NONAME
+	_ZN10NmUiEngine19getStaticMetaObjectEv @ 35 NONAME
+	_ZN10NmUiEngine20contentToMessagePartERK4NmIdS2_S2_R13NmMessagePart @ 36 NONAME
+	_ZN10NmUiEngine20createForwardMessageERK4NmIdS2_ @ 37 NONAME
+	_ZN10NmUiEngine20handleSyncStateEventE11NmSyncStateRK26NmOperationCompletionEvent @ 38 NONAME
+	_ZN10NmUiEngine22messageSearchListModelEP18QAbstractItemModel @ 39 NONAME
+	_ZN10NmUiEngine22sendOperationCompletedEv @ 40 NONAME
+	_ZN10NmUiEngine23refreshMailboxListModelEv @ 41 NONAME
+	_ZN10NmUiEngine28handleCompletedSendOperationEv @ 42 NONAME
+	_ZN10NmUiEngine6searchERK4NmIdRK11QStringList @ 43 NONAME
+	_ZN10NmUiEngine7messageERK4NmIdS2_S2_ @ 44 NONAME
+	_ZN10NmUiEngine8goOnlineERK4NmId @ 45 NONAME
+	_ZN10NmUiEngine8instanceEv @ 46 NONAME
+	_ZN10NmUiEngine9goOfflineERK4NmId @ 47 NONAME
+	_ZN10NmUiEngine9mInstanceE @ 48 NONAME DATA 4
+	_ZN10NmUiEngine9syncStateERK4NmId @ 49 NONAME
+	_ZN10NmUiEngineC1Ev @ 50 NONAME
+	_ZN10NmUiEngineC2Ev @ 51 NONAME
+	_ZN10NmUiEngineD0Ev @ 52 NONAME
+	_ZN10NmUiEngineD1Ev @ 53 NONAME
+	_ZN10NmUiEngineD2Ev @ 54 NONAME
+	_ZN11NmOperation11qt_metacallEN11QMetaObject4CallEiPPv @ 55 NONAME
+	_ZN11NmOperation11qt_metacastEPKc @ 56 NONAME
+	_ZN11NmOperation15cancelOperationEv @ 57 NONAME
+	_ZN11NmOperation15deleteOperationEv @ 58 NONAME
+	_ZN11NmOperation16staticMetaObjectE @ 59 NONAME DATA 16
+	_ZN11NmOperation17completeOperationEi @ 60 NONAME
+	_ZN11NmOperation17doCancelOperationEv @ 61 NONAME
+	_ZN11NmOperation17runAsyncOperationEv @ 62 NONAME
+	_ZN11NmOperation18operationCancelledEv @ 63 NONAME
+	_ZN11NmOperation18operationCompletedEi @ 64 NONAME
+	_ZN11NmOperation19doCompleteOperationEv @ 65 NONAME
+	_ZN11NmOperation19getStaticMetaObjectEv @ 66 NONAME
+	_ZN11NmOperation23addPreliminaryOperationEPS_ @ 67 NONAME
+	_ZN11NmOperation23updateOperationProgressEi @ 68 NONAME
+	_ZN11NmOperation24operationProgressChangedEi @ 69 NONAME
+	_ZN11NmOperation25doUpdateOperationProgressEv @ 70 NONAME
+	_ZN11NmOperation34handlePreliminaryOperationFinishedEv @ 71 NONAME
+	_ZN11NmOperationC2Ev @ 72 NONAME
+	_ZN11NmOperationD0Ev @ 73 NONAME
+	_ZN11NmOperationD1Ev @ 74 NONAME
+	_ZN11NmOperationD2Ev @ 75 NONAME
+	_ZN13NmDataManager10folderByIdERK4NmIdS2_ @ 76 NONAME
+	_ZN13NmDataManager11listFoldersE4NmIdR5QListIP8NmFolderE @ 77 NONAME
+	_ZN13NmDataManager11mailboxByIdERK4NmId @ 78 NONAME
+	_ZN13NmDataManager11qt_metacallEN11QMetaObject4CallEiPPv @ 79 NONAME
+	_ZN13NmDataManager11qt_metacastEPKc @ 80 NONAME
+	_ZN13NmDataManager12envelopeByIdERK4NmIdS2_S2_ @ 81 NONAME
+	_ZN13NmDataManager12listMessagesERK4NmIdS2_R5QListIP17NmMessageEnvelopeE @ 82 NONAME
+	_ZN13NmDataManager13listMailboxesER5QListIP9NmMailboxE @ 83 NONAME
+	_ZN13NmDataManager14listMailboxIdsER5QListI4NmIdE @ 84 NONAME
+	_ZN13NmDataManager16staticMetaObjectE @ 85 NONAME DATA 16
+	_ZN13NmDataManager19getStandardFolderIdERK4NmId12NmFolderType @ 86 NONAME
+	_ZN13NmDataManager19getStaticMetaObjectEv @ 87 NONAME
+	_ZN13NmDataManager20contentToMessagePartERK4NmIdS2_S2_R13NmMessagePart @ 88 NONAME
+	_ZN13NmDataManager6folderERK4NmIdS2_ @ 89 NONAME
+	_ZN13NmDataManager7mailboxERK4NmId @ 90 NONAME
+	_ZN13NmDataManager7messageERK4NmIdS2_S2_ @ 91 NONAME
+	_ZN13NmDataManagerC1Ev @ 92 NONAME
+	_ZN13NmDataManagerC2Ev @ 93 NONAME
+	_ZN13NmDataManagerD0Ev @ 94 NONAME
+	_ZN13NmDataManagerD1Ev @ 95 NONAME
+	_ZN13NmDataManagerD2Ev @ 96 NONAME
+	_ZN16NmFolderMetaData5setIdERK4NmId @ 97 NONAME
+	_ZN16NmFolderMetaData7setNameERK7QString @ 98 NONAME
+	_ZN16NmFolderMetaDataC1Ev @ 99 NONAME
+	_ZN16NmFolderMetaDataC2Ev @ 100 NONAME
+	_ZN16NmFolderMetaDataD0Ev @ 101 NONAME
+	_ZN16NmFolderMetaDataD1Ev @ 102 NONAME
+	_ZN16NmFolderMetaDataD2Ev @ 103 NONAME
+	_ZN17NmFolderListModel7refreshER5QListIP8NmFolderE @ 104 NONAME
+	_ZN17NmFolderListModelC1ER13NmDataManagerP7QObject @ 105 NONAME
+	_ZN17NmFolderListModelC2ER13NmDataManagerP7QObject @ 106 NONAME
+	_ZN17NmFolderListModelD0Ev @ 107 NONAME
+	_ZN17NmFolderListModelD1Ev @ 108 NONAME
+	_ZN17NmFolderListModelD2Ev @ 109 NONAME
+	_ZN17NmMailboxMetaData5setIdERK4NmId @ 110 NONAME
+	_ZN17NmMailboxMetaData7setNameERK7QString @ 111 NONAME
+	_ZN17NmMailboxMetaData9setIconIdERK4NmId @ 112 NONAME
+	_ZN17NmMailboxMetaDataC1Ev @ 113 NONAME
+	_ZN17NmMailboxMetaDataC2Ev @ 114 NONAME
+	_ZN17NmMailboxMetaDataD0Ev @ 115 NONAME
+	_ZN17NmMailboxMetaDataD1Ev @ 116 NONAME
+	_ZN17NmMailboxMetaDataD2Ev @ 117 NONAME
+	_ZN18NmBaseClientPlugin10getActionsERK15NmActionRequestR5QListIP8NmActionE @ 118 NONAME
+	_ZN18NmBaseClientPlugin10markAsReadEv @ 119 NONAME
+	_ZN18NmBaseClientPlugin11forwardMailEv @ 120 NONAME
+	_ZN18NmBaseClientPlugin11openMessageEv @ 121 NONAME
+	_ZN18NmBaseClientPlugin11qt_metacallEN11QMetaObject4CallEiPPv @ 122 NONAME
+	_ZN18NmBaseClientPlugin11qt_metacastEPKc @ 123 NONAME
+	_ZN18NmBaseClientPlugin12markAsUnreadEv @ 124 NONAME
+	_ZN18NmBaseClientPlugin12replyAllMailEv @ 125 NONAME
+	_ZN18NmBaseClientPlugin13createNewMailEv @ 126 NONAME
+	_ZN18NmBaseClientPlugin13deleteMessageEv @ 127 NONAME
+	_ZN18NmBaseClientPlugin13handleRequestE23NmActionResponseCommandRK15NmActionRequest @ 128 NONAME
+	_ZN18NmBaseClientPlugin14openAttachmentEv @ 129 NONAME
+	_ZN18NmBaseClientPlugin14setPriorityLowEv @ 130 NONAME
+	_ZN18NmBaseClientPlugin15setPriorityHighEv @ 131 NONAME
+	_ZN18NmBaseClientPlugin16removeAttachmentEv @ 132 NONAME
+	_ZN18NmBaseClientPlugin16staticMetaObjectE @ 133 NONAME DATA 16
+	_ZN18NmBaseClientPlugin17setPriorityNormalEv @ 134 NONAME
+	_ZN18NmBaseClientPlugin18mailboxListChangedERK4NmIdN10NmSettings16MailboxEventTypeE @ 135 NONAME
+	_ZN18NmBaseClientPlugin19getStaticMetaObjectEv @ 136 NONAME
+	_ZN18NmBaseClientPlugin22mailboxPropertyChangedERK4NmId8QVariantS3_ @ 137 NONAME
+	_ZN18NmBaseClientPlugin22updateEnvelopePropertyE20NmEnvelopeProperties @ 138 NONAME
+	_ZN18NmBaseClientPlugin24createEditorViewCommandsERK15NmActionRequestR5QListIP8NmActionE @ 139 NONAME
+	_ZN18NmBaseClientPlugin24createViewerViewCommandsERK15NmActionRequestR5QListIP8NmActionE @ 140 NONAME
+	_ZN18NmBaseClientPlugin25createMessageListCommandsERK15NmActionRequestR5QListIP8NmActionE @ 141 NONAME
+	_ZN18NmBaseClientPlugin26createNewMailViewerToolBarEv @ 142 NONAME
+	_ZN18NmBaseClientPlugin27deleteMessageFromViewerViewEv @ 143 NONAME
+	_ZN18NmBaseClientPlugin6attachEv @ 144 NONAME
+	_ZN18NmBaseClientPlugin6searchEv @ 145 NONAME
+	_ZN18NmBaseClientPlugin7refreshEv @ 146 NONAME
+	_ZN18NmBaseClientPlugin8goOnlineERK4NmId @ 147 NONAME
+	_ZN18NmBaseClientPlugin8sendMailEv @ 148 NONAME
+	_ZN18NmBaseClientPlugin8settingsEv @ 149 NONAME
+	_ZN18NmBaseClientPlugin9goOfflineERK4NmId @ 150 NONAME
+	_ZN18NmBaseClientPlugin9replyMailEv @ 151 NONAME
+	_ZN18NmBaseClientPluginC2Ev @ 152 NONAME
+	_ZN18NmBaseClientPluginD0Ev @ 153 NONAME
+	_ZN18NmBaseClientPluginD1Ev @ 154 NONAME
+	_ZN18NmBaseClientPluginD2Ev @ 155 NONAME
+	_ZN18NmMailboxListModel11qt_metacallEN11QMetaObject4CallEiPPv @ 156 NONAME
+	_ZN18NmMailboxListModel11qt_metacastEPKc @ 157 NONAME
+	_ZN18NmMailboxListModel16refreshModelItemERK4NmIdb @ 158 NONAME
+	_ZN18NmMailboxListModel16staticMetaObjectE @ 159 NONAME DATA 16
+	_ZN18NmMailboxListModel17createMailboxItemEPK9NmMailbox @ 160 NONAME
+	_ZN18NmMailboxListModel18handleMailboxEventE14NmMailboxEventRK5QListI4NmIdE @ 161 NONAME
+	_ZN18NmMailboxListModel19getStaticMetaObjectEv @ 162 NONAME
+	_ZN18NmMailboxListModel7refreshER5QListIP9NmMailboxE @ 163 NONAME
+	_ZN18NmMailboxListModelC1ER13NmDataManagerP7QObject @ 164 NONAME
+	_ZN18NmMailboxListModelC2ER13NmDataManagerP7QObject @ 165 NONAME
+	_ZN18NmMailboxListModelD0Ev @ 166 NONAME
+	_ZN18NmMailboxListModelD1Ev @ 167 NONAME
+	_ZN18NmMailboxListModelD2Ev @ 168 NONAME
+	_ZN18NmMessageListModel10removeItemEiR22NmMessageListModelItem @ 169 NONAME
+	_ZN18NmMessageListModel11qt_metacallEN11QMetaObject4CallEiPPv @ 170 NONAME
+	_ZN18NmMessageListModel11qt_metacastEPKc @ 171 NONAME
+	_ZN18NmMessageListModel11setDividersEb @ 172 NONAME
+	_ZN18NmMessageListModel11setNewParamEP14NmUiStartParam @ 173 NONAME
+	_ZN18NmMessageListModel13itemFromModelERK4NmId @ 174 NONAME
+	_ZN18NmMessageListModel14dividersActiveEv @ 175 NONAME
+	_ZN18NmMessageListModel14updateEnvelopeE20NmEnvelopePropertiesRK4NmId @ 176 NONAME
+	_ZN18NmMessageListModel16currentMailboxIdEv @ 177 NONAME
+	_ZN18NmMessageListModel16staticMetaObjectE @ 178 NONAME DATA 16
+	_ZN18NmMessageListModel17createMessageItemEP17NmMessageEnvelope @ 179 NONAME
+	_ZN18NmMessageListModel18handleMessageEventE14NmMessageEventRK4NmIdRK5QListIS1_E @ 180 NONAME
+	_ZN18NmMessageListModel19getStaticMetaObjectEv @ 181 NONAME
+	_ZN18NmMessageListModel21dividerInsertionIndexEi @ 182 NONAME
+	_ZN18NmMessageListModel21setEnvelopePropertiesE20NmEnvelopePropertiesRK5QListI4NmIdE @ 183 NONAME
+	_ZN18NmMessageListModel21updateMessageEnvelopeERK4NmIdS2_S2_ @ 184 NONAME
+	_ZN18NmMessageListModel22createTitleDividerItemEP17NmMessageEnvelope @ 185 NONAME
+	_ZN18NmMessageListModel22insertDividerIntoModelEP17NmMessageEnvelopei @ 186 NONAME
+	_ZN18NmMessageListModel22insertMessageIntoModelEP17NmMessageEnvelopeib @ 187 NONAME
+	_ZN18NmMessageListModel22removeMessageFromModelERK4NmId @ 188 NONAME
+	_ZN18NmMessageListModel25insertNewMessageIntoModelERK4NmIdS2_S2_ @ 189 NONAME
+	_ZN18NmMessageListModel7changedERK17NmMessageEnvelopeS2_ @ 190 NONAME
+	_ZN18NmMessageListModel7refreshE4NmIdS0_RK5QListIP17NmMessageEnvelopeE @ 191 NONAME
+	_ZN18NmMessageListModelC1ER13NmDataManagerP7QObject @ 192 NONAME
+	_ZN18NmMessageListModelC2ER13NmDataManagerP7QObject @ 193 NONAME
+	_ZN18NmMessageListModelD0Ev @ 194 NONAME
+	_ZN18NmMessageListModelD1Ev @ 195 NONAME
+	_ZN18NmMessageListModelD2Ev @ 196 NONAME
+	_ZN19NmDataPluginFactory10loadPluginERK4QDirRK7QString @ 197 NONAME
+	_ZN19NmDataPluginFactory12mPluginArrayE @ 198 NONAME DATA 4
+	_ZN19NmDataPluginFactory14pluginInstanceE4NmId @ 199 NONAME
+	_ZN19NmDataPluginFactory15mReferenceCountE @ 200 NONAME DATA 4
+	_ZN19NmDataPluginFactory15pluginInstancesEv @ 201 NONAME
+	_ZN19NmDataPluginFactory15releaseInstanceERPS_ @ 202 NONAME
+	_ZN19NmDataPluginFactory17interfaceInstanceE4NmId @ 203 NONAME
+	_ZN19NmDataPluginFactory17interfaceInstanceEP7QObject @ 204 NONAME
+	_ZN19NmDataPluginFactory18mPluginLoaderArrayE @ 205 NONAME DATA 4
+	_ZN19NmDataPluginFactory8instanceEv @ 206 NONAME
+	_ZN19NmDataPluginFactory9mInstanceE @ 207 NONAME DATA 4
+	_ZN19NmDataPluginFactoryC1Ev @ 208 NONAME
+	_ZN19NmDataPluginFactoryC2Ev @ 209 NONAME
+	_ZN19NmDataPluginFactoryD0Ev @ 210 NONAME
+	_ZN19NmDataPluginFactoryD1Ev @ 211 NONAME
+	_ZN19NmDataPluginFactoryD2Ev @ 212 NONAME
+	_ZN22NmCheckOutboxOperation11qt_metacallEN11QMetaObject4CallEiPPv @ 213 NONAME
+	_ZN22NmCheckOutboxOperation11qt_metacastEPKc @ 214 NONAME
+	_ZN22NmCheckOutboxOperation16staticMetaObjectE @ 215 NONAME DATA 16
+	_ZN22NmCheckOutboxOperation19getStaticMetaObjectEv @ 216 NONAME
+	_ZN22NmMessageListModelItem11envelopePtrEv @ 217 NONAME
+	_ZN22NmMessageListModelItem11setEnvelopeEP17NmMessageEnvelope @ 218 NONAME
+	_ZN22NmMessageListModelItem11setEnvelopeERK17NmMessageEnvelope @ 219 NONAME
+	_ZN22NmMessageListModelItem11setExpandedEb @ 220 NONAME
+	_ZN22NmMessageListModelItem11setItemTypeENS_17NmMessageItemTypeE @ 221 NONAME
+	_ZN22NmMessageListModelItem15setTitleDividerERK7QString @ 222 NONAME
+	_ZN22NmMessageListModelItem19callEmitDataChangedEv @ 223 NONAME
+	_ZN22NmMessageListModelItemC1Ev @ 224 NONAME
+	_ZN22NmMessageListModelItemC2Ev @ 225 NONAME
+	_ZN22NmMessageListModelItemD0Ev @ 226 NONAME
+	_ZN22NmMessageListModelItemD1Ev @ 227 NONAME
+	_ZN22NmMessageListModelItemD2Ev @ 228 NONAME
+	_ZN24NmMessageSearchListModel11qt_metacallEN11QMetaObject4CallEiPPv @ 229 NONAME
+	_ZN24NmMessageSearchListModel11qt_metacastEPKc @ 230 NONAME
+	_ZN24NmMessageSearchListModel15addSearchResultERK4NmId @ 231 NONAME
+	_ZN24NmMessageSearchListModel16staticMetaObjectE @ 232 NONAME DATA 16
+	_ZN24NmMessageSearchListModel18clearSearchResultsEv @ 233 NONAME
+	_ZN24NmMessageSearchListModel19getStaticMetaObjectEv @ 234 NONAME
+	_ZN24NmMessageSearchListModelC1EP7QObject @ 235 NONAME
+	_ZN24NmMessageSearchListModelC2EP7QObject @ 236 NONAME
+	_ZN24NmMessageSearchListModelD0Ev @ 237 NONAME
+	_ZN24NmMessageSearchListModelD1Ev @ 238 NONAME
+	_ZN24NmMessageSearchListModelD2Ev @ 239 NONAME
+	_ZN25NmAddAttachmentsOperation11qt_metacallEN11QMetaObject4CallEiPPv @ 240 NONAME
+	_ZN25NmAddAttachmentsOperation11qt_metacastEPKc @ 241 NONAME
+	_ZN25NmAddAttachmentsOperation16staticMetaObjectE @ 242 NONAME DATA 16
+	_ZN25NmAddAttachmentsOperation19getStaticMetaObjectEv @ 243 NONAME
+	_ZN25NmAddAttachmentsOperation21completeOperationPartERK7QStringRK4NmIdi @ 244 NONAME
+	_ZN25NmAddAttachmentsOperation22operationPartCompletedERK7QStringRK4NmIdi @ 245 NONAME
+	_ZN25NmAddAttachmentsOperationC2Ev @ 246 NONAME
+	_ZN25NmAddAttachmentsOperationD0Ev @ 247 NONAME
+	_ZN25NmAddAttachmentsOperationD1Ev @ 248 NONAME
+	_ZN25NmAddAttachmentsOperationD2Ev @ 249 NONAME
+	_ZN25NmStoreEnvelopesOperation11qt_metacallEN11QMetaObject4CallEiPPv @ 250 NONAME
+	_ZN25NmStoreEnvelopesOperation11qt_metacastEPKc @ 251 NONAME
+	_ZN25NmStoreEnvelopesOperation16staticMetaObjectE @ 252 NONAME DATA 16
+	_ZN25NmStoreEnvelopesOperation19getStaticMetaObjectEv @ 253 NONAME
+	_ZN26NmMessageCreationOperation11qt_metacallEN11QMetaObject4CallEiPPv @ 254 NONAME
+	_ZN26NmMessageCreationOperation11qt_metacastEPKc @ 255 NONAME
+	_ZN26NmMessageCreationOperation16staticMetaObjectE @ 256 NONAME DATA 16
+	_ZN26NmMessageCreationOperation19getStaticMetaObjectEv @ 257 NONAME
+	_ZN7NmIcons7getIconENS_4IconE @ 258 NONAME
+	_ZN7NmIcons9freeIconsEv @ 259 NONAME
+	_ZNK10NmUiEngine10metaObjectEv @ 260 NONAME
+	_ZNK10NmUiEngine16isSendingMessageEv @ 261 NONAME
+	_ZNK10NmUiEngine16messageBeingSentEv @ 262 NONAME
+	_ZNK11NmOperation10metaObjectEv @ 263 NONAME
+	_ZNK11NmOperation9isRunningEv @ 264 NONAME
+	_ZNK13NmDataManager10metaObjectEv @ 265 NONAME
+	_ZNK16NmFolderMetaData2idEv @ 266 NONAME
+	_ZNK16NmFolderMetaData4nameEv @ 267 NONAME
+	_ZNK17NmFolderListModel11columnCountERK11QModelIndex @ 268 NONAME
+	_ZNK17NmFolderListModel4dataERK11QModelIndexi @ 269 NONAME
+	_ZNK17NmFolderListModel6parentERK11QModelIndex @ 270 NONAME
+	_ZNK17NmFolderListModel8rowCountERK11QModelIndex @ 271 NONAME
+	_ZNK17NmMailboxMetaData2idEv @ 272 NONAME
+	_ZNK17NmMailboxMetaData4nameEv @ 273 NONAME
+	_ZNK17NmMailboxMetaData6IconIdEv @ 274 NONAME
+	_ZNK18NmBaseClientPlugin10metaObjectEv @ 275 NONAME
+	_ZNK18NmMailboxListModel10metaObjectEv @ 276 NONAME
+	_ZNK18NmMailboxListModel4dataERK11QModelIndexi @ 277 NONAME
+	_ZNK18NmMessageListModel10metaObjectEv @ 278 NONAME
+	_ZNK18NmMessageListModel17getInsertionIndexERK17NmMessageEnvelope @ 279 NONAME
+	_ZNK18NmMessageListModel30messagesBelongUnderSameDividerEPK17NmMessageEnvelopeS2_ @ 280 NONAME
+	_ZNK18NmMessageListModel4dataERK11QModelIndexi @ 281 NONAME
+	_ZNK22NmCheckOutboxOperation10metaObjectEv @ 282 NONAME
+	_ZNK22NmMessageListModelItem12titleDividerEv @ 283 NONAME
+	_ZNK22NmMessageListModelItem8envelopeEv @ 284 NONAME
+	_ZNK22NmMessageListModelItem8expandedEv @ 285 NONAME
+	_ZNK22NmMessageListModelItem8itemTypeEv @ 286 NONAME
+	_ZNK24NmMessageSearchListModel10metaObjectEv @ 287 NONAME
+	_ZNK24NmMessageSearchListModel16filterAcceptsRowEiRK11QModelIndex @ 288 NONAME
+	_ZNK24NmMessageSearchListModel4dataERK11QModelIndexi @ 289 NONAME
+	_ZNK25NmAddAttachmentsOperation10metaObjectEv @ 290 NONAME
+	_ZNK25NmStoreEnvelopesOperation10metaObjectEv @ 291 NONAME
+	_ZNK26NmMessageCreationOperation10metaObjectEv @ 292 NONAME
+	_ZTI10NmUiEngine @ 293 NONAME
+	_ZTI11NmOperation @ 294 NONAME
+	_ZTI13NmDataManager @ 295 NONAME
+	_ZTI16NmFolderMetaData @ 296 NONAME
+	_ZTI17NmFolderListModel @ 297 NONAME
+	_ZTI17NmMailboxMetaData @ 298 NONAME
+	_ZTI18NmBaseClientPlugin @ 299 NONAME
+	_ZTI18NmMailboxListModel @ 300 NONAME
+	_ZTI18NmMessageListModel @ 301 NONAME
+	_ZTI19NmDataPluginFactory @ 302 NONAME
+	_ZTI22NmCheckOutboxOperation @ 303 NONAME
+	_ZTI22NmMessageListModelItem @ 304 NONAME
+	_ZTI24NmMessageSearchListModel @ 305 NONAME
+	_ZTI25NmAddAttachmentsOperation @ 306 NONAME
+	_ZTI25NmStoreEnvelopesOperation @ 307 NONAME
+	_ZTI26NmMessageCreationOperation @ 308 NONAME
+	_ZTV10NmUiEngine @ 309 NONAME
+	_ZTV11NmOperation @ 310 NONAME
+	_ZTV13NmDataManager @ 311 NONAME
+	_ZTV16NmFolderMetaData @ 312 NONAME
+	_ZTV17NmFolderListModel @ 313 NONAME
+	_ZTV17NmMailboxMetaData @ 314 NONAME
+	_ZTV18NmBaseClientPlugin @ 315 NONAME
+	_ZTV18NmMailboxListModel @ 316 NONAME
+	_ZTV18NmMessageListModel @ 317 NONAME
+	_ZTV19NmDataPluginFactory @ 318 NONAME
+	_ZTV22NmCheckOutboxOperation @ 319 NONAME
+	_ZTV22NmMessageListModelItem @ 320 NONAME
+	_ZTV24NmMessageSearchListModel @ 321 NONAME
+	_ZTV25NmAddAttachmentsOperation @ 322 NONAME
+	_ZTV25NmStoreEnvelopesOperation @ 323 NONAME
+	_ZTV26NmMessageCreationOperation @ 324 NONAME
+	_ZThn8_N18NmBaseClientPlugin10getActionsERK15NmActionRequestR5QListIP8NmActionE @ 325 NONAME
+	_ZThn8_N18NmBaseClientPluginD0Ev @ 326 NONAME
+	_ZThn8_N18NmBaseClientPluginD1Ev @ 327 NONAME
+	_ZN10NmUiEngine14folderTypeByIdE4NmIdS0_ @ 328 NONAME
+	_ZN24NmMessageSearchListModel14refreshContentEv @ 329 NONAME
+	_ZNK24NmMessageSearchListModel17searchResultCountEv @ 330 NONAME
+	_ZN10NmUiEngine18handleConnectEventE14NmConnectStateRK4NmIdi @ 331 NONAME
 
--- a/emailuis/nmailuiengine/inc/nmaddattachmentsoperation.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiengine/inc/nmaddattachmentsoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -26,8 +26,7 @@
 {
     Q_OBJECT
 public:
-    NmAddAttachmentsOperation(QObject *parent = 0);
-    virtual ~NmAddAttachmentsOperation();
+    NmAddAttachmentsOperation();
     
 signals:
     // The observer of the asynchronous operation can connect to this signal.
@@ -35,6 +34,9 @@
     
 public slots:
     void completeOperationPart(const QString &fileName, const NmId &msgPartId, int result);
+
+protected:
+    virtual ~NmAddAttachmentsOperation();
 };
 
 #endif /* NMADDATTACHMENTSOPERATION_H_ */
--- a/emailuis/nmailuiengine/inc/nmbaseclientplugin.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiengine/inc/nmbaseclientplugin.h	Fri May 14 15:41:10 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -28,13 +28,10 @@
 #include "nmsettingscommon.h"
 
 class NmUiEngine;
-class NmSettingsViewLauncher;
+
 
-/*!
- \class NmBaseClientPlugin
- \brief
- */
-class NMUIENGINE_EXPORT NmBaseClientPlugin : public QObject, public NmUiExtensionInterface
+class NMUIENGINE_EXPORT NmBaseClientPlugin : public QObject,
+                                             public NmUiExtensionInterface
 {
     Q_OBJECT
     Q_INTERFACES(NmUiExtensionInterface)
@@ -65,6 +62,7 @@
     void attach();
     void removeAttachment();
     void openAttachment();
+    void search();
 
 private slots:
     void mailboxListChanged(const NmId &mailboxId, NmSettings::MailboxEventType type);
@@ -82,13 +80,14 @@
     void handleRequest(NmActionResponseCommand command, const NmActionRequest &request);
     void updateEnvelopeProperty(NmEnvelopeProperties property);
 
+protected:
+    NmActionRequest mMenuRequest;
+    NmUiEngine *mUiEngine; // Singleton instance
+            
 private:
-    NmActionRequest mMenuRequest;
     NmActionRequest mEditorToolBarRequest;
     NmActionRequest mViewerToolBarRequest;
     NmActionRequest mViewerViewRequest;
-    NmUiEngine *mUiEngine; // Singleton instance
-    NmSettingsViewLauncher *mSettingsViewLauncher; // owned
 };
 
 #endif /* NMBASECLIENTPLUGIN_H_ */
--- a/emailuis/nmailuiengine/inc/nmcheckoutboxoperation.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiengine/inc/nmcheckoutboxoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -20,13 +20,17 @@
 
 #include "nmoperation.h"
 
-class NmMessage;
 class NmId;
 
-class NmCheckOutboxOperation: public NmOperation
+class NMUIENGINE_EXPORT NmCheckOutboxOperation: public NmOperation
 {
+    Q_OBJECT
 public:
+    NmCheckOutboxOperation(){};
     virtual bool getMessageId(NmId &messageId) const = 0;
+
+protected:
+    virtual ~NmCheckOutboxOperation(){};
 };
 
 #endif /* NMCHECKOUTBOXOPERATION_H_ */
--- a/emailuis/nmailuiengine/inc/nmdatamanager.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiengine/inc/nmdatamanager.h	Fri May 14 15:41:10 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-10 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -20,7 +20,6 @@
 
 #include "nmuienginedef.h"
 #include "nmcommon.h"
-#include "nmdatapluginfactory.h"
 
 class NmMailbox;
 class NmMessage;
@@ -29,7 +28,7 @@
 class NmMailboxMetaData;
 class NmFolderMetaData;
 class NmMessageEnvelope;
-
+class NmDataPluginFactory;
 
 
 class NMUIENGINE_EXPORT NmDataManager: public QObject
--- a/emailuis/nmailuiengine/inc/nmdataplugininterface.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiengine/inc/nmdataplugininterface.h	Fri May 14 15:41:10 2010 +0300
@@ -19,12 +19,11 @@
 #define NMDATAPLUGININTERFACE_H_
 
 #include <QList>
-#ifdef Q_OS_SYMBIAN
+#include <QPointer>
 #include <xqsharablefile.h>
-#endif
+
 #include "nmcommon.h"
 
-
 class NmMailbox;
 class NmMessage;
 class NmMessagePart;
@@ -70,9 +69,9 @@
         NmMessage *&message) = 0;
 		
     virtual int getFolderById(
-            const NmId& mailboxId, 
-            const NmId& folderId, 
-            NmFolder*& folder ) = 0;
+        const NmId& mailboxId, 
+        const NmId& folderId, 
+        NmFolder*& folder ) = 0;
     
     virtual int listFolders(
         const NmId &mailboxId,
@@ -83,29 +82,34 @@
         const NmId &folderId,
         QList<NmMessageEnvelope*> &messageEnvelopeList) = 0;  
     
-virtual int listMessages(
+    virtual int listMessages(
         const NmId &mailboxId,
         const NmId &folderId,
         QList<NmMessageEnvelope*> &messageEnvelopeList, 
 		const int maxAmountOfEnvelopes ) = 0;
     
-    virtual NmOperation *fetchMessage( 
+    virtual int listMessages(
+        const NmId &mailboxId,
+        const NmId &folderId,
+        QList<NmMessage*> &messageList, 
+        const int maxAmountOfMessages = NmMaxItemsInMessageList) = 0;
+    
+    virtual QPointer<NmOperation> fetchMessage( 
         const NmId &mailboxId, 
         const NmId &folderId,
         const NmId &messageId ) = 0;
     
-    
-    virtual NmOperation *fetchMessagePart( 
+    virtual QPointer<NmOperation> fetchMessagePart( 
         const NmId &mailboxId,
         const NmId &folderId,
         const NmId &messageId,
         const NmId &messagePartId) = 0;
     
     virtual XQSharableFile messagePartFile(
-            const NmId &mailboxId,
-            const NmId &folderId,
-            const NmId &messageId,
-            const NmId &messagePartId) = 0;
+        const NmId &mailboxId,
+        const NmId &folderId,
+        const NmId &messageId,
+        const NmId &messagePartId) = 0;
     
     virtual NmId getStandardFolderId(
         const NmId &mailbox,
@@ -128,50 +132,55 @@
         const NmId &folderId,
         const QList<NmId> &messageIdList) = 0;
 
-    virtual NmStoreEnvelopesOperation *storeEnvelopes(
+    virtual QPointer<NmStoreEnvelopesOperation> storeEnvelopes(
         const NmId &mailboxId,
         const NmId &folderId,
         const QList<const NmMessageEnvelope*> &envelopeList) = 0;
 
-    virtual NmMessageCreationOperation *createNewMessage(const NmId &mailboxId) = 0;
+    virtual QPointer<NmMessageCreationOperation> createNewMessage(const NmId &mailboxId) = 0;
 
-    virtual NmMessageCreationOperation *createForwardMessage(
+    virtual QPointer<NmMessageCreationOperation> createForwardMessage(
         const NmId &mailboxId,
         const NmId &originalMessageId) = 0;
 
-    virtual NmMessageCreationOperation *createReplyMessage(
+    virtual QPointer<NmMessageCreationOperation> createReplyMessage(
         const NmId &mailboxId,
         const NmId &originalMessageId,
         const bool replyAll) = 0;
 
     virtual int saveMessage(const NmMessage &message) = 0;
 
-    virtual NmOperation *saveMessageWithSubparts(const NmMessage &message) = 0;
+    virtual QPointer<NmOperation> saveMessageWithSubparts(const NmMessage &message) = 0;
 
     virtual int removeMessage(
-                const NmId& mailboxId,
-                const NmId& folderId,
-                const NmId& messageId) = 0;
+        const NmId& mailboxId,
+        const NmId& folderId,
+        const NmId& messageId) = 0;
 
     virtual void subscribeMailboxEvents(const NmId& mailboxId) = 0;
     
     virtual void unsubscribeMailboxEvents(const NmId& mailboxId) = 0;
 
-    virtual NmMessageSendingOperation *sendMessage(NmMessage *message) = 0;
+    virtual QPointer<NmMessageSendingOperation> sendMessage(NmMessage *message) = 0;
     
-    virtual NmAddAttachmentsOperation *addAttachments(
-            const NmMessage &message,
-            const QList<QString> &fileList) = 0;
+    virtual QPointer<NmAddAttachmentsOperation> addAttachments(
+        const NmMessage &message,
+        const QList<QString> &fileList) = 0;
     
-    virtual NmOperation *removeAttachment(
-            const NmMessage &message,
-            const NmId &attachmentPartId) = 0;
+    virtual QPointer<NmOperation> removeAttachment(
+        const NmMessage &message,
+        const NmId &attachmentPartId) = 0;
 
-    virtual NmCheckOutboxOperation *checkOutbox(const NmId &mailboxId) = 0;
+    virtual QPointer<NmCheckOutboxOperation> checkOutbox(const NmId &mailboxId) = 0;
     
     virtual NmSyncState syncState(const NmId& mailboxId) const = 0;
     
     virtual NmConnectState connectionState(const NmId& mailboxId) const = 0;
+
+    virtual int search(const NmId &mailboxId,
+        const QStringList &searchStrings) = 0;
+
+    virtual int cancelSearch(const NmId &mailboxId) = 0;
 };
 
 Q_DECLARE_INTERFACE(NmDataPluginInterface, "sf.app.commonmail.emailuis.nmailuiengine.NmDataPluginInterface/1.0")
--- a/emailuis/nmailuiengine/inc/nmmessagecreationoperation.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiengine/inc/nmmessagecreationoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -23,11 +23,16 @@
 class NmMessage;
 class NmId;
 
-class NmMessageCreationOperation: public NmOperation
+class NMUIENGINE_EXPORT NmMessageCreationOperation: public NmOperation
 {
+    Q_OBJECT
 public:
+    NmMessageCreationOperation(){};
     virtual NmMessage *getMessage() = 0;
     virtual NmId getMessageId() = 0;
+    
+protected:
+    virtual ~NmMessageCreationOperation(){};
 };
 
 #endif /* NMMESSAGECREATIONOPERATION_H_ */
--- a/emailuis/nmailuiengine/inc/nmmessagelistmodel.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiengine/inc/nmmessagelistmodel.h	Fri May 14 15:41:10 2010 +0300
@@ -90,7 +90,6 @@
 
 signals:
     void setNewParam(NmUiStartParam *startParam);
-    void removeMessage(const NmId &messageId);
     
 private:
     NmDataManager &mDataManager;         // not owned
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailuiengine/inc/nmmessagesearchlistmodel.h	Fri May 14 15:41:10 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:
+*
+*/
+
+#ifndef NMMESSAGESEARCHLISTMODEL_H_
+#define NMMESSAGESEARCHLISTMODEL_H_
+
+#include <QSortFilterProxyModel>
+#include <QVector>
+
+#include "nmuienginedef.h" // For NMUIENGINE_EXPORT
+#include "nmcommon.h"
+
+
+class NMUIENGINE_EXPORT NmMessageSearchListModel : public QSortFilterProxyModel
+{
+    Q_OBJECT
+
+public: // Construction and destruction
+
+    NmMessageSearchListModel(QObject *parent = 0);
+
+    ~NmMessageSearchListModel();
+
+
+public:
+
+    void clearSearchResults();
+
+    int searchResultCount() const;
+
+
+public: // From QSortFilterProxyModel
+
+    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+
+
+protected: // From QSortFilterProxyModel
+
+    bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
+
+
+public slots:
+
+    bool addSearchResult(const NmId &messageId);
+
+    void refreshContent();
+
+
+private: // Data
+
+    QVector<NmId> mSearchResults;
+};
+
+#endif /* NMMESSAGESEARCHLISTMODEL_H_ */
+
+// End of file.
--- a/emailuis/nmailuiengine/inc/nmmessagesendingoperation.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiengine/inc/nmmessagesendingoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -22,10 +22,14 @@
 
 class NmMessage;
 
-class NmMessageSendingOperation : public NmOperation
+class NMUIENGINE_EXPORT NmMessageSendingOperation : public NmOperation
 {
 public:
+    NmMessageSendingOperation(){};
     virtual const NmMessage *getMessage() const = 0;
+    
+protected:
+    virtual ~NmMessageSendingOperation(){};
 };
 
 #endif /* NMMESSAGESENDINGOPERATION_H_ */
--- a/emailuis/nmailuiengine/inc/nmoperation.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiengine/inc/nmoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -21,16 +21,13 @@
 #include <QObject>
 #include "nmuienginedef.h"
 
-class QTimer;
 
 class NMUIENGINE_EXPORT NmOperation: public QObject
 {
     Q_OBJECT
 
 public:
-
-    NmOperation(QObject *parent = 0);
-    virtual ~NmOperation();    
+    NmOperation();  
     bool isRunning() const;
     void addPreliminaryOperation(NmOperation *operation);
     
@@ -48,14 +45,16 @@
     virtual void runAsyncOperation();
     virtual void handlePreliminaryOperationFinished();
 
+private slots:
+    void deleteOperation();
+    
 protected:
+    virtual ~NmOperation();  
     virtual void doCompleteOperation();
     virtual void doCancelOperation();
     virtual void doUpdateOperationProgress();
     virtual void doRunAsyncOperation() = 0;
 
-protected:
-    QTimer *mTimer;
     
 private:
     int mProgress;
--- a/emailuis/nmailuiengine/inc/nmstoreenvelopesoperation.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiengine/inc/nmstoreenvelopesoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -20,11 +20,14 @@
 
 #include "nmoperation.h"
 
-class NmStoreEnvelopesOperation: public NmOperation
+class NMUIENGINE_EXPORT NmStoreEnvelopesOperation: public NmOperation
 {
+    Q_OBJECT
 public:
     NmStoreEnvelopesOperation(){};
-    ~NmStoreEnvelopesOperation(){};
+    
+protected:
+    virtual ~NmStoreEnvelopesOperation(){};
 };
 
 #endif //#ifndef NMSTOREENVELOPESOPERATION_H_
--- a/emailuis/nmailuiengine/inc/nmuiengine.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiengine/inc/nmuiengine.h	Fri May 14 15:41:10 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -20,43 +20,42 @@
 
 #include <QObject>
 #include <QList>
-#ifdef Q_OS_SYMBIAN
 #include <xqsharablefile.h>
-#endif
 
 #include "nmcommon.h"
 #include "nmuienginedef.h"
 
+class QAbstractItemModel;
 class NmMailboxListModel;
 class NmMessageListModel;
+class NmMessageSearchListModel;
 class NmDataManager;
 class NmDataPluginFactory;
 class NmMailboxMetaData;
 class NmMessage;
 class NmMessagePart;
 class NmMessageEnvelope;
+class NmOperation;
 class NmMessageCreationOperation;
 class NmStoreEnvelopesOperation;
 class NmAddAttachmentsOperation;
-class NmOperation;
 class NmCheckOutboxOperation;
 class NmMessageSendingOperation;
 
+
 class NMUIENGINE_EXPORT NmUiEngine: public QObject
 {
     Q_OBJECT
+
 public:
 
     static NmUiEngine *instance();
     static void releaseInstance(NmUiEngine *&instance);
 
     NmMailboxListModel &mailboxListModel();
-
     void refreshMailboxListModel();
-
     NmMessageListModel &messageListModel(const NmId &mailboxId, const NmId &folderId);
-
-    void releaseMessageListModel(const NmId &mailboxId);
+    NmMessageSearchListModel &messageSearchListModel(QAbstractItemModel *sourceModel);
 
     NmId standardFolderId(const NmId &mailboxId, NmFolderType folderType);
 
@@ -65,22 +64,22 @@
         const NmId &folderId,
         const NmId &messageId);
 
-    NmOperation *fetchMessage(
+    QPointer<NmOperation> fetchMessage(
         const NmId &mailboxId,
         const NmId &folderId,
         const NmId &messageId);
 
-    NmOperation *fetchMessagePart( 
+    QPointer<NmOperation> fetchMessagePart( 
         const NmId &mailboxId,
         const NmId &folderId,
         const NmId &messageId,
         const NmId &messagePartId);
     
     XQSharableFile messagePartFile(
-            const NmId &mailboxId,
-            const NmId &folderId,
-            const NmId &messageId,
-            const NmId &messagePartId);
+       const NmId &mailboxId,
+       const NmId &folderId,
+       const NmId &messageId,
+       const NmId &messagePartId);
     
     NmMailboxMetaData *mailboxById(const NmId &mailboxId);
 
@@ -99,23 +98,22 @@
         const NmId &folderId,
         const QList<NmId> &messageIdList);
 
-    NmStoreEnvelopesOperation *setEnvelopes(
-            const NmId &mailboxId,
-            const NmId &folderId,
-            NmEnvelopeProperties property,
-            const QList<const NmMessageEnvelope*> &envelopeList);
+    QPointer<NmStoreEnvelopesOperation> setEnvelopes(
+        const NmId &mailboxId,
+        const NmId &folderId,
+        NmEnvelopeProperties property,
+        const QList<const NmMessageEnvelope*> &envelopeList);
 
-
-    NmMessageCreationOperation *createNewMessage(const NmId &mailboxId);
+    QPointer<NmMessageCreationOperation> createNewMessage(const NmId &mailboxId);
 
-    NmMessageCreationOperation *createForwardMessage(
-            const NmId &mailboxId,
-            const NmId &originalMessageId);
+    QPointer<NmMessageCreationOperation> createForwardMessage(
+        const NmId &mailboxId,
+        const NmId &originalMessageId);
 
-    NmMessageCreationOperation *createReplyMessage(
-            const NmId &mailboxId,
-            const NmId &originalMessageId,
-            bool replyAll);
+    QPointer<NmMessageCreationOperation> createReplyMessage(
+        const NmId &mailboxId,
+        const NmId &originalMessageId,
+        bool replyAll);
 
     int saveMessage(const NmMessage &message);
 
@@ -129,44 +127,64 @@
                 const NmId &mailboxId,
                 const NmId &folderId,
                 const NmId &messageId);
-
-    void storeOperation(NmOperation *op);
-
-    void sendMessage(NmMessage *message, const QList<NmOperation *> &preliminaryOperations);
+    
+    void sendMessage(NmMessage *message, const QList<NmOperation*> &preliminaryOperations);
 
     bool isSendingMessage() const;
 
     const NmMessage *messageBeingSent() const;
-    NmAddAttachmentsOperation *addAttachments(
-            const NmMessage &message,
-            const QList<QString> &fileList);
+    
+    QPointer<NmAddAttachmentsOperation> addAttachments(
+        const NmMessage &message,
+        const QList<QString> &fileList);
     
-    NmOperation *removeAttachment(const NmMessage &message, const NmId &attachmentPartId);
+    QPointer<NmOperation> removeAttachment(
+        const NmMessage &message, 
+        const NmId &attachmentPartId);
 
-    NmCheckOutboxOperation *checkOutbox(const NmId &mailboxId);
+    QPointer<NmCheckOutboxOperation> checkOutbox(const NmId &mailboxId);
     
     NmSyncState syncState(const NmId& mailboxId);
     NmConnectState connectionState(const NmId& mailboxId);
 
+    int search(const NmId &mailboxId,
+               const QStringList &searchStrings);
+
+    int cancelSearch(const NmId &mailboxId);
+    
+    NmFolderType folderTypeById(NmId mailboxId, NmId folderId);
+
 public slots:
-    void handleCompletedOperation();
     void handleCompletedSendOperation();
     void handleSyncStateEvent(NmSyncState syncState, const NmOperationCompletionEvent &event);
-    void cleanupSendOperation();
+    void handleConnectEvent(NmConnectState connectState, const NmId &mailboxId, const int errorCode);
+
+private slots:
+    void handleMessageEvent(
+            NmMessageEvent event,
+            const NmId &folderId,
+            const QList<NmId> &messageIds, 
+            const NmId& mailboxId);
     
+    void handleMailboxEvent(NmMailboxEvent event,
+                            const QList<NmId> &mailboxIds);
+
+
 signals:
     void syncStateEvent(NmSyncState, const NmId &);
     void connectionEvent(NmConnectState, const NmId &);
     void operationCompleted(const NmOperationCompletionEvent &event);
     void sendOperationCompleted();
-
+    void messageDeleted(const NmId &mailboxId, const NmId &folderId, const NmId &messageId);
+    void mailboxDeleted(const NmId &mailboxId);
+    void matchFound(const NmId &);
+    void searchComplete();
+    
 private:
-
     NmUiEngine();
     virtual ~NmUiEngine();
 
 private:
-
     static NmUiEngine *mInstance;
     static int	mReferenceCount;
 
@@ -174,9 +192,8 @@
     NmDataManager *mDataManager;                // Owned
     NmMailboxListModel *mMailboxListModel;      // Owned
     NmMessageListModel *mMessageListModel;      // Owned
-    QList<NmOperation*> mOperations;			// Owned
-
-    NmMessageSendingOperation *mSendOperation;  // Owned
+    NmMessageSearchListModel *mMessageSearchListModel; // Owned
+    QPointer<NmMessageSendingOperation> mSendOperation;  // Not owned
 };
 
 
--- a/emailuis/nmailuiengine/inc/nmuiengineheaders.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiengine/inc/nmuiengineheaders.h	Fri May 14 15:41:10 2010 +0300
@@ -25,9 +25,12 @@
 #include <QApplication>
 #include <QLocale>
 #include <QTimer>
-#ifdef Q_OS_SYMBIAN
+#include <QPointer>
+
 #include <xqsharablefile.h>
-#endif
+
+// Symbian
+#include <e32base.h>
 
 // Orbit
 #include <hbapplication.h>
@@ -35,7 +38,7 @@
 #include <hbnamespace.h>
 #include <hbicon.h>
 #include <hbiconanimationmanager.h>
-
+#include <hbmenu.h>
 
 // nmailuiengine
 #include "nmuienginedef.h"
@@ -44,21 +47,28 @@
 #include "nmmailboxlistmodel.h"
 #include "nmfolderlistmodel.h"
 #include "nmmessagelistmodel.h"
+#include "nmmessagesearchlistmodel.h"
 #include "nmdatapluginfactory.h"
 #include "nmdataplugininterface.h"
 #include "nmmailboxlistmodelitem.h"
 #include "nmmessagelistmodelitem.h"
 #include "nmmailboxmetadata.h"
 #include "nmfoldermetadata.h"
-#include "nmactionrequest.h"
-#include "nmactionresponse.h"
-#include "nmactionobserver.h"
-#include "nmaction.h"
 #include "nmicons.h"
 #include "nmbaseclientplugin.h"
 #include "nmoperation.h"
 #include "nmstoreenvelopesoperation.h"
 #include "nmmessagesendingoperation.h"
+#include "nmaddattachmentsoperation.h"
+#include "nmmessagecreationoperation.h"
+#include "nmcheckoutboxoperation.h"
+#include "nmmessagecreationoperation.h"
+
+// nmailui
+#include "nmactionrequest.h"
+#include "nmactionresponse.h"
+#include "nmactionobserver.h"
+#include "nmaction.h"
 
 // nmailbase
 #include "nmcommon.h"
@@ -67,17 +77,6 @@
 #include "nmmessagepart.h"
 #include "nmmessageenvelope.h"
 #include "nmfolder.h"
-#include "nmoperation.h"
-
-// nmsettings
-#include "nmsettingsviewlauncher.h"
-#include "nmsettingscommon.h"
-
-#ifdef Q_OS_SYMBIAN
-#include <e32base.h>
-#else
-#define NM_WINS_ENV
-#endif
 
 
 #endif /* NMUIENGINEHEADERS_H_ */
--- a/emailuis/nmailuiengine/nmailuiengine.pro	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiengine/nmailuiengine.pro	Fri May 14 15:41:10 2010 +0300
@@ -8,48 +8,60 @@
 # Nokia Corporation - initial contribution.
 # Contributors:
 # Description:
+
 CONFIG += debug
 CONFIG += hb
+
 TEMPLATE = lib
+
 TARGET = nmailuiengine
+
 QT += core
+
 DEFINES += BUILD_UIENGINE_DLL
 
+MOC_DIR = ./moc
+
 INCLUDEPATH += ./inc \
-  ../../inc \
-  ../nmsettingui/inc
+               ../../inc \
+
 HEADERS += inc/nmmessagecreationoperation.h \
-    inc/nmuiengine.h \
-    inc/nmdatamanager.h \
-    inc/nmmailboxlistmodel.h \
-    inc/nmmailboxlistmodelitem.h \
-    inc/nmmailboxmetadata.h \
-    inc/nmdatapluginfactory.h \
-    inc/nmfolderlistmodel.h \
-    inc/nmfoldermetadata.h \
-    inc/nmmessagelistmodelitem.h \
-    inc/nmmessagelistmodel.h \
-    inc/nmuienginedef.h \
-    inc/nmdataplugininterface.h \
-    inc/nmicons.h \
-    inc/nmbaseclientplugin.h \
-    inc/nmoperation.h \
-    inc/nmaddattachmentsoperation.h \
-    inc/nmmessagesendingoperation.h
+           inc/nmuiengine.h \
+           inc/nmdatamanager.h \
+           inc/nmmailboxlistmodel.h \
+           inc/nmmailboxlistmodelitem.h \
+           inc/nmmailboxmetadata.h \
+           inc/nmdatapluginfactory.h \
+           inc/nmfolderlistmodel.h \
+           inc/nmfoldermetadata.h \
+           inc/nmmessagelistmodelitem.h \
+           inc/nmmessagelistmodel.h \
+           inc/nmmessagesearchlistmodel.h \
+           inc/nmuienginedef.h \
+           inc/nmdataplugininterface.h \
+           inc/nmicons.h \
+           inc/nmbaseclientplugin.h \
+           inc/nmoperation.h \
+           inc/nmaddattachmentsoperation.h \
+           inc/nmmessagesendingoperation.h \
+           inc/nmcheckoutboxoperation.h \
+           inc/nmstoreenvelopesoperation.h
+
 SOURCES += src/nmuiengine.cpp \
-    src/nmdatamanager.cpp \
-    src/nmmailboxlistmodel.cpp \
-    src/nmmailboxlistmodelitem.cpp \
-    src/nmmailboxmetadata.cpp \
-    src/nmfolderlistmodel.cpp \
-    src/nmfoldermetadata.cpp \
-    src/nmmessagelistmodelitem.cpp \
-    src/nmmessagelistmodel.cpp \
-    src/nmdatapluginfactory.cpp \
-    src/nmicons.cpp \
-    src/nmbaseclientplugin.cpp \
-    src/nmaddattachmentoperation.cpp \
-    src/nmoperation.cpp
+           src/nmdatamanager.cpp \
+           src/nmmailboxlistmodel.cpp \
+           src/nmmailboxlistmodelitem.cpp \
+           src/nmmailboxmetadata.cpp \
+           src/nmfolderlistmodel.cpp \
+           src/nmfoldermetadata.cpp \
+           src/nmmessagelistmodelitem.cpp \
+           src/nmmessagelistmodel.cpp \
+           src/nmmessagesearchlistmodel.cpp \
+           src/nmdatapluginfactory.cpp \
+           src/nmicons.cpp \
+           src/nmbaseclientplugin.cpp \
+           src/nmaddattachmentoperation.cpp \
+           src/nmoperation.cpp
     
 LIBS += -leuser
 LIBS += -llibc
@@ -60,10 +72,9 @@
     TARGET.UID2 = 0x1000008D
     TARGET.UID3 = 0x20026763
     LIBS += -lnmailbase \
-        -lnmsettingui \
         -lxqserviceutil 
-	
-	defBlock = \      
+
+    defBlock = \      
       "$${LITERAL_HASH}if defined(MARM)" \
       "DEFFILE  eabi/nmailuiengine.def" \
       "$${LITERAL_HASH}else" \
@@ -72,11 +83,7 @@
     
     MMP_RULES += defBlock
 }
-win32 { 
-    INCLUDEPATH += ../../emailservices/nmailbase
-    DESTDIR = ../../bin
-    LIBS += -L../../bin \
-        -lnmailbase
-}
 
-RESOURCES += nmailuiengine.qrc
\ No newline at end of file
+RESOURCES += nmailuiengine.qrc
+
+# End of file.
--- a/emailuis/nmailuiengine/src/nmaddattachmentoperation.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiengine/src/nmaddattachmentoperation.cpp	Fri May 14 15:41:10 2010 +0300
@@ -15,13 +15,12 @@
 *
 */
 
-#include "nmaddattachmentsoperation.h"
+#include "nmuiengineheaders.h"
 
 /*!
   Constructor
   */
-NmAddAttachmentsOperation::NmAddAttachmentsOperation(QObject *parent)
-:NmOperation(parent)
+NmAddAttachmentsOperation::NmAddAttachmentsOperation()
 {
 }
 
--- a/emailuis/nmailuiengine/src/nmbaseclientplugin.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiengine/src/nmbaseclientplugin.cpp	Fri May 14 15:41:10 2010 +0300
@@ -33,6 +33,7 @@
  \li reply email
  \li reply all email
  \li forward email
+ \li search emails
 
  The plugin provides a list of supported UI services as NmAction objects. Actions are connected to
  different public slots and when they are triggered plugin will handle action by itself directly to
@@ -98,11 +99,10 @@
 */
 NmBaseClientPlugin::NmBaseClientPlugin()
 :mMenuRequest(NULL),
+mUiEngine(NULL),
 mEditorToolBarRequest(NULL),
 mViewerToolBarRequest(NULL),
-mViewerViewRequest(NULL),
-mUiEngine(NULL),
-mSettingsViewLauncher(NULL)
+mViewerViewRequest(NULL)
 {
     NMLOG("NmBaseClientPlugin::NmBaseClientPlugin()-->");
     mUiEngine = NmUiEngine::instance();
@@ -117,7 +117,6 @@
     NMLOG("NmBaseClientPlugin::~NmBaseClientPlugin()-->");
     NmUiEngine::releaseInstance(mUiEngine);
     mUiEngine = NULL;
-    delete mSettingsViewLauncher;
     NMLOG("<--NmBaseClientPlugin::~NmBaseClientPlugin()");
 }
 
@@ -241,38 +240,6 @@
 */
 void NmBaseClientPlugin::settings()
 {
-    NMLOG("NmBaseClientPlugin::settings()-->");
-
- #ifndef NM_WINS_ENV
-    const NmId &id = mMenuRequest.mailboxId();
-    NmMailboxMetaData *mailbox = mUiEngine->mailboxById(id);
-
-    if (mailbox) {
-        if (!mSettingsViewLauncher) {
-            mSettingsViewLauncher = new NmSettingsViewLauncher();
-
-            connect(mSettingsViewLauncher,
-                SIGNAL(mailboxListChanged(const NmId &, NmSettings::MailboxEventType)),
-                this, SLOT(mailboxListChanged(const NmId &, NmSettings::MailboxEventType)));
-
-            connect(mSettingsViewLauncher,
-                SIGNAL(mailboxPropertyChanged(const NmId &, QVariant, QVariant)),
-                this, SLOT(mailboxPropertyChanged(const NmId &, QVariant, QVariant)));
-
-            connect(mSettingsViewLauncher,
-            	SIGNAL(goOnline(const NmId &)),
-                this, SLOT(goOnline(const NmId &)));
-
-            connect(mSettingsViewLauncher,
-            	SIGNAL(goOffline(const NmId &)),
-                this, SLOT(goOffline(const NmId &)));
-        }
-
-        mSettingsViewLauncher->launchSettingsView(id, mailbox->name());
-    }
- #endif
-
-    NMLOG("<--NmBaseClientPlugin::settings()");
 }
 
 /*!
@@ -362,6 +329,15 @@
 }
 
 /*!
+    Requests the handling of the search action.
+    This public slot gets called when the search button in a toolbar is clicked.
+*/
+void NmBaseClientPlugin::search()
+{
+    handleRequest(NmActionResponseCommandSearch, mViewerToolBarRequest);
+}
+
+/*!
     Private slot connected to settings view launcher.
 
     \param mailboxId Id of mailbox.
@@ -407,7 +383,7 @@
 */
 void NmBaseClientPlugin::goOnline(const NmId &mailboxId)
 {
-        mUiEngine->goOnline(mailboxId);
+		(void) mUiEngine->refreshMailbox(mailboxId);
 }
 /*!
     Private slot connected to settings view launcher.
@@ -450,6 +426,15 @@
         }
         case NmActionToolbar:
         {
+            // Create the search button.
+            NmAction *mailSearchAction = new NmAction(0);
+            mailSearchAction->setObjectName("baseclientplugin_mailsearchaction");
+            mailSearchAction->setText(hbTrId("txt_mail_list_search"));
+            mailSearchAction->setIcon(HbIcon("qtg_mono_search"));
+            connect(mailSearchAction, SIGNAL(triggered()), this, SLOT(search()));
+            actionList.append(mailSearchAction);
+
+            // Create new mail button.
             mViewerToolBarRequest = request;
             NmAction *createMailAction = new NmAction(0);
             createMailAction->setObjectName("baseclientplugin_createmailaction");
@@ -465,12 +450,19 @@
             if (request.contextDataType() == NmActionContextDataMessage){
                 mMenuRequest = request;
 
-                // Open message
-                NmAction* openAction = new NmAction(0);
-                openAction->setObjectName("baseclientplugin_openaction");
-                openAction->setText(hbTrId("txt_common_menu_open"));
-                connect(openAction, SIGNAL(triggered()), this, SLOT(openMessage()));
-                actionList.append(openAction);
+                NmFolderType folderType(NmFolderInbox);
+                if (mUiEngine){
+                    folderType = mUiEngine->folderTypeById(request.mailboxId(),request.folderId());                
+                }
+                
+                if (folderType!=NmFolderOutbox){
+                    // Open message
+                    NmAction* openAction = new NmAction(0);
+                    openAction->setObjectName("baseclientplugin_openaction");
+                    openAction->setText(hbTrId("txt_common_menu_open"));
+                    connect(openAction, SIGNAL(triggered()), this, SLOT(openMessage()));
+                    actionList.append(openAction);                
+                }                
 
                 // Delete message
                 NmAction* deleteAction = new NmAction(0);
@@ -479,35 +471,37 @@
                 connect(deleteAction, SIGNAL(triggered()), this, SLOT(deleteMessage()));
                 actionList.append(deleteAction);
 
-                NmMessageEnvelope *envelope =
-                    request.requestData().value<NmMessageEnvelope*>();
-
-                if (envelope){
-                    if (envelope->isRead()){
-                        NMLOG("nmailui: envelope is read");
-                        NmAction* unreadAction = new NmAction(0);
-                        unreadAction->setObjectName("baseclientplugin_unreadaction");
-                        unreadAction->setText(hbTrId("txt_mail_menu_mark_as_unread"));
-
-                        connect(unreadAction,
-                            SIGNAL(triggered()),
-                            this,
-                            SLOT(markAsUnread()));
-
-                        actionList.append(unreadAction);
-                    }
-                    else {
-                        NMLOG("nmailui: envelope is unread");
-                        NmAction* readAction = new NmAction(0);
-                        readAction->setObjectName("baseclientplugin_readaction");
-                        readAction->setText(hbTrId("txt_mail_menu_mark_as_read"));
-
-                        connect(readAction,
-                            SIGNAL(triggered()),
-                            this,
-                            SLOT(markAsRead()));
-
-                        actionList.append(readAction);
+                if (folderType!=NmFolderOutbox &&
+                    folderType!=NmFolderDrafts ){
+                    NmMessageEnvelope *envelope =
+                        request.requestData().value<NmMessageEnvelope*>();    
+                    if (envelope){
+                        if (envelope->isRead()){
+                            NMLOG("nmailui: envelope is read");
+                            NmAction* unreadAction = new NmAction(0);
+                            unreadAction->setObjectName("baseclientplugin_unreadaction");
+                            unreadAction->setText(hbTrId("txt_mail_menu_mark_as_unread"));
+    
+                            connect(unreadAction,
+                                SIGNAL(triggered()),
+                                this,
+                                SLOT(markAsUnread()));
+    
+                            actionList.append(unreadAction);
+                        }
+                        else {
+                            NMLOG("nmailui: envelope is unread");
+                            NmAction* readAction = new NmAction(0);
+                            readAction->setObjectName("baseclientplugin_readaction");
+                            readAction->setText(hbTrId("txt_mail_menu_mark_as_read"));
+    
+                            connect(readAction,
+                                SIGNAL(triggered()),
+                                this,
+                                SLOT(markAsRead()));
+    
+                            actionList.append(readAction);
+                        }
                     }
                 }
             }
@@ -655,6 +649,8 @@
             attachAction->setObjectName("baseclientplugin_attachaction");
             attachAction->setText(hbTrId("txt_mail_button_attach"));
             attachAction->setIcon(NmIcons::getIcon(NmIcons::NmIconAttach));
+            // Action only available when attachment can be added
+            attachAction->setAvailabilityCondition(NmAction::NmAttachable);
             // connect action/add toolbar extensions
             connect(attachAction, SIGNAL(triggered()), this, SLOT(attach()));
             actionList.append(attachAction);
@@ -708,7 +704,7 @@
             action->setText(hbTrId("txt_common_menu_open"));
             connect(action, SIGNAL(triggered()), this, SLOT(openAttachment()));
             actionList.append(action);
-            break;	
+            break;
         }
         case NmActionVKB:
         {
@@ -779,15 +775,11 @@
     if (envelope) {
         envelopeList.append(envelope);
 
-        NmStoreEnvelopesOperation* op =
+        QPointer<NmStoreEnvelopesOperation> op =
                 mUiEngine->setEnvelopes(mMenuRequest.mailboxId(),
                                         mMenuRequest.folderId(),
                                         property,
                                         envelopeList);
-
-        if (op) {
-            mUiEngine->storeOperation(op);
-        }
     }
     envelopeList.clear();
     NMLOG("<--NmBaseClientPlugin::updateEnvelopeProperty()");
--- a/emailuis/nmailuiengine/src/nmdatamanager.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiengine/src/nmdatamanager.cpp	Fri May 14 15:41:10 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-10 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"
@@ -16,6 +16,7 @@
 */
 
 #include "nmuiengineheaders.h"
+#include "nmdatapluginfactory.h"
 
 /*!
     \class NmDataManager
--- a/emailuis/nmailuiengine/src/nmmessagelistmodel.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiengine/src/nmmessagelistmodel.cpp	Fri May 14 15:41:10 2010 +0300
@@ -192,7 +192,6 @@
         } else {
             for (int a(0); a < messageIds.count(); a++) {
                 removeMessageFromModel(messageIds[a]);
-                emit removeMessage(messageIds[a]);
             }
         }
     }
@@ -413,7 +412,7 @@
         QModelIndex index = items[i]->index();
         NmMessageListModelItem *item = static_cast<NmMessageListModelItem*>(itemFromIndex(index));
         if (NmMessageListModelItem::NmMessageItemMessage == item->itemType()
-                && msgId == item->envelope().id()) {
+                && msgId == item->envelope().messageId()) {
             found = true;
             // dividers are not active, just remove message
             if (!mDividersActive) {
@@ -475,7 +474,7 @@
         NmMessageListModelItem *item =
             static_cast<NmMessageListModelItem*>(itemFromIndex(items[i]->index()));
         if (NmMessageListModelItem::NmMessageItemMessage == item->itemType()
-            && messageId == item->envelope().id()) {
+            && messageId == item->envelope().messageId()) {
             found = true;
             ret = item;
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailuiengine/src/nmmessagesearchlistmodel.cpp	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,173 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "nmuiengineheaders.h"
+
+/*!
+    \class NmMessageSearchListModel
+    \brief A proxy model used to filter out messages from the message list model
+           that are not amongst the search results.
+*/
+
+/*!
+    Class constructor.
+*/
+NmMessageSearchListModel::NmMessageSearchListModel(QObject *parent)
+: QSortFilterProxyModel(parent)
+{
+    // No implementation required.
+}
+
+
+/*!
+    Class destructor.
+*/
+NmMessageSearchListModel::~NmMessageSearchListModel()
+{
+    clearSearchResults();
+}
+
+
+/*!
+    Clears search results and removes the accepted source model items from this
+    proxy model.
+*/
+void NmMessageSearchListModel::clearSearchResults()
+{
+    mSearchResults.clear();
+    invalidateFilter();
+}
+
+
+/*!
+    Returns the number of search results i.e. IDs in the container.
+
+    \return The number of search results.
+*/
+int NmMessageSearchListModel::searchResultCount() const
+{
+    return mSearchResults.count();
+}
+
+
+/*!
+    From QSortFilterProxyModel.
+    Returns the data from the source model according to the given proxy index.
+
+    \param index The index of this proxy model.
+    \param role The item role.
+
+    \return The item data wrapped in a QVariant.
+*/
+QVariant NmMessageSearchListModel::data(const QModelIndex &index,
+                                        int role /* = Qt::DisplayRole */) const
+{
+    QVariant retVal;
+    QAbstractItemModel *model = sourceModel();
+
+    if (model) {
+        // Return the data from the source model by mapping the given index
+        // in respect to the source model.
+        QModelIndex sourceIndex = mapToSource(index);
+        retVal = model->data(sourceIndex, role);
+    }
+    else {
+        // Since no source model set, use the base class method implementation.
+        retVal = QSortFilterProxyModel::data(index, role);
+    }
+
+    return retVal;
+}
+
+
+/*!
+    From QSortFilterProxyModel.
+    Filters the items of the source model depending on the current search results.
+
+    \param source_row A source model row index.
+    \param source_parent The parent model index of the row.
+
+    \return True if the row should be accepted to the search list model, false
+            otherwise.
+*/
+bool NmMessageSearchListModel::filterAcceptsRow(int source_row,
+                                                const QModelIndex &source_parent) const
+{
+    bool accept(false);
+
+    // Get the source model.
+    NmMessageListModel *model = qobject_cast<NmMessageListModel*>(sourceModel());
+
+    if (model) {
+        // Extract the model item corresponding the given row and index.
+        QModelIndex listIndex = model->index(source_row, 0, source_parent);
+        QVariant qVariant = model->data(listIndex);
+        NmMessageListModelItem *item = qVariant.value<NmMessageListModelItem*>();
+
+        if (item) {
+            // Get the message ID from the item and compare it to the current
+            // search results.
+            const NmId itemId = item->envelope().messageId();
+
+            if (mSearchResults.contains(itemId)) {
+                // The message ID matches the search result => do accept the row.
+                accept = true;
+            }
+        }
+    }
+
+    return accept;
+}
+
+
+/*!
+    Adds the given message ID to the search results.
+
+    \param messageId The ID to add.
+
+    \return True if the given ID was added, false otherwise.
+*/
+bool NmMessageSearchListModel::addSearchResult(const NmId &messageId)
+{
+    bool resultAdded(false);
+
+    // Make sure not to add the same ID twice.
+    if (!mSearchResults.contains(messageId)) {
+        // Add the given ID to the results.
+        mSearchResults.append(messageId);
+        resultAdded = true;
+
+        // Invalidate the filter in order to update the model. This forces
+        // filterAcceptsRow() to be ran again for each row in the source model.
+        invalidateFilter();
+    }
+
+    return resultAdded;
+}
+
+
+/*!
+    Refreshes the content by forcing the model to re-process the source model
+    items using the current filter (search results).
+*/
+void NmMessageSearchListModel::refreshContent()
+{
+    invalidateFilter();
+}
+
+
+// End of file.
--- a/emailuis/nmailuiengine/src/nmoperation.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiengine/src/nmoperation.cpp	Fri May 14 15:41:10 2010 +0300
@@ -17,23 +17,15 @@
 
 #include "nmuiengineheaders.h"
 
-#include <QTimer>
-
 /*!
     \brief Constructor
     Constructor of NmOperation
-    \param parent Parent object.
  */
-NmOperation::NmOperation(QObject *parent)
-: QObject(parent),
-mProgress(0),
-mIsRunning(true)
+NmOperation::NmOperation()
+: mProgress(0),
+  mIsRunning(true)
 {
-    // operation is started immediately
-    mTimer = new QTimer(this); // QObject takes care of deleting
-    mTimer->setSingleShot(true);
-    connect(mTimer, SIGNAL(timeout()), this, SLOT(runAsyncOperation()));
-    mTimer->start(1);
+    QMetaObject::invokeMethod(this, "runAsyncOperation", Qt::QueuedConnection);
 }
 
 /*!
@@ -41,10 +33,12 @@
  */
 NmOperation::~NmOperation()
 {
-    // Delete items from the mPreliminaryOperations list.
-    qDeleteAll(mPreliminaryOperations.begin(), mPreliminaryOperations.end());
-    // Remove the items.
-    mPreliminaryOperations.clear();
+    while (!mPreliminaryOperations.isEmpty()) {
+        QPointer<NmOperation> operation = mPreliminaryOperations.takeLast();
+        if (operation && operation->isRunning()) {
+            operation->cancelOperation();
+        }
+    }
 }
 
 /*!
@@ -57,7 +51,6 @@
 
 /*!
     \brief Adds a "preliminary operation" which needs to end until this operation can start.
-    Ownership of the operation is transferred to this.
  */
 void NmOperation::addPreliminaryOperation(NmOperation *operation)
 {
@@ -78,10 +71,11 @@
  */
 void NmOperation::completeOperation(int result)
 {
+    mIsRunning = false;
     // Operation is completed, emit the signal
     doCompleteOperation();
     emit this->operationCompleted(result);
-    mIsRunning = false;
+    QMetaObject::invokeMethod(this, "deleteOperation", Qt::QueuedConnection);
 }
 
 /*!
@@ -91,11 +85,11 @@
  */
 void NmOperation::cancelOperation()
 {
+    mIsRunning = false;
     // Operation is canceled, emit the signal
-    mTimer->stop();
     this->doCancelOperation();
     emit this->operationCancelled();
-    mIsRunning = false;
+    QMetaObject::invokeMethod(this, "deleteOperation", Qt::QueuedConnection);
 }
 /*!
     \brief Slot, update progress
@@ -112,22 +106,23 @@
 /*!
     \brief Slot, run the operation if no preliminary operations are running.
     Calls the pure virtual doRunAsyncOperation() of the derived class if there are no preliminary
-    operations running.
+    operations running. Operation will be deleted after it has compeleted or cancelled and the control
+    returns to the event loop.
  */
 void NmOperation::runAsyncOperation()
 {
-    // cleanup the preliminary operations
     int count = mPreliminaryOperations.count();
+    int ready = 0;
+    // go through preliminary operations
     for (int i = 0; i < count; ++i) {
         if (!mPreliminaryOperations[i] || !mPreliminaryOperations[i]->isRunning()) {
-            delete mPreliminaryOperations.takeAt(i);
-            --i;
-            --count;
+            ready++;
         }
     }
-
-    if (mPreliminaryOperations.count() == 0) {
-        doRunAsyncOperation();
+    // when all preliminary operations are either completed or cancelled
+    // start this one
+    if (count == ready) {
+        this->doRunAsyncOperation();
     }
 }
 
@@ -138,8 +133,7 @@
  */
 void NmOperation::handlePreliminaryOperationFinished()
 {
-    mTimer->stop();
-    mTimer->start(1);
+    QMetaObject::invokeMethod(this, "runAsyncOperation", Qt::QueuedConnection);
 }
 
 /*!
@@ -173,4 +167,13 @@
 {
 }
 
+/*!
+    \brief Private slot for operation deleting
+    This is signalled when operation is completed or cancelled. 
+    Delete happens when the control returns to the event loop.
+ */
+void NmOperation::deleteOperation()
+{
+    this->deleteLater();   
+}
 
--- a/emailuis/nmailuiengine/src/nmuiengine.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiengine/src/nmuiengine.cpp	Fri May 14 15:41:10 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -31,12 +31,45 @@
     Constructor
 */
 NmUiEngine::NmUiEngine() 
-:mMailboxListModel(NULL),
-mMessageListModel(NULL),
-mSendOperation(NULL)
+: mMailboxListModel(NULL),
+  mMessageListModel(NULL),
+  mMessageSearchListModel(NULL),
+  mSendOperation(NULL)
 {
     mPluginFactory = NmDataPluginFactory::instance();
     mDataManager = new NmDataManager();
+    // Connect to the plugins to receive change notifications
+    QList<QObject*> *dataPlugins = mPluginFactory->pluginInstances();
+    for (int i(0); i < dataPlugins->count(); i++) {
+        QObject *plugin = (*dataPlugins)[i];
+        if (plugin) {
+            // connet mailbox events
+            QObject::connect(plugin, SIGNAL(mailboxEvent(NmMailboxEvent, const QList<NmId> &)),
+                 this, SLOT(handleMailboxEvent(NmMailboxEvent, const QList<NmId> &)),
+                 Qt::UniqueConnection);
+            // connect message events
+            QObject::connect(plugin, 
+                SIGNAL(messageEvent(NmMessageEvent, const NmId &, const QList<NmId> &, const NmId&)),
+                this, SLOT(handleMessageEvent(NmMessageEvent, const NmId &, const QList<NmId> &, const NmId &)),
+                Qt::UniqueConnection);
+            // connect connection events
+            QObject::connect(plugin,
+                SIGNAL(connectionEvent(NmConnectState, const NmId &, const int)),
+                this,
+                SLOT(handleConnectEvent(NmConnectState, const NmId &, const int)),
+                Qt::UniqueConnection);       
+            // do the subscriptions also
+            NmDataPluginInterface *pluginInterface = mPluginFactory->interfaceInstance(plugin);
+            if (pluginInterface) {
+                QList<NmId> mailboxIdList;
+                pluginInterface->listMailboxIds(mailboxIdList);
+                for (int j(0); j < mailboxIdList.count(); j++) {
+                    pluginInterface->subscribeMailboxEvents(mailboxIdList[j]);
+                }
+                mailboxIdList.clear();
+            }
+        }
+    }
 }
 
 
@@ -45,6 +78,11 @@
 */
 NmUiEngine::~NmUiEngine()
 {
+    if (mMessageSearchListModel) {
+        delete mMessageSearchListModel;
+        mMessageSearchListModel = NULL;
+    }
+
     if (mMessageListModel) {
         delete mMessageListModel;
         mMessageListModel = NULL;
@@ -53,14 +91,22 @@
         delete mMailboxListModel;
         mMailboxListModel = NULL;
     }
+    // do the unsubscriptions
+    QList<NmId> mailboxIdList;
+    mDataManager->listMailboxIds(mailboxIdList);
+    for (int i(0); i < mailboxIdList.count(); i++) {
+        NmId id = mailboxIdList[i];
+        NmDataPluginInterface *pluginInterface = mPluginFactory->interfaceInstance(id);
+        if (pluginInterface) {
+            pluginInterface->unsubscribeMailboxEvents(id);
+        }
+    }
+    mailboxIdList.clear();
     NmDataPluginFactory::releaseInstance(mPluginFactory);
     delete mDataManager;
-    
-    while (!mOperations.isEmpty()) {
-        delete mOperations.takeLast();
+    if (mSendOperation && mSendOperation->isRunning()) {
+        mSendOperation->cancelOperation();
     }
-    
-    delete mSendOperation;
 }
 
 /*!
@@ -160,19 +206,8 @@
         QObject::connect(
             plugin, SIGNAL(syncStateEvent(NmSyncState, const NmOperationCompletionEvent &)),
             this, SLOT(handleSyncStateEvent(NmSyncState, const NmOperationCompletionEvent &)),
-            Qt::UniqueConnection);
-        
-        QObject::connect(plugin,
-            SIGNAL(connectionEvent(NmConnectState, const NmId &)),
-            this,
-            SIGNAL(connectionEvent(NmConnectState, const NmId &)),
-            Qt::UniqueConnection);
-        
-        // Start to listen mailbox events
-        NmDataPluginInterface *pluginInterface = mPluginFactory->interfaceInstance(plugin);
-        if (pluginInterface) {
-            pluginInterface->subscribeMailboxEvents(mailboxId);
-        }
+            Qt::UniqueConnection);        
+        // no need for mailbox event subscription here, already done in constructor
     }
     QList<NmMessageEnvelope*> messageEnvelopeList;
     mDataManager->listMessages(mailboxId, folderId, messageEnvelopeList);
@@ -183,18 +218,27 @@
     return *mMessageListModel;
 }
 
+
 /*!
-    
+    Returns a reference of the message search list model. If the model does not
+    exist yet, one is constructed.
+
+    \param sourceModel The source model for the search list model.
+
+    \return The message search list model.
 */
-void NmUiEngine::releaseMessageListModel(const NmId &mailboxId)
+NmMessageSearchListModel &NmUiEngine::messageSearchListModel(
+    QAbstractItemModel *sourceModel)
 {
-    // Stop listening mailbox events
-    NmDataPluginInterface *pluginInterface = mPluginFactory->interfaceInstance(mailboxId);
-    if (pluginInterface) {
-        pluginInterface->unsubscribeMailboxEvents(mailboxId);
+    if (!mMessageSearchListModel) {
+        mMessageSearchListModel = new NmMessageSearchListModel();
     }
+
+    mMessageSearchListModel->setSourceModel(sourceModel);
+    return *mMessageSearchListModel;
 }
 
+
 /*!
     Get the identifier of the standard folder of a type \a folderType 
     from the mailbox \a mailboxId.
@@ -230,11 +274,12 @@
 /*!
 
 */
-NmOperation *NmUiEngine::fetchMessage( const NmId &mailboxId,
+QPointer<NmOperation> NmUiEngine::fetchMessage( const NmId &mailboxId,
     const NmId &folderId,
     const NmId &messageId )
 {
-    NmOperation *value(NULL);
+    NMLOG("NmUiEngine::fetchMessage() <---");
+    QPointer<NmOperation> value(NULL);
     NmDataPluginInterface *plugin =
         mPluginFactory->interfaceInstance(mailboxId);
     if (plugin) {
@@ -246,13 +291,14 @@
 /*!
 
 */
-NmOperation *NmUiEngine::fetchMessagePart(
+QPointer<NmOperation> NmUiEngine::fetchMessagePart(
     const NmId &mailboxId,
     const NmId &folderId,
     const NmId &messageId,
     const NmId &messagePartId)
 {
-    NmOperation *value(NULL);
+    NMLOG("NmUiEngine::fetchMessagePart() <---");
+    QPointer<NmOperation> value(NULL);
     NmDataPluginInterface *plugin =
         mPluginFactory->interfaceInstance(mailboxId);
     if (plugin) {
@@ -315,22 +361,21 @@
 
 /*!
     Sets envelope property given in argument.
-    Ownership of operation object is transferred to the caller.
+    Operation is automatically deleted after completion or cancelling.
 */
-
-NmStoreEnvelopesOperation *NmUiEngine::setEnvelopes(
+QPointer<NmStoreEnvelopesOperation> NmUiEngine::setEnvelopes(
         const NmId &mailboxId,
         const NmId &folderId,
         NmEnvelopeProperties property,
         const QList<const NmMessageEnvelope*> &envelopeList)
 {
     NMLOG("NmUiEngine::setEnvelopes() <---");
-    NmStoreEnvelopesOperation *operation(NULL);
+    QPointer<NmStoreEnvelopesOperation> operation(NULL);
     if (mMessageListModel && envelopeList.count()) {
         QList<NmId> messageIdList;
         
         for (int i(0); i < envelopeList.count(); i++){
-            messageIdList.append(envelopeList[i]->id());
+            messageIdList.append(envelopeList[i]->messageId());
         }
         mMessageListModel->setEnvelopeProperties(
                            property, messageIdList);
@@ -342,8 +387,7 @@
                     mailboxId, folderId, envelopeList);
         }
         messageIdList.clear();
-    }
-    
+    }  
     NMLOG("NmUiEngine::setEnvelopes() --->");
     return operation;
 }
@@ -374,11 +418,12 @@
 
 /*!
     Creates a new message (into Drafts-folder).
-    Ownership of operation object is transferred to the caller.
+    Operation is automatically deleted after completion or cancelling.
 */
-NmMessageCreationOperation *NmUiEngine::createNewMessage(const NmId &mailboxId)
+QPointer<NmMessageCreationOperation> NmUiEngine::createNewMessage(const NmId &mailboxId)
 {
-    NmMessageCreationOperation *value(NULL);
+    NMLOG("NmUiEngine::createNewMessage() <---");
+    QPointer<NmMessageCreationOperation> value(NULL);
     NmDataPluginInterface *plugin =
         mPluginFactory->interfaceInstance(mailboxId);
     if (plugin) {
@@ -389,13 +434,14 @@
 
 /*!
     Creates a new forward message (into Drafts-folder).
-    Ownership of operation object is transferred to the caller.
+    Operation is automatically deleted after completion or cancelling.
 */
-NmMessageCreationOperation *NmUiEngine::createForwardMessage(
+QPointer<NmMessageCreationOperation> NmUiEngine::createForwardMessage(
         const NmId &mailboxId,
         const NmId &originalMessageId)
 {
-    NmMessageCreationOperation *value(NULL);
+    NMLOG("NmUiEngine::createForwardMessage() <---");
+    QPointer<NmMessageCreationOperation> value(NULL);
     NmDataPluginInterface *plugin =
         mPluginFactory->interfaceInstance(mailboxId);
     if (plugin) {
@@ -406,14 +452,15 @@
 
 /*!
     Creates a new reply message (into Drafts-folder).
-    Ownership of operation object is transferred to the caller.
+    Operation is automatically deleted after completion or cancelling.
 */
-NmMessageCreationOperation *NmUiEngine::createReplyMessage(
+QPointer<NmMessageCreationOperation> NmUiEngine::createReplyMessage(
         const NmId &mailboxId,
         const NmId &originalMessageId,
         bool replyAll)
 {
-    NmMessageCreationOperation *value(NULL);
+    NMLOG("NmUiEngine::createReplyMessage() <---");
+    QPointer<NmMessageCreationOperation> value(NULL);
     NmDataPluginInterface *plugin =
         mPluginFactory->interfaceInstance(mailboxId);
     if (plugin) {
@@ -427,7 +474,7 @@
 */
 int NmUiEngine::saveMessage(const NmMessage &message)
 {
-    const NmId &mailboxId = message.mailboxId();
+    const NmId &mailboxId = message.envelope().mailboxId();
     int ret(NmNotFoundError);
     NmDataPluginInterface *plugin =
         mPluginFactory->interfaceInstance(mailboxId);
@@ -497,19 +544,6 @@
     return result;
 }
 
-/*!
-    Takes ownership of an operation and connects to 
-    it's completion signal
- */
-void NmUiEngine::storeOperation(NmOperation *op)
-{
-    mOperations.append(op);
-    connect(
-            op, 
-            SIGNAL(operationCompleted(int)), 
-            this, 
-            SLOT(handleCompletedOperation()));
-}
 
 /*!
     Sends the given message.
@@ -519,20 +553,21 @@
     //First trigger message storing
     if (message) {
         NmDataPluginInterface *plugin =
-            mPluginFactory->interfaceInstance(message->mailboxId());
+            mPluginFactory->interfaceInstance(message->envelope().mailboxId());
         
         if (plugin) {
             // to be on the safer side:
             // we shouldn't even be here if mSendOperation != NULL
-            delete mSendOperation;
-            mSendOperation = NULL;
+            if (mSendOperation && mSendOperation->isRunning()) {
+                mSendOperation->cancelOperation();
+            }
             // ownership of message changes
             mSendOperation = plugin->sendMessage(message);
             // don't put this to mOperations as we need to handle this
             // operation separately
             if (mSendOperation) {
-                foreach (NmOperation *op, preliminaryOperations) {
-                    // ownership is transferred
+                for (int i(0); i < preliminaryOperations.count(); i++ ) {
+                    QPointer<NmOperation> op = preliminaryOperations[i];
                     mSendOperation->addPreliminaryOperation(op);
                 }
                 
@@ -551,7 +586,7 @@
 bool NmUiEngine::isSendingMessage() const
 {
     int ret(false);
-    if (mSendOperation) {
+    if (mSendOperation && mSendOperation->isRunning()) {
         ret = true;
     }
     return ret;
@@ -573,58 +608,55 @@
 
 /*!
     Add file attachment into given message. Return the operation object for
-    observing/cancelling. Ownership of operation object is transferred to the caller.
+    observing/cancelling. Operation is automatically deleted after completion or cancelling.
  */
-NmAddAttachmentsOperation *NmUiEngine::addAttachments(
+QPointer<NmAddAttachmentsOperation> NmUiEngine::addAttachments(
     const NmMessage &message,
     const QList<QString> &fileList)
 {
+    NMLOG("NmUiEngine::addAttachments() <---");
     NmDataPluginInterface *plugin =
-        mPluginFactory->interfaceInstance(message.mailboxId());
+        mPluginFactory->interfaceInstance(message.envelope().mailboxId());
     
-    NmAddAttachmentsOperation *ret(NULL);
-    
+    QPointer<NmAddAttachmentsOperation> ret(NULL);    
     if (plugin) {
         ret = plugin->addAttachments(message, fileList);
     }
-
     return ret;
 }
 
 /*!
     Remove attached file from given message. Return the operation object for
-    observing/cancelling. Ownership of operation object is transferred to the caller.
+    observing/cancelling. Operation is automatically deleted after completion or cancelling.
  */
-NmOperation *NmUiEngine::removeAttachment(
+QPointer<NmOperation> NmUiEngine::removeAttachment(
     const NmMessage &message,
     const NmId &attachmentPartId)
 {
+    NMLOG("NmUiEngine::removeAttachments() <---");
     NmDataPluginInterface *plugin =
-        mPluginFactory->interfaceInstance(message.mailboxId());
+        mPluginFactory->interfaceInstance(message.envelope().mailboxId());
     
-    NmOperation *ret(NULL);
-    
+    QPointer<NmOperation> ret(NULL);   
     if (plugin) {
         ret = plugin->removeAttachment(message, attachmentPartId);
     }
-
     return ret;
 }
 
 /*!
-    Ownership of operation object is transferred to the caller.
+    Operation is automatically deleted after completion or cancelling.
  */
-NmCheckOutboxOperation *NmUiEngine::checkOutbox(const NmId &mailboxId)
+QPointer<NmCheckOutboxOperation> NmUiEngine::checkOutbox(const NmId &mailboxId)
 {
+    NMLOG("NmUiEngine::checkOutbox() <---");
     NmDataPluginInterface *plugin =
         mPluginFactory->interfaceInstance(mailboxId);
 
-    NmCheckOutboxOperation *ret(NULL);
-    
+    QPointer<NmCheckOutboxOperation> ret(NULL); 
     if (plugin) {
         ret = plugin->checkOutbox(mailboxId);
-    }
-    
+    }  
     return ret;
 }
 
@@ -658,47 +690,108 @@
     }
 }
 
+
 /*!
- * deletes completed operations
- * 
- */
-void NmUiEngine::handleCompletedOperation()
+    Starts the search.
+
+    \param mailboxId The ID of the mailbox to search from.
+    \param searchStrings The strings to search with.
+
+    \return A possible error code.
+*/
+int NmUiEngine::search(const NmId &mailboxId,
+                       const QStringList &searchStrings)
 {
-    NMLOG("NmUiEngine::handleCompletedOperation() <---");
-    int count = mOperations.count();
+    // Get the plugin instance.
+    QObject *pluginInstance = mPluginFactory->pluginInstance(mailboxId);
+
+    if (pluginInstance) {
+        // Make sure the required signals are connected.
+        connect(pluginInstance, SIGNAL(matchFound(const NmId &)),
+                this, SIGNAL(matchFound(const NmId &)), Qt::UniqueConnection);    
+        connect(pluginInstance, SIGNAL(matchFound(const NmId &)),
+                mMessageSearchListModel, SLOT(addSearchResult(const NmId &)),
+                Qt::UniqueConnection);    
+        connect(pluginInstance, SIGNAL(searchComplete()),
+                this, SIGNAL(searchComplete()), Qt::UniqueConnection);    
+    }
+
+    int retVal(NmNoError);
+
+    // Get the plugin interface.
+    NmDataPluginInterface *pluginInterface =
+        mPluginFactory->interfaceInstance(mailboxId);
+
+    if (pluginInterface) {
+        // Start the search.
+        retVal = pluginInterface->search(mailboxId, searchStrings);
+    }
     
-    QObject *sender = this->sender();
-    
-    for(int i(0); i < count; i++){
-        if (mOperations[i] == sender){
-            delete mOperations.takeAt(i);
-            }
-        }
-    NMLOG("NmUiEngine::handleCompletedOperation() --->");
+    return retVal;
+}
+
+
+/*!
+    Cancels the search operation if one is ongoing.
+
+    \param mailboxId The ID of the mailbox running the search.
+
+    \return A possible error code.
+*/
+int NmUiEngine::cancelSearch(const NmId &mailboxId)
+{
+    int retVal(NmNoError);
+
+    // Get the plugin interface.
+    NmDataPluginInterface *pluginInterface =
+        mPluginFactory->interfaceInstance(mailboxId);
+
+    if (pluginInterface) {
+        // Cancel the search.
+        retVal = pluginInterface->cancelSearch(mailboxId);
+    }  
+    return retVal;    
 }
-    
+
+/*!
+    Cancels the search operation if one is ongoing.
+
+    \param mailboxId The ID of the mailbox containing the folder
+
+    \param folderId The ID of the folder 
+
+    \return Folder type
+*/
+NmFolderType NmUiEngine::folderTypeById(NmId mailboxId, NmId folderId)
+{
+    NmFolderType folderType(NmFolderOther);
+    if (standardFolderId(mailboxId,NmFolderInbox)==folderId){
+        folderType=NmFolderInbox;
+    }
+    else if (standardFolderId(mailboxId,NmFolderOutbox)==folderId){
+        folderType=NmFolderOutbox; 
+    }
+    else if (standardFolderId(mailboxId,NmFolderDrafts)==folderId){
+        folderType=NmFolderDrafts;
+    }
+    else if (standardFolderId(mailboxId,NmFolderSent)==folderId){
+        folderType=NmFolderSent; 
+    }    
+    else if (standardFolderId(mailboxId,NmFolderDeleted)==folderId){
+        folderType=NmFolderDeleted;  
+    }    
+    return folderType;
+}
 /*!
     Handle completed send operation.
 */
 void NmUiEngine::handleCompletedSendOperation()
 {
-    // Let the callback method finish until cleaning the operation.
-    QTimer::singleShot(1, this, SLOT(cleanupSendOperation()));
+    NMLOG("NmUiEngine::handleCompletedSendOperation()");
     emit sendOperationCompleted();
 }
 
 /*!
-    Cleanup the send operation
-*/
-void NmUiEngine::cleanupSendOperation()
-{
-    delete mSendOperation;
-    mSendOperation = NULL;
-    // delete the sent messages from the store if necessary
-    // ...
-}
-
-/*!
     Handles synch operation related events
  */
 void NmUiEngine::handleSyncStateEvent(NmSyncState syncState, const NmOperationCompletionEvent &event)
@@ -714,4 +807,59 @@
     emit syncStateEvent(syncState, event.mMailboxId);
 }
 
+/*!
+    Emits signals based on message events coming from plugins. 
+    Currently only NmMessageDeleted is handled.
+*/
+void NmUiEngine::handleMessageEvent(NmMessageEvent event,
+                                    const NmId &folderId,
+                                    const QList<NmId> &messageIds, 
+                                    const NmId& mailboxId)
+{
+    switch (event) {
+        case NmMessageDeleted:
+        {
+            for (int i(0); i < messageIds.count(); i++) {
+                emit messageDeleted(mailboxId, folderId, messageIds[i]);
+            }
+           break; 
+        }
+        default:
+        break;
+    }
+}
 
+/*!
+    Emits signals based on mailbox events coming from plugins. 
+    Currently only NmMailboxDeleted is handled.
+*/
+void NmUiEngine::handleMailboxEvent(NmMailboxEvent event,
+                                    const QList<NmId> &mailboxIds)
+{
+    switch (event) {
+        case NmMailboxDeleted:
+        {
+            for (int i(0); i < mailboxIds.count(); i++) {
+                emit mailboxDeleted(mailboxIds[i]);
+            }
+           break; 
+        }
+        default:
+        break;
+    }
+}
+
+/*!
+    receives events when going online, and offline.
+*/
+void NmUiEngine::handleConnectEvent(NmConnectState connectState, const NmId &mailboxId, const int errorCode)
+{
+    // signal for connection state icon handling
+    emit connectionEvent(connectState, mailboxId);
+
+    // in case going offline w/ error, emit signal to UI
+    if ( connectState == Disconnected && errorCode!= NmNoError ) {
+        NmOperationCompletionEvent event={NoOp, errorCode, mailboxId, 0, 0}; 
+        emit operationCompleted(event);
+    }
+}
--- a/emailuis/nmailuiwidgets/bwins/nmailuiwidgetsu.def	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiwidgets/bwins/nmailuiwidgetsu.def	Fri May 14 15:41:10 2010 +0300
@@ -1,142 +1,146 @@
 EXPORTS
 	?trUtf8@NmAttachmentListItem@@SA?AVQString@@PBD0H@Z @ 1 NONAME ; class QString NmAttachmentListItem::trUtf8(char const *, char const *, int)
-	?itemActivated@NmAttachmentListWidget@@IAEXH@Z @ 2 NONAME ; void NmAttachmentListWidget::itemActivated(int)
-	?textCursor@NmHtmlLineEdit@@QBE?AVQTextCursor@@XZ @ 3 NONAME ; class QTextCursor NmHtmlLineEdit::textCursor(void) const
-	?keyPressEvent@NmRecipientLineEdit@@MAEXPAVQKeyEvent@@@Z @ 4 NONAME ; void NmRecipientLineEdit::keyPressEvent(class QKeyEvent *)
-	?sendMouseReleaseEvent@NmEditorTextEdit@@QAEXPAVQGraphicsSceneMouseEvent@@@Z @ 5 NONAME ; void NmEditorTextEdit::sendMouseReleaseEvent(class QGraphicsSceneMouseEvent *)
-	?paint@NmAttachmentListWidget@@UAEXPAVQPainter@@PBVQStyleOptionGraphicsItem@@PAVQWidget@@@Z @ 6 NONAME ; void NmAttachmentListWidget::paint(class QPainter *, class QStyleOptionGraphicsItem const *, class QWidget *)
-	?tr@NmEditorTextEdit@@SA?AVQString@@PBD0H@Z @ 7 NONAME ; class QString NmEditorTextEdit::tr(char const *, char const *, int)
-	?toHtml@NmHtmlLineEdit@@QBE?AVQString@@XZ @ 8 NONAME ; class QString NmHtmlLineEdit::toHtml(void) const
-	?metaObject@NmBaseViewScrollArea@@UBEPBUQMetaObject@@XZ @ 9 NONAME ; struct QMetaObject const * NmBaseViewScrollArea::metaObject(void) const
-	?emailAddressList@NmRecipientLineEdit@@QAE?AV?$QList@VNmAddress@@@@XZ @ 10 NONAME ; class QList<class NmAddress> NmRecipientLineEdit::emailAddressList(void)
-	?getStaticMetaObject@NmAttachmentListItem@@SAABUQMetaObject@@XZ @ 11 NONAME ; struct QMetaObject const & NmAttachmentListItem::getStaticMetaObject(void)
-	?getStaticMetaObject@NmBaseViewScrollArea@@SAABUQMetaObject@@XZ @ 12 NONAME ; struct QMetaObject const & NmBaseViewScrollArea::getStaticMetaObject(void)
-	?getStaticMetaObject@NmAttachmentListWidget@@SAABUQMetaObject@@XZ @ 13 NONAME ; struct QMetaObject const & NmAttachmentListWidget::getStaticMetaObject(void)
-	??_ENmAttachmentListItem@@UAE@I@Z @ 14 NONAME ; NmAttachmentListItem::~NmAttachmentListItem(unsigned int)
-	?sendMouseMoveEvent@NmEditorTextEdit@@QAEXPAVQGraphicsSceneMouseEvent@@@Z @ 15 NONAME ; void NmEditorTextEdit::sendMouseMoveEvent(class QGraphicsSceneMouseEvent *)
-	?updateEditorHeight@NmEditorTextEdit@@QAEXXZ @ 16 NONAME ; void NmEditorTextEdit::updateEditorHeight(void)
-	?qt_metacast@NmHtmlLineEdit@@UAEPAXPBD@Z @ 17 NONAME ; void * NmHtmlLineEdit::qt_metacast(char const *)
-	?metaObject@NmEditorTextEdit@@UBEPBUQMetaObject@@XZ @ 18 NONAME ; struct QMetaObject const * NmEditorTextEdit::metaObject(void) const
-	?init@NmEditorTextEdit@@QAEXPAVNmEditorContent@@PAVNmBaseViewScrollArea@@@Z @ 19 NONAME ; void NmEditorTextEdit::init(class NmEditorContent *, class NmBaseViewScrollArea *)
-	?setFileNameText@NmAttachmentListItem@@QAEXABVQString@@@Z @ 20 NONAME ; void NmAttachmentListItem::setFileNameText(class QString const &)
-	?qt_metacast@NmBaseViewScrollArea@@UAEPAXPBD@Z @ 21 NONAME ; void * NmBaseViewScrollArea::qt_metacast(char const *)
-	?tr@NmBaseViewScrollArea@@SA?AVQString@@PBD0H@Z @ 22 NONAME ; class QString NmBaseViewScrollArea::tr(char const *, char const *, int)
-	?qt_metacall@NmAttachmentListWidget@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 23 NONAME ; int NmAttachmentListWidget::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?trUtf8@NmAttachmentListWidget@@SA?AVQString@@PBD0H@Z @ 24 NONAME ; class QString NmAttachmentListWidget::trUtf8(char const *, char const *, int)
-	?qt_metacall@NmRecipientLineEdit@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 25 NONAME ; int NmRecipientLineEdit::qt_metacall(enum QMetaObject::Call, int, void * *)
-	??0NmAttachmentListItem@@QAE@PAVQGraphicsItem@@@Z @ 26 NONAME ; NmAttachmentListItem::NmAttachmentListItem(class QGraphicsItem *)
-	?trUtf8@NmBaseViewScrollArea@@SA?AVQString@@PBD0H@Z @ 27 NONAME ; class QString NmBaseViewScrollArea::trUtf8(char const *, char const *, int)
-	??1NmHtmlLineEdit@@UAE@XZ @ 28 NONAME ; NmHtmlLineEdit::~NmHtmlLineEdit(void)
-	?setProgressBarValue@NmAttachmentListItem@@QAEXH@Z @ 29 NONAME ; void NmAttachmentListItem::setProgressBarValue(int)
-	?trUtf8@NmHtmlLineEdit@@SA?AVQString@@PBD0@Z @ 30 NONAME ; class QString NmHtmlLineEdit::trUtf8(char const *, char const *)
-	??0NmRecipientLineEdit@@QAE@PAVQGraphicsItem@@@Z @ 31 NONAME ; NmRecipientLineEdit::NmRecipientLineEdit(class QGraphicsItem *)
-	?setAttachmentSize@NmAttachmentListWidget@@QAEXHABVQString@@@Z @ 32 NONAME ; void NmAttachmentListWidget::setAttachmentSize(int, class QString const &)
-	?trUtf8@NmEditorTextEdit@@SA?AVQString@@PBD0H@Z @ 33 NONAME ; class QString NmEditorTextEdit::trUtf8(char const *, char const *, int)
-	?setPlainText@NmHtmlLineEdit@@QAEXABVQString@@@Z @ 34 NONAME ; void NmHtmlLineEdit::setPlainText(class QString const &)
-	?longPressGesture@NmBaseViewScrollArea@@MAEXABVQPointF@@@Z @ 35 NONAME ; void NmBaseViewScrollArea::longPressGesture(class QPointF const &)
-	?updateCustomTextColor@NmEditorTextEdit@@QAEXXZ @ 36 NONAME ; void NmEditorTextEdit::updateCustomTextColor(void)
-	?orientationChanged@NmAttachmentListWidget@@AAEXW4Orientation@Qt@@@Z @ 37 NONAME ; void NmAttachmentListWidget::orientationChanged(enum Qt::Orientation)
-	?insertSelectedContacts@NmRecipientLineEdit@@QAEXABVQVariant@@@Z @ 38 NONAME ; void NmRecipientLineEdit::insertSelectedContacts(class QVariant const &)
-	?qt_metacast@NmAttachmentListWidget@@UAEPAXPBD@Z @ 39 NONAME ; void * NmAttachmentListWidget::qt_metacast(char const *)
-	?getStaticMetaObject@NmHtmlLineEdit@@SAABUQMetaObject@@XZ @ 40 NONAME ; struct QMetaObject const & NmHtmlLineEdit::getStaticMetaObject(void)
-	?qt_metacall@NmEditorTextEdit@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 41 NONAME ; int NmEditorTextEdit::qt_metacall(enum QMetaObject::Call, int, void * *)
-	??1NmAttachmentListWidget@@UAE@XZ @ 42 NONAME ; NmAttachmentListWidget::~NmAttachmentListWidget(void)
-	??_ENmRecipientLineEdit@@UAE@I@Z @ 43 NONAME ; NmRecipientLineEdit::~NmRecipientLineEdit(unsigned int)
-	?qt_metacast@NmRecipientLineEdit@@UAEPAXPBD@Z @ 44 NONAME ; void * NmRecipientLineEdit::qt_metacast(char const *)
-	?setCustomTextColor@NmEditorTextEdit@@QAEXABU?$QPair@_NVQColor@@@@@Z @ 45 NONAME ; void NmEditorTextEdit::setCustomTextColor(struct QPair<bool, class QColor> const &)
-	?setDocument@NmHtmlLineEdit@@QAEXPAVQTextDocument@@@Z @ 46 NONAME ; void NmHtmlLineEdit::setDocument(class QTextDocument *)
-	?trUtf8@NmEditorTextEdit@@SA?AVQString@@PBD0@Z @ 47 NONAME ; class QString NmEditorTextEdit::trUtf8(char const *, char const *)
-	??0NmBaseViewScrollArea@@QAE@PAVQGraphicsItem@@@Z @ 48 NONAME ; NmBaseViewScrollArea::NmBaseViewScrollArea(class QGraphicsItem *)
-	?longPressed@NmAttachmentListWidget@@IAEXHVQPointF@@@Z @ 49 NONAME ; void NmAttachmentListWidget::longPressed(int, class QPointF)
-	?staticMetaObject@NmEditorTextEdit@@2UQMetaObject@@B @ 50 NONAME ; struct QMetaObject const NmEditorTextEdit::staticMetaObject
-	??0NmEditorTextEdit@@QAE@PAVQGraphicsItem@@@Z @ 51 NONAME ; NmEditorTextEdit::NmEditorTextEdit(class QGraphicsItem *)
-	??_ENmEditorTextEdit@@UAE@I@Z @ 52 NONAME ; NmEditorTextEdit::~NmEditorTextEdit(unsigned int)
-	?sendLongPressEvent@NmEditorTextEdit@@QAEXABVQPointF@@@Z @ 53 NONAME ; void NmEditorTextEdit::sendLongPressEvent(class QPointF const &)
-	?qt_metacast@NmAttachmentListItem@@UAEPAXPBD@Z @ 54 NONAME ; void * NmAttachmentListItem::qt_metacast(char const *)
-	?handleMouseReleaseEvent@NmBaseViewScrollArea@@IAEXPAVQGraphicsSceneMouseEvent@@@Z @ 55 NONAME ; void NmBaseViewScrollArea::handleMouseReleaseEvent(class QGraphicsSceneMouseEvent *)
-	?removeProgressBar@NmAttachmentListItem@@AAEXXZ @ 56 NONAME ; void NmAttachmentListItem::removeProgressBar(void)
-	??1NmBaseViewScrollArea@@UAE@XZ @ 57 NONAME ; NmBaseViewScrollArea::~NmBaseViewScrollArea(void)
-	?sendMousePressEvent@NmEditorTextEdit@@QAEXPAVQGraphicsSceneMouseEvent@@@Z @ 58 NONAME ; void NmEditorTextEdit::sendMousePressEvent(class QGraphicsSceneMouseEvent *)
-	??_ENmHtmlLineEdit@@UAE@I@Z @ 59 NONAME ; NmHtmlLineEdit::~NmHtmlLineEdit(unsigned int)
-	?tr@NmAttachmentListWidget@@SA?AVQString@@PBD0H@Z @ 60 NONAME ; class QString NmAttachmentListWidget::tr(char const *, char const *, int)
-	?handleMousePressEvent@NmBaseViewScrollArea@@IAEXPAVQGraphicsSceneMouseEvent@@@Z @ 61 NONAME ; void NmBaseViewScrollArea::handleMousePressEvent(class QGraphicsSceneMouseEvent *)
-	?insertItemToLayout@NmAttachmentListWidget@@AAEXPAVNmAttachmentListItem@@@Z @ 62 NONAME ; void NmAttachmentListWidget::insertItemToLayout(class NmAttachmentListItem *)
-	?metaObject@NmHtmlLineEdit@@UBEPBUQMetaObject@@XZ @ 63 NONAME ; struct QMetaObject const * NmHtmlLineEdit::metaObject(void) const
-	?setTextColor@NmAttachmentListItem@@QAEXVQColor@@@Z @ 64 NONAME ; void NmAttachmentListItem::setTextColor(class QColor)
-	??1NmAttachmentListItem@@UAE@XZ @ 65 NONAME ; NmAttachmentListItem::~NmAttachmentListItem(void)
-	?count@NmAttachmentListWidget@@QBEHXZ @ 66 NONAME ; int NmAttachmentListWidget::count(void) const
-	?handleTextChanged@NmRecipientLineEdit@@AAEXABVQString@@@Z @ 67 NONAME ; void NmRecipientLineEdit::handleTextChanged(class QString const &)
-	?longPressedActivated@NmAttachmentListItem@@AAEXXZ @ 68 NONAME ; void NmAttachmentListItem::longPressedActivated(void)
-	?handleLongPressGesture@NmBaseViewScrollArea@@IAEXABVQPointF@@@Z @ 69 NONAME ; void NmBaseViewScrollArea::handleLongPressGesture(class QPointF const &)
-	?updateScrollPosition@NmEditorTextEdit@@QAEXABVQPointF@@@Z @ 70 NONAME ; void NmEditorTextEdit::updateScrollPosition(class QPointF const &)
-	?contentHeight@NmEditorTextEdit@@QBEMXZ @ 71 NONAME ; float NmEditorTextEdit::contentHeight(void) const
-	?qt_metacast@NmEditorTextEdit@@UAEPAXPBD@Z @ 72 NONAME ; void * NmEditorTextEdit::qt_metacast(char const *)
-	?mouseMoveEvent@NmBaseViewScrollArea@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 73 NONAME ; void NmBaseViewScrollArea::mouseMoveEvent(class QGraphicsSceneMouseEvent *)
-	?qt_metacall@NmAttachmentListItem@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 74 NONAME ; int NmAttachmentListItem::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?handleLongPressed@NmAttachmentListWidget@@AAEXVQPointF@@@Z @ 75 NONAME ; void NmAttachmentListWidget::handleLongPressed(class QPointF)
-	?staticMetaObject@NmBaseViewScrollArea@@2UQMetaObject@@B @ 76 NONAME ; struct QMetaObject const NmBaseViewScrollArea::staticMetaObject
-	?setHeaderHeight@NmEditorTextEdit@@QAEXH@Z @ 77 NONAME ; void NmEditorTextEdit::setHeaderHeight(int)
-	?init@NmAttachmentListWidget@@AAEXXZ @ 78 NONAME ; void NmAttachmentListWidget::init(void)
-	?rearrangeLayout@NmAttachmentListWidget@@AAEXXZ @ 79 NONAME ; void NmAttachmentListWidget::rearrangeLayout(void)
-	?trUtf8@NmRecipientLineEdit@@SA?AVQString@@PBD0@Z @ 80 NONAME ; class QString NmRecipientLineEdit::trUtf8(char const *, char const *)
-	?metaObject@NmRecipientLineEdit@@UBEPBUQMetaObject@@XZ @ 81 NONAME ; struct QMetaObject const * NmRecipientLineEdit::metaObject(void) const
-	?tr@NmAttachmentListItem@@SA?AVQString@@PBD0@Z @ 82 NONAME ; class QString NmAttachmentListItem::tr(char const *, char const *)
-	?trUtf8@NmAttachmentListItem@@SA?AVQString@@PBD0@Z @ 83 NONAME ; class QString NmAttachmentListItem::trUtf8(char const *, char const *)
-	?trUtf8@NmBaseViewScrollArea@@SA?AVQString@@PBD0@Z @ 84 NONAME ; class QString NmBaseViewScrollArea::trUtf8(char const *, char const *)
-	?tr@NmBaseViewScrollArea@@SA?AVQString@@PBD0@Z @ 85 NONAME ; class QString NmBaseViewScrollArea::tr(char const *, char const *)
-	?setFileSizeText@NmAttachmentListItem@@QAEXABVQString@@@Z @ 86 NONAME ; void NmAttachmentListItem::setFileSizeText(class QString const &)
-	?customTextColor@NmEditorTextEdit@@QBE?AU?$QPair@_NVQColor@@@@XZ @ 87 NONAME ; struct QPair<bool, class QColor> NmEditorTextEdit::customTextColor(void) const
-	?staticMetaObject@NmHtmlLineEdit@@2UQMetaObject@@B @ 88 NONAME ; struct QMetaObject const NmHtmlLineEdit::staticMetaObject
-	?inputMethodEvent@NmRecipientLineEdit@@MAEXPAVQInputMethodEvent@@@Z @ 89 NONAME ; void NmRecipientLineEdit::inputMethodEvent(class QInputMethodEvent *)
-	?mouseReleaseEvent@NmBaseViewScrollArea@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 90 NONAME ; void NmBaseViewScrollArea::mouseReleaseEvent(class QGraphicsSceneMouseEvent *)
-	?constructUi@NmAttachmentListWidget@@AAEXXZ @ 91 NONAME ; void NmAttachmentListWidget::constructUi(void)
-	?toPlainText@NmHtmlLineEdit@@QBE?AVQString@@XZ @ 92 NONAME ; class QString NmHtmlLineEdit::toPlainText(void) const
-	?getStaticMetaObject@NmEditorTextEdit@@SAABUQMetaObject@@XZ @ 93 NONAME ; struct QMetaObject const & NmEditorTextEdit::getStaticMetaObject(void)
-	?setScrollPosition@NmEditorTextEdit@@QAEXHH@Z @ 94 NONAME ; void NmEditorTextEdit::setScrollPosition(int, int)
-	?tr@NmEditorTextEdit@@SA?AVQString@@PBD0@Z @ 95 NONAME ; class QString NmEditorTextEdit::tr(char const *, char const *)
-	?staticMetaObject@NmAttachmentListItem@@2UQMetaObject@@B @ 96 NONAME ; struct QMetaObject const NmAttachmentListItem::staticMetaObject
-	??_ENmBaseViewScrollArea@@UAE@I@Z @ 97 NONAME ; NmBaseViewScrollArea::~NmBaseViewScrollArea(unsigned int)
-	?itemLongPressed@NmAttachmentListItem@@IAEXVQPointF@@@Z @ 98 NONAME ; void NmAttachmentListItem::itemLongPressed(class QPointF)
-	?progressBarValue@NmAttachmentListItem@@QBEHXZ @ 99 NONAME ; int NmAttachmentListItem::progressBarValue(void) const
-	?setCustomTextColor@NmEditorTextEdit@@QAEX_NABVQColor@@@Z @ 100 NONAME ; void NmEditorTextEdit::setCustomTextColor(bool, class QColor const &)
-	?setEditorContentHeight@NmEditorTextEdit@@IAEXXZ @ 101 NONAME ; void NmEditorTextEdit::setEditorContentHeight(void)
-	??0NmHtmlLineEdit@@QAE@PAVQGraphicsItem@@@Z @ 102 NONAME ; NmHtmlLineEdit::NmHtmlLineEdit(class QGraphicsItem *)
-	?init@NmAttachmentListItem@@AAEXXZ @ 103 NONAME ; void NmAttachmentListItem::init(void)
-	?tr@NmRecipientLineEdit@@SA?AVQString@@PBD0@Z @ 104 NONAME ; class QString NmRecipientLineEdit::tr(char const *, char const *)
-	??1NmEditorTextEdit@@UAE@XZ @ 105 NONAME ; NmEditorTextEdit::~NmEditorTextEdit(void)
-	?generateEmailAddressList@NmRecipientLineEdit@@AAEXXZ @ 106 NONAME ; void NmRecipientLineEdit::generateEmailAddressList(void)
-	?trUtf8@NmAttachmentListWidget@@SA?AVQString@@PBD0@Z @ 107 NONAME ; class QString NmAttachmentListWidget::trUtf8(char const *, char const *)
-	?mousePressEvent@NmBaseViewScrollArea@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 108 NONAME ; void NmBaseViewScrollArea::mousePressEvent(class QGraphicsSceneMouseEvent *)
-	?handleItemActivated@NmAttachmentListWidget@@AAEXXZ @ 109 NONAME ; void NmAttachmentListWidget::handleItemActivated(void)
-	?metaObject@NmAttachmentListWidget@@UBEPBUQMetaObject@@XZ @ 110 NONAME ; struct QMetaObject const * NmAttachmentListWidget::metaObject(void) const
-	?constructUi@NmAttachmentListItem@@AAEXXZ @ 111 NONAME ; void NmAttachmentListItem::constructUi(void)
-	?trUtf8@NmHtmlLineEdit@@SA?AVQString@@PBD0H@Z @ 112 NONAME ; class QString NmHtmlLineEdit::trUtf8(char const *, char const *, int)
-	?setHtml@NmHtmlLineEdit@@QAEXABVQString@@@Z @ 113 NONAME ; void NmHtmlLineEdit::setHtml(class QString const &)
-	?tr@NmHtmlLineEdit@@SA?AVQString@@PBD0H@Z @ 114 NONAME ; class QString NmHtmlLineEdit::tr(char const *, char const *, int)
-	?mouseReleaseEvent@NmAttachmentListItem@@MAEXPAVQGraphicsSceneMouseEvent@@@Z @ 115 NONAME ; void NmAttachmentListItem::mouseReleaseEvent(class QGraphicsSceneMouseEvent *)
-	?itemActivated@NmAttachmentListItem@@IAEXXZ @ 116 NONAME ; void NmAttachmentListItem::itemActivated(void)
-	?tr@NmAttachmentListWidget@@SA?AVQString@@PBD0@Z @ 117 NONAME ; class QString NmAttachmentListWidget::tr(char const *, char const *)
-	?getStaticMetaObject@NmRecipientLineEdit@@SAABUQMetaObject@@XZ @ 118 NONAME ; struct QMetaObject const & NmRecipientLineEdit::getStaticMetaObject(void)
-	?findItem@NmAttachmentListWidget@@AAEHPBVQObject@@@Z @ 119 NONAME ; int NmAttachmentListWidget::findItem(class QObject const *)
-	??1NmRecipientLineEdit@@UAE@XZ @ 120 NONAME ; NmRecipientLineEdit::~NmRecipientLineEdit(void)
-	?removeAttachment@NmAttachmentListWidget@@QAEXH@Z @ 121 NONAME ; void NmAttachmentListWidget::removeAttachment(int)
-	?trUtf8@NmRecipientLineEdit@@SA?AVQString@@PBD0H@Z @ 122 NONAME ; class QString NmRecipientLineEdit::trUtf8(char const *, char const *, int)
-	?tr@NmRecipientLineEdit@@SA?AVQString@@PBD0H@Z @ 123 NONAME ; class QString NmRecipientLineEdit::tr(char const *, char const *, int)
-	?progressValue@NmAttachmentListWidget@@QBEHH@Z @ 124 NONAME ; int NmAttachmentListWidget::progressValue(int) const
-	?staticMetaObject@NmAttachmentListWidget@@2UQMetaObject@@B @ 125 NONAME ; struct QMetaObject const NmAttachmentListWidget::staticMetaObject
-	??_ENmAttachmentListWidget@@UAE@I@Z @ 126 NONAME ; NmAttachmentListWidget::~NmAttachmentListWidget(unsigned int)
-	?setTextColor@NmAttachmentListWidget@@QAEXVQColor@@@Z @ 127 NONAME ; void NmAttachmentListWidget::setTextColor(class QColor)
-	?setTextCursor@NmHtmlLineEdit@@QAEXABVQTextCursor@@@Z @ 128 NONAME ; void NmHtmlLineEdit::setTextCursor(class QTextCursor const &)
-	?handleMouseMoveEvent@NmBaseViewScrollArea@@IAEXPAVQGraphicsSceneMouseEvent@@@Z @ 129 NONAME ; void NmBaseViewScrollArea::handleMouseMoveEvent(class QGraphicsSceneMouseEvent *)
-	?staticMetaObject@NmRecipientLineEdit@@2UQMetaObject@@B @ 130 NONAME ; struct QMetaObject const NmRecipientLineEdit::staticMetaObject
-	?setProgressBarValue@NmAttachmentListWidget@@QAEXHH@Z @ 131 NONAME ; void NmAttachmentListWidget::setProgressBarValue(int, int)
-	?metaObject@NmAttachmentListItem@@UBEPBUQMetaObject@@XZ @ 132 NONAME ; struct QMetaObject const * NmAttachmentListItem::metaObject(void) const
-	?insertAttachment@NmAttachmentListWidget@@QAEXHABVQString@@0@Z @ 133 NONAME ; void NmAttachmentListWidget::insertAttachment(int, class QString const &, class QString const &)
-	??0NmAttachmentListWidget@@QAE@PAVQGraphicsItem@@@Z @ 134 NONAME ; NmAttachmentListWidget::NmAttachmentListWidget(class QGraphicsItem *)
-	?mousePressEvent@NmAttachmentListItem@@MAEXPAVQGraphicsSceneMouseEvent@@@Z @ 135 NONAME ; void NmAttachmentListItem::mousePressEvent(class QGraphicsSceneMouseEvent *)
-	?tr@NmAttachmentListItem@@SA?AVQString@@PBD0H@Z @ 136 NONAME ; class QString NmAttachmentListItem::tr(char const *, char const *, int)
-	?document@NmHtmlLineEdit@@QBEPAVQTextDocument@@XZ @ 137 NONAME ; class QTextDocument * NmHtmlLineEdit::document(void) const
-	?qt_metacall@NmBaseViewScrollArea@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 138 NONAME ; int NmBaseViewScrollArea::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?qt_metacall@NmHtmlLineEdit@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 139 NONAME ; int NmHtmlLineEdit::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?tr@NmHtmlLineEdit@@SA?AVQString@@PBD0@Z @ 140 NONAME ; class QString NmHtmlLineEdit::tr(char const *, char const *)
+	?screenSize@NmAttachmentListItem@@AAE?AVQSize@@W4Orientation@Qt@@@Z @ 2 NONAME ; class QSize NmAttachmentListItem::screenSize(enum Qt::Orientation)
+	?itemActivated@NmAttachmentListWidget@@IAEXH@Z @ 3 NONAME ; void NmAttachmentListWidget::itemActivated(int)
+	?textCursor@NmHtmlLineEdit@@QBE?AVQTextCursor@@XZ @ 4 NONAME ; class QTextCursor NmHtmlLineEdit::textCursor(void) const
+	?keyPressEvent@NmRecipientLineEdit@@MAEXPAVQKeyEvent@@@Z @ 5 NONAME ; void NmRecipientLineEdit::keyPressEvent(class QKeyEvent *)
+	?sendMouseReleaseEvent@NmEditorTextEdit@@QAEXPAVQGraphicsSceneMouseEvent@@@Z @ 6 NONAME ; void NmEditorTextEdit::sendMouseReleaseEvent(class QGraphicsSceneMouseEvent *)
+	?paint@NmAttachmentListWidget@@UAEXPAVQPainter@@PBVQStyleOptionGraphicsItem@@PAVQWidget@@@Z @ 7 NONAME ; void NmAttachmentListWidget::paint(class QPainter *, class QStyleOptionGraphicsItem const *, class QWidget *)
+	?tr@NmEditorTextEdit@@SA?AVQString@@PBD0H@Z @ 8 NONAME ; class QString NmEditorTextEdit::tr(char const *, char const *, int)
+	?toHtml@NmHtmlLineEdit@@QBE?AVQString@@XZ @ 9 NONAME ; class QString NmHtmlLineEdit::toHtml(void) const
+	?resetFileNameLength@NmAttachmentListItem@@QAEXW4Orientation@Qt@@@Z @ 10 NONAME ; void NmAttachmentListItem::resetFileNameLength(enum Qt::Orientation)
+	?metaObject@NmBaseViewScrollArea@@UBEPBUQMetaObject@@XZ @ 11 NONAME ; struct QMetaObject const * NmBaseViewScrollArea::metaObject(void) const
+	?init@NmEditorTextEdit@@QAEXPAVNmBaseViewScrollArea@@@Z @ 12 NONAME ; void NmEditorTextEdit::init(class NmBaseViewScrollArea *)
+	?emailAddressList@NmRecipientLineEdit@@QAE?AV?$QList@VNmAddress@@@@XZ @ 13 NONAME ; class QList<class NmAddress> NmRecipientLineEdit::emailAddressList(void)
+	?getStaticMetaObject@NmAttachmentListItem@@SAABUQMetaObject@@XZ @ 14 NONAME ; struct QMetaObject const & NmAttachmentListItem::getStaticMetaObject(void)
+	?getStaticMetaObject@NmBaseViewScrollArea@@SAABUQMetaObject@@XZ @ 15 NONAME ; struct QMetaObject const & NmBaseViewScrollArea::getStaticMetaObject(void)
+	?getStaticMetaObject@NmAttachmentListWidget@@SAABUQMetaObject@@XZ @ 16 NONAME ; struct QMetaObject const & NmAttachmentListWidget::getStaticMetaObject(void)
+	??_ENmAttachmentListItem@@UAE@I@Z @ 17 NONAME ; NmAttachmentListItem::~NmAttachmentListItem(unsigned int)
+	?sendMouseMoveEvent@NmEditorTextEdit@@QAEXPAVQGraphicsSceneMouseEvent@@@Z @ 18 NONAME ; void NmEditorTextEdit::sendMouseMoveEvent(class QGraphicsSceneMouseEvent *)
+	?updateEditorHeight@NmEditorTextEdit@@QAEXXZ @ 19 NONAME ; void NmEditorTextEdit::updateEditorHeight(void)
+	?qt_metacast@NmHtmlLineEdit@@UAEPAXPBD@Z @ 20 NONAME ; void * NmHtmlLineEdit::qt_metacast(char const *)
+	?metaObject@NmEditorTextEdit@@UBEPBUQMetaObject@@XZ @ 21 NONAME ; struct QMetaObject const * NmEditorTextEdit::metaObject(void) const
+	?setFileNameText@NmAttachmentListItem@@QAEXABVQString@@@Z @ 22 NONAME ; void NmAttachmentListItem::setFileNameText(class QString const &)
+	?qt_metacast@NmBaseViewScrollArea@@UAEPAXPBD@Z @ 23 NONAME ; void * NmBaseViewScrollArea::qt_metacast(char const *)
+	?tr@NmBaseViewScrollArea@@SA?AVQString@@PBD0H@Z @ 24 NONAME ; class QString NmBaseViewScrollArea::tr(char const *, char const *, int)
+	?qt_metacall@NmAttachmentListWidget@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 25 NONAME ; int NmAttachmentListWidget::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?trUtf8@NmAttachmentListWidget@@SA?AVQString@@PBD0H@Z @ 26 NONAME ; class QString NmAttachmentListWidget::trUtf8(char const *, char const *, int)
+	?qt_metacall@NmRecipientLineEdit@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 27 NONAME ; int NmRecipientLineEdit::qt_metacall(enum QMetaObject::Call, int, void * *)
+	??0NmAttachmentListItem@@QAE@PAVQGraphicsItem@@@Z @ 28 NONAME ; NmAttachmentListItem::NmAttachmentListItem(class QGraphicsItem *)
+	?trUtf8@NmBaseViewScrollArea@@SA?AVQString@@PBD0H@Z @ 29 NONAME ; class QString NmBaseViewScrollArea::trUtf8(char const *, char const *, int)
+	??1NmHtmlLineEdit@@UAE@XZ @ 30 NONAME ; NmHtmlLineEdit::~NmHtmlLineEdit(void)
+	?setProgressBarValue@NmAttachmentListItem@@QAEXH@Z @ 31 NONAME ; void NmAttachmentListItem::setProgressBarValue(int)
+	?trUtf8@NmHtmlLineEdit@@SA?AVQString@@PBD0@Z @ 32 NONAME ; class QString NmHtmlLineEdit::trUtf8(char const *, char const *)
+	??0NmRecipientLineEdit@@QAE@PAVQGraphicsItem@@@Z @ 33 NONAME ; NmRecipientLineEdit::NmRecipientLineEdit(class QGraphicsItem *)
+	?setAttachmentSize@NmAttachmentListWidget@@QAEXHABVQString@@@Z @ 34 NONAME ; void NmAttachmentListWidget::setAttachmentSize(int, class QString const &)
+	?trUtf8@NmEditorTextEdit@@SA?AVQString@@PBD0H@Z @ 35 NONAME ; class QString NmEditorTextEdit::trUtf8(char const *, char const *, int)
+	?setPlainText@NmHtmlLineEdit@@QAEXABVQString@@@Z @ 36 NONAME ; void NmHtmlLineEdit::setPlainText(class QString const &)
+	?longPressGesture@NmBaseViewScrollArea@@MAEXABVQPointF@@@Z @ 37 NONAME ; void NmBaseViewScrollArea::longPressGesture(class QPointF const &)
+	?updateCustomTextColor@NmEditorTextEdit@@QAEXXZ @ 38 NONAME ; void NmEditorTextEdit::updateCustomTextColor(void)
+	?orientationChanged@NmAttachmentListWidget@@AAEXW4Orientation@Qt@@@Z @ 39 NONAME ; void NmAttachmentListWidget::orientationChanged(enum Qt::Orientation)
+	?insertSelectedContacts@NmRecipientLineEdit@@QAEXABVQVariant@@@Z @ 40 NONAME ; void NmRecipientLineEdit::insertSelectedContacts(class QVariant const &)
+	?qt_metacast@NmAttachmentListWidget@@UAEPAXPBD@Z @ 41 NONAME ; void * NmAttachmentListWidget::qt_metacast(char const *)
+	?getStaticMetaObject@NmHtmlLineEdit@@SAABUQMetaObject@@XZ @ 42 NONAME ; struct QMetaObject const & NmHtmlLineEdit::getStaticMetaObject(void)
+	?qt_metacall@NmEditorTextEdit@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 43 NONAME ; int NmEditorTextEdit::qt_metacall(enum QMetaObject::Call, int, void * *)
+	??1NmAttachmentListWidget@@UAE@XZ @ 44 NONAME ; NmAttachmentListWidget::~NmAttachmentListWidget(void)
+	??_ENmRecipientLineEdit@@UAE@I@Z @ 45 NONAME ; NmRecipientLineEdit::~NmRecipientLineEdit(unsigned int)
+	?qt_metacast@NmRecipientLineEdit@@UAEPAXPBD@Z @ 46 NONAME ; void * NmRecipientLineEdit::qt_metacast(char const *)
+	?setCustomTextColor@NmEditorTextEdit@@QAEXABU?$QPair@_NVQColor@@@@@Z @ 47 NONAME ; void NmEditorTextEdit::setCustomTextColor(struct QPair<bool, class QColor> const &)
+	?setDocument@NmHtmlLineEdit@@QAEXPAVQTextDocument@@@Z @ 48 NONAME ; void NmHtmlLineEdit::setDocument(class QTextDocument *)
+	?trUtf8@NmEditorTextEdit@@SA?AVQString@@PBD0@Z @ 49 NONAME ; class QString NmEditorTextEdit::trUtf8(char const *, char const *)
+	??0NmBaseViewScrollArea@@QAE@PAVQGraphicsItem@@@Z @ 50 NONAME ; NmBaseViewScrollArea::NmBaseViewScrollArea(class QGraphicsItem *)
+	?longPressed@NmAttachmentListWidget@@IAEXHVQPointF@@@Z @ 51 NONAME ; void NmAttachmentListWidget::longPressed(int, class QPointF)
+	?staticMetaObject@NmEditorTextEdit@@2UQMetaObject@@B @ 52 NONAME ; struct QMetaObject const NmEditorTextEdit::staticMetaObject
+	??0NmEditorTextEdit@@QAE@PAVQGraphicsItem@@@Z @ 53 NONAME ; NmEditorTextEdit::NmEditorTextEdit(class QGraphicsItem *)
+	??_ENmEditorTextEdit@@UAE@I@Z @ 54 NONAME ; NmEditorTextEdit::~NmEditorTextEdit(unsigned int)
+	?sendLongPressEvent@NmEditorTextEdit@@QAEXABVQPointF@@@Z @ 55 NONAME ; void NmEditorTextEdit::sendLongPressEvent(class QPointF const &)
+	?hideProgressBar@NmAttachmentListItem@@QAEXXZ @ 56 NONAME ; void NmAttachmentListItem::hideProgressBar(void)
+	?qt_metacast@NmAttachmentListItem@@UAEPAXPBD@Z @ 57 NONAME ; void * NmAttachmentListItem::qt_metacast(char const *)
+	?handleMouseReleaseEvent@NmBaseViewScrollArea@@IAEXPAVQGraphicsSceneMouseEvent@@@Z @ 58 NONAME ; void NmBaseViewScrollArea::handleMouseReleaseEvent(class QGraphicsSceneMouseEvent *)
+	?removeProgressBar@NmAttachmentListItem@@AAEXXZ @ 59 NONAME ; void NmAttachmentListItem::removeProgressBar(void)
+	??1NmBaseViewScrollArea@@UAE@XZ @ 60 NONAME ; NmBaseViewScrollArea::~NmBaseViewScrollArea(void)
+	?sendMousePressEvent@NmEditorTextEdit@@QAEXPAVQGraphicsSceneMouseEvent@@@Z @ 61 NONAME ; void NmEditorTextEdit::sendMousePressEvent(class QGraphicsSceneMouseEvent *)
+	??_ENmHtmlLineEdit@@UAE@I@Z @ 62 NONAME ; NmHtmlLineEdit::~NmHtmlLineEdit(unsigned int)
+	?tr@NmAttachmentListWidget@@SA?AVQString@@PBD0H@Z @ 63 NONAME ; class QString NmAttachmentListWidget::tr(char const *, char const *, int)
+	?handleMousePressEvent@NmBaseViewScrollArea@@IAEXPAVQGraphicsSceneMouseEvent@@@Z @ 64 NONAME ; void NmBaseViewScrollArea::handleMousePressEvent(class QGraphicsSceneMouseEvent *)
+	?insertItemToLayout@NmAttachmentListWidget@@AAEXPAVNmAttachmentListItem@@@Z @ 65 NONAME ; void NmAttachmentListWidget::insertItemToLayout(class NmAttachmentListItem *)
+	?metaObject@NmHtmlLineEdit@@UBEPBUQMetaObject@@XZ @ 66 NONAME ; struct QMetaObject const * NmHtmlLineEdit::metaObject(void) const
+	?editorContentHeightChanged@NmEditorTextEdit@@IAEXXZ @ 67 NONAME ; void NmEditorTextEdit::editorContentHeightChanged(void)
+	?setTextColor@NmAttachmentListItem@@QAEXVQColor@@@Z @ 68 NONAME ; void NmAttachmentListItem::setTextColor(class QColor)
+	??1NmAttachmentListItem@@UAE@XZ @ 69 NONAME ; NmAttachmentListItem::~NmAttachmentListItem(void)
+	?count@NmAttachmentListWidget@@QBEHXZ @ 70 NONAME ; int NmAttachmentListWidget::count(void) const
+	?handleTextChanged@NmRecipientLineEdit@@AAEXABVQString@@@Z @ 71 NONAME ; void NmRecipientLineEdit::handleTextChanged(class QString const &)
+	?longPressedActivated@NmAttachmentListItem@@AAEXXZ @ 72 NONAME ; void NmAttachmentListItem::longPressedActivated(void)
+	?handleLongPressGesture@NmBaseViewScrollArea@@IAEXABVQPointF@@@Z @ 73 NONAME ; void NmBaseViewScrollArea::handleLongPressGesture(class QPointF const &)
+	?updateScrollPosition@NmEditorTextEdit@@QAEXABVQPointF@@@Z @ 74 NONAME ; void NmEditorTextEdit::updateScrollPosition(class QPointF const &)
+	?contentHeight@NmEditorTextEdit@@QBEMXZ @ 75 NONAME ; float NmEditorTextEdit::contentHeight(void) const
+	?qt_metacast@NmEditorTextEdit@@UAEPAXPBD@Z @ 76 NONAME ; void * NmEditorTextEdit::qt_metacast(char const *)
+	?mouseMoveEvent@NmBaseViewScrollArea@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 77 NONAME ; void NmBaseViewScrollArea::mouseMoveEvent(class QGraphicsSceneMouseEvent *)
+	?qt_metacall@NmAttachmentListItem@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 78 NONAME ; int NmAttachmentListItem::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?handleLongPressed@NmAttachmentListWidget@@AAEXVQPointF@@@Z @ 79 NONAME ; void NmAttachmentListWidget::handleLongPressed(class QPointF)
+	?staticMetaObject@NmBaseViewScrollArea@@2UQMetaObject@@B @ 80 NONAME ; struct QMetaObject const NmBaseViewScrollArea::staticMetaObject
+	?setHeaderHeight@NmEditorTextEdit@@QAEXH@Z @ 81 NONAME ; void NmEditorTextEdit::setHeaderHeight(int)
+	?init@NmAttachmentListWidget@@AAEXXZ @ 82 NONAME ; void NmAttachmentListWidget::init(void)
+	?rearrangeLayout@NmAttachmentListWidget@@AAEXXZ @ 83 NONAME ; void NmAttachmentListWidget::rearrangeLayout(void)
+	?trUtf8@NmRecipientLineEdit@@SA?AVQString@@PBD0@Z @ 84 NONAME ; class QString NmRecipientLineEdit::trUtf8(char const *, char const *)
+	?trUtf8@NmAttachmentListItem@@SA?AVQString@@PBD0@Z @ 85 NONAME ; class QString NmAttachmentListItem::trUtf8(char const *, char const *)
+	?metaObject@NmRecipientLineEdit@@UBEPBUQMetaObject@@XZ @ 86 NONAME ; struct QMetaObject const * NmRecipientLineEdit::metaObject(void) const
+	?tr@NmAttachmentListItem@@SA?AVQString@@PBD0@Z @ 87 NONAME ; class QString NmAttachmentListItem::tr(char const *, char const *)
+	?trUtf8@NmBaseViewScrollArea@@SA?AVQString@@PBD0@Z @ 88 NONAME ; class QString NmBaseViewScrollArea::trUtf8(char const *, char const *)
+	?tr@NmBaseViewScrollArea@@SA?AVQString@@PBD0@Z @ 89 NONAME ; class QString NmBaseViewScrollArea::tr(char const *, char const *)
+	?setFileSizeText@NmAttachmentListItem@@QAEXABVQString@@@Z @ 90 NONAME ; void NmAttachmentListItem::setFileSizeText(class QString const &)
+	?customTextColor@NmEditorTextEdit@@QBE?AU?$QPair@_NVQColor@@@@XZ @ 91 NONAME ; struct QPair<bool, class QColor> NmEditorTextEdit::customTextColor(void) const
+	?staticMetaObject@NmHtmlLineEdit@@2UQMetaObject@@B @ 92 NONAME ; struct QMetaObject const NmHtmlLineEdit::staticMetaObject
+	?inputMethodEvent@NmRecipientLineEdit@@MAEXPAVQInputMethodEvent@@@Z @ 93 NONAME ; void NmRecipientLineEdit::inputMethodEvent(class QInputMethodEvent *)
+	?mouseReleaseEvent@NmBaseViewScrollArea@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 94 NONAME ; void NmBaseViewScrollArea::mouseReleaseEvent(class QGraphicsSceneMouseEvent *)
+	?constructUi@NmAttachmentListWidget@@AAEXXZ @ 95 NONAME ; void NmAttachmentListWidget::constructUi(void)
+	?toPlainText@NmHtmlLineEdit@@QBE?AVQString@@XZ @ 96 NONAME ; class QString NmHtmlLineEdit::toPlainText(void) const
+	?getStaticMetaObject@NmEditorTextEdit@@SAABUQMetaObject@@XZ @ 97 NONAME ; struct QMetaObject const & NmEditorTextEdit::getStaticMetaObject(void)
+	?setScrollPosition@NmEditorTextEdit@@QAEXHH@Z @ 98 NONAME ; void NmEditorTextEdit::setScrollPosition(int, int)
+	?tr@NmEditorTextEdit@@SA?AVQString@@PBD0@Z @ 99 NONAME ; class QString NmEditorTextEdit::tr(char const *, char const *)
+	?staticMetaObject@NmAttachmentListItem@@2UQMetaObject@@B @ 100 NONAME ; struct QMetaObject const NmAttachmentListItem::staticMetaObject
+	??_ENmBaseViewScrollArea@@UAE@I@Z @ 101 NONAME ; NmBaseViewScrollArea::~NmBaseViewScrollArea(unsigned int)
+	?itemLongPressed@NmAttachmentListItem@@IAEXVQPointF@@@Z @ 102 NONAME ; void NmAttachmentListItem::itemLongPressed(class QPointF)
+	?progressBarValue@NmAttachmentListItem@@QBEHXZ @ 103 NONAME ; int NmAttachmentListItem::progressBarValue(void) const
+	?setCustomTextColor@NmEditorTextEdit@@QAEX_NABVQColor@@@Z @ 104 NONAME ; void NmEditorTextEdit::setCustomTextColor(bool, class QColor const &)
+	??0NmHtmlLineEdit@@QAE@PAVQGraphicsItem@@@Z @ 105 NONAME ; NmHtmlLineEdit::NmHtmlLineEdit(class QGraphicsItem *)
+	?init@NmAttachmentListItem@@AAEXXZ @ 106 NONAME ; void NmAttachmentListItem::init(void)
+	?tr@NmRecipientLineEdit@@SA?AVQString@@PBD0@Z @ 107 NONAME ; class QString NmRecipientLineEdit::tr(char const *, char const *)
+	??1NmEditorTextEdit@@UAE@XZ @ 108 NONAME ; NmEditorTextEdit::~NmEditorTextEdit(void)
+	?generateEmailAddressList@NmRecipientLineEdit@@AAEXXZ @ 109 NONAME ; void NmRecipientLineEdit::generateEmailAddressList(void)
+	?trUtf8@NmAttachmentListWidget@@SA?AVQString@@PBD0@Z @ 110 NONAME ; class QString NmAttachmentListWidget::trUtf8(char const *, char const *)
+	?mousePressEvent@NmBaseViewScrollArea@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 111 NONAME ; void NmBaseViewScrollArea::mousePressEvent(class QGraphicsSceneMouseEvent *)
+	?handleItemActivated@NmAttachmentListWidget@@AAEXXZ @ 112 NONAME ; void NmAttachmentListWidget::handleItemActivated(void)
+	?metaObject@NmAttachmentListWidget@@UBEPBUQMetaObject@@XZ @ 113 NONAME ; struct QMetaObject const * NmAttachmentListWidget::metaObject(void) const
+	?constructUi@NmAttachmentListItem@@AAEXXZ @ 114 NONAME ; void NmAttachmentListItem::constructUi(void)
+	?trUtf8@NmHtmlLineEdit@@SA?AVQString@@PBD0H@Z @ 115 NONAME ; class QString NmHtmlLineEdit::trUtf8(char const *, char const *, int)
+	?setHtml@NmHtmlLineEdit@@QAEXABVQString@@@Z @ 116 NONAME ; void NmHtmlLineEdit::setHtml(class QString const &)
+	?tr@NmHtmlLineEdit@@SA?AVQString@@PBD0H@Z @ 117 NONAME ; class QString NmHtmlLineEdit::tr(char const *, char const *, int)
+	?itemActivated@NmAttachmentListItem@@IAEXXZ @ 118 NONAME ; void NmAttachmentListItem::itemActivated(void)
+	?mouseReleaseEvent@NmAttachmentListItem@@MAEXPAVQGraphicsSceneMouseEvent@@@Z @ 119 NONAME ; void NmAttachmentListItem::mouseReleaseEvent(class QGraphicsSceneMouseEvent *)
+	?tr@NmAttachmentListWidget@@SA?AVQString@@PBD0@Z @ 120 NONAME ; class QString NmAttachmentListWidget::tr(char const *, char const *)
+	?getStaticMetaObject@NmRecipientLineEdit@@SAABUQMetaObject@@XZ @ 121 NONAME ; struct QMetaObject const & NmRecipientLineEdit::getStaticMetaObject(void)
+	?findItem@NmAttachmentListWidget@@AAEHPBVQObject@@@Z @ 122 NONAME ; int NmAttachmentListWidget::findItem(class QObject const *)
+	??1NmRecipientLineEdit@@UAE@XZ @ 123 NONAME ; NmRecipientLineEdit::~NmRecipientLineEdit(void)
+	?removeAttachment@NmAttachmentListWidget@@QAEXH@Z @ 124 NONAME ; void NmAttachmentListWidget::removeAttachment(int)
+	?trUtf8@NmRecipientLineEdit@@SA?AVQString@@PBD0H@Z @ 125 NONAME ; class QString NmRecipientLineEdit::trUtf8(char const *, char const *, int)
+	?tr@NmRecipientLineEdit@@SA?AVQString@@PBD0H@Z @ 126 NONAME ; class QString NmRecipientLineEdit::tr(char const *, char const *, int)
+	?progressValue@NmAttachmentListWidget@@QBEHH@Z @ 127 NONAME ; int NmAttachmentListWidget::progressValue(int) const
+	?staticMetaObject@NmAttachmentListWidget@@2UQMetaObject@@B @ 128 NONAME ; struct QMetaObject const NmAttachmentListWidget::staticMetaObject
+	??_ENmAttachmentListWidget@@UAE@I@Z @ 129 NONAME ; NmAttachmentListWidget::~NmAttachmentListWidget(unsigned int)
+	?setTextColor@NmAttachmentListWidget@@QAEXVQColor@@@Z @ 130 NONAME ; void NmAttachmentListWidget::setTextColor(class QColor)
+	?setTextCursor@NmHtmlLineEdit@@QAEXABVQTextCursor@@@Z @ 131 NONAME ; void NmHtmlLineEdit::setTextCursor(class QTextCursor const &)
+	?handleMouseMoveEvent@NmBaseViewScrollArea@@IAEXPAVQGraphicsSceneMouseEvent@@@Z @ 132 NONAME ; void NmBaseViewScrollArea::handleMouseMoveEvent(class QGraphicsSceneMouseEvent *)
+	?staticMetaObject@NmRecipientLineEdit@@2UQMetaObject@@B @ 133 NONAME ; struct QMetaObject const NmRecipientLineEdit::staticMetaObject
+	?setProgressBarValue@NmAttachmentListWidget@@QAEXHH@Z @ 134 NONAME ; void NmAttachmentListWidget::setProgressBarValue(int, int)
+	?metaObject@NmAttachmentListItem@@UBEPBUQMetaObject@@XZ @ 135 NONAME ; struct QMetaObject const * NmAttachmentListItem::metaObject(void) const
+	?insertAttachment@NmAttachmentListWidget@@QAEXHABVQString@@0@Z @ 136 NONAME ; void NmAttachmentListWidget::insertAttachment(int, class QString const &, class QString const &)
+	?hideProgressBar@NmAttachmentListWidget@@QAEXH@Z @ 137 NONAME ; void NmAttachmentListWidget::hideProgressBar(int)
+	??0NmAttachmentListWidget@@QAE@PAVQGraphicsItem@@@Z @ 138 NONAME ; NmAttachmentListWidget::NmAttachmentListWidget(class QGraphicsItem *)
+	?mousePressEvent@NmAttachmentListItem@@MAEXPAVQGraphicsSceneMouseEvent@@@Z @ 139 NONAME ; void NmAttachmentListItem::mousePressEvent(class QGraphicsSceneMouseEvent *)
+	?tr@NmAttachmentListItem@@SA?AVQString@@PBD0H@Z @ 140 NONAME ; class QString NmAttachmentListItem::tr(char const *, char const *, int)
+	?document@NmHtmlLineEdit@@QBEPAVQTextDocument@@XZ @ 141 NONAME ; class QTextDocument * NmHtmlLineEdit::document(void) const
+	?qt_metacall@NmBaseViewScrollArea@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 142 NONAME ; int NmBaseViewScrollArea::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?qt_metacall@NmHtmlLineEdit@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 143 NONAME ; int NmHtmlLineEdit::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?tr@NmHtmlLineEdit@@SA?AVQString@@PBD0@Z @ 144 NONAME ; class QString NmHtmlLineEdit::tr(char const *, char const *)
 
--- a/emailuis/nmailuiwidgets/eabi/nmailuiwidgetsu.def	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiwidgets/eabi/nmailuiwidgetsu.def	Fri May 14 15:41:10 2010 +0300
@@ -27,8 +27,8 @@
 	_ZN16NmEditorTextEdit20updateScrollPositionERK7QPointF @ 26 NONAME
 	_ZN16NmEditorTextEdit21sendMouseReleaseEventEP24QGraphicsSceneMouseEvent @ 27 NONAME
 	_ZN16NmEditorTextEdit21updateCustomTextColorEv @ 28 NONAME
-	_ZN16NmEditorTextEdit22setEditorContentHeightEv @ 29 NONAME
-	_ZN16NmEditorTextEdit4initEP15NmEditorContentP20NmBaseViewScrollArea @ 30 NONAME
+	_ZN16NmEditorTextEdit26editorContentHeightChangedEv @ 29 NONAME
+	_ZN16NmEditorTextEdit4initEP20NmBaseViewScrollArea @ 30 NONAME
 	_ZN16NmEditorTextEditC1EP13QGraphicsItem @ 31 NONAME
 	_ZN16NmEditorTextEditC2EP13QGraphicsItem @ 32 NONAME
 	_ZN16NmEditorTextEditD0Ev @ 33 NONAME
@@ -49,126 +49,130 @@
 	_ZN19NmRecipientLineEditD0Ev @ 48 NONAME
 	_ZN19NmRecipientLineEditD1Ev @ 49 NONAME
 	_ZN19NmRecipientLineEditD2Ev @ 50 NONAME
-	_ZN20NmAttachmentListItem11constructUiEv @ 51 NONAME
-	_ZN20NmAttachmentListItem11qt_metacallEN11QMetaObject4CallEiPPv @ 52 NONAME
-	_ZN20NmAttachmentListItem11qt_metacastEPKc @ 53 NONAME
-	_ZN20NmAttachmentListItem12setTextColorE6QColor @ 54 NONAME
-	_ZN20NmAttachmentListItem13itemActivatedEv @ 55 NONAME
-	_ZN20NmAttachmentListItem15itemLongPressedE7QPointF @ 56 NONAME
-	_ZN20NmAttachmentListItem15mousePressEventEP24QGraphicsSceneMouseEvent @ 57 NONAME
-	_ZN20NmAttachmentListItem15setFileNameTextERK7QString @ 58 NONAME
-	_ZN20NmAttachmentListItem15setFileSizeTextERK7QString @ 59 NONAME
-	_ZN20NmAttachmentListItem16staticMetaObjectE @ 60 NONAME DATA 16
-	_ZN20NmAttachmentListItem17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 61 NONAME
-	_ZN20NmAttachmentListItem17removeProgressBarEv @ 62 NONAME
-	_ZN20NmAttachmentListItem19getStaticMetaObjectEv @ 63 NONAME
-	_ZN20NmAttachmentListItem19setProgressBarValueEi @ 64 NONAME
-	_ZN20NmAttachmentListItem20longPressedActivatedEv @ 65 NONAME
-	_ZN20NmAttachmentListItem4initEv @ 66 NONAME
-	_ZN20NmAttachmentListItemC1EP13QGraphicsItem @ 67 NONAME
-	_ZN20NmAttachmentListItemC2EP13QGraphicsItem @ 68 NONAME
-	_ZN20NmAttachmentListItemD0Ev @ 69 NONAME
-	_ZN20NmAttachmentListItemD1Ev @ 70 NONAME
-	_ZN20NmAttachmentListItemD2Ev @ 71 NONAME
-	_ZN20NmBaseViewScrollArea11qt_metacallEN11QMetaObject4CallEiPPv @ 72 NONAME
-	_ZN20NmBaseViewScrollArea11qt_metacastEPKc @ 73 NONAME
-	_ZN20NmBaseViewScrollArea14mouseMoveEventEP24QGraphicsSceneMouseEvent @ 74 NONAME
-	_ZN20NmBaseViewScrollArea15mousePressEventEP24QGraphicsSceneMouseEvent @ 75 NONAME
-	_ZN20NmBaseViewScrollArea16longPressGestureERK7QPointF @ 76 NONAME
-	_ZN20NmBaseViewScrollArea16staticMetaObjectE @ 77 NONAME DATA 16
-	_ZN20NmBaseViewScrollArea17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 78 NONAME
-	_ZN20NmBaseViewScrollArea19getStaticMetaObjectEv @ 79 NONAME
-	_ZN20NmBaseViewScrollArea20handleMouseMoveEventEP24QGraphicsSceneMouseEvent @ 80 NONAME
-	_ZN20NmBaseViewScrollArea21handleMousePressEventEP24QGraphicsSceneMouseEvent @ 81 NONAME
-	_ZN20NmBaseViewScrollArea22handleLongPressGestureERK7QPointF @ 82 NONAME
-	_ZN20NmBaseViewScrollArea23handleMouseReleaseEventEP24QGraphicsSceneMouseEvent @ 83 NONAME
-	_ZN20NmBaseViewScrollAreaC1EP13QGraphicsItem @ 84 NONAME
-	_ZN20NmBaseViewScrollAreaC2EP13QGraphicsItem @ 85 NONAME
-	_ZN20NmBaseViewScrollAreaD0Ev @ 86 NONAME
-	_ZN20NmBaseViewScrollAreaD1Ev @ 87 NONAME
-	_ZN20NmBaseViewScrollAreaD2Ev @ 88 NONAME
-	_ZN22NmAttachmentListWidget11constructUiEv @ 89 NONAME
-	_ZN22NmAttachmentListWidget11longPressedEi7QPointF @ 90 NONAME
-	_ZN22NmAttachmentListWidget11qt_metacallEN11QMetaObject4CallEiPPv @ 91 NONAME
-	_ZN22NmAttachmentListWidget11qt_metacastEPKc @ 92 NONAME
-	_ZN22NmAttachmentListWidget12setTextColorE6QColor @ 93 NONAME
-	_ZN22NmAttachmentListWidget13itemActivatedEi @ 94 NONAME
-	_ZN22NmAttachmentListWidget15rearrangeLayoutEv @ 95 NONAME
-	_ZN22NmAttachmentListWidget16insertAttachmentEiRK7QStringS2_ @ 96 NONAME
-	_ZN22NmAttachmentListWidget16removeAttachmentEi @ 97 NONAME
-	_ZN22NmAttachmentListWidget16staticMetaObjectE @ 98 NONAME DATA 16
-	_ZN22NmAttachmentListWidget17handleLongPressedE7QPointF @ 99 NONAME
-	_ZN22NmAttachmentListWidget17setAttachmentSizeEiRK7QString @ 100 NONAME
-	_ZN22NmAttachmentListWidget18insertItemToLayoutEP20NmAttachmentListItem @ 101 NONAME
-	_ZN22NmAttachmentListWidget18orientationChangedEN2Qt11OrientationE @ 102 NONAME
-	_ZN22NmAttachmentListWidget19getStaticMetaObjectEv @ 103 NONAME
-	_ZN22NmAttachmentListWidget19handleItemActivatedEv @ 104 NONAME
-	_ZN22NmAttachmentListWidget19setProgressBarValueEii @ 105 NONAME
-	_ZN22NmAttachmentListWidget4initEv @ 106 NONAME
-	_ZN22NmAttachmentListWidget5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 107 NONAME
-	_ZN22NmAttachmentListWidget8findItemEPK7QObject @ 108 NONAME
-	_ZN22NmAttachmentListWidgetC1EP13QGraphicsItem @ 109 NONAME
-	_ZN22NmAttachmentListWidgetC2EP13QGraphicsItem @ 110 NONAME
-	_ZN22NmAttachmentListWidgetD0Ev @ 111 NONAME
-	_ZN22NmAttachmentListWidgetD1Ev @ 112 NONAME
-	_ZN22NmAttachmentListWidgetD2Ev @ 113 NONAME
-	_ZNK14NmHtmlLineEdit10metaObjectEv @ 114 NONAME
-	_ZNK14NmHtmlLineEdit10textCursorEv @ 115 NONAME
-	_ZNK14NmHtmlLineEdit11toPlainTextEv @ 116 NONAME
-	_ZNK14NmHtmlLineEdit6toHtmlEv @ 117 NONAME
-	_ZNK14NmHtmlLineEdit8documentEv @ 118 NONAME
-	_ZNK16NmEditorTextEdit10metaObjectEv @ 119 NONAME
-	_ZNK16NmEditorTextEdit13contentHeightEv @ 120 NONAME
-	_ZNK16NmEditorTextEdit15customTextColorEv @ 121 NONAME
-	_ZNK19NmRecipientLineEdit10metaObjectEv @ 122 NONAME
-	_ZNK20NmAttachmentListItem10metaObjectEv @ 123 NONAME
-	_ZNK20NmAttachmentListItem16progressBarValueEv @ 124 NONAME
-	_ZNK20NmBaseViewScrollArea10metaObjectEv @ 125 NONAME
-	_ZNK22NmAttachmentListWidget10metaObjectEv @ 126 NONAME
-	_ZNK22NmAttachmentListWidget13progressValueEi @ 127 NONAME
-	_ZNK22NmAttachmentListWidget5countEv @ 128 NONAME
-	_ZTI14NmHtmlLineEdit @ 129 NONAME
-	_ZTI16NmEditorTextEdit @ 130 NONAME
-	_ZTI19NmRecipientLineEdit @ 131 NONAME
-	_ZTI20NmAttachmentListItem @ 132 NONAME
-	_ZTI20NmBaseViewScrollArea @ 133 NONAME
-	_ZTI22NmAttachmentListWidget @ 134 NONAME
-	_ZTV14NmHtmlLineEdit @ 135 NONAME
-	_ZTV16NmEditorTextEdit @ 136 NONAME
-	_ZTV19NmRecipientLineEdit @ 137 NONAME
-	_ZTV20NmAttachmentListItem @ 138 NONAME
-	_ZTV20NmBaseViewScrollArea @ 139 NONAME
-	_ZTV22NmAttachmentListWidget @ 140 NONAME
-	_ZThn16_N14NmHtmlLineEditD0Ev @ 141 NONAME
-	_ZThn16_N14NmHtmlLineEditD1Ev @ 142 NONAME
-	_ZThn16_N16NmEditorTextEditD0Ev @ 143 NONAME
-	_ZThn16_N16NmEditorTextEditD1Ev @ 144 NONAME
-	_ZThn16_N19NmRecipientLineEditD0Ev @ 145 NONAME
-	_ZThn16_N19NmRecipientLineEditD1Ev @ 146 NONAME
-	_ZThn16_N20NmAttachmentListItemD0Ev @ 147 NONAME
-	_ZThn16_N20NmAttachmentListItemD1Ev @ 148 NONAME
-	_ZThn16_N20NmBaseViewScrollAreaD0Ev @ 149 NONAME
-	_ZThn16_N20NmBaseViewScrollAreaD1Ev @ 150 NONAME
-	_ZThn16_N22NmAttachmentListWidgetD0Ev @ 151 NONAME
-	_ZThn16_N22NmAttachmentListWidgetD1Ev @ 152 NONAME
-	_ZThn8_N14NmHtmlLineEditD0Ev @ 153 NONAME
-	_ZThn8_N14NmHtmlLineEditD1Ev @ 154 NONAME
-	_ZThn8_N16NmEditorTextEditD0Ev @ 155 NONAME
-	_ZThn8_N16NmEditorTextEditD1Ev @ 156 NONAME
-	_ZThn8_N19NmRecipientLineEdit13keyPressEventEP9QKeyEvent @ 157 NONAME
-	_ZThn8_N19NmRecipientLineEdit16inputMethodEventEP17QInputMethodEvent @ 158 NONAME
-	_ZThn8_N19NmRecipientLineEditD0Ev @ 159 NONAME
-	_ZThn8_N19NmRecipientLineEditD1Ev @ 160 NONAME
-	_ZThn8_N20NmAttachmentListItem15mousePressEventEP24QGraphicsSceneMouseEvent @ 161 NONAME
-	_ZThn8_N20NmAttachmentListItem17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 162 NONAME
-	_ZThn8_N20NmAttachmentListItemD0Ev @ 163 NONAME
-	_ZThn8_N20NmAttachmentListItemD1Ev @ 164 NONAME
-	_ZThn8_N20NmBaseViewScrollArea14mouseMoveEventEP24QGraphicsSceneMouseEvent @ 165 NONAME
-	_ZThn8_N20NmBaseViewScrollArea15mousePressEventEP24QGraphicsSceneMouseEvent @ 166 NONAME
-	_ZThn8_N20NmBaseViewScrollArea17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 167 NONAME
-	_ZThn8_N20NmBaseViewScrollAreaD0Ev @ 168 NONAME
-	_ZThn8_N20NmBaseViewScrollAreaD1Ev @ 169 NONAME
-	_ZThn8_N22NmAttachmentListWidget5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 170 NONAME
-	_ZThn8_N22NmAttachmentListWidgetD0Ev @ 171 NONAME
-	_ZThn8_N22NmAttachmentListWidgetD1Ev @ 172 NONAME
+	_ZN20NmAttachmentListItem10screenSizeEN2Qt11OrientationE @ 51 NONAME
+	_ZN20NmAttachmentListItem11constructUiEv @ 52 NONAME
+	_ZN20NmAttachmentListItem11qt_metacallEN11QMetaObject4CallEiPPv @ 53 NONAME
+	_ZN20NmAttachmentListItem11qt_metacastEPKc @ 54 NONAME
+	_ZN20NmAttachmentListItem12setTextColorE6QColor @ 55 NONAME
+	_ZN20NmAttachmentListItem13itemActivatedEv @ 56 NONAME
+	_ZN20NmAttachmentListItem15hideProgressBarEv @ 57 NONAME
+	_ZN20NmAttachmentListItem15itemLongPressedE7QPointF @ 58 NONAME
+	_ZN20NmAttachmentListItem15mousePressEventEP24QGraphicsSceneMouseEvent @ 59 NONAME
+	_ZN20NmAttachmentListItem15setFileNameTextERK7QString @ 60 NONAME
+	_ZN20NmAttachmentListItem15setFileSizeTextERK7QString @ 61 NONAME
+	_ZN20NmAttachmentListItem16staticMetaObjectE @ 62 NONAME DATA 16
+	_ZN20NmAttachmentListItem17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 63 NONAME
+	_ZN20NmAttachmentListItem17removeProgressBarEv @ 64 NONAME
+	_ZN20NmAttachmentListItem19getStaticMetaObjectEv @ 65 NONAME
+	_ZN20NmAttachmentListItem19resetFileNameLengthEN2Qt11OrientationE @ 66 NONAME
+	_ZN20NmAttachmentListItem19setProgressBarValueEi @ 67 NONAME
+	_ZN20NmAttachmentListItem20longPressedActivatedEv @ 68 NONAME
+	_ZN20NmAttachmentListItem4initEv @ 69 NONAME
+	_ZN20NmAttachmentListItemC1EP13QGraphicsItem @ 70 NONAME
+	_ZN20NmAttachmentListItemC2EP13QGraphicsItem @ 71 NONAME
+	_ZN20NmAttachmentListItemD0Ev @ 72 NONAME
+	_ZN20NmAttachmentListItemD1Ev @ 73 NONAME
+	_ZN20NmAttachmentListItemD2Ev @ 74 NONAME
+	_ZN20NmBaseViewScrollArea11qt_metacallEN11QMetaObject4CallEiPPv @ 75 NONAME
+	_ZN20NmBaseViewScrollArea11qt_metacastEPKc @ 76 NONAME
+	_ZN20NmBaseViewScrollArea14mouseMoveEventEP24QGraphicsSceneMouseEvent @ 77 NONAME
+	_ZN20NmBaseViewScrollArea15mousePressEventEP24QGraphicsSceneMouseEvent @ 78 NONAME
+	_ZN20NmBaseViewScrollArea16longPressGestureERK7QPointF @ 79 NONAME
+	_ZN20NmBaseViewScrollArea16staticMetaObjectE @ 80 NONAME DATA 16
+	_ZN20NmBaseViewScrollArea17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 81 NONAME
+	_ZN20NmBaseViewScrollArea19getStaticMetaObjectEv @ 82 NONAME
+	_ZN20NmBaseViewScrollArea20handleMouseMoveEventEP24QGraphicsSceneMouseEvent @ 83 NONAME
+	_ZN20NmBaseViewScrollArea21handleMousePressEventEP24QGraphicsSceneMouseEvent @ 84 NONAME
+	_ZN20NmBaseViewScrollArea22handleLongPressGestureERK7QPointF @ 85 NONAME
+	_ZN20NmBaseViewScrollArea23handleMouseReleaseEventEP24QGraphicsSceneMouseEvent @ 86 NONAME
+	_ZN20NmBaseViewScrollAreaC1EP13QGraphicsItem @ 87 NONAME
+	_ZN20NmBaseViewScrollAreaC2EP13QGraphicsItem @ 88 NONAME
+	_ZN20NmBaseViewScrollAreaD0Ev @ 89 NONAME
+	_ZN20NmBaseViewScrollAreaD1Ev @ 90 NONAME
+	_ZN20NmBaseViewScrollAreaD2Ev @ 91 NONAME
+	_ZN22NmAttachmentListWidget11constructUiEv @ 92 NONAME
+	_ZN22NmAttachmentListWidget11longPressedEi7QPointF @ 93 NONAME
+	_ZN22NmAttachmentListWidget11qt_metacallEN11QMetaObject4CallEiPPv @ 94 NONAME
+	_ZN22NmAttachmentListWidget11qt_metacastEPKc @ 95 NONAME
+	_ZN22NmAttachmentListWidget12setTextColorE6QColor @ 96 NONAME
+	_ZN22NmAttachmentListWidget13itemActivatedEi @ 97 NONAME
+	_ZN22NmAttachmentListWidget15hideProgressBarEi @ 98 NONAME
+	_ZN22NmAttachmentListWidget15rearrangeLayoutEv @ 99 NONAME
+	_ZN22NmAttachmentListWidget16insertAttachmentEiRK7QStringS2_ @ 100 NONAME
+	_ZN22NmAttachmentListWidget16removeAttachmentEi @ 101 NONAME
+	_ZN22NmAttachmentListWidget16staticMetaObjectE @ 102 NONAME DATA 16
+	_ZN22NmAttachmentListWidget17handleLongPressedE7QPointF @ 103 NONAME
+	_ZN22NmAttachmentListWidget17setAttachmentSizeEiRK7QString @ 104 NONAME
+	_ZN22NmAttachmentListWidget18insertItemToLayoutEP20NmAttachmentListItem @ 105 NONAME
+	_ZN22NmAttachmentListWidget18orientationChangedEN2Qt11OrientationE @ 106 NONAME
+	_ZN22NmAttachmentListWidget19getStaticMetaObjectEv @ 107 NONAME
+	_ZN22NmAttachmentListWidget19handleItemActivatedEv @ 108 NONAME
+	_ZN22NmAttachmentListWidget19setProgressBarValueEii @ 109 NONAME
+	_ZN22NmAttachmentListWidget4initEv @ 110 NONAME
+	_ZN22NmAttachmentListWidget5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 111 NONAME
+	_ZN22NmAttachmentListWidget8findItemEPK7QObject @ 112 NONAME
+	_ZN22NmAttachmentListWidgetC1EP13QGraphicsItem @ 113 NONAME
+	_ZN22NmAttachmentListWidgetC2EP13QGraphicsItem @ 114 NONAME
+	_ZN22NmAttachmentListWidgetD0Ev @ 115 NONAME
+	_ZN22NmAttachmentListWidgetD1Ev @ 116 NONAME
+	_ZN22NmAttachmentListWidgetD2Ev @ 117 NONAME
+	_ZNK14NmHtmlLineEdit10metaObjectEv @ 118 NONAME
+	_ZNK14NmHtmlLineEdit10textCursorEv @ 119 NONAME
+	_ZNK14NmHtmlLineEdit11toPlainTextEv @ 120 NONAME
+	_ZNK14NmHtmlLineEdit6toHtmlEv @ 121 NONAME
+	_ZNK14NmHtmlLineEdit8documentEv @ 122 NONAME
+	_ZNK16NmEditorTextEdit10metaObjectEv @ 123 NONAME
+	_ZNK16NmEditorTextEdit13contentHeightEv @ 124 NONAME
+	_ZNK16NmEditorTextEdit15customTextColorEv @ 125 NONAME
+	_ZNK19NmRecipientLineEdit10metaObjectEv @ 126 NONAME
+	_ZNK20NmAttachmentListItem10metaObjectEv @ 127 NONAME
+	_ZNK20NmAttachmentListItem16progressBarValueEv @ 128 NONAME
+	_ZNK20NmBaseViewScrollArea10metaObjectEv @ 129 NONAME
+	_ZNK22NmAttachmentListWidget10metaObjectEv @ 130 NONAME
+	_ZNK22NmAttachmentListWidget13progressValueEi @ 131 NONAME
+	_ZNK22NmAttachmentListWidget5countEv @ 132 NONAME
+	_ZTI14NmHtmlLineEdit @ 133 NONAME
+	_ZTI16NmEditorTextEdit @ 134 NONAME
+	_ZTI19NmRecipientLineEdit @ 135 NONAME
+	_ZTI20NmAttachmentListItem @ 136 NONAME
+	_ZTI20NmBaseViewScrollArea @ 137 NONAME
+	_ZTI22NmAttachmentListWidget @ 138 NONAME
+	_ZTV14NmHtmlLineEdit @ 139 NONAME
+	_ZTV16NmEditorTextEdit @ 140 NONAME
+	_ZTV19NmRecipientLineEdit @ 141 NONAME
+	_ZTV20NmAttachmentListItem @ 142 NONAME
+	_ZTV20NmBaseViewScrollArea @ 143 NONAME
+	_ZTV22NmAttachmentListWidget @ 144 NONAME
+	_ZThn16_N14NmHtmlLineEditD0Ev @ 145 NONAME
+	_ZThn16_N14NmHtmlLineEditD1Ev @ 146 NONAME
+	_ZThn16_N16NmEditorTextEditD0Ev @ 147 NONAME
+	_ZThn16_N16NmEditorTextEditD1Ev @ 148 NONAME
+	_ZThn16_N19NmRecipientLineEditD0Ev @ 149 NONAME
+	_ZThn16_N19NmRecipientLineEditD1Ev @ 150 NONAME
+	_ZThn16_N20NmAttachmentListItemD0Ev @ 151 NONAME
+	_ZThn16_N20NmAttachmentListItemD1Ev @ 152 NONAME
+	_ZThn16_N20NmBaseViewScrollAreaD0Ev @ 153 NONAME
+	_ZThn16_N20NmBaseViewScrollAreaD1Ev @ 154 NONAME
+	_ZThn16_N22NmAttachmentListWidgetD0Ev @ 155 NONAME
+	_ZThn16_N22NmAttachmentListWidgetD1Ev @ 156 NONAME
+	_ZThn8_N14NmHtmlLineEditD0Ev @ 157 NONAME
+	_ZThn8_N14NmHtmlLineEditD1Ev @ 158 NONAME
+	_ZThn8_N16NmEditorTextEditD0Ev @ 159 NONAME
+	_ZThn8_N16NmEditorTextEditD1Ev @ 160 NONAME
+	_ZThn8_N19NmRecipientLineEdit13keyPressEventEP9QKeyEvent @ 161 NONAME
+	_ZThn8_N19NmRecipientLineEdit16inputMethodEventEP17QInputMethodEvent @ 162 NONAME
+	_ZThn8_N19NmRecipientLineEditD0Ev @ 163 NONAME
+	_ZThn8_N19NmRecipientLineEditD1Ev @ 164 NONAME
+	_ZThn8_N20NmAttachmentListItem15mousePressEventEP24QGraphicsSceneMouseEvent @ 165 NONAME
+	_ZThn8_N20NmAttachmentListItem17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 166 NONAME
+	_ZThn8_N20NmAttachmentListItemD0Ev @ 167 NONAME
+	_ZThn8_N20NmAttachmentListItemD1Ev @ 168 NONAME
+	_ZThn8_N20NmBaseViewScrollArea14mouseMoveEventEP24QGraphicsSceneMouseEvent @ 169 NONAME
+	_ZThn8_N20NmBaseViewScrollArea15mousePressEventEP24QGraphicsSceneMouseEvent @ 170 NONAME
+	_ZThn8_N20NmBaseViewScrollArea17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 171 NONAME
+	_ZThn8_N20NmBaseViewScrollAreaD0Ev @ 172 NONAME
+	_ZThn8_N20NmBaseViewScrollAreaD1Ev @ 173 NONAME
+	_ZThn8_N22NmAttachmentListWidget5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 174 NONAME
+	_ZThn8_N22NmAttachmentListWidgetD0Ev @ 175 NONAME
+	_ZThn8_N22NmAttachmentListWidgetD1Ev @ 176 NONAME
 
--- a/emailuis/nmailuiwidgets/inc/nmailuiwidgetsheaders.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiwidgets/inc/nmailuiwidgetsheaders.h	Fri May 14 15:41:10 2010 +0300
@@ -18,12 +18,15 @@
 #ifndef NMAILUIWIDGETSHEADERS_H_
 #define NMAILUIWIDGETSHEADERS_H_
 
+// Qt
 #include <QtPlugin>
 #include <QTimer>
 #include <QCoreApplication>
 #include <QGraphicsItem>
 #include <QGraphicsSceneMouseEvent>
 #include <QGraphicsGridLayout>
+
+// Symbian & qt extensions
 #ifdef Q_OS_SYMBIAN
 #include <cntservicescontact.h>
 #include <xqservicerequest.h>
@@ -34,6 +37,8 @@
 #include <xqappmgr.h>
 #include <xqserviceipcmarshal.h>
 #endif
+
+// Orbit
 #include <hbmessagebox.h>
 #include <hbscrollarea.h>
 #include <hbstyleloader.h>
@@ -43,16 +48,16 @@
 #include <hbinstance.h>
 #include <hbcolorscheme.h>
 
+// nmail
 #include <nmaddress.h>
 #include <nmcommon.h>
+
+// nmailuiwidgets
 #include "nmrecipientlineedit.h"
 #include "nmhtmllineedit.h"
 #include "nmeditortextedit.h"
-#include "nmeditorcontent.h"
 #include "nmbaseviewscrollarea.h"
 #include "nmattachmentlistitem.h"
 #include "nmattachmentlistwidget.h"
 
-
-
 #endif /* NMAILUIWIDGETSHEADERS_H_ */
--- a/emailuis/nmailuiwidgets/inc/nmattachmentlistitem.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiwidgets/inc/nmattachmentlistitem.h	Fri May 14 15:41:10 2010 +0300
@@ -36,8 +36,10 @@
     void setTextColor(const QColor color);
     void setFileNameText(const QString &fileName);
     void setFileSizeText(const QString &fileSize);
+    void resetFileNameLength(Qt::Orientation orientation);
     void setProgressBarValue(const int value);
     int progressBarValue() const;
+    void hideProgressBar();
 
 protected: 
     void mousePressEvent( QGraphicsSceneMouseEvent *event );
@@ -54,6 +56,7 @@
 private: 
     void init( );
     void constructUi();
+    QSize screenSize(Qt::Orientation orientation);
     
 private:
     Q_DISABLE_COPY(NmAttachmentListItem)
--- a/emailuis/nmailuiwidgets/inc/nmattachmentlistwidget.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiwidgets/inc/nmattachmentlistwidget.h	Fri May 14 15:41:10 2010 +0300
@@ -40,6 +40,7 @@
     void setAttachmentSize(int index, const QString &fileSize);
     int count() const;
     int progressValue(int index) const;
+    void hideProgressBar(int index);
     void paint(QPainter *painter,const QStyleOptionGraphicsItem *option,QWidget *widget);
 
 public slots:
--- a/emailuis/nmailuiwidgets/inc/nmeditortextedit.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiwidgets/inc/nmeditortextedit.h	Fri May 14 15:41:10 2010 +0300
@@ -19,9 +19,8 @@
 #define NMEDITORTEXTEDIT_H_
 
 #include <hbtextedit.h>
-#include"nmailuiwidgetsdef.h"
+#include "nmailuiwidgetsdef.h"
 
-class NmEditorContent;
 class NmBaseViewScrollArea;
 class HbScrollArea;
 
@@ -34,7 +33,7 @@
     NmEditorTextEdit(QGraphicsItem *parent = 0);
     virtual ~NmEditorTextEdit();
 
-    void init(NmEditorContent *parent, NmBaseViewScrollArea *bgScrollArea);
+    void init(NmBaseViewScrollArea *bgScrollArea);
     qreal contentHeight() const;
 
     void sendMousePressEvent(QGraphicsSceneMouseEvent *event);
@@ -46,7 +45,7 @@
     QPair<bool, QColor> customTextColor() const;
 
 signals:
-    void setEditorContentHeight();
+    void editorContentHeightChanged();
 
 public slots:
     void updateEditorHeight();
@@ -56,7 +55,6 @@
     void updateCustomTextColor();
 
 private:
-    NmEditorContent *mParent;
     HbScrollArea *mScrollArea;
     NmBaseViewScrollArea *mBackgroundScrollArea;
     qreal mPreviousContentsHeight;
--- a/emailuis/nmailuiwidgets/nmailuiwidgets.pro	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiwidgets/nmailuiwidgets.pro	Fri May 14 15:41:10 2010 +0300
@@ -12,13 +12,9 @@
 TEMPLATE = lib
 TARGET = nmailuiwidgets
 CONFIG += hb
-QT += webkit
-QT += network
 DEFINES += BUILD_NMAILUIWIDGETS_DLL
-INCLUDEPATH += . \
-  ./inc \
-  ../../inc \
-  ../nmailui/inc
+INCLUDEPATH += ./inc \
+  ../../inc
 
 HEADERS += inc/nmailuiwidgetsheaders.h \
            inc/nmailuiwidgetsdef.h \
@@ -36,18 +32,9 @@
            src/nmattachmentlistwidget.cpp \
            src/nmattachmentlistitem.cpp
 
-LIBS += -leuser
-LIBS += -llibc
-
 symbian*: {
     INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
     
-    INCLUDEPATH += /epoc32/include \
-                   /epoc32/include/app \
-                   /epoc32/include/mw \
-                   /sf/mw/qtextensions/qthighway/inc \
-                   /sf/mw/qtextensions/qtmobileextensions/include 
-
     TARGET.EPOCALLOWDLLDATA = 1
     TARGET.CAPABILITY = CAP_GENERAL_DLL
     TARGET.UID2 = 0x1000008D
--- a/emailuis/nmailuiwidgets/src/nmattachmentlistitem.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiwidgets/src/nmattachmentlistitem.cpp	Fri May 14 15:41:10 2010 +0300
@@ -25,6 +25,8 @@
 static const int PROGRESSBAR_HIDE_COUNTDOWN = 500;
 static const int LONGPRESS_TIMER = 2000;
 
+// Hardcoded file size length. Maximum (999.9 Mb) fits into size field.
+static const int FILE_SIZE_FIELD_LENGTH = 120;
 
 /*!
  @nmailuiwidgets
@@ -98,8 +100,23 @@
             mFileSizeText->setTextColor(mTextColor);
         }
         mFileSizeText->setTextWrapping(Hb::TextNoWrap);
-        mFileSizeText->setText(fileSize);  
-    } 
+        mFileSizeText->setText(fileSize);
+    }
+}
+
+/*!
+    Set the length of the filename field.
+ */
+void NmAttachmentListItem::resetFileNameLength(Qt::Orientation orientation)
+{
+	QSizeF reso = screenSize(orientation);
+	
+	if (orientation == Qt::Horizontal) {
+        mFileNameText->setPreferredWidth(reso.width() / 2 - FILE_SIZE_FIELD_LENGTH);
+	}
+	else {		
+        mFileNameText->setPreferredWidth(reso.width() - FILE_SIZE_FIELD_LENGTH);
+	}
 }
 
 /*!
@@ -114,7 +131,7 @@
     }
 
     if ( !mProgressBar ){
-        mProgressBar = new HbProgressBar(HbProgressBar::SimpleProgressBar, this); 
+        mProgressBar = new HbProgressBar(this); 
         mProgressBar->setObjectName("attachmentlistitem_progress");
         mProgressBar->setRange(PROGRESSBAR_MIN,PROGRESSBAR_MAX);
         HbStyle::setItemName( mProgressBar, "progressbar" );
@@ -124,7 +141,7 @@
     
     //start hiding count down
     if(PROGRESSBAR_MAX <= value){
-        QTimer::singleShot(PROGRESSBAR_HIDE_COUNTDOWN,this, SLOT(removeProgressBar()));
+        hideProgressBar();
     }
 }
 
@@ -142,6 +159,14 @@
 }
 
 /*!
+    Hides progress bar, used if download is cancelled before 100 precent is reached
+*/
+void NmAttachmentListItem::hideProgressBar()
+{
+    QTimer::singleShot(PROGRESSBAR_HIDE_COUNTDOWN,this, SLOT(removeProgressBar()));
+}
+
+/*!
     Initialize
 */
 void NmAttachmentListItem::init( )
@@ -154,6 +179,7 @@
 
     //set temporary longpress timer
     mTimer = new QTimer(this);
+    mTimer->setSingleShot(true);
     connect(mTimer, SIGNAL(timeout()), this, SLOT(longPressedActivated()));
 }
 
@@ -169,12 +195,12 @@
     mFileNameText = new HbTextItem(this); 
     mFileNameText->setObjectName("nmattachmentlistitem_filenametext");
     HbStyle::setItemName( mFileNameText, "filename" );    
+    mFileNameText->setElideMode(Qt::ElideRight);
 
     mFileSizeText = new HbTextItem(this); 
     mFileSizeText->setObjectName("nmattachmentlistitem_filenamesize");
     HbStyle::setItemName( mFileSizeText, "filesize" );
     mFileSizeText->setElideMode(Qt::ElideNone);
-        
 }
 
 
@@ -232,3 +258,35 @@
     }
 }
 
+/*!
+    This function returns screen size depending on the orientation.
+    Function is copied from NmApplication.
+ */
+QSize NmAttachmentListItem::screenSize(Qt::Orientation orientation)
+{
+    QSize ret(0,0);
+    HbDeviceProfile currentP = HbDeviceProfile::current();
+    HbDeviceProfile altP(currentP.alternateProfileName());
+    QSize curPSize = currentP.logicalSize();
+    QSize altPSize = altP.logicalSize();
+    if (orientation == Qt::Horizontal) {
+        // Get wide profile size in landscape
+        if (curPSize.width() > altPSize.width()) {
+            ret = curPSize;
+        }
+        else{
+            ret = altPSize;
+        }
+    }
+    else {
+        // Get narrow profile size in portrait
+        if (curPSize.width() < altPSize.width()) {
+            ret = curPSize;
+        }
+        else{
+            ret = altPSize;
+        }
+    }
+    return ret;
+}
+
--- a/emailuis/nmailuiwidgets/src/nmattachmentlistwidget.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiwidgets/src/nmattachmentlistwidget.cpp	Fri May 14 15:41:10 2010 +0300
@@ -214,6 +214,17 @@
     return ret;
 }
 
+/*!
+    Hides progress of item, if index is negative or creater 
+    than last index function does nothing
+ */
+void NmAttachmentListWidget::hideProgressBar(int index)
+{
+    if(index >= 0 && index < mItemList.count()){
+        mItemList.at(index)->hideProgressBar();
+    }
+}
+
 
 /*!
     paint. Paint function for line painting.
@@ -401,12 +412,11 @@
     if(Qt::Vertical == mOrientation){
         mLayout->addItem(item,layout_count,0);
     } else {
-        if (mLayout->contentsRect().width() > 0) {
-            item->setPreferredWidth(mLayout->contentsRect().width() / 2);
-        }
+        item->setPreferredWidth(preferredWidth() / 2);
         mLayout->addItem(item,layout_count / 2, layout_count % 2);
     }
-
+    // Update maximum length of the file name field.
+    item->resetFileNameLength(mOrientation);
 }
 
 /*!
--- a/emailuis/nmailuiwidgets/src/nmeditortextedit.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiwidgets/src/nmeditortextedit.cpp	Fri May 14 15:41:10 2010 +0300
@@ -41,12 +41,11 @@
 {
 }
 
-void NmEditorTextEdit::init(NmEditorContent *parent, NmBaseViewScrollArea *bgScrollArea)
+void NmEditorTextEdit::init(NmBaseViewScrollArea *bgScrollArea)
 {
     mPreviousContentsHeight = 0;
     mFirstTime = true;
     mCustomTextColor = QPair<bool, QColor>(false,Qt::black);
-    mParent = parent;
     mBackgroundScrollArea = bgScrollArea;
     mHeaderHeight = (int)HeightOfTheHeaderOnStartup;
     mBgScrollPosition.setX(0);
@@ -65,7 +64,6 @@
     connect(this, SIGNAL(contentsChanged()), this, SLOT(updateEditorHeight()));
     connect(this, SIGNAL(cursorPositionChanged(int, int)),
             this, SLOT(setScrollPosition(int, int)));
-    connect(this, SIGNAL(setEditorContentHeight()), mParent, SLOT(setEditorContentHeight()));
     connect(this, SIGNAL(contentsChanged()), this, SLOT(updateCustomTextColor()));
 }
 
@@ -94,7 +92,7 @@
         setMaximumHeight(heightOfTheTextEdit);
     }
     // Inform parent that content height has been changed
-    emit setEditorContentHeight();
+    emit editorContentHeightChanged();
 }
 
 /*!
--- a/emailuis/nmailuiwidgets/src/nmrecipientlineedit.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiwidgets/src/nmrecipientlineedit.cpp	Fri May 14 15:41:10 2010 +0300
@@ -73,46 +73,39 @@
         CntServicesContactList contactList;
         contactList = qVariantValue<CntServicesContactList>(selectedContacts);
 
-        if (contactList.count() == 0) {	
-            // String "No contact returned" will be replaced by a hbTrId.
-            HbMessageBox note(tr("No contact returned"), HbMessageBox::MessageTypeInformation);
-            note.setTimeout(HbMessageBox::NoTimeout);
-            note.exec();
-        }
-        else {
-            // Loop through all the contacts selected from Contacts application.
-            for (int i = 0; i < contactList.count(); ++i) {
-                QString contactEmailAddress = contactList[i].mEmailAddress;
-                QString contactName = contactList[i].mDisplayName;
+        // Loop through all the selected contacts.
+        for (int i = 0; i < contactList.count(); ++i) {
+            QString contactEmailAddress = contactList[i].mEmailAddress;
+            QString contactName = contactList[i].mDisplayName;
 
             // If this contact has no name.
             if(contactName.isEmpty()) {				
-                // Generate custom keyevent for this contact's emailaddress.
+                // Generate a custom keyevent for this contact's emailaddress.
                 QKeyEvent contactEmailAddressKeyEvent(QEvent::KeyPress, Qt::Key_unknown, 
                 		                              Qt::NoModifier, contactEmailAddress);
-                // Forward this contactEmailAddressKeyEventt to base class to handle.
+                // Forward this contactEmailAddressKeyEvent to base class to handle.
                 NmHtmlLineEdit::keyPressEvent(&contactEmailAddressKeyEvent);
             }
             else {
-                // Handle a rare case: there's another contact has same name 
-                // but has different emailaddress.
+                // Handle a rare case: there's another contact has same name but has different emailaddress.
                 for (int i = 0; i != mContactsSelectedFromPhoneBook.count(); ++i) {
                     if (mContactsSelectedFromPhoneBook.at(i).displayName() == contactName &&
-                    	mContactsSelectedFromPhoneBook.at(i).address() != contactEmailAddress) {
+                  	    mContactsSelectedFromPhoneBook.at(i).address() != contactEmailAddress) {
                         // Differentiate this contact's name by adding a * mark
                         contactName.append("*");
                     }
                 }
                 
                 // Generate custom keyevent for this contact's name.
-                QKeyEvent contactNameKeyEvent(QEvent::KeyPress, Qt::Key_unknown, Qt::NoModifier,
-                                              contactName);
+                QKeyEvent contactNameKeyEvent(QEvent::KeyPress, Qt::Key_unknown, 
+                                              Qt::NoModifier, contactName);
                 // Forward this contactNameKeyEvent to base class to handle.
                 NmHtmlLineEdit::keyPressEvent(&contactNameKeyEvent);
             }
 
             // Generate custom keyevent for Delimiter("; ").
-            QKeyEvent delimiterKeyEvent(QEvent::KeyPress, Qt::Key_unknown, Qt::NoModifier, Delimiter);
+            QKeyEvent delimiterKeyEvent(QEvent::KeyPress, Qt::Key_unknown, 
+                                        Qt::NoModifier, Delimiter);
             // Forward the delimiterKeyEvent to base class to handle.
             NmHtmlLineEdit::keyPressEvent(&delimiterKeyEvent);
 			
@@ -123,12 +116,11 @@
             
             // Add this NmAddress formated contact into mContactsSelectedFromPhoneBook.
             mContactsSelectedFromPhoneBook.append(contact);
-            }
         }
     }
     else {
         //Request returned NULL 
-        NMLOG("Request returned NULL.");
+        NMLOG("ContactsPicker request returned NULL.");
     }
         
 }
--- a/emailuis/nmailuiwidgetsplugin/nmailuiwidgetsplugin.pro	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiwidgetsplugin/nmailuiwidgetsplugin.pro	Fri May 14 15:41:10 2010 +0300
@@ -14,19 +14,14 @@
 CONFIG += hb
 TEMPLATE = lib
 TARGET = nmailuiwidgetsplugin
-QT += core
 
-INCLUDEPATH += . \
-  ./inc \
-  ../../inc \
-  ../nmailuiwidgets/inc
+INCLUDEPATH += ./inc \
+  ../../inc
 
 HEADERS += inc/nmailuiwidgetsplugin.h
 
 SOURCES += src/nmailuiwidgetsplugin.cpp
 
-LIBS += -leuser
-
 symbian*: {
     TARGET.EPOCALLOWDLLDATA = 1
     TARGET.CAPABILITY = ALL \
@@ -45,4 +40,3 @@
     LIBS += -L../../bin \
         -lnmailuiwidgets
 }
-       
\ No newline at end of file
--- a/emailuis/nmailuiwidgetsplugin/src/nmailuiwidgetsplugin.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmailuiwidgetsplugin/src/nmailuiwidgetsplugin.cpp	Fri May 14 15:41:10 2010 +0300
@@ -16,11 +16,11 @@
 */
 
 #include "nmailuiwidgetsplugin.h"
-#include "nmrecipientlineedit.h"
-#include "nmhtmllineedit.h"
-#include "nmeditortextedit.h"
-#include "nmbaseviewscrollarea.h"
-#include "nmattachmentlistwidget.h"
+#include <nmrecipientlineedit.h>
+#include <nmhtmllineedit.h>
+#include <nmeditortextedit.h>
+#include <nmbaseviewscrollarea.h>
+#include <nmattachmentlistwidget.h>
 
 QObject *NMailUiWidgetsPlugin::createObject(const QString& type, const QString &name )
 {
--- a/emailuis/nmframeworkadapter/inc/nmframeworkadapter.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmframeworkadapter/inc/nmframeworkadapter.h	Fri May 14 15:41:10 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -18,14 +18,12 @@
 #ifndef NMFRAMEWORKADAPTER_H
 #define NMFRAMEWORKADAPTER_H
 
-
 #include <nmcommon.h>
 #include <nmdataplugininterface.h>
 #include <CFSMailCommon.h>
 #include <MFSMailEventObserver.h>
-#ifdef Q_OS_SYMBIAN
+
 #include <xqsharablefile.h>
-#endif
 
 class NmMailbox;
 class NmMessage;
@@ -39,10 +37,11 @@
 class CFSMailMessagePart;
 class NmStoreEnvelopesOperation;
 class NmAddAttachmentsOperation;
-class NmOperation;
 class NmCheckOutboxOperation;
+class NmMailboxSearchObserver;
 class NmMessageSendingOperation;
 
+
 class NmFrameworkAdapter :
     public QObject,
     public NmDataPluginInterface,
@@ -53,9 +52,9 @@
 
 public:
 
-    NmFrameworkAdapter( );
+    NmFrameworkAdapter();
 
-    ~NmFrameworkAdapter( );
+    ~NmFrameworkAdapter();
 
     int listMailboxIds(QList<NmId>& mailboxIdList);
 
@@ -79,17 +78,23 @@
             const NmId& mailboxId,
             const NmId& folderId,
             QList<NmMessageEnvelope*> &messageMetaDataList);
+    
+    int listMessages(
+            const NmId& mailboxId,
+            const NmId& folderId,
+            QList<NmMessage*> &messageList,
+            const int maxAmountOfMessages = NmMaxItemsInMessageList);
 
-    NmOperation *fetchMessage( 
+    QPointer<NmOperation> fetchMessage( 
             const NmId &mailboxId, 
             const NmId &folderId,
             const NmId &messageId);
     
-    NmOperation *fetchMessagePart( 
-        const NmId &mailboxId,
-        const NmId &folderId,
-        const NmId &messageId,
-        const NmId &messagePartId);
+    QPointer<NmOperation> fetchMessagePart( 
+            const NmId &mailboxId,
+            const NmId &folderId,
+            const NmId &messageId,
+            const NmId &messagePartId);
     
     XQSharableFile messagePartFile(
             const NmId &mailboxId,
@@ -118,33 +123,33 @@
             const NmId &folderId,
             const QList<NmId> &messageIdList);
 
-    NmStoreEnvelopesOperation *storeEnvelopes(
+    QPointer<NmStoreEnvelopesOperation> storeEnvelopes(
             const NmId &mailboxId,
             const NmId &folderId,
             const QList<const NmMessageEnvelope*> &envelopeList);
 
-    NmMessageCreationOperation *createNewMessage(
-        const NmId &mailboxId);
+    QPointer<NmMessageCreationOperation> createNewMessage(
+            const NmId &mailboxId);
 
-    NmMessageCreationOperation *createForwardMessage(
-        const NmId &mailboxId,
-        const NmId &originalMessageId);
+    QPointer<NmMessageCreationOperation> createForwardMessage(
+            const NmId &mailboxId,
+            const NmId &originalMessageId);
      
-    NmMessageCreationOperation *createReplyMessage(
-        const NmId &mailboxId,
-        const NmId &originalMessageId,
-        const bool replyAll);
+    QPointer<NmMessageCreationOperation> createReplyMessage(
+            const NmId &mailboxId,
+            const NmId &originalMessageId,
+            const bool replyAll);
     
     int saveMessage(const NmMessage &message);
 
-    NmOperation *saveMessageWithSubparts(const NmMessage &message);
+    QPointer<NmOperation> saveMessageWithSubparts(const NmMessage &message);
 
     void EventL(
-        TFSMailEvent event,
-        TFSMailMsgId mailbox,
-        TAny* param1,
-        TAny* param2,
-        TAny* param3);
+            TFSMailEvent event,
+            TFSMailMsgId mailbox,
+            TAny* param1,
+            TAny* param2,
+            TAny* param3);
 
     int removeMessage(const NmId& mailboxId, const NmId& folderId, const NmId& messageId);
     
@@ -152,15 +157,17 @@
     
     void unsubscribeMailboxEvents(const NmId& mailboxId);
 
-    NmMessageSendingOperation *sendMessage(NmMessage *message);
+    QPointer<NmMessageSendingOperation> sendMessage(NmMessage *message);
     
-    NmAddAttachmentsOperation *addAttachments(
+    QPointer<NmAddAttachmentsOperation> addAttachments(
             const NmMessage &message, 
             const QList<QString> &fileList);
 
-    NmOperation *removeAttachment(const NmMessage &message, const NmId &attachmentPartId);
+    QPointer<NmOperation> removeAttachment(
+            const NmMessage &message, 
+            const NmId &attachmentPartId);
 
-    NmCheckOutboxOperation *checkOutbox(const NmId& mailboxId);
+    QPointer<NmCheckOutboxOperation> checkOutbox(const NmId& mailboxId);
     
     NmSyncState syncState(const NmId& mailboxId) const;
     
@@ -176,9 +183,17 @@
             const NmId& folderId,
             QList<NmMessageEnvelope*> &messageMetaDataList,
             const int maxAmountOfEnvelopes);
-			
+
+    int search(const NmId &mailboxId,
+               const QStringList &searchStrings);
+
+    int cancelSearch(const NmId &mailboxId);
+
+
 signals:
+
     void mailboxEvent(NmMailboxEvent event, const QList<NmId> &mailboxIds);
+
     void messageEvent(
             NmMessageEvent event,
             const NmId &folderId,
@@ -186,24 +201,29 @@
             const NmId& mailboxId); //added to provide mailboxId
     
     void syncStateEvent(
-        NmSyncState state,
-        const NmOperationCompletionEvent &event );
+            NmSyncState state,
+            const NmOperationCompletionEvent &event );
     
-    void connectionEvent(NmConnectState state, const NmId mailboxId);
+    void connectionEvent(NmConnectState state, const NmId mailboxId, int errorCode);
+
+    void matchFound(const NmId &messageId);
+
+    void searchComplete();
+
 
 private:
     
     void getMessageByIdL(
-        const NmId& mailboxId,
-        const NmId& folderId,
-        const NmId& messageId,
-        NmMessage*& message);
+            const NmId& mailboxId,
+            const NmId& folderId,
+            const NmId& messageId,
+            NmMessage*& message);
 
     void contentToMessagePartL(
-        const NmId &mailboxId,
-        const NmId &folderId,
-        const NmId &messageId,
-        NmMessagePart &messagePart);
+            const NmId &mailboxId,
+            const NmId &folderId,
+            const NmId &messageId,
+            NmMessagePart &messagePart);
         
     void listMessagesL(  
             const NmId &mailboxId,
@@ -211,6 +231,17 @@
             QList<NmMessageEnvelope*> &messageMetaDataList, 
             const int maxAmountOfEnvelopes);
     
+    void listMessagesL(  
+            const NmId &mailboxId,
+            const NmId &folderId,
+            QList<NmMessage*> &messageList, 
+            const int maxAmountOfMessages);
+
+    void searchL(const NmId &mailboxId,
+                 const QList<NmId> &folderIds,
+                 const QStringList &searchStrings,
+                 NmMailboxSearchObserver &searchObserver);
+
     NmId getMailboxIdByMailMsgId(TFSMailMsgId mailbox);
 
     void removeMessageL(const NmId& mailboxId,
@@ -245,10 +276,13 @@
 	void getFolderByIdL(
             const NmId& mailboxId, 
             const NmId& folderId, 
-            NmFolder*& unreadCount );		
-	
-private:
-    CFSMailClient*  mFSfw;//singleton, not owned
+            NmFolder*& unreadCount );
+
+
+private: // Data
+
+    CFSMailClient* mFSfw; // Singleton, not owned
+    NmMailboxSearchObserver *mSearchObserver; // Owned
 };
 
 
--- a/emailuis/nmframeworkadapter/inc/nmframeworkadapterheaders.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmframeworkadapter/inc/nmframeworkadapterheaders.h	Fri May 14 15:41:10 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -23,13 +23,22 @@
 #include <QByteArray>
 #include <QTextCodec>
 #include <QRegExp>
+#include <QStringList>
 #include <QTimer>
-#ifdef Q_OS_SYMBIAN
+#include <QPointer>
+
 #include <xqsharablefile.h>
-#endif
-// Orbit
+
+// Symbian
+#include <utf.h> 
 
-// nmailuiengine
+// nmailuiengine 
+#include <nmoperation.h>
+#include <nmstoreenvelopesoperation.h>
+#include <nmcheckoutboxoperation.h>
+#include <nmmessagesendingoperation.h>
+#include <nmaddattachmentsoperation.h>
+#include <nmmessagecreationoperation.h>
 
 // nmailbase
 #include <nmmailbox.h>
@@ -37,24 +46,24 @@
 #include <nmmessageenvelope.h>
 #include <nmmessage.h>
 #include <nmconverter.h>
+
+// emailcommon
 #include <nmcleanuputils.h>
-#include <nmstoreenvelopesoperation.h>
-#include <nmcheckoutboxoperation.h>
 
 // nmframeworkadapter
 #include "nmframeworkadapter.h"
-#include "nmfwamessagefetchingoperation.h"
+#include "nmfwaaddattachmentsoperation.h"
+#include "nmfwaremoveattachmentoperation.h"
+#include "nmfwacheckoutboxoperation.h"
 #include "nmfwamessagecreationoperation.h"
 #include "nmfwaforwardmessagecreationoperation.h"
 #include "nmfwareplymessagecreationoperation.h"
-#include "nmfwastoreenvelopesoperation.h"
+#include "nmfwamessagefetchingoperation.h"
+#include "nmfwamessagepartfetchingoperation.h"
 #include "nmfwamessagesendingoperation.h"
-#include "nmfwaaddattachmentsoperation.h"
-#include "nmfwaremoveattachmentoperation.h"
+#include "nmfwastoreenvelopesoperation.h"
 #include "nmfwastoremessageoperation.h"
-#include "nmfwacheckoutboxoperation.h"
-#include "nmfwamessagesendingoperation.h"
-#include "nmfwamessagepartfetchingoperation.h"
+#include "nmmailboxsearchobserver.h"
 
 // fs email
 #include <CFSMailCommon.h>
@@ -62,10 +71,10 @@
 #include <CFSMailRequestObserver.h>
 #include <CFSMailFolder.h>
 #include <CFSMailBox.h>
+#include <MFSMailBoxSearchObserver.h>
 #include <MFSMailIterator.h>
 
-//Symbian
-#include <utf.h> 
+
 
 
 #endif /* NMFRAMEWORKADAPTERHEADERS_H_ */
--- a/emailuis/nmframeworkadapter/inc/nmfwaaddattachmentsoperation.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmframeworkadapter/inc/nmfwaaddattachmentsoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -25,36 +25,34 @@
 
 class NmMessage;
 class CFSMailClient;
+class CFSMailMessage;
 
 class NmFwaAddAttachmentsOperation : public NmAddAttachmentsOperation,
                                      public MFSMailRequestObserver
 {
     Q_OBJECT
+    
 public:
     NmFwaAddAttachmentsOperation(const NmMessage &message,
                                  const QList<QString> &fileList,
                                  CFSMailClient &mailClient);
-    
-    virtual ~NmFwaAddAttachmentsOperation();
 
 public: // from MFSMailRequestObserver
-    virtual void RequestResponseL(TFSProgress aEvent, TInt aRequestId);
+    void RequestResponseL(TFSProgress aEvent, TInt aRequestId);
     
 protected:
-    virtual void doRunAsyncOperation();
-    virtual void doCancelOperation();
+    void doRunAsyncOperation();
+    void doCancelOperation();
 
 private:
+    ~NmFwaAddAttachmentsOperation();
     void doRunAsyncOperationL();	
 
 private:
-    const NmMessage &mMessage;
-
+    TInt mRequestId;
     QList<QString> mFileList;
-    
     CFSMailClient &mMailClient;
-    
-    QList<int> mRequestIds;
+    CFSMailMessage *mFSMessage;
 };
 
 #endif /* NMFWAADDATTACHMENTSOPERATION_H_ */
--- a/emailuis/nmframeworkadapter/inc/nmfwacheckoutboxoperation.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmframeworkadapter/inc/nmfwacheckoutboxoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -31,24 +31,19 @@
         const NmId &mailboxId,
         CFSMailClient &mailClient);
     
-    virtual ~NmFwaCheckOutboxOperation();
-    
-    virtual bool getMessageId(NmId &messageId) const;
+    bool getMessageId(NmId &messageId) const;
 
 private:
-    virtual void doRunAsyncOperation();
+    void doRunAsyncOperation();
+    void doRunAsyncOperationL();
+    ~NmFwaCheckOutboxOperation();
     
 private:
-    void doRunAsyncOperationL();
-
-private:
     NmId mMailboxId;
+    CFSMailClient &mMailClient;
+    bool mFound;
+    NmId mMessageId;
 
-    CFSMailClient &mMailClient;
-
-    bool mFound;
-
-    NmId mMessageId;
 };
 
 #endif /* NMFWACHECKOUTBOXOPERATION_H_ */
--- a/emailuis/nmframeworkadapter/inc/nmfwaforwardmessagecreationoperation.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmframeworkadapter/inc/nmfwaforwardmessagecreationoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -28,12 +28,12 @@
         const NmId &mailboxId,
         const NmId &originalMessageId,
         CFSMailClient &mailClient);
-    
-    ~NmFwaForwardMessageCreationOperation();
-    
+       
 protected:
     void doRunAsyncOperation();
-    
+private:
+    ~NmFwaForwardMessageCreationOperation();
+   
 private:
     NmId mOriginalMessageId;
 };
--- a/emailuis/nmframeworkadapter/inc/nmfwamessagecreationoperation.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmframeworkadapter/inc/nmfwamessagecreationoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -23,7 +23,6 @@
 #include <CFSMailCommon.h>
 #include <MFSMailRequestObserver.h>
 
-class NmTestPlugin;
 class NmMessage;
 class CFSMailClient;
 
@@ -35,32 +34,24 @@
     NmFwaMessageCreationOperation(
         const NmId &mailboxId,
         CFSMailClient &mailClient);
-    
-    virtual ~NmFwaMessageCreationOperation();
-    
+       
     NmMessage *getMessage();
     NmId getMessageId();
 
-// from MFSMailRequestObserver
-
-    virtual void RequestResponseL(TFSProgress aEvent, TInt aRequestId);
+    // from MFSMailRequestObserver
+    void RequestResponseL(TFSProgress aEvent, TInt aRequestId);
 
 protected:
-    virtual void doRunAsyncOperation();
-    
-protected:
+    virtual void doRunAsyncOperation();    
     virtual void doCompleteOperation();
-
     virtual void doCancelOperation();
-
+    virtual ~NmFwaMessageCreationOperation();
 protected:
     NmId mMailboxId;
-
-    NmMessage *mMessage;
+    NmMessage *mMessage;   
+    CFSMailClient &mMailClient;   
+    TInt mRequestId;
     
-    CFSMailClient &mMailClient;
-    
-    TInt mRequestId;
 };
 
 #endif /* NMFAMESSAGECREATIONOPERATION_H_ */
--- a/emailuis/nmframeworkadapter/inc/nmfwamessagefetchingoperation.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmframeworkadapter/inc/nmfwamessagefetchingoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -32,27 +32,23 @@
         const NmId &mailboxId,
         const NmId &folderId,
         const NmId &messageId,
-        CFSMailClient &mailClient,
-        QObject *parent = NULL);
-    
-    ~NmFwaMessageFetchingOperation();
+        CFSMailClient &mailClient);
     
     // from MFSMailRequestObserver
     void RequestResponseL(TFSProgress aEvent, TInt aRequestId);
 
 protected:
-    virtual void doRunAsyncOperation();
+    void doRunAsyncOperation();
+    void doCancelOperation();
     
-protected:
-    virtual void doCancelOperation();
-
-protected:
+private:
+    ~NmFwaMessageFetchingOperation();
+    
+private:
     NmId mMailboxId;
     NmId mFolderId;
     NmId mMessageId;
-
-    CFSMailClient &mMailClient;
-    
+    CFSMailClient &mMailClient;  
     TInt mRequestId;
 };
 
--- a/emailuis/nmframeworkadapter/inc/nmfwamessagepartfetchingoperation.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmframeworkadapter/inc/nmfwamessagepartfetchingoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -33,33 +33,26 @@
         const NmId &folderId,
         const NmId &messageId,
         const NmId &messagePartId,
-        CFSMailClient &mailClient,
-        QObject *parent = NULL);
-    
-    virtual ~NmFwaMessagePartFetchingOperation();
+        CFSMailClient &mailClient);
     
     // from MFSMailRequestObserver
     void RequestResponseL(TFSProgress aEvent, TInt aRequestId);
 
 protected:
     void doRunAsyncOperation();
-    
-protected:
     void doCancelOperation();
     
 private:
+    ~NmFwaMessagePartFetchingOperation();
     void doRunAsyncOperationL();
 
 private:
     NmId mMailboxId;
     NmId mFolderId;
     NmId mMessageId;
-    NmId mMessagePartId;
-    
-    CFSMailClient &mMailClient;
-    
-    int mLastProgressValue;
-    
+    NmId mMessagePartId;   
+    CFSMailClient &mMailClient;  
+    int mLastProgressValue;   
     TInt mRequestId;
 };
 
--- a/emailuis/nmframeworkadapter/inc/nmfwamessagesendingoperation.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmframeworkadapter/inc/nmfwamessagesendingoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -18,7 +18,7 @@
 #ifndef NMFWAMESSAGESENDINGOPERATION_H_
 #define NMFWAMESSAGESENDINGOPERATION_H_
 
-#include <QObject>
+#include <QPointer>
 #include <nmmessagesendingoperation.h>
 #include <nmcommon.h>
 #include <CFSMailCommon.h>
@@ -37,8 +37,6 @@
                                  NmMessage *message,
                                  CFSMailClient &mailClient);
     
-    ~NmFwaMessageSendingOperation();
-
     const NmMessage *getMessage() const;
 
     // from MFSMailRequestObserver
@@ -53,13 +51,14 @@
     void doCancelOperation();
 
 private:
+    ~NmFwaMessageSendingOperation();
     int saveMessageWithSubparts();
     int sendMessageL();
 
 private:
     NmDataPluginInterface &mPluginInterface;
-    NmOperation *mSaveOperation;    // Owned
-    NmMessage *mMessage;            // Owned
+    QPointer<NmOperation> mSaveOperation;    // Not owned
+    NmMessage *mMessage;                     // Owned
     CFSMailClient &mMailClient;
     TInt mRequestId;
     bool mSaved;
--- a/emailuis/nmframeworkadapter/inc/nmfwaremoveattachmentoperation.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmframeworkadapter/inc/nmfwaremoveattachmentoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -34,20 +34,17 @@
     NmFwaRemoveAttachmentOperation(const NmMessage &message,
                                    const NmId &attachmentPartId,
                                    CFSMailClient &mailClient);
-    
-    virtual ~NmFwaRemoveAttachmentOperation();
 
 public: // from MFSMailRequestObserver
-    virtual void RequestResponseL(TFSProgress aEvent, TInt aRequestId);
+    void RequestResponseL(TFSProgress aEvent, TInt aRequestId);
     
 protected:
-    virtual void doRunAsyncOperation();
-
-protected:
-    virtual void doCancelOperation();
+    void doRunAsyncOperation();
+    void doCancelOperation();
     
 private:
 	void doRunAsyncOperationL();
+    ~NmFwaRemoveAttachmentOperation();
     
 private:
     const NmMessage &mMessage;
--- a/emailuis/nmframeworkadapter/inc/nmfwareplymessagecreationoperation.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmframeworkadapter/inc/nmfwareplymessagecreationoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -30,12 +30,13 @@
         const bool replyAll,
         CFSMailClient &mailClient);
     
-    ~NmFwaReplyMessageCreationOperation();
-    
 protected:
     void doRunAsyncOperation();
     
 private:
+    ~NmFwaReplyMessageCreationOperation();
+    
+private:
     NmId mOriginalMessageId;
     bool mReplyAll;
 };
--- a/emailuis/nmframeworkadapter/inc/nmfwastoreenvelopesoperation.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmframeworkadapter/inc/nmfwastoreenvelopesoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -34,16 +34,15 @@
             RPointerArray<CFSMailMessage> messages,
             CFSMailClient &mailClient);
     
-    virtual ~NmFwaStoreEnvelopesOperation();
-    
     // from MFSMailRequestObserver
     void RequestResponseL(TFSProgress aEvent, TInt aRequestId);
 
 protected:
     void doRunAsyncOperation();
+    void doCancelOperation();
     
-protected:
-    void doCancelOperation();
+private:
+    ~NmFwaStoreEnvelopesOperation();
 
 private:
     NmId                            mMailboxId;
--- a/emailuis/nmframeworkadapter/inc/nmfwastoremessageoperation.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmframeworkadapter/inc/nmfwastoremessageoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -34,19 +34,15 @@
 			CFSMailMessage *messages,
             CFSMailClient &mailClient);
     
-    virtual ~NmFwaStoreMessageOperation();
-    
-    virtual void RequestResponseL(TFSProgress aEvent, TInt aRequestId);
+    void RequestResponseL(TFSProgress aEvent, TInt aRequestId);
 
 protected:
-    virtual void doRunAsyncOperation();
-    
-protected:
-    virtual void doCompleteOperation();
-    virtual void doCancelOperation();
+    void doRunAsyncOperation();
+    void doCompleteOperation();
+    void doCancelOperation();
 
 private:
-    
+    ~NmFwaStoreMessageOperation();
     enum TStatus
         {
         EStoreHeader,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmframeworkadapter/inc/nmmailboxsearchobserver.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,58 @@
+/*
+* 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 NMMAILBOXSEARCHOBSERVER_H_
+#define NMMAILBOXSEARCHOBSERVER_H_
+
+#include <QObject>
+#include <MFSMailBoxSearchObserver.h>
+
+class NmId;
+
+
+class NmMailboxSearchObserver : public QObject,
+                                public MFSMailBoxSearchObserver
+{
+    Q_OBJECT
+
+public:
+
+    NmMailboxSearchObserver();
+
+    ~NmMailboxSearchObserver();
+
+
+public: // From MFSMailboxSearchObserver
+
+    void MatchFoundL(CFSMailMessage *aMatchMessage);
+
+    void SearchCompletedL();
+
+    void ClientRequiredSearchPriority(TInt *apRequiredSearchPriority); 
+    
+    
+signals:
+
+    void matchFound(const NmId &messageId);
+
+    void searchComplete();
+};
+
+
+#endif /* NMMAILBOXSEARCHOBSERVER_H_ */
+
+// End of file.
--- a/emailuis/nmframeworkadapter/nmframeworkadapter.pro	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmframeworkadapter/nmframeworkadapter.pro	Fri May 14 15:41:10 2010 +0300
@@ -13,16 +13,20 @@
 #
 # Description: 
 #
-# Version : %version: 24 %
+# Version : %version: 26 %
 TEMPLATE = lib
 TARGET = nmframeworkadapter
 
 CONFIG += plugin
 DEFINES += BUILD_DLL
 
-INCLUDEPATH += ../../inc
+MOC_DIR = ./moc
+
+INCLUDEPATH += ./moc \
+               ../../inc \
 
 HEADERS += inc/nmframeworkadapter.h \
+           inc/nmframeworkadapterheaders.h \
            inc/nmfwamessagefetchingoperation.h \
            inc/nmfwamessagecreationoperation.h \
            inc/nmfwastoreenvelopesoperation.h \
@@ -33,7 +37,8 @@
            inc/nmfwaremoveattachmentoperation.h \
            inc/nmfwastoremessageoperation.h \
            inc/nmfwacheckoutboxoperation.h \
-           inc/nmfwamessagepartfetchingoperation.h
+           inc/nmfwamessagepartfetchingoperation.h \
+           inc/nmmailboxsearchobserver.h
 
 SOURCES += src/nmframeworkadapter.cpp \
            src/nmfwamessagefetchingoperation.cpp \
@@ -46,7 +51,8 @@
            src/nmfwaremoveattachmentoperation.cpp \
            src/nmfwastoremessageoperation.cpp \
            src/nmfwacheckoutboxoperation.cpp \
-           src/nmfwamessagepartfetchingoperation.cpp
+           src/nmfwamessagepartfetchingoperation.cpp \
+           src/nmmailboxsearchobserver.cpp
 
 RESOURCES +=
 
@@ -65,20 +71,20 @@
     pluginstub.path = /resource/plugins
     DEPLOYMENT += pluginstub
 
-	TARGET.EPOCHEAPSIZE = 0x20000 0x1000000
+    TARGET.EPOCHEAPSIZE = 0x20000 0x1000000
     TARGET.EPOCALLOWDLLDATA = 1
     TARGET.CAPABILITY = CAP_GENERAL_DLL
     TARGET.UID2 = 0x1000008D
     TARGET.UID3 = 0x20027019
 
-	LIBS += -lnmailbase
-	LIBS += -lnmailuiengine
-	LIBS += -lfsmailframework
-	LIBS += -lfsfwcommonlib
-	LIBS += -lcharconv
+    LIBS += -lnmailbase
+    LIBS += -lnmailuiengine
+    LIBS += -lfsmailframework
+    LIBS += -lfsfwcommonlib
+    LIBS += -lcharconv
     LIBS += -lxqserviceutil 
 
-	BLD_INF_RULES.prj_exports += \
+    BLD_INF_RULES.prj_exports += \
     "../rom/nmframeworkadapter.iby             CORE_APP_LAYER_IBY_EXPORT_PATH(nmframeworkadapter.iby)"
 
 }
@@ -90,4 +96,4 @@
         -lnmailbase
 }
 
-
+# End of file.
--- a/emailuis/nmframeworkadapter/src/nmframeworkadapter.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmframeworkadapter/src/nmframeworkadapter.cpp	Fri May 14 15:41:10 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -29,21 +29,26 @@
     Also events coming from emailframework are converted and emitted as signals.
  */
 
-static const int nmListMessagesBlock = 100;
-static const int nmMaxItemsInMessageList = 1000;
+static const int NmListMessagesBlock = 100;
+
 
 
 /*!
     Constructor
 */
-NmFrameworkAdapter::NmFrameworkAdapter( ) : mFSfw(NULL)
+NmFrameworkAdapter::NmFrameworkAdapter()
+: mFSfw(NULL),
+  mSearchObserver(NULL)
 {
     NMLOG("NmFrameworkAdapter::NmFrameworkAdapter() <---");
-    // get s60email framework
+
+    // get s60 email framework
     TRAP_IGNORE(mFSfw = CFSMailClient::NewL());
-    if(mFSfw){
+
+    if (mFSfw) {
         TRAP_IGNORE(mFSfw->AddObserverL(*this));
-        }
+    }
+
     NMLOG("NmFrameworkAdapter::NmFrameworkAdapter() --->");
 }
 
@@ -52,10 +57,15 @@
 */
 NmFrameworkAdapter::~NmFrameworkAdapter()
 {
-    if(mFSfw){
+    if (mSearchObserver) {
+        delete mSearchObserver;
+        mSearchObserver = NULL;
+    }
+
+    if (mFSfw) {
         mFSfw->RemoveObserver(*this);
         mFSfw->Close();
-        }
+    }
 
     mFSfw = NULL;
 }
@@ -281,7 +291,7 @@
     const NmId &folderId,
     QList<NmMessageEnvelope*> &messageEnvelopeList)
 {
-    TRAPD(err, listMessagesL(mailboxId,folderId,messageEnvelopeList, nmMaxItemsInMessageList));
+    TRAPD(err, listMessagesL(mailboxId,folderId,messageEnvelopeList, NmMaxItemsInMessageList));
     return err;
 }
 
@@ -314,12 +324,12 @@
         return;
         }
 
-    int blockSize = nmListMessagesBlock;
-    int maxLimit = nmMaxItemsInMessageList;
-    if( maxAmountOfEnvelopes < nmMaxItemsInMessageList )
+    int blockSize = NmListMessagesBlock;
+    int maxLimit = NmMaxItemsInMessageList;
+    if( maxAmountOfEnvelopes < NmMaxItemsInMessageList )
         {
         maxLimit = maxAmountOfEnvelopes;
-        if(maxAmountOfEnvelopes < nmListMessagesBlock)
+        if(maxAmountOfEnvelopes < NmListMessagesBlock)
             {
             blockSize = maxAmountOfEnvelopes;
             }
@@ -387,6 +397,223 @@
     CleanupStack::PopAndDestroy(currentMailbox);
 }
 
+/*! 
+    Returns list of messages from the backend for specific mailbox and folder.
+
+    \param mailboxId Id of the mailbox containing the folder.
+    \param folderId Folder id.
+    \param messageMetaDataList Reference to pointer list to receive the envelope objects,
+     ownership is transferred.
+
+    \return Error code.
+ */
+int NmFrameworkAdapter::listMessages(
+    const NmId &mailboxId,
+    const NmId &folderId,
+    QList<NmMessage*> &messageList,
+    const int maxAmountOfMessages)
+{
+    TRAPD(err, listMessagesL(mailboxId,folderId,messageList, maxAmountOfMessages));
+    return err;
+}
+
+/*!
+    Leaving version of list messages with NmMessageList input
+ */
+void NmFrameworkAdapter::listMessagesL(
+        const NmId &mailboxId,
+        const NmId &folderId,
+        QList<NmMessage*> &messageList,
+        const int maxAmountOfEnvelopes)
+{
+    CFSMailBox * currentMailbox(NULL);
+    CFSMailFolder* folder(NULL);
+
+    //If we are requesting 0 or less mails so we can return
+    if( maxAmountOfEnvelopes <= 0)
+        {
+        return;
+        }
+
+    int blockSize = NmListMessagesBlock;
+    int maxLimit = NmMaxItemsInMessageList;
+    if( maxAmountOfEnvelopes < NmMaxItemsInMessageList )
+        {
+        maxLimit = maxAmountOfEnvelopes;
+        if(maxAmountOfEnvelopes < NmListMessagesBlock)
+            {
+            blockSize = maxAmountOfEnvelopes;
+            }
+        }
+   
+
+    currentMailbox = mFSfw->GetMailBoxByUidL(mailboxId);
+    if (!currentMailbox) {
+        User::Leave(KErrNotFound);
+    }
+    CleanupStack::PushL(currentMailbox);
+    folder = mFSfw->GetFolderByUidL(currentMailbox->GetId(), TFSMailMsgId(folderId));
+
+    if (folder) {
+        CleanupStack::PushL(folder);
+        // First prepare all the parameters
+        // select message details to be listed
+        TFSMailDetails details(EFSMsgDataEnvelope);
+
+        // set sorting criteria
+        TFSMailSortCriteria criteria;
+        criteria.iField = EFSMailSortByDate;
+        criteria.iOrder = EFSMailDescending;
+        RArray<TFSMailSortCriteria> sorting;
+        CleanupClosePushL(sorting);
+        sorting.Append(criteria);
+
+        TFSMailMsgId currentMessageId; // first call contains NULL id as begin id
+        // get messages list from the backend
+        MFSMailIterator* iterator(NULL);
+
+        iterator = folder->ListMessagesL(details, sorting);
+        if (iterator) {
+            CleanupStack::PushL(iterator);
+            RPointerArray<CFSMailMessage> messages;
+            CleanupResetAndDestroy<CFSMailMessage>::PushL(messages);
+
+            //Message list is fetched in blocks to prevent OOM in protocol plugin side
+            bool moreMessagesToFollow(false);
+            moreMessagesToFollow = iterator->NextL(
+                TFSMailMsgId(), blockSize, messages);
+            for ( int i = blockSize;
+                  i < maxLimit && moreMessagesToFollow ;
+                  i += blockSize ) {
+                moreMessagesToFollow = iterator->NextL(
+                    messages[i-1]->GetMessageId(), blockSize, messages);
+                
+            }
+
+            //Add all found emails to the result list
+            for(TInt i=0; i<messages.Count(); i++) {
+                NmMessage* newMessage(NULL);
+                newMessage = messages[i]->GetNmMessage();
+                if (newMessage) {
+					//Add content of message
+                    NmMessagePart *plainTextPart = newMessage->plainTextBodyPart();
+                    if (plainTextPart) {
+                        contentToMessagePart(mailboxId, folderId, newMessage->envelope().messageId(),
+                                             *plainTextPart);
+                    }
+                    messageList.append(newMessage);
+                }
+            }
+            
+            CleanupStack::PopAndDestroy( &messages );
+            CleanupStack::Pop(iterator);
+            delete iterator;
+            iterator = NULL;
+        }
+        CleanupStack::PopAndDestroy(); // sorting
+        CleanupStack::PopAndDestroy(folder);
+    }
+    CleanupStack::PopAndDestroy(currentMailbox);
+}
+
+/*!
+    Starts an asynchronous search for messages with the given search strings.
+    This is part of the public interface.
+
+    \see NmFrameworkAdapter::searchL().
+
+    \param mailboxId The mailbox to search from.
+    \param searchStrings The strings to search.
+
+    \return A possible error code.
+*/
+int NmFrameworkAdapter::search(const NmId &mailboxId,
+                               const QStringList &searchStrings)
+{
+    if (!mSearchObserver) {
+        mSearchObserver = new NmMailboxSearchObserver();
+    }
+
+    // Set connections for forwarding the signals emitted by the search
+    // observer.
+    connect(mSearchObserver, SIGNAL(matchFound(const NmId &)),
+            this, SIGNAL(matchFound(const NmId &)), Qt::UniqueConnection);
+    connect(mSearchObserver, SIGNAL(searchComplete()),
+            this, SIGNAL(searchComplete()), Qt::UniqueConnection);
+
+    TRAPD(err, searchL(mailboxId, QList<NmId>(), searchStrings, *mSearchObserver));
+    return err;
+}
+
+
+/*!
+    Cancels the search if one is ongoing.
+
+    \param mailboxId The ID of the mailbox running the search.
+
+    \return A possible error code.
+*/
+int NmFrameworkAdapter::cancelSearch(const NmId &mailboxId)
+{
+    // Get the mailbox with the given ID.
+    CFSMailBox *mailbox(NULL);
+    TRAPD(err, mailbox = mFSfw->GetMailBoxByUidL(mailboxId));
+
+    if (err == KErrNone && mailbox) {
+        mailbox->CancelSearch();
+    }
+
+    return err;
+}
+
+
+/*!
+    Starts an asynchronous search for messages with the given search strings.
+
+    \param mailboxId The mailbox to search from.
+    \param folderIds (not used)
+    \param searchStrings The strings to search. 
+    \param searchObserver The observer which gets informed about the progress
+                          of the search (match found, search complete etc.)
+*/
+void NmFrameworkAdapter::searchL(const NmId &mailboxId,
+                                 const QList<NmId> &folderIds,
+                                 const QStringList &searchStrings,
+                                 NmMailboxSearchObserver &searchObserver)
+{
+    // CFSMailBox has no support for search using folder IDs.
+    Q_UNUSED(folderIds); 
+
+    // Get the mailbox with the given ID.
+    CFSMailBox *mailbox(NULL);
+    mailbox = mFSfw->GetMailBoxByUidL(mailboxId);
+
+    if (mailbox) {
+        RPointerArray<TDesC> strings;
+        CleanupResetAndDestroy<TDesC>::PushL(strings);
+
+        // Convert the search strings to HBufCs.
+        foreach (QString string, searchStrings) {
+            HBufC *buffer = NmConverter::qstringToHBufCLC(string);
+            strings.AppendL(buffer);
+            CleanupStack::Pop(buffer);
+        }
+
+        // Show results in ascending date/time order.
+        TFSMailSortCriteria sortCriteria;
+        sortCriteria.iField = EFSMailSortByDate;
+        sortCriteria.iOrder = EFSMailAscending;
+
+        // Start the search.
+        mailbox->SearchL(strings, sortCriteria, searchObserver);
+
+        // Clean up.
+        strings.ResetAndDestroy();
+        CleanupStack::Pop(&strings);
+    }
+}
+
+
 /*!
     Starts a message fetching operation.
 
@@ -396,7 +623,7 @@
 
     \return An NmOperation object for the operation, ownership is transferred to caller
  */
-NmOperation *NmFrameworkAdapter::fetchMessage(
+QPointer<NmOperation> NmFrameworkAdapter::fetchMessage(
     const NmId &mailboxId,
     const NmId &folderId,
     const NmId &messageId )
@@ -415,13 +642,13 @@
 
     \return An NmOperation object for the operation, ownership is transferred to caller
  */
-NmOperation *NmFrameworkAdapter::fetchMessagePart( 
+QPointer<NmOperation> NmFrameworkAdapter::fetchMessagePart( 
     const NmId &mailboxId,
     const NmId &folderId,
     const NmId &messageId,
     const NmId &messagePartId)
 {
-    NmOperation *oper = new NmFwaMessagePartFetchingOperation(
+    QPointer<NmOperation> oper = new NmFwaMessagePartFetchingOperation(
             mailboxId, folderId, messageId, messagePartId, *mFSfw);
     return oper;
 }
@@ -625,7 +852,7 @@
                 QByteArray msgBytes = QByteArray(reinterpret_cast<const char*>(dataPtr.Ptr()), fileSize);
                 QTextCodec *codec = QTextCodec::codecForName(charset.toAscii());
                 if (!codec) {
-                    codec = QTextCodec::codecForName("iso-8859-1");
+                    codec = QTextCodec::codecForName("UTF-8");
                 }
                 QString encodedStr = codec->toUnicode(msgBytes); 
                 messagePart.setTextContent(encodedStr, contentType);           
@@ -685,7 +912,7 @@
 
     \return NmStoreEnvelopesOperation
  */
-NmStoreEnvelopesOperation *NmFrameworkAdapter::storeEnvelopes(
+QPointer<NmStoreEnvelopesOperation> NmFrameworkAdapter::storeEnvelopes(
 	const NmId &mailboxId,
 	const NmId &folderId,
 	const QList<const NmMessageEnvelope*> &envelopeList)
@@ -693,15 +920,15 @@
     Q_UNUSED(folderId);
     NMLOG("NmFrameworkAdapter::storeEnvelopes() <---");
 
-    NmStoreEnvelopesOperation* operation(NULL);
+    QPointer<NmStoreEnvelopesOperation> operation(NULL);
     RPointerArray<CFSMailMessage> envelopeMessages;
 
     int count = envelopeList.count();
-    for(int i=0;i<count;i++) {
-        TRAP_IGNORE( envelopeMessages.AppendL(mailMessageFromEnvelopeL( *envelopeList.at(i)) ));
+    for(int i(0); i < count; i++) {
+        TRAP_IGNORE(envelopeMessages.AppendL(mailMessageFromEnvelopeL(*envelopeList.at(i))));
     }
 
-    if ( envelopeMessages.Count() ) {
+    if (envelopeMessages.Count()) {
         operation = new NmFwaStoreEnvelopesOperation(
                 mailboxId,
                 envelopeMessages,
@@ -719,9 +946,9 @@
 
     \return NmMessageCreationOperation
  */
-NmMessageCreationOperation *NmFrameworkAdapter::createNewMessage(const NmId &mailboxId)
+QPointer<NmMessageCreationOperation> NmFrameworkAdapter::createNewMessage(const NmId &mailboxId)
 {
-    NmMessageCreationOperation *oper =
+    QPointer<NmMessageCreationOperation> oper =
         new NmFwaMessageCreationOperation(mailboxId, *mFSfw);
     return oper;
 }
@@ -734,11 +961,11 @@
 
     \return NmMessageCreationOperation
  */
-NmMessageCreationOperation *NmFrameworkAdapter::createForwardMessage(
+QPointer<NmMessageCreationOperation> NmFrameworkAdapter::createForwardMessage(
     const NmId &mailboxId,
     const NmId &originalMessageId)
 {
-    NmMessageCreationOperation *oper =
+    QPointer<NmMessageCreationOperation> oper =
         new NmFwaForwardMessageCreationOperation(mailboxId, originalMessageId, *mFSfw);
     return oper;
 }
@@ -752,12 +979,12 @@
 
     \return NmMessageCreationOperation
  */
-NmMessageCreationOperation *NmFrameworkAdapter::createReplyMessage(
+QPointer<NmMessageCreationOperation> NmFrameworkAdapter::createReplyMessage(
     const NmId &mailboxId,
     const NmId &originalMessageId,
     const bool replyAll)
 {
-    NmMessageCreationOperation *oper =
+    QPointer<NmMessageCreationOperation> oper =
         new NmFwaReplyMessageCreationOperation(mailboxId, originalMessageId, replyAll, *mFSfw);
     return oper;
 }
@@ -774,10 +1001,10 @@
 /*!
     Store asynchronously message with its parts.
  */
-NmOperation* NmFrameworkAdapter::saveMessageWithSubparts(const NmMessage &message)
+QPointer<NmOperation> NmFrameworkAdapter::saveMessageWithSubparts(const NmMessage &message)
 {
     CFSMailMessage * cfsMessage = NULL;
-    NmOperation *oper = NULL;
+    QPointer<NmOperation> oper(NULL);
 
     int err = KErrNone;
     TRAP(err, cfsMessage = CFSMailMessage::NewL(message));
@@ -874,13 +1101,25 @@
 
         case TFSEventMailboxOnline:{
             NmId id = NmConverter::mailMsgIdToNmId(mailbox);
-            emit connectionEvent(Connected, id);
+            emit connectionEvent(Connected, id, NmNoError);
             }
             break;
-        case TFSEventMailboxOffline:{
+            
+        // param1: errorcode
+        case TFSEventMailboxOffline: {
             NmId id = NmConverter::mailMsgIdToNmId(mailbox);
-            emit connectionEvent(Disconnected, id);
+            TInt error(KErrNone);
+            // if param1 is set, and it is != KErrNone, an unexpected offline event has occurred
+            if(param1) {
+                error=*(static_cast<TInt*>(param1));
             }
+            if(error) {
+                emit connectionEvent(Disconnected, id, NmConnectionError);
+            }
+            else {
+                emit connectionEvent(Disconnected, id, NmNoError);
+            }
+			}
             break;
 
         default:
@@ -964,41 +1203,41 @@
 /*!
    Sends the given message.
  */
-NmMessageSendingOperation *NmFrameworkAdapter::sendMessage(
+QPointer<NmMessageSendingOperation> NmFrameworkAdapter::sendMessage(
     NmMessage *message)
 {
-    NmMessageSendingOperation *oper = new NmFwaMessageSendingOperation(*this, message, *mFSfw);
+    QPointer<NmMessageSendingOperation>oper = new NmFwaMessageSendingOperation(*this, message, *mFSfw);
 	return oper;
 }
 
 /*!
    Add attachment into the given message.
  */
-NmAddAttachmentsOperation *NmFrameworkAdapter::addAttachments(
+QPointer<NmAddAttachmentsOperation> NmFrameworkAdapter::addAttachments(
     const NmMessage &message,
     const QList<QString> &fileList)
 {
-    NmAddAttachmentsOperation *oper = new NmFwaAddAttachmentsOperation(message, fileList, *mFSfw);
+    QPointer<NmAddAttachmentsOperation>oper = new NmFwaAddAttachmentsOperation(message, fileList, *mFSfw);
     return oper;
 }
 
 /*!
    Remove attachment from the given message.
  */
-NmOperation *NmFrameworkAdapter::removeAttachment(
+QPointer<NmOperation> NmFrameworkAdapter::removeAttachment(
     const NmMessage &message,
     const NmId &attachmentPartId)
 {
-    NmOperation *oper = new NmFwaRemoveAttachmentOperation(message, attachmentPartId, *mFSfw);
+    QPointer<NmOperation> oper = new NmFwaRemoveAttachmentOperation(message, attachmentPartId, *mFSfw);
     return oper;
 }
 
 /*!
    Checks outbox for messages
  */
-NmCheckOutboxOperation *NmFrameworkAdapter::checkOutbox(const NmId& mailboxId)
+QPointer<NmCheckOutboxOperation> NmFrameworkAdapter::checkOutbox(const NmId& mailboxId)
 {
-    NmCheckOutboxOperation *oper =
+    QPointer<NmCheckOutboxOperation> oper =
         new NmFwaCheckOutboxOperation(mailboxId, *mFSfw);
 
     return oper;
@@ -1230,6 +1469,7 @@
     TSSMailSyncState* state = static_cast<TSSMailSyncState*>( param1 );
     NmOperationCompletionEvent event;
     event.mMailboxId = NmConverter::mailMsgIdToNmId(mailbox);
+    event.mOperationType = Synch;
 
     switch(*state)
         {
@@ -1251,13 +1491,27 @@
             emit syncStateEvent(SyncComplete, event);
             break;
             }
-        case SyncError:
-        default:
+        case SyncCancelled:
+            {
+            event.mCompletionCode = NmCancelError;
+            emit syncStateEvent(SyncComplete, event);
+            break;
+            }
+        case ServerConnectionError:
             {
             event.mCompletionCode = NmServerConnectionError;
             emit syncStateEvent(SyncComplete, event);
             break;
             }
+        case SyncError:
+            {
+            event.mCompletionCode = NmConnectionError;
+            emit syncStateEvent(SyncComplete, event);
+            break;
+            }
+        default:
+            // ignore other statuses
+            break;
         };
 }
 Q_EXPORT_PLUGIN(NmFrameworkAdapter)
--- a/emailuis/nmframeworkadapter/src/nmfwaaddattachmentsoperation.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmframeworkadapter/src/nmfwaaddattachmentsoperation.cpp	Fri May 14 15:41:10 2010 +0300
@@ -37,14 +37,15 @@
     const NmMessage &message,
     const QList<QString> &fileList,
     CFSMailClient &mailClient) :
-        mMessage(message),
         mMailClient(mailClient)
 {
-    // Take own copy of the file list
+    // Take own copy of the file list.
     mFileList.clear();
     for (int i=0; i<fileList.count(); ++i) {
         mFileList.append(fileList.at(i));
     }
+    mFSMessage = CFSMailMessage::NewL(message);
+    mRequestId = NmNotFoundError;
 }
 
 /*!
@@ -52,13 +53,14 @@
  */
 NmFwaAddAttachmentsOperation::~NmFwaAddAttachmentsOperation()
 {
+    // Cancel all running operations.
     doCancelOperation();
-    mFileList.clear();
-    mRequestIds.clear();
+    mFileList.clear(); 
+    delete mFSMessage;
 }
 
 /*!
-    Called after base object construction via timer event, runs the
+    Called after base object construction, runs the
     async operation.
     
     \sa NmOperation
@@ -66,8 +68,34 @@
 void NmFwaAddAttachmentsOperation::doRunAsyncOperation()
 {
     TRAPD(err, doRunAsyncOperationL());
+    // Trap harness catches an error.
     if (err != KErrNone) {
-        completeOperation(NmGeneralError);
+        // File not found, inform UI.
+        if (err == KErrNotFound) {
+            completeOperationPart(mFileList.takeFirst(),
+                                  NULL,
+                                  NmNotFoundError);
+            // Let's continue, if files still left.
+            if (mFileList.count() > 0) {
+                doRunAsyncOperation();
+            }
+            else {
+                // We do not want to report whole operation error,
+                // when the last file is, or files, are missing.
+                completeOperation(NmNoError);
+            }
+        }
+        else {
+            // Complete operation part, because of unknown error.
+            // File list is never empty in this situation.
+            completeOperationPart(mFileList.takeFirst(),
+                                  NULL,
+                                  NmGeneralError);
+            // Complete whole operation, because of unknown error.
+            mFileList.clear();
+            mRequestId = NmNotFoundError ;
+            completeOperation(NmGeneralError);
+        }
     }
 }
 
@@ -76,17 +104,15 @@
  */
 void NmFwaAddAttachmentsOperation::doRunAsyncOperationL()
 {
-    CFSMailMessage *msg = NULL;
-    msg = CFSMailMessage::NewL(mMessage);
-
-    // Go through the attachment list and add those into mail message one by one.
-    for (int i=0; i<mFileList.count(); ++i) {
-        HBufC *fileName = NmConverter::qstringToHBufCLC(mFileList.at(i));
-        mRequestIds.append(msg->AddNewAttachmentL(*fileName, *this));
-        CleanupStack::PopAndDestroy(fileName);
+    if (mFileList.count() > 0) {
+        // Add new attachment from first file in the list.
+        HBufC *fileName = NmConverter::qstringToHBufCLC(mFileList.first());
+        mRequestId = mFSMessage->AddNewAttachmentL(*fileName, *this);
+        CleanupStack::PopAndDestroy(fileName);   
+    } else {
+        completeOperation(NmNoError);
     }
-    delete msg;
-    msg = NULL;
+        
 }
 
 /*!
@@ -99,66 +125,69 @@
                                                     TInt aRequestId)
 {
     int err = NmNoError;
-    for (int i=0;i<mRequestIds.count();++i) {
-        
-        if (aRequestId == mRequestIds[i]) {
-            
-            TFSProgress::TFSProgressStatus status = aEvent.iProgressStatus;
+
+    // Request id should always be valid. If not,
+    // then report general error and complete operation.
+    if (aRequestId == mRequestId) {
+
+        // Request completed so request id used.
+        mRequestId = KErrNotFound;
+       
+        // If request completed we can process the results.
+        //   Otherwise, we report about cancellation or general error
+        // and stop the operation.
+        if (aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestComplete) {
             
-            if (status == TFSProgress::EFSStatus_RequestComplete
-                && aEvent.iParam) {
-                // Request completed. Let's check the result
-                switch (aEvent.iError) {
-                    case KErrNone: {
-                        CFSMailMessagePart *fsMessagePart =
-                            static_cast<CFSMailMessagePart *>(aEvent.iParam);
-                        completeOperationPart(
-                            mFileList.at(i),
-                            fsMessagePart->GetPartId().GetNmId(),
-                            NmNoError);
-                        delete fsMessagePart;
-                        fsMessagePart = NULL;
-                        break;
-                    }
-                    case KErrNotFound:
-                        completeOperationPart(mFileList.at(i),
-                                              NULL,
-                                              NmNotFoundError);
-                        err = NmNotFoundError;
-                        break;
-                    default:
-                        completeOperationPart(mFileList.at(i),
-                                              NULL,
-                                              NmGeneralError);
-                        err = NmGeneralError;
-                } // end switch case
-                // remove request id and file name
-                mRequestIds.removeAt(i);
-                mFileList.removeAt(i);
-            }
-            else if (status == TFSProgress::EFSStatus_RequestCancelled) {
-                completeOperationPart(mFileList.at(i),
-                                      NULL,
-                                      NmCancelError);
-                mFileList.clear();
-                mRequestIds.clear();
-                operationCancelled();
-                err = NmCancelError;
+            // Request completed. Let's check the result. If no error
+            // and parameter not NULL, report UI about a file added.
+            //   Else complete operation part with general error,
+            // but continue if a file or files still left in the list.
+            if (aEvent.iError == KErrNone && aEvent.iParam) {
+                
+                // Cast the parameter to FS message part object, since
+                // it can't be anything else.
+                CFSMailMessagePart *fsMessagePart =
+                    static_cast<CFSMailMessagePart *>(aEvent.iParam);
+
+                completeOperationPart(
+                    mFileList.takeFirst(),
+                    fsMessagePart->GetPartId().GetNmId(),
+                    NmNoError);
+                    
+                delete fsMessagePart;
+                fsMessagePart = NULL;
             }
             else {
-                completeOperationPart(mFileList.at(i),
+                completeOperationPart(mFileList.takeFirst(),
                                       NULL,
                                       NmGeneralError);
-                mFileList.clear();
-                mRequestIds.clear();
-                err = NmGeneralError;
             }
-        } // end if
-    } // end for
+        }
+        else {
+            completeOperationPart(mFileList.takeFirst(),
+                                  NULL,
+                                  NmGeneralError);
+            mFileList.clear();
+            err = NmGeneralError;
+        }
+    } // if (aRequestId == mRequestId) 
+    else {
+        // Just to be sure.
+        if (mFileList.count() > 0) {
+            completeOperationPart(mFileList.takeFirst(),
+                                  NULL,
+                                  NmGeneralError);   
+        }
+        mFileList.clear();
+        err = NmGeneralError;
+    }
     
-    // complete operation
-    if (!mRequestIds.count()) {
+    // Complete operation if there are no files left.
+    // Otherwise, continue with next file.
+    if (!mFileList.count()) {
         completeOperation(err);
+    } else {
+        doRunAsyncOperation();
     }
 }
 
@@ -167,10 +196,8 @@
  */
 void NmFwaAddAttachmentsOperation::doCancelOperation()
 {
-    for (int i=0;i<mRequestIds.count();++i) {
-        if (mRequestIds[i] >= 0) {
-            TInt reqId = static_cast<TInt>(mRequestIds[i]);
-            TRAP_IGNORE(mMailClient.CancelL(reqId));
-        }
+    if (mRequestId != KErrNotFound) {
+        TRAP_IGNORE(mMailClient.CancelL(mRequestId));
     }
+    mRequestId = NmCancelError;
 }
--- a/emailuis/nmframeworkadapter/src/nmfwacheckoutboxoperation.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmframeworkadapter/src/nmfwacheckoutboxoperation.cpp	Fri May 14 15:41:10 2010 +0300
@@ -15,7 +15,6 @@
  *
  */
 
-#include "nmfwacheckoutboxoperation.h"
 #include "nmframeworkadapterheaders.h"
 
 NmFwaCheckOutboxOperation::NmFwaCheckOutboxOperation(
@@ -30,7 +29,6 @@
 
 NmFwaCheckOutboxOperation::~NmFwaCheckOutboxOperation()
 {
-    doCancelOperation();
 }
 
 void NmFwaCheckOutboxOperation::doRunAsyncOperation()
@@ -114,3 +112,4 @@
 
     completeOperation(err);
 }
+
--- a/emailuis/nmframeworkadapter/src/nmfwamessagecreationoperation.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmframeworkadapter/src/nmfwamessagecreationoperation.cpp	Fri May 14 15:41:10 2010 +0300
@@ -16,7 +16,6 @@
  */
 #include "nmframeworkadapterheaders.h"
 
-#include "nmfwamessagecreationoperation.h"
 
 /*!
     \class NmFwaMessageCreationOperation
@@ -50,6 +49,7 @@
 {
     doCancelOperation();
     delete mMessage;
+    NMLOG("NmFwaMessageCreationOperation::~NmFwaMessageCreationOperation --->");
 }
 
 /*!
@@ -144,7 +144,7 @@
     NmId messageId;
     
     if (mMessage) {
-        messageId = mMessage->envelope().id();
+        messageId = mMessage->envelope().messageId();
     }
     
     return messageId;
@@ -176,10 +176,11 @@
             completeOperation(NmNoError);
         }
         else if (status == TFSProgress::EFSStatus_RequestCancelled) {
-            operationCancelled();
+            completeOperation(NmCancelError);
         }
         else {
             completeOperation(NmGeneralError);
         }
     }
 }
+
--- a/emailuis/nmframeworkadapter/src/nmfwamessagefetchingoperation.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmframeworkadapter/src/nmfwamessagefetchingoperation.cpp	Fri May 14 15:41:10 2010 +0300
@@ -15,17 +15,14 @@
  *
  */
 
-#include "nmfwamessagefetchingoperation.h"
 #include "nmframeworkadapterheaders.h"
 
 NmFwaMessageFetchingOperation::NmFwaMessageFetchingOperation(
     const NmId &mailboxId,
     const NmId &folderId,
     const NmId &messageId,
-    CFSMailClient &mailClient,
-    QObject *parent) :
-        NmOperation(parent),
-        mMailboxId(mailboxId),
+    CFSMailClient &mailClient) 
+      : mMailboxId(mailboxId),
         mFolderId(folderId),
         mMessageId(messageId),
         mMailClient(mailClient),
@@ -37,6 +34,7 @@
 NmFwaMessageFetchingOperation::~NmFwaMessageFetchingOperation()
 {
     doCancelOperation();
+    NMLOG("NmFwaMessageFetchingOperation::~NmFwaMessageFetchingOperation --->");
 }
 
 void NmFwaMessageFetchingOperation::doRunAsyncOperation()
@@ -82,7 +80,7 @@
             completeOperation(NmNoError);
         }
         else if (aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestCancelled) {
-            operationCancelled();
+            completeOperation(NmCancelError); 
         }
     }
 }
--- a/emailuis/nmframeworkadapter/src/nmfwamessagepartfetchingoperation.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmframeworkadapter/src/nmfwamessagepartfetchingoperation.cpp	Fri May 14 15:41:10 2010 +0300
@@ -25,10 +25,8 @@
         const NmId &folderId,
         const NmId &messageId,
         const NmId &messagePartId,
-        CFSMailClient &mailClient,
-        QObject *parent) : 
-    NmOperation(parent),
-    mMailboxId(mailboxId), 
+        CFSMailClient &mailClient) 
+  : mMailboxId(mailboxId), 
     mFolderId(folderId), 
     mMessageId(messageId), 
     mMessagePartId(messagePartId),
@@ -46,6 +44,7 @@
 NmFwaMessagePartFetchingOperation::~NmFwaMessagePartFetchingOperation()
 {
     doCancelOperation();
+    NMLOG("NmFwaMessagePartFetchingOperation::~NmFwaMessagePartFetchingOperation --->");
 }
 
 /*!
@@ -58,8 +57,7 @@
             completeOperation(aEvent.iError);
         }
         else if (aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestCancelled) {
-            // emit cancelled
-            operationCancelled();
+            completeOperation(NmCancelError);
         }
         else if (aEvent.iProgressStatus == TFSProgress::EFSStatus_Status) {
             int progress = 0;
--- a/emailuis/nmframeworkadapter/src/nmfwamessagesendingoperation.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmframeworkadapter/src/nmfwamessagesendingoperation.cpp	Fri May 14 15:41:10 2010 +0300
@@ -51,11 +51,13 @@
  */
 NmFwaMessageSendingOperation::~NmFwaMessageSendingOperation()
 {
-    delete mSaveOperation;
-
+    if (mSaveOperation && mSaveOperation->isRunning()) {
+        mSaveOperation->cancelOperation();
+    }
     doCancelOperation();
     mMailClient.Close(); // decrease ref count
     delete mMessage;
+    NMLOG("NmFwaMessageSendingOperation::~NmFwaMessageSendingOperation --->");
 }
 
 /*!
@@ -113,6 +115,9 @@
         TRAP_IGNORE(mMailClient.CancelL(mRequestId));
         mRequestId = NmNotFoundError;
     }
+    if (mSaveOperation && mSaveOperation->isRunning()) {
+        mSaveOperation->cancelOperation();
+    }
 }
     
 /*!
@@ -145,9 +150,8 @@
 void NmFwaMessageSendingOperation::handleCompletedSaveOperation(int error)
 {
     if (error == NmNoError) {
-        mTimer->stop();
-        mTimer->start(1);
         mSaved = true;
+        doRunAsyncOperation();
     }
     else {
         completeOperation(NmGeneralError);
@@ -160,11 +164,10 @@
 int NmFwaMessageSendingOperation::saveMessageWithSubparts()
 {
     int ret = NmNotFoundError;
-    
     if (mMessage) {
-        delete mSaveOperation;
-        mSaveOperation = NULL;
-        
+        if (mSaveOperation && mSaveOperation->isRunning()) {
+            mSaveOperation->cancelOperation();
+        }
         mSaveOperation = mPluginInterface.saveMessageWithSubparts(*mMessage);
         
         if (mSaveOperation) {
@@ -186,10 +189,11 @@
  */
 int NmFwaMessageSendingOperation::sendMessageL()
 {
+    NMLOG("NmFwaMessageSendingOperation::sendMessageL");
     int ret = NmNotFoundError;
     
     if (mMessage) {
-        TFSMailMsgId mailboxId = NmConverter::nmIdToMailMsgId(mMessage->mailboxId());
+        TFSMailMsgId mailboxId = NmConverter::nmIdToMailMsgId(mMessage->envelope().mailboxId());
         CFSMailBox *currentMailbox( NULL );
         currentMailbox = mMailClient.GetMailBoxByUidL(mailboxId);
         CleanupStack::PushL(currentMailbox);
--- a/emailuis/nmframeworkadapter/src/nmfwaremoveattachmentoperation.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmframeworkadapter/src/nmfwaremoveattachmentoperation.cpp	Fri May 14 15:41:10 2010 +0300
@@ -53,7 +53,7 @@
 }
 
 /*!
-    Called after base object construction via timer event, runs the
+    Called after base object construction, runs the
     async operation.
     
     \sa NmOperation
@@ -83,16 +83,22 @@
         
     // Search through all attachments from message and remove attachment
     // if message part match.
+    bool found(false);
     for (int i=0; i<attachments.Count(); ++i) {
         if (mAttachmentPartId.id() == attachments[i]->GetPartId().GetNmId().id()) {
             mRequestId = msg->RemoveChildPartL(attachments[i]->GetPartId(),*this);
+            found = true;
             break;
         }
     }
-    attachments.ResetAndDestroy();
-    
+    attachments.ResetAndDestroy();   
     delete msg;
     msg = NULL;
+    // if attachment is not found, request to plugin is not made
+    // and the operation should be completed here
+    if (!found) {
+        completeOperation(NmNotFoundError);
+    }
 }
 
 /*!
@@ -121,7 +127,6 @@
             }
         }
         else if (status == TFSProgress::EFSStatus_RequestCancelled) {
-            operationCancelled();
             completeOperation(NmCancelError);
         }
         else {
--- a/emailuis/nmframeworkadapter/src/nmfwareplymessagecreationoperation.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmframeworkadapter/src/nmfwareplymessagecreationoperation.cpp	Fri May 14 15:41:10 2010 +0300
@@ -38,13 +38,10 @@
 
     CFSMailBox *mailBox(NULL);
     TRAP_IGNORE(mailBox = mMailClient.GetMailBoxByUidL(mailMsgId));
-    
     if (mailBox) {
         TRAPD(err, mRequestId = mailBox->CreateReplyMessageL(mOriginalMessageId, mReplyAll, *this));
-
         if (err == KErrFSMailPluginNotSupported) {
             CFSMailMessage *fsMessage = mailBox->CreateReplyMessage(mOriginalMessageId, mReplyAll);
- 
             mMessage = fsMessage->GetNmMessage();
             
             delete fsMessage;
--- a/emailuis/nmframeworkadapter/src/nmfwastoreenvelopesoperation.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmframeworkadapter/src/nmfwastoreenvelopesoperation.cpp	Fri May 14 15:41:10 2010 +0300
@@ -15,7 +15,6 @@
 *
 */
 
-#include "nmfwastoreenvelopesoperation.h"
 #include "nmframeworkadapterheaders.h"
 
 NmFwaStoreEnvelopesOperation::NmFwaStoreEnvelopesOperation(
@@ -81,7 +80,7 @@
             completeOperation(NmNoError);
         }
         else if (aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestCancelled) {
-            operationCancelled();
+            completeOperation(NmCancelError);
         }
         else {
             completeOperation(NmGeneralError);
--- a/emailuis/nmframeworkadapter/src/nmfwastoremessageoperation.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmframeworkadapter/src/nmfwastoremessageoperation.cpp	Fri May 14 15:41:10 2010 +0300
@@ -65,6 +65,8 @@
                 break;
             }
         }
+    } else {
+        completeOperation(NmGeneralError);
     }
 }
 
@@ -97,7 +99,7 @@
         if (aEvent.iProgressStatus ==
                 TFSProgress::EFSStatus_RequestComplete) {
             if(mStatus != EComplete) {
-                runAsyncOperation();
+                doRunAsyncOperation();
             } else {
                 completeOperation(NmNoError);
             }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmframeworkadapter/src/nmmailboxsearchobserver.cpp	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "nmframeworkadapterheaders.h"
+
+
+/*!
+    \class NmMailboxSearchObserver
+    \brief A Qt wrapper class for MFSMailBoxSearchObserver.
+*/
+
+
+/*!
+    Class constructor.
+*/
+NmMailboxSearchObserver::NmMailboxSearchObserver()
+{
+    
+}
+
+
+/*!
+    Class destructor.
+*/
+NmMailboxSearchObserver::~NmMailboxSearchObserver()
+{
+    
+}
+
+
+/*!
+    From MFSMailBoxSearchObserver.
+    Converts the ID of the received message into NmId and emits it with the
+    signal notifying that a match was found.
+
+    \param aMatchMessage A message that matches the search criteria. This class
+                         takes the ownership of the given instance.
+*/
+void NmMailboxSearchObserver::MatchFoundL(CFSMailMessage *aMatchMessage)
+{
+    if (aMatchMessage) {
+        NmMessage *message = aMatchMessage->GetNmMessage();
+
+        if (message) {
+            emit matchFound(message->envelope().messageId());
+            delete message;
+        }
+    }
+}
+
+
+/*!
+    From MFSMailBoxSearchObserver.
+    Emits a signal to notify that the search is complete.
+*/
+void NmMailboxSearchObserver::SearchCompletedL()
+{
+    emit searchComplete();
+}
+
+
+/*!
+    From MFSMailBoxSearchObserver.
+    TODO Implement if necessary.
+*/
+void NmMailboxSearchObserver::ClientRequiredSearchPriority(
+    TInt *apRequiredSearchPriority)
+{
+    Q_UNUSED(apRequiredSearchPriority);
+}
+
+
+// End of file.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmhswidget/conf/nmhswidgetmail.docml	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.0">
+	  <widget name="emailLayoutWidget" type="HbWidget">
+	      <widget name="iconSeparator" type="HbLabel">
+	          <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+	          <icon iconName="note_warning" name="icon"/>
+	          <real name="z" value="1"/>
+	          <enums name="aspectRatioMode" value="IgnoreAspectRatio"/>
+	          <sizepolicy horizontalPolicy="Ignored" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+	          <sizehint height="2" type="PREFERRED" width="50un"/>
+	      </widget>
+	      <widget name="iconNewMail" type="HbLabel">
+	          <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+	          <real name="z" value="2"/>
+	          <enums name="aspectRatioMode" value="IgnoreAspectRatio"/>
+	          <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Ignored" verticalStretch="0"/>
+	          <sizehint type="PREFERRED" width="1.25un"/>
+	      </widget>
+	      <widget name="labelSender" type="HbLabel">
+	          <real name="z" value="3"/>
+	          <string name="plainText" value="Mail Spammer"/>
+	          <sizehint height="var(hb-param-text-height-tiny)" type="PREFERRED" width="33.43284un"/>
+	          <sizepolicy horizontalPolicy="Ignored" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+	          <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-tiny)"/>
+	      </widget>
+	      <widget name="labelTime" type="HbLabel">
+	          <real name="z" value="4"/>
+	          <string name="plainText" value="12:45pm"/>
+	          <sizehint height="var(hb-param-text-height-tiny)" type="FIXED" width="13un"/>
+	          <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+	          <enums name="alignment" value="AlignRight|AlignTop|AlignTrailing"/>
+                  <fontspec name="fontSpec" role="Secondary" textheight="2.5un"/>
+	      </widget>
+	      <widget name="labelSubject" type="HbLabel">
+	          <real name="z" value="5"/>
+	          <string name="plainText" value="Check out great new medication.."/>
+	          <sizepolicy horizontalPolicy="Ignored" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+	          <sizehint height="var(hb-param-text-height-tiny)" type="PREFERRED" width="35un"/>
+	          <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-tiny)"/>
+	      </widget>
+	      <widget name="iconThree" type="HbLabel">
+	          <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+	          <icon iconName="note_warning" name="icon"/>
+	          <real name="z" value="6"/>
+	          <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+	          <sizehint height="var(hb-param-graphic-size-secondary)" type="FIXED" width="var(hb-param-graphic-size-secondary)"/>
+	      </widget>
+	      <widget name="iconTwo" type="HbLabel">
+	          <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+	          <icon iconName="note_warning" name="icon"/>
+	          <real name="z" value="7"/>
+	          <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+	          <sizehint height="var(hb-param-graphic-size-secondary)" type="FIXED" width="var(hb-param-graphic-size-secondary)"/>
+	      </widget>
+	      <widget name="iconOne" type="HbLabel">
+	          <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+	          <icon iconName="note_warning" name="icon"/>
+	          <real name="z" value="8"/>
+	          <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+	          <sizehint height="var(hb-param-graphic-size-secondary)" type="FIXED" width="var(hb-param-graphic-size-secondary)"/>
+	      </widget>
+	      <real name="z" value="1"/>
+	      <sizehint height="11.1un" type="FIXED" width="46un"/>
+	      <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+	      <layout type="anchor">
+	          <anchoritem dst="iconSeparator" dstEdge="LEFT" spacing="2" src="" srcEdge="LEFT"/>
+	          <anchoritem dst="iconSeparator" dstEdge="TOP" spacing="0" src="" srcEdge="TOP"/>
+	          <anchoritem dst="iconSeparator" dstEdge="RIGHT" spacing="-2" src="" srcEdge="RIGHT"/>
+	          <anchoritem dst="iconNewMail" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="" srcEdge="LEFT"/>
+	          <anchoritem dst="iconNewMail" dstEdge="TOP" spacing="0.5un" src="iconSeparator" srcEdge="BOTTOM"/>
+	          <anchoritem dst="iconNewMail" dstEdge="BOTTOM" spacing="-0.5un" src="" srcEdge="BOTTOM"/>
+	          <anchoritem dst="labelSender" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="iconNewMail" srcEdge="RIGHT"/>
+	          <anchoritem dst="labelSender" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="iconSeparator" srcEdge="BOTTOM"/>
+	          <anchoritem dst="labelTime" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="" srcEdge="RIGHT"/>
+	          <anchoritem dst="labelTime" dstEdge="TOP" spacing="0" src="labelSender" srcEdge="TOP"/>
+	          <anchoritem dst="labelTime" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="labelSender" srcEdge="RIGHT"/>
+	          <anchoritem dst="labelSubject" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="iconNewMail" srcEdge="RIGHT"/>
+	          <anchoritem dst="labelSubject" dstEdge="TOP" spacing="var(hb-param-margin-gene-middle-vertical)" src="labelSender" srcEdge="BOTTOM"/>
+	          <anchoritem dst="iconThree" dstEdge="TOP" spacing="0" src="labelSubject" srcEdge="TOP"/>
+	          <anchoritem dst="iconThree" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="" srcEdge="RIGHT"/>
+	          <anchoritem dst="iconTwo" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="iconThree" srcEdge="LEFT"/>
+	          <anchoritem dst="iconTwo" dstEdge="TOP" spacing="0" src="labelSubject" srcEdge="TOP"/>
+	          <anchoritem dst="iconOne" dstEdge="TOP" spacing="0" src="labelSubject" srcEdge="TOP"/>
+	          <anchoritem dst="iconOne" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="iconTwo" srcEdge="LEFT"/>
+	          <anchoritem dst="labelSubject" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="iconOne" srcEdge="LEFT"/>
+	      </layout>
+	  </widget>
+</hbdocument>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmhswidget/conf/nmhswidgettitle.docml	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.0">
+    <widget name="titleLayoutWidget" type="HbWidget">
+        <widget name="mailboxNameLabel" type="HbLabel">
+            <real name="z" value="1"/>
+            <sizepolicy horizontalPolicy="Ignored" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+            <sizehint height="var(hb-param-text-height-tiny)" type="PREFERRED" width="34.92537un"/>
+            <string name="plainText" value="Mailbox gmail"/>
+            <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-tiny)"/>
+        </widget>
+        <widget name="mailboxIcon" type="HbLabel">
+            <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+            <icon iconName="note_warning" name="icon"/>
+            <real name="z" value="2"/>
+            <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+            <sizehint height="11un" type="FIXED" width="11un"/>
+        </widget>
+        <widget name="unreadCountLabel" type="HbLabel">
+            <enums name="alignment" value="AlignRight|AlignVCenter|AlignTrailing"/>
+            <real name="z" value="3"/>
+            <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+            <sizehint height="var(hb-param-text-height-tiny)" type="FIXED" width="6un"/>
+            <string locid="txt_mail_widget_list_l1" name="plainText" value="(999)"/>
+            <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-tiny)"/>
+        </widget>
+        <widget name="collapseExpandIcon" type="HbPushButton">
+            <icon iconName="note_warning" name="icon"/>
+            <real name="z" value="4"/>
+            <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+            <sizehint height="5.5un" type="FIXED" width="5.5un"/>
+            <string name="alignment" value="AlignVCenter|AlignHCenter"/>
+        </widget>
+        <real name="z" value="1"/>
+        <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+        <sizehint height="7un" type="FIXED" width="46un"/>
+        <layout type="anchor">
+            <anchoritem dst="mailboxIcon" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="" srcEdge="LEFT"/>
+            <anchoritem dst="mailboxIcon" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+            <anchoritem dst="mailboxNameLabel" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="mailboxIcon" srcEdge="RIGHT"/>
+            <anchoritem dst="mailboxNameLabel" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="" srcEdge="TOP"/>
+            <anchoritem dst="mailboxNameLabel" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="unreadCountLabel" srcEdge="LEFT"/>
+            <anchoritem dst="unreadCountLabel" dstEdge="TOP" spacing="0un" src="mailboxNameLabel" srcEdge="TOP"/>
+            <anchoritem dst="unreadCountLabel" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="collapseExpandIcon" srcEdge="LEFT"/>
+            <anchoritem dst="collapseExpandIcon" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="" srcEdge="RIGHT"/>
+            <anchoritem dst="collapseExpandIcon" dstEdge="CENTERV" spacing="0un" src="unreadCountLabel" srcEdge="CENTERV"/>
+        </layout>
+    </widget>
+</hbdocument>
--- a/emailuis/nmhswidget/inc/nmhswidget.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmhswidget/inc/nmhswidget.h	Fri May 14 15:41:10 2010 +0300
@@ -25,34 +25,53 @@
 class NmHsWidgetTitleRow;
 class NmHsWidgetEmailRow;
 class QGraphicsLinearLayout;
+class QTranslator;
+class HbFrameDrawer;
+class NmHsWidgetDateTimeObserver;
 
 class NmHsWidget : public HbWidget
 {
     Q_OBJECT
     
     Q_PROPERTY(QString accountId READ accountId WRITE setAccountId)
+    Q_PROPERTY(QString accountIconName READ accountIconName WRITE setAccountIconName)
+    Q_PROPERTY(QString widgetState READ widgetStateProperty WRITE setWidgetStateProperty)
   
 public:
     NmHsWidget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0);
     ~NmHsWidget();
     
 public slots:
+    //from home screen fw
     void onInitialize();
     void onShow();
     void onHide();
     void onUninitialize();
-    
-
+    //engine
     void updateMailData();
+    void onEngineException(const int& exc);
+    //properties
     void setAccountId(const QString &text);
     QString accountId() const;
+    void setAccountIconName(const QString &text);
+    QString accountIconName() const;   
+    void setWidgetStateProperty(QString value);
+    QString widgetStateProperty();
+    //user actions
+    void handleExpandCollapseEvent();
+
+signals: 
+    void finished();
+    void setPreferences(const QStringList &names);
+    void error();
+private:
+    bool setupLocalization();
+    void setupUi();
+    void updateMailRowsVisibility(const int visibleCount);
+    void toggleExpansionState();  
 
 protected:
-    void updateMailRowsList(int mailCount);
-    void paint(QPainter *painter, 
-               const QStyleOptionGraphicsItem *option, 
-               QWidget *widget);
-    void mousePressEvent(QGraphicsSceneMouseEvent *event);
+    void updateMailRowsList(const int mailCount);
     
 private:
     NmHsWidgetEmailEngine* mEngine;
@@ -60,6 +79,12 @@
     NmHsWidgetTitleRow* mTitleRow;
     QList<NmHsWidgetEmailRow*> mMailRows;
     NmId mAccountId;
+    QString mAccountIconName;
+    QTranslator *mTranslator;
+    HbFrameDrawer* mBackgroundFrameDrawer;
+    bool mIsExpanded;
+    bool mStaticWidget;
+    NmHsWidgetDateTimeObserver* mDateObserver;
     
 public:    
     friend class TestNmHsWidget;     
--- a/emailuis/nmhswidget/inc/nmhswidgetconsts.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmhswidget/inc/nmhswidgetconsts.h	Fri May 14 15:41:10 2010 +0300
@@ -18,15 +18,31 @@
 #ifndef NMHSWIDGETCONSTS_H
 #define NMHSWIDGETCONSTS_H
 
+/**************************************************
+ * engine
+ *************************************************/
+//Maximum amount of envelopes that can be provided to client in getData function
+//This is also the amount of envelopes that is kept in mData all the time
+const int KMaxNumberOfEnvelopesProvided = 2;
+//Maximum value for unread count
+const int KMaxUnreadCount = 999; 
+
+/**************************************************
+ * nmhswidget
+ *************************************************/
 /** contents margin/spacing in all layouts / container widgets */
 const int KNmHsWidgetContentsMargin = 0;
-/** radius for container widget's rounded rect */
-const int KNmHsWidgetShoulderRadius = 10;
-/** background opacity */
-const qreal KNmHsWidgetBackgroundOpacity = 0.50;
-/** color scheme used in widget background */
-//const QString backgroundColorAttribute = "popupbackground";
-#define KBackgroundColorAttribute  "popupbackground"
+/** Widget's background image*/
+const QString KNmHsWidgetBackgroundImage = "qtg_fr_hswidget_normal";
+/** max number of mails shown in widget */
+const int KMaxNumberOfMailsShown = KMaxNumberOfEnvelopesProvided;
+/** Widget's localization file name*/
+const QString KNmHsWidgetLocFileName = "mailwidget_";
+/** Widget's localization file location*/
+const QString KNmHsWidgetLocLocation = "z:/resource/qt/translations/";
+/** Widget's state property values */
+const QString KNmHsWidgetStateCollapsed = "collapsed";
+const QString KNmHsWidgetStateExpanded = "expanded";
 
 /**************************************************
  * Title row widget
@@ -39,6 +55,10 @@
 #define KNmHsWidgetTitleRowMailboxIcon  "mailboxIcon"
 /** mailbox name label */
 #define KNmHsWidgetTitleRowMailboxNameLabel "mailboxNameLabel"
+/** unread count label */
+#define KNmHsWidgetTitleRowUnreadCountLabel  "unreadCountLabel"
+/** expand collapse icon */
+#define KNmHsWidgetTitleRowCollapseExpandIconLabel "collapseExpandIcon"
 
 /**************************************************
  * Mail row widget
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmhswidget/inc/nmhswidgetdatetimeobserver.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,46 @@
+/*
+* 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 NMHSWIDGETDATETIMEOBSERVER_H
+#define NMHSWIDGETDATETIMEOBSERVER_H
+
+#include <QObject>
+
+class NmHsWidgetDateTimeObserverPrivate;
+
+class NmHsWidgetDateTimeObserver : public QObject
+{
+    Q_OBJECT
+
+public:
+    explicit NmHsWidgetDateTimeObserver(QObject *parent = 0);
+    virtual ~NmHsWidgetDateTimeObserver();
+
+signals:
+    void dateTimeChanged();
+    
+protected:
+    void handleCompletion();
+
+private:
+    Q_DISABLE_COPY(NmHsWidgetDateTimeObserver)
+    friend class NmHsWidgetDateTimeObserverPrivate;
+
+    NmHsWidgetDateTimeObserverPrivate *d_ptr;
+};
+
+#endif // NMHSWIDGETDATETIMEOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmhswidget/inc/nmhswidgetdatetimeobserver_p.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#ifndef NMHSWIDGETDATETIMEOBSERVERPRIVATE_H
+#define NMHSWIDGETDATETIMEOBSERVERPRIVATE_H
+
+#include <qglobal.h>
+
+class NmHsWidgetDateTimeObserver;
+class CEnvironmentChangeNotifier;
+
+class NmHsWidgetDateTimeObserverPrivate
+{
+public:
+    explicit NmHsWidgetDateTimeObserverPrivate(NmHsWidgetDateTimeObserver *q = 0);
+    ~NmHsWidgetDateTimeObserverPrivate();
+    
+private:
+    TInt HandleLocaleChange();
+    static TInt LocaleChangeCallback(TAny* aThisPtr);
+    
+private:
+    Q_DISABLE_COPY(NmHsWidgetDateTimeObserverPrivate)
+
+    NmHsWidgetDateTimeObserver *q_ptr;
+    
+    /*
+     * Owned
+     */
+    CEnvironmentChangeNotifier* iLocaleNotifier;
+};
+
+#endif // NMHSWIDGETDATETIMEOBSERVERPRIVATE_H
--- a/emailuis/nmhswidget/inc/nmhswidgetemailengine.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmhswidget/inc/nmhswidgetemailengine.h	Fri May 14 15:41:10 2010 +0300
@@ -25,28 +25,24 @@
 class NmDataPluginFactory;
 class NmDataPluginInterface;
 class QPluginLoader;
-
+class QTimer;
 
+//Three seconds
+const int NmHsWidgetEmailEngineUpdateTimerValue = 3000;
 
-enum NmHsWidgetEmailEngineErrorCode
+enum NmHsWidgetEmailEngineExceptionCode
     {
-    NmEngineNoErr,
-    NmEngineErrNotFound,
-    NmEngineErrFailure
+    NmEngineExcFailure,
+    NmEngineExcAccountDeleted
     };
 
-//Maximum amount of envelopes that can be provided to client in getData function
-//This is also the amount of envelopes that is kept in mData all the time
-const int KMaxNumberOfEnvelopesProvided = 2;
-
-//Maximum value for unread count. Counting will stop when this limit is reached
-const int KMaxUnreadCount = 999; 
-
 class NmHsWidgetEmailEngine : public QObject
     {
     Q_OBJECT
+    
 public:
     NmHsWidgetEmailEngine( const NmId& monitoredMailboxId );
+    bool initialize(); 
     ~NmHsWidgetEmailEngine();
 
     int getEnvelopes(QList<NmMessageEnvelope> &list, int maxEnvelopeAmount);
@@ -67,17 +63,18 @@
     void activate();
     void launchMailAppInboxView();
     void launchMailAppMailViewer(const NmId &messageId);
+    void handleUpdateTimeout();
     
 signals:
     void mailDataChanged();    
     void accountNameChanged(const QString& accountName);
     void unreadCountChanged(const int& unreadCount);
-    void errorOccured(NmHsWidgetEmailEngineErrorCode err);
+    void exceptionOccured(const int& err);
     
 private:
-    void constructNmPlugin();
-    void updateData(); 
-    void updateAccount();
+    bool constructNmPlugin();
+    bool updateData(); 
+    bool updateAccount();
     void resetEnvelopeList();
     
 private:
@@ -92,6 +89,7 @@
     bool mAccountEventReceivedWhenSuspended;
     bool mMessageEventReceivedWhenSuspended;
     bool mSuspended; 
+    QTimer* mUpdateTimer;
     };
 
 #endif /* NMHSWIDGETEMAILENGINE_H_ */
--- a/emailuis/nmhswidget/inc/nmhswidgetemailrow.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmhswidget/inc/nmhswidgetemailrow.h	Fri May 14 15:41:10 2010 +0300
@@ -19,6 +19,7 @@
 #ifndef NMHSWIDGETEMAILROW_H_
 #define NMHSWIDGETEMAILROW_H_
 
+#include <QDateTime>
 #include <hbwidget.h>
 #include "nmcommon.h"
 
@@ -34,15 +35,23 @@
     NmHsWidgetEmailRow(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0);
     ~NmHsWidgetEmailRow();
     NmId messageId();
+    bool loadDocML();
 
 public slots:
     void updateMailData( const NmMessageEnvelope& envelope );
+    void updateDateTime();
+    
+signals:
+    void mailViewerLaunchTriggered(const NmId& messageId);
     
 private:
-    void loadDocML();
     void setIconsToWidget( const NmMessageEnvelope& envelope );
     void hideIcons();
     
+protected:
+    void mousePressEvent(QGraphicsSceneMouseEvent *event);
+    void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+    
 private:
     HbLabel *mSenderLabel;
     HbLabel *mSubjectLabel;
@@ -50,6 +59,7 @@
     HbLabel *mNewMailIcon;
     HbLabel *mSeparatorIcon;
     NmId mMessageId;
+    QDateTime mMessageSentTime;
     QList <HbLabel*> mStatusIcons;  
     
 };
--- a/emailuis/nmhswidget/inc/nmhswidgettitlerow.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmhswidget/inc/nmhswidgettitlerow.h	Fri May 14 15:41:10 2010 +0300
@@ -22,6 +22,7 @@
 
 //FORWARD DECLARATIONS:
 class HbLabel;
+class HbPushButton;
 
 class NmHsWidgetTitleRow : public HbWidget
 {
@@ -30,18 +31,30 @@
 public:
     NmHsWidgetTitleRow(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0);
     ~NmHsWidgetTitleRow();
+    bool loadDocML();
+    
+    void setAccountIcon(const QString& accountIconName );
     
 private:
-    void loadDocML();
+
     void updateData();
     
 public slots: 
     void updateAccountName(const QString& accountName );
     void updateUnreadCount(const int& unreadCount );
 
+signals:
+    void expandCollapseButtonPressed();
+    void mailboxLaunchTriggered();
+    
+protected:
+    void mousePressEvent(QGraphicsSceneMouseEvent *event);
+    
 private:
     HbLabel *mMailboxIcon;
     HbLabel *mMailboxInfo;
+    HbLabel *mUnreadCountLabel;
+    HbPushButton *mCollapseExpIconLabel;
     QString mAccountName;
     int mUnreadCount;
 };
--- a/emailuis/nmhswidget/nmhswidget.pro	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmhswidget/nmhswidget.pro	Fri May 14 15:41:10 2010 +0300
@@ -19,15 +19,15 @@
 CONFIG += plugin hb mobility qtservice
 QTSERVICE.DESCRIPTOR = resources/nmhswidget.xml
 MOBILITY = serviceframework
-#win32: PLUGIN_SUBDIR = /hsresources/import/widgetregistry/2002DD15
-#symbian: PLUGIN_SUBDIR = /private/20022F35/import/widgetregistry/2002DD15
 TARGET = nmhswidget
 QT += core
 RESOURCES += nmhswidget.qrc
 LIBS += -lnmailbase \
         -lnmailuiengine \
-        -lxqservice
-
+        -lxqservice \
+        -leuser \
+        -llibc \
+        -lbafl
 symbian: {
 TARGET.UID3=0x2002DD15
 TARGET.VID = VID_DEFAULT
@@ -42,7 +42,8 @@
 DEPLOYMENT += addFiles
 
 BLD_INF_RULES.prj_exports += "resources/nmhswidget.xml 			z:/private/2002DD15/nmhswidget.xml"
-BLD_INF_RULES.prj_exports += "rom/nmhswidget.iby						CORE_APP_LAYER_IBY_EXPORT_PATH(nmhswidget.iby)"
+BLD_INF_RULES.prj_exports += "rom/nmhswidget.iby				CORE_APP_LAYER_IBY_EXPORT_PATH(nmhswidget.iby)"
+BLD_INF_RULES.prj_exports += "rom/nmhswidgetlanguage.iby 		LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(nmhswidgetlanguage.iby)"
 TARGET.EPOCALLOWDLLDATA = 1
 }
 
@@ -52,21 +53,22 @@
     src/nmhswidgetemailengine.cpp \
     src/nmhswidgetemailrow.cpp \
     src/nmhswidgettitlerow.cpp \
-    src/nmhswidgetplugin.cpp
+    src/nmhswidgetplugin.cpp \
+    src/nmhswidgetdatetimeobserver.cpp \
+    src/nmhswidgetdatetimeobserver_p.cpp
 
 HEADERS += inc/nmhswidget.h \
     inc/nmhswidgetconsts.h \
     inc/nmhswidgetemailengine.h \
     inc/nmhswidgetemailrow.h \
     inc/nmhswidgettitlerow.h \
-    inc/nmhswidgetplugin.h 
+    inc/nmhswidgetplugin.h \
+    inc/nmhswidgetdatetimeobserver.h \
+    inc/nmhswidgetdatetimeobserver_p.h
 
 INCLUDEPATH += ./inc \
     ../../inc \
-    ./tsrc/nmhswidgettestapp/inc \
     ../nmailuiengine/inc \
     ../inc
 DEPENDPATH += .
-
-LIBS += -leuser
-LIBS += -llibc
+TRANSLATIONS = mailwidget.ts
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmhswidget/rom/nmhswidgetlanguage.iby	Fri May 14 15:41:10 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 __NMHSWIDGETLANGUAGE_IBY__
+#define __NMHSWIDGETLANGUAGE_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+data=DATAZ_\QT_TRANSLATIONS_DIR\mailwidget.qm  QT_TRANSLATIONS_DIR\mailwidget.qm
+
+#endif
\ No newline at end of file
--- a/emailuis/nmhswidget/src/nmhswidget.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmhswidget/src/nmhswidget.cpp	Fri May 14 15:41:10 2010 +0300
@@ -18,6 +18,9 @@
 #include <QtGui>
 #include <QGraphicsLinearLayout>
 #include <hbcolorscheme.h>
+#include <QTranslator>
+#include <hbframedrawer.h>
+#include <hbframeitem.h>
 #include "nmcommon.h"
 #include "nmhswidget.h"
 #include "nmhswidgetemailengine.h"
@@ -25,26 +28,23 @@
 #include "nmhswidgettitlerow.h"
 #include "nmhswidgetemailrow.h"
 #include "nmhswidgetconsts.h"
+#include "nmhswidgetdatetimeobserver.h"
 
 NmHsWidget::NmHsWidget(QGraphicsItem *parent, Qt::WindowFlags flags)
     : HbWidget(parent, flags), 
       mEngine(0),
       mRowLayout(0),
-      mTitleRow( new NmHsWidgetTitleRow() ),
-      mAccountId(0)
+      mTitleRow(0),
+      mAccountId(0),
+      mAccountIconName(0),
+      mTranslator(0),
+      mBackgroundFrameDrawer(0),
+      mIsExpanded(true),
+      mStaticWidget(true),
+      mDateObserver(0)
 {
     qDebug() << "NmHsWidget::NmHsWidget IN -->>";
-
-    this->setContentsMargins( KNmHsWidgetContentsMargin, KNmHsWidgetContentsMargin,
-            KNmHsWidgetContentsMargin, KNmHsWidgetContentsMargin);
-    //Setup layout
-    mRowLayout = new QGraphicsLinearLayout(Qt::Vertical);
-    mRowLayout->setContentsMargins(KNmHsWidgetContentsMargin, KNmHsWidgetContentsMargin,
-            KNmHsWidgetContentsMargin, KNmHsWidgetContentsMargin);
-    mRowLayout->setSpacing(KNmHsWidgetContentsMargin);
-    mRowLayout->addItem(mTitleRow);
-    setLayout(mRowLayout);
-    
+       
     qDebug() << "NmHsWidget::NmHsWidget OUT <<--";
 }
 
@@ -54,18 +54,32 @@
 NmHsWidget::~NmHsWidget()
 {
     qDebug() << "NmHsWidget::~NmHsWidget IN -->>";
-    if(mEngine)
-        {
+    if(mTranslator){
+        delete mTranslator;
+        mTranslator = NULL;
+    }
+    
+    if(mEngine){
         delete mEngine;
         mEngine = NULL;
         }
+    
+    if(mBackgroundFrameDrawer){
+        delete mBackgroundFrameDrawer;
+        mBackgroundFrameDrawer = NULL;
+        }
+		
+	if(mDateObserver){
+        delete mDateObserver;
+        mDateObserver = NULL;
+        }
     qDebug() << "NmHsWidget::~NmHsWidget OUT <<--";
 }
 
 /*!
     \fn void NmHsWidget::onShow()
 
-    Shows the widget
+    called by home screen fw when widget gets visible
 */
 void NmHsWidget::onShow()
 {
@@ -77,11 +91,10 @@
     qDebug() << "NmHsWidget::onShow OUT <<--";
 }
 
-
 /*!
     \fn void NmHsWidget::onHide()
 
-    Hides the widget
+    called by home screen fw when widget gets hidden
 */
 void NmHsWidget::onHide()
 {
@@ -93,36 +106,141 @@
     qDebug() << "NmHsWidget::onHide OUT <<--";
 }
 
+/*!
+    Initializes Localization.
+    /post mTranslator constructed & localization file loaded
+    returns false in failure, otherwise true
+*/
+bool NmHsWidget::setupLocalization()
+{
+    qDebug() << "NmHsWidget::setupLocalization IN -->>";
+    
+    //Use correct localisation
+    bool ret(false); 
+    mTranslator = new QTranslator();
+    QString lang = QLocale::system().name();
+    ret = mTranslator->load(KNmHsWidgetLocFileName + lang, KNmHsWidgetLocLocation);
+    qDebug() << "NmHsWidget::setupLocalization mTranslator->load loadSucceed:"<<ret;
+    QCoreApplication::installTranslator(mTranslator);
+
+    qDebug() << "NmHsWidget::setupLocalization OUT <<--";
+    return ret;
+}
+
+/*!
+    Initializes UI. Everything that is not done in docml files should be here.
+    return true if ok, in error false.
+*/
+void NmHsWidget::setupUi()
+{
+    qDebug() << "NmHsWidget::setupUi IN -->>";
+    setContentsMargins( KNmHsWidgetContentsMargin, KNmHsWidgetContentsMargin,
+            KNmHsWidgetContentsMargin, KNmHsWidgetContentsMargin);
+    
+    //Setup layout
+    mRowLayout = new QGraphicsLinearLayout(Qt::Vertical);
+
+    mRowLayout->setContentsMargins(KNmHsWidgetContentsMargin, KNmHsWidgetContentsMargin,
+            KNmHsWidgetContentsMargin, KNmHsWidgetContentsMargin);
+    mRowLayout->setSpacing(KNmHsWidgetContentsMargin);
+    setLayout(mRowLayout);
+   
+   //background
+   mBackgroundFrameDrawer = new HbFrameDrawer( KNmHsWidgetBackgroundImage, HbFrameDrawer::NinePieces );
+   HbFrameItem* backgroundLayoutItem = new HbFrameItem( mBackgroundFrameDrawer );
+   //set to NULL to indicate that ownership transferred
+   mBackgroundFrameDrawer = NULL;
+   setBackgroundItem( backgroundLayoutItem );
+   
+   qDebug() << "NmHsWidget::setupUi OUT -->>";
+}
 
 /*!
     Initializes the widget.
+    
+    called by home screen fw when widget is added to home screen
 */
 void NmHsWidget::onInitialize()
 {
-    qDebug() << "NmHsWidget::onInitialize IN -->>";
+    QT_TRY{
+        qDebug() << "NmHsWidget::onInitialize IN -->>";
+        
+        setupUi();
+        //emit error if localization fails
+        if(!setupLocalization()){
+            emit error();
+            return;
+        }
+        
+        //Engine construction is 2 phased. 
+        mEngine = new NmHsWidgetEmailEngine( mAccountId );
+        //Client must connect to exception signals before calling the initialize function
+        //because we don't want to miss any signals.
+        connect(mEngine, SIGNAL( exceptionOccured(const int&) )
+                ,this, SLOT( onEngineException(const int&) ) );
+        if(!mEngine->initialize())
+            {
+            //engine construction failed. Give up.
+            emit error();
+            return;
+            }
 
-    mEngine = new NmHsWidgetEmailEngine( mAccountId ); 
-    mTitleRow->updateAccountName(mEngine->accountName());
-    updateMailData();
-    mTitleRow->updateUnreadCount(mEngine->unreadCount());
+        //construct and load docml for title row
+        mTitleRow = new NmHsWidgetTitleRow(); 
+        if( !mTitleRow->loadDocML()){
+            //if docml loading fails no point to proceed
+            //but memoryleak must be prevented
+            delete mTitleRow;
+            mTitleRow = NULL;
+            emit error();
+            return;
+        }
+        mRowLayout->addItem(mTitleRow);
+        mTitleRow->updateAccountName(mEngine->accountName());
     
-    //Get signals about changes in mail data
-    connect(mEngine, SIGNAL( mailDataChanged() )
-            ,this, SLOT( updateMailData() ) );
+	    //create observer for date/time change events
+	    mDateObserver = new NmHsWidgetDateTimeObserver();
     
-    //Get Signals about changes in unread count
-    connect(mEngine, SIGNAL( unreadCountChanged(const int&) )
-            ,mTitleRow, SLOT( updateUnreadCount(const int&) ) );
-    
-    //Get signals about account name changes
-    connect(mEngine, SIGNAL( accountNameChanged(const QString&) )
-            ,mTitleRow, SLOT( updateAccountName(const QString&) ) );
+        updateMailData();
+        mTitleRow->updateUnreadCount(mEngine->unreadCount());
+        mTitleRow->setAccountIcon(mAccountIconName);
+        
+        //Get signals about changes in mail data
+        connect(mEngine, SIGNAL( mailDataChanged() )
+                ,this, SLOT( updateMailData() ) );
+        
+        //Get Signals about changes in unread count
+        connect(mEngine, SIGNAL( unreadCountChanged(const int&) )
+                ,mTitleRow, SLOT( updateUnreadCount(const int&) ) );
+        
+        //Get signals about account name changes
+        connect(mEngine, SIGNAL( accountNameChanged(const QString&) )
+                ,mTitleRow, SLOT( updateAccountName(const QString&) ) );
 
-    qDebug() << "NmHsWidget::onInitialize OUT <<--";  
+	    //Get signals about user actions
+	    connect(mTitleRow, SIGNAL( mailboxLaunchTriggered() )
+	            ,mEngine, SLOT( launchMailAppInboxView() ) );
+	    connect(mTitleRow, SIGNAL( expandCollapseButtonPressed() )
+	            ,this, SLOT( handleExpandCollapseEvent() ) );
+
+	    //resize here so homescreen will place widget correctly on screen
+	    setPreferredSize( mRowLayout->preferredSize() );
+	    if (parentWidget()) {
+	        //to place widget properly after adding to homescreen
+	        parentWidget()->resize(preferredSize()); 
+		}
+        qDebug() << "NmHsWidget::onInitialize OUT <<--";  
+    }
+    QT_CATCH(...){
+        emit error();
+    }
+
 }
 
 /*!
     Uninitializes the widget.
+    
+    called by home screen fw when widget is removed from home screen
 */
 void NmHsWidget::onUninitialize()
 {
@@ -132,45 +250,21 @@
 }
 
 /*!
-    Paints widget
-*/
-void NmHsWidget::paint(QPainter *painter, 
-                          const QStyleOptionGraphicsItem *option, 
-                          QWidget *widget)
-{
-    Q_UNUSED(option);
-    Q_UNUSED(widget);
-    //----- backgroud ----------------
-    painter->setOpacity(KNmHsWidgetBackgroundOpacity);
-    QColor backgroundColor(HbColorScheme::color(KBackgroundColorAttribute));
-    // frame is not wanted to be drawn, thus pen color is same as backround color
-    painter->setPen(QPen(backgroundColor, 0));
-    painter->setBrush(backgroundColor);
-    painter->drawRoundedRect(rect(), KNmHsWidgetShoulderRadius, 
-            KNmHsWidgetShoulderRadius);
-    painter->setOpacity(1); //set opacity back to default
-}
-
-/*!
     updateMailData slot
 */
 void NmHsWidget::updateMailData()
 {
     qDebug() << "NmHsWidget::updateData IN -->>";
     QList<NmMessageEnvelope> envelopes;
-    int count = mEngine->getEnvelopes(envelopes, 2);
-    //TODO: needs error check for -1 ?
+    int count = 0;
+    if (mIsExpanded) {
+        count = mEngine->getEnvelopes(envelopes, KMaxNumberOfMailsShown);
+        }
+
     updateMailRowsList(count);
     
     for(int i=0; i<envelopes.count(); i++)
         {
-        qDebug() << "env:" << QString::number(i) << "dispName: " << envelopes[i].sender().displayName();
-        qDebug() << "env:" << QString::number(i) << "dispName: " << envelopes[i].sender().address();
-        qDebug() << "env:" << QString::number(i) << "subject:" << envelopes[i].subject();
-        qDebug() << "env:" << QString::number(i) << "isRead: " << envelopes[i].isRead();
-        qDebug() << "env:" << QString::number(i) << "date: " << envelopes[i].sentTime();
-        qDebug() << "env:" << QString::number(i) << "priority: " << envelopes[i].priority();
-        qDebug() << "env:" << QString::number(i) << "attachments: " << envelopes[i].hasAttachments();
         mMailRows[i]->updateMailData( envelopes[i] );
         }
     qDebug() << "NmHsWidget::updateData OUT <<--"; 
@@ -178,7 +272,7 @@
 
 /*!
     Sets monitored account id from given string
-    Needed for home screen framework thich supports only QString type properties
+    Needed for home screen framework which supports only QString type properties
 */
 void NmHsWidget::setAccountId(const QString &text)
 {
@@ -187,9 +281,9 @@
     quint64 id = text.toULongLong(&ok);
     if (!ok)
         {
-        // TODO: assert here if conversion failed?
-        qDebug() << "NmHsWidget::setAccountId: invalid account ID data!!!"; 
-        mAccountId.setId(0);
+        qDebug() << "NmHsWidget::setAccountId: invalid account ID data, signal finished()!!!"; 
+        //No valid account id so give up
+        emit finished();
         }
     else
         {
@@ -209,57 +303,190 @@
 }
 
 /*!
-    Updates list to include correct amount of mail row widgets
+    Sets monitored account icon name from given string
+*/
+void NmHsWidget::setAccountIconName(const QString &text)
+{
+    qDebug() << "NmHsWidget::setAccountIconName IN -->>"; 
+    mAccountIconName = text;
+    qDebug() << "NmHsWidget::setAccountIconName OUT <<--"; 
+}
+
+/*!
+    Returns monitored account icon name
+*/
+QString NmHsWidget::accountIconName() const
+{
+    qDebug() << "NmHsWidget::accountIconName()"; 
+    return mAccountIconName;
+}
+
+/*!
+    Slot to handle expand/collapse trigger event
+*/
+void NmHsWidget::handleExpandCollapseEvent()
+{
+    qDebug() << "NmHsWidget::handleExpandCollapseEvent IN -->>";
+    toggleExpansionState();
+    qDebug() << "NmHsWidget::handleExpandCollapseEvent OUT <<--"; 
+}
+
+/*!
+    Sets widget expand/collapse state
+    /post widget expansion state is changed
 */
-void NmHsWidget::updateMailRowsList(int mailCount)
+void NmHsWidget::toggleExpansionState()
+{
+    qDebug() << "NmHsWidget::setExpanded IN -->>"; 
+
+    mIsExpanded = !mIsExpanded;
+    
+    //save new state to home screen
+    QStringList propertiesList;
+    propertiesList.append("widgetState");
+    emit setPreferences(propertiesList);
+    
+    //handle state change drawing
+    updateMailData();
+    
+    qDebug() << "NmHsWidget::setExpanded OUT <<--"; 
+}
+
+/*!
+    Sets expand/collapse state from given string (needed by homescreen)
+*/
+void NmHsWidget::setWidgetStateProperty(QString value)
+{
+    qDebug() << "NmHsWidget::setWidgetStateProperty IN -->>"; 
+    if (value == KNmHsWidgetStateCollapsed)
+        {
+        mIsExpanded = false;
+        }
+    else
+        {
+        mIsExpanded = true;
+        }
+    qDebug() << "NmHsWidget::setWidgetStateProperty OUT <<--"; 
+}
+
+/*!
+    Returns widget expand/collapse state as string (needed by homescreen) 
+*/
+QString NmHsWidget::widgetStateProperty()
+{
+    qDebug() << "NmHsWidget::widgetStateProperty()";
+    if (mIsExpanded)
+        {
+        return KNmHsWidgetStateExpanded;
+        }
+    else
+        {
+        return KNmHsWidgetStateCollapsed;
+        }
+}
+
+/*!
+    Updates mMailRows list to include correct amount of mail row widgets
+    /param mailCount defines how many mail rows is needed
+    /post mMailRows list includes NmHsWidgetEmailRow for each mail item 
+*/
+void NmHsWidget::updateMailRowsList(const int mailCount)
 {
     qDebug() << "NmHsWidget::updateMailRowsList IN -->>";
     qDebug() << "NmHsWidget - mMailRows.count() == " <<  mMailRows.count();
     qDebug() << "NmHsWidget - ordered count == " <<  mailCount;
-    while (mMailRows.count() != mailCount)
+    
+    int neededRowsCount = mailCount;
+    //force size when static and expanded
+    if (mStaticWidget && mIsExpanded)
+        {
+        neededRowsCount = KMaxNumberOfMailsShown;
+        }
+    
+    while (mMailRows.count() != neededRowsCount)
         {
         //more mails to show than rows
-        if (mMailRows.count() < mailCount)
+        if (mMailRows.count() < neededRowsCount)
             {
             qDebug() << "NmHsWidget - add new mail row";
             NmHsWidgetEmailRow *row = new NmHsWidgetEmailRow();
+            if( !row->loadDocML()){
+                qDebug() << "NmHsWidget::updateMailRowsList row->loadDocML() fails";
+                //if docml loading fails no point to proceed
+                //but memoryleak must be prevented
+                delete row;
+                row = NULL;
+                emit error();
+                return;
+            }
+            connect(row, SIGNAL(mailViewerLaunchTriggered(const NmId&))
+                    ,mEngine, SLOT(launchMailAppMailViewer(const NmId&)));
+            connect( mDateObserver, SIGNAL(dateTimeChanged())
+                    ,row, SLOT(updateDateTime()) );
             mMailRows.append(row);
             mRowLayout->addItem(row);            
             }
         //too many rows
-        else if (mMailRows.count() > mailCount)
+        else if (mMailRows.count() > neededRowsCount)
             {
             qDebug() << "NmHsWidget - remove mail row";
             mRowLayout->removeItem(mMailRows.last());
             delete mMailRows.takeLast();
             }
         }
-    __ASSERT_ALWAYS( mMailRows.count() == mailCount, User::Panic(_L("Invalid"), 500) );
+    __ASSERT_ALWAYS( mMailRows.count() == neededRowsCount, User::Panic(_L("Invalid"), 500) );
+    
+    //resize the widget to new layout size
+    setPreferredSize( mRowLayout->preferredSize() );
+    
+    if (mStaticWidget)
+        {
+        this->updateMailRowsVisibility(mailCount);
+        }
     qDebug() << "NmHsWidget::updateMailRowsList OUT <<--";
 }
 
 /*!
-    mousePressEvent(QGraphicsSceneMouseEvent *event)
+    Updates mail row visibilities in static widget
+    /param visibleCount defines how many items do have mail data
+    /post all row items having mail data are visible, other rows are hidden
 */
-void NmHsWidget::mousePressEvent(QGraphicsSceneMouseEvent *event)
+void NmHsWidget::updateMailRowsVisibility(const int visibleCount)
 {
-    qDebug() << "NmHsWidget::mousePressEvent IN -->>";
-
-    if (mTitleRow->rect().contains(event->pos()))
-        {
-        mEngine->launchMailAppInboxView();
-        }
-    else
+    qDebug() << "NmHsWidget::updateMailRowsVisibility IN -->>";
+  
+    // set visible as many rows as requested by visibleCount param
+    bool isVisible;
+    for (int i=0; i < mMailRows.count(); i++) 
         {
-        for (int i=0; i < mMailRows.count(); i++)
+        isVisible = false;
+        if ((mIsExpanded) && (i < visibleCount)) 
             {
-            QRectF tmpRect = mMailRows.at(i)->geometry(); // rect();
-            if (tmpRect.contains(event->pos()))
-                {
-                mEngine->launchMailAppMailViewer(mMailRows.at(i)->messageId());
-                break;
-                }
+            isVisible = true;
             }
+        mMailRows.at(i)->setVisible(isVisible);
         }
-    qDebug() << "NmHsWidget::mousePressEvent OUT <<--";
+    
+    qDebug() << "NmHsWidget::updateMailRowsVisibility OUT <<--";
 }
+
+/*!
+    onEngineException (NmHsWidgetEmailEngineExceptionCode exc)
+    signals widget to be finalized
+    /param exc exception type
+*/
+void NmHsWidget::onEngineException(const int& exc)
+    {
+    qDebug() << "NmHsWidget:onEngineException IN -->>";
+    switch (exc)
+        {
+        case (NmEngineExcAccountDeleted):
+             emit finished(); //succesful ending
+             break;
+        case (NmEngineExcFailure):
+             emit error(); //failure
+             break;
+        default: 
+            break; 
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmhswidget/src/nmhswidgetdatetimeobserver.cpp	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include <QDebug>
+#include "nmhswidgetdatetimeobserver.h"
+#include "nmhswidgetdatetimeobserver_p.h"
+
+/*!
+    \fn NmHsWidgetDateTimeObserver::NmHsWidgetDateTimeObserver(QObject *parent)
+
+    /post Private observer is created and listening to environment changes
+*/
+NmHsWidgetDateTimeObserver::NmHsWidgetDateTimeObserver(QObject *parent) :
+    QObject(parent),
+    d_ptr(0)
+{
+    qDebug() << "NmHsWidgetDateTimeObserver::NmHsWidgetDateTimeObserver --> IN";
+    d_ptr = new NmHsWidgetDateTimeObserverPrivate(this);
+    qDebug() << "NmHsWidgetDateTimeObserver::NmHsWidgetDateTimeObserver <-- OUT";
+}
+
+/*!
+    \fn NmHsWidgetDateTimeObserver::~NmHsWidgetDateTimeObserver()
+
+    /post Private observer is destroyed
+*/
+NmHsWidgetDateTimeObserver::~NmHsWidgetDateTimeObserver()
+{
+    qDebug() << "NmHsWidgetDateTimeObserver::~NmHsWidgetDateTimeObserver --> IN";
+    delete d_ptr;
+    qDebug() << "NmHsWidgetDateTimeObserver::~NmHsWidgetDateTimeObserver <-- OUT";
+}
+
+/*!
+    \fn void NmHsWidgetDateTimeObserver::handleCompletion()
+
+    /post Valid change event received by private observer and DateTimeChange signal is emitted
+*/
+void NmHsWidgetDateTimeObserver::handleCompletion()
+{
+    qDebug() << "NmHsWidgetDateTimeObserver::handleCompletion --> IN";
+    emit dateTimeChanged();
+    qDebug() << "NmHsWidgetDateTimeObserver::handleCompletion <-- OUT";
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmhswidget/src/nmhswidgetdatetimeobserver_p.cpp	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,85 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include <QDebug>
+#include <bacntf.h>
+#include "nmhswidgetdatetimeobserver.h"
+#include "nmhswidgetdatetimeobserver_p.h"
+
+/*!
+    \fn NmHsWidgetDateTimeObserverPrivate::NmHsWidgetDateTimeObserverPrivate()
+
+    /param q pointer to public interface
+    /post Observer listens to environment change events via callback
+*/
+NmHsWidgetDateTimeObserverPrivate::NmHsWidgetDateTimeObserverPrivate(NmHsWidgetDateTimeObserver *q) :
+    q_ptr(q)
+{
+    qDebug() << "NmHsWidgetDateTimeObserverPrivate::NmHsWidgetDateTimeObserverPrivate --> IN" ;
+    TCallBack callback( LocaleChangeCallback, this );
+    //TODO: Handle leave properly
+    TRAP_IGNORE(iLocaleNotifier = CEnvironmentChangeNotifier::NewL( CActive::EPriorityStandard, callback ));
+    iLocaleNotifier->Start();
+    qDebug() << "NmHsWidgetDateTimeObserverPrivate::NmHsWidgetDateTimeObserverPrivate <-- OUT" ;
+}
+
+/*!
+    \fn NmHsWidgetDateTimeObserverPrivate::~NmHsWidgetDateTimeObserverPrivate()
+
+    Destructor
+*/
+NmHsWidgetDateTimeObserverPrivate::~NmHsWidgetDateTimeObserverPrivate()
+{
+    qDebug() << "NmHsWidgetDateTimeObserverPrivate::~NmHsWidgetDateTimeObserverPrivate --> IN" ;
+    if(iLocaleNotifier){
+        delete iLocaleNotifier;
+        iLocaleNotifier = NULL;
+    }
+    qDebug() << "NmHsWidgetDateTimeObserverPrivate::~NmHsWidgetDateTimeObserverPrivate <-- OUT" ;
+}
+
+/*!
+    \fn TInt NmHsWidgetDateTimeObserverPrivate::HandleLocaleChange()
+
+    /post If event includes change for system time, locale or midnight crossover
+          indicates poblic interface about the change
+    /return Returns count of handled change events
+*/
+TInt NmHsWidgetDateTimeObserverPrivate::HandleLocaleChange()
+{
+    qDebug() << "NmHsWidgetDateTimeObserverPrivate::HandleLocaleChange";
+    TInt handled = 0;
+    if( iLocaleNotifier->Change() & ( EChangesSystemTime | EChangesLocale | EChangesMidnightCrossover ))
+        {
+        q_ptr->handleCompletion();
+        handled = 1;
+        }
+    return handled;
+}
+
+/*!
+    \fn TInt NmHsWidgetDateTimeObserverPrivate::LocaleChangeCallback(TAny* aThisPtr)
+    /param aThisPtr Pointer to tis observer from callback object
+    /post Event is checked and handled if valid change
+    /return Returns count of handled change events
+*/
+TInt NmHsWidgetDateTimeObserverPrivate::LocaleChangeCallback(TAny* aThisPtr)
+{
+    qDebug() << "NmHsWidgetDateTimeObserverPrivate::LocaleChangeCallback" ;
+    TInt ret = static_cast<NmHsWidgetDateTimeObserverPrivate*>(aThisPtr)->HandleLocaleChange();
+    return ret;
+}
--- a/emailuis/nmhswidget/src/nmhswidgetemailengine.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmhswidget/src/nmhswidgetemailengine.cpp	Fri May 14 15:41:10 2010 +0300
@@ -15,11 +15,11 @@
  *
  */
 
+#include <xqservicerequest.h>
 #include <QDebug>
 #include <QTimer>
 #include <QDir>
 #include <qpluginloader.h>
-#include <XQServiceRequest.h>
 #include "email_services_api.h"
 #include "nmcommon.h"
 #include "nmmessageenvelope.h"
@@ -28,135 +28,184 @@
 #include "nmmailbox.h"
 #include "nmfolder.h"
 #include "nmdatapluginfactory.h"
+#include "nmhswidgetconsts.h"
 
 /*!
  Constructor
  */
 NmHsWidgetEmailEngine::NmHsWidgetEmailEngine(const NmId& monitoredMailboxId) :
-    mMailboxId(monitoredMailboxId), mAccountName(0), mUnreadCount(0),
-            mEmailInterface(0), mFactory(0), mAccountEventReceivedWhenSuspended(false),
-            mMessageEventReceivedWhenSuspended(false), mSuspended(false) 
-    {
-    qDebug()<<"NmHsWidgetEmailEngine() -- START";
-    constructNmPlugin();
+    mMailboxId(monitoredMailboxId), 
+    mFolderId(0), 
+    mAccountName(0), 
+    mUnreadCount(-1),
+    mEmailInterface(0), 
+    mFactory(0), 
+    mAccountEventReceivedWhenSuspended(false),
+    mMessageEventReceivedWhenSuspended(false), 
+    mSuspended(false),
+    mUpdateTimer(0)
+{
+    qDebug() << "NmHsWidgetEmailEngine() -- START";
+
+    qDebug() << "NmHsWidgetEmailEngine() -- END";
+}
+
+/*!
+ initilaize - Initializes the engine
+ Works as a second phase constructor. Must be called before any other operations.
+ Client should connect to exceptionOccured signal before calling this method.
+ /return true if initialize succeedes otherwise false. If false the object is unusable.
+ */
+bool NmHsWidgetEmailEngine::initialize()
+{
+    qDebug() << "initialize() -- START";
+        
+    if (!constructNmPlugin()) {
+        //if plugin connection fails, there's no reason to proceed
+        return false;
+    }
     updateData();
     updateAccount();
-    qDebug()<<"NmHsWidgetEmailEngine() -- END";
-    }
-
+    
+    mUpdateTimer = new QTimer(this);
+    mUpdateTimer->setInterval(NmHsWidgetEmailEngineUpdateTimerValue);
+    connect(mUpdateTimer, SIGNAL(timeout()), this, SLOT(handleUpdateTimeout()) );
+    
+    qDebug() << "initialize() -- END";
+    return true;
+}
 
 /*!
  constructNmPlugin
+ /post Constructs a connection to an instance of NmDataPluginInterface
+ /return true if construction succeeded, otherwise false.
  */
-void NmHsWidgetEmailEngine::constructNmPlugin()
-    {
-    qDebug()<<"NmHsWidgetEmailEngine::constructNmPlugin() -- START";
-    
-    QObject* pluginInstance(0); 
+bool NmHsWidgetEmailEngine::constructNmPlugin()
+{
+    qDebug() << "NmHsWidgetEmailEngine::constructNmPlugin() -- START";
+
+    QObject* pluginInstance(0);
     //Get data plugin factory instance
     mFactory = NmDataPluginFactory::instance();
+    if (!mFactory) {
+        qDebug() << "NmHsWidgetEmailEngine::constructNmPlugin() -- mFactory FAILED";
+        return false;
+    }
 
-    if(mFactory)        
-        {
-        pluginInstance = mFactory->pluginInstance(mMailboxId);
-        }
+    //Get plugin instance
+    pluginInstance = mFactory->pluginInstance(mMailboxId);
+    if (!pluginInstance) {
+        qDebug() << "NmHsWidgetEmailEngine::constructNmPlugin() -- pluginInstance FAILED";
+        return false;
+    }
+
+    //get interface instance
+    mEmailInterface = mFactory->interfaceInstance(pluginInstance);
 
-    if(pluginInstance)
-        { 
-        mEmailInterface = mFactory->interfaceInstance( pluginInstance );
-        mFolderId = mEmailInterface->getStandardFolderId(mMailboxId, NmFolderInbox);
-        //Subscription is needed - otherwise the signals will not be received
-        mEmailInterface->subscribeMailboxEvents(mMailboxId);
-        
-        //Connect to events
-        connect(pluginInstance,
-                SIGNAL( messageEvent(NmMessageEvent, const NmId&, 
-                        const QList<NmId>&, const NmId&) ),
-                this,
-                SLOT( handleMessageEvent(NmMessageEvent, const NmId&, 
-                        const QList<NmId>&, const NmId&) ));
+    if (!mEmailInterface) {
+        qDebug() << "NmHsWidgetEmailEngine::constructNmPlugin() -- mEmailInterface FAILED";
+        return false;       
+    }
+    //Verify that the mailbox we are interested actually exists.
+    //Otherwise emit account deleted event (instead of just returning)
+    QList<NmId> ids; 
+    mEmailInterface->listMailboxIds(ids);
+    if(!ids.contains(mMailboxId)){
+        qDebug() << "NmHsWidgetEmailEngine::constructNmPlugin() -- !ids.contains(mMailboxId) FAILED";
+        emit exceptionOccured(NmEngineExcAccountDeleted);
+        return false;
+    }
+    
+    //retrieve folderID for this mailbox's inbox
+    //If NmId equals zero, we don't have the Initial sync done for the account
+    //This is valid at least for IMAP accounts. 
+    //Folder ID is then retrieved later when first message event is received
+    mFolderId = mEmailInterface->getStandardFolderId(mMailboxId, NmFolderInbox);
+    qDebug() << "NmHsWidgetEmailEngine::constructNmPlugin() -- mFolderId==" << mFolderId.id();
 
-        connect(pluginInstance,
-                SIGNAL( mailboxEvent(NmMailboxEvent, const QList<NmId>& ) ),
-                this,
-                SLOT( handleMailboxEvent(NmMailboxEvent, const QList<NmId>&) ));
-        
-        qDebug()<<"NmHsWidgetEmailEngine::constructNmPlugin() -- OK";
-        }
-    else
-        {
-        emit errorOccured(NmEngineErrFailure);
-        qDebug()<<"NmHsWidgetEmailEngine::constructNmPlugin() -- FAILED";
-        }
+    //Subscription is needed - otherwise the signals will not be received
+    mEmailInterface->subscribeMailboxEvents(mMailboxId);
 
-    qDebug()<<"NmHsWidgetEmailEngine::constructNmPlugin() -- END";
-    }
+    //Connect to events
+    connect(pluginInstance, SIGNAL( messageEvent(NmMessageEvent, const NmId&,
+            const QList<NmId>&, const NmId&) ), this,
+        SLOT( handleMessageEvent(NmMessageEvent, const NmId&,
+                const QList<NmId>&, const NmId&) ));
+
+    connect(pluginInstance, SIGNAL( mailboxEvent(NmMailboxEvent, const QList<NmId>& ) ), this,
+        SLOT( handleMailboxEvent(NmMailboxEvent, const QList<NmId>&) ));
+
+    qDebug() << "NmHsWidgetEmailEngine::constructNmPlugin() -- OK";
+
+    return true;
+}
 
 /*!
  Reset envelope list
  \post mEnvelopeList.isEmpty() == true && all contained objects are deleted
  */
 void NmHsWidgetEmailEngine::resetEnvelopeList()
-    {
-    qDebug()<<"NmHsWidgetEmailEngine::resetEnvelopeList() -- START";
-    
-    while (!mEnvelopeList.isEmpty())
-        {
+{
+    qDebug() << "NmHsWidgetEmailEngine::resetEnvelopeList() -- START";
+
+    while (!mEnvelopeList.isEmpty()) {
         delete mEnvelopeList.takeFirst();
-        }
-    
-    qDebug()<<"NmHsWidgetEmailEngine::resetEnvelopeList() -- END";
     }
 
+    qDebug() << "NmHsWidgetEmailEngine::resetEnvelopeList() -- END";
+}
+
 /*!
  Destructor
  */
 NmHsWidgetEmailEngine::~NmHsWidgetEmailEngine()
-    {
-    qDebug()<<"~NmHsWidgetEmailEngine -- START";
- 
+{
+    qDebug() << "~NmHsWidgetEmailEngine -- START";
+
     resetEnvelopeList();
-    if  ( mFactory )
-        {        
+    if (mFactory) {
         NmDataPluginFactory::releaseInstance(mFactory);
-        }
-    qDebug()<<"~NmHsWidgetEmailEngine -- END";
     }
-
+    
+    if (mUpdateTimer){
+        mUpdateTimer->stop();
+        delete mUpdateTimer;
+    }
+    
+    qDebug() << "~NmHsWidgetEmailEngine -- END";
+}
 
 /*!
  getEnvelopes() provides message envelopes as a list of stack objects
  Amount of message envelopes in the list parameter is the smallest of the following factors:
  'KMaxNumberOfEnvelopesProvided', 'maxEnvelopeAmount', 'amount of available envelopes'. 
-  
+ 
  \param list list to be filled with message envelopes
  \param maxEnvelopeAmount Client side limit for amount of message envelope count. 
  \return count of envelopes added to list
  */
-int NmHsWidgetEmailEngine::getEnvelopes(QList<NmMessageEnvelope> &list,
-        int maxEnvelopeAmount)
-    {
-    qDebug()<<"NmHsWidgetEmailEngine::getEnvelopes()";
+int NmHsWidgetEmailEngine::getEnvelopes(QList<NmMessageEnvelope> &list, int maxEnvelopeAmount)
+{
+    qDebug() << "NmHsWidgetEmailEngine::getEnvelopes()";
     list.clear(); //Reset the parameter list to avoid side effects
     int i = 0;
-    for (; i < mEnvelopeList.count() && i < maxEnvelopeAmount; i++)
-        {
+    for (; i < mEnvelopeList.count() && i < maxEnvelopeAmount; i++) {
         NmMessageEnvelope env(*mEnvelopeList[i]);
         list.append(env);
-        }
+    }
     return i;
-    }
+}
 
 /*!
  UnreadCount
 
- \return count of unread mails
+ \return count of unread mails, or -1 if there are no mails at all in the mailbox.
  */
 int NmHsWidgetEmailEngine::unreadCount()
-    {
-    qDebug()<<"NmHsWidgetEmailEngine::unreadCount()";
+{
+    qDebug() << "NmHsWidgetEmailEngine::unreadCount()";
     return mUnreadCount;
-    }
+}
 
 /*!
  accountName
@@ -164,170 +213,221 @@
  \return name of the monitored account
  */
 QString NmHsWidgetEmailEngine::accountName()
-    {
-    qDebug()<<"NmHsWidgetEmailEngine::accountName()";
+{
+    qDebug() << "NmHsWidgetEmailEngine::accountName()";
     return mAccountName;
-    }
+}
 
 /*!
  Refresh email data.
  \post mEnvelopeList is refreshed with valid content so that it has
- valid data with maximum of KMaxNumberOfEnvelopesProvided envelopes
+       valid data with maximum of KMaxNumberOfEnvelopesProvided envelopes. 
+       
+ - emits exceptionOccured(NmEngineExcFailure) if fatal error occurs.
+ - emits mailDataChanged() if new mail data is set into mEnvelopeList
+ - emits unreadCountChanged(mUnreadCount), if mUnreadCount is updated
  
+ \return true if everything succeeded, otherwise false
  */
-void NmHsWidgetEmailEngine::updateData()
-    {
-    qDebug()<<"NmHsWidgetEmailEngine::updateData() -- START";
-    if(!mEmailInterface)
-        {
-        qDebug()<<"NmHsWidgetEmailEngine::updateData() -- Interface missing";
-        return; //if interface is missing there's nothing to do
-        }
+bool NmHsWidgetEmailEngine::updateData()
+{
+    qDebug() << "NmHsWidgetEmailEngine::updateData() -- START";
+    if (!mEmailInterface) {
+        qDebug() << "NmHsWidgetEmailEngine::updateData() -- Interface missing";
+        emit exceptionOccured(NmEngineExcFailure); //fatal error
+        return false; //if interface is missing there's nothing to do
+    }
+
     //reset envelope list before retrieving new items
-    resetEnvelopeList(); 
+    resetEnvelopeList();
+
     //get messages from inbox
-    mEmailInterface->listMessages(mMailboxId, mFolderId, mEnvelopeList, KMaxNumberOfEnvelopesProvided);
-    Q_ASSERT_X(mEnvelopeList.count() <= KMaxNumberOfEnvelopesProvided, "nmhswidgetemailengine", "list max size exeeded");
+    int msgErr = mEmailInterface->listMessages(mMailboxId, mFolderId, mEnvelopeList,
+        KMaxNumberOfEnvelopesProvided);
+    if (msgErr) {
+        //retrieval of messages failed.  
+        return false;
+    }
     //emit signal about new message data right away
     emit mailDataChanged();
     //retrieve new unread count to mUnreadCount
     NmFolder* folder = NULL;
-    int err = mEmailInterface->getFolderById(mMailboxId, mFolderId, folder);
- 
-    if(folder)
-        {
-        mUnreadCount = folder->unreadMessageCount();
+    int folderErr = mEmailInterface->getFolderById(mMailboxId, mFolderId, folder);
+    if (folderErr) {
+        //retrieval of valid folder failed.
+        return false;
+    }
+    if (folder) {
+        //If messageCount in the folder is zero we must indicate unread count to be -1
+        if (folder->messageCount() == 0) {
+            mUnreadCount = -1;
+        }
+        else {
+            mUnreadCount = folder->unreadMessageCount();
+        }
         delete folder;
         folder = NULL;
         //limit the unread count to KMaxUnreadCount
-        if( mUnreadCount > KMaxUnreadCount)
-            {
+        if (mUnreadCount > KMaxUnreadCount) {
             mUnreadCount = KMaxUnreadCount;
-            }
+        }
         //emit signal about changed unread count
         emit unreadCountChanged(mUnreadCount);
-        }
-
+    }else{
+        return false;
+    }
 
-
-    qDebug()<<"NmHsWidgetEmailEngine::updateData() -- END";
-    }
+    qDebug() << "NmHsWidgetEmailEngine::updateData() -- END";
+    return true;
+}
 
 /*!
  handleMessageEvent slot.
  */
-void NmHsWidgetEmailEngine::handleMessageEvent(NmMessageEvent event,
-        const NmId &folderId, const QList<NmId> &messageIds, const NmId& mailboxId)
-    {
-    qDebug()<<"NmHsWidgetEmailEngine::handleMessageEvent() -- START";
+void NmHsWidgetEmailEngine::handleMessageEvent(
+    NmMessageEvent event,
+    const NmId &folderId,
+    const QList<NmId> &messageIds,
+    const NmId& mailboxId)
+{
+    qDebug() << "NmHsWidgetEmailEngine::handleMessageEvent() -- START";
     Q_UNUSED(event);
     Q_UNUSED(messageIds);
-    if ( (folderId == mFolderId) && (mailboxId == mMailboxId) )
-        {
+    
+    if (!mEmailInterface) {
+        qDebug() << "NmHsWidgetEmailEngine::handleMessageEvent() -- Interface missing";
+        emit exceptionOccured(NmEngineExcFailure); //fatal error
+        return; //if interface is missing there's nothing to do
+    }
+    
+    if (mFolderId == NmId(0)) {
+        // inbox was not created in construction phase, so let's
+        // get id now as received first mail event
+        mFolderId = mEmailInterface->getStandardFolderId(mMailboxId, NmFolderInbox);
+    }
+    if ((folderId == mFolderId) && (mailboxId == mMailboxId)) {
         //Data is updated only if the engine is not suspended
-        if( mSuspended )
-            {
+        if (mSuspended) {
             mMessageEventReceivedWhenSuspended = true;
-            }
-        else
-            {
-            updateData();
-            }   
         }
-    qDebug()<<"NmHsWidgetEmailEngine::handleMessageEvent() -- END";
+        else {
+            //start or restart the timer. Update is started when timer expires
+            mUpdateTimer->start();
+        }
     }
+    qDebug() << "NmHsWidgetEmailEngine::handleMessageEvent() -- END";
+}
 
 /*!
  handleMailboxEvent slot.
  */
-void NmHsWidgetEmailEngine::handleMailboxEvent(NmMailboxEvent event,
-        const QList<NmId> &mailboxIds)
-    {
-    qDebug()<<"NmHsWidgetEmailEngine::handleMailboxEvent() -- START";
-    Q_UNUSED(mailboxIds);
-    //react only to NmMailboxChanged event
-    if (event == NmMailboxChanged)
-        {
-        if ( mSuspended )
-            {
-            mAccountEventReceivedWhenSuspended = true;
+void NmHsWidgetEmailEngine::handleMailboxEvent(NmMailboxEvent event, const QList<NmId> &mailboxIds)
+{
+    qDebug() << "NmHsWidgetEmailEngine::handleMailboxEvent() -- START";
+    if (mailboxIds.contains(mMailboxId)) {
+        switch (event) {
+            case (NmMailboxChanged): {
+                if (mSuspended) {
+                    mAccountEventReceivedWhenSuspended = true;
+                }
+                else {
+                    updateAccount();
+                }
+                break;
+            }
+            case (NmMailboxDeleted): {
+                emit exceptionOccured(NmEngineExcAccountDeleted);
+                break;
             }
-        else
-            {
-            updateAccount();
-            }
+            default:
+                //ignored
+                break;
+        }
+    }
+    qDebug() << "NmHsWidgetEmailEngine::handleMailboxEvent() -- END";
+}
 
-        }
-    qDebug()<<"NmHsWidgetEmailEngine::handleMailboxEvent() -- END";
+/*!
+ * handleUpdateTimeout slot
+ */
+void NmHsWidgetEmailEngine::handleUpdateTimeout()
+{
+    qDebug() << "NmHsWidgetEmailEngine::handleUpdateTimeout() -- START";
+    if (mUpdateTimer){
+        mUpdateTimer->stop();
     }
+    updateData();
+    qDebug() << "NmHsWidgetEmailEngine::updateAccount() -- END";
+}
 
 /*!
  Update Account data
  \post if mEmailInterface exists, the mAccountName is refreshed from adapter 
-       and accountNameChanged signal is emitted.
+ and accountNameChanged signal is emitted.
  */
-void NmHsWidgetEmailEngine::updateAccount()
-    {
-    qDebug()<<"NmHsWidgetEmailEngine::updateAccount() -- START";
-    
+bool NmHsWidgetEmailEngine::updateAccount()
+{
+    qDebug() << "NmHsWidgetEmailEngine::updateAccount() -- START";
+
     NmMailbox* box = NULL;
-    if(mEmailInterface)
-        {
-        mEmailInterface->getMailboxById(mMailboxId, box);
+    if (mEmailInterface) {
+        int err = mEmailInterface->getMailboxById(mMailboxId, box);
+        if (err) {
+            //By specification return and wait another event
+            return false;
         }
-    if (box)
-        {
+    }
+    if (box) {
         mAccountName = box->name();
-        emit accountNameChanged(mAccountName);
         delete box;
         box = NULL;
-        }
-    qDebug()<<"NmHsWidgetEmailEngine::updateAccount() -- END";
+        emit accountNameChanged(mAccountName);
     }
+    qDebug() << "NmHsWidgetEmailEngine::updateAccount() -- END";
+    return true;
+}
 
 /*!
-  suspend slot.
-  \post engine will not emit signals or refresh its data during suspension.
+ suspend slot.
+ \post engine will not emit signals or refresh its data during suspension.
  */
 void NmHsWidgetEmailEngine::suspend()
-    {
-    qDebug()<<"NmHsWidgetEmailEngine::suspend() -- START";
+{
+    qDebug() << "NmHsWidgetEmailEngine::suspend() -- START";
     mSuspended = true;
-    qDebug()<<"NmHsWidgetEmailEngine::suspend() -- END";
-    }
+    qDebug() << "NmHsWidgetEmailEngine::suspend() -- END";
+}
 
 /*!
-  activate slot.
-  \post Engine will immediately refresh all the data that has been announced to
-  have changed during the suspension. Events are enabled.
+ activate slot.
+ \post Engine will immediately refresh all the data that has been announced to
+ have changed during the suspension. Events are enabled.
  */
 void NmHsWidgetEmailEngine::activate()
-    {
-    qDebug()<<"NmHsWidgetEmailEngine::activate() -- START";
-    mSuspended = false; 
-    if ( mAccountEventReceivedWhenSuspended )
-        {
+{
+    qDebug() << "NmHsWidgetEmailEngine::activate() -- START";
+    mSuspended = false;
+    if (mAccountEventReceivedWhenSuspended) {
         mAccountEventReceivedWhenSuspended = false;
         updateAccount();
-        }
-    if (mMessageEventReceivedWhenSuspended)
-        {
+    }
+    if (mMessageEventReceivedWhenSuspended) {
         mMessageEventReceivedWhenSuspended = false;
         updateData();
-        }
-    qDebug()<<"NmHsWidgetEmailEngine::activate() -- END";
     }
+    qDebug() << "NmHsWidgetEmailEngine::activate() -- END";
+}
 
 /*!
-  launchMailAppInboxView slot.
-  \post Mail application is launched to inbox view corresponding widget's mailbox id
+ launchMailAppInboxView slot.
+ \post Mail application is launched to inbox view corresponding widget's mailbox id
  */
 void NmHsWidgetEmailEngine::launchMailAppInboxView()
-    {
-    qDebug()<<"NmHsWidgetEmailEngine::launchMailAppInboxView() -- START";
+{
+    qDebug() << "NmHsWidgetEmailEngine::launchMailAppInboxView() -- START";
 
     XQServiceRequest request(
-        emailInterfaceNameMailbox,
+        emailFullServiceNameMailbox,
         emailOperationViewInbox,
         false);
     
@@ -335,23 +435,22 @@
     list.append(QVariant(mMailboxId.id()));
 
     request.setArguments(list);
-    QVariant returnValue;
-    bool rval = request.send(returnValue);
-    
-    qDebug()<<"NmHsWidgetEmailEngine::launchMailAppInboxView() -- END";
-    }
+    request.send();
+
+    qDebug() << "NmHsWidgetEmailEngine::launchMailAppInboxView() -- END";
+}
 
 /*!
-  launchMailAppMailViewer slot.
-  \param messageId Defines the message opened to viewer
-  \post Mail application is launched and viewing mail specified by
+ launchMailAppMailViewer slot.
+ \param messageId Defines the message opened to viewer
+ \post Mail application is launched and viewing mail specified by
  */
 void NmHsWidgetEmailEngine::launchMailAppMailViewer(const NmId &messageId)
-    {
-    qDebug()<<"NmHsWidgetEmailEngine::launchMailAppMailViewer() -- START";
+{
+    qDebug() << "NmHsWidgetEmailEngine::launchMailAppMailViewer() -- START";
 
     XQServiceRequest request(
-       emailInterfaceNameMessage,
+       emailFullServiceNameMessage,
        emailOperationViewMessage,
        false);
     
@@ -359,10 +458,9 @@
     list.append(QVariant(mMailboxId.id()));
     list.append(QVariant(mFolderId.id()));
     list.append(QVariant(messageId.id()));
-    
+
     request.setArguments(list);
-    QVariant returnValue;
-    bool rval = request.send(returnValue);
-    
-    qDebug()<<"NmHsWidgetEmailEngine::launchMailAppMailViewer() -- END";
-    }
+    request.send();
+
+    qDebug() << "NmHsWidgetEmailEngine::launchMailAppMailViewer() -- END";
+}
--- a/emailuis/nmhswidget/src/nmhswidgetemailrow.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmhswidget/src/nmhswidgetemailrow.cpp	Fri May 14 15:41:10 2010 +0300
@@ -20,31 +20,31 @@
 #include <hbdocumentloader.h>
 #include <hblabel.h>
 #include <hbextendedlocale.h>
+#include <HbFrameDrawer>
+#include <HbFrameItem>
 #include "nmicons.h"
 #include "nmcommon.h"
 #include "nmhswidgetemailrow.h"
 #include "nmhswidgetconsts.h"
 #include "nmmessageenvelope.h"
 
-NmHsWidgetEmailRow::NmHsWidgetEmailRow(QGraphicsItem *parent, Qt::WindowFlags flags)
-    : HbWidget(parent, flags),
-      mSenderLabel(0),
-      mSubjectLabel(0),
-      mTimeLabel(0),
-      mNewMailIcon(0),
-      mSeparatorIcon(0),
-      mMessageId(0)
+NmHsWidgetEmailRow::NmHsWidgetEmailRow(QGraphicsItem *parent, Qt::WindowFlags flags) :
+    HbWidget(parent, flags), 
+    mSenderLabel(0), 
+    mSubjectLabel(0), 
+    mTimeLabel(0), 
+    mNewMailIcon(0),
+    mSeparatorIcon(0), 
+    mMessageId(0)
 {
     qDebug() << "NmHsWidgetEmailRow::NmHsWidgetEmailRow IN -->>";
-    
-    loadDocML();
-    
+
     qDebug() << "NmHsWidgetEmailRow::NmHsWidgetEmailRow OUT <<--";
 }
 
 /*!
-    Destructor
-*/
+ Destructor
+ */
 NmHsWidgetEmailRow::~NmHsWidgetEmailRow()
 {
     qDebug() << "NmHsWidgetEmailRow::~NmHsWidgetEmailRow IN -->>";
@@ -53,8 +53,8 @@
 }
 
 /*!
-    Returns id of message shown
-*/
+ Returns id of message shown
+ */
 NmId NmHsWidgetEmailRow::messageId()
 {
     qDebug() << "NmHsWidgetEmailRow::messageId()";
@@ -63,99 +63,123 @@
 }
 
 /*!
-    Loads layout data and child items from docml file
-*/
-void NmHsWidgetEmailRow::loadDocML()
+ Loads layout data and child items from docml file
+ Must be called after constructor.
+  /return true if loading succeeded, otherwise false. False indicates that object is unusable.
+ */
+bool NmHsWidgetEmailRow::loadDocML()
 {
-    qDebug() << "NmHsWidgetEmailRow::loadDocML IN -->>";
+    HbFrameDrawer* backgroundFrameDrawer = 0;
+    HbFrameItem* backgroundLayoutItem = 0;
+    QT_TRY{
+        qDebug() << "NmHsWidgetEmailRow::loadDocML IN -->>";
+    
+        // Use document loader to load the contents
+        HbDocumentLoader loader;
+        bool ok(false);
+        loader.load(KNmHsWidgetMailRowDocML, &ok);
+        if (!ok) {
+            qDebug() << "NmHsWidgetEmailRow::loadDocML fail @ loader <<--";
+            return false;
+        }
+    
+        QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical);
     
-    QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical);
-    layout->setContentsMargins(KNmHsWidgetContentsMargin, KNmHsWidgetContentsMargin,
+        //Do the layout stuff and Set layout before next return to avoid memoryleak
+        layout->setContentsMargins(KNmHsWidgetContentsMargin, KNmHsWidgetContentsMargin,
             KNmHsWidgetContentsMargin, KNmHsWidgetContentsMargin);
-    layout->setSpacing(KNmHsWidgetContentsMargin);        
+        layout->setSpacing(KNmHsWidgetContentsMargin);
+        setLayout(layout);
     
-    // Use document loader to load the contents
-    HbDocumentLoader loader;
-    bool ok = false;
-    loader.load( KNmHsWidgetMailRowDocML, &ok);
-    Q_ASSERT_X(ok, "nmhswidget", "invalid email docml file");
+        //find container widget
+        QGraphicsWidget *container = loader.findWidget(KNmHsWidgetMailRowContainer);
+        if (!container) {
+            qDebug() << "NmHsWidgetEmailRow::loadDocML fail @ container <<--";
+            return false;
+        }
+        layout->addItem(container);
+    
+        //child items possible to update
+        //separator
+        mSeparatorIcon = static_cast<HbLabel*> (loader.findWidget(KNmHsWidgetMailSeparatorIcon));
+    
+        //labels
+        mSenderLabel = static_cast<HbLabel*> (loader.findWidget(KNmHsWidgetMailRowSenderLabel));
+        mSubjectLabel = static_cast<HbLabel*> (loader.findWidget(KNmHsWidgetMailRowSubjectLabel));
+        mTimeLabel = static_cast<HbLabel*> (loader.findWidget(KNmHsWidgetMailRowTimeLabel));
     
-    //find container widget
-    QGraphicsWidget *container = loader.findWidget(KNmHsWidgetMailRowContainer);
-    Q_ASSERT_X((container != 0), "nmhswidget", "email container not found!");
-    layout->addItem(container);
-
-    //separator
-    mSeparatorIcon = static_cast<HbLabel*>(loader.findWidget(KNmHsWidgetMailSeparatorIcon));
-    HbIcon separatorIcon("qtg_graf_divider_h_thin"); 
-    mSeparatorIcon->setIcon(separatorIcon);
+        //icons
+        mNewMailIcon = static_cast<HbLabel*> (loader.findWidget(KNmHsWidgetMailRowNewMailIcon));
+        // KNmHsWidgetMailRowLeftIcon is not yet used, because followup information is not shown in client side
+        // and thus it is not wanted to be shown in widget side
+        mStatusIcons.append(static_cast<HbLabel*> (loader.findWidget(KNmHsWidgetMailRowRightIcon)));
+        mStatusIcons.append(static_cast<HbLabel*> (loader.findWidget(KNmHsWidgetMailRowMiddleIcon)));
+        mStatusIcons.append(static_cast<HbLabel*> (loader.findWidget(KNmHsWidgetMailRowLeftIcon)));
+    
+        //Verify that items are valid
+        if (!mSenderLabel || !mSubjectLabel || !mTimeLabel || !mNewMailIcon || !mSeparatorIcon) {
+            qDebug() << "NmHsWidgetEmailRow::loadDocML fail @ labels & icons <<--";
+            return false;
+        }
+        //Verify all mStatusIcons
+        for (int i = 0; i < mStatusIcons.length(); i++) {
+            if (!mStatusIcons[i]) {
+                qDebug() << "NmHsWidgetEmailRow::loadDocML status icons <<--";
+                return false;
+            }
+        }
     
-    //child items possible to update
-    mSenderLabel = static_cast<HbLabel*>(loader.findWidget(KNmHsWidgetMailRowSenderLabel));
-    mSubjectLabel = static_cast<HbLabel*>(loader.findWidget(KNmHsWidgetMailRowSubjectLabel));
-    mTimeLabel = static_cast<HbLabel*>(loader.findWidget(KNmHsWidgetMailRowTimeLabel));
-
-    //Icons
-    mNewMailIcon = static_cast<HbLabel*>(loader.findWidget(KNmHsWidgetMailRowNewMailIcon));
-    HbIcon newEmailIcon("qtg_fr_list_new_item_c"); 
-    mNewMailIcon->setIcon(newEmailIcon);
-    // KNmHsWidgetMailRowLeftIcon is not yet used, because followup information is not shown in client side
-    // and thus it is not wanted to be shown in widget side
-    mStatusIcons.append( static_cast<HbLabel*>(loader.findWidget(KNmHsWidgetMailRowRightIcon)));
-    mStatusIcons.append( static_cast<HbLabel*>(loader.findWidget(KNmHsWidgetMailRowMiddleIcon)));
-    mStatusIcons.append( static_cast<HbLabel*>(loader.findWidget(KNmHsWidgetMailRowLeftIcon)));
-
-    //hide all the icons first to avoid blinking
-    hideIcons();
+        //separator icon
+        HbIcon separatorIcon("qtg_graf_divider_h_thin");
+        mSeparatorIcon->setIcon(separatorIcon);
+        
+        //new email icon
+        backgroundFrameDrawer = new HbFrameDrawer("qtg_fr_list_new_item",
+            HbFrameDrawer::ThreePiecesVertical);
+        backgroundLayoutItem = new HbFrameItem(backgroundFrameDrawer);
+        mNewMailIcon->setBackgroundItem(backgroundLayoutItem);
     
-    setLayout(layout);
+        //hide all the icons first to avoid blinking
+        hideIcons();
     
-    qDebug() << "NmHsWidgetEmailRow::loadDocML OUT <<--";
+        qDebug() << "NmHsWidgetEmailRow::loadDocML OK OUT <<--";
+        return true;
+    }
+    QT_CATCH(...){
+        if(!backgroundLayoutItem && backgroundFrameDrawer){
+            delete backgroundFrameDrawer;
+            backgroundFrameDrawer = NULL;
+        }
+        return false;
+    }
 }
 
 /*!
-    Sets the data provided as a parameter to the UI components
-    \param envelope message envelope representing an email
-*/
-void NmHsWidgetEmailRow::updateMailData( const NmMessageEnvelope& envelope )
-    {
+ Sets the data provided as a parameter to the UI components
+ \param envelope message envelope representing an email
+ */
+void NmHsWidgetEmailRow::updateMailData(const NmMessageEnvelope& envelope)
+{
     qDebug() << "NmHsWidgetEmailRow::updateMailData IN -->>";
 
     //hide all icons, so no previous data is messing with the new
     hideIcons();
 
-    mMessageId = envelope.id();
+    mMessageId = envelope.messageId();
     //Show sender name if it is available, otherwise show email address
     QString senderDisplayName = envelope.sender().displayName();
-    if ( !senderDisplayName.isNull() && !senderDisplayName.isEmpty()  )
-        {
-        mSenderLabel->setPlainText( senderDisplayName );
-        }
-    else
-        {
-        mSenderLabel->setPlainText ( envelope.sender().address() );
-        }
-    
+    if (!senderDisplayName.isNull() && !senderDisplayName.isEmpty()) {
+        mSenderLabel->setPlainText(senderDisplayName);
+    }
+    else {
+        mSenderLabel->setPlainText(envelope.sender().address());
+    }
+
     //Set subject
-    //Todo: what about empty subject?
-    mSubjectLabel->setPlainText( envelope.subject() );
+    mSubjectLabel->setPlainText(envelope.subject());
     
-    //Set Date with locale support
-    //Time shown if message is sent today, otherwise show date
-    HbExtendedLocale locale = HbExtendedLocale::system();
-    QDateTime now = QDateTime::currentDateTime();
-    QDateTime time = envelope.sentTime(); 
-    if ( time.date() == now.date() )
-        {
-        //time format specification
-        QString timeSpec = r_qtn_time_usual;
-        mTimeLabel->setPlainText( locale.format(time.time(), timeSpec) );
-        }
-    else
-        {
-        QString dateSpec = r_qtn_date_without_year;
-        mTimeLabel->setPlainText( locale.format(time.date(), dateSpec) );
-        }
+    mMessageSentTime = envelope.sentTime();
+    updateDateTime();
     
     //set new icons to widget based on the data
     setIconsToWidget( envelope );
@@ -163,42 +187,63 @@
     }
 
 /*!
-    hide icons from widget
+    updateDateTime to label using correct locale
 */
+void NmHsWidgetEmailRow::updateDateTime()
+    {
+    qDebug() << "NmHsWidgetEmailRow::updateDateTime IN -->>";
+    //Set Date with locale support
+    //Time shown if message is sent today, otherwise show date
+    HbExtendedLocale locale = HbExtendedLocale::system();
+    QDateTime now = QDateTime::currentDateTime();
+    if ( mMessageSentTime.date() == now.date() )
+        {
+        //time format specification
+        QString timeSpec = r_qtn_time_usual;
+        mTimeLabel->setPlainText( locale.format(mMessageSentTime.time(), timeSpec) );
+        }
+    else
+        {
+        QString dateSpec = r_qtn_date_without_year;
+        mTimeLabel->setPlainText( locale.format(mMessageSentTime.date(), dateSpec) );
+        }
+    qDebug() << "NmHsWidgetEmailRow::updateDateTime OUT <<--";
+    }
+
+/*!
+ hide icons from widget
+ */
 void NmHsWidgetEmailRow::hideIcons()
-    {
+{
     qDebug() << "NmHsWidgetEmailRow::hideIcons IN -->>";
-    for( int i = 0; i<mStatusIcons.count();i++)
-        {
+    for (int i = 0; i < mStatusIcons.count(); i++) {
         mStatusIcons[i]->hide();
-        }
+    }
     mNewMailIcon->hide();
     qDebug() << "NmHsWidgetEmailRow::hideIcons OUT <<--";
-    }
-
+}
 
 /*!
-    Set icons to widget
-*/
-void NmHsWidgetEmailRow::setIconsToWidget( const NmMessageEnvelope& envelope )
+ Set icons to widget
+ */
+void NmHsWidgetEmailRow::setIconsToWidget(const NmMessageEnvelope& envelope)
 {
     qDebug() << "NmHsWidgetEmailRow::setIconsToWidget IN -->>";
 
     bool unreadMail = !envelope.isRead();
     bool attachment = envelope.hasAttachments();
     int priority = envelope.priority();
-    
-    if(unreadMail){
-        //Todo: set unread icon when available
+
+    if (unreadMail) {
         mNewMailIcon->show();
     }
-    
+
     // Here we have list for priority and attachment icons. Later it is easy to add
     // followup icon or something else if needed.
     QList<HbIcon> iconList;
-    
+
     // Priority icon is added to list first thus it is always shown most right.
-    switch (priority){
+    switch (priority) {
         case NmMessagePriorityLow:
             iconList.append(NmIcons::getIcon(NmIcons::NmIconPriorityLow));
             break;
@@ -209,20 +254,40 @@
         default:
             // Normal priority has no icon
             break;
-        }
-    
+    }
+
     // Attachment icon is always shown on the left side of attachment icon if it
     // exists. Otherwise in the most right.
-    if(attachment){
+    if (attachment) {
         iconList.append(NmIcons::getIcon(NmIcons::NmIconAttachment));
     }
 
     // Here we show icons added to the iconList in the order they have been added.
-    for(int count = 0; count<iconList.count(); count++){
+    for (int count = 0; count < iconList.count(); count++) {
         mStatusIcons[count]->setIcon(iconList[count]);
         mStatusIcons[count]->show();
     }
-    
+
     qDebug() << "NmHsWidgetEmailRow::setIconsToWidget OUT <<--";
 }
 
+/*!
+ mousePressEvent(QGraphicsSceneMouseEvent *event)
+ */
+void NmHsWidgetEmailRow::mousePressEvent(QGraphicsSceneMouseEvent *event)
+{
+    qDebug() << "NmHsWidgetTitleRow::mousePressEvent() IN -->>";
+    Q_UNUSED(event); 
+    qDebug() << "NmHsWidgetTitleRow::mousePressEvent() OUT <<--";
+}
+
+/*!
+    mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
+*/
+void NmHsWidgetEmailRow::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
+{
+    qDebug() << "NmHsWidgetTitleRow::mouseReleaseEvent() IN -->>";
+    Q_UNUSED(event);
+    emit mailViewerLaunchTriggered(mMessageId);
+    qDebug() << "NmHsWidgetTitleRow::mouseReleaseEvent() OUT <<--";
+}
--- a/emailuis/nmhswidget/src/nmhswidgettitlerow.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmhswidget/src/nmhswidgettitlerow.cpp	Fri May 14 15:41:10 2010 +0300
@@ -16,97 +16,156 @@
  */
 
 #include <QDebug>
+#include <QtGui>
 #include <QGraphicsLinearLayout>
 #include <hbdocumentloader.h>
 #include <hblabel.h>
+#include <HbPushButton>
 #include "nmicons.h"
 #include "nmhswidgettitlerow.h"
 #include "nmhswidgetconsts.h"
 
-NmHsWidgetTitleRow::NmHsWidgetTitleRow(QGraphicsItem *parent, Qt::WindowFlags flags)
-    : HbWidget(parent, flags),
-      mMailboxIcon(0),
-      mMailboxInfo(0),
-      mAccountName(0),
-      mUnreadCount(0)
+NmHsWidgetTitleRow::NmHsWidgetTitleRow(QGraphicsItem *parent, Qt::WindowFlags flags) :
+    HbWidget(parent, flags), 
+    mMailboxIcon(0), 
+    mMailboxInfo(0), 
+    mUnreadCountLabel(0),
+    mCollapseExpIconLabel(0), 
+    mAccountName(0), 
+    mUnreadCount(0)
 {
     qDebug() << "NmHsWidgetTitleRow::NmHsWidgetTitleRow IN -->>";
-    
-    loadDocML();
-    
+
     qDebug() << "NmHsWidgetTitleRow::NmHsWidgetTitleRow OUT <<--";
 }
 
 /*!
-    Destructor
-*/
+ Destructor
+ */
 NmHsWidgetTitleRow::~NmHsWidgetTitleRow()
 {
     qDebug() << "NmHsWidgetTitleRow::~NmHsWidgetTitleRow IN -->>";
 
     qDebug() << "NmHsWidgetTitleRow::~NmHsWidgetTitleRow OUT <<--";
 }
-    
+
 /*!
-    Loads layout data and child items from docml file
-*/
-void NmHsWidgetTitleRow::loadDocML()
+ Loads layout data and child items from docml file. Must be called after constructor.
+ /return true if loading succeeded, otherwise false. False indicates that object is unusable
+ */
+bool NmHsWidgetTitleRow::loadDocML()
 {
-    qDebug() << "NmHsWidgetTitleRow::loadDocML IN -->>";
+    QT_TRY{
+        qDebug() << "NmHsWidgetTitleRow::loadDocML IN -->>";
     
-    QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical);
-    layout->setContentsMargins(KNmHsWidgetContentsMargin, KNmHsWidgetContentsMargin,
+        // Use document loader to load the contents
+        HbDocumentLoader loader;
+        bool ok(false);
+        loader.load(KNmHsWidgetTitleRowDocML, &ok);
+        if (!ok) {
+            qDebug() << "NmHsWidgetTitleRow::loadDocML Fail @ loader -->>";
+            return false; //failure
+        }
+    
+        //Create layout
+        QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical);
+    
+        layout->setContentsMargins(KNmHsWidgetContentsMargin, KNmHsWidgetContentsMargin,
             KNmHsWidgetContentsMargin, KNmHsWidgetContentsMargin);
-    layout->setSpacing(KNmHsWidgetContentsMargin);    
+        layout->setSpacing(KNmHsWidgetContentsMargin);
+        setLayout(layout); //pass the ownership
     
-    // Use document loader to load the contents
-    HbDocumentLoader loader;
-    bool ok = false;
-    loader.load( KNmHsWidgetTitleRowDocML, &ok);
-    Q_ASSERT_X(ok, "nmhswidget", "invalid title docml file");
+        // find container widget
+        QGraphicsWidget *container = loader.findWidget(KNmHsWidgetTitleRowContainer);
+        if (!container) {
+            qDebug() << "NmHsWidgetTitleRow::loadDocML Fail @ container -->>";
+            return false;
+        }
+        layout->addItem(container);
     
-    // find container widget
-    QGraphicsWidget *container = loader.findWidget(KNmHsWidgetTitleRowContainer);
-    Q_ASSERT_X((container != 0), "nmhswidget", "container not found!");
-    layout->addItem(container);
+        //child items possible to update
+        mMailboxIcon = static_cast<HbLabel*> (loader.findWidget(KNmHsWidgetTitleRowMailboxIcon));
+        mMailboxInfo = static_cast<HbLabel*> (loader.findWidget(KNmHsWidgetTitleRowMailboxNameLabel));
+        mUnreadCountLabel = static_cast<HbLabel*> (loader.findWidget(
+            KNmHsWidgetTitleRowUnreadCountLabel));
+        mCollapseExpIconLabel = static_cast<HbPushButton*> (loader.findWidget(
+            KNmHsWidgetTitleRowCollapseExpandIconLabel));
     
-    //child items possible to update
-    mMailboxIcon = static_cast<HbLabel*>(loader.findWidget(KNmHsWidgetTitleRowMailboxIcon));
-    mMailboxIcon->setIcon(NmIcons::getIcon(NmIcons::NmIconDefaultMailbox));
-    mMailboxInfo = static_cast<HbLabel*>(loader.findWidget(KNmHsWidgetTitleRowMailboxNameLabel));
-
-    setLayout(layout);
+        if (!mMailboxIcon || !mMailboxInfo || !mUnreadCountLabel || !mCollapseExpIconLabel) {
+            qDebug() << "NmHsWidgetTitleRow::loadDocML Fail @ icons & labels -->>";
+            return false;
+        }
     
-    qDebug() << "NmHsWidgetTitleRow::loadDocML OUT <<--";
+        //Expand collapse button
+        connect(mCollapseExpIconLabel, SIGNAL(clicked()), this, SIGNAL(expandCollapseButtonPressed()));
+    
+        qDebug() << "NmHsWidgetTitleRow::loadDocML OUT <<--";
+        return true;
+    }
+    QT_CATCH(...){
+        return false;
+    }
 }
 
 /*!
-    Slot for updating account name, calls updateData to update ui.
-*/
-void NmHsWidgetTitleRow::updateAccountName(const QString& accountName )
-    {
+ Slot for updating account name, calls updateData to update ui.
+ */
+void NmHsWidgetTitleRow::updateAccountName(const QString& accountName)
+{
+    qDebug() << "NmHsWidgetTitleRow::updateAccountName IN -->>";
     mAccountName = accountName;
     updateData();
-    }
+    qDebug() << "NmHsWidgetTitleRow::updateAccountName OUT <<--";
+}
 
 /*!
-    Slot for updating unread count, calls updateData to update ui.
-*/
-void NmHsWidgetTitleRow::updateUnreadCount(const int& unreadCount )
-    {
+ Set account icon name
+ */
+void NmHsWidgetTitleRow::setAccountIcon(const QString& accountIconName)
+{
+    qDebug() << "NmHsWidgetTitleRow::setAccountIcon -- accountIconName" << accountIconName;
+    mMailboxIcon->setIcon(accountIconName);
+    qDebug() << "NmHsWidgetTitleRow::setAccountIcon OUT <<--";
+}
+
+/*!
+ Slot for updating unread count, calls updateData to update ui.
+ */
+void NmHsWidgetTitleRow::updateUnreadCount(const int& unreadCount)
+{
+    qDebug() << "NmHsWidgetTitleRow::updateUnreadCount IN -->>";
     mUnreadCount = unreadCount;
     updateData();
-    }
+    qDebug() << "NmHsWidgetTitleRow::updateUnreadCount OUT <<--";
+}
 
 /*!
-    Update the data displayed in the UI
-*/
+ Update the data displayed in the UI
+ */
 void NmHsWidgetTitleRow::updateData()
-    {
-    //TODO: Sprint 3: use localization for displaying data
-    QString info = mAccountName;
-    info.append(" (");
-    info.append( QString::number(mUnreadCount));
-    info.append(")");
-    mMailboxInfo->setPlainText(info);
+{
+    qDebug() << "NmHsWidgetTitleRow::updateData() IN -->>";
+    mMailboxInfo->setPlainText(mAccountName);
+    //If unread count is -1, hide the unread count label completely.
+    //This indicates that there are no mails at all (or the initial sync is not done)
+    if (mUnreadCount != -1) {
+        QString unreadCount(hbTrId("txt_mail_widget_list_l1").arg(mUnreadCount));
+        mUnreadCountLabel->setPlainText(unreadCount);
+        mUnreadCountLabel->setVisible(true);
+    }
+    else {
+        mUnreadCountLabel->setVisible(false);
     }
+    qDebug() << "NmHsWidgetTitleRow::updateData() OUT <<--";
+}
+
+/*!
+ mousePressEvent(QGraphicsSceneMouseEvent *event)
+ */
+void NmHsWidgetTitleRow::mousePressEvent(QGraphicsSceneMouseEvent *event)
+{
+    qDebug() << "NmHsWidgetTitleRow::mousePressEvent() IN -->>";
+    Q_UNUSED(event); 
+	emit mailboxLaunchTriggered();
+    qDebug() << "NmHsWidgetTitleRow::mousePressEvent() OUT <<--";
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmhswidget/translations/mailwidget.ts	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="3.0" sourcelanguage="en_GB">
+<context>
+<message numerus="no" id="txt_mail_widget_list_l1">
+    <comment>New mail count in parenthesis after the Mail box name which is the title of the widget. Max number shown 999.</comment>        
+    <source>(%L1)</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_list_tiny</extra-loc-layout_id>    
+    <extra-loc-viewid>Mail Widget</extra-loc-viewid>
+    <extra-loc-positionid>List</extra-loc-positionid>
+    <extra-loc-feature>Mail Widget</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+</context>
+</TS>
--- a/emailuis/nmindicatorplugin/inc/nmindicator.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmindicatorplugin/inc/nmindicator.h	Fri May 14 15:41:10 2010 +0300
@@ -30,6 +30,7 @@
 public:
     NmId mId;
     QString mName;
+    QString mMailboxIconName;
     NmSyncState mSyncState;
     NmConnectState mConnectState;
     int mUnreadMails;
--- a/emailuis/nmindicatorplugin/inc/nmindicatorplugin.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmindicatorplugin/inc/nmindicatorplugin.h	Fri May 14 15:41:10 2010 +0300
@@ -42,7 +42,8 @@
 public: // From HbIndicatorPluginInterface
     QStringList indicatorTypes() const;
     bool accessAllowed(const QString &indicatorType,
-                               const HbSecurityInfo *securityInfo) const;
+        const QVariantMap &securityInfo) const;
+        
     HbIndicatorInterface* createIndicator(const QString &indicatorType);
     int error() const;
 
--- a/emailuis/nmindicatorplugin/nmindicatorplugin.pro	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmindicatorplugin/nmindicatorplugin.pro	Fri May 14 15:41:10 2010 +0300
@@ -21,20 +21,15 @@
 
 MOC_DIR = moc
 
-INCLUDEPATH += .
 DEPENDPATH += .
 INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-INCLUDEPATH += ../../../../inc
-INCLUDEPATH += ../../emailservices/nmailbase/inc
+INCLUDEPATH += ../../inc
 
 HEADERS += inc/nmindicatorplugin.h \
            inc/nmindicator.h
 SOURCES += src/nmindicatorplugin.cpp \
            src/nmindicator.cpp
 
-LIBS += -leuser
-LIBS += -llibc
-
 symbian {
     TARGET.EPOCALLOWDLLDATA=1
     TARGET.CAPABILITY = ALL -TCB
@@ -43,6 +38,9 @@
     pluginstub.sources = nmindicatorplugin.dll
     pluginstub.path = /resource/plugins/indicators
     DEPLOYMENT += pluginstub
+
+    LIBS += -leuser
+    LIBS += -llibc
     LIBS += -lxqservice
 }
 
--- a/emailuis/nmindicatorplugin/src/nmindicator.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmindicatorplugin/src/nmindicator.cpp	Fri May 14 15:41:10 2010 +0300
@@ -26,7 +26,7 @@
 
 #include <HbStringUtil>
 
-const int NmMailboxInfoItemCount = 7;
+const int NmMailboxInfoItemCount = 8;
 const int NmSendingStateDelay = 2000; // delay for 'send in progress' indicator
 const int NmMaxOutboxCount = 99;
 
@@ -127,9 +127,9 @@
 */
 QVariant NmIndicator::indicatorData(int role) const
 {
-    NMLOG("NmIndicator::indicatorData");
+    NMLOG(QString("NmIndicator::indicatorData %1").arg(role));
     switch(role) {
-        case TextRole:
+        case PrimaryTextRole:
             {
             return mMailbox.mName;
             }
@@ -153,7 +153,12 @@
             {
 			// Icon for the mailbox in the menu
             if (mActive) {
-                return QString("qtg_large_email");
+                if (!mMailbox.mMailboxIconName.isEmpty()) {
+                    return mMailbox.mMailboxIconName;
+                }
+                else {
+                    return QString("qtg_large_email");
+                }
             }
             break;
 		    }
@@ -169,9 +174,9 @@
 }
 
 /*!
-    Timer callback for hiding 'send in progress' indicator 
+    Timer callback for hiding 'send in progress' indicator
 */
-void NmIndicator::hideSendIndicator() 
+void NmIndicator::hideSendIndicator()
 {
     if (mShowSendProgress) {
         NMLOG("NmIndicator::hideSendIndicator - hide progress state");
@@ -222,6 +227,7 @@
             {
             mActive = true;
 			storeMailboxData(parameter);
+
             emit dataChanged();
             handled =  true;
             }
@@ -256,7 +262,7 @@
     // Activate the progress indicator
     if (!mShowSendProgress && mActive) {
         mShowSendProgress = true;
-        
+
         // Hide the progress state after some delay
         QTimer::singleShot(NmSendingStateDelay, this, SLOT(hideSendIndicator()));
     }
@@ -277,10 +283,11 @@
         mMailbox.mSyncState = infoList.at(3).value<NmSyncState>();
         mMailbox.mConnectState = infoList.at(4).value<NmConnectState>();
         mMailbox.mOutboxMails = infoList.at(5).toInt();
-        
+        mMailbox.mMailboxIconName = infoList.at(6).toString();
+
         bool oldSendingState = mSendingState;
-        mSendingState = infoList.at(6).toInt();
-        
+        mSendingState = infoList.at(7).toInt();
+
         // Sending state now activated
         if (!oldSendingState && mSendingState) {
             showSendProgress();
--- a/emailuis/nmindicatorplugin/src/nmindicatorplugin.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmindicatorplugin/src/nmindicatorplugin.cpp	Fri May 14 15:41:10 2010 +0300
@@ -29,6 +29,7 @@
 Q_EXPORT_PLUGIN(NmIndicatorPlugin)
 
 const int NmMaxIndicatorCount = 10;
+static const QString emailServiceNameMailbox = "nmail.com.nokia.symbian.IEmailInboxView";
 
 /*!
     \class NmIndicatorPlugin
@@ -66,11 +67,11 @@
 }
 
 /*!
-	Check if client is allowed to use notification widget
-	see HbIndicatorPluginInterface
+    Check if client is allowed to use notification widget
+    see HbIndicatorPluginInterface
 */
 bool NmIndicatorPlugin::accessAllowed(const QString &indicatorType,
-    const HbSecurityInfo *securityInfo) const
+    const QVariantMap &securityInfo) const
 {
     Q_UNUSED(indicatorType)
     Q_UNUSED(securityInfo)
@@ -80,6 +81,7 @@
     return true;
 }
 
+
 /*!
     Called when any of the indicator receive updated status of the global status
  */
@@ -175,7 +177,7 @@
 {
     NMLOG("NmIndicatorPlugin::showMailbox");
     XQServiceRequest request(
-        emailInterfaceNameMailbox,
+        emailServiceNameMailbox,
         emailOperationViewInbox,
         true);
 
--- a/emailuis/nmsettingui/bwins/nmsettinguiu.def	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmsettingui/bwins/nmsettinguiu.def	Fri May 14 15:41:10 2010 +0300
@@ -33,4 +33,6 @@
 	?goOnline@NmSettingsViewLauncher@@IAEXABVNmId@@@Z @ 32 NONAME ; void NmSettingsViewLauncher::goOnline(class NmId const &)
 	?aboutToClose@NmSettingsViewFactory@@IAEXXZ @ 33 NONAME ; void NmSettingsViewFactory::aboutToClose(void)
 	?goOffline@NmSettingsViewLauncher@@IAEXABVNmId@@@Z @ 34 NONAME ; void NmSettingsViewLauncher::goOffline(class NmId const &)
+	?createMessageBox@NmSettingsViewFactory@@AAEXXZ @ 35 NONAME ; void NmSettingsViewFactory::createMessageBox(void)
+	?launchWizard@NmSettingsViewFactory@@AAEXPAVHbAction@@@Z @ 36 NONAME ; void NmSettingsViewFactory::launchWizard(class HbAction *)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmsettingui/conf/nmmailboxsettingview.docml	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.0">
+    <widget name="mailboxSettingViewForm" type="HbDataForm"/>
+    <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+        <uistate name="Common ui state" sections="#common"/>
+    </metadata>
+</hbdocument>
--- a/emailuis/nmsettingui/eabi/nmsettinguiu.def	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmsettingui/eabi/nmsettinguiu.def	Fri May 14 15:41:10 2010 +0300
@@ -36,4 +36,6 @@
 	_ZN21NmSettingsViewFactory12aboutToCloseEv @ 35 NONAME
 	_ZN22NmSettingsViewLauncher8goOnlineERK4NmId @ 36 NONAME
 	_ZN22NmSettingsViewLauncher9goOfflineERK4NmId @ 37 NONAME
+	_ZN21NmSettingsViewFactory12launchWizardEP8HbAction @ 38 NONAME
+	_ZN21NmSettingsViewFactory16createMessageBoxEv @ 39 NONAME
 
--- a/emailuis/nmsettingui/inc/nmmailboxselectionview.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmsettingui/inc/nmmailboxselectionview.h	Fri May 14 15:41:10 2010 +0300
@@ -52,7 +52,7 @@
 public slots:
 
     void buttonClick(QObject *item);
-    void formActivate(const QModelIndex &index );
+    void itemActivate(const QModelIndex &index );
 
 private slots:
 
@@ -75,7 +75,6 @@
     HbDataFormModel *mModel;
     // Owned.
     QSignalMapper *mSignalMapper;
-    bool mSignalMapperConnected;
     bool mRefreshForm;
 };
 
--- a/emailuis/nmsettingui/inc/nmsettingsviewfactory.h	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmsettingui/inc/nmsettingsviewfactory.h	Fri May 14 15:41:10 2010 +0300
@@ -31,6 +31,8 @@
 class NmId;
 class NmSettingsViewLauncher;
 class HbView;
+class HbMessageBox;
+class HbAction;
 
 class NMAILSETTINGUI_EXPORT NmSettingsViewFactory : public CpSettingFormEntryItemData
 {
@@ -65,9 +67,12 @@
 private slots:
 
     void backPress();
+    void launchWizard(HbAction *action);
 
 private:
 
+    void createMessageBox();
+
     Q_DISABLE_COPY(NmSettingsViewFactory)
 
 private: // data
@@ -80,6 +85,9 @@
 
     // Not Owned.
     mutable HbView* mPrevView;
+
+    // Owned.
+    HbMessageBox *mMessageBox;
 };
 
 
--- a/emailuis/nmsettingui/nmsettingui.pro	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmsettingui/nmsettingui.pro	Fri May 14 15:41:10 2010 +0300
@@ -23,10 +23,8 @@
 
 DEPENDPATH += .
 
-INCLUDEPATH += .
 INCLUDEPATH += ./inc
 INCLUDEPATH += ../../inc
-INCLUDEPATH += ../nmailuiengine/inc
 INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
 
 CONFIG += hb
@@ -39,12 +37,8 @@
 
 # Platforms
 SYMBIAN_PLATFORMS = WINSCW \
-    ARMV5
-LIBS += -lcpframework
-LIBS += -lnmailuiengine
-LIBS += -lnmailbase
-LIBS += -leuser
-LIBS += -llibc
+                    ARMV5
+
 # Input
 HEADERS += inc/nmsettinguidef.h
 HEADERS += inc/nmsettingsviewfactory.h
@@ -80,6 +74,12 @@
     # Build.inf rules
     BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
     "rom/nmsettingui.iby CORE_APP_LAYER_IBY_EXPORT_PATH(nmsettingui.iby)"
+
+    LIBS += -lcpframework
+    LIBS += -lnmailuiengine
+    LIBS += -lnmailbase
+    LIBS += -leuser
+    LIBS += -llibc
 }
 
 TARGET.CAPABILITY = All -TCB
--- a/emailuis/nmsettingui/src/nmmailboxselectionview.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmsettingui/src/nmmailboxselectionview.cpp	Fri May 14 15:41:10 2010 +0300
@@ -49,14 +49,14 @@
 : CpBaseSettingView(0, parent),
   mSettingsManager(settingsManager),
   mSettingsFactory(settingsFactory),
-  mSignalMapperConnected(false),
   mRefreshForm(false)
 {
     QScopedPointer<QSignalMapper> signalMapper(new QSignalMapper());
 
-    // Connect the form activated signal.
-    connect(settingForm(), SIGNAL(activated(QModelIndex)),
-        this, SLOT(formActivate(QModelIndex)));
+    // Connect the form's activated signal.
+    HbDataForm *form = qobject_cast<HbDataForm*>(widget());
+    connect(form, SIGNAL(activated(QModelIndex)),
+        this, SLOT(itemActivate(QModelIndex)));
 
     QScopedPointer<CpItemDataHelper> itemHelper(new CpItemDataHelper());
     QScopedPointer<HbDataFormModel> model(new HbDataFormModel());
@@ -103,32 +103,33 @@
 }
 
 /*!
-    Handles the form activate signal. Maps the signal/mailbox item for the
-    buttons.
+    Handels the dataform's activated signal when item is shown. 
+    Maps the signal/mailbox item for the buttons.
 
     \param index Data model index.
 
 */
-void NmMailboxSelectionView::formActivate(const QModelIndex &index)
+void NmMailboxSelectionView::itemActivate(const QModelIndex &index)
 {
-    NMLOG("NmMailboxSelectionView::formActivate");
-    HbWidget *widget = settingForm()->dataFormViewItem(index)->dataItemContentWidget();
-    HbDataFormModel *model = static_cast<HbDataFormModel *>(settingForm()->model());
+    NMLOG("NmMailboxSelectionView::itemActivate");
+    
+    HbDataForm *form = qobject_cast<HbDataForm*>(widget());
+    HbDataFormModel *model = static_cast<HbDataFormModel *>(form->model());
     NmMailboxEntryItem *item = static_cast<NmMailboxEntryItem *>(model->itemFromIndex(index));
-    HbPushButton *button = static_cast<HbPushButton *>(widget);
-
+    
     if (!mSignalMapper->mapping(item)) {
+        
+        HbDataFormViewItem *viewItem = 
+            static_cast<HbDataFormViewItem *>(form->itemByIndex(index));
+        HbPushButton *button = 
+            static_cast<HbPushButton *>(viewItem->dataItemContentWidget());
+        
         connect(button, SIGNAL(pressed()), mSignalMapper, SLOT(map()));
-
+    
         mSignalMapper->setMapping(button, item);
-
-        // Form activate is called as many times as there are items in the view.
-        // This prevents multiple connections, so that the button click
-        // will be called only once.
-        if (!mSignalMapperConnected) {
-            connect(mSignalMapper, SIGNAL(mapped(QObject *)), this, SLOT(buttonClick(QObject *)));
-            mSignalMapperConnected = true;
-        }
+    
+        connect(mSignalMapper, SIGNAL(mapped(QObject *)), 
+            this, SLOT(buttonClick(QObject *)), Qt::UniqueConnection);
     }
 }
 
@@ -150,7 +151,8 @@
         mModel->appendDataFormItem(item.data());
         item.take();
     }
-    settingForm()->setModel(mModel);
+    HbDataForm *form = qobject_cast<HbDataForm*>(widget());
+    form->setModel(mModel);
 }
 
 /*!
--- a/emailuis/nmsettingui/src/nmmailboxsettingview.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmsettingui/src/nmmailboxsettingview.cpp	Fri May 14 15:41:10 2010 +0300
@@ -75,7 +75,7 @@
 
     if (mForm) {
         // Set the form for the view.
-        setSettingForm(mForm);
+        setWidget(mForm);
 
         // Make the custom items available.
         NmSettingsFormCustomItems *customItems = new NmSettingsFormCustomItems(mForm);
--- a/emailuis/nmsettingui/src/nmsettingsviewfactory.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/nmsettingui/src/nmsettingsviewfactory.cpp	Fri May 14 15:41:10 2010 +0300
@@ -61,8 +61,10 @@
     const HbIcon &icon,
     const HbDataFormModelItem *parent)
  : CpSettingFormEntryItemData(itemDataHelper, text, description, icon, parent),
-   mSettingsManager(new NmMailboxSettingsManager()), mSettingsViewLauncher(0),mPrevView(0)
+   mSettingsManager(new NmMailboxSettingsManager()), mSettingsViewLauncher(0),mPrevView(0),
+   mMessageBox(0)
 {
+    createMessageBox();
 }
 
 
@@ -85,8 +87,10 @@
     const HbIcon &icon,
     const HbDataFormModelItem *parent)
  : CpSettingFormEntryItemData(itemDataHelper, text, description, icon, parent),
-     mSettingsManager(new NmMailboxSettingsManager()), mSettingsViewLauncher(viewLauncher), mPrevView(0)
+     mSettingsManager(new NmMailboxSettingsManager()), mSettingsViewLauncher(viewLauncher),
+     mPrevView(0), mMessageBox(0)
 {
+    createMessageBox();
 }
 
 
@@ -96,6 +100,7 @@
 NmSettingsViewFactory::~NmSettingsViewFactory()
 {
     delete mSettingsManager;
+    delete mMessageBox;
 }
 
 
@@ -119,33 +124,27 @@
     NMLOG(QString("NmSettingsViewFactory::createSettingView(): Mailbox count is ") +
           QString::number(mailboxCount));
 
-    if (mailboxCount == 0) {
-        // Query the user whether to launch the wizard or not.
-        HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
-        messageBox->setText(hbTrId("txt_mail_dialog_no_mailboxes_create_new"));
-        messageBox->setTimeout(HbMessageBox::NoTimeout);
-
-        // Read the user selection.
-        HbAction *action = messageBox->exec();
+    switch(mailboxCount) {
+        case 0: {
+            // Query the user whether to launch the wizard or not.
+            mMessageBox->open(const_cast<NmSettingsViewFactory *>(this),
+                              SLOT(launchWizard(HbAction *)));
+            break;
+        }
+        case 1: {
+            // Construct setting view for the only available mailbox
+            NmMailbox *mailbox = mailboxList.at(0);
+            view = new NmMailboxSettingView(mailbox->id(),
+                                            mailbox->name(),
+                                            *mSettingsManager);
+            break;
+        }
+        default: {
+            // Construct mailbox selection view
+            view = new NmMailboxSelectionView(*this, *mSettingsManager, mailboxList);
+            break;
+        }
 
-        if (action == messageBox->primaryAction()) {
-            // Launch mail wizard.
-            NMLOG(QString("NmSettingsViewFactory::createSettingView(): Launching the mail wizard."));
-            QStringList args;
-            args << mailWizardStartArgs;
-            QProcess::startDetached(mailWizardStartExe, args);
-        }
-    }
-    else if (mailboxCount == 1) {
-        // Construct setting view for the only available mailbox
-        NmMailbox *mailbox = mailboxList.at(0);
-        view = new NmMailboxSettingView(mailbox->id(),
-                                        mailbox->name(),
-                                        *mSettingsManager);
-    }
-    else if (mailboxCount > 1) {
-        // Construct mailbox selection view
-        view = new NmMailboxSelectionView(*this, *mSettingsManager, mailboxList);
     }
 
     if (view) {
@@ -215,17 +214,17 @@
     connect(mSettingsManager,
             SIGNAL(goOnline(const NmId &)),
             mSettingsViewLauncher,
-            SIGNAL(goOnline(const NmId &)));
+            SIGNAL(goOnline(const NmId &)), Qt::UniqueConnection);
 
     connect(mSettingsManager,
             SIGNAL(goOffline(const NmId &)),
             mSettingsViewLauncher,
-            SIGNAL(goOffline(const NmId &)));
+            SIGNAL(goOffline(const NmId &)), Qt::UniqueConnection);
 
     connect(this,
             SIGNAL(aboutToClose()),
             mSettingsManager,
-            SIGNAL(aboutToClose()));
+            SIGNAL(aboutToClose()), Qt::UniqueConnection);
 
     // Create back navigation action for a view.
     HbAction *action = new HbAction(Hb::BackNaviAction, view);
@@ -265,4 +264,31 @@
     NMLOG(QString("NmSettingsViewFactory::backPress - OK"));
 }
 
+/*!
+    Handles user selection from "No mailboxes defined" dialog. Launches the Mail Wizard if \a action
+    is the dialog's primary action ("Yes"). Otherwise does nothing.
+    \param action. Action selected by the user.
+*/
+void NmSettingsViewFactory::launchWizard(HbAction *action)
+{
+    if (action == mMessageBox->primaryAction()) {
+        // Launch mail wizard.
+        NMLOG(QString("NmSettingsViewFactory::launchWizard(): Launching the mail wizard."));
+        QStringList args;
+        args << mailWizardStartArgs;
+        QProcess::startDetached(mailWizardStartExe, args);
+    }
+}
+
+/*!
+    Creates the "No mailboxes defined" dialog. Called from the constructors.
+*/
+void NmSettingsViewFactory::createMessageBox()
+{
+    mMessageBox = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
+    mMessageBox->setText(hbTrId("txt_mail_dialog_no_mailboxes_create_new"));
+    mMessageBox->setTimeout(HbMessageBox::NoTimeout);
+}
+
+
 // End of file.
--- a/emailuis/rom/nmail.iby	Mon May 03 12:23:15 2010 +0300
+++ b/emailuis/rom/nmail.iby	Fri May 14 15:41:10 2010 +0300
@@ -25,7 +25,6 @@
 
 file=ABI_DIR\BUILD_DIR\nmailui.exe                  SHARED_LIB_DIR\nmailui.exe   
 HB_UPGRADABLE_APP_REG_RSC(nmailui)
-S60_APP_RESOURCE(nmailui)
 
 file=ABI_DIR\BUILD_DIR\nmailuiengine.dll	SHARED_LIB_DIR\nmailuiengine.dll    PAGED
 file=ABI_DIR\BUILD_DIR\nmailbase.dll		SHARED_LIB_DIR\nmailbase.dll        PAGED
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/emailmailboxinfo.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,18 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "../emailservices/nmutilities/inc/emailmailboxinfo.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/ipssettingkeys.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,18 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Email mailbox setting key definitions for IMAP4/POP3
+*
+*/
+
+#include "../ipsservices/nmipssettings/inc/ipssettingkeys.h"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/nmailuiwidgetsdef.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,18 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "../emailuis/nmailuiwidgets/inc/nmailuiwidgetsdef.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/nmattachmentlistwidget.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,18 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "../emailuis/nmailuiwidgets/inc/nmattachmentlistwidget.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/nmbaseviewscrollarea.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,18 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include "../emailuis/nmailuiwidgets/inc/nmbaseviewscrollarea.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/nmdatamanager.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,18 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "../emailuis/nmailuiengine/inc/nmdatamanager.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/nmdatapluginfactory.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,18 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "../emailuis/nmailuiengine/inc/nmdatapluginfactory.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/nmeditortextedit.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,18 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "../emailuis/nmailuiwidgets/inc/nmeditortextedit.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/nmhtmllineedit.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,18 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include "../emailuis/nmailuiwidgets/inc/nmhtmllineedit.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/nmmessagesearchlistmodel.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,20 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include "../emailuis/nmailuiengine/inc/nmmessagesearchlistmodel.h"
+
+// End of file.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/nmrecipientlineedit.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,18 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include "../emailuis/nmailuiwidgets/inc/nmrecipientlineedit.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/nmsettingsviewfactory.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,18 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "../emailuis/nmsettingui/inc/nmsettingsviewfactory.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/nmsettingsviewlauncher.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,18 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "../emailuis/nmsettingui/inc/nmsettingsviewlauncher.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/nmsettinguidef.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,18 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "../emailuis/nmsettingui/inc/nmsettinguidef.h"
--- a/ipsservices/ipssosaoplugin/data/200100BA.rss	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosaoplugin/data/200100BA.rss	Fri May 14 15:41:10 2010 +0300
@@ -17,8 +17,9 @@
 
 
 #include <ecom/registryinfo.rh>
+//<Qmail>
 #include "../../inc/emailversionnumbers.hrh" // KEmailEcomVersionNumber
-
+//</Qmail>
 // ---------------------------------------------------------------------------
 // theInfo
 // Defines the ecom plugin for IPSSosSmtpPlugin
--- a/ipsservices/ipssosaoplugin/inc/IpsSosAOBaseAgent.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosaoplugin/inc/IpsSosAOBaseAgent.h	Fri May 14 15:41:10 2010 +0300
@@ -17,8 +17,8 @@
 */
 
 
-#ifndef IPSSOSAOBASEAGENT_H_
-#define IPSSOSAOBASEAGENT_H_
+#ifndef IPSSOSAOBASEAGENT_H
+#define IPSSOSAOBASEAGENT_H
 
 #include <e32base.h> 
 #include <msvapi.h>
@@ -58,7 +58,9 @@
 *
 * @lib ipssosaoplugin.lib
 */
+//<Qmail>
 NONSHARABLE_CLASS (CIpsSosAOBaseAgent) : public CActive
+//</Qmail>
     {
     
 public: // enums
@@ -235,4 +237,4 @@
     
     };
 
-#endif /*IPSSOSAOBASEAGENT_H_*/
+#endif /*IPSSOSAOBASEAGENT_H*/
--- a/ipsservices/ipssosaoplugin/inc/IpsSosAOEMNResolver.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosaoplugin/inc/IpsSosAOEMNResolver.h	Fri May 14 15:41:10 2010 +0300
@@ -17,8 +17,8 @@
 */
 
 
-#ifndef IPSSOSAOEMNRESOLVER_H_
-#define IPSSOSAOEMNRESOLVER_H_
+#ifndef IPSSOSAOEMNRESOLVER_H
+#define IPSSOSAOEMNRESOLVER_H
 
 // INCLUDES
 #include <e32base.h>
@@ -29,7 +29,9 @@
 *  This class handles OMA Email Notification messages.
 *
 */
+//<Qmail>
 NONSHARABLE_CLASS (CIpsSosAOEMNResolver) : public CBase
+//</Qmail>
     {
     public: 
 
@@ -45,12 +47,12 @@
         * @return, Constructed object
         */
         static CIpsSosAOEMNResolver* NewL();
-
+		//<Qmail>
         /**
-        * 
+        * destructor
         */
         virtual ~CIpsSosAOEMNResolver();
-
+		//</Qmail>
     public: 
     
         /**
@@ -72,17 +74,17 @@
             TEMNElement& aElement ) const;
 
     private:
-
+		//<Qmail>
         /**
-        * 
+        * constructor
         */
         CIpsSosAOEMNResolver();
 
         /**
-        *
+        * 2nd phase constructor
         */
         void ConstructL();
-
+		//</Qmail>
     private: 
         
         /**
@@ -123,4 +125,4 @@
             
     };
 
-#endif /*IPSSOSAOEMNRESOLVER_H_*/
+#endif /*IPSSOSAOEMNRESOLVER_H*/
--- a/ipsservices/ipssosaoplugin/inc/IpsSosAOImapAgent.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosaoplugin/inc/IpsSosAOImapAgent.h	Fri May 14 15:41:10 2010 +0300
@@ -23,9 +23,7 @@
 #include <imapconnectionobserver.h>
 #include <imapset.h>
 #include <mtclreg.h>
-//<cmail>
 #include "MFSMailRequestObserver.h"
-//</cmail>
 
 #include "IpsSosAOBaseAgent.h"
 
@@ -40,7 +38,9 @@
 * virtual functions.
 *
 */
+//<Qmail>
 NONSHARABLE_CLASS (CIpsSosAOImapAgent) : public CIpsSosAOBaseAgent,
+//</Qmail>
                            public MMsvImapConnectionObserver,
                            public MFSMailRequestObserver
     {
@@ -61,35 +61,77 @@
     virtual ~CIpsSosAOImapAgent();
     
 public: // from CIpsSosAOBaseAgent
-    
+    //<Qmail>
+    /**
+     * GetServerAddress
+     * @param a return parameter
+     */
     virtual void GetServerAddress( 
             TBuf<KIpsSosAOTextBufferSize>& aIncomingServer ) const;
     
+    /**
+     * GetUsername
+     * @param a return parameter
+     */
     virtual void GetUsername( 
             TBuf8<KIpsSosAOTextBufferSize>& aUsername ) const;
     
+    /**
+     * checks is does mailbox have connection open
+     * @return is connected or not
+     */
     virtual TBool IsConnected() const;
     
+    /**
+     * Starts email sync
+     */
     virtual void StartSyncL();
     
+    /**
+     * starts fetching messages
+     */
     virtual void StartFetchMessagesL( const RArray<TMsvId>& aFetchMsgArray );
     
+    /**
+     * cancels all ongoing suboperations and disconnects
+     */
     virtual void CancelAllAndDisconnectL();
     
+    /**
+     * cancels all suboperations
+     */
     virtual void CancelAllAndDoNotDisconnect();
     
+    /**
+     * sets iDoNotDisconnect as ETrue
+     */
     virtual void DoNotDisconnect();
     
+    /**
+     * sets iDoNotDisconnect as EFalse
+     */
     virtual void ClearDoNotDisconnect();
     
+    /**
+     * pauses ongoing operations
+     */
     virtual void HoldOperations();
 
+    /**
+     * resumes paused operations
+     */
     virtual void ContinueHoldOperations();
     
+    /**
+     * @return current iState
+     */
     virtual CIpsSosAOBaseAgent::TAgentState GetState() const;
     
+    /**
+     * Loads CImImap4Settings object
+     */
     virtual void LoadSettingsL();
-    
+    //</Qmail>
 public: // MMsvImapConnectionObserver  
     
     /**
@@ -119,17 +161,32 @@
     * Second phase constructor
     */
     void ConstructL();
-    
+    //<Qmail>
+    /**
+     * called when cancelled
+     */
     virtual void DoCancel();
     
+    /**
+     * from CActive
+     */
     virtual void RunL();
     
+    /**
+     * from CActive
+     */
     virtual TInt RunError( TInt aError );
 
+    /**
+     * fetches the content of all synced messages
+     */
     void PopulateAllL();
     
+    /**
+     * triggers async statemachine
+     */
     inline void SetActiveAndCompleteThis();
-
+	//</Qmail>
 private:
     
     CMsvSession&                        iSession;
@@ -137,14 +194,16 @@
     TMsvId                              iServiceId;
     TAgentState                         iState;
     TBool                               iDoNotDisconnect;
-    CImImap4Settings*                   iImapSettings;
-    CMsvOperation*                      iOngoingOp;
+	//<Qmail>
+    CImImap4Settings*                   iImapSettings;//owned
+    CMsvOperation*                      iOngoingOp;//owned
 
     TPckgBuf<TImap4CompoundProgress>    iProgressBuf;
     TInt                                iError;
-    CImap4ClientMtm*                    iImapClientMtm;
-    CClientMtmRegistry*                 iMtmReg;
-    RArray<TMsvId>                      iFoldersArray;
+    CImap4ClientMtm*                    iImapClientMtm;//owned
+    CClientMtmRegistry*                 iMtmReg;//owned
+    RArray<TMsvId>                      iFoldersArray;//owned
+	//<Qmail>
 	//<QMail>
 
     //</QMail>
--- a/ipsservices/ipssosaoplugin/inc/IpsSosAOImapPopLogic.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosaoplugin/inc/IpsSosAOImapPopLogic.h	Fri May 14 15:41:10 2010 +0300
@@ -17,8 +17,8 @@
 */
 
 
-#ifndef IPSSOSAOIMAPPOPLOGIC_H_
-#define IPSSOSAOIMAPPOPLOGIC_H_
+#ifndef IPSSOSAOIMAPPOPLOGIC_H
+#define IPSSOSAOIMAPPOPLOGIC_H
 
 #include <e32base.h> 
 #include <msvapi.h>
@@ -39,7 +39,9 @@
 * 
 * lib ipssosaoplugin.lib
 */
+//<Qmail>
 NONSHARABLE_CLASS (CIpsSosAOImapPopLogic) : public CBase
+//</Qmail>
     {
 
 public:
@@ -150,4 +152,4 @@
     
     };
 
-#endif /* IPSSOSAOIMAPPOPLOGIC_H_*/
+#endif /* IPSSOSAOIMAPPOPLOGIC_H*/
--- a/ipsservices/ipssosaoplugin/inc/IpsSosAOMboxLogic.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosaoplugin/inc/IpsSosAOMboxLogic.h	Fri May 14 15:41:10 2010 +0300
@@ -15,26 +15,20 @@
 *     Contains mailbox specified always online logic
 *
 */
-
-#ifndef IPSSOSAOMBOXLOGIC_CPP_
-#define IPSSOSAOMBOXLOGIC_CPP_
-
+//<Qmail>
+#ifndef IPSSOSAOMBOXLOGIC_H
+#define IPSSOSAOMBOXLOGIC_H
+//</Qmail>
 #include <e32base.h> 
 #include <msvapi.h>
 
-//<cmail> removing internal dependency
-/*#ifdef _DEBUG
-#include "../../internal/IpsSosAOPluginTester/inc/IpsSosAOPluginTester.hrh"
-#endif // _DEBUG*/
-//</cmail>
 
 #include "IpsSosAOBaseAgent.h"
 //<QMail>
 
 //</QMail>
 #include "IpsSosAOPluginTimer.h"
-//<cmail>
-//</cmail>
+
 //<QMail>
 
 //</QMail>
@@ -48,7 +42,9 @@
 * class CIpsSosAOImapPopLogic;
 *
 */
+//<Qmail>
 NONSHARABLE_CLASS (CIpsSosAOMBoxLogic) : 
+//</Qmail>
     public CBase, 
                            public MIpsSosAOPluginTimerCallBack,
                            public MIpsSosAOAgentOperationResponse
@@ -187,18 +183,14 @@
      * mailbox settings
      * @param aNewValue new value of flag
      */
-     //<cmail>
     void SetEmnReceivedFlagL( TBool aNewValue );
-    //</cmail>
     
     /*
      * Gets mailbox roaming stopped status
      * @return ETrue if roaming and mailbox logic is stopped during roaming
      */
-     //<cmail>
     TBool IsMailboxRoamingStoppedL();
-    //</cmail>
-
+    
 	/**
      * Has mailbox ever received and OMA EMN
      */
@@ -264,9 +256,7 @@
     /*
      * checks is operation completion error fatal and should timed sync swithc off
      */
-     //<cmail>
     TBool IsErrorFatalL( TInt aError );
-    //</cmail>
     
     /*
      * Suspends ongoing sync (or fetch) and swiths logic to suspend state
@@ -304,11 +294,6 @@
      */
     TBool CanConnectIfRoamingL();
 
-// <cmail> removing flags    
-/*#ifdef IPSSOSIMAPPOLOGGING_ON
-    void WriteDebugData( TInt aEvent );
-#endif*/
-//</cmail>
     
 private:
     
@@ -317,17 +302,19 @@
     TMBoxLogicState                 iState;
     TInt                            iErrorCounter;
     TInt                            iError;
-    CIpsSosAOPluginTimer*           iTimer;
+	//<Qmail>
+    CIpsSosAOPluginTimer*           iTimer;//owned
     // message fetch is not currently used
-    RArray<TMsvId>                  iFetchMsgArray;
+    RArray<TMsvId>                  iFetchMsgArray;//owned
 	//<QMail>
 
 	//</QMail>
-    CIpsSosAOBaseAgent*             iAgent;
+    CIpsSosAOBaseAgent*             iAgent;//owned
+	//</Qmail>
 	//<QMail>
 
 	//</QMail>
     TBool                           iIsRoaming;
     };
 
-#endif /*IPSSOSAOMBOXLOGIC_CPP_*/
+#endif /*IPSSOSAOMBOXLOGIC_H*/
--- a/ipsservices/ipssosaoplugin/inc/IpsSosAOPlugin.hrh	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosaoplugin/inc/IpsSosAOPlugin.hrh	Fri May 14 15:41:10 2010 +0300
@@ -17,8 +17,8 @@
 */
 
 
-#ifndef IPSSOSAOPLUGIN_HRH_
-#define IPSSOSAOPLUGIN_HRH_
+#ifndef IPSSOSAOPLUGIN_HRH
+#define IPSSOSAOPLUGIN_HRH
 
 const TInt KIpsSosAOMaxStateCycles = 50;
 const TInt KIpsSosAOStartDelaySeconds = 60;
@@ -31,4 +31,4 @@
 
 
 
-#endif /*IPSSOSAOPLUGIN_HRH_*/
+#endif /*IPSSOSAOPLUGIN_HRH*/
--- a/ipsservices/ipssosaoplugin/inc/IpsSosAOPluginEComInterface.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosaoplugin/inc/IpsSosAOPluginEComInterface.h	Fri May 14 15:41:10 2010 +0300
@@ -16,8 +16,8 @@
 *
 */
 
-#ifndef IPSSOSAOPLUGINECOMINTERFACE_H_
-#define IPSSOSAOPLUGINECOMINTERFACE_H_
+#ifndef IPSSOSAOPLUGINECOMINTERFACE_H
+#define IPSSOSAOPLUGINECOMINTERFACE_H
 
 #include <e32base.h>    // CBase
 #include <AlwaysOnlineEComInterface.h>
@@ -36,7 +36,9 @@
 *
 * @lib ipssosaoplugin.lib
 */
+//<Qmail>
 NONSHARABLE_CLASS (CIpsSosAOPluginEComInterface) : 
+//</Qmail>
     public CAlwaysOnlineEComInterface,
     public MMsvSessionObserver
     {
@@ -93,13 +95,13 @@
         void CompleteConstructL();
         
     private: // data
-        
-        CIpsSosAOSmtpSendWatcher*   iSendWatcher;
-        CIpsSosAOImapPopLogic*  iImapPopLogic;
-        CMsvSession*            iSession;
-        RArray<TInt>            iBufferedAOCommands;
-
+        //<Qmail>
+        CIpsSosAOSmtpSendWatcher*   iSendWatcher;//owned
+        CIpsSosAOImapPopLogic*  iImapPopLogic;//owned
+        CMsvSession*            iSession;//owned
+        RArray<TInt>            iBufferedAOCommands;//owned
+		//</Qmail>
 
     };
 
-#endif /*IPSSOSAOPLUGINECOMINTERFACE_H_*/
+#endif //IPSSOSAOPLUGINECOMINTERFACE_H
--- a/ipsservices/ipssosaoplugin/inc/IpsSosAOPluginTimer.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosaoplugin/inc/IpsSosAOPluginTimer.h	Fri May 14 15:41:10 2010 +0300
@@ -17,17 +17,12 @@
 */
 
 
-#ifndef __CIPSSOSSMTPPLUGINTIMER_H__
-#define __CIPSSOSSMTPPLUGINTIMER_H__
+#ifndef IPSSOSSMTPPLUGINTIMER_H
+#define IPSSOSSMTPPLUGINTIMER_H
 
 
 #include <e32base.h>    // CBase
 
-//<cmail> //internal dependency removed
-/*#ifdef _DEBUG
-#include "../../internal/IpsSosAOPluginTester/inc/IpsSosAOPluginTester.hrh"
-#endif // _DEBUG*/
-//</cmail>
 
 /**
 * class MIpsSosAOPluginTimerCallBack
@@ -48,7 +43,9 @@
 * 
 * @lib ipssosaoplugin.lib
 */
+//<Qmail>
 NONSHARABLE_CLASS (CIpsSosAOPluginTimer) : 
+//</Qmail>
     public CActive
     {
     
@@ -92,13 +89,6 @@
         */
 		void After( const TTimeIntervalSeconds& aSeconds );
 
-//<cmail> //internal dependency removed
-/*#ifdef _DEBUG		
-#ifdef IPSAOPLUGINTESTER_MBOXLOGICTEST
-        // test usage
-        TInt GetSecondsToTrick();
-#endif // IPSAOPLUGINTESTER_MBOXLOGICTEST*/
-//</cmail>
 
 protected:
 
@@ -125,15 +115,8 @@
 		RTimer                        iTimer;
 		MIpsSosAOPluginTimerCallBack& iCallBack;
 
-//<cmail> //internal dependency removed
-/*#ifdef _DEBUG				
-#ifdef IPSAOPLUGINTESTER_MBOXLOGICTEST
-        // test usage
-        TTime                          iTestActivationTime;
-#endif // IPSAOPLUGINTESTER_MBOXLOGICTEST*/
-//</cmail>
     };
     
-#endif /* __CIPSSOSSMTPPLUGINTIMER_H__ */
+#endif //IPSSOSSMTPPLUGINTIMER_H
 
 //EOF
--- a/ipsservices/ipssosaoplugin/inc/IpsSosAOPopAgent.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosaoplugin/inc/IpsSosAOPopAgent.h	Fri May 14 15:41:10 2010 +0300
@@ -17,8 +17,8 @@
 */
 
 
-#ifndef IPSSOSAOPOPAGENT_H_
-#define IPSSOSAOPOPAGENT_H_
+#ifndef IPSSOSAOPOPAGENT_H
+#define IPSSOSAOPOPAGENT_H
 
 #include <pop3set.h>
 #include <mtclreg.h>
@@ -35,7 +35,9 @@
 * implementations of base class pure virtual functions.
 *
 */
+//<Qmail>
 NONSHARABLE_CLASS (CIpsSosAOPopAgent) : public CIpsSosAOBaseAgent
+//</Qmail>
     {
 public:
     
@@ -54,35 +56,77 @@
     virtual ~CIpsSosAOPopAgent();
     
 public: // from CIpsSosAOBaseAgent
-    
+    //<Qmail>
+    /**
+     * GetServerAddress
+     * @param a return parameter
+     */
     virtual void GetServerAddress( 
             TBuf<KIpsSosAOTextBufferSize>& aIncomingServer ) const;
     
+    /**
+     * GetUsername
+     * @param a return parameter
+     */
     virtual void GetUsername( 
             TBuf8<KIpsSosAOTextBufferSize>& aUsername ) const;
     
+    /**
+     * checks is does mailbox have connection open
+     * @return is connected or not
+     */
     virtual TBool IsConnected() const;
     
+    /**
+     * Starts email sync
+     */
     virtual void StartSyncL();
     
+    /**
+     * starts fetching messages
+     */
     virtual void StartFetchMessagesL( const RArray<TMsvId>& aFetchMsgArray );
     
+    /**
+     * cancels all ongoing suboperations and disconnects
+     */
     virtual void CancelAllAndDisconnectL();
     
+    /**
+     * cancels all suboperations
+     */
     virtual void CancelAllAndDoNotDisconnect();
     
+    /**
+     * sets iDoNotDisconnect as ETrue
+     */
     virtual void DoNotDisconnect();
     
+    /**
+     * sets iDoNotDisconnect as EFalse
+     */
     virtual void ClearDoNotDisconnect();
     
+    /**
+     * pauses ongoing operations
+     */
     virtual void HoldOperations();
 
+    /**
+     * resumes paused operations
+     */
     virtual void ContinueHoldOperations();
     
+    /**
+     * @return current iState
+     */
     virtual CIpsSosAOBaseAgent::TAgentState GetState() const;
     
+    /**
+     * Loads CImPop3Settings object
+     */
     virtual void LoadSettingsL();
-    
+    //</Qmail>
 private:
 
     /**
@@ -97,17 +141,32 @@
     * Second phase constructor
     */
     void ConstructL();
-    
+    //<Qmail>
+    /**
+     * called when cancelled
+     */
     virtual void DoCancel();
     
+    /**
+     * from CActive
+     */
     virtual void RunL();
     
+    /**
+     * from CActive
+     */
     virtual TInt RunError( TInt aError );
 
+    /**
+     * fetches the content of all synced messages
+     */
     void PopulateAllL();
     
+    /**
+     * triggers async statemachine
+     */
     inline void SetActiveAndCompleteThis();
-    
+    //</Qmail>
     
 private:
     
@@ -117,17 +176,19 @@
     TBool                               iSyncStartedSignaled;
     TAgentState                         iState;
     TBool                               iDoNotDisconnect;
-    CImPop3Settings*                    iPopSettings;
-    CMsvOperation*                      iOngoingOp;
+	//<Qmail>
+    CImPop3Settings*                    iPopSettings;//owned
+    CMsvOperation*                      iOngoingOp;//owned
 
     TPckgBuf<TPop3Progress>             iProgressBuf;
-    CMsvEntrySelection*                 iSelection;
+    CMsvEntrySelection*                 iSelection;//owned
     TInt                                iError;
-    CPop3ClientMtm*                     iPopClientMtm;
-    CClientMtmRegistry*                 iMtmReg;
+    CPop3ClientMtm*                     iPopClientMtm;//owned
+    CClientMtmRegistry*                 iMtmReg;//owned
+	//</Qmail>
     TInt                                iPopulateLimit;
     
     };
 
 
-#endif /*IPSSOSAOPOPAGENT_H_*/
+#endif /*IPSSOSAOPOPAGENT_H*/
--- a/ipsservices/ipssosaoplugin/inc/IpsSosAOSchedulerUtils.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosaoplugin/inc/IpsSosAOSchedulerUtils.h	Fri May 14 15:41:10 2010 +0300
@@ -17,8 +17,8 @@
 */
 
 
-#ifndef IPSSOSAOSCHEDULERUTILS_H_
-#define IPSSOSAOSCHEDULERUTILS_H_
+#ifndef IPSSOSAOSCHEDULERUTILS_H
+#define IPSSOSAOSCHEDULERUTILS_H
 
 #include <e32base.h>
 //<Qmail>
@@ -38,18 +38,20 @@
     EAOVCDConnectionPreviousDayOnly
     };
 
+//<Qmail>
+class CIpsSosAOSettingsHandler;
+//</Qmail>
 /**
 *  Class CIpsSosAOSchedulerUtils 
 *  
 *  calculates time to next interval according to 
 *  mailbox's always online settings
 * 
-*  NOTE: this class is taken from S60 Email client,
-*  Some parts of this class may not be used in FSEmail
-*    
 *  @since FSEmail 2.0
 */
+//<Qmail>
 NONSHARABLE_CLASS (CIpsSosAOSchedulerUtils) : public CBase
+//</Qmail>
     {
 public:  // Constructors and destructor
 
@@ -58,14 +60,14 @@
     * @return, Constructed object
     */
     //<Qmail>
-    static CIpsSosAOSchedulerUtils* NewLC();
+    static CIpsSosAOSchedulerUtils* NewLC(CIpsSosAOSettingsHandler& aSettings);
     //</Qmail>
     /**
     * NewL
     * @return, Constructed object
     */
     //<Qmail>
-    static CIpsSosAOSchedulerUtils* NewL();
+    static CIpsSosAOSchedulerUtils* NewL(CIpsSosAOSettingsHandler& aSettings);
     //</Qmail>
     /**
     * Destructor
@@ -93,15 +95,15 @@
     * Constructor
     */
     //<Qmail>
-    CIpsSosAOSchedulerUtils();
+    CIpsSosAOSchedulerUtils(CIpsSosAOSettingsHandler& aSettings);
     //</Qmail>
     /**
     * Symbian 2-phase constructor
     */
     void ConstructL();
-
+	//<Qmail>
     /**
-    *
+    * gets time values needed to do cheduling
     */
     void PrepareScheduling(
         TTime& aClock,
@@ -110,7 +112,7 @@
         TTimeIntervalSeconds& aStop );
 
     /**
-    *
+    * Checks if now is an allowed time to connect
     */
     TBool CanConnect(
         const TTime& aClock,
@@ -119,27 +121,27 @@
         TTimeIntervalSeconds& aStop );
                         
     /**
-    *
+    * performs connection checks based on day
     */
     TIpsSosAOValidConnectionDay GetValidConnectionDay( 
         const TTime& aClock );
         
     /**
-    *
+    * Gets next day
     */
     TDay GetNextDay( 
         const TDay aToday, 
         const TInt aNth = 1 );
               
     /**
-    *
+    * Gets previous day
     */
     TDay GetPrevDay( 
         const TDay aToday, 
         const TInt aNth = 1 );
         
     /**
-    *
+    * Checks if given time in sync window
     */
     TBool IsValidTimeToConnect( 
         const TIpsSosAOValidConnectionDay aValidDay,
@@ -148,13 +150,13 @@
         TTimeIntervalSeconds& aStop );
 
     /**
-    *
+    * Creates hometime with hours, minutes and seconds only
     */
     TDateTime AdjustHomeTime( 
         const TTime& aClock );
             
     /**
-    *
+    * Converts time to seconds
     */
     void Times2Seconds(
         const TTime& aClock,
@@ -163,7 +165,7 @@
         TTimeIntervalSeconds& aStop );
                 
     /**
-    *
+    * Creates valid start and stop times
     */
     void OrganizeStartAndStopTimes(
         TTimeIntervalSeconds& aHome,
@@ -171,7 +173,7 @@
         TTimeIntervalSeconds& aStop );
                     
     /**
-    *
+    * How many seconds to next connection/disconnection
     */
     void CalculateSecondsToNextMark(
         const TIpsSosAOConnectionType aConnectionStatus,
@@ -182,7 +184,7 @@
         const TTimeIntervalSeconds& aStop );
 
     /**
-    *
+    * How many seconds to next day we are allowed to connect
     */
     TTimeIntervalSeconds CalcSecsToNextScheduledDay(
         const TTime& aClock, 
@@ -190,7 +192,7 @@
         const TBool aScheduledDay );
 
     /**
-    *
+    * Sub routine for CalculateSecondsToNextMark
     */
     void CalcSecsToMark(
         TTimeIntervalSeconds& aSeconds,
@@ -200,17 +202,17 @@
         const TBool aScheduledDay );
 
     /**
-    *
+    * Checks is given day selected to be synced
     */
     TBool IsDaySelected( const TUint aDay ) const;
-        
+    //</Qmail>
 private:
 
-    // Reference to extended settings
+    
     //<Qmail>
-    
+    CIpsSosAOSettingsHandler& iSettings;
     //</Qmail>
     };
 
 
-#endif /*IPSSOSAOSCHEDULERUTILS_H_*/
+#endif /*IPSSOSAOSCHEDULERUTILS_H*/
--- a/ipsservices/ipssosaoplugin/inc/IpsSosAOSettingsHandler.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosaoplugin/inc/IpsSosAOSettingsHandler.h	Fri May 14 15:41:10 2010 +0300
@@ -27,7 +27,17 @@
 #include "nmipssettingitems.h"
 
 
+class CMsvSession;
+class TMsvEntry;
+class NmId;
+class QVariant;
 
+
+const TInt KIpsHeadersOnly           = -2;
+const TInt KIpsFullBodyAndAttas      = -1;
+const TInt KIpsFullBodyOnly          = -3;
+
+class NmIpsSosAoExtendedSettingsManager;
 /**
 * class CIpsSosAOSettingsHandler
 *
@@ -41,7 +51,8 @@
     /*
      * NewL
      */
-    static CIpsSosAOSettingsHandler* NewL( TUid aProtocol );
+    static CIpsSosAOSettingsHandler* NewL( 
+            CMsvSession& aSession, TMsvId aMailboxId );
     
     /*
      * Destructor
@@ -50,13 +61,16 @@
     
     /**
      * List folders subscribed to be synced.
+     * Not supported.
      */
     void GetSubscribedImapFoldersL( 
             TMsvId aServiceId, 
             RArray<TMsvId>& aFoldersArray );
     
     /**
-     * 
+     * Reads TImImap4GetPartialMailInfo data from settings
+     * @param aInfo return parameter
+     * @param aImap4Settings reference to settings 
      */
     void ConstructImapPartialFetchInfo( 
             TImImap4GetPartialMailInfo& aInfo, 
@@ -71,8 +85,7 @@
      * @param aAlwaysOnlineState, new state for alwaysonline
      */
     void SetAlwaysOnlineState(
-        const IpsServices::TIpsSetDataAoStates aAlwaysOnlineState,
-        TBool aIgnoreStateFlag=EFalse );
+        const IpsServices::TIpsSetDataAoStates aAlwaysOnlineState );
     
     /**
      * Fetches the state of email notification -flag
@@ -95,16 +108,19 @@
     /**
      * Sets a flag when mailbox receives it's first OMA EMN.
      * (email notification)
+     * @param flag value
      */
     void SetFirstEmnReceived( TBool aValue );
     
     /**
-    *
+    * returns value of this flag
+    * @return is flag set
     */
     TBool EmnReceivedButNotSyncedFlag() const;
         
     /**
-    *
+    * sets flag value
+    * @param flag value
     */
     void SetEmnReceivedButNotSyncedFlag( TBool aFlag );
     
@@ -114,12 +130,12 @@
     TUint SelectedWeekDays() const;
     
     /**
-     * @return 
+     * @return start time 
      */
     TTime SelectedTimeStart() const;
     
     /**
-     * @return 
+     * @return stop time
      */
     TTime SelectedTimeStop() const;
     
@@ -129,35 +145,35 @@
     void SetLastUpdateInfo( const IpsServices::TAOInfo& aLastUpdateInfo );
 
     /**
-     * @return
+     * @return info about last update
      */
     IpsServices::TAOInfo LastUpdateInfo() const;
     
     /**
-     * @return
+     * @return refresh interval
      */
     TInt InboxRefreshTime() const;
     
+    
     /**
-    * Are we allowed to sync only in home network
-    * @return true, if home only is selected
-    */
-    TBool RoamHomeOnlyFlag();
+     * Gets email address from smtp settings.
+     * @return pointer to emailaddress. ownership is transferred.
+     */
+    HBufC* EmailAddressL();
     
-protected:
+private:
     
     /*
      * Constructor 
      */
-    CIpsSosAOSettingsHandler();
-    
-    
+    CIpsSosAOSettingsHandler(CMsvSession& aSession);
+        
 private:
     
     /*
      * 2nd phase constructor 
      */
-    void ConstructL( TUid aProtocol );
+    void ConstructL( TMsvId aMailboxId );
     
     
     /**
@@ -165,12 +181,57 @@
      * @return FS plugin id
      */
     TInt GetFSPluginId() const;
-        
-private:
+    
+    /**
+     * Constructs NmId type mailbox id from TMsvId and plugin's id.
+     */
+    NmId MboxId() const;
+    
+    /**
+     * Reads values from extended settings
+     * @param aItem wanted item id
+     * @param aValue return parameter
+     * @return did succeed
+     */
+    TBool GetSettingValue(IpsServices::SettingItem aItem, QVariant& aValue) const;
+    
+    /**
+     * Sets setting value into extended settings
+     * @param aItem item which to set
+     * @param items data
+     * @return did succeed
+     */
+    TBool SetSettingValue(
+            const IpsServices::SettingItem aItem, 
+            const QVariant& aData);
     
+    /**
+     * Creates a new key-value pair into cenrep
+     * @param aKey key to be created
+     * @aValue initial value for the key
+     * @return did succeed
+     */
+    TBool CreateKeyValuePair(
+            const IpsServices::SettingItem aKey, 
+            const QVariant& aValue);
+    
+    /**
+     * method to determine daytime and "other" time
+     */
+    TBool IsDaytime() const;
+    
+    /**
+     * Maps TIPsSetProfiles into TIpsSetDataAoStates 
+     */
+    IpsServices::TIpsSetDataAoStates ProfileIntoAOState(
+            const TInt aProfile) const;
+    
+    
+private:
+    NmIpsSosAoExtendedSettingsManager* iExtMgr;//owned
     TPckgBuf<TIpsPlgPropertyEvent>  iPropertyBuf;
-    TUid                            iMtmType;
-    
+    TMsvEntry                       iEntry;
+    CMsvSession&                    iSession;
     };
 
 #endif /*IPSSOSAOSETTINGSHANDLER_H_*/
--- a/ipsservices/ipssosaoplugin/inc/IpsSosAOSmtpAgent.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosaoplugin/inc/IpsSosAOSmtpAgent.h	Fri May 14 15:41:10 2010 +0300
@@ -16,8 +16,8 @@
 *
 */
 
-#ifndef __IPSSOSAOSMTPAGENT_H__
-#define __IPSSOSAOSMTPAGENT_H__
+#ifndef __IPSSOSAOSMTPAGENT_H
+#define __IPSSOSAOSMTPAGENT_H
 
 
 #include <e32base.h>    // CBase
@@ -32,7 +32,9 @@
 * class CIpsSosAOSmtpAgent;
 *
 */
+//<Qmail>
 NONSHARABLE_CLASS (CIpsSosAOSmtpAgent) : 
+//</Qmail>
     public CActive
     {
     public:
@@ -55,16 +57,25 @@
         */
         virtual ~CIpsSosAOSmtpAgent();
         
+        
         virtual void DoCancel();
+        
         virtual void RunL();
-        
+        //<Qmail>
+        /**
+         * CMsvSession event callback 
+         */
         void HandleSessionEventL(    
             MMsvSessionObserver::TMsvSessionEvent aEvent,
             TAny* aArg1, 
             TAny* aArg2, 
             TAny* aArg3 );
             
+        /**
+         * Tries to send messages from outbox
+         */
         void EmptyOutboxNowL( TMsvId aMessage );
+		//</Qmail>
         
     private:
         /**
@@ -78,10 +89,17 @@
         * Second phase constructor
         */
         void ConstructL();    
-
+		//<Qmail>
+        /**
+         * Creates needed internal data
+         */
         void CreateInternalDataL( );
         
+        /**
+         * Releases internal resources
+         */
         void ReleaseInternalData( );
+		//</Qmail>
         
         
     private:
@@ -91,14 +109,14 @@
     private:
 
        CMsvSession& iSession;
-	
-       CIpsPlgSmtpOperation* iOperation;
-	   //<QMail>
+		//<Qmail>
+       CIpsPlgSmtpOperation* iOperation;//owned
+	  
 
        //</QMail>
        TInt iError;
        
     };
 
-#endif /* __IPSSOSAOSMTPAGENT_H__ */
+#endif /* __IPSSOSAOSMTPAGENT_H*/
 //EOF
--- a/ipsservices/ipssosaoplugin/inc/IpsSosAOSmtpSendWatcher.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosaoplugin/inc/IpsSosAOSmtpSendWatcher.h	Fri May 14 15:41:10 2010 +0300
@@ -30,7 +30,9 @@
 * CIpsSosAOSmtpSendWatcher
 *
 */
+//<Qmail>
 NONSHARABLE_CLASS (CIpsSosAOSmtpSendWatcher) : 
+//</Qmail>
     public CActive
     {
     public:
@@ -94,9 +96,9 @@
 		virtual TInt RunError( TInt aError );
 
 	protected: // Data
-	
-	    CIpsSosAOSmtpAgent* iAgent;
-        
+		//<Qmail>
+	    CIpsSosAOSmtpAgent* iAgent;//owned
+        //</Qmail>
         RProperty iProperty;
     };
     
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ipsservices/ipssosaoplugin/inc/IpsSosAoExtendedSettingsManager.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,104 @@
+/*
+* 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 NMIPSSOSAOEXTENDEDSETTINGSMANAGER_H
+#define NMIPSSOSAOEXTENDEDSETTINGSMANAGER_H
+
+#include <qvariant.h>
+#include "nmipssettingitems.h"
+
+class NmId;
+class XQSettingsManager;
+class XQCentralRepositoryUtils;
+
+/**
+ * class to handle settings stored in central repository
+ */
+NONSHARABLE_CLASS (NmIpsSosAoExtendedSettingsManager)
+{
+public:
+    /**
+     * constructor
+     * @param mailbox who's settings we are handling
+     */
+    NmIpsSosAoExtendedSettingsManager(const NmId &mailboxId);
+    
+    /**
+     * destructor
+     */
+    virtual ~NmIpsSosAoExtendedSettingsManager();
+    
+    /**
+     * reads a setting from cen rep
+     * @param settingItem id of the setting
+     * @param settingValue a return parameter
+     * @return was read a success
+     */
+    bool readSetting(
+            IpsServices::SettingItem settingItem, 
+            QVariant &settingValue) const;
+    
+    /**
+     * writes a setting into cen rep
+     * @param settingItem id of the setting
+     * @param settingValue value of the setting to be stored
+     * @return was write a success
+     */
+    bool writeSetting(
+            IpsServices::SettingItem settingItem, 
+            const QVariant &settingValue);
+    
+	bool writeSetting(
+		int profileMode, 
+		IpsServices::SettingItem settingItem, 
+		const QVariant &settingValue);
+	
+    /**
+     * deletes settings
+     */
+    void deleteSettings();
+    
+    /**
+     * creates a new key-value pair
+     * @param settingItem id of the setting
+     * @param settingValue value of the setting to be stored
+     * @return was creation a success
+     */
+    bool createKeyValuePair(
+            const IpsServices::SettingItem settingItem, 
+            const QVariant &settingValue);
+
+private:
+    bool writeSettingToCenRep(
+	qint32 profileOffset, 
+	IpsServices::SettingItem settingItem, 
+	const QVariant &settingValue);
+	
+    QVariant readFromCenRep(quint32 key) const;
+    bool writeToCenRep(quint32 key, const QVariant &value) const;
+    void calculateMailboxOffset();
+    void calculateActiveProfileOffset();
+    qint32 convertToProfileOffset(int profile);
+
+private: // data
+    const NmId &mMailboxId;
+    qint32 mMailboxOffset;
+    qint32 mActiveProfileOffset;
+    XQSettingsManager* mSettingsManager; // Owned.
+};
+
+#endif // NMIPSSOSAOEXTENDEDSETTINGSMANAGER_H
--- a/ipsservices/ipssosaoplugin/ipssosaoplugin.pro	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosaoplugin/ipssosaoplugin.pro	Fri May 14 15:41:10 2010 +0300
@@ -42,7 +42,8 @@
 inc/IpsSosAOSchedulerUtils.h \
 inc/IpsSosAOSmtpAgent.h \
 inc/IpsSosAOSmtpSendWatcher.h \
-inc/IpsSosAOSettingsHandler.h
+inc/IpsSosAOSettingsHandler.h \
+inc/IpsSosAoExtendedSettingsManager.h
 
 
     
@@ -59,7 +60,8 @@
 src/IpsSosAOSchedulerUtils.cpp \
 src/IpsSosAOSmtpAgent.cpp \
 src/IpsSosAOSmtpSendWatcher.cpp \
-src/IpsSosAOSettingsHandler.cpp
+src/IpsSosAOSettingsHandler.cpp \
+src/IpsSosAoExtendedSettingsManager.cpp
 
 
 RESOURCES +=
@@ -104,7 +106,9 @@
     -limcm \
     -lgsecomplugin \
     -leikcore \
-    -lipssosplugin
+    -lipssosplugin \
+    -lxqsettingsmanager \
+    -lcmmanager
 
 
       
--- a/ipsservices/ipssosaoplugin/src/IpsSosAOImapAgent.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosaoplugin/src/IpsSosAOImapAgent.cpp	Fri May 14 15:41:10 2010 +0300
@@ -24,18 +24,16 @@
 #include <impcmtm.h>
 #include <msvapi.h>
 #include <AlwaysOnlineManagerCommon.h>
-//<cmail>
 #include "CFSMailCommon.h"
-//</cmail>
-
 
 #include "IpsSosAOImapAgent.h"
 #include "IpsSosAOImapPopLogic.h"
 
 
-// from settings
 //<QMail>
+#include "IpsSosAOSettingsHandler.h"
 
+const TInt KIpsSetDataHeadersOnly           = -2;
 //</QMail>
 
 // from ipsplugin
@@ -187,7 +185,13 @@
              break;
          case EStateRefreshFolderArray:
 			 //<QMail>
-             //iDataApi->GetSubscribedImapFoldersL( iServiceId , iFoldersArray );
+             {
+             CIpsSosAOSettingsHandler* settings = 
+                     CIpsSosAOSettingsHandler::NewL(iSession, iServiceId);
+             CleanupStack::PushL(settings);
+             settings->GetSubscribedImapFoldersL( iServiceId , iFoldersArray );
+             CleanupStack::PopAndDestroy(settings);
+             }             
 			 //</QMail>
              iState = EStatePopulateAll;
              SetActiveAndCompleteThis();
@@ -475,8 +479,12 @@
     {
     FUNC_LOG;
     TImImap4GetPartialMailInfo info;
-	//<QMail>
-    //CIpsSetDataApi::ConstructImapPartialFetchInfo( info, *iImapSettings );
+    //<QMail>
+    CIpsSosAOSettingsHandler* settings = 
+             CIpsSosAOSettingsHandler::NewL(iSession, iServiceId);
+     CleanupStack::PushL(settings);
+     settings->ConstructImapPartialFetchInfo( info, *iImapSettings );
+     CleanupStack::PopAndDestroy(settings);	
 	//</QMail>
     
     if ( !IsConnected() )
@@ -485,8 +493,8 @@
         CancelAllAndDisconnectL();
         }
 	//<QMail>
-    else if ( iFoldersArray.Count())// > 0 && info.iTotalSizeLimit 
-            //!= KIpsSetDataHeadersOnly )
+    else if ( iFoldersArray.Count() > 0 && info.iTotalSizeLimit 
+            != KIpsSetDataHeadersOnly )
 	//</QMail>
          {
 
@@ -504,18 +512,19 @@
          iImapClientMtm->SwitchCurrentEntryL( iServiceId );
          TFSMailMsgId mbox( KIpsPlgImap4PluginUidValue, iServiceId );
          iStatus = KRequestPending;
+		 //<Qmail>
          iOngoingOp = CIpsPlgImap4PopulateOp::NewL(
-             iSession,
-             this->iStatus,
-             iServiceId,
-             *dummy,
-             info,
-             *sel,
-             mbox,
-             this,
-             0,
-             NULL );
-         
+                 iSession,
+                 this->iStatus,
+                 iServiceId,
+                 *dummy,
+                 info,
+                 *sel,
+                 mbox,
+                 this,
+                 0,
+                 NULL );
+         //</Qmail>
          iFoldersArray.Remove( 0 );
          SetActive();
          iState = EStatePopulateAll;
--- a/ipsservices/ipssosaoplugin/src/IpsSosAOImapPopLogic.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosaoplugin/src/IpsSosAOImapPopLogic.cpp	Fri May 14 15:41:10 2010 +0300
@@ -31,7 +31,7 @@
 #include "IpsSosAOMboxLogic.h"
 #include "IpsSosAOEMNResolver.h"
 //<QMail>
-
+#include "IpsSosAOSettingsHandler.h"
 //</QMail>
 
 
@@ -222,9 +222,6 @@
             result = KErrNotSupported;
             break;
         }
-   
-    
-    // </cmail>
     return result;
     }
 
@@ -232,7 +229,6 @@
 // ----------------------------------------------------------------------------
 // 
 void CIpsSosAOImapPopLogic::HandleMsvSessionEventL(
-// <cmail> RD_IPS_AO_PLUGIN flag removed
      MMsvSessionObserver::TMsvSessionEvent aEvent, 
      TAny* aArg1, TAny* aArg2, TAny* /*aArg3*/ )
     {
@@ -275,7 +271,6 @@
         default:
             break;
         };
-    // </cmail>
     }
 
 // ----------------------------------------------------------------------------
@@ -343,14 +338,13 @@
         if ( index != KErrNotFound )
             {
             CIpsSosAOMBoxLogic* logic = iMailboxLogics[index];
-            //<cmail>
+            
 			if ( !logic->FirstEMNReceived() )
                 {
                 logic->SetFirstEMNReceived();
                 }
             if ( !iNoNWOpsAllowed && 
                  !logic->IsMailboxRoamingStoppedL() )
-            //</cmail>
                 {
                 SendCommandToSpecificMailboxL( 
                     logic->GetMailboxId(), // faulty CS warning
@@ -358,17 +352,11 @@
                 }
             else
                 {
-                //<cmail>
-                logic->SetEmnReceivedFlagL( ETrue );
-                //</cmail>
+                logic->SetEmnReceivedFlagL( ETrue );                
                 }
             logic = NULL;
             }
-/*<cmail>
-        else
-            {
-            }
-</cmail>*/
+
         }
     }
 
@@ -412,32 +400,33 @@
                 }
             }
 		//<QMail>
-        /*
-        CIpsSetDataExtension* extSet = CIpsSetDataExtension::NewLC();
-        TRAPD( error, iDataApi->LoadExtendedSettingsL( 
-                mboxId, *extSet ) );
-        if ( error == KErrNone  )
+        CIpsSosAOSettingsHandler* settings = 
+                 CIpsSosAOSettingsHandler::NewL(iSession, mboxId);
+        CleanupStack::PushL(settings);
+         
+        if ( !found  && ( settings->AlwaysOnlineState() 
+                != IpsServices::EMailAoOff || 
+                    settings->EmailNotificationState() 
+                != IpsServices::EMailEmnOff || 
+                    !settings->FirstEmnReceived() )
+                 )
             {
-            if ( !found  && ( extSet->AlwaysOnlineState() != EMailAoOff || 
-                    extSet->EmailNotificationState() != EMailEmnOff || 
-                    !extSet->FirstEmnReceived() )
-                     )
-                {
-                CIpsSosAOMBoxLogic* newLogic = CIpsSosAOMBoxLogic::NewL( 
-                        iSession, mboxId );
-                CleanupStack::PushL( newLogic );
-                iMailboxLogics.AppendL( newLogic );
-                CleanupStack::Pop( newLogic );
-                }
-            else if ( found && extSet->AlwaysOnlineState() == EMailAoOff &&
-                    extSet->EmailNotificationState() == EMailEmnOff &&
-                    extSet->FirstEmnReceived() )
-                {
-                StopAndRemoveMailboxL( mboxId );
-                }
+            CIpsSosAOMBoxLogic* newLogic = CIpsSosAOMBoxLogic::NewL( 
+                    iSession, mboxId );
+            CleanupStack::PushL( newLogic );
+            iMailboxLogics.AppendL( newLogic );
+            CleanupStack::Pop( newLogic );
             }
-        CleanupStack::PopAndDestroy( extSet );
-        */
+        else if ( found && settings->AlwaysOnlineState() 
+                == IpsServices::EMailAoOff &&
+                    settings->EmailNotificationState() 
+                == IpsServices::EMailEmnOff &&
+                    settings->FirstEmnReceived() )
+            {
+            StopAndRemoveMailboxL( mboxId );
+            }
+        
+        CleanupStack::PopAndDestroy(settings);
 		//</QMail>
         }
     }
--- a/ipsservices/ipssosaoplugin/src/IpsSosAOMboxLogic.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosaoplugin/src/IpsSosAOMboxLogic.cpp	Fri May 14 15:41:10 2010 +0300
@@ -16,26 +16,21 @@
 *
 */
 
-
-//<cmail> internal dependency removed
-/*#ifdef _DEBUG
-#include "../../internal/IpsSosAOPluginTester/inc/IpsSosAOPluginTester.hrh"
-#endif // _DEBUG*/
-//</cmail>
-
+//<Qmail>
 #include <cmmanager.h>
+//</Qmail>
 
 #include "emailtrace.h"
 #include "IpsSosAOMboxLogic.h"
 //<QMail>
-
+#include "IpsSosAOSettingsHandler.h"
 //</QMail>
 #include "IpsSosAOSchedulerUtils.h"
 #include "IpsSosAOPlugin.hrh"
 #include "IpsSosAOImapPopLogic.h"
 
 //<QMail>
-//const TInt KAOSecondsInMinute = 60;
+const TInt KAOSecondsInMinute = 60;
 //</QMail>
 const TInt KIpsSosAOMboxLogicMinGra = 1;
 
@@ -93,9 +88,10 @@
     iTimer = CIpsSosAOPluginTimer::NewL( CActive::EPriorityStandard, *this );
 	//<QMail>
 
-	//</QMail>
+	
     iAgent = CIpsSosAOBaseAgent::CreateAgentL( iSession, *this, iMailboxId );
-    LoadSettingsL();
+    
+    //</QMail>
     }
 
 // ----------------------------------------------------------------------------
@@ -185,7 +181,9 @@
 void CIpsSosAOMBoxLogic::FetchMessagesL( const RArray<TMsvId> aArray )
     {
     FUNC_LOG;
-    LoadSettingsL();
+    //<Qmail>
+    
+    //</Qmail>
     for ( TInt i = 0; i < aArray.Count(); i++ )
         {
         iFetchMsgArray.AppendL( aArray[i] );
@@ -219,17 +217,22 @@
     FUNC_LOG;
     TBool ret = ETrue;
 	//<QMail>
-    /*
-    TIpsSetDataEmnStates state = EMailEmnOff;
-    if ( iExtendedSettings )
-        {
-        state = iExtendedSettings->EmailNotificationState();
+    CIpsSosAOSettingsHandler* settings = NULL;
+    TRAP_IGNORE( settings = 
+            CIpsSosAOSettingsHandler::NewL(iSession, iMailboxId));
+    
+    if(settings){
+        IpsServices::TIpsSetDataEmnStates state = IpsServices::EMailEmnOff;
+        state = settings->EmailNotificationState();
+        
+        if ( state == IpsServices::EMailEmnOff )
+            {
+            ret = EFalse;
+            }
+        
+        delete settings;
         }
-    if ( state == EMailEmnOff )
-        {
-        ret = EFalse;
-        }
-        */
+    
 	//</QMail>
     return ret;
     }
@@ -239,45 +242,57 @@
 // 
 //<QMail>
 void CIpsSosAOMBoxLogic::GetEmailAddress(  
-    TBuf<KIpsSosAOTextBufferSize>& /*aEmailAddress*/ ) const
+    TBuf<KIpsSosAOTextBufferSize>& aEmailAddress ) const
     {
     FUNC_LOG;
-    /*
-    const TDesC& addr = iExtendedSettings->EmailAddress();
-    __ASSERT_DEBUG( ( 
-            addr.Length() <= KIpsSosAOTextBufferSize ), 
-            User::Panic( KIpsSosAOPanicLit, KErrGeneral) );
+    CIpsSosAOSettingsHandler* settings = NULL;
+
+    TRAPD( err, settings = CIpsSosAOSettingsHandler::NewL(
+            iSession, iMailboxId) );
     
-    if ( addr.Length() <= KIpsSosAOTextBufferSize )
-        {
-        aEmailAddress.Copy( addr );
+    if(settings){
+        HBufC* addr = NULL;
+        TRAP(err, addr = settings->EmailAddressL());
+        
+        if(addr){
+            __ASSERT_DEBUG( ( 
+                    addr->Length() <= KIpsSosAOTextBufferSize ), 
+                    User::Panic( KIpsSosAOPanicLit, KErrGeneral) );
+            
+            if ( addr->Length() <= KIpsSosAOTextBufferSize )
+                {
+                aEmailAddress.Copy( *addr );
+                }
+            delete addr;
+            }   
+        
+        delete settings;
         }
-        */
+    
 	//<QMail>
     }
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 //<QMail>
-//<cmail>
-void CIpsSosAOMBoxLogic::SetEmnReceivedFlagL( TBool /*aNewValue*/ )
-//</cmail>
+void CIpsSosAOMBoxLogic::SetEmnReceivedFlagL( TBool aNewValue )
     {
-    LoadSettingsL();
-    /*
-    iExtendedSettings->SetEmnReceivedButNotSyncedFlag( aNewValue );
-    iDataApi->SaveExtendedSettingsL(
-        *iExtendedSettings );
-    */
+    
+    CIpsSosAOSettingsHandler* settings = 
+            CIpsSosAOSettingsHandler::NewL(
+                iSession, iMailboxId );
+    CleanupStack::PushL(settings);
+    
+    settings->SetEmnReceivedButNotSyncedFlag( aNewValue );
+    
+    CleanupStack::PopAndDestroy(settings);
 	//</QMail>
     }
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 //
-//<cmail>
 TBool CIpsSosAOMBoxLogic::IsMailboxRoamingStoppedL()
-//</cmail>
     {
     TBool ret = EFalse;
     if ( iIsRoaming && !CanConnectIfRoamingL() )
@@ -309,11 +324,6 @@
     
     while ( event != EEventNop && iState != EStateError )
         {
-//<cmail> removing flags    
-/*#ifdef IPSSOSIMAPPOLOGGING_ON
-        WriteDebugData( event );
-#endif*/
-//</cmail>
         switch ( event )
             {
             case EEventTimerFired:
@@ -332,21 +342,24 @@
                     // received when emn arrives, checking scheduling 
                     // if user have selected week days / hours in setting
 					//<QMail>
-                /*
+                    CIpsSosAOSettingsHandler* settings = 
+                             CIpsSosAOSettingsHandler::NewL(iSession, iMailboxId);
+                    CleanupStack::PushL(settings);
+                    
                     CIpsSosAOSchedulerUtils* scheduler = 
-                        CIpsSosAOSchedulerUtils::NewLC( *iExtendedSettings );
-                        */
+                        CIpsSosAOSchedulerUtils::NewLC( *settings );
+                        
                     TTimeIntervalSeconds seconds;
-                    TIpsSosAOConnectionType type = EAOCConnectAfter; 
-                        //= scheduler->SecondsToNextMark( seconds );
+                    TIpsSosAOConnectionType type = 
+                            scheduler->SecondsToNextMark( seconds );
+                    
 					//</QMail>
                     if ( type == EAOCConnectAfter )
                         {
                         iState = EStateWaitSyncStart;
                         iTimer->After( seconds );
-                        //<cmail>
+                        
                         SetEmnReceivedFlagL( ETrue );
-                        //</cmail>
                         }
                     else
                         {
@@ -355,7 +368,7 @@
                         iState = EStateSyncOngoing;
                         }
 					//<QMail>
-                    //CleanupStack::PopAndDestroy( scheduler );
+                    CleanupStack::PopAndDestroy( 2, settings );
 					//</QMail>
                     }
                 // ignore in other states
@@ -482,6 +495,11 @@
     {
     FUNC_LOG;
     TInt event = EEventNop;
+	//<Qmail>
+    CIpsSosAOSettingsHandler* settings = 
+             CIpsSosAOSettingsHandler::NewL(iSession, iMailboxId);
+    CleanupStack::PushL(settings);
+	//</Qmail>     
     if ( iState == EStateSyncOngoing )
         {
         if ( !( iError == KErrNone || iError == KErrCancel ) )
@@ -493,23 +511,20 @@
             iError = KErrNone;
             iErrorCounter = 0;
             }
-        //<cmail>
+        
         if ( iError != KErrNone && 
                 IsErrorFatalL( iError ) )
-        //</cmail>
             {
             iAgent->CancelAllAndDisconnectL();
             // switch ao off
 			//<QMail>
-            /*
-            iExtendedSettings->SetAlwaysOnlineState( EMailAoOff );
+            
+            settings->SetAlwaysOnlineState( IpsServices::EMailAoOff );
             // emn not swithced of if its going to be "always on" in
             // future
-            iExtendedSettings->SetEmnReceivedButNotSyncedFlag( EFalse );
-            iDataApi->SaveExtendedSettingsL(
-                *iExtendedSettings );
-                */
-			//</QMail>
+            
+            settings->SetEmnReceivedButNotSyncedFlag( EFalse );
+            //</QMail>
             iState = EStateError;
             iErrorCounter = 0;
             }
@@ -518,9 +533,10 @@
             {
             // not fatal error
 			//<QMail>
-        /*
-            TIpsSetDataAoStates state = iExtendedSettings->AlwaysOnlineState();
-            if ( state == EMailAoOff )
+            IpsServices::TIpsSetDataAoStates state = 
+                    settings->AlwaysOnlineState();
+            
+            if ( state == IpsServices::EMailAoOff )
                 {
                 iState = EStateIdleAndWaitCommands;
                 }
@@ -528,19 +544,18 @@
                 {
                 if( !iTimer->IsActive() )
                     {
-                iTimer->After( KIpsSosAOReTryInterval );
+                    iTimer->After( KIpsSosAOReTryInterval );
                     }
                 iState = EStateWaitSyncStart;
                 }
-                */
+
 			//</QMail>
             }
         else if ( iError != KErrNone && 
                 iErrorCounter >= KIpsSosAOMaxReTryTimes )
             {
-            //<cmail>
+            
             SetEmnReceivedFlagL( EFalse );
-            //</cmail>
             // not fatal, but all re trys are gone
             CalculateToNextIntervalL();
             }
@@ -565,6 +580,9 @@
             event = CheckSchedulingAndSwitchStateL();          
             }
         }
+		//<Qmail>
+    CleanupStack::PopAndDestroy(settings);
+	//</Qmail>
     return event;
     }
 
@@ -590,26 +608,32 @@
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 //<QMail>
-//<cmail>
-TBool CIpsSosAOMBoxLogic::IsErrorFatalL( TInt /*aError*/ )
-//</cmail>
+
+TBool CIpsSosAOMBoxLogic::IsErrorFatalL( TInt aError )
     {
     FUNC_LOG;
     // error can be fatal only if we haven't got successful connect
     // in mailbox ever and error is something else than KErrNone or
     // KErrCancel, and retry interval is reached
     TBool ret = EFalse;
-    LoadSettingsL();
-    /*
-    TAOInfo info = iExtendedSettings->LastUpdateInfo();
+    //<Qmail>
+    
+    //</Qmail>
+    
+    CIpsSosAOSettingsHandler* settings = 
+             CIpsSosAOSettingsHandler::NewL(iSession, iMailboxId);
+    CleanupStack::PushL(settings);
+    
+    IpsServices::TAOInfo info = settings->LastUpdateInfo();
     if ( aError != KErrNone && aError != KErrCancel 
             && !info.iUpdateSuccessfulWithCurSettings
             && iErrorCounter >= KIpsSosAOMaxReTryTimes )
         {
         ret = ETrue;
         }
-        */
-	//</QMail>
+    
+    CleanupStack::PopAndDestroy(settings);
+    //</QMail>
     return ret;
     }
 
@@ -619,20 +643,24 @@
 CIpsSosAOMBoxLogic::TMBoxLogicEvent 
     CIpsSosAOMBoxLogic::CheckSchedulingAndSwitchStateL()
     {
-     //<cmail> logs removed </cmail>
-    iTimer->Cancel();
+	//<Qmail>
+    FUNC_LOG;
+     iTimer->Cancel();
     TMBoxLogicEvent event = EEventNop;
     TTimeIntervalSeconds secondsToConnect = CalculateScheduledSyncTimeL();
-    //<cmail> logs removed </cmail>
+    
+    CIpsSosAOSettingsHandler* settings = 
+             CIpsSosAOSettingsHandler::NewL(iSession, iMailboxId);
+    CleanupStack::PushL(settings);
+      
     if ( secondsToConnect.Int() == 0 )
         {
         //check last successfull sync time and check is interval reached
-	//<QMail>
-    /*
-        TAOInfo info = iExtendedSettings->LastUpdateInfo();
+
+    
+        IpsServices::TAOInfo info = settings->LastUpdateInfo();
         if ( !info.iUpdateSuccessfulWithCurSettings )
             {
-        
             event = EEventStartSync;
             }
         else 
@@ -640,7 +668,7 @@
             TTime now;
             now.HomeTime();
             TInt interval = 
-                iExtendedSettings->InboxRefreshTime() * KAOSecondsInMinute;
+                    settings->InboxRefreshTime() * KAOSecondsInMinute;
             TTimeIntervalSeconds secsFromLastSync;
             now.SecondsFrom( info.iLastSuccessfulUpdate, secsFromLastSync );
             if ( (secsFromLastSync.Int() > 0) && ( 
@@ -661,23 +689,22 @@
         {
         // means that ao is not on (but emn is)
         iState = EStateIdleAndWaitCommands;
-       
-        if ( iExtendedSettings->EmnReceivedButNotSyncedFlag() )
+      
+        if ( settings->EmnReceivedButNotSyncedFlag() )
             {
             // got emn when logic was stopped
             event = EEventStartSync;
             }
-            
         }
     else
         {
         iTimer->After( secondsToConnect );
         iState = EStateWaitSyncStart;
+        
+
         }
-    */
-	//</QMail>
-        }
-    
+    CleanupStack::PopAndDestroy(settings);
+    //</Qmail>
     return event;
     }
 
@@ -687,12 +714,12 @@
 void CIpsSosAOMBoxLogic::CalculateToNextIntervalL()
     {
     FUNC_LOG;
-    //<cmail> logs removed </cmail>
+    
     iTimer->Cancel();
     TTimeIntervalSeconds interval;
     // first check and calculate scheduling function also loads settings
     interval = CalculateScheduledSyncTimeL();
-    //<cmail> logs removed </cmail>
+    
     if ( interval.Int() == 0 )
         {
         // add next interval, if interval is grater than 0 it means
@@ -700,8 +727,12 @@
         // settings
 		
 		//<QMail>
-       // iTimer->After( 
-       //         iExtendedSettings->InboxRefreshTime() * KAOSecondsInMinute );
+        CIpsSosAOSettingsHandler* settings = 
+                 CIpsSosAOSettingsHandler::NewL(iSession, iMailboxId);
+        CleanupStack::PushL(settings);
+        iTimer->After( 
+                settings->InboxRefreshTime() * KAOSecondsInMinute );
+        CleanupStack::PopAndDestroy(settings);
 	   //</QMail>
         iState = EStateWaitSyncStart;
         }
@@ -722,30 +753,36 @@
 //
 TTimeIntervalSeconds CIpsSosAOMBoxLogic::CalculateScheduledSyncTimeL()
     {
-    FUNC_LOG;
-    //<cmail> logs removed </cmail> 
-    LoadSettingsL();
-    TTimeIntervalSeconds seconds;
-	//<QMail>
-    /*
+    FUNC_LOG;    
+	//<Qmail>
+    
+    TTimeIntervalSeconds seconds=KErrNotFound;
+	
+    
+    CIpsSosAOSettingsHandler* settings = 
+             CIpsSosAOSettingsHandler::NewL(iSession, iMailboxId);
+    CleanupStack::PushL(settings);
+            
     // first check is ao or emn on at all
-    if ( (iExtendedSettings->AlwaysOnlineState() == EMailAoOff && 
-            iExtendedSettings->EmailNotificationState() == EMailEmnOff  )||
-        iExtendedSettings->SelectedWeekDays() == 0 ) // no week days chosen
+    if ( (settings->AlwaysOnlineState() == IpsServices::EMailAoOff && 
+            settings->EmailNotificationState() == IpsServices::EMailEmnOff  )||
+            settings->SelectedWeekDays() == 0 ) // no week days chosen
         {
         // no timed sync on
+        CleanupStack::PopAndDestroy(settings);    
         return KErrNotFound;
         }
     
-    if ( iExtendedSettings->EmailNotificationState() != EMailEmnOff && 
-         !iExtendedSettings->EmnReceivedButNotSyncedFlag()   )
+    if ( settings->EmailNotificationState() != IpsServices::EMailEmnOff && 
+         !settings->EmnReceivedButNotSyncedFlag()   )
         {
+        CleanupStack::PopAndDestroy(settings);
         return KErrNotFound;
         }
     
     
     CIpsSosAOSchedulerUtils* scheduler = CIpsSosAOSchedulerUtils::NewLC(
-        *iExtendedSettings );
+        *settings );
 
     TIpsSosAOConnectionType type = scheduler->SecondsToNextMark( seconds );
     if ( type == EAOCDisconnectAfter ) 
@@ -761,8 +798,8 @@
         // this means that user have choosed time/day schedule at 
         // timed sync and now we have to wait sync time
         }
-    CleanupStack::PopAndDestroy( scheduler );
-    */
+    CleanupStack::PopAndDestroy( 2, settings );
+    
 	//</QMail>
     return seconds;
     }
@@ -773,11 +810,9 @@
 void CIpsSosAOMBoxLogic::LoadSettingsL()
     {
     FUNC_LOG;
-    //<cmail> logs removed </cmail> 
-	//<QMail>
+    //<QMail>
     //removed loading
 	//</QMail>
-    //<cmail> logs removed </cmail>
     }
 
 // ----------------------------------------------------------------------------
@@ -788,18 +823,21 @@
     FUNC_LOG;
     TTime now;
     now.HomeTime();
-    LoadSettingsL();
-	//<QMail>
-    /*
-    TAOInfo info;
+    //<QMail>
+    
+	
+    CIpsSosAOSettingsHandler* settings = 
+             CIpsSosAOSettingsHandler::NewL(iSession, iMailboxId);
+    CleanupStack::PushL(settings);
+        
+    IpsServices::TAOInfo info;
     info.iLastSuccessfulUpdate = now;
     info.iUpdateSuccessfulWithCurSettings = ETrue;
-    iExtendedSettings->SetLastUpdateInfo( info );
+    settings->SetLastUpdateInfo( info );
     // clear flag
-    iExtendedSettings->SetEmnReceivedButNotSyncedFlag( EFalse );
-    iDataApi->SaveExtendedSettingsL(
-            *iExtendedSettings );
-            */
+    settings->SetEmnReceivedButNotSyncedFlag( EFalse );
+            
+    CleanupStack::PopAndDestroy(settings);
 	//</QMail>
     }
 
@@ -808,18 +846,29 @@
 TBool CIpsSosAOMBoxLogic::CanConnectIfRoamingL()
     {
     FUNC_LOG;
-    TBool ret = ETrue;
-    LoadSettingsL();
-	//<QMail>
-    /*
-    if ( ( iExtendedSettings->EmailNotificationState() == EMailEmnHomeOnly 
-          || iExtendedSettings->AlwaysOnlineState() == EMailAoHomeOnly
-          || iExtendedSettings->RoamHomeOnlyFlag() ) && iIsRoaming )
-        {
+    TBool ret = EFalse;
+    //<Qmail>
+    RCmManager mgr;
+    CleanupClosePushL(mgr);
+    TRAPD(err, mgr.OpenL());
+    
+    TCmGenConnSettings set;
+    
+    if(err==KErrNone){
+        TRAP(err, mgr.ReadGenConnSettingsL(set));
+        }
+    
+    CleanupStack::PopAndDestroy(&mgr);
+    
+    if( err==KErrNone && 
+            set.iCellularDataUsageVisitor == ECmCellularDataUsageAutomatic){
+        ret = ETrue;
+        }
+    else{
         ret = EFalse;
         }
-        */
-	//</QMail>
+   
+    //</QMail>
     return ret;          
     }
 
@@ -828,8 +877,16 @@
 TBool CIpsSosAOMBoxLogic::FirstEMNReceived()
     {
 	//<QMail>
-    //return iExtendedSettings->FirstEmnReceived();
-    return false;
+    CIpsSosAOSettingsHandler* settings = NULL;
+    TBool ret = EFalse;
+    TRAP_IGNORE(CIpsSosAOSettingsHandler::NewL(iSession, iMailboxId));
+    if(settings){
+        ret = settings->FirstEmnReceived();
+        delete settings;
+        }
+    
+    return ret;
+    
 	//</QMail>
     }
 
@@ -837,78 +894,30 @@
 // ----------------------------------------------------------------------------
 void CIpsSosAOMBoxLogic::SetFirstEMNReceived()
     {
-    TRAP_IGNORE( LoadSettingsL() );
-	//<QMail>
-    /*
-    iExtendedSettings->SetFirstEmnReceived( ETrue );
+    //<QMail>
+    
+    CIpsSosAOSettingsHandler* settings = NULL;
+    TRAP_IGNORE( settings = 
+            CIpsSosAOSettingsHandler::NewL(iSession, iMailboxId));
+    
+    if(settings){
+        settings->SetFirstEmnReceived( ETrue );
+        
     
-    //if alwaysonline was allowed to roam, so will EMN be.
-    iExtendedSettings->SetEmailNotificationState(
-            iExtendedSettings->AlwaysOnlineState() == 
-            EMailAoAlways ? EMailEmnAutomatic : EMailEmnHomeOnly );
-    
+        //if alwaysonline was allowed to roam, so will EMN be.
+        settings->SetEmailNotificationState(
+            settings->AlwaysOnlineState() == 
+            IpsServices::EMailAoAlways ? 
+                IpsServices::EMailEmnAutomatic : IpsServices::EMailEmnHomeOnly );
+        
+        
+        // set always online state off when emn is on
+        settings->SetAlwaysOnlineState( IpsServices::EMailAoOff );
+        delete settings;
+        }
     
-    // set always online state off when emn is on
-    iExtendedSettings->SetAlwaysOnlineState( EMailAoOff );    
-    iExtendedSettings->SetInboxRefreshTime( KErrNotFound );
-    
-    TRAP_IGNORE( iDataApi->SaveExtendedSettingsL(
-       *iExtendedSettings ) );    
-    */
 	//</QMail>
     }
-//<cmail> removing flags
-/*
-#ifdef IPSSOSIMAPPOLOGGING_ON
-// ----------------------------------------------------------------------------
-// ----------------------------------------------------------------------------
-//
-void CIpsSosAOMBoxLogic::WriteDebugData( TInt aEvent )
-    {
-    switch ( aEvent )
-        {
-        case EEventTimerFired:
-            break;
-        case EEventStartSync:
-            break;
-        case EEventFetchMessages:
-            break;
-        case EEventOperationCompleted:
-            break;
-        case EEventSuspendOperations:
-            break;
-        case EEventContinueOperations:
-            break;
-        case EEventStart:
-            break;
-        case EEventStopAndRemoveOps:
-            break;
-        case EEventNop:
-            break;
-        default:
-            break;
-        }
-
-    switch ( iState )
-        {
-        case EStateWaitSyncStart:
-            break;
-        case EStateSyncOngoing:
-            break;
-        case EStateFetchOngoing:
-            break;
-        case EStateSuspended:
-            break;
-        case EStateIdleAndWaitCommands:
-            break;
-        case EStateError:
-            break;
-        default:
-            break;
-        };
-    }
-#endif // IPSSMTPLOGGING_ON*/
-//</cmail>    
 
 // End of file
 
--- a/ipsservices/ipssosaoplugin/src/IpsSosAOPluginTimer.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosaoplugin/src/IpsSosAOPluginTimer.cpp	Fri May 14 15:41:10 2010 +0300
@@ -20,11 +20,6 @@
 #include "emailtrace.h"
 #include "IpsSosAOPluginTimer.h"
 
-//<cmail> //internal dependency removed
-/*#ifdef _DEBUG
-#include "../../internal/IpsSosAOPluginTester/inc/IpsSosAOPluginTester.hrh"
-#endif // _DEBUG*/
-//</cmail>
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
@@ -84,12 +79,6 @@
     time = time + aSeconds;
     iTimer.At( iStatus, time );
     SetActive();
-    
-//<cmail> removing flags
-/*#ifdef IPSAOPLUGINTESTER_MBOXLOGICTEST   
-    iTestActivationTime = time;
-#endif // IPSAOPLUGINTESTER_MBOXLOGICTEST*/
-//</cmail>    
     }
     
 // ----------------------------------------------------------------------------
@@ -120,27 +109,6 @@
     return KErrNone;            
     }
 
-//<cmail> removing flags
-/*#ifdef IPSAOPLUGINTESTER_MBOXLOGICTEST
-// ----------------------------------------------------------------------------
-// TEST USAGE
-// ----------------------------------------------------------------------------
-//
-TInt CIpsSosAOPluginTimer::GetSecondsToTrick()
-    {
-    if ( !IsActive() )
-        {
-        return KErrNotFound;
-        }
-    
-    TTime now;
-    now.HomeTime();
-    TTimeIntervalSeconds secs;
-    iTestActivationTime.SecondsFrom( now, secs );
-    return secs.Int();
-    }
-#endif // IPSAOPLUGINTESTER_MBOXLOGICTEST*/
-//</cmail>    
 
 //EOF
 
--- a/ipsservices/ipssosaoplugin/src/IpsSosAOPopAgent.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosaoplugin/src/IpsSosAOPopAgent.cpp	Fri May 14 15:41:10 2010 +0300
@@ -460,12 +460,7 @@
         iPopulateLimit = ( iPopulateLimit * 1024 ) / 75;
         }
 	//<QMail>
-    /*
-    else if ( iPopulateLimit == KIpsSetDataHeadersOnly )    
-        {
-        iPopulateLimit = 0;
-        }
-        */
+    
 	//</QMail>
     else
         {
--- a/ipsservices/ipssosaoplugin/src/IpsSosAOSchedulerUtils.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosaoplugin/src/IpsSosAOSchedulerUtils.cpp	Fri May 14 15:41:10 2010 +0300
@@ -20,7 +20,7 @@
 #include "emailtrace.h"
 #include "IpsSosAOSchedulerUtils.h"
 //<QMail>
-
+#include "IpsSosAOSettingsHandler.h"
 //</QMail>
 
 
@@ -32,7 +32,8 @@
 // ----------------------------------------------------------------------------
 //
 //<Qmail>
-CIpsSosAOSchedulerUtils::CIpsSosAOSchedulerUtils()
+CIpsSosAOSchedulerUtils::CIpsSosAOSchedulerUtils( CIpsSosAOSettingsHandler& aSettings ):
+        iSettings(aSettings)
 //</Qmail>
     {
     FUNC_LOG;
@@ -58,12 +59,12 @@
 // ----------------------------------------------------------------------------
 //
 //<Qmail>
-CIpsSosAOSchedulerUtils* CIpsSosAOSchedulerUtils::NewL()
+CIpsSosAOSchedulerUtils* CIpsSosAOSchedulerUtils::NewL(CIpsSosAOSettingsHandler& aSettings)
 //</Qmail>
     {
     FUNC_LOG;
     //<Qmail>
-    CIpsSosAOSchedulerUtils* self = NewLC();
+    CIpsSosAOSchedulerUtils* self = NewLC(aSettings);
     //</Qmail>
     CleanupStack::Pop( self );
 
@@ -74,13 +75,13 @@
 // ----------------------------------------------------------------------------
 //
 //<Qmail>
-CIpsSosAOSchedulerUtils* CIpsSosAOSchedulerUtils::NewLC()
+CIpsSosAOSchedulerUtils* CIpsSosAOSchedulerUtils::NewLC(CIpsSosAOSettingsHandler& aSettings)
 //</Qmail>
     {
     FUNC_LOG;
     CIpsSosAOSchedulerUtils* self =
             //<Qmail>
-        new ( ELeave ) CIpsSosAOSchedulerUtils();
+        new ( ELeave ) CIpsSosAOSchedulerUtils(aSettings);
     //</Qmail>
     CleanupStack::PushL( self );
     self->ConstructL();
@@ -227,8 +228,7 @@
     TDay currentDay = aClock.DayNoInWeek();
     TDay previousDay = GetPrevDay( currentDay );
     TIpsSosAOValidConnectionDay result;
-    
-    
+        
     // Connection can be made anyday
     if ( IsDaySelected( currentDay ) && IsDaySelected( previousDay ) )
         {
@@ -250,10 +250,10 @@
         }
     // no selected days this is wron in settings side but still return anyday
 	//<QMail>
-    /*else if ( iExtentedSettings.SelectedWeekDays() == 0 )
+    else if ( iSettings.SelectedWeekDays() == 0 )
         {
         result = EAOVCDConnectionAnyDay;
-        }*/
+        }
 	//</QMail>
     // Connection is not allowed
     else
@@ -261,7 +261,7 @@
         
         result = EAOVCDNoConnection;
         } 
-        
+    
     return result;           
     }
 
@@ -392,8 +392,8 @@
     TTime zeroTime( 0 );
     TTime adjustedHomeTime = AdjustHomeTime( aClock );
 	//<QMail>
-    TTime selectedTimeStart;// = iExtentedSettings.SelectedTimeStart();
-    TTime selectedTimeStop;// = iExtentedSettings.SelectedTimeStop();
+    TTime selectedTimeStart = iSettings.SelectedTimeStart();
+    TTime selectedTimeStop = iSettings.SelectedTimeStop();
 	//</QMail>
     adjustedHomeTime.SecondsFrom( zeroTime, aHome );
     selectedTimeStart.SecondsFrom( zeroTime, aStart );
@@ -508,9 +508,9 @@
 //
 TTimeIntervalSeconds CIpsSosAOSchedulerUtils::CalcSecsToNextScheduledDay(
 //<QMail>
-    const TTime& /*aClock*/,
-    const TTimeIntervalSeconds& /*aHome*/,
-    const TBool /*aScheduledDay*/ )
+    const TTime& aClock,
+    const TTimeIntervalSeconds& aHome,
+    const TBool aScheduledDay )
     {
     FUNC_LOG;
 
@@ -518,14 +518,10 @@
 
     // First check if all of the days are unchecked, which should not happen
     // at all, but just in case
-    /*
-    if ( !iExtentedSettings.SelectedWeekDays() )
+    
+    if ( !iSettings.SelectedWeekDays() )
         {
-        // Temporarly set all the days selected
         return seconds;
-        __ASSERT_DEBUG( ( 
-                EFalse ), 
-                User::Panic( _L("AO"), KErrGeneral) );
         }
 
     TBool hit = EFalse;
@@ -544,7 +540,7 @@
     
     seconds = KAOSecondsIn24Hours - aHome.Int() +
         dayCount * KAOSecondsIn24Hours;
-*/
+
     //</QMail>
     return seconds;       
     }
@@ -553,12 +549,11 @@
 // ----------------------------------------------------------------------------
 //
 //<QMail>
-TBool CIpsSosAOSchedulerUtils::IsDaySelected( const TUint /*aDay*/ ) const
+TBool CIpsSosAOSchedulerUtils::IsDaySelected( const TUint aDay ) const
     {
     FUNC_LOG;
-    //return ( iExtentedSettings.SelectedWeekDays() >> aDay ) & 0x01;
-    return EFalse;
-	//</QMail>
+    return ( iSettings.SelectedWeekDays() >> aDay ) & 0x01;
+    //</QMail>
     }
 
 // End of File
--- a/ipsservices/ipssosaoplugin/src/IpsSosAOSettingsHandler.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosaoplugin/src/IpsSosAOSettingsHandler.cpp	Fri May 14 15:41:10 2010 +0300
@@ -16,23 +16,34 @@
 *
 */
 #include "IpsSosAOSettingsHandler.h"
+#include "IpsSosAoExtendedSettingsManager.h"
+#include "nmipssettingitems.h"
+#include "ipssettingkeys.h"
 #include <SendUiConsts.h>
+#include <msvapi.h>
+#include <cemailaccounts.h>
+#include <smtpset.h>
+#include <nmcommon.h>
 
+const TInt KAOMinutesInHour = 60;
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
-CIpsSosAOSettingsHandler* CIpsSosAOSettingsHandler::NewL( TUid aProtocol )
+CIpsSosAOSettingsHandler* CIpsSosAOSettingsHandler::NewL( 
+        CMsvSession& aSession,
+        TMsvId aMailboxId )
     {
-    CIpsSosAOSettingsHandler* self = new(ELeave)CIpsSosAOSettingsHandler();
+    CIpsSosAOSettingsHandler* self = new(ELeave)CIpsSosAOSettingsHandler(aSession);
     CleanupStack::PushL(self);
-    self->ConstructL( aProtocol );
+    self->ConstructL( aMailboxId );
     CleanupStack::Pop(self);
     return self;
     }
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
-CIpsSosAOSettingsHandler::CIpsSosAOSettingsHandler() 
+CIpsSosAOSettingsHandler::CIpsSosAOSettingsHandler(CMsvSession& aSession) :
+        iSession(aSession)
     {
     }
 
@@ -40,13 +51,17 @@
 // ----------------------------------------------------------------------------
 CIpsSosAOSettingsHandler::~CIpsSosAOSettingsHandler()
     {
+    delete iExtMgr;
     }
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
-void CIpsSosAOSettingsHandler::ConstructL( TUid aProtocol )
+void CIpsSosAOSettingsHandler::ConstructL( TMsvId aMailboxId )
     {
-    iMtmType = aProtocol;
+    TMsvId dummy;    
+    iSession.GetEntry(aMailboxId, dummy, iEntry);
+    
+    iExtMgr = new NmIpsSosAoExtendedSettingsManager(MboxId());
     }
 
 
@@ -55,11 +70,11 @@
 TInt CIpsSosAOSettingsHandler::GetFSPluginId() const
     {
     TInt pluginId = 0;
-    if ( iMtmType.iUid == KSenduiMtmImap4UidValue )
+    if ( iEntry.iMtm.iUid == KSenduiMtmImap4UidValue )
         {
         pluginId = IPSSOSIMAP4PLUGIN_IMPLEMENTATION_UID;
         }
-    else if ( iMtmType.iUid == KSenduiMtmPop3UidValue )
+    else if ( iEntry.iMtm.iUid == KSenduiMtmPop3UidValue )
         {
         pluginId = IPSSOSPOP3PLUGIN_IMPLEMENTATION_UID;
         }
@@ -68,21 +83,64 @@
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
+NmId CIpsSosAOSettingsHandler::MboxId() const
+    {
+    NmId id;
+    id.setId32(iEntry.Id());
+    id.setPluginId32(GetFSPluginId());
+    return id;
+    }
+
+// ----------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
 void CIpsSosAOSettingsHandler::GetSubscribedImapFoldersL( 
             TMsvId /*aServiceId*/, 
             RArray<TMsvId>& /*aFoldersArray*/ )
     {
-    
+    //folders not supported
     }
     
     
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 void CIpsSosAOSettingsHandler::ConstructImapPartialFetchInfo( 
-        TImImap4GetPartialMailInfo& /*aInfo*/, 
-        CImImap4Settings& /*aImap4Settings*/ )
+        TImImap4GetPartialMailInfo& aInfo, 
+        CImImap4Settings& aImap4Settings )
     {
+    TInt sizeLimit = aImap4Settings.BodyTextSizeLimit();
     
+    if ( sizeLimit == KIpsHeadersOnly )
+        {
+        aInfo.iTotalSizeLimit = KIpsHeadersOnly;
+        }
+    else if ( sizeLimit == KIpsFullBodyAndAttas )
+        {        
+        aInfo.iTotalSizeLimit = KMaxTInt;
+        aInfo.iAttachmentSizeLimit = KMaxTInt;
+        aInfo.iBodyTextSizeLimit = KMaxTInt;
+        aInfo.iMaxEmailSize = KMaxTInt;
+        aInfo.iPartialMailOptions = ENoSizeLimits;
+        aInfo.iGetMailBodyParts = EGetImap4EmailBodyTextAndAttachments;
+        }
+    else if ( sizeLimit == KIpsFullBodyOnly )
+        {
+        aInfo.iTotalSizeLimit = KMaxTInt; 
+        aInfo.iAttachmentSizeLimit = 0;
+        aInfo.iBodyTextSizeLimit = KMaxTInt;
+        aInfo.iMaxEmailSize = KMaxTInt;
+        aInfo.iPartialMailOptions = EBodyAlternativeText;
+        aInfo.iGetMailBodyParts = EGetImap4EmailBodyAlternativeText;
+        }
+    else
+        {
+        aInfo.iTotalSizeLimit = sizeLimit*1024; 
+        // set zero when it not documentated does total size overrides these 
+        aInfo.iAttachmentSizeLimit = 0;
+        aInfo.iMaxEmailSize = sizeLimit*1024;
+        aInfo.iBodyTextSizeLimit = sizeLimit*1024;
+        aInfo.iPartialMailOptions = EBodyAlternativeText;
+        aInfo.iGetMailBodyParts = EGetImap4EmailBodyAlternativeText;
+        }
     }
 
 
@@ -91,15 +149,37 @@
 IpsServices::TIpsSetDataAoStates 
     CIpsSosAOSettingsHandler::AlwaysOnlineState() const
     {
-    return IpsServices::EMailAoOff;
+    TInt prof = IpsServices::EmailSyncProfileManualFetch;
+    IpsServices::TIpsSetDataAoStates ret = IpsServices::EMailAoOff;
+    
+    QVariant state;
+    TBool ok = GetSettingValue(IpsServices::ReceptionActiveProfile, state);
+    
+    if(ok ){
+        prof = state.toInt();
+        
+        ret = ProfileIntoAOState(prof);
+        }   
+    
+    return ret;
     }
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 void CIpsSosAOSettingsHandler::SetAlwaysOnlineState(
-    const IpsServices::TIpsSetDataAoStates /*aAlwaysOnlineState*/,
-    TBool /*aIgnoreStateFlag*/ )
+    const IpsServices::TIpsSetDataAoStates aAlwaysOnlineState )
     {
+    //we're allowed to switch ourselves off, not on.
+    if ( aAlwaysOnlineState == IpsServices::EMailAoOff ){
+        if(!SetSettingValue(
+                IpsServices::ReceptionActiveProfile, 
+                IpsServices::EmailSyncProfileManualFetch)){
+        
+            CreateKeyValuePair(
+                    IpsServices::ReceptionActiveProfile, 
+                    IpsServices::EmailSyncProfileManualFetch);
+            }
+        }
     
     }
 
@@ -108,7 +188,18 @@
 IpsServices::TIpsSetDataEmnStates 
     CIpsSosAOSettingsHandler::EmailNotificationState() const
     {
-    return IpsServices::EMailEmnOff;
+    IpsServices::TIpsSetDataEmnStates ret = IpsServices::EMailEmnOff;
+
+    /* Not supported yet
+    QVariant state = NULL;
+    TBool ok = GetSettingValue(IpsServices::EmailNotificationState, state);
+        
+    if(ok){
+        ret = static_cast<IpsServices::TIpsSetDataEmnStates>(state.toInt());
+        }
+    */
+        
+    return ret;
     }
 
 // ----------------------------------------------------------------------------
@@ -116,90 +207,315 @@
 void CIpsSosAOSettingsHandler::SetEmailNotificationState(
     const IpsServices::TIpsSetDataEmnStates /*aEmnState*/ )
     {
-    
+    /* Not supported yet
+    if(!SetSettingValue(IpsServices::EmailNotificationState, aEmnState)){
+        CreateKeyValuePair(IpsServices::EmailNotificationState, aEmnState);
+        }
+    */
     }
     
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 TBool CIpsSosAOSettingsHandler::FirstEmnReceived() const
     {
-    return EFalse;
+    TBool ret = EFalse;
+    
+    /* Not supported yet
+    QVariant state = NULL;
+    TBool ok = GetSettingValue(IpsServices::FirstEmnReceived, state);
+            
+    if(ok){
+        ret = static_cast<TBool>(state.toInt());
+        }
+    */
+    
+    return ret;
     }
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 void CIpsSosAOSettingsHandler::SetFirstEmnReceived( TBool /*aValue*/ )
     {
-    
+    /* Not supported yet
+    if(!SetSettingValue( IpsServices::FirstEmnReceived, aValue )){
+        CreateKeyValuePair(IpsServices::FirstEmnReceived, aValue);
+        }
+    */
     }
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 TBool CIpsSosAOSettingsHandler::EmnReceivedButNotSyncedFlag() const
     {
-    return EFalse;
+    TBool ret = EFalse; 
+
+    /* Not supported yet
+
+    QVariant state = NULL;
+    TBool ok = GetSettingValue(IpsServices::EmnReceivedNotSynced, state);
+                
+    if(ok){
+        ret = static_cast<TBool>(state.toInt());
+        }
+    */
+
+    return ret;
     }
     
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 void CIpsSosAOSettingsHandler::SetEmnReceivedButNotSyncedFlag( TBool /*aFlag*/ )
     {
+    /* Not supported yet
     
+    if(!SetSettingValue(IpsServices::EmnReceivedNotSynced, aFlag)){
+        CreateKeyValuePair(IpsServices::EmnReceivedNotSynced, aFlag);
+        }
+    */
     }
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 TUint CIpsSosAOSettingsHandler::SelectedWeekDays() const
     {
-    return 0;
+    TUint ret = 0;
+    
+    QVariant state = NULL;
+    TBool ok = GetSettingValue(IpsServices::ReceptionWeekDays, state);
+                    
+    if(ok){
+        ret = static_cast<TUint>(state.toUInt());
+        }
+    
+    return ret;
     }
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 TTime CIpsSosAOSettingsHandler::SelectedTimeStart() const
     {
-    TTime t = TTime(); 
-    t.HomeTime();
-    return t;
+    QVariant value = NULL;
+    TBool ok = GetSettingValue(IpsServices::ReceptionDayStartTime, value);
+    TDateTime time;
+    
+    if(ok){
+        TInt total = value.toInt();
+        TInt minutes = total%KAOMinutesInHour;
+        TInt hour = total/KAOMinutesInHour;
+        time.SetHour(hour);
+        time.SetMinute(minutes);
+        }
+    
+    TTime ret(time);
+    return ret;       
     }
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 TTime CIpsSosAOSettingsHandler::SelectedTimeStop() const
     {
-    TTime t = TTime();
-    t.HomeTime();
-    return t;
+    QVariant value = NULL;
+    TBool ok = GetSettingValue(IpsServices::ReceptionDayEndTime, value);
+    TDateTime time;
+    
+    if(ok){
+        TInt total = value.toInt();
+        TInt minutes = total%KAOMinutesInHour;
+        TInt hour = total/KAOMinutesInHour;
+        time.SetHour(hour);
+        time.SetMinute(minutes);
+        }
+    
+    TTime ret(time);
+    return ret;
     }
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 void CIpsSosAOSettingsHandler::SetLastUpdateInfo( 
-        const IpsServices::TAOInfo& /*aLastUpdateInfo*/ )
+        const IpsServices::TAOInfo& aLastUpdateInfo )
     {
-    
+    TInt high = I64HIGH(aLastUpdateInfo.iLastSuccessfulUpdate.Int64());
+    TInt low = I64LOW(aLastUpdateInfo.iLastSuccessfulUpdate.Int64());
+   
+    if(!SetSettingValue(IpsServices::AoLastSuccessfulUpdateL, low)){
+        CreateKeyValuePair(IpsServices::AoLastSuccessfulUpdateL, low);
+        }
+        
+    if(!SetSettingValue(IpsServices::AoLastSuccessfulUpdateH, high)){
+        CreateKeyValuePair(IpsServices::AoLastSuccessfulUpdateH, high);
+        }
+        
+    if(!SetSettingValue(
+            IpsServices::AoLastUpdateFailed, 
+            aLastUpdateInfo.iLastUpdateFailed)){
+        CreateKeyValuePair(IpsServices::AoLastUpdateFailed, 
+                aLastUpdateInfo.iLastUpdateFailed);
+        }
+        
+    if(!SetSettingValue(
+            IpsServices::AoUpdateSuccessfulWithCurSettings, 
+            aLastUpdateInfo.iUpdateSuccessfulWithCurSettings)){
+        CreateKeyValuePair(IpsServices::AoUpdateSuccessfulWithCurSettings, 
+                aLastUpdateInfo.iUpdateSuccessfulWithCurSettings);
+        }
     }
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 IpsServices::TAOInfo CIpsSosAOSettingsHandler::LastUpdateInfo() const
     {
-    IpsServices::TAOInfo dummy;
-    return dummy;
+    IpsServices::TAOInfo info;
+
+    TDateTime time;        
+    info.iLastSuccessfulUpdate = time; 
+    
+    QVariant high=NULL;
+    QVariant low=NULL;
+    QVariant fail=NULL;
+    QVariant success=NULL;
+        
+    TBool ok = GetSettingValue(IpsServices::AoLastSuccessfulUpdateH, high);
+    if(ok){
+        ok = GetSettingValue(IpsServices::AoLastSuccessfulUpdateL, low);
+        }
+     if(ok){
+         info.iLastSuccessfulUpdate = MAKE_TINT64( high.toInt(), low.toInt() );
+         }
+    
+    ok = GetSettingValue(IpsServices::AoLastUpdateFailed, fail);
+    
+    if(ok){
+        info.iLastUpdateFailed = static_cast<TBool>(fail.toInt());
+        }
+    
+    ok = GetSettingValue(IpsServices::AoUpdateSuccessfulWithCurSettings, success);
+    
+    if(ok){
+        info.iUpdateSuccessfulWithCurSettings = static_cast<TBool>(success.toInt());
+        }
+    
+    return info;
     }
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 TInt CIpsSosAOSettingsHandler::InboxRefreshTime() const
     {
-    return 0;
+    QVariant value = NULL;
+    TBool ok = EFalse;
+    if(IsDaytime()){
+        ok = GetSettingValue( IpsServices::ReceptionRefreshPeriodDayTime, value);
+        }
+    else{
+        ok = GetSettingValue(IpsServices::ReceptionRefreshPeriodOther, value);
+        }    
+    
+    TInt ret = 0;
+    if(ok){
+        ret = value.toInt();
+        }
+    
+    return ret;
+    }
+
+
+
+// ----------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
+HBufC* CIpsSosAOSettingsHandler::EmailAddressL()
+    {
+    CEmailAccounts* acc = CEmailAccounts::NewLC();
+    TSmtpAccount smtp;
+    acc->GetSmtpAccountL( iEntry.iRelatedId , smtp );
+    CImSmtpSettings* smtpSet = new (ELeave) CImSmtpSettings();
+    CleanupStack::PushL( smtpSet );
+    acc->LoadSmtpSettingsL( smtp, *smtpSet );
+    HBufC* address = smtpSet->EmailAddress().AllocL();
+    CleanupStack::PopAndDestroy( 2, acc );
+    
+    return address;
+    }
+
+// ----------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
+TBool CIpsSosAOSettingsHandler::GetSettingValue(
+        IpsServices::SettingItem aItem,
+        QVariant& aValue) const
+    {
+    bool ret = false;
+    if(iExtMgr){
+        ret = iExtMgr->readSetting(aItem, aValue);
+        }
+    return ret;
     }
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
-TBool CIpsSosAOSettingsHandler::RoamHomeOnlyFlag()
+TBool CIpsSosAOSettingsHandler::SetSettingValue(
+        const IpsServices::SettingItem aItem, 
+        const QVariant& aData)
+    {
+    bool ret = false;
+    
+    if(iExtMgr){
+        ret = iExtMgr->writeSetting(aItem, aData);
+        }
+    return ret;
+    }
+
+// ----------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
+TBool CIpsSosAOSettingsHandler::CreateKeyValuePair(
+            const IpsServices::SettingItem aKey, 
+            const QVariant& aValue)
+    {
+    return iExtMgr->createKeyValuePair(aKey, aValue);
+    }
+// ----------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
+TBool CIpsSosAOSettingsHandler::IsDaytime() const
     {
-    return EFalse;
+    TTime current;
+    current.HomeTime();
+    
+    TDateTime tmp = current.DateTime();
+    
+    //create blanc time object for comparison.
+    //real current time cannot be used because we only want to
+    //compare hours & minutes
+    TDateTime dtNow;
+    dtNow.SetMinute(tmp.Minute());
+    dtNow.SetHour(tmp.Hour());
+    
+    TTime now(dtNow);
+    TTime start = SelectedTimeStart();
+    TTime stop = SelectedTimeStop();
+    
+    TDateTime a = start.DateTime();
+    TDateTime b = stop.DateTime();
+    
+    if(now >= start &&
+        now < stop){
+        return ETrue;
+        }
+        
+    return EFalse;    
     }
+
+// ----------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
+IpsServices::TIpsSetDataAoStates CIpsSosAOSettingsHandler::ProfileIntoAOState(
+            const TInt aProfile) const
+    {
+    IpsServices::TIpsSetDataAoStates ret = IpsServices::EMailAoOff;
+    
+    if ( aProfile != IpsServices::EmailSyncProfileManualFetch ){
+        ret = IpsServices::EMailAoAlways;
+        }
+    
+    return ret;
+    }
+    
 // End of file
 
--- a/ipsservices/ipssosaoplugin/src/IpsSosAOSmtpAgent.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosaoplugin/src/IpsSosAOSmtpAgent.cpp	Fri May 14 15:41:10 2010 +0300
@@ -142,12 +142,7 @@
         iOperation = CIpsPlgSmtpOperation::NewL(
             iSession, iStatus  );
         }
-    /*
-    if ( !iSettingsApi )
-        {
-        iSettingsApi = CIpsSetDataApi::NewL( iSession );
-        }
-    */
+    
 	//</QMail>
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ipsservices/ipssosaoplugin/src/IpsSosAoExtendedSettingsManager.cpp	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,411 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <xqsettingsmanager.h>
+#include <xqcentralrepositoryutils.h>
+#include <xqcentralrepositorysearchcriteria.h>
+#include <qlist.h>
+
+#include "IpsSosAoExtendedSettingsManager.h"
+#include "nmipssettingitems.h"
+#include "ipssettingkeys.h"
+#include "nmcommon.h"
+
+/*!
+    \class NmIpsSosAoExtendedSettingsManager
+    \brief The class is used for manipulating extended POP3 and IMAP4 account settings stored
+    in the Central Repository.
+*/
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+    Constructor    
+    Creates the NmIpsSosAoExtendedSettingsManagerfor loading and saving extended mailbox settings.
+    \param mailboxId Mailbox identifier.
+*/
+NmIpsSosAoExtendedSettingsManager::NmIpsSosAoExtendedSettingsManager(const NmId &mailboxId)
+    : mMailboxId(mailboxId), mMailboxOffset(-1), mActiveProfileOffset(-1)
+{
+    mSettingsManager = new XQSettingsManager();
+
+    calculateMailboxOffset();
+}
+
+/*!
+    Destructor
+*/
+NmIpsSosAoExtendedSettingsManager::~NmIpsSosAoExtendedSettingsManager()
+{
+    delete mSettingsManager;
+}
+
+/*!     
+    Reads extended mailbox 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 read, otherwise <false>.
+*/
+bool NmIpsSosAoExtendedSettingsManager::readSetting(IpsServices::SettingItem settingItem,
+                                               QVariant &settingValue) const
+{
+    bool ret(mMailboxOffset>=0);
+    if(ret) {
+        switch(settingItem) {
+            case IpsServices::DownloadPictures:
+                settingValue = readFromCenRep(IpsServices::EmailKeyPreferenceDownloadPictures);
+                break;
+            case IpsServices::MessageDivider:
+                settingValue = readFromCenRep(IpsServices::EmailKeyPreferenceMessageDivider);
+                break;
+            case IpsServices::ReceptionActiveProfile:
+                settingValue = readFromCenRep(IpsServices::EmailKeyReceptionActiveProfile);
+                break;
+            case IpsServices::ReceptionUserDefinedProfile:
+                settingValue = readFromCenRep(IpsServices::EmailKeyReceptionUserDefinedProfile);
+                break;
+            case IpsServices::ReceptionInboxSyncWindow:
+                settingValue = readFromCenRep(mActiveProfileOffset +
+                                              IpsServices::EmailKeyReceptionInboxSyncWindow);
+                break;
+            case IpsServices::ReceptionGenericSyncWindowInMessages:
+                settingValue = readFromCenRep(mActiveProfileOffset +
+                                      IpsServices::EmailKeyReceptionGenericSyncWindowInMessages);
+                break;
+            case IpsServices::ReceptionWeekDays:
+                settingValue = readFromCenRep(mActiveProfileOffset +
+                                              IpsServices::EmailKeyReceptionWeekDays);
+                break;
+            case IpsServices::ReceptionDayStartTime:
+                settingValue = readFromCenRep(mActiveProfileOffset +
+                                              IpsServices::EmailKeyReceptionDayStartTime);
+                break;
+            case IpsServices::ReceptionDayEndTime:
+                settingValue = readFromCenRep(mActiveProfileOffset +
+                                              IpsServices::EmailKeyReceptionDayEndTime);
+                break;
+            case IpsServices::ReceptionRefreshPeriodDayTime:
+                settingValue = readFromCenRep(mActiveProfileOffset +
+                                              IpsServices::EmailKeyReceptionRefreshPeriodDayTime);
+                break;
+            case IpsServices::ReceptionRefreshPeriodOther:
+                settingValue = readFromCenRep(mActiveProfileOffset +
+                                              IpsServices::EmailKeyReceptionRefreshPeriodOther);
+                break;
+            case IpsServices::UserNameHidden:
+                settingValue = readFromCenRep(IpsServices::EmailKeyUserNameHidden);
+                break;
+            case IpsServices::EmailNotificationState:
+                settingValue = readFromCenRep(IpsServices::EmailKeyEMNState);
+                break;
+            case IpsServices::FirstEmnReceived:
+                settingValue = readFromCenRep(IpsServices::EmailKeyFirstEmnReceived);
+                break;
+            case IpsServices::EmnReceivedNotSynced:
+                settingValue = readFromCenRep(IpsServices::EmailKeyEmnReceivedNotSynced);
+                break;
+            case IpsServices::AoLastSuccessfulUpdateL:
+                settingValue = readFromCenRep(IpsServices::EmailKeyAoLastSuccessfulUpdateL);
+                break;
+            case IpsServices::AoLastSuccessfulUpdateH:
+                settingValue = readFromCenRep(IpsServices::EmailKeyAoLastSuccessfulUpdateH);
+                break;
+            case IpsServices::AoLastUpdateFailed:
+                settingValue = readFromCenRep(IpsServices::EmailKeyAoLastUpdateFailed);
+                break;
+            case IpsServices::AoUpdateSuccessfulWithCurSettings:
+                settingValue = readFromCenRep(IpsServices::EmailKeyAoUpdateSuccessfulWithCurSettings);
+                break;
+            default:
+                ret = false;
+                break;
+            }
+    }
+    if(!settingValue.isValid()){
+        ret = false;
+        }
+    
+    return ret;
+}
+   
+/*!     
+    Writes extended mailbox setting.
+    \param settingItem SettingItem enum of the setting to replace.
+    \param settingValue QVariant of the new setting value.
+    \return bool <true> when the setting item was written, otherwise <false>.
+*/
+bool NmIpsSosAoExtendedSettingsManager::writeSetting(IpsServices::SettingItem settingItem,
+                                                const QVariant &settingValue)
+{
+    return writeSettingToCenRep(mActiveProfileOffset, settingItem, settingValue);
+}
+
+/*!     
+
+*/
+bool NmIpsSosAoExtendedSettingsManager::writeSetting(int profileMode,
+    IpsServices::SettingItem settingItem, const QVariant &settingValue)
+{
+    quint32 profileOffset = convertToProfileOffset(profileMode);
+    return writeSettingToCenRep(profileOffset, settingItem, settingValue);
+}
+
+/*!     
+    Deletes all the extended settings of the mailbox.
+*/
+void NmIpsSosAoExtendedSettingsManager::deleteSettings()
+{
+    if(mMailboxOffset>=0) {
+
+        // Find all the keys that match the criteria 0xXXXXXZZZ, where X=part of mailbox offset
+        // and Z=don't care. This will give us all the keys for the particular mailbox.
+        quint32 partialKey(mMailboxOffset);
+        quint32 bitMask(0xFFFFF000);
+        XQCentralRepositorySearchCriteria criteria(IpsServices::EmailMailboxSettingRepository,
+                                                   partialKey, bitMask);
+        // Find the keys.
+        XQCentralRepositoryUtils utils(*mSettingsManager);
+        QList<XQCentralRepositorySettingsKey> foundKeys = utils.findKeys(criteria);
+
+        // Delete the keys.
+        foreach(XQCentralRepositorySettingsKey key, foundKeys) {
+            utils.deleteKey(key);
+            }
+    }
+}
+
+/*!
+
+*/
+bool NmIpsSosAoExtendedSettingsManager::writeSettingToCenRep(qint32 profileOffset,
+    IpsServices::SettingItem settingItem, const QVariant &settingValue)
+{
+    bool ret(profileOffset >= 0);
+    if(ret) {
+        switch(settingItem) {
+            case IpsServices::DownloadPictures:
+                ret = writeToCenRep(
+                        IpsServices::EmailKeyPreferenceDownloadPictures, 
+                        settingValue);
+                break;
+            case IpsServices::MessageDivider:
+                ret = writeToCenRep(
+                        IpsServices::EmailKeyPreferenceMessageDivider, 
+                        settingValue);
+                break;
+            case IpsServices::ReceptionActiveProfile:
+                ret = writeToCenRep(
+                        IpsServices::EmailKeyReceptionActiveProfile, 
+                        settingValue);
+                calculateActiveProfileOffset();
+                break;
+            case IpsServices::ReceptionUserDefinedProfile:
+                ret = writeToCenRep(
+                        IpsServices::EmailKeyReceptionUserDefinedProfile, 
+                        settingValue);
+                break;
+            case IpsServices::ReceptionInboxSyncWindow:
+                ret = writeToCenRep(
+                        profileOffset + 
+                        IpsServices::EmailKeyReceptionInboxSyncWindow,
+                        settingValue);
+                break;
+            case IpsServices::ReceptionGenericSyncWindowInMessages:
+                ret = writeToCenRep(
+                        profileOffset + 
+                        IpsServices::EmailKeyReceptionGenericSyncWindowInMessages,
+                        settingValue);
+                break;
+            case IpsServices::ReceptionWeekDays:
+                ret = writeToCenRep(
+                        profileOffset + 
+                        IpsServices::EmailKeyReceptionWeekDays,
+                        settingValue);
+                break;
+            case IpsServices::ReceptionDayStartTime:
+                ret = writeToCenRep(
+                        profileOffset + 
+                        IpsServices::EmailKeyReceptionDayStartTime,
+                        settingValue);
+                break;
+            case IpsServices::ReceptionDayEndTime:
+                ret = writeToCenRep(
+                        profileOffset + 
+                        IpsServices::EmailKeyReceptionDayEndTime,
+                        settingValue);
+                break;
+            case IpsServices::ReceptionRefreshPeriodDayTime:
+                ret = writeToCenRep(
+                        profileOffset + 
+                        IpsServices::EmailKeyReceptionRefreshPeriodDayTime,
+                        settingValue);
+                break;
+            case IpsServices::ReceptionRefreshPeriodOther:
+                ret = writeToCenRep(
+                        profileOffset + 
+                        IpsServices::EmailKeyReceptionRefreshPeriodOther,
+                        settingValue);
+                break;
+            case IpsServices::UserNameHidden:
+                ret = writeToCenRep(
+                        IpsServices::EmailKeyUserNameHidden, settingValue);
+                break;
+            case IpsServices::EmailNotificationState:
+                ret = writeToCenRep(
+                        IpsServices::EmailKeyEMNState, settingValue);
+                break;
+            case IpsServices::FirstEmnReceived:
+                ret = writeToCenRep(
+                        IpsServices::EmailKeyFirstEmnReceived, settingValue);
+                break;
+            case IpsServices::EmnReceivedNotSynced:
+                ret = writeToCenRep(
+                        IpsServices::EmailKeyEmnReceivedNotSynced,
+                        settingValue);
+                break;
+            case IpsServices::AoLastSuccessfulUpdateL:
+                ret = writeToCenRep(
+                        IpsServices::EmailKeyAoLastSuccessfulUpdateL,
+                        settingValue);
+                break;
+            case IpsServices::AoLastSuccessfulUpdateH:
+                ret = writeToCenRep(
+                        IpsServices::EmailKeyAoLastSuccessfulUpdateH,
+                        settingValue);
+                break;
+            case IpsServices::AoLastUpdateFailed:
+                ret = writeToCenRep(
+                        IpsServices::EmailKeyAoLastUpdateFailed,
+                        settingValue);
+                break;
+            case IpsServices::AoUpdateSuccessfulWithCurSettings:
+                ret = writeToCenRep(
+                        IpsServices::EmailKeyAoUpdateSuccessfulWithCurSettings,
+                        settingValue);
+                break;
+            default:
+                ret = false;
+                break;
+            }
+    }
+    return ret;
+}
+
+/*!
+    Creates a new key-value pair into cenrep
+ */
+bool NmIpsSosAoExtendedSettingsManager::createKeyValuePair(
+            const IpsServices::SettingItem settingItem, 
+            const QVariant &settingValue)
+    {
+    
+    XQCentralRepositoryUtils* utils =
+            new XQCentralRepositoryUtils(*mSettingsManager);
+    
+    XQCentralRepositorySettingsKey settingKey(
+                  IpsServices::EmailMailboxSettingRepository,
+                  mMailboxOffset + settingItem);
+          
+    bool ret = utils->createKey(settingKey, settingValue);
+          
+    
+    delete utils;
+    
+    return ret;    
+    }
+
+/*!
+    Reads a key value from the Central Repository.
+    \param key Key identifier.
+    \return The settings value for the given key.
+*/
+QVariant NmIpsSosAoExtendedSettingsManager::readFromCenRep(quint32 key) const
+{
+    XQCentralRepositorySettingsKey settingKey(IpsServices::EmailMailboxSettingRepository,
+                                              mMailboxOffset + key);
+    return mSettingsManager->readItemValue(settingKey);
+}
+
+/*!
+    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.
+*/
+bool NmIpsSosAoExtendedSettingsManager::writeToCenRep(quint32 key, const QVariant &value) const
+{
+    XQCentralRepositorySettingsKey settingKey(IpsServices::EmailMailboxSettingRepository,
+                                              mMailboxOffset + key);
+    return mSettingsManager->writeItemValue(settingKey, value);
+}
+
+void NmIpsSosAoExtendedSettingsManager::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.
+    quint32 partialKey(0x00000000);
+    quint32 bitMask(0x00000FFF);
+    XQCentralRepositorySearchCriteria criteria(IpsServices::EmailMailboxSettingRepository,
+                                               partialKey, bitMask);
+    // Set the mailbox id is value criteria for the search.
+    criteria.setValueCriteria((int)mMailboxId.id32());
+
+    // Find the keys.
+    XQCentralRepositoryUtils utils(*mSettingsManager);
+    QList<XQCentralRepositorySettingsKey> foundKeys = utils.findKeys(criteria);
+
+    // We should only get one key as a result.
+    if (foundKeys.count() == 1) {
+        mMailboxOffset = foundKeys[0].key();
+        calculateActiveProfileOffset();
+    }
+}
+
+/*!
+    Calculates the active reception schedule profile offset.
+*/
+void NmIpsSosAoExtendedSettingsManager::calculateActiveProfileOffset()
+{
+    QVariant activeProfile = readFromCenRep(IpsServices::EmailKeyReceptionActiveProfile);
+    mActiveProfileOffset = convertToProfileOffset(activeProfile.toInt());
+}
+
+/*!
+
+*/
+qint32 NmIpsSosAoExtendedSettingsManager::convertToProfileOffset(int profile)
+{
+    quint32 profileOffset(0);
+    // Possible values are defined in ipssettingkeys.h
+    switch(profile) {
+        case 0:
+            profileOffset = IpsServices::EmailProfileOffsetKUTD;
+            break;
+        case 1:
+            profileOffset = IpsServices::EmailProfileOffsetSE;
+            break;
+        case 2:
+            profileOffset = IpsServices::EmailProfileOffsetMF;
+            break;
+        case 3:
+            profileOffset = IpsServices::EmailProfileOffsetUD;
+            break;
+        default:
+            break;
+    }
+    return profileOffset;
+}
--- a/ipsservices/ipssosplugin/data/2000E53D.rss	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/data/2000E53D.rss	Fri May 14 15:41:10 2010 +0300
@@ -21,6 +21,7 @@
 #include "CFSMailPlugin.hrh" // fsmailplugininterface
 //</cmail>
 #include "ipsplgsosbaseplugin.hrh"
+// <qmail> emailversionnumbers removed
 
 // ---------------------------------------------------------------------------
 // theInfo
@@ -40,7 +41,9 @@
 				IMPLEMENTATION_INFO
 					{
 					implementation_uid = IPSSOSIMAP4PLUGIN_IMPLEMENTATION_UID;
+					// <qmail>
 					version_no = 1;
+					// </qmail>
 					display_name = "FSEmail ECom plugin for imap4";
 					default_data = "";
 					opaque_data  = " ";
@@ -48,7 +51,9 @@
 				IMPLEMENTATION_INFO
 					{
 					implementation_uid = IPSSOSPOP3PLUGIN_IMPLEMENTATION_UID;
+					// <qmail>
 					version_no = 1;
+					// </qmail>
 					display_name = "FSEmail ECom plugin for pop3";
 					default_data = "";
 					opaque_data  = " ";
--- a/ipsservices/ipssosplugin/inc/ipsplgbaseoperation.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgbaseoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -18,17 +18,22 @@
 #ifndef IPSPLGBASEOPERATION_H
 #define IPSPLGBASEOPERATION_H
 
+// <qmail> CFSMailCommon include not needed
+
 class CMsvOperation;
 
 /**
 * class CIpsPlgBaseOperation
-* Common base class for email operations
+*
+* Common base class for email online operations.
 */
 NONSHARABLE_CLASS ( CIpsPlgBaseOperation ) : public CMsvOperation
     {
 public:
     virtual ~CIpsPlgBaseOperation();
 
+	// <qmail> ProgressL function has been removed
+
     /**
     * For reporting if DoRunL leaves
     * All operations must implement this
@@ -53,15 +58,20 @@
 	* (given by caller during instantiation)
 	*/
 	TFSMailMsgId FSMailboxId() const;
-    
+
+// <qmail>    
     /**
     * All concrete derived classes must have a type identifier
     * @return operation type
     */
-    virtual TIpsOpType IpsOpType() const = 0; // <qmail>
+    virtual TIpsOpType IpsOpType() const = 0;
+// </qmail>
 	
 protected:
 
+	/**
+    * C++ constructor
+    */
     // <qmail> priority parameter has been removed
     CIpsPlgBaseOperation(
         CMsvSession& aMsvSession,
@@ -69,6 +79,8 @@
         TInt aFSRequestId,
         TFSMailMsgId aFSMailboxId );
 
+//<qmail> DoCancel, RunL, RunError functions have been removed
+
 protected:
     TInt            iFSRequestId;
     TFSMailMsgId    iFSMailboxId;
--- a/ipsservices/ipssosplugin/inc/ipsplgcommon.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgcommon.h	Fri May 14 15:41:10 2010 +0300
@@ -41,8 +41,10 @@
 static _LIT_SECURITY_POLICY_PASS( KAllowAllPolicy );
 static _LIT_SECURITY_POLICY_C1( KAllowWriteDeviceDataPolicy, ECapabilityWriteDeviceData );
 
+//<qmail>
 _LIT( KIpsPlgReplySubjectFormat, "%S" );
 _LIT( KIpsPlgForwardSubjectFormat, "%S" );
+//</qmail>
 
 /**
  * class TIpsMailboxState
--- a/ipsservices/ipssosplugin/inc/ipsplgconnectandrefreshfolderlist.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgconnectandrefreshfolderlist.h	Fri May 14 15:41:10 2010 +0300
@@ -18,13 +18,16 @@
 #ifndef IPSPLGCONNECTANDREFRESHFOLDERLIST_H
 #define IPSPLGCONNECTANDREFRESHFOLDERLIST_H
 
+// <qmail> AknWaitNoteWrapper include has been removed
 #include <imapset.h>
 
+// Specific includes
 #include "ipsplgonlineoperation.h"
 
 /**
 * Operation that 1) goes online, 2) updates mailbox's folder list, and 3) disconnects again
 */
+// <qmail> MAknBackgroundProcess base class has been removed
 NONSHARABLE_CLASS ( CIpsPlgConnectAndRefreshFolderList ) : public CIpsPlgOnlineOperation
     {
 // <qmail> removed 3 functions from MAknBackgroundProcess
@@ -54,6 +57,10 @@
         MFSMailRequestObserver* aFSObserver, 
         CIpsPlgTimerOperation& aActivityTimer );
 
+    /**
+    * Destructor
+    * ~CIpsPlgConnectAndRefreshFolderList()
+    */
     virtual ~CIpsPlgConnectAndRefreshFolderList();
     
     /**
@@ -71,13 +78,15 @@
     
     TFSProgress GetFSProgressL() const;
 
-    // <qmail> new func to this op
+// <qmail> new func to this op
     /**
      * Returns operation type
      */
     TIpsOpType IpsOpType() const;
+// </qmail>
 
 protected: // From CActive
+
     virtual void DoRunL();
     virtual void DoCancel();
     
@@ -93,8 +102,13 @@
         ECompleted
         };
 
-    // <qmail> priority parameter has been removed
-    CIpsPlgConnectAndRefreshFolderList( 
+	/**
+    * C++ constructor
+    * CIpsPlgConnectAndRefreshFolderList()
+    */
+    // <qmail> rename selection parameter
+	// <qmail> MFSMailRequestObserver& changed to pointer
+	CIpsPlgConnectAndRefreshFolderList( 
         CMsvSession& aSession,
         TRequestStatus& aObserverRequestStatus, 
         TMsvId aService, 
@@ -103,10 +117,17 @@
         MFSMailRequestObserver* aFSObserver, 
         CIpsPlgTimerOperation& aTimer );
 
+    /**
+    * ConstructL()
+    */
+	// <qmail> aMsvEntry parameter has been removed
     void ConstructL();
 
-private: // data
-    // <qmail> changes in members
+	// <qmail> DisplayLoginFailedDialogL function has been removed
+
+    //data
+private:
+    // <qmail> changes in members: iTimer, iAsyncWaitNote removed, iMsvEntry -> iSelection
     TIpsSetFolderRefreshStates          iState;
     CMsvEntrySelection*					iSelection; // owned
     TPckgBuf<TImap4CompoundProgress>    iProgressBuf;
--- a/ipsservices/ipssosplugin/inc/ipsplgcreateforwardmessageoperation.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgcreateforwardmessageoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -29,12 +29,24 @@
 NONSHARABLE_CLASS ( CIpsPlgCreateForwardMessageOperation ) : public CIpsPlgCreateMessageOperation
     {
 public:
-    
+    //<qmail> comments added
+	//<qmail> para to refe
     /**
-    * Constructor.
+    * Two-phased constructor
+    * 
+    * @param aSmtpService               contains SMTP message services
+    * @param aMsvSession                client/server session to MsvServer
+    * @param aObserverRequestStatus     operations observer status
+    * @param aPartList                  specifies one or more parts of a message
+    * @param aMailBoxId                 id's for mailbox and plugin
+    * @param aOriginalMessageId         id of message to be forward
+    * @param aOperationObserver         observes the progress of this operation
+    * @param aRequestId                 identifier for this instance of operation, 
+    *                                   assigned by the client
+    * @return CIpsPlgCreateForwardMessageOperation* self pointer                                  
     */
     static CIpsPlgCreateForwardMessageOperation* NewL(
-        CIpsPlgSmtpService* aSmtpService,
+        CIpsPlgSmtpService& aSmtpService,
         CMsvSession& aMsvSession,
         TRequestStatus& aObserverRequestStatus,
         TMsvPartList aPartList,
@@ -42,7 +54,7 @@
         TMsvId aOriginalMessageId,
         MFSMailRequestObserver& aOperationObserver,
         TInt aRequestId );
-        
+        //</qmail>
     /**
     * Destructor.
     */
@@ -53,8 +65,9 @@
     /**
     * Constructor.
     */
+		//<qmail> para to refe
     CIpsPlgCreateForwardMessageOperation(
-        CIpsPlgSmtpService* aSmtpService,
+        CIpsPlgSmtpService& aSmtpService,
         CMsvSession& aMsvSession,
         TRequestStatus& aObserverRequestStatus,
         TMsvPartList aPartList,
@@ -62,7 +75,7 @@
         TMsvId aOriginalMessageId, 
         MFSMailRequestObserver& aOperationObserver,
         TInt aRequestId );
-
+	//</qmail>
     /**
     * From CActive
     */
--- a/ipsservices/ipssosplugin/inc/ipsplgcreatemessageoperation.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgcreatemessageoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -31,20 +31,31 @@
 NONSHARABLE_CLASS ( CIpsPlgCreateMessageOperation ) : public CIpsPlgBaseOperation
     {
 public:
-    
+    //<qmail> comments added
+	//<qmail> para to refe
+	//<qmail> aSmtpServiceId removed
     /**
-    * Constructor.
+    * Two-phased constructor
+    * 
+    * @param aSmtpService               contains SMTP message services
+    * @param aMsvSession                client/server session to MsvServer
+    * @param aObserverRequestStatus     operations observer status
+    * @param aPartList                  specifies one or more parts of a message
+    * @param aMailBoxId                 id's for mailbox and plugin
+    * @param aOperationObserver         observes the progress of this operation
+    * @param aRequestId                 identifier for this instance of operation, 
+    *                                   assigned by the client
+    * @return CIpsPlgCreateMessageOperation* self pointer                                  
     */
     static CIpsPlgCreateMessageOperation* NewL(
-        CIpsPlgSmtpService* aSmtpService,
+        CIpsPlgSmtpService& aSmtpService,
         CMsvSession& aMsvSession,
         TRequestStatus& aObserverRequestStatus,
-        TMsvId aSmtpServiceId, 
         TMsvPartList aPartList,
         TFSMailMsgId aMailBoxId,
         MFSMailRequestObserver& aOperationObserver,
         TInt aRequestId );
-        
+//</qmail>        
     /**
     * Destructor.
     */
@@ -76,16 +87,17 @@
     /**
     * Constructor.
     */
+		//<qmail> para to refe
+	//<qmail> aSmtpServiceId removed
     CIpsPlgCreateMessageOperation(
-        CIpsPlgSmtpService* aSmtpService,
+        CIpsPlgSmtpService& aSmtpService,
         CMsvSession& aMsvSession,
         TRequestStatus& aObserverRequestStatus,
-        TMsvId aSmtpServiceId, 
         TMsvPartList aPartList,
         TFSMailMsgId aMailBoxId,
         MFSMailRequestObserver& aOperationObserver,
         TInt aRequestId );
-    
+    //</qmail>
     /**
     * Constructor.
     */
@@ -115,10 +127,12 @@
     virtual void StartMessageCreationL();
 
 protected:
-    CIpsPlgSmtpService* iSmtpService;   // not owned
-    CMsvOperation* iOperation;   // owned
-    TMsvId iSmtpServiceId; 
+	//<qmail> para to refe
+    CIpsPlgSmtpService& iSmtpService;   // not owned
+    CMsvOperation* iOperation;   // owned 
+	//<qmail> iSmtpServiceId removed
     TMsvPartList iPartList;
+// <qmail> iBlank member removed
     MFSMailRequestObserver& iOperationObserver;  // not owned
     TFSProgress iFSProgress;
     };
--- a/ipsservices/ipssosplugin/inc/ipsplgcreatereplymessageoperation.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgcreatereplymessageoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -29,12 +29,23 @@
 NONSHARABLE_CLASS ( CIpsPlgCreateReplyMessageOperation ) : public CIpsPlgCreateMessageOperation
     {
 public:
-    
+    //<qmail> comments + aSmtpService -> reference
     /**
-    * Constructor.
+    * Two-phased constructor
+    * 
+    * @param aSmtpService               contains SMTP message services
+    * @param aMsvSession                client/server session to MsvServer
+    * @param aObserverRequestStatus     operations observer status
+    * @param aPartList                  specifies one or more parts of a message
+    * @param aMailBoxId                 id's for mailbox and plugin
+    * @param aOriginalMessageId         id of message to be forward
+    * @param aOperationObserver         observes the progress of this operation
+    * @param aRequestId                 identifier for this instance of operation, 
+    *                                   assigned by the client
+    * @return CIpsPlgCreateForwardMessageOperation* self pointer                                  
     */
     static CIpsPlgCreateReplyMessageOperation* NewL(
-        CIpsPlgSmtpService* aSmtpService,
+        CIpsPlgSmtpService& aSmtpService,
         CMsvSession& aMsvSession,
         TRequestStatus& aObserverRequestStatus,
         TMsvPartList aPartList,
@@ -42,7 +53,7 @@
         TMsvId aOriginalMessageId,
         MFSMailRequestObserver& aOperationObserver,
         TInt aRequestId );
-        
+//</qmail>        
     /**
     * Destructor.
     */
@@ -53,8 +64,9 @@
     /**
     * Constructor.
     */
+//<qmail>	
     CIpsPlgCreateReplyMessageOperation(
-        CIpsPlgSmtpService* aSmtpService,
+        CIpsPlgSmtpService& aSmtpService,
         CMsvSession& aMsvSession,
         TRequestStatus& aObserverRequestStatus,
         TMsvPartList aPartList,
@@ -62,14 +74,24 @@
         TMsvId aOriginalMessageId, 
         MFSMailRequestObserver& aOperationObserver,
         TInt aRequestId );
-
+//</qmail>
     /**
     * From CActive
     */
     void RunL();
     
     void StartMessageCreationL();
-
+    //<qmail>
+    /**
+    * Copy recipients from original message to new one 
+    * 
+    * @param aHeader            IM header of original message
+    * @param aNewMessage        Reply message where recipients added
+    */ 
+    void RecipientsCallToOrderL(
+            CImHeader* aHeader,
+            CFSMailMessage* aNewMessage );
+//</qmail>
 private:
     TMsvId iOriginalMessageId;
     };
--- a/ipsservices/ipssosplugin/inc/ipsplgdeletelocal.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgdeletelocal.h	Fri May 14 15:41:10 2010 +0300
@@ -23,16 +23,14 @@
 #include <cacheman.h>
 
 
-// CONSTANTS
-// MACROS
-// DATA TYPES
-// FUNCTION PROTOTYPES
-// FORWARD DECLARATIONS
-// CLASS DECLARATION
-
+//<qmail> removed
+//<qmail> comment added
 /**
-*
+* class CIpsPlgDeleteLocal
+* Implements virtual Filter() of CImCacheManager and decides if
+* message should be deleted. 
 */
+//</qmail>
 NONSHARABLE_CLASS( CIpsPlgDeleteLocal ) : public CImCacheManager
     {
     public:
@@ -45,7 +43,7 @@
         * @return pointer to created CIpsPlgDeleteLocal object.
         */
         static CIpsPlgDeleteLocal* NewL(
-            CMsvEntrySelection& aMessageSelection,
+            CMsvEntrySelection* aMessageSelection,
             CMsvSession& aMsvSession,
             TRequestStatus& aObserverRequestStatus );
 
@@ -61,7 +59,7 @@
         * Symbian OS constructor.
         * @param aMessageSelection array of message ids to be purged
         */
-        void ConstructL( CMsvEntrySelection& aMessageSelection );
+        void ConstructL( CMsvEntrySelection* aMessageSelection );
 
     private:
     
@@ -80,9 +78,9 @@
             TRequestStatus& aObserverRequestStatus );
 
     private: // data
-
-        CMsvEntrySelection*                 iMessageSelection;
-        
+//<qmail>
+        CMsvEntrySelection*                 iMessageSelection; // owned
+//</qmail>        
     };
 
 #endif      // IPSPLGDELETELOCAL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ipsservices/ipssosplugin/inc/ipsplgdeleteoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,143 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Deletes messages first locally and then from server
+*
+*/
+//<qmail> class renamed
+#ifndef IPSPLGDELETEOPERATION_H
+#define IPSPLGDELETEOPERATION_H
+//</qmail>
+//  INCLUDES
+#include <e32def.h>
+#include <e32des8.h>    // TDesC8
+
+class CMsvOperation;
+class CMsvEntry;
+class CMsvEntrySelection;
+class CMsvSession;
+class TRequestStatus;
+
+/**
+* class CIpsPlgDeleteOperation
+* Encapsulates delete locally operation and delete from server operation.
+* First deletes message locally and after it has been completed, deletes from the server
+*/
+//<qmail>
+NONSHARABLE_CLASS ( CIpsPlgDeleteOperation ) : public CMsvOperation
+//</qmail>        
+    {
+    public:
+        // <qmail>
+        /**
+        * Two-phased constructor
+        * 
+        * @param aMsvSession                client/server session to MsvServer
+        * @param aObserverRequestStatus     operations observer status
+        * @param aEntriesToDelete           Message entries to be deleted from server and locally  
+        *
+        * @return CIpsPlgCreateForwardMessageOperation* self pointer                                  
+        */
+        static CIpsPlgDeleteOperation* NewL(
+            CMsvSession& aMsvSession,
+            TRequestStatus& aObserverRequestStatus,
+            CMsvEntrySelection* aEntriesToDelete );
+        // </qmail>    
+//<qmail> class renamed + comments removed
+        virtual ~CIpsPlgDeleteOperation();
+        
+        virtual const TDesC8& ProgressL();
+//</qmail> 
+
+    private:
+        // <qmail>   
+        enum TIpsPlgDeleteMessagesState 
+            {
+            ESetFlags = 0,    
+            ELocally,
+            EFromServer
+            };
+        // </qmail>
+
+        /**
+        * Constructor.
+        */
+		//<qmail> class renamed
+        CIpsPlgDeleteOperation(
+            CMsvSession& aMsvSession,
+            TRequestStatus& aObserverRequestStatus );
+		//</qmail>	
+        // <qmail> 
+        /**
+        * 2nd phase constructor
+        */
+        void ConstructL( CMsvEntrySelection* aEntriesToDelete );
+        // </qmail>
+        
+        /**
+        * From CActive
+        */
+        void DoCancel();
+        
+        /**
+        * From CActive
+        */
+        void RunL();
+
+        /**
+        * Starts new local delete progress
+        */
+        void StartNextDeleteLocally();
+        //<qmail>
+        /**
+        * Creates object of CIpsPlgDeleteLocal
+        */
+        void MakeNextDeleteLocallyL();
+        //</qmail>
+
+        /**
+        * Starts entry delete after local delete is completed.
+        */
+        void StartDeleteFromServer();
+
+        /**
+        * Creates delete operation
+        */
+        void MakeDeleteFromServerL();
+
+		// <qmail>    
+        /**
+        * Sets the locally deleted flag for the next item (iSetFlagIndex)
+        * return true if operation started successfully, otherwise false
+        */
+        TBool SetNextLocallyDeletedFlagL();
+		// </qmail>    
+
+    private:
+        // <qmail>
+        CMsvOperation*              iOperation; // owned
+        CMsvEntry*                  iEntry; // owned
+        CMsvEntrySelection*         iEntrySelection; // owned
+        // <qmail> removed member iEntryCount
+        TInt                        iSetFlagIndex;
+        CMsvEntry*                  iSetFlagEntry; // owned
+        // <qmail> removed member iBlank
+		//<qmail> enum renamed
+        TIpsPlgDeleteMessagesState  iState;
+        // </qmail>
+        
+    };
+
+#endif      // IPSPLGDELETEREMOTE_H
+
+// End of File
--- a/ipsservices/ipssosplugin/inc/ipsplgdeleteremote.h	Mon May 03 12:23:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +0,0 @@
-/*
-* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Deletes messages first locally and then from server
-*
-*/
-
-#ifndef IPSPLGDELETEREMOTE_H
-#define IPSPLGDELETEREMOTE_H
-
-//  INCLUDES
-#include <e32def.h>
-#include <e32des8.h>    // TDesC8
-
-class CMsvOperation;
-class CMsvEntry;
-class CMsvEntrySelection;
-class CMsvSession;
-class TRequestStatus;
-
-/**
-* class CIpsPlgDeleteRemote
-* Encapsulates delete locally operation and delete from server operation.
-* First deletes message locally and after it has been completed, deletes from the server
-*/
-NONSHARABLE_CLASS ( CIpsPlgDeleteRemote ) :
-    public CMsvOperation
-    {
-    public:
-        /**
-        * Constructor.
-        */
-        static CIpsPlgDeleteRemote* NewL(
-            CMsvSession& aMsvSession,
-            TRequestStatus& aObserverRequestStatus,
-            CMsvEntrySelection& aDeletedEntries );
-            
-        /**
-        * Destructor.
-        */
-        virtual ~CIpsPlgDeleteRemote();
-        
-        /**
-        *
-        */
-        virtual const TDesC8& ProgressL();
-
-
-    private:
-    
-        enum IpsPlgDeleteMessagesState 
-            {
-			// <qmail>    
-            EDeletingMessagesStateSetFlags = 0,
-			// </qmail>    
-            EDeletingMessagesStateLocally,
-            EDeletingMessagesStateFromServer
-            };
-
-        /**
-        * Constructor.
-        */
-        CIpsPlgDeleteRemote(
-            CMsvSession& aMsvSession,
-            TRequestStatus& aObserverRequestStatus );
-
-        /**
-        * Constructor.
-        */
-        void ConstructL( CMsvEntrySelection& aDeletedEntries );
-        
-        /**
-        * From CActive
-        */
-        void DoCancel();
-        
-        /**
-        * From CActive
-        */
-        void RunL();
-
-        /**
-        * Starts new local delete progress
-        */
-        void StartNextDeleteLocally();
-
-        /**
-        * Creates object of CImumDeleteMessagesLocally
-        */
-        void MakeNextDeleteLocallyL();
-
-        /**
-        * Starts entry delete after local delete is completed.
-        */
-        void StartDeleteFromServer();
-
-        /**
-        * Creates delete operation
-        */
-        void MakeDeleteFromServerL();
-
-		// <qmail>    
-        /**
-        * Sets the locally deleted flag for the next item (iSetFlagIndex)
-        * return true if operation started successfully, otherwise false
-        */
-        TBool SetNextLocallyDeletedFlagL();
-		// </qmail>    
-
-    private:
-        CMsvOperation*              iOperation;
-        CMsvEntry*                  iEntry;
-        CMsvEntrySelection*         iEntrySelection; 
-        TInt                        iEntryCount;
-        // <qmail>
-        TInt                        iSetFlagIndex;
-        CMsvEntry*                  iSetFlagEntry;
-        // </qmail>
-        TBuf8<1>                    iBlank;
-        IpsPlgDeleteMessagesState   iState;
-        
-    };
-
-#endif      // IPSPLGDELETEREMOTE_H
-
-// End of File
--- a/ipsservices/ipssosplugin/inc/ipsplgdisconnectop.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgdisconnectop.h	Fri May 14 15:41:10 2010 +0300
@@ -37,10 +37,10 @@
     * @param aFSMailBoxId specifies mailbox
     * @param aFSOperationObserver observer of the operation
     * @param aFSRequestId identifier for this request instance
-    * @param aDoRemoveAfterDisconnect
     * @return instance of this operation class
     */
-    // <qmail> parameter removed
+    // <qmail> aDoRemoveAfterDisconnect parameter removed
+	// <qmail> MFSMailRequestObserver& changed to pointer
     static CIpsPlgDisconnectOp* NewL(
         CMsvSession& aMsvSession,
         TRequestStatus& aObserverRequestStatus,
@@ -71,12 +71,15 @@
    
    // <qmail> new function in this op
    TIpsOpType IpsOpType() const;
+   // </qmail>
    
 protected: // From CActive
     void DoRunL();
     
 private:
 
+	// <qmail> aDoRemoveAfterDisconnect parameter removed
+	// <qmail> MFSMailRequestObserver& changed to pointer
     CIpsPlgDisconnectOp(
         CMsvSession& aMsvSession,
         TRequestStatus& aObserverRequestStatus,
--- a/ipsservices/ipssosplugin/inc/ipsplgeventhandler.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgeventhandler.h	Fri May 14 15:41:10 2010 +0300
@@ -29,6 +29,7 @@
 class CRepository;
 class CIpsPlgSettingsObserver;
 class CIpsPlgSyncStateObserver;
+// <qmail> CIpsSetDataApi removed
 /**
 * MIpsPlgPropertyObserver
 *
@@ -196,12 +197,13 @@
      */
     void NotifyPropertyEventL( TIpsPlgPropertyEvent aEvent );
 
-    // <qmail> removing unused functions
+// <qmail> removing unused functions
     //    void SignalMailboxOfflineStateL( const TFSMailMsgId& aAccount );
     //    void QueryUsrPassL( TMsvId aMbox, MIpsPlgConnectOpCallback* aCallback=NULL );
     //    void SignalCredientialsSetL( TInt aMailboxId, TBool aCancelled );
-    // </qmail>
+// </qmail>
 private:
+// <qmail> removed enum TQueryUsrPassState
 
     /**
     * Checks the source type of event and also
@@ -392,14 +394,14 @@
             const CMsvEntrySelection* aSelection,
             TUint aMtmUid );
 
-    // <qmail> new function
+// <qmail> new function
     /**
      * Convert sync operation completion code to email framework's syncState
      * @param aStatus
      * @return syncstate
      */
     TSSMailSyncState ConvertCompletionCode( TInt aCompletionCode );
-    // </qmail>
+// </qmail>
     
     CRepository*                            iCenRep;
 
@@ -430,10 +432,10 @@
     // base plugin id
     TUint                                   iPluginId;
 
-    // <qmail> MIpsPlgConnectOpCallback not used any more
-
     RArray<TMsvId>                          iImapFolderIds;
 
+// <qmail> MIpsPlgConnectOpCallback not used any more
+// <qmail> iQueryPassState, iConnOpCallbacks, iIncomingPass removed
     };
 
 
--- a/ipsservices/ipssosplugin/inc/ipsplgheaders.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgheaders.h	Fri May 14 15:41:10 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -19,14 +19,17 @@
 #define IPSPLGHEADERS_H
 
 // System includes
+// <qmail>
 #include <nmcommonheaders.h>
+// </qmail>
 #include <e32cmn.h>
 #include <e32def.h>
 #include <e32base.h>
-#include <e32property.h> 
+#include <e32property.h>
 
 #include <f32file.h>
 
+// <qmail> eikenv, eikrutil, coemain includes removed
 
 #include <charconv.h>
 
@@ -35,6 +38,7 @@
 // ecom
 #include <implementationproxy.h>
 // mtm
+// <qmail> MTMStore include removed
 #include <mtmuibas.h>
 // mtcl
 #include <mtclbase.h>
@@ -42,7 +46,7 @@
 // msv
 #include <msvstd.hrh>
 #include <msvapi.h>     // Messaging framework
-#include <msvuids.h> 
+#include <msvuids.h>
 #include <msvstd.h>
 // miut
 #include <miutset.h>    // MTM identifiers
@@ -50,9 +54,9 @@
 #include <miut_err.h>   // KErrImapServerBusy
 #include <miutmsg.h>
 #include <miutconv.h>
-
+// <qmail>
 #include <timrfc822datefield.h> // KUidMsvEmailTextEntry, KUidMsvEmailHtmlEntry 
-
+// </qmail>
 // imap
 #include <imapset.h>
 #include <imapcmds.h>
@@ -73,6 +77,7 @@
 #include <SendUiConsts.h>
 #include <SenduiMtmUids.h>
 
+// <qmail> fsmailserverconst include removed
 // mfsmail
 #include "MFSMailBoxSearchObserver.h"
 #include "MFSMailEventObserver.h"
@@ -88,6 +93,8 @@
 
 #include <cemailaccounts.h>
 
+#include <in_sock.h>
+
 // Internal headers
 
 // base
@@ -106,7 +113,7 @@
 #include "ipsplgmsgmapper.h"
 #include "ipsplgmsgkey.h"
 #include "ipsplgmsgiterator.h"      // CIpsPlgMsgIterator
-#include "ipsplgmsgswap.h"        // TIpsPlgMsgSwap 
+#include "ipsplgmsgswap.h"        // TIpsPlgMsgSwap
 
 
 // imap4
@@ -136,6 +143,7 @@
 #include "ipsplgsearchop.h"
 #include "ipsplgtextsearcher.h"
 
+// <qmail> setting-related includes removed
 // mrulist
 #include "ipsplgmrulist.h"
 
@@ -170,21 +178,10 @@
 // </qmail>
 #include "ipsplgdisconnectop.h"
 #include "ipsplgservicedeletionop.h"
-#include "ipsplgdeleteremote.h"
+// <qmail> name changed
+#include "ipsplgdeleteoperation.h"
+// </qmail>
 #include "ipsplgdeletelocal.h"
 #include "ipsplgsingleopwatcher.h"
 
-
-
-
-
-
-
-
-
-// #include "ipsplgheaders.h"
-
 #endif //IPSPLGHEADERS_H
-
-
-
--- a/ipsservices/ipssosplugin/inc/ipsplgimap4connectop.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgimap4connectop.h	Fri May 14 15:41:10 2010 +0300
@@ -15,8 +15,8 @@
 *
 */
 
-#ifndef IPSPLGIMAP4CONNECT_H
-#define IPSPLGIMAP4CONNECT_H
+#ifndef IPSPLGIMAP4CONNECTOP_H
+#define IPSPLGIMAP4CONNECTOP_H
 
 #include "ipsplgonlineoperation.h"
 #include "imapconnectionobserver.h"
@@ -53,6 +53,8 @@
     * @return CIpsPlgImap4ConnectionOp* self pointer
     */
     // <qmail> priority parameter has been removed
+	// <qmail> MFSMailRequestObserver& changed it to pointer
+	// <qmail> aSignallingAllowed parameter has been removed
     static CIpsPlgImap4ConnectOp* NewL(
         CMsvSession& aMsvSession,
         TRequestStatus& aObserverRequestStatus,
@@ -106,14 +108,16 @@
     enum TImapConnectionState 
         { 
         EStateStartConnect,
-        // <qmail> removing EStateQueryingDetails, 
+        // <qmail> removing EStateQueryingDetails, EStateQueryingDetailsBusy
         EStateConnectAndSync,
         EStatePopulateAllCompleted,
         EStateCompleted,
         EStateIdle 
         };
     
-    // <qmail> priority parameter has been removed
+	// <qmail> priority parameter has been removed
+	// <qmail> MFSMailRequestObserver& changed it to pointer
+	// <qmail> aSignallingAllowed parameter has been removed
     CIpsPlgImap4ConnectOp(
         CMsvSession& aMsvSession,
         TRequestStatus& aObserverRequestStatus,
@@ -189,6 +193,8 @@
     CIpsPlgEventHandler*                iEventHandler; // not owned
     // prevents signalling sync started for more than once
     TBool                               iIsSyncStartedSignaled;
+	
+	// <qmail> iAlreadyConnected removed
     };
 
 #endif // IPSPLGIMAP4CONNECT_H
--- a/ipsservices/ipssosplugin/inc/ipsplgimap4fetchattachmentop.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgimap4fetchattachmentop.h	Fri May 14 15:41:10 2010 +0300
@@ -33,10 +33,13 @@
     */
     static CIpsFetchProgReport* NewL( CIpsPlgImap4FetchAttachmentOp& aAttaOp );
 
+	// <qmail> destructor made virtual
     virtual ~CIpsFetchProgReport();
 
 protected: // From CActive
+
     virtual void DoCancel();
+	
     virtual void RunL();
 
 private:
@@ -71,6 +74,8 @@
     * @param aFSRequestId identifier for this instance of operation, assigned by the client
     * @return CIpsPlgImap4FetchAttachmentOp* self pointer
     */
+	// <qmail> CMsvEntrySelection& changed to pointer, aFunctionId removed
+	// <qmail> MFSMailRequestObserver& changed to pointer
     static CIpsPlgImap4FetchAttachmentOp* NewL(
         CMsvSession& aMsvSession,
         TRequestStatus& aObserverRequestStatus,
@@ -81,6 +86,10 @@
         MFSMailRequestObserver* aFSOperationObserver,
         TInt aFSRequestId );
 
+    /**
+    * ~CIpsPlgImap4FetchAttachmentOp()
+    * destructor
+    */
     virtual ~CIpsPlgImap4FetchAttachmentOp();
 
     /**
@@ -99,6 +108,8 @@
     TFSProgress GetFSProgressL() const;
     
 private:
+	// <qmail> CMsvEntrySelection& changed to pointer, aFunctionId removed
+	// <qmail> MFSMailRequestObserver& changed to pointer
     CIpsPlgImap4FetchAttachmentOp(
         CMsvSession& aMsvSession,
         TRequestStatus& aObserverRequestStatus,
@@ -135,23 +146,34 @@
     
 protected:
     
+	// <qmail> GetEngineProgress removed
     void DoFetchAttachmentL( );
         
+// <qmail>
 private: //Data
     friend class CIpsFetchProgReport;
+// <qmail>
 
     // internal state of this statemachine
     enum TFetchState {
         EStateIdle,
         EStateConnecting,
         EStateFetching,
+		EStateWaiting,
         EStateDisconnecting };
     TFetchState iState;
         
     const CMsvEntrySelection*               iSelection;
     TDesC8*                                 iFetchErrorProgress;
+	// <qmail> iGetMailInfo, iFunctionId removed
     TPckgBuf<TImap4CompoundProgress>        iProgress;
+	// <qmail> iService, iPopulated removed
     CIpsFetchProgReport*                    iProgReport;
+    // Temporary fix for handling KErrServerBusy errors from the
+    // messaging service.  Remove these once the appropriate observer
+    // mechanism has been implemented in the messaging service.
+    TInt                                    iRetryCount;
+    RTimer                                  iRetryTimer;
     };
 
 #endif // IPSPLGIMAP4FETCHATTACHMENTOP_H
--- a/ipsservices/ipssosplugin/inc/ipsplgimap4moveremoteop.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgimap4moveremoteop.h	Fri May 14 15:41:10 2010 +0300
@@ -19,6 +19,7 @@
 #define IPSPLGIMAP4MOVEREMOTEOP_H
 
 #include "ipsplgonlineoperation.h"
+// <qmail> mfsmailrequestobserver include removed
 
 /**
 * Move a selection of messages that may or may not be complete.
@@ -41,7 +42,8 @@
     * @param aFSRequestId client assigned request identifier
     * @return class instance
     */
-    // <qmail> parameters changed
+    // <qmail> parameters changed: aFunctionId removed, TImImap4GetMailInfo& -> TMsvId&
+	// <qmail> MFSMailRequestObserver* changed to pointer
     static CIpsPlgImap4MoveRemoteOp* NewL(
         CMsvSession& aMsvSession,
         TRequestStatus& aObserverRequestStatus,
@@ -78,6 +80,9 @@
     
 private:
     // <qmail> parameters changed
+    /**
+    * for explanation of parameters, see NewL
+    */
     CIpsPlgImap4MoveRemoteOp(
         CMsvSession& aMsvSession,
         TRequestStatus& aObserverRequestStatus,
@@ -109,11 +114,6 @@
      * Completes client's status
      */
     void Complete();
-    
-    /**
-     * handles local moving
-     */
-    void DoMoveLocalL();
 
     /**
      * handles remote moving
@@ -133,17 +133,48 @@
         };
     TState                              iState;
 
-    // <qmail> iFunctionId; removed
+    // <qmail> iFunctionId removed, TImImap4GetMailInfo -> TMsvId
     // used in error situations
     TDesC8*                             iMoveErrorProgress;
     // <qmail> using destination folder Id instead of mailInfo struct
     // specifies folder where to move
     TMsvId                              iDestinationFolderId;
     // <qmail> removed iSelection;
-    CMsvEntrySelection*                 iLocalSel;      // Complete messages
     CMsvEntrySelection*                 iRemoteSel;     // Incomplete messages to be fetched.
     TPckgBuf<TImap4CompoundProgress>    iProgressBuf;
     TPckgBuf<TImap4SyncProgress>        iSyncProgress;
     };
 
+
+NONSHARABLE_CLASS( CIpsPlgImap4MoveRemoteOpObserver ) : public CBase,
+    public MFSMailRequestObserver
+    {
+public:
+
+    static CIpsPlgImap4MoveRemoteOpObserver* NewL( CMsvSession& aSession,
+        CIpsPlgEventHandler& aEventHandler, const TFSMailMsgId& aSourceFolder,
+        const RArray<TFSMailMsgId>& aMessageIds );
+    ~CIpsPlgImap4MoveRemoteOpObserver();
+
+    // From base class MFSMailRequestObserver
+    void RequestResponseL( TFSProgress aEvent, TInt aRequestId );
+
+private:
+
+    CIpsPlgImap4MoveRemoteOpObserver( CMsvSession& aSession,
+        CIpsPlgEventHandler& aEventHandler,
+        TMsvId aSourceFolderId );
+    void ConstructL( const RArray<TFSMailMsgId>& aMessageIds );
+
+private:
+
+    // data
+    CMsvSession& iSession;
+    CIpsPlgEventHandler& iEventHandler;
+    TMsvId iSourceFolderId;
+    CMsvEntrySelection* iSelection;
+    };
+
 #endif // IPSPLGIMAP4MOVEREMOTEOP_H
+
+// End of File
--- a/ipsservices/ipssosplugin/inc/ipsplgimap4plugin.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgimap4plugin.h	Fri May 14 15:41:10 2010 +0300
@@ -83,6 +83,14 @@
         const TFSMailMsgId& aSourceFolderId, 
         const TFSMailMsgId& aDestinationFolderId );
     
+    TInt MoveMessagesL( 
+        const TFSMailMsgId& aMailBoxId,
+        const RArray<TFSMailMsgId>& aMessageIds, 
+        const TFSMailMsgId& aSourceFolderId,
+        const TFSMailMsgId& aDestinationFolderId,
+        MFSMailRequestObserver& aOperationObserver,
+        TInt aRequestId );
+    
     void PopulateNewMailL( 
         const TFSMailMsgId& aMailboxId, 
         TMsvId aNewId, 
--- a/ipsservices/ipssosplugin/inc/ipsplgimap4populateop.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgimap4populateop.h	Fri May 14 15:41:10 2010 +0300
@@ -48,6 +48,7 @@
     * @return CIpsPlgImap4PopulateOperation* self pointer
     */
     // <qmail> priority parameter has been removed
+	// <qmail> MFSMailRequestObserver& changed to pointer
     IMPORT_C static CIpsPlgImap4PopulateOp* NewL(
         CMsvSession& aMsvSession,
         TRequestStatus& aObserverRequestStatus,
--- a/ipsservices/ipssosplugin/inc/ipsplgmsgkey.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgmsgkey.h	Fri May 14 15:41:10 2010 +0300
@@ -83,7 +83,7 @@
     /**
      * Compares the subject strings omitting the reply & forward prefixes
      */
-    TInt CompareSubjects( const TDesC& aLeft, const TDesC& aRight ) const;
+    TInt CompareSubjectsL( const TDesC& aLeft, const TDesC& aRight ) const; // <cmail> change to leaving function
 
 private:
     // Folder objects the messages of which are sorted. Not owned.    
--- a/ipsservices/ipssosplugin/inc/ipsplgmsgmapper.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgmsgmapper.h	Fri May 14 15:41:10 2010 +0300
@@ -235,7 +235,7 @@
      * Sets the fetch state of the FS message objects based on the state
      * of TMsvEmailEntry instance
      */
-    void SetFetchState( 
+    void SetFetchStateL( 
         const TMsvEmailEntry& aEntry, 
         TMsvId aMsgMainId,
         TBool aIsAtta, 
@@ -244,7 +244,7 @@
     /**
      * Sets the fetch state of imap message entry
      */
-    void SetFetchStateImap( 
+    void DoSetFetchStateL( 
             const TMsvEmailEntry& aEntry, 
             TMsvId aMsgMainId,
             TBool aIsAtta, 
--- a/ipsservices/ipssosplugin/inc/ipsplgnewchildpartfromfileoperation.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgnewchildpartfromfileoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -101,6 +101,7 @@
      */
     enum TOperationStep
         {
+        EInitAttachmentManager,
         EPrepareMsvEntry,
         EPrepareStore,
         EStoreMessagePart
@@ -128,8 +129,10 @@
     
 protected:
     CMsvOperation* iOperation;   // owned
+	// <qmail> iBlank, iMailBoxId removed
     TFSMailMsgId iMessageId;
     MFSMailRequestObserver& iOperationObserver;  // not owned
+	// <qmail> iRequestId removed
     HBufC* iContentType;
     HBufC* iFilePath;
     CMsvEntry* iCachedEntry;
--- a/ipsservices/ipssosplugin/inc/ipsplgonlineoperation.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgonlineoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -59,6 +59,8 @@
      * @param aFSRequestId id of the request
      */
     // <qmail> priority parameter has been removed
+	// <qmail> MFSMailRequestObserver& changed to pointer
+	// <qmail> aSignallingAllowed parameter has been removed
     CIpsPlgOnlineOperation(
         CMsvSession& aMsvSession,
         TRequestStatus& aObserverRequestStatus,
@@ -81,6 +83,7 @@
      * It is called by OnlineOperation's RunL()
      */
     virtual void DoRunL() = 0;
+
     // <qmail> removing virtual TInt RunError( TInt aError ); Not needed because RunL uses TRAP harness and never leaves
 
     /**
@@ -102,6 +105,7 @@
     * (e.g. which message entry to send)
     * @param aParams specifies other parameters needed by particular command
     */
+	// <qmail> aContextId parameter has been removed
     void InvokeClientMtmAsyncFunctionL(
         TInt aFunctionId,
         TMsvId aEntryId,
@@ -114,6 +118,7 @@
     * (e.g. which messages to send)
     * @param aParams specifies other parameters needed by particular command
     */
+	// <qmail> aContextId parameter has been removed
     void InvokeClientMtmAsyncFunctionL(
         TInt aFunctionId,
         const CMsvEntrySelection& aSel,
@@ -135,7 +140,7 @@
         
 protected:
         // mailbox specific activity timer
-        CIpsPlgTimerOperation&  iActivityTimer;
+        CIpsPlgTimerOperation*  iActivityTimer;
         CBaseMtm*               iBaseMtm;
         CClientMtmRegistry*     iMtmReg;
         // sub-operation that this operation is using currently
--- a/ipsservices/ipssosplugin/inc/ipsplgpanic.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgpanic.h	Fri May 14 15:41:10 2010 +0300
@@ -22,7 +22,10 @@
 #include <e32def.h>
 
 _LIT(KIpsPlgPanicCategory, "IpsPlgSos");
-_LIT( KIpsPlgIpsConnPanic, "IpsConn" ); 
+// <qmail>
+_LIT( KIpsPlgIpsConnPanic, "IpsConn" );
+_LIT( KIpsPlgPopConnectPanic, "PopConnectOp" );
+// </qmail>
 
 enum TIpsPlgPanic {
     EIpsPlgInvalidMessageIndex,
--- a/ipsservices/ipssosplugin/inc/ipsplgpop3connectop.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgpop3connectop.h	Fri May 14 15:41:10 2010 +0300
@@ -33,9 +33,21 @@
     // <qmail> MIpsPlgConnectOpCallback not used any more
 public:
 
-        /**
-        *
-        */
+	    /**
+	    * NewL
+	    * @param aMsvSession client/server session to MsvServer
+	    * @param aObserverRequestStatus client status
+	    * @param aService serviceId of the mailbox
+	    * @param aForcePopulate whether to populate fetched messages
+	    * @param aActivityTimer mailbox specific activity timer
+	    * @param aFSMailBoxId specifies mailbox
+	    * @param aFSOperationObserver observer callback pointer
+	    * @param aFSRequestId client assigned identifier for the request instance
+	    * @param aEventHandler event handler for sending sync events
+	    * @return new instance of the class
+	    */
+		// <qmail> MFSMailRequestObserver& changed to pointer
+		// <qmail> aSignallingAllowed parameter removed
         static CIpsPlgPop3ConnectOp* NewL(
             CMsvSession& aMsvSession,
             TRequestStatus& aObserverRequestStatus,
@@ -45,7 +57,7 @@
             TFSMailMsgId aFSMailBoxId,
             MFSMailRequestObserver* aFSOperationObserver,
             TInt aFSRequestId,
-            CIpsPlgEventHandler* aEventHandler=NULL );
+            CIpsPlgEventHandler* aEventHandler );
 
         /**
         *
@@ -53,7 +65,8 @@
         virtual ~CIpsPlgPop3ConnectOp();
 
         /**
-        *
+	    * From CIpsPlgBaseOperation
+	    * For reporting if DoRunL leaves
         */
         const TDesC8& GetErrorProgressL(TInt aError);
         
@@ -62,22 +75,25 @@
         */
         TFSProgress GetFSProgressL() const;
 
+	    /**
+	    * From MsvOperation
+	    * Gets information on the progress of the operation
+	    * (see MsvOperation header)
+	    */
+	    // <qmail> moved to 'public:'as defined so in base class
+	    const TDesC8& ProgressL();
 // <qmail> Connected() used from baseclass
         
-        // <qmail> change ret val type
+// <qmail> change ret val type
         /**
          * Returns operation type
          */
         TIpsOpType IpsOpType() const;
+// </qmail>
 
     protected:
 
         /**
-        * 
-        */
-        const TDesC8& ProgressL();
-        
-        /**
          * 
          */
         void DoCancel();
@@ -87,16 +103,13 @@
         */
         void DoRunL();
         
-        /**
-        * 
-        */
-        TInt GetOperationErrorCodeL( );
-        
     private:
 
         /**
         *
         */
+		// <qmail> MFSMailRequestObserver& changed to pointer
+		// <qmail> aSignallingAllowed parameter removed
         CIpsPlgPop3ConnectOp(
             CMsvSession& aMsvSession,
             TRequestStatus& aObserverRequestStatus,
@@ -119,34 +132,40 @@
          */
         void DoConnectL();
         void DoPopulateL();
-// <qmail> TBool ValidateL() removed (did nothing)
-// <qmail> void DoQueryPasswordL() not used any more
+	    // <qmail> removed TBool ValidateL() (did nothing)
+	    // <qmail> removed void DoQueryPasswordL() not used any more
         void DoDisconnect();
-        // </qmail>
+		// </qmail>
         
         // <qmail> removed flag methods as they were not used or even defined anywhere
         
+	    // <qmail> new function
+	    /**
+	     * Reads populate limit from account's settings and converts it to member variable
+	     */
+	    TInt GetPopulateLimitFromSettingsL();
     private: // Data
     
-        enum TPopConnectStates 
+    	enum TOperationState 
             {
             EStartConnect,
             EConnected,
             EPopulate,
-            // <qmail> new EDisconnecting state, removed querydetails state
+            // <qmail> removed EQueryingDetails/EQueryingDetailsBusy state
+        	// <qmail> new EDisconnecting state
             EDisconnecting,
-            // </qmail>
-            EErrInvalidDetails,
+        	// <qmail> removed EErrInvalidDetails,
             EIdle
             };
 
-        TInt                                            iState;
-        CMsvEntry*                                      iEntry;        
-        TPckgBuf<TPop3Progress>                         iProgress;
-        TInt                                            iPopulateLimit;
-        TBool                                           iForcePopulate;
-        CMsvEntrySelection*                             iSelection;
-        CIpsPlgEventHandler*                            iEventHandler; // not owned
+	    TOperationState                                 iState;
+	    // <qmail> removed iEntry;
+	    TPckgBuf<TPop3Progress>                         iProgress;
+	    // <qmail> removed iPopulateLimit;
+	    TBool                                           iForcePopulate;
+	    // <qmail> removed iSelection;
+	    CIpsPlgEventHandler*                            iEventHandler; // not owned
+        TBool                                           iAlreadyConnected;
     };
 
 #endif
--- a/ipsservices/ipssosplugin/inc/ipsplgpop3fetchoperation.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgpop3fetchoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -20,8 +20,6 @@
 
 #include "ipsplgonlineoperation.h"
 
-//class CMsvEmailConnectionProgressProvider;
-
 /**
 * CIpsPlgPop3FetchOperation
 * Fetch message(s) operation, using client MTM Get Mail API.
@@ -31,21 +29,32 @@
     {
     public:
 
-        /**
-        *
-        */
-        static CIpsPlgPop3FetchOperation* NewL(
-            CMsvSession& aMsvSession,
-            TRequestStatus& aObserverRequestStatus,
-            TInt aFunctionId,
-            TMsvId aService,
-            CIpsPlgTimerOperation& aActivityTimer,
-            const TImPop3GetMailInfo& aGetMailInfo,
-            const CMsvEntrySelection& aSel,
-            TFSMailMsgId aFSMailBoxId,
-            MFSMailRequestObserver* aFSOperationObserver,
-            TInt aFSRequestId,
-            CIpsPlgEventHandler* aEventHandler );
+	    /**
+	    * NewL
+	    * @param aMsvSession client/server session to MsvServer
+	    * @param aObserverRequestStatus client status
+	    * @param aService serviceId of mailbox
+	    * @param aActivityTimer mailbox specific activity timer
+	    * @param aGetMailInfo parameters set for actual MsvServer command
+	    * @param aSelection selection of entries to fetch
+	    * @param aFSMailBoxId mailbox identifier
+	    * @param aFSOperationObserver observer of this operation
+	    * @param aFSRequestId client assigned identifier for this operation instance
+	    * @param aEventHandler event handler for sending sync status events
+	    * @return operation instance
+	    */
+		// <qmail> MFSMailRequestObserver& changed to pointer
+	    static CIpsPlgPop3FetchOperation* NewL(
+	        CMsvSession& aMsvSession,
+	        TRequestStatus& aObserverRequestStatus,
+	        TMsvId aService,
+	        CIpsPlgTimerOperation& aActivityTimer,
+	        const TImPop3GetMailInfo& aGetMailInfo,
+	        CMsvEntrySelection* aSelection,
+	        TFSMailMsgId aFSMailBoxId,
+	        MFSMailRequestObserver* aFSOperationObserver,
+	        TInt aFSRequestId,
+	        CIpsPlgEventHandler* aEventHandler );
 
        
         /**
@@ -54,13 +63,16 @@
         virtual ~CIpsPlgPop3FetchOperation();
 
         /**
-        *
+	    * From MsvOperation
+	    * Gets information on the progress of the operation
+	    * (see MsvOperation header)
         */
         virtual const TDesC8& ProgressL();
 
         /**
-        *
-        */
+	    * From CIpsPlgBaseOperation
+	    * For reporting if DoRunL leaves
+	    */
         virtual const TDesC8& GetErrorProgressL( TInt aError );
         
         /**
@@ -68,34 +80,36 @@
         */
         virtual TFSProgress GetFSProgressL() const;
         
-        // <qmail> new func to this op
+// <qmail> new func to this op
         /**
          * Returns operation type
          */
         TIpsOpType IpsOpType() const;
+// </qmail>
         
     protected:
 
         /**
         *
         */
-        CIpsPlgPop3FetchOperation(
-            CMsvSession& aMsvSession,
-            TRequestStatus& aObserverRequestStatus,
-            TInt aFunctionId,
-            TMsvId aService,
-            CIpsPlgTimerOperation& aActivityTimer,
-            const TImPop3GetMailInfo& aGetMailInfo,
-            TFSMailMsgId aFSMailBoxId,
-            MFSMailRequestObserver* aFSOperationObserver,
-            TInt aFSRequestId,
-            CIpsPlgEventHandler* aEventHandler);
+		// <qmail> MFSMailRequestObserver& changed to pointer
+	    CIpsPlgPop3FetchOperation(
+	        CMsvSession& aMsvSession,
+	        TRequestStatus& aObserverRequestStatus,
+	        TMsvId aService,
+	        CIpsPlgTimerOperation& aActivityTimer,
+	        const TImPop3GetMailInfo& aGetMailInfo,
+	        CMsvEntrySelection* aSelection,
+	        TFSMailMsgId aFSMailBoxId,
+	        MFSMailRequestObserver* aFSOperationObserver,
+	        TInt aFSRequestId,
+	        CIpsPlgEventHandler* aEventHandler);
 
             
         /**
         *
         */
-        void ConstructL( const CMsvEntrySelection& aSel );
+        void ConstructL();
 
         /**
         * From CActive
@@ -127,24 +141,27 @@
         */
         void DoDisconnectL();
 
-    protected:
+	// <qmail> protected to private
+	private:
 
         enum TFetchState {
             EStateIdle,
             EStateConnecting,
+            EStateClearCompleteFlag,
             EStateFetching,
             EStateDisconnecting };
+    	// internal state of the operation
         TFetchState iState;
-
-    protected:
-        
+        // <qmail> protected to private
         TDesC8* iFetchErrorProgress;
-        TInt iFunctionId;
+    	// <qmail> removed iFunctionId;
         TImPop3GetMailInfo iGetMailInfo;
         TPckgBuf<TPop3Progress> iProgressBuf;
         CMsvEntrySelection* iSelection;
         CIpsPlgEventHandler* iEventHandler;
-        
+        // For clear complete flag operation
+        CMsvEntry* iEntry;
+        TInt iEntryIndex;
     };
 
 
--- a/ipsservices/ipssosplugin/inc/ipsplgsearch.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgsearch.h	Fri May 14 15:41:10 2010 +0300
@@ -163,6 +163,10 @@
      */
     void CollectMessagesL();
 
+    /**
+     * server asks client if to change the search priority (when calling)
+     */
+    void ClientRequiredSearchPriority( TInt *apRequiredSearchPriority );
     
 protected:
 
--- a/ipsservices/ipssosplugin/inc/ipsplgsearch.inl	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgsearch.inl	Fri May 14 15:41:10 2010 +0300
@@ -19,7 +19,11 @@
 #include <StringLoader.h>
 
 const TInt KIpsPlgArrayGranularity = 3;
-_LIT( KIpsPlgPattern, "*%1U*" );
+// <cmail> mirrored
+//_LIT( KIpsPlgPattern, "*%0U*" );
+_LIT( KIpsPlgPattern, "*" );
+// </cmail> 
+
 
 // ---------------------------------------------------------------------------
 // CIpsPlgSearch::TSearchParams::TSearchParams()
@@ -109,16 +113,27 @@
 
     for ( TInt item = 0; item < aSearchStrings.Count(); item++ )
         {
+        // <cmail> mirrored
+
         // Add the wildcards here.
-        TBuf<5> pattern( KIpsPlgPattern );
+        //TBuf<5> pattern( KIpsPlgPattern );
         RBuf destroyThisHackStringNow;
         destroyThisHackStringNow.CreateL(
             aSearchStrings[item]->Length() + 2 );
         CleanupClosePushL( destroyThisHackStringNow );
 
+        destroyThisHackStringNow.Insert(0, KIpsPlgPattern);
+        destroyThisHackStringNow.Append(*aSearchStrings[item]);
+        destroyThisHackStringNow.Append(KIpsPlgPattern);
+        /*
         StringLoader::Format(
-            destroyThisHackStringNow, pattern, 1, *aSearchStrings[item] );
-        iSearchStrings->AppendL( *destroyThisHackStringNow.AllocL() );
+            destroyThisHackStringNow, pattern, 0, *aSearchStrings[item] );
+        */
+
+        // </cmail> 
+
+        
+        iSearchStrings->AppendL( destroyThisHackStringNow ); //<cmail>
 
         CleanupStack::PopAndDestroy( &destroyThisHackStringNow );
         }
@@ -138,7 +153,7 @@
 
     for ( TInt item = 0; item < aSearchStrings.Count(); item++ )
         {
-        iSearchStrings->AppendL( *aSearchStrings[item].AllocL() );
+        iSearchStrings->AppendL( aSearchStrings[item] ); //<cmail>
         }
     }
 
--- a/ipsservices/ipssosplugin/inc/ipsplgsearchop.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgsearchop.h	Fri May 14 15:41:10 2010 +0300
@@ -66,7 +66,7 @@
      * @return
      */
     void DoCancel();
-    
+
 protected:
 
     /**
@@ -225,6 +225,12 @@
      */
     CIpsPlgTextSearcher* iSearcher;  
     
+//    
+    /**
+     * Enable changing searching priority on client feedback - must be made in RunL
+     */
+    TInt iRequiredPriority;
+//    
     };
 
 #endif /* IPSPLGSEARCHOP_H */
--- a/ipsservices/ipssosplugin/inc/ipsplgsingleopwatcher.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgsingleopwatcher.h	Fri May 14 15:41:10 2010 +0300
@@ -24,6 +24,7 @@
 class CMsvOperation;
 class MIpsPlgSingleOpWatcher;
 class CIpsPlgBaseOperation;
+class CIpsPlgImap4MoveRemoteOpObserver;
 
 /**
 * CMsvOperation watcher class.
@@ -60,6 +61,11 @@
         void SetOperation( CIpsPlgBaseOperation* aBaseOperation );
 
         /**
+        * Sets request observer.
+        */
+        void SetRequestObserver( CIpsPlgImap4MoveRemoteOpObserver* aObserver );
+
+        /**
         * Returns reference to the operation
         */
         IMPORT_C CMsvOperation& Operation() const;
@@ -91,6 +97,7 @@
         MIpsPlgSingleOpWatcher& iObserver;
         CMsvOperation *iOperation;
         CIpsPlgBaseOperation* iBaseOperation;
+        CIpsPlgImap4MoveRemoteOpObserver* iRequestObserver;
     };
 
 
--- a/ipsservices/ipssosplugin/inc/ipsplgsmtpoperation.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgsmtpoperation.h	Fri May 14 15:41:10 2010 +0300
@@ -21,10 +21,12 @@
 
 #include <smtcmtm.h>
 #include "ipsplgcommon.h"
+// <qmail>
 #include "ipsplgbaseoperation.h"
 
 class CClientMtmRegistry;
 class MFSMailRequestObserver;
+// </qmail>
 
 /**
  *  Class for smtp related operations
@@ -32,9 +34,12 @@
  *  @lib ipssosplugin.lib
  *  @since FS 1.0
  */
-//should this class inherited from online operation
+// <qmail> base class changed: CMsvOperation -> CIpsPlgBaseOperation, MIpsPlgConnectOpCallback removed
 NONSHARABLE_CLASS( CIpsPlgSmtpOperation ) : public CIpsPlgBaseOperation
     {
+
+// <qmail> CredientialsSetL removed 
+
 public:
 
     /**
@@ -43,7 +48,7 @@
      * @since FS 1.0
      * @return None
      */
-    // <qmail> priority parameter has been removed
+    // <qmail> aPriority, aUsePublishSubscribe parameters removed, aFSOperationObserver, aFSRequestId added
     IMPORT_C static CIpsPlgSmtpOperation* NewL( 
         CMsvSession& aMsvSession, 
         TRequestStatus& aObserverRequestStatus,
@@ -56,7 +61,7 @@
      * @since FS 1.0
      * @return None
      */
-    // <qmail> priority parameter has been removed
+    // <qmail> aPriority, aUsePublishSubscribe parameters removed, aFSOperationObserver, aFSRequestId added
     IMPORT_C static CIpsPlgSmtpOperation* NewLC(
         CMsvSession& aMsvSession, 
         TRequestStatus& aObserverRequestStatus,
@@ -76,15 +81,18 @@
      */ 
     virtual const TDesC8& ProgressL();
     
+// <qmail>
     virtual const TDesC8& GetErrorProgressL( TInt aError );
 
     virtual TFSProgress GetFSProgressL() const;
+// </qmail>
 
-    // <qmail> change ret val type
+// <qmail> change ret val type
     /**
      * Returns operation type
      */
     TIpsOpType IpsOpType() const;
+// </qmail>
 
     /**
      * Stard sending operation
@@ -98,6 +106,11 @@
     IMPORT_C TInt EmptyOutboxFromPendingMessagesL( TMsvId aMailboxId );
 
     IMPORT_C CMsvEntrySelection* GetOutboxChildrensL( );
+
+	/**
+	 *  Sets CIpsPlgEventHandler
+	 */
+	void SetEventHandler( TAny* aEventHandler );
     
 protected:
 
@@ -107,13 +120,13 @@
      * @since FS 1.0
      * @return None
      */
-    // <qmail> priority parameter has been removed
+    // <qmail> aPriority parameter removed, aFSOperationObserver, aFSRequestId added
     CIpsPlgSmtpOperation( 
         CMsvSession& aMsvSession, 
         TRequestStatus& aObserverRequestStatus,
         MFSMailRequestObserver* aFSOperationObserver,
         TInt aFSRequestId );
-
+    
     /**
      * Constructor for leaving methods
      *
@@ -122,12 +135,25 @@
      */    
     void ConstructL( );
 
+    /**
+     * Completes observer with status aStatus
+     * @param aStatus: Status of the operation.
+     */
+    void CompleteObserver( TInt aStatus = KErrNone );
+
+    /**
+     * Completes itself with KErrNone status
+     */
+    void CompleteThis();
+
 private: // From CActive
 
     enum TIpsSendState
         {
-        EMovingOutbox,
-        ESending
+        EIdle,
+        EMovingOutbox,          // moving mail to OutBox folder
+        ESending                // sending mail
+		// <qmail> EQueryingDetails, EQueryingDetailsBusy removed
         };
 
     /**
@@ -137,7 +163,9 @@
      */
     void RunL( );
 
+// <qmail>
     TInt RunError( TInt aError );
+// </qmail>
 
     void DoCancel( );
     
@@ -166,7 +194,8 @@
      * @param aRecipients array of addresses
      */
     void ValidateAddressArrayL( const CDesCArray& aRecipients );
-    
+
+	// <qmail> QueryUserPassL() function removed
 private:
 
     CSmtpClientMtm*         iSmtpMtm;
@@ -175,8 +204,12 @@
     CClientMtmRegistry*     iMtmRegistry;
     TInt                    iState;
     TMsvId                  iSmtpService;
+// <qmail>
     MFSMailRequestObserver* iFSOperationObserver;
     TFSProgress             iFSProgress;
+// </qmail>
+	// not owned
+    TAny*               	iEventHandler; // pointer to CIpsPlgEventHandler
     };
 
 #endif /* IPSPLGSENDOPERATION_H */
--- a/ipsservices/ipssosplugin/inc/ipsplgsmtpservice.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgsmtpservice.h	Fri May 14 15:41:10 2010 +0300
@@ -123,7 +123,16 @@
      * @param aEntry Original message entry 
      * @return None
      */
-    void ChangeServiceIdL( TMsvEntry& aEntry );    
+    void ChangeServiceIdL( TMsvEntry& aEntry );
+	
+	 /**
+     * Changes messages service id to the given id
+     *
+     * @param aEntry message entry
+     * @param aServiceId new service id
+     * @return None
+     */
+    void ChangeServiceIdL( TMsvEntry& aEntry, TMsvId aServiceId );    
 // </qmail>
 
 protected:
@@ -181,7 +190,6 @@
      * @param aCharset the charset to be set
      */
     void SetCharactersetL( CMsvEntry& aEntry, TUid aCharset );
-
 private: // data
 
     CIpsPlgSosBasePlugin& iPlugin;
@@ -189,6 +197,12 @@
     CMsvSession& iSession;
     
     CIpsPlgMsgMapper* iMsgMapper;
+    
+    /**
+     * Own: Feature manager initialization flag
+     */
+    TBool iFeatureManagerInitialized;
+
     };
 
 #endif /* IPSPLGSMTPSERVICE_H*/
--- a/ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.h	Fri May 14 15:41:10 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"
@@ -38,13 +38,14 @@
 class CIpsPlgSettingsObserver;
 class CRepository;
 class CIpsPlgSearch;
+// <qmail> CIpsSetDataApi removed
 class CIpsPlgSmtpService;
 class CIpsPlgSyncStateHandler;
 class CIpsPlgEventHandler;
 
 /**
- *  FreestyleIpsServices plugin class 
- * 
+ *  FreestyleIpsServices plugin class
+ *
  *  @lib ipssosplugin.lib
  *  @since FSEmail 2.0
  */
@@ -53,10 +54,10 @@
                              public MIpsPlgSingleOpWatcher,
                              public MFSMailRequestObserver, // a dummy observer
                              public MIpsPlgTimerOperationCallBack
-    {  
-    
+    {
+
 public:
-		
+
     /**
     * ~CIpsPlgSosBasePlugin
     * Destructor
@@ -66,34 +67,34 @@
 public: //from MIpsPlgSingleOpWatcher
 
     /**
-    * 
+    *
     */
-    void OpCompleted( 
-        CIpsPlgSingleOpWatcher& aOpWatcher, 
+    void OpCompleted(
+        CIpsPlgSingleOpWatcher& aOpWatcher,
         TInt aCompletionCode );
 
 public: //from MFSMailRequestObserver
-    
+
     /**
     * no real implementation for this. we're just a dummy observer,
     * so we can internally run our own operations, like DisconnectL
     */
     virtual void RequestResponseL( TFSProgress aEvent, TInt aRequestId );
-    
+
 public: // from MIpsPlgTimerOperationCallBack
-    
+
     /**
     * Called when activity timer fires
-    */    
+    */
     virtual void HandleTimerFiredL( const TFSMailMsgId& aMailboxId );
-    
+
 public: // from CFSMailPlugin
 
     virtual void SetMailboxName(
-         const TFSMailMsgId& aMailboxId, 
+         const TFSMailMsgId& aMailboxId,
          const TDesC& aMailboxName );
-    
-    virtual TFSMailBoxStatus GetMailBoxStatus( 
+
+    virtual TFSMailBoxStatus GetMailBoxStatus(
          const TFSMailMsgId& aMailBoxId );
 
     virtual TFSMailMsgId SpecifiedSendingMailbox();
@@ -110,12 +111,20 @@
     virtual TDesC& GetBrandingIdL( const TFSMailMsgId& aMailBoxId);
 
     virtual void MoveMessagesL(
-        const TFSMailMsgId& aMailBoxId, 
-        const RArray<TFSMailMsgId>& aMessageIds, 
-        const TFSMailMsgId& aSourceFolderId, 
-        const TFSMailMsgId& aDestinationFolderId );     
+        const TFSMailMsgId& aMailBoxId,
+        const RArray<TFSMailMsgId>& aMessageIds,
+        const TFSMailMsgId& aSourceFolderId,
+        const TFSMailMsgId& aDestinationFolderId );
 
-    virtual void CopyMessagesL( 
+    virtual TInt MoveMessagesL(
+        const TFSMailMsgId& aMailBoxId,
+        const RArray<TFSMailMsgId>& aMessageIds,
+        const TFSMailMsgId& aSourceFolderId,
+        const TFSMailMsgId& aDestinationFolderId,
+        MFSMailRequestObserver& aOperationObserver,
+        TInt aRequestId );
+
+    virtual void CopyMessagesL(
         const TFSMailMsgId& aMailBoxId,
         const RArray<TFSMailMsgId>& aMessageIds,
         RArray<TFSMailMsgId>& aNewMessages,
@@ -124,29 +133,29 @@
 
     virtual MDesCArray* GetMrusL( const TFSMailMsgId& aMailBoxId );
 
-    virtual void SetMrusL( 
-            const TFSMailMsgId& aMailBoxId, 
+    virtual void SetMrusL(
+            const TFSMailMsgId& aMailBoxId,
             MDesCArray* aNewMruList );
 
-    virtual const TFSProgress GetLastSyncStatusL( 
+    virtual const TFSProgress GetLastSyncStatusL(
         const TFSMailMsgId& aMailBoxId );
 
     virtual TInt CancelSyncL( const TFSMailMsgId& aMailBoxId );
 
     // FOLDER HANDLING
 
-    virtual CFSMailFolder* GetFolderByUidL( 
-        const TFSMailMsgId& aMailBoxId, 
+    virtual CFSMailFolder* GetFolderByUidL(
+        const TFSMailMsgId& aMailBoxId,
         const TFSMailMsgId& aFolderId );
 
-    virtual CFSMailFolder* CreateFolderL( 
-        const TFSMailMsgId& aMailBoxId, 
+    virtual CFSMailFolder* CreateFolderL(
+        const TFSMailMsgId& aMailBoxId,
         const TFSMailMsgId& aFolderId,
-        const TDesC& aFolderName, 
+        const TDesC& aFolderName,
         const TBool aSync );
 
     virtual void DeleteFolderByUidL(
-        const TFSMailMsgId& aMailBoxId, 
+        const TFSMailMsgId& aMailBoxId,
         const TFSMailMsgId& aFolderId);
 
     // MESSAGE FETCH AND STORE
@@ -157,20 +166,20 @@
         const TFSMailDetails aDetails,
         const RArray<TFSMailSortCriteria>& aSorting );
 
-    virtual CFSMailMessage* GetMessageByUidL( 
-        const TFSMailMsgId& aMailBoxId, 
+    virtual CFSMailMessage* GetMessageByUidL(
+        const TFSMailMsgId& aMailBoxId,
         const TFSMailMsgId& aFolderId,
-        const TFSMailMsgId& aMessageId, 
+        const TFSMailMsgId& aMessageId,
         const TFSMailDetails aDetails);
 
-    virtual void DeleteMessagesByUidL( 
+    virtual void DeleteMessagesByUidL(
         const TFSMailMsgId& aMailBoxId,
         const TFSMailMsgId& aFolderId,
         const RArray<TFSMailMsgId>& aMessages );
 
     // MESSAGE STORE OPERATIONS
 
-    virtual CFSMailMessage* CreateMessageToSendL( 
+    virtual CFSMailMessage* CreateMessageToSendL(
         const TFSMailMsgId& aMailBoxId );
     
 // <qmail>
@@ -187,8 +196,8 @@
         const TInt aRequestId );
 // </qmail>
 
-    virtual CFSMailMessage* CreateForwardMessageL( 
-        const TFSMailMsgId& aMailBoxId, 
+    virtual CFSMailMessage* CreateForwardMessageL(
+        const TFSMailMsgId& aMailBoxId,
         const TFSMailMsgId& aOriginalMessageId,
         const TDesC& aHeaderDescriptor );
 
@@ -209,8 +218,8 @@
         const TDesC& aHeaderDescriptor = KNullDesC );
 // </qmail>
 
-    virtual CFSMailMessage* CreateReplyMessageL( 
-        const TFSMailMsgId& aMailBoxId, 
+    virtual CFSMailMessage* CreateReplyMessageL(
+        const TFSMailMsgId& aMailBoxId,
         const TFSMailMsgId& aOriginalMessageId,
         const TBool aReplyToAll,
         const TDesC& aHeaderDescriptor );
@@ -234,8 +243,8 @@
         const TDesC& aHeaderDescriptor );
 // </qmail>
        
-    virtual void StoreMessageL( 
-        const TFSMailMsgId& aMailBoxId, 
+    virtual void StoreMessageL(
+        const TFSMailMsgId& aMailBoxId,
         CFSMailMessage& aMessage );
 
 
@@ -248,19 +257,19 @@
     // </qmail>
             
     virtual void GetMessagesL(
-        const TFSMailMsgId& aMailBoxId, 
+        const TFSMailMsgId& aMailBoxId,
         const TFSMailMsgId& aFolderId,
         const RArray<TFSMailMsgId>& aMessageIds,
         RPointerArray<CFSMailMessage>& aMessageList,
         const TFSMailDetails aDetails );
-    						
-    virtual void ChildPartsL( 
+
+    virtual void ChildPartsL(
         const TFSMailMsgId& aMailBoxId,
         const TFSMailMsgId& aParentFolderId,
         const TFSMailMsgId& aMessageId,
         const TFSMailMsgId& aParentId,
         RPointerArray<CFSMailMessagePart>& aParts);
-    						
+
     virtual CFSMailMessagePart* NewChildPartL(
         const TFSMailMsgId& aMailBoxId,
         const TFSMailMsgId& aParentFolderId,
@@ -332,47 +341,47 @@
         const TInt aRequestId );
     // </qmail>
         
-    virtual CFSMailMessagePart* MessagePartL(  
-        const TFSMailMsgId& aMailBoxId, 
+    virtual CFSMailMessagePart* MessagePartL(
+        const TFSMailMsgId& aMailBoxId,
         const TFSMailMsgId& aParentFolderId,
         const TFSMailMsgId& aMessageId,
         const TFSMailMsgId& aMessagePartId);
 
-    virtual TInt GetMessagePartFileL(  
-        const TFSMailMsgId& aMailBoxId, 
+    virtual TInt GetMessagePartFileL(
+        const TFSMailMsgId& aMailBoxId,
         const TFSMailMsgId& aParentFolderId,
         const TFSMailMsgId& aMessageId,
-        const TFSMailMsgId& aMessagePartId, 
+        const TFSMailMsgId& aMessagePartId,
         RFile& aFileHandle);
 
-    virtual void CopyMessagePartFileL( 
-        const TFSMailMsgId& aMailBoxId, 
+    virtual void CopyMessagePartFileL(
+        const TFSMailMsgId& aMailBoxId,
         const TFSMailMsgId& aParentFolderId,
         const TFSMailMsgId& aMessageId,
-        const TFSMailMsgId& aMessagePartId, 
+        const TFSMailMsgId& aMessagePartId,
         const TDesC& aFilePath);
 
-    virtual void GetContentToBufferL(	
+    virtual void GetContentToBufferL(
         const TFSMailMsgId& aMailBoxId,
         const TFSMailMsgId& aParentFolderId,
         const TFSMailMsgId& aMessageId,
         const TFSMailMsgId& aMessagePartId,
         TDes& aBuffer,
         const TUint aStartOffset);
-    						 
+
     virtual void SetContentL(
-        const TDesC& aBuffer, 
+        const TDesC& aBuffer,
         const TFSMailMsgId& aMailBoxId,
         const TFSMailMsgId& aParentFolderId,
-        const TFSMailMsgId& aMessageId, 
-        const TFSMailMsgId& aMessagePartId); 
+        const TFSMailMsgId& aMessageId,
+        const TFSMailMsgId& aMessagePartId);
 
-    virtual void RemovePartContentL( 
-        const TFSMailMsgId& aMailBoxId, 
+    virtual void RemovePartContentL(
+        const TFSMailMsgId& aMailBoxId,
         const TFSMailMsgId& aParentFolderId,
         const TFSMailMsgId& aMessageId,
         const RArray<TFSMailMsgId>& aPartIds);
-        
+
     virtual void SetPartContentFromFileL(
         const TFSMailMsgId& aMailBoxId,
         const TFSMailMsgId& aParentFolderId,
@@ -397,6 +406,8 @@
 
     // MESSAGE SENDING
 
+    virtual void SendL(TFSMailMsgId aMessageId );
+
     virtual void SendMessageL( CFSMailMessage& aMessage );
 
     virtual void SendMessageL(
@@ -405,18 +416,18 @@
         const TInt aRequestId );
 
     // OPERATION HANDLING
-    
+
     virtual void GoOnlineL( const TFSMailMsgId& aMailBoxId );
-    
+
     virtual void GoOfflineL( const TFSMailMsgId& aMailBoxId );
-    						
+
     virtual TFSProgress StatusL(const TInt aRequestId);
 
     virtual void CancelL(const TInt aRequestId);
 
-    // Search API 
+    // Search API
 
-    virtual void SearchL( 
+    virtual void SearchL(
         const TFSMailMsgId& aMailBoxId,
         const RArray<TFSMailMsgId>& aFolderIds,
         const RPointerArray<TDesC>& aSearchStrings,
@@ -442,7 +453,7 @@
         const TFSMailMsgId& aMailBoxId);
 
     virtual TInt WizardDataAvailableL( );
-    
+
     /**
      * reads connection id from plugin
      *
@@ -454,24 +465,24 @@
     /**
      * checks from plugin if connection is allowed when roaming
      *
-     * @param  aConnectionAllowed 
+     * @param  aConnectionAllowed
      * @return KErrNone or error code
      */
-     virtual TInt IsConnectionAllowedWhenRoaming( 
-             TFSMailMsgId aMailBoxId, 
+     virtual TInt IsConnectionAllowedWhenRoaming(
+             TFSMailMsgId aMailBoxId,
              TBool& aConnectionAllowed );
 
     virtual void AuthenticateL(
         MFSMailRequestObserver& aOperationObserver,
         TInt aRequestId );
 
-    virtual void SetCredentialsL( 
-       const TFSMailMsgId& aMailBoxId, 
+    virtual void SetCredentialsL(
+       const TFSMailMsgId& aMailBoxId,
        const TDesC& aUsername,
        const TDesC& aPassword );
-    
+
 public:
-    
+
     /**
     * Function to identify which protocol plugin we are working with
     * @return MTM id
@@ -486,7 +497,7 @@
      * @since FSEmail 2.0
      */
    TUint PluginId() const;
-    
+
     /**
      * Disconnects mailbox
      *
@@ -497,12 +508,12 @@
      *                           removed afted disconnect, default is EFalse
      * @since FSEmail 2.0
      */
-    virtual void DisconnectL( 
-        const TFSMailMsgId& aMailBoxId, 
+    virtual void DisconnectL(
+        const TFSMailMsgId& aMailBoxId,
         MFSMailRequestObserver& aObserver,
         const TInt aRequestId,
         TBool aRemoveAccountAlso = EFalse );
-    
+
     /**
      * Fetch content of new mail, used in event handler
      * needed because imap idle
@@ -512,11 +523,11 @@
      * @param aParentId new mail's parent entry id
      * @since FSEmail 2.0
      */
-    virtual void PopulateNewMailL( 
-        const TFSMailMsgId& aMailboxId, 
-        TMsvId aNewId, 
+    virtual void PopulateNewMailL(
+        const TFSMailMsgId& aMailboxId,
+        TMsvId aNewId,
         TMsvId aParentId ) = 0;
-    
+
     /**
      * Gets reference to activity timer object, used when clearing
      * activity timer in operation complete function (online operation)
@@ -528,27 +539,27 @@
      * @since FSEmail 2.0
      */
     CIpsPlgTimerOperation& ActivityTimerL( const TFSMailMsgId& aMailBoxId );
-    
+
     /*
      * Gets reference to sync state handler class
-     * @return reference to sync state handler 
+     * @return reference to sync state handler
      * @since FSEmail 2.0
      */
     CIpsPlgSyncStateHandler& GetSyncStateHandler();
-    
+
     /**
      * This is called after msv session ready event comes from msv server
      * @since FSEmail 2.0
      */
     void CompleteConstructL();
-    
-    
+
+
     /**
      * called if session terminated event is sent by msv server
      * @since FSEmail 2.0
      */
     void SessionTerminated();
-    
+
     /**
     * Does checks to see is connection attempt possible and allowed
     * @param aMailboxId mailbox to do the checks to
@@ -558,15 +569,23 @@
     */
     TBool CanConnectL( const TFSMailMsgId& aMailboxId,
         TInt& aReason );
-    
+
     /*
      * Gludge type check is plugin instance running under ui process
      * needed in event handler
      * @since FSEmail 2.0
      */
     TBool IsUnderUiProcess();
-    
-protected:        
+
+    // <qmail> new function
+    /*
+     * Checks whether given mailbox has ongoing operations or not
+     * @param aMailboxId
+     * @return true/false
+     */
+    TBool HasOperations( const TFSMailMsgId& aMailboxId );
+    // </qmail>
+protected:
 
     /*
      * Constructor
@@ -581,25 +600,25 @@
 
     /**
      * passes completion event to protocol plugin
-     * If certain operation completion requires special handling, 
+     * If certain operation completion requires special handling,
      * protocol plugin should keep the id of the operation
      * so it can know, that this certain operation has completed.
      */
-    virtual void HandleOpCompletedL( 
-        CIpsPlgSingleOpWatcher& aOpWatcher, 
+    virtual void HandleOpCompletedL(
+        CIpsPlgSingleOpWatcher& aOpWatcher,
         TInt aCompletionCode ) = 0;
-    
+
     /**
     * Sends pending messages from outbox, if user manually start
     * send-receive operation.
     */
     void EmptyOutboxL( const TFSMailMsgId& aMailBoxId );
-    
+
     /**
     * Checks if offline mode is activated
     */
     TBool OfflineModeSetL();
-    
+
     /**
     * Checks if given local feature is turned on
     */
@@ -607,89 +626,115 @@
         const TUid& aCenRepUid,
         const TUint32 aKeyId,
         const TUint32 aFlag );
-    
+
     /**
     * Checks if we are roaming and are we allowed to
     * connect if we are.
     */
     TBool RoamingCheckL();
-    
+
     /**
     * Check network registration status i.e. are we in gsm or wlan network
     */
     TInt RegistrationStatusL();
-    
+
     /**
     * Called from Imap Plugin's MoveMessagesL if destination folder
     * is draft folder.
     */
     void MoveMessagesToDraftL(
-        const TFSMailMsgId& aMailBoxId, 
-        const RArray<TFSMailMsgId>& aMessageIds, 
-        const TFSMailMsgId& aSourceFolderId, 
+        const TFSMailMsgId& aMailBoxId,
+        const RArray<TFSMailMsgId>& aMessageIds,
+        const TFSMailMsgId& aSourceFolderId,
         const TFSMailMsgId& aDestinationFolderId );
-    
+
 private:
-    
+
     /**
      * Returns a cached entry objects or creates new objects and keeps them
      * in the cache.
      * Returned objects should not be deleted in the calling method.
      * Pointers are set NULL in the case of error.
      * Pointers are valid until the method is called next time
-     * Method should be used only for entries representing messages (not 
+     * Method should be used only for entries representing messages (not
      * folders or attachements).
      */
-    void GetMessageEntryL( 
-        TMsvId aId, 
+    void GetMessageEntryL(
+        TMsvId aId,
+        CMsvEntry*& aMessageEntry,
+        CImEmailMessage*& aImEmailMessage );
+
+    /**
+	 * Takes ownership of the cached objects or creates new ones
+	 */     	 
+	void TakeMessageEntryLC(
+		TMsvId aId,
         CMsvEntry*& aMessageEntry,
         CImEmailMessage*& aImEmailMessage );
     
+    /**
+     * Return objects to cache, deleting old ones in the cache if necessary
+     */         
+    void ReturnMessageEntry(
+        CMsvEntry* aMessageEntry,
+        CImEmailMessage* aImEmailMessage );
+        
     /*
      * Cleans up the cached messages entries that have accessed with
      * GetMessageEntryL()
      */
     void CleanCachedMessageEntries();
-    
+
     /**
     * Cancel all online operations, use before disconnect
     */
     void CancelAllOnlineOperations( const TFSMailMsgId& aMailboxId );
-    
+
     /**
     * Checks is there any connect operations running, meaning
     * that we are "connected" state
     */
     TBool ConnOpRunning( const TFSMailMsgId& aMailBoxId  );
-    
+
     /**
     * Cancel, delete and remove operation from iOperations array.
     * Send Sync Completed event to plugin if operation is sync op
     */
-    void DeleteAndRemoveOperation( 
+    void DeleteAndRemoveOperation(
             const TInt aOpArrayIndex, TInt aCompleteCode );
+
+    /**
+     * Fixes the forward (or reply) message header parts (that are copied
+     * to msg content) in case that caller has provided an own header 
+     * descriptor for these parts.
+     */
+    void FixReplyForwardHeaderL(
+            CFSMailMessage* aMessage,
+            const TFSMailMsgId& aMailBoxId,
+            const TFSMailMsgId& aOriginalMessageId,
+            const TDesC& aHeaderDescriptor );
     
-private:        
+private:
 
     /**
     * Maps symbian msv api's folder type to fs folder type
     */
-    TFSFolderType GetFolderType( 
-            CMsvEntry* aEntry, 
+    TFSFolderType GetFolderType(
+            CMsvEntry* aEntry,
             TFSMailMsgId aFolderId );
-    
+
     /**
     * Set folders to blocklist in online, offline or in both cases.
-    * Operations (move/copy) allowed only between remote folders 
+    * Operations (move/copy) allowed only between remote folders
     * (+IMAP inbox) in online mode and Outbox->Drafts
     */
-    void BlockCopyMoveFromFoldersL( 
-        CMsvEntry* aFolderEntry, 
-        TFSMailMsgId aFolderId, 
+    void BlockCopyMoveFromFoldersL(
+        CMsvEntry* aFolderEntry,
+        TFSMailMsgId aFolderId,
         CFSMailFolder& aFSMailFolder );
-    
+
     /**
-     * Set IMEI code to service's TEntry.iDescription 
+     * Set IMEI code to service's TEntry.iDescription
      */
     void StoreIMEIToMailboxL( const TMsvId aMailboxId );
 
@@ -701,18 +746,18 @@
     void DeleteActivityTimer( const TFSMailMsgId& aMailBoxId  );
 
 protected: // internal enumerations and data structures
-    
+
     enum TSyncStatesInCenRep
         {
         ESyncFinishedSuccessfully = 103,
         ESyncError,
         ESyncCancelled
         };
-    
+
 private:
 
     CIpsPlgSosBasePlugin();
-    
+
 protected:
 
     // uint of fs plugin implementation, pop of imap
@@ -720,13 +765,13 @@
 
     // Symbian message server session
     CMsvSession* iSession;
-    
+
     // Message mapper instance
     CIpsPlgMsgMapper* iMsgMapper;
-    
+
     //array of operation watchers
     RPointerArray<CIpsPlgSingleOpWatcher>   iOperations;
-    
+
     //array of activity timers
     RPointerArray<CIpsPlgTimerOperation>   iActivitytimers;
 
@@ -736,30 +781,32 @@
     // Cached Symbian message data structures
     CMsvEntry* iCachedEntry;
     CImEmailMessage* iCachedEmailMessage;
-    
+
     // read and write most recent used address list
     CIpsPlgMruList* iMruList;
-    
+
     // Search Engine
     CIpsPlgSearch*  iSearch;
-    
+
+    // <qmail> iSettingsApi removed
+
     // maps symbian events to fs events
     CIpsPlgEventHandler*    iEventHandler;
-    
-    // keeps track is sync started in some plugin instance 
+
+    // keeps track is sync started in some plugin instance
     // or in always online needed when mailbox status is asked
     CIpsPlgSyncStateHandler* iSyncStateHandler;
-    
-    RConnectionMonitor              iConMon;    
-    
+
+    RConnectionMonitor              iConMon;
+
     // flag indicates is msv session ready
     TBool iSessionOk;
-    
+
     TBuf<KIpsPlgMaxPhoneIdLength>  iIMEI;
 
     // branding id i.e. "yahoo.com" or "google"
     HBufC*  iBrandingId;
-    
+
     // flag indicates is instance under FSEmail.exe
     TBool iIsUnderUiProcess;
 	};
--- a/ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.hrh	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.hrh	Fri May 14 15:41:10 2010 +0300
@@ -61,6 +61,7 @@
     KIPSSosSmtpSendStartedSignal,
     KIPSSosSmtpSendEndedSignal,
     KIPSSosSmtpEmptyOutboxNow
+// <qmail> EIPSSosSmtpPswErr removed
     };
 
 enum TIpsOpType
@@ -68,6 +69,7 @@
     EIpsOpTypeUnknown,
     EIpsOpTypeImap4SyncOp,
     EIpsOpTypePop3SyncOp,
+    EIpsOpTypeOnlineOp,
     EIpsOpTypeImap4PopulateOp,
     EIpsOpTypeSmtp,
 // <qmail> new op types
--- a/ipsservices/ipssosplugin/inc/ipsplgsyncstatehandler.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgsyncstatehandler.h	Fri May 14 15:41:10 2010 +0300
@@ -103,7 +103,12 @@
     
     TInt FindMailbox( TMsvId aMailbox );
     
-
+    /**
+    * Checks is there any connect operations running, meaning
+    * that the mailbox is in "connected" state.
+    * @param aMailBoxId Id of the mailbox which state is checked
+    */
+    TBool ConnOpRunning( const TFSMailMsgId& aMailBoxId  );
     
 private:
     
--- a/ipsservices/ipssosplugin/ipssosplugin.pro	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/ipssosplugin.pro	Fri May 14 15:41:10 2010 +0300
@@ -34,7 +34,7 @@
 inc/ipsplgmrulist.h \
 inc/ipsplgpanic.h \
 inc/ipsplgdeletelocal.h \
-inc/ipsplgdeleteremote.h \
+inc/ipsplgdeleteoperation.h \
 inc/ipsplgdisconnectop.h \
 inc/ipsplgeventtimer.h \
 inc/ipsplgimap4connectop.h \
@@ -78,7 +78,7 @@
     
 SOURCES   += src/ipsplgbaseoperation.cpp \
 src/ipsplgdeletelocal.cpp \
-src/ipsplgdeleteremote.cpp \
+src/ipsplgdeleteoperation.cpp \
 src/ipsplgdisconnectop.cpp \
 src/ipsplgeventtimer.cpp \
 src/ipsplgimap4connectop.cpp \
@@ -170,7 +170,9 @@
     -lCommonEngine \
     -lcharconv \
     -lConnMon \
-    -lflogger
+    -lflogger \
+    -lfeatmgr \
+    -lmessagestoreclient
 
     BLD_INF_RULES.prj_exports += \
       "inc/ipsplgsmtpoperation.h |../inc/ipsplgsmtpoperation.h" \
--- a/ipsservices/ipssosplugin/src/ipsplgbaseoperation.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgbaseoperation.cpp	Fri May 14 15:41:10 2010 +0300
@@ -64,3 +64,5 @@
     FUNC_LOG;
     return iFSMailboxId;
     }
+
+// <qmail> IpsOpType function body has been removed
--- a/ipsservices/ipssosplugin/src/ipsplgconnectandrefreshfolderlist.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgconnectandrefreshfolderlist.cpp	Fri May 14 15:41:10 2010 +0300
@@ -16,13 +16,20 @@
 *
 */
 
+
+// <qmail> aknmessagequerydialog include removed
+
 #include "emailtrace.h"
 #include "ipsplgheaders.h"
 
+// <qmail> ipssossettings rsg removed
+// <qmail> fsmailserver rsg removed
+
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
-// <qmail> priority parameter has been removed
-// <qmail> rename selection parameter
+// <qmail> priority parameter removed, aSelection moved from ConstructL -> constructor
+// <qmail> MFSMailRequestObserver& changed to pointer
+// <qmail> renamed selection parameter
 CIpsPlgConnectAndRefreshFolderList* CIpsPlgConnectAndRefreshFolderList::NewL(
     CMsvSession& aSession, 
     TRequestStatus& aObserverRequestStatus,
@@ -49,7 +56,9 @@
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
-// <qmail> priority parameter has been removed
+// <qmail> priority parameter removed, aSelection moved from ConstructL -> constructor
+// <qmail> MFSMailRequestObserver& changed to pointer
+// <qmail> renamed selection parameter
 CIpsPlgConnectAndRefreshFolderList::CIpsPlgConnectAndRefreshFolderList(
     CMsvSession& aSession, 
     TRequestStatus& aObserverRequestStatus,
@@ -69,12 +78,13 @@
 	iState( EIdle ),
     iSelection( aSelection )
     {
+    FUNC_LOG;
     iService = aService;
-    FUNC_LOG;
     }
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
+// <qmail> aMsvEntry removed
 void CIpsPlgConnectAndRefreshFolderList::ConstructL()
     {
     FUNC_LOG;
@@ -117,6 +127,7 @@
 TFSProgress CIpsPlgConnectAndRefreshFolderList::GetFSProgressL() const
     {
     FUNC_LOG;
+    // Hardly ever called
     return TFSProgress();
     }
     
@@ -127,8 +138,10 @@
     FUNC_LOG;
     
     if( iStatus.Int() != KErrNone )
+// </qmail>
         {
         iState = ECompleted;
+// <qmail> DisplayLoginFailedDialogL removed
         CompleteObserver();
         return;
         }
@@ -143,7 +156,7 @@
                 iMsvSession,
                 iStatus,
                 iService,
-                iActivityTimer,
+                *iActivityTimer,
                 iFSMailboxId,
                 NULL, // no observer for suboperations
                 0, // no requestId needed
@@ -171,7 +184,7 @@
                 iMsvSession, 
                 iStatus, 
                 iService, 
-                iActivityTimer,
+                *iActivityTimer,
                 iFSMailboxId, 
                 NULL, // no observer for suboperations
                 0 ); // no requestId needed
@@ -202,6 +215,11 @@
     iState = ECompleted;
     }
 
+
+// <qmail> removed in Qmail
+//void CIpsPlgConnectAndRefreshFolderList::DisplayLoginFailedDialogL()
+// </qmail>
+
 // <qmail> new func to this op
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------    
--- a/ipsservices/ipssosplugin/src/ipsplgcreateforwardmessageoperation.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgcreateforwardmessageoperation.cpp	Fri May 14 15:41:10 2010 +0300
@@ -18,11 +18,10 @@
 // <qmail>
 
 // INCLUDE FILES
-
 #include "emailtrace.h"
 #include "ipsplgheaders.h"
 
-// LOCAL CONSTANTS AND MACROS
+// <qmail> removed comment
 
 // ================= MEMBER FUNCTIONS =======================
 
@@ -30,8 +29,10 @@
 // CIpsPlgCreateForwardMessageOperation::CIpsPlgCreateForwardMessageOperation
 // ----------------------------------------------------------------------------
 //
+//<qmail> aSmtpService changed to reference
+//<qmail> KMsvNullIndexEntry para removed
 CIpsPlgCreateForwardMessageOperation::CIpsPlgCreateForwardMessageOperation(
-    CIpsPlgSmtpService* aSmtpService,
+    CIpsPlgSmtpService& aSmtpService,
     CMsvSession& aMsvSession,
     TRequestStatus& aObserverRequestStatus,
     TMsvPartList aPartList,
@@ -44,7 +45,6 @@
         aSmtpService,
         aMsvSession,
         aObserverRequestStatus,
-        KMsvNullIndexEntryId,
         aPartList,
         aMailBoxId,
         aOperationObserver,
@@ -53,14 +53,16 @@
     {
     FUNC_LOG;
     }
+//</qmail>	
 
 
 // ----------------------------------------------------------------------------
 // CIpsPlgCreateForwardMessageOperation::NewL
 // ----------------------------------------------------------------------------
 //
+//<qmail> aSmtpService changed to reference
 CIpsPlgCreateForwardMessageOperation* CIpsPlgCreateForwardMessageOperation::NewL(
-    CIpsPlgSmtpService* aSmtpService,
+    CIpsPlgSmtpService& aSmtpService,
     CMsvSession& aMsvSession,
     TRequestStatus& aObserverRequestStatus,
     TMsvPartList aPartList,
@@ -68,6 +70,7 @@
     TMsvId aOriginalMessageId, 
     MFSMailRequestObserver& aOperationObserver,
     TInt aRequestId )
+//</qmail>	
     {
     FUNC_LOG;
     CIpsPlgCreateForwardMessageOperation* self =
@@ -81,7 +84,9 @@
             aOperationObserver, 
             aRequestId );
     CleanupStack::PushL( self );
-    self->ConstructL();
+    // <qmail>
+    self->ConstructL(); // Use base class constructor
+    // </qmail>
     CleanupStack::Pop( self ); 
     return self;
     }
@@ -106,16 +111,14 @@
         {
         // new message creation has finished so make an FS type message
         CFSMailMessage* newMessage = NULL;
+        //<qmail> TRAP removed
+        TMsvId msgId;
         
-        TMsvId msgId = TMsvId();
-        TRAPD( err, msgId = GetIdFromProgressL( iOperation->FinalProgress() ) );
+        msgId = GetIdFromProgressL( iOperation->FinalProgress() );
             
-        if( err == KErrNone )
-            {
-            newMessage = iSmtpService->CreateFSMessageAndSetFlagsL( 
-                    msgId, iOriginalMessageId, iFSMailboxId.Id(), ETrue );
-            }
-        
+        newMessage = iSmtpService.CreateFSMessageAndSetFlagsL( 
+                msgId, iOriginalMessageId, iFSMailboxId.Id(), ETrue );
+        //</qmail>
         // relay the created message (observer takes ownership)
         SignalFSObserver( iStatus.Int(), newMessage );        
         }
@@ -134,7 +137,7 @@
     FUNC_LOG;
     delete iOperation;
     iOperation = NULL;
-    
+    //<qmail> commented parameter removed
     // Start a new operation, execution continues in RunL 
     // once the operation has finished.
     iOperation = CImEmailOperation::CreateForwardL(
@@ -145,8 +148,8 @@
             iPartList, 
             KIpsPlgForwardSubjectFormat,
             KMsvEmailTypeListMHTMLMessage,
-            //0,
             KUidMsgTypeSMTP);
+    //</qmail>
     }
 
 //  End of File
--- a/ipsservices/ipssosplugin/src/ipsplgcreatemessageoperation.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgcreatemessageoperation.cpp	Fri May 14 15:41:10 2010 +0300
@@ -18,11 +18,10 @@
 // <qmail>
 
 // INCLUDE FILES
-
 #include "emailtrace.h"
 #include "ipsplgheaders.h"
 
-// LOCAL CONSTANTS AND MACROS
+//<qmail> removed
 
 // ================= MEMBER FUNCTIONS =======================
 
@@ -31,11 +30,12 @@
 // ----------------------------------------------------------------------------
 //
 // <qmail> priority parameter has been removed
+//<qmail> iBlank removed
+//<qmail> aSmtpServiceId removed
 CIpsPlgCreateMessageOperation::CIpsPlgCreateMessageOperation(
-    CIpsPlgSmtpService* aSmtpService,
+    CIpsPlgSmtpService& aSmtpService,
     CMsvSession& aMsvSession,
     TRequestStatus& aObserverRequestStatus,
-    TMsvId aSmtpServiceId, 
     TMsvPartList aPartList,
     TFSMailMsgId aMailBoxId,
     MFSMailRequestObserver& aOperationObserver,
@@ -47,14 +47,13 @@
         aRequestId,
         aMailBoxId),
     iSmtpService(aSmtpService),
-    iSmtpServiceId(aSmtpServiceId),
     iPartList(aPartList),
     iOperationObserver(aOperationObserver)
     {
     FUNC_LOG;
     CActiveScheduler::Add( this );
     }
-
+//</qmail>
 // ----------------------------------------------------------------------------
 // CIpsPlgCreateMessageOperation::ConstructL
 // ----------------------------------------------------------------------------
@@ -70,11 +69,12 @@
 // CIpsPlgCreateMessageOperation::NewL
 // ----------------------------------------------------------------------------
 //
+//<qmail> aSmtpServiceId removed
+//<qmail> aSmtpService changed to reference
 CIpsPlgCreateMessageOperation* CIpsPlgCreateMessageOperation::NewL(
-    CIpsPlgSmtpService* aSmtpService,
+    CIpsPlgSmtpService& aSmtpService,
     CMsvSession& aMsvSession,
     TRequestStatus& aObserverRequestStatus,
-    TMsvId aSmtpServiceId, 
     TMsvPartList aPartList,
     TFSMailMsgId aMailBoxId,
     MFSMailRequestObserver& aOperationObserver,
@@ -83,14 +83,14 @@
     FUNC_LOG;
     CIpsPlgCreateMessageOperation* self =
         new (ELeave) CIpsPlgCreateMessageOperation(
-            aSmtpService, aMsvSession, aObserverRequestStatus, aSmtpServiceId,
+            aSmtpService, aMsvSession, aObserverRequestStatus,
             aPartList, aMailBoxId, aOperationObserver, aRequestId );
     CleanupStack::PushL( self );
     self->ConstructL();
     CleanupStack::Pop( self ); 
     return self;
     }
-
+//</qmail>
 // ----------------------------------------------------------------------------
 // CIpsPlgCreateMessageOperation::~CIpsPlgCreateMessageOperation
 // ----------------------------------------------------------------------------
@@ -134,16 +134,14 @@
         {
         // new message creation has finished so make an FS type message
         CFSMailMessage* newMessage = NULL;
+        //<qmail> removed trap, handled in RunError
+        TMsvId msgId;
         
-        TMsvId msgId = TMsvId();
-        TRAPD( err, msgId = GetIdFromProgressL( iOperation->FinalProgress() ) );
+        msgId = GetIdFromProgressL( iOperation->FinalProgress() );
             
-        if( err == KErrNone )
-            {
-            newMessage = iSmtpService->CreateFSMessageAndSetFlagsL( 
-                    msgId, KErrNotFound, iFSMailboxId.Id() );
-            }
-        
+        newMessage = iSmtpService.CreateFSMessageAndSetFlagsL( 
+                msgId, KErrNotFound, iFSMailboxId.Id() );
+        //</qmail>
         // relay the created message (observer takes ownership)
         SignalFSObserver( iStatus.Int(), newMessage );        
         }
@@ -152,7 +150,7 @@
     TRequestStatus* status = &iObserverRequestStatus;
     User::RequestComplete( status, iStatus.Int() );
     }
-
+//<qmail> 
 // ----------------------------------------------------------------------------
 // CIpsPlgCreateMessageOperation::RunError()
 // ----------------------------------------------------------------------------
@@ -166,7 +164,8 @@
     User::RequestComplete( status, aError );
     return KErrNone; // RunError must return KErrNone to active sheduler.
     }
-
+//</qmail>
+//<qmail> function description updated
 // ----------------------------------------------------------------------------
 // CIpsPlgCreateMessageOperation::GetIdFromProgressL
 // ----------------------------------------------------------------------------
@@ -174,7 +173,7 @@
 TMsvId CIpsPlgCreateMessageOperation::GetIdFromProgressL( const TDesC8& aProg )
     {
     FUNC_LOG;
-    // Taken from symbian os help example code
+    //<qmail> comment removed
     // Create and initialise a temporary TPckg object that 
     // can hold a message Id.
     TMsvId msgId;
@@ -192,9 +191,9 @@
         }
     return msgId;
     }
-
+//<qmail> function description updated
 // ----------------------------------------------------------------------------
-// CIpsPlgCreateMessageOperation::ProgressL
+// CIpsPlgCreateMessageOperation::SignalFSObserver
 // ----------------------------------------------------------------------------
 //
 void CIpsPlgCreateMessageOperation::SignalFSObserver(
@@ -232,8 +231,9 @@
             return iOperation->ProgressL();
             }
         }
-
+    //<qmail>
     return KNullDesC8;
+    //</qmail>
     }
 
 // ---------------------------------------------------------------------------
@@ -284,20 +284,28 @@
 void CIpsPlgCreateMessageOperation::StartMessageCreationL()
     {
     FUNC_LOG;
+	//<qmail>
+    TMsvId service;
+    TMsvEntry mboxEntry;
+        
     delete iOperation;
     iOperation = NULL;
-    
+        
+    User::LeaveIfError(
+        iMsvSession.GetEntry( iFSMailboxId.Id(), service, mboxEntry ) );
+	//</qmail>	
+    //<qmail> removed useless parameter
     // Start a new operation, execution continues in RunL 
     // once the operation has finished.
     iOperation = CImEmailOperation::CreateNewL(
         iStatus, 
         iMsvSession,
         KMsvDraftEntryId,
-        iSmtpServiceId, 
+        mboxEntry.iRelatedId, // SMTP service id
         iPartList, 
         KMsvEmailTypeListMHTMLMessage,
-        //0,
         KUidMsgTypeSMTP);
+    //</qmail>
     }
 
 
--- a/ipsservices/ipssosplugin/src/ipsplgcreatereplymessageoperation.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgcreatereplymessageoperation.cpp	Fri May 14 15:41:10 2010 +0300
@@ -18,11 +18,10 @@
 // <qmail>
 
 // INCLUDE FILES
-
 #include "emailtrace.h"
 #include "ipsplgheaders.h"
 
-// LOCAL CONSTANTS AND MACROS
+// <qmail> removed description
 
 // ================= MEMBER FUNCTIONS =======================
 
@@ -30,8 +29,9 @@
 // CIpsPlgCreateReplyMessageOperation::CIpsPlgCreateReplyMessageOperation
 // ----------------------------------------------------------------------------
 //
+//<qmail> aSmtpService to reference
 CIpsPlgCreateReplyMessageOperation::CIpsPlgCreateReplyMessageOperation(
-    CIpsPlgSmtpService* aSmtpService,
+    CIpsPlgSmtpService& aSmtpService,
     CMsvSession& aMsvSession,
     TRequestStatus& aObserverRequestStatus,
     TMsvPartList aPartList,
@@ -44,7 +44,6 @@
         aSmtpService,
         aMsvSession,
         aObserverRequestStatus,
-        KMsvNullIndexEntryId,
         aPartList,
         aMailBoxId,
         aOperationObserver,
@@ -53,14 +52,15 @@
     {
     FUNC_LOG;
     }
-
+//</qmail>
 
 // ----------------------------------------------------------------------------
 // CIpsPlgCreateReplyMessageOperation::NewL
 // ----------------------------------------------------------------------------
 //
+//<qmail> aSmtpService to reference
 CIpsPlgCreateReplyMessageOperation* CIpsPlgCreateReplyMessageOperation::NewL(
-    CIpsPlgSmtpService* aSmtpService,
+    CIpsPlgSmtpService& aSmtpService,
     CMsvSession& aMsvSession,
     TRequestStatus& aObserverRequestStatus,
     TMsvPartList aPartList,
@@ -81,11 +81,11 @@
             aOperationObserver, 
             aRequestId );
     CleanupStack::PushL( self );
-    self->ConstructL();
+    self->ConstructL(); // Use base class constructor
     CleanupStack::Pop( self ); 
     return self;
     }
-
+//</qmail>
 // ----------------------------------------------------------------------------
 // CIpsPlgCreateReplyMessageOperation::~CIpsPlgCreateReplyMessageOperation
 // ----------------------------------------------------------------------------
@@ -106,113 +106,62 @@
         {
         CFSMailMessage* newMessage = NULL;
         
+        // <qmail> removed TRAP 
         // new message creation has finished and we have an id...
-        TMsvId msgId = TMsvId();
-        TRAPD( err, msgId = GetIdFromProgressL( iOperation->FinalProgress() ) );
-            
-        if( err == KErrNone )
-            {
-            //  ...so we can create an FS type message
-            newMessage = iSmtpService->CreateFSMessageAndSetFlagsL( 
-                    msgId, iOriginalMessageId, iFSMailboxId.Id() );
-            CleanupStack::PushL( newMessage ); // ***
+        TMsvId msgId;
+        msgId = GetIdFromProgressL( iOperation->FinalProgress() );
+        //</qmail>
+        
+		//<qmail> 
+        //  ...so we can create an FS type message
+        newMessage = iSmtpService.CreateFSMessageAndSetFlagsL( 
+                msgId, iOriginalMessageId, iFSMailboxId.Id() );
+        CleanupStack::PushL( newMessage );
+    
+        // dig out new reply message's header
+        CMsvEntry* cEntry = iMsvSession.GetEntryL( msgId );
+        CleanupStack::PushL( cEntry );
+        CMsvStore* store = cEntry->ReadStoreL();
+        CleanupStack::PushL( store );
+        if( store->IsPresentL( KUidMsgFileIMailHeader ) == EFalse )
+             {
+             User::Leave(KErrCorrupt);
+             }
+        CImHeader* header = CImHeader::NewLC();
+        header->RestoreL( *store );
         
-            // dig out new reply message's header
-            CMsvEntry* cEntry = iMsvSession.GetEntryL( msgId );
-            CleanupStack::PushL( cEntry ); // ***
-            CMsvStore* store = cEntry->ReadStoreL();
-            CleanupStack::PushL( store ); // ***
-            if( store->IsPresentL( KUidMsgFileIMailHeader ) == EFalse )
-                 {
-                 User::Leave(KErrCorrupt);
-                 }
-            CImHeader* header = CImHeader::NewLC(); // ***
-            header->RestoreL( *store );
-            
-            // Start handling recipients
-            HBufC* emailAddr( NULL );
-            CFSMailAddress* fsAddr( NULL );
-            
-            // copy to recipients            
-            TInt toRecipientCount( header->ToRecipients().Count() );
-            for( TInt i = 0; i < toRecipientCount; i++ )
-                {
-                emailAddr = header->ToRecipients()[i].AllocLC(); // ***
-                fsAddr = CFSMailAddress::NewLC(); // ***
-                fsAddr->SetEmailAddress( *emailAddr ); // Copy created
-                newMessage->AppendToRecipient( fsAddr ); // No copy
-                CleanupStack::Pop( fsAddr ); // fsAddr belong now to fsMsg
-                CleanupStack::PopAndDestroy( emailAddr ); // emailAddr not used
-                }
+        // Start handling recipients
+        HBufC* emailAddr( NULL );
+        CFSMailAddress* fsAddr( NULL );
+        
+        // copy to recipients            
+        TInt toRecipientCount( header->ToRecipients().Count() );
+        for( TInt i = 0; i < toRecipientCount; i++ )
+            {
+            emailAddr = header->ToRecipients()[i].AllocLC();
+            fsAddr = CFSMailAddress::NewLC();
+            fsAddr->SetEmailAddress( *emailAddr ); // Copy created
+            newMessage->AppendToRecipient( fsAddr ); // No copy
+            CleanupStack::Pop( fsAddr ); // fsAddr belong now to fsMsg
+            CleanupStack::PopAndDestroy( emailAddr ); // emailAddr not used
+            }
 
-            // get additional recipients (reply all case)
-            if( iPartList & KMsvMessagePartRecipient )
-                {
-                // check if CC recipient read from header was present in To field
-                // of original message. If so, copy it into To recipients.
-                // 
-                CMsvEntry* tmpEntry = iMsvSession.GetEntryL( iOriginalMessageId );
-                CleanupStack::PushL( tmpEntry ); // ***
-                CMsvStore* tmpStore = tmpEntry->ReadStoreL();
-                CleanupStack::PushL( tmpStore ); // ***
-                if( tmpStore->IsPresentL( KUidMsgFileIMailHeader ) )
-                    {
-                    CImHeader* tmpHeader = CImHeader::NewLC(); // ***
-                    tmpHeader->RestoreL( *tmpStore );
+        // get additional recipients (reply all case)
+        if( iPartList & KMsvMessagePartRecipient )
+            {
+            // <qmail> code moved to own function
+            RecipientsCallToOrderL( header, newMessage );
+            // </qmail>
+            }
                     
-                    TInt originalToRecipientsCount = tmpHeader->ToRecipients().Count(); 
-                    TBool present = EFalse;
-                    for( TInt i = 0; i < header->CcRecipients().Count(); i++ )
-                        {
-                        emailAddr = header->CcRecipients()[i].AllocLC(); // ***
-                        fsAddr = CFSMailAddress::NewLC(); // ***
-                        fsAddr->SetEmailAddress( *emailAddr ); // Copy created
-                        
-                        present = EFalse;
-                        for( TInt j = 0; j < originalToRecipientsCount; j++ )
-                            {
-                            if( emailAddr->Find( tmpHeader->ToRecipients()[j]) != KErrNotFound )
-                                {
-                                present = ETrue;
-                                break;
-                                }
-                            }
-                        
-                        if( present )
-                            {
-                            newMessage->AppendToRecipient( fsAddr ); // No copy
-                            }
-                        else
-                            {
-                            newMessage->AppendCCRecipient( fsAddr ); // No copy
-                            }
-                        
-                        CleanupStack::Pop( fsAddr ); // fsAddr belong now to fsMsg
-                        CleanupStack::PopAndDestroy( emailAddr ); // emailAddr not used
-                        }
-                    CleanupStack::PopAndDestroy( tmpHeader );
-                    }
-                CleanupStack::PopAndDestroy( 2, tmpEntry );
-                
-                // copy bcc recipients
-                for( TInt i = 0; i < header->BccRecipients().Count(); i++ )
-                    {
-                    emailAddr = header->BccRecipients()[i].AllocLC(); // ***
-                    fsAddr = CFSMailAddress::NewLC(); // ***
-                    fsAddr->SetEmailAddress( *emailAddr ); // Copy created
-                    newMessage->AppendBCCRecipient( fsAddr ); // No copy
-                    CleanupStack::Pop( fsAddr ); // fsAddr belong now to fsMsg
-                    CleanupStack::PopAndDestroy( emailAddr ); // emailAddr not used
-                    }
-                }
-                        
-            CleanupStack::PopAndDestroy( 3, cEntry ); // header, store, cEntry
-            CleanupStack::Pop( newMessage ); // fsMsg is given to client
-            
-            // save the added recipients to the message
-            newMessage->SaveMessageL();
-            }
+        CleanupStack::PopAndDestroy( 3, cEntry ); // header, store, cEntry
+        CleanupStack::Pop( newMessage ); // fsMsg is given to client
         
+        // save the added recipients to the message
+        newMessage->SaveMessageL();
+        
+        // <qmail> removed bracket
+    	//</qmail>
         // relay the created message (observer takes ownership)
         SignalFSObserver( iStatus.Int(), newMessage );        
         }
@@ -232,6 +181,7 @@
     delete iOperation;
     iOperation = NULL;
     
+    // <qmail> removed useless parameter
     // Start a new operation, execution continues in RunL 
     // once the operation has finished.
     iOperation = CImEmailOperation::CreateReplyL(
@@ -242,10 +192,80 @@
             iPartList, 
             KIpsPlgReplySubjectFormat,
             KMsvEmailTypeListMHTMLMessage,
-            //0,
             KUidMsgTypeSMTP);
+    // </qmail>
     }
-
+//<qmail>
+// ----------------------------------------------------------------------------
+// CIpsPlgCreateReplyMessageOperation::RecipientsCallToOrderL
+// ----------------------------------------------------------------------------
+//
+void CIpsPlgCreateReplyMessageOperation::RecipientsCallToOrderL( 
+        CImHeader* aHeader,
+        CFSMailMessage* aNewMessage
+        )
+    {
+    // check if CC recipient read from header was present in To field
+    // of original message. If so, copy it into To recipients.
+    // 
+    HBufC* emailAddr( NULL );
+    CFSMailAddress* fsAddr( NULL );
+    
+    CMsvEntry* tmpEntry = iMsvSession.GetEntryL( iOriginalMessageId );
+    CleanupStack::PushL( tmpEntry );
+    CMsvStore* tmpStore = tmpEntry->ReadStoreL();
+    CleanupStack::PushL( tmpStore );
+    if( tmpStore->IsPresentL( KUidMsgFileIMailHeader ) )
+        {
+        CImHeader* tmpHeader = CImHeader::NewLC();
+        tmpHeader->RestoreL( *tmpStore );
+       
+        TInt originalToRecipientsCount = tmpHeader->ToRecipients().Count(); 
+        TBool present = EFalse;
+        for( TInt i = 0; i < aHeader->CcRecipients().Count(); i++ )
+            {
+            emailAddr = aHeader->CcRecipients()[i].AllocLC();
+            fsAddr = CFSMailAddress::NewLC();
+            fsAddr->SetEmailAddress( *emailAddr ); // Copy created
+           
+            present = EFalse;
+            for( TInt j = 0; j < originalToRecipientsCount; j++ )
+                {
+                if( emailAddr->Find( tmpHeader->ToRecipients()[j]) != KErrNotFound )
+                    {
+                    present = ETrue;
+                    break;
+                    }
+                }
+           
+            if( present )
+                {
+                aNewMessage->AppendToRecipient( fsAddr ); // No copy
+                }
+            else
+                {
+                aNewMessage->AppendCCRecipient( fsAddr ); // No copy
+                }
+           
+            CleanupStack::Pop( fsAddr ); // fsAddr belong now to fsMsg
+            CleanupStack::PopAndDestroy( emailAddr ); // emailAddr not used
+            }
+        CleanupStack::PopAndDestroy( tmpHeader );
+        }
+    CleanupStack::PopAndDestroy( 2, tmpEntry );
+   
+    // copy bcc recipients
+    for( TInt i = 0; i < aHeader->BccRecipients().Count(); i++ )
+        {
+        emailAddr = aHeader->BccRecipients()[i].AllocLC();
+        fsAddr = CFSMailAddress::NewLC();
+        fsAddr->SetEmailAddress( *emailAddr ); // Copy created
+        aNewMessage->AppendBCCRecipient( fsAddr ); // No copy
+        CleanupStack::Pop( fsAddr ); // fsAddr belong now to fsMsg
+        CleanupStack::PopAndDestroy( emailAddr ); // emailAddr not used
+        }
+    }
+//</qmail>
 //  End of File
 
 // </qmail>
--- a/ipsservices/ipssosplugin/src/ipsplgdeletelocal.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgdeletelocal.cpp	Fri May 14 15:41:10 2010 +0300
@@ -42,11 +42,20 @@
 // ----------------------------------------------------------------------------
 // 
 void CIpsPlgDeleteLocal::ConstructL(
-    CMsvEntrySelection& aMessageSelection )
+    CMsvEntrySelection* aMessageSelection )
     {
     FUNC_LOG;
+    //<qmail>
+    // Start cache manager to prune messages
+    //</qmail>
     CImCacheManager::ConstructL();
-    iMessageSelection = aMessageSelection.CopyL();
+    //<qmail>
+    iMessageSelection = new (ELeave) CMsvEntrySelection();
+    for ( TInt i=0; i<aMessageSelection->Count(); i++ )
+        {
+        iMessageSelection->AppendL( aMessageSelection->At(i) );
+        }
+    //</qmail>
     StartL( *iMessageSelection, iObserverRequestStatus );
     }
 
@@ -55,7 +64,7 @@
 // ----------------------------------------------------------------------------
 // 
 CIpsPlgDeleteLocal* CIpsPlgDeleteLocal::NewL(
-    CMsvEntrySelection& aMessageSelection,
+    CMsvEntrySelection* aMessageSelection,
     CMsvSession& aMsvSession,
     TRequestStatus& aObserverRequestStatus)
     {
@@ -89,11 +98,13 @@
 TBool CIpsPlgDeleteLocal::Filter() const
     {
     FUNC_LOG;
-    if ( iMessageSelection->Find( iCurrentEntry->Entry().Id() )
-        > KErrNotFound )
+    //<qmail> 
+    if ( iMessageSelection->Find( 
+            iCurrentEntry->Entry().Id() ) == KErrNone )
         {
         return ETrue;
         }
+    //</qmail>
     return EFalse;
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ipsservices/ipssosplugin/src/ipsplgdeleteoperation.cpp	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,342 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+//<qmail>
+* Description: This file implements class CIpsPlgDeleteOperation.
+//</qmail>
+*
+*/
+
+
+
+// INCLUDE FILES
+
+#include "emailtrace.h"
+#include "ipsplgheaders.h"
+
+//<qmail> comment removed
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ----------------------------------------------------------------------------
+// CIpsPlgDeleteOperation::CIpsPlgDeleteOperation
+// ----------------------------------------------------------------------------
+//
+//<qmail>
+CIpsPlgDeleteOperation::CIpsPlgDeleteOperation(
+    CMsvSession& aMsvSession,
+    TRequestStatus& aObserverRequestStatus )
+    :
+    CMsvOperation( 
+        aMsvSession, 
+        CActive::EPriorityStandard, 
+        aObserverRequestStatus),
+    iState( ESetFlags ) // <qmail>
+    //</qmail> iBlank removed    
+    {
+    FUNC_LOG;
+    CActiveScheduler::Add(this);
+    }
+//</qmail>
+
+
+// ----------------------------------------------------------------------------
+// CIpsPlgDeleteOperation::ConstructL
+// ----------------------------------------------------------------------------
+//
+// <qmail>
+void CIpsPlgDeleteOperation::ConstructL(
+    CMsvEntrySelection* aEntriesToDelete ) //<qmail> param name changed
+    {
+    FUNC_LOG;
+    //<qmail>
+    iEntrySelection = new (ELeave) CMsvEntrySelection();
+    
+    for ( TInt i=0; i<aEntriesToDelete->Count(); i++ )
+        {
+        iEntrySelection->AppendL( aEntriesToDelete->At(i) );
+        }
+    
+    if ( !iEntrySelection->Count() )
+        {
+        User::Leave( KErrNotSupported );
+        }
+    //</qmail>
+
+    //<qmail>
+    // Messages will be deleted from one specific folder at a time
+    TMsvId serviceId;
+    TMsvEntry entry;
+    User::LeaveIfError(
+        iMsvSession.GetEntry(
+            (*iEntrySelection)[0], serviceId, entry ) );
+    iEntry = CMsvEntry::NewL(
+        iMsvSession, entry.Parent(), TMsvSelectionOrdering() );
+    
+    // For CMsvOperation
+    iMtm = iEntry->Entry().iMtm;
+    //</qmail>
+    iStatus = KRequestPending;
+
+    // It is known that there is at least one entry -> no return value check
+    SetNextLocallyDeletedFlagL();
+
+    SetActive();
+    }
+// </qmail>
+
+// ----------------------------------------------------------------------------
+// CIpsPlgDeleteOperation::NewL
+// ----------------------------------------------------------------------------
+//
+CIpsPlgDeleteOperation* CIpsPlgDeleteOperation::NewL(
+    CMsvSession& aMsvSession,
+    TRequestStatus& aObserverRequestStatus,
+    CMsvEntrySelection* aEntriesToDelete ) //<qmail> param name changed
+    {
+    FUNC_LOG;
+    CIpsPlgDeleteOperation* self=new (ELeave) CIpsPlgDeleteOperation(
+        aMsvSession, aObserverRequestStatus );
+    CleanupStack::PushL(self);
+    //<qmail>
+    self->ConstructL( aEntriesToDelete );
+    //</qmail>
+    CleanupStack::Pop( self ); 
+    return self;
+    }
+
+// ----------------------------------------------------------------------------
+// CIpsPlgDeleteOperation::~CIpsPlgDeleteOperation
+// ----------------------------------------------------------------------------
+//
+CIpsPlgDeleteOperation::~CIpsPlgDeleteOperation()
+    {
+    FUNC_LOG;
+    Cancel();
+
+    delete iOperation;
+    delete iEntry;
+    delete iEntrySelection;
+	// <qmail>    
+    delete iSetFlagEntry;
+	// </qmail>    
+    }
+
+// ----------------------------------------------------------------------------
+// CIpsPlgDeleteOperation::DoCancel
+// ----------------------------------------------------------------------------
+//
+void CIpsPlgDeleteOperation::DoCancel()
+    {
+    FUNC_LOG;
+    if (iOperation)
+        {
+        iOperation->Cancel();
+        }
+    TRequestStatus* status = &iObserverRequestStatus;
+    if ( status && status->Int() == KRequestPending )
+        {
+        User::RequestComplete(status, iStatus.Int());
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CIpsPlgDeleteOperation::RunL
+// ----------------------------------------------------------------------------
+//
+void CIpsPlgDeleteOperation::RunL()
+    {
+    FUNC_LOG;
+    // Make first a check, that nothing has failed
+    if ( iStatus.Int() != KErrNone )
+        {
+        // something failed, just complete
+        TRequestStatus* status = &iObserverRequestStatus;
+        User::RequestComplete(status, iStatus.Int());
+        return;
+        }
+
+	// <qmail>    
+    if ( iState == ESetFlags )
+    //</qmail>    
+        {
+        // cleanup is handled by SetNextLocallyDeletedFlagL
+        TBool ret = EFalse;
+        
+        TRAPD( err, ret = SetNextLocallyDeletedFlagL() );
+        
+        if ( err != KErrNone )
+            {
+            TRequestStatus* status = &iObserverRequestStatus;
+            User::RequestComplete(status, iStatus.Int());
+            }
+        else if ( ret )
+            {
+            SetActive();
+            }
+        else
+            { // setting the flags is ready, start local deletion
+            StartNextDeleteLocally();
+            }
+        }
+    //<qmail>
+    else if ( iState == ELocally )
+    //</qmail>
+        {
+        // local delete completed, start deleting from server
+        StartDeleteFromServer();
+        }
+    else
+        {
+        // nothing left to process, so complete the observer
+        TRequestStatus* status = &iObserverRequestStatus;
+        User::RequestComplete(status, iStatus.Int());
+        }
+    // </qmail>    
+	}
+
+// ----------------------------------------------------------------------------
+// CIpsPlgDeleteOperation::ProgressL
+// ----------------------------------------------------------------------------
+//
+//<qmail>
+const TDesC8& CIpsPlgDeleteOperation::ProgressL()
+    {
+    FUNC_LOG;
+    // Make sure that operation is active
+    if ( IsActive() )
+        {
+        // Get progress
+        if ( iOperation )
+            {
+            return iOperation->ProgressL();
+            }
+        }
+    //<qmail>
+    return KNullDesC8;
+    //</qmail>
+    }
+//</qmail>
+// ----------------------------------------------------------------------------
+// CIpsPlgDeleteOperation::StartNextDeleteLocally
+// ----------------------------------------------------------------------------
+//
+void CIpsPlgDeleteOperation::StartNextDeleteLocally()
+    {
+    //<qmail>
+    FUNC_LOG;
+    iState = ELocally;
+    //</qmail>
+    iStatus = KRequestPending;
+    
+    TRAPD( err, MakeNextDeleteLocallyL() );
+    SetActive();
+    // if error then complete this pass with the error code
+    if ( err )
+        {
+        TRequestStatus* status = &iStatus;
+        User::RequestComplete(status, err);
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CIpsPlgDeleteOperation::MakeNextDeleteLocallyL
+// ----------------------------------------------------------------------------
+//
+void CIpsPlgDeleteOperation::MakeNextDeleteLocallyL()
+    {
+    FUNC_LOG;
+    delete iOperation;
+    iOperation = NULL;
+    iOperation = CIpsPlgDeleteLocal::NewL(
+        iEntrySelection, iMsvSession, iStatus );
+    }
+
+// ----------------------------------------------------------------------------
+// CIpsPlgDeleteOperation::StartDeleteFromServer
+// ----------------------------------------------------------------------------
+//
+void CIpsPlgDeleteOperation::StartDeleteFromServer()
+    {
+    FUNC_LOG;
+    //<qmail>
+    iState = EFromServer;
+    //</qmail>
+    iStatus = KRequestPending;
+    TRAPD( err, MakeDeleteFromServerL() );
+
+    SetActive();
+    // if error then complete this pass with the error code
+    if ( err )
+        {
+        TRequestStatus* status = &iStatus;
+        User::RequestComplete( status, err );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// CIpsPlgDeleteOperation::MakeDeleteFromServerL
+// ----------------------------------------------------------------------------
+//
+void CIpsPlgDeleteOperation::MakeDeleteFromServerL()
+    {
+    FUNC_LOG;
+    delete iOperation;
+    iOperation = NULL;
+    iOperation = iEntry->DeleteL( *iEntrySelection, iStatus );
+    }
+
+
+// <qmail>    
+// ----------------------------------------------------------------------------
+// CIpsPlgDeleteOperation::SetNextLocallyDeletedFlagL
+// ----------------------------------------------------------------------------
+//
+TBool CIpsPlgDeleteOperation::SetNextLocallyDeletedFlagL()
+    {
+    FUNC_LOG;
+    
+    delete iOperation;
+    iOperation = NULL;
+    
+    delete iSetFlagEntry;
+    iSetFlagEntry = NULL;
+
+    TBool ret = EFalse;
+    //<qmail>
+    if ( iSetFlagIndex < iEntrySelection->Count() )
+    //</qmail>    
+        {
+        TMsvId entryId = ( *iEntrySelection )[ iSetFlagIndex++ ];
+        
+        iSetFlagEntry = CMsvEntry::NewL( 
+            iMsvSession, entryId, TMsvSelectionOrdering() );
+        
+        TMsvEntry tEntry = iSetFlagEntry->Entry();
+
+        // Sets bit 32 of iMtmData1, used when msg deleted in Offline
+        // and status hasn't updated to server (client entry still exists)
+        tEntry.SetLocallyDeleted( ETrue );
+
+        iOperation = iSetFlagEntry->ChangeL( tEntry, iStatus );
+        
+        ret = ETrue;
+        }
+    
+    return ret;
+    }
+// </qmail>    
+
+//  End of File
+
+
--- a/ipsservices/ipssosplugin/src/ipsplgdeleteremote.cpp	Mon May 03 12:23:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,314 +0,0 @@
-/*
-* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This file implements class CIpsPlgDeleteRemote.
-*
-*/
-
-
-
-// INCLUDE FILES
-
-#include "emailtrace.h"
-#include "ipsplgheaders.h"
-
-// LOCAL CONSTANTS AND MACROS
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ----------------------------------------------------------------------------
-// CIpsPlgDeleteRemote::CIpsPlgDeleteRemote
-// ----------------------------------------------------------------------------
-//
-CIpsPlgDeleteRemote::CIpsPlgDeleteRemote(
-    CMsvSession& aMsvSession,
-    TRequestStatus& aObserverRequestStatus )
-    :
-    CMsvOperation( 
-        aMsvSession, 
-        CActive::EPriorityStandard, 
-        aObserverRequestStatus),
-        iBlank( KNullDesC8 )
-    {
-    FUNC_LOG;
-    CActiveScheduler::Add(this);
-    }
-
-
-// ----------------------------------------------------------------------------
-// CIpsPlgDeleteRemote::ConstructL
-// ----------------------------------------------------------------------------
-//
-void CIpsPlgDeleteRemote::ConstructL(
-    CMsvEntrySelection& aDeletedEntries )
-    {
-    FUNC_LOG;
-    iEntrySelection = aDeletedEntries.CopyL();
-    iEntryCount = iEntrySelection->Count();
-    if ( iEntryCount == 0 )
-        {
-        User::Leave( KErrNotSupported );
-        }
-
-    TMsvId serviceId;
-    TMsvEntry entry;
-    User::LeaveIfError(
-        iMsvSession.GetEntry(
-            (*iEntrySelection)[0], serviceId, entry ) );
-    iEntry = CMsvEntry::NewL(
-        iMsvSession, entry.Parent(), TMsvSelectionOrdering() );
-    iMtm = iEntry->Entry().iMtm;
-
-    iStatus=KRequestPending;
-
-	// <qmail>    
-    // It is known that there is at least one entry -> no return value check
-    SetNextLocallyDeletedFlagL();
-
-    SetActive();
-	// </qmail>    
-    }
-
-// ----------------------------------------------------------------------------
-// CIpsPlgDeleteRemote::NewL
-// ----------------------------------------------------------------------------
-//
-CIpsPlgDeleteRemote* CIpsPlgDeleteRemote::NewL(
-    CMsvSession& aMsvSession,
-    TRequestStatus& aObserverRequestStatus,
-    CMsvEntrySelection& aDeletedEntries )
-    {
-    FUNC_LOG;
-    CIpsPlgDeleteRemote* self=new (ELeave) CIpsPlgDeleteRemote(
-        aMsvSession, aObserverRequestStatus );
-    CleanupStack::PushL(self);
-    self->ConstructL( aDeletedEntries );
-    CleanupStack::Pop( self ); 
-    return self;
-    }
-
-// ----------------------------------------------------------------------------
-// CIpsPlgDeleteRemote::~CIpsPlgDeleteRemote
-// ----------------------------------------------------------------------------
-//
-CIpsPlgDeleteRemote::~CIpsPlgDeleteRemote()
-    {
-    FUNC_LOG;
-    Cancel();
-
-    delete iOperation;
-    delete iEntry;
-    delete iEntrySelection;
-	// <qmail>    
-    delete iSetFlagEntry;
-	// </qmail>    
-    }
-
-// ----------------------------------------------------------------------------
-// CIpsPlgDeleteRemote::DoCancel
-// ----------------------------------------------------------------------------
-//
-void CIpsPlgDeleteRemote::DoCancel()
-    {
-    FUNC_LOG;
-    if (iOperation)
-        {
-        iOperation->Cancel();
-        }
-    TRequestStatus* status = &iObserverRequestStatus;
-    if ( status && status->Int() == KRequestPending )
-        {
-        User::RequestComplete(status, iStatus.Int());
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CIpsPlgDeleteRemote::RunL
-// ----------------------------------------------------------------------------
-//
-void CIpsPlgDeleteRemote::RunL()
-    {
-    FUNC_LOG;
-    // Make first a check, that nothing has failed
-    if ( iStatus.Int() != KErrNone )
-        {
-        // something failed, just complete
-        TRequestStatus* status = &iObserverRequestStatus;
-        User::RequestComplete(status, iStatus.Int());
-        return;
-        }
-
-	// <qmail>    
-    if ( iState == EDeletingMessagesStateSetFlags )
-        {
-        // cleanup is handled by SetNextLocallyDeletedFlagL
-        TBool ret = EFalse;
-        
-        TRAPD( err, ret = SetNextLocallyDeletedFlagL() );
-        
-        if ( err != KErrNone )
-            {
-            TRequestStatus* status = &iObserverRequestStatus;
-            User::RequestComplete(status, iStatus.Int());
-            }
-        else if ( ret )
-            {
-            SetActive();
-            }
-        else
-            { // setting the flags is ready, start local deletion
-            StartNextDeleteLocally();
-            }
-        }
-    else if ( iState == EDeletingMessagesStateLocally )
-        {
-        // local delete completed, start deleting from server
-        StartDeleteFromServer();
-        }
-    else
-        {
-        // nothing left to process, so complete the observer
-        TRequestStatus* status = &iObserverRequestStatus;
-        User::RequestComplete(status, iStatus.Int());
-        }
-    // </qmail>    
-	}
-
-// ----------------------------------------------------------------------------
-// CIpsPlgDeleteRemote::ProgressL
-// ----------------------------------------------------------------------------
-//
-const TDesC8& CIpsPlgDeleteRemote::ProgressL()
-    {
-    FUNC_LOG;
-    // Make sure that operation is active
-    if ( IsActive() )
-        {
-        // Get progress
-        if ( iOperation )
-            {
-            return iOperation->ProgressL();
-            }
-        }
-
-    return iBlank;
-    }
-
-// ----------------------------------------------------------------------------
-// CIpsPlgDeleteRemote::StartNextDeleteLocally
-// ----------------------------------------------------------------------------
-//
-void CIpsPlgDeleteRemote::StartNextDeleteLocally()
-    {
-    FUNC_LOG;
-    iState = EDeletingMessagesStateLocally;
-    iStatus = KRequestPending;
-    
-    TRAPD( err, MakeNextDeleteLocallyL() );
-    SetActive();
-    // if error then complete this pass with the error code
-    if ( err )
-        {
-        TRequestStatus* status = &iStatus;
-        User::RequestComplete(status, err);
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CIpsPlgDeleteRemote::MakeNextDeleteLocallyL
-// ----------------------------------------------------------------------------
-//
-void CIpsPlgDeleteRemote::MakeNextDeleteLocallyL()
-    {
-    FUNC_LOG;
-    delete iOperation;
-    iOperation = NULL;
-    iOperation = CIpsPlgDeleteLocal::NewL(
-        *iEntrySelection, iMsvSession, iStatus );
-    }
-
-// ----------------------------------------------------------------------------
-// CIpsPlgDeleteRemote::StartDeleteFromServer
-// ----------------------------------------------------------------------------
-//
-void CIpsPlgDeleteRemote::StartDeleteFromServer()
-    {
-    FUNC_LOG;
-    iState = EDeletingMessagesStateFromServer;
-    iStatus = KRequestPending;
-    TRAPD( err, MakeDeleteFromServerL() );
-
-    SetActive();
-    // if error then complete this pass with the error code
-    if ( err )
-        {
-        TRequestStatus* status = &iStatus;
-        User::RequestComplete( status, err );
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CIpsPlgDeleteRemote::MakeDeleteFromServerL
-// ----------------------------------------------------------------------------
-//
-void CIpsPlgDeleteRemote::MakeDeleteFromServerL()
-    {
-    FUNC_LOG;
-    delete iOperation;
-    iOperation = NULL;
-    iOperation = iEntry->DeleteL( *iEntrySelection, iStatus );
-    }
-
-
-// <qmail>    
-// ----------------------------------------------------------------------------
-// CIpsPlgDeleteRemote::SetNextLocallyDeletedFlagL
-// ----------------------------------------------------------------------------
-//
-TBool CIpsPlgDeleteRemote::SetNextLocallyDeletedFlagL()
-    {
-    FUNC_LOG;
-    
-    delete iOperation;
-    iOperation = NULL;
-    
-    delete iSetFlagEntry;
-    iSetFlagEntry = NULL;
-
-    TBool ret = EFalse;
-    
-    if ( iSetFlagIndex < iEntryCount )
-        {
-        TMsvId entryId = ( *iEntrySelection )[ iSetFlagIndex++ ];
-        
-        iSetFlagEntry = CMsvEntry::NewL( 
-            iMsvSession, entryId, TMsvSelectionOrdering() );
-        
-        TMsvEntry tEntry = iSetFlagEntry->Entry();
-
-        // Sets bit 32 of iMtmData1, used when msg deleted in Offline
-        // and status hasn't updated to server (client entry still exists)
-        tEntry.SetLocallyDeleted( ETrue );
-
-        iOperation = iSetFlagEntry->ChangeL( tEntry, iStatus );
-        
-        ret = ETrue;
-        }
-    
-    return ret;
-    }
-// </qmail>    
-
-//  End of File
-
-
--- a/ipsservices/ipssosplugin/src/ipsplgdisconnectop.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgdisconnectop.cpp	Fri May 14 15:41:10 2010 +0300
@@ -23,7 +23,8 @@
 // ----------------------------------------------------------------------------
 // CIpsPlgDisconnectOp::NewL()
 // ----------------------------------------------------------------------------
-//
+// <qmail> aDoRemoveAfterDisconnect parameter removed
+// <qmail> MFSMailRequestObserver& changed to pointer
 CIpsPlgDisconnectOp* CIpsPlgDisconnectOp::NewL(
     CMsvSession& aMsvSession,
     TRequestStatus& aObserverRequestStatus,
@@ -34,7 +35,7 @@
     TInt aFSRequestId )
     {
     FUNC_LOG;
-    // <qmail> aDoRemoveAfterDisconnect removed
+// <qmail> aDoRemoveAfterDisconnect removed
     CIpsPlgDisconnectOp* op = new(ELeave) CIpsPlgDisconnectOp(
         aMsvSession,
         aObserverRequestStatus,
@@ -130,9 +131,11 @@
 void CIpsPlgDisconnectOp::DoRunL()
     {
     FUNC_LOG;
+// <qmail>
     if( Connected() )
         {        
         DoDisconnectL();
+// </qmail>
         }
     else
         {                
@@ -144,7 +147,8 @@
 // ----------------------------------------------------------------------------
 // CIpsPlgDisconnectOp::CIpsPlgDisconnectOp()
 // ----------------------------------------------------------------------------
-//
+// <qmail> aDoRemoveAfterDisconnect removed
+// <qmail> MFSMailRequestObserver& changed to pointer
 CIpsPlgDisconnectOp::CIpsPlgDisconnectOp(
     CMsvSession& aMsvSession,
     TRequestStatus& aObserverRequestStatus,
@@ -172,7 +176,9 @@
 void CIpsPlgDisconnectOp::ConstructL()
     {    
     FUNC_LOG;
+// <qmail> iDisconnected removed
     TMsvId service;
+    
     iMsvSession.GetEntry( iService, service, iTEntry );
     
     if ( iTEntry.iType.iUid == KUidMsvServiceEntryValue )
@@ -181,6 +187,7 @@
         }
     else
         {
+        //should we panic with own codes?
         User::Leave( KErrNotSupported );
         }
     
@@ -195,6 +202,8 @@
 void CIpsPlgDisconnectOp::DoDisconnectL()
     {
     FUNC_LOG;
+    iStatus = KRequestPending;
+    
     TInt cmd = (iTEntry.iMtm == KUidMsgTypePOP3) ? KPOP3MTMDisconnect : KIMAP4MTMDisconnect;
     InvokeClientMtmAsyncFunctionL( cmd, iService ); // <qmail> 1 param removed
     SetActive();
@@ -216,3 +225,5 @@
         return EIpsOpTypeImap4Disconnect;
         }
     }
+// </qmail>
+
--- a/ipsservices/ipssosplugin/src/ipsplgeventhandler.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgeventhandler.cpp	Fri May 14 15:41:10 2010 +0300
@@ -105,6 +105,7 @@
     iIPSSettingsObservers.ResetAndDestroy();
     iIPSSettingsObservers.Close();
     iPropertyObservers.Close();
+// <qmail> iConnOpCallbacks, iSettingsApi members removed
     iImapFolderIds.Close();
     }
 
@@ -127,11 +128,11 @@
 void CIpsPlgEventHandler::ConstructL( )
     {
     FUNC_LOG;
-    // <qmail>
+// <qmail>
     // commented out from qmail when extented settings 
     // cen rep not exist in environment
     //iCenRep = CRepository::NewL( KCRUidExtendedSettingsUid );
-    // </qmail>
+// </qmail>
     iPluginId = iBasePlugin.PluginId();
     RegisterPropertyObserverL( this );
     }
@@ -142,6 +143,7 @@
     {
     FUNC_LOG;
     iSession = aSession;
+// <qmail> iSettingsApi member removed
 
     // this collects all folderids to array from mailboxes that
     // have registered observers, this is need to do here because
@@ -245,7 +247,8 @@
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
-void CIpsPlgEventHandler::NotifyPropertyEventL( TIpsPlgPropertyEvent aEvent )
+void CIpsPlgEventHandler::NotifyPropertyEventL(
+        TIpsPlgPropertyEvent aEvent )
     {
     FUNC_LOG;
     INFO_1("pluginid == 0x%x", iPluginId);
@@ -523,6 +526,7 @@
     event.iArg3 = aArg3;
 
     RPointerArray<MFSMailEventObserver> observers;
+    CleanupClosePushL( observers );
 
     if( aEvent == TFSEventNewMailbox ||
         aEvent == TFSEventMailboxRenamed ||
@@ -543,14 +547,16 @@
         }
     for( TInt i = 0; i < observers.Count(); ++i )
         {
-        observers[i]->EventL(
+        // ignore leave so that other observers get event even if
+        // one leaves
+        TRAP_IGNORE(observers[i]->EventL(
             event.iEvent,
             event.iAccountId,
             event.iArg1,
             event.iArg2,
-            event.iArg3 );
+            event.iArg3 ));
         }
-    observers.Close();
+    CleanupStack::PopAndDestroy( &observers );
     }
 
 // ----------------------------------------------------------------------------
@@ -640,7 +646,19 @@
             SendDelayedEventL( event, mbox,
                 arg1, arg2 , arg3 );
             }
-        if ( type == KUidMsvMessageEntry )
+        
+        // discard any new mail events if message is marked as deleted in imap
+        const TMsvEmailEntry& emlEntry(tNew);
+        TBool isMarkedAsDeleted = EFalse;
+        if ( mbox.PluginId() == KIpsPlgImap4PluginUid
+                && (EDisconnectedDeleteOperation == emlEntry.DisconnectedOperation()
+                || emlEntry.DeletedIMAP4Flag()) )
+            {
+            isMarkedAsDeleted = ETrue;
+            }
+        
+        
+        if ( type == KUidMsvMessageEntry && !isMarkedAsDeleted )
             {
             TMsvId* parent = static_cast<TMsvId*>(aArg2);
             // NOTE: assumed that event contains only one new message
@@ -674,6 +692,7 @@
 
             // set entries array pointer
             RArray<TFSMailMsgId> array(KEventGranularity);
+            CleanupClosePushL( array );
 
             FillFSMessageArray(
                 array,
@@ -688,7 +707,7 @@
 
             SendDelayedEventL( event, mbox,
                 arg1, arg2 , arg3 );
-            array.Close();
+            CleanupStack::PopAndDestroy( &array );
             }
         else if ( type == KUidMsvFolderEntry )
             {
@@ -697,6 +716,7 @@
 
             // set entries array pointer
             RArray<TFSMailMsgId> array(1);
+            CleanupClosePushL( array );
             array.Append( SymId2FsId( tNew ) );
             arg1 = &array;
 
@@ -708,7 +728,7 @@
             SendDelayedEventL( event, mbox,
                 arg1, arg2 , arg3 );
 
-            array.Close();
+            CleanupStack::PopAndDestroy( &array );
 
             if( tNew.iMtm.iUid == KSenduiMtmImap4UidValue )
                 {
@@ -745,6 +765,7 @@
         TFSMailEvent event( TFSMailboxUnavailable );
 
         RArray<TFSMailMsgId> array(KEventGranularity);
+        CleanupClosePushL( array );
         FillFSMessageArray(
             array,
             static_cast<const CMsvEntrySelection*>(aArg1),
@@ -788,7 +809,7 @@
             arg2,
             arg3 );
 
-        array.Close();
+        CleanupStack::PopAndDestroy( &array );
         // set null to prevent later usage in framework side
         // causes kern exec 3 panic...
         arg1 = arg2 = arg3 = NULL;
@@ -886,9 +907,9 @@
             // message in remote folder (inbox)
             TFSMailMsgId mbox(iPluginId, tEntry.iServiceId );
             RArray<TFSMailMsgId> array( KEventGranularity );
+            CleanupClosePushL( array );
             TFSMailMsgId parentId( iPluginId, tEntry.Id() );
 
-
             if ( tEntry.iMtm.iUid == KSenduiMtmImap4UidValue )
                 {
                 isFolderId = MatchFolderIdFound( deletedId );
@@ -927,7 +948,7 @@
                     arg3 );
                 }
 
-            array.Close();
+            CleanupStack::PopAndDestroy( &array );
             }
         else if ( tEntry.iMtm.iUid == KSenduiMtmSmtpUidValue )
             {
@@ -970,6 +991,7 @@
                 }
 
             RArray<TFSMailMsgId> array(1);
+            CleanupClosePushL( array );
             array.Append( msg );
             arg1 = &array;
             arg2 = &parent;
@@ -980,7 +1002,7 @@
                 arg1,
                 arg2,
                 arg3 );
-            array.Close();
+            CleanupStack::PopAndDestroy( &array );
             }
         else
             {
@@ -1003,6 +1025,8 @@
     TAny* arg2=NULL;
     TAny* arg3=NULL;
 
+    TInt errorCode( KErrNone ); // <qmail>
+
     TUid uId;
     TMsvEntry tChanged;
     if ( !IsEventFromIpsSourceL( aArg1, uId, tChanged ) )
@@ -1019,6 +1043,7 @@
     TFSMailEvent event = static_cast<TFSMailEvent>( KErrNotFound );
 
     RArray<TFSMailMsgId> array(1);
+    CleanupClosePushL( array );
 
     if ( tChanged.iType == KUidMsvMessageEntry )
         {
@@ -1074,7 +1099,18 @@
             }
         else
             {
+            // <qmail> add error code
             event = TFSEventMailboxOffline;
+            const CMsvEntrySelection* selection = static_cast<CMsvEntrySelection*>( aArg1 );
+            TFSMailMsgId mailboxId( iPluginId, selection->At(0) );
+
+            if ( !(iBasePlugin.HasOperations( mailboxId )) && iBasePlugin.ActivityTimerL( mailboxId ).IsActive() )
+                {
+                // considering this disconnection event as unexpected
+                errorCode = KErrDisconnected;
+                arg1 = &errorCode;
+                }
+            // </qmail>
             }
         }
     else if( IsAccountNameChangeL( aArg1, aArg2 ) )
@@ -1108,7 +1144,7 @@
         SendDelayedEventL( event,
             mbox, arg1, arg2, arg3 );
         }
-    array.Close();
+    CleanupStack::PopAndDestroy( &array );
     // set null to prevent later usage in framework side
     // causes kern exec 3 panic...
     arg1 = arg2 = arg3 = NULL;
@@ -1318,14 +1354,14 @@
         }
     else
         {
-        // <qmail>
+// <qmail>
         // commented out from qmail when extented settings 
         // cen rep not exist in environment
         /*CIpsPlgSettingsObserver* obs =
             CIpsPlgSettingsObserver::NewL( aAccount, *iCenRep, *this );
         obs->SetKeyAndActivateL( aSettingKey, observers );
         iIPSSettingsObservers.AppendL( obs );*/
-        // </qmail>
+// </qmail>
         }
     observers.Close();
     }
@@ -1520,6 +1556,7 @@
 TSSMailSyncState CIpsPlgEventHandler::ConvertCompletionCode( TInt aCompletionCode )
     {
     FUNC_LOG;
+    INFO_1("completioncode == %d", aCompletionCode);
     switch ( aCompletionCode )
         {
         case KErrNone:
@@ -1531,6 +1568,10 @@
         case KPop3InvalidLogin:
         case KPop3InvalidApopLogin:
             return PasswordNotVerified;
+        case -5120: // (DndTimedOut) wrong server name in settings
+        case KErrHostUnreach: // wrong port number
+            return ServerConnectionError;
+        case KErrTimedOut:
         default:
             return SyncError;
         }
@@ -1717,3 +1758,6 @@
 //    SendDelayedEventL( event, aMailboxId, &state, NULL , NULL );
 //    }
 // </qmail>
+
+// End of File
+
--- a/ipsservices/ipssosplugin/src/ipsplgimap4connectop.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgimap4connectop.cpp	Fri May 14 15:41:10 2010 +0300
@@ -25,10 +25,14 @@
 const TInt KIpsSetDataFullBodyOnly          = -3;
 // </qmail>
 
+// <qmail> KIpsPlgIpsConnPanic removed
+
 // ----------------------------------------------------------------------------
-// CIpsPlgImap4ConnOp::NewL()
+// CIpsPlgImap4ConnectOp::NewL()
 // ----------------------------------------------------------------------------
 // <qmail> priority parameter has been removed
+// <qmail> MFSMailRequestObserver& changed it to pointer
+// <qmail> aSignallingAllowed parameter has been removed
 CIpsPlgImap4ConnectOp* CIpsPlgImap4ConnectOp::NewL(
     CMsvSession& aMsvSession,
     TRequestStatus& aObserverRequestStatus,
@@ -62,6 +66,8 @@
 // CIpsPlgImap4ConnectOp::CIpsPlgImap4ConnectOp()
 // ----------------------------------------------------------------------------
 // <qmail> priority parameter has been removed
+// <qmail> MFSMailRequestObserver& changed it to pointer
+// <qmail> aSignallingAllowed parameter has been removed
 CIpsPlgImap4ConnectOp::CIpsPlgImap4ConnectOp(
     CMsvSession& aMsvSession,
     TRequestStatus& aObserverRequestStatus,
@@ -182,7 +188,7 @@
     result.iError = KErrNone;
     switch( iState )
         {
-        // <qmail> case EStateQueryingDetails removed
+        // <qmail> cases EStateQueryingDetails/EStateQueryingDetailsBusy removed
         case EStateStartConnect:
             result.iProgressStatus = TFSProgress::EFSStatus_Started;
             break;
@@ -331,7 +337,7 @@
 
     iSelection->ResizeL(0);
     iSelection->AppendL(iService);
-
+    
     // <qmail>
     iStatus = KRequestPending;
     if ( iDoPlainConnect && !Connected() )
@@ -395,7 +401,7 @@
             iService,
             // <qmail> passing in activity timer; only place where NULL "reference" was used
             // <qmail> -> can get rid of checking existence of a reference memeber...
-            iActivityTimer,
+            *iActivityTimer,
             info,
             *iSelection,
             iFSMailboxId,
@@ -415,9 +421,9 @@
     iState = EStatePopulateAllCompleted;
     }
 
-// <qmail> remove CIpsPlgImap4ConnectOp::StartL()
-// <qmail> remove CIpsPlgImap4ConnectOp::QueryUserPwdL()
-// <qmail> remove CIpsPlgImap4ConnectOp::GetOperationErrorCodeL()
+// <qmail> removed CIpsPlgImap4ConnectOp::StartL()
+// <qmail> removed CIpsPlgImap4ConnectOp::QueryUserPwdL()
+// <qmail> removed CIpsPlgImap4ConnectOp::GetOperationErrorCodeL()
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------       
@@ -448,7 +454,7 @@
 
 // <qmail> Removing CIpsPlgImap4ConnectOp::CredientialsSetL 
 
-// <qmail>
+// <qmail> new functions added
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 void CIpsPlgImap4ConnectOp::ConstructImapPartialFetchInfo( 
--- a/ipsservices/ipssosplugin/src/ipsplgimap4fetchattachmentop.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgimap4fetchattachmentop.cpp	Fri May 14 15:41:10 2010 +0300
@@ -20,8 +20,10 @@
 #include "emailtrace.h"
 #include "ipsplgheaders.h"
 
-// <qmail> priority const has been removed
+// <qmail> priority const has been removed, interval changed to 0.2 sec
 const TInt KIpsAttaFetchProgressReportInterval = 200000; // 0.2 sec
+const TInt KIpsAttaFetchRetryInterval = 1000000; // 1 sec
+const TInt KIpsAttaFetchRetryCount = 30;
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
@@ -98,6 +100,8 @@
 // ----------------------------------------------------------------------------
 // CIpsPlgImap4FetchAttachmentOp
 // ----------------------------------------------------------------------------
+// <qmail> aFunctionId removed, CMsvEntrySelection& changed to pointer
+// <qmail> MFSMailRequestObserver& changed to pointer
 CIpsPlgImap4FetchAttachmentOp* CIpsPlgImap4FetchAttachmentOp::NewL(
     CMsvSession& aMsvSession,
     TRequestStatus& aObserverRequestStatus,
@@ -129,6 +133,7 @@
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // <qmail> priority parameter has been removed
+// <qmail> MFSMailRequestObserver& changed to pointer
 CIpsPlgImap4FetchAttachmentOp::CIpsPlgImap4FetchAttachmentOp(
     CMsvSession& aMsvSession,
     TRequestStatus& aObserverRequestStatus,
@@ -146,10 +151,12 @@
         aFSMailBoxId,
         aFSOperationObserver,
         aFSRequestId ),
-    iSelection( aSelection )
+    	iSelection( aSelection ),
+    	iRetryCount( 0 )
     {
     FUNC_LOG;
     iService = aService;
+    iRetryTimer.CreateLocal();
     }
 
 // ----------------------------------------------------------------------------
@@ -157,6 +164,7 @@
 CIpsPlgImap4FetchAttachmentOp::~CIpsPlgImap4FetchAttachmentOp()
     {
     FUNC_LOG;
+    iRetryTimer.Close();
     delete iSelection;
     delete iProgReport;
     delete iFetchErrorProgress;
@@ -184,7 +192,7 @@
         iMsvSession,
         iStatus, 
         iService,
-        iActivityTimer,
+        *iActivityTimer,
         iFSMailboxId,
         NULL, // no observer for subopertaion
         0,    // no requestId needed
@@ -225,6 +233,12 @@
                 CompleteObserver( KErrCouldNotConnect );
                 return;
                 }
+            iRetryCount = 0;
+            DoFetchAttachmentL();
+            break;
+            }
+        case EStateWaiting:
+            {
             DoFetchAttachmentL();
             break;
             }
@@ -233,14 +247,29 @@
             delete iProgReport;
             iProgReport = NULL;
             
-            TInt err( iStatus.Int() );
-            if( err != KErrNone && iSubOperation )
+            TInt err = iStatus.Int();
+
+            // If the server was busy, try again after a short delay, up to
+            // some retry limit.
+            if ( err == KErrServerBusy && iRetryCount < KIpsAttaFetchRetryCount )
                 {
-                iFetchErrorProgress = iSubOperation->ProgressL().AllocL();
+                iRetryCount++;
+                INFO_1( "CIpsPlgImap4FetchAttachmentOp::DoRunL: iRetryCount = %d", iRetryCount );
+                iState = EStateWaiting;
+                iStatus = KRequestPending;
+                iRetryTimer.After( iStatus, KIpsAttaFetchRetryInterval );
+                SetActive();
                 }
-            
-            iState = EStateIdle;
-            CompleteObserver( err );
+            else
+                {
+                if( err != KErrNone && iSubOperation )
+                    {
+                    iFetchErrorProgress = iSubOperation->ProgressL().AllocL();
+                    }
+                
+                iState = EStateIdle;
+                CompleteObserver( err );
+                }
             break;
             }
         default:
@@ -279,7 +308,7 @@
 void CIpsPlgImap4FetchAttachmentOp::ReportProgressL()
     {
     FUNC_LOG;
-    TInt error( KErrNone );
+    TInt error = KErrNone;
     TFSProgress fsProgress = { TFSProgress::EFSStatus_Waiting, 0, 0, KErrNone };
     if ( iSubOperation && iState == EStateFetching )
         {
@@ -307,12 +336,14 @@
         {
         User::Leave( error );
         }
-    
+
+// <qmail>
     // signal observer if it exists
     if ( iFSOperationObserver )
         {
         iFSOperationObserver->RequestResponseL( fsProgress, iFSRequestId );
         }
+// </qmail>
     }
 
 // ----------------------------------------------------------------------------
@@ -370,11 +401,13 @@
     // Switch operations.
     delete iSubOperation;
     iSubOperation = NULL;
+    iStatus = KRequestPending;
 
     iProgReport = CIpsFetchProgReport::NewL( *this );
 
     // Filters are not used when performing 'fetch' operation, 
     // use normal getmail info instead
+// <qmail>
     TPckgBuf<TImImap4GetMailInfo> param;
     TImImap4GetMailInfo& options = param();
     options.iMaxEmailSize = KMaxTInt32;
@@ -382,9 +415,12 @@
     options.iDestinationFolder = 0; // not used
 
     InvokeClientMtmAsyncFunctionL( KIMAP4MTMPopulate, *iSelection, param ); // <qmail> 1 param removed
+// </qmail>
     SetActive();
     }
     
+// <qmail> GetEngineProgress function removed
+
 // <qmail> new func to this op
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------    
@@ -393,3 +429,8 @@
     FUNC_LOG;
     return EIpsOpTypeFetchAttachmentOp;
     }
+// </qmail>
+
+
+// End of File
+
--- a/ipsservices/ipssosplugin/src/ipsplgimap4moveremoteop.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgimap4moveremoteop.cpp	Fri May 14 15:41:10 2010 +0300
@@ -23,6 +23,8 @@
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
+// <qmail> TImImap4GetMailInfo& -> TMsvId&, aFunctionId removed
+// <qmail> MFSMailRequestObserver& changed to pointer
 CIpsPlgImap4MoveRemoteOp* CIpsPlgImap4MoveRemoteOp::NewL(
     CMsvSession& aMsvSession,
     TRequestStatus& aObserverRequestStatus,
@@ -53,7 +55,8 @@
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
-// <qmail> priority parameter has been removed
+// <qmail> TImImap4GetMailInfo& -> TMsvId&, aFunctionId removed, priority param removed
+// <qmail> MFSMailRequestObserver& changed to pointer
 CIpsPlgImap4MoveRemoteOp::CIpsPlgImap4MoveRemoteOp(
     CMsvSession& aMsvSession,
     TRequestStatus& aObserverRequestStatus,
@@ -71,11 +74,13 @@
         aFSMailBoxId,
         aFSOperationObserver,
         aFSRequestId ),
+// <qmail>
     iState( EIdle ),
     iDestinationFolderId( aDestinationFolderId )
+// </qmail>
     {
     FUNC_LOG;
-    iService = aService;    
+    iService = aService;
     }
 
 // ----------------------------------------------------------------------------
@@ -83,9 +88,10 @@
 CIpsPlgImap4MoveRemoteOp::~CIpsPlgImap4MoveRemoteOp()
     {
     FUNC_LOG;
-    delete iLocalSel;
     delete iRemoteSel;
+// <qmail>
     delete iMoveErrorProgress;
+// </qmail>
     }
 
 // ----------------------------------------------------------------------------
@@ -111,7 +117,7 @@
         iMsvSession,
         iStatus, 
         iService,
-        iActivityTimer,
+        *iActivityTimer,
         iFSMailboxId,
         NULL, // no operationobserver for suboperation
         0,    // no requestId needed
@@ -133,9 +139,10 @@
         {
         // Completed, but with an error during move.
         return *iMoveErrorProgress;
-        }
+        }        
     TImap4SyncProgress progg;
     progg.iErrorCode = KErrNone;
+    progg.iFoldersNotFound = 0;
     TPckgBuf<TImap4SyncProgress> param(progg);
     iSyncProgress.Copy(param);
     return iSyncProgress;  
@@ -150,7 +157,8 @@
     if(!iProgressBuf().iGenericProgress.iErrorCode)
         {
         TImap4CompoundProgress& prog = iProgressBuf();
-        prog.iGenericProgress.iOperation = TImap4GenericProgress::EMoveWithinService;
+        prog.iGenericProgress.iOperation = 
+            TImap4GenericProgress::EMoveWithinService;
         prog.iGenericProgress.iState = TImap4GenericProgress::EMoving;
         prog.iGenericProgress.iErrorCode = aError;
         }
@@ -204,7 +212,7 @@
                 CompleteObserver( KErrCouldNotConnect );
                 return;
                 }
-            DoMoveLocalL();
+            DoMoveRemoteL();
             }
             break;
         case ELocalMsgs:
@@ -248,7 +256,6 @@
         User::Leave( KErrNotSupported );
         }
     // Sort messages into complete and incomplete selections.
-    iLocalSel = new(ELeave) CMsvEntrySelection;
     iRemoteSel = new(ELeave) CMsvEntrySelection;
 
     TInt err;
@@ -262,17 +269,6 @@
         err = iMsvSession.GetEntry( id, service, tEntry );
         if( KErrNone == err )
             {
-            // local move is not needed, if the message is not fetched
-            if( tEntry.Complete() )
-                {
-                if ( 0 < count )
-                    {
-                    // service id is not added to local, 
-                    // service is already
-                    // added in MoveMessagesL
-                    iLocalSel->AppendL( id );
-                    }
-                }
             iRemoteSel->AppendL( id );
             }
         }
@@ -286,36 +282,6 @@
     TRequestStatus* observer = &iObserverRequestStatus;
     User::RequestComplete( observer, KErrNone );
     }
-    
-// ----------------------------------------------------------------------------
-// ----------------------------------------------------------------------------
-void CIpsPlgImap4MoveRemoteOp::DoMoveLocalL()
-    {
-    FUNC_LOG;
-    iState = ELocalMsgs;
-    iStatus = KRequestPending;
-    if( iLocalSel->Count() )
-        {
-        // this gets the first msg to be moved
-        CMsvEntry* cEntry = iMsvSession.GetEntryL( (*iLocalSel)[0] );
-        CleanupStack::PushL( cEntry );
-        // find the parent of the moved message...
-        TMsvId parent = cEntry->Entry().Parent();
-        // and use it as a context
-        cEntry->SetEntryL( parent );
-
-        delete iSubOperation;
-        iSubOperation = NULL;
-        iSubOperation = cEntry->MoveL( *iLocalSel, iDestinationFolderId, iStatus );
-        CleanupStack::PopAndDestroy( cEntry ); 
-        SetActive();
-        }
-    else
-        {
-        // <qmail> SetActive(); moved inside CompleteThis();
-        CompleteThis();
-        }
-    }
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
@@ -323,6 +289,7 @@
     {
     FUNC_LOG;
     iState = ERemoteMsgs;
+    iStatus = KRequestPending;
     // first element of the CMsvEntrySelection is the service which is then
     // followed by any messages
     if( iRemoteSel->Count() > 1 )
@@ -331,13 +298,16 @@
     
         // Filters are not used when performing 'move' operation, use normal 
         // getmail info instead
+		// <qmail>
         TPckgBuf<TImImap4GetMailInfo> paramBuf;
         TImImap4GetMailInfo& mailInfo = paramBuf();
         mailInfo.iMaxEmailSize = KMaxTInt32;
         mailInfo.iGetMailBodyParts = EGetImap4EmailBodyTextAndAttachments;
         mailInfo.iDestinationFolder = iDestinationFolderId;
 
+// <qmail> Parameters changed
         InvokeClientMtmAsyncFunctionL( KIMAP4MTMMoveMailSelectionWhenAlreadyConnected, *iRemoteSel, paramBuf );
+// </qmail>
         SetActive();
         }
     else
@@ -357,3 +327,88 @@
     FUNC_LOG;
     return EIpsOpTypeMoveRemoteOp;
     }
+// </qmail>	
+
+// class CIpsPlgImap4MoveRemoteOpObserver
+//
+
+// ----------------------------------------------------------------------------
+// ---------------------------------------------------------------------------- 
+CIpsPlgImap4MoveRemoteOpObserver* CIpsPlgImap4MoveRemoteOpObserver::NewL(
+    CMsvSession& aSession, CIpsPlgEventHandler& aEventHandler,
+    const TFSMailMsgId& aSourceFolder,
+    const RArray<TFSMailMsgId>& aMessageIds )
+    {
+    FUNC_LOG;
+    CIpsPlgImap4MoveRemoteOpObserver* self
+        = new ( ELeave ) CIpsPlgImap4MoveRemoteOpObserver( aSession,
+            aEventHandler, aSourceFolder.Id() );
+    CleanupStack::PushL( self );
+    self->ConstructL( aMessageIds );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ----------------------------------------------------------------------------
+// ---------------------------------------------------------------------------- 
+CIpsPlgImap4MoveRemoteOpObserver::~CIpsPlgImap4MoveRemoteOpObserver()
+    {
+    FUNC_LOG;
+    delete iSelection;
+    }
+
+// ----------------------------------------------------------------------------
+// ---------------------------------------------------------------------------- 
+void CIpsPlgImap4MoveRemoteOpObserver::RequestResponseL( TFSProgress aEvent,
+    TInt /*aRequestId*/ )
+    {
+    FUNC_LOG;
+    if ( aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestCancelled ||
+         aEvent.iError != KErrNone )
+        {
+        // Assumes that still existing entries have not been moved.
+        for ( TInt ii = iSelection->Count() - 1; ii >= 0; --ii )
+            {
+            TMsvId id = iSelection->At(ii);
+            TMsvId dummy = KMsvNullIndexEntryIdValue;
+            TMsvEntry entry;
+            if ( iSession.GetEntry( id, dummy, entry ) != KErrNone )
+                {
+                iSelection->Delete( ii );
+                }
+            }
+
+        if ( iSelection->Count() )
+            {
+            iEventHandler.HandleSessionEventL(
+                MMsvSessionObserver::EMsvEntriesMoved,
+                iSelection, &iSourceFolderId, &iSourceFolderId );
+            }
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// ---------------------------------------------------------------------------- 
+CIpsPlgImap4MoveRemoteOpObserver::CIpsPlgImap4MoveRemoteOpObserver(
+    CMsvSession& aSession, CIpsPlgEventHandler& aEventHandler,
+    TMsvId aSourceFolderId )
+    : iSession( aSession ), iEventHandler( aEventHandler ),
+    iSourceFolderId( aSourceFolderId )
+    {
+    FUNC_LOG;
+    }
+
+// ----------------------------------------------------------------------------
+// ----------------------------------------------------------------------------     
+void CIpsPlgImap4MoveRemoteOpObserver::ConstructL(
+    const RArray<TFSMailMsgId>& aMessageIds )
+    {
+    FUNC_LOG;
+    TInt count = aMessageIds.Count();
+    iSelection = new ( ELeave ) CMsvEntrySelection;
+    for ( TInt ii = 0; ii < count; ++ii )
+        {
+        iSelection->AppendL( aMessageIds[ii].Id() );
+        }
+    }
+
--- a/ipsservices/ipssosplugin/src/ipsplgimap4plugin.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgimap4plugin.cpp	Fri May 14 15:41:10 2010 +0300
@@ -93,11 +93,14 @@
         case EFSMBoxCapaCanBeDeleted:
         case EFSMBoxCapaSupportsSaveToDrafts:
         case EFSMBoxCapaMeetingRequestRespond:
+        case EFSMboxCapaSupportsAttahmentsInMR:
         case EFSMBoxCapaMeetingRequestCreate:
         case EFSMBoxCapaCanUpdateMeetingRequest:
         case EFSMBoxCapaMoveToFolder:
         case EFSMBoxCapaCopyToFolder:
         case EFSMBoxCapaSupportsSync:
+        case EFSMBoxCapaRemoveFromCalendar:
+        case EFSMBoxCapaMoveMessageNoConnectNeeded:
             {
             result = ETrue;
             break;
@@ -111,6 +114,7 @@
         case EFSMBoxCapaSupportsMRU:
         case EFSMBoxCapaSymbianMsgIntegration:
         case EFSMBoxCapaNewEmailNotifications:
+        default:
             {
             result = EFalse;
             break;
@@ -322,33 +326,40 @@
     const RArray<TFSMailMsgId>& aMessageIds, 
     const TFSMailMsgId& aSourceFolderId, 
     const TFSMailMsgId& aDestinationFolderId )
-	{
+    {
     FUNC_LOG;
-	if( aDestinationFolderId.Id() == KMsvDraftEntryId  )
-	    {
-	    // Move to Drafts folder
-	    MoveMessagesToDraftL( aMailBoxId, 
-	                          aMessageIds, 
-	                          aSourceFolderId, 
-	                          aDestinationFolderId );
-	    }
+    if( aDestinationFolderId.Id() == KMsvDraftEntryId  )
+        {
+        // Move to Drafts folder
+        MoveMessagesToDraftL( aMailBoxId, 
+                aMessageIds, 
+                aSourceFolderId, 
+                aDestinationFolderId );
+        }
     else if( aDestinationFolderId.Id() != aSourceFolderId.Id() )
         {
-    	TMsvId service = aMailBoxId.Id();
-    	
-    	CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewL(*this);
+        TMsvId service = aMailBoxId.Id();
+
+        CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewL(*this);
         CleanupStack::PushL( watcher );
         
         CMsvEntrySelection* sel = new(ELeave) CMsvEntrySelection;
         CleanupStack::PushL(sel);
         sel->AppendL( service );
-        
+
         TInt msgIdCount( aMessageIds.Count() );
-    	for ( TInt i(0); i< msgIdCount; i++ )
+        for ( TInt i(0); i< msgIdCount; i++ )
             {
             sel->AppendL( aMessageIds[i].Id() );
             }
     	
+		// <qmail> TImImap4GetMailInfo options not needed
+
+        CIpsPlgImap4MoveRemoteOpObserver* observer =
+            CIpsPlgImap4MoveRemoteOpObserver::NewL( *iSession, *iEventHandler,
+                aSourceFolderId, aMessageIds );
+        watcher->SetRequestObserver( observer );
+
         // Synchronous operation
         // <qmail> following constructor's parameters have changed
     	CIpsPlgBaseOperation* op = CIpsPlgImap4MoveRemoteOp::NewL(
@@ -360,14 +371,96 @@
             *sel,
             aMailBoxId,
             NULL, // no observer, async not supported
-            0 ); // no reqId, async not supported
-            
+            0 ); // async not supported
+
         watcher->SetOperation( op );
         CleanupStack::PopAndDestroy( sel );
         iOperations.AppendL( watcher );
         CleanupStack::Pop( watcher );
         }
-	} 	
+    else
+        {
+        //do nothing
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CIpsPlgImap4Plugin::MoveMessagesL()
+// asynchronic move message function
+// ---------------------------------------------------------------------------
+//
+TInt CIpsPlgImap4Plugin::MoveMessagesL( 
+    const TFSMailMsgId& aMailBoxId,
+    const RArray<TFSMailMsgId>& aMessageIds, 
+    const TFSMailMsgId& aSourceFolderId,
+    const TFSMailMsgId& aDestinationFolderId,
+    MFSMailRequestObserver& aOperationObserver,
+    TInt aRequestId )
+    {
+    FUNC_LOG;
+    TInt ret = KErrNone;
+    if( aDestinationFolderId.Id() == KMsvDraftEntryId  )
+        {
+        // Move to Drafts folder
+        MoveMessagesToDraftL( aMailBoxId, 
+                aMessageIds, 
+                aSourceFolderId, 
+                aDestinationFolderId );
+        TFSProgress progress = { 
+                TFSProgress::EFSStatus_RequestComplete, 0, 0, ret };
+        aOperationObserver.RequestResponseL( 
+                progress, aRequestId );
+        }
+    else if( aDestinationFolderId.Id() != aSourceFolderId.Id() )
+        {
+        TMsvId service = aMailBoxId.Id();
+
+        CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewL(*this);
+        CleanupStack::PushL( watcher );
+        
+        CMsvEntrySelection* sel = new(ELeave) CMsvEntrySelection;
+        CleanupStack::PushL(sel);
+        sel->AppendL( service );
+
+        TInt msgIdCount( aMessageIds.Count() );
+        for ( TInt i(0); i< msgIdCount; i++ )
+            {
+            sel->AppendL( aMessageIds[i].Id() );
+            }
+
+        TPckgBuf<TImImap4GetMailInfo> optionsBuf;
+        TImImap4GetMailInfo& options = optionsBuf();
+        options.iMaxEmailSize = KMaxTInt32;
+        options.iGetMailBodyParts = EGetImap4EmailBodyTextAndAttachments;
+        options.iDestinationFolder = aDestinationFolderId.Id();
+
+		// <qmail> following constructor's parameters have changed
+    	CIpsPlgBaseOperation* op = CIpsPlgImap4MoveRemoteOp::NewL(
+            *iSession, 
+            watcher->iStatus,
+            service,
+            ActivityTimerL( aMailBoxId ),
+            aDestinationFolderId.Id(),
+            *sel,
+            aMailBoxId,
+            &aOperationObserver, // async not supported
+            0 ); // async not supported
+
+        watcher->SetOperation( op );
+        CleanupStack::PopAndDestroy( sel );
+        iOperations.AppendL( watcher );
+        CleanupStack::Pop( watcher );
+        }
+    else
+        {
+        ret = KErrNotSupported;
+        TFSProgress progress = { 
+                TFSProgress::EFSStatus_RequestComplete, 0, 0, ret };
+        aOperationObserver.RequestResponseL( 
+                progress, aRequestId );
+        }
+    return ret;
+    }
 
 // ---------------------------------------------------------------------------
 // CIpsPlgImap4Plugin::FetchMessagePartsL()
@@ -432,7 +525,8 @@
             }
         
         }
-        
+       
+	// <qmail> TImImap4GetMailInfo options removed
     CIpsPlgBaseOperation* op = CIpsPlgImap4FetchAttachmentOp::NewL( 
         *iSession, 
         watcher->iStatus,
@@ -445,7 +539,9 @@
     
     watcher->SetOperation( op );
     iOperations.AppendL( watcher );
+// <qmail>
     CleanupStack::Pop( sel );
+// </qmail>
     CleanupStack::Pop( watcher );
     }
 
@@ -483,6 +579,7 @@
     accounts->GetImapAccountL( aMailboxId.Id(), imapAcc );
     accounts->LoadImapSettingsL( imapAcc, *settings );
     TImImap4GetPartialMailInfo info;
+// <qmail>	
     info.iPartialMailOptions = ENoSizeLimits;
     //CIpsSetDataApi::ConstructImapPartialFetchInfo( info, *settings );
     CleanupStack::PopAndDestroy( 2, settings );
@@ -491,6 +588,7 @@
         {
         return;
         }*/
+// </qmail>
     
     TPckgBuf<TImImap4GetPartialMailInfo> package(info);
     
--- a/ipsservices/ipssosplugin/src/ipsplgimap4populateop.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgimap4populateop.cpp	Fri May 14 15:41:10 2010 +0300
@@ -18,9 +18,12 @@
 #include "emailtrace.h"
 #include "ipsplgheaders.h"
 
+// <qmail> priority const has been removed
+
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // <qmail> priority parameter has been removed
+// <qmail> MFSMailRequestObserver& changed to pointer
 EXPORT_C CIpsPlgImap4PopulateOp* CIpsPlgImap4PopulateOp::NewL(
     CMsvSession& aMsvSession,
     TRequestStatus& aObserverRequestStatus,
@@ -90,12 +93,19 @@
     {
     FUNC_LOG;
     delete iSelection;
-   	delete iTempSelection;
+
+    if ( iTempSelection )
+    	{
+    	iTempSelection->Reset();
+   		delete iTempSelection;
+    	}
     }
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
-void CIpsPlgImap4PopulateOp::ConstructL( const CMsvEntrySelection& aSel, TBool aDoFilterSelection )
+void CIpsPlgImap4PopulateOp::ConstructL( 
+        const CMsvEntrySelection& aSel,
+        TBool aDoFilterSelection )
     {
     FUNC_LOG;
     BaseConstructL( KUidMsgTypeIMAP4 );
@@ -124,7 +134,7 @@
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
-// <qmail> return type
+// <qmail> return type changed: TInt -> TIpsOpType
 TIpsOpType CIpsPlgImap4PopulateOp::IpsOpType() const
     {
     FUNC_LOG;
@@ -144,7 +154,7 @@
         iMsvSession,
         iStatus, 
         iService,
-        iActivityTimer,
+        *iActivityTimer,
         iFSMailboxId,
         NULL, // no observer for suboperations
         0,    // requestId not needed
@@ -185,7 +195,7 @@
             {
             TMsvEntry tentry;
             TMsvId service;
-            iMsvSession.GetEntry( iService, service, tentry );
+            iMsvSession.GetEntry(iService, service, tentry );
             if( !tentry.Connected() )
                 {
                 CompleteObserver( KErrCouldNotConnect );
@@ -240,6 +250,7 @@
     else
         {
         TImap4SyncProgress progg;
+    	progg.iFoldersNotFound = 0;
         progg.iErrorCode = KErrNone;
         TPckgBuf<TImap4SyncProgress> param(progg);
         iSyncProgress.Copy(param);
@@ -300,17 +311,21 @@
     FUNC_LOG;
     iSelection->Reset();
     TMsvId messageId;
+    // NOTE: this code is taken from symbian os source IMPCMTM.CPP
+    // filter selection is in here because messages are
+    // fetched separately then we dont have to make unneccessery imap 
+    // client mtm calls
 
-    for ( TInt i = 0; i < aSelection.Count(); i++ )
+    for (TInt i=0; i<aSelection.Count(); i++)
         {
-        messageId  = (aSelection)[i];
+        messageId = (aSelection)[i];
         if ( messageId == iService )
             {
             continue; // ignore serviceId
             }
         TMsvEmailEntry entry;
-        TMsvId service( KMsvNullIndexEntryId );          
-        User::LeaveIfError( iMsvSession.GetEntry( messageId, service, entry ) );
+        TMsvId service = KMsvNullIndexEntryId;          
+        User::LeaveIfError(iMsvSession.GetEntry(messageId, service, entry));
         
         TBool isComplete = !(   ( entry.Complete() && entry.PartialDownloaded() ) 
                              || ( !entry.Complete() && ( !entry.BodyTextComplete() 
@@ -319,9 +334,12 @@
 
         TBool isMsgEntry = entry.iType == KUidMsvMessageEntry;
         TBool isSizeUnderMax = entry.iSize <= iPartialMailInfo.iMaxEmailSize;
-        TBool isParentComp = entry.Parent() == iPartialMailInfo.iDestinationFolder && isComplete;
+        TBool isParentComp = entry.Parent() == 
+            iPartialMailInfo.iDestinationFolder && isComplete;
         
-        if( isMsgEntry && IsPartialPopulate() && !isComplete )
+        if( IsPartialPopulate( )
+              && !isComplete
+              && entry.iType == KUidMsvMessageEntry )
             {
             iSelection->AppendL( messageId ); 
             }
@@ -338,6 +356,8 @@
     {
     // <qmail> cleaned up code and took one "always true" condition out from the if statement
     FUNC_LOG;
+    // NOTE: this code is taken from symbian os source IMPCMTM.CPP
+    // code is modified to this class purpose 
     TBool isPartialPopulate( EFalse );
     if ( iPartialMailInfo.iPartialMailOptions == ENoSizeLimits &&
          iPartialMailInfo.iTotalSizeLimit == KMaxTInt &&
@@ -388,3 +408,5 @@
         CompleteObserver();
         }
     }
+
+// End of File
--- a/ipsservices/ipssosplugin/src/ipsplgmrulist.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgmrulist.cpp	Fri May 14 15:41:10 2010 +0300
@@ -251,7 +251,7 @@
                 start += 1;
                 emailAddress.Set( aNewMruList->MdcaPoint(i + 1).Mid( start, ( end - start ) ) );
                 }
-
+// <qmail> someone disabled in Qmail?
             // check validity of email before saving diplay name and address
             /*if( IpsSetUtils::IsValidEmailAddressL(emailAddress) )
                 {
@@ -287,6 +287,7 @@
                     }
                 }*/
             }
+// </qmail>
         }
     // </cmail>
 
--- a/ipsservices/ipssosplugin/src/ipsplgmsgkey.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgmsgkey.cpp	Fri May 14 15:41:10 2010 +0300
@@ -15,6 +15,11 @@
 *
 */
 
+// <qmail> Are AknUtils available in 10.1?
+// <cmail>
+#include <AknUtils.h>
+// </cmail>
+// </qmail>
 
 #include "emailtrace.h"
 #include "ipsplgheaders.h"
@@ -24,6 +29,11 @@
 const TInt KEqual = 0;
 
 _LIT(KDefaultSubjectPrefixSeparator,": ");
+// <cmail>
+// <qmail> Cmail bugfix uses AknUtils (available in 10.1?) - commented out until it is clear
+//_LIT( KCharsToReplace, "\r\n\t\x2028\x2029" );
+// <qmail>
+// </cmail>
 
 // ---------------------------------------------------------------------------
 // Basic sonstructor
@@ -94,8 +104,10 @@
                 }
             case EFSMailSortBySubject:
                 {
-                result = CompareSubjects( 
-                    leftEntry.iDescription, rightEntry.iDescription );
+                // <cmail> due to changes in CompareSubject method
+                TRAP_IGNORE( result = CompareSubjectsL( 
+                    leftEntry.iDescription, rightEntry.iDescription ) );
+                // </cmail>
                 break;
                 }
             case EFSMailSortByPriority:
@@ -134,11 +146,11 @@
                 // a read one
                 if ( !leftEntry.Unread() && rightEntry.Unread() ) 
                     {
-                    result = KLessThan;
+                    result = KMoreThan; // <cmail> changed from KLessThan 
                     }
                 else if ( leftEntry.Unread() && !rightEntry.Unread() ) 
                     {
-                    result = KMoreThan;
+                    result = KLessThan; // <cmail> changed from KMoreThan
                     }
                 break;
                 }
@@ -200,7 +212,7 @@
 // Strips the subject prefixes before comparing the strings
 // ---------------------------------------------------------------------------
 
-TInt TIpsPlgMsgKey::CompareSubjects( 
+TInt TIpsPlgMsgKey::CompareSubjectsL( 
     const TDesC& aLeft, 
     const TDesC& aRight ) const
     {
@@ -215,8 +227,29 @@
         leftPtr.Ptr() + leftOffset, leftPtr.Length() - leftOffset );
     rightPtr.Set( 
         rightPtr.Ptr() + rightOffset, rightPtr.Length() - rightOffset );
+    
+// <qmail> Are AknUtils available in 10.1?
+    // <cmail> for unifying with UI - remove all white spaces
+    /*HBufC* croppedLeft = leftPtr.AllocLC();
+    TPtr croppedLeftPtr = croppedLeft->Des();
+    HBufC* croppedRight = rightPtr.AllocLC();
+    TPtr croppedRightPtr = croppedRight->Des();
         
-    result = leftPtr.CompareC( rightPtr );
+    AknTextUtils::ReplaceCharacters( croppedLeftPtr, KCharsToReplace, ' ' );
+    croppedLeftPtr.TrimAll();
+    AknTextUtils::ReplaceCharacters( croppedRightPtr, KCharsToReplace, ' ' );
+    croppedRightPtr.TrimAll();
+    
+    result = croppedLeftPtr.CompareC( croppedRightPtr );
+    
+    CleanupStack::PopAndDestroy( croppedRight );
+    CleanupStack::PopAndDestroy( croppedLeft );*/
+    // </cmail>
+// </qmail>
+
+// <qmail> Remove line if above code is valid in 10.1
+	result = leftPtr.CompareC( rightPtr );
+// </qmail>
         
     return result;
     }
@@ -232,27 +265,75 @@
 TInt TIpsPlgMsgKey::FindSubjectStart( const TDesC& aSubject ) const
     {
     FUNC_LOG;
-	TPtrC ptr(aSubject);
-	TInt offset(0);
-	TInt current(0);
-	TInt skipLength = iSubjectPrefixSeparator.Length();
-	
-	// Loop while separators are found
-	do
-		{
-		current = ptr.FindF( iSubjectPrefixSeparator );
+    TInt offset(0);
+    // <cmail> removed and replaced with the code from UI
+    // TFsEmailUiUtility::CreateSubjectWithoutLocalisedPrefixLC
+    // to have the same subject here and there
+    // there was sorting problem when subjects where handled
+    // different here and in UI while creating mails' list.  
+    
+    /*TPtrC ptr(aSubject);
+    TInt current(0);
+    TInt skipLength = iSubjectPrefixSeparator.Length();
+    
+    // Loop while separators are found
+    do
+        {
+        current = ptr.FindF( iSubjectPrefixSeparator );
 
-		if ( current != KErrNotFound )
-			{
-			offset += current + skipLength;
-			ptr.Set( aSubject.Ptr() + offset, aSubject.Length() - offset );
-			}
-		} while ( current != KErrNotFound );
+        if ( current != KErrNotFound )
+            {
+            offset += current + skipLength;
+            ptr.Set( aSubject.Ptr() + offset, aSubject.Length() - offset );
+            }
+        } while ( current != KErrNotFound );*/
+    
+    TBool prefixFound = EFalse;
+    TPtrC croppedSubject;
+    croppedSubject.Set( aSubject );
+    
+    do
+        {
+        prefixFound = EFalse;
+    
+        // Remove leading white space before trying to find the prefix
+        while( croppedSubject.Length() && 
+               TChar( croppedSubject[0] ).IsSpace() )
+            {
+            croppedSubject.Set( croppedSubject.Mid(1) );
+            offset++;
+            }
+    
+        // try to find ":" at the beginning
+        // Locate : character on location 1,2 and 3
+        static const TInt KPrefixMinLength = 1;
+        static const TInt KPrefixMaxLength = 3;
+        static const TText KPrefixSeparator = ':';
+        TInt separatorPosition = croppedSubject.Locate( KPrefixSeparator );
+        if ( separatorPosition >= KPrefixMinLength &&
+             separatorPosition <= KPrefixMaxLength )
+            {
+            TPtrC prefixCandidate = croppedSubject.Left( separatorPosition );
+            // Only fully alphabetic prefixes are cropped
+            TBool isAlpha = ETrue;
+            for ( TInt i = 0 ; i < prefixCandidate.Length() ; ++i )
+                {
+                if ( !TChar( prefixCandidate[i] ).IsAlpha() )
+                    {
+                    isAlpha = EFalse;
+                    }
+                }
+            if ( isAlpha )
+                {
+                croppedSubject.Set( croppedSubject.Mid( 
+                        separatorPosition + 1 ) );
+                offset += separatorPosition + 1;
+                prefixFound = ETrue;
+                }
+            }
+        }
+    while ( prefixFound );
+    // </cmail>
 
-	return offset;
+    return offset;
     }
-
-
-
-
-
--- a/ipsservices/ipssosplugin/src/ipsplgmsgmapper.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgmsgmapper.cpp	Fri May 14 15:41:10 2010 +0300
@@ -25,11 +25,10 @@
 _LIT( KMimeTypeTextRtf, "text/rtf" );
 _LIT( KSlash, "/" );
 
-// <cmail>
 _LIT( KCharSemicolon, ";" );
 _LIT( KCharEquals, "=" );
 _LIT( KCharsetTag, "CHARSET" );
-// </cmail>
+_LIT( KMessageExtension, ".eml" );
 
 // Supported multipart content types
 _LIT( KMimeTypeMultipartRelated, "multipart/related" );
@@ -45,9 +44,8 @@
 const TInt KCharEscape       = 0x5C;
 const TInt KCharNonPrintable = 0x1F;
 const TInt KCharAt           = 0x40;
-// <cmail>
 const TInt KMaxContentTypeLength = 200;
-// </cmail>
+const TInt KEmbeddedMsgExtensionLength  = 4;
 
 // ======== CONSTRUCTORS & DESTRUCTOR ========
 
@@ -124,7 +122,10 @@
 
     fsMsg->SetFolderId(
         TFSMailMsgId( iPlugin.PluginId(), aEntry.Entry().Parent() ) );
-
+    // ERLN-7YUEX3
+    fsMsg->SetMailBoxId(TFSMailMsgId( iPlugin.PluginId(), aEntry.Entry().iServiceId ));
+    // End ERLN-7YUEX3
+    
     CMsvStore* store( NULL );
 
     if ( aEntry.HasStoreL() )
@@ -172,7 +173,7 @@
         TFSMailMsgId( iPlugin.PluginId(), aEntry.Parent() ) );
 
     SetFlags( aEntry, *result );
-    SetFetchState( aEntry, aEntry.Id(), EFalse ,*result );
+    SetFetchStateL( aEntry, aEntry.Id(), EFalse, *result );
 
     switch( aDetails )
         {
@@ -190,27 +191,30 @@
             {
             CMsvStore* store( NULL );
             CMsvEntry* cEntry = iSession.GetEntryL( aEntry.Id() );
-            CleanupStack::PushL( cEntry );
 
-            if ( cEntry && cEntry->HasStoreL() )
-                {
-                store = cEntry->ReadStoreL();
-                CleanupStack::PushL( store );
-                }
-
-            SetEnvelopeL( cEntry, store, *result );
+            if ( cEntry )
+            	{
+                CleanupStack::PushL( cEntry );
+            	if ( cEntry->HasStoreL() )
+					{
+					store = cEntry->ReadStoreL();
+					CleanupStack::PushL( store );
+					}
 
-            // Apparently, this should be done only with
-            // EFSMsgDataStructure, but EFSMsgDataEnvelope is currently
-            // used by assuming that it reads also the content-type of
-            // the message
-            SetStructureL( cEntry, *result );
-
-            if ( store )
-                {
-                CleanupStack::PopAndDestroy( store );
-                }
-            CleanupStack::PopAndDestroy( cEntry );
+				SetEnvelopeL( cEntry, store, *result );
+	
+				// Apparently, this should be done only with
+				// EFSMsgDataStructure, but EFSMsgDataEnvelope is currently
+				// used by assuming that it reads also the content-type of
+				// the message
+				SetStructureL( cEntry, *result );
+	
+				if ( store )
+					{
+					CleanupStack::PopAndDestroy( store );
+					}
+				CleanupStack::PopAndDestroy( cEntry );
+            	}
             break;
             }
         case EFSMsgDataIdOnly:
@@ -271,15 +275,12 @@
                 break;
                 }
             case KUidMsvAttachmentEntryValue:
+            case KUidMsvMessageEntryValue:
                 {
                 result = ConvertAttachmentEntry2MessagePartL( tEntry,
                     aMailBoxId, aMessageId );
                 break;
                 }
-            case KUidMsvMessageEntryValue:
-                {
-                break;
-                }
             case KUidMsvEmailTextEntryValue:
             case KUidMsvEmailHtmlEntryValue:
             case KUidMsvEmailExternalBodyEntryValue:
@@ -305,9 +306,11 @@
     TInt msgFlags = aMessage.GetFlags();
     TBool modified ( EFalse );
     TBool unread( aEmlEntry.Unread() );
-    
+
+// <qmail>
     if ( !LogicalXor( unread, msgFlags & EFSMsgFlag_Read ) ||
          !LogicalXor( unread, msgFlags & EFSMsgFlag_Read_Locally ))
+// </qmail>
         {
         aEmlEntry.SetUnread( !unread );
         modified = ETrue;
@@ -408,7 +411,9 @@
 
     if ( isModified )
         {
+// <qmail> Function called sync in Qmail
         cEntry->ChangeL( tEntry );
+// </qmail>
         }
 
     CleanupStack::PopAndDestroy( cEntry );
@@ -624,6 +629,8 @@
     {
     FUNC_LOG;
 
+    TBool forwardedMeetingRequest = EFalse;
+    
     // EFSMsgFlag_Read
     // EFSMsgFlag_Read_Locally
     if ( aEntry.Unread() )
@@ -686,12 +693,33 @@
                 // <cmail> implementation changed due to cs warning
                 TInt attCount = 0;
                 TRAPD ( err, attCount = GetAttachmentCountL( aEntry ) );
-                if ( err == KErrNone && attCount < 2 )
+                if ( err == KErrNone && attCount == 1 )
                 	{
-                    // Only text/calendar part included as attachment
-                    aMsg.ResetFlag( EFSMsgFlag_Attachments );
-                    //Set Attachment flag for CMsvEntry (needed for sorting)
-                    TRAP_IGNORE( SetAttachmentFlagL( aEntry, EFalse ) );
+                	CMsvEntry* cEntry = NULL;
+                	TRAPD ( err2, cEntry = iSession.GetEntryL( aEntry.Id() ) );
+                	if ( err2 == KErrNone && cEntry->Count() == 1 )
+                		{
+                		TMsvEmailEntry tEntry = (*cEntry)[0];
+                		TImEmailFolderType ft = tEntry.MessageFolderType();
+                		if ( tEntry.iType == KUidMsvFolderEntry && ft == EFolderTypeMixed  )
+                			{
+                           	// Message with calendar object. But based on content type
+                			// (multipart/mixed) we know that this is meeting request
+                			// forwarded as email, so it must be seen as normal email.
+                   			forwardedMeetingRequest = ETrue;
+                   			aMsg.ResetFlag( EFSMsgFlag_CalendarMsg );
+                   			aMsg.SetFlag( EFSMsgFlag_Attachments );
+                        	}
+						else
+							{
+							// Only text/calendar part included as attachment
+							aMsg.ResetFlag( EFSMsgFlag_Attachments );
+							//Set Attachment flag for CMsvEntry (needed for sorting)
+							TRAP_IGNORE( SetAttachmentFlagL( aEntry, EFalse ) );
+							}
+                		}
+                	delete cEntry;
+                	cEntry = NULL;
                 	}
                 // </cmail>
                 }
@@ -708,7 +736,7 @@
     // the index entry)
 
     // EFSMsgFlag_CalendarMsg
-    if ( aEntry.ICalendar() )
+    if ( aEntry.ICalendar() && !forwardedMeetingRequest ) // <cmail>
         {
         aMsg.SetFlag( EFSMsgFlag_CalendarMsg );
         }
@@ -749,15 +777,16 @@
 
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
-void CIpsPlgMsgMapper::SetFetchState(
+void CIpsPlgMsgMapper::SetFetchStateL(
     const TMsvEmailEntry& aEntry,
     TMsvId aMsgMainId,
     TBool aIsAtta,
     CFSMailMessagePart& aMessage )
     {
     FUNC_LOG;
-    if ( aEntry.iMtm.iUid == KSenduiMtmPop3UidValue
-            && aEntry.Id() != aMsgMainId )
+    if ( aEntry.iMtm.iUid == KSenduiMtmPop3UidValue && 
+            aEntry.Id() != aMsgMainId &&
+            !aIsAtta )
         {
         TInt error = KErrNone;
         TMsvEmailEntry emlEntry;
@@ -767,7 +796,7 @@
 
         if ( error == KErrNone )
             {
-            SetFetchStateImap( emlEntry, aMsgMainId, aIsAtta ,aMessage );
+            DoSetFetchStateL( emlEntry, aMsgMainId, aIsAtta, aMessage );
             }
         else
             {
@@ -776,13 +805,13 @@
         }
     else
         {
-        SetFetchStateImap( aEntry, aMsgMainId, aIsAtta, aMessage );
+        DoSetFetchStateL( aEntry, aMsgMainId, aIsAtta, aMessage );
         }
     }
 
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
-void CIpsPlgMsgMapper::SetFetchStateImap(
+void CIpsPlgMsgMapper::DoSetFetchStateL(
     const TMsvEmailEntry& aEntry,
     TMsvId aMsgMainId,
     TBool aIsAtta,
@@ -793,10 +822,44 @@
         {
         aMessage.SetMessagePartsStatus( EFSPartial );
         }
-    else if ( aEntry.Complete() || (aEntry.BodyTextComplete() && !aIsAtta) )
+    else if ( aEntry.BodyTextComplete() && !aIsAtta )
+        {
+        aMessage.SetMessagePartsStatus( EFSFull );
+        }
+    else if ( aEntry.Complete() && !aIsAtta )
         {
         aMessage.SetMessagePartsStatus( EFSFull );
         }
+    else if ( aEntry.Complete() && aIsAtta )
+        {
+        CMsvEntry* cEntry = iSession.GetEntryL( aEntry.Id() );
+
+        CleanupStack::PushL( cEntry );
+
+        TBool hasStore = cEntry->HasStoreL();
+
+        if ( hasStore )
+            {
+            CMsvStore* store = cEntry->EditStoreL();
+    
+            CleanupStack::PushL( store );
+
+            MMsvAttachmentManager& attMgr = store->AttachmentManagerL();
+        
+            if ( attMgr.AttachmentCount() )
+                {
+                aMessage.SetMessagePartsStatus( EFSFull );
+                }
+            else
+                {
+                aMessage.SetMessagePartsStatus( EFSNone );
+                }
+            
+            CleanupStack::PopAndDestroy( store );
+            }
+
+        CleanupStack::PopAndDestroy( cEntry );
+        }
     else if ( aEntry.Id() != aMsgMainId )
         {
         // fetch state of some message part, then we sure know
@@ -1189,10 +1252,12 @@
 
         CleanupStack::Pop( result );
         }
-    SetFetchState( aEntry, aMessageId.Id(), EFalse, *result );
-// <cmail>
+    if(result) // coverity error fix: result might be null
+        {
+        SetFetchStateL( aEntry, aMessageId.Id(), EFalse, *result );
+        }
+
     CleanupStack::PopAndDestroy( buf );
-// </cmail>
     return result;
     }
 
@@ -1208,7 +1273,8 @@
     HBufC* buffer;
     CMsvEntry* cEntry;
 
-    __ASSERT_DEBUG( ( aEntry.iType == KUidMsvAttachmentEntry ),
+    __ASSERT_DEBUG( ( aEntry.iType == KUidMsvAttachmentEntry || 
+    	aEntry.iType == KUidMsvMessageEntry ),
         User::Panic( KIpsPlgPanicCategory, EIpsPlgInvalidEntry ) );
 
     cEntry = iSession.GetEntryL( aEntry.Id() );
@@ -1228,7 +1294,14 @@
             mimeHeader->RestoreL( *store );
 
             // Content-type
-            SetContentTypeL( *mimeHeader, *result );
+            if ( aEntry.iType.iUid == KUidMsvMessageEntryValue )
+                {
+                result->SetContentType( KMimeTypeMultipartRfc822 );
+                }
+            else
+                {
+                SetContentTypeL( *mimeHeader, *result );
+                }
 
             // Content-description
             buffer = HBufC::NewLC(
@@ -1273,7 +1346,18 @@
             CleanupStack::PopAndDestroy( mimeHeader );
             }
         // Name
-        result->SetAttachmentNameL( aEntry.iDetails );
+        if ( aEntry.iType.iUid == KUidMsvMessageEntryValue )
+            {
+            HBufC* att = HBufC::NewLC( aEntry.iDescription.Length() + KEmbeddedMsgExtensionLength );
+            att->Des().Copy( aEntry.iDescription );
+            att->Des().Append( KMessageExtension );
+            result->SetAttachmentNameL( att->Des() );
+            CleanupStack::PopAndDestroy( att );
+            }
+        else
+            {
+            result->SetAttachmentNameL( aEntry.iDetails );
+            }
 
         // Size
         result->SetContentSize( aEntry.iSize );
@@ -1288,9 +1372,10 @@
             }
         result->SetMailBoxId( aMailBoxId );
         CleanupStack::PopAndDestroy(store);
+        
+        SetFetchStateL( aEntry, aMessageId.Id(), ETrue, *result );
         CleanupStack::Pop( result );
         }
-    SetFetchState( aEntry, aMessageId.Id(), ETrue ,*result );
     CleanupStack::PopAndDestroy( cEntry );
 
     return result;
@@ -1434,9 +1519,11 @@
 	// Only text/calendar part included as attachment
 	TMsvEmailEntry entryToBeChanged( aEntry );
 	entryToBeChanged.SetAttachment( aHasAttachment );
+
+// <qmail> Function called sync in Qmail
 	cEntry->ChangeL( entryToBeChanged );
-	
 	CleanupStack::PopAndDestroy( cEntry );
+// </qmail>
 	}
 // </cmail>
 
--- a/ipsservices/ipssosplugin/src/ipsplgonlineoperation.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgonlineoperation.cpp	Fri May 14 15:41:10 2010 +0300
@@ -35,6 +35,8 @@
 // CIpsPlgOnlineOperation::CIpsPlgOnlineOperation()
 // ----------------------------------------------------------------------------
 // <qmail> priority parameter has been removed
+// <qmail> MFSMailRequestObserver& changed to pointer
+// <qmail> aSignallingAllowed parameter has been removed
 CIpsPlgOnlineOperation::CIpsPlgOnlineOperation(
     CMsvSession& aMsvSession,
     TRequestStatus& aObserverRequestStatus,
@@ -48,7 +50,7 @@
         aObserverRequestStatus,
         aFSRequestId, 
         aFSMailBoxId ), 
-    iActivityTimer( aActivityTimer ),
+    iActivityTimer( &aActivityTimer ),
     iBaseMtm( NULL ),
     iMtmReg( NULL ), 
     iSubOperation( NULL ),
@@ -68,7 +70,10 @@
     // reset timer, if operation not completed after timer fires causes
     // disconnection
     // <qmail> remove cheking of existence of this reference member
-    iActivityTimer.ResetTimerOperation();
+    if (iActivityTimer)
+        {
+        iActivityTimer->ResetTimerOperation();
+        }
 
     iMtmReg = CClientMtmRegistry::NewL( iMsvSession );
     iBaseMtm = iMtmReg->NewMtmL( aMtmType );
@@ -129,11 +134,11 @@
         //if connected, reset activitytimer. if not, there is no reason to.
         if ( Connected() )
             {
-            iActivityTimer.ResetTimerOperation();
+            iActivityTimer->ResetTimerOperation();
             }
         else
             {
-            iActivityTimer.Cancel();
+            iActivityTimer->Cancel();
             }
         // </qmail>
         User::RequestComplete(status, aStatus);
--- a/ipsservices/ipssosplugin/src/ipsplgpop3connectop.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgpop3connectop.cpp	Fri May 14 15:41:10 2010 +0300
@@ -18,15 +18,19 @@
 #include "emailtrace.h"
 #include "ipsplgheaders.h"
 
+
 // Constants and defines
-const TInt KIpsPlgPop3PopulateLimitInitValue = 50;
+// <qmail> rename const
+const TInt KDefaultPopulateLimit( 50 );
+const TInt KPopulateAlgorithmBytesInKilo( 1024 );
+const TInt KPopulateAlgorithmRowLength( 75 );
 
-_LIT( KIpsPlgPopConnectPanic, "PopConnectOp" );
 
 // ----------------------------------------------------------------------------
 // CIpsPlgPop3ConnectOp::NewL()
 // ----------------------------------------------------------------------------
-//
+// <qmail> MFSMailRequestObserver& changed to pointer
+// <qmail> aSignallingAllowed parameter removed
 CIpsPlgPop3ConnectOp* CIpsPlgPop3ConnectOp::NewL(
     CMsvSession& aMsvSession,                           
     TRequestStatus& aObserverRequestStatus,
@@ -39,12 +43,17 @@
     CIpsPlgEventHandler* aEventHandler )
     {
     FUNC_LOG;
-    CIpsPlgPop3ConnectOp* op = 
-        new(ELeave) CIpsPlgPop3ConnectOp( aMsvSession, aObserverRequestStatus, 
-            aService, aForcePopulate, aActivityTimer, aFSMailBoxId,
-            aFSOperationObserver, aFSRequestId, 
-            aEventHandler );
-        
+    CIpsPlgPop3ConnectOp* op = new(ELeave) CIpsPlgPop3ConnectOp(
+        aMsvSession,
+        aObserverRequestStatus,
+        aService,
+        aForcePopulate,
+        aActivityTimer,
+        aFSMailBoxId,
+        aFSOperationObserver,
+        aFSRequestId,
+        aEventHandler );
+
     CleanupStack::PushL( op );
     op->ConstructL();
     CleanupStack::Pop( op );
@@ -58,9 +67,9 @@
 CIpsPlgPop3ConnectOp::~CIpsPlgPop3ConnectOp()
     {
     FUNC_LOG;
-    delete iEntry;
-    delete iSelection;
-    iState = EIdle;
+    // <qmail> removed iEntry;
+    // <qmail> removed iSelection;
+    // <qmail> removed state setting
     }
 
 // ----------------------------------------------------------------------------
@@ -103,22 +112,20 @@
 void CIpsPlgPop3ConnectOp::DoRunL()
     {
     FUNC_LOG;
-    // handle these error situations properly, 
-    // and report somehow back to framework
-    TInt err( KErrNone );
- 
-// <qmail> remove EQueryingDetails state
+    // <qmail> move TInt err declaration later, and narrow the scope
+
+    // <qmail> remove EQueryingDetails state
     if ( iState == EStartConnect )
         {
         if ( iSubOperation )
             {
             // operation exist and it means 
             // disconnect operation was ongoing.
-            // How handle errors
             delete iSubOperation;
             iSubOperation = NULL;
             }
         
+// <qmail> ValidateL removed
         // Begin Connect.
         DoConnectL();
         iState = EConnected;
@@ -126,8 +133,8 @@
     else if ( iState == EConnected )
         {
         // Connect completed
-        err = GetOperationErrorCodeL( );
-        User::LeaveIfError( err );
+// <qmail> Login details checking removed
+        User::LeaveIfError( iStatus.Int() );
         if ( iForcePopulate && Connected() )
             {
             iState = EPopulate;
@@ -144,16 +151,16 @@
         }
     else if ( iState == EPopulate )
         {
-        err = GetOperationErrorCodeL( );
+        // <qmail> suboperation has completed, the result is in 'this->iStatus'
         if ( iEventHandler )
             {
-            iEventHandler->SetNewPropertyEvent( iService, KIpsSosEmailSyncCompleted, err );
+            iEventHandler->SetNewPropertyEvent( iService, KIpsSosEmailSyncCompleted, iStatus.Int() );
             }
         CIpsPlgSyncStateHandler::SaveSuccessfulSyncTimeL( iMsvSession, iService );
 
         // <qmail>
         // start disconnecting
-        iState = Disconnecting;
+        iState = EDisconnecting;
         DoDisconnect();
         // </qmail>
         }
@@ -164,11 +171,7 @@
         CompleteObserver( KErrNone );
         }
     // </qmail>
-    else if ( iState == EErrInvalidDetails )
-        {
-        // proper error code;
-        CompleteObserver( KErrGeneral );
-        }
+    // <qmail> removed state EErrInvalidDetails
     else
         {
         User::Panic( KIpsPlgPopConnectPanic ,KErrNotFound);
@@ -206,12 +209,10 @@
 TFSProgress CIpsPlgPop3ConnectOp::GetFSProgressL() const
     {
     FUNC_LOG;
-    // might not never called, but gives something reasonable if called
     TFSProgress result = { TFSProgress::EFSStatus_Waiting, 0, 0, KErrNone };
-    result.iError = KErrNone;
     switch( iState )
         {
-        // <qmail> removed queryingdetails case
+        // <qmail> removed queryingdetails cases
         case EStartConnect:
         case EConnected:
             result.iProgressStatus = TFSProgress::EFSStatus_Connecting;
@@ -238,6 +239,8 @@
 // ----------------------------------------------------------------------------
 //
 // <qmail> priority parameter has been removed
+// <qmail> MFSMailRequestObserver& changed to pointer
+// <qmail> aSignallingAllowed parameter removed
 CIpsPlgPop3ConnectOp::CIpsPlgPop3ConnectOp(
     CMsvSession& aMsvSession,
     TRequestStatus& aObserverRequestStatus,
@@ -257,11 +260,9 @@
         aFSOperationObserver, 
         aFSRequestId ),
     iState( EIdle ),
-    iEntry( NULL ),
-    iPopulateLimit( KIpsPlgPop3PopulateLimitInitValue ),
     iForcePopulate( aForcePopulate ),
-    iSelection( NULL ),
-    iEventHandler( aEventHandler )
+    iEventHandler( aEventHandler ),
+    iAlreadyConnected( EFalse )
     {
     iService = aServiceId; 
     }
@@ -274,51 +275,36 @@
     {
     FUNC_LOG;
     BaseConstructL( KUidMsgTypePOP3 );
-   	
-    iEntry = iMsvSession.GetEntryL( iService );
-    if ( !iEntry )
-        {
-        User::Leave( KErrGeneral );
-        }
-    iSelection = new(ELeave) CMsvEntrySelection;
-    const TMsvEntry& tentry = iEntry->Entry();
-    
+
+    // <qmail> iSelection construction has been removed
+
+    CMsvEntry* cEntry = iMsvSession.GetEntryL( iService );
+    User::LeaveIfNull( cEntry );
+    // NOTE: Not using cleanupStack as it is not needed in this situation:
+    const TMsvEntry tentry = cEntry->Entry();
+    delete cEntry;
+    cEntry = NULL;
+
     if ( tentry.iType.iUid != KUidMsvServiceEntryValue )
         {
+        // should we panic with own codes?
         User::Leave( KErrNotSupported );
         }
+
+    // <qmail> no need to have population limit as member variable
+    // <qmail> it is read from settings when needed
     
-    // get correct populate and sync limet values from settings
-    CImPop3Settings* settings = new(ELeave) CImPop3Settings();
-    CleanupStack::PushL( settings );
-    TPopAccount popAccountId;
-    CEmailAccounts* accounts = CEmailAccounts::NewLC();
-    accounts->GetPopAccountL( iService , popAccountId );
-    accounts->LoadPopSettingsL( popAccountId, *settings );
-    iPopulateLimit = settings->PopulationLimit();
-    if ( iPopulateLimit > 0 )
-        {
-        iPopulateLimit = ( iPopulateLimit * 1024 ) / 75;
+    if ( tentry.Connected() )
+        {      
+        iState = EConnected;
+		iAlreadyConnected = ETrue;
         }
     else
         {
-        iPopulateLimit = KMaxTInt;
+        iState = EStartConnect;
         }
-    
-    CleanupStack::PopAndDestroy( 2, settings );
-       
-    if ( tentry.Connected() )
-        {      
-        iState = EConnected; 
-        // <qmail> SetActive(); moved inside CompleteThis();
-        CompleteThis();
-        }
-    else
-        {
-        iState = EStartConnect; 
-        // <qmail> SetActive(); moved inside CompleteThis();
-        CompleteThis();
-        }    
+    // <qmail> SetActive(); moved inside CompleteThis();
+    CompleteThis();
     }
 
 // ----------------------------------------------------------------------------
@@ -331,12 +317,13 @@
     // <qmail> unnecessary: iStatus = KRequestPending;
     InvokeClientMtmAsyncFunctionL( KPOP3MTMConnect, iService ); // <qmail> 1 param removed
     SetActive();
-    
+
+// <qmail>
     if ( iEventHandler )
         {
-        iEventHandler->SetNewPropertyEvent( 
-                iService, KIpsSosEmailSyncStarted, KErrNone );
-        } 
+        iEventHandler->SetNewPropertyEvent( iService, KIpsSosEmailSyncStarted, KErrNone );
+        }
+// </qmail>
     }
 
 // ----------------------------------------------------------------------------
@@ -351,15 +338,21 @@
     // Prepare parameters and include filtering
     TImPop3PopulateOptions pop3GetMailInfo;
     pop3GetMailInfo.SetMaxEmailSize( KMaxTInt32 );
-    pop3GetMailInfo.SetPopulationLimit( iPopulateLimit );
+// <qmail>
+    pop3GetMailInfo.SetPopulationLimit( GetPopulateLimitFromSettingsL() );
     TPckgBuf<TImPop3PopulateOptions> params( pop3GetMailInfo );
 
-    iSelection->InsertL(0, iService);
+    // <qmail> selection is no longer a member variable
+    CMsvEntrySelection* selection = new(ELeave) CMsvEntrySelection;
+    CleanupStack::PushL( selection );
+    selection->InsertL( 0, iService );
     iBaseMtm->SwitchCurrentEntryL( iService );
     // Start the fetch operation
-    InvokeClientMtmAsyncFunctionL( KPOP3MTMPopulateAll, *iSelection, params ); // <qmail> 1 param removed
-
+    InvokeClientMtmAsyncFunctionL( KPOP3MTMPopulateAll, *selection, params ); // <qmail> 1 param removed
     SetActive();
+    CleanupStack::PopAndDestroy( selection );
+// <qmail> iEventHandler->SetNewPropertyEvent call removed from here
+// </qmail>
     }
 // <qmail> Connected() moved to baseclass
 
@@ -373,33 +366,11 @@
     }
 
 // <qmail> removed QueryUsrPassL() from here as unneeded
-// <qmail> ValidateL() removed (did nothing)
+// <qmail> removed ValidateL() (did nothing)
+// <qmail> removed TInt CIpsPlgPop3ConnectOp::GetOperationErrorCodeL( )
+// <qmail> removed CIpsPlgImap4ConnectOp::CredientialsSetL
 
-// ----------------------------------------------------------------------------
-// ----------------------------------------------------------------------------    
-// 
-TInt CIpsPlgPop3ConnectOp::GetOperationErrorCodeL( )
-    {
-    FUNC_LOG;
-    if ( !iSubOperation )
-        {
-        return KErrNotFound;
-        }
-    if ( !iSubOperation->IsActive() && iSubOperation->iStatus.Int() != KErrNone )
-        {
-        return iSubOperation->iStatus.Int();
-        }
-    
-    TPckgBuf<TPop3Progress> paramPack;
-    paramPack.Copy( iSubOperation->ProgressL() );
-    const TPop3Progress& progress = paramPack();
-    
-    return progress.iErrorCode;
-    }
-
-// <qmail> Removing CIpsPlgImap4ConnectOp::CredientialsSetL 
-
-//<qmail> new state
+//<qmail> new functions
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 void CIpsPlgPop3ConnectOp::DoDisconnect()
@@ -409,4 +380,28 @@
     InvokeClientMtmAsyncFunctionL( KPOP3MTMDisconnect, iService ); // <qmail> 1 param removed
     SetActive();
     }
+
+// ----------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
+TInt CIpsPlgPop3ConnectOp::GetPopulateLimitFromSettingsL()
+    {
+    FUNC_LOG;
+    TInt limit( KDefaultPopulateLimit );
+        
+    CImPop3Settings* settings = new(ELeave) CImPop3Settings();
+    CleanupStack::PushL( settings );
+    TPopAccount popAccountId;
+    CEmailAccounts* accounts = CEmailAccounts::NewLC();
+    accounts->GetPopAccountL( iService , popAccountId );
+    accounts->LoadPopSettingsL( popAccountId, *settings );
+    limit = settings->PopulationLimit();
+    if ( limit > 0 )
+        {
+        // basically doing a _very_rough_ conversion from kilobyte value to number-of-rows
+    limit = ( limit * KPopulateAlgorithmBytesInKilo ) / KPopulateAlgorithmRowLength;
+        }
+    CleanupStack::PopAndDestroy( 2, settings );
+    return limit;
+    }
+
 //</qmail>
--- a/ipsservices/ipssosplugin/src/ipsplgpop3fetchoperation.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgpop3fetchoperation.cpp	Fri May 14 15:41:10 2010 +0300
@@ -18,16 +18,17 @@
 #include "emailtrace.h"
 #include "ipsplgheaders.h"
 
+// <qmail> priority const has been removed
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
+// <qmail> MFSMailRequestObserver& changed to pointer
 CIpsPlgPop3FetchOperation* CIpsPlgPop3FetchOperation::NewL(
     CMsvSession& aMsvSession,
     TRequestStatus& aObserverRequestStatus,
-    TInt aFunctionId,
     TMsvId aService,
     CIpsPlgTimerOperation& aActivityTimer,
     const TImPop3GetMailInfo& aGetMailInfo,
-    const CMsvEntrySelection& aSel,
+    CMsvEntrySelection* aSelection,
     TFSMailMsgId aFSMailBoxId,
     MFSMailRequestObserver* aFSOperationObserver,
     TInt aFSRequestId,
@@ -35,12 +36,19 @@
     {
     FUNC_LOG;
     CIpsPlgPop3FetchOperation* op = new(ELeave) CIpsPlgPop3FetchOperation(
-        aMsvSession, aObserverRequestStatus, aFunctionId, aService,
-        aActivityTimer, aGetMailInfo, aFSMailBoxId, aFSOperationObserver,
-        aFSRequestId, aEventHandler );
+        aMsvSession,
+        aObserverRequestStatus, 
+        aService,
+        aActivityTimer, 
+        aGetMailInfo,
+        aSelection,
+        aFSMailBoxId, 
+        aFSOperationObserver,
+        aFSRequestId, 
+        aEventHandler );
         
     CleanupStack::PushL(op);
-    op->ConstructL(aSel);
+    op->ConstructL();
     CleanupStack::Pop( op );
     return op;
     }
@@ -53,6 +61,8 @@
     FUNC_LOG;
     delete iFetchErrorProgress;
     delete iSelection;
+    
+    delete iEntry;
     }
 
 // ----------------------------------------------------------------------------
@@ -70,6 +80,7 @@
     else
         {
         TPop3Progress progg;
+        progg.iTotalSize = 0;
         progg.iErrorCode = KErrNone;
         TPckgBuf<TPop3Progress> param(progg);
         iProgressBuf.Copy(param);
@@ -80,14 +91,48 @@
 // ----------------------------------------------------------------------------
 // ConstructL
 // ----------------------------------------------------------------------------
-void CIpsPlgPop3FetchOperation::ConstructL(const CMsvEntrySelection& aSel)
+void CIpsPlgPop3FetchOperation::ConstructL()
     {
     FUNC_LOG;
+
     BaseConstructL( KUidMsgTypePOP3 );
-    iSelection = aSel.CopyL();
+    // <qmail> 1st entry must be serviceId
     iSelection->InsertL( 0, iService );
     // For Get Mail API, first selection element must be service.
-    DoConnectL();
+
+    // It is possible that the complete flag is on and we want to
+    // download the attachment. In these cases we need to clear the
+    // complete flag.
+
+    TInt count = iSelection->Count();
+
+    for ( ; iEntryIndex < count && !iSubOperation; iEntryIndex++ )
+        {
+        delete iEntry;
+        iEntry = NULL;
+        
+        iEntry = iMsvSession.GetEntryL( iSelection->At( iEntryIndex ) );
+
+        TMsvEntry entry = iEntry->Entry();
+        
+        TBool complete = entry.Complete();
+
+        if ( complete )
+            {
+            entry.SetComplete( EFalse );
+
+            iSubOperation = iEntry->ChangeL( entry, iStatus );
+
+            SetActive();
+            
+            iState = EStateClearCompleteFlag;
+            }
+        }
+
+    if ( !iSubOperation )
+        {
+        DoConnectL();
+        }
     }
 
 // ----------------------------------------------------------------------------
@@ -108,7 +153,7 @@
         iStatus, 
         iService, 
         EFalse, 
-        iActivityTimer,
+        *iActivityTimer,
         iFSMailboxId, 
         iFSOperationObserver, 
         iFSRequestId, 
@@ -129,27 +174,39 @@
 
     iState = EStateFetching;
 
-    // Switch operations.
-    delete iSubOperation;
-    iSubOperation = NULL;
+    // <qmail> deletion of possible previous iSubOperaiton is handled in InvokeClientMtmAsyncFunctionL
+    // <qmail> delete iSubOperation;
+    // <qmail> iSubOperation = NULL;
+    iStatus = KRequestPending;
 
     // Filters are not used when performing 'fetch' operation, use normal 
     // getmail info instead
     TPckg<TImPop3GetMailInfo> param( iGetMailInfo );
-    InvokeClientMtmAsyncFunctionL( iFunctionId, *iSelection, param );
+    // <qmail> using constant functionId as its always the same
+    InvokeClientMtmAsyncFunctionL( KPOP3MTMCopyMailSelectionWhenAlreadyConnected, *iSelection, param );
     SetActive();
+    
+    if ( iEventHandler )
+        {
+        iEventHandler->SetNewPropertyEvent( 
+            iService, KIpsSosEmailSyncStarted, KErrNone );
+        } 
+    
     }
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // <qmail> priority parameter has been removed
+// <qmail> MFSMailRequestObserver& changed to pointer
+// <qmail> aFunctionId parameter has been removed
+// <qmail> aSelection parameter has been added
 CIpsPlgPop3FetchOperation::CIpsPlgPop3FetchOperation(
     CMsvSession& aMsvSession,
     TRequestStatus& aObserverRequestStatus,
-    TInt aFunctionId,
     TMsvId aService,
     CIpsPlgTimerOperation& aActivityTimer,
     const TImPop3GetMailInfo& aGetMailInfo,
+    CMsvEntrySelection* aSelection,
     TFSMailMsgId aFSMailBoxId,
     MFSMailRequestObserver* aFSOperationObserver,
     TInt aFSRequestId,
@@ -162,8 +219,8 @@
         aFSMailBoxId,
         aFSOperationObserver, 
         aFSRequestId ),
-    iFunctionId( aFunctionId ),
     iGetMailInfo( aGetMailInfo ), 
+    iSelection( aSelection ),
     iEventHandler( aEventHandler )
     {
     FUNC_LOG;
@@ -194,14 +251,16 @@
     CIpsPlgOnlineOperation::DoCancel();
     if(iState == EStateFetching)
         {
-        // Cancelled while fetching. Need to disconnect.
+        // Stops any operations that a Server-side MTM for the specified service is running,
+        // and then unloads the Server-side MTM.
+        // The current operation and any queued operations are cancelled.
         iMsvSession.StopService( iService );
-        // Ignore return value, nothing we can do.
         }
     if ( iEventHandler )
         {
-        iEventHandler->SetNewPropertyEvent( 
-                iService, KIpsSosEmailSyncCompleted, KErrCancel );
+        // <qmail>
+        iEventHandler->SetNewPropertyEvent( iService, KIpsSosEmailSyncCompleted, KErrCancel );
+		// </qmail>
         }
     }
 
@@ -214,6 +273,49 @@
 
     switch(iState)
         {
+        case EStateClearCompleteFlag:
+            {
+            // First clean things
+            delete iSubOperation;
+            iSubOperation = NULL;
+
+            delete iEntry;
+            iEntry = NULL;
+            
+            // Leave if setting the complete flag was a failure.
+            User::LeaveIfError( iStatus.Int() );
+            
+            TInt count = iSelection->Count();
+
+            for ( ; iEntryIndex < count && !iSubOperation; iEntryIndex++ )
+                {
+                delete iEntry;
+                iEntry = NULL;
+                
+                iEntry = iMsvSession.GetEntryL(
+                    iSelection->At( iEntryIndex ) );
+
+                TMsvEntry entry = iEntry->Entry();
+                
+                TBool complete = entry.Complete();
+
+                if ( complete )
+                    {
+                    entry.SetComplete( EFalse );
+
+                    iSubOperation = iEntry->ChangeL( entry, iStatus );
+
+                    SetActive();
+                    }
+                }
+
+            if ( !iSubOperation )
+                {
+                DoConnectL();
+                }
+            
+            break;
+            }
         case EStateConnecting:
             {
             // Connect complete.
@@ -229,13 +331,14 @@
         case EStateFetching:         
             {
             TInt err = iStatus.Int();
-
-            if( KErrNone != err )
+			// <qmail>
+            if( err )
+			// </qmail>
                 {
                 TPckgBuf<TPop3Progress> paramPack;
                 if ( iSubOperation )
                     {
-                paramPack.Copy( iSubOperation->ProgressL() );
+                    paramPack.Copy( iSubOperation->ProgressL() );
                     }
                 TPop3Progress& progress = paramPack();
                 progress.iErrorCode = err;
@@ -246,8 +349,9 @@
             CompleteObserver( err );
             if ( iEventHandler )
                 {
-                iEventHandler->SetNewPropertyEvent( 
-                        iService, KIpsSosEmailSyncCompleted, err );
+				// <qmail>
+                iEventHandler->SetNewPropertyEvent( iService, KIpsSosEmailSyncCompleted, err );
+				// </qmail>
                 }
             }
             break;
@@ -273,7 +377,7 @@
     FUNC_LOG;
     // might not never called, but gives something reasonable if called
     TFSProgress result = { TFSProgress::EFSStatus_Waiting, 0, 0, KErrNone };
-    result.iError = KErrNone;
+    // <qmail> removed result.iError = KErrNone;
     switch( iState )
         {
         case EStateConnecting:
@@ -303,3 +407,5 @@
     FUNC_LOG;
     return EIpsOpTypePop3FetchOp;
     }
+// </qmail>
+
--- a/ipsservices/ipssosplugin/src/ipsplgpop3plugin.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgpop3plugin.cpp	Fri May 14 15:41:10 2010 +0300
@@ -92,8 +92,10 @@
         case EFSMBoxCapaCanBeDeleted:
         case EFSMBoxCapaSupportsSaveToDrafts:
         case EFSMBoxCapaMeetingRequestRespond:
+        case EFSMboxCapaSupportsAttahmentsInMR:
         case EFSMBoxCapaMeetingRequestCreate:
         case EFSMBoxCapaCanUpdateMeetingRequest:
+        case EFSMBoxCapaRemoveFromCalendar:    
             {
             result = ETrue;
             break;
@@ -161,11 +163,13 @@
     TInt populationLimit( settings->PopulationLimit() );
     CleanupStack::PopAndDestroy( 2, settings );   // >>> settings, accounts
     TBool forcePopulate( EFalse );
+// <qmail>
     /*
     if( populationLimit != KIpsSetDataHeadersOnly )
         {
         forcePopulate = ETrue;
         }*/
+// </qmail>
     
     CIpsPlgBaseOperation* op = CIpsPlgPop3ConnectOp::NewL( 
         *iSession, 
@@ -184,10 +188,10 @@
     iOperations.AppendL( watcher );
     CleanupStack::Pop( watcher );   // >> watcher
     	
-   	//<qmail>
+//<qmail>
     // send part of refresh
     //EmptyOutboxL( aMailBoxId ); // not used in qmail yet
-	  //</qmail>
+//</qmail>
     }
 
 // ---------------------------------------------------------------------------
@@ -334,22 +338,22 @@
     TImPop3GetMailInfo info;
     info.iMaxEmailSize = KMaxTInt32;
     info.iDestinationFolder = aMailBoxId.Id();
-    
+    // <qmail> ownership of selection is moved to the operation
     CIpsPlgBaseOperation* op = CIpsPlgPop3FetchOperation::NewL( 
         *iSession, 
         watcher->iStatus,
-        KPOP3MTMCopyMailSelectionWhenAlreadyConnected,
         aMailBoxId.Id(), 
         ActivityTimerL( aMailBoxId ), 
         info, 
-        *sel, 
+        sel, 
         aMailBoxId, 
         &aObserver, 
         aRequestId,
         iEventHandler );
     
     watcher->SetOperation( op );
-    CleanupStack::PopAndDestroy( sel );
+	// <qmail> change PopAndDestroy to Pop
+    CleanupStack::Pop( sel );
     CleanupStack::Pop( watcher );
     
     iOperations.AppendL( watcher );	
--- a/ipsservices/ipssosplugin/src/ipsplgsearch.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgsearch.cpp	Fri May 14 15:41:10 2010 +0300
@@ -960,18 +960,36 @@
 void CIpsPlgSearch::CollectMessagesL()
     {
     FUNC_LOG;
+    TMsvId mailboxId = iCurrentSearch.iMailbox.Id();
+	TMsvId serviceId;
+	TMsvEntry tEntry;
+	TMsvEntry mailboxServiceEntry;
+	
     // Lets make a huge list of message id's. 
     iEmailMessages.Reset();    
     
     const TInt folders = iCurrentSearch.iFolderIds.Count();
     for ( TInt folder = 0; folder < folders; folder++ )
         {
-        iActiveEntry->SetEntryL( iCurrentSearch.iFolderIds[folder].Id() );        
+        iActiveEntry->SetEntryL( iCurrentSearch.iFolderIds[folder].Id() );  
+    	if( iActiveEntry->Entry().Parent() == KMsvLocalServiceIndexEntryIdValue )
+    		{
+    		User::LeaveIfError(
+    			iMsvSession.GetEntry( mailboxId, serviceId, tEntry ) );
+    		User::LeaveIfError(
+    		    iMsvSession.GetEntry( tEntry.iRelatedId, serviceId, mailboxServiceEntry ) );
+    		}
+    	else
+    		{
+     		serviceId = mailboxId;
+    		}
+
         const TInt msgs = iActiveEntry->Count();
         for ( TInt msg = 0; msg < msgs; msg++ )
             {
             const TMsvEntry& entry = ( *iActiveEntry )[msg];
             if ( entry.iType == KUidMsvMessageEntry &&
+            	 entry.iServiceId == serviceId &&
                  ( entry.iMtm.iUid == KSenduiMtmSmtpUidValue ||
                    entry.iMtm.iUid == iPlugin.MtmId().iUid ) )
                 {
@@ -981,6 +999,15 @@
             }
         }    
     }
+
+//Ask client if it wants to change the search prority (i.e. to enable search for contact)
+void CIpsPlgSearch::ClientRequiredSearchPriority( TInt *apRequiredSearchPriority )
+	{
+	FUNC_LOG;
+	if ( iObserver )
+	  iObserver->ClientRequiredSearchPriority( apRequiredSearchPriority );
+	}
+
     
 // End of File
 
--- a/ipsservices/ipssosplugin/src/ipsplgsearchop.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgsearchop.cpp	Fri May 14 15:41:10 2010 +0300
@@ -22,8 +22,10 @@
 
 /** Snippet length, for HTML tags. */
 const TInt KIpsPlgSnippetLen = 300;
+
+// changed to one mail per one RunL - for cycle in RunL was removed
 // Defines the number of mails handled in one scheduler round
-const TInt KIpsPlgSearchMailsInRound = 10;
+// const TInt KIpsPlgSearchMailsInRound = 10;
 
 // ======== CONSTRUCTORS & DESTRUCTOR ========
 
@@ -85,6 +87,7 @@
     iMessage( NULL )
     {
     FUNC_LOG;
+    iRequiredPriority = Priority(); // priority changes are enabled
     CActiveScheduler::Add( this );
     }
 
@@ -137,13 +140,12 @@
             iObserver.CollectMessagesL();
             iObserver.Sort();
             iState = ERunning;
+            iRequiredPriority = EPriorityStandard; // priority changes may be decreased
             ActivateAndComplete();
             break;
             }
         case ERunning:
             {
-            for ( TInt i(0); i < KIpsPlgSearchMailsInRound; i++ )
-                {
                 if ( NextMailL() )
                     {
                     // Mail found, read the content and search for the string.
@@ -158,9 +160,13 @@
                     FinalizeL();
                     return;
                     }
-                }
+            iState = ERunning;
+// 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);
 
-            iState = ERunning;
             ActivateAndComplete();
             break;
             }
@@ -363,6 +369,11 @@
     {
     FUNC_LOG;
     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();    
     TRequestStatus* status = &iStatus;
     User::RequestComplete( status, KErrNone );    
--- a/ipsservices/ipssosplugin/src/ipsplgsingleopwatcher.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgsingleopwatcher.cpp	Fri May 14 15:41:10 2010 +0300
@@ -99,7 +99,8 @@
     FUNC_LOG;
     Cancel();
     delete iOperation;
-    delete iBaseOperation;      
+    delete iBaseOperation;
+    delete iRequestObserver;
     }
 
 
@@ -228,5 +229,13 @@
     iObserver.OpCompleted( *this, iStatus.Int() );
     }
 
+
+void CIpsPlgSingleOpWatcher::SetRequestObserver(
+    CIpsPlgImap4MoveRemoteOpObserver* aObserver )
+    {
+    delete iRequestObserver;
+    iRequestObserver = aObserver;
+    }
+
 // End of file
 
--- a/ipsservices/ipssosplugin/src/ipsplgsmtpoperation.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgsmtpoperation.cpp	Fri May 14 15:41:10 2010 +0300
@@ -18,6 +18,7 @@
 
 #include "emailtrace.h"
 #include "ipsplgheaders.h"
+#include "miut_err.h" // SMTP error codes
 
 
 const TInt KIpsSmtpOperationCharLessThan = '<';
@@ -26,7 +27,7 @@
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 //
-// <qmail> priority parameter has been removed
+// <qmail> aPriority, aUsePublishSubscribe parameters removed, aOperationObserver, aRequestId added
 EXPORT_C CIpsPlgSmtpOperation* CIpsPlgSmtpOperation::NewL( 
     CMsvSession& aMsvSession, 
     TRequestStatus& aObserverRequestStatus,
@@ -46,7 +47,7 @@
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 //
-// <qmail> priority parameter has been removed
+// <qmail> aPriority, aUsePublishSubscribe parameters removed, aOperationObserver, aRequestId added
 EXPORT_C CIpsPlgSmtpOperation* CIpsPlgSmtpOperation::NewLC( 
     CMsvSession& aMsvSession, 
     TRequestStatus& aObserverRequestStatus,
@@ -66,7 +67,7 @@
    
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
-// <qmail> priority parameter has been removed
+// <qmail> aPriority parameter removed, aOperationObserver, aRequestId added
 CIpsPlgSmtpOperation::CIpsPlgSmtpOperation( 
     CMsvSession& aMsvSession, 
     TRequestStatus& aObserverRequestStatus,
@@ -77,7 +78,9 @@
     iOperation( NULL ),
     iSelection( NULL ),  
     iMtmRegistry( NULL ),
-    iFSOperationObserver( aFSOperationObserver )
+    iState( EIdle ),
+    iFSOperationObserver( aFSOperationObserver ),
+    iEventHandler( NULL )
     {
     FUNC_LOG;
     }
@@ -93,6 +96,9 @@
     delete iMtmRegistry;
     delete iSelection;
     delete iOperation;
+    iOperation = NULL;
+    iEventHandler = NULL;
+    iState = EIdle;
     } 
 
 // ---------------------------------------------------------------------------
@@ -104,42 +110,76 @@
     iSelection = new (ELeave) CMsvEntrySelection();
     CActiveScheduler::Add( this );
     }
-    
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CIpsPlgSmtpOperation::CompleteObserver( TInt aStatus /*= KErrNone*/ )
+    {
+    FUNC_LOG;
+
+    TRequestStatus* status = &iObserverRequestStatus;
+    if ( status && status->Int() == KRequestPending )
+        {
+        User::RequestComplete( status, aStatus );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CIpsPlgSmtpOperation::CompleteThis()
+    {
+    FUNC_LOG;
+
+    TRequestStatus* status = &iStatus;
+    User::RequestComplete( status, KErrNone );
+    }
+
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 //
 void CIpsPlgSmtpOperation::RunL()
     {
     FUNC_LOG;
-    
-    
-    if ( iState == EMovingOutbox )
-        {
-        delete iOperation;
-        iOperation = NULL;
-        iSelection->InsertL(0, iSmtpService );
-        CallSendL( );
-        }
-    else if ( iState == ESending )
+
+    switch ( iState )
         {
-        TImSmtpProgress prog;
-        TPckg<TImSmtpProgress> param(prog);
-        param.Copy( iOperation->FinalProgress() ); 
-        
-        if ( iFSOperationObserver )
+        case EMovingOutbox:
+            {
+            delete iOperation;
+            iOperation = NULL;
+            iSelection->InsertL( 0, iSmtpService );
+            CallSendL();
+            break;
+            }
+        case ESending:
             {
-            iFSProgress.iProgressStatus =
-                TFSProgress::EFSStatus_RequestComplete;
-            iFSProgress.iError = prog.Error();
+            TImSmtpProgress prog;
+            TPckg<TImSmtpProgress> param(prog);
+            param.Copy( iOperation->FinalProgress() );
+
+// <qmail> Removed login error handling
+
+// <qmail>
+	        if ( iFSOperationObserver )
+	            {
+	            iFSProgress.iProgressStatus =
+	                TFSProgress::EFSStatus_RequestComplete;
+	            iFSProgress.iError = prog.Error();
 
-            TRAP_IGNORE( iFSOperationObserver->RequestResponseL(
-                iFSProgress, iFSRequestId ) );
+	            TRAP_IGNORE( iFSOperationObserver->RequestResponseL(
+	                iFSProgress, iFSRequestId ) );
+	            }
+	        TRequestStatus* status = &iObserverRequestStatus;
+	        User::RequestComplete( status, prog.Error() );
+    		break;
+// <qmail>
             }
-        TRequestStatus* status = &iObserverRequestStatus;
-        User::RequestComplete( status, prog.Error() );
         }
-    }
+	}
 
+// <qmail>
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 //
@@ -161,7 +201,7 @@
     
     return KErrNone;
     }
-
+// </qmail>
 
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
@@ -178,9 +218,7 @@
     // It is not relevant to inform FS observer. Cancelling is initiated
     // either by the observer or the engine destructor when the application
     // exits.
-    
-    TRequestStatus* status = &iObserverRequestStatus;
-    User::RequestComplete( status, KErrCancel );
+    CompleteObserver( KErrCancel );
     }
 
 // ---------------------------------------------------------------------------
@@ -197,6 +235,7 @@
     return KNullDesC8;
     }
 
+// <qmail>
 // ---------------------------------------------------------------------------
 // CIpsPlgSmtpOperation::GetErrorProgressL
 // ---------------------------------------------------------------------------
@@ -227,6 +266,7 @@
     FUNC_LOG;
     return EIpsOpTypeSmtp;
     }
+// </qmail>
 
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
@@ -349,6 +389,12 @@
         {
         CallSendL();
         }
+    else
+        {
+        // nothing to do, finish operation
+        CompleteObserver( KErrNone );
+        }
+
     return retValue;
     }
 
@@ -441,12 +487,23 @@
             fullName.Set( aRecipients[i].Mid( start, ( end - start ) ) );
             }
         // make basic sanity checks for email address
+// <qmail>
         //if( !IpsSetUtils::IsValidEmailAddressL( fullName ) )
         //    {
         //    User::Leave( KErrBadName );
         //    }
+// </qmail>
         }
     }
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CIpsPlgSmtpOperation::SetEventHandler( TAny* aEventHandler )
+    {
+    iEventHandler = aEventHandler;
+    }
+// <qmail> TBool CIpsPlgSmtpOperation::QueryUserPassL() removed
+// <qmail> void CIpsPlgSmtpOperation::CredientialsSetL( TInt aEvent )
 
 // End of File
 
--- a/ipsservices/ipssosplugin/src/ipsplgsmtpservice.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgsmtpservice.cpp	Fri May 14 15:41:10 2010 +0300
@@ -19,6 +19,9 @@
 #include "emailtrace.h"
 #include "ipsplgheaders.h"
 
+#include <featmgr.h>
+#include <bldvariant.hrh> // for feature definitions
+
 // <cmail> const TInt KIpsSetUtilsCharAt = '@'; </cmail>
 const TInt KIpsSetUtilsCharLessThan = '<';
 const TInt KIpsSetUtilsCharMoreThan = '>';
@@ -48,6 +51,11 @@
     {
     FUNC_LOG;
     delete iMsgMapper;
+    
+    if( iFeatureManagerInitialized )
+    	{
+    	FeatureManager::UnInitializeLib();  
+    	}
     }    
 
 // ---------------------------------------------------------------------------
@@ -89,6 +97,9 @@
     {
     FUNC_LOG;
     iMsgMapper = CIpsPlgMsgMapper::NewL( iSession, iPlugin );
+    
+    FeatureManager::InitializeLibL();
+    iFeatureManagerInitialized = ETrue;
     }
 
 // ---------------------------------------------------------------------------
@@ -154,7 +165,9 @@
         }
     
     // To Field
+// <qmail> return by value, because Qt types are used for internal CFSMailAddress data storage
     RPointerArray<CFSMailAddress> toArray = aMessage.GetToRecipients();
+// </qmail>
     // Reseting recipient list, because our client calls us many times
     // and we want to avoid duplicates
     header->ToRecipients().Reset();
@@ -179,21 +192,33 @@
         }   
     
     // CC field
+// <qmail> return by value, because Qt types are used for internal CFSMailAddress data storage
     RPointerArray<CFSMailAddress> ccArray 
         = aMessage.GetCCRecipients();
+// </qmail>
     header->CcRecipients().Reset();
     for( TInt i = 0; i < ccArray.Count(); i++ )
         {
-        header->CcRecipients().AppendL( ccArray[i]->GetEmailAddress() ); // copy created
+        TPtrC displayName = ccArray[i]->GetDisplayName();
+        TPtrC emailName = ccArray[i]->GetEmailAddress();
+        HBufC* fullName = CreateDisplayStringLC( displayName, emailName );  // << fullName
+        header->CcRecipients().AppendL( *fullName );
+        CleanupStack::PopAndDestroy( fullName );    // >>> fullName
         }
     
     // BCC field
+// <qmail> return by value, because Qt types are used for internal CFSMailAddress data storage
     RPointerArray<CFSMailAddress> bccArray 
         = aMessage.GetBCCRecipients();
+// </qmail>
     header->BccRecipients().Reset();
     for( TInt i = 0; i < bccArray.Count(); i++ )
         {
-        header->BccRecipients().AppendL( bccArray[i]->GetEmailAddress() ); // copy created
+        TPtrC displayName = bccArray[i]->GetDisplayName();
+        TPtrC emailName = bccArray[i]->GetEmailAddress();
+        HBufC* fullName = CreateDisplayStringLC( displayName, emailName );  // << fullName
+        header->BccRecipients().AppendL( *fullName ); // copy created
+        CleanupStack::PopAndDestroy( fullName );    // >>> fullName
         }
     
     // Subject, check null pointer
@@ -255,7 +280,7 @@
     return CreateFSMessageAndSetFlagsL( 
             msgId, KErrNotFound, aMailBoxId.Id() );
     }
-
+    
 // ---------------------------------------------------------------------------
 // CIpsPlgSmtpService::CreateForwardSmtpMessageL
 // ---------------------------------------------------------------------------
@@ -277,11 +302,17 @@
         User::Leave(KErrNotFound);
         }
     
+    // In case original message is in Sent folder, it's serviceId must be
+    // changed before starting forward/reply msg creation operation
+    // (after forward msg is created, this is changed back)
+    TMsvId orgServiceId( 0 );
     if ( ( orgMsg.Parent() == KMsvSentEntryIdValue ) && 
          ( orgMsg.iMtm == KSenduiMtmSmtpUid ) )
         {
+        orgServiceId = orgMsg.iServiceId;
         ChangeServiceIdL( orgMsg );
         }
+
     TMsvPartList partList( KMsvMessagePartBody | KMsvMessagePartAttachments );
     
     CIpsPlgOperationWait* wait = CIpsPlgOperationWait::NewLC( );
@@ -301,10 +332,17 @@
     TMsvId msgId = GetIdFromProgressL( forwMailOp->FinalProgress() );
     
     CleanupStack::PopAndDestroy( 2, wait );
+
+    // If original message's serviceId was changed prior to forward/reply msg
+    // creation op, changing it back to the original
+    if ( orgServiceId )
+        {
+        ChangeServiceIdL( orgMsg, orgServiceId );
+        }
     
     return CreateFSMessageAndSetFlagsL( msgId, orgMsg.Id(), aMailBoxId.Id() );
     }
-
+    
 // ---------------------------------------------------------------------------
 // CIpsPlgSmtpService::CreateReplySmtpMessageL
 // ---------------------------------------------------------------------------
@@ -326,9 +364,14 @@
         User::Leave(KErrNotFound);
         }
     
+    // In case original message is in Sent folder, it's serviceId must be
+    // changed before starting forward/reply msg creation operation
+    // (after forward msg is created, this is changed back)
+    TMsvId orgServiceId( 0 );
     if ( ( orgMsg.Parent() == KMsvSentEntryIdValue ) && 
          ( orgMsg.iMtm == KSenduiMtmSmtpUid ) )
         {
+        orgServiceId = orgMsg.iServiceId;
         ChangeServiceIdL( orgMsg );
         }
     
@@ -355,6 +398,13 @@
     TMsvId msgId = GetIdFromProgressL( replMailOp->FinalProgress() );
     CleanupStack::PopAndDestroy( 2, wait );
     
+    // If original message's serviceId was changed prior to forward/reply msg
+    // creation op, changing it back to the original
+    if ( orgServiceId )
+        {
+        ChangeServiceIdL( orgMsg, orgServiceId );
+        }
+
     // Start finalising new FS style message
     CFSMailMessage* fsMsg = CreateFSMessageAndSetFlagsL( 
             msgId, orgMsg.Id(), aMailBoxId.Id() );
@@ -386,15 +436,59 @@
         CleanupStack::PopAndDestroy( emailAddr ); // emailAddr not used
         }
     // copy cc recipients
+    // <cmail>
+    TFSMailMsgId folderId;
+    TFSMailDetails details( EFSMsgDataEnvelope );
+    CFSMailMessage* originalMessage = iPlugin.GetMessageByUidL( aMailBoxId, 
+                                       folderId, aOriginalMessageId, details );
+    CleanupStack::PushL( originalMessage );
+// <qmail> return by value, because Qt types are used for internal CFSMailAddress data storage
+    const RPointerArray<CFSMailAddress>& originalToRecipients = 
+                                            originalMessage->GetToRecipients();
+// </qmail>
+    TInt originalToRecipientsCount = originalToRecipients.Count(); 
+    TBool present = EFalse;
+    // </cmail>
     for( TInt i = 0; i < header->CcRecipients().Count(); i++ )
         {
         emailAddr = header->CcRecipients()[i].AllocLC(); // ***
         fsAddr = CFSMailAddress::NewLC(); // ***
         fsAddr->SetEmailAddress( *emailAddr ); // Copy created
-        fsMsg->AppendCCRecipient( fsAddr ); // No copy
+        // <cmail>
+        if( aReplyToAll )
+            {
+            // check if CC recipient read from header was present in To field
+            // of original message. If so, copy it into To recipietns
+            present = EFalse;
+            for( TInt j = 0; j < originalToRecipientsCount; j++ )
+                {
+                if( emailAddr->Find( originalToRecipients[j]->GetEmailAddress())
+                                                              != KErrNotFound )
+                    {
+                    present = ETrue;
+                    break;
+                    }
+                }
+            if( present )
+                {
+                fsMsg->AppendToRecipient( fsAddr ); // No copy
+                }
+            else
+                {
+                fsMsg->AppendCCRecipient( fsAddr ); // No copy
+                }
+            }
+        else
+        {
+            fsMsg->AppendCCRecipient( fsAddr ); // No copy
+        }
+        // </cmail>
         CleanupStack::Pop( fsAddr ); // fsAddr belong now to fsMsg
         CleanupStack::PopAndDestroy( emailAddr ); // emailAddr not used
         }
+    // <cmail>
+    CleanupStack::PopAndDestroy( originalMessage );
+    // </cmail>
     // copy bcc recipients
     for( TInt i = 0; i < header->BccRecipients().Count(); i++ )
         {
@@ -431,7 +525,21 @@
         }
     CleanupStack::PopAndDestroy( cEntry );
     }
-    
+
+// ---------------------------------------------------------------------------
+// CIpsPlgSmtpService::ChangeServiceIdL
+// ---------------------------------------------------------------------------
+//
+void CIpsPlgSmtpService::ChangeServiceIdL( TMsvEntry& aEntry, TMsvId aServiceId )
+    {
+    FUNC_LOG;
+    CMsvEntry* cEntry = iSession.GetEntryL( aEntry.Id() );
+    CleanupStack::PushL( cEntry );
+    aEntry.iServiceId = aServiceId;
+    cEntry->ChangeL( aEntry );
+    CleanupStack::PopAndDestroy( cEntry );
+    }
+
 // ---------------------------------------------------------------------------
 // CIpsPlgSmtpService::CreateFSMessageAndSetFlagsL
 // ---------------------------------------------------------------------------
@@ -444,10 +552,44 @@
     {
     FUNC_LOG;
 
+    
+   
+    // tp teleca change for korean specific email encoding
     // Default charset
     TUid charset;
     charset.iUid = KCharacterSetIdentifierUtf8;
 
+      // korea specific charset
+      if ( FeatureManager::FeatureSupported( KFeatureIdKorean ))
+      {
+      
+      //const TUid KCRUidEMailCharsets = {0x20018441};    // korea needs different default charset
+          const TInt KoreanMib = 38; // magic number to read from cen rep would be better
+            
+		  CCnvCharacterSetConverter* charConv = NULL;
+		  TRAPD( err, charConv = CCnvCharacterSetConverter::NewL() );
+		  if( err == KErrNone )
+			  {
+			  TUint characterSetId = KCharacterSetIdentifierUtf8;
+			  RFs fs;
+			  TInt err = fs.Connect();
+			  
+			  if( err == KErrNone )
+				  {
+				  TRAP( err, characterSetId = charConv->ConvertMibEnumOfCharacterSetToIdentifierL( KoreanMib, fs ));
+				   if( err == KErrNone )
+					   { // set korean specific charset
+					   charset = TUid::Uid( characterSetId );
+					   }
+				   fs.Close();
+				  }
+			  }
+
+         delete charConv; 
+     
+      }
+      // tp teleca change END
+
     // set in preparation flag, altought 
     // not known where this affects
     TMsvId dummy;
@@ -462,15 +604,15 @@
         TMsvEntry orgMsg;
         //get entry errors not handled
         iSession.GetEntry( aOriginalMsgId, dummy, orgMsg );
-        iSession.GetEntry( aMessageId, dummy, newEmailMsg );
         const TMsvEmailEntry& orgEmailMsg(orgMsg);
         
         // symbian not mark same priority to reply / forward messages
+// <qmail>
         if ( aCopyOriginalMsgProperties && orgEmailMsg.Priority() != newEmailMsg.Priority() )
+// </qmail>
             {
             newEmailMsg.SetPriority( orgEmailMsg.Priority() );
             }
-        
         //get charset from original message
         charset = GetOriginalCharsetL( aOriginalMsgId );
         }
@@ -497,15 +639,16 @@
     fsMsg->SetFolderId( 
         TFSMailMsgId( iPlugin.PluginId(), KMsvDraftEntryId ) );
 
+// <qmail>
     // update subject
     fsMsg->SetSubject( newEmailMsg.iDescription );
+// </qmail>
     
     //update flags
     iMsgMapper->SetFSMessageFlagsL( newEmailMsg, *fsMsg );
     
     return fsMsg;
     }
-    
 
 // ---------------------------------------------------------------------------
 // CIpsPlgSmtpService::GetIdFromProgressL
--- a/ipsservices/ipssosplugin/src/ipsplgsosbaseplugin.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgsosbaseplugin.cpp	Fri May 14 15:41:10 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -11,17 +11,21 @@
 *
 * Contributors:
 *
-* Description: This file implements classes CIpsPlgSosBasePlugin, Plugin. 
+* Description: This file implements classes CIpsPlgSosBasePlugin, Plugin.
  *
 */
 
-
-
 #include "emailtrace.h"
 #include "ipsplgheaders.h"
+
+// <qmail> FreestyleEmailUiConstants include removed
+
+// <qmail>
 #include "ipsplgsosbaseplugin.hrh"
 #include "ipsplgmailstoreroperation.h"
 #include "ipsplgmessagepartstoreroperation.h"
+#include "BasePlugin.h" 
+//</qmail>
 
 // <cmail> S60 UID update
 #define FREESTYLE_EMAIL_UI_SID 0x200255BA
@@ -40,16 +44,16 @@
 #ifdef __WINS__
 _LIT( KEmulatorIMEI, "123456789012345" );
 #endif // __WINS__
-  
+
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
-//
+// <qmail> iSettingsApi removed
 CIpsPlgSosBasePlugin::CIpsPlgSosBasePlugin( const TUint aFSPluginId ) :
     iFSPluginId( aFSPluginId ),
     iSession( NULL ),
     iMsgMapper( NULL ),
     iOperations( KOpGranularity ),
-    iActivitytimers( KOpGranularity ), 
+    iActivitytimers( KOpGranularity ),
     iSmtpService( NULL ),
     iCachedEntry( NULL ),
     iCachedEmailMessage( NULL ),
@@ -65,7 +69,7 @@
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
-//
+// <qmail> iSettingsApi, iWait removed
 CIpsPlgSosBasePlugin::~CIpsPlgSosBasePlugin()
     {
     FUNC_LOG;
@@ -88,19 +92,20 @@
     delete iSession;
     delete iBrandingId;
     }
- 
+
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 void CIpsPlgSosBasePlugin::BaseConstructL()
     {
     FUNC_LOG;
     iEventHandler = CIpsPlgEventHandler::NewL( *this );
-    iSession = CMsvSession::OpenAsyncL( *iEventHandler );   
+    iSession = CMsvSession::OpenAsyncL( *iEventHandler );
     iMsgMapper = CIpsPlgMsgMapper::NewL( *iSession, *this );
     iSmtpService = CIpsPlgSmtpService::NewL( *iSession, *this );
     iMruList = CIpsPlgMruList::NewL( );
     iSearch = CIpsPlgSearch::NewL( *iSession, *this );
-    iSyncStateHandler = CIpsPlgSyncStateHandler::NewL( 
+	// <qmail> iSettingsApi removed
+    iSyncStateHandler = CIpsPlgSyncStateHandler::NewL(
             *iSession, *this, iOperations );
     iEventHandler->RegisterPropertyObserverL( iSyncStateHandler );
 
@@ -115,30 +120,30 @@
         }
 
 #ifndef RD_101_EMAIL
-    RAlwaysOnlineClientSession aosession; 
+    RAlwaysOnlineClientSession aosession;
     TInt err = aosession.Connect();
     if ( err == KErrNone )
         {
         TBuf8<1> dummyBuf;
-        TRAP( err, aosession.RelayCommandL( 
-                EServerAPIEmailDisableAOEmailPlugin, 
+        TRAP( err, aosession.RelayCommandL(
+                EServerAPIEmailDisableAOEmailPlugin,
                 dummyBuf ) );
         }
     aosession.Close();
 #endif    
-    } 
+    }
 
 // ----------------------------------------------------------------------------
-// ----------------------------------------------------------------------------	
+// ----------------------------------------------------------------------------
 void CIpsPlgSosBasePlugin::CompleteConstructL()
     {
     FUNC_LOG;
     iSessionOk = ETrue;
-    iEventHandler->CompleteConstructL( iSession ); 
+    iEventHandler->CompleteConstructL( iSession );
     }
-    
+
 // ----------------------------------------------------------------------------
-// ----------------------------------------------------------------------------	
+// ----------------------------------------------------------------------------
 void CIpsPlgSosBasePlugin::SessionTerminated()
     {
     FUNC_LOG;
@@ -147,12 +152,12 @@
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
-void CIpsPlgSosBasePlugin::OpCompleted( 
-	CIpsPlgSingleOpWatcher& aOpWatcher, 
+void CIpsPlgSosBasePlugin::OpCompleted(
+	CIpsPlgSingleOpWatcher& aOpWatcher,
 	TInt aCompletionCode )
     {
     FUNC_LOG;
-    // Get valid operation count in each, some operations could have been 
+    // Get valid operation count in each, some operations could have been
     // deleted in array
     TInt opId = aOpWatcher.Operation().Id();
     for ( TInt i = iOperations.Count()-1; i >= 0; i-- )
@@ -163,12 +168,14 @@
             {
             DeleteAndRemoveOperation( i, aCompletionCode );
             }
+
+// <qmail> iWait removed
         }
     }
 
 // ----------------------------------------------------------------------------
-// ----------------------------------------------------------------------------    
- TFSMailBoxStatus CIpsPlgSosBasePlugin::GetMailBoxStatus( 
+// ----------------------------------------------------------------------------
+ TFSMailBoxStatus CIpsPlgSosBasePlugin::GetMailBoxStatus(
     const TFSMailMsgId&  aMailBoxId  )
     {
     FUNC_LOG;
@@ -178,7 +185,7 @@
     if( iSessionOk )
         {
         iSession->GetEntry( aMailBoxId.Id(), service, tEntry );
-        
+
         if ( tEntry.Connected() )
             {
             status = EFSMailBoxOnline;
@@ -187,7 +194,7 @@
             {
             status = EFSMailBoxOnline;
             }
-        else 
+        else
             {
             status = EFSMailBoxOffline;
             }
@@ -202,7 +209,7 @@
 // ----------------------------------------------------------------------------
 // CIpsPlgSosBasePlugin::SpecifiedSendingMailbox
 // Returns 'null' ID, because the method is not relevant with IPS protocols
-// ----------------------------------------------------------------------------    
+// ----------------------------------------------------------------------------
  TFSMailMsgId CIpsPlgSosBasePlugin::SpecifiedSendingMailbox()
      {
     FUNC_LOG;
@@ -210,21 +217,21 @@
      }
 
  // ----------------------------------------------------------------------------
- // ----------------------------------------------------------------------------    
+ // ----------------------------------------------------------------------------
 void CIpsPlgSosBasePlugin::ListMailBoxesL( RArray<TFSMailMsgId>& aMailboxes )
 	{
     FUNC_LOG;
-	
+
 	if( !iSessionOk )
         {
         User::Leave( KErrNotReady );
         }
 	CMsvEntry* cEntry = iSession->GetEntryL( KMsvRootIndexEntryId );
     CleanupStack::PushL( cEntry );
-    
+
     CMsvEntrySelection* childEntries = cEntry->ChildrenWithMtmL( MtmId() );
     CleanupStack::PushL( childEntries );
-    
+
     TInt count( childEntries->Count() );
     for ( TInt i(0); i < count; i++)
         {
@@ -232,9 +239,9 @@
     	TMsvEntry tEntry;
     	TMsvId serviceId;
     	TDriveUnit driveUnit = EDriveC;
-    	
+
         iSession->GetEntry( childEntries->At(i), serviceId, tEntry );
-        
+
         if( iIMEI.Compare( tEntry.iDescription ) == 0 )
             {
             mailboxId.SetPluginId( TUid::Uid( PluginId() ) );
@@ -257,11 +264,11 @@
         }
     CleanupStack::PopAndDestroy( 2, cEntry ); // childEntries
 	}
- 
+
+// ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 
-CFSMailBox* CIpsPlgSosBasePlugin::GetMailBoxByUidL( 
-    const TFSMailMsgId& aMailBoxId) 
+CFSMailBox* CIpsPlgSosBasePlugin::GetMailBoxByUidL(
+    const TFSMailMsgId& aMailBoxId)
 	{
     FUNC_LOG;
     CFSMailBox* result( NULL );
@@ -269,20 +276,21 @@
     TMsvId    serviceId;
     TInt      status;
     HBufC*    address( NULL );
-    
+
     if( !iSessionOk )
         {
         User::Leave( KErrNotReady );
         }
     status = iSession->GetEntry( aMailBoxId.Id(), serviceId, tEntry );
-    
+
     if ( status == KErrNone )
-        {  
+        {
         result = CFSMailBox::NewL( aMailBoxId );
         CleanupStack::PushL( result );   // << result
         result->SetName( tEntry.iDetails );
         result->SetSettingsUid( TUid::Uid( IPS_SET_ECOM_IMPLEMENTATION_UID ) );
-        
+
+// <qmail>
         CEmailAccounts* acc = CEmailAccounts::NewLC();
         TSmtpAccount smtpAcc;
         acc->GetSmtpAccountL( tEntry.iRelatedId , smtpAcc );
@@ -291,6 +299,7 @@
         acc->LoadSmtpSettingsL( smtpAcc, *smtpSet );
         address = smtpSet->EmailAddress().AllocL();
         CleanupStack::PopAndDestroy( 2, acc );
+// </qmail>
         
         CleanupStack::PushL( address ); // << address
         CFSMailAddress* fsAddress = CFSMailAddress::NewLC();    // << fsAddress
@@ -300,12 +309,12 @@
         CleanupStack::PopAndDestroy( address ); // >>> address
         CleanupStack::Pop( result );    // >> result
         }
-    
+
     return result;
 	}
 
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 
+// ----------------------------------------------------------------------------
 void CIpsPlgSosBasePlugin::DeleteMailBoxByUidL(
     const TFSMailMsgId& aMailBoxId,
     MFSMailRequestObserver& aOperationObserver,
@@ -319,6 +328,7 @@
         User::Leave( KErrNotReady );
         }
     
+// <qmail> RAlwaysOnlineClientSession - related code removed
     // Prepare the parameters to be forwarded to AO-server
     TPckg<TMsvId> param = aMailBoxId.Id();
 
@@ -327,26 +337,43 @@
 
     iSyncStateHandler->NotifyMailboxRemove( aMailBoxId.Id() );
 
+// <qmail> CancelAllOnlineOperations function call removed
     iSession->GetEntry( aMailBoxId.Id(), service, tEntry );
     if ( tEntry.Connected() )
         {
         DisconnectL( aMailBoxId, aOperationObserver, aRequestId, ETrue );
+
+        // remove activity timer from array here but leave the actual delete
+        // to the disconnect operation. This is because the disconnect op
+        // sometimes tries to use the timer after it was deleted here.
+        TInt timerCount = iActivitytimers.Count();
+        for ( TInt j = 0; j < timerCount; j++ )
+            {
+            if ( iActivitytimers[j]->FSMailboxId() == aMailBoxId )
+                {
+                iActivitytimers.Remove( j );
+                timerCount--;
+                j--;
+                }
+            }
         }
     else
         {
+// <qmail> iSettingsApi removed
         TFSProgress progress = { TFSProgress::EFSStatus_Waiting, 0, 0, KErrNone };
         progress.iProgressStatus = TFSProgress::EFSStatus_RequestComplete;
         progress.iError = KErrNone;
         TInt requestId = aRequestId;
         aOperationObserver.RequestResponseL( progress, requestId );
+
+        DeleteActivityTimer( aMailBoxId  );
         }
-    DeleteActivityTimer( aMailBoxId  );
     }
 
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 
-TDesC& CIpsPlgSosBasePlugin::GetBrandingIdL( const TFSMailMsgId& aMailBoxId ) 
-    {    
+// ----------------------------------------------------------------------------
+TDesC& CIpsPlgSosBasePlugin::GetBrandingIdL( const TFSMailMsgId& aMailBoxId )
+    {
     FUNC_LOG;
     if( !iSessionOk )
         {
@@ -355,14 +382,16 @@
     CMsvEntry* mboxEntry = iSession->GetEntryL( aMailBoxId.Id() );
     CleanupStack::PushL( mboxEntry );
 
+// <qmail> iSettingsApi removed, iBrandingId removed
     CleanupStack::PopAndDestroy( mboxEntry );
-    
+
     return *iBrandingId;
     }
 
 // ----------------------------------------------------------------------------
-// ----------------------------------------------------------------------------   
-void CIpsPlgSosBasePlugin::MoveMessagesL( 
+// Pop3 has no implementation for this virtual
+// ----------------------------------------------------------------------------
+void CIpsPlgSosBasePlugin::MoveMessagesL(
     const TFSMailMsgId& aMailBoxId,
     const RArray<TFSMailMsgId>& aMessageIds,
     const TFSMailMsgId& aSourceFolderId,
@@ -372,48 +401,79 @@
 	// Pop3 has no implementation for this virtual
 	if( aDestinationFolderId.Id() == KMsvDraftEntryId  )
 	    {
-	    MoveMessagesToDraftL( 
-	        aMailBoxId, 
-	                          aMessageIds, 
-	                          aSourceFolderId, 
-	                          aDestinationFolderId );
+	    MoveMessagesToDraftL(
+	        aMailBoxId,
+	        aMessageIds,
+	        aSourceFolderId,
+	        aDestinationFolderId );
 	    }
 	}
 
 // ----------------------------------------------------------------------------
-// ----------------------------------------------------------------------------	
+// asynchronic version from move messages function, pop3 plugin not implent
+// this virtual fucntion.
+// ----------------------------------------------------------------------------
+TInt CIpsPlgSosBasePlugin::MoveMessagesL(
+    const TFSMailMsgId& aMailBoxId,
+    const RArray<TFSMailMsgId>& aMessageIds,
+    const TFSMailMsgId& aSourceFolderId,
+    const TFSMailMsgId& aDestinationFolderId,
+    MFSMailRequestObserver& aOperationObserver,
+    TInt aRequestId )
+    {
+    FUNC_LOG;
+    TInt ret = KErrNotSupported;
+    if( aDestinationFolderId.Id() == KMsvDraftEntryId  )
+        {
+        MoveMessagesToDraftL(
+            aMailBoxId,
+            aMessageIds,
+            aSourceFolderId,
+            aDestinationFolderId );
+        ret = KErrNone;
+        }
+    ret = KErrNotSupported;
+    TFSProgress progress = { 
+            TFSProgress::EFSStatus_RequestComplete, 0, 0, ret };
+    aOperationObserver.RequestResponseL(
+            progress, aRequestId );
+    return ret;
+    }
+
+// ----------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
 void CIpsPlgSosBasePlugin::MoveMessagesToDraftL(
-    const TFSMailMsgId& /*aMailBoxId*/, 
-    const RArray<TFSMailMsgId>& aMessageIds, 
-    const TFSMailMsgId& aSourceFolderId, 
+    const TFSMailMsgId& /*aMailBoxId*/,
+    const RArray<TFSMailMsgId>& aMessageIds,
+    const TFSMailMsgId& aSourceFolderId,
     const TFSMailMsgId& aDestinationFolderId )
     {
     FUNC_LOG;
-    
+
     TInt count( aMessageIds.Count() );
     if ( !count )
         {
         User::Leave( KErrArgument );
         }
-            
+
     if( !iSessionOk )
         {
         User::Leave( KErrNotReady );
         }
-     
+
     TMsvId msgService;
     TMsvEntry tEntry;
-       
+
     CMsvEntrySelection* sel = new(ELeave) CMsvEntrySelection;
     CleanupStack::PushL(sel);
 
     CMsvEntry* msgEntry = iSession->GetEntryL( aMessageIds[0].Id() );
     CleanupStack::PushL( msgEntry );
-    
+
 	for( TInt i(0); i < count; i++ )
         {
         iSession->GetEntry( aMessageIds[i].Id(), msgService, tEntry );
-        
+
         if( aSourceFolderId.Id() == KMsvGlobalOutBoxIndexEntryIdValue )
             {
             if( tEntry.SendingState() != KMsvSendStateSending )
@@ -433,7 +493,7 @@
         else
             {
             sel->AppendL( tEntry.Id() );
-            }            
+            }
         }
     if( sel->Count() )
         {
@@ -443,25 +503,25 @@
             CMsvEntry* cEntry = iSession->GetEntryL( aSourceFolderId.Id() );
             CleanupStack::PushL( cEntry );
             cEntry->MoveL(
-                *sel, 
+                *sel,
                            aDestinationFolderId.Id(),//KMsvDraftEntryIdValue
                            wait->iStatus );
-                           
-            CleanupStack::PopAndDestroy( cEntry );                           
+
+            CleanupStack::PopAndDestroy( cEntry );
             }
         else
             {
             // Message is in editing state, we can't use parent as entry
-            // because it's equal to destination. 
+            // because it's equal to destination.
             TMsvId parent = msgEntry->Entry().Parent();
             msgEntry->SetEntryL( parent );
             msgEntry->CopyL(
-                *sel, 
+                *sel,
                              aDestinationFolderId.Id(),//KMsvDraftEntryIdValue
                              wait->iStatus );
             }
         wait->Start();
-        CleanupStack::PopAndDestroy( wait ); // wait    
+        CleanupStack::PopAndDestroy( wait ); // wait
         }
     CleanupStack::PopAndDestroy( 2, sel ); // msgEntry, sel
     }
@@ -476,9 +536,9 @@
     const TFSMailMsgId& /*aDestinationFolderId*/ )
 	{
 	}
-	
+
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 	
+// ----------------------------------------------------------------------------
 MDesCArray* CIpsPlgSosBasePlugin::GetMrusL(
                 const TFSMailMsgId& aMailBoxId)
     {
@@ -486,14 +546,14 @@
     }
 
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 	
+// ----------------------------------------------------------------------------
 void CIpsPlgSosBasePlugin::SetMrusL(
     const TFSMailMsgId& aMailBoxId,
     MDesCArray*  aNewMruList )
     {
     iMruList->SetMruListL( aMailBoxId, aNewMruList );
     }
-    
+
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 void CIpsPlgSosBasePlugin::GoOnlineL( const TFSMailMsgId& aMailBoxId )
@@ -504,20 +564,20 @@
         RefreshNowL( aMailBoxId, *this, 0 );
         }
     }
-    
+
 // ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------    
+// ---------------------------------------------------------------------------
 void CIpsPlgSosBasePlugin::GoOfflineL( const TFSMailMsgId& aMailBoxId )
     {
     FUNC_LOG;
     CancelAllOnlineOperations( aMailBoxId );
     // use 0 for request id
-    DisconnectL( aMailBoxId, *this, 0 ); 
+    DisconnectL( aMailBoxId, *this, 0 );
     }
-    
+
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 
-const TFSProgress CIpsPlgSosBasePlugin::GetLastSyncStatusL( 
+// ----------------------------------------------------------------------------
+const TFSProgress CIpsPlgSosBasePlugin::GetLastSyncStatusL(
     const TFSMailMsgId& aMailBoxId )
     {
     FUNC_LOG;
@@ -530,9 +590,9 @@
         User::Leave( KErrNotReady );
         }
     iSession->GetEntry( aMailBoxId.Id(), service, tEntry );
-    
+// <qmail>
     TInt state(0);
-    
+// </qmail>
     switch( state )
         {
         case ESyncFinishedSuccessfully:
@@ -553,7 +613,7 @@
     return progress;
     }
 
-// ---------------------------------------------------------------------------- 
+// ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 TInt CIpsPlgSosBasePlugin::CancelSyncL( const TFSMailMsgId& aMailBoxId )
     {
@@ -563,7 +623,7 @@
     // found correct operation
     for ( TInt i = iOperations.Count()-1; i >= 0; i-- )
         {
-        const CIpsPlgBaseOperation* baseOp = 
+        const CIpsPlgBaseOperation* baseOp =
             iOperations[i]->BaseOperation();
         if ( baseOp && baseOp->FSMailboxId() == aMailBoxId &&
                ( baseOp->IpsOpType() == EIpsOpTypePop3SyncOp
@@ -590,7 +650,7 @@
     }
 
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 
+// ----------------------------------------------------------------------------
 //
 CFSMailFolder* CIpsPlgSosBasePlugin::GetFolderByUidL(
     const TFSMailMsgId& aMailBoxId,
@@ -602,7 +662,7 @@
         {
         User::Leave( KErrNotReady );
         }
-        
+
     CMsvEntry* folderEntry = iSession->GetEntryL( aFolderId.Id() );
     CleanupStack::PushL( folderEntry ); // << folderEntry
 
@@ -611,7 +671,7 @@
         result = CFSMailFolder::NewLC( aFolderId ); // << result
         result->SetMailBoxId( aMailBoxId );
 
-        CMsvEntrySelection* msgChilds = folderEntry->ChildrenWithTypeL( 
+        CMsvEntrySelection* msgChilds = folderEntry->ChildrenWithTypeL(
                 KUidMsvMessageEntry );
         CleanupStack::PushL( msgChilds );
         TInt msgCount( msgChilds->Count() );
@@ -623,7 +683,7 @@
             TMsvEmailEntry emlEntry;
             TMsvId dummy;
             TBool isRead = ETrue;
-            if ( iSession->GetEntry( 
+            if ( iSession->GetEntry(
                     msgChilds->At(i), dummy, emlEntry ) == KErrNone )
                 {
                 if ( ( PluginId() == KIpsPlgImap4PluginUid.iUid ||
@@ -633,18 +693,18 @@
                     isRead = EFalse;
                     }
                 }
-            if ( !isRead && !emlEntry.LocallyDeleted() ) 
+            if ( !isRead && !emlEntry.LocallyDeleted() )
                 {
                 unreadCount++;
                 }
             }
-        
+
         CleanupStack::PopAndDestroy( msgChilds );
         result->SetUnreadCount( unreadCount );
         result->SetFolderName( folderEntry->Entry().iDetails );
         result->SetFolderType( GetFolderType( folderEntry, aFolderId ) );
         TMsvEntry parentEntry;
-        TInt status = iSession->GetEntry( folderEntry->Entry().Parent( ), serviceId, 
+        TInt status = iSession->GetEntry( folderEntry->Entry().Parent( ), serviceId,
                 parentEntry );
         TUint parent( 0 );
 		if( status == KErrNone )
@@ -658,12 +718,12 @@
                 parent = 0;
 				}
 			}
-        
+
         TFSMailMsgId parentId( PluginId(), parent );
         result->SetParentFolderId( parentId );
-        
+
         // Set subfolder count here for ListFolderL
-        CMsvEntrySelection* fldChildren = 
+        CMsvEntrySelection* fldChildren =
     		folderEntry->ChildrenWithTypeL( KUidMsvFolderEntry );
     	CleanupStack::PushL( fldChildren );    // << children
         result->SetSubFolderCount( fldChildren->Count() );
@@ -671,17 +731,17 @@
 
         // Set blocklist for FW
         BlockCopyMoveFromFoldersL( folderEntry, aFolderId, *result );
-        
+
         CleanupStack::Pop( result );    // >> result
         }
 	CleanupStack::PopAndDestroy( folderEntry ); // >>> folderEntry
-        
+
     return result;
 	}
-	
+
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 
-CFSMailFolder* CIpsPlgSosBasePlugin::CreateFolderL( 
+// ----------------------------------------------------------------------------
+CFSMailFolder* CIpsPlgSosBasePlugin::CreateFolderL(
     const TFSMailMsgId& /* aMailBoxId */,
     const TFSMailMsgId& /* aFolderId */,
     const TDesC& /* aFolderName */,
@@ -691,7 +751,7 @@
 	}
 
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 
+// ----------------------------------------------------------------------------
 void CIpsPlgSosBasePlugin::DeleteFolderByUidL(
     const TFSMailMsgId& /* aMailBoxId */,
     const TFSMailMsgId& /* aFolderId */)
@@ -699,57 +759,57 @@
 	}
 
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 
+// ----------------------------------------------------------------------------
 MFSMailIterator* CIpsPlgSosBasePlugin::ListMessagesL(
     const TFSMailMsgId& aMailBoxId,
     const TFSMailMsgId& aFolderId,
     const TFSMailDetails aDetails,
-    const RArray<TFSMailSortCriteria>& aSorting ) 
+    const RArray<TFSMailSortCriteria>& aSorting )
     {
     FUNC_LOG;
-    CIpsPlgMsgIterator* iterator = CIpsPlgMsgIterator::NewL( 
+    CIpsPlgMsgIterator* iterator = CIpsPlgMsgIterator::NewL(
         *this, *iSession, aMailBoxId, aFolderId, aDetails, aSorting );
-        
+
     return iterator;
     }
-	
+
+// ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 
 //
-CFSMailMessage* CIpsPlgSosBasePlugin::GetMessageByUidL( 
+CFSMailMessage* CIpsPlgSosBasePlugin::GetMessageByUidL(
     const TFSMailMsgId& aMailBoxId,
     const TFSMailMsgId& /* aFolderId */,
-    const TFSMailMsgId& aMessageId, 
-    const TFSMailDetails aDetails) 
+    const TFSMailMsgId& aMessageId,
+    const TFSMailDetails aDetails)
 	{
     FUNC_LOG;
 	CFSMailMessage* result( NULL );
 	TMsvId serviceId;
 	TMsvEntry tEntry;
 	TInt status( KErrNone );
-	
+
 	if( !iSessionOk )
 	    {
 	    User::Leave( KErrNotReady );
 	    }
-	
+
 	status = iSession->GetEntry( aMessageId.Id(), serviceId, tEntry);
-	
+
 	const TMsvEmailEntry& emlEntry(tEntry);
 	// do not give deleted marked messages
-	if ( status == KErrNone && 
+	if ( status == KErrNone &&
 	    EDisconnectedDeleteOperation != emlEntry.DisconnectedOperation()
 	    && !emlEntry.DeletedIMAP4Flag() )
 	    {
         result = iMsgMapper->GetMailMessageL( aMailBoxId, tEntry, aDetails );
 	    }
-	
-	return result;    
+
+	return result;
 	}
-	
+
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 	
- CFSMailMessage* CIpsPlgSosBasePlugin::CreateMessageToSendL( 
+// ----------------------------------------------------------------------------
+ CFSMailMessage* CIpsPlgSosBasePlugin::CreateMessageToSendL(
     const TFSMailMsgId& aMailBoxId )
 	{
     FUNC_LOG;
@@ -769,21 +829,18 @@
     TMsvPartList partList( KMsvMessagePartBody );
     
     CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewLC(*this);
+
+    //<qmail> removed mboxEntry from parameters + changed iSmtpService to pointer 
     
-    TMsvEntry mboxEntry;
-    TMsvId service;
-    User::LeaveIfError(
-        iSession->GetEntry( aMailBoxId.Id(), service, mboxEntry ) );
-
     CIpsPlgCreateMessageOperation* op = CIpsPlgCreateMessageOperation::NewL( 
-        iSmtpService, 
+        *iSmtpService, 
         *iSession,
         watcher->iStatus,
-        mboxEntry.iRelatedId, 
         partList, 
         aMailBoxId, 
         aOperationObserver, 
         aRequestId );
+    //</qmail>
     watcher->SetOperation( op );
 
     iOperations.AppendL( watcher ); 
@@ -793,14 +850,26 @@
  
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
-CFSMailMessage* CIpsPlgSosBasePlugin::CreateForwardMessageL( 
+CFSMailMessage* CIpsPlgSosBasePlugin::CreateForwardMessageL(
     const TFSMailMsgId& aMailBoxId,
     const TFSMailMsgId& aOriginalMessageId,
-    const TDesC& /* aHeaderDescriptor */)
+    const TDesC& aHeaderDescriptor )
     {
     FUNC_LOG;
-    CFSMailMessage* msg = iSmtpService->CreateForwardSmtpMessageL( 
+    CFSMailMessage* msg = iSmtpService->CreateForwardSmtpMessageL(
         aMailBoxId, aOriginalMessageId );
+    
+    if ( aHeaderDescriptor != KNullDesC )
+        {
+        // Ignoring trap as it is better to provide something in case of the
+        // below fix method fails than nothing.
+        TRAP_IGNORE( FixReplyForwardHeaderL( 
+                        msg, 
+                        aMailBoxId, 
+                        aOriginalMessageId, 
+                        aHeaderDescriptor ) );
+        }
+  
     return msg;
     }
 
@@ -839,8 +908,9 @@
     
     CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewLC(*this);
     
+    //<qmail> changed iSmtpService to pointer
     CIpsPlgCreateForwardMessageOperation* op = CIpsPlgCreateForwardMessageOperation::NewL( 
-        iSmtpService, 
+        *iSmtpService, 
         *iSession,
         watcher->iStatus,
         partList, 
@@ -848,6 +918,7 @@
         orgMsg.Id(), 
         aOperationObserver, 
         aRequestId );
+    //</qmail>
     watcher->SetOperation( op );
 
     iOperations.AppendL( watcher ); 
@@ -861,11 +932,23 @@
     const TFSMailMsgId& aMailBoxId,
     const TFSMailMsgId& aOriginalMessageId,
     const TBool aReplyToAll,
-    const TDesC& /* aHeaderDescriptor */ )
+    const TDesC& aHeaderDescriptor )
     {
     FUNC_LOG;
-    CFSMailMessage* msg = iSmtpService->CreateReplySmtpMessageL( 
+    CFSMailMessage* msg = iSmtpService->CreateReplySmtpMessageL(
         aMailBoxId, aOriginalMessageId, aReplyToAll );
+
+    if ( aHeaderDescriptor != KNullDesC )
+        {
+        // Ignoring trap as it is better to provide something in case of the
+        // below fix method fails than nothing.
+        TRAP_IGNORE( FixReplyForwardHeaderL( 
+                                msg, 
+                                aMailBoxId, 
+                                aOriginalMessageId, 
+                                aHeaderDescriptor ) );
+        }
+
     return msg;
     }
 
@@ -910,8 +993,9 @@
     
     CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewLC(*this);
     
+    //<qmail> changed iSmtpService to pointer
     CIpsPlgCreateReplyMessageOperation* op = CIpsPlgCreateReplyMessageOperation::NewL( 
-        iSmtpService, 
+        *iSmtpService, 
         *iSession,
         watcher->iStatus,
         partList, 
@@ -919,6 +1003,7 @@
         orgMsg.Id(), 
         aOperationObserver, 
         aRequestId );
+    //</qmail>
     watcher->SetOperation( op );
 
     iOperations.AppendL( watcher ); 
@@ -954,6 +1039,8 @@
 
     if ( incoming )
         {
+		// <qmail> Cmail change to synchronous call (UpdateMessageFlagsL) ignored,
+        // <qmail> because it causes emulator & HW to freeze on 10.1
         CIpsPlgSingleOpWatcher* opW = CIpsPlgSingleOpWatcher::NewLC( *this );
         CMsvOperation* op = iMsgMapper->UpdateMessageFlagsAsyncL( 
                 msgId.Id(), aMessage, opW->iStatus );
@@ -1008,31 +1095,31 @@
 
 // ----------------------------------------------------------------------------
 // CIpsPlgSosBasePlugin::GetMessagesL()
-// ---------------------------------------------------------------------------- 
+// ----------------------------------------------------------------------------
 //
 void CIpsPlgSosBasePlugin::GetMessagesL(
     const TFSMailMsgId& aMailBoxId,
     const TFSMailMsgId& aFolderId,
     const RArray<TFSMailMsgId>& aMessageIds,
     RPointerArray<CFSMailMessage>& aMessageList,
-    const TFSMailDetails aDetails ) 
+    const TFSMailDetails aDetails )
 	{
     FUNC_LOG;
     TInt i;
     CFSMailMessage* msg;
-    
+
 	for (i = 0; i < aMessageIds.Count(); i++ )
         {
-        msg = GetMessageByUidL( 
+        msg = GetMessageByUidL(
             aMailBoxId, aFolderId, aMessageIds[i], aDetails );
         CleanupStack::PushL( msg );
         aMessageList.AppendL( msg );
         CleanupStack::Pop( msg );
         }
-	} 							
+	}
 
 // ----------------------------------------------------------------------------
-// ----------------------------------------------------------------------------  
+// ----------------------------------------------------------------------------
 void CIpsPlgSosBasePlugin::ChildPartsL(
     const TFSMailMsgId& aMailBoxId,
     const TFSMailMsgId& /* aParentFolderId */,
@@ -1045,7 +1132,7 @@
 	}
 
 // ----------------------------------------------------------------------------
-// ----------------------------------------------------------------------------  
+// ----------------------------------------------------------------------------
 CFSMailMessagePart* CIpsPlgSosBasePlugin::NewChildPartL(
     const TFSMailMsgId& aMailBoxId,
     const TFSMailMsgId& /* aParentFolderId */,
@@ -1062,7 +1149,7 @@
     }
 
 // ----------------------------------------------------------------------------
-// ----------------------------------------------------------------------------  
+// ----------------------------------------------------------------------------
 CFSMailMessagePart* CIpsPlgSosBasePlugin::NewChildPartFromFileL(
     const TFSMailMsgId& aMailBoxId,
     const TFSMailMsgId& /* aParentFolderId */,
@@ -1078,41 +1165,47 @@
     RFile file;
     TInt fileSize( 0 );
     TBool parentToMultipartAlternative( EFalse );
-    
+
     // Read attachment size
     User::LeaveIfError( file.Open( iSession->FileSession(), aFilePath, EFileShareReadersOnly ) );
-        
+
     //in rare case that file has disappeared while sending
     //we just won't get the size for it
     file.Size( fileSize );
-    file.Close();    
-        
-    // Initialize CMsvAttachment instance for the attachment creation
-    CMsvAttachment* info = CMsvAttachment::NewL( CMsvAttachment::EMsvFile );
-    CleanupStack::PushL( info );
+    file.Close();
 
-    info->SetAttachmentNameL( aFilePath );
-    info->SetSize( fileSize );
-
-    // Create/acquire Symbian message entry objects
-    GetMessageEntryL( aMessageId.Id(), cEntry, message );
-
+  // Take ownership of message entry objects since thanks to
+    // "clever" use of active scheduler waits we can re-enter 
+    // this function leading to crashes if somebody clears the cache
+    // while this iteration still needs them
+    TakeMessageEntryLC( aMessageId.Id(), cEntry, message );
+	
     // Operation waiter needed to implement synchronous operation
     // on the top of async API
     CIpsPlgOperationWait* waiter = CIpsPlgOperationWait::NewL();
     CleanupStack::PushL( waiter );
 
+    // Initialize CMsvAttachment instance for the attachment creation
+    CMsvAttachment* info = CMsvAttachment::NewL( CMsvAttachment::EMsvFile );
+    CleanupStack::PushL( info );
+    info->SetAttachmentNameL( aFilePath );
+    info->SetSize( fileSize );
+
     // Start attachment creation
-    message->AttachmentManager().AddAttachmentL( 
+    message->AttachmentManager().AddAttachmentL(
         aFilePath, info, waiter->iStatus );
+    CleanupStack::Pop( info ); // attachment manager takes ownership
 
     waiter->Start();
     CleanupStack::PopAndDestroy( waiter );
-    CleanupStack::Pop( info ); // attachment manager takes ownership
+    	
+    // Return message entry objects back to cache
+    CleanupStack::Pop( 2 ); // cEntry, message
+    ReturnMessageEntry( cEntry, message );
 
     // Dig out the entry ID of the new attachment (unbelievable that
     // there seems to be no better way to do this)
-    message->GetAttachmentsListL( cEntry->Entry().Id( ), 
+    message->GetAttachmentsListL( cEntry->Entry().Id( ),
         CImEmailMessage::EAllAttachments, CImEmailMessage::EThisMessageOnly );
     TKeyArrayFix key( 0, ECmpTInt32 );
     CMsvEntrySelection* attachmentIds = message->Selection().CopyLC();
@@ -1123,10 +1216,10 @@
         }
     TMsvId newAttachmentId = (*attachmentIds)[ attachmentIds->Count()-1 ];
     CleanupStack::PopAndDestroy( attachmentIds );
-    
+
     CMsvEntry* cAtta = iSession->GetEntryL( newAttachmentId );
     CleanupStack::PushL( cAtta );
-    
+
     // Set filename to iDetails
     TMsvEntry tEntry = cAtta->Entry();
     tEntry.iDetails.Set( aFilePath );
@@ -1137,23 +1230,23 @@
         CMsvStore* store = cAtta->EditStoreL();
         CleanupStack::PushL( store );
         CImMimeHeader* mimeHeader = CImMimeHeader::NewLC();
-        
+
         if( store->IsPresentL( KUidMsgFileMimeHeader ) )
             {
             mimeHeader->RestoreL( *store );
             CDesC8Array& array = mimeHeader->ContentTypeParams();
             array.AppendL( KMethod );
             parentToMultipartAlternative = ETrue;
-            
+
             if( aContentType.Find( KMimeTextCalRequest ) != KErrNotFound )
-                {    
+                {
                 array.AppendL( KRequest );
                 }
             else if( aContentType.Find( KMimeTextCalResponse ) != KErrNotFound )
                 {
                 array.AppendL( KResponse );
                 }
-            else if( aContentType.Find( KMimeTextCalCancel ) != KErrNotFound ) 
+            else if( aContentType.Find( KMimeTextCalCancel ) != KErrNotFound )
                 {
                 array.AppendL( KCancel );
                 }
@@ -1164,32 +1257,32 @@
             mimeHeader->StoreWithoutCommitL( *store );
             store->CommitL();
             }
-        
+
         CleanupStack::PopAndDestroy( 2, store );
         }
 
     if( parentToMultipartAlternative &&
         aFilePath.Find( _L(".ics")) != KErrNotFound )
-        {        
+        {
         TMsvEntry tAttaEntry = cAtta->Entry();
         TMsvId id = tAttaEntry.Parent();
         CMsvEntry* cParent = iSession->GetEntryL( id );
         CleanupStack::PushL( cParent );
-        
+
         TMsvEmailEntry tEntry = cParent->Entry();
         tEntry.SetMessageFolderType( EFolderTypeAlternative );
         cParent->ChangeL( tEntry );
-        
+
         CleanupStack::PopAndDestroy( cParent );
         }
     CleanupStack::PopAndDestroy( cAtta );
-    
-    // Delete the message entries to get all the changes to disk and 
+
+    // Delete the message entries to get all the changes to disk and
     // possible store locks released
     CleanCachedMessageEntries();
-    
+
     // Create the FS message part object
-    result = iMsgMapper->GetMessagePartL( newAttachmentId, aMailBoxId, 
+    result = iMsgMapper->GetMessagePartL( newAttachmentId, aMailBoxId,
         aMessageId );
 
     return result;
@@ -1242,7 +1335,7 @@
     RFile& aFile )
     {
     FUNC_LOG;
-    
+
     // Initialize helper variables
     CFSMailMessagePart* result ( NULL );
     CMsvEntry* cEntry( NULL );
@@ -1250,33 +1343,41 @@
     TInt fileSize( 0 );
     TBuf<KMaxFileName> fileName;
 
-    // Create/acquire Symbian message entry objects
-    CleanCachedMessageEntries();
-    GetMessageEntryL( aMessageId.Id(), cEntry, message );
+ // Take ownership of message entry objects since thanks to
+    // "clever" use of active scheduler waits we can re-enter 
+    // this function leading to crashes if somebody clears the cache
+    // while this iteration still needs them
+    TakeMessageEntryLC( aMessageId.Id(), cEntry, message );
+
+    // Operation waiter needed to implement synchronous operation
+    // on the top of async API
+    CIpsPlgOperationWait* waiter = CIpsPlgOperationWait::NewL();
+    CleanupStack::PushL( waiter );
 
     // Initialize CMsvAttachment instance for the attachment creation
     CMsvAttachment* info = CMsvAttachment::NewL( CMsvAttachment::EMsvFile );
     CleanupStack::PushL( info );
-    
+
     // Read attachment size
     User::LeaveIfError( aFile.Size( fileSize ) );
     info->SetSize( fileSize );
-    
+
     // Read attachment filename
     User::LeaveIfError( aFile.FullName( fileName ) );
     info->SetAttachmentNameL( fileName );
+
+    message->AttachmentManager().AddAttachmentL( aFile, info, waiter->iStatus );
+    CleanupStack::Pop( info ); // attachment manager takes ownership
     
-    // Operation waiter needed to implement synchronous operation
-    // on the top of async API
-    CIpsPlgOperationWait* waiter = CIpsPlgOperationWait::NewL();
-    CleanupStack::PushL( waiter );
-    message->AttachmentManager().AddAttachmentL( aFile, info, waiter->iStatus );
     waiter->Start();
     CleanupStack::PopAndDestroy( waiter );
-    CleanupStack::Pop( info ); // attachment manager takes ownership
+
+ 	// Return message entry objects back to cache
+ 	CleanupStack::Pop( 2 ); // cEntry, message
+ 	ReturnMessageEntry( cEntry, message );
 
     // Dig out the entry ID of the new attachment
-    message->GetAttachmentsListL( cEntry->Entry().Id( ), 
+    message->GetAttachmentsListL( cEntry->Entry().Id( ),
         CImEmailMessage::EAllAttachments, CImEmailMessage::EThisMessageOnly );
     TKeyArrayFix key( 0, ECmpTInt32 );
     CMsvEntrySelection* attachmentIds = message->Selection().CopyLC();
@@ -1287,7 +1388,7 @@
         }
     TMsvId newAttachmentId = (*attachmentIds)[ attachmentIds->Count()-1 ];
     CleanupStack::PopAndDestroy( attachmentIds );
-    
+
     // Meeting request related handling
     TBool parentToMultipartAlternative( EFalse );
     CMsvEntry* cAtta = iSession->GetEntryL( newAttachmentId );
@@ -1297,29 +1398,29 @@
     TMsvEntry tEntry = cAtta->Entry();
     tEntry.iDetails.Set( fileName );
     cAtta->ChangeL( tEntry );
-    
+
     if( cAtta->HasStoreL() )
         {
         CMsvStore* store = cAtta->EditStoreL();
         CleanupStack::PushL( store );
         CImMimeHeader* mimeHeader = CImMimeHeader::NewLC();
-        
+
         if( store->IsPresentL( KUidMsgFileMimeHeader ) )
             {
             mimeHeader->RestoreL( *store );
             CDesC8Array& array = mimeHeader->ContentTypeParams();
             array.AppendL( KMethod );
             parentToMultipartAlternative = ETrue;
-            
+
             if( aContentType.Find( KMimeTextCalRequest ) != KErrNotFound )
-                {    
+                {
                 array.AppendL( KRequest );
                 }
             else if( aContentType.Find( KMimeTextCalResponse ) != KErrNotFound )
                 {
                 array.AppendL( KResponse );
                 }
-            else if( aContentType.Find( KMimeTextCalCancel ) != KErrNotFound ) 
+            else if( aContentType.Find( KMimeTextCalCancel ) != KErrNotFound )
                 {
                 array.AppendL( KCancel );
                 }
@@ -1333,32 +1434,32 @@
         CleanupStack::PopAndDestroy( 2, store );
         }
     if( parentToMultipartAlternative && fileName.Find( _L(".ics")) != KErrNotFound )
-        {        
+        {
         TMsvEntry tAttaEntry = cAtta->Entry();
         TMsvId id = tAttaEntry.Parent();
         CMsvEntry* cParent = iSession->GetEntryL( id );
         CleanupStack::PushL( cParent );
-        
+
         TMsvEmailEntry tEntry = cParent->Entry();
         tEntry.SetMessageFolderType( EFolderTypeAlternative );
         cParent->ChangeL( tEntry );
-        
+
         CleanupStack::PopAndDestroy( cParent );
         }
     CleanupStack::PopAndDestroy( cAtta );
-    
-    // Delete the message entries to get all the changes to disk and 
+
+    // Delete the message entries to get all the changes to disk and
     // possible store locks released
     CleanCachedMessageEntries();
-    
+
     // Create the FS message part object and return it
-    result = iMsgMapper->GetMessagePartL( newAttachmentId, aMailBoxId, 
+    result = iMsgMapper->GetMessagePartL( newAttachmentId, aMailBoxId,
         aMessageId );
     return result;
     }
 
 // ----------------------------------------------------------------------------
-// ----------------------------------------------------------------------------  
+// ----------------------------------------------------------------------------
 CFSMailMessagePart* CIpsPlgSosBasePlugin::CopyMessageAsChildPartL(
     const TFSMailMsgId& /* aMailBoxId */,
     const TFSMailMsgId& /* aParentFolderId */,
@@ -1371,9 +1472,9 @@
 	}
 
 // ----------------------------------------------------------------------------
-// Supports currently deletion of attachments and multipart structures 
+// Supports currently deletion of attachments and multipart structures
 // which are represented as folders in Symbian store)
-// ----------------------------------------------------------------------------  
+// ----------------------------------------------------------------------------
 //
 void CIpsPlgSosBasePlugin::RemoveChildPartL(
     const TFSMailMsgId& /* aMailBoxId */,
@@ -1388,26 +1489,36 @@
     TMsvEntry tEntry;
     TMsvId serviceId;
     status = iSession->GetEntry( aPartId.Id(), serviceId, tEntry );
-    
-    if ( ( status == KErrNone ) && 
+
+    if ( ( status == KErrNone ) &&
          ( tEntry.iType == KUidMsvAttachmentEntry ) )
         {
         CImEmailMessage* message( NULL );
+  
         // We trust that the message ID really refers to a message
-        GetMessageEntryL( aMessageId.Id(), cEntry, message );
-    
-        MMsvAttachmentManager& attachmentMgr( message->AttachmentManager() ); 
-    
+        
+        // Take ownership of message entry objects since thanks to
+        // "clever" use of active scheduler waits we can re-enter 
+        // this function leading to crashes if somebody clears the cache
+        // while this iteration still needs them
+        TakeMessageEntryLC( aMessageId.Id(), cEntry, message );
+
+        MMsvAttachmentManager& attachmentMgr( message->AttachmentManager() );
+
         CIpsPlgOperationWait* waiter = CIpsPlgOperationWait::NewL();
         CleanupStack::PushL( waiter );
-    
-        attachmentMgr.RemoveAttachmentL( 
+
+        attachmentMgr.RemoveAttachmentL(
             (TMsvAttachmentId) aPartId.Id(), waiter->iStatus );
-    
+
         waiter->Start();
         CleanupStack::PopAndDestroy( waiter );
+        	
+        // Return message entry objects to cache
+        CleanupStack::Pop( 2 ); // cEntry, message
+        ReturnMessageEntry( cEntry, message );
         }
-    else if ( ( status == KErrNone ) && 
+    else if ( ( status == KErrNone ) &&
               ( tEntry.iType == KUidMsvFolderEntry ) )
         {
         cEntry = iSession->GetEntryL( tEntry.Parent() );
@@ -1452,13 +1563,13 @@
 
 // ----------------------------------------------------------------------------
 // The implementation supoorts the atachment and body parts at the moment.
-// ----------------------------------------------------------------------------  
+// ----------------------------------------------------------------------------
 //
-CFSMailMessagePart* CIpsPlgSosBasePlugin::MessagePartL(  
+CFSMailMessagePart* CIpsPlgSosBasePlugin::MessagePartL(
     const TFSMailMsgId& aMailBoxId,
     const TFSMailMsgId& /* aParentFolderId */,
     const TFSMailMsgId& aMessageId,
-    const TFSMailMsgId& aMessagePartId) 
+    const TFSMailMsgId& aMessagePartId)
 	{
     FUNC_LOG;
     CFSMailMessagePart* result( NULL );
@@ -1478,7 +1589,7 @@
     const TFSMailMsgId& /* aParentFolderId */,
     const TFSMailMsgId& /* aMessageId */,
     const TFSMailMsgId& aMessagePartId,
-    RFile& aFileHandle) 
+    RFile& aFileHandle)
 	{
     FUNC_LOG;
     TInt status( KErrNone );
@@ -1488,30 +1599,30 @@
     TBool hasStore = cEntry->HasStoreL();
     if ( hasStore )
         {
-        //<qmail>
+//<qmail>
         // We need to open store for edit to support multipart/alternative
         // structure: we must have a possibility to modify text/html message part
         //store = cEntry->ReadStoreL();
         store = cEntry->EditStoreL();
-        //</qmail>
+//</qmail>
         }
-    
+
     if ( !store || !hasStore )
         {
         User::Leave( KErrNotFound );
         }
     CleanupStack::PushL( store );
     MMsvAttachmentManager& attachmentMgr = store->AttachmentManagerL();
-    
+
     // It is assumed that the attachment file is always in the index 0
     if ( attachmentMgr.AttachmentCount() )
         {
-        //<qmail>
+//<qmail>
         // We need to open store for edit to support multipart/alternative
         // structure: we must have a possibility to modify text/html message part
         //aFileHandle = attachmentMgr.GetAttachmentFileL( 0 );
         aFileHandle = attachmentMgr.GetAttachmentFileForWriteL( 0 );
-        //</qmail>
+//</qmail>
         }
     else
         {
@@ -1523,7 +1634,7 @@
     }
 
 // ----------------------------------------------------------------------------
-// ----------------------------------------------------------------------------  
+// ----------------------------------------------------------------------------
 //
 void CIpsPlgSosBasePlugin::CopyMessagePartFileL(
     const TFSMailMsgId& /* aMailBoxId */,
@@ -1531,7 +1642,7 @@
     const TFSMailMsgId& /*aMessageId*/,
     const TFSMailMsgId& aMessagePartId,
     const TDesC& aFilePath)
-    {
+	{
     FUNC_LOG;
     //<qmail>
     CMsvEntry* cEntry = iSession->GetEntryL( aMessagePartId.Id() );
@@ -1571,14 +1682,14 @@
 
 // ----------------------------------------------------------------------------
 // The method supports only reading of the plain text body currently.
-// ---------------------------------------------------------------------------- 
-void CIpsPlgSosBasePlugin::GetContentToBufferL(	
+// ----------------------------------------------------------------------------
+void CIpsPlgSosBasePlugin::GetContentToBufferL(
     const TFSMailMsgId& /* aMailBoxId */,
     const TFSMailMsgId& /* aParentFolderId */,
     const TFSMailMsgId& aMessageId,
     const TFSMailMsgId& aMessagePartId,
     TDes& aBuffer,
-    const TUint aStartOffset) 
+    const TUint aStartOffset)
 	{
     FUNC_LOG;
     CMsvEntry* cEntry( NULL );
@@ -1590,7 +1701,7 @@
         {
     message->GetBodyTextEntryIdL(
         cEntry->Entry().Id(), CImEmailMessage::EThisMessageOnly );
-    
+
     if ( message->Selection().Count() > 0 )
         {
         // Check whether the body text is requested
@@ -1600,17 +1711,17 @@
             CleanupStack::PushL(globalParaLayer);
             CCharFormatLayer* globalCharLayer = CCharFormatLayer::NewL();
             CleanupStack::PushL(globalCharLayer);
-            
+
             CRichText* bodyText = CRichText::NewL(
-                globalParaLayer, globalCharLayer);            
+                globalParaLayer, globalCharLayer);
             CleanupStack::PushL( bodyText );
-            
-            message->GetBodyTextL( 
+
+            message->GetBodyTextL(
                 aMessageId.Id(), CImEmailMessage::EThisMessageOnly,
                 *bodyText, *globalParaLayer, *globalCharLayer );
-            
+
             bodyText->Extract( aBuffer, aStartOffset, aBuffer.MaxLength() );
-            
+
             CleanupStack::PopAndDestroy(bodyText);
             CleanupStack::PopAndDestroy(globalCharLayer);
             CleanupStack::PopAndDestroy(globalParaLayer);
@@ -1618,9 +1729,9 @@
         }
 	}
 	}
-	 							 
+
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 
+// ----------------------------------------------------------------------------
 void CIpsPlgSosBasePlugin::SetContentL(
     const TDesC& aBuffer,
     const TFSMailMsgId& /* aMailBoxId */,
@@ -1630,7 +1741,7 @@
 	{
     FUNC_LOG;
     
-	//<qmail>
+//<qmail> Rewritten in Qmail: CIpsPlgOperationWait is no longer used 
     // Notice that SetContentL sets only the content of text/plain message part:
     // text/html part can be modified directly using GetMessagePartFileL
 	CMsvEntry* cEntry( NULL );
@@ -1656,21 +1767,68 @@
         CleanupStack::PopAndDestroy( 4, store );
     }
     CleanupStack::PopAndDestroy(cEntry);
-	//</qmail>
+//</qmail>
 	}
 
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 
+// ----------------------------------------------------------------------------
 void CIpsPlgSosBasePlugin::RemovePartContentL(
     const TFSMailMsgId& /* aMailBoxId */,
     const TFSMailMsgId& /* aParentFolderId */,
     const TFSMailMsgId& /* aMessageId */,
-    const RArray<TFSMailMsgId>& /* aPartIds */)
+    const RArray<TFSMailMsgId>& aPartIds )
     {
+    TInt count( aPartIds.Count() );
+
+    for( TInt i(0); i < count; i++ )
+        {
+        CMsvEntry* cEntry = iSession->GetEntryL( aPartIds[i].Id() );
+        CleanupStack::PushL( cEntry );
+        CMsvStore* store = NULL;
+        TBool hasStore = cEntry->HasStoreL();
+        if ( hasStore )
+            {
+            store = cEntry->EditStoreL();
+            }
+
+        if ( !store || !hasStore )
+            {
+            User::Leave( KErrNotFound );
+            }
+        CleanupStack::PushL( store );
+        MMsvAttachmentManager& attachmentMgr = store->AttachmentManagerL();
+
+        // It is assumed that the attachment file is always in the index 0
+        if ( attachmentMgr.AttachmentCount() )
+            {
+            // delete attachment file
+            CIpsPlgOperationWait* waiter = CIpsPlgOperationWait::NewLC();
+            attachmentMgr.RemoveAttachmentL( 0, waiter->iStatus );
+            waiter->Start();
+            CleanupStack::PopAndDestroy( waiter );
+            store->CommitL();
+
+            // clear complete flag
+            TMsvEntry tEntry( cEntry->Entry() );
+            tEntry.SetComplete( EFalse );
+
+            waiter = CIpsPlgOperationWait::NewLC();
+            CMsvOperation* ops = cEntry->ChangeL( tEntry, waiter->iStatus );
+            CleanupStack::PushL( ops );
+            waiter->Start();
+            CleanupStack::PopAndDestroy( 2, waiter );
+            }
+        else
+            {
+            User::Leave( KErrNotFound );
+            }
+        CleanupStack::PopAndDestroy( store );
+        CleanupStack::PopAndDestroy( cEntry );
+        }
     }
-    
+
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 	
+// ----------------------------------------------------------------------------
 void CIpsPlgSosBasePlugin::SetPartContentFromFileL(
     const TFSMailMsgId& /* aMailBoxId */,
     const TFSMailMsgId& /* aParentFolderId */,
@@ -1681,7 +1839,7 @@
     }
 
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 	
+// ----------------------------------------------------------------------------
 void CIpsPlgSosBasePlugin::StoreMessagePartL(
     const TFSMailMsgId& /* aMailBoxId */,
     const TFSMailMsgId& /* aParentFolderId */,
@@ -1716,7 +1874,27 @@
 void CIpsPlgSosBasePlugin::UnregisterRequestObserver( TInt /* aRequestId */)
     {
     }
-    
+
+// ----------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
+void CIpsPlgSosBasePlugin::SendL(TFSMailMsgId aMessageId )
+ 	{
+    FUNC_LOG;
+ 	CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewL(*this);
+ 	CleanupStack::PushL(watcher);
+// <qmail>
+    CIpsPlgSmtpOperation* op = CIpsPlgSmtpOperation::NewLC(
+        *iSession, watcher->iStatus );
+// </qmail>
+    op->SetEventHandler(iEventHandler);
+    watcher->SetOperation(op);
+    CleanupStack::Pop( op ); // op added as member of watcher
+    op->StartSendL( aMessageId.Id() );
+    iOperations.AppendL(watcher);
+    CleanupStack::Pop( watcher );
+ 	}
+
+   
 // ----------------------------------------------------------------------------
 // ---------------------------------------------------------------------------- 	
 void CIpsPlgSosBasePlugin::SendMessageL( CFSMailMessage& /*aMessage*/ )
@@ -1766,12 +1944,13 @@
 // </qmail>
 
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 
+// ----------------------------------------------------------------------------
 TFSProgress CIpsPlgSosBasePlugin::StatusL( TInt aRequestId )
 	{
     FUNC_LOG;
 	TFSProgress status;
-	status.iProgressStatus = TFSProgress::EFSStatus_RequestComplete;	
+	status.iError = KErrNone;
+	status.iProgressStatus = TFSProgress::EFSStatus_RequestComplete;
 	for ( TInt i = 0; i < iOperations.Count(); i++ )
         {
         const CIpsPlgBaseOperation* op = iOperations[i]->BaseOperation();
@@ -1784,8 +1963,8 @@
 	}
 
 // ----------------------------------------------------------------------------
-// ----------------------------------------------------------------------------    
-void CIpsPlgSosBasePlugin::CancelL(TInt aRequestId) 
+// ----------------------------------------------------------------------------
+void CIpsPlgSosBasePlugin::CancelL(TInt aRequestId)
 	{
     FUNC_LOG;
 	const TInt count = iOperations.Count();
@@ -1803,58 +1982,58 @@
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
-void CIpsPlgSosBasePlugin::SearchL( 
+void CIpsPlgSosBasePlugin::SearchL(
     const TFSMailMsgId& aMailBoxId,
     const RArray<TFSMailMsgId>& aFolderIds,
     const RPointerArray<TDesC>& aSearchStrings,
     const TFSMailSortCriteria& aSortCriteria,
-    MFSMailBoxSearchObserver& aSearchObserver ) 
+    MFSMailBoxSearchObserver& aSearchObserver )
     {
     FUNC_LOG;
-	iSearch->SearchL( 
+	iSearch->SearchL(
 	    aMailBoxId,
 	    aFolderIds,
 	    aSearchStrings,
 	    aSortCriteria,
 	    aSearchObserver );
 	}
-	
+
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 	
-void CIpsPlgSosBasePlugin::CancelSearch( const TFSMailMsgId& /* aMailBoxId */ ) 
+// ----------------------------------------------------------------------------
+void CIpsPlgSosBasePlugin::CancelSearch( const TFSMailMsgId& /* aMailBoxId */ )
 	{
     FUNC_LOG;
 	iSearch->Cancel();
 	}
 
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 
-void CIpsPlgSosBasePlugin::ClearSearchResultCache( 
-    const TFSMailMsgId& /* aMailBoxId */ ) 
+// ----------------------------------------------------------------------------
+void CIpsPlgSosBasePlugin::ClearSearchResultCache(
+    const TFSMailMsgId& /* aMailBoxId */ )
 	{
     FUNC_LOG;
 	iSearch->ClearCache();
 	}
 
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 
-void CIpsPlgSosBasePlugin::AddObserverL(MFSMailEventObserver& aObserver) 
+// ----------------------------------------------------------------------------
+void CIpsPlgSosBasePlugin::AddObserverL(MFSMailEventObserver& aObserver)
 	{
     FUNC_LOG;
 	iEventHandler->AddPluginObserverL( &aObserver );
 	}
 
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 	
-void CIpsPlgSosBasePlugin::RemoveObserver(MFSMailEventObserver& aObserver)     
+// ----------------------------------------------------------------------------
+void CIpsPlgSosBasePlugin::RemoveObserver(MFSMailEventObserver& aObserver)
 	{
 	//don't delete. we don't own this.
 	iEventHandler->RemovePluginObserver( &aObserver );
 	}
 
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 	
-void CIpsPlgSosBasePlugin::DeleteMessagesByUidL( 
+// ----------------------------------------------------------------------------
+void CIpsPlgSosBasePlugin::DeleteMessagesByUidL(
     const TFSMailMsgId& /*aMailBoxId*/,
     const TFSMailMsgId& /*aFolderId*/,
 	const RArray<TFSMailMsgId>& aMessages )
@@ -1862,7 +2041,7 @@
     FUNC_LOG;
     CMsvEntrySelection* sel=new(ELeave) CMsvEntrySelection;
     CleanupStack::PushL(sel);
-    
+
     TInt count = aMessages.Count();
     TMsvEntry tEntry;
     TMsvId service;
@@ -1881,28 +2060,34 @@
         
     CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewL( *this );
     CleanupStack::PushL( watcher );
-    CMsvOperation* op = CIpsPlgDeleteRemote::NewL( *iSession,
-        watcher->iStatus, *sel );
+    //<qmail>
+    CMsvOperation* op = CIpsPlgDeleteOperation::NewL( *iSession,
+        watcher->iStatus, sel );
+    //</qmail>
     watcher->SetOperation( op );
     iOperations.AppendL( watcher );
     CleanupStack::Pop( watcher );
-    CleanupStack::PopAndDestroy( sel );
+    //<qmail>
+    CleanupStack::Pop( sel );
+    //</qmail>
     }
-    
+
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 	
+// ----------------------------------------------------------------------------
 void CIpsPlgSosBasePlugin::SubscribeMailboxEventsL(
     const TFSMailMsgId& aMailboxId,
     MFSMailEventObserver& aObserver)
     {
     FUNC_LOG;
+// <qmail>
     TUint32 key(0);
-    
+// </qmail>
+
     iEventHandler->SubscribeMailboxEventsL( aMailboxId, aObserver, key );
     }
 
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 	
+// ----------------------------------------------------------------------------
 void CIpsPlgSosBasePlugin::UnsubscribeMailboxEvents(
     const TFSMailMsgId& aMailboxId,
     MFSMailEventObserver& aObserver)
@@ -1912,7 +2097,7 @@
     }
 
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 	
+// ----------------------------------------------------------------------------
 TSSMailSyncState CIpsPlgSosBasePlugin::CurrentSyncState(
     const TFSMailMsgId& aMailBoxId )
     {
@@ -1926,20 +2111,22 @@
     {
     FUNC_LOG;
     TInt error = KErrNone;
- 
+// <qmail> iSettingsApi not available in Qmail
+    /*error = iSettingsApi->HandleMailboxCreation( MtmId(), *iSession );
     if ( error == KErrNotSupported )
         {
         // this means that wizard data is not meaned for this plugin (instance)
         // just return KErrNone at the moment
         return KErrNone;
-        }
+        }*/
+// </qmail>
     return error;
     }
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
-TInt CIpsPlgSosBasePlugin::GetConnectionId( 
-        TFSMailMsgId /*aMailBoxId*/, 
+TInt CIpsPlgSosBasePlugin::GetConnectionId(
+        TFSMailMsgId /*aMailBoxId*/,
         TUint32& /*aConnectionId*/ )
     {
     return KErrNotSupported;
@@ -1947,8 +2134,8 @@
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
-TInt CIpsPlgSosBasePlugin::IsConnectionAllowedWhenRoaming( 
-             TFSMailMsgId /*aMailBoxId*/, 
+TInt CIpsPlgSosBasePlugin::IsConnectionAllowedWhenRoaming(
+             TFSMailMsgId /*aMailBoxId*/,
              TBool& /*aConnectionAllowed*/ )
     {
     return KErrNotSupported;
@@ -1962,9 +2149,9 @@
     TInt /* aRequestId */)
     {
     }
-    
+
 // ----------------------------------------------------------------------------
-// method sets authentication popup data 
+// method sets authentication popup data
 // ----------------------------------------------------------------------------
 //
 void CIpsPlgSosBasePlugin::SetCredentialsL( const TFSMailMsgId& /*aMailBoxId*/,
@@ -1999,11 +2186,11 @@
 
 // ----------------------------------------------------------------------------
 // CIpsPlgSosBasePlugin::GetMessageEntryL( )
-// Checks whether the requested message is already cached. If not, the cached 
+// Checks whether the requested message is already cached. If not, the cached
 // objects are deleted and new objects are created.
 // ----------------------------------------------------------------------------
-void CIpsPlgSosBasePlugin::GetMessageEntryL( 
-    TMsvId aId, 
+void CIpsPlgSosBasePlugin::GetMessageEntryL(
+    TMsvId aId,
     CMsvEntry*& aMessageEntry,
     CImEmailMessage*& aImEmailMessage )
     {
@@ -2012,7 +2199,7 @@
             iCachedEmailMessage->IsActive() )
         {
         CleanCachedMessageEntries();
-        
+
         iCachedEntry = iSession->GetEntryL( aId );
         if ( iCachedEntry->Entry().iType == KUidMsvMessageEntry )
             {
@@ -2023,6 +2210,60 @@
     aImEmailMessage = iCachedEmailMessage;
     }
 
+    
+// ----------------------------------------------------------------------------
+// CIpsPlgSosBasePlugin::TakeMessageEntryL( )
+// Takes ownership of the cached objects or creates new ones
+// ----------------------------------------------------------------------------
+
+void CIpsPlgSosBasePlugin::TakeMessageEntryLC(
+    TMsvId aId,
+    CMsvEntry*& aMessageEntry,
+    CImEmailMessage*& aImEmailMessage )
+    {
+    FUNC_LOG;
+    if ( !iCachedEntry || ( aId != iCachedEntry->Entry().Id() ) ||
+            iCachedEmailMessage->IsActive() )
+        {
+        // Can't use the ones that are in cache, create new ones and don't replace the ones in cache
+        aMessageEntry = iSession->GetEntryL( aId );
+        aImEmailMessage = 0;
+        
+        if ( aMessageEntry->Entry().iType == KUidMsvMessageEntry )
+            {
+            CleanupStack::PushL( aMessageEntry );
+            aImEmailMessage = CImEmailMessage::NewL( *aMessageEntry );
+            CleanupStack::Pop();
+            }
+        }
+    else
+    	{
+    	// Take ownership of the cached objects
+    	aMessageEntry = iCachedEntry;
+    	aImEmailMessage = iCachedEmailMessage;
+    	iCachedEntry = 0;
+    	iCachedEmailMessage = 0;
+    	}
+    	
+    // Ownership is transferred to the caller
+    CleanupStack::PushL( aMessageEntry );
+    CleanupStack::PushL( aImEmailMessage );
+    }
+
+// ----------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
+void CIpsPlgSosBasePlugin::ReturnMessageEntry(
+        CMsvEntry* aMessageEntry,
+        CImEmailMessage* aImEmailMessage )
+	{
+	// Clean old ones from the cache
+	CleanCachedMessageEntries();
+	
+	// Always save the latest ones in the cache
+	iCachedEntry = aMessageEntry;
+	iCachedEmailMessage = aImEmailMessage;
+    }
+   
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 //
@@ -2034,22 +2275,22 @@
     delete iCachedEntry;
     iCachedEntry = NULL;
     }
-    
+
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
-TFSFolderType CIpsPlgSosBasePlugin::GetFolderType( 
+TFSFolderType CIpsPlgSosBasePlugin::GetFolderType(
     CMsvEntry* aEntry,
     TFSMailMsgId aFolderId )
 	{
     FUNC_LOG;
     TFSFolderType folderType( EFSOther );
- 
+
 	if( ( aEntry->Entry().iDetails.CompareF( KIpsPlgInbox ) == 0 ) &&
 		( aEntry->Entry().iType == KUidMsvFolderEntry ) )
         {
         folderType = EFSInbox;
         }
-	else if( ( aEntry->Entry().iMtm == KSenduiMtmPop3Uid ) && 
+	else if( ( aEntry->Entry().iMtm == KSenduiMtmPop3Uid ) &&
 	         ( aEntry->Entry().iType == KUidMsvServiceEntry ) &&
 	         ( aEntry->Entry().iServiceId == aFolderId.Id() ) )
 	    {
@@ -2079,7 +2320,7 @@
 	}
 
 // ----------------------------------------------------------------------------
-// ----------------------------------------------------------------------------	
+// ----------------------------------------------------------------------------
 CIpsPlgTimerOperation& CIpsPlgSosBasePlugin::ActivityTimerL(
     const TFSMailMsgId& aMailBoxId )
     {
@@ -2092,7 +2333,7 @@
             timer = iActivitytimers[i];
             }
         }
-       
+
     if ( !timer )
         {
         // No timer for mailbox found create new
@@ -2101,19 +2342,19 @@
         User::LeaveIfError( iActivitytimers.Append( timer ) );
         CleanupStack::Pop( timer );
         }
-    return *timer;        
+    return *timer;
     }
 
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 
+// ----------------------------------------------------------------------------
 CIpsPlgSyncStateHandler& CIpsPlgSosBasePlugin::GetSyncStateHandler()
     {
     return *iSyncStateHandler;
     }
 
 // ----------------------------------------------------------------------------
-// ---------------------------------------------------------------------------- 
-void CIpsPlgSosBasePlugin::CancelAllOnlineOperations( 
+// ----------------------------------------------------------------------------
+void CIpsPlgSosBasePlugin::CancelAllOnlineOperations(
     const TFSMailMsgId& aMailboxId )
     {
     FUNC_LOG;
@@ -2131,43 +2372,96 @@
 
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
-void CIpsPlgSosBasePlugin::DeleteAndRemoveOperation( 
+void CIpsPlgSosBasePlugin::DeleteAndRemoveOperation(
         const TInt aOpArrayIndex, TInt aCompleteCode )
     {
     FUNC_LOG;
     CIpsPlgSingleOpWatcher* opWatcher = iOperations[aOpArrayIndex];
     
-    // <qmail> removed; does nothing
+// <qmail> removed; does nothing
     // The operations matches, handle it in protocol plugin...if needed.
     //TRAP_IGNORE( HandleOpCompletedL( *opWatcher, aCompleteCode ) );
-    // </qmail>
+// </qmail>
     const CIpsPlgBaseOperation* op = opWatcher->BaseOperation();
     TMsvId service = KErrNotFound;
     TUint pluginId = PluginId();
-    if ( op && ( 
+    if ( op && (
             op->IpsOpType() == EIpsOpTypeImap4SyncOp  ||
-             op->IpsOpType() == EIpsOpTypePop3SyncOp || 
+             op->IpsOpType() == EIpsOpTypePop3SyncOp ||
              op->IpsOpType() == EIpsOpTypeImap4PopulateOp ) )
         {
         service = op->Service();
-        }     
+        }
     iOperations.Remove( aOpArrayIndex );
     delete opWatcher;
     opWatcher = NULL;
     // need to remove operation first because after signaling
-    // sync complete mailbox status is asked immediatelly 
+    // sync complete mailbox status is asked immediatelly
     // and function checks connects ops also (see GetMailBoxStatus)
-    if ( service != KErrNotFound )    
+    if ( service != KErrNotFound )
         {
-        iEventHandler->SetNewPropertyEvent( 
+        iEventHandler->SetNewPropertyEvent(
                 service, KIpsSosEmailSyncCompleted, aCompleteCode );
         }
     }
 
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
-void CIpsPlgSosBasePlugin::DisconnectL( 
-    const TFSMailMsgId& aMailBoxId, 
+void CIpsPlgSosBasePlugin::FixReplyForwardHeaderL(
+        CFSMailMessage* aMessage,
+        const TFSMailMsgId& aMailBoxId,
+        const TFSMailMsgId& aOriginalMessageId,
+        const TDesC& aHeaderDescriptor )
+    {
+    FUNC_LOG;
+    CFSMailMessagePart* textBodyPart = aMessage->PlainTextBodyPartL();
+    if ( textBodyPart )
+        {
+        CleanupStack::PushL( textBodyPart );
+        CFSMailMessage* origMsg = GetMessageByUidL( 
+                                        aMailBoxId, 
+                                        TFSMailMsgId(), 
+                                        aOriginalMessageId, 
+                                        EFSMsgDataStructure );
+        if ( origMsg )
+            {
+            CleanupStack::PushL( origMsg );
+            CFSMailMessagePart* origMsgTextBodyPart = 
+                origMsg->PlainTextBodyPartL();
+                if ( origMsgTextBodyPart )
+                    {
+                    CleanupStack::PushL( origMsgTextBodyPart );
+                    // Use the content provided in aHeaderDescriptor
+                    // instead of what is provided by 
+                    // CreateForwardSmtpMessage..
+                    TPckgBuf<TReplyForwardParams> pckg;
+                    pckg.Copy( aHeaderDescriptor );
+                    TPtr hPtr( pckg().iHeader->Des() );
+                    HBufC* body = HBufC::NewLC( 
+                            textBodyPart->FetchedContentSize() );
+                    TPtr bPtr( body->Des() );
+                    origMsgTextBodyPart->GetContentToBufferL( bPtr, 0 );
+                    HBufC* content = HBufC::NewLC(
+                            hPtr.Length() + bPtr.Length() );
+                    TPtr cPtr( content->Des() );                        
+                    cPtr.Append( hPtr );
+                    cPtr.Append( bPtr );
+                    textBodyPart->SetContent( cPtr );
+                    textBodyPart->SaveL();
+                    CleanupStack::PopAndDestroy( content );
+                    CleanupStack::PopAndDestroy( body );
+                    CleanupStack::PopAndDestroy( origMsgTextBodyPart );
+                    }
+            CleanupStack::PopAndDestroy( origMsg );
+            }
+        CleanupStack::PopAndDestroy( textBodyPart );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+void CIpsPlgSosBasePlugin::DisconnectL(
+    const TFSMailMsgId& aMailBoxId,
     MFSMailRequestObserver& aObserver,
     const TInt aRequestId,
     TBool /*aRemoveAccountAlso*/ )
@@ -2177,9 +2471,9 @@
     TMsvEntry tEntry;
     TMsvId serv;
     iSession->GetEntry( service, serv, tEntry );
-    
+
     if ( tEntry.Connected() )
-        {        
+        {
         CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewL(*this);
         CleanupStack::PushL( watcher );
 
@@ -2201,10 +2495,10 @@
 
         watcher->SetOperation( op );
         CleanupStack::PopAndDestroy( sel );
-        iOperations.AppendL( watcher ); 
+        iOperations.AppendL( watcher );
         CleanupStack::Pop( watcher );
         }
-    }        
+    }
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
@@ -2213,7 +2507,7 @@
     FUNC_LOG;
     for ( TInt i = 0; i < iActivitytimers.Count(); i++ )
         {
-        // do not disconnect automatically mailboxes that are set to 
+        // do not disconnect automatically mailboxes that are set to
         // "connected"
         if ( iActivitytimers[i]->FSMailboxId().Id() == aMailboxId.Id() )
             {
@@ -2222,9 +2516,9 @@
             }
         }
     }
-        
+
 // ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------    
+// ---------------------------------------------------------------------------
 void CIpsPlgSosBasePlugin::RequestResponseL(
     TFSProgress /*aEvent*/,
     TInt /*aRequestId*/ )
@@ -2232,15 +2526,16 @@
     }
 
 // ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------    
+// ---------------------------------------------------------------------------
 void CIpsPlgSosBasePlugin::EmptyOutboxL( const TFSMailMsgId& aMailBoxId )
     {
     FUNC_LOG;
     CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewL(*this);
  	CleanupStack::PushL(watcher);
- 	// <qmail>
+// <qmail>
     CIpsPlgSmtpOperation* op = CIpsPlgSmtpOperation::NewLC( *iSession, watcher->iStatus );
- 	// </qmail>
+// </qmail>
+    op->SetEventHandler(iEventHandler);
     watcher->SetOperation(op);
     op->EmptyOutboxFromPendingMessagesL( aMailBoxId.Id() );
     iOperations.AppendL(watcher);
@@ -2253,37 +2548,37 @@
     TInt& /*aReason*/ )
     {
     FUNC_LOG;
-#ifdef __WINS__    
+#ifdef __WINS__
     return ETrue;
 #endif
     TBool ret=ETrue;
     //check offline mode. If set, we can't connect.
     ret = !OfflineModeSetL();
     if( ret )
-        {        
+        {
         ret = RoamingCheckL();
         }
     return ret;
     }
 
 // ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------    
+// ---------------------------------------------------------------------------
 TBool CIpsPlgSosBasePlugin::IsUnderUiProcess()
     {
     return iIsUnderUiProcess;
     }
 
 // ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------    
+// ---------------------------------------------------------------------------
 TBool CIpsPlgSosBasePlugin::OfflineModeSetL()
     {
     FUNC_LOG;
-    return !LocalFeatureL( KCRUidCoreApplicationUIs, 
-        KCoreAppUIsNetworkConnectionAllowed, 1 );        
-    }    
+    return !LocalFeatureL( KCRUidCoreApplicationUIs,
+        KCoreAppUIsNetworkConnectionAllowed, 1 );
+    }
 
 // ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------    
+// ---------------------------------------------------------------------------
 TBool CIpsPlgSosBasePlugin::LocalFeatureL(
     const TUid& aCenRepUid,
     const TUint32 aKeyId,
@@ -2307,15 +2602,15 @@
     // Return the result as a boolean value
     return ( flags & aFlag ) == aFlag;
     }
-    
+
 // ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------    
+// ---------------------------------------------------------------------------
 TBool CIpsPlgSosBasePlugin::RoamingCheckL()
     {
     FUNC_LOG;
     //first check our registration status
     TInt regStatus = RegistrationStatusL();
-    
+
     if ( regStatus == ENetworkRegistrationHomeNetwork )
         {
         return ETrue;
@@ -2333,9 +2628,9 @@
         return EFalse;
         }
     }
-    
+
 // ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------    
+// ---------------------------------------------------------------------------
 TInt CIpsPlgSosBasePlugin::RegistrationStatusL()
     {
     FUNC_LOG;
@@ -2344,69 +2639,63 @@
 
     //check network status
     iConMon.ConnectL();
-    
+
     iConMon.GetIntAttribute(
-        EBearerIdGSM, 0, KNetworkRegistration, 
+        EBearerIdGSM, 0, KNetworkRegistration,
         registrationStatus, status );
 
     User::WaitForRequest( status ); // faulty CS warning
-    
+
     iConMon.Close();
-        
-    return registrationStatus;        
+
+    return registrationStatus;
     }
 
 // ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------    
-//  
-void CIpsPlgSosBasePlugin::BlockCopyMoveFromFoldersL( 
-    CMsvEntry* aFolderEntry, 
-    TFSMailMsgId aFolderId, 
+// ---------------------------------------------------------------------------
+//
+void CIpsPlgSosBasePlugin::BlockCopyMoveFromFoldersL(
+    CMsvEntry* aFolderEntry,
+    TFSMailMsgId aFolderId,
     CFSMailFolder& aFSMailFolder )
     {
     FUNC_LOG;
-    RArray<TFSFolderType> blockFoldersOnline;
-    CleanupClosePushL( blockFoldersOnline );
-    RArray<TFSFolderType> blockFoldersOffline;
-    CleanupClosePushL( blockFoldersOffline );
+    // Currently IPS plugin can connect automatically when doing the actual
+    // move/copy operation, so no need to block offline moves separately
+    RArray<TFSFolderType> blockFolders;
+    CleanupClosePushL( blockFolders );
+
     // Move/Copy operations only between remote folders (+ IMAP Inbox) and
     // Outbox -> Drafts, block others.
-    blockFoldersOnline.Reset();
-    blockFoldersOffline.Reset();
-    
+    blockFolders.Reset();
+
     if( ( GetFolderType( aFolderEntry, aFolderId ) != EFSOther ) &&
         ( GetFolderType( aFolderEntry, aFolderId ) != EFSInbox ) )
         {
-        blockFoldersOnline.Append( EFSInbox );
-        blockFoldersOnline.Append( EFSOther );
+        blockFolders.Append( EFSInbox );
+        blockFolders.Append( EFSOther );
         }
 
     if( GetFolderType( aFolderEntry, aFolderId ) != EFSDraftsFolder )
         {
-        blockFoldersOnline.Append( EFSOutbox );
-        blockFoldersOffline.Append( EFSOutbox );
+        blockFolders.Append( EFSOutbox );
         }
-    blockFoldersOnline.Append( EFSSentFolder );
-    blockFoldersOnline.Append( EFSDraftsFolder );
-    blockFoldersOnline.Append( EFSDeleted );
-    blockFoldersOffline.Append( EFSSentFolder );
-    blockFoldersOffline.Append( EFSDraftsFolder );
-    blockFoldersOffline.Append( EFSDeleted );
-    blockFoldersOffline.Append( EFSInbox );
-    blockFoldersOffline.Append( EFSOther );
-    
-    // Block move/copy to this folder from blocklist
-    aFSMailFolder.BlockCopyFromL( blockFoldersOnline, EFSMailBoxOnline );
-    aFSMailFolder.BlockMoveFromL( blockFoldersOnline, EFSMailBoxOnline );
-    aFSMailFolder.BlockCopyFromL( blockFoldersOffline, EFSMailBoxOffline );
-    aFSMailFolder.BlockMoveFromL( blockFoldersOffline, EFSMailBoxOffline );
-            
-    CleanupStack::PopAndDestroy( &blockFoldersOffline ); 
-    CleanupStack::PopAndDestroy( &blockFoldersOnline );     
+    blockFolders.Append( EFSSentFolder );
+    blockFolders.Append( EFSDraftsFolder );
+    blockFolders.Append( EFSDeleted );
+
+    // Block move/copy to this folder from blocklist, same blocklist
+    // applies to both online and offline moves/copies
+    aFSMailFolder.BlockCopyFromL( blockFolders, EFSMailBoxOnline );
+    aFSMailFolder.BlockMoveFromL( blockFolders, EFSMailBoxOnline );
+    aFSMailFolder.BlockCopyFromL( blockFolders, EFSMailBoxOffline );
+    aFSMailFolder.BlockMoveFromL( blockFolders, EFSMailBoxOffline );
+
+    CleanupStack::PopAndDestroy( &blockFolders );
     }
 
 // ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------    
+// ---------------------------------------------------------------------------
 void CIpsPlgSosBasePlugin::StoreIMEIToMailboxL( const TMsvId aMailboxId )
     {
     FUNC_LOG;
@@ -2426,19 +2715,7 @@
 TBool CIpsPlgSosBasePlugin::ConnOpRunning( const TFSMailMsgId& aMailBoxId  )
     {
     FUNC_LOG;
-    for ( TInt i = 0; i < iOperations.Count(); i++ )
-       {
-       const CIpsPlgBaseOperation* baseOp = iOperations[i]->BaseOperation();
-       
-       if ( baseOp && baseOp->FSMailboxId() == aMailBoxId &&
-              ( baseOp->IpsOpType() == EIpsOpTypePop3SyncOp
-               || baseOp->IpsOpType() == EIpsOpTypeImap4SyncOp
-               || baseOp->IpsOpType() == EIpsOpTypeImap4PopulateOp ) )
-           {
-           return ETrue;
-           }
-       }
-    return EFalse;
+    return iSyncStateHandler->ConnOpRunning( aMailBoxId );
     }
 
 // ---------------------------------------------------------------------------
@@ -2451,6 +2728,7 @@
     TMsvEntry tEntry;
     TMsvId service;
     iSession->GetEntry( aMailboxId.Id(), service, tEntry );
+// <qmail> iSettingsApi removed
     }
 
 // ---------------------------------------------------------------------------
@@ -2484,8 +2762,28 @@
         if ( iActivitytimers[j]->FSMailboxId() == aMailboxId )
             {
             delete iActivitytimers[j];
+            iActivitytimers[j] = NULL;
             iActivitytimers.Remove( j );
+            timerCount--;
+            j--;
             }
         }
     }
 
+// <qmail> new function
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+TBool CIpsPlgSosBasePlugin::HasOperations( const TFSMailMsgId& aMailboxId )
+    {
+    FUNC_LOG;
+    TBool ret( EFalse );
+    for ( TInt i = 0; i < iOperations.Count(); i++ )
+        {
+        if( iOperations[i]->BaseOperation()->FSMailboxId() == aMailboxId )
+            {
+            ret = ETrue;
+            }
+        }
+    return ret;
+    }
+// </qmail>
--- a/ipsservices/ipssosplugin/src/ipsplgsyncstatehandler.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgsyncstatehandler.cpp	Fri May 14 15:41:10 2010 +0300
@@ -88,10 +88,29 @@
     
     TInt err = iSession.GetEntry( aMailboxId.Id(), service, tEntry );
 
-    if ( err != KErrNone || !tEntry.Connected() || iOperationsRef.Count() == 0 )
+    if ( err != KErrNone || iOperationsRef.Count() == 0 )
+        {
+        return Idle;
+        }
+
+    // If the mailbox is not online but it has some connection operation
+    // already running, it means that it will be synchronized when the mailbox
+    // goes online. So we need to check is there any connection operation
+    // ongoing and return StartingSync in that case.
+    if( !tEntry.Connected() )
         {
-        // no sync ongoing if not connected
-        return Idle;
+        if( ConnOpRunning( aMailboxId ) )
+            {
+            // Some connection operation already processing, so the sync
+            // will start soon
+            return StartingSync;
+            }
+        else
+            {
+            // no sync ongoing if not connected and no connection operations
+            // started
+            return Idle;
+            }
         }
 
 #ifndef RD_101_EMAIL    
@@ -125,26 +144,52 @@
        const CIpsPlgBaseOperation* baseOp = iOperationsRef[i]->BaseOperation();
        
        if ( baseOp && baseOp->FSMailboxId() == aMailboxId &&
-              ( baseOp->IpsOpType() == EIpsOpTypePop3SyncOp
-               || baseOp->IpsOpType() == EIpsOpTypeImap4SyncOp
-               || baseOp->IpsOpType() == EIpsOpTypeImap4PopulateOp ) )
+            ( baseOp->IpsOpType() == EIpsOpTypePop3SyncOp ||
+              baseOp->IpsOpType() == EIpsOpTypeImap4SyncOp ||
+              baseOp->IpsOpType() == EIpsOpTypeImap4PopulateOp ) )
            {
-           // check syncing mailbox, to prevent sync icon running 
-           // all the time
-           if ( FindMailbox( aMailboxId.Id() ) == KIpsSosEmailSyncCompleted )
-               {
-               return Idle;
-               }
-           else
-               {
-               return EmailSyncing;
-               }
+           // Due to timing problems we might in some rare cases report
+           // EmailSyncing here even if the actual syncing is already
+           // finsihed, because the operation is removed from the array
+           // with an async function call. HandlePropertyEventL events
+           // seem to be even more unreliable (sync start event comes with
+           // big delay), so we can't trust those either. Some kind of
+           // redesign is needed to get this sync state query more reliable.
+           return EmailSyncing;
            }
        }
     return Idle;
     }
 
 // ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+TBool CIpsPlgSyncStateHandler::ConnOpRunning( const TFSMailMsgId& aMailBoxId  )
+    {
+    FUNC_LOG;
+    for ( TInt i = 0; i < iOperationsRef.Count(); i++ )
+       {
+       const CIpsPlgBaseOperation* baseOp = iOperationsRef[i]->BaseOperation();
+
+       if ( baseOp && baseOp->FSMailboxId() == aMailBoxId &&
+              ( baseOp->IpsOpType() == EIpsOpTypePop3SyncOp
+               || baseOp->IpsOpType() == EIpsOpTypeImap4SyncOp
+               || baseOp->IpsOpType() == EIpsOpTypeOnlineOp
+               || baseOp->IpsOpType() == EIpsOpTypeImap4PopulateOp ) )
+           {
+           // Due to timing problems we might in some rare cases report
+           // EmailSyncing here even if the actual syncing is already
+           // finsihed, because the operation is removed from the array
+           // with an async function call. HandlePropertyEventL events
+           // seem to be even more unreliable (sync start event comes with
+           // big delay), so we can't trust those either. Some kind of
+           // redesign is needed to get this sync state query more reliable.
+           return ETrue;
+           }
+       }
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------    
 TInt CIpsPlgSyncStateHandler::FindSyncingMailbox( TMsvId aMailbox )
     {
@@ -259,6 +304,7 @@
     FUNC_LOG;
     TTime now;
     now.HomeTime();
+// <qmail>
     //CIpsSetDataExtension* extendedSettings = CIpsSetDataExtension::NewLC();
     //CIpsSetDataApi* dataApi = CIpsSetDataApi::NewL( aSession );
     //CleanupStack::PushL( dataApi );
@@ -271,6 +317,7 @@
     //extendedSettings->SetEmnReceivedButNotSyncedFlag( EFalse );
     //dataApi->SaveExtendedSettingsL( *extendedSettings );
     //CleanupStack::PopAndDestroy( 2, extendedSettings );
+// </qmail>
     }
 
 
--- a/ipsservices/nmimapclientplugin/inc/nmimapclientplugin.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/nmimapclientplugin/inc/nmimapclientplugin.h	Fri May 14 15:41:10 2010 +0300
@@ -20,6 +20,11 @@
 
 #include "nmbaseclientplugin.h"
 #include "nmuiextensioninterface.h"
+#include "nmuienginedef.h"
+#include "nmactionrequest.h"
+
+class NmUiEngine;
+class NmSettingsViewLauncher;
 
 /*!
  \class NmImapClientPlugin
@@ -36,9 +41,19 @@
     void getActions( const NmActionRequest &request,
         QList<NmAction*> &actionList);
 
+private slots:
+    void settings();
+    void switchToStandardFolderInbox();
+    void switchToStandardFolderOutbox();
+    void switchToStandardFolderDrafts();
+    void switchToStandardFolderSent();
+
 protected:
     virtual quint32 pluginId();
 
+private:
+    NmActionRequest mListOptionsMenuRequest;
+    NmSettingsViewLauncher *mSettingsViewLauncher; // owned
 };
 
 #endif /* NMIMAPCLIENTPLUGIN_H_ */
--- a/ipsservices/nmimapclientplugin/inc/nmimapclientpluginheaders.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/nmimapclientplugin/inc/nmimapclientpluginheaders.h	Fri May 14 15:41:10 2010 +0300
@@ -24,6 +24,7 @@
 #include <QtGlobal>
 
 // Orbit
+#include <hbmenu.h>
 
 // ipsservices
 #include "ipsplgsosbaseplugin.hrh"
@@ -42,10 +43,13 @@
 #include "nmactionresponse.h"
 #include "nmmessageenvelope.h"
 #include "nmuiextensioninterface.h"
+#include "nmmailboxmetadata.h"
 
 // client plugins
 #include "nmimapclientplugin.h"
 
+// settings
+#include "nmsettingsviewlauncher.h"
 
 
 #endif /* NMIMAPCLIENTPLUGINHEADERS_H_ */
--- a/ipsservices/nmimapclientplugin/nmimapclientplugin.pro	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/nmimapclientplugin/nmimapclientplugin.pro	Fri May 14 15:41:10 2010 +0300
@@ -20,8 +20,7 @@
 
 INCLUDEPATH += inc \
     ../inc \
-    ../../inc \
-    ../../emailuis/nmsettingui/inc
+    ../../inc
 
 HEADERS += inc/nmimapclientplugin.h \
     inc/nmimapclientpluginheaders.h
@@ -37,11 +36,22 @@
         -TCB
     TARGET.UID2 = 0x1000008D
     TARGET.UID3 = 0x2002B3D1
-    pluginstub.sources = nmimapclientplugin.dll
-    pluginstub.path = /resource/plugins
+    
+    PLUGIN_STUB_PATH = /resource/qt/plugins/nmail/uiext
+    
+    deploy.path = C:
+    pluginstub.sources = $${TARGET}.dll
+    pluginstub.path = $$PLUGIN_STUB_PATH
+    DEPLOYMENT += pluginstub
+
+    qtplugins.path = $$PLUGIN_STUB_PATH
+    qtplugins.sources += qmakepluginstubs/$${TARGET}.qtplugin
+    for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)"
+        
     DEPLOYMENT += pluginstub
     LIBS += -lnmailbase \
-            -lnmailuiengine
+            -lnmsettingui \
+            -lnmailuiengine 
 }
 
 win32 {    
@@ -55,3 +65,6 @@
                 -lnmailuiengine 
 }
 
+plugin.sources = $${TARGET}.dll
+plugin.path = $$PLUGIN_STUB_PATH
+DEPLOYMENT += plugin
--- a/ipsservices/nmimapclientplugin/src/nmimapclientplugin.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/nmimapclientplugin/src/nmimapclientplugin.cpp	Fri May 14 15:41:10 2010 +0300
@@ -33,6 +33,8 @@
     Constructs a new NmImapClientPlugin.
  */
 NmImapClientPlugin::NmImapClientPlugin()
+: mListOptionsMenuRequest(NULL),
+mSettingsViewLauncher(NULL)
 {
 }
 
@@ -41,6 +43,7 @@
  */
 NmImapClientPlugin::~NmImapClientPlugin()
 {
+    delete mSettingsViewLauncher;
 }
 
 /*!
@@ -54,7 +57,7 @@
       QList<NmAction *> &actionList)
 {
     NMLOG("NmImapClientPlugin::getActions()-->");
-    
+
     // Check if this request is for the IMAP protocol.
     quint32 pluginId = this->pluginId();
     if (request.mailboxId().pluginId32() != pluginId
@@ -66,12 +69,180 @@
         NMLOG(QString("request.mailboxId().pluginId32()=%1").arg(request.mailboxId().pluginId32()));
         return;
     }
-	
+
     // Get the NmBaseClientPlugin implementation of the UI actions.
     NmBaseClientPlugin::getActions(request, actionList);
+
+    // Append IMAP plugin specific actions
+    switch (request.menuType()) {
+    case NmActionOptionsMenu:
+        {
+        if (request.contextView()==NmActionContextViewMessageList){
+            mListOptionsMenuRequest = request;
+            // Create sub-menu for standard folders selection
+            HbMenu *standardFolders = new HbMenu();
+            NmAction *inboxAction = new NmAction(0);
+            inboxAction->setObjectName("imapclientplugin_folders_inbox");
+            inboxAction->setText(hbTrId("txt_mail_opt_folders_inbox"));
+            inboxAction->setCheckable(true);
+            connect(inboxAction, SIGNAL(triggered()), this, SLOT(switchToStandardFolderInbox()));
+            standardFolders->addAction(inboxAction);
+            NmAction *outboxAction = new NmAction(0);
+            outboxAction->setObjectName("imapclientplugin_folders_outbox");
+            outboxAction->setText(hbTrId("txt_mail_opt_folders_outbox"));
+            outboxAction->setCheckable(true);
+            connect(outboxAction, SIGNAL(triggered()), this, SLOT(switchToStandardFolderOutbox()));
+            standardFolders->addAction(outboxAction);
+            NmAction *draftsAction = new NmAction(0);
+            draftsAction->setObjectName("imapclientplugin_folders_drafts");
+            draftsAction->setText(hbTrId("txt_mail_opt_folders_drafts"));
+            draftsAction->setCheckable(true);
+            connect(draftsAction, SIGNAL(triggered()), this, SLOT(switchToStandardFolderDrafts()));
+            standardFolders->addAction(draftsAction);
+            NmAction *sentAction = new NmAction(0);
+            sentAction->setObjectName("imapclientplugin_folders_sent");
+            sentAction->setText(hbTrId("txt_mail_opt_folders_sent"));
+            sentAction->setCheckable(true);
+            connect(sentAction, SIGNAL(triggered()), this, SLOT(switchToStandardFolderSent()));
+            standardFolders->addAction(sentAction);
+            // Set active action
+            NmFolderType curFolderType(NmFolderOther);
+            if (mUiEngine) {
+                curFolderType = mUiEngine->folderTypeById(request.mailboxId(),request.folderId());
+            }
+            switch (curFolderType){
+                case NmFolderInbox: {
+                    inboxAction->setChecked(true);
+                    break;
+                }
+                case NmFolderOutbox: {
+                    outboxAction->setChecked(true);
+                    break;
+                }
+                case NmFolderDrafts: {
+                    draftsAction->setChecked(true);
+                    break;
+                }
+                case NmFolderSent: {
+                    sentAction->setChecked(true);
+                    break;
+                }
+            }
+
+            // Add folders selection with sub-menu
+            NmAction *foldersAction = new NmAction(0);
+            foldersAction->setObjectName("baseclientplugin_folders");
+            foldersAction->setText(hbTrId("txt_mail_opt_folders"));
+            foldersAction->setMenu(standardFolders);
+            actionList.append(foldersAction);
+            }
+        }
+        break;
+    default:
+        break;
+    }
+
     NMLOG("<--NmImapClientPlugin::getActions()");
 }
 
+/*!
+    Slot connected to options menu settings NmAction.
+    Opens mailbox settings.
+ */
+void NmImapClientPlugin::settings()
+{
+    NMLOG("NmImapClientPlugin::settings()-->");
+
+    const NmId &id = mMenuRequest.mailboxId();
+    NmMailboxMetaData *mailbox = mUiEngine->mailboxById(id);
+
+    if (mailbox) {
+        if (!mSettingsViewLauncher) {
+            mSettingsViewLauncher = new NmSettingsViewLauncher();
+
+            connect(mSettingsViewLauncher,
+                SIGNAL(mailboxListChanged(const NmId &, NmSettings::MailboxEventType)),
+                this, SLOT(mailboxListChanged(const NmId &, NmSettings::MailboxEventType)));
+
+            connect(mSettingsViewLauncher,
+                SIGNAL(mailboxPropertyChanged(const NmId &, QVariant, QVariant)),
+                this, SLOT(mailboxPropertyChanged(const NmId &, QVariant, QVariant)));
+
+            connect(mSettingsViewLauncher,
+                SIGNAL(goOnline(const NmId &)),
+                this, SLOT(goOnline(const NmId &)));
+
+            connect(mSettingsViewLauncher,
+                SIGNAL(goOffline(const NmId &)),
+                this, SLOT(goOffline(const NmId &)));
+        }
+
+        mSettingsViewLauncher->launchSettingsView(id, mailbox->name());
+    }
+
+    NMLOG("<--NmImapClientPlugin::settings()");
+}
+
+/*!
+    Private slot to switch message list contents
+    to standard folder inbox
+*/
+void NmImapClientPlugin::switchToStandardFolderInbox()
+{
+    if (mListOptionsMenuRequest.observer()){
+        NmId folderId=mUiEngine->standardFolderId(mListOptionsMenuRequest.mailboxId(),NmFolderInbox);
+        NmActionResponse response(NmActionResponseCommandSwitchFolder, NmActionOptionsMenu,
+                                  NmActionContextViewNone, mListOptionsMenuRequest.mailboxId(),
+                                  folderId);
+        mListOptionsMenuRequest.observer()->handleActionCommand(response);
+    }
+}
+
+/*!
+    Private slot to switch message list contents
+    to standard folder outbox
+*/
+void NmImapClientPlugin::switchToStandardFolderOutbox()
+{
+    if (mListOptionsMenuRequest.observer()){
+        NmId folderId=mUiEngine->standardFolderId(mListOptionsMenuRequest.mailboxId(),NmFolderOutbox);
+        NmActionResponse response(NmActionResponseCommandSwitchFolder, NmActionOptionsMenu,
+                                  NmActionContextViewNone, mListOptionsMenuRequest.mailboxId(),
+                                  folderId);
+        mListOptionsMenuRequest.observer()->handleActionCommand(response);
+    }
+}
+
+/*!
+    Private slot to switch message list contents
+    to standard folder drafts
+*/
+void NmImapClientPlugin::switchToStandardFolderDrafts()
+{
+    if (mListOptionsMenuRequest.observer()){
+        NmId folderId=mUiEngine->standardFolderId(mListOptionsMenuRequest.mailboxId(),NmFolderDrafts);
+        NmActionResponse response(NmActionResponseCommandSwitchFolder, NmActionOptionsMenu,
+                                  NmActionContextViewNone, mListOptionsMenuRequest.mailboxId(),
+                                  folderId);
+        mListOptionsMenuRequest.observer()->handleActionCommand(response);
+    }
+}
+
+/*!
+    Private slot to switch message list contents
+    to standard folder sent
+*/
+void NmImapClientPlugin::switchToStandardFolderSent()
+{
+    if (mListOptionsMenuRequest.observer()){
+        NmId folderId=mUiEngine->standardFolderId(mListOptionsMenuRequest.mailboxId(),NmFolderSent);
+        NmActionResponse response(NmActionResponseCommandSwitchFolder, NmActionOptionsMenu,
+                                  NmActionContextViewNone, mListOptionsMenuRequest.mailboxId(),
+                                  folderId);
+        mListOptionsMenuRequest.observer()->handleActionCommand(response);
+    }
+}
+
 
 /*!
     Provide id of plugin.
--- a/ipsservices/nmipssettings/inc/ipssettingkeys.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/nmipssettings/inc/ipssettingkeys.h	Fri May 14 15:41:10 2010 +0300
@@ -62,6 +62,15 @@
 // Values: 0=Divider not shown, 1=1ivider is shown
 static const quint32 EmailKeyPreferenceMessageDivider = 2;
 
+// sync profile identifiers
+static const int EmailSyncProfileKeepUpToDate = 0;
+static const int EmailSyncProfileSaveEnergy = 1;
+static const int EmailSyncProfileManualFetch = 2;
+static const int EmailSyncProfileUserDefined = 3;
+
+// initial sync profile value when a mailbox is created (save energy)
+static const int EmailInitialSyncProfile = 1;
+
 // Currently used sync profile 
 //  Keep Up-to-Date (=KUTD) / Save Energy (=SE) / Manual Fetch (=MF) / User defined (=UD)
 //  Keep Up-to-Date  = 0 (EmailProfileOffsetKUTD)
@@ -113,25 +122,25 @@
 static const int DefaultValueManualSyncReceptionDays = -1;
 static const int DefaultUserDefinedReceptionDays = -1;
 
-// Receive start time. Value 00am – 12pm (integer 0-23).
-// Value for each profile: KUTP(8), SE(8), MF(-1=N/A), UD
+// Receive start time. Value 00:00 – 23:59 (integer 0-1439).
+// Value for each profile: KUTP(480), SE(480), MF(-1=N/A), UD
 // This key follows the profile offset.
 static const quint32 EmailKeyReceptionDayStartTime = 8;
 
 // default values for each profile
-static const int DefaultValueKeepUpToDateReceptionStartTime = 8;
-static const int DefaultValueSaveEnergyReceptionStartTime = 8;
+static const int DefaultValueKeepUpToDateReceptionStartTime = 480;
+static const int DefaultValueSaveEnergyReceptionStartTime = 480;
 static const int DefaultValueManualSyncReceptionStartTime = -1;
 static const int DefaultUserDefinedReceptionStartTime = -1;
 
-// Receive end time. Value 00am – 12pm (integer 0-23).
-// Value for each profile: KUTP(22), SE(22), MF(-1=N/A), UD
+// Receive end time in minutes. Value 00:00 – 23:59 (integer 0-1439).
+// Value for each profile: KUTP(1320), SE(1320), MF(-1=N/A), UD
 // This key follows the profile offset.
 static const quint32 EmailKeyReceptionDayEndTime = 9;
 
 // default values for each profile
-static const int DefaultValueKeepUpToDateReceptionEndTime = 22;
-static const int DefaultValueSaveEnergyReceptionEndTime = 22;
+static const int DefaultValueKeepUpToDateReceptionEndTime = 1320;
+static const int DefaultValueSaveEnergyReceptionEndTime = 1320;
 static const int DefaultValueManualSyncReceptionEndTime = -1;
 static const int DefaultUserDefinedReceptionEndTime = -1;
 
@@ -158,6 +167,13 @@
 // Defines if user name for particular mailbox is hidden.
 static const quint32 EmailKeyUserNameHidden = 20;
 
+static const quint32 EmailKeyEMNState = 21;
+static const quint32 EmailKeyFirstEmnReceived = 22;
+static const quint32 EmailKeyEmnReceivedNotSynced = 23;
+static const quint32 EmailKeyAoLastSuccessfulUpdateL = 24;
+static const quint32 EmailKeyAoLastSuccessfulUpdateH = 25;
+static const quint32 EmailKeyAoLastUpdateFailed = 26;
+static const quint32 EmailKeyAoUpdateSuccessfulWithCurSettings = 27;
 } // namespace
 
 #endif //IPSSETTINGKEYS_H
--- a/ipsservices/nmipssettings/inc/nmipssettingitems.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/nmipssettings/inc/nmipssettingitems.h	Fri May 14 15:41:10 2010 +0300
@@ -47,7 +47,15 @@
         OutgoingMailServer,                     // String
         IncomingPort,                           // Integer
         OutgoingPort,                           // Integer
-        FolderPath,                             // String: Empty string means 'Default'
+        FolderPath,                              // String: Empty string means 'Default'
+        AlwaysOnlineState,                      // Integer: 0=always,1=homeonly,2=off
+        EmailNotificationState,                 // Integer: 0=automatic,1=homeonly,2=off
+        FirstEmnReceived,                       // Integer: 0=false,1=true
+        EmnReceivedNotSynced,                   // Integer: 0=false,1=true
+        AoLastSuccessfulUpdateL,                // Integer: low part of 64bit integer
+        AoLastSuccessfulUpdateH,                // Integer: high part of 64bit integer
+        AoLastUpdateFailed,                     // Integer: 0=false, 1=true
+        AoUpdateSuccessfulWithCurSettings,      // Integer: 0=false, 1=true
         IncomingSecureSockets,                  // Boolean
         IncomingSSLWrapper,                     // Boolean
         OutgoingLoginName,                      // String
@@ -108,6 +116,16 @@
         EMailImap
         };
     
+    /** 
+     *  SMTP Authentication types 
+     */
+    enum TIpsSetSMTPAuthenticationTypes
+        {
+        EMailAuthNone = 0,
+        EMailAuthSameAsIncoming,
+        EMailAuthUserAuthentication
+        };
+    
     const int standardPop3Port = 110;   // POP3 - port 110
     const int standardImap4Port = 143;  // IMAP - port 143
     const int standardSmtpPort = 25;    // SMTP - port 25
--- a/ipsservices/nmipssettings/inc/nmipssettingscustomitem.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/nmipssettings/inc/nmipssettingscustomitem.h	Fri May 14 15:41:10 2010 +0300
@@ -18,8 +18,8 @@
 #ifndef NMIPSSETTINGSCUSTOMITEM_H
 #define NMIPSSETTINGSCUSTOMITEM_H
 
-#include <hbdataformviewitem.h>
-#include <hbdataformmodelitem.h>
+#include <HbDataFormViewItem>
+#include <HbDataFormModelItem>
 
 class QGraphicsItem;
 class HbAbstractViewItem;
@@ -33,21 +33,22 @@
 public:
 
     enum { LabeledComboBox = HbDataFormModelItem::CustomItemBase + 10,
-           TimeEditor };
+           TimeEditor, MultiSelectionItem};
 
     explicit NmIpsSettingsCustomItem(QGraphicsItem *parent=0);
     virtual ~NmIpsSettingsCustomItem();
     virtual HbAbstractViewItem* createItem();
     virtual bool canSetModelIndex(const QModelIndex &index) const;
-
-public slots:
-
-    void restore();
 	
 protected:
 
     virtual HbWidget* createCustomWidget();
 
+private slots:
+
+    void restore();
+    void propertyChanged(QMap<QString, QVariant> properties);
+
 private:
 
     void setWidgetProperty(const QString &property, const QHash<QString, QVariant> &properties);
--- a/ipsservices/nmipssettings/inc/nmipssettingshelper.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/nmipssettings/inc/nmipssettingshelper.h	Fri May 14 15:41:10 2010 +0300
@@ -21,6 +21,7 @@
 #include <QObject>
 #include <QMap>
 #include <QVariant>
+#include <QDateTime>
 
 #include "nmsettingscommon.h"
 #include "nmipssettingitems.h"
@@ -30,6 +31,9 @@
 class HbDataFormModel;
 class HbDataForm;
 class HbAction;
+class HbMessageBox;
+class HbInputDialog;
+class HbValidator;
 class CpSettingFormItemData;
 class NmIpsSettingsManagerBase;
 class NmId;
@@ -55,12 +59,15 @@
     bool isOffline();
     
     void setReceivingScheduleGroupItem(HbDataFormModelItem *item);
+    void setServerInfoGroupItem(HbDataFormModelItem *item);
     void createOrUpdateReceivingScheduleGroupDynamicItem(IpsServices::SettingItem item);
+    void createServerInfoGroupDynamicItems();
     
     int getCorrectPortRadioButtonIndex(int currentPort);
     int getCorrectSecureRadioButtonIndex(QVariant secureSockets, QVariant secureSSLWrapper);
     int getCorrectInboxPathRadioButtonIndex(QVariant folderPath);
     int getCorrectOutgoingPortRadioButtonIndex(int currentPort);
+    int getCorrectOutgoingAuthenticationRadioButtonIndex();
     void handleReceivingScheduleSettingChange(IpsServices::SettingItem settingItem,
         const QVariant &settingValue);
     
@@ -79,9 +86,12 @@
     void mailboxNameTextChange(const QString &text);
     void saveMailAddress();
     void mailAddressTextChange(const QString &text);
-    void saveUserName();
-    void userNameTextChange(const QString &text);
-    void savePassword();
+    void saveIncomingUserName();
+    void incomingUserNameTextChange(const QString &text);
+    void saveIncomingPassword();
+    void saveOutgoingUserName();
+    void outgoingUserNameTextChange(const QString &text);
+    void saveOutgoingPassword();     
     void saveReplyTo();
     void replyToTextChange(const QString &text);
     void deleteButtonPress();
@@ -91,31 +101,38 @@
     void saveOutgoingMailServer();
     void outgoingMailServerTextChange(const QString &text);
     void incomingPortChange(int index);
-    void incomingPortPressed(const QModelIndex &index);
+    void incomingPortPress(const QModelIndex &index);
     void incomingSecureConnectionItemChange(int index);
-    void incomingSecureConnectionPressed(const QModelIndex &index);
-    void inboxPathChange(int index);
-    void inboxPathPressed(const QModelIndex &index);
+    void incomingSecureConnectionPress(const QModelIndex &index);
+    void folderPathChange(int index);
+    void folderPathPress(const QModelIndex &index);
     void outgoingPortChange(int index);
-    void outgoingPortPressed(const QModelIndex &index);
+    void outgoingPortPress(const QModelIndex &index);
     void outgoingSecureConnectionItemChange(int index);
-    void outgoingSecureConnectionPressed(const QModelIndex &index);
+    void outgoingSecureConnectionPress(const QModelIndex &index);
+    void outgoingAuthenticationChange(int index);
+    void outgoingAuthenticationPress(const QModelIndex &index);
 
 private slots:
 
-    void receivingWeekdaysModified(HbAction *action);
-    void startTimeModified();
-    void endTimeModified();
+    void receivingWeekdaysModified();
+    void startTimeModified(QTime time);
+    void endTimeModified(QTime time);
     void refreshPeriodModified(int index);
+    void handleMailboxDelete(HbAction *action);
+    void handleMailboxDeleteUpdate(HbAction *action);
+    void handleUserDefinedIncomingPortInput(HbAction *action);
+    void handleUserDefinedFolderPathInput(HbAction *action);
+    void handleUserDefinedOutgoingPortInput(HbAction *action);
     
 private:
 
     void updateShowMailInMailbox();
     void deleteReceivingScheduleGroupDynamicItem(IpsServices::SettingItem item);
-    QString timeFormat();
-    int showIncomingPortInputDialog(int currentPort, bool &changed);
-    QString showFolderPathInputDialog(bool &changed);
-    int showOutgoingPortInputDialog(int currentPort, bool &changed);
+    void deleteServerInfoGroupDynamicItems();
+    void showIncomingPortInputDialog();
+    void showFolderPathInputDialog();
+    void showOutgoingPortInputDialog();
     void copyReceivingScheduleSettingsFromActiveProfile(int profileMode);
 
     Q_DISABLE_COPY(NmIpsSettingsHelper)
@@ -127,9 +144,17 @@
     NmIpsSettingsManagerBase &mSettingsManager;
     QMap<IpsServices::SettingItem, HbDataFormModelItem *> mContentItems;
     HbDataFormModelItem *mReceivingScheduleGroupItem;   // Not owned.
-    HbDataForm &mDataForm;
-    HbDataFormModel &mDataFormModel;
-    bool mDynamicItemsVisible;
+    HbDataFormModelItem *mServerInfoGroupItem;	// Not owned.
+	HbDataForm &mDataForm;
+	HbDataFormModel &mDataFormModel;
+	HbMessageBox *mDeleteConfirmationDialog; // Owned;
+	HbMessageBox *mDeleteInformationDialog; // Owned;
+	HbInputDialog *mIncomingPortInputDialog; // Owned;
+	HbValidator *mIncomingPortInputValidator; // Owned;
+    HbInputDialog *mFolderPathInputDialog; // Owned;
+    HbInputDialog *mOutgoingPortInputDialog; // Owned;
+    HbValidator *mOutgoingPortInputValidator; // Owned;    
+    bool mServerInfoDynamicItemsVisible;
     int mRadioButtonPreviousIndex;
 };
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ipsservices/nmipssettings/inc/nmipssettingsmultiselectionitem.h	Fri May 14 15:41:10 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:
+*
+*/
+
+#ifndef NMIPSSETTINGSMULTISELECTIONITEM_H
+#define NMIPSSETTINGSMULTISELECTIONITEM_H
+
+#include <HbWidget>
+
+class HbPushButton;
+class HbAction;
+class HbSelectionDialog;
+
+class NmIpsSettingsMultiSelectionItem : public HbWidget
+{
+    Q_OBJECT
+
+    Q_PROPERTY(QString text READ text WRITE setText)
+    Q_PROPERTY(QStringList items READ stringItems WRITE setStringItems)
+    Q_PROPERTY(QList<QVariant> selectedItems READ selectedItems WRITE setSelectedItems)
+    Q_PROPERTY(QString heading READ heading WRITE setHeading)
+
+public:
+
+    NmIpsSettingsMultiSelectionItem(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0);
+    virtual ~NmIpsSettingsMultiSelectionItem();
+
+    QString text() const;
+    void setText(QString text);
+
+    QStringList stringItems() const;
+    void setStringItems(QStringList items);
+
+    QList<QVariant> selectedItems()const;
+    void setSelectedItems(QList<QVariant> selectedItems);
+
+    QString heading() const;
+    void setHeading(QString heading);
+
+signals:
+
+    void editingFinished();
+    void propertyChanged(QMap<QString, QVariant> properties);
+
+private slots:
+
+    void launchSelectionDialog();
+    void selectionDialogClosed(HbAction *action);
+
+private:
+
+    void generateButtonText();
+
+private: // data
+
+    // Not owned.
+    HbPushButton *mButton;
+    // Owned.
+    HbSelectionDialog *mSelectionDialog;
+    QStringList mItems;
+    QList<QVariant> mSelectedItems;
+    QString mHeading;
+};
+
+#endif // NMIPSSETTINGSMULTISELECTIONITEM_H
--- a/ipsservices/nmipssettings/inc/nmipssettingsplugin.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/nmipssettings/inc/nmipssettingsplugin.h	Fri May 14 15:41:10 2010 +0300
@@ -77,8 +77,6 @@
     NmIpsSettingsHelper *mSettingsHelper;
     // Owned.
     NmIpsSettingsManagerBase *mSettingsManager;
-    // Owned.
-    QTranslator *mTranslator;
     // Not owned.
     HbDataFormModel *mModel;
     // Not owned.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ipsservices/nmipssettings/inc/nmipssettingstimeeditor.h	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,72 @@
+/*
+* 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 NMIPSSETTINGSTIMEEDITOR_H
+#define NMIPSSETTINGSTIMEEDITOR_H
+
+#include <QDateTime>
+#include <HbWidget>
+
+class QGraphicsLinearLayout;
+class QGraphicsItem;
+class HbPushButton;
+class HbDialog;
+class HbAction;
+
+class NmIpsSettingsTimeEditor : public HbWidget
+{
+    Q_OBJECT
+
+    Q_PROPERTY(QTime time READ time WRITE setTime)
+    Q_PROPERTY(QString heading READ heading WRITE setHeading)
+
+public:
+
+    NmIpsSettingsTimeEditor(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0);
+    virtual ~NmIpsSettingsTimeEditor();
+
+    QTime time() const;
+    void setTime(QTime time);
+
+    QString heading() const;
+    void setHeading(QString label);
+
+signals:
+
+    void timeChanged(QTime time);
+
+private slots:
+
+    void launchTimePicker();
+    void handleTimeAction(HbAction *action);
+
+private:
+
+    QString timeFormat();
+
+private: // data
+
+    // Now owned.
+    HbPushButton *mButton;
+
+    HbDialog *mTimePickerDialog;
+
+    QTime mTime;
+    QString mLabel;
+};
+
+#endif // NMIPSSETTINGSTIMEEDITOR_H
--- a/ipsservices/nmipssettings/nmipssettings.pro	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/nmipssettings/nmipssettings.pro	Fri May 14 15:41:10 2010 +0300
@@ -23,10 +23,8 @@
 
 DEPENDPATH += .
 
-INCLUDEPATH += .
 INCLUDEPATH += ./inc
 INCLUDEPATH += ../../inc
-INCLUDEPATH += ../../emailuis/nmsettingui/inc/
 INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
 
 CONFIG += hb
@@ -49,7 +47,9 @@
            inc/nmipssettingsmanagerfactory.h \
            inc/nmipsextendedsettingsmanager.h \
            inc/nmipssettingscustomitem.h \
-           inc/nmipssettingslabeledcombobox.h
+           inc/nmipssettingslabeledcombobox.h \
+           inc/nmipssettingstimeeditor.h \
+           inc/nmipssettingsmultiselectionitem.h
 
 SOURCES += src/nmipssettingsplugin.cpp \
            src/nmipssettingshelper.cpp \
@@ -59,10 +59,9 @@
            src/nmipssettingsmanagerfactory.cpp \
            src/nmipsextendedsettingsmanager.cpp \
            src/nmipssettingscustomitem.cpp \
-           src/nmipssettingslabeledcombobox.cpp
-
-LIBS += -leuser
-LIBS += -llibc
+           src/nmipssettingslabeledcombobox.cpp \
+           src/nmipssettingstimeeditor.cpp \
+           src/nmipssettingsmultiselectionitem.cpp
 
 symbian: { 
     TARGET.EPOCALLOWDLLDATA = 1
@@ -74,7 +73,9 @@
     LIBS += -lxqutils
     LIBS += -lxqsettingsmanager
     LIBS += -leuser
+    LIBS += -llibc
 }
+
 symbian: plugin { # copy qtstub and manifest
 
     PLUGIN_STUB_PATH = /resource/qt/plugins/nmail/settings
@@ -93,7 +94,7 @@
 BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
                              "rom/nmipssettings.iby                 CORE_APP_LAYER_IBY_EXPORT_PATH(nmipssettings.iby)" \
                              "rom/nmipssettingslanguage.iby         LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(nmipssettingslanguage.iby)" \
-                             "inc/ipssettingkeys.h                  |../../inc/ipssettingkeys.h" \
+                             "inc/ipssettingkeys.h                  |../inc/ipssettingkeys.h" \
                              "inc/nmipssettingitems.h               |../inc/nmipssettingitems.h" \
                              "conf/2000E53D.txt                     /epoc32/release/winscw/udeb/z/private/10202BE9/2000E53D.txt" \
                              "conf/2000E53D.txt                     /epoc32/release/winscw/urel/z/private/10202BE9/2000E53D.txt" \
@@ -107,3 +108,5 @@
 plugin.sources = $${TARGET}.dll
 plugin.path = $$PLUGIN_STUB_PATH
 DEPLOYMENT += plugin
+    
+TRANSLATIONS = mailips.ts
--- a/ipsservices/nmipssettings/src/nmipssettingscustomitem.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/nmipssettings/src/nmipssettingscustomitem.cpp	Fri May 14 15:41:10 2010 +0300
@@ -16,13 +16,14 @@
 */
 
 #include <QVariant>
-#include <hbdatetimeedit.h>
-#include <hbabstractitemview.h>
-#include <hbdataformmodel.h>
-#include <hbdataformmodelitem.h>
+#include <HbAbstractItemView>
+#include <HbDataFormModel>
+#include <HbDataFormModelItem>
 
 #include "nmipssettingscustomitem.h"
 #include "nmipssettingslabeledcombobox.h"
+#include "nmipssettingstimeeditor.h"
+#include "nmipssettingsmultiselectionitem.h"
 
 /*!
     \class NmIpsSettingsCustomItem
@@ -61,43 +62,7 @@
 bool NmIpsSettingsCustomItem::canSetModelIndex(const QModelIndex &index) const
 {
     int type(index.data(HbDataFormModelItem::ItemTypeRole).toInt());
-    return type==LabeledComboBox || type==TimeEditor;
-}
-
-/*!
-    Sets the custom widget's properties from the model item.
-*/
-void NmIpsSettingsCustomItem::restore()
-{
-    HbDataFormModelItem::DataItemType itemType = static_cast<HbDataFormModelItem::DataItemType>(
-        modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt());
-
-    if (itemType==LabeledComboBox || itemType==TimeEditor) {
-
-        HbDataFormModel* model = static_cast<HbDataFormModel*>
-            (static_cast<HbAbstractViewItem*>(this)->itemView()->model());
-        HbDataFormModelItem* modelItem = model->itemFromIndex(modelIndex());
-        QHash<QString ,QVariant> properties =
-            modelItem->data(HbDataFormModelItem::PropertyRole).toHash();
-
-         if (itemType==TimeEditor) {
-             // Set time editor properties. Simply copy all set properties to the widget.
-             QStringList propertyNames = properties.keys();
-
-             for (int index=0 ; index < propertyNames.count() ; index++) {
-                 QString propName = propertyNames.at(index);
-                 dataItemContentWidget()->setProperty(propName.toAscii().data(),
-                                                      properties.value(propName));
-             }
-         } else {
-             // Set combobox properties in specific order. currentIndex must be set last so that
-             // both the labelTexts and comboItems have been set before. Also, labelTexts must be
-             // set before comboItems.
-             setWidgetProperty("labelTexts", properties);
-             setWidgetProperty("comboItems", properties);
-             setWidgetProperty("currentIndex", properties);
-         }
-    }
+    return type == LabeledComboBox || type == TimeEditor || type == MultiSelectionItem;
 }
 
 /*!
@@ -111,24 +76,89 @@
     HbWidget *widget = 0;
 
     switch (type) {
-            case LabeledComboBox: {
-                widget = new NmIpsSettingsLabeledComboBox();
-                break;
-                }
-            case TimeEditor: {
-                HbDateTimeEdit *edit = new HbDateTimeEdit();
-                widget = edit;
-                break;
-                }
-            default: {
-                break;
-                }
+        case LabeledComboBox: {
+            widget = new NmIpsSettingsLabeledComboBox();
+            break;
+            }
+        case TimeEditor: {
+            widget = new NmIpsSettingsTimeEditor();
+            break;
+            }
+        case MultiSelectionItem: {
+            widget = new NmIpsSettingsMultiSelectionItem();
+            connect(widget, SIGNAL(propertyChanged(QMap<QString, QVariant>)),
+                this, SLOT(propertyChanged(QMap<QString, QVariant>)));
+            break;
+        }
+        default: {
+            // Unknown/unhandled item type.
+            break;
+        }
     }
 
     return widget;
 }
 
 /*!
+    Sets the custom widget's properties from the model item.
+*/
+void NmIpsSettingsCustomItem::restore()
+{
+    HbDataFormModelItem::DataItemType itemType = static_cast<HbDataFormModelItem::DataItemType>(
+        modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt());
+
+    if (itemType == LabeledComboBox || itemType == TimeEditor || itemType == MultiSelectionItem) {
+
+        HbDataFormModel *model = static_cast<HbDataFormModel *>
+            (static_cast<HbAbstractViewItem *>(this)->itemView()->model());
+
+        HbDataFormModelItem *modelItem = model->itemFromIndex(modelIndex());
+
+        QHash<QString ,QVariant> properties =
+            modelItem->data(HbDataFormModelItem::PropertyRole).toHash();
+
+        if (itemType == LabeledComboBox) {
+            // Set combobox properties in specific order. currentIndex must be set last so that
+            // both the labelTexts and comboItems have been set before. Also, labelTexts must
+            // have been set before comboItems. Otherwise the setting of current item doesn't work.
+            // Block signals which are generated when comboItems are set.
+            setWidgetProperty("labelTexts", properties);
+            dataItemContentWidget()->blockSignals(true);
+            setWidgetProperty("comboItems", properties);
+            dataItemContentWidget()->blockSignals(false);
+            setWidgetProperty("currentIndex", properties);
+
+        } else {
+            // Set item properties. Simply copy all set properties to the widget.
+            QStringList propertyNames = properties.keys();
+            foreach (QString key, propertyNames) {
+                QVariant value = properties.value(key);
+                dataItemContentWidget()->setProperty(key.toAscii().data(), value);
+            }
+        }
+    }
+}
+
+/*!
+    Copies all given properties from widget to model.
+
+    \param properties Composited widget properties.
+*/
+void NmIpsSettingsCustomItem::propertyChanged(QMap<QString, QVariant> properties)
+{
+    HbDataFormModel* model =
+        static_cast<HbDataFormModel*>(static_cast<HbAbstractViewItem*>(this)->itemView()->model());
+
+    model->blockSignals(true);
+    HbDataFormModelItem* modlItem = model->itemFromIndex(modelIndex());
+    QStringList keys = properties.keys();
+    foreach (QString key, keys) {
+        modlItem->setContentWidgetData(key, properties.value(key));
+    }
+    model->blockSignals(false);
+}
+
+/*!
     Sets \a property to the content widget if found from \a properties.
     \param property Name of the property to set.
     \param properties Available properties.
@@ -140,4 +170,3 @@
         dataItemContentWidget()->setProperty(property.toAscii().data(), properties.value(property));
     }
 }
-
--- a/ipsservices/nmipssettings/src/nmipssettingshelper.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/nmipssettings/src/nmipssettingshelper.cpp	Fri May 14 15:41:10 2010 +0300
@@ -25,6 +25,7 @@
 #include <hbdataformmodel.h>
 #include <qstringlist.h>
 #include <hbextendedlocale.h>
+#include <hblineedit.h>
 #include <HbValidator>
 #include <QIntValidator>
 #include <HbStringUtil>
@@ -39,6 +40,7 @@
 
 // Dynamic receiving schedule group items
 const IpsServices::SettingItem NmIpsSettingsReceivingSchedule[] = {
+        IpsServices::ReceptionInboxSyncWindow,
         IpsServices::ReceptionWeekDays,
         IpsServices::ReceptionDayStartTime,
         IpsServices::ReceptionDayEndTime,
@@ -63,7 +65,14 @@
   mSettingsManager(settingsManager),
   mDataForm(dataForm),
   mDataFormModel(dataFormModel),
-  mDynamicItemsVisible(false),
+  mDeleteConfirmationDialog(0),
+  mDeleteInformationDialog(0),
+  mIncomingPortInputDialog(0),
+  mIncomingPortInputValidator(0),
+  mFolderPathInputDialog(0),
+  mOutgoingPortInputDialog(0),
+  mOutgoingPortInputValidator(0),
+  mServerInfoDynamicItemsVisible(false),
   mRadioButtonPreviousIndex(0)
 {
 }
@@ -74,12 +83,18 @@
 NmIpsSettingsHelper::~NmIpsSettingsHelper()
 {
     mContentItems.clear();
+    delete mDeleteConfirmationDialog;
+    delete mDeleteInformationDialog;
+    delete mIncomingPortInputDialog;
+    delete mIncomingPortInputValidator;
+    delete mFolderPathInputDialog;
+    delete mOutgoingPortInputDialog;
 }
 
 /*!
     Inserts content item pointers into map, which then can be used to access the widgets data.
     \param IpsServices::SettingItem. Key that can be used to access the value from map.
-    \param  CpSettingFormItemData *. Pointer to the content item.
+    \param  HbDataFormModelItem *. Pointer to the content item.
 */
 void NmIpsSettingsHelper::insertContentItem(IpsServices::SettingItem key,
     HbDataFormModelItem *value)
@@ -88,7 +103,7 @@
 }
 
 /*!
-
+    Returns a content item from contentitem map.
 */
 HbDataFormModelItem *NmIpsSettingsHelper::contentItem(IpsServices::SettingItem key) const
 {
@@ -105,6 +120,15 @@
 }
 
 /*!
+    Sets the group item for dynamic receiving schedule items.
+    \param item Group item.
+*/
+void NmIpsSettingsHelper::setServerInfoGroupItem(HbDataFormModelItem *item)
+{
+    mServerInfoGroupItem = item;
+}
+
+/*!
     Creates or updates the setting items under the receiving schedule group item.
 */
 void NmIpsSettingsHelper::createOrUpdateReceivingScheduleGroupDynamicItem(
@@ -123,20 +147,21 @@
                 // If not exist, create one
                 if (!formItemData) {
                     formItemData =
-                        new CpSettingFormItemData(HbDataFormModelItem::MultiselectionItem,
-                            hbTrId("txt_mailips_setlabel_receiving_weekdays"));
+                        new CpSettingFormItemData(
+                            static_cast<HbDataFormModelItem::DataItemType>(NmIpsSettingsCustomItem::MultiSelectionItem),
+                                hbTrId("txt_mailips_setlabel_receiving_weekdays"));
 
                     insertContentItem(IpsServices::ReceptionWeekDays, formItemData);
                     mReceivingScheduleGroupItem->appendChild(formItemData);
                     QStringList weekdayItems;
+
                     weekdayItems << hbTrId("txt_mailips_setlabel_download_images_val_mon")
                                  << hbTrId("txt_mailips_setlabel_download_images_val_tue")
                                  << hbTrId("txt_mailips_setlabel_download_images_val_wed")
                                  << hbTrId("txt_mailips_setlabel_download_images_val_thu")
                                  << hbTrId("txt_mailips_setlabel_download_images_val_fri")
                                  << hbTrId("txt_mailips_setlabel_download_images_val_sat")
-                                 << hbTrId("txt_mailips_setlabel_download_images_val_sun")
-                                 << hbTrId("txt_mailips_setlabel_download_images_val_every_day");
+                                 << hbTrId("txt_mailips_setlabel_download_images_val_sun");
 
                     QList<QVariant> weekdayItemValues;
                     weekdayItemValues << 0x01
@@ -145,15 +170,18 @@
                                       << 0x08
                                       << 0x10
                                       << 0x20
-                                      << 0x40
-                                      << 0x7F;
+                                      << 0x40;
 
                     formItemData->setData(HbDataFormModelItem::HbDataFormModelItem::DescriptionRole + 1,
                         weekdayItemValues);
+
+                    formItemData->setContentWidgetData(QString("heading"),
+                        hbTrId("txt_mailips_dialog_heading_receiving_weekdays"));
+
                     formItemData->setContentWidgetData(QString("items"), weekdayItems);
-                    formItemData->setEnabled(false);
-//                    mDataForm.addConnection(formItemData, SIGNAL(finished(HbAction *)),
-//                        this, SLOT(receivingWeekdaysModified(HbAction *)));
+
+                    mDataForm.addConnection(formItemData, SIGNAL(editingFinished()),
+                        this, SLOT(receivingWeekdaysModified()));
                 }
 
                 // Update data
@@ -162,18 +190,22 @@
                 QList<QVariant> selectedDays;
                 selectedDays.clear();
                 int days(value.toInt());
-                if (days == 0x7f) {
-                   // Every weekday selected
-                   selectedDays.append(7);
-                } else {
-                   // 0-6 Individual weekdays selected
-                   for (int i=0; i<=6; ++i) {
-                       if (days & (1 << i)) {
-                           selectedDays.append(i);
-                       }
+
+                // 0-6 Individual weekdays selected
+                for (int i=0; i<=6; ++i) {
+                   if (days & (1 << i)) {
+                       selectedDays.append(i);
                    }
                 }
+
                 formItemData->setContentWidgetData(QString("selectedItems"), selectedDays);
+
+                // Every weekday selected
+                if (days == 0x7f) {
+                    formItemData->setContentWidgetData(QString("text"),
+                        hbTrId("txt_mailips_setlabel_download_images_val_every_day"));
+                }
+
                 break;
             }
 
@@ -182,25 +214,25 @@
             {
                 // If not exist, create one
                 if (!formItemData) {
-                    QString format(timeFormat());
                     formItemData = new CpSettingFormItemData(
-                        static_cast< HbDataFormModelItem::DataItemType >(NmIpsSettingsCustomItem::TimeEditor),
+                        static_cast<HbDataFormModelItem::DataItemType>(NmIpsSettingsCustomItem::TimeEditor),
                             hbTrId("txt_mailips_setlabel_day_start_time"));
 
                     insertContentItem(IpsServices::ReceptionDayStartTime, formItemData);
-                    formItemData->setEnabled(true);
-                    formItemData->setContentWidgetData(QString("displayFormat"), format);
+                    formItemData->setContentWidgetData(QString("heading"),
+                        hbTrId("txt_mailips_dialog_heading_start_time"));
                     mReceivingScheduleGroupItem->appendChild(formItemData);
-                    mDataForm.addConnection(formItemData, SIGNAL(editingFinished()),
-                        this, SLOT(startTimeModified()));
+                    mDataForm.addConnection(formItemData, SIGNAL(timeChanged(QTime)),
+                        this, SLOT(startTimeModified(QTime)));
 
                 }
 
                 // Update data
                 QVariant startTime;
                 mSettingsManager.readSetting(item, startTime);
-                QDateTime startDateTime(QDate(2010, 1, 1), QTime(startTime.toInt(),0));
-                formItemData->setContentWidgetData("dateTime", startDateTime);
+                int startHour(startTime.toInt() / 60);
+                int startMinute(startTime.toInt() % 60);
+                formItemData->setContentWidgetData("time", QTime(startHour, startMinute));
                 break;
             }
 
@@ -209,24 +241,24 @@
             {
                 // If not exist, create one
                 if (!formItemData) {
-                    QString format(timeFormat());
                     formItemData = new CpSettingFormItemData(
                         static_cast<HbDataFormModelItem::DataItemType> (NmIpsSettingsCustomItem::TimeEditor),
                             hbTrId("txt_mailips_setlabel_day_end_time"));
 
                     insertContentItem(IpsServices::ReceptionDayEndTime, formItemData);
-                    formItemData->setEnabled(true);
-                    formItemData->setContentWidgetData(QString("displayFormat"), format);
+                    formItemData->setContentWidgetData(QString("heading"),
+                        hbTrId("txt_mailips_dialog_heading_end_time"));
                     mReceivingScheduleGroupItem->appendChild(formItemData);
                 }
 
                 // Update data
                 QVariant endTime;
                 mSettingsManager.readSetting(item, endTime);
-                QDateTime endDateTime(QDate(2010, 1, 1), QTime(endTime.toInt(),0));
-                formItemData->setContentWidgetData("dateTime", endDateTime);
-                mDataForm.addConnection(formItemData, SIGNAL(editingFinished()),
-                    this, SLOT(endTimeModified()));
+                int endHour(endTime.toInt() / 60);
+                int endMinute(endTime.toInt() % 60);
+                formItemData->setContentWidgetData("time", QTime(endHour, endMinute));
+                mDataForm.addConnection(formItemData, SIGNAL(timeChanged(QTime)),
+                    this, SLOT(endTimeModified(QTime)));
                 break;
             }
 
@@ -282,6 +314,42 @@
 }
 
 /*!
+    Creates the setting items under the Serverinfo group items user authentication.
+*/
+void NmIpsSettingsHelper::createServerInfoGroupDynamicItems()
+{   
+    HbDataFormModelItem *item = mContentItems.value(IpsServices::SMTPAuthentication);
+    int insertIndex = mServerInfoGroupItem->indexOf(item) + 1;
+        
+    // Username
+    QVariant username;
+    mSettingsManager.readSetting(IpsServices::OutgoingLoginName, username);
+    CpSettingFormItemData *usernameItem = new CpSettingFormItemData(
+        HbDataFormModelItem::TextItem, hbTrId("txt_mailips_setlabel_username"));
+    insertContentItem(IpsServices::OutgoingLoginName, usernameItem);
+    usernameItem->setContentWidgetData(QString("text"), username);
+    mDataForm.addConnection(usernameItem, SIGNAL(editingFinished()),
+                            this, SLOT(saveOutgoingUserName()));
+    mDataForm.addConnection(usernameItem, SIGNAL(textChanged(QString)),
+                            this, SLOT(outgoingUserNameTextChange(QString)));
+    mServerInfoGroupItem->insertChild(insertIndex, usernameItem);
+
+    // Password
+    QVariant password;
+    mSettingsManager.readSetting(IpsServices::OutgoingPassword, password);
+    CpSettingFormItemData *passwordItem = new CpSettingFormItemData(
+        HbDataFormModelItem::TextItem, hbTrId("txt_mailips_setlabel_password"));
+    insertContentItem(IpsServices::OutgoingPassword, passwordItem);
+    passwordItem->setContentWidgetData(QString("text"), password);
+    passwordItem->setContentWidgetData(QString("echoMode"), HbLineEdit::PasswordEchoOnEdit);
+    mDataForm.addConnection(passwordItem, SIGNAL(editingFinished()),
+                            this, SLOT(saveOutgoingPassword()));
+    mServerInfoGroupItem->insertChild(insertIndex + 1, passwordItem);
+    
+    mServerInfoDynamicItemsVisible = true;
+}
+
+/*!
     Saves the My Name value into database if user has changed the value.
 */
 void NmIpsSettingsHelper::saveMyName()
@@ -310,13 +378,23 @@
 */
 void NmIpsSettingsHelper::saveMailboxName()
 {
+	bool ok = true;
     if (mCurrentLineEditChanged) {
         HbDataFormModelItem *item = mContentItems.value(IpsServices::MailboxName);
         QVariant data = item->contentWidgetData(QString("text"));
         // Only save mailbox name if it's length is greater than zero. CEmailAccounts does not
         // allow zero-length mailbox names.
         if (data.toString().length() > 0) {
-            mSettingsManager.writeSetting(IpsServices::MailboxName, data);
+            ok = mSettingsManager.writeSetting(IpsServices::MailboxName, data);
+
+            // If failed, try again when the plugin is set to offline
+            if (!ok) {
+                NMLOG("NmIpsSettingsHelper::saveMailboxName failed");
+            	emit goOffline(mSettingsManager.mailboxId());
+				mEmitOnline = true;
+				ok = mSettingsManager.writeSetting(IpsServices::MailboxName, data);
+			}
+
             QVariant property(NmSettings::MailboxName);
             emit mailboxPropertyChanged(mSettingsManager.mailboxId(), property, data);
         }
@@ -368,16 +446,37 @@
 }
 
 /*!
-    Saves the Username value into database if user has changed the value.
+    Saves the Incoming username value into database if user has changed the value.
 */
-void NmIpsSettingsHelper::saveUserName()
+void NmIpsSettingsHelper::saveIncomingUserName()
 {
     if (mCurrentLineEditChanged) {
 		emit goOffline(mSettingsManager.mailboxId());
 		mEmitOnline = true;
 		HbDataFormModelItem *item = mContentItems.value(IpsServices::IncomingLoginName);
+        QVariant username = item->contentWidgetData(QString("text"));
+        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(QString("selected"));
+        if (selected.toInt() == IpsServices::EMailAuthSameAsIncoming) {
+            mSettingsManager.writeSetting(IpsServices::OutgoingLoginName, username);
+        }
+    }
+    mCurrentLineEditChanged = false;
+}
+
+/*!
+    Saves the Outgoing username value into database if user has changed the value.
+*/
+void NmIpsSettingsHelper::saveOutgoingUserName()
+{
+    if (mCurrentLineEditChanged) {
+        emit goOffline(mSettingsManager.mailboxId());
+        mEmitOnline = true;
+        HbDataFormModelItem *item = mContentItems.value(IpsServices::OutgoingLoginName);
         QVariant data = item->contentWidgetData(QString("text"));
-        mSettingsManager.writeSetting(IpsServices::IncomingLoginName, data);
+        mSettingsManager.writeSetting(IpsServices::OutgoingLoginName, data);
     }
     mCurrentLineEditChanged = false;
 }
@@ -387,25 +486,54 @@
 
     \param text Reference to the text value in the line edit box.
 */
-void NmIpsSettingsHelper::userNameTextChange(const QString &text)
+void NmIpsSettingsHelper::incomingUserNameTextChange(const QString &text)
+{
+    Q_UNUSED(text);
+    mCurrentLineEditChanged = true;
+}
+
+/*!
+    Sets the edit changed flag to indicate that user has edited the field
+
+    \param text Reference to the text value in the line edit box.
+*/
+
+void NmIpsSettingsHelper::outgoingUserNameTextChange(const QString &text)
 {
     Q_UNUSED(text);
     mCurrentLineEditChanged = true;
 }
 
 /*!
-    Saves the Password value into database
+    Saves the Incoming password value into database
 */
-void NmIpsSettingsHelper::savePassword()
+void NmIpsSettingsHelper::saveIncomingPassword()
 {
 	emit goOffline(mSettingsManager.mailboxId());
 	mEmitOnline = true;
 	HbDataFormModelItem *item = mContentItems.value(IpsServices::IncomingPassword);
-    QVariant data = item->contentWidgetData(QString("text"));
-    mSettingsManager.writeSetting(IpsServices::IncomingPassword, data);
+    QVariant password = item->contentWidgetData(QString("text"));
+    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(QString("selected"));
+    if (selected.toInt() == IpsServices::EMailAuthSameAsIncoming) {
+        mSettingsManager.writeSetting(IpsServices::OutgoingPassword, password);
+    }
 }
 
 /*!
+    Saves the Outgoing password value into database
+*/
+void NmIpsSettingsHelper::saveOutgoingPassword()
+{
+    emit goOffline(mSettingsManager.mailboxId());
+    mEmitOnline = true;
+    HbDataFormModelItem *item = mContentItems.value(IpsServices::OutgoingPassword);
+    QVariant data = item->contentWidgetData(QString("text"));
+    mSettingsManager.writeSetting(IpsServices::OutgoingPassword, data);
+}
+/*!
     Saves the Reply to value into database if user has changed the value.
 */
 void NmIpsSettingsHelper::saveReplyTo()
@@ -430,64 +558,89 @@
 }
 
 /*!
-    Deletes mailbox and displays the proper notes.
+    Shows the confirmation dialog for user.
 */
 void NmIpsSettingsHelper::deleteButtonPress()
 {
-    HbMessageBox confirmationDialog(HbMessageBox::MessageTypeQuestion);
-    confirmationDialog.setText(hbTrId("txt_mail_dialog_do_you_want_to_delete_the_mailbox"));
-    confirmationDialog.setModal(true);
-    confirmationDialog.setTimeout(HbMessageBox::NoTimeout);
-
-    HbAction *action = confirmationDialog.exec();
-
-    if (action != confirmationDialog.primaryAction()) {
-        // The user did not confirm the deletion.
-        return;
+    if(!mDeleteConfirmationDialog) {
+        mDeleteConfirmationDialog = 
+            new HbMessageBox(HbMessageBox::MessageTypeQuestion);
+        mDeleteConfirmationDialog->setText(
+            hbTrId("txt_mail_dialog_do_you_want_to_delete_the_mailbox"));
+        mDeleteConfirmationDialog->setTimeout(HbMessageBox::NoTimeout);
     }
-
-	emit goOffline(mSettingsManager.mailboxId());
-	mEmitOnline = false;
-
-    QVariant mailboxName;
-    mSettingsManager.readSetting(IpsServices::MailboxName, mailboxName);
+    mDeleteConfirmationDialog->open(this, SLOT(handleMailboxDelete(HbAction *)));
+}
 
-    // Display the progress note. Before display the note, remove the cancel
-    // button.
-    HbProgressDialog progressNote(HbProgressDialog::WaitDialog);
-    progressNote.setText(hbTrId("txt_common_info_deleting"));
-    action = progressNote.primaryAction();
-    progressNote.removeAction(action);
-    progressNote.delayedShow();
-
-    if (!mSettingsManager.deleteMailbox()) {
-        // The mailbox was deleted successfully. Hide the progress note and
-        // display the "mailbox deleted" dialog.
-        progressNote.close();
-
-        HbMessageBox infoDialog(HbMessageBox::MessageTypeInformation);
-        infoDialog.setText(
-            hbTrId("txt_mail_dpophead _1_deleted").arg(mailboxName.toString()));
-        infoDialog.setModal(true);
-        HbAction *action = infoDialog.exec();
-
-        // Emit the signal to update the UI.
-        emit mailboxListChanged(mSettingsManager.mailboxId(),
-                                NmSettings::MailboxDeleted);
-    } else {
-        // Failed to delete the mailbox!
-        progressNote.close();
+/*!
+    Deletes mailbox and displays the proper notes.
+*/
+void NmIpsSettingsHelper::handleMailboxDelete(HbAction *action)
+{
+    if (action == mDeleteConfirmationDialog->primaryAction()) {
+        
+        emit goOffline(mSettingsManager.mailboxId());
+        mEmitOnline = false;
+    
+        QVariant mailboxName;
+        mSettingsManager.readSetting(IpsServices::MailboxName, mailboxName);
+    
+        // Display the progress note. Before display the note, remove the cancel
+        // button.
+        HbProgressDialog progressNote(HbProgressDialog::WaitDialog);
+        progressNote.setText(hbTrId("txt_common_info_deleting"));
+        action = progressNote.primaryAction();
+        progressNote.removeAction(action);
+        progressNote.delayedShow();
+    
+        if (!mSettingsManager.deleteMailbox()) {
+            // The mailbox was deleted successfully. Hide the progress note and
+            // display the "mailbox deleted" dialog.
+            progressNote.close();
+            
+            if (!mDeleteInformationDialog) {
+                mDeleteInformationDialog = 
+                    new HbMessageBox(HbMessageBox::MessageTypeInformation);
+                mDeleteInformationDialog->setText(
+                    hbTrId("txt_mail_dpophead _1_deleted").arg(mailboxName.toString()));
+                mDeleteInformationDialog->setTimeout(HbMessageBox::NoTimeout);
+            }
+            mDeleteInformationDialog->open(this, SLOT(handleMailboxDeleteUpdate(HbAction *)));            
+            
+        } else {
+            // Failed to delete the mailbox!
+            progressNote.close();
+        }
     }
 }
 
 /*!
+    Handels the event after the mailbox delete information dialog has been dismissed.
+*/
+void NmIpsSettingsHelper::handleMailboxDeleteUpdate(HbAction *action)
+{
+    Q_UNUSED(action);
+    // Emit the signal to update the UI.
+    emit mailboxListChanged(mSettingsManager.mailboxId(),
+                            NmSettings::MailboxDeleted);
+}
+
+/*!
     Saves the selected receiving schedule setting.
-    \index Selected receiving schedule.
+    \param index Selected receiving schedule.
 */
 void NmIpsSettingsHelper::receivingScheduleChange(int index)
 {
     mSettingsManager.writeSetting(IpsServices::ReceptionActiveProfile, QVariant(index));
 
+    // Remove text property to avoid old data to be copied from model to widget.
+    HbDataFormModelItem *item = contentItem(IpsServices::ReceptionWeekDays);
+    if (item) {
+        QHash<QString, QVariant> data = item->contentWidgetData();
+        data.remove("text");
+        item->setData(HbDataFormModelItem::PropertyRole, data);
+    }
+
     // Read receiving schedule dynamic group item values and
     // make a decision based on those if item should be visible or not.
     const int dynamicGroupItemsCount(
@@ -556,22 +709,30 @@
 }
 
 /*!
-    Returns locale specific formatting string for hours and minutes.
-    \return Time format string.
+    Deletes the dynamic setting items under the serverinfo group item.
 */
-QString NmIpsSettingsHelper::timeFormat()
+void NmIpsSettingsHelper::deleteServerInfoGroupDynamicItems()
 {
-    // Set the correct time format string based on locale.
-    HbExtendedLocale locale = HbExtendedLocale::system();
-    QString timeFormat("h:mm ap");
-    if (HbExtendedLocale::Time24 == locale.timeStyle()) {
-        timeFormat = QString("h:mm");
+    if(mServerInfoDynamicItemsVisible) {
+        HbDataFormModelItem *item = mContentItems.value(IpsServices::OutgoingLoginName);
+        mDataForm.removeConnection(item, SIGNAL(editingFinished()),
+            this, SLOT(saveOutgoingUserName()));
+        mDataForm.removeConnection(item, SIGNAL(textChanged(QString)),
+            this, SLOT(outgoingUserNameTextChange(QString)));
+        int index = mServerInfoGroupItem->indexOf(item);
+        mServerInfoGroupItem->removeChild(index);
+        mContentItems.remove(IpsServices::OutgoingLoginName);
+
+        item = mContentItems.value(IpsServices::OutgoingPassword);
+        mDataForm.removeConnection(item, SIGNAL(editingFinished()),
+            this, SLOT(saveOutgoingPassword()));
+        index = mServerInfoGroupItem->indexOf(item);
+        mServerInfoGroupItem->removeChild(index);
+        mContentItems.remove(IpsServices::OutgoingPassword);
+        mServerInfoDynamicItemsVisible = false;
     }
-    // Set the separator between hours and minutes.
-    timeFormat.replace(QString(":"), locale.timeSeparator(1));
+}
 
-    return timeFormat;
-}
 /*!
     Saves the incoming mailserver value into database if user has changed the value.
 */
@@ -637,19 +798,49 @@
         int port = mSettingsManager.determineDefaultIncomingPort();
         mSettingsManager.writeSetting(IpsServices::IncomingPort, port);
     } else if (index == IpsServices::NmIpsSettingsUserDefined) {
-        QVariant port; 
-        mSettingsManager.readSetting(IpsServices::IncomingPort, port);
-        bool changed = false;
-        int changedPort = showIncomingPortInputDialog(port.toInt(), changed);       
-        if (changed) {
-            emit goOffline(mSettingsManager.mailboxId());
-            mEmitOnline = true;
-            mSettingsManager.writeSetting(IpsServices::IncomingPort, changedPort);
-        } else {
-            //set selected value back if user canceled.
-            HbDataFormModelItem *item = mContentItems.value(IpsServices::IncomingPort);
-            item->setContentWidgetData(QString("selected"), mRadioButtonPreviousIndex);
-        }
+        showIncomingPortInputDialog();
+    }
+}
+
+/*!
+    Show a input dialog for allowing the user to specify a incoming port.
+*/
+void NmIpsSettingsHelper::showIncomingPortInputDialog()
+{    
+    // User can open the dialog multiple times, so delete the old ones first.
+    delete mIncomingPortInputDialog;
+    mIncomingPortInputDialog = 0;
+    delete mIncomingPortInputValidator;
+    mIncomingPortInputValidator = 0;
+    
+    mIncomingPortInputDialog = new HbInputDialog();
+    mIncomingPortInputDialog->setInputMode(HbInputDialog::IntInput);
+    QVariant currentPort;
+    mSettingsManager.readSetting(IpsServices::IncomingPort, currentPort);
+    mIncomingPortInputValidator = new HbValidator();
+    mIncomingPortInputValidator->addField(new QIntValidator(0, 65535, 0), 
+                        HbStringUtil::convertDigits(QString::number(currentPort.toInt())));
+    mIncomingPortInputDialog->setValidator(mIncomingPortInputValidator);
+    mIncomingPortInputDialog->setPromptText(
+        hbTrId("txt_mailips_setlabel_incoming_port_user_defined"));
+    
+    mIncomingPortInputDialog->open(this, SLOT(handleUserDefinedIncomingPortInput(HbAction *)));
+}
+
+/*!
+   Handels the saving of the port new value.
+*/
+void NmIpsSettingsHelper::handleUserDefinedIncomingPortInput(HbAction *action)
+{
+    if (action == mIncomingPortInputDialog->primaryAction()) {
+        QVariant newPort = mIncomingPortInputDialog->value();
+        emit goOffline(mSettingsManager.mailboxId());
+        mEmitOnline = true;
+        mSettingsManager.writeSetting(IpsServices::IncomingPort, newPort);
+    } else {
+        //set selected value back if user canceled.
+        HbDataFormModelItem *item = mContentItems.value(IpsServices::IncomingPort);
+        item->setContentWidgetData(QString("selected"), mRadioButtonPreviousIndex);
     }
 }
 
@@ -671,39 +862,11 @@
 }
 
 /*!
-    Show a input dialog for allowing the user to specify a incoming port 
-    \param int The current port stored in the settings  
-    \param bool Reference used for marking if the value really changed
-    \return int The user defined port
-*/
-int NmIpsSettingsHelper::showIncomingPortInputDialog(int currentPort, bool &changed)
-{    
-    QVariant newPort;
-
-    HbInputDialog inputDialog;
-    inputDialog.setInputMode(HbInputDialog::IntInput);
-    HbValidator *validator = new HbValidator();
-    validator->addField(new QIntValidator(0, 65535, 0), 
-                        HbStringUtil::convertDigits(QString::number(currentPort)));
-    inputDialog.setValidator(validator);
-    inputDialog.setPromptText(hbTrId("txt_mailips_setlabel_incoming_port_user_defined"));
-    
-    HbAction *action = inputDialog.exec();     
-    if (action == inputDialog.primaryAction()) {
-        newPort = inputDialog.value();
-        changed = true;
-    }  
-    delete validator;   
-    
-    return newPort.toInt();
-}
-
-/*!
     Sets the previous index value to indicate that user has edited the field
 
     \param text Reference to the item in the radio button list.
 */
-void NmIpsSettingsHelper::incomingPortPressed(const QModelIndex &index)
+void NmIpsSettingsHelper::incomingPortPress(const QModelIndex &index)
 {
     Q_UNUSED(index);
     HbDataFormModelItem *item = mContentItems.value(IpsServices::IncomingPort);
@@ -721,18 +884,18 @@
         mEmitOnline = true;
         switch (index) {
             case IpsServices::EMailStartTls: // On (Start TLS)
-                mSettingsManager.writeSetting(IpsServices::IncomingSecureSockets, ETrue);
-                mSettingsManager.writeSetting(IpsServices::IncomingSSLWrapper, EFalse);
+                mSettingsManager.writeSetting(IpsServices::IncomingSecureSockets, true);
+                mSettingsManager.writeSetting(IpsServices::IncomingSSLWrapper, false);
                 break;
 
             case IpsServices::EMailSslTls: // On (SSL/TLS)
-                mSettingsManager.writeSetting(IpsServices::IncomingSecureSockets, EFalse);
-                mSettingsManager.writeSetting(IpsServices::IncomingSSLWrapper, ETrue);
+                mSettingsManager.writeSetting(IpsServices::IncomingSecureSockets, false);
+                mSettingsManager.writeSetting(IpsServices::IncomingSSLWrapper, true);
                 break;
 
             case IpsServices::EMailSecurityOff: // Off
-                mSettingsManager.writeSetting(IpsServices::IncomingSecureSockets, EFalse);
-                mSettingsManager.writeSetting(IpsServices::IncomingSSLWrapper, EFalse);
+                mSettingsManager.writeSetting(IpsServices::IncomingSecureSockets, false);
+                mSettingsManager.writeSetting(IpsServices::IncomingSSLWrapper, false);
                 break;
 
         	 default:
@@ -754,7 +917,7 @@
 
     \param text Reference to the item in the radio button list.
 */
-void NmIpsSettingsHelper::incomingSecureConnectionPressed(const QModelIndex &index)
+void NmIpsSettingsHelper::incomingSecureConnectionPress(const QModelIndex &index)
 {
 	Q_UNUSED(index);
 	HbDataFormModelItem *item = mContentItems.value(IpsServices::IncomingSecureSockets);
@@ -789,58 +952,62 @@
 /*!
     Saves the folderpath value into database if user has changed the value.
 */
-void NmIpsSettingsHelper::inboxPathChange(int index)
+void NmIpsSettingsHelper::folderPathChange(int index)
 {
     if (mRadioButtonPreviousIndex != index && index == IpsServices::NmIpsSettingsDefault) {
         // Empty string sets the folder path to default.
         mSettingsManager.writeSetting(IpsServices::FolderPath, QString(""));
     } else if (index == IpsServices::NmIpsSettingsUserDefined) {
-        bool changed = false;
-        HbDataFormModelItem *item = mContentItems.value(IpsServices::FolderPath);
-        QString changedPath = showFolderPathInputDialog(changed);       
-        if (changed) {
-            mSettingsManager.writeSetting(IpsServices::FolderPath, changedPath);
-            //set selected index to default if user inputed empty string.
-            if (changedPath.isEmpty()) {
-                item->setContentWidgetData(QString("selected"), IpsServices::NmIpsSettingsDefault);
-            }
-        } else {
-            //set selected value back if user canceled.
-            item->setContentWidgetData(QString("selected"), mRadioButtonPreviousIndex);
-        }
+        showFolderPathInputDialog();       
     }
 }
 
 /*!
-    Show a input dialog for allowing the user to specify a folder path 
-    \param bool Reference used for marking if the value really changed
-    \return QString The user defined folder path
+    Show a input dialog for allowing the user to specify a folder path.
 */
-QString NmIpsSettingsHelper::showFolderPathInputDialog(bool &changed)
-{    
+void NmIpsSettingsHelper::showFolderPathInputDialog()
+{   
+    // User can open the dialog multiple times, so delete the old one first.
+    delete mFolderPathInputDialog;
+    mFolderPathInputDialog = 0;
+    
     QVariant folderPath;
     mSettingsManager.readSetting(IpsServices::FolderPath, folderPath);
     
-    HbInputDialog inputDialog;
-    inputDialog.setInputMode(HbInputDialog::TextInput);
-    inputDialog.setPromptText(hbTrId("txt_mailips_setlabel_inbox_path_user_defined"));
-    inputDialog.setValue(folderPath.toString());
+    mFolderPathInputDialog = new HbInputDialog();
+    mFolderPathInputDialog->setInputMode(HbInputDialog::TextInput);
+    mFolderPathInputDialog->setPromptText(hbTrId("txt_mailips_setlabel_folder_path_user_defined"));
+    mFolderPathInputDialog->setValue(folderPath.toString());
     
-    HbAction *action = inputDialog.exec();     
-    if (action == inputDialog.primaryAction()) { 
-        folderPath = inputDialog.value();
-        changed = true;
-    }
-
-    return folderPath.toString();
+    mFolderPathInputDialog->open(this, SLOT(handleUserDefinedFolderPathInput(HbAction *)));
 }
 
 /*!
-    Sets the previous index value to indicate that user has edited the field
+   Handels the saving of the folder path new value.
+*/
+void NmIpsSettingsHelper::handleUserDefinedFolderPathInput(HbAction *action)
+{
+    HbDataFormModelItem *item = mContentItems.value(IpsServices::FolderPath);
+    
+    if (action == mFolderPathInputDialog->primaryAction()) { 
+        QVariant newFolderPath = mFolderPathInputDialog->value();
+        mSettingsManager.writeSetting(IpsServices::FolderPath, newFolderPath);
+        //set selected index to default if user inputed empty string.
+        if (newFolderPath.toString().isEmpty()) {
+            item->setContentWidgetData(QString("selected"), IpsServices::NmIpsSettingsDefault);
+        }
+    } else {
+        //set selected value back if user canceled.
+        item->setContentWidgetData(QString("selected"), mRadioButtonPreviousIndex);
+    }
+}
+
+/*!
+    Sets the previous index value to indicate that user has edited the field.
 
     \param text Reference to the item in the radio button list.
 */
-void NmIpsSettingsHelper::inboxPathPressed(const QModelIndex &index)
+void NmIpsSettingsHelper::folderPathPress(const QModelIndex &index)
 {
     Q_UNUSED(index);
     HbDataFormModelItem *item = mContentItems.value(IpsServices::FolderPath);
@@ -849,34 +1016,45 @@
 }
 
 /*!
-
+    Handles weekdays modifications.
 */
-void NmIpsSettingsHelper::receivingWeekdaysModified(HbAction *action)
+void NmIpsSettingsHelper::receivingWeekdaysModified()
 {
-    Q_UNUSED(action)
     HbDataFormModelItem *item = mContentItems.value(IpsServices::ReceptionWeekDays);
     QVariant widgetData = item->contentWidgetData(QString("selectedItems"));
-    QList< QVariant > selectedItems = widgetData.value< QList< QVariant > >();
+    QList<QVariant> selectedIndexes = widgetData.value< QList<QVariant> >();
+    QVariant itemData = item->data(HbDataFormModelItem::HbDataFormModelItem::DescriptionRole + 1);
+    QList<QVariant> itemValues = itemData.value< QList<QVariant> >();
 
-    foreach (QVariant selection, selectedItems) {
-        int value = selection.toInt();
+    int days(0);
+    foreach (QVariant selectedIndex, selectedIndexes) {
+        days |= itemValues.at(selectedIndex.toInt()).toInt();
+    }
+
+    handleReceivingScheduleSettingChange(IpsServices::ReceptionWeekDays, days);
+
+    // Every weekday selected.
+    if (days == 0x7f) {
+        item->setContentWidgetData(QString("text"),
+            hbTrId("txt_mailips_setlabel_download_images_val_every_day"));
     }
 }
 
 /*!
-
+    Handles start time modifications.
+	
+    \param time Modified start time.
 */
-void NmIpsSettingsHelper::startTimeModified()
+void NmIpsSettingsHelper::startTimeModified(QTime time)
 {
-    HbDataFormModelItem *item = mContentItems.value(IpsServices::ReceptionDayStartTime);
-    QVariant data = item->contentWidgetData(QString("dateTime"));
-    QDateTime dateTime = data.value< QDateTime >();
-    int startHour(dateTime.time().hour());
-    handleReceivingScheduleSettingChange(IpsServices::ReceptionDayStartTime, startHour);
+    int startTime(time.hour()*60 + time.minute());
+    handleReceivingScheduleSettingChange(IpsServices::ReceptionDayStartTime, startTime);
 }
 
 /*!
+    Handles refresh period modifications.
 
+    \param index selected item index.
 */
 void NmIpsSettingsHelper::refreshPeriodModified(int index)
 {
@@ -887,15 +1065,14 @@
 }
 
 /*!
+    Handles end time modifications.
 
+    \param time Modified start time.
 */
-void NmIpsSettingsHelper::endTimeModified()
+void NmIpsSettingsHelper::endTimeModified(QTime time)
 {
-    HbDataFormModelItem *item = mContentItems.value(IpsServices::ReceptionDayEndTime);
-    QVariant data = item->contentWidgetData(QString("dateTime"));
-    QDateTime dateTime = data.value< QDateTime >();
-    int endHour(dateTime.time().hour());
-    handleReceivingScheduleSettingChange(IpsServices::ReceptionDayEndTime, endHour);
+    int endTime(time.hour()*60 + time.minute());
+    handleReceivingScheduleSettingChange(IpsServices::ReceptionDayEndTime, endTime);
 }
 
 /*!
@@ -915,7 +1092,12 @@
 }
 
 /*!
+    Handles receiving schedule item value modifications.
+    Takes care of creating 'user defined' mode, coping values from active profile to
+    user defined mode, storing changed value and selecting 'user defined' mode.
 
+    \param settingItem Changed setting item.
+    \param settingValue Setting item's value.
 */
 void NmIpsSettingsHelper::handleReceivingScheduleSettingChange(
     IpsServices::SettingItem settingItem, const QVariant &settingValue)
@@ -946,7 +1128,9 @@
 }
 
 /*!
+    Copies receiving schedule settings from currently active profile to given profile.
 
+    \param profileMode Mode where receiving schedule settings from active profile are copied to.
 */
 void NmIpsSettingsHelper::copyReceivingScheduleSettingsFromActiveProfile(int profileMode)
 {
@@ -982,19 +1166,50 @@
         int port = mSettingsManager.determineDefaultOutgoingPort();
         mSettingsManager.writeSetting(IpsServices::OutgoingPort, port);
     } else if (index == IpsServices::NmIpsSettingsUserDefined) {
-        QVariant port;
-        mSettingsManager.readSetting(IpsServices::OutgoingPort, port);
-        bool changed = false;
-        int changedPort = showOutgoingPortInputDialog(port.toInt(), changed);
-        if (changed) {
-            emit goOffline(mSettingsManager.mailboxId());
-            mEmitOnline = true;
-            mSettingsManager.writeSetting(IpsServices::OutgoingPort, changedPort);
-        } else {
-            //set selected value back if user canceled.
-            HbDataFormModelItem *item = mContentItems.value(IpsServices::OutgoingPort);
-            item->setContentWidgetData(QString("selected"), mRadioButtonPreviousIndex);
-        }
+        showOutgoingPortInputDialog();
+    }
+}
+
+/*!
+    Show a input dialog for allowing the user to specify a outgoing port.
+
+*/
+void NmIpsSettingsHelper::showOutgoingPortInputDialog()
+{
+    // User can open the dialog multiple times, so delete the old ones first.
+    delete mOutgoingPortInputDialog;
+    mOutgoingPortInputDialog = 0;
+    delete mOutgoingPortInputValidator;
+    mOutgoingPortInputValidator = 0;
+    
+    mOutgoingPortInputDialog = new HbInputDialog();
+    mOutgoingPortInputDialog->setInputMode(HbInputDialog::IntInput);
+    QVariant currentPort;
+    mSettingsManager.readSetting(IpsServices::OutgoingPort, currentPort);
+    mOutgoingPortInputValidator = new HbValidator();
+    mOutgoingPortInputValidator->addField(new QIntValidator(0, 65535, 0), 
+                        HbStringUtil::convertDigits(QString::number(currentPort.toInt())));
+    mOutgoingPortInputDialog->setValidator(mOutgoingPortInputValidator);
+    mOutgoingPortInputDialog->setPromptText(
+        hbTrId("txt_mailips_setlabel_incoming_port_user_defined"));
+    
+    mOutgoingPortInputDialog->open(this, SLOT(handleUserDefinedOutgoingPortInput(HbAction *)));
+}
+
+/*!
+    Handels the saving of the port new value.
+*/
+void NmIpsSettingsHelper::handleUserDefinedOutgoingPortInput(HbAction *action)
+{
+    if (action == mOutgoingPortInputDialog->primaryAction()) {
+        QVariant newPort = mOutgoingPortInputDialog->value();
+        emit goOffline(mSettingsManager.mailboxId());
+        mEmitOnline = true;
+        mSettingsManager.writeSetting(IpsServices::OutgoingPort, newPort);
+    } else {
+        //set selected value back if user canceled.
+        HbDataFormModelItem *item = mContentItems.value(IpsServices::OutgoingPort);
+        item->setContentWidgetData(QString("selected"), mRadioButtonPreviousIndex);
     }
 }
 
@@ -1003,7 +1218,7 @@
 
     \param index Reference to the item in the radio button list.
 */
-void NmIpsSettingsHelper::outgoingPortPressed(const QModelIndex &index)
+void NmIpsSettingsHelper::outgoingPortPress(const QModelIndex &index)
 {
     Q_UNUSED(index);
     HbDataFormModelItem *item = mContentItems.value(IpsServices::OutgoingPort);
@@ -1012,34 +1227,6 @@
 }
 
 /*!
-    Show a input dialog for allowing the user to specify a outgoing port
-    \param int The current port stored in the settings
-    \param bool Reference used for marking if the value really changed
-    \return int The user defined port
-*/
-int NmIpsSettingsHelper::showOutgoingPortInputDialog(int currentPort, bool &changed)
-{
-    QVariant newPort;
-
-    HbInputDialog inputDialog;
-    inputDialog.setInputMode(HbInputDialog::IntInput);
-    HbValidator *validator = new HbValidator();
-    validator->addField(new QIntValidator(0, 65535, 0), 
-                        HbStringUtil::convertDigits(QString::number(currentPort)));
-    inputDialog.setValidator(validator);
-    inputDialog.setPromptText(hbTrId("txt_mailips_setlabel_incoming_port_user_defined"));
-
-    HbAction *action = inputDialog.exec();
-    if (action == inputDialog.primaryAction()) {
-        newPort = inputDialog.value();
-        changed = true;
-    }
-    delete validator;
-
-    return newPort.toInt();
-}
-
-/*!
     Used for getting the index to display in the outgoing port radio button list
 
     \return index Used to set the selected value
@@ -1057,6 +1244,41 @@
 }
 
 /*!
+    Used for getting the index to display in the outgoing authentication radio button list 
+    
+    \return index Used to set the selected value
+*/
+int NmIpsSettingsHelper::getCorrectOutgoingAuthenticationRadioButtonIndex()
+{
+    int index(IpsServices::EMailAuthNone);
+    QVariant temp;
+    bool outgoingAuthentication;
+    QString outgoingLoginName;
+    QString outgoingPassword;
+    QString incomingLoginName;
+    QString incomingPassword;
+    mSettingsManager.readSetting(IpsServices::SMTPAuthentication, temp);
+    outgoingAuthentication = temp.toBool();
+    mSettingsManager.readSetting(IpsServices::OutgoingLoginName, temp);
+    outgoingLoginName = temp.toString();
+    mSettingsManager.readSetting(IpsServices::OutgoingPassword, temp);
+    outgoingPassword = temp.toString();
+    mSettingsManager.readSetting(IpsServices::IncomingLoginName, temp);
+    incomingLoginName = temp.toString();
+    mSettingsManager.readSetting(IpsServices::IncomingPassword, temp);
+    incomingPassword = temp.toString();
+    
+    if (outgoingAuthentication) {
+        if (outgoingLoginName == incomingLoginName && outgoingPassword == incomingPassword) {
+            index = IpsServices::EMailAuthSameAsIncoming;    
+        } else {
+            index = IpsServices::EMailAuthUserAuthentication;
+        }
+    }
+    return index;
+}
+
+/*!
     Saves the outgoing secure connection value into database if user has changed the value.
 */
 void NmIpsSettingsHelper::outgoingSecureConnectionItemChange(int index)
@@ -1066,18 +1288,18 @@
         mEmitOnline = true;
         switch (index) {
             case IpsServices::EMailStartTls: // On (Start TLS)
-                mSettingsManager.writeSetting(IpsServices::OutgoingSecureSockets, ETrue);
-                mSettingsManager.writeSetting(IpsServices::OutgoingSSLWrapper, EFalse);
+                mSettingsManager.writeSetting(IpsServices::OutgoingSecureSockets, true);
+                mSettingsManager.writeSetting(IpsServices::OutgoingSSLWrapper, false);
                 break;
 
             case IpsServices::EMailSslTls: // On (SSL/TLS)
-                mSettingsManager.writeSetting(IpsServices::OutgoingSecureSockets, EFalse);
-                mSettingsManager.writeSetting(IpsServices::OutgoingSSLWrapper, ETrue);
+                mSettingsManager.writeSetting(IpsServices::OutgoingSecureSockets, false);
+                mSettingsManager.writeSetting(IpsServices::OutgoingSSLWrapper, true);
                 break;
 
             case IpsServices::EMailSecurityOff: // Off
-                mSettingsManager.writeSetting(IpsServices::OutgoingSecureSockets, EFalse);
-                mSettingsManager.writeSetting(IpsServices::OutgoingSSLWrapper, EFalse);
+                mSettingsManager.writeSetting(IpsServices::OutgoingSecureSockets, false);
+                mSettingsManager.writeSetting(IpsServices::OutgoingSSLWrapper, false);
                 break;
 
         	 default:
@@ -1099,7 +1321,7 @@
 
     \param text Reference to the item in the radio button list.
 */
-void NmIpsSettingsHelper::outgoingSecureConnectionPressed(const QModelIndex &index)
+void NmIpsSettingsHelper::outgoingSecureConnectionPress(const QModelIndex &index)
 {
 	Q_UNUSED(index);
 	HbDataFormModelItem *item = mContentItems.value(IpsServices::OutgoingSecureSockets);
@@ -1107,3 +1329,55 @@
     mRadioButtonPreviousIndex = data.toInt();
 }
 
+/*!
+    Saves the outgoing authetication value into database if user has changed the value and
+    updates dynamic group items.
+*/
+void NmIpsSettingsHelper::outgoingAuthenticationChange(int index)
+{
+    if (mRadioButtonPreviousIndex != index) {
+        QVariant loginName;
+        QVariant loginPassword;
+        emit goOffline(mSettingsManager.mailboxId());
+        mEmitOnline = true;
+        switch (index) {
+            case IpsServices::EMailAuthNone: // No authentication
+                deleteServerInfoGroupDynamicItems();
+                mSettingsManager.writeSetting(IpsServices::SMTPAuthentication, false);
+                break;
+
+            case IpsServices::EMailAuthSameAsIncoming: // Same as Incoming
+                deleteServerInfoGroupDynamicItems();
+                mSettingsManager.writeSetting(IpsServices::SMTPAuthentication, true);
+              
+                mSettingsManager.readSetting(IpsServices::IncomingLoginName, loginName);
+                mSettingsManager.writeSetting(IpsServices::OutgoingLoginName, loginName);
+                
+                mSettingsManager.readSetting(IpsServices::IncomingPassword, loginPassword);
+                mSettingsManager.writeSetting(IpsServices::OutgoingPassword, loginPassword);
+                break;
+
+            case IpsServices::EMailAuthUserAuthentication: // User authentication
+                mSettingsManager.writeSetting(IpsServices::SMTPAuthentication, true);
+                createServerInfoGroupDynamicItems();
+                break;
+                
+             default:
+                break;
+        }
+    }
+}
+
+/*!
+    Sets the previous index value to indicate that user has edited the field
+
+    \param text Reference to the item in the radio button list.
+*/
+void NmIpsSettingsHelper::outgoingAuthenticationPress(const QModelIndex &index)
+{
+    Q_UNUSED(index);
+    HbDataFormModelItem *item = mContentItems.value(IpsServices::SMTPAuthentication);
+    QVariant data = item->contentWidgetData(QString("selected"));
+    mRadioButtonPreviousIndex = data.toInt();
+}
+
--- a/ipsservices/nmipssettings/src/nmipssettingslabeledcombobox.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/nmipssettings/src/nmipssettingslabeledcombobox.cpp	Fri May 14 15:41:10 2010 +0300
@@ -26,7 +26,6 @@
     \brief The class implements a custom HbDataFormViewItem that combines a HbComboBox and HbLabel
     widgets that are linked. I.e. When the user selects changes the combobox's value, the label
     text is updated accordingly.
-
 */
 
 // ======== MEMBER FUNCTIONS ========
@@ -34,7 +33,8 @@
 /*!
     Constructor of NmIpsSettingsLabeledComboBox.
 */
-NmIpsSettingsLabeledComboBox::NmIpsSettingsLabeledComboBox(QGraphicsItem *parent, Qt::WindowFlags wFlags)
+NmIpsSettingsLabeledComboBox::NmIpsSettingsLabeledComboBox(
+    QGraphicsItem *parent, Qt::WindowFlags wFlags)
 : HbWidget(parent, wFlags)
 {
     // Create widget layout.
@@ -54,8 +54,9 @@
     layout->addItem(mLabel); // Takes ownership
 
     // Connect signals and slots.
-    connect(mComboBox, SIGNAL(currentIndexChanged(int)), 
+    connect(mComboBox, SIGNAL(currentIndexChanged(int)),
         this, SLOT(comboBoxIndexChanged(int)), Qt::UniqueConnection);
+
     connect(mComboBox, SIGNAL(currentIndexChanged(int)),
         this, SIGNAL(currentIndexChanged(int)), Qt::UniqueConnection);
 }
@@ -102,6 +103,7 @@
 {
     mComboBox->setItems(comboItems);
 }
+
 /*!
     Returns the current label texts.
     \return Label texts.
--- a/ipsservices/nmipssettings/src/nmipssettingsmanagerbase.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/nmipssettings/src/nmipssettingsmanagerbase.cpp	Fri May 14 15:41:10 2010 +0300
@@ -193,7 +193,7 @@
             }
             break;
         case IpsServices::SMTPAuthentication:            
-            mSmtpSettings->SetSMTPAuth((settingValue.toBool()));
+            mSmtpSettings->SetSMTPAuth(settingValue.toBool());
             ret = saveSettings();
             break;
         case IpsServices::OutgoingSecureSockets:
@@ -274,6 +274,6 @@
 */
 NmIpsExtendedSettingsManager &NmIpsSettingsManagerBase::extendedSettingsManager() const
 {
-return *mExtendedSettingsManager;
+    return *mExtendedSettingsManager;
 }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ipsservices/nmipssettings/src/nmipssettingsmultiselectionitem.cpp	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,225 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <QGraphicsLinearLayout>
+#include <QScopedPointer>
+#include <HbPushButton>
+#include <HbSelectionDialog>
+#include <HbLabel>
+#include <HbExtendedLocale>
+
+#include "nmipssettingsmultiselectionitem.h"
+
+/*!
+    \class NmIpsSettingsMultiSelectionItem
+    \brief The class implements a custom HbDataFormViewItem for showing multi selection dialog.
+
+*/
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+    Constructor of NmIpsSettingsMultiSelectionItem.
+*/
+
+
+NmIpsSettingsMultiSelectionItem::NmIpsSettingsMultiSelectionItem(
+    QGraphicsItem *parent, Qt::WindowFlags wFlags)
+ : HbWidget(parent, wFlags),
+   mButton(0),
+   mSelectionDialog(0)
+{
+    // Create widget layout.
+    QScopedPointer<QGraphicsLinearLayout> layout(new QGraphicsLinearLayout(Qt::Vertical, this));
+    this->setLayout(layout.data());
+
+    // Create button.
+    mButton = new HbPushButton();
+    layout->addItem(mButton);
+
+    connect(mButton, SIGNAL(clicked()), this, SLOT(launchSelectionDialog()));
+    (void)layout.take();
+}
+
+/*!
+    Destructor of NmIpsSettingsMultiSelectionItem.
+*/
+NmIpsSettingsMultiSelectionItem::~NmIpsSettingsMultiSelectionItem()
+{
+    delete mSelectionDialog;
+}
+
+/*!
+    Returns shown text.
+
+    \return Shown text.
+*/
+QString NmIpsSettingsMultiSelectionItem::text() const
+{
+    return mButton->text();
+}
+
+/*!
+    Sets shown text.
+
+    \param text Shown text.
+*/
+void NmIpsSettingsMultiSelectionItem::setText(QString text)
+{
+    mButton->setText(text);
+}
+
+/*!
+    Returns items which are shown in dialog.
+
+    \return items which are shown in dialog.
+*/
+QStringList NmIpsSettingsMultiSelectionItem::stringItems() const
+{
+    return mItems;
+}
+
+/*!
+    Sets items which are shown in dialog.
+
+    \param items Items which are shown in dialog.
+*/
+void NmIpsSettingsMultiSelectionItem::setStringItems(QStringList items)
+{
+    mItems = items;
+    generateButtonText();
+}
+
+/*!
+    Returns selected items.
+
+    \return selected items.
+*/
+QList<QVariant> NmIpsSettingsMultiSelectionItem::selectedItems()const
+{
+    return mSelectedItems;
+}
+
+/*!
+    Sets selected items.
+
+    \param selectedItems Indexes of items which will be seleceted when dialog is shown.
+*/
+void NmIpsSettingsMultiSelectionItem::setSelectedItems(QList<QVariant> selectedItems)
+{
+    // Store selected items and generate button text.
+    mSelectedItems = selectedItems;
+    generateButtonText();
+}
+
+/*!
+    Returns heading text.
+
+    \return heading text.
+*/
+QString NmIpsSettingsMultiSelectionItem::heading() const
+{
+    return mHeading;
+}
+
+/*!
+    Sets heading text.
+
+    \param heading Shown heading text in dialog.
+*/
+void NmIpsSettingsMultiSelectionItem::setHeading(QString heading)
+{
+    mHeading = heading;
+}
+
+/*!
+    Launches the Selection dialog.
+*/
+void NmIpsSettingsMultiSelectionItem::launchSelectionDialog()
+{
+    if (mSelectionDialog) {
+        delete mSelectionDialog;
+        mSelectionDialog = 0;
+    }
+
+    // Create the dialog.
+    mSelectionDialog = new HbSelectionDialog();
+    mSelectionDialog->setSelectionMode(HbAbstractItemView::MultiSelection);
+    mSelectionDialog->setStringItems(mItems, mItems.count() + 1);
+    mSelectionDialog->setSelectedItems(mSelectedItems);
+
+    // Set the heading for the dialog.
+    HbLabel *headingLabel = new HbLabel(mHeading, mSelectionDialog);
+    mSelectionDialog->setHeadingWidget(headingLabel);
+    mSelectionDialog->open(this, SLOT(selectionDialogClosed(HbAction *)));
+}
+
+/*!
+    Handles the action from selection dialog.
+
+    \param action Dialog closing action.
+*/
+void NmIpsSettingsMultiSelectionItem::selectionDialogClosed(HbAction *action)
+{
+    if (action == mSelectionDialog->primaryAction()) {
+        // Get selected items.
+        mSelectedItems = mSelectionDialog->selectedItems();
+
+        // Generate button text from selected items.
+        generateButtonText();
+
+        QMap<QString, QVariant> properties;
+        properties.insert("selectedItems", mSelectedItems);
+
+        emit propertyChanged(properties);
+
+        // Emit the signal.
+        emit editingFinished();
+    }
+}
+
+/*!
+    Generates shown text from selected items.
+*/
+void NmIpsSettingsMultiSelectionItem::generateButtonText()
+{
+    // Generate button text only if both properties are valid.
+    const int itemCount(mItems.count());
+    if (mItems.count() >= mSelectedItems.count()) {
+        // Construct separator for button text.
+        QChar groupSeparator = HbExtendedLocale::system().groupSeparator();
+        QString separator(" ");
+        separator.insert(0, groupSeparator);
+
+        QString buttonText;
+        QListIterator<QVariant> itemIterator(mSelectedItems);
+        while (itemIterator.hasNext()) {
+            QVariant item(itemIterator.next());
+            bool conversionOk(false);
+            const int selectedIndex(item.toInt(&conversionOk));
+            if (conversionOk && (selectedIndex >= 0) && (selectedIndex < itemCount)) {
+                // Generate button text.
+                buttonText.append(mItems.at(selectedIndex));
+                // Add separator if not last item.
+                if (itemIterator.hasNext()) {
+                    buttonText.append(separator);
+                }
+            }
+        }
+        mButton->setText(buttonText);
+    }
+}
--- a/ipsservices/nmipssettings/src/nmipssettingsplugin.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/nmipssettings/src/nmipssettingsplugin.cpp	Fri May 14 15:41:10 2010 +0300
@@ -33,6 +33,7 @@
 #include "nmipssettingsmanagerfactory.h"
 #include "nmipssettingitems.h"
 #include "nmcommon.h"
+#include "ipssettingkeys.h"
 
 #include "nmipssettingscustomitem.h"
 #include "nmipssettingslabeledcombobox.h"
@@ -55,26 +56,25 @@
 */
 NmIpsSettingsPlugin::NmIpsSettingsPlugin()
 : mSettingsHelper(0),
-  mSettingsManager(0),
-  mTranslator(0)
+  mSettingsManager(0)
 {
-    QScopedPointer<QTranslator> translator(new QTranslator());
-
-#ifdef Q_OS_SYMBIAN
     QString lang = QLocale::system().name();
-    QString appName = "mailips_";
     QString path = "Z:/resource/qt/translations/";
-#else
-    QString lang;
-    QString appName = "mailips";
-    QString path = ":/translations";
-#endif
+    QString appName = "mailips_";
+    QString commonName = "common_";
+    
 
+    // Load common strings
+	QScopedPointer<QTranslator> commonTranslator(new QTranslator(this));
+    commonTranslator->load(commonName + lang, path);
+    QCoreApplication::installTranslator(commonTranslator.data());
+    (void)commonTranslator.take();  
+    
+    // Load IPS settings specific strings
+	QScopedPointer<QTranslator> translator(new QTranslator(this));
     translator->load(appName + lang, path);
-
     QCoreApplication::installTranslator(translator.data());
-    mTranslator = translator.take();
-
+    (void)translator.take();
 }
 
 /*!
@@ -84,7 +84,6 @@
 {
     delete mSettingsManager;
     delete mSettingsHelper;
-    delete mTranslator;
 }
 
 /*!
@@ -143,15 +142,15 @@
 */
 void NmIpsSettingsPlugin::aboutToClose()
 {
-	if (mSettingsHelper->isOffline()) {
+    QVariant profileIndex;
+	mSettingsManager->readSetting(IpsServices::ReceptionActiveProfile, profileIndex);
+	if ((mSettingsHelper->isOffline()) && (profileIndex.toInt() != IpsServices::EmailSyncProfileManualFetch)) {
 		emit goOnline(mSettingsManager->mailboxId());
 	}
 }
 
 /*!
-    Appends the group items to the group item.
-    \param model Reference to the model.
-    \param form Reference to the form.
+    Appends the group items to the model.
 */
 void NmIpsSettingsPlugin::initGroupItems()
 {
@@ -180,6 +179,7 @@
         mModel->appendDataFormItem(HbDataFormModelItem::GroupItem,
                                    hbTrId("txt_mailips_subhead_server_info"),
                                    rootItem);
+    mSettingsHelper->setServerInfoGroupItem(serverInfoItem);
     initServerInfoItems(*serverInfoItem);
 
     // Create the delete mailbox button.
@@ -203,7 +203,7 @@
 */
 void NmIpsSettingsPlugin::initPreferenceItems(HbDataFormModelItem &item) const
 {
-    // My Name
+    // 1. My Name
     QVariant myName;
     mSettingsManager->readSetting(IpsServices::EmailAlias, myName);
     CpSettingFormItemData *myNameItem = new CpSettingFormItemData(
@@ -216,7 +216,7 @@
                          mSettingsHelper, SLOT(myNameTextChange(QString)));
     item.appendChild(myNameItem);
 
-    // Mailbox Name
+    // 2. Mailbox Name
     QVariant mailboxName;
     mSettingsManager->readSetting(IpsServices::MailboxName, mailboxName);
     CpSettingFormItemData *mailboxNameItem = new CpSettingFormItemData(
@@ -333,7 +333,7 @@
 */
 void NmIpsSettingsPlugin::initUserInfoItems(HbDataFormModelItem &item) const
 {
-    // Mail address
+    // 1. Mail address
     QVariant mailAddress;
     mSettingsManager->readSetting(IpsServices::EmailAddress, mailAddress);
     CpSettingFormItemData *mailAddressItem = new CpSettingFormItemData(
@@ -346,7 +346,7 @@
                          mSettingsHelper, SLOT(mailAddressTextChange(QString)));
     item.appendChild(mailAddressItem);
 
-    // Username (Never visible in Yahoo!)
+    // 2. Username
     QVariant username;
     mSettingsManager->readSetting(IpsServices::IncomingLoginName, username);
     CpSettingFormItemData *usernameItem = new CpSettingFormItemData(
@@ -354,12 +354,12 @@
     mSettingsHelper->insertContentItem(IpsServices::IncomingLoginName, usernameItem);
     usernameItem->setContentWidgetData(QString("text"), username);
     mForm->addConnection(usernameItem, SIGNAL(editingFinished()),
-                         mSettingsHelper, SLOT(saveUserName()));
+                         mSettingsHelper, SLOT(saveIncomingUserName()));
     mForm->addConnection(usernameItem, SIGNAL(textChanged(QString)),
-                         mSettingsHelper, SLOT(userNameTextChange(QString)));
+                         mSettingsHelper, SLOT(incomingUserNameTextChange(QString)));
     item.appendChild(usernameItem);
 
-    // Password
+    // 3. Password
     QVariant password;
     mSettingsManager->readSetting(IpsServices::IncomingPassword, password);
     CpSettingFormItemData *passwordItem = new CpSettingFormItemData(
@@ -368,7 +368,7 @@
     passwordItem->setContentWidgetData(QString("text"), password);
     passwordItem->setContentWidgetData(QString("echoMode"), HbLineEdit::PasswordEchoOnEdit);
     mForm->addConnection(passwordItem, SIGNAL(editingFinished()),
-                         mSettingsHelper, SLOT(savePassword()));
+                         mSettingsHelper, SLOT(saveIncomingPassword()));
     item.appendChild(passwordItem);
 
     // Reply to address
@@ -426,7 +426,7 @@
     mForm->addConnection(incomingSecureConnectionItem, SIGNAL(itemSelected(int)),    		  
     		mSettingsHelper, SLOT(incomingSecureConnectionItemChange(int)));
     mForm->addConnection(incomingSecureConnectionItem, SIGNAL(pressed(const QModelIndex &)),    		  
-    		mSettingsHelper, SLOT(incomingSecureConnectionPressed(const QModelIndex &)));
+    		mSettingsHelper, SLOT(incomingSecureConnectionPress(const QModelIndex &)));
     item.appendChild(incomingSecureConnectionItem);
     
     // 3. Incoming mail server port
@@ -439,7 +439,7 @@
     mForm->addConnection(incomingPortItem, SIGNAL(itemSelected(int)),
                          mSettingsHelper, SLOT(incomingPortChange(int)));
     mForm->addConnection(incomingPortItem, SIGNAL(pressed(const QModelIndex &)),              
-                         mSettingsHelper, SLOT(incomingPortPressed(const QModelIndex &)));
+                         mSettingsHelper, SLOT(incomingPortPress(const QModelIndex &)));
     QStringList incomingPortItems;
     incomingPortItems << hbTrId("txt_mailips_setlabel_incoming_port_default")
                       << hbTrId("txt_mailips_setlabel_incoming_port_user_defined");
@@ -462,7 +462,7 @@
                          mSettingsHelper, SLOT(outgoingMailServerTextChange(QString)));
     item.appendChild(outgoingMailServerItem);
     
-    // 5. Outgoing Secure connection
+    // 5. Outgoing secure connection
     QVariant outgoingSecureSockets;
     QVariant outgoingSSLWrapper;
     mSettingsManager->readSetting(IpsServices::OutgoingSecureSockets, outgoingSecureSockets);
@@ -485,7 +485,7 @@
     mForm->addConnection(outgoingSecureConnectionItem, SIGNAL(itemSelected(int)),    		  
     		mSettingsHelper, SLOT(outgoingSecureConnectionItemChange(int)));
     mForm->addConnection(outgoingSecureConnectionItem, SIGNAL(pressed(const QModelIndex &)),    		  
-    		mSettingsHelper, SLOT(outgoingSecureConnectionPressed(const QModelIndex &)));
+    		mSettingsHelper, SLOT(outgoingSecureConnectionPress(const QModelIndex &)));
     item.appendChild(outgoingSecureConnectionItem);
 
     // 6. Outgoing mail server port
@@ -498,7 +498,7 @@
     mForm->addConnection(outgoingPortItem, SIGNAL(itemSelected(int)),
                          mSettingsHelper, SLOT(outgoingPortChange(int)));
     mForm->addConnection(outgoingPortItem, SIGNAL(pressed(const QModelIndex &)),              
-                         mSettingsHelper, SLOT(outgoingPortPressed(const QModelIndex &)));
+                         mSettingsHelper, SLOT(outgoingPortPress(const QModelIndex &)));
     QStringList outgoingPortItems;
     outgoingPortItems << hbTrId("txt_mailips_setlabel_incoming_port_default")
                       << hbTrId("txt_mailips_setlabel_incoming_port_user_defined");
@@ -508,6 +508,28 @@
     outgoingPortItem->setContentWidgetData(QString("selected"), outgoingPortItemIndex);
     item.appendChild(outgoingPortItem);
     
+    // 7. Outgoing authentication.
+    CpSettingFormItemData *outgoingAuthenticationItem =
+        new CpSettingFormItemData(HbDataFormModelItem::RadioButtonListItem, hbTrId(
+            "txt_mailips_setlabel_outgoing_mail_authentication"));
+    mSettingsHelper->insertContentItem(IpsServices::SMTPAuthentication, outgoingAuthenticationItem);
+    mForm->addConnection(outgoingAuthenticationItem, SIGNAL(itemSelected(int)),
+                         mSettingsHelper, SLOT(outgoingAuthenticationChange(int)));
+    mForm->addConnection(outgoingAuthenticationItem, SIGNAL(pressed(const QModelIndex &)),              
+                         mSettingsHelper, SLOT(outgoingAuthenticationPress(const QModelIndex &)));
+    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);
+    int outgoingAuthenticationIndex = 
+        mSettingsHelper->getCorrectOutgoingAuthenticationRadioButtonIndex(); 
+    outgoingAuthenticationItem->setContentWidgetData(QString("selected"), outgoingAuthenticationIndex);
+    item.appendChild(outgoingAuthenticationItem);
+    if (outgoingAuthenticationIndex == IpsServices::EMailAuthUserAuthentication) {
+        mSettingsHelper->createServerInfoGroupDynamicItems();
+    }
+    
     // 8. Folder path
     // This item is only shown for IMAP4 account.
     if (mSettingsManager->accountType() == IpsServices::EMailImap) {
@@ -518,9 +540,9 @@
                 "txt_mailips_setlabel_folder_path"));
         mSettingsHelper->insertContentItem(IpsServices::FolderPath, folderPathItem);    
         mForm->addConnection(folderPathItem, SIGNAL(itemSelected(int)),
-                             mSettingsHelper, SLOT(inboxPathChange(int)));
+                             mSettingsHelper, SLOT(folderPathChange(int)));
         mForm->addConnection(folderPathItem, SIGNAL(pressed(const QModelIndex &)),              
-                             mSettingsHelper, SLOT(inboxPathPressed(const QModelIndex &)));
+                             mSettingsHelper, SLOT(folderPathPress(const QModelIndex &)));
         QStringList folderPathItems;
         folderPathItems << hbTrId("txt_mailips_setlabel_folder_path_val_default")
                        << hbTrId("txt_mailips_setlabel_folder_path_user_defined");
@@ -539,9 +561,9 @@
     QVariant userDefineMode;
     mSettingsManager->readSetting(IpsServices::ReceptionUserDefinedProfile, userDefineMode);
 
-    // If user defined mode do not already exist, create it
+    // If user defined mode do not already exist, create it.
     if (!userDefineMode.toInt()) {
-        // Add 'user defined' mode to combobox
+        // Add 'user defined' mode to combobox.
         HbDataFormModelItem *syncProfile =
             mSettingsHelper->contentItem(IpsServices::ReceptionActiveProfile);
 
@@ -549,30 +571,33 @@
         QStringList modeList = contentWidgetData.value<QStringList>();
         modeList << hbTrId("txt_mailips_setlabel_selected_mode_val_user_define");
 
-        // Add 'user defined' explanation text to label text
+        // Add 'user defined' explanation text to label text.
         contentWidgetData = syncProfile->contentWidgetData(NmIpsSettingsLabelTexts);
         QStringList infoList = contentWidgetData.value<QStringList>();
         infoList << hbTrId("txt_mailips_list_the_mailbox_is_refreshed_as_defin");
 
-        // disconnect
+        // Disconnect signal temporarily so that by setting content widget data will
+        // not cause any unnecessary actions in helper.
         mForm->removeConnection(syncProfile, SIGNAL(currentIndexChanged(int)),
             mSettingsHelper, SLOT(receivingScheduleChange(int)));
 
         syncProfile->setContentWidgetData(NmIpsSettingsComboItems, modeList);
         syncProfile->setContentWidgetData(NmIpsSettingsLabelTexts, infoList);
 
-        // reconnect
+        // Reconnect signal, so that helper is aware of data modifications.
         mForm->addConnection(syncProfile, SIGNAL(currentIndexChanged(int)),
             mSettingsHelper, SLOT(receivingScheduleChange(int)));
 
-        // Mark that user defined mode exists
+        // Mark that user defined mode exists.
         userDefineMode.setValue(1);
         mSettingsManager->writeSetting(IpsServices::ReceptionUserDefinedProfile, userDefineMode);
     }
 }
 
 /*!
+    Handles mail in inbox modifications.
 
+    \param index Selected value index.
 */
 void NmIpsSettingsPlugin::showMailInInboxModified(int index)
 {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ipsservices/nmipssettings/src/nmipssettingstimeeditor.cpp	Fri May 14 15:41:10 2010 +0300
@@ -0,0 +1,176 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <QGraphicsLinearLayout>
+#include <HbPushButton>
+#include <HbDialog>
+#include <HbLabel>
+#include <HbDateTimePicker>
+#include <HbAction>
+#include <HbExtendedLocale>
+
+#include "nmipssettingstimeeditor.h"
+
+/*!
+    \class NmIpsSettingsTimeEditor
+    \brief The class implements a custom HbDataFormViewItem for selecting time with a tumbler.
+
+*/
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+    Constructor of NmIpsSettingsTimeEditor.
+*/
+NmIpsSettingsTimeEditor::NmIpsSettingsTimeEditor(QGraphicsItem *parent, Qt::WindowFlags wFlags)
+    : HbWidget(parent, wFlags),
+      mButton(0),
+      mTimePickerDialog(0)
+{
+    // Create widget layout.
+    QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical);
+    this->setLayout(layout); // Takes ownership
+
+    // Create label.
+    mButton = new HbPushButton();
+    layout->addItem(mButton); // Takes ownership
+
+    connect( mButton, SIGNAL(clicked()),
+             this, SLOT(launchTimePicker()));
+}
+
+/*!
+    Destructor of NmIpsSettingsTimeEditor.
+*/
+NmIpsSettingsTimeEditor::~NmIpsSettingsTimeEditor()
+{
+    delete mTimePickerDialog;
+}
+
+/*!
+    Returns the currently set time.
+    \return The time.
+ */
+QTime NmIpsSettingsTimeEditor::time() const
+{
+    return mTime;
+}
+
+/*!
+    Sets the current time.
+    \param time The time to set.
+ */
+void NmIpsSettingsTimeEditor::setTime(QTime time)
+{
+    mTime = time;
+    mButton->setText(mTime.toString(timeFormat()));
+}
+
+/*!
+    Returns the selection dialog heading label.
+    \return The heading label.
+ */
+QString NmIpsSettingsTimeEditor::heading() const
+    {
+    return mLabel;
+    }
+
+/*!
+    Sets the time selection dialog heading label.
+    \param label The label to set.
+ */
+void NmIpsSettingsTimeEditor::setHeading(QString label)
+{
+    mLabel = label;
+}
+
+
+/*!
+    Launches the time picker dialog.
+ */
+void NmIpsSettingsTimeEditor::launchTimePicker()
+{
+    if (mTimePickerDialog) {
+        delete mTimePickerDialog;
+        mTimePickerDialog = 0;
+    }
+
+    // Create the dialog.
+    mTimePickerDialog = new HbDialog();
+    mTimePickerDialog->setTimeout(HbDialog::NoTimeout);
+    mTimePickerDialog->setDismissPolicy(HbDialog::NoDismiss);
+
+    // Set the heading for the dialog.
+    HbLabel *timeLabel = new HbLabel(mLabel, mTimePickerDialog);
+    mTimePickerDialog->setHeadingWidget(timeLabel);
+
+    // Create the tumbler.
+    HbDateTimePicker *timePicker = new HbDateTimePicker(mTimePickerDialog);
+
+    // Set the tumbler as the content widget.
+    mTimePickerDialog->setContentWidget(timePicker);
+
+    // Set tumbler data.
+    timePicker->setDisplayFormat(timeFormat());
+    timePicker->setTime(mTime);
+
+    // Set dialog actions.
+    HbAction *okAction = new HbAction(QString(hbTrId("txt_common_button_ok")), mTimePickerDialog);
+    mTimePickerDialog->setPrimaryAction(okAction);
+
+    HbAction *cancelAction = new HbAction(QString(hbTrId("txt_common_button_cancel")),
+        mTimePickerDialog);
+    mTimePickerDialog->setSecondaryAction( cancelAction );
+
+    // Show the dialog.
+    mTimePickerDialog->open(this, SLOT(handleTimeAction(HbAction *)));
+}
+
+/*!
+    Handles the action from the time picker dialog.
+ */
+void NmIpsSettingsTimeEditor::handleTimeAction(HbAction *action)
+{
+    if (action == mTimePickerDialog->primaryAction()) {
+        // Get the time from the picker.
+        QTime newTime = static_cast<HbDateTimePicker *> (mTimePickerDialog->contentWidget())->time();
+
+        // Store the new time.
+        setTime(newTime);
+
+        // Emit the signal.
+        emit timeChanged(newTime);
+    }
+}
+
+/*!
+    Returns locale specific formatting string for hours and minutes.
+    \return Time format string.
+*/
+QString NmIpsSettingsTimeEditor::timeFormat()
+{
+    // Set the correct time format string based on locale.
+    HbExtendedLocale locale = HbExtendedLocale::system();
+    QString timeFormat("h:mm ap");
+    if (HbExtendedLocale::Time24 == locale.timeStyle()) {
+        timeFormat = QString("h:mm");
+    }
+    // Set the separator between hours and minutes.
+    timeFormat.replace(QString(":"), locale.timeSeparator(1));
+
+    return timeFormat;
+}
Binary file ipsservices/nmipssettings/translations/mailips.qm has changed
--- a/ipsservices/nmipssettings/translations/mailips.ts	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/nmipssettings/translations/mailips.ts	Fri May 14 15:41:10 2010 +0300
@@ -13,12 +13,12 @@
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mailips_setlabel_outgoing_mail_authentication">
-    <comment>Value for txt_mailips_setlabel_outgoing_mail_authentication. User defines the authentication</comment>        
-    <source>User authentication</source>
+    <comment>Setting label under Server info txt_mailips_subhead_server_info for defining the type of authentication for outgoing mail. Setting item in server info: what is used for outgoing mail authetication</comment>        
+    <source>Outgoing mail authentication</source>
     <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
+    <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
     <extra-loc-viewid>mail_06_d</extra-loc-viewid>
-    <extra-loc-positionid>setlabel_10_val</extra-loc-positionid>
+    <extra-loc-positionid>setlabel_10</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
@@ -33,7 +33,7 @@
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_long_caption_mailips">
-    <comment></comment>        
+    <comment>Name of the mail application.</comment>        
     <source>Mail</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_pri_large_graphic</extra-loc-layout_id>    
@@ -42,6 +42,16 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mailips_setlabel_folder_path_val_default">
+    <comment>Value for txt_mailips_setlabel_folder_path. Default folder path will be used.</comment>        
+    <source>Default</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
+    <extra-loc-positionid>setlabel_9_val</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mailips_setlabel_incoming_port">
     <comment>Setting label under Server info txt_mailips_subhead_server_info for defining the incoming port for mail connection.</comment>        
     <source>Incoming port</source>
@@ -92,16 +102,6 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mailips_setlabel_inbox_path_user_defined">
-    <comment>Value for txt_mailips_setlabel_inbox_path. Value for inbox path and port</comment>        
-    <source>User defined</source>
-    <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
-    <extra-loc-positionid>setlabel_9_val</extra-loc-positionid>
-    <extra-loc-feature>mail</extra-loc-feature>
-    <extra-loc-blank>False</extra-loc-blank>
-</message>
 <message numerus="no" id="txt_mailips_setlabel_day_end_time">
     <comment>Setting label under Receiving schedule &gt; Selected mode &gt; Save energy  (txt_mailips_setlabel_selected_mode_val_save_energy). Label for selecting the end time of of the day</comment>        
     <source>Day end time</source>
@@ -212,6 +212,26 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mailips_setlabel_folder_path_user_defined">
+    <comment>Value for txt_mailips_setlabel_folder_path. User is able to define the folder path.</comment>        
+    <source>User defined</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
+    <extra-loc-positionid>setlabel_9_val</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_mailips_setlabel_folder_path">
+    <comment>Setting label under Server info txt_mailips_subhead_server_info for defining the folder path. Setting item in server info</comment>        
+    <source>Folder path</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
+    <extra-loc-positionid>setlabel_9</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mailips_setlabel_security_val_off">
     <comment>Value for txt_mailips_setlabel_secure_connection. Secure connection off</comment>        
     <source>Off</source>
@@ -244,7 +264,7 @@
 </message>
 <message numerus="no" id="txt_mailips_setlabel_receiving_weekdays">
     <comment>Setting label under Receiving schedule &gt; Selected mode &gt; Save energy  (txt_mailips_setlabel_selected_mode_val_save_energy). Label for selecting the busy days when the mail is received frequently</comment>        
-    <source>Receiving weekdays</source>
+    <source>Receiving days</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
     <extra-loc-viewid>mail_06_b</extra-loc-viewid>
@@ -302,13 +322,13 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mailips_setlabel_inbox_path">
-    <comment>Setting label under Server info txt_mailips_subhead_server_info for defining the Inbox path. Setting item in server info</comment>        
-    <source>Inbox path</source>
+<message numerus="no" id="txt_mailips_setlabel_outgoing_authentication_same">
+    <comment>Value for txt_mailips_setlabel_outgoing_mail_authentication. Same authentication as for incoming mail</comment>        
+    <source>Same as for incoming</source>
     <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
+    <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
     <extra-loc-viewid>mail_06_d</extra-loc-viewid>
-    <extra-loc-positionid>setlabel_9</extra-loc-positionid>
+    <extra-loc-positionid>setlabel_10_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
@@ -352,16 +372,6 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mailips_setlabel_inbox_path_val_default">
-    <comment>Value for txt_mailips_setlabel_inbox_path. Value for inbox path and port</comment>        
-    <source>Default</source>
-    <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
-    <extra-loc-positionid>setlabel_9_val</extra-loc-positionid>
-    <extra-loc-feature>mail</extra-loc-feature>
-    <extra-loc-blank>False</extra-loc-blank>
-</message>
 <message numerus="no" id="txt_mailips_setlabel_val_when_i_open_mailbox">
     <comment>Value for txt_mailips_setlabel_refresh_mail. The mailbox is refreshed only and always when the user opens the mailbox</comment>        
     <source>When I open mailbox</source>
@@ -452,6 +462,16 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mailips_setlabel_outgoing_authentication_user">
+    <comment>Value for txt_mailips_setlabel_outgoing_mail_authentication. User defines the authentication</comment>        
+    <source>User authentication</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
+    <extra-loc-positionid>setlabel_10_val</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mailips_setlabel_security_val_on_ssltls">
     <comment>Value for txt_mailips_setlabel_secure_connection. Secure connection on with SLL/TLS (name of the secure connection protocol )</comment>        
     <source>On (SLL/TLS)</source>
@@ -592,5 +612,15 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mailips_setlabel_outgoing_authentication_none">
+    <comment>Value for txt_mailips_setlabel_outgoing_mail_authentication. No authetication</comment>        
+    <source>None</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
+    <extra-loc-positionid>setlabel_10_val</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 </context>
 </TS>
--- a/ipsservices/nmpopclientplugin/inc/nmpopclientplugin.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/nmpopclientplugin/inc/nmpopclientplugin.h	Fri May 14 15:41:10 2010 +0300
@@ -20,6 +20,11 @@
 
 #include "nmbaseclientplugin.h"
 #include "nmuiextensioninterface.h"
+#include "nmuienginedef.h"
+#include "nmactionrequest.h"
+
+class NmUiEngine;
+class NmSettingsViewLauncher;
 
 /*!
  \class NmPopClientPlugin
@@ -36,9 +41,19 @@
     void getActions( const NmActionRequest &request,
         QList<NmAction*> &actionList);
 
+private slots:
+    void settings();
+    void switchToStandardFolderInbox();
+    void switchToStandardFolderOutbox();
+    void switchToStandardFolderDrafts();
+    void switchToStandardFolderSent();
+
 protected:
     virtual quint32 pluginId();
 
+private:
+    NmActionRequest mListOptionsMenuRequest;
+    NmSettingsViewLauncher *mSettingsViewLauncher; // owned
 };
 
 #endif /* NMTESTPLUGINEXTENSION_H_ */
--- a/ipsservices/nmpopclientplugin/inc/nmpopclientpluginheaders.h	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/nmpopclientplugin/inc/nmpopclientpluginheaders.h	Fri May 14 15:41:10 2010 +0300
@@ -25,6 +25,9 @@
 // ipsservices
 #include "ipsplgsosbaseplugin.hrh"
 
+// Orbit
+#include <hbmenu.h>
+
 // nmailuiengine
 #include <nmuiengine.h>
 #include "nmbaseclientplugin.h"
@@ -39,10 +42,12 @@
 #include "nmactionresponse.h"
 #include "nmmessageenvelope.h"
 #include "nmuiextensioninterface.h"
+#include "nmmailboxmetadata.h"
 
 // client plugins
 #include "nmpopclientplugin.h"
 
-
+// settings
+#include "nmsettingsviewlauncher.h"
 
 #endif /* NMIMAPCLIENTPLUGINHEADERS_H_ */
--- a/ipsservices/nmpopclientplugin/nmpopclientplugin.pro	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/nmpopclientplugin/nmpopclientplugin.pro	Fri May 14 15:41:10 2010 +0300
@@ -20,8 +20,7 @@
 
 INCLUDEPATH += inc \
     ../inc \
-    ../../inc \
-    ../../emailuis/nmsettingui/inc    
+    ../../inc 
 
 HEADERS += inc/nmpopclientplugin.h \
     inc/nmpopclientpluginheaders.h
@@ -37,10 +36,21 @@
         -TCB
     TARGET.UID2 = 0x1000008D
     TARGET.UID3 = 0x2002B3D2
-    pluginstub.sources = nmpopclientplugin.dll
-    pluginstub.path = /resource/plugins
+
+    PLUGIN_STUB_PATH = /resource/qt/plugins/nmail/uiext
+    
+    deploy.path = C:
+    pluginstub.sources = $${TARGET}.dll
+    pluginstub.path = $$PLUGIN_STUB_PATH
+    DEPLOYMENT += pluginstub
+
+    qtplugins.path = $$PLUGIN_STUB_PATH
+    qtplugins.sources += qmakepluginstubs/$${TARGET}.qtplugin
+    for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)" 
+ 
     DEPLOYMENT += pluginstub
     LIBS += -lnmailbase \
+            -lnmsettingui \
             -lnmailuiengine
 }
 
@@ -52,6 +62,11 @@
     DEPLOYMENT += pluginstub
     LIBS += -L../../bin \
                 -lnmailbase \
+                -lnmsettingui \
                 -lnmailuiengine 
 }
 
+plugin.sources = $${TARGET}.dll
+plugin.path = $$PLUGIN_STUB_PATH
+DEPLOYMENT += plugin
+
--- a/ipsservices/nmpopclientplugin/src/nmpopclientplugin.cpp	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/nmpopclientplugin/src/nmpopclientplugin.cpp	Fri May 14 15:41:10 2010 +0300
@@ -33,6 +33,8 @@
     Constructs a new NmPopClientPlugin.
  */
 NmPopClientPlugin::NmPopClientPlugin()
+: mSettingsViewLauncher(NULL),
+mListOptionsMenuRequest(NULL)
 {
     NMLOG("NmPopClientPlugin::NmPopClientPlugin()-->");
     NMLOG("<--NmPopClientPlugin::NmPopClientPlugin()");
@@ -44,6 +46,7 @@
 NmPopClientPlugin::~NmPopClientPlugin()
 {
     NMLOG("NmPopClientPlugin::~NmPopClientPlugin()-->");
+    delete mSettingsViewLauncher;
     NMLOG("<--NmPopClientPlugin::~NmPopClientPlugin()");
 }
 
@@ -71,13 +74,181 @@
         NMLOG(QString("request.mailboxId().pluginId32()=%1").arg(request.mailboxId().pluginId32()));
         return;
     }
-	
+
     // Get the NmBaseClientPlugin implementation of the UI actions.
     NmBaseClientPlugin::getActions(request, actionList);
+
+    // Append POP plugin specific actions
+    switch (request.menuType()) {
+    case NmActionOptionsMenu:
+        {
+        if (request.contextView()==NmActionContextViewMessageList){
+            mListOptionsMenuRequest = request;
+            // Create sub-menu for standard folders selection
+            HbMenu *standardFolders = new HbMenu();
+            NmAction *inboxAction = new NmAction(0);
+            inboxAction->setObjectName("popclientplugin_folders_inbox");
+            inboxAction->setText(hbTrId("txt_mail_opt_folders_inbox"));
+            inboxAction->setCheckable(true);
+            connect(inboxAction, SIGNAL(triggered()), this, SLOT(switchToStandardFolderInbox()));
+            standardFolders->addAction(inboxAction);
+            NmAction *outboxAction = new NmAction(0);
+            outboxAction->setObjectName("popclientplugin_folders_outbox");
+            outboxAction->setText(hbTrId("txt_mail_opt_folders_outbox"));
+            outboxAction->setCheckable(true);
+            connect(outboxAction, SIGNAL(triggered()), this, SLOT(switchToStandardFolderOutbox()));
+            standardFolders->addAction(outboxAction);
+            NmAction *draftsAction = new NmAction(0);
+            draftsAction->setObjectName("popclientplugin_folders_drafts");
+            draftsAction->setText(hbTrId("txt_mail_opt_folders_drafts"));
+            draftsAction->setCheckable(true);
+            connect(draftsAction, SIGNAL(triggered()), this, SLOT(switchToStandardFolderDrafts()));
+            standardFolders->addAction(draftsAction);
+            NmAction *sentAction = new NmAction(0);
+            sentAction->setObjectName("popclientplugin_folders_sent");
+            sentAction->setText(hbTrId("txt_mail_opt_folders_sent"));
+            sentAction->setCheckable(true);
+            connect(sentAction, SIGNAL(triggered()), this, SLOT(switchToStandardFolderSent()));
+            standardFolders->addAction(sentAction);
+            // Set active action
+            NmFolderType curFolderType(NmFolderOther);
+            if (mUiEngine) {
+                curFolderType = mUiEngine->folderTypeById(request.mailboxId(),request.folderId());
+            }
+            switch (curFolderType){
+                case NmFolderInbox: {
+                    inboxAction->setChecked(true);
+                    break;
+                }
+                case NmFolderOutbox: {
+                    outboxAction->setChecked(true);
+                    break;
+                }
+                case NmFolderDrafts: {
+                    draftsAction->setChecked(true);
+                    break;
+                }
+                case NmFolderSent: {
+                    sentAction->setChecked(true);
+                    break;
+                }
+            }
+
+            // Add folders selection with sub-menu
+            NmAction *foldersAction = new NmAction(0);
+            foldersAction->setObjectName("baseclientplugin_folders");
+            foldersAction->setText(hbTrId("txt_mail_opt_folders"));
+            foldersAction->setMenu(standardFolders);
+            actionList.append(foldersAction);
+            }
+        }
+        break;
+    default:
+        break;
+    }
+
     NMLOG("<--NmPopClientPlugin::getActions()");
 }
 
 /*!
+    Slot connected to options menu settings NmAction.
+    Opens mailbox settings.
+ */
+void NmPopClientPlugin::settings()
+{
+    NMLOG("NmPopClientPlugin::settings()-->");
+
+    const NmId &id = mMenuRequest.mailboxId();
+    NmMailboxMetaData *mailbox = mUiEngine->mailboxById(id);
+
+    if (mailbox) {
+        if (!mSettingsViewLauncher) {
+            mSettingsViewLauncher = new NmSettingsViewLauncher();
+
+            connect(mSettingsViewLauncher,
+                SIGNAL(mailboxListChanged(const NmId &, NmSettings::MailboxEventType)),
+                this, SLOT(mailboxListChanged(const NmId &, NmSettings::MailboxEventType)));
+
+            connect(mSettingsViewLauncher,
+                SIGNAL(mailboxPropertyChanged(const NmId &, QVariant, QVariant)),
+                this, SLOT(mailboxPropertyChanged(const NmId &, QVariant, QVariant)));
+
+            connect(mSettingsViewLauncher,
+                SIGNAL(goOnline(const NmId &)),
+                this, SLOT(goOnline(const NmId &)));
+
+            connect(mSettingsViewLauncher,
+                SIGNAL(goOffline(const NmId &)),
+                this, SLOT(goOffline(const NmId &)));
+        }
+
+        mSettingsViewLauncher->launchSettingsView(id, mailbox->name());
+    }
+
+    NMLOG("<--NmPopClientPlugin::settings()");
+}
+
+/*!
+    Private slot to switch message list contents
+    to standard folder inbox
+*/
+void NmPopClientPlugin::switchToStandardFolderInbox()
+{
+    if (mListOptionsMenuRequest.observer()){
+        NmId folderId=mUiEngine->standardFolderId(mListOptionsMenuRequest.mailboxId(),NmFolderInbox);
+        NmActionResponse response(NmActionResponseCommandSwitchFolder, NmActionOptionsMenu,
+                                  NmActionContextViewNone, mListOptionsMenuRequest.mailboxId(),
+                                  folderId);
+        mListOptionsMenuRequest.observer()->handleActionCommand(response);
+    }
+}
+
+/*!
+    Private slot to switch message list contents
+    to standard folder outbox
+*/
+void NmPopClientPlugin::switchToStandardFolderOutbox()
+{
+    if (mListOptionsMenuRequest.observer()){
+        NmId folderId=mUiEngine->standardFolderId(mListOptionsMenuRequest.mailboxId(),NmFolderOutbox);
+        NmActionResponse response(NmActionResponseCommandSwitchFolder, NmActionOptionsMenu,
+                                  NmActionContextViewNone, mListOptionsMenuRequest.mailboxId(),
+                                  folderId);
+        mListOptionsMenuRequest.observer()->handleActionCommand(response);
+    }
+}
+
+/*!
+    Private slot to switch message list contents
+    to standard folder drafts
+*/
+void NmPopClientPlugin::switchToStandardFolderDrafts()
+{
+    if (mListOptionsMenuRequest.observer()){
+        NmId folderId=mUiEngine->standardFolderId(mListOptionsMenuRequest.mailboxId(),NmFolderDrafts);
+        NmActionResponse response(NmActionResponseCommandSwitchFolder, NmActionOptionsMenu,
+                                  NmActionContextViewNone, mListOptionsMenuRequest.mailboxId(),
+                                  folderId);
+        mListOptionsMenuRequest.observer()->handleActionCommand(response);
+    }
+}
+
+/*!
+    Private slot to switch message list contents
+    to standard folder sent
+*/
+void NmPopClientPlugin::switchToStandardFolderSent()
+{
+    if (mListOptionsMenuRequest.observer()){
+        NmId folderId=mUiEngine->standardFolderId(mListOptionsMenuRequest.mailboxId(),NmFolderSent);
+        NmActionResponse response(NmActionResponseCommandSwitchFolder, NmActionOptionsMenu,
+                                  NmActionContextViewNone, mListOptionsMenuRequest.mailboxId(),
+                                  folderId);
+        mListOptionsMenuRequest.observer()->handleActionCommand(response);
+    }
+}
+
+/*!
     Provide id of plugin.
     Implementation of NmUiExtensionInterface.
  */
--- a/ipsservices/rom/FreestyleIpsServices.iby	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/rom/FreestyleIpsServices.iby	Fri May 14 15:41:10 2010 +0300
@@ -23,7 +23,7 @@
 #ifdef FF_EMAIL_FRAMEWORK
 
 ECOM_PLUGIN( ipssosplugin.dll, ipssosplugin.rsc )
-ECOM_PLUGIN( IPSSosAOPlugin.dll, IPSSosAOPlugin.rsc )
+//ECOM_PLUGIN( IPSSosAOPlugin.dll, IPSSosAOPlugin.rsc )
 
 file=ABI_DIR\BUILD_DIR\nmipsmtms.dll		SHARED_LIB_DIR\nmipsmtms.dll        PAGED
 data=DATAZ_\MTM_INFO_FILE_DIR\smtp.rsc           MTM_INFO_FILE_DIR\smtp.rsc
--- a/ipsservices/rom/nmimapclientplugin.iby	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/rom/nmimapclientplugin.iby	Fri May 14 15:41:10 2010 +0300
@@ -22,7 +22,7 @@
 #ifdef FF_EMAIL_FRAMEWORK
 
 file=ABI_DIR\BUILD_DIR\nmimapclientplugin.dll		SHARED_LIB_DIR\nmimapclientplugin.dll     PAGED
-data=\epoc32\data\z\resource\plugins\nmimapclientplugin.qtplugin		resource\plugins\nmimapclientplugin.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\nmail\uiext\nmimapclientplugin.qtplugin		resource\qt\plugins\nmail\uiext\nmimapclientplugin.qtplugin
 
 #endif //FF_EMAIL_FRAMEWORK
 
--- a/ipsservices/rom/nmpopclientplugin.iby	Mon May 03 12:23:15 2010 +0300
+++ b/ipsservices/rom/nmpopclientplugin.iby	Fri May 14 15:41:10 2010 +0300
@@ -22,7 +22,7 @@
 #ifdef FF_EMAIL_FRAMEWORK
 
 file=ABI_DIR\BUILD_DIR\nmpopclientplugin.dll		SHARED_LIB_DIR\nmpopclientplugin.dll     PAGED
-data=\epoc32\data\z\resource\plugins\nmpopclientplugin.qtplugin		resource\plugins\nmpopclientplugin.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\nmail\uiext\nmpopclientplugin.qtplugin		resource\qt\plugins\nmail\uiext\nmpopclientplugin.qtplugin
 
 #endif //FF_EMAIL_FRAMEWORK
 
--- a/nmail.pro	Mon May 03 12:23:15 2010 +0300
+++ b/nmail.pro	Fri May 14 15:41:10 2010 +0300
@@ -48,7 +48,8 @@
         email_plat \
         emailservices/nmregister \
         emailuis/nmhswidget \
-        emailuis/nmhswidget/tsrc/nmhswidgettestapp
+        emailuis/nmhswidget/tsrc/nmhswidgettestapp \
+        emailservices/nmutilities
         
     # Need to remove warnings SYSTEMINCLUDE path "\epoc32\include\mw\hb\..." not found
     system(mkdir \epoc32\include\mw\hb\hbcnf\)