Revision: 201003 RCL_3 PDK_3.0.h
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 19 Feb 2010 22:37:30 +0200
branchRCL_3
changeset 8 e1b6206813b4
parent 4 e7aa27f58ae1
child 10 f5907b1a1053
Revision: 201003 Kit: 201007
email_plat/email_client_api/inc/emailapidefs.h
email_pub/email_widget_api/email_widget_api.metaxml
email_pub/email_widget_api/group/bld.inf
email_pub/email_widget_api/inc/emailobserverinterface.hrh
email_pub/email_widget_api/inc/emailobserverplugin.h
email_pub/email_widget_api/inc/emailobserverplugin.inl
email_pub/email_widget_api/inc/memailapplaunchdata.h
email_pub/email_widget_api/inc/memaildata.h
email_pub/email_widget_api/inc/memailmailboxdata.h
email_pub/email_widget_api/inc/memailmessagedata.h
email_pub/email_widget_api/inc/memailobserverlistener.h
email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/data/2002C324.rss
email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/group/ABLD.BAT
email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/group/bld.inf
email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/group/testplugin2.mmp
email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/inc/applaunchdataimpl.h
email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/inc/emaildataimpl.h
email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/inc/mailboxdataimpl.h
email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/inc/messagedataimpl.h
email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/inc/t_testpluginconst.hrh
email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/inc/t_testpluginimpl.h
email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/rom/3rdpartyapitestplugin2.iby
email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/src/applaunchdataimpl.cpp
email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/src/emaildataimpl.cpp
email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/src/mailboxdataimpl.cpp
email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/src/messagedataimpl.cpp
email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/src/t_testpluginimpl.cpp
email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/src/t_testpluginproxy.cpp
email_pub/group/bld.inf
emailcontacts/remotecontactlookup/engine/data/engine.rss
emailservices/emailclientapi/group/emailclientapi.mmp
emailservices/emailclientapi/inc/emailapiutils.h
emailservices/emailclientapi/inc/emailattachment.h
emailservices/emailclientapi/inc/emailclientapiimpl.h
emailservices/emailclientapi/inc/emailcontent.h
emailservices/emailclientapi/inc/emailfolder.h
emailservices/emailclientapi/inc/emailmailbox.h
emailservices/emailclientapi/inc/emailmessage.h
emailservices/emailclientapi/inc/emailmessagesearch.h
emailservices/emailclientapi/inc/emailmultipart.h
emailservices/emailclientapi/inc/emailtextcontent.h
emailservices/emailclientapi/inc/messageiterator.h
emailservices/emailclientapi/src/emailaddress.cpp
emailservices/emailclientapi/src/emailapiutils.cpp
emailservices/emailclientapi/src/emailclientapiimpl.cpp
emailservices/emailclientapi/src/emailcontent.cpp
emailservices/emailclientapi/src/emailfolder.cpp
emailservices/emailclientapi/src/emailinterfacefactoryimpl.cpp
emailservices/emailclientapi/src/emailmailbox.cpp
emailservices/emailclientapi/src/emailmessage.cpp
emailservices/emailclientapi/src/messageiterator.cpp
emailservices/emaildebug/inc/emailtrace.h
emailservices/emaildebug/inc/emailtraceconfig.hrh
emailservices/emailframework/commonlib/group/bld.inf
emailservices/emailframework/commonlib/inc/CFSMailAddress.h
emailservices/emailframework/commonlib/inc/CFSMailBox.h
emailservices/emailframework/commonlib/inc/CFSMailBoxBase.h
emailservices/emailframework/commonlib/inc/CFSMailFolder.h
emailservices/emailframework/commonlib/inc/CFSMailFolderBase.h
emailservices/emailframework/commonlib/inc/CFSMailIterator.h
emailservices/emailframework/commonlib/inc/CFSMailMessage.h
emailservices/emailframework/commonlib/inc/CFSMailMessageBase.h
emailservices/emailframework/commonlib/inc/CFSMailPluginData.h
emailservices/emailframework/commonlib/inc/CFSMailRequestHandler.h
emailservices/emailframework/commonlib/inc/CFSMailRequestObserver.h
emailservices/emailframework/commonlib/inc/mmrinfoprocessor.h
emailservices/emailframework/commonlib/src/CFSMailAddress.cpp
emailservices/emailframework/commonlib/src/CFSMailBox.cpp
emailservices/emailframework/commonlib/src/CFSMailBoxBase.cpp
emailservices/emailframework/commonlib/src/CFSMailFolder.cpp
emailservices/emailframework/commonlib/src/CFSMailFolderBase.cpp
emailservices/emailframework/commonlib/src/CFSMailIterator.cpp
emailservices/emailframework/commonlib/src/CFSMailMessage.cpp
emailservices/emailframework/commonlib/src/CFSMailMessageBase.cpp
emailservices/emailframework/commonlib/src/CFSMailMessagePart.cpp
emailservices/emailframework/commonlib/src/CFSMailPluginData.cpp
emailservices/emailframework/commonlib/src/CFSMailRequestHandler.cpp
emailservices/emailframework/commonlib/src/CFSMailRequestObserver.cpp
emailservices/emailframework/data/fsmailbrandmanager.rss
emailservices/emailframework/group/FSMailFramework.mmp
emailservices/emailframework/group/bld.inf
emailservices/emailframework/inc/CFSClientAPIRequestHandler.h
emailservices/emailframework/inc/CFSMailBrand.h
emailservices/emailframework/inc/CFSMailBrandManagerImpl.h
emailservices/emailframework/inc/CFSMailClient.h
emailservices/emailframework/inc/CFSMailPlugin.h
emailservices/emailframework/inc/CFSMailPluginManager.h
emailservices/emailframework/inc/MFSMailBoxSearchObserver.h
emailservices/emailframework/inc/MFSMailBrandManager.h
emailservices/emailframework/inc/MFSMailEventObserver.h
emailservices/emailframework/inc/MFSMailIterator.h
emailservices/emailframework/src/CFSClientAPI.cpp
emailservices/emailframework/src/CFSClientAPIRequestHandler.cpp
emailservices/emailframework/src/CFSFWImplementation.cpp
emailservices/emailframework/src/CFSMailBrand.cpp
emailservices/emailframework/src/CFSMailBrandManagerImpl.cpp
emailservices/emailframework/src/CFSMailClient.cpp
emailservices/emailframework/src/CFSMailPluginManager.cpp
emailservices/emailserver/cmailhandlerplugin/data/iconlist.txt
emailservices/emailserver/cmailhandlerplugin/group/cmailhandlerplugin.mmp
emailservices/emailserver/cmailhandlerplugin/inc/cmailcpshandler.h
emailservices/emailserver/cmailhandlerplugin/inc/cmailcpsif.h
emailservices/emailserver/cmailhandlerplugin/inc/cmailcpsifconsts.h
emailservices/emailserver/cmailhandlerplugin/inc/cmailcpssettings.h
emailservices/emailserver/cmailhandlerplugin/inc/cmailcpsutils.h
emailservices/emailserver/cmailhandlerplugin/inc/cmailexternalaccount.h
emailservices/emailserver/cmailhandlerplugin/inc/cmailmessagedetails.h
emailservices/emailserver/cmailhandlerplugin/inc/cmailpluginproxy.h
emailservices/emailserver/cmailhandlerplugin/inc/cmailwidgetcenrepkeys.h
emailservices/emailserver/cmailhandlerplugin/inc/fsnotificationhandlernotifierinitiator.h
emailservices/emailserver/cmailhandlerplugin/src/cmailcpshandler.cpp
emailservices/emailserver/cmailhandlerplugin/src/cmailcpsif.cpp
emailservices/emailserver/cmailhandlerplugin/src/cmailcpssettings.cpp
emailservices/emailserver/cmailhandlerplugin/src/cmailcpsutils.cpp
emailservices/emailserver/cmailhandlerplugin/src/cmailexternalaccount.cpp
emailservices/emailserver/cmailhandlerplugin/src/cmailmessagedetails.cpp
emailservices/emailserver/cmailhandlerplugin/src/cmailpluginproxy.cpp
emailservices/emailserver/cmailhandlerplugin/src/emailsoundhandler.cpp
emailservices/emailserver/cmailhandlerplugin/src/fsmailauthenticationhandler.cpp
emailservices/emailserver/cmailhandlerplugin/src/fsmailmessagequeryhandler.cpp
emailservices/emailserver/cmailhandlerplugin/src/fsmailmtmhandler.cpp
emailservices/emailserver/cmailhandlerplugin/src/fsmailoutofmemoryhandler.cpp
emailservices/emailserver/cmailhandlerplugin/src/fsnotificationhandlerbaseimpl.cpp
emailservices/emailserver/group/fsmailserver.mmp
emailservices/emailserver/inc/fsnotificationhandlerbase.h
emailservices/emailserver/inc/fsnotificationhandlermgrimpl.h
emailservices/emailserver/mailserverautostart/group/fsmailserverautostart.mmp
emailservices/emailserver/src/fsnotificationhandlermgrimpl.cpp
emailservices/emailservermonitor/group/emailservermonitor.mmp
emailservices/emailservermonitor/src/emailshutter.cpp
emailservices/emailstore/base_plugin/group/BasePlugin.mmp
emailservices/emailstore/base_plugin/group/bld.inf
emailservices/emailstore/base_plugin/inc/BaseMrInfoObject.h
emailservices/emailstore/base_plugin/inc/BasePlugin.h
emailservices/emailstore/base_plugin/inc/MailIterator.h
emailservices/emailstore/base_plugin/inc/Map.h
emailservices/emailstore/base_plugin/inc/baseplugindelayedops.h
emailservices/emailstore/base_plugin/src/BaseMrInfoObject.cpp
emailservices/emailstore/base_plugin/src/BasePlugin.cpp
emailservices/emailstore/base_plugin/src/BasePluginPanic.cpp
emailservices/emailstore/base_plugin/src/MailIterator.cpp
emailservices/emailstore/base_plugin/src/baseplugindelayedops.cpp
emailservices/emailstore/base_plugin/src/basepluginfetch.cpp
emailservices/emailstore/base_plugin/src/basepluginmisc.cpp
emailservices/emailstore/base_plugin/src/basepluginnotifications.cpp
emailservices/emailstore/base_plugin/src/basepluginparts.cpp
emailservices/emailstore/base_plugin/src/baseplugintranslator.cpp
emailservices/emailstore/group/bld.inf
emailservices/emailstore/inc/emailstorepskeys.h
emailservices/emailstore/message_store/MsgStoreRfsPlugin/data/RfsMsgStorePlugin.rss
emailservices/emailstore/message_store/MsgStoreRfsPlugin/group/RfsMsgStorePlugin.mmp
emailservices/emailstore/message_store/MsgStoreRfsPlugin/src/RfsMsgStorePlugin.cpp
emailservices/emailstore/message_store/MsgStoreRfsPlugin/src/RfsMsgStoreProxy.cpp
emailservices/emailstore/message_store/PointSecMonitor/Group/ImsPointsecMonitor.mmp
emailservices/emailstore/message_store/PointSecMonitor/Inc/ImsPointsecMonitor.h
emailservices/emailstore/message_store/client/api/MsgStore.h
emailservices/emailstore/message_store/client/api/MsgStoreAddress.h
emailservices/emailstore/message_store/client/api/MsgStoreFolder.h
emailservices/emailstore/message_store/client/api/MsgStoreFolderUtils.h
emailservices/emailstore/message_store/client/api/MsgStoreMailBox.h
emailservices/emailstore/message_store/client/api/MsgStoreMailBoxObserver.h
emailservices/emailstore/message_store/client/api/MsgStoreMessage.h
emailservices/emailstore/message_store/client/api/MsgStoreMessagePart.h
emailservices/emailstore/message_store/client/api/MsgStoreObserver.h
emailservices/emailstore/message_store/client/api/MsgStorePropertyContainer.h
emailservices/emailstore/message_store/client/api/MsgStorePropertyContainerWithContent.h
emailservices/emailstore/message_store/client/api/MsgStorePropertyKeys.h
emailservices/emailstore/message_store/client/api/MsgStoreSearchCriteria.h
emailservices/emailstore/message_store/client/api/MsgStoreSortCriteria.h
emailservices/emailstore/message_store/client/api/MsgStoreSortResultIterator.h
emailservices/emailstore/message_store/client/api/MsgStoreWritablePropertyContainer.h
emailservices/emailstore/message_store/client/group/MessageStoreClient.mmp
emailservices/emailstore/message_store/client/group/bld.inf
emailservices/emailstore/message_store/client/inc/MsgStoreObserverHandler.h
emailservices/emailstore/message_store/client/inc/MsgStorePropertyContainersArray.h
emailservices/emailstore/message_store/client/inc/MsgStoreSearchHandler.h
emailservices/emailstore/message_store/client/inc/MsgStoreSessionContext.h
emailservices/emailstore/message_store/client/inc/RMessageStoreSession.h
emailservices/emailstore/message_store/client/src/MessageStoreClient.cpp
emailservices/emailstore/message_store/client/src/MsgStore.cpp
emailservices/emailstore/message_store/client/src/MsgStoreAccount.cpp
emailservices/emailstore/message_store/client/src/MsgStoreAddress.cpp
emailservices/emailstore/message_store/client/src/MsgStoreFolder.cpp
emailservices/emailstore/message_store/client/src/MsgStoreFolderUtils.cpp
emailservices/emailstore/message_store/client/src/MsgStoreMailBox.cpp
emailservices/emailstore/message_store/client/src/MsgStoreMessage.cpp
emailservices/emailstore/message_store/client/src/MsgStoreMessagePart.cpp
emailservices/emailstore/message_store/client/src/MsgStoreObserverHandler.cpp
emailservices/emailstore/message_store/client/src/MsgStorePropertyContainer.cpp
emailservices/emailstore/message_store/client/src/MsgStorePropertyContainerWithContent.cpp
emailservices/emailstore/message_store/client/src/MsgStorePropertyContainersArray.cpp
emailservices/emailstore/message_store/client/src/MsgStoreSearchCriteria.cpp
emailservices/emailstore/message_store/client/src/MsgStoreSearchHandler.cpp
emailservices/emailstore/message_store/client/src/MsgStoreSessionContext.cpp
emailservices/emailstore/message_store/client/src/MsgStoreSortCriteria.cpp
emailservices/emailstore/message_store/client/src/MsgStoreSortResultIterator.cpp
emailservices/emailstore/message_store/client/src/MsgStoreWritablePropertyContainer.cpp
emailservices/emailstore/message_store/client/src/RMessageStoreSession.cpp
emailservices/emailstore/message_store/common/inc/MessageStoreClientServer.h
emailservices/emailstore/message_store/debuglog/group/DebugLog.mmp
emailservices/emailstore/message_store/debuglog/group/bld.inf
emailservices/emailstore/message_store/debuglog/inc/DebugLogConst.h
emailservices/emailstore/message_store/debuglog/inc/DebugLogMacros.h
emailservices/emailstore/message_store/debuglog/src/DebugLog.cpp
emailservices/emailstore/message_store/exe/group/MessageStoreExe.mmp
emailservices/emailstore/message_store/server/group/MessageStoreServer.mmp
emailservices/emailstore/message_store/server/inc/BackupRestoreObserver.h
emailservices/emailstore/message_store/server/inc/ContainerStore.h
emailservices/emailstore/message_store/server/inc/ContainerStoreAccountTable.h
emailservices/emailstore/message_store/server/inc/ContainerStoreContainersTable.h
emailservices/emailstore/message_store/server/inc/ContainerStoreContentManager.h
emailservices/emailstore/message_store/server/inc/ContainerStoreDeleteHandler.h
emailservices/emailstore/message_store/server/inc/ContainerStoreEncryption.h
emailservices/emailstore/message_store/server/inc/ContainerStoreGeneralTable.h
emailservices/emailstore/message_store/server/inc/ContainerStoreMRUAddressTable.h
emailservices/emailstore/message_store/server/inc/ContainerStoreSearchResultTable.h
emailservices/emailstore/message_store/server/inc/ContainerStoreSortingTable.h
emailservices/emailstore/message_store/server/inc/ContainerStoreTable.h
emailservices/emailstore/message_store/server/inc/ContainerStoreUtils.h
emailservices/emailstore/message_store/server/inc/MessageStoreServer.h
emailservices/emailstore/message_store/server/inc/MessageStoreSession.h
emailservices/emailstore/message_store/server/inc/MsgStoreSortResultRowSet.h
emailservices/emailstore/message_store/server/inc/ShutdownServer.h
emailservices/emailstore/message_store/server/src/ContainerStore.cpp
emailservices/emailstore/message_store/server/src/ContainerStoreSearchHandler.cpp
emailservices/emailstore/message_store/server/src/ContainerStoreSortingTable.cpp
emailservices/emailstore/message_store/server/src/MessageStoreServer.cpp
emailservices/emailstore/preinstall/group/EmailStorePreInstall.mmp
emailservices/emailstore/preinstall/inc/EmailStorePreInstall.h
emailservices/emailstore/preinstall/inc/ProcessTimer.h
emailservices/emailstore/preinstall/src/EmailStorePreInstall.cpp
emailservices/emailstore/tsrc/message_store_test/src/ContentTests.cpp
emailservices/emailstore/tsrc/message_store_test/src/DbCorruptTests.cpp
emailservices/emailstore/tsrc/message_store_test/src/EncryptionTests.cpp
emailservices/emailstore/tsrc/message_store_test/src/MruTests.cpp
emailservices/emailstore/tsrc/message_store_test/src/SearchTests.cpp
emailservices/emailstore/tsrc/message_store_test/src/ShutdownServerTest.cpp
emailservices/emailstore/tsrc/message_store_test/src/SizeTests.cpp
emailservices/emailstore/tsrc/message_store_test/src/SortTests.cpp
emailservices/psmruadapter/inc/CPsMruAdapter.h
emailservices/psmruadapter/src/CPsMruAdapter.cpp
emailuis/emailui/data/FreestyleEmailUi.rss
emailuis/emailui/data/html/email_rtl.html
emailuis/emailui/group/FreestyleEmailUi.mmp
emailuis/emailui/group/bld.inf
emailuis/emailui/inc/ESMailSettingsPlugin.h
emailuis/emailui/inc/FreestyleEmailDownloadInformationMediator.h
emailuis/emailui/inc/FreestyleEmailUiAknStatusIndicator.h
emailuis/emailui/inc/FreestyleEmailUiAppui.h
emailuis/emailui/inc/FreestyleEmailUiConstants.h
emailuis/emailui/inc/FreestyleEmailUiContactHandler.h
emailuis/emailui/inc/FreestyleEmailUiControlBarCallback.h
emailuis/emailui/inc/FreestyleEmailUiGlobalSettingsListView.h
emailuis/emailui/inc/FreestyleEmailUiHtmlViewerContainer.h
emailuis/emailui/inc/FreestyleEmailUiHtmlViewerView.h
emailuis/emailui/inc/FreestyleEmailUiLauncherGridModel.h
emailuis/emailui/inc/FreestyleEmailUiListModel.h
emailuis/emailui/inc/FreestyleEmailUiMailListVisualiser.h
emailuis/emailui/inc/FreestyleEmailUiMailViewerVisualiser.h
emailuis/emailui/inc/FreestyleEmailUiMsgDetailsVisualiser.h
emailuis/emailui/inc/FreestyleEmailUiSearchListVisualiser.h
emailuis/emailui/inc/FreestyleEmailUiSettingsList.h
emailuis/emailui/inc/FreestyleEmailUiUtilities.h
emailuis/emailui/inc/FreestyleEmailUiViewBase.h
emailuis/emailui/inc/FreestyleEmailUiWizardObserver.h
emailuis/emailui/inc/FreestyleMessageHeaderHTML.h
emailuis/emailui/inc/FreestyleMessageHeaderURL.h
emailuis/emailui/inc/FreestyleMessageHeaderURLFactory.h
emailuis/emailui/inc/OverlayControl.h
emailuis/emailui/inc/freestyleemailuimailboxdeleter.h
emailuis/emailui/inc/ncscomposeview.h
emailuis/emailui/inc/ncssubjectfield.h
emailuis/emailui/inc/ncsutility.h
emailuis/emailui/loc/freestyleemailui.loc
emailuis/emailui/sendasmtm/fsmtms/client/inc/cfsclientmtm.h
emailuis/emailui/sendasmtm/fsmtms/client/src/cfsclientmtm.cpp
emailuis/emailui/sendasmtm/fsmtms/server/src/cfsservermtm.cpp
emailuis/emailui/sendasmtm/fsmtms/uidata/src/cfsuidatamtm.cpp
emailuis/emailui/sendasmtm/inc/cfssendashelper.h
emailuis/emailui/sendasmtm/sendashelper/inc/cfssendashelper.h
emailuis/emailui/sendasmtm/sendashelper/src/cfssendashelper.cpp
emailuis/emailui/sis/commonemail.pkg
emailuis/emailui/sis/commonemail_loc.pkg
emailuis/emailui/sis/commonemail_udeb.pkg
emailuis/emailui/sis/commonemail_udeb_loc.pkg
emailuis/emailui/sis/pkg-localizer.py
emailuis/emailui/src/FSComposerFetchLogic.cpp
emailuis/emailui/src/FreestyleEmailCenRepHandler.cpp
emailuis/emailui/src/FreestyleEmailDownloadInformationMediator.cpp
emailuis/emailui/src/FreestyleEmailUiAknStatusIndicator.cpp
emailuis/emailui/src/FreestyleEmailUiAppui.cpp
emailuis/emailui/src/FreestyleEmailUiAttachmentsListModel.cpp
emailuis/emailui/src/FreestyleEmailUiAttachmentsListVisualiser.cpp
emailuis/emailui/src/FreestyleEmailUiCLSListsHandler.cpp
emailuis/emailui/src/FreestyleEmailUiContactHandler.cpp
emailuis/emailui/src/FreestyleEmailUiDownloadManagerVisualiser.cpp
emailuis/emailui/src/FreestyleEmailUiFolderListModel.cpp
emailuis/emailui/src/FreestyleEmailUiFolderListVisualiser.cpp
emailuis/emailui/src/FreestyleEmailUiGlobalSettingsList.cpp
emailuis/emailui/src/FreestyleEmailUiHtmlViewerContainer.cpp
emailuis/emailui/src/FreestyleEmailUiHtmlViewerView.cpp
emailuis/emailui/src/FreestyleEmailUiLauncherGridVisualiser.cpp
emailuis/emailui/src/FreestyleEmailUiMailListModel.cpp
emailuis/emailui/src/FreestyleEmailUiMailListVisualiser.cpp
emailuis/emailui/src/FreestyleEmailUiMailViewerRichText.cpp
emailuis/emailui/src/FreestyleEmailUiMailViewerVisualiser.cpp
emailuis/emailui/src/FreestyleEmailUiMsgDetailsModel.cpp
emailuis/emailui/src/FreestyleEmailUiMsgDetailsVisualiser.cpp
emailuis/emailui/src/FreestyleEmailUiSearchListVisualiser.cpp
emailuis/emailui/src/FreestyleEmailUiSendAttachmentsListControl.cpp
emailuis/emailui/src/FreestyleEmailUiSendAttachmentsListModel.cpp
emailuis/emailui/src/FreestyleEmailUiSettingsList.cpp
emailuis/emailui/src/FreestyleEmailUiSettingsListView.cpp
emailuis/emailui/src/FreestyleEmailUiShortcutBinding.cpp
emailuis/emailui/src/FreestyleEmailUiUtilities.cpp
emailuis/emailui/src/FreestyleEmailUiViewBase.cpp
emailuis/emailui/src/FreestyleEmailUiWizardObserver.cpp
emailuis/emailui/src/FreestyleMessageHeaderHTML.cpp
emailuis/emailui/src/FreestyleMessageHeaderURLEventHandler.cpp
emailuis/emailui/src/FreestyleMessageHeaderURLFactory.cpp
emailuis/emailui/src/OverlayControl.cpp
emailuis/emailui/src/freestyleemailuimailboxdeleter.cpp
emailuis/emailui/src/ncsaddressinputfield.cpp
emailuis/emailui/src/ncsaifeditor.cpp
emailuis/emailui/src/ncscomposeview.cpp
emailuis/emailui/src/ncscomposeviewcontainer.cpp
emailuis/emailui/src/ncsheadercontainer.cpp
emailuis/emailui/src/ncspopuplistbox.cpp
emailuis/emailui/src/ncssubjectfield.cpp
emailuis/emailui/src/ncsutility.cpp
emailuis/gsemailsettings/src/GSEmailSettingsView.cpp
emailuis/uicomponents/inc/fstreevisualizerbase.h
emailuis/uicomponents/src/fscontrolbuttonvisualiser.cpp
emailuis/uicomponents/src/fsfastaddressingvisualizer.cpp
emailuis/uicomponents/src/fstreevisualizerbase.cpp
emailuis/widget/emailwidgetsettings/conf/cmailwidget.confml
emailuis/widget/emailwidgetsettings/conf/cmailwidget_2001E272.crml
emailuis/widget/emailwidgetsettings/group/emailwidgetsettings.mmp
emailuis/widget/emailwidgetsettings/inc/emailwidgetsettingslistview.h
emailuis/widget/emailwidgetsettings/inc/emailwidgetsettingsmailboxes.h
emailuis/widget/emailwidgetsettings/src/emailwidgetsettingsappui.cpp
emailuis/widget/emailwidgetsettings/src/emailwidgetsettingslistview.cpp
emailuis/widget/emailwidgetsettings/src/emailwidgetsettingslistviewcontainer.cpp
emailuis/widget/emailwidgetsettings/src/emailwidgetsettingsmailboxes.cpp
emailuis/widget/xuikon/00/emailwidget.css
group/bld.inf
help/data/xhtml.zip
help/inc/cmail.hlp.hrh
ipsservices/ipssosaoplugin/group/IPSSosAOPlugin.mmp
ipsservices/ipssosaoplugin/inc/IpsSosAOImapAgent.h
ipsservices/ipssosaoplugin/src/IpsSosAOImapAgent.cpp
ipsservices/ipssosplugin/data/2000E53D.rss
ipsservices/ipssosplugin/inc/ipsplgbaseoperation.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/ipsplgmsgiterator.h
ipsservices/ipssosplugin/inc/ipsplgmsgkey.h
ipsservices/ipssosplugin/inc/ipsplgpop3connectop.h
ipsservices/ipssosplugin/inc/ipsplgsmtpoperation.h
ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.h
ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.hrh
ipsservices/ipssosplugin/src/ipsplgconnectandrefreshfolderlist.cpp
ipsservices/ipssosplugin/src/ipsplgeventhandler.cpp
ipsservices/ipssosplugin/src/ipsplgimap4connectop.cpp
ipsservices/ipssosplugin/src/ipsplgimap4fetchattachmentop.cpp
ipsservices/ipssosplugin/src/ipsplgonlineoperation.cpp
ipsservices/ipssosplugin/src/ipsplgpop3connectop.cpp
ipsservices/ipssosplugin/src/ipsplgsmtpoperation.cpp
ipsservices/ipssosplugin/src/ipsplgsmtpservice.cpp
ipsservices/ipssosplugin/src/ipsplgsosbaseplugin.cpp
ipsservices/ipssossettings/data/ipssetuistrings.ra
ipsservices/ipssossettings/inc/ipssetview.h
ipsservices/ipssossettings/src/ipssetdata.cpp
ipsservices/ipssossettings/src/ipssetdataapi.cpp
ipsservices/ipssossettings/src/ipssetdatamanager.cpp
ipsservices/ipssossettings/src/ipssetuidialog.cpp
ipsservices/ipssossettings/src/ipssetuifoldersubscription.cpp
ipsservices/ipssossettings/src/ipssetview.cpp
ipsservices/ipssossettings/tsrc/IpsSosTestApp/inc/TESTAPPDocument.h
ipsservices/ipssossettings/tsrc/IpsSosTestApp/src/TESTAPPAppUi.cpp
ipsservices/ipssossettings/tsrc/IpsSosTestApp/src/TESTAPPContainer.cpp
meetingrequest/mrentry/inc/cesmrfsmailboxutils.h
meetingrequest/mrentry/inc/mesmrmeetingrequestentry.h
meetingrequest/mrentry/src/cesmrfsmailboxutils.cpp
meetingrequest/mrgui/inc/cesmruibase.h
meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/resmrpluginextensionstatic.h
meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrattendeefield.cpp
meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrclslistshandler.cpp
meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrcontacthandler.cpp
meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrresponsefield.cpp
meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrviewerattachmentsfield.cpp
meetingrequest/mrgui/src/cesmraddressselectionquery.cpp
meetingrequest/mrgui/src/cesmrcontactmenuurlhandler.cpp
meetingrequest/mrgui/src/cesmrviewerdialog.cpp
meetingrequest/mrgui/src/cmrresponsedialogview.cpp
meetingrequest/mrgui/src/resmrstatic.cpp
meetingrequest/mricalviewer/inc/cesmrimapicalretriever.h
meetingrequest/mricalviewer/inc/cesmrimapmailfetcher.h
meetingrequest/mricalviewer/src/cesmricalviewercanviewmr.cpp
meetingrequest/mricalviewer/src/cesmricalviewercmdhandler.cpp
meetingrequest/mricalviewer/src/cesmricalvieweremailasynccmd.cpp
meetingrequest/mricalviewer/src/cesmricalviewerloadmrdatacmd.cpp
meetingrequest/mricalviewer/src/cesmricalviewerremovemrfromcalcmd.cpp
meetingrequest/mricalviewer/src/cesmricalviewerresolvemrmethodasync.cpp
meetingrequest/mricalviewer/src/cesmricalviewerresponsetomrcmd.cpp
meetingrequest/mricalviewer/src/cesmrimapicalretriever.cpp
meetingrequest/mricalviewer/src/cesmrimapmailfetcher.cpp
meetingrequest/mricalviewer/src/cesmrmrinfoicalretriever.cpp
meetingrequest/mricalviewer/src/cesmruilauncher.cpp
meetingrequest/mricalviewer/src/esmricalviewerutils.cpp
meetingrequest/mrtasks/inc/cesmrfsemailmanager.h
meetingrequest/mrtasks/src/cesmrfsemailmanager.cpp
meetingrequest/mrtasks/src/cesmrsendmrfsmailreplytask.cpp
meetingrequest/mrtasks/src/cesmrtaskfactory.cpp
--- a/email_plat/email_client_api/inc/emailapidefs.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/email_plat/email_client_api/inc/emailapidefs.h	Fri Feb 19 22:37:30 2010 +0200
@@ -91,7 +91,7 @@
     inline TFolderId() : TBaseId(), iMailboxId() {}
     
     inline TBool operator==( const TFolderId& aFolderId ) const {
-        return ( iMailboxId.iId == aFolderId.iId &&
+        return ( iMailboxId.iId == aFolderId.iMailboxId.iId &&
         iId == aFolderId.iId ); }
         
     inline TBool operator!=( const TFolderId& aFolderId ) const {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/email_widget_api.metaxml	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<api id="2a622bfae811b1680aa73cb3f15ff4b4" dataversion="2.0">
+  <name>Email widget api</name>
+  <description>API for 3rd party email clients to provide data for email widget</description>
+  <type>c++</type>
+  <collection>email_pub</collection>
+  <libs/>
+  <release category="public" sinceversion="3"/>
+  <attributes>
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/group/bld.inf	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,34 @@
+/*
+* 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:  Build information for widget API for 3rd party email clients
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../inc/emailobserverinterface.hrh   APP_LAYER_PUBLIC_EXPORT_PATH(emailobserverinterface.hrh)
+../inc/emailobserverplugin.h        APP_LAYER_PUBLIC_EXPORT_PATH(emailobserverplugin.h)
+../inc/emailobserverplugin.inl      APP_LAYER_PUBLIC_EXPORT_PATH(emailobserverplugin.inl)
+../inc/memailobserverlistener.h     APP_LAYER_PUBLIC_EXPORT_PATH(memailobserverlistener.h)
+../inc/memaildata.h     	        APP_LAYER_PUBLIC_EXPORT_PATH(memaildata.h)
+../inc/memailmailboxdata.h          APP_LAYER_PUBLIC_EXPORT_PATH(memailmailboxdata.h)
+../inc/memailmessagedata.h          APP_LAYER_PUBLIC_EXPORT_PATH(memailmessagedata.h)
+../inc/memailapplaunchdata.h        APP_LAYER_PUBLIC_EXPORT_PATH(memailapplaunchdata.h)
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/inc/emailobserverinterface.hrh	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 - 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:  Interface UID definition for Email Observer.
+*
+*/
+
+#ifndef EMAILOBSERVERINTERFACE_HRH
+#define EMAILOBSERVERINTERFACE_HRH
+
+/**
+ * Ecom interface uid for email observer plugin.
+ */
+#define KEmailObserverInterfaceUid 0x2002A5AE
+
+#endif // EMAILOBSERVERINTERFACE_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/inc/emailobserverplugin.h	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2009 - 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:  Interface header for Email Observer Plugin API.
+*
+*/
+
+#ifndef EMAILOBSERVERPLUGIN_H
+#define EMAILOBSERVERPLUGIN_H
+
+// System includes
+#include <ecom/ecom.h>
+
+namespace EmailInterface {
+
+// Forward declarations
+class MEmailObserverListener;
+class MEmailData;
+
+/**
+ *  Class that client of this interface user instantiates
+ */
+class CEmailObserverPlugin : public CBase
+    {
+public:
+    /**
+     * Contructor
+     * @param aImplUid implementation identifier used by the ECOM framework
+     * @param aListener callback interface provided by the client/instantiator.
+     *        Plugin should call this when it wants the widget data to be updated
+     * @return plugin instance
+     */
+    inline static CEmailObserverPlugin* NewL(
+        TUid aImplUid,
+        MEmailObserverListener* aListener );
+
+    /** destructor */
+    inline virtual ~CEmailObserverPlugin();
+
+    /**
+     * Accessor for data that needs to be published
+     * Plugin must implement this.
+     * When client calls this, plugin must ensure that all necessary data is accessible/updated
+     * @return interface to email data
+     */
+    virtual MEmailData& EmailDataL() = 0;
+
+private:
+    /**
+     * Unique instance identifier key
+     */
+    TUid iDtor_ID_Key;
+    };
+
+// Inline functions
+#include "emailobserverplugin.inl"
+
+} // namespace
+
+#endif // EMAILOBSERVERPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/inc/emailobserverplugin.inl	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2009 - 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:  Ininline definitions for Email Observer Plugin API.
+*
+*/
+
+#include <ecom/ecom.h>
+
+// ----------------------------------------------------------------------------
+// CEmailObserverPlugin::NewL
+// ----------------------------------------------------------------------------
+//
+inline CEmailObserverPlugin* CEmailObserverPlugin::NewL(
+    TUid aImplUid,
+    MEmailObserverListener* aListener )
+    {
+    TAny* interface = REComSession::CreateImplementationL( aImplUid,
+        _FOFF( CEmailObserverPlugin, iDtor_ID_Key ), aListener );
+    return reinterpret_cast<CEmailObserverPlugin*>( interface );
+    }
+
+// ----------------------------------------------------------------------------
+// CEmailObserverPlugin::~CEmailObserverPlugin
+// ----------------------------------------------------------------------------
+//
+inline CEmailObserverPlugin::~CEmailObserverPlugin()
+    {
+    REComSession::DestroyedImplementation( iDtor_ID_Key );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/inc/memailapplaunchdata.h	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2009 - 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:  Helper classes for interface.
+*
+*/
+
+#ifndef MEMAILAPPLAUNCHDATA_H
+#define MEMAILAPPLAUNCHDATA_H
+
+#include <e32cmn.h>
+
+namespace EmailInterface {
+
+/**
+ * Container for launch parameters
+ * When user touches the widget, an application launch is initiated with
+ * these parameters
+ * (see MMailboxData::LaunchParameters() )
+ */
+class MEmailLaunchParameters
+    {
+public:
+    /**
+     * Application UID identifying the application to be launched
+     */
+    virtual TUid ApplicationUid() const = 0;
+
+    /**
+     * ViewId within the application
+     */
+    virtual TUid ViewId() const = 0;
+
+    /**
+     * TUid that will be delivered to the launched application
+     */
+    virtual TUid CustomMessageId() const = 0;
+
+    /**
+     * Data that will be delivered to the launched application
+     */
+    virtual const TDesC8& CustomMessage() const = 0;
+    };
+
+} // namespace
+
+#endif // MEMAILAPPLAUNCHDATA_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/inc/memaildata.h	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2009 - 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:  Helper classes for interface.
+*
+*/
+
+#ifndef MEMAILDATA_H
+#define MEMAILDATA_H
+
+// System includes
+#include <memailmailboxdata.h>
+
+namespace EmailInterface {
+
+/**
+ * Container interface to data that plugin offers
+ * Plugin must ensure that the data is available when MailboxesL() returns
+ * Client will access the data always through this API; no direct references are
+ * stored permanently in the client
+ */
+class MEmailData
+    {
+public:
+    /**
+     * Accessor for mailbox information that this plugin is offering
+     * @ return pointer array of mailbox data interfaces
+     */
+    virtual RPointerArray<MMailboxData>& MailboxesL() = 0;
+    };
+
+} // namespace
+
+#endif // MEMAILDATA_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/inc/memailmailboxdata.h	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2009 - 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:  Helper classes for interface.
+*
+*/
+
+#ifndef MEMAILMAILBOXDATA_H
+#define MEMAILMAILBOXDATA_H
+
+#include <memailmessagedata.h>
+
+namespace EmailInterface {
+
+class MEmailLaunchParameters;
+
+/**
+ *  Container interface for mailbox related info
+ */
+class MMailboxData
+    {
+public:
+    /**
+     * Accessor for mailbox id
+     * @return mailbox identifier
+     */
+    virtual TUint MailboxId() const = 0;
+
+    /**
+     * Accessor for mailbox name
+     * @return mailbox name
+     */
+    virtual const TDesC& Name() const = 0;
+
+    /**
+     * Accessor for mailbox branding icon specifier
+     * @return path descriptor to branding icon
+     *     e.g. "mif(z:\\resource\\apps\\myemailplugin.mif N1 N2)",
+     *     where N1 is integer specifying the icon number in the mif file,
+     *     and N2 is the number of the respective icon mask
+     */
+    virtual const TDesC& BrandingIcon() const = 0;
+
+    /**
+     * Is mailbox's outbox empty or not
+     * @return boolean
+     */
+    virtual TBool IsOutboxEmpty() const = 0;
+
+    /**
+     * Accessor for seen/unseen status
+     * i.e. whether user has been to inbox after last message has been received
+     * @return boolean
+     */
+    virtual TBool Unseen() const = 0;
+
+    /**
+     * Accessor for launching parameters
+     * These parameters specify what application is launched when widget is pressed
+     * @return interface to launch parameters
+     */
+    virtual MEmailLaunchParameters& LaunchParameters() const = 0;
+
+    /**
+     * Accessor for total count of messages in inbox
+     * @return total message count
+     */
+    virtual TInt MessageCount() const = 0;
+
+    /**
+     * Accessor for mailbox's messages. If there are more messages in the array
+     * than fits the widget, only the newest will be published.
+     * Assumption: array must be ordered based on timestamp (i.e. newest in index 0)
+     * Assumption: plugin does not have to upkeep more than 2 latest messages
+     * @return array of messages
+     */
+    virtual const RPointerArray<MMessageData>& LatestMessagesL() const = 0;
+    };
+
+} // namespace
+
+#endif // EMAILMAILBOXDATA_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/inc/memailmessagedata.h	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 2009 - 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:  Helper classes for interface.
+*
+*/
+
+#ifndef MEMAILMESSAGEDATA_H
+#define MEMAILMESSAGEDATA_H
+
+// System includes
+#include <e32std.h>
+
+namespace EmailInterface {
+
+/** Email message priority flag */
+enum TEmailPriority
+    {
+    ENormal,
+    ELow,
+    EHigh
+    };
+
+/**
+ * Container interface for message related info
+ * Plugin implementor make implementation for this
+ */
+class MMessageData
+    {
+public:
+    /**
+     * Accessor for message sender information
+     * @return sender as descriptor
+     */
+    virtual const TDesC& Sender() const = 0;
+
+    /**
+     * Accessor for message subject information
+     * @return message subject
+     */
+    virtual const TDesC& Subject() const = 0;
+
+    /**
+     * Accessor for message timestamp information
+     * @return timestamp
+     */
+    virtual TTime TimeStamp() const = 0;
+
+    /**
+     * Accessor for message read/unread status
+     * @return boolean
+     */
+    virtual TBool Unread() const = 0;
+
+    /**
+     * Accessor for message priority status
+     * @return one of message priority values
+     */
+    virtual TEmailPriority Priority() const = 0;
+
+    /**
+     * Accessor for message's attachment status
+     * @return boolean depending whether message has any attachmants or not
+     */
+    virtual TBool Attachments() const = 0;
+
+    /**
+     * Accessor for info whether this is a calendar message or not
+     * @return boolean
+     */
+    virtual TBool CalendarMsg() const = 0;
+
+    /**
+     * Accessor for info whether this message has been replied or not
+     * @return boolean
+     */
+    virtual TBool Replied() const = 0;
+
+    /**
+     * Accessor for info whether this message has been forwarded or not
+     * @return boolean
+     */
+    virtual TBool Forwarded() const = 0;
+    };
+
+} // namespace
+
+#endif // MEMAILMESSAGEDATA_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/inc/memailobserverlistener.h	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2009 - 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:  Interface header for event listener.
+*
+*/
+
+#ifndef MEMAILOBSERVERLISTENER_H
+#define MEMAILOBSERVERLISTENER_H
+
+namespace EmailInterface {
+
+// Forward declarations
+class MEmailObserverPlugin;
+class MEmailData;
+
+/**
+ * Interface class that is implemented by the plugin instantiator
+ */
+class MEmailObserverListener
+{
+    public:
+    /**
+     * Client callback routine. Client should override this method to implement
+     * event handling routine.
+     * Plugin calls this when it wishes to update data on the widget
+     * @param aEmailData reference to email data provided by the plugin
+     */
+    virtual void EmailObserverEvent( MEmailData& aEmailData ) = 0;
+};
+
+} // namespace
+
+#endif // MEMAILOBSERVERLISTENER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/data/2002C324.rss	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Dummy 3rd party email testplugin
+*
+*/
+
+#include <emailobserverinterface.hrh>
+#include <ecom/registryinfo.rh>
+#include "t_testpluginconst.hrh"
+
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid = KTestPlugin2Uid3;
+    interfaces =
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = KEmailObserverInterfaceUid;
+            implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = KTestPlugin2ImplUid;
+                    version_no = 1;
+                    display_name = "3rd party testplugin 2";
+                    default_data = "";
+                    opaque_data = "";
+                    }
+                };
+            }
+        };
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/group/ABLD.BAT	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,15 @@
+@ECHO OFF
+
+REM Bldmake-generated batch file - ABLD.BAT
+REM ** DO NOT EDIT **
+
+perl -S ABLD.PL "\sf\app\commonemail\email_pub\email_widget_api\tsrc\3rdpartyapitestplugin2\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9
+if errorlevel==1 goto CheckPerl
+goto End
+
+:CheckPerl
+perl -v >NUL
+if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed?
+goto End
+
+:End
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/group/bld.inf	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,36 @@
+/*
+* 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 <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+//--------------------
+PRJ_TESTEXPORTS
+//--------------------
+../rom/3rdpartyapitestplugin2.iby            CORE_APP_LAYER_IBY_EXPORT_PATH( 3rdpartyapitestplugin2.iby )
+
+//--------------------
+PRJ_MMPFILES
+//--------------------
+
+//--------------------
+PRJ_TESTMMPFILES
+//--------------------
+testplugin2.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/group/testplugin2.mmp	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project definition file for 3rd party api testplugin
+*
+*/
+
+
+#include <platform_paths.hrh>       // APP_LAYER_SYSTEMINCLUDE
+#include <data_caging_paths.hrh>    // ECOM_RESOURCE_DIR
+
+#include "../inc/t_testpluginconst.hrh"
+
+TARGET              testplugin2.dll
+TARGETTYPE          PLUGIN
+UID                 0x10009D8D KTestPlugin2Uid3
+
+CAPABILITY          CAP_GENERAL_DLL
+VENDORID            VID_DEFAULT
+
+USERINCLUDE         . ../inc
+USERINCLUDE         ../../../../../inc
+
+APP_LAYER_SYSTEMINCLUDE
+
+START RESOURCE ../data/2002C324.rss
+TARGET          testplugin2
+END
+
+LIBRARY             euser.lib
+LIBRARY             ecom.lib
+LIBRARY             cmaillogger.lib
+
+SOURCEPATH          ../src
+SOURCE              t_testpluginproxy.cpp
+SOURCE              t_testpluginimpl.cpp
+SOURCE              emaildataimpl.cpp
+SOURCE              mailboxdataimpl.cpp
+SOURCE              applaunchdataimpl.cpp
+SOURCE              messagedataimpl.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/inc/applaunchdataimpl.h	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  3rd party api testplugin app launcher data
+*
+*/
+
+#ifndef APPLAUNCHDATAIMPL_H
+#define APPLAUNCHDATAIMPL_H
+
+#include <e32base.h>
+#include <e32des8.h>
+
+#include "memailapplaunchdata.h"
+
+NONSHARABLE_CLASS( CAppLaunchDataImpl ) : public EmailInterface::MEmailLaunchParameters
+    {
+    public:
+        static CAppLaunchDataImpl* NewL( TUid aAppUid, TUid aViewUid );
+        virtual ~CAppLaunchDataImpl();
+
+    public:
+        virtual TUid ApplicationUid() const;
+        virtual TUid ViewId() const;
+        virtual TUid CustomMessageId() const;
+        virtual const TDesC8& CustomMessage() const;
+
+    private:
+        CAppLaunchDataImpl( TUid aAppUid, TUid aViewUid );
+        void ConstructL();
+
+    public:    // Data
+        TUid iAppUid;
+        TUid iViewUid;
+        TUid iCustMsgUid;
+        HBufC8* iCustomMessage;
+    };
+
+#endif // APPLAUNCHDATAIMPL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/inc/emaildataimpl.h	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  3rd party api testplugin email data
+*
+*/
+
+#ifndef EMAILDATAIMPL_H
+#define EMAILDATAIMPL_H
+
+#include <e32base.h>
+#include <memaildata.h>
+
+#include "mailboxdataimpl.h"
+
+class MMailboxData;
+
+NONSHARABLE_CLASS( CEmailDataImpl ) : public EmailInterface::MEmailData
+    {
+    public:
+        static CEmailDataImpl* NewL();
+        virtual ~CEmailDataImpl();
+        virtual RPointerArray<EmailInterface::MMailboxData>& MailboxesL();
+        
+    private:
+        CEmailDataImpl();
+        void ConstructL();
+
+    public:    // Data
+        RPointerArray<EmailInterface::MMailboxData> iMailboxes;
+    };
+
+#endif // EMAILDATAIMPL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/inc/mailboxdataimpl.h	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  3rd party api testplugin mailbox data
+*
+*/
+
+#ifndef MAILBOXDATAIMPL_H
+#define MAILBOXDATAIMPL_H
+
+#include <e32base.h>
+#include <memailmailboxdata.h>
+#include <memailapplaunchdata.h>
+
+
+class MMessageData;
+class MEmailLaunchParameters;
+class CAppLaunchDataImpl;
+
+NONSHARABLE_CLASS( CMailboxDataImpl ) : public EmailInterface::MMailboxData
+    {
+    public:
+        static CMailboxDataImpl* NewL();
+        virtual ~CMailboxDataImpl();
+
+        virtual TUint MailboxId() const;
+        virtual const TDesC& Name() const;
+        virtual const TDesC& BrandingIcon() const;
+        virtual TBool IsOutboxEmpty() const;
+        virtual TBool Unseen() const;
+        virtual EmailInterface::MEmailLaunchParameters& LaunchParameters() const;
+        virtual TInt MessageCount() const;
+        virtual const RPointerArray<EmailInterface::MMessageData>& LatestMessagesL() const;
+
+    private:
+        CMailboxDataImpl();
+        void ConstructL();
+
+    public:    // Data
+        TInt iMailboxId;
+        HBufC* iName;
+        HBufC* iBrandingIcon;
+        TBool iIsOutboxEmpty;
+        TBool iUnseen;
+        CAppLaunchDataImpl* iAppLaunchParams;
+        RPointerArray<EmailInterface::MMessageData> iMessages;
+    };
+
+#endif // MAILBOXDATAIMPL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/inc/messagedataimpl.h	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  3rd party api testplugin message data
+*
+*/
+
+#ifndef MESSAGEDATAIMPL_H
+#define MESSAGEDATAIMPL_H
+
+#include <e32base.h>
+
+class MMessageData;
+
+NONSHARABLE_CLASS( CMessageDataImpl ) : public EmailInterface::MMessageData
+    {
+    public:
+        static CMessageDataImpl* NewL();
+        virtual ~CMessageDataImpl();
+
+        virtual const TDesC& Sender() const;
+        virtual const TDesC& Subject() const;
+        virtual TTime TimeStamp() const;
+        virtual TBool Unread() const;
+        virtual EmailInterface::TEmailPriority Priority() const;
+        virtual TBool Attachments() const;
+        virtual TBool CalendarMsg() const;
+        virtual TBool Replied() const;
+        virtual TBool Forwarded() const;
+
+        void SetFlagsL( const TInt aFlags );
+
+    private:
+        CMessageDataImpl();
+        void ConstructL();
+    public:    // Data
+        HBufC* iSender;
+        HBufC* iSubject;
+        TTime iTimeStamp;
+        TBool iUnread;
+        EmailInterface::TEmailPriority iPriority;
+        TBool iAttachments;
+        TBool iCalendarMsg;
+        TBool iReplied;
+        TBool iForwarded;
+    };
+
+#endif // MESSAGEDATAIMPL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/inc/t_testpluginconst.hrh	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,19 @@
+/*
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 3rd party api testplugin constants
+*
+*/
+
+#define    KTestPlugin2Uid3          0x2002C324
+#define    KTestPlugin2ImplUid       0x2002C325
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/inc/t_testpluginimpl.h	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 3rd party api testplugin
+*
+*/
+
+#ifndef TESTPLUGINIMPL_H
+#define TESTPLUGINIMPL_H
+
+#include <e32base.h>
+#include <emailobserverplugin.h>
+#include <memailmailboxdata.h>
+
+class MEmailObserverListener;
+class CEmailDataImpl;
+
+NONSHARABLE_CLASS( CEmailObserverPluginImpl ) : public EmailInterface::CEmailObserverPlugin
+    {
+    public:
+        static EmailInterface::CEmailObserverPlugin* NewL( EmailInterface::MEmailObserverListener* aListener );
+        virtual ~CEmailObserverPluginImpl();
+        virtual EmailInterface::MEmailData& EmailDataL();
+
+    private:
+        CEmailObserverPluginImpl( EmailInterface::MEmailObserverListener* aListener );
+        void ConstructL();
+        void ReadInitialDatafromPubSubL();
+
+    private:    // Data
+        EmailInterface::MEmailObserverListener* iListener; // not owned
+        CEmailDataImpl* iData;
+    };
+
+#endif // TESTPLUGINIMPL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/rom/3rdpartyapitestplugin2.iby	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,24 @@
+/*
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Image description file for 3rd party api testplugin
+*
+*/
+
+#ifndef THIRDPARTYAPITESTPLUGIN_IBY
+#define THIRDPARTYAPITESTPLUGIN_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+ECOM_PLUGIN( testplugin2.dll, testplugin2.rsc )
+
+#endif // THIRDPARTYAPITESTPLUGIN_IBY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/src/applaunchdataimpl.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  3rd party api testplugin app launcher data
+*
+*/
+
+#include "applaunchdataimpl.h"
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+CAppLaunchDataImpl* CAppLaunchDataImpl::NewL( TUid aAppUid, TUid aViewUid )
+    {
+    CAppLaunchDataImpl* self = new(ELeave) CAppLaunchDataImpl( aAppUid, aViewUid );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+CAppLaunchDataImpl::~CAppLaunchDataImpl()
+    {
+    delete iCustomMessage;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+CAppLaunchDataImpl::CAppLaunchDataImpl( TUid aAppUid, TUid aViewUid ) : 
+    iAppUid( aAppUid ), iViewUid( aViewUid ), iCustMsgUid( TUid() ), iCustomMessage( NULL )
+    {
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+void CAppLaunchDataImpl::ConstructL()
+    {
+    iCustomMessage = HBufC8::NewL(1);
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+TUid CAppLaunchDataImpl::ApplicationUid() const
+    {
+    return iAppUid;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+TUid CAppLaunchDataImpl::ViewId() const
+    {
+    return iViewUid;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+TUid CAppLaunchDataImpl::CustomMessageId() const
+    {
+    return iCustMsgUid;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+const TDesC8& CAppLaunchDataImpl::CustomMessage() const
+    {
+    return *iCustomMessage;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/src/emaildataimpl.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 3rd party test plugin email data
+*
+*/
+
+#include <memaildata.h>
+
+#include "emailtrace.h"
+#include "emaildataimpl.h"
+#include "mailboxdataimpl.h"
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+CEmailDataImpl* CEmailDataImpl::NewL()
+    {
+    FUNC_LOG;
+    CEmailDataImpl* self = new(ELeave) CEmailDataImpl();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+CEmailDataImpl::~CEmailDataImpl()
+    {
+    for ( TInt i = 0; i < iMailboxes.Count(); i++ )
+        {
+        delete static_cast<CMailboxDataImpl*>(iMailboxes[i]);
+        iMailboxes.Remove(i);
+        }
+    iMailboxes.ResetAndDestroy();
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+CEmailDataImpl::CEmailDataImpl()
+    {
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+void CEmailDataImpl::ConstructL()
+    {
+    CMailboxDataImpl* mailbox = CMailboxDataImpl::NewL();
+    iMailboxes.AppendL( mailbox );
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+RPointerArray<EmailInterface::MMailboxData>& CEmailDataImpl::MailboxesL()
+    {
+    FUNC_LOG;
+    return iMailboxes;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/src/mailboxdataimpl.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,145 @@
+/*
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  3rd party api testplugin mailbox data
+*
+*/
+
+#include <memaildata.h>
+#include <memailmailboxdata.h>
+#include <memailmessagedata.h>
+
+#include "emailtrace.h"
+#include "mailboxdataimpl.h"
+#include "messagedataimpl.h"
+#include "t_testpluginconst.hrh"
+#include "applaunchdataimpl.h"
+
+// Hardcoded default values
+
+// Path to graphics file with icon/mask numbers (client must provide separate file with brand graphics)
+_LIT( KDefaultBrandingIcon, "mif(Z:\\resource\\apps\\google_brand_graphics.mif 16384 16385)" );
+_LIT( KDefaultName, "HARDCODED" );           // default mailbox name
+const TInt KDefaultMailboxId = 12345;
+const TUid KDefaultAppUid  = { 0x200009EE }; // App to be launched from widget
+const TUid KDefaultViewUid = { 0x00000001 }; // View to be activated from widget
+const TBool KDefaultIsOutboxEmpty( ETrue );
+const TBool KDefaultUnseen( EFalse );
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+CMailboxDataImpl* CMailboxDataImpl::NewL()
+    {
+    FUNC_LOG;
+    CMailboxDataImpl* self = new(ELeave) CMailboxDataImpl();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+CMailboxDataImpl::~CMailboxDataImpl()
+    {
+    delete iName;
+
+    for ( TInt i = 0; i < iMessages.Count(); i++ )
+        {
+        delete static_cast<CMessageDataImpl*>(iMessages[i]);
+        iMessages.Remove(i);
+        }
+    iMessages.ResetAndDestroy();
+    delete iAppLaunchParams;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+CMailboxDataImpl::CMailboxDataImpl() :
+    iName( NULL ),
+    iBrandingIcon( NULL),
+    iIsOutboxEmpty( KDefaultIsOutboxEmpty ),
+    iUnseen( KDefaultUnseen ),
+    iAppLaunchParams( NULL )
+    {
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+void CMailboxDataImpl::ConstructL()
+    {
+    iAppLaunchParams = CAppLaunchDataImpl::NewL( KDefaultAppUid, KDefaultViewUid );
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+TUint CMailboxDataImpl::MailboxId() const
+    {
+    FUNC_LOG;
+    return KDefaultMailboxId;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+const TDesC& CMailboxDataImpl::Name() const
+    {
+    FUNC_LOG;
+    return KDefaultName;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+const TDesC& CMailboxDataImpl::BrandingIcon() const
+    {
+    FUNC_LOG;
+    return KDefaultBrandingIcon;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+TBool CMailboxDataImpl::IsOutboxEmpty() const
+    {
+    FUNC_LOG;
+    return iIsOutboxEmpty;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+const RPointerArray<EmailInterface::MMessageData>& CMailboxDataImpl::LatestMessagesL() const
+    {
+    FUNC_LOG;
+    return iMessages;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+TInt CMailboxDataImpl::MessageCount() const
+    {
+    return iMessages.Count();
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+TBool CMailboxDataImpl::Unseen() const
+    {
+    FUNC_LOG;
+    return iUnseen;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+EmailInterface::MEmailLaunchParameters& CMailboxDataImpl::LaunchParameters() const
+    {
+    FUNC_LOG;
+    return *( static_cast<EmailInterface::MEmailLaunchParameters*>( iAppLaunchParams ) );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/src/messagedataimpl.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  3rd party api testplugin message data
+*
+*/
+
+#include <memaildata.h>
+#include <memailmessagedata.h>
+
+#include "messagedataimpl.h"
+
+// Hardcoded default values
+_LIT( KDefaultSender, "sender@domain.com" );
+_LIT( KDefaultSubject, "Test subject" );
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+CMessageDataImpl* CMessageDataImpl::NewL()
+    {
+    CMessageDataImpl* self = new(ELeave) CMessageDataImpl();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+CMessageDataImpl::~CMessageDataImpl()
+    {
+    delete iSender;
+    delete iSubject;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+CMessageDataImpl::CMessageDataImpl() : iSender( NULL ), iSubject( NULL ),
+    iUnread( EFalse ), iPriority( EmailInterface::ENormal ), iAttachments( EFalse ), iCalendarMsg( EFalse ),
+    iReplied( EFalse ), iForwarded( EFalse )
+    {
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+void CMessageDataImpl::ConstructL()
+    {
+    iTimeStamp.HomeTime();
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+const TDesC& CMessageDataImpl::Sender() const
+    {
+    return KDefaultSender;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+const TDesC& CMessageDataImpl::Subject() const
+    {
+    return KDefaultSubject;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+TTime CMessageDataImpl::TimeStamp() const
+    {
+    return iTimeStamp;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+TBool CMessageDataImpl::Unread() const
+    {
+    return iUnread;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+EmailInterface::TEmailPriority CMessageDataImpl::Priority() const
+    {
+    return iPriority;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+TBool CMessageDataImpl::Attachments() const
+    {
+    return iAttachments;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+TBool CMessageDataImpl::CalendarMsg() const
+    {
+    return iCalendarMsg;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+TBool CMessageDataImpl::Replied() const
+    {
+    return iReplied;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+TBool CMessageDataImpl::Forwarded() const
+    {
+    return iForwarded;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/src/t_testpluginimpl.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  3rd party api testplugin
+*
+*/
+
+#include <memailobserverlistener.h>
+#include <memaildata.h>
+
+#include "emailtrace.h"
+#include "t_testpluginimpl.h"
+#include "emaildataimpl.h"
+#include "mailboxdataimpl.h"
+#include "messagedataimpl.h"
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+EmailInterface::CEmailObserverPlugin* CEmailObserverPluginImpl::NewL(
+    EmailInterface::MEmailObserverListener* aListener )
+    {
+    FUNC_LOG;
+    CEmailObserverPluginImpl* self = new(ELeave) CEmailObserverPluginImpl( aListener );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+CEmailObserverPluginImpl::~CEmailObserverPluginImpl()
+    {
+    delete iData;
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+CEmailObserverPluginImpl::CEmailObserverPluginImpl( EmailInterface::MEmailObserverListener* aListener ) :
+    iListener( aListener ), iData( NULL )
+    {
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+void CEmailObserverPluginImpl::ConstructL()
+    {
+    iData = CEmailDataImpl::NewL();
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+EmailInterface::MEmailData& CEmailObserverPluginImpl::EmailDataL()
+    {
+    FUNC_LOG;
+    return *( static_cast<EmailInterface::MEmailData*>( iData ) );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/email_widget_api/tsrc/3rdpartyapitestplugin2/src/t_testpluginproxy.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  3rd party api testplugin proxy
+*
+*/
+
+#include <ecom/implementationproxy.h>
+
+#include "t_testpluginimpl.h"
+#include "t_testpluginconst.hrh"
+
+// ---------------------------------------------------------
+// Pairs ECom implementation UIDs with a pointer to the instantiation
+// method for that implementation. Required for all ECom implementation
+// collections.
+// ---------------------------------------------------------
+const TImplementationProxy ImplementationTable[] =
+    {
+    { {KTestPlugin2ImplUid}, reinterpret_cast<TProxyNewLPtr>( CEmailObserverPluginImpl::NewL ) }
+    };
+
+// ---------------------------------------------------------
+// Returns an instance of the proxy table.
+// Returns: KErrNone
+// ---------------------------------------------------------
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(
+    TInt& aTableCount )
+    {
+    aTableCount = sizeof( ImplementationTable) / sizeof( TImplementationProxy );
+    return ImplementationTable;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_pub/group/bld.inf	Fri Feb 19 22:37:30 2010 +0200
@@ -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:  Build information for widget API for 3rd party email clients
+*
+*/
+
+#include "../email_widget_api/group/bld.inf"
--- a/emailcontacts/remotecontactlookup/engine/data/engine.rss	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailcontacts/remotecontactlookup/engine/data/engine.rss	Fri Feb 19 22:37:30 2010 +0200
@@ -88,7 +88,7 @@
 		MENU_ITEM { command = ERclCmdNewSearch; txt = qtn_rcl_opt_new_search; },
 		MENU_ITEM { command = ERclCmdCall; cascade = r_rcl_call_menu_pane; txt = qtn_rcl_opt_call; },
 		MENU_ITEM { command = ERclCmdSend; cascade = r_rcl_send_menu_pane; txt = qtn_rcl_opt_send; },
-		MENU_ITEM { command = ERclCmdHelp; txt = qtn_options_help; },
+//		MENU_ITEM { command = ERclCmdHelp; txt = qtn_options_help; },
 		MENU_ITEM { command = EAknCmdExit; txt = qtn_options_exit; }	
 		};
 	}
--- a/emailservices/emailclientapi/group/emailclientapi.mmp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailclientapi/group/emailclientapi.mmp	Fri Feb 19 22:37:30 2010 +0200
@@ -19,6 +19,7 @@
 #include <platform_paths.hrh>
 #include "../inc/emailclientapiimpl.hrh"
 #include "../../../inc/emailtraceconfig.hrh"
+#include "../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber
 
 
 TARGET          emailclientapi.dll
@@ -28,6 +29,9 @@
 
 VENDORID        VID_DEFAULT
 
+VERSION         KEmailBinaryVersionNumber
+KEmailBinaryDemandPaging
+
 SOURCEPATH      ../src
 SOURCE          emailclientapiimpl.cpp
 SOURCE          emailinterfacefactoryimpl.cpp
@@ -45,12 +49,11 @@
 SOURCE          emailtextcontent.cpp
 SOURCE          emailmultipart.cpp
 
-//user include
+// User include
 USERINCLUDE     ../inc
 USERINCLUDE     ../../../inc
 
-//system include
-
+// System include
 APP_LAYER_SYSTEMINCLUDE
 
 
--- a/emailservices/emailclientapi/inc/emailapiutils.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailclientapi/inc/emailapiutils.h	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 #define EMAILAPIUTILS_H
 
 #include <e32base.h>
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 #include <emailapidefs.h>
 
 //using namespace EmailInterface;
--- a/emailservices/emailclientapi/inc/emailattachment.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailclientapi/inc/emailattachment.h	Fri Feb 19 22:37:30 2010 +0200
@@ -23,7 +23,7 @@
 #include <e32std.h>
 #include <e32base.h>
 
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 #include <memailcontent.h>
 #include "emailapiutils.h"
 
--- a/emailservices/emailclientapi/inc/emailclientapiimpl.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailclientapi/inc/emailclientapiimpl.h	Fri Feb 19 22:37:30 2010 +0200
@@ -22,7 +22,6 @@
 #include <ecom/implementationinformation.h> 
 #include "emailapiutils.h"
 #include "cfsmailcommon.h"
-//#include "emailinternalclientapi.h"
 #include "mfsmaileventobserver.h"    
 #include <memailclientapi.h>
 #include "emailclientpluginmanager.h"
--- a/emailservices/emailclientapi/inc/emailcontent.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailclientapi/inc/emailcontent.h	Fri Feb 19 22:37:30 2010 +0200
@@ -20,7 +20,7 @@
 
 #include <memailcontent.h>
 
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 #include "emailapiutils.h"
 
 using namespace EmailInterface;
--- a/emailservices/emailclientapi/inc/emailfolder.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailclientapi/inc/emailfolder.h	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 #define CEMAILFOLDER_H
 
 #include <emailapidefs.h>
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 #include <memailfolder.h>
 #include "mfsmaileventobserver.h"
 
--- a/emailservices/emailclientapi/inc/emailmailbox.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailclientapi/inc/emailmailbox.h	Fri Feb 19 22:37:30 2010 +0200
@@ -18,7 +18,7 @@
 #ifndef EMAILMAILBOX_H
 #define EMAILMAILBOX_H
 
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 #include <memailmailbox.h>
 #include "mfsmaileventobserver.h"
 #include "mfsmailrequestobserver.h"
--- a/emailservices/emailclientapi/inc/emailmessage.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailclientapi/inc/emailmessage.h	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 #define EMAILMESSAGE_H
 
 #include <memailmessage.h>
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 #include "emailapiutils.h"
 
 using namespace EmailInterface;
@@ -132,6 +132,9 @@
     
 private:        
 
+    // Copies/moves flag values from iPluginMessage's flags to local flag member variable
+    void InitializeFlagValues();
+    
     CEmailMessage( CPluginData& aPluginData, CFSMailMessage* aMessage, const TDataOwner aOwner );
     
     void ConstructL();
--- a/emailservices/emailclientapi/inc/emailmessagesearch.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailclientapi/inc/emailmessagesearch.h	Fri Feb 19 22:37:30 2010 +0200
@@ -22,8 +22,8 @@
 #include <memailmessagesearch.h>
 #include <emailsorting.h>
 
-#include "CFSMailClient.h"
-#include "MFSMailBoxSearchObserver.h"
+#include "cfsmailclient.h"
+#include "mfsmailboxsearchobserver.h"
 #include "emailapiutils.h"
 
 using namespace EmailInterface;
--- a/emailservices/emailclientapi/inc/emailmultipart.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailclientapi/inc/emailmultipart.h	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 #ifndef EMAILMULTIPART_H_
 #define EMAILMULTIPART_H_
 // INCLUDES
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 #include <memailcontent.h>
 #include "emailapiutils.h"
 
--- a/emailservices/emailclientapi/inc/emailtextcontent.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailclientapi/inc/emailtextcontent.h	Fri Feb 19 22:37:30 2010 +0200
@@ -20,7 +20,7 @@
 #define EMAILTEXTCONTENT_H_
 
 // INCLUDES
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 #include <memailcontent.h>
 #include "emailapiutils.h"
 
--- a/emailservices/emailclientapi/inc/messageiterator.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailclientapi/inc/messageiterator.h	Fri Feb 19 22:37:30 2010 +0200
@@ -20,7 +20,7 @@
                                                                              
 #include <mmessageiterator.h>                                                                             
 #include "emailapidefs.h"
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 
 using namespace EmailInterface;
 
--- a/emailservices/emailclientapi/src/emailaddress.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailclientapi/src/emailaddress.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -16,7 +16,7 @@
 */
 
 #include "emailaddress.h"
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 #include "emailclientapi.hrh"
 
 CEmailAddress* CEmailAddress::NewL( const TRole aRole, const TDataOwner aOwner )
--- a/emailservices/emailclientapi/src/emailapiutils.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailclientapi/src/emailapiutils.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -16,7 +16,7 @@
 */
 
 #include    <e32std.h>       
-#include "CFSMailPlugin.h"
+#include "cfsmailplugin.h"
 #include "emailapidefs.h"
 #include "emailclientapiimpldefs.h"
 #include "emailapiutils.h"
--- a/emailservices/emailclientapi/src/emailclientapiimpl.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailclientapi/src/emailclientapiimpl.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -29,8 +29,8 @@
 #include "emailapiutils.h"
 #include "emailmailbox.h"
 #include <memailaddress.h>
-#include "CFSMailPlugin.h"
-#include "CFSClientAPI.h"
+#include "cfsmailplugin.h"
+#include "cfsclientapi.h"
 #include "emailclientapiimpldefs.h"
 #include "emailmailboxcache.h"
 #include "FreestyleEmailUiConstants.h"
--- a/emailservices/emailclientapi/src/emailcontent.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailclientapi/src/emailcontent.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,7 +18,7 @@
 #include <apmstd.h>
 
 #include "emailcontent.h"
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 #include "emailclientapi.hrh"
 #include "emailapiutils.h"
 
--- a/emailservices/emailclientapi/src/emailfolder.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailclientapi/src/emailfolder.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -20,8 +20,8 @@
 #include "emailapiutils.h"
 #include "messageiterator.h"
 #include "emailsorting.h"
-#include "CFSMailFolder.h"
-#include "CFSMailPlugin.h"
+#include "cfsmailfolder.h"
+#include "cfsmailplugin.h"
 #include "emailclientapi.hrh"
 #include "emailclientapiimpldefs.h"
 
@@ -255,7 +255,7 @@
     for ( TInt i=0; i < aSortCriteria.Count(); i++ )
         {
         const TEmailSortCriteria& criteria  = aSortCriteria[i];
-        __ASSERT_ALWAYS( criteria.iField < sizeof( fieldValues ),
+        __ASSERT_ALWAYS( criteria.iField < sizeof( fieldValues ) / sizeof (fieldValues [i] ),
             Panic( EMailPanicSortMapIndexOutOfBounds ) );
         TFSMailSortCriteria fsCriteria;
         fsCriteria.iField = fieldValues[ criteria.iField ];
--- a/emailservices/emailclientapi/src/emailinterfacefactoryimpl.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailclientapi/src/emailinterfacefactoryimpl.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -20,7 +20,7 @@
 
 #include "emailinterfacefactoryimpl.h"
 #include "emailcontent.h"
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 #include "emailclientapiimpldefs.h"
 #include "emailclientapiimpl.h"
 #include "emailaddress.h"
--- a/emailservices/emailclientapi/src/emailmailbox.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailclientapi/src/emailmailbox.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -31,11 +31,11 @@
 #include "emailfolder.h"
 #include "emailmessage.h"
 #include "emailmessagesearch.h"
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 #include "emailclientapiimpl.h"
-#include "CFSMailPlugin.h"
-#include "CFSMailbox.h"
-#include "CFSMailFolder.h"
+#include "cfsmailplugin.h"
+#include "cfsmailbox.h"
+#include "cfsmailfolder.h"
 #include "emailclientapi.hrh"
 #include "FreestyleEmailUiConstants.h"
 
@@ -450,7 +450,7 @@
     TMailboxId id( aMailbox.Id() );
     // boundary check
     const TInt index( aEvent );
-    if ( index < sizeof( KMailboxEventHandlers ) )
+    if ( index < sizeof( KMailboxEventHandlers ) / sizeof( KMailboxEventHandlers[ index ] ) )
         {
         // call event handler function
         TEventMapFunc method = KMailboxEventHandlers[ index ];        
--- a/emailservices/emailclientapi/src/emailmessage.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailclientapi/src/emailmessage.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -33,9 +33,9 @@
 #include "emailtextcontent.h"
 #include "emailmultipart.h"
 #include "emailattachment.h"
-#include "CFSMailPlugin.h"
+#include "cfsmailplugin.h"
 #include "FreestyleEmailUiConstants.h"
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 
 // -----------------------------------------------------------------------------
 // 
@@ -74,6 +74,9 @@
             iPluginMessage->GetMessageId().Id(),
             iPluginMessage->GetFolderId().Id(), 
             iPluginMessage->GetMailBoxId().Id() );
+        
+        // Copy the message flags
+        InitializeFlagValues();
         }
     }
 
@@ -353,6 +356,142 @@
 // -----------------------------------------------------------------------------
 // 
 // -----------------------------------------------------------------------------
+void CEmailMessage::InitializeFlagValues()
+    {
+    // 1st reset member value, then start copying different flags
+    iFlags = 0;
+    
+    // EFlag_Read
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_Read ) )
+        {
+        iFlags |= EFlag_Read;
+        }
+    else
+        {
+        iFlags &= ~EFlag_Read;
+        }
+    //    EFlag_Read_Locally
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_Read_Locally ) )
+        {
+        iFlags |= EFlag_Read_Locally;
+        }
+    else
+        {
+        iFlags &= ~EFlag_Read_Locally;
+        }    
+    // EFlag_Low
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_Low ) )
+        {
+        iFlags |= EFlag_Low;
+        }
+    else
+        {
+        iFlags &= ~EFlag_Low;
+        }
+    // EFlag_Important
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_Important ) )
+        {
+        iFlags |= EFlag_Important;
+        }
+    else
+        {
+        iFlags &= ~EFlag_Important;
+        }
+    // EFlag_FollowUpComplete
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_FollowUpComplete ) )
+        {
+        iFlags |= EFlag_FollowUpComplete;
+        }
+    else
+        {
+        iFlags &= ~EFlag_FollowUpComplete;
+        }
+    // EFlag_FollowUp
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_FollowUp ) )
+        {
+        iFlags |= EFlag_FollowUp;
+        }
+    else
+        {
+        iFlags &= ~EFlag_FollowUp;
+        }
+    // EFlag_Attachments
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_Attachments ) )
+        {
+        iFlags |= EFlag_Attachments;
+        }
+    else
+        {
+        iFlags &= ~EFlag_Attachments;
+        }
+    // EFlag_Multiple
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_Multiple ) )
+        {
+        iFlags |= EFlag_Multiple;
+        }
+    else
+        {
+        iFlags &= ~EFlag_Multiple;
+        }
+    // EFlag_CalendarMsg
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_CalendarMsg ) )
+        {
+        iFlags |= EFlag_CalendarMsg;
+        }
+    else
+        {
+        iFlags &= ~EFlag_CalendarMsg;
+        }
+    // EFlag_Answered
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_Answered ) )
+        {
+        iFlags |= EFlag_Answered;
+        }
+    else
+        {
+        iFlags &= ~EFlag_Answered;
+        }
+    // EFlag_Forwarded
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_Forwarded ) )
+        {
+        iFlags |= EFlag_Forwarded;
+        }
+    else
+        {
+        iFlags &= ~EFlag_Forwarded;
+        }
+    // EFlag_OnlyToMe
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_OnlyToMe ) )
+        {
+        iFlags |= EFlag_OnlyToMe;
+        }
+    else
+        {
+        iFlags &= ~EFlag_OnlyToMe;
+        }
+    // EFlag_RemoteDeleted
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_RemoteDeleted ) )
+        {
+        iFlags |= EFlag_RemoteDeleted;
+        }
+    else
+        {
+        iFlags &= ~EFlag_RemoteDeleted;
+        }
+    // EFlag_HasMsgSender 
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_HasMsgSender ) )
+        {
+        iFlags |= EFlag_HasMsgSender;
+        }
+    else
+        {
+        iFlags &= ~EFlag_HasMsgSender;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
 MEmailMessageContent* CEmailMessage::ContentL() const
     {
     if (iTextContent)
@@ -382,16 +521,16 @@
                         iMessageId.iFolderId.iId,
                         iMessageId.iFolderId.iMailboxId ); 
 
-    if (!contentType.Compare(KFSMailContentTypeTextPlain) || 
-        !contentType.Compare(KFSMailContentTypeTextHtml))
+    if (!contentType.Find(KFSMailContentTypeTextPlain) || 
+        !contentType.Find(KFSMailContentTypeTextHtml))
         {                                
         iTextContent = CEmailTextContent::NewL(iPluginData, msgContentId, part, EAPIOwns );        
         }
-    else if (!contentType.Compare(KFSMailContentTypeMultipartMixed) ||
-             !contentType.Compare(KFSMailContentTypeMultipartAlternative) ||
-             !contentType.Compare(KFSMailContentTypeMultipartDigest) ||
-             !contentType.Compare(KFSMailContentTypeMultipartRelated) ||
-             !contentType.Compare(KFSMailContentTypeMultipartParallel))
+    else if (!contentType.Find(KFSMailContentTypeMultipartMixed) ||
+             !contentType.Find(KFSMailContentTypeMultipartAlternative) ||
+             !contentType.Find(KFSMailContentTypeMultipartDigest) ||
+             !contentType.Find(KFSMailContentTypeMultipartRelated) ||
+             !contentType.Find(KFSMailContentTypeMultipartParallel))
         {
         iContent = CEmailMultipart::NewL(iPluginData, msgContentId, part, EAPIOwns);
         }
@@ -422,7 +561,10 @@
             delete iTextContent; // Destroy old content
             }
         iTextContent = dynamic_cast<CEmailTextContent*>(textContent);
-        iTextContent->SetOwner( EAPIOwns );
+		if ( iTextContent )
+			{
+			iTextContent->SetOwner( EAPIOwns );
+			}
         return;
         }
     MEmailMultipart* mPart = aContent->AsMultipartOrNull();
@@ -433,7 +575,10 @@
             delete iContent;
             }
         iContent = dynamic_cast<CEmailMultipart*>(mPart);
-        iContent->SetOwner( EAPIOwns );
+		if ( iContent )
+			{
+			iContent->SetOwner( EAPIOwns );
+			}
         }    
     }
     
--- a/emailservices/emailclientapi/src/messageiterator.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailclientapi/src/messageiterator.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,10 +18,10 @@
 #include "emailmessage.h"
 #include "messageiterator.h"
 #include "emailapiutils.h"
-#include "CFSMailPlugin.h"
+#include "cfsmailplugin.h"
 #include "emailapiutils.h"
 #include "emailclientapi.hrh"
-#include "MFSMailIterator.h"
+#include "mfsmailiterator.h"
 
 // number of messages in chunk to retrive from protocol plugin. Actual chunk
 // size is one less because last element is used for reference to next chunk
--- a/emailservices/emaildebug/inc/emailtrace.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emaildebug/inc/emailtrace.h	Fri Feb 19 22:37:30 2010 +0200
@@ -347,7 +347,7 @@
 //
 #if defined(TIMESTAMP_TRAC)
 
-    #if defined(TRACE_INTO_FIL)
+    #if defined(TRACE_INTO_FILE)
 
         #define TIMESTAMP( aCaption )\
             {\
@@ -355,9 +355,9 @@
             t.HomeTime();\
             TDateTime dt = t.DateTime();\
             _LIT( KMsg, aCaption );\
-            _LIT( KFormat, "[TIMESTAMP] %S %d:%02d:%02d.%d us");\
+            _LIT( KFormat, "[TIMESTAMP] %d:%02d:%02d.%06d us %S");\
             RFileLogger::WriteFormat(  KEmailDir,  KEmailTraceFile, EFileLoggingModeAppend, KFormat,\
-                &KMsg, dt.Hour(), dt.Minute(), dt.Second(), dt.MicroSecond() );\
+                dt.Hour(), dt.Minute(), dt.Second(), dt.MicroSecond(), &KMsg );\
             }
 
     #else//TRACE_INTO_FILE not defined
@@ -368,9 +368,9 @@
             t.HomeTime();\
             TDateTime dt = t.DateTime();\
             _LIT( KMsg, aCaption );\
-            _LIT( KFormat, "[TIMESTAMP] %S %d:%02d:%02d.%d us");\
+            _LIT( KFormat, "[TIMESTAMP] %d:%02d:%02d.%06d us %S");\
             RDebug::Print( KFormat,\
-                &KMsg, dt.Hour(), dt.Minute(), dt.Second(), dt.MicroSecond() );\
+                dt.Hour(), dt.Minute(), dt.Second(), dt.MicroSecond(), &KMsg );\
             }
 
     #endif//TRACE_INTO_FILE
--- a/emailservices/emaildebug/inc/emailtraceconfig.hrh	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emaildebug/inc/emailtraceconfig.hrh	Fri Feb 19 22:37:30 2010 +0200
@@ -47,4 +47,20 @@
 
 #endif // ENABLE_TRACES
 
+#ifdef ENABLE_TIMESTAMP_TRACES
+#ifndef _DEBUG
+// Undefine error traces
+#undef ERROR_TRACE
+// Undefine info traces
+#undef INFO_TRACE
+// Undefine function traces
+#undef FUNC_TRACE
+// Trace to file
+#define TRACE_INTO_FILE
+// Timestamp trace enabled
+#define TIMESTAMP_TRAC
+#endif // _DEBUG
+#endif //ENABLE_TIMESTAMP_TRACES
+
+
 #endif // EMAILTRACECONFIG_HRH
--- a/emailservices/emailframework/commonlib/group/bld.inf	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/commonlib/group/bld.inf	Fri Feb 19 22:37:30 2010 +0200
@@ -18,15 +18,15 @@
 
 PRJ_EXPORTS
 
-../inc/CFSMailCommon.h |../../../../inc/CFSMailCommon.h
-../inc/CFSMailBox.h |../../../../inc/CFSMailBox.h
-../inc/CFSMailBoxBase.h |../../../../inc/CFSMailBoxBase.h
-../inc/CFSMailFolder.h |../../../../inc/CFSMailFolder.h
-../inc/CFSMailFolderBase.h |../../../../inc/CFSMailFolderBase.h
-../inc/CFSMailMessage.h |../../../../inc/CFSMailMessage.h
-../inc/CFSMailMessageBase.h |../../../../inc/CFSMailMessageBase.h
-../inc/CFSMailMessagePart.h |../../../../inc/CFSMailMessagePart.h
-../inc/CFSMailAddress.h |../../../../inc/CFSMailAddress.h
+../inc/cfsmailcommon.h |../../../../inc/cfsmailcommon.h
+../inc/cfsmailbox.h |../../../../inc/cfsmailbox.h
+../inc/cfsmailboxbase.h |../../../../inc/cfsmailboxbase.h
+../inc/cfsmailfolder.h |../../../../inc/cfsmailfolder.h
+../inc/cfsmailfolderbase.h |../../../../inc/cfsmailfolderbase.h
+../inc/cfsmailmessage.h |../../../../inc/cfsmailmessage.h
+../inc/cfsmailmessagebase.h |../../../../inc/cfsmailmessagebase.h
+../inc/cfsmailmessagepart.h |../../../../inc/cfsmailmessagepart.h
+../inc/cfsmailaddress.h |../../../../inc/cfsmailaddress.h
 ../inc/cemailextensionbase.h |../../../../inc/cemailextensionbase.h
 ../inc/cmrcalendarinfo.h |../../../../inc/cmrcalendarinfo.h
 ../inc/cmailmessageext.h |../../../../inc/cmailmessageext.h
--- a/emailservices/emailframework/commonlib/inc/CFSMailAddress.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/commonlib/inc/CFSMailAddress.h	Fri Feb 19 22:37:30 2010 +0200
@@ -23,7 +23,7 @@
 #include <e32std.h>
 #include <e32base.h>
 
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 
 /**
  *  email address handling
--- a/emailservices/emailframework/commonlib/inc/CFSMailBox.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/commonlib/inc/CFSMailBox.h	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 #ifndef CFSMAILBOX_H
 #define CFSMAILBOX_H
 
-#include "CFSMailBoxBase.h"
+#include "cfsmailboxbase.h"
 
 // forward declarations
 class CFSMailPlugin;
--- a/emailservices/emailframework/commonlib/inc/CFSMailBoxBase.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/commonlib/inc/CFSMailBoxBase.h	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 #ifndef __CFSMAILBOXBASE_H
 #define __CFSMAILBOXBASE_H
 
-#include "CFSMailFolder.h"
+#include "cfsmailfolder.h"
 #include "mmrinfoprocessor.h"
 #include "cemailextensionbase.h"
 
--- a/emailservices/emailframework/commonlib/inc/CFSMailFolder.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/commonlib/inc/CFSMailFolder.h	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 #ifndef __FSMAILFOLDER_H
 #define __FSMAILFOLDER_H
 
-#include "CFsMailFolderBase.h"
+#include "cfsmailfolderbase.h"
 #include "mfsmailiterator.h"
 
 // forward declarations
--- a/emailservices/emailframework/commonlib/inc/CFSMailFolderBase.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/commonlib/inc/CFSMailFolderBase.h	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 #ifndef __FSMAILFOLDERBASE_H
 #define __FSMAILFOLDERBASE_H
 
-#include "CFsMailMessage.h"
+#include "cfsmailmessage.h"
 #include "cemailextensionbase.h"
 
 /**
--- a/emailservices/emailframework/commonlib/inc/CFSMailIterator.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/commonlib/inc/CFSMailIterator.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,8 +21,8 @@
 
 //  INCLUDES
 //<cmail>
-#include "MFSMailIterator.h"
-#include "CFSMailMessage.h"
+#include "mfsmailiterator.h"
+#include "cfsmailmessage.h"
 //</cmail>
 
 /**
--- a/emailservices/emailframework/commonlib/inc/CFSMailMessage.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/commonlib/inc/CFSMailMessage.h	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 #define __CFSMAILMESSAGE_H
 
 //<cmail>
-#include "CFSMailMessagePart.h"
+#include "cfsmailmessagepart.h"
 //</cmail>
 
 /**
--- a/emailservices/emailframework/commonlib/inc/CFSMailMessageBase.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/commonlib/inc/CFSMailMessageBase.h	Fri Feb 19 22:37:30 2010 +0200
@@ -41,7 +41,7 @@
      *
      * @param aMessageId id of the email to be created
      */
-   	 IMPORT_C static CFSMailMessageBase* NewL(const TFSMailMsgId aMessageId);
+     IMPORT_C static CFSMailMessageBase* NewL(const TFSMailMsgId aMessageId);
     
     /**
      * Two-phased constructor.
@@ -61,21 +61,21 @@
      * @return message id
      */
      IMPORT_C TFSMailMsgId GetMessageId() const;
-  	 
- 	/**
+     
+    /**
      * if email is related to another email, for example due reply / forward,
      * related email id is returned
      *
      * @return related email id
      */
-  	 IMPORT_C TFSMailMsgId IsRelatedTo() const;
+     IMPORT_C TFSMailMsgId IsRelatedTo() const;
 
- 	/**
+    /**
      * set email related to another email, for example due reply / forward
      *
      * @param aMessageId related email id
      */
-  	 IMPORT_C void SetRelatedTo( const TFSMailMsgId aMessageId );
+     IMPORT_C void SetRelatedTo( const TFSMailMsgId aMessageId );
 
     /**
      * email parent folder id accessor
@@ -159,7 +159,7 @@
      *
      * @param aRecipient new recipient email address
      */
-  	 IMPORT_C void AppendBCCRecipient( CFSMailAddress* aRecipient );
+     IMPORT_C void AppendBCCRecipient( CFSMailAddress* aRecipient );
 
     /**
      * clears email TO-recipients list
@@ -226,7 +226,7 @@
      *
      * @aFlag email flag to be reset
      */
-	 IMPORT_C void ResetFlag(const TInt aFlag);
+     IMPORT_C void ResetFlag(const TInt aFlag);
 
     /**
      * test email flag is set
@@ -253,10 +253,10 @@
      IMPORT_C void SetReplyToAddress(CFSMailAddress* aReplyToAddress);
 
      /**
-	  * plugin request handler accessor
-	  * 
-	  * @return request handler
-	  */
+      * plugin request handler accessor
+      * 
+      * @return request handler
+      */
      IMPORT_C CFSMailRequestHandler& RequestHandler( );
           
 public: // from  CExtendableEmail
@@ -287,43 +287,43 @@
      TFSMailMsgId    iMessageId;
 
  private: 
-	 
+     
     /**
      * ConstructL
      */
-     void ConstructL( const TFSMailMsgId aMessageId );	 
+     void ConstructL( const TFSMailMsgId aMessageId );   
 protected:
     // Request handler from tls 
-    CFSMailRequestHandler* 			iRequestHandler;	
+    CFSMailRequestHandler*          iRequestHandler;    
  private: // data
 
- 	/**
+    /**
      * id of another email or part this object is related to
      * due some reason, like in reply or forward email use cases
      */
-	 TFSMailMsgId    iRelatedTo;
+     TFSMailMsgId    iRelatedTo;
 
- 	/**
+    /**
      * email mailbox id
      */
      TFSMailMsgId    iMailBoxId;
 
- 	/**
+    /**
      * email parent folder id
      */
      TFSMailMsgId    iFolderId;
 
- 	/**
+    /**
      * email sender address
      */
      CFSMailAddress*    iSender;
 
- 	/**
+    /**
      * email reply-to address
      */
      CFSMailAddress*    iReplyTo;
 
-	/**
+    /**
      * email recipients, to/cc/bcc
      */
      RPointerArray<CFSMailAddress> iToRecipients;
@@ -334,7 +334,7 @@
      * email subject
      */
      HBufC*             iSubject;
- 		 
+         
     /**
      * email flags
      */
@@ -343,7 +343,7 @@
     /**
      * email date
      */
-     TTime              iDate;	 
+     TTime              iDate;   
 };
 
 
--- a/emailservices/emailframework/commonlib/inc/CFSMailPluginData.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/commonlib/inc/CFSMailPluginData.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,7 +21,7 @@
 
 //  INCLUDES
 //<cmail>
-#include "CFSMailPlugin.h"
+#include "cfsmailplugin.h"
 //</cmail>
 
 /**
--- a/emailservices/emailframework/commonlib/inc/CFSMailRequestHandler.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/commonlib/inc/CFSMailRequestHandler.h	Fri Feb 19 22:37:30 2010 +0200
@@ -20,8 +20,8 @@
 #define CFSMAILREQUESTHANDLER_H
 
 //  INCLUDES
-#include "CFSMailPlugin.h"
-#include "CFSMailPluginData.h"
+#include "cfsmailplugin.h"
+#include "cfsmailplugindata.h"
 
 // FORWARD DECLARATIONS
 class CFSMailRequestObserver;
--- a/emailservices/emailframework/commonlib/inc/CFSMailRequestObserver.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/commonlib/inc/CFSMailRequestObserver.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,10 +21,10 @@
 
 //  INCLUDES
 //<cmail>
-#include "MFSMailRequestObserver.h"
-#include "CFSMailPlugin.h"
+#include "mfsmailrequestobserver.h"
+#include "cfsmailplugin.h"
 //</cmail>
-#include "CFSMailRequestHandler.h"
+#include "cfsmailrequesthandler.h"
 
 /**
  *  asynchronous request observer
--- a/emailservices/emailframework/commonlib/inc/mmrinfoprocessor.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/commonlib/inc/mmrinfoprocessor.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,7 +21,7 @@
 
 #include <e32base.h>
 //<cmail>
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 //</cmail>
 
 // Forward declaration
--- a/emailservices/emailframework/commonlib/src/CFSMailAddress.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/commonlib/src/CFSMailAddress.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,7 +18,7 @@
 
 //<cmail>
 #include "emailtrace.h"
-#include "CFSMailAddress.h"
+#include "cfsmailaddress.h"
 //</cmail>
 
 // ================= MEMBER FUNCTIONS ==========================================
@@ -59,11 +59,11 @@
 CFSMailAddress::CFSMailAddress()
     {
     FUNC_LOG;
-	iEmailAddress = HBufC::New(1);
-	iEmailAddress->Des().Copy(KNullDesC());
+    iEmailAddress = HBufC::New(1);
+    iEmailAddress->Des().Copy(KNullDesC());
 
-	iDisplayName = HBufC::New(1);
-	iDisplayName->Des().Copy(KNullDesC());
+    iDisplayName = HBufC::New(1);
+    iDisplayName->Des().Copy(KNullDesC());
     }
 
 // -----------------------------------------------------------------------------
@@ -72,17 +72,17 @@
 EXPORT_C CFSMailAddress::~CFSMailAddress()
     {
     FUNC_LOG;
-	if(iEmailAddress)
-		{
-		delete iEmailAddress;
-		}
-	iEmailAddress = NULL;
-		
-	if (iDisplayName)
-		{
-		delete iDisplayName;
-		}
-	iDisplayName = NULL;
+    if(iEmailAddress)
+        {
+        delete iEmailAddress;
+        }
+    iEmailAddress = NULL;
+        
+    if (iDisplayName)
+        {
+        delete iDisplayName;
+        }
+    iDisplayName = NULL;
     }
 
 // -----------------------------------------------------------------------------
@@ -91,7 +91,7 @@
 EXPORT_C TDesC& CFSMailAddress::GetEmailAddress() const
     {
     FUNC_LOG;
-	return *iEmailAddress;
+    return *iEmailAddress;
     }
 
 // -----------------------------------------------------------------------------
@@ -100,16 +100,16 @@
 EXPORT_C void CFSMailAddress::SetEmailAddress(const TDesC& aAddress)
     {
     FUNC_LOG;
-	// init mailbox name
-	HBufC* address = HBufC::New(aAddress.Length());
-	
-	// store new mailbox name
-	if(address)
+    // init mailbox name
+    HBufC* address = HBufC::New(aAddress.Length());
+    
+    // store new mailbox name
+    if(address)
         {
-		delete iEmailAddress;
-		iEmailAddress = address;
-		iEmailAddress->Des().Copy(aAddress);
-	    }
+        delete iEmailAddress;
+        iEmailAddress = address;
+        iEmailAddress->Des().Copy(aAddress);
+        }
 
     }
 
@@ -119,7 +119,7 @@
 EXPORT_C TDesC& CFSMailAddress::GetDisplayName() const
     {
     FUNC_LOG;
-	return *iDisplayName;
+    return *iDisplayName;
     }
 
 // -----------------------------------------------------------------------------
@@ -128,15 +128,15 @@
 EXPORT_C void CFSMailAddress::SetDisplayName(const TDesC& aDisplayName)
     {
     FUNC_LOG;
-	// init mailbox name
-	HBufC* name = HBufC::New(aDisplayName.Length());
-	
-	// store new mailbox name
-	if(name)
-	    {
-		delete iDisplayName;
-		iDisplayName = name;
-		iDisplayName->Des().Copy(aDisplayName);
+    // init mailbox name
+    HBufC* name = HBufC::New(aDisplayName.Length());
+    
+    // store new mailbox name
+    if(name)
+        {
+        delete iDisplayName;
+        iDisplayName = name;
+        iDisplayName->Des().Copy(aDisplayName);
         }
     }
 
--- a/emailservices/emailframework/commonlib/src/CFSMailBox.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/commonlib/src/CFSMailBox.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -19,11 +19,11 @@
 #include <bamdesca.h>
 
 
-#include "CFSMailPlugin.h"
+#include "cfsmailplugin.h"
 #include "cmrcalendarinfoimpl.h"
 
-#include "CFSMailBox.h"
-#include "CFSMailRequestObserver.h"
+#include "cfsmailbox.h"
+#include "cfsmailrequestobserver.h"
 
 const TInt KMaxMruEntries( 150 );
 
@@ -57,8 +57,8 @@
 CFSMailBox::CFSMailBox()
 {
     FUNC_LOG;
-	// get requesthandler pointer
-	iRequestHandler = static_cast<CFSMailRequestHandler*>(Dll::Tls());
+    // get requesthandler pointer
+    iRequestHandler = static_cast<CFSMailRequestHandler*>(Dll::Tls());
 }
 
 // -----------------------------------------------------------------------------
@@ -67,7 +67,7 @@
 EXPORT_C CFSMailBox::~CFSMailBox()
 {
     FUNC_LOG;
-	iFolders.ResetAndDestroy();
+    iFolders.ResetAndDestroy();
 }
 
 // -----------------------------------------------------------------------------
@@ -89,11 +89,11 @@
 EXPORT_C void CFSMailBox::GoOnlineL()
     {
     FUNC_LOG;
-	
-	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
-		{
-	    plugin->GoOnlineL( GetId() );
-		}
+    
+    if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
+        {
+        plugin->GoOnlineL( GetId() );
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -103,11 +103,11 @@
     {
     FUNC_LOG;
     
-	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
-		{
-	    plugin->GoOfflineL( GetId() );
-		}
-		
+    if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
+        {
+        plugin->GoOfflineL( GetId() );
+        }
+        
     }
 
 // -----------------------------------------------------------------------------
@@ -116,11 +116,11 @@
 EXPORT_C void CFSMailBox::CancelSyncL()
     {
     FUNC_LOG;
-	
-	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
-		{
-	    plugin->CancelSyncL( GetId() );
-		}
+    
+    if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
+        {
+        plugin->CancelSyncL( GetId() );
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -130,11 +130,11 @@
     {
     FUNC_LOG;
     TFSProgress progress;
-	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
-		{
-	    progress = plugin->GetLastSyncStatusL( GetId() );		
-		}
-	return progress;
+    if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
+        {
+        progress = plugin->GetLastSyncStatusL( GetId() );       
+        }
+    return progress;
     }
 
 // -----------------------------------------------------------------------------
@@ -145,21 +145,21 @@
     {
     FUNC_LOG;
 
-	TFSPendingRequest request;
-	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
-		{
-		// init asynchronous request
-    	request = iRequestHandler->InitAsyncRequestL( GetId().PluginId(),
-    													aOperationObserver );
-    	MFSMailRequestObserver* observer = request.iObserver;
-    	TRAPD(err,plugin->RefreshNowL( GetId(), *observer, request.iRequestId));
-    	if(err != KErrNone)
-			{
-			iRequestHandler->CompleteRequest(request.iRequestId);
-			User::Leave(err);
-			}
-		}
- 	return request.iRequestId;
+    TFSPendingRequest request;
+    if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
+        {
+        // init asynchronous request
+        request = iRequestHandler->InitAsyncRequestL( GetId().PluginId(),
+                                                        aOperationObserver );
+        MFSMailRequestObserver* observer = request.iObserver;
+        TRAPD(err,plugin->RefreshNowL( GetId(), *observer, request.iRequestId));
+        if(err != KErrNone)
+            {
+            iRequestHandler->CompleteRequest(request.iRequestId);
+            User::Leave(err);
+            }
+        }
+    return request.iRequestId;
 
    }
 
@@ -170,22 +170,22 @@
     {
     FUNC_LOG;
 
-	TFSPendingRequest request;
+    TFSPendingRequest request;
     MFSMailRequestObserver* observer = NULL;
-   	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
-		{
-		// init asynchronous request
+    if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
+        {
+        // init asynchronous request
         request = iRequestHandler->InitAsyncRequestL( GetId().PluginId(), *observer );
-    	
-    	observer = request.iObserver;
-    	TRAPD(err,plugin->RefreshNowL( GetId(), *observer, request.iRequestId));
-    	if(err != KErrNone)
-			{
-			iRequestHandler->CompleteRequest(request.iRequestId);
-			User::Leave(err);
-			}
-		}
- 	return request.iRequestId;
+        
+        observer = request.iObserver;
+        TRAPD(err,plugin->RefreshNowL( GetId(), *observer, request.iRequestId));
+        if(err != KErrNone)
+            {
+            iRequestHandler->CompleteRequest(request.iRequestId);
+            User::Leave(err);
+            }
+        }
+    return request.iRequestId;
 
    }
 
@@ -196,60 +196,60 @@
 {
     FUNC_LOG;
 
-	CFSMailMessage* message = NULL;
-	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
-		{
-		TRAPD(err,message = plugin->CreateMessageToSendL( GetId() ));
-		if(err != KErrNone)
-			{
-			message = NULL;
-			}
-		}
-	return message;
+    CFSMailMessage* message = NULL;
+    if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
+        {
+        TRAPD(err,message = plugin->CreateMessageToSendL( GetId() ));
+        if(err != KErrNone)
+            {
+            message = NULL;
+            }
+        }
+    return message;
 }
 
 // -----------------------------------------------------------------------------
 // CFSMailBox::CreateForwardMessage
 // -----------------------------------------------------------------------------
-EXPORT_C CFSMailMessage* CFSMailBox::CreateForwardMessage( 	TFSMailMsgId aOriginalMessageId,
-															const TDesC& aHeaderDescriptor )
+EXPORT_C CFSMailMessage* CFSMailBox::CreateForwardMessage(  TFSMailMsgId aOriginalMessageId,
+                                                            const TDesC& aHeaderDescriptor )
 {
     FUNC_LOG;
-	CFSMailMessage* message = NULL;
-	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
-		{
-		TRAPD(err,message = plugin->CreateForwardMessageL( GetId(), 
-																aOriginalMessageId,
-																aHeaderDescriptor ));
-		if(err != KErrNone)
-			{
-			message = NULL;
-			}
-		}
-	return message;
+    CFSMailMessage* message = NULL;
+    if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
+        {
+        TRAPD(err,message = plugin->CreateForwardMessageL( GetId(), 
+                                                                aOriginalMessageId,
+                                                                aHeaderDescriptor ));
+        if(err != KErrNone)
+            {
+            message = NULL;
+            }
+        }
+    return message;
 }
 
 // -----------------------------------------------------------------------------
 // CFSMailBox::CreateReplyMessage
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailMessage* CFSMailBox::CreateReplyMessage( TFSMailMsgId aOriginalMessageId,
-														 TBool aReplyToAll,
-														 const TDesC& aHeaderDescriptor )
+                                                         TBool aReplyToAll,
+                                                         const TDesC& aHeaderDescriptor )
 {
     FUNC_LOG;
-	CFSMailMessage* message = NULL;
-	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
-		{
-		TRAPD(err,message = plugin->CreateReplyMessageL( GetId(),
-															aOriginalMessageId,
-															aReplyToAll,
-															aHeaderDescriptor ));
-		if(err != KErrNone)
-			{
-			message = NULL;
-			}
-		}
-	return message;
+    CFSMailMessage* message = NULL;
+    if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
+        {
+        TRAPD(err,message = plugin->CreateReplyMessageL( GetId(),
+                                                            aOriginalMessageId,
+                                                            aReplyToAll,
+                                                            aHeaderDescriptor ));
+        if(err != KErrNone)
+            {
+            message = NULL;
+            }
+        }
+    return message;
 }
 
 // -----------------------------------------------------------------------------
@@ -259,16 +259,16 @@
 {
     FUNC_LOG;
 
-	TFSMailMsgId folderId;
-	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
-		{
-		TRAPD(err, folderId = plugin->GetStandardFolderIdL(GetId(), aFolderType ));
-		if(err != KErrNone)
-			{
-			folderId.SetNullId();
-			}
-		}
-	return folderId;
+    TFSMailMsgId folderId;
+    if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
+        {
+        TRAPD(err, folderId = plugin->GetStandardFolderIdL(GetId(), aFolderType ));
+        if(err != KErrNone)
+            {
+            folderId.SetNullId();
+            }
+        }
+    return folderId;
 }
 
 // -----------------------------------------------------------------------------
@@ -277,50 +277,50 @@
 EXPORT_C void CFSMailBox::SendMessageL( CFSMailMessage& aMessage )
     {
     FUNC_LOG;
-	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
-		{
-		UpdateMrusL( aMessage.GetToRecipients(),
-		           	 aMessage.GetCCRecipients(),
-		        	 aMessage.GetBCCRecipients() );
-		plugin->SendMessageL( aMessage );
-		
-		}
+    if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
+        {
+        UpdateMrusL( aMessage.GetToRecipients(),
+                     aMessage.GetCCRecipients(),
+                     aMessage.GetBCCRecipients() );
+        plugin->SendMessageL( aMessage );
+        
+        }
     }
 
 // -----------------------------------------------------------------------------
 // CFSMailBox::ListFolders
 // -----------------------------------------------------------------------------
-EXPORT_C void CFSMailBox::ListFolders( 	TFSMailMsgId aFolder,
-										RPointerArray<CFSMailFolder>& aFolderList)
+EXPORT_C void CFSMailBox::ListFolders(  TFSMailMsgId aFolder,
+                                        RPointerArray<CFSMailFolder>& aFolderList)
 {
     FUNC_LOG;
 
-	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
-	{
-		TRAPD(err, plugin->ListFoldersL(GetId(),aFolder,aFolderList));
-		if(err != KErrNone)
-			{
-			aFolderList.ResetAndDestroy();
-			}
-	}
+    if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
+    {
+        TRAPD(err, plugin->ListFoldersL(GetId(),aFolder,aFolderList));
+        if(err != KErrNone)
+            {
+            aFolderList.ResetAndDestroy();
+            }
+    }
 }
 
 // -----------------------------------------------------------------------------
 // CFSMailBox::ListFolders
 // -----------------------------------------------------------------------------
 EXPORT_C RPointerArray<CFSMailFolder>& CFSMailBox::ListFolders( )
-{	
-	iFolders.ResetAndDestroy();
-	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
-	{
-		TRAPD(err,plugin->ListFoldersL(GetId(),iFolders));
-		if(err != KErrNone)
-			{
-			iFolders.ResetAndDestroy();
-			}
-	}
+{   
+    iFolders.ResetAndDestroy();
+    if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
+    {
+        TRAPD(err,plugin->ListFoldersL(GetId(),iFolders));
+        if(err != KErrNone)
+            {
+            iFolders.ResetAndDestroy();
+            }
+    }
 
-	return iFolders;
+    return iFolders;
 }
 
 // -----------------------------------------------------------------------------
@@ -329,21 +329,21 @@
 EXPORT_C TDesC& CFSMailBox::GetBrandingIdL( )
 {
     FUNC_LOG;
-	return BrandingId();
+    return BrandingId();
 }
 
 // -----------------------------------------------------------------------------
 // CFSMailBox::MoveMessagesL
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailBox::MoveMessagesL( const RArray<TFSMailMsgId>& aMessageIds, 
-                            			 const TFSMailMsgId aSourceFolderId, 
-                            			 const TFSMailMsgId aDestinationFolderId )
+                                         const TFSMailMsgId aSourceFolderId, 
+                                         const TFSMailMsgId aDestinationFolderId )
 {
     FUNC_LOG;
-	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
-		{
-		plugin->MoveMessagesL(GetId(), aMessageIds, aSourceFolderId, aDestinationFolderId);
-		}
+    if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
+        {
+        plugin->MoveMessagesL(GetId(), aMessageIds, aSourceFolderId, aDestinationFolderId);
+        }
 }
 
 // -----------------------------------------------------------------------------
@@ -351,25 +351,25 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TInt CFSMailBox::MoveMessagesL( MFSMailRequestObserver& aOperationObserver,
                                          const RArray<TFSMailMsgId>& aMessageIds, 
-                            			 const TFSMailMsgId aSourceFolderId, 
-                            			 const TFSMailMsgId aDestinationFolderId )
+                                         const TFSMailMsgId aSourceFolderId, 
+                                         const TFSMailMsgId aDestinationFolderId )
 {
     FUNC_LOG;
     TFSPendingRequest request;
-	if( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) )
-		{
-		// init asynchronous request
-    	request = iRequestHandler->InitAsyncRequestL( GetId().PluginId(),
-    													aOperationObserver );        
+    if( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) )
+        {
+        // init asynchronous request
+        request = iRequestHandler->InitAsyncRequestL( GetId().PluginId(),
+                                                        aOperationObserver );        
         
-		plugin->MoveMessagesL(
-		    GetId(), 
-		    aMessageIds, 
-		    aSourceFolderId, 
-		    aDestinationFolderId, 
-		    aOperationObserver, 
-		    request.iRequestId );
-		}
+        plugin->MoveMessagesL(
+            GetId(), 
+            aMessageIds, 
+            aSourceFolderId, 
+            aDestinationFolderId, 
+            aOperationObserver, 
+            request.iRequestId );
+        }
     return request.iRequestId;
 }
 
@@ -377,118 +377,118 @@
 // CFSMailBox::CopyMessagesL
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailBox::CopyMessagesL( const RArray<TFSMailMsgId>& aMessageIds, 
- 										 RArray<TFSMailMsgId>& aNewMessages, 
-                                     	 const TFSMailMsgId aSourceFolderId, 
-                                    	 const TFSMailMsgId aDestinationFolderId )
+                                         RArray<TFSMailMsgId>& aNewMessages, 
+                                         const TFSMailMsgId aSourceFolderId, 
+                                         const TFSMailMsgId aDestinationFolderId )
 {
     FUNC_LOG;
-	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
-		{
-		plugin->CopyMessagesL(GetId(), aMessageIds, aNewMessages,
-								aSourceFolderId, aDestinationFolderId );	
-		}
+    if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
+        {
+        plugin->CopyMessagesL(GetId(), aMessageIds, aNewMessages,
+                                aSourceFolderId, aDestinationFolderId );    
+        }
 }
 
 // -----------------------------------------------------------------------------
 // CFSMailBox::SearchL
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailBox::SearchL( const RPointerArray<TDesC>& /*aSearchStrings*/,
-								   const TFSMailSortCriteria&  /*aSortCriteria*/,
-					 			   MFSMailBoxSearchObserver&   /*aSearchObserver*/,
+                                   const TFSMailSortCriteria&  /*aSortCriteria*/,
+                                   MFSMailBoxSearchObserver&   /*aSearchObserver*/,
                                    const RArray<TFSMailMsgId>  /*aFolderIds */ )
-	{
+    {
     FUNC_LOG;
 
-	}
-	
+    }
+    
 // -----------------------------------------------------------------------------
 // CFSMailBox::SearchL
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailBox::SearchL( const RPointerArray<TDesC>& aSearchStrings,
-								   const TFSMailSortCriteria& aSortCriteria,
-					 			   MFSMailBoxSearchObserver& aSearchObserver )
-	{
+                                   const TFSMailSortCriteria& aSortCriteria,
+                                   MFSMailBoxSearchObserver& aSearchObserver )
+    {
     FUNC_LOG;
-	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
-		{
+    if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
+        {
 
-		// get mailbox folder list
-		iFolders.ResetAndDestroy();
-		plugin->ListFoldersL(GetId(),iFolders);
+        // get mailbox folder list
+        iFolders.ResetAndDestroy();
+        plugin->ListFoldersL(GetId(),iFolders);
 
-		TFSMailMsgId draftsFolderId = GetStandardFolderId( EFSDraftsFolder );
-		TFSMailMsgId outboxId = GetStandardFolderId( EFSOutbox );
-		
-		// remove outbox, drafts folder from folder list
-		RArray<TFSMailMsgId> folderIds;
-		folderIds.Reset();
-		for(TInt i=0;i<iFolders.Count();i++)
-		{
-			TFSMailMsgId id = iFolders[i]->GetFolderId();
-			if(	id != draftsFolderId && id != outboxId )
-			{
-				folderIds.Append(id);
-			}
-		}
-		
-		// start search
-		plugin->SearchL( GetId(), folderIds, aSearchStrings, aSortCriteria, aSearchObserver );
-		folderIds.Reset();
-		}
-	}
+        TFSMailMsgId draftsFolderId = GetStandardFolderId( EFSDraftsFolder );
+        TFSMailMsgId outboxId = GetStandardFolderId( EFSOutbox );
+        
+        // remove outbox, drafts folder from folder list
+        RArray<TFSMailMsgId> folderIds;
+        folderIds.Reset();
+        for(TInt i=0;i<iFolders.Count();i++)
+        {
+            TFSMailMsgId id = iFolders[i]->GetFolderId();
+            if( id != draftsFolderId && id != outboxId )
+            {
+                folderIds.Append(id);
+            }
+        }
+        
+        // start search
+        plugin->SearchL( GetId(), folderIds, aSearchStrings, aSortCriteria, aSearchObserver );
+        folderIds.Reset();
+        }
+    }
 
 // -----------------------------------------------------------------------------
 // CFSMailBox::CancelSearch
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailBox::CancelSearch()
-	{
+    {
     FUNC_LOG;
-	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
-		{
-		plugin->CancelSearch( GetId() );
-		}
-	}
+    if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
+        {
+        plugin->CancelSearch( GetId() );
+        }
+    }
 
 // -----------------------------------------------------------------------------
 // CFSMailBox::ClearSearchResultCache
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailBox::ClearSearchResultCache()
-	{
+    {
     FUNC_LOG;
-	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
-		{
-		plugin->ClearSearchResultCache( GetId() );
-		}
-	}
+    if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
+        {
+        plugin->ClearSearchResultCache( GetId() );
+        }
+    }
 
 // -----------------------------------------------------------------------------
 // CFSMailBox::ListMrusL
 // -----------------------------------------------------------------------------
 EXPORT_C MDesCArray* CFSMailBox::ListMrusL() const
-	{
+    {
     FUNC_LOG;
-	MDesCArray* mruList(0);
-	if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId() ) )
-		{
-   		mruList = plugin->GetMrusL( GetId() );
-		}
-	return mruList;
-	}
+    MDesCArray* mruList(0);
+    if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId() ) )
+        {
+        mruList = plugin->GetMrusL( GetId() );
+        }
+    return mruList;
+    }
 
 
 // -----------------------------------------------------------------------------
 // CFSMailBox::CurrentSyncState
 // -----------------------------------------------------------------------------
 EXPORT_C TSSMailSyncState CFSMailBox::CurrentSyncState() const
-	{
+    {
     FUNC_LOG;
-	TSSMailSyncState syncState(Idle);
-	if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) )
-		{
-		syncState = plugin->CurrentSyncState( GetId() );
-		}
-	return syncState;
-	}
+    TSSMailSyncState syncState(Idle);
+    if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) )
+        {
+        syncState = plugin->CurrentSyncState( GetId() );
+        }
+    return syncState;
+    }
 
 // -----------------------------------------------------------------------------
 // CFSMailBox::HasCapability
@@ -496,16 +496,16 @@
 EXPORT_C TBool CFSMailBox::HasCapability( const TFSMailBoxCapabilities aCapability ) const
 {
     FUNC_LOG;
-	TBool capability = EFalse;
-	if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) )
-		{
-		TRAPD( err,capability = plugin->MailboxHasCapabilityL( aCapability,GetId() )) ;
-		if ( err != KErrNone )
-			{
-			capability = EFalse;
-			}
-		}
-	return capability;
+    TBool capability = EFalse;
+    if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) )
+        {
+        TRAPD( err,capability = plugin->MailboxHasCapabilityL( aCapability,GetId() )) ;
+        if ( err != KErrNone )
+            {
+            capability = EFalse;
+            }
+        }
+    return capability;
 }
 
 // -----------------------------------------------------------------------------
@@ -514,12 +514,12 @@
 EXPORT_C TFSMailBoxStatus CFSMailBox::GetMailBoxStatus()
 {
     FUNC_LOG;
-	TFSMailBoxStatus status(EFSMailBoxOffline);
-	if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId() ) )
-	{
-		status = plugin->GetMailBoxStatus( GetId() );
-	}
-	return status;
+    TFSMailBoxStatus status(EFSMailBoxOffline);
+    if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId() ) )
+    {
+        status = plugin->GetMailBoxStatus( GetId() );
+    }
+    return status;
 }
 
 // -----------------------------------------------------------------------------
@@ -528,10 +528,10 @@
 EXPORT_C void CFSMailBox::SetCredentialsL( const TDesC& aUsername, const TDesC& aPassword )
     {
     FUNC_LOG;
-	if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId() ) )
-		{
-	    plugin->SetCredentialsL( GetId(), aUsername, aPassword );
-		}
+    if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId() ) )
+        {
+        plugin->SetCredentialsL( GetId(), aUsername, aPassword );
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -611,7 +611,7 @@
     // whose content we can later alter as we wish
     MDesCArray* currentMruList( NULL );
 
-	CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId());
+    CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId());
     if ( !plugin )
         {
         User::Leave( KErrGeneral );
--- a/emailservices/emailframework/commonlib/src/CFSMailBoxBase.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/commonlib/src/CFSMailBoxBase.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,7 +18,7 @@
 #include <AknUtils.h>           // AknTextUtils
     
 #include "emailtrace.h"
-#include "CFSMailBoxBase.h"
+#include "cfsmailboxbase.h"
 
 _LIT( KCharsToReplace, "\r\n\t\x2028\x2029" );
 
--- a/emailservices/emailframework/commonlib/src/CFSMailFolder.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/commonlib/src/CFSMailFolder.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,12 +18,12 @@
 
 //<cmail>
 #include "emailtrace.h"
-#include "CFSMailFolder.h"
-#include "CFSMailPlugin.h"
+#include "cfsmailfolder.h"
+#include "cfsmailplugin.h"
 //</cmail>
 
-#include "CFSMailIterator.h"
-#include "CFSMailRequestObserver.h"
+#include "cfsmailiterator.h"
+#include "cfsmailrequestobserver.h"
 
 // ================= MEMBER FUNCTIONS ==========================================
 // -----------------------------------------------------------------------------
--- a/emailservices/emailframework/commonlib/src/CFSMailFolderBase.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/commonlib/src/CFSMailFolderBase.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,7 +18,7 @@
 
 //<cmail>
 #include "emailtrace.h"
-#include "CFSMailFolderBase.h"
+#include "cfsmailfolderbase.h"
 //</cmail>
 
 // ================= MEMBER FUNCTIONS ==========================================
--- a/emailservices/emailframework/commonlib/src/CFSMailIterator.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/commonlib/src/CFSMailIterator.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -17,7 +17,7 @@
 
 
 #include "emailtrace.h"
-#include "CFSMailIterator.h"
+#include "cfsmailiterator.h"
 
 // ================= MEMBER FUNCTIONS ==========================================
 // -----------------------------------------------------------------------------
--- a/emailservices/emailframework/commonlib/src/CFSMailMessage.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/commonlib/src/CFSMailMessage.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -20,9 +20,9 @@
 #include <apmrec.h>
 #include <mmf/common/mmfcontrollerpluginresolver.h> // CleanupResetAndDestroy
 
-#include "CFSMailMessage.h"
-#include "CFSMailPlugin.h"
-#include "CFSMailRequestHandler.h"
+#include "cfsmailmessage.h"
+#include "cfsmailplugin.h"
+#include "cfsmailrequesthandler.h"
 
 // ================= MEMBER FUNCTIONS ==========================================
 
--- a/emailservices/emailframework/commonlib/src/CFSMailMessageBase.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/commonlib/src/CFSMailMessageBase.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -16,9 +16,9 @@
 */
 
 
-#include "CFSMailRequestHandler.h"
+#include "cfsmailrequesthandler.h"
 #include "emailtrace.h"
-#include "CFSMailMessageBase.h"
+#include "cfsmailmessagebase.h"
 #include "cmailmessageext.h"
 
 // ================= MEMBER FUNCTIONS ==========================================
--- a/emailservices/emailframework/commonlib/src/CFSMailMessagePart.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/commonlib/src/CFSMailMessagePart.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -21,11 +21,11 @@
 #include <mmf/common/mmfcontrollerpluginresolver.h> // CleanupResetAndDestroy
 
 //<cmail>
-#include "CFSMailMessagePart.h"
-#include "CFSMailPlugin.h"
+#include "cfsmailmessagepart.h"
+#include "cfsmailplugin.h"
 //</cmail>
 
-#include "CFSMailRequestObserver.h"
+#include "cfsmailrequestobserver.h"
 
 
 // ================= MEMBER FUNCTIONS ==========================================
--- a/emailservices/emailframework/commonlib/src/CFSMailPluginData.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/commonlib/src/CFSMailPluginData.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -17,7 +17,7 @@
 
 
 #include "emailtrace.h"
-#include "CFSMailPluginData.h"
+#include "cfsmailplugindata.h"
 
 // -----------------------------------------------------------------------------
 // CFSMailPluginData::CFSMailPluginData
--- a/emailservices/emailframework/commonlib/src/CFSMailRequestHandler.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/commonlib/src/CFSMailRequestHandler.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -17,11 +17,11 @@
 
 
 #include "emailtrace.h"
-#include "CFSMailRequestHandler.h"
-#include "CFSMailRequestObserver.h"
+#include "cfsmailrequesthandler.h"
+#include "cfsmailrequestobserver.h"
 
 
-// ================= MEMBER FUNCTIONS ==========================================	
+// ================= MEMBER FUNCTIONS ==========================================    
 // -----------------------------------------------------------------------------
 // CFSMailRequestHandler::CFSMailRequestHandler
 // -----------------------------------------------------------------------------
@@ -29,14 +29,14 @@
 {
     FUNC_LOG;
 
-	// store pointer to TLS
-	TInt err = Dll::SetTls(static_cast<TAny*>(this));
+    // store pointer to TLS
+    TInt err = Dll::SetTls(static_cast<TAny*>(this));
 
-	// reset 
-	iPendingRequests.Reset();
-	iPluginList.Reset();
-	
-	iTempDirName =NULL;
+    // reset 
+    iPendingRequests.Reset();
+    iPluginList.Reset();
+    
+    iTempDirName =NULL;
 }
 
 // -----------------------------------------------------------------------------
@@ -62,8 +62,8 @@
 // CFSMailRequestHandler::NewLC
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailRequestHandler* CFSMailRequestHandler::NewLC( 
-									RPointerArray<CImplementationInformation>& aPluginInfo,
-									RPointerArray<CFSMailPlugin>& aPlugins )
+                                    RPointerArray<CImplementationInformation>& aPluginInfo,
+                                    RPointerArray<CFSMailPlugin>& aPlugins )
 {
     FUNC_LOG;
   CFSMailRequestHandler* pluginHandler = new (ELeave) CFSMailRequestHandler();
@@ -76,12 +76,12 @@
 // CFSMailRequestHandler::NewL
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailRequestHandler* CFSMailRequestHandler::NewL( 
-									RPointerArray<CImplementationInformation>& aPluginInfo,
-									RPointerArray<CFSMailPlugin>& aPlugins )
+                                    RPointerArray<CImplementationInformation>& aPluginInfo,
+                                    RPointerArray<CFSMailPlugin>& aPlugins )
 {
     FUNC_LOG;
   CFSMailRequestHandler* pluginHandler =  
-  				CFSMailRequestHandler::NewLC( aPluginInfo, aPlugins );
+                CFSMailRequestHandler::NewLC( aPluginInfo, aPlugins );
   CleanupStack:: Pop(pluginHandler);
   return pluginHandler;
 }
@@ -90,8 +90,8 @@
 // CFSMailRequestHandler::ConstructL
 // -----------------------------------------------------------------------------
 void CFSMailRequestHandler::ConstructL( 
-								RPointerArray<CImplementationInformation> /*aPluginInfo*/,
-								RPointerArray<CFSMailPlugin> /*aPlugins*/ )
+                                RPointerArray<CImplementationInformation> /*aPluginInfo*/,
+                                RPointerArray<CFSMailPlugin> /*aPlugins*/ )
 {
     FUNC_LOG;
 
@@ -102,125 +102,125 @@
 // CFSMailRequestHandler::GetPluginByUid
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailPlugin* CFSMailRequestHandler::GetPluginByUid(TFSMailMsgId aObjectId)
-	{
+    {
     FUNC_LOG;
 
-	for(TInt i=0;i<iPluginList.Count();i++)
-		{
-		if(iPluginList[i]->iPluginId.iUid == aObjectId.PluginId().iUid)
-			{
-			return iPluginList[i]->iPlugin;
-			}
-		}
+    for(TInt i=0;i<iPluginList.Count();i++)
+        {
+        if(iPluginList[i]->iPluginId.iUid == aObjectId.PluginId().iUid)
+            {
+            return iPluginList[i]->iPlugin;
+            }
+        }
 
 
-	return NULL;
-	}
-	
+    return NULL;
+    }
+    
 // -----------------------------------------------------------------------------
 // CFSMailRequestHandler::InitAsyncRequestL
 // -----------------------------------------------------------------------------
 EXPORT_C TFSPendingRequest CFSMailRequestHandler::InitAsyncRequestL( 
-													TUid aPluginId,
-													MFSMailRequestObserver& aOperationObserver)
-	{
+                                                    TUid aPluginId,
+                                                    MFSMailRequestObserver& aOperationObserver)
+    {
     FUNC_LOG;
-		TFSPendingRequest newRequest;
-		for(TInt i=0;i<iPendingRequests.Count();i++)
-			{
-			if(iPendingRequests[i].iRequestStatus != TFSPendingRequest::EFSRequestPending)
-				{
-				iPendingRequests[i].iPluginId = aPluginId;
-				iPendingRequests[i].iRequestStatus = TFSPendingRequest::EFSRequestPending;
-				iPendingRequests[i].iObserver->SetUserObserver(aOperationObserver);			
-				newRequest = iPendingRequests[i];
-				return newRequest;
-				}
-			}
+        TFSPendingRequest newRequest;
+        for(TInt i=0;i<iPendingRequests.Count();i++)
+            {
+            if(iPendingRequests[i].iRequestStatus != TFSPendingRequest::EFSRequestPending)
+                {
+                iPendingRequests[i].iPluginId = aPluginId;
+                iPendingRequests[i].iRequestStatus = TFSPendingRequest::EFSRequestPending;
+                iPendingRequests[i].iObserver->SetUserObserver(aOperationObserver);         
+                newRequest = iPendingRequests[i];
+                return newRequest;
+                }
+            }
 
-		newRequest.iRequestId = iPendingRequests.Count();
-		newRequest.iPluginId = aPluginId;
-		newRequest.iRequestStatus = TFSPendingRequest::EFSRequestPending;			
-    	CFSMailRequestObserver* observer = 
-    		CFSMailRequestObserver::NewL(*this, aOperationObserver);
-		newRequest.iObserver = observer;
-		iPendingRequests.Append(newRequest);
-    	
-		return newRequest;
-	}
+        newRequest.iRequestId = iPendingRequests.Count();
+        newRequest.iPluginId = aPluginId;
+        newRequest.iRequestStatus = TFSPendingRequest::EFSRequestPending;           
+        CFSMailRequestObserver* observer = 
+            CFSMailRequestObserver::NewL(*this, aOperationObserver);
+        newRequest.iObserver = observer;
+        iPendingRequests.Append(newRequest);
+        
+        return newRequest;
+    }
 
 // -----------------------------------------------------------------------------
 // CFSMailRequestHandler::CompleteRequest
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailRequestHandler::CompleteRequest( TInt aRequestId )
-	{
+    {
     FUNC_LOG;
-		for(TInt i=0;i<iPendingRequests.Count();i++)
-		{
-		if(iPendingRequests[i].iRequestId == aRequestId)
-			{
-			iPendingRequests[i].iRequestStatus = TFSPendingRequest::EFSRequestComplete;
-			break;
-			}
-		}
+        for(TInt i=0;i<iPendingRequests.Count();i++)
+        {
+        if(iPendingRequests[i].iRequestId == aRequestId)
+            {
+            iPendingRequests[i].iRequestStatus = TFSPendingRequest::EFSRequestComplete;
+            break;
+            }
+        }
 
-	}
-	
+    }
+    
 // -----------------------------------------------------------------------------
 // CFSMailRequestHandler::CancelRequestL
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailRequestHandler::CancelRequestL( TInt aRequestId )
-	{
+    {
     FUNC_LOG;
-		for(TInt i=0;i<iPendingRequests.Count();i++)
-		{
-		if(iPendingRequests[i].iRequestId == aRequestId &&
-			iPendingRequests[i].iRequestStatus == TFSPendingRequest::EFSRequestPending)
-			{
-			TFSMailMsgId pluginId(iPendingRequests[i].iPluginId,0);
-			if(CFSMailPlugin* plugin = GetPluginByUid(pluginId))
-			    {
-			    plugin->CancelL(aRequestId);
-			    }
-			iPendingRequests[i].iRequestStatus = TFSPendingRequest::EFSRequestCancelled;
-			break;
-			}
-		}
-	}
+        for(TInt i=0;i<iPendingRequests.Count();i++)
+        {
+        if(iPendingRequests[i].iRequestId == aRequestId &&
+            iPendingRequests[i].iRequestStatus == TFSPendingRequest::EFSRequestPending)
+            {
+            TFSMailMsgId pluginId(iPendingRequests[i].iPluginId,0);
+            if(CFSMailPlugin* plugin = GetPluginByUid(pluginId))
+                {
+                plugin->CancelL(aRequestId);
+                }
+            iPendingRequests[i].iRequestStatus = TFSPendingRequest::EFSRequestCancelled;
+            break;
+            }
+        }
+    }
 
 // -----------------------------------------------------------------------------
 // CFSMailRequestHandler::CancelAllRequestsL
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailRequestHandler::CancelAllRequestsL( )
-	{
+    {
     FUNC_LOG;
-		for(TInt i=0;i<iPendingRequests.Count();i++)
-		{
-			if(iPendingRequests[i].iRequestStatus == TFSPendingRequest::EFSRequestPending)
-				{
-				TFSMailMsgId pluginId(iPendingRequests[i].iPluginId,0);
-				if(CFSMailPlugin* plugin = GetPluginByUid(pluginId))
-				    {
-				    plugin->CancelL(iPendingRequests[i].iRequestId);
-				    }
-				iPendingRequests[i].iRequestStatus = TFSPendingRequest::EFSRequestCancelled;
-				}
-		}
-	}
+        for(TInt i=0;i<iPendingRequests.Count();i++)
+        {
+            if(iPendingRequests[i].iRequestStatus == TFSPendingRequest::EFSRequestPending)
+                {
+                TFSMailMsgId pluginId(iPendingRequests[i].iPluginId,0);
+                if(CFSMailPlugin* plugin = GetPluginByUid(pluginId))
+                    {
+                    plugin->CancelL(iPendingRequests[i].iRequestId);
+                    }
+                iPendingRequests[i].iRequestStatus = TFSPendingRequest::EFSRequestCancelled;
+                }
+        }
+    }
 
 // -----------------------------------------------------------------------------
 // CFSMailRequestHandler::AddPluginL
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailRequestHandler::AddPluginL( TUid aPluginId, CFSMailPlugin* aPlugin )
-	{
+    {
     FUNC_LOG;
 
-	CFSMailPluginData* pluginData = new (ELeave) CFSMailPluginData;
-	pluginData->iPluginId = aPluginId;
-	pluginData->iPlugin = aPlugin;
-	iPluginList.Append(pluginData);				
+    CFSMailPluginData* pluginData = new (ELeave) CFSMailPluginData;
+    pluginData->iPluginId = aPluginId;
+    pluginData->iPlugin = aPlugin;
+    iPluginList.Append(pluginData);             
 
-	}
+    }
 
 // -----------------------------------------------------------------------------
 // CFSMailRequestHandler::RemoveAllRequests
--- a/emailservices/emailframework/commonlib/src/CFSMailRequestObserver.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/commonlib/src/CFSMailRequestObserver.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -17,8 +17,8 @@
 
 
 #include "emailtrace.h"
-#include "CFSMailRequestObserver.h"
-#include "CFSMailRequestHandler.h"
+#include "cfsmailrequestobserver.h"
+#include "cfsmailrequesthandler.h"
 
 // ================= MEMBER FUNCTIONS ==========================================
 // -----------------------------------------------------------------------------
--- a/emailservices/emailframework/data/fsmailbrandmanager.rss	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/data/fsmailbrandmanager.rss	Fri Feb 19 22:37:30 2010 +0200
@@ -25,8 +25,8 @@
 #include <ovi_brand_graphics.mbg>
 #include <aol_brand_graphics.mbg>
 
-#include "MailBrandManager.hrh"
-#include "MailBrandManager.rh"
+#include "mailbrandmanager.hrh"
+#include "mailbrandmanager.rh"
 
 // ---------------------------------------------------------
 //   
--- a/emailservices/emailframework/group/FSMailFramework.mmp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/group/FSMailFramework.mmp	Fri Feb 19 22:37:30 2010 +0200
@@ -67,13 +67,8 @@
 // </gmail_brand_issue>
 LIBRARY         cmaillogger.lib
 
-#ifdef TRACE_INTO_FILE
-LIBRARY         flogger.lib
-#endif // TRACE_INTO_FILE
-
-
 SOURCEPATH      ../data
-START RESOURCE fsmailbrandmanager.rss
+START RESOURCE  fsmailbrandmanager.rss
 HEADER
 targetpath RESOURCE_FILES_DIR
 LANGUAGE_IDS
@@ -85,4 +80,4 @@
 MACRO DEBUGLOGGER_DEBUG_ASSERTS
 #endif
 
-LIBRARY       flogger.lib
+LIBRARY         flogger.lib
--- a/emailservices/emailframework/group/bld.inf	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/group/bld.inf	Fri Feb 19 22:37:30 2010 +0200
@@ -18,18 +18,18 @@
 #include <platform_paths.hrh>
 
 PRJ_EXPORTS
-../inc/MFSMailIterator.h |../../../inc/MFSMailIterator.h
-../inc/MFSMailEventObserver.h |../../../inc/MFSMailEventObserver.h
-../inc/MFSMailRequestObserver.h |../../../inc/MFSMailRequestObserver.h
-../inc/MFSMailBoxSearchObserver.h |../../../inc/MFSMailBoxSearchObserver.h
-../inc/MFSMailBrandManager.h |../../../inc/MFSMailBrandManager.h
-../inc/MailBrandManager.hrh |../../../inc/MailBrandManager.hrh
-../inc/CFSMailClient.h |../../../inc/CFSMailClient.h
-../inc/CFSClientAPI.h |../../../inc/CFSClientAPI.h
-../inc/CFSMailPlugin.h |../../../inc/CFSMailPlugin.h
-../inc/CFSMailPlugin.inl |../../../inc/CFSMailPlugin.inl
-../inc/CFSMailPlugin.hrh |../../../inc/CFSMailPlugin.hrh
-../inc/CFSMailClient.hrh |../../../inc/CFSMailClient.hrh
+../inc/mfsmailiterator.h |../../../inc/mfsmailiterator.h
+../inc/mfsmaileventobserver.h |../../../inc/mfsmaileventobserver.h
+../inc/mfsmailrequestobserver.h |../../../inc/mfsmailrequestobserver.h
+../inc/mfsmailboxsearchobserver.h |../../../inc/mfsmailboxsearchobserver.h
+../inc/mfsmailbrandmanager.h |../../../inc/mfsmailbrandmanager.h
+../inc/mailbrandmanager.hrh |../../../inc/mailbrandmanager.hrh
+../inc/cfsmailclient.h |../../../inc/cfsmailclient.h
+../inc/cfsclientapi.h |../../../inc/cfsclientapi.h
+../inc/cfsmailplugin.h |../../../inc/cfsmailplugin.h
+../inc/cfsmailplugin.inl |../../../inc/cfsmailplugin.inl
+../inc/cfsmailplugin.hrh |../../../inc/cfsmailplugin.hrh
+../inc/cfsmailclient.hrh |../../../inc/cfsmailclient.hrh
 
 ../inc/emailversionnumbers.hrh |../../../inc/emailversionnumbers.hrh
 
--- a/emailservices/emailframework/inc/CFSClientAPIRequestHandler.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/inc/CFSClientAPIRequestHandler.h	Fri Feb 19 22:37:30 2010 +0200
@@ -20,7 +20,7 @@
 #define CFSCLIENTAPIREQUESTHANDLER_H
 
 //  INCLUDES
-#include "CFSMailRequestHandler.h"
+#include "cfsmailrequesthandler.h"
 
 // FORWARD DECLARATIONS
 class CFSMailRequestObserver;
--- a/emailservices/emailframework/inc/CFSMailBrand.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/inc/CFSMailBrand.h	Fri Feb 19 22:37:30 2010 +0200
@@ -20,7 +20,7 @@
 #define CFSMAILBRAND_H
 
 // INCLUDES
-#include "MailBrandManager.hrh"		// TFSBrandElement
+#include "mailbrandmanager.hrh"		// TFSBrandElement
 #include <gdi.h>
 #include <badesca.h>
 
--- a/emailservices/emailframework/inc/CFSMailBrandManagerImpl.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/inc/CFSMailBrandManagerImpl.h	Fri Feb 19 22:37:30 2010 +0200
@@ -23,7 +23,7 @@
 #include <e32base.h>
 #include <barsc.h>
 
-#include "MFSMailBrandManager.h"
+#include "mfsmailbrandmanager.h"
 
 // FORWARD DECLARATIONS
 class TResourceReader;
--- a/emailservices/emailframework/inc/CFSMailClient.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/inc/CFSMailClient.h	Fri Feb 19 22:37:30 2010 +0200
@@ -22,10 +22,10 @@
 #include <e32std.h>
 #include <e32base.h>
 
-#include "CFSMailClient.hrh"
+#include "cfsmailclient.hrh"
 #include "cemailextensionbase.h"
 
-#include "MFSMailBrandManager.h"
+#include "mfsmailbrandmanager.h"
 #include "cfsmailplugin.h"
 
 
--- a/emailservices/emailframework/inc/CFSMailPlugin.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/inc/CFSMailPlugin.h	Fri Feb 19 22:37:30 2010 +0200
@@ -20,7 +20,7 @@
 
 #include <ecom/ecom.h>
 
-#include "MFSMailRequestObserver.h"
+#include "mfsmailrequestobserver.h"
 #include "mfsmaileventobserver.h"
 #include "cfsmailbox.h"
 #include "cfsmailplugin.hrh"
@@ -36,8 +36,8 @@
  *  and implemented by plugin implementor.
  *
  *  Plugin implementor inherits from class CFSMailPlugin,
- *  but plugin load medhods are provided by framework in file CFSMailPlugin.inl
- *  CFSMailPlugin,CFSMailPlugin.inl are exported by framework
+ *  but plugin load medhods are provided by framework in file cfsmailplugin.inl
+ *  CFSMailPlugin,cfsmailplugin.inl are exported by framework
  *
  *  @lib FSFWCommonLib
  *
--- a/emailservices/emailframework/inc/CFSMailPluginManager.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/inc/CFSMailPluginManager.h	Fri Feb 19 22:37:30 2010 +0200
@@ -25,9 +25,9 @@
 #include <e32base.h>
 #include <ecom/ecom.h>
 
-#include "CFSMailPlugin.h"
+#include "cfsmailplugin.h"
 
-#include "CFSMailRequestHandler.h"
+#include "cfsmailrequesthandler.h"
 
 /** plugin configuration at start up */
 enum TFsFwConfiguration
--- a/emailservices/emailframework/inc/MFSMailBoxSearchObserver.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/inc/MFSMailBoxSearchObserver.h	Fri Feb 19 22:37:30 2010 +0200
@@ -45,15 +45,15 @@
 
    /**
     * Notifies the email search API client that the search has completed
-	*
-	*/
+    *
+    */
     virtual void SearchCompletedL() = 0;
       
 //</cmail>
     /**
     * server asks client if to change the search priority (i.e. when calling to contact) 
- 	*
- 	*/
+    *
+    */
     virtual void ClientRequiredSearchPriority(TInt *apRequiredSearchPriority) = 0; 
 //</cmail>
     };
--- a/emailservices/emailframework/inc/MFSMailBrandManager.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/inc/MFSMailBrandManager.h	Fri Feb 19 22:37:30 2010 +0200
@@ -48,21 +48,21 @@
      */  
      virtual ~MFSMailBrandManager() { }
     
-	/**
-	 * Returns a branded graphical element.
-	 *
-	 * @param aElement Id of the branded element. This identifies which
-	 *                 graphic user wishes to retrieve.
-	 * @param aMailBoxId mailbox whose branded element is retrieved.
-	 *
-	 * @return A pointer to a CGulIcon object. The caller of this method is 
-	 *         responsible of destroying the object. Returns NULL if the 
-	 *         brand doesn't contain the requested branding element.
-	 */
-	 virtual CGulIcon* GetGraphicL( TFSBrandElement aElement,
-	                                const TFSMailMsgId& aMailboxId ) = 0;
+    /**
+     * Returns a branded graphical element.
+     *
+     * @param aElement Id of the branded element. This identifies which
+     *                 graphic user wishes to retrieve.
+     * @param aMailBoxId mailbox whose branded element is retrieved.
+     *
+     * @return A pointer to a CGulIcon object. The caller of this method is 
+     *         responsible of destroying the object. Returns NULL if the 
+     *         brand doesn't contain the requested branding element.
+     */
+     virtual CGulIcon* GetGraphicL( TFSBrandElement aElement,
+                                    const TFSMailMsgId& aMailboxId ) = 0;
 
-	 /**
+     /**
       * Returns a branded graphical element.
       *
       * @param aElement Id of the branded element. This identifies which
@@ -75,75 +75,75 @@
       */
       virtual CGulIcon* GetGraphicL( TFSBrandElement aElement,
                                      const TDesC& aBrandId ) = 0;
-	
-	/**
-	 * Returns a branded text element.
-	 *
-	 * @param aElement Id of the branded element. This identifies which
-	 *                 text user wishes to retrieve.
-	 * @param aMailBoxId mailbox whose branded element is retrieved.
-	 *
-	 * @return A TPtrC object. Returns TPtrC to a null descriptor if the
-	 *         brand doesn't contain the requested branding element.
-	 */
-	 virtual TPtrC GetTextL( TFSBrandElement aElement,
-	                        const TFSMailMsgId& aMailboxId ) = 0;
-	
-	/**
-	 * Returns a branded text element.
-	 * This function is for WhiteLabelBranding, because branded mailbox name is
-	 * needed before mailbox creation.
-	 * 
-	 * @param aElement Id of the branded element. This identifies which
-	 *                 text user wishes to retrieve.
-	 * @param aMailBoxId mailbox whose branded element is retrieved.
-	 *
-	 * @return A TPtrC object. Returns TPtrC to a null descriptor if the
-	 *         brand doesn't contain the requested branding element.
-	 */
-	 virtual TPtrC GetTextL( TFSBrandElement aElement, 
-			                const TDesC& aBrandId ) = 0;
-	
-	/**
-	 * Returns a branded text element.
-	 *
-	 * @param aElement The id of the branded element. This identifies which
-	 *                 color user wishes to retrieve.
-	 * @param aMailBoxId mailbox whose branded element is retrieved.
-	 * @param aColor A reference to a TRgb object. The color is returned
-	 *               using this reference.
+    
+    /**
+     * Returns a branded text element.
+     *
+     * @param aElement Id of the branded element. This identifies which
+     *                 text user wishes to retrieve.
+     * @param aMailBoxId mailbox whose branded element is retrieved.
+     *
+     * @return A TPtrC object. Returns TPtrC to a null descriptor if the
+     *         brand doesn't contain the requested branding element.
+     */
+     virtual TPtrC GetTextL( TFSBrandElement aElement,
+                            const TFSMailMsgId& aMailboxId ) = 0;
+    
+    /**
+     * Returns a branded text element.
+     * This function is for WhiteLabelBranding, because branded mailbox name is
+     * needed before mailbox creation.
+     * 
+     * @param aElement Id of the branded element. This identifies which
+     *                 text user wishes to retrieve.
+     * @param aMailBoxId mailbox whose branded element is retrieved.
      *
-	 * @return Error code. KErrNotFound if the brand doesn't contain the requested
-	 *         branding element.
-	 */
-	 virtual TInt GetColorL( TFSBrandElement aElement,
-	                        const TFSMailMsgId& aMailboxId,
-	                        TRgb& aColor ) = 0;
-	
-	/**
-	 * This function will change 'mailbox name' as branded name.
-	 * If aMailboxId is NULL function goes through all mailboxes and check if mailbox is branded.
-	 * If it is, function will change 'mailbox name' as branded name.
-	 * This function should be called after mailbox settings has changed.
-	 * 
-	 * @param aMailboxId Id of the mailbox
-	 */
-	 virtual void UpdateMailboxNamesL(  const TFSMailMsgId aMailboxId ) = 0;
+     * @return A TPtrC object. Returns TPtrC to a null descriptor if the
+     *         brand doesn't contain the requested branding element.
+     */
+     virtual TPtrC GetTextL( TFSBrandElement aElement, 
+                            const TDesC& aBrandId ) = 0;
+    
+    /**
+     * Returns a branded text element.
+     *
+     * @param aElement The id of the branded element. This identifies which
+     *                 color user wishes to retrieve.
+     * @param aMailBoxId mailbox whose branded element is retrieved.
+     * @param aColor A reference to a TRgb object. The color is returned
+     *               using this reference.
+     *
+     * @return Error code. KErrNotFound if the brand doesn't contain the requested
+     *         branding element.
+     */
+     virtual TInt GetColorL( TFSBrandElement aElement,
+                            const TFSMailMsgId& aMailboxId,
+                            TRgb& aColor ) = 0;
+    
+    /**
+     * This function will change 'mailbox name' as branded name.
+     * If aMailboxId is NULL function goes through all mailboxes and check if mailbox is branded.
+     * If it is, function will change 'mailbox name' as branded name.
+     * This function should be called after mailbox settings has changed.
+     * 
+     * @param aMailboxId Id of the mailbox
+     */
+     virtual void UpdateMailboxNamesL(  const TFSMailMsgId aMailboxId ) = 0;
 
     /**
      * Returns branded graphic element of given type.
      *
      * @param aElementId brand element
-	 * @param aMailBoxId mailbox whose branded element is retrieved.	 
+     * @param aMailBoxId mailbox whose branded element is retrieved.     
      * @param aIconIds Icon path and ids
-	 *
-	 * @return Error code
+     *
+     * @return Error code
      */
-	 virtual TInt GetGraphicIdsL( TFSBrandElement aElement,
-	                              const TFSMailMsgId& aMailboxId,
+     virtual TInt GetGraphicIdsL( TFSBrandElement aElement,
+                                  const TFSMailMsgId& aMailboxId,
                                   TDes& aIconIds  ) = 0;
-		
+        
 };
 
 
-#endif	// MFSMAILBRANDMANAGER_H
\ No newline at end of file
+#endif  // MFSMAILBRANDMANAGER_H
\ No newline at end of file
--- a/emailservices/emailframework/inc/MFSMailEventObserver.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/inc/MFSMailEventObserver.h	Fri Feb 19 22:37:30 2010 +0200
@@ -23,7 +23,7 @@
 #include <e32std.h>
 #include <e32base.h>
 //<cmail>
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 //</cmail>
 
 /**
--- a/emailservices/emailframework/inc/MFSMailIterator.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/inc/MFSMailIterator.h	Fri Feb 19 22:37:30 2010 +0200
@@ -35,7 +35,7 @@
     {
 
 public:
-									
+                                    
     /**
      * Lists user given count of email objects located after user
      * given start point.
@@ -100,9 +100,9 @@
     /**
      * Destructor.
      */  
-   	 virtual ~MFSMailIterator() { }; 
-        	
-   	};
+     virtual ~MFSMailIterator() { }; 
+            
+    };
 
 #endif  // MFSMAILITERATOR_H
 
--- a/emailservices/emailframework/src/CFSClientAPI.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/src/CFSClientAPI.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -16,8 +16,8 @@
 */
 
 #include "emailtrace.h"
-#include "CFSClientAPIRequestHandler.h"
-#include "CFSClientAPI.h"
+#include "cfsclientapirequesthandler.h"
+#include "cfsclientapi.h"
 #include "emailclientpluginmanager.h"
 
 // -----------------------------------------------------------------------------
--- a/emailservices/emailframework/src/CFSClientAPIRequestHandler.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/src/CFSClientAPIRequestHandler.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -17,8 +17,8 @@
 
 
 #include "emailtrace.h"
-#include "CFSClientAPIRequestHandler.h"
-#include "CFSMailRequestObserver.h"
+#include "cfsclientapirequesthandler.h"
+#include "cfsmailrequestobserver.h"
 #include "emailclientpluginmanager.h"
 
 // ================= MEMBER FUNCTIONS ==========================================	
--- a/emailservices/emailframework/src/CFSFWImplementation.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/src/CFSFWImplementation.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -17,11 +17,11 @@
 
 
 #include "emailtrace.h"
-#include "CFSFWImplementation.h"
+#include "cfsfwimplementation.h"
 //<cmail>
-#include "CFSMailPlugin.h"
+#include "cfsmailplugin.h"
 //</cmail>
-#include "CFSMailPluginManager.h"
+#include "cfsmailpluginmanager.h"
 
 // ================= MEMBER FUNCTIONS ==========================================
 // -----------------------------------------------------------------------------
--- a/emailservices/emailframework/src/CFSMailBrand.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/src/CFSMailBrand.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -22,10 +22,10 @@
 #include <gulicon.h>
 #include <centralrepository.h>
 //<cmail>
-#include "FreestyleEmailCenRepKeys.h"
+#include "freestyleemailcenrepkeys.h"
 //</cmail>
 
-#include "CFSMailBrand.h"
+#include "cfsmailbrand.h"
 
 const TInt KElementArrayGranularity = 5;
 const TInt KMaxStringLenFromCenrep = 256;
--- a/emailservices/emailframework/src/CFSMailBrandManagerImpl.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/src/CFSMailBrandManagerImpl.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -29,11 +29,11 @@
 #include <centralrepository.h>
 // </gmail_brand_issue>
 //<cmail>
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 //</cmail>
 
-#include "CFSMailBrandManagerImpl.h"
-#include "CFSMailBrand.h"
+#include "cfsmailbrandmanagerimpl.h"
+#include "cfsmailbrand.h"
 
 
 const TInt KBrandArrayGranularity = 5;
--- a/emailservices/emailframework/src/CFSMailClient.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/src/CFSMailClient.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -17,12 +17,12 @@
 
 
 #include "emailtrace.h"
-#include "CFSMailClient.h"
-#include "CFSFWImplementation.h"
-#include "CFSMailPluginManager.h"
-#include "CFSMailRequestObserver.h"
-#include "CFSMailIterator.h"
-#include "CFSMailBrandManagerImpl.h"
+#include "cfsmailclient.h"
+#include "cfsfwimplementation.h"
+#include "cfsmailpluginmanager.h"
+#include "cfsmailrequestobserver.h"
+#include "cfsmailiterator.h"
+#include "cfsmailbrandmanagerimpl.h"
 
 
 // ================= MEMBER FUNCTIONS ==========================================
--- a/emailservices/emailframework/src/CFSMailPluginManager.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailframework/src/CFSMailPluginManager.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -17,9 +17,9 @@
 
 
 #include "emailtrace.h"
-#include "CFSMailPluginManager.h"
-#include "CFSMailRequestObserver.h"
-#include "CFSMailRequestHandler.h"
+#include "cfsmailpluginmanager.h"
+#include "cfsmailrequestobserver.h"
+#include "cfsmailrequesthandler.h"
 
 // ================= MEMBER FUNCTIONS ==========================================
 // -----------------------------------------------------------------------------
--- a/emailservices/emailserver/cmailhandlerplugin/data/iconlist.txt	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailserver/cmailhandlerplugin/data/iconlist.txt	Fri Feb 19 22:37:30 2010 +0200
@@ -54,5 +54,5 @@
 -c16,8 qgn_indi_cmail_calendar_event_read_attachments_high_prio.svg
 -c16,8 qgn_indi_cmail_calendar_event_read_low_prio.svg
 -c16,8 qgn_indi_cmail_calendar_event_read_attachments_low_prio.svg
--c16,8 qgn_indi_ai_eplg_unread.svg
--c16,8 qgn_prop_mce_outbox_small.svg
+-c16,8 qgn_stat_message_mail_uni.svg
+-c16,8 qgn_indi_cmail_outbox_msg.svg
--- a/emailservices/emailserver/cmailhandlerplugin/group/cmailhandlerplugin.mmp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailserver/cmailhandlerplugin/group/cmailhandlerplugin.mmp	Fri Feb 19 22:37:30 2010 +0200
@@ -37,8 +37,11 @@
 SOURCE                          cmailcpssettings.cpp
 SOURCE                          cmailmessagedetails.cpp
 SOURCE                          cmailmailboxdetails.cpp
+SOURCE                          cmailcpsutils.cpp
 #endif // FF_CMAIL_INTEGRATION
 SOURCE                          cmaildriveobserver.cpp
+SOURCE                          cmailexternalaccount.cpp
+SOURCE                          cmailpluginproxy.cpp
 
 //From server
 SOURCE                          fsmailledhandler.cpp
--- a/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpshandler.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpshandler.h	Fri Feb 19 22:37:30 2010 +0200
@@ -20,6 +20,8 @@
 #define __CMAILCPSHANDLER_H__
 
 #include <aknappui.h>
+#include <memailobserverlistener.h> // base class
+
 // FSMailServer classes (base classes and callback interfaces)
 #include "fsnotificationhandlerbase.h"
 #include "fsnotificationhandlernotifierinitiator.h"
@@ -31,6 +33,9 @@
 class CFSMailBox;
 class CMailMailboxDetails;
 class CMailCpsSettings;
+class CMailExternalAccount;
+class CMailPluginProxy;
+class CEmailObserverPlugin;
 
 /**
  * CMail ContentPublishingService Handler class
@@ -41,7 +46,8 @@
  */
 NONSHARABLE_CLASS( CMailCpsHandler ) : 
     public CFSNotificationHandlerBase,
-    public MMailCpsSettingsCallback
+    public MMailCpsSettingsCallback,
+    public EmailInterface::MEmailObserverListener
     {
 public:
     
@@ -72,6 +78,12 @@
     void UpdateMailboxesL(TInt aInstance, const TDesC& aContentId);
 
     /**
+     * Updates external (3rd party) account based on contentId
+     * @param aContentId specifies the widget and account related to it
+     */
+    void UpdateExtAccountL( const TDesC& aContentId );
+
+    /**
      *
      */
     void LaunchWidgetSettingsL( const TDesC& aContentId );
@@ -86,6 +98,13 @@
      */    
     void LaunchEmailWizardL();
     /**
+     * Launches an application based on the given contentId
+     * This method is for external (3rd party) accounts
+     * @param aContentId specifies the widget that was pressed by the user
+     */
+    void LaunchExtAppL( const TDesC& aContentId );
+
+    /**
      *
      */	
     TBool AssociateWidgetToSetting( const TDesC& aContentId );
@@ -96,15 +115,33 @@
     void DissociateWidgetFromSettingL( const TDesC& aContentId );    
 
     /**
-     *
+     * Return total number of mailboxes (native+3rd party) in the system
+     */
+    TInt TotalMailboxCountL();
+    
+    /**
+     * Return total number of native mailboxes in the system
      */     
-    TInt GetMailboxCount();    
+    TInt TotalIntMailboxCount();
+
+    /**
+     * Return total number of 3rd party mailboxes in the system
+     */
+    TInt TotalExtMailboxCountL();
 
     /**
      *
      */    
     void ManualAccountSelectionL( const TDesC& aContentId );
     
+	/**
+     * Gets correct localised format for time (or date) string
+     */ 
+    static HBufC* GetMessageTimeStringL( TTime aMessageTime );
+
+    // From MEmailObserverListener
+    void EmailObserverEvent( EmailInterface::MEmailData& aData );
+
 protected:
     /**
      * From CFSNotificationHandlerBase
@@ -144,10 +181,15 @@
     void Reset();
 
     /**
-     * Initializes everything
+     * Initializes native accounts
      */
     void InitializeL();
     
+    /**
+     * Initializes external accounts
+     */
+    void InitializeExternalAccountsL();
+    
     // Creation methods
     /**
      * Creates an instance of mailboxdetails based on parameters
@@ -178,11 +220,6 @@
                           const TInt aWidgetInstance,
 	                      const TInt aMessageNumber,
                           const TInt aFirstRow );
-
-    /**
-     * Gets correct localised format for time (or date) string
-     */	
-	HBufC* GetMessageTimeStringL( TTime aMessageTime );
 	
 	/**
      *
@@ -338,12 +375,60 @@
      * @return ETrue if duplicate, EFalse if new message
      */
     TBool IsDuplicate( const CMailMailboxDetails& aMailbox, const TFSMailMsgId& aMsgId );
+
+    //
+    // Private methods related to 3rd party email widget publishers
+    //
+    /**
+     * Removes all plugin proxies (and plugins) that are not listed in aAccounts
+     * @param aAccounts up-to-date list of external (3rd party) email accounts
+     *        that are specified in settings
+     */
+    void RemoveUnusedPluginsL( RPointerArray<CMailExternalAccount>& aAccounts );
+    
+    /**
+     * Goes through the array of external accounts and instantiates (newly added)
+     * 3rd party plugins
+     * @param aAccounts up-to-date list of external (3rd party) email accounts
+     *        that are specified in settings
+     */
+    void AddNewPluginsL( RPointerArray<CMailExternalAccount>& aAccounts );
     
     /**
-     *
+     * Goes through the array of existing 3rd party plugin (proxies) and
+     * lets them take the accounts given in the param array.
+     * Plugin proxies also update the widget data.
+     * @param aAccounts up-to-date list of external (3rd party) email accounts
+     *        that are specified in settings
      */
+    void SelectAndUpdateExtAccountsL( RPointerArray<CMailExternalAccount>& aAccounts );
+    
     TBool FirstBootL();
     
+    /**
+     * Checks whether aAccounts array has entries relating to plugin with id aPluginId
+     * @param aPluginId 3rd party plugin identifier (implementation uid)
+     * @param aAccounts array of 3rd party email account information
+     * @return true or false
+     */
+    TBool IsPluginInArray( const TInt aPluginId, RPointerArray<CMailExternalAccount>& aAccounts );
+    
+    /**
+     * Checks whether aPlugins array has entries relating to plugin with id aPluginId
+     * @param aPluginId 3rd party plugin identifier (implementation uid)
+     * @param aPlugins array of plugin proxies
+     * @return true or false
+     */
+    TBool IsPluginInArray( const TInt aPluginId, RPointerArray<CMailPluginProxy>& aPlugins );
+
+    /**
+     * Goes through iExternalPlugins array and finds correct entry
+     * @param aContentId specifying a widget/account
+     * @return correct plugin proxy instance pointer (ownership not transferred)
+     *         if not found, NULL is retuned
+     */
+    CMailPluginProxy* GetExtPluginL( const TDesC& aContentId );
+
 private: // data
     CEikonEnv* iEnv;
     // pointer to liw wrapper that handles actual publishing
@@ -352,6 +437,8 @@
     CMailCpsSettings*                  iSettings;
     // local cache of mailbox details
     RPointerArray<CMailMailboxDetails> iAccountsArray;
+    // array of plugin proxies. One plugin proxy handles one 3rd party plugin and its accounts
+    RPointerArray<CMailPluginProxy> iExternalPlugins;
     };
 
 #endif  //__CMAILCPSHANDLER_H__
--- a/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpsif.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpsif.h	Fri Feb 19 22:37:30 2010 +0200
@@ -20,9 +20,9 @@
 #define CMAILCPSIF_H_
 
 // LIW interface
-#include <LiwServiceHandler.h>
-#include <LiwVariant.h>
-#include <LiwGenericParam.h>
+#include <liwservicehandler.h>
+#include <liwvariant.h>
+#include <liwgenericparam.h>
 #include <fbs.h>
 #include <data_caging_path_literals.hrh>
 
@@ -67,6 +67,18 @@
                                     TFSMailMsgId aFolderId );
 
     /**
+     * Publishes mailbox name to widget and action related to widget
+     * @param aInstance specifies the widget instance on homescreen
+     * @param aMailboxName specifies the text to be published
+     * @param aAction specifies the action identifier that will be sent back
+     *        when user presses the widget
+     */
+    void PublishMailboxNameL(
+        const TInt aInstance, 
+        const TDesC& aMailboxName,
+        const TDesC8& aAction );
+
+    /**
      * Resets mailbox name from widget
      * @param aRowNumber specifies the row on widget UI
      */
@@ -85,6 +97,23 @@
     void PublishMailboxIconL( const TInt aInstance, const TInt aRowNumber, const TInt aIcon, TFSMailMsgId aMailBoxId );
 
     /**
+     * Publishes mailbox icon based on given resource path
+     * @param aInstance specifies the widget
+     * @param aIconResourcePath specifies the icon resource
+     *  (e.g. "mif(z:\\resource\\apps\\myemailplugin.mif 16384 16385)")
+     */
+    void PublishMailboxIconL( const TInt aInstance, const TDesC& aIconPath );
+
+    /**
+     * 
+     */
+    void PublishIconReferenceL(
+        const TDesC& aContentId,
+        const TDesC& aContentType,
+        const TDesC8& aKey,
+        const TDesC& aIconPath );
+    
+    /**
      * 
      */    
     void PublishMailDetailL(
@@ -118,7 +147,7 @@
      * 
      */	
 	TInt HandleNotifyL(
-        TInt aErrorCode,
+        TInt aCmdId,
         TInt aEventId,
         CLiwGenericParamList& aEventParamList,
         const CLiwGenericParamList& aInParamList );
@@ -153,7 +182,7 @@
     /**
      * adds resource file
      */
-    void CMailCpsIf::AllocateResourcesL();
+    void AllocateResourcesL();
     
     /**
      * initializes the LIW IF
@@ -217,6 +246,12 @@
      * 
      */	    
     TInt FindWidgetInstanceId(const TDesC& aContentId);
+    
+    /**
+     * Resets all the published content values on HomeScreen database
+     */
+    void ResetPublishedDataL( const TDesC& aContentId );
+
 public:
 	//
     RPointerArray<HBufC>    iInstIdList;
--- a/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpsifconsts.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpsifconsts.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,6 +21,7 @@
 
 // Hardcoded maximum value for number of rows in widget
 const TInt KMaxRowCount = 3;
+const TInt KMaxMsgCount = 2;
 // Hardcoded maximum value for number of mailboxes
 const TInt KMaxMailboxCount = 18;
 const TInt KMaxUnreadCount = 999;
@@ -100,6 +101,7 @@
 _LIT8( KDelete, "Delete" );
 _LIT( KCpData, "cp_data" );
 _LIT8( KFilter, "filter" );
+_LIT8( KData8, "data" );
 _LIT8( KId, "id" );
 _LIT8( KItem, "item" );
 _LIT8( KItemId, "item_id" );
--- a/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpssettings.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpssettings.h	Fri Feb 19 22:37:30 2010 +0200
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008 - 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2008 - 20010 Nokia Corporation and/or 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,6 +20,7 @@
 #define CMAILCPSSETTINGS_H_
 
 class CRepository;
+class CMailExternalAccount;
 
 /*
  * Callback interface for observer
@@ -79,6 +80,13 @@
     RArray<TFSMailMsgId>& Mailboxes();
 
     /**
+     * Gets array of external mailboxes from widget settings
+     * @param aAccounts on completion, contains the necessary information of
+     * external mailboxes that currently should have a widget
+     */
+    void GetExtMailboxesL( RPointerArray<CMailExternalAccount>& aAccounts );
+
+    /**
      * Adds mailbox to widget settings
      * Method ensures that same mailbox is not added again, if it happens
      * to exist already in the settings. If already exists, method simply returns without
@@ -150,9 +158,10 @@
     TInt32 Configuration();
 
     /**
-     * 
+     * Return total number of all native mailboxes in the system
      */
-    TInt GetTotalMailboxCount();
+    TInt TotalIntMailboxCount();
+
 
     /**
      * 
@@ -169,6 +178,16 @@
      */    
     void RemoveFromContentIdListL( const TDesC& aContentId );
 
+    /**
+     *
+     */
+    void ToggleWidgetNewMailIconL( TBool aIconOn, const TFSMailMsgId& aMailBox ); 
+
+    /**
+     *
+     */    
+    TBool GetNewMailState( const TFSMailMsgId& aMailBox );
+    
 protected:
     /**
      * From CActive
@@ -228,6 +247,13 @@
      * @param aKeys array of keys
      */
     void GetMailboxNonZeroKeysL( RArray<TUint32>& aKeys );
+    
+    /**
+     * Gets all the external mailbox identifiers
+     * @param on completion, contains an array of cenrep keys that have an external
+     * account specified (i.e. not empty) 
+     */
+    void GetExtMailboxNonZeroKeysL( RArray<TUint32>& aKeys );
 
     /**
      * 
@@ -240,6 +266,8 @@
      */	
     TUint32 GetSettingToAssociate();
     
+    CMailExternalAccount* GetExtMailboxL( TInt aKey );
+    
 private: // data
     // reference to mailclient
     CFSMailClient&            iMailClient;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpsutils.h	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2008 - 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:  Class to handle content publishing for widget
+*
+*/
+
+
+#ifndef CMAILCPSUTILS_H
+#define CMAILCPSUTILS_H
+
+#include <memailmessagedata.h> // TEmailPriority
+
+/**
+ *  Utility methods for cps handler
+ *  @lib fsmailserver.exe
+ *  @since S60 v5.2
+ */
+NONSHARABLE_CLASS( TMailCpsUtils )
+    {
+public:
+    
+    /**
+     * Two-phased constructor.
+     * @param aOwner Owner and manager of this handler.
+     */ 
+    static TInt ResolveIcon( 
+        TBool aUnread,
+        TBool aCalMsg,
+        TBool aAttas,
+        EmailInterface::TEmailPriority aPrio,
+        TBool aRe,
+        TBool aFw );
+    };
+
+#endif  // CMAILCPSUTILS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailexternalaccount.h	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This file defines class CMailMessageDetails.
+*
+*/
+
+#ifndef CMAILEXTERNALACCOUNT_H_
+#define CMAILEXTERNALACCOUNT_H_
+
+#include <e32def.h>
+#include <e32base.h>
+
+/**
+ *  Container class external email account
+ *
+ *  @lib
+ *  @since S60 v9.2
+ */
+NONSHARABLE_CLASS( CMailExternalAccount ) : public CBase
+    {
+public:
+    /** public constructor */
+    static CMailExternalAccount* NewL(
+        const TInt aMailboxId,
+        const TInt aPluginId,
+        HBufC* aContentId );
+
+    /** destructor */
+    virtual ~CMailExternalAccount();
+
+    // Member accessors
+    TInt MailboxId();
+    TInt PluginId();
+    TDesC& ContentId();
+    
+private:
+
+    void ConstructL();
+
+    CMailExternalAccount(
+        const TInt aMailboxId,
+        const TInt aPluginId,
+        HBufC* aContentId );
+
+private: // data
+    // actual identifier of the mailbox (unique within plugin context)
+    TInt iMailboxId;
+    // identifier for plugin
+    TInt iPluginId;
+    // identifier for the widget on homescreen
+    HBufC* iContentId; 
+    };
+
+#endif /* CMAILEXTERNALACCOUNT_H_ */
--- a/emailservices/emailserver/cmailhandlerplugin/inc/cmailmessagedetails.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailmessagedetails.h	Fri Feb 19 22:37:30 2010 +0200
@@ -22,7 +22,7 @@
 #include <e32def.h>
 #include <e32base.h>
 //<cmail>
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 //</cmail>
 
 class CMailMailboxDetails;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailpluginproxy.h	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This file defines class CMailMessageDetails.
+*
+*/
+
+#ifndef CMAILPLUGINPROXY_H_
+#define CMAILPLUGINPROXY_H_
+
+#include <e32def.h>
+#include <e32base.h>
+#include <emailobserverplugin.h>
+#include <memailobserverlistener.h>
+#include <memailmailboxdata.h>
+
+class CMailExternalAccount;
+class CMailCpsIf;
+
+/**
+ * Class that represents the 3rd party email widget plugin to the rest of the cps logic
+ * Also takes care of all the email accounts that the plugin handles
+ * @lib cmailhandlerplugin.lib
+ * @since S60 v9.2
+ */
+NONSHARABLE_CLASS( CMailPluginProxy ) : public CBase, public EmailInterface::MEmailObserverListener
+    {
+public:
+    static CMailPluginProxy* NewL(
+        const TInt aPluginId,
+        CMailCpsIf& aPublisher );
+
+    virtual ~CMailPluginProxy();
+    
+    // From MEmailObserverListener
+    /**
+     * Called by 3rd party plugins when there are chnages in the data to be published
+     * @param aData offers access to all the necessary data needed for publishing data on widget
+     */
+    void EmailObserverEvent( EmailInterface::MEmailData& aData );
+
+    /**
+     * Accessor for the plugin id
+     * @return this plugin's 'implementation id'
+     */
+    TInt PluginId();
+        
+    /**
+     * Whether this plugin handles the specified contentId (i.e. email account)
+     * @param aContentId specifying a widget instance and a mailbox related to it
+     * @return boolean
+     */
+    TBool HasAccount( const TDesC& aContentId );
+    
+    /**
+     * Looks up the data related to trigger event, and launches the specified application
+     * @param aContentId content id of the widget that received the key press
+     */
+    void LaunchExtAppL( const TDesC& aContentId );
+    
+    /**
+     * Picks the accounts that belong to this plugin, and updates the data
+     * publishing of them all
+     * @param aAccounts list of external accounts
+     */
+    void SelectAndUpdateAccountsL( RPointerArray<CMailExternalAccount>& aAccounts );
+
+    /**
+     * Handles updating of one account/widget data based on contentId
+     * @param aContentId content id of the widget
+     */
+    void UpdateAccountL( const TDesC& aContentId );
+
+private:
+
+    void ConstructL();
+
+    CMailPluginProxy(
+        const TInt aPluginId,
+        CMailCpsIf& aPublisher );
+
+    void RemoveAccountsL();
+    
+    void ResetAccountL( const TDesC& aContentId );
+
+    void ResetMessageRowL( const TInt aWidgetInstanceId, const TInt aRow );
+
+    void SelectOwnAccountsL( RPointerArray<CMailExternalAccount>& aAccounts );
+    
+    TInt ResolveWidgetInstance( const TDesC& aContentId );
+
+    TInt GetMailboxId( const TDesC& aContentId );
+
+    void PublishAccountsL();
+
+    void PublishAccountL( const TInt aWidgetInstanceId, const TInt aMailboxId );
+
+    void PublishAccountL( const TInt aWidgetInstanceId, EmailInterface::MMailboxData& aMailboxData );
+
+    void PublishFirstRowL( const TInt aWidgetInstanceId, EmailInterface::MMailboxData& aMailboxData );
+    
+    void PublishMessageRowL( const TInt aWidgetInstanceId, EmailInterface::MMessageData& aMessageData, const TInt aRow );
+    
+    HBufC* ConstructMailboxNameWithMessageCountLC( EmailInterface::MMailboxData& aMailboxData );
+    
+    TInt ResolveIndicatorIcon( EmailInterface::MMailboxData& aMailboxData );
+
+    EmailInterface::MMailboxData& GetMailboxDataL( TInt aMailboxId );
+    
+    TInt UnreadCountL( EmailInterface::MMailboxData& aMailboxData );
+    
+private: // data
+    // identifier of the plugin
+    TInt iPluginId;
+    // plugin instance where rest of the data is buffered
+    EmailInterface::CEmailObserverPlugin* iPlugin;
+    // reference to publisher interface
+    CMailCpsIf& iPublisher;
+    // array of accounts that have widget and this plugin is responsible for
+    RPointerArray<CMailExternalAccount> iAccounts;
+    };
+
+#endif /* CMAILPLUGINPROXY_H_ */
--- a/emailservices/emailserver/cmailhandlerplugin/inc/cmailwidgetcenrepkeys.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailwidgetcenrepkeys.h	Fri Feb 19 22:37:30 2010 +0200
@@ -45,4 +45,7 @@
 const TUint32 KCMailExtPluginIdOffset             = 0x00000100;
 const TUint32 KCMailExtWidgetCidOffset            = 0x00000200;
 
+// Key to store mailboxes where is new messages. Format: <mailbox1><mailbox2><mailbox3>...
+const TUint32 KCMailMailboxesWithNewMail          = 0x10000003;
+
 #endif // CMAILWIDGETCENREPKEYS_H
--- a/emailservices/emailserver/cmailhandlerplugin/inc/fsnotificationhandlernotifierinitiator.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailserver/cmailhandlerplugin/inc/fsnotificationhandlernotifierinitiator.h	Fri Feb 19 22:37:30 2010 +0200
@@ -24,7 +24,7 @@
 
 #include <barsc.h>
 //<cmail>
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 
 #include "fsmailserverconst.h"
 //</cmail>
--- a/emailservices/emailserver/cmailhandlerplugin/src/cmailcpshandler.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailserver/cmailhandlerplugin/src/cmailcpshandler.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -24,18 +24,27 @@
 #include <centralrepository.h>
 #include <starterdomaincrkeys.h>
 #include <startupdomainpskeys.h>
+#include <emailobserverinterface.hrh>
+#include <emailobserverplugin.h>
+#include <memaildata.h>
+#include <memailmailboxdata.h>
 
 #include "emailtrace.h"
-#include "CFSMailClient.h"
-#include "CFSMailBox.h"
-#include "CFSMailFolder.h"
+#include "cfsmailclient.h"
+#include "cfsmailbox.h"
+#include "cfsmailfolder.h"
 #include "cmailcpshandler.h"
 #include "cmailcpssettings.h"
 #include "cmailcpsif.h"
 #include "cmailmessagedetails.h"
 #include "cmailmailboxdetails.h"
+#include "cmailexternalaccount.h"
 #include "cmailcpsifconsts.h"
 #include "FreestyleEmailUiConstants.h"
+#include "cmailpluginproxy.h"
+#include "cmailhandlerpluginpanic.h"
+
+using namespace EmailInterface;
 
 // ---------------------------------------------------------
 // CMailCpsHandler::CMailCpsHandler
@@ -81,7 +90,8 @@
     iSettings = CMailCpsSettings::NewL( MailClient() );
 
     InitializeL();
-    
+    InitializeExternalAccountsL();
+
     iSettings->StartObservingL( this );
     }
 
@@ -95,6 +105,7 @@
     delete iLiwIf;
     delete iSettings;
     iAccountsArray.ResetAndDestroy();
+    iExternalPlugins.ResetAndDestroy();
     }
 
 // ---------------------------------------------------------
@@ -164,6 +175,120 @@
     }
 
 // ---------------------------------------------------------
+// CMailCpsHandler::InitializeExternalAccountsL
+// ---------------------------------------------------------
+//
+void CMailCpsHandler::InitializeExternalAccountsL()
+    {
+    FUNC_LOG;
+    // Read external account data from settings
+    RPointerArray<CMailExternalAccount> extAccounts;
+    CleanupClosePushL( extAccounts );
+    iSettings->GetExtMailboxesL( extAccounts );
+
+    // Delete removed plugins
+    RemoveUnusedPluginsL( extAccounts );
+
+    // Instantiate new plugins
+    AddNewPluginsL( extAccounts );
+
+    // Set accounts under correct pluginProxies
+    SelectAndUpdateExtAccountsL( extAccounts );
+
+    __ASSERT_DEBUG( extAccounts.Count() == 0, Panic( ECmailHandlerPluginPanicNoFailedState ) );
+    CleanupStack::PopAndDestroy();
+    }
+
+// ---------------------------------------------------------
+// CMailCpsHandler::RemoveUnusedPluginsL
+// ---------------------------------------------------------
+//
+void CMailCpsHandler::RemoveUnusedPluginsL( RPointerArray<CMailExternalAccount>& aAccounts )
+    {
+    FUNC_LOG;
+    for ( TInt i = 0; i < iExternalPlugins.Count(); i++ )
+        {
+        if ( !IsPluginInArray( iExternalPlugins[i]->PluginId(), aAccounts ) )
+            {
+            // all plugin's accounts have been removed from widget settings, unloading resources
+            CMailPluginProxy* proxy = iExternalPlugins[i];
+            iExternalPlugins.Remove(i--); // also change the loop index
+            delete proxy;
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CMailCpsHandler::AddNewPluginsL
+// ---------------------------------------------------------
+//
+void CMailCpsHandler::AddNewPluginsL( RPointerArray<CMailExternalAccount>& aAccounts )
+    {
+    FUNC_LOG;
+    for ( TInt i = 0; i < aAccounts.Count(); i++ )
+        {
+        if ( !IsPluginInArray( aAccounts[i]->PluginId(), iExternalPlugins ) )
+            {
+            // new plugin instantiation
+            INFO_1("Instantiating plugin 0x%x", aAccounts[i]->PluginId() );
+            CMailPluginProxy* proxy = CMailPluginProxy::NewL( aAccounts[i]->PluginId(), *iLiwIf );
+            CleanupStack::PushL( proxy );
+            iExternalPlugins.AppendL( proxy );
+            CleanupStack::Pop( proxy );
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CMailCpsHandler::UpdateExtAccountsL
+// ---------------------------------------------------------
+//
+void CMailCpsHandler::SelectAndUpdateExtAccountsL( RPointerArray<CMailExternalAccount>& aAccounts )
+    {
+    FUNC_LOG;
+    for ( TInt i = 0; i < iExternalPlugins.Count(); i++ )
+        {
+        iExternalPlugins[i]->SelectAndUpdateAccountsL( aAccounts );
+        }
+    }
+
+// ---------------------------------------------------------
+// CMailCpsHandler::IsPluginInArray
+// ---------------------------------------------------------
+//
+TBool CMailCpsHandler::IsPluginInArray( const TInt aPluginId, RPointerArray<CMailExternalAccount>& aAccounts )
+    {
+    FUNC_LOG;
+    TBool found( EFalse );
+    for ( TInt i = 0; i < aAccounts.Count(); i++ )
+        {
+        if ( aAccounts[i]->PluginId() == aPluginId )
+            {
+            found = ETrue;
+            }
+        }
+    return found;
+    }
+
+// ---------------------------------------------------------
+// CMailCpsHandler::IsPluginInArray
+// ---------------------------------------------------------
+//
+TBool CMailCpsHandler::IsPluginInArray( const TInt aPluginId, RPointerArray<CMailPluginProxy>& aPlugins )
+    {
+    FUNC_LOG;
+    TBool found( EFalse );
+    for ( TInt i = 0; i < aPlugins.Count(); i++ )
+        {
+        if ( aPlugins[i]->PluginId() == aPluginId )
+            {
+            found = ETrue;
+            }
+        }
+    return found;
+    }
+
+// ---------------------------------------------------------
 // CMailCpsHandler::CreateMailboxDetailsL
 // ---------------------------------------------------------
 //
@@ -186,6 +311,7 @@
     Reset();
     // Trying to keep callback interface non-leaving
     TRAP_IGNORE( InitializeL() );
+    TRAP_IGNORE( InitializeExternalAccountsL() );
     // Update widget contents after settings change
     TRAP_IGNORE( UpdateFullL() );
     }
@@ -215,24 +341,30 @@
     FUNC_LOG;
     TInt row(1); // start from first row
     TInt mailbox(0);
-    
+    TBool found( EFalse );
+    // try to find mailbox with matching contentId
     for ( mailbox = 0; mailbox < iAccountsArray.Count(); mailbox++ )
-        {           
-        TInt compare = aContentId.Compare(*iAccountsArray[mailbox]->iWidgetInstance);
-        if (!compare)
+        {
+        if ( !aContentId.Compare( *iAccountsArray[mailbox]->iWidgetInstance ) )
             {
+            INFO_1("iAccountsArray.Count() == %d", iAccountsArray.Count());
+            found = ETrue;
             break;
             }
         }
 
-    // Update fields from left to right
-    UpdateMailBoxIconL( mailbox, aInstance, row );
-    UpdateMailboxNameL( mailbox, aInstance, row );
-	UpdateIndicatorIconL( mailbox, aInstance, row );
-	row++;
-	UpdateMessagesL( mailbox, aInstance, 1, row);
-	row++;
-	UpdateMessagesL( mailbox, aInstance, 2, row);
+    // if contentId found from array, update the mailbox
+    if ( found )
+        {
+        // Update fields from left to right
+        UpdateMailBoxIconL( mailbox, aInstance, row );
+        UpdateMailboxNameL( mailbox, aInstance, row );
+        UpdateIndicatorIconL( mailbox, aInstance, row );
+        row++;
+        UpdateMessagesL( mailbox, aInstance, 1, row);
+        row++;
+        UpdateMessagesL( mailbox, aInstance, 2, row);
+        }
     }
 
 // ---------------------------------------------------------
@@ -601,18 +733,18 @@
         TFSMailMsgId mailBoxId;
         mailBoxId = iAccountsArray[aMailBoxNumber]->iMailboxId;    
     
-        if ( GetUnseenCountL(mailBoxId) > 0 )
+        if ( iSettings->GetNewMailState( mailBoxId ) )
             {
             iLiwIf->PublishIndicatorIconL( aWidgetInstance,
                                            aRowNumber,
-                                           EMbmCmailhandlerpluginQgn_indi_ai_eplg_unread );
+                                           EMbmCmailhandlerpluginQgn_stat_message_mail_uni );
             }
     
         else if( !IsOutboxEmptyL(mailBoxId) )
             {
             iLiwIf->PublishIndicatorIconL( aWidgetInstance,
                                            aRowNumber,                
-                                           EMbmCmailhandlerpluginQgn_prop_mce_outbox_small);
+                                           EMbmCmailhandlerpluginQgn_indi_cmail_outbox_msg);
             }
         else
             {    
@@ -704,11 +836,13 @@
         case TFSEventMailboxRenamed:
             {
             HandleMailboxRenamedEventL( aMailbox );
+            UpdateFullL();
             break;
             }
         case TFSEventMailboxDeleted:
             {
             HandleMailboxDeletedEventL( aMailbox );
+            UpdateFullL();
             break;
             }
         case TFSEventMailboxSettingsChanged:
@@ -720,11 +854,13 @@
         case TFSEventNewMail:
             {
             HandleNewMailEventL( aMailbox, aParam1, aParam2 );
+            UpdateFullL();
             break;
             }
         case TFSEventMailDeleted:
             {
             HandleMailDeletedEventL( aMailbox, aParam1, aParam2 );
+            UpdateFullL();
             break;
             }
         case TFSEventMailChanged:
@@ -742,7 +878,6 @@
             break;
             }            
         }
-	UpdateFullL();
     }
 
 // ---------------------------------------------------------
@@ -831,6 +966,7 @@
 
             // Remove from cenrep
             iSettings->RemoveMailboxL( aMailbox );
+            iSettings->ToggleWidgetNewMailIconL( EFalse, aMailbox );
             break;
             }
         }
@@ -844,6 +980,9 @@
     TFSMailMsgId aMailbox, TAny* aParam1, TAny* aParam2 )
     {
     FUNC_LOG;
+    
+    iSettings->ToggleWidgetNewMailIconL( ETrue, aMailbox );
+    
     // Basic assertions
     if ( !aParam1 || !aParam2 )
         {
@@ -1589,28 +1728,38 @@
     {
     FUNC_LOG;
 
-    TUid mailBoxUid;
-    mailBoxUid.iUid = iSettings->GetMailboxUidByContentId(aContentId);
-    TFSMailMsgId mailBoxId;
-    mailBoxId.SetId(mailBoxUid.iUid);
-    TUid pluginUid;
-    pluginUid.iUid = iSettings->GetPluginUidByContentId(aContentId);
-    mailBoxId.SetPluginId(pluginUid);
-    CFSMailBox* mailBox = MailClient().GetMailBoxByUidL( mailBoxId );
-    CleanupStack::PushL( mailBox );
-    if ( mailBox )
+    TInt nativeMailboxId( iSettings->GetMailboxUidByContentId( aContentId ) );
+    // Is the contentId related to internal mailbox or external?
+    if( nativeMailboxId )
         {
-        TFSMailMsgId inboxFolderId = mailBox->GetStandardFolderId( EFSInbox );    
+        TUid mailBoxUid;
+        mailBoxUid.iUid = nativeMailboxId;
         
-        TMailListActivationData tmp;
-        tmp.iFolderId = inboxFolderId;
-        tmp.iMailBoxId = mailBoxId; 
-        const TPckgBuf<TMailListActivationData> pkgOut( tmp );
-        iEnv->EikAppUi()->ActivateViewL( TVwsViewId(KUidEmailUi, KMailListId), 
-                                         KStartListWithFolderId, 
-                                         pkgOut);
+        TFSMailMsgId mailBoxId;
+        mailBoxId.SetId(mailBoxUid.iUid);
+        TUid pluginUid;
+        pluginUid.iUid = iSettings->GetPluginUidByContentId(aContentId);
+        mailBoxId.SetPluginId(pluginUid);
+        CFSMailBox* mailBox = MailClient().GetMailBoxByUidL( mailBoxId );
+        CleanupStack::PushL( mailBox );
+        if ( mailBox )
+            {
+            TFSMailMsgId inboxFolderId = mailBox->GetStandardFolderId( EFSInbox );
+    
+            TMailListActivationData tmp;
+            tmp.iFolderId = inboxFolderId;
+            tmp.iMailBoxId = mailBoxId;
+            const TPckgBuf<TMailListActivationData> pkgOut( tmp );
+            iEnv->EikAppUi()->ActivateViewL( TVwsViewId(KUidEmailUi, KMailListId),
+                                             KStartListWithFolderId,
+                                             pkgOut);
+            }
+        CleanupStack::PopAndDestroy( mailBox );
         }
-    CleanupStack::PopAndDestroy( mailBox );
+    else
+        {
+        LaunchExtAppL( aContentId );
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -1625,6 +1774,55 @@
                                      viewUid, 
                                      KNullDesC8);
     }
+
+// -----------------------------------------------------------------------------
+//  CMailCpsHandler::LaunchExtAppL()
+// -----------------------------------------------------------------------------
+//
+void CMailCpsHandler::LaunchExtAppL( const TDesC& aContentId )
+    {
+    FUNC_LOG;
+    CMailPluginProxy* plugin = GetExtPluginL( aContentId );
+    if ( plugin )
+        {
+        plugin->LaunchExtAppL( aContentId );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+//  CMailCpsHandler::GetExtPluginL
+// -----------------------------------------------------------------------------
+//
+CMailPluginProxy* CMailCpsHandler::GetExtPluginL( const TDesC& aContentId )
+    {
+    FUNC_LOG;
+    CMailPluginProxy* plugin( NULL );
+    for( TInt i = 0; i < iExternalPlugins.Count(); i++ )
+        {
+        if ( iExternalPlugins[i]->HasAccount( aContentId ) )
+            {
+            plugin = iExternalPlugins[i];
+            }
+        }
+    return plugin;
+    }
+
+// -----------------------------------------------------------------------------
+//  CMailCpsHandler::UpdateExtAccountL
+// -----------------------------------------------------------------------------
+//
+void CMailCpsHandler::UpdateExtAccountL( const TDesC& aContentId )
+    {
+    FUNC_LOG;
+    // Look up plugin that handles this account
+    CMailPluginProxy* plugin = GetExtPluginL( aContentId );
+    if ( plugin )
+        {
+        // Publish its data
+        plugin->UpdateAccountL( aContentId );
+        }
+    }
+
 // ---------------------------------------------------------------------------
 // CMailCpsHandler::AssociateWidget
 // ---------------------------------------------------------------------------
@@ -1652,13 +1850,50 @@
     }
 
 // ---------------------------------------------------------------------------
+// CMailCpsHandler::TotalMailboxCount
+// ---------------------------------------------------------------------------
+//
+TInt CMailCpsHandler::TotalMailboxCountL()
+    {
+    FUNC_LOG;
+    return TotalIntMailboxCount() + TotalExtMailboxCountL();
+    }
+
+// ---------------------------------------------------------------------------
 // CMailCpsHandler::GetMailboxCount
 // ---------------------------------------------------------------------------
 //
-TInt CMailCpsHandler::GetMailboxCount()
+TInt CMailCpsHandler::TotalIntMailboxCount()
+    {
+    FUNC_LOG;
+    return iSettings->TotalIntMailboxCount();
+    }
+
+// ---------------------------------------------------------
+// CMailCpsHandler::TotalExtMailboxCount
+// ---------------------------------------------------------
+//
+TInt CMailCpsHandler::TotalExtMailboxCountL()
     {
     FUNC_LOG;
-    return iSettings->GetTotalMailboxCount();
+    TInt totalMailboxCount( 0 );
+    TUid interfaceUid = TUid::Uid( KEmailObserverInterfaceUid );
+    RImplInfoPtrArray plugins;
+    CleanupClosePushL( plugins );
+    REComSession::ListImplementationsL( interfaceUid, plugins);
+
+    for ( TInt i = 0; i < plugins.Count(); i++ )
+        {
+        TUid implUid = plugins[i]->ImplementationUid();
+        INFO_1("Instantiating plugin %d", implUid.iUid);
+        EmailInterface::CEmailObserverPlugin* plugin = 
+            EmailInterface::CEmailObserverPlugin::NewL( implUid, this );
+        MEmailData& data( plugin->EmailDataL() );
+        totalMailboxCount += data.MailboxesL().Count();
+        }
+    
+    CleanupStack::PopAndDestroy(); // plugins
+    return totalMailboxCount;
     }
 
 // ---------------------------------------------------------------------------
@@ -1681,7 +1916,7 @@
         if (!iSettings->FindFromContentIdListL(aContentId))
             {
             iSettings->AddToContentIdListL(aContentId);
-            if (GetMailboxCount())
+            if ( TotalMailboxCountL() )
                 {
                 LaunchWidgetSettingsL(aContentId);
                 }
@@ -1719,3 +1954,10 @@
     return ret;
     }
 
+// ---------------------------------------------------------------------------
+// CMailCpsHandler::EmailObserverEvent
+// ---------------------------------------------------------------------------
+void CMailCpsHandler::EmailObserverEvent( EmailInterface::MEmailData& /*aData*/ )
+    {
+    // Nothing to do
+    }
--- a/emailservices/emailserver/cmailhandlerplugin/src/cmailcpsif.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailserver/cmailhandlerplugin/src/cmailcpsif.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008 - 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2008 - 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,7 +23,7 @@
 #include <emailwidget.rsg>
 
 #include "emailtrace.h"
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 #include "cmailcpsif.h"
 #include "cmailcpsifconsts.h"
 #include "FreestyleEmailUiConstants.h"
@@ -74,6 +74,8 @@
     iMsgInterface = GetMessagingInterfaceL();
     RegisterForObserverL();
     PublisherRegisteryActionL();
+    
+    ResetPublishedDataL( KCPAll );
     }
 
 // ---------------------------------------------------------------------------
@@ -232,6 +234,31 @@
     }
 
 // ---------------------------------------------------------------------------
+// CMailCpsIf::PublishActiveMailboxNameL
+// ---------------------------------------------------------------------------
+//
+void CMailCpsIf::PublishMailboxNameL(
+    const TInt aInstance, 
+    const TDesC& aMailboxName,
+    const TDesC8& aAction )
+    {
+    FUNC_LOG;
+    
+    TBuf<KMaxDescLen> contentType;
+    contentType.Copy(KContTypeBodyText);        
+    contentType.Append(_L("1"));
+    
+    TBuf<KMaxDescLen> textKey;
+    textKey.Copy(KKeyBodyText);
+    textKey.Append(_L("1"));
+
+    TFSMailMsgId dummy;
+    
+    PublishDescriptorL( KPubId, contentType, iInstIdList[aInstance]->Des(),
+        aMailboxName, textKey, aAction, 0, dummy, dummy );
+    }
+
+// ---------------------------------------------------------------------------
 // CMailCpsIf::PublishIndicatorIconL
 // ---------------------------------------------------------------------------
 //
@@ -300,6 +327,71 @@
     }
 
 // ---------------------------------------------------------------------------
+// CMailCpsIf::PublishMailboxIconL
+// ---------------------------------------------------------------------------
+//
+void CMailCpsIf::PublishMailboxIconL( const TInt aInstance, const TDesC& aIconPath )
+    {
+    FUNC_LOG;
+
+    TBuf<KMaxDescLen> contentType;
+    contentType.Copy(KContTypeMailboxIcons);        
+    contentType.Append(_L("1"));
+
+    TBuf8<KMaxDescLen> key;
+    key.Copy(KKeyMailboxIcons);     
+    key.Append(_L8("1"));
+
+    User::LeaveIfNull( iInstIdList[aInstance] );
+    PublishIconReferenceL(
+        iInstIdList[aInstance]->Des(),
+        contentType,
+        key,
+        aIconPath );
+    }
+
+// ---------------------------------------------------------------------------
+// CMailCpsIf::PublishIconReferenceL
+// ---------------------------------------------------------------------------
+//
+void CMailCpsIf::PublishIconReferenceL(
+    const TDesC& aContentId,
+    const TDesC& aContentType,
+    const TDesC8& aKey,
+    const TDesC& aIconPath )
+    {
+    FUNC_LOG;
+    CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL());
+    CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL());
+
+    TLiwGenericParam type( KType, TLiwVariant( KCpData ) );
+    inparam->AppendL( type );
+
+    CLiwDefaultMap* pdatamap = CLiwDefaultMap::NewLC();
+    CLiwDefaultMap* datamap = CLiwDefaultMap::NewLC();
+
+    pdatamap->InsertL( KPublisherId, TLiwVariant( KPubId ) );
+    pdatamap->InsertL( KContentType, TLiwVariant( aContentType ) );
+    pdatamap->InsertL( KContentId, TLiwVariant( aContentId ) );
+    
+    datamap->InsertL( aKey, TLiwVariant( aIconPath ) );
+
+    pdatamap->InsertL( KDataMap, TLiwVariant(datamap) );
+    TLiwGenericParam item( KItem, TLiwVariant( pdatamap ) );       
+    inparam->AppendL( item );
+    
+    iMsgInterface->ExecuteCmdL( KAdd, *inparam, *outparam );
+    
+    CleanupStack::PopAndDestroy( datamap );
+    CleanupStack::PopAndDestroy( pdatamap );    
+    
+    item.Reset();
+    type.Reset();
+    outparam->Reset();
+    inparam->Reset();
+    }
+
+// ---------------------------------------------------------------------------
 // CMailCpsIf::PublishMailDetailL
 // ---------------------------------------------------------------------------
 //
@@ -492,6 +584,7 @@
         iconIds.Append( KSpace );
         id.Num( aBitmapMaskId );
         iconIds.Append( id );
+        iconIds.Append( _L(")") );        
         }
 
     // The actual image publishing part starts here   
@@ -668,14 +761,14 @@
 // ---------------------------------------------------------------------------
 //
 TInt CMailCpsIf::HandleNotifyL(
-        TInt aErrorCode,
+        TInt /*aCmdId*/,
         TInt /*aEventId*/,
         CLiwGenericParamList& aEventParamList,
         const CLiwGenericParamList& /*aInParamList*/ )
     {
     FUNC_LOG;
     PublisherStatusL  ( aEventParamList);
-    return aErrorCode;
+    return KErrNone;
     }
    
 // ---------------------------------------------------------------------------
@@ -751,6 +844,7 @@
                              TInt widgetInstance = FindWidgetInstanceId(cid->Des());
                              PublishSetupWizardL(widgetInstance);
                              iMailCpsHandler->UpdateMailboxesL(widgetInstance, cid->Des());
+                             iMailCpsHandler->UpdateExtAccountL( cid->Des() );
                              // Widget visible on the homescreen. Publishing allowed.
                              iAllowedToPublish[widgetInstance] = ETrue;
                              iInactive[widgetInstance] = EFalse;
@@ -776,6 +870,7 @@
                              {                            
                              // Widget removed from homescreen.
                              HBufC* cid = contentid.AllocLC();
+                             ResetPublishedDataL( cid->Des() );
                              TInt widgetInstance = FindWidgetInstanceId(cid->Des());
                              if (widgetInstance != KErrNotFound )
                             	 {
@@ -799,7 +894,7 @@
                              {
                              // If no accounts are created launch email wizard
                              // otherwice launch widget settings app                             
-                             if (iMailCpsHandler->GetMailboxCount())
+                             if ( iMailCpsHandler->TotalMailboxCountL() )
                                  {
                                  HBufC* cid = contentid.AllocLC();
                                  iMailCpsHandler->LaunchWidgetSettingsL(cid->Des());
@@ -877,3 +972,35 @@
     return instance;
     }
 
+// ---------------------------------------------------------------------------
+// CMailCpsIf::ResetPublishedDataL
+// ---------------------------------------------------------------------------
+//
+void CMailCpsIf::ResetPublishedDataL( const TDesC& aContentId )
+    {
+    FUNC_LOG;
+    // Clean up all published data
+    if( !iMsgInterface ) GetMessagingInterfaceL();
+    CLiwGenericParamList* inParam = &(iServiceHandler->InParamListL());
+    CLiwGenericParamList* outParam = &(iServiceHandler->OutParamListL());
+
+    // Fill input param
+    TLiwGenericParam cptype( KType, TLiwVariant( KCpData ));
+    inParam->AppendL( cptype );
+
+    CLiwDefaultMap* cpData = CLiwDefaultMap::NewLC();
+    cpData->InsertL( KPublisherId, TLiwVariant( KPubId ) );
+    cpData->InsertL( KContentType, TLiwVariant( KCPAll ) );
+    cpData->InsertL( KContentId, TLiwVariant( aContentId ) );
+    TLiwGenericParam item( KData8, TLiwVariant( cpData ) );
+    inParam->AppendL( item );
+
+    // Execute command
+    iMsgInterface->ExecuteCmdL( KDelete , *inParam, *outParam );
+    
+    CleanupStack::PopAndDestroy( cpData );
+    item.Reset();
+    cptype.Reset();
+    outParam->Reset();
+    inParam->Reset();
+    }
--- a/emailservices/emailserver/cmailhandlerplugin/src/cmailcpssettings.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailserver/cmailhandlerplugin/src/cmailcpssettings.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008 - 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2008 - 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,17 +20,19 @@
 #include <e32base.h>
 // CRepository
 #include <centralrepository.h>
+
 // Email Framework APIs
 //<cmail>
-#include "CFSMailCommon.h"
-#include "CFSMailClient.h"
-#include "CFSMailBox.h"
-#include "CFSMailFolder.h"
+#include "cfsmailcommon.h"
+#include "cfsmailclient.h"
+#include "cfsmailbox.h"
+#include "cfsmailfolder.h"
 //</cmail>
 
 #include "cmailcpssettings.h"
 #include "cmailwidgetcenrepkeysinternal.h"
 #include "cmailcpsifconsts.h"
+#include "cmailexternalaccount.h"
 
 // ======== MEMBER FUNCTIONS ========
 
@@ -96,10 +98,10 @@
 void CMailCpsSettings::RunL()
     {
     FUNC_LOG;
+    StartObservingL();
     LoadSettingsL(); // mailboxes etc. user changeable data
     LoadConfigurationL(); // internal configuration data
     iObserver->SettingsChangedCallback();
-    StartObservingL();
     }
 
 // ---------------------------------------------------------------------------
@@ -192,6 +194,20 @@
     }
 
 // ---------------------------------------------------------------------------
+// CMailCpsSettings::GetMailboxNonZeroKeysL
+// ---------------------------------------------------------------------------
+//
+void CMailCpsSettings::GetExtMailboxNonZeroKeysL( RArray<TUint32>& aKeys )
+    {
+    FUNC_LOG;
+    TInt ret = iCenRep->FindNeqL( KCmailExtMailboxKeyRange, KCmailExtMailboxRangeMask, 0, aKeys );
+    if ( ret != KErrNone && ret != KErrNotFound )
+        {
+        User::Leave( ret );
+        }
+    }
+
+// ---------------------------------------------------------------------------
 // CMailCpsSettings::ResolveMailbox
 // ---------------------------------------------------------------------------
 //
@@ -266,10 +282,53 @@
 //
 RArray<TFSMailMsgId>& CMailCpsSettings::Mailboxes()
     {
+    FUNC_LOG;
     return iMailboxArray;
     }
 
 // ---------------------------------------------------------------------------
+// CMailCpsSettings::ExternalMailboxes
+// ---------------------------------------------------------------------------
+//
+void CMailCpsSettings::GetExtMailboxesL( RPointerArray<CMailExternalAccount>& aAccounts )
+    {
+    FUNC_LOG;
+    RArray<TUint32> keys;
+    CleanupClosePushL( keys );
+    GetExtMailboxNonZeroKeysL( keys );
+
+    for ( TInt i = 0; i < keys.Count(); i++ )
+        {
+        CMailExternalAccount* account = GetExtMailboxL( keys[i] );
+        CleanupStack::PushL( account );
+        aAccounts.AppendL( account );
+        CleanupStack::Pop( account );
+        }
+
+    CleanupStack::PopAndDestroy(); // keys
+    }
+
+// ---------------------------------------------------------------------------
+// CMailCpsSettings::GetExtMailboxL
+// ---------------------------------------------------------------------------
+//
+CMailExternalAccount* CMailCpsSettings::GetExtMailboxL( TInt aKey )
+    {
+    FUNC_LOG;
+    TInt mailboxId( 0 );
+    TInt pluginId( 0 );
+    HBufC* contentIdBuf = HBufC::NewL( KMaxDescLen );
+    TPtr contentId = contentIdBuf->Des();
+
+    User::LeaveIfError( iCenRep->Get( aKey, mailboxId ) );
+    User::LeaveIfError( iCenRep->Get( aKey + KCMailExtPluginIdOffset, pluginId ) );
+    User::LeaveIfError( iCenRep->Get( aKey + KCMailExtWidgetCidOffset, contentId ) );
+
+    return CMailExternalAccount::NewL(
+        mailboxId, pluginId, contentIdBuf );
+    }
+
+// ---------------------------------------------------------------------------
 // CMailCpsSettings::AddMailboxL
 // ---------------------------------------------------------------------------
 //
@@ -579,10 +638,10 @@
     }
 
 // ---------------------------------------------------------------------------
-// CMailCpsSettings::GetTotalMailboxCount
+// CMailCpsSettings::TotalIntMailboxCount
 // ---------------------------------------------------------------------------
 //
-TInt CMailCpsSettings::GetTotalMailboxCount()
+TInt CMailCpsSettings::TotalIntMailboxCount()
     {
     FUNC_LOG;
     RPointerArray<CFSMailBox> mailboxarray;
@@ -661,3 +720,68 @@
         iCenRep->Set( key, value );        
         }
     }
+
+// -----------------------------------------------------------------------------
+// CMailCpsSettings::ToggleWidgetNewMailIconL
+// -----------------------------------------------------------------------------
+void CMailCpsSettings::ToggleWidgetNewMailIconL( TBool aIconOn, const TFSMailMsgId& aMailBox )
+    {
+    FUNC_LOG;
+    TBuf<KMaxDescLen> mailbox;
+    mailbox.Num(aMailBox.Id());
+
+    TBuf<KMaxDescLen> str;
+    str.Copy(KStartSeparator);    
+    str.Append(mailbox);
+    str.Append(KEndSeparator);    
+
+    TBuf<KMaxDescLen> stored;
+    TUint32 key(KCMailMailboxesWithNewMail);
+    iCenRep->Get( key, stored );
+    
+    TInt result = stored.Find(str);
+    
+    if (aIconOn)
+        {
+        if (result < 0) // Not found
+            {
+            stored.Append(str);
+            iCenRep->Set( key, stored );
+            }
+        }
+    else
+        {
+        if (result >= 0)
+            {
+            stored.Delete(result, str.Length());
+            iCenRep->Set( key, stored );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CMailCpsSettings::GetNewMailState
+// -----------------------------------------------------------------------------
+TBool CMailCpsSettings::GetNewMailState( const TFSMailMsgId& aMailBox )
+    {
+    FUNC_LOG;
+    TBool ret(EFalse);
+    TBuf<KMaxDescLen> mailbox;
+    mailbox.Num(aMailBox.Id());
+
+    TBuf<KMaxDescLen> str;
+    str.Copy(KStartSeparator);    
+    str.Append(mailbox);
+    str.Append(KEndSeparator);    
+
+    TBuf<KMaxDescLen> stored;
+    TUint32 key(KCMailMailboxesWithNewMail);
+    iCenRep->Get( key, stored );
+    
+    TInt result = stored.Find(str);
+    if (result >= 0)
+        {
+        ret = ETrue;
+        }
+    return ret;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailserver/cmailhandlerplugin/src/cmailcpsutils.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Class to handle content publishing for widget
+*
+*/
+
+#include "emailtrace.h"
+#include "cmailcpsutils.h"
+#include "cmailhandlerplugin.mbg"
+
+using namespace EmailInterface;
+
+// ---------------------------------------------------------
+// CMailCpsUtils::ResolveIndicatorIcon
+// ---------------------------------------------------------
+//
+TInt TMailCpsUtils::ResolveIcon(
+    TBool aUnread,
+    TBool aCalMsg,
+    TBool aAttas,
+    EmailInterface::TEmailPriority aPrio,
+    TBool aRe,
+    TBool aFw )
+    {
+    FUNC_LOG;
+    if ( !aUnread && !aCalMsg && !aAttas && aPrio == ENormal && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read;
+    if ( !aUnread && !aCalMsg && aAttas && aPrio == ENormal && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_attach;
+    if ( !aUnread && !aCalMsg && aAttas && aPrio == EHigh && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_attach_high_prio;
+    if ( !aUnread && !aCalMsg && aAttas && aPrio == ELow && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_attach_low_prio;
+    if ( !aUnread && !aCalMsg && !aAttas && aPrio == ENormal && !aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_forwarded;
+    if ( !aUnread && !aCalMsg && aAttas && aPrio == ENormal && !aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_forwarded_attach;
+    if ( !aUnread && !aCalMsg && aAttas && aPrio == EHigh && !aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_forwarded_attach_high_prio;
+    if ( !aUnread && !aCalMsg && aAttas && aPrio == ELow && !aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_forwarded_attach_low_prio;
+    if ( !aUnread && !aCalMsg && !aAttas && aPrio == EHigh && !aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_forwarded_high_prio;
+    if ( !aUnread && !aCalMsg && !aAttas && aPrio == ELow && !aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_forwarded_low_prio;    
+    if ( !aUnread && !aCalMsg && !aAttas && aPrio == EHigh && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_high_prio;
+    if ( !aUnread && !aCalMsg && !aAttas && aPrio == ELow && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_low_prio;
+    if ( !aUnread && !aCalMsg && !aAttas && aPrio == ENormal && aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_replied;
+    if ( !aUnread && !aCalMsg && aAttas && aPrio == ENormal && aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_replied_attach;
+    if ( !aUnread && !aCalMsg && aAttas && aPrio == EHigh && aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_replied_attach_high_prio;
+    if ( !aUnread && !aCalMsg && aAttas && aPrio == ELow && aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_replied_attach_low_prio;
+    if ( !aUnread && !aCalMsg && !aAttas && aPrio == ENormal && aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_replied_forwarded;
+    if ( !aUnread && !aCalMsg && aAttas && aPrio == ENormal && aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_replied_forwarded_attach;
+    if ( !aUnread && !aCalMsg && aAttas && aPrio == EHigh && aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_replied_forwarded_attach_high_prio;
+    if ( !aUnread && !aCalMsg && aAttas && aPrio == ELow && aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_replied_forwarded_attach_low_prio;
+    if ( !aUnread && !aCalMsg && !aAttas && aPrio == EHigh && aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_replied_forwarded_high_prio;
+    if ( !aUnread && !aCalMsg && !aAttas && aPrio == EHigh && aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_replied_high_prio;
+    if ( !aUnread && !aCalMsg && !aAttas && aPrio == ELow && aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_read_replied_low_prio;
+    if ( aUnread && !aCalMsg && !aAttas && aPrio == ENormal && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread;
+    if ( aUnread && !aCalMsg && aAttas && aPrio == ENormal && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_attach;
+    if ( aUnread && !aCalMsg && aAttas && aPrio == EHigh && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_attach_high_prio;
+    if ( aUnread && !aCalMsg && aAttas && aPrio == ELow && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_attach_low_prio;
+    if ( aUnread && !aCalMsg && !aAttas && aPrio == ENormal && !aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_forwarded;
+    if ( aUnread && !aCalMsg && aAttas && aPrio == ENormal && !aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_forwarded_attach;
+    if ( aUnread && !aCalMsg && aAttas && aPrio == EHigh && !aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_forwarded_attach_high_prio;
+    if ( aUnread && !aCalMsg && aAttas && aPrio == ELow && !aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_forwarded_attach_low_prio;
+    if ( aUnread && !aCalMsg && !aAttas && aPrio == EHigh && !aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_forwarded_high_prio;
+    if ( aUnread && !aCalMsg && !aAttas && aPrio == ELow && !aRe && aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_forwarded_low_prio;
+    if ( aUnread && !aCalMsg && !aAttas && aPrio == EHigh && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_high_prio;
+    if ( aUnread && !aCalMsg && !aAttas && aPrio == ELow && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_low_prio;
+    if ( aUnread && !aCalMsg && !aAttas && aPrio == ENormal && aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_replied;
+    if ( aUnread && !aCalMsg && aAttas && aPrio == ENormal && aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_replied_attach;
+    if ( aUnread && !aCalMsg && aAttas && aPrio == EHigh && aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_replied_attach_high_prio;
+    if ( aUnread && !aCalMsg && aAttas && aPrio == ELow && aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_replied_attach_low_prio;
+    if ( aUnread && !aCalMsg && !aAttas && aPrio == EHigh && aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_replied_high_prio;
+    if ( aUnread && !aCalMsg && !aAttas && aPrio == ELow && aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_unread_replied_low_prio;
+    if ( aUnread && aCalMsg && !aAttas && aPrio == ENormal && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_calendar_event_unread;
+    if ( aUnread && aCalMsg && aAttas && aPrio == ENormal && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_calendar_event_unread_attachments;
+    if ( aUnread && aCalMsg && !aAttas && aPrio == EHigh && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_calendar_event_unread_high_prio;
+    if ( aUnread && aCalMsg && aAttas && aPrio == EHigh && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_calendar_event_unread_attachments_high_prio;
+    if ( aUnread && aCalMsg && !aAttas && aPrio == ELow && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_calendar_event_unread_low_prio;
+    if ( aUnread && aCalMsg && aAttas && aPrio == ELow && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_calendar_event_unread_attachments_low_prio;
+    if ( !aUnread && aCalMsg && !aAttas && aPrio == ENormal && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_calendar_event_read;
+    if ( !aUnread && aCalMsg && aAttas && aPrio == ENormal && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_calendar_event_read_attachments;
+    if ( !aUnread && aCalMsg && !aAttas && aPrio == EHigh && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_calendar_event_read_high_prio;
+    if ( !aUnread && aCalMsg && aAttas && aPrio == EHigh && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_calendar_event_read_attachments_high_prio;
+    if ( !aUnread && aCalMsg && !aAttas && aPrio == ELow && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_calendar_event_read_low_prio;
+    if ( !aUnread && aCalMsg && aAttas && aPrio == ELow && !aRe && !aFw ) return EMbmCmailhandlerpluginQgn_indi_cmail_calendar_event_read_attachments_low_prio;
+
+    // default
+    return EMbmCmailhandlerpluginQgn_indi_cmail_read;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailserver/cmailhandlerplugin/src/cmailexternalaccount.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,97 @@
+/*
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This file implements class CMailMailboxDetails.
+*
+*/
+
+#include "emailtrace.h"
+#include "cmailexternalaccount.h"
+
+// ---------------------------------------------------------
+// CMailExternalAccount::NewL
+// ---------------------------------------------------------
+//
+CMailExternalAccount* CMailExternalAccount::NewL(
+    const TInt aMailboxId,
+    const TInt aPluginId,
+    HBufC* aContentId )
+    {
+    FUNC_LOG;
+    CMailExternalAccount* self = new(ELeave) CMailExternalAccount( aMailboxId, aPluginId, aContentId );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CMailExternalAccount::CMailExternalAccount
+// ---------------------------------------------------------
+//
+CMailExternalAccount::CMailExternalAccount(
+    const TInt aMailboxId,
+    const TInt aPluginId,
+    HBufC* aContentId ) :
+    iMailboxId( aMailboxId ),
+    iPluginId( aPluginId ),
+    iContentId( aContentId )
+    {
+    FUNC_LOG;
+    }
+
+// ---------------------------------------------------------
+// CMailExternalAccount::~CMailExternalAccount
+// ---------------------------------------------------------
+//
+CMailExternalAccount::~CMailExternalAccount()
+    {
+    FUNC_LOG;
+    delete iContentId;
+    }
+
+// ---------------------------------------------------------
+// CMailExternalAccount::ConstructL
+// ---------------------------------------------------------
+//
+void CMailExternalAccount::ConstructL()
+    {
+    FUNC_LOG;
+    }
+
+// ---------------------------------------------------------
+// CMailExternalAccount::MailboxId
+// ---------------------------------------------------------
+//
+TInt CMailExternalAccount::MailboxId()
+    {
+    return iMailboxId;
+    }
+
+// ---------------------------------------------------------
+// CMailExternalAccount::PluginId
+// ---------------------------------------------------------
+//
+TInt CMailExternalAccount::PluginId()
+    {
+    return iPluginId;
+    }
+
+// ---------------------------------------------------------
+// CMailExternalAccount::ContentId
+// ---------------------------------------------------------
+//
+TDesC& CMailExternalAccount::ContentId()
+    {
+    return *iContentId;
+    }
--- a/emailservices/emailserver/cmailhandlerplugin/src/cmailmessagedetails.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailserver/cmailhandlerplugin/src/cmailmessagedetails.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,8 +18,8 @@
 
 //<cmail>
 #include "emailtrace.h"
-#include "CFSMailBox.h"
-#include "CFSMailFolder.h"
+#include "cfsmailbox.h"
+#include "cfsmailfolder.h"
 //</cmail>
 
 #include "cmailmessagedetails.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailserver/cmailhandlerplugin/src/cmailpluginproxy.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -0,0 +1,483 @@
+/*
+* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This file implements class CMailMailboxDetails.
+*
+*/
+
+#include <cmailhandlerplugin.mbg> // icons
+#include <StringLoader.h>
+#include <emailwidget.rsg>
+
+#include <memaildata.h>
+#include <emailobserverplugin.h>
+#include <memailmailboxdata.h>
+#include <memailapplaunchdata.h>
+
+#include "emailtrace.h"
+#include "cmailpluginproxy.h"
+#include "cmailexternalaccount.h"
+#include "cmailcpsif.h"
+#include "cmailcpsutils.h"
+
+using namespace EmailInterface;
+
+// ---------------------------------------------------------
+// CMailPluginProxy::NewL
+// ---------------------------------------------------------
+//
+CMailPluginProxy* CMailPluginProxy::NewL(
+    const TInt aPluginId,
+    CMailCpsIf& aPublisher )
+    {
+    FUNC_LOG;
+    CMailPluginProxy* self = new(ELeave) CMailPluginProxy( aPluginId, aPublisher );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CMailPluginProxy::CMailPluginProxy
+// ---------------------------------------------------------
+//
+CMailPluginProxy::CMailPluginProxy(
+    const TInt aPluginId,
+    CMailCpsIf& aPublisher ) :
+    iPluginId( aPluginId ),
+    iPublisher( aPublisher )
+    {
+    FUNC_LOG;
+    }
+
+// ---------------------------------------------------------
+// CMailPluginProxy::~CMailPluginProxy
+// ---------------------------------------------------------
+//
+CMailPluginProxy::~CMailPluginProxy()
+    {
+    FUNC_LOG;
+    delete iPlugin;
+    TRAP_IGNORE( RemoveAccountsL() );
+    iAccounts.ResetAndDestroy();
+    }
+
+// ---------------------------------------------------------
+// CMailPluginProxy::ConstructL
+// ---------------------------------------------------------
+//
+void CMailPluginProxy::ConstructL()
+    {
+    FUNC_LOG;
+    TUid implUid = TUid::Uid( iPluginId ); 
+    iPlugin = EmailInterface::CEmailObserverPlugin::NewL( implUid, this );
+    }
+
+// ---------------------------------------------------------
+// CMailPluginProxy::EmailObserverEvent
+// ---------------------------------------------------------
+//
+void CMailPluginProxy::EmailObserverEvent( MEmailData& /*aData*/ )
+    {
+    FUNC_LOG;
+    TRAP_IGNORE( PublishAccountsL() );
+    }
+
+// ---------------------------------------------------------
+// CMailPluginProxy::PluginId
+// ---------------------------------------------------------
+//
+TInt CMailPluginProxy::PluginId()
+    {
+    FUNC_LOG;
+    return iPluginId;
+    }
+
+// ---------------------------------------------------------
+// CMailPluginProxy::RemoveAccountsL
+// ---------------------------------------------------------
+//
+void CMailPluginProxy::RemoveAccountsL()
+    {
+    FUNC_LOG;
+    while ( iAccounts.Count() )
+        {
+        ResetAccountL( iAccounts[0]->ContentId() );
+        delete iAccounts[0];
+        iAccounts.Remove(0);
+        }
+    }
+
+// ---------------------------------------------------------
+// CMailPluginProxy::ResetAccountL
+// ---------------------------------------------------------
+//
+void CMailPluginProxy::ResetAccountL( const TDesC& aContentId )
+    {
+    FUNC_LOG;
+    TInt instId = ResolveWidgetInstance( aContentId );
+    if ( instId >= 0 )
+        {
+        TFSMailMsgId dummy;
+        iPublisher.PublishMailboxIconL( instId, KNullDesC );
+        iPublisher.PublishActiveMailboxNameL( instId, 1, KNullDesC, 0, dummy, dummy );
+        iPublisher.PublishIndicatorIconL( instId, 1, KNullIcon );
+
+        ResetMessageRowL( instId, 2 ); // 1st message row
+        ResetMessageRowL( instId, 3 ); // 2nd..
+        }
+    }
+
+// ---------------------------------------------------------
+// CMailPluginProxy::ResetMessageRowL
+// ---------------------------------------------------------
+//
+void CMailPluginProxy::ResetMessageRowL( const TInt aWidgetInstanceId, const TInt aRow )
+    {
+    FUNC_LOG;
+    TFSMailMsgId dummy;
+    iPublisher.PublishMailboxIconL( aWidgetInstanceId, aRow, KNullIcon, dummy );
+    iPublisher.PublishMailDetailL( aWidgetInstanceId, aRow, KNullDesC, ESender );
+    iPublisher.PublishMailDetailL( aWidgetInstanceId, aRow, KNullDesC, ETime );
+    }
+
+// ---------------------------------------------------------
+// CMailPluginProxy::SelectOwnAccountsL
+// ---------------------------------------------------------
+//
+void CMailPluginProxy::SelectOwnAccountsL( RPointerArray<CMailExternalAccount>& aAccounts )
+    {
+    FUNC_LOG;
+    for ( TInt i = 0; i < aAccounts.Count(); i++ )
+        {
+        if ( aAccounts[i]->PluginId() == iPluginId )
+            {
+            // own account, take ownership
+            iAccounts.AppendL( aAccounts[i] );
+            aAccounts.Remove(i);
+            i--; // update loop indexing
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CMailPluginProxy::PublishAccountsL
+// ---------------------------------------------------------
+//
+void CMailPluginProxy::PublishAccountsL()
+    {
+    FUNC_LOG;
+    // Loops through all external accounts of this plugin (that are configured
+    // to be published), and calls publish on them
+    for ( TInt i = 0; i < iAccounts.Count(); i++ )
+        {
+        TInt instId = ResolveWidgetInstance( iAccounts[i]->ContentId() );
+        if ( instId != KErrNotFound && iPublisher.AllowedToPublish( instId ) )
+            {
+            PublishAccountL( instId, iAccounts[i]->MailboxId() );
+            }
+        else
+            {
+            INFO("Correct widget not found, not publishing..");
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CMailPluginProxy::PublishAccountL
+// ---------------------------------------------------------
+//
+void CMailPluginProxy::PublishAccountL( const TInt aWidgetInstanceId, const TInt aMailboxId )
+    {
+    FUNC_LOG;
+    // Loops through plugin's mailbox array and finds matching mailbox
+    MEmailData& data( iPlugin->EmailDataL() );
+    RPointerArray<MMailboxData> mailboxes = data.MailboxesL();
+    for ( TInt j = 0; j < mailboxes.Count(); j++ )
+        {
+        if ( mailboxes[j]->MailboxId() == aMailboxId )
+            {
+            PublishAccountL( aWidgetInstanceId, *(mailboxes[j]) );
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CMailPluginProxy::PublishAccountL
+// ---------------------------------------------------------
+//
+void CMailPluginProxy::PublishAccountL( const TInt aWidgetInstanceId, MMailboxData& aMailboxData )
+    {
+    FUNC_LOG;    
+    // 1st row
+    PublishFirstRowL( aWidgetInstanceId, aMailboxData );
+    
+    // message rows
+    TInt msgCount = aMailboxData.LatestMessagesL().Count();
+    for ( TInt i = 0; i < KMaxMsgCount; i++ )
+        {
+        if ( msgCount > i )
+            {
+            // enough messages for this row
+            PublishMessageRowL( aWidgetInstanceId, *(aMailboxData.LatestMessagesL()[i]), i+2 ); // message-rows start from 2
+            }
+        else
+            {
+            // make sure this row is empty
+            TFSMailMsgId dummy;
+            iPublisher.PublishMailboxIconL( aWidgetInstanceId, i+2, KNullIcon, dummy );
+            iPublisher.PublishMailDetailL( aWidgetInstanceId, i+2, KNullDesC, ESender );
+            iPublisher.PublishMailDetailL( aWidgetInstanceId, i+2, KNullDesC, ETime );
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CMailPluginProxy::PublishMessageL
+// ---------------------------------------------------------
+//
+void CMailPluginProxy::PublishMessageRowL( const TInt aWidgetInstanceId, EmailInterface::MMessageData& aMessageData, const TInt aRow )
+    {
+    FUNC_LOG;
+    TFSMailMsgId dummy;
+    TInt iconId = TMailCpsUtils::ResolveIcon(
+        aMessageData.Unread(),
+        aMessageData.CalendarMsg(),
+        aMessageData.Attachments(),
+        aMessageData.Priority(),
+        aMessageData.Replied(),
+        aMessageData.Forwarded() );
+    
+    iPublisher.PublishMailboxIconL( aWidgetInstanceId, aRow, iconId, dummy );
+    iPublisher.PublishMailDetailL( aWidgetInstanceId, aRow, aMessageData.Sender(), ESender );
+    HBufC* timeString = CMailCpsHandler::GetMessageTimeStringL( aMessageData.TimeStamp() );
+    CleanupStack::PushL( timeString );
+    iPublisher.PublishMailDetailL( aWidgetInstanceId, aRow, *timeString, ETime );
+    CleanupStack::PopAndDestroy( timeString );
+    }
+
+// ---------------------------------------------------------
+// CMailPluginProxy::PublishFirstRowL
+// ---------------------------------------------------------
+//
+void CMailPluginProxy::PublishFirstRowL( const TInt aWidgetInstanceId, EmailInterface::MMailboxData& aMailboxData )
+    {
+    FUNC_LOG;
+    HBufC* firstLineText = ConstructMailboxNameWithMessageCountLC( aMailboxData );
+    TInt indicator = ResolveIndicatorIcon( aMailboxData );
+    iPublisher.PublishMailboxIconL( aWidgetInstanceId, aMailboxData.BrandingIcon() );
+    iPublisher.PublishMailboxNameL( aWidgetInstanceId, *firstLineText, KTriggerEmailUi8 );
+    iPublisher.PublishIndicatorIconL( aWidgetInstanceId, 1, indicator );
+    CleanupStack::PopAndDestroy( firstLineText );
+    }
+
+// ---------------------------------------------------------
+// CMailPluginProxy::ConstructMailboxNameWithMessageCountLC
+// ---------------------------------------------------------
+//
+HBufC* CMailPluginProxy::ConstructMailboxNameWithMessageCountLC( MMailboxData& aMailboxData )
+    {
+    FUNC_LOG;
+    HBufC* mailboxAndCount( NULL );
+    TInt unreadCount = UnreadCountL( aMailboxData );
+    if ( unreadCount > 0 )
+        {
+        // Arrays must be used when loc string contains indexed parameters
+        CDesCArrayFlat* strings = new CDesCArrayFlat( 1 );
+        CleanupStack::PushL( strings );
+        strings->AppendL( aMailboxData.Name() ); // replace "%0U" with mailbox name
+    
+        CArrayFix<TInt>* ints = new(ELeave) CArrayFixFlat<TInt>( 1 );
+        CleanupStack::PushL( ints );
+        ints->AppendL( unreadCount ); // replace "%1N" with number of unread messages
+    
+        mailboxAndCount = StringLoader::LoadL( R_EMAILWIDGET_TEXT_MAILBOX_AND_MAILCOUNT, *strings, *ints );
+        CleanupStack::PopAndDestroy(ints);
+        CleanupStack::PopAndDestroy(strings);
+        CleanupStack::PushL( mailboxAndCount );
+        }
+    else
+        {
+        // if 0 messages, first line text is pure mailbox name
+        mailboxAndCount = aMailboxData.Name().AllocLC();
+        }
+    INFO_1("first line: %S", mailboxAndCount);
+    return mailboxAndCount;
+    }
+
+// ---------------------------------------------------------
+// CMailPluginProxy::UnreadCountL
+// ---------------------------------------------------------
+//
+TInt CMailPluginProxy::UnreadCountL( EmailInterface::MMailboxData& aMailboxData )
+    {
+    FUNC_LOG;
+    TInt count( 0 );
+    for ( TInt i = 0; i < aMailboxData.LatestMessagesL().Count(); i++ )
+        {
+        if ( aMailboxData.LatestMessagesL()[i]->Unread() )
+            {
+            count++;
+            }
+        }
+    return count;
+    }
+
+// ---------------------------------------------------------------------------
+// CMailPluginProxy::ResolveIndicatorIcon
+// ---------------------------------------------------------------------------
+//
+TInt CMailPluginProxy::ResolveIndicatorIcon( EmailInterface::MMailboxData& aMailboxData )
+    {
+    FUNC_LOG;
+    TInt indicator( 0 );
+    if ( aMailboxData.Unseen() )
+        {
+        indicator = EMbmCmailhandlerpluginQgn_stat_message_mail_uni;
+        }
+    else if ( !aMailboxData.IsOutboxEmpty() )
+        {
+        indicator = EMbmCmailhandlerpluginQgn_indi_cmail_outbox_msg;
+        }
+    else
+        {
+        indicator = KNullIcon;
+        }
+    return indicator;
+    }
+
+// ---------------------------------------------------------------------------
+// CMailPluginProxy::ResolveWidgetInstance
+// ---------------------------------------------------------------------------
+//
+TInt CMailPluginProxy::ResolveWidgetInstance( const TDesC& aContentId )
+    {
+    FUNC_LOG;
+    TInt id( KErrNotFound );
+    for ( TInt i = 0; i < iPublisher.iInstIdList.Count(); i++ )
+        {
+        if ( aContentId.Compare( *(iPublisher.iInstIdList[i]) ) == 0 )
+            {
+            id = i;
+            }
+        }
+    return id;
+    }
+
+// ---------------------------------------------------------------------------
+// CMailPluginProxy::HasAccount
+// ---------------------------------------------------------------------------
+//
+TBool CMailPluginProxy::HasAccount( const TDesC& aContentId )
+    {
+    FUNC_LOG;
+    TBool found( EFalse );
+    for ( TInt i = 0; i < iAccounts.Count(); i++ )
+        {
+        if ( !( iAccounts[i]->ContentId().Compare( aContentId ) ) )
+            {
+            found = ETrue;
+            }
+        }
+    return found;
+    }
+
+// ---------------------------------------------------------------------------
+// CMailPluginProxy::LaunchExtAppL
+// ---------------------------------------------------------------------------
+//
+void CMailPluginProxy::LaunchExtAppL( const TDesC& aContentId )
+    {
+    FUNC_LOG;
+    MMailboxData& mailbox = GetMailboxDataL( GetMailboxId( aContentId ) );
+    MEmailLaunchParameters& launchParams = mailbox.LaunchParameters();
+
+    CEikonEnv* env = CEikonEnv::Static();
+    TVwsViewId view( launchParams.ApplicationUid(), launchParams.ViewId() );
+    if ( launchParams.CustomMessageId().iUid == 0 )
+        {
+        env->EikAppUi()->ActivateViewL( view, launchParams.CustomMessageId(), launchParams.CustomMessage() );
+        }
+    else
+        {
+        env->EikAppUi()->ActivateViewL( view );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CMailPluginProxy::ResolveMailboxId
+// ---------------------------------------------------------------------------
+//
+TInt CMailPluginProxy::GetMailboxId( const TDesC& aContentId )
+    {
+    FUNC_LOG;
+    TInt mailboxId( 0 );
+    for ( TInt i = 0; i < iAccounts.Count(); i++ )
+        {
+        if ( !(iAccounts[i]->ContentId().Compare( aContentId )) )
+            {
+            mailboxId = iAccounts[i]->MailboxId();
+            }
+        }
+    return mailboxId;
+    }
+
+// ---------------------------------------------------------------------------
+// CMailPluginProxy::GetMailboxDataL
+// ---------------------------------------------------------------------------
+//
+EmailInterface::MMailboxData& CMailPluginProxy::GetMailboxDataL( TInt aMailboxId )
+    {
+    FUNC_LOG;
+    TInt index( KErrNotFound );
+    RPointerArray<MMailboxData> mailboxes = iPlugin->EmailDataL().MailboxesL();
+    for ( TInt i = 0; i < mailboxes.Count(); i++ )
+        {
+        if ( mailboxes[i]->MailboxId() == aMailboxId )
+            {
+            index = i;
+            }
+        }
+
+    if ( index == KErrNotFound )
+        {
+        User::Leave( KErrNotFound );
+        }
+    
+    return *(mailboxes[index]);
+    }
+
+// ---------------------------------------------------------------------------
+// CMailPluginProxy::SelectAndUpdateAccountsL
+// ---------------------------------------------------------------------------
+//
+void CMailPluginProxy::SelectAndUpdateAccountsL( RPointerArray<CMailExternalAccount>& aAccounts )
+    {
+    FUNC_LOG;
+    RemoveAccountsL();
+    SelectOwnAccountsL( aAccounts );
+    PublishAccountsL();
+    }
+
+// ---------------------------------------------------------------------------
+// CMailPluginProxy::UpdateAccountL
+// ---------------------------------------------------------------------------
+//
+void CMailPluginProxy::UpdateAccountL( const TDesC& aContentId )
+    {
+    FUNC_LOG;
+    PublishAccountL(
+        ResolveWidgetInstance( aContentId ), 
+        GetMailboxId( aContentId ) );
+    }
--- a/emailservices/emailserver/cmailhandlerplugin/src/emailsoundhandler.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailserver/cmailhandlerplugin/src/emailsoundhandler.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -229,7 +229,7 @@
     TBool vibraEnabled = profile->ProfileTones().ToneSettings().iEmailVibratingAlert;
 
 
-    TInt preference = KAudioPrefNewSMS;
+    TInt preference = KAudioPrefNewSpecialMessage;
     if ( !vibraEnabled )
         {
         preference = EMdaPriorityPreferenceTimeAndQuality;
--- a/emailservices/emailserver/cmailhandlerplugin/src/fsmailauthenticationhandler.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailserver/cmailhandlerplugin/src/fsmailauthenticationhandler.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,7 +18,7 @@
 
 //<cmail>
 #include "emailtrace.h"
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 //</cmail>
 
 #include "fsmailauthenticationhandler.h"
--- a/emailservices/emailserver/cmailhandlerplugin/src/fsmailmessagequeryhandler.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailserver/cmailhandlerplugin/src/fsmailmessagequeryhandler.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,7 +18,7 @@
 
 //<cmail>
 #include "emailtrace.h"
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 //</cmail>
 
 #include "fsmailmessagequeryhandler.h"
--- a/emailservices/emailserver/cmailhandlerplugin/src/fsmailmtmhandler.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailserver/cmailhandlerplugin/src/fsmailmtmhandler.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,7 +18,7 @@
 
 //<cmail>
 #include "emailtrace.h"
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 //</cmail>
 #include <e32base.h> // needed because of the following hrh
 #include <data_caging_path_literals.hrh> // KDC_MTM_INFO_FILE_DIR
@@ -36,8 +36,8 @@
 
 // FREESTYLE EMAIL FRAMEWORK INCLUDES
 //<cmail>
-#include "CFSMailClient.h"
-#include "MFSMailBrandManager.h"
+#include "cfsmailclient.h"
+#include "mfsmailbrandmanager.h"
 //</cmail>
 
 
--- a/emailservices/emailserver/cmailhandlerplugin/src/fsmailoutofmemoryhandler.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailserver/cmailhandlerplugin/src/fsmailoutofmemoryhandler.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,7 +18,7 @@
 
 //<cmail>
 #include "emailtrace.h"
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 //</cmail>
 #include <aknlists.h>
 #include <e32cmn.h>
--- a/emailservices/emailserver/cmailhandlerplugin/src/fsnotificationhandlerbaseimpl.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailserver/cmailhandlerplugin/src/fsnotificationhandlerbaseimpl.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,7 +18,7 @@
 
 //<cmail>
 #include "emailtrace.h"
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 //</cmail>
 
 #include "fsnotificationhandlermgr.h"
--- a/emailservices/emailserver/group/fsmailserver.mmp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailserver/group/fsmailserver.mmp	Fri Feb 19 22:37:30 2010 +0200
@@ -99,9 +99,8 @@
 LIBRARY sysutil.lib
 LIBRARY liwservicehandler.lib
 LIBRARY cmaillogger.lib
-DEBUGLIBRARY flogger.lib
 
 
 #ifdef TRACE_INTO_FILE
-LIBRARY         flogger.lib
+LIBRARY flogger.lib
 #endif // TRACE_INTO_FILE
--- a/emailservices/emailserver/inc/fsnotificationhandlerbase.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailserver/inc/fsnotificationhandlerbase.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,7 +21,7 @@
 
 #include <e32base.h>
 //<cmail>
-#include "MFSMailEventObserver.h"
+#include "mfsmaileventobserver.h"
 //</cmail>
 
 class CFSMailClient;
--- a/emailservices/emailserver/inc/fsnotificationhandlermgrimpl.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailserver/inc/fsnotificationhandlermgrimpl.h	Fri Feb 19 22:37:30 2010 +0200
@@ -23,8 +23,8 @@
 #include <e32base.h>
 
 //<cmail>
-#include "CFSMailCommon.h"
-#include "MFSMailEventObserver.h"
+#include "cfsmailcommon.h"
+#include "mfsmaileventobserver.h"
 //</cmail>
 
 #include "fsnotificationhandlermgr.h"
--- a/emailservices/emailserver/mailserverautostart/group/fsmailserverautostart.mmp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailserver/mailserverautostart/group/fsmailserverautostart.mmp	Fri Feb 19 22:37:30 2010 +0200
@@ -46,5 +46,5 @@
 USERINCLUDE             ../../../../inc
 
 LIBRARY                 euser.lib
-DEBUGLIBRARY            flogger.lib
+LIBRARY                 flogger.lib
 LIBRARY                 cmaillogger.lib
--- a/emailservices/emailserver/src/fsnotificationhandlermgrimpl.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailserver/src/fsnotificationhandlermgrimpl.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 #include "emailtrace.h"
 #include <ecom/ecom.h> // FinalClose()
 //<cmail>
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 //</cmail>
 #include <sysutil.h>
 //<cmail>
--- a/emailservices/emailservermonitor/group/emailservermonitor.mmp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailservermonitor/group/emailservermonitor.mmp	Fri Feb 19 22:37:30 2010 +0200
@@ -35,7 +35,7 @@
 
 USERINCLUDE   ../inc
 USERINCLUDE   ../../../inc
-USERINCLUDE   ../../emailstore/inc              // EmailStoreUids.hrh
+USERINCLUDE   ../../emailstore/inc              // emailstoreuids.hrh
 
 APP_LAYER_SYSTEMINCLUDE
 
@@ -59,4 +59,4 @@
 LIBRARY       PsServerClientAPI.lib         // PCS engine client-side API
 LIBRARY       estor.lib                     // RDesRead/WriteStream
 LIBRARY       cmaillogger.lib
-DEBUGLIBRARY  flogger.lib
+LIBRARY       flogger.lib
--- a/emailservices/emailservermonitor/src/emailshutter.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailservermonitor/src/emailshutter.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -29,11 +29,11 @@
 #include <AlwaysOnlineManagerClient.h>  // RAlwaysOnlineClientSession
 #include <CPsRequestHandler.h>          // CPSRequestHandler
 #include <centralrepository.h>          // CRepository
-#include <platform/mw/aisystemuids.hrh> // HomeScreen UIDs
+#include <aisystemuids.hrh>             // HomeScreen UIDs
 
 #include "FreestyleEmailUiConstants.h"  // FS Email UI UID
 #include "fsmtmsconstants.h"            // MCE, Phonebook & Calendar UIDs
-#include "EmailStoreUids.hrh"           // KUidMessageStoreExe
+#include "emailstoreuids.hrh"           // KUidMessageStoreExe
 
 #include "emailtrace.h"
 #include "emailshutdownconst.h"
--- a/emailservices/emailstore/base_plugin/group/BasePlugin.mmp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/base_plugin/group/BasePlugin.mmp	Fri Feb 19 22:37:30 2010 +0200
@@ -21,7 +21,7 @@
 
 #include "../../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber
 #include "../../../../inc/emailtraceconfig.hrh"
-#include "../../inc/EmailStoreUids.hrh"
+#include "../../inc/emailstoreuids.hrh"
 
 TARGET            baseplugin.dll
 TARGETTYPE        dll
--- a/emailservices/emailstore/base_plugin/group/bld.inf	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/base_plugin/group/bld.inf	Fri Feb 19 22:37:30 2010 +0200
@@ -21,11 +21,11 @@
 DEFAULT
 
 PRJ_EXPORTS
-../inc/BasePlugin.h              |../../../../inc/BasePlugin.h
-../inc/SafePointerArray.h        |../../../../inc/SafePointerArray.h
-../inc/Map.inl                   |../../../../inc/Map.inl
-../inc/Map.h                     |../../../../inc/Map.h
-../inc/BaseMrInfoObject.h        |../../../../inc/basemrinfoobject.h
+../inc/baseplugin.h              |../../../../inc/baseplugin.h
+../inc/safepointerarray.h        |../../../../inc/safepointerarray.h
+../inc/map.inl                   |../../../../inc/map.inl
+../inc/map.h                     |../../../../inc/map.h
+../inc/basemrinfoobject.h        |../../../../inc/basemrinfoobject.h
 ../inc/baseplugincommonutils.h   |../../../../inc/baseplugincommonutils.h
 ../inc/baseplugindelayedops.h    |../../../../inc/baseplugindelayedops.h
 
--- a/emailservices/emailstore/base_plugin/inc/BaseMrInfoObject.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/base_plugin/inc/BaseMrInfoObject.h	Fri Feb 19 22:37:30 2010 +0200
@@ -20,7 +20,7 @@
 #define __BASEMRINFOOBJECT_H__
 
 #include <e32std.h>
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 #include "mmrinfoobject.h"
 #include "mmrorganizer.h"
 #include "mmrattendee.h"
--- a/emailservices/emailstore/base_plugin/inc/BasePlugin.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/base_plugin/inc/BasePlugin.h	Fri Feb 19 22:37:30 2010 +0200
@@ -22,20 +22,20 @@
 #include <e32std.h>
 #include <e32base.h>
 
-#include "CFSMailPlugin.h"
+#include "cfsmailplugin.h"
 #include "mmrorganizer.h"
 
 //<cmail>
-#include "MsgStoreFolderUtils.h"
-#include "MsgStoreMailBox.h"
-#include "MsgStoreMailBoxObserver.h"
-#include "MsgStoreMessage.h"
-#include "MsgStoreObserver.h"
-#include "DebugLogMacros.h"
+#include "msgstorefolderutils.h"
+#include "msgstoremailbox.h"
+#include "msgstoremailboxobserver.h"
+#include "msgstoremessage.h"
+#include "msgstoreobserver.h"
+#include "debuglogmacros.h"
 //</cmail>
 
-#include "BaseMrInfoObject.h"
-#include "Map.h"
+#include "basemrinfoobject.h"
+#include "map.h"
 
 
 class CMsgStore;
--- a/emailservices/emailstore/base_plugin/inc/MailIterator.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/base_plugin/inc/MailIterator.h	Fri Feb 19 22:37:30 2010 +0200
@@ -20,12 +20,12 @@
 #define __MAILITERATOR_H__
 
 //<cmail>
-#include "MFSMailIterator.h"
-#include "MsgStoreSortResultIterator.h"
-#include "DebugLogMacros.h"
+#include "mfsmailiterator.h"
+#include "msgstoresortresultiterator.h"
+#include "debuglogmacros.h"
 //</cmail>
 
-#include "BasePlugin.h"
+#include "baseplugin.h"
 
 
 /**
--- a/emailservices/emailstore/base_plugin/inc/Map.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/base_plugin/inc/Map.h	Fri Feb 19 22:37:30 2010 +0200
@@ -36,7 +36,7 @@
 }
 ****************************************************************/
 
-#include "SafePointerArray.h"
+#include "safepointerarray.h"
 
 template <class Tkey, class Tvalue>
 class RMap
@@ -168,6 +168,6 @@
 
 */
 
-#include "Map.inl"
+#include "map.inl"
 
 #endif //__MAP_H__
--- a/emailservices/emailstore/base_plugin/inc/baseplugindelayedops.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/base_plugin/inc/baseplugindelayedops.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,9 +21,9 @@
 
 
 #include <e32base.h>
-#include "CFSMailCommon.h"
-#include "BasePlugin.h"
-#include "DebugLogMacros.h"
+#include "cfsmailcommon.h"
+#include "baseplugin.h"
+#include "debuglogmacros.h"
 
 
 class CBasePlugin;
--- a/emailservices/emailstore/base_plugin/src/BaseMrInfoObject.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/base_plugin/src/BaseMrInfoObject.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,8 +18,8 @@
 
 
 
-#include "BaseMrInfoObject.h"
-#include "BasePlugin.h"
+#include "basemrinfoobject.h"
+#include "baseplugin.h"
 
 
 /**
--- a/emailservices/emailstore/base_plugin/src/BasePlugin.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/base_plugin/src/BasePlugin.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,24 +18,24 @@
 
 //MsgStore.
 //<cmail>
-#include "MsgStore.h"
-#include "MsgStoreAccount.h"
-#include "MsgStoreMailBox.h"
-#include "MsgStoreMessage.h"
-#include "MsgStoreFolder.h"
-#include "MsgStorePropertyContainer.h"
-#include "MsgStorePropertyKeys.h"
-#include "MsgStoreSortCriteria.h"
-#include "MsgStoreSortResultIterator.h"
+#include "msgstore.h"
+#include "msgstoreaccount.h"
+#include "msgstoremailbox.h"
+#include "msgstoremessage.h"
+#include "msgstorefolder.h"
+#include "msgstorepropertycontainer.h"
+#include "msgstorepropertykeys.h"
+#include "msgstoresortcriteria.h"
+#include "msgstoresortresultiterator.h"
 //Freestyle.
-#include "CFSMailCommon.h"
-#include "CFSMailMessage.h"
+#include "cfsmailcommon.h"
+#include "cfsmailmessage.h"
 //</cmail>
 //Base plugin.
-#include "BasePlugin.h"
-#include "BasePluginPanic.h"
+#include "baseplugin.h"
+#include "basepluginpanic.h"
 #include "baseplugincommonutils.h"
-#include "MailIterator.h"
+#include "mailiterator.h"
 #include "baseplugindelayedopsprivate.h"
 // Other
 #include <e32base.h>
--- a/emailservices/emailstore/base_plugin/src/BasePluginPanic.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/base_plugin/src/BasePluginPanic.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -17,7 +17,7 @@
 
 
 #include <e32std.h>
-#include "BasePluginPanic.h"
+#include "basepluginpanic.h"
 
 _LIT( KBasePluginCategory, "BasePlugin" );
 
--- a/emailservices/emailstore/base_plugin/src/MailIterator.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/base_plugin/src/MailIterator.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -20,7 +20,7 @@
 #include <e32std.h>
 
 #include "baseplugincommonutils.h"
-#include "MailIterator.h"
+#include "mailiterator.h"
 
 
 /**
--- a/emailservices/emailstore/base_plugin/src/baseplugindelayedops.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/base_plugin/src/baseplugindelayedops.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -14,7 +14,7 @@
 * Description:  Email interface implementation.
 *
 */
-#include "MsgStoreWritablePropertyContainer.h"
+#include "msgstorewritablepropertycontainer.h"
 
 #include "baseplugindelayedops.h"
 #include "baseplugindelayedopsprivate.h"
--- a/emailservices/emailstore/base_plugin/src/basepluginfetch.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/base_plugin/src/basepluginfetch.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -17,7 +17,7 @@
 
 
 
-#include "BasePlugin.h"
+#include "baseplugin.h"
 
 
 /**
--- a/emailservices/emailstore/base_plugin/src/basepluginmisc.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/base_plugin/src/basepluginmisc.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,13 +18,13 @@
 
 
 //<cmail>
-#include "MsgStore.h"
-#include "MsgStoreSearchCriteria.h"
-#include "MFSMailBoxSearchObserver.h"
+#include "msgstore.h"
+#include "msgstoresearchcriteria.h"
+#include "mfsmailboxsearchobserver.h"
 //</cmail>
 
-#include "BasePlugin.h"
-#include "BasePluginPanic.h"
+#include "baseplugin.h"
+#include "basepluginpanic.h"
 #include "baseplugincommonutils.h"
 #include "baseplugindelayedopsprivate.h"
 
--- a/emailservices/emailstore/base_plugin/src/basepluginnotifications.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/base_plugin/src/basepluginnotifications.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,11 +18,11 @@
 
 
 //<cmail>
-#include "MsgStore.h"
-#include "MsgStoreFolder.h"
+#include "msgstore.h"
+#include "msgstorefolder.h"
 //</cmail>
 
-#include "BasePlugin.h"
+#include "baseplugin.h"
 #include "baseplugincommonutils.h"
 
 
--- a/emailservices/emailstore/base_plugin/src/basepluginparts.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/base_plugin/src/basepluginparts.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -14,7 +14,7 @@
 * Description:   Multi-part support.
 *
 */
-#include "BasePlugin.h"
+#include "baseplugin.h"
 #include "baseplugincommonutils.h"
 #include "baseplugindelayedopsprivate.h"
 
--- a/emailservices/emailstore/base_plugin/src/baseplugintranslator.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/base_plugin/src/baseplugintranslator.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -17,9 +17,9 @@
 
 
 
-#include "BasePlugin.h"
+#include "baseplugin.h"
 #include "baseplugincommonutils.h"
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 
 
 static void TranslateMsgStoreAttendeeL(
@@ -1112,7 +1112,7 @@
  * when dealing with rule translation.
  *
  * @param aDayOfWeekMask day of week mask in the MsgStore format, see
- * MsgStorePropertyKeys.h for information.
+ * msgstorepropertykeys.h for information.
  * @param aFtor translation ftor.
  */
 void CBasePlugin::TranslateMsgStoreDayOfWeek(
--- a/emailservices/emailstore/group/bld.inf	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/group/bld.inf	Fri Feb 19 22:37:30 2010 +0200
@@ -25,7 +25,7 @@
 
 PRJ_EXPORTS
 ../inc/emailstorepskeys.h              |../../../inc/emailstorepskeys.h
-../inc/EmailStoreUids.hrh              |../../../inc/EmailStoreUids.hrh
+../inc/emailstoreuids.hrh              |../../../inc/emailstoreuids.hrh
 ../rom/emailstore.iby                  CORE_APP_LAYER_IBY_EXPORT_PATH(emailstore.iby)
 ../sis/emailstore_stub.sis             /epoc32/data/z/system/install/emailstore_stub.sis
 
--- a/emailservices/emailstore/inc/emailstorepskeys.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/inc/emailstorepskeys.h	Fri Feb 19 22:37:30 2010 +0200
@@ -17,7 +17,7 @@
 #ifndef _EMAILSTOREPSKEYS_H_
 #define _EMAILSTOREPSKEYS_H_
 
-#include "EmailStoreUids.hrh"
+#include "emailstoreuids.hrh"
 
 /**
   * EmailStore Upgrade P/S Category UID
@@ -30,4 +30,9 @@
   */
 const TInt KProperty_EmailStore_Upgrade = 115;
   
+
+// Copied from emailshutter.h 
+// Value to be set in shutdown P&S key.
+const TInt KEmailShutterPsValue = 1;
+
 #endif //_EMAILSTOREPSKEYS_H_
--- a/emailservices/emailstore/message_store/MsgStoreRfsPlugin/data/RfsMsgStorePlugin.rss	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/MsgStoreRfsPlugin/data/RfsMsgStorePlugin.rss	Fri Feb 19 22:37:30 2010 +0200
@@ -18,7 +18,7 @@
 NAME EAXP
 
 #include <ecom/registryinfo.rh>
-#include "EmailStoreUids.hrh"
+#include "emailstoreuids.hrh"
 
 RESOURCE REGISTRY_INFO theInfo
     {
--- a/emailservices/emailstore/message_store/MsgStoreRfsPlugin/group/RfsMsgStorePlugin.mmp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/MsgStoreRfsPlugin/group/RfsMsgStorePlugin.mmp	Fri Feb 19 22:37:30 2010 +0200
@@ -17,7 +17,7 @@
 
 #include <platform_paths.hrh>
 #include <data_caging_paths.hrh>
-#include "../../../inc/EmailStoreUids.hrh"
+#include "../../../inc/emailstoreuids.hrh"
 
 TARGET        RfsMsgStorePlugin.dll
 TARGETTYPE    PLUGIN
--- a/emailservices/emailstore/message_store/MsgStoreRfsPlugin/src/RfsMsgStorePlugin.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/MsgStoreRfsPlugin/src/RfsMsgStorePlugin.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 #include <f32file.h>
 
 #include "RfsMsgStorePlugin.h"
-#include "EmailStoreUids.hrh"
+#include "emailstoreuids.hrh"
 #include <bautils.h>  
 #include <s32file.h>
 
--- a/emailservices/emailstore/message_store/MsgStoreRfsPlugin/src/RfsMsgStoreProxy.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/MsgStoreRfsPlugin/src/RfsMsgStoreProxy.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 #include <e32std.h>
 #include <ecom/implementationproxy.h>
 
-#include "EmailStoreUids.hrh"
+#include "emailstoreuids.hrh"
 #include "RfsMsgStorePlugin.h"
 
 
--- a/emailservices/emailstore/message_store/PointSecMonitor/Group/ImsPointsecMonitor.mmp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/PointSecMonitor/Group/ImsPointsecMonitor.mmp	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 #include <platform_paths.hrh>
 
 #include "../../../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber
-#include "../../../inc/EmailStoreUids.hrh"
+#include "../../../inc/emailstoreuids.hrh"
 
 TARGET			ImsPointSecMonitor.dll
 TARGETTYPE		dll
--- a/emailservices/emailstore/message_store/PointSecMonitor/Inc/ImsPointsecMonitor.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/PointSecMonitor/Inc/ImsPointsecMonitor.h	Fri Feb 19 22:37:30 2010 +0200
@@ -26,7 +26,7 @@
 #include <e32property.h>
 
 //<cmail>
-#include "DebugLogMacros.h"
+#include "debuglogmacros.h"
 //</cmail>
 
 class MImsPointsecObserver;
--- a/emailservices/emailstore/message_store/client/api/MsgStore.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/api/MsgStore.h	Fri Feb 19 22:37:30 2010 +0200
@@ -22,7 +22,7 @@
 
 #include <e32base.h>
 //<cmail>
-#include "MsgStoreTypes.h"
+#include "msgstoretypes.h"
 //</cmail>
 
 // ====================
--- a/emailservices/emailstore/message_store/client/api/MsgStoreAddress.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/api/MsgStoreAddress.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,9 +21,7 @@
 #define __MSG_STORE_ADDRESS_H__
 
 #include <e32base.h>
-//<cmail>
-#include "MsgStoreTypes.h"
-//</cmail>
+#include "msgstoretypes.h"
 
 /** Simple convinent on-stack class to encapsulate the {email address, display name} pair used
  *  as address fields (From, Sender, To, Cc, Bcc) in a message.
--- a/emailservices/emailstore/message_store/client/api/MsgStoreFolder.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/api/MsgStoreFolder.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,8 +21,8 @@
 #define __MSG_STORE_FOLDER_H__
 
 //<cmail>
-#include "MsgStoreTypes.h"
-#include "MsgStoreWritablePropertyContainer.h"
+#include "msgstoretypes.h"
+#include "msgstorewritablepropertycontainer.h"
 //</cmail>
 
 //forward declaration
--- a/emailservices/emailstore/message_store/client/api/MsgStoreFolderUtils.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/api/MsgStoreFolderUtils.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,9 +21,9 @@
 #define __MSGSTOREFOLDERUTILS_H__
 
 //<cmail>
-#include "MsgStoreMailBox.h"
-#include "MsgStorePropertyKeys.h"
-#include "MsgStoreTypes.h"
+#include "msgstoremailbox.h"
+#include "msgstorepropertykeys.h"
+#include "msgstoretypes.h"
 //</cmail>
 
 /**
--- a/emailservices/emailstore/message_store/client/api/MsgStoreMailBox.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/api/MsgStoreMailBox.h	Fri Feb 19 22:37:30 2010 +0200
@@ -22,8 +22,8 @@
 
 #include <e32base.h>
 //<cmail>
-#include "MsgStoreTypes.h"
-#include "MsgStoreWritablePropertyContainer.h"
+#include "msgstoretypes.h"
+#include "msgstorewritablepropertycontainer.h"
 //</cmail>
 
 class CMsgStoreMessage;
--- a/emailservices/emailstore/message_store/client/api/MsgStoreMailBoxObserver.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/api/MsgStoreMailBoxObserver.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,7 +21,7 @@
 #define __MSG_STORE_MAILBOX_OBSERVER_H__
 
 //<cmail>
-#include "MsgStoreTypes.h"
+#include "msgstoretypes.h"
 //</cmail>
 
 class CMsgStoreObserverHandler;
--- a/emailservices/emailstore/message_store/client/api/MsgStoreMessage.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/api/MsgStoreMessage.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,7 +21,7 @@
 #define __MSG_STORE_MESSAGE_H__
 
 //<cmail>
-#include "MsgStoreMessagePart.h"
+#include "msgstoremessagepart.h"
 //</cmail>
 
 /** This class represents a message in the message store.
--- a/emailservices/emailstore/message_store/client/api/MsgStoreMessagePart.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/api/MsgStoreMessagePart.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,8 +21,8 @@
 #define __MSG_STORE_MESSAGE_PART_H__
 
 //<cmail>
-#include "MsgStoreTypes.h"
-#include "MsgStorePropertyContainerWithContent.h"
+#include "msgstoretypes.h"
+#include "msgstorepropertycontainerwithcontent.h"
 //</cmail>
 
 class CMsgStoreMessage;
--- a/emailservices/emailstore/message_store/client/api/MsgStoreObserver.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/api/MsgStoreObserver.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,8 +21,8 @@
 #define __MSG_STORE_OBSERVER_H__
 
 //<cmail>
-#include "MsgStoreTypes.h"
-#include "MsgStoreAccount.h"
+#include "msgstoretypes.h"
+#include "msgstoreaccount.h"
 //</cmail>
 
 /** This class defines the message store observation API.
--- a/emailservices/emailstore/message_store/client/api/MsgStorePropertyContainer.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/api/MsgStorePropertyContainer.h	Fri Feb 19 22:37:30 2010 +0200
@@ -22,8 +22,8 @@
 
 #include <e32base.h>
 //<cmail>
-#include "MsgStoreTypes.h"
-#include "MsgStoreAddress.h"
+#include "msgstoretypes.h"
+#include "msgstoreaddress.h"
 //</cmail>
 
 /**
--- a/emailservices/emailstore/message_store/client/api/MsgStorePropertyContainerWithContent.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/api/MsgStorePropertyContainerWithContent.h	Fri Feb 19 22:37:30 2010 +0200
@@ -22,7 +22,7 @@
 
 #include <f32file.h>
 //<cmail>
-#include "MsgStoreWritablePropertyContainer.h"
+#include "msgstorewritablepropertycontainer.h"
 //</cmail>
 
 
--- a/emailservices/emailstore/message_store/client/api/MsgStorePropertyKeys.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/api/MsgStorePropertyKeys.h	Fri Feb 19 22:37:30 2010 +0200
@@ -29,7 +29,7 @@
  ************************************************************************/
 
 /** The property key for status flags field.  Its property value type is EMsgStoreTypeUint32.
- *  The values are defined in email fw's TFSMsgFlag enum (CFSMailCommon.h).
+ *  The values are defined in email fw's TFSMsgFlag enum (cfsmailcommon.h).
  * 
  *  The following code updates the "flags" field with the local read flag
  *
--- a/emailservices/emailstore/message_store/client/api/MsgStoreSearchCriteria.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/api/MsgStoreSearchCriteria.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,7 +21,7 @@
 #define __MSG_STORE_SEARCH_CRITERIA_H__
 
 //<cmail>
-#include "MsgStoreTypes.h"
+#include "msgstoretypes.h"
 //</cmail>
 
 /** This class represents the criteria for a search request
--- a/emailservices/emailstore/message_store/client/api/MsgStoreSortCriteria.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/api/MsgStoreSortCriteria.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,7 +21,7 @@
 #define __MSG_STORE_SORT_CRITERIA_H__
 
 //<cmail>
-#include "MsgStoreTypes.h"
+#include "msgstoretypes.h"
 //</cmail>
 
 /** This class represents the criteria for a sorting request
--- a/emailservices/emailstore/message_store/client/api/MsgStoreSortResultIterator.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/api/MsgStoreSortResultIterator.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,8 +21,8 @@
 #define __MSG_STORE_SORT_RESULT_ITERATOR_H__
 
 //<cmail>
-#include "MsgStoreTypes.h"
-#include "MsgStorePropertyContainer.h"
+#include "msgstoretypes.h"
+#include "msgstorepropertycontainer.h"
 //</cmail>
 
 class TMsgStoreIdAndFlag
--- a/emailservices/emailstore/message_store/client/api/MsgStoreWritablePropertyContainer.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/api/MsgStoreWritablePropertyContainer.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,7 +21,7 @@
 #define __MSG_STORE_WRITABLE_PROPERTY_CONTAINER_H__
 
 //<cmail>
-#include "MsgStorePropertyContainer.h"
+#include "msgstorepropertycontainer.h"
 //</cmail>
 
 class CMsgStoreSessionContext;
--- a/emailservices/emailstore/message_store/client/group/MessageStoreClient.mmp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/group/MessageStoreClient.mmp	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 #include <platform_paths.hrh>
 
 #include "../../../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber
-#include "../../../inc/EmailStoreUids.hrh"
+#include "../../../inc/emailstoreuids.hrh"
 
 TARGET        MessageStoreClient.dll
 TARGETTYPE    dll
@@ -42,7 +42,7 @@
 USERINCLUDE   ../../../inc
 USERINCLUDE   ../../common/inc
 
-// TEMPORARY MOVED STUFF FROM IsMsgStorePropertyKeys.h USED BY MSGSTORE TO MsgStorePropertyKeys.h
+// TEMPORARY MOVED STUFF FROM IsMsgStorePropertyKeys.h USED BY MSGSTORE TO msgstorepropertykeys.h
 //because of the IsMsgStorePropertyKeys.h there is now dependency and I'd rather keep it in its
 //original location because of the merges and the fact that it logically belongs there.
 //USERINCLUDE   ../../../../Intellisyncengine/client_symbian_s60_freestyle/sync/inc
--- a/emailservices/emailstore/message_store/client/group/bld.inf	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/group/bld.inf	Fri Feb 19 22:37:30 2010 +0200
@@ -19,25 +19,25 @@
 
 
 PRJ_EXPORTS
-../api/MsgStoreTypes.h                          |../../../../../inc/MsgStoreTypes.h
-../api/MsgStorePropertyKeys.h                   |../../../../../inc/MsgStorePropertyKeys.h
-../api/MsgStorePropertyContainer.h              |../../../../../inc/MsgStorePropertyContainer.h   
-../api/MsgStoreWritablePropertyContainer.h      |../../../../../inc/MsgStoreWritablePropertyContainer.h   
-../api/MsgStorePropertyContainerWithContent.h   |../../../../../inc/MsgStorePropertyContainerWithContent.h   
-../api/MsgStoreAccount.h                        |../../../../../inc/MsgStoreAccount.h   
-../api/MsgStoreObserver.h                       |../../../../../inc/MsgStoreObserver.h   
-../api/MsgStoreMailBoxObserver.h                |../../../../../inc/MsgStoreMailBoxObserver.h 
-../api/MsgStoreMessagePart.h                    |../../../../../inc/MsgStoreMessagePart.h 
-../api/MsgStoreMessage.h                        |../../../../../inc/MsgStoreMessage.h   
-../api/MsgStoreFolder.h                         |../../../../../inc/MsgStoreFolder.h   
-../api/MsgStoreSearchCriteria.h                 |../../../../../inc/MsgStoreSearchCriteria.h
-../api/MsgStoreSortCriteria.h                   |../../../../../inc/MsgStoreSortCriteria.h
-../api/MsgStoreSortResultIterator.h             |../../../../../inc/MsgStoreSortResultIterator.h 
-../api/MsgStoreMailBox.h                        |../../../../../inc/MsgStoreMailBox.h   
-../api/MsgStore.h                               |../../../../../inc/MsgStore.h   
-../api/MsgStoreAPI.h                            |../../../../../inc/MsgStoreAPI.h   
-../api/MsgStoreFolderUtils.h                    |../../../../../inc/MsgStoreFolderUtils.h
-../api/MsgStoreAddress.h                        |../../../../../inc/MsgStoreAddress.h
+../api/msgstoretypes.h                          |../../../../../inc/msgstoretypes.h
+../api/msgstorepropertykeys.h                   |../../../../../inc/msgstorepropertykeys.h
+../api/msgstorepropertycontainer.h              |../../../../../inc/msgstorepropertycontainer.h   
+../api/msgstorewritablepropertycontainer.h      |../../../../../inc/msgstorewritablepropertycontainer.h   
+../api/msgstorepropertycontainerwithcontent.h   |../../../../../inc/msgstorepropertycontainerwithcontent.h   
+../api/msgstoreaccount.h                        |../../../../../inc/msgstoreaccount.h   
+../api/msgstoreobserver.h                       |../../../../../inc/msgstoreobserver.h   
+../api/msgstoremailboxobserver.h                |../../../../../inc/msgstoremailboxobserver.h 
+../api/msgstoremessagepart.h                    |../../../../../inc/msgstoremessagepart.h 
+../api/msgstoremessage.h                        |../../../../../inc/msgstoremessage.h   
+../api/msgstorefolder.h                         |../../../../../inc/msgstorefolder.h   
+../api/msgstoresearchcriteria.h                 |../../../../../inc/msgstoresearchcriteria.h
+../api/msgstoresortcriteria.h                   |../../../../../inc/msgstoresortcriteria.h
+../api/msgstoresortresultiterator.h             |../../../../../inc/msgstoresortresultiterator.h 
+../api/msgstoremailbox.h                        |../../../../../inc/msgstoremailbox.h   
+../api/msgstore.h                               |../../../../../inc/msgstore.h   
+../api/msgstoreapi.h                            |../../../../../inc/msgstoreapi.h   
+../api/msgstorefolderutils.h                    |../../../../../inc/msgstorefolderutils.h
+../api/msgstoreaddress.h                        |../../../../../inc/msgstoreaddress.h
 
 PRJ_MMPFILES
 MessageStoreClient.mmp
--- a/emailservices/emailstore/message_store/client/inc/MsgStoreObserverHandler.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/inc/MsgStoreObserverHandler.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,11 +21,11 @@
 
 #include <e32base.h>
 //<cmail>
-#include "MsgStoreTypes.h"
-#include "MsgStoreObserver.h"
-#include "MsgStoreMailBoxObserver.h"
+#include "msgstoretypes.h"
+#include "msgstoreobserver.h"
+#include "msgstoremailboxobserver.h"
 //</cmail>
-#include "RMessageStoreSession.h"
+#include "rmessagestoresession.h"
 #include "MessageStoreClientServer.h"
 
 const TUint KEventBufferLength  = 30;
--- a/emailservices/emailstore/message_store/client/inc/MsgStorePropertyContainersArray.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/inc/MsgStorePropertyContainersArray.h	Fri Feb 19 22:37:30 2010 +0200
@@ -20,7 +20,7 @@
 #ifndef _MSG_STORE_PROPERTY_CONTAINERS_ARRAY_H_
 #define _MSG_STORE_PROPERTY_CONTAINERS_ARRAY_H_
 
-#include "RMessageStoreSession.h"
+#include "rmessagestoresession.h"
 
 class CMsgStorePropertyContainer;
 
--- a/emailservices/emailstore/message_store/client/inc/MsgStoreSearchHandler.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/inc/MsgStoreSearchHandler.h	Fri Feb 19 22:37:30 2010 +0200
@@ -23,7 +23,7 @@
 // ========
 #include <e32base.h>
 //<cmail>
-#include "DebugLogMacros.h"
+#include "debuglogmacros.h"
 //</cmail>
 
 class RMessageStoreSession;
--- a/emailservices/emailstore/message_store/client/inc/MsgStoreSessionContext.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/inc/MsgStoreSessionContext.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,10 +21,10 @@
 #define _MSG_STORE_SESSION_CONTEXT_H_
 
 //<cmail>
-#include "MsgStoreTypes.h"
-#include "DebugLogMacros.h"
+#include "msgstoretypes.h"
+#include "debuglogmacros.h"
 //</cmail>
-#include "RMessageStoreSession.h"
+#include "rmessagestoresession.h"
 
 class CMsgStoreObserverHandler;
 class CMsgStoreSearchHandler;
--- a/emailservices/emailstore/message_store/client/inc/RMessageStoreSession.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/inc/RMessageStoreSession.h	Fri Feb 19 22:37:30 2010 +0200
@@ -27,10 +27,10 @@
 #include <e32base.h>
 #include <f32file.h>
 //<cmail>
-#include "MsgStoreTypes.h"
-#include "DebugLogMacros.h"
+#include "msgstoretypes.h"
+#include "debuglogmacros.h"
 #include "MessageStoreClientServer.h"
-#include "MsgStoreSortResultIterator.h"
+#include "msgstoresortresultiterator.h"
 //</cmail>
 // ====================
 // FORWARD DECLARATIONS
--- a/emailservices/emailstore/message_store/client/src/MessageStoreClient.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/src/MessageStoreClient.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -22,7 +22,7 @@
 // ========
 
 #include <e32svr.h>
-#include <S32MEM.H>
+#include <s32mem.h>
 //#include <MessageStoreClient.h>
 //<cmail>
 #include "msgstoretypes.h"
@@ -30,12 +30,12 @@
 //</cmail>
 
 #include "MessageStoreClientServer.h"
-#include "EmailStoreUids.hrh"
+#include "emailstoreuids.hrh"
 #include "PropertiesSerializer.h"
-#include "MsgStoreFolder.h"
-#include "MsgStoreObserver.h"
-#include "MsgStorePropertyContainerWithContent.h"
-#include "MsgStoreSessionContext.h"
+#include "msgstorefolder.h"
+#include "msgstoreobserver.h"
+#include "msgstorepropertycontainerwithcontent.h"
+#include "msgstoresessioncontext.h"
 
 // =========
 // CONSTANTS
@@ -46,34 +46,34 @@
 
 /** This class defines the message store search client API.
 
-	This class is used to notify the search client of the completion of an asynchronous search of the
-	message store.
+    This class is used to notify the search client of the completion of an asynchronous search of the
+    message store.
 */
 class MMsgStoreSearchClient
-	{
-	public:
+    {
+    public:
 
-		virtual void MatchFound( TMsgStoreId aMessageId ) = 0;
-	
-		virtual void SearchCompleted() = 0;
-	
-	}; // end class MMsgStoreSearchClient
+        virtual void MatchFound( TMsgStoreId aMessageId ) = 0;
+    
+        virtual void SearchCompleted() = 0;
+    
+    }; // end class MMsgStoreSearchClient
 
 
 /** This class defines the message store quick property client API.
 
-	This class is used to notify the client when a quick property is ready to be processed, or
+    This class is used to notify the client when a quick property is ready to be processed, or
     to notify the client something has changed, restart building the list
 */
 class MMsgStoreQuickPropertyClient
-	{
-	public:
+    {
+    public:
 
-		virtual void ProcessQuickProperty( const CMsgStorePropertyContainer& aContainer ) = 0;
-	
-		virtual void Reset() = 0;
-	
-	}; // end class MMsgStoreSearchClient
+        virtual void ProcessQuickProperty( const CMsgStorePropertyContainer& aContainer ) = 0;
+    
+        virtual void Reset() = 0;
+    
+    }; // end class MMsgStoreSearchClient
 
 
     
@@ -84,10 +84,10 @@
     {
     public:
     
-	    // ==============
-	    // PUBLIC METHODS
-	    // ==============
-	    
+        // ==============
+        // PUBLIC METHODS
+        // ==============
+        
         TPropertyContainerProxy( MMsgStoreQuickPropertyClient& aClient );
         
         // inherited from MPropertiesArray              
@@ -96,10 +96,10 @@
         
     private:
     
-	    // ==================
-	    // PRIVATE ATTRIBUTES
-	    // ==================
-	
+        // ==================
+        // PRIVATE ATTRIBUTES
+        // ==================
+    
         MMsgStoreQuickPropertyClient& iClient;
         
     }; // end class TPropertyContainerProxy
@@ -118,209 +118,209 @@
 // FUNCTION: CopyAttachmentL
 // ==========================================================================
 EXPORT_C TMsgStoreId CMsgStoreSession::CopyAttachmentL( TMsgStoreId aAttachmentId,
-		                                                TMsgStoreId aSourceMessageId, 
-		                                                TMsgStoreId aSourceFolderId, 
-		                                                TMsgStoreId aDestinationMessageId, 
-		                                                TMsgStoreId aDestinationFolderId )
-	{
-	iContext->VerifyTypeL( aAttachmentId, EMsgStoreAttachmentBits );
-	iContext->VerifyTypeL( aSourceMessageId, EMsgStoreMessageBits );
-	iContext->VerifyTypeL( aSourceFolderId, EMsgStoreFolderBits );
-	iContext->VerifyTypeL( aDestinationMessageId, EMsgStoreMessageBits );
-	iContext->VerifyTypeL( aDestinationFolderId, EMsgStoreFolderBits );
-	
-	return iContext->iSession.CopyContainerL( aAttachmentId, 
-	                                          aSourceMessageId, 
-	                                          aSourceFolderId,
-	                                          aDestinationMessageId,
-	                                          aDestinationFolderId );	
-	} // end CopyAttachmentL
+                                                        TMsgStoreId aSourceMessageId, 
+                                                        TMsgStoreId aSourceFolderId, 
+                                                        TMsgStoreId aDestinationMessageId, 
+                                                        TMsgStoreId aDestinationFolderId )
+    {
+    iContext->VerifyTypeL( aAttachmentId, EMsgStoreAttachmentBits );
+    iContext->VerifyTypeL( aSourceMessageId, EMsgStoreMessageBits );
+    iContext->VerifyTypeL( aSourceFolderId, EMsgStoreFolderBits );
+    iContext->VerifyTypeL( aDestinationMessageId, EMsgStoreMessageBits );
+    iContext->VerifyTypeL( aDestinationFolderId, EMsgStoreFolderBits );
+    
+    return iContext->iSession.CopyContainerL( aAttachmentId, 
+                                              aSourceMessageId, 
+                                              aSourceFolderId,
+                                              aDestinationMessageId,
+                                              aDestinationFolderId );   
+    } // end CopyAttachmentL
 
 // ==========================================================================
 // FUNCTION: QuickMessagePropertiesL
 // ==========================================================================
 EXPORT_C void CMsgStoreSession::QuickMessagePropertiesL( TMsgStoreId aFolderId, RPointerArray<CMsgStorePropertyContainer>& aQuickProperties )
-	{
-	iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits );
-	
-	TPropertyContainersArray containersArray( aQuickProperties );
-	
-	iContext->iSession.ChildrenPropertiesL( aFolderId,            // aId
-	                                        KMsgStoreInvalidId,   // aParentId (do not need to check parent ID)
-	                                        EMsgStoreMessageBits, // aContainerType
-	                                        ETrue,                // aQuickProperties
-	                                        EFalse,               // aRecursive	                                        
-	                                        containersArray );
-	} // end QuickMessagePropertiesL
-	
+    {
+    iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits );
+    
+    TPropertyContainersArray containersArray( aQuickProperties );
+    
+    iContext->iSession.ChildrenPropertiesL( aFolderId,            // aId
+                                            KMsgStoreInvalidId,   // aParentId (do not need to check parent ID)
+                                            EMsgStoreMessageBits, // aContainerType
+                                            ETrue,                // aQuickProperties
+                                            EFalse,               // aRecursive                                         
+                                            containersArray );
+    } // end QuickMessagePropertiesL
+    
 // ==========================================================================
 // FUNCTION: QuickMessagePropertiesL overloaded
 // ==========================================================================
 EXPORT_C void CMsgStoreSession::QuickMessagePropertiesL( TMsgStoreId aFolderId, MMsgStoreQuickPropertyClient& aClient )
-	{
-	iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits );
-	
-	TPropertyContainerProxy containerProxy( aClient );
-	
-	iContext->iSession.ChildrenPropertiesL( aFolderId,            // aId
-	                                        KMsgStoreInvalidId,   // aParentId (do not need to check parent ID)
-	                                        EMsgStoreMessageBits, // aContainerType
-	                                        ETrue,                // aQuickProperties
-	                                        EFalse,               // aRecursive	                                        
-	                                        containerProxy );
-	} // end QuickMessagePropertiesL
+    {
+    iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits );
+    
+    TPropertyContainerProxy containerProxy( aClient );
+    
+    iContext->iSession.ChildrenPropertiesL( aFolderId,            // aId
+                                            KMsgStoreInvalidId,   // aParentId (do not need to check parent ID)
+                                            EMsgStoreMessageBits, // aContainerType
+                                            ETrue,                // aQuickProperties
+                                            EFalse,               // aRecursive                                         
+                                            containerProxy );
+    } // end QuickMessagePropertiesL
 
 // ==========================================================================
 // FUNCTION: AttachmentsL
 // ==========================================================================
 EXPORT_C void CMsgStoreSession::AttachmentsL( TMsgStoreId                         aMessageId,
-											  TMsgStoreId                         aFolderId,
-										      RPointerArray<CMsgStoreAttachment>& aAttachmentsList )
-	{
-	iContext->VerifyTypeL( aMessageId, EMsgStoreMessageBits );
-	iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits );
+                                              TMsgStoreId                         aFolderId,
+                                              RPointerArray<CMsgStoreAttachment>& aAttachmentsList )
+    {
+    iContext->VerifyTypeL( aMessageId, EMsgStoreMessageBits );
+    iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits );
 
-//	TAttachmentsArray attachmentsArray( *iContext, aAttachmentsList );
-	
-	iContext->iSession.ChildrenPropertiesL( aMessageId,              // aId
-	                                        aFolderId,               // aParentId
-	                                        EMsgStoreAttachmentBits, // aContainerType
-	                                        EFalse,                  // aQuickProperties
-	                                        EFalse,                  // aRecursive	                                        	                                        
-	                                        attachmentsArray );	
-	} // end AttachmentsL
+//  TAttachmentsArray attachmentsArray( *iContext, aAttachmentsList );
+    
+    iContext->iSession.ChildrenPropertiesL( aMessageId,              // aId
+                                            aFolderId,               // aParentId
+                                            EMsgStoreAttachmentBits, // aContainerType
+                                            EFalse,                  // aQuickProperties
+                                            EFalse,                  // aRecursive                                                                                      
+                                            attachmentsArray ); 
+    } // end AttachmentsL
 
 // ==========================================================================
 // FUNCTION: AttachmentL
 // ==========================================================================
 EXPORT_C CMsgStoreAttachment* CMsgStoreSession::AttachmentL( TMsgStoreId aAttachmentId,
-										   				     TMsgStoreId aMessageId,
-										   				     TMsgStoreId aFolderId )
-	{
-	iContext->VerifyTypeL( aAttachmentId, EMsgStoreAttachmentBits );
-	iContext->VerifyTypeL( aMessageId, EMsgStoreMessageBits );
-	iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits );
-	
-	RBuf8 propertiesBuf;
-	CleanupClosePushL( propertiesBuf );
-	
-	iContext->iSession.ContainerPropertiesL( aAttachmentId, aMessageId, aFolderId, propertiesBuf );	
+                                                             TMsgStoreId aMessageId,
+                                                             TMsgStoreId aFolderId )
+    {
+    iContext->VerifyTypeL( aAttachmentId, EMsgStoreAttachmentBits );
+    iContext->VerifyTypeL( aMessageId, EMsgStoreMessageBits );
+    iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits );
+    
+    RBuf8 propertiesBuf;
+    CleanupClosePushL( propertiesBuf );
+    
+    iContext->iSession.ContainerPropertiesL( aAttachmentId, aMessageId, aFolderId, propertiesBuf ); 
 
-	CMsgStoreAttachment* attachment = CMsgStoreAttachment::NewL( *iContext, aAttachmentId, aMessageId, propertiesBuf );
-	
-	CleanupStack::PopAndDestroy( &propertiesBuf );
-	
-	return attachment;
-	} // end AttachmentL
+    CMsgStoreAttachment* attachment = CMsgStoreAttachment::NewL( *iContext, aAttachmentId, aMessageId, propertiesBuf );
+    
+    CleanupStack::PopAndDestroy( &propertiesBuf );
+    
+    return attachment;
+    } // end AttachmentL
 
 // ==========================================================================
 // FUNCTION: AddAttachmentL
 // ==========================================================================
 EXPORT_C CMsgStoreAttachment* CMsgStoreSession::AddAttachmentL( TMsgStoreId                       aMessageId,
-																TMsgStoreId                       aFolderId,
-																const TDesC&                      aFilename, 
-																const CMsgStorePropertyContainer& aProperties )
-	{
-	iContext->VerifyTypeL( aMessageId, EMsgStoreMessageBits );
-	iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits );
-	
-	if( aFilename.Length() == 0 )
-	    {
-    	__LOG_STATIC_ENTER( "msg", "AddAttachmentL" )
-    	__LOG_WRITE_ERROR( "zero length file name" )
-	    __LOG_STATIC_EXIT
-	    User::Leave( KErrArgument );
-	    } // end if
-	
-	RBuf8 serializedProperties;
-	CleanupClosePushL( serializedProperties );
-	aProperties.SerializeL( serializedProperties );
-	
-	TInt id = iContext->iSession.CreateContainerL( aMessageId, 
-												   aFolderId,
-												   EMsgStoreAttachmentBits,
-												   serializedProperties,
-												   ETrue,
-												   aFilename );
-	
-	CMsgStoreAttachment* attachment = CMsgStoreAttachment::NewL( *iContext, id, aMessageId, serializedProperties );
-	
-	CleanupStack::PopAndDestroy( &serializedProperties );
-	
-	return attachment;
-	} // end AddAttachmentL
+                                                                TMsgStoreId                       aFolderId,
+                                                                const TDesC&                      aFilename, 
+                                                                const CMsgStorePropertyContainer& aProperties )
+    {
+    iContext->VerifyTypeL( aMessageId, EMsgStoreMessageBits );
+    iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits );
+    
+    if( aFilename.Length() == 0 )
+        {
+        __LOG_STATIC_ENTER( "msg", "AddAttachmentL" )
+        __LOG_WRITE_ERROR( "zero length file name" )
+        __LOG_STATIC_EXIT
+        User::Leave( KErrArgument );
+        } // end if
+    
+    RBuf8 serializedProperties;
+    CleanupClosePushL( serializedProperties );
+    aProperties.SerializeL( serializedProperties );
+    
+    TInt id = iContext->iSession.CreateContainerL( aMessageId, 
+                                                   aFolderId,
+                                                   EMsgStoreAttachmentBits,
+                                                   serializedProperties,
+                                                   ETrue,
+                                                   aFilename );
+    
+    CMsgStoreAttachment* attachment = CMsgStoreAttachment::NewL( *iContext, id, aMessageId, serializedProperties );
+    
+    CleanupStack::PopAndDestroy( &serializedProperties );
+    
+    return attachment;
+    } // end AddAttachmentL
 
 // ==========================================================================
 // FUNCTION: AddAttachmentL
 // ==========================================================================
 EXPORT_C CMsgStoreAttachment* CMsgStoreSession::AddAttachmentL( TMsgStoreId                       aMessageId,
-																TMsgStoreId                       aFolderId,
-																const CMsgStorePropertyContainer& aProperties )
-	{
-	iContext->VerifyTypeL( aMessageId, EMsgStoreMessageBits );
-	iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits );
-	
-	RBuf8 serializedProperties;
-	CleanupClosePushL( serializedProperties );
-	aProperties.SerializeL( serializedProperties );
-	
-	TInt id = iContext->iSession.CreateContainerL( aMessageId, 
-												   aFolderId,
-												   EMsgStoreAttachmentBits,
-												   serializedProperties );
-	
-	CMsgStoreAttachment* attachment = CMsgStoreAttachment::NewL( *iContext, id, aMessageId, serializedProperties );
-	
-	CleanupStack::PopAndDestroy( &serializedProperties );
-	
-	return attachment;
-	} // end AddAttachmentL
+                                                                TMsgStoreId                       aFolderId,
+                                                                const CMsgStorePropertyContainer& aProperties )
+    {
+    iContext->VerifyTypeL( aMessageId, EMsgStoreMessageBits );
+    iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits );
+    
+    RBuf8 serializedProperties;
+    CleanupClosePushL( serializedProperties );
+    aProperties.SerializeL( serializedProperties );
+    
+    TInt id = iContext->iSession.CreateContainerL( aMessageId, 
+                                                   aFolderId,
+                                                   EMsgStoreAttachmentBits,
+                                                   serializedProperties );
+    
+    CMsgStoreAttachment* attachment = CMsgStoreAttachment::NewL( *iContext, id, aMessageId, serializedProperties );
+    
+    CleanupStack::PopAndDestroy( &serializedProperties );
+    
+    return attachment;
+    } // end AddAttachmentL
 
 // ==========================================================================
 // FUNCTION: RemoveAttachmentL
 // ==========================================================================
 EXPORT_C void CMsgStoreSession::RemoveAttachmentL( TMsgStoreId aAttachmentId,
-												   TMsgStoreId aMessageId,
-												   TMsgStoreId aFolderId )
-	{
-	iContext->VerifyTypeL( aMessageId, EMsgStoreMessageBits );
-	iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits );
-	iContext->VerifyTypeL( aAttachmentId, EMsgStoreAttachmentBits );
-	
-	iContext->iSession.DeleteContainerL( aAttachmentId, aMessageId, aFolderId );
-	} // end RemoveAttachmentL
-		
+                                                   TMsgStoreId aMessageId,
+                                                   TMsgStoreId aFolderId )
+    {
+    iContext->VerifyTypeL( aMessageId, EMsgStoreMessageBits );
+    iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits );
+    iContext->VerifyTypeL( aAttachmentId, EMsgStoreAttachmentBits );
+    
+    iContext->iSession.DeleteContainerL( aAttachmentId, aMessageId, aFolderId );
+    } // end RemoveAttachmentL
+        
 // ==========================================================================
 // FUNCTION: SearchL
 // ==========================================================================
 EXPORT_C void CMsgStoreSession::SearchL( TMsgStoreId            aFolderId, 
                                          TMsgStoreSearchType    aSearchType, 
-                					     const TDesC&           aSearchString,
-                					     MMsgStoreSearchClient& aSearchClient )
+                                         const TDesC&           aSearchString,
+                                         MMsgStoreSearchClient& aSearchClient )
     {
-	iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits );
+    iContext->VerifyTypeL( aFolderId, EMsgStoreFolderBits );
 
-	if( aSearchString.Length() == 0 )
-	    {
-    	__LOG_STATIC_ENTER( "msg", "SearchL" )
-    	__LOG_WRITE_ERROR( "zero length search string" )
+    if( aSearchString.Length() == 0 )
+        {
+        __LOG_STATIC_ENTER( "msg", "SearchL" )
+        __LOG_WRITE_ERROR( "zero length search string" )
         __LOG_STATIC_EXIT
         User::Leave( KErrArgument );
-	    } // end if
+        } // end if
     
     if( iContext->iSearchHandler )
         {
-    	__LOG_STATIC_ENTER( "msg", "SearchL" )
-    	__LOG_WRITE_ERROR( "search already in progress" )
+        __LOG_STATIC_ENTER( "msg", "SearchL" )
+        __LOG_WRITE_ERROR( "search already in progress" )
         __LOG_STATIC_EXIT
         User::Leave( KErrInUse );
         } // end if        
-	
+    
     iContext->iSearchHandler = CMsgStoreSearchHandler::NewL( iContext->iSession, aFolderId, aSearchType, aSearchString, *this );
     iContext->iSearchClient  = &aSearchClient;
     
     } // end SearchL
-									       
+                                           
 // ==========================================================================
 // FUNCTION: CancelSearch
 // ==========================================================================
@@ -363,8 +363,8 @@
 CMsgStoreSearchHandler* CMsgStoreSearchHandler::NewL( RMessageStoreSession&  aSession,
                                                       TMsgStoreId            aFolderId, 
                                                       TMsgStoreSearchType    aSearchType, 
-                        					          const TDesC&           aSearchString,
-                        					          MMsgStoreSearchClient& aSearchClient )
+                                                      const TDesC&           aSearchString,
+                                                      MMsgStoreSearchClient& aSearchClient )
     {
     CMsgStoreSearchHandler* self = new(ELeave) CMsgStoreSearchHandler( aSession, aSearchClient );
     CleanupStack::PushL( self );
@@ -372,27 +372,27 @@
     CleanupStack::Pop( self );
     return self;
     } // end NewL
-	
+    
 // ==========================================================================
 // FUNCTION: Constructor
 // ==========================================================================
 CMsgStoreSearchHandler::CMsgStoreSearchHandler( RMessageStoreSession& aSession,
                                                 MMsgStoreSearchClient& aSearchClient ) :
-	CActive( EPriorityStandard ),
-	iSession( aSession ),
+    CActive( EPriorityStandard ),
+    iSession( aSession ),
     iSearchClient( aSearchClient )
     {
     __LOG_CONSTRUCT( "msg", "CMsgStoreSearchHandler" ) 
     
-   	CActiveScheduler::Add(this);    
+    CActiveScheduler::Add(this);    
     } // end constructor
-                			   
+                               
 // ==========================================================================
 // FUNCTION: ConstructL
 // ==========================================================================
 void CMsgStoreSearchHandler::ConstructL( TMsgStoreId           aFolderId, 
                                          TMsgStoreSearchType   aSearchType, 
-		                                 const TDesC&          aSearchString )    
+                                         const TDesC&          aSearchString )    
     {
     iMatchBuffer[0].CreateL( sizeof(TMsgStoreId) * KSearchBufferLength );
     iMatchBuffer[1].CreateL( sizeof(TMsgStoreId) * KSearchBufferLength );
@@ -420,7 +420,7 @@
         
     __LOG_DESTRUCT
     } // end destructor
-	
+    
 // ==========================================================================
 // FUNCTION: RunL
 // ==========================================================================
@@ -431,12 +431,12 @@
     RBuf8& currentMatchBuffer = iMatchBuffer[iMatchBufferIndex];
     
     if( iStatus == KErrNone && currentMatchBuffer.Length() > 0 )
-    	{
-    	// Switch to the other match buffer for the next call to the session.  Make this call before
-    	// calling the search client with matches, just in case the client cancels the search during
-    	// the callback.  This will cause DoCancel to be called during this object's destruction, which
-    	// will cancel the server-side search.
-    	iMatchBufferIndex = (iMatchBufferIndex + 1) % 2;
+        {
+        // Switch to the other match buffer for the next call to the session.  Make this call before
+        // calling the search client with matches, just in case the client cancels the search during
+        // the callback.  This will cause DoCancel to be called during this object's destruction, which
+        // will cancel the server-side search.
+        iMatchBufferIndex = (iMatchBufferIndex + 1) % 2;
         iSession.GetMatchesL( iStatus, iMatchBuffer[iMatchBufferIndex] );
         SetActive();                                      
 
@@ -445,13 +445,13 @@
         TBool thisObjectHasBeenDeleted = EFalse;
         iThisObjectHasBeenDeleted = &thisObjectHasBeenDeleted;
             
-    	TBool atEndOfIds = (currentMatchBuffer.Length() == 0);
-    	TUint offset = 0;
+        TBool atEndOfIds = (currentMatchBuffer.Length() == 0);
+        TUint offset = 0;
 
-    	while( !thisObjectHasBeenDeleted && !atEndOfIds )
-    	    {
-        	const TMsgStoreId& currentId = *reinterpret_cast<const TMsgStoreId *>( currentMatchBuffer.Ptr() + offset );
-        	
+        while( !thisObjectHasBeenDeleted && !atEndOfIds )
+            {
+            const TMsgStoreId& currentId = *reinterpret_cast<const TMsgStoreId *>( currentMatchBuffer.Ptr() + offset );
+            
             __LOG_WRITE8_FORMAT1_INFO( "match found (%i)", currentId )  
               
             offset += sizeof(TMsgStoreId);                    
@@ -463,22 +463,22 @@
             // Note that the client may cancel the search during this callback.                    
             iSearchClient.MatchFound( currentId );                    
                                 
-    	    } // end while                    	    
+            } // end while                          
 
         if( !thisObjectHasBeenDeleted )
             {
             iThisObjectHasBeenDeleted = NULL;
             } // end if
-	    }
+        }
     else
-    	{
+        {
         __LOG_WRITE8_FORMAT1_INFO( "Search completed, iStatus=%d", iStatus.Int() );
         
         iSearchClient.SearchCompleted();
         
-    	} // end if       	
+        } // end if         
 
-    // __LOG_EXIT was removed because it crashes in cases where thisObjectHasBeenDeleted is true    	
+    // __LOG_EXIT was removed because it crashes in cases where thisObjectHasBeenDeleted is true        
     
     } // end RunL
     
--- a/emailservices/emailstore/message_store/client/src/MsgStore.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/src/MsgStore.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,16 +18,16 @@
 
 
 //<cmail>
-#include "MsgStore.h"
-#include "MsgStoreMailBox.h"
-#include "MsgStoreAccount.h"
-#include "MsgStoreObserver.h"
-#include "MsgStorePropertyContainer.h"
-#include "MsgStorePropertyKeys.h"
+#include "msgstore.h"
+#include "msgstoremailbox.h"
+#include "msgstoreaccount.h"
+#include "msgstoreobserver.h"
+#include "msgstorepropertycontainer.h"
+#include "msgstorepropertykeys.h"
 //</cmail>
 
-#include "MsgStoreSessionContext.h"
-#include "MsgStoreObserverHandler.h"
+#include "msgstoresessioncontext.h"
+#include "msgstoreobserverhandler.h"
 //<cmail>
 //#include "IsMsgStorePropertyKeys.h"
 //</cmail>
--- a/emailservices/emailstore/message_store/client/src/MsgStoreAccount.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/src/MsgStoreAccount.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,7 +18,7 @@
 
 
 //<cmail>
-#include "MsgStoreAccount.h"
+#include "msgstoreaccount.h"
 //</cmail>
 
 EXPORT_C CMsgStoreAccount* CMsgStoreAccount::NewL( const TInt32 aOwnerUid, const TDesC& aName )
--- a/emailservices/emailstore/message_store/client/src/MsgStoreAddress.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/src/MsgStoreAddress.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,7 +18,7 @@
 
 
 //<cmail>
-#include "MsgStoreAddress.h"
+#include "msgstoreaddress.h"
 //</cmail>
 
 // --------------------------
--- a/emailservices/emailstore/message_store/client/src/MsgStoreFolder.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/src/MsgStoreFolder.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,10 +18,10 @@
 
 
 //<cmail>
-#include "MsgStoreFolder.h"
-#include "MsgStorePropertyKeys.h"
+#include "msgstorefolder.h"
+#include "msgstorepropertykeys.h"
 //</cmail>
-#include "MsgStoreSessionContext.h"
+#include "msgstoresessioncontext.h"
 
 CMsgStoreFolder* CMsgStoreFolder::NewL( CMsgStoreSessionContext& aSessionContext, 
 									  	TMsgStoreId 			 aId, 
--- a/emailservices/emailstore/message_store/client/src/MsgStoreFolderUtils.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/src/MsgStoreFolderUtils.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -17,9 +17,9 @@
 
 
 
-#include "MsgStoreFolderUtils.h"
+#include "msgstorefolderutils.h"
 //<cmail>
-#include "MsgStoreFolder.h"
+#include "msgstorefolder.h"
 //</cmail>
 
 
--- a/emailservices/emailstore/message_store/client/src/MsgStoreMailBox.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/src/MsgStoreMailBox.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,19 +18,19 @@
 
 
 //<cmail>
-#include "MsgStoreMailBox.h"
-#include "DebugLogMacros.h"
-#include "RMessageStoreSession.h"
-#include "MsgStoreSessionContext.h"
-#include "MsgStoreFolder.h"
-#include "MsgStoreMessage.h"
-#include "MsgStorePropertyKeys.h"
-#include "MsgStoreObserverHandler.h"
-#include "MsgStorePropertyContainersArray.h"
-#include "MsgStoreSortCriteria.h"
-#include "MsgStoreSortResultIterator.h"
-#include "MsgStoreSearchHandler.h"
-#include "MsgStoreSearchCriteria.h"
+#include "msgstoremailbox.h"
+#include "debuglogmacros.h"
+#include "rmessagestoresession.h"
+#include "msgstoresessioncontext.h"
+#include "msgstorefolder.h"
+#include "msgstoremessage.h"
+#include "msgstorepropertykeys.h"
+#include "msgstoreobserverhandler.h"
+#include "msgstorepropertycontainersarray.h"
+#include "msgstoresortcriteria.h"
+#include "msgstoresortresultiterator.h"
+#include "msgstoresearchhandler.h"
+#include "msgstoresearchcriteria.h"
 //#include "IsMsgStorePropertyKeys.h"
 //</cmail>
 
--- a/emailservices/emailstore/message_store/client/src/MsgStoreMessage.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/src/MsgStoreMessage.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,9 +18,9 @@
 
 
 //<cmail>
-#include "MsgStoreMessage.h"
+#include "msgstoremessage.h"
 //</cmail>
-#include "MsgStoreSessionContext.h"
+#include "msgstoresessioncontext.h"
 
 /** Commits a newly created message to the message store.
 	
--- a/emailservices/emailstore/message_store/client/src/MsgStoreMessagePart.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/src/MsgStoreMessagePart.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,13 +18,13 @@
 
 
 //<cmail>
-#include "MsgStoreMessagePart.h"
-#include "MsgStorePropertyKeys.h"
+#include "msgstoremessagepart.h"
+#include "msgstorepropertykeys.h"
 //</cmail>
-#include "MsgStoreSessionContext.h"
-#include "RMessageStoreSession.h"
+#include "msgstoresessioncontext.h"
+#include "rmessagestoresession.h"
 #include "MessageStoreClientServer.h"
-#include "MsgStoreMessage.h"
+#include "msgstoremessage.h"
 
 //_LIT( KTextPlain, "text/plain" );
 //_LIT( KTextHTML, "text/html" );
--- a/emailservices/emailstore/message_store/client/src/MsgStoreObserverHandler.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/src/MsgStoreObserverHandler.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -16,10 +16,10 @@
 */
 
 
-#include "MsgStoreObserverHandler.h"
-#include "RMessageStoreSession.h"
+#include "msgstoreobserverhandler.h"
+#include "rmessagestoresession.h"
 //<cmail>
-#include "MsgStoreObserver.h"
+#include "msgstoreobserver.h"
 //</cmail>
 
 
--- a/emailservices/emailstore/message_store/client/src/MsgStorePropertyContainer.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/src/MsgStorePropertyContainer.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -17,10 +17,10 @@
 
 
 
-#include "MsgStorePropertyContainer.h"
+#include "msgstorepropertycontainer.h"
 //<cmail>
-#include "DebugLogMacros.h"
-#include "MsgStorePropertyKeys.h"
+#include "debuglogmacros.h"
+#include "msgstorepropertykeys.h"
 //</cmail>
 #include "PropertiesSerializer.h"
 
--- a/emailservices/emailstore/message_store/client/src/MsgStorePropertyContainerWithContent.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/src/MsgStorePropertyContainerWithContent.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -16,8 +16,8 @@
 */
 
 
-#include "MsgStorePropertyContainerWithContent.h"
-#include "MsgStoreSessionContext.h"
+#include "msgstorepropertycontainerwithcontent.h"
+#include "msgstoresessioncontext.h"
 
 // -------------------------------------
 // CMsgStorePropertyContainerWithContent
--- a/emailservices/emailstore/message_store/client/src/MsgStorePropertyContainersArray.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/src/MsgStorePropertyContainersArray.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -17,9 +17,9 @@
 
 
 
-#include "MsgStorePropertyContainersArray.h"
+#include "msgstorepropertycontainersarray.h"
 //<cmail>
-#include "MsgStorePropertyContainer.h"
+#include "msgstorepropertycontainer.h"
 //</cmail>
 
 // ------------------------        
--- a/emailservices/emailstore/message_store/client/src/MsgStoreSearchCriteria.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/src/MsgStoreSearchCriteria.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -15,7 +15,7 @@
 *
 */
 
-#include "MsgStoreSearchCriteria.h"
+#include "msgstoresearchcriteria.h"
 
 // --------------------------
 // RMsgStoreAddress
--- a/emailservices/emailstore/message_store/client/src/MsgStoreSearchHandler.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/src/MsgStoreSearchHandler.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -17,12 +17,12 @@
 
 
 
-#include "MsgStoreSearchHandler.h"
+#include "msgstoresearchhandler.h"
 //<cmail>
-#include "MsgStoreTypes.h"
-#include "MsgStoreMailBox.h"
+#include "msgstoretypes.h"
+#include "msgstoremailbox.h"
 //</cmail>
-#include "RMessageStoreSession.h"
+#include "rmessagestoresession.h"
 
 const TInt KInitialPropertiesTransferBufferLength = 10000;
 
--- a/emailservices/emailstore/message_store/client/src/MsgStoreSessionContext.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/src/MsgStoreSessionContext.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -15,7 +15,7 @@
 *
 */
 
-#include "MsgStoreSessionContext.h"
+#include "msgstoresessioncontext.h"
 
 // ==========================================================================
 // FUNCTION: Constructor
--- a/emailservices/emailstore/message_store/client/src/MsgStoreSortCriteria.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/src/MsgStoreSortCriteria.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,7 +18,7 @@
 
 
 //<cmail>
-#include "MsgStoreSortCriteria.h"
+#include "msgstoresortcriteria.h"
 //</cmail>
 
 // --------------------------
--- a/emailservices/emailstore/message_store/client/src/MsgStoreSortResultIterator.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/src/MsgStoreSortResultIterator.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -17,9 +17,9 @@
 
 
 
-#include "MsgStoreSortResultIterator.h"
-#include "MsgStoreSessionContext.h"
-#include "MsgStorePropertyContainersArray.h"
+#include "msgstoresortresultiterator.h"
+#include "msgstoresessioncontext.h"
+#include "msgstorepropertycontainersarray.h"
 
 // ----------------------------------
 // CMsgStoreSortResultIterator
--- a/emailservices/emailstore/message_store/client/src/MsgStoreWritablePropertyContainer.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/src/MsgStoreWritablePropertyContainer.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -16,8 +16,8 @@
 */
 
 
-#include "MsgStoreWritablePropertyContainer.h"
-#include "MsgStoreSessionContext.h"
+#include "msgstorewritablepropertycontainer.h"
+#include "msgstoresessioncontext.h"
 
 // ----------------------------------
 // CMsgStoreWritablePropertyContainer
--- a/emailservices/emailstore/message_store/client/src/RMessageStoreSession.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/client/src/RMessageStoreSession.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -24,17 +24,17 @@
 #include <s32mem.h>  // for descriptor read/write streams
 #include <f32file.h>
 
-#include "RMessageStoreSession.h"
+#include "rmessagestoresession.h"
 
-#include "EmailStoreUids.hrh"
+#include "emailstoreuids.hrh"
 #include "MessageStoreClientServer.h"
-#include "RMessageStoreSession.h"
+#include "rmessagestoresession.h"
 //<cmail>
-#include "MsgStoreAccount.h"
+#include "msgstoreaccount.h"
 #include "AccountsSerializer.h"
-#include "MsgStoreSortCriteria.h"
-#include "MsgStoreSearchCriteria.h"
-#include "MsgStoreAddress.h"
+#include "msgstoresortcriteria.h"
+#include "msgstoresearchcriteria.h"
+#include "msgstoreaddress.h"
 //</cmail>
 
 // =========
--- a/emailservices/emailstore/message_store/common/inc/MessageStoreClientServer.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/common/inc/MessageStoreClientServer.h	Fri Feb 19 22:37:30 2010 +0200
@@ -26,8 +26,8 @@
 
 #include <e32std.h>
 //<cmail>
-#include "MsgStoreTypes.h"
-#include "MsgStoreAccount.h"
+#include "msgstoretypes.h"
+#include "msgstoreaccount.h"
 //</cmail>
 
 // =========
--- a/emailservices/emailstore/message_store/debuglog/group/DebugLog.mmp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/debuglog/group/DebugLog.mmp	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 #include <platform_paths.hrh>
 
 #include "../../../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber
-#include "../../../inc/EmailStoreUids.hrh"
+#include "../../../inc/emailstoreuids.hrh"
 
 TARGET          DebugLog.dll
 TARGETTYPE      dll
--- a/emailservices/emailstore/message_store/debuglog/group/bld.inf	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/debuglog/group/bld.inf	Fri Feb 19 22:37:30 2010 +0200
@@ -21,9 +21,9 @@
 // Support all platforms for now
 
 PRJ_EXPORTS
-../inc/DebugLogMacros.h            |../../../../../inc/DebugLogMacros.h
-../inc/DebugLogConst.h             |../../../../../inc/DebugLogConst.h
-../inc/DebugLog.h                  |../../../../../inc/DebugLog.h
+../inc/debuglogmacros.h            |../../../../../inc/debuglogmacros.h
+../inc/debuglogconst.h             |../../../../../inc/debuglogconst.h
+../inc/debuglog.h                  |../../../../../inc/debuglog.h
 ../inc/GlobalDebugLoggingOptions.h |../../../../../inc/GlobalDebugLoggingOptions.h
 
 PRJ_MMPFILES
--- a/emailservices/emailstore/message_store/debuglog/inc/DebugLogConst.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/debuglog/inc/DebugLogConst.h	Fri Feb 19 22:37:30 2010 +0200
@@ -25,7 +25,7 @@
 
 #include <e32std.h>
 #include <e32def.h>
-#include "DebugLog.h"
+#include "debuglog.h"
 
 // ========
 // LITERALS
@@ -171,7 +171,7 @@
 #define DEBUG_USE_VAR(var) if ( &var ) {};
 
 // These are the basic logging macros - they are NOT intended to be called directly.
-// Instead use the logging MACROS defined in DebugLogMacros.h
+// Instead use the logging MACROS defined in debuglogmacros.h
 #define __INTERNAL_LOG_DECLARATION  RDebugLog iLogger;
 
 #define __INTERNAL_LOG_CLOSE_BETWEEN_WRITES  \
@@ -620,4 +620,4 @@
 
 #endif // _DEBUG_LOG_CONST_H_
 
-// END FILE DebugLogConst.h
+// END FILE debuglogconst.h
--- a/emailservices/emailstore/message_store/debuglog/inc/DebugLogMacros.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/debuglog/inc/DebugLogMacros.h	Fri Feb 19 22:37:30 2010 +0200
@@ -52,7 +52,7 @@
 //  PRINTING: (NOTE: The following is just a reference example)
 //
 //      // Include the debug logging header file
-//      #include "DebugLogMacros.h"
+//      #include "debuglogmacros.h"
 //
 //      class CTestClass
 //          {
@@ -181,7 +181,7 @@
     // DEBUG BUILD
     // ===========
 
-    #include "DebugLogConst.h"
+    #include "debuglogconst.h"
 
     // =====================================================================
     // Utility Logging Macros
@@ -457,5 +457,5 @@
 
 #endif  // _DEBUG_LOG_MACROS_H_
 
-// END FILE DebugLogMacros.h
+// END FILE debuglogmacros.h
 
--- a/emailservices/emailstore/message_store/debuglog/src/DebugLog.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/debuglog/src/DebugLog.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -25,8 +25,8 @@
 #include <f32file.h>
 #include <sysutil.h>
 
-#include "DebugLog.h"
-#include "DebugLogConst.h"
+#include "debuglog.h"
+#include "debuglogconst.h"
 
 // This takes a lot more memory to use, so it is defaulted to off.  If the code is crashing
 // in DoLogLeakedObjects then uncomment this line to help find the problem.  It is most likely
--- a/emailservices/emailstore/message_store/exe/group/MessageStoreExe.mmp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/exe/group/MessageStoreExe.mmp	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 #include <platform_paths.hrh>
 
 #include "../../../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber
-#include "../../../inc/EmailStoreUids.hrh"
+#include "../../../inc/emailstoreuids.hrh"
 
 TARGET        MessageStoreExe.exe
 TARGETTYPE    exe
--- a/emailservices/emailstore/message_store/server/group/MessageStoreServer.mmp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/server/group/MessageStoreServer.mmp	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 #include <platform_paths.hrh>
 
 #include "../../../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber
-#include "../../../inc/EmailStoreUids.hrh"
+#include "../../../inc/emailstoreuids.hrh"
 
 TARGET        MessageStoreServer.dll
 TARGETTYPE    dll
--- a/emailservices/emailstore/message_store/server/inc/BackupRestoreObserver.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/server/inc/BackupRestoreObserver.h	Fri Feb 19 22:37:30 2010 +0200
@@ -27,7 +27,7 @@
 #include <e32base.h>
 #include <e32property.h>
 //<cmail>
-#include "DebugLogMacros.h"
+#include "debuglogmacros.h"
 //</cmail>
 
 // =======
--- a/emailservices/emailstore/message_store/server/inc/ContainerStore.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/server/inc/ContainerStore.h	Fri Feb 19 22:37:30 2010 +0200
@@ -28,7 +28,7 @@
 #include <f32file.h>
 #include <e32cmn.h>
 //<cmail>
-#include "DebugLogMacros.h"
+#include "debuglogmacros.h"
 //</cmail>
 #include "MessageStoreClientServer.h"
 #include "EncryptableTable.h"
--- a/emailservices/emailstore/message_store/server/inc/ContainerStoreAccountTable.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreAccountTable.h	Fri Feb 19 22:37:30 2010 +0200
@@ -27,7 +27,7 @@
 #include <e32base.h>
 #include <d32dbms.h>  // database
 //<cmail>
-#include "DebugLogMacros.h"
+#include "debuglogmacros.h"
 //</cmail>
 
 #include "ContainerStoreTable.h"
--- a/emailservices/emailstore/message_store/server/inc/ContainerStoreContainersTable.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreContainersTable.h	Fri Feb 19 22:37:30 2010 +0200
@@ -27,7 +27,7 @@
 #include <e32base.h>
 #include <d32dbms.h>  // database
 //<cmail>
-#include "DebugLogMacros.h"
+#include "debuglogmacros.h"
 //</cmail>
 
 #include "ContainerStoreTable.h"
--- a/emailservices/emailstore/message_store/server/inc/ContainerStoreContentManager.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreContentManager.h	Fri Feb 19 22:37:30 2010 +0200
@@ -25,7 +25,7 @@
 
 #include <e32base.h>
 //<cmail>
-#include "DebugLogMacros.h"
+#include "debuglogmacros.h"
 //</cmail>
 
 #include "ContainerStore.h"
--- a/emailservices/emailstore/message_store/server/inc/ContainerStoreDeleteHandler.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreDeleteHandler.h	Fri Feb 19 22:37:30 2010 +0200
@@ -27,7 +27,7 @@
 #include <e32base.h>
 #include <d32dbms.h>  // database
 //<cmail>
-#include "DebugLogMacros.h"
+#include "debuglogmacros.h"
 //</cmail>
 
 #include "ContainerStore.h"
--- a/emailservices/emailstore/message_store/server/inc/ContainerStoreEncryption.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreEncryption.h	Fri Feb 19 22:37:30 2010 +0200
@@ -27,7 +27,7 @@
 #include <e32base.h>
 #include <s32strm.h>
 //<cmail>
-#include "DebugLogMacros.h"
+#include "debuglogmacros.h"
 //</cmail>
 
 #include "ContainerStoreGeneralTable.h"
--- a/emailservices/emailstore/message_store/server/inc/ContainerStoreGeneralTable.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreGeneralTable.h	Fri Feb 19 22:37:30 2010 +0200
@@ -27,7 +27,7 @@
 #include <e32base.h>
 #include <d32dbms.h>  // database
 //<cmail>
-#include "DebugLogMacros.h"
+#include "debuglogmacros.h"
 //</cmail>
 
 #include "ContainerStoreTable.h"
--- a/emailservices/emailstore/message_store/server/inc/ContainerStoreMRUAddressTable.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreMRUAddressTable.h	Fri Feb 19 22:37:30 2010 +0200
@@ -27,7 +27,7 @@
 #include <e32base.h>
 #include <d32dbms.h>  // database
 //<cmail>
-#include "DebugLogMacros.h"
+#include "debuglogmacros.h"
 //</cmail>
 
 #include "ContainerStoreTable.h"
--- a/emailservices/emailstore/message_store/server/inc/ContainerStoreSearchResultTable.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreSearchResultTable.h	Fri Feb 19 22:37:30 2010 +0200
@@ -27,12 +27,12 @@
 #include <e32base.h>
 #include <d32dbms.h>  // database
 //<cmail>
-#include "DebugLogMacros.h"
+#include "debuglogmacros.h"
 //</cmail>
 
 #include "ContainerStoreTable.h"
 #include "ContainerStore.h"
-#include "MsgStoreTypes.h"
+#include "msgstoretypes.h"
 
 // =======
 // CLASSES
--- a/emailservices/emailstore/message_store/server/inc/ContainerStoreSortingTable.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreSortingTable.h	Fri Feb 19 22:37:30 2010 +0200
@@ -27,12 +27,12 @@
 #include <e32base.h>
 #include <d32dbms.h>  // database
 //<cmail>
-#include "DebugLogMacros.h"
+#include "debuglogmacros.h"
 //</cmail>
 
 #include "ContainerStoreTable.h"
 #include "ContainerStore.h"
-#include "MsgStoreTypes.h"
+#include "msgstoretypes.h"
 #include "EncryptableTable.h"
 
 enum TSortableFieldsMasks
--- a/emailservices/emailstore/message_store/server/inc/ContainerStoreTable.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreTable.h	Fri Feb 19 22:37:30 2010 +0200
@@ -27,7 +27,7 @@
 #include <e32base.h>
 #include <d32dbms.h>  // database
 //<cmail>
-#include "DebugLogMacros.h"
+#include "debuglogmacros.h"
 //</cmail>
 
 class CContainerStoreUtils;
--- a/emailservices/emailstore/message_store/server/inc/ContainerStoreUtils.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreUtils.h	Fri Feb 19 22:37:30 2010 +0200
@@ -29,7 +29,7 @@
 #include <d32dbms.h>  // database
 #include <s32file.h>  // stream store 
 //<cmail>
-#include "DebugLogMacros.h"
+#include "debuglogmacros.h"
 //</cmail>
 
 // ====================
--- a/emailservices/emailstore/message_store/server/inc/MessageStoreServer.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/server/inc/MessageStoreServer.h	Fri Feb 19 22:37:30 2010 +0200
@@ -26,7 +26,7 @@
 
 #include <e32base.h>
 //<cmail>
-#include "DebugLogMacros.h"
+#include "debuglogmacros.h"
 #include "ImsPointsecObserver.h"
 #include "ImsPointsecMonitor.h"
 #include "StoreDriveMonitor.h"
--- a/emailservices/emailstore/message_store/server/inc/MessageStoreSession.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/server/inc/MessageStoreSession.h	Fri Feb 19 22:37:30 2010 +0200
@@ -26,7 +26,7 @@
 
 #include <e32base.h>
 //<cmail>
-#include "DebugLogMacros.h"
+#include "debuglogmacros.h"
 //</cmail>
 
 #include "MessageStoreClientServer.h"
--- a/emailservices/emailstore/message_store/server/inc/MsgStoreSortResultRowSet.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/server/inc/MsgStoreSortResultRowSet.h	Fri Feb 19 22:37:30 2010 +0200
@@ -20,7 +20,7 @@
 #define MSGSTORE_SORT_RESULT_ROWSET_
 
 #include "ContainerStoreSortingTable.h"
-#include "MsgStoreTypes.h"
+#include "msgstoretypes.h"
 
 // ==================================
 // CLASS: CMsgStoreSortResultRowSet
--- a/emailservices/emailstore/message_store/server/inc/ShutdownServer.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/server/inc/ShutdownServer.h	Fri Feb 19 22:37:30 2010 +0200
@@ -26,7 +26,7 @@
 
 #include <e32base.h>
 //<cmail>
-#include "DebugLogMacros.h"
+#include "debuglogmacros.h"
 //</cmail>
 
 #include "ContainerStore.h"
--- a/emailservices/emailstore/message_store/server/src/ContainerStore.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/server/src/ContainerStore.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -23,7 +23,7 @@
 
 #include <bautils.h>
 
-#include "MsgStoreTypes.h"
+#include "msgstoretypes.h"
 #include "ContainerStore.h"
 #include "ContainerStoreContainersTable.h"
 #include "ContainerStoreContentManager.h"
@@ -40,7 +40,7 @@
 #include "ContainerStoreSearchResultTable.h"
 #include "MessageStoreEncryptHandler.h"
 #include "ContainerStoreMRUAddressTable.h"
-#include "MsgStorePropertyKeys.h"
+#include "msgstorepropertykeys.h"
 
 // =========
 // CONSTANTS
--- a/emailservices/emailstore/message_store/server/src/ContainerStoreSearchHandler.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/server/src/ContainerStoreSearchHandler.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -29,7 +29,7 @@
 #include "MsgStoreSortResultRowSet.h"
 #include "PropertiesSerializer.h"
 //<cmail>
-#include "MsgStorePropertyKeys.h"
+#include "msgstorepropertykeys.h"
 //</cmail>
 
 // =========
--- a/emailservices/emailstore/message_store/server/src/ContainerStoreSortingTable.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/server/src/ContainerStoreSortingTable.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,7 +18,7 @@
 
 
 #include "ContainerStoreSortingTable.h"
-#include "MsgStoreTypes.h"
+#include "msgstoretypes.h"
 #include "MessageStoreClientServer.h"
 #include "ContainerStoreDefs.h"
 #include "MsgStoreSortResultRowSet.h"
--- a/emailservices/emailstore/message_store/server/src/MessageStoreServer.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/message_store/server/src/MessageStoreServer.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -26,9 +26,9 @@
 #include <driveinfo.h>
 #include <s32file.h>
 
-#include "MsgStoreTypes.h"
-#include "MsgStorePropertyKeys.h"
-#include "EmailStoreUids.hrh"
+#include "msgstoretypes.h"
+#include "msgstorepropertykeys.h"
+#include "emailstoreuids.hrh"
 #include "MessageStoreServer.h"
 #include "MessageStoreSession.h"
 #include "ContainerStore.h"
@@ -38,6 +38,7 @@
 #include "ImsPointsecMonitor.h"
 #include "ImsPointsecObserver.h"
 #include "emailstorepskeys.h" // Support for on-the-fly upgrade
+#include "emailshutdownconst.h"
 //</cmail>
 
 // =========
@@ -328,9 +329,9 @@
     TSecurityPolicy readPolicy( ECapabilityReadDeviceData );
     TSecurityPolicy writePolicy( ECapabilityWriteDeviceData );
     iUpgradePropertyWatcher = CPSIntPropertyWatcher::NewL( this );
-    iUpgradePropertyWatcher->StartL( KEmailStoreUpgradePSCategory,
-                                     KProperty_EmailStore_Upgrade,
-                                     process.SecureId(),
+    iUpgradePropertyWatcher->StartL( KEmailShutdownPsCategory, 
+                                     EEmailPsKeyShutdownMsgStore,
+                                     KEmailShutterPsValue,
                                      /*ETrue*/EFalse,
                                      readPolicy,
                                      writePolicy ); 
--- a/emailservices/emailstore/preinstall/group/EmailStorePreInstall.mmp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/preinstall/group/EmailStorePreInstall.mmp	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 #include <platform_paths.hrh> //needed for APP_LAYER_SYSTEMINCLUDE
 
 #include "../../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber
-#include "../../inc/EmailStoreUids.hrh"
+#include "../../inc/emailstoreuids.hrh"
 
 TARGET          EmailStorePreInstall.exe
 TARGETTYPE      exe
--- a/emailservices/emailstore/preinstall/inc/EmailStorePreInstall.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/preinstall/inc/EmailStorePreInstall.h	Fri Feb 19 22:37:30 2010 +0200
@@ -24,7 +24,7 @@
 #include <w32std.h>
 #include <apgtask.h>
 #include <e32property.h>
-#include <DebugLogMacros.h>
+#include <debuglogmacros.h>
 #include "ProcessTimer.h"
 
 // ========
--- a/emailservices/emailstore/preinstall/inc/ProcessTimer.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/preinstall/inc/ProcessTimer.h	Fri Feb 19 22:37:30 2010 +0200
@@ -18,7 +18,7 @@
 #define PROCESSTIMER_H_
 
 #include <e32base.h>
-#include <DebugLogMacros.h>
+#include <debuglogmacros.h>
 
 /**
  * Timeout observer interface.
--- a/emailservices/emailstore/preinstall/src/EmailStorePreInstall.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/preinstall/src/EmailStorePreInstall.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 
 #include <e32const.h>
 #include "EmailStorePreInstall.h"
-#include "EmailStoreUids.hrh"
+#include "emailstoreuids.hrh"
 #include "emailstorepskeys.h"
 
 // Timeout for process exit.
--- a/emailservices/emailstore/tsrc/message_store_test/src/ContentTests.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/tsrc/message_store_test/src/ContentTests.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -16,9 +16,8 @@
 */
 
 
-#include <BAUTILS.H>
+#include <bautils.h>
 #include "ContentTests.h"
-//#include <ismsgstorepropertykeys.h>
 #include "messagestoreclientserver.h"
 
 // ============================ MEMBER FUNCTIONS ===============================
--- a/emailservices/emailstore/tsrc/message_store_test/src/DbCorruptTests.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/tsrc/message_store_test/src/DbCorruptTests.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -16,11 +16,11 @@
 */
 
 
-#include <BAUTILS.H>
-#include <S32FILE.H>
-#include <D32DBMS.H>
+#include <bautils.h>
+#include <s32file.h>
+#include <d32dbms.h>
 #include "DbCorruptTests.h"
-#include <EmailStoreUids.hrh>
+#include <emailstoreuids.hrh>
 
 //these must match those defined in ContainerStoreDefs.
 _LIT( KDbFilename, "message_store.db" );
--- a/emailservices/emailstore/tsrc/message_store_test/src/EncryptionTests.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/tsrc/message_store_test/src/EncryptionTests.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -16,10 +16,7 @@
 */
 
 
-//#include <BAUTILS.H>
 #include "EncryptionTests.h"
-//#include <ismsgstorepropertykeys.h>
-//#include "messagestoreclientserver.h"
 
 // This must match that's defined in ContainerStoreDefs.h
 enum TEncryptionState
--- a/emailservices/emailstore/tsrc/message_store_test/src/MruTests.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/tsrc/message_store_test/src/MruTests.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -16,9 +16,7 @@
 */
 
 
-//#include <BAUTILS.H>
 #include "MruTests.h"
-//#include <ismsgstorepropertykeys.h>
 #include "messagestoreclientserver.h"
 
 // ============================ MEMBER FUNCTIONS ===============================
--- a/emailservices/emailstore/tsrc/message_store_test/src/SearchTests.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/tsrc/message_store_test/src/SearchTests.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -16,10 +16,7 @@
 */
 
 
-//#include <BAUTILS.H>
 #include "SearchTests.h"
-//#include <ismsgstorepropertykeys.h>
-//#include "messagestoreclientserver.h"
 
 _LIT(KHigh,   "High");
 _LIT(KNormal, "Normal");
--- a/emailservices/emailstore/tsrc/message_store_test/src/ShutdownServerTest.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/tsrc/message_store_test/src/ShutdownServerTest.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -16,10 +16,7 @@
 */
 
 
-//#include <BAUTILS.H>
 #include "ShutdownServerTest.h"
-//#include <ismsgstorepropertykeys.h>
-//#include "messagestoreclientserver.h"
 
 // ============================ MEMBER FUNCTIONS ===============================
 
--- a/emailservices/emailstore/tsrc/message_store_test/src/SizeTests.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/tsrc/message_store_test/src/SizeTests.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -16,10 +16,7 @@
 */
 
 
-//#include <BAUTILS.H>
 #include "SizeTests.h"
-//#include <ismsgstorepropertykeys.h>
-//#include "messagestoreclientserver.h"
 
 // ============================ MEMBER FUNCTIONS ===============================
 
--- a/emailservices/emailstore/tsrc/message_store_test/src/SortTests.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/emailstore/tsrc/message_store_test/src/SortTests.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -16,12 +16,9 @@
 */
 
 
-//#include <BAUTILS.H>
 #include <e32math.h>
 #include <tz.h>
 #include "SortTests.h"
-//#include <ismsgstorepropertykeys.h>
-//#include "messagestoreclientserver.h"
 
 const TInt32 KOwner1 = 1234;
 _LIT(KAccount1, "My Account");
--- a/emailservices/psmruadapter/inc/CPsMruAdapter.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/psmruadapter/inc/CPsMruAdapter.h	Fri Feb 19 22:37:30 2010 +0200
@@ -22,13 +22,15 @@
 // INCLUDES
 #include <CPsDataPlugin.h>
 //<cmail>
-#include "MFSMailEventObserver.h"
+#include "mfsmaileventobserver.h"
 //</cmail>
 
 // FORWARD DECLARATION
 class CPsData;
 class CFSMailClient;
+class MDesCArray;
 
+class CDelayMailboxCreationHelper;
 // CLASS DECLARATION
 
 /**
@@ -39,24 +41,24 @@
 * @since S60 v3.2
 */
 class CPsMruAdapter : public CPsDataPlugin, public MFSMailEventObserver
-	{
-	public: 
-	
-	    /**
-	     * Two phase construction
-	     */
-	    static CPsMruAdapter* NewL(TAny* aPsDataPluginParameters);
-
-	    /**
-	     * Destructor
-	     */
-	    virtual ~CPsMruAdapter();
-
-	    /**
-	     * Returns the additional data for given item id
-	     * Returns NULL (in current implementation)
-	     */
-	    TAny* RequestForDataExtensionL( TInt ItemId );
+    {
+    public: 
+    
+        /**
+         * Two phase construction
+         */
+        static CPsMruAdapter* NewL(TAny* aPsDataPluginParameters);
+    
+        /**
+         * Destructor
+         */
+        virtual ~CPsMruAdapter();
+    
+        /**
+         * Returns the additional data for given item id
+         * Returns NULL (in current implementation)
+         */
+        TAny* RequestForDataExtensionL( TInt ItemId );
 
 // from base class CPsDataPlugin
 
@@ -97,92 +99,157 @@
         void EventL( TFSMailEvent aEvent, TFSMailMsgId aMailbox, 
             TAny* aParam1, TAny* aParam2, TAny* aParam3 );
 
+        /**
+         * If problem with NewMailbox this function will be called 
+         * by CDelayMailboxCreationHelper to try it after some delay
+         */
+        TBool DeleayedMailboxCreationEventL();
+        
+        /**
+         * If problem with NewMailbox this function will be called 
+         * by CDelayMailboxCreationHelper to try it after some delay
+         */
+        void DeleayMailboxCreationEventL( TFSMailMsgId &aMailbox );
+        
 	private:
 
-	    /**
-	     * Constructor
-	     */
-		CPsMruAdapter();
-
-		/**
-		 * 2nd phase construtor
-		 */
-		void ConstructL(MDataStoreObserver* aObserverForDataStore,
-		    MStoreListObserver* aStoreListObserver);
-
-		/**
-		 * Updates given data store
-		 */  	    
-		TBool FillDataStoreL( TDesC& aDataStoreURI );
-
-		/**
-		 * Updates given data store
-		 */  	    	    
-		TBool FillDataStoreL( TFSMailMsgId& aId );
-
-		/**
-		 * Updates a list of supported data stores
-		 */  	    
-		void UpdateSupportedDataStoresList();	    
-
-		/**
-		 * Starts observing mailbox
-		 */
-		TBool AddMailboxObserverL( TFSMailMsgId& aId );
-		
-		/**
-		 * Stops observing mailbox
-		 */
-	    TBool RemoveMailboxObserver( TFSMailMsgId& aId );
-	    
-		/**
-		 * Stops all mailbox observers
-		 */
-	    void RemoveAllMailboxObservers();
-		
-		/**
-		 * Converts Uri to TFsMailMsgId
-		 */
-		TBool GetMailboxIdentifierFromUri( TDesC& aUri, TFSMailMsgId& aId );
-
-		/**
-		 * Converts TFsMailMsgId to Uri
-		 */
-	    TBool GetUriFromMailboxIdentifier( TFSMailMsgId& aId, HBufC& aUri );
-	    
-		/**
-	    * Updates given data store
-	    */  	    	    
-	    TBool FillDataStoreL( TFSMailMsgId& aId, TDesC& aDataStoreURI );	    
+        /**
+         * Constructor
+         */
+        CPsMruAdapter();
+        
+        /**
+         * 2nd phase construtor
+         */
+        void ConstructL(MDataStoreObserver* aObserverForDataStore,
+            MStoreListObserver* aStoreListObserver);
+        
+        /**
+         * Updates given data store
+         */  	    
+        TBool FillDataStoreL( TDesC& aDataStoreURI );
+        
+        /**
+         * Updates given data store
+         */  	    	    
+        TBool FillDataStoreL( TFSMailMsgId& aId );
+        
+        /**
+         * Updates a list of supported data stores
+         */  	    
+        void UpdateSupportedDataStoresList();	    
+        
+        /**
+         * Starts observing mailbox
+         */
+        TBool AddMailboxObserverL( TFSMailMsgId& aId );
+        
+        /**
+         * Stops observing mailbox
+         */
+        TBool RemoveMailboxObserver( TFSMailMsgId& aId );
+        
+        /**
+         * Stops all mailbox observers
+         */
+        void RemoveAllMailboxObservers();
+        
+        /**
+         * Converts Uri to TFsMailMsgId
+         */
+        TBool GetMailboxIdentifierFromUri( TDesC& aUri, TFSMailMsgId& aId );
+        
+        /**
+         * Converts TFsMailMsgId to Uri
+         */
+        TBool GetUriFromMailboxIdentifier( TFSMailMsgId& aId, HBufC& aUri );
+        
+        /**
+        * Updates given data store
+        */  	    	    
+        TBool FillDataStoreL( TFSMailMsgId& aId, TDesC& aDataStoreURI );	    
+        
+        /**
+        * Calls MDataStoreObserver::AddData for every mru email - used for trapping 
+        */  	    	    
+        void AddMruEmailsL( MDesCArray* aMruList, TDesC& aDataStoreURI );
 
     private: // data
 
-		/**
-		 * Holds the observer object to communicate add/modify/delete of contacts
-		 * Not owned.
-		 */
-		MDataStoreObserver* iDataStoreObserver;
-		
-		/**
-	    * An observer instance used to send the datastore to the adapter
-	    */
-		MStoreListObserver* iStoreListObserver;		
-			
-		/**
+        /**
+         * Holds the observer object to communicate add/modify/delete of contacts
+         * Not owned.
+         */
+        MDataStoreObserver* iDataStoreObserver;
+        
+        /**
+        * An observer instance used to send the datastore to the adapter
+        */
+        MStoreListObserver* iStoreListObserver;		
+        	
+        /**
         * Supported Uris(data stores)
         */
-    	RPointerArray<HBufC> iSupportedUris;	
-    	
-    	/**
-    	 * List of mailboxes currently being observed
-    	 */
-    	RArray<TFSMailMsgId> iObservedMailboxes;
-    	
-		/**
+        RPointerArray<HBufC> iSupportedUris;	
+        
+        /**
+         * List of mailboxes currently being observed
+         */
+        RArray<TFSMailMsgId> iObservedMailboxes;
+        
+        /**
         * Fs Email framework client
         */
-	    CFSMailClient* iMailClient;
-	};
-	
+        CFSMailClient* iMailClient;
+
+        /**
+        * Class for postponing the mailbox creation in MRU list - Event may come beforet the mailbox exists
+        */
+        CDelayMailboxCreationHelper *iDelayMailboxCreationPtr;
+        
+        /**
+        * This mailboxes should be handled by CDelayMailboxCreationHelper
+        */
+        RArray<TFSMailMsgId> iDelayedCreatedMailboxes;
+
+    }; // class CPsMruAdapter
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+
+
+// Helper class for thread synchronization 
+// used when mailbox is not ready when TFSEventNewMailbox event comes 
+// Waits 30*0.5 sec to try posponed mailbox registration
+
+// wait 500 ms to try adding the mailbox - because sync problems 
+#define KDelayToRunAddMailbox 500 
+// try it 15 second - 30 times
+#define KNumberOfDelayedTrials 30
+
+
+class CDelayMailboxCreationHelper : public CTimer
+    {
+    public:
+        static CDelayMailboxCreationHelper* NewLC( CPsMruAdapter *aPsMruAdapterPtr );
+        static CDelayMailboxCreationHelper* NewL( CPsMruAdapter *aPsMruAdapterPtr );
+        // d-tor
+        virtual ~CDelayMailboxCreationHelper();
+        // Start timer to call CPsMruAdapter::DeleayedMailboxCreationEventL by RunL 
+        void StartDelayedCall();	
+    protected:
+        // on timer event - calls CPsMruAdapter::DeleayedMailboxCreationEventL
+        virtual void RunL();
+        // when leave from RunL, if err handled return KErrNone
+        TInt RunError( TInt aError );
+        // two phase constr.
+        void ConstructL();
+    private:
+        CDelayMailboxCreationHelper( CPsMruAdapter *aPsMruAdapterPtr ); // EPriorityLow, EPriorityIdle
+        // callback not owning pointer assigned during construction
+        CPsMruAdapter *iPsMruAdapterPtr;
+        // unsuccessful calls still allowed counter
+        TInt iNumberOfDelayedTrials;
+    }; // class CDelayMailboxCreationHelper
 
 #endif // C_PS_MRU_ADAPTER_H
--- a/emailservices/psmruadapter/src/CPsMruAdapter.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailservices/psmruadapter/src/CPsMruAdapter.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -23,7 +23,7 @@
 #include <data_caging_path_literals.hrh>
 #include <VPbkEng.rsg>
 //<cmail>
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 #include "CPsMruAdapter.h"
 //</cmail>
 #include <mmf/common/mmfcontrollerpluginresolver.h> // CleanupResetAndDestroy
@@ -31,6 +31,8 @@
 
 #define PRINT(x)
 
+#include "emailtrace.h"
+
 // ============================== MEMBER FUNCTIONS ============================
 
 // Identifier for mailbox Uri
@@ -45,57 +47,61 @@
 // Two Phase Construction
 // ----------------------------------------------------------------------------
 CPsMruAdapter* CPsMruAdapter::NewL( TAny* aPsDataPluginParameters )
-	{
-	PRINT ( _L( "Enter CPsMruAdapter::NewL" ) );
-
-	// Get the PsData plugin parametrs
-	TPsDataPluginParams* params =
-			reinterpret_cast<TPsDataPluginParams*>(aPsDataPluginParameters );
-	CPsMruAdapter* self = new ( ELeave ) CPsMruAdapter();
-	CleanupStack::PushL(self);
-	self->ConstructL( params->iDataStoreObserver, params->iStoreListObserver );
-	CleanupStack::Pop( self );
-
-	PRINT ( _L( "End CPsMruAdapter::NewL" ) );
-
-	return self;
-	}
+    {
+    FUNC_LOG;
+    PRINT ( _L( "Enter CPsMruAdapter::NewL" ) );
+    
+    // Get the PsData plugin parametrs
+    TPsDataPluginParams* params =
+    		reinterpret_cast<TPsDataPluginParams*>(aPsDataPluginParameters );
+    CPsMruAdapter* self = new ( ELeave ) CPsMruAdapter();
+    CleanupStack::PushL(self);
+    self->ConstructL( params->iDataStoreObserver, params->iStoreListObserver );
+    CleanupStack::Pop( self );
+    
+    PRINT ( _L( "End CPsMruAdapter::NewL" ) );
+    
+    return self;
+    }
 
 // ----------------------------------------------------------------------------
 // CPsMruAdapter::CPsMruAdapter
 // Two Phase Construction
 // ----------------------------------------------------------------------------
 CPsMruAdapter::CPsMruAdapter()
-	{
-	PRINT ( _L( "Enter CPsMruAdapter::CPsMruAdapter" ) );
-	PRINT ( _L( "End CPsMruAdapter::CPsMruAdapter" ) );
-	}
+    {
+    FUNC_LOG;
+    PRINT ( _L( "Enter CPsMruAdapter::CPsMruAdapter" ) );
+    iDelayMailboxCreationPtr = NULL;
+    PRINT ( _L( "End CPsMruAdapter::CPsMruAdapter" ) );
+    }
 
 // ----------------------------------------------------------------------------
 // CPsMruAdapter::ConstructL
 // Two Phase Construction
 // ----------------------------------------------------------------------------
 void CPsMruAdapter::ConstructL( MDataStoreObserver* aObserverForDataStore,
-		MStoreListObserver* aStoreListObserver )
-	{
-	PRINT ( _L( "Enter CPsMruAdapter::ConstructL" ) );
+        MStoreListObserver* aStoreListObserver )
+    {
+    FUNC_LOG;	
+    PRINT ( _L( "Enter CPsMruAdapter::ConstructL" ) );
 
-	// Mail client for FS Email framework
-	iMailClient = CFSMailClient::NewL();
+    // Mail client for FS Email framework
+    iMailClient = CFSMailClient::NewL();
 
-	// Register as observer for mail client, we'll need this to observe MRU list changes
-	// When i.e mail is sent
-	iMailClient->AddObserverL( *this );
+    // Register as observer for mail client, we'll need this to observe MRU list changes
+    // When i.e mail is sent
+    iMailClient->AddObserverL( *this );
 
-	// This updates the list of all the supported datastores
-	UpdateSupportedDataStoresList();
+    // This updates the list of all the supported datastores
+    UpdateSupportedDataStoresList();
 
-	// Store these for later use
-	iDataStoreObserver = aObserverForDataStore;
-	iStoreListObserver = aStoreListObserver;
+    // Store these for later use
+    iDataStoreObserver = aObserverForDataStore;
+    iStoreListObserver = aStoreListObserver;
 
-	PRINT ( _L( "End CPsMruAdapter::ConstructL" ) );
-	}
+    PRINT ( _L( "End CPsMruAdapter::ConstructL" ) );
+    }
 
 // ----------------------------------------------------------------------------
 // CPsMruAdapter::~CPsMruAdapter
@@ -103,6 +109,7 @@
 // ----------------------------------------------------------------------------
 CPsMruAdapter::~CPsMruAdapter()
     {
+    FUNC_LOG;	
     PRINT ( _L( "Enter CPsMruAdapter::~CPsMruAdapter" ) );
 
     iSupportedUris.ResetAndDestroy();
@@ -116,7 +123,15 @@
         iMailClient->RemoveObserver( *this );
         iMailClient->Close();
         }
-
+    if(iDelayMailboxCreationPtr)
+        {
+        iDelayMailboxCreationPtr->Deque();
+        delete iDelayMailboxCreationPtr;
+        }
+    
+    iDelayedCreatedMailboxes.Reset();
+    iDelayedCreatedMailboxes.Close();
+    
     PRINT ( _L( "End CPsMruAdapter::~CPsMruAdapter" ) );
     }
 
@@ -126,13 +141,14 @@
 // ----------------------------------------------------------------------------
 void CPsMruAdapter::RequestForDataL( TDesC& aDataStoreURI )
 	{
-	PRINT ( _L( "Enter CPsMruAdapter::RequestForDataL" ) );
+    FUNC_LOG;	
+    PRINT ( _L( "Enter CPsMruAdapter::RequestForDataL" ) );
 
-	// Add data to datastore, fill only requested one
-	FillDataStoreL( aDataStoreURI );
+    // Add data to datastore, fill only requested one
+    FillDataStoreL( aDataStoreURI );
 
-	PRINT ( _L( "Enter CPsMruAdapter::RequestForDataL" ) );
-	}
+    PRINT ( _L( "Enter CPsMruAdapter::RequestForDataL" ) );
+    }
 
 // ----------------------------------------------------------------------------
 // CPsMruAdapter::GetSupportedDataStoresL
@@ -140,378 +156,554 @@
 // ----------------------------------------------------------------------------
 
 void CPsMruAdapter::GetSupportedDataStoresL(
-		RPointerArray<TDesC> &aDataStoresURIs )
-	{
-	for ( TInt i = 0; i < iSupportedUris.Count(); i++ )
-		{
-		aDataStoresURIs.Append( iSupportedUris[i] );
-		}
-	}
+        RPointerArray<TDesC> &aDataStoresURIs )
+    {
+    FUNC_LOG;	
+    for ( TInt i = 0; i < iSupportedUris.Count(); i++ )
+        {
+        aDataStoresURIs.Append( iSupportedUris[i] );
+        }
+    }
 
 // ----------------------------------------------------------------------------
 // CPsMruAdapter::RequestForDataExtensionL
 // 
 // ----------------------------------------------------------------------------
 TAny* CPsMruAdapter::RequestForDataExtensionL(TInt /*aItemId*/)
-	{
-	// No extention required for this since we have and interger as itemId
-	// Simply return NULL
-	return NULL;
-	}
+    {
+    FUNC_LOG;	
+    // No extention required for this since we have and interger as itemId
+    // Simply return NULL
+    return NULL;
+    }
 
 // ----------------------------------------------------------------------------
 // CPsMruAdapter::UpdateSupportedDataStoresList
 // 
 // ----------------------------------------------------------------------------
 void CPsMruAdapter::UpdateSupportedDataStoresList()
-	{
-	// Mailboxes will be fetched to this array
-	RPointerArray<CFSMailBox> mailBoxes;
-
-	// List all mailboxes
-	TFSMailMsgId plugin;
-	iMailClient->ListMailBoxes( plugin, mailBoxes );
+    {
+    FUNC_LOG;	
+    // Mailboxes will be fetched to this array
+    RPointerArray<CFSMailBox> mailBoxes;
 
-	iSupportedUris.ResetAndDestroy();
+    // List all mailboxes
+    TFSMailMsgId plugin;
+    iMailClient->ListMailBoxes( plugin, mailBoxes );
+
+    iSupportedUris.ResetAndDestroy();
 
-	// Add all mailboxes as data stores
-	for ( TInt i = 0; i < mailBoxes.Count(); i++ )
-		{
-		// Get id of mailbox
-		TFSMailMsgId id = mailBoxes[i]->GetId();
+    // Add all mailboxes as data stores
+    for ( TInt i = 0; i < mailBoxes.Count(); i++ )
+        {
+        // Get id of mailbox
+        TFSMailMsgId id = mailBoxes[i]->GetId();
 
-		// Convert it to string, this will be the unique identifier for this mailbox
-		HBufC* identifier = HBufC::New( KMaximumMailboxUriLength );
-		if ( identifier && GetUriFromMailboxIdentifier( id, *identifier ) )
-			{
-			// Add to supported Uris list
-			if ( iSupportedUris.Append( identifier ) == KErrNone )
-			    {
-			    // Ownership of the string is successfully moved to the array
-			    identifier = NULL;
-			    }
-			}
-		delete identifier;
-		}
+        // Convert it to string, this will be the unique identifier for this mailbox
+        HBufC* identifier = HBufC::New( KMaximumMailboxUriLength );
+        if ( identifier && GetUriFromMailboxIdentifier( id, *identifier ) )
+            {
+            // Add to supported Uris list
+            if ( iSupportedUris.Append( identifier ) == KErrNone )
+                {
+                // Ownership of the string is successfully moved to the array
+                identifier = NULL;
+                }
+            }
+        delete identifier;
+        }
 
-	// Release allocated memory
-	mailBoxes.ResetAndDestroy();
-	}
+    // Release allocated memory
+    mailBoxes.ResetAndDestroy();
+    }
 
 // ----------------------------------------------------------------------------
 // CPsMruAdapter::FillDataStoreL
 // ----------------------------------------------------------------------------
 TBool CPsMruAdapter::FillDataStoreL( TDesC& aDataStoreURI )
-	{
-	TBool result = EFalse;
+    {
+    FUNC_LOG;	
+    TBool result = EFalse;
 
-	TFSMailMsgId dataStoreId;
+    TFSMailMsgId dataStoreId;
 
-	if ( GetMailboxIdentifierFromUri( aDataStoreURI, dataStoreId ) )
-		{
-		result = FillDataStoreL( dataStoreId, aDataStoreURI );
-		}
+    if ( GetMailboxIdentifierFromUri( aDataStoreURI, dataStoreId ) )
+        {
+        result = FillDataStoreL( dataStoreId, aDataStoreURI );
+        }
 
-	return result;
-	}
+    return result;
+    }
 
 TBool CPsMruAdapter::FillDataStoreL( TFSMailMsgId& aId )
-	{
-	TBool result = EFalse;
+    {
+    FUNC_LOG;	
+    TBool result = EFalse;
+
+    // Create Uri for this mailbox
+    HBufC* identifier = HBufC::NewLC( KMaximumMailboxUriLength );
+    if ( GetUriFromMailboxIdentifier( aId, *identifier ) )
+        {
+        result = FillDataStoreL( aId, *identifier );
+        }
+    CleanupStack::PopAndDestroy( identifier );
+    return result;
+    }
 
-	// Create Uri for this mailbox
-	HBufC* identifier = HBufC::NewLC( KMaximumMailboxUriLength );
-	if ( GetUriFromMailboxIdentifier( aId, *identifier ) )
-		{
-		result = FillDataStoreL( aId, *identifier );
-		}
-	CleanupStack::PopAndDestroy( identifier );
-	return result;
-	}
+void CPsMruAdapter::AddMruEmailsL( MDesCArray* aMruList, TDesC& aDataStoreURI )
+    {
+    FUNC_LOG;	
+    TInt entryIndex = 0;
+    // Add all data to data store, the format is:
+    // index0: displayname
+    // index1: email
+    // index2: next displayname
+    // index3: next email
+    // etc..
+    for ( int mruIndex = 0; mruIndex < aMruList->MdcaCount(); mruIndex += 2 )
+        {
+        TPtrC displayName = aMruList->MdcaPoint( mruIndex );
+        TPtrC emailAddress = aMruList->MdcaPoint( mruIndex + 1 );
+
+        CPsData* mruData = CPsData::NewL();
+        CleanupStack::PushL(mruData);
+        mruData->SetId( entryIndex++ );
+
+        // Set the data
+        mruData->SetDataL( 0, displayName );
+        mruData->SetDataL( 1, KNullDesC );
+        mruData->SetDataL( 2, emailAddress );
+
+        iDataStoreObserver->AddData( aDataStoreURI, mruData );
+        CleanupStack::Pop(mruData); // transferred ownership
+        }
+    }
 
 TBool CPsMruAdapter::FillDataStoreL( TFSMailMsgId& aId, TDesC& aDataStoreURI )
-	{
-	TBool result = EFalse;
-
-	// Mailboxes will be fetched to this array
-	RPointerArray<CFSMailBox> mailBoxes;
-	CleanupResetAndDestroyPushL( mailBoxes );
-
-	// List all mailboxes
-	TFSMailMsgId plugin;
-	iMailClient->ListMailBoxes( plugin, mailBoxes );
-
-	// Find the requested mailbox
-	for ( TInt i = 0; i < mailBoxes.Count(); i++ )
-		{
-		// Get id of mailbox
-		TFSMailMsgId id = mailBoxes[i]->GetId();
-
-		// Check that this is the requested mailbox
-		if ( id == aId )
-			{
-			AddMailboxObserverL( aId );
-			
-			// update the caching status as InProgress
-			iDataStoreObserver->UpdateCachingStatus( aDataStoreURI,
-					ECachingInProgress );
-
-			// Update datastore contents, first reset
-			iDataStoreObserver->RemoveAll( aDataStoreURI );
-
-			// Get MRU list for this mailbox
-			MDesCArray* mruList = mailBoxes[i]->ListMrusL();
+    {
+    FUNC_LOG;	
+    TBool result = EFalse;
+// code was simplified not to trace all mailboxes
+// function has trap in  Event() -case> TFSEventNewMailbox and in DeleayedMailboxCreationEventL()
+// should not leave when new mailbox only when new mail address
+    CFSMailBox *mailBox = iMailClient->GetMailBoxByUidL(aId);
+    if (mailBox)
+        {
+        AddMailboxObserverL( aId );
+        
+        // Get MRU list for this mailbox
+        MDesCArray* mruList = mailBox->ListMrusL();
+        mailBox = NULL;
+        
+        // update the caching status as InProgress
+        iDataStoreObserver->UpdateCachingStatus( aDataStoreURI,
+                ECachingInProgress );
 
-			if ( mruList )
-				{
-				TInt entryIndex = 0;
-	
-				// Add all data to data store, the format is:
-				// index0: displayname
-				// index1: email
-				// index2: next displayname
-				// index3: next email
-				// etc..
-				for ( int mruIndex = 0; mruIndex < mruList->MdcaCount(); mruIndex += 2 )
-					{
-					TPtrC displayName = mruList->MdcaPoint( mruIndex );
-					TPtrC emailAddress = mruList->MdcaPoint( mruIndex + 1 );
-	
-					CPsData* mruData = CPsData::NewL();
-					mruData->SetId( entryIndex++ );
-	
-					// Set the data
-					mruData->SetDataL( 0, displayName );
-					mruData->SetDataL( 1, KNullDesC );
-					mruData->SetDataL( 2, emailAddress );
-	
-					iDataStoreObserver->AddData( aDataStoreURI, mruData );
-					}
-	
-				delete mruList;
-				}
-			// update the caching status as Complete
-			iDataStoreObserver->UpdateCachingStatus( aDataStoreURI,
-					ECachingComplete );
+        // Update datastore contents, first reset
+        iDataStoreObserver->RemoveAll( aDataStoreURI );
 
-			result = ETrue;
-			break;
-			}
-		}
-
-	CleanupStack::PopAndDestroy( &mailBoxes );
-	return result;
-	}
+        TInt trap_err; // for trap macro
+        if ( mruList )
+            {
+            // trap the error to enable returning status back
+            TRAP(trap_err, AddMruEmailsL( mruList, aDataStoreURI ) );  
+            delete mruList;
+            }
+        // update the caching status as Complete
+        iDataStoreObserver->UpdateCachingStatus( aDataStoreURI,
+                ECachingComplete );
+        if ( trap_err != KErrNone ) // check for error leave code 
+            {  
+            User::Leave(trap_err);       
+            }
+        result = ETrue;
+        }   // if (mailBox)
+    return result;
+    }
 
 // ----------------------------------------------------------------------------
 // CPsContactDataAdapter::IsDataStoresSupportedL
 // 
 // ----------------------------------------------------------------------------
 TBool CPsMruAdapter::IsDataStoresSupportedL( TDesC& aDataStoreURI )
-	{
-	for ( TInt i = 0; i < iSupportedUris.Count(); i++ )
-		{
-		if ( iSupportedUris[i]->Compare( aDataStoreURI ) == 0 )
-			return ETrue;
-		}
-
-	return EFalse;
-	}
+    {
+    FUNC_LOG;	
+    for ( TInt i = 0; i < iSupportedUris.Count(); i++ )
+        {
+        if ( iSupportedUris[i]->Compare( aDataStoreURI ) == 0 )
+            return ETrue;
+        }
+    return EFalse;
+    }
 
 // ----------------------------------------------------------------------------
 // CPsContactDataAdapter::GetSupportedDataFieldsL
 // 
 // ----------------------------------------------------------------------------
 void CPsMruAdapter::GetSupportedDataFieldsL( RArray<TInt>& aDataFields )
-	{
-	aDataFields.Append( R_VPBK_FIELD_TYPE_FIRSTNAME );
-	aDataFields.Append( R_VPBK_FIELD_TYPE_LASTNAME );
-	aDataFields.Append( R_VPBK_FIELD_TYPE_EMAILGEN );
-	}
+    {
+    FUNC_LOG;	
+    aDataFields.Append( R_VPBK_FIELD_TYPE_FIRSTNAME );
+    aDataFields.Append( R_VPBK_FIELD_TYPE_LASTNAME );
+    aDataFields.Append( R_VPBK_FIELD_TYPE_EMAILGEN );
+    }
 
 TBool CPsMruAdapter::GetMailboxIdentifierFromUri( TDesC& aUri, TFSMailMsgId& aId )
-	{
-	// Find first separator in reverse order
-	TInt lastSeparator = aUri.LocateReverseF( KDefaultMailBoxURISeparator );
-	if ( lastSeparator == KErrNotFound )
-		return EFalse;
+    {
+    FUNC_LOG;	
+    // Find first separator in reverse order
+    TInt lastSeparator = aUri.LocateReverseF( KDefaultMailBoxURISeparator );
+    if ( lastSeparator == KErrNotFound )
+        return EFalse;
 
-	// This is where plugin id string starts
-	TInt pluginIdStartPosition = KDefaultMailBoxURI().Length();
-	TInt mailboxIdStartPosition = lastSeparator + 1;
+    // This is where plugin id string starts
+    TInt pluginIdStartPosition = KDefaultMailBoxURI().Length();
+    TInt mailboxIdStartPosition = lastSeparator + 1;
 
-	// It cannot be further than mailbox id
-	if ( pluginIdStartPosition >= mailboxIdStartPosition )
-		return EFalse;
+    // It cannot be further than mailbox id
+    if ( pluginIdStartPosition >= mailboxIdStartPosition )
+        return EFalse;
 
-	// Use TLex to convert string to integer
-	TLex pluginIdConverter( aUri.Mid( pluginIdStartPosition,
-			mailboxIdStartPosition - pluginIdStartPosition - 1 ) );
+    // Use TLex to convert string to integer
+    TLex pluginIdConverter( aUri.Mid( pluginIdStartPosition,
+            mailboxIdStartPosition - pluginIdStartPosition - 1 ) );
 
-	// Use TLex to convert string to integer
-	TLex mailboxIdConverter( aUri.Mid( mailboxIdStartPosition, aUri.Length()
-			- mailboxIdStartPosition ) );
+    // Use TLex to convert string to integer
+    TLex mailboxIdConverter( aUri.Mid( mailboxIdStartPosition, aUri.Length()
+            - mailboxIdStartPosition ) );
 
-	TInt pluginId;
-	TInt mailboxId;
+    TInt pluginId;
+    TInt mailboxId;
 
-	// Get plugin ID
-	if ( pluginIdConverter.Val( pluginId ) != KErrNone)
-		return EFalse;
+    // Get plugin ID
+    if ( pluginIdConverter.Val( pluginId ) != KErrNone)
+        return EFalse;
 
-	// Get mailbox ID
-	if ( mailboxIdConverter.Val( mailboxId ) != KErrNone)
-		return EFalse;
+    // Get mailbox ID
+    if ( mailboxIdConverter.Val( mailboxId ) != KErrNone)
+        return EFalse;
 
-	// Store and we're ready
-	aId.SetPluginId( TUid::Uid( pluginId ) );
-	aId.SetId( mailboxId );
+    // Store and we're ready
+    aId.SetPluginId( TUid::Uid( pluginId ) );
+    aId.SetId( mailboxId );
 
-	return ETrue;
-	}
+    return ETrue;
+    }
 
 TBool CPsMruAdapter::GetUriFromMailboxIdentifier( TFSMailMsgId& aId, HBufC& aUri )
-	{
-	// Add the uri identifier
-	aUri.Des().Copy( KDefaultMailBoxURI );
-	// Add plugin ID
-	aUri.Des().AppendNum( aId.PluginId().iUid );
-	// Add separator
-	aUri.Des().Append( KDefaultMailBoxURISeparator );
-	// Add mailbox id
-	aUri.Des().AppendNum( aId.Id() );
-
-	return true;
-	}
+    {
+    FUNC_LOG;	
+    // Add the uri identifier
+    aUri.Des().Copy( KDefaultMailBoxURI );
+    // Add plugin ID
+    aUri.Des().AppendNum( aId.PluginId().iUid );
+    // Add separator
+    aUri.Des().Append( KDefaultMailBoxURISeparator );
+    // Add mailbox id
+    aUri.Des().AppendNum( aId.Id() );
+    
+    return true;
+    }
 
 void CPsMruAdapter::EventL( TFSMailEvent aEvent, TFSMailMsgId aMailbox,
-		TAny* /*aParam1*/, TAny* aParam2, TAny* /*aParam3*/ )
-	{
-	switch ( aEvent )
-		{
-		case TFSEventMailMoved:
-		case TFSEventMailCopied:		
-		case TFSEventNewMail:
-			{
-			// Check the new parent folder id for this message
-			// For all these events, param2 indicates the new parent folder
-			TFSMailMsgId* parentFolderId =
-					static_cast< TFSMailMsgId* >( aParam2 );
-			if ( parentFolderId )
-				{
-				// Get the parent folder object
-				CFSMailFolder* parentFolder = iMailClient->GetFolderByUidL(
-						aMailbox, *parentFolderId );
-				if ( parentFolder )
-					{
-					CleanupStack::PushL( parentFolder );
+        TAny* /*aParam1*/, TAny* aParam2, TAny* /*aParam3*/ )
+    {
+    FUNC_LOG;	
+    switch ( aEvent )
+        {
+        case TFSEventMailMoved:
+        case TFSEventMailCopied:		
+        case TFSEventNewMail:
+            {
+            // Check the new parent folder id for this message
+            // For all these events, param2 indicates the new parent folder
+            TFSMailMsgId* parentFolderId =
+            		static_cast< TFSMailMsgId* >( aParam2 );
+            if ( parentFolderId )
+                {
+                // Get the parent folder object
+                CFSMailFolder* parentFolder = iMailClient->GetFolderByUidL(
+                        aMailbox, *parentFolderId );
+                if ( parentFolder )
+                    {
+                    CleanupStack::PushL( parentFolder );
+                
+                    // If it's sent/outbox folder,
+                    // we'll consider that as a new message being sent
+                    // and therefore we'll update the MRU list here
+                    if ( ( parentFolder->GetFolderType() == EFSSentFolder ) || 
+                         ( parentFolder->GetFolderType() == EFSOutbox ) )
+                        {
+                        FillDataStoreL( aMailbox );
+                        }
+                    CleanupStack::PopAndDestroy( parentFolder );
+                    }
+                }
+            }
+            break;
+            
+        case TFSEventNewMailbox:
+            {
+            CFSMailBox *mailboxPtr(NULL);
+            // if mailbox is not ready it may leave here
+            TRAPD(trap_err, mailboxPtr = iMailClient->GetMailBoxByUidL( aMailbox ));
+            if ( trap_err != KErrNone )
+                {
+                mailboxPtr = NULL;
+                }
+            if (NULL == mailboxPtr) // mailbox still does not exist 
+                {
+                DeleayMailboxCreationEventL( aMailbox ); // start timer to postpone creation	
+                break;
+                }
+            mailboxPtr = NULL;
+            HBufC* identifier = HBufC::NewLC( KMaximumMailboxUriLength ); // new string ident
+            if ( GetUriFromMailboxIdentifier( aMailbox, *identifier ) )
+                {
+                // Add to supported Uri list
+                iSupportedUris.AppendL( identifier );
 
-					// If it's sent/outbox folder,
-					// we'll consider that as a new message being sent
-					// and therefore we'll update the MRU list here
-					if ( ( parentFolder->GetFolderType() == EFSSentFolder ) || 
-						 ( parentFolder->GetFolderType() == EFSOutbox ) )
-						{
-						FillDataStoreL( aMailbox );
-						}
-					CleanupStack::PopAndDestroy( parentFolder );
-					}
-				}
-			}
-			break;
-			
-		case TFSEventNewMailbox:
-			{
-			HBufC* identifier = HBufC::NewLC( KMaximumMailboxUriLength );
-			if ( GetUriFromMailboxIdentifier( aMailbox, *identifier ) )
-				{
-				// Add to supported Uri list
-				iSupportedUris.AppendL( identifier );
+                // Add new data store to cache
+                iStoreListObserver->AddDataStore( *identifier );
+
+                // Add all data to data store
+                // FillDataStoreL( *identifier );
+                // FillDataStoreL removed - called by AddDataStore through RequestForDataL callback
 
-				// Add new data store to cache
-				iStoreListObserver->AddDataStore( *identifier );
+                // In case there is a problem with transferring strings to  - should be obsolete 
+                AddMailboxObserverL( aMailbox ); // will be added by FillDataStoreL
 
-				// Add all data to data store
-				FillDataStoreL( *identifier );
+                CleanupStack::Pop( identifier );
+                }
+            else
+                {
+                CleanupStack::PopAndDestroy( identifier );
+                }
+            }
+            break;
 
-				CleanupStack::Pop( identifier );
-				}
-			else
-				{
-				CleanupStack::PopAndDestroy( identifier );
-				}
-			}
-			break;
+        case TFSEventMailboxDeleted:
+            {
+            HBufC* identifier = HBufC::NewL( KMaximumMailboxUriLength );
+            if ( GetUriFromMailboxIdentifier( aMailbox, *identifier ) )
+                {
+                RemoveMailboxObserver( aMailbox );
+
+                // Remove data store from cache
+                iStoreListObserver->RemoveDataStore( *identifier );
 
-		case TFSEventMailboxDeleted:
-			{
-			HBufC* identifier = HBufC::NewL( KMaximumMailboxUriLength );
-			if ( GetUriFromMailboxIdentifier( aMailbox, *identifier ) )
-				{
-				RemoveMailboxObserver( aMailbox );
-				
-				// Remove data store from cache
-				iStoreListObserver->RemoveDataStore( *identifier );
-
-				// Remove from supported Uri list
-				for ( TInt i = 0; i < iSupportedUris.Count(); i++ )
-					{
-					if ( iSupportedUris[i]->Compare( *identifier ) == 0 )
-						{
-						delete iSupportedUris[i];
-						iSupportedUris.Remove( i );
-						break;
-						}
-					}
-				}
-			delete identifier;
-			}
-			break;
-		}
-	}
+                // Remove from supported Uri list
+                for ( TInt i = 0; i < iSupportedUris.Count(); i++ )
+                    {
+                    if ( iSupportedUris[i]->Compare( *identifier ) == 0 )
+                        {
+                        delete iSupportedUris[i];
+                        iSupportedUris.Remove( i );
+                        break;
+                        }
+                    }
+                }
+            delete identifier;
+            }
+            break;
+        }
+    }
 
 TBool CPsMruAdapter::AddMailboxObserverL( TFSMailMsgId& aId )
-	{
-	for( TInt index = 0; index < iObservedMailboxes.Count(); index++ )
-		{
-		if( iObservedMailboxes[index] == aId )
-			{
-			// Already observing
-			return EFalse;
-			}
-		}
-	
-	iMailClient->SubscribeMailboxEventsL( aId, *this );
-	iObservedMailboxes.Append( aId );
-	return ETrue;
-	}
+    {
+    FUNC_LOG;	
+    for( TInt index = 0; index < iObservedMailboxes.Count(); index++ )
+        {
+        if( iObservedMailboxes[index] == aId )
+            {
+            // Already observing
+            return EFalse;
+            }
+        }
+    
+    iMailClient->SubscribeMailboxEventsL( aId, *this );
+    iObservedMailboxes.Append( aId );
+    return ETrue;
+    }
 
 TBool CPsMruAdapter::RemoveMailboxObserver( TFSMailMsgId& aId )
-	{
-	for( TInt index = 0; index < iObservedMailboxes.Count(); index++ )
-		{
-		if( iObservedMailboxes[index] == aId )
-			{
-			iMailClient->UnsubscribeMailboxEvents( aId, *this );
-			iObservedMailboxes.Remove( index );
-			return ETrue;
-			}
-		}
-	
-	return EFalse;
-	}
+    {
+    FUNC_LOG;	
+    for( TInt index = 0; index < iObservedMailboxes.Count(); index++ )
+        {
+        if( iObservedMailboxes[index] == aId )
+            {
+            iMailClient->UnsubscribeMailboxEvents( aId, *this );
+            iObservedMailboxes.Remove( index );
+            return ETrue;
+            }
+        }
+    
+    return EFalse;
+    }
 
 void CPsMruAdapter::RemoveAllMailboxObservers()
+    {
+    FUNC_LOG;	
+    for( TInt index = 0; index < iObservedMailboxes.Count(); index++ )
+        {
+        iMailClient->UnsubscribeMailboxEvents( iObservedMailboxes[index], *this );
+        }
+
+    iObservedMailboxes.Reset();	
+    }
+
+/**
+ * If problem with NewMailbox this function will be called 
+ * by CDelayMailboxCreationHelper timer to try it after some delay
+ */
+TBool CPsMruAdapter::DeleayedMailboxCreationEventL()
 	{
-	for( TInt index = 0; index < iObservedMailboxes.Count(); index++ )
-		{
-		iMailClient->UnsubscribeMailboxEvents( iObservedMailboxes[index], *this );
-		}
+    FUNC_LOG;
+    for ( int i = iDelayedCreatedMailboxes.Count()-1; i>=0; i-- )
+        {
+        CFSMailBox *mailboxPtr(NULL);
+        // if mailbox is not ready it may leave there
+        TRAPD(trap_err, mailboxPtr = iMailClient->GetMailBoxByUidL( iDelayedCreatedMailboxes[i] ));
+        if ( trap_err != KErrNone )
+            {
+            mailboxPtr = NULL;
+            }
+        if ( mailboxPtr ) 
+            {
+            HBufC* identifier = HBufC::NewLC( KMaximumMailboxUriLength ); // new string ident
+            if ( GetUriFromMailboxIdentifier( iDelayedCreatedMailboxes[i], *identifier ) )
+                {
+
+                // Add to supported Uri list
+                iSupportedUris.AppendL( identifier );
+
+                // Add new data store to cache
+                iStoreListObserver->AddDataStore( *identifier );
+
+                // Add all data to data store 
+                // removed because this is called by AddDataStore through RequestForDataL callback
+                // FillDataStoreL( *identifier );
+
+                // In case there is a problem with transferring strings to  - should be obsolete 
+                AddMailboxObserverL( iDelayedCreatedMailboxes[i] ); // will be added by FillDataStoreL
+
+                CleanupStack::Pop( identifier );
+                iDelayedCreatedMailboxes.Remove( i );    	
+                }
+            else
+                {
+                CleanupStack::PopAndDestroy( identifier );
+                }
+            } 
+        }
+    return ( 0 == iDelayedCreatedMailboxes.Count() );
+    }
+
+/**
+ * If problem with NewMailbox this function will use 
+ * CDelayMailboxCreationHelper to try it after some delay
+ */
+void CPsMruAdapter::DeleayMailboxCreationEventL( TFSMailMsgId &aMailbox )
+    {
+    FUNC_LOG;	
+    if ( NULL == iDelayMailboxCreationPtr )
+        {
+        iDelayMailboxCreationPtr = CDelayMailboxCreationHelper::NewL( this );
+        }
+    iDelayedCreatedMailboxes.Append( aMailbox );
+    iDelayMailboxCreationPtr->StartDelayedCall();
+    }
+
+// ---------------------------------------------------------------------------------------------------
+// class CDelayMailboxCreationHelper : public CTimer
+// ---------------------------------------------------------------------------------------------------
+
+// static construction leaving on the stack
+CDelayMailboxCreationHelper* CDelayMailboxCreationHelper::NewLC( CPsMruAdapter *aPsMruAdapterPtr )
+    {
+    FUNC_LOG;
+    CDelayMailboxCreationHelper* self = new ( ELeave ) CDelayMailboxCreationHelper( aPsMruAdapterPtr );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
 
-	iObservedMailboxes.Reset();	
-	}
+// static construction leaving
+CDelayMailboxCreationHelper* CDelayMailboxCreationHelper::NewL( CPsMruAdapter *aPsMruAdapterPtr )
+    {
+    FUNC_LOG;
+    CDelayMailboxCreationHelper* self = CDelayMailboxCreationHelper::NewLC( aPsMruAdapterPtr );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// used by MruAdapter when delayed datasource adding is needed
+void CDelayMailboxCreationHelper::StartDelayedCall()	
+    {
+    FUNC_LOG;
+    if( IsActive() )  // don't call again in case the timer rq is pending
+        {
+        Cancel();
+        }
+    iNumberOfDelayedTrials = KNumberOfDelayedTrials;
+    After( KDelayToRunAddMailbox );  // CTimer::After contains SetActive() 
+    }
 
+// Limited unsuccesful call repeating
+void CDelayMailboxCreationHelper::RunL()
+    {
+    FUNC_LOG;
+    iNumberOfDelayedTrials --; 
+    User::LeaveIfError( iStatus.Int() );
+    TBool Handled = iPsMruAdapterPtr->DeleayedMailboxCreationEventL();
+    if (( Handled ) || ( 0 >= iNumberOfDelayedTrials ))
+        { // no need to call again
+        Cancel();
+        }
+    else
+        { // wait once more
+//      SetActive is called by After
+        After( KDelayToRunAddMailbox ); 
+        }
+    }
+
+// when leave from RunL, if err handled return KErrNone
+TInt CDelayMailboxCreationHelper::RunError( TInt aError )
+    {
+    FUNC_LOG;
+    if ( KErrNone != aError )
+        {
+        Cancel(); // stop pending requiest
+        }
+    return KErrNone; //not desired to panic the thread in case of error returned
+    }
+
+// 2nd phase of construction
+void CDelayMailboxCreationHelper::ConstructL()
+    {
+    FUNC_LOG;
+    CTimer::ConstructL();
+    CActiveScheduler::Add( this );
+    }
+
+// c-tor   
+CDelayMailboxCreationHelper::CDelayMailboxCreationHelper(
+    CPsMruAdapter *aPsMruAdapterPtr )
+    : CTimer( EPriorityStandard )  //possible also EPriorityLow, EPriorityIdle
+    , iPsMruAdapterPtr ( aPsMruAdapterPtr )  // not ownink ptr
+    , iNumberOfDelayedTrials ( KNumberOfDelayedTrials ) //limited repeating num.
+    {
+    FUNC_LOG;
+    }
+
+// d-tor
+CDelayMailboxCreationHelper::~CDelayMailboxCreationHelper()
+    {
+    FUNC_LOG;
+    iPsMruAdapterPtr = NULL; // not owning interface ptr
+    Cancel();  // stop pending request
+    Deque();   // remove from CActiveScheduler
+    }
 
 // End of file
-
-
--- a/emailuis/emailui/data/FreestyleEmailUi.rss	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/data/FreestyleEmailUi.rss	Fri Feb 19 22:37:30 2010 +0200
@@ -1116,6 +1116,8 @@
 RESOURCE TBUF r_freestyle_email_ui_folder_list_sent					{ buf=qtn_fse_folder_list_sent; }
 RESOURCE TBUF r_freestyle_email_ui_folder_list_deleted				{ buf=qtn_fse_folder_list_deleted_items; }
 
+RESOURCE TBUF r_freestyle_email_ui_folder_list_folder_with_unread	{ buf=qtn_fse_folder_list_folder_with_unread; }
+
 RESOURCE TBUF r_freestyle_email_ui_dropdown_list_inbox				{ buf=qtn_fse_message_list_inbox; }
 RESOURCE TBUF r_freestyle_email_ui_dropdown_list_outbox				{ buf=qtn_fse_message_list_outbox; }
 RESOURCE TBUF r_freestyle_email_ui_dropdown_list_drafts				{ buf=qtn_fse_message_list_draft; }
@@ -1297,6 +1299,7 @@
           MENU_ITEM { command = EFsEmailUiCmdActionsForward; txt = qtn_fse_message_list_options_forward; },
           MENU_ITEM { command = EFsEmailUiCmdMailActions; txt = qtn_cmail_message_list_options_actions; cascade=r_fsemailui_maillist_submenu_mail_actions;},
           MENU_ITEM { command = EFsEmailUiCmdSync; txt = qtn_cmail_message_list_options_send_receive; },
+          MENU_ITEM { command = EFsEmailUiCmdCancelSync; txt = qtn_fse_launcher_options_cancel_sync; },  
           MENU_ITEM { command = EFsEmailUiCmdSubMenuMark; txt = qtn_fse_message_list_options_mark; cascade=r_fsemailui_maillist_submenu_mark;},
           MENU_ITEM { command = EFsEmailUiCmdSubMenuUnmark; txt = qtn_fse_message_list_options_unmark; cascade=r_fsemailui_maillist_submenu_unmark;},
           MENU_ITEM { command = EFsEmailUiCmdSettings; txt = qtn_fse_message_list_options_settings; },
@@ -2856,6 +2859,11 @@
             },
         STYLUS_POPUP_MENU_ITEM
             {
+            txt = qtn_fse_viewer_options_contact_details;    // contact details
+            command = EFsEmailUiCmdActionsContactDetails;
+            },     
+        STYLUS_POPUP_MENU_ITEM
+            {
                 txt = qtn_cmail_popup_search_server;    // Search from server
                 command = EFsEmailUiCmdActionsRemoteLookup;
             },
--- a/emailuis/emailui/data/html/email_rtl.html	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/data/html/email_rtl.html	Fri Feb 19 22:37:30 2010 +0200
@@ -5,7 +5,7 @@
 	{
 	var bodyFrame = document.getElementById("body_frame");
 	bodyFrame.contentWindow.document.body.dir = "rtl";
-	bodyFrame.contentWindow.document.body.align = "left"
+	bodyFrame.contentWindow.document.body.align = "right"
 	}
 onload=setEmailBodyDirection;
 </script>
--- a/emailuis/emailui/group/FreestyleEmailUi.mmp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/group/FreestyleEmailUi.mmp	Fri Feb 19 22:37:30 2010 +0200
@@ -218,4 +218,4 @@
 
 LIBRARY MsgEditorModel.lib
 LIBRARY touchfeedback.lib
-
+LIBRARY ccaclient.lib
--- a/emailuis/emailui/group/bld.inf	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/group/bld.inf	Fri Feb 19 22:37:30 2010 +0200
@@ -91,14 +91,14 @@
 ../sis/commonemailstub.sis          /epoc32/data/z/system/install/commonemailstub.sis
 
 /* Plugin settings exports */
-../inc/ESMailSettingsPlugin.h |../../../inc/ESMailSettingsPlugin.h
-../inc/ESMailSettingsPlugin.inl |../../../inc/ESMailSettingsPlugin.inl
-../inc/ESMailSettingsPluginUids.hrh |../../../inc/ESMailSettingsPluginUids.hrh/* Required by MCE and Integration MTM*/
+../inc/esmailsettingsplugin.h |../../../inc/esmailsettingsplugin.h
+../inc/esmailsettingsplugin.inl |../../../inc/esmailsettingsplugin.inl
+../inc/esmailsettingspluginuids.hrh |../../../inc/esmailsettingspluginuids.hrh/* Required by MCE and Integration MTM*/
 
 ../inc/FreestyleEmailUiConstants.h |../../../inc/FreestyleEmailUiConstants.h
 
 /* Central Repository for White Label Branding */
-../inc/FreestyleEmailCenRepKeys.h |../../../inc/FreestyleEmailCenRepKeys.h
+../inc/freestyleemailcenrepkeys.h |../../../inc/freestyleemailcenrepkeys.h
 
 // Generic configuration interface for component cenrep settings
 ../conf/freestyleemailui.confml APP_LAYER_CONFML(freestyleemailui.confml) 
--- a/emailuis/emailui/inc/ESMailSettingsPlugin.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/ESMailSettingsPlugin.h	Fri Feb 19 22:37:30 2010 +0200
@@ -158,6 +158,6 @@
 		TUid iDtor_ID_Key;
 };
 
-#include "ESMailSettingsPlugin.inl"
+#include "esmailsettingsplugin.inl"
 
 #endif /*_ESMAILSESETTINGSPLUGIN_H_*/
--- a/emailuis/emailui/inc/FreestyleEmailDownloadInformationMediator.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleEmailDownloadInformationMediator.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,7 +21,7 @@
 //  INCLUDES
 #include <e32base.h>
 //<cmail>
-#include "MFSMailRequestObserver.h"
+#include "mfsmailrequestobserver.h"
 //</cmail>
 #include <AknGlobalMsgQuery.h>
 #include "FreestyleEmailUiConstants.h"
--- a/emailuis/emailui/inc/FreestyleEmailUiAknStatusIndicator.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleEmailUiAknStatusIndicator.h	Fri Feb 19 22:37:30 2010 +0200
@@ -1,10 +1,16 @@
 /*
-* Copyright (c) 2009 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"
 * which accompanies this distribution, and is available
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
 */ 
 
 
--- a/emailuis/emailui/inc/FreestyleEmailUiAppui.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleEmailUiAppui.h	Fri Feb 19 22:37:30 2010 +0200
@@ -34,14 +34,14 @@
 #include <TPbkContactItemField.h>
 #include <hwrmdomainpskeys.h> // For flip change status.
 //<cmail>
-#include "MFSMailRequestObserver.h"
-#include "MFSMailEventObserver.h"
+#include "mfsmailrequestobserver.h"
+#include "mfsmaileventobserver.h"
 #include "FreestyleEmailUiUtilities.h"
 //</cmail>
 #include <msvapi.h>
 #include <cstack.h>
 #include <iaupdateobserver.h>
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 #include "cmailcustomstatuspaneindicators.h"
 
 // INTERNAL INCLUDES
--- a/emailuis/emailui/inc/FreestyleEmailUiConstants.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleEmailUiConstants.h	Fri Feb 19 22:37:30 2010 +0200
@@ -25,7 +25,7 @@
 #define PBKX_DEBUG_LEVEL 3 // Print errors, warnings, traces, infos, details
 
 //<cmail>
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 //</cmail>
 #include <f32file.h>
 
--- a/emailuis/emailui/inc/FreestyleEmailUiContactHandler.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleEmailUiContactHandler.h	Fri Feb 19 22:37:30 2010 +0200
@@ -23,6 +23,10 @@
 #include <MVPbkSingleContactOperationObserver.h>
 #include <MVPbkContactStoreListObserver.h>
 #include <AiwCommon.h>
+
+// CCA Launcher view
+#include <mccaconnection.h>
+
 //<cmail>
 #include "cpbkxremotecontactlookupserviceuicontext.h"
 //</cmail>
@@ -95,7 +99,8 @@
 	public MFSEmailUiClsListsObserver,
 	public MVPbkSingleContactOperationObserver,
 	public MVPbkContactStoreListObserver,
-	public MAiwNotifyCallback
+	public MAiwNotifyCallback, 
+	public MCCAObserver
 
 {
 public:
@@ -339,6 +344,9 @@
 	
 	void ClearObservers();
       
+// from MCCAObserver      
+    void CCASimpleNotifyL( TNotifyType aType, TInt aReason );
+      
 private:
     
     CFSEmailUiContactHandler( RFs& aSession );
@@ -446,10 +454,11 @@
     /// Flag for indicating that caching error was received  
     TBool iCachingInProgressError;
     
-    // <cmail> video call
     // Flag for making video call
     TBool iVideoCall;
-    // </cmail>
+
+    // connection to CCMA launcher    
+    MCCAConnection* iConnection;
 };
 
 #endif /*FREESTYLEEMAILUICONTACTHANDLER_H_*/
--- a/emailuis/emailui/inc/FreestyleEmailUiControlBarCallback.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleEmailUiControlBarCallback.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,7 +21,7 @@
 #define M_FREESTYLEEMAILUICONTROLBARCALLBACK_H
 
 //<cmail>
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 //</cmail>
 
 // FORWARD DECLARATIONS
--- a/emailuis/emailui/inc/FreestyleEmailUiGlobalSettingsListView.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleEmailUiGlobalSettingsListView.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,7 +21,7 @@
 
 // SYSTEM INCLUDES
 //<cmail>
-#include "CFSMailCommon.h" // for email constants
+#include "cfsmailcommon.h" // for email constants
 //</cmail>
 
 // LOCAL INCLUDES
--- a/emailuis/emailui/inc/FreestyleEmailUiHtmlViewerContainer.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleEmailUiHtmlViewerContainer.h	Fri Feb 19 22:37:30 2010 +0200
@@ -22,8 +22,8 @@
 
 
 #include <coecntrl.h>
-#include <BrCtlSpecialLoadObserver.h>
-#include <BrCtlLinkResolver.h>
+#include <brctlspecialloadobserver.h>
+#include <brctllinkresolver.h>
 
 #include "FreestyleEmailDownloadInformationMediator.h"
 #include "OverlayControl.h"
@@ -135,12 +135,15 @@
     // Copies given file to temporary HTML folder and returns an open file
     // handle to the created copy.
 // <cmail>
-    void CopyFileToHtmlFileL( RFile& aFile, const TDesC& aFileName, CFSMailMessagePart& aHtmlBodyPart );
+    void CopyToHtmlFileL( CFSMailMessagePart& aHtmlBodyPart, const TDesC& aFileName );
+    void ConvertToHtmlFileL( CFSMailMessagePart& aTextBodyPart, const TDesC& aHtmlFileName );
+
     // Reads given file content to buffer and return pointer to it
     HBufC8* ReadContentFromFileLC( RFile& aFile );
     // Writes buffer to given file
     void WriteContentToFileL( const TDesC8& aContent, const TDesC& aFileName, CFSMailMessagePart& aHtmlBodyPart );
 
+    void PrepareBodyHtmlL(  const TDesC& aFileName  );
     void WriteEmptyBodyHtmlL( const TDesC& aFileName );
     
 // </cmail>
@@ -166,14 +169,11 @@
     void CopyHTMLResourceL();
     // Ensure all resource files (eg. images) required by HTML display to be ready in C:\[private]\HtmlFile
     void EnsureHTMLResourceL(); 
-    void ConvertPlainTextToHTML(CFSMailMessagePart* aTextBodyPart, RFile htmlFile);
-    void CopyFileToHtmlFileL( const TDesC8& aBuffer,
-            const TDesC& aFileName, CFSMailMessagePart& aHtmlBodyPart );
     void ConvertToHTML( const TDesC8& aContent,
             const TDesC& aFileName, CFSMailMessagePart& aHtmlBodyPart );
     HBufC8* GetCharacterSetL( CFSMailMessagePart& aHtmlBodyPart );
     TBool IsMessageBodyURL(const TDesC& aUrl);
-	void CreateHyperlinksFromUrlsL( CBufBase& aSource );
+    void CreateHyperlinksFromUrlsL( CBufBase& aSource );
     //Returns ETrue of clicking on a link requires a browser to be launched
     TBool NeedToLaunchBrowserL( const TDesC& aUrl );
     //Launch the browser as a standalone app
--- a/emailuis/emailui/inc/FreestyleEmailUiHtmlViewerView.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleEmailUiHtmlViewerView.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,7 +21,7 @@
 #define __FREESTYLEEMAILUI_HTML_VIEWER_VIEW_H__
 
 #include <cstack.h>
-#include "MFSMailRequestObserver.h"
+#include "mfsmailrequestobserver.h"
 #include "mesmricalviewercallback.h"
 #include "mesmricalviewerobserver.h"
 #include "FreestyleEmailUiViewBase.h"
@@ -263,6 +263,9 @@
     void OpenLinkInBrowserL( const TDesC& aUrl) const;
     void SaveWebAddressToFavouritesL( const TDesC& aUrl ) const;
     void SetScrollPosition(TInt aPosition);
+    
+    void CheckMessageBodyL( CFSMailMessage& aMessage, TBool& aMessageBodyStructurePresent, TBool& aMessageBodyContentPresent);
+    
 private: // Constructors
     
     void ConstructL();
--- a/emailuis/emailui/inc/FreestyleEmailUiLauncherGridModel.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleEmailUiLauncherGridModel.h	Fri Feb 19 22:37:30 2010 +0200
@@ -24,7 +24,7 @@
 #include <alf/alftexture.h>
 //</cmail>
 #include "FSEmailLauncherItem.h"
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 
 
 enum TItemType
--- a/emailuis/emailui/inc/FreestyleEmailUiListModel.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleEmailUiListModel.h	Fri Feb 19 22:37:30 2010 +0200
@@ -23,7 +23,7 @@
 
 #include <e32base.h>
 //<cmail>
-#include "CFSMailMessage.h"
+#include "cfsmailmessage.h"
 //</cmail>
 
 // LIST ITEM MODEL DEFINITION
--- a/emailuis/emailui/inc/FreestyleEmailUiMailListVisualiser.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleEmailUiMailListVisualiser.h	Fri Feb 19 22:37:30 2010 +0200
@@ -25,8 +25,8 @@
 //<cmail>
 #include "fscontrolbarobserver.h"
 #include "fstreelistobserver.h"
-#include "CFSMailCommon.h"
-#include "MFSMailEventObserver.h"
+#include "cfsmailcommon.h"
+#include "mfsmaileventobserver.h"
 #include "fsccontactactionmenudefines.h"
 //</cmail>
 #include "FSEmailBuildFlags.h"
@@ -287,7 +287,7 @@
 	void HandleDynamicVariantSwitchL( CFsEmailUiViewBase::TDynamicSwitchType aType );
 	void HandleDynamicVariantSwitchOnBackgroundL( CFsEmailUiViewBase::TDynamicSwitchType aType );
 	// Handle foregroundevent
-	void HandleForegroundEventL();
+	void HandleForegroundEventL( TBool aForeground );
 	// Sets softkeys
 	void SetViewSoftkeysL( TInt aResourceId );
 	void SetMskL();
@@ -785,6 +785,8 @@
     TBool iConsumeStdKeyYes_KeyUp;
     CMailListModelUpdater* iMailListModelUpdater;
     TBool iForceRefresh;
+    // true if message viewer/editor is open to disable background list updates
+    TBool iMailOpened;
   	};
 
 
--- a/emailuis/emailui/inc/FreestyleEmailUiMailViewerVisualiser.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleEmailUiMailViewerVisualiser.h	Fri Feb 19 22:37:30 2010 +0200
@@ -30,7 +30,7 @@
 #include <AknProgressDialog.h>
 //</cmail>
 //<cmail>
-#include "MFSMailRequestObserver.h"
+#include "mfsmailrequestobserver.h"
 #include "mesmricalviewercallback.h"
 #include "mesmricalviewerobserver.h"
 //</cmail>
--- a/emailuis/emailui/inc/FreestyleEmailUiMsgDetailsVisualiser.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleEmailUiMsgDetailsVisualiser.h	Fri Feb 19 22:37:30 2010 +0200
@@ -33,6 +33,8 @@
 #include "FreestyleEmailUiConstants.h"
 #include "FreestyleEmailUiContactHandlerObserver.h"
 
+#include "mfsmailrequestobserver.h"
+#include <AknProgressDialog.h>
 // forward declarations
 class CFSEmailUiMsgDetailsControl;
 class CFSEmailUiMsgDetailsModel;
@@ -50,12 +52,17 @@
 class CFsTreePlainOneLineNodeVisualizer;
 class CFsTreePlainOneLineItemVisualizer;
 class CFsTreePlainTwoLineItemVisualizer;
+class MFSMailRequestObserver; //<cmail>
+class MProgressDialogCallback; //<cmail>
+class CAknWaitDialog; //<cmail>
 
 // <cmail> Touch
 class CFSEmailUiMsgDetailsVisualiser : public CFsEmailUiViewBase,
 									   public MFSEmailUiContactHandlerObserver,
 									   public MFsTreeListObserver,
-									   public MFsActionMenuPositionGiver
+									   public MFsActionMenuPositionGiver,
+									   public MFSMailRequestObserver,
+									   public MProgressDialogCallback
 // </cmail>
 	{ 
 
@@ -119,6 +126,45 @@
     TPoint ActionMenuPosition();
 // </cmail>
 
+    // <cmail>     
+public: 
+	/**
+	 * MFSMailRequestObserver interface implementation
+	 */	 
+    void RequestResponseL( TFSProgress aEvent, TInt aRequestId );
+    
+    /**
+     * MProgressDialogCallback interface implementation 
+     */    
+    void DialogDismissedL( TInt aButtonId);
+    
+private:	
+	/// data related to fetching message structure
+	TInt iCurrentStructureFetchRequestId; 
+	TBool iFetchingMessageStructure;
+	TBool iAsyncProcessComplete;
+	TInt iWaitNoteId;
+	/// Wait note stuff
+	CAknWaitDialog* iWaitDialog;
+	TBool iDialogNotDismissed;
+	
+	/**
+	 * Update our message pointer and saves its status
+	 */	
+	void UpdateMessagePtrL( TFSMailMsgId aNewMailboxId,
+			TFSMailMsgId aNewFolderId,
+			TFSMailMsgId aNewMessageId );
+	
+	/**
+	 * Fetching the Message Structure. It is necessary for POP protocol in order to read recipients 
+	 */
+	void StartFetchingMessageStructureL( CFSMailMessage* aMsg );
+	
+	/**
+	 * Cancel fetching of the message structureCancel fetching of the message structure
+	 */
+	void CancelFetching();	
+	// </cmail>
 // <cmail> Toolbar    
 private: // from
     
--- a/emailuis/emailui/inc/FreestyleEmailUiSearchListVisualiser.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleEmailUiSearchListVisualiser.h	Fri Feb 19 22:37:30 2010 +0200
@@ -22,8 +22,8 @@
 #include <e32base.h>
 
 //<cmail>
-#include "CFSMailCommon.h"
-#include "MFSMailBoxSearchObserver.h"
+#include "cfsmailcommon.h"
+#include "mfsmailboxsearchobserver.h"
 #include "fstreevisualizerobserver.h"
 #include "fstreelistobserver.h"
 #include "fsccontactactionmenudefines.h"
--- a/emailuis/emailui/inc/FreestyleEmailUiSettingsList.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleEmailUiSettingsList.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,7 +21,7 @@
 // SYSTEM INCLUDES
 #include <coecntrl.h>
 #include <e32cmn.h>
-#include "MFSMailRequestObserver.h"
+#include "mfsmailrequestobserver.h"
 #include <AknWaitDialog.h>
 #include <aknlongtapdetector.h>
 
--- a/emailuis/emailui/inc/FreestyleEmailUiUtilities.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleEmailUiUtilities.h	Fri Feb 19 22:37:30 2010 +0200
@@ -231,6 +231,7 @@
 		
     // Set new email message icon on/off
     static void ToggleEmailIconL( TBool aIconOn );
+	static void ToggleEmailIconL( TBool aIconOn, const TFSMailMsgId& aMailBox );
     
     static HBufC* DateTextFromMsgLC( const CFSMailMessage* aMessage,  TBool aAddYearNumer = ETrue );
     static HBufC* TimeTextFromMsgLC( const CFSMailMessage* aMessage );
--- a/emailuis/emailui/inc/FreestyleEmailUiViewBase.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleEmailUiViewBase.h	Fri Feb 19 22:37:30 2010 +0200
@@ -22,7 +22,7 @@
 
 #include <aknview.h>
 //<cmail>
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 //</cmail>
 // <cmail> Toolbar
 #include "akntoolbarobserver.h"
@@ -123,7 +123,7 @@
      * Inherited classes may override this to react to FsEmail application
      * being brougt to foreground while that particular view is active.
      */
-    virtual void HandleForegroundEventL();
+    virtual void HandleForegroundEventL( TBool aForeground );
 
     /**
     * Inherited classes should override this instead of DoDeactivate()
--- a/emailuis/emailui/inc/FreestyleEmailUiWizardObserver.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleEmailUiWizardObserver.h	Fri Feb 19 22:37:30 2010 +0200
@@ -22,7 +22,7 @@
 //  INCLUDES
 #include <AknWaitNoteWrapper.h>
 //<cmail>
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 //</cmail>
 
 
--- a/emailuis/emailui/inc/FreestyleMessageHeaderHTML.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleMessageHeaderHTML.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,8 +21,8 @@
 #include <e32base.h>
 #include <biditext.h>  
 
-#include "CFSMailMessage.h"
-#include "CFSMailAddress.h"
+#include "cfsmailmessage.h"
+#include "cfsmailaddress.h"
 #include "FreestyleMessageHeaderURLFactory.h"
 
 class RWriteStream;
@@ -81,6 +81,12 @@
     void HTMLBodyStartL() const;
     void HTMLBodyEndL() const;
     
+    /*
+     * Writes the subject to iWriteStream and also
+     * takes care of the urls and marks them as hotspots
+     */
+    void WriteSubjectL(TDesC& aText ) const; 
+    
     void ExportSubjectL() const;
     void ExportFromL() const;
     void ExportToL() const;
@@ -147,6 +153,7 @@
     TInt                        iVisibleWidth;
     TInt                        iScrollPosition;
     TBidiText::TDirectionality  iDirectionality;
+    TBool                       iMirrorLayout;
      
     RPointerArray<CFSMailMessagePart> iAttachments;
 };
--- a/emailuis/emailui/inc/FreestyleMessageHeaderURL.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleMessageHeaderURL.h	Fri Feb 19 22:37:30 2010 +0200
@@ -31,6 +31,7 @@
 _LIT( KURLHttpPrefix, "http://" );
 _LIT( KURLHttpsPrefix, "https://" );
 _LIT( KURLMailToPrefix, "mailto:" );
+_LIT( KURLTypeSubject, "subject" );
 
 class CFreestyleMessageHeaderURL : public CBase
     {
--- a/emailuis/emailui/inc/FreestyleMessageHeaderURLFactory.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleMessageHeaderURLFactory.h	Fri Feb 19 22:37:30 2010 +0200
@@ -35,7 +35,8 @@
         };
 public:
     IMPORT_C static CFreestyleMessageHeaderURL* CreateEmailAddressUrlL( TEmailAddressType aEmailType, const CFSMailAddress& aEmailAddress );
-    IMPORT_C static CFreestyleMessageHeaderURL* CreateAttachmentUrlL( const TDesC& aAttachmentItemId ); 
+    IMPORT_C static CFreestyleMessageHeaderURL* CreateAttachmentUrlL( const TDesC& aAttachmentItemId );
+    IMPORT_C static CFreestyleMessageHeaderURL* CreateEmailSubjectUrlL( const TDesC& aSubject );
     };
 
 #endif //__CFREESTYLE_MESSAGE_HEADER_URL_FACTORY_H__
--- a/emailuis/emailui/inc/OverlayControl.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/OverlayControl.h	Fri Feb 19 22:37:30 2010 +0200
@@ -74,12 +74,6 @@
 	void HandlePointerEventL(const TPointerEvent& aPointerEvent);
 	
 	void MakeVisible( TBool aVisible );
-
-	   /**
-	     * Update visual state
-	     * @param aButtonDown ETrue if button is in down state
-	     */
-	void UpdateButtonState( TBool aButtonDown );
 	
 private:
 
@@ -94,30 +88,10 @@
 	 */
 	void ConstructL( CCoeControl* aParent, const TRect& aRect, TInt aBitmapId, TInt aMaskId );
 
-	/**
-	 * Make a copy of bitmap
-	 */
-    void CopyBitmapL( const CFbsBitmap& aSource, CFbsBitmap& aDest );
-    
-    /**
-     * Adjust alpha for the bitmap
-     * @param aBitmap bitmap to adjust
-     * @param aFactor factor to apply
-     */
-    void AdjustAlpha( CFbsBitmap& aBitmap, TReal aFactor );
-    
-    /**
-     * Update used mask according to current button state
-     */
-    void UpdateMask();
-	
 private:
     
 	CFbsBitmap* iBitmap;
 	CFbsBitmap* iMask;
-	CFbsBitmap* iSolidMask;
-	TBool iDownState;
-	
 	MOverlayControlObserver* iObserver;
 	};
 
--- a/emailuis/emailui/inc/freestyleemailuimailboxdeleter.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/freestyleemailuimailboxdeleter.h	Fri Feb 19 22:37:30 2010 +0200
@@ -23,7 +23,7 @@
 #include <AknWaitDialog.h>
 
 // INTERNAL INCLUDE FILES
-#include "MFSMailRequestObserver.h"
+#include "mfsmailrequestobserver.h"
 
 // FORWARD DECLARATIONS
 class CFSMailClient;
--- a/emailuis/emailui/inc/ncscomposeview.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/ncscomposeview.h	Fri Feb 19 22:37:30 2010 +0200
@@ -20,8 +20,8 @@
 #ifndef __CNCSCOMPOSEVIEW_H__
 #define __CNCSCOMPOSEVIEW_H__
 
-#include "CFSMailCommon.h"
-#include "MFSMailRequestObserver.h"
+#include "cfsmailcommon.h"
+#include "mfsmailrequestobserver.h"
 #include <alf/alfenv.h>
 #include "AknServerApp.h"
 #include <AknProgressDialog.h>
--- a/emailuis/emailui/inc/ncssubjectfield.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/ncssubjectfield.h	Fri Feb 19 22:37:30 2010 +0200
@@ -177,8 +177,6 @@
     
     TRgb iBgColor;
     
-    CAsyncCallBack* iFocusChangeHandler;
-    
     TBool iDrawAfterFocusChange;
    
 // <cmail> Platform layout changes
--- a/emailuis/emailui/inc/ncsutility.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/inc/ncsutility.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,7 +21,7 @@
 #define NCSUTILITY_H
 
 #include <cntitem.h>
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 #include "ncsaddressinputfield.h"
 
 class CNcsEmailAddressObject;
--- a/emailuis/emailui/loc/freestyleemailui.loc	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/loc/freestyleemailui.loc	Fri Feb 19 22:37:30 2010 +0200
@@ -955,7 +955,7 @@
 // l:popup_note_window/opt2
 // r:TB9.1
 //
-#define qtn_fse_confirm_note_sending_queued	"E-mail queued for sending"
+#define qtn_fse_confirm_note_sending_queued	"Sending mail"
 
 // d:Information note. Informs that e-mail is in Outbox until status is online.
 // l:popup_note_window/opt2
@@ -1600,6 +1600,12 @@
 //
 #define qtn_fse_folder_list_deleted_items	"Deleted items"
 
+// d:Folder list item with unread count
+// l:list_single_large_graphic_pane_t1
+// r:5250+
+//
+#define qtn_fse_folder_list_folder_with_unread	"%0U (%1N)"
+
 // d:Options menu item in folder list
 // l:list_single_pane_t1_cp2
 // r:TB9.1
--- a/emailuis/emailui/sendasmtm/fsmtms/client/inc/cfsclientmtm.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/sendasmtm/fsmtms/client/inc/cfsclientmtm.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,7 +21,7 @@
 
 #include <e32base.h>
 #include <mtclbase.h>
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 
 #include <msvstd.hrh>
 enum TEasEmailMTMCmds
--- a/emailuis/emailui/sendasmtm/fsmtms/client/src/cfsclientmtm.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/sendasmtm/fsmtms/client/src/cfsclientmtm.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -32,7 +32,7 @@
 
 
 #include <centralrepository.h>
-#include "FreestyleEmailCenRepKeys.h"
+#include "freestyleemailcenrepkeys.h"
 #include <MeetingRequestIds.hrh>
 #include "cfssendashelper.h"
 #include "fsmtmsconstants.h"
--- a/emailuis/emailui/sendasmtm/fsmtms/server/src/cfsservermtm.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/sendasmtm/fsmtms/server/src/cfsservermtm.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -20,7 +20,7 @@
 #include "emailtrace.h"
 #include <StringLoader.h>
 #include <centralrepository.h>
-#include "FreestyleEmailCenRepKeys.h"
+#include "freestyleemailcenrepkeys.h"
 #include "cfsservermtm.h"
 #include <msventry.h>
 #include <mentact.h>
--- a/emailuis/emailui/sendasmtm/fsmtms/uidata/src/cfsuidatamtm.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/sendasmtm/fsmtms/uidata/src/cfsuidatamtm.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -33,13 +33,13 @@
 #include "cfsuidatamtm.h"
 
 // FREESTYLE EMAIL FRAMEWORK INCLUDES
-#include "CFSMailCommon.h"
-#include "CFSMailClient.h"
-#include "CFSMailBox.h"
+#include "cfsmailcommon.h"
+#include "cfsmailclient.h"
+#include "cfsmailbox.h"
 
 
 #include <gulicon.h>
-#include "MFSMailBrandManager.h"
+#include "mfsmailbrandmanager.h"
 
 // GLOBAL EXPORTS.
 
@@ -139,77 +139,77 @@
     // Support for White label branding added
     CFSMailClient* mailClient = CFSMailClient::NewL();
     CleanupClosePushL(*mailClient);
-	MFSMailBrandManager& brandManager = mailClient->GetBrandManagerL();
-	RPointerArray<CFSMailBox> mailboxes;
-	CleanupResetAndDestroyClosePushL( mailboxes );
-	TFSMailMsgId id;
+    MFSMailBrandManager& brandManager = mailClient->GetBrandManagerL();
+    RPointerArray<CFSMailBox> mailboxes;
+    CleanupResetAndDestroyClosePushL( mailboxes );
+    TFSMailMsgId id;
 
-	mailClient->ListMailBoxes( id, mailboxes );
+    mailClient->ListMailBoxes( id, mailboxes );
 
-	iIconArrays->Reset();
-	iMailboxIds.Reset();
+    iIconArrays->Reset();
+    iMailboxIds.Reset();
 
-	for ( TInt i = 0; i <= mailboxes.Count(); i++ ) // Last round is for setting the default mb icon at the end of the list
-		{
-	    CFbsBitmap* bitmap(0);
-	    CFbsBitmap* bitmapMask(0);
-	    CArrayPtrFlat<CFbsBitmap>* array = new (ELeave) CArrayPtrFlat<CFbsBitmap>( 2 );
-		CleanupStack::PushL( array ); // +2 array
-		array->SetReserveL( 2 ); // AppendLs will not LEAVE
-		
-		CGulIcon* brandedIcon( NULL );
-		TInt err;
+    for ( TInt i = 0; i <= mailboxes.Count(); i++ ) // Last round is for setting the default mb icon at the end of the list
+        {
+        CFbsBitmap* bitmap(0);
+        CFbsBitmap* bitmapMask(0);
+        CArrayPtrFlat<CFbsBitmap>* array = new (ELeave) CArrayPtrFlat<CFbsBitmap>( 2 );
+        CleanupStack::PushL( array ); // +2 array
+        array->SetReserveL( 2 ); // AppendLs will not LEAVE
+        
+        CGulIcon* brandedIcon( NULL );
+        TInt err;
 
-		if ( i < mailboxes.Count() ) // Do not execute for the last round
-			{
-			TRAP( err, brandedIcon = brandManager.GetGraphicL( EFSMailboxIcon, mailboxes[i]->GetId() ) );
-			}
-		if ( err == KErrNone && brandedIcon )
-			{
-			bitmap = brandedIcon->Bitmap();
-			bitmapMask = brandedIcon->Mask();
-			brandedIcon->SetBitmapsOwnedExternally( ETrue );
-		    CleanupStack::PushL( bitmap );
-		    array->AppendL( bitmap );
-		    CleanupStack::Pop( bitmap );
-			bitmap = 0;
-		    CleanupStack::PushL( bitmapMask );
-			array->AppendL( bitmapMask );
-		    CleanupStack::Pop( bitmapMask );
-			bitmapMask = 0;
-			iIconArrays->AppendL( array );
-			iMailboxIds.Append( (mailboxes[i]->GetId()).Id() );
+        if ( i < mailboxes.Count() ) // Do not execute for the last round
+            {
+            TRAP( err, brandedIcon = brandManager.GetGraphicL( EFSMailboxIcon, mailboxes[i]->GetId() ) );
+            }
+        if ( err == KErrNone && brandedIcon )
+            {
+            bitmap = brandedIcon->Bitmap();
+            bitmapMask = brandedIcon->Mask();
+            brandedIcon->SetBitmapsOwnedExternally( ETrue );
+            CleanupStack::PushL( bitmap );
+            array->AppendL( bitmap );
+            CleanupStack::Pop( bitmap );
+            bitmap = 0;
+            CleanupStack::PushL( bitmapMask );
+            array->AppendL( bitmapMask );
+            CleanupStack::Pop( bitmapMask );
+            bitmapMask = 0;
+            iIconArrays->AppendL( array );
+            iMailboxIds.Append( (mailboxes[i]->GetId()).Id() );
             }
-		else
-			{
-			// Icon was not found from the branding manager or last round for the default icon
-			TRAPD( err, AknIconUtils::CreateIconL( bitmap, bitmapMask, bitmapFileName,
-					EMbmFsuidatamtmQgn_prop_cmail_inbox_small, EMbmFsuidatamtmQgn_prop_cmail_inbox_small + 1 ));
-			if( err != KErrNone )
-				{
-				}
-		    CleanupStack::PushL( bitmap );
-		    array->AppendL( bitmap );
-		    CleanupStack::Pop( bitmap );
-			bitmap = 0;
-		    CleanupStack::PushL( bitmapMask );
-			array->AppendL( bitmapMask );
-		    CleanupStack::Pop( bitmapMask );
-			bitmapMask = 0;
-			// INFO: This is not working for some reason, otherwise above code is not required.
-			// CreateBitmapsL(2, KFsUiDataMtmUdBitmapFile, EMbmFsuidatamtmFsmailbox, 
-			// EMbmFsuidatamtmLastElement);
-			iIconArrays->AppendL( array );
-			iMailboxIds.Append(0);
-			}
-		if ( brandedIcon )
-			{
-			delete brandedIcon;
-			}
-		CleanupStack::Pop( array );  
-		}
-	
-	CleanupStack::PopAndDestroy( &mailboxes );
+        else
+            {
+            // Icon was not found from the branding manager or last round for the default icon
+            TRAPD( err, AknIconUtils::CreateIconL( bitmap, bitmapMask, bitmapFileName,
+                    EMbmFsuidatamtmQgn_prop_cmail_inbox_small, EMbmFsuidatamtmQgn_prop_cmail_inbox_small + 1 ));
+            if( err != KErrNone )
+                {
+                }
+            CleanupStack::PushL( bitmap );
+            array->AppendL( bitmap );
+            CleanupStack::Pop( bitmap );
+            bitmap = 0;
+            CleanupStack::PushL( bitmapMask );
+            array->AppendL( bitmapMask );
+            CleanupStack::Pop( bitmapMask );
+            bitmapMask = 0;
+            // INFO: This is not working for some reason, otherwise above code is not required.
+            // CreateBitmapsL(2, KFsUiDataMtmUdBitmapFile, EMbmFsuidatamtmFsmailbox, 
+            // EMbmFsuidatamtmLastElement);
+            iIconArrays->AppendL( array );
+            iMailboxIds.Append(0);
+            }
+        if ( brandedIcon )
+            {
+            delete brandedIcon;
+            }
+        CleanupStack::Pop( array );  
+        }
+    
+    CleanupStack::PopAndDestroy( &mailboxes );
     CleanupStack::PopAndDestroy( mailClient );
 
 }
@@ -251,12 +251,12 @@
 {
     FUNC_LOG;
     for ( TInt i = 0; i < iIconArrays->Count() - 1; i++ )
-    	{
+        {
         if ( iMailboxIds[i] == aContext.iMtmData2 )
-        	{    	
-        	return *(iIconArrays->At( i ));
-        	}
-    	}
+            {       
+            return *(iIconArrays->At( i ));
+            }
+        }
     return *(iIconArrays->At( iIconArrays->Count() - 1)); // Default icon
 }
 
@@ -339,11 +339,11 @@
     FUNC_LOG;
     if ((aNewEntry.iMtm == KUidMsgValTypeFsMtmVal) && 
         (aNewEntry.iType == KUidMsvServiceEntry) )
-    	{
-    	aReasonResourceId=0;
+        {
+        aReasonResourceId=0;
         // --- Can create services if they are off root ---
         return (aParent.Id() == KMsvRootIndexEntryIdValue);
-    	}
+        }
     aReasonResourceId = R_FS_NOT_SUPPORTED;
     
     return EFalse;
@@ -532,7 +532,7 @@
         // defined in aknsconstants.hrh.
 
             //Disabling SendAs for Calendar is removed.
-       	    aResponse=ETrue;
+            aResponse=ETrue;
             break;
 
         default:
--- a/emailuis/emailui/sendasmtm/inc/cfssendashelper.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/sendasmtm/inc/cfssendashelper.h	Fri Feb 19 22:37:30 2010 +0200
@@ -24,7 +24,7 @@
 
 #include <cmsvrecipientlist.h>
 //<cmail>
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 //</cmail>
 // ---------------------------------------------------------------------------
 
--- a/emailuis/emailui/sendasmtm/sendashelper/inc/cfssendashelper.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/sendasmtm/sendashelper/inc/cfssendashelper.h	Fri Feb 19 22:37:30 2010 +0200
@@ -24,7 +24,7 @@
 
 #include <cmsvrecipientlist.h>
 //<cmail>
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 //</cmail>
 // ---------------------------------------------------------------------------
 
--- a/emailuis/emailui/sendasmtm/sendashelper/src/cfssendashelper.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/sendasmtm/sendashelper/src/cfssendashelper.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -31,19 +31,19 @@
 #include <FreestyleEmailUi.rsg>
 
 //<cmail>
-#include "CFSMailCommon.h"
-#include "CFSMailClient.h"
-#include "CFSMailMessage.h"
-#include "CFSMailBox.h"
-#include "CFSMailAddress.h"
-#include "CFSMailMessageBase.h"
-#include "CFSMailMessagePart.h"
+#include "cfsmailcommon.h"
+#include "cfsmailclient.h"
+#include "cfsmailmessage.h"
+#include "cfsmailbox.h"
+#include "cfsmailaddress.h"
+#include "cfsmailmessagebase.h"
+#include "cfsmailmessagepart.h"
 #include "FreestyleEmailUiConstants.h"
-#include "ESMailSettingsPlugin.h"
+#include "esmailsettingsplugin.h"
 //</cmail>
 #include "cfssendashelper.h"
 #include "fsmtmsconstants.h"
-#include "FreestyleEmailCenRepKeys.h"
+#include "freestyleemailcenrepkeys.h"
 
 _LIT( KFreestyleEmailUiResourceFileName, "FreestyleEmailUi.rsc" );
 
--- a/emailuis/emailui/sis/commonemail.pkg	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/sis/commonemail.pkg	Fri Feb 19 22:37:30 2010 +0200
@@ -256,4 +256,4 @@
 
 ; emailservices / emailservermonitor
 "\epoc32\release\armv5\urel\emailservermonitor.exe"              - "c:\sys\bin\emailservermonitor.exe"
-"\epoc32\release\armv5\urel\fsmailserverautostart.exe"           - "c:\sys\bin\fsmailserverautostart.exe", FILERUN, RUNBOTH
+"\epoc32\release\armv5\urel\fsmailserverautostart.exe"           - "c:\sys\bin\fsmailserverautostart.exe", FILERUN, RUNINSTALL
--- a/emailuis/emailui/sis/commonemail_loc.pkg	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/sis/commonemail_loc.pkg	Fri Feb 19 22:37:30 2010 +0200
@@ -1222,4 +1222,4 @@
 
 ; emailservices / emailservermonitor
 "\epoc32\release\armv5\urel\emailservermonitor.exe"              - "c:\sys\bin\emailservermonitor.exe"
-"\epoc32\release\armv5\urel\fsmailserverautostart.exe"           - "c:\sys\bin\fsmailserverautostart.exe", FILERUN, RUNBOTH
+"\epoc32\release\armv5\urel\fsmailserverautostart.exe"           - "c:\sys\bin\fsmailserverautostart.exe", FILERUN, RUNINSTALL
--- a/emailuis/emailui/sis/commonemail_udeb.pkg	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/sis/commonemail_udeb.pkg	Fri Feb 19 22:37:30 2010 +0200
@@ -244,4 +244,4 @@
 
 ; emailservices / emailservermonitor
 "\epoc32\release\armv5\udeb\emailservermonitor.exe"              - "c:\sys\bin\emailservermonitor.exe"
-"\epoc32\release\armv5\udeb\fsmailserverautostart.exe"           - "c:\sys\bin\fsmailserverautostart.exe", FILERUN, RUNBOTH
+"\epoc32\release\armv5\udeb\fsmailserverautostart.exe"           - "c:\sys\bin\fsmailserverautostart.exe", FILERUN, RUNINSTALL
--- a/emailuis/emailui/sis/commonemail_udeb_loc.pkg	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/sis/commonemail_udeb_loc.pkg	Fri Feb 19 22:37:30 2010 +0200
@@ -1210,4 +1210,4 @@
 
 ; emailservices / emailservermonitor
 "\epoc32\release\armv5\udeb\emailservermonitor.exe"              - "c:\sys\bin\emailservermonitor.exe"
-"\epoc32\release\armv5\udeb\fsmailserverautostart.exe"           - "c:\sys\bin\fsmailserverautostart.exe", FILERUN, RUNBOTH
+"\epoc32\release\armv5\udeb\fsmailserverautostart.exe"           - "c:\sys\bin\fsmailserverautostart.exe", FILERUN, RUNINSTALL
--- a/emailuis/emailui/sis/pkg-localizer.py	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/sis/pkg-localizer.py	Fri Feb 19 22:37:30 2010 +0200
@@ -14,8 +14,8 @@
 * Contributors:
 *
 * Description:
-* Python script that can be used to make localized pkg-files
-* based on Engineering English pkg-files
+* Python script that can be used to make localized pkg-files based on
+* Engineering English pkg-files. Meant only for internal use in Email.
 *
 */
 """
--- a/emailuis/emailui/src/FSComposerFetchLogic.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FSComposerFetchLogic.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,8 +18,8 @@
 
 //<cmail>
 #include "emailtrace.h"
-#include "CFSMailClient.h"
-#include "CFSMailCommon.h"
+#include "cfsmailclient.h"
+#include "cfsmailcommon.h"
 //</cmail>
 #include <FreestyleEmailUi.rsg>
 //#include <aknquerydialog.h> //<cmail>
--- a/emailuis/emailui/src/FreestyleEmailCenRepHandler.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailCenRepHandler.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -22,8 +22,8 @@
 #include <e32svr.h>
 #include <aknnotewrappers.h> // for note
 
-#include "FreestyleEmailCenRepHandler.h"
-#include "FreestyleEmailCenRepKeys.h"
+#include "freestyleemailcenrephandler.h"
+#include "freestyleemailcenrepkeys.h"
 
 // CONSTANTS
 //_LIT( KFsCrHandlerDelimiter, "," );
--- a/emailuis/emailui/src/FreestyleEmailDownloadInformationMediator.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailDownloadInformationMediator.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -20,7 +20,7 @@
 #include "emailtrace.h"
 #include <e32svr.h>
 //<cmail>
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 //</cmail>
 #include <StringLoader.h>
 #include <FreestyleEmailUi.rsg>
@@ -29,7 +29,7 @@
 #include "FreestyleEmailUiLiterals.h"
 #include "FreestyleEmailUiUtilities.h"
 #include "FreestyleEmailDownloadInformationMediator.h"
-#include "FreestyleEmailCenRepHandler.h"
+#include "freestyleemailcenrephandler.h"
 #include "FreestyleEmailUiAppui.h"
 #include "FSEmail.pan"
 
--- a/emailuis/emailui/src/FreestyleEmailUiAknStatusIndicator.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiAknStatusIndicator.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -1,17 +1,23 @@
 /*
-* Copyright (c) 2009 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"
 * which accompanies this distribution, and is available
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
 */ 
 
 #include "FreestyleEmailUiAknStatusIndicator.h"
 
 #include <biditext.h>
-#include <akniconutils.h>
-#include <aknbiditextutils.h>
+#include <AknIconUtils.h>
+#include <AknBidiTextUtils.h>
 
 const TInt KImageMargin = 8;
 const TInt KTextMargin = 4;
--- a/emailuis/emailui/src/FreestyleEmailUiAppui.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiAppui.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -32,12 +32,12 @@
 #include <fsmailserver.rsg>
 #include <StringLoader.h>
 //<cmail>
-#include "CFSMailClient.h"
-#include "CFSMailBox.h"
-#include "CFSMailFolder.h"
-#include "CFSMailMessage.h"
-#include "CFSMailAddress.h"
-#include "CFSMailCommon.h"
+#include "cfsmailclient.h"
+#include "cfsmailbox.h"
+#include "cfsmailfolder.h"
+#include "cfsmailmessage.h"
+#include "cfsmailaddress.h"
+#include "cfsmailcommon.h"
 //</cmail>
 #include <freestyleemailui.mbg>
 #include <AknQueryDialog.h>
@@ -169,6 +169,7 @@
     {
     FUNC_LOG;
     iEnv = &aEnv;
+    TIMESTAMP( "Application starting" );
     }
 
 // ---------------------------------------------------------------------------
@@ -381,6 +382,7 @@
     // until a certain callback event is received
     // -> thus keep this last in this method!
     iWizardObserver->DoWizardStartupActionsL();
+    TIMESTAMP( "Application started" );
     }
 
 // Functions loads some views as delayed to reduce startup time
@@ -531,6 +533,7 @@
     delete iNaviDecorator2MailViewer;
 
     delete iConnectionStatusIconAnimTimer;
+    TIMESTAMP( "Application exit" );
     }
 
 
@@ -634,6 +637,14 @@
             iCurrentActiveView = iNavigationHistory->Pop();
             }
         }
+    // may be tricky; added here to handle activation of composer view from external app when email is plugin settings view
+    // in this case also duplictaed view needs to be poped up, but iSettingsViewActive is already set to EFalse
+    // other solution would need to expand api of this class to handle directly this case 
+    else
+    	if ( iPreviousActiveView->Id() == SettingsViewId  || iPreviousActiveView->Id() == MailListId )
+    		{
+    		iCurrentActiveView = iNavigationHistory->Pop();
+    		}
     }
 
 void CFreestyleEmailUiAppUi::ViewActivatedExternallyL( TUid aViewId )
@@ -668,7 +679,7 @@
             iCurrentActiveView = static_cast<CFsEmailUiViewBase*>( View(aViewId) );
             }
         }
-
+    TIMESTAMP( "View activated" );
     }
 
 void CFreestyleEmailUiAppUi::SetSwitchingToBackground( TBool aValue )
@@ -700,6 +711,7 @@
 	    {
        	ReturnToPreviousViewL();
 	    }
+	TIMESTAMP( "Returned from html viewer view to previous view" );
 	}
 
 TUid CFreestyleEmailUiAppUi::ReturnToPreviousViewL( const TDesC8& aCustomMessage /*= KNullDesC8*/ )
@@ -725,6 +737,7 @@
 	if ( viewId == AppGridId )
 		{
 		ActivateLocalViewL( AppGridId );
+		TIMESTAMP( "Return to application grid view" );
 		}
 	else if ( viewId == MailListId )
 		{
@@ -737,6 +750,7 @@
     		const TPckgBuf<TMailListActivationData> pkgOut;
     		ActivateLocalViewL( MailListId, KStartListReturnToPreviousFolder, pkgOut );
 		    }
+		TIMESTAMP( "Return to message list view" );
 		}
 	else if ( viewId == SearchListViewId )
 		{
@@ -755,10 +769,12 @@
 	    // launch html viewer
 		const TPckgBuf<THtmlViewerActivationData> pkgOut;
 		ActivateLocalViewL( HtmlViewerId, KHtmlViewerReturnToPrevious, pkgOut );
+		TIMESTAMP( "Return to html viewer view" );
 	    }
 	else if ( viewId == MailEditorId )
 		{
 		ActivateLocalViewL( MailEditorId, TUid::Uid(KEditorCmdReturnToPrevious), aCustomMessage );
+		TIMESTAMP( "Return to email editor view" );
 		}
 	else if ( viewId == MsgDetailsViewId )
 		{
@@ -772,6 +788,7 @@
 		{
 		// Generic case where the view does not need any startup parameters
 		ActivateLocalViewL( viewId );
+		TIMESTAMP( "Return to previous view" );
 		}
 
 	return viewId;
@@ -824,6 +841,7 @@
         {
         ActivateLocalViewL( iCurrentActiveView->Id() );
         }
+    TIMESTAMP( "Return to earlier view" );
     }
 
 void CFreestyleEmailUiAppUi::ShowFolderListInPopupL(
@@ -897,6 +915,7 @@
 void CFreestyleEmailUiAppUi::Exit()
     {
     FUNC_LOG;
+    TIMESTAMP ("Exiting from email application");
     g_ApplicationExitOnGoing = ETrue;
     if ( iExitGuardian->ExitApplication() == KRequestPending )
         {
@@ -1741,23 +1760,40 @@
 
 // Force Sync on active mailbox.
 void CFreestyleEmailUiAppUi::SyncActiveMailBoxL()
-	{
-    FUNC_LOG;
-	if ( iActiveMailbox )
-		{
-    	iSyncStatusReqId = iActiveMailbox->RefreshNowL( *this );
-		}
-	}
-
+     {
+     FUNC_LOG;
+     if( iActiveMailbox )
+         {
+         // Start sync automatically if not syncing already
+         TSSMailSyncState latestSyncstate = iActiveMailbox->CurrentSyncState();
+         if( latestSyncstate != InboxSyncing && latestSyncstate != StartingSync && latestSyncstate != EmailSyncing )
+	     {
+    	     iSyncStatusReqId = iActiveMailbox->RefreshNowL( *this );
+	     }
+         }
+      }
 void CFreestyleEmailUiAppUi::StopActiveMailBoxSyncL()
-	{
-    FUNC_LOG;
-    if ( iActiveMailbox )
-        {
-        iActiveMailbox->CancelSyncL();
-        }
-	}
-
+     {
+     FUNC_LOG;
+     if ( iActiveMailbox && iActiveMailbox->GetMailBoxStatus()==EFSMailBoxOnline)
+         {
+         TSSMailSyncState latestSyncstate = iActiveMailbox->CurrentSyncState();
+         if(latestSyncstate == InboxSyncing ||
+                latestSyncstate == EmailSyncing ||
+                latestSyncstate == OutboxSyncing ||
+                latestSyncstate == SentItemsSyncing ||
+                latestSyncstate == DraftsSyncing ||
+                latestSyncstate == CalendarSyncing ||
+                latestSyncstate == ContactsSyncing ||
+                latestSyncstate == TasksSyncing ||
+                latestSyncstate == NotesSyncing ||
+                latestSyncstate == FilesSyncing ||
+                latestSyncstate == DataSyncStarting )
+             {
+             iActiveMailbox->CancelSyncL();
+             }
+         }
+     }
 
 MCoeMessageObserver::TMessageResponse CFreestyleEmailUiAppUi::HandleMessageL(
     TUint32 aClientHandleOfTargetWindowGroup,
@@ -1883,7 +1919,9 @@
         			{
                     case StartingSync:
                         {
+                        TIMESTAMP( "Starting sync" );
                         //If syncs were started by user, show the synchoronisation indicator
+                        TIMESTAMP( "Sync error" );
                         if(iManualMailBoxSyncAll)
                             {
                             ManualMailBoxSyncAll(EFalse);
@@ -1910,6 +1948,7 @@
                     case SyncCancelled:
                     case Idle:
                         {
+                        TIMESTAMP( "Sync finished" );
                         ManualMailBoxSync( EFalse );
                         }
                         break;
--- a/emailuis/emailui/src/FreestyleEmailUiAttachmentsListModel.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiAttachmentsListModel.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 // SYSTEM INCLUDEfS
 //<cmail>
 #include "emailtrace.h"
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 //</cmail>
 #include <StringLoader.h>
 #include <FreestyleEmailUi.rsg>
--- a/emailuis/emailui/src/FreestyleEmailUiAttachmentsListVisualiser.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiAttachmentsListVisualiser.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 
 // SYSTEM INCLUDES
 #include "emailtrace.h"
-#include "CFSMailBox.h"
+#include "cfsmailbox.h"
 #include <e32base.h>
 #include <freestyleemailui.mbg>
 #include <AknUtils.h>
--- a/emailuis/emailui/src/FreestyleEmailUiCLSListsHandler.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiCLSListsHandler.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -20,7 +20,7 @@
 #include <centralrepository.h>						// CRepository
 #include <AknFepInternalCRKeys.h>					// KCRUidAknFep
 //<cmail>
-#include "CFSMailBox.h"								// cfsmailbox
+#include "cfsmailbox.h"								// cfsmailbox
 //</cmail>
 #include <CPsRequestHandler.h>
 #include <CPsSettings.h>
--- a/emailuis/emailui/src/FreestyleEmailUiContactHandler.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiContactHandler.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -35,13 +35,16 @@
 #include <MVPbkContactFieldTextData.h>
 #include <MVPbkContactStoreList.h>
 
+// CCA Launcher view
+#include <mccaparameter.h>
+#include <ccafactory.h>
+#include <ccapbkcontextlauncher.h>
+
 
 // Phonebook 2
 #include <CPbk2SortOrderManager.h>
 #include <MPbk2ContactNameFormatter.h>
 #include <Pbk2ContactNameFormatterFactory.h>        
-#include <Pbk2ViewId.hrh>
-#include <CPbk2ViewState.h>
 
 // Send UI
 #include <sendui.h>
@@ -70,7 +73,7 @@
 #include <AiwServiceHandler.h>
 
 // FS Email framework
-#include "CFSMailBox.h"
+#include "cfsmailbox.h"
 //</cmail>
 
 #include <FreestyleEmailUi.rsg>
@@ -106,8 +109,8 @@
 CFSEmailUiContactHandler::~CFSEmailUiContactHandler()
     {
     FUNC_LOG;
-	delete iContactForMsgCreation;
-	if (iPersistentSetting)
+    delete iContactForMsgCreation;
+    if (iPersistentSetting)
         {
         iPersistentSetting->Close();
         delete iPersistentSetting;
@@ -128,6 +131,11 @@
     delete iLinkOperationFetch;
     delete iCurrentLink;
     delete iLastClsItem;
+    
+    if ( iConnection )
+        {
+        iConnection->Close();
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -140,72 +148,72 @@
     {
     FUNC_LOG;
     if ( iState == EContactHandlerIdle ) //Check that there are no other request on going
-    	{
-    	iState = EContactHandlerAddToContacts;
-    	iHandlerObserver = aObserver; //Can be null
-    	TUint assignFlags = 0;
-    	if ( aAddToContactsType == EContactHandlerCreateNewContact )
-    		{
-    		// In case of EUpdateExisting, we don't have to do anything as default is updateexisting
-    		assignFlags = AiwContactAssign::ECreateNewContact;
-    		}
+        {
+        iState = EContactHandlerAddToContacts;
+        iHandlerObserver = aObserver; //Can be null
+        TUint assignFlags = 0;
+        if ( aAddToContactsType == EContactHandlerCreateNewContact )
+            {
+            // In case of EUpdateExisting, we don't have to do anything as default is updateexisting
+            assignFlags = AiwContactAssign::ECreateNewContact;
+            }
 
-    	CAiwGenericParamList& inParamList =
-    	iServiceHandler->InParamListL();
+        CAiwGenericParamList& inParamList =
+        iServiceHandler->InParamListL();
 
-    	inParamList.AppendL(
-    			TAiwGenericParam(
-    					EGenericParamContactAssignData,
-    					TAiwVariant(AiwContactAssign::TAiwSingleContactAssignDataV1Pckg(
-    							AiwContactAssign::TAiwSingleContactAssignDataV1().SetFlags(assignFlags)))));
-    	
-    	TGenericParamIdValue updateType;
-    	if ( aUpdateType == EContactUpdateEmail )
-    		{
-    		updateType = EGenericParamEmailAddress;
-    		}
-    	else // EContactUpdateNumber
-    		{
-    		updateType = EGenericParamPhoneNumber;
-    		}
-    	
-    	inParamList.AppendL(
-    			TAiwGenericParam(
-    					updateType,
-    					TAiwVariant(aDes)
-    			));
+        inParamList.AppendL(
+                TAiwGenericParam(
+                        EGenericParamContactAssignData,
+                        TAiwVariant(AiwContactAssign::TAiwSingleContactAssignDataV1Pckg(
+                                AiwContactAssign::TAiwSingleContactAssignDataV1().SetFlags(assignFlags)))));
+        
+        TGenericParamIdValue updateType;
+        if ( aUpdateType == EContactUpdateEmail )
+            {
+            updateType = EGenericParamEmailAddress;
+            }
+        else // EContactUpdateNumber
+            {
+            updateType = EGenericParamPhoneNumber;
+            }
+        
+        inParamList.AppendL(
+                TAiwGenericParam(
+                        updateType,
+                        TAiwVariant(aDes)
+                ));
 
-    	//Async call, CallBack is HandleNotify
-    	iServiceHandler->ExecuteServiceCmdL(
-    			KAiwCmdAssign,
-    			inParamList,
-    			iServiceHandler->OutParamListL(),
-    			0,
-    			this);
-    	}
+        //Async call, CallBack is HandleNotify
+        iServiceHandler->ExecuteServiceCmdL(
+                KAiwCmdAssign,
+                inParamList,
+                iServiceHandler->OutParamListL(),
+                0,
+                this);
+        }
     }
 
 // -----------------------------------------------------------------------------
 // CFSEmailUiContactHandler::AddToContactsQueryL
 // -----------------------------------------------------------------------------
 TBool CFSEmailUiContactHandler::AddtoContactsQueryL( TAddToContactsType& aType )
-	{
+    {
     FUNC_LOG;
-	// create popup list dialog asking new/update
-	// Costruct listbox and popup list
-	CEikTextListBox* listbox = new ( ELeave ) CAknSinglePopupMenuStyleListBox();
-	CleanupStack::PushL( listbox );
+    // create popup list dialog asking new/update
+    // Costruct listbox and popup list
+    CEikTextListBox* listbox = new ( ELeave ) CAknSinglePopupMenuStyleListBox();
+    CleanupStack::PushL( listbox );
 
-	CAknPopupList* popupList = CAknPopupList::NewL( listbox, 
-			R_AVKON_SOFTKEYS_SELECT_BACK );
+    CAknPopupList* popupList = CAknPopupList::NewL( listbox, 
+            R_AVKON_SOFTKEYS_SELECT_BACK );
 
-	CleanupStack::PushL( popupList );
-	listbox->ConstructL( popupList, CEikListBox::ELeftDownInViewRect );
+    CleanupStack::PushL( popupList );
+    listbox->ConstructL( popupList, CEikListBox::ELeftDownInViewRect );
 
-	listbox->CreateScrollBarFrameL(ETrue);
-	listbox->ScrollBarFrame()->SetScrollBarVisibilityL(
-			CEikScrollBarFrame::EOff,
-			CEikScrollBarFrame::EAuto );
+    listbox->CreateScrollBarFrameL(ETrue);
+    listbox->ScrollBarFrame()->SetScrollBarVisibilityL(
+            CEikScrollBarFrame::EOff,
+            CEikScrollBarFrame::EAuto );
 
     // Get list item array and put all removable theme names in it.
     MDesCArray* itemList = listbox->Model()->ItemTextArray();
@@ -216,7 +224,7 @@
     popupList->SetTitleL( *resource );
     CleanupStack::PopAndDestroy( resource );            
 
-	// Load and append actual selection lines
+    // Load and append actual selection lines
     resource = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_CREATE_NEW_CONTACT );
     listitems->AppendL( *resource );
     CleanupStack::PopAndDestroy( resource );            
@@ -228,23 +236,23 @@
     TBool returnValue = EFalse;
     // Execute popup list.
     if ( popupList->ExecuteLD() )
-    	{
-    	if ( !listbox->CurrentItemIndex() )
-    		{
-    		aType = EContactHandlerCreateNewContact;
-    		}
-    	else
-    		{
-    		//UpdateExisting is "default" so no flags are needed
-    		aType = EContactHandlerUpdateExisting;
-    		}
-    	returnValue = ETrue; //User pressed OK
-    	}
+        {
+        if ( !listbox->CurrentItemIndex() )
+            {
+            aType = EContactHandlerCreateNewContact;
+            }
+        else
+            {
+            //UpdateExisting is "default" so no flags are needed
+            aType = EContactHandlerUpdateExisting;
+            }
+        returnValue = ETrue; //User pressed OK
+        }
     CleanupStack::Pop( popupList ); 
-	CleanupStack::PopAndDestroy( listbox );	
+    CleanupStack::PopAndDestroy( listbox ); 
 
-	return returnValue;
-	}
+    return returnValue;
+    }
 
 // ---------------------------------------------------------------------------
 // CFSEmailUiContactHandler::FindAndCallToContactByEmailL
@@ -273,22 +281,22 @@
 // CFSEmailUiContactHandler::FindAndCreateMsgToContactByEmailL
 // -----------------------------------------------------------------------------
 void CFSEmailUiContactHandler::FindAndCreateMsgToContactByEmailL( const TDesC& aEmailAddress,
-															 	  CFSMailBox* aMailBox )
+                                                                  CFSMailBox* aMailBox )
     {
     FUNC_LOG;
     if ( iOpenComplete && (iState == EContactHandlerIdle) ) //If contact stores all ready
-    	{
-    	
-    	iState = EContactHandlerCreateMessage;
-     	iMailBox = aMailBox;     	
+        {
+        
+        iState = EContactHandlerCreateMessage;
+        iMailBox = aMailBox;        
 
-     	FindContactLinkL( aEmailAddress );
-    	
-    	}
+        FindContactLinkL( aEmailAddress );
+        
+        }
     }
 
 
-	
+    
 // ---------------------------------------------------------------------------
 // Searches for the contact if necessary and shows the contact details.
 // ---------------------------------------------------------------------------
@@ -306,8 +314,8 @@
 
 
 void CFSEmailUiContactHandler::MakeAiwCallL(MVPbkContactLink* aContactLink,
-											const TDesC& aContactNumber,
-											TBool aVoipOverride )
+                                            const TDesC& aContactNumber,
+                                            TBool aVoipOverride )
     {
     FUNC_LOG;
     CAiwDialDataExt* dialData = CAiwDialDataExt::NewLC();
@@ -316,22 +324,22 @@
     HBufC8* linkBuffer(NULL);
     
     if( aContactLink )
-    	{
-    	linkBuffer = aContactLink->PackLC();
-    	dialData->SetContactLinkL( *linkBuffer );
-   		// Contact link exists, check if voip is preferred
-	   	// Create iPersistentSetting here only when needed for the first time
-		if ( !iPersistentSetting )
-			{
-		    iPersistentSetting = 
-		        PbkGlobalSettingFactory::CreatePersistentSettingL();
-		    iPersistentSetting->
-		        ConnectL(MPbkGlobalSetting::ERichCallSettingsCategory);		
-			} 
-		if ( aVoipOverride || SelectBetweenCsAndVoip() == EAiwVoIPCall )
-			{
-		    dialData->SetCallType( CAiwDialData::EAIWVoiP );      	  	
-			}
+        {
+        linkBuffer = aContactLink->PackLC();
+        dialData->SetContactLinkL( *linkBuffer );
+        // Contact link exists, check if voip is preferred
+        // Create iPersistentSetting here only when needed for the first time
+        if ( !iPersistentSetting )
+            {
+            iPersistentSetting = 
+                PbkGlobalSettingFactory::CreatePersistentSettingL();
+            iPersistentSetting->
+                ConnectL(MPbkGlobalSetting::ERichCallSettingsCategory);     
+            } 
+        if ( aVoipOverride || SelectBetweenCsAndVoip() == EAiwVoIPCall )
+            {
+            dialData->SetCallType( CAiwDialData::EAIWVoiP );            
+            }
         // <cmail> video call
         else if ( iVideoCall )
             {
@@ -339,17 +347,17 @@
             dialData->SetCallType( CAiwDialData::EAIWForcedVideo );
             }
         // </cmail>
-		else
-			{
-		    dialData->SetCallType( CAiwDialData::EAIWVoice );      	  	
-			} 							
-    	}
+        else
+            {
+            dialData->SetCallType( CAiwDialData::EAIWVoice );           
+            }                           
+        }
     else
-    	{
-		if ( aVoipOverride )
-			{
-		    dialData->SetCallType( CAiwDialData::EAIWVoiP );      	  	
-			}
+        {
+        if ( aVoipOverride )
+            {
+            dialData->SetCallType( CAiwDialData::EAIWVoiP );            
+            }
         // <cmail> video call
         else if ( iVideoCall ) 
             {
@@ -357,19 +365,19 @@
             dialData->SetCallType( CAiwDialData::EAIWForcedVideo );
             }
         // </cmail>
-		else
-			{
-		    dialData->SetCallType( CAiwDialData::EAIWVoice );      	  	
-			}   
-    	dialData->SetPhoneNumberL( aContactNumber );
-    	}
+        else
+            {
+            dialData->SetCallType( CAiwDialData::EAIWVoice );           
+            }   
+        dialData->SetPhoneNumberL( aContactNumber );
+        }
     
     CAiwGenericParamList& inParamList = iServiceHandler->InParamListL();
     dialData->FillInParamListL( inParamList );    
     if( aContactLink )
-    	{
-    	CleanupStack::PopAndDestroy( linkBuffer );
-    	}
+        {
+        CleanupStack::PopAndDestroy( linkBuffer );
+        }
     
     CleanupStack::PopAndDestroy( dialData );
     
@@ -380,12 +388,12 @@
         0,
         NULL );
     if ( iHandlerObserver )
-    	{
-    	RPointerArray<CFSEmailUiClsItem> emptyArray;
-    	iHandlerObserver->OperationCompleteL( EFindAndCallToContactByEmailL, emptyArray );
-    	emptyArray.Close();
-    	iHandlerObserver = NULL;
-    	}
+        {
+        RPointerArray<CFSEmailUiClsItem> emptyArray;
+        iHandlerObserver->OperationCompleteL( EFindAndCallToContactByEmailL, emptyArray );
+        emptyArray.Close();
+        iHandlerObserver = NULL;
+        }
     iState = EContactHandlerIdle;
     } 
 
@@ -396,12 +404,12 @@
     // Default to voice call
     TInt ret = EAiwVoice;
     
-	TInt preferred = KErrNotFound;
+    TInt preferred = KErrNotFound;
     if ( iPersistentSetting )
-    	{
-	    iPersistentSetting->Get
-    	    (MPbkGlobalSetting::EPreferredTelephony, preferred);	
-    	}
+        {
+        iPersistentSetting->Get
+            (MPbkGlobalSetting::EPreferredTelephony, preferred);    
+        }
    
     // VoIP type is preferred only if the setting is,
     // KInternetCallPreferred. In other cases, like when the setting
@@ -430,16 +438,16 @@
     {
     FUNC_LOG;
     if ( (iState == EContactHandlerIdle) ||
-    	 (iState == EContactHandlerSearchMatches)  )
-    	{
-    	iState = EContactHandlerSearchMatches;
-    	iHandlerObserver = aObserver;
-    	
-    	iClsListHandler->SetCurrentMailboxL( aMailBox );
-    	
-    	//Async call, CallBack is ArrayUpdatedL (when error: OperationErrorL)
-    	iClsListHandler->SearchMatchesL( aText );
-    	}
+         (iState == EContactHandlerSearchMatches)  )
+        {
+        iState = EContactHandlerSearchMatches;
+        iHandlerObserver = aObserver;
+        
+        iClsListHandler->SetCurrentMailboxL( aMailBox );
+        
+        //Async call, CallBack is ArrayUpdatedL (when error: OperationErrorL)
+        iClsListHandler->SearchMatchesL( aText );
+        }
     }
 
 TBool CFSEmailUiContactHandler::IsLanguageSupportedL()
@@ -449,48 +457,48 @@
     }
 
 CVPbkContactManager* CFSEmailUiContactHandler::GetContactManager()
-	{
+    {
     FUNC_LOG;
-	return iContactManager;
-	}
+    return iContactManager;
+    }
 
 
 void CFSEmailUiContactHandler::GetAddressesFromPhonebookL(
     MFSEmailUiContactHandlerObserver* aObserver )
-	{
+    {
     FUNC_LOG;
-	if ( iState == EContactHandlerIdle )
-		{
-		if ( !aObserver )
-			{
-			//Request can't be fulfilled without observer
-			return;
-			}
-		iHandlerObserver = aObserver;
-		iState = EContactHandlerGetAddressesFromPhonebook;
-		TUint fetchFlags = 0;
+    if ( iState == EContactHandlerIdle )
+        {
+        if ( !aObserver )
+            {
+            //Request can't be fulfilled without observer
+            return;
+            }
+        iHandlerObserver = aObserver;
+        iState = EContactHandlerGetAddressesFromPhonebook;
+        TUint fetchFlags = 0;
 
-		iContactObjects.ResetAndDestroy();
+        iContactObjects.ResetAndDestroy();
 
-		CAiwGenericParamList& inParamList = iServiceHandler->InParamListL();
-		inParamList.AppendL(
-				TAiwGenericParam(
-						EGenericParamContactSelectionData,
-						TAiwVariant(TAiwMultipleItemSelectionDataV1Pckg(
-								TAiwMultipleItemSelectionDataV1().
-								SetAddressSelectType(EAiwEMailSelect).
-								SetFlags( fetchFlags )))));
+        CAiwGenericParamList& inParamList = iServiceHandler->InParamListL();
+        inParamList.AppendL(
+                TAiwGenericParam(
+                        EGenericParamContactSelectionData,
+                        TAiwVariant(TAiwMultipleItemSelectionDataV1Pckg(
+                                TAiwMultipleItemSelectionDataV1().
+                                SetAddressSelectType(EAiwEMailSelect).
+                                SetFlags( fetchFlags )))));
 
 
-		//Async call, CallBack is HandleNotify
-		iServiceHandler->ExecuteServiceCmdL(
-				KAiwCmdSelect,
-				inParamList,
-				iServiceHandler->OutParamListL(),
-				0,
-				this);	
-		}
-	}
+        //Async call, CallBack is HandleNotify
+        iServiceHandler->ExecuteServiceCmdL(
+                KAiwCmdSelect,
+                inParamList,
+                iServiceHandler->OutParamListL(),
+                0,
+                this);  
+        }
+    }
 
 // <cmail> video call
 // ---------------------------------------------------------------------------
@@ -508,22 +516,22 @@
 //
 /////////////////////////////////////////////////////////////////////////////
 void CFSEmailUiContactHandler::GetSmsAddressFromPhonebookAndSendL( MVPbkContactLink* aContactLink )
-	{
+    {
     FUNC_LOG;
-	if ( iState == EContactHandlerIdle )
-		{
-		iState = EContactHandlerGetSmsAddressFromPhonebook;
+    if ( iState == EContactHandlerIdle )
+        {
+        iState = EContactHandlerGetSmsAddressFromPhonebook;
 
- 		CAiwGenericParamList& inParamList = iServiceHandler->InParamListL();
- 		// Set data type select
- 	    TAiwSingleItemSelectionDataV3 dataSelect;
+        CAiwGenericParamList& inParamList = iServiceHandler->InParamListL();
+        // Set data type select
+        TAiwSingleItemSelectionDataV3 dataSelect;
         dataSelect.SetAddressSelectType( EAiwPhoneNumberSelect );
         TAiwSingleItemSelectionDataV3Pckg dataPckg( dataSelect );
         inParamList.AppendL( TAiwGenericParam( EGenericParamContactSelectionData, 
                            TAiwVariant( dataPckg )));
- 	 		
- 		// Append contact links 		
-       	CVPbkContactLinkArray* links = CVPbkContactLinkArray::NewLC();
+            
+        // Append contact links         
+        CVPbkContactLinkArray* links = CVPbkContactLinkArray::NewLC();
         links->AppendL( aContactLink ); // Clone ownership is transferred    
         HBufC8* packedLinks = links->PackLC();          
         inParamList.AppendL( TAiwGenericParam( EGenericParamContactLinkArray,
@@ -532,60 +540,60 @@
         CleanupStack::PopAndDestroy( links ); 
 
         //Async call, CallBack is HandleNotify
-		iServiceHandler->ExecuteServiceCmdL(
-				KAiwCmdSelect,
-				inParamList,
-				iServiceHandler->OutParamListL(),
-				0,
-				this);	
-		}
-	}
+        iServiceHandler->ExecuteServiceCmdL(
+                KAiwCmdSelect,
+                inParamList,
+                iServiceHandler->OutParamListL(),
+                0,
+                this);  
+        }
+    }
 
 /////////////////////////////////////////////////////////////////////////////
 // CFSEmailUiContactHandler::GetMmsAddressFromPhonebookAndSendL
 //
 /////////////////////////////////////////////////////////////////////////////
 void CFSEmailUiContactHandler::GetMmsAddressFromPhonebookAndSendL( MVPbkContactLink* aContactLink,
-														    TBool aIsVoiceMessage )
-	{
+                                                            TBool aIsVoiceMessage )
+    {
     FUNC_LOG;
-	if ( iState == EContactHandlerIdle )
-		{
-		if ( aIsVoiceMessage )
-			{
-			iState = EContactHandlerGetVoiceMsgAddressFromPhonebook;		
-			}
-		else
-			{
-			iState = EContactHandlerGetMmsAddressFromPhonebook;			
-			}
+    if ( iState == EContactHandlerIdle )
+        {
+        if ( aIsVoiceMessage )
+            {
+            iState = EContactHandlerGetVoiceMsgAddressFromPhonebook;        
+            }
+        else
+            {
+            iState = EContactHandlerGetMmsAddressFromPhonebook;         
+            }
 
- 		CAiwGenericParamList& inParamList = iServiceHandler->InParamListL();
- 		// Set data type select
- 	    TAiwSingleItemSelectionDataV3 dataSelect;
+        CAiwGenericParamList& inParamList = iServiceHandler->InParamListL();
+        // Set data type select
+        TAiwSingleItemSelectionDataV3 dataSelect;
         dataSelect.SetAddressSelectType( EAiwMMSSelect );
         TAiwSingleItemSelectionDataV3Pckg dataPckg( dataSelect );
         inParamList.AppendL( TAiwGenericParam( EGenericParamContactSelectionData, 
                            TAiwVariant( dataPckg )));
- 	 		
- 		// Append contact links 				
-       	CVPbkContactLinkArray* links = CVPbkContactLinkArray::NewLC();
+            
+        // Append contact links                 
+        CVPbkContactLinkArray* links = CVPbkContactLinkArray::NewLC();
         links->AppendL( aContactLink ); // Clone ownership is transferred
-	    HBufC8* packedLinks = links->PackLC();          
+        HBufC8* packedLinks = links->PackLC();          
         inParamList.AppendL( TAiwGenericParam( EGenericParamContactLinkArray,
                           TAiwVariant(*packedLinks)));
         CleanupStack::PopAndDestroy( packedLinks ); 
         CleanupStack::PopAndDestroy( links );
 
         //Async call, CallBack is HandleNotify
-		iServiceHandler->ExecuteServiceCmdL(
-				KAiwCmdSelect,
-				inParamList,
-				iServiceHandler->OutParamListL(),
-				0,
-				this);	
-		}
-	}
+        iServiceHandler->ExecuteServiceCmdL(
+                KAiwCmdSelect,
+                inParamList,
+                iServiceHandler->OutParamListL(),
+                0,
+                this);  
+        }
+    }
 
 /////////////////////////////////////////////////////////////////////////////
 // CFSEmailUiContactHandler::ArrayUpdatedL
@@ -598,56 +606,56 @@
 
     switch ( iState )
         {
-		case EContactHandlerCreateMessage:
-			CreateMessageL( aMatchingItems );	
-			break;
-		case EContactHandlerCallToContactByEmail:
-			if ( aMatchingItems.Count() )
-				{
-				delete iLastClsItem;
-				iLastClsItem = NULL;
-				iLastClsItem = aMatchingItems[0]->CloneLC();
-				CleanupStack::Pop();
-				}
-			HandleCallL( aMatchingItems );
-			break;
-		case EContactHandlerShowContactDetails:
-			ShowDetailsL( aMatchingItems );
-			break;
-		case EContactHandlerSearchMatches: 
-			if ( aMatchingItems.Count() == 1 )
-				{
-				if ( !iSearchMatch )
-					{
-					iSearchMatch = CFSEmailUiClsItem::NewL();			
-					}
-				iSearchMatch->SetDisplayNameL( aMatchingItems[0]->DisplayName() );
-				iSearchMatch->SetEmailAddressL( aMatchingItems[0]->EmailAddress() );
-				}
-			else
-			    {
-			    delete iSearchMatch;
-			    iSearchMatch = NULL;
-			    }
-	
-			// The ownership of the array content is transferred to observer.
-			iState = EContactHandlerIdle;
-			if ( iHandlerObserver )
-				{
-				iHandlerObserver->OperationCompleteL( ESearchContacts, aMatchingItems );
-				}
-			break;
-		default:
-			break;
+        case EContactHandlerCreateMessage:
+            CreateMessageL( aMatchingItems );   
+            break;
+        case EContactHandlerCallToContactByEmail:
+            if ( aMatchingItems.Count() )
+                {
+                delete iLastClsItem;
+                iLastClsItem = NULL;
+                iLastClsItem = aMatchingItems[0]->CloneLC();
+                CleanupStack::Pop();
+                }
+            HandleCallL( aMatchingItems );
+            break;
+        case EContactHandlerShowContactDetails:
+            ShowDetailsL( aMatchingItems );
+            break;
+        case EContactHandlerSearchMatches: 
+            if ( aMatchingItems.Count() == 1 )
+                {
+                if ( !iSearchMatch )
+                    {
+                    iSearchMatch = CFSEmailUiClsItem::NewL();           
+                    }
+                iSearchMatch->SetDisplayNameL( aMatchingItems[0]->DisplayName() );
+                iSearchMatch->SetEmailAddressL( aMatchingItems[0]->EmailAddress() );
+                }
+            else
+                {
+                delete iSearchMatch;
+                iSearchMatch = NULL;
+                }
+    
+            // The ownership of the array content is transferred to observer.
+            iState = EContactHandlerIdle;
+            if ( iHandlerObserver )
+                {
+                iHandlerObserver->OperationCompleteL( ESearchContacts, aMatchingItems );
+                }
+            break;
+        default:
+            break;
         }
 
     }
 
 void CFSEmailUiContactHandler::OperationErrorL( TInt aErrorCode )
-	{
+    {
     FUNC_LOG;
-	if ( iHandlerObserver )
-		{
+    if ( iHandlerObserver )
+        {
         // KerrNotReady --> caching in progress, KErrNotFound --> caching not started yet
         if ( (aErrorCode == KErrNotReady) || (aErrorCode == KErrNotFound) )
             {
@@ -662,9 +670,9 @@
                 {
                 iCachingInProgressError = EFalse;
                 iState = EContactHandlerIdle;
-		iHandlerObserver->OperationErrorL( ESearchContacts, aErrorCode );
-		}
-	}
+        iHandlerObserver->OperationErrorL( ESearchContacts, aErrorCode );
+        }
+    }
         else
             {
             iState = EContactHandlerIdle;
@@ -679,373 +687,373 @@
 
 
 void CFSEmailUiContactHandler::VPbkSingleContactOperationComplete(
-	    MVPbkContactOperationBase& aOperation,
-	    MVPbkStoreContact* aContact )
-	{
+        MVPbkContactOperationBase& aOperation,
+        MVPbkStoreContact* aContact )
+    {
     FUNC_LOG;
 //inform also client in case of error to enable client's actions (i.e. return search priority)
-//	TRAP_IGNORE( VPbkSingleContactOperationCompleteL( aOperation, aContact) );
+//  TRAP_IGNORE( VPbkSingleContactOperationCompleteL( aOperation, aContact) );
     TRAPD(error, VPbkSingleContactOperationCompleteL( aOperation, aContact) );
     if ( error != KErrNone )
         {
         TRAP_IGNORE(ObserverOperationErrorL( CurrentCommand(), error ));
         }
 //
-	}
+    }
 
 void CFSEmailUiContactHandler::VPbkSingleContactOperationCompleteL(
-		    MVPbkContactOperationBase& aOperation,
-		    MVPbkStoreContact* aContact )
-	{
+            MVPbkContactOperationBase& aOperation,
+            MVPbkStoreContact* aContact )
+    {
     FUNC_LOG;
-	
-	if ( (iLinkOperationFetch == &aOperation) && iState == EContactHandlerGetAddressesFromPhonebook )
-		{
-		CleanupDeletePushL( aContact );
-		
-		RPointerArray<HBufC> firstname;
-		CleanupResetAndDestroyClosePushL( firstname );
-		RPointerArray<HBufC> lastname;
-		CleanupResetAndDestroyClosePushL( lastname );
-		RPointerArray<HBufC> emailAddresses;			
-		CleanupResetAndDestroyClosePushL( emailAddresses );
-		GetContactFieldsL( iFirstnameFields, firstname, aContact );
-		GetContactFieldsL( iLastnameFields, lastname, aContact );
-	
-		// Create display name, this will be used in UI.
-		TInt dispNameLength = 1;
-		if ( firstname.Count() ) dispNameLength += firstname[0]->Length();
-		if ( lastname.Count() ) dispNameLength += lastname[0]->Length();
-		HBufC* displayname = HBufC::NewLC( dispNameLength );
-		
-		if ( firstname.Count() )
-			{
-			displayname->Des().Copy( *firstname[0] );
-			displayname->Des().Append( KSpace );
-			}
-		if ( lastname.Count() )
-			{
-			displayname->Des().Append( *lastname[0] );
-			}
-		
-		// retrieve selected email address
-		MVPbkStoreContactFieldCollection& fields = aContact->Fields();
-		MVPbkBaseContactField* selectedField = fields.RetrieveField( *iCurrentLink );
-		HBufC* selectedEmailAddress = MVPbkContactFieldTextData::Cast( 
-						selectedField->FieldData() ).Text().AllocLC();
+    
+    if ( (iLinkOperationFetch == &aOperation) && iState == EContactHandlerGetAddressesFromPhonebook )
+        {
+        CleanupDeletePushL( aContact );
+        
+        RPointerArray<HBufC> firstname;
+        CleanupResetAndDestroyClosePushL( firstname );
+        RPointerArray<HBufC> lastname;
+        CleanupResetAndDestroyClosePushL( lastname );
+        RPointerArray<HBufC> emailAddresses;            
+        CleanupResetAndDestroyClosePushL( emailAddresses );
+        GetContactFieldsL( iFirstnameFields, firstname, aContact );
+        GetContactFieldsL( iLastnameFields, lastname, aContact );
+    
+        // Create display name, this will be used in UI.
+        TInt dispNameLength = 1;
+        if ( firstname.Count() ) dispNameLength += firstname[0]->Length();
+        if ( lastname.Count() ) dispNameLength += lastname[0]->Length();
+        HBufC* displayname = HBufC::NewLC( dispNameLength );
+        
+        if ( firstname.Count() )
+            {
+            displayname->Des().Copy( *firstname[0] );
+            displayname->Des().Append( KSpace );
+            }
+        if ( lastname.Count() )
+            {
+            displayname->Des().Append( *lastname[0] );
+            }
+        
+        // retrieve selected email address
+        MVPbkStoreContactFieldCollection& fields = aContact->Fields();
+        MVPbkBaseContactField* selectedField = fields.RetrieveField( *iCurrentLink );
+        HBufC* selectedEmailAddress = MVPbkContactFieldTextData::Cast( 
+                        selectedField->FieldData() ).Text().AllocLC();
 
         //check number of email addreses
         GetContactFieldsL( iEmailFields, emailAddresses, aContact );
-		// create contact object
-		CFSEmailUiClsItem* item = CFSEmailUiClsItem::NewLC();
+        // create contact object
+        CFSEmailUiClsItem* item = CFSEmailUiClsItem::NewLC();
         
         if ( emailAddresses.Count() > 1 )
             {
             item->SetMultipleEmails( ETrue );
             }
 
-		item->SetDisplayNameL( displayname->Des() );
-		item->SetEmailAddressL( *selectedEmailAddress );
-		CleanupStack::Pop( item );
-		iContactObjects.Append( item );
+        item->SetDisplayNameL( displayname->Des() );
+        item->SetEmailAddressL( *selectedEmailAddress );
+        CleanupStack::Pop( item );
+        iContactObjects.Append( item );
 
-		CleanupStack::PopAndDestroy( selectedEmailAddress );
-		selectedEmailAddress = NULL;
+        CleanupStack::PopAndDestroy( selectedEmailAddress );
+        selectedEmailAddress = NULL;
 
-		
-		CleanupStack::PopAndDestroy( displayname );
-		CleanupStack::PopAndDestroy( &emailAddresses );
-		CleanupStack::PopAndDestroy( &lastname );
-		CleanupStack::PopAndDestroy( &firstname );
-		CleanupStack::PopAndDestroy( aContact );
-		
-		// Get index of Next ContactLink if there's no LinkSet
-		// or iCurrenLink index is set to 0
-		TInt index = (iLinksSet && iCurrentLink ? iLinksSet->Find
-				(*iCurrentLink) + 1 : 0);
-		
-		if (iLinksSet && index < iLinksSet->Count())
-		    {
-		    iCurrentLink = &iLinksSet->At(index);
-		    delete iLinkOperationFetch;
-		    iLinkOperationFetch = NULL;
+        
+        CleanupStack::PopAndDestroy( displayname );
+        CleanupStack::PopAndDestroy( &emailAddresses );
+        CleanupStack::PopAndDestroy( &lastname );
+        CleanupStack::PopAndDestroy( &firstname );
+        CleanupStack::PopAndDestroy( aContact );
+        
+        // Get index of Next ContactLink if there's no LinkSet
+        // or iCurrenLink index is set to 0
+        TInt index = (iLinksSet && iCurrentLink ? iLinksSet->Find
+                (*iCurrentLink) + 1 : 0);
+        
+        if (iLinksSet && index < iLinksSet->Count())
+            {
+            iCurrentLink = &iLinksSet->At(index);
+            delete iLinkOperationFetch;
+            iLinkOperationFetch = NULL;
 
-		    //Async operation, callback VPbkSingleContactOperationCompleteL
-		    //Error situations: VPbkSingleContactOperationFailed
-		    iLinkOperationFetch = iContactManager->RetrieveContactL(
-		        *iCurrentLink, *this);
-		    }
-		else 
-		    {
-		    delete iLinkOperationFetch; 
-		    iLinkOperationFetch = NULL;
+            //Async operation, callback VPbkSingleContactOperationCompleteL
+            //Error situations: VPbkSingleContactOperationFailed
+            iLinkOperationFetch = iContactManager->RetrieveContactL(
+                *iCurrentLink, *this);
+            }
+        else 
+            {
+            delete iLinkOperationFetch; 
+            iLinkOperationFetch = NULL;
 
-		    iCurrentLink = NULL;
-		    iState = EContactHandlerIdle;
-		    delete iLinksSet;
-		    iLinksSet = NULL;
+            iCurrentLink = NULL;
+            iState = EContactHandlerIdle;
+            delete iLinksSet;
+            iLinksSet = NULL;
 
-		    if ( iHandlerObserver )
-		    	{
-		    	iHandlerObserver->OperationCompleteL( EGetAddressesFromPhonebook, iContactObjects );
-		    	iContactObjects.ResetAndDestroy();
-		    	iHandlerObserver = NULL;
-		    	}
-			}
-		}
-	
-	else if ( (iLinkOperationFetch == &aOperation) && (iState == EContactHandlerCallToContactByEmail ) )
-	{	
-		CleanupDeletePushL( aContact );
-	
-		RPointerArray<HBufC> phonenumbers;
-		CleanupResetAndDestroyClosePushL( phonenumbers );
-		GetContactFieldsL( iPhoneNumberFields, phonenumbers, aContact );
-		TInt phoneNumbersAvailable = phonenumbers.Count();
-		CleanupStack::PopAndDestroy( &phonenumbers );
-		
-		if ( phoneNumbersAvailable )
-			{
-			if ( CallQueryL( iLastClsItem->DisplayName() ) )
-				{
-				MakeAiwCallL( iLastClsItem->ContactLink(), KNullDesC );
-				}
-			else
-				{
+            if ( iHandlerObserver )
+                {
+                iHandlerObserver->OperationCompleteL( EGetAddressesFromPhonebook, iContactObjects );
+                iContactObjects.ResetAndDestroy();
+                iHandlerObserver = NULL;
+                }
+            }
+        }
+    
+    else if ( (iLinkOperationFetch == &aOperation) && (iState == EContactHandlerCallToContactByEmail ) )
+    {   
+        CleanupDeletePushL( aContact );
+    
+        RPointerArray<HBufC> phonenumbers;
+        CleanupResetAndDestroyClosePushL( phonenumbers );
+        GetContactFieldsL( iPhoneNumberFields, phonenumbers, aContact );
+        TInt phoneNumbersAvailable = phonenumbers.Count();
+        CleanupStack::PopAndDestroy( &phonenumbers );
+        
+        if ( phoneNumbersAvailable )
+            {
+            if ( CallQueryL( iLastClsItem->DisplayName() ) )
+                {
+                MakeAiwCallL( iLastClsItem->ContactLink(), KNullDesC );
+                }
+            else
+                {
 // user cancelled operation - inform client to enable its actions (i.e. return search priority)
                 ObserverOperationErrorL( EFindAndCallToContactByEmailL, KErrCancel );
-				iState = EContactHandlerIdle;
-				}
-			}
-		else 
-			{
-	        if ( IsRemoteLookupSupported() )
-	            {
-	            RemoteContactQueryL();
-	            }
-	        else
-	            {
-	            TFsEmailUiUtility::ShowErrorNoteL( R_FREESTYLE_EMAIL_UI_VIEWER_NO_PHONE_NUMBER );					
+                iState = EContactHandlerIdle;
+                }
+            }
+        else 
+            {
+            if ( IsRemoteLookupSupported() )
+                {
+                RemoteContactQueryL();
+                }
+            else
+                {
+                TFsEmailUiUtility::ShowErrorNoteL( R_FREESTYLE_EMAIL_UI_VIEWER_NO_PHONE_NUMBER );                   
 //no phone number found - inform client to enable its actions (i.e. return search priority)
                 ObserverOperationErrorL( EFindAndCallToContactByEmailL, KErrNotFound );
-	            }
-			iState = EContactHandlerIdle;
-			}
-		
-		CleanupStack::PopAndDestroy( aContact );
-	}
-	// Addition to get contact for message creation.
-	else if ( (iLinkOperationFetch == &aOperation) && ( iMsgCreationHelperState == EContactHandlerGetSmsAddressFromPhonebook || 
-		    iMsgCreationHelperState == EContactHandlerGetMmsAddressFromPhonebook || iMsgCreationHelperState == EContactHandlerGetVoiceMsgAddressFromPhonebook ) )
-		{
-		if ( iContactForMsgCreation )
-			{
-			delete iContactForMsgCreation;
-			iContactForMsgCreation = NULL;
-			}
-		// Check that we have a contact for message creatiun
-		if ( aContact )
-			{
-			// State is now idle.
-			iState = EContactHandlerIdle;
-			// Store contact
-			iContactForMsgCreation = aContact;
-			// Create clonelink for address selection
-	        MVPbkContactLink* cloneLink = iCurrentLink->CloneLC();  
-	   		CleanupStack::Pop();
-			switch ( iMsgCreationHelperState )
-				{
-				case EContactHandlerGetSmsAddressFromPhonebook:
-					// Select SMS address, sending is done when callback completes
-					GetSmsAddressFromPhonebookAndSendL( cloneLink );
-					break;
-				case EContactHandlerGetMmsAddressFromPhonebook:
-					// Select MMS address, sending is done when callback completes
-					GetMmsAddressFromPhonebookAndSendL( cloneLink, EFalse );	
-					break;
-				case EContactHandlerGetVoiceMsgAddressFromPhonebook:
-					// Select Voice MSG address, sending is done when callback completes
-					GetMmsAddressFromPhonebookAndSendL( cloneLink, ETrue );	
-					break;
-				default:
-					iState = EContactHandlerIdle;
-					iMsgCreationHelperState = EContactHandlerIdle;
-					break;
-				}		
-			}	
-		else
-			{
-			iMsgCreationHelperState = EContactHandlerIdle;
-			iState = EContactHandlerIdle;
-			}
-		}
-	
-	}
+                }
+            iState = EContactHandlerIdle;
+            }
+        
+        CleanupStack::PopAndDestroy( aContact );
+    }
+    // Addition to get contact for message creation.
+    else if ( (iLinkOperationFetch == &aOperation) && ( iMsgCreationHelperState == EContactHandlerGetSmsAddressFromPhonebook || 
+            iMsgCreationHelperState == EContactHandlerGetMmsAddressFromPhonebook || iMsgCreationHelperState == EContactHandlerGetVoiceMsgAddressFromPhonebook ) )
+        {
+        if ( iContactForMsgCreation )
+            {
+            delete iContactForMsgCreation;
+            iContactForMsgCreation = NULL;
+            }
+        // Check that we have a contact for message creatiun
+        if ( aContact )
+            {
+            // State is now idle.
+            iState = EContactHandlerIdle;
+            // Store contact
+            iContactForMsgCreation = aContact;
+            // Create clonelink for address selection
+            MVPbkContactLink* cloneLink = iCurrentLink->CloneLC();  
+            CleanupStack::Pop();
+            switch ( iMsgCreationHelperState )
+                {
+                case EContactHandlerGetSmsAddressFromPhonebook:
+                    // Select SMS address, sending is done when callback completes
+                    GetSmsAddressFromPhonebookAndSendL( cloneLink );
+                    break;
+                case EContactHandlerGetMmsAddressFromPhonebook:
+                    // Select MMS address, sending is done when callback completes
+                    GetMmsAddressFromPhonebookAndSendL( cloneLink, EFalse );    
+                    break;
+                case EContactHandlerGetVoiceMsgAddressFromPhonebook:
+                    // Select Voice MSG address, sending is done when callback completes
+                    GetMmsAddressFromPhonebookAndSendL( cloneLink, ETrue ); 
+                    break;
+                default:
+                    iState = EContactHandlerIdle;
+                    iMsgCreationHelperState = EContactHandlerIdle;
+                    break;
+                }       
+            }   
+        else
+            {
+            iMsgCreationHelperState = EContactHandlerIdle;
+            iState = EContactHandlerIdle;
+            }
+        }
+    
+    }
 
 void CFSEmailUiContactHandler::VPbkSingleContactOperationFailed(
-	    MVPbkContactOperationBase& aOperation, TInt aError )
-	{
+        MVPbkContactOperationBase& aOperation, TInt aError )
+    {
     FUNC_LOG;
-	TRAP_IGNORE( VPbkSingleContactOperationFailedL( aOperation, aError ) );
-	}
+    TRAP_IGNORE( VPbkSingleContactOperationFailedL( aOperation, aError ) );
+    }
 
 void CFSEmailUiContactHandler::VPbkSingleContactOperationFailedL(
-	    MVPbkContactOperationBase& /*aOperation*/, TInt aError )
-	{
+        MVPbkContactOperationBase& /*aOperation*/, TInt aError )
+    {
     FUNC_LOG;
-	iState = EContactHandlerIdle;
-	if ( iHandlerObserver )
-		{
-		iHandlerObserver->OperationErrorL( EFindAndCallToContactByEmailL, aError );
-		iHandlerObserver = NULL;
-		}
-	}
+    iState = EContactHandlerIdle;
+    if ( iHandlerObserver )
+        {
+        iHandlerObserver->OperationErrorL( EFindAndCallToContactByEmailL, aError );
+        iHandlerObserver = NULL;
+        }
+    }
 
 
 void CFSEmailUiContactHandler::OpenComplete()
-	{
+    {
     FUNC_LOG;
-	if ( iStoreReady )
-		{
-		iOpenComplete = ETrue;
-		}
-	}
+    if ( iStoreReady )
+        {
+        iOpenComplete = ETrue;
+        }
+    }
 
 void CFSEmailUiContactHandler::StoreReady(MVPbkContactStore& /*aContactStore*/)
-	{
+    {
     FUNC_LOG;
-	iStoreReady = ETrue;
-	}
+    iStoreReady = ETrue;
+    }
 
 
 void CFSEmailUiContactHandler::StoreUnavailable(MVPbkContactStore& /*aContactStore*/, TInt /*aReason*/)
-	{
+    {
     FUNC_LOG;
-	iStoreReady = EFalse;
-	}
+    iStoreReady = EFalse;
+    }
 
 
 void CFSEmailUiContactHandler::HandleStoreEventL( MVPbkContactStore& /*aContactStore*/, 
-                								  TVPbkContactStoreEvent /*aStoreEvent*/)
-	{
+                                                  TVPbkContactStoreEvent /*aStoreEvent*/)
+    {
     FUNC_LOG;
-	
-	}
+    
+    }
 
 // -----------------------------------------------------------------------------
 // CFSEmailUiContactHandler::HandleNotifyL
 // -----------------------------------------------------------------------------
 TInt CFSEmailUiContactHandler::HandleNotifyL( TInt aCmdId, TInt aEventId,
-	                CAiwGenericParamList& aEventParamList,
-	                const CAiwGenericParamList& /*aInParamList*/)
-	{
+                    CAiwGenericParamList& aEventParamList,
+                    const CAiwGenericParamList& /*aInParamList*/)
+    {
     FUNC_LOG;
-	TInt result = 0;
-	if ( (aCmdId == KAiwCmdAssign) && (iState == EContactHandlerAddToContacts) &&
-		 (aEventId == KAiwEventCompleted) )
-		{
-		// Add to contacts function is completed
-		iState = EContactHandlerIdle;
-		if ( iHandlerObserver )
-			{
-			RPointerArray<CFSEmailUiClsItem> emptyItems;
-			iHandlerObserver->OperationCompleteL( EAddToContactL, emptyItems );
-			emptyItems.Close();
-			iHandlerObserver = NULL;
-			}
-		
-		}
-	else if ( (aCmdId == KAiwCmdSelect) && (iState == EContactHandlerGetAddressesFromPhonebook) &&
-			  (aEventId == KAiwEventCompleted))
-		{
+    TInt result = 0;
+    if ( (aCmdId == KAiwCmdAssign) && (iState == EContactHandlerAddToContacts) &&
+         (aEventId == KAiwEventCompleted) )
+        {
+        // Add to contacts function is completed
+        iState = EContactHandlerIdle;
+        if ( iHandlerObserver )
+            {
+            RPointerArray<CFSEmailUiClsItem> emptyItems;
+            iHandlerObserver->OperationCompleteL( EAddToContactL, emptyItems );
+            emptyItems.Close();
+            iHandlerObserver = NULL;
+            }
+        
+        }
+    else if ( (aCmdId == KAiwCmdSelect) && (iState == EContactHandlerGetAddressesFromPhonebook) &&
+              (aEventId == KAiwEventCompleted))
+        {
 
-		TInt index = 0;
-		const TAiwGenericParam* param =
-		aEventParamList.FindFirst(index, EGenericParamContactLinkArray);
-		if (param)
-			{
-			TPtrC8 contactLinks = param->Value().AsData();
+        TInt index = 0;
+        const TAiwGenericParam* param =
+        aEventParamList.FindFirst(index, EGenericParamContactLinkArray);
+        if (param)
+            {
+            TPtrC8 contactLinks = param->Value().AsData();
 
-			iLinksSet = iContactManager->CreateLinksLC(contactLinks);
-			CleanupStack::Pop();
-			if ( iLinksSet->Count() )
-				{
-				iCurrentLink = &iLinksSet->At(0);
-				//Async operation, callback VPbkSingleContactOperationCompleteL
-				//Error situations: VPbkSingleContactOperationFailed
-				iLinkOperationFetch = iContactManager->RetrieveContactL( iLinksSet->At(0), *this );
-				}
+            iLinksSet = iContactManager->CreateLinksLC(contactLinks);
+            CleanupStack::Pop();
+            if ( iLinksSet->Count() )
+                {
+                iCurrentLink = &iLinksSet->At(0);
+                //Async operation, callback VPbkSingleContactOperationCompleteL
+                //Error situations: VPbkSingleContactOperationFailed
+                iLinkOperationFetch = iContactManager->RetrieveContactL( iLinksSet->At(0), *this );
+                }
 
-			iContactManager->ContactStoresL().OpenAllL( *this );
-			}
+            iContactManager->ContactStoresL().OpenAllL( *this );
+            }
 
-		}
-	else if ( (aCmdId == KAiwCmdSelect) && (iState == EContactHandlerGetSmsAddressFromPhonebook) &&
-			  (aEventId == KAiwEventCompleted))
-		{
-		iState = EContactHandlerIdle;
-		SendMessageL( aEventParamList,  EContactHandlerGetSmsAddressFromPhonebook );
-		}
-	else if ( (aCmdId == KAiwCmdSelect) && (iState == EContactHandlerGetMmsAddressFromPhonebook) &&
-			  (aEventId == KAiwEventCompleted))
-		{
-		iState = EContactHandlerIdle;
-		// Send SMS to contact address
-		SendMessageL( aEventParamList,  EContactHandlerGetMmsAddressFromPhonebook );
-		}
-	else if ( (aCmdId == KAiwCmdSelect) && (iState == EContactHandlerGetVoiceMsgAddressFromPhonebook) &&
-			  (aEventId == KAiwEventCompleted))
-		{
-		iState = EContactHandlerIdle;
-		// Send Voice MSG to contact address
-		SendMessageL( aEventParamList,  EContactHandlerGetVoiceMsgAddressFromPhonebook );
-		}
-	
-	//Notify caller of the error
-	else if ( aEventId == KAiwEventError )
-		{
-		iState = EContactHandlerIdle;
-		if ( iHandlerObserver )
-			{
-			iHandlerObserver->OperationErrorL( CurrentCommand(), KErrGeneral );
-			iHandlerObserver = NULL;
-			}
-		}
+        }
+    else if ( (aCmdId == KAiwCmdSelect) && (iState == EContactHandlerGetSmsAddressFromPhonebook) &&
+              (aEventId == KAiwEventCompleted))
+        {
+        iState = EContactHandlerIdle;
+        SendMessageL( aEventParamList,  EContactHandlerGetSmsAddressFromPhonebook );
+        }
+    else if ( (aCmdId == KAiwCmdSelect) && (iState == EContactHandlerGetMmsAddressFromPhonebook) &&
+              (aEventId == KAiwEventCompleted))
+        {
+        iState = EContactHandlerIdle;
+        // Send SMS to contact address
+        SendMessageL( aEventParamList,  EContactHandlerGetMmsAddressFromPhonebook );
+        }
+    else if ( (aCmdId == KAiwCmdSelect) && (iState == EContactHandlerGetVoiceMsgAddressFromPhonebook) &&
+              (aEventId == KAiwEventCompleted))
+        {
+        iState = EContactHandlerIdle;
+        // Send Voice MSG to contact address
+        SendMessageL( aEventParamList,  EContactHandlerGetVoiceMsgAddressFromPhonebook );
+        }
+    
+    //Notify caller of the error
+    else if ( aEventId == KAiwEventError )
+        {
+        iState = EContactHandlerIdle;
+        if ( iHandlerObserver )
+            {
+            iHandlerObserver->OperationErrorL( CurrentCommand(), KErrGeneral );
+            iHandlerObserver = NULL;
+            }
+        }
 
-	// We don't need to check outParams, or do anything special during the exit
-	else if ( (aEventId == KAiwEventQueryExit) )
-		{
-		result = ETrue;
-		}
-	
-	else if ( aEventId == KAiwEventOutParamCheck )
-		{
-		result = 1;
-		}
-	else if ( aEventId == KAiwEventCanceled )
-		{
-		iState = EContactHandlerIdle;
-		if ( iHandlerObserver )
-			{
-			RPointerArray<CFSEmailUiClsItem> emptyItems;
-			iHandlerObserver->OperationCompleteL( CurrentCommand(), emptyItems );
-			emptyItems.Close();
-			iHandlerObserver = NULL;
-			}
-		}
+    // We don't need to check outParams, or do anything special during the exit
+    else if ( (aEventId == KAiwEventQueryExit) )
+        {
+        result = ETrue;
+        }
+    
+    else if ( aEventId == KAiwEventOutParamCheck )
+        {
+        result = 1;
+        }
+    else if ( aEventId == KAiwEventCanceled )
+        {
+        iState = EContactHandlerIdle;
+        if ( iHandlerObserver )
+            {
+            RPointerArray<CFSEmailUiClsItem> emptyItems;
+            iHandlerObserver->OperationCompleteL( CurrentCommand(), emptyItems );
+            emptyItems.Close();
+            iHandlerObserver = NULL;
+            }
+        }
 
     return result;
     }
 
 
 CFSEmailUiContactHandler::CFSEmailUiContactHandler( RFs& aSession ): 
-	iState(EContactHandlerIdle),
+    iState(EContactHandlerIdle),
     iHandlerObserver(NULL),
-	iOpenComplete(EFalse),
-	iStoreReady(EFalse),
-	iUseSenderText(EFalse),
-	iFs( aSession ),
-	iCachingInProgressError(EFalse),
+    iOpenComplete(EFalse),
+    iStoreReady(EFalse),
+    iUseSenderText(EFalse),
+    iFs( aSession ),
+    iCachingInProgressError(EFalse),
     // <cmail> video call
     iVideoCall( EFalse )
     // </cmail>
@@ -1092,13 +1100,13 @@
             }
         else
             {
-            TFsEmailUiUtility::ShowErrorNoteL( R_FREESTYLE_EMAIL_UI_VIEWER_NO_PHONE_NUMBER );					
+            TFsEmailUiUtility::ShowErrorNoteL( R_FREESTYLE_EMAIL_UI_VIEWER_NO_PHONE_NUMBER );                   
             }
         // <cmail> video call flag needs to be cleared
         iVideoCall = EFalse;
         // </cmail>
         iState = EContactHandlerIdle;
-        }				
+        }               
     else if ( aMatchingItems.Count() > 0 ) // Call to one directly
         {
         // Create contact item in which to copy number or address, async operation.
@@ -1108,26 +1116,26 @@
         iCurrentLink = aMatchingItems[0]->ContactLink()->CloneLC();
         CleanupStack::Pop();
         if ( iLinkOperationFetch )
-        	{
-        	delete iLinkOperationFetch;
-        	iLinkOperationFetch = NULL;
-        	}
+            {
+            delete iLinkOperationFetch;
+            iLinkOperationFetch = NULL;
+            }
         
         //Async operation, callback VPbkSingleContactOperationCompleteL
         //Error situations: VPbkSingleContactOperationFailed
         iLinkOperationFetch = iContactManager->RetrieveContactL
-        (*iCurrentLink, *this);	
+        (*iCurrentLink, *this); 
         
         }
     }
 
 void CFSEmailUiContactHandler::CreateMessageL( const RPointerArray<CFSEmailUiClsItem>& aMatchingItems )
-	{
+    {
     FUNC_LOG;
-	iState = EContactHandlerIdle;
-	
-	if ( aMatchingItems.Count() == 0 )
-		{
+    iState = EContactHandlerIdle;
+    
+    if ( aMatchingItems.Count() == 0 )
+        {
         // <cmail>
         /*if ( IsRemoteLookupSupported() )
             {
@@ -1147,179 +1155,179 @@
         // no Text message available - subset of Multimedia and Voice message is displayed
         TFsEmailUiUtility::ShowCreateMessageQueryL( *iPreviousEmailAddress, ETrue );
         // </cmail>
-		iState = EContactHandlerIdle;
-		}
-	else if ( aMatchingItems.Count() > 0 ) 
-		{
-		CSendUi* sendUi = CSendUi::NewLC();
+        iState = EContactHandlerIdle;
+        }
+    else if ( aMatchingItems.Count() > 0 ) 
+        {
+        CSendUi* sendUi = CSendUi::NewLC();
 
-		CArrayFix<TUid>* showedServicesUidArray = new( ELeave ) CArrayFixFlat<TUid>(4);
-		CleanupStack::PushL( showedServicesUidArray );
+        CArrayFix<TUid>* showedServicesUidArray = new( ELeave ) CArrayFixFlat<TUid>(4);
+        CleanupStack::PushL( showedServicesUidArray );
 
-		CDesCArrayFlat* array = new ( ELeave ) CDesCArrayFlat( 2 );
-		CleanupStack::PushL( array );
+        CDesCArrayFlat* array = new ( ELeave ) CDesCArrayFlat( 2 );
+        CleanupStack::PushL( array );
 
-		TSendingCapabilities noCapabilities(0,0,0);
-		
-		if( sendUi->ValidateServiceL( KSenduiMtmSmsUid, noCapabilities ) )
-			{
-			HBufC* textMessage = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_TEXT_MESSAGE );
-		    array->AppendL( *textMessage );
-			CleanupStack::PopAndDestroy( textMessage );				
-			showedServicesUidArray->AppendL( KSenduiMtmSmsUid );
-			}
-		if( sendUi->ValidateServiceL( KSenduiMtmMmsUid, noCapabilities ) )
-			{
-			HBufC* multimediaMessage = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_MULTIMEDIA_MESSAGE );
-		    array->AppendL( *multimediaMessage );
-			CleanupStack::PopAndDestroy( multimediaMessage );				
-			showedServicesUidArray->AppendL( KSenduiMtmMmsUid );
-			}
-		if( sendUi->ValidateServiceL( KSenduiMtmAudioMessageUid, noCapabilities ) )
-			{
-			HBufC* voiceMessage = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_VOICE_MESSAGE );
-		    array->AppendL( *voiceMessage );
-			CleanupStack::PopAndDestroy( voiceMessage );				
-			showedServicesUidArray->AppendL( KSenduiMtmAudioMessageUid );
-			}
+        TSendingCapabilities noCapabilities(0,0,0);
+        
+        if( sendUi->ValidateServiceL( KSenduiMtmSmsUid, noCapabilities ) )
+            {
+            HBufC* textMessage = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_TEXT_MESSAGE );
+            array->AppendL( *textMessage );
+            CleanupStack::PopAndDestroy( textMessage );             
+            showedServicesUidArray->AppendL( KSenduiMtmSmsUid );
+            }
+        if( sendUi->ValidateServiceL( KSenduiMtmMmsUid, noCapabilities ) )
+            {
+            HBufC* multimediaMessage = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_MULTIMEDIA_MESSAGE );
+            array->AppendL( *multimediaMessage );
+            CleanupStack::PopAndDestroy( multimediaMessage );               
+            showedServicesUidArray->AppendL( KSenduiMtmMmsUid );
+            }
+        if( sendUi->ValidateServiceL( KSenduiMtmAudioMessageUid, noCapabilities ) )
+            {
+            HBufC* voiceMessage = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_VOICE_MESSAGE );
+            array->AppendL( *voiceMessage );
+            CleanupStack::PopAndDestroy( voiceMessage );                
+            showedServicesUidArray->AppendL( KSenduiMtmAudioMessageUid );
+            }
 
-		TInt selectedOption;
-		CAknListQueryDialog* dlg = new ( ELeave ) CAknListQueryDialog( &selectedOption );
-		dlg->PrepareLC( R_MAIL_VIEWER_CREATE_MESSAGE_DIALOG  );
-					
-		dlg->SetItemTextArray( array );
-		dlg->SetOwnershipType( ELbmDoesNotOwnItemArray );	
-		TInt ret = dlg->RunLD();
-		CleanupStack::PopAndDestroy( array );
-		CleanupStack::PopAndDestroy( showedServicesUidArray );
-		CleanupStack::PopAndDestroy( sendUi );		
-	
-		// Continue sending process if query is not cancelled
-		if( ret )
-			{
-			switch ( selectedOption )
-				{
-				case 0:
-					// Select SMS address, sending is done when callback completes
-					iMsgCreationHelperState = EContactHandlerGetSmsAddressFromPhonebook;	
-					break;
-				case 1:
-					// Select MMS address, sending is done when callback completes
-					iMsgCreationHelperState = EContactHandlerGetMmsAddressFromPhonebook;	
-					break;
-				case 2:
-					// Select Voice MSG address, sending is done when callback completes
-					iMsgCreationHelperState = EContactHandlerGetVoiceMsgAddressFromPhonebook;	
-					break;
-				default:
-					iMsgCreationHelperState = EContactHandlerIdle;
-					break;
-				}
-			// Create contact item in which to copy number or address, async operation.
-			delete iCurrentLink;
-			iCurrentLink = NULL;
-			
-			iCurrentLink = aMatchingItems[0]->ContactLink()->CloneLC();
-			CleanupStack::Pop();
-			if ( iLinkOperationFetch )
-				{
-				delete iLinkOperationFetch;
-				iLinkOperationFetch = NULL;
-				}
-			
-			//Async operation, callback VPbkSingleContactOperationCompleteL
-			//Error situations: VPbkSingleContactOperationFailed
-			iLinkOperationFetch = iContactManager->RetrieveContactL
-			(*iCurrentLink, *this);											
-			}
-		}
-	}
+        TInt selectedOption;
+        CAknListQueryDialog* dlg = new ( ELeave ) CAknListQueryDialog( &selectedOption );
+        dlg->PrepareLC( R_MAIL_VIEWER_CREATE_MESSAGE_DIALOG  );
+                    
+        dlg->SetItemTextArray( array );
+        dlg->SetOwnershipType( ELbmDoesNotOwnItemArray );   
+        TInt ret = dlg->RunLD();
+        CleanupStack::PopAndDestroy( array );
+        CleanupStack::PopAndDestroy( showedServicesUidArray );
+        CleanupStack::PopAndDestroy( sendUi );      
+    
+        // Continue sending process if query is not cancelled
+        if( ret )
+            {
+            switch ( selectedOption )
+                {
+                case 0:
+                    // Select SMS address, sending is done when callback completes
+                    iMsgCreationHelperState = EContactHandlerGetSmsAddressFromPhonebook;    
+                    break;
+                case 1:
+                    // Select MMS address, sending is done when callback completes
+                    iMsgCreationHelperState = EContactHandlerGetMmsAddressFromPhonebook;    
+                    break;
+                case 2:
+                    // Select Voice MSG address, sending is done when callback completes
+                    iMsgCreationHelperState = EContactHandlerGetVoiceMsgAddressFromPhonebook;   
+                    break;
+                default:
+                    iMsgCreationHelperState = EContactHandlerIdle;
+                    break;
+                }
+            // Create contact item in which to copy number or address, async operation.
+            delete iCurrentLink;
+            iCurrentLink = NULL;
+            
+            iCurrentLink = aMatchingItems[0]->ContactLink()->CloneLC();
+            CleanupStack::Pop();
+            if ( iLinkOperationFetch )
+                {
+                delete iLinkOperationFetch;
+                iLinkOperationFetch = NULL;
+                }
+            
+            //Async operation, callback VPbkSingleContactOperationCompleteL
+            //Error situations: VPbkSingleContactOperationFailed
+            iLinkOperationFetch = iContactManager->RetrieveContactL
+            (*iCurrentLink, *this);                                         
+            }
+        }
+    }
 
 // -----------------------------------------------------------------------------
 // CFSEmailUiContactHandler::SendMessageL
 // -----------------------------------------------------------------------------
 void CFSEmailUiContactHandler::SendMessageL( CAiwGenericParamList& aEventParamList, TInt aServiceType )
-	{
+    {
     FUNC_LOG;
-	TInt paramIndex(0);
-	iState = EContactHandlerIdle;
+    TInt paramIndex(0);
+    iState = EContactHandlerIdle;
 
-	const TAiwGenericParam* param = 
+    const TAiwGenericParam* param = 
             aEventParamList.FindFirst( paramIndex, EGenericParamContactLinkArray );
     if ( param )
         {
         TPtrC8 packedLinks = param->Value().AsData();
         if ( packedLinks.Length() > 0 )
             {      
-	     	CSendUi* sendUi = CSendUi::NewLC();
-    		CMessageData* messageData = CMessageData::NewLC();		 
+            CSendUi* sendUi = CSendUi::NewLC();
+            CMessageData* messageData = CMessageData::NewLC();       
             MVPbkContactLinkArray* linkArray = GetContactManager()->CreateLinksLC(packedLinks);
             MVPbkStoreContactField* field = iContactForMsgCreation->Fields().RetrieveField(linkArray->At(0));
             MVPbkContactFieldData& data = field->FieldData();
             if (data.DataType() == EVPbkFieldStorageTypeText)
                 {
-                const TDesC& dataText = MVPbkContactFieldTextData::Cast(data).Text();			
-		     	// Get contact alias to message data if there is name data
+                const TDesC& dataText = MVPbkContactFieldTextData::Cast(data).Text();           
+                // Get contact alias to message data if there is name data
                 //RFs& rFs = CEikonEnv::Static()->FsSession();
-		        //User::LeaveIfError(rFs.Connect());    
-			    CPbk2SortOrderManager* sortOrderManager = 
-			    		CPbk2SortOrderManager::NewL(iContactManager->FieldTypes(), &iFs);
-			    MPbk2ContactNameFormatter* nameFormatter = 
-			    		Pbk2ContactNameFormatterFactory::CreateL(iContactManager->FieldTypes(), *sortOrderManager, &iFs);		     
-		     	HBufC* nameBuffer = nameFormatter->GetContactTitleL( iContactForMsgCreation->Fields(), 0);
-		     	
-		     	delete sortOrderManager;
-		     	sortOrderManager = NULL;
-		     	delete nameFormatter;     
-		     	nameFormatter = NULL;
-		        
-		     	//rFs.Close();
-		        if ( nameBuffer )
-		            {
-		            CleanupStack::PushL( nameBuffer );
-		            messageData->AppendToAddressL( dataText, *nameBuffer );
-		            CleanupStack::PopAndDestroy( nameBuffer );
-		            }
-		        else
-		            {
-					messageData->AppendToAddressL( dataText );	
-		            }	
-		        // Send selected message							
-				TSendingCapabilities noCapabilities(0,0,0);
-				switch ( aServiceType )
-					{				
-					case EContactHandlerGetSmsAddressFromPhonebook:
-						{
-						if( sendUi->ValidateServiceL( KSenduiMtmSmsUid, noCapabilities ) )
-							{
-							sendUi->CreateAndSendMessageL( KSenduiMtmSmsUid, messageData, KNullUid, EFalse );							
-							}
-						}					
-						break;
-					case EContactHandlerGetMmsAddressFromPhonebook:
-						{
-						if( sendUi->ValidateServiceL( KSenduiMtmMmsUid, noCapabilities ) )
-							{
-							sendUi->CreateAndSendMessageL( KSenduiMtmMmsUid, messageData, KNullUid, EFalse );							
-							}
-						}
-						break;
-					case EContactHandlerGetVoiceMsgAddressFromPhonebook:
-						{
-						if( sendUi->ValidateServiceL( KSenduiMtmAudioMessageUid, noCapabilities ) )
-							{
-							sendUi->CreateAndSendMessageL( KSenduiMtmAudioMessageUid, messageData, KNullUid, EFalse );							
-							}
-						}
-		 				break;
-					default:
-						break;			
-					}
-                }	
+                //User::LeaveIfError(rFs.Connect());    
+                CPbk2SortOrderManager* sortOrderManager = 
+                        CPbk2SortOrderManager::NewL(iContactManager->FieldTypes(), &iFs);
+                MPbk2ContactNameFormatter* nameFormatter = 
+                        Pbk2ContactNameFormatterFactory::CreateL(iContactManager->FieldTypes(), *sortOrderManager, &iFs);            
+                HBufC* nameBuffer = nameFormatter->GetContactTitleL( iContactForMsgCreation->Fields(), 0);
+                
+                delete sortOrderManager;
+                sortOrderManager = NULL;
+                delete nameFormatter;     
+                nameFormatter = NULL;
+                
+                //rFs.Close();
+                if ( nameBuffer )
+                    {
+                    CleanupStack::PushL( nameBuffer );
+                    messageData->AppendToAddressL( dataText, *nameBuffer );
+                    CleanupStack::PopAndDestroy( nameBuffer );
+                    }
+                else
+                    {
+                    messageData->AppendToAddressL( dataText );  
+                    }   
+                // Send selected message                            
+                TSendingCapabilities noCapabilities(0,0,0);
+                switch ( aServiceType )
+                    {               
+                    case EContactHandlerGetSmsAddressFromPhonebook:
+                        {
+                        if( sendUi->ValidateServiceL( KSenduiMtmSmsUid, noCapabilities ) )
+                            {
+                            sendUi->CreateAndSendMessageL( KSenduiMtmSmsUid, messageData, KNullUid, EFalse );                           
+                            }
+                        }                   
+                        break;
+                    case EContactHandlerGetMmsAddressFromPhonebook:
+                        {
+                        if( sendUi->ValidateServiceL( KSenduiMtmMmsUid, noCapabilities ) )
+                            {
+                            sendUi->CreateAndSendMessageL( KSenduiMtmMmsUid, messageData, KNullUid, EFalse );                           
+                            }
+                        }
+                        break;
+                    case EContactHandlerGetVoiceMsgAddressFromPhonebook:
+                        {
+                        if( sendUi->ValidateServiceL( KSenduiMtmAudioMessageUid, noCapabilities ) )
+                            {
+                            sendUi->CreateAndSendMessageL( KSenduiMtmAudioMessageUid, messageData, KNullUid, EFalse );                          
+                            }
+                        }
+                        break;
+                    default:
+                        break;          
+                    }
+                }   
             CleanupStack::PopAndDestroy( 3 ); // Sendui, messageData and linkArray.
             }
         }
-	}
+    }
 // ---------------------------------------------------------------------------
 // CFSEmailUiContactHandler::IsRemoteLookupSupported
 // ---------------------------------------------------------------------------
@@ -1335,33 +1343,33 @@
 
 void CFSEmailUiContactHandler::GetContactFieldsL( RArray<TInt>& aFieldIds,
     RPointerArray<HBufC>& aNumbers, MVPbkStoreContact* aContact)
-	{
+    {
     FUNC_LOG;
-	for (TInt i = 0; i < aFieldIds.Count(); i++ )
-		{
-		const MVPbkFieldType*  myContactDataField = 
-		iContactManager->FieldTypes().Find( aFieldIds[i] );
+    for (TInt i = 0; i < aFieldIds.Count(); i++ )
+        {
+        const MVPbkFieldType*  myContactDataField = 
+        iContactManager->FieldTypes().Find( aFieldIds[i] );
 
-		CVPbkBaseContactFieldTypeIterator* itrNumber = 
-		CVPbkBaseContactFieldTypeIterator::NewLC( *myContactDataField, 
-				aContact->Fields() );	
+        CVPbkBaseContactFieldTypeIterator* itrNumber = 
+        CVPbkBaseContactFieldTypeIterator::NewLC( *myContactDataField, 
+                aContact->Fields() );   
 
-		// Iterate through each of the data fields
-		while ( itrNumber->HasNext() )
-			{
-			const MVPbkBaseContactField* field = itrNumber->Next();
+        // Iterate through each of the data fields
+        while ( itrNumber->HasNext() )
+            {
+            const MVPbkBaseContactField* field = itrNumber->Next();
 
-			if ( (field->FieldData()).DataType() == EVPbkFieldStorageTypeText )
-				{
-				HBufC* toAppend = MVPbkContactFieldTextData::Cast(
-						field->FieldData() ).Text().AllocL();
-				
-				aNumbers.Append( toAppend );					
-				}
-			}
-		CleanupStack::PopAndDestroy( itrNumber ); 
-		}
-	}
+            if ( (field->FieldData()).DataType() == EVPbkFieldStorageTypeText )
+                {
+                HBufC* toAppend = MVPbkContactFieldTextData::Cast(
+                        field->FieldData() ).Text().AllocL();
+                
+                aNumbers.Append( toAppend );                    
+                }
+            }
+        CleanupStack::PopAndDestroy( itrNumber ); 
+        }
+    }
 
 // ---------------------------------------------------------------------------
 // Activates phonebook view to show details of give contact
@@ -1375,23 +1383,33 @@
         aMatchingItems[0]->ContactLink() )
         {
         MVPbkContactLink* contact = aMatchingItems[0]->ContactLink();
-        CPbk2ViewState* pbk2ViewParam = CPbk2ViewState::NewLC();
-        pbk2ViewParam->SetFocusedContact( contact->CloneLC() );
-        CleanupStack::Pop(); // Cloned contact
-        pbk2ViewParam->SetFocusedFieldIndex( 3 );
-        HBufC8* paramBuf = pbk2ViewParam->PackLC();
+        HBufC8* packed = contact->PackLC();
+
+        HBufC16* link16 = HBufC16::NewLC(packed->Length());
+        link16->Des().Copy(packed->Des());
+
+        MCCAParameter*  param = TCCAFactory::NewParameterL();
+        CleanupClosePushL( *param );
+        
+        delete iConnection;
+        iConnection = NULL;
+        iConnection = TCCAFactory::NewConnectionL();
 
-        // Make view id with Phonebook2's app UID3 and Contact Info View's id
-        const TVwsViewId viewId( TUid::Uid(0x101f4cce),
-            TUid::Uid(EPbk2ContactInfoViewId) );
+        // Setting up the contact link parameter, ownership transfers
+        param->SetConnectionFlag(MCCAParameter::ENormal);
+        param->SetContactDataFlag(MCCAParameter::EContactLink);
+        param->SetContactDataL( link16->Des() );
 
-        // Activate the view
-        CEikonEnv::Static()->AppUi()->ActivateViewL( viewId,
-            CPbk2ViewState::Uid(), *paramBuf );
+        // switch to details view
+        const TUid uid = TUid::Uid( 0x200159E7 ); 
+        param->SetLaunchedViewUid( uid);
 
-        // Cleanup
-        CleanupStack::PopAndDestroy( paramBuf );
-        CleanupStack::PopAndDestroy( pbk2ViewParam );
+        // Launching the  CCA application
+        iConnection->LaunchAppL( *param, this );
+
+        CleanupStack::Pop( param );  // parameter is taken care by MCCAConnection
+        CleanupStack::PopAndDestroy( link16 );
+        CleanupStack::PopAndDestroy( packed );
         }
     else
         {
@@ -1420,32 +1438,32 @@
     }
 
 void CFSEmailUiContactHandler::FormatFieldIds()
-	{
+    {
     FUNC_LOG;
-	iEmailFields.Append( R_VPBK_FIELD_TYPE_EMAILGEN );
-	iEmailFields.Append( R_VPBK_FIELD_TYPE_EMAILWORK );
-	iEmailFields.Append( R_VPBK_FIELD_TYPE_EMAILHOME );
-	
-	iFirstnameFields.Append( R_VPBK_FIELD_TYPE_FIRSTNAME );
-	iLastnameFields.Append( R_VPBK_FIELD_TYPE_LASTNAME );
-	
-	iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_LANDPHONEHOME );
-	iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_MOBILEPHONEWORK );
-	iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_MOBILEPHONEHOME );
-	iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_LANDPHONEWORK );
-	iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_LANDPHONEGEN );
-	iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_MOBILEPHONEGEN );
-	
-	}
+    iEmailFields.Append( R_VPBK_FIELD_TYPE_EMAILGEN );
+    iEmailFields.Append( R_VPBK_FIELD_TYPE_EMAILWORK );
+    iEmailFields.Append( R_VPBK_FIELD_TYPE_EMAILHOME );
+    
+    iFirstnameFields.Append( R_VPBK_FIELD_TYPE_FIRSTNAME );
+    iLastnameFields.Append( R_VPBK_FIELD_TYPE_LASTNAME );
+    
+    iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_LANDPHONEHOME );
+    iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_MOBILEPHONEWORK );
+    iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_MOBILEPHONEHOME );
+    iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_LANDPHONEWORK );
+    iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_LANDPHONEGEN );
+    iPhoneNumberFields.Append( R_VPBK_FIELD_TYPE_MOBILEPHONEGEN );
+    
+    }
 
 void CFSEmailUiContactHandler::ResetFieldIds()
-	{
+    {
     FUNC_LOG;
-	iLastnameFields.Reset();
-	iFirstnameFields.Reset();
-	iEmailFields.Reset();
-	iPhoneNumberFields.Reset();
-	}
+    iLastnameFields.Reset();
+    iFirstnameFields.Reset();
+    iEmailFields.Reset();
+    iPhoneNumberFields.Reset();
+    }
 
 
 // -----------------------------------------------------------------------------
@@ -1453,98 +1471,98 @@
 // -----------------------------------------------------------------------------
 TBool CFSEmailUiContactHandler::GetNameAndEmailFromRemoteLookupL( CFSMailBox& aMailBox,
     const TDesC& aQueryString, TDes& aDisplayname, TDes& aEmailAddress )
-	{
+    {
     FUNC_LOG;
 
-	CPbkxRemoteContactLookupServiceUiContext::TResult result;
-	DoRemoteLookupL( aMailBox, aQueryString, result, 
-			         CPbkxRemoteContactLookupServiceUiContext::EModeContactSelector);
+    CPbkxRemoteContactLookupServiceUiContext::TResult result;
+    DoRemoteLookupL( aMailBox, aQueryString, result, 
+                     CPbkxRemoteContactLookupServiceUiContext::EModeContactSelector);
 
-	if ( result.iExitReason == 
-		 CPbkxRemoteContactLookupServiceUiContext::TResult::EExitContactSelected )
-		{
-		GetNameAndEmail( aDisplayname, aEmailAddress, *(result.iSelectedContactItem) );
-		return ETrue;
-		} 
+    if ( result.iExitReason == 
+         CPbkxRemoteContactLookupServiceUiContext::TResult::EExitContactSelected )
+        {
+        GetNameAndEmail( aDisplayname, aEmailAddress, *(result.iSelectedContactItem) );
+        return ETrue;
+        } 
 
-	return EFalse;
-	}
+    return EFalse;
+    }
 
 // -----------------------------------------------------------------------------
 // CFSEmailUiContactHandler::LaunchRemoteLookupL
 // -----------------------------------------------------------------------------
 void CFSEmailUiContactHandler::LaunchRemoteLookupL( CFSMailBox& aMailBox )
-	{
+    {
     FUNC_LOG;
 
-	CPbkxRemoteContactLookupServiceUiContext::TResult result;
-	DoRemoteLookupL( aMailBox, KNullDesC , result, 
-				     CPbkxRemoteContactLookupServiceUiContext::EModeNormal );
+    CPbkxRemoteContactLookupServiceUiContext::TResult result;
+    DoRemoteLookupL( aMailBox, KNullDesC , result, 
+                     CPbkxRemoteContactLookupServiceUiContext::EModeNormal );
 
-	}
+    }
 
 // -----------------------------------------------------------------------------
 // CFSEmailUiContactHandler::LaunchRemoteLookupL
 // -----------------------------------------------------------------------------
 HBufC* CFSEmailUiContactHandler::GetNameAndNumberFromRemoteLookupL( CFSMailBox& aMailBox, const TDesC& aQuery, 
-													  RBuf& aPhoneNumber )
-	{
+                                                      RBuf& aPhoneNumber )
+    {
     FUNC_LOG;
 
-	CPbkxRemoteContactLookupServiceUiContext::TResult result;
-	DoRemoteLookupL( aMailBox, aQuery , result, 
-				     CPbkxRemoteContactLookupServiceUiContext::EModeContactSelector );
+    CPbkxRemoteContactLookupServiceUiContext::TResult result;
+    DoRemoteLookupL( aMailBox, aQuery , result, 
+                     CPbkxRemoteContactLookupServiceUiContext::EModeContactSelector );
 
-	HBufC* displayName = NULL;
-	
-	if ( result.iExitReason == 
-	CPbkxRemoteContactLookupServiceUiContext::TResult::EExitContactSelected )
-		{
-		displayName = GetPhoneNumberAndNameL( aPhoneNumber, *(result.iSelectedContactItem) );
-		} 
-	return displayName;
-	}
+    HBufC* displayName = NULL;
+    
+    if ( result.iExitReason == 
+    CPbkxRemoteContactLookupServiceUiContext::TResult::EExitContactSelected )
+        {
+        displayName = GetPhoneNumberAndNameL( aPhoneNumber, *(result.iSelectedContactItem) );
+        } 
+    return displayName;
+    }
 
 void CFSEmailUiContactHandler::LaunchRemoteLookupWithQueryL( CFSMailBox& aMailBox, const TDesC& aQuery )
-	{
+    {
     FUNC_LOG;
 
-	CPbkxRemoteContactLookupServiceUiContext::TResult result;
-	DoRemoteLookupL( aMailBox, aQuery , result, 
-					     CPbkxRemoteContactLookupServiceUiContext::EModeExistingCriteria );
+    CPbkxRemoteContactLookupServiceUiContext::TResult result;
+    DoRemoteLookupL( aMailBox, aQuery , result, 
+                         CPbkxRemoteContactLookupServiceUiContext::EModeExistingCriteria );
 
-	}
+    }
 
 HBufC* CFSEmailUiContactHandler::GetLastSearchNameL( const TDesC& aEmailAddress )
-	{
+    {
     FUNC_LOG;
-	HBufC* name(NULL);
-	if ( iSearchMatch )
-		{
-		if ( !iSearchMatch->EmailAddress().CompareF( aEmailAddress ) )
-			{
-			if ( iSearchMatch->DisplayName() != KNullDesC )
-				{
-				name = iSearchMatch->DisplayName().AllocL();
-				}
-			}
-		}
-	return name;
-	}
+    HBufC* name(NULL);
+    if ( iSearchMatch )
+        {
+        if ( !iSearchMatch->EmailAddress().CompareF( aEmailAddress ) )
+            {
+            if ( iSearchMatch->DisplayName() != KNullDesC )
+                {
+                name = iSearchMatch->DisplayName().AllocL();
+                }
+            }
+        }
+    return name;
+    }
 
 void CFSEmailUiContactHandler::Reset()
-	{
+    {
     FUNC_LOG;
-	iContactObjects.ResetAndDestroy();
-	iState = EContactHandlerIdle;
-	delete iLinksSet;
-	iLinksSet = NULL;
-	delete iLinkOperation;
-	iLinkOperation = NULL;
-	delete iLinkOperationFetch;
-	iLinkOperationFetch = NULL;
-	iHandlerObserver = NULL;
-	}
+    iContactObjects.ResetAndDestroy();
+    iState = EContactHandlerIdle;
+    delete iLinksSet;
+    iLinksSet = NULL;
+    delete iLinkOperation;
+    iLinkOperation = NULL;
+    delete iLinkOperationFetch;
+    iLinkOperationFetch = NULL;
+    iHandlerObserver = NULL;
+    }
 
 
 // ---------------------------------------------------------------------------
@@ -1553,131 +1571,131 @@
 //
 void CFSEmailUiContactHandler::GetNameAndEmail( TDes& aName, TDes& aEmail,
     CContactItem& aItem ) const
-	{
+    {
     FUNC_LOG;
-	CContactItemFieldSet& fieldSet = aItem.CardFields();
-	aName.Zero();
+    CContactItemFieldSet& fieldSet = aItem.CardFields();
+    aName.Zero();
 
-	RBuf familyName;
-	RBuf givenName;
-	TInt pos;
+    RBuf familyName;
+    RBuf givenName;
+    TInt pos;
 
-	pos = fieldSet.Find(KUidContactFieldFamilyName);
-	if (pos >= 0)
-		{
-		CContactItemField& itemField=fieldSet[pos];
-		if (!(itemField.IsHidden()) && !(itemField.IsDisabled()))
-			{
-			CContactTextField* textField = itemField.TextStorage();
-			familyName.Create( textField->Text() );
-			}				
-		}
-	pos = fieldSet.Find(KUidContactFieldGivenName);
-	if (pos >= 0)
-		{
-		CContactItemField& itemField=fieldSet[pos];
-		if (!(itemField.IsHidden()) && !(itemField.IsDisabled()))
-			{
-			CContactTextField* textField = itemField.TextStorage();
-			givenName.Create( textField->Text() );
-			}				
-		}	
-	RBuf email;
-	pos = fieldSet.Find(KUidContactFieldEMail);
-	if (pos >= 0)
-		{
-		CContactItemField& itemField=fieldSet[pos];
-		if (!(itemField.IsHidden()) && !(itemField.IsDisabled()))
-			{
-			CContactTextField* textField = itemField.TextStorage();
-			email.Create( textField->Text() );
-			aEmail.Copy( email );
-			}				
-		}
-	email.Close();
+    pos = fieldSet.Find(KUidContactFieldFamilyName);
+    if (pos >= 0)
+        {
+        CContactItemField& itemField=fieldSet[pos];
+        if (!(itemField.IsHidden()) && !(itemField.IsDisabled()))
+            {
+            CContactTextField* textField = itemField.TextStorage();
+            familyName.Create( textField->Text() );
+            }               
+        }
+    pos = fieldSet.Find(KUidContactFieldGivenName);
+    if (pos >= 0)
+        {
+        CContactItemField& itemField=fieldSet[pos];
+        if (!(itemField.IsHidden()) && !(itemField.IsDisabled()))
+            {
+            CContactTextField* textField = itemField.TextStorage();
+            givenName.Create( textField->Text() );
+            }               
+        }   
+    RBuf email;
+    pos = fieldSet.Find(KUidContactFieldEMail);
+    if (pos >= 0)
+        {
+        CContactItemField& itemField=fieldSet[pos];
+        if (!(itemField.IsHidden()) && !(itemField.IsDisabled()))
+            {
+            CContactTextField* textField = itemField.TextStorage();
+            email.Create( textField->Text() );
+            aEmail.Copy( email );
+            }               
+        }
+    email.Close();
 
 
-	if ( familyName.Length() )
-		{
-		aName.Append(givenName);
-		aName.Trim();
-		}
+    if ( familyName.Length() )
+        {
+        aName.Append(givenName);
+        aName.Trim();
+        }
 
-	if ( givenName.Length() )
-		{
-		aName.Append(' ');
-		aName.Append(familyName);
-		aName.Trim();
-		}
+    if ( givenName.Length() )
+        {
+        aName.Append(' ');
+        aName.Append(familyName);
+        aName.Trim();
+        }
 
-	givenName.Close();
-	familyName.Close();
-	}
+    givenName.Close();
+    familyName.Close();
+    }
 
 // ---------------------------------------------------------------------------
 // Gets the phone number from given contact item
 // ---------------------------------------------------------------------------
 //
 HBufC* CFSEmailUiContactHandler::GetPhoneNumberAndNameL( RBuf& aPhoneNumber, CContactItem& aItem ) const
-	{
+    {
     FUNC_LOG;
-	TInt pos;
-	CContactItemFieldSet& fieldSet = aItem.CardFields();
+    TInt pos;
+    CContactItemFieldSet& fieldSet = aItem.CardFields();
 
-	pos = fieldSet.Find(KUidContactFieldPhoneNumber);
-	if (pos >= 0)
-		{
-		CContactItemField& itemField=fieldSet[pos];
-		if (!(itemField.IsHidden()) && !(itemField.IsDisabled()))
-			{
-			CContactTextField* textField = itemField.TextStorage();
-			//aPhoneNumber.Create( textField->Text()->Length() );
-			//aPhoneNumber.Copy( textField->Text() );
-			aPhoneNumber.Create( textField->Text() );
-			}				
-		}
-	
-	HBufC* firstname = NULL;
-	
-	pos = fieldSet.Find( KUidContactFieldGivenName );
-	if ( pos >= 0 )
-		{
-		CContactItemField& itemField=fieldSet[pos];
-		if ( !itemField.IsHidden() && !itemField.IsDisabled() )
-			{
-			CContactTextField* textField = itemField.TextStorage();
-			firstname = textField->Text().AllocLC();
-			}				
-		}
-	if ( !firstname )
-	    {
-	    firstname = KNullDesC().AllocLC();
-	    }
+    pos = fieldSet.Find(KUidContactFieldPhoneNumber);
+    if (pos >= 0)
+        {
+        CContactItemField& itemField=fieldSet[pos];
+        if (!(itemField.IsHidden()) && !(itemField.IsDisabled()))
+            {
+            CContactTextField* textField = itemField.TextStorage();
+            //aPhoneNumber.Create( textField->Text()->Length() );
+            //aPhoneNumber.Copy( textField->Text() );
+            aPhoneNumber.Create( textField->Text() );
+            }               
+        }
+    
+    HBufC* firstname = NULL;
+    
+    pos = fieldSet.Find( KUidContactFieldGivenName );
+    if ( pos >= 0 )
+        {
+        CContactItemField& itemField=fieldSet[pos];
+        if ( !itemField.IsHidden() && !itemField.IsDisabled() )
+            {
+            CContactTextField* textField = itemField.TextStorage();
+            firstname = textField->Text().AllocLC();
+            }               
+        }
+    if ( !firstname )
+        {
+        firstname = KNullDesC().AllocLC();
+        }
 
-	HBufC* lastname = NULL;
-	
-	pos = fieldSet.Find( KUidContactFieldFamilyName );
-	if ( pos >= 0 )
-		{
-		CContactItemField& itemField=fieldSet[pos];
-		if ( !itemField.IsHidden() && !itemField.IsDisabled() )
-			{
-			CContactTextField* textField = itemField.TextStorage();
-			lastname = textField->Text().AllocLC();
-			}				
-		}
-	if ( !lastname )
-	    {
-	    lastname = KNullDesC().AllocLC();
-	    }
-	
-	HBufC* name = TFsEmailUiUtility::CreateDisplayNameLC( *firstname, *lastname, KNullDesC );
-	CleanupStack::Pop( name );
-	CleanupStack::PopAndDestroy( lastname );
-	CleanupStack::PopAndDestroy( firstname );
-	
-	return name;
-	}
+    HBufC* lastname = NULL;
+    
+    pos = fieldSet.Find( KUidContactFieldFamilyName );
+    if ( pos >= 0 )
+        {
+        CContactItemField& itemField=fieldSet[pos];
+        if ( !itemField.IsHidden() && !itemField.IsDisabled() )
+            {
+            CContactTextField* textField = itemField.TextStorage();
+            lastname = textField->Text().AllocLC();
+            }               
+        }
+    if ( !lastname )
+        {
+        lastname = KNullDesC().AllocLC();
+        }
+    
+    HBufC* name = TFsEmailUiUtility::CreateDisplayNameLC( *firstname, *lastname, KNullDesC );
+    CleanupStack::Pop( name );
+    CleanupStack::PopAndDestroy( lastname );
+    CleanupStack::PopAndDestroy( firstname );
+    
+    return name;
+    }
 
 // ---------------------------------------------------------------------------
 // CFSEmailUiContactHandler::DoRemoteLookupL
@@ -1685,36 +1703,36 @@
 //
 void CFSEmailUiContactHandler::DoRemoteLookupL( CFSMailBox& aMailBox,
     const TDesC& aQueryString,
-	CPbkxRemoteContactLookupServiceUiContext::TResult& aResult,
-	CPbkxRemoteContactLookupServiceUiContext::TMode aContext )
-	{
+    CPbkxRemoteContactLookupServiceUiContext::TResult& aResult,
+    CPbkxRemoteContactLookupServiceUiContext::TMode aContext )
+    {
     FUNC_LOG;
-   	TUid protocolUid = TUid::Null();
-	TUint accountId = 0;
-	aMailBox.GetRCLInfo( protocolUid, accountId );
-	const TPbkxRemoteContactLookupProtocolAccountId KAccountId(
-		protocolUid, accountId );
-		
+    TUid protocolUid = TUid::Null();
+    TUint accountId = 0;
+    aMailBox.GetRCLInfo( protocolUid, accountId );
+    const TPbkxRemoteContactLookupProtocolAccountId KAccountId(
+        protocolUid, accountId );
+        
 
-	CPbkxRemoteContactLookupEnv* env = CPbkxRemoteContactLookupEnv::NewL();
-	CleanupStack::PushL( env );
+    CPbkxRemoteContactLookupEnv* env = CPbkxRemoteContactLookupEnv::NewL();
+    CleanupStack::PushL( env );
 
-	MPbkxRemoteContactLookupServiceUi* serviceUi = env->ServiceUiL();
+    MPbkxRemoteContactLookupServiceUi* serviceUi = env->ServiceUiL();
 
-	// If you want test with RCL dummyContactDatabase, KAccountId = serviceUi->DefaultAccountIdL();
-	MPbkxRemoteContactLookupServiceUi::TContextParams params = { KAccountId, aContext };
+    // If you want test with RCL dummyContactDatabase, KAccountId = serviceUi->DefaultAccountIdL();
+    MPbkxRemoteContactLookupServiceUi::TContextParams params = { KAccountId, aContext };
 
-	CPbkxRemoteContactLookupServiceUiContext* ctx( NULL );
-	ctx = serviceUi->NewContextL( params );
+    CPbkxRemoteContactLookupServiceUiContext* ctx( NULL );
+    ctx = serviceUi->NewContextL( params );
 
-	CleanupStack::PushL( ctx ); 
+    CleanupStack::PushL( ctx ); 
 
-	ctx->ExecuteL( aQueryString, aResult );
+    ctx->ExecuteL( aQueryString, aResult );
 
-	CleanupStack::PopAndDestroy( ctx );
-	CleanupStack::PopAndDestroy( env );
+    CleanupStack::PopAndDestroy( ctx );
+    CleanupStack::PopAndDestroy( env );
 
-	}
+    }
 
 
 // ---------------------------------------------------------------------------
@@ -1723,43 +1741,43 @@
 //
 TBool CFSEmailUiContactHandler::CallQueryL(
     const TDesC& aDisplayName )
-	{
+    {
     FUNC_LOG;
-	TInt answer = 0;
-	
-	if ( aDisplayName.Length() )
-	    {
-	    if ( iUseSenderText )
-	    	{
-	    	answer = TFsEmailUiUtility::ShowConfirmationQueryL( R_FREESTYLE_EMAIL_CALL_SENDER_QUERY, 
-															aDisplayName );
-	    	}
-	    else
-	    	{
-	    	answer = TFsEmailUiUtility::ShowConfirmationQueryL( R_FREESTYLE_EMAIL_UI_VIEWER_CALL_HOTSPOT, 
-															    aDisplayName );
-	    	}
-	    }
-	else // Show basic note if display name is not available.
-	    {
-	    _LIT(KEmpty, "");
-	    // Create dialog
-	    CFSEmailUiCallDialog* queryNote = new ( ELeave ) CFSEmailUiCallDialog();
-	    CleanupStack::PushL( queryNote ); 
+    TInt answer = 0;
+    
+    if ( aDisplayName.Length() )
+        {
+        if ( iUseSenderText )
+            {
+            answer = TFsEmailUiUtility::ShowConfirmationQueryL( R_FREESTYLE_EMAIL_CALL_SENDER_QUERY, 
+                                                            aDisplayName );
+            }
+        else
+            {
+            answer = TFsEmailUiUtility::ShowConfirmationQueryL( R_FREESTYLE_EMAIL_UI_VIEWER_CALL_HOTSPOT, 
+                                                                aDisplayName );
+            }
+        }
+    else // Show basic note if display name is not available.
+        {
+        _LIT(KEmpty, "");
+        // Create dialog
+        CFSEmailUiCallDialog* queryNote = new ( ELeave ) CFSEmailUiCallDialog();
+        CleanupStack::PushL( queryNote ); 
         // Createa and set text
-	    HBufC* querytext = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_CALL_HOTSPOT, KEmpty );       
-	    TPtr pointer = querytext->Des();
-	    _LIT(KLineBreak, "\n");
+        HBufC* querytext = StringLoader::LoadLC( R_FREESTYLE_EMAIL_UI_VIEWER_CALL_HOTSPOT, KEmpty );       
+        TPtr pointer = querytext->Des();
+        _LIT(KLineBreak, "\n");
         AknTextUtils::StripCharacters( pointer, KLineBreak );
-	    queryNote->SetPromptL( *querytext );       
-	    CleanupStack::PopAndDestroy( querytext );
+        queryNote->SetPromptL( *querytext );       
+        CleanupStack::PopAndDestroy( querytext );
         CleanupStack::Pop( queryNote );
         // Show note.
         answer = queryNote->ExecuteLD( R_FSEMAIL_QUERY_DIALOG );
-	    }
-	
-	return answer;
-	}
+        }
+    
+    return answer;
+    }
 
 
 
@@ -1793,42 +1811,42 @@
     }
 
 void CFSEmailUiContactHandler::RemoteContactQueryL()
-	{
-	FUNC_LOG;
-	TInt answer = TFsEmailUiUtility::ShowConfirmationQueryL( R_FREESTYLE_EMAIL_FETCH_FROM_REMOTE_QUERY );
-	if ( answer )	
-		{
-		LaunchRemoteLookupWithQueryL( *iMailBox, *iPreviousEmailAddress );
-		}
+    {
+    FUNC_LOG;
+    TInt answer = TFsEmailUiUtility::ShowConfirmationQueryL( R_FREESTYLE_EMAIL_FETCH_FROM_REMOTE_QUERY );
+    if ( answer )   
+        {
+        LaunchRemoteLookupWithQueryL( *iMailBox, *iPreviousEmailAddress );
+        }
     else // user cancelled operation inform client to enable its actions (i.e. return search priority)
         {
         ObserverOperationErrorL( CurrentCommand(), KErrCancel );
         }
 
-	}
+    }
 
 TContactHandlerCmd CFSEmailUiContactHandler::CurrentCommand()
-	{
+    {
     FUNC_LOG;
-	switch (iState)
-		{
-		case EContactHandlerAddToContacts:
-			return EAddToContactL;
-		case EContactHandlerSearchMatches:
-			return ESearchContacts;
-		case EContactHandlerShowContactDetails:
-			return EShowContactDetailsL;
-		case EContactHandlerGetAddressesFromPhonebook:
-			return EGetAddressesFromPhonebook;
-		case EContactHandlerCallToContactByEmail:
-			return ECallToContact;
-		case EContactHandlerCreateMessage:
-			return ECreateMessage;
-		default:
-			break;
-		}
-	return EIdle;
-	}
+    switch (iState)
+        {
+        case EContactHandlerAddToContacts:
+            return EAddToContactL;
+        case EContactHandlerSearchMatches:
+            return ESearchContacts;
+        case EContactHandlerShowContactDetails:
+            return EShowContactDetailsL;
+        case EContactHandlerGetAddressesFromPhonebook:
+            return EGetAddressesFromPhonebook;
+        case EContactHandlerCallToContactByEmail:
+            return ECallToContact;
+        case EContactHandlerCreateMessage:
+            return ECreateMessage;
+        default:
+            break;
+        }
+    return EIdle;
+    }
 
 void CFSEmailUiContactHandler::ClearObservers()
     {
@@ -1845,3 +1863,16 @@
         }
     }
 
+void CFSEmailUiContactHandler::CCASimpleNotifyL( TNotifyType aType, TInt /*aReason*/ )
+    {
+    if ( MCCAObserver::EExitEvent == aType )
+        {
+        // Calling Close() for iConnection will close the running 
+        // CCApplication, so be careful when using it
+        if ( iConnection )
+            {
+            iConnection->Close();
+            iConnection = NULL;
+            }
+        }
+    }
--- a/emailuis/emailui/src/FreestyleEmailUiDownloadManagerVisualiser.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiDownloadManagerVisualiser.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -19,8 +19,8 @@
 
 // SYSTEM INCLUDES
 #include "emailtrace.h"
-#include <FreestyleEmailUi.mbg>
-#include <aknutils.h>
+#include <freestyleemailui.mbg>
+#include <AknUtils.h>
 #include <gulicon.h>
 #include <StringLoader.h>
 #include <FreestyleEmailUi.rsg>
@@ -37,9 +37,9 @@
 #include "fstreeplaintwolineitemdata.h"
 #include "fstreeplaintwolineitemvisualizer.h"
 // </cmail>
-#include <AknListQueryDialog.h>
-#include <caknfileselectiondialog.h>
-#include <caknmemoryselectiondialog.h>
+#include <aknlistquerydialog.h>
+#include <CAknFileSelectionDialog.h>
+#include <CAknMemorySelectionDialog.h>
 #include <pathinfo.h>
 #include <aknnotewrappers.h>
 // <cmail> SF
@@ -50,7 +50,7 @@
 #include "mfsmailbrandmanager.h"
 #include "cfsmailclient.h"
 //</cmail>
-#include <FeatMgr.h>
+#include <featmgr.h>
 //</cmail>
 
 // INTERNAL INCLUDES
@@ -89,32 +89,32 @@
     CleanupStack::PushL( self );
     self->ConstructL();
     return self;
-	}
+    }
 
 void CFSEmailUiDownloadManagerVisualiser::ConstructL()
-	{
+    {
     FUNC_LOG;
 
-	BaseConstructL( R_FSEMAILUI_DOWNLOADMANAGER_VIEW );
+    BaseConstructL( R_FSEMAILUI_DOWNLOADMANAGER_VIEW );
 
-	// Create list screen (list) control
-	iScreenControl = CFreestyleEmailUiDownloadManagerControl::NewL( iEnv, this );
-	
-	// Create attachments list layout and set it to fill the main pane
-  	TRect screenRect;
- 	AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, screenRect );	
+    // Create list screen (list) control
+    iScreenControl = CFreestyleEmailUiDownloadManagerControl::NewL( iEnv, this );
+    
+    // Create attachments list layout and set it to fill the main pane
+    TRect screenRect;
+    AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, screenRect ); 
     iListLayout = CAlfDeckLayout::AddNewL( *iScreenControl );  
     screenRect.Move(0,0);
     iListLayout->SetRect( screenRect );
   
-   	// Create attachments list tree list component 
+    // Create attachments list tree list component 
     iDownloadManagerTreeListVisualizer = CFsTreeVisualizerBase::NewL(iScreenControl, *iListLayout);
-   	iDownloadManagerTreeListVisualizer->SetItemExpansionDelay( iAppUi.LayoutHandler()->ListItemExpansionDelay() );
-   	
+    iDownloadManagerTreeListVisualizer->SetItemExpansionDelay( iAppUi.LayoutHandler()->ListItemExpansionDelay() );
+    
     iDownloadManagerList = CFsTreeList::NewL(*iDownloadManagerTreeListVisualizer, iEnv);   
     iDownloadManagerList->SetScrollbarVisibilityL( EFsScrollbarAuto );
-  	iDownloadManagerList->SetMarkTypeL( CFsTreeList::EFsTreeListMultiMarkable );
-  	iDownloadManagerList->SetIndentationL( 0 );
+    iDownloadManagerList->SetMarkTypeL( CFsTreeList::EFsTreeListMultiMarkable );
+    iDownloadManagerList->SetIndentationL( 0 );
 
     //<cmail> Compared to S60 3.2.3 in S60 5.0 Alf offers the key events in
     // opposite order.
@@ -125,7 +125,7 @@
     iModel = CFSEmailUiDownloadManagerModel::NewL( iAppUi, *this );
     //<cmail> S60 skin support
     //iDownloadManagerTreeListVisualizer->SetBackgroundTextureL( iAppUi.FsTextureManager()->TextureByIndex( EBackgroundTextureMailList ) );  
-	//</cmail>
+    //</cmail>
     iDownloadManagerTreeListVisualizer->SetMenuIcon( iAppUi.FsTextureManager()->TextureByIndex( EListControlMenuIcon ) );
     iDownloadManagerTreeListVisualizer->SetItemsAlwaysExtendedL( ETrue );
     iDownloadManagerList->AddObserverL( *this );
@@ -136,42 +136,42 @@
     iDownloadManagerTreeListVisualizer->AddCustomPageUpKey( EStdKeyPageUp );
     iDownloadManagerTreeListVisualizer->AddCustomPageDownKey( EStdKeyPageDown );
  
-   	CAlfBrush* selectorBrush = iAppUi.FsTextureManager()->ListSelectorBrushL();
-	iDownloadManagerTreeListVisualizer->SetSelectorPropertiesL( selectorBrush, 1.0, CFsTreeVisualizerBase::EFsSelectorMoveSmoothly );
+    CAlfBrush* selectorBrush = iAppUi.FsTextureManager()->ListSelectorBrushL();
+    iDownloadManagerTreeListVisualizer->SetSelectorPropertiesL( selectorBrush, 1.0, CFsTreeVisualizerBase::EFsSelectorMoveSmoothly );
   
- 	}
+    }
 
 
 CFSEmailUiDownloadManagerVisualiser::CFSEmailUiDownloadManagerVisualiser(
     CAlfEnv& aEnv, CFreestyleEmailUiAppUi* aAppUi, CAlfControlGroup& aControlGroup )
     : CFsEmailUiViewBase( aControlGroup, *aAppUi ), iEnv( aEnv )
-	{
+    {
     FUNC_LOG;
-	}
+    }
 
 CFSEmailUiDownloadManagerVisualiser::~CFSEmailUiDownloadManagerVisualiser()
-	{
+    {
     FUNC_LOG;
-	delete iModel;
-	if ( iDownloadManagerList )
-		{
-		iDownloadManagerList->RemoveObserver( *this );
-		}
-	delete iDownloadManagerList;
-	}
+    delete iModel;
+    if ( iDownloadManagerList )
+        {
+        iDownloadManagerList->RemoveObserver( *this );
+        }
+    delete iDownloadManagerList;
+    }
 
 
 TInt CFSEmailUiDownloadManagerVisualiser::HighlightedIndex()
-	{
+    {
     FUNC_LOG;
-	return 0;
-	}
+    return 0;
+    }
 
 TUid CFSEmailUiDownloadManagerVisualiser::Id() const
-	{
+    {
     FUNC_LOG;
-	return DownloadManagerViewId;
-	}			   
+    return DownloadManagerViewId;
+    }              
 
 // ---------------------------------------------------------------------------
 // CFSEmailUiDownloadManagerVisualiser::ChildDoActivateL
@@ -187,38 +187,38 @@
         TUid /*aCustomMessageId*/,
         const TDesC8& /*aCustomMessage*/ )
 // <cmail> Toolbar
-	{
+    {
     FUNC_LOG;
-	RefreshL();
-	iDownloadManagerList->ShowListL();
-	
-	SetMailboxNameToStatusPaneL();
-	}
+    RefreshL();
+    iDownloadManagerList->ShowListL();
+    
+    SetMailboxNameToStatusPaneL();
+    }
 
 void CFSEmailUiDownloadManagerVisualiser::SetMailboxNameToStatusPaneL()
-	{
+    {
     FUNC_LOG;
-	iAppUi.SetActiveMailboxNameToStatusPaneL();
-	}
+    iAppUi.SetActiveMailboxNameToStatusPaneL();
+    }
 
 // ---------------------------------------------------------------------------
 // CFSEmailUiDownloadManagerVisualiser::ChildDoDeactivate
 // ---------------------------------------------------------------------------
 //
 void CFSEmailUiDownloadManagerVisualiser::ChildDoDeactivate()
-	{
+    {
     FUNC_LOG;
     if ( !iAppUi.AppUiExitOngoing() )
         {
         iDownloadManagerTreeListVisualizer->NotifyControlVisibilityChange( EFalse );
         }
-    }	
-	
+    }   
+    
 CFSEmailUiDownloadManagerModel* CFSEmailUiDownloadManagerVisualiser::Model()
-	{
+    {
     FUNC_LOG;
-	return iModel;	
-	}
+    return iModel;  
+    }
 
 void CFSEmailUiDownloadManagerVisualiser::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
     {
@@ -257,10 +257,10 @@
     else if ( aResourceId == R_FSEMAILUI_DOWNLOADMANAGER_MENUPANE )
         {
         if ( FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration ) )
-    	   {
-    	   // remove help support in pf5250
-    	   aMenuPane->SetItemDimmed( EFsEmailUiCmdHelp, ETrue);      
-    	   }        
+           {
+           // remove help support in pf5250
+           aMenuPane->SetItemDimmed( EFsEmailUiCmdHelp, ETrue);      
+           }        
         
         aMenuPane->SetItemDimmed( EFsEmailUiCmdMailActions,
                 !IsCommandAvailableOnItem(EFsEmailUiCmdMailActions, selectedItem) );
@@ -278,10 +278,10 @@
 
     // Add shortcut hints
     iAppUi.ShortcutBinding().AppendShortcutHintsL( *aMenuPane, 
-            CFSEmailUiShortcutBinding::EContextDownloadManager );	
+            CFSEmailUiShortcutBinding::EContextDownloadManager );   
     }
-	
-	
+    
+    
 // ---------------------------------------------------------------------------
 // HandleMailBoxEventL
 // Mailbox event handler, responds to events sent by the plugin.
@@ -291,10 +291,10 @@
     TFSMailMsgId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ )
     {
     FUNC_LOG;
-	// Safety, refresh only if this view is active, has model and mail deleted event has been received.  
+    // Safety, refresh only if this view is active, has model and mail deleted event has been received.  
     if ( aEvent == TFSEventMailDeleted && iModel ) 
         {
-		// Remove deleted items from list. Refresh list if this view is active
+        // Remove deleted items from list. Refresh list if this view is active
         // and some item was removed.
         if ( iModel->ClearInvalidItemsL() && 
              iAppUi.CurrentActiveView() == this )
@@ -303,122 +303,122 @@
             SetMskL();
             }
         }
-    }	
-		
-		
+    }   
+        
+        
 void CFSEmailUiDownloadManagerVisualiser::RefreshL()
-	{
+    {
     FUNC_LOG;
-	TRect screenRect;
-	AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect );
-	iListLayout->SetRect( screenRect );
+    TRect screenRect;
+    AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect );
+    iListLayout->SetRect( screenRect );
 
-	iDownloadManagerList->RemoveAllL(); 
-	
-	CFsTreePlainTwoLineItemData* twoLineItemData = CFsTreePlainTwoLineItemData::NewL();
-	CleanupStack::PushL( twoLineItemData );
+    iDownloadManagerList->RemoveAllL(); 
+    
+    CFsTreePlainTwoLineItemData* twoLineItemData = CFsTreePlainTwoLineItemData::NewL();
+    CleanupStack::PushL( twoLineItemData );
     CFsTreePlainTwoLineItemVisualizer* twoLineItemVisualizer = 
         CFsTreePlainTwoLineItemVisualizer::NewL( *iDownloadManagerList->TreeControl() );
     CleanupStack::PushL( twoLineItemVisualizer );
- 	// Set font height
-	twoLineItemVisualizer->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() );		
-	// Set font bolding
-	twoLineItemVisualizer->SetTextBold( ETrue );
+    // Set font height
+    twoLineItemVisualizer->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() );        
+    // Set font bolding
+    twoLineItemVisualizer->SetTextBold( ETrue );
     // Set manual layout and make item non-focusable
-	twoLineItemVisualizer->SetFlags( twoLineItemVisualizer->Flags() & ~KFsTreeListItemFocusable );
+    twoLineItemVisualizer->SetFlags( twoLineItemVisualizer->Flags() & ~KFsTreeListItemFocusable );
 
-  	// Set correct skin text colors for the list items  
-   	TRgb focusedColor = iAppUi.LayoutHandler()->ListFocusedStateTextSkinColor();
-   	TRgb normalItemColor = iAppUi.LayoutHandler()->ListNormalStateTextSkinColor();
-   	TRgb normalNodeColor = iAppUi.LayoutHandler()->ListNodeTextColor();
+    // Set correct skin text colors for the list items  
+    TRgb focusedColor = iAppUi.LayoutHandler()->ListFocusedStateTextSkinColor();
+    TRgb normalItemColor = iAppUi.LayoutHandler()->ListNormalStateTextSkinColor();
+    TRgb normalNodeColor = iAppUi.LayoutHandler()->ListNodeTextColor();
     TRgb headerBgColor = iAppUi.LayoutHandler()->ListHeaderBackgroundColor();
 
-   	twoLineItemVisualizer->SetFocusedStateTextColor( focusedColor );
-   	twoLineItemVisualizer->SetNormalStateTextColor( normalItemColor );
-   	twoLineItemVisualizer->SetBackgroundColor( headerBgColor );
-	
-	const RArray<TMessageData>& modelData = iModel->GetModel();
-	HBufC* resourceString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_HEADER_DOWNLOAD_MANAGER );
-	twoLineItemData->SetDataL( *resourceString );	
-	CleanupStack::PopAndDestroy( resourceString );
+    twoLineItemVisualizer->SetFocusedStateTextColor( focusedColor );
+    twoLineItemVisualizer->SetNormalStateTextColor( normalItemColor );
+    twoLineItemVisualizer->SetBackgroundColor( headerBgColor );
+    
+    const RArray<TMessageData>& modelData = iModel->GetModel();
+    HBufC* resourceString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_HEADER_DOWNLOAD_MANAGER );
+    twoLineItemData->SetDataL( *resourceString );   
+    CleanupStack::PopAndDestroy( resourceString );
 
-	resourceString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_HEADER_TOTAL, iModel->AttachmentCount() );
-	twoLineItemData->SetSecondaryDataL( *resourceString );
-	CleanupStack::PopAndDestroy( resourceString );
-	twoLineItemData->SetIcon ( iAppUi.FsTextureManager()->TextureByIndex( EAttachmentIcon ) );
-	CleanupStack::Pop( twoLineItemVisualizer );
-	CleanupStack::Pop( twoLineItemData );
+    resourceString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_HEADER_TOTAL, iModel->AttachmentCount() );
+    twoLineItemData->SetSecondaryDataL( *resourceString );
+    CleanupStack::PopAndDestroy( resourceString );
+    twoLineItemData->SetIcon ( iAppUi.FsTextureManager()->TextureByIndex( EAttachmentIcon ) );
+    CleanupStack::Pop( twoLineItemVisualizer );
+    CleanupStack::Pop( twoLineItemData );
     iHeaderItemId = iDownloadManagerList->InsertItemL( *twoLineItemData, *twoLineItemVisualizer, KFsTreeRootID );
 
-	TFsTreeItemId parentNode;
-	for ( TInt i=0 ; i<modelData.Count() ; i++ )
-		{
-		CFsTreePlainOneLineNodeData* separatorData = CFsTreePlainOneLineNodeData::NewL();
-		CleanupStack::PushL( separatorData );
-	    CFsTreePlainOneLineNodeVisualizer* separatorVisualiser = 
+    TFsTreeItemId parentNode;
+    for ( TInt i=0 ; i<modelData.Count() ; i++ )
+        {
+        CFsTreePlainOneLineNodeData* separatorData = CFsTreePlainOneLineNodeData::NewL();
+        CleanupStack::PushL( separatorData );
+        CFsTreePlainOneLineNodeVisualizer* separatorVisualiser = 
             CFsTreePlainOneLineNodeVisualizer::NewL( *iDownloadManagerList->TreeControl() );
-	    CleanupStack::PushL( separatorVisualiser );
-	    separatorData->SetDataL( *modelData[i].mailSubject );
- 		// Set font height
-		separatorVisualiser->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() );		
-		// Set font bolding
-		separatorVisualiser->SetTextBold( ETrue );
-	  	// Set correct skin text colors for the list items  
-		separatorVisualiser->SetFocusedStateTextColor( focusedColor );
-		separatorVisualiser->SetNormalStateTextColor( normalNodeColor );
-		separatorVisualiser->SetBackgroundColor( iAppUi.LayoutHandler()->ListNodeBackgroundColor() );
-		
-	    separatorVisualiser->SetExtendable( EFalse );
-		separatorData->SetIconExpanded( iAppUi.FsTextureManager()->TextureByIndex( EListTextureNodeExpanded ) );
-		separatorData->SetIconCollapsed( iAppUi.FsTextureManager()->TextureByIndex( EListTextureNodeCollapsed ) );
-		CleanupStack::Pop( separatorVisualiser );
-		CleanupStack::Pop( separatorData );
-	    parentNode = iDownloadManagerList->InsertNodeL(*separatorData, *separatorVisualiser, KFsTreeRootID);  
-		iModel->SetNodeIdL( i, parentNode );
-		for (TInt j=0; j<modelData[i].mailAttachments.Count(); j++)
-			{
-		    twoLineItemData = CFsTreePlainTwoLineItemData::NewL();
-			CleanupStack::PushL( twoLineItemData );
-		    twoLineItemData->SetDataL( modelData[i].mailAttachments[j].fileName );
-	    
+        CleanupStack::PushL( separatorVisualiser );
+        separatorData->SetDataL( *modelData[i].mailSubject );
+        // Set font height
+        separatorVisualiser->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() );      
+        // Set font bolding
+        separatorVisualiser->SetTextBold( ETrue );
+        // Set correct skin text colors for the list items  
+        separatorVisualiser->SetFocusedStateTextColor( focusedColor );
+        separatorVisualiser->SetNormalStateTextColor( normalNodeColor );
+        separatorVisualiser->SetBackgroundColor( iAppUi.LayoutHandler()->ListNodeBackgroundColor() );
+        
+        separatorVisualiser->SetExtendable( EFalse );
+        separatorData->SetIconExpanded( iAppUi.FsTextureManager()->TextureByIndex( EListTextureNodeExpanded ) );
+        separatorData->SetIconCollapsed( iAppUi.FsTextureManager()->TextureByIndex( EListTextureNodeCollapsed ) );
+        CleanupStack::Pop( separatorVisualiser );
+        CleanupStack::Pop( separatorData );
+        parentNode = iDownloadManagerList->InsertNodeL(*separatorData, *separatorVisualiser, KFsTreeRootID);  
+        iModel->SetNodeIdL( i, parentNode );
+        for (TInt j=0; j<modelData[i].mailAttachments.Count(); j++)
+            {
+            twoLineItemData = CFsTreePlainTwoLineItemData::NewL();
+            CleanupStack::PushL( twoLineItemData );
+            twoLineItemData->SetDataL( modelData[i].mailAttachments[j].fileName );
+        
             HBufC* secondLine = CreateSecondLineTextLC( modelData[i].mailAttachments[j] );
-    		twoLineItemData->SetSecondaryDataL( *secondLine );
-    		CleanupStack::PopAndDestroy( secondLine );		
-					
-    		CAlfTexture& itemTexture = TFsEmailUiUtility::GetAttachmentIcon( modelData[i].mailAttachments[j].fileType, 
-    		                                                                 *iAppUi.FsTextureManager() );
-       		twoLineItemData->SetIcon( itemTexture );
+            twoLineItemData->SetSecondaryDataL( *secondLine );
+            CleanupStack::PopAndDestroy( secondLine );      
+                    
+            CAlfTexture& itemTexture = TFsEmailUiUtility::GetAttachmentIcon( modelData[i].mailAttachments[j].fileType, 
+                                                                             *iAppUi.FsTextureManager() );
+            twoLineItemData->SetIcon( itemTexture );
 
 
-	 	    twoLineItemVisualizer = CFsTreePlainTwoLineItemVisualizer::NewL( *iDownloadManagerList->TreeControl());
-		    CleanupStack::PushL( twoLineItemVisualizer );
-	 		twoLineItemVisualizer->SetExtendable(ETrue);
-			twoLineItemVisualizer->SetFlags( twoLineItemVisualizer->Flags() | KFsTreeListItemHasMenu );
-			
-			CAlfTextStyle* textStyle = iAppUi.LayoutHandler()->FSTextStyleFromIdL( EFSFontTypeSmall );
-			twoLineItemVisualizer->SetTextStyleId( textStyle->Id() );
+            twoLineItemVisualizer = CFsTreePlainTwoLineItemVisualizer::NewL( *iDownloadManagerList->TreeControl());
+            CleanupStack::PushL( twoLineItemVisualizer );
+            twoLineItemVisualizer->SetExtendable(ETrue);
+            twoLineItemVisualizer->SetFlags( twoLineItemVisualizer->Flags() | KFsTreeListItemHasMenu );
+            
+            CAlfTextStyle* textStyle = iAppUi.LayoutHandler()->FSTextStyleFromIdL( EFSFontTypeSmall );
+            twoLineItemVisualizer->SetTextStyleId( textStyle->Id() );
 
-	 		// Set font height
-			twoLineItemVisualizer->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() );		
-			// Set font bolding
-			twoLineItemVisualizer->SetTextBold( EFalse );
-		  	// Set correct skin text colors for the list items  
-		   	twoLineItemVisualizer->SetFocusedStateTextColor( focusedColor );
-		   	twoLineItemVisualizer->SetNormalStateTextColor( normalItemColor );
+            // Set font height
+            twoLineItemVisualizer->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() );        
+            // Set font bolding
+            twoLineItemVisualizer->SetTextBold( EFalse );
+            // Set correct skin text colors for the list items  
+            twoLineItemVisualizer->SetFocusedStateTextColor( focusedColor );
+            twoLineItemVisualizer->SetNormalStateTextColor( normalItemColor );
 
-		
-		    TFsTreeItemId treeItemId = iDownloadManagerList->InsertItemL( *twoLineItemData, *twoLineItemVisualizer, parentNode);
-			CleanupStack::Pop( twoLineItemVisualizer );
-			CleanupStack::Pop( twoLineItemData );
-		    
-			iModel->SetItemIdL( i, j, treeItemId );
-			}
-	   	}
-	}
-	
-	
+        
+            TFsTreeItemId treeItemId = iDownloadManagerList->InsertItemL( *twoLineItemData, *twoLineItemVisualizer, parentNode);
+            CleanupStack::Pop( twoLineItemVisualizer );
+            CleanupStack::Pop( twoLineItemData );
+            
+            iModel->SetItemIdL( i, j, treeItemId );
+            }
+        }
+    }
+    
+    
 void CFSEmailUiDownloadManagerVisualiser::HandleDynamicVariantSwitchL( CFsEmailUiViewBase::TDynamicSwitchType aType )
-	{
+    {
     FUNC_LOG;
     iDownloadManagerList->HideListL();
     if ( aType ==  CFsEmailUiViewBase::ESkinChanged )
@@ -426,12 +426,12 @@
         ResetColorsL();
         iDownloadManagerList->ShowListL();
         }
-  	else if ( aType == CFsEmailUiViewBase::EScreenLayoutChanged )
-  	    {
-    	ReScaleUiL();
-        iDownloadManagerList->ShowListL();	
-  	    }
-	}
+    else if ( aType == CFsEmailUiViewBase::EScreenLayoutChanged )
+        {
+        ReScaleUiL();
+        iDownloadManagerList->ShowListL();  
+        }
+    }
 
 void CFSEmailUiDownloadManagerVisualiser::HandleDynamicVariantSwitchOnBackgroundL( CFsEmailUiViewBase::TDynamicSwitchType aType )
     {
@@ -453,67 +453,67 @@
     TFsTreeItemId focusedId = iDownloadManagerList->FocusedItem();
     
     switch(aCommand)
-  		{
-  		case EFsEmailUiCmdEmpty: // used when focused item is being downloaded
+        {
+        case EFsEmailUiCmdEmpty: // used when focused item is being downloaded
         case EAknSoftkeyOpen:
-  		case EFsEmailUiCmdOpen:
-  		    {
-  		    TryToOpenItemL( focusedId );
-			}
-			break;
-  		case EFsEmailUiCmdDownload:
-  		    {
-  		    iModel->StartDownloadL(focusedId);
-  		    }
-  		    break;
-  		case EFsEmailUiCmdDownloadAll:
-  			{
-  			iModel->DownloadAllAttachmentsL();
-  			}
-  			break;
-   		case EFsEmailUiCmdCancelDownload:
-   		    {
-   		    TInt reallyCancel = 
-   		        TFsEmailUiUtility::ShowConfirmationQueryL( R_FSE_VIEWER_CANCEL_DOWNLOAD_QUERY );
-			if ( reallyCancel )
-				{
-				iModel->CancelDownloadL( focusedId );
-				}
-   		    }
-   		    break;
-  		case EFsEmailUiCmdCancelAllDownloads:
-  		    {
-   		    TInt reallyCancel = 
-   		        TFsEmailUiUtility::ShowConfirmationQueryL( R_FSE_VIEWER_CANCEL_DOWNLOADS_QUERY );
-			if ( reallyCancel )
-				{
-   				iModel->CancelAllDownloadsL();
-				}
-  		    }
-  		    break;
-  		case EFsEmailUiCmdSave:
-  			{
-  		    TFileName fileName;
-  		    TInt savedCount( 0 );
-  		    if ( TFsEmailUiUtility::ShowSaveFolderDialogL( fileName ) )
-  				{
-				iModel->SaveAttachmentL( focusedId, fileName, savedCount );
-  				}
-  		    if ( savedCount )
-  		        {
-  		        TFsEmailUiUtility::ShowFilesSavedToFolderNoteL( savedCount );        
-  		        }
-  			}
-  			break;
-  		case EFsEmailUiCmdSaveAll:
-  		    {
-  		    TFileName fileName;
-  			if ( TFsEmailUiUtility::ShowSaveFolderDialogL( fileName ) )
-  				{
-  				iModel->SaveAllAttachmentsL( fileName );
-  				}
-  		    }
-  			break;
+        case EFsEmailUiCmdOpen:
+            {
+            TryToOpenItemL( focusedId );
+            }
+            break;
+        case EFsEmailUiCmdDownload:
+            {
+            iModel->StartDownloadL(focusedId);
+            }
+            break;
+        case EFsEmailUiCmdDownloadAll:
+            {
+            iModel->DownloadAllAttachmentsL();
+            }
+            break;
+        case EFsEmailUiCmdCancelDownload:
+            {
+            TInt reallyCancel = 
+                TFsEmailUiUtility::ShowConfirmationQueryL( R_FSE_VIEWER_CANCEL_DOWNLOAD_QUERY );
+            if ( reallyCancel )
+                {
+                iModel->CancelDownloadL( focusedId );
+                }
+            }
+            break;
+        case EFsEmailUiCmdCancelAllDownloads:
+            {
+            TInt reallyCancel = 
+                TFsEmailUiUtility::ShowConfirmationQueryL( R_FSE_VIEWER_CANCEL_DOWNLOADS_QUERY );
+            if ( reallyCancel )
+                {
+                iModel->CancelAllDownloadsL();
+                }
+            }
+            break;
+        case EFsEmailUiCmdSave:
+            {
+            TFileName fileName;
+            TInt savedCount( 0 );
+            if ( TFsEmailUiUtility::ShowSaveFolderDialogL( fileName ) )
+                {
+                iModel->SaveAttachmentL( focusedId, fileName, savedCount );
+                }
+            if ( savedCount )
+                {
+                TFsEmailUiUtility::ShowFilesSavedToFolderNoteL( savedCount );        
+                }
+            }
+            break;
+        case EFsEmailUiCmdSaveAll:
+            {
+            TFileName fileName;
+            if ( TFsEmailUiUtility::ShowSaveFolderDialogL( fileName ) )
+                {
+                iModel->SaveAllAttachmentsL( fileName );
+                }
+            }
+            break;
         case EFsEmailUiCmdClearFetchedAttachment:
         case EFsEmailUiCmdRemoveAttachment:
         case EFsEmailUiCmdActionsDelete: // from shortcut key
@@ -521,7 +521,7 @@
             RemoveAttachmentL( focusedId );
             }
             break;
-  		case EFsEmailUiCmdMsgDetails:
+        case EFsEmailUiCmdMsgDetails:
             {
             TPartData messageData = iModel->GetMessageL( focusedId );
             
@@ -530,11 +530,11 @@
             msgDetailsData.iFolderId = messageData.iFolderId;
             msgDetailsData.iMessageId = messageData.iMessageId;
 
-            const TPckgBuf<TMsgDetailsActivationData> pkgOut( msgDetailsData );	
+            const TPckgBuf<TMsgDetailsActivationData> pkgOut( msgDetailsData ); 
             iAppUi.EnterFsEmailViewL( MsgDetailsViewId, KStartMsgDetailsToBeginning, pkgOut );
             }
             break;
-  		case EFSEmailUICmdViewMessage:
+        case EFSEmailUICmdViewMessage:
             {
             TPartData messageData = iModel->GetMessageL( focusedId );
             
@@ -543,7 +543,7 @@
             msgViewerData.iFolderId = messageData.iFolderId;
             msgViewerData.iMessageId = messageData.iMessageId;
             msgViewerData.iDetails = EFSMsgDataStructure;
-            const TPckgBuf<TMsgViewerActivationData> pkgOut( msgViewerData );	
+            const TPckgBuf<TMsgViewerActivationData> pkgOut( msgViewerData );   
             iAppUi.EnterFsEmailViewL( MailViewerId, KStartViewerWithMsgId, pkgOut );
             }
             break;
@@ -553,14 +553,14 @@
             }
             break;
         case EAknSoftkeyBack:
-     		{
-     		if ( !iAppUi.ViewSwitchingOngoing() )
-     			{
-	  	       	iAppUi.ReturnToPreviousViewL();
-     			}
-     		}   
-        	break;
-        	
+            {
+            if ( !iAppUi.ViewSwitchingOngoing() )
+                {
+                iAppUi.ReturnToPreviousViewL();
+                }
+            }   
+            break;
+            
         case EFsEmailUiCmdCollapse:
             {
             iDownloadManagerList->CollapseNodeL( focusedId );
@@ -601,13 +601,13 @@
             iCoeEnv->SimulateKeyEventL( simEvent, EEventKey );
             }
             break;
-       	case EFsEmailUiCmdHelp:
-  			{
-			TFsEmailUiUtility::LaunchHelpL( KFSE_HLP_LAUNCHER_GRID );
-  			}
-  			break; 
+        case EFsEmailUiCmdHelp:
+            {
+            TFsEmailUiUtility::LaunchHelpL( KFSE_HLP_LAUNCHER_GRID );
+            }
+            break; 
         default:
-        	break;
+            break;
         }
     }
     
@@ -615,41 +615,41 @@
     {
     FUNC_LOG;
     TFsTreeItemId curId = iDownloadManagerList->FocusedItem(); 
-	if ( curId )
-		{
-	    if( iDownloadManagerList->IsNode( curId ) )
-	        {
-	        if (iDownloadManagerList->IsExpanded( curId ) )
-	            {
-	            ChangeMskCommandL( R_FSE_QTN_MSK_COLLAPSE );
-	            } 
-	        else  
-	            {
-	            ChangeMskCommandL( R_FSE_QTN_MSK_EXPAND );
-	            }
-	        }
-	    else // non-node item
-	        { 
-	        TAttachmentData* selectedItem = iModel->GetItem( iDownloadManagerList->FocusedItem());
-	        if ( selectedItem && IsCommandAvailableOnItem( EFsEmailUiCmdDownload, selectedItem ) )
-	            {
-	            ChangeMskCommandL( R_FSE_QTN_MSK_DOWNLOAD );
-	            }
-	        else if ( selectedItem && IsCommandAvailableOnItem( EFsEmailUiCmdOpen, selectedItem ) )
-	            {
-	            ChangeMskCommandL( R_FSE_QTN_MSK_OPEN );
-	            }
-	        else
-	            {
-	            ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY );
-	            }
-	        }		
-		}
-	else
-		{
-        ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY );		
-		}	
-    }	
+    if ( curId )
+        {
+        if( iDownloadManagerList->IsNode( curId ) )
+            {
+            if (iDownloadManagerList->IsExpanded( curId ) )
+                {
+                ChangeMskCommandL( R_FSE_QTN_MSK_COLLAPSE );
+                } 
+            else  
+                {
+                ChangeMskCommandL( R_FSE_QTN_MSK_EXPAND );
+                }
+            }
+        else // non-node item
+            { 
+            TAttachmentData* selectedItem = iModel->GetItem( iDownloadManagerList->FocusedItem());
+            if ( selectedItem && IsCommandAvailableOnItem( EFsEmailUiCmdDownload, selectedItem ) )
+                {
+                ChangeMskCommandL( R_FSE_QTN_MSK_DOWNLOAD );
+                }
+            else if ( selectedItem && IsCommandAvailableOnItem( EFsEmailUiCmdOpen, selectedItem ) )
+                {
+                ChangeMskCommandL( R_FSE_QTN_MSK_OPEN );
+                }
+            else
+                {
+                ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY );
+                }
+            }       
+        }
+    else
+        {
+        ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY );       
+        }   
+    }   
 
 TBool CFSEmailUiDownloadManagerVisualiser::OfferEventL(const TAlfEvent& aEvent)
     {
@@ -658,19 +658,19 @@
     SetMskL();
     if ( aEvent.IsKeyEvent() && aEvent.Code() == EEventKey )
         {
-	    TInt scanCode = aEvent.KeyEvent().iScanCode;
-	    // Swap right and left controls in mirrored layout
-	    if ( AknLayoutUtils::LayoutMirrored() )
-	        {
-	        if (scanCode == EStdKeyRightArrow) scanCode = EStdKeyLeftArrow;
-	        else if (scanCode == EStdKeyLeftArrow ) scanCode = EStdKeyRightArrow;
-	        }
-	
-		if ( scanCode == EStdKeyRightArrow )
-			{
-			LaunchActionMenuL();
-			result = ETrue;
-			}
+        TInt scanCode = aEvent.KeyEvent().iScanCode;
+        // Swap right and left controls in mirrored layout
+        if ( AknLayoutUtils::LayoutMirrored() )
+            {
+            if (scanCode == EStdKeyRightArrow) scanCode = EStdKeyLeftArrow;
+            else if (scanCode == EStdKeyLeftArrow ) scanCode = EStdKeyRightArrow;
+            }
+    
+        if ( scanCode == EStdKeyRightArrow )
+            {
+            LaunchActionMenuL();
+            result = ETrue;
+            }
         else
             {
             // Check keyboard shortcuts.
@@ -685,17 +685,17 @@
             }
         }
 
-	/*
+    /*
     if (!result)
         {
         result = iDownloadManagerList->TreeControl()->OfferEventL(aEvent);
         }
-	*/
+    */
     return result;
     }
 
 void CFSEmailUiDownloadManagerVisualiser::ReScaleUiL()
-	{
+    {
     FUNC_LOG;
     TInt fontHeight = iAppUi.LayoutHandler()->ListItemFontHeightInTwips();
     
@@ -720,52 +720,52 @@
             MFsTreeItemVisualizer& attachmentVis = iDownloadManagerList->ItemVisualizer( attachment.treeId );
             attachmentVis.SetFontHeight( fontHeight );
             }
-        }	
+        }   
     }
 
 void CFSEmailUiDownloadManagerVisualiser::ResetColorsL()
     {
     FUNC_LOG;
-   	TRgb normalTextColor = iAppUi.LayoutHandler()->ListNormalStateTextSkinColor();
-   	TRgb focusedTextColor = iAppUi.LayoutHandler()->ListFocusedStateTextSkinColor();
-   	TRgb nodeTextColor = iAppUi.LayoutHandler()->ListNodeTextColor();
-   	TRgb nodeBgColor = iAppUi.LayoutHandler()->ListNodeBackgroundColor();
+    TRgb normalTextColor = iAppUi.LayoutHandler()->ListNormalStateTextSkinColor();
+    TRgb focusedTextColor = iAppUi.LayoutHandler()->ListFocusedStateTextSkinColor();
+    TRgb nodeTextColor = iAppUi.LayoutHandler()->ListNodeTextColor();
+    TRgb nodeBgColor = iAppUi.LayoutHandler()->ListNodeBackgroundColor();
     TRgb headerBgColor = iAppUi.LayoutHandler()->ListHeaderBackgroundColor();
-   	
-   	// Header item
-   	TFsTreeItemId headerId = iDownloadManagerList->Child( KFsTreeRootID, 0 );
-   	MFsTreeItemVisualizer& headerVis = iDownloadManagerList->ItemVisualizer( headerId );
-   	headerVis.SetNormalStateTextColor( normalTextColor );
-   	headerVis.SetFocusedStateTextColor( focusedTextColor );
-   	headerVis.SetBackgroundColor( headerBgColor );
+    
+    // Header item
+    TFsTreeItemId headerId = iDownloadManagerList->Child( KFsTreeRootID, 0 );
+    MFsTreeItemVisualizer& headerVis = iDownloadManagerList->ItemVisualizer( headerId );
+    headerVis.SetNormalStateTextColor( normalTextColor );
+    headerVis.SetFocusedStateTextColor( focusedTextColor );
+    headerVis.SetBackgroundColor( headerBgColor );
 
-   	// Mail nodes and attachment items
-	const RArray<TMessageData>& modelData = iModel->GetModel();
+    // Mail nodes and attachment items
+    const RArray<TMessageData>& modelData = iModel->GetModel();
     for ( TInt i=0 ; i<modelData.Count() ; ++i )
         {
-    	const TMessageData& message = modelData[ i ];
-    	
-       	MFsTreeItemVisualizer& messageVis = iDownloadManagerList->ItemVisualizer( message.treeId );
-       	messageVis.SetNormalStateTextColor( nodeTextColor );
-       	messageVis.SetFocusedStateTextColor( focusedTextColor );
-       	messageVis.SetBackgroundColor( nodeBgColor );
-    	
-    	for ( TInt j=0 ; j<message.mailAttachments.Count() ; j++ )
-    	    {
-    	    const TAttachmentData& attachment = message.mailAttachments[j];
-    	    
-           	MFsTreeItemVisualizer& attachmentVis = iDownloadManagerList->ItemVisualizer( attachment.treeId );
-           	attachmentVis.SetNormalStateTextColor( normalTextColor );
-           	attachmentVis.SetFocusedStateTextColor( focusedTextColor );
-    	    }
+        const TMessageData& message = modelData[ i ];
+        
+        MFsTreeItemVisualizer& messageVis = iDownloadManagerList->ItemVisualizer( message.treeId );
+        messageVis.SetNormalStateTextColor( nodeTextColor );
+        messageVis.SetFocusedStateTextColor( focusedTextColor );
+        messageVis.SetBackgroundColor( nodeBgColor );
+        
+        for ( TInt j=0 ; j<message.mailAttachments.Count() ; j++ )
+            {
+            const TAttachmentData& attachment = message.mailAttachments[j];
+            
+            MFsTreeItemVisualizer& attachmentVis = iDownloadManagerList->ItemVisualizer( attachment.treeId );
+            attachmentVis.SetNormalStateTextColor( normalTextColor );
+            attachmentVis.SetFocusedStateTextColor( focusedTextColor );
+            }
         }
     }
 
 CAlfControl* CFSEmailUiDownloadManagerVisualiser::ViewerControl()
-	{
+    {
     FUNC_LOG;
-	return iScreenControl;
-	}
+    return iScreenControl;
+    }
 
 TBool CFSEmailUiDownloadManagerVisualiser::IsCommandAvailableOnItem( TInt aCommandId, 
                                                                      const TAttachmentData* aFocusedItem ) const
@@ -784,10 +784,10 @@
         //case FsEActionAttachmentClearFetchedContent:
         // </cmail>
             {
-    		if ( aFocusedItem && aFocusedItem->downloadProgress == KComplete )
-    			{
-    			available = ETrue;
-    			}
+            if ( aFocusedItem && aFocusedItem->downloadProgress == KComplete )
+                {
+                available = ETrue;
+                }
             }
             break;
 
@@ -803,33 +803,33 @@
         case EFsEmailUiCmdRemoveAttachment:
         case FsEActionAttachmentRemoveUnfetchedAttachment:
             {
-    		if ( iAppUi.DownloadInfoMediator() && aFocusedItem && aFocusedItem->downloadProgress == KNone && 
-    		     !iAppUi.DownloadInfoMediator()->IsDownloading( aFocusedItem->partData.iMessagePartId ) )
-    			{
-    			available = ETrue;
-    			}
+            if ( iAppUi.DownloadInfoMediator() && aFocusedItem && aFocusedItem->downloadProgress == KNone && 
+                 !iAppUi.DownloadInfoMediator()->IsDownloading( aFocusedItem->partData.iMessagePartId ) )
+                {
+                available = ETrue;
+                }
             }
             break;
 
         case EFsEmailUiCmdCancelDownload:
         case FsEActionAttachmentCancelDownload:
             {
-    		if ( iAppUi.DownloadInfoMediator() && aFocusedItem && 
-    			 iAppUi.DownloadInfoMediator()->IsDownloading( aFocusedItem->partData.iMessagePartId ) )
-    			{
-    			available = ETrue;
-    			}
+            if ( iAppUi.DownloadInfoMediator() && aFocusedItem && 
+                 iAppUi.DownloadInfoMediator()->IsDownloading( aFocusedItem->partData.iMessagePartId ) )
+                {
+                available = ETrue;
+                }
             }
             break;
 
         case EFsEmailUiCmdSave:
         case FsEActionAttachmentSave:
             {
-    		if ( iAppUi.DownloadInfoMediator() && aFocusedItem && 
-    			 !iAppUi.DownloadInfoMediator()->IsDownloading( aFocusedItem->partData.iMessagePartId ) )
-    			{
-    			available = ETrue;
-    			}
+            if ( iAppUi.DownloadInfoMediator() && aFocusedItem && 
+                 !iAppUi.DownloadInfoMediator()->IsDownloading( aFocusedItem->partData.iMessagePartId ) )
+                {
+                available = ETrue;
+                }
             }
             break;
 
@@ -841,19 +841,19 @@
             if ( iModel->AttachmentCount() > 1 )
                 {
                 available = ETrue;
-        		for ( TInt i=0; i<model.Count(); i++)
-        			{
-        			const RArray<TAttachmentData>& attachments = model[i].mailAttachments;
-        			for ( TInt j=0 ; j<attachments.Count() ; ++j )
-        			    {
-            			if ( iAppUi.DownloadInfoMediator() && 
-            				 iAppUi.DownloadInfoMediator()->IsDownloading( attachments[j].partData.iMessagePartId ) )
-            				{
-           					available = EFalse;
-           					break;
-            				}
-        			    }
-        			}
+                for ( TInt i=0; i<model.Count(); i++)
+                    {
+                    const RArray<TAttachmentData>& attachments = model[i].mailAttachments;
+                    for ( TInt j=0 ; j<attachments.Count() ; ++j )
+                        {
+                        if ( iAppUi.DownloadInfoMediator() && 
+                             iAppUi.DownloadInfoMediator()->IsDownloading( attachments[j].partData.iMessagePartId ) )
+                            {
+                            available = EFalse;
+                            break;
+                            }
+                        }
+                    }
                 }
             }
             break;
@@ -863,22 +863,22 @@
             {
             // Cancel all is available if there is more than one ongoing download
             TInt downloads = 0;
-    		for ( TInt i=0; i<model.Count(); i++)
-    			{	
-    			const RArray<TAttachmentData>& attachments = model[i].mailAttachments;
-    			for ( TInt j=0 ; j<attachments.Count() ; ++j )
-    			    {
-        			if ( iAppUi.DownloadInfoMediator() && 
-        				 iAppUi.DownloadInfoMediator()->IsDownloading( attachments[j].partData.iMessagePartId ) )
-        				{
-        				downloads++;
-        				}
-    			    }
-    			}
-    		if ( downloads > 1 )
-    		    {
-    		    available = ETrue;
-    		    }
+            for ( TInt i=0; i<model.Count(); i++)
+                {   
+                const RArray<TAttachmentData>& attachments = model[i].mailAttachments;
+                for ( TInt j=0 ; j<attachments.Count() ; ++j )
+                    {
+                    if ( iAppUi.DownloadInfoMediator() && 
+                         iAppUi.DownloadInfoMediator()->IsDownloading( attachments[j].partData.iMessagePartId ) )
+                        {
+                        downloads++;
+                        }
+                    }
+                }
+            if ( downloads > 1 )
+                {
+                available = ETrue;
+                }
             }
             break;
 
@@ -888,21 +888,21 @@
             // Download all is available there is more than one attachments for which
             // "Download" command is available.
             TInt downloadableFiles = 0;
-    		for ( TInt i=0; i<model.Count(); i++)
-    			{
-    			const RArray<TAttachmentData>& attachments = model[i].mailAttachments;
-    			for ( TInt j=0 ; j<attachments.Count() ; ++j )
-    			    {
-        			if ( IsCommandAvailableOnItem( EFsEmailUiCmdDownload, &attachments[j] ) )
-        				{
+            for ( TInt i=0; i<model.Count(); i++)
+                {
+                const RArray<TAttachmentData>& attachments = model[i].mailAttachments;
+                for ( TInt j=0 ; j<attachments.Count() ; ++j )
+                    {
+                    if ( IsCommandAvailableOnItem( EFsEmailUiCmdDownload, &attachments[j] ) )
+                        {
                         downloadableFiles++;
-        				}
-    			    }
-    			}
-    		if ( downloadableFiles > 1 )
-    		    {
-    		    available = ETrue;
-    		    }
+                        }
+                    }
+                }
+            if ( downloadableFiles > 1 )
+                {
+                available = ETrue;
+                }
             }
             break;
 
@@ -934,30 +934,30 @@
     {
     FUNC_LOG;
     // File extension
-	TPtrC extString = TParsePtrC( aAttachment.fileName ).Ext();
-	// It seems to vary if preceeding dot is included in the file extension. Remove it if present.
-	if ( extString.Length() && extString[0] == '.' )
-	    {
-	    extString.Set( extString.Mid(1) );
-	    }
+    TPtrC extString = TParsePtrC( aAttachment.fileName ).Ext();
+    // It seems to vary if preceeding dot is included in the file extension. Remove it if present.
+    if ( extString.Length() && extString[0] == '.' )
+        {
+        extString.Set( extString.Mid(1) );
+        }
 
-    // File size	
-	HBufC* sizeString = iModel->CreateSizeDescLC( aAttachment.fileSize );
+    // File size    
+    HBufC* sizeString = iModel->CreateSizeDescLC( aAttachment.fileSize );
 
     // Download progress
     HBufC* progressString = NULL;
-	if ( iAppUi.DownloadInfoMediator() && iAppUi.DownloadInfoMediator()->IsDownloading( aAttachment.partData.iMessagePartId ) )
-		{
-		progressString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_LIST_DOWNLOADING, aAttachment.downloadProgress  );
-		}
-	else if ( aAttachment.downloadProgress == KComplete )
-	    {
-		progressString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_LIST_DOWNLOADED_100 );
-	    }
-	else
-	    {
-	    progressString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_LIST_DOWNLOADING_CANCELLED );
-	    }
+    if ( iAppUi.DownloadInfoMediator() && iAppUi.DownloadInfoMediator()->IsDownloading( aAttachment.partData.iMessagePartId ) )
+        {
+        progressString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_LIST_DOWNLOADING, aAttachment.downloadProgress  );
+        }
+    else if ( aAttachment.downloadProgress == KComplete )
+        {
+        progressString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_LIST_DOWNLOADED_100 );
+        }
+    else
+        {
+        progressString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_LIST_DOWNLOADING_CANCELLED );
+        }
 
     // Combine the accumulated data to one buffer
     HBufC* result = HBufC::NewL( extString.Length() + 
@@ -971,12 +971,12 @@
     resultPtr.Append( *sizeString );
     resultPtr.Append( KSpace );
     resultPtr.Append( *progressString );
-    	
-	CleanupStack::PopAndDestroy( progressString );
-	CleanupStack::PopAndDestroy( sizeString );
-	
-	CleanupStack::PushL( result );
-	return result;
+        
+    CleanupStack::PopAndDestroy( progressString );
+    CleanupStack::PopAndDestroy( sizeString );
+    
+    CleanupStack::PushL( result );
+    return result;
     }
 
 // ---------------------------------------------------------------------------
@@ -992,28 +992,28 @@
     TRAPD( err, attachment = &iModel->GetItemL( aId ) );
     
     if( !err )
-    	{
-	    if ( attachment )
-	        {
-	        if ( iModel->IsDownloading( *attachment ) )
-	            {
-	            TFsEmailUiUtility::ShowInfoNoteL( R_FSE_VIEWER_NOTE_ATTACHMENT_DOWNLOADING_PROGRESS );
-	            }
-	        else if ( attachment->downloadProgress != KComplete )
-	            {
-	            TInt restartDownload = 
-	                TFsEmailUiUtility::ShowConfirmationQueryL( R_FSE_VIEWER_NOTE_ATTACHMENT_RESTART_DOWNLOADING );
-	            if ( restartDownload )
-	                {
-	                HandleCommandL( EFsEmailUiCmdDownload );
-	                }
-	            }
-	        else
-	            {
-	            TFsEmailUiUtility::OpenAttachmentL( attachment->partData );
-	            }
-	        }
-	    }
+        {
+        if ( attachment )
+            {
+            if ( iModel->IsDownloading( *attachment ) )
+                {
+                TFsEmailUiUtility::ShowInfoNoteL( R_FSE_VIEWER_NOTE_ATTACHMENT_DOWNLOADING_PROGRESS );
+                }
+            else if ( attachment->downloadProgress != KComplete )
+                {
+                TInt restartDownload = 
+                    TFsEmailUiUtility::ShowConfirmationQueryL( R_FSE_VIEWER_NOTE_ATTACHMENT_RESTART_DOWNLOADING );
+                if ( restartDownload )
+                    {
+                    HandleCommandL( EFsEmailUiCmdDownload );
+                    }
+                }
+            else
+                {
+                TFsEmailUiUtility::OpenAttachmentL( attachment->partData );
+                }
+            }
+        }
     }
 
 // ---------------------------------------------------------------------------
@@ -1071,22 +1071,22 @@
     }
 
 void CFSEmailUiDownloadManagerVisualiser::DownloadStatusChangedL( TInt aIndex )
-	{
+    {
     FUNC_LOG;
-	if ( iAppUi.CurrentActiveView() == this &&
-	     aIndex < iModel->GetModel().Count() &&
-	     !iAppUi.AppUiExitOngoing() )
-	    {
-      	TRect screenRect;
-     	AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect );	
+    if ( iAppUi.CurrentActiveView() == this &&
+         aIndex < iModel->GetModel().Count() &&
+         !iAppUi.AppUiExitOngoing() )
+        {
+        TRect screenRect;
+        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect );   
     
-       	TRgb focusedColor = iAppUi.LayoutHandler()->ListFocusedStateTextSkinColor();
-       	TRgb normalItemColor = iAppUi.LayoutHandler()->ListNormalStateTextSkinColor();
-       	TRgb normalNodeColor = iAppUi.LayoutHandler()->ListNodeTextColor();
+        TRgb focusedColor = iAppUi.LayoutHandler()->ListFocusedStateTextSkinColor();
+        TRgb normalItemColor = iAppUi.LayoutHandler()->ListNormalStateTextSkinColor();
+        TRgb normalNodeColor = iAppUi.LayoutHandler()->ListNodeTextColor();
     
-    	const RArray<TMessageData>& modelData = iModel->GetModel();
-    	const TMessageData& message = modelData[ aIndex ];
-    	
+        const RArray<TMessageData>& modelData = iModel->GetModel();
+        const TMessageData& message = modelData[ aIndex ];
+        
         // Insert the message node if it's not yet present
         if ( message.treeId == KFsTreeNoneID )
             {
@@ -1114,33 +1114,33 @@
 
         // Insert or update the attachment items 
         for ( TInt j = 0 ; j < message.mailAttachments.Count() ; j++ )
-    		{
+            {
             HBufC* secondLine = CreateSecondLineTextLC( message.mailAttachments[j] );
     
-    		//is the item already drawn
-       		TFsTreeItemId itemId = message.mailAttachments[j].treeId;
-    		if ( itemId != KFsTreeNoneID )
-    			{
-    			// Item is already present. Update the existing item but only if the second line data
-    			// is actually changed. 
-    		    CFsTreePlainTwoLineItemData& itemData = 
-    		            static_cast<CFsTreePlainTwoLineItemData&>( iDownloadManagerList->ItemData( itemId ) );
+            //is the item already drawn
+            TFsTreeItemId itemId = message.mailAttachments[j].treeId;
+            if ( itemId != KFsTreeNoneID )
+                {
+                // Item is already present. Update the existing item but only if the second line data
+                // is actually changed. 
+                CFsTreePlainTwoLineItemData& itemData = 
+                        static_cast<CFsTreePlainTwoLineItemData&>( iDownloadManagerList->ItemData( itemId ) );
 
-    		    if ( itemData.SecondaryData() != *secondLine )
-    		        {
-    		        itemData.SetSecondaryDataL( *secondLine );
-        		    iDownloadManagerTreeListVisualizer->UpdateItemL( itemId );
-        			
-        	        // Update the MSK label if the updated item happens to be the focused item
-        			if ( itemId == iDownloadManagerList->FocusedItem() )
-        			    {
+                if ( itemData.SecondaryData() != *secondLine )
+                    {
+                    itemData.SetSecondaryDataL( *secondLine );
+                    iDownloadManagerTreeListVisualizer->UpdateItemL( itemId );
+                    
+                    // Update the MSK label if the updated item happens to be the focused item
+                    if ( itemId == iDownloadManagerList->FocusedItem() )
+                        {
                         SetMskL();
-        			    }
-    		        }
-    			}
-    		else 
-    			{
-    			//create and draw new item
+                        }
+                    }
+                }
+            else 
+                {
+                //create and draw new item
                 CFsTreePlainTwoLineItemData* twoLineItemData = CFsTreePlainTwoLineItemData::NewL();
                 CleanupStack::PushL( twoLineItemData );
         
@@ -1151,94 +1151,94 @@
                                                                                  *iAppUi.FsTextureManager() );
                 twoLineItemData->SetIcon( itemTexture );
         
-    	 	    CFsTreePlainTwoLineItemVisualizer* twoLineItemVisualizer = 
-    	 	        CFsTreePlainTwoLineItemVisualizer::NewL( *iDownloadManagerList->TreeControl() );
-    	 	    CleanupStack::PushL( twoLineItemVisualizer );
-    			twoLineItemVisualizer->SetFlags( twoLineItemVisualizer->Flags() | KFsTreeListItemHasMenu );
-    	 		twoLineItemVisualizer->SetExtendable( ETrue );
-				CAlfTextStyle* textStyle = iAppUi.LayoutHandler()->FSTextStyleFromIdL( EFSFontTypeSmall );
-    			twoLineItemVisualizer->SetTextStyleId( textStyle->Id() );
-    	 		// Set font height
-    			twoLineItemVisualizer->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() );		
-    			// Set font bolding
-    			twoLineItemVisualizer->SetTextBold( EFalse );
-    		  	// Set correct skin text colors for the list items  
-    		   	twoLineItemVisualizer->SetFocusedStateTextColor( focusedColor );
-    		   	twoLineItemVisualizer->SetNormalStateTextColor( normalItemColor );
-    			TFsTreeItemId treeItemId = 
-    			    iDownloadManagerList->InsertItemL( *twoLineItemData, *twoLineItemVisualizer, message.treeId, j );
-    			CleanupStack::Pop( twoLineItemVisualizer );  // ownership transferred to TreeList
-    			CleanupStack::Pop( twoLineItemData );        // ownership transferred to TreeList
-    			iModel->SetItemIdL( aIndex, j, treeItemId );
-    			}
+                CFsTreePlainTwoLineItemVisualizer* twoLineItemVisualizer = 
+                    CFsTreePlainTwoLineItemVisualizer::NewL( *iDownloadManagerList->TreeControl() );
+                CleanupStack::PushL( twoLineItemVisualizer );
+                twoLineItemVisualizer->SetFlags( twoLineItemVisualizer->Flags() | KFsTreeListItemHasMenu );
+                twoLineItemVisualizer->SetExtendable( ETrue );
+                CAlfTextStyle* textStyle = iAppUi.LayoutHandler()->FSTextStyleFromIdL( EFSFontTypeSmall );
+                twoLineItemVisualizer->SetTextStyleId( textStyle->Id() );
+                // Set font height
+                twoLineItemVisualizer->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() );        
+                // Set font bolding
+                twoLineItemVisualizer->SetTextBold( EFalse );
+                // Set correct skin text colors for the list items  
+                twoLineItemVisualizer->SetFocusedStateTextColor( focusedColor );
+                twoLineItemVisualizer->SetNormalStateTextColor( normalItemColor );
+                TFsTreeItemId treeItemId = 
+                    iDownloadManagerList->InsertItemL( *twoLineItemData, *twoLineItemVisualizer, message.treeId, j );
+                CleanupStack::Pop( twoLineItemVisualizer );  // ownership transferred to TreeList
+                CleanupStack::Pop( twoLineItemData );        // ownership transferred to TreeList
+                iModel->SetItemIdL( aIndex, j, treeItemId );
+                }
 
-    		CleanupStack::PopAndDestroy( secondLine );      
-    		}
-	    }
-	}
+            CleanupStack::PopAndDestroy( secondLine );      
+            }
+        }
+    }
 
 // <cmail> Touch
 void CFSEmailUiDownloadManagerVisualiser::TreeListEventL(
-	const TFsTreeListEvent aEvent, const TFsTreeItemId aId )
+    const TFsTreeListEvent aEvent, const TFsTreeItemId aId )
 // </cmail>
-	{
+    {
     FUNC_LOG;
-	if ( aEvent == EFsTreeItemSelected )
-		{
-		TRAPD( err, TryToOpenItemL( aId ) );
-		if ( err != KErrNone )
-			{
-			}
-		}
-	}
+    if ( aEvent == EFsTreeItemSelected )
+        {
+        TRAPD( err, TryToOpenItemL( aId ) );
+        if ( err != KErrNone )
+            {
+            }
+        }
+    }
 
 void CFSEmailUiDownloadManagerVisualiser::LaunchActionMenuL()
-	{
+    {
     FUNC_LOG;
-  	
-	TAttachmentData* selectedItem = NULL;
-	
-	TRAPD( err, selectedItem = &iModel->GetItemL( iDownloadManagerList->FocusedItem() ) );
-	
-	if ( !err )
-		{
-		// Remove old items from action menu
-	    CFSEmailUiActionMenu::RemoveAllL();
-		
-		// Construct item list
-	    RFsEActionMenuIdList itemList;
+    
+    TAttachmentData* selectedItem = NULL;
+    
+    TRAPD( err, selectedItem = &iModel->GetItemL( iDownloadManagerList->FocusedItem() ) );
+    
+    if ( !err )
+        {
+        // Remove old items from action menu
+        CFSEmailUiActionMenu::RemoveAllL();
+        
+        // Construct item list
+        RFsEActionMenuIdList itemList;
         CleanupClosePushL( itemList );
 
-		if ( IsCommandAvailableOnItem( FsEActionAttachmentOpen, selectedItem ) )
-			{
-			itemList.AppendL( FsEActionAttachmentOpen );
-			}
+        if ( IsCommandAvailableOnItem( FsEActionAttachmentOpen, selectedItem ) )
+            {
+            itemList.AppendL( FsEActionAttachmentOpen );
+            }
 
-		if ( IsCommandAvailableOnItem( FsEActionAttachmentDownload, selectedItem ) )
-			{
-			itemList.AppendL( FsEActionAttachmentDownload );
-			}
+        if ( IsCommandAvailableOnItem( FsEActionAttachmentDownload, selectedItem ) )
+            {
+            itemList.AppendL( FsEActionAttachmentDownload );
+            }
 
         if ( IsCommandAvailableOnItem( FsEActionAttachmentDownloadAll, selectedItem ) )
             {
             itemList.AppendL( FsEActionAttachmentDownloadAll );
             }
 
-		if ( IsCommandAvailableOnItem( FsEActionAttachmentCancelDownload, selectedItem ) )
-			{
-			itemList.AppendL( FsEActionAttachmentCancelDownload );
-			}
+        if ( IsCommandAvailableOnItem( FsEActionAttachmentCancelDownload, selectedItem ) )
+            {
+            itemList.AppendL( FsEActionAttachmentCancelDownload );
+            }
 
         if ( IsCommandAvailableOnItem( FsEActionAttachmentCancelAllDownloads, selectedItem ) )
             {
             itemList.AppendL( FsEActionAttachmentCancelAllDownloads );
             }
             
-		if ( IsCommandAvailableOnItem( FsEActionAttachmentSave, selectedItem ) )
-			{
-			itemList.AppendL( FsEActionAttachmentSave );
-			}
-		
+        if ( IsCommandAvailableOnItem( FsEActionAttachmentSave, selectedItem ) )
+            {
+            itemList.AppendL( FsEActionAttachmentSave );
+            }
+        
         if ( IsCommandAvailableOnItem( FsEActionAttachmentSaveAll, selectedItem ) )
             {
             itemList.AppendL( FsEActionAttachmentSaveAll );
@@ -1254,25 +1254,25 @@
             itemList.AppendL( FsEActionAttachmentRemoveUnfetchedAttachment );
             }
         
-		// Execute action list and handle the menu command
-	   	TActionMenuCustomItemId itemId = CFSEmailUiActionMenu::ExecuteL( itemList );
-	   	
-	   	CleanupStack::PopAndDestroy( &itemList );
-	   	
-	  	switch( itemId )
-	  		{
-			case FsEActionAttachmentOpen:
-			    HandleCommandL( EFsEmailUiCmdOpen );
-			    break;
-			case FsEActionAttachmentDownload:
-			    HandleCommandL( EFsEmailUiCmdDownload );
-			    break;
-			case FsEActionAttachmentCancelDownload:
+        // Execute action list and handle the menu command
+        TActionMenuCustomItemId itemId = CFSEmailUiActionMenu::ExecuteL( itemList );
+        
+        CleanupStack::PopAndDestroy( &itemList );
+        
+        switch( itemId )
+            {
+            case FsEActionAttachmentOpen:
+                HandleCommandL( EFsEmailUiCmdOpen );
+                break;
+            case FsEActionAttachmentDownload:
+                HandleCommandL( EFsEmailUiCmdDownload );
+                break;
+            case FsEActionAttachmentCancelDownload:
                 HandleCommandL( EFsEmailUiCmdCancelDownload );
-				break;
-			case FsEActionAttachmentSave:
-			    HandleCommandL( EFsEmailUiCmdSave );
-			    break;
+                break;
+            case FsEActionAttachmentSave:
+                HandleCommandL( EFsEmailUiCmdSave );
+                break;
             case FsEActionAttachmentDownloadAll:
                 HandleCommandL( EFsEmailUiCmdDownloadAll );
                 break;
@@ -1288,11 +1288,11 @@
             case FsEActionAttachmentRemoveUnfetchedAttachment:
                 HandleCommandL( EFsEmailUiCmdRemoveAttachment );
                 break;
-			default:
-				break;
-	  		}
-  		}
-	}
+            default:
+                break;
+            }
+        }
+    }
 
 // ---------------------------------------------------------------------------
 // If there is one or more expanded nodes, collapses all nodes.
@@ -1312,7 +1312,7 @@
             {
             collapseAllNodes = ETrue;
             break;
-            }	
+            }   
         }
 
     if ( collapseAllNodes )
@@ -1321,9 +1321,9 @@
         }
     else
         {
-       	TFsTreeItemId prevId = iDownloadManagerList->FocusedItem(); // the focus may fall out of the screen unless manually reset
+        TFsTreeItemId prevId = iDownloadManagerList->FocusedItem(); // the focus may fall out of the screen unless manually reset
         iDownloadManagerTreeListVisualizer->ExpandAllL();
-    	iDownloadManagerTreeListVisualizer->SetFocusedItemL( prevId );    
+        iDownloadManagerTreeListVisualizer->SetFocusedItemL( prevId );    
         }
     }
 
@@ -1367,4 +1367,4 @@
         }
     }
 
-	
+    
--- a/emailuis/emailui/src/FreestyleEmailUiFolderListModel.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiFolderListModel.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -19,8 +19,8 @@
 // SYSTEM INCLUDES
 //<cmail>
 #include "emailtrace.h"
-#include "CFSMailBox.h"
-#include "CFSMailFolder.h"
+#include "cfsmailbox.h"
+#include "cfsmailfolder.h"
 //</cmail>
 
 // INTERNAL INCLUDES
--- a/emailuis/emailui/src/FreestyleEmailUiFolderListVisualiser.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiFolderListVisualiser.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -50,10 +50,10 @@
 #include "fsseparatorvisualizer.h"
 
 // FREESTYLE EMAIL FRAMEWORK INCLUDES
-#include "CFSMailCommon.h"
-#include "CFSMailClient.h"
-#include "CFSMailBox.h"
-#include "CFSMailFolder.h"
+#include "cfsmailcommon.h"
+#include "cfsmailclient.h"
+#include "cfsmailbox.h"
+#include "cfsmailfolder.h"
 #include <csxhelp/cmail.hlp.hrh>
 #include <featmgr.h>
 
@@ -72,7 +72,7 @@
 #include "FreestyleEmailUiUtilities.h"
 #include "FreestyleEmailUiLayoutData.h"
 #include "FreestyleEmailUiShortcutBinding.h"
-#include "ESMailSettingsPlugin.h"
+#include "esmailsettingsplugin.h"
 #include "FreestyleEmailUiStatusIndicator.h"
 #include <alf/alfborderbrush.h>
 
--- a/emailuis/emailui/src/FreestyleEmailUiGlobalSettingsList.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiGlobalSettingsList.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -97,7 +97,7 @@
 					aId,
 					iSettings.TitleDividers() );
 			return item;
-			}
+			}/*
 		case EGlobalSettingsDownloadNotifications:
 			{			
 			CAknBinaryPopupSettingItem* item = new ( ELeave ) 
@@ -105,7 +105,7 @@
 					aId,
 					iSettings.DownloadNotifications() );
 			return item;
-			}
+			}*/
 		case EGlobalSettingsWarnBeforeDelete:
 		    {         
 		    CAknBinaryPopupSettingItem* item = new ( ELeave ) 
@@ -204,7 +204,7 @@
 	
 	iSettings.SetBodyPreview( crHandler->BodyPreview() );
 	iSettings.SetTitleDividers( crHandler->TitleDividers() );
-	iSettings.SetDownloadNotifications( crHandler->DownloadNotifications() );
+	//iSettings.SetDownloadNotifications( crHandler->DownloadNotifications() );
 	iSettings.SetActiveIdle( crHandler->ActiveIdle() );
 	iSettings.SetWarnBeforeDelete( crHandler->WarnBeforeDelete() );
 	//iSettings.SetDownloadHTMLImages( crHandler->DownloadHTMLImages() );
@@ -227,7 +227,7 @@
 	
 	crHandler->SetBodyPreview( iSettings.BodyPreview() );
 	crHandler->SetTitleDividers( iSettings.TitleDividers() );
-	crHandler->SetDownloadNotifications( iSettings.DownloadNotifications() );
+	//crHandler->SetDownloadNotifications( iSettings.DownloadNotifications() );
 	crHandler->SetActiveIdle( iSettings.ActiveIdle() );
 	crHandler->SetWarnBeforeDelete( iSettings.WarnBeforeDelete() );
 	//crHandler->SetDownloadHTMLImages( iSettings.DownloadHTMLImages() );
--- a/emailuis/emailui/src/FreestyleEmailUiHtmlViewerContainer.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiHtmlViewerContainer.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -22,16 +22,17 @@
 #include <commdbconnpref.h>
 #include <bautils.h>
 #include <biditext.h>
-#include <stringloader.h>
+#include <StringLoader.h>
 #include <e32base.h>
 #include <badesca.h>
+#include <utf.h>
 
 //<cmail>
-#include "CFSMailMessage.h"
+#include "cfsmailmessage.h"
 //</cmail>
 #include <brctlinterface.h>
 #include <sysutil.h>
-#include <SchemeHandler.h>
+#include <schemehandler.h>
 
 #include <FreestyleEmailUi.rsg>
 
@@ -354,6 +355,14 @@
         {
         iScrollPosition = 0; 
         }
+    if ( AknLayoutUtils::LayoutMirrored() )
+        {
+        direction = TBidiText::ERightToLeft;
+        }
+    else
+        {
+        direction = TBidiText::ELeftToRight;
+        }
     CFreestyleMessageHeaderHTML::ExportL( *iMessage, iFs, headerHtmlFile, iAppUi.ClientRect().Width(), 
                                             iScrollPosition,
                                             direction);
@@ -361,57 +370,16 @@
     // Remove all previously created files from temporary HTML folder
     EmptyTempHtmlFolderL();
 
-    CFSMailMessagePart* htmlBodyPart = iMessage->HtmlBodyPartL();
-
-    if ( htmlBodyPart )
-        {
-        CleanupStack::PushL( htmlBodyPart );
-        
-        RFile htmlFile = htmlBodyPart->GetContentFileL();
-        CleanupClosePushL( htmlFile );
-        
-        // Copy html body part to email html file
-        CopyFileToHtmlFileL( htmlFile, KBodyHtmlFile, *htmlBodyPart );
-        
-        CleanupStack::PopAndDestroy( &htmlFile );
-        CleanupStack::PopAndDestroy( htmlBodyPart );
-        }
-    else
+    TRAPD( error, PrepareBodyHtmlL( KBodyHtmlFile ) );
+    if ( error != KErrNone )
         {
-        CFSMailMessagePart* textBodyPart = iMessage->PlainTextBodyPartL();
-
-        if ( textBodyPart )
-            {
-            CleanupStack::PushL( textBodyPart );
-            //For now do not do any conversion just add start and end..Let browser display plain text as is
-            //Later need to refine this and add conversions
-            //htmlFile = textBodyPart->GetContentFileL();
-            //Need to get buffer in this case, file does not work
-            //HBufC* contentBuffer=HBufC::NewLC(textBodyPart->ContentSize());
-            
-            HBufC* contentBuffer=HBufC::NewLC(textBodyPart->FetchedContentSize());
-            TPtr bufPtr(contentBuffer->Des());
-            
-            textBodyPart->GetContentToBufferL(bufPtr,0);
-            HBufC8* contentBuffer8=HBufC8::NewLC(contentBuffer->Length());
-            
-            contentBuffer8->Des().Copy(*contentBuffer);         
-            CopyFileToHtmlFileL( *contentBuffer8, KBodyHtmlFile, *textBodyPart );
-            
-            CleanupStack::PopAndDestroy( contentBuffer8 );
-            CleanupStack::PopAndDestroy( contentBuffer );
-            CleanupStack::PopAndDestroy( textBodyPart ); 
-            }
-        else
-            {
-            WriteEmptyBodyHtmlL( KBodyHtmlFile );
-            }
+        WriteEmptyBodyHtmlL( KBodyHtmlFile );
         }
 
     // pass the emailHtmlFile to the browser for it to load
     TPath emailHtmlFile;
     emailHtmlFile.Copy( iHtmlFolderPath );
-    if ( direction == TBidiText::ELeftToRight )
+    if ( !AknLayoutUtils::LayoutMirrored() )
         {
         emailHtmlFile.Append( KMessageHtmlFile );
         }
@@ -456,10 +424,20 @@
             return iBrCtlInterface;
             }
         case 1:
+            {
+            return iOverlayControlNext;
+            }
+        case 2:
+            {
+            return iOverlayControlPrev;
+            }
+        case 3:
+            {
             if ( iStatusIndicator )
                 return iStatusIndicator;
             else
                 return NULL;
+            }
         default:
             {
             return NULL;
@@ -476,11 +454,11 @@
     FUNC_LOG;
     if ( iStatusIndicator )
         {
-        return 2;
+        return 4;
         }
     else 
         {
-        return 1;
+        return 3;
         }
     }
 
@@ -515,22 +493,39 @@
         {
         iBrCtlInterface->SetRect( rect );
         }
-    
-        if ( iMessage )
+
+    if ( iMessage )
+        {
+        // update the width in header part and reload
+        TPath headerHtmlFile;
+        headerHtmlFile.Copy( iHtmlFolderPath );
+        headerHtmlFile.Append( KHeaderHtmlFile );
+
+        TLanguage language = User::Language();
+        TBidiText::TDirectionality direction = TBidiText::ScriptDirectionality( language );
+        
+        if ( AknLayoutUtils::LayoutMirrored() )
+            {
+            direction = TBidiText::ERightToLeft;
+            }
+        else
             {
-            // update the width in header part and reload
-            TPath headerHtmlFile;
-            headerHtmlFile.Copy( iHtmlFolderPath );
-            headerHtmlFile.Append( KHeaderHtmlFile );
-                
-            TRAP_IGNORE( CFreestyleMessageHeaderHTML::ExportL( *iMessage, iFs, headerHtmlFile, 
-                  rect.Width(), iScrollPosition ) )
-                
-            TPath emailHtmlFile;
-            emailHtmlFile.Copy( iHtmlFolderPath );
+            direction = TBidiText::ELeftToRight;
+            }
+        TRAP_IGNORE( CFreestyleMessageHeaderHTML::ExportL( *iMessage, iFs, headerHtmlFile, 
+            rect.Width(), iScrollPosition, direction ) ) 
+        
+        TPath emailHtmlFile;
+        emailHtmlFile.Copy( iHtmlFolderPath );
+        if ( AknLayoutUtils::LayoutMirrored() )
+            {
+            emailHtmlFile.Append( KMessageHtmlRTLFile );
+            }
+        else
+            {
             emailHtmlFile.Append( KMessageHtmlFile );
-            TRAP_IGNORE( LoadContentFromFileL( emailHtmlFile ) )
             }
+        }
     
     UpdateOverlayButtons( IsVisible() );
     
@@ -567,7 +562,7 @@
             }
         }
 
-    if ( iBrCtlInterface && retVal == EKeyWasNotConsumed )
+    else if ( iBrCtlInterface && retVal == EKeyWasNotConsumed )
         {
         retVal = iBrCtlInterface->OfferKeyEventL( aKeyEvent, aType );
         }
@@ -833,21 +828,24 @@
 // ---------------------------------------------------------------------------
 //
 // <cmail>
-void CFsEmailUiHtmlViewerContainer::CopyFileToHtmlFileL( RFile& aFile,
-    const TDesC& aFileName, CFSMailMessagePart& aHtmlBodyPart )
+void CFsEmailUiHtmlViewerContainer::CopyToHtmlFileL( CFSMailMessagePart& aHtmlBodyPart, const TDesC& aFileName )
     {
     FUNC_LOG;
     TFileName targetFileName;
     targetFileName.Copy( iTempHtmlFolderPath );
     targetFileName.Append( aFileName );
 
+    RFile htmlFile = aHtmlBodyPart.GetContentFileL();
+    CleanupClosePushL( htmlFile );
+    
     // Read content from given source file
-    HBufC8* content = ReadContentFromFileLC( aFile );
+    HBufC8* content = ReadContentFromFileLC( htmlFile );
 
     // Write content to target file
     WriteContentToFileL( *content, targetFileName, aHtmlBodyPart );
 
     CleanupStack::PopAndDestroy( content );
+    CleanupStack::PopAndDestroy( &htmlFile );
     }
 // </cmail>
 
@@ -856,16 +854,27 @@
 // ---------------------------------------------------------------------------
 //
 // <cmail>
-void CFsEmailUiHtmlViewerContainer::CopyFileToHtmlFileL( const TDesC8& aBuffer,
-    const TDesC& aFileName, CFSMailMessagePart& aHtmlBodyPart )
+void CFsEmailUiHtmlViewerContainer::ConvertToHtmlFileL( CFSMailMessagePart& aTextBodyPart, const TDesC& aHtmlFileName )
     {
     FUNC_LOG;
     TFileName targetFileName;
     targetFileName.Copy( iTempHtmlFolderPath );
-    targetFileName.Append( aFileName );
+    targetFileName.Append( aHtmlFileName );
+    
+    HBufC* content = HBufC::NewLC( aTextBodyPart.FetchedContentSize() );
+    TPtr contentPtr( content->Des() );
+    
+    aTextBodyPart.GetContentToBufferL( contentPtr, 0 );
     
-    // Write content to target file
-    ConvertToHTML( aBuffer, targetFileName, aHtmlBodyPart );
+    HBufC8* content8 = CnvUtfConverter::ConvertFromUnicodeToUtf8L( *content );
+    
+    CleanupStack::PopAndDestroy( content );
+    CleanupStack::PushL( content8 );
+        
+    ConvertToHTML( *content8, targetFileName, aTextBodyPart );
+
+    CleanupStack::PopAndDestroy( content8 );
+    
     }
 
 // ---------------------------------------------------------------------------
@@ -1287,25 +1296,23 @@
         CleanupClosePushL( targetFile );
         User::LeaveIfError( targetFile.Replace( iFs, aFileName, EFileWrite ) );
         
-        HBufC8* charSet = GetCharacterSetL( aTextBodyPart );
-        CleanupStack::PushL( charSet );
-        
         RBuf8 messageHeader;
-        TInt bufSize = KHtmlHeader1().Length() + charSet->Length() + KHtmlHeader2().Length();
+        _LIT8( KCharsetUtf8, "UTF-8" );
+        TInt bufSize = KHtmlHeader1().Length() + KCharsetUtf8().Length() + KHtmlHeader2().Length();
         messageHeader.CreateL( bufSize );
         messageHeader.CleanupClosePushL();
         
         messageHeader.Append( KHtmlHeader1 );
-        messageHeader.Append( *charSet );
+        messageHeader.Append( KCharsetUtf8 );
         messageHeader.Append( KHtmlHeader2 );
-        
+
         RFileWriteStream fileStream( targetFile );
         fileStream.PushL();
         fileStream.WriteL( messageHeader.Ptr(), messageHeader.Length() );
-        
+
         TInt bufPos( 0 );
         TInt bufTotalSize = bodyBuf->Size();
-        
+
         while ( bufPos < bufTotalSize )
             {
             TInt segmentLength = bodyBuf->Ptr( bufPos ).Length();
@@ -1314,10 +1321,9 @@
             }
 
         fileStream.CommitL();
-        
+
         CleanupStack::PopAndDestroy( &fileStream );
         CleanupStack::PopAndDestroy( &messageHeader );
-        CleanupStack::PopAndDestroy( charSet );
         CleanupStack::PopAndDestroy( &targetFile );
         CleanupStack::PopAndDestroy( bodyBuf );
 
@@ -1645,31 +1651,27 @@
     }
 
 void CFsEmailUiHtmlViewerContainer::HandleResourceChange( TInt aType )
-	{
-	CCoeControl::HandleResourceChange( aType );
-	
-	if ( aType == CFsEmailUiViewBase::EScreenLayoutChanged )
-		{
-	    // only update header if we get a layout change from email ui
-		RefreshCurrentMailHeader();
-		}
-	}
+    {
+    CCoeControl::HandleResourceChange( aType );
+    }
 
 void CFsEmailUiHtmlViewerContainer::RefreshCurrentMailHeader()
-	{
-	if ( iMessage )
-		{
-		// Update the width in header part and reload
-		TPath headerHtmlFile;
-		headerHtmlFile.Copy( iHtmlFolderPath );
-		headerHtmlFile.Append( KHeaderHtmlFile );
-		
-		TLanguage language = User::Language();
-		TBidiText::TDirectionality direction = TBidiText::ScriptDirectionality( language );    
-		TRAP_IGNORE( CFreestyleMessageHeaderHTML::ExportL( *iMessage, iFs, headerHtmlFile, iAppUi.ClientRect().Width(), direction ) )
-		
+    {
+    if ( iMessage )
+        {
+        // Update the width in header part and reload
+        TPath headerHtmlFile;
+        headerHtmlFile.Copy( iHtmlFolderPath );
+        headerHtmlFile.Append( KHeaderHtmlFile );
+        
+        TLanguage language = User::Language();
+        TBidiText::TDirectionality direction = TBidiText::ScriptDirectionality( language );    
+        TRAP_IGNORE( CFreestyleMessageHeaderHTML::ExportL( *iMessage, iFs, headerHtmlFile, iAppUi.ClientRect().Width(), direction ) )
+        
         TPath emailHtmlFile;
         emailHtmlFile.Copy( iHtmlFolderPath );
+        emailHtmlFile.Append( KMessageHtmlFile );
+        
         if ( direction == TBidiText::ELeftToRight )
             {
             emailHtmlFile.Append( KMessageHtmlFile );
@@ -1678,7 +1680,7 @@
             {
             emailHtmlFile.Append( KMessageHtmlRTLFile );
             }
-		
+        
         //Load page synchronously if menu invisible
         if(!iEventHandler->IsMenuVisible())
             {
@@ -1689,9 +1691,9 @@
         else
             {
             iEventHandler->DismissMenuAndReload();
-            }		
-		}
-	}
+            }       
+        }
+    }
 
 void CFsEmailUiHtmlViewerContainer::ReloadPageL()
     {
@@ -1699,8 +1701,8 @@
     TBidiText::TDirectionality direction = TBidiText::ScriptDirectionality( language );    
     TPath emailHtmlFile;
     emailHtmlFile.Copy( iHtmlFolderPath );
-    if ( direction == TBidiText::ELeftToRight )
-            {
+    if( !AknLayoutUtils::LayoutMirrored() )
+        {
         emailHtmlFile.Append( KMessageHtmlFile );
         }
     else
@@ -1973,6 +1975,35 @@
     CleanupStack::PopAndDestroy( handler );
     }
 
+void CFsEmailUiHtmlViewerContainer::PrepareBodyHtmlL( const TDesC& aFileName )
+    {
+    CFSMailMessagePart* htmlBodyPart = iMessage->HtmlBodyPartL();
+    
+    if ( htmlBodyPart )
+        {
+        CleanupStack::PushL( htmlBodyPart );
+        // Copy html body part to email html file
+        CopyToHtmlFileL( *htmlBodyPart, aFileName );
+        CleanupStack::PopAndDestroy( htmlBodyPart );
+        }
+    else
+        {
+        CFSMailMessagePart* textBodyPart = iMessage->PlainTextBodyPartL();
+
+        if ( textBodyPart )
+            {
+            CleanupStack::PushL( textBodyPart );
+            // Copy html body part to email html file
+            ConvertToHtmlFileL( *textBodyPart, aFileName );
+            CleanupStack::PopAndDestroy( textBodyPart );
+            }
+        else
+            {
+            User::Leave( KErrNotFound );
+            }
+        }
+    }
+
 void CFsEmailUiHtmlViewerContainer::WriteEmptyBodyHtmlL( const TDesC& aFileName )
     {
     FUNC_LOG;
--- a/emailuis/emailui/src/FreestyleEmailUiHtmlViewerView.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiHtmlViewerView.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -26,15 +26,15 @@
 #include <AknGlobalNote.h>
 #include <aknnavi.h>
 #include <aknnavide.h>
-#include <APGCLI.H>
-#include <APMSTD.H>
-#include <FavouritesDb.h>
+#include <apgcli.h>
+#include <apmstd.h>
+#include <favouritesdb.h>
 //<cmail>
 #include <featmgr.h>
-#include "CFSMailMessage.h"
-#include "CFSMailClient.h"
+#include "cfsmailmessage.h"
+#include "cfsmailclient.h"
 #include <FreestyleEmailUi.rsg>
-#include <SchemeHandler.h> // CSchemeHandler
+#include <schemehandler.h> // CSchemeHandler
 #include <brctlinterface.h>
 #include <csxhelp/cmail.hlp.hrh>
 #include <baclipb.h> // for clipboard copy
@@ -53,11 +53,11 @@
 #include "FreestyleEmailUiHtmlViewerContainer.h"
 #include "FreestyleEmailUiUtilities.h"
 #include "FreestyleEmailUiShortcutBinding.h"
-#include "FreestyleEmailCenRepHandler.h"
+#include "freestyleemailcenrephandler.h"
 #include "FreestyleEmailUiAttachmentsListModel.h"
 #include "FreestyleEmailUiConstants.h"
 #include "FSEmail.pan"
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 
 #include "FreestyleEmailUiMailViewerConstants.h"
 #include "FSDelayedLoader.h"
@@ -209,23 +209,23 @@
                     case TBrCtlDefs::EElementAnchor:
                         {
                         // OPEN url in standalone browser UI
-                        /*                         HBufC* url = iContainer->BrowserControlIf()->PageInfoLC(TBrCtlDefs::EPageInfoFocusedNodeUrl);
-                                               // Use scheme handler to launch the browser as a stand alone application
-                                               TInt urlPos = url->Find( KUrlPrefixIdentifier );
-                                               if( urlPos == KErrNotFound )
-                                                   {
-                                                   HBufC* newBuf = url->ReAllocL( url->Length() + KHttpUrlPrefix().Length() );
-                                                   CleanupStack::Pop( url );
-                                                   url = newBuf;
-                                                   CleanupStack::PushL( url );
-                                                   TPtr urlPtr = url->Des();
-                                                   urlPtr.Insert( 0, KHttpUrlPrefix );
-                                                   }
-                                               CSchemeHandler* handler = CSchemeHandler::NewL( *url );
-                                               CleanupStack::PushL( handler );
-                                               handler->HandleUrlStandaloneL();
-                                               CleanupStack::PopAndDestroy( handler );
-                                               CleanupStack::PopAndDestroy( url );                                     */
+                        HBufC* url = iContainer->BrowserControlIf()->PageInfoLC(TBrCtlDefs::EPageInfoFocusedNodeUrl);
+                        // Use scheme handler to launch the browser as a stand alone application
+                        TInt urlPos = url->Find( KUrlPrefixIdentifier );
+                        if( urlPos == KErrNotFound )
+                            {
+                            HBufC* newBuf = url->ReAllocL( url->Length() + KHttpUrlPrefix().Length() );
+                            CleanupStack::Pop( url );
+                            url = newBuf;
+                            CleanupStack::PushL( url );
+                            TPtr urlPtr = url->Des();
+                            urlPtr.Insert( 0, KHttpUrlPrefix );
+                            }
+                        CSchemeHandler* handler = CSchemeHandler::NewL( *url );
+                        CleanupStack::PushL( handler );
+                        handler->HandleUrlStandaloneL();
+                        CleanupStack::PopAndDestroy( handler );
+                        CleanupStack::PopAndDestroy( url );                                     
                         }
                     break;
                     case TBrCtlDefs::EElementNone:
@@ -243,6 +243,7 @@
             case EFsEmailUiCmdActionsOpen:
             case EFsEmailUiCmdActionsReply:
                 {
+                TIMESTAMP( "Reply selected from html viewer" );
                 if ( iMessage && !iActivationData.iEmbeddedMessageMode )
                     {
                     TEditorLaunchParams params;
@@ -263,6 +264,7 @@
             break;
             case EFsEmailUiCmdActionsReplyAll:
                 {
+                TIMESTAMP( "Reply to all selected from html viewer" );
                 if ( iMessage && !iActivationData.iEmbeddedMessageMode )
                     {
                     TEditorLaunchParams params;
@@ -282,6 +284,7 @@
             break;
             case EFsEmailUiCmdActionsForward:
                 {
+                TIMESTAMP( "Forward selected from html viewer" );
                 if ( iMessage && !iActivationData.iEmbeddedMessageMode )
                     {
                     TEditorLaunchParams params;
@@ -301,6 +304,7 @@
             break;
             case EFsEmailUiCmdActionsDelete:
                 {
+                TIMESTAMP( "Delete selected from html viewer" );
                 DeleteMailL();
                 }
             break;
@@ -323,6 +327,7 @@
             break;
             case EFsEmailUiCmdExit:
                 {
+                TIMESTAMP( "Exit selected from html viewer" );
                 // <cmail>
                 iContainer->PrepareForExit();
                 // </cmail>
@@ -406,6 +411,7 @@
             break;
             }
         }
+    TIMESTAMP( "Html viewer selected operation done" );    
     }
 
 // ---------------------------------------------------------------------------
@@ -477,6 +483,9 @@
         TUid aCustomMessageId, const TDesC8& aCustomMessage )
     {
     FUNC_LOG;
+
+    TBool msgBodyStructurePresent ( EFalse );
+    TBool msgBodyContentPresent ( EFalse );
     
     if ( iMrObserverToInform && 
          aCustomMessageId == KStartViewerReturnToPreviousMsg )
@@ -588,13 +597,14 @@
                     iAppUi.MrViewerInstanceL()->ExecuteViewL( *iMessage, *this );  
                     }                              
                 else
-            		{
-		            iAttachmentsListModel = CFSEmailUiAttachmentsListModel::NewL( iAppUi, *this );
-		            TPartData msgPartData( iActivationData.iMailBoxId, iActivationData.iFolderId, iActivationData.iMessageId);
-		            iAttachmentsListModel->UpdateListL( msgPartData );
+                    {
+                    iAttachmentsListModel = CFSEmailUiAttachmentsListModel::NewL( iAppUi, *this );
+                    TPartData msgPartData( iActivationData.iMailBoxId, iActivationData.iFolderId, iActivationData.iMessageId);
+                    iAttachmentsListModel->UpdateListL( msgPartData );
                        
-            		LoadContentFromMailMessageL( iMessage, ETrue );
-            		}
+                    CheckMessageBodyL( *iMessage, msgBodyStructurePresent, msgBodyContentPresent );
+                    LoadContentFromMailMessageL( iMessage, ETrue );
+                    }
                 
                 }
             else
@@ -640,7 +650,7 @@
                 iAttachmentsListModel->UpdateListL( iOpenMessages->Head() );         
                 }                
             
-    
+            CheckMessageBodyL( *iOpenMessages->Head(), msgBodyStructurePresent, msgBodyContentPresent );
             LoadContentFromMailMessageL( iOpenMessages->Head(), ETrue );
             
             // update tool bar as some action menu boton should not appear in embbeded messages.
@@ -711,21 +721,7 @@
             }
         else 
             {
-            TBool bodypartNotFound ( EFalse );
-            if ( type == EMessagePlainTextBodyPart )
-                {
-                CFSMailMessagePart* textBodyPart = iMessage->PlainTextBodyPartL();
-                if ( textBodyPart )
-                    {
-                    delete textBodyPart;
-                    }
-                else
-                    {
-                    bodypartNotFound = ETrue;
-                    }                
-                }
-            
-            if ( bodypartNotFound )
+            if ( msgBodyStructurePresent && !msgBodyContentPresent )
                 {
                 iAsyncProcessComplete = EFalse;
                 iFetchingAlready = EFalse;
@@ -745,7 +741,7 @@
         iContainer->SetRect( ContainerRect() );
         }
 
-    
+    TIMESTAMP( "Html viewer opened" );    
     }
 
 // -----------------------------------------------------------------------------
@@ -923,7 +919,7 @@
 // ---------------------------------------------------------------------------
 //
 void CFsEmailUiHtmlViewerView::SetStatusBarLayout()
-	{
+    {
     TInt res = R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT;
     if( Layout_Meta_Data::IsLandscapeOrientation() )
         {
@@ -936,7 +932,7 @@
         TRAP_IGNORE(
             StatusPane()->SwitchLayoutL( res ));
         }
-	}
+    }
 
 void CFsEmailUiHtmlViewerView::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
     {
@@ -1253,14 +1249,14 @@
         TFSMailMsgId mailBox = iMessage->GetMailBoxId();
         TFSMailMsgId folderId = iMessage->GetFolderId();        
  
-		//Get the id and check if there is a previous message available 
-		TFSMailMsgId prevMsgId;
-		TFSMailMsgId prevMsgFolderId;  
-		
-		//Get the previous message if it exists
-		TBool available = iAppUi.IsPreviousMsgAvailable( currentMsgId, 
-												   prevMsgId, 
-                        		                   prevMsgFolderId );
+        //Get the id and check if there is a previous message available 
+        TFSMailMsgId prevMsgId;
+        TFSMailMsgId prevMsgFolderId;  
+        
+        //Get the previous message if it exists
+        TBool available = iAppUi.IsPreviousMsgAvailable( currentMsgId, 
+                                                   prevMsgId, 
+                                                   prevMsgFolderId );
         
         //Delete the message
         iAppUi.GetMailClient()->DeleteMessagesByUidL( mailBox, folderId, msgIds );
@@ -1270,20 +1266,20 @@
         SendEventToAppUiL( TFSEventMailDeleted ); 
         
         if ( iAppUi.CurrentActiveView()->Id() == HtmlViewerId )
-			{	
-			//Open the previous message or navigate back to list viewer
-			if ( available )
-				{
-				iAppUi.MoveToPreviousMsgAfterDeleteL( prevMsgId );				
-				}	
-			else
-				{
-				ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY );
-				NavigateBackL();
-				}
-			//inform user that mail is deleted	
-			TFsEmailUiUtility::ShowGlobalInfoNoteL( R_FREESTYLE_EMAIL_MAIL_DELETED );
-			}        
+            {   
+            //Open the previous message or navigate back to list viewer
+            if ( available )
+                {
+                iAppUi.MoveToPreviousMsgAfterDeleteL( prevMsgId );              
+                }   
+            else
+                {
+                ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY );
+                NavigateBackL();
+                }
+            //inform user that mail is deleted  
+            TFsEmailUiUtility::ShowGlobalInfoNoteL( R_FREESTYLE_EMAIL_MAIL_DELETED );
+            }        
         }
     }
 
@@ -1306,9 +1302,12 @@
 
         for ( TInt i = 0 ; i < removedEntries->Count() && cont; i++ )
             {
-            if ( curMsgId == ( *removedEntries )[i] )
+            if ( ( curMsgId == ( *removedEntries )[i] ) &&
+                    (iDeletedMessageFromMrui != curMsgId) )
                 {                
                 cont = EFalse;
+                ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY );
+                HandleCommandL( EAknSoftkeyBack );
                 }            
             } 
         }
@@ -1430,10 +1429,10 @@
                 }
             break;
             case EFsEmailUiCmdActionsAddContact:
-			   {
-			   SaveEmailAsContactL( aEmailAddress );
-			   }
-			   break;
+               {
+               SaveEmailAsContactL( aEmailAddress );
+               }
+               break;
             case EFsEmailUiCmdActionsCall:
                 {
                 CallAdressL( aEmailAddress, EFalse );
@@ -1455,9 +1454,9 @@
                 }
             break;
             case EFsEmailUiCmdActionsCopyToClipboard:
-            	{
-            	CopyCurrentToClipBoardL( aEmailAddress );
-            	}
+                {
+                CopyCurrentToClipBoardL( aEmailAddress );
+                }
             break;
             default:
                 //nothing right now?
@@ -1474,23 +1473,23 @@
     {
     FUNC_LOG;
     switch ( aCommand )
-    	{
-    	case EFsEmailUiCmdActionsOpenWeb:
-    		{
-    		OpenLinkInBrowserL( aUrl );
-    		break;
-    		}
-		case EFsEmailUiCmdActionsAddBookmark:
-			{
-			SaveWebAddressToFavouritesL( aUrl );
-			break;
-			}
-		case EFsEmailUiCmdActionsCopyWWWAddressToClipboard:
-			{
-			CopyCurrentToClipBoardL( aUrl );
-			break;
-			}    				
-    	}
+        {
+        case EFsEmailUiCmdActionsOpenWeb:
+            {
+            OpenLinkInBrowserL( aUrl );
+            break;
+            }
+        case EFsEmailUiCmdActionsAddBookmark:
+            {
+            SaveWebAddressToFavouritesL( aUrl );
+            break;
+            }
+        case EFsEmailUiCmdActionsCopyWWWAddressToClipboard:
+            {
+            CopyCurrentToClipBoardL( aUrl );
+            break;
+            }                   
+        }
     }
 
 void CFsEmailUiHtmlViewerView::SaveEmailAsContactL(
@@ -1732,7 +1731,7 @@
 TBool CFsEmailUiHtmlViewerView::IsEmbeddedMsgSavingAllowed()
     {
     return iMailBox->HasCapability( 
-				EFSMboxCapaSupportsSavingOfEmbeddedMessages );
+                EFSMboxCapaSupportsSavingOfEmbeddedMessages );
     }
 
 void CFsEmailUiHtmlViewerView::UpdateDownloadIndicatorL( 
@@ -1884,16 +1883,16 @@
 void CFsEmailUiHtmlViewerView::SendEventToAppUiL( TFSMailEvent aEventType )
     {
     if ( iMessage )
-    	{
-		RArray<TFSMailMsgId> msgIdArray;
-		CleanupClosePushL( msgIdArray );
-		msgIdArray.AppendL( iMessage->GetMessageId() );
-		TFSMailMsgId folderId = iMessage->GetFolderId();
-		iAppUi.EventL( aEventType,
-					   iAppUi.GetActiveMailboxId(),
-					   &msgIdArray, &folderId, NULL );
-		CleanupStack::PopAndDestroy( &msgIdArray );
-    	}
+        {
+        RArray<TFSMailMsgId> msgIdArray;
+        CleanupClosePushL( msgIdArray );
+        msgIdArray.AppendL( iMessage->GetMessageId() );
+        TFSMailMsgId folderId = iMessage->GetFolderId();
+        iAppUi.EventL( aEventType,
+                       iAppUi.GetActiveMailboxId(),
+                       &msgIdArray, &folderId, NULL );
+        CleanupStack::PopAndDestroy( &msgIdArray );
+        }
     }
 // -----------------------------------------------------------------------------
 // CFsEmailUiHtmlViewerView::ChangeMsgReadStatusL
@@ -2313,11 +2312,11 @@
         if (  iContainer )
             {
             iContainer->ResetContent();                
-			if( iMessage )
-				{
-				LoadContentFromMailMessageL( iMessage , EFalse);  
-				SetMskL();
-				}
+            if( iMessage )
+                {
+                LoadContentFromMailMessageL( iMessage , EFalse);  
+                SetMskL();
+                }
             }
         }
             
@@ -3010,9 +3009,9 @@
     FUNC_LOG;
     // Reload mail header.
     if ( iContainer )
-    	{
-    	iContainer->RefreshCurrentMailHeader();
-    	}
+        {
+        iContainer->RefreshCurrentMailHeader();
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -3050,7 +3049,7 @@
 // CFsEmailUiHtmlViewerView::CopyToClipBoardL
 // -----------------------------------------------------------------------------
 void CFsEmailUiHtmlViewerView::CopyCurrentToClipBoardL( const TDesC& aArgument ) const
-	{
+    {
     FUNC_LOG;
     
     // Making sure that we are copying something to the clipboard 
@@ -3058,92 +3057,92 @@
         {
         HBufC* clipBoardText = aArgument.AllocLC();
         CClipboard* cb = CClipboard::NewForWritingLC( CCoeEnv::Static()->FsSession() );
-		cb->StreamDictionary().At( KClipboardUidTypePlainText );
-		CPlainText* plainText = CPlainText::NewL();
-		CleanupStack::PushL( plainText );
-		plainText->InsertL( 0 , *clipBoardText );
-		plainText->CopyToStoreL( cb->Store(), cb->StreamDictionary(), 0, plainText->DocumentLength() );
-		CleanupStack::PopAndDestroy( plainText );
-		cb->CommitL();
-		CleanupStack::PopAndDestroy( cb );
-		CleanupStack::PopAndDestroy( clipBoardText );     
+        cb->StreamDictionary().At( KClipboardUidTypePlainText );
+        CPlainText* plainText = CPlainText::NewL();
+        CleanupStack::PushL( plainText );
+        plainText->InsertL( 0 , *clipBoardText );
+        plainText->CopyToStoreL( cb->Store(), cb->StreamDictionary(), 0, plainText->DocumentLength() );
+        CleanupStack::PopAndDestroy( plainText );
+        cb->CommitL();
+        CleanupStack::PopAndDestroy( cb );
+        CleanupStack::PopAndDestroy( clipBoardText );     
         }
-	}
+    }
 
 // --------------------------------------------------------------------------------
 // CFsEmailUiHtmlViewerView::OpenLinkInBrowserL
 // --------------------------------------------------------------------------------
 void CFsEmailUiHtmlViewerView::OpenLinkInBrowserL( const TDesC& aUrl ) const
-	{
-	FUNC_LOG;
-	
-	// Create session
-	RApaLsSession session;
-	User::LeaveIfError( session.Connect() );
-	CleanupClosePushL( session );
-	 
-	// Gets the default application UID for for the given MIME type
-	TUid uid;
-	TDataType dataType( _L8( "text/html" ) );
-	session.AppForDataType( dataType, uid );
-	 
-	// Runs the default application using the dataType
-	TThreadId threadId;
-	User::LeaveIfError( session.StartDocument( aUrl , dataType, threadId ) );
-	 
-	CleanupStack::PopAndDestroy(); // session
+    {
+    FUNC_LOG;
+    
+    // Create session
+    RApaLsSession session;
+    User::LeaveIfError( session.Connect() );
+    CleanupClosePushL( session );
+     
+    // Gets the default application UID for for the given MIME type
+    TUid uid;
+    TDataType dataType( _L8( "text/html" ) );
+    session.AppForDataType( dataType, uid );
+     
+    // Runs the default application using the dataType
+    TThreadId threadId;
+    User::LeaveIfError( session.StartDocument( aUrl , dataType, threadId ) );
+     
+    CleanupStack::PopAndDestroy(); // session
 }
 
 // --------------------------------------------------------------------------------
 // CFsEmailUiHtmlViewerView::SaveWebAddressToFavouritesL
 // --------------------------------------------------------------------------------
 void CFsEmailUiHtmlViewerView::SaveWebAddressToFavouritesL( const TDesC& aUrl ) const
-	{
-	FUNC_LOG;
-	HBufC* url = aUrl.AllocLC();
-	
-	RFavouritesSession fSession;
-	User::LeaveIfError( fSession.Connect() );
-	CleanupClosePushL( fSession );
+    {
+    FUNC_LOG;
+    HBufC* url = aUrl.AllocLC();
+    
+    RFavouritesSession fSession;
+    User::LeaveIfError( fSession.Connect() );
+    CleanupClosePushL( fSession );
 
-	RFavouritesDb favourites;
-	User::LeaveIfError( favourites.Open( fSession, KBrowserBookmarks ) );
-	CleanupClosePushL( favourites );
+    RFavouritesDb favourites;
+    User::LeaveIfError( favourites.Open( fSession, KBrowserBookmarks ) );
+    CleanupClosePushL( favourites );
 
-	CFavouritesItem *favouritesItem = CFavouritesItem::NewLC();
-	favouritesItem->SetType( CFavouritesItem::EItem );
-	favouritesItem->SetUrlL( aUrl );
-	// Should be less than KFavouritesMaxName ( 50 )
-	if ( url->Length() > KFavouritesMaxName )
-		{
-		favouritesItem->SetNameL( url->Left( KFavouritesMaxName ) );
-		}
-	else
-		{
-		favouritesItem->SetNameL( *url );
-		}
+    CFavouritesItem *favouritesItem = CFavouritesItem::NewLC();
+    favouritesItem->SetType( CFavouritesItem::EItem );
+    favouritesItem->SetUrlL( aUrl );
+    // Should be less than KFavouritesMaxName ( 50 )
+    if ( url->Length() > KFavouritesMaxName )
+        {
+        favouritesItem->SetNameL( url->Left( KFavouritesMaxName ) );
+        }
+    else
+        {
+        favouritesItem->SetNameL( *url );
+        }
 
-	favouritesItem->SetParentFolder( KFavouritesRootUid );
+    favouritesItem->SetParentFolder( KFavouritesRootUid );
 
-	TInt error = favourites.Add( *favouritesItem, ETrue );
+    TInt error = favourites.Add( *favouritesItem, ETrue );
 
-	CleanupStack::PopAndDestroy( favouritesItem );
-	CleanupStack::PopAndDestroy( &favourites );
-	CleanupStack::PopAndDestroy( &fSession );
+    CleanupStack::PopAndDestroy( favouritesItem );
+    CleanupStack::PopAndDestroy( &favourites );
+    CleanupStack::PopAndDestroy( &fSession );
 
-	CleanupStack::PopAndDestroy( url );
-	
-	if ( error == KErrNone )
-		{
-		TFsEmailUiUtility::ShowInfoNoteL(
-			R_FREESTYLE_EMAIL_UI_VIEWER_BOOKMARK_ADDED, ETrue );
-		}
-	else // Error in bookmark creation, show could not complete message
-		{
-		TFsEmailUiUtility::ShowErrorNoteL(
-			R_FREESTYLE_EMAIL_ERROR_GENERAL_UNABLE_TO_COMPLETE, ETrue );
-		}
-	}
+    CleanupStack::PopAndDestroy( url );
+    
+    if ( error == KErrNone )
+        {
+        TFsEmailUiUtility::ShowInfoNoteL(
+            R_FREESTYLE_EMAIL_UI_VIEWER_BOOKMARK_ADDED, ETrue );
+        }
+    else // Error in bookmark creation, show could not complete message
+        {
+        TFsEmailUiUtility::ShowErrorNoteL(
+            R_FREESTYLE_EMAIL_ERROR_GENERAL_UNABLE_TO_COMPLETE, ETrue );
+        }
+    }
 
 /*
  * Delaying the fetch for MfE till the user scrolls to the bottom of 
@@ -3174,6 +3173,38 @@
            }
        }
     }
+
+void CFsEmailUiHtmlViewerView::CheckMessageBodyL( CFSMailMessage& aMessage, TBool& aMessageBodyStructurePresent, TBool& aMessageBodyContentPresent)
+    {
+    CFSMailMessagePart* bodyPart = iMessage->HtmlBodyPartL();
+    if ( !bodyPart )
+        {
+        bodyPart = iMessage->PlainTextBodyPartL();
+        }
+    
+    if ( bodyPart )
+        {
+        aMessageBodyStructurePresent = ETrue;
+        CleanupStack::PushL( bodyPart );
+
+        if ( bodyPart->FetchedContentSize() == 0 && bodyPart->ContentSize() != 0 )
+            {
+            aMessageBodyContentPresent = EFalse;
+            }
+        else
+            {
+            aMessageBodyContentPresent = ETrue;
+            }
+        
+        CleanupStack::PopAndDestroy( bodyPart );
+        }
+    else
+        {
+        aMessageBodyStructurePresent = EFalse;
+        aMessageBodyContentPresent = EFalse;
+        }
+    }
+
 //////////////////////////////////////////////////////////////////////////////////////
 // CLASS IMPLEMENTATION CHANGE TO FLAG DIALOG GLOBAL NOTE
 ///////////////////////////////////////////////////////////////////////////////////
--- a/emailuis/emailui/src/FreestyleEmailUiLauncherGridVisualiser.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiLauncherGridVisualiser.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -35,10 +35,10 @@
 #include <freestyleemailui.mbg>
 #include <gulicon.h>
 #include <akntoolbar.h>
-#include "CFSMailMessage.h"
+#include "cfsmailmessage.h"
 #include <alf/alfframebrush.h>
-#include "CFSMailBox.h"
-#include "CFSMailClient.h"
+#include "cfsmailbox.h"
+#include "cfsmailclient.h"
 #include <hlplch.h>
 #include <akntitle.h>
 #include <centralrepository.h>
--- a/emailuis/emailui/src/FreestyleEmailUiMailListModel.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiMailListModel.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 // SYSTEM INCLUDES
 //<cmail>
 #include "emailtrace.h"
-#include "CFSMailMessage.h"
+#include "cfsmailmessage.h"
 //</cmail>
 
 
--- a/emailuis/emailui/src/FreestyleEmailUiMailListVisualiser.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiMailListVisualiser.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -24,9 +24,9 @@
 #include <StringLoader.h>
 #include <FreestyleEmailUi.rsg>
 #include <featmgr.h>
-#include "CFSMailClient.h"
-#include "CFSMailBox.h"
-#include "CFSMailFolder.h"
+#include "cfsmailclient.h"
+#include "cfsmailbox.h"
+#include "cfsmailfolder.h"
 #include "fscontrolbar.h"
 #include "fscontrolbuttoninterface.h"
 #include "fstreelist.h"
@@ -35,7 +35,7 @@
 #include "fstreeplainonelinenodevisualizer.h"
 #include "fstreeplaintwolineitemdata.h"
 #include "fstreeplaintwolineitemvisualizer.h"
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 #include "ceuiemaillisttouchmanager.h"
 #include "FSEmailBuildFlags.h"
 #include "cfsccontactactionmenu.h"
@@ -52,9 +52,9 @@
 #include <aknnotewrappers.h>
 #include <msvapi.h>
 #include <akntitle.h>
-#include "ESMailSettingsPluginUids.hrh"
-#include "ESMailSettingsPlugin.h"
-#include "MFSMailBrandManager.h"
+#include "esmailsettingspluginuids.hrh"
+#include "esmailsettingsplugin.h"
+#include "mfsmailbrandmanager.h"
 #include <AknWaitDialog.h>
 #include <aknlayoutscalable_apps.cdl.h>
 #include <layoutmetadata.cdl.h>
@@ -78,7 +78,7 @@
 #include "FreestyleEmailUiMailListControl.h"
 #include "FreestyleEmailUiMailViewerVisualiser.h"
 #include "FreestyleEmailUiStatusIndicator.h"
-#include "FreestyleEmailCenRepHandler.h"
+#include "freestyleemailcenrephandler.h"
 #include "FreestyleEmailUiFolderListVisualiser.h"
 #include "FreestyleEmailUiShortcutBinding.h"
 #include "FreestyleEmailUiMsgDetailsVisualiser.h"
@@ -470,7 +470,8 @@
     iEnv( aEnv ),
     iListMarkItemsState( ETrue ), //Initlly list has no markings
     iMoveToFolderOngoing( EFalse ),
-    iConsumeStdKeyYes_KeyUp( EFalse ) // use to prevent Call application execution if call for contact processed
+    iConsumeStdKeyYes_KeyUp( EFalse ), // use to prevent Call application execution if call for contact processed
+    iMailOpened(EFalse)
 	{
     FUNC_LOG;
 	}
@@ -601,6 +602,7 @@
         }
     SetListAndCtrlBarFocusL();
     iAppUi.StartMonitoringL();
+    TIMESTAMP( "Locally stored messages fetched for message list" );    
     }
 
 // ---------------------------------------------------------------------------
@@ -1041,6 +1043,7 @@
     TInt idx = KErrNotFound;
     TFsTreeItemId parentId = KFsTreeRootID;
     TInt childIdx = KErrNotFound;
+    TInt moveViewPortPosition = 0;
 
     if ( !iNodesInUse )
         {
@@ -1079,6 +1082,7 @@
                 TInt nodeIdxUnderRoot = iMailList->ChildIndex( KFsTreeRootID, nextNodeId );
                 InsertNodeItemL( idx-1, nodeIdxUnderRoot, aAllowRefresh );
                 }
+            moveViewPortPosition += iAppUi.LayoutHandler()->OneLineListItemHeight(); 
             }
         else
             {
@@ -1093,7 +1097,23 @@
     CleanupStack::Pop( newItem );
 
     // Insert the tree list item
-    InsertListItemL( idx, parentId, childIdx, aAllowRefresh );
+    TPoint viewPortCenterPos = iMailTreeListVisualizer->ViewPosition();
+    TPoint viewPortTopPos = iMailTreeListVisualizer->ViewPortTopPosition();
+    TInt itemPos = iMailTreeListVisualizer->GetItemWorldPosition( idx );
+    TBool refresh = viewPortTopPos.iY != 0 && itemPos < viewPortCenterPos.iY;
+     
+    if( refresh )
+    	{
+		InsertListItemL( idx, parentId, childIdx, EFalse );
+		// viewPort update needed
+		moveViewPortPosition += iAppUi.LayoutHandler()->TwoLineListItemHeight(); // add mail item height
+		viewPortCenterPos.iY += moveViewPortPosition;
+		iMailTreeListVisualizer->ViewPositionChanged( viewPortCenterPos, EFalse, 1 );
+    	}
+    else
+    	{
+    	InsertListItemL( idx, parentId, childIdx, aAllowRefresh );
+    	}
 
     // Move focus after insertion if necessary
     if ( firstItemWasFocused )
@@ -1224,6 +1244,7 @@
                      const TDesC8& aCustomMessage)
 	{
     FUNC_LOG;
+    TIMESTAMP( "Opening message list view" );
     iShowReplyAll = EFalse;
 
 	if ( !iFirstStartCompleted )
@@ -1491,7 +1512,7 @@
 	iThisViewActive = ETrue;
 
 	// Set email indicator off.. user has checked the new emails
-	TFsEmailUiUtility::ToggleEmailIconL(EFalse);
+	TFsEmailUiUtility::ToggleEmailIconL(EFalse, activationData.iMailBoxId );
 
 	iShiftDepressed = EFalse; // clear state just in case
 
@@ -1511,6 +1532,7 @@
 	UpdateButtonTextsL();
 	FocusVisibilityChange( iAppUi.IsFocusShown() );
 	iAppUi.ShowTitlePaneConnectionStatus();
+	TIMESTAMP( "Message list view opened" );
 	}
 
 // ---------------------------------------------------------------------------
@@ -1610,7 +1632,30 @@
 
     // MAIN MENU ***************************************************************************
 	if ( aResourceId == R_FSEMAILUI_MAILLIST_MENUPANE )
-		{
+	    {
+            // Sync/cancel sync
+	    CFSMailBox* activeMailbox = iAppUi.GetActiveMailbox();
+	    TBool supportsSync = activeMailbox->HasCapability( EFSMBoxCapaSupportsSync );
+                
+            // flag to hide or show SyncButton
+            TBool hideSync = GetLatestSyncState();
+            if(activeMailbox->CurrentSyncState()==StartingSync) hideSync=EFalse;
+        
+            // hide or show options: Sync/cancel sync
+            if ( !supportsSync )
+                {
+                aMenuPane->SetItemDimmed( EFsEmailUiCmdCancelSync, ETrue );
+                aMenuPane->SetItemDimmed( EFsEmailUiCmdSync, ETrue );
+                }
+             else if ( hideSync || iMailListModelUpdater->IsUpdating() )
+                {
+                aMenuPane->SetItemDimmed( EFsEmailUiCmdSync, ETrue );
+                }
+             else
+                {
+                aMenuPane->SetItemDimmed( EFsEmailUiCmdCancelSync, ETrue );
+                }
+ 	
 		// Saves a focus visibility.
 		iLastFocus = EFalse;
 		if( iFocusedControl == EMailListComponent && IsFocusShown() )
@@ -1902,6 +1947,9 @@
 	iMailList->RemoveAllL();
 	iTreeItemArray.Reset();
 
+    // when we get refresh mail list updates should be fully enabled	
+    iMailOpened = EFalse;
+	
 	RefreshListItemsL();
 
 	if ( !iModel->Count() )
@@ -2998,10 +3046,14 @@
 // If there is a need to refresh the list.
 // ---------------------------------------------------------------------------
 //
-void CFSEmailUiMailListVisualiser::HandleForegroundEventL()
+void CFSEmailUiMailListVisualiser::HandleForegroundEventL( TBool aForeground )
 	{
     FUNC_LOG;
-	if ( iFirstStartCompleted ) // Safety
+    if( iMailFolder ) 
+        {
+        TFsEmailUiUtility::ToggleEmailIconL(EFalse, iMailFolder->GetMailBoxId() );
+        }
+    if ( aForeground && iFirstStartCompleted ) // Safety
 	    {
 	    // Update mail list settings and date formats, is done every time
 	    // the user might have changed these in settings, so the list needs to refresh
@@ -3075,6 +3127,7 @@
 void CFSEmailUiMailListVisualiser::HandleCommandL( TInt aCommand )
     {
     FUNC_LOG;
+    TIMESTAMP( "Message list command for handling" );
     CompletePendingRefresh();
 
     // custom command handling for launching plugin settings
@@ -3133,6 +3186,7 @@
         {
     	case EAknSoftkeyOpen:
             {
+            TIMESTAMP( "Open email selected from message list" );
             if( !iAppUi.IsFocusShown() )
                 {
                 iAppUi.SetFocusVisibility( ETrue );
@@ -3141,6 +3195,7 @@
             }
        	case EAknSoftkeySelect:
        	    {
+       	    TIMESTAMP( "Open email selected from message list" );    
        	    if ( iFocusedControl == EMailListComponent )
        	        {
        	        CFSEmailUiMailListModelItem* item = dynamic_cast<CFSEmailUiMailListModelItem*>(iModel->Item(HighlightedIndex()));
@@ -3211,22 +3266,26 @@
         case EEikCmdExit:
         case EAknSoftkeyExit:
         case EFsEmailUiCmdExit:
+            TIMESTAMP( "Exit selected from message list" );
             iAppUi.Exit();
             break;
        	case EFsEmailUiCmdCalActionsReplyAsMail:
 		case EFsEmailUiCmdActionsReply:
 			{
+			TIMESTAMP( "Reply to selected from message list" );
    	   	 	ReplyL( NULL ); // Function will check marked/highlighted msg
 			}
             break;
 		case EFsEmailUiCmdActionsReplyAll:
 			{
+			TIMESTAMP( "Reply to all selected from message list" );
 			ReplyAllL( NULL ); // Function will check marked/highlighted msg
 			}
             break;
        	case EFsEmailUiCmdCalActionsForwardAsMail:
 		case EFsEmailUiCmdActionsForward:
 			{
+			TIMESTAMP( "Forward selected from message list" );
            	ForwardL( NULL ); // Function will check marked/highlighted msg
 			}
             break;
@@ -3346,6 +3405,7 @@
        	case EFsEmailUiCmdActionsDeleteCalEvent:
 		case EFsEmailUiCmdActionsDelete:
 			{
+			TIMESTAMP( "Delete to selected from message list" );    
 			TInt index = HighlightedIndex();
 			CFSEmailUiMailListModelItem* item =
 				dynamic_cast<CFSEmailUiMailListModelItem*>(
@@ -3370,6 +3430,7 @@
             break;
 		case EFsEmailUiCmdCompose:
 			{
+			TIMESTAMP( "Create new message selected from message list" );    
 			CreateNewMsgL();
 			}
 			break;
@@ -3421,6 +3482,7 @@
        	case EFsEmailUiCmdOpen:
         case EFsEmailUiCmdActionsOpen:
         	{
+        	TIMESTAMP( "Open email selected from message list" );        
 	        if ( iFocusedControl == EMailListComponent )
 	            {
 	            // Opening can happen only when there's exactly one message marked or in focus
@@ -3536,18 +3598,21 @@
 			        iAppUi.SyncActiveMailBoxL();
 			        // Sync was started by the user
 			        ManualMailBoxSync(ETrue);
-                    iAppUi.ManualMailBoxSync( ETrue );
+                                iAppUi.ManualMailBoxSync( ETrue );
 			        }
 			    }
 			}
 			break;
        	case EFsEmailUiCmdCancelSync:
        		{
-			TBool supportsSync = iAppUi.GetActiveMailbox()->HasCapability( EFSMBoxCapaSupportsSync );
-			if ( supportsSync )
-				{
-	       		iAppUi.StopActiveMailBoxSyncL();
-				}
+		TBool supportsSync = iAppUi.GetActiveMailbox()->HasCapability( EFSMBoxCapaSupportsSync );
+		if ( supportsSync )
+		    {
+	            iAppUi.StopActiveMailBoxSyncL();
+	            // Sync was started by the user
+	            ManualMailBoxSync(ETrue);
+	            iAppUi.ManualMailBoxSync( ETrue );
+		    }
        		}
        		break;
         case EFsEmailUiCmdGoOffline:
@@ -3781,6 +3846,7 @@
         	break;
         } // switch ( aCommand )
     CleanupStack::PopAndDestroy( &actionTargetItems );
+    TIMESTAMP( "Message list selected operation done" );    
     }
 
 // ---------------------------------------------------------------------------
@@ -4339,6 +4405,7 @@
                                 CFSMailMessage* messagePtr = &item->MessagePtr();
                                 if ( messagePtr )
                                     {
+                                    TIMESTAMP( "Open email selected from message list" );    
                                     OpenHighlightedMailL();
                                     return EKeyWasConsumed;
                                     }
@@ -4551,6 +4618,7 @@
             CFSMailMessage* messagePtr = &item->MessagePtr();
             if ( messagePtr )
                 {
+                TIMESTAMP( "Open email selected from message list" );
                 OpenHighlightedMailL();
                 }
             }
@@ -5330,8 +5398,11 @@
                 }
             msgPtr.SaveMessageL();  // Save flag
 
-            // Switch icon to correct one
-            UpdateMsgIconAndBoldingL( aIndex );
+            if ( !iMailOpened )
+                {
+                // Switch icon to correct one if mail list is visible
+                UpdateMsgIconAndBoldingL( aIndex );
+                }
 
             if ( iCurrentSortCriteria.iField == EFSMailSortByUnread )
                 {
@@ -5616,6 +5687,17 @@
         	    }
     		}
 	    }
+	if ( aEntryIds.Count() > 0  )
+		{
+        if ( iMailListUpdater )
+            {
+            if ( iMailListUpdater->IsActive() )
+                {
+                iMailListUpdater->Stop();
+                }
+             iMailListUpdater->StartL();
+             }
+		}
 	if ( iNodesInUse )
 		{
 		RemoveUnnecessaryNodesL();
@@ -6400,6 +6482,8 @@
 	                iMailFolder->GetFolderId(), item->MessagePtr().GetMessageId(), EFSMsgDataEnvelope );
 	        if ( confirmedMsgPtr )
 	            {
+	            iMailOpened = ETrue;
+	            
 	            ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY );
 	            // Pointer confirmed, store Id and delete not needed anymore
 	            TFSMailMsgId confirmedId = confirmedMsgPtr->GetMessageId();
@@ -6489,7 +6573,7 @@
     iDateChanged = ETrue;
     if ( iAppUi.IsForeground() )
         {
-        HandleForegroundEventL();
+        HandleForegroundEventL(ETrue);
         }
     }
 
@@ -6566,50 +6650,53 @@
 	// Check mail list item's type
 	CFSEmailUiMailListModelItem* item =
 		static_cast<CFSEmailUiMailListModelItem*>( iModel->Item( HighlightedIndex() ) );
-	if ( item && item->ModelItemType() == ETypeMailItem )
+	if ( item )
 		{
-		// Add mark as read / unread options
-		iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, !IsMarkAsUnreadAvailableL() );
-		iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsRead, !IsMarkAsReadAvailableL() );
-
-		// Check support for object mail iten moving
-		TBool supportsMoving = iAppUi.GetActiveMailbox()->HasCapability( EFSMBoxCapaMoveToFolder );
-		iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, !supportsMoving );
-
-		// Hide / show follow up
-		TBool supportsFlag = TFsEmailUiUtility::IsFollowUpSupported( *iAppUi.GetActiveMailbox() );
-		iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsFlag, !supportsFlag );
-
-		// Hide mark if applicable
-		if ( iMailList->IsMarked( iMailList->FocusedItem() ) )
+		if ( item->ModelItemType() == ETypeMailItem )
 			{
-			iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMark, ETrue );
-			}
-
-		// Hide collapse / expand all
-		iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsCollapseAll, ETrue );
-		iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsExpandAll, ETrue );
-		}
-	else if ( item->ModelItemType() == ETypeSeparator )
-		{
-		// Hide mark as read / unread options
-		iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, ETrue );
-		iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsRead, ETrue );
-
-		// Hide move & follow up
-		iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, ETrue );
-		iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsFlag, ETrue );
-
-		// Hide collapse / expand all when applicable
-		if ( iNodesInUse == EListControlSeparatorDisabled || !iModel->Count() )
-			{
+			// Add mark as read / unread options
+			iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, !IsMarkAsUnreadAvailableL() );
+			iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsRead, !IsMarkAsReadAvailableL() );
+	
+			// Check support for object mail iten moving
+			TBool supportsMoving = iAppUi.GetActiveMailbox()->HasCapability( EFSMBoxCapaMoveToFolder );
+			iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, !supportsMoving );
+	
+			// Hide / show follow up
+			TBool supportsFlag = TFsEmailUiUtility::IsFollowUpSupported( *iAppUi.GetActiveMailbox() );
+			iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsFlag, !supportsFlag );
+	
+			// Hide mark if applicable
+			if ( iMailList->IsMarked( iMailList->FocusedItem() ) )
+				{
+				iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMark, ETrue );
+				}
+	
+			// Hide collapse / expand all
 			iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsCollapseAll, ETrue );
 			iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsExpandAll, ETrue );
 			}
-		else
+		else if ( item->ModelItemType() == ETypeSeparator )
 			{
-			iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsCollapseAll, AllNodesCollapsed() );
-			iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsExpandAll, AllNodesExpanded() );
+			// Hide mark as read / unread options
+			iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, ETrue );
+			iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdMarkAsRead, ETrue );
+	
+			// Hide move & follow up
+			iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, ETrue );
+			iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsFlag, ETrue );
+	
+			// Hide collapse / expand all when applicable
+			if ( iNodesInUse == EListControlSeparatorDisabled || !iModel->Count() )
+				{
+				iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsCollapseAll, ETrue );
+				iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsExpandAll, ETrue );
+				}
+			else
+				{
+				iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsCollapseAll, AllNodesCollapsed() );
+				iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdActionsExpandAll, AllNodesExpanded() );
+				}
 			}
 		}
 
@@ -6851,28 +6938,31 @@
 			}
 		else if ( aEvent == TFSEventMailChanged && iMailFolder ) // Added iMailFolder null safety check
 			{
-			// Change mail item icon or read status
-			RArray<TFSMailMsgId>* entries = static_cast<RArray<TFSMailMsgId>*>( aParam1 );
-			TFSMailMsgId* parentFolderId = static_cast<TFSMailMsgId*>( aParam2 );
-			TFSMailMsgId currentFolderId = iMailFolder->GetFolderId();
-			if ( *parentFolderId == currentFolderId )
-				{
- 	 			// Refresh mailfolder to get correct actual data
-				/*
-                iMailListModelUpdater->Cancel();
-                SafeDelete(iMailFolder);
-				iMailFolder = iAppUi.GetMailClient()->GetFolderByUidL( aMailboxId, currentFolderId );
-				*/
-				for ( TInt i=0 ; i<entries->Count() ; i++ )
-					{
-					TFSMailMsgId msgId = (*entries)[i];
-					TInt idx = ItemIndexFromMessageId( msgId );
-					if ( idx != KErrNotFound )
-					    {
-					    UpdateItemAtIndexL( idx );
-					    }
-					}
-				}
+			if ( !iMailOpened ) // do not handle mail changed while viewer/editor is open. This may cause flickering
+			    {
+    			// Change mail item icon or read status
+    			RArray<TFSMailMsgId>* entries = static_cast<RArray<TFSMailMsgId>*>( aParam1 );
+    			TFSMailMsgId* parentFolderId = static_cast<TFSMailMsgId*>( aParam2 );
+    			TFSMailMsgId currentFolderId = iMailFolder->GetFolderId();
+    			if ( *parentFolderId == currentFolderId )
+    				{
+     	 			// Refresh mailfolder to get correct actual data
+    				/*
+                    iMailListModelUpdater->Cancel();
+                    SafeDelete(iMailFolder);
+    				iMailFolder = iAppUi.GetMailClient()->GetFolderByUidL( aMailboxId, currentFolderId );
+    				*/
+    				for ( TInt i=0 ; i<entries->Count() ; i++ )
+    					{
+    					TFSMailMsgId msgId = (*entries)[i];
+    					TInt idx = ItemIndexFromMessageId( msgId );
+    					if ( idx != KErrNotFound )
+    					    {
+    					    UpdateItemAtIndexL( idx );
+    					    }
+    					}
+    				}
+			    }
 			}
    		else if ( aEvent == TFSEventMailboxSyncStateChanged )
    			{
@@ -6882,14 +6972,25 @@
 	    		switch ( *newSyncState )
 	    			{
 	    			case StartingSync:
-	   					{
-	   					//If sync was started by user, show the synchronisation indicator
-	   					if ( iManualMailBoxSync )
-	   						{
-			   		     	ManualMailBoxSync(EFalse);
-	   						}
-		   				}
-						break;
+	   			    {
+	   			    //If sync was started by user, show the synchronisation indicator
+	   			    if ( iManualMailBoxSync )
+	   			        {
+			   		ManualMailBoxSync(EFalse);
+	   				}
+		   		    }
+				    break;
+						
+	    			case SyncCancelled:
+	    			    {
+	    			    //If sync was started by user, show the synchronisation indicator
+	    			    if ( iManualMailBoxSync )
+	    			        {
+	    			        ManualMailBoxSync(EFalse);
+	    			        }
+	    			    }
+	    			    break;
+						
 	    			}
     			}
 			}
--- a/emailuis/emailui/src/FreestyleEmailUiMailViewerRichText.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiMailViewerRichText.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -12,7 +12,7 @@
 * Contributors:
 *
 * Description: FreestyleEmailUi mail viewer rich text implementation
-* Version    : %version: 48 %
+* Version    : %version: e003sa37#49 %
 *
 */
 
@@ -27,9 +27,9 @@
 //<cmail>
 #include "fstextviewer.h"
 #include "fsrichtext.h"
-#include "CFSMailMessagePart.h"
-#include "CFSMailClient.h"
-#include "CFSMailCommon.h"
+#include "cfsmailmessagepart.h"
+#include "cfsmailclient.h"
+#include "cfsmailcommon.h"
 //</cmail>
 #include <txtfrmat.h>
 // <cmail> SF
--- a/emailuis/emailui/src/FreestyleEmailUiMailViewerVisualiser.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiMailViewerVisualiser.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -40,12 +40,12 @@
 #include <commonphoneparser.h>
 #include <browserlauncher.h>
 //<cmail>
-#include "CFSMailMessagePart.h"
-#include "CFSMailClient.h"
+#include "cfsmailmessagepart.h"
+#include "cfsmailclient.h"
 //</cmail>
 #include <apgcli.h>
 //<cmail>
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 //</cmail>
 #include <featmgr.h>
 //</cmail>
@@ -79,12 +79,12 @@
 #include <AiwMenu.h>
 
 // for opening normal browser
-#include <BrowserOverriddenSettings.h>
-#include <BrowserLauncher.h>
+#include <browseroverriddensettings.h>
+#include <browserlauncher.h>
 
 // for bookmarks
-#include <FavouritesLimits.h>   // KBrowserBookmarks
-#include <FavouritesDb.h>
+#include <favouriteslimits.h>   // KBrowserBookmarks
+#include <favouritesdb.h>
 
 // for fonts
 #include <AknFontAccess.h>
@@ -114,7 +114,7 @@
 // </cmail>
 #include <aknnotewrappers.h>
 
-#include <SchemeHandler.h> // CSchemeHandler
+#include <schemehandler.h> // CSchemeHandler
 
 // <cmail>
 #include "FreestyleEmailUiConstants.h"
@@ -125,7 +125,7 @@
 #include "FreestyleEmailUiMailListVisualiser.h"
 #include "FreestyleEmailUiFileSystemInfo.h"
 #include "FreestyleEmailUi.hrh"
-#include "FreestyleEmailCenRepHandler.h"
+#include "freestyleemailcenrephandler.h"
 #include "FreestyleEmailUiLayoutHandler.h"
 #include "FreestyleEmailUiTextureManager.h"
 #include "FreestyleEmailUiMsgDetailsVisualiser.h"
@@ -788,7 +788,7 @@
             }
 
         // Set email indicator off.. user has checked the new emails
-        TFsEmailUiUtility::ToggleEmailIconL( EFalse );
+        TFsEmailUiUtility::ToggleEmailIconL( EFalse, activationData.iMailBoxId );
         }
 
     iNextOrPevMessageSelected = EFalse;
--- a/emailuis/emailui/src/FreestyleEmailUiMsgDetailsModel.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiMsgDetailsModel.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 // SYSTEM INCLUDES
 //<cmail>
 #include "emailtrace.h"
-#include "CFSMailAddress.h"
+#include "cfsmailaddress.h"
 //</cmail>
 
 // INTERNAL INCLUDES
@@ -29,18 +29,18 @@
 // Folder list item constructor.
 // ---------------------------------------------------------------------------
 CFSEmailUiMsgDetailsItem::CFSEmailUiMsgDetailsItem( TFsTreeItemId aListId )
-	: iListId( aListId ), iMailAddress( NULL ), iText( NULL )
-	{
+    : iListId( aListId ), iMailAddress( NULL ), iText( NULL )
+    {
     FUNC_LOG;
-	}
+    }
 
 // ---------------------------------------------------------------------------
 // Folder list item destructor.
 // ---------------------------------------------------------------------------
 CFSEmailUiMsgDetailsItem::~CFSEmailUiMsgDetailsItem()
-	{
+    {
     FUNC_LOG;
-	}
+    }
 
 // ---------------------------------------------------------------------------
 // NewLC
@@ -59,66 +59,66 @@
 // Constructor
 // ---------------------------------------------------------------------------
 CFSEmailUiMsgDetailsModel::CFSEmailUiMsgDetailsModel()
-	{
+    {
     FUNC_LOG;
-	}
+    }
 
 // ---------------------------------------------------------------------------
 // Destructor.
 // ---------------------------------------------------------------------------
 CFSEmailUiMsgDetailsModel::~CFSEmailUiMsgDetailsModel()
-	{
+    {
     FUNC_LOG;
-	RemoveAll();
-	iItemArray.Close();
-	}
+    RemoveAll();
+    iItemArray.Close();
+    }
 
 // ---------------------------------------------------------------------------
 // Add an item to the end of the list.
 // ---------------------------------------------------------------------------
 void CFSEmailUiMsgDetailsModel::AppendL( TFsTreeItemId aListId, CFSMailAddress* aMailAddress )
-	{
+    {
     FUNC_LOG;
-	CFSEmailUiMsgDetailsItem* item = CFSEmailUiMsgDetailsItem::NewLC( aListId );
-	item->iMailAddress = aMailAddress;
-	iItemArray.AppendL( item );
+    CFSEmailUiMsgDetailsItem* item = CFSEmailUiMsgDetailsItem::NewLC( aListId );
+    item->iMailAddress = aMailAddress;
+    iItemArray.AppendL( item );
     CleanupStack::Pop( item );
-	}
+    }
 
 // ---------------------------------------------------------------------------
 // Add an item to the end of the list.
 // ---------------------------------------------------------------------------
 void CFSEmailUiMsgDetailsModel::AppendL( TFsTreeItemId aListId, TDesC* aText )
-	{
+    {
     FUNC_LOG;
-	CFSEmailUiMsgDetailsItem* item = CFSEmailUiMsgDetailsItem::NewLC( aListId );
-	item->iText = aText;
-	iItemArray.AppendL( item );
+    CFSEmailUiMsgDetailsItem* item = CFSEmailUiMsgDetailsItem::NewLC( aListId );
+    item->iText = aText;
+    iItemArray.AppendL( item );
     CleanupStack::Pop( item );
-	}
+    }
 
 // ---------------------------------------------------------------------------
 // Remove item by list item id.
 // ---------------------------------------------------------------------------
 void CFSEmailUiMsgDetailsModel::Remove( TFsTreeItemId aListId )
-	{
+    {
     FUNC_LOG;
-	TInt index = Index( aListId );
-	if( index != KErrNotFound )
-		{
-		delete iItemArray[index];
-		iItemArray.Remove( index );
-		}
-	}
+    TInt index = Index( aListId );
+    if( index != KErrNotFound )
+        {
+        delete iItemArray[index];
+        iItemArray.Remove( index );
+        }
+    }
 
 // ---------------------------------------------------------------------------
 // Remove all items.
-// ---------------------------------------------------------------------------	
+// ---------------------------------------------------------------------------  
 void CFSEmailUiMsgDetailsModel::RemoveAll()
-	{
+    {
     FUNC_LOG;
-	iItemArray.ResetAndDestroy();
-	}
+    iItemArray.ResetAndDestroy();
+    }
 
 // ---------------------------------------------------------------------------
 // Get an item by list item id.
@@ -126,56 +126,56 @@
 // @return NULL if not found.
 // ---------------------------------------------------------------------------
 CFSEmailUiMsgDetailsItem* CFSEmailUiMsgDetailsModel::ItemByListId( TFsTreeItemId aListId ) const
-	{
+    {
     FUNC_LOG;
-	TInt index = Index( aListId );
-	if( index != KErrNotFound )
-		{
-		return iItemArray[ index ];
-		}
-	else
-		{
-		return NULL;
-		}
-	}
-	
+    TInt index = Index( aListId );
+    if( index != KErrNotFound )
+        {
+        return iItemArray[ index ];
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+    
 // ---------------------------------------------------------------------------
 // Get an item by list index.
 // 
 // @return NULL if not found.
 // ---------------------------------------------------------------------------
 CFSEmailUiMsgDetailsItem* CFSEmailUiMsgDetailsModel::ItemByIndex( TInt aModelIndex ) const
-	{
+    {
     FUNC_LOG;
-	return iItemArray[ aModelIndex ];
-	}
+    return iItemArray[ aModelIndex ];
+    }
 
 // ---------------------------------------------------------------------------
 // Get number of items in list.
 // 
 // @return Number of items.
-// ---------------------------------------------------------------------------		
+// ---------------------------------------------------------------------------      
 TInt CFSEmailUiMsgDetailsModel::Count() const
-	{
+    {
     FUNC_LOG;
-	return iItemArray.Count();
-	}
-	
+    return iItemArray.Count();
+    }
+    
 // ---------------------------------------------------------------------------
 // Get the array index of the spcified item.
 // 
 // @return Array index of the item.
-// ---------------------------------------------------------------------------		
+// ---------------------------------------------------------------------------      
 TInt CFSEmailUiMsgDetailsModel::Index( TFsTreeItemId aListId ) const
-	{
+    {
     FUNC_LOG;
-	for( TInt i = 0; i < Count(); i++ )
-		{
-		if( iItemArray[i]->iListId == aListId )
-			{
-			return i;
-			}
-		}
-	return KErrNotFound;
-	}
+    for( TInt i = 0; i < Count(); i++ )
+        {
+        if( iItemArray[i]->iListId == aListId )
+            {
+            return i;
+            }
+        }
+    return KErrNotFound;
+    }
 
--- a/emailuis/emailui/src/FreestyleEmailUiMsgDetailsVisualiser.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiMsgDetailsVisualiser.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -12,7 +12,7 @@
 * Contributors:
 *
 *  Description : FreestyleEmailUi message details view implementation
-*  Version     : %version: e002sa38#46 %
+*  Version     : %version: e003sa37#48 %
 *
 */
 
@@ -37,8 +37,8 @@
 //</cmail>
 
 //<cmail>
-#include "CFSMailMessage.h"
-#include "CFSMailClient.h"
+#include "cfsmailmessage.h"
+#include "cfsmailclient.h"
 //</cmail>
 
 #include "FSEmailBuildFlags.h"
@@ -57,6 +57,7 @@
 #include "fstreeplaintwolineitemdata.h"
 #include "fstreeplaintwolineitemvisualizer.h"
 #include <csxhelp/cmail.hlp.hrh>
+#include "AknWaitDialog.h"
 // </cmail>
 
 // INTERNAL INCLUDES
@@ -101,7 +102,9 @@
     BaseConstructL( R_FSEMAILUI_MAIL_DETAILS_VIEW );
 
     iFirstStartCompleted = EFalse;    
- 
+	iFetchingMessageStructure = EFalse;
+	iAsyncProcessComplete = ETrue;
+	iWaitDialog = NULL;
 	}
 
 // CFSEmailUiMsgDetailsVisualiser::DoFirstStartL()
@@ -271,6 +274,24 @@
 
 	    if ( iViewedMsg ) // Safety check
 	        {
+			//<cmail> 
+			// The code below fetches the mail structure in order to have access to all detail needed. 
+			// IMAP - hasStructure should be always True
+			// POP  - it is False if the message has not been read yet so the code below
+			//        should fetch the message structure
+			iAsyncProcessComplete = ETrue;
+			TBool hasStructure = TFsEmailUiUtility::IsMessageStructureKnown( *iViewedMsg );			 
+			if (!hasStructure)
+				{
+				iWaitDialog = new (ELeave) CAknWaitDialog((REINTERPRET_CAST(CEikDialog**,&iWaitDialog)), EFalse);
+				iWaitDialog->SetCallback(this);
+				iWaitDialog->ExecuteLD(R_FSE_FETCHING_WAIT_DIALOG);
+
+				iDialogNotDismissed = ETrue;
+				iAsyncProcessComplete = EFalse;
+				StartFetchingMessageStructureL(iViewedMsg);
+				}
+			//</cmail>
 	        // Set title bar text to "Message/Meeting details"
 	        ChangeTitleBarTextL( ETrue );
 
@@ -295,9 +316,17 @@
             iParentLayout->SetRect( iScreenRect );
             ClearMsgDetailsModelL();        
             
+			//<cmail> 
+			// IMAP - hasStructure is True so the view can be updated. 
+			// POP - if hasStructure is False then the message strucure is being fetched. Wait for responce that will be received in 
+			//       observer method RequestResponseL( ... )
+			if ( hasStructure )
+				{
             UpdateMsgDetailsModelL();
             iTreeList->ShowListL();
 	        }
+			//</cmail>
+	        }
 		}
 	// <cmail> Touch
 	iTreeList->SetFocusedL(ETrue);
@@ -307,6 +336,9 @@
 void CFSEmailUiMsgDetailsVisualiser::ChildDoDeactivate()
 	{
     FUNC_LOG;
+	//<cmail> 
+	CancelFetching();
+	//</cmail>
     if ( !iAppUi.AppUiExitOngoing() )
         {
         if ( iTreeList->IsFocused() )
@@ -1810,3 +1842,145 @@
     aLayoutArray.AppendL( iParentLayout );
     }
 
+// <cmail> 
+// ---------------------------------------------------------------------------
+// Fetching the Message Structure. It is necessary for POP protocol in order to read recipients
+// ---------------------------------------------------------------------------
+//
+void CFSEmailUiMsgDetailsVisualiser::StartFetchingMessageStructureL(
+		CFSMailMessage* aMsg)
+	{
+	FUNC_LOG;
+	TFSMailMsgId currentMailboxId = aMsg->GetMailBoxId();
+	TFSMailMsgId currentMessageFolderId = aMsg->GetFolderId();
+	CFSMailFolder* currentFolder = iAppUi.GetMailClient()->GetFolderByUidL(
+			currentMailboxId, currentMessageFolderId);
+	CleanupStack::PushL(currentFolder);
+	RArray<TFSMailMsgId> messageIds;
+	CleanupClosePushL(messageIds);
+	messageIds.Append(aMsg->GetMessageId());
+	// Fetch the message structure
+	iCurrentStructureFetchRequestId = currentFolder->FetchMessagesL(messageIds,
+			EFSMsgDataStructure, *this);
+	iFetchingMessageStructure = ETrue;
+	CleanupStack::PopAndDestroy(&messageIds);
+	CleanupStack::PopAndDestroy(currentFolder);
+	}
+// </cmail>
+
+// <cmail> 
+// ---------------------------------------------------------------------------
+// MFSMailRequestObserver interface implementation
+// ---------------------------------------------------------------------------
+//
+void CFSEmailUiMsgDetailsVisualiser::RequestResponseL(TFSProgress aEvent,
+		TInt aRequestId)
+	{
+	FUNC_LOG;
+	if (aRequestId == iCurrentStructureFetchRequestId && iFetchingMessageStructure)
+		{
+		if (aEvent.iError != KErrNone || aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestCancelled)
+			{
+			iAsyncProcessComplete = ETrue;
+			iFetchingMessageStructure = EFalse;
+			}
+		else if (aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestComplete)
+			{
+			iAsyncProcessComplete = ETrue;
+			iFetchingMessageStructure = EFalse;
+
+			// get message again, there might be new information
+			if (iViewedMsg)
+				{
+				TFSMailMsgId mailboxId = iViewedMsg->GetMailBoxId();
+				TFSMailMsgId folderId = iViewedMsg->GetFolderId();
+				TFSMailMsgId messageId = iViewedMsg->GetMessageId();
+				UpdateMessagePtrL(mailboxId, folderId, messageId);
+				}
+			}
+		}	
+    //<cmail>
+    if (iAsyncProcessComplete && iWaitDialog && iDialogNotDismissed)
+		{
+		iWaitDialog->ProcessFinishedL(); // deletes the dialog
+		}
+    //</cmail>
+	
+	if (iViewedMsg) //safety check
+		{
+		UpdateMsgDetailsModelL();
+		iTreeList->ShowListL();
+		iTreeList->SetFocusedL(ETrue);
+		}
+	}
+// </cmail>
+
+// <cmail> 
+// ---------------------------------------------------------------------------
+// Update our message pointer and saves its status
+// ---------------------------------------------------------------------------
+// 
+void CFSEmailUiMsgDetailsVisualiser::UpdateMessagePtrL(
+		TFSMailMsgId aNewMailboxId, TFSMailMsgId aNewFolderId,
+		TFSMailMsgId aNewMessageId)
+	{
+	FUNC_LOG;
+	if (iViewedMsg)
+		{
+
+		delete iViewedMsg;
+		iViewedMsg = NULL;
+		}
+
+	// it should contain all data now (including recipients)
+	iViewedMsg = iAppUi.GetMailClient()->GetMessageByUidL(aNewMailboxId,
+			aNewFolderId, aNewMessageId, EFSMsgDataEnvelope);
+
+	if (iViewedMsg)
+		{
+		// Save read status
+		iViewedMsg->SaveMessageL();
+		}
+	}
+// </cmail>
+
+// <cmail> 
+// ---------------------------------------------------------------------------
+// Cancel fetching of the message structure 
+// ---------------------------------------------------------------------------
+//
+void CFSEmailUiMsgDetailsVisualiser::CancelFetching()
+	{
+	FUNC_LOG;
+
+	if (iFetchingMessageStructure)
+		{
+		TRAP_IGNORE( iAppUi.GetMailClient()->CancelL( iCurrentStructureFetchRequestId ) );
+		iFetchingMessageStructure = EFalse;
+		}
+	iAsyncProcessComplete = ETrue;
+	if (iWaitDialog && iDialogNotDismissed)
+		{
+		TRAP_IGNORE(iWaitDialog->ProcessFinishedL()); // deletes the dialog
+		iWaitDialog = NULL;
+		}
+	//</cmail>
+	}
+// </cmail>
+
+// <cmail> 
+// ---------------------------------------------------------------------------
+// MProgressDialogCallback interface implementation
+// ---------------------------------------------------------------------------
+//
+void CFSEmailUiMsgDetailsVisualiser::DialogDismissedL( TInt aButtonId)
+	{
+    FUNC_LOG;
+    iDialogNotDismissed = EFalse;
+	if( aButtonId == EAknSoftkeyCancel )
+		{
+		CancelFetching();
+		}
+	
+	}
+// </cmail>
--- a/emailuis/emailui/src/FreestyleEmailUiSearchListVisualiser.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiSearchListVisualiser.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -26,10 +26,10 @@
 #include <FreestyleEmailUi.rsg>
 
 //<cmail>
-#include "CFSMailMessage.h"
-#include "CFSMailClient.h"
-#include "CFSMailFolder.h"
-#include "CFSMailBox.h"
+#include "cfsmailmessage.h"
+#include "cfsmailclient.h"
+#include "cfsmailfolder.h"
+#include "cfsmailbox.h"
 #include <alf/alfframebrush.h>
 #include <alf/alftextvisual.h>
 #include "fstreelist.h"
@@ -42,7 +42,7 @@
 //</cmail>
 #include <AknQueryDialog.h>
 //<cmail>
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 #include <alf/alfanchorlayout.h>
 #include <alf/alfdecklayout.h>
 #include <alf/alfcontrolgroup.h>
@@ -89,7 +89,7 @@
 #include "FreestyleEmailUiLiterals.h"
 #include "FreestyleEmailUiShortcutBinding.h"
 #include "FreestyleEmailUiMsgDetailsVisualiser.h"
-#include "FreestyleEmailCenRepHandler.h"
+#include "freestyleemailcenrephandler.h"
 #include "FreestyleEmailUiHtmlViewerView.h"
 #include "FSEmail.pan"
 
--- a/emailuis/emailui/src/FreestyleEmailUiSendAttachmentsListControl.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiSendAttachmentsListControl.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -31,7 +31,7 @@
 #include <CommonContentPolicy.h>
 #include <aknnotewrappers.h> 
 #include <StringLoader.h>
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 #include <CVPbkContactManager.h> // Virtual phonebook contact manager
 // <cmail> SF
 #include <alf/alfevent.h>
--- a/emailuis/emailui/src/FreestyleEmailUiSendAttachmentsListModel.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiSendAttachmentsListModel.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -22,7 +22,7 @@
 #include <AknUtils.h>
 #include <StringLoader.h>
 #include <FreestyleEmailUi.rsg>
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 // <cmail> SF
 #include <alf/alfdecklayout.h>
 // </cmail>
--- a/emailuis/emailui/src/FreestyleEmailUiSettingsList.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiSettingsList.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -30,12 +30,12 @@
 #include <e32cmn.h>
 #include <FreestyleEmailUi.rsg>
 
-#include "CFSMailClient.h"
-#include "CFSMailBox.h"
+#include "cfsmailclient.h"
+#include "cfsmailbox.h"
 #include <AknGlobalConfirmationQuery.h> // confirmation
 #include <freestyleemailui.mbg> // icons
-#include "ESMailSettingsPluginUids.hrh"
-#include "ESMailSettingsPlugin.h"
+#include "esmailsettingspluginuids.hrh"
+#include "esmailsettingsplugin.h"
 
 #include <aknnotewrappers.h> // for note
 #include <AknDialog.h> // for settings dialog
--- a/emailuis/emailui/src/FreestyleEmailUiSettingsListView.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiSettingsListView.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -32,10 +32,10 @@
 #include <featmgr.h>
 #include <aknstyluspopupmenu.h>
 
-#include "CFSMailCommon.h"
-#include "CFSMailBox.h"
-#include "ESMailSettingsPlugin.h"
-#include "ESMailSettingsPluginUids.hrh"
+#include "cfsmailcommon.h"
+#include "cfsmailbox.h"
+#include "esmailsettingsplugin.h"
+#include "esmailsettingspluginuids.hrh"
 #include <gsfwviewuids.h> // Uids for general settings activation
 #include <csxhelp/cmail.hlp.hrh>
 
--- a/emailuis/emailui/src/FreestyleEmailUiShortcutBinding.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiShortcutBinding.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -114,7 +114,11 @@
         { 0, EStdKeyBackspace, 0, EFsEmailUiCmdActionsDelete },
         { 0,    'H', 0,     EFsEmailUiCmdHelp },
         { 0,  '+', 0,     EFsEmailUiCmdZoomIn },
-        { 0,  '-', 0,     EFsEmailUiCmdZoomOut }
+        { 0,  '-', 0,     EFsEmailUiCmdZoomOut },
+        { 0,  'N', 0,     EFsEmailUiCmdNextMessage },
+        { 0,  'P', 0,     EFsEmailUiCmdPreviousMessage },
+        { 0,  EStdKeyLeftArrow, EModifierShift,     EFsEmailUiCmdPreviousMessage },
+        { 0,  EStdKeyRightArrow, EModifierShift,     EFsEmailUiCmdNextMessage }
     };
 
 // Shortcuts for the search results view    
--- a/emailuis/emailui/src/FreestyleEmailUiUtilities.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiUtilities.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -70,7 +70,7 @@
 #include <CSendingServiceInfo.h>
 #include <CoreApplicationUIsSDKCRKeys.h> // offline mode keys
 #include <data_caging_path_literals.hrh>
-
+#include <cmailwidgetcenrepkeys.h>
 
 // <cmail> Removed DISABLE_DEFAULT_EMAIL
 //#ifndef DISABLE_DEFAULT_EMAIL
@@ -90,10 +90,10 @@
 #include <freestyleemailui.mbg>
 
 //<cmail>
-#include "CFSMailCommon.h"
-#include "CFSMailClient.h"
-#include "CFSMailBox.h"
-#include "CFSMailMessage.h"
+#include "cfsmailcommon.h"
+#include "cfsmailclient.h"
+#include "cfsmailbox.h"
+#include "cfsmailmessage.h"
 #include "cesmricalviewer.h"
 //</cmail>
 
@@ -2689,6 +2689,7 @@
 void TFsEmailUiUtility::ToggleEmailIconL(TBool aIconOn )
 	{
     FUNC_LOG;
+    //Toggle email status indicator
 	if(aIconOn)
 		{
 		RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsNewEmailStatus, ECoreAppUIsNewEmail );
@@ -2700,6 +2701,64 @@
 	}
 
 // -----------------------------------------------------------------------------
+// TFsEmailUiUtility::ToggleEmailIconL
+// -----------------------------------------------------------------------------
+void TFsEmailUiUtility::ToggleEmailIconL( TBool aIconOn, const TFSMailMsgId& aMailBox )
+	{
+    FUNC_LOG;
+    //Toggle email status indicator
+	if(aIconOn)
+		{
+		RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsNewEmailStatus, ECoreAppUIsNewEmail );
+		}
+	else
+		{
+		RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsNewEmailStatus, ECoreAppUIsNoNewEmail );
+		}
+
+    //Toggle new mail icon in widget
+    if (aMailBox.Id())
+        {
+        CRepository* repository(NULL);
+        TRAPD( err, repository = CRepository::NewL( KCRUidCmailWidget ) );
+        if ( err == KErrNone )
+            {
+            TBuf<256> mailbox;
+            mailbox.Num(aMailBox.Id());
+
+            TBuf<256> str;
+            str.Copy(_L("<"));    
+            str.Append(mailbox);
+            str.Append(_L(">"));    
+
+            TBuf<256> stored;
+            TUint32 key(KCMailMailboxesWithNewMail);
+            repository->Get( key, stored );
+    
+            TInt result = stored.Find(str);
+    
+            if (aIconOn)
+                {
+                if (result < 0) // Not found
+                    {
+                    stored.Append(str);
+                    repository->Set( key, stored );
+                    }
+                }
+            else
+                {
+                if (result >= 0)
+                    {
+                    stored.Delete(result, str.Length());
+                    repository->Set( key, stored );
+                    }
+                }
+            }
+        delete repository;
+        }
+	}
+	
+// -----------------------------------------------------------------------------
 // TFsEmailUiUtility::DisplayMsgsMovedNoteL
 // -----------------------------------------------------------------------------
 void TFsEmailUiUtility::DisplayMsgsMovedNoteL( TInt aMsgCount, const TFSMailMsgId aDestinationFolderId,
--- a/emailuis/emailui/src/FreestyleEmailUiViewBase.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiViewBase.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -110,6 +110,12 @@
     TRAPD( error, ChildDoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage) );
     if ( !error )
         {
+        //view history have to be updated once again when email is sent to background when in plugin settings and composer is activated externaly
+        //when composer view will be deactivated it wiil call NavigateBack;
+        if (pluginSettingsActive && iAppUi.CurrentActiveView()->Id() == MailEditorId)
+        	{
+        	iAppUi.ReturnFromPluginSettingsView();
+        	}
         // View activated succesfully. Change visible control group, but not
         // when application is being sent to background.
         if ( !iAppUi.SwitchingToBackground() )
@@ -437,10 +443,9 @@
 void CFsEmailUiViewBase::HandleAppForegroundEventL( TBool aForeground )
     {
     FUNC_LOG;
+    HandleForegroundEventL(aForeground);    
     if ( aForeground )
         {
-        HandleForegroundEventL();
-
         // Activate control group in case the view was activated when
         // application was being sent to background, and the control group
         // was left inactive.
@@ -556,7 +561,7 @@
 
 // ---------------------------------------------------------------------------
 //
-void CFsEmailUiViewBase::HandleForegroundEventL()
+void CFsEmailUiViewBase::HandleForegroundEventL( TBool /*aForeground*/ )
     {
     FUNC_LOG;
     }
--- a/emailuis/emailui/src/FreestyleEmailUiWizardObserver.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiWizardObserver.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -23,13 +23,13 @@
 #include <centralrepository.h>
 #include <StringLoader.h>
 //<cmail>
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 //</cmail>
 
 // INTERNAL INCLUDE FILES
 #include "FreestyleEmailUiWizardObserver.h"
 #include "FreestyleEmailUiLauncherGridVisualiser.h"
-#include "FreestyleEmailCenRepHandler.h"
+#include "freestyleemailcenrephandler.h"
 #include "FreestyleEmailUiUtilities.h"
 
 
--- a/emailuis/emailui/src/FreestyleMessageHeaderHTML.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleMessageHeaderHTML.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -23,7 +23,7 @@
 #include <StringLoader.h>
 
 #include <FreestyleEmailUi.rsg>
-
+#include <finditemengine.h>
 #include "FreestyleMessageHeaderHTML.h"
 #include "FreestyleEmailUiUtilities.h"
 #include "ncsconstants.h"
@@ -156,22 +156,31 @@
     iWriteStream( aWriteStream ),
     iVisibleWidth( aVisibleWidth - KFreestyleMessageHeaderHTMLRightMarginInPx ),
     iScrollPosition(aScrollPosition),
-    iDirectionality( aDirectionality )
+    iDirectionality( aDirectionality ),
+    iMirrorLayout( EFalse )
     {
     }
 
 void CFreestyleMessageHeaderHTML::ConstructL()
     {
     iMailMessage.AttachmentListL( iAttachments );
+    if ( AknLayoutUtils::LayoutMirrored() )
+        {
+        iMirrorLayout = ETrue;
+        }
     }
 
 void CFreestyleMessageHeaderHTML::HTMLStartL() const
     {
     iWriteStream.WriteL(_L8("<html"));
-    if ( iDirectionality == TBidiText::ERightToLeft )
+    if ( iMirrorLayout )
         {
         iWriteStream.WriteL(_L8(" dir=\"rtl\""));
-        }    
+        }
+    else
+        {
+        iWriteStream.WriteL(_L8(" dir=\"ltr\""));
+        }
     iWriteStream.WriteL(_L8(" xmlns=\"http://www.w3.org/1999/xhtml\">\n"));
     iWriteStream.CommitL();
     }
@@ -258,7 +267,8 @@
     
     // add Sent time and date
     iWriteStream.WriteL(_L8("<td id=\"sent_initial\""));
-    if ( iDirectionality == TBidiText::ELeftToRight )
+
+    if ( !iMirrorLayout )
         {
         iWriteStream.WriteL(_L8(" align=\"left\""));
         }
@@ -289,7 +299,7 @@
     
     // add "show details" image on the same line as Sent time and date
     iWriteStream.WriteL(_L8("<td width=\"1\" valign=\"top\""));
-    if ( iDirectionality == TBidiText::ELeftToRight )
+    if ( !iMirrorLayout )
         {
         iWriteStream.WriteL(_L8(" align=\"right\""));
         }
@@ -308,7 +318,7 @@
     // start second row which contains subject
     iWriteStream.WriteL(_L8("<tr>\n"));
     iWriteStream.WriteL(_L8("<td id=\"subject_initial\""));
-    if ( iDirectionality == TBidiText::ELeftToRight )
+    if ( !iMirrorLayout )
         {
         iWriteStream.WriteL(_L8(" align=\"left\""));
         }
@@ -318,10 +328,13 @@
         }
     iWriteStream.WriteL(_L8("><b>"));
 
-    HBufC8* subject8 = CnvUtfConverter::ConvertFromUnicodeToUtf8L( iMailMessage.GetSubject() );
-    CleanupStack::PushL( subject8 );
-    iWriteStream.WriteL( *subject8 );
-    CleanupStack::PopAndDestroy( subject8 );
+	HBufC* subject = iMailMessage.GetSubject().Alloc();
+	/*
+     * Writes the subject to iWriteStream and also
+     * takes care of the urls and marks them as hotspots
+     */
+    WriteSubjectL(*subject);
+
     iWriteStream.WriteL(_L8("</b>"));
         
     // Write icons (if necessary).
@@ -347,6 +360,90 @@
         
     iWriteStream.CommitL();
     }
+// -----------------------------------------------------------------------------
+// CFreestyleMessageHeaderHTML::WriteSubjectL
+// Writes the subject to iWriteStream and also
+// takes care of the urls and marks them as hotspots
+// -----------------------------------------------------------------------------
+//
+void CFreestyleMessageHeaderHTML::WriteSubjectL(TDesC& aText ) const
+    {
+    /* 
+    * Add these to searchcases to make it also search 
+    * for emailaddress and phonenumber :
+    * CFindItemEngine::EFindItemSearchMailAddressBin |
+    * CFindItemEngine::EFindItemSearchPhoneNumberBin |
+    */
+    // Search for urls    
+    TInt searchCases = CFindItemEngine::EFindItemSearchURLBin;
+                       
+    CFindItemEngine* itemEngine =
+              CFindItemEngine::NewL ( aText,
+                       ( CFindItemEngine::TFindItemSearchCase ) searchCases );
+    CleanupStack::PushL (itemEngine );
+
+    const CArrayFixFlat<CFindItemEngine::SFoundItem>
+            * foundItems = itemEngine->ItemArray ( );
+    
+    TInt index = 0;
+    // For each found item
+    for (TInt i=0; i<foundItems->Count ( ); ++i )
+        {
+        // iItemType, iStartPos, iLength
+        const CFindItemEngine::SFoundItem& item = foundItems->At (i );
+        HBufC* valueBuf = aText.Mid (item.iStartPos, item.iLength ).AllocL ( );
+        CleanupStack::PushL (valueBuf );
+        // We write the normal text to iWriteStream before and between the links in the header subject field
+        if(item.iStartPos > 0)
+            {
+            TInt itemstart = item.iStartPos;
+            HBufC* normalText = aText.Mid(index, itemstart-index).Alloc();
+            CleanupStack::PushL( normalText );
+            HBufC8* normalText8 = CnvUtfConverter::ConvertFromUnicodeToUtf8L( *normalText );
+            CleanupStack::PushL( normalText8 );
+            iWriteStream.WriteL( *normalText8 );
+            CleanupStack::PopAndDestroy( 2 ); //normalText8m, normalText
+            }        
+        switch (item.iItemType )
+            {
+            /* To make header subjectfield to recognise also phonenumber and emailadress just 
+             * add CFindItemEngine::EFindItemSearchMailAddressBin & 
+             * CFindItemEngine::EFindItemSearchPhoneNumberBin cases here.
+             */
+            case CFindItemEngine::EFindItemSearchURLBin:
+                {
+                HBufC8* url8 = CnvUtfConverter::ConvertFromUnicodeToUtf8L( *valueBuf );
+                FreestyleMessageHeaderURLFactory::CreateEmailSubjectUrlL(*valueBuf);
+                CleanupStack::PushL( url8 );
+                StartHyperlinkL(*url8);
+                iWriteStream.WriteL(*url8);
+                EndHyperlinkL();
+                CleanupStack::PopAndDestroy( url8 );
+
+                break;
+                }
+            default:
+                {
+                break;
+                }
+            }        
+        index = item.iStartPos+item.iLength;
+        CleanupStack::PopAndDestroy (valueBuf );
+        }
+        //Write the rest of the subject to subject field if we are not 
+        //at the end of the subject already, or if there wasn't any
+        //url items write the whole subject field here
+        if(index < aText.Length() )
+            {
+            HBufC* normalText = aText.Mid(index, aText.Length()-index).Alloc();
+            CleanupStack::PushL( normalText );
+            HBufC8* normalText8 = CnvUtfConverter::ConvertFromUnicodeToUtf8L( *normalText );
+            CleanupStack::PushL( normalText8 );
+            iWriteStream.WriteL( *normalText8 );
+            CleanupStack::PopAndDestroy( 2 ); //normalText8m, normalText
+            }
+    CleanupStack::PopAndDestroy (itemEngine );
+    }
 
 HBufC8* CFreestyleMessageHeaderHTML::HTMLHeaderFollowUpIconLC( TBool aShowText ) const
     {
@@ -567,11 +664,12 @@
     // subject text
     iWriteStream.WriteL( _L8("<tr>") );
     iWriteStream.WriteL( _L8("<td>") );
-
-    HBufC8* subject8 = CnvUtfConverter::ConvertFromUnicodeToUtf8L( iMailMessage.GetSubject() );
-    CleanupStack::PushL( subject8 );
-    iWriteStream.WriteL( *subject8 );
-    CleanupStack::PopAndDestroy( subject8 );
+	HBufC* subject = iMailMessage.GetSubject().Alloc();
+    /*
+     * Writes the subject to iWriteStream and also
+     * takes care of the urls and marks them as hotspots
+     */
+    WriteSubjectL(*subject);
 
     iWriteStream.WriteL( _L8("</td>") );
     iWriteStream.WriteL( _L8("</tr>\n") );
@@ -696,13 +794,13 @@
           
         // add attachment icon
         iWriteStream.WriteL( _L8("<td width=\"1\" valign=\"top\"") );
-        if ( iDirectionality == TBidiText::ELeftToRight )
+        if ( !iMirrorLayout )
             {
-            iWriteStream.WriteL(_L8(" align=\"right\""));
+            iWriteStream.WriteL(_L8(" align=\"left\""));
             }
         else
             {
-            iWriteStream.WriteL(_L8(" align=\"left\""));
+            iWriteStream.WriteL(_L8(" align=\"right\""));
             }
         iWriteStream.WriteL( _L8("><image src=\"") );
         
@@ -775,7 +873,9 @@
     CleanupStack::PopAndDestroy( url );
 
     HBufC8* displayName8 = NULL;
-    if ( aEmailAddress.GetDisplayName().Length() > 0 )
+    //  ENLN-7ZVBES
+    //  Display name not shown in From:, instead, email address is shown
+    if ( (aEmailAddress.GetDisplayName().Length() > 0) && aEmailAddressType != FreestyleMessageHeaderURLFactory::EEmailAddressTypeFrom )
         {
         displayName8 = CnvUtfConverter::ConvertFromUnicodeToUtf8L( aEmailAddress.GetDisplayName() );
         }
@@ -904,7 +1004,7 @@
     iWriteStream.WriteL( _L8("<tr>\n"));
     
     iWriteStream.WriteL( _L8("<td valign=\"top\""));
-    if ( iDirectionality == TBidiText::ELeftToRight )
+    if ( !iMirrorLayout )
         {
         iWriteStream.WriteL(_L8(" align=\"right\""));
         }
--- a/emailuis/emailui/src/FreestyleMessageHeaderURLEventHandler.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleMessageHeaderURLEventHandler.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 #include "FreestyleMessageHeaderURL.h"
 #include "FreestyleEmailUiConstants.h"
 #include "FreestyleEmailUiUtilities.h"
-#include "CFSMailMessage.h"
+#include "cfsmailmessage.h"
 #include "FreestyleEmailUiAppui.h"
 #include "FreestyleEmailUiHtmlViewerView.h"
 #include "FreestyleEmailUi.hrh"
@@ -28,10 +28,11 @@
 
 #include <aknnotewrappers.h>
 #include <aknstyluspopupmenu.h>
-#include <BrCtlDefs.h>
+#include <brctldefs.h>
 #include <e32std.h>
-#include <EIKMOBS.H>
+#include <eikmobs.h>
 #include <coemain.h>  
+#include <schemehandler.h>
 
 EXPORT_C CFreestyleMessageHeaderURLEventHandler* CFreestyleMessageHeaderURLEventHandler::NewL( 
         CFreestyleEmailUiAppUi& aAppUi, 
@@ -66,19 +67,19 @@
     delete iMessageHeaderURL;
     delete iHTMLReloadAO; 
     if( iEmailAddressStylusPopup )
-    	{
-		delete iEmailAddressStylusPopup; 
-    	}
+        {
+        delete iEmailAddressStylusPopup; 
+        }
     
     if( iAttachmentStylusPopup )
-		{
-		delete iAttachmentStylusPopup; 
-		}
+        {
+        delete iAttachmentStylusPopup; 
+        }
     
     if( iWebAddressStylusPopup )
-		{
-		delete iWebAddressStylusPopup; 
-		}   
+        {
+        delete iWebAddressStylusPopup; 
+        }   
     
     delete iUrl;
     }
@@ -92,17 +93,17 @@
         {
         //Handle http and https links
         if( ( aUri.FindF( KURLHttpPrefix ) ) == 0 
-        		||( aUri.FindF( KURLHttpsPrefix ) ) == 0 )
-        	{
-        	if ( iUrl )
-        		{
-        		delete iUrl;
-        		iUrl = NULL;
-        		}
-        	iUrl = aUri.AllocL();
-        	LaunchWebAddressMenuL( );
-        	return ETrue;
-        	}         
+                ||( aUri.FindF( KURLHttpsPrefix ) ) == 0 )
+            {
+            if ( iUrl )
+                {
+                delete iUrl;
+                iUrl = NULL;
+                }
+            iUrl = aUri.AllocL();
+            LaunchWebAddressMenuL( );
+            return ETrue;
+            }         
         //Link wasn't handled
         return EFalse;
         }
@@ -122,6 +123,13 @@
             {
             LaunchAttachmentMenuL( FindAttachmentL( *iMessageHeaderURL ) );
             }
+        else if ( iMessageHeaderURL->Type()->CompareF( KURLTypeSubject ) )
+            {
+            CSchemeHandler* handler = CSchemeHandler::NewL( aUri );
+            CleanupStack::PushL( handler );
+            handler->HandleUrlStandaloneL();
+            CleanupStack::PopAndDestroy( handler );
+            }
         iMenuVisible=EFalse;
         if( iPendingReload )
             {
@@ -158,61 +166,62 @@
     CleanupStack::PopAndDestroy(); //resource reader
          
     iEmailAddressStylusPopup->SetItemDimmed( EFsEmailUiCmdActionsRemoteLookup, 
-											 !iView.IsRemoteLookupSupportedL() ); 
+                                             !iView.IsRemoteLookupSupportedL() ); 
     iEmailAddressStylusPopup->SetPosition( iAppUi.ClientRect().Center(), 
-										   CAknStylusPopUpMenu::EPositionTypeRightBottom );
+                                           CAknStylusPopUpMenu::EPositionTypeRightBottom );
     iEmailAddressStylusPopup->ShowMenu();
     }
 
 //From MEikMenuObserver
 void CFreestyleMessageHeaderURLEventHandler::ProcessCommandL( TInt aCommand )
-	{
-	
-	switch ( aCommand )
-		{
-		case EFsEmailUiCmdActionsReply:
-		case EFsEmailUiCmdActionsAddContact:
-		case EFsEmailUiCmdActionsRemoteLookup:
-		case EFsEmailUiCmdActionsCopyToClipboard:
-			{
-			iView.HandleEmailAddressCommandL( aCommand, *iMessageHeaderURL->ItemId() );
-			break;
-			}
-			
-		case EFsEmailUiCmdCancelDownload:
-			{
-			iView.CancelAttachmentL( FindAttachmentL( *iMessageHeaderURL ) );
-			break;
-			}
-			
-		case EFsEmailUiCmdOpenAttachment:
-			{
-			iView.OpenAttachmentL( FindAttachmentL( *iMessageHeaderURL ) );
-			break;
-			}
-			
-		case EFsEmailUiCmdSave:
-			{
-			iView.SaveAttachmentL( FindAttachmentL( *iMessageHeaderURL ) );
-			break;
-			}
-			
-		case EFsEmailUiCmdSaveAll:
-			{
-			iView.SaveAllAttachmentsL( );
-			break;  	
-			}
-			
-		case EFsEmailUiCmdActionsOpenWeb:
-		case EFsEmailUiCmdActionsAddBookmark:
-		case EFsEmailUiCmdActionsCopyWWWAddressToClipboard:
-			{
-			iView.HandleWebAddressCommandL( aCommand, *iUrl );
-			break;
-			}
-			
-		}
-	}
+    {
+    
+    switch ( aCommand )
+        {
+        case EFsEmailUiCmdActionsReply:
+        case EFsEmailUiCmdActionsAddContact:
+        case EFsEmailUiCmdActionsRemoteLookup:
+        case EFsEmailUiCmdActionsCopyToClipboard:
+        case EFsEmailUiCmdActionsContactDetails:
+            {
+            iView.HandleEmailAddressCommandL( aCommand, *iMessageHeaderURL->ItemId() );
+            break;
+            }
+            
+        case EFsEmailUiCmdCancelDownload:
+            {
+            iView.CancelAttachmentL( FindAttachmentL( *iMessageHeaderURL ) );
+            break;
+            }
+            
+        case EFsEmailUiCmdOpenAttachment:
+            {
+            iView.OpenAttachmentL( FindAttachmentL( *iMessageHeaderURL ) );
+            break;
+            }
+            
+        case EFsEmailUiCmdSave:
+            {
+            iView.SaveAttachmentL( FindAttachmentL( *iMessageHeaderURL ) );
+            break;
+            }
+            
+        case EFsEmailUiCmdSaveAll:
+            {
+            iView.SaveAllAttachmentsL( );
+            break;      
+            }
+            
+        case EFsEmailUiCmdActionsOpenWeb:
+        case EFsEmailUiCmdActionsAddBookmark:
+        case EFsEmailUiCmdActionsCopyWWWAddressToClipboard:
+            {
+            iView.HandleWebAddressCommandL( aCommand, *iUrl );
+            break;
+            }
+            
+        }
+    }
 
 const TAttachmentData& CFreestyleMessageHeaderURLEventHandler::FindAttachmentL( 
         const CFreestyleMessageHeaderURL& aAttachmentUrl )
@@ -323,7 +332,7 @@
             }         
         }
     iAttachmentStylusPopup->SetPosition( iAppUi.ClientRect().Center(), 
-    								     CAknStylusPopUpMenu::EPositionTypeRightBottom );
+                                         CAknStylusPopUpMenu::EPositionTypeRightBottom );
     iAttachmentStylusPopup->ShowMenu();
     }
 
@@ -348,14 +357,14 @@
     CleanupStack::PopAndDestroy(); //resource reader
  
     iWebAddressStylusPopup->SetPosition( iAppUi.ClientRect().Center(), 
-										   CAknStylusPopUpMenu::EPositionTypeRightBottom );
+                                           CAknStylusPopUpMenu::EPositionTypeRightBottom );
     iWebAddressStylusPopup->ShowMenu();
     }
 
 //From MEikMenuObserver
 void CFreestyleMessageHeaderURLEventHandler::SetEmphasis(CCoeControl* /*aMenuControl*/,TBool /*aEmphasis*/)
-	{
-	}
+    {
+    }
 
 void CFreestyleMessageHeaderURLEventHandler::DismissMenuAndReload()
     {
--- a/emailuis/emailui/src/FreestyleMessageHeaderURLFactory.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleMessageHeaderURLFactory.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -16,7 +16,7 @@
 */
 
 #include "FreestyleMessageHeaderURLFactory.h"
-#include "CFSMailAddress.h"
+#include "cfsmailaddress.h"
 
 EXPORT_C CFreestyleMessageHeaderURL* FreestyleMessageHeaderURLFactory::CreateEmailAddressUrlL( TEmailAddressType aEmailType, 
         const CFSMailAddress& aEmailAddress )
@@ -67,4 +67,16 @@
     return url;
     }
 
+EXPORT_C CFreestyleMessageHeaderURL* FreestyleMessageHeaderURLFactory::CreateEmailSubjectUrlL( const TDesC& aSubject )
+    {
+    HBufC* scheme = KURLSchemeCmail().AllocLC();
+    HBufC* type = KURLTypeSubject().AllocLC();
+    HBufC* subject = aSubject.AllocLC();
+    CFreestyleMessageHeaderURL *url = CFreestyleMessageHeaderURL::NewL( scheme, type, subject );
+    CleanupStack::Pop( subject );
+    CleanupStack::Pop( type );
+    CleanupStack::Pop( scheme );
+    
+    return url;    
+    }
 
--- a/emailuis/emailui/src/OverlayControl.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/OverlayControl.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -30,7 +30,6 @@
 	{
     delete iBitmap;
     delete iMask;
-    delete iSolidMask;
 	}
 
 COverlayControl* COverlayControl::NewL( CCoeControl* aParent, MOverlayControlObserver* aObserver, 
@@ -45,9 +44,8 @@
 
 void COverlayControl::ConstructL( CCoeControl* aParent, const TRect& aRect, TInt aBitmapId, TInt aMaskId )
 	{
-	iSolidMask = new(ELeave) CFbsBitmap();
 
-    CreateWindowL( aParent );
+    SetContainerWindowL( *aParent );
 	
 	TFileName iconFileName;
 	TFsEmailUiUtility::GetFullIconFileNameL( iconFileName );
@@ -72,137 +70,41 @@
     if( iMask )
         {
         AknIconUtils::SetSize( iMask, aRect.Size() );
-        
-        // Create a solid version of the mask, too
-        TRAP_IGNORE(
-            CopyBitmapL( *iMask, *iSolidMask );
-            AdjustAlpha( *iSolidMask, KSolidTransparencyFactor );
-            );
-        
-        UpdateMask();
         }
     CCoeControl::SetRect( aRect );
     }
 
-void COverlayControl::CopyBitmapL( const CFbsBitmap& aSource, CFbsBitmap& aDest )
-    {
-    TSize size = aSource.SizeInPixels();
-    TInt dataSize = aSource.DataStride() * size.iHeight;
-    User::LeaveIfError( aDest.Create( size, aSource.DisplayMode() ) );
-    
-    CFbsBitGc* bitCtx;
-    CFbsBitmapDevice* bitDev = CFbsBitmapDevice::NewL( &aDest );
-    CleanupStack::PushL( bitDev );
-    User::LeaveIfError( bitDev->CreateContext( bitCtx ) );
-    CleanupStack::PushL( bitCtx );
-    bitCtx->BitBlt( TRect( size ).iTl, &aSource );
-    CleanupStack::PopAndDestroy( 2 ); // bitCtx, bitDev
-    }
-
-void COverlayControl::AdjustAlpha( CFbsBitmap& aBitmap, TReal aFactor )
-    {
-    aBitmap.LockHeap();
-    TUint8* data = (TUint8*)aBitmap.DataAddress();
-    TSize size = aBitmap.SizeInPixels();
-    TInt dataSize = aBitmap.DataStride() * size.iHeight;
-    for( TInt i = 0; i<dataSize; i++ )
-        {
-        // multiply each pixel by aFactor
-        if( data[i] ) 
-            {
-            TInt value = aFactor * data[ i ];
-            if( value > KMaxTUint8 ) 
-                {
-                value = KMaxTUint8;
-                }
-            data[ i ] = value;
-            }
-        }
-    aBitmap.UnlockHeap();   
-    }
-
 void COverlayControl::HandlePointerEventL( const TPointerEvent& aPointerEvent )
     {
     CCoeControl::HandlePointerEventL( aPointerEvent );
-
-    // Do hit test for the pointer event
-    TBool hit = EFalse;
     
-    TSize size = Size();
-    if( aPointerEvent.iPosition.iX >= 0 && 
-         aPointerEvent.iPosition.iY >= 0 &&
-         aPointerEvent.iPosition.iX < size.iWidth && 
-         aPointerEvent.iPosition.iY < size.iHeight )
-        {
-        hit = ETrue;
-        }
-    
-    if( aPointerEvent.iType == TPointerEvent::EButton1Up )
+    if( iObserver )
         {
-        SetPointerCapture( EFalse );
-        UpdateButtonState( EFalse );
-        
-        // Notify the events only if released on top of the control 
-        if( iObserver && hit )
-            {
-            // Do not let leaves disturb the system
-            TRAP_IGNORE(
-                iObserver->HandleOverlayPointerEventL( this, aPointerEvent );
-                );
-            }
+        // Do not let leaves disturb the system
+        TRAP_IGNORE(
+            iObserver->HandleOverlayPointerEventL( this, aPointerEvent ));
         }
-    else if( aPointerEvent.iType == TPointerEvent::EButton1Down )
-        {
-        UpdateButtonState( ETrue );
-        SetGloballyCapturing( ETrue );
-        SetPointerCapture( ETrue );
-        }
-    else if( aPointerEvent.iType == TPointerEvent::EDrag )
-        {
-        // Update the button UI according to hit result
-        UpdateButtonState( hit );
-        }
-    }
-
-void COverlayControl::UpdateButtonState( TBool aButtonDown )
-    {
-    if( iDownState != aButtonDown )
-        {
-        iDownState = aButtonDown;
-        UpdateMask();
-        }
-    }
+     }
 
 void COverlayControl::MakeVisible( TBool aVisible )
     {
     if( !aVisible )
         {
-        UpdateButtonState( EFalse );
         SetPointerCapture( EFalse );
         }
+    else
+        {
+        DrawDeferred();
+        }
     CCoeControl::MakeVisible( aVisible );
     }
 
-void COverlayControl::UpdateMask()
-    {
-    CFbsBitmap* mask = iMask;
-    if( iDownState )
-        {
-        mask = iSolidMask;
-        }
-    if( mask )
-        {
-        Window().SetTransparencyBitmap( *mask );
-        }
-    }
-
 void COverlayControl::Draw( const TRect& ) const 
 	{
 	CWindowGc& gc = SystemGc();
-
 	if( iBitmap )
 	    {
         TSize size = iBitmap->SizeInPixels();
-        gc.BitBlt( TPoint( 0, 0 ), iBitmap );
-	    }
+        gc.BitBltMasked(Position(),iBitmap,TRect( TPoint(0,0), size),iMask, ETrue);
+        }
 	}
--- a/emailuis/emailui/src/freestyleemailuimailboxdeleter.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/freestyleemailuimailboxdeleter.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -30,9 +30,9 @@
 #include "emailtrace.h"
 #include "freestyleemailuimailboxdeleter.h"
 #include "FreestyleEmailUiUtilities.h"
-#include "CFSMailBox.h"
+#include "cfsmailbox.h"
 #include "FreestyleEmailUiAppui.h"
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 
 // CONSTANT VALUES
 _LIT( KTabCharacter, "\t" ); 
--- a/emailuis/emailui/src/ncsaddressinputfield.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/ncsaddressinputfield.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -352,6 +352,7 @@
         {
         iButton->HandlePointerEventL( aPointerEvent );
         }
+    iTextEditor->HandleTextChangedL();    
     }
 
 // -----------------------------------------------------------------------------
--- a/emailuis/emailui/src/ncsaifeditor.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/ncsaifeditor.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -1087,7 +1087,6 @@
 
 	CleanupStack::PushL( text );
 	TPtr ptr( text->Des() );
-	ptr = ptr.LeftTPtr( CursorPos() );
 	TInt location = ptr.LocateReverse( KCharAddressDelimeterSemiColon );
 	if( location != KErrNotFound )
         {
--- a/emailuis/emailui/src/ncscomposeview.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/ncscomposeview.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -24,11 +24,11 @@
 #include <AknWaitDialog.h>
 #include <MsgAttachmentUtils.h>
 #include <featmgr.h>
-#include "CFSMailBox.h"
-#include "CFSMailMessage.h"
-#include "CFSMailAddress.h"
-#include "CFSMailClient.h"
-#include "CFSMailCommon.h"
+#include "cfsmailbox.h"
+#include "cfsmailmessage.h"
+#include "cfsmailaddress.h"
+#include "cfsmailclient.h"
+#include "cfsmailcommon.h"
 #include <csxhelp/cmail.hlp.hrh>
 #include <akntoolbar.h>
 #include <akntoolbarextension.h>
@@ -42,7 +42,7 @@
 #include "ncsconstants.h"
 #include "ncsutility.h"
 #include "ncsemailaddressobject.h"
-#include "FreestyleEmailCenRepHandler.h"
+#include "freestyleemailcenrephandler.h"
 #include "FreestyleEmailUi.hrh"
 #include "FreestyleEmailUiConstants.h"
 #include "FreestyleEmailUiSendAttachmentsListControl.h"
@@ -408,6 +408,7 @@
         Toolbar()->SetDimmed( EFalse );
         RefreshToolbar();
         }
+    TIMESTAMP( "Editor launched" );
     }
 
 
@@ -908,6 +909,7 @@
                 break;
             case ENcsCmdExit:
                 {
+                TIMESTAMP( "Exit selected from editor" );
                 iAppUi.Exit();
                 }
                 break;
@@ -1041,6 +1043,7 @@
                 break;
     		case 1:
     			{
+    			TIMESTAMP( "Delete draft message selected in editor" ); 
 				TRAPD( error, SaveToDraftsL( ETrue ) );
     			if ( KErrNone != error )
     			    {
@@ -2029,6 +2032,7 @@
         attachmentControl->Model()->Clear();
         }
     ExitComposer();
+    TIMESTAMP( "Editor exited" );
     }
 
 // -----------------------------------------------------------------------------
--- a/emailuis/emailui/src/ncscomposeviewcontainer.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/ncscomposeviewcontainer.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -287,6 +287,7 @@
                     {
                     iFocused = iHeader;
                     iHeader->SetFocus( ETrue,EDrawNow );
+                    iMessageField->ClearSelectionL();
                     iMessageField->SetFocus( EFalse, EDrawNow );
                     iHeader->MakeVisible( ETrue );
                     CommitL( EBodyField );
@@ -425,6 +426,11 @@
     		break;
     		}
     	}
+    	
+    if( iFocused == iMessageField )
+    	{
+    	iMessageField->HandleTextChangedL();
+    	}
 
     if ( aPointerEvent.iType == TPointerEvent::EButton1Down &&
          iHeader->NeedsLongTapL( aPointerEvent.iPosition ) )
@@ -505,7 +511,9 @@
     if ( ret == EKeyWasNotConsumed )
         {
         ret = iFocused->OfferKeyEventL( aKeyEvent, aType );
-
+        if( aType == EEventKeyUp )
+        	iView.HandleContainerChangeRequiringToolbarRefresh();
+        
         // Report user activity to auto saver if editor field handled the
         // event. In case of message field (body text), EKeyWasConsumed
         // condition does not come true because AknFep consumes EKeyEvent
@@ -514,7 +522,6 @@
         // autosaver is notified in HandleEdwinEventL()
         if ( ( ret == EKeyWasConsumed ) && ( iFocused != iMessageField ) )
             {
-            iView.HandleContainerChangeRequiringToolbarRefresh();
             iAutoSaver.ReportActivity();
             }
         }
--- a/emailuis/emailui/src/ncsheadercontainer.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/ncsheadercontainer.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -23,7 +23,7 @@
 #include <aknnotewrappers.h> //CAknInformationNote
 #include <FreestyleEmailUi.rsg>
 
-#include "CFSMailBox.h"
+#include "cfsmailbox.h"
 #include <FreestyleEmailUi.rsg>
 
 #include "cpbkxremotecontactlookupserviceuicontext.h"
@@ -536,7 +536,14 @@
     		{
     		ret = focused->OfferKeyEventL( aKeyEvent, aType );
     		
-    		doScroll = ( ret == EKeyWasConsumed ); 
+    		if(aType==EEventKeyDown)
+    		    {
+    		    doScroll = ETrue; 
+    		    }
+    		else 
+    		    {
+    		    doScroll = (ret == EKeyWasConsumed); 
+    		    }
     		}
     	}
 
--- a/emailuis/emailui/src/ncspopuplistbox.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/ncspopuplistbox.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -291,32 +291,34 @@
 // -----------------------------------------------------------------------------
 //
 CNcsEmailAddressObject* CNcsPopupListBox::ReturnCurrentEmailAddressLC()
-	{
+    {
     FUNC_LOG;
-	CNcsEmailAddressObject* addressObject = NULL;
+    CNcsEmailAddressObject* addressObject = NULL;
 
     if ( iMatchingItems.Count() )
-		{
-		CFSEmailUiClsItem* clsItem = NULL;
-		if ( iRemoteLookupSupported )
-			{
-			clsItem = iMatchingItems[CurrentItemIndex()-1];  // -1 because of iRemoteLookupItemPos
-			}
-		else
-			{
-			clsItem = iMatchingItems[CurrentItemIndex()]; // no iRemoteLookupItemPos			
-			}
-		addressObject= CNcsEmailAddressObject::NewL( clsItem->DisplayName(), clsItem->EmailAddress() );
-        CleanupStack::PushL( addressObject );			
+        {
+        CFSEmailUiClsItem* clsItem = NULL;
+        if ( iRemoteLookupSupported )
+            {
+            // calculate index of item
+            TInt index = (CurrentItemIndex() > iRemoteLookupItemPos ? CurrentItemIndex() - 1 : CurrentItemIndex());
+            clsItem = iMatchingItems[index];
+            }
+        else
+            {
+            clsItem = iMatchingItems[CurrentItemIndex()]; // no iRemoteLookupItemPos
+            }
+
+        addressObject= CNcsEmailAddressObject::NewL( clsItem->DisplayName(), clsItem->EmailAddress() );
+        CleanupStack::PushL( addressObject );
         if ( clsItem->MultipleEmails() )
-        	{
+            {
+            addressObject->SetDisplayFull( ETrue );
+            }
+        }
 
-        	addressObject->SetDisplayFull( ETrue );
-        	}
-      
-        }
-	return addressObject;
-	}
+    return addressObject;
+    }
 
 // -----------------------------------------------------------------------------
 // CNcsPopupListBox::SetPopupMaxRect
@@ -503,7 +505,7 @@
 			}
 
 
-		if( ItemExists ( newCurrentItem ) )
+		if( ItemExists ( newCurrentItem ) && newRMLUItemIndex != -1 )
 			{
 			iItemTextsArray->Delete( iRemoteLookupItemPos );
 
@@ -580,6 +582,29 @@
 	iGc->SetBrushColor(iBackColor);
 	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
 
+    // draw the background
+	TRect backgroundRect( aActualItemRect );
+
+    if ( !aItemIndex ) 
+        {
+        backgroundRect.iTl.iY = 0;
+        }
+    else if ( aItemIndex == iListBox.Model()->NumberOfItems() - 1 ) 
+        {
+        backgroundRect.iBr.iY = iListBox.Size().iHeight;
+        }
+    
+    iGc->DrawRect( backgroundRect );
+    
+
+    TRect textRect( aActualItemRect );
+    {
+    // temporary const_cast to get scroll width
+    CNcsPopupListBox& tmpListBox = const_cast<CNcsPopupListBox&>(iListBox);
+    textRect.Resize( -tmpListBox.ScrollBarFrame()->ScrollBarBreadth(CEikScrollBar::EVertical), 0 );
+    }
+
+
 	// Now draw the highlight
 	if( aItemIsCurrent ) 
 		{
@@ -588,14 +613,13 @@
 //	    AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(), *iGc,
 //	    	aActualItemRect, aActualItemRect,
 //	    	KNcsIIDHighlightBackground, KNcsIIDHighlightBackground );
+        iGc->DrawRect(textRect);
 		}
-	iGc->DrawRect(aActualItemRect);
-
 
 	iGc->SetPenColor(iTextColor);
 	iGc->SetPenStyle(CGraphicsContext::ESolidPen);
 	iGc->SetBrushStyle(CGraphicsContext::ENullBrush);
-	TInt topToBaseline = ( aActualItemRect.Height() - font->HeightInPixels() ) / 2
+	TInt topToBaseline = ( textRect.Height() - font->HeightInPixels() ) / 2
 						+ font->AscentInPixels();
 
 	TPtrC itemText = iListBox.Model()->ItemText( aItemIndex );
@@ -606,10 +630,10 @@
 	TRAPD( err, bidiText = TBidiText::NewL( itemText, 1 ) );
 	if ( err == KErrNone )
 		{
-		bidiText->WrapText( aActualItemRect.Width(), *font, NULL );
+		bidiText->WrapText( textRect.Width(), *font, NULL );
 		}
 		
-	TPoint leftBase = aActualItemRect.iTl + TPoint( 0, topToBaseline );
+	TPoint leftBase = textRect.iTl + TPoint( 0, topToBaseline );
 
     if ( err != KErrNone )
         {
@@ -625,7 +649,7 @@
 	else
 		{
 		// if list has rmlu item change item index right
-		if ( rmluPosition >= 0 )
+		if ( rmluPosition >= 0 && aItemIndex > rmluPosition )
 			{
 			aItemIndex--;
 			}
@@ -662,7 +686,7 @@
 					{
 					// draw letters to the start of the underlined part
 					currentTextLength = underlines[i].index - currentTextStart;
-					DrawPartOfItem( aActualItemRect, *font, currentTextStart, currentTextLength, itemText,
+					DrawPartOfItem( textRect, *font, currentTextStart, currentTextLength, itemText,
 									EFalse, topToBaseline );
 					}
 				else if ( currentTextStart == underlines[i].index )
@@ -670,7 +694,7 @@
 					// draw underlined letters
 					currentTextLength = underlines[i].length;
 					
-					DrawPartOfItem( aActualItemRect, *font, currentTextStart, currentTextLength, itemText,
+					DrawPartOfItem( textRect, *font, currentTextStart, currentTextLength, itemText,
 									ETrue, topToBaseline );
 					i++;
 					}
@@ -691,7 +715,7 @@
 					if ( currentTextStart < itemText.Length() )
 						{
 						currentTextLength = itemText.Length() - currentTextStart;
-						DrawPartOfItem( aActualItemRect, *font, currentTextStart, currentTextLength, itemText,
+						DrawPartOfItem( textRect, *font, currentTextStart, currentTextLength, itemText,
 										EFalse, topToBaseline );
 						}
 					}
@@ -746,6 +770,7 @@
     else
         {
         MakeVisible( ETrue );
+        UpdateScrollBarsL();
         iHeaderContainer.ShowPopupMenuBarL( ETrue );
         }
     }
--- a/emailuis/emailui/src/ncssubjectfield.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/ncssubjectfield.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -89,9 +89,6 @@
 
     iTextEditor = new ( ELeave ) CNcsEditor( iSizeObserver, ETrue, ENcsEditorSubject, captionText );
     CleanupStack::PopAndDestroy( aTextBuf );
-
-    // iTextEditor is not completely constructed until in SetContainerWindowL()
-    iFocusChangeHandler = new (ELeave) CAsyncCallBack( CActive::EPriorityStandard );
     }
 
 // ---------------------------------------------------------------------------
@@ -109,8 +106,6 @@
         ControlEnv()->ScreenDevice()->ReleaseFont( iFont );
         iFont = NULL;
         }*/
-
-    delete iFocusChangeHandler;
     }
 
 // -----------------------------------------------------------------------------
@@ -245,6 +240,7 @@
     {
 	FUNC_LOG;
     iTextEditor->HandlePointerEventL( aPointerEvent );
+    iTextEditor->HandleTextChangedL();
     }
 
 // -----------------------------------------------------------------------------
@@ -254,21 +250,8 @@
 void CNcsSubjectField::FocusChanged( TDrawNow aDrawNow )
 	{
     FUNC_LOG;
-	// The focus change gaining handling needs to be deferred until AknFep is fully
-	// initialised. Otherwise there will be problems when moving focus from
-	// body to subject. Focus losing can be handled immediately
 	iDrawAfterFocusChange = aDrawNow;
-	if ( IsFocused() )
-	    {
-	TCallBack callback( DoHandleFocusChanged, this );
-	iFocusChangeHandler->Cancel();
-	iFocusChangeHandler->Set( callback );
-	iFocusChangeHandler->CallBack();
-	}
-	else
-	    {
-	    DoHandleFocusChanged( this );
-	    }
+	DoHandleFocusChanged( this );
 	}
 
 // -----------------------------------------------------------------------------
--- a/emailuis/emailui/src/ncsutility.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/ncsutility.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -36,9 +36,9 @@
 #include <flogger.h>
 #include <aknenv.h>	// CAknEnv
 
-#include "CFSMailBox.h"
-#include "CFSMailClient.h"
-#include "CFSMailAddress.h"
+#include "cfsmailbox.h"
+#include "cfsmailclient.h"
+#include "cfsmailaddress.h"
 
 #include <aknlayoutscalable_apps.cdl.h>
 #include <layoutmetadata.cdl.h>
--- a/emailuis/gsemailsettings/src/GSEmailSettingsView.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/gsemailsettings/src/GSEmailSettingsView.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -25,7 +25,7 @@
 #include <StringLoader.h>
 #include <GSEmailSettingsPlugin.rsg>
 //<cmail>
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 #include "FreestyleEmailUiConstants.h" // email enumerations
 //</cmail>
 #include <freestyleemailui.mbg> // icons
--- a/emailuis/uicomponents/inc/fstreevisualizerbase.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/uicomponents/inc/fstreevisualizerbase.h	Fri Feb 19 22:37:30 2010 +0200
@@ -1009,6 +1009,13 @@
     virtual void SetFocusedItemL( const TFsTreeItemId aItem, TBool aCheckFocus = ETrue );
     // </cmail>
 
+    /** 
+    * Gets item vertical position in the list 
+    * 
+    * @param aIdx indicates item index
+    */
+    virtual TInt GetItemWorldPosition( const TInt aIdx );
+   
     /**
      * Returns item id of the currently focused item.
      *
@@ -1646,6 +1653,28 @@
      * @return ETrue if kinetic scrolling is disabled.
      */
     TBool IsKineticScrollingDisabled() const;
+    
+    /**
+    * Returns viewPort top-left position
+    */
+    virtual TPoint ViewPortTopPosition() const;
+
+public: // from MAknPhysicsObserver
+
+   /**
+    * @see MAknPhysicsObserver::ViewPositionChanged
+    */
+   virtual void ViewPositionChanged( const TPoint& aNewPosition, TBool aDrawNow = ETrue, TUint aFlags = 0 );
+
+   /**
+    * @see MAknPhysicsObserver::PhysicEmulationEnded
+    */
+   virtual void PhysicEmulationEnded();
+
+   /**
+    * @see MAknPhysicsObserver::ViewPosition
+    */
+   virtual TPoint ViewPosition() const;
 
 private:
 
@@ -1953,23 +1982,6 @@
 
 private: // from MAknPhysicsObserver
 
-   /**
-    * @see MAknPhysicsObserver::ViewPositionChanged
-    */
-   virtual void ViewPositionChanged( const TPoint& aNewPosition, TBool aDrawNow = ETrue, TUint aFlags = 0 );
-
-   /**
-    * @see MAknPhysicsObserver::PhysicEmulationEnded
-    */
-   virtual void PhysicEmulationEnded();
-
-   /**
-    * @see MAknPhysicsObserver::ViewPosition
-    */
-   virtual TPoint ViewPosition() const;
-
-private: // Single click changes
-
    virtual TBool IsFocusShown();
 
 private: //Data members
--- a/emailuis/uicomponents/src/fscontrolbuttonvisualiser.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/uicomponents/src/fscontrolbuttonvisualiser.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -1243,9 +1243,9 @@
         {
         TSize oldIconSize = iconA.Size();
         iconA.SetRect( TPoint( 
-                iconA.iTl .iX + ( buttonSize.iWidth - oldIconSize.iWidth ) / 2, 
-                iconA.iTl .iY + ( buttonSize.iHeight - oldIconSize.iHeight ) / 2 ),
-                oldIconSize );
+                            ( buttonSize.iWidth - oldIconSize.iWidth ) / 2, 
+                            ( buttonSize.iHeight - oldIconSize.iHeight ) / 2 ),
+                            oldIconSize );
         }
     iconA.SetHeight( buttonSize.iHeight );
     text1.SetHeight( buttonSize.iHeight );
--- a/emailuis/uicomponents/src/fsfastaddressingvisualizer.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/uicomponents/src/fsfastaddressingvisualizer.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -16,16 +16,11 @@
 */
 
 
-//<cmail> removed __FS_ALFRED_SUPPORT flag 
-//#include <fsconfig.h>
-//</cmail> removed __FS_ALFRED_SUPPORT flag 
-//<cmail> SF
 #include "emailtrace.h"
 #include <alf/alfAnchorLayout.h>
 #include <alf/alfFlowLayout.h>
 #include <alf/alfimagevisual.h>
-//</cmail>
-#include <COECNTRL.H>
+#include <coecntrl.h>
 
 #include "fsfastaddressingvisualizer.h"
 #include "fstextinputvisual.h"
--- a/emailuis/uicomponents/src/fstreevisualizerbase.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/uicomponents/src/fstreevisualizerbase.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -1703,6 +1703,17 @@
     }
 
 // ---------------------------------------------------------------------------
+// Gets item vertical position in the list 
+// ---------------------------------------------------------------------------
+//
+TInt CFsTreeVisualizerBase::GetItemWorldPosition( const TInt aIdx )
+    {
+    TRect rect;
+    iWorld.GetItemRectByIndex( aIdx, rect);
+    return rect.iTl.iY;
+    }
+
+// ---------------------------------------------------------------------------
 // Checks if the specified item is focused.
 // ---------------------------------------------------------------------------
 //
@@ -2524,7 +2535,8 @@
             iWorld.AppendL(itemId, itemviz->Size());
             }
         }
-    iViewPort.SetPositionL(TPoint(), EFalse);
+        // Below line commetned out. ViewPort is now not moved to the top of mail list
+        //iViewPort.SetPositionL(TPoint(), EFalse);
     iViewPort.ClearCache();
     if (!isUpdating)
         {
@@ -5020,15 +5032,26 @@
     }
 
 // ---------------------------------------------------------------------------
+// Returns viewPort top-left position
+// ---------------------------------------------------------------------------
+//
+TPoint CFsTreeVisualizerBase::ViewPortTopPosition() const
+{
+    FUNC_LOG;
+    return iViewPort.Position();
+}
+
+// ---------------------------------------------------------------------------
 // Physic updated view position
 // ---------------------------------------------------------------------------
 //
 void CFsTreeVisualizerBase::ViewPositionChanged(const TPoint& aNewPosition,
-        TBool /*aDrawNow*/, TUint /*aFlags*/)
+        TBool /*aDrawNow*/, TUint aFlags )
     {
     FUNC_LOG;
     TInt error(KErrNone);
-    TRAP( error, iViewPort.SetCenterPositionL(aNewPosition, ETrue, EUpdatedByPhisic) );
+    TRAP( error, iViewPort.SetCenterPositionL(aNewPosition, ETrue,
+                aFlags == 0 ? EUpdatedByPhisic : ENotUpdatedByPhisic ) );
     ERROR_1( error, "iViewPort.SetCenterPositionL failed with error: %d", error );
     }
 
Binary file emailuis/widget/emailwidgetsettings/conf/cmailwidget.confml has changed
Binary file emailuis/widget/emailwidgetsettings/conf/cmailwidget_2001E272.crml has changed
--- a/emailuis/widget/emailwidgetsettings/group/emailwidgetsettings.mmp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/widget/emailwidgetsettings/group/emailwidgetsettings.mmp	Fri Feb 19 22:37:30 2010 +0200
@@ -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,6 +20,7 @@
 #include <platform_paths.hrh>
 
 #include "../../../../inc/emailversionnumbers.hrh" // KEmailBinaryVersionNumber
+#include "../../../../inc/emailtraceconfig.hrh"
 
 TARGET           emailwidgetsettings.exe
 TARGETTYPE       exe
@@ -28,6 +29,7 @@
 
 VENDORID         VID_DEFAULT
 CAPABILITY       CAP_APPLICATION
+EPOCSTACKSIZE    0x5000
 
 VERSION          KEmailBinaryVersionNumber
 KEmailBinaryDemandPaging
@@ -77,5 +79,10 @@
 LIBRARY          commonengine.lib
 LIBRARY          cmaillogger.lib
 LIBRARY          egul.lib
+LIBRARY          ecom.lib
+
+#ifdef TRACE_INTO_FILE
+LIBRARY          flogger.lib
+#endif // TRACE_INTO_FILE
 
 // End of file
--- a/emailuis/widget/emailwidgetsettings/inc/emailwidgetsettingslistview.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/widget/emailwidgetsettings/inc/emailwidgetsettingslistview.h	Fri Feb 19 22:37:30 2010 +0200
@@ -23,6 +23,9 @@
 #include <AknQueryDialog.h>
 #include <aknenv.h>
 #include <aknsettingitemlist.h>
+#include <ecom/ecom.h>
+#include <emailobserverplugin.h>
+#include <memailobserverlistener.h>
 
 #include "emailwidgetsettingsappui.h"
 #include "emailwidgetsettingsmailboxes.h"
@@ -30,7 +33,9 @@
 extern const TUid KEmailWidgetSettingsListViewId;
 
 class CEmailWidgetSettingsListView;
-class CEmailWidgetSettingsListViewContainer : public CCoeControl
+class CEmailWidgetSettingsListViewContainer :
+    public CCoeControl, 
+    public EmailInterface::MEmailObserverListener
 	{
 public:
 	CEmailWidgetSettingsListViewContainer();
@@ -46,6 +51,9 @@
 	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
 	TSize MinimumSize();
     void SaveSelectedL();
+    
+    // From MEmailObserverListener
+    virtual void EmailObserverEvent( EmailInterface::MEmailData& aEmailData );
 
 private:
 	void CreateCbaL(MEikCommandObserver* aObserver);
@@ -55,20 +63,31 @@
             CArrayPtr<CGulIcon>* aIcons,
             const TInt aFileBitmapId, 
             const TInt aFileMaskId);
-	TInt GetSettingToAssociateL(const TDesC& aCid);
+    TInt AppendExternalIconL(
+            CArrayPtr<CGulIcon>* aIcons,
+            const TDesC& aMifPath,
+            const TInt aFileBitmapId, 
+            const TInt aFileMaskId);
+
+	TInt GetSettingToAssociateL(const TDesC& aCid, const TBool aNativeBox, CRepository* aCenRep);
 	void LaunchEmailWizardL();
 	
+	void ResetExtAccountWithSameId( const TDesC& aContentId, CRepository* aCenRep );
+    void ResetNatAccountWithSameId( const TDesC& aContentId, CRepository* aCenRep );
+
 private: // from MObjectProvider
 	TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
 
 public:
-	CEikButtonGroupContainer*       iPopoutCba;
-	CEikColumnListBox*	            iListBox;
-	CDesCArrayFlat*                 iAccountNames;
-	CDesCArrayFlat*                 iDomains;
-    CArrayFixFlat<TFSMailMsgId>*    iAccountIds;
-	CEmailWidgetSettingsMailboxes*  iMailboxes;
-    CEikonEnv*                      iEnv;	
+	CEikColumnListBox*                     iListBox;
+	
+private:
+	CEikButtonGroupContainer*              iPopoutCba;
+	CDesCArrayFlat*                        iAccountNames;
+	CDesCArrayFlat*                        iDomains;
+	CArrayFixFlat<TFSMailMsgId>*           iAccountIds;
+	CEmailWidgetSettingsMailboxes*         iMailboxes;
+	CEikonEnv*                             iEnv;
 	};
 
 class CEmailWidgetSettingsListView : public CAknView, public MEikListBoxObserver
--- a/emailuis/widget/emailwidgetsettings/inc/emailwidgetsettingsmailboxes.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/widget/emailwidgetsettings/inc/emailwidgetsettingsmailboxes.h	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 #ifndef EMAILWIDGETSETTINGSMAILBOXES_H_
 #define EMAILWIDGETSETTINGSMAILBOXES_H_
 
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 
 class CFSMailClient;
 
--- a/emailuis/widget/emailwidgetsettings/src/emailwidgetsettingsappui.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/widget/emailwidgetsettings/src/emailwidgetsettingsappui.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -47,7 +47,7 @@
 void CEmailWidgetSettingsAppUi::ConstructL()
     {
     FUNC_LOG;	
-    BaseConstructL(EAknEnableSkin);
+    BaseConstructL( EAknEnableSkin /*| EAknEnableMSK | EAknSingleClickCompatible*/ );
     CreateListViewL();
     }
 
--- a/emailuis/widget/emailwidgetsettings/src/emailwidgetsettingslistview.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/widget/emailwidgetsettings/src/emailwidgetsettingslistview.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -88,7 +88,7 @@
 //	
 void CEmailWidgetSettingsListView::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
     {
-    if (aEventType == EEventEnterKeyPressed || aEventType == EEventItemDoubleClicked)
+    if (aEventType == EEventEnterKeyPressed || aEventType == EEventItemDoubleClicked /*EEventItemSingleClicked*/ )
         {    
         iView->SaveSelectedL();
         AppUi()->HandleCommandL(EAknSoftkeyCancel); // Exit app
--- a/emailuis/widget/emailwidgetsettings/src/emailwidgetsettingslistviewcontainer.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/widget/emailwidgetsettings/src/emailwidgetsettingslistviewcontainer.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -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,28 +20,33 @@
 #include <eikmop.h>
 #include <bacline.h>
 #include <StringLoader.h>
-#include <akniconarray.h>
+#include <AknIconArray.h>
 #include <emailwidgetsettings.rsg>
 #include <emailwidgetsettings.mbg>
+#include <emailobserverinterface.hrh>
+#include <memaildata.h>
 
 #include "emailtrace.h"
 #include "emailwidgetsettingslistview.h"
 #include "cmailwidgetcenrepkeys.h"
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 
 using namespace AknLayout;
+using namespace EmailInterface;
 
 const TInt KMaxMailboxCount = 18;
+const TInt KMaxExternalBoxCount = 10;
 _LIT( KDissociated,"0");
 const TInt KMaxDescLen = 256;
 const TUid KUidWizardApp = { 0x10281c96 };
 const TUid KUidEmailWizardView = { 0x10281C9A };
 _LIT( KMifPath, "z:\\resource\\apps\\emailwidgetsettings.mif");
+_LIT( KMifPrefix, "mif(" );
 
 // ======== MEMBER FUNCTIONS ========
 
 // ---------------------------------------------------------------------------
-// 
+// CEmailWidgetSettingsListViewContainer::CEmailWidgetSettingsListViewContainer
 // ---------------------------------------------------------------------------
 //
 CEmailWidgetSettingsListViewContainer::CEmailWidgetSettingsListViewContainer()
@@ -50,7 +55,7 @@
     }
 
 // ---------------------------------------------------------------------------
-// 
+// CEmailWidgetSettingsListViewContainer::ConstructL
 // ---------------------------------------------------------------------------
 //
 void CEmailWidgetSettingsListViewContainer::ConstructL(CEmailWidgetSettingsListView* aView, 
@@ -69,24 +74,27 @@
     }
 
 // ---------------------------------------------------------------------------
-// 
+// CEmailWidgetSettingsListViewContainer::CreateListBoxL 
 // ---------------------------------------------------------------------------
 //
 void CEmailWidgetSettingsListViewContainer::CreateListBoxL(MEikListBoxObserver* aObserver)
     {
-    FUNC_LOG;        
-    TInt count = iMailboxes->MailboxCount();
+    FUNC_LOG;      
+    
+    
+    TInt nativeMailboxCount = iMailboxes->MailboxCount();
 
     iListBox = new(ELeave) CAknSingleGraphicStyleListBox;
     iListBox->SetContainerWindowL( *this);
     iListBox->ConstructL( this, EAknListBoxSelectionList );
-    iAccountNames = new (ELeave) CDesCArrayFlat(count + 1);
-    iDomains = new (ELeave) CDesCArrayFlat(count);
-    if (count)
-        {
-		iAccountIds = new ( ELeave ) CArrayFixFlat<TFSMailMsgId>(count);
-		}
-    for (TInt i = 0; i < count; i++)
+    
+    iAccountNames = new (ELeave) CDesCArrayFlat(nativeMailboxCount + 1); // +1 for creating new mailbox
+    iDomains = new (ELeave) CDesCArrayFlat(1);
+	iAccountIds = new ( ELeave ) CArrayFixFlat<TFSMailMsgId>(1);
+	
+    // First items on the selection list are native mailboxes.
+	// Append name, domain and id information to the arrays.
+	for (TInt i = 0; i < nativeMailboxCount; i++)
         {
         TBuf<KMaxDescLen> name;
         TBuf<KMaxDescLen> domain;        
@@ -98,6 +106,56 @@
         iDomains->AppendL(domain);
         iAccountIds->AppendL(id);
         }
+    
+    // Continue with external mailboxes.
+	// List plugins implementing the interface.
+    TUid interfaceUid = TUid::Uid( KEmailObserverInterfaceUid );
+    RImplInfoPtrArray pluginArray;
+    REComSession::ListImplementationsL( interfaceUid, pluginArray);
+   
+    const TInt pluginCount = pluginArray.Count();
+    INFO_1("***** NUMBER OF plugins == %d", pluginCount);
+    for ( TInt ii = 0; ii < pluginCount; ii++ )
+        {
+        TUid implUid = pluginArray[ii]->ImplementationUid();
+       
+        // load external email client plugin
+        INFO_1("***** BEFORE instantiating plugin %d", implUid.iUid);
+        EmailInterface::CEmailObserverPlugin* plugin = EmailInterface::CEmailObserverPlugin::NewL( implUid, this );
+        CleanupStack::PushL( plugin );
+        INFO("***** AFTER instantiating plugin ");
+        
+        // list mailboxes of the plugin
+        MEmailData& data( plugin->EmailDataL() );
+        RPointerArray<MMailboxData> extMailboxes = data.MailboxesL();
+        
+        const TInt extMailboxCount = extMailboxes.Count();
+        
+        for ( TInt jj = 0; jj < extMailboxCount; jj++ )
+            {
+            // Append mailbox name using indexed format ( e.g. "1\tMailboxName\t\t" )
+            TBuf<KMaxDescLen> name;
+            name.AppendNum(nativeMailboxCount + 1 + jj);
+            name.Append(_L("\t"));
+            name.Append(extMailboxes[jj]->Name());
+            name.Append(_L("\t\t"));
+            iAccountNames->AppendL(name);
+            
+            // Instead of domain information, external mail clients are requested
+            // to provide a string containing a mif file path and icon/mask numbers.
+            // The provided string is stored to domain list.
+            iDomains->AppendL( extMailboxes[jj]->BrandingIcon());
+            
+
+            // Combine plugin uid and mailbox id and add to the list.
+            TFSMailMsgId uid( implUid, extMailboxes[jj]->MailboxId() );
+            iAccountIds->AppendL( uid );
+            }
+        CleanupStack::PopAndDestroy(plugin);
+        plugin = NULL;
+        }
+    pluginArray.ResetAndDestroy();
+  
     HBufC* createNewMailbox = StringLoader::LoadLC(R_EMAILWIDGETSETTINGS_CREATE_NEW_MAILBOX);
     iAccountNames->AppendL(createNewMailbox->Des());
     CleanupStack::PopAndDestroy(createNewMailbox);
@@ -110,11 +168,13 @@
     iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
     iListBox->SetListBoxObserver(aObserver);
     
+
     SetupListIconsL();
+
     }
 
 // ---------------------------------------------------------------------------
-// 
+// CEmailWidgetSettingsListViewContainer::SetupListIconsL
 // ---------------------------------------------------------------------------
 //
 void CEmailWidgetSettingsListViewContainer::SetupListIconsL()
@@ -124,10 +184,12 @@
     CleanupClosePushL(*mailClient);
     MFSMailBrandManager& brandManager = mailClient->GetBrandManagerL();
     
-    TInt count = iMailboxes->MailboxCount();
+    TInt count = iAccountIds->Count();
+    
     CArrayPtr<CGulIcon>* icons = new(ELeave) CArrayPtrFlat<CGulIcon>( count + 1 );
     CleanupStack::PushL( icons );
-   
+    
+    // Add "new mailbox" icon to the list
     AppendIconL(icons, EMbmEmailwidgetsettingsQgn_prop_cmail_new_mailbox, 
                        EMbmEmailwidgetsettingsQgn_prop_cmail_new_mailbox_mask);
 
@@ -138,15 +200,54 @@
         
         if (brandIcon)
             {
+            // Add branded mailbox icon to the list
             icons->AppendL(brandIcon);
             }
         else
             {
-            AppendIconL(icons, EMbmEmailwidgetsettingsQgn_indi_cmail_drop_email_account, 
-                               EMbmEmailwidgetsettingsQgn_indi_cmail_drop_email_account_mask);
+            TInt err(KErrNotFound);
+            
+            // Check if domain list item contains mif file path (instead of domain)
+            // Path follows the format: "mif(z:\\resource\\apps\\myemailplugin.mif N1 N2)"    
+        
+            TBufC<KMaxDescLen> temp( iDomains->MdcaPoint(i) );
+            if( temp.Find(KMifPrefix) == 0 )
+                {        
+                TInt p1 = KMifPrefix().Length();
+                TInt p2 = temp.Locate(' ') + 1;
+                TInt p3 = temp.LocateReverse(' ') + 1;
+                TInt end = temp.Length() - 1;
+
+                TInt p1Len = p2-p1-1;
+                TInt p2Len = p3-p2-1;
+                TInt p3Len = end-p3;
+
+                // negative lengths not allowed
+                if ( p1Len > 0 && p2Len > 0 && p3Len > 0 )
+                    {
+                    TBufC<KMaxDescLen>  mifPath(temp.Mid( p1, p1Len ));
+                    TBufC<16>        iconString(temp.Mid( p2, p2Len ));
+                    TBufC<16>        maskString(temp.Mid( p3, p3Len )); 
+                    
+                    TLex lexIcon(iconString);
+                    TLex lexMask(maskString);
+                    TInt icon(0), mask(0);     
+                    lexIcon.Val(icon);
+                    lexMask.Val(mask);
+                    
+                    // Add 3rd party mailbox icon to the list
+                    err = AppendExternalIconL( icons, mifPath, icon, mask );
+                    }
+                }   
+            if ( err )
+                {
+                // Add default mailbox icon to the list
+                AppendIconL(icons, EMbmEmailwidgetsettingsQgn_indi_cmail_drop_email_account, 
+                                   EMbmEmailwidgetsettingsQgn_indi_cmail_drop_email_account_mask);
+                }
             }
         }
-
+    
     // clear any previous icon array
     CAknIconArray* oldIconArray = static_cast<CAknIconArray*>(iListBox->ItemDrawer()->ColumnData()->IconArray());
     if (oldIconArray)
@@ -158,7 +259,7 @@
     }
 
 // -----------------------------------------------------------------------------
-// CFeedsTopicContainer::AppendIconL
+// CEmailWidgetSettingsListViewContainer::AppendIconL
 //
 // Loads and appends an icon to the icon array.
 // -----------------------------------------------------------------------------
@@ -184,6 +285,40 @@
     CleanupStack::Pop(newIcon);
     }
 
+// -----------------------------------------------------------------------------
+// CEmailWidgetSettingsListViewContainer::AppendExternalIconL
+//
+// Loads and appends an 3rd party icon to the icon array.
+// -----------------------------------------------------------------------------
+//
+TInt CEmailWidgetSettingsListViewContainer::AppendExternalIconL(
+        CArrayPtr<CGulIcon>* aIcons,
+        const TDesC& aMifPath,
+        const TInt aFileBitmapId, 
+        const TInt aFileMaskId)
+    {
+    FUNC_LOG;
+    CGulIcon*    newIcon;
+    CFbsBitmap*  newIconBmp;
+    CFbsBitmap*  newIconMaskBmp;
+    // Trap when faulty mif path, missing graphic file, etc. 
+    TRAPD( err, AknIconUtils::CreateIconL( newIconBmp, newIconMaskBmp, aMifPath,
+                aFileBitmapId,
+                aFileMaskId ) );
+    if (!err)
+        {
+        CleanupStack::PushL(newIconBmp);
+        CleanupStack::PushL(newIconMaskBmp);
+        newIcon = CGulIcon::NewL(newIconBmp, newIconMaskBmp);
+        CleanupStack::Pop(newIconMaskBmp);
+        CleanupStack::Pop(newIconBmp);
+        CleanupStack::PushL(newIcon);
+        aIcons->AppendL(newIcon);
+        CleanupStack::Pop(newIcon);
+        }
+    return err;
+    }
+
 // ---------------------------------------------------------------------------
 // CEmailWidgetSettingsListViewContainer::CreateCbaL
 // ---------------------------------------------------------------------------
@@ -210,6 +345,7 @@
     delete iAccountNames;
     delete iDomains;
     delete iAccountIds;
+    REComSession::FinalClose();
     }
 
 // ---------------------------------------------------------------------------
@@ -220,9 +356,9 @@
     {
     FUNC_LOG;        
     TRect mainPaneRect;
-		AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
-		TRect listBoxRect(mainPaneRect.Size());
-		iListBox->SetRect(listBoxRect);
+    AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
+    TRect listBoxRect(mainPaneRect.Size());
+    iListBox->SetRect(listBoxRect);
     }
 
 // ---------------------------------------------------------------------------
@@ -291,7 +427,8 @@
 //
 void CEmailWidgetSettingsListViewContainer::SaveSelectedL()
     {
-    FUNC_LOG;        
+    FUNC_LOG;
+
     if (CurrentIndex() == iAccountNames->Count() - 1)
         {
         LaunchEmailWizardL();
@@ -306,21 +443,47 @@
         }  
     CRepository* cenRep = CRepository::NewL( KCRUidCmailWidget );
 
+    // Check whether selected box is native or external mailbox
+    TInt index = CurrentIndex();
+    TInt nativeBoxCount = iMailboxes->MailboxCount();
+
+    TBool nativeBox(ETrue);
+    if ( index >= nativeBoxCount )
+        {
+        nativeBox = EFalse;
+        }
+    
     if ( cenRep )
         {
-        TInt setId (GetSettingToAssociateL(args->Arg(1)));
+        TInt setId ( GetSettingToAssociateL(args->Arg(1), nativeBox, cenRep) );
         if (setId >= 0)
             {
-            TUint32 errorKey;
             TFSMailMsgId msgId = (*iAccountIds)[CurrentIndex()];
             TInt id = msgId.Id();
             TUid pluginId = msgId.PluginId();
             TInt pId(pluginId.iUid);
-            cenRep->StartTransaction(CRepository::EConcurrentReadWriteTransaction);
-            cenRep->Set( KCMailMailboxIdBase+setId, id );
-            cenRep->Set( KCMailPluginIdBase+setId, pId );
-            cenRep->Set( KCMailWidgetContentIdBase+setId, args->Arg(1) );
+            TInt ret = cenRep->StartTransaction(CRepository::EConcurrentReadWriteTransaction);
+
+            if ( nativeBox )
+                {
+                ResetExtAccountWithSameId( args->Arg(1), cenRep );
+            
+                ret = cenRep->Set( KCMailMailboxIdBase+setId, id );
+                ret = cenRep->Set( KCMailPluginIdBase+setId, pId );
+                ret = cenRep->Set( KCMailWidgetContentIdBase+setId, args->Arg(1) );
+                }
+            else // external mailbox
+                {
+                ResetNatAccountWithSameId( args->Arg(1), cenRep );
+            
+                ret = cenRep->Set( KCMailExtMailboxBase+setId, id );
+                ret = cenRep->Set( KCMailExtMailboxBase+KCMailExtPluginIdOffset+setId, pId );
+                ret = cenRep->Set( KCMailExtMailboxBase+KCMailExtWidgetCidOffset+setId, args->Arg(1) );          
+                }
+            
+            TUint32 errorKey( 0 );
             cenRep->CommitTransaction(errorKey);
+            INFO_1("Errorkey == %d", errorKey);
             }
         }
     delete cenRep;
@@ -328,42 +491,99 @@
     }
 
 // ---------------------------------------------------------------------------
+// CEmailWidgetSettingsListViewContainer::ResetExtAccountWithSameId
+// ---------------------------------------------------------------------------
+//
+void CEmailWidgetSettingsListViewContainer::ResetExtAccountWithSameId( const TDesC& aContentId, CRepository* aCenRep )
+    {
+    FUNC_LOG;
+    for ( TInt i = 0; i < KMaxExternalBoxCount; i++ )
+        {
+        TBuf<10> value;
+        TInt ret = aCenRep->Get( KCMailExtMailboxBase+KCMailExtWidgetCidOffset+i, value );
+        if ( !value.Compare( aContentId ) )
+            {
+            // found
+            ret = aCenRep->Set(KCMailExtMailboxBase+i, 0);
+            ret = aCenRep->Set(KCMailExtMailboxBase+KCMailExtPluginIdOffset+i, 0);
+            ret = aCenRep->Set(KCMailExtMailboxBase+KCMailExtWidgetCidOffset+i, KDissociated);
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CEmailWidgetSettingsListViewContainer::ResetNatAccountWithSameId
+// ---------------------------------------------------------------------------
+void CEmailWidgetSettingsListViewContainer::ResetNatAccountWithSameId( const TDesC& aContentId, CRepository* aCenRep )
+    {
+    FUNC_LOG;
+    for ( TInt i = 0; i < KMaxMailboxCount; i++ )
+        {
+        TBuf<10> value;
+        TInt ret = aCenRep->Get( KCMailWidgetContentIdBase+i, value );
+        if ( !value.Compare( aContentId ) )
+            {
+            // found
+            ret = aCenRep->Set(KCMailMailboxIdBase+i, 0);
+            ret = aCenRep->Set(KCMailPluginIdBase+i, 0);
+            ret = aCenRep->Set(KCMailWidgetContentIdBase+i, KDissociated);
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
 // CEmailWidgetSettingsListViewContainer::GetSettingToAssociateL
 // ---------------------------------------------------------------------------
 //
-TInt CEmailWidgetSettingsListViewContainer::GetSettingToAssociateL(const TDesC& aCid)
+TInt CEmailWidgetSettingsListViewContainer::GetSettingToAssociateL(const TDesC& aCid,
+                                                                   const TBool aNativeBox,
+                                                                   CRepository* aCenRep)
     {
     FUNC_LOG;
+    TUint32 keyBase;
+    TInt mailboxCount;
+    if (aNativeBox)
+        {
+        keyBase = KCMailWidgetContentIdBase;
+        mailboxCount = KMaxMailboxCount;
+        }
+    else // external mailbox
+        {
+        keyBase = KCMailExtMailboxBase + KCMailExtWidgetCidOffset;
+        mailboxCount = KMaxExternalBoxCount;
+        }
+    
     TInt ret(KErrNotFound);
-    CRepository* cenRep = CRepository::NewL( KCRUidCmailWidget );
-    for (TInt i = 0; i < KMaxMailboxCount; i++)
+
+    // Search selected widget content id from cenrep settings 
+    for (TInt i = 0; i < mailboxCount; i++)
         {
         TBuf<KMaxDescLen> value;
-        TUint32 key(KCMailWidgetContentIdBase+i);
-        cenRep->Get( key, value );
+        aCenRep->Get( keyBase+i, value );
         TInt result = value.Compare(aCid);
         if (!result)
             {
+            // Content id found
             ret = i;
             break;
             }
         }
     if (ret < 0 )
         {
-        for (TInt i = 0; i < KMaxMailboxCount; i++)
+        // Content id not found. Search first free space.
+        for (TInt i = 0; i < mailboxCount; i++)
             {       
             TBuf<KMaxDescLen> value;
-            TUint32 key(KCMailWidgetContentIdBase+i);
-            cenRep->Get( key, value );
+            aCenRep->Get( keyBase+i, value );
             TInt result = value.Compare(KDissociated);
             if (!result)
                 {
+                // Free space found
                 ret = i;
                 break;
                 }
             }
         }
-    delete cenRep;
     return ret;
     }
 
@@ -385,4 +605,10 @@
         }
     }
 
+void CEmailWidgetSettingsListViewContainer::EmailObserverEvent(
+    EmailInterface::MEmailData& /*aEmailData*/ )
+    {
+    FUNC_LOG;
+    }
+
 // End of File
--- a/emailuis/widget/emailwidgetsettings/src/emailwidgetsettingsmailboxes.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/widget/emailwidgetsettings/src/emailwidgetsettingsmailboxes.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -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"
@@ -73,7 +73,7 @@
     }
 
 // ---------------------------------------------------------------------------
-// CEmailWidgetSettingsMailboxes::AppendMailboxItemsL
+// CEmailWidgetSettingsMailboxes::GetMailboxIdL
 // ---------------------------------------------------------------------------
 //
 void CEmailWidgetSettingsMailboxes::GetMailboxIdL(TInt aNum, 
--- a/emailuis/widget/xuikon/00/emailwidget.css	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/widget/xuikon/00/emailwidget.css	Fri Feb 19 22:37:30 2010 +0200
@@ -107,3 +107,7 @@
     text-align: right;
 }
 
+image
+{
+    _s60-aspect-ratio:preserve;
+}
--- a/group/bld.inf	Tue Feb 02 00:02:40 2010 +0200
+++ b/group/bld.inf	Fri Feb 19 22:37:30 2010 +0200
@@ -23,3 +23,4 @@
 #include "../meetingrequest/group/bld.inf"                   
 #include "../emailuis/group/bld.inf"
 #include "../email_plat/group/bld.inf"                       
+#include "../email_pub/group/bld.inf"
\ No newline at end of file
Binary file help/data/xhtml.zip has changed
--- a/help/inc/cmail.hlp.hrh	Tue Feb 02 00:02:40 2010 +0200
+++ b/help/inc/cmail.hlp.hrh	Fri Feb 19 22:37:30 2010 +0200
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* 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"
--- a/ipsservices/ipssosaoplugin/group/IPSSosAOPlugin.mmp	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssosaoplugin/group/IPSSosAOPlugin.mmp	Fri Feb 19 22:37:30 2010 +0200
@@ -70,8 +70,7 @@
 LIBRARY                 ipssosplugin.lib
 LIBRARY                 IpsSosSettings.lib
 LIBRARY                 cmaillogger.lib
-LIBRARY					cmmanager.lib
-DEBUGLIBRARY            flogger.lib
+LIBRARY                 cmmanager.lib
 
 #ifdef TRACE_INTO_FILE
 LIBRARY                 flogger.lib
--- a/ipsservices/ipssosaoplugin/inc/IpsSosAOImapAgent.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssosaoplugin/inc/IpsSosAOImapAgent.h	Fri Feb 19 22:37:30 2010 +0200
@@ -24,7 +24,7 @@
 #include <imapset.h>
 #include <mtclreg.h>
 //<cmail>
-#include "MFSMailRequestObserver.h"
+#include "mfsmailrequestobserver.h"
 //</cmail>
 
 #include "IpsSosAOBaseAgent.h"
--- a/ipsservices/ipssosaoplugin/src/IpsSosAOImapAgent.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssosaoplugin/src/IpsSosAOImapAgent.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -25,7 +25,7 @@
 #include <msvapi.h>
 #include <AlwaysOnlineManagerCommon.h>
 //<cmail>
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 //</cmail>
 
 
--- a/ipsservices/ipssosplugin/data/2000E53D.rss	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssosplugin/data/2000E53D.rss	Fri Feb 19 22:37:30 2010 +0200
@@ -17,7 +17,7 @@
 
 
 #include <ecom/registryinfo.rh>
-#include "CFSMailPlugin.hrh" // fsmailplugininterface
+#include "cfsmailplugin.hrh" // fsmailplugininterface
 #include "ipsplgsosbaseplugin.hrh"
 #include "../../../inc/emailversionnumbers.hrh" // KEmailEcomVersionNumber
 
--- a/ipsservices/ipssosplugin/inc/ipsplgbaseoperation.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssosplugin/inc/ipsplgbaseoperation.h	Fri Feb 19 22:37:30 2010 +0200
@@ -18,8 +18,10 @@
 #ifndef IPSPLGBASEOPERATION_H
 #define IPSPLGBASEOPERATION_H
 
+#include "cfsmailcommon.h" // for TFSMailMsgId, TFSProgress
 
 class CMsvOperation;
+
 /**
 * class CIpsPlgBaseOperation
 *
--- a/ipsservices/ipssosplugin/inc/ipsplgeventhandler.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssosplugin/inc/ipsplgeventhandler.h	Fri Feb 19 22:37:30 2010 +0200
@@ -205,11 +205,27 @@
     void SignalMailboxOfflineStateL( const TFSMailMsgId& aAccount );
 
     /**
-     * Send user password query request to fs email ui
+     * Send user password query request to fs email ui.
+     * Request is handled by emailserver.
+     * Only one query at a time is allowed - restriction of CFSMailMessageQueryHandler
+     * Operation callback is registered in handler and will receive notification
+     * on query password finished.
+     * 
      * @param aMbox entry id of mailbox service
      * @param aCallback callback interface to connection operation, defaut NULL
+     * @param aIncoming incoming or outgoing password query
+     * @return ETrue query invoked, wait for notification
+     *         EFalse another query is in progress
      */
-    void QueryUsrPassL( TMsvId aMbox, MIpsPlgConnectOpCallback* aCallback=NULL );
+    TBool QueryUsrPassL(
+        TMsvId aMbox,
+        MIpsPlgConnectOpCallback* aCallback=NULL,
+        TBool aIncoming=ETrue );
+
+    /**
+     * Query in progress is for incoming or outgoing mail.
+     */
+    TBool IncomingPass() const;
 
     /**
      * Send user password (=credentials) set signal to all plugin
@@ -221,6 +237,16 @@
 
 private:
 
+    /** States of Query user password operation */
+    enum TQueryUsrPassState
+        {
+        EReady,                 // ready for action
+        EBusy,                  // request in progress (invoker eventhandler`s state)
+        ENotificationRequest,   // user notification request (emailserver eventhandler`s state)
+        EPasswordRequest,       // password request (emailserver eventhandler`s state)
+        ERequestResponding      // response for request received, handling in progress (invoker eventhandler`s state)
+        };
+
     /**
     * Checks the source type of event and also
     * checks is the event from IPS type  ( imap/pop ) entry
@@ -443,11 +469,16 @@
     // base plugin id
     TUint                                   iPluginId;
 
-    //not owned
-    MIpsPlgConnectOpCallback*               iConnOpCallback;
-
     RArray<TMsvId>                          iImapFolderIds;
 
+    // state of the query user password operation
+    // diffrent states are for query invoker and query handler (emailserver)
+    TQueryUsrPassState                      iQueryPassState;
+    // array of operations which wait for query response
+    // or possibilty to perform a query
+    RPointerArray<MIpsPlgConnectOpCallback> iConnOpCallbacks;
+    // query user password for incoming or outgoing
+    TBool                                   iIncomingPass;
     };
 
 
--- a/ipsservices/ipssosplugin/inc/ipsplgheaders.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssosplugin/inc/ipsplgheaders.h	Fri Feb 19 22:37:30 2010 +0200
@@ -71,16 +71,16 @@
 #include <mmsvattachmentmanager.h>    // MMsvAttachmentManager
 // cfsmail
 //<cmail>
-#include "CFSMailCommon.h"
-#include "CFSMailMessage.h"
+#include "cfsmailcommon.h"
+#include "cfsmailmessage.h"
 // sendui
 #include <SendUiConsts.h>
 #include <SenduiMtmUids.h>
 
 #include "fsmailserverconst.h"
 // mfsmail
-#include "MFSMailBoxSearchObserver.h"
-#include "MFSMailEventObserver.h"
+#include "mfsmailboxsearchobserver.h"
+#include "mfsmaileventobserver.h"
 //</cmail>
 // alwaysonline
 #include <AlwaysOnlineManagerClient.h>
@@ -160,7 +160,7 @@
 #include "ipsplgsyncstatehandler.h"
 
 // observers
-#include "MFSMailRequestObserver.h"
+#include "mfsmailrequestobserver.h"
 #include "ipsplgsettingsobserver.h"
 #include "ipsplgpropertywatcher.h"
 
--- a/ipsservices/ipssosplugin/inc/ipsplgimap4connectop.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssosplugin/inc/ipsplgimap4connectop.h	Fri Feb 19 22:37:30 2010 +0200
@@ -139,7 +139,8 @@
 		enum TImapConnectionState 
 			{ 
 			EStateStartConnect,
-			EStateQueryingDetails, 
+			EStateQueryingDetails,
+			EStateQueryingDetailsBusy,
 			EStateConnectAndSync,
 			EStatePopulateAllCompleted,
 			EStateCompleted,
@@ -186,13 +187,14 @@
         *
         */       
         void DoPopulateAllL();
-        
+
         /**
-        *
-        */
-        void QueryUserPwdL();
-        
-        
+         * Send user password query request to CIpsPlgEventHandler
+         * @return ETrue - if query send
+         */
+        TBool QueryUserPassL();
+
+
         /**
          * 
          */
--- a/ipsservices/ipssosplugin/inc/ipsplgimap4fetchattachmentop.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssosplugin/inc/ipsplgimap4fetchattachmentop.h	Fri Feb 19 22:37:30 2010 +0200
@@ -232,6 +232,7 @@
         TMsvId                                  iService;
         TBool                                   iPopulated;
         CIpsFetchProgReport*                    iProgReport;
+        TInt                                    iRetryCount;
     };
 
 #endif //__IPSPLGIMAP4FETCHATTACHMENTOP_H__
--- a/ipsservices/ipssosplugin/inc/ipsplgimap4moveremoteop.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssosplugin/inc/ipsplgimap4moveremoteop.h	Fri Feb 19 22:37:30 2010 +0200
@@ -20,7 +20,7 @@
 
 
 #include "ipsplgonlineoperation.h"
-#include "MFSMailRequestObserver.h"
+#include "mfsmailrequestobserver.h"
 
 /**
 * Move a selection of messages that may or may not be complete.
--- a/ipsservices/ipssosplugin/inc/ipsplgmsgiterator.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssosplugin/inc/ipsplgmsgiterator.h	Fri Feb 19 22:37:30 2010 +0200
@@ -22,7 +22,7 @@
 
 #include <e32def.h>             // NONSHARABLE_CLASS
 //<cmail>
-#include "MFSMailIterator.h"    // mfsmailiterator
+#include "mfsmailiterator.h"    // mfsmailiterator
 //</cmail>
 
 class TIpsPlgMsgKey;
--- a/ipsservices/ipssosplugin/inc/ipsplgmsgkey.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssosplugin/inc/ipsplgmsgkey.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,7 +21,7 @@
 
 #include <e32base.h>          // TKey
 //<cmail>
-#include "CFSMailCommon.h"    // tfsmailsortcriteria
+#include "cfsmailcommon.h"    // tfsmailsortcriteria
 //</cmail>
 
 class CMsvEntry;
--- a/ipsservices/ipssosplugin/inc/ipsplgpop3connectop.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssosplugin/inc/ipsplgpop3connectop.h	Fri Feb 19 22:37:30 2010 +0200
@@ -135,9 +135,10 @@
         TBool ValidateL();
 
         /**
-        *
-        */
-        void QueryUsrPassL();
+         * Send user password query request to CIpsPlgEventHandler
+         * @return ETrue - if query send
+         */
+        TBool QueryUserPassL();
         
          
         /**
@@ -163,7 +164,7 @@
             EConnected,
             EPopulate,
             EQueryingDetails,
-            EErrInvalidDetails,
+            EQueryingDetailsBusy,
             EIdle
             };
 
--- a/ipsservices/ipssosplugin/inc/ipsplgsmtpoperation.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssosplugin/inc/ipsplgsmtpoperation.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,18 +21,33 @@
 
 #include <smtcmtm.h>
 #include "ipsplgcommon.h"
+#include "ipsplgonlineoperation.h" // for MIpsPlgConnectOpCallback
 
 class CClientMtmRegistry;
 
 /**
  *  Class for smtp related operations
  *
+ *  This class encapsulates SMTP send new message and send pending messages
+ *  operations.
+ *
+ *  This class requires CIpsPlgEventHandler for QueryUsrPassL method
+ *  for handling login problems. Because this class is exported and
+ *  CIpsPlgEventHandler isn`t, to avoid problems, iEventHandler is passed
+ *  as TAny* and can be set only from ipssosplugin.
+ *
  *  @lib ipssosplugin.lib
  *  @since FS 1.0
  */
 //should this class inherited from online operation
-NONSHARABLE_CLASS( CIpsPlgSmtpOperation ) : public CMsvOperation
+NONSHARABLE_CLASS( CIpsPlgSmtpOperation ) :
+    public CMsvOperation,
+    public MIpsPlgConnectOpCallback
     {
+public: //from MIpsPlgConnectOpCallback
+
+    void CredientialsSetL( TInt aEvent );
+
 public:
 
     /**
@@ -84,6 +99,11 @@
     IMPORT_C TInt EmptyOutboxFromPendingMessagesL( TMsvId aMailboxId );
 
     IMPORT_C CMsvEntrySelection* GetOutboxChildrensL( );
+
+	/**
+	 *  Sets CIpsPlgEventHandler
+	 */
+	void SetEventHandler( TAny* aEventHandler );
     
 protected:
 
@@ -121,8 +141,11 @@
 
     enum TIpsSendState
         {
-        EMovingOutbox,
-        ESending
+        EIdle,
+        EMovingOutbox,          // moving mail to OutBox folder
+        ESending,               // sending mail
+        EQueryingDetails,       // querying for password
+        EQueryingDetailsBusy,   // another operation is querying for details
         };
 
     /**
@@ -158,7 +181,13 @@
      * @param aRecipients array of addresses
      */
     void ValidateAddressArrayL( const CDesCArray& aRecipients );
-    
+
+    /**
+     * Send user password query request to CIpsPlgEventHandler
+     * @return ETrue - if query send
+     */
+    TBool QueryUserPassL();
+
 private:
 
     CSmtpClientMtm*     iSmtpMtm;
@@ -167,6 +196,8 @@
     CClientMtmRegistry* iMtmRegistry;
     TInt                iState;
     TMsvId              iSmtpService;
+    // not owned
+    TAny*               iEventHandler; // pointer to CIpsPlgEventHandler
     };
 
 #endif /* IPSPLGSENDOPERATION_H */
--- a/ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.h	Fri Feb 19 22:37:30 2010 +0200
@@ -20,8 +20,8 @@
 #define IPSPLGSOSBASEPLUGIN_H
 
 //<cmail>
-#include "CFSMailPlugin.h"
-#include "MFSMailRequestObserver.h"
+#include "cfsmailplugin.h"
+#include "mfsmailrequestobserver.h"
 //</cmail>
 #include <rconnmon.h>
 
@@ -586,6 +586,17 @@
     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:
 
     /**
--- a/ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.hrh	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.hrh	Fri Feb 19 22:37:30 2010 +0200
@@ -55,7 +55,8 @@
     EIPSSosSettingsChanged,
     KIPSSosSmtpSendStartedSignal,
     KIPSSosSmtpSendEndedSignal,
-    KIPSSosSmtpEmptyOutboxNow
+    KIPSSosSmtpEmptyOutboxNow,
+    EIPSSosSmtpPswErr
     };
 
 enum TIpsOpType
--- a/ipsservices/ipssosplugin/src/ipsplgconnectandrefreshfolderlist.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssosplugin/src/ipsplgconnectandrefreshfolderlist.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -17,7 +17,7 @@
 */
 
 
-#include <AknMessageQueryDialog.h>
+#include <aknmessagequerydialog.h>
 
 #include "emailtrace.h"
 #include "ipsplgheaders.h"
@@ -64,18 +64,18 @@
     TFSMailMsgId& aMailboxId, 
     MFSMailRequestObserver& aFSObserver,
     CIpsPlgTimerOperation& aTimer )
-	:
-	CIpsPlgOnlineOperation(
-	        aSession,
-	        aPriority,
-	        aObserverRequestStatus,
-	        aTimer,
-	        aMailboxId,
-	        aFSObserver,
-	        0, // FSRequestId
-	        EFalse), // SignallingAllowed
-	iState( EIdle ),
-	iMailboxId( aMailboxId ),
+    :
+    CIpsPlgOnlineOperation(
+            aSession,
+            aPriority,
+            aObserverRequestStatus,
+            aTimer,
+            aMailboxId,
+            aFSObserver,
+            0, // FSRequestId
+            EFalse), // SignallingAllowed
+    iState( EIdle ),
+    iMailboxId( aMailboxId ),
     iSession( aSession ),
     iService( aService ),
     iOperation( NULL ),
@@ -197,50 +197,50 @@
             delete iOperation;
             iOperation = NULL;
             InvokeClientMtmAsyncFunctionL( 
-							KIMAP4MTMConnect, 
-							*iMsvEntry,
-            	            iService,
-            	            dummyParam );
+                            KIMAP4MTMConnect, 
+                            *iMsvEntry,
+                            iService,
+                            dummyParam );
             iState = EConnecting;
             SetActive();
             break;
-	    case EConnecting:
-	        {
-	        //  We have successfully completed connecting
-	        
-	        delete iOperation;
-	        iOperation = NULL;
-	        InvokeClientMtmAsyncFunctionL( 
-	                    KIMAP4MTMSyncTree, 
-	                    *iMsvEntry,
-	                    iService,
-	                    dummyParam ); 
-	        iState = ERefreshing;
-	        SetActive();
-	        }
-	        break;
-	    case ERefreshing:
-	        //  We have successfully completed refreshing the folder list
-	        delete iOperation;
-	        iOperation = NULL;
-	        iOperation = CIpsPlgDisconnectOp::NewL( 
-	                        iSession, 
-	                        iStatus, 
-	                        iService, 
-	                        *iTimer,
-	                        iMailboxId, 
-	                        *observer, 
-	                        NULL );
-	        iState = EDisconnecting;
-	        SetActive();
-	        break;
-	    case EDisconnecting:
-	        iState = ECompleted;
-	        CompleteObserver();
-	        break;
-	    default:
-	        User::Panic( KIpsPlgPanicCategory, EIpsPlgNoParameters );
-	    	break;
+        case EConnecting:
+            {
+            //  We have successfully completed connecting
+            
+            delete iOperation;
+            iOperation = NULL;
+            InvokeClientMtmAsyncFunctionL( 
+                        KIMAP4MTMSyncTree, 
+                        *iMsvEntry,
+                        iService,
+                        dummyParam ); 
+            iState = ERefreshing;
+            SetActive();
+            }
+            break;
+        case ERefreshing:
+            //  We have successfully completed refreshing the folder list
+            delete iOperation;
+            iOperation = NULL;
+            iOperation = CIpsPlgDisconnectOp::NewL( 
+                            iSession, 
+                            iStatus, 
+                            iService, 
+                            *iTimer,
+                            iMailboxId, 
+                            *observer, 
+                            NULL );
+            iState = EDisconnecting;
+            SetActive();
+            break;
+        case EDisconnecting:
+            iState = ECompleted;
+            CompleteObserver();
+            break;
+        default:
+            User::Panic( KIpsPlgPanicCategory, EIpsPlgNoParameters );
+            break;
         }
     }
 
--- a/ipsservices/ipssosplugin/src/ipsplgeventhandler.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssosplugin/src/ipsplgeventhandler.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -105,6 +105,7 @@
     iIPSSettingsObservers.ResetAndDestroy();
     iIPSSettingsObservers.Close();
     iPropertyObservers.Close();
+    iConnOpCallbacks.Close();
     delete iSettingsApi;
     iImapFolderIds.Close();
     }
@@ -118,7 +119,8 @@
     iIPSAccounts( KEventGranularity ),
     iIPSSettingsObservers( KEventGranularity ),
     iIsConnected( EFalse ),
-    iPropertyObservers( KEventGranularity )
+    iPropertyObservers( KEventGranularity ),
+    iConnOpCallbacks( KEventGranularity )
     {
     FUNC_LOG;
     }
@@ -1578,29 +1580,43 @@
 void CIpsPlgEventHandler::HandlePropertyEventL(
         TInt aEvent,
         TInt aMailbox,
-        TInt /*aPluginId*/,
-        TInt aError )
+        TInt aPluginId,
+        TInt /*aError*/ )
     {
     FUNC_LOG;
     RProcess process;
-    if ( aEvent == EIPSSosPswErr && process.SecureId() == FREESTYLE_FSSERVER_SID )
+
+    // only email server should handle login notifications
+    if (( aEvent == EIPSSosPswErr || aEvent == EIPSSosSmtpPswErr ) &&
+          process.SecureId() == FREESTYLE_FSSERVER_SID &&
+          iQueryPassState == EReady &&
+          iBasePlugin.PluginId() == aPluginId )
         {
-        TFSMailMsgId mbox = SymId2FsId( aMailbox,
-                        iBasePlugin.MtmId().iUid );
+        TFSMailMsgId mbox = SymId2FsId( aMailbox, iBasePlugin.MtmId().iUid );
+
+        // keep information about type of mail we`re setting the password
+        iIncomingPass = ( aEvent == EIPSSosPswErr ? ETrue : EFalse );
+        iQueryPassState = ENotificationRequest;
+
         TFSMailEvent event = TFSEventException;
         TFsEmailNotifierSystemMessageType msg = EFsEmailNotifErrLoginUnsuccesfull;
-        SendDelayedEventL( event, mbox, &msg, NULL , (MFSMailExceptionEventCallback*)this );
+        SendDelayedEventL( event, mbox, &msg, NULL, (MFSMailExceptionEventCallback*)this );
         }
     else if ( aEvent == EIPSSosCredientialsSet || aEvent == EIPSSosCredientialsCancelled )
         {
-        if ( iConnOpCallback )
+        // if this handler invoked query user pass
+        if ( iQueryPassState == EBusy )
             {
-            iConnOpCallback->CredientialsSetL( aEvent );
+            iQueryPassState = ERequestResponding;
+            // run callbacks
+            for ( TInt i = 0; i < iConnOpCallbacks.Count(); i++ )
+                iConnOpCallbacks[i]->CredientialsSetL( aEvent );
 
-            //Set to null after we have used this.
-            //don't delete, we don't own this.
-            iConnOpCallback=NULL;
+            iConnOpCallbacks.Reset();
+            // now handler is ready for another query user pass
+            iQueryPassState = EReady;
             }
+
         //if password was changed, we need to send settings changed event also.
         if( aEvent == EIPSSosCredientialsSet )
             {
@@ -1617,24 +1633,41 @@
         TFSMailEvent event = TFSEventMailboxSettingsChanged;
         SendDelayedEventL( event, mbox, NULL, NULL , NULL );
         }
-    else if ( aEvent == KIpsSosEmailSyncCompleted &&
-            aError == KErrImapBadLogon )
-        {
-        TFSMailMsgId mbox = SymId2FsId( aMailbox,
-                        iBasePlugin.MtmId().iUid );
-        TFSMailEvent event = TFSEventException;
-        TFsEmailNotifierSystemMessageType msg = EFsEmailNotifErrLoginUnsuccesfull;
-        SendDelayedEventL( event, mbox, &msg, NULL , this );
-        }
     }
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
-void CIpsPlgEventHandler::QueryUsrPassL( TMsvId aMbox, MIpsPlgConnectOpCallback* aCallback )
+TBool CIpsPlgEventHandler::QueryUsrPassL(
+    TMsvId aMbox,
+    MIpsPlgConnectOpCallback* aCallback/*=NULL*/,
+    TBool aIncoming/*=ETrue*/ )
     {
     FUNC_LOG;
-    iConnOpCallback = aCallback;//can be null, doesn't matter.
-    SetNewPropertyEvent( aMbox, EIPSSosPswErr, 0 );
+
+    ASSERT( iConnOpCallbacks.Find( aCallback ) == KErrNotFound );
+    if ( aCallback )
+        iConnOpCallbacks.Append( aCallback );
+
+    // set or re-set property event
+    SetNewPropertyEvent( aMbox, (aIncoming ? EIPSSosPswErr : EIPSSosSmtpPswErr), 0 );
+
+    // only one query at a time allowed
+    if ( iQueryPassState != EReady )
+        {
+        return EFalse;
+        }
+
+    // update state
+    iQueryPassState = EBusy;
+
+    return ETrue;
+    }
+
+// ----------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
+TBool CIpsPlgEventHandler::IncomingPass() const
+    {
+    return iIncomingPass;
     }
 
 // ----------------------------------------------------------------------------
@@ -1642,6 +1675,12 @@
 void CIpsPlgEventHandler::SignalCredientialsSetL( TInt aMailboxId, TBool aCancelled )
     {
     FUNC_LOG;
+    if ( iQueryPassState == EPasswordRequest )
+        {
+        iQueryPassState = EReady;
+        iIncomingPass = ETrue;
+        }
+
     TInt event = EIPSSosCredientialsSet;
     if ( aCancelled )
         {
@@ -1703,14 +1742,20 @@
 // ----------------------------------------------------------------------------
 void CIpsPlgEventHandler::ExceptionEventCallbackL(
         TFSMailMsgId aMailboxId,
-        TInt /*aEventType*/,
+        TInt aEventType,
         TBool /*aResponse*/ )
     {
     FUNC_LOG;
-    TFSMailEvent event = TFSEventMailboxSyncStateChanged;
-    TSSMailSyncState state = PasswordNotVerified;
 
-    SendDelayedEventL( event, aMailboxId, &state, NULL , NULL );
+    if ( aEventType == EFsEmailNotifErrLoginUnsuccesfull &&
+         iQueryPassState == ENotificationRequest )
+        {
+        iQueryPassState = EPasswordRequest;
+        TFSMailEvent event = TFSEventMailboxSyncStateChanged;
+        TSSMailSyncState state = PasswordNotVerified;
+
+        SendDelayedEventL( event, aMailboxId, &state, NULL, NULL );
+        }
     }
 
 // End of File
--- a/ipsservices/ipssosplugin/src/ipsplgimap4connectop.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssosplugin/src/ipsplgimap4connectop.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -188,6 +188,7 @@
     switch( iState )
         {
         case EStateQueryingDetails:
+        case EStateQueryingDetailsBusy:
             result.iProgressStatus = TFSProgress::EFSStatus_Authenticating;
             break;
         case EStateStartConnect:
@@ -268,33 +269,22 @@
     switch( iState )
         {
         case EStateQueryingDetails:
-            
-            if ( KErrNone != err )
-                {
-                // user might be cancelled query
-                // or it IS EMPTY
-                iError = err;
-                iState = EStateIdle;
-                }
-            else
-                {
-                // Retry connect.
-                DoConnectOpL();
-                }
+            // querying pass finished - try to reconnect
+            DoConnectOpL();
             break;
         case EStateStartConnect:
         	StartL();
         	break;
         case EStateConnectAndSync:
             // Connection completed
-                
-            if( err == KErrImapBadLogon )
+
+            if ( err == KErrImapBadLogon )
                 {
-                // Login details are wrong.
-                QueryUserPwdL();
-                iState = EStateQueryingDetails;
-                
-                err = KErrNone;
+                // Login details are wrong. Trying to ask for password
+                if ( QueryUserPassL() )
+                    {
+                    err = KErrNone;
+                    }
                 }
             else if ( err == KErrNone )
                 {
@@ -520,12 +510,25 @@
 // CIpsPlgImap4ConnectOp::QueryUserPwdL()
 // ----------------------------------------------------------------------------
 // 
-void CIpsPlgImap4ConnectOp::QueryUserPwdL()
+TBool CIpsPlgImap4ConnectOp::QueryUserPassL()
     {
     if ( iEventHandler )
         {
-        iEventHandler->QueryUsrPassL( iService, this );
+        // ask for credentials for imap account and wait for callback
+        if ( iEventHandler->QueryUsrPassL( iService, this ) )
+            {
+            iState = EStateQueryingDetails;
+            }
+        else
+            {
+            // another operation is waiting for password
+            iState = EStateQueryingDetailsBusy;
+            }
+
+        return ETrue;
         }
+
+    return EFalse;
     }
 
     
@@ -580,8 +583,10 @@
     FUNC_LOG;
     if ( iEventHandler && aError == KErrImapBadLogon )
         {
+        /*
         iEventHandler->SetNewPropertyEvent( 
                 iService, KIpsSosEmailSyncCompleted, aError );
+        */
         iIsSyncStartedSignaled = EFalse;
         }
     }
@@ -592,14 +597,29 @@
 void CIpsPlgImap4ConnectOp::CredientialsSetL( TInt aEvent )
     {
     FUNC_LOG;
-    if ( aEvent == EIPSSosCredientialsCancelled )
+
+    if ( iState == EStateQueryingDetails )
         {
-        CompleteObserver( KErrCancel );
+        // response for our operation`s query
+        if ( aEvent == EIPSSosCredientialsCancelled )
+            {
+            // user canceled operation
+            CompleteObserver( KErrCancel );
+            }
+
+        // password has been set, continue with operation
+        SetActive();
+        CompleteThis();
         }
-    //password has been set, continue with operation
-    
-    SetActive();
-    CompleteThis();
+    else if ( iState == EStateQueryingDetailsBusy )
+        {
+        // response for other operation`s query
+        // we could try to ask for password now,
+        // but decision was made to cancel operation
+        CompleteObserver( KErrCancel );
+        SetActive();
+        CompleteThis();
+        }
     }
 // End of File
 
--- a/ipsservices/ipssosplugin/src/ipsplgimap4fetchattachmentop.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssosplugin/src/ipsplgimap4fetchattachmentop.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -152,7 +152,8 @@
     aFSRequestId),
     iSelection( NULL ),
     iGetMailInfo(aGetMailInfo),
-    iFunctionId(aFunctionId)
+    iFunctionId(aFunctionId),
+    iRetryCount( 0 )
     {
     FUNC_LOG;
     iService = aService;
@@ -233,6 +234,7 @@
                 CompleteObserver( KErrCouldNotConnect );
                 return;
                 }
+            iRetryCount = 0;
             DoFetchAttachmentL();
             break;
             }
@@ -243,13 +245,22 @@
             
             TInt err = iStatus.Int();
 
-            if( err != KErrNone && iOperation )
+            // If the server was busy, try again a few times.
+            if ( err == KErrServerBusy && iRetryCount < 3 )
                 {
-                iFetchErrorProgress = iOperation->ProgressL().AllocL();
+                iRetryCount++;
+                DoFetchAttachmentL();
                 }
-            
-            iState = EStateIdle;
-            CompleteObserver( err );
+            else
+                {
+                if( err != KErrNone && iOperation )
+                    {
+                    iFetchErrorProgress = iOperation->ProgressL().AllocL();
+                    }
+                
+                iState = EStateIdle;
+                CompleteObserver( err );
+                }
             break;
             }
         default:
--- a/ipsservices/ipssosplugin/src/ipsplgonlineoperation.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssosplugin/src/ipsplgonlineoperation.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -230,29 +230,34 @@
 void CIpsPlgOnlineOperation::SignalFSObserver( TInt aStatus )
     {
     FUNC_LOG;
-    if( iSignallingAllowed )
-        {        
+    if ( iSignallingAllowed )
+        {
         TFSProgress prog;
-        prog.iError = aStatus;
         // Initialize the progress data
         // it would be better to get fs progress from inherited class
         // by calling FSProgressL method??
-        if ( prog.iError == KErrCancel || prog.iError == KErrImapBadLogon )
+        if ( aStatus == KErrCancel )
             {
+            prog.iError = KErrNone;
+            prog.iProgressStatus = TFSProgress::EFSStatus_RequestCancelled;
+            }
+        else if ( aStatus == KErrImapBadLogon )
+            {
+            prog.iError = aStatus;
             prog.iProgressStatus = TFSProgress::EFSStatus_RequestCancelled;
             }
         else
             {
+            prog.iError = aStatus;
             prog.iProgressStatus = TFSProgress::EFSStatus_RequestComplete;
             }
         // At least in the attachment download, FS UI assumes that
         // the counter fields are greater than 0
         prog.iMaxCount = 1;  
         prog.iCounter = 1;
-        
-        
+
         //in case of autoconnect, we don't have valid observer
-        if( &iFSOperationObserver )
+        if ( &iFSOperationObserver )
             {            
             TRAP_IGNORE( iFSOperationObserver.RequestResponseL( prog, iFSRequestId ) );
             }
--- a/ipsservices/ipssosplugin/src/ipsplgpop3connectop.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssosplugin/src/ipsplgpop3connectop.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -149,11 +149,11 @@
              ( err == KPop3InvalidLogin )  ||
              ( err == KPop3InvalidApopLogin ) )
             {
-            // Login details are wrong.
-        
-            iState = EQueryingDetails;
-            
-            QueryUsrPassL();
+            // Login details are wrong. Trying to ask for password
+            if ( !QueryUserPassL() )
+                {
+                CompleteObserver( err );
+                }
             }
         else if ( err == KErrNone )
             {
@@ -167,7 +167,6 @@
                 iState = EIdle;
                 CompleteObserver( KErrNone );
                 }
-                
             }
         else
             {
@@ -189,11 +188,6 @@
                 iMsvSession, iService );
         CompleteObserver( err ); 
         }
-    else if ( iState == EErrInvalidDetails )
-        {
-        // proper error code;
-        CompleteObserver( KErrGeneral );
-        }
     else
         {
         User::Panic( KIpsPlgPopConnectPanic ,KErrNotFound);
@@ -238,6 +232,7 @@
     switch( iState )
         {
         case EQueryingDetails:
+        case EQueryingDetailsBusy:
             result.iProgressStatus = TFSProgress::EFSStatus_Authenticating;
             break;
         case EStartConnect:
@@ -427,21 +422,33 @@
     }
 
 // ----------------------------------------------------------------------------
-// CIpsPlgPop3ConnectOp::QueryUsrPassL()
+// CIpsPlgPop3ConnectOp::QueryUserPassL()
 // ----------------------------------------------------------------------------
 //
-void CIpsPlgPop3ConnectOp::QueryUsrPassL()
+TBool CIpsPlgPop3ConnectOp::QueryUserPassL()
     {
     FUNC_LOG;
 
     if ( iEventHandler )
         {
-        iEventHandler->QueryUsrPassL( iEntry->EntryId(), this );
+        // ask for credentials for pop3 account and wait for callback
+        if ( iEventHandler->QueryUsrPassL( iEntry->EntryId(), this ) )
+            {
+            iState = EQueryingDetails;
+            }
+        else
+            {
+            // another operation is waiting for password
+            iState = EQueryingDetailsBusy;
+            }
+
+        return ETrue;
         }
+
+    return EFalse;
     }
 
 
-
 // ----------------------------------------------------------------------------
 // CIpsPlgPop3ConnectOp::GetOperationErrorCodeL()
 // ----------------------------------------------------------------------------    
@@ -476,16 +483,31 @@
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 void CIpsPlgPop3ConnectOp::CredientialsSetL( TInt aEvent )
-    {              
+    {
     FUNC_LOG;
-    if ( aEvent == EIPSSosCredientialsCancelled ) 
+
+    if ( iState == EQueryingDetails )
         {
+        // response for our operation`s query
+        if ( aEvent == EIPSSosCredientialsCancelled )
+            {
+            // user canceled operation
+            CompleteObserver( KErrCancel );
+            }
+
+        // password has been set, continue with operation
+        SetActive();
+        CompleteThis();
+        }
+    else if ( iState == EQueryingDetailsBusy )
+        {
+        // response for other operation`s query
+        // we could try to ask for password now,
+        // but decision was made to cancel operation
         CompleteObserver( KErrCancel );
+        SetActive();
+        CompleteThis();
         }
-    //password has been set, continue with operation
-    
-    SetActive();
-    CompleteThis();
     }
 //EOF
 
--- a/ipsservices/ipssosplugin/src/ipsplgsmtpoperation.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssosplugin/src/ipsplgsmtpoperation.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -18,6 +18,7 @@
 
 #include "emailtrace.h"
 #include "ipsplgheaders.h"
+#include "miut_err.h" // SMTP error codes
 
 
 const TInt KIpsSmtpOperationCharLessThan = '<';
@@ -67,7 +68,9 @@
     iSmtpMtm( NULL ),
     iOperation( NULL ),
     iSelection( NULL ),  
-    iMtmRegistry( NULL )
+    iMtmRegistry( NULL ),
+    iState( EIdle ),
+    iEventHandler( NULL )
     {
     FUNC_LOG;
     }
@@ -83,6 +86,9 @@
     delete iMtmRegistry;
     delete iSelection;
     delete iOperation;
+    iOperation = NULL;
+    iEventHandler = NULL;
+    iState = EIdle;
     } 
 
 // ---------------------------------------------------------------------------
@@ -126,25 +132,67 @@
 void CIpsPlgSmtpOperation::RunL()
     {
     FUNC_LOG;
-    
-    
-    if ( iState == EMovingOutbox )
+
+    switch ( iState )
         {
-        delete iOperation;
-        iOperation = NULL;
-        iSelection->InsertL(0, iSmtpService );
-        CallSendL( );
-        }
-    else if ( iState == ESending )
-        {
-        TImSmtpProgress prog;
-        TPckg<TImSmtpProgress> param(prog);
-        param.Copy( iOperation->FinalProgress() ); 
+        case EMovingOutbox:
+            {
+            delete iOperation;
+            iOperation = NULL;
+            iSelection->InsertL( 0, iSmtpService );
+            CallSendL();
+            break;
+            }
+        case ESending:
+            {
+            TImSmtpProgress prog;
+            TPckg<TImSmtpProgress> param(prog);
+            param.Copy( iOperation->FinalProgress() );
 
-        CompleteObserver( prog.Error() );
+            if ( prog.Error() == KSmtpLoginRefused )
+                {
+                // Login details are wrong. Trying to ask for password
+                if ( !QueryUserPassL() )
+                    {
+                    CompleteObserver( prog.Error() );
+                    }
+                }
+            else if ( prog.Error() == KSmtpUnknownErr )
+                {
+                // try to handle empty password problem
+                CEmailAccounts* accounts = CEmailAccounts::NewLC();
+                CImSmtpSettings* smtpSettings = new(ELeave) CImSmtpSettings();
+                CleanupStack::PushL( smtpSettings );
+                TSmtpAccount smtpAccount;
+                accounts->GetSmtpAccountL( iSmtpService, smtpAccount );
+                accounts->LoadSmtpSettingsL( smtpAccount, *smtpSettings );
+
+                if ( smtpSettings->Password().Length() == 0 )
+                    {
+                    if ( !QueryUserPassL() )
+                        {
+                        CompleteObserver( prog.Error() );
+                        }
+                    }
+                CleanupStack::PopAndDestroy( 2, accounts );
+                }
+            else
+                {
+                CompleteObserver( prog.Error() );
+                }
+            break;
+            }
+        case EQueryingDetails:
+            {
+            delete iOperation;
+            iOperation = NULL;
+            // querying pass finished - try to resend mail
+            CallSendL();
+            break;
+            }
         }
     }
-    
+
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 //    
@@ -400,5 +448,73 @@
         }
     }
 
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CIpsPlgSmtpOperation::SetEventHandler( TAny* aEventHandler )
+    {
+    iEventHandler = aEventHandler;
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TBool CIpsPlgSmtpOperation::QueryUserPassL()
+    {
+    if ( iEventHandler )
+        {
+        CIpsPlgEventHandler* eventHandler = static_cast<CIpsPlgEventHandler*>(iEventHandler);
+        TMsvEntry entry;
+        TMsvId service;
+        User::LeaveIfError( iMsvSession.GetEntry( iSmtpService, service, entry ) );
+
+        // ask for credentials for smtp account and wait for callback
+        if ( eventHandler->QueryUsrPassL( entry.iRelatedId, this, EFalse ) )
+            {
+            iState = EQueryingDetails;
+            }
+        else
+            {
+            // another operation is waiting for password
+            iState = EQueryingDetailsBusy;
+            }
+
+        return ETrue;
+        }
+
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CIpsPlgSmtpOperation::CredientialsSetL( TInt aEvent )
+    {
+    FUNC_LOG;
+
+    if ( iState == EQueryingDetails )
+        {
+        // response for our operation`s query
+        if ( aEvent == EIPSSosCredientialsCancelled )
+            {
+            // user canceled operation
+            CompleteObserver( KErrCancel );
+            }
+
+        // password has been set, continue with operation
+        SetActive();
+        CompleteThis();
+        }
+    else if ( iState == EQueryingDetailsBusy )
+        {
+        // response for other operation`s query
+        // we could try to ask for password now,
+        // but decision was made to cancel operation
+        CompleteObserver( KErrCancel );
+        SetActive();
+        CompleteThis();
+        }
+    }
+
 // End of File
 
--- a/ipsservices/ipssosplugin/src/ipsplgsmtpservice.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssosplugin/src/ipsplgsmtpservice.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -196,7 +196,11 @@
     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
@@ -205,7 +209,11 @@
     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
--- a/ipsservices/ipssosplugin/src/ipsplgsosbaseplugin.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssosplugin/src/ipsplgsosbaseplugin.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -15,10 +15,9 @@
  *
 */
 
-
-
 #include "emailtrace.h"
 #include "ipsplgheaders.h"
+#include "FreestyleEmailUiConstants.h"
 
 #define FREESTYLE_EMAIL_UI_SID 0x2001E277
 
@@ -820,11 +819,23 @@
 CFSMailMessage* CIpsPlgSosBasePlugin::CreateForwardMessageL(
     const TFSMailMsgId& aMailBoxId,
     const TFSMailMsgId& aOriginalMessageId,
-    const TDesC& /* aHeaderDescriptor */)
+    const TDesC& aHeaderDescriptor )
     {
     FUNC_LOG;
     CFSMailMessage* msg = iSmtpService->CreateForwardSmtpMessageL(
         aMailBoxId, aOriginalMessageId );
+    
+    if ( aHeaderDescriptor != KNullDesC )
+        {
+        // Ignoring trap as it is better to provide something in case of the
+        // below fix method fails than nothing.
+        TRAP_IGNORE( FixReplyForwardHeaderL( 
+                        msg, 
+                        aMailBoxId, 
+                        aOriginalMessageId, 
+                        aHeaderDescriptor ) );
+        }
+  
     return msg;
     }
 
@@ -834,11 +845,23 @@
     const TFSMailMsgId& aMailBoxId,
     const TFSMailMsgId& aOriginalMessageId,
     const TBool aReplyToAll,
-    const TDesC& /* aHeaderDescriptor */ )
+    const TDesC& aHeaderDescriptor )
     {
     FUNC_LOG;
     CFSMailMessage* msg = iSmtpService->CreateReplySmtpMessageL(
         aMailBoxId, aOriginalMessageId, aReplyToAll );
+
+    if ( aHeaderDescriptor != KNullDesC )
+        {
+        // Ignoring trap as it is better to provide something in case of the
+        // below fix method fails than nothing.
+        TRAP_IGNORE( FixReplyForwardHeaderL( 
+                                msg, 
+                                aMailBoxId, 
+                                aOriginalMessageId, 
+                                aHeaderDescriptor ) );
+        }
+
     return msg;
     }
 
@@ -1561,6 +1584,7 @@
  	CleanupStack::PushL(watcher);
     CIpsPlgSmtpOperation* op = CIpsPlgSmtpOperation::NewLC(
         *iSession, CActive::EPriorityStandard, watcher->iStatus, ETrue );
+    op->SetEventHandler(iEventHandler);
     watcher->SetOperation(op);
     CleanupStack::Pop( op ); // op added as member of watcher
     op->StartSendL( aMessageId.Id() );
@@ -1831,7 +1855,20 @@
         CMsvEntry* cEntry = iSession->GetEntryL( aMailBoxId.Id() );
         CleanupStack::PushL( cEntry );
 
-        api->SetNewPasswordL( *cEntry, aPassword );
+        RProcess process;
+        // only email server can set outgoing password
+        if ( process.SecureId() == FREESTYLE_FSSERVER_SID )
+            {
+            if ( !iEventHandler->IncomingPass() )
+                {
+                CMsvEntry* cTmp = iSession->GetEntryL( cEntry->Entry().iRelatedId );
+                CleanupStack::PopAndDestroy( 1, cEntry );
+                CleanupStack::PushL( cTmp );
+                cEntry = cTmp;
+                }
+            }
+
+		api->SetNewPasswordL( *cEntry, aPassword );
 
         CleanupStack::PopAndDestroy( 2, api );//cEntry, api
 
@@ -2012,6 +2049,59 @@
 
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
+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,
@@ -2082,6 +2172,7 @@
  	CleanupStack::PushL(watcher);
     CIpsPlgSmtpOperation* op = CIpsPlgSmtpOperation::NewLC(
         *iSession, CActive::EPriorityStandard, watcher->iStatus, ETrue );
+    op->SetEventHandler(iEventHandler);
     watcher->SetOperation(op);
     op->EmptyOutboxFromPendingMessagesL( aMailBoxId.Id() );
     iOperations.AppendL(watcher);
--- a/ipsservices/ipssossettings/data/ipssetuistrings.ra	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssossettings/data/ipssetuistrings.ra	Fri Feb 19 22:37:30 2010 +0200
@@ -337,7 +337,7 @@
 RESOURCE DIALOG r_ips_setui_wait_disconnecting_dialog
     {
     flags = EAknWaitNoteFlags;
-    buttons = R_AVKON_SOFTKEYS_CANCEL;
+    buttons = R_AVKON_SOFTKEYS_EMPTY;
     items =
         {
         DLG_LINE
--- a/ipsservices/ipssossettings/inc/ipssetview.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssossettings/inc/ipssetview.h	Fri Feb 19 22:37:30 2010 +0200
@@ -20,8 +20,8 @@
 
 // SYSTEM INCLUDES
 //<cmail>
-#include "CFSMailCommon.h"
-#include "ESMailSettingsPlugin.h"
+#include "cfsmailcommon.h"
+#include "esmailsettingsplugin.h"
 //</cmail>
 
 
--- a/ipsservices/ipssossettings/src/ipssetdata.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssossettings/src/ipssetdata.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -1116,7 +1116,7 @@
 //
 void CIpsSetData::SetSchedule( 
     const TInt aSchedule,
-    const TBool aRoaming )
+    const TBool /*aRoaming*/ )
     {
     FUNC_LOG;
     TInt time = 0;
--- a/ipsservices/ipssossettings/src/ipssetdataapi.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssossettings/src/ipssetdataapi.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -162,6 +162,16 @@
         {
         SetNewImap4PasswordL( aService, aPassword );
         }
+    else if ( aService.Entry().iMtm.iUid == KSenduiMtmSmtpUidValue )
+        {
+        CEmailAccounts* accounts = CEmailAccounts::NewLC();
+
+        TBuf8<KIpsDataApiMaxPassLen> temp;
+        temp.Copy( aPassword );
+
+        SetNewSmtpPasswordL( aService.EntryId(), temp, *accounts );
+        CleanupStack::PopAndDestroy( 1, accounts );
+        }
     }
 
 // ----------------------------------------------------------------------------
--- a/ipsservices/ipssossettings/src/ipssetdatamanager.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssossettings/src/ipssetdatamanager.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -13,7 +13,7 @@
 *
 *  Description:
 *       Encapsulates saving and removing email accounts
-*  Version     : %version: 12.1.2 %
+*  Version     : %version: e003sa37#12.1.3 %
 *
 */
 
@@ -34,7 +34,7 @@
 #include "ipssetdataapi.h"
 #include "ipsplgpropertywatcher.h"
 #include "ipsplgcommon.h"
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 
 
 const TInt KIpsSetManagerMaxCreTry = 10;
--- a/ipsservices/ipssossettings/src/ipssetuidialog.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssossettings/src/ipssetuidialog.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -35,7 +35,7 @@
 //</cmail>
 
 //<cmail>
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 //</cmail>
 
 #include "ipssetui.h"
--- a/ipsservices/ipssossettings/src/ipssetuifoldersubscription.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssossettings/src/ipssetuifoldersubscription.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -39,7 +39,7 @@
 //<cmail>
 #include <featmgr.h>
 //</cmail>
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 //</cmail>
 #include <imapset.h>
 #include <akntitle.h>
--- a/ipsservices/ipssossettings/src/ipssetview.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssossettings/src/ipssetview.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -183,10 +183,20 @@
         }
     else
         {
-        // go back to previous view
-        self->AppUi()->ActivateViewL( self->iPrevViewId,
-                                      TUid::Uid(KMailSettingsReturnFromPluginSettings),
-                                      *self->iCustomMessage );
+    	//check if composer is active view; needed to handle special case when email is plugin settings and composer is activated externaly
+    	TVwsViewId aViewId;
+    	self->AppUi()->GetActiveViewId(aViewId);
+    	if (aViewId.iViewUid == MailEditorId )
+    		{
+    		//just skip 
+    		}
+    	else
+    		{
+    		// go back to previous view
+    		self->AppUi()->ActivateViewL( self->iPrevViewId,
+										  TUid::Uid(KMailSettingsReturnFromPluginSettings),
+										  *self->iCustomMessage );
+    		}
         }
     return KErrNone;
     }
--- a/ipsservices/ipssossettings/tsrc/IpsSosTestApp/inc/TESTAPPDocument.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssossettings/tsrc/IpsSosTestApp/inc/TESTAPPDocument.h	Fri Feb 19 22:37:30 2010 +0200
@@ -25,7 +25,7 @@
 #define TestAppDOCUMENT_H
 
 // INCLUDES
-#include <akndoc.h>
+#include <AknDoc.h>
    
 // CONSTANTS
 
--- a/ipsservices/ipssossettings/tsrc/IpsSosTestApp/src/TESTAPPAppUi.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssossettings/tsrc/IpsSosTestApp/src/TESTAPPAppUi.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -29,7 +29,7 @@
 #include <e32property.h>
 #include <msvstd.h>
 #include <ImumDaSettingsData.h>
-#include <ImumDaSettingsDatacollection.h>
+#include <ImumDaSettingsDataCollection.h>
 #include <ImumDaMailboxServices.h>
 #include <ImumDaMailboxUtilities.h>
 #include <ImumDomainApi.h>
--- a/ipsservices/ipssossettings/tsrc/IpsSosTestApp/src/TESTAPPContainer.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/ipsservices/ipssossettings/tsrc/IpsSosTestApp/src/TESTAPPContainer.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -20,7 +20,7 @@
 #include "TestAppContainer.h"
 #include <aknlists.h>
 #include <AknsUtils.h>
-#include <AppLayout.cdl.h>
+#include <applayout.cdl.h>
 #include <AknIconUtils.h>
 #include <AknsConstants.h>
 #include <AknsDrawUtils.h>
@@ -38,11 +38,11 @@
     CreateWindowL(); 
 
     // Get the skin instance
-	iSkinInstance = AknsUtils::SkinInstance();
+    iSkinInstance = AknsUtils::SkinInstance();
 
-	// Create background control context for skinning the background
-	iBackgroundSkinContext = CAknsBasicBackgroundControlContext::NewL( 
-			KAknsIIDSkinBmpMainPaneUsual, aRect, ETrue );
+    // Create background control context for skinning the background
+    iBackgroundSkinContext = CAknsBasicBackgroundControlContext::NewL( 
+            KAknsIIDSkinBmpMainPaneUsual, aRect, ETrue );
     
     iListBox = new (ELeave) CEikTextListBox;
     iListBox->SetContainerWindowL( *this );
@@ -119,7 +119,7 @@
 void CTestAppContainer::Draw(const TRect& /*aRect*/) const
     {
     CWindowGc& gc = SystemGc();
-	
+    
     AknsDrawUtils::Background( iSkinInstance, 
         iBackgroundSkinContext, this, gc, Rect() );
     }
--- a/meetingrequest/mrentry/inc/cesmrfsmailboxutils.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mrentry/inc/cesmrfsmailboxutils.h	Fri Feb 19 22:37:30 2010 +0200
@@ -20,7 +20,7 @@
 
 #include <e32base.h>
 #include <cmrmailboxutils.h>
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 #include "esmrdef.h"
 
 class CFSMailClient;
--- a/meetingrequest/mrentry/inc/mesmrmeetingrequestentry.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mrentry/inc/mesmrmeetingrequestentry.h	Fri Feb 19 22:37:30 2010 +0200
@@ -19,7 +19,7 @@
 #ifndef MESMRMEETINGREQUESTENTRY_H
 #define MESMRMEETINGREQUESTENTRY_H
 
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 #include "mesmrcalentry.h"
 #include "esmrdef.h"
 
--- a/meetingrequest/mrentry/src/cesmrfsmailboxutils.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mrentry/src/cesmrfsmailboxutils.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -22,8 +22,8 @@
 #include "esmrinternaluid.h"
 
 #include <calentry.h>
-#include "CFSMailClient.h"
-#include "CFSMailBox.h"
+#include "cfsmailclient.h"
+#include "cfsmailbox.h"
 #include <caluser.h>
 
 // Unnamed namespace for local definitions
--- a/meetingrequest/mrgui/inc/cesmruibase.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mrgui/inc/cesmruibase.h	Fri Feb 19 22:37:30 2010 +0200
@@ -18,7 +18,7 @@
 #ifndef CESMRUIBASE_H
 #define CESMRUIBASE_H
 
-#include <akndialog.h>
+#include <AknDialog.h>
 #include "mesmruibase.h"
 
 /**
--- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/resmrpluginextensionstatic.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/inc/resmrpluginextensionstatic.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,7 +21,7 @@
 
 #include <e32base.h>
 //<cmail>
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 //</cmail>
 
 class TESMRPluginExtensionData;
--- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrattendeefield.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrattendeefield.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -27,7 +27,7 @@
 #include <AknsFrameBackgroundControlContext.h>
 //<cmail>
 #include "esmrcommands.h"
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 //</cmail>
 #include "cesmrncspopuplistbox.h"
 #include "cesmrncsemailaddressobject.h"
--- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrclslistshandler.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrclslistshandler.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -25,7 +25,7 @@
 #include <CPbkContactItem.h>                        // CPbkContactItem, TPbkContactItemField
 #include <aknnotewrappers.h>                        // CAknErrorNote
 //<cmail>
-#include "CFSMailBox.h"                             // cfsmailbox
+#include "cfsmailbox.h"                             // cfsmailbox
 //</cmail>
 #include <CPsRequestHandler.h>
 #include <CPsSettings.h>
--- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrcontacthandler.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrcontacthandler.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -46,7 +46,7 @@
 #include <AiwGenericParam.h>
 
 //FS Email framework
-#include "CFSMailBox.h"
+#include "cfsmailbox.h"
 //</cmail>
 
 //MRUI
--- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrresponsefield.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrresponsefield.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -23,7 +23,7 @@
 #include "cesmrlayoutmgr.h"
 #include "nmrlayoutmanager.h"
 #include "esmrhelper.h"
-#include "CFSMailBox.h"
+#include "cfsmailbox.h"
 
 #include <esmrgui.rsg>
 #include <StringLoader.h>
--- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrviewerattachmentsfield.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrviewerattachmentsfield.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -25,7 +25,7 @@
 #include <StringLoader.h>
 //<cmail>
 #include "esmricalvieweropcodes.hrh"
-#include "CFSMailMessage.h"
+#include "cfsmailmessage.h"
 //</cmail>
 
 #include "cesmrrichtextviewer.h"
--- a/meetingrequest/mrgui/src/cesmraddressselectionquery.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mrgui/src/cesmraddressselectionquery.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -21,7 +21,7 @@
 #include "cesmraddressselectionquery.h"
 
 #include <aknlists.h>
-#include <aknpopup.h>
+#include <aknPopup.h>
 #include <bautils.h>
 #include <esmrgui.rsg>
 #include <data_caging_path_literals.hrh>
@@ -115,7 +115,7 @@
 // -----------------------------------------------------------------------------
 //
 TInt CESMRAddressSelectionQuery::ExecuteAddressSelectionListL( 
-		const RPointerArray<HBufC>& aAddressArray )
+        const RPointerArray<HBufC>& aAddressArray )
     {
     FUNC_LOG;
     TInt ret = ExecuteL( aAddressArray );
@@ -127,13 +127,13 @@
 // -----------------------------------------------------------------------------
 //
 TInt CESMRAddressSelectionQuery::ExecuteL( 
-		const RPointerArray<HBufC>& aAddressArray )
+        const RPointerArray<HBufC>& aAddressArray )
     {
     FUNC_LOG;
     TInt response( KErrCancel );
 
     CAknDoublePopupMenuStyleListBox* list = 
-    	new( ELeave )CAknDoublePopupMenuStyleListBox;
+        new( ELeave )CAknDoublePopupMenuStyleListBox;
     CleanupStack::PushL( list );
     
     CAknPopupList* popupList = CAknPopupList::NewL( list,
@@ -175,14 +175,14 @@
 //
 
 void CESMRAddressSelectionQuery::SetListQueryTextsL( 
-		CDesCArrayFlat* aItemArray,
-		CAknPopupList* aPopupList,
-		const RPointerArray<HBufC>& aAddressArray )
+        CDesCArrayFlat* aItemArray,
+        CAknPopupList* aPopupList,
+        const RPointerArray<HBufC>& aAddressArray )
     {
     FUNC_LOG;
     // Set title for popup
     aPopupList->SetTitleL( *iEnv->AllocReadResourceAsDes16LC( 
-    		R_QTN_MEET_REQ_LOC_ADDRESS_SELECTION_TITLE ) );
+            R_QTN_MEET_REQ_LOC_ADDRESS_SELECTION_TITLE ) );
     CleanupStack::PopAndDestroy(); // Resource string
 
     // Amount of addresses the contact has
@@ -193,7 +193,7 @@
     item.CleanupClosePushL();
     
     for ( TInt i(0); i < itemCount; ++i )
-    	{
+        {
         // Descriptor has separator between label and the actual address
         TPtr16 temp = aAddressArray[i]->Des();
 
@@ -203,25 +203,25 @@
             temp.SetLength( KMaxLength );
             }
         
-    	// Finding the first instance of a separator
-    	TInt offset = temp.Find( KSeparator );
-    	
-    	if( 0 <= offset && offset < KMaxLength )
-    	    {
-    	    // Forming label from the beginning to the first separator
-    	    TPtrC16 tempLabel = temp.Mid( 0, offset );
-    	    
-    	    // Forming address from the first separator to the end
-    	    TPtrC16 tempAddress = temp.Mid( 
-    	            offset + KSeparatorLength, 
-    	            temp.Length() - offset - KSeparatorLength );
-    	        
-    	    // appending address item to array
-    	    item.Format( KListItemFormat, &tempLabel, &tempAddress );
-    	    aItemArray->AppendL( item );
-    	    }
-    	
-    	}
+        // Finding the first instance of a separator
+        TInt offset = temp.Find( KSeparator );
+        
+        if( 0 <= offset && offset < KMaxLength )
+            {
+            // Forming label from the beginning to the first separator
+            TPtrC16 tempLabel = temp.Mid( 0, offset );
+            
+            // Forming address from the first separator to the end
+            TPtrC16 tempAddress = temp.Mid( 
+                    offset + KSeparatorLength, 
+                    temp.Length() - offset - KSeparatorLength );
+                
+            // appending address item to array
+            item.Format( KListItemFormat, &tempLabel, &tempAddress );
+            aItemArray->AppendL( item );
+            }
+        
+        }
     CleanupStack::PopAndDestroy( &item );
     }
 
--- a/meetingrequest/mrgui/src/cesmrcontactmenuurlhandler.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mrgui/src/cesmrcontactmenuurlhandler.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -32,12 +32,12 @@
 #include <coemain.h>
 #include <gulicon.h>
 #include <AknsUtils.h>
-#include <FavouritesDb.h>
+#include <favouritesdb.h>
 #include <apgtask.h>
 #include <apgcli.h>
 #include <AknQueryDialog.h>
 #include <aknnotewrappers.h>
-#include <FeatMgr.h>
+#include <featmgr.h>
 // for intranet application opening
 #include <AiwServiceHandler.h>
 #include <data_caging_path_literals.hrh>
@@ -49,7 +49,7 @@
 
 /// Unnamed namespace for local definitions
 namespace // codescanner::namespace
-	{
+    {
 // URL actionmenu uids
 const TUid KUidOpenInBrowser =
     {
@@ -87,7 +87,7 @@
 // ---------------------------------------------------------------------------
 //
 CESMRContactMenuUrlHandler::CESMRContactMenuUrlHandler( 
-		CFscContactActionMenu& aContactActionMenu ) :
+        CFscContactActionMenu& aContactActionMenu ) :
     iContactActionMenu( aContactActionMenu )
     {
     FUNC_LOG;
@@ -103,7 +103,7 @@
     {
     FUNC_LOG;
     CESMRContactMenuUrlHandler* self = 
-		new (ELeave) CESMRContactMenuUrlHandler( aContactActionMenu );
+        new (ELeave) CESMRContactMenuUrlHandler( aContactActionMenu );
     return self;
     }
 
@@ -147,8 +147,8 @@
 // ---------------------------------------------------------------------------
 //
 void CESMRContactMenuUrlHandler::CreateMenuItemL( 
-		TInt aResourceId, 
-		TUid aCommandUid )
+        TInt aResourceId, 
+        TUid aCommandUid )
     {
     FUNC_LOG;
     CGulIcon* itemIcon = CreateIconL(aCommandUid);
@@ -159,8 +159,8 @@
 
     HBufC* text = CCoeEnv::Static()->AllocReadResourceLC( aResourceId );
     CFscContactActionMenuItem* newItem = 
-		iContactActionMenu.Model().NewMenuItemL( *text,
-												 itemIcon,
+        iContactActionMenu.Model().NewMenuItemL( *text,
+                                                 itemIcon,
                                                  1,
                                                  EFalse,
                                                  aCommandUid );
@@ -226,7 +226,7 @@
 // ---------------------------------------------------------------------------
 //
 void CESMRContactMenuUrlHandler::InitOptionsMenuL( 
-		CEikMenuPane* aActionMenuPane )
+        CEikMenuPane* aActionMenuPane )
     {
     FUNC_LOG;
     CEikMenuPaneItem::SData data;
@@ -239,7 +239,7 @@
     data.iCommandId = command;
     command++;//dynamic command ids
     CCoeEnv::Static()->ReadResourceL( 
-    		data.iText, R_QTN_MEET_REQ_VIEWER_OPTIONS_OPEN_IN_WEB );
+            data.iText, R_QTN_MEET_REQ_VIEWER_OPTIONS_OPEN_IN_WEB );
     aActionMenuPane->AddMenuItemL( data );
 
     if(IsServiceAvailableL(R_INTRANET_AIW_INTEREST) &&
@@ -248,13 +248,13 @@
         data.iCommandId = command;
         command++;//dynamic command ids
         CCoeEnv::Static()->ReadResourceL( 
-        		data.iText, R_QTN_MEET_REQ_FSOPTIONS_OPEN_IN_INTRA );
+                data.iText, R_QTN_MEET_REQ_FSOPTIONS_OPEN_IN_INTRA );
         aActionMenuPane->AddMenuItemL( data );
         }
 
     data.iCommandId = command;
     CCoeEnv::Static()->ReadResourceL( 
-    		data.iText, R_QTN_MEET_REQ_VIEWER_OPTIONS_BOOKMARK );
+            data.iText, R_QTN_MEET_REQ_VIEWER_OPTIONS_BOOKMARK );
     aActionMenuPane->AddMenuItemL( data );
     }
 
@@ -326,13 +326,13 @@
 
     //fill list
     CreateMenuItemL( R_QTN_MEET_REQ_VIEWER_OPTIONS_OPEN_IN_WEB, 
-					 KUidOpenInBrowser);
+                     KUidOpenInBrowser);
 
     if(IsServiceAvailableL(R_INTRANET_AIW_INTEREST) &&
        FeatureManager::FeatureSupported( KFeatureIdFfIntranetBrowsing ) )
         {
         CreateMenuItemL( R_QTN_MEET_REQ_FSOPTIONS_OPEN_IN_INTRA, 
-						 KUidOpenInIntranet);
+                         KUidOpenInIntranet);
         }
 
     CreateMenuItemL(R_QTN_MEET_REQ_VIEWER_OPTIONS_BOOKMARK, KUidBookmark);
@@ -375,7 +375,7 @@
         User::LeaveIfError( appArcSession.Connect() ); 
         TThreadId id;
         User::LeaveIfError( appArcSession.StartDocument ( 
-        		*param, KUidBrowser, id ) );
+                *param, KUidBrowser, id ) );
         CleanupStack::PopAndDestroy( &appArcSession );
         }
     CleanupStack::PopAndDestroy( param );
@@ -396,9 +396,9 @@
     inParamList.AppendL( inParam );
 
     ServiceHandlerL().ExecuteServiceCmdL( 
-							KAiwCmdView, 
-							inParamList, 
-							ServiceHandlerL().OutParamListL() );
+                            KAiwCmdView, 
+                            inParamList, 
+                            ServiceHandlerL().OutParamListL() );
     CleanupStack::PopAndDestroy( eightBitUrl );
     }
 
@@ -416,7 +416,7 @@
 
     // Read default name from resources
     HBufC* defaultName =CCoeEnv::Static()->AllocReadResourceLC ( 
-									R_QTN_CALENDAR_DEFAULT_BOOKMARK );
+                                    R_QTN_CALENDAR_DEFAULT_BOOKMARK );
 
     TBuf<KMaxBookmarkNameLength> retName;
     retName.Copy( defaultName->Des() );
@@ -430,31 +430,31 @@
         CleanupStack::PopAndDestroy ( 2, item ); // item, defaultName
         }
     else
-    	{
-    	item->SetNameL( retName );
-		item->SetUrlL( *iUrl );
+        {
+        item->SetNameL( retName );
+        item->SetUrlL( *iUrl );
 
-		RFavouritesSession sess; // codescanner::resourcenotoncleanupstack
-		RFavouritesDb db; // codescanner::resourcenotoncleanupstack
+        RFavouritesSession sess; // codescanner::resourcenotoncleanupstack
+        RFavouritesDb db; // codescanner::resourcenotoncleanupstack
 
-		User::LeaveIfError( sess.Connect() );
-		CleanupClosePushL<RFavouritesSession> ( sess );
-		User::LeaveIfError( db.Open( sess, KBrowserBookmarks ) );
-		CleanupClosePushL<RFavouritesDb> ( db );
+        User::LeaveIfError( sess.Connect() );
+        CleanupClosePushL<RFavouritesSession> ( sess );
+        User::LeaveIfError( db.Open( sess, KBrowserBookmarks ) );
+        CleanupClosePushL<RFavouritesDb> ( db );
 
-		// add item
-		db.Add( *item, ETrue );
-		// Close the database.
-		db.Close();
+        // add item
+        db.Add( *item, ETrue );
+        // Close the database.
+        db.Close();
 
-		HBufC * msgBuffer = CCoeEnv::Static()->AllocReadResourceLC( 
-										R_QTN_CALENDAR_BOOKMARK_SAVED );
-		CAknConfirmationNote* note = new(ELeave)CAknConfirmationNote( ETrue );
-		note->ExecuteLD ( *msgBuffer );
+        HBufC * msgBuffer = CCoeEnv::Static()->AllocReadResourceLC( 
+                                        R_QTN_CALENDAR_BOOKMARK_SAVED );
+        CAknConfirmationNote* note = new(ELeave)CAknConfirmationNote( ETrue );
+        note->ExecuteLD ( *msgBuffer );
 
-		// item, db, sess, defaultName, msgBuffer
-		CleanupStack::PopAndDestroy ( 5, item ); // codescanner::magicnumbers
-    	}
+        // item, db, sess, defaultName, msgBuffer
+        CleanupStack::PopAndDestroy ( 5, item ); // codescanner::magicnumbers
+        }
     }
 
 // ---------------------------------------------------------------------------
--- a/meetingrequest/mrgui/src/cesmrviewerdialog.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mrgui/src/cesmrviewerdialog.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -79,7 +79,7 @@
 #include "esmrconfig.hrh"
 #include "mesmrfieldevent.h"
 
-#include "CFSMailBox.h"
+#include "cfsmailbox.h"
 
 /// Unnamed namespace for local definitions
 namespace  { // codescanner::namespace
--- a/meetingrequest/mrgui/src/cmrresponsedialogview.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mrgui/src/cmrresponsedialogview.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -177,10 +177,10 @@
     CCoeControl::SetContainerWindowL( aContainer );
     iEditor = new (ELeave )CEikRichTextEditor();
     iEditor->ConstructL( this, 0, 0, CEikEdwin::ENoAutoSelection, 0, 0 );
+    iEditor->SetContainerWindowL(*this);
+    iEditor->SetSize(Rect().Size());
+    iEditor->SetSkinBackgroundControlContextL( iBgContext );
     iEditor->SetFocus( ETrue );
-    iEditor->SetContainerWindowL( *this );
-    iEditor->SetSize( Rect().Size() );
-    iEditor->SetSkinBackgroundControlContextL( iBgContext );
     
     // Create vertical scrollbar for editor
     iScrollBarFrame = iEditor->CreateScrollBarFrameL();
--- a/meetingrequest/mrgui/src/resmrstatic.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mrgui/src/resmrstatic.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -21,8 +21,8 @@
 
 #include "cesmrcontactmenuhandler.h"
 #include "cesmrcontactmanagerhandler.h"
-#include "CFSMailClient.h"
-#include "CFSMailBox.h"
+#include "cfsmailclient.h"
+#include "cfsmailbox.h"
 // <cmail> Removed profiling </cmail>
 
 /**
--- a/meetingrequest/mricalviewer/inc/cesmrimapicalretriever.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mricalviewer/inc/cesmrimapicalretriever.h	Fri Feb 19 22:37:30 2010 +0200
@@ -22,7 +22,7 @@
 #include <e32base.h>
 //<cmail>
 #include "mesmragnimportobserver.h"
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 //</cmail>
 #include "cesmricalviewerasynccommand.h"
 
--- a/meetingrequest/mricalviewer/inc/cesmrimapmailfetcher.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mricalviewer/inc/cesmrimapmailfetcher.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,7 +21,7 @@
 
 #include <e32base.h>
 //<cmail>
-#include "MFSMailRequestObserver.h"
+#include "mfsmailrequestobserver.h"
 #include "mesmricalviewerobserver.h"
 //</cmail>
 #include "cesmricalviewerasynccommand.h"
--- a/meetingrequest/mricalviewer/src/cesmricalviewercanviewmr.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mricalviewer/src/cesmricalviewercanviewmr.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -21,8 +21,8 @@
 #include "cesmricalviewercanviewmr.h"
 //<cmail>
 #include "esmricalvieweropcodes.hrh"
-#include "CFSMailCommon.h"
-#include "CFSMailMessage.h"
+#include "cfsmailcommon.h"
+#include "cfsmailmessage.h"
 //</cmail>
 
 // ======== MEMBER FUNCTIONS ========
--- a/meetingrequest/mricalviewer/src/cesmricalviewercmdhandler.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mricalviewer/src/cesmricalviewercmdhandler.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -29,7 +29,7 @@
 
 #include <calsession.h>
 //<cmail>
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 #include "esmricalvieweropcodes.hrh"
 #include "esmricalviewerdefs.hrh"
 //</cmail>
--- a/meetingrequest/mricalviewer/src/cesmricalvieweremailasynccmd.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mricalviewer/src/cesmricalvieweremailasynccmd.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -23,7 +23,7 @@
 //<cmail>
 #include "esmricalvieweropcodes.hrh"
 #include <calsession.h>
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 //</cmail>
 #include <calentry.h>
 
--- a/meetingrequest/mricalviewer/src/cesmricalviewerloadmrdatacmd.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mricalviewer/src/cesmricalviewerloadmrdatacmd.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -22,7 +22,7 @@
 //<cmail>
 #include "esmricalvieweropcodes.hrh"
 #include <calsession.h>
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 //</cmail>
 
 #include "cesmrmrinfoicalretriever.h"
--- a/meetingrequest/mricalviewer/src/cesmricalviewerremovemrfromcalcmd.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mricalviewer/src/cesmricalviewerremovemrfromcalcmd.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -24,7 +24,7 @@
 //<cmail>
 #include "esmricalvieweropcodes.hrh"
 #include <calsession.h>
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 //</cmail>
 #include <calentry.h>
 
--- a/meetingrequest/mricalviewer/src/cesmricalviewerresolvemrmethodasync.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mricalviewer/src/cesmricalviewerresolvemrmethodasync.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -23,7 +23,7 @@
 //<cmail>
 #include "esmricalvieweropcodes.hrh"
 #include <calsession.h>
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 //</cmail>
 #include <calentry.h>
 
--- a/meetingrequest/mricalviewer/src/cesmricalviewerresponsetomrcmd.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mricalviewer/src/cesmricalviewerresponsetomrcmd.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -28,7 +28,7 @@
 //<cmail>
 #include "esmricalvieweropcodes.hrh"
 #include <calsession.h>
-#include "CFSMailClient.h"
+#include "cfsmailclient.h"
 //</cmail>
 #include <calentry.h>
 
--- a/meetingrequest/mricalviewer/src/cesmrimapicalretriever.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mricalviewer/src/cesmrimapicalretriever.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -25,11 +25,11 @@
 #include "esmrconfig.hrh"
 
 //<cmail>
-#include "CFSMailClient.h"
-#include "CFSMailBox.h"
-#include "CFSMailMessage.h"
-#include "CFSMailMessagePart.h"
-#include "CFSMailCommon.h"
+#include "cfsmailclient.h"
+#include "cfsmailbox.h"
+#include "cfsmailmessage.h"
+#include "cfsmailmessagepart.h"
+#include "cfsmailcommon.h"
 #include "cesmragnexternalinterface.h"
 #include "esmricalvieweropcodes.hrh"
 //</cmail>
--- a/meetingrequest/mricalviewer/src/cesmrimapmailfetcher.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mricalviewer/src/cesmrimapmailfetcher.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -20,10 +20,10 @@
 #include "cesmrimapmailfetcher.h"
 #include "esmricalviewerutils.h"
 //<cmail>
-#include "CFSMailClient.h"
-#include "CFSMailFolder.h"
-#include "CFSMailMessagePart.h"
-#include "CFSMailCommon.h"
+#include "cfsmailclient.h"
+#include "cfsmailfolder.h"
+#include "cfsmailmessagepart.h"
+#include "cfsmailcommon.h"
 #include "esmricalvieweropcodes.hrh"
 //</cmail>
 
--- a/meetingrequest/mricalviewer/src/cesmrmrinfoicalretriever.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mricalviewer/src/cesmrmrinfoicalretriever.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -27,11 +27,11 @@
 
 //<cmail>
 #include "esmricalvieweropcodes.hrh"
-#include "CFSMailClient.h"
-#include "CFSMailBox.h"
-#include "CFSMailMessage.h"
-#include "CFSMailMessagePart.h"
-#include "CFSMailCommon.h"
+#include "cfsmailclient.h"
+#include "cfsmailbox.h"
+#include "cfsmailmessage.h"
+#include "cfsmailmessagepart.h"
+#include "cfsmailcommon.h"
 #include "mmrinfoprocessor.h"
 #include "mmrattendee.h"
 #include "mmrrecurrencerule.h"
--- a/meetingrequest/mricalviewer/src/cesmruilauncher.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mricalviewer/src/cesmruilauncher.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -27,7 +27,7 @@
 #include <CalenInterimUtils2.h>
 //<cmail>
 #include "FreestyleEmailUiConstants.h"
-#include "CFSMailMessage.h"
+#include "cfsmailmessage.h"
 #include "fsmtmsuids.h"
 #include <coemain.h>
 #include <coeaui.h>
--- a/meetingrequest/mricalviewer/src/esmricalviewerutils.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mricalviewer/src/esmricalviewerutils.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -20,10 +20,10 @@
 #include "esmricalviewerutils.h"
 #include "cesmrattachmentinfo.h"
 //<cmail>
-#include "CFSMailMessagePart.h"
-#include "CFSMailClient.h"
-#include "CFSMailMessage.h"
-#include "CFSMailBox.h"
+#include "cfsmailmessagepart.h"
+#include "cfsmailclient.h"
+#include "cfsmailmessage.h"
+#include "cfsmailbox.h"
 //</cmail>
 
 #include <calentry.h>
--- a/meetingrequest/mrtasks/inc/cesmrfsemailmanager.h	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mrtasks/inc/cesmrfsemailmanager.h	Fri Feb 19 22:37:30 2010 +0200
@@ -21,7 +21,7 @@
 
 #include <e32base.h>
 //<cmail>
-#include "CFSMailCommon.h"
+#include "cfsmailcommon.h"
 #include "mmrinfoprocessor.h"
 #include "esmrdef.h"
 //</cmail>
--- a/meetingrequest/mrtasks/src/cesmrfsemailmanager.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mrtasks/src/cesmrfsemailmanager.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -21,13 +21,13 @@
 #include "emailtrace.h"
 #include "cesmrfsemailmanager.h"
 
-#include "CFSMailClient.h"
-#include "CFSMailBox.h"
-#include "CFSMailMessage.h"
-#include "CFSMailMessagePart.h"
+#include "cfsmailclient.h"
+#include "cfsmailbox.h"
+#include "cfsmailmessage.h"
+#include "cfsmailmessagepart.h"
 #include "mmrinfoprocessor.h"
-#include "CFSMailCommon.h"
-#include "CFSMailPlugin.h"
+#include "cfsmailcommon.h"
+#include "cfsmailplugin.h"
 
 #include "tesmrinputparams.h"
 #include "esmrconfig.hrh"
--- a/meetingrequest/mrtasks/src/cesmrsendmrfsmailreplytask.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mrtasks/src/cesmrsendmrfsmailreplytask.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -24,7 +24,7 @@
 #include <cmrmailboxutils.h>
 #include <calentry.h>
 //<cmail>
-#include "CFSMailMessage.h"
+#include "cfsmailmessage.h"
 #include <coemain.h>
 #include <coeaui.h>
 #include "FreestyleEmailUiConstants.h"
--- a/meetingrequest/mrtasks/src/cesmrtaskfactory.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/meetingrequest/mrtasks/src/cesmrtaskfactory.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -35,10 +35,10 @@
 #include "esmrconfig.hrh"
 
 //<cmail>
-#include "CFSMailCommon.h"
-#include "CFSMailClient.h"
-#include "CFSMailMessage.h"
-#include "CFSMailBox.h"
+#include "cfsmailcommon.h"
+#include "cfsmailclient.h"
+#include "cfsmailmessage.h"
+#include "cfsmailbox.h"
 //</cmail>
 
 namespace {