Revision: 201035
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 17 Sep 2010 08:28:39 +0300
changeset 70 a15d9966050f
parent 61 8ba0afbb4637
child 72 6f657153cbc5
Revision: 201035 Kit: 201037
email/pop3andsmtpmtm/clientmtms/group/IMCM.mmp
email/pop3andsmtpmtm/popservermtm/src/POPSMTM.CPP
inc/convergedmessage.h
inc/msgcontacthandler.h
messagingapp/conf/CI_messaging.confml
messagingapp/conf/messaging_conf.pro
messagingapp/msgappfw/client/src/rcssession.cpp
messagingapp/msgappfw/plugins/previewplugin/group/cspreviewplugin.mmp
messagingapp/msgappfw/plugins/previewplugin/src/ccspreviewpluginhandler.cpp
messagingapp/msgappfw/server/inc/ccsconversation.h
messagingapp/msgappfw/server/src/ccsconversation.cpp
messagingapp/msgappfw/server/src/ccsconversationcachehelper.cpp
messagingapp/msgnotifications/bwins/msgerrorwatcheru.def
messagingapp/msgnotifications/eabi/msgerrorwatcheru.def
messagingapp/msgnotifications/flashmsgnotifier/flashmsgnotifier.pro
messagingapp/msgnotifications/flashmsgnotifier/inc/flashmsgnotifier.h
messagingapp/msgnotifications/flashmsgnotifier/src/flashmsgnotifier.cpp
messagingapp/msgnotifications/msgerrornotifier/inc/msgerrornotifiersvc.h
messagingapp/msgnotifications/msgerrornotifier/msgerrornotifier.pro
messagingapp/msgnotifications/msgerrornotifier/src/msgerrornotifiersvc.cpp
messagingapp/msgnotifications/msgerrorwatcher/inc/msgcenrepobserver.h
messagingapp/msgnotifications/msgerrorwatcher/inc/msgerrorcommdbobserver.h
messagingapp/msgnotifications/msgerrorwatcher/inc/msgerrordiskspaceobserver.h
messagingapp/msgnotifications/msgerrorwatcher/inc/msgerrorextsmsdiskspaceobserver.h
messagingapp/msgnotifications/msgerrorwatcher/inc/msgerrorroamingobserver.h
messagingapp/msgnotifications/msgerrorwatcher/inc/msgerrorsmsdiskspaceobserver.h
messagingapp/msgnotifications/msgerrorwatcher/inc/msgerrorstartupobserver.h
messagingapp/msgnotifications/msgerrorwatcher/inc/msgerrorwatcher.h
messagingapp/msgnotifications/msgerrorwatcher/inc/msgerrorwatcher.hrh
messagingapp/msgnotifications/msgerrorwatcher/inc/msgerrorwatcher_p.h
messagingapp/msgnotifications/msgerrorwatcher/msgerrorwatcher.pro
messagingapp/msgnotifications/msgerrorwatcher/rom/msgerrorwatcher.iby
messagingapp/msgnotifications/msgerrorwatcher/src/msgcenrepobserver.cpp
messagingapp/msgnotifications/msgerrorwatcher/src/msgerrorcommdbobserver.cpp
messagingapp/msgnotifications/msgerrorwatcher/src/msgerrordiskspaceobserver.cpp
messagingapp/msgnotifications/msgerrorwatcher/src/msgerrorextsmsdiskspaceobserver.cpp
messagingapp/msgnotifications/msgerrorwatcher/src/msgerrorroamingobserver.cpp
messagingapp/msgnotifications/msgerrorwatcher/src/msgerrorsmsdiskspaceobserver.cpp
messagingapp/msgnotifications/msgerrorwatcher/src/msgerrorstartupobserver.cpp
messagingapp/msgnotifications/msgerrorwatcher/src/msgerrorwatcher.cpp
messagingapp/msgnotifications/msgerrorwatcher/src/msgerrorwatcher_p.cpp
messagingapp/msgnotifications/msgindicatorplugin/inc/msgindicator.h
messagingapp/msgnotifications/msgindicatorplugin/msgindicatorplugin.pro
messagingapp/msgnotifications/msgindicatorplugin/src/msgindicator.cpp
messagingapp/msgnotifications/msgnotifications.pro
messagingapp/msgnotifications/msgnotifier/inc/msgnotifier.h
messagingapp/msgnotifications/msgnotifier/inc/msgnotifier_p.h
messagingapp/msgnotifications/msgnotifier/msgnotifier.pro
messagingapp/msgnotifications/msgnotifier/src/msgnotifier.cpp
messagingapp/msgnotifications/msgnotifier/src/msgnotifier_p.cpp
messagingapp/msgnotifications/msgnotifier/tsrc/tsrc.pro
messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/mmstestbed/mmstestbed.pro
messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsgplugin/data/SmileyFace.gif
messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsgplugin/data/sample.txt
messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsgplugin/data/testmmsplugin.cfg
messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsgplugin/data/testmmsplugin.pl
messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsgplugin/inc/testmmsplugin.h
messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsgplugin/inc/testmmsplugin.ini
messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsgplugin/src/testmmsplugin.cpp
messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsgplugin/testmmsplugin.pro
messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsplugin/data/SmileyFace.gif
messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsplugin/data/sample.txt
messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsplugin/data/testmmsplugin.cfg
messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsplugin/data/testmmsplugin.pl
messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsplugin/inc/testmmsplugin.h
messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsplugin/inc/testmmsplugin.ini
messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsplugin/src/testmmsplugin.cpp
messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsplugin/testmmsplugin.pro
messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/unittest_mmsplugin.pro
messagingapp/msgservices/msgserviceapp/inc/msgserviceviewmanager.h
messagingapp/msgservices/msgserviceapp/inc/msgservicewindow.h
messagingapp/msgservices/msgserviceapp/inc/msgurihandlerinterface.h
messagingapp/msgservices/msgserviceapp/msgserviceapp.pro
messagingapp/msgservices/msgserviceapp/rom/msgserviceapp.iby
messagingapp/msgservices/msgserviceapp/service_conf.xml
messagingapp/msgservices/msgserviceapp/src/msgserviceviewmanager.cpp
messagingapp/msgservices/msgserviceapp/src/msgservicewindow.cpp
messagingapp/msgservices/msgserviceapp/src/msgurihandlerinterface.cpp
messagingapp/msgsettings/msginit/src/simscnumberdetector.cpp
messagingapp/msgsettings/msginit/tsrc/testmsginit/inc/testmsginit.h
messagingapp/msgsettings/msginit/tsrc/testmsginit/inc/testoutboxobserver_stub.h
messagingapp/msgsettings/msginit/tsrc/testmsginit/inc/testoutboxsender_stub.h
messagingapp/msgsettings/msginit/tsrc/testmsginit/inc/testsimnumdetector_stub.h
messagingapp/msgsettings/msginit/tsrc/testmsginit/src/testmsginit.cpp
messagingapp/msgsettings/msginit/tsrc/testmsginit/src/testoutboxobserver_stub.cpp
messagingapp/msgsettings/msginit/tsrc/testmsginit/src/testoutboxsender_stub.cpp
messagingapp/msgsettings/msginit/tsrc/testmsginit/src/testsimnumdetector_stub.cpp
messagingapp/msgsettings/settingsview/src/msgsettingsview.cpp
messagingapp/msgui/appengine/inc/conversationsmodel.h
messagingapp/msgui/appengine/src/conversationmsgstorehandler.cpp
messagingapp/msgui/appengine/src/conversationsmodel.cpp
messagingapp/msgui/bwins/conversationviewu.def
messagingapp/msgui/bwins/msgaudiofetcheru.def
messagingapp/msgui/bwins/unifiededitoru.def
messagingapp/msgui/bwins/unifiedvieweru.def
messagingapp/msgui/conversationview/conversationview.pro
messagingapp/msgui/conversationview/inc/msgcontactcardwidget.h
messagingapp/msgui/conversationview/inc/msgconversationbaseview.h
messagingapp/msgui/conversationview/inc/msgconversationview.h
messagingapp/msgui/conversationview/inc/msgconversationviewitem.h
messagingapp/msgui/conversationview/inc/msgconversationwidget.h
messagingapp/msgui/conversationview/inc/msgeditorwidget.h
messagingapp/msgui/conversationview/inc/msgviewutils.h
messagingapp/msgui/conversationview/resources/layouts/msgconversationwidget.widgetml
messagingapp/msgui/conversationview/src/msgcontactcardwidget.cpp
messagingapp/msgui/conversationview/src/msgconversationbaseview.cpp
messagingapp/msgui/conversationview/src/msgconversationview.cpp
messagingapp/msgui/conversationview/src/msgconversationviewitem.cpp
messagingapp/msgui/conversationview/src/msgeditorwidget.cpp
messagingapp/msgui/conversationview/tsrc/tsrc.pro
messagingapp/msgui/conversationview/tsrc/unittests/unittest_msgconversationwidget/hbwidget.h
messagingapp/msgui/conversationview/tsrc/unittests/unittest_msgconversationwidget/msgconversationwidgetheaders.h
messagingapp/msgui/conversationview/tsrc/unittests/unittest_msgconversationwidget/unittest_msgconversationwidget.cpp
messagingapp/msgui/conversationview/tsrc/unittests/unittest_msgconversationwidget/unittest_msgconversationwidget.pro
messagingapp/msgui/conversationview/tsrc/unittests/unittests.pro
messagingapp/msgui/eabi/conversationviewu.def
messagingapp/msgui/eabi/msgaudiofetcheru.def
messagingapp/msgui/eabi/unifiededitoru.def
messagingapp/msgui/eabi/unifiedvieweru.def
messagingapp/msgui/inc/msgaudiofetcherdialog.h
messagingapp/msgui/inc/msgbaseview.h
messagingapp/msgui/msgapp/inc/msgactivityhandler.h
messagingapp/msgui/msgapp/inc/msglistviewitem.h
messagingapp/msgui/msgapp/inc/msgmainwindow.h
messagingapp/msgui/msgapp/inc/msgviewmanager.h
messagingapp/msgui/msgapp/msgapp.pro
messagingapp/msgui/msgapp/rom/messaging_uda.confml
messagingapp/msgui/msgapp/rom/msgapp.iby
messagingapp/msgui/msgapp/src/msgactivityhandler.cpp
messagingapp/msgui/msgapp/src/msglistview.cpp
messagingapp/msgui/msgapp/src/msglistviewitem.cpp
messagingapp/msgui/msgapp/src/msgmainwindow.cpp
messagingapp/msgui/msgapp/src/msgviewmanager.cpp
messagingapp/msgui/msgaudiofetcher/inc/msgaudiofetcherview.h
messagingapp/msgui/msgaudiofetcher/inc/msgaudiofetcherwidget.h
messagingapp/msgui/msgaudiofetcher/msgaudiofetcher.pro
messagingapp/msgui/msgaudiofetcher/src/msgaudiofetcherdialog.cpp
messagingapp/msgui/msgaudiofetcher/src/msgaudiofetcherview.cpp
messagingapp/msgui/msgaudiofetcher/src/msgaudiofetcherwidget.cpp
messagingapp/msgui/msgaudiofetcher/src/msgaudioselectionengine.cpp
messagingapp/msgui/msguiutils/src/msgcontactsutil.cpp
messagingapp/msgui/msguiutils/tsrc/unittest_msguiutils/mmstestbed/inc/mmsreadfile.h
messagingapp/msgui/msguiutils/tsrc/unittest_msguiutils/mmstestbed/inc/mmstestbed.h
messagingapp/msgui/msguiutils/tsrc/unittest_msguiutils/mmstestbed/inc/mmstestbed.hrh
messagingapp/msgui/msguiutils/tsrc/unittest_msguiutils/mmstestbed/inc/mmsteststaticutils.h
messagingapp/msgui/msguiutils/tsrc/unittest_msguiutils/mmstestbed/inc/mmstestuitimer.h
messagingapp/msgui/msguiutils/tsrc/unittest_msguiutils/mmstestbed/src/mmsreadfile.cpp
messagingapp/msgui/msguiutils/tsrc/unittest_msguiutils/mmstestbed/src/mmstestbed.cpp
messagingapp/msgui/msguiutils/tsrc/unittest_msguiutils/mmstestbed/src/mmsteststaticutils.cpp
messagingapp/msgui/msguiutils/tsrc/unittest_msguiutils/mmstestbed/src/mmstestuitimer.cpp
messagingapp/msgui/unifiededitor/inc/msgunieditoraddress.h
messagingapp/msgui/unifiededitor/inc/msgunieditorattachment.h
messagingapp/msgui/unifiededitor/inc/msgunieditorattachmentcontainer.h
messagingapp/msgui/unifiededitor/inc/msgunieditorbody.h
messagingapp/msgui/unifiededitor/inc/msgunieditorlineedit.h
messagingapp/msgui/unifiededitor/inc/msgunieditorpixmapwidget.h
messagingapp/msgui/unifiededitor/inc/msgunieditorsubject.h
messagingapp/msgui/unifiededitor/inc/msgunieditorview.h
messagingapp/msgui/unifiededitor/src/msgunieditoraddress.cpp
messagingapp/msgui/unifiededitor/src/msgunieditorattachment.cpp
messagingapp/msgui/unifiededitor/src/msgunieditorbody.cpp
messagingapp/msgui/unifiededitor/src/msgunieditorpixmapwidget.cpp
messagingapp/msgui/unifiededitor/src/msgunieditorview.cpp
messagingapp/msgui/unifiededitor/unifiededitor.pro
messagingapp/msgui/unifiedviewer/inc/unifiedviewer.h
messagingapp/msgui/unifiedviewer/inc/univiewerattachmentwidget.h
messagingapp/msgui/unifiedviewer/inc/univieweraudiowidget.h
messagingapp/msgui/unifiedviewer/inc/univiewerpixmapwidget.h
messagingapp/msgui/unifiedviewer/src/unifiedviewer.cpp
messagingapp/msgui/unifiedviewer/src/univieweraddresswidget.cpp
messagingapp/msgui/unifiedviewer/src/univiewerattachmentwidget.cpp
messagingapp/msgui/unifiedviewer/src/univieweraudiowidget.cpp
messagingapp/msgui/unifiedviewer/src/univiewerfeeder.cpp
messagingapp/msgui/unifiedviewer/src/univiewerfeeder_p.cpp
messagingapp/msgui/unifiedviewer/src/univiewerheadercontainer.cpp
messagingapp/msgui/unifiedviewer/src/univiewerpixmapwidget.cpp
messagingapp/msgui/unifiedviewer/src/univiewertextitem.cpp
messagingapp/msgutils/bwins/convergedmessageutilsu.def
messagingapp/msgutils/convergedmessageutils/inc/convergedmessageimpl.h
messagingapp/msgutils/convergedmessageutils/src/convergedmessage.cpp
messagingapp/msgutils/convergedmessageutils/src/convergedmessageimpl.cpp
messagingapp/msgutils/convergedmessageutils/tsrc/testconvergedmessageutilsapp/mmstestbed/mmstestbed.pro
messagingapp/msgutils/convergedmessageutils/tsrc/testconvergedmessageutilsapp/testconvergedmessageutils/inc/testconvergedmessageutils.ini
messagingapp/msgutils/convergedmessageutils/tsrc/testconvergedmessageutilsapp/testconvergedmessageutils/src/testconvergedmessageutils.cpp
messagingapp/msgutils/convergedmessageutils/tsrc/testconvergedmessageutilsapp/testconvergedmessageutils/testconvergedmessageutils.pro
messagingapp/msgutils/convergedmessageutils/tsrc/testconvergedmessageutilsapp/testconvergedmessageutilsapp.pro
messagingapp/msgutils/convergedmessageutils/tsrc/tsrc.pro
messagingapp/msgutils/eabi/convergedmessageutilsu.def
messagingapp/msgutils/unidatautils/unidatamodelloader/tsrc/testunidatamodelloader/data/SmileyFace.gif
messagingapp/msgutils/unidatautils/unidatamodelloader/tsrc/testunidatamodelloader/data/sample.txt
messagingapp/msgutils/unidatautils/unidatamodelloader/tsrc/testunidatamodelloader/inc/testunidatamodelloader.h
messagingapp/msgutils/unidatautils/unidatamodelloader/tsrc/testunidatamodelloader/inc/testunidatamodelloader.ini
messagingapp/msgutils/unidatautils/unidatamodelloader/tsrc/testunidatamodelloader/src/testunidatamodelloader.cpp
messagingapp/msgutils/unidatautils/unidatamodelloader/tsrc/testunidatamodelloader/testunidatamodelloader.pro
messagingapp/msgutils/unidatautils/unidatamodelloader/tsrc/tsrc.pro
messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/bwins/test_unidatamodel_mms_pluginu.def
messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/data/TestUnidataModelMMSPluginPhoto.jpg
messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/inc/testunidatamodelmmsplugin.h
messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/inc/testunidatamodelmmsplugin.ini
messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/photo.jpg
messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/src/testunidatamodelmmsplugin.cpp
messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/testunidatamodelmmsplugin.cpp
messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/testunidatamodelmmsplugin.h
messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/testunidatamodelmmsplugin.ini
messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/testunidatamodelmmsplugin.pro
messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/tsrc.pro
messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/tsrc/bwins/test_unidatamodel_sms_pluginu.def
messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/tsrc/testunidatamodelsmsplugin/inc/testunidatamodelsmsplugin.h
messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/tsrc/testunidatamodelsmsplugin/inc/testunidatamodelsmsplugin.ini
messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/tsrc/testunidatamodelsmsplugin/src/testunidatamodelsmsplugin.cpp
messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/tsrc/testunidatamodelsmsplugin/testunidatamodelsmsplugin.cpp
messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/tsrc/testunidatamodelsmsplugin/testunidatamodelsmsplugin.h
messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/tsrc/testunidatamodelsmsplugin/testunidatamodelsmsplugin.ini
messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/tsrc/testunidatamodelsmsplugin/testunidatamodelsmsplugin.pro
messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/tsrc/tsrc.pro
messagingapp/msgutils/unieditorutils/bwins/editorgenutilsu.def
messagingapp/msgutils/unieditorutils/eabi/editorgenutilsu.def
messagingapp/msgutils/unieditorutils/editorgenutils/inc/UniEditorGenUtils.h
messagingapp/msgutils/unieditorutils/editorgenutils/src/UniEditorGenUtils.cpp
messagingapp/msgutils/unieditorutils/unieditorpluginloader/tsrc/testunieditorpluginloader/data/TestUnieditorPluginLoaderSample.txt
messagingapp/msgutils/unieditorutils/unieditorpluginloader/tsrc/testunieditorpluginloader/inc/testunieditorpluginloader.h
messagingapp/msgutils/unieditorutils/unieditorpluginloader/tsrc/testunieditorpluginloader/inc/testunieditorpluginloader.ini
messagingapp/msgutils/unieditorutils/unieditorpluginloader/tsrc/testunieditorpluginloader/src/testunieditorpluginloader.cpp
messagingapp/msgutils/unieditorutils/unieditorpluginloader/tsrc/testunieditorpluginloader/testunieditorpluginloader.pro
messagingapp/msgutils/unieditorutils/unieditorpluginloader/tsrc/tsrc.pro
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/inc/unieditormmsplugin_p.h
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/src/unieditormmsplugin_p.cpp
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgpluginapp/mmstestbed/mmstestbed.pro
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgpluginapp/testmmsgpluginapp.pro
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgpluginapp/testmmsplugin/inc/testmmsplugin.ini
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgpluginapp/testmmsplugin/src/testmmsplugin.cpp
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgpluginapp/testmmsplugin/testmmsplugin.pro
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/tsrc.pro
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/inc/unieditorsmsplugin_p.h
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/src/unieditorsmsplugin_p.cpp
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/bwins/test_sms_pluginu.def
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/1000102C.txt
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/100058DB.txt
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/101FB0D5.txt
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/101FB0D9.txt
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/cccccc00.cre
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/ced_simtsy.cfg
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/sms.rsc
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/testmsg.h
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/testsmsplugin.cpp
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/testsmsplugin.h
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/testsmsplugin.ini
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/testsmsplugin.pro
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testunieditorsmsplugin/data/TestUnieditorSMSPluginSample.txt
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testunieditorsmsplugin/data/TestUnieditorSMSPluginSample.vcf
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testunieditorsmsplugin/data/TestUnieditorSMSPluginSample.vcs
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testunieditorsmsplugin/inc/testunieditorsmsplugin.h
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testunieditorsmsplugin/inc/testunieditorsmsplugin.ini
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testunieditorsmsplugin/src/testunieditorsmsplugin.cpp
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testunieditorsmsplugin/testunieditorsmsplugin.pro
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/tsrc.pro
messagingapp/shareui/inc/shareuiprivate.h
messagingapp/shareui/shareui.pro
messagingapp/shareui/src/shareuiprivate.cpp
messagingappbase/obexmtms/Group/bld.inf
messagingappbase/smilparser/GROUP/bld.inf
messagingappbase/smilparser/SMILdtd/SRC/Smildtd.cpp
mmsengine/applicationadapter/bld/bld.inf
mmsengine/clientmtm/bld/bld.inf
mmsengine/conf/CI_mmsengine.confml
mmsengine/genutils/bld/bld.inf
mmsengine/group/bld.inf
mmsengine/mmscodec/bld/bld.inf
mmsengine/mmscodecclient/bld/bld.inf
mmsengine/mmsconninit/bld/bld.inf
mmsengine/mmsengine.pro
mmsengine/mmshttptransport/bld/bld.inf
mmsengine/mmsmessage/bld/bld.inf
mmsengine/mmsmessage/bld/mmsmessage.mmp
mmsengine/mmsmessage/inc/mmsownnumber.h
mmsengine/mmsmessage/src/mmsmessageoperation.cpp
mmsengine/mmsmessage/src/mmsownnumber.cpp
mmsengine/mmspushhandler/bld/bld.inf
mmsengine/mmsserver/bld/bld.inf
mmsengine/mmsserversettings/bld/bld.inf
mmsengine/mmswatcher/bld/bld.inf
package_definition.xml
package_map.xml
--- a/email/pop3andsmtpmtm/clientmtms/group/IMCM.mmp	Thu Sep 02 20:23:03 2010 +0300
+++ b/email/pop3andsmtpmtm/clientmtms/group/IMCM.mmp	Fri Sep 17 08:28:39 2010 +0300
@@ -48,7 +48,7 @@
 LIBRARY			centralrepository.lib tzclient.lib numberconversion.lib
 
 SOURCEPATH              .
-START RESOURCE  imcm.rss
+START RESOURCE  IMCM.rss
 LANG	SC
 HEADER
 TARGETPATH      resource/messaging
--- a/email/pop3andsmtpmtm/popservermtm/src/POPSMTM.CPP	Thu Sep 02 20:23:03 2010 +0300
+++ b/email/pop3andsmtpmtm/popservermtm/src/POPSMTM.CPP	Fri Sep 17 08:28:39 2010 +0300
@@ -40,7 +40,7 @@
 #include "POPSMTM.H"
 #include "POPS.H"
 #include "POPSOFFL.H"
-#include "iapprefs.h"
+#include "IAPPrefs.h"
 #include "PopsDele.h"
 #include "POPSRFSH.h"
 #include "PopsCpMv.h"
--- a/inc/convergedmessage.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/inc/convergedmessage.h	Fri Sep 17 08:28:39 2010 +0300
@@ -102,7 +102,9 @@
     enum MessageProperty
         {
         Unread = 0x0001,
-        Attachment = 0x0002
+        Attachment = 0x0002,
+        /** TP-RP (Reply Path) Found in first octet of Submit and Deliver. */
+        ReplyPath = 0x0004
         };
 
     /**
@@ -411,6 +413,33 @@
      * @param stream data stream from which data is deserialized. 
      */
     void deserialize(QDataStream &stream);
+    
+    /**
+     * Sets the message property, if reply-path is present
+     * @param replypath, TP-RP (Reply Path) Found in first octet of
+     * Submit and Deliver PDU
+     */
+    void setReplyPath(bool replypath = true);
+    
+    /**
+     * Tells if the reply-path is set for this message
+     * @return bool, if the reply-path exists
+     */
+    bool replyPath();
+    
+    /**
+     * Set originating service center address. This is used for reply
+     * purposes, if the reply-via-same-smsc flag is ON
+     * @param scaddress, service center address
+     */
+    void setOriginatingSC(const QString& scaddress);
+    
+    /**
+     * Get originating service center address,
+     * if preserved for reply-via-same-smsc
+     * @return originating service center address
+     */
+    const QString& originatingSC() const;
 
 private:
     /**
--- a/inc/msgcontacthandler.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/inc/msgcontacthandler.h	Fri Sep 17 08:28:39 2010 +0300
@@ -28,6 +28,7 @@
 #include <qversitcontactimporter.h>
 #include <qversitdocument.h>
 #include <qversitreader.h>
+#include <qcontactid.h>
 
 QTM_BEGIN_NAMESPACE
 class QContactManager;
@@ -37,14 +38,14 @@
 
 class MsgContactHandler
 {
-    
+
 public:
 
     /**
      * This shall resolve contact number with display name
      * @param contactNumber number to resolve
      * @param displayName resolved name
-     * @param countPhoneNumber specifies number of contacts inside 
+     * @param countPhoneNumber specifies number of contacts inside
      * the resolved contact ex mobile, home, office etc
      * @return contacts unique localId
      */
@@ -148,12 +149,12 @@
             QContactPhoneNumber::FieldNumber);
         phoneFilter.setValue(phoneNumber);
         phoneFilter.setMatchFlags(QContactFilter::MatchEndsWith);
-        
+
         QList<QContact> matchingContacts = phonebookManager.contacts(phoneFilter);
 
         return matchingContacts;
     }
-    
+
     /**
      * Get display-name of a contact from VCard.
      * @param filePath, VCard file-path
@@ -202,6 +203,46 @@
         file.close();
         return displayName;
     }
+
+    /**
+     * Get list of self-addresses
+     * @return QStringList, list of self-addresses
+     */
+    static QStringList selfAddresses()
+    {
+        QStringList selfAddrs;
+        QContactManager* contactManager =
+                                        new QContactManager("symbian");
+        QContactLocalId selfId = contactManager->selfContactId();
+        if( (selfId == 0) ||
+            (contactManager->error() == QContactManager::DoesNotExistError) )
+        {
+            // if no self-address exists
+            return selfAddrs;
+        }
+
+        QContact selfContact = contactManager->contact(selfId);
+        
+        // append numbers to the list of self-addresses
+        QList<QContactPhoneNumber> selfPhoneNumbers = 
+                        selfContact.details<QContactPhoneNumber>();
+        int selfNumCount = selfPhoneNumbers.count();
+        for(int i=0; i< selfNumCount; i++)
+        {
+            selfAddrs << selfPhoneNumbers.at(i).number();
+        }
+
+        // append email-addresses to the list
+        QList<QContactEmailAddress> selfEmailAddrs = 
+                        selfContact.details<QContactEmailAddress>();
+        int selfEmailAddrCount = selfEmailAddrs.count();
+        for(int i=0; i< selfEmailAddrCount; i++)
+        {
+            selfAddrs << selfEmailAddrs.at(i).emailAddress();
+        }
+        return selfAddrs;
+    }
+
 };
 
 #endif /* MSGCONTACTHANDLER_H_ */
Binary file messagingapp/conf/CI_messaging.confml has changed
--- a/messagingapp/conf/messaging_conf.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/conf/messaging_conf.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -23,8 +23,7 @@
 symbian{
 		BLD_INF_RULES.prj_exports += \
     "$${LITERAL_HASH}include <platform_paths.hrh>" \
-    "messaging.confml APP_LAYER_CONFML(messaging.confml)" \
-    "CI_messaging.confml APP_LAYER_CONFML(CI_messaging.confml)" \
+    "messaging.confml APP_LAYER_CONFML(messaging.confml)" \    
 		"messaging_101F87EB.crml APP_LAYER_CRML(messaging_101F87EB.crml)" \
 		"messaging_101F87EC.crml APP_LAYER_CRML(messaging_101F87EC.crml)" \
 		"messaging_101F87ED.crml APP_LAYER_CRML(messaging_101F87ED.crml)" \
--- a/messagingapp/msgappfw/client/src/rcssession.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgappfw/client/src/rcssession.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -23,6 +23,8 @@
 // USER INCLUDES
 #include "ccsdebug.h"
 
+const TInt KCsServerRetryTimeout  = 100000;
+const TInt KCsServerRetryCount    = 5;
 // ----------------------------------------------------------------------------
 // StartServer
 // Starts the server. Used only when the server is implemented as a transient.
@@ -54,15 +56,10 @@
 
     User::WaitForRequest(status);
 
-    if (status != KErrNone)
-    {
-        server.Close();
-        return status.Int();
-    }
-
+    err = (server.ExitType() == EExitPanic ) ? KErrGeneral : status.Int();
+    server.Close();
     PRINT ( _L("End RCsSession->StartServer") );
-
-    return KErrNone;
+    return err;
 }
 // ============================== MEMBER FUNCTIONS ============================
 
@@ -84,27 +81,31 @@
 // ----------------------------------------------------------------------------
 TInt RCsSession::Connect()
 {
-    TInt err = CreateSession(KCsServerName, Version());
-
-    if (err != KErrNone)
+    TInt retry = KCsServerRetryCount;
+    FOREVER
     {
-        PRINT ( _L("conversation server not running. Trying to start") );
-
-        err = StartServer();
-
-        if (err != KErrNone)
-        {
-            PRINT ( _L("Conversation server startup failed") );
-            PRINT1 ( _L("End RCsSession::Connect. Error code = %d"), err );
-            return err;
-        }
-
-        PRINT ( _L("Conversation server startup successful") );
-
-        err = CreateSession(KCsServerName, Version());
+         TInt err = CreateSession(KCsServerName, Version());
+         if( err != KErrNotFound && err != KErrServerTerminated && err != KErrServerBusy )
+         {
+             return err;
+         }
+         if( --retry == 0 )
+         {
+             return err;
+         }
+         if( err == KErrServerBusy )
+         {
+             User::After(KCsServerRetryTimeout);
+         }
+         PRINT ( _L("conversation server not running. Trying to start") );
+         err = StartServer();
+         if( err != KErrNone && err != KErrAlreadyExists )
+         {
+             PRINT ( _L("Conversation server startup failed") );
+             return err;
+         }
+         PRINT ( _L("Conversation server startup successful") );
     }
-
-    return err;
 }
 
 // ----------------------------------------------------------------------------
--- a/messagingapp/msgappfw/plugins/previewplugin/group/cspreviewplugin.mmp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgappfw/plugins/previewplugin/group/cspreviewplugin.mmp	Fri Sep 17 08:28:39 2010 +0300
@@ -65,4 +65,5 @@
 LIBRARY         unidatamodel.lib
 LIBRARY         charconv.lib
 LIBRARY         centralrepository.lib
-LIBRARY         MsgMedia.lib
\ No newline at end of file
+LIBRARY         MsgMedia.lib
+LIBRARY         imageconversion.lib
\ No newline at end of file
--- a/messagingapp/msgappfw/plugins/previewplugin/src/ccspreviewpluginhandler.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgappfw/plugins/previewplugin/src/ccspreviewpluginhandler.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -35,6 +35,7 @@
 #include <MsgMediaResolver.h>
 #include <fileprotectionresolver.h>
 #include <MmsEngineInternalCRKeys.h>
+#include <imageconversion.h>
 //CONSTANTS
 //DB-file
 _LIT(KDbFileName, "c:[2002A542]conversations.db");
@@ -61,8 +62,8 @@
 
 const TInt KDefaultMaxSize = 300 * 1024;
 //Preview thumbnail size
-const TInt KWidth = 9.5 * 6.7;
-const TInt KHeight = 9.5 * 6.7;
+const TInt KWidth = 24 * 6.7;
+const TInt KHeight = 24 * 6.7;
 
 // NOTE:- DRAFTS ENTRIES ARE NOT HANDLED IN THE PLUGIN
 
@@ -336,15 +337,18 @@
         // skip processing this event for the given message
         return;
         }
-
+    
     // start processing message, set flag
     setMsgProcessingState(msgId, EPreviewMsgProcessing);
 
+
+    TRAPD( err,
+            {        
     // update db with message preview data
     RSqlStatement sqlInsertStmt;
     CleanupClosePushL(sqlInsertStmt);
     sqlInsertStmt.PrepareL(iSqlDb, KSqlInsertStmt);
-
+    
     // parse message
     iMmsMtm->SwitchCurrentEntryL(msgId);
     iMmsMtm->LoadMessageL();
@@ -352,7 +356,7 @@
     CUniDataModel* iUniDataModel = CUniDataModel::NewL(ifsSession, *iMmsMtm);
     CleanupStack::PushL(iUniDataModel);
     iUniDataModel->RestoreL(*this, ETrue);
-
+    
     //msg property
     TInt msgProperty = 0;
     if (iUniDataModel->AttachmentList().Count() > 0)
@@ -499,6 +503,12 @@
 
     //cleanup
     CleanupStack::PopAndDestroy(2, &sqlInsertStmt);
+            }); //TRAP
+    
+    if( err != KErrNone )
+        {
+        setMsgProcessingState(msgId, EPreviewMsgNotProcessed);
+        }
 
     PRINT ( _L("Enter CCsPreviewPluginHandler::HandleMMSEntry end.") );
     }
@@ -897,15 +907,6 @@
 void CCsPreviewPluginHandler::GetThumbNailL(TMsvAttachmentId attachmentId,
     TDesC8& mimeType, TMsvId msgId)
 {
-    //Scale the image
-    iThumbnailManager->SetFlagsL(CThumbnailManager::ECropToAspectRatio);
-
-    //TODO replace with hb-param-graphic-size-image-portrait * value of un in pixcels
-    iThumbnailManager->SetThumbnailSizeL(TSize(KWidth, KHeight)); 
-    
-    //optimize for performace
-    iThumbnailManager->SetQualityPreferenceL(
-        CThumbnailManager::EOptimizeForPerformance);
 
     // Create Thumbnail object source representing a path to a file
     HBufC* mimeInfo = HBufC::NewLC(mimeType.Length());
@@ -919,6 +920,53 @@
     RFile file = attachMan.GetAttachmentFileL(attachmentId);
     CleanupClosePushL(file);
 
+    //Find if the image is portrait image (or) landscape image
+    CImageDecoder *decoder =  CImageDecoder::FileNewL(file,mimeType,ContentAccess::EUnknown);
+    CleanupStack::PushL(decoder);
+    TSize size(0,0);
+       
+    TFrameInfo info = decoder->FrameInfo();
+    
+    size = info.iOverallSizeInPixels;
+    
+    CleanupStack::PopAndDestroy(decoder);
+   
+    TReal32 newLength = 0;
+    
+    if(size.iWidth >= size.iHeight)
+    {
+        //TODO replace with hb-param-graphic-size-image-portrait * value of un in pixcels
+        if(size.iWidth < KWidth)
+        {
+            iThumbnailManager->SetThumbnailSizeL(size);    
+        }
+        else
+        {
+            newLength = (KWidth * size.iHeight) /size.iWidth;
+            iThumbnailManager->SetThumbnailSizeL(TSize(KWidth, newLength));
+        }
+    }
+    else
+    {        
+        //TODO replace with hb-param-graphic-size-image-portrait * value of un in pixcels
+        if(size.iHeight < KHeight)
+        {
+            iThumbnailManager->SetThumbnailSizeL(size);    
+        }
+        else
+        {
+            newLength = (KHeight * size.iWidth) / size.iHeight;
+            iThumbnailManager->SetThumbnailSizeL(TSize(newLength, KHeight));    
+        }
+    }
+
+    //Scale the image
+    iThumbnailManager->SetFlagsL(CThumbnailManager::ECropToAspectRatio);
+
+    //optimize for performace
+    iThumbnailManager->SetQualityPreferenceL(
+        CThumbnailManager::EOptimizeForQuality);
+
     CThumbnailObjectSource* source = CThumbnailObjectSource::NewLC(
         (RFile64&) file, mimeInfo->Des());
 
--- a/messagingapp/msgappfw/server/inc/ccsconversation.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgappfw/server/inc/ccsconversation.h	Fri Sep 17 08:28:39 2010 +0300
@@ -160,8 +160,11 @@
      * Add contact Number for the conversation
      * 
      * @param aContactNumber Contact number
+     * @param aContactId Contact id
      */
-    void AddContactDetailsL(TDesC& aContactNumber);
+    void AddContactDetailsL(
+            TDesC& aContactNumber,
+            TInt32 aContactID);
 
     /**
      * UpdateEntryL
--- a/messagingapp/msgappfw/server/src/ccsconversation.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgappfw/server/src/ccsconversation.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -295,9 +295,11 @@
 // ----------------------------------------------------------------------------
 void
 CCsConversation::AddContactDetailsL(
-        TDesC& aContactNumber)
+        TDesC& aContactNumber,
+        TInt32 aContactID)
     {
     iContact->AddPhoneNumberL(aContactNumber);
+    iContact->SetContactId(aContactID);
     }
 
 // ----------------------------------------------------------------------------
--- a/messagingapp/msgappfw/server/src/ccsconversationcachehelper.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgappfw/server/src/ccsconversationcachehelper.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -574,13 +574,15 @@
 
     // fill firstname and lastname and contact Id
     if(aDisplayName)
+    {
    		conversation->AddContactDetailsL(aContactId,
                                      aDisplayName);
+    }
 
-    // fill the phone number
+    // fill the phone number and contact Id
     if (aConversationEntry->Contact())
     {
-        conversation->AddContactDetailsL(* (aConversationEntry->Contact()));
+        conversation->AddContactDetailsL(* (aConversationEntry->Contact()), aContactId);
     }
 
     // add into the list
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/bwins/msgerrorwatcheru.def	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,15 @@
+EXPORTS
+	?trUtf8@MsgErrorWatcher@@SA?AVQString@@PBD0H@Z @ 1 NONAME ; class QString MsgErrorWatcher::trUtf8(char const *, char const *, int)
+	?trUtf8@MsgErrorWatcher@@SA?AVQString@@PBD0@Z @ 2 NONAME ; class QString MsgErrorWatcher::trUtf8(char const *, char const *)
+	?qt_metacall@MsgErrorWatcher@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 3 NONAME ; int MsgErrorWatcher::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?ShowNote@MsgErrorWatcher@@QAEXW4TMsgErrorNoteIds@@@Z @ 4 NONAME ; void MsgErrorWatcher::ShowNote(enum TMsgErrorNoteIds)
+	?staticMetaObject@MsgErrorWatcher@@2UQMetaObject@@B @ 5 NONAME ; struct QMetaObject const MsgErrorWatcher::staticMetaObject
+	?metaObject@MsgErrorWatcher@@UBEPBUQMetaObject@@XZ @ 6 NONAME ; struct QMetaObject const * MsgErrorWatcher::metaObject(void) const
+	?tr@MsgErrorWatcher@@SA?AVQString@@PBD0@Z @ 7 NONAME ; class QString MsgErrorWatcher::tr(char const *, char const *)
+	??1MsgErrorWatcher@@UAE@XZ @ 8 NONAME ; MsgErrorWatcher::~MsgErrorWatcher(void)
+	?getStaticMetaObject@MsgErrorWatcher@@SAABUQMetaObject@@XZ @ 9 NONAME ; struct QMetaObject const & MsgErrorWatcher::getStaticMetaObject(void)
+	??_EMsgErrorWatcher@@UAE@I@Z @ 10 NONAME ; MsgErrorWatcher::~MsgErrorWatcher(unsigned int)
+	??0MsgErrorWatcher@@QAE@PAVQObject@@@Z @ 11 NONAME ; MsgErrorWatcher::MsgErrorWatcher(class QObject *)
+	?tr@MsgErrorWatcher@@SA?AVQString@@PBD0H@Z @ 12 NONAME ; class QString MsgErrorWatcher::tr(char const *, char const *, int)
+	?qt_metacast@MsgErrorWatcher@@UAEPAXPBD@Z @ 13 NONAME ; void * MsgErrorWatcher::qt_metacast(char const *)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/eabi/msgerrorwatcheru.def	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,15 @@
+EXPORTS
+	_ZN15MsgErrorWatcher11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME
+	_ZN15MsgErrorWatcher11qt_metacastEPKc @ 2 NONAME
+	_ZN15MsgErrorWatcher16staticMetaObjectE @ 3 NONAME DATA 16
+	_ZN15MsgErrorWatcher19getStaticMetaObjectEv @ 4 NONAME
+	_ZN15MsgErrorWatcher8ShowNoteE16TMsgErrorNoteIds @ 5 NONAME
+	_ZN15MsgErrorWatcherC1EP7QObject @ 6 NONAME
+	_ZN15MsgErrorWatcherC2EP7QObject @ 7 NONAME
+	_ZN15MsgErrorWatcherD0Ev @ 8 NONAME
+	_ZN15MsgErrorWatcherD1Ev @ 9 NONAME
+	_ZN15MsgErrorWatcherD2Ev @ 10 NONAME
+	_ZNK15MsgErrorWatcher10metaObjectEv @ 11 NONAME
+	_ZTI15MsgErrorWatcher @ 12 NONAME
+	_ZTV15MsgErrorWatcher @ 13 NONAME
+
--- a/messagingapp/msgnotifications/flashmsgnotifier/flashmsgnotifier.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgnotifications/flashmsgnotifier/flashmsgnotifier.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -37,7 +37,9 @@
 	    -lgsmu \
 	    -lxqutils \
 	    -lcsserverclientapi \
-	    -lxqsystemtoneservice
+	    -lxqsystemtoneservice \
+	    -lxqsettingsmanager \
+	    -lhwrmvibraclient
 
 SERVICE.FILE = service_conf.xml
 SERVICE.OPTIONS = embeddable
--- a/messagingapp/msgnotifications/flashmsgnotifier/inc/flashmsgnotifier.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgnotifications/flashmsgnotifier/inc/flashmsgnotifier.h	Fri Sep 17 08:28:39 2010 +0300
@@ -25,6 +25,8 @@
 
 class FlashMsgNotifierPrivate;
 class XQSystemToneService;
+class XQSettingsManager;
+class CHWRMVibra;
 
 /**
  * @class FlashMsgNotifier
@@ -84,6 +86,17 @@
      * Address string
      */
     QString mAddress;
+      
+    /**
+     * Settings manager 
+     * Owned.
+     */
+    XQSettingsManager* mSettingsManager;
+    
+    /**
+     * Vibra alert on receiving a new message
+     */
+    CHWRMVibra *mVibra; // Owned.
 };
 
 #endif // MSGERRORNOTIFIER_H
--- a/messagingapp/msgnotifications/flashmsgnotifier/src/flashmsgnotifier.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgnotifications/flashmsgnotifier/src/flashmsgnotifier.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -27,12 +27,17 @@
 #include <xqapplicationmanager.h>
 #include <xqaiwrequest.h>
 #include <xqsystemtoneservice.h>
+#include <XQSettingsManager>
+#include <ProfileEngineInternalCRKeys.h>
+#include <hwrmvibra.h>
 #include "flashmsgnotifier_p.h"
 
 #define LOC_NOTIFICATION_MSG_TITLE  hbTrId("txt_messaging_title_notification_message")
 #define LOC_BUTTON_SAVE       hbTrId("txt_common_menu_save")
 #define LOC_BUTTON_DELETE       hbTrId("txt_common_menu_delete")
 
+const XQCentralRepositorySettingsKey silenceModeKey(KCRUidProfileEngine.iUid, KProEngSilenceMode);
+
 //-------------------------------------------------------
 // FlashMsgNotifier::FlashMsgNotifier()
 // Constructor
@@ -44,6 +49,8 @@
     publishAll();
     mSts = new XQSystemToneService;
     d_ptr = q_check_ptr(new FlashMsgNotifierPrivate(this));
+    QT_TRYCATCH_LEAVING(mSettingsManager = new XQSettingsManager());
+    mVibra = CHWRMVibra::NewL();
 }
 
 //-------------------------------------------------------
@@ -54,6 +61,16 @@
 {
     delete d_ptr;
     delete mSts;
+    if(mSettingsManager)
+        {
+        delete mSettingsManager;
+        mSettingsManager = NULL;
+        }
+    if(mVibra)
+        {
+        delete mVibra;
+        mVibra = NULL;
+        }
 }
 
 //-------------------------------------------------------
@@ -120,7 +137,19 @@
     notificationDialog.setAction(actionQuit, HbDeviceMessageBox::RejectButtonRole);
 
     //Play audio alert when flash msg is shown
-    mSts->playTone(XQSystemToneService::SmsAlertTone);
+    QVariant silenceMode = mSettingsManager->readItemValue(silenceModeKey, XQSettingsManager::TypeInt);
+    int silent = silenceMode.toInt();
+    if(silent < 1)
+        {
+        //Play new message alert tone.
+        mSts->playTone(XQSystemToneService::SmsAlertTone);
+        }
+    // Execute the vibra effect.
+    if (mVibra) 
+        {
+        TInt err = KErrNone;
+        TRAP(err,mVibra->StartVibraL(1000));
+        }
 
     const QAction* result = notificationDialog.exec();
     // if accepted launch view else quit
--- a/messagingapp/msgnotifications/msgerrornotifier/inc/msgerrornotifiersvc.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgnotifications/msgerrornotifier/inc/msgerrornotifiersvc.h	Fri Sep 17 08:28:39 2010 +0300
@@ -21,9 +21,6 @@
 #include <xqserviceprovider.h>
 #include <qvariant.h>
 
-//Forward Declaration
-class XQSystemToneService;
-
 class MsgErrorNotifierSvc: public XQServiceProvider
 {
 
@@ -49,12 +46,6 @@
      */
     void displayErrorNote(QVariantList displayParams);
 
-private:
-    
-    /**
-     * Object to handle audio alerts
-     */
-    XQSystemToneService* mSts;
 };
 
 #endif /* MSGERRORNOTIFIERSVC_H_ */
--- a/messagingapp/msgnotifications/msgerrornotifier/msgerrornotifier.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgnotifications/msgerrornotifier/msgerrornotifier.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -25,8 +25,7 @@
            src/msgerrornotifiersvc.cpp
            
 LIBS += -lxqservice \
-	    -lxqserviceutil \
-	    -lxqsystemtoneservice
+	    -lxqserviceutil
 
 SERVICE.FILE = service_conf.xml
 SERVICE.OPTIONS = embeddable
--- a/messagingapp/msgnotifications/msgerrornotifier/src/msgerrornotifiersvc.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgnotifications/msgerrornotifier/src/msgerrornotifiersvc.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -26,7 +26,6 @@
 #include <xqappmgr.h>
 #include <ccsdefs.h>
 #include <qaction.h>
-#include <xqsystemtoneservice.h>
 
 #define LOC_VIEW hbTrId("txt_messaging_button_view")
 #define LOC_CANCEL hbTrId("txt_common_button_cancel")
@@ -38,7 +37,6 @@
 MsgErrorNotifierSvc::MsgErrorNotifierSvc(QObject* parent) :
     XQServiceProvider(QLatin1String("messaging.com.nokia.symbian.MsgErrorNotifier"), parent)
 {
-    mSts = new XQSystemToneService();
     publishAll();
 
 }
@@ -47,11 +45,6 @@
 //---------------------------------------------------------
 MsgErrorNotifierSvc::~MsgErrorNotifierSvc()
 {
-    if(mSts)
-        {
-        delete mSts;
-        mSts = NULL;
-        }
 }
 
 //---------------------------------------------------------
@@ -93,10 +86,7 @@
     messageBox.setAction(actionQuit,HbDeviceMessageBox::RejectButtonRole);
 
     setCurrentRequestAsync();
-
-    //Play audio alert when error notification is shown
-    mSts->playTone(XQSystemToneService::MessageSendFailureTone);
-    
+  
     // launch Messagebox
     const QAction* result = messageBox.exec();
   
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrorwatcher/inc/msgcenrepobserver.h	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,104 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*     CMsgCenRepObserver declaration file
+*
+*/
+
+
+
+#ifndef CMSGCENREPOBSERVER_H
+#define CMSGCENREPOBSERVER_H
+
+//  INCLUDES
+#include    <e32base.h>
+
+// FORWARD DECLARATIONS
+class CMsgErrorWatcherPrivate;
+class CRepository;
+
+// CLASS DECLARATION
+/**
+* Class for observing CenRep if MMS Access Point in use changes
+*/
+class CMsgCenRepObserver : public CActive
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+        * @param aRConnection opened RConnection
+        */
+        static CMsgCenRepObserver* NewL(CMsgErrorWatcherPrivate& aWatcher);
+
+        /**
+        * Destructor.
+        */
+        virtual ~CMsgCenRepObserver();
+
+    public: // New functions
+
+        /**
+        * Subscribe to a notification from CenRep
+        */
+        void SubscribeNotification();
+
+    protected:  // Functions from base classes
+
+        /**
+        * Active object cancellation
+        */
+        void DoCancel();
+        
+        /**
+        * If RunL leaves
+        */
+        TInt RunError( TInt aError );
+
+    private:
+
+        /**
+        * C++ default constructor.
+        */
+        CMsgCenRepObserver( CMsgErrorWatcherPrivate& aWatcher );
+
+        /**
+        * By default Symbian OS constructor is private.
+        * @param aRConnection opened RConnection
+        */
+        void ConstructL();
+
+        /**
+        * Completion
+        */
+        void RunL();
+
+        // By default, prohibit copy constructor
+        CMsgCenRepObserver( const CMsgCenRepObserver& );
+
+        // Prohibit assignment operator
+        CMsgCenRepObserver& operator= ( const CMsgCenRepObserver& );
+
+    private:    // Data
+
+        CMsgErrorWatcherPrivate&          iWatcher;
+        CRepository*               iRepository;
+        TUid                       iRepositoryUid;
+        TInt32                     iKey;
+
+    };
+
+#endif      // CMSGCENREPOBSERVER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrorwatcher/inc/msgerrorcommdbobserver.h	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,104 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*     CMsgErrorCommDbObserver declaration file
+*
+*/
+
+
+
+#ifndef MSGERRORCOMMDBOBSERVER_H
+#define MSGERRORCOMMDBOBSERVER_H
+
+#include    <e32base.h>
+
+// FORWARD DECLARATIONS
+class CMsgErrorWatcherPrivate;
+class CCommsDatabase;
+
+// CLASS DECLARATION
+
+/**
+* CMsgErrorCommDbObserver
+*/
+class CMsgErrorCommDbObserver : public CActive
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        *
+        * @param aWatcher A pointer to CMsgErrorWatcherPrivate
+        */
+        static CMsgErrorCommDbObserver* NewL( CMsgErrorWatcherPrivate& aWatcher );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CMsgErrorCommDbObserver();
+
+        /**
+        * For external reactivating the active object.
+        */
+        void Restart();
+
+    private:
+
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * Private C++ constructor.
+        *
+        * @param aWatcher A pointer to CMsgErrorWatcherPrivate
+        */
+        CMsgErrorCommDbObserver( CMsgErrorWatcherPrivate&  aWatcher );
+
+    private: // from CActive
+
+        /**
+        * For starting the active object.
+        */
+        void Start();
+
+        /**
+        * From CActive
+        */
+        void DoCancel();
+
+        /**
+        * From CActive
+        */
+        void RunL();
+
+    private:    // Data
+
+        /*
+         * Pointer to commdb
+         * Own
+         */
+        CCommsDatabase*     iDb;
+        
+        /**
+         * Reference to watcher to give call back
+         * Doesn't own
+         */
+        CMsgErrorWatcherPrivate&   iWatcher;
+    };
+
+#endif      // MSGERRORCOMMDBOBSERVER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrorwatcher/inc/msgerrordiskspaceobserver.h	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*     CMsgErrorDiskSpaceObserver declaration file
+*
+*/
+
+
+
+#ifndef MSGERRORDISKSPACEOBSERVER_H
+#define MSGERRORDISKSPACEOBSERVER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <f32file.h>
+
+// FORWARD DECLARATIONS
+class CMsgErrorWatcherPrivate;
+class CMsvSession;
+
+// CLASS DECLARATION
+
+/**
+* CMsgErrorDiskSpaceObserver
+*/
+class CMsgErrorDiskSpaceObserver : public CActive
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        *
+        * @param aWatcher A pointer to CMsgErrorWatcherPrivate
+        * @param aSession A reference to message server session
+        * @param aFs A reference to file session
+        */
+        static CMsgErrorDiskSpaceObserver* NewL( CMsgErrorWatcherPrivate& aWatcher, CMsvSession& aSession, RFs& aFs );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CMsgErrorDiskSpaceObserver();
+
+    public: // New functions
+
+        /**
+        * Updates the trigger limit to aLimit, if it
+        * is smaller than current limit. (Re)activates
+        * the active object.
+        *
+        * @param aLimit The trigger limit in bytes
+        */
+        void SetLimitAndActivateL( TInt32 aLimit );
+
+    private:
+
+        /**
+        * Private C++ constructor.
+        *
+        * @param aWatcher A pointer to CMsgErrorWatcherPrivate
+        * @param aSession A reference to message server session
+        * @param aFs A reference to file session
+        */
+        CMsgErrorDiskSpaceObserver( CMsgErrorWatcherPrivate& aWatcher, CMsvSession& aSession, RFs& aFs );
+
+    private:
+
+        /**
+        * From CActive
+        */
+        void RunL();
+
+        /**
+        * From CActive
+        */
+        void DoCancel();
+
+    private:    // Data
+
+        CMsgErrorWatcherPrivate&   iWatcher;
+        CMsvSession&        iSession;
+        RFs&                iFs;
+        TInt32              iLimit;
+    };
+
+#endif      // MSGERRORDISKSPACEOBSERVER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrorwatcher/inc/msgerrorextsmsdiskspaceobserver.h	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*     CMsgErrorSmsDiskSpaceObserver declaration file
+*
+*
+*/
+
+
+#ifndef __MSGERROREXTSMSDISKSPACEOBSERVER_H
+#define __MSGERROREXTSMSDISKSPACEOBSERVER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32property.h>
+
+// FORWARD DECLARATIONS
+class CMsgErrorWatcherPrivate;
+
+// CLASS DECLARATION
+
+/**
+* CMsgErrorSmsDiskSpaceObserver
+*
+* @lib msgerrorwatcher.dll
+* @since 5.0
+*/
+class CMsgErrorExtSmsDiskSpaceObserver : public CActive
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        *
+        * @param aWatcher A pointer to CMsgErrorWatcherPrivate
+        */
+        static CMsgErrorExtSmsDiskSpaceObserver* NewL( CMsgErrorWatcherPrivate& aWatcher);
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CMsgErrorExtSmsDiskSpaceObserver();
+
+    private:
+
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * Private C++ constructor.
+        *
+        * @param aWatcher A pointer to CMsgErrorWatcherPrivate
+        */
+        CMsgErrorExtSmsDiskSpaceObserver( CMsgErrorWatcherPrivate& aWatcher);
+
+    private:
+
+        /**
+        * From CActive
+        */
+        void DoCancel();
+
+        /**
+        * From CActive
+        */
+        void RunL();
+
+    private:    // Data
+
+        /*
+         * Reference to watcher
+         * Doesn't own
+         */
+        CMsgErrorWatcherPrivate&   iWatcher;
+        
+        /*
+         * Diskspace property
+         */
+        RProperty iSmsDiskSpaceProperty; 
+
+    };
+
+#endif      // __MSGERROREXTSMSDISKSPACEOBSERVER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrorwatcher/inc/msgerrorroamingobserver.h	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*     CMsgErrorRoamingObserver declaration file
+*
+*/
+
+
+
+#ifndef MSGERRORROAMINGOBSERVER_H
+#define MSGERRORROAMINGOBSERVER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <etel.h>                   //RTelServer
+#include <etelmm.h>
+
+
+
+// FORWARD DECLARATIONS
+class CMsgErrorWatcherPrivate;
+
+// CLASS DECLARATION
+
+/**
+* CMsgErrorRoamingObserver
+*/
+class CMsgErrorRoamingObserver : public CActive
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        *
+        * @param aWatcher A pointer to CMsgErrorWatcherPrivate
+        */
+        static CMsgErrorRoamingObserver* NewL( CMsgErrorWatcherPrivate& aWatcher );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CMsgErrorRoamingObserver();
+
+    private:
+
+        /**
+        * Checks whether roaming status has changed
+        * from home network to roaming or vice versa.
+        * If so, calls CMsgErrorWatcherPrivate::HandleRoamingEventL
+        */
+        void UpdateRoamingStatusL();
+
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * Private C++ constructor.
+        *
+        * @param aWatcher A pointer to CMsgErrorWatcherPrivate
+        */
+        CMsgErrorRoamingObserver( CMsgErrorWatcherPrivate& aWatcher );
+
+    private:
+
+        /**
+        * For starting the active object.
+        */
+        void Start();
+
+        /**
+        * From CActive
+        */
+        void DoCancel();
+
+        /**
+        * From CActive
+        */
+        void RunL();
+
+    private:    // Data
+
+        CMsgErrorWatcherPrivate&   iWatcher;
+        TBool               iRoaming;
+        RMobilePhone        iMobilePhone;
+        RTelServer          iETelServer;
+        RMobilePhone::TMobilePhoneRegistrationStatus iRegStatus;
+        TInt                iRequestId;
+
+    };
+
+#endif      // MSGERRORROAMINGOBSERVER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrorwatcher/inc/msgerrorsmsdiskspaceobserver.h	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*     CMsgErrorSmsDiskSpaceObserver declaration file
+*
+*/
+
+
+
+#ifndef __MSGERRORSMSDISKSPACEOBSERVER_H
+#define __MSGERRORSMSDISKSPACEOBSERVER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32property.h>
+
+// FORWARD DECLARATIONS
+class CMsgErrorWatcherPrivate;
+
+// CLASS DECLARATION
+
+/**
+* CMsgErrorSmsDiskSpaceObserver
+*/
+class CMsgErrorSmsDiskSpaceObserver : public CActive
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        *
+        * @param aWatcher A pointer to CMsgErrorWatcherPrivate
+        */
+        static CMsgErrorSmsDiskSpaceObserver* NewL( CMsgErrorWatcherPrivate& aWatcher);
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CMsgErrorSmsDiskSpaceObserver();
+
+    private:
+
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * Private C++ constructor.
+        *
+        * @param aWatcher A pointer to CMsgErrorWatcherPrivate
+        */
+        CMsgErrorSmsDiskSpaceObserver( CMsgErrorWatcherPrivate& aWatcher);
+
+    private:
+
+        /**
+        * From CActive
+        */
+        void DoCancel();
+
+        /**
+        * From CActive
+        */
+        void RunL();
+
+    private:    // Data
+
+        CMsgErrorWatcherPrivate&   iWatcher;
+        RProperty iSmsDiskSpaceProperty;
+
+    };
+
+#endif      // __MSGERRORSMSDISKSPACEOBSERVER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrorwatcher/inc/msgerrorstartupobserver.h	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*     CMsgErrorStartupObserver declaration file
+*
+*/
+
+
+
+#ifndef __MSGERRORSTARTUPOBSERVER_H
+#define __MSGERRORSTARTUPOBSERVER_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32property.h>
+
+// FORWARD DECLARATIONS
+class CMsgErrorWatcherPrivate;
+
+// CLASS DECLARATION
+
+/**
+* CMsgErrorStartupObserver
+*/
+class CMsgErrorStartupObserver : public CActive
+    {
+    public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        *
+        * @param aWatcher A pointer to CMsgErrorWatcherPrivate
+        */
+        static CMsgErrorStartupObserver* NewL( CMsgErrorWatcherPrivate& aWatcher );
+        
+        /**
+        * Destructor.
+        */
+        virtual ~CMsgErrorStartupObserver();
+
+    private:
+
+        /**
+        * By default Symbian OS constructor is private.
+        */
+        void ConstructL();
+
+        /**
+        * Private C++ constructor.
+        *
+        * @param aWatcher A pointer to CMsgErrorWatcherPrivate
+        */
+        CMsgErrorStartupObserver( CMsgErrorWatcherPrivate& aWatcher );
+
+    private:
+
+        /**
+        * From CActive
+        */
+        void DoCancel();
+
+        /**
+        * From CActive
+        */
+        void RunL();
+
+    private:    // Data
+
+        CMsgErrorWatcherPrivate&   iWatcher;
+        RProperty iStartupProperty;
+
+    };
+
+#endif      // __MSGERRORSTARTUPOBSERVER_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrorwatcher/inc/msgerrorwatcher.h	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *     CMsgErrorWatcher declaration file
+ *
+ */
+#ifndef MSGERRORWATCHER_H
+#define MSGERRORWATCHER_H
+
+#ifdef  MSGERRORWATCHER_DLL
+#define MSGERRORWATCHER_EXPORT Q_DECL_EXPORT
+#else
+#define MSGERRORWATCHER_EXPORT Q_DECL_IMPORT
+#endif
+
+// INCLUDES
+#include "msgerrorwatcher.hrh"
+// SYSTEM INCLUDES
+#include <QObject>
+// CLASS DECLARATION
+class CMsgErrorWatcherPrivate;
+
+/**
+ * Handles showing notes handled by the errowatcher
+ */
+class MSGERRORWATCHER_EXPORT MsgErrorWatcher: public QObject
+{
+Q_OBJECT
+
+public:
+    /**
+     * Constructor
+     */
+    MsgErrorWatcher(QObject* parent = 0);
+
+    /**
+     * Destructor
+     */
+    ~MsgErrorWatcher();
+
+public:
+    
+    /**
+     *  Displays notifiction dialog
+     *  @param errornoteid error id
+     */
+    void ShowNote(TMsgErrorNoteIds errornoteid);
+    
+private:
+
+    /**
+     * Object of private implementation.
+     * Owned.
+     */
+    CMsgErrorWatcherPrivate* d_ptr;
+
+};
+
+#endif // MSGERRORWATCHER_H
+//EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrorwatcher/inc/msgerrorwatcher.hrh	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*     This file contains declarations for resources of MsgErrorWatcher
+*     The file can be included in C++ or resource file.
+*
+*/
+
+
+
+#ifndef MSGERRORWATCHER_HRH
+#define MSGERRORWATCHER_HRH
+
+/**
+ * ErrorNote Ids
+ */
+enum TMsgErrorNoteIds
+    {
+    ENoAccesPointsNote=1,
+    EInvalidAccessPointNote,
+    EConnectionInUseNote,
+    EDiskLowNote1,
+    EDiskLowNoteN,
+    EMemoryLowNote,
+    ERoamingNote,
+    ESendFailureNote,
+    ESendingMessageNote,
+    ESMSIncomingLowDiskSpace
+    };
+
+#endif      //  MSGERRORWATCHER_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrorwatcher/inc/msgerrorwatcher_p.h	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,441 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*     CMsgErrorWatcher declaration file
+*
+*/
+
+
+
+#ifndef MSGERRORWATCHERPRIVATE_H
+#define MSGERRORWATCHERPRIVATE_H
+
+// INCLUDES
+#include <f32file.h>
+#include <msvstd.h>
+#include <msvapi.h>
+#include <systemwarninglevels.hrh>    // Critical level
+#include <mmsconst.h>          // KMmsDiskSafetyMargin
+
+#include "MsgErrorWatcher.hrh"
+
+const TUint KCriticalDiskLevel = KDRIVECCRITICALTHRESHOLD;
+const TUint KCriticalLevel = KCriticalDiskLevel + KMmsDiskSafetyMargin;
+const TUint32 KDefaultTriggerLevel = 300 * 1024; // 100 kilobytes
+const TUint KTriggerMargin = 20 * 1024; // 20 kilobytes
+
+// FUNCTION PROTOTYPES
+GLREF_C void Panic( TInt aPanic ); 
+
+// FORWARD DECLARATIONS
+class CWatcherLog;
+class CMmsClientMtm;
+class CClientMtmRegistry;
+class MsgErrorWatcher;
+class CMsgErrorCommDbObserver;
+class CMsgErrorDiskSpaceObserver;
+class CMsgErrorSmsDiskSpaceObserver;
+class CMsgErrorExtSmsDiskSpaceObserver;
+class CMsgErrorRoamingObserver;
+class CMsgErrorStartupObserver;
+class CMsgErrorDisconnectDlg;
+class CMsgCenRepObserver;
+
+
+// CLASS DECLARATION
+
+/**
+* CMsgErrorWatcherPrivate
+*/
+class CMsgErrorWatcherPrivate :public CActive, public MMsvSessionObserver
+    {
+    public:  // Constructors and destructor        
+      /**
+        * Default constructor.
+        */
+    CMsgErrorWatcherPrivate(MsgErrorWatcher* msgErrorWatcher);
+
+       /**
+        * Destructor
+        */
+       virtual ~CMsgErrorWatcherPrivate();
+
+    public: // New functions
+
+        /**
+        * Callback function for roaming observer.
+        *
+        * @param aRoaming ETrue if roaming, EFalse otherwise
+        */
+        void HandleRoamingEventL( TBool aRoaming );
+
+        /**
+        * Callback function for CommDB observer.
+        */
+        void HandleCommDbEventL();
+
+        /**
+        * Callback function for connection observer.
+        */
+       // void HandleConnectionEvent();
+
+        /**
+        * Callback function for disk space observer.
+        */
+        void HandleDiskSpaceEventL();
+        void HandleDiskSpaceEvent2L();
+        
+        /**
+        * Callback function for startup state observer (currently
+        * sent items observer).
+        */
+       void HandleStartupReadyL();
+        
+        /**
+        * HandleCenRepNotificationL
+        * Handles events from central repository observer
+        */
+        void HandleCenRepNotificationL();
+                
+        
+    public: // Functions from base classes
+
+        /**
+        * From MMsvSessionObserver
+        */
+        void HandleSessionEventL(
+            TMsvSessionEvent aEvent,
+            TAny* aArg1,
+            TAny* aArg2,
+            TAny* aArg3 );
+
+    protected: // Functions from base classes
+
+        /**
+        * From CActive
+        */
+        void RunL();
+
+        /**
+        * From CActive
+        */
+        void DoCancel();
+
+    private:
+
+        
+        /**
+         * Initializes the MsgStoreHandler class.     
+         */
+        void InitL();
+
+        /**
+        * Start watcher.
+        */
+        void StartWatcherL();
+
+        /**
+        * Stop watcher.
+        */
+        void StopWatcher();
+
+        /**
+        * Start restart timer. Timer is used when trying to reconnect
+        * to message server after watcher has been stopped due
+        * to certain message server events.
+        */
+        void StartRestartTimer();
+
+        /**
+        * Kills all observers and resets counters.
+        */
+        void ResetWatcher();
+
+        /**
+        * Checks whether MMS Service is already found. If not
+        * gets a pointer to MMS service from MsgStore and if
+        * found updates the context of MmsClientMtm.
+        *
+        * @return ETrue if MMS service was found, EFalse otherwise
+        */
+        TBool GetMmsServiceL();
+
+        /**
+        * Initiates MMS fetch by sending a request to MMS engine.
+        */
+        void StartMmsFetchL();
+
+        /**
+        * Initiates MMS send by sending a request to MMS engine.
+        */
+        void StartMmsSendL();
+
+        /**
+        * Checks whether MMS receiving mode is "Enabled in home network"
+        * and "On". If so, activates roaming observer.
+        */
+        void CheckMmsReceivingModeL();
+
+        /**
+        * A wrapper for CMmsClient::ValidateService().
+        *
+        * @return ETrue if service is valid, EFalse otherwise.
+        */
+        TBool ValidateMmsServiceL();
+
+        /**
+        * Called when MMS reception fails due to insufficient
+        * disk space.
+        *
+        * @param aEntry The failed entry
+        */
+        void HandleDiskSpaceErrorL( TMsvEntry& aEntry );
+
+        /**
+        * Called when MMS reception fails due to insufficient
+        * memory.
+        *
+        * @param aEntry The failed entry
+        */
+        void HandleMemoryErrorL( TMsvEntry& aEntry );
+
+        /**
+        * Called when MMS reception fails because there is
+        * another data connection open.
+        *
+        * @param aEntry The failed entry
+        * @param aReceive, ETrue for incoming messages, EFalse for outgoing
+        */
+        //void HandleConnectionErrorL( TMsvEntry& aEntry, TBool aReceive );
+
+        /**
+        * Called when MMS reception fails because there is no
+        * access point defined.
+        *
+        * @param aEntry The failed entry
+        */
+        void HandleNoAPErrorL( TMsvEntry& aEntry );
+
+        /**
+        * Called when MMS reception fails because the current
+        * access point is invalid.
+        *
+        * @param aEntry The failed entry
+        */
+        void HandleInvalidAPErrorL( TMsvEntry& aEntry, TBool aStartObserver );
+
+        /**
+        * Subfunction of HandleSessionEventL
+        * Handles root events from MsgServer observer
+        *
+        * @param aEvent     Message server event
+        * @param aEntries   Affected entries
+        */
+        void HandleRootEventL(
+            TMsvSessionEvent aEvent,
+            CMsvEntrySelection* aEntries );
+
+        /**
+        * Subfunction of HandleSessionEventL
+        * Handles local service events from MsgServer observer
+        *
+        * @param aEvent     Message server event
+        * @param aEntries   Affected entries
+        */
+        void HandleLocalServiceEventL(
+            TMsvSessionEvent aEvent,
+            CMsvEntrySelection* aEntries );
+
+        /**
+        * Subfunction of HandleSessionEventL
+        * Handles inbox events from MsgServer observer
+        *
+        * @param aEvent     Message server event
+        * @param aEntries   Affected entries
+        */
+        void HandleInboxEventL(
+            TMsvSessionEvent aEvent,
+            CMsvEntrySelection* aEntries );
+
+        /**
+        * Subfunction of HandleSessionEventL
+        * Handles outbox events from MsgServer observer
+        *
+        * @param aEvent     Message server event
+        * @param aEntries   Affected entries
+        */
+        void HandleOutboxEventL(
+            TMsvSessionEvent aEvent,
+            CMsvEntrySelection* aEntries );
+
+        /**
+        * Subfunction of HandleSessionEventL
+        * Handles MMS service events from MsgServer observer
+        *
+        * @param aEvent     Message server event
+        * @param aEntries   Affected entries
+        */
+        void HandleMmsServiceEventL(
+            TMsvSessionEvent aEvent,
+            CMsvEntrySelection* aEntries );
+
+
+        /**
+        * Resets TMsvEntry::iError of an entry saved in iCurrentEntry
+        */
+        void ResetErrorFieldL( );
+        
+        /**
+        * Resets TMsvEntry::iError of an entry given as parameter
+        */
+        void ResetErrorFieldL( TMsvEntry& aEntry );
+         
+    private:    // Data
+
+        enum TMsgErrorWatcherFlags
+            {
+            EStartupReady               = 0x0001,
+            EWatcherRunning             = 0x0002,
+            ENoAPErrorPending           = 0x0004,
+            EShowRoamingNote            = 0x0008,
+            ERoamingNoteShown           = 0x0010,
+            EReceivingDisconnectDelay   = 0x0020
+            };
+
+        enum TMsgRequestTypes
+            {
+            EMsgRequestNone = 0,
+            EMsgRequestStartingUp,
+            EMsgRequestFetching,
+            EMsgRequestFetchingAll,
+            EMsgRequestSending,
+            EMsgRequestWaitingErrorNote,
+            EMsgRequestWaitingDisconnection
+            };
+
+        /**
+         * Pointer to MsgErrorWatcher
+         * Doesn't own
+         */
+        MsgErrorWatcher* q_ptr;
+
+        /**
+         * MMSservice id
+         */
+        TMsvId iMmsServiceId;
+        
+        /**
+         * Notification folder id
+         */
+        TMsvId iNotificationFolderId;
+        
+        /**
+         * Msv session
+         * Own
+         */
+        CMsvSession* iSession;
+        
+        /**
+         * Msv operation
+         * Own
+         */
+        CMsvOperation* iOperation;
+        
+        /**
+         * Mtmregitsry client
+         * Own
+         */
+        CClientMtmRegistry* iClientMtmRegistry;
+        
+        /**
+         * Mmsclient
+         * Own
+         */
+        CMmsClientMtm* iMmsClient;
+        
+        /**
+         * Pointer to mms receive error messages
+         * Own
+         */
+        CMsvEntrySelection* iMmsReceiveErrorMessages;
+        
+        /**
+         * Pointer to mms receive error messages
+         * Own
+         */
+        CMsvEntrySelection* iMmsSendErrorMessages;
+
+        /**
+         * Current entry id
+         */
+        TMsvId iCurrentEntryId;
+
+        /**
+         * Pointers to error observers
+         * CommDb observer
+         * Own
+         */
+        CMsgErrorCommDbObserver* iCommDbObserver;
+        
+        /**
+         * Pointer to diskspace observer
+         * Own
+         */
+        CMsgErrorDiskSpaceObserver* iDiskSpaceObserver;
+        /**
+         * Pointer to sms diskspace observer
+         * Own
+         */
+        CMsgErrorSmsDiskSpaceObserver* iSmsDiskSpaceObserver;
+        /**
+         * Pointer to extension sms diskspace observer
+         * Own
+         */
+        CMsgErrorExtSmsDiskSpaceObserver* iSmsExtDiskSpaceObserver;
+        /**
+         * Pointer to roaming observer
+         * Own
+         */
+        CMsgErrorRoamingObserver* iRoamingObserver;
+        /**
+         * Pointer to startup observer
+         * Own
+         */
+        CMsgErrorStartupObserver* iStartupObserver;
+        /**
+         * Pointer to cenerep observer
+         * Own
+         */
+        CMsgCenRepObserver* iCenRepObserver;
+       
+        /**
+         * File session
+         */
+        RFs iFs;
+        
+        /**
+         * Timer
+         */
+        RTimer iTimer;
+
+        TMsgRequestTypes iRequestType;
+        TUint iWatcherFlags;
+        TUint32 iMaxReceiveSize;
+        TUint iDiskSpaceErrors;
+        TUint iTimerRetries;
+    };
+
+#endif      // MSGERRORWATCHERPRIVATE_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrorwatcher/msgerrorwatcher.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,110 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+TEMPLATE = lib
+TARGET = msgerrorwatcher
+
+CONFIG += hb
+
+DEFINES += MSGERRORWATCHER_DLL
+
+DEPENDPATH +=  ./inc ./src
+INCLUDEPATH +=  ./inc 
+INCLUDEPATH += ../../../inc 
+INCLUDEPATH += ../../msgsettings/settingsview/inc 
+INCLUDEPATH += ../../msgui/inc
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+# Input
+HEADERS += ./inc/msgerrorwatcher.h \
+           ./inc/msgerrorwatcher_p.h \
+			./inc/msgerrorroamingobserver.h \
+			./inc/msgerrorstartupobserver.h  \
+			./inc/msgerrorsmsdiskspaceobserver.h \
+			./inc/msgerrorextsmsdiskspaceobserver.h \
+			./inc/msgcenrepobserver.h \
+			./inc/msgerrorcommdbobserver.h\
+			./inc/msgerrordiskspaceobserver.h 
+
+SOURCES +=  ./src/msgerrorwatcher.cpp \
+            ./src/msgerrorwatcher_p.cpp \
+           ./src/msgerrorroamingobserver.cpp \
+			./src/msgerrorstartupobserver.cpp \
+			./src/msgerrorsmsdiskspaceobserver.cpp \
+			./src/msgerrorextsmsdiskspaceobserver.cpp \
+			./src/msgcenrepobserver.cpp \
+			./src/msgerrorcommdbobserver.cpp \
+			./src/msgerrordiskspaceobserver.cpp 
+
+defBlock = \      
+	  "$${LITERAL_HASH}if defined(EABI)" \
+	  "DEFFILE  ../eabi/msgerrorwatcher.def" \
+             "$${LITERAL_HASH}else" \
+             "DEFFILE  ../bwins/msgerrorwatcher.def" \
+             "$${LITERAL_HASH}endif"
+	
+MMP_RULES += defBlock			
+LIBS +=   -lecom \
+          -leuser \
+          -lcommonengine \
+          -lefsrv\
+          -letel \
+          -letelmm \   
+          -lmsgs \
+          -lcentralrepository \
+          -lcenrepnotifhandler \   
+          -llogcli \
+          -llogwrap \
+          -lcommdb \
+          -lconnmon \
+          -lHbCore \
+          -lHbWidgets \
+          -lHbUtils \
+          -lQtCore \
+          -lxqutils \
+          -lflogger \
+          -lcone \
+          -leikcdlg \
+          -leikctl \
+          -leikcoctl \
+          -leikcore \
+          -lgdi \
+          -lbafl \
+          -lplatformenv \
+          -lccon \
+          -lestor \
+          -lCdlEngine \
+          -laknskins \
+	        -laknicon \
+	        -legul \
+	        -lxqservice 
+           
+
+TARGET.UID3 = 0x2001FE78 #MSGERRORWATCHER_DLL_UID 
+TARGET.CAPABILITY =  All -TCB
+TARGET.EPOCALLOWDLLDATA = 1  
+
+# Platforms
+SYMBIAN_PLATFORMS = WINSCW \
+    ARMV5
+
+# Build.inf rules
+BLD_INF_RULES.prj_exports += \
+     "$${LITERAL_HASH}include <platform_paths.hrh>" \
+     "rom/msgerrorwatcher.iby  CORE_APP_LAYER_IBY_EXPORT_PATH(msgerrorwatcher.iby)"
+
+# End of file	--Don't remove this.
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrorwatcher/rom/msgerrorwatcher.iby	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  MsgErrorWatcher.iby*
+*/
+
+
+#ifndef __MSGERRORWATCHER_IBY__
+#define __MSGERRORWATCHER_IBY__
+
+
+REM DLL
+file=ABI_DIR\UREL\msgerrorwatcher.dll                   SHARED_LIB_DIR\msgerrorwatcher.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrorwatcher/src/msgcenrepobserver.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,147 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*          CMsgCenRepObserver implementation file
+*
+*/
+
+
+
+// INCLUDE FILES
+//#include    <es_sock.h>
+#include <centralrepository.h>
+
+#include "msgerrorwatcher_p.h"
+#include "msgcenrepobserver.h"
+ 
+#include "MmsEngineInternalCRKeys.h"
+#include "debugtraces.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// C++ constructor
+// ---------------------------------------------------------
+//
+CMsgCenRepObserver::CMsgCenRepObserver(CMsgErrorWatcherPrivate& aWatcher)
+    :CActive ( EPriorityStandard),
+    iWatcher(aWatcher),
+    iRepositoryUid( KCRUidMmsEngine ),
+    iKey( KMmsAccesspointArrayBase/*KMmsEngineAccessPointCount*/ )
+    {
+    QDEBUG_WRITE("CMsgCenRepObserver:CMsgCenRepObserver : Enter");
+    QDEBUG_WRITE("CMsgCenRepObserver:CMsgCenRepObserver : Exit");
+    }
+
+// ---------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------
+//
+void CMsgCenRepObserver::ConstructL()
+    {
+    QDEBUG_WRITE("CMsgCenRepObserver:ConstructL : Enter");
+    CActiveScheduler::Add( this );
+
+    // Connect CenRep
+    TRAPD( err, iRepository = CRepository::NewL( iRepositoryUid ) );
+    if( err != KErrNone )
+        {
+
+        QDEBUG_WRITE( "Error in connecting to CenRep!" );
+
+        return;
+        }
+    QDEBUG_WRITE("CMsgCenRepObserver:ConstructL : Exit");  
+    }
+
+// ---------------------------------------------------------
+// Symbian two-phased constructor
+// ---------------------------------------------------------
+//
+CMsgCenRepObserver* CMsgCenRepObserver::NewL( CMsgErrorWatcherPrivate& aWatcher )
+    {
+    QDEBUG_WRITE("CMsgCenRepObserver:NewL : Enter");
+    CMsgCenRepObserver* self = new ( ELeave ) CMsgCenRepObserver( aWatcher );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    QDEBUG_WRITE("CMsgCenRepObserver:NewL : Exit");
+    return self;
+    }
+    
+// ---------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------
+//
+CMsgCenRepObserver::~CMsgCenRepObserver()
+    {
+    QDEBUG_WRITE("CMsgCenRepObserver:~CMsgCenRepObserver : Enter");
+    Cancel();
+    if( iRepository )
+        {
+        delete iRepository;
+        }
+    QDEBUG_WRITE("CMsgCenRepObserver:~CMsgCenRepObserver : Exit");
+    }
+
+// ---------------------------------------------------------
+// SubscribeNotification
+// ---------------------------------------------------------
+//
+void CMsgCenRepObserver::SubscribeNotification( )
+    {
+    QDEBUG_WRITE("CMsgCenRepObserver:SubscribeNotification : Enter");
+    // Subscribe
+    iRepository->NotifyRequest( iKey, iStatus );
+    SetActive();
+    QDEBUG_WRITE("CMsgCenRepObserver:SubscribeNotification : Exit");
+    }
+
+// ---------------------------------------------------------
+// RunL
+// ---------------------------------------------------------
+//
+void CMsgCenRepObserver::RunL()
+    {
+    QDEBUG_WRITE("CMsgCenRepObserver:RunL : Enter");
+    iWatcher.HandleCenRepNotificationL();    
+    QDEBUG_WRITE("CMsgCenRepObserver:RunL : Exit");
+    }
+
+// ---------------------------------------------------------
+// RunError
+// ---------------------------------------------------------
+//
+TInt CMsgCenRepObserver::RunError( TInt /*aError*/ )
+    {
+    QDEBUG_WRITE("CMsgCenRepObserver:RunError : Enter");
+    QDEBUG_WRITE("CMsgCenRepObserver:RunError : Exit");
+	return KErrNone;	
+    }
+
+// ---------------------------------------------------------
+// DoCancel
+// ---------------------------------------------------------
+//
+void CMsgCenRepObserver::DoCancel()
+    {
+    QDEBUG_WRITE("CMsgCenRepObserver:DoCancel : Enter");
+    iRepository->NotifyCancel( iKey );
+    QDEBUG_WRITE("CMsgCenRepObserver:DoCancel : Exit");
+    }
+
+// ================= OTHER EXPORTED FUNCTIONS ==============
+
+//  End of File  
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrorwatcher/src/msgerrorcommdbobserver.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,163 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*       CMsgErrorCommDbObserver implementation file
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    <e32base.h>
+#include    <commdb.h>
+
+#include    "msgerrorwatcher_p.h"
+#include    "msgerrorcommdbobserver.h"
+#include    "debugtraces.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CMsgErrorCommDbObserver::CMsgErrorCommDbObserver
+//
+// C++ constructor can NOT contain any code, that
+// might leave.
+// ---------------------------------------------------------
+//
+CMsgErrorCommDbObserver::CMsgErrorCommDbObserver( CMsgErrorWatcherPrivate& aWatcher )
+    : CActive( CActive::EPriorityStandard ),
+    iWatcher( aWatcher )
+    {
+    QDEBUG_WRITE("CMsgErrorCommDbObserver:CMsgErrorCommDbObserver : Enter");
+    QDEBUG_WRITE("CMsgErrorCommDbObserver:CMsgErrorCommDbObserver : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorCommDbObserver::ConstructL
+//
+// Symbian OS default constructor can leave.
+// ---------------------------------------------------------
+//
+void CMsgErrorCommDbObserver::ConstructL()
+    {
+    QDEBUG_WRITE("CMsgErrorCommDbObserver:ConstructL : Enter");
+    iDb = CCommsDatabase::NewL( EDatabaseTypeIAP );
+    CActiveScheduler::Add( this );
+    Start();
+    QDEBUG_WRITE("CMsgErrorCommDbObserver:ConstructL : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorCommDbObserver::NewL
+//
+// Two-phased constructor.
+// ---------------------------------------------------------
+//
+CMsgErrorCommDbObserver* CMsgErrorCommDbObserver::NewL( CMsgErrorWatcherPrivate& aWatcher )
+    {
+    QDEBUG_WRITE("CMsgErrorCommDbObserver:NewL : Enter");
+    CMsgErrorCommDbObserver* self = new ( ELeave )
+        CMsgErrorCommDbObserver( aWatcher );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    QDEBUG_WRITE("CMsgErrorCommDbObserver:NewL : Exit");
+    return self;
+    }
+
+    
+// ---------------------------------------------------------
+// CMsgErrorCommDbObserver::~CMsgErrorCommDbObserver
+//
+// Destructor
+// ---------------------------------------------------------
+//
+CMsgErrorCommDbObserver::~CMsgErrorCommDbObserver()
+    {
+    QDEBUG_WRITE("CMsgErrorCommDbObserver:~CMsgErrorCommDbObserver : Enter");
+    Cancel();
+    delete iDb;
+    QDEBUG_WRITE("CMsgErrorCommDbObserver:~CMsgErrorCommDbObserver : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorCommDbObserver::Restart
+//
+// (Re)starts the active object (public)
+// ---------------------------------------------------------
+//
+void CMsgErrorCommDbObserver::Restart()
+    {
+    QDEBUG_WRITE("CMsgErrorCommDbObserver:Restart : Enter");
+    Start();
+    QDEBUG_WRITE("CMsgErrorCommDbObserver:Restart : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorCommDbObserver::Start
+//
+// Starts the active object
+// ---------------------------------------------------------
+//
+void CMsgErrorCommDbObserver::Start()
+    {
+    QDEBUG_WRITE("CMsgErrorCommDbObserver:Start : Enter");
+    if ( !IsActive() ) 
+        {
+        iDb->RequestNotification( iStatus );
+        SetActive();       
+        }
+    QDEBUG_WRITE("CMsgErrorCommDbObserver:Start : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorCommDbObserver::DoCancel
+//
+// From active object framework
+// ---------------------------------------------------------
+//
+void CMsgErrorCommDbObserver::DoCancel()
+    {
+    QDEBUG_WRITE("CMsgErrorCommDbObserver:DoCancel : Enter");
+    if ( iDb )
+        {
+        iDb->CancelRequestNotification();
+        }
+    QDEBUG_WRITE("CMsgErrorCommDbObserver:DoCancel : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorCommDbObserver::RunL
+//
+// From active object framework
+// ---------------------------------------------------------
+//
+void CMsgErrorCommDbObserver::RunL()
+    {
+    QDEBUG_WRITE("CMsgErrorCommDbObserver:RunL : Enter");
+    if ( iStatus == RDbNotifier::ECommit )
+        {
+        TRAP_IGNORE( iWatcher.HandleCommDbEventL() );
+        }
+    else
+        {
+        Start();
+        }
+    QDEBUG_WRITE("CMsgErrorCommDbObserver:RunL : Exit");
+    }
+
+// ================= OTHER EXPORTED FUNCTIONS ==============
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrorwatcher/src/msgerrordiskspaceobserver.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,173 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*     CMsgErrorDiskSpaceObserver implementation file
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    <e32base.h>
+
+#include    "msgerrorwatcher_p.h"
+#include    "msgerrordiskspaceobserver.h"
+#include    "debugtraces.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CMsgErrorDiskSpaceObserver::CMsgErrorDiskSpaceObserver
+//
+// C++ constructor can NOT contain any code, that
+// might leave.
+// ---------------------------------------------------------
+//
+CMsgErrorDiskSpaceObserver::CMsgErrorDiskSpaceObserver( 
+    CMsgErrorWatcherPrivate& aWatcher, 
+        CMsvSession& aSession, 
+        RFs& aFs )
+    : CActive( CActive::EPriorityStandard ),
+    iWatcher( aWatcher ),
+    iSession( aSession ),
+    iFs( aFs ),
+    iLimit( 0 )
+    {
+    QDEBUG_WRITE("CMsgErrorDiskSpaceObserver:CMsgErrorDiskSpaceObserver : Enter");
+    CActiveScheduler::Add( this );
+    QDEBUG_WRITE("CMsgErrorDiskSpaceObserver:CMsgErrorDiskSpaceObserver : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorDiskSpaceObserver::NewL
+//
+// Two-phased constructor.
+// ---------------------------------------------------------
+//
+CMsgErrorDiskSpaceObserver* CMsgErrorDiskSpaceObserver::NewL( 
+    CMsgErrorWatcherPrivate& aWatcher, 
+        CMsvSession& aSession, 
+        RFs& aFs )
+    {
+    QDEBUG_WRITE("CMsgErrorDiskSpaceObserver:NewL : Enter");
+    CMsgErrorDiskSpaceObserver* self = new ( ELeave )
+        CMsgErrorDiskSpaceObserver( aWatcher, aSession, aFs );
+    QDEBUG_WRITE("CMsgErrorDiskSpaceObserver:NewL : Exit");
+    return self;
+    }
+
+    
+// ---------------------------------------------------------
+// CMsgErrorDiskSpaceObserver::~CMsgErrorDiskSpaceObserver
+//
+// Destructor
+// ---------------------------------------------------------
+//
+CMsgErrorDiskSpaceObserver::~CMsgErrorDiskSpaceObserver()
+    {
+    QDEBUG_WRITE("CMsgErrorDiskSpaceObserver:~CMsgErrorDiskSpaceObserver : Enter");
+    Cancel();
+    QDEBUG_WRITE("CMsgErrorDiskSpaceObserver:~CMsgErrorDiskSpaceObserver : Exit");
+    }
+
+
+// ---------------------------------------------------------
+// CMsgErrorDiskSpaceObserver::DoCancel
+//
+// From active object framework
+// ---------------------------------------------------------
+//
+void CMsgErrorDiskSpaceObserver::DoCancel()
+    {
+    QDEBUG_WRITE("CMsgErrorDiskSpaceObserver:DoCancel : Enter");
+    iFs.NotifyDiskSpaceCancel( iStatus );
+    QDEBUG_WRITE("CMsgErrorDiskSpaceObserver:DoCancel : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorDiskSpaceObserver::RunL
+//
+// From active object framework
+// ---------------------------------------------------------
+//
+void CMsgErrorDiskSpaceObserver::RunL()
+    {
+    QDEBUG_WRITE("CMsgErrorDiskSpaceObserver:RunL : Enter");
+    QDEBUG_WRITE_FORMAT("DiskSpace: RunL, iStatus: ", iStatus.Int() );
+    TInt status = iStatus.Int();
+    if ( status < 0 )
+        {
+        //Reset the observer.
+        TRAP_IGNORE ( SetLimitAndActivateL( iLimit ) );
+        return;
+        }
+    
+    //We shouldn't have to check whether we're above the limit,
+    //because we were below when we activated and the event comes
+    //when we cross the limit
+
+    TRAP_IGNORE( iWatcher.HandleDiskSpaceEventL() );
+    QDEBUG_WRITE("CMsgErrorDiskSpaceObserver:RunL : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorDiskSpaceObserver::SetLimitAndActivateL
+//
+// Sets the disk space trigger level for active object
+// and activates it.
+// ---------------------------------------------------------
+//
+void CMsgErrorDiskSpaceObserver::SetLimitAndActivateL( TInt32 aLimit )
+    {
+    QDEBUG_WRITE("CMsgErrorDiskSpaceObserver:SetLimitAndActivateL : Enter");
+    QDEBUG_WRITE_FORMAT("DiskSpace: aLimit ", aLimit );
+    __ASSERT_DEBUG( aLimit >= 0, User::Leave( KErrArgument ) );
+    if ( aLimit < 0 )
+        {
+        return;
+        }
+    if ( iLimit == 0 || iLimit > aLimit )
+        {
+        Cancel();
+        iLimit = aLimit;
+
+        TInt currentDrive = TInt( iSession.CurrentDriveL() );
+        TVolumeInfo volInfo;
+        User::LeaveIfError( iFs.Volume( volInfo, currentDrive ) );
+        QDEBUG_WRITE_FORMAT("DiskSpace: free/hi : ", I64HIGH( volInfo.iFree ) );
+        QDEBUG_WRITE_FORMAT("DiskSpace: free/lo : ", I64LOW( volInfo.iFree ) );
+        //check if we're already above the limit
+        if ( I64HIGH( volInfo.iFree ) != 0 ||
+            I64LOW( volInfo.iFree ) > (TUint)iLimit ) //iLimit is always positive.
+            {
+            iWatcher.HandleDiskSpaceEventL();
+            return;
+            }
+        else
+            {
+            QDEBUG_WRITE( "notify activated" );
+            TInt64 treshold = iLimit;
+            iFs.NotifyDiskSpace( treshold, currentDrive, iStatus );
+            // No need to check IsActive since object is cancelled 
+            // anyway above
+            SetActive();
+            }
+        }
+    QDEBUG_WRITE("CMsgErrorDiskSpaceObserver:SetLimitAndActivateL : Exit");
+    }
+
+// ================= OTHER EXPORTED FUNCTIONS ==============
+
+//  End of File  
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrorwatcher/src/msgerrorextsmsdiskspaceobserver.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,146 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*       CMsgErrorExtSmsDiskSpaceObserver implementation file
+*
+*
+*/
+
+
+// INCLUDE FILES
+#include <e32base.h>
+
+#include <e32property.h>
+
+#include <smsuaddr.h>
+#include "msgerrorwatcher_p.h"
+#include "msgerrorextsmsdiskspaceobserver.h"
+#include "debugtraces.h"
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CMsgErrorExtSmsDiskSpaceObserver::CMsgErrorExtSmsDiskSpaceObserver
+//
+// C++ constructor can NOT contain any code, that
+// might leave.
+// ---------------------------------------------------------
+//
+CMsgErrorExtSmsDiskSpaceObserver::CMsgErrorExtSmsDiskSpaceObserver( CMsgErrorWatcherPrivate& aWatcher )
+    : CActive( CActive::EPriorityStandard ),
+    iWatcher( aWatcher )
+    {
+    QDEBUG_WRITE("CMsgErrorExtSmsDiskSpaceObserver:CMsgErrorExtSmsDiskSpaceObserver : Enter");
+    CActiveScheduler::Add( this );
+    QDEBUG_WRITE("CMsgErrorExtSmsDiskSpaceObserver:CMsgErrorExtSmsDiskSpaceObserver : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorExtSmsDiskSpaceObserver::ConstructL()
+//
+// Symbian OS default constructor can leave.
+// ---------------------------------------------------------
+//
+void CMsgErrorExtSmsDiskSpaceObserver::ConstructL()
+    {
+    QDEBUG_WRITE("CMsgErrorExtSmsDiskSpaceObserver:ConstructL : Enter");            
+    TInt success = iSmsDiskSpaceProperty.Attach( KUidSystemCategory, KUidPSDiskSpaceMonitorKeyType );
+    QDEBUG_WRITE_FORMAT("iSmsDiskSpaceProperty.Attach: " ,success );
+    User::LeaveIfError(success);        
+    QDEBUG_WRITE( " AFTER ATTACH" );
+    iStatus = KRequestPending;
+    iSmsDiskSpaceProperty.Subscribe( iStatus );
+    SetActive();
+    QDEBUG_WRITE("CMsgErrorExtSmsDiskSpaceObserver:ConstructL : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorExtSmsDiskSpaceObserver::NewL
+//
+// Two-phased constructor.
+// ---------------------------------------------------------
+//
+CMsgErrorExtSmsDiskSpaceObserver* CMsgErrorExtSmsDiskSpaceObserver::NewL( CMsgErrorWatcherPrivate& aWatcher)
+    {
+    QDEBUG_WRITE("CMsgErrorExtSmsDiskSpaceObserver:NewL : Enter");
+    CMsgErrorExtSmsDiskSpaceObserver* self = new ( ELeave )
+        CMsgErrorExtSmsDiskSpaceObserver( aWatcher);
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    QDEBUG_WRITE("CMsgErrorExtSmsDiskSpaceObserver:NewL : Exit");
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorExtSmsDiskSpaceObserver::~CMsgErrorExtSmsDiskSpaceObserver
+//
+// Destructor
+// ---------------------------------------------------------
+//
+CMsgErrorExtSmsDiskSpaceObserver::~CMsgErrorExtSmsDiskSpaceObserver()
+    {
+    QDEBUG_WRITE("CMsgErrorExtSmsDiskSpaceObserver:~CMsgErrorExtSmsDiskSpaceObserver : Enter");
+    Cancel();
+    iSmsDiskSpaceProperty.Close();
+    QDEBUG_WRITE("CMsgErrorExtSmsDiskSpaceObserver:~CMsgErrorExtSmsDiskSpaceObserver : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorExtSmsDiskSpaceObserver::DoCancel
+//
+// From active object framework
+// ---------------------------------------------------------
+//
+void CMsgErrorExtSmsDiskSpaceObserver::DoCancel()
+    {
+    QDEBUG_WRITE("CMsgErrorExtSmsDiskSpaceObserver:DoCancel : Enter");
+    iSmsDiskSpaceProperty.Cancel();
+    QDEBUG_WRITE("CMsgErrorExtSmsDiskSpaceObserver:DoCancel : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorExtSmsDiskSpaceObserver::RunL
+//
+// From active object framework
+// ---------------------------------------------------------
+//
+void CMsgErrorExtSmsDiskSpaceObserver::RunL()
+    {
+    QDEBUG_WRITE("CMsgErrorExtSmsDiskSpaceObserver:RunL : Enter");
+    TInt messagesComingInLowDiskSpace(ESmsDiskSpaceUnknown);
+    TInt success = iSmsDiskSpaceProperty.Get( messagesComingInLowDiskSpace );
+    
+   QDEBUG_WRITE_FORMAT("iSmsDiskSpaceProperty.Get returns: " ,success );
+   QDEBUG_WRITE_FORMAT("iSmsDiskSpaceProperty.Get:  " ,messagesComingInLowDiskSpace );
+        
+    if ( messagesComingInLowDiskSpace == ESmsDiskSpaceFull )
+        {
+        QDEBUG_WRITE( "CMsgErrorExtSmsDiskSpaceObserver::RunL: ESmsDiskSpaceFull" );
+        TRAP_IGNORE( iWatcher.HandleDiskSpaceEvent2L() );
+        }
+
+    iStatus = KRequestPending;
+    iSmsDiskSpaceProperty.Subscribe( iStatus );
+    SetActive();
+    QDEBUG_WRITE("CMsgErrorExtSmsDiskSpaceObserver:RunL : Exit");
+    }
+
+
+
+// ================= OTHER EXPORTED FUNCTIONS ==============
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrorwatcher/src/msgerrorroamingobserver.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,247 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*       CMsgErrorRoamingObserver implementation file
+*
+*/
+
+
+
+// INCLUDE FILES
+#include    <e32base.h>
+#include    <etel.h>
+#include    <etelmm.h>
+#include    <mmtsy_names.h>
+
+#include    "msgerrorwatcher_p.h"
+#include    "msgerrorroamingobserver.h"
+#include    "debugtraces.h"
+
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+/*****************************************************
+*   Series 60 Customer / ETel
+*   Series 60  ETel API
+*****************************************************/
+
+// ---------------------------------------------------------
+// CMsgErrorRoamingObserver::CMsgErrorRoamingObserver
+//
+// C++ constructor can NOT contain any code, that
+// might leave.
+// ---------------------------------------------------------
+//
+CMsgErrorRoamingObserver::CMsgErrorRoamingObserver( CMsgErrorWatcherPrivate&  aWatcher )
+    : CActive( CActive::EPriorityStandard ),
+    iWatcher( aWatcher ),
+    iRoaming( EFalse ),
+    iRegStatus( RMobilePhone::ERegistrationUnknown ),
+    iRequestId( 0 )
+    {
+    QDEBUG_WRITE("CMsgErrorRoamingObserver:CMsgErrorRoamingObserver : Enter");
+    CActiveScheduler::Add( this );
+    QDEBUG_WRITE("CMsgErrorRoamingObserver:CMsgErrorRoamingObserver : Exit");
+    }
+
+/*****************************************************
+*   Series 60 Customer / ETel
+*   Series 60  ETel API
+*****************************************************/
+
+/*****************************************************
+*   Series 60 Customer / TSY
+*   Needs customer TSY implementation
+*****************************************************/
+
+// ---------------------------------------------------------
+// CMsgErrorRoamingObserver::ConstructL()
+//
+// Symbian OS default constructor can leave.
+// ---------------------------------------------------------
+//
+void CMsgErrorRoamingObserver::ConstructL()
+    {
+    QDEBUG_WRITE("CMsgErrorRoamingObserver:ConstructL : Enter");
+    User::LeaveIfError( iETelServer.Connect() );
+    User::LeaveIfError( iETelServer.LoadPhoneModule( KMmTsyModuleName ) );
+    User::LeaveIfError( iMobilePhone.Open( iETelServer, KMmTsyPhoneName ) );
+    iMobilePhone.GetNetworkRegistrationStatus( iStatus, iRegStatus );
+    iRequestId = EMobilePhoneGetNetworkRegistrationStatus;
+    SetActive();
+    QDEBUG_WRITE("CMsgErrorRoamingObserver:ConstructL : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorRoamingObserver::NewL
+//
+// Two-phased constructor.
+// ---------------------------------------------------------
+//
+CMsgErrorRoamingObserver* CMsgErrorRoamingObserver::NewL( CMsgErrorWatcherPrivate& aWatcher )
+    {
+    QDEBUG_WRITE("CMsgErrorRoamingObserver:NewL : Enter");
+    CMsgErrorRoamingObserver* self = new ( ELeave )
+        CMsgErrorRoamingObserver( aWatcher );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    QDEBUG_WRITE("CMsgErrorRoamingObserver:NewL : Exit");
+
+    return self;
+    }
+
+    
+/*****************************************************
+*   Series 60 Customer / ETel
+*   Series 60  ETel API
+*****************************************************/
+
+/*****************************************************
+*   Series 60 Customer / TSY
+*   Needs customer TSY implementation
+*****************************************************/
+
+// ---------------------------------------------------------
+// CMsgErrorRoamingObserver::~CMsgErrorRoamingObserver
+//
+// Destructor
+// ---------------------------------------------------------
+//
+CMsgErrorRoamingObserver::~CMsgErrorRoamingObserver()
+    {
+    QDEBUG_WRITE("CMsgErrorRoamingObserver:~CMsgErrorRoamingObserver : Enter");
+    Cancel();
+    iMobilePhone.Close();
+    iETelServer.UnloadPhoneModule( KMmTsyModuleName );
+    iETelServer.Close();    
+    QDEBUG_WRITE("CMsgErrorRoamingObserver:~CMsgErrorRoamingObserver : Exit");
+    }
+
+/*****************************************************
+*   Series 60 Customer / ETel
+*   Series 60  ETel API
+*****************************************************/
+
+// ---------------------------------------------------------
+// CMsgErrorRoamingObserver::UpdateRoamingStatusL
+//
+// Checks whether roaming status has actually changed
+// ---------------------------------------------------------
+//
+void CMsgErrorRoamingObserver::UpdateRoamingStatusL()
+    {
+    QDEBUG_WRITE("CMsgErrorRoamingObserver:UpdateRoamingStatusL : Enter");
+    QDEBUG_WRITE_FORMAT("iRoaming: ", iRoaming);
+    QDEBUG_WRITE_FORMAT("iRegStatus: ", iRegStatus);
+    
+    TBool changed = EFalse;
+    if ( iRoaming && iRegStatus == RMobilePhone::ERegisteredOnHomeNetwork )
+        {
+        iRoaming = EFalse;
+        changed = ETrue;
+        }
+    else if ( !iRoaming && iRegStatus == RMobilePhone::ERegisteredRoaming )
+        {
+        iRoaming = ETrue;
+        changed = ETrue;
+        }
+    else
+        {
+        //Nothing to do
+        }  
+    QDEBUG_WRITE_FORMAT("changed: ", changed);
+    if ( changed )
+        {
+        //Inform watcher only when roaming status has changed
+        iWatcher.HandleRoamingEventL( iRoaming );
+        }
+    QDEBUG_WRITE("CMsgErrorRoamingObserver:UpdateRoamingStatusL : Exit");
+    }
+
+/*****************************************************
+*   Series 60 Customer / ETel
+*   Series 60  ETel API
+*****************************************************/
+
+// ---------------------------------------------------------
+// CMsgErrorRoamingObserver::Start
+//
+// Starts the active object
+// ---------------------------------------------------------
+//
+void CMsgErrorRoamingObserver::Start()
+    {
+    QDEBUG_WRITE("CMsgErrorRoamingObserver:Start : Enter");
+    if ( !IsActive() ) 
+        {
+        iMobilePhone.NotifyNetworkRegistrationStatusChange( iStatus, iRegStatus );
+        iRequestId = EMobilePhoneNotifyNetworkRegistrationStatusChange;
+        SetActive();
+        }
+    QDEBUG_WRITE("CMsgErrorRoamingObserver:Start : Exit");
+    }
+
+/*****************************************************
+*   Series 60 Customer / ETel
+*   Series 60  ETel API
+*****************************************************/
+
+// ---------------------------------------------------------
+// CMsgErrorRoamingObserver::DoCancel
+//
+// From active object framework
+// ---------------------------------------------------------
+//
+void CMsgErrorRoamingObserver::DoCancel()
+    {
+    QDEBUG_WRITE("CMsgErrorRoamingObserver:DoCancel : Enter");
+    if ( iRequestId )
+        {
+        iMobilePhone.CancelAsyncRequest( iRequestId );
+        iRequestId = 0;
+        }
+    QDEBUG_WRITE("CMsgErrorRoamingObserver:DoCancel : Exit");
+    }
+
+/*****************************************************
+*   Series 60 Customer / ETel
+*   Series 60  ETel API
+*****************************************************/
+
+// ---------------------------------------------------------
+// CMsgErrorRoamingObserver::RunL
+//
+// From active object framework
+// ---------------------------------------------------------
+//
+void CMsgErrorRoamingObserver::RunL()
+    {
+    QDEBUG_WRITE("CMsgErrorRoamingObserver:RunL : Enter");
+    iRequestId = 0;
+    TInt status = iStatus.Int();
+    if ( status < 0 )
+        {
+        iRegStatus = RMobilePhone::ERegistrationUnknown;
+        }
+    TRAP_IGNORE( UpdateRoamingStatusL() );
+    Start();
+    QDEBUG_WRITE("CMsgErrorRoamingObserver:RunL : Exit");
+    }
+
+// ================= OTHER EXPORTED FUNCTIONS ==============
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrorwatcher/src/msgerrorsmsdiskspaceobserver.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,147 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*       CMsgErrorSmsDiskSpaceObserver implementation file
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+
+#include <e32property.h>
+
+#include <smsuaddr.h>
+#include  "msgerrorwatcher_p.h"
+#include "msgerrorsmsdiskspaceobserver.h"
+#include "debugtraces.h"
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CMsgErrorSmsDiskSpaceObserver::CMsgErrorSmsDiskSpaceObserver
+//
+// C++ constructor can NOT contain any code, that
+// might leave.
+// ---------------------------------------------------------
+//
+CMsgErrorSmsDiskSpaceObserver::CMsgErrorSmsDiskSpaceObserver( CMsgErrorWatcherPrivate&  aWatcher )
+    : CActive( CActive::EPriorityStandard ),
+    iWatcher( aWatcher )
+    {
+    QDEBUG_WRITE("CMsgErrorSmsDiskSpaceObserver:CMsgErrorSmsDiskSpaceObserver : Enter");
+    CActiveScheduler::Add( this );
+    QDEBUG_WRITE("CMsgErrorSmsDiskSpaceObserver:CMsgErrorSmsDiskSpaceObserver : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorSmsDiskSpaceObserver::ConstructL()
+//
+// Symbian OS default constructor can leave.
+// ---------------------------------------------------------
+//
+void CMsgErrorSmsDiskSpaceObserver::ConstructL()
+    {
+    QDEBUG_WRITE("CMsgErrorSmsDiskSpaceObserver:ConstructL : Enter");
+    
+    TInt success = iSmsDiskSpaceProperty.Attach( KUidPSSMSStackCategory, KUidPSSMSStackDiskSpaceMonitorKey );
+    QDEBUG_WRITE_FORMAT("iSmsDiskSpaceProperty.Attach: " ,success );
+    User::LeaveIfError(success);            
+    iStatus = KRequestPending;
+    iSmsDiskSpaceProperty.Subscribe( iStatus );
+    SetActive();
+    QDEBUG_WRITE("CMsgErrorSmsDiskSpaceObserver:ConstructL : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorSmsDiskSpaceObserver::NewL
+//
+// Two-phased constructor.
+// ---------------------------------------------------------
+//
+CMsgErrorSmsDiskSpaceObserver* CMsgErrorSmsDiskSpaceObserver::NewL( CMsgErrorWatcherPrivate&  aWatcher)
+    {
+    QDEBUG_WRITE("CMsgErrorSmsDiskSpaceObserver:NewL : Enter");
+    CMsgErrorSmsDiskSpaceObserver* self = new ( ELeave )
+        CMsgErrorSmsDiskSpaceObserver( aWatcher);
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    QDEBUG_WRITE("CMsgErrorSmsDiskSpaceObserver:NewL : Exit");
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorSmsDiskSpaceObserver::~CMsgErrorSmsDiskSpaceObserver
+//
+// Destructor
+// ---------------------------------------------------------
+//
+CMsgErrorSmsDiskSpaceObserver::~CMsgErrorSmsDiskSpaceObserver()
+    {
+    QDEBUG_WRITE("CMsgErrorSmsDiskSpaceObserver:~CMsgErrorSmsDiskSpaceObserver : Enter");
+    Cancel();
+    iSmsDiskSpaceProperty.Close();
+    QDEBUG_WRITE("CMsgErrorSmsDiskSpaceObserver:~CMsgErrorSmsDiskSpaceObserver : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorSmsDiskSpaceObserver::DoCancel
+//
+// From active object framework
+// ---------------------------------------------------------
+//
+void CMsgErrorSmsDiskSpaceObserver::DoCancel()
+    {
+    QDEBUG_WRITE("CMsgErrorSmsDiskSpaceObserver:DoCancel : Enter");
+    iSmsDiskSpaceProperty.Cancel();
+    QDEBUG_WRITE("CMsgErrorSmsDiskSpaceObserver:DoCancel : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorSmsDiskSpaceObserver::RunL
+//
+// From active object framework
+// ---------------------------------------------------------
+//
+void CMsgErrorSmsDiskSpaceObserver::RunL()
+    {
+    QDEBUG_WRITE("CMsgErrorSmsDiskSpaceObserver:RunL : Enter");    
+    TInt messagesComingInLowDiskSpace(ESmsDiskSpaceUnknown);
+    TInt success = iSmsDiskSpaceProperty.Get( messagesComingInLowDiskSpace );
+    
+   QDEBUG_WRITE_FORMAT("iSmsDiskSpaceProperty.Get returns: " ,success );
+   QDEBUG_WRITE_FORMAT("iSmsDiskSpaceProperty.Get: " ,messagesComingInLowDiskSpace );
+        
+    
+    if ( messagesComingInLowDiskSpace == ESmsDiskSpaceFull )
+        {
+        QDEBUG_WRITE( "CMsgErrorSmsDiskSpaceObserver::RunL: ESmsDiskSpaceFull" );
+        TRAP_IGNORE( iWatcher.HandleDiskSpaceEvent2L() );
+        }
+
+    iStatus = KRequestPending;
+    iSmsDiskSpaceProperty.Subscribe( iStatus );
+    SetActive();
+    QDEBUG_WRITE("CMsgErrorSmsDiskSpaceObserver:RunL : Exit");
+    }
+
+
+
+// ================= OTHER EXPORTED FUNCTIONS ==============
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrorwatcher/src/msgerrorstartupobserver.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,144 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*       CMsgErrorStartupObserver implementation file
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+
+#include <startupdomainpskeys.h>
+
+#include  "msgerrorwatcher_p.h"
+#include  "msgerrorstartupobserver.h"
+#include "debugtraces.h"
+
+
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CMsgErrorStartupObserver::CMsgErrorStartupObserver
+//
+// C++ constructor can NOT contain any code, that
+// might leave.
+// ---------------------------------------------------------
+//
+CMsgErrorStartupObserver::CMsgErrorStartupObserver( CMsgErrorWatcherPrivate&  aWatcher )
+    : CActive( CActive::EPriorityStandard ),
+    iWatcher( aWatcher )
+    {
+    QDEBUG_WRITE("CMsgErrorStartupObserver:CMsgErrorStartupObserver : Enter");
+    CActiveScheduler::Add( this );
+    QDEBUG_WRITE("CMsgErrorStartupObserver:CMsgErrorStartupObserver : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorStartupObserver::ConstructL()
+//
+// Symbian OS default constructor can leave.
+// ---------------------------------------------------------
+//
+void CMsgErrorStartupObserver::ConstructL()
+    {
+    QDEBUG_WRITE("CMsgErrorStartupObserver:ConstructL : Enter");
+    User::LeaveIfError( iStartupProperty.Attach( KPSUidStartup, KPSGlobalSystemState ) );
+    // Complete self
+    iStatus = KRequestPending;
+    TRequestStatus* pStatus = &iStatus;
+    SetActive();
+    User::RequestComplete( pStatus, KErrNone );
+    QDEBUG_WRITE("CMsgErrorStartupObserver:ConstructL : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorStartupObserver::NewL
+//
+// Two-phased constructor.
+// ---------------------------------------------------------
+//
+CMsgErrorStartupObserver* CMsgErrorStartupObserver::NewL( CMsgErrorWatcherPrivate&  aWatcher )
+    {
+    QDEBUG_WRITE("CMsgErrorStartupObserver:NewL : Enter");
+    CMsgErrorStartupObserver* self = new ( ELeave )
+        CMsgErrorStartupObserver( aWatcher );
+    
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    QDEBUG_WRITE("CMsgErrorStartupObserver:NewL : Exit");
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorStartupObserver::~CMsgErrorStartupObserver
+//
+// Destructor
+// ---------------------------------------------------------
+//
+CMsgErrorStartupObserver::~CMsgErrorStartupObserver()
+    {
+    QDEBUG_WRITE("CMsgErrorStartupObserver:~CMsgErrorStartupObserver : Enter");
+    Cancel();
+    iStartupProperty.Close();
+    QDEBUG_WRITE("CMsgErrorStartupObserver:~CMsgErrorStartupObserver : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorStartupObserver::DoCancel
+//
+// From active object framework
+// ---------------------------------------------------------
+//
+void CMsgErrorStartupObserver::DoCancel()
+    {
+    QDEBUG_WRITE("CMsgErrorStartupObserver:DoCancel : Enter");
+    iStartupProperty.Cancel();
+    QDEBUG_WRITE("CMsgErrorStartupObserver:DoCancel : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorStartupObserver::RunL
+//
+// From active object framework
+// ---------------------------------------------------------
+//
+void CMsgErrorStartupObserver::RunL()
+    {
+    QDEBUG_WRITE("CMsgErrorStartupObserver:RunL : Enter");
+    TInt startupState = 0;
+    iStartupProperty.Get( startupState );
+
+    if ( startupState == ESwStateNormalRfOn ||
+        startupState == ESwStateNormalRfOff ||
+        startupState == ESwStateNormalBTSap )
+        {
+        TRAP_IGNORE( iWatcher.HandleStartupReadyL() );
+        }
+    else
+        {
+        iStatus = KRequestPending;
+        iStartupProperty.Subscribe( iStatus );
+        SetActive();
+        }
+    QDEBUG_WRITE("CMsgErrorStartupObserver:RunL : Exit");
+    }
+
+// ================= OTHER EXPORTED FUNCTIONS ==============
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrorwatcher/src/msgerrorwatcher.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *     MsgErrorWatcher implementation file
+ *
+ */
+
+// SYSTEM INCLUDES
+#include <hbmessagebox.h>
+
+//USER INCLUDES
+#include "msgerrorwatcher.h"
+#include "msgerrorwatcher_p.h"
+#include <hbdevicemessagebox.h>
+#include <hbnotificationdialog.h>
+#include <HbDeviceNotificationDialog>
+#include "debugtraces.h"
+#include <HbDeviceMessageBox>
+#include <xqaiwrequest.h>
+#include <xqappmgr.h>
+#include "msgsettingsview.h"
+// LOCAL CONSTANTS AND MACROS
+#define LOC_MSG_ERRH_DISK_LOW_1     hbTrId("MMS message isn't fetched because disk space is low. Free some memory first.")
+#define LOC_MSG_ERRH_MEMORY_LOW     hbTrId("MMS message is not been fetched because device memory is low. Try to close other applications.")
+#define LOC_MMS_OFF      hbTrId("The MMS message reception is now off. You should change the reception to Always enabled in order to receive MMS messages while roaming.")
+#define LOC_MSG_ERRH_ACCESS_POINTS_INV   hbTrId("MMS Access Points are not valid. Please check the access point data.")
+#define LOC_OK hbTrId("Ok")
+#define LOC_CANCEL hbTrId("Cancel")
+// ----------------------------------------------------------------------------
+// MsgErrorWatcher::MsgErrorWatcher
+// @see MsgErrorWatcher.h
+// ----------------------------------------------------------------------------
+MsgErrorWatcher::MsgErrorWatcher(QObject* parent) :
+    QObject(parent)
+{
+    QDEBUG_WRITE("MsgErrorWatcher::MsgErrorWatcher : Enter")
+
+    d_ptr = new CMsgErrorWatcherPrivate(this);
+    // load the messaging ts file.
+
+    QDEBUG_WRITE("MsgErrorWatcher::MsgErrorWatcher : Exit")
+}
+
+// ----------------------------------------------------------------------------
+// MsgErrorWatcher::~MsgErrorWatcher
+// @see MsgErrorWatcher.h
+// ----------------------------------------------------------------------------
+MsgErrorWatcher::~MsgErrorWatcher()
+{
+   QDEBUG_WRITE("MsgErrorWatcher::~MsgErrorWatcher : Enter")
+
+    delete d_ptr;
+
+  QDEBUG_WRITE("MsgErrorWatcher::~MsgErrorWatcher : Exit")
+}
+
+// ----------------------------------------------------------------------------
+// MsgErrorWatcher::~MsgErrorWatcher
+// @see MsgErrorWatcher.h
+// ----------------------------------------------------------------------------
+void MsgErrorWatcher::ShowNote(TMsgErrorNoteIds errornoteid)
+{
+    QDEBUG_WRITE("MsgErrorWatcher::ShowNote : Enter")
+    QDEBUG_WRITE_FORMAT("errornoteid : ", errornoteid)
+    HbDeviceMessageBox messageBox(HbMessageBox::MessageTypeWarning);
+    QAction* actionView = NULL;
+    QAction* actionQuit = NULL;
+    const QAction* result = NULL;
+    //create dialog parameters
+    QString text("");
+    switch (errornoteid) {
+    case EDiskLowNote1:
+        text = LOC_MSG_ERRH_DISK_LOW_1;
+        break;
+    case EMemoryLowNote:
+        text = LOC_MSG_ERRH_MEMORY_LOW;
+        break;
+    case ERoamingNote:
+        text = LOC_MMS_OFF;
+        break;
+    case EInvalidAccessPointNote:
+        text = LOC_MSG_ERRH_ACCESS_POINTS_INV;
+        messageBox.setTimeout(HbPopup::NoTimeout);
+        messageBox.setText(text);
+        actionView = new QAction(LOC_OK, this);
+        messageBox.setAction(actionView, HbDeviceMessageBox::AcceptButtonRole);
+
+        actionQuit = new QAction(LOC_CANCEL, this);
+        messageBox.setAction(actionQuit, HbDeviceMessageBox::RejectButtonRole);
+
+        messageBox.setDismissPolicy(HbPopup::NoDismiss);
+        // launch Messagebox
+        result = messageBox.exec();
+
+        // if accepted launch view else quit
+        if (messageBox.isAcceptAction(result)) {
+            QList<QVariant> args;
+            QString serviceName("messagesettings");
+            QString operation("launchSettings(int)");
+            XQAiwRequest* request;
+            XQApplicationManager appManager;
+            request = appManager.create(serviceName, "com.nokia.symbian.IMessageSettings",
+                operation, false); // non embedded
+            if (request == NULL) {
+                return;
+            }
+            args << QVariant(MsgSettingsView::MMSView);
+            request->setArguments(args);
+            request->send();
+            delete request;
+        }
+        return;
+    default:
+        break;
+    }
+    HbDeviceNotificationDialog::notification("", text);
+    QDEBUG_WRITE("MsgErrorWatcher::ShowNote : Exit")
+
+}
+
+//EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrorwatcher/src/msgerrorwatcher_p.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,1331 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*     CMsgErrorWatcherPrivate implementation file
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+
+#include <msvapi.h>
+#include <msvids.h>          //Msv index entry ID's
+#include <msvuids.h>
+#include <mmscmds.h>         //EMmsScheduledReceiveForced
+#include <mmsconst.h>        //Notification folder
+#include <SenduiMtmUids.h>   //MTM Uids
+#include <mtclreg.h>         //ClientMtmRegistry
+#include <watcher.h>
+#include <mmserrors.h>
+#include <mmsclient.h>
+#include <mmssettings.h>
+
+
+
+#include <xqconversions.h>
+#include <hbglobal.h>
+#include <HbTranslator>
+#include <QString>
+#include <in_iface.h>            // KErrIfAuthenticationFailure
+#include <etelpckt.h>            // KErrGprsInsufficientResources, etc.
+//#include <exterror.h>            // KErrGsmMMServiceOptionTemporaryOutOfOrder
+#include <gsmerror.h>
+
+#include <centralrepository.h>    // link against centralrepository.lib
+#include <messaginginternalcrkeys.h> // for Central Repository keys
+
+#include <messagingvariant.hrh>  // Variation
+
+#include "msgerrorwatcher.h"
+#include "msgerrorwatcher_p.h"
+#include "msgerrorwatcher.hrh"
+#include "msgerrorcommdbobserver.h"
+#include "msgcenrepobserver.h"
+// this should be handled later,
+//#include "msgerrorconnectionobserver.h"
+#include "msgerrordiskspaceobserver.h"
+#include "msgerrorsmsdiskspaceobserver.h"
+#include "msgerrorextsmsdiskspaceobserver.h"
+#include "msgerrorroamingobserver.h"
+#include "msgerrorstartupobserver.h"
+
+
+
+#include "debugtraces.h"
+
+//const TInt KConnectionRetries = 3;
+//const TInt KIntMaxLength = 10; //2~32 =~ 4000000000
+const TUint KInitialDelayBetweenSessionConnectRetries = 5000000; //five seconds
+const TUint KMaxTimerRetries = 50;
+//const TInt KDelayAfterDisconnect = 3000000; //3 seconds
+//Total delay between first and last retry is
+//( A * (B^2 + B) ) / 2
+// - where A is KInitialDelayBetweenSessionConnectRetries
+// -   and B is KMaxTimerRetries
+//If A = 5 seconds and B = 50 times last retry is made
+//after about 106 minutes from the first one.
+//const TMsvId KWatcherInboxFolderId = KMsvGlobalInBoxIndexEntryIdValue;
+const TMsvId KWatcherOutboxFolderId = KMsvGlobalOutBoxIndexEntryIdValue;
+//const TUid KMessageEntryUid = { KUidMsvMessageEntryValue };
+
+
+CMsgErrorWatcherPrivate::CMsgErrorWatcherPrivate(MsgErrorWatcher* msgErrorWatcher  ): 
+CActive( EPriorityStandard ),
+    q_ptr(msgErrorWatcher),
+    iMmsServiceId( KMsvNullIndexEntryId ),
+    iNotificationFolderId( KMsvNullIndexEntryId ),
+    iCurrentEntryId ( KMsvNullIndexEntryId )
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:CMsgErrorWatcherPrivate : Enter");
+    CActiveScheduler::Add( this );
+    TRAP_IGNORE(InitL())
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:CMsgErrorWatcherPrivate : Exit");
+    
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::CMsgErrorWatcherPrivate
+//
+// Symbian OS default constructor can leave.
+// ---------------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::InitL()
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:InitL : Enter");
+    User::LeaveIfError( iTimer.CreateLocal() );
+    User::LeaveIfError(iFs.Connect());
+
+    TInt features = 0;   
+    CRepository* repository = CRepository::NewL( KCRUidMuiuVariation );
+    repository->Get( KMuiuMmsFeatures, features );
+    delete repository;
+    repository = NULL;
+    if ( features & KMmsFeatureIdDelayDisconnectDialog )
+        {
+        iWatcherFlags |= EReceivingDisconnectDelay;
+        }
+
+    StartWatcherL();
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:InitL : Exit");
+    }
+
+
+
+    
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::~CMsgErrorWatcherPrivate
+//
+// Destructor
+// ---------------------------------------------------------
+//
+CMsgErrorWatcherPrivate::~CMsgErrorWatcherPrivate()
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:~CMsgErrorWatcherPrivate : Enter");   
+    StopWatcher();
+    iTimer.Close();
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:~CMsgErrorWatcherPrivate : Exit");  
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::StartWatcherL
+//
+// Does the actual construction of the watcher.
+// ---------------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::StartWatcherL()
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:StartMmsFetchL : Enter"); 
+    iSession = CMsvSession::OpenSyncL( *this );
+    // might be required in future for propogating the errors to the ui.
+    iMmsReceiveErrorMessages = new ( ELeave ) CMsvEntrySelection;
+    iMmsSendErrorMessages = new ( ELeave ) CMsvEntrySelection;
+    
+    // Get message server session
+    iClientMtmRegistry = CClientMtmRegistry::NewL( *iSession );
+    TRAPD( err,
+        {
+        iMmsClient = static_cast<CMmsClientMtm*>
+            ( iClientMtmRegistry->NewMtmL( KUidMsgTypeMultimedia ) );
+        } );
+    if ( err == KErrNotFound )
+        {
+        QDEBUG_WRITE( "MmsClientMtm not found!" );
+        // Make sure iMmsClient is NULL - just in case.
+        delete iMmsClient;
+        iMmsClient = NULL;
+        }
+    else
+        {
+        User::LeaveIfError( err );
+        }
+
+    if ( iMmsClient )
+        {
+        // We're interested in roaming events only if MMS is enabled.
+        iRoamingObserver = CMsgErrorRoamingObserver::NewL( *this ); 
+        QDEBUG_WRITE( "Created Roaming Observer!" );
+        }
+
+
+    iStartupObserver = CMsgErrorStartupObserver::NewL( *this );
+    
+    if(!( iWatcherFlags & EWatcherRunning))
+        {
+        //if not yet created
+        iSmsDiskSpaceObserver = CMsgErrorSmsDiskSpaceObserver::NewL( *this );
+        iSmsExtDiskSpaceObserver = CMsgErrorExtSmsDiskSpaceObserver::NewL( *this );
+        QDEBUG_WRITE( "Created iSmsDiskSpaceObserver, iSmsExtDiskSpaceObserver!" );
+        }
+
+    iWatcherFlags |= EWatcherRunning;
+
+    if ( GetMmsServiceL() )
+        {
+        CheckMmsReceivingModeL();
+        }
+
+    // Startup successful if we got this far. Reset retry counter.
+    iTimerRetries = 0;
+    
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:StartWatcherL : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::StopWatcher
+//
+// Stops (and destructs) the watcher.
+// ---------------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::StopWatcher()
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:~CMsgErrorWatcherPrivate : Enter");
+    iWatcherFlags &= ~EWatcherRunning;
+    iWatcherFlags &= ~ENoAPErrorPending;
+    iMmsServiceId = KMsvNullIndexEntryId;
+    iNotificationFolderId = KMsvNullIndexEntryId;
+    Cancel();
+
+    delete iCommDbObserver;
+    iCommDbObserver = NULL;
+    delete iCenRepObserver;
+    iCenRepObserver = NULL;
+//    delete iConnectionObserver;
+//    iConnectionObserver = NULL;
+    delete iDiskSpaceObserver;
+    iDiskSpaceObserver = NULL;
+    delete iSmsDiskSpaceObserver;
+    iSmsDiskSpaceObserver = NULL;
+    delete iSmsExtDiskSpaceObserver;
+    iSmsExtDiskSpaceObserver = NULL;    
+    delete iRoamingObserver;
+    iRoamingObserver = NULL;
+    delete iMmsClient;
+    iMmsClient = NULL;
+    delete iClientMtmRegistry;
+    iClientMtmRegistry = NULL;
+    delete iOperation;
+    iOperation = NULL;
+    delete iStartupObserver;
+    iStartupObserver = NULL;
+    delete iSession;
+    iSession = NULL;
+    delete iMmsReceiveErrorMessages;
+    iMmsReceiveErrorMessages = NULL;
+    delete iMmsSendErrorMessages;
+    iMmsSendErrorMessages = NULL;
+
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:~CMsgErrorWatcherPrivate : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::StartRestartTimer
+//
+// Start session reconnect timer.
+// ---------------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::StartRestartTimer()
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:~CMsgErrorWatcherPrivate : Enter");
+    if ( !IsActive() ) 
+        {
+        QDEBUG_WRITE( "Starting timer" );
+        iStatus = KRequestPending;
+        iRequestType = EMsgRequestStartingUp;
+        iTimerRetries++;
+        //The interval between retries comes longer every time
+        iTimer.After( iStatus,
+            iTimerRetries * KInitialDelayBetweenSessionConnectRetries );
+        SetActive();
+        }
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:~CMsgErrorWatcherPrivate : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::ResetWatcher
+//
+// Resets watcher.
+// ---------------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::ResetWatcher()
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:~CMsgErrorWatcherPrivate : Enter");
+
+    iWatcherFlags &= ~ENoAPErrorPending;
+    
+    //Drop all observers
+    delete iCommDbObserver;
+    iCommDbObserver = NULL;
+    delete iCenRepObserver;
+    iCenRepObserver = NULL;
+//    delete iConnectionObserver;
+//    iConnectionObserver = NULL;
+    delete iDiskSpaceObserver;
+    iDiskSpaceObserver = NULL;
+	delete iSmsDiskSpaceObserver;
+    iSmsDiskSpaceObserver = NULL;
+    delete iSmsExtDiskSpaceObserver;
+    iSmsExtDiskSpaceObserver = NULL;    
+    //Reset disk space errors
+    iDiskSpaceErrors = 0;
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:~CMsgErrorWatcherPrivate : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::GetMmsServiceL
+//
+// Retrieves MMS service id from MsgStore
+// ---------------------------------------------------------
+//
+TBool CMsgErrorWatcherPrivate::GetMmsServiceL()
+    {
+    if ( !iMmsClient )
+        {
+        return EFalse;
+        }
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:~CMsgErrorWatcherPrivate : Enter");
+    if ( iMmsServiceId == KMsvNullIndexEntryId )
+        {
+        QDEBUG_WRITE( "Looking for MMS service" );
+        iMmsClient->RestoreSettingsL();
+        iMmsServiceId = iMmsClient->MmsSettings().Service();
+        iNotificationFolderId = iMmsClient->MmsSettings().NotificationFolder();
+        iMaxReceiveSize = iMmsClient->MmsSettings().MaximumReceiveSize();
+        }
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:~CMsgErrorWatcherPrivate : Exit");
+    return ( iMmsServiceId != KMsvNullIndexEntryId );
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::StartMmsFetchL
+//
+// Initiates MMS fetch
+// ---------------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::StartMmsFetchL()
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:~CMsgErrorWatcherPrivate : Enter");
+    if ( !IsActive() && iMmsReceiveErrorMessages->Count() )
+        {
+        QDEBUG_WRITE_FORMAT("Fetching  message(s): ",
+            iMmsReceiveErrorMessages->Count() );
+        TCommandParameters parameters; // initialized to zero
+        TCommandParametersBuf paramPack( parameters );
+
+        //Add service entry as the first entry in the array
+        iMmsReceiveErrorMessages->InsertL( 0, iMmsServiceId );
+
+        // First remove existing schedules:
+        QDEBUG_WRITE( "Deleting old schedules" );
+        // Calling synchronous TransferCommandL method
+        const TInt KBufSize = 256;
+        TBuf8<KBufSize> dummy;
+        iSession->TransferCommandL( *iMmsReceiveErrorMessages,
+            EMmsDeleteSchedule,
+            paramPack,
+            dummy );
+        QDEBUG_WRITE( "Old schedules deleted!" );
+
+        // Then reschedule:
+        iStatus = KRequestPending;
+        iRequestType = EMsgRequestFetching;
+        delete iOperation;
+        iOperation = NULL;
+        QDEBUG_WRITE( "Request fetch" );
+        iOperation = iSession->TransferCommandL( *iMmsReceiveErrorMessages,
+            EMmsScheduledReceive,
+            paramPack,
+            iStatus );
+        SetActive();
+        QDEBUG_WRITE( "Reset array" );
+        iMmsReceiveErrorMessages->Reset();
+        }
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:~CMsgErrorWatcherPrivate : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::StartMmsSendL
+//
+// 
+// ---------------------------------------------------------
+// TODO: to be handled late when connection errors are handled.
+//void CMsgErrorWatcherPrivate::StartMmsSendL()
+//    {
+//   QDEBUG_WRITE("CMsgErrorWatcherPrivate:StartMmsSendL : Enter");
+//    if ( !IsActive() && iMmsSendErrorMessages->Count() )
+//        {
+//        QDEBUG_WRITE_FORMAT("Sending message(s): "),
+//            iMmsSendErrorMessages->Count() );
+//        TCommandParameters parameters; // initialized to zero
+//        TCommandParametersBuf paramPack( parameters );
+//
+//        //Add service entry as the first entry in the array
+//        iMmsSendErrorMessages->InsertL( 0, iMmsServiceId );
+//
+//        iStatus = KRequestPending;
+//        iRequestType = EMsgRequestSending;
+//        delete iOperation;
+//        iOperation = NULL;
+//        QDEBUG_WRITE( "Request send" );
+//        iOperation = iSession->TransferCommandL( *iMmsSendErrorMessages,
+//            EMmsScheduledSend,
+//            paramPack,
+//            iStatus );
+//        SetActive();
+//        QDEBUG_WRITE( "Reset array" );
+//        iMmsSendErrorMessages->Reset();
+//        }
+//     QDEBUG_WRITE("CMsgErrorWatcherPrivate:StartMmsSendL : Exit");
+//    }
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::CheckMmsReceivingModeL
+//
+// Checks MMS receiving mode
+// ---------------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::CheckMmsReceivingModeL()
+    {
+    if ( !( iWatcherFlags & EStartupReady ) || !GetMmsServiceL() )
+        {
+        return;
+        }
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:CMsgErrorWatcherPrivate : Enter");
+    TBool validAP = ValidateMmsServiceL(); //Refreshes MMS settings
+    
+
+    TInt fetchHome = iMmsClient->MmsSettings().ReceivingModeHome();
+    TInt fetchRoam = iMmsClient->MmsSettings().ReceivingModeForeign();
+    QDEBUG_WRITE_FORMAT("ReceivingModeHome: ", fetchHome );
+    QDEBUG_WRITE_FORMAT("ReceivingModeForeign: ", fetchRoam );
+
+    if ( validAP &&
+        fetchRoam == EMmsReceivingReject &&
+        fetchHome != EMmsReceivingReject )
+        {
+        QDEBUG_WRITE( "ShowNote flag enabled" );
+        iWatcherFlags |= EShowRoamingNote;
+        }
+    else
+        {
+        //Reset roaming note flag
+        QDEBUG_WRITE( "ShowNote flag disabled" );
+        iWatcherFlags &= ~EShowRoamingNote;
+        iWatcherFlags &= ~ERoamingNoteShown;
+        }
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:~CMsgErrorWatcherPrivate : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::ValidateMmsServiceL
+//
+// Validates MMS service
+// ---------------------------------------------------------
+//
+TBool CMsgErrorWatcherPrivate::ValidateMmsServiceL()
+    {
+//    if ( !GetMmsServiceL() )
+//        {
+//        return EFalse;
+//        }
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:ValidateMmsServiceL : Enter");
+    iMmsClient->RestoreSettingsL(); //Refreshes MMS settings
+    QDEBUG_WRITE_FORMAT("ValidateService: ", iMmsClient->ValidateService( iMmsServiceId ) );
+
+    TInt errorCode = iMmsClient->ValidateService( iMmsServiceId );
+    QDEBUG_WRITE_FORMAT("ValidateService: errorcode ---  ", errorCode );
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:ValidateMmsServiceL : Exit");
+    return ( errorCode == KErrNone );
+    }
+
+// ---------------------------------------------------------
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::HandleNoAPErrorL
+//
+// Handles "no access point defined" error
+// ---------------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::HandleNoAPErrorL( TMsvEntry& aEntry )
+    { 
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleNoAPErrorL : Enter");
+    iMmsReceiveErrorMessages->AppendL( aEntry.Id() );
+
+    iWatcherFlags |= ENoAPErrorPending;
+    if ( !iCenRepObserver )
+        {
+        QDEBUG_WRITE( "Creating CenRep observer" );
+        iCenRepObserver = CMsgCenRepObserver::NewL( *this );
+        iCenRepObserver->SubscribeNotification();
+        }
+    //Let's reset the TMsvEntry::iError to get rig of excess warning note
+    ResetErrorFieldL( aEntry );
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleNoAPErrorL : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::HandleInvalidAPErrorL
+//
+// Handles "invalid access point" error
+// ---------------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::HandleInvalidAPErrorL( TMsvEntry& aEntry, TBool aStartObserver )
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleInvalidAPErrorL : Enter");
+    iMmsReceiveErrorMessages->AppendL( aEntry.Id() );
+   
+    q_ptr->ShowNote(EInvalidAccessPointNote);
+    if ( aStartObserver && !iCommDbObserver )
+        {
+        QDEBUG_WRITE( "Creating CommDB observer" );
+        iCommDbObserver = CMsgErrorCommDbObserver::NewL( *this );
+        }
+    if ( aStartObserver && !iCenRepObserver )
+        {
+        //We must also start cenrep observer
+        QDEBUG_WRITE( "Creating CenRep observer" );
+        iCenRepObserver = CMsgCenRepObserver::NewL( *this );
+        iCenRepObserver->SubscribeNotification();
+        }    
+    
+    //Let's reset the TMsvEntry::iError to get rig of excess warning note
+    ResetErrorFieldL( aEntry ); 
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleInvalidAPErrorL : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::HandleConnectionErrorL
+//
+// Handles "connection reserved" error
+// ---------------------------------------------------------
+// TODO: to be handled later.
+//void CMsgErrorWatcherPrivate::HandleConnectionErrorL( TMsvEntry& aEntry, TBool aReceive )
+//    {
+//        QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleConnectionErrorL : Enter");
+//    if ( !iConnectionObserver )
+//        {
+//        QDEBUG_WRITE( "Creating connection observer" );
+//        iConnectionObserver = CMsgErrorConnectionObserver::NewL( *this );
+//        }
+//    if ( iConnectionObserver->ConnectionsOpen() )
+//        {
+//        QDEBUG_WRITE( "Open connections detected" );
+//        if ( aReceive )
+//            {
+//            iMmsReceiveErrorMessages->AppendL( aEntry.Id() );
+//            }
+//        else
+//            {
+//            iMmsSendErrorMessages->AppendL( aEntry.Id() );
+//            }
+//        //No matter if already started
+//        iConnectionObserver->StartL();
+//        }
+//    else
+//        {
+//        QDEBUG_WRITE( "No open connections" );
+//        delete iConnectionObserver;
+//        iConnectionObserver = NULL;
+//        }
+//    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleConnectionErrorL : Exit");
+//    }
+
+// ---------------------------------------------------------
+// CMsgErrorWatcher::HandleDiskSpaceErrorL
+//
+// Handles "no disk space" error
+// ---------------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::HandleDiskSpaceErrorL( TMsvEntry& aEntry )
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleDiskSpaceErrorL : Enter");
+    iMmsReceiveErrorMessages->AppendL( aEntry.Id() );
+
+    iDiskSpaceErrors++;
+    if ( iDiskSpaceErrors == 1 )
+        {
+        if ( !( iWatcherFlags & EStartupReady ) )
+            {
+            return;
+            }
+        QDEBUG_WRITE( "Show note" );
+        q_ptr->ShowNote(EDiskLowNote1);
+        }
+    TUint triggerLevel = Max( KDefaultTriggerLevel, iMaxReceiveSize );
+    //Activate DiskSpace observer
+    if ( !iDiskSpaceObserver )
+        {
+       QDEBUG_WRITE( "Creating disk space observer" );
+        iDiskSpaceObserver = CMsgErrorDiskSpaceObserver::NewL( *this, *iSession, iFs );
+        }
+       QDEBUG_WRITE_FORMAT("Limit set to: ",
+        KCriticalLevel + triggerLevel + KTriggerMargin );
+    iDiskSpaceObserver->SetLimitAndActivateL( KCriticalLevel +
+        triggerLevel +
+        KTriggerMargin );
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleDiskSpaceErrorL : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::HandleMemoryErrorL
+//
+// Handles "no memory" error
+// ---------------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::HandleMemoryErrorL( TMsvEntry& aEntry )
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleMemoryErrorL : Enter");
+    iMmsReceiveErrorMessages->AppendL( aEntry.Id() );
+    if ( !( iWatcherFlags & EStartupReady ) )
+        {
+        return;
+        }
+    q_ptr->ShowNote(EMemoryLowNote);
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleMemoryErrorL : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::HandleRoamingEventL
+//
+// Handles events from roaming observer
+// ---------------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::HandleRoamingEventL( TBool aRoaming )
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleRoamingEventL : Enter");
+    QDEBUG_WRITE_FORMAT("aRoaming : ", aRoaming );
+    if ( !iMmsClient )
+        {
+        // We should never get here if MMS Client MTM is not present
+        // since roaming observer is not started in that case.
+        // This return is here just in case...
+        return;
+        }
+
+    TInt fetchHome = iMmsClient->MmsSettings().ReceivingModeHome();
+    TInt fetchRoam =  iMmsClient->MmsSettings().ReceivingModeForeign();
+    QDEBUG_WRITE_FORMAT("HandleRoamingEventL fetchHome : ", fetchHome );
+    QDEBUG_WRITE_FORMAT("HandleRoamingEventL fetchRoam : ", fetchRoam );
+    
+    TBool fetchAll = EFalse;
+
+    if ( aRoaming )
+        {
+        QDEBUG_WRITE( "we are in roaming." );
+        //We are in roaming network
+        if ( fetchRoam == EMmsReceivingAutomatic &&
+            fetchHome != EMmsReceivingAutomatic )
+            {
+            fetchAll = ETrue;
+            }
+        if ( ( iWatcherFlags & EShowRoamingNote ) &&
+            !( iWatcherFlags & ERoamingNoteShown ) )
+            {
+            //Show roaming note if requested
+            if ( !( iWatcherFlags & EStartupReady ) )
+                   {
+                   return;
+                   }
+            q_ptr->ShowNote(ERoamingNote);
+            iWatcherFlags |= ERoamingNoteShown;
+            }
+        }
+    else
+        {
+        QDEBUG_WRITE( "we are in home network." );
+        //We are in home network
+        if ( fetchHome == EMmsReceivingAutomatic &&
+            fetchRoam != EMmsReceivingAutomatic )
+            {
+            fetchAll = ETrue;
+            }
+        //Reset roaming note flag
+        iWatcherFlags &= ~ERoamingNoteShown;
+        }
+
+    if ( fetchAll && !IsActive() )
+        {
+        QDEBUG_WRITE( "starting fetch all" );
+        iStatus = KRequestPending;
+        iRequestType = EMsgRequestFetchingAll;
+        delete iOperation;
+        iOperation = NULL;
+        iOperation = iMmsClient->FetchAllL( iStatus, EFalse );
+        SetActive();
+        }
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:~CMsgErrorWatcherPrivate : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::HandleCommDbEventL
+//
+// Handles events from CommDB observer
+// ---------------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::HandleCommDbEventL()
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleCommDbEventL : Enter");
+    if ( ValidateMmsServiceL() )
+        {
+        QDEBUG_WRITE( "starting fetch" );
+        StartMmsFetchL();
+        }
+    else
+        {
+        //Wait for another event
+        QDEBUG_WRITE( "restart CommDB observer" );
+        iCommDbObserver->Restart();
+        }
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleCommDbEventL : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::HandleConnectionEvent
+//
+// Handles events from connection observer
+// ---------------------------------------------------------
+// TODO: handel later.
+//void CMsgErrorWatcherPrivate::HandleConnectionEvent()
+//    {
+//    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleConnectionEvent : Enter");
+//    if ( !IsActive() )
+//        {
+//        MEWLOGGER_WRITE( "HandleConnectionEvent, Starting delay timer" );
+//        iStatus = KRequestPending;
+//        iRequestType = EMsgRequestWaitingDisconnection;
+//        iTimer.After( iStatus, KDelayAfterDisconnect );
+//        SetActive();
+//        }
+//   QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleConnectionEvent : Exit");
+//    }
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::HandleDiskSpaceEventL
+//
+// Handles events from disk space observer
+// ---------------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::HandleDiskSpaceEventL()
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleDiskSpaceEventL : Enter");
+    QDEBUG_WRITE( "starting fetch" );
+    StartMmsFetchL();
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleDiskSpaceEventL : Exit");
+    }
+
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::HandleDiskSpaceEvent2L
+//
+// Handles events from disk space observer
+// -------k--------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::HandleDiskSpaceEvent2L()
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleDiskSpaceEvent2L : Enter");
+    // erro note text was coming form avkon.
+    QDEBUG_WRITE( "show note" );
+    q_ptr->ShowNote(ESMSIncomingLowDiskSpace);
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleDiskSpaceEvent2L : Exit");
+    
+    }
+
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::HandleStartupReadyL
+//
+// Handles events from startup state observer (currently 
+// CMsgSentItemsObserver)
+// ---------------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::HandleStartupReadyL()
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleStartupReadyL : Enter");
+    QDEBUG_WRITE( "Startup ready!" );
+    iWatcherFlags |= EStartupReady;
+    CheckMmsReceivingModeL();
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleStartupReadyL : Exit");
+    }
+
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::HandleCenRepNotificationL
+//
+// Handles events from Central Repository observer
+// ---------------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::HandleCenRepNotificationL()
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleCenRepNotificationL : Enter");
+    if ( ValidateMmsServiceL() )
+        {
+        QDEBUG_WRITE( "starting fetch" );
+        StartMmsFetchL();
+        }
+    else
+        {
+        //Wait for another event
+        QDEBUG_WRITE( "restart CenRep observer" );
+        iCenRepObserver->SubscribeNotification();
+        }
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleCenRepNotificationL : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::HandleSessionEventL
+//
+// Handles events from MsgServer observer
+// ---------------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::HandleSessionEventL( TMsvSessionEvent aEvent,
+                                           TAny* aArg1,
+                                           TAny* aArg2,
+                                           TAny* aArg3 )
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleSessionEventL : Enter");
+    if ( ( aEvent == EMsvCloseSession ||
+        aEvent == EMsvServerTerminated ||
+        aEvent == EMsvMediaUnavailable ||
+        aEvent == EMsvMediaChanged ) &&
+        iWatcherFlags & EWatcherRunning )
+        {
+        QDEBUG_WRITE_FORMAT("StopWatcher event: ", aEvent );
+        StopWatcher();
+        //Start retry timer
+        StartRestartTimer();
+        return;
+        }
+    if ( aEvent == EMsvServerReady &&
+        !( iWatcherFlags & EWatcherRunning ) )
+        {
+        TRAPD ( err, StartWatcherL() );
+        if ( err ) //make sure watcher is not left in obscure state
+            {
+            StopWatcher();
+            }
+        return;
+        }
+    if ( aArg1 == 0 || aArg2 == 0 || !( iWatcherFlags & EWatcherRunning ) )
+        {
+        return;
+        }
+    // If for some reason MMS service is not yet found,
+    // we try to find it now...
+    GetMmsServiceL();
+
+    CMsvEntrySelection* entries = static_cast<CMsvEntrySelection*>( aArg1 );
+    TInt count = entries->Count();
+    
+    // Mark the _original_ folder as parent for "entries moved" events (in "aArg3").
+    // For other events the parent is in "aArg2".
+    TMsvId parentId = ( aEvent == EMsvEntriesMoved )
+        ? *( static_cast<TMsvId*>( aArg3 ) )
+        : *( static_cast<TMsvId*>( aArg2 ) );
+    
+    if ( count < 1 )
+        {
+        return;
+        }
+    if ( parentId == KMsvRootIndexEntryIdValue &&
+        iMmsServiceId != KMsvNullIndexEntryId )
+        {
+        // We're not interested in these events if MMS Service is not present.
+        HandleRootEventL( aEvent, entries );
+        }
+    else if ( parentId == KMsvLocalServiceIndexEntryIdValue )
+        {
+        HandleLocalServiceEventL( aEvent, entries );
+        }
+    else if ( parentId == KWatcherOutboxFolderId )
+        {
+        HandleOutboxEventL( aEvent, entries );
+        }
+    else if ( ( iMmsServiceId != KMsvNullIndexEntryId && parentId == iMmsServiceId ) ||
+        ( iNotificationFolderId != KMsvNullIndexEntryId && parentId == iNotificationFolderId ) )
+        {
+        HandleMmsServiceEventL( aEvent, entries );
+        }
+    else
+        {
+        //do nothing
+        }
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleSessionEventL : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::HandleRootEventL
+//
+// Handles root events from MsgServer observer
+// ---------------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::HandleRootEventL( TMsvSessionEvent aEvent,
+                                        CMsvEntrySelection* aEntries )
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleRootEventL : Enter");
+    QDEBUG_WRITE_FORMAT("aEvent : ",aEvent);
+    switch ( aEvent )
+        {
+        case EMsvEntriesChanged:
+            {
+            TInt count = aEntries->Count();
+            TInt i = 0;
+            while ( i < count )
+                {
+                TMsvId dummy;
+                TMsvEntry entry;
+                TInt error = iSession->GetEntry(
+                    aEntries->At( i ), dummy, entry );
+
+                //We're only interested in MMS service
+                if ( !error && 
+                    iMmsServiceId != KMsvNullIndexEntryId &&
+                    entry.Id() == iMmsServiceId )
+                    {
+                    QDEBUG_WRITE( "HandleRootEventL, MMS service changed" );
+                    //Check whether the roaming setting has changed
+                    CheckMmsReceivingModeL();
+
+                    //We're waiting for the the user to change access points
+                    //if iCommDbObserver exists
+                    if ( iCommDbObserver && ValidateMmsServiceL() )
+                        {
+                        QDEBUG_WRITE( "HandleRootEventL, deleting CommDB observer" );
+                        StartMmsFetchL();
+                        }
+                    }
+                i++;
+                }
+            break;
+            }
+        default:
+            break;
+        }
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleRootEventL : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::HandleLocalServiceEventL
+//
+// Handles local service events from MsgServer observer
+// ---------------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::HandleLocalServiceEventL( TMsvSessionEvent aEvent,
+                                                CMsvEntrySelection* aEntries )
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleLocalServiceEventL : Enter");
+    if ( iNotificationFolderId == KMsvNullIndexEntryId &&
+        aEvent == EMsvEntriesCreated )
+        {
+        TInt count = aEntries->Count();
+        TInt i = 0;
+        while ( i < count )
+            {
+            TMsvId dummy;
+            TMsvEntry entry;
+            TInt error = iSession->GetEntry(
+                aEntries->At( i ), dummy, entry );
+            if ( !error &&
+                entry.iDetails.Compare( KMMSNotificationFolder ) == 0 )
+                {
+                iNotificationFolderId = aEntries->At( i );
+               QDEBUG_WRITE_FORMAT("Notification folder created: ", iNotificationFolderId );
+                }
+            i++;
+            }
+        }
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleLocalServiceEventL : Exit");
+    }
+
+
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::HandleOutboxEventL
+//
+// Handles outbox events from MsgServer observer
+// ---------------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::HandleOutboxEventL( TMsvSessionEvent aEvent,
+                                          CMsvEntrySelection* aEntries )
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleOutboxEventL : Enter");
+    TInt count = aEntries->Count();
+    QDEBUG_WRITE_FORMAT("aEvent: ",aEvent);
+    switch (aEvent)
+        {
+        case EMsvEntriesChanged:
+               {
+//               MEWLOGGER_WRITE("HandleOutboxEventL: case: EMsvEntriesChanged start");
+//               TInt i = 0;
+//               MEWLOGGER_WRITEF( _L("EMsvEntriesChanged count: %d"), count );
+//               while ( i < count )
+//                   {
+//                   MEWLOGGER_WRITE( "EMsvEntriesChanged - inside while" );
+//                   TMsvId dummy;
+//                   TMsvEntry entry;
+//                   TInt error = iSession->GetEntry(
+//                       aEntries->At( i ), dummy, entry );
+//                   TUid mtm = entry.iMtm;
+//                   MEWLOGGER_WRITEF( _L("EMsvEntriesChanged - mtm ---  %d"), mtm );
+//                   MEWLOGGER_WRITEF( _L("EMsvEntriesChanged - entry id ---  %d"), iMmsSendErrorMessages->Find( entry.Id() ));
+//                   if ( mtm == KSenduiMtmMmsUid &&
+//                       iMmsSendErrorMessages->Find( entry.Id() ) == KErrNotFound )
+//                       {
+//                       MEWLOGGER_WRITE( "EMsvEntriesChanged - inside if" );
+//                       if ( // the first error is activated again to synchronize
+//                           // with connection manager (MPM) 
+//                           entry.iError == KErrPacketDataTsyMaxPdpContextsReached ||
+//                           entry.iError == KErrUmtsMaxNumOfContextExceededByPhone ||
+//                           entry.iError == KErrUmtsMaxNumOfContextExceededByNetwork ||
+//                           // add the following error to the list to synchronize with 
+//                           // connection manager (MPM)
+//                           entry.iError == KErrGprsInsufficientResources )
+//                           {
+//                           MEWLOGGER_WRITE( "MMS send - connection active" );
+//                           
+//                           //Let's now save the id. This way we can reset the entrys
+//                           //error field just before the fetch start. This prevents
+//                           //duplicate error notes because this case branch is reached many times.
+//                           iCurrentEntryId = entry.Id();
+//                           
+//                           HandleConnectionErrorL( entry, EFalse );
+//                           }
+//                       }
+//                   i++;
+//                   }
+             break;      
+             }
+        case EMsvEntriesMoved: // Messages are moved _from_ this folder.
+        case EMsvEntriesDeleted:
+            {
+            TInt i = 0;
+            while ( i < count )
+                {
+                TInt selectionId = iMmsSendErrorMessages->Find( aEntries->At( i ) );
+                if ( selectionId != KErrNotFound )
+                    {
+                    iMmsSendErrorMessages->Delete( selectionId );
+                    }
+                i++;
+                }
+            }
+            break;
+        default:
+            break;
+        }
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleOutboxEventL : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::HandleMmsServiceEventL
+//
+// Handles MMS service events from MsgServer observer
+// ---------------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::HandleMmsServiceEventL( TMsvSessionEvent aEvent,
+                                              CMsvEntrySelection* aEntries )
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleMmsServiceEventL : Enter");
+    TInt count = aEntries->Count();
+    QDEBUG_WRITE_FORMAT("aEvent: ", aEvent );
+    switch (aEvent)
+        {
+        case EMsvEntriesChanged:
+            {
+            TInt i = 0;
+            while ( i < count )
+                {
+                TMsvId dummy;
+                TMsvEntry entry;
+                TInt error = iSession->GetEntry(
+                    aEntries->At( i ), dummy, entry );
+
+                if ( !error )
+                    {
+                    QDEBUG_WRITE_FORMAT("FetchState: ", entry.SendingState() );
+                    QDEBUG_WRITE_FORMAT("Error: ", entry.iError );
+                    QDEBUG_WRITE_FORMAT("Retries: ", entry.iMtmData3 );
+                    QDEBUG_WRITE_FORMAT("Failed: ", (TInt)entry.Failed() );
+                    QDEBUG_WRITE_FORMAT("ArrayId: ", iMmsReceiveErrorMessages->Find( entry.Id() ) );
+                    }
+                //Check that reception has failed and that the entry is not
+                //already in iMmsReceiveErrorMessages
+                if ( !error &&
+                    iMmsReceiveErrorMessages->Find( entry.Id() ) == KErrNotFound )
+                    {
+                    TInt entryErr = entry.iError;
+                    if ( entryErr == KErrGprsMissingorUnknownAPN )
+                        {
+                        // Map to "invalid ap" error.
+                        entryErr = KMmsErrorAP1Invalid;
+                        }
+                    QDEBUG_WRITE_FORMAT("entryErr: ", entryErr );
+                    switch ( entryErr )
+                        {
+                        case KErrDiskFull:
+                            {
+                            HandleDiskSpaceErrorL( entry );
+                            }
+                            break;
+                        case KErrNoMemory:
+                            {
+                            HandleMemoryErrorL( entry );
+                            }
+                            break;
+                          // TODO: to be handled later.
+                         // the first error is activated again to synchronize
+                         // with connection manager (MPM)
+//                        case KErrPacketDataTsyMaxPdpContextsReached:
+//                        case KErrUmtsMaxNumOfContextExceededByPhone:
+//                        case KErrUmtsMaxNumOfContextExceededByNetwork:
+//                        // add the following error to the list to synchronize with 
+//                        // connection manager (MPM)
+//                        case KErrGprsInsufficientResources:
+//                            {
+//                            //Let's now save the id. This way we can reset the entrys
+//                            //error field just before the fetch start. This prevents
+//                            //duplicate error notes because this case branch is reached many times.
+//                            iCurrentEntryId = entry.Id();
+//                            //Connection already active should be "detected"
+//                            //only after third retry failure if "disconnect
+//                            //delay" feature is activated.
+//                            TInt retries = ( iWatcherFlags & EReceivingDisconnectDelay )
+//                                ? KConnectionRetries
+//                                : 0;
+//                            if ( ( entry.iMtmData3 & KMmsRetryCountMask ) >= retries ) //lint !e574
+//                                {
+//                                MEWLOGGER_WRITE( "MMS fetch - connection active" );
+//                                
+//                                
+//                                HandleConnectionErrorL( entry, ETrue );
+//                                }
+//                            }
+//
+//                            break;
+
+                        case KMmsErrorNoWAPAccessPoint:
+                            {
+                            HandleNoAPErrorL( entry );
+                            }
+                            break;
+                        case KMmsErrorAP1Invalid:
+                        case KMmsErrorNoURI1:
+                            {
+                            HandleInvalidAPErrorL( entry, ETrue );
+                            }
+                            break;
+                        case KErrIfAuthenticationFailure: //username/passwd
+                            {
+                            HandleInvalidAPErrorL( entry, EFalse );
+                            }
+                            break;
+                        default:
+                            //nothing to do
+                            break;
+                        }
+                    }
+                i++;
+                }
+            }
+            break;
+        case EMsvEntriesMoved: // Messages are moved _from_ this "folder".
+        case EMsvEntriesDeleted:
+            {
+            TInt i = 0;
+            TInt originalCount = iMmsReceiveErrorMessages->Count();
+            while ( i < count )
+                {
+                TInt selectionId = iMmsReceiveErrorMessages->Find( aEntries->At( i ) );
+                if ( selectionId != KErrNotFound )
+                    {
+                    iMmsReceiveErrorMessages->Delete( selectionId );
+                    }
+                i++;
+                }
+            if ( originalCount && !iMmsReceiveErrorMessages->Count() )
+                {
+                // array was emptied
+                ResetWatcher();
+                }
+            }
+            break;
+        default:
+            break;
+        }
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:HandleMmsServiceEventL : Enter");
+    }
+
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::ResetErrorFieldL
+//
+// Reset TMsvEntry::iError of the current notification
+// ---------------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::ResetErrorFieldL( )
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:ResetErrorFieldL : Enter");
+    //Makes sure the entry is set
+    if( iCurrentEntryId != KMsvNullIndexEntryId )
+        {
+        CMsvEntry *cEntry( NULL );
+        TRAPD( err, cEntry = iSession->GetEntryL( iCurrentEntryId ) );
+        if ( err == KErrNotFound )
+        	{
+        	iCurrentEntryId = KMsvNullIndexEntryId;
+        	return;
+        	}
+        CleanupStack::PushL( cEntry );
+        TMsvEntry tEntry = cEntry->Entry();
+        tEntry.iError = KErrNone;
+        cEntry -> ChangeL( tEntry );
+        CleanupStack::PopAndDestroy( cEntry );
+        //This prevents getting here to often
+        iCurrentEntryId = KMsvNullIndexEntryId;
+        } 
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:ResetErrorFieldL : Exit");
+    }
+    
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::ResetErrorFieldL
+//
+// Reset TMsvEntry::iError 
+// ---------------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::ResetErrorFieldL( TMsvEntry& aEntry )
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:ResetErrorFieldL() : Enter");
+    CMsvEntry *cEntry = iSession->GetEntryL( aEntry.Id() );  
+    CleanupStack::PushL( cEntry );
+    aEntry.iError = KErrNone;
+    cEntry -> ChangeL( aEntry );
+    CleanupStack::PopAndDestroy( cEntry ); 
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:ResetErrorFieldL() : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::DoCancel
+//
+// From active object framework
+// ---------------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::DoCancel()
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:DoCancel : Enter");
+    iTimer.Cancel();
+    if ( iOperation )
+        {
+        iOperation->Cancel();
+        }
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:DoCancel : Exit");
+    }
+
+// ---------------------------------------------------------
+// CMsgErrorWatcherPrivate::RunL
+//
+// From active object framework
+// ---------------------------------------------------------
+//
+void CMsgErrorWatcherPrivate::RunL()
+    {
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:RunL : Enter");
+    QDEBUG_WRITE_FORMAT("RunL, iStatus: ", iStatus.Int() );
+    QDEBUG_WRITE_FORMAT("RunL, iRequestType: ", iRequestType );
+    QDEBUG_WRITE_FORMAT("RunL, EMsgRequestSending - iMmsReceiveErrorMessages: ", iMmsReceiveErrorMessages->Count() );
+    
+    switch ( iRequestType )
+        {
+        case EMsgRequestStartingUp:
+            {
+            if ( !( iWatcherFlags & EWatcherRunning ) )
+                {
+                TRAPD ( err, StartWatcherL() );
+                if ( err ) //make sure watcher is not left in obscure state
+                    {
+                    QDEBUG_WRITE_FORMAT("Leave from StartWatcherL: %d", err );
+                    StopWatcher();
+                    if ( iTimerRetries < KMaxTimerRetries )
+                        {
+                        StartRestartTimer();
+                        }
+                    //else give up
+                    }
+                }
+            }
+            break;
+        case EMsgRequestSending:
+            {
+            if ( iMmsReceiveErrorMessages->Count() )
+                {
+                StartMmsFetchL();
+                }
+            else
+                {
+//                delete iConnectionObserver;
+//                iConnectionObserver = NULL;
+                ResetErrorFieldL();
+                }
+            break;
+            }
+        case EMsgRequestFetching:
+            {
+            ResetErrorFieldL();
+            ResetWatcher();
+            break;
+            }
+//       TODO: to be handled later.
+//        case EMsgRequestWaitingDisconnection:
+//            {
+//            MEWLOGGER_WRITE( "RunL, Disconnect delay passed" );
+//            MEWLOGGER_WRITEF( _L("RunL, EMsgRequestWaitingDisconnection - iMmsReceiveErrorMessages: %d"),  iMmsSendErrorMessages->Count() );
+//            if ( iMmsSendErrorMessages->Count() )
+//                {
+//                StartMmsSendL();
+//                }
+//            else
+//                {
+//                StartMmsFetchL();
+//                }
+//            //ResetErrorFieldL();     
+//            }
+//            break;
+        case EMsgRequestFetchingAll:
+        default:
+            break;
+        }
+    QDEBUG_WRITE("CMsgErrorWatcherPrivate:RunL : Exit");
+    }
+
+
+//  End of File  
+
--- a/messagingapp/msgnotifications/msgindicatorplugin/inc/msgindicator.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgnotifications/msgindicatorplugin/inc/msgindicator.h	Fri Sep 17 08:28:39 2010 +0300
@@ -24,6 +24,7 @@
 
 #include "msginfodefs.h"
 class MsgIndicatorPrivate;
+class QTranslator;
 
 class ServiceRequestSenderTask : public QRunnable
 {
@@ -137,6 +138,18 @@
     MsgIndicatorPrivate* d_ptr;
    
     /**
+     * Translator member variable
+     * Owned
+     */     
+    QTranslator* mTranslator;
+    
+    /**
+     * Translator member variable
+     * Owned
+     */     
+    QTranslator* mTranslator_comm;
+   
+    /**
      * Primary Text
      * 
      */
--- a/messagingapp/msgnotifications/msgindicatorplugin/msgindicatorplugin.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgnotifications/msgindicatorplugin/msgindicatorplugin.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -34,7 +34,8 @@
 SOURCES += src/msgindicatorplugin.cpp \
 		   src/msgindicator.cpp \
 		   src/msgindicator_p.cpp
-		   
+
+TRANSLATIONS = messaging.ts		   
 
 symbian {
     TARGET.EPOCALLOWDLLDATA=1
--- a/messagingapp/msgnotifications/msgindicatorplugin/src/msgindicator.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgnotifications/msgindicatorplugin/src/msgindicator.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -30,19 +30,20 @@
 #include <xqappmgr.h>
 #include <ccsdefs.h>
 
-
+#include <QTranslator>
+#include <QLocale>
+#include <hbapplication.h>
 //Localized Constants
 #define LOC_UNREAD_MESSAGES hbTrId("txt_messaging_list_ln")
 #define LOC_NEW_MESSAGES hbTrId("txt_common_opt_ln_new_messages")
-#define LOC_RECEIVED_FILES hbTrId("Received files")
-#define LOC_UNREAD_SINGLE_MESSAGE hbTrId("Unread Message")
-#define LOC_UNREAD_MULTIPLE_MESSAGES hbTrId("Unread Messages")
-#define LOC_FAILED_SINGLE_MESSAGE hbTrId("Failed Message")
-#define LOC_FAILED_MULTIPLE_MESSAGES hbTrId("Failed Messages")
-#define LOC_OUTGOING_SINGLE_MESSAGE hbTrId("Outgoing Message")
-#define LOC_OUTGOING_MULTIPLE_MESSAGES hbTrId("Outgoing Messages")
+#define LOC_RECEIVED_FILES hbTrId("txt_messaging_title_received_files")
+#define LOC_UNREAD_MULTIPLE_MESSAGES hbTrId("txt_messaging_list_ln_new_messages") // for unread messages
+#define LOC_FAILED_SINGLE_MESSAGE hbTrId("txt_messaging_list_failed_message")
+#define LOC_FAILED_MULTIPLE_MESSAGES hbTrId("txt_messaging_dpophead_ln_failed_messages")
+#define LOC_OUTGOING_SINGLE_MESSAGE hbTrId("txt_messaging_indimenu_list_outgoing_message")
+#define LOC_OUTGOING_MULTIPLE_MESSAGES hbTrId("txt_messaging_dpophead_ln_outgoing_messages")  
 #define STATUS_MONO_NEW_MESSAGE QString("qtg_status_new_message")
-#define LOC_BUSINESSCARD hbTrId("Business card")
+#define LOC_BUSINESSCARD hbTrId("txt_messaging_menu_business_card")
 #define LOC_MULTIMEDIA_MSG hbTrId("txt_messaging_list_indimenu_multimedia_message")
 /**
  * The number of indicators.
@@ -122,6 +123,16 @@
         InteractionActivated),
 		mIndicatorType(NULL)
 {
+    QString locale = QLocale::system().name();
+    QString path = "z:/resource/qt/translations/";
+        
+    mTranslator = new QTranslator();
+    mTranslator_comm = new QTranslator();
+    mTranslator->load(path + QString("messaging_") + locale);
+    mTranslator_comm->load(path + QString("common_") + locale);
+    qApp->installTranslator(mTranslator);
+    qApp->installTranslator(mTranslator_comm);
+    
     d_ptr = q_check_ptr(new MsgIndicatorPrivate(this));
 }
 
@@ -132,6 +143,8 @@
 MsgIndicator::~MsgIndicator()
 {
     delete d_ptr;
+    delete mTranslator;
+    delete mTranslator_comm;
 }
 
 // ----------------------------------------------------------------------------
--- a/messagingapp/msgnotifications/msgnotifications.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgnotifications/msgnotifications.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -19,6 +19,7 @@
 SYMBIAN_PLATFORMS = WINSCW ARMV5
 SUBDIRS += msgnotificationdialogplugin/msgnotificationdialogplugin.pro
 SUBDIRS += msgindicatorplugin/msgindicatorplugin.pro
+SUBDIRS += msgerrorwatcher/msgerrorwatcher.pro
 SUBDIRS += msgnotifier/msgnotifier.pro
 SUBDIRS += msgerrornotifier/msgerrornotifier.pro
 SUBDIRS += flashmsgnotifier/flashmsgnotifier.pro
--- a/messagingapp/msgnotifications/msgnotifier/inc/msgnotifier.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgnotifications/msgnotifier/inc/msgnotifier.h	Fri Sep 17 08:28:39 2010 +0300
@@ -28,6 +28,7 @@
 // CLASS DECLARATION
 class MsgNotifierPrivate;
 class MsgSimNumDetector;
+class MsgErrorWatcher;
 
 /**
  * Stores the data required for notification.
@@ -137,6 +138,12 @@
      * Sim settings handler
      */
     MsgSimNumDetector* mSimHandler;
+    
+    /**
+     * Pointer to error watcher
+     * Own
+     */
+   MsgErrorWatcher* mErrorWatcher;
 };
 
 #endif // MSGNOTIFIER_H
--- a/messagingapp/msgnotifications/msgnotifier/inc/msgnotifier_p.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgnotifications/msgnotifier/inc/msgnotifier_p.h	Fri Sep 17 08:28:39 2010 +0300
@@ -29,6 +29,7 @@
 class XQSettingsManager;
 class XQPublishAndSubscribeUtils;
 class XQSystemToneService;
+class CHWRMVibra;
 
 /**
  * Structure to hold the details of a class 0 SMS
@@ -198,6 +199,11 @@
      * Object to handle audio alert when new message is received
      */
     XQSystemToneService* mSts;
+    
+    /**
+     * Vibra alert on receiving a new message
+     */
+    CHWRMVibra *mVibra; // Owned.
     };
 
 
--- a/messagingapp/msgnotifications/msgnotifier/msgnotifier.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgnotifications/msgnotifier/msgnotifier.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -22,6 +22,7 @@
 HEADERS += $$PUBLIC_HEADERS
 INCLUDEPATH += . inc ../../../inc 
 INCLUDEPATH += ../../msgsettings/msginit/inc
+INCLUDEPATH += ../msgerrorwatcher/inc
 INCLUDEPATH += ../inc
 INCLUDEPATH += $$APP_LAYER_INCLUDEPATH
 INCLUDEPATH += $$MW_LAYER_INCLUDEPATH
@@ -66,12 +67,14 @@
         -lQtContacts \
         -lQtVersit \
         -lunidatamodelloader \
-	-lxqsettingsmanager \
+	    -lxqsettingsmanager \
         -apgrfx.lib \
         -lxqutils \
         -lws32 \
         -lapgrfx \
-	-lxqsystemtoneservice \
-	-lgsmu \
-	-lssmcmn
+	    -lxqsystemtoneservice \
+        -lmsgerrorwatcher \
+	    -lgsmu \
+	    -lssmcmn \
+	    -lhwrmvibraclient
         
--- a/messagingapp/msgnotifications/msgnotifier/src/msgnotifier.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgnotifications/msgnotifier/src/msgnotifier.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -31,6 +31,7 @@
 #include "unidatamodelloader.h"
 #include "unidatamodelplugininterface.h"
 #include "msgcontacthandler.h"
+#include "msgerrorwatcher.h"
 
 #include "debugtraces.h"
 
@@ -58,6 +59,7 @@
     d_ptr = q_check_ptr(new MsgNotifierPrivate(this));
 
     mSimHandler = new MsgSimNumDetector();
+    mErrorWatcher = new MsgErrorWatcher(this);
 
     QDEBUG_WRITE("MsgNotifier::MsgNotifier : Exit")
 }
@@ -72,6 +74,7 @@
 
     delete d_ptr;
     delete mSimHandler;
+	delete mErrorWatcher;
 
     QDEBUG_WRITE("MsgNotifier::~MsgNotifier : Enter")
 }
--- a/messagingapp/msgnotifications/msgnotifier/src/msgnotifier_p.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgnotifications/msgnotifier/src/msgnotifier_p.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -32,6 +32,8 @@
 #include <xqsystemtoneservice.h>
 #include <xqconversions.h>
 #include <QThreadPool>
+#include <ProfileEngineInternalCRKeys.h>
+#include <hwrmvibra.h>
 
 //USER INCLUDES
 #include "msgnotifier.h"
@@ -41,6 +43,8 @@
 #include "conversationidpsconsts.h"
 #include "debugtraces.h"
 
+const XQCentralRepositorySettingsKey silenceModeKey(KCRUidProfileEngine.iUid, KProEngSilenceMode);
+
 // ----------------------------------------------------------------------------
 // MsgNotifierPrivate::MsgNotifierPrivate
 // @see MsgNotifierPrivate.h
@@ -89,6 +93,11 @@
         mSts = NULL;
         }
     
+    if(mVibra)
+        {
+        delete mVibra;
+        mVibra = NULL;
+        }
     QDEBUG_WRITE("MsgNotifierPrivate::~MsgNotifierPrivate : Exit")
 }
 
@@ -127,6 +136,8 @@
     
     QT_TRYCATCH_LEAVING(mSts = new XQSystemToneService());
     
+    mVibra = CHWRMVibra::NewL();
+    
     QDEBUG_WRITE("MsgNotifierPrivate::initL : Exit")
 }
 
@@ -228,8 +239,19 @@
             notifData.mDescription = XQConversions::s60DescToQString(*descrp);
             }
         
-        //Play new message alert tone.
-        mSts->playTone(XQSystemToneService::SmsAlertTone);
+        QVariant silenceMode = mSettingsManager->readItemValue(silenceModeKey, XQSettingsManager::TypeInt);
+        int silent = silenceMode.toInt();
+        if(silent < 1)
+            {
+            //Play new message alert tone.
+            mSts->playTone(XQSystemToneService::SmsAlertTone);
+            }
+        // Execute the vibra effect.
+        if (mVibra) 
+            {
+            TInt err = KErrNone;
+            TRAP(err,mVibra->StartVibraL(1000));
+            }
         
         // check whether opened cv id and received 
         // cv id are same and show notification
--- a/messagingapp/msgnotifications/msgnotifier/tsrc/tsrc.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgnotifications/msgnotifier/tsrc/tsrc.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -19,7 +19,7 @@
 CONFIG += symbian_test
 
 #Sub .pro files
-SUBDIRS += unittest_mmsplugin/unittest_mmsplugin.pro
+SUBDIRS += unittest_mmsplugin
 
 # Platforms
 SYMBIAN_PLATFORMS = DEFAULT
\ No newline at end of file
--- a/messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/mmstestbed/mmstestbed.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/mmstestbed/mmstestbed.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -14,7 +14,7 @@
 # Description:
 #
 
-QT += testlib
+#QT += testlib
 QT -= gui
 
 TEMPLATE = lib
@@ -67,7 +67,7 @@
 
 
 symbian {
-	TARGET.UID3 =  0xE5c588a1
+    TARGET.UID3 =  0xE5c588a1
     TARGET.CAPABILITY = CAP_GENERAL_DLL
     TARGET.EPOCSTACKSIZE = 0x8000
     TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000
Binary file messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsgplugin/data/SmileyFace.gif has changed
--- a/messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsgplugin/data/testmmsplugin.cfg	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-TestMmsPlugin
--- a/messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsgplugin/data/testmmsplugin.pl	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,182 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:
-#
-#!/usr/bin/perl -w
-use warnings;
-use strict;
-
-my $TOTALCASES 		= 0;
-my $TOTALPASSED 	= 0;
-my $TOTALRUN 			= 0;
-my $TOTALFAILED 	= 0;
-my $TOTALSKIPPED 	= 0;
-
-sub parse_line
-{
-	my $line = $_[0];
-	my @parts = split (" ", $line);
-	my $passed  = $parts[1];
-	my $failed  = $parts[3];
-	my $skipped = $parts[5];
-	
-	my $total = $passed + $failed + $skipped;
-	my $passrate = $passed * 100 / $total;
-	my $passrateround = sprintf("%.0f",$passrate);
-	my $runrate = ($total - $skipped)*100/$total;
-	my $runrateround = sprintf("%.0f",$runrate);
-	
-	$TOTALCASES += $total;
-	$TOTALPASSED += $passed;
-	$TOTALRUN += ($total - $skipped);
-	$TOTALFAILED += $failed;
-	$TOTALSKIPPED  += $skipped;
-	
-	printf MYFILE "<td>\n";
-	printf MYFILE "$passed\n";
-	printf MYFILE "</td>\n";
-	
-	if($failed > 0)
-	{
-	printf MYFILE "<td style=\"font-weight:bold;color:red\">\n";
-	printf MYFILE "$failed\n";
-	printf MYFILE "</td>\n";
-	}
-	else
-	{
-	printf MYFILE "<td>\n";
-	printf MYFILE "$failed\n";
-	printf MYFILE "</td>\n";	
-	}
-
-	printf MYFILE "<td>\n";
-	printf MYFILE "$skipped\n";
-	printf MYFILE "</td>\n";
-
-	printf MYFILE "<td>\n";
-	printf MYFILE "$total\n";
-	printf MYFILE "</td>\n";
-	 
-	printf MYFILE "<td>\n";
-	printf MYFILE ("$passrateround %%\n");
-	printf MYFILE "</td>\n";
-
-	printf MYFILE "<td>\n";
-	printf MYFILE "$runrateround %%\n";
-	printf MYFILE "</td>\n";
-	
-	
-}
-
-sub parse_file
-	{
-		my $pattern = "Totals";
-		my $file = $_[0];
-		open (FILE,$file);
-	
-		while (my $line= <FILE>)
-		{
-			chomp ($line);
-		if ($line =~ m/$pattern/)
-			{				
-			parse_line $line;
-			}
-		}
-		close(FILE);
-	}
-
-
-sub generate_report
-	{
-		open (MYFILE, '>/epoc32/winscw/c/logs/messagingtestsuite/report.html');
-		printf MYFILE "<html>\n"; 
-		printf MYFILE "<body>\n";
-		printf MYFILE "<head>\n"; 
-		printf MYFILE "<title>MsgApp Test Suite Reports</title>"; 
-		printf MYFILE "</head>\n";
-		printf MYFILE "<h2 align = center>Messaging101 Test Suite Report</h2>\n";
-		printf MYFILE "<table border = 2 cellpadding = 10 align = center>\n";
-		printf MYFILE "<tr style = \" background-color:lavender \">\n";
-		printf MYFILE "<th>Module</th>\n";
-		printf MYFILE "<th style = color:green>Passed</th>\n";
-		printf MYFILE "<th style = color:red>Failed</th>\n";
-		printf MYFILE "<th style = color:chocolate>Skipped</th>\n";
-		printf MYFILE "<th>Total Cases</th>\n";
-		printf MYFILE "<th>Pass Rate</th>\n";
-		printf MYFILE "<th>Run Rate</th>\n";
-		printf MYFILE "</tr>\n";
-		
-		
-		my @files = </epoc32/winscw/c/logs/messagingtestsuite/*.txt>;
-		foreach my $file (@files) 
-		{	
-			my @splitedpath = split("/",$file);
-			my $filename = $splitedpath[-1];	
-			my $length = length($filename);
-		  my $name = substr($filename,11,$length-15);
-		  printf MYFILE "<tr>\n";
-		  printf MYFILE "<td>\n";
-		  printf MYFILE "<a HREF=$filename style = text-decoration:none><b>$name</b></a>\n";
-		  printf MYFILE "</td>\n";
-		  
-		  parse_file $file;
-		  
-		  printf MYFILE "</tr>\n";
-		}
-		
-		printf MYFILE "<tr style= \"font-weight:bold; color:white; background-color:gray\">\n";
-		printf MYFILE "<td>\n";
-		printf MYFILE "<b>Overall</b>\n";
-		printf MYFILE "</td>\n";
-		
-		
-		printf MYFILE "<td>\n";
-		printf MYFILE "$TOTALPASSED\n";
-		printf MYFILE "</td>\n";
-		
-		printf MYFILE "<td>\n";
-		printf MYFILE "$TOTALFAILED\n";
-		printf MYFILE "</td>\n";
-		
-		printf MYFILE "<td>\n";
-		printf MYFILE "$TOTALSKIPPED\n";
-		printf MYFILE "</td>\n";
-		
-		printf MYFILE "<td>\n";
-		printf MYFILE "$TOTALCASES\n";
-		printf MYFILE "</td>\n";
-		
-		my $passrate = $TOTALPASSED*100/$TOTALCASES;
-		my $passrateround = sprintf("%.0f",$passrate);
-		printf MYFILE "<td>\n";
-		printf MYFILE "$passrateround%%\n";
-		printf MYFILE "</td>\n";
-		
-		my $runrate = ($TOTALCASES - $TOTALSKIPPED)*100/$TOTALCASES;
-		my $runrateround = sprintf("%.0f",$runrate);
-		printf MYFILE "<td>\n";
-		printf MYFILE "$runrateround%%\n";
-		printf MYFILE "</td>\n";
-		
-		printf MYFILE "</tr>\n";
-		
-		printf MYFILE "</table>\n";
-	  printf MYFILE "</body>\n"; 
-		printf MYFILE "</html>\n";
-			
-		close (MYFILE);
-	}
-
-
-generate_report;
\ No newline at end of file
--- a/messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsgplugin/inc/testmmsplugin.h	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- * 
- * Description: - Main test class for Msgnotification -indicator plugin, 
- *                                                   -notification dialog plugin
- */
-
-#ifndef TEST_MMS_PLUGIN_H
-#define TEST_MMS_PLUGIN_H
-
-#ifdef BUILD_TEST_DLL
-#define TEST_EXPORT Q_DECL_EXPORT
-#else
-#define TEST_EXPORT Q_DECL_IMPORT
-#endif
-
-#include <QObject>
-#include <e32const.h>
-
-class UniEditorMmsPlugin;
-class ConvergedMessage;
-class MmsTestBed;
-class QSignalSpy;
-
-class TEST_EXPORT TestMmsPlugin: public QObject
-    {
-    Q_OBJECT
-
-private slots:
-     
-    /**
-        * Called by framework,its called before the 1st test function is executed.
-     */  
-   
-    void initTestCase();
-
-    /**
-        * Called by framework,its called before each test function is executed.
-     */  
-
-    void init();
-
-    /**
-        * Test Sending MMS
-     */  
-
-    void testSendMMS(); 
-
-    /**
-        * Test receiving MMS
-     */  
-
-    void testMmsReceived();
-
-    /**
-        * Called by framework,its called after each test function is executed.
-     */  
-
-    void cleanup();
-
-    /**
-        * Called by framework,its called after the last test function is executed.
-     */  
-
-    void cleanupTestCase();
-
-private:
-
-    QSignalSpy *spy_draft;
-    QSignalSpy *spy_outbox;
-    QSignalSpy *spy_sent;
-
-    UniEditorMmsPlugin* msgPlugin;
-    int mmsId;
-    MmsTestBed* mmstestbed;
-   
-    };
-#endif //TEST_MMS_PLUGIN_H
--- a/messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsgplugin/inc/testmmsplugin.ini	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-//this file is used to provide predefined set of input data.
-
-const char TEST_MSG_RECIEPIENT[]         = "+919000";
-const char TEST_MSG_FROM2[]              = "999";
-const char TEST_MSG_SUBJECT[]            = "Message Subject";
-const char TEST_SERVICE_NAME_MMS[] 	 = "messaging.mserver.testservice.MMS";
-const char TEST_SENDER[]		 = "+918888";
-const char TEST_ATTACHMENT[]		 = "c:\\sample.txt";
-const char TEST_ATTACHMENT4[]		 = "c:\\SmileyFace.gif";
-const char TEST_ATTACHMENT5[]		 = "c:\\sample.txt";
-const char TEST_CC[]			 = "DummyCCAddress";
-const char TEST_BCC[]			 = "DummyBCCAddress";
\ No newline at end of file
--- a/messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsgplugin/src/testmmsplugin.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,229 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- * 
- * Description: - Main test class for Msgnotification -indicator plugin, 
- *                                                   -notification dialog plugin
- */
-
-#include "testmmsplugin.h"
-#include <QtTest/QtTest>
-#include "debugtraces.h"
-#include <QTimer>
-#include <QSignalSpy>
-#include "convergedmessage.h"
-#include "convergedmessageid.h"
-#include "unieditormmsplugin.h"
-#include "mmstestbed.h"
-#include "testmmsplugin.ini"
-#include <QSignalSpy>
-
-
-
-//factory method to create objects.
-QObject* getObject(QString className)
-{
-    if(className == "TestMmsPlugin" )
-    {
-        return new TestMmsPlugin;
-    }
- 	else
-	{
-		return 0;
-	}
-}
-
-//main entry point
-int main(int argc, char *argv[])
-    { 
-    int ret = -1;
-	QCoreApplication app(argc, argv);
-	
-	//the configuration file.
-	QFile data("c:/testmmsplugin.cfg");
-    if (data.open(QFile::ReadOnly)) 
-        {
-		QTextStream in(&data);
-		while(!in.atEnd())
-			{
-			QString name = in.readLine();
-			QObject* tc = getObject(name);
-			
-			if(tc)
-				{
-				ret =  QTest::qExec(tc, argc, argv);
-				delete tc;
-				}
-			}
-        }
-	return ret;
-
-    }
-
-
-
-
-
-
-//---------------------------------------------------------------
-// TestMmsPlugin::initTestCase
-//---------------------------------------------------------------
-
-void TestMmsPlugin::initTestCase()
-{
-    qRegisterMetaType<long int> ("long int"); 
-    msgPlugin = new UniEditorMmsPlugin();
-    QVERIFY(msgPlugin != 0);
-    mmsId = -1;
-    mmstestbed = new MmsTestBed;
-	QVERIFY(mmstestbed != 0);
-	if(!mmstestbed)
-	{
-		QSKIP("Mmstestbed creation failed", SkipAll); 
-	}
-
-    spy_draft  = new QSignalSpy(mmstestbed,SIGNAL(entryCreatedInDraft(long int)));
-    spy_outbox = new QSignalSpy(mmstestbed,SIGNAL(entryMovedToOutbox(long int)));
-    spy_sent   = new QSignalSpy(mmstestbed,SIGNAL(entryMovedToSent(long int)));
-
-}
-
-//---------------------------------------------------------------
-// TestMmsPlugin::init
-//---------------------------------------------------------------
-
-void TestMmsPlugin::init()
-{
-}
-
-//---------------------------------------------------------------
-// TestMmsPlugin::testSendMMS
-//---------------------------------------------------------------
-
-void TestMmsPlugin::testSendMMS()
-{
-   
-    qRegisterMetaType<long int> ("long int");
-    QString service = TEST_SERVICE_NAME_MMS;
-	
-	QString subject  = TEST_MSG_SUBJECT;
-	qint64 timeStamp = QDateTime::currentDateTime().toTime_t();
-	
-	QString sender(TEST_SENDER);
-	ConvergedMessageAddress address(sender);
-	ConvergedMessageAttachmentList attachmentList;    
-
-	QString attachment2Path = TEST_ATTACHMENT4;
-	ConvergedMessageAttachment* attachment2 = 
-			new ConvergedMessageAttachment(attachment2Path, ConvergedMessageAttachment::EAttachment);
-	
-	QString attachmentPath = TEST_ATTACHMENT5;
-	ConvergedMessageAttachment* attachment = 
-		new ConvergedMessageAttachment(attachmentPath, ConvergedMessageAttachment::EAttachment);
-		
-	attachmentList.append(attachment);
-	attachmentList.append(attachment2);
-	ConvergedMessage msg;
-	msg.setMessageType(ConvergedMessage::Mms);
-	msg.setSubject(subject);
-	msg.setTimeStamp(timeStamp);
-	msg.addToRecipient(address);
-	msg.addAttachments(attachmentList);
-	msg.setPriority(ConvergedMessage::Normal);
-	//Adding alias
-	ConvergedMessageAddress address1;
-	address1.setAlias(QString(TEST_MSG_RECIEPIENT));
-	msg.addToRecipient(address1);
-	
-	//Adding CC Address
-	QString ccAddress(TEST_CC);
-	ConvergedMessageAddress ccAdd(ccAddress);
-	msg.addCcRecipient(ccAdd);
-	
-	//Adding BCC Address
-	QString bccAddress(TEST_BCC);
-	ConvergedMessageAddress bccAdd(bccAddress);
-	msg.addBccRecipient(bccAdd);
-	
-	mmstestbed->cleanAll();
-	mmstestbed->setConnectionLocal(true);
-	long int id = msgPlugin->convertTo(&msg);
-	
-	QVERIFY(id != 0);
-	msgPlugin->send(id);
-	QTest::qWait(5000); 
-	long int idRec;
-	
-	if( 1 == spy_draft->count())
-		{
-		void * temp = const_cast<void*>(spy_draft->at(0).at(0).data());
-		idRec = *reinterpret_cast< long int(*)>(temp);
-		QDEBUG_WRITE("passed: spy_draft.count");
-		}
-	else
-		{
-		QFAIL("testSendReceiveMMS: Failed to create message in Draft");
-		mmstestbed->setConnectionLocal(false);
-		return;
-		}
-	if( 1 == spy_outbox->count())
-		{
-		mmstestbed->fromOutboxToMmsc();
-		QDEBUG_WRITE("passed: spy_outbox.count");
-		}
-	else
-		{
-		QFAIL("testSendReceiveMMS: Failed to move message to Outbox");
-		mmstestbed->setConnectionLocal(false);
-		return;
-		}
-
-	if( 1 == spy_sent->count())
-		{
-		void * temp = const_cast<void*>(spy_sent->at(0).at(0).data());
-		long int sentmsgid = *reinterpret_cast< long int(*)>(temp);
-		QCOMPARE(sentmsgid, idRec);
-		mmstestbed->fromMmscToInbox();
-		QDEBUG_WRITE("passed: spy_sent.count");
-		}
-	else
-		{
-		QFAIL("testSendReceiveMMS: Failed to move message to Sent folder");
-		mmstestbed->setConnectionLocal(false);
-		return;
-		}
-}
-
-//---------------------------------------------------------------
-// TestMmsPlugin::testMmsReceived
-//---------------------------------------------------------------
-void TestMmsPlugin::testMmsReceived()
-{
-        QTest::qWait(5000);
-}
-
-//---------------------------------------------------------------
-// TestMmsPlugin::cleanup
-//---------------------------------------------------------------
-void TestMmsPlugin::cleanup()
-{
-}
-
-//---------------------------------------------------------------
-// TestMmsPlugin::cleanupTestCase
-//---------------------------------------------------------------
-void TestMmsPlugin::cleanupTestCase()
-{
-    delete msgPlugin;
-    delete mmstestbed;
-}
-
--- a/messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsgplugin/testmmsplugin.pro	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,177 +0,0 @@
-
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:
-#
-
-QT += testlib
-QT -= gui
-
-CONFIG += hb
-CONFIG += symbian_test
-
-TEMPLATE = app
-TARGET = testmmsplugin
-
-INCLUDEPATH += inc
-INCLUDEPATH += ../../inc
-INCLUDEPATH += ../../../../../../../../inc
-INCLUDEPATH += ../../../../../../inc
-INCLUDEPATH += ../../../../../msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/inc
-INCLUDEPATH += ../../../../../msgutils/unidatautils/unidatamodel/inc
-INCLUDEPATH += ../../../../../msgutils/unieditorutils/editorgenutils/inc
-INCLUDEPATH += ../../../../../../../../mmsengine/mmsmessage/inc 
-INCLUDEPATH += ../../../../../../../../mmsengine/inc
-INCLUDEPATH += ../mmstestbed/inc
-INCLUDEPATH +=
-INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-
-DEFINES += BUILD_TEST_DLL
-
-SOURCES += \
-  src/testmmsplugin.cpp \
-  ../../../../../msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/src/unieditormmsplugin.cpp \
-  ../../../../../msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/src/unieditormmsplugin_p.cpp  
-      
-
-# Input
-HEADERS += \
-  inc/testmmsplugin.h \
-  ../../../../../msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/inc/unieditormmsplugin.h \
-  ../../../../../msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/inc/unieditormmsplugin_p.h 
-               
-   
-SYMBIAN_PLATFORMS = WINSCW ARMV5
-
-symbian {
-    TARGET.UID3 =  0xE7232a7c
-    TARGET.CAPABILITY = CAP_GENERAL_DLL
-    TARGET.EPOCSTACKSIZE = 0x8000
-    TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000
-    TARGET.EPOCALLOWDLLDATA = 1
-    VENDORID =  VID_DEFAULT
-    BLD_INF_RULES.prj_exports += "data/testmmsplugin.cfg c:/testmmsplugin.cfg"
-    BLD_INF_RULES.prj_exports += "data/testmmsplugin.pl  c:/testmmsplugin.pl"
-    BLD_INF_RULES.prj_exports += "data/SmileyFace.gif    c:/SmileyFace.gif"
-    BLD_INF_RULES.prj_exports += "data/sample.txt        c:/sample.txt"
-
-	}
-
- LIBS += -leuser \
-    -lcsserverclientapi \ 
-    -lcsutils \
-    -lconvergedmessageutils \
-    -lMsgMedia \
-    -leikctl \
-    -leditorgenutils \
-    -lcone \
-    -leikcoctl \
-    -leikcore \
-    -leikdlg \
-    -lmsgs \
-    -letext \
-    -lmmsserversettings \
-    -lgsmu \
-    -lmmsgenutils \
-    -lefsrv \
-    -lestor \
-    -lsmcm \
-    -lCommonEngine \
-    -lbafl \
-    -lCdlEngine \
-    -lFeatMgr \
-    -lapmime \
-    -lapgrfx \
-    -lcharconv \
-    -lInetProtUtil \
-    -lsmildtd \  
-    -lxmldom \
-    -lxmlparser \
-    -lcone \
-    -lQtCore \
-    -letel \
-    -lmmsmessage \  
-    -lcommdb \
-    -lcommsdat \
-    -letelmm \
-    -lunidatamodelloader \
-    -lunidatamodel \
-    -lavkon \
-    -leikcoctl \
-    -leikctl \
-    -lform \
-    -luiklaf\ 
-    -lxqutils\ 
-    -lmmstestbed\
-   -lmsginit \
-        -lmsgs \
-        -letext \
-        -lsmcm \
-        -lmmsmessage \
-        -lmmsserversettings \
-        -lmmscli \
-        -lxqservice \
-        -lQtContacts \
-        -lQtVersit \
-        -lunidatamodelloader \
-	-lxqsettingsmanager \
-        -apgrfx.lib \
-        -lxqutils \
-        -lws32 \
-        -lapgrfx \
-	-lxqsystemtoneservice
-
-  	
-
-packageheader = "$${LITERAL_HASH}{\"QTestLibCVsClientServerTest\"},(0xE7232a7c),1,0,0,TYPE=SA"
-
-vendorinfo = \
-			"; Localised Vendor name" \
-			"%{\"Nokia\"}" \
-			"; Unique Vendor name" \
-			":\"Nokia\"" 
-			
-dependencyinfo = \
-				"; Default HW/platform dependencies" \
-				"[0x101F7961],0,0,0,{\"S60ProductID\"}" \
-				"[0x2001E61C],4,6,3,{"Qt"}
-				
-default_deployment.pkg_prerules =	packageheader \
-									vendorinfo \
-									dependencyinfo 
-
-#Copy the dependent DLL
-symbian: {
-	addCfg.sources = ./data/testmmsplugin.cfg
-	addCfg.path = C:/
-	DEPLOYMENT += addCfg
-
-	addPl.sources = ./data/testmmsplugin.pl
-	addPl.path = C:/
-	DEPLOYMENT += addPl
-
-	addFiles.sources = mmstestbed.dll
-	addFiles.path = /sys/bin
-	DEPLOYMENT += addFiles
-
-      addP2.sources = ./data/SmileyFace.gif
-	addP2.path = C:/
-	DEPLOYMENT += addP2
-
-	addP3.sources = ./data/sample.txt
-	addP3.path = C:/
-	DEPLOYMENT += addP3	
-
-
-}
Binary file messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsplugin/data/SmileyFace.gif has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsplugin/data/testmmsplugin.cfg	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,1 @@
+TestMmsPlugin
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsplugin/data/testmmsplugin.pl	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,182 @@
+#
+# 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:
+#
+#!/usr/bin/perl -w
+use warnings;
+use strict;
+
+my $TOTALCASES 		= 0;
+my $TOTALPASSED 	= 0;
+my $TOTALRUN 			= 0;
+my $TOTALFAILED 	= 0;
+my $TOTALSKIPPED 	= 0;
+
+sub parse_line
+{
+	my $line = $_[0];
+	my @parts = split (" ", $line);
+	my $passed  = $parts[1];
+	my $failed  = $parts[3];
+	my $skipped = $parts[5];
+	
+	my $total = $passed + $failed + $skipped;
+	my $passrate = $passed * 100 / $total;
+	my $passrateround = sprintf("%.0f",$passrate);
+	my $runrate = ($total - $skipped)*100/$total;
+	my $runrateround = sprintf("%.0f",$runrate);
+	
+	$TOTALCASES += $total;
+	$TOTALPASSED += $passed;
+	$TOTALRUN += ($total - $skipped);
+	$TOTALFAILED += $failed;
+	$TOTALSKIPPED  += $skipped;
+	
+	printf MYFILE "<td>\n";
+	printf MYFILE "$passed\n";
+	printf MYFILE "</td>\n";
+	
+	if($failed > 0)
+	{
+	printf MYFILE "<td style=\"font-weight:bold;color:red\">\n";
+	printf MYFILE "$failed\n";
+	printf MYFILE "</td>\n";
+	}
+	else
+	{
+	printf MYFILE "<td>\n";
+	printf MYFILE "$failed\n";
+	printf MYFILE "</td>\n";	
+	}
+
+	printf MYFILE "<td>\n";
+	printf MYFILE "$skipped\n";
+	printf MYFILE "</td>\n";
+
+	printf MYFILE "<td>\n";
+	printf MYFILE "$total\n";
+	printf MYFILE "</td>\n";
+	 
+	printf MYFILE "<td>\n";
+	printf MYFILE ("$passrateround %%\n");
+	printf MYFILE "</td>\n";
+
+	printf MYFILE "<td>\n";
+	printf MYFILE "$runrateround %%\n";
+	printf MYFILE "</td>\n";
+	
+	
+}
+
+sub parse_file
+	{
+		my $pattern = "Totals";
+		my $file = $_[0];
+		open (FILE,$file);
+	
+		while (my $line= <FILE>)
+		{
+			chomp ($line);
+		if ($line =~ m/$pattern/)
+			{				
+			parse_line $line;
+			}
+		}
+		close(FILE);
+	}
+
+
+sub generate_report
+	{
+		open (MYFILE, '>/epoc32/winscw/c/logs/messagingtestsuite/report.html');
+		printf MYFILE "<html>\n"; 
+		printf MYFILE "<body>\n";
+		printf MYFILE "<head>\n"; 
+		printf MYFILE "<title>MsgApp Test Suite Reports</title>"; 
+		printf MYFILE "</head>\n";
+		printf MYFILE "<h2 align = center>Messaging101 Test Suite Report</h2>\n";
+		printf MYFILE "<table border = 2 cellpadding = 10 align = center>\n";
+		printf MYFILE "<tr style = \" background-color:lavender \">\n";
+		printf MYFILE "<th>Module</th>\n";
+		printf MYFILE "<th style = color:green>Passed</th>\n";
+		printf MYFILE "<th style = color:red>Failed</th>\n";
+		printf MYFILE "<th style = color:chocolate>Skipped</th>\n";
+		printf MYFILE "<th>Total Cases</th>\n";
+		printf MYFILE "<th>Pass Rate</th>\n";
+		printf MYFILE "<th>Run Rate</th>\n";
+		printf MYFILE "</tr>\n";
+		
+		
+		my @files = </epoc32/winscw/c/logs/messagingtestsuite/*.txt>;
+		foreach my $file (@files) 
+		{	
+			my @splitedpath = split("/",$file);
+			my $filename = $splitedpath[-1];	
+			my $length = length($filename);
+		  my $name = substr($filename,11,$length-15);
+		  printf MYFILE "<tr>\n";
+		  printf MYFILE "<td>\n";
+		  printf MYFILE "<a HREF=$filename style = text-decoration:none><b>$name</b></a>\n";
+		  printf MYFILE "</td>\n";
+		  
+		  parse_file $file;
+		  
+		  printf MYFILE "</tr>\n";
+		}
+		
+		printf MYFILE "<tr style= \"font-weight:bold; color:white; background-color:gray\">\n";
+		printf MYFILE "<td>\n";
+		printf MYFILE "<b>Overall</b>\n";
+		printf MYFILE "</td>\n";
+		
+		
+		printf MYFILE "<td>\n";
+		printf MYFILE "$TOTALPASSED\n";
+		printf MYFILE "</td>\n";
+		
+		printf MYFILE "<td>\n";
+		printf MYFILE "$TOTALFAILED\n";
+		printf MYFILE "</td>\n";
+		
+		printf MYFILE "<td>\n";
+		printf MYFILE "$TOTALSKIPPED\n";
+		printf MYFILE "</td>\n";
+		
+		printf MYFILE "<td>\n";
+		printf MYFILE "$TOTALCASES\n";
+		printf MYFILE "</td>\n";
+		
+		my $passrate = $TOTALPASSED*100/$TOTALCASES;
+		my $passrateround = sprintf("%.0f",$passrate);
+		printf MYFILE "<td>\n";
+		printf MYFILE "$passrateround%%\n";
+		printf MYFILE "</td>\n";
+		
+		my $runrate = ($TOTALCASES - $TOTALSKIPPED)*100/$TOTALCASES;
+		my $runrateround = sprintf("%.0f",$runrate);
+		printf MYFILE "<td>\n";
+		printf MYFILE "$runrateround%%\n";
+		printf MYFILE "</td>\n";
+		
+		printf MYFILE "</tr>\n";
+		
+		printf MYFILE "</table>\n";
+	  printf MYFILE "</body>\n"; 
+		printf MYFILE "</html>\n";
+			
+		close (MYFILE);
+	}
+
+
+generate_report;
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsplugin/inc/testmmsplugin.h	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,88 @@
+/*
+ * 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: - Main test class for Msgnotification -indicator plugin, 
+ *                                                   -notification dialog plugin
+ */
+
+#ifndef TEST_MMS_PLUGIN_H
+#define TEST_MMS_PLUGIN_H
+
+#ifdef BUILD_TEST_DLL
+#define TEST_EXPORT Q_DECL_EXPORT
+#else
+#define TEST_EXPORT Q_DECL_IMPORT
+#endif
+
+#include <QObject>
+#include <e32const.h>
+
+class UniEditorMmsPlugin;
+class ConvergedMessage;
+class MmsTestBed;
+class QSignalSpy;
+
+class TEST_EXPORT TestMmsPlugin: public QObject
+    {
+    Q_OBJECT
+
+private slots:
+     
+    /**
+        * Called by framework,its called before the 1st test function is executed.
+     */  
+   
+    void initTestCase();
+
+    /**
+        * Called by framework,its called before each test function is executed.
+     */  
+
+    void init();
+
+    /**
+        * Test Sending MMS
+     */  
+
+    void testSendMMS(); 
+
+    /**
+        * Test receiving MMS
+     */  
+
+    void testMmsReceived();
+
+    /**
+        * Called by framework,its called after each test function is executed.
+     */  
+
+    void cleanup();
+
+    /**
+        * Called by framework,its called after the last test function is executed.
+     */  
+
+    void cleanupTestCase();
+
+private:
+
+    QSignalSpy *spy_draft;
+    QSignalSpy *spy_outbox;
+    QSignalSpy *spy_sent;
+
+    UniEditorMmsPlugin* msgPlugin;
+    int mmsId;
+    MmsTestBed* mmstestbed;
+   
+    };
+#endif //TEST_MMS_PLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsplugin/inc/testmmsplugin.ini	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,12 @@
+//this file is used to provide predefined set of input data.
+
+const char TEST_MSG_RECIEPIENT[]         = "+919000";
+const char TEST_MSG_FROM2[]              = "999";
+const char TEST_MSG_SUBJECT[]            = "Message Subject";
+const char TEST_SERVICE_NAME_MMS[] 	 = "messaging.mserver.testservice.MMS";
+const char TEST_SENDER[]		 = "+918888";
+const char TEST_ATTACHMENT[]		 = "c:\\sample.txt";
+const char TEST_ATTACHMENT4[]		 = "c:\\SmileyFace.gif";
+const char TEST_ATTACHMENT5[]		 = "c:\\sample.txt";
+const char TEST_CC[]			 = "DummyCCAddress";
+const char TEST_BCC[]			 = "DummyBCCAddress";
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsplugin/src/testmmsplugin.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,229 @@
+/*
+ * 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: - Main test class for Msgnotification -indicator plugin, 
+ *                                                   -notification dialog plugin
+ */
+
+#include "testmmsplugin.h"
+#include <QtTest/QtTest>
+#include "debugtraces.h"
+#include <QTimer>
+#include <QSignalSpy>
+#include "convergedmessage.h"
+#include "convergedmessageid.h"
+#include "unieditormmsplugin.h"
+#include "mmstestbed.h"
+#include "testmmsplugin.ini"
+#include <QSignalSpy>
+
+
+
+//factory method to create objects.
+QObject* getObject(QString className)
+{
+    if(className == "TestMmsPlugin" )
+    {
+        return new TestMmsPlugin;
+    }
+ 	else
+	{
+		return 0;
+	}
+}
+
+//main entry point
+int main(int argc, char *argv[])
+    { 
+    int ret = -1;
+	QCoreApplication app(argc, argv);
+	
+	//the configuration file.
+	QFile data("c:/testmmsplugin.cfg");
+    if (data.open(QFile::ReadOnly)) 
+        {
+		QTextStream in(&data);
+		while(!in.atEnd())
+			{
+			QString name = in.readLine();
+			QObject* tc = getObject(name);
+			
+			if(tc)
+				{
+				ret =  QTest::qExec(tc, argc, argv);
+				delete tc;
+				}
+			}
+        }
+	return ret;
+
+    }
+
+
+
+
+
+
+//---------------------------------------------------------------
+// TestMmsPlugin::initTestCase
+//---------------------------------------------------------------
+
+void TestMmsPlugin::initTestCase()
+{
+    qRegisterMetaType<long int> ("long int"); 
+    msgPlugin = new UniEditorMmsPlugin();
+    QVERIFY(msgPlugin != 0);
+    mmsId = -1;
+    mmstestbed = new MmsTestBed;
+	QVERIFY(mmstestbed != 0);
+	if(!mmstestbed)
+	{
+		QSKIP("Mmstestbed creation failed", SkipAll); 
+	}
+
+    spy_draft  = new QSignalSpy(mmstestbed,SIGNAL(entryCreatedInDraft(long int)));
+    spy_outbox = new QSignalSpy(mmstestbed,SIGNAL(entryMovedToOutbox(long int)));
+    spy_sent   = new QSignalSpy(mmstestbed,SIGNAL(entryMovedToSent(long int)));
+
+}
+
+//---------------------------------------------------------------
+// TestMmsPlugin::init
+//---------------------------------------------------------------
+
+void TestMmsPlugin::init()
+{
+}
+
+//---------------------------------------------------------------
+// TestMmsPlugin::testSendMMS
+//---------------------------------------------------------------
+
+void TestMmsPlugin::testSendMMS()
+{
+   
+    qRegisterMetaType<long int> ("long int");
+    QString service = TEST_SERVICE_NAME_MMS;
+	
+	QString subject  = TEST_MSG_SUBJECT;
+	qint64 timeStamp = QDateTime::currentDateTime().toTime_t();
+	
+	QString sender(TEST_SENDER);
+	ConvergedMessageAddress address(sender);
+	ConvergedMessageAttachmentList attachmentList;    
+
+	QString attachment2Path = TEST_ATTACHMENT4;
+	ConvergedMessageAttachment* attachment2 = 
+			new ConvergedMessageAttachment(attachment2Path, ConvergedMessageAttachment::EAttachment);
+	
+	QString attachmentPath = TEST_ATTACHMENT5;
+	ConvergedMessageAttachment* attachment = 
+		new ConvergedMessageAttachment(attachmentPath, ConvergedMessageAttachment::EAttachment);
+		
+	attachmentList.append(attachment);
+	attachmentList.append(attachment2);
+	ConvergedMessage msg;
+	msg.setMessageType(ConvergedMessage::Mms);
+	msg.setSubject(subject);
+	msg.setTimeStamp(timeStamp);
+	msg.addToRecipient(address);
+	msg.addAttachments(attachmentList);
+	msg.setPriority(ConvergedMessage::Normal);
+	//Adding alias
+	ConvergedMessageAddress address1;
+	address1.setAlias(QString(TEST_MSG_RECIEPIENT));
+	msg.addToRecipient(address1);
+	
+	//Adding CC Address
+	QString ccAddress(TEST_CC);
+	ConvergedMessageAddress ccAdd(ccAddress);
+	msg.addCcRecipient(ccAdd);
+	
+	//Adding BCC Address
+	QString bccAddress(TEST_BCC);
+	ConvergedMessageAddress bccAdd(bccAddress);
+	msg.addBccRecipient(bccAdd);
+	
+	mmstestbed->cleanAll();
+	mmstestbed->setConnectionLocal(true);
+	long int id = msgPlugin->convertTo(&msg);
+	
+	QVERIFY(id != 0);
+	msgPlugin->send(id);
+	QTest::qWait(5000); 
+	long int idRec;
+	
+	if( 1 == spy_draft->count())
+		{
+		void * temp = const_cast<void*>(spy_draft->at(0).at(0).data());
+		idRec = *reinterpret_cast< long int(*)>(temp);
+		QDEBUG_WRITE("passed: spy_draft.count");
+		}
+	else
+		{
+		QFAIL("testSendReceiveMMS: Failed to create message in Draft");
+		mmstestbed->setConnectionLocal(false);
+		return;
+		}
+	if( 1 == spy_outbox->count())
+		{
+		mmstestbed->fromOutboxToMmsc();
+		QDEBUG_WRITE("passed: spy_outbox.count");
+		}
+	else
+		{
+		QFAIL("testSendReceiveMMS: Failed to move message to Outbox");
+		mmstestbed->setConnectionLocal(false);
+		return;
+		}
+
+	if( 1 == spy_sent->count())
+		{
+		void * temp = const_cast<void*>(spy_sent->at(0).at(0).data());
+		long int sentmsgid = *reinterpret_cast< long int(*)>(temp);
+		QCOMPARE(sentmsgid, idRec);
+		mmstestbed->fromMmscToInbox();
+		QDEBUG_WRITE("passed: spy_sent.count");
+		}
+	else
+		{
+		QFAIL("testSendReceiveMMS: Failed to move message to Sent folder");
+		mmstestbed->setConnectionLocal(false);
+		return;
+		}
+}
+
+//---------------------------------------------------------------
+// TestMmsPlugin::testMmsReceived
+//---------------------------------------------------------------
+void TestMmsPlugin::testMmsReceived()
+{
+        QTest::qWait(5000);
+}
+
+//---------------------------------------------------------------
+// TestMmsPlugin::cleanup
+//---------------------------------------------------------------
+void TestMmsPlugin::cleanup()
+{
+}
+
+//---------------------------------------------------------------
+// TestMmsPlugin::cleanupTestCase
+//---------------------------------------------------------------
+void TestMmsPlugin::cleanupTestCase()
+{
+    delete msgPlugin;
+    delete mmstestbed;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/testmmsplugin/testmmsplugin.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,178 @@
+
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+QT += testlib
+QT -= gui
+
+CONFIG += hb
+CONFIG += symbian_test
+
+TEMPLATE = app
+TARGET = testmmsplugin
+
+INCLUDEPATH += inc
+INCLUDEPATH += ../../inc
+INCLUDEPATH += ../../../../../../../../inc
+INCLUDEPATH += ../../../../../../inc
+INCLUDEPATH += ../../../../../msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/inc
+INCLUDEPATH += ../../../../../msgutils/unidatautils/unidatamodel/inc
+INCLUDEPATH += ../../../../../msgutils/unieditorutils/editorgenutils/inc
+INCLUDEPATH += ../../../../../../../../mmsengine/mmsmessage/inc 
+INCLUDEPATH += ../../../../../../../../mmsengine/inc
+INCLUDEPATH += ../mmstestbed/inc
+INCLUDEPATH +=
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+DEFINES += BUILD_TEST_DLL
+
+SOURCES += \
+  src/testmmsplugin.cpp \
+  ../../../../../msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/src/unieditormmsplugin.cpp \
+  ../../../../../msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/src/unieditormmsplugin_p.cpp  
+      
+
+# Input
+HEADERS += \
+  inc/testmmsplugin.h \
+  ../../../../../msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/inc/unieditormmsplugin.h \
+  ../../../../../msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/inc/unieditormmsplugin_p.h 
+               
+   
+SYMBIAN_PLATFORMS = WINSCW ARMV5
+
+symbian {
+    TARGET.UID3 =  0xE7232a7c
+#    TARGET.CAPABILITY = CAP_GENERAL_DLL
+    TARGET.CAPABILITY = CAP_APPLICATION
+    TARGET.EPOCSTACKSIZE = 0x8000
+    TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000
+    TARGET.EPOCALLOWDLLDATA = 1
+    VENDORID =  VID_DEFAULT
+    BLD_INF_RULES.prj_exports += "data/testmmsplugin.cfg c:/testmmsplugin.cfg"
+    BLD_INF_RULES.prj_exports += "data/testmmsplugin.pl  c:/testmmsplugin.pl"
+    BLD_INF_RULES.prj_exports += "data/SmileyFace.gif    c:/SmileyFace.gif"
+    BLD_INF_RULES.prj_exports += "data/sample.txt        c:/sample.txt"
+
+	}
+
+ LIBS += -leuser \
+    -lcsserverclientapi \ 
+    -lcsutils \
+    -lconvergedmessageutils \
+    -lMsgMedia \
+    -leikctl \
+    -leditorgenutils \
+    -lcone \
+    -leikcoctl \
+    -leikcore \
+    -leikdlg \
+    -lmsgs \
+    -letext \
+    -lmmsserversettings \
+    -lgsmu \
+    -lmmsgenutils \
+    -lefsrv \
+    -lestor \
+    -lsmcm \
+    -lCommonEngine \
+    -lbafl \
+    -lCdlEngine \
+    -lFeatMgr \
+    -lapmime \
+    -lapgrfx \
+    -lcharconv \
+    -lInetProtUtil \
+    -lsmildtd \  
+    -lxmldom \
+    -lxmlparser \
+    -lcone \
+    -lQtCore \
+    -letel \
+    -lmmsmessage \  
+    -lcommdb \
+    -lcommsdat \
+    -letelmm \
+    -lunidatamodelloader \
+    -lunidatamodel \
+    -lavkon \
+    -leikcoctl \
+    -leikctl \
+    -lform \
+    -luiklaf\ 
+    -lxqutils\ 
+    -lmmstestbed\
+   -lmsginit \
+        -lmsgs \
+        -letext \
+        -lsmcm \
+        -lmmsmessage \
+        -lmmsserversettings \
+        -lmmscli \
+        -lxqservice \
+        -lQtContacts \
+        -lQtVersit \
+        -lunidatamodelloader \
+	-lxqsettingsmanager \
+        -apgrfx.lib \
+        -lxqutils \
+        -lws32 \
+        -lapgrfx \
+	-lxqsystemtoneservice
+
+  	
+
+packageheader = "$${LITERAL_HASH}{\"QTestMsgNotifier\"},(0xE7232a7c),1,0,0,TYPE=SA"
+
+vendorinfo = \
+			"; Localised Vendor name" \
+			"%{\"Nokia\"}" \
+			"; Unique Vendor name" \
+			":\"Nokia\"" 
+			
+dependencyinfo = \
+				"; Default HW/platform dependencies" \
+				"[0x101F7961],0,0,0,{\"S60ProductID\"}" \
+				"[0x2001E61C],4,6,3,{"Qt"}
+				
+default_deployment.pkg_prerules =	packageheader \
+									vendorinfo \
+									dependencyinfo 
+
+#Copy the dependent DLL
+symbian: {
+	addCfg.sources = ./data/testmmsplugin.cfg
+	addCfg.path = C:/
+	DEPLOYMENT += addCfg
+
+	addPl.sources = ./data/testmmsplugin.pl
+	addPl.path = C:/
+	DEPLOYMENT += addPl
+
+	addFiles.sources = mmstestbed.dll
+	addFiles.path = /sys/bin
+	DEPLOYMENT += addFiles
+
+      addP2.sources = ./data/SmileyFace.gif
+	addP2.path = C:/
+	DEPLOYMENT += addP2
+
+	addP3.sources = ./data/sample.txt
+	addP3.path = C:/
+	DEPLOYMENT += addP3	
+
+
+}
--- a/messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/unittest_mmsplugin.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgnotifications/msgnotifier/tsrc/unittest_mmsplugin/unittest_mmsplugin.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -20,8 +20,8 @@
 CONFIG += ordered
 
 #Sub .pro files
-SUBDIRS += mmstestbed/mmstestbed.pro
-SUBDIRS += testmmsgplugin/testmmsplugin.pro
+SUBDIRS += mmstestbed
+SUBDIRS += testmmsplugin
 
 
 # Platforms
--- a/messagingapp/msgservices/msgserviceapp/inc/msgserviceviewmanager.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgservices/msgserviceapp/inc/msgserviceviewmanager.h	Fri Sep 17 08:28:39 2010 +0300
@@ -22,6 +22,7 @@
 #include <QObject>
 #include <QVariant>
 #include <HbEffect>
+#include <convergedmessage.h>
 
 class QGraphicsItem;
 class QGraphicsPixmapItem;
@@ -83,13 +84,25 @@
      * @param data data to be sent.
      */
     void send(QVariant data);
-
+	
+    /**
+     * Send message.
+     */
+    void send(ConvergedMessage message);
+	
     /**
      * Opens the viewer to view the message.
      * @param msgId message id of the message.
      */
     void view(int msgId);
 
+    /**
+     * Handles the HW key events.
+     * @param key key type.
+     * @return true if key event handled else false.
+     */
+    bool handleKeyEvent(int key);
+
 private:
     /*
      * Switch to unieditor.
--- a/messagingapp/msgservices/msgserviceapp/inc/msgservicewindow.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgservices/msgserviceapp/inc/msgservicewindow.h	Fri Sep 17 08:28:39 2010 +0300
@@ -26,6 +26,7 @@
 class MsgServiceViewManager;
 class MsgShareUiInterface;
 class MsgSendInterface;
+class MsgUriHandlerInterface;
 
 class MsgServiceWindow : public HbMainWindow
     {
@@ -42,6 +43,14 @@
      */
     ~MsgServiceWindow();
     
+protected:
+
+    /**
+     * Key press event handler
+     * @see QGraphicsItem
+     */
+    void keyPressEvent(QKeyEvent *event);
+
 private:
     /**
      * View interface object
@@ -60,6 +69,12 @@
      * Owned
      */
     MsgShareUiInterface*  mShareUiInterface;
+
+    /**
+     * URI handler interface object
+     * Owned
+     */
+    MsgUriHandlerInterface*  mUriInterface;
     
     /**
      * Message store handler
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgservices/msgserviceapp/inc/msgurihandlerinterface.h	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ * 
+ * Description: Message Application service interface used for interfacing between
+ *              QT highway and other applications
+ *
+ */
+
+#ifndef __MSG_URIHANDLERINTERFACE_H__
+#define __MSG_URIHANDLERINTERFACE_H__
+
+#include <xqserviceprovider.h>
+#include <QVariant>
+#include <convergedmessage.h>
+
+class MsgServiceViewManager;
+
+class MsgUriHandlerInterface : public XQServiceProvider
+    {
+    Q_OBJECT
+    
+public:
+    /*
+     * Constructor
+     */
+    MsgUriHandlerInterface(MsgServiceViewManager* viewManager, QObject* parent=0);
+    
+    /*
+     * Destructor
+     */
+    ~MsgUriHandlerInterface();
+    
+public slots:
+
+    bool view(const QString& uri);
+
+private:
+    
+    void normalizeQueryItems(QUrl &url);
+    
+    void addRecipients(ConvergedMessage &message, const QString &recipientsList);
+
+private:
+    
+    MsgServiceViewManager* viewManager;
+    
+    };
+
+#endif /* __MSG_URIHANDLERINTERFACE_H__ */
--- a/messagingapp/msgservices/msgserviceapp/msgserviceapp.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgservices/msgserviceapp/msgserviceapp.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -36,15 +36,17 @@
 	         inc/msgstorehandler.h \
 	         inc/msgsendinterface.h \
 			 inc/msgshareuiinterface.h \
-			 inc/msgserviceviewmanager.h
+			 inc/msgserviceviewmanager.h \
+		    	 inc/msgurihandlerinterface.h
 			
 SOURCES += src/main.cpp \
            src/msgviewinterface.cpp \
            src/msgservicewindow.cpp \
            src/msgstorehandler.cpp \
            src/msgsendinterface.cpp \
-		   src/msgshareuiinterface.cpp \
-		   src/msgserviceviewmanager.cpp
+	   src/msgshareuiinterface.cpp \
+	   src/msgserviceviewmanager.cpp \
+     	   src/msgurihandlerinterface.cpp
 			
 # Capability
 TARGET.CAPABILITY = ALL -TCB
--- a/messagingapp/msgservices/msgserviceapp/rom/msgserviceapp.iby	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgservices/msgserviceapp/rom/msgserviceapp.iby	Fri Sep 17 08:28:39 2010 +0300
@@ -22,10 +22,9 @@
 data=DATAZ_\resource\apps\msgserviceapp.rsc  resource\apps\msgserviceapp.rsc
 data=DATAZ_\private\10003a3f\import\apps\msgserviceapp_reg.rsc   private\10003a3f\import\apps\msgserviceapp_reg.rsc
 
-<clip>
-      data=ZRESOURCE\hb\splashml\messagingsendservice.splashml  RESOURCE_FILES_DIR\hb\splashml\messagingsendservice.splashml
-      data=ZRESOURCE\hb\splashml\messagingsendservice.docml  RESOURCE_FILES_DIR\hb\splashml\messagingsendservice.docml
-      data=ZRESOURCE\hb\splashml\messagingviewservice.splashml  RESOURCE_FILES_DIR\hb\splashml\messagingviewservice.splashml
-      data=ZRESOURCE\hb\splashml\messagingviewservice.docml  RESOURCE_FILES_DIR\hb\splashml\messagingviewservice.docml
-</clip>
+data=ZRESOURCE\hb\splashml\messagingsendservice.splashml  RESOURCE_FILES_DIR\hb\splashml\messagingsendservice.splashml
+data=ZRESOURCE\hb\splashml\messagingsendservice.docml  RESOURCE_FILES_DIR\hb\splashml\messagingsendservice.docml
+data=ZRESOURCE\hb\splashml\messagingviewservice.splashml  RESOURCE_FILES_DIR\hb\splashml\messagingviewservice.splashml
+data=ZRESOURCE\hb\splashml\messagingviewservice.docml  RESOURCE_FILES_DIR\hb\splashml\messagingviewservice.docml
+
 #endif
--- a/messagingapp/msgservices/msgserviceapp/service_conf.xml	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgservices/msgserviceapp/service_conf.xml	Fri Sep 17 08:28:39 2010 +0300
@@ -4,11 +4,18 @@
   <filepath>No path</filepath>
   <description>Messaging services</description>
   <interface>
+     <name>com.nokia.symbian.IUriView</name>
+     <version>1.0</version>
+     <description>Interface for showing URIs</description>
+     <customproperty key="schemes">sms,mmsto</customproperty>
+  </interface>
+  
+  <interface>
      <name>com.nokia.symbian.IFileShare</name>
      <version>1.0</version>
      <description>Share UI send interface</description>
      <customproperty key="aiw_action_text_file">messaging</customproperty>
-     <customproperty key="aiw_action_text">txt_messaging_list_attach_to_new_message</customproperty>
+     <customproperty key="aiw_action_text">txt_share_dblist_message</customproperty>
      <customproperty key="aiw_action_icon">qtg_large_message</customproperty>
      <customproperty key="blocked_mime_types">video/*</customproperty>
   </interface>
--- a/messagingapp/msgservices/msgserviceapp/src/msgserviceviewmanager.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgservices/msgserviceapp/src/msgserviceviewmanager.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -390,6 +390,20 @@
     }
 
 // ----------------------------------------------------------------------------
+// MsgServiceViewManager::handleKeyEvent
+// @see header
+// ----------------------------------------------------------------------------
+bool MsgServiceViewManager::handleKeyEvent(int key)
+{
+    MsgBaseView *baseView = static_cast<MsgBaseView *>(mMainWindow->currentView());
+    bool eventHandled = false;
+    if (baseView) {
+        eventHandled = baseView->handleKeyEvent(key);
+    }
+    return eventHandled;
+}
+
+// ----------------------------------------------------------------------------
 // MsgServiceViewManager::handleSmsMmsMsg
 // @see header
 // ----------------------------------------------------------------------------
@@ -693,3 +707,26 @@
 
     return animFile;
     }
+
+//-----------------------------------------------------------------------------
+//MsgServiceViewManager::send
+//@see header
+//-----------------------------------------------------------------------------
+
+void MsgServiceViewManager::send(ConvergedMessage message)
+    {
+    QVariantList param;
+    QByteArray dataArray;
+    QDataStream messageStream(&dataArray, QIODevice::WriteOnly | QIODevice::Append);
+    
+    message.serialize(messageStream);
+    param << dataArray;
+
+    // switch to editor
+    switchToUniEditor(param);
+    
+    XQServiceUtil::toBackground(false);    
+    }
+	
+	
+	
--- a/messagingapp/msgservices/msgserviceapp/src/msgservicewindow.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgservices/msgserviceapp/src/msgservicewindow.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -20,10 +20,13 @@
 #include "msgviewinterface.h"
 #include "msgsendinterface.h"
 #include "msgshareuiinterface.h"
+#include "msgurihandlerinterface.h"
 
 #include "msgstorehandler.h"
 #include "msgserviceviewmanager.h"
 
+#include <QKeyEvent>
+
 // LOCALIZATION
 #define LOC_BUTTON_DELETE hbTrId("txt_common_button_delete")
 #define LOC_BUTTON_CANCEL hbTrId("txt_common_button_cancel")
@@ -51,6 +54,7 @@
     // create interfaces 
     mSendInterface = new MsgSendInterface(mViewManager);
     mViewInterface = new MsgViewInterface(mViewManager);
+    mUriInterface = new MsgUriHandlerInterface(mViewManager);
     mShareUiInterface = new MsgShareUiInterface(mViewManager);
     }
 
@@ -64,6 +68,12 @@
         {
         delete mShareUiInterface;
         }
+	
+	if(mUriInterface)
+        {
+        delete mUriInterface;
+        }
+		
     if(mViewInterface)
         {
         delete mViewInterface;
@@ -83,8 +93,23 @@
         }
     }
 
-
+//---------------------------------------------------------------
+// MsgServiceWindow::keyPressEvent
+// @see header
+//---------------------------------------------------------------
+void MsgServiceWindow::keyPressEvent(QKeyEvent *event)
+{
+    bool eventHandled = false;
+    if (Qt::Key_Yes == event->key()) {
+        eventHandled = mViewManager->handleKeyEvent(event->key());
+    }
 
-    
+    if (eventHandled) {
+        event->accept();
+    }
+    else {
+        HbMainWindow::keyPressEvent(event);
+    }
 
-
+}
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgservices/msgserviceapp/src/msgurihandlerinterface.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ * class to manage differnt messaging views.
+ *
+ */
+
+#include "msgurihandlerinterface.h"
+
+#include <QtGlobal>
+
+#include <QString>
+#include <QStringList>
+#include <QPair>
+#include <QUrl>
+#include <convergedmessage.h>
+#include <convergedmessageaddress.h>
+
+#include "msgserviceviewmanager.h"
+#include "debugtraces.h"
+
+
+MsgUriHandlerInterface::MsgUriHandlerInterface(MsgServiceViewManager* viewManager, QObject* parent)
+:
+XQServiceProvider(QLatin1String("messaging.com.nokia.symbian.IUriView"), parent),   
+viewManager(viewManager)
+{
+    publishAll();
+}
+    
+MsgUriHandlerInterface::~MsgUriHandlerInterface()
+{
+    
+}
+    
+bool MsgUriHandlerInterface::view(const QString& uri)
+{
+    QDEBUG_WRITE_FORMAT("service request for URI:", uri.toLatin1().data());
+    QUrl parsedUri;
+    
+    parsedUri.setUrl(uri);
+    normalizeQueryItems(parsedUri);
+
+    QDEBUG_WRITE_FORMAT("scheme: ", parsedUri.scheme().toLatin1().data());
+    QDEBUG_WRITE_FORMAT("path: ", parsedUri.path().toLatin1().data());
+    QDEBUG_WRITE_FORMAT("items count: ", parsedUri.queryItems().size());
+    QDEBUG_WRITE_FORMAT("error: ", parsedUri.errorString());
+#ifdef _DEBUG_TRACES_
+    QPair<QString,QString> item;
+    foreach (item, parsedUri.queryItems()) 
+    {
+        int i = 0;
+        QDEBUG_WRITE_FORMAT("MsgUriHandlerInterface::view(): query item # i :", i++);
+        QDEBUG_WRITE_FORMAT("MsgUriHandlerInterface::view(): query item # First Item :", item.first.toLatin1().data());
+        QDEBUG_WRITE_FORMAT("MsgUriHandlerInterface::view(): query item # Second Item :", item.second.toLatin1().data());
+    }
+#endif    
+    
+    ConvergedMessage message;
+    
+    if (parsedUri.scheme().compare("sms", Qt::CaseInsensitive)) 
+    {
+        message.setMessageType(ConvergedMessage::Sms);
+    } 
+    else if (parsedUri.scheme().compare("mmsto", Qt::CaseInsensitive)) 
+    {
+        message.setMessageType(ConvergedMessage::Mms);
+    } 
+    else 
+    {
+       QDEBUG_WRITE_FORMAT("Unsupported scheme:", parsedUri.scheme().toLatin1().data());
+       return false;
+    }
+
+    QString addressLine = parsedUri.path();
+    addRecipients(message, addressLine);
+    
+    QString body = parsedUri.queryItemValue("body");
+    message.setBodyText(body);
+    
+    /* mms specific query values */
+
+    QString subject = parsedUri.queryItemValue("subject");
+    message.setSubject(subject);
+
+    QString priority = parsedUri.queryItemValue("priority");
+    if (priority.compare("Low", Qt::CaseInsensitive)) 
+    {
+        message.setPriority(ConvergedMessage::Low);
+    } 
+    else if (priority.compare("Normal", Qt::CaseInsensitive)) 
+    {
+        message.setPriority(ConvergedMessage::Normal);
+    } 
+    else if (priority.compare("High", Qt::CaseInsensitive)) 
+    {
+        message.setPriority(ConvergedMessage::High);
+    } 
+    else 
+    {
+       QDEBUG_WRITE_FORMAT("MsgUriHandlerInterface::view(): Unknown priority value: ", priority.toLatin1().data());
+       return false;
+    }
+    
+    QStringList tos = parsedUri.allQueryItemValues("to");
+    QString to;
+    foreach (to, tos) 
+    {
+        addRecipients(message, to);
+    }
+    
+    QStringList ccs = parsedUri.allQueryItemValues("cc");
+    QString cc;
+    foreach (cc, ccs) 
+    {
+        addRecipients(message, cc);
+    }
+    
+    viewManager->send(message);
+    
+    return true;
+}
+
+void MsgUriHandlerInterface::normalizeQueryItems(QUrl &url)
+{
+    QList<QPair<QString, QString> > items = url.queryItems();
+    QPair<QString, QString> item;
+    int i = 0;
+    foreach (item, items) 
+    {
+        items.replace(i++, QPair<QString,QString >(item.first.toLower(), item.second));
+    }
+    url.setQueryItems(items);
+}
+
+
+void MsgUriHandlerInterface::addRecipients(ConvergedMessage &message, const QString &recipientsList)
+{
+    QStringList addressList = recipientsList.split(",");
+    QString addressEntry;
+    
+    foreach (addressEntry, addressList) 
+    {
+        addressEntry.trimmed();
+        if (! addressEntry.isEmpty()) 
+        {
+            ConvergedMessageAddress address;
+            address.setAddress(addressEntry);
+            message.addToRecipient(address);
+            QDEBUG_WRITE_FORMAT("MsgUriHandlerInterface::addRecipients() recipient added: ", addressEntry.toLatin1().data());
+         }
+     }
+}
--- a/messagingapp/msgsettings/msginit/src/simscnumberdetector.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgsettings/msginit/src/simscnumberdetector.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -448,22 +448,40 @@
             }
 
         QDEBUG_WRITE("CMsgSimOperation::DoStartRunL create name")
-        
-        TBuf<100> name(KSmscSimDefaultName); 
-        name.AppendNum(i);
-        
-        QDEBUG_WRITE("CMsgSimOperation::DoStartRunL name created")
-        
-        smsSettings->AddServiceCenterL(name, entry.iServiceCentre.iTelNumber);
+		
+		TBool duplicateFound(EFalse);
+
+		numSCAddresses = smsSettings->ServiceCenterCount();
+        for ( TInt j = 0; j < numSCAddresses; j++ )
+			{
+			if ( entry.iServiceCentre.iTelNumber == smsSettings->GetServiceCenter( j ).Address() )
+				{
+                QDEBUG_WRITE_FORMAT("DoStartRunL - Duplicate. SMSC ", i)
+                QDEBUG_WRITE_FORMAT("DoStartRunL -    of Sms Settings SMSC ", j)
+                duplicateFound = ETrue;
+                break;
+				}
+             }
+        if(!duplicateFound)
+            {            
+			TBuf<KMaxNameLength> name;
+            name = entry.iText;        
+            if ( name == KNullDesC )
+                {        
+                name.Append(KSmscSimDefaultName); 
+                name.AppendNum(i);
+                }
+    
+            QDEBUG_WRITE("CMsgSimOperation::DoStartRunL name created")        
+            smsSettings->AddServiceCenterL(name, entry.iServiceCentre.iTelNumber);
+            QDEBUG_WRITE("CMsgSimOperation::DoStartRunL AddServiceCenterL completed")
+            }
         
-        
-        QDEBUG_WRITE("CMsgSimOperation::DoStartRunL AddServiceCenterL completed")
-
-        if ( i == 0 )
+      	if (i==0)
             {
-            smsSettings->SetDefaultServiceCenter(i);
-            QDEBUG_WRITE("CMsgSimOperation::DoStartRunL SetDefaultServiceCenter completed")
-            }
+			smsSettings->SetDefaultServiceCenter(i);
+			QDEBUG_WRITE("CMsgSimOperation::DoStartRunL SetDefaultServiceCenter completed")
+			}      
         }
 
     // save settings
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgsettings/msginit/tsrc/testmsginit/inc/testmsginit.h	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef TESTMSGINIT_H_
+#define TESTMSGINIT_H_
+
+#ifdef BUILD_TEST_DLL
+#define TEST_EXPORT Q_DECL_EXPORT
+#else
+#define TEST_EXPORT 
+#endif
+
+// INCLUDES
+#include <QtTest/QtTest>
+
+// FORWARD DECLARATIONS
+class MsgSimNumDetector;
+class CMsvOperation;
+class COutboxObserver;
+class CMobileSignalStrengthHandler;
+class CTestMsgSimOperation;
+
+class TEST_EXPORT TestMsgInit: public QObject
+{
+    Q_OBJECT
+    
+private slots:
+
+    /**
+     * Intializes component for testing
+     */
+    void initTestCase();
+
+    /**
+     * Initilazes the test case data to be executed
+     */
+    void init();
+    
+    void validateMobileSignalStrength();
+    
+    void validateOutboxSenderOperation();
+    
+    void validateOutboxObserver();
+    
+    void validateSimNumDetector();    
+    /**
+     * Clean the test case data
+     */
+    void cleanup();
+
+    /**
+     * Delete the initialized component for testing
+     */
+    void cleanupTestCase();
+    
+private: 
+    MsgSimNumDetector* iSimHandler;
+    CMsvOperation* iMsvOperation;
+    COutboxObserver* iOutBoxObserver;
+    CTestMsgSimOperation* iTestMsgSimOperation;
+    CMobileSignalStrengthHandler* iSignalStrengthHandler;
+
+};
+#endif /* TESTMSGINIT_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgsettings/msginit/tsrc/testmsginit/inc/testoutboxobserver_stub.h	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:   
+ *       The purpose of this class is to observe if there are messages 
+ *       in the outbox.
+ *
+ */
+
+#ifndef TESTOUTBOXOBSERVER_STUB_H_
+#define TESTOUTBOXOBSERVER_STUB_H_
+
+//  INCLUDES
+#include <e32base.h>
+#include <msvapi.h>         // for MMsvSessionObserver
+#include "msignalstrengthobserver.h"
+
+// FORWARD DECLARATIONS
+
+class CMsvSession;
+class COutboxSender;
+class MSignalStrengthHandler;
+
+// CLASS DECLARATION
+
+/**
+ *  Observes if there are messages in the OutBox..
+ */
+class CTestOutboxObserver: public MSignalStrengthObserver
+{
+public:
+    // Constructors and destructor
+
+    /**
+     *   A Two-phased constructor.
+     */
+    static CTestOutboxObserver* NewL();
+
+    /**
+     *   Destructor.
+     */
+    virtual ~CTestOutboxObserver();
+
+private:
+    // From MSignalStrengthObserver
+
+    void SignalStrengthAndBarUpdatedL(TInt aNewSignalValue, TInt aNewBarValue);
+
+public:
+
+    void HandleMsvSessionReadyL(CMsvSession& aMsvSession);
+    void HandleMsvSessionClosedL();
+
+public:
+    // New functions
+
+    /**
+     *  Informs the networkstatus to Outbox Sender
+     */
+    void InformOutboxSenderL(const TInt& aNetworkBars);
+
+private:
+
+    /**
+     *   A C++ constructor.
+     */
+    CTestOutboxObserver();
+
+    /**
+     *   By default Symbian OS constructor is private.
+     */
+    void ConstructL();
+
+    /**
+     * Creates the Msv Session and sets the outbox 
+     * observer and outbox sender.
+     * @param aMsvSession The Msv session to use.
+     */
+    void StartSessionsL(CMsvSession& aMsvSession);
+
+    /**
+     *   Delete session, outbox observer and outbox sender.
+     */
+    void EndSessions();
+
+private:
+    // In-box folder entry. Note that the entry is not owned by this class.
+    CMsvEntry* iOutboxFolder;
+    // Pointer to Outbox Sender.
+    COutboxSender* iOutboxSender;
+    // Signal strength handler. Owned.
+    MSignalStrengthHandler* iSignalStrengthHandler;
+};
+
+#endif /* TESTOUTBOXOBSERVER_STUB_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgsettings/msginit/tsrc/testmsginit/inc/testoutboxsender_stub.h	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *       This class follows the offline status of the phone. When the mode is
+ *       changed from online to offline, the sending operation is started. When
+ *       the mode is changed from online to offline, the current sending
+ *       operation is cancelled.
+ *
+ */
+
+
+#ifndef TESTOUTBOXSENDER_STUB_H_
+#define TESTOUTBOXSENDER_STUB_H_
+
+//  INCLUDES
+#include <msvapi.h>
+#include <MuiuMsvSingleOpWatcher.h>
+#include <cenrepnotifyhandler.h>
+
+// FORWARD DECLARATIONS
+class CRepository;
+
+// CLASS DECLARATION
+
+class CTestOutboxSender: public MMsvSingleOpWatcher
+{
+public:
+    // Constructors and destructor
+
+    /**
+     *   A two-phased constructor.
+     */
+    static CTestOutboxSender* NewL(CMsvSession& aMsvSession);
+
+    /**
+     *   A destructor.
+     */
+    virtual ~CTestOutboxSender();
+
+public:
+    // New functions
+
+    /**
+     *   Starts the message sending operation for sms-messages.
+     */
+    void StartSendingL();
+
+    /**
+     *   Cancels current message sending operation.
+     */
+    void CancelSending();
+
+    /**
+     *   Checks if the sending operation is currently active.
+     */
+    TBool IsSending() const;
+
+    /**
+     *  Confirms the network status and starts sending messages
+     */
+    void CheckAndStartSendingL(const TInt& aNetworkBars);
+
+public:
+    // Functions from base classes
+
+    /**
+     *   From MMsvSingleOpWatcher. Deletes the sending operation.
+     */
+    virtual void OpCompleted(CMsvSingleOpWatcher& aOpWatcher, TInt aCompletionCode);
+
+private:
+    /**
+     *   A C++ Constructor
+     */
+    CTestOutboxSender(CMsvSession& aMsvSession);
+
+    /**
+     *   Creates the connection to shared data and
+     *   begins listening the KGSNetworkConnectionAllowed-key.
+     */
+    void ConstructL();
+
+    /**
+     * Checks whether SMS sending is needed in boot-phase and
+     * launches the sending operation
+     */
+    void CheckBootPhaseL();
+
+private:
+    enum TCleanupFlags
+    {
+        EUserSettingsConnected = 0x01,
+        EUserSettingsNotifierSet = 0x02,
+        EOffllineSendingNeeded = 0x10
+    };
+};
+
+#endif /* TESTOUTBOXSENDER_STUB_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgsettings/msginit/tsrc/testmsginit/inc/testsimnumdetector_stub.h	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *     An active object class which takes care of reading the possible new
+ *     service centres from SIM and adds them to Sms Settings.
+ *
+ */
+
+
+#ifndef TESTSIMNUMDETECTOR_STUB_H_
+#define TESTSIMNUMDETECTOR_STUB_H_
+
+//  INCLUDES
+#include <msvapi.h>     // for MsvSession
+
+// FORWARD DECLARATIONS
+class CMsvSession;
+
+/**
+ *  CTestMsgSimOperation
+ *  Inherited from CBase, MMsvSessionObserver
+ */
+class CTestMsgSimOperation : public MMsvSessionObserver
+{
+public:
+    
+    /**
+     * Constructor.
+     */
+    IMPORT_C static CTestMsgSimOperation* NewL();
+
+    /**
+     * Destructor
+     */
+    ~CTestMsgSimOperation();
+
+public:
+    
+
+    /**
+     * Callback function for startup state monitor object
+     */
+    void HandleStartupReadyL();
+
+private:
+    
+    /**
+	 * C++ constructor which initializes the active object with a 
+	 * default priority and adds it to the active scheduler.
+	 * @param TRequestStatus& aStatus, TInt aPriority
+	 * @return nothing
+	 */
+	CTestMsgSimOperation();
+    
+    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2,
+                             TAny* aArg3);
+
+    /**
+     * By default Symbian OS constructor is private.
+     */
+    void ConstructL();
+    
+public:
+    //data
+    CMsvSession* iMsvSession;
+
+};
+
+#endif /* TESTSIMNUMDETECTOR_STUB_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgsettings/msginit/tsrc/testmsginit/src/testmsginit.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,231 @@
+/*
+ * 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:
+ *
+ */
+
+// INCLUDES
+#include "testmsginit.h"
+#include "debugtraces.h"
+#include "msgsimnumberdetector.h"
+#include "coutboxobserver.h"
+#include "startupmonitor.h"
+#include "coutboxsendoperation.h"
+#include "cmobilesignalstrengthhandler.h"
+#include "testoutboxobserver_stub.h"
+#include "testoutboxsender_stub.h"
+#include "testsimnumdetector_stub.h"
+
+#include <csmsaccount.h>
+#include <e32property.h>
+#include <startupdomainpskeys.h>
+
+
+void TestMsgInit::initTestCase()
+	{
+
+	}
+
+void TestMsgInit::init()
+	{
+	qDebug("TestMsgInit::init enter");
+	
+	iTestMsgSimOperation = CTestMsgSimOperation::NewL();
+	QVERIFY2(iTestMsgSimOperation != NULL, "CTestMsgSimOperation init failed.");
+	
+	qDebug("TestMsgInit::init exit");
+	}
+
+void TestMsgInit::validateMobileSignalStrength()
+	{
+	qDebug("TestMsgInit::validateMobileSignalStrength enter");
+	
+	CTestOutboxObserver* mOutBoxObserver = CTestOutboxObserver::NewL();
+	QVERIFY2(mOutBoxObserver != NULL, "CTestOutboxObserver init failed.");
+	CleanupStack::PushL(mOutBoxObserver);
+	
+	iSignalStrengthHandler = CMobileSignalStrengthHandler::NewL();
+	QVERIFY2(iSignalStrengthHandler != NULL, "CMobileSignalStrengthHandler init failed.");
+	
+	if (iSignalStrengthHandler->ObservingSupported()) 
+	{
+		iSignalStrengthHandler->SetSignalStrengthObserverL(mOutBoxObserver);
+		iSignalStrengthHandler->StartObservingL();
+	}
+	
+	CleanupStack::PopAndDestroy(mOutBoxObserver);
+	//QTest::qWait(1000);
+	if(NULL !=iSignalStrengthHandler)
+		{
+		delete iSignalStrengthHandler;
+		iSignalStrengthHandler = NULL;
+		}
+	qDebug("TestMsgInit::validateMobileSignalStrength exit");
+	}
+
+void TestMsgInit::validateOutboxSenderOperation()
+	{
+	qDebug("TestMsgInit::validateOutboxSenderOperation enter");
+	
+	CTestOutboxSender* mTestOutboxSender = CTestOutboxSender::NewL(*(iTestMsgSimOperation->iMsvSession));
+	QVERIFY2(mTestOutboxSender != NULL, "CTestOutboxSender init failed.");
+	CleanupStack::PushL(mTestOutboxSender);
+	
+	CMsvSingleOpWatcher* msingleOpWatcher = CMsvSingleOpWatcher::NewL(*mTestOutboxSender);
+	QVERIFY2(msingleOpWatcher != NULL, "CMsvSingleOpWatcher init failed.");
+	CleanupStack::PushL(msingleOpWatcher);
+
+	iMsvOperation = COutboxSendOperation::NewL(*(iTestMsgSimOperation->iMsvSession), msingleOpWatcher->iStatus);
+	QVERIFY2(iMsvOperation != NULL, "COutboxSendOperation init failed.");
+	
+	//QTest::qWait(1000);
+	if(NULL !=iMsvOperation)
+		{
+		delete iMsvOperation;
+		iMsvOperation = NULL;
+		}
+	CleanupStack::PopAndDestroy(2); //mTestOutboxSender, msingleOpWatcher
+	
+	qDebug("TestMsgInit::validateOutboxSenderOperation exit");
+	}
+
+void TestMsgInit::validateOutboxObserver()
+	{
+	qDebug("TestMsgInit::validateOutboxObserver enter");
+	
+	// Observes the OUTBOX for any offline messages...
+	iOutBoxObserver = COutboxObserver::NewL();
+	QVERIFY2(iOutBoxObserver != NULL, "COutboxObserver init failed.");
+	    
+	// Start the Auto-send AO, to handle offline SMS messages
+	iOutBoxObserver->HandleMsvSessionReadyL(*(iTestMsgSimOperation->iMsvSession));
+	//QTest::qWait(1000);
+	
+	if(NULL !=iOutBoxObserver)
+		{
+		delete iOutBoxObserver;
+		iOutBoxObserver = NULL;
+		}
+	qDebug("TestMsgInit::validateOutboxObserver exit");
+	}
+
+ void TestMsgInit::validateSimNumDetector()
+	{
+	qDebug("TestMsgInit::validateSimNumDetector enter");
+	 
+	TInt startupState = 0;
+	TInt modifiedState = ESwStateNormalRfOn;
+	TInt status = 0;
+	
+	//Load current settings
+	CSmsSettings* smsSettings = CSmsSettings::NewLC();
+	CSmsAccount* smsAccount = CSmsAccount::NewLC();
+	smsAccount->LoadSettingsL(*smsSettings);
+
+	// Remove all old SMSC's configured
+	TInt numSCAddresses = smsSettings->ServiceCenterCount();
+
+	qDebug() << "numSCAddresses:" << numSCAddresses;
+
+	for (TInt j = numSCAddresses; j > 0; j--)
+		{
+		smsSettings->RemoveServiceCenter(j - 1);
+		}
+
+	// Save settings
+	TInt maxTries(5);
+	TBool done(EFalse);
+	while (maxTries && !done)
+		{
+		TRAPD( err, smsAccount->SaveSettingsL( *smsSettings ) );
+		if (err == KErrNone)
+			{
+		qDebug("CMsgSimOperation::CreateDefaultSettingsL settings saved");
+
+			done = ETrue;
+			}
+		else if (err == KErrLocked)
+			{
+		qDebug("CMsgSimOperation::CreateDefaultSettingsL KErrLocked");
+
+			// Wait a while and retry.
+			User::After(100000); // 0.1 seconds
+			maxTries--;
+			}
+		else
+			{
+			User::Leave(err);
+			}
+		}
+
+	QVERIFY2((iSimHandler = new MsgSimNumDetector()) != NULL, "Message settings engine init failed.");
+	status = RProperty::Get( KPSUidStartup, KPSGlobalSystemState, startupState );
+	if(ESwStateNormalRfOn != startupState)
+		{
+		RProperty::Set( KPSUidStartup, KPSGlobalSystemState, modifiedState );
+		}
+	qDebug() << "startupState:" << startupState;
+	qDebug() << "modifiedState:" << modifiedState;
+	RProperty::Set(KPSUidStartup, KPSGlobalSystemState, startupState);
+	
+	qDebug() << "startupState:" << startupState;
+	qDebug() << "modifiedState:" << modifiedState;
+	CleanupStack::PopAndDestroy(2); // smsAccount, smsSettings
+	//QTest::qWait(1000);
+	if(NULL !=iSimHandler)
+		{
+		delete iSimHandler;
+		iSimHandler = NULL;
+		}
+	
+	qDebug("TestMsgInit::validateSimNumDetector Exit");
+	}
+ 
+void TestMsgInit::cleanup()
+	{
+	if(NULL !=iTestMsgSimOperation)
+		{
+		delete iTestMsgSimOperation;
+		iTestMsgSimOperation = NULL;
+		}	
+	}
+
+void TestMsgInit::cleanupTestCase()
+	{
+	
+	}
+
+//main entry point
+int main(int argc, char *argv[])
+    { 
+    int ret = -1;
+    QCoreApplication app(argc, argv);
+    QObject* tc = new TestMsgInit();
+    
+#ifdef __WINSCW__	
+		char *new_argv[3]; 
+		QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log";	
+		QByteArray bytes = str.toAscii();	
+		char arg1[] = "-o";	
+		new_argv[0] = argv[0];	
+		new_argv[1] = arg1;	
+		new_argv[2] = bytes.data();	
+		ret = QTest::qExec(tc, 3, new_argv);	
+#else	
+		ret = QTest::qExec(tc, argc, argv);	
+#endif
+	delete tc;
+    return ret;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgsettings/msginit/tsrc/testmsginit/src/testoutboxobserver_stub.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:   Implements the class
+ *
+ */
+
+// INCLUDE FILES
+#include <e32def.h>
+#include <msvids.h>              // Entry Ids
+#include <e32property.h>
+#include <PSVariables.h>
+#include "coutboxsender.h"
+#include "testoutboxobserver_stub.h"
+#include "cmobilesignalstrengthhandler.h"
+#include "debugtraces.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CTestOutboxObserver::CTestOutboxObserver
+// ---------------------------------------------------------
+//
+CTestOutboxObserver::CTestOutboxObserver(){}
+
+// ---------------------------------------------------------
+// CTestOutboxObserver::ConstructL
+// ---------------------------------------------------------
+//
+void CTestOutboxObserver::ConstructL()
+{
+    QDEBUG_WRITE( "CTestOutboxObserver::ConstructL Enter" );
+    // instantiate the signal strength handler
+    iSignalStrengthHandler = CMobileSignalStrengthHandler::NewL();
+
+    if (iSignalStrengthHandler->ObservingSupported()) 
+    {
+        iSignalStrengthHandler->SetSignalStrengthObserverL(this);
+        iSignalStrengthHandler->StartObservingL();
+    }
+    else 
+    {
+        QDEBUG_WRITE( "CTestOutboxObserver::ConstructL else part" );
+    }
+    QDEBUG_WRITE( "CTestOutboxObserver::ConstructL Exit" );
+}
+
+// ---------------------------------------------------------
+// CTestOutboxObserver::NewL
+// ---------------------------------------------------------
+//
+CTestOutboxObserver* CTestOutboxObserver::NewL()
+{
+    // Create the instance of the outbox observer
+    CTestOutboxObserver* self = new (ELeave) CTestOutboxObserver();
+    // Push it to stack while executing the constructor
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+}
+
+// ---------------------------------------------------------
+// CTestOutboxObserver::~CTestOutboxObserver
+// ---------------------------------------------------------
+//
+CTestOutboxObserver::~CTestOutboxObserver()
+{
+    delete iSignalStrengthHandler;
+    EndSessions();
+}
+
+// ---------------------------------------------------------
+// CTestOutboxObserver::SignalStrengthUpdatedL
+// ---------------------------------------------------------
+//
+void CTestOutboxObserver::SignalStrengthAndBarUpdatedL(TInt /*aNewSignalValue*/, TInt aNewBarValue)
+{
+    QDEBUG_WRITE_FORMAT( "CTestOutboxObserver::SignalStrengthUpdatedL - Signal bars ", aNewBarValue );
+    // pass new bar value to outbox sender
+    InformOutboxSenderL(aNewBarValue);
+}
+
+// ---------------------------------------------------------
+// CTestOutboxObserver::InformOutboxSenderL
+// ---------------------------------------------------------
+//
+void CTestOutboxObserver::InformOutboxSenderL(const TInt& aNetworkBars)
+{
+   QDEBUG_WRITE( "CTestOutboxObserver::InformOutboxSenderL" );
+}
+
+// ---------------------------------------------------------
+// CTestOutboxObserver::StartSessionsL
+// ---------------------------------------------------------
+//
+void CTestOutboxObserver::StartSessionsL(CMsvSession& aMsvSession)
+{    
+    QDEBUG_WRITE( "CTestOutboxObserver::StartSessionsL" );
+}
+
+// ---------------------------------------------------------
+// CTestOutboxObserver::EndSessions
+// ---------------------------------------------------------
+//
+void CTestOutboxObserver::EndSessions()
+{
+	 QDEBUG_WRITE( "CTestOutboxObserver::EndSessions" );
+}
+
+// ---------------------------------------------------------
+// CTestOutboxObserver::HandleMsvSessionReadyL
+// ---------------------------------------------------------
+//    
+void CTestOutboxObserver::HandleMsvSessionReadyL(CMsvSession& aMsvSession)
+{
+    StartSessionsL(aMsvSession);
+}
+// ---------------------------------------------------------
+// CTestOutboxObserver::HandleMsvSessionClosedL
+// ---------------------------------------------------------
+//    
+void CTestOutboxObserver::HandleMsvSessionClosedL()
+{
+    EndSessions();
+}
+
+//  End of File
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgsettings/msginit/tsrc/testmsginit/src/testoutboxsender_stub.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:   Implements class
+ *
+ */
+
+// INCLUDE FILES
+
+#include <CoreApplicationUIsSDKCRKeys.h>
+#include <msvuids.h>                 // Entry Uids
+#include "coutboxsendoperation.h"
+#include "testoutboxsender_stub.h"
+#include "debugtraces.h"
+
+// CONSTANTS
+const TInt KListBar0(0);
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ----------------------------------------------------
+//  CTestOutboxSender::NewL
+// ----------------------------------------------------
+//
+CTestOutboxSender* CTestOutboxSender::NewL(CMsvSession& aMsvSession)
+{
+    CTestOutboxSender* self = new (ELeave) CTestOutboxSender(aMsvSession);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+}
+
+// ----------------------------------------------------
+//  CTestOutboxSender::CTestOutboxSender
+// ----------------------------------------------------
+//
+CTestOutboxSender::CTestOutboxSender(CMsvSession& aMsvSession)
+{
+	QDEBUG_WRITE( "CTestOutboxObserver::CTestOutboxSender" );
+}
+
+// ----------------------------------------------------
+//  CTestOutboxSender::~CTestOutboxSender
+// ----------------------------------------------------
+//
+CTestOutboxSender::~CTestOutboxSender()
+{
+	QDEBUG_WRITE( "CTestOutboxObserver::CTestOutboxSender" );
+}
+
+// ----------------------------------------------------
+//  CTestOutboxSender::ConstructL
+// ----------------------------------------------------
+//
+void CTestOutboxSender::ConstructL()
+{
+	QDEBUG_WRITE( "CTestOutboxObserver::ConstructL" );
+}
+
+// ----------------------------------------------------
+//  CTestOutboxSender::StartSendingL
+// ----------------------------------------------------
+//
+void CTestOutboxSender::StartSendingL()
+{
+	QDEBUG_WRITE( "CTestOutboxObserver::ConstructL Enter" );
+}
+
+// ----------------------------------------------------
+//  CTestOutboxSender::CancelSending
+// ----------------------------------------------------
+//
+void CTestOutboxSender::CancelSending()
+{
+	QDEBUG_WRITE( "CTestOutboxObserver::CancelSending" );
+}
+
+// ----------------------------------------------------
+//  CTestOutboxSender::IsSending
+// ----------------------------------------------------
+//
+TBool CTestOutboxSender::IsSending() const
+{
+	QDEBUG_WRITE( "CTestOutboxObserver::IsSending" );
+}
+
+// ----------------------------------------------------
+//  CTestOutboxSender::OpCompleted
+// ----------------------------------------------------
+//
+void CTestOutboxSender::OpCompleted(CMsvSingleOpWatcher& /*aOpWatcher*/, TInt /*aCompletionCode*/)
+{
+	QDEBUG_WRITE( "CTestOutboxObserver::OpCompleted" );
+}
+
+// ----------------------------------------------------
+//  CTestOutboxSender::CheckAndStartSendingL
+// ----------------------------------------------------
+//
+void CTestOutboxSender::CheckAndStartSendingL(const TInt& aNetworkBars)
+{
+	QDEBUG_WRITE( "CTestOutboxObserver::CheckAndStartSendingL" );
+}
+
+// ----------------------------------------------------
+//  CTestOutboxSender::CheckBootPhaseL
+// ----------------------------------------------------
+//
+void CTestOutboxSender::CheckBootPhaseL()
+{
+	QDEBUG_WRITE( "CTestOutboxObserver::CheckBootPhaseL" );
+}
+
+// End of file
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgsettings/msginit/tsrc/testmsginit/src/testsimnumdetector_stub.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *     A class which takes care of reading the possible new
+ *     service centres from SIM and adds them to pda-side Sms Settings.
+ *
+ */
+
+// INCLUDE FILES
+
+#include "coutboxobserver.h"
+#include "testsimnumdetector_stub.h"
+#include "startupmonitor.h"
+#include "debugtraces.h"
+
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+EXPORT_C CTestMsgSimOperation* CTestMsgSimOperation::NewL()
+    {
+    QDEBUG_WRITE("CTestMsgSimOperation::NewL enter")
+
+    CTestMsgSimOperation* self = new (ELeave) CTestMsgSimOperation();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+
+    QDEBUG_WRITE("CTestMsgSimOperation::NewL End")
+    return self;
+    }
+
+
+CTestMsgSimOperation::CTestMsgSimOperation()
+    {
+    }
+
+void CTestMsgSimOperation::ConstructL()
+    {   
+    QDEBUG_WRITE("CTestMsgSimOperation::ConstructL enter")
+
+    // initialise
+    iMsvSession = CMsvSession::OpenSyncL(*this);
+   
+    QDEBUG_WRITE("CTestMsgSimOperation::ConstructL exit")
+    }
+
+CTestMsgSimOperation::~CTestMsgSimOperation()
+    {
+    QDEBUG_WRITE("CTestMsgSimOperation::~CTestMsgSimOperation Enter") 
+    if(NULL != iMsvSession)
+    	{
+		delete iMsvSession;
+		iMsvSession = NULL;
+    	}
+    
+    QDEBUG_WRITE("CTestMsgSimOperation::~CTestMsgSimOperation Exit") 
+    }
+
+void CTestMsgSimOperation::HandleSessionEventL(TMsvSessionEvent aEvent,
+        TAny* /*aArg1*/, TAny* /*aArg2*/,
+        TAny* /*aArg3*/)
+    {
+	QDEBUG_WRITE("CTestMsgSimOperation::HandleSessionEventL Enter") 
+
+	QDEBUG_WRITE("CTestMsgSimOperation::HandleSessionEventL Exit") 
+    }
+
+void CTestMsgSimOperation::HandleStartupReadyL()
+    {
+    QDEBUG_WRITE("CTestMsgSimOperation::HandleStartupReadyL Enter") 
+    // Boot ready, start the real SimOperation
+
+    QDEBUG_WRITE("CTestMsgSimOperation::HandleStartupReadyL Exit") 
+    }
+
+//  End of File  
+
+
--- a/messagingapp/msgsettings/settingsview/src/msgsettingsview.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgsettings/settingsview/src/msgsettingsview.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -66,18 +66,11 @@
 
 MsgSettingsView::~MsgSettingsView()
 {
-    delete mSMSCenterView;
 }
 
 void MsgSettingsView::onNewSMSCCenterClicked(int index)
 {
     //open the sms center views
-    if (mSMSCenterView)
-    {
-        delete mSMSCenterView;
-        mSMSCenterView = NULL;
-    }
-
     mSMSCenterView = new MsgSMSCenterView(index);
 
     connect(mSMSCenterView,
@@ -95,11 +88,16 @@
     //sms center view was directly launched, no need to go back to settings view.
     if(mCurrentView == SMSView)
     {
+        // mSMSCenterView will be deleted by MainWindow. 
         this->navigationAction()->trigger();
         return;
     }
     //remove the view 
     mMainWindow->removeView(mSMSCenterView);
+    // Delete the view since the ownership is transferred to caller.
+    // @see HbMainWindow::removeView()
+    delete mSMSCenterView;
+    mSMSCenterView = NULL;
     
     // This check is needed in case when smsc center view is 
     // launched directly 
--- a/messagingapp/msgui/appengine/inc/conversationsmodel.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/appengine/inc/conversationsmodel.h	Fri Sep 17 08:28:39 2010 +0300
@@ -180,6 +180,14 @@
      */
     void handleVCard(QStandardItem& item, int msgId);
 
+    /*
+     * Get the scaled size from the original image size
+     * @param originalSize, QSize
+     * @param scaledSize, QSize
+     */
+    void getScaledSize(const QSize &originalSize,
+            QSize &scaledSize);
+
 private:
 
     /**
--- a/messagingapp/msgui/appengine/src/conversationmsgstorehandler.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/appengine/src/conversationmsgstorehandler.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -53,9 +53,9 @@
 #define LOC_CLASS_INFORMATIONAL hbTrId("txt_messaging_list_informational")
 #define LOC_CLASS_PERSONAL hbTrId("txt_messaging_list_personal")
 #define LOC_MMS_RETRIEVAL_FAILED hbTrId("txt_messaging_dialog_mms_retrieval_failed")
-#define LOC_MMS_NOTIF_EXPIRED hbTrId("Message Expired !")   //TODO: localization
+#define LOC_MMS_NOTIF_EXPIRED hbTrId("txt_messaging_list_message_expired")  
 #define LOC_MMS_WAITING hbTrId("txt_wireframe_list_multimedia_message_waiting")
-#define LOC_MMS_RETRIEVING hbTrId("Retrieving message...")   //TODO: localization
+#define LOC_MMS_RETRIEVING hbTrId("txt_messaging_list_retrieving_message")   
 #define LOC_MMS_EXPIRY_DATE hbTrId("txt_messaging_list_expiry_date")
 
 // ================= MEMBER FUNCTIONS =======================
--- a/messagingapp/msgui/appengine/src/conversationsmodel.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/appengine/src/conversationsmodel.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -53,8 +53,8 @@
 // preview-cache max cost (items)
 const int CACHE_COST =  50;
 //Preview thumbnail size
-const int KWidth = 9.5 * 6.7;
-const int KHeight = 9.5 * 6.7;
+const int KWidth = 24 * 6.7;
+const int KHeight = 24 * 6.7;
 //---------------------------------------------------------------
 // ConversationsModel::ConversationsModel
 // Constructor
@@ -512,6 +512,12 @@
                                     true);
 
                             }
+                        else
+                            {
+                            QPixmap pixmap;
+                            setPreviewIcon(pixmap, attachmentPath, msgId,
+                                    false);
+                            }
                         //remove bitmap
                         delete bitmap;
                         }
@@ -817,7 +823,12 @@
     if (!inDb)
     {
         QPixmap pixmap(filePath);
-        QPixmap scaledPixmap = pixmap.scaled(KWidth, KHeight, Qt::IgnoreAspectRatio);
+        QSize originalIconSize = pixmap.size();
+        QSize scaledIconSize;
+        getScaledSize(originalIconSize,scaledIconSize);
+
+        QPixmap scaledPixmap = pixmap.scaled(scaledIconSize.width(), 
+                scaledIconSize.height(), Qt::KeepAspectRatio);
         HbIcon *previewIcon = new HbIcon(scaledPixmap);
 
         previewIconCache.insert(msgId, previewIcon);
@@ -935,7 +946,12 @@
     if (!imagePreviewed)
     {
         QPixmap orgPixmap(filePath);
-        pixmap = orgPixmap.scaled(63.65, 63.65, Qt::IgnoreAspectRatio);
+        QSize originalIconSize = pixmap.size();
+        QSize scaledIconSize;
+        getScaledSize(originalIconSize,scaledIconSize);
+
+        QPixmap scaledPixmap = orgPixmap.scaled(scaledIconSize.width(), 
+                scaledIconSize.height(), Qt::KeepAspectRatio);
     }
     HbIcon * previewIcon = new HbIcon(pixmap);
 
@@ -1073,4 +1089,45 @@
 {
     emit conversationViewEmpty();
 }
+
+//---------------------------------------------------------------
+// ConversationsModel::getScaledSize()
+// @see header
+//---------------------------------------------------------------
+void ConversationsModel::getScaledSize(const QSize &originalSize,
+        QSize &scaledSize)
+{
+    qreal newLength =0;
+    if(originalSize.width() >= originalSize.height())
+        {
+        if(originalSize.width() < KWidth)
+            {
+            scaledSize.setHeight(originalSize.height());
+            scaledSize.setWidth(originalSize.width());
+            }
+        else
+            {
+            scaledSize.setWidth(KWidth);
+            newLength = (KWidth * originalSize.height())/
+                    originalSize.width();
+            scaledSize.setHeight(newLength);
+            }
+        }
+    else
+        {
+        if(originalSize.height() < KHeight)
+            {
+            scaledSize.setHeight(originalSize.height());
+            scaledSize.setWidth(originalSize.width());
+            }
+        else
+            {
+            scaledSize.setHeight(KHeight);
+            newLength = (KHeight * originalSize.width())/
+                    originalSize.height();
+            scaledSize.setWidth(newLength);
+            }            
+        }
+}
+
 //EOF
--- a/messagingapp/msgui/bwins/conversationviewu.def	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/bwins/conversationviewu.def	Fri Sep 17 08:28:39 2010 +0300
@@ -2,28 +2,29 @@
 	?qt_metacast@MsgConversationBaseView@@UAEPAXPBD@Z @ 1 NONAME ; void * MsgConversationBaseView::qt_metacast(char const *)
 	?metaObject@MsgConversationBaseView@@UBEPBUQMetaObject@@XZ @ 2 NONAME ; struct QMetaObject const * MsgConversationBaseView::metaObject(void) const
 	?handleConversationIdChange@MsgConversationBaseView@@AAEX_J@Z @ 3 NONAME ; void MsgConversationBaseView::handleConversationIdChange(long long)
-	?closeConversationView@MsgConversationBaseView@@QAEXXZ @ 4 NONAME ; void MsgConversationBaseView::closeConversationView(void)
-	?trUtf8@MsgConversationBaseView@@SA?AVQString@@PBD0H@Z @ 5 NONAME ; class QString MsgConversationBaseView::trUtf8(char const *, char const *, int)
-	?handleError@MsgConversationBaseView@@AAEXHABVQString@@@Z @ 6 NONAME ; void MsgConversationBaseView::handleError(int, class QString const &)
-	?tr@MsgConversationBaseView@@SA?AVQString@@PBD0H@Z @ 7 NONAME ; class QString MsgConversationBaseView::tr(char const *, char const *, int)
-	?hideChrome@MsgConversationBaseView@@AAEX_N@Z @ 8 NONAME ; void MsgConversationBaseView::hideChrome(bool)
-	??0MsgConversationBaseView@@QAE@PAVQGraphicsItem@@@Z @ 9 NONAME ; MsgConversationBaseView::MsgConversationBaseView(class QGraphicsItem *)
-	?handleOk@MsgConversationBaseView@@AAEXABVQVariant@@@Z @ 10 NONAME ; void MsgConversationBaseView::handleOk(class QVariant const &)
-	?trUtf8@MsgConversationBaseView@@SA?AVQString@@PBD0@Z @ 11 NONAME ; class QString MsgConversationBaseView::trUtf8(char const *, char const *)
-	?saveContentToDrafts@MsgConversationBaseView@@QAEHXZ @ 12 NONAME ; int MsgConversationBaseView::saveContentToDrafts(void)
-	?setPSCVId@MsgConversationBaseView@@QAEX_N@Z @ 13 NONAME ; void MsgConversationBaseView::setPSCVId(bool)
-	?doDelayedConstruction@MsgConversationBaseView@@AAEXXZ @ 14 NONAME ; void MsgConversationBaseView::doDelayedConstruction(void)
-	?openConversation@MsgConversationBaseView@@QAEX_J@Z @ 15 NONAME ; void MsgConversationBaseView::openConversation(long long)
-	?conversationId@MsgConversationBaseView@@QAE_JXZ @ 16 NONAME ; long long MsgConversationBaseView::conversationId(void)
-	?staticMetaObject@MsgConversationBaseView@@2UQMetaObject@@B @ 17 NONAME ; struct QMetaObject const MsgConversationBaseView::staticMetaObject
-	?conversationViewClosed@MsgConversationBaseView@@IAEXXZ @ 18 NONAME ; void MsgConversationBaseView::conversationViewClosed(void)
-	?initView@MsgConversationBaseView@@AAEXXZ @ 19 NONAME ; void MsgConversationBaseView::initView(void)
-	?markMessagesAsRead@MsgConversationBaseView@@QAEXXZ @ 20 NONAME ; void MsgConversationBaseView::markMessagesAsRead(void)
-	?tr@MsgConversationBaseView@@SA?AVQString@@PBD0@Z @ 21 NONAME ; class QString MsgConversationBaseView::tr(char const *, char const *)
-	?qt_metacall@MsgConversationBaseView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 22 NONAME ; int MsgConversationBaseView::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?getStaticMetaObject@MsgConversationBaseView@@SAABUQMetaObject@@XZ @ 23 NONAME ; struct QMetaObject const & MsgConversationBaseView::getStaticMetaObject(void)
-	??1MsgConversationBaseView@@UAE@XZ @ 24 NONAME ; MsgConversationBaseView::~MsgConversationBaseView(void)
-	?handleViewReady@MsgConversationBaseView@@AAEXXZ @ 25 NONAME ; void MsgConversationBaseView::handleViewReady(void)
-	??_EMsgConversationBaseView@@UAE@I@Z @ 26 NONAME ; MsgConversationBaseView::~MsgConversationBaseView(unsigned int)
-	?clearContent@MsgConversationBaseView@@QAEXXZ @ 27 NONAME ; void MsgConversationBaseView::clearContent(void)
+	?handleKeyEvent@MsgConversationBaseView@@UAE_NH@Z @ 4 NONAME ; bool MsgConversationBaseView::handleKeyEvent(int)
+	?closeConversationView@MsgConversationBaseView@@QAEXXZ @ 5 NONAME ; void MsgConversationBaseView::closeConversationView(void)
+	?trUtf8@MsgConversationBaseView@@SA?AVQString@@PBD0H@Z @ 6 NONAME ; class QString MsgConversationBaseView::trUtf8(char const *, char const *, int)
+	?handleError@MsgConversationBaseView@@AAEXHABVQString@@@Z @ 7 NONAME ; void MsgConversationBaseView::handleError(int, class QString const &)
+	?tr@MsgConversationBaseView@@SA?AVQString@@PBD0H@Z @ 8 NONAME ; class QString MsgConversationBaseView::tr(char const *, char const *, int)
+	?hideChrome@MsgConversationBaseView@@AAEX_N@Z @ 9 NONAME ; void MsgConversationBaseView::hideChrome(bool)
+	??0MsgConversationBaseView@@QAE@PAVQGraphicsItem@@@Z @ 10 NONAME ; MsgConversationBaseView::MsgConversationBaseView(class QGraphicsItem *)
+	?handleOk@MsgConversationBaseView@@AAEXABVQVariant@@@Z @ 11 NONAME ; void MsgConversationBaseView::handleOk(class QVariant const &)
+	?trUtf8@MsgConversationBaseView@@SA?AVQString@@PBD0@Z @ 12 NONAME ; class QString MsgConversationBaseView::trUtf8(char const *, char const *)
+	?saveContentToDrafts@MsgConversationBaseView@@QAEHXZ @ 13 NONAME ; int MsgConversationBaseView::saveContentToDrafts(void)
+	?setPSCVId@MsgConversationBaseView@@QAEX_N@Z @ 14 NONAME ; void MsgConversationBaseView::setPSCVId(bool)
+	?doDelayedConstruction@MsgConversationBaseView@@AAEXXZ @ 15 NONAME ; void MsgConversationBaseView::doDelayedConstruction(void)
+	?openConversation@MsgConversationBaseView@@QAEX_J@Z @ 16 NONAME ; void MsgConversationBaseView::openConversation(long long)
+	?conversationId@MsgConversationBaseView@@QAE_JXZ @ 17 NONAME ; long long MsgConversationBaseView::conversationId(void)
+	?staticMetaObject@MsgConversationBaseView@@2UQMetaObject@@B @ 18 NONAME ; struct QMetaObject const MsgConversationBaseView::staticMetaObject
+	?conversationViewClosed@MsgConversationBaseView@@IAEXXZ @ 19 NONAME ; void MsgConversationBaseView::conversationViewClosed(void)
+	?initView@MsgConversationBaseView@@AAEXXZ @ 20 NONAME ; void MsgConversationBaseView::initView(void)
+	?markMessagesAsRead@MsgConversationBaseView@@QAEXXZ @ 21 NONAME ; void MsgConversationBaseView::markMessagesAsRead(void)
+	?tr@MsgConversationBaseView@@SA?AVQString@@PBD0@Z @ 22 NONAME ; class QString MsgConversationBaseView::tr(char const *, char const *)
+	?qt_metacall@MsgConversationBaseView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 23 NONAME ; int MsgConversationBaseView::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?getStaticMetaObject@MsgConversationBaseView@@SAABUQMetaObject@@XZ @ 24 NONAME ; struct QMetaObject const & MsgConversationBaseView::getStaticMetaObject(void)
+	??1MsgConversationBaseView@@UAE@XZ @ 25 NONAME ; MsgConversationBaseView::~MsgConversationBaseView(void)
+	?handleViewReady@MsgConversationBaseView@@AAEXXZ @ 26 NONAME ; void MsgConversationBaseView::handleViewReady(void)
+	??_EMsgConversationBaseView@@UAE@I@Z @ 27 NONAME ; MsgConversationBaseView::~MsgConversationBaseView(unsigned int)
+	?clearContent@MsgConversationBaseView@@QAEXXZ @ 28 NONAME ; void MsgConversationBaseView::clearContent(void)
 
--- a/messagingapp/msgui/bwins/msgaudiofetcheru.def	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/bwins/msgaudiofetcheru.def	Fri Sep 17 08:28:39 2010 +0300
@@ -1,20 +1,23 @@
 EXPORTS
-	?metaObject@MsgAudioFetcherView@@UBEPBUQMetaObject@@XZ @ 1 NONAME ; struct QMetaObject const * MsgAudioFetcherView::metaObject(void) const
-	?enableToolBar@MsgAudioFetcherView@@AAEX_N@Z @ 2 NONAME ; void MsgAudioFetcherView::enableToolBar(bool)
-	??1MsgAudioFetcherView@@UAE@XZ @ 3 NONAME ; MsgAudioFetcherView::~MsgAudioFetcherView(void)
-	?staticMetaObject@MsgAudioFetcherView@@2UQMetaObject@@B @ 4 NONAME ; struct QMetaObject const MsgAudioFetcherView::staticMetaObject
-	??_EMsgAudioFetcherView@@UAE@I@Z @ 5 NONAME ; MsgAudioFetcherView::~MsgAudioFetcherView(unsigned int)
-	?trUtf8@MsgAudioFetcherView@@SA?AVQString@@PBD0@Z @ 6 NONAME ; class QString MsgAudioFetcherView::trUtf8(char const *, char const *)
-	?removeToolBarAction@MsgAudioFetcherView@@AAEXXZ @ 7 NONAME ; void MsgAudioFetcherView::removeToolBarAction(void)
-	?qt_metacall@MsgAudioFetcherView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 8 NONAME ; int MsgAudioFetcherView::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?initMainWidget@MsgAudioFetcherView@@AAEXXZ @ 9 NONAME ; void MsgAudioFetcherView::initMainWidget(void)
-	?trUtf8@MsgAudioFetcherView@@SA?AVQString@@PBD0H@Z @ 10 NONAME ; class QString MsgAudioFetcherView::trUtf8(char const *, char const *, int)
-	?tr@MsgAudioFetcherView@@SA?AVQString@@PBD0H@Z @ 11 NONAME ; class QString MsgAudioFetcherView::tr(char const *, char const *, int)
-	?on_rightAction_triggered@MsgAudioFetcherView@@AAEXXZ @ 12 NONAME ; void MsgAudioFetcherView::on_rightAction_triggered(void)
-	??0MsgAudioFetcherView@@QAE@ABV?$QList@VQVariant@@@@@Z @ 13 NONAME ; MsgAudioFetcherView::MsgAudioFetcherView(class QList<class QVariant> const &)
-	?initToolBar@MsgAudioFetcherView@@AAEXXZ @ 14 NONAME ; void MsgAudioFetcherView::initToolBar(void)
-	?tr@MsgAudioFetcherView@@SA?AVQString@@PBD0@Z @ 15 NONAME ; class QString MsgAudioFetcherView::tr(char const *, char const *)
-	?qt_metacast@MsgAudioFetcherView@@UAEPAXPBD@Z @ 16 NONAME ; void * MsgAudioFetcherView::qt_metacast(char const *)
-	?getStaticMetaObject@MsgAudioFetcherView@@SAABUQMetaObject@@XZ @ 17 NONAME ; struct QMetaObject const & MsgAudioFetcherView::getStaticMetaObject(void)
-	?on_leftAction_triggered@MsgAudioFetcherView@@AAEXXZ @ 18 NONAME ; void MsgAudioFetcherView::on_leftAction_triggered(void)
+	?qt_metacast@MsgAudioFetcherDialog@@UAEPAXPBD@Z @ 1 NONAME ; void * MsgAudioFetcherDialog::qt_metacast(char const *)
+	?onSelectAction@MsgAudioFetcherDialog@@AAEXXZ @ 2 NONAME ; void MsgAudioFetcherDialog::onSelectAction(void)
+	?onCancelAction@MsgAudioFetcherDialog@@AAEXXZ @ 3 NONAME ; void MsgAudioFetcherDialog::onCancelAction(void)
+	?getCurrentItemPath@MsgAudioFetcherDialog@@AAE?AVQString@@XZ @ 4 NONAME ; class QString MsgAudioFetcherDialog::getCurrentItemPath(void)
+	?trUtf8@MsgAudioFetcherDialog@@SA?AVQString@@PBD0@Z @ 5 NONAME ; class QString MsgAudioFetcherDialog::trUtf8(char const *, char const *)
+	?metaObject@MsgAudioFetcherDialog@@UBEPBUQMetaObject@@XZ @ 6 NONAME ; struct QMetaObject const * MsgAudioFetcherDialog::metaObject(void) const
+	??0MsgAudioFetcherDialog@@QAE@PAVQGraphicsItem@@@Z @ 7 NONAME ; MsgAudioFetcherDialog::MsgAudioFetcherDialog(class QGraphicsItem *)
+	?audioSelected@MsgAudioFetcherDialog@@IAEXAAVQString@@@Z @ 8 NONAME ; void MsgAudioFetcherDialog::audioSelected(class QString &)
+	?reset@MsgAudioFetcherDialog@@AAEXXZ @ 9 NONAME ; void MsgAudioFetcherDialog::reset(void)
+	?initActions@MsgAudioFetcherDialog@@AAEXXZ @ 10 NONAME ; void MsgAudioFetcherDialog::initActions(void)
+	?on_list_activated@MsgAudioFetcherDialog@@AAEXABVQModelIndex@@@Z @ 11 NONAME ; void MsgAudioFetcherDialog::on_list_activated(class QModelIndex const &)
+	?trUtf8@MsgAudioFetcherDialog@@SA?AVQString@@PBD0H@Z @ 12 NONAME ; class QString MsgAudioFetcherDialog::trUtf8(char const *, char const *, int)
+	?staticMetaObject@MsgAudioFetcherDialog@@2UQMetaObject@@B @ 13 NONAME ; struct QMetaObject const MsgAudioFetcherDialog::staticMetaObject
+	??1MsgAudioFetcherDialog@@UAE@XZ @ 14 NONAME ; MsgAudioFetcherDialog::~MsgAudioFetcherDialog(void)
+	?initMainWidget@MsgAudioFetcherDialog@@AAEXXZ @ 15 NONAME ; void MsgAudioFetcherDialog::initMainWidget(void)
+	?qt_metacall@MsgAudioFetcherDialog@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 16 NONAME ; int MsgAudioFetcherDialog::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?doDelayedConstruction@MsgAudioFetcherDialog@@AAEXXZ @ 17 NONAME ; void MsgAudioFetcherDialog::doDelayedConstruction(void)
+	?tr@MsgAudioFetcherDialog@@SA?AVQString@@PBD0@Z @ 18 NONAME ; class QString MsgAudioFetcherDialog::tr(char const *, char const *)
+	?getStaticMetaObject@MsgAudioFetcherDialog@@SAABUQMetaObject@@XZ @ 19 NONAME ; struct QMetaObject const & MsgAudioFetcherDialog::getStaticMetaObject(void)
+	??_EMsgAudioFetcherDialog@@UAE@I@Z @ 20 NONAME ; MsgAudioFetcherDialog::~MsgAudioFetcherDialog(unsigned int)
+	?tr@MsgAudioFetcherDialog@@SA?AVQString@@PBD0H@Z @ 21 NONAME ; class QString MsgAudioFetcherDialog::tr(char const *, char const *, int)
 
--- a/messagingapp/msgui/bwins/unifiededitoru.def	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/bwins/unifiededitoru.def	Fri Sep 17 08:28:39 2010 +0300
@@ -1,64 +1,69 @@
 EXPORTS
-	?fetchAudio@MsgUnifiedEditorView@@AAEXXZ @ 1 NONAME ; void MsgUnifiedEditorView::fetchAudio(void)
-	??0CUniImageProcessor@@QAE@PAVMUniImageProcessorCallback@@@Z @ 2 NONAME ; CUniImageProcessor::CUniImageProcessor(class MUniImageProcessorCallback *)
-	?changePriority@MsgUnifiedEditorView@@AAEXXZ @ 3 NONAME ; void MsgUnifiedEditorView::changePriority(void)
-	?updateOtherRecipientCount@MsgUnifiedEditorView@@AAEX_N@Z @ 4 NONAME ; void MsgUnifiedEditorView::updateOtherRecipientCount(bool)
-	?qt_metacall@MsgUnifiedEditorView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 5 NONAME ; int MsgUnifiedEditorView::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?fetchImages@MsgUnifiedEditorView@@AAEXXZ @ 6 NONAME ; void MsgUnifiedEditorView::fetchImages(void)
-	?packMessage@MsgUnifiedEditorView@@AAEXAAVConvergedMessage@@_N@Z @ 7 NONAME ; void MsgUnifiedEditorView::packMessage(class ConvergedMessage &, bool)
-	?handleViewExtnActivated@MsgUnifiedEditorView@@AAEXPAVHbListWidgetItem@@@Z @ 8 NONAME ; void MsgUnifiedEditorView::handleViewExtnActivated(class HbListWidgetItem *)
-	?addAttachment@MsgUnifiedEditorView@@AAEHABVQString@@@Z @ 9 NONAME ; int MsgUnifiedEditorView::addAttachment(class QString const &)
-	?doDelayedConstruction@MsgUnifiedEditorView@@AAEXXZ @ 10 NONAME ; void MsgUnifiedEditorView::doDelayedConstruction(void)
-	?fetchMessageFromStore@MsgUnifiedEditorView@@AAEXAAVConvergedMessageId@@W4MessageType@ConvergedMessage@@H@Z @ 11 NONAME ; void MsgUnifiedEditorView::fetchMessageFromStore(class ConvergedMessageId &, enum ConvergedMessage::MessageType, int)
-	?onContentChanged@MsgUnifiedEditorView@@AAEXXZ @ 12 NONAME ; void MsgUnifiedEditorView::onContentChanged(void)
-	?staticMetaObject@MsgUnifiedEditorView@@2UQMetaObject@@B @ 13 NONAME ; struct QMetaObject const MsgUnifiedEditorView::staticMetaObject
-	?activateInputBlocker@MsgUnifiedEditorView@@AAEXXZ @ 14 NONAME ; void MsgUnifiedEditorView::activateInputBlocker(void)
-	?resizeEvent@MsgUnifiedEditorView@@MAEXPAVQGraphicsSceneResizeEvent@@@Z @ 15 NONAME ; void MsgUnifiedEditorView::resizeEvent(class QGraphicsSceneResizeEvent *)
-	?ScaleImageL@CUniImageProcessor@@QAEXPAVCFbsBitmap@@0H@Z @ 16 NONAME ; void CUniImageProcessor::ScaleImageL(class CFbsBitmap *, class CFbsBitmap *, int)
-	?onDialogSmsSettings@MsgUnifiedEditorView@@AAEXPAVHbAction@@@Z @ 17 NONAME ; void MsgUnifiedEditorView::onDialogSmsSettings(class HbAction *)
-	?populateContent@MsgUnifiedEditorView@@QAEXABV?$QList@VQVariant@@@@@Z @ 18 NONAME ; void MsgUnifiedEditorView::populateContent(class QList<class QVariant> const &)
-	?onDialogMmsSettings@MsgUnifiedEditorView@@AAEXPAVHbAction@@@Z @ 19 NONAME ; void MsgUnifiedEditorView::onDialogMmsSettings(class HbAction *)
-	?addCcBcc@MsgUnifiedEditorView@@AAEXXZ @ 20 NONAME ; void MsgUnifiedEditorView::addCcBcc(void)
-	?saveContentToDrafts@MsgUnifiedEditorView@@QAEHXZ @ 21 NONAME ; int MsgUnifiedEditorView::saveContentToDrafts(void)
-	?ProcessImageL@CUniImageProcessor@@QAEXAAVRFile@@0AAVTSize@@ABVTDesC8@@HH@Z @ 22 NONAME ; void CUniImageProcessor::ProcessImageL(class RFile &, class RFile &, class TSize &, class TDesC8 const &, int, int)
-	?generateFileName@MsgUnifiedEditorView@@AAE?AVQString@@AAV2@@Z @ 23 NONAME ; class QString MsgUnifiedEditorView::generateFileName(class QString &)
-	?metaObject@MsgUnifiedEditorView@@UBEPBUQMetaObject@@XZ @ 24 NONAME ; struct QMetaObject const * MsgUnifiedEditorView::metaObject(void) const
-	?createVCards@MsgUnifiedEditorView@@AAEHABVQVariant@@AAVQStringList@@@Z @ 25 NONAME ; int MsgUnifiedEditorView::createVCards(class QVariant const &, class QStringList &)
-	?addSubject@MsgUnifiedEditorView@@AAEXXZ @ 26 NONAME ; void MsgUnifiedEditorView::addSubject(void)
-	?createTempFolder@MsgUnifiedEditorView@@AAE_NXZ @ 27 NONAME ; bool MsgUnifiedEditorView::createTempFolder(void)
-	?imagesFetched@MsgUnifiedEditorView@@AAEXABVQVariant@@@Z @ 28 NONAME ; void MsgUnifiedEditorView::imagesFetched(class QVariant const &)
-	?setFocus@MsgUnifiedEditorView@@AAEXPAVMsgUnifiedEditorBaseWidget@@@Z @ 29 NONAME ; void MsgUnifiedEditorView::setFocus(class MsgUnifiedEditorBaseWidget *)
-	?vkbClosed@MsgUnifiedEditorView@@AAEXXZ @ 30 NONAME ; void MsgUnifiedEditorView::vkbClosed(void)
-	?serviceRequestError@MsgUnifiedEditorView@@AAEXHABVQString@@@Z @ 31 NONAME ; void MsgUnifiedEditorView::serviceRequestError(int, class QString const &)
-	?qt_metacast@MsgUnifiedEditorView@@UAEPAXPBD@Z @ 32 NONAME ; void * MsgUnifiedEditorView::qt_metacast(char const *)
-	?removeTempFolder@MsgUnifiedEditorView@@AAEXXZ @ 33 NONAME ; void MsgUnifiedEditorView::removeTempFolder(void)
-	?vkbOpened@MsgUnifiedEditorView@@AAEXXZ @ 34 NONAME ; void MsgUnifiedEditorView::vkbOpened(void)
-	?ScaleImageL@CUniImageProcessor@@QAEXAAVRFile@@AAPAVCFbsBitmap@@1AAVTSize@@H@Z @ 35 NONAME ; void CUniImageProcessor::ScaleImageL(class RFile &, class CFbsBitmap * &, class CFbsBitmap * &, class TSize &, int)
-	?addMenu@MsgUnifiedEditorView@@AAEXXZ @ 36 NONAME ; void MsgUnifiedEditorView::addMenu(void)
-	?enableSendButton@MsgUnifiedEditorView@@AAEX_N@Z @ 37 NONAME ; void MsgUnifiedEditorView::enableSendButton(bool)
-	?initView@MsgUnifiedEditorView@@AAEXXZ @ 38 NONAME ; void MsgUnifiedEditorView::initView(void)
-	??_EMsgUnifiedEditorView@@UAE@I@Z @ 39 NONAME ; MsgUnifiedEditorView::~MsgUnifiedEditorView(unsigned int)
-	??1MsgUnifiedEditorView@@UAE@XZ @ 40 NONAME ; MsgUnifiedEditorView::~MsgUnifiedEditorView(void)
-	?setAttachOptionEnabled@MsgUnifiedEditorView@@AAEXW4TBE_AttachOption@1@_N@Z @ 41 NONAME ; void MsgUnifiedEditorView::setAttachOptionEnabled(enum MsgUnifiedEditorView::TBE_AttachOption, bool)
-	?hideChrome@MsgUnifiedEditorView@@AAEX_N@Z @ 42 NONAME ; void MsgUnifiedEditorView::hideChrome(bool)
-	?trUtf8@MsgUnifiedEditorView@@SA?AVQString@@PBD0@Z @ 43 NONAME ; class QString MsgUnifiedEditorView::trUtf8(char const *, char const *)
-	?tr@MsgUnifiedEditorView@@SA?AVQString@@PBD0@Z @ 44 NONAME ; class QString MsgUnifiedEditorView::tr(char const *, char const *)
-	?ScaleImageL@CUniImageProcessor@@QAEXPAVCFbsBitmap@@AAVRFile@@ABVTSize@@ABVTDesC8@@H@Z @ 45 NONAME ; void CUniImageProcessor::ScaleImageL(class CFbsBitmap *, class RFile &, class TSize const &, class TDesC8 const &, int)
-	?getStaticMetaObject@MsgUnifiedEditorView@@SAABUQMetaObject@@XZ @ 46 NONAME ; struct QMetaObject const & MsgUnifiedEditorView::getStaticMetaObject(void)
-	?tr@MsgUnifiedEditorView@@SA?AVQString@@PBD0H@Z @ 47 NONAME ; class QString MsgUnifiedEditorView::tr(char const *, char const *, int)
-	?send@MsgUnifiedEditorView@@AAEXXZ @ 48 NONAME ; void MsgUnifiedEditorView::send(void)
-	?Reset@CUniImageProcessor@@QAEXXZ @ 49 NONAME ; void CUniImageProcessor::Reset(void)
-	?populateContentIntoEditor@MsgUnifiedEditorView@@AAEXABVConvergedMessage@@_N@Z @ 50 NONAME ; void MsgUnifiedEditorView::populateContentIntoEditor(class ConvergedMessage const &, bool)
-	?openDraftsMessage@MsgUnifiedEditorView@@QAEXABV?$QList@VQVariant@@@@@Z @ 51 NONAME ; void MsgUnifiedEditorView::openDraftsMessage(class QList<class QVariant> const &)
-	?addToolBar@MsgUnifiedEditorView@@AAEXXZ @ 52 NONAME ; void MsgUnifiedEditorView::addToolBar(void)
-	?contactsFetched@MsgUnifiedEditorView@@AAEXABVQVariant@@@Z @ 53 NONAME ; void MsgUnifiedEditorView::contactsFetched(class QVariant const &)
-	?removeAttachmentContainer@MsgUnifiedEditorView@@AAEXXZ @ 54 NONAME ; void MsgUnifiedEditorView::removeAttachmentContainer(void)
-	?trUtf8@MsgUnifiedEditorView@@SA?AVQString@@PBD0H@Z @ 55 NONAME ; class QString MsgUnifiedEditorView::trUtf8(char const *, char const *, int)
-	?onDialogDeleteMsg@MsgUnifiedEditorView@@AAEXPAVHbAction@@@Z @ 56 NONAME ; void MsgUnifiedEditorView::onDialogDeleteMsg(class HbAction *)
-	??0MsgUnifiedEditorView@@QAE@PAVQGraphicsItem@@@Z @ 57 NONAME ; MsgUnifiedEditorView::MsgUnifiedEditorView(class QGraphicsItem *)
-	?fetchContacts@MsgUnifiedEditorView@@AAEXXZ @ 58 NONAME ; void MsgUnifiedEditorView::fetchContacts(void)
-	?formatAddresses@MsgUnifiedEditorView@@AAEXAAV?$QList@PAVConvergedMessageAddress@@@@@Z @ 59 NONAME ; void MsgUnifiedEditorView::formatAddresses(class QList<class ConvergedMessageAddress *> &)
-	?deleteMessage@MsgUnifiedEditorView@@AAEXXZ @ 60 NONAME ; void MsgUnifiedEditorView::deleteMessage(void)
-	?addAttachments@MsgUnifiedEditorView@@AAEXVQStringList@@@Z @ 61 NONAME ; void MsgUnifiedEditorView::addAttachments(class QStringList)
-	?deactivateInputBlocker@MsgUnifiedEditorView@@AAEXXZ @ 62 NONAME ; void MsgUnifiedEditorView::deactivateInputBlocker(void)
+	?fetchImages@MsgUnifiedEditorView@@AAEXXZ @ 1 NONAME ; void MsgUnifiedEditorView::fetchImages(void)
+	?handleViewExtnActivated@MsgUnifiedEditorView@@AAEXPAVHbListWidgetItem@@@Z @ 2 NONAME ; void MsgUnifiedEditorView::handleViewExtnActivated(class HbListWidgetItem *)
+	?fetchMessageFromStore@MsgUnifiedEditorView@@AAEXAAVConvergedMessageId@@W4MessageType@ConvergedMessage@@H@Z @ 3 NONAME ; void MsgUnifiedEditorView::fetchMessageFromStore(class ConvergedMessageId &, enum ConvergedMessage::MessageType, int)
+	?onContentChanged@MsgUnifiedEditorView@@AAEXXZ @ 4 NONAME ; void MsgUnifiedEditorView::onContentChanged(void)
+	?staticMetaObject@MsgUnifiedEditorView@@2UQMetaObject@@B @ 5 NONAME ; struct QMetaObject const MsgUnifiedEditorView::staticMetaObject
+	?resizeEvent@MsgUnifiedEditorView@@MAEXPAVQGraphicsSceneResizeEvent@@@Z @ 6 NONAME ; void MsgUnifiedEditorView::resizeEvent(class QGraphicsSceneResizeEvent *)
+	?ScaleImageL@CUniImageProcessor@@QAEXPAVCFbsBitmap@@0H@Z @ 7 NONAME ; void CUniImageProcessor::ScaleImageL(class CFbsBitmap *, class CFbsBitmap *, int)
+	?vkbAboutToClose@MsgUnifiedEditorView@@AAEXXZ @ 8 NONAME ; void MsgUnifiedEditorView::vkbAboutToClose(void)
+	?onDialogSmsSettings@MsgUnifiedEditorView@@AAEXPAVHbAction@@@Z @ 9 NONAME ; void MsgUnifiedEditorView::onDialogSmsSettings(class HbAction *)
+	?addCcBcc@MsgUnifiedEditorView@@AAEXXZ @ 10 NONAME ; void MsgUnifiedEditorView::addCcBcc(void)
+	?saveContentToDrafts@MsgUnifiedEditorView@@QAEHXZ @ 11 NONAME ; int MsgUnifiedEditorView::saveContentToDrafts(void)
+	?generateFileName@MsgUnifiedEditorView@@AAE?AVQString@@AAV2@@Z @ 12 NONAME ; class QString MsgUnifiedEditorView::generateFileName(class QString &)
+	?createVCards@MsgUnifiedEditorView@@AAEHABVQVariant@@AAVQStringList@@@Z @ 13 NONAME ; int MsgUnifiedEditorView::createVCards(class QVariant const &, class QStringList &)
+	?addSubject@MsgUnifiedEditorView@@AAEXXZ @ 14 NONAME ; void MsgUnifiedEditorView::addSubject(void)
+	?createTempFolder@MsgUnifiedEditorView@@AAE_NXZ @ 15 NONAME ; bool MsgUnifiedEditorView::createTempFolder(void)
+	?imagesFetched@MsgUnifiedEditorView@@AAEXABVQVariant@@@Z @ 16 NONAME ; void MsgUnifiedEditorView::imagesFetched(class QVariant const &)
+	?setFocus@MsgUnifiedEditorView@@AAEXPAVMsgUnifiedEditorBaseWidget@@@Z @ 17 NONAME ; void MsgUnifiedEditorView::setFocus(class MsgUnifiedEditorBaseWidget *)
+	?serviceRequestError@MsgUnifiedEditorView@@AAEXHABVQString@@@Z @ 18 NONAME ; void MsgUnifiedEditorView::serviceRequestError(int, class QString const &)
+	?isReplyPathBroken@MsgUnifiedEditorView@@AAE_NXZ @ 19 NONAME ; bool MsgUnifiedEditorView::isReplyPathBroken(void)
+	?removeTempFolder@MsgUnifiedEditorView@@AAEXXZ @ 20 NONAME ; void MsgUnifiedEditorView::removeTempFolder(void)
+	?vkbOpened@MsgUnifiedEditorView@@AAEXXZ @ 21 NONAME ; void MsgUnifiedEditorView::vkbOpened(void)
+	?addMenu@MsgUnifiedEditorView@@AAEXXZ @ 22 NONAME ; void MsgUnifiedEditorView::addMenu(void)
+	??_EMsgUnifiedEditorView@@UAE@I@Z @ 23 NONAME ; MsgUnifiedEditorView::~MsgUnifiedEditorView(unsigned int)
+	?setAttachOptionEnabled@MsgUnifiedEditorView@@AAEXW4TBE_AttachOption@1@_N@Z @ 24 NONAME ; void MsgUnifiedEditorView::setAttachOptionEnabled(enum MsgUnifiedEditorView::TBE_AttachOption, bool)
+	?ScaleImageL@CUniImageProcessor@@QAEXPAVCFbsBitmap@@AAVRFile@@ABVTSize@@ABVTDesC8@@H@Z @ 25 NONAME ; void CUniImageProcessor::ScaleImageL(class CFbsBitmap *, class RFile &, class TSize const &, class TDesC8 const &, int)
+	?send@MsgUnifiedEditorView@@AAEXXZ @ 26 NONAME ; void MsgUnifiedEditorView::send(void)
+	?populateContentIntoEditor@MsgUnifiedEditorView@@AAEXABVConvergedMessage@@_N@Z @ 27 NONAME ; void MsgUnifiedEditorView::populateContentIntoEditor(class ConvergedMessage const &, bool)
+	?addToolBar@MsgUnifiedEditorView@@AAEXXZ @ 28 NONAME ; void MsgUnifiedEditorView::addToolBar(void)
+	?onDialogDeleteMsg@MsgUnifiedEditorView@@AAEXPAVHbAction@@@Z @ 29 NONAME ; void MsgUnifiedEditorView::onDialogDeleteMsg(class HbAction *)
+	?onAudioSelected@MsgUnifiedEditorView@@AAEXAAVQString@@@Z @ 30 NONAME ; void MsgUnifiedEditorView::onAudioSelected(class QString &)
+	?fetchContacts@MsgUnifiedEditorView@@AAEXXZ @ 31 NONAME ; void MsgUnifiedEditorView::fetchContacts(void)
+	?formatAddresses@MsgUnifiedEditorView@@AAEXAAV?$QList@PAVConvergedMessageAddress@@@@@Z @ 32 NONAME ; void MsgUnifiedEditorView::formatAddresses(class QList<class ConvergedMessageAddress *> &)
+	?addAttachments@MsgUnifiedEditorView@@AAEXVQStringList@@@Z @ 33 NONAME ; void MsgUnifiedEditorView::addAttachments(class QStringList)
+	??0CUniImageProcessor@@QAE@PAVMUniImageProcessorCallback@@@Z @ 34 NONAME ; CUniImageProcessor::CUniImageProcessor(class MUniImageProcessorCallback *)
+	?fetchAudio@MsgUnifiedEditorView@@AAEXXZ @ 35 NONAME ; void MsgUnifiedEditorView::fetchAudio(void)
+	?changePriority@MsgUnifiedEditorView@@AAEXXZ @ 36 NONAME ; void MsgUnifiedEditorView::changePriority(void)
+	?qt_metacall@MsgUnifiedEditorView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 37 NONAME ; int MsgUnifiedEditorView::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?updateOtherRecipientCount@MsgUnifiedEditorView@@AAEX_N@Z @ 38 NONAME ; void MsgUnifiedEditorView::updateOtherRecipientCount(bool)
+	?addAttachment@MsgUnifiedEditorView@@AAEHABVQString@@@Z @ 39 NONAME ; int MsgUnifiedEditorView::addAttachment(class QString const &)
+	?vkbAboutToOpen@MsgUnifiedEditorView@@AAEXXZ @ 40 NONAME ; void MsgUnifiedEditorView::vkbAboutToOpen(void)
+	?doDelayedConstruction@MsgUnifiedEditorView@@AAEXXZ @ 41 NONAME ; void MsgUnifiedEditorView::doDelayedConstruction(void)
+	?activateInputBlocker@MsgUnifiedEditorView@@AAEXXZ @ 42 NONAME ; void MsgUnifiedEditorView::activateInputBlocker(void)
+	?onDialogMmsSettings@MsgUnifiedEditorView@@AAEXPAVHbAction@@@Z @ 43 NONAME ; void MsgUnifiedEditorView::onDialogMmsSettings(class HbAction *)
+	?populateContent@MsgUnifiedEditorView@@QAEXABV?$QList@VQVariant@@@@@Z @ 44 NONAME ; void MsgUnifiedEditorView::populateContent(class QList<class QVariant> const &)
+	?ProcessImageL@CUniImageProcessor@@QAEXAAVRFile@@0AAVTSize@@ABVTDesC8@@HH@Z @ 45 NONAME ; void CUniImageProcessor::ProcessImageL(class RFile &, class RFile &, class TSize &, class TDesC8 const &, int, int)
+	?metaObject@MsgUnifiedEditorView@@UBEPBUQMetaObject@@XZ @ 46 NONAME ; struct QMetaObject const * MsgUnifiedEditorView::metaObject(void) const
+	?vkbClosed@MsgUnifiedEditorView@@AAEXXZ @ 47 NONAME ; void MsgUnifiedEditorView::vkbClosed(void)
+	?qt_metacast@MsgUnifiedEditorView@@UAEPAXPBD@Z @ 48 NONAME ; void * MsgUnifiedEditorView::qt_metacast(char const *)
+	?enableSendButton@MsgUnifiedEditorView@@AAEX_N@Z @ 49 NONAME ; void MsgUnifiedEditorView::enableSendButton(bool)
+	?ScaleImageL@CUniImageProcessor@@QAEXAAVRFile@@AAPAVCFbsBitmap@@1AAVTSize@@H@Z @ 50 NONAME ; void CUniImageProcessor::ScaleImageL(class RFile &, class CFbsBitmap * &, class CFbsBitmap * &, class TSize &, int)
+	?handleKeyEvent@MsgUnifiedEditorView@@UAE_NH@Z @ 51 NONAME ; bool MsgUnifiedEditorView::handleKeyEvent(int)
+	?initView@MsgUnifiedEditorView@@AAEXXZ @ 52 NONAME ; void MsgUnifiedEditorView::initView(void)
+	?packMessage@MsgUnifiedEditorView@@AAEHAAVConvergedMessage@@_N@Z @ 53 NONAME ; int MsgUnifiedEditorView::packMessage(class ConvergedMessage &, bool)
+	??1MsgUnifiedEditorView@@UAE@XZ @ 54 NONAME ; MsgUnifiedEditorView::~MsgUnifiedEditorView(void)
+	?hideChrome@MsgUnifiedEditorView@@AAEX_N@Z @ 55 NONAME ; void MsgUnifiedEditorView::hideChrome(bool)
+	?getStaticMetaObject@MsgUnifiedEditorView@@SAABUQMetaObject@@XZ @ 56 NONAME ; struct QMetaObject const & MsgUnifiedEditorView::getStaticMetaObject(void)
+	?tr@MsgUnifiedEditorView@@SA?AVQString@@PBD0@Z @ 57 NONAME ; class QString MsgUnifiedEditorView::tr(char const *, char const *)
+	?trUtf8@MsgUnifiedEditorView@@SA?AVQString@@PBD0@Z @ 58 NONAME ; class QString MsgUnifiedEditorView::trUtf8(char const *, char const *)
+	?tr@MsgUnifiedEditorView@@SA?AVQString@@PBD0H@Z @ 59 NONAME ; class QString MsgUnifiedEditorView::tr(char const *, char const *, int)
+	?Reset@CUniImageProcessor@@QAEXXZ @ 60 NONAME ; void CUniImageProcessor::Reset(void)
+	?openDraftsMessage@MsgUnifiedEditorView@@QAEXABV?$QList@VQVariant@@@@@Z @ 61 NONAME ; void MsgUnifiedEditorView::openDraftsMessage(class QList<class QVariant> const &)
+	?contactsFetched@MsgUnifiedEditorView@@AAEXABVQVariant@@@Z @ 62 NONAME ; void MsgUnifiedEditorView::contactsFetched(class QVariant const &)
+	?removeAttachmentContainer@MsgUnifiedEditorView@@AAEXXZ @ 63 NONAME ; void MsgUnifiedEditorView::removeAttachmentContainer(void)
+	??0MsgUnifiedEditorView@@QAE@PAVQGraphicsItem@@@Z @ 64 NONAME ; MsgUnifiedEditorView::MsgUnifiedEditorView(class QGraphicsItem *)
+	?trUtf8@MsgUnifiedEditorView@@SA?AVQString@@PBD0H@Z @ 65 NONAME ; class QString MsgUnifiedEditorView::trUtf8(char const *, char const *, int)
+	?deleteMessage@MsgUnifiedEditorView@@AAEXXZ @ 66 NONAME ; void MsgUnifiedEditorView::deleteMessage(void)
+	?deactivateInputBlocker@MsgUnifiedEditorView@@AAEXXZ @ 67 NONAME ; void MsgUnifiedEditorView::deactivateInputBlocker(void)
 
--- a/messagingapp/msgui/bwins/unifiedvieweru.def	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/bwins/unifiedvieweru.def	Fri Sep 17 08:28:39 2010 +0300
@@ -1,26 +1,28 @@
 EXPORTS
 	?trUtf8@UnifiedViewer@@SA?AVQString@@PBD0@Z @ 1 NONAME ; class QString UnifiedViewer::trUtf8(char const *, char const *)
-	?populateContent@UnifiedViewer@@QAEXH_NH@Z @ 2 NONAME ; void UnifiedViewer::populateContent(int, bool, int)
-	?handleReplyAction@UnifiedViewer@@AAEXXZ @ 3 NONAME ; void UnifiedViewer::handleReplyAction(void)
-	?handleDeleteAction@UnifiedViewer@@QAEXXZ @ 4 NONAME ; void UnifiedViewer::handleDeleteAction(void)
-	?metaObject@UnifiedViewer@@UBEPBUQMetaObject@@XZ @ 5 NONAME ; struct QMetaObject const * UnifiedViewer::metaObject(void) const
-	?sendMessage@UnifiedViewer@@AAEXABVQString@@0@Z @ 6 NONAME ; void UnifiedViewer::sendMessage(class QString const &, class QString const &)
-	?resizeEvent@UnifiedViewer@@MAEXPAVQGraphicsSceneResizeEvent@@@Z @ 7 NONAME ; void UnifiedViewer::resizeEvent(class QGraphicsSceneResizeEvent *)
-	??0UnifiedViewer@@QAE@HPAVQGraphicsItem@@@Z @ 8 NONAME ; UnifiedViewer::UnifiedViewer(int, class QGraphicsItem *)
-	?isForwardOk@UnifiedViewer@@AAE_NXZ @ 9 NONAME ; bool UnifiedViewer::isForwardOk(void)
-	?handleFwdAction@UnifiedViewer@@QAEXXZ @ 10 NONAME ; void UnifiedViewer::handleFwdAction(void)
-	?qt_metacast@UnifiedViewer@@UAEPAXPBD@Z @ 11 NONAME ; void * UnifiedViewer::qt_metacast(char const *)
-	?onDialogDeleteMsg@UnifiedViewer@@AAEXH@Z @ 12 NONAME ; void UnifiedViewer::onDialogDeleteMsg(int)
+	?handleReplyAction@UnifiedViewer@@AAEXXZ @ 2 NONAME ; void UnifiedViewer::handleReplyAction(void)
+	?handleDeleteAction@UnifiedViewer@@QAEXXZ @ 3 NONAME ; void UnifiedViewer::handleDeleteAction(void)
+	?metaObject@UnifiedViewer@@UBEPBUQMetaObject@@XZ @ 4 NONAME ; struct QMetaObject const * UnifiedViewer::metaObject(void) const
+	?sendMessage@UnifiedViewer@@AAEXABVQString@@0@Z @ 5 NONAME ; void UnifiedViewer::sendMessage(class QString const &, class QString const &)
+	?resizeEvent@UnifiedViewer@@MAEXPAVQGraphicsSceneResizeEvent@@@Z @ 6 NONAME ; void UnifiedViewer::resizeEvent(class QGraphicsSceneResizeEvent *)
+	??0UnifiedViewer@@QAE@HPAVQGraphicsItem@@@Z @ 7 NONAME ; UnifiedViewer::UnifiedViewer(int, class QGraphicsItem *)
+	?isForwardOk@UnifiedViewer@@AAE_NXZ @ 8 NONAME ; bool UnifiedViewer::isForwardOk(void)
+	?handleFwdAction@UnifiedViewer@@QAEXXZ @ 9 NONAME ; void UnifiedViewer::handleFwdAction(void)
+	?qt_metacast@UnifiedViewer@@UAEPAXPBD@Z @ 10 NONAME ; void * UnifiedViewer::qt_metacast(char const *)
+	?onDialogDeleteMsg@UnifiedViewer@@AAEXH@Z @ 11 NONAME ; void UnifiedViewer::onDialogDeleteMsg(int)
+	?handleKeyEvent@UnifiedViewer@@UAE_NH@Z @ 12 NONAME ; bool UnifiedViewer::handleKeyEvent(int)
 	?createToolBar@UnifiedViewer@@AAEXXZ @ 13 NONAME ; void UnifiedViewer::createToolBar(void)
 	??1UnifiedViewer@@UAE@XZ @ 14 NONAME ; UnifiedViewer::~UnifiedViewer(void)
-	??_EUnifiedViewer@@UAE@I@Z @ 15 NONAME ; UnifiedViewer::~UnifiedViewer(unsigned int)
-	?qt_metacall@UnifiedViewer@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 16 NONAME ; int UnifiedViewer::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?tr@UnifiedViewer@@SA?AVQString@@PBD0@Z @ 17 NONAME ; class QString UnifiedViewer::tr(char const *, char const *)
-	?getStaticMetaObject@UnifiedViewer@@SAABUQMetaObject@@XZ @ 18 NONAME ; struct QMetaObject const & UnifiedViewer::getStaticMetaObject(void)
-	?staticMetaObject@UnifiedViewer@@2UQMetaObject@@B @ 19 NONAME ; struct QMetaObject const UnifiedViewer::staticMetaObject
-	?handleReplyAllAction@UnifiedViewer@@AAEXXZ @ 20 NONAME ; void UnifiedViewer::handleReplyAllAction(void)
-	?trUtf8@UnifiedViewer@@SA?AVQString@@PBD0H@Z @ 21 NONAME ; class QString UnifiedViewer::trUtf8(char const *, char const *, int)
-	?clearContent@UnifiedViewer@@QAEXXZ @ 22 NONAME ; void UnifiedViewer::clearContent(void)
-	?launchEditor@UnifiedViewer@@AAEXW4UniEditorOperation@MsgBaseView@@@Z @ 23 NONAME ; void UnifiedViewer::launchEditor(enum MsgBaseView::UniEditorOperation)
-	?tr@UnifiedViewer@@SA?AVQString@@PBD0H@Z @ 24 NONAME ; class QString UnifiedViewer::tr(char const *, char const *, int)
+	?populateContent@UnifiedViewer@@QAEXH_NH_J@Z @ 15 NONAME ; void UnifiedViewer::populateContent(int, bool, int, long long)
+	??_EUnifiedViewer@@UAE@I@Z @ 16 NONAME ; UnifiedViewer::~UnifiedViewer(unsigned int)
+	?qt_metacall@UnifiedViewer@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 17 NONAME ; int UnifiedViewer::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?tr@UnifiedViewer@@SA?AVQString@@PBD0@Z @ 18 NONAME ; class QString UnifiedViewer::tr(char const *, char const *)
+	?getStaticMetaObject@UnifiedViewer@@SAABUQMetaObject@@XZ @ 19 NONAME ; struct QMetaObject const & UnifiedViewer::getStaticMetaObject(void)
+	?staticMetaObject@UnifiedViewer@@2UQMetaObject@@B @ 20 NONAME ; struct QMetaObject const UnifiedViewer::staticMetaObject
+	?call@UnifiedViewer@@AAEXABVQString@@@Z @ 21 NONAME ; void UnifiedViewer::call(class QString const &)
+	?handleReplyAllAction@UnifiedViewer@@AAEXXZ @ 22 NONAME ; void UnifiedViewer::handleReplyAllAction(void)
+	?trUtf8@UnifiedViewer@@SA?AVQString@@PBD0H@Z @ 23 NONAME ; class QString UnifiedViewer::trUtf8(char const *, char const *, int)
+	?clearContent@UnifiedViewer@@QAEXXZ @ 24 NONAME ; void UnifiedViewer::clearContent(void)
+	?launchEditor@UnifiedViewer@@AAEXW4UniEditorOperation@MsgBaseView@@@Z @ 25 NONAME ; void UnifiedViewer::launchEditor(enum MsgBaseView::UniEditorOperation)
+	?tr@UnifiedViewer@@SA?AVQString@@PBD0H@Z @ 26 NONAME ; class QString UnifiedViewer::tr(char const *, char const *, int)
 
--- a/messagingapp/msgui/conversationview/conversationview.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/conversationview/conversationview.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -24,7 +24,6 @@
 
 INCLUDEPATH += .
 INCLUDEPATH += ../../../inc
-INCLUDEPATH += ../msgaudiofetcher/inc
 INCLUDEPATH += ../msguiutils/inc
 INCLUDEPATH += ../../msgutils/unieditorutils/editorgenutils/inc
 INCLUDEPATH += ../appengine/inc
--- a/messagingapp/msgui/conversationview/inc/msgcontactcardwidget.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/conversationview/inc/msgcontactcardwidget.h	Fri Sep 17 08:28:39 2010 +0300
@@ -211,6 +211,13 @@
      * Own.
      */
     ThumbnailManager *mThumbnailManager;
+
+#ifdef MSGUI_UNIT_TEST
+    /**
+     * Unit Testing
+     */
+    friend class TestMsgContactCardWidget;
+#endif
 };
 
 #endif // MSGCONTACTCARDWIDGET_H
--- a/messagingapp/msgui/conversationview/inc/msgconversationbaseview.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/conversationview/inc/msgconversationbaseview.h	Fri Sep 17 08:28:39 2010 +0300
@@ -18,10 +18,14 @@
 #ifndef MSG_CONVERSATION_VIEW_INTERFACE_H
 #define MSG_CONVERSATION_VIEW_INTERFACE_H
 
-#ifdef  CONVERSATIONVIEW_DLL
-#define CONVERSATION_VIEW_EXPORT Q_DECL_EXPORT
+#ifdef MSGUI_UNIT_TEST
+ #define CONVERSATION_VIEW_EXPORT
 #else
-#define CONVERSATION_VIEW_EXPORT Q_DECL_IMPORT
+ #ifdef  CONVERSATIONVIEW_DLL
+  #define CONVERSATION_VIEW_EXPORT Q_DECL_EXPORT
+ #else
+  #define CONVERSATION_VIEW_EXPORT Q_DECL_IMPORT
+ #endif
 #endif
 
 #include <xqsettingskey.h>
@@ -80,6 +84,14 @@
      */
     qint64 conversationId();
 
+    /**
+     * Event handler
+     * @param key Key code
+     * @return true if key event handled else false.
+     * @see MsgBaseView
+     */
+    bool handleKeyEvent(int key);
+
 public slots:
     /**
      * Close the conversation view 
--- a/messagingapp/msgui/conversationview/inc/msgconversationview.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/conversationview/inc/msgconversationview.h	Fri Sep 17 08:28:39 2010 +0300
@@ -33,6 +33,8 @@
 class HbStaticVkbHost;
 class QGraphicsLinearLayout;
 class HbAction;
+class MsgAudioFetcherDialog;
+
 //Defines
 #define INVALID_MSG_ID -1
 
@@ -71,6 +73,14 @@
      */
     int saveContentToDrafts();
 
+    /**
+     * Event handler
+     * @param key Key code
+     * @return true if key event handled else false.
+     * @see MsgBaseView
+     */
+    bool handleKeyEvent(int key);
+
 private slots:
 
     /**
@@ -337,6 +347,12 @@
      */
     bool isSharedMessage(qint32 messageId);
     
+    /** 
+     * This slot is called after sound clip is 
+     * selected from audio fetcher dialog    
+     */
+    void onAudioSelected(QString& filePath);
+    
 signals:
     /**
      * Signal emitted to inform close the conversation view.
@@ -409,6 +425,11 @@
      */
     void showContextMenu(HbAbstractViewItem* viewItem,const QPointF& point, int placement);
 
+    /**
+     * Launches Dialer Service 
+     */
+    void call(const QString& address);
+
 private:
 
     /**
@@ -449,6 +470,12 @@
     HbStaticVkbHost* mVkbHost;
     
     /**
+     * Instance of Audio Fetcher Dialog
+     * Need to show when attachment audio selected
+     */
+    MsgAudioFetcherDialog* mDialog;
+    
+    /**
      * variable holding the visible model index
      */
     QModelIndex mVisibleIndex;
@@ -463,6 +490,13 @@
      * Flag is set when 
      */
     bool mViewReady;
+
+#ifdef MSGUI_UNIT_TEST
+    /**
+     * Unit Testing
+     */
+    friend class TestMsgConversationView;
+#endif
 };
 
 #endif // MSG_CONVERSATION_VIEW_H
--- a/messagingapp/msgui/conversationview/inc/msgconversationviewitem.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/conversationview/inc/msgconversationviewitem.h	Fri Sep 17 08:28:39 2010 +0300
@@ -108,6 +108,13 @@
      */
     void init();
 
+    /**
+     * Finds the message timestamp to be set.
+     * @parma index Model index of the item.
+     * @return Timestamp string to be set.
+     */
+    QString getMsgTimeStamp(const QModelIndex& index);
+
 private slots:    
 
     /*
--- a/messagingapp/msgui/conversationview/inc/msgconversationwidget.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/conversationview/inc/msgconversationwidget.h	Fri Sep 17 08:28:39 2010 +0300
@@ -459,6 +459,13 @@
      * Owned
      */
     HbIconItem *mPreviewIconItem;
+
+#ifdef MSGUI_UNIT_TEST
+    /**
+     * Unit Testing
+     */
+    friend class TestMsgConversationWidget;
+#endif
 };
 
 #endif // MSG_CONVERSATIONWIDGET_H
--- a/messagingapp/msgui/conversationview/inc/msgeditorwidget.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/conversationview/inc/msgeditorwidget.h	Fri Sep 17 08:28:39 2010 +0300
@@ -234,6 +234,13 @@
      * Indication for sms char limt reached
      */
     bool mSmsCharLimitReached;
+
+#ifdef MSGUI_UNIT_TEST
+    /**
+     * Unit Testing
+     */
+    friend class TestMsgEditorWidget;
+#endif
 };
 
 #endif // MSGEDITORWIDGET_H
--- a/messagingapp/msgui/conversationview/inc/msgviewutils.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/conversationview/inc/msgviewutils.h	Fri Sep 17 08:28:39 2010 +0300
@@ -60,6 +60,13 @@
 private:
     // Data
 
+#ifdef MSGUI_UNIT_TEST
+    /**
+     * Unit Testing
+     */
+    friend class TestMsgViewUtils;
+#endif
+
 };
 
 #endif // MSGVIEWUTILS_H
--- a/messagingapp/msgui/conversationview/resources/layouts/msgconversationwidget.widgetml	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/conversationview/resources/layouts/msgconversationwidget.widgetml	Fri Sep 17 08:28:39 2010 +0300
@@ -83,7 +83,7 @@
     <meshitem src="timeStamp" srcEdge="TOP" dst="bodyText" dstEdge="BOTTOM" spacer="topSpacer" />
     <meshitem src="timeStamp" srcEdge="LEFT" dst="playIcon" dstEdge="RIGHT" />
     <meshitem src="timeStamp" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
-    <meshitem src="timeStamp" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"  />
+    <meshitem src="timeStamp" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacer="bottomSpacer" />
 
     <meshitem src="newItemIcon" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
     <meshitem src="newItemIcon" srcEdge="TOP" dst="" dstEdge="TOP"/>
--- a/messagingapp/msgui/conversationview/src/msgcontactcardwidget.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/conversationview/src/msgcontactcardwidget.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -345,29 +345,30 @@
 //---------------------------------------------------------------
 void MsgContactCardWidget::openContactInfo()
 {
+    //service stuff.
+    QString service("phonebookservices");
+    QString interface;
     QString operation;
     QList<QVariant> args;
     if (KBluetoothMsgsConversationId != ConversationsEngine::instance()->getCurrentConversationId()) {
         int contactId = resolveContactId(mContactNumber);
         if (contactId > 0) {
             //open existing contact card
-            operation = QString("open(int)");
+            interface = QString("com.nokia.symbian.IContactsView");
+            operation = QString("openContactCard(int)");
             args << contactId;
         }
         else {
             //populate data and open unknown contact template
+            interface = QString("com.nokia.symbian.IContactsEdit");
             operation = QString("editCreateNew(QString,QString)");
             QString type = QContactPhoneNumber::DefinitionName;
-
             args << type;
             args << mAddress;
         }
-        //service stuff.
-        QString serviceName("com.nokia.services.phonebookservices");
-
         XQAiwRequest* request;
         XQApplicationManager appManager;
-        request = appManager.create(serviceName, "Fetch", operation, true); // embedded
+        request = appManager.create(service, interface, operation, true); // embedded
         if (request == NULL) {
             return;
         }
@@ -379,7 +380,7 @@
 
         //disbale subscritption for the CV events
         ConversationsEngine::instance()->disableRegisterationForCVEvents();
-                
+
         request->setArguments(args);
         request->send();
         delete request;
@@ -439,8 +440,16 @@
     QList<QContact> matchingContacts = MsgContactHandler::findContactList(mContactNumber);
 
     if (!matchingContacts.isEmpty()) {
-        setAddress(matchingContacts.at(0).displayLabel());
-
+        QString displayLabel = matchingContacts.at(0).displayLabel();
+        if(!displayLabel.isEmpty())
+        {
+            setAddress(displayLabel);
+        }
+        else
+        {
+            setAddress(mContactNumber);
+        }
+        
         QList<QContactAvatar> avatarDetails = matchingContacts.at(0).details<QContactAvatar> ();
 
         if (!avatarDetails.isEmpty()) {
--- a/messagingapp/msgui/conversationview/src/msgconversationbaseview.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/conversationview/src/msgconversationbaseview.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -284,4 +284,13 @@
         mSettingsManager->writeItemValue(mCVIdkey, -1);
     }
 }
+
+//---------------------------------------------------------------
+// MsgConversationBaseView::handleKeyEvent
+//
+//---------------------------------------------------------------
+bool MsgConversationBaseView::handleKeyEvent(int key)
+{
+    return mConversationView->handleKeyEvent(key);
+}
 // EOF
--- a/messagingapp/msgui/conversationview/src/msgconversationview.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/conversationview/src/msgconversationview.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -18,19 +18,20 @@
 #include "msgconversationview.h"
 
 // SYSTEM INCLUDES
+#include <hbapplication.h>
 #include <HbMenu>
 #include <HbAction>
 #include <HbListView>
 #include <HbMessageBox>
 #include <HbNotificationDialog>
 #include <HbFrameBackground>
-#include <xqservicerequest.h>
 #include <HbStaticVkbHost>
 #include <HbStyleLoader>
 #include <xqaiwrequest.h>
 #include <xqappmgr.h>
 #include <HbMainWindow>
 
+#include <QInputContext>
 #include <QDir>
 #include <QDateTime>
 #include <QGraphicsLinearLayout>
@@ -57,9 +58,9 @@
 #include "ringbc.h"
 #include "mmsconformancecheck.h"
 #include "msgsettingsview.h"
-#include "msgaudiofetcherview.h"
 #include "unieditorpluginloader.h"
 #include "unieditorplugininterface.h"
+#include "msgaudiofetcherdialog.h"
 
 //Item specific menu.
 
@@ -106,6 +107,7 @@
     mContactCardWidget(contactCardWidget),
     mSendUtil(NULL),
     mVkbHost(NULL),
+    mDialog(NULL),
     mVisibleIndex(),
     mModelPopulated(false),
     mViewReady(false)
@@ -133,7 +135,8 @@
 //---------------------------------------------------------------
 MsgConversationView::~MsgConversationView()
 {
-    
+    //delete the popup dialog
+    delete mDialog;
 }
 //---------------------------------------------------------------
 // MsgConversationView::setupView
@@ -485,6 +488,15 @@
         }
     }
     deactivateInputBlocker();
+
+    // make sure virtual keyboard is closed
+    QInputContext *ic = qApp->inputContext();
+    if (ic) {
+    QEvent *closeEvent = new QEvent(QEvent::CloseSoftwareInputPanel);
+    ic->filterEvent(closeEvent);
+    delete closeEvent;
+    }
+
     if( sendResult == KErrNotFound)
     {
     HbMessageBox::question(LOC_DIALOG_SMS_SETTINGS_INCOMPLETE, this,
@@ -523,12 +535,12 @@
     if(!action)
         return;
 
-    QList<QVariant> args;
-    QString serviceName("com.nokia.services.phonebookservices");
-    QString operation("fetch(QString,QString,QString)");
+    QString service("phonebookservices");
+    QString interface("com.nokia.symbian.IContactsFetch");
+    QString operation("multiFetch(QString,QString)");
     XQAiwRequest* request;
     XQApplicationManager appManager;
-    request = appManager.create(serviceName, "Fetch", operation, true); //embedded
+    request = appManager.create(service, interface, operation, true); //embedded
     if ( request == NULL )
     {
         return;       
@@ -549,6 +561,7 @@
     connect (request, SIGNAL(requestError(int,const QString&)), 
         this, SLOT(serviceRequestError(int,const QString&)));
 
+    QList<QVariant> args;
     args << QString(tr("Phonebook")); 
     args << KCntActionAll;
     args << KCntFilterDisplayAll;
@@ -569,13 +582,15 @@
     XQAiwRequest* request = NULL;
     XQApplicationManager appManager;
     request = appManager.create(service,interface, operation, true); // embedded
-    request->setSynchronous(true); // synchronous
+
     if(!request)
     {
         QDEBUG_WRITE("AIW-ERROR: NULL request");
         return;
     }
 
+    request->setSynchronous(true); // synchronous
+    
     connect(request, SIGNAL(requestOk(const QVariant&)),
         this, SLOT(imagesFetched(const QVariant&)));
     connect(request, SIGNAL(requestError(int,const QString&)),
@@ -595,25 +610,18 @@
 //---------------------------------------------------------------
 void MsgConversationView::fetchAudio()
 {
-    // Launch Audio fetcher view
-    QVariantList params;
-    QByteArray dataArray;
-    QDataStream messageStream
-    (&dataArray, QIODevice::WriteOnly | QIODevice::Append);
+    // Launch Audio fetcher dialog
+    if (!mDialog)
+    {
+        mDialog = new MsgAudioFetcherDialog();
+        bool b = connect(mDialog,
+                SIGNAL(audioSelected(QString&)),
+                this,
+                SLOT(onAudioSelected(QString&)));
+    }
 
-    ConvergedMessage message;
-    message.setBodyText(mEditorWidget->content());
-    // add address from contact-card to to-field
-    ConvergedMessageAddress address;
-    address.setAlias(mContactCardWidget->address().at(0)->alias());
-    address.setAddress(mContactCardWidget->address().at(0)->address());
-    message.addToRecipient(address);
-    message.serialize(messageStream);
-
-    params << MsgBaseView::AUDIOFETCHER; // target view
-    params << MsgBaseView::CV; // source view
-    params << dataArray;
-    emit switchView(params);
+    //show the dialog
+    mDialog->show();    
 }
 
 //---------------------------------------------------------------
@@ -841,7 +849,7 @@
 
     args << QVariant(messageId);
     request->setSynchronous(true);
-    
+    request->setEmbedded(true);
     request->setArguments(args);
     request->send();
     delete request;    
@@ -976,7 +984,7 @@
     // For suspended message both short tap and long tap needs to show the same
     // context menu.....
     if(direction == ConvergedMessage::Outgoing 
-        	&&sendingState == ConvergedMessage::Suspended )
+        	&& ((sendingState == ConvergedMessage::Suspended) || (sendingState == ConvergedMessage::Failed)))
     {
         handleShortTap();
         return;
@@ -1105,7 +1113,6 @@
     if(!data2.isNull())
         params << data2;
 
-    clearEditors();
     emit switchView(params);
 }
 
@@ -1488,4 +1495,79 @@
     return shared;
 }
 
+//---------------------------------------------------------------
+// MsgConversationView::onAudioSelected
+// @see header file
+//---------------------------------------------------------------
+void MsgConversationView::onAudioSelected(QString& filePath)
+{
+    QVariantList params;
+    QByteArray dataArray;
+    QDataStream messageStream
+    (&dataArray, QIODevice::WriteOnly | QIODevice::Append);
+
+    ConvergedMessage message;
+    message.setBodyText(mEditorWidget->content());
+    // add address from contact-card to to-field
+    ConvergedMessageAddress address;
+    address.setAlias(mContactCardWidget->address().at(0)->alias());
+    address.setAddress(mContactCardWidget->address().at(0)->address());
+    message.addToRecipient(address);
+    
+    //add the attachment as selected from audio picker
+    ConvergedMessageAttachment* attachment =
+                new ConvergedMessageAttachment(filePath);
+    ConvergedMessageAttachmentList attachmentList;
+    attachmentList.append(attachment);
+    message.addAttachments(attachmentList);
+    message.serialize(messageStream);
+
+    params << MsgBaseView::UNIEDITOR; // target view
+    params << MsgBaseView::CV; // source view
+    params << dataArray;
+    params << MsgBaseView::ADD_AUDIO;
+    emit switchView(params);
+}
+
+//---------------------------------------------------------------
+// MsgConversationView::handleKeyEvent
+// @see header file
+//---------------------------------------------------------------
+bool MsgConversationView::handleKeyEvent(int key)
+{
+    bool eventHandled = false;
+    if (Qt::Key_Yes == key) {
+        //getting address of last sent/received msg.
+        const int rowCount = mMessageModel->rowCount();
+        QModelIndex index = mMessageModel->index(rowCount - 1, 0);
+        QString address = index.data(ConversationAddress).toString();
+
+        if (!address.isEmpty()) {
+            call(address);
+            eventHandled = true;
+        }
+    }
+    return eventHandled;
+}
+
+//---------------------------------------------------------------
+// MsgConversationView::call
+// @see header
+//---------------------------------------------------------------
+void MsgConversationView::call(const QString& address)
+{
+    QString service("phoneui");
+    QString interface("com.nokia.symbian.ICallDial");
+    QString operation("dial(QString)");
+
+    XQApplicationManager appManager;
+    QScopedPointer<XQAiwRequest> request(appManager.create(service, interface, operation, false));
+    if (request) {
+        QList<QVariant> args;
+        args << address;
+        request->setArguments(args);
+        request->send();
+    }
+}
+
 // EOF
--- a/messagingapp/msgui/conversationview/src/msgconversationviewitem.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/conversationview/src/msgconversationviewitem.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -20,9 +20,7 @@
 // SYSTEM INCLUDES
 #include <QDateTime>
 #include "debugtraces.h"
-#include <QDir>
 #include <QChar>
-#include <QStringBuilder>
 #include <HbTextItem>
 #include <HbIconItem>
 #include <HbIconAnimationManager>
@@ -173,21 +171,7 @@
     mConversation->drawBubbleFrame();
     mConversation->drawNewItemFrame();
 
-    QDateTime dateTime;
-    dateTime.setTime_t(index.data(TimeStamp).toUInt());
-    QString resendStateNote((index.data(SendingState).toInt()
-                    == ConvergedMessage::Resend) ? LOC_RESEND_AT : "");
-
-    HbExtendedLocale locale = HbExtendedLocale::system();
-    QString date = locale.format(dateTime.date(), DATE_FORMAT);
-    QString time = locale.format(dateTime.time(), TIME_FORMAT);
-
-    if (dateTime.date() == QDateTime::currentDateTime().date()) {
-        mConversation->setTimeStamp(resendStateNote % time);
-    }
-    else {
-        mConversation->setTimeStamp(resendStateNote % date);
-    }
+    mConversation->setTimeStamp(getMsgTimeStamp(index));
 
     if (messageSubType == ConvergedMessage::VCal)
         {
@@ -258,21 +242,7 @@
     mConversation->drawBubbleFrame();
     mConversation->drawNewItemFrame();
 
-    QDateTime dateTime;
-    dateTime.setTime_t(index.data(TimeStamp).toUInt());
-    QString resendStateNote((index.data(SendingState).toInt()
-            == ConvergedMessage::Resend) ? LOC_RESEND_AT : "");
-
-    HbExtendedLocale locale = HbExtendedLocale::system();
-    QString date = locale.format(dateTime.date(), DATE_FORMAT);
-    QString time = locale.format(dateTime.time(), TIME_FORMAT);
-
-    if (dateTime.date() == QDateTime::currentDateTime().date()) {
-        mConversation->setTimeStamp(resendStateNote % time);
-    }
-    else {
-        mConversation->setTimeStamp(resendStateNote % date);
-    }
+    mConversation->setTimeStamp(getMsgTimeStamp(index));
 
     if (messageType == ConvergedMessage::Mms)
         {
@@ -570,6 +540,35 @@
 }
 
 //---------------------------------------------------------------
+// MsgConversationViewItem::getMsgTimeStamp
+// @see header file
+//---------------------------------------------------------------
+QString MsgConversationViewItem::getMsgTimeStamp(const QModelIndex& index)
+{
+    QDateTime dateTime;
+    dateTime.setTime_t(index.data(TimeStamp).toUInt());
+    
+    HbExtendedLocale locale = HbExtendedLocale::system();
+
+    QString timeStampStr;
+    if (dateTime.date() == QDateTime::currentDateTime().date()) {
+        timeStampStr = locale.format(dateTime.time(), TIME_FORMAT);
+    }
+    else {
+        timeStampStr = locale.format(dateTime.date(), DATE_FORMAT);
+    }
+
+    QString msgTimeStamp;
+    if (ConvergedMessage::Resend == index.data(SendingState).toInt()) {
+        msgTimeStamp = LOC_RESEND_AT.arg(timeStampStr);
+    }
+    else {
+        msgTimeStamp = timeStampStr;
+    }
+    return msgTimeStamp;
+}
+
+//---------------------------------------------------------------
 // MsgConversationViewItem::orientationchanged
 // @see header file
 //---------------------------------------------------------------
--- a/messagingapp/msgui/conversationview/src/msgeditorwidget.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/conversationview/src/msgeditorwidget.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -382,19 +382,12 @@
 // @see header
 //---------------------------------------------------------------
 void MsgEditor::focusInEvent(QFocusEvent *event)
- {
-    if(event->reason() == Qt::MouseFocusReason)
-    {
-        HbLineEdit::focusInEvent(event);
-        FOCUSITEM->setFocusProxy(this);
-        setCursorVisibility(Hb::TextCursorVisible);
-        emit replyStarted();
-    }
-    else
-    {
-        setCursorVisibility(Hb::TextCursorHidden);
-    }
- }
+	{
+	HbLineEdit::focusInEvent(event);
+    FOCUSITEM->setFocusProxy(this);
+    setCursorVisibility(Hb::TextCursorVisible);
+    emit replyStarted();    
+	}
 
 //---------------------------------------------------------------
 // MsgEditor::focusOutEvent
--- a/messagingapp/msgui/conversationview/tsrc/tsrc.pro	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-#
-# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-# 
-# Description:
-#
-#
-
-SUBDIRS += unittests
-TEMPLATE = subdirs
--- a/messagingapp/msgui/conversationview/tsrc/unittests/unittest_msgconversationwidget/hbwidget.h	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-#ifndef T_MSGCONVERSATIONVIEW_HBWIDGET_H
-#define T_MSGCONVERSATIONVIEW_HBWIDGET_H
-
-#include <QGraphicsWidget>
-
-/*
-    Mocked HbWidget class' external variables.
- */
-extern QGraphicsWidget *hbwidget_parent;
-
-/*
-    Mocked HbWidget class.
- */
-class HbWidget : public QGraphicsWidget
-{
-    Q_OBJECT
-public:
-    HbWidget(QGraphicsWidget *parent = NULL)
-    : QGraphicsWidget(hbwidget_parent = parent)
-    {
-    }
-    ~HbWidget()
-    {        
-    }
-        
-    void repolish() {}
-    
-private:
-    Q_DISABLE_COPY(HbWidget)
-private:    
-};
-
-#endif /* T_MSGCONVERSATIONVIEW_HBWIDGET_H */
--- a/messagingapp/msgui/conversationview/tsrc/unittests/unittest_msgconversationwidget/msgconversationwidgetheaders.h	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,282 +0,0 @@
-/*
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-#ifndef T_MSGCONVERSATIONWIDGET_HEADERS_H
-#define T_MSGCONVERSATIONWIDGET_HEADERS_H
-
-#include <QGraphicsWidget>
-
-#include "convergedmessage.h"
-#include "debugtraces.h"
-
-#define QCoreApplication QCoreApplication2
-
-/*
-    Mocked HbEvent class.
- */
-class HbEvent : public QObject
-{
-    Q_OBJECT
-public:
-	  enum Flags{
-	  	ThemeChanged
-	  	};
-	  	
-    HbEvent(HbEvent::Flags flag)
-    {
-    }
-    ~HbEvent()
-    {        
-    }
-        
-private:
-    Q_DISABLE_COPY(HbEvent)   
-};
-
-/*
-    Mocked QCoreApplication class.
- */
- class MSG;
- 
-class QCoreApplication2 : public QObject
-{
-    Q_OBJECT
-public:
-	enum EventFilter
-	{
-		CodecForTr, UnicodeUTF8, DefaultCodec 
-	};
-		
-    QCoreApplication ( int & argc, char ** argv )  {}
-    ~QCoreApplication ()  {}
-    bool filterEvent ( void * message, long * result ) {}
-    virtual bool notify ( QObject * receiver, QEvent * event ) {}
-    EventFilter setEventFilter ( EventFilter filter ) {}
-    virtual bool winEventFilter ( MSG * msg, long * result ) {}
-    static void postEvent(QObject* ref, HbEvent* ob) {}
-
-private:
-    Q_DISABLE_COPY(QCoreApplication)   
-};
-
-/*
-    Mocked Hb class.
- */
-class Hb : public QObject
-{
-    Q_OBJECT
-public:
-	enum Flags{
-		TextCursorHidden
-		
-	};
-	
-    Hb(QObject *parent = NULL)
-    {
-    }
-    ~Hb()
-    {        
-    }
-        
-private:
-    Q_DISABLE_COPY(Hb)   
-};
-
-/*
-    Mocked HbIcon class.
- */
-class HbIcon
-{
-  
-public:
-  
-    HbIcon (const QString &iconName)  {}
-    HbIcon (const QIcon &icon) {}
-    HbIcon (const HbIcon &other) {}
-
-    QSizeF size() const {}
-private:
-    //Q_DISABLE_COPY(HbIcon)
-};
-
-/*
-    Mocked HbIconItem class.
- */
-
-class HbIconItem : public QGraphicsWidget
-{
-    Q_OBJECT
-public:
-    HbIconItem(QGraphicsWidget *parent = NULL)
-    {
-    }
-    ~HbIconItem()
-    {        
-    }
-        void setAlignment(Qt::Alignment alignment) {}
-        void setIcon(const HbIcon &icon) {}
-        void setPreferredSize(QSizeF size) {}
-        void show(){}
-        void setIconName(const QString& name) {}
-private:
-    Q_DISABLE_COPY(HbIconItem)
-private:    
-};
-
-/*
-    Mocked HbTextItem class.
- */
-class HbTextItem : public QGraphicsWidget
-{
-    Q_OBJECT
-public:
-    HbTextItem(QGraphicsWidget *parent = NULL)
-    {
-    }
-    ~HbTextItem()
-    {        
-    }
-    void setText(const QString &timeStamp){}
-    void show(){}
-private:
-    Q_DISABLE_COPY(HbTextItem)
-private:    
-};
-
-/*
-    Mocked HbIconItem class.
- */
-extern int hbtextedit_setsmileysenabled_callcount;
-extern int hbtextedit_setreadonly_callcount;
- 
-class HbTextEdit : public QGraphicsWidget
-{
-    Q_OBJECT
-public:
-    HbTextEdit(QGraphicsWidget *parent = NULL)
-    {
-    }
-    ~HbTextEdit()
-    {        
-    }
-        void setReadOnly(bool status) {
-        	hbtextedit_setreadonly_callcount++;
-        	}
-        void setBackgroundItem(int back) {}
-        void setSmileysEnabled(bool status) {
-        	hbtextedit_setsmileysenabled_callcount++;
-        	}
-        void setFlag(QGraphicsWidget::GraphicsItemFlag flag,bool status) {}
-        void setPlainText(QString text) {}
-        void show() {}
-        void setCursorVisibility(Hb::Flags flag) {}
-private:
-    Q_DISABLE_COPY(HbTextEdit)
-private:    
-};
-
-/*
-    Mocked HbStyle class.
- */
-extern int hbstyle_setitemname_callcount;
-
-class HbStyle: public QObject
-{
-    Q_OBJECT
-public:
-	enum{
-		P_None
-	};
-    HbStyle(QObject *parent = NULL)
-    {
-    }
-    
-    void static setItemName(QGraphicsWidget* bubbleFrameItem, QString type)
-    {
-    	hbstyle_setitemname_callcount++;
-    }
-    
-private:
-    Q_DISABLE_COPY(HbStyle)
-};
-
-/*
-    Mocked HbFrameDrawer class.
- */
- extern int hbframedrawer_setframetype_callcount;
- 
-class HbFrameDrawer: public QObject
-{
-    Q_OBJECT
-public:
-		enum PieceSize{
-		OnePieces,
-		TwoPieces,
-		ThreePiecesVertical,
-		FourPieces,
-		NinePieces
-	};
-    HbFrameDrawer(QObject *parent = NULL)
-    {
-    }
-    void setFrameType(HbFrameDrawer::PieceSize piece)
-    	{
-    		hbframedrawer_setframetype_callcount++;
-    	}
-    	
-    	void setFrameGraphicsName(const QString name) {}
-    	
-private:
-    Q_DISABLE_COPY(HbFrameDrawer)
-};
-
-/*
-    Mocked HbFrameItem class.
- */
-extern int hbframeitem_framedrawer_callcount;
- 
-class HbFrameItem : public QGraphicsWidget
-{
-    Q_OBJECT
-    
-public:
-	
-    HbFrameItem(QGraphicsWidget *parent = NULL)
-    {
-    }
-    ~HbFrameItem()
-    {        
-    }
-    
-HbFrameDrawer& frameDrawer  ( )  
-{
-	hbframeitem_framedrawer_callcount++;
-	return frameDraw;
-}
-    
-private:
-    Q_DISABLE_COPY(HbFrameItem)
-private:
-    HbFrameDrawer frameDraw;    
-};
-
-/*
-    Include the header file of the class under test.
- */
-#include "../../../inc/msgconversationwidget.h"
-
-#endif /* T_MSGCONVERSATIONWIDGET_HEADERS_H */
--- a/messagingapp/msgui/conversationview/tsrc/unittests/unittest_msgconversationwidget/unittest_msgconversationwidget.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,174 +0,0 @@
-/*
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-#include <QtTest/QtTest>
-
-#include "msgconversationwidgetheaders.h"
-
-/*
-    Global variables that are used to control the test environment and/or
-    observe the individual tests. The naming convention can be described with
-    a ternary template
-    
-        <class>_<member>[_<suffix>],
-    
-    where <class> is the name of a mocked class, <member> is the name of a
-    variable, a function, or a property under consideration, and <suffix> is
-    an optional description. For example, if we wish to observe the number of
-    A::B() calls, we declare a global integer a_b_callcount and increment it
-    every time A::B() is called. The variable is also declared in the header
-    file of the mocked class by using the extern keyword. Typically, these
-    global variables are defined and reset in the unit-test class' helper
-    functions.
-    
-    Mocked HbLabel class' global variables:
-    
-        • argument of setNumber() and/or setPlainText(),
-        • number of setNumber() calls, and
-        • number of setPlaintText() calls.
- */
-
-int hbframeitem_framedrawer_callcount;
-int hbstyle_setitemname_callcount;
-int hbframedrawer_setframetype_callcount;
-int hbtextedit_setreadonly_callcount;
-int hbtextedit_setsmileysenabled_callcount;
-const QString SUBJECT = "Subject";
-const QString BODYTEXT = "Body Text";
-
-QGraphicsWidget *hbwidget_parent;
-
-/*
-    The unit-test class. The class definition contains four helper functions
-    and a number of test functions. The helper functions are responsible for
-    the initialization and cleanup of the test environment, whereas the test
-    functions implement the actual testing. Although the test functions are
-    executed in the order they are defined, they should not depend on each
-    other in any way. In other words, one should be able to scramble the test
-    functions and still compile a working unit test.
- */
-class TestMsgConversationWidget : public QObject
-{
-    Q_OBJECT
-private slots:
-    void initTestCase();
-    void cleanupTestCase();
-    void init();
-    void cleanup();
-    void testConstructor();
-    void testSetSubject();
-    void testSetBodyText();
-};
-
-/*
-    Initializes the test environment. This function is automatically invoked
-    before the first test function.
- */
-void TestMsgConversationWidget::initTestCase()
-{
-}
-
-/*
-    Cleans up the test environment. This function is automatically invoked
-    after the last test function.
- */
-void TestMsgConversationWidget::cleanupTestCase()
-{
-}
-
-/*
-    Performs initialization for a single test function. This function is
-    automatically invoked before each test function.
- */
-void TestMsgConversationWidget::init()
-{
-    hbframeitem_framedrawer_callcount = 0;
-    hbstyle_setitemname_callcount = 0;
-    hbframedrawer_setframetype_callcount = 0;
-    hbtextedit_setsmileysenabled_callcount = 0;
-    hbtextedit_setreadonly_callcount = 0;
-    hbwidget_parent = NULL;
-}
-
-/*
-    Performs cleanup for a single test function. This function is auto-
-    matically invoked after each test function.
- */
-void TestMsgConversationWidget::cleanup()
-{
-}
-
-/*
-    Test the constructor with different parent arguments:
-    
-        1. null parent (i.e. default parent argument) and
-        2. non-null parent.
- */
-void TestMsgConversationWidget::testConstructor()
-{
-    // 1.
-    MsgConversationWidget *widget = new MsgConversationWidget();
-    QVERIFY(!hbwidget_parent);
-    delete widget;
-    
-    // 2.
-    MsgConversationWidget parent(NULL);
-    widget = new MsgConversationWidget(&parent);
-    QVERIFY(hbwidget_parent == &parent);
-    
-    QVERIFY(6 == hbframeitem_framedrawer_callcount);
-    QVERIFY(6 == hbframedrawer_setframetype_callcount);
-    QVERIFY(6 == hbstyle_setitemname_callcount);
-    
-    delete widget;
-}
-
-void TestMsgConversationWidget::testSetSubject()
-{
-    // 1.
-    MsgConversationWidget* myWidget = new MsgConversationWidget();
-    myWidget->setSubject(SUBJECT);
-    QVERIFY(1 == hbtextedit_setreadonly_callcount);
-    QVERIFY(1 == hbtextedit_setsmileysenabled_callcount);
-    
-    delete myWidget;
-}
-
-void TestMsgConversationWidget::testSetBodyText()
-{
-    // 1.
-    MsgConversationWidget* myWidget = new MsgConversationWidget();
-    myWidget->setBodyText(BODYTEXT);
-    QVERIFY(1 == hbtextedit_setreadonly_callcount);
-    QVERIFY(1 == hbtextedit_setsmileysenabled_callcount);
-    
-    delete myWidget;
-}
-
-/*
-    Implement a main() function that initializes the test environment,
-    executes all tests in the order they were defined, and finally cleans up
-    the test environment.
- */
-QTEST_APPLESS_MAIN(TestMsgConversationWidget)
-
-/*
-    Because both the declaration and the implementation of our test class are
-    in a single .cpp file, we also need to include the generated moc file to
-    make Qt's introspection work.
- */
-#include "unittest_msgconversationwidget.moc"
--- a/messagingapp/msgui/conversationview/tsrc/unittests/unittest_msgconversationwidget/unittest_msgconversationwidget.pro	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-#
-# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-# 
-# Description:
-#
-#
-
-CONFIG            += qtestlib symbian_test
-INCLUDEPATH       += .
-MMP_RULES         += "USERINCLUDE . ../../../../../../inc"
-MOC_DIR            = moc
-TARGET             = unittest_msgconversationwidget
-TARGET.CAPABILITY  = All -TCB
-TEMPLATE           = app
-
-HEADERS += hbwidget.h \
-           msgconversationwidgetheaders.h \
-           ../../../inc/msgconversationwidget.h
-
-SOURCES += unittest_msgconversationwidget.cpp \
-           ../../../src/msgconversationwidget.cpp
--- a/messagingapp/msgui/conversationview/tsrc/unittests/unittests.pro	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-#
-# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-# 
-# Description:
-#
-#
-
-CONFIG  += symbian_test
-SUBDIRS += unittest_nmexampleadapterclass \
-           unittest_nmexamplesymbianclass \
-           unittest_nmexampleview
-TEMPLATE = subdirs
--- a/messagingapp/msgui/eabi/conversationviewu.def	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/eabi/conversationviewu.def	Fri Sep 17 08:28:39 2010 +0300
@@ -5,29 +5,30 @@
 	_ZN23MsgConversationBaseView11qt_metacastEPKc @ 4 NONAME
 	_ZN23MsgConversationBaseView12clearContentEv @ 5 NONAME
 	_ZN23MsgConversationBaseView14conversationIdEv @ 6 NONAME
-	_ZN23MsgConversationBaseView15handleViewReadyEv @ 7 NONAME
-	_ZN23MsgConversationBaseView16openConversationEx @ 8 NONAME
-	_ZN23MsgConversationBaseView16staticMetaObjectE @ 9 NONAME DATA 16
-	_ZN23MsgConversationBaseView18markMessagesAsReadEv @ 10 NONAME
-	_ZN23MsgConversationBaseView19getStaticMetaObjectEv @ 11 NONAME
-	_ZN23MsgConversationBaseView19saveContentToDraftsEv @ 12 NONAME
-	_ZN23MsgConversationBaseView21closeConversationViewEv @ 13 NONAME
-	_ZN23MsgConversationBaseView21doDelayedConstructionEv @ 14 NONAME
-	_ZN23MsgConversationBaseView22conversationViewClosedEv @ 15 NONAME
-	_ZN23MsgConversationBaseView26handleConversationIdChangeEx @ 16 NONAME
-	_ZN23MsgConversationBaseView8handleOkERK8QVariant @ 17 NONAME
-	_ZN23MsgConversationBaseView8initViewEv @ 18 NONAME
-	_ZN23MsgConversationBaseView9setPSCVIdEb @ 19 NONAME
-	_ZN23MsgConversationBaseViewC1EP13QGraphicsItem @ 20 NONAME
-	_ZN23MsgConversationBaseViewC2EP13QGraphicsItem @ 21 NONAME
-	_ZN23MsgConversationBaseViewD0Ev @ 22 NONAME
-	_ZN23MsgConversationBaseViewD1Ev @ 23 NONAME
-	_ZN23MsgConversationBaseViewD2Ev @ 24 NONAME
-	_ZNK23MsgConversationBaseView10metaObjectEv @ 25 NONAME
-	_ZTI23MsgConversationBaseView @ 26 NONAME
-	_ZTV23MsgConversationBaseView @ 27 NONAME
-	_ZThn16_N23MsgConversationBaseViewD0Ev @ 28 NONAME
-	_ZThn16_N23MsgConversationBaseViewD1Ev @ 29 NONAME
-	_ZThn8_N23MsgConversationBaseViewD0Ev @ 30 NONAME
-	_ZThn8_N23MsgConversationBaseViewD1Ev @ 31 NONAME
+	_ZN23MsgConversationBaseView14handleKeyEventEi @ 7 NONAME
+	_ZN23MsgConversationBaseView15handleViewReadyEv @ 8 NONAME
+	_ZN23MsgConversationBaseView16openConversationEx @ 9 NONAME
+	_ZN23MsgConversationBaseView16staticMetaObjectE @ 10 NONAME DATA 16
+	_ZN23MsgConversationBaseView18markMessagesAsReadEv @ 11 NONAME
+	_ZN23MsgConversationBaseView19getStaticMetaObjectEv @ 12 NONAME
+	_ZN23MsgConversationBaseView19saveContentToDraftsEv @ 13 NONAME
+	_ZN23MsgConversationBaseView21closeConversationViewEv @ 14 NONAME
+	_ZN23MsgConversationBaseView21doDelayedConstructionEv @ 15 NONAME
+	_ZN23MsgConversationBaseView22conversationViewClosedEv @ 16 NONAME
+	_ZN23MsgConversationBaseView26handleConversationIdChangeEx @ 17 NONAME
+	_ZN23MsgConversationBaseView8handleOkERK8QVariant @ 18 NONAME
+	_ZN23MsgConversationBaseView8initViewEv @ 19 NONAME
+	_ZN23MsgConversationBaseView9setPSCVIdEb @ 20 NONAME
+	_ZN23MsgConversationBaseViewC1EP13QGraphicsItem @ 21 NONAME
+	_ZN23MsgConversationBaseViewC2EP13QGraphicsItem @ 22 NONAME
+	_ZN23MsgConversationBaseViewD0Ev @ 23 NONAME
+	_ZN23MsgConversationBaseViewD1Ev @ 24 NONAME
+	_ZN23MsgConversationBaseViewD2Ev @ 25 NONAME
+	_ZNK23MsgConversationBaseView10metaObjectEv @ 26 NONAME
+	_ZTI23MsgConversationBaseView @ 27 NONAME
+	_ZTV23MsgConversationBaseView @ 28 NONAME
+	_ZThn16_N23MsgConversationBaseViewD0Ev @ 29 NONAME
+	_ZThn16_N23MsgConversationBaseViewD1Ev @ 30 NONAME
+	_ZThn8_N23MsgConversationBaseViewD0Ev @ 31 NONAME
+	_ZThn8_N23MsgConversationBaseViewD1Ev @ 32 NONAME
 
--- a/messagingapp/msgui/eabi/msgaudiofetcheru.def	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/eabi/msgaudiofetcheru.def	Fri Sep 17 08:28:39 2010 +0300
@@ -1,24 +1,27 @@
 EXPORTS
-	_ZN19MsgAudioFetcherView11initToolBarEv @ 1 NONAME
-	_ZN19MsgAudioFetcherView11qt_metacallEN11QMetaObject4CallEiPPv @ 2 NONAME
-	_ZN19MsgAudioFetcherView11qt_metacastEPKc @ 3 NONAME
-	_ZN19MsgAudioFetcherView13enableToolBarEb @ 4 NONAME
-	_ZN19MsgAudioFetcherView14initMainWidgetEv @ 5 NONAME
-	_ZN19MsgAudioFetcherView16staticMetaObjectE @ 6 NONAME DATA 16
-	_ZN19MsgAudioFetcherView19getStaticMetaObjectEv @ 7 NONAME
-	_ZN19MsgAudioFetcherView19removeToolBarActionEv @ 8 NONAME
-	_ZN19MsgAudioFetcherView23on_leftAction_triggeredEv @ 9 NONAME
-	_ZN19MsgAudioFetcherView24on_rightAction_triggeredEv @ 10 NONAME
-	_ZN19MsgAudioFetcherViewC1ERK5QListI8QVariantE @ 11 NONAME
-	_ZN19MsgAudioFetcherViewC2ERK5QListI8QVariantE @ 12 NONAME
-	_ZN19MsgAudioFetcherViewD0Ev @ 13 NONAME
-	_ZN19MsgAudioFetcherViewD1Ev @ 14 NONAME
-	_ZN19MsgAudioFetcherViewD2Ev @ 15 NONAME
-	_ZNK19MsgAudioFetcherView10metaObjectEv @ 16 NONAME
-	_ZTI19MsgAudioFetcherView @ 17 NONAME
-	_ZTV19MsgAudioFetcherView @ 18 NONAME
-	_ZThn16_N19MsgAudioFetcherViewD0Ev @ 19 NONAME
-	_ZThn16_N19MsgAudioFetcherViewD1Ev @ 20 NONAME
-	_ZThn8_N19MsgAudioFetcherViewD0Ev @ 21 NONAME
-	_ZThn8_N19MsgAudioFetcherViewD1Ev @ 22 NONAME
+	_ZN21MsgAudioFetcherDialog11initActionsEv @ 1 NONAME
+	_ZN21MsgAudioFetcherDialog11qt_metacallEN11QMetaObject4CallEiPPv @ 2 NONAME
+	_ZN21MsgAudioFetcherDialog11qt_metacastEPKc @ 3 NONAME
+	_ZN21MsgAudioFetcherDialog13audioSelectedER7QString @ 4 NONAME
+	_ZN21MsgAudioFetcherDialog14initMainWidgetEv @ 5 NONAME
+	_ZN21MsgAudioFetcherDialog14onCancelActionEv @ 6 NONAME
+	_ZN21MsgAudioFetcherDialog14onSelectActionEv @ 7 NONAME
+	_ZN21MsgAudioFetcherDialog16staticMetaObjectE @ 8 NONAME DATA 16
+	_ZN21MsgAudioFetcherDialog17on_list_activatedERK11QModelIndex @ 9 NONAME
+	_ZN21MsgAudioFetcherDialog18getCurrentItemPathEv @ 10 NONAME
+	_ZN21MsgAudioFetcherDialog19getStaticMetaObjectEv @ 11 NONAME
+	_ZN21MsgAudioFetcherDialog21doDelayedConstructionEv @ 12 NONAME
+	_ZN21MsgAudioFetcherDialog5resetEv @ 13 NONAME
+	_ZN21MsgAudioFetcherDialogC1EP13QGraphicsItem @ 14 NONAME
+	_ZN21MsgAudioFetcherDialogC2EP13QGraphicsItem @ 15 NONAME
+	_ZN21MsgAudioFetcherDialogD0Ev @ 16 NONAME
+	_ZN21MsgAudioFetcherDialogD1Ev @ 17 NONAME
+	_ZN21MsgAudioFetcherDialogD2Ev @ 18 NONAME
+	_ZNK21MsgAudioFetcherDialog10metaObjectEv @ 19 NONAME
+	_ZTI21MsgAudioFetcherDialog @ 20 NONAME
+	_ZTV21MsgAudioFetcherDialog @ 21 NONAME
+	_ZThn16_N21MsgAudioFetcherDialogD0Ev @ 22 NONAME
+	_ZThn16_N21MsgAudioFetcherDialogD1Ev @ 23 NONAME
+	_ZThn8_N21MsgAudioFetcherDialogD0Ev @ 24 NONAME
+	_ZThn8_N21MsgAudioFetcherDialogD1Ev @ 25 NONAME
 
--- a/messagingapp/msgui/eabi/unifiededitoru.def	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/eabi/unifiededitoru.def	Fri Sep 17 08:28:39 2010 +0300
@@ -22,48 +22,53 @@
 	_ZN20MsgUnifiedEditorView13imagesFetchedERK8QVariant @ 21 NONAME
 	_ZN20MsgUnifiedEditorView14addAttachmentsE11QStringList @ 22 NONAME
 	_ZN20MsgUnifiedEditorView14changePriorityEv @ 23 NONAME
-	_ZN20MsgUnifiedEditorView15contactsFetchedERK8QVariant @ 24 NONAME
-	_ZN20MsgUnifiedEditorView15formatAddressesER5QListIP23ConvergedMessageAddressE @ 25 NONAME
-	_ZN20MsgUnifiedEditorView15populateContentERK5QListI8QVariantE @ 26 NONAME
-	_ZN20MsgUnifiedEditorView16createTempFolderEv @ 27 NONAME
-	_ZN20MsgUnifiedEditorView16enableSendButtonEb @ 28 NONAME
-	_ZN20MsgUnifiedEditorView16generateFileNameER7QString @ 29 NONAME
-	_ZN20MsgUnifiedEditorView16onContentChangedEv @ 30 NONAME
-	_ZN20MsgUnifiedEditorView16removeTempFolderEv @ 31 NONAME
-	_ZN20MsgUnifiedEditorView16staticMetaObjectE @ 32 NONAME DATA 16
-	_ZN20MsgUnifiedEditorView17onDialogDeleteMsgEP8HbAction @ 33 NONAME
-	_ZN20MsgUnifiedEditorView17openDraftsMessageERK5QListI8QVariantE @ 34 NONAME
-	_ZN20MsgUnifiedEditorView19getStaticMetaObjectEv @ 35 NONAME
-	_ZN20MsgUnifiedEditorView19onDialogMmsSettingsEP8HbAction @ 36 NONAME
-	_ZN20MsgUnifiedEditorView19onDialogSmsSettingsEP8HbAction @ 37 NONAME
-	_ZN20MsgUnifiedEditorView19saveContentToDraftsEv @ 38 NONAME
-	_ZN20MsgUnifiedEditorView19serviceRequestErrorEiRK7QString @ 39 NONAME
-	_ZN20MsgUnifiedEditorView20activateInputBlockerEv @ 40 NONAME
-	_ZN20MsgUnifiedEditorView21doDelayedConstructionEv @ 41 NONAME
-	_ZN20MsgUnifiedEditorView21fetchMessageFromStoreER18ConvergedMessageIdN16ConvergedMessage11MessageTypeEi @ 42 NONAME
-	_ZN20MsgUnifiedEditorView22deactivateInputBlockerEv @ 43 NONAME
-	_ZN20MsgUnifiedEditorView22setAttachOptionEnabledENS_16TBE_AttachOptionEb @ 44 NONAME
-	_ZN20MsgUnifiedEditorView23handleViewExtnActivatedEP16HbListWidgetItem @ 45 NONAME
-	_ZN20MsgUnifiedEditorView25populateContentIntoEditorERK16ConvergedMessageb @ 46 NONAME
-	_ZN20MsgUnifiedEditorView25removeAttachmentContainerEv @ 47 NONAME
-	_ZN20MsgUnifiedEditorView25updateOtherRecipientCountEb @ 48 NONAME
-	_ZN20MsgUnifiedEditorView4sendEv @ 49 NONAME
-	_ZN20MsgUnifiedEditorView7addMenuEv @ 50 NONAME
-	_ZN20MsgUnifiedEditorView8addCcBccEv @ 51 NONAME
-	_ZN20MsgUnifiedEditorView8initViewEv @ 52 NONAME
-	_ZN20MsgUnifiedEditorView8setFocusEP26MsgUnifiedEditorBaseWidget @ 53 NONAME
-	_ZN20MsgUnifiedEditorView9vkbClosedEv @ 54 NONAME
-	_ZN20MsgUnifiedEditorView9vkbOpenedEv @ 55 NONAME
-	_ZN20MsgUnifiedEditorViewC1EP13QGraphicsItem @ 56 NONAME
-	_ZN20MsgUnifiedEditorViewC2EP13QGraphicsItem @ 57 NONAME
-	_ZN20MsgUnifiedEditorViewD0Ev @ 58 NONAME
-	_ZN20MsgUnifiedEditorViewD1Ev @ 59 NONAME
-	_ZN20MsgUnifiedEditorViewD2Ev @ 60 NONAME
-	_ZNK20MsgUnifiedEditorView10metaObjectEv @ 61 NONAME
-	_ZTI20MsgUnifiedEditorView @ 62 NONAME
-	_ZTV20MsgUnifiedEditorView @ 63 NONAME
-	_ZThn16_N20MsgUnifiedEditorViewD0Ev @ 64 NONAME
-	_ZThn16_N20MsgUnifiedEditorViewD1Ev @ 65 NONAME
-	_ZThn8_N20MsgUnifiedEditorViewD0Ev @ 66 NONAME
-	_ZThn8_N20MsgUnifiedEditorViewD1Ev @ 67 NONAME
+	_ZN20MsgUnifiedEditorView14handleKeyEventEi @ 24 NONAME
+	_ZN20MsgUnifiedEditorView14vkbAboutToOpenEv @ 25 NONAME
+	_ZN20MsgUnifiedEditorView15contactsFetchedERK8QVariant @ 26 NONAME
+	_ZN20MsgUnifiedEditorView15formatAddressesER5QListIP23ConvergedMessageAddressE @ 27 NONAME
+	_ZN20MsgUnifiedEditorView15onAudioSelectedER7QString @ 28 NONAME
+	_ZN20MsgUnifiedEditorView15populateContentERK5QListI8QVariantE @ 29 NONAME
+	_ZN20MsgUnifiedEditorView15vkbAboutToCloseEv @ 30 NONAME
+	_ZN20MsgUnifiedEditorView16createTempFolderEv @ 31 NONAME
+	_ZN20MsgUnifiedEditorView16enableSendButtonEb @ 32 NONAME
+	_ZN20MsgUnifiedEditorView16generateFileNameER7QString @ 33 NONAME
+	_ZN20MsgUnifiedEditorView16onContentChangedEv @ 34 NONAME
+	_ZN20MsgUnifiedEditorView16removeTempFolderEv @ 35 NONAME
+	_ZN20MsgUnifiedEditorView16staticMetaObjectE @ 36 NONAME DATA 16
+	_ZN20MsgUnifiedEditorView17isReplyPathBrokenEv @ 37 NONAME
+	_ZN20MsgUnifiedEditorView17onDialogDeleteMsgEP8HbAction @ 38 NONAME
+	_ZN20MsgUnifiedEditorView17openDraftsMessageERK5QListI8QVariantE @ 39 NONAME
+	_ZN20MsgUnifiedEditorView19getStaticMetaObjectEv @ 40 NONAME
+	_ZN20MsgUnifiedEditorView19onDialogMmsSettingsEP8HbAction @ 41 NONAME
+	_ZN20MsgUnifiedEditorView19onDialogSmsSettingsEP8HbAction @ 42 NONAME
+	_ZN20MsgUnifiedEditorView19saveContentToDraftsEv @ 43 NONAME
+	_ZN20MsgUnifiedEditorView19serviceRequestErrorEiRK7QString @ 44 NONAME
+	_ZN20MsgUnifiedEditorView20activateInputBlockerEv @ 45 NONAME
+	_ZN20MsgUnifiedEditorView21doDelayedConstructionEv @ 46 NONAME
+	_ZN20MsgUnifiedEditorView21fetchMessageFromStoreER18ConvergedMessageIdN16ConvergedMessage11MessageTypeEi @ 47 NONAME
+	_ZN20MsgUnifiedEditorView22deactivateInputBlockerEv @ 48 NONAME
+	_ZN20MsgUnifiedEditorView22setAttachOptionEnabledENS_16TBE_AttachOptionEb @ 49 NONAME
+	_ZN20MsgUnifiedEditorView23handleViewExtnActivatedEP16HbListWidgetItem @ 50 NONAME
+	_ZN20MsgUnifiedEditorView25populateContentIntoEditorERK16ConvergedMessageb @ 51 NONAME
+	_ZN20MsgUnifiedEditorView25removeAttachmentContainerEv @ 52 NONAME
+	_ZN20MsgUnifiedEditorView25updateOtherRecipientCountEb @ 53 NONAME
+	_ZN20MsgUnifiedEditorView4sendEv @ 54 NONAME
+	_ZN20MsgUnifiedEditorView7addMenuEv @ 55 NONAME
+	_ZN20MsgUnifiedEditorView8addCcBccEv @ 56 NONAME
+	_ZN20MsgUnifiedEditorView8initViewEv @ 57 NONAME
+	_ZN20MsgUnifiedEditorView8setFocusEP26MsgUnifiedEditorBaseWidget @ 58 NONAME
+	_ZN20MsgUnifiedEditorView9vkbClosedEv @ 59 NONAME
+	_ZN20MsgUnifiedEditorView9vkbOpenedEv @ 60 NONAME
+	_ZN20MsgUnifiedEditorViewC1EP13QGraphicsItem @ 61 NONAME
+	_ZN20MsgUnifiedEditorViewC2EP13QGraphicsItem @ 62 NONAME
+	_ZN20MsgUnifiedEditorViewD0Ev @ 63 NONAME
+	_ZN20MsgUnifiedEditorViewD1Ev @ 64 NONAME
+	_ZN20MsgUnifiedEditorViewD2Ev @ 65 NONAME
+	_ZNK20MsgUnifiedEditorView10metaObjectEv @ 66 NONAME
+	_ZTI20MsgUnifiedEditorView @ 67 NONAME
+	_ZTV20MsgUnifiedEditorView @ 68 NONAME
+	_ZThn16_N20MsgUnifiedEditorViewD0Ev @ 69 NONAME
+	_ZThn16_N20MsgUnifiedEditorViewD1Ev @ 70 NONAME
+	_ZThn8_N20MsgUnifiedEditorViewD0Ev @ 71 NONAME
+	_ZThn8_N20MsgUnifiedEditorViewD1Ev @ 72 NONAME
 
--- a/messagingapp/msgui/eabi/unifiedvieweru.def	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/eabi/unifiedvieweru.def	Fri Sep 17 08:28:39 2010 +0300
@@ -7,24 +7,26 @@
 	_ZN13UnifiedViewer12clearContentEv @ 6 NONAME
 	_ZN13UnifiedViewer12launchEditorEN11MsgBaseView18UniEditorOperationE @ 7 NONAME
 	_ZN13UnifiedViewer13createToolBarEv @ 8 NONAME
-	_ZN13UnifiedViewer15handleFwdActionEv @ 9 NONAME
-	_ZN13UnifiedViewer15populateContentEibi @ 10 NONAME
-	_ZN13UnifiedViewer16staticMetaObjectE @ 11 NONAME DATA 16
-	_ZN13UnifiedViewer17handleReplyActionEv @ 12 NONAME
-	_ZN13UnifiedViewer17onDialogDeleteMsgEi @ 13 NONAME
-	_ZN13UnifiedViewer18handleDeleteActionEv @ 14 NONAME
-	_ZN13UnifiedViewer19getStaticMetaObjectEv @ 15 NONAME
-	_ZN13UnifiedViewer20handleReplyAllActionEv @ 16 NONAME
-	_ZN13UnifiedViewerC1EiP13QGraphicsItem @ 17 NONAME
-	_ZN13UnifiedViewerC2EiP13QGraphicsItem @ 18 NONAME
-	_ZN13UnifiedViewerD0Ev @ 19 NONAME
-	_ZN13UnifiedViewerD1Ev @ 20 NONAME
-	_ZN13UnifiedViewerD2Ev @ 21 NONAME
-	_ZNK13UnifiedViewer10metaObjectEv @ 22 NONAME
-	_ZTI13UnifiedViewer @ 23 NONAME
-	_ZTV13UnifiedViewer @ 24 NONAME
-	_ZThn16_N13UnifiedViewerD0Ev @ 25 NONAME
-	_ZThn16_N13UnifiedViewerD1Ev @ 26 NONAME
-	_ZThn8_N13UnifiedViewerD0Ev @ 27 NONAME
-	_ZThn8_N13UnifiedViewerD1Ev @ 28 NONAME
+	_ZN13UnifiedViewer14handleKeyEventEi @ 9 NONAME
+	_ZN13UnifiedViewer15handleFwdActionEv @ 10 NONAME
+	_ZN13UnifiedViewer15populateContentEibix @ 11 NONAME
+	_ZN13UnifiedViewer16staticMetaObjectE @ 12 NONAME DATA 16
+	_ZN13UnifiedViewer17handleReplyActionEv @ 13 NONAME
+	_ZN13UnifiedViewer17onDialogDeleteMsgEi @ 14 NONAME
+	_ZN13UnifiedViewer18handleDeleteActionEv @ 15 NONAME
+	_ZN13UnifiedViewer19getStaticMetaObjectEv @ 16 NONAME
+	_ZN13UnifiedViewer20handleReplyAllActionEv @ 17 NONAME
+	_ZN13UnifiedViewer4callERK7QString @ 18 NONAME
+	_ZN13UnifiedViewerC1EiP13QGraphicsItem @ 19 NONAME
+	_ZN13UnifiedViewerC2EiP13QGraphicsItem @ 20 NONAME
+	_ZN13UnifiedViewerD0Ev @ 21 NONAME
+	_ZN13UnifiedViewerD1Ev @ 22 NONAME
+	_ZN13UnifiedViewerD2Ev @ 23 NONAME
+	_ZNK13UnifiedViewer10metaObjectEv @ 24 NONAME
+	_ZTI13UnifiedViewer @ 25 NONAME
+	_ZTV13UnifiedViewer @ 26 NONAME
+	_ZThn16_N13UnifiedViewerD0Ev @ 27 NONAME
+	_ZThn16_N13UnifiedViewerD1Ev @ 28 NONAME
+	_ZThn8_N13UnifiedViewerD0Ev @ 29 NONAME
+	_ZThn8_N13UnifiedViewerD1Ev @ 30 NONAME
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/inc/msgaudiofetcherdialog.h	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *     The header file for messaging's audio fetcher view.
+ *
+ */
+
+#ifndef MSGAUDIOFETCHERDIALOG_H
+#define MSGAUDIOFETCHERDIALOG_H
+
+#ifdef BUILD_MSGAUDIOFETCHER_DLL
+#define MSGAUDIOFETCHER_DLL_EXPORT Q_DECL_EXPORT
+#else
+#define MSGAUDIOFETCHER_DLL_EXPORT Q_DECL_IMPORT
+#endif
+
+// SYSTEM INCLUDES
+#include <QObject>
+#include <hblistwidget.h>
+#include <HbDialog>
+
+// FORWARD DECLARATIONS
+//class MsgAudioFetcherWidget;
+class HbAction;
+class HbListView;
+class MsgAudioFetcherModel;
+class MsgAudioPreview;
+
+/**
+ * @class MsgAudioFetcherView
+ * @brief This class is messaging's audio fetcher view
+ */
+class MSGAUDIOFETCHER_DLL_EXPORT MsgAudioFetcherDialog : public HbDialog
+{
+Q_OBJECT
+
+public:
+    /**
+     * Constructor
+     */
+    explicit MsgAudioFetcherDialog(QGraphicsItem *parent = 0);
+
+    /**
+     * Destructor
+     */
+    ~MsgAudioFetcherDialog();  
+        
+private:
+    /**
+     * Creates a widget and sets it to the view
+     */
+    void initMainWidget();
+
+    /**
+     * Initializes dialog actions
+     */
+    void initActions();   
+    
+    /**
+     * Returns the selected audio path
+     */
+    QString getCurrentItemPath();
+
+signals:
+
+    /**
+     * Emits when audio selected from dialog
+     */
+    void audioSelected(QString& filePath);
+    
+private slots:
+
+    /**
+     * On View Ready signal do some construction
+     */
+    void doDelayedConstruction();
+    
+    /**
+     * Handles toolbar's leftaction (select)
+     */
+    void onSelectAction();
+
+    /**
+     * Handles toolbar's rightaction (cancel)
+     */
+    void onCancelAction();
+
+    /**
+     * On close of dialog this resets the item
+     */
+    void reset();
+    
+    /**
+     * This gets called after list item gets 
+     * activated
+     */
+    void on_list_activated(const QModelIndex &index);
+
+private:
+    
+    /**
+     * List for displaying the audio list
+     */
+    HbListView* mListView;
+    
+    /**
+     * Model for the List View
+     */
+    MsgAudioFetcherModel* mFetcherModel;
+    
+    /**
+     * Audio preview instance
+     */
+    MsgAudioPreview* mAudioPreview;
+    
+    /**
+     * Toolbar's left SELECT action
+     */
+    HbAction *mLeftAction;
+    
+    /**
+     * last selected item
+     */
+    QModelIndex mSeletedItem;
+    
+    /**
+     * This to enable the left action in dialog
+     */
+    bool mSelected;
+};
+
+#endif /* MSGAUDIOFETCHERVIEW_H */
--- a/messagingapp/msgui/inc/msgbaseview.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/inc/msgbaseview.h	Fri Sep 17 08:28:39 2010 +0300
@@ -34,6 +34,17 @@
     MsgBaseView(QGraphicsItem* parent=0):HbView(parent){}
     
     /**
+     * Handler for HW key events.
+     * @param key Key code.
+     * @return true if key event handled else false.
+     */
+    virtual bool handleKeyEvent(int key)
+    {
+        Q_UNUSED(key)
+        return false;
+    }
+
+    /**
      * enum defining view id(s).
      */
     enum viewId
@@ -45,8 +56,7 @@
         UNIEDITOR,
         UNIVIEWER,
         MSGSETTINGS,
-        SERVICE,
-        AUDIOFETCHER
+        SERVICE
         };
     
     /**
@@ -76,7 +86,6 @@
      * Forceful close of conversation view
      */
     void closeOpenConversationView();
-
 };
 
 #endif //MSG_BASE_VIEW_H_
--- a/messagingapp/msgui/msgapp/inc/msgactivityhandler.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/msgapp/inc/msgactivityhandler.h	Fri Sep 17 08:28:39 2010 +0300
@@ -24,6 +24,7 @@
 
 class MsgMainWindow;
 class MsgViewManager;
+class AfActivityStorage;
 
 class MsgActivityHandler: public QObject
 {
@@ -71,7 +72,13 @@
     /**
      * main window reference not owned.
      */
-    MsgMainWindow* mMainWindow;
+    MsgMainWindow *mMainWindow;
+
+    /**
+     * App Framework activity service.
+     * Own.
+     */
+    AfActivityStorage *mActivityStorage;
 };
 
 #endif /* MSGACTIVITYHANDLER_H_ */
--- a/messagingapp/msgui/msgapp/inc/msglistviewitem.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/msgapp/inc/msglistviewitem.h	Fri Sep 17 08:28:39 2010 +0300
@@ -149,6 +149,14 @@
      * To display the presence indication
      */
     HbIconItem* mMsgCommonIndicatorItem;
+
+    /**
+     * Unit Testing
+     */
+    #ifdef MSGUI_UNIT_TEST
+	  friend class TestMsgListViewItem;
+	  
+	#endif
     
     };
 
--- a/messagingapp/msgui/msgapp/inc/msgmainwindow.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/msgapp/inc/msgmainwindow.h	Fri Sep 17 08:28:39 2010 +0300
@@ -53,6 +53,15 @@
      * Returns view manager.
      */
     MsgViewManager* viewManager();
+
+protected:
+
+    /**
+     * Key press event handler
+     * @see QGraphicsItem
+     */
+    void keyPressEvent(QKeyEvent *event);
+
 private:
     MsgServiceInterface* mMsgSI;
     MsgSendServiceInterface* mMsgSendSI;
--- a/messagingapp/msgui/msgapp/inc/msgviewmanager.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/msgapp/inc/msgviewmanager.h	Fri Sep 17 08:28:39 2010 +0300
@@ -33,7 +33,6 @@
 class MsgSettingsView;
 class HbAction;
 class HbView;
-class MsgAudioFetcherView;
 
 class MsgViewManager: public QObject
 {
@@ -96,6 +95,14 @@
 	 * Saves the content of editor or Cv to draft.
 	 */
     int saveContentToDraft();
+
+    /**
+     * Handles the HW key events.
+     * @param key key type.
+     * @return true if key event handled else false.
+     */
+    bool handleKeyEvent(int key);
+
 private:
     /**
      * swiches back to last view after service request is complete.
@@ -178,11 +185,6 @@
     void populateUniEditorAfterViewReady(const QVariantList& editorData);
     
     /**
-     * Launch Audio fetcher view
-     */
-    void switchToAudioFetcher(const QVariantList& data);
-	
-	/**
 	 * opens unieditor as activity.
 	 * @param activityMsgId activity msg id.
 	 */
@@ -247,7 +249,7 @@
     UnifiedViewer* mUniViewer;
     DraftsListView* mDraftsListView;
     MsgSettingsView* mSettingsView;
-    MsgAudioFetcherView* mAudioFetcherView;
+    
     HbAction* mBackAction;
 
     int mPreviousView;
--- a/messagingapp/msgui/msgapp/msgapp.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/msgapp/msgapp.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -21,7 +21,6 @@
 INCLUDEPATH += .
 INCLUDEPATH += ../inc
 INCLUDEPATH += ../../../inc
-INCLUDEPATH += ../msgaudiofetcher/inc
 INCLUDEPATH += ../unifiededitor/inc
 INCLUDEPATH += ../appengine/inc
 INCLUDEPATH += ../conversationview/inc
@@ -102,6 +101,6 @@
         -lQtContacts \
         -lsettingsview \
         -lringbc \
-        -lunidatamodelloader \
-        -lmsgaudiofetcher
+        -lafservice \
+        -lunidatamodelloader 
 
--- a/messagingapp/msgui/msgapp/rom/messaging_uda.confml	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/msgapp/rom/messaging_uda.confml	Fri Sep 17 08:28:39 2010 +0300
@@ -10,7 +10,7 @@
 	</confml:feature>
 	<confml:data>
 		<confml:messaging_uda>
-			<confml:Enabled>true</confml:Enabled>
+			<confml:Enabled>false</confml:Enabled>
 		</confml:messaging_uda>
 	</confml:data>
 </confml:configuration>
--- a/messagingapp/msgui/msgapp/rom/msgapp.iby	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/msgapp/rom/msgapp.iby	Fri Sep 17 08:28:39 2010 +0300
@@ -19,15 +19,12 @@
 
 file=ABI_DIR\UREL\messaging101.exe                              SHARED_LIB_DIR\messaging101.exe
 data=DATAZ_\private\10003a3f\import\apps\messaging101_reg.rsc   private\10003a3f\import\apps\messaging101_reg.rsc
-data=DATAZ_\resource\apps\messaging101.mif                        resource\apps\messaging101.mif
 
 data=DATAZ_\system\install\msgapp_stub.sis					           system\install\msgapp_stub.sis
 
-<clip>
-      data=ZRESOURCE\hb\splashml\messaging101.splashml  RESOURCE_FILES_DIR\hb\splashml\messaging101.splashml
-      data=ZRESOURCE\hb\splashml\messaging101.docml  RESOURCE_FILES_DIR\hb\splashml\messaging101.docml
-      data=ZRESOURCE\hb\splashml\messaging101_dummy.splashml  RESOURCE_FILES_DIR\hb\splashml\messaging101_dummy.splashml
-      data=ZRESOURCE\hb\splashml\messaging101_dummy.docml  RESOURCE_FILES_DIR\hb\splashml\messaging101_dummy.docml
-</clip>
+data=ZRESOURCE\hb\splashml\messaging101.splashml  RESOURCE_FILES_DIR\hb\splashml\messaging101.splashml
+data=ZRESOURCE\hb\splashml\messaging101.docml  RESOURCE_FILES_DIR\hb\splashml\messaging101.docml
+data=ZRESOURCE\hb\splashml\messaging101_dummy.splashml  RESOURCE_FILES_DIR\hb\splashml\messaging101_dummy.splashml
+data=ZRESOURCE\hb\splashml\messaging101_dummy.docml  RESOURCE_FILES_DIR\hb\splashml\messaging101_dummy.docml
 
 #endif // __MSGAPP_IBY__
--- a/messagingapp/msgui/msgapp/src/msgactivityhandler.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/msgapp/src/msgactivityhandler.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -21,9 +21,8 @@
 #include "msgviewmanager.h"
 #include "msgbaseview.h"
 #include "msgmainwindow.h"
-#include <hbapplication.h>
-#include <hbactivitymanager.h>
 #include <QVariantHash>
+#include <afactivitystorage.h>
 
 const int INVALID_MSGID = -1;
 // Activity Names 
@@ -37,7 +36,7 @@
 MsgActivityHandler::MsgActivityHandler(QObject* parent):
     QObject(parent)
 {
-  
+    mActivityStorage = new AfActivityStorage();
 }
 
 //-----------------------------------------------------------------------------
@@ -46,7 +45,10 @@
 //-----------------------------------------------------------------------------
 MsgActivityHandler::~MsgActivityHandler()
 {
-   
+   if (mActivityStorage) {
+       delete mActivityStorage;
+       mActivityStorage = NULL;
+   }
 }
 
 //-----------------------------------------------------------------------------
@@ -55,9 +57,6 @@
 //-----------------------------------------------------------------------------
 void MsgActivityHandler::saveActivity()
 {
-    HbActivityManager* activityManager = 
-                        qobject_cast<HbApplication*>(qApp)->activityManager();
-                        
      int currentView = mMainWindow->viewManager()->currentView();
      int msgId = INVALID_MSGID;
      if((currentView == MsgBaseView::CV) || (currentView== MsgBaseView::UNIEDITOR))
@@ -81,16 +80,14 @@
         stream << msgId;
 
         // add the activity to the activity manager
-        bool ok = activityManager->addActivity(EditorActivityName, 
-                serializedActivity, metadata);
+        mActivityStorage->saveActivity(EditorActivityName, serializedActivity, metadata);
         }
     else
         {    
         stream << ListViewActivityName;
 
         // add the activity to the activity manager
-        bool ok = activityManager->addActivity(ListViewActivityName, 
-                serializedActivity, metadata);
+        mActivityStorage->saveActivity(ListViewActivityName, serializedActivity, metadata);
         }
 }
 
@@ -119,10 +116,8 @@
 //-----------------------------------------------------------------------------
 void MsgActivityHandler::clearActivities()
 {
-    HbActivityManager* activityManager = 
-                        qobject_cast<HbApplication*>(qApp)->activityManager();
-    activityManager->removeActivity(ListViewActivityName);   
-    activityManager->removeActivity(EditorActivityName);   
+    mActivityStorage->removeActivity(ListViewActivityName);
+    mActivityStorage->removeActivity(EditorActivityName);
 }
 
 //-----------------------------------------------------------------------------
--- a/messagingapp/msgui/msgapp/src/msglistview.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/msgapp/src/msglistview.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -55,6 +55,7 @@
 //Localized constants
 
 #define LOC_DIALOG_DELETE_CONVERSATION hbTrId("txt_messaging_dialog_delete_conversation")
+#define LOC_DIALOG_UNABLE_TO_DELETE_CONVERSATION hbTrId("txt_messaging_dialog_unable_to_delete_conversation")
 
 //itemspecific menu
 #define LOC_OPEN hbTrId("txt_common_menu_open")
@@ -225,10 +226,28 @@
 #ifdef _DEBUG_TRACES_
     qDebug() << "Inside MsgListView::deleteItem";
 #endif
-    //confirmation dialog.
-    HbMessageBox::question(LOC_DIALOG_DELETE_CONVERSATION,
-                           this,SLOT(onDialogDeleteMsg(HbAction*)),
-                           HbMessageBox::Delete | HbMessageBox::Cancel);    
+    QModelIndex index = mMsgList->currentIndex();
+    if (index.isValid())
+    {
+        int sendState = index.data(SendingState).toInt();
+        if(ConvergedMessage::Sending == sendState)
+        {
+            //confirmation dialog.
+            HbMessageBox::information(LOC_DIALOG_UNABLE_TO_DELETE_CONVERSATION,
+                0,0,
+                HbMessageBox::Ok);      
+        }
+        // not in sending state and hence can be deleted.
+        else
+        {
+            //confirmation dialog.
+            HbMessageBox::question(LOC_DIALOG_DELETE_CONVERSATION,
+                this,SLOT(onDialogDeleteMsg(HbAction*)),
+                HbMessageBox::Delete | HbMessageBox::Cancel);       
+        }
+
+    }
+    
 #ifdef _DEBUG_TRACES_	
     qDebug() << " Leaving MsgConversationView::deleteItem";
 #endif
@@ -362,12 +381,13 @@
     args << data;
 
     //service stuff.
-    QString serviceName("com.nokia.services.phonebookservices");
+    QString service("phonebookservices");
+    QString interface("com.nokia.symbian.IContactsEdit");
     QString operation("editCreateNew(QString,QString)");
 
     XQAiwRequest* request;
     XQApplicationManager appManager;
-    request = appManager.create(serviceName, "Fetch", operation, true); // embedded
+    request = appManager.create(service, interface, operation, true); // embedded
     if ( request == NULL )
         {
         return;       
@@ -393,12 +413,13 @@
     args << contactId;
 
     //service stuff.
-    QString serviceName("com.nokia.services.phonebookservices");
-    QString operation("open(int)");
+    QString service("phonebookservices");
+    QString interface("com.nokia.symbian.IContactsView");
+    QString operation("openContactCard(int)");
 
     XQAiwRequest* request;
     XQApplicationManager appManager;
-    request = appManager.create(serviceName, "Fetch", operation, true); // embedded
+    request = appManager.create(service, interface, operation, true); // embedded
     if ( request == NULL )
         {
         return;       
--- a/messagingapp/msgui/msgapp/src/msglistviewitem.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/msgapp/src/msglistviewitem.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -244,7 +244,7 @@
         switch (sendState) {
         case ConvergedMessage::Resend:
         {
-            previewText = LOC_MSG_RESEND_AT + dateTimeString;
+            previewText = LOC_MSG_RESEND_AT.arg(dateTimeString);
             dateTimeString = QString();            
             setCommonIndicator(MSG_OUTGOING_ICON);
             break;
--- a/messagingapp/msgui/msgapp/src/msgmainwindow.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/msgapp/src/msgmainwindow.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -23,6 +23,8 @@
 #include "msgsendserviceinterface.h"
 #include "conversationsengine.h"
 
+#include <QKeyEvent>
+
 
 //---------------------------------------------------------------
 // MsgMainWindow::MsgMainWindow
@@ -68,4 +70,24 @@
 {   
      return mViewManager; 
 }
+
+//---------------------------------------------------------------
+// MsgMainWindow::keyPressEvent
+// @see header
+//---------------------------------------------------------------
+void MsgMainWindow::keyPressEvent(QKeyEvent *event)
+{
+    bool eventHandled = false;
+    if (Qt::Key_Yes == event->key()) {
+        eventHandled = mViewManager->handleKeyEvent(event->key());
+    }
+
+    if (eventHandled) {
+        event->accept();
+    }
+    else {
+        HbMainWindow::keyPressEvent(event);
+    }
+
+}
 // End of file
--- a/messagingapp/msgui/msgapp/src/msgviewmanager.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/msgapp/src/msgviewmanager.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -41,7 +41,6 @@
 #include "unidatamodelplugininterface.h"
 #include "msgcontacthandler.h"
 #include "debugtraces.h"
-#include "msgaudiofetcherview.h"
 
 // LOCALIZATION
 #define LOC_DELETE_MESSAGE hbTrId("txt_messaging_dialog_delete_message")
@@ -51,7 +50,7 @@
 
 MsgViewManager::MsgViewManager(bool serviceRequest, HbMainWindow* mainWindow, QObject* parent,int activityMsgId) :
     QObject(parent), mMainWindow(mainWindow), mUniEditor(0), mListView(0), mConversationView(0),
-        mUniViewer(0), mDraftsListView(0), mSettingsView(0), mAudioFetcherView(0), mBackAction(0),
+        mUniViewer(0), mDraftsListView(0), mSettingsView(0), mBackAction(0),
         mServiceRequest(serviceRequest), mConversationId(-1), mViewServiceRequest(false),mMessageId(-1)
 {
     //creating back action.
@@ -240,20 +239,7 @@
         param << MsgBaseView::MSGSETTINGS;
         switchView(param);
         break;
-    }
-    case MsgBaseView::AUDIOFETCHER:
-    {
-        // switch back to previous view
-        QVariantList param;
-        param << mPreviousView;
-        param << MsgBaseView::AUDIOFETCHER;
-        if(mPreviousView == MsgBaseView::CV)
-        {
-            param << mConversationId;
-        }
-        switchView(param);
-        break;
-    }
+    }    
     default:
     {
         break;
@@ -308,11 +294,6 @@
         switchToMsgSettings(data);
         break;
     }
-    case MsgBaseView::AUDIOFETCHER:
-    {
-        switchToAudioFetcher(data);
-        break;
-    }
     }
     QCRITICAL_WRITE("MsgViewManager::switchView end.");
 }
@@ -575,13 +556,6 @@
         HbApplication::quit();
     }
 
-    // delete Audio Fetcher view
-    if(mAudioFetcherView)
-    {
-        appendViewToBeDeleted(mAudioFetcherView);
-        mAudioFetcherView = NULL;
-    }
-
     //delete UniEditor
     if (mUniEditor)
     {
@@ -694,24 +668,14 @@
      * Editor is tried to open again before exiting the previously
      * opened editor. Multi taping in DLV or Forward.
      */
-    if (mUniEditor && !mAudioFetcherView)
+    if (mUniEditor)
     {
         return;
     }
 
     mCurrentView = MsgBaseView::UNIEDITOR;
-    if(MsgBaseView::AUDIOFETCHER != data.at(1).toInt())
-    {
-        mPreviousView = data.at(1).toInt();
-    }
-
-    // delete Audio Fetcher view
-    if(mAudioFetcherView)
-    {
-        appendViewToBeDeleted(mAudioFetcherView);
-        mAudioFetcherView = NULL;
-    }
-
+    mPreviousView = data.at(1).toInt();
+    
     // delete UniViewer
 	if (mUniViewer )
 	{
@@ -719,11 +683,6 @@
 	    mUniViewer = NULL;
 	}
 
-    if (mConversationView)
-    {
-        //clearing content of cv.
-        mConversationView->clearContent();
-    }
 
     // reset conversation id published
     if(mPreviousView == MsgBaseView::CV && mConversationView)
@@ -802,7 +761,7 @@
             connect(mUniViewer, SIGNAL(switchView(const QVariantList&)), this,
                 SLOT(switchView(const QVariantList&)));
         }
-        mUniViewer->populateContent(messageId, true, msgCount);
+        mUniViewer->populateContent(messageId, true, msgCount, mConversationId);
     }
 
     if(mPreviousView==MsgBaseView::CV && mConversationView)
@@ -962,7 +921,7 @@
         connect(mUniViewer, SIGNAL(switchView(const QVariantList&)), this,
             SLOT(switchView(const QVariantList&)));
     }
-    mUniViewer->populateContent(msgId, true, -1);
+    mUniViewer->populateContent(msgId, true, -1, mConversationId);
 
     mMainWindow->setCurrentView(mUniViewer,true,Hb::ViewSwitchSequential);
 }
@@ -1118,42 +1077,6 @@
     }
 
 // ----------------------------------------------------------------------------
-// MsgViewManager::switchToAudioFetcher
-// @see header
-// ----------------------------------------------------------------------------
-void MsgViewManager::switchToAudioFetcher(const QVariantList& data)
-    {
-    /**
-     * Audio Fetcher is tried to open again
-     */
-    if(mAudioFetcherView)
-        {
-        return;
-        }
-
-    //switch to Audio Fetcher view
-    mCurrentView = MsgBaseView::AUDIOFETCHER;
-    mPreviousView = data.at(1).toInt();
-    QVariantList editorData;
-    // i=2 because view manager consumed first two args
-    for (int i = 2; i < data.length(); i++) {
-        editorData << data.at(i);
-    }
-    mAudioFetcherView = new MsgAudioFetcherView(editorData);
-    mAudioFetcherView->setNavigationAction(mBackAction);
-    connect(mAudioFetcherView, SIGNAL(switchView(const QVariantList&)), this,
-            SLOT(switchView(const QVariantList&)));
-
-    if(mPreviousView==MsgBaseView::CV && mConversationView)
-        {
-        mConversationView->setPSCVId(false);
-        }
-
-    mMainWindow->addView(mAudioFetcherView);
-    mMainWindow->setCurrentView(mAudioFetcherView,true,Hb::ViewSwitchSequential);
-    }
-
-// ----------------------------------------------------------------------------
 // MsgViewManager::saveContentToDraft
 // @see header
 // ----------------------------------------------------------------------------
@@ -1172,6 +1095,20 @@
     }
 
 // ----------------------------------------------------------------------------
+// MsgViewManager::handleKeyEvent
+// @see header
+// ----------------------------------------------------------------------------
+bool MsgViewManager::handleKeyEvent(int key)
+{
+    MsgBaseView *baseView = static_cast<MsgBaseView *>(mMainWindow->currentView());
+    bool eventHandled = false;
+    if (baseView) {
+        eventHandled = baseView->handleKeyEvent(key);
+    }
+    return eventHandled;
+}
+
+// ----------------------------------------------------------------------------
 // MsgViewManager::saveContentToDraft
 // @see header
 // ----------------------------------------------------------------------------
--- a/messagingapp/msgui/msgaudiofetcher/inc/msgaudiofetcherview.h	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *     The header file for messaging's audio fetcher view.
- *
- */
-
-#ifndef MSGAUDIOFETCHERVIEW_H
-#define MSGAUDIOFETCHERVIEW_H
-
-#ifdef BUILD_MSGAUDIOFETCHER_DLL
-#define MSGAUDIOFETCHER_DLL_EXPORT Q_DECL_EXPORT
-#else
-#define MSGAUDIOFETCHER_DLL_EXPORT Q_DECL_IMPORT
-#endif
-
-// SYSTEM INCLUDES
-#include <QObject>
-#include <hblistwidget.h>
-
-// USER INCLUDES
-#include "msgbaseview.h"
-#include "convergedmessage.h"
-
-// FORWARD DECLARATIONS
-class MsgAudioFetcherWidget;
-class HbAction;
-
-/**
- * @class MsgAudioFetcherView
- * @brief This class is messaging's audio fetcher view
- */
-class MSGAUDIOFETCHER_DLL_EXPORT MsgAudioFetcherView : public MsgBaseView
-{
-Q_OBJECT
-
-public:
-    /**
-     * Constructor
-     */
-    explicit MsgAudioFetcherView(const QVariantList& data);
-
-    /**
-     * Destructor
-     */
-    ~MsgAudioFetcherView();
-private:
-    /**
-     * Creates a widget and sets it to the view
-     */
-    void initMainWidget();
-
-    /**
-     * Initializes view's toolbar actions
-     */
-    void initToolBar();
-
-    /**
-     * tool bar actions must to be removed in case the app crashes.
-     */
-    void removeToolBarAction();
-
-private slots:
-    /**
-     * Handles toolbar's leftaction (play/pause)
-     */
-    void on_leftAction_triggered();
-
-    /**
-     * Handles toolbar's rightaction (select)
-     */
-    void on_rightAction_triggered();
-
-    /**
-     * enable toolbar actions, only when an item is selected
-     */
-    void enableToolBar(bool enable);
-
-private:
-    /**
-     * view's main widget
-     */
-    MsgAudioFetcherWidget *mWidget;
-    
-    /**
-     * Toolbar's left action
-     */
-    HbAction *mToolBarLeftAction;
-
-    /**
-     * Toolbar's right action
-     */
-    HbAction *mToolBarRightAction;
-    
-    /**
-     * Converged Message object
-     * owned
-     */
-    ConvergedMessage* message;
-};
-
-#endif /* MSGAUDIOFETCHERVIEW_H */
--- a/messagingapp/msgui/msgaudiofetcher/inc/msgaudiofetcherwidget.h	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-/*
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *     The header file for messaging's audio fetcher widget.
- *
- */
-#ifndef MSGAUDIOFETCHERWIDGET_H
-#define MSGAUDIOFETCHERWIDGET_H
-
-// SYSTEM INCLUDES
-#include <HbWidget>
-
-// USER INCLUDES
-class HbListView;
-class QGraphicsLinearLayout;
-class MsgAudioFetcherView;
-class MsgAudioFetcherModel;
-class HbLabel;
-class MsgAudioPreview;
-
-/**
- * @class MsgAudioFetcherWidget
- * @brief This class is messaging's audio fetcher view's mainwidget
- */
-class MsgAudioFetcherWidget : public HbWidget
-{
-Q_OBJECT
-
-public:
-    /**
-     * Constructor
-     */
-    explicit MsgAudioFetcherWidget();
-
-    /**
-     * Destructor
-     */
-    ~MsgAudioFetcherWidget();
-
-    /**
-     * Get the path of item selected in the list
-     */
-    QString getCurrentItemPath();
-
-    /**
-     * Play or pause the audio file
-     */
-    void playOrPause();
-
-signals:
-    /**
-     * Signal to enable/disable the toolbar
-     */
-    void triggerToolBar(bool enable);
-
-private slots:
-    /**
-     * Handles selection of a list item
-     */
-    void on_list_activated(const QModelIndex &index);
-private:
-    /**
-     * initializes widget
-     */
-    void init();
-    
-private:
-    /**
-     * label of the list view
-     * owned
-     */
-    HbLabel *mLabel;
-    
-    /**
-     * list view
-     * owned
-     */
-    HbListView *mListView;
-    
-    /**
-     * list's layout
-     * owned
-     */
-    QGraphicsLinearLayout *mLayout;
-    
-    /**
-     * populating model
-     * owned
-     */
-    MsgAudioFetcherModel *mFetcherModel;
-
-    /**
-     * For previewing audio files
-     * owned
-     */
-    MsgAudioPreview* mAudioPreview;
-    
-    /**
-     * selection state
-     */
-    bool mSelected;
-    
-    /**
-     * last selected item
-     */
-    QModelIndex mOldSeletedItem;
-};
-
-#endif /* MSGAUDIOFETCHERWIDGET_H_ */
--- a/messagingapp/msgui/msgaudiofetcher/msgaudiofetcher.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/msgaudiofetcher/msgaudiofetcher.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -43,15 +43,12 @@
 # Input
 HEADERS += msgaudioselectionengine.h \
            msgaudiofetchermodel.h \
-           msgaudiofetcherwidget.h \
-           msgaudiofetcherview.h \
-           msgaudiopreview.h \
-           ../inc/msgbaseview.h
+           ../inc/msgaudiofetcherdialog.h \
+           msgaudiopreview.h
            
 SOURCES += msgaudioselectionengine.cpp \
            msgaudiofetchermodel.cpp \
-           msgaudiofetcherwidget.cpp \
-           msgaudiofetcherview.cpp \
+           msgaudiofetcherdialog.cpp \
            msgaudiopreview.cpp
 
 defBlock = \      
@@ -64,8 +61,7 @@
 MMP_RULES += defBlock
 
 # Libs
-LIBS += -lconvergedmessageutils \
-        -lxqutils \
+LIBS += -lxqutils \
         -lmdeclient \
         -lcentralrepository \
         -lProfileEng \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/msgaudiofetcher/src/msgaudiofetcherdialog.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,203 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *     The source file for messaging's audio fetcher dialog.
+ *
+ */
+
+// SYSTEM INCLUDES
+#include <hbaction.h>
+#include <HbStyleLoader>
+#include <HbTextItem>
+#include <HbColorScheme>
+#include <HbListView>
+#include <QModelIndex>
+#include <QStandardItemModel>
+
+// USER INCLUDES
+#include "msgaudiofetcherdialog.h"
+#include "msgaudiofetchermodel.h"
+#include "msgaudiopreview.h"
+
+#define LOC_SELECT_SELECT hbTrId("txt_common_button_select")
+#define LOC_SELECT_CANCEL hbTrId("txt_common_button_cancel")
+#define LOC_SELECT_SOUND  hbTrId("txt_messaging_title_select_a_sound")
+
+const QString LIST_ITEM_TITLE("qtc_list_item_title_normal");
+
+MsgAudioFetcherDialog::MsgAudioFetcherDialog(QGraphicsItem *parent) :
+	HbDialog(parent),
+	mListView(NULL),
+	mFetcherModel(NULL),
+	mAudioPreview(NULL),
+	mSelected(false)
+{
+    setDismissPolicy(HbDialog::NoDismiss);
+    setFrameType(HbDialog::Strong);
+    setModal(true);
+    
+    initActions();
+    initMainWidget();  
+    
+    connect(
+            this, 
+            SIGNAL(aboutToClose()), 
+            this, 
+            SLOT(reset()));
+    
+    //TODO: Goal was to put in viewReady, but connect is
+    //not working since it only works for views not dialogs
+    doDelayedConstruction();
+}
+
+MsgAudioFetcherDialog::~MsgAudioFetcherDialog()
+{
+    //do nothing
+}
+
+void MsgAudioFetcherDialog::initMainWidget()
+{
+	//set heading
+	HbTextItem* heading = new HbTextItem(
+	        LOC_SELECT_SOUND, 
+	        this);
+	QColor color = HbColorScheme::color( LIST_ITEM_TITLE );
+	heading->setTextColor( color );
+	heading->setAlignment(Qt::AlignLeft);
+	setHeadingWidget(heading);	
+}
+
+void MsgAudioFetcherDialog::initActions()
+{
+    mLeftAction = new HbAction(this);
+    mLeftAction->setText(LOC_SELECT_SELECT);
+    addAction(mLeftAction);
+    mLeftAction->setEnabled(false);
+
+    HbAction* rightAction = new HbAction(this);
+    rightAction->setText(LOC_SELECT_CANCEL);
+    rightAction->setEnabled(true);
+    addAction(rightAction);    
+    
+    connect(mLeftAction,
+                SIGNAL(triggered()),
+                this,
+                SLOT(onSelectAction()));
+    
+    connect(rightAction,
+                SIGNAL(triggered()),
+                this,
+                SLOT(onCancelAction()));    
+}
+
+QString MsgAudioFetcherDialog::getCurrentItemPath()
+{
+    if (mSeletedItem.isValid())
+    {
+        QString temppath = 
+                    mFetcherModel->data(
+                            mSeletedItem, 
+                            Qt::UserRole).toString();
+        //return the path
+        return QDir::toNativeSeparators(temppath);
+    }
+    return QString();
+}
+
+void MsgAudioFetcherDialog::doDelayedConstruction()
+{
+    //set the content list
+    mListView = new HbListView(this);
+    Q_ASSERT(mListView);
+    mListView->setSelectionMode(
+            HbAbstractItemView::SingleSelection);
+    mFetcherModel = new MsgAudioFetcherModel(this);
+    mListView->setModel(mFetcherModel);
+    mListView->setUniformItemSizes(true);
+    setContentWidget(mListView);
+    connect(mListView, SIGNAL(activated(QModelIndex)),
+            this, SLOT(on_list_activated(QModelIndex)));
+    
+    //initializes the audio preview
+    mAudioPreview = new MsgAudioPreview(this);
+}
+
+void MsgAudioFetcherDialog::onSelectAction()
+{
+	//stop the playing file
+    if (mAudioPreview->IsPlaying()) {
+            mAudioPreview->Stop();        
+        }
+    
+    //emit the selected sound file
+    QString filePath = getCurrentItemPath();
+    emit audioSelected(filePath);
+    
+    //close the dialog
+    close();
+}
+
+void MsgAudioFetcherDialog::onCancelAction()
+{    
+    //stop the playing file and return
+    if (mAudioPreview->IsPlaying()) {
+                mAudioPreview->Stop();        
+            }
+    close();
+    return;
+}
+
+void MsgAudioFetcherDialog::reset()
+{
+    mSelected = false;
+    mLeftAction->setEnabled(false);
+    
+    //list scroll to top
+    mListView->scrollTo(
+            mListView->model(
+                    )->index(0,0));
+    
+    //deselect the selected item
+    mListView->selectionModel(
+            )->select(
+                    mSeletedItem, 
+                    QItemSelectionModel::Deselect);    
+}
+
+void MsgAudioFetcherDialog::on_list_activated(
+        const QModelIndex &index)
+{
+    //stop previewing when clicking another item.
+    if (mAudioPreview->IsPlaying()) {
+        mAudioPreview->SetAttr(getCurrentItemPath());
+        mAudioPreview->Play();        
+    }
+
+    //enable the action select
+    if(!mSelected)
+    {
+        mLeftAction->setEnabled(true);        
+        mSelected = true;
+    }     
+    
+    //save the latest selected
+    mSeletedItem = index;
+    
+    //start play the item
+    mAudioPreview->SetAttr(getCurrentItemPath());
+    mAudioPreview->Play();
+    
+    return;
+}
+//End of File
--- a/messagingapp/msgui/msgaudiofetcher/src/msgaudiofetcherview.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +0,0 @@
-/*
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *     The source file for messaging's audio fetcher view.
- *
- */
-
-// SYSTEM INCLUDES
-#include <hbaction.h>
-#include <hbtoolbar.h>
-
-// USER INCLUDES
-#include "msgaudiofetcherview.h"
-#include "msgaudiofetcherwidget.h"
-#include "convergedmessage.h"
-
-#define LOC_SELECT_SOUND hbTrId("txt_messaging_title_select_a_sound")
-
-MsgAudioFetcherView::MsgAudioFetcherView(const QVariantList& data) :
-message(NULL)
-{
-    message = new ConvergedMessage;
-    if(data.length() > 0)
-    {
-        QByteArray dataArray = data.at(0).toByteArray();
-        QDataStream stream(&dataArray, QIODevice::ReadOnly);
-        message->deserialize(stream);
-    }
-    initToolBar();
-    initMainWidget();
-    QMetaObject::connectSlotsByName(this);
-}
-
-MsgAudioFetcherView::~MsgAudioFetcherView()
-{
-    if(message != NULL)
-    {
-        delete message;
-        message = NULL;
-    }
-    removeToolBarAction();
-}
-
-void MsgAudioFetcherView::initMainWidget()
-{
-    mWidget = new MsgAudioFetcherWidget();
-    Q_ASSERT(mWidget);
-    setWidget(mWidget);
-    connect(mWidget, SIGNAL(triggerToolBar(bool)), this, SLOT(enableToolBar(bool)));
-}
-
-void MsgAudioFetcherView::initToolBar()
-{
-    mToolBarLeftAction = new HbAction(this);
-    mToolBarLeftAction->setObjectName("leftAction");
-    //TODO: need localized string
-    mToolBarLeftAction->setText(hbTrId("Play/Pause"));
-    toolBar()->addAction(mToolBarLeftAction);
-    mToolBarLeftAction->setEnabled(false);
-
-    mToolBarRightAction = new HbAction(this);
-    mToolBarRightAction->setObjectName("rightAction");
-    //TODO: need localized string
-    mToolBarRightAction->setText(LOC_SELECT_SOUND);
-    mToolBarRightAction->setEnabled(false);
-    toolBar()->addAction(mToolBarRightAction);
-
-    toolBar()->setOrientation(Qt::Horizontal);
-    toolBar()->setEnabled(false);
-}
-
-void MsgAudioFetcherView::removeToolBarAction()
-{
-    toolBar()->removeAction(mToolBarRightAction);
-    toolBar()->removeAction(mToolBarLeftAction);
-}
-
-void MsgAudioFetcherView::on_leftAction_triggered()
-{
-    mWidget->playOrPause();
-}
-
-void MsgAudioFetcherView::on_rightAction_triggered()
-{    
-    // param list for switching to editor view
-    QVariantList params;
-    QByteArray dataArray;
-    QDataStream messageStream
-    (&dataArray, QIODevice::WriteOnly | QIODevice::Append);
-
-    QString filepath(mWidget->getCurrentItemPath());
-    ConvergedMessageAttachment* attachment =
-            new ConvergedMessageAttachment(filepath);
-    ConvergedMessageAttachmentList attachmentList;
-    attachmentList.append(attachment);
-    message->addAttachments(attachmentList);
-    
-    message->serialize(messageStream);
-    params << MsgBaseView::UNIEDITOR;
-    params << MsgBaseView::AUDIOFETCHER;
-    params << dataArray;
-    params << MsgBaseView::ADD_AUDIO;
-    emit switchView(params);
-}
-
-void MsgAudioFetcherView::enableToolBar(bool enable)
-{
-    mToolBarRightAction->setEnabled(enable);
-    mToolBarLeftAction->setEnabled(enable);
-    toolBar()->setEnabled(enable);
-}
-
-//End of File
--- a/messagingapp/msgui/msgaudiofetcher/src/msgaudiofetcherwidget.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *     The source file for messaging's audio fetcher widget.
- *
- */
-
-// SYSTEM INCLUDES
-#include <HbListView>
-#include <QModelIndex>
-#include <QGraphicsLinearLayout>
-#include <QStandardItemModel>
-#include <HbLabel>
-
-// USER INCLUDES
-#include "msgaudiofetcherwidget.h"
-#include "msgaudiofetchermodel.h"
-#include "msgaudiopreview.h"
-
-// LOCALIZED CONSTANTS
-#define LOC_SELECT_SOUND  hbTrId("txt_messaging_title_select_a_sound")
-
-
-MsgAudioFetcherWidget::MsgAudioFetcherWidget()
-    : HbWidget(NULL),
-      mLabel(0),
-      mListView(0),
-      mLayout(0),
-      mFetcherModel(0),
-      mAudioPreview(0),
-      mSelected(false)
-{
-    init();
-}
-
-MsgAudioFetcherWidget::~MsgAudioFetcherWidget()
-{
-}
-
-QString MsgAudioFetcherWidget::getCurrentItemPath()
-{
-    QModelIndexList modelIndexList = mListView->selectionModel()->selectedIndexes();
-    if(modelIndexList.count() > 0)
-    {
-        QModelIndex index = modelIndexList.at(0);
-        QString temppath = 
-                mFetcherModel->data(index, Qt::UserRole).toString();
-        return QDir::toNativeSeparators(temppath);
-    }
-    return QString();
-}
-
-void MsgAudioFetcherWidget::playOrPause()
-{
-    mAudioPreview->SetAttr(getCurrentItemPath());
-    mAudioPreview->Play();
-}
-
-void MsgAudioFetcherWidget::on_list_activated(const QModelIndex &index)
-{
-    QModelIndexList modelIndexList = mListView->selectionModel()->selectedIndexes();
-
-    //stop previewing when clicking another item.
-    if (mAudioPreview->IsPlaying()) {
-        mAudioPreview->SetAttr(getCurrentItemPath());
-            mAudioPreview->Play();
-        
-    }
-
-    /*
-     * when one item is selected, reselecting it will deselect it. selecting another
-     * will also deselect it, while the other is selected.
-     */
-    if(mSelected)
-    {
-        if(mOldSeletedItem != index)
-        {
-            mListView->selectionModel()->select(index, QItemSelectionModel::Select);
-            mOldSeletedItem = index;
-            emit triggerToolBar(true);
-        }
-        else
-        {
-            mListView->selectionModel()->select(index, QItemSelectionModel::Deselect);
-            mSelected = false;
-            emit triggerToolBar(false);
-        }
-        return;
-    }
-
-    if(modelIndexList.count() > 0)
-    {
-		QModelIndexList::const_iterator it;
-        for(it=modelIndexList.begin(); it!=modelIndexList.end(); ++it)
-        {
-            if((*it) == index)
-            {
-                mSelected = true;
-                mOldSeletedItem = index;
-                emit triggerToolBar(true);
-            }
-        }
-    }
-}
-
-void MsgAudioFetcherWidget::init()
-{
-    mLayout = new QGraphicsLinearLayout(this);
-    mLayout->setOrientation(Qt::Vertical);
-    setLayout(mLayout);
-
-    mLabel = new HbLabel(this);
-    // TODO: need localized string
-    mLabel->setPlainText(LOC_SELECT_SOUND);
-    mLayout->addItem(mLabel);
-
-    mListView = new HbListView(this);
-    mListView->setObjectName("list");
-    mLayout->addItem(mListView);
-    mListView->setSelectionMode(HbAbstractItemView::SingleSelection);
-
-    mFetcherModel = new MsgAudioFetcherModel(this);
-    mListView->setModel(mFetcherModel);
-    connect(mListView, SIGNAL(activated(QModelIndex)),
-        this, SLOT(on_list_activated(QModelIndex)));
-    mAudioPreview = new MsgAudioPreview(this);
-}
-
-//End of File
--- a/messagingapp/msgui/msgaudiofetcher/src/msgaudioselectionengine.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/msgaudiofetcher/src/msgaudioselectionengine.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -22,6 +22,7 @@
 #include <bautils.h>
 #include <centralrepository.h>
 #include <ProfileEngineDomainCRKeys.h>
+#include <QMap>
 
 // USER INCLUDES
 #include "msgaudioselectionengine.h"
@@ -135,6 +136,7 @@
         }
     else
         {
+        QMap<QString,QString> nameUriList;
         CMdEObjectQuery* query = static_cast<CMdEObjectQuery*> (&aQuery);
         TInt count = query->Count();
         for (TInt i = 0; i < count; ++i)
@@ -153,11 +155,30 @@
                         property->TextValueL()));
                 QString uriValue(XQConversions::s60DescToQString(
                         object->Uri()));
-                iNameList.append(songName);
-                iUriList.append(uriValue);
+                
+                //insert into the map
+                nameUriList.insertMulti(uriValue, songName);
                 }
             CleanupStack::PopAndDestroy(object);
             }
+        
+        //now get all the song names and sort them
+        iNameList = nameUriList.values();
+        iNameList.sort();
+        
+        // go through the song list and get the associated uri
+        // insert into the uri list
+        int nameListTotal = iNameList.count();
+        for(int nameListCount = 0; 
+                nameListCount<nameListTotal;
+                nameListCount++)
+            {
+            QString key = nameUriList.key(iNameList.at(nameListCount));
+            iUriList.append(key);
+            nameUriList.remove(key);                        
+            }
+        
+        // emit the list to the model
         emit queryComplete(iNameList, iUriList);
         }
     }
--- a/messagingapp/msgui/msguiutils/src/msgcontactsutil.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/msguiutils/src/msgcontactsutil.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -56,9 +56,9 @@
     //TODO: remove copyVcsFile after capabilities fix from Contacts
     QString newfilepath = copyVCardToTemp(filepath);
 
-    QString service("com.nokia.services.phonebookservices");
-    QString interface("Fetch");
-    QString operation("editCreateNew(QString)");
+    QString service("phonebookservices");
+    QString interface("com.nokia.symbian.IContactsEdit");
+    QString operation("editCreateNewFromVCard(QString)");
     XQApplicationManager appManager;
     XQAiwRequest* request = appManager.create(service, interface, operation, true); //embedded
     if(request)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/msguiutils/tsrc/unittest_msguiutils/mmstestbed/inc/mmsreadfile.h	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,471 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ */
+
+#ifndef MMSREADFILE_H
+#define MMSREADFILE_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <badesca.h>
+#include <f32file.h>
+#include <msvstd.h>
+
+// forward references
+class CMmsAttaStructure;
+class CMmsHeaders;
+class CEikonEnv;
+class CMmsClientMtm;
+
+// Out-of-range value for any MMS header with assigned number
+// Used in coverage tests to get coverage for "default" branches
+// in "case" statements.
+const TInt KMmsTestIllegalValue = 255;
+
+//
+// TEST KEY WORDS
+// Extended to include all MMS headers to allow generation of arbitrary PDUs
+// Content type header cannot be separately defined,
+// it will always be "multipat/mixed" or "multipart/related"
+_LIT8( KTestEndOfFile,          "EOF" );
+_LIT8( KTestNewMessage,         "MESSAGE BEGIN" );
+//------------------------------------------------
+_LIT8( KTestMessageType,        "MESSAGE-TYPE" ); //X-Mms-Message-Type
+_LIT8( KTestDate,               "DATE" ); // Date
+_LIT8( KTestFrom,               "FROM" ); // From
+_LIT8( KTestTo,                 "TO" ); // To
+_LIT8( KTestCc,                 "CC" ); // Cc
+_LIT8( KTestBcc,                "BCC" ); // Bcc
+_LIT8( KTestSubject,            "SUBJECT" ); // Subject
+_LIT8( KTestExpiryRel,          "EXPIRY-REL" ); // X-Mms-Expiry, relative
+_LIT8( KTestExpiryAbs,          "EXPIRY-ABS" ); // X-Mms-Expiry, absolute
+_LIT8( KTestDeliveryTimeRel,    "DELIVERY-TIME-REL" ); // X-Mms-Delivery-Time, relative
+_LIT8( KTestDeliveryTimeAbs,    "DELIVERY-TIME-ABS" ); // X-Mms-Delivery-Time, absolute
+_LIT8( KTestPriority,           "PRIORITY" ); // X-Mms-Priority
+_LIT8( KTestSenderVisibility,   "SENDER-VISIBILITY" ); // X-Mms-Sender-Visibility
+_LIT8( KTestDeliveryReport,     "DELIVERY-REPORT" ); // X-Mms-Delivery-Report
+_LIT8( KTestReadReply,          "READ-REPLY" ); // X-Mms-Read-Report
+// ---------------------------------------------------
+_LIT8( KTestNewAttachment,      "ATTACHMENT" );
+_LIT8( KTestAttachmentType,     "ATTACHMENTTYPE" );
+_LIT8( KTestAttachmentName,     "ATTACHMENTNAME" );
+_LIT8( KTestAttachmentContLoc,  "ATTACHMENTCONTLOC" );
+_LIT8( KTestAttachmentCharset,  "ATTACHMENTCHARSET" );
+_LIT8( KTestAttachmentCid,      "ATTACHMENTCID" );
+_LIT8( KTestAttachmentRoot,     "ATTACHMENTROOT" );
+// content-type and x-type parameters for attachments
+// should appear in name-value pairs.
+// Test program is not responsible for verifying illegal scripts
+_LIT8( KTestAttContTypeParamName, "ContTypeParamName" );
+_LIT8( KTestAttContTypeParamValue, "ContTypeParamValue" );
+_LIT8( KTestAttXTypeParamName, "X-TypeParamName" );
+_LIT8( KTestAttXTypeParamValue, "X-TypeParamValue" );
+// -----------------------------------------------------
+_LIT8( KTestMessageClass,       "MESSAGE-CLASS" ); // X-Mms-Message-Class
+_LIT8( KTestDelivRepSendAllow,  "DELIV-REP-SEND-ALLOW" ); // X-Mms-Report-Allowed
+_LIT8( KTestAcceptAdvertis,     "ACCEPT-ADVERTISEMENTS" );
+_LIT8( KTestRetryCount,         "RETRY-COUNT" );
+_LIT8( KTestRetryInterval,      "RETRY-INTERVAL" );
+// -------------------------------------------------
+_LIT8( KTestAlias,				"ALIAS" );
+_LIT8( KTestFromAlias,			"FROMALIAS" );
+_LIT8( KTestToAlias,			"TOALIAS" );
+_LIT8( KTestCcAlias,			"CCALIAS" );
+_LIT8( KTestBccAlias,			"BCCALIAS" );
+// -------------------------------------------------
+// more Message headers to allow testing all possible PDUs and
+// MMS 1.1 headers
+_LIT8( KTestReplyCharging,      "REPLY-CHARGING" ); // X-Mms-Reply-Charging
+_LIT8( KTestReplyChargAbs,      "REPLY-CHARG-DEADLINE-ABS" ); // X-Mms-Reply-Charging, absolute
+_LIT8( KTestReplyChargRel,      "REPLY-CHARG-DEADLINE-REL" ); // X-Mms-Reply-Charging, relative
+_LIT8( KTestReplyChargSize,     "REPLY-CHARG-SIZE" ); // X-Mms-Reply-Charging-Size (octets)
+_LIT8( KTestReplyChargID,       "REPLY-CHARGING-ID" ); // X-Mms-Reply-Charging-ID
+_LIT8( KTestTID,                "TID" );
+_LIT8( KTestContentLocation,    "CONTLOC" ); // X-Mms-Content-Location
+// The following three must appear as triplets.
+// index must be first, address and date may appear in any order
+_LIT8( KTestPreviouslySentIndex, "PREVIOUSINDEX" ); // forwarded count for X-Mms-PreviouslySent headers
+_LIT8( KTestPreviouslySentBy,    "PREV-SENT-BY" ); // X-Mms-Previously-Sent-By
+_LIT8( KTestPreviouslySentDate,  "PREV-SENT-DATE" ); // X-Mms-Previously-Sent-Date
+//---
+_LIT8( KTestMessageId,           "MESSAGE-ID" ); // Message-ID
+_LIT8( KTestMessageSize,         "MESSAGE-SIZE" ); // X-Mms-Message-Size (octets)
+_LIT8( KTestVersion,             "MMS-VERSION" ); // X-MMS-Version (hex:, 10 = 1.0, 11 = 1.1 etc. )
+_LIT8( KTestReadStatus,          "READ-STATUS" ); // X-Mms-Read-Status
+_LIT8( KTestResponseStatus,      "RESPONSE-STATUS" ); // X-Mms-Response-Status
+_LIT8( KTestResponseText,        "RESPONSE-TEXT" ); // X-Mms-Response-Text
+_LIT8( KTestRetrieveStatus,      "RETRIEVE-STATUS" ); // X-Mms-Retrieve-Status
+_LIT8( KTestRetrieveText,        "RETRIEVE-TEXT" ); // X-Mms-Retrieve-Text
+_LIT8( KTestStatus,              "STATUS" ); // X-Mms-Status
+// -------------------------------------------------
+// MMS 1.2 headers
+_LIT8( KTestAttribute,          "ATTRIBUTE" ); // X-Mms-Attribute
+// The value should be one of the following:
+// BCC, CC, CONTENT, CONTENT-TYPE, DATE, DELIVERY-REPORT, DELIVERY-TIME-ABS,
+// EXPIRY-ABS, FROM, MESSAGE-CLASS, MESSAGE-ID, MESSAGE-SIZE, PRIORITY,
+// READ-REPLY, SUBJECT, TO, REPLY-CHARGING, REPLY-CHARGING-ID,
+// REPLY-CHARG-DEADLINE-ABS, REPLY-CHARG-SIZE, PREV-SENT-BY,
+// PREV-SENT-DATE, ADDITIONAL-HEADERS
+_LIT8( KTestDistributionIndicator,  "DISTRIBUTION-INDICATOR" ); // X-Mms-Distribution-Indicator
+_LIT8( KTestLimit,              "LIMIT" ); // X-Mms-Limit
+_LIT8( KTestMessageQuota,       "MESSAGE-QUOTA" ); // X-Mms-Mbox-Quota, message number
+_LIT8( KTestSizeQuota,          "SIZE-QUOTA" ); // X-Mms-Mbox-Quota, size quota
+_LIT8( KTestMessageTotal,       "MESSAGE-TOTAL" ); // X-Mms-Mbox-Totals, message number
+_LIT8( KTestSizeTotal,          "SIZE-TOTAL" ); // X-Mms-Mbox-Totals, total size
+_LIT8( KTestMessageCount,       "MESSAGE-COUNT" ); // X-Mms-Message-Count
+_LIT8( KTestAddKeyword,         "ADD-KEYWORD" ); // X-Mms-MM-Flags
+_LIT8( KTestRemoveKeyword,      "REMOVE-KEYWORD" ); // X-Mms-MM-Flags
+_LIT8( KTestFilterKeyword,      "FILTER-KEYWORD" ); // X-Mms-MM-FLags
+_LIT8( KTestMMState,            "MESSAGE-STATE" ); // X-Mms-MM-State
+_LIT8( KTestQuota,              "QUOTA" ); // X-Mms-Quotas
+_LIT8( KTestStart,              "START" ); // X-Mms-Start
+_LIT8( KTestStore,              "STORE" ); // X-Mms-Store
+_LIT8( KTestStored,             "STORED" ); // X-Mms-Stored
+_LIT8( KTestStoreStatus,        "STORE-STATUS" ); // X-Mms-Store-Status
+_LIT8( KTestStoreStatusText,    "STORE-STATUS-TEXT" ); // X-Mms-Store-Status-Text
+_LIT8( KTestTotals,             "TOTALS" ); // X-Mms-Totals
+// Delete confirmation header structure
+// This consists of index, content location, response status and response status text.
+// All three values are not always necessary for each index, but at least content-location
+// and response status should be present.
+// The index retains its value until a new index is encountered.
+_LIT8( KTestDeleteInfoIndex,    "DELETESTATUSINDEX" ); // index for next delete info fields
+// This header must precede content-location, response-status and response-text fields
+// in a delete confirmation. Index retains its value until a new index is encountered.
+
+// Element descriptor header not implemented
+
+// Application id headers
+// These will officially be supported in MMS encapsulation version 1.3
+// Java has non-standard support even earlier
+
+_LIT8( KTestApplicId,            "APPLIC-ID" ); // X-Mms-Applic-ID
+_LIT8( KTestReplyApplicId,       "REPLY-APPLIC-ID" ); // X-Mms-Reply-Applic-ID
+_LIT8( KTestApplicInfo,          "AUX-APPLIC-INFO" ); // X-Mms-Aux-Applic-Info
+
+// Since Encapsulation 1.3
+_LIT8( KTestContentClass,        "CONTENT-CLASS" ); // X-Mms-Content-Class
+_LIT8( KTestDrmContent,          "DRM-CONTENT" ); // X-Mms-DRM-Content
+_LIT8( KTestAdaptationAllowed,   "ADAPTATION-ALLOWED" ); // X-Mms-Adaptation-Allowed
+_LIT8( KTestRecommendedRetrievalMode, "REC-RETRIEVAL-MODE" ); // X-Mms-Recommended-Retrieval-Mode
+_LIT8( KTestRecRetrievalModeText, "REC-RETR-MODE-TEXT" ); // X-Mms-Recommended-Retrieval-Mode-Text
+_LIT8( KTestReplaceId,           "REPLACE-ID" ); // X-Mms-Replace-ID
+_LIT8( KTestStatusText,          "STATUS-TEXT" ); // X-Mms-Status-Text
+_LIT8( KTestCancelId,            "CANCEL-ID" ); // X-Mms-Cancel-ID
+_LIT8( KTestCancelStatus,        "CANCEL-STATUS" ); // X-Mms-Cancel-Status
+
+// DATA TYPES
+#define aSet            1
+#define aReset          0
+#define PartCount      100
+#define MaxAttaCount   10
+#define DefaultBufLen 256
+#define MaxRecipients   5
+
+// status returned by ReadRow
+enum TTestReadStatus
+    {
+    ETestUnknown,
+    ETestNewMessage,
+    ETestNewAttachment,
+    ETestEof,    // End of file
+    ETestMessageType,
+    ETestDate,
+    ETestFrom,
+    ETestTo,
+    ETestCc,
+    ETestBcc,
+	ETestAlias,
+	ETestFromAlias,
+	ETestToAlias,
+	ETestCcAlias,
+	ETestBccAlias,
+    ETestSubject,
+    ETestExpiryRel,
+    ETestExpiryAbs,
+    ETestDeliveryTimeRel,
+    ETestDeliveryTimeAbs,
+    ETestPriority,
+    ETestSenderVisibility,
+    ETestDeliveryReport,
+    ETestReadReply,
+    ETestAttachmentType,
+//    ETestAttachmentName,
+    ETestAttachmentCharset,
+    ETestAttachmentCid,
+	ETestAttachmentRoot,
+    ETestSettings,
+    ETestMessageClass,
+    ETestDelivReportSendAllow,
+    ETestSingleMessageClass,
+    ETestReplyCharging,
+    ETestReplyChargAbs,
+    ETestReplyChargRel,
+    ETestReplyChargSize,
+    ETestReplyChargID,
+    ETestTID,
+    ETestContentLocation,
+    ETestPreviouslySentIndex,
+    ETestPreviouslySentBy,
+    ETestPreviouslySentDate,
+    ETestMessageId,
+    ETestMessageSize,
+    ETestVersion,
+    ETestReadStatus,
+    ETestResponseStatus,
+    ETestResponseText,
+    ETestRetrieveStatus,
+    ETestRetrieveText,
+    ETestStatus,
+    ETestAttribute,
+    ETestDistributionIndicator,
+    ETestLimit,
+    ETestMessageQuota,
+    ETestSizeQuota,
+    ETestMessageTotal,
+    ETestSizeTotal,
+    ETestMessageCount,
+    ETestAddKeyword,
+    ETestRemoveKeyword,
+    ETestFilterKeyword,
+    ETestMMState,
+    ETestQuota,
+    ETestStart,
+    ETestStore,
+    ETestStored,
+    ETestStoreStatus,
+    ETestStoreStatusText,
+    ETestTotals,
+    ETestDeleteInfoIndex,
+    ETestApplicId,
+    ETestReplyApplicId,
+    ETestApplicInfo,
+    ETestContentClass,
+    ETestDrmContent,
+    ETestAdaptationAllowed,
+    ETestRecommendedRetrievalMode,
+    ETestRecRetrievalModeText,
+    ETestReplaceId,
+    ETestStatusText,
+    ETestCancelId,
+    ETestCancelStatus,
+    ETestAttaRecommendedName,
+    ETestAttachmentContLoc,
+    ETestAttContTypeParamName,
+    ETestAttContTypeParamValue,
+    ETestAttXTypeParamName,
+    ETestAttXTypeParamValue
+
+    };
+
+// VALUE KEYWORDS
+_LIT( KPersonal,      "Personal" );
+_LIT( KAdvertisement, "Advertisement" );
+_LIT( KInformational, "Informational" );
+_LIT( KAuto,          "Auto" );
+_LIT( KLow,    "Low" );
+_LIT( KNormal, "Normal" );
+_LIT( KHigh,   "High" );
+_LIT( KHide,   "Hide" );
+_LIT( KShow,   "Show" );
+_LIT( KYes,    "Yes" );
+_LIT( KNo,     "No" );
+_LIT( KOn,     "On" );
+_LIT( KOff,     "Off" );
+_LIT( KDeferred, "Deferred" );
+_LIT( KExpired,  "Expired" );
+_LIT( KRetrieved, "Retrieved" );
+_LIT( KRejected, "Rejected" );
+_LIT( KUnrecognized, "Unrecognized" );
+_LIT( KIndeterminate, "Indeterminate" );
+_LIT( KForwarded, "Forwarded" );
+_LIT( KUnreachable, "Unreachable" );
+_LIT( KDraft, "Draft");
+_LIT( KSent, "Sent" );
+_LIT( KNew, "New" );
+// X-Mms-Message-Type
+_LIT( KSendReq, "SendReq" );
+_LIT( KSendConf, "SendConf" );
+_LIT( KNotifInd, "NotifInd" );
+_LIT( KNotifResp, "NotifResp" );
+_LIT( KRetrConf, "RetrConf" );
+_LIT( KAckInd, "AckInd" );
+_LIT( KDelInd, "DelInd" );
+_LIT( KReadReqInd, "ReadReqInd" );
+_LIT( KReadOrigInd, "ReadOrigInd" );
+_LIT( KForwardRec, "ForwardReq" );
+_LIT( KForwardConf, "ForwardConf" );
+_LIT( KMBoxStoreReq, "MBoxStoreReq" );
+_LIT( KMBoxStoreConf, "MBoxStoreConf" );
+_LIT( KMBoxViewReq, "MBoxViewReq" );
+_LIT( KMBoxViewConf, "MBoxViewConf" );
+_LIT( KMBoxUploadReq, "MBoxUploadReq" );
+_LIT( KMBoxUploadConf, "MBoxUploadConf" );
+_LIT( KMBoxDeleteReq, "MBoxDeleteReq" );
+_LIT( KMBoxDeleteConf, "MBoxDeleteConf" );
+_LIT( KMBoxDescr, "MBoxDescr" );
+_LIT( KDeleteReq, "DeleteReq" );
+_LIT( KDeleteConf, "DeleteConf" );
+_LIT( KCancelReq, "CancelReq" );
+_LIT( KCancelResp, "CancelConf" );
+// X-Mms-Read-Status
+_LIT( KRead, "Read" );
+_LIT( KDelNotRead, "DeletedNotRead" );
+// X-Mms-Reply-Charging
+_LIT( KRequested, "Requested" );
+_LIT( KReqTextOnly, "ReqTextOnly" );
+_LIT( KAccepted, "Accepted" );
+_LIT( KAccTextOnly, "AccTextOnly" );
+// X-Mms-Cancel-Status (only receival of request, not actual cancellation)
+_LIT( KCancelSuccessful, "CancelSuccess" );
+_LIT( KCancelCorrupted, "CancelCorrupted" );
+// X-Mms-Content-Class
+_LIT( KText, "Text" );
+_LIT( KImageBasic, "ImageBasic" );
+_LIT( KImageRich, "ImageRich" );
+_LIT( KVideoBasic, "VideoBasic" );
+_LIT( KVideoRich, "VideoRich" );
+_LIT( KMegaPixel, "MegaPixel" );
+_LIT( KContentBasic, "ContentBasic" );
+_LIT( KContentRich, "ContentRich" );
+// X-Mms-Recommended-Retrieval-Mode
+_LIT( KManual, "Manual" );
+
+//X-Mms-ResponseStatus
+// legacy values
+_LIT( KOk, "OK" );
+_LIT( KErrUnspecified, "Unspecified" );
+_LIT( KErrServiceDenied, "ServiceDenied" );
+_LIT( KErrMessageFormatCorrupt, "FormatCorrupt" );
+_LIT( KErrAddressUnresolved, "AddressUnresolved" );
+_LIT( KErrMessageNotFound, "MessageNotFound" );
+_LIT( KErrNetworkProblem, "NetworkProblem" );
+_LIT( KErrContentNotAccepted, "ContentNotAccepted" );
+_LIT( KErrUnsupportedMessage, "UnsupportedMessage" );
+// values since 1.1 (and 1.2)
+_LIT( KErrTransient, "TransientFailure" );
+_LIT( KErrTransientAddressUnresolved, "TransientAddressUnresolved" );
+_LIT( KErrTransientNotFound, "TransientMessageNotFound" );
+_LIT( KErrTransientNetworkproblem, "TransientNetworkProblem" );
+_LIT( KErrTransientPartialSuccess, "PartialSuccess" );
+_LIT( KErrPermanent, "PermanentFailure" );
+_LIT( KErrPermanentServiceDenied, "PermanentServiceDenied" );
+_LIT( KErrPermanentMessageFormatCorrupt, "PermanentFormatCorrupt" );
+_LIT( KErrPermanentAddressUnresolved, "PermanentAddressUnresolved" );
+_LIT( KErrPermanentNotFound, "PermanentMessageNotFound" );
+_LIT( KErrPermanentContentNotAccepted, "PermanentContentNotAccepted" );
+_LIT( KErrReplyChargingLimitNotMet, "ReplyChargingLimitNotMet" );
+_LIT( KErrReplyChargingRequestNotAccepted, "ReplyChargingRequestNotAccepted" );
+_LIT( KErrReplyChargingForwardingDenied, "ReplyChargingForwardingDenied" );
+_LIT( KErrReplyChargingNotSupported, "ReplyChargingNotSupported" );
+_LIT( KErrAddressHidingNotSupported, "AddressHidingNotSupported" );
+_LIT( KErrPermanentLackOfPrepaid, "PermanentLackOfPrepaid" );
+//X-Mms-RetrieveStatus (one extra value)
+_LIT( KErrRetrieveContentUnsupported, "PermanentContentUnsupported" );
+//X-Mms-Store-Status (one extra value)
+_LIT( KErrMMBoxFull, "MMBoxFull" );
+
+_LIT8( KTestContent,  "Content" ); // For attribute list only
+_LIT8( KTestAdditionalHeaders,  "ADDITIONAL-HEADERS" ); // For attribute list only
+_LIT8( KTestDeliveryTime,       "DELIVERY-TIME"); // for attribute list only
+_LIT8( KTestExpiry,             "EXPIRY"); // for attribute list only
+_LIT8( KTestReplyCharg,         "REPLY-CHARG-DEADLINE" ); // for attribute list only
+_LIT8( KTestContentType,        "CONTENT-TYPE" );  // for attribute list only
+
+/**
+*  CMmsReadFile
+*/
+NONSHARABLE_CLASS( CMmsReadFile ):public CBase
+    {
+    public:  // Constructors and destructor
+
+        static CMmsReadFile* NewL(RFs& aFs, RFileReadStream& aReadStream ); // Two-phased constructor.
+        virtual ~CMmsReadFile(); // Destructor
+
+    public: // New functions
+
+        TInt CompleteTestL(TInt aMessageCounter, CMmsHeaders& aMmsHeaders);
+        TTestReadStatus ReadRowL();
+        void CreateMessageL( CMmsClientMtm* aMmsClient, CMmsHeaders* aMmsHeaders );
+		TInt FindAlias(TPtrC alias);
+		void SetAttaStructure( TBool aOldAttaStructure = EFalse );
+
+    protected:  // Functions from base classes
+
+    private:
+
+        CMmsReadFile(); // C++ default constructor.
+        // By default constructor is private.
+        void ConstructL( RFs& aFs, RFileReadStream& aReadStream );
+        void Reset();
+
+    public: // data
+        TInt                            iMessageType;
+
+
+    private:     // Data
+
+        RFs                             iFs;
+        RFileReadStream*                iReader;
+        TBuf<DefaultBufLen>             iValueBuffer;
+        CDesCArray*     iAliasArray;    // aliases
+        HBufC8*         iByteBuffer;
+        TTime                           iDate;
+        CArrayPtrFlat<CMmsAttaStructure>* iAttaStructures;
+        TInt                            iAttaCount;
+		TInt							iAttaRoot;
+		TInt							iAliasCount;
+        TInt                            iNextMessageType;
+        TParse                          iParse;
+        TFileName                       iFilename;
+
+    protected:  // Data
+    private:    // Data
+
+        // CArrayFixFlat <TestMessage>* iMessages;
+
+    public:     // Friend classes
+    protected:  // Friend classes
+    private:    // Friend classes
+
+    };
+
+
+NONSHARABLE_CLASS( CMmsAttaStructure ):public CBase
+    {
+    public:  // Constructors and destructor
+        static CMmsAttaStructure* NewL(); // Two-phased constructor.
+        virtual ~CMmsAttaStructure(); // Destructor
+    private:
+        CMmsAttaStructure(); // C++ default constructor.
+        // By default constructor is private.
+        void ConstructL();
+
+    public:     // Data
+        HBufC8*         iAtta;
+        HBufC8*         iAttaName; // content location
+        HBufC8*         iAttaType;
+        HBufC8*         iAttaCid;
+        TInt            iAttaCharset;
+        HBufC*          iAttaRecommendedName; // recommended filename
+       	CDesC8ArrayFlat* iContentTypeParams;  // zero or more "parameter"
+    	CDesC8ArrayFlat* iXTypeParams;        // zero or more X-Type "parameters"
+
+    };
+
+
+#endif      // MMSREADFILE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/msguiutils/tsrc/unittest_msguiutils/mmstestbed/inc/mmstestbed.h	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ */
+
+#ifndef MMSTESTBED_H
+#define MMSTESTBED_H
+
+#ifdef BUILD_MMSTESTBED_DLL
+#define MMSTESTBED_EXPORT Q_DECL_EXPORT
+#else
+#define MMSTESTBED_EXPORT Q_DECL_IMPORT
+#endif
+
+#include <QObject>
+#include <QString>
+
+#include <msvids.h>  //for consts like KMsvNullIndexEntryIdValue
+#include <MSVAPI.H>
+#include <MTCLREG.H>
+#include <mmsclient.h>
+//#include <mmsservercommon.h>
+
+class CTestUiTimer;
+class CMsvSession;
+class CMmsClientMtm;
+class CMmsSettings;
+class CMmsHeaders;
+class CLogEvent;
+class CLogViewEvent;
+class CLogFilter;
+class CLogClient;
+
+class MMSTESTBED_EXPORT MmsTestBed : public QObject, public MMsvSessionObserver
+    {
+    Q_OBJECT
+
+public:
+    /**
+     *
+     */
+    MmsTestBed();
+    ~MmsTestBed();
+    void setConnectionLocal(bool value);
+    void fromOutboxToMmsc();
+    void fromMmscToInbox();
+    /**
+     * cleanup MMS service
+     */
+    void cleanupAndCreateNewService();
+    void deleteNotifications();
+    void restoreFactorySettings();
+    void setFetchingState( TMmsReceivingMode aState );
+    void sendFromFile();
+    void sendOneByOne();
+    void sendNotifications();
+    void copyDrafts();
+    void garbageCollection(TUint32 aReason = 0x00000001); //0x00000001 == KMmsReasonBoot
+    void messageVariation();
+    void cancelSendScheduling();
+    void scheduledSend(TMsvId aBoxId, TInt aDelay = 5);
+    void deleteSendSchedule();
+    void cancelFetchScheduling();
+    void fetchForced(TInt aDelay = 5);
+    void deleteFetchSchedule();
+    void doAFetchCycle();
+    void createEntry(TMsvEntry& aNewEntry, CMsvEntry& aClientEntry);
+    void cleanOutbox();
+    void cleanInbox();
+    void cleanSent();
+    void cleanDrafts();
+    void cleanAll();
+    void reply();
+    void replyToAll();
+    void forward();
+    void sendReadReport(); // send a read report
+    int fromOutboxToMmscWithMemoryFailure(); // returns memory failure count
+    int fromMmscToInboxWithMemoryFailure(); // returns memory failure count
+    void sendViaClient();
+    void scheduledFetch(TInt aDelay = 5);
+    void fetchForcedImmediate();
+    void getEventType();
+    void addEventType();
+    void deleteEventType();
+    void cleanLog();
+    void setOnline(bool value);
+    void generateDeliveryReport( CMmsHeaders* aMmsHeaders );
+    void sendDeliveryReport();
+
+signals:
+    void entryCreatedInDraft(long int id);
+    void entryMovedToOutbox(long int id);
+    void entryMovedToSent(long int id);
+    void entryCreatedInInbox(long int id);
+
+protected:
+    /**
+     * From MMsvSessionObserver
+     */
+    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1,
+            TAny* aArg2, TAny* aArg3);
+
+private:
+    void findDefaultL();
+    void createMmsService();
+    void cleanup();
+    void deleteEntry(TMsvId aEntryId, CMsvEntry& aClientEntry);
+    void testFile(TFileName& aFilePath, TInt aCommand = 0, TMsvId aBox = KMsvGlobalOutBoxIndexEntryId);
+    void addMMBoxDescriptions();
+    void encodeMessageFromDrafts();
+    TMsvId findMMSFolder();
+    bool checkLogClient();
+    int getLogEntries();
+
+private:
+    //data
+    CTestUiTimer* iTimer;
+    CMsvOperationActiveSchedulerWait* iWait;
+    CMsvSession* iSession;
+    CClientMtmRegistry* iClientMtmRegistry;
+    CMmsClientMtm* iMmsClient;
+    CMmsSettings* iSettings;
+    CMmsHeaders* iMmsHeaders;
+    TMsvId iServiceId;
+    TMsvId iDefaultServiceId;
+    TMsvSessionEvent iEvent;
+    RFs iFs;
+    TFileName iFilename;
+    TFileName iCurrentFile;
+    TFileName iCurrentPath;
+    TParse iParse;     // parse buffer as member to save stack space
+    CBufFlat* iEncodeBuffer;
+    CMsvEntrySelection* iMsvEntrySelection;
+    CLogEvent* iLogEvent;
+    CLogClient* iLogClient;
+    CLogViewEvent* iLogView;
+    CLogFilter* iLogFilter;
+    };
+
+#endif // MMSTESTBED_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/msguiutils/tsrc/unittest_msguiutils/mmstestbed/inc/mmstestbed.hrh	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,131 @@
+/*
+ * 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 <bldvariant.hrh>
+
+
+#ifndef MMSTESTBED_HRH
+#define MMSTESTBED_HRH
+
+enum
+{
+    EAppMainOk = 1,
+    EAppMainCancel,
+    //
+    EMenufrmCmdCascadeTest,
+    ECleanup,
+    ECleanOutbox,
+    ESaveSettings,
+    ELoadSettings,
+    ECleanInbox,
+    EShowIn,
+    EShowOut,
+    EOutToMMSC,
+    EMMSCToIn,
+    ESendScheduled,
+    EReceiveScheduled,
+    EShowSent,
+    ECleanSent,
+    EStartMyNotifier,
+    EGetEventType,
+    EAddEventType,
+    EDeleteEventType,
+    EViewLog,
+    ECleanLog,
+    EShowWapAccessPoints,
+    ESelectWapAccessPoint,
+    EShowConnectionMode,
+    EShowIAP,
+    EConnectToIAP,
+    EDeleteSendSchedule,
+    EDeleteReceiveSchedule,
+    EDeleteNotifications,
+    ERestoreFactorySettings,
+    ECreateFromFile,
+    EShowNotifications,
+    ESendDeliveryReport,
+    EShowDrafts,
+    ECleanDrafts,
+    ECleanAll,
+    EFetchingDeferred,
+    EFetchingOn,
+    ESendFromFile,
+    ESwitchToLocal,
+    ESwitchToGlobal,
+    EDecodeLoggingOn,
+    EDecodeLoggingOff,
+    EBinaryDumpOn,
+    EBinaryDumpOff,
+    ESendNotification,
+    ECreateToInbox,
+    ECreateToSentItems,
+    ESendFromDrafts,
+    EFindMMSFolder,
+    ESendOneByOne,
+    ECreateToDrafts,
+    ESendViaClient,
+    ESendMemFail,
+    EFetchMemFail,
+    EReceiveForced,
+    ECreateHeadersFromFile,
+    ESwitchToOffline,
+    ESwitchToOnline,
+    ECopyDrafts,
+    ECreateNotification,
+    EReply,
+    EReplyToAll,
+    EForward,
+    EFetchingManual,
+    EFirstBoot,
+    ENoFirstBoot,
+    EFindNetworkStatus,
+    ESendReadReport,
+    ECreateMMBoxViewConf,
+    EGetMMBoxView,
+    ECleanMMBox,
+    EShowMMBox
+};
+
+#define 	ETestLabel1 1
+#define 	ETestLabel2 2
+#define 	ETestLabel3 3
+#define 	ETestLabel4 4
+
+#define     EServiceList 2
+
+
+enum TTestBedDlgCtrlIds
+	{
+	ETestEditField = 1
+	};
+
+enum TEditServiceControls
+	{
+	EFolderLabel = 1,
+    EEditUri
+//	EEditServiceFolder,
+//	ENameLabel,
+//	EEditServiceName,
+//	ENumberLabel,
+//	EEditServiceNumber
+	};
+
+enum
+	{
+	EFsViewDialogId = 1
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/msguiutils/tsrc/unittest_msguiutils/mmstestbed/inc/mmsteststaticutils.h	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,203 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ */
+
+#ifndef MMSTESTSTATICUTILS_H
+#define MMSTESTSTATICUTILS_H
+
+#include <e32std.h>
+#include <msvstd.h>
+#include <badesca.h>
+
+#include "mmsconst.h"
+
+class RFs;
+class CMsvSession;
+class CMmsEncode;
+class CMmsHeaders;
+
+#ifdef __WINS__
+_LIT( KRootPath, "c:\\" );
+#else
+// This is removable disk.
+// drive letter should not be hard coded, must be investigated further
+// We use c: for a while for the tests (to be cahnged later)
+_LIT( KRootPath, "c:\\" );
+//_LIT( KRootPath, "e:\\" );
+#endif
+
+// directory where mmbox descriptions are created
+_LIT( KMmsMMBoxDescriptionDirectory, "C:\\mmsmmboxdescriptions\\");
+// directory where created headers are dumped
+_LIT( KMmsDumpDirectory, "C:\\mmsdump\\");
+// content type of MMS PDUs
+_LIT8( KMmsMimeType, "application/vnd.wap.mms-message" );
+
+_LIT( KWild, "*" );
+
+
+/**
+ *  joined array structure
+ *
+ */
+NONSHARABLE_CLASS( TMmsJoinedArrays ): public MDesCArray
+    {
+public:
+    TMmsJoinedArrays(CDesCArray* const & aArray1, CDesCArray* const & aArray2);
+    TInt MdcaCount() const;
+    TPtrC16 MdcaPoint(TInt aIndex) const;
+private:
+    CDesCArray* const & iArray1;
+    CDesCArray* const & iArray2;
+    };
+
+/**
+ *  static utility functions
+ *
+ */
+class TMmsTestUtils
+    {
+
+public:
+
+    /**
+     *
+     */
+    TMmsTestUtils();
+
+    /**
+     * read phone number for sending messages
+     *
+     * @param aFileName full path for filename
+     * @param aFs file system handle
+     * @return allocated pointer containing the name
+     *     The caller must delete the pointer when no longer needed
+     */
+    static HBufC* ReadContactFromFileL( TDesC& aFileName, RFs& aFs );
+
+    static void DecodeLoggingOnL();
+    static void DecodeLoggingOffL();
+    static void BinaryDumpOnL();
+    static void BinaryDumpOffL();
+
+    /**
+     * Clean all temporary directories used in local mode.
+     * Does not delete the directories, only the contents
+     *
+     * @param aFs file system handle
+     */
+    static void CleanDirectoryL( RFs& aFs );
+
+    /**
+     * Dump a binary message
+     *
+     * @param aBuffer buffer containing the binary message
+     * @param aFilename full path of the directory whenre the dump goes
+     * @param aParse reference to parser (to save stack space)
+     * @param aFs file system handle
+     */
+    static void Dump(
+        CBufFlat& aBuffer, TFileName& aFilename, TParse& aParse, RFs& aFs );
+
+    /**
+     * Delete all MMS messages and notifications from a given folder
+     *
+     * @param aBoxId folder id
+     * @param aSession Messaging server session
+     */
+    static void CleanBoxL(TMsvId aBoxId, CMsvSession& aSession);
+
+    /**
+     * turn on logging messages sent to email addresses
+     */
+    static void EmailLoggingOnL();
+
+    /**
+     * turn off logging messages sent to email addresses
+     */
+    static void EmailLoggingOffL();
+
+    /**
+     * load list of children into selection and return count
+     *
+     * @param aBoxId folder id
+     * @param aMsvEntrySelection reference to a pointer that will contain the list of child ids
+     *     caller is responsible of deleting the pointer afterwards.
+     *     Pointer may be NULL at entry, and a new pointer will be allocated
+     * @param aSession messge server session
+     * @param aMessageType child MTM type, default is multimedia message
+     * @return number of entries in selection
+     */
+    static TInt CountChildrenL(
+        TMsvId aBoxId,
+        CMsvEntrySelection*& aMsvEntrySelection,
+        CMsvSession& aSession,
+        TUid aMessageType = KUidMsgTypeMultimedia);
+
+    /**
+     * Create a folder entry
+     *
+     * @param aSession messge server session
+     * @param aParentFolder the parent folder
+     * @param aFolderName name of the folder
+     * @param aFolderId will contain the if of the new folder if creation was successful
+     */
+    static void CreateFolderEntryL(
+        CMsvSession& aSession,
+        TMsvId aParentFolder,
+        const TDesC& aFolderName,
+        TMsvId& aFolderId );
+
+    /**
+    * Create an MMS notification from data in buffer
+    * @param aNotificationFolder mms notification folder (target folder)
+    * @param aServiceId id of MMS service
+    * @param aEncodeBuffer buffer that contains the data
+    * @param aSession message server session
+    * @return id of the created notification
+    */
+    static TMsvId CreateNotificationEntryL(
+        TMsvId aNotificationFolder,
+        TMsvId aServiceId,
+        CBufFlat* aEncodeBuffer,
+        CMsvSession& aSession );
+
+    /**
+    * Encode an MMS notification into buffer
+    * @param aUrl url of the notification for local messages a filepath
+    * @param aSize size of the message
+    * @param aMmsHeaders MMS headers structure for creating the notification
+    * @param aMmsEncoder reference to CMmsEncode class
+    * @param aEncodeBuffer flat buffer that will contain the encoded notification
+    */
+    static void FormNotification(
+        TDesC8& aUrl,
+        TInt aSize,
+        CMmsHeaders& aMmsHeaders,
+        CMmsEncode& aMmsEncoder,
+        CBufFlat* aEncodeBuffer );
+
+
+    static TBool IsDrive(const TDesC& aFileName);
+    static TBool IsDir(const TDesC& aFileName, RFs& aFs);
+    static TBool IsFile(const TDesC& aFileName, RFs& aFs);
+
+
+private:
+
+    };
+
+
+#endif // MMSTESTSTATICUTILS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/msguiutils/tsrc/unittest_msguiutils/mmstestbed/inc/mmstestuitimer.h	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ */
+
+#ifndef C_TESTUITIMER_H
+#define C_TESTUITIMER_H
+
+
+#include <e32base.h>
+
+#define KPeriod 10000 // period of timer
+
+/**
+ *  timer for test programs
+ */
+NONSHARABLE_CLASS( CTestUiTimer ): public CTimer
+    {
+public:
+
+    static CTestUiTimer* NewL();
+    virtual  ~CTestUiTimer();
+
+    void RunL();
+    void DoCancel();
+    void ConstructL();
+    void IssueRequest();
+    void TimeoutOperation(CActive* aObject, TTimeIntervalSeconds aTimeoutInSeconds);
+
+private:
+    CTestUiTimer();
+
+public:
+    TTimeIntervalMicroSeconds32 period;
+
+private: // data
+    CActive* iObject;
+    };
+
+#endif // C_TESTUITIMER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/msguiutils/tsrc/unittest_msguiutils/mmstestbed/src/mmsreadfile.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,1799 @@
+/*
+ * 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 FILES
+#include    <e32base.h>
+#include    <badesca.h>
+#include    <e32def.h>
+#include    <s32file.h>
+#include    <msvids.h>
+#include    <mtmdef.h>
+//#include    <eikenv.h>
+#include    <apgcli.h>
+#include    <CMsvMimeHeaders.h>
+#include    <AknNoteWrappers.h>
+
+#include    <mmsservercommon.h>
+#include    "mmsconst.h"
+#include    "mmsclient.h"
+#include    "mmsheaders.h"
+#include    "mmsreadfile.h"
+#include    "mmsmmboxviewheaders.h"
+#include    "mmsmmboxmessageheaders.h"
+#include    "mmsmmboxflags.h"
+#include    "mmssettings.h"
+
+
+// EXTERNAL DATA STRUCTURES
+
+// EXTERNAL FUNCTION PROTOTYPES
+
+// CONSTANTS
+const TInt KMmsGranularity = 8;
+_LIT( K1970, "19700000:000000.000000" );    // 1-Jan 1970 0:00:00
+
+
+// MACROS
+
+// LOCAL CONSTANTS AND MACROS
+
+// MODULE DATA STRUCTURES
+
+// LOCAL FUNCTION PROTOTYPES
+
+// ==================== LOCAL FUNCTIONS ====================
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CMmsReadFile::CMmsReadFile()
+    {
+    // all member variables in a class derived from CBase
+    // are automatically set to 0.
+    }
+
+
+//
+void CMmsReadFile::ConstructL(RFs& aFs, RFileReadStream& aReadStream )
+    {
+    // iRowBuffer = HBufC8::NewMaxL( 500 ); // Max row length!!!!
+    iFs = aFs;
+    iReader = &aReadStream;
+    iByteBuffer = HBufC8::NewL( DefaultBufLen );
+    iAliasArray = new ( ELeave ) CDesCArrayFlat( KMmsGranularity );
+    iAttaStructures = new ( ELeave ) CArrayPtrFlat<CMmsAttaStructure>( KMmsGranularity );
+    Reset();
+    }
+
+// Two-phased constructor.
+CMmsReadFile* CMmsReadFile::NewL(RFs& aFs, RFileReadStream& aReadStream )
+    {
+    CMmsReadFile* self = new ( ELeave ) CMmsReadFile();
+    CleanupStack::PushL( self );
+    self->ConstructL( aFs, aReadStream );
+    CleanupStack::Pop();
+    return self;
+    }
+
+
+// Destructor
+CMmsReadFile::~CMmsReadFile()
+    {
+    Reset(); // resets and destroys all array data
+    if (iAliasArray != NULL) iAliasArray->Reset();
+    delete iByteBuffer;
+    delete iAliasArray;
+    delete iAttaStructures;
+    }
+
+void CMmsReadFile::Reset()
+    {
+    // reset all arrays
+    if (iAttaStructures != NULL) iAttaStructures->ResetAndDestroy();
+    iAttaCount = 0;
+    iAttaRoot = 0;
+    }
+
+// ---------------------------------------------------------
+// CMmsReadFile()::CompleteTest
+// ---------------------------------------------------------
+//
+TInt CMmsReadFile::CompleteTestL( TInt aMessageCounter, CMmsHeaders& aMmsHeaders )
+{
+    Reset(); // new message
+
+    TUint32 val;
+    TUint   limit = 1000000;
+    TUint   sizeLimit = 1000 * 1024; //max message size 1000 kB!
+    TUint   allLimit = 999999;
+    TInt    error;
+    TRadix  radix = EDecimal;
+    TLex16  lex;
+    TTestReadStatus readStatus = ETestUnknown;
+    CMmsAttaStructure* oneAtta = NULL;
+	TInt    index;
+    TTime y1970( K1970 );
+    TTimeIntervalMicroSeconds interval;
+    TTime date;
+    TInt order = 0;
+    TInt16 shortInteger = 0;
+
+    //iso luuppi, joka kiertää ja lukee kunnes EOF tule vastaan
+    //Big Loop, which passes around and read until the EOF
+
+    iMessageType = iNextMessageType;
+    while(readStatus != ETestEof)
+        {
+        readStatus = ReadRowL();
+        if ( readStatus ==  ETestEof )
+            {
+            return(-1);
+            }
+        if ( readStatus == ETestUnknown )
+            {
+            // A line containing only comments, or an unknown tag
+            // As using the scripts to test settings is no longer supported,
+            // any old keywords used to test CMmsSettings class are ignored
+            continue;
+            }
+        if( readStatus == ETestNewMessage )
+            {
+            iNextMessageType = readStatus;
+            if(aMessageCounter++)
+                {
+                return(NULL);
+                }
+            else
+                {
+                iMessageType = iNextMessageType;
+                continue;
+                }
+            }
+        if ( iMessageType == ETestNewMessage)
+            {
+            switch(readStatus)
+                {
+                case ETestFrom:
+                    aMmsHeaders.SetSenderL( iValueBuffer );
+                    break;
+                case ETestFromAlias:
+					index = FindAlias(iValueBuffer);
+					if(index >= 0)
+    					{
+                        aMmsHeaders.SetSenderL( iAliasArray->MdcaPoint(index).Mid(iAliasArray->MdcaPoint(index).Locate('=') + 1 ) );
+	    				}
+                    break;
+                case ETestTo:
+                    aMmsHeaders.AddTypedAddresseeL( iValueBuffer, EMsvRecipientTo );
+                    break;
+                case ETestToAlias:
+					index = FindAlias(iValueBuffer);
+					if(index >= 0)
+    					{
+                        aMmsHeaders.AddTypedAddresseeL( iAliasArray->MdcaPoint(index).Mid(iAliasArray->MdcaPoint(index).Locate('=') + 1 ), EMmsTo );
+						}
+                    break;
+                case ETestCc:
+                    aMmsHeaders.AddTypedAddresseeL( iValueBuffer, EMsvRecipientCc );
+                    break;
+                case ETestCcAlias:
+					index = FindAlias(iValueBuffer);
+					if(index >= 0)
+    					{
+                        aMmsHeaders.AddTypedAddresseeL( iAliasArray->MdcaPoint(index).Mid(iAliasArray->MdcaPoint(index).Locate('=') + 1 ), EMmsCc );
+						}
+                    break;
+                case ETestBcc:
+                    aMmsHeaders.AddTypedAddresseeL( iValueBuffer, EMsvRecipientBcc );
+                    break;
+                case ETestBccAlias:
+					index = FindAlias(iValueBuffer);
+					if(index >= 0)
+    					{
+                        aMmsHeaders.AddTypedAddresseeL( iAliasArray->MdcaPoint(index).Mid(iAliasArray->MdcaPoint(index).Locate('=') + 1 ), EMmsBcc );
+						}
+                    break;
+                case ETestSubject:
+                    aMmsHeaders.SetSubjectL( iValueBuffer );
+                    break;
+                case ETestExpiryRel:
+                    lex.Assign(iValueBuffer);
+                    error = lex.Val(val,radix,limit);
+                    if (error == KErrNone)
+                        {
+                        aMmsHeaders.SetExpiryInterval( val );
+                        }
+                    break;
+                case ETestExpiryAbs:
+                    error = iDate.Set(iValueBuffer);
+                    interval = iDate.MicroSecondsFrom( y1970 );
+                    // expiry date in seconds from 1.1.1970.
+                    aMmsHeaders.SetExpiryDate( (interval.Int64())/1000000 );
+                    break;
+                case ETestDeliveryTimeRel:
+                    lex.Assign(iValueBuffer);
+                    error = lex.Val(val,radix,limit);
+                    if (error == KErrNone)
+                        {
+                        aMmsHeaders.SetDeliveryTimeInterval( val );
+                        }
+                    break;
+                case ETestDeliveryTimeAbs:
+                    error = iDate.Set(iValueBuffer);
+                    interval = iDate.MicroSecondsFrom( y1970 );
+                    aMmsHeaders.SetDeliveryDate( (interval.Int64())/1000000 );
+                    break;
+                case ETestDate:
+                    error = iDate.Set(iValueBuffer);
+                    interval = iDate.MicroSecondsFrom( y1970 );
+                    aMmsHeaders.SetDate( (interval.Int64())/1000000 );
+                case ETestPriority:
+                    val = 0;
+                    if ((iValueBuffer.CompareF(KLow)) == 0)
+                        {
+                        val = EMmsPriorityLow;
+                        }
+                    else if ((iValueBuffer.CompareF(KNormal)) == 0)
+                        {
+                        val = EMmsPriorityNormal;
+                        }
+                    else if ((iValueBuffer.CompareF(KHigh)) == 0)
+                        {
+                        val = EMmsPriorityHigh;
+                        }
+                    else
+                        {
+                        val = KMmsTestIllegalValue;
+                        }
+                    aMmsHeaders.SetMessagePriority( val );
+                    break;
+                case ETestSenderVisibility:
+                    val = 0;
+                    if ((iValueBuffer.CompareF(KHide)) == 0)
+                        {
+                        val = EMmsSenderVisibilityHide;
+                        }
+                    else if ((iValueBuffer.CompareF(KShow)) == 0)
+                        {
+                        val = EMmsSenderVisibilityShow;
+                        }
+                    else
+                        {
+                        val = KMmsTestIllegalValue;
+                        }
+                    aMmsHeaders.SetSenderVisibility( val );
+                    break;
+                case ETestDeliveryReport:
+                    val = 0;
+                    if ((iValueBuffer.CompareF(KYes)) == 0)
+                        {
+                        val = EMmsYes;
+                        }
+                    else if ((iValueBuffer.CompareF(KNo)) == 0)
+                        {
+                        val = EMmsNo;
+                        }
+                    else
+                        {
+                        val = KMmsTestIllegalValue;
+                        }
+                    aMmsHeaders.SetDeliveryReport( val );
+                    break;
+                case ETestDelivReportSendAllow:
+                    val = 0;
+                    if ((iValueBuffer.CompareF(KYes)) == 0)
+                        {
+                        val = EMmsYes;
+                        }
+                    else if ((iValueBuffer.CompareF(KNo)) == 0)
+                        {
+                        val = EMmsNo;
+                        }
+                    else
+                        {
+                        val = KMmsTestIllegalValue;
+                        }
+                    aMmsHeaders.SetReportAllowed( val );
+                    break;
+
+                case ETestReadReply:
+                    val = 0;
+                    if ((iValueBuffer.CompareF(KYes)) == 0)
+                        {
+                        val = EMmsYes;
+                        }
+                    else if ((iValueBuffer.CompareF(KNo)) == 0)
+                        {
+                        val = EMmsNo;
+                        }
+                    else
+                        {
+                        val = KMmsTestIllegalValue;
+                        }
+                    aMmsHeaders.SetReadReply( val );
+                    break;
+                case ETestNewAttachment:
+                    oneAtta = CMmsAttaStructure::NewL();
+                    iAttaStructures->AppendL(oneAtta);
+                    oneAtta->iAtta->Des().Copy( iValueBuffer );
+                    iAttaCount++;
+                    break;
+                case ETestAttachmentType:
+                    if (oneAtta != NULL)
+                        {
+                        oneAtta->iAttaType->Des().Copy( iValueBuffer );
+                        }
+                    break;
+                case ETestAttachmentContLoc:
+                    if (oneAtta != NULL)
+                        {
+                        oneAtta->iAttaName->Des().Copy( iValueBuffer );
+                        }
+                    break;
+                case ETestAttaRecommendedName:
+                    if (oneAtta != NULL)
+                        {
+                        oneAtta->iAttaRecommendedName->Des().Copy( iValueBuffer );
+                        }
+                    break;
+                case ETestAttachmentCharset:
+                    lex.Assign(iValueBuffer);
+                    error = lex.Val(val,radix,limit);
+                    if (error == KErrNone)
+                        {
+                        if (oneAtta != NULL)
+                            {
+                            oneAtta->iAttaCharset = val;
+                            }
+                        }
+                    break;
+                case ETestAttachmentCid:
+                    if (oneAtta != NULL)
+                        {
+                        oneAtta->iAttaCid->Des().Copy(iValueBuffer);
+                        }
+                    break;
+                case ETestAttContTypeParamName:
+                    iByteBuffer->Des().Copy( iValueBuffer );
+                    if (oneAtta != NULL)
+                        {
+                        oneAtta->iContentTypeParams->AppendL(iByteBuffer->Des());
+                        }
+                    break;
+                case ETestAttContTypeParamValue:
+                    iByteBuffer->Des().Copy( iValueBuffer );
+                    if (oneAtta != NULL)
+                        {
+                        oneAtta->iContentTypeParams->AppendL(iByteBuffer->Des());
+                        }
+                    break;
+                case ETestAttXTypeParamName:
+                    iByteBuffer->Des().Copy( iValueBuffer );
+                    if (oneAtta != NULL)
+                        {
+                        oneAtta->iXTypeParams->AppendL(iByteBuffer->Des());
+                        }
+                    break;
+                case ETestAttXTypeParamValue:
+                    iByteBuffer->Des().Copy( iValueBuffer );
+                    if (oneAtta != NULL)
+                        {
+                        oneAtta->iXTypeParams->AppendL(iByteBuffer->Des());
+                        }
+                    break;
+                case ETestAttachmentRoot:
+                    iAttaRoot = iAttaCount;
+                    break;
+                case ETestAlias:
+                    // all aliases are global even if they appear
+                    // in the middle of a message
+                    iAliasArray->AppendL( iValueBuffer );
+                    iAliasCount++;
+				    break;
+                case ETestMessageClass: // should be handled!
+                    val = EMmsClassPersonal;
+                    if ((iValueBuffer.CompareF(KPersonal)) == 0)
+                        {
+                        val = EMmsClassPersonal;
+                        }
+                    else if ((iValueBuffer.CompareF(KAdvertisement)) == 0)
+                        {
+                        val = EMmsClassAdvertisement;
+                        }
+                    else if ((iValueBuffer.CompareF(KInformational)) == 0)
+                        {
+                        val = EMmsClassInformational;
+                        }
+                    else if ((iValueBuffer.CompareF(KAuto)) == 0)
+                        {
+                        val = EMmsClassAuto;
+                        }
+                    else
+                        {
+                        val = (TMmsMessageClass)KMmsTestIllegalValue;
+                        }
+                    aMmsHeaders.SetMessageClass( val );
+                    break;
+                case ETestReplyCharging:
+                    val = 0;
+                    if ((iValueBuffer.CompareF(KRequested)) == 0)
+                        {
+                        val = KMmsReplyChargingRequested;
+                        }
+                    else if ((iValueBuffer.CompareF(KReqTextOnly)) == 0)
+                        {
+                        val = KMmsReplyChargingRequestedTextOnly;
+                        }
+                    else if ((iValueBuffer.CompareF(KAccepted)) == 0)
+                        {
+                        val = KMmsReplyChargingAccepted;
+                        }
+                    else if ((iValueBuffer.CompareF(KAccTextOnly)) == 0)
+                        {
+                        val = KMmsReplyChargingAcceptedTextOnly;
+                        }
+                    else
+                        {
+                        val = KMmsTestIllegalValue;
+                        }
+                    aMmsHeaders.SetReplyCharging( val );
+                    break;
+                case ETestReplyChargAbs:
+                    error = date.Set(iValueBuffer);
+                    if ( error == KErrNone )
+                        {
+                        interval = date.MicroSecondsFrom( y1970 );
+                        aMmsHeaders.SetReplyChargingDate( (interval.Int64())/1000000 );
+                        }
+                    break;
+                case ETestReplyChargRel:
+                    lex.Assign(iValueBuffer);
+                    error = lex.Val(val,radix,limit);
+                    if (error == KErrNone)
+                        {
+                        aMmsHeaders.SetReplyChargingInterval( val );
+                        }
+                    break;
+                case ETestReplyChargSize:
+                    lex.Assign(iValueBuffer);
+                    error = lex.Val(val,radix,sizeLimit);
+                    if (error == KErrNone)
+                        {
+                        aMmsHeaders.SetReplyChargingSize( val );
+                        }
+                    break;
+                case ETestReplyChargID:
+                    iByteBuffer->Des().Copy( iValueBuffer );
+                    aMmsHeaders.SetReplyChargingIdL( iByteBuffer->Des() );
+                    break;
+                case ETestTID:
+                    iByteBuffer->Des().Copy( iValueBuffer );
+                    aMmsHeaders.SetTidL( iByteBuffer->Des() );
+                    break;
+                case ETestContentLocation:
+                    iByteBuffer->Des().Copy( iValueBuffer );
+                    if ( aMmsHeaders.MessageType() == KMmsMessageTypeMboxViewReq ||
+                        aMmsHeaders.MessageType() == KMmsMessageTypeMboxViewConf ||
+                        aMmsHeaders.MessageType() == KMmsMessageTypeMBoxDeleteReq )
+                        {
+                        aMmsHeaders.MMBoxMessageHeadersL().ContentLocationList().AppendL( iByteBuffer->Des() );
+                        }
+                    else if ( aMmsHeaders.MessageType() == KMmsMessageTypeMBoxDeleteConf )
+                        {
+                        aMmsHeaders.InsertDeleteContentLocationL( order, iByteBuffer->Des() );
+                        }
+                    else
+                        {
+                        aMmsHeaders.SetContentLocationL( iByteBuffer->Des() );
+                        }
+                    break;
+                case ETestPreviouslySentIndex:
+                    lex.Assign(iValueBuffer);
+                    error = lex.Val(val,radix,limit);
+                    order = val;
+                    break;
+                case ETestPreviouslySentBy:
+                    aMmsHeaders.InsertPreviouslySentByL( order, iValueBuffer );
+                    break;
+                case ETestPreviouslySentDate:
+                    error = date.Set(iValueBuffer);
+                    if ( error == KErrNone )
+                        {
+                        interval = date.MicroSecondsFrom( y1970 );
+                        aMmsHeaders.InsertPreviouslySentDateL( order, (interval.Int64())/1000000 );
+                        }
+                    break;
+                case ETestMessageId:
+                    iByteBuffer->Des().Copy( iValueBuffer );
+                    aMmsHeaders.SetMessageIdL( iByteBuffer->Des() );
+                    break;
+                case ETestMessageSize:
+                    lex.Assign(iValueBuffer);
+                    error = lex.Val(val,radix,sizeLimit);
+                    if (error == KErrNone)
+                        {
+                        aMmsHeaders.SetMessageSize( val );
+                        }
+                    break;
+                case ETestVersion:
+                    lex.Assign(iValueBuffer);
+                    error = lex.Val(val,EHex,limit);
+                    shortInteger = TInt16( val );
+                    if (error == KErrNone)
+                        {
+                        aMmsHeaders.SetMmsVersion( shortInteger );
+                        }
+                    break;
+                case ETestReadStatus:
+                    val = 0;
+                    if ((iValueBuffer.CompareF(KRead)) == 0)
+                        {
+                        val = KMmsReadStatusRead;
+                        }
+                    else if ((iValueBuffer.CompareF(KDelNotRead)) == 0)
+                        {
+                        val = KMmsReadStatusDeletedWithoutBeingRead;
+                        }
+                    else
+                        {
+                        val = KMmsTestIllegalValue;
+                        }
+                    aMmsHeaders.SetReadStatus( val );
+                    break;
+                case ETestResponseStatus:
+                    val = 0;
+                    if ((iValueBuffer.CompareF(KOk)) == 0)
+                        {
+                        val = KMmsStatusOk;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrUnspecified)) == 0)
+                        {
+                        val = KMmsErrorUnspecified;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrServiceDenied)) == 0)
+                        {
+                        val = KMmsErrorServiceDenied;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrMessageFormatCorrupt)) == 0)
+                        {
+                        val = KMmsErrorMessageFormatCorrupt;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrAddressUnresolved)) == 0)
+                        {
+                        val = KMmsErrorSendingAddressUnresolved;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrMessageNotFound)) == 0)
+                        {
+                        val = KMmsErrorMessageNotFound;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrNetworkProblem)) == 0)
+                        {
+                        val = KMmsErrorNetworkProblem;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrContentNotAccepted)) == 0)
+                        {
+                        val = KMmsErrorNoContentAccepted;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrUnsupportedMessage)) == 0)
+                        {
+                        val = KMmsErrorUnsupportedMessage;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrTransient)) == 0)
+                        {
+                        val = KMmsErrorTransientFailure;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrTransientAddressUnresolved)) == 0)
+                        {
+                        val = KMmsErrorTransientSendingAddressUnresolved;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrTransientNotFound)) == 0)
+                        {
+                        val = KMmsErrorTransientMessageNotFound;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrTransientNetworkproblem)) == 0)
+                        {
+                        val = KMmsErrorTransientNetworkProblem;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrPermanent)) == 0)
+                        {
+                        val = KMmsErrorPermanentFailure;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrPermanentServiceDenied)) == 0)
+                        {
+                        val = KMmsErrorPermanentServiceDenied;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrPermanentMessageFormatCorrupt)) == 0)
+                        {
+                        val = KMmsErrorPermanentMessageFormatCorrupt;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrPermanentAddressUnresolved)) == 0)
+                        {
+                        val = KMmsErrorPermanentSendingAddressUnresolved;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrPermanentNotFound)) == 0)
+                        {
+                        val = KMmsErrorPermanentMessageNotFound;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrPermanentContentNotAccepted)) == 0)
+                        {
+                        val = KMmsErrorPermanentContentNotAccepted;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrReplyChargingLimitNotMet)) == 0)
+                        {
+                        val = KMmsErrorPermanentReplyChargingLimitationsNotMet;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrReplyChargingRequestNotAccepted)) == 0)
+                        {
+                        val = KMmsErrorPermanentReplyChargingRequestNotAccepted;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrReplyChargingForwardingDenied)) == 0)
+                        {
+                        val = KMmsErrorPermanentReplyChargingForwardingDenied;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrReplyChargingNotSupported)) == 0)
+                        {
+                        val = KMmsErrorPermanentReplyChargingNotSupported;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrTransientPartialSuccess)) == 0)
+                        {
+                        val = KMmsErrorTransientPartialSuccess;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrAddressHidingNotSupported)) == 0)
+                        {
+                        val = KMmsErrorPermanentAddressHidingNotSupported;
+                        }
+                    else
+                        {
+                        val = KMmsTestIllegalValue;
+                        }
+                    if ( aMmsHeaders.MessageType() == KMmsMessageTypeMBoxDeleteConf )
+                        {
+                        aMmsHeaders.InsertDeleteStatusL( order, val );
+                        }
+                    else
+                        {
+                         aMmsHeaders.SetResponseStatus( val );
+                        }
+                    break;
+                case ETestResponseText:
+                    if ( aMmsHeaders.MessageType() == KMmsMessageTypeMBoxDeleteConf )
+                        {
+                        aMmsHeaders.InsertDeleteResponseTextL( order, iValueBuffer );
+                        }
+                    else
+                        {
+                        aMmsHeaders.SetResponseTextL( iValueBuffer );
+                        }
+                    break;
+                case ETestRetrieveStatus:
+                    val = 0;
+                    if ((iValueBuffer.CompareF(KOk)) == 0)
+                        {
+                        val = KMmsStatusOk;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrTransient)) == 0)
+                        {
+                        val = KMmsErrorTransientFailure;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrTransientNotFound)) == 0)
+                        {
+                        val = KMmsErrorReceiveTransientMessageNotFound;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrTransientNetworkproblem)) == 0)
+                        {
+                        val = KMmsErrorReceiveTransientNetworkProblem;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrPermanent)) == 0)
+                        {
+                        val = KMmsErrorPermanentFailure;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrPermanentServiceDenied)) == 0)
+                        {
+                        val = KMmsErrorPermanentServiceDenied;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrPermanentNotFound)) == 0)
+                        {
+                        val = KMmsErrorReceivePermanentMessageNotFound;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrRetrieveContentUnsupported)) == 0)
+                        {
+                        val = KMmsErrorReceivePermanentContentUnsupported;
+                        }
+                    else
+                        {
+                        val = KMmsTestIllegalValue;
+                        }
+                    aMmsHeaders.SetResponseStatus( val );
+                    break;
+                case ETestRetrieveText:
+                    aMmsHeaders.SetResponseTextL( iValueBuffer );
+                    break;
+                case ETestStatus:
+                    val = 0;
+                    if ((iValueBuffer.CompareF(KDeferred)) == 0)
+                        {
+                        val = KMmsMessageStatusDeferred;
+                        }
+                    else if ((iValueBuffer.CompareF(KExpired)) == 0)
+                        {
+                        val = KMmsMessageStatusExpired;
+                        }
+                    else if ((iValueBuffer.CompareF(KRetrieved)) == 0)
+                        {
+                        val = KMmsMessageStatusRetrieved;
+                        }
+                    else if ((iValueBuffer.CompareF(KRejected)) == 0)
+                        {
+                        val = KMmsMessageStatusRejected;
+                        }
+                    else if ((iValueBuffer.CompareF(KUnrecognized)) == 0)
+                        {
+                        val = KMmsMessageStatusUnrecognized;
+                        }
+                    else if ((iValueBuffer.CompareF(KIndeterminate)) == 0)
+                        {
+                        val = KMmsMessageStatusIndeterminate;
+                        }
+                    else if ((iValueBuffer.CompareF(KForwarded)) == 0)
+                        {
+                        val = KMmsMessageStatusForwarded;
+                        }
+                    else if ((iValueBuffer.CompareF(KUnreachable)) == 0)
+                        {
+                        val = KMmsMessageStatusUnreachable;
+                        }
+                    else
+                        {
+                        val = KMmsTestIllegalValue;
+                        }
+                    aMmsHeaders.SetStatus( val );
+                    break;
+                case ETestMessageType:
+                    val = 0;
+                    if ((iValueBuffer.CompareF(KSendReq)) == 0)
+                        {
+                        val = KMmsMessageTypeMSendReq;
+                        }
+                    else if ((iValueBuffer.CompareF(KSendConf)) == 0)
+                        {
+                        val = KMmsMessageTypeMSendConf;
+                        }
+                    else if ((iValueBuffer.CompareF(KNotifInd)) == 0)
+                        {
+                        val = KMmsMessageTypeMNotificationInd;
+                        }
+                    else if ((iValueBuffer.CompareF(KNotifResp)) == 0)
+                        {
+                        val = KMmsMessageTypeMNotifyRespInd;
+                        }
+                    else if ((iValueBuffer.CompareF(KRetrConf)) == 0)
+                        {
+                        val = KMmsMessageTypeMRetrieveConf;
+                        }
+                    else if ((iValueBuffer.CompareF(KAckInd)) == 0)
+                        {
+                        val = KMmsMessageTypeAcknowledgeInd;
+                        }
+                    else if ((iValueBuffer.CompareF(KDelInd)) == 0)
+                        {
+                        val = KMmsMessageTypeDeliveryInd;
+                        }
+                    else if ((iValueBuffer.CompareF(KReadReqInd)) == 0)
+                        {
+                        val = KMmsMessageTypeReadRecInd;
+                        }
+                    else if ((iValueBuffer.CompareF(KReadOrigInd)) == 0)
+                        {
+                        val = KMmsMessageTypeReadOrigInd;
+                        }
+                    else if ((iValueBuffer.CompareF(KForwardRec)) == 0)
+                        {
+                        val = KMmsMessageTypeForwardReq;
+                        }
+                    else if ((iValueBuffer.CompareF(KForwardConf)) == 0)
+                        {
+                        val = KMmsMessageTypeForwardConf;
+                        }
+                    else if ((iValueBuffer.CompareF(KMBoxStoreReq)) == 0)
+                        {
+                        val = KMmsMessageTypeMboxStoreReq;
+                        }
+                    else if ((iValueBuffer.CompareF(KMBoxStoreConf)) == 0)
+                        {
+                        val = KMmsMessageTypeMboxStoreConf;
+                        }
+                    else if ((iValueBuffer.CompareF(KMBoxViewReq)) == 0)
+                        {
+                        val = KMmsMessageTypeMboxViewReq;
+                        }
+                    else if ((iValueBuffer.CompareF(KMBoxViewConf)) == 0)
+                        {
+                        val = KMmsMessageTypeMboxViewConf;
+                        }
+                    else if ((iValueBuffer.CompareF(KMBoxUploadReq)) == 0)
+                        {
+                        val = KMmsMessageTypeMBoxUploadReq;
+                        }
+                    else if ((iValueBuffer.CompareF(KMBoxUploadConf)) == 0)
+                        {
+                        val = KMmsMessageTypeMBoxUploadConf;
+                        }
+                    else if ((iValueBuffer.CompareF(KMBoxDeleteReq)) == 0)
+                        {
+                        val = KMmsMessageTypeMBoxDeleteReq;
+                        }
+                    else if ((iValueBuffer.CompareF(KMBoxDeleteConf)) == 0)
+                        {
+                        val = KMmsMessageTypeMBoxDeleteConf;
+                        }
+                    else if ((iValueBuffer.CompareF(KMBoxDescr)) == 0)
+                        {
+                        val = KMmsMessageTypeMBoxDescr;
+                        }
+                    else if ((iValueBuffer.CompareF(KDeleteReq)) == 0)
+                        {
+                        val = KMmsMessageTypeDeleteReq;
+                        }
+                    else if ((iValueBuffer.CompareF(KDeleteConf)) == 0)
+                        {
+                        val = KMmsMessageTypeDeleteConf;
+                        }
+                    else if ((iValueBuffer.CompareF(KCancelReq)) == 0)
+                        {
+                        val = KMmsMessageTypeCancelReq;
+                        }
+                    else if ((iValueBuffer.CompareF(KCancelResp)) == 0)
+                        {
+                        val = KMmsMessageTypeCancelConf;
+                        }
+                    else
+                        {
+                        val = KMmsTestIllegalValue;
+                        }
+                    aMmsHeaders.SetMessageType( val );
+                    break;
+                case ETestAttribute:
+                    val = 0;
+                    iByteBuffer->Des().Copy( iValueBuffer );
+                    if ((iByteBuffer->Des().CompareF(KTestBcc)) == 0)
+                        {
+                        val = KMmsAssignedBcc;
+                        }
+                    else if ((iByteBuffer->Des().CompareF(KTestCc)) == 0)
+                        {
+                        val = KMmsAssignedCc;
+                        }
+                    else if ((iByteBuffer->Des().CompareF(KTestContent)) == 0)
+                        {
+                        val = KMmsAssignedContent;
+                        }
+                    else if ((iByteBuffer->Des().CompareF(KTestContentType)) == 0)
+                        {
+                        val = KMmsAssignedContentType;
+                        }
+                    else if ((iByteBuffer->Des().CompareF(KTestDate)) == 0)
+                        {
+                        val = KMmsAssignedDate;
+                        }
+                    else if ((iByteBuffer->Des().CompareF(KTestDeliveryReport)) == 0)
+                        {
+                        val = KMmsAssignedDeliveryReport;
+                        }
+                    else if ((iByteBuffer->Des().CompareF(KTestDeliveryTime)) == 0)
+                        {
+                        val = KMmsAssignedDeliveryTime;
+                        }
+                    else if ((iByteBuffer->Des().CompareF(KTestExpiry)) == 0)
+                        {
+                        val = KMmsAssignedExpiry;
+                        }
+                    else if ((iByteBuffer->Des().CompareF(KTestFrom)) == 0)
+                        {
+                        val = KMmsAssignedFrom;
+                        }
+                    else if ((iByteBuffer->Des().CompareF(KTestMessageClass)) == 0)
+                        {
+                        val = KMmsAssignedMessageClass;
+                        }
+                    else if ((iByteBuffer->Des().CompareF(KTestMessageId)) == 0)
+                        {
+                        val = KMmsAssignedMessageId;
+                        }
+                    else if ((iByteBuffer->Des().CompareF(KTestMessageSize)) == 0)
+                        {
+                        val = KMmsAssignedMessageSize;
+                        }
+                    else if ((iByteBuffer->Des().CompareF(KTestPriority)) == 0)
+                        {
+                        val = KMmsAssignedPriority;
+                        }
+                    else if ((iByteBuffer->Des().CompareF(KTestReadReply)) == 0)
+                        {
+                        val = KMmsAssignedReadReply;
+                        }
+                    else if ((iByteBuffer->Des().CompareF(KTestSubject)) == 0)
+                        {
+                        val = KMmsAssignedSubject;
+                        }
+                    else if ((iByteBuffer->Des().CompareF(KTestTo)) == 0)
+                        {
+                        val = KMmsAssignedTo;
+                        }
+                    else if ((iByteBuffer->Des().CompareF(KTestReplyCharging)) == 0)
+                        {
+                        val = KMmsAssignedReplyCharging;
+                        }
+                    else if ((iByteBuffer->Des().CompareF(KTestReplyChargID)) == 0)
+                        {
+                        val = KMmsAssignedReplyChargingID;
+                        }
+                    else if ((iByteBuffer->Des().CompareF(KTestReplyCharg)) == 0)
+                        {
+                        val = KMmsAssignedReplyChargingDeadline;
+                        }
+                    else if ((iByteBuffer->Des().CompareF(KTestReplyChargSize)) == 0)
+                        {
+                        val = KMmsAssignedReplyChargingSize;
+                        }
+                    else if ((iByteBuffer->Des().CompareF(KTestPreviouslySentBy)) == 0)
+                        {
+                        val = KMmsAssignedPreviouslySentBy;
+                        }
+                    else if ((iByteBuffer->Des().CompareF(KTestPreviouslySentDate)) == 0)
+                        {
+                        val = KMmsAssignedPreviouslySentDate;
+                        }
+                    else if ((iByteBuffer->Des().CompareF(KTestAdditionalHeaders)) == 0)
+                        {
+                        val = KMmsAssignedAdditionalHeaders;
+                        }
+                    else
+                        {
+                        val = KMmsTestIllegalValue;
+                        }
+                    aMmsHeaders.MMBoxViewHeadersL().AttributeArray().InsertInOrder(val);
+                    break;
+                case ETestDistributionIndicator:
+                    val = 0;
+                    if ((iValueBuffer.CompareF(KYes)) == 0)
+                        {
+                        val = KMmsYes;
+                        }
+                    else if ((iValueBuffer.CompareF(KNo)) == 0)
+                        {
+                        val = KMmsNo;
+                        }
+                    else
+                        {
+                        val = KMmsTestIllegalValue;
+                        }
+                    aMmsHeaders.SetDistributionIndicator( val );
+                    break;
+                case ETestLimit:
+                    aMmsHeaders.MMBoxViewHeadersL().SetMmsLimit(KMaxTUint32);
+                    lex.Assign(iValueBuffer);
+                    error = lex.Val(val,radix,limit);
+                    if ( val > allLimit )
+                        {
+                        val = KMaxTUint32; // this is too hard to type, more than 999999 means "all"
+                        }
+                    if( error == KErrNone )
+                        {
+                        aMmsHeaders.MMBoxViewHeadersL().SetMmsLimit(val);
+                        }
+                    break;
+                case ETestMessageQuota:
+                    aMmsHeaders.MMBoxViewHeadersL().SetMMBoxQuotaNumber(KMaxTUint32);
+                    lex.Assign(iValueBuffer);
+                    error = lex.Val(val,radix,limit);
+                    if ( val > allLimit )
+                        {
+                        val = KMaxTUint32; // this is too hard to type, more than 999999 means "all"
+                        }
+                    if (error == KErrNone)
+                        {
+                        aMmsHeaders.MMBoxViewHeadersL().SetMMBoxQuotaNumber(val);
+                        }
+                    break;
+                case ETestSizeQuota:
+                    aMmsHeaders.MMBoxViewHeadersL().SetMMBoxQuotaSize(KMaxTUint32);
+                    lex.Assign(iValueBuffer);
+                    error = lex.Val(val,radix,limit);
+                    if ( val > allLimit )
+                        {
+                        val = KMaxTUint32; // this is too hard to type, more than 999999 means "all"
+                        }
+                    if (error == KErrNone)
+                        {
+                        aMmsHeaders.MMBoxViewHeadersL().SetMMBoxQuotaSize(val);
+                        }
+                    break;
+                case ETestMessageTotal:
+                    aMmsHeaders.MMBoxViewHeadersL().SetMMBoxTotalNumber(KMaxTUint32);
+                    lex.Assign(iValueBuffer);
+                    error = lex.Val(val,radix,limit);
+                    if ( val > allLimit )
+                        {
+                        val = KMaxTUint32; // this is too hard to type, more than 999999 means "all"
+                        }
+                    if (error == KErrNone)
+                        {
+                        aMmsHeaders.MMBoxViewHeadersL().SetMMBoxTotalNumber(val);
+                        }
+                    break;
+                case ETestSizeTotal:
+                    aMmsHeaders.MMBoxViewHeadersL().SetMMBoxTotalSize(KMaxTUint32);
+                    lex.Assign(iValueBuffer);
+                    error = lex.Val(val,radix,limit);
+                    if ( val > allLimit )
+                        {
+                        val = KMaxTUint32; // this is too hard to type, more than 999999 means "all"
+                        }
+                    if (error == KErrNone)
+                        {
+                        aMmsHeaders.MMBoxViewHeadersL().SetMMBoxTotalSize(val);
+                        }
+                    break;
+                case ETestMessageCount:
+                    aMmsHeaders.MMBoxViewHeadersL().SetMmsMessageCount(KMaxTUint32);
+                    lex.Assign(iValueBuffer);
+                    error = lex.Val(val,radix,limit);
+                    if ( val > allLimit )
+                        {
+                        val = KMaxTUint32; // this is too hard to type, more than 999999 means "all"
+                        }
+                    if (error == KErrNone)
+                        {
+                        aMmsHeaders.MMBoxViewHeadersL().SetMmsMessageCount(val);
+                        }
+                    break;
+                case ETestAddKeyword:
+                    aMmsHeaders.MMBoxMessageHeadersL().AppendKeywordItemL(KMmsAddToken, iValueBuffer);
+                    break;
+                case ETestRemoveKeyword:
+                    aMmsHeaders.MMBoxMessageHeadersL().AppendKeywordItemL(KMmsRemoveToken, iValueBuffer);
+                    break;
+                case ETestFilterKeyword:
+                    aMmsHeaders.MMBoxMessageHeadersL().AppendKeywordItemL(KMmsFilterToken, iValueBuffer);
+                    break;
+                case ETestMMState:
+                    val = 0;
+                    if ((iValueBuffer.CompareF(KDraft)) == 0)
+                        {
+                        val = KMmsDraft;
+                        }
+                    else if ((iValueBuffer.CompareF(KSent)) == 0)
+                        {
+                        val = KMmsSent;
+                        }
+                    else if ((iValueBuffer.CompareF(KNew)) == 0)
+                        {
+                        val = KMmsNew;
+                        }
+                    else if ((iValueBuffer.CompareF(KRetrieved)) == 0)
+                        {
+                        val = KMmsRetrieved;
+                        }
+                    else if ((iValueBuffer.CompareF(KForwarded)) == 0)
+                        {
+                        val = KMmsForwarded;
+                        }
+                    else
+                        {
+                        val = KMmsTestIllegalValue;
+                        }
+                    if ( aMmsHeaders.MessageType() == KMmsMessageTypeMboxViewReq ||
+                        aMmsHeaders.MessageType() == KMmsMessageTypeMboxViewConf )
+                        {
+                        aMmsHeaders.MMBoxViewHeadersL().MMStateArray().InsertInOrder( val );
+                        }
+                    else
+                        {
+                        aMmsHeaders.MMBoxMessageHeadersL().SetMMState( val );
+                        }
+                    break;
+                case ETestQuota:
+                    val = 0;
+                    if ((iValueBuffer.CompareF(KYes)) == 0)
+                        {
+                        val = KMmsYes;
+                        }
+                    else if ((iValueBuffer.CompareF(KNo)) == 0)
+                        {
+                        val = KMmsNo;
+                        }
+                    else
+                        {
+                        val = KMmsTestIllegalValue;
+                        }
+                    aMmsHeaders.MMBoxViewHeadersL().SetMmsQuotas( val );
+                    break;
+                case ETestStart:
+                    lex.Assign(iValueBuffer);
+                    error = lex.Val(val,radix,limit);
+                    if (error == KErrNone)
+                        {
+                        aMmsHeaders.MMBoxViewHeadersL().SetMmsStart(val);
+                        }
+                    break;
+                case ETestStore:
+                    val = 0;
+                    if ((iValueBuffer.CompareF(KYes)) == 0)
+                        {
+                        val = KMmsYes;
+                        }
+                    else if ((iValueBuffer.CompareF(KNo)) == 0)
+                        {
+                        val = KMmsNo;
+                        }
+                    else
+                        {
+                        val = KMmsTestIllegalValue;
+                        }
+                    aMmsHeaders.MMBoxMessageHeadersL().SetMmsStore( val );
+                    break;
+                case ETestStored:
+                    val = 0;
+                    if ((iValueBuffer.CompareF(KYes)) == 0)
+                        {
+                        val = KMmsYes;
+                        }
+                    else if ((iValueBuffer.CompareF(KNo)) == 0)
+                        {
+                        val = KMmsNo;
+                        }
+                    else
+                        {
+                        val = KMmsTestIllegalValue;
+                        }
+                    aMmsHeaders.MMBoxMessageHeadersL().SetMmsStored( val );
+                    break;
+                case ETestStoreStatus:
+                    val = 0;
+                    if ((iValueBuffer.CompareF(KOk)) == 0)
+                        {
+                        val = KMmsStatusOk;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrTransient)) == 0)
+                        {
+                        val = KMmsErrorTransientFailure;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrTransientNetworkproblem)) == 0)
+                        {
+                        val = KMmsErrorStoreStatusTransientNetworkProblem;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrPermanent)) == 0)
+                        {
+                        val = KMmsErrorPermanentFailure;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrPermanentServiceDenied)) == 0)
+                        {
+                        val = KMmsErrorPermanentServiceDenied;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrPermanentMessageFormatCorrupt)) == 0)
+                        {
+                        val = KMmsErrorPermanentMessageFormatCorrupt;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrPermanentNotFound)) == 0)
+                        {
+                        val = KMmsErrorStoreStatusPermanentMessageNotFound;
+                        }
+                    else if ((iValueBuffer.CompareF(KErrMMBoxFull)) == 0)
+                        {
+                        val = KMmsErrorStoreStatusPermanentMmboxFull;
+                        }
+                    else
+                        {
+                        val = KMmsTestIllegalValue;
+                        }
+                    aMmsHeaders.MMBoxMessageHeadersL().SetMmsStoreStatus( val );
+                    break;
+                case ETestStoreStatusText:
+                    aMmsHeaders.MMBoxMessageHeadersL().SetMmsStoreStatusTextL( iValueBuffer );
+                    break;
+                case ETestTotals:
+                    val = 0;
+                    if ((iValueBuffer.CompareF(KYes)) == 0)
+                        {
+                        val = KMmsYes;
+                        }
+                    else if ((iValueBuffer.CompareF(KNo)) == 0)
+                        {
+                        val = KMmsNo;
+                        }
+                    else
+                        {
+                        val = KMmsTestIllegalValue;
+                        }
+                    aMmsHeaders.MMBoxViewHeadersL().SetMmsTotals( val );
+                    break;
+
+                case ETestDeleteInfoIndex:
+                    lex.Assign(iValueBuffer);
+                    error = lex.Val(val,radix,limit);
+                    order = val;
+                    break;
+
+                case ETestApplicId:
+                    aMmsHeaders.SetApplicIdL( iValueBuffer );
+                    break;
+                case ETestReplyApplicId:
+                    aMmsHeaders.SetReplyApplicIdL( iValueBuffer );
+                    break;
+                case ETestApplicInfo:
+                    iByteBuffer->Des().Copy( iValueBuffer );
+                    aMmsHeaders.SetAuxApplicInfoL( iByteBuffer->Des() );
+                    break;
+                case ETestContentClass:
+                    val = 0;
+                    if ((iValueBuffer.CompareF(KText)) == 0)
+                        {
+                        val = KMmsContentClassText;
+                        }
+                    else if ((iValueBuffer.CompareF(KImageBasic)) == 0)
+                        {
+                        val = KMmsContentClassImageBasic;
+                        }
+                    else if ((iValueBuffer.CompareF(KImageRich)) == 0)
+                        {
+                        val = KMmsContentClassImageRich;
+                        }
+                    else if ((iValueBuffer.CompareF(KVideoBasic)) == 0)
+                        {
+                        val = KMmsContentClassVideoBasic;
+                        }
+                    else if ((iValueBuffer.CompareF(KVideoRich)) == 0)
+                        {
+                        val = KMmsContentClassVideoRich;
+                        }
+                    else if ((iValueBuffer.CompareF(KMegaPixel)) == 0)
+                        {
+                        val = KMmsContentClassMegaPixel;
+                        }
+                    else if ((iValueBuffer.CompareF(KContentBasic)) == 0)
+                        {
+                        val = KMmsContentClassContentBasic;
+                        }
+                    else if ((iValueBuffer.CompareF(KContentRich)) == 0)
+                        {
+                        val = KMmsContentClassContentRich;
+                        }
+                    else
+                        {
+                        val = KMmsTestIllegalValue;
+                        }
+                    aMmsHeaders.SetContentClass( val );
+                    break;
+                case ETestDrmContent:
+                    val = 0;
+                    if ((iValueBuffer.CompareF(KYes)) == 0)
+                        {
+                        val = KMmsYes;
+                        }
+                    else if ((iValueBuffer.CompareF(KNo)) == 0)
+                        {
+                        val = KMmsNo;
+                        }
+                    else
+                        {
+                        val = KMmsTestIllegalValue;
+                        }
+                    aMmsHeaders.SetDrmContent( val );
+                    break;
+                case ETestAdaptationAllowed:
+                    val = 0;
+                    if ((iValueBuffer.CompareF(KYes)) == 0)
+                        {
+                        val = KMmsYes;
+                        }
+                    else if ((iValueBuffer.CompareF(KNo)) == 0)
+                        {
+                        val = KMmsNo;
+                        }
+                    else
+                        {
+                        val = KMmsTestIllegalValue;
+                        }
+                    aMmsHeaders.SetAdaptationAllowed( val );
+                    break;
+                case ETestRecommendedRetrievalMode:
+                    val = 0;
+                    if ((iValueBuffer.CompareF(KManual)) == 0)
+                        {
+                        val = KMmsRecommendedRetrievalModeManual;
+                        }
+                    else
+                        {
+                        val = KMmsTestIllegalValue;
+                        }
+                    aMmsHeaders.SetRecommendedRetrievalMode( val );
+                    break;
+                case ETestRecRetrievalModeText:
+                    aMmsHeaders.SetRecommendedRetrievalModeTextL( iValueBuffer );
+                    break;
+                case ETestReplaceId:
+                    iByteBuffer->Des().Copy( iValueBuffer );
+                    aMmsHeaders.SetReplaceCancelIdL( iByteBuffer->Des() );
+                    break;
+                case ETestStatusText:
+                    aMmsHeaders.SetResponseTextL( iValueBuffer );
+                    break;
+                case ETestCancelId:
+                    iByteBuffer->Des().Copy( iValueBuffer );
+                    aMmsHeaders.SetReplaceCancelIdL( iByteBuffer->Des() );
+                    break;
+                case ETestCancelStatus:
+                    val = 0;
+                    if ((iValueBuffer.CompareF(KCancelSuccessful)) == 0)
+                        {
+                        val = KMmsCancelRequestSuccessfullyReceived;
+                        }
+                    else if ((iValueBuffer.CompareF(KCancelCorrupted)) == 0)
+                        {
+                        val = KMmsCancelRequestCorrupted;
+                        }
+                    else
+                        {
+                        val = KMmsTestIllegalValue;
+                        }
+                    aMmsHeaders.SetCancelStatus( val );
+                    break;
+                default:
+                    break;
+                }
+            }
+            else
+            {
+            switch(readStatus)
+                {
+                case ETestAlias:
+                    iAliasArray->AppendL( iValueBuffer );
+                    iAliasCount++;
+				    break;
+
+                default:
+                    break;
+                }
+
+            }
+        }
+    return(-1);
+}
+
+// ---------------------------------------------------------
+// CMmsReadFile()::ReadRowL
+// ---------------------------------------------------------
+//
+TTestReadStatus CMmsReadFile::ReadRowL()
+    {
+
+        TBuf8<DefaultBufLen> RowBuffer;
+        TBuf8<32> KeyBuffer;
+
+        // READ ONE ROW AND DROP CR+LF FROM THE END OF LINE
+        TChar delim( 10 );
+        iReader->ReadL( RowBuffer, delim);
+        TInt length = RowBuffer.Length();
+        if ( RowBuffer.Length() < 2 )
+            {
+            return ETestEof;
+            }
+        RowBuffer.Delete(length - 2,2);
+
+        // DROP POSSIBLE COMMENT OUT
+        TInt pos = RowBuffer.Locate( ';' );
+		if ( pos >= 0 ) RowBuffer.Delete( pos, length-pos-2 );
+
+        if ( RowBuffer.Length() == 0 )
+            {
+            // the line contained only comment
+            return ETestUnknown;
+            }
+
+        // First split the row (:)
+        pos = RowBuffer.Locate( ':' );
+        if (pos > 0)
+        {
+            TPtrC8 p = RowBuffer.Mid( pos+1 );
+            length = p.Length();
+            iValueBuffer.Zero();
+            for (TInt i=0; i < length; ++i)
+                {
+                iValueBuffer.Append(p[i]);
+                }
+            iValueBuffer.Trim();
+            TPtrC8 pp = RowBuffer.Left(pos);
+            KeyBuffer.CopyUC(pp);
+            KeyBuffer.Trim();
+        }
+        // TRY TO FIND CORRECT TAG
+        if ((KeyBuffer.CompareF(KTestNewMessage)) == 0) return(ETestNewMessage);
+        if ((KeyBuffer.CompareF(KTestMessageType)) == 0) return ETestMessageType;
+        if ((KeyBuffer.CompareF(KTestDate)) == 0) return ETestDate;
+        if ((KeyBuffer.CompareF(KTestFrom)) == 0) return ETestFrom;
+        if ((KeyBuffer.CompareF(KTestTo)) == 0) return ETestTo;
+        if ((KeyBuffer.CompareF(KTestCc)) == 0) return ETestCc;
+        if ((KeyBuffer.CompareF(KTestBcc)) == 0) return ETestBcc;
+        if ((KeyBuffer.CompareF(KTestSubject)) == 0) return ETestSubject;
+        if ((KeyBuffer.CompareF(KTestExpiryRel)) == 0) return ETestExpiryRel;
+        if ((KeyBuffer.CompareF(KTestExpiryAbs)) == 0) return ETestExpiryAbs;
+        if ((KeyBuffer.CompareF(KTestDeliveryTimeRel)) == 0) return ETestDeliveryTimeRel;
+        if ((KeyBuffer.CompareF(KTestDeliveryTimeAbs)) == 0) return ETestDeliveryTimeAbs;
+        if ((KeyBuffer.CompareF(KTestPriority)) == 0) return ETestPriority;
+        if ((KeyBuffer.CompareF(KTestSenderVisibility)) == 0) return ETestSenderVisibility;
+        if ((KeyBuffer.CompareF(KTestDeliveryReport)) == 0) return ETestDeliveryReport;
+        if ((KeyBuffer.CompareF(KTestReadReply)) == 0) return ETestReadReply;
+        if ((KeyBuffer.CompareF(KTestNewAttachment)) == 0) return ETestNewAttachment;
+        if ((KeyBuffer.CompareF(KTestAttachmentName)) == 0) return ETestAttaRecommendedName;
+        if ((KeyBuffer.CompareF(KTestAttachmentContLoc)) == 0) return ETestAttachmentContLoc;
+        if ((KeyBuffer.CompareF(KTestAttachmentType)) == 0) return ETestAttachmentType;
+        if ((KeyBuffer.CompareF(KTestAttachmentCharset)) == 0) return ETestAttachmentCharset;
+        if ((KeyBuffer.CompareF(KTestAttachmentCid)) == 0) return ETestAttachmentCid;
+        if ((KeyBuffer.CompareF(KTestAttachmentRoot)) == 0) return ETestAttachmentRoot;
+        if ((KeyBuffer.CompareF(KTestEndOfFile)) == 0) return ETestEof;
+        if ((KeyBuffer.CompareF(KTestMessageClass)) == 0) return ETestMessageClass;
+        if ((KeyBuffer.CompareF(KTestDelivRepSendAllow)) == 0) return ETestDelivReportSendAllow;
+        if ((KeyBuffer.CompareF(KTestAlias)) == 0 ) return ETestAlias;
+        if ((KeyBuffer.CompareF(KTestFromAlias)) == 0 ) return ETestFromAlias;
+        if ((KeyBuffer.CompareF(KTestToAlias)) == 0 ) return ETestToAlias;
+        if ((KeyBuffer.CompareF(KTestCcAlias)) == 0 ) return ETestCcAlias;
+        if ((KeyBuffer.CompareF(KTestBccAlias)) == 0 ) return ETestBccAlias;
+        if ((KeyBuffer.CompareF(KTestReplyCharging)) == 0 ) return ETestReplyCharging;
+        if ((KeyBuffer.CompareF(KTestReplyChargAbs)) == 0 ) return ETestReplyChargAbs;
+        if ((KeyBuffer.CompareF(KTestReplyChargRel)) == 0 ) return ETestReplyChargRel;
+        if ((KeyBuffer.CompareF(KTestReplyChargSize)) == 0 ) return ETestReplyChargSize;
+        if ((KeyBuffer.CompareF(KTestReplyChargID)) == 0 ) return ETestReplyChargID;
+        if ((KeyBuffer.CompareF(KTestTID)) == 0 ) return ETestTID;
+        if ((KeyBuffer.CompareF(KTestContentLocation)) == 0 ) return ETestContentLocation;
+        if ((KeyBuffer.CompareF(KTestPreviouslySentIndex)) == 0 ) return ETestPreviouslySentIndex;
+        if ((KeyBuffer.CompareF(KTestPreviouslySentBy)) == 0 ) return ETestPreviouslySentBy;
+        if ((KeyBuffer.CompareF(KTestPreviouslySentDate)) == 0 ) return ETestPreviouslySentDate;
+        if ((KeyBuffer.CompareF(KTestMessageId)) == 0 ) return ETestMessageId;
+        if ((KeyBuffer.CompareF(KTestMessageSize)) == 0 ) return ETestMessageSize;
+        if ((KeyBuffer.CompareF(KTestVersion)) == 0 ) return ETestVersion;
+        if ((KeyBuffer.CompareF(KTestReadStatus)) == 0 ) return ETestReadStatus;
+        if ((KeyBuffer.CompareF(KTestResponseStatus)) == 0 ) return ETestResponseStatus;
+        if ((KeyBuffer.CompareF(KTestResponseText)) == 0 ) return ETestResponseText;
+        if ((KeyBuffer.CompareF(KTestRetrieveStatus)) == 0 ) return ETestRetrieveStatus;
+        if ((KeyBuffer.CompareF(KTestRetrieveText)) == 0 ) return ETestRetrieveText;
+        if ((KeyBuffer.CompareF(KTestStatus)) == 0 ) return ETestStatus;
+        if ((KeyBuffer.CompareF(KTestAttribute)) == 0 ) return ETestAttribute;
+        if ((KeyBuffer.CompareF(KTestDistributionIndicator)) == 0 ) return ETestDistributionIndicator;
+        if ((KeyBuffer.CompareF(KTestLimit)) == 0 ) return ETestLimit;
+        if ((KeyBuffer.CompareF(KTestMessageQuota)) == 0 ) return ETestMessageQuota;
+        if ((KeyBuffer.CompareF(KTestSizeQuota)) == 0 ) return ETestSizeQuota;
+        if ((KeyBuffer.CompareF(KTestMessageTotal)) == 0 ) return ETestMessageTotal;
+        if ((KeyBuffer.CompareF(KTestSizeTotal)) == 0 ) return ETestSizeTotal;
+        if ((KeyBuffer.CompareF(KTestMessageCount)) == 0 ) return ETestMessageCount;
+        if ((KeyBuffer.CompareF(KTestAddKeyword)) == 0 ) return ETestAddKeyword;
+        if ((KeyBuffer.CompareF(KTestRemoveKeyword)) == 0 ) return ETestRemoveKeyword;
+        if ((KeyBuffer.CompareF(KTestFilterKeyword)) == 0 ) return ETestFilterKeyword;
+        if ((KeyBuffer.CompareF(KTestMMState)) == 0 ) return ETestMMState;
+        if ((KeyBuffer.CompareF(KTestQuota)) == 0 ) return ETestQuota;
+        if ((KeyBuffer.CompareF(KTestStart)) == 0 ) return ETestStart;
+        if ((KeyBuffer.CompareF(KTestStore)) == 0 ) return ETestStore;
+        if ((KeyBuffer.CompareF(KTestStored)) == 0 ) return ETestStored;
+        if ((KeyBuffer.CompareF(KTestStoreStatus)) == 0 ) return ETestStoreStatus;
+        if ((KeyBuffer.CompareF(KTestStoreStatusText)) == 0 ) return ETestStoreStatusText;
+        if ((KeyBuffer.CompareF(KTestTotals)) == 0 ) return ETestTotals;
+        if ((KeyBuffer.CompareF(KTestDeleteInfoIndex)) == 0 ) return ETestDeleteInfoIndex;
+        if ((KeyBuffer.CompareF(KTestApplicId)) == 0 ) return ETestApplicId;
+        if ((KeyBuffer.CompareF(KTestReplyApplicId)) == 0 ) return ETestReplyApplicId;
+        if ((KeyBuffer.CompareF(KTestApplicInfo)) == 0 ) return ETestApplicInfo;
+        if ((KeyBuffer.CompareF(KTestContentClass)) == 0 ) return ETestContentClass;
+        if ((KeyBuffer.CompareF(KTestDrmContent)) == 0 ) return ETestDrmContent;
+        if ((KeyBuffer.CompareF(KTestAdaptationAllowed)) == 0 ) return ETestAdaptationAllowed;
+        if ((KeyBuffer.CompareF(KTestRecommendedRetrievalMode)) == 0 ) return ETestRecommendedRetrievalMode;
+        if ((KeyBuffer.CompareF(KTestRecRetrievalModeText)) == 0 ) return ETestRecRetrievalModeText;
+        if ((KeyBuffer.CompareF(KTestReplaceId)) == 0 ) return ETestReplaceId;
+        if ((KeyBuffer.CompareF(KTestStatusText)) == 0 ) return ETestStatusText;
+        if ((KeyBuffer.CompareF(KTestCancelId)) == 0 ) return ETestCancelId;
+        if ((KeyBuffer.CompareF(KTestCancelStatus)) == 0 ) return ETestCancelStatus;
+        if ((KeyBuffer.CompareF(KTestAttContTypeParamName)) == 0 ) return ETestAttContTypeParamName;
+        if ((KeyBuffer.CompareF(KTestAttContTypeParamValue)) == 0 ) return ETestAttContTypeParamValue;
+        if ((KeyBuffer.CompareF(KTestAttXTypeParamName)) == 0 ) return ETestAttXTypeParamName;
+        if ((KeyBuffer.CompareF(KTestAttXTypeParamValue)) == 0 ) return ETestAttXTypeParamValue;
+        return ETestUnknown;
+    }
+
+// ---------------------------------------------------------
+// CMmsReadFile()::CreateMessageL
+// program build a message from given parts
+// ---------------------------------------------------------
+//
+void CMmsReadFile::CreateMessageL( CMmsClientMtm* aMmsClient, CMmsHeaders* aMmsHeaders )
+    {
+
+    // Reset inactivity timer to keem viewServer from crashing
+    User::ResetInactivityTime();
+
+    TInt      i;
+    TInt error = KErrNone;
+    RFile attaFile;
+    _LIT8(KLeftAngle, "<");
+    _LIT8(KRightAngle, ">");
+    // we can't use "seconds from" as it only returns a
+    // 32 bit signed integer. If fails in 2038.
+    // "microseconds from" returns a 64 bit signed integer
+
+    CMsvStore* store = aMmsClient->Entry().EditStoreL();
+    CleanupStack::PushL(store);
+    aMmsHeaders->StoreL(*store);
+    store->CommitL();
+    CleanupStack::PopAndDestroy( store );
+    store = NULL;
+
+    aMmsClient->LoadMessageL(); // read store is needed to do this
+
+    store = aMmsClient->Entry().EditStoreL();
+    CleanupStack::PushL(store);
+    CMsvAttachment* attaInfo = NULL;
+    TMsvAttachmentId attaId = 0;
+
+    for ( i=0; i < iAttaStructures->Count(); ++i)
+        {
+        attaId = KMsvNullIndexEntryId;
+        iFilename.Copy(iAttaStructures->At(i)->iAtta->Des());
+
+        error = attaFile.Open( iFs, iFilename, EFileShareReadersOnly | EFileRead );
+        User::LeaveIfError( error );
+
+		CleanupClosePushL(attaFile);
+
+		CMsvMimeHeaders* mimeHeaders = CMsvMimeHeaders::NewL();
+		CleanupStack::PushL( mimeHeaders );
+		TPtrC8 contentType = iAttaStructures->At(i)->iAttaType->Des();
+
+        TDataRecognitionResult result;
+        result.Reset(); // make sure that it is cleared
+
+        if(iAttaStructures->At(i)->iAttaCid->Length())
+            {
+            TPtr8 attaCID = iAttaStructures->At(i)->iAttaCid->Des();
+            if (attaCID.Find(KLeftAngle) == 0 &&
+                attaCID.Find(KRightAngle) == attaCID.Length()-1 )
+                {
+                // remove angle brackets from cid
+                attaCID = attaCID.Mid(1,attaCID.Length()-2);
+                }
+            mimeHeaders->SetContentIdL(attaCID);
+            }
+
+        if (iAttaStructures->At(i)->iAttaCharset)
+            {
+            mimeHeaders->SetMimeCharset(iAttaStructures->At(i)->iAttaCharset);
+            }
+
+        if (iAttaStructures->At(i)->iAttaName->Length())
+            {
+            iFilename.Copy(iAttaStructures->At(i)->iAttaName->Des());
+            }
+        iParse.Set( iFilename, NULL, NULL );
+        iFilename.Copy( iParse.NameAndExt() );
+
+        mimeHeaders->SetContentLocationL( iFilename );
+
+		// if Mime type has not been set, use RapaRecognizer
+		if ( iAttaStructures->At(i)->iAttaType->Length() == 0 && iFilename.Length() > 0)
+		    {
+		    // TO BE IMPLEMENTED
+
+            RApaLsSession lsSession;
+
+            if ( lsSession.Connect() == KErrNone )
+                {
+                CleanupClosePushL( lsSession );
+
+                iFilename.Copy(iAttaStructures->At(i)->iAtta->Des());
+                if ( lsSession.RecognizeData( iFilename, TPtrC8(), result ) == KErrNone )
+                    {
+                    // Check confidence level. Recognization must be at least
+                    // "EProbable". We don't accept the result if it is "EPossible"
+                    // or "EUnlikely" or "ENotRecognized"!
+
+                    if ( result.iConfidence < CApaDataRecognizerType::EProbable )
+                        {
+                        result.Reset(); // clear buffer and try again with longer buffer
+                        }
+
+                    TPtrC8 mimeBuf8 = result.iDataType.Des8();
+
+                    if ( mimeBuf8.Length() == 0 )
+                        {
+                        // Open file buffer and try again..
+
+                        TInt bufSize = 0;
+                        (void)lsSession.GetMaxDataBufSize( bufSize ); // ignore errors
+                        if ( bufSize <= 0 )
+                            {
+                            bufSize = 30;
+                            }
+                        HBufC8* buf = HBufC8::NewLC( bufSize );
+                        TPtr8 des = buf->Des();
+
+                        RFile file;
+                        TInt err=file.Open( iFs, iFilename, EFileShareReadersOnly );
+                        if ( err == KErrNone )
+                            {
+                            err = file.Read( des );
+                            file.Close();
+                            if ( err == KErrNone )
+                                {
+                                if ( ( lsSession.RecognizeData( iFilename, des, result ) ) == KErrNone )
+                                    {
+                                    mimeBuf8.Set( result.iDataType.Des8() );
+                                    }
+                                }
+
+                            }
+                        CleanupStack::PopAndDestroy(); // buf
+                        }
+                    if ( mimeBuf8.Length() > 0 &&
+                        result.iConfidence >= CApaDataRecognizerType::EProbable )
+                        {
+                        contentType.Set( result.iDataType.Des8() );
+                        }
+                    }
+                CleanupStack::PopAndDestroy(1); // lssession
+                }
+		    }
+
+        if ( contentType.Length() > 0 )
+            {
+            TInt position = contentType.Find( KMmsSlash8 );
+            if ( position >= 0 )
+                {
+                mimeHeaders->SetContentTypeL( contentType.Left( position ) );
+                }
+            if ( position < contentType.Length() - 1 )
+                {
+                mimeHeaders->SetContentSubTypeL( contentType.Mid( position + 1 ) );
+                }
+//          CreateAttachment2L sets the content type to attaInfo
+//            attaInfo->SetMimeTypeL( contentType );
+            }
+
+        if (iAttaStructures->At(i)->iAttaRecommendedName->Length())
+            {
+            iFilename.Copy(iAttaStructures->At(i)->iAttaRecommendedName->Des());
+            iParse.Set( iFilename, NULL, NULL );
+            iFilename.Copy( iParse.NameAndExt() );
+            mimeHeaders->SetSuggestedFilenameL( iFilename );
+            }
+
+        TInt j = 0;
+        for ( j = 0; j < iAttaStructures->At(i)->iContentTypeParams->MdcaCount(); ++j )
+            {
+            mimeHeaders->ContentTypeParams().AppendL( iAttaStructures->At(i)->iContentTypeParams->MdcaPoint( j ) );
+            }
+        for ( j = 0; j < iAttaStructures->At(i)->iXTypeParams->MdcaCount(); ++j )
+            {
+            mimeHeaders->XTypeParams().AppendL( iAttaStructures->At(i)->iXTypeParams->MdcaPoint( j ) );
+            }
+
+        attaInfo = CMsvAttachment::NewL(CMsvAttachment::EMsvFile);
+        // attaInfo does not go onto cleaunpstack because ownership will
+        // be transferred to attachment manager.
+
+        aMmsClient->CreateAttachment2L(
+            *store,
+            attaFile,
+            contentType,
+            *mimeHeaders,
+            attaInfo,
+            attaId);
+        attaInfo = NULL; // ownership transferred
+
+        CleanupStack::PopAndDestroy(); // mimeHeaders
+        CleanupStack::PopAndDestroy(); // attaFile.Close()
+
+        if ( iAttaRoot > 0 && iAttaRoot == ( i + 1 ) )
+            {
+            aMmsClient->SetMessageRootL( attaId );
+            }
+        }
+
+    store->CommitL();
+    CleanupStack::PopAndDestroy(); // store
+
+    // This frees all memory and resets all values
+    Reset();
+    // Reset inactivity timer to keem viewServer from crashing
+    User::ResetInactivityTime();
+    }
+
+
+// ---------------------------------------------------------
+// CMmsReadFile()::FindAlias
+// program build a message from given parts
+// ---------------------------------------------------------
+//
+TInt CMmsReadFile::FindAlias( TPtrC aAlias )
+    {
+	TBuf<DefaultBufLen> abuf;
+	for( TInt i=0; i < iAliasCount; ++i )
+	    {
+		abuf.Copy( iAliasArray->MdcaPoint(i) );
+		abuf.SetLength( abuf.Locate('=') );
+		if( ( abuf.CompareF( aAlias ) ) == 0 ) return( i );
+	    }
+	return( -1 );
+    }
+
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CMmsAttaStructure::CMmsAttaStructure()
+    {
+    iAtta = NULL;
+    iAttaType = NULL;
+    iAttaName = NULL;
+    iAttaCid = NULL;
+    iAttaRecommendedName = NULL;
+    }
+
+
+//
+void CMmsAttaStructure::ConstructL()
+    {
+    iAtta = HBufC8::NewL(DefaultBufLen);
+    iAttaType = HBufC8::NewL(DefaultBufLen);
+    iAttaName = HBufC8::NewL(DefaultBufLen);
+    iAttaCid = HBufC8::NewL(DefaultBufLen);
+    iAttaRecommendedName = HBufC::NewL(DefaultBufLen);
+    iAttaCharset = 0;
+   	iXTypeParams  = new(ELeave) CDesC8ArrayFlat(4);
+   	iContentTypeParams  = new(ELeave) CDesC8ArrayFlat(4);
+
+    }
+
+// Two-phased constructor.
+CMmsAttaStructure* CMmsAttaStructure::NewL()
+    {
+    CMmsAttaStructure* self = new ( ELeave ) CMmsAttaStructure;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+// Destructor
+CMmsAttaStructure::~CMmsAttaStructure()
+    {
+    delete iAtta;
+    delete iAttaName;
+    delete iAttaType;
+    delete iAttaCid;
+    delete iAttaRecommendedName;
+    if ( iContentTypeParams )
+        {
+    	iContentTypeParams->Reset();
+        }
+  	delete iContentTypeParams;
+    if ( iXTypeParams )
+        {
+      	iXTypeParams->Reset();
+        }
+	delete iXTypeParams;
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/msguiutils/tsrc/unittest_msguiutils/mmstestbed/src/mmstestbed.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,2357 @@
+/*
+ * 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 <mtmdef.h>
+#include <CoreApplicationUIsSDKCRKeys.h>
+#include <mmsheaders.h>
+#include <mmscmds.h>
+#include <mmsencode.h>
+#include <mmscliententry.h>
+#include <logwrap.h>
+#include <logcli.h>
+#include <logview.h>
+#include "mmssettings.h"  //use mmssettings.h instead of cmmssettings.h
+#include "mmstestbed.h"
+#include "mmsreadfile.h"
+#include "mmstestuitimer.h"
+#include "mmsteststaticutils.h"
+#include "mmstestbed.hrh"
+
+//constants
+_LIT( KMmsSender, "0601234567" );
+
+MmsTestBed::MmsTestBed()
+    {
+    //start the timer
+    iTimer = CTestUiTimer::NewL();
+    iTimer->Cancel();
+
+    iWait = CMsvOperationActiveSchedulerWait::NewLC();
+    // don't leave iWait on cleanup stack
+    CleanupStack::Pop();
+
+    //open msvsession
+    iSession = CMsvSession::OpenSyncL(*this);
+    //create client registry
+    iClientMtmRegistry = CClientMtmRegistry::NewL(*iSession);
+    //create client mtm
+    iMmsClient = (CMmsClientMtm *) iClientMtmRegistry->NewMtmL(
+            KUidMsgTypeMultimedia);
+
+    User::LeaveIfError( iFs.Connect() );
+    iFs.SetSessionPath( KRootPath );
+    iSettings = CMmsSettings::NewL();
+    iMmsHeaders = CMmsHeaders::NewL(iSettings->MmsVersion());
+    findDefaultL();
+    iServiceId = iDefaultServiceId;
+
+    //validate the settings
+    iSettings->ValidateSettings();
+
+    iLogEvent = CLogEvent::NewL();
+    iLogEvent->SetEventType(KLogMmsEventTypeUid);
+    iLogClient = NULL; // we test soon if this is available
+    iLogView = NULL; // needs log client
+    if ( checkLogClient() )
+        {
+        // first we generate a general view of all events
+        // we'll set the filter when we update the view
+        iLogView = CLogViewEvent::NewL( *iLogClient );
+        }
+    iLogFilter = CLogFilter::NewL();
+    // we try to filter MMS events
+    iLogFilter->SetEventType(KLogMmsEventTypeUid);
+    }
+
+MmsTestBed::~MmsTestBed()
+    {
+    delete iLogView;
+    delete iLogFilter;
+    delete iLogClient;
+    delete iLogEvent;
+    delete iSettings;
+    delete iMmsHeaders;
+    if(iTimer)
+    {
+        iTimer->Cancel();
+        delete iTimer;
+    }
+    //delete iMsvEntrySelection;
+    delete iMmsClient;
+    delete iClientMtmRegistry;
+//    delete iClientMtmRegistry;
+    delete iSession;
+    delete iWait;
+    }
+
+void MmsTestBed::setConnectionLocal(bool value)
+    {
+    //value = true for global off, local on
+    //value = false for global on, local off
+    iSettings->LoadSettingsL();
+    iSettings->SetLocalMode( value );
+    iSettings->SaveSettingsL();
+    }
+
+void MmsTestBed::fromOutboxToMmsc()
+    {
+    CMsvEntry* cEntry = NULL;
+
+    // Get List of services
+    cEntry = iSession->GetEntryL(KMsvGlobalOutBoxIndexEntryIdValue);
+    CleanupStack::PushL(cEntry);
+    // Get all mms messages of outbox
+    CMsvEntrySelection* selection = cEntry->ChildrenWithMtmL(
+            KUidMsgTypeMultimedia);
+    CleanupStack::PushL(selection);
+
+    // Change state to "KMsvSendStateUnknown" in case the entry has been suspended earlier
+    for (TInt i = 0; i < selection->Count(); ++i)
+        {
+        cEntry->SetEntryL(selection->At(i));
+        TMsvEntry entry = cEntry->Entry();
+        entry.SetReadOnly(EFalse);
+        entry.SetSendingState(KMsvSendStateUnknown);
+        cEntry->ChangeL(entry);
+        }
+
+    selection->InsertL(0, iServiceId);
+
+    CMsvOperation * op = NULL;
+    TCommandParameters parameters; // initialized to zero
+    TCommandParametersBuf paramPack(parameters);
+
+    op = iSession->TransferCommandL(*selection, EMmsSend, paramPack,
+            iWait->iStatus);
+
+    CleanupStack::PushL(op);
+    iWait->Start();
+
+    while (iWait->iStatus.Int() == KRequestPending)
+        {
+        if (!iTimer->IsActive())
+            {
+            iTimer->IssueRequest();
+            }
+        CActiveScheduler::Start();
+        }
+
+    if (iWait->iStatus.Int() != KErrNone)
+        {
+        //DEBUG(_L("Testbed tried to send, return status %d"), iWait->iStatus.Int());
+        }
+
+    iTimer->Cancel();
+
+    CleanupStack::PopAndDestroy(); // op
+    CleanupStack::PopAndDestroy(); // selection
+    CleanupStack::PopAndDestroy(); //cEntry
+    }
+
+void MmsTestBed::fromMmscToInbox()
+    {
+    CMsvEntrySelection* msvEntrySelection = new CMsvEntrySelection;
+    CleanupStack::PushL(msvEntrySelection);
+
+    // if we have a selected service, insert it into selection
+    if (iServiceId != KMsvNullIndexEntryId)
+        {
+        msvEntrySelection->InsertL(0, iServiceId);
+        }
+
+    CMsvOperation * op = NULL;
+    TCommandParameters parameters; // initialized to zero
+    TCommandParametersBuf paramPack(parameters);
+
+    op = iMmsClient->InvokeAsyncFunctionL(EMmsReceive, *msvEntrySelection,
+            paramPack, iWait->iStatus);
+
+    CleanupStack::PushL(op);
+    iWait->Start();
+
+    while (iWait->iStatus.Int() == KRequestPending)
+        {
+        if (!iTimer->IsActive())
+            {
+            iTimer->IssueRequest();
+            }
+        CActiveScheduler::Start();
+        }
+
+    if (iWait->iStatus.Int() != KErrNone)
+        {
+        //DEBUG(_L("Testbed tried to receive, return status %d"),iWait->iStatus.Int());
+        }
+
+    iTimer->Cancel();
+    CleanupStack::PopAndDestroy(); // op
+    CleanupStack::PopAndDestroy(); //msvEntrySelection
+    }
+
+void MmsTestBed::findDefaultL()
+    {
+    iSettings->LoadSettingsL();
+    iDefaultServiceId = iSettings->Service();
+    }
+
+void MmsTestBed::HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1,
+        TAny* aArg2, TAny* /*aArg3*/)
+    {
+    iEvent = aEvent;
+    if (aEvent == EMsvGeneralError)
+        {
+        return;
+        }
+    TMsvId parentId = KMsvNullIndexEntryId;
+    if (aArg2 != NULL)
+        {
+        parentId = *(TMsvId*) aArg2;
+        }
+
+    CMsvEntrySelection* selection = (CMsvEntrySelection*) aArg1;
+    TMsvEntry tEntry;
+    TMsvId service;
+    TInt error = KErrNone;
+    error = iSession->GetEntry(selection->At(0), service, tEntry);
+
+    CMsvEntry* cEntry = NULL;
+    switch (aEvent)
+        {
+        case EMsvEntriesCreated:
+            {
+            if (parentId == KMsvGlobalInBoxIndexEntryIdValue)
+                {
+                // emit signal for new entry into INBOX
+                emit entryCreatedInInbox(tEntry.Id());
+                }
+            else if (parentId == KMsvDraftEntryIdValue)
+                {
+                // emit signal for new entry into Draft
+                emit entryCreatedInDraft(tEntry.Id());
+                }
+            else if (parentId == iServiceId)
+                {
+                // emit signal for new Entry into SERVICE
+                }
+            else
+                {
+                // do nothing
+                }
+            }
+            break;
+        case EMsvEntriesChanged:
+            {
+            TMsvId id;
+            CMsvEntrySelection* selection = (CMsvEntrySelection*) aArg1;
+            if (selection == NULL)
+                {
+                // no selection, cannot handle
+                return;
+                }
+            id = selection->At(0);
+            //DEBUG Entry changed"));
+            if (parentId == KMsvGlobalInBoxIndexEntryIdValue)
+                {
+/*
+                cEntry = iSession->GetEntryL( parentId );
+                CleanupStack::PushL( cEntry );
+                TRAPD (error, cEntry->SetEntryL( id ));
+                if ( error != KErrNone )
+                    {
+                    CleanupStack::PopAndDestroy(); // cEntry
+                    return;
+                    }
+                TMsvEntry tEntry = cEntry->Entry();
+                if ( tEntry.Visible() )
+                    {
+                    // generate fake delivery report
+                    CMsvStore* store = cEntry->ReadStoreL();
+                    CleanupStack::PushL( store );
+                    CMmsHeaders* mmsHeaders = CMmsHeaders::NewL( iSettings->MmsVersion() );
+                    CleanupStack::PushL( mmsHeaders );
+                    mmsHeaders->RestoreL( *store );
+                    iEncodeBuffer->ResizeL( 0 );
+                    generateDeliveryReport( mmsHeaders );
+                    CleanupStack::PopAndDestroy( 2 ); // mmsHeaders, store
+                    }
+                CleanupStack::PopAndDestroy(); // cEntry
+*/
+                }
+            }
+            break;
+        case EMsvEntriesDeleted:
+            {
+            //emit signal for entry deleted
+            }
+            break;
+        case EMsvEntriesMoved:
+            {
+            if (parentId == KMsvGlobalOutBoxIndexEntryIdValue)
+                {
+                // entry moved to outbox
+                emit entryMovedToOutbox(tEntry.Id());
+                }
+            else if (parentId == KMsvSentEntryIdValue)
+                {
+                // entry moved to sent folder
+                emit entryMovedToSent(tEntry.Id());
+                }
+            else
+                {
+                // do nothing
+                }
+            }
+            break;
+        default:
+            break;
+        }
+    }
+
+void MmsTestBed::createMmsService()
+    {
+    CMmsSettings * settings = CMmsSettings::NewL();
+    CleanupStack::PushL( settings );
+    settings->CreateNewServiceL( *iSession );
+    CleanupStack::PopAndDestroy(); // settings
+    return;
+    }
+
+void MmsTestBed::cleanup()
+    {
+    TMsvId entryToBeKilled;
+    // Get access to root index
+    CMsvEntry* cEntry = iSession->GetEntryL(KMsvRootIndexEntryId);
+    CleanupStack::PushL(cEntry);
+
+    entryToBeKilled = iSettings->Service();
+    cEntry->SetSortTypeL( TMsvSelectionOrdering( KMsvNoGrouping, EMsvSortByNone, ETrue ) );
+    while (entryToBeKilled != KMsvNullIndexEntryId)
+        {
+        // delete child of root entry
+        deleteEntry(entryToBeKilled, *cEntry);
+        entryToBeKilled = iSettings->Service();
+        }
+
+    CleanupStack::PopAndDestroy(); // cEntry
+    // We deleted everything!
+    iDefaultServiceId = KMsvNullIndexEntryId;
+    iServiceId = KMsvNullIndexEntryId;
+    }
+
+void MmsTestBed::deleteEntry(TMsvId aEntryId, CMsvEntry& aClientEntry)
+    {
+    aClientEntry.DeleteL(aEntryId);
+    }
+
+void MmsTestBed::cleanupAndCreateNewService()
+    {
+    cleanup();
+    // all old service entries have been destroyed, create a new one
+    createMmsService();
+    }
+
+void MmsTestBed::testFile(TFileName& aFilePath, TInt aCommand /* = 0 */, TMsvId aBox /* = KMsvGlobalOutBoxIndexEntryId */ )
+    {
+    // update settings in mmsclient
+    iMmsClient->RestoreSettingsL();
+    iSettings->CopyL( iMmsClient->MmsSettings() );
+
+    RFileReadStream readStream;
+    readStream.PushL();
+//    TMsvId id = KMsvNullIndexEntryId;
+    CBufFlat* encodeBuffer = NULL;
+    CMmsEncode* encoder = NULL;
+
+    // Open the file
+    TInt err = readStream.Open(iFs, aFilePath, EFileShareReadersOnly );
+    if (err != KErrNone) User::Leave( err );
+
+    TInt   retCode = 0;
+    CMmsReadFile* readFile = NULL;
+    readFile = CMmsReadFile::NewL( iFs, readStream );
+    CleanupStack::PushL( readFile );
+
+    TInt messageCounter = 0;
+    CMsvEntry* cEntry = NULL;
+
+    while(!retCode)
+        {
+        // READ MESSAGE TO BUFFERS
+        iMmsHeaders->Reset(iSettings);
+        // put in some message type just for fun (testing...)
+        iMmsHeaders->SetMessageType( KMmsMessageTypeForwardReq );
+        retCode = readFile->CompleteTestL( messageCounter++, *iMmsHeaders );
+        if(readFile->iMessageType == ETestNewMessage)
+            {
+            // CREATE MESSAGE ENTRY
+            switch ( aCommand )
+                {
+                case ECreateToInbox:
+                case ECreateNotification:
+                    cEntry = iSession->GetEntryL(KMsvGlobalInBoxIndexEntryId);
+                    break;
+                case ECreateToSentItems:
+                    cEntry = iSession->GetEntryL(KMsvSentEntryId);
+                    break;
+                case ECreateToDrafts:
+                    cEntry = iSession->GetEntryL(KMsvDraftEntryId);
+                    break;
+                case ECreateHeadersFromFile:
+                    // here we just encode headers, no message entry
+                    // the entry is fake.
+                    break;
+                case ECreateMMBoxViewConf:
+                    if ( iMmsHeaders->MessageType() == KMmsMessageTypeMboxViewConf )
+                        {
+                        // entry is not created for the description items
+                        // they become attachments
+                        cEntry = iSession->GetEntryL(KMsvDraftEntryId);
+                        }
+                    break;
+                default:
+                    cEntry = iSession->GetEntryL(aBox);
+                    break;
+                }
+
+            // if we are just playing with headers we have no entry
+            if ( aCommand != ECreateHeadersFromFile && aCommand != ECreateMMBoxViewConf )
+                {
+                CleanupStack::PushL(cEntry);
+                iMmsClient->SwitchCurrentEntryL(cEntry->EntryId());
+
+                // CREATE MESSAGE
+                iMmsClient->CreateMessageL(iServiceId);
+                }
+            else if ( aCommand == ECreateMMBoxViewConf )
+                {
+                if ( iMmsHeaders->MessageType() == KMmsMessageTypeMboxViewConf )
+                    {
+                    CleanupStack::PushL(cEntry);
+                    iMmsClient->SwitchCurrentEntryL(cEntry->EntryId());
+
+                    // CREATE MESSAGE
+                    iMmsClient->CreateMessageL(iServiceId);
+                    }
+                else
+                    {
+                    encodeBuffer = CBufFlat::NewL( 4 * 1024 ); // should be plenty
+                    CleanupStack::PushL( encodeBuffer );
+                    encoder = CMmsEncode::NewL( iFs );
+                    CleanupStack::PushL( encoder );
+
+                    // encode headers to a binary file
+                    encoder->EncodeHeadersL( *iMmsHeaders, *encodeBuffer );
+
+                    iFilename = KMmsMMBoxDescriptionDirectory;
+                    TMmsTestUtils::Dump( *encodeBuffer, iFilename, iParse, iFs );
+
+                    CleanupStack::PopAndDestroy( 2 ); // encodeBuffer, encoder
+                    encodeBuffer = NULL;
+                    encoder = NULL;
+                    }
+                }
+            else
+                {
+                encodeBuffer = CBufFlat::NewL( 4 * 1024 ); // should be plenty
+                CleanupStack::PushL( encodeBuffer );
+                encoder = CMmsEncode::NewL( iFs );
+                CleanupStack::PushL( encoder );
+
+                // encode headers to a binary file
+                encoder->EncodeHeadersL( *iMmsHeaders, *encodeBuffer );
+
+                iFilename = KMmsDumpDirectory;
+                TMmsTestUtils::Dump( *encodeBuffer, iFilename, iParse, iFs );
+
+                CleanupStack::PopAndDestroy( 2 ); // encodeBuffer, encoder
+                encodeBuffer = NULL;
+                encoder = NULL;
+                }
+            }
+
+        if ( aCommand != ECreateHeadersFromFile &&
+            ( aCommand != ECreateMMBoxViewConf || iMmsHeaders->MessageType() == KMmsMessageTypeMboxViewConf ) )
+            {
+            if(readFile->iMessageType == ETestSettings)
+                {
+                TMsvId ServiceId = iMmsClient->DefaultServiceL();
+                iMmsClient->RestoreSettingsL();
+                iSettings->CopyL( iMmsClient->MmsSettings() );
+                }
+
+            TMemoryInfoV1Buf memory;
+            UserHal::MemoryInfo( memory );
+            TInt available = memory().iFreeRamInBytes;
+//            TMmsLogger::Log(_L("Free memory before CreateMessageL %d"), available );
+
+            TRAP (err, readFile->CreateMessageL(iMmsClient, iMmsHeaders));
+
+            available = memory().iFreeRamInBytes;
+//            TMmsLogger::Log(_L("Free memory after CreateMessageL %d"), available );
+
+            if(readFile->iMessageType == ETestNewMessage)
+                {
+                TMsvEntry tEntry = iMmsClient->Entry().Entry();
+                TMsvId id = tEntry.Id();
+                if ( err == KErrNone )
+                    {
+                    // SAVE MESSAGE
+                    iMmsClient->SaveMessageL();
+
+                    // If we are creating a MMBox View confirmation,
+                    // we add all binary files from KMmsMMBoxDirectory
+                    // as attachments.
+
+                    if ( iMmsHeaders->MessageType() == KMmsMessageTypeMboxViewConf )
+                        {
+                        addMMBoxDescriptions();
+                        }
+
+                    // reload the entry in case mms client put something into it
+                    // MESSAGE MUST BE SET VISIBLE
+                    tEntry = iMmsClient->Entry().Entry();
+                    if ( iMmsClient->MessageClass() == EMmsClassAdvertisement )
+                        {
+                        tEntry.iMtmData1 |= KMmsMessageAdvertisement;
+                        }
+                    else if ( iMmsClient->MessageClass() == EMmsClassInformational )
+                        {
+                        tEntry.iMtmData1 |= KMmsMessageInformational;
+                        }
+                    tEntry.iMtmData1 &= ~KMmsMessageMobileTerminated;
+
+                    // Test: Set all as editor oriented - except notifications!
+                    if ( aCommand == ECreateNotification )
+                        {
+                        tEntry.iMtm = KUidMsgMMSNotification;
+                        }
+                    else
+                        {
+                        tEntry.iMtmData1 |= KMmsMessageEditorOriented;
+                        }
+                    if ( aCommand == ECreateToInbox )
+                        {
+                        tEntry.iMtmData1 |= KMmsMessageMobileTerminated;
+                        tEntry.SetReadOnly( ETrue );
+                        tEntry.SetNew( ETrue );
+                        tEntry.SetUnread( ETrue );
+                        }
+                    else if ( aCommand == ECreateToSentItems )
+                        {
+                        tEntry.SetReadOnly( ETrue );
+                        }
+                    tEntry.SetVisible( ETrue );
+                    tEntry.SetInPreparation( EFalse );
+                    TTime now;
+                    now.UniversalTime();
+                    tEntry.iDate = now;
+                    TMsvId entryId = tEntry.Id();
+                    iMmsClient->Entry().ChangeL( tEntry );
+                    if ( iMmsHeaders->MessageType() == KMmsMessageTypeMboxViewConf )
+                        {
+                        // Encode to the directory that is used to fetch MMBox view
+                        iFilename.Copy( KMmsMMBoxDirectory );
+                        encodeMessageFromDrafts();
+                        cEntry->SetEntryL( KMsvDraftEntryId );
+                        cEntry->DeleteL( entryId );
+                        }
+                    }
+                else
+                    {
+                    //TMmsLogger::Log(_L("CreateMessageL left with error %d"), err );
+                    iSession->RemoveEntry(id);
+                    err = KErrNone; // clear error
+                    }
+                CleanupStack::PopAndDestroy(); // cEntry
+                cEntry = NULL;
+                }
+            if(readFile->iMessageType == ETestSettings)
+                {
+                iMmsClient->SetSettingsL( *iSettings );
+                iMmsClient->StoreSettingsL();
+                }
+        }
+    }
+
+    CleanupStack::PopAndDestroy(); //readFile
+
+    readStream.Close();
+    readStream.Pop();
+
+    /*
+    iMmsClient->SwitchCurrentEntryL(id);
+    */
+    }
+
+void MmsTestBed::addMMBoxDescriptions()
+    {
+    // add the contents of KMmsMMBoxDescriptionDirectory as attachments
+    CDir* fileList = NULL;
+    TInt i = 0;  // general counter
+    TInt error = KErrNone;
+    iCurrentPath = KMmsMMBoxDescriptionDirectory;
+
+    iFs.SetSessionPath(iCurrentPath);
+
+    TFindFile finder( iFs );
+    error = finder.FindWildByPath( KWild, NULL, fileList );
+    CleanupStack::PushL( fileList );
+    TInt fileCounter = 0;
+
+    if ( error == KErrNone )
+        {
+        fileCounter = fileList->Count();
+        }
+
+    TEntry entry;
+
+    if ( error == KErrNone )
+        {
+        for ( i = 0; i < fileCounter; ++i )
+            {
+            // Reset inactivity timer to keep viewServer from crashing
+            User::ResetInactivityTime();
+            entry = (*fileList)[i]; // name is entry.iName
+            iFilename.Copy( iCurrentPath );
+            iFilename.Append( entry.iName );
+            TPtrC ptr;
+            ptr.Set( iFilename );
+            iWait->iStatus = KErrNone;
+            iMmsClient->AddAttachmentL( ptr, KMmsMimeType, 0, iWait->iStatus );
+
+            iWait->Start();
+            // The descriptions are cleared after being used
+            iFs.Delete( ptr);
+            }
+        }
+
+    iMmsClient->SaveMessageL(); // just in case somthing must be updated
+    CleanupStack::PopAndDestroy(); // fileList
+    fileList = NULL;
+    }
+
+void MmsTestBed::encodeMessageFromDrafts()
+    {
+    CMmsEncode* encoder = CMmsEncode::NewL( iFs );
+    CleanupStack::PushL( encoder );
+    // encode a message iMmsClientPoints to
+    iMmsClient->LoadMessageL();
+    CMsvStore* store = iMmsClient->Entry().ReadStoreL();
+    CleanupStack::PushL( store );
+    iMmsHeaders->RestoreL( *store );
+    CleanupStack::PopAndDestroy(); // store
+    store = NULL;
+    iWait->iStatus = KErrNone;
+
+// caller sets the directory
+//    iFilename = KMmsMessageDumpDirectory;
+
+    CMmsClientEntry* entryWrapper = CMmsClientEntry::NewL( iFs, iMmsClient->Entry(), iServiceId );
+    CleanupStack::PushL( entryWrapper );
+    iEncodeBuffer->ResizeL(0);
+    encoder->StartL( *entryWrapper, *iMmsHeaders, *iEncodeBuffer, iWait->iStatus );
+    iWait->Start();
+    if ( iWait->iStatus == KErrNone )
+        {
+        TMmsTestUtils::Dump( *iEncodeBuffer, iFilename, iParse, iFs );
+        }
+    iEncodeBuffer->ResizeL(0);
+    CleanupStack::PopAndDestroy(); // entryWrapper
+    CleanupStack::PopAndDestroy(); // encoder
+    }
+
+void MmsTestBed::deleteNotifications()
+    {
+    TMsvId mmsFolderId = KMsvNullIndexEntryId;
+    mmsFolderId = findMMSFolder();
+
+    CMsvEntry* cEntry = NULL;
+    // delete all messages from the specified box
+    cEntry = iSession->GetEntryL(KMsvRootIndexEntryId);
+    CleanupStack::PushL(cEntry);
+
+    if ( mmsFolderId != KMsvNullIndexEntryId )
+        {
+        cEntry->SetEntryL(mmsFolderId);
+
+        // show invisible entries
+        cEntry->SetSortTypeL( TMsvSelectionOrdering( KMsvNoGrouping, EMsvSortByNone, ETrue ) );
+        CMsvEntrySelection* msvEntrySelection = cEntry->ChildrenWithMtmL(KUidMsgTypeMultimedia);
+        CleanupStack::PushL(msvEntrySelection);
+
+        TCommandParameters parameters; // initialized to zero
+        TCommandParametersBuf paramPack( parameters );
+
+        if (msvEntrySelection->Count() > 0)
+            {
+            CMsvOperation* op = iSession->TransferCommandL(
+                *msvEntrySelection,
+                EMmsDeleteEntries,
+                paramPack,
+                iWait->iStatus);
+            CleanupStack::PushL(op);
+            iWait->Start();
+            CleanupStack::PopAndDestroy(); // op
+            }
+
+        // These cannot be deleted unless we have the a server mtm
+        // corresponding to this mtm type.
+        cEntry->SetSortTypeL( TMsvSelectionOrdering( KMsvNoGrouping, EMsvSortByNone, ETrue ) );
+        CleanupStack::PopAndDestroy(); //msvEntrySelection
+        msvEntrySelection = cEntry->ChildrenWithMtmL( KUidMsgMMSNotification );
+        CleanupStack::PushL(msvEntrySelection);
+
+        if (msvEntrySelection->Count() > 0)
+            {
+            CMsvOperation* op = iSession->TransferCommandL(
+                *msvEntrySelection,
+                EMmsDeleteEntries,
+                paramPack,
+                iWait->iStatus);
+            CleanupStack::PushL(op);
+            iWait->Start();
+            CleanupStack::PopAndDestroy(); // op
+            }
+
+        CleanupStack::PopAndDestroy(); //msvEntrySelection
+
+        CleanupStack::PopAndDestroy(); //cEntry
+        }
+    }
+
+TMsvId MmsTestBed::findMMSFolder()
+    {
+    return iSettings->NotificationFolder();
+    }
+
+void MmsTestBed::restoreFactorySettings()
+    {
+    iMmsClient->RestoreSettingsL();
+    iSettings->CopyL( iMmsClient->MmsSettings() );
+    // do not reset access point
+    TInt accessPoint = iSettings->AccessPoint( 0 );
+    iSettings->RestoreFactorySettingsL( iMmsClient->Session(), EMmsFactorySettingsLevelDeep );
+    TInt count = iSettings->AccessPointCount();
+    TInt i = 0;
+    for ( i = count - 1; i >= 0; --i )
+        {
+        iSettings->DeleteAccessPointL( i );
+        }
+    // restore the original access point
+    if ( accessPoint > 0 )
+        {
+        // a negative access point is an error (most likely "KErrNotFound")
+        iSettings->AddAccessPointL( accessPoint, 0 );
+        }
+    iMmsClient->SetSettingsL( *iSettings );
+    iMmsClient->StoreSettingsL();
+    }
+
+void MmsTestBed::setFetchingState( TMmsReceivingMode aState )
+    {
+    iMmsClient->RestoreSettingsL();
+    iSettings->CopyL( iMmsClient->MmsSettings() );
+
+    iSettings->SetReceivingModeHome( aState );
+
+    iMmsClient->SetSettingsL( *iSettings );
+    iMmsClient->StoreSettingsL();
+    }
+
+void MmsTestBed::sendFromFile()
+    {
+    CMsvOperation * op = NULL;
+
+    CMsvEntry* cEntry = iSession->GetEntryL(KMsvGlobalOutBoxIndexEntryId);
+    CleanupStack::PushL( cEntry );
+
+    CMsvEntrySelection* selection = NULL;
+    selection = cEntry->ChildrenWithMtmL(KUidMsgTypeMultimedia);
+    CleanupStack::PopAndDestroy(); // cEntry
+    CleanupStack::PushL( selection );
+
+    TRAPD (error, op = iMmsClient->SendL(*selection, iWait->iStatus));
+    if ( error != KErrNone )
+        {
+        CleanupStack::PopAndDestroy(); // selection
+        delete op;
+        return;
+        }
+    CleanupStack::PushL(op);
+    iWait->Start();
+
+    while (iWait->iStatus.Int() == KRequestPending )
+        {
+        if (!iTimer->IsActive())
+            {
+            iTimer->IssueRequest();
+            }
+        CActiveScheduler::Start();
+        }
+
+    if ( iWait->iStatus.Int() != KErrNone )
+        {
+        //TMmsLogger::Log(_L("Testbed tried to send, return status %d"), iWait->iStatus.Int());
+        }
+
+    iTimer->Cancel();
+    CleanupStack::PopAndDestroy(2); // op, selection
+    }
+
+void MmsTestBed::sendOneByOne()
+    {
+    CMsvEntry* cEntry = iSession->GetEntryL(KMsvGlobalOutBoxIndexEntryId);
+    CleanupStack::PushL( cEntry );
+
+    CMsvEntrySelection* selection = NULL;
+    selection = cEntry->ChildrenWithMtmL(KUidMsgTypeMultimedia);
+    CleanupStack::PushL( selection );
+
+    CMsvEntrySelection* shortSelection = new (ELeave) CMsvEntrySelection;
+    CleanupStack::PushL( shortSelection );
+
+    TInt i;
+
+    for ( i = 0; i < selection->Count(); ++i )
+        {
+        shortSelection->Reset();
+        shortSelection->AppendL( selection->At( i ) );
+
+        CMsvOperation * op = NULL;
+
+        TTime now;
+        now.UniversalTime();
+
+        TRAPD (error, op = iMmsClient->SendL(*shortSelection, iWait->iStatus, now ));
+        if ( error != KErrNone )
+            {
+            delete op;
+            CleanupStack::PopAndDestroy( 3 ); // entry, selection, shortSelection
+            return;
+            }
+        CleanupStack::PushL(op);
+        iWait->Start();
+
+        while (iWait->iStatus.Int() == KRequestPending )
+            {
+            if (!iTimer->IsActive())
+                {
+                iTimer->IssueRequest();
+                }
+            CActiveScheduler::Start();
+            }
+
+        if ( iWait->iStatus.Int() != KErrNone )
+            {
+            //TMmsLogger::Log(_L("Testbed tried to send, return status %d"), iWait->iStatus.Int());
+            }
+
+        iTimer->Cancel();
+        CleanupStack::PopAndDestroy(); // op
+
+        }
+    CleanupStack::PopAndDestroy( 3 ); // entry, selection, shortSelection
+    }
+
+void MmsTestBed::sendNotifications()
+    {
+    // Only send one notification!!
+
+    TInt error = KErrNone;
+
+    if (! TMmsTestUtils::IsFile(iCurrentFile, iFs) )
+        {
+        //Not a file
+        return;
+        }
+    TMsvId mmsFolder = findMMSFolder();
+
+    TEntry entry;
+
+
+    // now I think we have a filename
+    TEntry orgEntry;
+    TUint size = 0;
+    error = iFs.Entry( iCurrentFile, orgEntry );
+    size = orgEntry.iSize;
+
+    //TMmsLogger::Log(_L("- notification %S "), &iCurrentFile);
+    if ( size == 0 )
+        {
+        //empty file
+        //TMmsLogger::Log(_L("- empty file"));
+        return;
+        }
+
+    if ( iEncodeBuffer == NULL )
+        {
+        iEncodeBuffer = CBufFlat::NewL( size );
+        }
+    else
+        {
+        iEncodeBuffer->ResizeL( 0 );
+        iEncodeBuffer->ResizeL( size );
+        }
+
+    RFile inFile;
+    error = inFile.Open( iFs, iCurrentFile, EFileShareReadersOnly );
+    TPtr8 ptr = iEncodeBuffer->Ptr( 0 );
+    if ( error == KErrNone )
+        {
+        error = inFile.Read( ptr, size );
+        inFile.Close();
+        }
+    else
+       {
+       //Error
+       //TMmsLogger::Log(_L("- can't read file"));
+       return;
+       }
+
+    TUint8 byte;
+    TUint position = 0;
+    TUint32 uintvar = 0;
+
+    if ( size > 2 )
+        {
+        iEncodeBuffer->Read( 1, &byte, 1 );
+        if ( byte == 6 ) // PUSH PDU
+            {
+            // try to find out length of header
+            position = 2;
+            iEncodeBuffer->Read( position, &byte, 1);
+
+            while ( byte & 0x80  && position < size )
+                {
+                uintvar += ( byte & 0x7f );
+                uintvar <<= 7;
+                position++;
+                iEncodeBuffer->Read( position, &byte, 1 );
+                }
+
+            // add last byte without shift
+            uintvar += byte;
+            position++;
+           }
+        }
+
+    position += uintvar;
+
+    if ( position < size )
+        {
+        ptr = iEncodeBuffer->Ptr( position );
+        size = ptr.Length();
+        }
+
+    if ( size == 0 )
+        {
+        //no MMS stuff
+        //TMmsLogger::Log(_L("- no MMS stuff"));
+        return;
+        }
+
+    TMsvId entryId = TMmsTestUtils::CreateNotificationEntryL( mmsFolder, iServiceId, iEncodeBuffer, *iSession );
+
+    // Now we have streamed our data into this entry.
+    // Now we have an entry that says: local service, MMS MTM
+    CMsvEntrySelection* selection = new (ELeave) CMsvEntrySelection;
+    CleanupStack::PushL( selection );
+    if ( entryId != KMsvNullIndexEntryId )
+        {
+        selection->AppendL( entryId );
+        }
+    else
+        {
+        selection->AppendL( iDefaultServiceId );
+        }
+
+    TWatcherParameters parameters; // initialized to zero
+    parameters.iWatcherId = RThread().Id();
+    parameters.iDataPointer = &ptr;
+    TWatcherParametersBuf paramPack( parameters );
+
+    CMsvOperation * op = NULL;
+
+    op = iSession->TransferCommandL(
+        *selection, EMmsDecodePushedMessage, paramPack, iWait->iStatus );
+    CleanupStack::PushL(op);
+    iWait->Start();
+
+    while (iWait->iStatus.Int() == KRequestPending )
+        {
+        if (!iTimer->IsActive())
+            {
+            iTimer->IssueRequest();
+            }
+        CActiveScheduler::Start();
+        }
+
+    iTimer->Cancel();
+    User::After(1000000);
+
+    CleanupStack::PopAndDestroy(); // op
+    CleanupStack::PopAndDestroy(); // selection
+    }
+
+void MmsTestBed::copyDrafts()
+    {
+    CMsvEntry* cEntry = NULL;
+// Copies contents of sent folder to drafts for retrying sending.
+
+    cEntry = iSession->GetEntryL(KMsvSentEntryId);
+    CleanupStack::PushL(cEntry);
+    // Get all mms messages in drafts
+    CMsvEntrySelection* selection = cEntry->ChildrenWithMtmL( KUidMsgTypeMultimedia );
+    CleanupStack::PushL( selection );
+
+    TMsvLocalOperationProgress progress;
+    cEntry->CopyL( *selection, KMsvDraftEntryId, progress );
+
+    TInt i = 0;
+    for ( i = 0; i < selection->Count(); ++i )
+        {
+        cEntry->SetEntryL( selection->At( i ) );
+        TMsvEntry entry = cEntry->Entry();
+        entry.SetReadOnly( EFalse );
+        cEntry->ChangeL( entry );
+        }
+
+    CleanupStack::PopAndDestroy(2); // selection, cEntry
+    }
+
+void MmsTestBed::garbageCollection(TUint32 aReason)
+    {
+    CMsvEntrySelection* selection = new (ELeave) CMsvEntrySelection;
+    CleanupStack::PushL( selection );
+    selection->InsertL(0, iDefaultServiceId);
+
+    CMsvOperation * op = NULL;
+
+    TMMSGarbageCollectionParameters parameters; // initialized to zero
+    parameters.iReasonFlags = aReason;
+    TMMSGarbageCollectionParametersBuf paramPack( parameters );
+    op = iSession->TransferCommandL(
+        *selection, EMmsGarbageCollection, paramPack, iWait->iStatus );
+    CleanupStack::PushL(op);
+    iWait->Start();
+
+    while (iWait->iStatus.Int() == KRequestPending )
+        {
+        if (!iTimer->IsActive())
+            {
+            iTimer->IssueRequest();
+            }
+        CActiveScheduler::Start();
+        }
+
+    iTimer->Cancel();
+
+    CleanupStack::PopAndDestroy(); // op
+    CleanupStack::PopAndDestroy(); // selection
+    }
+
+void MmsTestBed::messageVariation()
+    {
+    CMsvEntrySelection* selection = new (ELeave) CMsvEntrySelection;
+    CleanupStack::PushL( selection );
+    selection->InsertL(0, iDefaultServiceId);
+
+    CMsvOperation * op = NULL;
+
+    op = iSession->TransferCommandL(
+        *selection, EMmsMessageGeneration, TPtrC8(), iWait->iStatus );
+    CleanupStack::PushL(op);
+    iWait->Start();
+
+    while (iWait->iStatus.Int() == KRequestPending )
+        {
+        if (!iTimer->IsActive())
+            {
+            iTimer->IssueRequest();
+            }
+        CActiveScheduler::Start();
+        }
+
+    iTimer->Cancel();
+
+    CleanupStack::PopAndDestroy(); // op
+    CleanupStack::PopAndDestroy(); // selection
+    }
+
+void MmsTestBed::cancelSendScheduling()
+    {
+    CMsvEntry* cEntry = NULL;
+    setFetchingState( EMmsReceivingPostpone );
+    testFile( iCurrentFile );
+    scheduledSend(KMsvGlobalOutBoxIndexEntryIdValue, 10000); // long delay so that we have time to cancel
+    deleteSendSchedule();
+
+    cEntry = iSession->GetEntryL(KMsvRootIndexEntryId);
+    CleanupStack::PushL(cEntry);
+    cEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryIdValue);
+    if (iMsvEntrySelection != NULL)
+        {
+        delete iMsvEntrySelection;
+        iMsvEntrySelection = NULL;
+        }
+    iMsvEntrySelection = cEntry->ChildrenWithMtmL(KUidMsgTypeMultimedia);
+    CleanupStack::PopAndDestroy();
+    }
+
+void MmsTestBed::scheduledSend(TMsvId aBoxId, TInt aDelay /* = 5 */)
+    {
+    CMsvEntry* cEntry = NULL;
+    TCommandParameters parameters;
+    parameters.iInitialDelay = aDelay;
+    TCommandParametersBuf paramPack( parameters );
+
+    cEntry = iSession->GetEntryL(aBoxId);
+    CleanupStack::PushL(cEntry);
+    // Get all mms messages of outbox
+    CMsvEntrySelection* selection = cEntry->ChildrenWithMtmL( KUidMsgTypeMultimedia );
+    CleanupStack::PushL( selection );
+//    selection->InsertL(0, iDefaultServiceId);
+
+    CMsvOperation * op = NULL;
+    op = iMmsClient->InvokeAsyncFunctionL(
+        EMmsScheduledSend,
+        *selection,
+        paramPack,
+        iWait->iStatus);
+    CleanupStack::PushL(op);
+    iWait->Start();
+
+    while (iWait->iStatus.Int() == KRequestPending )
+        {
+        if (!iTimer->IsActive())
+            {
+            iTimer->IssueRequest();
+            }
+        CActiveScheduler::Start();
+        }
+
+    iTimer->Cancel();
+
+    CleanupStack::PopAndDestroy(); // op
+    CleanupStack::PopAndDestroy(2); // cEntry, selection
+    }
+
+void MmsTestBed::deleteSendSchedule()
+    {
+    CMsvEntry* cEntry = NULL;
+
+    TCommandParameters parameters; // initialized to zero
+    TCommandParametersBuf paramPack( parameters );
+
+    cEntry = iSession->GetEntryL(KMsvGlobalOutBoxIndexEntryIdValue);
+    CleanupStack::PushL(cEntry);
+    // Get all mms messages of outbox
+    CMsvEntrySelection* selection = cEntry->ChildrenWithMtmL( KUidMsgTypeMultimedia );
+    CleanupStack::PushL( selection );
+    selection->InsertL(0, iDefaultServiceId);
+
+    CMsvOperation * op = NULL;
+    op = iMmsClient->InvokeAsyncFunctionL(
+        EMmsDeleteSchedule,
+        *selection,
+        paramPack,
+        iWait->iStatus);
+    CleanupStack::PushL(op);
+    iWait->Start();
+
+    while (iWait->iStatus.Int() == KRequestPending )
+        {
+        if (!iTimer->IsActive())
+            {
+            iTimer->IssueRequest();
+            }
+        CActiveScheduler::Start();
+        }
+
+    iTimer->Cancel();
+
+    CleanupStack::PopAndDestroy(); // op
+    CleanupStack::PopAndDestroy(2); // cEntry, selection
+    }
+
+void MmsTestBed::cancelFetchScheduling()
+    {
+    TMsvId mmsFolder = findMMSFolder();
+    CMsvEntry* cEntry = NULL;
+    setFetchingState( EMmsReceivingPostpone );
+    testFile( iCurrentFile );
+    fromOutboxToMmsc(); // immediate send (EMmsSend)
+
+    // Wait until notification has arrived - may take a while in global mode
+    TInt i = 0;
+    while ( TMmsTestUtils::CountChildrenL( mmsFolder, iMsvEntrySelection, *iSession ) == 0
+        && i < 2000 )
+        {
+        if (!iTimer->IsActive())
+            {
+            iTimer->IssueRequest();
+            }
+        i++;
+        if ( (i/100) * 100 == i )
+            {
+            //TMmsLogger::Log(_L("%d:th wait cycle"), i );
+            }
+        CActiveScheduler::Start();
+        }
+    iTimer->Cancel();
+
+    fetchForced( 10000 ); // delay to allow cancelling
+    deleteFetchSchedule();
+
+    cEntry = iSession->GetEntryL(KMsvRootIndexEntryId);
+    CleanupStack::PushL(cEntry);
+    cEntry->SetEntryL(mmsFolder);
+    if (iMsvEntrySelection != NULL)
+        {
+        delete iMsvEntrySelection;
+        iMsvEntrySelection = NULL;
+        }
+    iMsvEntrySelection = cEntry->ChildrenWithMtmL(KUidMsgTypeMultimedia);
+    CleanupStack::PopAndDestroy(); // cEntry
+    }
+
+void MmsTestBed::fetchForced(TInt aDelay /* = 5 */)
+    {
+    TCommandParameters parameters;
+    parameters.iInitialDelay = aDelay;
+    TCommandParametersBuf paramPack( parameters );
+
+    CMsvEntrySelection* selection = new CMsvEntrySelection;
+    CleanupStack::PushL( selection );
+    // if we have a selected service, insert it into selection
+    if (iServiceId != KMsvNullIndexEntryId)
+        {
+        selection->InsertL(0, iServiceId);
+        }
+    else
+        {
+        selection->InsertL(0, iDefaultServiceId);
+        }
+
+
+    CMsvOperation * op = NULL;
+    op = iMmsClient->InvokeAsyncFunctionL(
+        EMmsScheduledReceiveForced,
+        *selection,
+        paramPack,
+        iWait->iStatus);
+
+    CleanupStack::PushL(op);
+    iWait->Start();
+
+    while (iWait->iStatus.Int() == KRequestPending )
+        {
+        if (!iTimer->IsActive())
+            {
+            iTimer->IssueRequest();
+            }
+        CActiveScheduler::Start();
+        }
+
+    iTimer->Cancel();
+
+    CleanupStack::PopAndDestroy(); // op
+    CleanupStack::PopAndDestroy(); // selection
+    }
+
+void MmsTestBed::deleteFetchSchedule()
+    {
+    CMsvEntry* cEntry = NULL;
+
+    TCommandParameters parameters; // initialized to zero
+    TCommandParametersBuf paramPack( parameters );
+
+    TMsvId mmsFolderId = KMsvNullIndexEntryId;
+    mmsFolderId = findMMSFolder();
+    cEntry = iSession->GetEntryL( mmsFolderId );
+    CleanupStack::PushL(cEntry);
+    // Get all notifications
+    CMsvEntrySelection* selection = cEntry->ChildrenWithMtmL( KUidMsgTypeMultimedia );
+    CleanupStack::PushL( selection );
+    selection->InsertL(0, iDefaultServiceId);
+
+    CMsvOperation * op = NULL;
+    op = iMmsClient->InvokeAsyncFunctionL(
+        EMmsDeleteSchedule,
+        *selection,
+        paramPack,
+        iWait->iStatus);
+    CleanupStack::PushL(op);
+    iWait->Start();
+
+    while (iWait->iStatus.Int() == KRequestPending )
+        {
+        if (!iTimer->IsActive())
+            {
+            iTimer->IssueRequest();
+            }
+        CActiveScheduler::Start();
+        }
+
+    iTimer->Cancel();
+
+    CleanupStack::PopAndDestroy(); // op
+    CleanupStack::PopAndDestroy(2); // cEntry, selection
+    }
+
+void MmsTestBed::doAFetchCycle()
+    {
+    // Sends a message from iCurrentFile and lets it come back
+    TMsvId mmsFolder = findMMSFolder();
+    testFile( iCurrentFile );
+    fromOutboxToMmsc(); // immediate send (EMmsSend)
+    // fetching will start automatically
+
+    TInt i = 0;
+    while ( TMmsTestUtils::CountChildrenL( KMsvGlobalInBoxIndexEntryId, iMsvEntrySelection, *iSession ) == 0
+         && i < 2000
+         && TMmsTestUtils::CountChildrenL( mmsFolder, iMsvEntrySelection, *iSession ) > 0 )
+        {
+        if (!iTimer->IsActive())
+            {
+            iTimer->IssueRequest();
+            }
+        i++;
+        if ( (i/100) * 100 == i )
+            {
+            //TMmsLogger::Log(_L("%d:th wait cycle"), i );
+            }
+        CActiveScheduler::Start();
+        }
+    iTimer->Cancel();
+    }
+
+bool MmsTestBed::checkLogClient()
+    {
+    if ( iLogClient == NULL )
+        {
+        TRAP_IGNORE( iLogClient = CLogClient::NewL( iFs ) );
+        }
+    return ( iLogClient != NULL );
+    }
+
+int MmsTestBed::getLogEntries()
+    {
+    TInt count = 0;
+    if ( !iLogView )
+        {
+        return 0;
+        }
+
+    if ( iLogView->SetFilterL( *iLogFilter, iWait->iStatus ) )
+        {
+        // should complete with KErrNone
+        iWait->Start();
+        if ( iWait->iStatus.Int() == KErrNone )
+            {
+            count = iLogView->CountL();
+            }
+        }
+    return count;
+    }
+
+void MmsTestBed::createEntry(TMsvEntry& aNewEntry, CMsvEntry& aClientEntry)
+    {
+    CMsvOperation*  opert = aClientEntry.CreateL(aNewEntry, iWait->iStatus);
+    iWait->Start();
+    if (!opert->iStatus.Int()==KErrNone)
+        {
+        // what should we do? panic?
+        }
+
+    TPckgBuf<TMsvLocalOperationProgress> package;
+    package.Copy(opert->ProgressL());
+    *(TMsvId*)&aNewEntry = package().iId;
+
+    delete opert; opert=NULL;
+    }
+
+void MmsTestBed::cleanOutbox()
+    {
+    TMmsTestUtils::CleanBoxL(KMsvGlobalOutBoxIndexEntryId, *iSession);
+    }
+
+void MmsTestBed::cleanInbox()
+    {
+    TMmsTestUtils::CleanBoxL(KMsvGlobalInBoxIndexEntryId, *iSession);
+    }
+
+void MmsTestBed::cleanSent()
+    {
+    TMmsTestUtils::CleanBoxL(KMsvSentEntryId, *iSession);
+    }
+
+void MmsTestBed::cleanDrafts()
+    {
+    TMmsTestUtils::CleanBoxL(KMsvDraftEntryId, *iSession);
+    }
+
+void MmsTestBed::cleanAll()
+    {
+    cleanInbox();
+    cleanOutbox();
+    cleanSent();
+    cleanDrafts();
+    TMmsTestUtils::CleanBoxL( iSettings->MMBoxFolder(), *iSession );
+    deleteNotifications();
+    }
+
+void MmsTestBed::reply()
+    {
+    // The first message from inbox is replied to
+    CMsvEntry* cEntry = iSession->GetEntryL(KMsvGlobalInBoxIndexEntryId);
+    CleanupStack::PushL(cEntry);
+    delete iMsvEntrySelection;
+    iMsvEntrySelection = NULL;
+    iMsvEntrySelection = cEntry->ChildrenWithMtmL( KUidMsgTypeMultimedia );
+    if ( iMsvEntrySelection->Count() > 0 )
+        {
+        TMsvId originalEntry = iMsvEntrySelection->At(0);
+        iMmsClient->SwitchCurrentEntryL( originalEntry );
+        TMsvPartList partList = KMsvMessagePartOriginator | KMsvMessagePartDescription;
+        CMsvOperation * op = NULL;
+        op = iMmsClient->ReplyL( KMsvGlobalOutBoxIndexEntryId, partList, iWait->iStatus);
+        CleanupStack::PushL(op);
+        iWait->Start();
+        while (iWait->iStatus.Int() == KRequestPending )
+            {
+            if (!iTimer->IsActive())
+                {
+                iTimer->IssueRequest();
+                }
+            CActiveScheduler::Start();
+            }
+
+        iTimer->Cancel();
+        if ( iWait->iStatus.Int() != KErrNone )
+            {
+            //TMmsLogger::Log(_L("Create reply, return status %d"), iWait->iStatus.Int());
+            }
+        else
+            {
+            TMsvId newEntry = KMsvNullIndexEntryId;
+            TPckgBuf<TMsvId> package;
+            package.Copy(op->ProgressL());
+            newEntry = package();
+            if ( newEntry != KMsvNullIndexEntryId )
+                {
+                cEntry->SetEntryL( newEntry );
+                TMsvEntry entry = cEntry->Entry();
+                entry.SetInPreparation( EFalse );
+                entry.SetVisible( ETrue );
+                cEntry->ChangeL(entry);
+                }
+            }
+        CleanupStack::PopAndDestroy(); // op
+        }
+    CleanupStack::PopAndDestroy(); // cEntry
+    }
+
+void MmsTestBed::replyToAll()
+    {
+    // The first message from inbox is replied to
+    CMsvEntry* cEntry = iSession->GetEntryL(KMsvGlobalInBoxIndexEntryId);
+    CleanupStack::PushL(cEntry);
+    delete iMsvEntrySelection;
+    iMsvEntrySelection = NULL;
+    iMsvEntrySelection = cEntry->ChildrenWithMtmL(KUidMsgTypeMultimedia);
+
+    if ( iMsvEntrySelection->Count() > 0 )
+        {
+        TMsvId originalEntry = iMsvEntrySelection->At(0);
+        iMmsClient->SwitchCurrentEntryL( originalEntry );
+        TMsvPartList partList = KMsvMessagePartOriginator | KMsvMessagePartDescription |
+            KMsvMessagePartRecipient;
+        CMsvOperation * op = NULL;
+        op = iMmsClient->ReplyL( KMsvGlobalOutBoxIndexEntryId, partList, iWait->iStatus);
+        CleanupStack::PushL(op);
+        iWait->Start();
+        while (iWait->iStatus.Int() == KRequestPending )
+            {
+            if (!iTimer->IsActive())
+                {
+                iTimer->IssueRequest();
+                }
+            CActiveScheduler::Start();
+            }
+
+        iTimer->Cancel();
+        if ( iWait->iStatus.Int() != KErrNone )
+            {
+            //TMmsLogger::Log(_L("Create reply to all, return status %d"), iWait->iStatus.Int());
+            }
+        else
+            {
+            TMsvId newEntry = KMsvNullIndexEntryId;
+            TPckgBuf<TMsvId> package;
+            package.Copy(op->ProgressL());
+            newEntry = package();
+            if ( newEntry != KMsvNullIndexEntryId )
+                {
+                cEntry->SetEntryL( newEntry );
+                TMsvEntry entry = cEntry->Entry();
+                entry.SetInPreparation( EFalse );
+                entry.SetVisible( ETrue );
+                cEntry->ChangeL(entry);
+                }
+            }
+        CleanupStack::PopAndDestroy(); // op
+        }
+    CleanupStack::PopAndDestroy(); // cEntry
+    }
+
+void MmsTestBed::forward()
+    {
+    // The first message from inbox is forwarded
+    CMsvEntry* cEntry = iSession->GetEntryL(KMsvGlobalInBoxIndexEntryId);
+    CleanupStack::PushL(cEntry);
+    delete iMsvEntrySelection;
+    iMsvEntrySelection = NULL;
+    iMsvEntrySelection = cEntry->ChildrenWithMtmL(KUidMsgTypeMultimedia);
+
+    if ( iMsvEntrySelection->Count() > 0 )
+        {
+        TMsvId originalEntry = iMsvEntrySelection->At(0);
+        iMmsClient->SwitchCurrentEntryL( originalEntry );
+        TMsvPartList partList = KMsvMessagePartOriginator | KMsvMessagePartDescription |
+            KMsvMessagePartRecipient | KMsvMessagePartAttachments;
+        CMsvOperation * op = NULL;
+        op = iMmsClient->ForwardL( KMsvGlobalOutBoxIndexEntryId, partList, iWait->iStatus);
+        CleanupStack::PushL(op);
+        iWait->Start();
+        while (iWait->iStatus.Int() == KRequestPending )
+            {
+            if (!iTimer->IsActive())
+                {
+                iTimer->IssueRequest();
+                }
+            CActiveScheduler::Start();
+            }
+
+        iTimer->Cancel();
+        if ( iWait->iStatus.Int() != KErrNone )
+            {
+            //TMmsLogger::Log(_L("Create forward, return status %d"), iWait->iStatus.Int());
+            }
+        else
+            {
+            TMsvId newEntry = KMsvNullIndexEntryId;
+            TPckgBuf<TMsvId> package;
+            package.Copy(op->ProgressL());
+            newEntry = package();
+            if ( newEntry != KMsvNullIndexEntryId )
+                {
+                iMmsClient->SwitchCurrentEntryL( newEntry );
+                // Add a sender: 0601234567
+                iMmsClient->LoadMessageL();
+                iMmsClient->SetSenderL( KMmsSender );
+                iMmsClient->SaveMessageL();
+                cEntry->SetEntryL( newEntry );
+                TMsvEntry entry = cEntry->Entry();
+                entry.SetInPreparation( EFalse );
+                entry.SetVisible( ETrue );
+                cEntry->ChangeL(entry);
+                }
+            }
+        CleanupStack::PopAndDestroy(); // op
+        }
+    CleanupStack::PopAndDestroy(); // cEntry
+    }
+
+void MmsTestBed::sendReadReport()
+    {
+    // TURN READ REPORTS ON (until available from menu)
+    iSettings->LoadSettingsL();
+    iSettings->SetReadReplyReportSendingAllowed( ETrue );
+    iSettings->SaveSettingsL();
+    iMmsClient->RestoreSettingsL();
+
+
+    // Read report is sent for the first message in inbox
+    CMsvEntry* cEntry = iSession->GetEntryL( KMsvGlobalInBoxIndexEntryId );
+    CleanupStack::PushL(cEntry);
+    delete iMsvEntrySelection;
+    iMsvEntrySelection = NULL;
+    iMsvEntrySelection = cEntry->ChildrenWithMtmL( KUidMsgTypeMultimedia );
+
+    if ( iMsvEntrySelection->Count() == 0 )
+        {
+        return;
+        }
+    TMsvId originalEntry = iMsvEntrySelection->At( 0 );
+
+    // new test using Client MTM
+    CMsvOperation * op = NULL;
+    op = iMmsClient->SendReadReportL( originalEntry, iWait->iStatus, EMmsReadStatusRead );
+    CleanupStack::PushL(op);
+    iWait->Start();
+
+    while (iWait->iStatus.Int() == KRequestPending )
+        {
+        if (!iTimer->IsActive())
+            {
+            iTimer->IssueRequest();
+            }
+        CActiveScheduler::Start();
+        }
+
+    if ( iWait->iStatus.Int() != KErrNone )
+        {
+        //TMmsLogger::Log(_L("Testbed tried to send read report, return status %d"), iWait->iStatus.Int());
+        }
+
+    iTimer->Cancel();
+
+    CleanupStack::PopAndDestroy( op );
+    op = NULL;
+
+    // Try sending the read report to current entry
+
+    iMmsClient->SwitchCurrentEntryL( originalEntry );
+    op = iMmsClient->SendReadReportL( originalEntry, iWait->iStatus, EMmsReadStatusRead );
+    CleanupStack::PushL(op);
+    iWait->Start();
+
+    while (iWait->iStatus.Int() == KRequestPending )
+        {
+        if (!iTimer->IsActive())
+            {
+            iTimer->IssueRequest();
+            }
+        CActiveScheduler::Start();
+        }
+
+    if ( iWait->iStatus.Int() != KErrNone )
+        {
+        //TMmsLogger::Log(_L("Testbed tried to send read report, return status %d"), iWait->iStatus.Int());
+        }
+
+    iTimer->Cancel();
+    CleanupStack::PopAndDestroy( op );
+    op = NULL;
+
+/*
+    cEntry->SetEntryL( originalEntry );
+    iMmsHeaders->Reset();
+    CMsvStore* store = cEntry->ReadStoreL();
+    CleanupStack::PushL( store );
+    iMmsHeaders->RestoreL( *store );
+    CleanupStack::PopAndDestroy( store );
+    store = NULL;
+    HBufC8* messageId = HBufC8::NewL( iMmsHeaders->MessageId().Length() );
+    CleanupStack::PushL( messageId );
+    messageId->Des().Copy( iMmsHeaders->MessageId() );
+
+    iMmsClient->SwitchCurrentEntryL( originalEntry );
+    iMmsClient->LoadMessageL();
+
+    iMmsHeaders->Reset();
+    iMmsHeaders->SetMessageType( KMmsMessageTypeReadRecInd );
+    // Message id cannot be accessed via MMS Client MTM!
+
+    iMmsHeaders->SetMessageIdL( messageId->Des() );
+    CleanupStack::PopAndDestroy( messageId );
+
+    iMmsHeaders->AddTypedAddresseeL( iMmsClient->Sender(), EMsvRecipientTo );
+    // sender must be insert-address-token because we don't know our number
+    TTime now;
+    now.UniversalTime();
+
+    _LIT( K1970, "19700000:000000.000000" );    // 1-Jan 1970 0:00:00
+
+    TTime y1970( K1970 );
+    TTimeIntervalMicroSeconds interval;
+    // we can't use "seconds from" as it only returns a
+    // 32 bit signed integer. If fails in 2038.
+    // "microseconds from" returns a 64 bit signed integer
+    interval = now.MicroSecondsFrom( y1970 );
+    // date in iMmsHeaders() in seconds from 1.1.1970.
+    iMmsHeaders->SetDate( (interval.Int64() ) / KMmsMillion );
+    iMmsHeaders->SetReadStatus( KMmsReadStatusRead );
+
+    TMsvId mmsFolderId = KMsvNullIndexEntryId;
+    mmsFolderId = FindMMSFolderL();
+
+    cEntry->SetEntryL( mmsFolderId );
+
+    TMsvEntry entry;
+    entry.iType = KUidMsvMessageEntry;
+    entry.iMtm = KUidMsgTypeMultimedia;
+    entry.SetVisible( ETrue );
+    entry.SetInPreparation( EFalse );
+    entry.iServiceId = KMsvLocalServiceIndexEntryId;
+    entry.iRelatedId = iDefaultServiceId;
+    entry.iMtmData1 = KMmsMessageReadRecInd;
+    cEntry->CreateL( entry );
+    TMsvId entryId = entry.Id();
+
+    cEntry->SetEntryL( entryId );
+
+    store = cEntry->EditStoreL();
+    CleanupStack::PushL( store );
+    iMmsHeaders->StoreL( *store );
+    store->CommitL();
+    CleanupStack::PopAndDestroy( store );
+    store = NULL;
+
+    CMsvEntrySelection* selection = new ( ELeave ) CMsvEntrySelection;
+    CleanupStack::PushL( selection );
+    selection->InsertL(0, entryId);
+
+    CMsvOperation * op = NULL;
+    TCommandParameters parameters; // initialized to zero
+    TCommandParametersBuf paramPack( parameters );
+
+    op = iSession->TransferCommandL(*selection,EMmsScheduledReadReport,paramPack,iWait->iStatus);
+
+    CleanupStack::PushL(op);
+    iWait->Start();
+
+    while (iWait->iStatus.Int() == KRequestPending )
+        {
+        if (!iTimer->IsActive())
+            {
+            iTimer->IssueRequest();
+            }
+        CActiveScheduler::Start();
+        }
+
+    if ( iWait->iStatus.Int() != KErrNone )
+        {
+        //TMmsLogger::Log(_L("Testbed tried to send read report, return status %d"), iWait->iStatus.Int());
+        }
+
+    iTimer->Cancel();
+
+    CleanupStack::PopAndDestroy( op );
+    CleanupStack::PopAndDestroy( selection );
+*/
+    CleanupStack::PopAndDestroy( cEntry );
+    }
+
+int MmsTestBed::fromOutboxToMmscWithMemoryFailure()
+    {
+    TInt error = KErrNone;
+    TInt messageCount = 0;
+    TInt failureCount = 0;
+    do {
+        CMsvEntry* cEntry = NULL;
+
+        // Get List of services
+        cEntry = iSession->GetEntryL(KMsvGlobalOutBoxIndexEntryIdValue);
+        CleanupStack::PushL(cEntry);
+        // Get all mms messages of outbox
+        CMsvEntrySelection* selection = cEntry->ChildrenWithMtmL( KUidMsgTypeMultimedia );
+        CleanupStack::PushL( selection );
+        failureCount++;
+        // These are failures that fail in Message server.
+        if ( failureCount >= 63 && failureCount <= 64 )
+            {
+            failureCount = 65;
+            }
+        cEntry->SetEntryL( iServiceId );
+        TMsvEntry entry = cEntry->Entry();
+        entry.iMtmData3 &= 0x0000000FF;
+        entry.iMtmData3 |= failureCount << 8;
+        cEntry->ChangeL( entry );
+
+        selection->InsertL(0, iServiceId);
+
+        CMsvOperation * op = NULL;
+        TCommandParameters parameters; // initialized to zero
+        TCommandParametersBuf paramPack( parameters );
+
+        TRAP (error, op = iSession->TransferCommandL(*selection,EMmsSend,paramPack,iWait->iStatus));
+
+        if ( error == KErrNone )
+            {
+            CleanupStack::PushL(op);
+            iWait->Start();
+
+            while (iWait->iStatus.Int() == KRequestPending )
+                {
+                if (!iTimer->IsActive())
+                    {
+                    iTimer->IssueRequest();
+                    }
+                CActiveScheduler::Start();
+                }
+
+            if ( iWait->iStatus.Int() != KErrNone )
+                {
+                error = iWait->iStatus.Int();
+                if ( iWait->iStatus.Int() != KErrNoMemory )
+                    {
+                    //TMmsLogger::Log(_L("Testbed tried to send, return status %d"), iWait->iStatus.Int());
+                    }
+                }
+
+            CleanupStack::PopAndDestroy(); // op
+            }
+        iTimer->Cancel();
+        CleanupStack::PopAndDestroy(); // selection
+        CleanupStack::PopAndDestroy(); // cEntry
+        selection = NULL;
+        cEntry = NULL;
+        cEntry = iSession->GetEntryL( KMsvGlobalOutBoxIndexEntryIdValue );
+        CleanupStack::PushL(cEntry);
+        selection = cEntry->ChildrenWithMtmL( KUidMsgTypeMultimedia );
+        messageCount = selection->Count();
+        delete selection;
+        selection = 0;
+        CleanupStack::PopAndDestroy(); //cEntry
+        }
+    while ( error == KErrNoMemory || messageCount > 0 );
+    return failureCount;
+    }
+
+int MmsTestBed::fromMmscToInboxWithMemoryFailure()
+    {
+    TInt error = KErrNone;
+    TInt failureCount = 0;
+    TInt messageCount = 0;
+    TMsvId mmsFolderId = KMsvNullIndexEntryId;
+    mmsFolderId = findMMSFolder();
+
+    do {
+        // Inbox must be cleaned if failure makes message to be fetched more than once.
+        // should not happen, but this test is quite stressful, and perfect result
+        // cannot be guaranteed.
+        // What is expected:
+        // 1. Program does not crash
+        // 2. After sufficient number of retries the message is fetched and notification deleted.
+        TMmsTestUtils::CleanBoxL(KMsvGlobalInBoxIndexEntryId, *iSession);
+        CMsvEntry* cEntry = NULL;
+        CMsvEntrySelection* msvEntrySelection = new CMsvEntrySelection;
+        CleanupStack::PushL(msvEntrySelection);
+
+        cEntry = iSession->GetEntryL(iServiceId);
+        CleanupStack::PushL(cEntry);
+
+        failureCount++;
+        // These are failures that fail in Message server.
+        if ( failureCount >= 63 && failureCount <= 64 )
+            {
+            failureCount = 65;
+            }
+        cEntry->SetEntryL( iServiceId );
+
+        TMsvEntry entry = cEntry->Entry();
+        entry.iMtmData3 &= 0x0000000FF;
+        entry.iMtmData3 |= failureCount << 8;
+        cEntry->ChangeL( entry );
+
+        // if we have a selected service, insert it into selection
+        if (iServiceId != KMsvNullIndexEntryId)
+            {
+            msvEntrySelection->InsertL(0, iServiceId);
+            }
+
+        CMsvOperation * op = NULL;
+        TCommandParameters parameters; // initialized to zero
+        TCommandParametersBuf paramPack( parameters );
+
+        TRAP (error, op = iMmsClient->InvokeAsyncFunctionL(
+            EMmsReceiveForced,
+            *msvEntrySelection,
+            paramPack,
+            iWait->iStatus) );
+
+        if ( error == KErrNone )
+            {
+            CleanupStack::PushL(op);
+            iWait->Start();
+
+            while (iWait->iStatus.Int() == KRequestPending )
+                {
+                if (!iTimer->IsActive())
+                    {
+                    iTimer->IssueRequest();
+                    }
+                CActiveScheduler::Start();
+                }
+
+            if ( iWait->iStatus.Int() != KErrNone )
+                {
+                error = iWait->iStatus.Int();
+                if ( iWait->iStatus.Int() != KErrNoMemory )
+                    {
+                    //TMmsLogger::Log(_L("Testbed tried to receive, return status %d"), iWait->iStatus.Int());
+                    }
+                }
+
+            CleanupStack::PopAndDestroy(); // op
+            }
+
+        iTimer->Cancel();
+        CleanupStack::PopAndDestroy(); // msvEntrySelection
+        CleanupStack::PopAndDestroy(); // cEntry
+        msvEntrySelection = NULL;
+        cEntry = NULL;
+        cEntry = iSession->GetEntryL( mmsFolderId );
+        CleanupStack::PushL(cEntry);
+        msvEntrySelection = cEntry->ChildrenWithMtmL( KUidMsgTypeMultimedia );
+        messageCount = msvEntrySelection->Count();
+        delete msvEntrySelection;
+        msvEntrySelection = 0;
+        CleanupStack::PopAndDestroy(); //cEntry
+        }
+    while ( error == KErrNoMemory || messageCount > 0 );
+    if ( error != KErrNoMemory && error != KErrNone )
+        {
+        //TMmsLogger::Log(_L("Memory failure loop ended with %d"), error);
+        }
+    return failureCount;
+    }
+
+void MmsTestBed::sendViaClient()
+    {
+    CMsvEntry* cEntry = NULL;
+
+    cEntry = iSession->GetEntryL(KMsvDraftEntryId);
+    CleanupStack::PushL(cEntry);
+    // Get all mms messages in drafts
+    CMsvEntrySelection* selection = cEntry->ChildrenWithMtmL( KUidMsgTypeMultimedia );
+    CleanupStack::PushL( selection );
+
+    CMsvOperation * op = NULL;
+    TTime now;
+    now.UniversalTime();
+    op = iMmsClient->SendL( *selection, iWait->iStatus, now );
+
+    CleanupStack::PushL(op);
+    iWait->Start();
+
+    while (iWait->iStatus.Int() == KRequestPending )
+        {
+        if (!iTimer->IsActive())
+            {
+            iTimer->IssueRequest();
+            }
+        CActiveScheduler::Start();
+        }
+
+    iTimer->Cancel();
+    CleanupStack::PopAndDestroy(); // op
+    CleanupStack::PopAndDestroy(2); // cEntry, selection
+    }
+
+void MmsTestBed::scheduledFetch(TInt aDelay /* = 5 */)
+    {
+    TCommandParameters parameters;
+    parameters.iInitialDelay = aDelay;
+    TCommandParametersBuf paramPack( parameters );
+
+    CMsvEntrySelection* selection = new CMsvEntrySelection;
+    CleanupStack::PushL( selection );
+    // if we have a selected service, insert it into selection
+    if (iServiceId != KMsvNullIndexEntryId)
+        {
+        selection->InsertL(0, iServiceId);
+        }
+    else
+        {
+        selection->InsertL(0, iDefaultServiceId);
+        }
+
+    CMsvOperation * op = NULL;
+    op = iMmsClient->InvokeAsyncFunctionL(
+        EMmsScheduledReceive,
+        *selection,
+        paramPack,
+        iWait->iStatus);
+
+    CleanupStack::PushL(op);
+    iWait->Start();
+
+    while (iWait->iStatus.Int() == KRequestPending )
+        {
+        if (!iTimer->IsActive())
+            {
+            iTimer->IssueRequest();
+            }
+        CActiveScheduler::Start();
+        }
+
+    iTimer->Cancel();
+    CleanupStack::PopAndDestroy(); // op
+    CleanupStack::PopAndDestroy(); // selection
+    }
+
+void MmsTestBed::fetchForcedImmediate()
+    {
+    TCommandParameters parameters;
+    TCommandParametersBuf paramPack( parameters );
+
+    CMsvEntrySelection* selection = new CMsvEntrySelection;
+    CleanupStack::PushL( selection );
+    // if we have a selected service, insert it into selection
+    if (iServiceId != KMsvNullIndexEntryId)
+        {
+        selection->InsertL(0, iServiceId);
+        }
+    else
+        {
+        selection->InsertL(0, iDefaultServiceId);
+        }
+
+
+    CMsvOperation * op = NULL;
+    op = iMmsClient->InvokeAsyncFunctionL(
+        EMmsReceiveForced,
+        *selection,
+        paramPack,
+        iWait->iStatus);
+
+    CleanupStack::PushL(op);
+    iWait->Start();
+
+    while (iWait->iStatus.Int() == KRequestPending )
+        {
+        if (!iTimer->IsActive())
+            {
+            iTimer->IssueRequest();
+            }
+        CActiveScheduler::Start();
+        }
+
+    iTimer->Cancel();
+    CleanupStack::PopAndDestroy(); // op
+    CleanupStack::PopAndDestroy(); // selection
+    }
+
+void MmsTestBed::getEventType()
+    {
+    if ( !checkLogClient() )
+        {
+        return; // not available
+        }
+
+    CLogEventType* eventType = CLogEventType::NewL();
+    CleanupStack::PushL( eventType );
+    eventType->SetUid(iLogEvent->EventType());
+    iLogClient->GetEventType( *eventType, iWait->iStatus );
+
+    iWait->Start();
+    CleanupStack::PopAndDestroy(); // eventType
+    }
+
+void MmsTestBed::addEventType()
+    {
+    if ( !checkLogClient() )
+        {
+        return; // not available
+        }
+
+    CLogEventType* eventType = CLogEventType::NewL();
+    CleanupStack::PushL( eventType );
+    eventType->SetUid(iLogEvent->EventType());
+    eventType->SetDescription(_L("Multimedia Message") );
+    eventType->SetLoggingEnabled( ETrue );
+
+//    iWait->iStatus = KRequestPending;
+    iLogClient->AddEventType( *eventType, iWait->iStatus );
+    iWait->Start();
+    CleanupStack::PopAndDestroy(); // eventType
+    }
+
+void MmsTestBed::deleteEventType()
+    {
+    if ( !checkLogClient() )
+        {
+        return; // not available
+        }
+//    iWait->iStatus = KRequestPending;
+    iLogClient->DeleteEventType( iLogEvent->EventType(), iWait->iStatus );
+    iWait->Start();
+    }
+
+void MmsTestBed::cleanLog()
+    {
+    TInt count = 0;
+
+    count = getLogEntries();
+
+    TInt i;
+    for ( i = 0; i < count; ++i )
+        {
+        // when a view is created, it will be positioned on the first event
+//        iWait->iStatus = KRequestPending;
+        iLogClient->DeleteEvent(iLogView->Event().Id(), iWait->iStatus);
+        iWait->Start();
+
+        if ( iLogView->NextL( iWait->iStatus ) )
+            {
+            // should complete with KErrNone
+            iWait->Start();
+            if ( iWait->iStatus.Int() != KErrNone )
+                {
+                // could not get next event!
+                break;
+                }
+            }
+        else
+            {
+            break; // no more events!
+            }
+        }
+    }
+
+void MmsTestBed::setOnline(bool value)
+    {
+    //value = true for online mode
+    //value = false for offline mode
+    CRepository* repository = NULL;
+    TInt retval = KErrNone;
+    TRAP( retval, repository = CRepository::NewL( KCRUidCoreApplicationUIs ) );
+    if( retval == KErrNone )
+        {
+        repository->Set( KCoreAppUIsNetworkConnectionAllowed, value );
+        delete repository;
+        }
+    }
+
+void MmsTestBed::generateDeliveryReport( CMmsHeaders* aMmsHeaders )
+    {
+    iEncodeBuffer->ResizeL( 1024 );
+
+    TInt position = 0;
+
+    // encode message type
+    iEncodeBuffer->Write( position, &KMmsAssignedMessageType, 1 );
+    position++;
+    iEncodeBuffer->Write( position, &KMmsMessageTypeDeliveryInd, 1 );
+    position++;
+
+    // version
+    iEncodeBuffer->Write( position, &KMmsAssignedMmsVersion, 1 );
+    position++;
+
+    TUint8 version = aMmsHeaders->MmsVersion() | 0x80; // current version as short integer
+    iEncodeBuffer->Write( position, &version, 1 );
+    position++;
+
+    // message id from the headers
+    // At least once MMSC did not send us the message id!
+    // if message id is missing, we cannot match the entry!
+    // This only a fake. Real delivery reports should always
+    // contain the message id.
+    if ( aMmsHeaders->MessageId().Length() > 0 )
+        {
+        iEncodeBuffer->Write( position, &KMmsAssignedMessageId, 1 );
+        position++;
+        iEncodeBuffer->Write( position, &(aMmsHeaders->MessageId()[0]), aMmsHeaders->MessageId().Length() );
+        position += aMmsHeaders->MessageId().Length();
+        iEncodeBuffer->Write( position, &KMmsNull, 1 );
+        position++;
+        }
+
+    // To is taken from the headers
+    iEncodeBuffer->Write( position, &KMmsAssignedTo, 1 );
+    position++;
+
+    TPtrC recipient;
+    if ( aMmsHeaders->ToRecipients().MdcaCount() > 0 &&
+        aMmsHeaders->ToRecipients()[0].Length() > 0 )
+        {
+        recipient.Set( aMmsHeaders->ToRecipients()[0] );
+        }
+    else if( aMmsHeaders->CcRecipients().MdcaCount() > 0 &&
+        aMmsHeaders->CcRecipients()[0].Length() > 0 )
+        {
+        recipient.Set( aMmsHeaders->CcRecipients()[0] );
+        }
+    else if( aMmsHeaders->BccRecipients().MdcaCount() > 0 &&
+        aMmsHeaders->BccRecipients()[0].Length() > 0 )
+        {
+        recipient.Set( aMmsHeaders->BccRecipients()[0] );
+        }
+    else
+        {
+        recipient.Set( _L("Jasso-Kissa@jii.fi") );
+        }
+
+    TMmsAddressType addressType = EMmsAddressTypeUnknown;
+
+    if ( recipient.Find( KMiuMau ) != KErrNotFound )
+        {
+        addressType = EMmsAddressTypeEmail;
+        }
+    else
+        {
+        addressType = EMmsAddressTypeMobile;
+        }
+
+    TUint8 character;
+    TInt i;
+    if ( addressType == EMmsAddressTypeEmail )
+        {
+        // email address - ASCII ONLY - THIS IS JUST A TEST!
+
+        for ( i = 0; i < recipient.Length(); ++i )
+            {
+            character = TUint8( recipient[i] & 0xff );
+            iEncodeBuffer->Write( position, &character, 1 );
+            position++;
+            }
+        iEncodeBuffer->Write( position, &KMmsNull, 1 );
+        position++;
+
+        }
+    else
+        {
+        // must be a phone number
+        // We expect for now that the format is correct as is
+        // All legal characters present in a phone number are ASCII
+
+        TInt i;
+        for ( i = 0; i < recipient.Length(); ++i )
+            {
+            character = TUint8( recipient[i] & 0xff );
+            iEncodeBuffer->Write( position, &character, 1 );
+            position++;
+            }
+        iEncodeBuffer->Write( position, KMmsPlmn, KMmsPlmnLength );
+        position += KMmsPlmnLength;
+        iEncodeBuffer->Write( position, &KMmsNull, 1 );
+        position++;
+        }
+
+    // date
+    iEncodeBuffer->Write( position, &KMmsAssignedDate, 1 );
+    position++;
+
+    TLocale locale;
+    locale.Refresh();
+    TInt64 UtcDate;
+    TTimeIntervalSeconds universalTimeOffset( locale.UniversalTimeOffset() );
+
+    TTime now;
+    now.UniversalTime();
+    UtcDate = ( now.MicroSecondsFrom( TTime( KMmsYear1970String ) ).Int64() ) / 1000000 ;
+
+    UtcDate -= universalTimeOffset.Int();
+
+    if ( locale.QueryHomeHasDaylightSavingOn() )
+        {
+        TTimeIntervalSeconds daylightSaving( 60 * 60 );
+        UtcDate -= daylightSaving.Int();
+        }
+
+    TUint8 len; // number of bytes we will need
+    len = 0;
+    TUint8 array[8];
+
+    TInt64 temp = UtcDate;
+
+    for (i = 7; i >= 0; --i)
+        {
+        array[i] = TInt8( ( I64INT( temp ) ) & 0xFF );
+        I64LSR( temp, 8 );
+        }
+
+    len = 8;
+    i = 0;
+    while( ( array[i]== 0 ) && ( i < 8 ) )
+        {
+        i++;
+        len--;
+        }
+
+    // a zero should be coded as short integer.
+    // However, if there is a valid reason to code a zero as a long integer,
+    // we allow it. The caller should know what he is doing.
+    if ( len == 0 )
+        {
+        len = 1;
+        }
+    // write short length
+    iEncodeBuffer->Write( position, &len, 1 );
+    position++;
+    // write as many bytes as were non-zero
+    iEncodeBuffer->Write( position, &(array[8 - len] ), len );
+    position+= len;
+    // status
+    iEncodeBuffer->Write( position, &KMmsAssignedStatus, 1 );
+    position++;
+    iEncodeBuffer->Write( position, &KMmsMessageStatusRetrieved, 1 );
+    position++;
+    // DONE!!!
+    iEncodeBuffer->ResizeL( position );
+    return;
+    }
+
+void MmsTestBed::sendDeliveryReport()
+    {
+    if ( iEncodeBuffer->Size() == 0 )
+        {
+        //No delivery report
+        return;
+        }
+
+
+    TMsvId mmsFolder = findMMSFolder();
+    CMsvEntrySelection* selection = new (ELeave) CMsvEntrySelection;
+    CleanupStack::PushL( selection );
+
+    TMsvId entryId = TMmsTestUtils::CreateNotificationEntryL( mmsFolder, iServiceId, iEncodeBuffer, *iSession );
+    TPtr8 ptr = iEncodeBuffer->Ptr( 0 );
+
+    // Now we have streamed our data into this entry.
+    // Now we have an entry that says: local service, MMS MTM
+
+    if ( entryId != KMsvNullIndexEntryId )
+        {
+        selection->AppendL( entryId );
+        }
+    else
+        {
+        selection->AppendL( iDefaultServiceId );
+        }
+
+    TWatcherParameters parameters; // initialized to zero
+    parameters.iWatcherId = RThread().Id();
+    parameters.iDataPointer = &ptr;
+    TWatcherParametersBuf paramPack( parameters );
+
+    CMsvOperation * op = NULL;
+
+//    iWait->iStatus = KRequestPending;
+    op = iSession->TransferCommandL(
+        *selection, EMmsDecodePushedMessage, paramPack, iWait->iStatus );
+    CleanupStack::PushL(op);
+    iWait->Start();
+
+    while (iWait->iStatus.Int() == KRequestPending )
+        {
+        if (!iTimer->IsActive())
+            {
+            iTimer->IssueRequest();
+            }
+        CActiveScheduler::Start();
+        }
+
+    iTimer->Cancel();
+
+    CleanupStack::PopAndDestroy(); // op
+    CleanupStack::PopAndDestroy(); // selection
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/msguiutils/tsrc/unittest_msguiutils/mmstestbed/src/mmsteststaticutils.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,528 @@
+/*
+ * 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 <f32file.h>
+#include <centralrepository.h>
+#include <apparc.h>
+#include <msvapi.h>
+#include <msvids.h>
+
+#include "mmsteststaticutils.h"
+#include "mmsconst.h"
+#include "MmsEnginePrivateCRKeys.h"
+#include "mmssettings.h"
+#include "mmsheaders.h"
+#include "mmsservercommon.h"
+#include "mmsencode.h"
+
+
+// ---------------------------------------------------------
+//
+// ---------------------------------------------------------
+//
+TMmsJoinedArrays::TMmsJoinedArrays(CDesCArray* const & aArray1, CDesCArray* const & aArray2)
+: iArray1(aArray1), iArray2(aArray2)
+    {
+    }
+
+TInt TMmsJoinedArrays::MdcaCount() const
+    {
+    TInt count=0;
+    if (iArray1)
+        count += iArray1->MdcaCount();
+    if (iArray2)
+        count += iArray2->MdcaCount();
+    return count;
+    }
+
+TPtrC16 TMmsJoinedArrays::MdcaPoint(TInt aIndex) const
+    {
+    if (iArray1)
+        {
+        if (aIndex < iArray1->MdcaCount())
+            return iArray1->MdcaPoint(aIndex);
+        else
+            aIndex -= iArray1->MdcaCount();
+        }
+    return iArray2->MdcaPoint(aIndex);
+    }
+
+
+// ---------------------------------------------------------
+//
+// ---------------------------------------------------------
+//
+TMmsTestUtils::TMmsTestUtils()
+    {
+
+    }
+
+// ---------------------------------------------------------
+//
+// ---------------------------------------------------------
+//
+HBufC* TMmsTestUtils::ReadContactFromFileL( TDesC& aFileName, RFs& aFs )
+    {
+    RFile file;
+    TInt error = KErrNone;
+
+    TInt textBufferSize = 256;
+    HBufC* textBuffer = HBufC::NewL( textBufferSize );
+    TPtr textPtr = textBuffer->Des();
+    TFileText textFile;
+
+    error = file.Open( aFs, aFileName,
+            EFileRead|EFileShareReadersOnly );
+
+    if ( error == KErrNone )
+        {
+        textFile.Set( file );
+        error = textFile.Seek( ESeekStart );
+        }
+
+    if ( error == KErrNone )
+        {
+        error = textFile.Read( textPtr );
+        }
+
+    file.Close();
+
+    if ( textBuffer->Des().Find( &KMmsByteOrderMark, 1 ) == 0 )
+        {
+        textBuffer->Des().Copy( textBuffer->Des().Mid( 1 ) );
+        }
+
+    return textBuffer;
+    }
+
+//----------------------------------------------------------------------------------------
+// turn on detailed logging while decoding a message
+//----------------------------------------------------------------------------------------
+//
+void TMmsTestUtils::DecodeLoggingOnL()
+    {
+    // CenRep for decodelogging
+    CRepository* repository = NULL;
+    TInt retval = KErrNone;
+    TRAP( retval, repository = CRepository::NewL( KUidMmsServerMtm ) );
+    if( retval == KErrNone )
+        {
+        // Best effort - if cannot access repository, no can do
+        TInt temp = 1;
+        repository->Set( KMmsEngineDecodeLog, temp );
+        delete repository;
+        }
+    }
+
+//----------------------------------------------------------------------------------------
+// turn off detailed logging while decoding a message
+//----------------------------------------------------------------------------------------
+//
+void TMmsTestUtils::DecodeLoggingOffL()
+    {
+    // CenRep for decodelogging
+    CRepository* repository = NULL;
+    TInt retval = KErrNone;
+    TRAP( retval, repository = CRepository::NewL( KUidMmsServerMtm ) );
+    if( retval == KErrNone )
+        {
+        // Best effort - if cannot access repository, no can do
+        TInt temp = 0;
+        repository->Set( KMmsEngineDecodeLog, temp );
+        delete repository;
+        }
+
+    }
+
+//----------------------------------------------------------------------------------------
+// turn on binary dump of incoming messages
+//----------------------------------------------------------------------------------------
+//
+void TMmsTestUtils::BinaryDumpOnL()
+    {
+    // CenRep for binarydump setting
+    CRepository* repository = NULL;
+    TInt retval = KErrNone;
+    TRAP( retval, repository = CRepository::NewL( KUidMmsServerMtm ) );
+    if( retval == KErrNone )
+        {
+        // Best effort - if cannot access repository, no can do
+        TInt temp = 1;
+        repository->Set( KMmsEngineBinaryDump, temp );
+        delete repository;
+        }
+
+    }
+
+//----------------------------------------------------------------------------------------
+// turn off binary dump of incoming messages
+//----------------------------------------------------------------------------------------
+//
+void TMmsTestUtils::BinaryDumpOffL()
+    {
+    // CenRep for binarydump setting
+    CRepository* repository = NULL;
+    TInt retval = KErrNone;
+    TRAP( retval, repository = CRepository::NewL( KUidMmsServerMtm ) );
+    if( retval == KErrNone )
+        {
+        // Best effort - if cannot access repository, no can do
+        TInt temp = 0;
+        repository->Set( KMmsEngineBinaryDump, temp );
+        delete repository;
+        }
+    }
+
+// ---------------------------------------------------------
+//
+// ---------------------------------------------------------
+//
+void TMmsTestUtils::CleanDirectoryL( RFs& aFs )
+    {
+    // Delete the files in the directory
+    CFileMan* fileMan = CFileMan::NewL( aFs );
+    CleanupStack::PushL( fileMan );
+    fileMan->RmDir( KMmsDefaultLocalModeDir );
+    fileMan->RmDir( KMmsMMBoxDirectory );
+    fileMan->RmDir( KMmsMMBoxDescriptionDirectory );
+    CleanupStack::PopAndDestroy(); // fileManager
+    // we don't want to throw these away!
+    aFs.MkDirAll( KMmsDefaultLocalModeDir );
+    aFs.MkDirAll( KMmsMMBoxDirectory );
+    aFs.MkDirAll( KMmsMMBoxDescriptionDirectory );
+    }
+
+// ---------------------------------------------------------
+//
+// ---------------------------------------------------------
+//
+void TMmsTestUtils::Dump( CBufFlat& aBuffer, TFileName& aFilename, TParse& aParse, RFs& aFs )
+    {
+    TInt error = KErrNone;
+    aFs.MkDirAll( aFilename );
+    TUint att;
+    if ( aFs.Att( aFilename, att ) == KErrNone )
+        {
+        _LIT( KRelated, "dump.mms");
+        aParse.Set( aFilename, &KRelated, NULL );
+        aFilename = aParse.FullName();
+        error = CApaApplication::GenerateFileName( aFs, aFilename );
+        if ( error == KErrNone )
+            {
+            RFile file;
+            error = file.Create( aFs, aFilename, EFileWrite | EFileShareExclusive );
+            // for message id generation
+            aParse.Set( aFilename, NULL, NULL );
+            if ( error == KErrNone )
+                {
+                // the data is supposed to be in the encode buffer
+                TPtr8 ptr = aBuffer.Ptr( 0 );
+                file.Write( ptr );
+                file.Flush();
+                }
+
+            // done - close files
+            file.Close();
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+//
+// ---------------------------------------------------------
+//
+void TMmsTestUtils::CleanBoxL(TMsvId aBoxId, CMsvSession& aSession)
+    {
+    CMsvEntry* cEntry = NULL;
+    // delete all messages from the specified box
+    cEntry = aSession.GetEntryL(KMsvRootIndexEntryId);
+    CleanupStack::PushL(cEntry);
+    cEntry->SetEntryL(aBoxId);
+    // show invisible entries
+    cEntry->SetSortTypeL( TMsvSelectionOrdering( KMsvNoGrouping, EMsvSortByNone, ETrue ) );
+    CMsvEntrySelection* msvEntrySelection = cEntry->ChildrenWithMtmL(KUidMsgTypeMultimedia);
+    CleanupStack::PushL(msvEntrySelection);
+
+    CMsvEntrySelection* selection = NULL;
+    cEntry->SetSortTypeL( TMsvSelectionOrdering( KMsvNoGrouping, EMsvSortByNone, ETrue ) );
+    selection = cEntry->ChildrenWithMtmL(KUidMsgMMSNotification);
+    CleanupStack::PushL( selection );
+    if ( selection->Count() > 0 )
+        {
+        msvEntrySelection->AppendL( selection->Back( 0 ), selection->Count() );
+        }
+    CleanupStack::PopAndDestroy(); // selection
+
+    int i;
+    for (i = 0; i < msvEntrySelection->Count(); ++i)
+        {
+        CMsvEntry* entry = aSession.GetEntryL( msvEntrySelection->At(i) );
+        CleanupStack::PushL( entry );
+        TMsvEntry tEntry = entry->Entry();
+        tEntry.SetReadOnly(EFalse);
+        entry->ChangeL(tEntry);
+        cEntry->DeleteL( msvEntrySelection->At(i) );
+        CleanupStack::PopAndDestroy( entry );
+        }
+
+    CleanupStack::PopAndDestroy(msvEntrySelection);
+    CleanupStack::PopAndDestroy(cEntry);
+    }
+
+//----------------------------------------------------------------------------------------
+// turn on logging email recipients
+//----------------------------------------------------------------------------------------
+void TMmsTestUtils::EmailLoggingOnL()
+    {
+    // CenRep for binarydump setting
+    CRepository* repository = NULL;
+    TInt retval = KErrNone;
+    TRAP( retval, repository = CRepository::NewL( KUidMmsServerMtm ) ); // ***
+    if( retval == KErrNone )
+        {
+        TInt temp = 1;
+        repository->Set( KMmsEngineLogEmailRecipients, temp );
+        delete repository;
+        }
+
+    }
+
+//----------------------------------------------------------------------------------------
+// turn off logging email recipients
+//----------------------------------------------------------------------------------------
+void TMmsTestUtils::EmailLoggingOffL()
+    {
+    // CenRep for binarydump setting
+    CRepository* repository = NULL;
+    TInt retval = KErrNone;
+    TRAP( retval, repository = CRepository::NewL( KUidMmsServerMtm ) ); // ***
+    if( retval == KErrNone )
+        {
+        TInt temp = 0;
+        repository->Set( KMmsEngineLogEmailRecipients, temp );
+        delete repository;
+        }
+
+    }
+
+//----------------------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------------------
+TInt TMmsTestUtils::CountChildrenL(TMsvId aBoxId, CMsvEntrySelection*& aMsvEntrySelection, CMsvSession& aSession, TUid aMessageType )
+    {
+    CMsvEntry* cEntry = aSession.GetEntryL(KMsvRootIndexEntryId);
+    CleanupStack::PushL(cEntry);
+    cEntry->SetEntryL(aBoxId);
+    if (aMsvEntrySelection != NULL)
+        {
+        delete aMsvEntrySelection;
+        aMsvEntrySelection = NULL;
+        }
+    aMsvEntrySelection = cEntry->ChildrenWithMtmL(aMessageType);
+    CleanupStack::PopAndDestroy(); // cEntry
+    return aMsvEntrySelection->Count();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CreateFolderEntryL
+//
+// -----------------------------------------------------------------------------
+//
+void TMmsTestUtils::CreateFolderEntryL(
+    CMsvSession& aSession,
+    TMsvId aParentFolder,
+    const TDesC& aFolderName,
+    TMsvId& aFolderId )
+    {
+    aFolderId = KMsvNullIndexEntryId;
+    CMsvEntry* cEntry = aSession.GetEntryL( aParentFolder );
+    CleanupStack::PushL( cEntry );
+
+    // Create a new folder.
+
+    TMsvEntry entry;
+    entry.iType = KUidMsvFolderEntry;
+    entry.iMtm = KUidMsvLocalServiceMtm;
+    entry.iDetails.Set( aFolderName );
+    entry.SetVisible( EFalse );
+    entry.SetInPreparation( EFalse );
+    entry.iServiceId = KMsvLocalServiceIndexEntryId;
+    cEntry->CreateL( entry );
+    aFolderId = entry.Id();
+    CleanupStack::PopAndDestroy( cEntry );
+
+    }
+
+
+//----------------------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------------------
+TMsvId TMmsTestUtils::CreateNotificationEntryL(
+        TMsvId aNotificationFolder,
+        TMsvId aServiceId,
+        CBufFlat* aEncodeBuffer,
+        CMsvSession& aSession )
+    {
+    TMsvId entryId = KMsvNullIndexEntryId;
+    if ( aNotificationFolder == KMsvNullIndexEntryId )
+        {
+        // no folder no entry
+        return entryId;
+        }
+
+    CMsvEntry* cEntry = aSession.GetEntryL( aNotificationFolder );
+    CleanupStack::PushL(cEntry);
+
+    TMsvEntry entry;
+    entry.iType = KUidMsvMessageEntry;
+    entry.iMtm = KUidMsgTypeMultimedia;
+    entry.SetVisible( ETrue );
+    // If we want to put data here, InPreparation must be set to true first
+    entry.SetInPreparation( EFalse );
+    entry.iServiceId = KMsvLocalServiceIndexEntryId;
+    entry.iRelatedId = aServiceId;
+    entry.iMtmData2 = KMmsNotificationBinary;
+    cEntry->CreateL( entry );
+    entryId = entry.Id();
+
+    //
+    // Stream
+    // 1) length of the data as 32 bit integer
+    // 2) pushed message data
+    // into created entry's stream
+    //
+    cEntry->SetEntryL( entryId );
+    CMsvStore* store = cEntry->EditStoreL();
+    CleanupStack::PushL( store );   // ***
+    RMsvWriteStream outs;
+    outs.AssignLC( *store, KUidBinaryNotificationStream ); // ***
+    TPtrC8 ptr = aEncodeBuffer->Ptr( 0 );
+    outs.WriteUint32L( ptr.Length() );
+    outs.WriteL( ptr );
+    outs.CommitL();
+    outs.Close();
+    store->CommitL();
+
+    CleanupStack::PopAndDestroy( &outs ); // close outs
+    CleanupStack::PopAndDestroy( store );
+    CleanupStack::PopAndDestroy( cEntry );
+
+    return entryId;
+
+    }
+
+//----------------------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------------------
+void TMmsTestUtils::FormNotification(
+        TDesC8& aUrl,
+        TInt aSize,
+        CMmsHeaders& aMmsHeaders,
+        CMmsEncode& aMmsEncoder,
+        CBufFlat* aEncodeBuffer )
+    {
+    // for test purposes aUrl will contain the filename.
+
+    // Reset sets the default encapsulation version
+    // The default version has been set from MmsSettings in NewL
+    aMmsHeaders.Reset();
+
+    // construct the notification into iMmsHeaders, and call encode
+
+    aMmsHeaders.SetMessageType( KMmsMessageTypeMNotificationInd );
+
+    TTime currentTime;
+    currentTime.UniversalTime();
+    currentTime.Int64();
+
+    TPtrC8 tid;
+    TBufC8<KMMSMAXTIDLENGTH> target;
+    TInt random = 0;
+
+    // we don't generate a true random TID: We generate the
+    // TID from the URL so that if we generate a notification
+    // twice from the same file, we get the same TID and the
+    // same URL. This way we can test the pruning function in
+    // server MTM
+
+    TInt i;
+    for ( i = 0; i < aUrl.Length(); ++i )
+        {
+        random += aUrl[ i ];
+        }
+
+    target.Des().Num( random );
+    tid.Set( target.Des() );
+    aMmsHeaders.SetTidL( tid );
+
+    aMmsHeaders.SetMessageClass( EMmsClassPersonal );
+    aMmsHeaders.SetMessageSize( aSize );
+    const TInt KTenHours = 10 * 60 * 60; // 10 hours relative expiry
+    aMmsHeaders.SetExpiryInterval( KTenHours );
+    aMmsHeaders.SetContentLocationL( aUrl );
+
+    aMmsEncoder.EncodeHeadersL( aMmsHeaders, *aEncodeBuffer );
+
+    }
+
+
+//----------------------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------------------
+TBool TMmsTestUtils::IsFile(const TDesC& aFileName, RFs& aFs)
+    {
+    //Is the name a file?
+    if (IsDrive(aFileName))
+        return EFalse;
+    return !(IsDir(aFileName, aFs));
+    }
+
+//----------------------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------------------
+TBool TMmsTestUtils::IsDir(const TDesC& aFileName, RFs& aFs)
+    {
+    //Is the name a directory?
+    TEntry entry;
+    TInt err = aFs.Entry(aFileName, entry);
+    if (err)
+        return EFalse;
+    else
+        return entry.IsDir();
+    }
+
+//----------------------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------------------
+TBool TMmsTestUtils::IsDrive(const TDesC& aFileName)
+    {
+    //horrible little function to figure if the path is just a drive
+    TBool retVal = EFalse;
+    if (aFileName.Length()==3) //eg "c:\"
+        {
+        if ((aFileName[1] == ':')  && (aFileName[2] == '\\'))
+            retVal=ETrue;
+        }
+    else if (aFileName.Length()==2) //eg "c:"
+        {
+        if (aFileName[1] == ':')
+            retVal=ETrue;
+        }
+    return retVal;
+    }
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/msguiutils/tsrc/unittest_msguiutils/mmstestbed/src/mmstestuitimer.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,121 @@
+/*
+ * 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 "mmstestuitimer.h"
+
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CTestUiTimer::CTestUiTimer(): CTimer( 5 )
+    {
+    period = KPeriod;
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CTestUiTimer::ConstructL()
+    {
+    CTimer::ConstructL();
+    CActiveScheduler::Add(this);
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CTestUiTimer* CTestUiTimer::NewL()
+    {
+    CTestUiTimer* self = new(ELeave) CTestUiTimer();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CTestUiTimer::~CTestUiTimer()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CTestUiTimer::IssueRequest()
+    {
+    // No operation to cancel if this function is called
+    iObject = NULL;
+    After(period);
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CTestUiTimer::TimeoutOperation( CActive* aObject, TTimeIntervalSeconds aTimeoutInSeconds )
+    {
+    iObject = aObject;
+    TTimeIntervalMicroSeconds32 timeout = aTimeoutInSeconds.Int() * 1000000;
+    After( timeout );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CTestUiTimer::DoCancel()
+    {
+    CTimer::DoCancel();
+    if ( iObject )
+        {
+        iObject->Cancel();
+        iObject = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CTestUiTimer::RunL()
+    {
+    if ( iObject )
+        {
+        // If we timeout while holding an active object, we cancel it
+        iObject->Cancel();
+        iObject = NULL;
+        }
+    else
+        {
+        CActiveScheduler::Stop();
+        }
+    }
+
+// ======== GLOBAL FUNCTIONS ========
+
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditoraddress.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditoraddress.h	Fri Sep 17 08:28:39 2010 +0300
@@ -62,7 +62,7 @@
      * setter method to set address
      * @param addrlist, list of addresses to be set in address editor
      */
-    void setAddresses(ConvergedMessageAddressList addrlist);
+    void setAddresses(ConvergedMessageAddressList addrlist,bool aSkipCheck=FALSE);
 
     /**
      * Get amount of digits to be used in contact matching
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditorattachment.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorattachment.h	Fri Sep 17 08:28:39 2010 +0300
@@ -112,11 +112,6 @@
 	 * slot to open attachment
 	 */
     void handleOpen();
-
-	/**
-	 * slot to view details of the attachment file
-	 */
-    void viewDetails();
     
     /**
      * Slot to regrab gesture after some delay (300 ms) to avoid multiple gesture
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditorattachmentcontainer.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorattachmentcontainer.h	Fri Sep 17 08:28:39 2010 +0300
@@ -91,7 +91,7 @@
      */
     void emptyAttachmentContainer();
     
-private slots:
+public slots:
     /**
      * delete attachment from the container
      */
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditorbody.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorbody.h	Fri Sep 17 08:28:39 2010 +0300
@@ -116,6 +116,12 @@
         return mIsImageResizing;
         }
 
+    /**
+     * remove media content.called when file is not avaialable
+     * @param fileName file name
+     */
+    void removeMediaContent(QString fileName);
+    
 public slots:
     /**
      * Called to insert image content in editor.
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditorlineedit.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorlineedit.h	Fri Sep 17 08:28:39 2010 +0300
@@ -98,6 +98,10 @@
     int mSelectionStart;
     int mSelectionEnd;
     bool mDefaultBehaviour;
+    
+#ifdef MSGUI_UNIT_TEST
+    friend class TestMsgUnifiedEditorLineEdit;
+#endif
 };
 
 #endif // MSG_UNIFIED_EDITOR_LINEEDIT_H
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditorpixmapwidget.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorpixmapwidget.h	Fri Sep 17 08:28:39 2010 +0300
@@ -89,11 +89,6 @@
     void handleRemove(); 
     
     /**
-     * Handles opening of details view.
-     */
-    void viewDetails();
-    
-    /**
      * Slot to regrab gesture after some delay (300 ms) to avoid multiple gesture
      * events back to back.  
      */
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditorsubject.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorsubject.h	Fri Sep 17 08:28:39 2010 +0300
@@ -118,6 +118,10 @@
      * Holds the previous buffer inside subject field
      */
     QString mPrevBuffer;
+    
+#ifdef MSGUI_UNIT_TEST
+    friend class TestMsgUnifiesEditorSubject;
+#endif
     };
 
 #endif //MSG_UNIFIED_EDITOR_SUBJECT_H
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditorview.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorview.h	Fri Sep 17 08:28:39 2010 +0300
@@ -18,10 +18,14 @@
 #ifndef MSG_UNIFIED_EDITOR_VIEW_H
 #define MSG_UNIFIED_EDITOR_VIEW_H
 
-#ifdef UNIFIEDEDITOR_DLL
-#define UNIFIEDEDITOR_EXPORT Q_DECL_EXPORT
+#ifdef MSGUI_UNIT_TEST
+ #define UNIFIEDEDITOR_EXPORT
 #else
-#define UNIFIEDEDITOR_EXPORT Q_DECL_IMPORT
+ #ifdef UNIFIEDEDITOR_DLL
+  #define UNIFIEDEDITOR_EXPORT Q_DECL_EXPORT
+ #else
+  #define UNIFIEDEDITOR_EXPORT Q_DECL_IMPORT
+ #endif
 #endif
 
 #include "msgbaseview.h"
@@ -42,6 +46,7 @@
 class HbAbstractVkbHost;
 class MsgUnifiedEditorBaseWidget;
 class HbListWidget;
+class MsgAudioFetcherDialog;
 
 class UNIFIEDEDITOR_EXPORT MsgUnifiedEditorView : public MsgBaseView
     {
@@ -77,6 +82,14 @@
      */
     int saveContentToDrafts();
     
+    /**
+     * Event handler
+     * @param key Key code
+     * @return true if key event handled else false.
+     * @see MsgBaseView
+     */
+    bool handleKeyEvent(int key);
+
 protected:
     /**
      * reimplemented from base class to provide proper geometry for scrolling.
@@ -100,8 +113,9 @@
      * @param [OUT]msg, converged message to hold editor data
      * @param isSave, flag to indicate that msg needs to be packed
      * for saving to draft or not
+     * @return returns error if something fails
      */
-    void packMessage(ConvergedMessage &msg, bool isSave=false);
+    int packMessage(ConvergedMessage &msg, bool isSave=false);
 
     /**
      * Populate editor with prepopulated msg content
@@ -337,8 +351,21 @@
       * This slot is triggered when vkb is about to be closed.
       */
      void vkbAboutToClose();
+     
+     /** 
+      * This slot is called after sound clip is 
+      * selected from audio fetcher dialog    
+      */
+     void onAudioSelected(QString& filePath);
+	 
+	 /**
+      * Check if the reply-path is broken
+      * @return bool, true if reply-path constraints are broken
+      */
+     bool isReplyPathBroken();
     
 private:
+     
     HbAction* mSubjectAction;
     HbAction* mCcBccAction;
     HbAction* mSendAction;
@@ -369,6 +396,29 @@
      */
 	HbAbstractVkbHost* mVkbHost;
 	
+	/**
+	 * Instance of Audio Fetcher Dialog
+	 * Need to show when attachment audio selected
+	 */
+	MsgAudioFetcherDialog* mDialog;
+
+    /**
+     * Originating SC, 
+     * to be used only when reply-path is available
+     */
+    QString mOriginatingSC;
+
+    /**
+     * Originating SME,
+     * to be used only when reply-path is available
+     */
+    QString mOriginatingSME;
+
+    /**
+     * Flag to tell if reply-path is available
+     */
+    bool mReplyPath;	
+
 	friend class MsgUnifiedEditorMonitor;
     };
 
--- a/messagingapp/msgui/unifiededitor/src/msgunieditoraddress.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/src/msgunieditoraddress.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -97,12 +97,12 @@
 {
     mLaunchBtn->blockSignals(true);
 
-    QList<QVariant> args;
-    QString serviceName("com.nokia.services.phonebookservices");
-    QString operation("fetch(QString,QString,QString)");
+    QString service("phonebookservices");
+    QString interface("com.nokia.symbian.IContactsFetch");
+    QString operation("multiFetch(QString,QString)");
     XQAiwRequest* request;
     XQApplicationManager appManager;
-    request = appManager.create(serviceName, "Fetch", operation, true); // embedded
+    request = appManager.create(service, interface, operation, true); // embedded
     if ( request == NULL )
         {
         return;
@@ -112,6 +112,7 @@
     connect (request, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleOk(const QVariant&)));
     connect (request, SIGNAL(requestError(int,const QString&)), this, SLOT(handleError(int,const QString&)));
 
+    QList<QVariant> args;
     args << QString(tr("Phonebook"));
     args << KCntActionAll;
     args << KCntFilterDisplayAll;
@@ -205,7 +206,7 @@
     return mAddressEdit->addresses().count();
 }
 
-void MsgUnifiedEditorAddress::setAddresses(ConvergedMessageAddressList addrlist)
+void MsgUnifiedEditorAddress::setAddresses(ConvergedMessageAddressList addrlist,bool aSkipCheck)
 {
     // avoid processing if no info available
     if(addrlist.count() == 0)
@@ -243,7 +244,15 @@
     for(int i = 0; i < count; i++ )
         {
         bool isValid = false;
-        isValid = checkValidAddress(addrlist.at(i)->address());
+        if(!aSkipCheck)
+        {
+            isValid = checkValidAddress(addrlist.at(i)->address());
+        }
+        else
+        {
+            // no need to validate, assume correct
+            isValid = true;
+        }
         if(!isValid)
            {
             invalidCount ++;
@@ -253,7 +262,10 @@
                 {
                 invalidContacts.append(COMMA_SEPERATOR);
                 }
-            invalidContacts.append(addrlist.at(i)->alias());
+            if(addrlist[i]->alias().isEmpty())
+                invalidContacts.append(addrlist.at(i)->address());
+            else
+                invalidContacts.append(addrlist.at(i)->alias());
            }
        else
            {
@@ -271,12 +283,10 @@
     if(invalidCount)
         {
         QString invalidStr;
-        (invalidCount == 1)?(invalidStr = QString(LOC_INVALID_RECIPIENT_NOT_ADDED)) :(invalidStr = QString(LOC_INVALID_RECIPIENTS_NOT_ADDED));
-        // append line seperator
-         invalidStr.append("<br>");
-         invalidStr.append(invalidContacts);
-         HbMessageBox::information(invalidStr, 0, 0, HbMessageBox::Ok);
-        }
+        (invalidCount == 1)?(invalidStr = QString(LOC_INVALID_RECIPIENT_NOT_ADDED.arg(invalidContacts))) :(invalidStr = QString(LOC_INVALID_RECIPIENTS_NOT_ADDED.arg(invalidContacts)));
+		HbMessageBox::information(invalidStr, 0, 0, HbMessageBox::Ok);
+    }
+    
 
     // addition operation complete, reset flags
     mAboutToExceedMaxSmsRecipients = false;
--- a/messagingapp/msgui/unifiededitor/src/msgunieditorattachment.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/src/msgunieditorattachment.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -46,7 +46,6 @@
 //Localized Constants for item specific menu
 #define LOC_OPEN    hbTrId("txt_common_menu_open")
 #define LOC_REMOVE  hbTrId("txt_common_menu_remove")
-#define LOC_DETAILS hbTrId("txt_common_menu_details")
 
 const QString LIST_ITEM_BG_FRAME_NORMAL ("qtg_fr_list_normal");
 const QString LIST_ITEM_BG_FRAME_PRESSED("qtg_fr_list_pressed");
@@ -141,9 +140,10 @@
 void MsgUnifiedEditorAttachment::handleLongTap(QPointF position)
 {
     HbMenu* menu = new HbMenu;
+    
     menu->addAction(LOC_OPEN, this, SLOT(handleOpen()));
     menu->addAction(LOC_REMOVE, this, SLOT(handleRemove()));
-    menu->addAction(LOC_DETAILS, this, SLOT(viewDetails()));
+
     menu->setDismissPolicy(HbPopup::TapAnywhere);
     menu->setAttribute(Qt::WA_DeleteOnClose, true);
     menu->setPreferredPos(position);
@@ -171,11 +171,6 @@
     QTimer::singleShot(300,this,SLOT(regrabGesture()));
 }
 
-void MsgUnifiedEditorAttachment::viewDetails()
-{
-    //open details view.
-}
-
 bool MsgUnifiedEditorAttachment::isMultimediaContent()
 {
     bool ret = true;
--- a/messagingapp/msgui/unifiededitor/src/msgunieditorbody.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/src/msgunieditorbody.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -776,4 +776,40 @@
 {
     mTextEdit->setFocus(Qt::MouseFocusReason);
 }
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorBody :: removeMediaContent
+// @see header file
+//---------------------------------------------------------------
+void MsgUnifiedEditorBody::removeMediaContent(QString fileName)
+{
+    if(!(mImageFile.compare(fileName))) //remove image
+    {
+        mImageFile.clear();
+        if(mPixmapItem)
+        {
+            mPixmapItem->setParent(NULL);
+            delete mPixmapItem;
+            mPixmapItem = NULL;
+        }
+        setImage(false);
+        mImageSize = 0;
+    }
+    else if(!(mAudioFile.compare(fileName)))//remove audio item
+    {
+        mAudioFile.clear();
+        if(mAudioItem)
+        {
+            mAudioItem->setParent(NULL);
+            delete mAudioItem;
+            mAudioItem = NULL;
+        }
+        setAudio(false);
+        mAudioSize = 0;
+    }
+
+    this->repolish();
+
+    emit contentChanged();
+}
 // EOF
--- a/messagingapp/msgui/unifiededitor/src/msgunieditorpixmapwidget.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/src/msgunieditorpixmapwidget.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -31,7 +31,6 @@
 // LOCAL CONSTANTS
 #define LOC_OPEN    hbTrId("txt_common_menu_open")
 #define LOC_REMOVE  hbTrId("txt_common_menu_remove")
-#define LOC_DETAILS hbTrId("txt_common_menu_details")
 
 const QString IMAGE_MIMETYPE("image");
 
@@ -135,15 +134,6 @@
     emit remove();
 }
 
-//---------------------------------------------------------------
-// MsgUnifiedEditorPixmapWidget::handleSave
-// @see header file
-//---------------------------------------------------------------
-void MsgUnifiedEditorPixmapWidget::viewDetails()
-{
-    
-}
-
 //----------------------------------------------------------------------------
 // MsgUnifiedEditorPixmapWidget::handleShortTap
 // @see header file
@@ -170,7 +160,6 @@
     
     menu->addAction(LOC_OPEN, this, SLOT(handleOpen()));
     menu->addAction(LOC_REMOVE, this, SLOT(handleRemove()));
-    menu->addAction(LOC_DETAILS, this, SLOT(viewDetails()));
     
     menu->setPreferredPos(position);
     menu->show();
--- a/messagingapp/msgui/unifiededitor/src/msgunieditorview.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/src/msgunieditorview.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -66,6 +66,8 @@
 #include "unieditorpluginloader.h"
 #include "unieditorplugininterface.h"
 #include "msgsettingsview.h"
+#include "msgcontacthandler.h"
+#include "msgaudiofetcherdialog.h"
 
 QTM_USE_NAMESPACE
 // Constants
@@ -122,6 +124,8 @@
 //settings confirmation
 #define LOC_DIALOG_SMS_SETTINGS_INCOMPLETE hbTrId("txt_messaging_dialog_sms_message_centre_does_not_e")
 #define LOC_DIALOG_MMS_SETTINGS_INCOMPLETE hbTrId("txt_messaging_dialog_mms_access_point_not_defined")
+#define LOC_NOTE_FILES_MISSED_DRAFTS hbTrId("txt_messaging_dpopinfo_some_files_in_the_message")
+#define LOC_NOTE_FILES_MISSED_SEND hbTrId("txt_messaging_dialog_unable_to_send_message_some")
 // LOCAL FUNCTIONS
 
 //---------------------------------------------------------------
@@ -158,7 +162,11 @@
     mAttachmentContainer(0),
     mPluginLoader(0),
     mCanSaveToDrafts(true),
-    mVkbHost(NULL)
+    mVkbHost(NULL),
+	mDialog(NULL),
+    mOriginatingSC(0),
+    mOriginatingSME(0),
+    mReplyPath(false)
     {
     connect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(doDelayedConstruction()));
     
@@ -174,6 +182,9 @@
 {
     // clean editor's temporary contents before exiting
     removeTempFolder();
+    
+    //delete the popup dialog
+    delete mDialog;
 }
 
 //---------------------------------------------------------------
@@ -295,6 +306,12 @@
 
     if( msg != NULL )
     {
+        mReplyPath = msg->replyPath();
+        if(mReplyPath)
+        {
+            mOriginatingSC = msg->originatingSC();
+            mOriginatingSME = msg->toAddressList().at(0)->address();
+        }
         //Populate the content inside editor
         populateContentIntoEditor(*msg,true); // true as it is  draft message
         delete msg;
@@ -330,6 +347,15 @@
                     (UniEditorPluginInterface::EditorOperation)editorOperation);
     if( msg != NULL )
     {
+        if(editorOperation == UniEditorPluginInterface::Reply)
+        {
+            mReplyPath = msg->replyPath();
+            if(mReplyPath)
+            {
+                mOriginatingSC = msg->originatingSC();
+                mOriginatingSME = msg->toAddressList().at(0)->address();
+            }
+        }
         //Populate the content inside editor
         populateContentIntoEditor(*msg);
         delete msg;
@@ -474,14 +500,14 @@
     mMsgMonitor->setSkipNote(true);
     mToField->skipMaxRecipientQuery(true);
 
-    mToField->setAddresses(messageDetails.toAddressList());
+    mToField->setAddresses(messageDetails.toAddressList(),draftMessage);
     if(messageDetails.ccAddressList().count() > 0 )
     {
         if(!mCcField)
         {
         addCcBcc();
         }
-        mCcField->setAddresses(messageDetails.ccAddressList());
+        mCcField->setAddresses(messageDetails.ccAddressList(),draftMessage);
     }
     if(messageDetails.bccAddressList().count() > 0 )
     {
@@ -489,7 +515,7 @@
         {
         addCcBcc();
         }
-        mBccField->setAddresses(messageDetails.bccAddressList());
+        mBccField->setAddresses(messageDetails.bccAddressList(),draftMessage);
     }
     if(messageDetails.subject().size() > 0)
     {
@@ -860,8 +886,13 @@
     //close vkb before switching view.
     mVkbHost->closeKeypad(true);
 
-    packMessage(msg);
-    
+    int result = packMessage(msg);
+    if(result == KErrNotFound)
+    {
+        HbMessageBox::information(LOC_NOTE_FILES_MISSED_SEND, 0, 0, HbMessageBox::Ok);
+        deactivateInputBlocker();
+        return;
+    }
     // send message
     MsgSendUtil *sendUtil = new MsgSendUtil(this);
     int sendResult = sendUtil->send(msg);
@@ -952,8 +983,20 @@
     }
 }
 
-void MsgUnifiedEditorView::packMessage(ConvergedMessage &msg, bool isSave)
+int MsgUnifiedEditorView::packMessage(ConvergedMessage &msg, bool isSave)
 {
+    // reset reply-path if originating SME constraint is broken
+    if(mReplyPath && isReplyPathBroken())
+    {
+        mReplyPath = false;
+    }
+
+    msg.setReplyPath(mReplyPath);
+    if(mReplyPath)
+    {
+        msg.setOriginatingSC(mOriginatingSC);
+    }
+
     ConvergedMessage::MessageType messageType = MsgUnifiedEditorMonitor::messageType();
     msg.setMessageType(messageType);
     // If isSave is true (save to draft usecase), then don't remove duplicates
@@ -963,7 +1006,8 @@
             mToField->addresses(removeDuplicates);
     ConvergedMessageAddressList ccAddresses;
     ConvergedMessageAddressList bccAddresses;
-    
+    ConvergedMessageAttachmentList mediaList;
+    int errorCode = 0;
 	//Don't format the addresses for save to drfats case
 	if(!isSave)
 	{
@@ -1050,18 +1094,23 @@
             msg.setPriority(mSubjectField->priority());
         }
 
-        ConvergedMessageAttachmentList mediaList;
-
         QStringList mediafiles(mBody->mediaContent());
         if (!mediafiles.isEmpty())
         {
             for (int i = 0; i < mediafiles.size(); ++i)
             {
+                if(QFile::exists(mediafiles.at(i)))
+                {
                 ConvergedMessageAttachment* attachment =
                     new ConvergedMessageAttachment(
                         mediafiles.at(i),
                         ConvergedMessageAttachment::EInline);
                 mediaList << attachment;
+                }
+                else
+                {   mBody->removeMediaContent(mediafiles.at(i));
+                    errorCode = KErrNotFound;
+                }
             }
 
         }
@@ -1079,17 +1128,26 @@
                 mAttachmentContainer->attachmentList();
                 for (int i = 0; i < editorAttachmentList.count(); ++i)
                 {
-                    ConvergedMessageAttachment* attachment =
-                        new ConvergedMessageAttachment(
-                            editorAttachmentList.at(i)->path(),
-                            ConvergedMessageAttachment::EAttachment);
-                    attachmentList << attachment;
+                    if(QFile::exists(editorAttachmentList.at(i)->path()))
+                    {
+                        ConvergedMessageAttachment* attachment =
+                                                new ConvergedMessageAttachment(
+                                                    editorAttachmentList.at(i)->path(),
+                                                    ConvergedMessageAttachment::EAttachment);
+                                            attachmentList << attachment;    
+                    }
+                    else
+                    {
+                        mAttachmentContainer->deleteAttachment(editorAttachmentList.at(i));
+                        errorCode = KErrNotFound;
+                    }   
                 }
             }
         if(attachmentList.count() > 0)
         {
             msg.addAttachments(attachmentList);
         }
+        return errorCode;
 }
 
 int MsgUnifiedEditorView::saveContentToDrafts()
@@ -1165,8 +1223,25 @@
         return INVALID_MSGID;
     }
     ConvergedMessage msg;
-    packMessage(msg, true);
+    int result = packMessage(msg, true);
+    if(result == KErrNotFound)
+        {
+        HbNotificationDialog::launchDialog(LOC_NOTE_FILES_MISSED_DRAFTS);
+        if(messageType == ConvergedMessage::Sms &&
+                    addresses.isEmpty() &&
+                    MsgUnifiedEditorMonitor::bodySize() <= 0 &&
+                    MsgUnifiedEditorMonitor::containerSize() <= 0)
+            {
+                if(mOpenedMessageId.getId() != -1)
+                {
+                pluginInterface->deleteDraftsEntry(mOpenedMessageId.getId());
+                }
 
+                // if empty msg, do not save
+                deactivateInputBlocker();
+                return INVALID_MSGID;
+            }
+        }
     // save to drafts
     MsgSendUtil *sendUtil = new MsgSendUtil(this);
     int msgId = sendUtil->saveToDrafts(msg);
@@ -1191,6 +1266,17 @@
     return msgId;
 }
 
+bool MsgUnifiedEditorView::handleKeyEvent(int key)
+{
+    bool eventHandled = false;
+    if (Qt::Key_Yes == key && mSendAction->isEnabled()) {
+        eventHandled = true;
+        send();
+    }
+
+    return eventHandled;
+}
+
 void MsgUnifiedEditorView::resizeEvent( QGraphicsSceneResizeEvent * event )
 {
  Q_UNUSED(event)
@@ -1218,22 +1304,31 @@
     QContactManager* contactManager = new QContactManager("symbian");
     CntServicesContactList cntServicesContacts = qVariantValue<CntServicesContactList>(value);
     int cntCount = cntServicesContacts.count();
+    
+    QCRITICAL_WRITE_FORMAT("servicecontactlist count:",cntCount);
+    
     QList<QtMobility::QContact> contactList;
     for(int i = 0; i < cntCount; i++ )
-    {
+    {        
         contactList << contactManager->contact( cntServicesContacts.at(i).mContactId );
     }
     delete contactManager;
-
+   
     // get list of all versit-documents
     QVersitDocument::VersitType versitType(QVersitDocument::VCard21Type);
-    QVersitContactExporter* exporter = new QVersitContactExporter();
+    
+    QVersitContactExporter exporter;
+    bool ret_val = exporter.exportContacts(contactList, versitType);
     
-    bool ret_val = exporter->exportContacts(contactList, versitType);
-    QList<QtMobility::QVersitDocument> documentList = exporter->documents();    
-
-    delete exporter;
-
+    if(ret_val == false)
+        { 
+        QCRITICAL_WRITE("QVersitContactExporter::exportContacts returned false");
+        return KErrGeneral;
+        }  
+    
+    // process the documents
+	QList<QtMobility::QVersitDocument> documentList = exporter.documents();
+	
     // loop though and create a vcard for each contact
     QVersitWriter* writer = new QVersitWriter();
     for(int i = 0; i < cntCount; i++ )
@@ -1258,17 +1353,29 @@
                 // trap ignore so that, incase of multiselection, other vcards are still created
                 QByteArray bufArr;
                 TRAP_IGNORE(
-                CBufBase* contactbufbase = CBufFlat::NewL(contactsbuf.size());
-                CleanupStack::PushL(contactbufbase);
-                contactbufbase->InsertL( contactbufbase->Size(),
-                        *XQConversions::qStringToS60Desc8( contactsbuf.data() ) );
-                TPtr8 ptrbuf(contactbufbase->Ptr(0));
-                bufArr = XQConversions::s60Desc8ToQByteArray(ptrbuf);
-                CleanupStack::PopAndDestroy(contactbufbase);
-                );
-                file.write(bufArr);
-                file.close();
-                filelist << filepath;
+                        HBufC8* contactBuf8 = XQConversions::qStringToS60Desc8(contactsbuf.data());
+                        if(contactBuf8)
+                            {
+                            CleanupStack::PushL(contactBuf8);
+                            CBufBase* contactbufbase = CBufFlat::NewL(contactsbuf.size());
+                            CleanupStack::PushL(contactbufbase);
+                            
+                            contactbufbase->InsertL( contactbufbase->Size(), *contactBuf8);
+                            
+                            TPtr8 ptrbuf(contactbufbase->Ptr(0));
+                            bufArr = XQConversions::s60Desc8ToQByteArray(ptrbuf);
+                            
+                            CleanupStack::PopAndDestroy(contactbufbase);
+                            CleanupStack::PopAndDestroy(contactBuf8);
+                            
+                            // write to file
+                            file.write(bufArr);                                            
+                            filelist << filepath;
+                            }
+                ); // TRAP END
+                
+                //close file
+                file.close();                
             }
         }
     }
@@ -1361,25 +1468,26 @@
 //---------------------------------------------------------------
 void MsgUnifiedEditorView::fetchContacts()
 {
-    QList<QVariant> args;
-    QString serviceName("com.nokia.services.phonebookservices");
-    QString operation("fetch(QString,QString,QString)");
+    QString service("phonebookservices");
+    QString interface("com.nokia.symbian.IContactsFetch");
+    QString operation("multiFetch(QString,QString)");
     XQAiwRequest* request;
     XQApplicationManager appManager;
-    request = appManager.create(serviceName, "Fetch", operation, true); //embedded
+    request = appManager.create(service, interface, operation, true); //embedded
     if ( request == NULL )
     {
         QCRITICAL_WRITE("AIW-ERROR: NULL request");
-        return;       
+        return;
     }
 
     // Result handlers
-    connect (request, SIGNAL(requestOk(const QVariant&)), 
+    connect (request, SIGNAL(requestOk(const QVariant&)),
         this, SLOT(contactsFetched(const QVariant&)));
-    connect (request, SIGNAL(requestError(int,const QString&)), 
+    connect (request, SIGNAL(requestError(int,const QString&)),
         this, SLOT(serviceRequestError(int,const QString&)));
 
-    args << QString(tr("Phonebook")); 
+    QList<QVariant> args;
+    args << QString(tr("Phonebook"));
     args << KCntActionAll;
     args << KCntFilterDisplayAll;
 
@@ -1403,12 +1511,14 @@
     XQAiwRequest* request = NULL;
     XQApplicationManager appManager;
     request = appManager.create(service,interface, operation, true);//embedded
-    request->setSynchronous(true); // synchronous
+  
     if(!request)
     {     
         QCRITICAL_WRITE("AIW-ERROR: NULL request");
         return;
     }
+    
+    request->setSynchronous(true); // synchronous
 
     connect(request, SIGNAL(requestOk(const QVariant&)),
         this, SLOT(imagesFetched(const QVariant&)));
@@ -1429,11 +1539,18 @@
 //---------------------------------------------------------------
 void MsgUnifiedEditorView::fetchAudio()
 {
-    // Launch Audio fetcher view
-    QVariantList params;
-    params << MsgBaseView::AUDIOFETCHER; // target view
-    params << MsgBaseView::UNIEDITOR; // source view
-    emit switchView(params);
+    // Launch Audio fetcher dialog
+    if(!mDialog)
+    {
+       mDialog = new MsgAudioFetcherDialog();
+       connect(mDialog,
+            SIGNAL(audioSelected(QString&)),
+            this,
+            SLOT(onAudioSelected(QString&)));
+    }
+
+    //show the dialog
+    mDialog->show();    
 }
 
 //---------------------------------------------------------------
@@ -1550,6 +1667,20 @@
     connect(mVkbHost,SIGNAL(aboutToOpen()),
             this,SLOT(vkbAboutToOpen()));
 }
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::onAudioSelected
+// @see header file
+//---------------------------------------------------------------
+void 
+MsgUnifiedEditorView::onAudioSelected(QString& filePath)
+{
+    if (!filePath.isEmpty())
+        {
+            mBody->setAudio(filePath);
+        }    
+}
+
 //---------------------------------------------------------------
 // MsgUnifiedEditorView::hideChrome
 //
@@ -1750,4 +1881,60 @@
         delete tempAddr;                                                       
     }       
 }
+
+// ----------------------------------------------------------------------------
+// MsgUnifiedEditorView::isReplyPathBroken
+// @see header
+// ----------------------------------------------------------------------------
+bool MsgUnifiedEditorView::isReplyPathBroken()
+{
+    // 1. Never set for MMS
+    // 2. if additional recipients exits
+    if( (MsgUnifiedEditorMonitor::messageType() == ConvergedMessage::Mms) ||
+        (mToField->addressCount() != 1) )
+    {
+        // broken
+        return true;
+    }
+
+    // 3. if only recipient is not same as originating SME
+    QString dispName;
+    int phCount;
+    int origCntLocalId = MsgContactHandler::resolveContactDisplayName(
+            mOriginatingSME, dispName, phCount);
+    int currCntLocalId = -1;
+    QString currAddress(mToField->addresses().at(0)->address());
+    if(origCntLocalId != -1)
+    {
+        currCntLocalId = MsgContactHandler::resolveContactDisplayName(
+            currAddress, dispName, phCount);
+    }
+
+    if(currCntLocalId != -1)
+    { // both are mapped contacts present in contacts db
+        if(currCntLocalId != origCntLocalId)
+        {
+            return true;
+        }
+    }
+    else
+    { // atleast one contact is not present in contacts db
+      // direct compare
+        UniEditorGenUtils* genUtils = q_check_ptr(new UniEditorGenUtils);
+        bool compareResult = false;
+        TRAP_IGNORE(
+        compareResult = genUtils->MatchPhoneNumberL(
+                *XQConversions::qStringToS60Desc(mOriginatingSME),
+                *XQConversions::qStringToS60Desc(currAddress))
+        );
+        delete genUtils;
+        if(!compareResult)
+        {
+            return true;
+        }
+    }
+
+    return false;
+}
+
 //EOF
--- a/messagingapp/msgui/unifiededitor/unifiededitor.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/unifiededitor.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -109,6 +109,7 @@
         -lsmcm \
         -lxqserviceutil \
         -lcommonengine \
-        -lefsrv
+        -lefsrv \
+        -lmsgaudiofetcher
 
         
\ No newline at end of file
--- a/messagingapp/msgui/unifiedviewer/inc/unifiedviewer.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/inc/unifiedviewer.h	Fri Sep 17 08:28:39 2010 +0300
@@ -18,15 +18,17 @@
 #ifndef UNIFIED_VIEWER_H
 #define UNIFIED_VIEWER_H
 
-#ifdef BUILD_UNI_VIEWER_DLL
-#define UNI_VIEWER_DLL Q_DECL_EXPORT
+#ifdef MSGUI_UNIT_TEST
+ #define UNI_VIEWER_DLL
 #else
-#define UNI_VIEWER_DLL Q_DECL_IMPORT
+ #ifdef BUILD_UNI_VIEWER_DLL
+  #define UNI_VIEWER_DLL Q_DECL_EXPORT
+ #else
+  #define UNI_VIEWER_DLL Q_DECL_IMPORT
+ #endif
 #endif
 
-#include <sqldb.h>
 #include "msgbaseview.h"
-
 #include "convergedmessage.h"
 
 class UniViewerFeeder;
@@ -58,7 +60,30 @@
     /**
      * Populates the content on the widget
      */
-    void populateContent(const qint32 messageId, bool update, int msgCount);
+    void populateContent(const qint32 messageId, bool update, int msgCount, qint64 conversationId = -1);
+
+    /**
+     * Event handler
+     * @param key Key code
+     * @return true if key event handled else false.
+     * @see MsgBaseView
+     */
+    bool handleKeyEvent(int key);
+
+public slots:
+
+    /**
+     * Clears the content on the widget
+     */
+    void clearContent();
+
+    // Used for internal testing will be removed
+    void handleFwdAction();
+
+    /**
+     * Handle delete
+     */
+    void handleDeleteAction();
 
 protected:
 
@@ -87,20 +112,11 @@
      */
     void launchEditor(MsgBaseView::UniEditorOperation operation);
 
-public slots:
-
     /**
-     * Clears the content on the widget
+     * Launches the dialer interface.
+     * @args number Number to be called.
      */
-    void clearContent();
-
-    // Used for internal testing will be removed
-    void handleFwdAction();
-    
-    /**
-     * Handle delete 
-     */     
-    void handleDeleteAction();
+    void call(const QString &number);
 
 private slots:
     /**
@@ -146,6 +162,11 @@
     UniContentsWidget* mContentsWidget;
 
     /**
+     * Conversation ID
+     */
+    qint64 mConversationID;
+
+    /**
      * Contact id
      */
     qint32 mContactId;
@@ -154,11 +175,18 @@
      * Message id
      */
     qint32 mMessageId;
-	
+
     /**
      * Message count
      */
     int mMsgCount;
+
+#ifdef MSGUI_UNIT_TEST
+    /**
+     * Unit Testing
+     */
+    friend class TestUnifiedViewer;
+#endif
 };
 
 #endif
--- a/messagingapp/msgui/unifiedviewer/inc/univiewerattachmentwidget.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/inc/univiewerattachmentwidget.h	Fri Sep 17 08:28:39 2010 +0300
@@ -86,11 +86,6 @@
     void handleOpen();
 
     /**
-     * Handles saving of media.
-     */
-    void handleSave();
-    
-    /**
      * Slot to regrab gesture after some delay (300 ms) to avoid multiple gesture
      * events back to back.  
      */
--- a/messagingapp/msgui/unifiedviewer/inc/univieweraudiowidget.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/inc/univieweraudiowidget.h	Fri Sep 17 08:28:39 2010 +0300
@@ -89,11 +89,6 @@
     void handleOpen();
 
     /**
-     * Handles saving of media.
-     */
-    void handleSave();
-    
-    /**
      * Slot to regrab gesture after some delay (300 ms) to avoid multiple gesture
      * events back to back.  
      */
--- a/messagingapp/msgui/unifiedviewer/inc/univiewerpixmapwidget.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/inc/univiewerpixmapwidget.h	Fri Sep 17 08:28:39 2010 +0300
@@ -88,11 +88,6 @@
     void handleOpen();
 
     /**
-     * Handles saving of media.
-     */
-    void handleSave();
-
-    /**
      * Slot to regrab gesture after some delay (300 ms) to avoid multiple gesture
      * events back to back.  
      */
--- a/messagingapp/msgui/unifiedviewer/src/unifiedviewer.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/src/unifiedviewer.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -27,6 +27,9 @@
 #include <centralrepository.h>
 #include <MmsEngineDomainCRKeys.h>
 #include <ccsdefs.h>
+#include <xqappmgr.h>
+#include <xqaiwrequest.h>
+#include <sqldb.h>
 
 // USER INCLUDES
 #include "uniscrollarea.h"
@@ -51,7 +54,7 @@
 //DB-file
 _LIT(KDbFileName, "c:[2002A542]conversations.db");
 // query to see if msg is forwardable
-_LIT(KSelectMsgPropertyStmt, " SELECT message_id, msg_property FROM conversation_messages WHERE message_id=:message_id ");
+_LIT(KSelectMsgPropertyStmt, " SELECT message_id, msg_property, msg_processingstate FROM conversation_messages WHERE message_id=:message_id ");
 
 
 //LOCALIZED CONSTANTS
@@ -62,14 +65,12 @@
 // UnifiedViewer::UnifiedViewer
 // constructor
 //----------------------------------------------------------------------------
-UnifiedViewer::UnifiedViewer(const qint32 messageId,
-                             QGraphicsItem *parent) :
-    MsgBaseView(parent)
+UnifiedViewer::UnifiedViewer(const qint32 messageId, QGraphicsItem *parent) :
+    MsgBaseView(parent), mConversationID(-1)
 {
     QDEBUG_WRITE("UnifiedViewer contruction start");
 
-    if (!HbStyleLoader::registerFilePath(":/layouts"))
-    {
+    if (!HbStyleLoader::registerFilePath(":/layouts")) {
         QDEBUG_WRITE("ERROR: UnifiedViewer -> HbStyleLoader::registerFilePath");
     }
 
@@ -79,13 +80,12 @@
     mScrollArea = new UniScrollArea(this);
     this->setWidget(mScrollArea);
 
-    mContentsWidget = new UniContentsWidget(mViewFeeder,this);
+    mContentsWidget = new UniContentsWidget(mViewFeeder, this);
 
-    connect(mContentsWidget,SIGNAL(sendMessage(const QString&,const QString&)),
-            this, SLOT(sendMessage(const QString&,const QString&)));
+    connect(mContentsWidget, SIGNAL(sendMessage(const QString&,const QString&)), this,
+        SLOT(sendMessage(const QString&,const QString&)));
 
-    connect(mScrollArea, SIGNAL(scrolledToNextSlide()),
-    mContentsWidget, SLOT(populateNextSlide()));
+    connect(mScrollArea, SIGNAL(scrolledToNextSlide()), mContentsWidget, SLOT(populateNextSlide()));
 
     mScrollArea->setContentWidget(mContentsWidget);
     mScrollArea->setHorizontalScrollBarPolicy(HbScrollArea::ScrollBarAlwaysOff);
@@ -160,12 +160,13 @@
 // UnifiedViewer::populateContent
 // @see header file
 //---------------------------------------------------------------
-void UnifiedViewer::populateContent(const qint32 messageId, bool update, int msgCount)
+void UnifiedViewer::populateContent(const qint32 messageId, bool update, int msgCount, qint64 conversationId)
 {
     QDEBUG_WRITE("UnifiedViewer populateContent Start");
 
     mMsgCount = msgCount;
     mMessageId = messageId;
+    mConversationID = conversationId;
 
     QDEBUG_WRITE("UnifiedViewer feeder->updateContent START");
 
@@ -198,6 +199,42 @@
 }
 
 //---------------------------------------------------------------
+// UnifiedViewer::handleKeyEvent
+// @see header file
+//---------------------------------------------------------------
+bool UnifiedViewer::handleKeyEvent(int key)
+{
+    bool eventHandled = false;
+    if (Qt::Key_Yes == key) {
+        bool incoming = mViewFeeder->isIncoming();
+        QString number;
+        if (incoming) {
+            QString alias;
+            mViewFeeder->fromAddressAndAlias(number, alias);
+        }
+        else if (!incoming && 1 == mViewFeeder->recipientCount()) {
+            ConvergedMessageAddressList addrList;
+            if ((addrList = mViewFeeder->toAddressList()).count()) {
+                number = addrList[0]->address();
+            }
+            else if((addrList = mViewFeeder->ccAddressList()).count()) {
+                number = addrList[0]->address();
+            }
+            else if ((addrList = mViewFeeder->bccAddressList()).count()) {
+                number = addrList[0]->address();
+            }
+        }
+
+        // Call
+        if (!number.isEmpty()) {
+            eventHandled = true;
+            call(number);
+        }
+    }
+    return eventHandled;
+}
+
+//---------------------------------------------------------------
 // UnifiedViewer::handleFwdAction
 // @see header file
 //---------------------------------------------------------------
@@ -298,6 +335,7 @@
         if (mMsgCount > 1) {
             param << MsgBaseView::CV;
             param << MsgBaseView::UNIVIEWER;
+            param << mConversationID;
         }
         else {
             param << MsgBaseView::CLV;
@@ -345,6 +383,26 @@
 }
 
 //---------------------------------------------------------------
+// UnifiedViewer::call
+// @see header file
+//---------------------------------------------------------------
+void UnifiedViewer::call(const QString &number)
+{
+    QString service("phoneui");
+    QString interface("com.nokia.symbian.ICallDial");
+    QString operation("dial(QString)");
+
+    XQApplicationManager appManager;
+    QScopedPointer<XQAiwRequest> request(appManager.create(service, interface, operation, false));
+    if (request) {
+        QList<QVariant> args;
+        args << number;
+        request->setArguments(args);
+        request->send();
+    }
+}
+
+//---------------------------------------------------------------
 // UnifiedViewer::isForwardOk
 // @see header file
 //---------------------------------------------------------------
@@ -366,15 +424,36 @@
             // read the flag
             TInt msgPropertyIndex =
                     sqlSelectStmt.ColumnIndex(_L("msg_property"));
+            
+            TInt msgProcessingStateIndex = sqlSelectStmt.ColumnIndex(
+                       _L("msg_processingstate"));
+            
             TInt retValue = 0;
+            TInt processingStateVal = 0;
             if (sqlSelectStmt.Next() == KSqlAtRow)
             {
                 retValue = static_cast<TInt>
                     (sqlSelectStmt.ColumnInt(msgPropertyIndex));
-            }
+                processingStateVal = static_cast<TInt>
+                    (sqlSelectStmt.ColumnInt(msgProcessingStateIndex));              
+            }        
+           
             CleanupStack::PopAndDestroy(&sqlSelectStmt);
             sqlDb.Close();
-            canForwardMsg = (retValue & EPreviewForward)? true:false;
+            
+            bool processing =  (processingStateVal & EPreviewMsgProcessed)? true:false;
+            if(processing)
+            {
+                canForwardMsg = (retValue & EPreviewForward)? true:false;
+            }
+            else
+            {
+               	// If message is still getting processed, forward field may not be updated in
+               	// Preview DB, so get the forwardable state from MMS conformance checks...
+                MmsConformanceCheck* mmsConformanceCheck = new MmsConformanceCheck;
+                canForwardMsg = mmsConformanceCheck->validateMsgForForward(mMessageId);
+                delete mmsConformanceCheck;  
+            }
         }
         else
         {
--- a/messagingapp/msgui/unifiedviewer/src/univieweraddresswidget.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/src/univieweraddresswidget.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -475,9 +475,6 @@
     
     if(action)
     {
-        QList<QVariant> args;
-        QString operation;
-        
         QString data = action->data().toString();        
     
         int contactId = MsgContactHandler::resolveContactDisplayName(
@@ -495,29 +492,31 @@
                 QContactEmailAddress::FieldEmailAddress);
         }
 
+        //service stuff.
+        QString service("phonebookservices");
+        QString interface;
+        QString operation;
+        QList<QVariant> args;
+
         if(contactId > 0)
         {
             //open contact card
-            operation = QString("open(int)");
+            interface = QString("com.nokia.symbian.IContactsView");
+            operation = QString("openContactCard(int)");
             args << contactId;
         }
         else
         {
             //save to contacts with phone number field prefilled.
-
+            interface = QString("com.nokia.symbian.IContactsEdit");
             operation = QString("editCreateNew(QString,QString)");
             QString type = QContactPhoneNumber::DefinitionName;
-
             args << type;
             args << data;
         }
-        
-        //service stuff.
-        QString serviceName("com.nokia.services.phonebookservices");
-     
         XQAiwRequest* request;
         XQApplicationManager appManager;
-        request = appManager.create(serviceName, "Fetch", operation, true); // embedded
+        request = appManager.create(service, interface, operation, true); // embedded
         if ( request == NULL )
             {
             return;       
--- a/messagingapp/msgui/unifiedviewer/src/univiewerattachmentwidget.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/src/univiewerattachmentwidget.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -35,7 +35,6 @@
 
 // LOCAL CONSTANTS
 #define LOC_OPEN hbTrId("txt_common_menu_open")
-#define LOC_SAVE hbTrId("txt_common_menu_save")
 #define LOC_SAVE_TO_CONTACTS hbTrId("txt_messaging_menu_save_to_contacts")
 
 const QString BG_FRAME_NORMAL("qtg_fr_list_normal");
@@ -182,15 +181,6 @@
 }
 
 //----------------------------------------------------------------------------
-// UniViewerAttachmentWidget::handleSave
-// @see header file
-//----------------------------------------------------------------------------
-void UniViewerAttachmentWidget::handleSave()
-{
-
-}
-
-//----------------------------------------------------------------------------
 // UniViewerAttachmentWidget::handleShortTap
 // @see header file
 //----------------------------------------------------------------------------
@@ -221,7 +211,7 @@
     }
     else {
         menu->addAction(LOC_OPEN, this, SLOT(handleOpen()));
-        menu->addAction(LOC_SAVE, this, SLOT(handleSave()));
+        
     }
 
     menu->show();
--- a/messagingapp/msgui/unifiedviewer/src/univieweraudiowidget.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/src/univieweraudiowidget.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -28,7 +28,7 @@
 
 // LOCAL CONSTANTS
 #define LOC_OPEN    hbTrId("txt_common_menu_open")
-#define LOC_SAVE    hbTrId("txt_common_menu_save")
+
 
 static const char VIDEO_MIMETYPE[] = "video";
 static const char AUDIO_ICON[] = "qtg_mono_audio";
@@ -138,7 +138,6 @@
     HbMenu* menu = new HbMenu;
     menu->setAttribute(Qt::WA_DeleteOnClose);
     menu->addAction(LOC_OPEN, this, SLOT(handleOpen()));
-    menu->addAction(LOC_SAVE, this, SLOT(handleSave()));
     menu->setPreferredPos(position);
     menu->show();
 }
@@ -160,15 +159,6 @@
     QTimer::singleShot(300,this,SLOT(regrabGesture()));
 }
 
-//----------------------------------------------------------------------------
-// UniViewerAudioWidget::handleSave
-// @see header file
-//----------------------------------------------------------------------------
-void UniViewerAudioWidget::handleSave()
-{
-
-}
-
 //---------------------------------------------------------------
 // UniViewerAudioWidget::regrabGesture
 // @see header file
--- a/messagingapp/msgui/unifiedviewer/src/univiewerfeeder.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/src/univiewerfeeder.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -202,41 +202,48 @@
     return d_ptr->clearContent();
 }
 
+// ---------------------------------------------------------------------------
 // UniViewerFeeder::fromAddressAndAlias
 // @see header file
-//
+// ---------------------------------------------------------------------------
 void UniViewerFeeder::fromAddressAndAlias(QString& from, QString& alias)
 {
     return d_ptr->fromAddressAndAlias(from, alias);
 }
 
+// ---------------------------------------------------------------------------
 // UniViewerFeeder::isIncoming
 // @see header file
-//
+// ---------------------------------------------------------------------------
 bool UniViewerFeeder::isIncoming()
 {
     return d_ptr->isIncoming();
 }
 
+// ---------------------------------------------------------------------------
 // UniViewerFeeder::priority
 // @see header file
-//
+// ---------------------------------------------------------------------------
 int UniViewerFeeder::priority()
 {
     return d_ptr->priority();
 }
 
+// ---------------------------------------------------------------------------
 // UniViewerFeeder::subject
 // @see header file
-//
+// ---------------------------------------------------------------------------
 QString UniViewerFeeder::subject()
 {
     return d_ptr->subject();
 }
 
+// ---------------------------------------------------------------------------
+// UniViewerFeeder::sendingState
+// @see header file
+// ---------------------------------------------------------------------------
 int UniViewerFeeder::sendingState()
 {
-    
-    return d_ptr->sendingState();    
+    return d_ptr->sendingState();
 }
 // EOF
--- a/messagingapp/msgui/unifiedviewer/src/univiewerfeeder_p.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/src/univiewerfeeder_p.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -283,7 +283,7 @@
     int count;
     for (int i = 0; i < mCcAddressList.count(); ++i) {
         MsgContactHandler::resolveContactDisplayName(
-		mToAddressList.at(i)->address(), alias, count);
+        mCcAddressList.at(i)->address(), alias, count);
         mCcAddressList.at(i)->setAlias(alias);
         alias.clear();
 
--- a/messagingapp/msgui/unifiedviewer/src/univiewerheadercontainer.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/src/univiewerheadercontainer.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -247,14 +247,24 @@
         (alias.isEmpty()) ? mHeaderGroupBox->setHeading(from) : mHeaderGroupBox->setHeading(alias);
     }
     else {
-        QString toAddrList = createAddressList(mViewFeeder->toAddressList());
-        QString ccAddrList = createAddressList(mViewFeeder->ccAddressList());
-
-        if (!ccAddrList.isEmpty()) {
-            toAddrList.append(ADDR_LIST_SEPARATOR);
-            toAddrList.append(ccAddrList);
+        ConvergedMessageAddressList addrList;
+        QString headingStr;
+        if ((addrList = mViewFeeder->toAddressList()).count()) {
+            headingStr.append(createAddressList(addrList));
         }
-        mHeaderGroupBox->setHeading(toAddrList);
+        if ((addrList = mViewFeeder->ccAddressList()).count()) {
+            if (!headingStr.isEmpty()) {
+                headingStr.append(ADDR_LIST_SEPARATOR);
+            }
+            headingStr.append(createAddressList(addrList));
+        }
+        if ((addrList = mViewFeeder->bccAddressList()).count()) {
+            if (!headingStr.isEmpty()) {
+                headingStr.append(ADDR_LIST_SEPARATOR);
+            }
+            headingStr.append(createAddressList(addrList));
+        }
+        mHeaderGroupBox->setHeading(headingStr);
     }
 }
 
--- a/messagingapp/msgui/unifiedviewer/src/univiewerpixmapwidget.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/src/univiewerpixmapwidget.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -32,7 +32,7 @@
 
 // LOCAL CONSTANTS
 #define LOC_OPEN    hbTrId("txt_common_menu_open")
-#define LOC_SAVE    hbTrId("txt_common_menu_save")
+
 
 static const char PIXMAP_ICON[] = "qtg_small_image";
 static const char CORRUPTED_PIXMAP_ICON[] = "qtg_large_corrupted";
@@ -171,14 +171,6 @@
 }
 
 //---------------------------------------------------------------
-// UniViewerPixmapWidget::handleSave
-// @see header file
-//---------------------------------------------------------------
-void UniViewerPixmapWidget::handleSave()
-{
-}
-
-//---------------------------------------------------------------
 // UniViewerPixmapWidget::regrabGesture
 // @see header file
 //---------------------------------------------------------------
@@ -244,7 +236,7 @@
     HbMenu* menu = new HbMenu;
     menu->setAttribute(Qt::WA_DeleteOnClose);
     menu->addAction(LOC_OPEN, this, SLOT(handleOpen()));
-    menu->addAction(LOC_SAVE, this, SLOT(handleSave()));
+    
     menu->setPreferredPos(position);
     menu->show();
 }
--- a/messagingapp/msgui/unifiedviewer/src/univiewertextitem.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/src/univiewertextitem.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -493,8 +493,11 @@
     
     if(action)
     {
+        //service stuff.
+        QString service("phonebookservices");
+        QString interface;
+        QString operation;
         QList<QVariant> args;
-        QString operation;
         
         QString data = action->data().toString();
         
@@ -510,16 +513,16 @@
             if(contactId > 0)
                 {
                 //open contact card
-                operation = QString("open(int)");
+                interface = QString("com.nokia.symbian.IContactsView");
+                operation = QString("openContactCard(int)");
                 args << contactId;
                 }
             else
                 {
                 //save to contacts with phone number field prefilled.
-        
+                interface = QString("com.nokia.symbian.IContactsEdit");
                 operation = QString("editCreateNew(QString,QString)");
                 QString type = QContactPhoneNumber::DefinitionName;
-        
                 args << type;
                 args << data;
                 }
@@ -536,28 +539,23 @@
             if(contactId > 0)
                 {
                 //open contact card
-                operation = QString("open(int)");
+                interface = QString("com.nokia.symbian.IContactsView");
+                operation = QString("openContactCard(int)");
                 args << contactId;
                 }
             else
                 {
                 //save to contacts with e-mail field prefilled.
-        
-                operation = QString("editCreateNew(QString,QString)");                
-                
+                interface = QString("com.nokia.symbian.IContactsEdit");
+                operation = QString("editCreateNew(QString,QString)");
                 QString type = QContactEmailAddress::DefinitionName;
-        
                 args << type;
                 args << data;
                 }
-        }
-        
-        //service stuff.
-        QString serviceName("com.nokia.services.phonebookservices");
-     
+        }        
         XQAiwRequest* request;
         XQApplicationManager appManager;
-        request = appManager.create(serviceName, "Fetch", operation, true); // embedded
+        request = appManager.create(service, interface, operation, true); // embedded
         if ( request == NULL )
             {
             return;       
--- a/messagingapp/msgutils/bwins/convergedmessageutilsu.def	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/bwins/convergedmessageutilsu.def	Fri Sep 17 08:28:39 2010 +0300
@@ -2,71 +2,73 @@
 	??0ConvergedMessageId@@QAE@H@Z @ 1 NONAME ; ConvergedMessageId::ConvergedMessageId(int)
 	?toAddressList@ConvergedMessage@@QBE?BV?$QList@PAVConvergedMessageAddress@@@@XZ @ 2 NONAME ; class QList<class ConvergedMessageAddress *> const ConvergedMessage::toAddressList(void) const
 	?serialize@ConvergedMessageAttachment@@QBEXAAVQDataStream@@@Z @ 3 NONAME ; void ConvergedMessageAttachment::serialize(class QDataStream &) const
-	?fromAddress@ConvergedMessage@@QBEPAVConvergedMessageAddress@@XZ @ 4 NONAME ; class ConvergedMessageAddress * ConvergedMessage::fromAddress(void) const
-	?setProperty@ConvergedMessage@@QAEXW4MessageProperty@1@@Z @ 5 NONAME ; void ConvergedMessage::setProperty(enum ConvergedMessage::MessageProperty)
-	?sendingState@ConvergedMessage@@QBE?AW4SendingState@1@XZ @ 6 NONAME ; enum ConvergedMessage::SendingState ConvergedMessage::sendingState(void) const
-	?properties@ConvergedMessage@@QBEGXZ @ 7 NONAME ; unsigned short ConvergedMessage::properties(void) const
-	?address@ConvergedMessageAddress@@QBEABVQString@@XZ @ 8 NONAME ; class QString const & ConvergedMessageAddress::address(void) const
-	??4ConvergedMessageId@@QAEAAV0@ABV0@@Z @ 9 NONAME ; class ConvergedMessageId & ConvergedMessageId::operator=(class ConvergedMessageId const &)
-	?location@ConvergedMessage@@QBE?AW4MessageLocation@1@XZ @ 10 NONAME ; enum ConvergedMessage::MessageLocation ConvergedMessage::location(void) const
-	?setTimeStamp@ConvergedMessage@@QAEX_J@Z @ 11 NONAME ; void ConvergedMessage::setTimeStamp(long long)
-	?setAttachmentType@ConvergedMessageAttachment@@QAEXH@Z @ 12 NONAME ; void ConvergedMessageAttachment::setAttachmentType(int)
-	?setSubject@ConvergedMessage@@QAEXABVQString@@@Z @ 13 NONAME ; void ConvergedMessage::setSubject(class QString const &)
-	?timeStamp@ConvergedMessage@@QBE_JXZ @ 14 NONAME ; long long ConvergedMessage::timeStamp(void) const
-	?bodyText@ConvergedMessage@@QBEABVQString@@XZ @ 15 NONAME ; class QString const & ConvergedMessage::bodyText(void) const
-	??0ConvergedMessageAttachment@@QAE@ABVQString@@H@Z @ 16 NONAME ; ConvergedMessageAttachment::ConvergedMessageAttachment(class QString const &, int)
-	?setAddress@ConvergedMessageAddress@@QAEXABVQString@@@Z @ 17 NONAME ; void ConvergedMessageAddress::setAddress(class QString const &)
-	?addCcRecipient@ConvergedMessage@@QAEXAAVConvergedMessageAddress@@@Z @ 18 NONAME ; void ConvergedMessage::addCcRecipient(class ConvergedMessageAddress &)
-	??0ConvergedMessage@@QAE@ABV0@@Z @ 19 NONAME ; ConvergedMessage::ConvergedMessage(class ConvergedMessage const &)
-	?setPriority@ConvergedMessage@@QAEXW4Priority@1@@Z @ 20 NONAME ; void ConvergedMessage::setPriority(enum ConvergedMessage::Priority)
-	?setBodyText@ConvergedMessage@@QAEXABVQString@@@Z @ 21 NONAME ; void ConvergedMessage::setBodyText(class QString const &)
-	?setDirection@ConvergedMessage@@QAEXW4Direction@1@@Z @ 22 NONAME ; void ConvergedMessage::setDirection(enum ConvergedMessage::Direction)
-	?addBccRecipients@ConvergedMessage@@QAEXAAV?$QList@PAVConvergedMessageAddress@@@@@Z @ 23 NONAME ; void ConvergedMessage::addBccRecipients(class QList<class ConvergedMessageAddress *> &)
-	?attachmentType@ConvergedMessageAttachment@@QBEHXZ @ 24 NONAME ; int ConvergedMessageAttachment::attachmentType(void) const
-	?addToRecipients@ConvergedMessage@@QAEXAAV?$QList@PAVConvergedMessageAddress@@@@@Z @ 25 NONAME ; void ConvergedMessage::addToRecipients(class QList<class ConvergedMessageAddress *> &)
-	?serialize@ConvergedMessageAddress@@QBEXAAVQDataStream@@@Z @ 26 NONAME ; void ConvergedMessageAddress::serialize(class QDataStream &) const
-	??0ConvergedMessageAddress@@QAE@ABVQString@@0@Z @ 27 NONAME ; ConvergedMessageAddress::ConvergedMessageAddress(class QString const &, class QString const &)
-	??_EConvergedMessageAddress@@QAE@I@Z @ 28 NONAME ABSENT ; ConvergedMessageAddress::~ConvergedMessageAddress(unsigned int)
-	??_EConvergedMessageAttachment@@QAE@I@Z @ 29 NONAME ABSENT ; ConvergedMessageAttachment::~ConvergedMessageAttachment(unsigned int)
-	?addFromRecipient@ConvergedMessage@@QAEXAAVConvergedMessageAddress@@@Z @ 30 NONAME ; void ConvergedMessage::addFromRecipient(class ConvergedMessageAddress &)
+	?setReplyPath@ConvergedMessage@@QAEX_N@Z @ 4 NONAME ; void ConvergedMessage::setReplyPath(bool)
+	?fromAddress@ConvergedMessage@@QBEPAVConvergedMessageAddress@@XZ @ 5 NONAME ; class ConvergedMessageAddress * ConvergedMessage::fromAddress(void) const
+	?setProperty@ConvergedMessage@@QAEXW4MessageProperty@1@@Z @ 6 NONAME ; void ConvergedMessage::setProperty(enum ConvergedMessage::MessageProperty)
+	?sendingState@ConvergedMessage@@QBE?AW4SendingState@1@XZ @ 7 NONAME ; enum ConvergedMessage::SendingState ConvergedMessage::sendingState(void) const
+	?properties@ConvergedMessage@@QBEGXZ @ 8 NONAME ; unsigned short ConvergedMessage::properties(void) const
+	?address@ConvergedMessageAddress@@QBEABVQString@@XZ @ 9 NONAME ; class QString const & ConvergedMessageAddress::address(void) const
+	??4ConvergedMessageId@@QAEAAV0@ABV0@@Z @ 10 NONAME ; class ConvergedMessageId & ConvergedMessageId::operator=(class ConvergedMessageId const &)
+	?location@ConvergedMessage@@QBE?AW4MessageLocation@1@XZ @ 11 NONAME ; enum ConvergedMessage::MessageLocation ConvergedMessage::location(void) const
+	?setTimeStamp@ConvergedMessage@@QAEX_J@Z @ 12 NONAME ; void ConvergedMessage::setTimeStamp(long long)
+	?setAttachmentType@ConvergedMessageAttachment@@QAEXH@Z @ 13 NONAME ; void ConvergedMessageAttachment::setAttachmentType(int)
+	?setSubject@ConvergedMessage@@QAEXABVQString@@@Z @ 14 NONAME ; void ConvergedMessage::setSubject(class QString const &)
+	?timeStamp@ConvergedMessage@@QBE_JXZ @ 15 NONAME ; long long ConvergedMessage::timeStamp(void) const
+	?bodyText@ConvergedMessage@@QBEABVQString@@XZ @ 16 NONAME ; class QString const & ConvergedMessage::bodyText(void) const
+	??0ConvergedMessageAttachment@@QAE@ABVQString@@H@Z @ 17 NONAME ; ConvergedMessageAttachment::ConvergedMessageAttachment(class QString const &, int)
+	?setAddress@ConvergedMessageAddress@@QAEXABVQString@@@Z @ 18 NONAME ; void ConvergedMessageAddress::setAddress(class QString const &)
+	?addCcRecipient@ConvergedMessage@@QAEXAAVConvergedMessageAddress@@@Z @ 19 NONAME ; void ConvergedMessage::addCcRecipient(class ConvergedMessageAddress &)
+	??0ConvergedMessage@@QAE@ABV0@@Z @ 20 NONAME ; ConvergedMessage::ConvergedMessage(class ConvergedMessage const &)
+	?setPriority@ConvergedMessage@@QAEXW4Priority@1@@Z @ 21 NONAME ; void ConvergedMessage::setPriority(enum ConvergedMessage::Priority)
+	?setBodyText@ConvergedMessage@@QAEXABVQString@@@Z @ 22 NONAME ; void ConvergedMessage::setBodyText(class QString const &)
+	?setDirection@ConvergedMessage@@QAEXW4Direction@1@@Z @ 23 NONAME ; void ConvergedMessage::setDirection(enum ConvergedMessage::Direction)
+	?addBccRecipients@ConvergedMessage@@QAEXAAV?$QList@PAVConvergedMessageAddress@@@@@Z @ 24 NONAME ; void ConvergedMessage::addBccRecipients(class QList<class ConvergedMessageAddress *> &)
+	?attachmentType@ConvergedMessageAttachment@@QBEHXZ @ 25 NONAME ; int ConvergedMessageAttachment::attachmentType(void) const
+	?addToRecipients@ConvergedMessage@@QAEXAAV?$QList@PAVConvergedMessageAddress@@@@@Z @ 26 NONAME ; void ConvergedMessage::addToRecipients(class QList<class ConvergedMessageAddress *> &)
+	?serialize@ConvergedMessageAddress@@QBEXAAVQDataStream@@@Z @ 27 NONAME ; void ConvergedMessageAddress::serialize(class QDataStream &) const
+	??0ConvergedMessageAddress@@QAE@ABVQString@@0@Z @ 28 NONAME ; ConvergedMessageAddress::ConvergedMessageAddress(class QString const &, class QString const &)
+	?addFromRecipient@ConvergedMessage@@QAEXAAVConvergedMessageAddress@@@Z @ 29 NONAME ; void ConvergedMessage::addFromRecipient(class ConvergedMessageAddress &)
+	?setMessageSubType@ConvergedMessage@@QAEXW4MessageSubType@1@@Z @ 30 NONAME ; void ConvergedMessage::setMessageSubType(enum ConvergedMessage::MessageSubType)
 	?addBccRecipient@ConvergedMessage@@QAEXAAVConvergedMessageAddress@@@Z @ 31 NONAME ; void ConvergedMessage::addBccRecipient(class ConvergedMessageAddress &)
 	?direction@ConvergedMessage@@QBE?AW4Direction@1@XZ @ 32 NONAME ; enum ConvergedMessage::Direction ConvergedMessage::direction(void) const
 	?setMessageId@ConvergedMessage@@QAEXAAVConvergedMessageId@@@Z @ 33 NONAME ; void ConvergedMessage::setMessageId(class ConvergedMessageId &)
 	?isUnread@ConvergedMessage@@QBE_NXZ @ 34 NONAME ; bool ConvergedMessage::isUnread(void) const
 	?setAlias@ConvergedMessageAddress@@QAEXABVQString@@@Z @ 35 NONAME ; void ConvergedMessageAddress::setAlias(class QString const &)
-	?setLocation@ConvergedMessage@@QAEXW4MessageLocation@1@@Z @ 36 NONAME ; void ConvergedMessage::setLocation(enum ConvergedMessage::MessageLocation)
-	?addAttachments@ConvergedMessage@@QAEXAAV?$QList@PAVConvergedMessageAttachment@@@@@Z @ 37 NONAME ; void ConvergedMessage::addAttachments(class QList<class ConvergedMessageAttachment *> &)
-	?bccAddressList@ConvergedMessage@@QBE?BV?$QList@PAVConvergedMessageAddress@@@@XZ @ 38 NONAME ; class QList<class ConvergedMessageAddress *> const ConvergedMessage::bccAddressList(void) const
-	?attachments@ConvergedMessage@@QBE?AV?$QList@PAVConvergedMessageAttachment@@@@XZ @ 39 NONAME ; class QList<class ConvergedMessageAttachment *> ConvergedMessage::attachments(void) const
-	?priority@ConvergedMessage@@QBE?AW4Priority@1@XZ @ 40 NONAME ; enum ConvergedMessage::Priority ConvergedMessage::priority(void) const
-	?getId@ConvergedMessageId@@QBEHXZ @ 41 NONAME ; int ConvergedMessageId::getId(void) const
-	?deserialize@ConvergedMessageAddress@@QAEXAAVQDataStream@@@Z @ 42 NONAME ; void ConvergedMessageAddress::deserialize(class QDataStream &)
-	?hasAttachment@ConvergedMessage@@QBE_NXZ @ 43 NONAME ; bool ConvergedMessage::hasAttachment(void) const
-	?setId@ConvergedMessageId@@QAEXH@Z @ 44 NONAME ; void ConvergedMessageId::setId(int)
-	?setMessageType@ConvergedMessage@@QAEXW4MessageType@1@@Z @ 45 NONAME ; void ConvergedMessage::setMessageType(enum ConvergedMessage::MessageType)
-	?id@ConvergedMessage@@QBEPAVConvergedMessageId@@XZ @ 46 NONAME ; class ConvergedMessageId * ConvergedMessage::id(void) const
-	??0ConvergedMessage@@QAE@ABVConvergedMessageId@@@Z @ 47 NONAME ; ConvergedMessage::ConvergedMessage(class ConvergedMessageId const &)
-	??0ConvergedMessage@@QAE@W4MessageType@0@@Z @ 48 NONAME ; ConvergedMessage::ConvergedMessage(enum ConvergedMessage::MessageType)
-	?addToRecipient@ConvergedMessage@@QAEXAAVConvergedMessageAddress@@@Z @ 49 NONAME ; void ConvergedMessage::addToRecipient(class ConvergedMessageAddress &)
-	?subject@ConvergedMessage@@QBEABVQString@@XZ @ 50 NONAME ; class QString const & ConvergedMessage::subject(void) const
-	?alias@ConvergedMessageAddress@@QBEABVQString@@XZ @ 51 NONAME ; class QString const & ConvergedMessageAddress::alias(void) const
-	?ccAddressList@ConvergedMessage@@QBE?BV?$QList@PAVConvergedMessageAddress@@@@XZ @ 52 NONAME ; class QList<class ConvergedMessageAddress *> const ConvergedMessage::ccAddressList(void) const
-	??1ConvergedMessageAddress@@QAE@XZ @ 53 NONAME ; ConvergedMessageAddress::~ConvergedMessageAddress(void)
-	?messageType@ConvergedMessage@@QBE?AW4MessageType@1@XZ @ 54 NONAME ; enum ConvergedMessage::MessageType ConvergedMessage::messageType(void) const
-	?deserialize@ConvergedMessageAttachment@@QAEXAAVQDataStream@@@Z @ 55 NONAME ; void ConvergedMessageAttachment::deserialize(class QDataStream &)
-	??1ConvergedMessageAttachment@@QAE@XZ @ 56 NONAME ; ConvergedMessageAttachment::~ConvergedMessageAttachment(void)
-	?serialize@ConvergedMessage@@QBEXAAVQDataStream@@@Z @ 57 NONAME ; void ConvergedMessage::serialize(class QDataStream &) const
-	??0ConvergedMessageId@@QAE@ABV0@@Z @ 58 NONAME ; ConvergedMessageId::ConvergedMessageId(class ConvergedMessageId const &)
-	?serialize@ConvergedMessageId@@QBEXAAVQDataStream@@@Z @ 59 NONAME ; void ConvergedMessageId::serialize(class QDataStream &) const
-	?setSendingState@ConvergedMessage@@QAEXW4SendingState@1@@Z @ 60 NONAME ; void ConvergedMessage::setSendingState(enum ConvergedMessage::SendingState)
-	??8ConvergedMessageAttachment@@QBE_NABV0@@Z @ 61 NONAME ; bool ConvergedMessageAttachment::operator==(class ConvergedMessageAttachment const &) const
-	??8ConvergedMessageId@@QBE_NABV0@@Z @ 62 NONAME ; bool ConvergedMessageId::operator==(class ConvergedMessageId const &) const
-	?deserialize@ConvergedMessageId@@QAEXAAVQDataStream@@@Z @ 63 NONAME ; void ConvergedMessageId::deserialize(class QDataStream &)
-	?filePath@ConvergedMessageAttachment@@QBEABVQString@@XZ @ 64 NONAME ; class QString const & ConvergedMessageAttachment::filePath(void) const
-	??1ConvergedMessage@@QAE@XZ @ 65 NONAME ; ConvergedMessage::~ConvergedMessage(void)
-	?addCcRecipients@ConvergedMessage@@QAEXAAV?$QList@PAVConvergedMessageAddress@@@@@Z @ 66 NONAME ; void ConvergedMessage::addCcRecipients(class QList<class ConvergedMessageAddress *> &)
-	?deserialize@ConvergedMessage@@QAEXAAVQDataStream@@@Z @ 67 NONAME ; void ConvergedMessage::deserialize(class QDataStream &)
-	?setFilePath@ConvergedMessageAttachment@@QAEXABVQString@@@Z @ 68 NONAME ; void ConvergedMessageAttachment::setFilePath(class QString const &)
-	?setMessageSubType@ConvergedMessage@@QAEXW4MessageSubType@1@@Z @ 69 NONAME ; void ConvergedMessage::setMessageSubType(enum ConvergedMessage::MessageSubType)
-	?messageSubType@ConvergedMessage@@QBE?AW4MessageSubType@1@XZ @ 70 NONAME ; enum ConvergedMessage::MessageSubType ConvergedMessage::messageSubType(void) const
+	?setOriginatingSC@ConvergedMessage@@QAEXABVQString@@@Z @ 36 NONAME ; void ConvergedMessage::setOriginatingSC(class QString const &)
+	?setLocation@ConvergedMessage@@QAEXW4MessageLocation@1@@Z @ 37 NONAME ; void ConvergedMessage::setLocation(enum ConvergedMessage::MessageLocation)
+	?addAttachments@ConvergedMessage@@QAEXAAV?$QList@PAVConvergedMessageAttachment@@@@@Z @ 38 NONAME ; void ConvergedMessage::addAttachments(class QList<class ConvergedMessageAttachment *> &)
+	?bccAddressList@ConvergedMessage@@QBE?BV?$QList@PAVConvergedMessageAddress@@@@XZ @ 39 NONAME ; class QList<class ConvergedMessageAddress *> const ConvergedMessage::bccAddressList(void) const
+	?attachments@ConvergedMessage@@QBE?AV?$QList@PAVConvergedMessageAttachment@@@@XZ @ 40 NONAME ; class QList<class ConvergedMessageAttachment *> ConvergedMessage::attachments(void) const
+	?priority@ConvergedMessage@@QBE?AW4Priority@1@XZ @ 41 NONAME ; enum ConvergedMessage::Priority ConvergedMessage::priority(void) const
+	?replyPath@ConvergedMessage@@QAE_NXZ @ 42 NONAME ; bool ConvergedMessage::replyPath(void)
+	?getId@ConvergedMessageId@@QBEHXZ @ 43 NONAME ; int ConvergedMessageId::getId(void) const
+	?deserialize@ConvergedMessageAddress@@QAEXAAVQDataStream@@@Z @ 44 NONAME ; void ConvergedMessageAddress::deserialize(class QDataStream &)
+	?hasAttachment@ConvergedMessage@@QBE_NXZ @ 45 NONAME ; bool ConvergedMessage::hasAttachment(void) const
+	?setId@ConvergedMessageId@@QAEXH@Z @ 46 NONAME ; void ConvergedMessageId::setId(int)
+	?setMessageType@ConvergedMessage@@QAEXW4MessageType@1@@Z @ 47 NONAME ; void ConvergedMessage::setMessageType(enum ConvergedMessage::MessageType)
+	?originatingSC@ConvergedMessage@@QBEABVQString@@XZ @ 48 NONAME ; class QString const & ConvergedMessage::originatingSC(void) const
+	?id@ConvergedMessage@@QBEPAVConvergedMessageId@@XZ @ 49 NONAME ; class ConvergedMessageId * ConvergedMessage::id(void) const
+	??0ConvergedMessage@@QAE@ABVConvergedMessageId@@@Z @ 50 NONAME ; ConvergedMessage::ConvergedMessage(class ConvergedMessageId const &)
+	??0ConvergedMessage@@QAE@W4MessageType@0@@Z @ 51 NONAME ; ConvergedMessage::ConvergedMessage(enum ConvergedMessage::MessageType)
+	?addToRecipient@ConvergedMessage@@QAEXAAVConvergedMessageAddress@@@Z @ 52 NONAME ; void ConvergedMessage::addToRecipient(class ConvergedMessageAddress &)
+	?subject@ConvergedMessage@@QBEABVQString@@XZ @ 53 NONAME ; class QString const & ConvergedMessage::subject(void) const
+	?alias@ConvergedMessageAddress@@QBEABVQString@@XZ @ 54 NONAME ; class QString const & ConvergedMessageAddress::alias(void) const
+	?messageSubType@ConvergedMessage@@QBE?AW4MessageSubType@1@XZ @ 55 NONAME ; enum ConvergedMessage::MessageSubType ConvergedMessage::messageSubType(void) const
+	?ccAddressList@ConvergedMessage@@QBE?BV?$QList@PAVConvergedMessageAddress@@@@XZ @ 56 NONAME ; class QList<class ConvergedMessageAddress *> const ConvergedMessage::ccAddressList(void) const
+	??1ConvergedMessageAddress@@QAE@XZ @ 57 NONAME ; ConvergedMessageAddress::~ConvergedMessageAddress(void)
+	?messageType@ConvergedMessage@@QBE?AW4MessageType@1@XZ @ 58 NONAME ; enum ConvergedMessage::MessageType ConvergedMessage::messageType(void) const
+	?deserialize@ConvergedMessageAttachment@@QAEXAAVQDataStream@@@Z @ 59 NONAME ; void ConvergedMessageAttachment::deserialize(class QDataStream &)
+	??1ConvergedMessageAttachment@@QAE@XZ @ 60 NONAME ; ConvergedMessageAttachment::~ConvergedMessageAttachment(void)
+	?serialize@ConvergedMessage@@QBEXAAVQDataStream@@@Z @ 61 NONAME ; void ConvergedMessage::serialize(class QDataStream &) const
+	??0ConvergedMessageId@@QAE@ABV0@@Z @ 62 NONAME ; ConvergedMessageId::ConvergedMessageId(class ConvergedMessageId const &)
+	?serialize@ConvergedMessageId@@QBEXAAVQDataStream@@@Z @ 63 NONAME ; void ConvergedMessageId::serialize(class QDataStream &) const
+	?setSendingState@ConvergedMessage@@QAEXW4SendingState@1@@Z @ 64 NONAME ; void ConvergedMessage::setSendingState(enum ConvergedMessage::SendingState)
+	??8ConvergedMessageAttachment@@QBE_NABV0@@Z @ 65 NONAME ; bool ConvergedMessageAttachment::operator==(class ConvergedMessageAttachment const &) const
+	?deserialize@ConvergedMessageId@@QAEXAAVQDataStream@@@Z @ 66 NONAME ; void ConvergedMessageId::deserialize(class QDataStream &)
+	??8ConvergedMessageId@@QBE_NABV0@@Z @ 67 NONAME ; bool ConvergedMessageId::operator==(class ConvergedMessageId const &) const
+	?filePath@ConvergedMessageAttachment@@QBEABVQString@@XZ @ 68 NONAME ; class QString const & ConvergedMessageAttachment::filePath(void) const
+	??1ConvergedMessage@@QAE@XZ @ 69 NONAME ; ConvergedMessage::~ConvergedMessage(void)
+	?addCcRecipients@ConvergedMessage@@QAEXAAV?$QList@PAVConvergedMessageAddress@@@@@Z @ 70 NONAME ; void ConvergedMessage::addCcRecipients(class QList<class ConvergedMessageAddress *> &)
+	?deserialize@ConvergedMessage@@QAEXAAVQDataStream@@@Z @ 71 NONAME ; void ConvergedMessage::deserialize(class QDataStream &)
+	?setFilePath@ConvergedMessageAttachment@@QAEXABVQString@@@Z @ 72 NONAME ; void ConvergedMessageAttachment::setFilePath(class QString const &)
 
--- a/messagingapp/msgutils/convergedmessageutils/inc/convergedmessageimpl.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/convergedmessageutils/inc/convergedmessageimpl.h	Fri Sep 17 08:28:39 2010 +0300
@@ -286,6 +286,33 @@
      * @param stream data stream from which data is deserialized.
      */
     void deserialize(QDataStream &stream);
+    
+    /**
+     * Sets the message property, if reply-path is present
+     * @param replypath, TP-RP (Reply Path) Found in first octet of
+     * Submit and Deliver PDU
+     */
+    void setReplyPath(bool replypath);
+    
+    /**
+     * Tells if the reply-path is set for this message
+     * @return bool, if the reply-path exists
+     */
+    bool replyPath();
+    
+    /**
+     * Set originating service center address. This is used for reply
+     * purposes, if the reply-via-same-smsc flag is ON
+     * @param scaddress, service center address
+     */
+    void setOriginatingSC(const QString& scaddress);
+    
+    /**
+     * Get originating service center address,
+     * if preserved for reply-via-same-smsc
+     * @return originating service center address
+     */
+    const QString& originatingSC() const;
 
 private:
     /**
@@ -379,6 +406,12 @@
      * Messaging sending states
      */
     quint8 mSendingState;
+    
+    /**
+     * Originating SC, 
+     * to be used only when reply-path is available
+     */
+    QString mOriginatingSC;    
     };
 
 #endif // CONVERGED_MESSAGE_IMPL_H
--- a/messagingapp/msgutils/convergedmessageutils/src/convergedmessage.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/convergedmessageutils/src/convergedmessage.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -416,5 +416,41 @@
     mConvergedMessageImpl->deserialize(stream);
     }
 
+//----------------------------------------------------------------
+// ConvergedMessage::setReplyPath
+// @see header
+//----------------------------------------------------------------
+void ConvergedMessage::setReplyPath(bool replypath)
+    {
+    mConvergedMessageImpl->setReplyPath(replypath);
+    }
+
+//----------------------------------------------------------------
+// ConvergedMessage::replyPath
+// @see header
+//----------------------------------------------------------------
+bool ConvergedMessage::replyPath()
+    {
+    return mConvergedMessageImpl->replyPath();
+    }
+
+//----------------------------------------------------------------
+// ConvergedMessage::setOriginatingSC
+// @see header
+//----------------------------------------------------------------
+void ConvergedMessage::setOriginatingSC(const QString& scaddress)
+    {
+    mConvergedMessageImpl->setOriginatingSC(scaddress);
+    }
+
+//----------------------------------------------------------------
+// ConvergedMessage::originatingSC
+// @see header
+//----------------------------------------------------------------
+const QString& ConvergedMessage::originatingSC() const
+    {
+    return mConvergedMessageImpl->originatingSC();
+    }
+
 // eof
 
--- a/messagingapp/msgutils/convergedmessageutils/src/convergedmessageimpl.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/convergedmessageutils/src/convergedmessageimpl.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -38,7 +38,8 @@
             mPriority(ConvergedMessage::Normal), mLocation(
                     ConvergedMessage::Delete), mDirection(
                     ConvergedMessage::Incoming), mSendingState(
-                    ConvergedMessage::Unknown)
+                    ConvergedMessage::Unknown),
+    mOriginatingSC(0)
     {
     mMessageType = messageType;
     mId = new ConvergedMessageId();
@@ -56,11 +57,11 @@
             mPriority(ConvergedMessage::Normal), mLocation(
                     ConvergedMessage::Delete), mDirection(
                     ConvergedMessage::Incoming), mSendingState(
-                    ConvergedMessage::Unknown)
+                    ConvergedMessage::Unknown),
+    mOriginatingSC(0)
     {
     mId = new ConvergedMessageId(id);
     mFromAddress = new ConvergedMessageAddress();
-
     }
 
 //----------------------------------------------------------------
@@ -121,6 +122,7 @@
     mLocation = msg.location();
     mDirection = msg.direction();
     mSendingState = msg.sendingState();
+    mOriginatingSC = QString(msg.originatingSC());
     }
 
 //----------------------------------------------------------------
@@ -507,7 +509,6 @@
         ConvergedMessageAttachmentList attachmentList)
     {
     mAttachments.append(attachmentList);
-
     }
 
 //----------------------------------------------------------------
@@ -560,6 +561,7 @@
     stream << mLocation;
     stream << mDirection;
     stream << mSendingState;
+    stream << mOriginatingSC;
     }
 
 //----------------------------------------------------------------
@@ -633,6 +635,52 @@
     stream >> mLocation;
     stream >> mDirection;
     stream >> mSendingState;
+    stream >> mOriginatingSC;
+    }
+
+//----------------------------------------------------------------
+// ConvergedMessageImpl::setReplyPath
+// @see header
+//----------------------------------------------------------------
+void ConvergedMessageImpl::setReplyPath(bool replypath)
+    {
+    if( replypath )
+        {
+        // set replypath property
+        mProperty |= ConvergedMessage::ReplyPath;
+        }
+    else
+        {
+        // reset replypath property
+        mProperty &= ~ConvergedMessage::ReplyPath;
+        }
+    }
+
+//----------------------------------------------------------------
+// ConvergedMessageImpl::replyPath
+// @see header
+//----------------------------------------------------------------
+bool ConvergedMessageImpl::replyPath()
+    {
+    return mProperty & ConvergedMessage::ReplyPath;
+    }
+
+//----------------------------------------------------------------
+// ConvergedMessageImpl::setOriginatingSC
+// @see header
+//----------------------------------------------------------------
+void ConvergedMessageImpl::setOriginatingSC(const QString& scaddress)
+    {
+    mOriginatingSC = scaddress;
+    }
+    
+//----------------------------------------------------------------
+// ConvergedMessageImpl::originatingSC
+// @see header
+//----------------------------------------------------------------
+const QString& ConvergedMessageImpl::originatingSC() const
+    {
+    return mOriginatingSC;
     }
 
 // eof
--- a/messagingapp/msgutils/convergedmessageutils/tsrc/testconvergedmessageutilsapp/mmstestbed/mmstestbed.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/convergedmessageutils/tsrc/testconvergedmessageutilsapp/mmstestbed/mmstestbed.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -11,29 +11,36 @@
 #
 # Contributors:
 #
-# Description: Project Definiton File for mmstestbed
+# Description:
 #
 
-QT += testlib
+#QT += testlib
 QT -= gui
 
-CONFIG += hb
-CONFIG += symbian_test
-CONFIG += qtestlib
-
 TEMPLATE = lib
 
+CONFIG += hb
+#CONFIG += qtestlib
+CONFIG += symbian_test
 TARGET = mmstestbed
 
 INCLUDEPATH += .
 INCLUDEPATH += inc
 INCLUDEPATH += ../../../inc
+
 INCLUDEPATH += ../../../../../../mmsengine/inc
+INCLUDEPATH += ../../../../../../mmsengine/mmsserver/inc
+INCLUDEPATH += ../../../../../../mmsengine/mmsmessage/inc
 INCLUDEPATH += ../../../../../../mmsengine/mmscodec/inc
-INCLUDEPATH += ../../../../../../mmsengine/mmshttptransport/inc
-INCLUDEPATH += ../../../../../../mmsengine/mmsmessage/inc
-INCLUDEPATH += ../../../../../../mmsengine/mmsconninit/inc
-INCLUDEPATH += ../../../../../../mmsengine/mmsserver/inc
+INCLUDEPATH += ../../../../../../inc
+INCLUDEPATH += ../../../../../../mmsengine/mmsengine/inc
+INCLUDEPATH += ../../../../../../../../mmsengine/inc
+INCLUDEPATH += ../../../../../../../../mmsengine/mmscodec/inc
+INCLUDEPATH += ../../../../../../../../mmsengine/mmshttptransport/inc
+INCLUDEPATH += ../../../../../../../../mmsengine/mmsmessage/inc
+INCLUDEPATH += ../../../../../../../../mmsengine/mmsconninit/inc
+#INCLUDEPATH += ../../../../mmsengine/mmscodec/inc
+INCLUDEPATH += ../../../../../../../../mmsengine/mmsserver/inc
 INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
 
 DEFINES += BUILD_MMSTESTBED_DLL
@@ -51,23 +58,23 @@
 
 SYMBIAN_PLATFORMS = WINSCW ARMV5
 
+defBlock = \
+	"$${LITERAL_HASH}if defined(EABI)" \
+	"DEFFILE eabi/mmstestbedu.def" \
+	"$${LITERAL_HASH}else" \
+	"DEFFILE bwins/mmstestbedu.def" \
+	"$${LITERAL_HASH}endif"
+
+
 symbian {
     TARGET.UID3 =  0xE5c588a1
     TARGET.CAPABILITY = CAP_GENERAL_DLL
     TARGET.EPOCSTACKSIZE = 0x8000
     TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000
-    TARGET.EPOCALLOWDLLDATA = 1 
+    TARGET.EPOCALLOWDLLDATA = 1
     VENDORID =  VID_DEFAULT
 	}
 
-#Def File rules
-defBlock = \
-"$${LITERAL_HASH}if defined(EABI)" \
-"DEFFILE eabi/mmstestbedu.def" \
-"$${LITERAL_HASH}else" \
-"DEFFILE bwins/mmstestbedu.def" \
-"$${LITERAL_HASH}endif"
-
 # Build.inf rules
 BLD_INF_RULES.prj_exports += \
      "$${LITERAL_HASH}include <platform_paths.hrh>"
--- a/messagingapp/msgutils/convergedmessageutils/tsrc/testconvergedmessageutilsapp/testconvergedmessageutils/inc/testconvergedmessageutils.ini	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/convergedmessageutils/tsrc/testconvergedmessageutilsapp/testconvergedmessageutils/inc/testconvergedmessageutils.ini	Fri Sep 17 08:28:39 2010 +0300
@@ -21,14 +21,3 @@
 const char TEST_CC[]			= "DummyCCAddress";
 const char TEST_BCC[]			= "DummyBCCAddress";
 const char TEST_ALIAS[]			= "DummySenderAlias";
-
-//out put directory for test results.
-QString OUTPUTDIRECTORY = "c:/logs/TestConvergedMessageUtils";
-//o/p directory for data to be written on temp file.
-QString TEMPDIR = "c:/logs/TestConvergedMessageUtils/testdata";
-//test result O/P file name.
-QString RESULTFILE = "c:/logs/TestConvergedMessageUtils/result_%1.txt";
-// folder named UID3 of msgapptestsuite inside private folder.
-const QString PRIVATE_DIR("C:/private/E39cd515");
-//application class name
-const QString appClassName("TestConvergedMessageUtils");
\ No newline at end of file
--- a/messagingapp/msgutils/convergedmessageutils/tsrc/testconvergedmessageutilsapp/testconvergedmessageutils/src/testconvergedmessageutils.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/convergedmessageutils/tsrc/testconvergedmessageutilsapp/testconvergedmessageutils/src/testconvergedmessageutils.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -265,67 +265,30 @@
 }
 
 //---------------------------------------------------------------
-// getObject
-// factory method to create objects.
-//---------------------------------------------------------------
-QObject* getObject(QString className)
-{
-    if(className == "TestConvergedMessageUtils" )
-    {
-        return new TestConvergedMessageUtils;
-    }
- 	else
-	{
-		return 0;
-	}
-}
-
-//---------------------------------------------------------------
-// createOutPutDirectory
-// creating o/p directory.
-//---------------------------------------------------------------
-void createOutPutDirectory()
-    {
-    QDir dir;
-    //o/p dir
-    dir.mkdir(OUTPUTDIRECTORY);
-    //tmp dir
-    dir.mkdir(TEMPDIR);
-    // dir inside private folder.
-    dir.mkdir(PRIVATE_DIR);
-    }
-
-//---------------------------------------------------------------
 // main
 // main entry point
 //---------------------------------------------------------------
 int main(int argc, char *argv[])
     { 
-    int ret = -1;
-    QCoreApplication app(argc, argv);    
-    
-    //creating output directory.
-    createOutPutDirectory();
-    
-	QStringList args;
-	QString appName = argv[0];
-	args << appName;
-
-	QString option  = "-o";
-	args << option;
-
-	QString outFile = RESULTFILE;
-	outFile = outFile.arg(appClassName);
-	args << outFile;
-
-	QObject* tc = getObject(appClassName);
-
-	if(tc)
-		{
-		ret =  QTest::qExec(tc, args); 
-		delete tc;
-		}
-    return ret;
+	int ret = -1;
+	QCoreApplication app(argc, argv);
+	QObject* tc = new TestConvergedMessageUtils();
+	
+#ifdef __WINSCW__
+	char *new_argv[3]; 
+	QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log";	
+	QByteArray bytes = str.toAscii();	
+	char arg1[] = "-o";	
+	new_argv[0] = argv[0];	
+	new_argv[1] = arg1;	
+	new_argv[2] = bytes.data();	
+	ret = QTest::qExec(tc, 3, new_argv);
+#else
+	ret = QTest::qExec(tc, argc, argv);	
+#endif
+	
+	delete tc;
+	return ret;
     }
 
 //End of File
--- a/messagingapp/msgutils/convergedmessageutils/tsrc/testconvergedmessageutilsapp/testconvergedmessageutils/testconvergedmessageutils.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/convergedmessageutils/tsrc/testconvergedmessageutilsapp/testconvergedmessageutils/testconvergedmessageutils.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -52,7 +52,8 @@
 SYMBIAN_PLATFORMS = WINSCW ARMV5
     symbian {
     TARGET.UID3 =  0xE39cd515
-    TARGET.CAPABILITY = All -TCB -DRM
+#    TARGET.CAPABILITY = All -TCB -DRM
+    TARGET.CAPABILITY = CAP_APPLICATION
     TARGET.EPOCSTACKSIZE = 0x8000
     TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000
     VENDORID =  VID_DEFAULT
--- a/messagingapp/msgutils/convergedmessageutils/tsrc/testconvergedmessageutilsapp/testconvergedmessageutilsapp.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/convergedmessageutils/tsrc/testconvergedmessageutilsapp/testconvergedmessageutilsapp.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -16,7 +16,7 @@
 
 TEMPLATE = subdirs
 
-SUBDIRS += mmstestbed/mmstestbed.pro 
-SUBDIRS += testconvergedmessageutils/testconvergedmessageutils.pro 
+SUBDIRS += mmstestbed
+SUBDIRS += testconvergedmessageutils 
 
 CONFIG += ordered
\ No newline at end of file
--- a/messagingapp/msgutils/convergedmessageutils/tsrc/tsrc.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/convergedmessageutils/tsrc/tsrc.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -16,6 +16,6 @@
 
 TEMPLATE = subdirs
 
-SUBDIRS += testconvergedmessageutilsapp/testconvergedmessageutilsapp.pro 
+SUBDIRS += testconvergedmessageutilsapp
 
 CONFIG += ordered
\ No newline at end of file
--- a/messagingapp/msgutils/eabi/convergedmessageutilsu.def	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/eabi/convergedmessageutilsu.def	Fri Sep 17 08:28:39 2010 +0300
@@ -7,74 +7,78 @@
 	_ZN16ConvergedMessage11setPropertyENS_15MessagePropertyE @ 6 NONAME
 	_ZN16ConvergedMessage12setDirectionENS_9DirectionE @ 7 NONAME
 	_ZN16ConvergedMessage12setMessageIdER18ConvergedMessageId @ 8 NONAME
-	_ZN16ConvergedMessage12setTimeStampEx @ 9 NONAME
-	_ZN16ConvergedMessage14addAttachmentsER5QListIP26ConvergedMessageAttachmentE @ 10 NONAME
-	_ZN16ConvergedMessage14addCcRecipientER23ConvergedMessageAddress @ 11 NONAME
-	_ZN16ConvergedMessage14addToRecipientER23ConvergedMessageAddress @ 12 NONAME
-	_ZN16ConvergedMessage14setMessageTypeENS_11MessageTypeE @ 13 NONAME
-	_ZN16ConvergedMessage15addBccRecipientER23ConvergedMessageAddress @ 14 NONAME
-	_ZN16ConvergedMessage15addCcRecipientsER5QListIP23ConvergedMessageAddressE @ 15 NONAME
-	_ZN16ConvergedMessage15addToRecipientsER5QListIP23ConvergedMessageAddressE @ 16 NONAME
-	_ZN16ConvergedMessage15setSendingStateENS_12SendingStateE @ 17 NONAME
-	_ZN16ConvergedMessage16addBccRecipientsER5QListIP23ConvergedMessageAddressE @ 18 NONAME
-	_ZN16ConvergedMessage16addFromRecipientER23ConvergedMessageAddress @ 19 NONAME
-	_ZN16ConvergedMessageC1ENS_11MessageTypeE @ 20 NONAME
-	_ZN16ConvergedMessageC1ERK18ConvergedMessageId @ 21 NONAME
-	_ZN16ConvergedMessageC1ERKS_ @ 22 NONAME
-	_ZN16ConvergedMessageC2ENS_11MessageTypeE @ 23 NONAME
-	_ZN16ConvergedMessageC2ERK18ConvergedMessageId @ 24 NONAME
-	_ZN16ConvergedMessageC2ERKS_ @ 25 NONAME
-	_ZN16ConvergedMessageD1Ev @ 26 NONAME
-	_ZN16ConvergedMessageD2Ev @ 27 NONAME
-	_ZN18ConvergedMessageId11deserializeER11QDataStream @ 28 NONAME
-	_ZN18ConvergedMessageId5setIdEi @ 29 NONAME
-	_ZN18ConvergedMessageIdC1ERKS_ @ 30 NONAME
-	_ZN18ConvergedMessageIdC1Ei @ 31 NONAME
-	_ZN18ConvergedMessageIdC2ERKS_ @ 32 NONAME
-	_ZN18ConvergedMessageIdC2Ei @ 33 NONAME
-	_ZN18ConvergedMessageIdaSERKS_ @ 34 NONAME
-	_ZN23ConvergedMessageAddress10setAddressERK7QString @ 35 NONAME
-	_ZN23ConvergedMessageAddress11deserializeER11QDataStream @ 36 NONAME
-	_ZN23ConvergedMessageAddress8setAliasERK7QString @ 37 NONAME
-	_ZN23ConvergedMessageAddressC1ERK7QStringS2_ @ 38 NONAME
-	_ZN23ConvergedMessageAddressC2ERK7QStringS2_ @ 39 NONAME
-	_ZN23ConvergedMessageAddressD1Ev @ 40 NONAME
-	_ZN23ConvergedMessageAddressD2Ev @ 41 NONAME
-	_ZN26ConvergedMessageAttachment11deserializeER11QDataStream @ 42 NONAME
-	_ZN26ConvergedMessageAttachment11setFilePathERK7QString @ 43 NONAME
-	_ZN26ConvergedMessageAttachment17setAttachmentTypeEi @ 44 NONAME
-	_ZN26ConvergedMessageAttachmentC1ERK7QStringi @ 45 NONAME
-	_ZN26ConvergedMessageAttachmentC2ERK7QStringi @ 46 NONAME
-	_ZN26ConvergedMessageAttachmentD1Ev @ 47 NONAME
-	_ZN26ConvergedMessageAttachmentD2Ev @ 48 NONAME
-	_ZNK16ConvergedMessage10propertiesEv @ 49 NONAME
-	_ZNK16ConvergedMessage11attachmentsEv @ 50 NONAME
-	_ZNK16ConvergedMessage11fromAddressEv @ 51 NONAME
-	_ZNK16ConvergedMessage11messageTypeEv @ 52 NONAME
-	_ZNK16ConvergedMessage12sendingStateEv @ 53 NONAME
-	_ZNK16ConvergedMessage13ccAddressListEv @ 54 NONAME
-	_ZNK16ConvergedMessage13hasAttachmentEv @ 55 NONAME
-	_ZNK16ConvergedMessage13toAddressListEv @ 56 NONAME
-	_ZNK16ConvergedMessage14bccAddressListEv @ 57 NONAME
-	_ZNK16ConvergedMessage2idEv @ 58 NONAME
-	_ZNK16ConvergedMessage7subjectEv @ 59 NONAME
-	_ZNK16ConvergedMessage8bodyTextEv @ 60 NONAME
-	_ZNK16ConvergedMessage8isUnreadEv @ 61 NONAME
-	_ZNK16ConvergedMessage8locationEv @ 62 NONAME
-	_ZNK16ConvergedMessage8priorityEv @ 63 NONAME
-	_ZNK16ConvergedMessage9directionEv @ 64 NONAME
-	_ZNK16ConvergedMessage9serializeER11QDataStream @ 65 NONAME
-	_ZNK16ConvergedMessage9timeStampEv @ 66 NONAME
-	_ZNK18ConvergedMessageId5getIdEv @ 67 NONAME
-	_ZNK18ConvergedMessageId9serializeER11QDataStream @ 68 NONAME
-	_ZNK18ConvergedMessageIdeqERKS_ @ 69 NONAME
-	_ZNK23ConvergedMessageAddress5aliasEv @ 70 NONAME
-	_ZNK23ConvergedMessageAddress7addressEv @ 71 NONAME
-	_ZNK23ConvergedMessageAddress9serializeER11QDataStream @ 72 NONAME
-	_ZNK26ConvergedMessageAttachment14attachmentTypeEv @ 73 NONAME
-	_ZNK26ConvergedMessageAttachment8filePathEv @ 74 NONAME
-	_ZNK26ConvergedMessageAttachment9serializeER11QDataStream @ 75 NONAME
-	_ZNK26ConvergedMessageAttachmenteqERKS_ @ 76 NONAME
-	_ZN16ConvergedMessage17setMessageSubTypeENS_14MessageSubTypeE @ 77 NONAME
-	_ZNK16ConvergedMessage14messageSubTypeEv @ 78 NONAME
+	_ZN16ConvergedMessage12setReplyPathEb @ 9 NONAME
+	_ZN16ConvergedMessage12setTimeStampEx @ 10 NONAME
+	_ZN16ConvergedMessage14addAttachmentsER5QListIP26ConvergedMessageAttachmentE @ 11 NONAME
+	_ZN16ConvergedMessage14addCcRecipientER23ConvergedMessageAddress @ 12 NONAME
+	_ZN16ConvergedMessage14addToRecipientER23ConvergedMessageAddress @ 13 NONAME
+	_ZN16ConvergedMessage14setMessageTypeENS_11MessageTypeE @ 14 NONAME
+	_ZN16ConvergedMessage15addBccRecipientER23ConvergedMessageAddress @ 15 NONAME
+	_ZN16ConvergedMessage15addCcRecipientsER5QListIP23ConvergedMessageAddressE @ 16 NONAME
+	_ZN16ConvergedMessage15addToRecipientsER5QListIP23ConvergedMessageAddressE @ 17 NONAME
+	_ZN16ConvergedMessage15setSendingStateENS_12SendingStateE @ 18 NONAME
+	_ZN16ConvergedMessage16addBccRecipientsER5QListIP23ConvergedMessageAddressE @ 19 NONAME
+	_ZN16ConvergedMessage16addFromRecipientER23ConvergedMessageAddress @ 20 NONAME
+	_ZN16ConvergedMessage16setOriginatingSCERK7QString @ 21 NONAME
+	_ZN16ConvergedMessage17setMessageSubTypeENS_14MessageSubTypeE @ 22 NONAME
+	_ZN16ConvergedMessage9replyPathEv @ 23 NONAME
+	_ZN16ConvergedMessageC1ENS_11MessageTypeE @ 24 NONAME
+	_ZN16ConvergedMessageC1ERK18ConvergedMessageId @ 25 NONAME
+	_ZN16ConvergedMessageC1ERKS_ @ 26 NONAME
+	_ZN16ConvergedMessageC2ENS_11MessageTypeE @ 27 NONAME
+	_ZN16ConvergedMessageC2ERK18ConvergedMessageId @ 28 NONAME
+	_ZN16ConvergedMessageC2ERKS_ @ 29 NONAME
+	_ZN16ConvergedMessageD1Ev @ 30 NONAME
+	_ZN16ConvergedMessageD2Ev @ 31 NONAME
+	_ZN18ConvergedMessageId11deserializeER11QDataStream @ 32 NONAME
+	_ZN18ConvergedMessageId5setIdEi @ 33 NONAME
+	_ZN18ConvergedMessageIdC1ERKS_ @ 34 NONAME
+	_ZN18ConvergedMessageIdC1Ei @ 35 NONAME
+	_ZN18ConvergedMessageIdC2ERKS_ @ 36 NONAME
+	_ZN18ConvergedMessageIdC2Ei @ 37 NONAME
+	_ZN18ConvergedMessageIdaSERKS_ @ 38 NONAME
+	_ZN23ConvergedMessageAddress10setAddressERK7QString @ 39 NONAME
+	_ZN23ConvergedMessageAddress11deserializeER11QDataStream @ 40 NONAME
+	_ZN23ConvergedMessageAddress8setAliasERK7QString @ 41 NONAME
+	_ZN23ConvergedMessageAddressC1ERK7QStringS2_ @ 42 NONAME
+	_ZN23ConvergedMessageAddressC2ERK7QStringS2_ @ 43 NONAME
+	_ZN23ConvergedMessageAddressD1Ev @ 44 NONAME
+	_ZN23ConvergedMessageAddressD2Ev @ 45 NONAME
+	_ZN26ConvergedMessageAttachment11deserializeER11QDataStream @ 46 NONAME
+	_ZN26ConvergedMessageAttachment11setFilePathERK7QString @ 47 NONAME
+	_ZN26ConvergedMessageAttachment17setAttachmentTypeEi @ 48 NONAME
+	_ZN26ConvergedMessageAttachmentC1ERK7QStringi @ 49 NONAME
+	_ZN26ConvergedMessageAttachmentC2ERK7QStringi @ 50 NONAME
+	_ZN26ConvergedMessageAttachmentD1Ev @ 51 NONAME
+	_ZN26ConvergedMessageAttachmentD2Ev @ 52 NONAME
+	_ZNK16ConvergedMessage10propertiesEv @ 53 NONAME
+	_ZNK16ConvergedMessage11attachmentsEv @ 54 NONAME
+	_ZNK16ConvergedMessage11fromAddressEv @ 55 NONAME
+	_ZNK16ConvergedMessage11messageTypeEv @ 56 NONAME
+	_ZNK16ConvergedMessage12sendingStateEv @ 57 NONAME
+	_ZNK16ConvergedMessage13ccAddressListEv @ 58 NONAME
+	_ZNK16ConvergedMessage13hasAttachmentEv @ 59 NONAME
+	_ZNK16ConvergedMessage13originatingSCEv @ 60 NONAME
+	_ZNK16ConvergedMessage13toAddressListEv @ 61 NONAME
+	_ZNK16ConvergedMessage14bccAddressListEv @ 62 NONAME
+	_ZNK16ConvergedMessage14messageSubTypeEv @ 63 NONAME
+	_ZNK16ConvergedMessage2idEv @ 64 NONAME
+	_ZNK16ConvergedMessage7subjectEv @ 65 NONAME
+	_ZNK16ConvergedMessage8bodyTextEv @ 66 NONAME
+	_ZNK16ConvergedMessage8isUnreadEv @ 67 NONAME
+	_ZNK16ConvergedMessage8locationEv @ 68 NONAME
+	_ZNK16ConvergedMessage8priorityEv @ 69 NONAME
+	_ZNK16ConvergedMessage9directionEv @ 70 NONAME
+	_ZNK16ConvergedMessage9serializeER11QDataStream @ 71 NONAME
+	_ZNK16ConvergedMessage9timeStampEv @ 72 NONAME
+	_ZNK18ConvergedMessageId5getIdEv @ 73 NONAME
+	_ZNK18ConvergedMessageId9serializeER11QDataStream @ 74 NONAME
+	_ZNK18ConvergedMessageIdeqERKS_ @ 75 NONAME
+	_ZNK23ConvergedMessageAddress5aliasEv @ 76 NONAME
+	_ZNK23ConvergedMessageAddress7addressEv @ 77 NONAME
+	_ZNK23ConvergedMessageAddress9serializeER11QDataStream @ 78 NONAME
+	_ZNK26ConvergedMessageAttachment14attachmentTypeEv @ 79 NONAME
+	_ZNK26ConvergedMessageAttachment8filePathEv @ 80 NONAME
+	_ZNK26ConvergedMessageAttachment9serializeER11QDataStream @ 81 NONAME
+	_ZNK26ConvergedMessageAttachmenteqERKS_ @ 82 NONAME
 
Binary file messagingapp/msgutils/unidatautils/unidatamodelloader/tsrc/testunidatamodelloader/data/SmileyFace.gif has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelloader/tsrc/testunidatamodelloader/inc/testunidatamodelloader.h	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ * 
+ * Description:
+ */
+
+#ifndef TEST_UNI_DATA_MODEL_LOADER_H
+#define TEST_UNI_DATA_MODEL_LOADER_H
+
+#ifdef BUILD_TEST_DLL
+#define TEST_EXPORT Q_DECL_EXPORT
+#else
+#define TEST_EXPORT Q_DECL_IMPORT
+#endif
+
+#include <QObject>
+#include <txtetext.h>
+#include <txtrich.h>
+#include <mtclreg.h>
+#include <mtclbase.h>
+#include <msvids.h>
+#include <smsclnt.h>
+#include <smuthdr.h>
+#include <QDateTime>
+#include <e32math.h> 
+
+
+#include <bsp.h>
+
+const TInt32	KUidBIOVCalenderMsg			=  {0x10005533};    // VCalender diary
+
+class UniDataModelPluginInterface;
+class UniDataModelLoader;
+class MsgObserver;
+class S60QConversions;
+class ConvergedMessage;
+class CBIODatabase;
+class ConvergedMessgageAddress;
+class UniEditorPluginInterface;
+
+typedef enum
+	{							//	GENERATE A MESSAGE USING....
+    ENoMessage,                 //  .. error cases
+    EBioIapSettingsMessage,     //  .. IAP grammar, includes Internet settings 
+								//		Email settings, and logon scripts, 
+	EBioEnpMessage,				//	.. Email Notification grammar.
+	EBioRingTonesMessage,		//	.. Ringing Tones binary data
+	EBioOpLogoMessage,			//	.. Logo for Operator service
+	EBioCompBusCardMessage,		//	.. Compact Business Card data
+	EBiovCardMessage,			//	.. virtual business card data
+	EBiovCalenderMessage,		//	.. vCalender data
+	EBioWAPSettingsMessage,		//  .. wap settings
+	EBioWPRVSettingsMessage		//	.. wprv settings
+	} TBIOMessageType;
+
+
+class TEST_EXPORT TestUniDataModelLoader: public QObject
+{
+Q_OBJECT
+
+private slots:
+    //called by frame work.
+    void initTestCase();//called before the first testfunction is executed.    
+    void init();//called before each testfunction is executed.
+    
+    //test cases.
+    void testBioMessage();
+    void testMMSMessage();
+    void testSMSMessage();
+  
+    void cleanup();//called after every testfunction.
+    void cleanupTestCase();//called after the last testfunction was executed.
+    
+private:
+    
+    UniDataModelPluginInterface* pluginInterface;
+    MsgObserver* iObserver;
+    CMsvSession* iMSession;
+    CClientMtmRegistry* iMtmReg;
+    TMsvId messageId;
+    UniDataModelLoader* pluginLoader;
+    QDateTime retTimeStamp;
+    RFs iFs;
+    CMsvEntry* iMsvEntry;
+    CBIODatabase* iBioDb;
+    TMsvId newEntryId;
+    HBufC* tempNumber;
+    TBufC<KMaxFileName> currentFile;
+    TBool inbox;
+    
+};
+
+class MsgObserver : public MMsvSessionObserver
+{
+public:
+    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2,
+                             TAny* aArg3);
+};
+
+#endif //TEST_UNI_DATA_MODEL_LOADER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelloader/tsrc/testunidatamodelloader/inc/testunidatamodelloader.ini	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,15 @@
+//this file is used to provide predefined set of input data.
+
+//eg.
+const char TEST_MSG_RECIEPIENT[] 	= "Shweta Singh<77>";
+const char TEST_MSG_FROM1[] 		= "88";
+const char TEST_MSG_ALIAS1[] 		= "Shweta Singh";
+const char TEST_MSG_FROM2[] 		= "999";
+const char TEST_MSG_SUBJECT[] 		= "Hi";
+const char TEST_MSG_BODY[] 		    = "Hello";
+const char TEST_SERVICE_NAME_MMS[] 	= "messaging.mserver.testservice.MMS";
+const char TEST_SENDER[]		    = "+918888";
+const char TEST_ATTACHMENT4[]		= "c:\\data\\SmileyFace.gif";
+const char TEST_ATTACHMENT5[]		= "c:\\data\\sample.txt";
+const char TEST_CC[]			    = "DummyCCAddress";
+const char TEST_BCC[]			    = "DummyBCCAddress";
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelloader/tsrc/testunidatamodelloader/src/testunidatamodelloader.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,225 @@
+/*
+ * 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 <QtTest/QtTest>
+#include <QtDebug>
+#include <QTimer>
+#include <QSignalSpy>
+#include <xqconversions.h>
+#include <bsp.h>
+#include <biodb.h> 
+#include <biouids.h>
+#include <biocmtm.h>
+#include "convergedmessageaddress.h"
+
+#include "testunidatamodelloader.h"
+#include <unidatamodelloader.h>
+#include "testunidatamodelloader.ini"
+#include "unidatamodelplugininterface.h"
+#include <convergedmessage.h>
+#include <unieditorplugininterface.h>
+
+const TInt KTelephoneNumberMaxLength = 32;
+
+// vCalender
+_LIT(KUnixEpoch, "19700000:000000.000000");
+#define KBioUidValue  0x10001262
+
+const TUid KBioUidValueUid = {KBioUidValue};
+
+
+//---------------------------------------------------------------
+//Main entry point
+//---------------------------------------------------------------
+int main(int argc, char *argv[])
+    { 
+    int ret = -1;
+    QCoreApplication app(argc, argv);
+    QObject* tc = new TestUniDataModelLoader();
+    
+#ifdef __WINSCW__	
+		char *new_argv[3]; 
+		QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log";	
+		QByteArray bytes = str.toAscii();	
+		char arg1[] = "-o";	
+		new_argv[0] = argv[0];	
+		new_argv[1] = arg1;	
+		new_argv[2] = bytes.data();	
+		ret = QTest::qExec(tc, 3, new_argv);	
+#else	
+		ret = QTest::qExec(tc, argc, argv);	
+#endif
+	delete tc;
+    return ret;
+
+    }
+
+//---------------------------------------------------------------
+// TestUniDataModelLoader::init
+//---------------------------------------------------------------
+void TestUniDataModelLoader::initTestCase()
+{
+	iObserver = new (ELeave) MsgObserver();
+
+	// Create a new messaging server session..
+	iMSession = CMsvSession::OpenSyncL(*iObserver);
+
+	iMsvEntry = iMSession->GetEntryL(KMsvRootIndexEntryId);
+	newEntryId = 0;
+	pluginLoader = new UniDataModelLoader();
+
+	retTimeStamp = QDateTime::currentDateTime();
+	int err = iFs.Connect();
+	QVERIFY(err == 0);
+	iBioDb = CBIODatabase::NewL(iFs);
+	iFs.SetSessionPath(_L("c:\\"));
+	inbox = EFalse;
+}
+
+//---------------------------------------------------------------
+// TestUniDataModelLoader::init
+//---------------------------------------------------------------
+void TestUniDataModelLoader::init()
+{
+    
+}
+
+//---------------------------------------------------------------
+// TestUniDataModelLoader::testBioMessage
+//---------------------------------------------------------------
+void TestUniDataModelLoader::testBioMessage()
+{
+	inbox = ETrue;
+	pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::BioMsg);
+	
+	QVERIFY( pluginInterface != NULL );
+	
+	QString msgType = pluginInterface->messageType();
+			
+	qDebug() <<"msgType" << msgType;
+	QCOMPARE(msgType, QString("biomessage"));
+	
+	qDebug() <<"UnidataModel Loader for Biomessage Created Successfully";
+}
+
+//---------------------------------------------------------------
+// TestUniDataModelLoader::testMMSMessage
+//---------------------------------------------------------------
+void TestUniDataModelLoader::testMMSMessage()
+{
+	qRegisterMetaType<long int> ("long int");
+	QString service = TEST_SERVICE_NAME_MMS;
+	QString subject  = TEST_MSG_SUBJECT;
+	qint64 timeStamp = QDateTime::currentDateTime().toTime_t();
+		
+	QString sender(TEST_SENDER);
+	ConvergedMessageAddress address(sender);
+	ConvergedMessageAttachmentList attachmentList;  
+	
+	QString attachment2Path = TEST_ATTACHMENT4;
+		ConvergedMessageAttachment* attachment2 = 
+				new ConvergedMessageAttachment(attachment2Path, ConvergedMessageAttachment::EAttachment);
+		
+	QString attachmentPath = TEST_ATTACHMENT5;
+	ConvergedMessageAttachment* attachment = 
+			new ConvergedMessageAttachment(attachmentPath, ConvergedMessageAttachment::EAttachment);
+			
+	attachmentList.append(attachment);
+	attachmentList.append(attachment2);
+	ConvergedMessage msg;
+	msg.setMessageType(ConvergedMessage::Mms);
+	msg.setSubject(subject);
+	msg.setTimeStamp(timeStamp);
+	msg.addToRecipient(address);
+	msg.addAttachments(attachmentList);
+	msg.setPriority(ConvergedMessage::Normal);
+		//Adding alias
+	ConvergedMessageAddress address1;
+	address1.setAlias(QString(TEST_MSG_RECIEPIENT));
+	msg.addToRecipient(address1);
+  
+	pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::Mms);
+	pluginInterface->setMessageId(newEntryId);
+
+	QVERIFY( pluginInterface != NULL ); 
+	
+	QString msgType = pluginInterface->messageType();
+		   
+	qDebug() <<"msgType" << msgType;
+	QCOMPARE(msgType, QString("mms"));
+	
+	qDebug() <<"UnidataModel Loader for MMS Created Successfully";
+} 
+
+//---------------------------------------------------------------
+// TestUniDataModelLoader::testSMSMessage
+//---------------------------------------------------------------
+void TestUniDataModelLoader::testSMSMessage()
+{
+	qint64 timeStamp = QDateTime::currentDateTime().toTime_t();
+	QString sender(TEST_SENDER);
+	ConvergedMessageAddress address(sender);
+	ConvergedMessage msg;
+	msg.setMessageType(ConvergedMessage::Sms);
+	msg.setTimeStamp(timeStamp);
+	msg.addToRecipient(address);
+	msg.setBodyText( TEST_MSG_BODY);
+	msg.setPriority(ConvergedMessage::Normal);
+	//Adding alias
+	ConvergedMessageAddress address1;
+	address1.setAlias(QString(TEST_MSG_RECIEPIENT));
+	msg.addToRecipient(address1);
+			
+	pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::Sms);
+	
+	QVERIFY( pluginInterface != NULL );
+	
+	QString msgType = pluginInterface->messageType();
+   
+	qDebug() <<"msgType" << msgType;
+	QCOMPARE(msgType, QString("sms"));
+	
+	qDebug() <<"UnidataModel Loader for SMS Created Successfully";
+}
+
+//---------------------------------------------------------------
+// TestUniDataModelLoader::cleanup
+//---------------------------------------------------------------
+void TestUniDataModelLoader::cleanup()
+{
+
+}
+
+//---------------------------------------------------------------
+// TestUniDataModelLoader::cleanupTestCase
+//---------------------------------------------------------------
+void TestUniDataModelLoader::cleanupTestCase()
+{
+	delete iMsvEntry;
+	iMsvEntry = NULL;
+	delete iObserver;
+	iObserver = NULL;
+	delete iMSession;
+	iMSession = NULL;
+	delete pluginLoader;
+}
+
+//---------------------------------------------------------------
+// TestUniDataModelLoader::HandleSessionEventL
+//---------------------------------------------------------------
+void MsgObserver::HandleSessionEventL(TMsvSessionEvent /*aEvent*/,
+                                      TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
+{
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelloader/tsrc/testunidatamodelloader/testunidatamodelloader.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,100 @@
+#
+# 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:
+#
+
+QT += testlib
+QT -= gui
+
+TEMPLATE = app
+TARGET = testunidatamodelloader
+
+CONFIG += hb
+CONFIG += symbian_test
+
+
+INCLUDEPATH += inc
+INCLUDEPATH += ../../../../../../inc
+INCLUDEPATH += ../../../../../../../inc
+INCLUDEPATH += ../../../../../../../../../../epoc32/include/platform/mw
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+DEFINES += BUILD_TEST_DLL
+
+SOURCES += \
+	src/testunidatamodelloader.cpp
+
+				
+# Input
+HEADERS += \
+	inc/testunidatamodelloader.h
+	
+	 	   			 
+   
+SYMBIAN_PLATFORMS = WINSCW ARMV5
+    symbian {
+    TARGET.CAPABILITY = All -TCB -DRM
+    TARGET.EPOCSTACKSIZE = 0x8000
+    TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000
+    VENDORID =  VID_DEFAULT
+    BLD_INF_RULES.prj_exports += "data/SmileyFace.gif    	 c:/data/SmileyFace.gif"
+    BLD_INF_RULES.prj_exports += "data/sample.txt            c:/data/sample.txt"
+    }
+
+
+
+packageheader = "$${LITERAL_HASH}{\"QTestUnidataModelLoader\"},(0xEadfc3ef.),1,0,0,TYPE=SA"
+
+vendorinfo = \
+			"; Localised Vendor name" \
+			"%{\"Nokia\"}" \
+			"; Unique Vendor name" \
+			":\"Nokia\"" 
+			
+dependencyinfo = \
+				"; Default HW/platform dependencies" \
+				"[0x101F7961],0,0,0,{\"S60ProductID\"}" \
+				"[0x2001E61C],4,6,3,{"Qt"}
+				
+default_deployment.pkg_prerules =	packageheader \
+									vendorinfo \
+									dependencyinfo 
+
+
+ LIBS += -leuser \
+	-lconvergedmessageutils\
+	-lmsgs \
+	-lsmcm \
+	-lgsmu \
+	-letext \
+	-lmsgs \
+	-lunidatamodelloader\
+	-lQtCore \
+	-lbioc \
+	-lefsrv \
+	-lbiodb \
+     -lxqutils \
+	-lbifu
+	
+#Copy the dependent DLL
+symbian: {
+	addP1.sources = ./data/SmileyFace.gif
+	addP1.path = C:/data/
+	DEPLOYMENT += addP1
+
+	addP2.sources = ./data/sample.txt
+	addP2.path = C:/data/
+	DEPLOYMENT += addP2	
+	}
+	
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelloader/tsrc/tsrc.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,25 @@
+#
+# 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:
+#
+
+TEMPLATE = subdirs
+
+CONFIG += symbian_test
+
+#Sub .pro files
+SUBDIRS += testunidatamodelloader
+
+# Platforms
+SYMBIAN_PLATFORMS = DEFAULT
\ No newline at end of file
--- a/messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/bwins/test_unidatamodel_mms_pluginu.def	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-EXPORTS
-	?createMMS@TestUniDataModelMMSPlugin@@AAEXJH@Z @ 1 NONAME ; void TestUniDataModelMMSPlugin::createMMS(long, int)
-	?testOutboxMessage@TestUniDataModelMMSPlugin@@AAEXXZ @ 2 NONAME ; void TestUniDataModelMMSPlugin::testOutboxMessage(void)
-	?tr@TestUniDataModelMMSPlugin@@SA?AVQString@@PBD0H@Z @ 3 NONAME ; class QString TestUniDataModelMMSPlugin::tr(char const *, char const *, int)
-	?cleanup@TestUniDataModelMMSPlugin@@AAEXXZ @ 4 NONAME ; void TestUniDataModelMMSPlugin::cleanup(void)
-	?staticMetaObject@TestUniDataModelMMSPlugin@@2UQMetaObject@@B @ 5 NONAME ; struct QMetaObject const TestUniDataModelMMSPlugin::staticMetaObject
-	?initTestCase@TestUniDataModelMMSPlugin@@AAEXXZ @ 6 NONAME ; void TestUniDataModelMMSPlugin::initTestCase(void)
-	?testInboxMessage@TestUniDataModelMMSPlugin@@AAEXXZ @ 7 NONAME ; void TestUniDataModelMMSPlugin::testInboxMessage(void)
-	?tr@TestUniDataModelMMSPlugin@@SA?AVQString@@PBD0@Z @ 8 NONAME ; class QString TestUniDataModelMMSPlugin::tr(char const *, char const *)
-	?getStaticMetaObject@TestUniDataModelMMSPlugin@@SAABUQMetaObject@@XZ @ 9 NONAME ; struct QMetaObject const & TestUniDataModelMMSPlugin::getStaticMetaObject(void)
-	?metaObject@TestUniDataModelMMSPlugin@@UBEPBUQMetaObject@@XZ @ 10 NONAME ; struct QMetaObject const * TestUniDataModelMMSPlugin::metaObject(void) const
-	?testInboxImageMMSMessage@TestUniDataModelMMSPlugin@@AAEXXZ @ 11 NONAME ; void TestUniDataModelMMSPlugin::testInboxImageMMSMessage(void)
-	?init@TestUniDataModelMMSPlugin@@AAEXXZ @ 12 NONAME ; void TestUniDataModelMMSPlugin::init(void)
-	?qt_metacast@TestUniDataModelMMSPlugin@@UAEPAXPBD@Z @ 13 NONAME ; void * TestUniDataModelMMSPlugin::qt_metacast(char const *)
-	?testGetPluginWithoutLoading@TestUniDataModelMMSPlugin@@AAEXXZ @ 14 NONAME ; void TestUniDataModelMMSPlugin::testGetPluginWithoutLoading(void)
-	?trUtf8@TestUniDataModelMMSPlugin@@SA?AVQString@@PBD0@Z @ 15 NONAME ; class QString TestUniDataModelMMSPlugin::trUtf8(char const *, char const *)
-	?trUtf8@TestUniDataModelMMSPlugin@@SA?AVQString@@PBD0H@Z @ 16 NONAME ; class QString TestUniDataModelMMSPlugin::trUtf8(char const *, char const *, int)
-	?createInboxImageMMS@TestUniDataModelMMSPlugin@@AAEXXZ @ 17 NONAME ; void TestUniDataModelMMSPlugin::createInboxImageMMS(void)
-	?testPluginLoading@TestUniDataModelMMSPlugin@@AAEXXZ @ 18 NONAME ; void TestUniDataModelMMSPlugin::testPluginLoading(void)
-	?cleanupTestCase@TestUniDataModelMMSPlugin@@AAEXXZ @ 19 NONAME ; void TestUniDataModelMMSPlugin::cleanupTestCase(void)
-	?qt_metacall@TestUniDataModelMMSPlugin@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 20 NONAME ; int TestUniDataModelMMSPlugin::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?testPluginLoadingMultipleTimes@TestUniDataModelMMSPlugin@@AAEXXZ @ 21 NONAME ; void TestUniDataModelMMSPlugin::testPluginLoadingMultipleTimes(void)
-
Binary file messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/data/TestUnidataModelMMSPluginPhoto.jpg has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/inc/testunidatamodelmmsplugin.h	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,146 @@
+/*
+ * 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: Main test class declaration for MMS Data Plugin
+ */
+
+#ifndef TESTUNIDATAMODELMMSPLUGIN_H_
+#define TESTUNIDATAMODELMMSPLUGIN_H_
+
+#ifdef BUILD_TESTUNIDATAMODELMMSPLUGIN_DLL
+#define TEST_EXPORT Q_DECL_EXPORT
+#else
+#define TEST_EXPORT Q_DECL_IMPORT
+#endif
+
+#include <QObject>
+#include <txtetext.h>
+#include <txtrich.h>
+#include <mtclreg.h>
+#include <mtclbase.h>
+#include <msvids.h>
+#include <QDateTime>
+
+//Forward Declarations
+class UniDataModelPluginInterface;
+class UniDataModelLoader;
+class TestObserverMMS;
+class CMmsClientMtm;
+class ConvergedMessage;
+class RFs;
+
+//Class Declaration
+class TEST_EXPORT TestUniDataModelMMSPlugin : public QObject
+{
+Q_OBJECT
+
+private slots:
+	
+	/**
+	 * Initialises the whole Test
+	 **/  
+    void initTestCase();//called before the first testfunction is executed.
+    
+    /**
+	 * Initialises each Test Case
+	 **/  
+    void init();//called before each testfunction is executed.
+
+    /**
+	 * Tests that the MMS message is created successfully in the Inbox Folder
+	 **/ 
+    void testInboxMessage();
+    
+    /**
+	 * Cleans up each Test Case
+	 **/  
+   	void cleanup();//called after every testfunction. 
+   	
+   	/**
+	 * Cleans up the whole Test Case
+	 **/  
+   	void cleanupTestCase();//called after the last testfunction was executed.
+    
+private:
+   	
+    /**
+   	 * Creates the MMS message in the Inbox Folder
+   	 **/ 
+    void createMMS(TMsvId pId, TBool subjectField);
+    
+private: //Data
+    
+    /**
+	 * pluginInterface - UniDataMMSPlug-in
+	 **/  
+    UniDataModelPluginInterface* pluginInterface;
+    
+    /**
+	 * pluginLoader - UniDataPlug-in Loader
+	 **/
+    UniDataModelLoader* pluginLoader;
+    
+    /**
+	 * iObserver - Observer pointer For Test Class
+	 **/
+    TestObserverMMS* iObserver;
+    
+    /**
+	 * iMSession - Session
+	 **/
+    CMsvSession* iMSession;
+    
+    /**
+	 * iMmsClientMtm - MMS Client MTM
+	 **/
+    CMmsClientMtm* iMmsClientMtm;
+    
+    /**
+	 * iMessageId - MMS Message ID of the MMS created in the Inbox Folder
+	 **/
+    TMsvId iMessageId;
+    
+    /**
+	 * retTimeStamp - Timestamp for the MMS being Created
+	 **/
+    QDateTime retTimeStamp;
+    
+    /**
+	 * iFs - File Server
+	 **/
+    RFs iFs;
+    
+    /**
+	 * iServiceId - MMS Service Id
+	 **/
+    TMsvId iServiceId;
+    
+    /**
+	 * msgSize - Size of the MMS message created in the Inbox Folder
+	 **/
+    TInt msgSize;
+};
+
+//Observer Class Declaration
+class TestObserverMMS : public MMsvSessionObserver
+{
+public:
+	
+	/**
+	 * Handles various outcome Events after the different services like Creation, Sending, etc. of a MMS Message
+	 **/  
+    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2,
+                             TAny* aArg3);
+};
+
+#endif /* TESTUNIDATAMODELMMSPLUGIN_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/inc/testunidatamodelmmsplugin.ini	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,9 @@
+const char TEST_MSG_FROM1[] 		= "9741596546";
+const char TEST_MSG_RECIEPIENT1[] 	= "9741596546";
+const char TEST_MSG_RECIEPIENT2[] 	= "9741596547";
+const char TEST_MSG_RECIEPIENT3[] 	= "9741596548";
+const char TEST_MSG_SUBJECT[] = "This is an MMS";
+
+_LIT(KUnixEpoch, "19700000:000000.000000");
+_LIT(KRootPath, "c:\\" );
+_LIT(KPictureFileName, "C:\\data\\TestUnidataModelMMSPluginPhoto.jpg");
Binary file messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/photo.jpg has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/src/testunidatamodelmmsplugin.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,372 @@
+/*
+ * 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: Main test class definition for MMS Data Plugin
+ */
+
+#include <QtTest/QtTest>
+#include <QtDebug>
+#include <QTimer>
+#include <QSignalSpy>
+#include <mmsclient.h>
+#include <mmssettings.h>
+#include <CMsvMimeHeaders.h>
+#include <f32file.h>
+#include "debugtraces.h"
+#include "convergedmessageaddress.h"
+#include "testunidatamodelmmsplugin.h"
+#include "testunidatamodelmmsplugin.ini"
+#include "xqconversions.h"
+#include "unidatamodelplugininterface.h"
+#include "unidatamodelloader.h"
+
+//---------------------------------------------------------------
+// TestUniDataModelPlugin::initTestCase
+//---------------------------------------------------------------
+void TestUniDataModelMMSPlugin::initTestCase()
+    {
+    iObserver = new (ELeave) TestObserverMMS();
+
+    // Create a new messaging server session..
+    TRAPD(err,iMSession = CMsvSession::OpenSyncL(*iObserver));
+    if(err)
+        {
+        TInt x = err;
+        }
+    
+    // Create the client mtm registry
+    CClientMtmRegistry* mtmReg = CClientMtmRegistry::NewL(*iMSession);
+
+    // Get the MMS clientmtm
+    iMmsClientMtm = static_cast<CMmsClientMtm*> (mtmReg->NewMtmL(KUidMsgTypeMultimedia));
+
+    //Connecting to File Server Session
+    User::LeaveIfError( iFs.Connect() );
+    iFs.SetSessionPath( KRootPath );
+    
+    //Getting Service ID for MMS
+    CMmsSettings* settings = CMmsSettings::NewL();
+    settings->LoadSettingsL();
+    iServiceId = settings->Service();
+    
+    iMessageId = 0;
+    
+    //Saving the Timestamp before Message is created
+    retTimeStamp = QDateTime::currentDateTime();
+    
+    // Get the MMS data modelplugin
+    pluginLoader = new UniDataModelLoader;
+    pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::Mms);
+    }
+
+//---------------------------------------------------------------
+// TestUniDataModelPlugin::init
+//---------------------------------------------------------------
+void TestUniDataModelMMSPlugin::init()
+{
+}
+
+//---------------------------------------------------------------
+// TestUniDataModelPlugin::testInboxMessage
+//---------------------------------------------------------------
+void TestUniDataModelMMSPlugin::testInboxMessage()
+    {
+	//Create the MMS First
+	createMMS(KMsvGlobalInBoxIndexEntryIdValue,ETrue);
+    
+	QTest::qWait(50000);  //to ensure path completion
+	
+	//MMS Message created, will now be validated
+	
+	//Checking if Another Instance of MMS Data Plugin can be created form an existing one
+	QObject* anotherInstance = pluginInterface->createInstance();
+    QVERIFY(anotherInstance != NULL);
+    delete anotherInstance;
+    
+    //Setting a Message ID, thereby populating the MMS message at the Plugin
+    QVERIFY(pluginInterface->setMessageId(iMessageId) == KErrNone);
+
+    //Verifying the MMS message size
+    QVERIFY(pluginInterface->messageSize() == msgSize);
+    
+    //Verifying the MMS timestamp
+    QVERIFY(pluginInterface->timeStamp() == retTimeStamp);
+    
+    //Verifying is the MMP Plugin works file afetr it has been Reset and Restored
+    pluginInterface->reset();
+	pluginInterface->restore(*iMmsClientMtm);
+	QVERIFY(pluginInterface->setMessageId(iMessageId) == KErrNone);
+	
+	//Subject Verification
+    QVERIFY(pluginInterface->subject().compare(QString(TEST_MSG_SUBJECT)) == 0);
+    
+    //MMS message have no Body String
+    QString body;
+    pluginInterface->body(body);
+    QVERIFY(body == QString(""));
+    
+    //Message type verification
+    QVERIFY(pluginInterface->messageType().compare(QString("mms")) == 0);
+    
+    //Fetch the To List
+    ConvergedMessageAddressList recipientList;
+    pluginInterface->toRecipientList(recipientList);
+    QVERIFY(recipientList.count() != 0);
+    QVERIFY(recipientList[0]->address().compare(QString(TEST_MSG_RECIEPIENT1)) == 0);
+    
+    //Fetch the CC List
+    ConvergedMessageAddressList recipientList2;
+    pluginInterface->ccRecipientList(recipientList2);
+    QVERIFY(recipientList2.count() != 0);
+    QVERIFY(recipientList2[0]->address().compare(QString(TEST_MSG_RECIEPIENT2)) == 0);
+    
+    //Fetch the BCC List
+    ConvergedMessageAddressList recipientList3;
+    pluginInterface->bccRecipientList(recipientList3);
+    QVERIFY(recipientList3.count() != 0);
+    QVERIFY(recipientList3[0]->address().compare(QString(TEST_MSG_RECIEPIENT3)) == 0);
+    
+    //Fetch the From Address
+    QString recepient(TEST_MSG_FROM1);
+    QString fromaddress;
+    pluginInterface->fromAddress(fromaddress);
+    QVERIFY(recepient == fromaddress);
+    
+    //Verifying Attachments
+    UniMessageInfoList attList = pluginInterface->attachmentList();
+    QVERIFY(attList.count() == 0);
+    
+    QVERIFY(pluginInterface->hasAttachment() == false);
+    
+    QVERIFY(pluginInterface->attachmentCount() == 0);
+    
+    QVERIFY(pluginInterface->messagePriority() == 1);
+
+    //Verifying various objects added to the MMS Message during creation
+    QVERIFY(pluginInterface->objectCount() == 2);
+    
+    UniMessageInfoList objectlist = pluginInterface->objectList();
+    QVERIFY(!objectlist.isEmpty());
+    
+    QVERIFY(objectlist[1]->path().contains(QString("TestUnidataModelMMSPluginPhoto.jpg"), Qt::CaseInsensitive) == true);
+	QVERIFY(objectlist[1]->mimetype().contains(QString("image/jpeg"), Qt::CaseInsensitive) == true);
+    
+    QVERIFY(pluginInterface->slideCount() == 1);
+    
+    QVERIFY(pluginInterface->slideContent(0)[0]->path().contains(QString("Story.txt"), Qt::CaseInsensitive) == true);
+    QVERIFY(pluginInterface->slideContent(0)[0]->mimetype().contains(QString("text/plain"), Qt::CaseInsensitive) == true);
+    
+    //Verifying if the plugin returns the correct session, thus will correctly delete the MMS we just created
+    CMsvSession* msvSession = pluginInterface->session();
+    QVERIFY(msvSession != NULL);
+    msvSession->RemoveEntry(iMessageId);
+    
+    qDebug() << "Verified Test MMS Successfully";    
+    }
+
+//---------------------------------------------------------------
+// TestUniDataModelPlugin::cleanup
+//---------------------------------------------------------------
+void TestUniDataModelMMSPlugin::cleanup()
+{
+}
+
+//---------------------------------------------------------------
+// TestUniDataModelPlugin::cleanupTestCase
+//---------------------------------------------------------------
+void TestUniDataModelMMSPlugin::cleanupTestCase()
+    {
+	//Cleanup
+	delete pluginInterface;
+	delete pluginLoader;
+    delete iMmsClientMtm;
+    delete iMSession;
+    delete iObserver;
+    }
+
+//---------------------------------------------------------------
+// TestUniDataModelPlugin::createMMS
+//---------------------------------------------------------------
+void TestUniDataModelMMSPlugin::createMMS(TMsvId pId, TBool subjectField)
+    {
+    TMsvEntry indexEntry;
+    indexEntry.iType = KUidMsvMessageEntry;
+    indexEntry.iMtm = KUidMsgTypeMultimedia;
+    indexEntry.iServiceId = iServiceId;
+    indexEntry.iDate.HomeTime();
+    
+    // Convert TTime to QDateTime , this will be used for comparing the time of mesage 
+    // when fetched from datamodel
+    TTime unixEpoch(KUnixEpoch);
+    TTimeIntervalSeconds seconds;
+    TTime timeStamp = indexEntry.iDate;
+    timeStamp.SecondsFrom(unixEpoch, seconds);
+    retTimeStamp.setTime_t(seconds.Int());
+
+    TMsvId parentId = pId;
+    CMsvEntry* entry = CMsvEntry::NewL(*iMSession,parentId,TMsvSelectionOrdering());
+    CleanupStack::PushL(entry);
+
+    entry->SetEntryL(parentId);
+    entry->CreateL(indexEntry);
+    entry->SetEntryL(indexEntry.Id());
+    iMmsClientMtm->SwitchCurrentEntryL(entry->EntryId());
+
+    CMsvStore* store = iMmsClientMtm->Entry().EditStoreL();
+    CleanupStack::PushL(store);
+      
+    //MMS Message ID Saved
+    iMessageId = indexEntry.Id();
+    
+    //Adding Subject
+    if(subjectField)
+        {
+        QString subject(TEST_MSG_SUBJECT);
+        HBufC* subj = XQConversions::qStringToS60Desc(subject);
+        iMmsClientMtm->SetSubjectL(*subj);
+        }
+
+    //Adding Sender
+    QString sender(TEST_MSG_FROM1);
+    HBufC* addr = XQConversions::qStringToS60Desc(sender);
+    
+    if (addr)
+        {
+        CleanupStack::PushL(addr);
+        TBuf<32> name;
+        name.Copy(addr->Left(32));
+        indexEntry.iDetails.Set(name);
+        
+        iMmsClientMtm->SetSenderL(*addr);
+        
+        CleanupStack::PopAndDestroy(addr);
+        }
+    
+    //Adding Recipient
+    QString recipient(TEST_MSG_RECIEPIENT1);
+    HBufC* addr2 = XQConversions::qStringToS60Desc(recipient);
+    if (addr2)
+        {
+        CleanupStack::PushL(addr2);
+        iMmsClientMtm->AddAddresseeL(EMsvRecipientTo,*addr2);
+        CleanupStack::PopAndDestroy(addr2);
+        }
+    
+    //Adding cCRecipient
+    QString recipient2(TEST_MSG_RECIEPIENT2);
+    HBufC* addr3 = XQConversions::qStringToS60Desc(recipient2);
+    if (addr3)
+        {
+        CleanupStack::PushL(addr3);
+        iMmsClientMtm->AddAddresseeL(EMsvRecipientCc,*addr3);
+        CleanupStack::PopAndDestroy(addr3);
+        }
+      
+    //Adding bCCRecipient
+    QString recipient3(TEST_MSG_RECIEPIENT3);
+	HBufC* addr4 = XQConversions::qStringToS60Desc(recipient3);
+	if (addr4)
+		{
+		CleanupStack::PushL(addr4);
+		iMmsClientMtm->AddAddresseeL(EMsvRecipientBcc,*addr4);
+		CleanupStack::PopAndDestroy(addr4);
+		}
+	
+    //Create Text Attachment
+    TMsvAttachmentId attaId = 0;
+    TFileName attachmentFile( _L("story.txt") );
+    TBufC<12> story = _L( "Hello world!" );
+    
+    iMmsClientMtm->CreateTextAttachmentL(*store, attaId, story, attachmentFile, ETrue );
+    qDebug() << "Text Attachment id" << attaId;
+    
+    //Image Attachment added to the message entry
+    RFile attaFile;
+	// Set filename of attachment
+	TFileName name( KPictureFileName );
+   
+	CMsvMimeHeaders* mimeHeaders = CMsvMimeHeaders::NewL();
+	CleanupStack::PushL( mimeHeaders );
+   
+	// Set values to mime headers
+	mimeHeaders->SetContentTypeL( _L8( "image") );
+	mimeHeaders->SetContentSubTypeL( _L8( "jpeg" ) );
+   
+	_LIT8(KMimeType, "image/jpeg");
+	TBufC8<10> mimeType(KMimeType);
+	// CreateAttachment2L will set the content type to attachment Info
+   
+	// Open the attachment file for reading
+	attaFile.Open( iFs, name, EFileShareReadersOnly | EFileRead );
+	CleanupClosePushL(attaFile);
+   
+	CMsvAttachment* attaInfo = CMsvAttachment::NewL(CMsvAttachment::EMsvFile);
+	// attaInfo ownerhip will be transferred to Attachment Manager.
+	// It must not be pushed onto the cleanupStack before calling 
+	// CreateAttachment2L.
+   
+	iMmsClientMtm->CreateAttachment2L(*store, attaFile,mimeType,*mimeHeaders,attaInfo,attaId);
+	qDebug() << "Image Attachment id" << attaId;
+	
+	// Now Attachment Manager owns the attaInfo
+	CleanupStack::Pop(); // attaFile.Close()
+	CleanupStack::PopAndDestroy(); // mimeHeaders
+        
+    store->CommitL();
+    
+    CleanupStack::PopAndDestroy(store); // store
+    
+    iMmsClientMtm->SaveMessageL();
+    
+    //Saving the message size for future checking
+    msgSize = iMmsClientMtm->MessageSize();
+    
+    CleanupStack::Pop(entry); // entry
+    }
+
+//---------------------------------------------------------------
+// TestObserverMMS::HandleSessionEventL
+//---------------------------------------------------------------
+void TestObserverMMS::HandleSessionEventL(TMsvSessionEvent /*aEvent*/,
+                                       TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
+{
+}
+
+//---------------------------------------------------------------
+// main
+// main entry point
+//---------------------------------------------------------------
+int main(int argc, char *argv[])
+    { 
+	int ret = -1;
+	QCoreApplication app(argc, argv);
+	QObject* tc = new TestUniDataModelMMSPlugin();
+	
+#ifdef __WINSCW__
+	char *new_argv[3]; 
+	QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log";	
+	QByteArray bytes = str.toAscii();	
+	char arg1[] = "-o";	
+	new_argv[0] = argv[0];	
+	new_argv[1] = arg1;	
+	new_argv[2] = bytes.data();	
+	ret = QTest::qExec(tc, 3, new_argv);
+#else
+	ret = QTest::qExec(tc, argc, argv); 
+#endif
+	
+	delete tc;
+	return ret;
+    }
+
+//End of File
--- a/messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/testunidatamodelmmsplugin.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,496 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- * 
- * Description:
- */
-
-#include <QtTest/QtTest>
-#include "serviceinfo.h"
-#include <QtDebug>
-#include <QTimer>
-#include <QSignalSpy>
-#include "convergedmessage.h"
-#include <xqconversions.h>
-#include "unidatamodelplugininterface.h"
-#include "unidatamodelloader.h"
-#include <mmsclient.h>
-#include <mmsheaders.h>
-#include <mmssettings.h>
-#include <CMsvMimeHeaders.h>
-#include "convergedmessageaddress.h"
-#include "testunidatamodelmmsplugin.h"
-#include "testunidatamodelmmsplugin.ini"
-#include <f32file.h>
-
-_LIT(KUnixEpoch, "19700000:000000.000000");
-_LIT( KRootPath, "c:\\" );
-
-
-void TestUniDataModelMMSPlugin::initTestCase()
-    {
-    iObserver = new (ELeave) TestObserverMMS();
-
-    // Create a new messaging server session..
-    TRAPD(err,iMSession = CMsvSession::OpenSyncL(*iObserver));
-    if(err)
-        {
-        TInt x=err;
-        }
-    // Create the client mtm registry
-    iMtmReg = CClientMtmRegistry::NewL(*iMSession);
-
-    // Get the MMS clientmtm
-    iMmsClientMtm = (CMmsClientMtm *) iMtmReg->NewMtmL(KUidMsgTypeMultimedia);
-
-    User::LeaveIfError( iFs.Connect() );
-    iFs.SetSessionPath( KRootPath );
-    iSettings = CMmsSettings::NewL();
-    iMmsHeaders = CMmsHeaders::NewL(iSettings->MmsVersion());
-    iSettings->LoadSettingsL();
-    iServiceId = iSettings->Service();
-    
-    iMessageId = 0;
-    pluginLoader = new UniDataModelLoader();
-    retTimeStamp = QDateTime::currentDateTime();
-    }
-
-void TestUniDataModelMMSPlugin::cleanupTestCase()
-    {
-    for(TInt i=0; i<idArr.Count();i++)
-        {
-        iMmsClientMtm->Entry().DeleteL(idArr[i]);
-        }
-
-    delete iObserver;
-    delete iMmsClientMtm;
-    delete iMtmReg;
-    delete iMSession;
-    delete pluginLoader;
-    }
-
-
-//---------------------------------------------------------------
-// TestUniDataModelPlugin::init
-//---------------------------------------------------------------
-
-void TestUniDataModelMMSPlugin::init()
-{
-/*    iObserver = new (ELeave) TestObserverMMS();
-
-    // Create a new messaging server session..
-    TRAPD(err,iMSession = CMsvSession::OpenSyncL(*iObserver));
-    if(err)
-        {
-        TInt x=err;
-        }
-    // Create the client mtm registry
-    iMtmReg = CClientMtmRegistry::NewL(*iMSession);
-
-    // Get the MMS clientmtm
-    iMmsClientMtm = (CMmsClientMtm *) iMtmReg->NewMtmL(KUidMsgTypeMultimedia);
-
-    User::LeaveIfError( iFs.Connect() );
-    iFs.SetSessionPath( KRootPath );
-    iSettings = CMmsSettings::NewL();
-    iMmsHeaders = CMmsHeaders::NewL(iSettings->MmsVersion());
-    iSettings->LoadSettingsL();
-    iServiceId = iSettings->Service();
-    
-    iMessageId = 0;
-    pluginLoader = new UniDataModelLoader();
-    retTimeStamp = QDateTime::currentDateTime();*/
-}
-
-//---------------------------------------------------------------
-// TestUniDataModelPlugin::cleanup
-//---------------------------------------------------------------
-void TestUniDataModelMMSPlugin::cleanup()
-{
-
- /*  
-    for(TInt i=0; i<idArr.Count();i++)
-        {
-        iMmsClientMtm->Entry().DeleteL(idArr[i]);
-        }
-
-    delete iObserver;
-    delete iMmsClientMtm;
-    delete iMtmReg;
-    delete iMSession;
-    delete pluginLoader;*/
-}
-
-
-void TestUniDataModelMMSPlugin::createMMS(TMsvId pId, TBool subjectField)
-    {
-    TMsvEntry indexEntry;
-    indexEntry.iType = KUidMsvMessageEntry;
-    indexEntry.iMtm = KUidMsgTypeMultimedia;
-    indexEntry.iServiceId = iServiceId;
-    indexEntry.iDate.HomeTime();
-    
-    // Convert TTime to QDateTime , this will be used for comparing the time of mesage 
-    // when fetched from datamodel
-    TTime unixEpoch(KUnixEpoch);
-    TTimeIntervalSeconds seconds;
-    TTime timeStamp = indexEntry.iDate;
-    timeStamp.SecondsFrom(unixEpoch, seconds);
-    retTimeStamp.setTime_t(seconds.Int());
-
-
-    TMsvId parentId = pId;
-    CMsvEntry* entry = CMsvEntry::NewL(*iMSession,parentId,TMsvSelectionOrdering());
-    CleanupStack::PushL(entry);
-
-    entry->SetEntryL(parentId);
-    entry->CreateL(indexEntry);
-    entry->SetEntryL(indexEntry.Id());
-    iMmsClientMtm->SwitchCurrentEntryL(entry->EntryId());
-    
-    //iMmsClientMtm->LoadMessageL();
-    
-    CMsvStore* store = iMmsClientMtm->Entry().EditStoreL();
-    CleanupStack::PushL(store);
-      
-    iMessageId = indexEntry.Id();
-    idArr.Append(iMessageId);
-    
-    if(subjectField)
-        {
-        QString subject(TEST_MSG_SUBJECT);
-        HBufC* subj = XQConversions::qStringToS60Desc(subject);
-        iMmsClientMtm->SetSubjectL(*subj);
-        }
-
-    //Sender
-    QString sender(TEST_MSG_FROM1);
-    HBufC* addr = XQConversions::qStringToS60Desc(sender);
-    
-    
-    if (addr)
-        {
-        CleanupStack::PushL(addr);
-        TBuf<32> name;
-        name.Copy(addr->Left(32));
-        indexEntry.iDetails.Set(name);
-        
-        iMmsClientMtm->SetSenderL(*addr);
-        
-        CleanupStack::PopAndDestroy(addr);
-        }
-    
-    //Recipient
-    QString recipient(TEST_MSG_RECIEPIENT1);
-    HBufC* addr2 = XQConversions::qStringToS60Desc(recipient);
-    if (addr2)
-        {
-        CleanupStack::PushL(addr2);
-        iMmsClientMtm->AddAddresseeL(EMsvRecipientTo,*addr2);
-        CleanupStack::PopAndDestroy(addr2);
-        }
-    
-    QString recipient2(TEST_MSG_RECIEPIENT2);
-    HBufC* addr3 = XQConversions::qStringToS60Desc(recipient2);
-    if (addr3)
-        {
-        CleanupStack::PushL(addr3);
-        iMmsClientMtm->AddAddresseeL(EMsvRecipientCc,*addr3);
-        CleanupStack::PopAndDestroy(addr3);
-        }
-        
-    QString recipient3(TEST_MSG_RECIEPIENT3);
-        HBufC* addr4 = XQConversions::qStringToS60Desc(recipient3);
-        if (addr4)
-            {
-            CleanupStack::PushL(addr4);
-            iMmsClientMtm->AddAddresseeL(EMsvRecipientBcc,*addr4);
-            CleanupStack::PopAndDestroy(addr4);
-            }
-        
-    //Create Text Attachment
-    TMsvAttachmentId attaId = 0;
-    TFileName attachmentFile( _L("story.txt") );
-    TBufC<12> story = _L( "Hello world!" );
-    
-    iMmsClientMtm->CreateTextAttachmentL(*store, attaId, story, attachmentFile, ETrue );
-    msgSize = iMmsClientMtm->MessageSize();
-    
-    store->CommitL();
-    CleanupStack::PopAndDestroy(); // store
-    
-    iMmsClientMtm->SaveMessageL();    
-    }
-
-void TestUniDataModelMMSPlugin::testInboxMessage()
-    {
-    createMMS(KMsvGlobalInBoxIndexEntryIdValue,ETrue);
-    
-    // Get the MMS data modelplugin
-    pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::Mms);
-    
-    pluginInterface->setMessageId(iMessageId);
-
-    int size = pluginInterface->messageSize();
-    QVERIFY(size == msgSize);
-    
-    QVERIFY(pluginInterface->timeStamp() == retTimeStamp);
-    
-   
-    //Fetch the To List
-    ConvergedMessageAddressList recipientList;
-    pluginInterface->toRecipientList(recipientList);
-    QVERIFY(recipientList.count() != 0);
-    
-    ConvergedMessageAddressList recipientList2;
-    pluginInterface->ccRecipientList(recipientList2);
-    QVERIFY(recipientList2.count() != 0);
-    
-    ConvergedMessageAddressList recipientList3;
-    pluginInterface->bccRecipientList(recipientList3);
-    QVERIFY(recipientList3.count() != 0);
-    
-    QString recepient(TEST_MSG_FROM1);
-    QString fromaddress;
-    pluginInterface->fromAddress(fromaddress);
-    QVERIFY(recepient == fromaddress);
-    
-    UniMessageInfoList attList = pluginInterface->attachmentList();
-    QVERIFY(attList.count() != 0);
-    
-    TInt attCount =0;
-    attCount = pluginInterface->attachmentCount();
-    QVERIFY(attCount != 0);
-    
-    MsgPriority priority = pluginInterface->messagePriority();
-    // Normal priority
-    qDebug() << "prority" << priority;
-    QVERIFY(priority == 1);
-
-    QVERIFY(pluginInterface->objectCount() == 1);
-    
-    UniMessageInfoList objectlist = pluginInterface->objectList();
-    QVERIFY(!objectlist.isEmpty());
-    
-    QVERIFY(pluginInterface->slideCount() == 0);
-    
-    TRAPD(err, iMmsClientMtm->SwitchCurrentEntryL(KMsvGlobalInBoxIndexEntryId));
-    }
-
-void TestUniDataModelMMSPlugin::testOutboxMessage()
-    {
-    createMMS(KMsvGlobalOutBoxIndexEntryIdValue,EFalse);
-    
-    // Get the MMS data modelplugin
-    pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::Mms);
-    QVERIFY(pluginInterface->messageType()=="mms");
-    
-    pluginInterface->setMessageId(iMessageId);
-
-    int size = pluginInterface->messageSize();
-    QVERIFY(size == msgSize);
-    
-    QVERIFY(pluginInterface->timeStamp() == retTimeStamp);
-    
-        
-    //Fetch the To List
-    ConvergedMessageAddressList recipientList;
-    pluginInterface->toRecipientList(recipientList);
-    QVERIFY(recipientList.count() != 0);
-    
-    ConvergedMessageAddressList recipientList2;
-    pluginInterface->ccRecipientList(recipientList2);
-    QVERIFY(recipientList2.count() != 0);
-    
-    ConvergedMessageAddressList recipientList3;
-    pluginInterface->bccRecipientList(recipientList3);
-    QVERIFY(recipientList3.count() != 0);
-    
-    QString recepient(TEST_MSG_FROM1);
-    QString fromaddress;
-    pluginInterface->fromAddress(fromaddress);
-    QVERIFY(recepient == fromaddress);
-    
-    UniMessageInfoList attList = pluginInterface->attachmentList();
-    QVERIFY(attList.count() != 0);
-    
-    TInt attCount =0;
-    attCount = pluginInterface->attachmentCount();
-    QVERIFY(attCount != 0);
-    
-    MsgPriority priority = pluginInterface->messagePriority();
-    // Normal priority
-    qDebug() << "prority" << priority;
-    QVERIFY(priority == 1);
-    
-    QVERIFY(pluginInterface->objectCount() == 1);
-    
-    UniMessageInfoList objectlist = pluginInterface->objectList();
-    QVERIFY(!objectlist.isEmpty());
-
-    TRAPD(err, iMmsClientMtm->SwitchCurrentEntryL(KMsvGlobalInBoxIndexEntryId));    
-    }
-
-
-void TestUniDataModelMMSPlugin::createInboxImageMMS()
-    {
-    TMsvEntry indexEntry;
-    indexEntry.iType = KUidMsvMessageEntry;
-    indexEntry.iMtm = KUidMsgTypeMultimedia;
-    indexEntry.iServiceId = iServiceId;
-    indexEntry.iDate.HomeTime();
-    
-    // Convert TTime to QDateTime , this will be used for comparing the time of mesage 
-    // when fetched from datamodel
-    TTime unixEpoch(KUnixEpoch);
-    TTimeIntervalSeconds seconds;
-    TTime timeStamp = indexEntry.iDate;
-    timeStamp.SecondsFrom(unixEpoch, seconds);
-    retTimeStamp.setTime_t(seconds.Int());
-
-
-    TMsvId parentId = KMsvGlobalInBoxIndexEntryIdValue;
-    CMsvEntry* entry = CMsvEntry::NewL(*iMSession,parentId,TMsvSelectionOrdering());
-    CleanupStack::PushL(entry);
-
-    entry->SetEntryL(parentId);
-    entry->CreateL(indexEntry);
-    entry->SetEntryL(indexEntry.Id());
-    iMmsClientMtm->SwitchCurrentEntryL(entry->EntryId());
-    
-    //iMmsClientMtm->LoadMessageL();
-    
-    CMsvStore* store = iMmsClientMtm->Entry().EditStoreL();
-    CleanupStack::PushL(store);
-      
-    iMessageId = indexEntry.Id();
-    idArr.Append(iMessageId);
-    
-    //Sender
-    QString sender(TEST_MSG_FROM1);
-    HBufC* addr = XQConversions::qStringToS60Desc(sender);
-    
-    if (addr)
-        {
-        CleanupStack::PushL(addr);
-        TBuf<32> name;
-        name.Copy(addr->Left(32));
-        indexEntry.iDetails.Set(name);
-        
-        iMmsClientMtm->SetSenderL(*addr);
-        
-        CleanupStack::PopAndDestroy(addr);
-        }
-    
-    //Recipient
-    QString recipient(TEST_MSG_RECIEPIENT1);
-    HBufC* addr2 = XQConversions::qStringToS60Desc(recipient);
-    if (addr2)
-        {
-        CleanupStack::PushL(addr2);
-        iMmsClientMtm->AddAddresseeL(EMsvRecipientTo,*addr2);    
-        CleanupStack::PopAndDestroy(addr2);
-        }
-    
-    
-    // Attachments are added to the message entry one by one
-   
-    TMsvAttachmentId attaId = 0;
-   
-    RFile attaFile;
-    // Set filename of attachment
-    TFileName name( _L("C:\\pictures\\photo.jpg") );
-   
-    CMsvMimeHeaders* mimeHeaders = CMsvMimeHeaders::NewL();
-    CleanupStack::PushL( mimeHeaders );
-   
-    // Set values to mime headers
-    mimeHeaders->SetContentTypeL( _L8( "image") );
-    mimeHeaders->SetContentSubTypeL( _L8( "jpeg" ) );
-   
-    _LIT8(KMimeType, "image/jpeg");
-    TBufC8<10> mimeType(KMimeType);
-    // CreateAttachment2L will set the content type to attachment Info
-   
-    // Open the attachment file for reading
-    attaFile.Open( iFs, name, EFileShareReadersOnly | EFileRead );
-    CleanupClosePushL(attaFile);
-   
-    CMsvAttachment* attaInfo = CMsvAttachment::NewL(CMsvAttachment::EMsvFile);
-    // attaInfo ownerhip will be transferred to Attachment Manager.
-    // It must not be pushed onto the cleanupStack before calling 
-    // CreateAttachment2L.
-   
-       
-    iMmsClientMtm->CreateAttachment2L(*store, attaFile,mimeType,*mimeHeaders,attaInfo,attaId);
-    // Now Attachment Manager owns the attaInfo
-    attaInfo = NULL;
-   
-    CleanupStack::PopAndDestroy(); // attaFile.Close()
-    CleanupStack::PopAndDestroy(); // mimeHeaders
-   
-    // Several attachments can be added before committing the store
-   
-    // Store must be committed before it is destroyed
-    store->CommitL();
-    CleanupStack::PopAndDestroy(); // store
-    
-    iMmsClientMtm->SaveMessageL();    
-    }
-
-void TestUniDataModelMMSPlugin::testInboxImageMMSMessage()
-    {
-    createInboxImageMMS();
-    
-    // Get the MMS data modelplugin
-    pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::Mms);
-    
-    pluginInterface->setMessageId(iMessageId);
-
-    int size = pluginInterface->messageSize();
-    
-    QVERIFY(pluginInterface->timeStamp() == retTimeStamp);
-    
-        
-    //Fetch the To List
-    ConvergedMessageAddressList recipientList;
-    pluginInterface->toRecipientList(recipientList);
-    QVERIFY(recipientList.count() != 0);
-    
-    QString recepient(TEST_MSG_FROM1);
-    QString fromaddress;
-    pluginInterface->fromAddress(fromaddress);
-    QVERIFY(recepient == fromaddress);
-    
-    TRAPD(err, iMmsClientMtm->SwitchCurrentEntryL(KMsvGlobalInBoxIndexEntryId));
-    }
-
-
-
-void TestUniDataModelMMSPlugin::testGetPluginWithoutLoading()
-{
-    pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::Mms);
-    QVERIFY(pluginInterface == NULL);
-
-    // Try to geta plugin for a differnt message type
-    pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::BioMsg);
-    QVERIFY(pluginInterface == NULL);
-}
-
-
-void TestObserverMMS::HandleSessionEventL(TMsvSessionEvent /*aEvent*/,
-                                       TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
-{
-}
-
-
-
--- a/messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/testunidatamodelmmsplugin.h	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- * 
- * Description:
- */
-
-#ifndef TESTUNIDATAMODELMMSPLUGIN_H_
-#define TESTUNIDATAMODELMMSPLUGIN_H_
-
-#ifdef BUILD_TEST_DLL
-#define TEST_EXPORT Q_DECL_EXPORT
-#else
-#define TEST_EXPORT Q_DECL_IMPORT
-#endif
-
-#include <QObject>
-#include <txtetext.h>
-#include <txtrich.h>
-#include <mtclreg.h>
-#include <mtclbase.h>
-#include <msvids.h>
-#include <QDateTime>
-
-class UniDataModelPluginInterface;
-class UniDataModelLoader;
-class TestObserverMMS;
-class CMmsClientMtm;
-class CMmsHeaders;
-class CMmsSettings;
-
-class ConvergedMessage;
-class RFs;
-
-class TEST_EXPORT TestUniDataModelMMSPlugin : public QObject
-{
-Q_OBJECT
-
-private slots:
-    //called by frame work.
-    void initTestCase();//called before the first testfunction is executed.
-    void cleanupTestCase();//called after the last testfunction was executed.
-    void init();//called before each testfunction is executed.
-    void cleanup();//called after every testfunction.
-    void testInboxMessage();
-	void testOutboxMessage();
-    void testInboxImageMMSMessage();
-    
-private:
-    void createMMS(TMsvId pId, TBool subjectField);
-    void createInboxImageMMS();
-    
-private:
-    UniDataModelPluginInterface* pluginInterface;
-    TestObserverMMS* iObserver;
-    CMsvSession* iMSession;
-    CClientMtmRegistry* iMtmReg;
-    CMmsClientMtm* iMmsClientMtm;
-    TMsvId iMessageId;
-    RArray<TMsvId> idArr;
-    UniDataModelLoader* pluginLoader;
-    QDateTime retTimeStamp ;
-    RFs iFs;
-    CMmsSettings* iSettings;
-    CMmsHeaders* iMmsHeaders;
-    TMsvId iServiceId;
-    TInt msgSize;
-};
-
-class TestObserverMMS : public MMsvSessionObserver
-{
-public:
-    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2,
-                             TAny* aArg3);
-};
-
-#endif /* TESTUNIDATAMODELMMSPLUGIN_H_ */
--- a/messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/testunidatamodelmmsplugin.ini	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-const char TEST_MSG_FROM1[] 		= "9741596546";
-const char TEST_MSG_RECIEPIENT1[] 	= "9741596546";
-const char TEST_MSG_RECIEPIENT2[] 	= "9741596547";
-const char TEST_MSG_RECIEPIENT3[] 	= "9741596548";
-const char TEST_MSG_SUBJECT[] = "This is an MMS";
\ No newline at end of file
--- a/messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/testunidatamodelmmsplugin.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/testunidatamodelmmsplugin.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -1,63 +1,92 @@
-######################################################################
-# Automatically generated by qmake (2.01a) Fri Aug 7 12:54:45 2009
-######################################################################
+#
+# 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: Test Case Project Definition for UnidataModelMMSPlugin
+#
+
 QT += testlib
 QT -= gui
 
-TEMPLATE = lib
-TARGET = test-unidatamodel-mms-plugin
-
+CONFIG += hb
+CONFIG += symbian_test
+CONFIG += qtestlib
 
-INCLUDEPATH += .
-INCLUDEPATH += ../../../../../internal/sf/app/messaging/mmsengine/mmsmessage/inc 
-INCLUDEPATH += ../../../../../internal/sf/app/messaging/mmsengine/inc
-INCLUDEPATH += ../../../../../../inc
+TEMPLATE = app
+TARGET = testunidatamodelmmsplugin
 
+INCLUDEPATH += ./inc
+INCLUDEPATH += ../../../../../../../inc
+INCLUDEPATH += ../../../../unidatamodel/inc
+INCLUDEPATH += ../../inc
 INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
 
-DEFINES += BUILD_TEST_DLL
+DEFINES += BUILD_TESTUNIDATAMODELMMSPLUGIN_DLL
+
+SYMBIAN_PLATFORMS = WINSCW ARMV5
 
 SOURCES += \
-	TestUniDataModelMmsPlugin.cpp
-
-				 
+	./src/TestUniDataModelMmsPlugin.cpp
 
 # Input
 HEADERS += \
-	TestUniDataModelMmsPlugin.h
-	
-	   	   			 
-   
+	./inc/TestUniDataModelMmsPlugin.h
+
 SYMBIAN_PLATFORMS = WINSCW ARMV5
     symbian {
-    TARGET.CAPABILITY = CAP_GENERAL_DLL
+    TARGET.UID3 =  0xE7567466
+    TARGET.CAPABILITY = All -TCB -DRM
     TARGET.EPOCSTACKSIZE = 0x8000
     TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000
-    TARGET.EPOCALLOWDLLDATA = 1
-    BLD_INF_RULES.prj_exports += "photo.jpg C:/pictures/photo.jpg"
-		}
-		
-defBlock = \      
-	  "$${LITERAL_HASH}if defined(EABI)" \
-	  "DEFFILE  ../eabi/test_unidatamodel_mms_plugin.def" \
-             "$${LITERAL_HASH}else" \
-             "DEFFILE  ../bwins/test_unidatamodel_mms_plugin.def" \
-             "$${LITERAL_HASH}endif"
+    VENDORID =  VID_DEFAULT
+    BLD_INF_RULES.prj_exports += "data/TestUnidataModelMMSPluginPhoto.jpg C:/data/TestUnidataModelMMSPluginPhoto.jpg"
+    }
 	
-MMP_RULES += defBlock
-		
- LIBS += -leuser \
-	-lconvergedmessageutils\
+LIBS += -leuser \
+	-lconvergedmessageutils \
 	-lxqutils \
 	-lmsgs \
 	-lsmcm \
 	-lgsmu \
 	-letext \
 	-lmsgs \
-	-lunidatamodelloader\
 	-lQtCore \
 	-lmmscli \
 	-lefsrv \
 	-lmmsmessage \
-	-lmmsserversettings
+	-lmmsserversettings \
+	-lunidatamodelloader
+
+packageheader = "$${LITERAL_HASH}{\"TestUnidataModelMMSPlugin\"},(0xE7567466),1,0,0,TYPE=SA"
 
+vendorinfo = \
+			"; Localised Vendor name" \
+			"%{\"Nokia\"}" \
+			"; Unique Vendor name" \
+			":\"Nokia\"" 
+			
+dependencyinfo = \
+				"; Default HW/platform dependencies" \
+				"[0x101F7961],0,0,0,{\"S60ProductID\"}" \
+				"[0x2001E61C],4,6,3,{"Qt"}
+				
+default_deployment.pkg_prerules =	packageheader \
+									vendorinfo \
+									dependencyinfo 
+
+#Copy the dependent DLL
+symbian: {
+	addFile1.sources = ./data/TestUnidataModelMMSPluginPhoto.jpg
+	addFile1.path = C:/data/
+	DEPLOYMENT += addFile1
+	}
+	
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/tsrc.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,21 @@
+#
+# 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: Project file for testmmsgplugin
+#
+
+TEMPLATE = subdirs
+
+SUBDIRS += testunidatamodelmmsplugin
+
+CONFIG += ordered
\ No newline at end of file
--- a/messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/tsrc/bwins/test_unidatamodel_sms_pluginu.def	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-EXPORTS
-	?testGetPluginWithoutLoading@TestUniDataModelSMSPlugin@@AAEXXZ @ 1 NONAME ; void TestUniDataModelSMSPlugin::testGetPluginWithoutLoading(void)
-	?qt_metacall@TestUniDataModelSMSPlugin@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 2 NONAME ; int TestUniDataModelSMSPlugin::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?tr@TestUniDataModelSMSPlugin@@SA?AVQString@@PBD0H@Z @ 3 NONAME ; class QString TestUniDataModelSMSPlugin::tr(char const *, char const *, int)
-	?createDraftsSMSNoRecipient@TestUniDataModelSMSPlugin@@AAEXXZ @ 4 NONAME ; void TestUniDataModelSMSPlugin::createDraftsSMSNoRecipient(void)
-	?createSentSMS@TestUniDataModelSMSPlugin@@AAEXXZ @ 5 NONAME ; void TestUniDataModelSMSPlugin::createSentSMS(void)
-	?testOutboxMessage@TestUniDataModelSMSPlugin@@AAEXXZ @ 6 NONAME ; void TestUniDataModelSMSPlugin::testOutboxMessage(void)
-	?testDraftsMessageNoRecipient@TestUniDataModelSMSPlugin@@AAEXXZ @ 7 NONAME ; void TestUniDataModelSMSPlugin::testDraftsMessageNoRecipient(void)
-	?staticMetaObject@TestUniDataModelSMSPlugin@@2UQMetaObject@@B @ 8 NONAME ; struct QMetaObject const TestUniDataModelSMSPlugin::staticMetaObject
-	?metaObject@TestUniDataModelSMSPlugin@@UBEPBUQMetaObject@@XZ @ 9 NONAME ; struct QMetaObject const * TestUniDataModelSMSPlugin::metaObject(void) const
-	?cleanup@TestUniDataModelSMSPlugin@@AAEXXZ @ 10 NONAME ; void TestUniDataModelSMSPlugin::cleanup(void)
-	?trUtf8@TestUniDataModelSMSPlugin@@SA?AVQString@@PBD0H@Z @ 11 NONAME ; class QString TestUniDataModelSMSPlugin::trUtf8(char const *, char const *, int)
-	?testUnusedAPIs@TestUniDataModelSMSPlugin@@AAEXXZ @ 12 NONAME ; void TestUniDataModelSMSPlugin::testUnusedAPIs(void)
-	?testInboxMessage@TestUniDataModelSMSPlugin@@AAEXXZ @ 13 NONAME ; void TestUniDataModelSMSPlugin::testInboxMessage(void)
-	?createInboxSMS@TestUniDataModelSMSPlugin@@AAEXXZ @ 14 NONAME ; void TestUniDataModelSMSPlugin::createInboxSMS(void)
-	?qt_metacast@TestUniDataModelSMSPlugin@@UAEPAXPBD@Z @ 15 NONAME ; void * TestUniDataModelSMSPlugin::qt_metacast(char const *)
-	?init@TestUniDataModelSMSPlugin@@AAEXXZ @ 16 NONAME ; void TestUniDataModelSMSPlugin::init(void)
-	?tr@TestUniDataModelSMSPlugin@@SA?AVQString@@PBD0@Z @ 17 NONAME ; class QString TestUniDataModelSMSPlugin::tr(char const *, char const *)
-	?getStaticMetaObject@TestUniDataModelSMSPlugin@@SAABUQMetaObject@@XZ @ 18 NONAME ; struct QMetaObject const & TestUniDataModelSMSPlugin::getStaticMetaObject(void)
-	?testPluginLoading@TestUniDataModelSMSPlugin@@AAEXXZ @ 19 NONAME ; void TestUniDataModelSMSPlugin::testPluginLoading(void)
-	?trUtf8@TestUniDataModelSMSPlugin@@SA?AVQString@@PBD0@Z @ 20 NONAME ; class QString TestUniDataModelSMSPlugin::trUtf8(char const *, char const *)
-	?testDraftsMessage@TestUniDataModelSMSPlugin@@AAEXXZ @ 21 NONAME ; void TestUniDataModelSMSPlugin::testDraftsMessage(void)
-	?testPluginLoadingMultipleTimes@TestUniDataModelSMSPlugin@@AAEXXZ @ 22 NONAME ; void TestUniDataModelSMSPlugin::testPluginLoadingMultipleTimes(void)
-	?createOutboxSMS@TestUniDataModelSMSPlugin@@AAEXXZ @ 23 NONAME ; void TestUniDataModelSMSPlugin::createOutboxSMS(void)
-	?createDraftsSMS@TestUniDataModelSMSPlugin@@AAEXXZ @ 24 NONAME ; void TestUniDataModelSMSPlugin::createDraftsSMS(void)
-	?testSentMessage@TestUniDataModelSMSPlugin@@AAEXXZ @ 25 NONAME ; void TestUniDataModelSMSPlugin::testSentMessage(void)
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/tsrc/testunidatamodelsmsplugin/inc/testunidatamodelsmsplugin.h	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ * 
+ * Description:
+ */
+
+#ifndef TEST_UNI_DATA_MODEL_SMS_PLUGIN_H
+#define TEST_UNI_DATA_MODEL_SMS_PLUGIN_H
+
+#ifdef BUILD_TEST_DLL
+#define TEST_EXPORT Q_DECL_EXPORT
+#else
+#define TEST_EXPORT Q_DECL_IMPORT
+#endif
+
+#include <QObject>
+#include <txtetext.h>
+#include <txtrich.h>
+#include <mtclreg.h>
+#include <mtclbase.h>
+#include <msvids.h>
+#include <smsclnt.h>
+#include <smuthdr.h>
+#include <QDateTime>
+
+class UniDataModelPluginInterface;
+class UniDataModelLoader;
+class TestObserver;
+
+class ConvergedMessage;
+
+class TEST_EXPORT TestUniDataModelSMSPlugin : public QObject
+{
+Q_OBJECT
+
+private slots:
+    //called by frame work.
+    //  void initTestCase();//called before the first testfunction is executed.
+    //  void cleanupTestCase();//called after the last testfunction was executed.
+    void init();//called before each testfunction is executed.
+    void cleanup();//called after every testfunction.
+
+    //test cases.
+    
+    void testInboxMessage();
+    void testOutboxMessage();
+    void testDraftsMessage();
+    void testDraftsMessageNoRecipient();
+    void testUnusedAPIs();
+
+private:
+    void createInboxSMS();
+    void createOutboxSMS();
+    void createDraftsSMS();
+    void createDraftsSMSNoRecipient();
+    void testGetPluginWithoutLoading();
+    
+
+private:
+    UniDataModelPluginInterface* pluginInterface;
+    TestObserver* iObserver;
+    CMsvSession* iMSession;
+    CClientMtmRegistry* iMtmReg;
+    CSmsClientMtm* iSmsClientMtm;
+    TMsvId messageId;
+    UniDataModelLoader* pluginLoader;
+    QDateTime retTimeStamp ;
+};
+
+class TestObserver : public MMsvSessionObserver
+{
+public:
+    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2,
+                             TAny* aArg3);
+};
+
+#endif //TEST_UNI_DATA_MODEL_SMS_PLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/tsrc/testunidatamodelsmsplugin/inc/testunidatamodelsmsplugin.ini	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,10 @@
+//this file is used to provide predefined set of input data.
+
+//eg.
+const char TEST_MSG_BODY[] 			= "Hi Phone Owner";
+const char TEST_MSG_RECIEPIENT[] 	= "9222";
+const char TEST_MSG_FROM1[] 		= "911";
+const char TEST_MSG_ALIAS1[] 		= "ABC";
+const char TEST_MSG_FROM2[] 		= "9797979797";
+const char TEST_MSG_ALIAS2[] 		= "XYZ";
+const char TEST_MSG_SUBJECT[] 		= "Message Subject";
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/tsrc/testunidatamodelsmsplugin/src/testunidatamodelsmsplugin.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,602 @@
+/*
+ * 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 <QtTest/QtTest>
+#include <QtDebug>
+#include <QTimer>
+#include <QSignalSpy>
+#include <xqconversions.h>
+#include <csmsaccount.h>
+
+#include "convergedmessage.h"
+#include "unidatamodelplugininterface.h"
+#include "unidatamodelloader.h"
+#include "testunidatamodelsmsplugin.h"
+#include "testunidatamodelsmsplugin.ini"
+_LIT(KUnixEpoch, "19700000:000000.000000");
+
+
+//main entry point
+int main(int argc, char *argv[])
+    { 
+    int ret = -1;
+    QCoreApplication app(argc, argv);
+    QObject* tc = new TestUniDataModelSMSPlugin();
+    
+#ifdef __WINSCW__	
+	char *new_argv[3]; 
+	QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log";	
+	QByteArray bytes = str.toAscii();	
+	char arg1[] = "-o";	
+	new_argv[0] = argv[0];	
+	new_argv[1] = arg1;	
+	new_argv[2] = bytes.data();	
+	ret = QTest::qExec(tc, 3, new_argv);	
+#else	
+	ret = QTest::qExec(tc, argc, argv);	
+#endif
+
+	delete tc;
+    return ret;
+
+    }
+
+
+
+//---------------------------------------------------------------
+// TestUniDataModelSMSPlugin::init
+//---------------------------------------------------------------
+
+void TestUniDataModelSMSPlugin::init()
+{
+    iObserver = new (ELeave) TestObserver();
+
+    // Create a new messaging server session..
+    iMSession = CMsvSession::OpenSyncL(*iObserver);
+    // Create the client mtm registry
+    iMtmReg = CClientMtmRegistry::NewL(*iMSession);
+
+    // Get the SMS clientmtm
+    iSmsClientMtm = static_cast<CSmsClientMtm*> (iMtmReg->NewMtmL(KUidMsgTypeSMS));
+      
+    TRAPD(err, iSmsClientMtm->DefaultServiceL()) ;     
+            
+    if( err == KErrNotFound)
+        {
+        CSmsAccount* account = CSmsAccount::NewL();
+        CleanupStack::PushL(account);
+        CSmsSettings* settings = CSmsSettings::NewL();
+        CleanupStack::PushL(settings);
+        account->InitialiseDefaultSettingsL(*settings);
+        CleanupStack::PopAndDestroy(2);
+        }
+    messageId = 0;
+    pluginLoader = new UniDataModelLoader();
+    retTimeStamp = QDateTime::currentDateTime();
+}
+
+//---------------------------------------------------------------
+// TestUniDataModelSMSPlugin::cleanup
+//---------------------------------------------------------------
+void TestUniDataModelSMSPlugin::cleanup()
+{
+
+    if (messageId > 0)
+        iSmsClientMtm->Entry().DeleteL(messageId);
+
+    delete iObserver;
+    iObserver = NULL;
+    
+    delete iSmsClientMtm;
+    iSmsClientMtm = NULL;
+    
+    delete iMtmReg;
+    iMtmReg = NULL;
+    
+    delete iMSession;
+    iMSession = NULL;
+    
+    delete pluginLoader;
+}
+
+//---------------------------------------------------------------
+// TestUniDataModelSMSPlugin::validateMsg
+//---------------------------------------------------------------
+
+void TestUniDataModelSMSPlugin::createInboxSMS()
+{
+    TRAPD(err, iSmsClientMtm->SwitchCurrentEntryL(KMsvGlobalInBoxIndexEntryId));
+
+    // Create a SMS message 
+    iSmsClientMtm->CreateMessageL(iSmsClientMtm->DefaultServiceL());
+    TMsvEntry indexEntry = iSmsClientMtm->Entry().Entry();
+
+    indexEntry.SetInPreparation(ETrue);
+    indexEntry.iMtm = KUidMsgTypeSMS;
+    indexEntry.iType = KUidMsvMessageEntry;
+    indexEntry.iServiceId = iSmsClientMtm->ServiceId();
+    indexEntry.iDate.HomeTime();
+
+    // Convert TTime to QDateTime , this will be used for comparing the time of message 
+    // when fetched from datamodel
+    TTime unixEpoch(KUnixEpoch);
+    TTimeIntervalSeconds seconds;
+    TTime timeStamp = indexEntry.iDate;
+    timeStamp.SecondsFrom(unixEpoch, seconds);
+    retTimeStamp.setTime_t(seconds.Int());
+
+    //AddBody
+    QString body(TEST_MSG_BODY);
+
+    HBufC* bodyText = XQConversions::qStringToS60Desc(body);
+    if (bodyText)
+    {
+        CleanupStack::PushL(bodyText);
+        // Set the Body of the message
+        CRichText & body = iSmsClientMtm->Body();
+        body.Reset();
+        body.InsertL(0, *bodyText);
+
+        TBuf<32> buf;
+        buf.Copy(bodyText->Left(32));
+        indexEntry.iDescription.Set(buf);
+
+        CleanupStack::PopAndDestroy(bodyText);
+    }
+
+    QString recepient(TEST_MSG_FROM1);
+    QString recepient2(TEST_MSG_FROM2);
+    QString alias(TEST_MSG_ALIAS1);
+
+    HBufC* addr = XQConversions::qStringToS60Desc(recepient);
+    HBufC* addr2 = XQConversions::qStringToS60Desc(recepient2);
+    HBufC* alias1 = XQConversions::qStringToS60Desc(alias);
+
+    if (addr)
+    {
+        CleanupStack::PushL(addr);
+        TBuf<32> name;
+        name.Copy(addr->Left(32));
+        indexEntry.iDetails.Set(name);
+        CSmsHeader& smsHeader = iSmsClientMtm->SmsHeader();
+        smsHeader.SetFromAddressL(*addr);
+        messageId = indexEntry.Id();
+
+        CleanupStack::PopAndDestroy(addr);
+    }
+
+    indexEntry.SetAttachment(EFalse);
+    indexEntry.SetVisible(ETrue);
+    indexEntry.SetInPreparation(EFalse);
+
+    indexEntry.SetComplete(ETrue);
+    iSmsClientMtm->Entry().ChangeL(indexEntry);
+    iSmsClientMtm->SaveMessageL();
+
+}
+
+//---------------------------------------------------------------
+// TestUniDataModelSMSPlugin::createOutboxSMS
+//---------------------------------------------------------------
+
+void TestUniDataModelSMSPlugin::createOutboxSMS()
+{
+    TRAPD(err, iSmsClientMtm->SwitchCurrentEntryL(KMsvGlobalOutBoxIndexEntryId));
+
+    // Create a SMS message 
+    iSmsClientMtm->CreateMessageL(iSmsClientMtm->DefaultServiceL());
+    TMsvEntry indexEntry = iSmsClientMtm->Entry().Entry();
+
+    indexEntry.SetInPreparation(ETrue);
+    indexEntry.iMtm = KUidMsgTypeSMS;
+    indexEntry.iType = KUidMsvMessageEntry;
+    indexEntry.iServiceId = iSmsClientMtm->ServiceId();
+    indexEntry.iDate.HomeTime();
+
+    // Convert TTime to QDateTime , this will be used for comparing the time of message 
+    // when fetched from datamodel
+    TTime unixEpoch(KUnixEpoch);
+    TTimeIntervalSeconds seconds;
+    TTime timeStamp = indexEntry.iDate;
+    timeStamp.SecondsFrom(unixEpoch, seconds);
+    retTimeStamp.setTime_t(seconds.Int());
+
+    //AddBody
+    QString body(TEST_MSG_BODY);
+
+    HBufC* bodyText = XQConversions::qStringToS60Desc(body);
+    if (bodyText)
+    {
+        CleanupStack::PushL(bodyText);
+        // Set the Body of the message
+        CRichText & body = iSmsClientMtm->Body();
+        body.Reset();
+        body.InsertL(0, *bodyText);
+
+        TBuf<32> buf;
+        buf.Copy(bodyText->Left(32));
+        indexEntry.iDescription.Set(buf);
+
+        CleanupStack::PopAndDestroy(bodyText);
+    }
+
+    QString recepient(TEST_MSG_FROM1);
+    QString recepient2(TEST_MSG_FROM2);
+    QString alias(TEST_MSG_ALIAS1);
+
+    HBufC* addr = XQConversions::qStringToS60Desc(recepient);
+    HBufC* addr2 = XQConversions::qStringToS60Desc(recepient2);
+    HBufC* alias1 = XQConversions::qStringToS60Desc(alias);
+
+    if (addr)
+    {
+        CleanupStack::PushL(addr);
+        TBuf<32> name;
+        name.Copy(addr->Left(32));
+        indexEntry.iDetails.Set(name);
+
+        // If drafts/ outbox message , set the recipients 
+        iSmsClientMtm->AddAddresseeL(*addr, TPtrC());
+        iSmsClientMtm->AddAddresseeL(*addr2, *alias1);
+        indexEntry.SetSendingState(KMsvSendStateWaiting);
+        messageId = indexEntry.Id();
+        CleanupStack::PopAndDestroy(addr);
+    }
+
+    indexEntry.SetAttachment(EFalse);
+    indexEntry.SetVisible(ETrue);
+    indexEntry.SetInPreparation(EFalse);
+
+    indexEntry.SetComplete(ETrue);
+    iSmsClientMtm->Entry().ChangeL(indexEntry);
+    iSmsClientMtm->SaveMessageL();
+
+}
+
+//---------------------------------------------------------------
+// TestUniDataModelSMSPlugin::createDraftsSMS
+//---------------------------------------------------------------
+
+void TestUniDataModelSMSPlugin::createDraftsSMS()
+{
+    TRAPD(err, iSmsClientMtm->SwitchCurrentEntryL(KMsvDraftEntryId));
+    // Create a SMS message 
+    iSmsClientMtm->CreateMessageL(iSmsClientMtm->DefaultServiceL());
+    TMsvEntry indexEntry = iSmsClientMtm->Entry().Entry();
+
+    indexEntry.SetInPreparation(ETrue);
+    indexEntry.iMtm = KUidMsgTypeSMS;
+    indexEntry.iType = KUidMsvMessageEntry;
+    indexEntry.iServiceId = iSmsClientMtm->ServiceId();
+    indexEntry.iDate.HomeTime();
+
+    // Convert TTime to QDateTime , this will be used for comparing the time of message 
+    // when fetched from datamodel
+    TTime unixEpoch(KUnixEpoch);
+    TTimeIntervalSeconds seconds;
+    TTime timeStamp = indexEntry.iDate;
+    timeStamp.SecondsFrom(unixEpoch, seconds);
+    retTimeStamp.setTime_t(seconds.Int());
+
+    //AddBody
+    QString body(TEST_MSG_BODY);
+
+    HBufC* bodyText = XQConversions::qStringToS60Desc(body);
+    if (bodyText)
+    {
+        CleanupStack::PushL(bodyText);
+        // Set the Body of the message
+        CRichText & body = iSmsClientMtm->Body();
+        body.Reset();
+        body.InsertL(0, *bodyText);
+
+        TBuf<32> buf;
+        buf.Copy(bodyText->Left(32));
+        indexEntry.iDescription.Set(buf);
+
+        CleanupStack::PopAndDestroy(bodyText);
+    }
+
+    QString recipient(TEST_MSG_FROM1);
+    QString recipient2(TEST_MSG_FROM2);
+    QString alias(TEST_MSG_ALIAS1);
+
+    HBufC* addr = XQConversions::qStringToS60Desc(recipient);
+    HBufC* addr2 = XQConversions::qStringToS60Desc(recipient2);
+    HBufC* alias1 = XQConversions::qStringToS60Desc(alias);
+
+    if (addr)
+    {
+        CleanupStack::PushL(addr);
+        TBuf<32> name;
+        name.Copy(addr->Left(32));
+        indexEntry.iDetails.Set(name);
+
+        // If drafts/ outbox message , set the recipients 
+        iSmsClientMtm->AddAddresseeL(*addr, TPtrC());
+        indexEntry.SetSendingState(KMsvSendStateWaiting);
+        messageId = indexEntry.Id();
+
+        CleanupStack::PopAndDestroy(addr);
+    }
+
+    indexEntry.SetAttachment(EFalse);
+    indexEntry.SetVisible(ETrue);
+    indexEntry.SetInPreparation(EFalse);
+
+    indexEntry.SetComplete(ETrue);
+    iSmsClientMtm->Entry().ChangeL(indexEntry);
+    iSmsClientMtm->SaveMessageL();
+
+}
+
+//---------------------------------------------------------------
+// TestUniDataModelSMSPlugin::createDraftsSMSNoRecipient
+//---------------------------------------------------------------
+void TestUniDataModelSMSPlugin::createDraftsSMSNoRecipient()
+{
+    TRAPD(err, iSmsClientMtm->SwitchCurrentEntryL(KMsvDraftEntryId));
+    // Create a SMS message 
+    iSmsClientMtm->CreateMessageL(iSmsClientMtm->DefaultServiceL());
+    TMsvEntry indexEntry = iSmsClientMtm->Entry().Entry();
+
+    indexEntry.SetInPreparation(ETrue);
+    indexEntry.iMtm = KUidMsgTypeSMS;
+    indexEntry.iType = KUidMsvMessageEntry;
+    indexEntry.iServiceId = iSmsClientMtm->ServiceId();
+    indexEntry.iDate.HomeTime();
+
+    //AddBody
+    QString body(TEST_MSG_BODY);
+
+    HBufC* bodyText = XQConversions::qStringToS60Desc(body);
+    if (bodyText)
+    {
+        CleanupStack::PushL(bodyText);
+        // Set the Body of the message
+        CRichText & body = iSmsClientMtm->Body();
+        body.Reset();
+        body.InsertL(0, *bodyText);
+
+        TBuf<32> buf;
+        buf.Copy(bodyText->Left(32));
+        indexEntry.iDescription.Set(buf);
+
+        CleanupStack::PopAndDestroy(bodyText);
+    }
+
+    indexEntry.SetSendingState(KMsvSendStateWaiting);
+    messageId = indexEntry.Id();
+
+    indexEntry.SetAttachment(EFalse);
+    indexEntry.SetVisible(ETrue);
+    indexEntry.SetInPreparation(EFalse);
+
+    indexEntry.SetComplete(ETrue);
+    iSmsClientMtm->Entry().ChangeL(indexEntry);
+    iSmsClientMtm->SaveMessageL();
+}
+
+//---------------------------------------------------------------
+// TestUniDataModelSMSPlugin::testInboxMessage
+//---------------------------------------------------------------
+
+void TestUniDataModelSMSPlugin::testInboxMessage()
+{
+    createInboxSMS();
+
+    // Get the SMS data modelplugin
+    pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::Sms);
+
+    pluginInterface->setMessageId(messageId);
+
+    int size = pluginInterface->messageSize();
+
+    QVERIFY(pluginInterface->timeStamp() == retTimeStamp);
+
+    QString body;
+    pluginInterface->body(body);
+    QString origBody(TEST_MSG_BODY);
+    QVERIFY(origBody == body);
+
+    ConvergedMessageAddressList recipientList;
+    pluginInterface->toRecipientList(recipientList);
+
+    QString recipient(TEST_MSG_FROM1);
+    QString recipient2(TEST_MSG_FROM2);
+    QString origalias(TEST_MSG_ALIAS1);
+
+    QVERIFY(recipientList.count() == 0);
+
+    int size1 = pluginInterface->messageSize();
+
+    QString fromaddress;
+    pluginInterface->fromAddress(fromaddress);
+    QVERIFY(recipient == fromaddress);
+}
+
+//---------------------------------------------------------------
+// TestUniDataModelSMSPlugin::testOutboxMessage
+//---------------------------------------------------------------
+
+void TestUniDataModelSMSPlugin::testOutboxMessage()
+{
+    createOutboxSMS();
+    // Get the SMS data modelplugin
+    pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::Sms);
+
+    // Get the data for the first message in DRAFTS    
+    pluginInterface->setMessageId(messageId);
+    int size = pluginInterface->messageSize();
+
+    QVERIFY(pluginInterface->timeStamp() == retTimeStamp);
+
+    QString body;
+    pluginInterface->body(body);
+    QString origBody(TEST_MSG_BODY);
+    QVERIFY(origBody == body);
+
+    ConvergedMessageAddressList recipientList;
+    pluginInterface->toRecipientList(recipientList);
+
+    QString recipient(TEST_MSG_FROM1);
+    QString recipient2(TEST_MSG_FROM2);
+    QString origalias(TEST_MSG_ALIAS1);
+
+    QVERIFY(recipientList.count() == 2);
+    QVERIFY(recipient == recipientList[0]->address()
+            && recipientList[0]->alias().isEmpty());
+
+    const QString& as = recipientList[1]->address();
+    const QString& as1 = recipientList[1]->alias();
+    QVERIFY(recipient2 == as);
+
+    // ConvergedMessageAddress::alias return a QSting with a space
+    origalias.append(' ');
+    QVERIFY(origalias == as1);
+
+    int size1 = pluginInterface->messageSize();
+
+    QString fromaddress;
+    pluginInterface->fromAddress(fromaddress);
+    QVERIFY(fromaddress.isEmpty());
+}
+
+//---------------------------------------------------------------
+// TestUniDataModelSMSPlugin::testDraftsMessage
+//---------------------------------------------------------------
+
+void TestUniDataModelSMSPlugin::testDraftsMessage()
+{
+    createDraftsSMS();
+    // Get the SMS data modelplugin
+    pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::Sms);
+
+    // Get the data for the first message in DRAFTS    
+    pluginInterface->setMessageId(messageId);
+    int size = pluginInterface->messageSize();
+
+    QVERIFY(pluginInterface->timeStamp() == retTimeStamp);
+
+    QString body;
+    pluginInterface->body(body);
+    QString origBody(TEST_MSG_BODY);
+    QVERIFY(origBody == body);
+
+    ConvergedMessageAddressList recipientList;
+    pluginInterface->toRecipientList(recipientList);
+
+    QString recipient(TEST_MSG_FROM1);
+
+    QVERIFY(recipientList.count() == 1);
+    QVERIFY(recipient == recipientList[0]->address()
+            && recipientList[0]->alias().isEmpty());
+
+    QString fromaddress;
+    pluginInterface->fromAddress(fromaddress);
+    QVERIFY(fromaddress.isEmpty());
+}
+
+//---------------------------------------------------------------
+// TestUniDataModelSMSPlugin::testDraftsMessageNoRecipient
+//---------------------------------------------------------------
+
+void TestUniDataModelSMSPlugin::testDraftsMessageNoRecipient()
+{
+    createDraftsSMSNoRecipient();
+    // Get the SMS data modelplugin
+    pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::Sms);
+
+    // Get the data for the first message in DRAFTS    
+    pluginInterface->setMessageId(messageId);
+    int size = pluginInterface->messageSize();
+
+    QString body;
+    pluginInterface->body(body);
+    QString origBody(TEST_MSG_BODY);
+    QVERIFY(origBody == body);
+
+    ConvergedMessageAddressList recipientList;
+    pluginInterface->toRecipientList(recipientList);
+
+    QVERIFY(recipientList.count() == 0);
+
+    QString fromaddress;
+    pluginInterface->fromAddress(fromaddress);
+    QVERIFY(fromaddress.isEmpty());
+}
+
+//---------------------------------------------------------------
+// TestUniDataModelSMSPlugin::testGetPluginWithoutLoading
+//---------------------------------------------------------------
+
+void TestUniDataModelSMSPlugin::testGetPluginWithoutLoading()
+{
+    pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::Sms);
+    QVERIFY(pluginInterface == NULL);
+
+    // Try to geta plugin for a differnt message type
+    pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::Mms);
+    QVERIFY(pluginInterface == NULL);
+}
+
+//---------------------------------------------------------------
+// TestUniDataModelSMSPlugin::testUnusedAPIs
+//---------------------------------------------------------------
+
+void TestUniDataModelSMSPlugin::testUnusedAPIs()
+{
+	  pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::Sms);
+
+    QVERIFY(pluginInterface->hasAttachment() == false);
+
+    UniMessageInfoList attachmentlist = pluginInterface->attachmentList();
+    QVERIFY(attachmentlist.isEmpty());
+
+    QVERIFY(pluginInterface->objectCount() == 0);
+
+    UniMessageInfoList objectlist = pluginInterface->objectList();
+    QVERIFY(objectlist.isEmpty());
+
+    QVERIFY(pluginInterface->slideCount() == 0);
+
+    UniMessageInfoList slidelist = pluginInterface->slideContent(0);
+    QVERIFY(slidelist.isEmpty());
+    
+    ConvergedMessageAddressList recipientList;
+    
+	pluginInterface->ccRecipientList(recipientList);
+	QVERIFY(recipientList.count() == 0);
+		
+	pluginInterface->bccRecipientList(recipientList);
+	QVERIFY(recipientList.count() == 0);
+		
+	 MsgPriority priority = pluginInterface->messagePriority();
+    // Normal priority
+    qDebug() << "prority" << priority;
+    QVERIFY(priority == 1);
+	int count = pluginInterface->attachmentCount();
+    QVERIFY(count == 0);
+		
+}
+
+//---------------------------------------------------------------
+// TestUniDataModelSMSPlugin::HandleSessionEventL
+//---------------------------------------------------------------
+
+void TestObserver::HandleSessionEventL(TMsvSessionEvent /*aEvent*/,
+                                       TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
+{
+}
--- a/messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/tsrc/testunidatamodelsmsplugin/testunidatamodelsmsplugin.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,646 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- * 
- * Description:
- */
-#include <QtTest/QtTest>
-#include <QtDebug>
-#include <QTimer>
-#include <QSignalSpy>
-#include <xqconversions.h>
-#include <csmsaccount.h>
-
-#include "convergedmessage.h"
-#include "unidatamodelplugininterface.h"
-#include "unidatamodelloader.h"
-#include "serviceinfo.h"
-#include "testunidatamodelsmsplugin.h"
-#include "testunidatamodelsmsplugin.ini"
-_LIT(KUnixEpoch, "19700000:000000.000000");
-
-//---------------------------------------------------------------
-// TestUniDataModelSMSPlugin::init
-//---------------------------------------------------------------
-
-void TestUniDataModelSMSPlugin::init()
-{
-    iObserver = new (ELeave) TestObserver();
-
-    // Create a new messaging server session..
-    iMSession = CMsvSession::OpenSyncL(*iObserver);
-    // Create the client mtm registry
-    iMtmReg = CClientMtmRegistry::NewL(*iMSession);
-
-    // Get the SMS clientmtm
-    iSmsClientMtm
-            = static_cast<CSmsClientMtm*> (iMtmReg->NewMtmL(KUidMsgTypeSMS));
-      
-    TRAPD(err, iSmsClientMtm->DefaultServiceL()) ;     
-            
-    if( err == KErrNotFound)
-        {
-        CSmsAccount* account = CSmsAccount::NewL();
-        CleanupStack::PushL(account);
-        CSmsSettings* settings = CSmsSettings::NewL();
-        CleanupStack::PushL(settings);
-        account->InitialiseDefaultSettingsL(*settings);
-        CleanupStack::PopAndDestroy(2);
-        
-        }
-    messageId = 0;
-    pluginLoader = new UniDataModelLoader();
-    retTimeStamp = QDateTime::currentDateTime();
-}
-
-//---------------------------------------------------------------
-// TestUniDataModelSMSPlugin::cleanup
-//---------------------------------------------------------------
-void TestUniDataModelSMSPlugin::cleanup()
-{
-
-    if (messageId > 0)
-        iSmsClientMtm->Entry().DeleteL(messageId);
-
-    delete iObserver;
-    iObserver = NULL;
-    delete iSmsClientMtm;
-    iSmsClientMtm = NULL;
-    delete iMtmReg;
-    iMtmReg = NULL;
-    delete iMSession;
-    iMSession = NULL;
-    
-    delete pluginLoader;
-}
-
-//---------------------------------------------------------------
-// TestUniDataModelSMSPlugin::validateMsg
-//---------------------------------------------------------------
-void TestUniDataModelSMSPlugin::createInboxSMS()
-{
-    TRAPD(err, iSmsClientMtm->SwitchCurrentEntryL(KMsvGlobalInBoxIndexEntryId));
-
-    // Create a SMS message 
-    iSmsClientMtm->CreateMessageL(iSmsClientMtm->DefaultServiceL());
-    TMsvEntry indexEntry = iSmsClientMtm->Entry().Entry();
-
-    indexEntry.SetInPreparation(ETrue);
-    indexEntry.iMtm = KUidMsgTypeSMS;
-    indexEntry.iType = KUidMsvMessageEntry;
-    indexEntry.iServiceId = iSmsClientMtm->ServiceId();
-    indexEntry.iDate.HomeTime();
-
-    // Convert TTime to QDateTime , this will be used for comparing the time of message 
-    // when fetched from datamodel
-    TTime unixEpoch(KUnixEpoch);
-    TTimeIntervalSeconds seconds;
-    TTime timeStamp = indexEntry.iDate;
-    timeStamp.SecondsFrom(unixEpoch, seconds);
-    retTimeStamp.setTime_t(seconds.Int());
-
-    //AddBody
-    QString body(TEST_MSG_BODY);
-
-    HBufC* bodyText = XQConversions::qStringToS60Desc(body);
-    if (bodyText)
-    {
-        CleanupStack::PushL(bodyText);
-        // Set the Body of the message
-        CRichText & body = iSmsClientMtm->Body();
-        body.Reset();
-        body.InsertL(0, *bodyText);
-
-        TBuf<32> buf;
-        buf.Copy(bodyText->Left(32));
-        indexEntry.iDescription.Set(buf);
-
-        CleanupStack::PopAndDestroy(bodyText);
-    }
-
-    QString recepient(TEST_MSG_FROM1);
-    QString recepient2(TEST_MSG_FROM2);
-    QString alias(TEST_MSG_ALIAS1);
-
-    HBufC* addr = XQConversions::qStringToS60Desc(recepient);
-    HBufC* addr2 = XQConversions::qStringToS60Desc(recepient2);
-    HBufC* alias1 = XQConversions::qStringToS60Desc(alias);
-
-    if (addr)
-    {
-        CleanupStack::PushL(addr);
-        TBuf<32> name;
-        name.Copy(addr->Left(32));
-        indexEntry.iDetails.Set(name);
-        CSmsHeader& smsHeader = iSmsClientMtm->SmsHeader();
-        smsHeader.SetFromAddressL(*addr);
-        messageId = indexEntry.Id();
-
-        CleanupStack::PopAndDestroy(addr);
-    }
-
-    indexEntry.SetAttachment(EFalse);
-    indexEntry.SetVisible(ETrue);
-    indexEntry.SetInPreparation(EFalse);
-
-    indexEntry.SetComplete(ETrue);
-    iSmsClientMtm->Entry().ChangeL(indexEntry);
-    iSmsClientMtm->SaveMessageL();
-
-}
-
-void TestUniDataModelSMSPlugin::createOutboxSMS()
-{
-    TRAPD(err, iSmsClientMtm->SwitchCurrentEntryL(KMsvGlobalOutBoxIndexEntryId));
-
-    // Create a SMS message 
-    iSmsClientMtm->CreateMessageL(iSmsClientMtm->DefaultServiceL());
-    TMsvEntry indexEntry = iSmsClientMtm->Entry().Entry();
-
-    indexEntry.SetInPreparation(ETrue);
-    indexEntry.iMtm = KUidMsgTypeSMS;
-    indexEntry.iType = KUidMsvMessageEntry;
-    indexEntry.iServiceId = iSmsClientMtm->ServiceId();
-    indexEntry.iDate.HomeTime();
-
-    // Convert TTime to QDateTime , this will be used for comparing the time of message 
-    // when fetched from datamodel
-    TTime unixEpoch(KUnixEpoch);
-    TTimeIntervalSeconds seconds;
-    TTime timeStamp = indexEntry.iDate;
-    timeStamp.SecondsFrom(unixEpoch, seconds);
-    retTimeStamp.setTime_t(seconds.Int());
-
-    //AddBody
-    QString body(TEST_MSG_BODY);
-
-    HBufC* bodyText = XQConversions::qStringToS60Desc(body);
-    if (bodyText)
-    {
-        CleanupStack::PushL(bodyText);
-        // Set the Body of the message
-        CRichText & body = iSmsClientMtm->Body();
-        body.Reset();
-        body.InsertL(0, *bodyText);
-
-        TBuf<32> buf;
-        buf.Copy(bodyText->Left(32));
-        indexEntry.iDescription.Set(buf);
-
-        CleanupStack::PopAndDestroy(bodyText);
-    }
-
-    QString recepient(TEST_MSG_FROM1);
-    QString recepient2(TEST_MSG_FROM2);
-    QString alias(TEST_MSG_ALIAS1);
-
-    HBufC* addr = XQConversions::qStringToS60Desc(recepient);
-    HBufC* addr2 = XQConversions::qStringToS60Desc(recepient2);
-    HBufC* alias1 = XQConversions::qStringToS60Desc(alias);
-
-    if (addr)
-    {
-        CleanupStack::PushL(addr);
-        TBuf<32> name;
-        name.Copy(addr->Left(32));
-        indexEntry.iDetails.Set(name);
-
-        // If drafts/ outbox message , set the recipients 
-        iSmsClientMtm->AddAddresseeL(*addr, TPtrC());
-        iSmsClientMtm->AddAddresseeL(*addr2, *alias1);
-        indexEntry.SetSendingState(KMsvSendStateWaiting);
-        messageId = indexEntry.Id();
-        CleanupStack::PopAndDestroy(addr);
-    }
-
-    indexEntry.SetAttachment(EFalse);
-    indexEntry.SetVisible(ETrue);
-    indexEntry.SetInPreparation(EFalse);
-
-    indexEntry.SetComplete(ETrue);
-    iSmsClientMtm->Entry().ChangeL(indexEntry);
-    iSmsClientMtm->SaveMessageL();
-
-}
-
-void TestUniDataModelSMSPlugin::createSentSMS()
-{
-    TRAPD(err, iSmsClientMtm->SwitchCurrentEntryL(KMsvSentEntryId));
-
-    // Create a SMS message 
-    iSmsClientMtm->CreateMessageL(iSmsClientMtm->DefaultServiceL());
-    TMsvEntry indexEntry = iSmsClientMtm->Entry().Entry();
-
-    indexEntry.SetInPreparation(ETrue);
-    indexEntry.iMtm = KUidMsgTypeSMS;
-    indexEntry.iType = KUidMsvMessageEntry;
-    indexEntry.iServiceId = iSmsClientMtm->ServiceId();
-    indexEntry.iDate.HomeTime();
-
-    // Convert TTime to QDateTime , this will be used for comparing the time of message 
-    // when fetched from datamodel
-
-    TTime unixEpoch(KUnixEpoch);
-    TTimeIntervalSeconds seconds;
-    TTime timeStamp = indexEntry.iDate;
-    timeStamp.SecondsFrom(unixEpoch, seconds);
-    retTimeStamp.setTime_t(seconds.Int());
-
-    //AddBody
-    QString body(TEST_MSG_BODY);
-
-    HBufC* bodyText = XQConversions::qStringToS60Desc(body);
-    if (bodyText)
-    {
-        CleanupStack::PushL(bodyText);
-        // Set the Body of the message
-        CRichText & body = iSmsClientMtm->Body();
-        body.Reset();
-        body.InsertL(0, *bodyText);
-
-        TBuf<32> buf;
-        buf.Copy(bodyText->Left(32));
-        indexEntry.iDescription.Set(buf);
-
-        CleanupStack::PopAndDestroy(bodyText);
-    }
-
-    QString recepient(TEST_MSG_FROM1);
-    QString recepient2(TEST_MSG_FROM2);
-    QString alias(TEST_MSG_ALIAS1);
-
-    HBufC* addr = XQConversions::qStringToS60Desc(recepient);
-    HBufC* addr2 = XQConversions::qStringToS60Desc(recepient2);
-    HBufC* alias1 = XQConversions::qStringToS60Desc(alias);
-
-    if (addr)
-    {
-        CleanupStack::PushL(addr);
-        TBuf<32> name;
-        name.Copy(addr->Left(32));
-        indexEntry.iDetails.Set(name);
-
-        // If inbox/ sent folder  message , set the from address 
-        CSmsHeader& smsHeader = iSmsClientMtm->SmsHeader();
-        smsHeader.SetFromAddressL(*addr);
-        messageId = indexEntry.Id();
-
-        CleanupStack::PopAndDestroy(addr);
-    }
-
-    indexEntry.SetAttachment(EFalse);
-    indexEntry.SetVisible(ETrue);
-    indexEntry.SetInPreparation(EFalse);
-
-    indexEntry.SetComplete(ETrue);
-    iSmsClientMtm->Entry().ChangeL(indexEntry);
-    iSmsClientMtm->SaveMessageL();
-
-}
-
-void TestUniDataModelSMSPlugin::createDraftsSMS()
-{
-    TRAPD(err, iSmsClientMtm->SwitchCurrentEntryL(KMsvDraftEntryId));
-    // Create a SMS message 
-    iSmsClientMtm->CreateMessageL(iSmsClientMtm->DefaultServiceL());
-    TMsvEntry indexEntry = iSmsClientMtm->Entry().Entry();
-
-    indexEntry.SetInPreparation(ETrue);
-    indexEntry.iMtm = KUidMsgTypeSMS;
-    indexEntry.iType = KUidMsvMessageEntry;
-    indexEntry.iServiceId = iSmsClientMtm->ServiceId();
-    indexEntry.iDate.HomeTime();
-
-    // Convert TTime to QDateTime , this will be used for comparing the time of message 
-    // when fetched from datamodel
-    TTime unixEpoch(KUnixEpoch);
-    TTimeIntervalSeconds seconds;
-    TTime timeStamp = indexEntry.iDate;
-    timeStamp.SecondsFrom(unixEpoch, seconds);
-    retTimeStamp.setTime_t(seconds.Int());
-
-    //AddBody
-    QString body(TEST_MSG_BODY);
-
-    HBufC* bodyText = XQConversions::qStringToS60Desc(body);
-    if (bodyText)
-    {
-        CleanupStack::PushL(bodyText);
-        // Set the Body of the message
-        CRichText & body = iSmsClientMtm->Body();
-        body.Reset();
-        body.InsertL(0, *bodyText);
-
-        TBuf<32> buf;
-        buf.Copy(bodyText->Left(32));
-        indexEntry.iDescription.Set(buf);
-
-        CleanupStack::PopAndDestroy(bodyText);
-    }
-
-    QString recipient(TEST_MSG_FROM1);
-    QString recipient2(TEST_MSG_FROM2);
-    QString alias(TEST_MSG_ALIAS1);
-
-    HBufC* addr = XQConversions::qStringToS60Desc(recipient);
-    HBufC* addr2 = XQConversions::qStringToS60Desc(recipient2);
-    HBufC* alias1 = XQConversions::qStringToS60Desc(alias);
-
-    if (addr)
-    {
-        CleanupStack::PushL(addr);
-        TBuf<32> name;
-        name.Copy(addr->Left(32));
-        indexEntry.iDetails.Set(name);
-
-        // If drafts/ outbox message , set the recipients 
-        iSmsClientMtm->AddAddresseeL(*addr, TPtrC());
-        indexEntry.SetSendingState(KMsvSendStateWaiting);
-        messageId = indexEntry.Id();
-
-        CleanupStack::PopAndDestroy(addr);
-    }
-
-    indexEntry.SetAttachment(EFalse);
-    indexEntry.SetVisible(ETrue);
-    indexEntry.SetInPreparation(EFalse);
-
-    indexEntry.SetComplete(ETrue);
-    iSmsClientMtm->Entry().ChangeL(indexEntry);
-    iSmsClientMtm->SaveMessageL();
-
-}
-
-void TestUniDataModelSMSPlugin::createDraftsSMSNoRecipient()
-{
-    TRAPD(err, iSmsClientMtm->SwitchCurrentEntryL(KMsvDraftEntryId));
-    // Create a SMS message 
-    iSmsClientMtm->CreateMessageL(iSmsClientMtm->DefaultServiceL());
-    TMsvEntry indexEntry = iSmsClientMtm->Entry().Entry();
-
-    indexEntry.SetInPreparation(ETrue);
-    indexEntry.iMtm = KUidMsgTypeSMS;
-    indexEntry.iType = KUidMsvMessageEntry;
-    indexEntry.iServiceId = iSmsClientMtm->ServiceId();
-    indexEntry.iDate.HomeTime();
-
-    //AddBody
-    QString body(TEST_MSG_BODY);
-
-    HBufC* bodyText = XQConversions::qStringToS60Desc(body);
-    if (bodyText)
-    {
-        CleanupStack::PushL(bodyText);
-        // Set the Body of the message
-        CRichText & body = iSmsClientMtm->Body();
-        body.Reset();
-        body.InsertL(0, *bodyText);
-
-        TBuf<32> buf;
-        buf.Copy(bodyText->Left(32));
-        indexEntry.iDescription.Set(buf);
-
-        CleanupStack::PopAndDestroy(bodyText);
-    }
-
-    indexEntry.SetSendingState(KMsvSendStateWaiting);
-    messageId = indexEntry.Id();
-
-    indexEntry.SetAttachment(EFalse);
-    indexEntry.SetVisible(ETrue);
-    indexEntry.SetInPreparation(EFalse);
-
-    indexEntry.SetComplete(ETrue);
-    iSmsClientMtm->Entry().ChangeL(indexEntry);
-    iSmsClientMtm->SaveMessageL();
-
-}
-
-void TestUniDataModelSMSPlugin::testInboxMessage()
-{
-    createInboxSMS();
-
-    // Get the SMS data modelplugin
-    pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::Sms);
-
-    pluginInterface->setMessageId(messageId);
-
-    int size = pluginInterface->messageSize();
-
-    QVERIFY(pluginInterface->timeStamp() == retTimeStamp);
-
-    QString body;
-    pluginInterface->body(body);
-    QString origBody(TEST_MSG_BODY);
-    QVERIFY(origBody == body);
-
-    ConvergedMessageAddressList recipientList;
-    pluginInterface->toRecipientList(recipientList);
-
-    QString recipient(TEST_MSG_FROM1);
-    QString recipient2(TEST_MSG_FROM2);
-    QString origalias(TEST_MSG_ALIAS1);
-
-    QVERIFY(recipientList.count() == 0);
-
-    int size1 = pluginInterface->messageSize();
-
-    QString fromaddress;
-    pluginInterface->fromAddress(fromaddress);
-    QVERIFY(recipient == fromaddress);
-    TRAPD(err, iSmsClientMtm->SwitchCurrentEntryL(KMsvGlobalInBoxIndexEntryId));
-}
-
-void TestUniDataModelSMSPlugin::testOutboxMessage()
-{
-    createOutboxSMS();
-    // Get the SMS data modelplugin
-    pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::Sms);
-
-    // Get the data for the first message in DRAFTS    
-    pluginInterface->setMessageId(messageId);
-    int size = pluginInterface->messageSize();
-
-    QVERIFY(pluginInterface->timeStamp() == retTimeStamp);
-
-    QString body;
-    pluginInterface->body(body);
-    QString origBody(TEST_MSG_BODY);
-    QVERIFY(origBody == body);
-
-    ConvergedMessageAddressList recipientList;
-    pluginInterface->toRecipientList(recipientList);
-
-    QString recipient(TEST_MSG_FROM1);
-    QString recipient2(TEST_MSG_FROM2);
-    QString origalias(TEST_MSG_ALIAS1);
-
-    QVERIFY(recipientList.count() == 2);
-    QVERIFY(recipient == recipientList[0]->address()
-            && recipientList[0]->alias().isEmpty());
-
-    const QString& as = recipientList[1]->address();
-    const QString& as1 = recipientList[1]->alias();
-    QVERIFY(recipient2 == as);
-
-    // ConvergedMessageAddress::alias return a QSting with a space
-    origalias.append(' ');
-    QVERIFY(origalias == as1);
-
-    int size1 = pluginInterface->messageSize();
-
-    QString fromaddress;
-    pluginInterface->fromAddress(fromaddress);
-    QVERIFY(fromaddress.isEmpty());
-    TRAPD(err, iSmsClientMtm->SwitchCurrentEntryL(KMsvGlobalOutBoxIndexEntryId));
-}
-
-void TestUniDataModelSMSPlugin::testSentMessage()
-{
-    createSentSMS();
-    // Get the SMS data modelplugin
-    pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::Sms);
-
-    pluginInterface->setMessageId(messageId);
-
-    int size = pluginInterface->messageSize();
-
-    QVERIFY(pluginInterface->timeStamp() == retTimeStamp);
-
-    QString body;
-    pluginInterface->body(body);
-    QString origBody(TEST_MSG_BODY);
-    QVERIFY(origBody == body);
-
-    ConvergedMessageAddressList recipientList;
-    pluginInterface->toRecipientList(recipientList);
-
-    QString recipient(TEST_MSG_FROM1);
-    QString recipient2(TEST_MSG_FROM2);
-    QString origalias(TEST_MSG_ALIAS1);
-
-    QVERIFY(recipientList.count() == 0);
-
-    QString fromaddress;
-    pluginInterface->fromAddress(fromaddress);
-    QVERIFY(recipient == fromaddress);
-    TRAPD(err, iSmsClientMtm->SwitchCurrentEntryL(KMsvSentEntryId));
-}
-
-void TestUniDataModelSMSPlugin::testDraftsMessage()
-{
-    createDraftsSMS();
-    // Get the SMS data modelplugin
-    pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::Sms);
-
-    // Get the data for the first message in DRAFTS    
-    pluginInterface->setMessageId(messageId);
-    int size = pluginInterface->messageSize();
-
-    QVERIFY(pluginInterface->timeStamp() == retTimeStamp);
-
-    QString body;
-    pluginInterface->body(body);
-    QString origBody(TEST_MSG_BODY);
-    QVERIFY(origBody == body);
-
-    ConvergedMessageAddressList recipientList;
-    pluginInterface->toRecipientList(recipientList);
-
-    QString recipient(TEST_MSG_FROM1);
-
-    QVERIFY(recipientList.count() == 1);
-    QVERIFY(recipient == recipientList[0]->address()
-            && recipientList[0]->alias().isEmpty());
-
-    QString fromaddress;
-    pluginInterface->fromAddress(fromaddress);
-    QVERIFY(fromaddress.isEmpty());
-    TRAPD(err, iSmsClientMtm->SwitchCurrentEntryL(KMsvDraftEntryId));
-}
-
-void TestUniDataModelSMSPlugin::testDraftsMessageNoRecipient()
-{
-    createDraftsSMSNoRecipient();
-    // Get the SMS data modelplugin
-    pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::Sms);
-
-    // Get the data for the first message in DRAFTS    
-    pluginInterface->setMessageId(messageId);
-    int size = pluginInterface->messageSize();
-
-    QString body;
-    pluginInterface->body(body);
-    QString origBody(TEST_MSG_BODY);
-    QVERIFY(origBody == body);
-
-    ConvergedMessageAddressList recipientList;
-    pluginInterface->toRecipientList(recipientList);
-
-    QVERIFY(recipientList.count() == 0);
-
-    QString fromaddress;
-    pluginInterface->fromAddress(fromaddress);
-    QVERIFY(fromaddress.isEmpty());
-    TRAPD(err, iSmsClientMtm->SwitchCurrentEntryL(KMsvDraftEntryId));
-}
-
-void TestUniDataModelSMSPlugin::testGetPluginWithoutLoading()
-{
-    pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::Sms);
-    QVERIFY(pluginInterface == NULL);
-
-    // Try to geta plugin for a differnt message type
-    pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::Mms);
-    QVERIFY(pluginInterface == NULL);
-}
-
-void TestUniDataModelSMSPlugin::testUnusedAPIs()
-{
-	  pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::Sms);
-
-    QVERIFY(pluginInterface->hasAttachment() == false);
-
-    UniMessageInfoList attachmentlist = pluginInterface->attachmentList();
-    QVERIFY(attachmentlist.isEmpty());
-
-    QVERIFY(pluginInterface->objectCount() == 0);
-
-    UniMessageInfoList objectlist = pluginInterface->objectList();
-    QVERIFY(objectlist.isEmpty());
-
-    QVERIFY(pluginInterface->slideCount() == 0);
-
-    UniMessageInfoList slidelist = pluginInterface->slideContent(0);
-    QVERIFY(slidelist.isEmpty());
-    
-    ConvergedMessageAddressList recipientList;
-    
-	pluginInterface->ccRecipientList(recipientList);
-	QVERIFY(recipientList.count() == 0);
-		
-	pluginInterface->bccRecipientList(recipientList);
-	QVERIFY(recipientList.count() == 0);
-		
-	 MsgPriority priority = pluginInterface->messagePriority();
-    // Normal priority
-    qDebug() << "prority" << priority;
-    QVERIFY(priority == 1);
-	int count = pluginInterface->attachmentCount();
-    QVERIFY(count == 0);
-		
-}
-
-void TestObserver::HandleSessionEventL(TMsvSessionEvent /*aEvent*/,
-                                       TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
-{
-}
--- a/messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/tsrc/testunidatamodelsmsplugin/testunidatamodelsmsplugin.h	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- * 
- * Description:
- */
-
-#ifndef TEST_UNI_DATA_MODEL_SMS_PLUGIN_H
-#define TEST_UNI_DATA_MODEL_SMS_PLUGIN_H
-
-#ifdef BUILD_TEST_DLL
-#define TEST_EXPORT Q_DECL_EXPORT
-#else
-#define TEST_EXPORT Q_DECL_IMPORT
-#endif
-
-#include <QObject>
-#include <txtetext.h>
-#include <txtrich.h>
-#include <mtclreg.h>
-#include <mtclbase.h>
-#include <msvids.h>
-#include <smsclnt.h>
-#include <smuthdr.h>
-#include <QDateTime>
-
-class UniDataModelPluginInterface;
-class UniDataModelLoader;
-class TestObserver;
-
-class ConvergedMessage;
-
-class TEST_EXPORT TestUniDataModelSMSPlugin : public QObject
-{
-Q_OBJECT
-
-private slots:
-    //called by frame work.
-    //  void initTestCase();//called before the first testfunction is executed.
-    //  void cleanupTestCase();//called after the last testfunction was executed.
-    void init();//called before each testfunction is executed.
-    void cleanup();//called after every testfunction.
-
-    //test cases.
-    
-    void testInboxMessage();
-    void testOutboxMessage();
-    void testSentMessage();
-    void testDraftsMessage();
-    void testDraftsMessageNoRecipient();
-    void testUnusedAPIs();
-
-private:
-    void createInboxSMS();
-    void createOutboxSMS();
-    void createSentSMS();
-    void createDraftsSMS();
-    void createDraftsSMSNoRecipient();
-    
-
-private:
-    UniDataModelPluginInterface* pluginInterface;
-    TestObserver* iObserver;
-    CMsvSession* iMSession;
-    CClientMtmRegistry* iMtmReg;
-    CSmsClientMtm* iSmsClientMtm;
-    TMsvId messageId;
-    UniDataModelLoader* pluginLoader;
-    QDateTime retTimeStamp ;
-};
-
-class TestObserver : public MMsvSessionObserver
-{
-public:
-    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2,
-                             TAny* aArg3);
-};
-
-#endif //TEST_UNI_DATA_MODEL_SMS_PLUGIN_H
--- a/messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/tsrc/testunidatamodelsmsplugin/testunidatamodelsmsplugin.ini	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-//this file is used to provide predefined set of input data.
-
-//eg.
-const char TEST_MSG_BODY[] 			= "This string is message body test string";
-const char TEST_MSG_RECIEPIENT[] 		= "Javaid Nabi<9741596546>";
-const char TEST_MSG_FROM1[] 		= "9741596546";
-const char TEST_MSG_ALIAS1[] 		= "Javaid Nabi";
-const char TEST_MSG_FROM2[] 		= "9797979797";
-const char TEST_MSG_ALIAS2[] 		= "Rajesh Batchu";
-const char TEST_MSG_SUBJECT[] 		= "Message Subject";
--- a/messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/tsrc/testunidatamodelsmsplugin/testunidatamodelsmsplugin.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/tsrc/testunidatamodelsmsplugin/testunidatamodelsmsplugin.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -17,34 +17,38 @@
 QT += testlib
 QT -= gui
 
-TEMPLATE = lib
+TEMPLATE = app
 TARGET = test-unidatamodel-sms-plugin
 
 
-INCLUDEPATH += .
+CONFIG += hb
+CONFIG += symbian_test
+
+INCLUDEPATH += inc
 INCLUDEPATH += ../../../../../../inc
+INCLUDEPATH += ../../../../../../../inc
 INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
 
 DEFINES += BUILD_TEST_DLL
 
 SOURCES += \
-	testunidatamodelsmsplugin.cpp
+	src/testunidatamodelsmsplugin.cpp
 
 				 
 
 # Input
 HEADERS += \
-	testunidatamodelsmsplugin.h
+	inc/testunidatamodelsmsplugin.h
 	
 	   	   			 
    
 SYMBIAN_PLATFORMS = WINSCW ARMV5
     symbian {
-    TARGET.CAPABILITY = CAP_GENERAL_DLL
+    TARGET.CAPABILITY = All -TCB -DRM
     TARGET.EPOCSTACKSIZE = 0x8000
     TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000
-    TARGET.EPOCALLOWDLLDATA = 1
-		}
+    VENDORID =  VID_DEFAULT
+    }
 	
 defBlock = \      
 	  "$${LITERAL_HASH}if defined(EABI)" \
@@ -55,6 +59,26 @@
 	
 MMP_RULES += defBlock
 		
+
+packageheader = "$${LITERAL_HASH}{\"QTestLibCVsClientServerTest\"},(0xEa1ebe60),1,0,0,TYPE=SA"
+
+vendorinfo = \
+			"; Localised Vendor name" \
+			"%{\"Nokia\"}" \
+			"; Unique Vendor name" \
+			":\"Nokia\"" 
+			
+dependencyinfo = \
+				"; Default HW/platform dependencies" \
+				"[0x101F7961],0,0,0,{\"S60ProductID\"}" \
+				"[0x2001E61C],4,6,3,{"Qt"}
+				
+default_deployment.pkg_prerules =	packageheader \
+									vendorinfo \
+									dependencyinfo 
+
+
+
  LIBS += -leuser \
 	-lconvergedmessageutils\
 	-lxqutils \
@@ -65,5 +89,4 @@
 	-lmsgs \
 	-lunidatamodelloader\
 	-lQtCore
-	
-
+	
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/tsrc/tsrc.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,25 @@
+#
+# 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:
+#
+
+TEMPLATE = subdirs
+
+CONFIG += symbian_test
+
+#Sub .pro files
+SUBDIRS += testunidatamodelsmsplugin
+
+# Platforms
+SYMBIAN_PLATFORMS = DEFAULT
\ No newline at end of file
--- a/messagingapp/msgutils/unieditorutils/bwins/editorgenutilsu.def	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/unieditorutils/bwins/editorgenutilsu.def	Fri Sep 17 08:28:39 2010 +0300
@@ -18,14 +18,15 @@
 	?NewLC@CMuiuOperationWait@@SAPAV1@H@Z @ 17 NONAME ; class CMuiuOperationWait * CMuiuOperationWait::NewLC(int)
 	?RunL@CMuiuOperationWait@@MAEXXZ @ 18 NONAME ; void CMuiuOperationWait::RunL(void)
 	?getFileInfoL@UniEditorGenUtils@@QAEXVQString@@AAHAAV2@AAW4TMsgMediaType@@@Z @ 19 NONAME ; void UniEditorGenUtils::getFileInfoL(class QString, int &, class QString &, enum TMsgMediaType &)
-	??1UniEditorGenUtils@@UAE@XZ @ 20 NONAME ; UniEditorGenUtils::~UniEditorGenUtils(void)
-	?MaxMmsRecipientsL@UniEditorGenUtils@@QAEHXZ @ 21 NONAME ; int UniEditorGenUtils::MaxMmsRecipientsL(void)
-	??1CMuiuOperationWait@@UAE@XZ @ 22 NONAME ; CMuiuOperationWait::~CMuiuOperationWait(void)
-	?VerifyEmailAddressesL@UniEditorGenUtils@@QAEHV?$QList@PAVConvergedMessageAddress@@@@@Z @ 23 NONAME ; int UniEditorGenUtils::VerifyEmailAddressesL(class QList<class ConvergedMessageAddress *>)
-	?WriteEmailOverSmsSettingsL@UniEditorGenUtils@@QAEHABVTDes16@@0ABH@Z @ 24 NONAME ; int UniEditorGenUtils::WriteEmailOverSmsSettingsL(class TDes16 const &, class TDes16 const &, int const &)
-	?ReadEmailOverSmsSettingsL@UniEditorGenUtils@@QAEHAAVTDes16@@0AAH@Z @ 25 NONAME ; int UniEditorGenUtils::ReadEmailOverSmsSettingsL(class TDes16 &, class TDes16 &, int &)
-	?absoluteMaxSmsPartsL@UniEditorGenUtils@@AAEHXZ @ 26 NONAME ; int UniEditorGenUtils::absoluteMaxSmsPartsL(void)
-	?UTF8Size@UniEditorGenUtils@@QAEHVQString@@@Z @ 27 NONAME ; int UniEditorGenUtils::UTF8Size(class QString)
-	?IsPhoneOfflineL@UniEditorGenUtils@@QAEHXZ @ 28 NONAME ; int UniEditorGenUtils::IsPhoneOfflineL(void)
-	?AcceptEmailAddressesL@UniEditorGenUtils@@QAEHXZ @ 29 NONAME ; int UniEditorGenUtils::AcceptEmailAddressesL(void)
+	?MatchPhoneNumberL@UniEditorGenUtils@@QAEHAAVTDesC16@@0@Z @ 20 NONAME ; int UniEditorGenUtils::MatchPhoneNumberL(class TDesC16 &, class TDesC16 &)
+	??1UniEditorGenUtils@@UAE@XZ @ 21 NONAME ; UniEditorGenUtils::~UniEditorGenUtils(void)
+	?MaxMmsRecipientsL@UniEditorGenUtils@@QAEHXZ @ 22 NONAME ; int UniEditorGenUtils::MaxMmsRecipientsL(void)
+	??1CMuiuOperationWait@@UAE@XZ @ 23 NONAME ; CMuiuOperationWait::~CMuiuOperationWait(void)
+	?VerifyEmailAddressesL@UniEditorGenUtils@@QAEHV?$QList@PAVConvergedMessageAddress@@@@@Z @ 24 NONAME ; int UniEditorGenUtils::VerifyEmailAddressesL(class QList<class ConvergedMessageAddress *>)
+	?WriteEmailOverSmsSettingsL@UniEditorGenUtils@@QAEHABVTDes16@@0ABH@Z @ 25 NONAME ; int UniEditorGenUtils::WriteEmailOverSmsSettingsL(class TDes16 const &, class TDes16 const &, int const &)
+	?ReadEmailOverSmsSettingsL@UniEditorGenUtils@@QAEHAAVTDes16@@0AAH@Z @ 26 NONAME ; int UniEditorGenUtils::ReadEmailOverSmsSettingsL(class TDes16 &, class TDes16 &, int &)
+	?absoluteMaxSmsPartsL@UniEditorGenUtils@@AAEHXZ @ 27 NONAME ; int UniEditorGenUtils::absoluteMaxSmsPartsL(void)
+	?UTF8Size@UniEditorGenUtils@@QAEHVQString@@@Z @ 28 NONAME ; int UniEditorGenUtils::UTF8Size(class QString)
+	?IsPhoneOfflineL@UniEditorGenUtils@@QAEHXZ @ 29 NONAME ; int UniEditorGenUtils::IsPhoneOfflineL(void)
+	?AcceptEmailAddressesL@UniEditorGenUtils@@QAEHXZ @ 30 NONAME ; int UniEditorGenUtils::AcceptEmailAddressesL(void)
 
--- a/messagingapp/msgutils/unieditorutils/eabi/editorgenutilsu.def	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/unieditorutils/eabi/editorgenutilsu.def	Fri Sep 17 08:28:39 2010 +0300
@@ -6,34 +6,35 @@
 	_ZN17UniEditorGenUtils14MaxSmsMsgSizeLEb @ 5 NONAME
 	_ZN17UniEditorGenUtils15ConvertDigitsToER6TDes1610TDigitType @ 6 NONAME
 	_ZN17UniEditorGenUtils15IsPhoneOfflineLEv @ 7 NONAME
-	_ZN17UniEditorGenUtils17MaxMmsRecipientsLEv @ 8 NONAME
-	_ZN17UniEditorGenUtils17MaxSmsRecipientsLEv @ 9 NONAME
-	_ZN17UniEditorGenUtils17ReplaceCharactersER6TDes16RK7TDesC165TChar @ 10 NONAME
-	_ZN17UniEditorGenUtils19IsValidEmailAddressERK7TDesC16 @ 11 NONAME
-	_ZN17UniEditorGenUtils20absoluteMaxSmsPartsLEv @ 12 NONAME
-	_ZN17UniEditorGenUtils21AcceptEmailAddressesLEv @ 13 NONAME
-	_ZN17UniEditorGenUtils21VerifyEmailAddressesLE5QListIP23ConvergedMessageAddressE @ 14 NONAME
-	_ZN17UniEditorGenUtils21getSmsCharacterLimitsERiS0_b @ 15 NONAME
-	_ZN17UniEditorGenUtils25ReadEmailOverSmsSettingsLER6TDes16S1_Ri @ 16 NONAME
-	_ZN17UniEditorGenUtils25absoluteMaxSmsCharactersLEv @ 17 NONAME
-	_ZN17UniEditorGenUtils26WriteEmailOverSmsSettingsLERK6TDes16S2_RKi @ 18 NONAME
-	_ZN17UniEditorGenUtils8UTF8SizeE7QString @ 19 NONAME
-	_ZN17UniEditorGenUtilsC1Ev @ 20 NONAME
-	_ZN17UniEditorGenUtilsC2Ev @ 21 NONAME
-	_ZN17UniEditorGenUtilsD0Ev @ 22 NONAME
-	_ZN17UniEditorGenUtilsD1Ev @ 23 NONAME
-	_ZN17UniEditorGenUtilsD2Ev @ 24 NONAME
-	_ZN18CMuiuOperationWait4RunLEv @ 25 NONAME
-	_ZN18CMuiuOperationWait5NewLCEi @ 26 NONAME
-	_ZN18CMuiuOperationWait5StartEv @ 27 NONAME
-	_ZN18CMuiuOperationWait8DoCancelEv @ 28 NONAME
-	_ZN18CMuiuOperationWaitC1Ei @ 29 NONAME
-	_ZN18CMuiuOperationWaitC2Ei @ 30 NONAME
-	_ZN18CMuiuOperationWaitD0Ev @ 31 NONAME
-	_ZN18CMuiuOperationWaitD1Ev @ 32 NONAME
-	_ZN18CMuiuOperationWaitD2Ev @ 33 NONAME
-	_ZTI17UniEditorGenUtils @ 34 NONAME
-	_ZTI18CMuiuOperationWait @ 35 NONAME
-	_ZTV17UniEditorGenUtils @ 36 NONAME
-	_ZTV18CMuiuOperationWait @ 37 NONAME
+	_ZN17UniEditorGenUtils17MatchPhoneNumberLER7TDesC16S1_ @ 8 NONAME
+	_ZN17UniEditorGenUtils17MaxMmsRecipientsLEv @ 9 NONAME
+	_ZN17UniEditorGenUtils17MaxSmsRecipientsLEv @ 10 NONAME
+	_ZN17UniEditorGenUtils17ReplaceCharactersER6TDes16RK7TDesC165TChar @ 11 NONAME
+	_ZN17UniEditorGenUtils19IsValidEmailAddressERK7TDesC16 @ 12 NONAME
+	_ZN17UniEditorGenUtils20absoluteMaxSmsPartsLEv @ 13 NONAME
+	_ZN17UniEditorGenUtils21AcceptEmailAddressesLEv @ 14 NONAME
+	_ZN17UniEditorGenUtils21VerifyEmailAddressesLE5QListIP23ConvergedMessageAddressE @ 15 NONAME
+	_ZN17UniEditorGenUtils21getSmsCharacterLimitsERiS0_b @ 16 NONAME
+	_ZN17UniEditorGenUtils25ReadEmailOverSmsSettingsLER6TDes16S1_Ri @ 17 NONAME
+	_ZN17UniEditorGenUtils25absoluteMaxSmsCharactersLEv @ 18 NONAME
+	_ZN17UniEditorGenUtils26WriteEmailOverSmsSettingsLERK6TDes16S2_RKi @ 19 NONAME
+	_ZN17UniEditorGenUtils8UTF8SizeE7QString @ 20 NONAME
+	_ZN17UniEditorGenUtilsC1Ev @ 21 NONAME
+	_ZN17UniEditorGenUtilsC2Ev @ 22 NONAME
+	_ZN17UniEditorGenUtilsD0Ev @ 23 NONAME
+	_ZN17UniEditorGenUtilsD1Ev @ 24 NONAME
+	_ZN17UniEditorGenUtilsD2Ev @ 25 NONAME
+	_ZN18CMuiuOperationWait4RunLEv @ 26 NONAME
+	_ZN18CMuiuOperationWait5NewLCEi @ 27 NONAME
+	_ZN18CMuiuOperationWait5StartEv @ 28 NONAME
+	_ZN18CMuiuOperationWait8DoCancelEv @ 29 NONAME
+	_ZN18CMuiuOperationWaitC1Ei @ 30 NONAME
+	_ZN18CMuiuOperationWaitC2Ei @ 31 NONAME
+	_ZN18CMuiuOperationWaitD0Ev @ 32 NONAME
+	_ZN18CMuiuOperationWaitD1Ev @ 33 NONAME
+	_ZN18CMuiuOperationWaitD2Ev @ 34 NONAME
+	_ZTI17UniEditorGenUtils @ 35 NONAME
+	_ZTI18CMuiuOperationWait @ 36 NONAME
+	_ZTV17UniEditorGenUtils @ 37 NONAME
+	_ZTV18CMuiuOperationWait @ 38 NONAME
 
--- a/messagingapp/msgutils/unieditorutils/editorgenutils/inc/UniEditorGenUtils.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/unieditorutils/editorgenutils/inc/UniEditorGenUtils.h	Fri Sep 17 08:28:39 2010 +0300
@@ -187,6 +187,14 @@
          */
         TBool IsValidEmailAddress( const TDesC& aAddress );
         
+        /**
+         * Verifies if the given two numbers are same
+         * @param aFirstNumber, phone number to be matched
+         * @param aSecondNumber, phone number to be matched
+         * @return TBool, true if the numbers match
+         */
+        TBool MatchPhoneNumberL(TDesC& aFirstNumber, TDesC& aSecondNumber);
+        
       private:
           /**
            * get sms character limits from feature manager
@@ -236,6 +244,11 @@
            * MMS size limit
            */
           int mMaxMmsSize;
+          
+          /**
+           * The amount of digits to be used in contact matching
+           */
+          int mMatchDigitCount;
     };
 
 
--- a/messagingapp/msgutils/unieditorutils/editorgenutils/src/UniEditorGenUtils.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/unieditorutils/editorgenutils/src/UniEditorGenUtils.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -22,6 +22,8 @@
 #include <MmsEngineDomainCRKeys.h>
 #include <MsgMediaResolver.h>
 #include <DRMHelper.h>
+#include <ccsdefs.h> // for KDefaultGsmNumberMatchLength
+#include <telconfigcrkeys.h> // for KCRUidTelephonyConfiguration
 
 #include "MessagingVariant.hrh"
 #include "MessagingInternalCRKeys.h"  // Keys
@@ -47,7 +49,8 @@
 UniEditorGenUtils::UniEditorGenUtils() :
 mAbsMaxConcatenatedSms(-1),
 mAbsMaxSmsCharacters(-1),
-mMaxMmsSize(-1)
+mMaxMmsSize(-1),
+mMatchDigitCount(-1)
 {
 
 }
@@ -602,4 +605,41 @@
     return ( aDomain[length-1] != '.' );
     }
 
+// ----------------------------------------------------
+// UniEditorGenUtils::MatchPhoneNumber
+// @see header
+// ----------------------------------------------------
+TBool UniEditorGenUtils::MatchPhoneNumberL(
+        TDesC& aFirstNumber, TDesC& aSecondNumber)
+    {
+    // if matching digit count is already read from CR, then don't do that again
+    if(mMatchDigitCount == -1)
+        {
+        mMatchDigitCount = KDefaultGsmNumberMatchLength;
+        // Read the amount of digits to be used in contact matching
+        // The key is owned by PhoneApp
+        CRepository* repository = CRepository::NewL(KCRUidTelConfiguration);
+        CleanupStack::PushL(repository);
+        if (repository->Get(KTelMatchDigits, mMatchDigitCount) == KErrNone)
+            {
+            // Min is 7
+            mMatchDigitCount = Max(mMatchDigitCount, KDefaultGsmNumberMatchLength);
+            }
+        CleanupStack::PopAndDestroy(); // repository
+        }
+    
+    // start matching
+    if( (aFirstNumber.Length() == 0) || (aSecondNumber.Length() == 0) )
+        {
+        return EFalse;
+        }
+    
+    if (aFirstNumber.Right(mMatchDigitCount).CompareF(
+            aSecondNumber.Right(mMatchDigitCount)) == 0)
+        {
+        return ETrue;
+        }
+    return EFalse;
+    }
+
 // End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorpluginloader/tsrc/testunieditorpluginloader/data/TestUnieditorPluginLoaderSample.txt	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,1 @@
+Message Text
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorpluginloader/tsrc/testunieditorpluginloader/inc/testunieditorpluginloader.h	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ * 
+ * Description: Main test class declaration for UnieditorPluginLoader
+ */
+
+#ifndef TEST_UNIEDITORPLUGINLOADER_H
+#define TEST_UNIEDITORPLUGINLOADER_H
+
+#ifdef BUILD_TEST_DLL
+#define TEST_EXPORT Q_DECL_EXPORT
+#else
+#define TEST_EXPORT Q_DECL_IMPORT
+#endif
+
+#include <QObject>
+#include <e32const.h>
+#include "convergedmessage.h"
+
+class UniEditorPluginLoader;
+
+//Main Tets Class Declaration
+class TEST_EXPORT TestUnieditorPluginLoader: public QObject
+    {
+    Q_OBJECT
+
+private slots:
+    
+    /**
+	 * Initialises the whole Test
+	 **/  
+    void initTestCase();//called before the first testfunction is executed.
+    
+    /**
+	 * Initialises each Test Case
+	 **/  
+    void init();//called before each testfunction is executed.
+        
+    /**
+	 * Creates a MMS messsage
+	 **/  
+	void createMMS();
+	
+	/**
+	 * Tests the MMS message
+	 **/  
+	void testMMS();
+	
+	/**
+	 * Creates a SMS messsage
+	 **/  
+	void createSMS();
+	
+	/**
+	 * Tests the SMS message
+	 **/  
+	void testSMS();
+	
+	/**
+	 * Cleans up each Test Case
+	 **/ 
+	void cleanup();//called after every testfunction.
+	
+	/**
+	 * Cleans up the whole Test Case
+	 **/  
+    void cleanupTestCase();//called after the last testfunction was executed.
+
+private: //Data
+    
+    /**
+	 * msgPlugin - SMS/MMS Message Plug-in Loader
+	 **/  	
+    UniEditorPluginLoader* unieditorPluginLoader;
+	
+	/**
+	 * mmsMsgId - The SMS/MMS message Id
+	 **/  	
+	long int msgId;
+	
+	/**
+	 * messageType - type of Message - SMS or MMS
+	 **/  	
+	ConvergedMessage::MessageType messageType;
+	};
+#endif //TEST_UNIEDITORPLUGINLOADER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorpluginloader/tsrc/testunieditorpluginloader/inc/testunieditorpluginloader.ini	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,23 @@
+/*
+ * 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: Input data Set File for TestUnieditorPluginLoader test cases
+ */
+
+const char TEST_MSG_BODY[]        = "TestTextE_1_2";
+const char TEST_MSG_SUBJECT[]     = "Message Subject";
+const char TEST_SENDER[]			= "+919860479112";
+const char TEST_ATTACHMENT[]		= "c:\\data\\TestUnieditorPluginLoaderSample.txt";
+const char TEST_CC[]			= "DummyCCAddress";
+const char TEST_BCC[]			= "DummyBCCAddress";
+const char TEST_ALIAS[]			= "DummySenderAlias";
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorpluginloader/tsrc/testunieditorpluginloader/src/testunieditorpluginloader.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,300 @@
+/*
+ * 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: Main test class definition for UnieditorPluginLoader
+ */
+
+#include <QtTest/QtTest>
+#include "debugtraces.h"
+#include "unieditorpluginloader.h"
+#include "unieditorplugininterface.h"
+#include "testunieditorpluginloader.h"
+#include "testunieditorpluginloader.ini"
+
+//---------------------------------------------------------------
+// TestUnieditorPluginLoader::initTestCase
+//---------------------------------------------------------------
+void TestUnieditorPluginLoader::initTestCase()
+{
+	//register user defined object to meta system.
+	qRegisterMetaType<long int> ("long int");
+		
+	//Instantiate UnieditorPluginLoader and verify if it is correctly Instantited. 
+	unieditorPluginLoader = new UniEditorPluginLoader;
+	QVERIFY(unieditorPluginLoader != NULL);
+}
+
+//---------------------------------------------------------------
+// TestUnieditorPluginLoader::init
+//---------------------------------------------------------------
+void TestUnieditorPluginLoader::init()
+{
+}
+
+//---------------------------------------------------------------
+// TestUnieditorPluginLoader::createMMS
+//---------------------------------------------------------------
+void TestUnieditorPluginLoader::createMMS()
+{
+    //Create a Converged Message instance. 
+    QString subject  = TEST_MSG_SUBJECT;
+    
+    qint64 timeStamp = QDateTime::currentDateTime().toTime_t();
+	
+	QString sender(TEST_SENDER);
+	ConvergedMessageAddress address(sender);
+	ConvergedMessageAttachmentList attachmentList;    
+
+	//Add a text attachment to attachment list. 
+	QString attachmentPath = TEST_ATTACHMENT;
+	ConvergedMessageAttachment* attachment = 
+		new ConvergedMessageAttachment(attachmentPath, ConvergedMessageAttachment::EAttachment);
+	
+	attachmentList.append(attachment);
+	
+	//Instantiate a Converged Message object and set service a MMS
+	ConvergedMessage msg;
+	
+	messageType = ConvergedMessage::Mms;
+	msg.setMessageType(messageType);
+	
+	//Set Subject
+	msg.setSubject(subject);
+	
+	//Set Timestamp and verify
+	msg.setTimeStamp(timeStamp);
+	QVERIFY(timeStamp == msg.timeStamp());
+	
+	//Set Alias to an address
+	address.setAlias(QString (TEST_ALIAS));
+	
+	//Set recipient. 
+	msg.addToRecipient(address);
+	
+	//Add attachments' list
+	msg.addAttachments(attachmentList);
+	msg.setPriority(ConvergedMessage::Normal);
+	
+	//Adding CC Address
+	QString ccAddress(TEST_CC);
+	ConvergedMessageAddress ccAdd(ccAddress);
+	msg.addCcRecipient(ccAdd);
+	
+	//Adding BCC Address
+	QString bccAddress(TEST_BCC);
+	ConvergedMessageAddress bccAdd(bccAddress);
+	msg.addBccRecipient(bccAdd);
+	
+	//Adding From Address
+	QString recipientAddress(TEST_SENDER);
+	ConvergedMessageAddress recipientAdd(recipientAddress);
+	msg.addFromRecipient(recipientAdd);
+	
+	//Set Body Text and verify
+	msg.setBodyText(QString(TEST_MSG_BODY));
+	QVERIFY(msg.bodyText().compare(QString(TEST_MSG_BODY)) == 0);
+	
+	//Removing Body Text as MMS messages do not contain Body Text
+	msg.setBodyText(QString(NULL));
+	
+	//Set Property and Verify
+	msg.setProperty(ConvergedMessage::Attachment);
+	msg.setProperty(ConvergedMessage::Unread);
+	QVERIFY(msg.properties() == ConvergedMessage::Attachment | ConvergedMessage::Unread);
+	QVERIFY(msg.hasAttachment() == true);
+	QVERIFY(msg.isUnread() == true);
+			
+	//Set Location
+	msg.setLocation(ConvergedMessage::Draft);
+	
+	//Set Sending State and Verify
+	msg.setSendingState(ConvergedMessage::Waiting);
+	QVERIFY(msg.sendingState() == ConvergedMessage::Waiting);
+	
+	//Set Direction
+	msg.setDirection(ConvergedMessage::Outgoing);
+	
+	//Set Priority
+	msg.setPriority(ConvergedMessage::Normal);
+	
+	//Set Sub Type and verify
+	msg.setMessageSubType(ConvergedMessage::NokiaService);
+	QVERIFY(msg.messageSubType() == ConvergedMessage::NokiaService);
+	
+	UniEditorPluginInterface* pluginInterface = unieditorPluginLoader->getUniEditorPlugin(messageType);
+	
+	//Get a valid MMS message ID and verify that it is valid.
+	msgId = pluginInterface->convertTo(&msg);
+	QVERIFY(msgId != -1);
+	QDEBUG_WRITE("MMS Successfully Created in Drafts Folder");
+}
+
+//---------------------------------------------------------------
+// TestUnieditorPluginLoader::testMMS
+//---------------------------------------------------------------
+void TestUnieditorPluginLoader::testMMS()
+{
+	//check if draft-folder signal was received...this means message was created in draft
+	
+	UniEditorPluginInterface* pluginInterface = unieditorPluginLoader->getUniEditorPlugin(messageType);
+	
+	//Validate the MMS message with all the values set before. 
+	ConvergedMessage draftMsg = *(pluginInterface->convertFrom(msgId));
+	QVERIFY(draftMsg.subject().compare(QString(TEST_MSG_SUBJECT)) == 0);
+	QVERIFY(draftMsg.messageType() == ConvergedMessage::Mms);
+	QVERIFY(QString(TEST_SENDER).contains(draftMsg.toAddressList()[0]->address(), Qt::CaseInsensitive) == true);
+	QVERIFY(QString(TEST_ALIAS).contains(draftMsg.toAddressList()[0]->alias(), Qt::CaseInsensitive) == true);
+	QVERIFY(QString(TEST_CC).contains(draftMsg.ccAddressList()[0]->address(), Qt::CaseInsensitive) == true);
+	QVERIFY(QString(TEST_BCC).contains(draftMsg.bccAddressList()[0]->address(), Qt::CaseInsensitive) == true);
+	QVERIFY(QString(TEST_SENDER).contains(draftMsg.fromAddress()->address(), Qt::CaseInsensitive) == true);
+	QVERIFY(draftMsg.attachments().count() == 1);
+	QVERIFY(draftMsg.attachments()[0]->attachmentType() == ConvergedMessageAttachment::EAttachment);
+	QVERIFY(draftMsg.attachments()[0]->filePath().contains(QString(TEST_ATTACHMENT).mid(QString(TEST_ATTACHMENT).indexOf(QString("Sample.txt"), 0, Qt::CaseInsensitive)), Qt::CaseInsensitive) == true);
+	QVERIFY(draftMsg.location() == ConvergedMessage::Draft);
+	QVERIFY(draftMsg.priority() == ConvergedMessage::Normal);
+	QVERIFY(draftMsg.direction() == ConvergedMessage::Outgoing);
+	QDEBUG_WRITE("MMS Successfully Verified at Drafts Folder");
+}
+
+//---------------------------------------------------------------
+// TestUnieditorPluginLoader::createSMS
+//---------------------------------------------------------------
+void TestUnieditorPluginLoader::createSMS()
+{
+    //Create a Converged Message instance. 
+    QString subject  = TEST_MSG_SUBJECT;
+    
+    qint64 timeStamp = QDateTime::currentDateTime().toTime_t();
+	
+	QString sender(TEST_SENDER);
+	ConvergedMessageAddress address(sender);
+	
+	//Instantiate a Converged Message object and set service a SMS
+	ConvergedMessage msg;
+	
+	messageType = ConvergedMessage::Sms;
+	msg.setMessageType(messageType);
+	
+	//Set Subject
+	msg.setSubject(subject);
+	
+	//Set Body
+	msg.setBodyText(QString(TEST_MSG_BODY));
+	
+	//Set Timestamp and verify
+	msg.setTimeStamp(timeStamp);
+	QVERIFY(timeStamp == msg.timeStamp());
+	
+	//Set recipient. 
+	msg.addToRecipient(address);
+	
+	//Set priority.
+	msg.setPriority(ConvergedMessage::Normal);
+	
+	//Adding From Address
+	QString recipientAddress(TEST_SENDER);
+	ConvergedMessageAddress recipientAdd(recipientAddress);
+	msg.addFromRecipient(recipientAdd);
+	
+	//Set Property and Verify
+	msg.setProperty(ConvergedMessage::Unread);
+	QVERIFY(msg.properties() == ConvergedMessage::Unread);
+	QVERIFY(msg.isUnread() == true);
+			
+	//Set Location
+	msg.setLocation(ConvergedMessage::Draft);
+	
+	//Set Sending State and Verify
+	msg.setSendingState(ConvergedMessage::Waiting);
+	QVERIFY(msg.sendingState() == ConvergedMessage::Waiting);
+	
+	//Set Direction
+	msg.setDirection(ConvergedMessage::Outgoing);
+	
+	//Set Priority
+	msg.setPriority(ConvergedMessage::Normal);
+	
+	UniEditorPluginInterface* pluginInterface = unieditorPluginLoader->getUniEditorPlugin(messageType);
+	
+	//Get a valid SMS message ID and verify that it is valid.
+	msgId = pluginInterface->convertTo(&msg);
+	QVERIFY(msgId != -1);
+	QDEBUG_WRITE("SMS Successfully Created in Drafts Folder");
+}
+
+//---------------------------------------------------------------
+// TestUnieditorPluginLoader::testSMS
+//---------------------------------------------------------------
+void TestUnieditorPluginLoader::testSMS()
+{
+	//check if draft-folder signal was received...this means message was created in draft
+	
+	UniEditorPluginInterface* pluginInterface = unieditorPluginLoader->getUniEditorPlugin(messageType);
+	
+	//Validate the SMS message with all the values set before. 
+	ConvergedMessage draftMsg = *(pluginInterface->convertFrom(msgId));
+	QVERIFY(draftMsg.subject().compare(QString(TEST_MSG_SUBJECT)) == 0);
+	QVERIFY(draftMsg.bodyText().compare(QString(TEST_MSG_BODY)) == 0);
+	QVERIFY(draftMsg.messageType() == ConvergedMessage::Sms);
+	QVERIFY(QString(TEST_SENDER).contains(draftMsg.toAddressList()[0]->address(), Qt::CaseInsensitive) == true);
+	QVERIFY(QString(TEST_SENDER).contains(draftMsg.fromAddress()->address(), Qt::CaseInsensitive) == true);
+	QVERIFY(draftMsg.location() == ConvergedMessage::Draft);
+	QVERIFY(draftMsg.priority() == ConvergedMessage::Normal);
+	QVERIFY(draftMsg.direction() == ConvergedMessage::Outgoing);
+	QDEBUG_WRITE("SMS Successfully Verified at Drafts Folder");
+}
+
+//---------------------------------------------------------------
+// TestUnieditorPluginLoader::cleanup
+//---------------------------------------------------------------
+void TestUnieditorPluginLoader::cleanup()
+{
+}
+
+//---------------------------------------------------------------
+// TestUnieditorPluginLoader::cleanupTestCase
+//---------------------------------------------------------------
+void TestUnieditorPluginLoader::cleanupTestCase()
+{
+	//Cleanup
+	delete unieditorPluginLoader;//SMS/MMS Plugin Loader
+}
+
+//---------------------------------------------------------------
+// main
+// main entry point
+//---------------------------------------------------------------
+int main(int argc, char *argv[])
+    { 
+	int ret = -1;
+	QCoreApplication app(argc, argv);
+	QObject* tc = new TestUnieditorPluginLoader();
+	
+#ifdef __WINSCW__
+	char *new_argv[3]; 
+	QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log";	
+	QByteArray bytes = str.toAscii();	
+	char arg1[] = "-o";	
+	new_argv[0] = argv[0];	
+	new_argv[1] = arg1;	
+	new_argv[2] = bytes.data();	
+	ret = QTest::qExec(tc, 3, new_argv);
+#else
+	ret = QTest::qExec(tc, argc, argv);	
+#endif
+	
+	delete tc;
+	return ret;
+    }
+
+//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorpluginloader/tsrc/testunieditorpluginloader/testunieditorpluginloader.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,75 @@
+#
+# 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: Test Case Project Definition for UnieditorPluginLoader
+#
+
+QT += testlib
+QT -= gui
+
+CONFIG += hb
+CONFIG += symbian_test
+CONFIG += qtestlib
+
+TEMPLATE = app
+TARGET = testunieditorpluginloader
+
+INCLUDEPATH += ../../../../../../inc
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+DEFINES += BUILD_TEST_DLL
+
+# Input
+SOURCES += \
+  ./src/testunieditorpluginloader.cpp
+    
+HEADERS += \
+  ./inc/testunieditorpluginloader.h
+     
+SYMBIAN_PLATFORMS = WINSCW ARMV5
+    symbian {
+    TARGET.UID3 =  0xEc0880aa
+    TARGET.CAPABILITY = All -TCB -DRM
+    TARGET.EPOCSTACKSIZE = 0x8000
+    TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000
+    VENDORID =  VID_DEFAULT
+    BLD_INF_RULES.prj_exports += "data/TestUnieditorPluginLoaderSample.txt c:/data/TestUnieditorPluginLoaderSample.txt"
+    }
+	
+LIBS += -lunieditorpluginloader \
+		-lconvergedmessageutils
+
+packageheader = "$${LITERAL_HASH}{\"TestUnieditorPluginLoader\"},(0xEc0880aa),1,0,0,TYPE=SA"
+
+vendorinfo = \
+			"; Localised Vendor name" \
+			"%{\"Nokia\"}" \
+			"; Unique Vendor name" \
+			":\"Nokia\"" 
+			
+dependencyinfo = \
+				"; Default HW/platform dependencies" \
+				"[0x101F7961],0,0,0,{\"S60ProductID\"}" \
+				"[0x2001E61C],4,6,3,{"Qt"}
+				
+default_deployment.pkg_prerules =	packageheader \
+									vendorinfo \
+									dependencyinfo 
+
+#Copy the dependent files
+symbian: {
+	addFile1.sources = ./data/TestUnieditorPluginLoaderSample.txt
+	addFile1.path = C:/data/
+	DEPLOYMENT += addFile1
+	}
+	
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorpluginloader/tsrc/tsrc.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,21 @@
+#
+# 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: Project Definiton File for TestUnieditorPluginLoader
+#
+
+TEMPLATE = subdirs
+
+SUBDIRS += testunieditorpluginloader 
+
+CONFIG += ordered
\ No newline at end of file
--- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/inc/unieditormmsplugin_p.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/inc/unieditormmsplugin_p.h	Fri Sep 17 08:28:39 2010 +0300
@@ -24,6 +24,8 @@
 #include "convergedmessage.h"
 #include "convergedmessageid.h"
 #include "UniDataModel.h"
+#include "UniEditorGenUtils.h"
+
 // DATA TYPES
 
 // FORWARD DECLARATIONS
@@ -230,6 +232,39 @@
      * Populates converged message for default case
      */
     void convertFromDefaultHandlerL(ConvergedMessage* aMessage);
+    
+    /**
+     * Handles own-number identification/deletion for composing reply-all
+     * to a message
+     * @param sourcemsg, message on which own-number logic is applied
+     * @param targetmsg, message to which trimmed address list is committed
+     */
+    void removeOwnNumberForReplyAll(
+            ConvergedMessage* sourcemsg, 
+            ConvergedMessage* targetmsg);
+    
+    /**
+     * Helper method to make a copy of address list
+     * @param addrList, list of addresses to make a copy of
+     * @return ConvergedMessageAddressList, copy of list of addresses
+     */
+    ConvergedMessageAddressList copyAddrList(
+            ConvergedMessageAddressList addrList);
+
+    /**
+     * Helper method to resolve contacts in an addresslist
+     * @param addrList, list of addresses whose contacts need to be resolved
+     */
+    void resolveContacts(ConvergedMessageAddressList addrList);
+    
+    /**
+     * Helper method to check if a given address is self-address or not
+     * @param address, address to be verified
+     * @param selfAddrList, list of self-addresses
+     * @return bool, true if address is a self-address
+     */
+    bool isSelfAddress(QString address,QStringList selfAddrList);
+
 
 private:
     // Data
@@ -255,6 +290,8 @@
     CEikRichTextEditor* iEditor;
     // owned
     CMDXMLDocument* iDom;
+    // owned
+    UniEditorGenUtils* iGenUtils;
 };
 
 #endif   // __UNIEDITORMMSPLUGINPRIVATE_H
--- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/src/unieditormmsplugin_p.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/src/unieditormmsplugin_p.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -46,7 +46,6 @@
 #include "msgcontacthandler.h"
 #include <xqconversions.h>
 #include "debugtraces.h"
-#include "UniEditorGenUtils.h"
 
 // Possible values for mms validity period in seconds
 const TInt32 KUniMmsValidityPeriod1h = 3600;
@@ -103,6 +102,7 @@
     {
         delete iSession;
     }
+    delete iGenUtils;
 }
 
 // -----------------------------------------------------------------------------
@@ -113,6 +113,7 @@
 CUniEditorMmsPluginPrivate::CUniEditorMmsPluginPrivate( )
 {
     TRAP_IGNORE(iSession = CMsvSession::OpenSyncL(*this));
+    iGenUtils = new UniEditorGenUtils();
 }
 
 // -----------------------------------------------------------------------------
@@ -664,9 +665,7 @@
             // Internal data structures always holds the address data in western format.
             // UI is responsible of doing language specific conversions.    
             //MuiuTextUtils::ConvertDigitsTo( addressPtr, EDigitTypeWestern );
-            UniEditorGenUtils* genUtils = new UniEditorGenUtils();
-            genUtils->ConvertDigitsTo( addressPtr, EDigitTypeWestern );
-            delete genUtils;
+            iGenUtils->ConvertDigitsTo( addressPtr, EDigitTypeWestern );
         }
 
         if ( ( aDetails.Length() != 0 ) &&   // Not a first address
@@ -1032,10 +1031,11 @@
             {
             QString alias;
             int count;
-            int localId =
-                    MsgContactHandler::resolveContactDisplayName(
-                            addr->address(), alias, count);
-            addr->setAlias(alias);
+            if(-1 != MsgContactHandler::resolveContactDisplayName(
+                            addr->address(), alias, count))
+                {
+                addr->setAlias(alias);
+                }
             }
         }
     }
@@ -1048,67 +1048,16 @@
 void CUniEditorMmsPluginPrivate::convertFromReplyAllHandlerL(
         ConvergedMessage* aMessage)
     {
+    ConvergedMessage* tempmsg = new ConvergedMessage();
     // populate all recipients (and sender for received mms)
     TMsvEntry entry = MmsMtmL()->Entry().Entry();
     if( entry.Parent() == KMsvGlobalInBoxIndexEntryIdValue )
         {
-        populateSenderL(*aMessage);
-        }
-    populateRecipientsL(*aMessage);
-    
-    // resolve to-field contacts
-    ConvergedMessageAddressList addrList = aMessage->toAddressList();
-    int addrCount = addrList.count();
-    for(int i=0; i<addrCount; i++)
-        {
-        ConvergedMessageAddress* addr = addrList.at(i);
-        // resolve contact if alias is empty
-        if(addr->alias().isEmpty())
-            {
-            QString alias;
-            int count;
-            int localId =
-                    MsgContactHandler::resolveContactDisplayName(
-                            addr->address(), alias, count);
-            addr->setAlias(alias);
-            }
+        populateSenderL(*tempmsg);
         }
-
-    // resolve cc-field contacts
-    addrList = aMessage->ccAddressList();
-    addrCount = addrList.count();
-    for(int i=0; i<addrCount; i++)
-        {
-        ConvergedMessageAddress* addr = addrList.at(i);
-        // resolve contact if alias is empty
-        if(addr->alias().isEmpty())
-            {
-            QString alias;
-            int count;
-            int localId =
-                    MsgContactHandler::resolveContactDisplayName(
-                            addr->address(), alias, count);
-            addr->setAlias(alias);
-            }
-        }
-
-    // resolve bcc-field contacts
-    addrList = aMessage->bccAddressList();
-    addrCount = addrList.count();
-    for(int i=0; i<addrCount; i++)
-        {
-        ConvergedMessageAddress* addr = addrList.at(i);
-        // resolve contact if alias is empty
-        if(addr->alias().isEmpty())
-            {
-            QString alias;
-            int count;
-            int localId =
-                    MsgContactHandler::resolveContactDisplayName(
-                            addr->address(), alias, count);
-            addr->setAlias(alias);
-            }
-        }
+    populateRecipientsL(*tempmsg);
+    removeOwnNumberForReplyAll(tempmsg, aMessage);
+    delete tempmsg;
 
     // populate the subject field
     QString subject = XQConversions::s60DescToQString(
@@ -1176,4 +1125,178 @@
     
     QDEBUG_WRITE("Exit convertFromDefaultHandlerL");
 }
+
+// -----------------------------------------------------------------------------
+// removeOwnNumberForReplyAll
+// @see Header
+// -----------------------------------------------------------------------------
+void CUniEditorMmsPluginPrivate::removeOwnNumberForReplyAll(
+        ConvergedMessage* sourcemsg, 
+        ConvergedMessage* targetmsg)
+{
+    // allocate new memory for trimming the address list
+    // why do we need it? Because ConvergedMessageAddressList is implicitely
+    // shared, and Implicit sharing automatically detaches the object from
+    // a shared block if the object is about to change and the reference count
+    // is greater than one. This is called copy-on-write or value semantics.
+    ConvergedMessageAddressList toAddrList = 
+            copyAddrList(sourcemsg->toAddressList());
+    ConvergedMessageAddressList ccAddrList = 
+            copyAddrList(sourcemsg->ccAddressList());
+    ConvergedMessageAddressList bccAddrList = 
+            copyAddrList(sourcemsg->bccAddressList());
+
+    // start self-address check/remove process. Stop if there's only one
+    // address left in the address-list (to+cc+bcc)
+    QStringList selfAddrs = MsgContactHandler::selfAddresses();
+    int remainingAddr = 
+            toAddrList.count() + ccAddrList.count() + bccAddrList.count();
+    bool runOwnAddrCheck =(remainingAddr>1)?true:false;
+    if(runOwnAddrCheck)
+    {
+        foreach(ConvergedMessageAddress *bccAddress,bccAddrList)
+        {
+            if(isSelfAddress(bccAddress->address(), selfAddrs))
+            {
+                bccAddrList.removeOne(bccAddress);
+                --remainingAddr;
+                if(remainingAddr == 1)
+                {
+                    runOwnAddrCheck = false;
+                    break;
+                }
+            }
+        }
+    }
+
+    if(runOwnAddrCheck)
+    {
+        foreach(ConvergedMessageAddress *ccAddress,ccAddrList)
+        {
+            if(isSelfAddress(ccAddress->address(), selfAddrs))
+            {
+                ccAddrList.removeOne(ccAddress);
+                --remainingAddr;
+                if(remainingAddr == 1)
+                {
+                    runOwnAddrCheck = false;
+                    break;
+                }
+            }
+        }
+    }
+
+    if(runOwnAddrCheck)
+    {
+        foreach(ConvergedMessageAddress *toAddress,toAddrList)
+        {
+            if(isSelfAddress(toAddress->address(), selfAddrs))
+            {
+                toAddrList.removeOne(toAddress);
+                --remainingAddr;
+                if(remainingAddr == 1)
+                {
+                    runOwnAddrCheck = false;
+                    break;
+                }
+            }
+        }
+    }
+
+    // Run contact-resolution on address list now. This is needed
+    // because we by-pass server and directly feed data in UI
+    resolveContacts(toAddrList);
+    resolveContacts(ccAddrList);
+    resolveContacts(bccAddrList);
+
+    // restore addresses to aMessage
+    targetmsg->addToRecipients(toAddrList);
+    targetmsg->addCcRecipients(ccAddrList);
+    targetmsg->addBccRecipients((bccAddrList));
+}
+
+// -----------------------------------------------------------------------------
+// copyAddrList
+// @see Header
+// -----------------------------------------------------------------------------
+ConvergedMessageAddressList CUniEditorMmsPluginPrivate::copyAddrList(
+        ConvergedMessageAddressList addrList)
+{
+    ConvergedMessageAddressList copyAddrList;
+    int count = addrList.count();
+    for(int i=0; i<count; i++)
+    {
+        ConvergedMessageAddress* addr = new ConvergedMessageAddress;
+        addr->setAddress(addrList.at(i)->address());
+        addr->setAlias(addrList.at(i)->alias());
+        copyAddrList << addr;
+    }
+    return copyAddrList;
+}
+
+// -----------------------------------------------------------------------------
+// resolveContacts
+// @see Header
+// -----------------------------------------------------------------------------
+void CUniEditorMmsPluginPrivate::resolveContacts(
+        ConvergedMessageAddressList addrList)
+{
+    int count = addrList.count();
+    for(int i=0; i<count; i++)
+    {
+        ConvergedMessageAddress* addr = addrList.at(i);
+        // resolve contact if alias is empty
+        if(addr->alias().isEmpty())
+        {
+            QString alias;
+            int count;
+            if(-1 != MsgContactHandler::resolveContactDisplayName(
+                            addr->address(), alias, count))
+            {
+                addr->setAlias(alias);
+            }
+        }
+    }
+}
+
+// -----------------------------------------------------------------------------
+// isSelfAddress
+// @see Header
+// -----------------------------------------------------------------------------
+bool CUniEditorMmsPluginPrivate::isSelfAddress(
+        QString address,
+        QStringList selfAddrList)
+{
+    bool ifSelfAddr = false;
+    
+    TRAP_IGNORE(
+    // check if the given address is an email-address
+    HBufC* addr = XQConversions::qStringToS60Desc(address);
+    CleanupStack::PushL(addr);
+
+    if( iGenUtils->IsValidEmailAddress(*addr) )
+    {
+        ifSelfAddr = selfAddrList.contains(address, Qt::CaseInsensitive);
+    }
+    else // address is a phonenumber, use contact matching
+    {
+        foreach(QString selfaddress, selfAddrList)
+        {
+            bool ret = false;
+            HBufC* selfAddr = XQConversions::qStringToS60Desc(selfaddress);
+            CleanupStack::PushL(selfAddr);
+            ret = iGenUtils->MatchPhoneNumberL(*addr,*selfAddr);
+            CleanupStack::PopAndDestroy(selfAddr);
+            if(ret)
+            {
+                ifSelfAddr = true;
+                break;
+            }
+        }
+    }
+    CleanupStack::PopAndDestroy(addr);
+    );
+    return ifSelfAddr;
+}
+
 //  End of File
--- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgpluginapp/mmstestbed/mmstestbed.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgpluginapp/mmstestbed/mmstestbed.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -11,33 +11,40 @@
 #
 # Contributors:
 #
-# Description: Project file for mmstestbed
+# Description:
 #
 
-QT += testlib
+#QT += testlib
 QT -= gui
 
 TEMPLATE = lib
 
+CONFIG += hb
+#CONFIG += qtestlib
+CONFIG += symbian_test
 TARGET = mmstestbed
 
 INCLUDEPATH += .
 INCLUDEPATH += inc
 INCLUDEPATH += ../../../inc
+
+INCLUDEPATH += ../../../../../../mmsengine/inc
+INCLUDEPATH += ../../../../../../mmsengine/mmsserver/inc
+INCLUDEPATH += ../../../../../../mmsengine/mmsmessage/inc
+INCLUDEPATH += ../../../../../../mmsengine/mmscodec/inc
+INCLUDEPATH += ../../../../../../inc
+INCLUDEPATH += ../../../../../../mmsengine/mmsengine/inc
 INCLUDEPATH += ../../../../../../../../mmsengine/inc
 INCLUDEPATH += ../../../../../../../../mmsengine/mmscodec/inc
 INCLUDEPATH += ../../../../../../../../mmsengine/mmshttptransport/inc
 INCLUDEPATH += ../../../../../../../../mmsengine/mmsmessage/inc
 INCLUDEPATH += ../../../../../../../../mmsengine/mmsconninit/inc
+#INCLUDEPATH += ../../../../mmsengine/mmscodec/inc
 INCLUDEPATH += ../../../../../../../../mmsengine/mmsserver/inc
 INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
 
 DEFINES += BUILD_MMSTESTBED_DLL
 
-CONFIG += hb
-CONFIG += symbian_test
-CONFIG += qtestlib
-
 SOURCES += src/mmstestbed.cpp \
            src/mmsteststaticutils.cpp \
            src/mmsreadfile.cpp \
@@ -51,23 +58,23 @@
 
 SYMBIAN_PLATFORMS = WINSCW ARMV5
 
+defBlock = \
+	"$${LITERAL_HASH}if defined(EABI)" \
+	"DEFFILE eabi/mmstestbedu.def" \
+	"$${LITERAL_HASH}else" \
+	"DEFFILE bwins/mmstestbedu.def" \
+	"$${LITERAL_HASH}endif"
+
+
 symbian {
-	TARGET.UID3 =  0xE5c588a1
+    TARGET.UID3 =  0xE5c588a1
     TARGET.CAPABILITY = CAP_GENERAL_DLL
     TARGET.EPOCSTACKSIZE = 0x8000
     TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000
-    TARGET.EPOCALLOWDLLDATA = 1 
+    TARGET.EPOCALLOWDLLDATA = 1
     VENDORID =  VID_DEFAULT
 	}
 
-#Def File rules
-defBlock = \
-"$${LITERAL_HASH}if defined(EABI)" \
-"DEFFILE eabi/mmstestbedu.def" \
-"$${LITERAL_HASH}else" \
-"DEFFILE bwins/mmstestbedu.def" \
-"$${LITERAL_HASH}endif"
-
 # Build.inf rules
 BLD_INF_RULES.prj_exports += \
      "$${LITERAL_HASH}include <platform_paths.hrh>"
--- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgpluginapp/testmmsgpluginapp.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgpluginapp/testmmsgpluginapp.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -16,7 +16,7 @@
 
 TEMPLATE = subdirs
 
-SUBDIRS += mmstestbed/mmstestbed.pro 
-SUBDIRS += testmmsplugin/testmmsplugin.pro
+SUBDIRS += mmstestbed 
+SUBDIRS += testmmsplugin
 
 CONFIG += ordered
\ No newline at end of file
--- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgpluginapp/testmmsplugin/inc/testmmsplugin.ini	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgpluginapp/testmmsplugin/inc/testmmsplugin.ini	Fri Sep 17 08:28:39 2010 +0300
@@ -7,14 +7,3 @@
 const char TEST_ATTACHMENT5[]		= "c:\\data\\TestMMSPluginSample.txt";
 const char TEST_CC[]			= "DummyCCAddress<+919860479113>";
 const char TEST_BCC[]			= "DummyBCCAddress<+919860479114>";
-
-//out put directory for test results.
-QString OUTPUTDIRECTORY = "c:/logs/TestMmsPlugin";
-//o/p directory for data to be written on temp file.
-QString TEMPDIR = "c:/logs/TestMmsPlugin/testdata";
-//test result O/P file name.
-QString RESULTFILE = "c:/logs/TestMmsPlugin/result_%1.txt";
-// folder named UID3 of msgapptestsuite inside private folder.
-const QString PRIVATE_DIR("C:/private/E274bf60");
-//application class name
-const QString appClassName("TestMmsPlugin");
\ No newline at end of file
--- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgpluginapp/testmmsplugin/src/testmmsplugin.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgpluginapp/testmmsplugin/src/testmmsplugin.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -413,67 +413,29 @@
 }
 
 //---------------------------------------------------------------
-// getObject
-// factory method to create objects.
-//---------------------------------------------------------------
-QObject* getObject(QString className)
-{
-    if(className == "TestMmsPlugin" )
-    {
-        return new TestMmsPlugin;
-    }
- 	else
-	{
-		return 0;
-	}
-}
-
-//---------------------------------------------------------------
-// createOutPutDirectory
-// creating o/p directory.
-//---------------------------------------------------------------
-void createOutPutDirectory()
-    {
-    QDir dir;
-    //o/p dir
-    dir.mkdir(OUTPUTDIRECTORY);
-    //tmp dir
-    dir.mkdir(TEMPDIR);
-    // dir inside private folder.
-    dir.mkdir(PRIVATE_DIR);
-    }
-
-//---------------------------------------------------------------
 // main
 // main entry point
 //---------------------------------------------------------------
 int main(int argc, char *argv[])
     { 
-    int ret = -1;
-    QCoreApplication app(argc, argv);    
-    
-    //creating output directory.
-    createOutPutDirectory();
-    
-	QStringList args;
-	QString appName = argv[0];
-	args << appName;
-
-	QString option  = "-o";
-	args << option;
-
-	QString outFile = RESULTFILE;
-	outFile = outFile.arg(appClassName);
-	args << outFile;
-
-	QObject* tc = getObject(appClassName);
-
-	if(tc)
-		{
-		ret =  QTest::qExec(tc, args); 
-		delete tc;
-		}
-    return ret;
+	int ret = -1;
+	QCoreApplication app(argc, argv);
+	QObject* tc = new TestMmsPlugin();
+	
+#ifdef __WINSCW__
+	char *new_argv[3]; 
+	QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log";	
+	QByteArray bytes = str.toAscii();	
+	char arg1[] = "-o";	
+	new_argv[0] = argv[0];	
+	new_argv[1] = arg1;	
+	new_argv[2] = bytes.data();	
+	ret = QTest::qExec(tc, 3, new_argv);
+#else
+	ret = QTest::qExec(tc, argc, argv); 
+#endif
+	delete tc;
+	return ret;
     }
 
 //End of File
--- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgpluginapp/testmmsplugin/testmmsplugin.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgpluginapp/testmmsplugin/testmmsplugin.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -51,7 +51,8 @@
 SYMBIAN_PLATFORMS = WINSCW ARMV5
     symbian {
     TARGET.UID3 =  0xE274bf60
-    TARGET.CAPABILITY = All -TCB -DRM
+#    TARGET.CAPABILITY = All -TCB -DRM
+    TARGET.CAPABILITY = CAP_APPLICATION
     TARGET.EPOCSTACKSIZE = 0x8000
     TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000
     VENDORID =  VID_DEFAULT
--- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/tsrc.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/tsrc.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -16,6 +16,6 @@
 
 TEMPLATE = subdirs
 
-SUBDIRS += testmmsgpluginapp/testmmsgpluginapp.pro 
+SUBDIRS += testmmsgpluginapp 
 
 CONFIG += ordered
\ No newline at end of file
--- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/inc/unieditorsmsplugin_p.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/inc/unieditorsmsplugin_p.h	Fri Sep 17 08:28:39 2010 +0300
@@ -259,7 +259,7 @@
         /**
          * set/update sms settings 
          */
-        void SetSmsSettingsL();
+        void SetSmsSettingsL(ConvergedMessage* message);
      
         /**
          * set data to the sms
--- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/src/unieditorsmsplugin_p.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/src/unieditorsmsplugin_p.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -329,6 +329,17 @@
 
         //Populate message body
         populateMessageBodyL(aMessage,msvEntry);
+
+        // read flag for reply-via-same-smsc usecase
+        bool replyPath = SmsMtmL()->SmsHeader().Submit().ReplyPath();
+        aMessage->setReplyPath(replyPath);
+        if(replyPath)
+        {
+            // save smsc in the message
+            QString scaddress = XQConversions::s60DescToQString(
+                    SmsMtmL()->SmsHeader().Message().ServiceCenterAddress());
+            aMessage->setOriginatingSC(scaddress);
+        }
     }
     else if(aOperation == UniEditorPluginInterface::Forward)
     {
@@ -368,7 +379,7 @@
                 // set sms data
                 SetSmsDataL( message );
                 // set sms settings
-                SetSmsSettingsL();
+                SetSmsSettingsL( message );
                 // save all changes for the entry
                 SmsMtmL()->SaveMessageL();
         );
@@ -692,7 +703,7 @@
 // SetSmsSettingsL
 // @see header
 // -----------------------------------------------------------------------------
-void UniEditorSmsPluginPrivate::SetSmsSettingsL()
+void UniEditorSmsPluginPrivate::SetSmsSettingsL(ConvergedMessage* message)
     {
     CSmsSettings* sendOptions = CSmsSettings::NewL();
     CleanupStack::PushL( sendOptions );
@@ -728,7 +739,7 @@
     sendOptions->SetDeliveryReport( defaultSettings->DeliveryReport() );
     sendOptions->SetSmsBearer( defaultSettings->SmsBearer() );
     sendOptions->SetValidityPeriod( defaultSettings->ValidityPeriod() );
-    sendOptions->SetReplyPath( defaultSettings->ReplyPath() );
+    sendOptions->SetReplyPath( message->replyPath() );
 
     if (defaultSettings->CharacterSet()
             == TSmsDataCodingScheme::ESmsAlphabetUCS2)
@@ -744,9 +755,16 @@
 
     // Move all the stuff from iSmsHeader::SmsSettings to SmsMtm::SmsHeader::SmsSettings
     SmsMtmL()->SmsHeader( ).SetSmsSettingsL( *sendOptions );
-    //If sc is existant then only set the default service center
-    if(ValidateSCNumberL())
+
+    // if reply-path is present, then lets use it
+    if(message->replyPath())
     {
+    QString scaddress = message->originatingSC();
+    SmsMtmL()->SmsHeader( ).Message( ).
+        SetServiceCenterAddressL( *XQConversions::qStringToS60Desc(scaddress) );
+    }
+    else if(ValidateSCNumberL())
+    {    // Or if default SC is existant then only set the default SC
     SmsMtmL()->SmsHeader( ).Message( ).
         SetServiceCenterAddressL( defaultSettings->GetServiceCenter(defaultSettings->DefaultServiceCenter()).Address() );
     }
@@ -1917,6 +1935,16 @@
             ConvergedMessageAddress messageAddress(addr);
             aMessage->addToRecipient(messageAddress);
             }
+        // read flag for reply-via-same-smsc usecase
+        bool replyPath = SmsMtmL()->SmsHeader().Deliver().ReplyPath();
+        aMessage->setReplyPath(replyPath);
+        if(replyPath)
+            {
+            // save smsc in the message
+            QString scaddress = XQConversions::s60DescToQString(
+                    SmsMtmL()->SmsHeader().Deliver().ServiceCenterAddress());
+            aMessage->setOriginatingSC(scaddress);
+            }
         }
     // else, for outgoing message, populate receiver address in To-field
     else if(smsPduType == CSmsPDU::ESmsSubmit)
@@ -1935,10 +1963,11 @@
             {
             QString alias;
             int count;
-            int localId =
-                    MsgContactHandler::resolveContactDisplayName(
-                            addr->address(), alias, count);
-            addr->setAlias(alias);
+            if(-1 != MsgContactHandler::resolveContactDisplayName(
+                                        addr->address(), alias, count))
+                {
+                addr->setAlias(alias);
+                }
             }
         }
     }
--- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/bwins/test_sms_pluginu.def	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-EXPORTS
-	qt_plugin_instance @ 1 NONAME
-	qt_plugin_query_verification_data @ 2 NONAME
-	?initTestCase@TestSmsPlugin@@AAEXXZ @ 3 NONAME ; void TestSmsPlugin::initTestCase(void)
-	?qt_metacast@TestSmsPlugin@@UAEPAXPBD@Z @ 4 NONAME ; void * TestSmsPlugin::qt_metacast(char const *)
-	?cleanupTestCase@TestSmsPlugin@@AAEXXZ @ 5 NONAME ; void TestSmsPlugin::cleanupTestCase(void)
-	?qt_metacall@TestSmsPlugin@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 6 NONAME ; int TestSmsPlugin::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?trUtf8@TestSmsPlugin@@SA?AVQString@@PBD0H@Z @ 7 NONAME ; class QString TestSmsPlugin::trUtf8(char const *, char const *, int)
-	?trUtf8@TestSmsPlugin@@SA?AVQString@@PBD0@Z @ 8 NONAME ; class QString TestSmsPlugin::trUtf8(char const *, char const *)
-	?validateMsg@TestSmsPlugin@@AAEXABVConvergedMessage@@ABVQString@@@Z @ 9 NONAME ; void TestSmsPlugin::validateMsg(class ConvergedMessage const &, class QString const &)
-	?staticMetaObject@TestSmsPlugin@@2UQMetaObject@@B @ 10 NONAME ; struct QMetaObject const TestSmsPlugin::staticMetaObject
-	?testReceived@TestSmsPlugin@@AAEXH@Z @ 11 NONAME ; void TestSmsPlugin::testReceived(int)
-	?createAndSend@TestSmsPlugin@@AAEXH@Z @ 12 NONAME ; void TestSmsPlugin::createAndSend(int)
-	?init@TestSmsPlugin@@AAEXXZ @ 13 NONAME ; void TestSmsPlugin::init(void)
-	?tr@TestSmsPlugin@@SA?AVQString@@PBD0H@Z @ 14 NONAME ; class QString TestSmsPlugin::tr(char const *, char const *, int)
-	?testSendReceiveSMS@TestSmsPlugin@@AAEXXZ @ 15 NONAME ; void TestSmsPlugin::testSendReceiveSMS(void)
-	?tr@TestSmsPlugin@@SA?AVQString@@PBD0@Z @ 16 NONAME ; class QString TestSmsPlugin::tr(char const *, char const *)
-	?metaObject@TestSmsPlugin@@UBEPBUQMetaObject@@XZ @ 17 NONAME ; struct QMetaObject const * TestSmsPlugin::metaObject(void) const
-	?getStaticMetaObject@TestSmsPlugin@@SAABUQMetaObject@@XZ @ 18 NONAME ; struct QMetaObject const & TestSmsPlugin::getStaticMetaObject(void)
-	?cleanup@TestSmsPlugin@@AAEXXZ @ 19 NONAME ; void TestSmsPlugin::cleanup(void)
-
Binary file messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/1000102C.txt has changed
Binary file messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/100058DB.txt has changed
Binary file messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/101FB0D5.txt has changed
Binary file messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/101FB0D9.txt has changed
Binary file messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/cccccc00.cre has changed
--- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/ced_simtsy.cfg	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2244 +0,0 @@
-############################################################
-## AUTO-GENERATED CONFIGURATION FILE
-## CommsDat Database Dump Utility
-## 1.0
-############################################################
-
-############################################################
-## Network
-## 
-[Network]
-ADD_SECTION
-# COMMDB_ID = 1
-	Name=Intranet
-	FIELD_COUNT=1
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 2
-	Name=mRouter
-	FIELD_COUNT=1
-END_ADD
-
-
-############################################################
-## ModemBearer
-## 
-[ModemBearer]
-ADD_TEMPLATE
-	Name=Default Modem
-	IfName=PPP
-	PortName=COMM::0
-	TSYName=SIM
-	CSYName=ECUART
-	LastSocketActivityTimeout=180
-	LastSessionClosedTimeout=30
-	LastSocketClosedTimeout=60
-	DataBits=8
-	StopBits=1
-	Parity=NONE
-	Rate=115200
-	Handshaking=0
-	SpecialRate=0
-	XonChar=0
-	XoffChar=0
-	FaxClassPref=AUTO
-	SpeakerPref=NEVER
-	SpeakerVolPref=QUIET
-	ModemInitString=AT
-	DataInitString=AT
-	FaxInitString=AT
-	DialPauseLength=S8=
-	SpeakerVolContorlLow=L0
-	SpeakerVolControlMedium=L1
-	SpeakerVolControlHigh=L2
-	SpeakerAlwaysOff=M0
-	SpeakerOnUntilCarrier=M1
-	SpeakerAlwaysOn=M2
-	SpeakerOnAfterUntilCarrier=M3
-	DialToneWaitModifier=W
-	CallProgress1=X1
-	CallProgress2=X2
-	CallProgress3=X3
-	CallProgress4=X4
-	EchoOff=E0
-	VerboseText=V1
-	QuietOff=Q0
-	QuietOn=Q1
-	DialCommandStateModifier=;
-	OnLine=O
-	ResetConfiguration=Z
-	ReturnToFactoryDefs=&F
-	DCDOnDuringLink=&C1
-	DTRHangUp=&D2
-	DSRAlwaysOn=&S0
-	RTSCTSHandshake=&K3
-	XonXoffHandshake=&K4
-	EscapeCharacter=+
-	EscapeGuardPeriod=S12
-	NoDialTone=NO DIAL TONE
-	Busy=BUSY
-	NoAnswer=NO ANSWER
-	Carrier=CARRIER
-	Connect=CONNECT
-	CompressionClass5=COMPRESSION:CLASS 5
-	CompressionV42bis=COMPRESSION:V.42 bis
-	CompressionNone=COMPRESSION:NONE
-	ProtocolLAPD=PROTOCOL:LAPD
-	ProtocolALT=PROTOCOL:ALT
-	ProtocolALTCELLULAR=PROTOCOL:ALT-CELLULAR
-	ProtocolNone=PROTOCOL:NONE
-	MessageCentreNumber=+44123456789
-	MessageValidityPeriod=1440
-	MessageDeliveryReport=FALSE
-	MinimumSignalLevel=9905
-	CommRole=0
-	SIRSettings=0
-	Agent=CSD.agt
-	FIELD_COUNT=69
-END_TEMPLATE
-
-ADD_SECTION
-# COMMDB_ID = 2
-	Name=Null Modem 115200bps
-	IfName=PPP
-	PortName=COMM::0
-	TSYName=SIM
-	CSYName=ECUART
-	LastSocketActivityTimeout=180
-	LastSessionClosedTimeout=30
-	LastSocketClosedTimeout=60
-	DataBits=8
-	StopBits=1
-	Parity=NONE
-	Rate=115200
-	Handshaking=4
-	SpecialRate=0
-	XonChar=0
-	XoffChar=0
-	FaxClassPref=AUTO
-	SpeakerPref=NEVER
-	SpeakerVolPref=QUIET
-	ModemInitString=AT
-	DataInitString=AT
-	FaxInitString=AT
-	DialPauseLength=S8=
-	SpeakerVolContorlLow=L0
-	SpeakerVolControlMedium=L1
-	SpeakerVolControlHigh=L2
-	SpeakerAlwaysOff=M0
-	SpeakerOnUntilCarrier=M1
-	SpeakerAlwaysOn=M2
-	SpeakerOnAfterUntilCarrier=M3
-	DialToneWaitModifier=W
-	CallProgress1=X1
-	CallProgress2=X2
-	CallProgress3=X3
-	CallProgress4=X4
-	EchoOff=E0
-	VerboseText=V1
-	QuietOff=Q0
-	QuietOn=Q1
-	DialCommandStateModifier=;
-	OnLine=O
-	ResetConfiguration=Z
-	ReturnToFactoryDefs=&F
-	DCDOnDuringLink=&C1
-	DTRHangUp=&D2
-	DSRAlwaysOn=&S0
-	RTSCTSHandshake=&K3
-	XonXoffHandshake=&K4
-	EscapeCharacter=+
-	EscapeGuardPeriod=S12
-	NoDialTone=NO DIAL TONE
-	Busy=BUSY
-	NoAnswer=NO ANSWER
-	Carrier=CARRIER
-	Connect=CONNECT
-	CompressionClass5=COMPRESSION:CLASS 5
-	CompressionV42bis=COMPRESSION:V.42 bis
-	CompressionNone=COMPRESSION:NONE
-	ProtocolLAPD=PROTOCOL:LAPD
-	ProtocolALT=PROTOCOL:ALT
-	ProtocolALTCELLULAR=PROTOCOL:ALT-CELLULAR
-	ProtocolNone=PROTOCOL:NONE
-	MessageCentreNumber=+385669988
-	MessageValidityPeriod=3000
-	MessageDeliveryReport=TRUE
-	MinimumSignalLevel=9905
-	CommRole=0
-	SIRSettings=0
-	Agent=CSD.agt
-	FIELD_COUNT=69
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 3
-	Name=US Robotics Sportster
-	IfName=PPP
-	PortName=COMM::0
-	TSYName=MM
-	CSYName=ECUART
-	LastSocketActivityTimeout=180
-	LastSessionClosedTimeout=30
-	LastSocketClosedTimeout=60
-	DataBits=8
-	StopBits=1
-	Parity=NONE
-	Rate=57600
-	Handshaking=244
-	SpecialRate=0
-	XonChar=0
-	XoffChar=0
-	FaxClassPref=AUTO
-	SpeakerPref=AFTERDIALUNTILANSWER
-	SpeakerVolPref=QUIET
-	ModemInitString=AT&F1
-	DataInitString=AT
-	FaxInitString=AT&d2
-	DialPauseLength=S8=
-	SpeakerVolContorlLow=L0
-	SpeakerVolControlMedium=L1
-	SpeakerVolControlHigh=L2
-	SpeakerAlwaysOff=M0
-	SpeakerOnUntilCarrier=M1
-	SpeakerAlwaysOn=M2
-	SpeakerOnAfterUntilCarrier=M3
-	DialToneWaitModifier=W
-	CallProgress1=X1
-	CallProgress2=X2
-	CallProgress3=X3
-	CallProgress4=X4
-	EchoOff=E0
-	VerboseText=V1
-	QuietOff=Q0
-	QuietOn=Q1
-	DialCommandStateModifier=;
-	OnLine=O
-	ResetConfiguration=Z
-	ReturnToFactoryDefs=&F
-	DCDOnDuringLink=&C1
-	DTRHangUp=&D2
-	DSRAlwaysOn=&S0
-	RTSCTSHandshake=&K3
-	XonXoffHandshake=&K4
-	EscapeCharacter=+
-	EscapeGuardPeriod=S12
-	NoDialTone=NO DIAL TONE
-	Busy=BUSY
-	NoAnswer=NO ANSWER
-	Carrier=CARRIER
-	Connect=CONNECT
-	CompressionClass5=COMPRESSION:CLASS 5
-	CompressionV42bis=COMPRESSION:V.42 bis
-	CompressionNone=COMPRESSION:NONE
-	ProtocolLAPD=PROTOCOL:LAPD
-	ProtocolALT=PROTOCOL:ALT
-	ProtocolALTCELLULAR=PROTOCOL:ALT-CELLULAR
-	ProtocolNone=PROTOCOL:NONE
-	MessageCentreNumber=+44123456789
-	MessageValidityPeriod=1440
-	MessageDeliveryReport=FALSE
-	MinimumSignalLevel=9905
-	CommRole=0
-	SIRSettings=0
-	Agent=CSD.agt
-	FIELD_COUNT=69
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 4
-	Name=Dacom Surfer
-	IfName=PPP
-	PortName=COMM::0
-	TSYName=MM
-	CSYName=ECUART
-	LastSocketActivityTimeout=180
-	LastSessionClosedTimeout=30
-	LastSocketClosedTimeout=60
-	DataBits=8
-	StopBits=1
-	Parity=NONE
-	Rate=57600
-	Handshaking=244
-	SpecialRate=0
-	XonChar=0
-	XoffChar=0
-	FaxClassPref=AUTO
-	SpeakerPref=AFTERDIALUNTILANSWER
-	SpeakerVolPref=QUIET
-	ModemInitString=AT&F
-	DataInitString=AT
-	FaxInitString=AT&d2
-	DialPauseLength=S8=
-	SpeakerVolContorlLow=L0
-	SpeakerVolControlMedium=L1
-	SpeakerVolControlHigh=L2
-	SpeakerAlwaysOff=M0
-	SpeakerOnUntilCarrier=M1
-	SpeakerAlwaysOn=M2
-	SpeakerOnAfterUntilCarrier=M3
-	DialToneWaitModifier=W
-	CallProgress1=X1
-	CallProgress2=X2
-	CallProgress3=X3
-	CallProgress4=X4
-	EchoOff=E0
-	VerboseText=V1
-	QuietOff=Q0
-	QuietOn=Q1
-	DialCommandStateModifier=;
-	OnLine=O
-	ResetConfiguration=Z
-	ReturnToFactoryDefs=&F
-	DCDOnDuringLink=&C1
-	DTRHangUp=&D2
-	DSRAlwaysOn=&S0
-	RTSCTSHandshake=&K3
-	XonXoffHandshake=&K4
-	EscapeCharacter=+
-	EscapeGuardPeriod=S12
-	NoDialTone=NO DIAL TONE
-	Busy=BUSY
-	NoAnswer=NO ANSWER
-	Carrier=CARRIER
-	Connect=CONNECT
-	CompressionClass5=COMPRESSION:CLASS 5
-	CompressionV42bis=COMPRESSION:V.42 bis
-	CompressionNone=COMPRESSION:NONE
-	ProtocolLAPD=PROTOCOL:LAPD
-	ProtocolALT=PROTOCOL:ALT
-	ProtocolALTCELLULAR=PROTOCOL:ALT-CELLULAR
-	ProtocolNone=PROTOCOL:NONE
-	MessageCentreNumber=+44123456789
-	MessageValidityPeriod=1440
-	MessageDeliveryReport=FALSE
-	MinimumSignalLevel=9905
-	CommRole=0
-	SIRSettings=0
-	Agent=CSD.agt
-	FIELD_COUNT=69
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 5
-	Name=GSM Mobile Phone via Infrared
-	IfName=PPP
-	PortName=IRCOMM::0
-	TSYName=MM
-	CSYName=IRCOMM
-	LastSocketActivityTimeout=180
-	LastSessionClosedTimeout=30
-	LastSocketClosedTimeout=60
-	DataBits=8
-	StopBits=1
-	Parity=NONE
-	Rate=115200
-	Handshaking=196
-	SpecialRate=0
-	XonChar=17
-	XoffChar=19
-	FaxClassPref=AUTO
-	SpeakerPref=NEVER
-	SpeakerVolPref=QUIET
-	ModemInitString=ATZ
-	DataInitString=AT
-	FaxInitString=AT
-	DialPauseLength=S8=
-	SpeakerVolContorlLow=L0
-	SpeakerVolControlMedium=L1
-	SpeakerVolControlHigh=L2
-	SpeakerAlwaysOff=M0
-	SpeakerOnUntilCarrier=M1
-	SpeakerAlwaysOn=M2
-	SpeakerOnAfterUntilCarrier=M3
-	DialToneWaitModifier=W
-	CallProgress1=X1
-	CallProgress2=X2
-	CallProgress3=X3
-	CallProgress4=X4
-	EchoOff=E0
-	VerboseText=V1
-	QuietOff=Q0
-	QuietOn=Q1
-	DialCommandStateModifier=;
-	OnLine=O
-	ResetConfiguration=Z
-	ReturnToFactoryDefs=&F
-	DCDOnDuringLink=&C1
-	DTRHangUp=&D2
-	DSRAlwaysOn=&S0
-	RTSCTSHandshake=&K3
-	XonXoffHandshake=&K4
-	EscapeCharacter=+
-	EscapeGuardPeriod=S12
-	NoDialTone=NO DIAL TONE
-	Busy=BUSY
-	NoAnswer=NO ANSWER
-	Carrier=CARRIER
-	Connect=CONNECT
-	CompressionClass5=COMPRESSION:CLASS 5
-	CompressionV42bis=COMPRESSION:V.42 bis
-	CompressionNone=COMPRESSION:NONE
-	ProtocolLAPD=PROTOCOL:LAPD
-	ProtocolALT=PROTOCOL:ALT
-	ProtocolALTCELLULAR=PROTOCOL:ALT-CELLULAR
-	ProtocolNone=PROTOCOL:NONE
-	MessageCentreNumber=+44123456789
-	MessageValidityPeriod=1440
-	MessageDeliveryReport=FALSE
-	MinimumSignalLevel=9905
-	CommRole=0
-	SIRSettings=0
-	Agent=CSD.agt
-	FIELD_COUNT=69
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 6
-	Name=GSM Mobile Phone via Serial
-	IfName=PPP
-	PortName=COMM::0
-	TSYName=MM
-	CSYName=ECUART
-	LastSocketActivityTimeout=180
-	LastSessionClosedTimeout=30
-	LastSocketClosedTimeout=60
-	DataBits=8
-	StopBits=1
-	Parity=NONE
-	Rate=19200
-	Handshaking=196
-	SpecialRate=0
-	XonChar=17
-	XoffChar=19
-	FaxClassPref=AUTO
-	SpeakerPref=NEVER
-	SpeakerVolPref=QUIET
-	ModemInitString=ATZ
-	DataInitString=AT
-	FaxInitString=AT
-	DialPauseLength=S8=
-	SpeakerVolContorlLow=L0
-	SpeakerVolControlMedium=L1
-	SpeakerVolControlHigh=L2
-	SpeakerAlwaysOff=M0
-	SpeakerOnUntilCarrier=M1
-	SpeakerAlwaysOn=M2
-	SpeakerOnAfterUntilCarrier=M3
-	DialToneWaitModifier=W
-	CallProgress1=X1
-	CallProgress2=X2
-	CallProgress3=X3
-	CallProgress4=X4
-	EchoOff=E0
-	VerboseText=V1
-	QuietOff=Q0
-	QuietOn=Q1
-	DialCommandStateModifier=;
-	OnLine=O
-	ResetConfiguration=Z
-	ReturnToFactoryDefs=&F
-	DCDOnDuringLink=&C1
-	DTRHangUp=&D2
-	DSRAlwaysOn=&S0
-	RTSCTSHandshake=&K3
-	XonXoffHandshake=&K4
-	EscapeCharacter=+
-	EscapeGuardPeriod=S12
-	NoDialTone=NO DIAL TONE
-	Busy=BUSY
-	NoAnswer=NO ANSWER
-	Carrier=CARRIER
-	Connect=CONNECT
-	CompressionClass5=COMPRESSION:CLASS 5
-	CompressionV42bis=COMPRESSION:V.42 bis
-	CompressionNone=COMPRESSION:NONE
-	ProtocolLAPD=PROTOCOL:LAPD
-	ProtocolALT=PROTOCOL:ALT
-	ProtocolALTCELLULAR=PROTOCOL:ALT-CELLULAR
-	ProtocolNone=PROTOCOL:NONE
-	MessageCentreNumber=+44123456789
-	MessageValidityPeriod=1440
-	MessageDeliveryReport=FALSE
-	MinimumSignalLevel=9905
-	CommRole=0
-	SIRSettings=0
-	Agent=CSD.agt
-	FIELD_COUNT=69
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 7
-	Name=GPRS Ericsson R520m via IR
-	IfName=PPP
-	PortName=IRCOMM::0
-	TSYName=MM
-	CSYName=IRCOMM
-	LastSocketActivityTimeout=180
-	LastSessionClosedTimeout=30
-	LastSocketClosedTimeout=60
-	DataBits=8
-	StopBits=1
-	Parity=NONE
-	Rate=115200
-	Handshaking=4
-	SpecialRate=0
-	XonChar=17
-	XoffChar=19
-	FaxClassPref=AUTO
-	SpeakerPref=NEVER
-	SpeakerVolPref=QUIET
-	ModemInitString=ATZ
-	DataInitString=AT
-	FaxInitString=AT
-	DialPauseLength=S8=
-	SpeakerVolContorlLow=L0
-	SpeakerVolControlMedium=L1
-	SpeakerVolControlHigh=L2
-	SpeakerAlwaysOff=M0
-	SpeakerOnUntilCarrier=M1
-	SpeakerAlwaysOn=M2
-	SpeakerOnAfterUntilCarrier=M3
-	DialToneWaitModifier=W
-	CallProgress1=X1
-	CallProgress2=X2
-	CallProgress3=X3
-	CallProgress4=X4
-	EchoOff=E0
-	VerboseText=V1
-	QuietOff=Q0
-	QuietOn=Q1
-	DialCommandStateModifier=;
-	OnLine=O
-	ResetConfiguration=Z
-	ReturnToFactoryDefs=&F
-	DCDOnDuringLink=&C1
-	DTRHangUp=&D2
-	DSRAlwaysOn=&S0
-	RTSCTSHandshake=&K3
-	XonXoffHandshake=&K4
-	EscapeCharacter=+
-	EscapeGuardPeriod=S12
-	NoDialTone=NO DIAL TONE
-	Busy=BUSY
-	NoAnswer=NO ANSWER
-	Carrier=CARRIER
-	Connect=CONNECT
-	CompressionClass5=COMPRESSION:CLASS 5
-	CompressionV42bis=COMPRESSION:V.42 bis
-	CompressionNone=COMPRESSION:NONE
-	ProtocolLAPD=PROTOCOL:LAPD
-	ProtocolALT=PROTOCOL:ALT
-	ProtocolALTCELLULAR=PROTOCOL:ALT-CELLULAR
-	ProtocolNone=PROTOCOL:NONE
-	MessageCentreNumber=+44123456789
-	MessageValidityPeriod=1440
-	MessageDeliveryReport=FALSE
-	MinimumSignalLevel=9905
-	CommRole=0
-	SIRSettings=0
-	Agent=PSD.agt
-	FIELD_COUNT=69
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 8
-	Name=GPRS Ericsson R520m/T68i via Serial
-	IfName=PPP
-	PortName=COMM::0
-	TSYName=MM
-	CSYName=ECUART
-	LastSocketActivityTimeout=180
-	LastSessionClosedTimeout=30
-	LastSocketClosedTimeout=60
-	DataBits=8
-	StopBits=1
-	Parity=NONE
-	Rate=19200
-	Handshaking=4
-	SpecialRate=0
-	XonChar=17
-	XoffChar=19
-	FaxClassPref=AUTO
-	SpeakerPref=NEVER
-	SpeakerVolPref=QUIET
-	ModemInitString=ATZ
-	DataInitString=AT
-	FaxInitString=AT
-	IspInitString=*99***1#
-	DialPauseLength=S8=
-	SpeakerVolContorlLow=L0
-	SpeakerVolControlMedium=L1
-	SpeakerVolControlHigh=L2
-	SpeakerAlwaysOff=M0
-	SpeakerOnUntilCarrier=M1
-	SpeakerAlwaysOn=M2
-	SpeakerOnAfterUntilCarrier=M3
-	DialToneWaitModifier=W
-	CallProgress1=X1
-	CallProgress2=X2
-	CallProgress3=X3
-	CallProgress4=X4
-	EchoOff=E0
-	VerboseText=V1
-	QuietOff=Q0
-	QuietOn=Q1
-	DialCommandStateModifier=;
-	OnLine=O
-	ResetConfiguration=Z
-	ReturnToFactoryDefs=&F
-	DCDOnDuringLink=&C1
-	DTRHangUp=&D2
-	DSRAlwaysOn=&S0
-	RTSCTSHandshake=&K3
-	XonXoffHandshake=&K4
-	EscapeCharacter=+
-	EscapeGuardPeriod=S12
-	NoDialTone=NO DIAL TONE
-	Busy=BUSY
-	NoAnswer=NO ANSWER
-	Carrier=CARRIER
-	Connect=CONNECT
-	CompressionClass5=COMPRESSION:CLASS 5
-	CompressionV42bis=COMPRESSION:V.42 bis
-	CompressionNone=COMPRESSION:NONE
-	ProtocolLAPD=PROTOCOL:LAPD
-	ProtocolALT=PROTOCOL:ALT
-	ProtocolALTCELLULAR=PROTOCOL:ALT-CELLULAR
-	ProtocolNone=PROTOCOL:NONE
-	MessageCentreNumber=+44123456789
-	MessageValidityPeriod=1440
-	MessageDeliveryReport=FALSE
-	MinimumSignalLevel=9905
-	CommRole=0
-	SIRSettings=0
-	Agent=PSD.agt
-	FIELD_COUNT=70
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 9
-	Name=GPRS Motorola Mobile Phone via Serial
-	IfName=PPP
-	PortName=COMM::0
-	TSYName=MM
-	CSYName=ECUART
-	LastSocketActivityTimeout=180
-	LastSessionClosedTimeout=30
-	LastSocketClosedTimeout=60
-	DataBits=8
-	StopBits=1
-	Parity=NONE
-	Rate=57600
-	Handshaking=4
-	SpecialRate=0
-	XonChar=17
-	XoffChar=19
-	FaxClassPref=AUTO
-	SpeakerPref=NEVER
-	SpeakerVolPref=QUIET
-	ModemInitString=ATZ
-	DataInitString=AT
-	FaxInitString=AT
-	DialPauseLength=S8=
-	SpeakerVolContorlLow=L0
-	SpeakerVolControlMedium=L1
-	SpeakerVolControlHigh=L2
-	SpeakerAlwaysOff=M0
-	SpeakerOnUntilCarrier=M1
-	SpeakerAlwaysOn=M2
-	SpeakerOnAfterUntilCarrier=M3
-	DialToneWaitModifier=W
-	CallProgress1=X1
-	CallProgress2=X2
-	CallProgress3=X3
-	CallProgress4=X4
-	EchoOff=E0
-	VerboseText=V1
-	QuietOff=Q0
-	QuietOn=Q1
-	DialCommandStateModifier=;
-	OnLine=O
-	ResetConfiguration=Z
-	ReturnToFactoryDefs=&F
-	DCDOnDuringLink=&C1
-	DTRHangUp=&D2
-	DSRAlwaysOn=&S0
-	RTSCTSHandshake=&K3
-	XonXoffHandshake=&K4
-	EscapeCharacter=+
-	EscapeGuardPeriod=S12
-	NoDialTone=NO DIAL TONE
-	Busy=BUSY
-	NoAnswer=NO ANSWER
-	Carrier=CARRIER
-	Connect=CONNECT
-	CompressionClass5=COMPRESSION:CLASS 5
-	CompressionV42bis=COMPRESSION:V.42 bis
-	CompressionNone=COMPRESSION:NONE
-	ProtocolLAPD=PROTOCOL:LAPD
-	ProtocolALT=PROTOCOL:ALT
-	ProtocolALTCELLULAR=PROTOCOL:ALT-CELLULAR
-	ProtocolNone=PROTOCOL:NONE
-	MessageCentreNumber=+44123456789
-	MessageValidityPeriod=1440
-	MessageDeliveryReport=FALSE
-	MinimumSignalLevel=9905
-	CommRole=0
-	SIRSettings=0
-	Agent=PSD.agt
-	FIELD_COUNT=69
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 10
-	Name=WinTunnel Modem
-	IfName=PPP
-	PortName=COMM::6
-	TSYName=MM
-	CSYName=ECUART
-	LastSocketActivityTimeout=180
-	LastSessionClosedTimeout=30
-	LastSocketClosedTimeout=60
-	DataBits=8
-	StopBits=1
-	Parity=NONE
-	Rate=115200
-	Handshaking=4
-	SpecialRate=0
-	XonChar=0
-	XoffChar=0
-	FaxClassPref=AUTO
-	SpeakerPref=NEVER
-	SpeakerVolPref=QUIET
-	ModemInitString=AT
-	DataInitString=AT
-	FaxInitString=AT
-	DialPauseLength=S8=
-	SpeakerVolContorlLow=L0
-	SpeakerVolControlMedium=L1
-	SpeakerVolControlHigh=L2
-	SpeakerAlwaysOff=M0
-	SpeakerOnUntilCarrier=M1
-	SpeakerAlwaysOn=M2
-	SpeakerOnAfterUntilCarrier=M3
-	DialToneWaitModifier=W
-	CallProgress1=X1
-	CallProgress2=X2
-	CallProgress3=X3
-	CallProgress4=X4
-	EchoOff=E0
-	VerboseText=V1
-	QuietOff=Q0
-	QuietOn=Q1
-	DialCommandStateModifier=;
-	OnLine=O
-	ResetConfiguration=Z
-	ReturnToFactoryDefs=&F
-	DCDOnDuringLink=&C1
-	DTRHangUp=&D2
-	DSRAlwaysOn=&S0
-	RTSCTSHandshake=&K3
-	XonXoffHandshake=&K4
-	EscapeCharacter=+
-	EscapeGuardPeriod=S12
-	NoDialTone=NO DIAL TONE
-	Busy=BUSY
-	NoAnswer=NO ANSWER
-	Carrier=CARRIER
-	Connect=CONNECT
-	CompressionClass5=COMPRESSION:CLASS 5
-	CompressionV42bis=COMPRESSION:V.42 bis
-	CompressionNone=COMPRESSION:NONE
-	ProtocolLAPD=PROTOCOL:LAPD
-	ProtocolALT=PROTOCOL:ALT
-	ProtocolALTCELLULAR=PROTOCOL:ALT-CELLULAR
-	ProtocolNone=PROTOCOL:NONE
-	MessageCentreNumber=+44123456789
-	MessageValidityPeriod=1440
-	MessageDeliveryReport=FALSE
-	MinimumSignalLevel=9905
-	CommRole=0
-	SIRSettings=0
-	Agent=null.agt
-	FIELD_COUNT=69
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 11
-	Name=mRouterWinsBearer
-	IfName=PPP
-	PortName=WINS::0
-	TSYName=MM
-	CSYName=WINSCSY
-	LastSocketActivityTimeout=9999
-	LastSessionClosedTimeout=180
-	LastSocketClosedTimeout=30
-	DataBits=8
-	StopBits=1
-	Parity=NONE
-	Rate=115200
-	Handshaking=4
-	SpecialRate=0
-	XonChar=0
-	XoffChar=0
-	FaxClassPref=AUTO
-	SpeakerPref=NEVER
-	SpeakerVolPref=QUIET
-	ModemInitString=AT
-	DataInitString=AT
-	FaxInitString=AT
-	DialPauseLength=S8=
-	SpeakerVolContorlLow=L0
-	SpeakerVolControlMedium=L1
-	SpeakerVolControlHigh=L2
-	SpeakerAlwaysOff=M0
-	SpeakerOnUntilCarrier=M1
-	SpeakerAlwaysOn=M2
-	SpeakerOnAfterUntilCarrier=M3
-	DialToneWaitModifier=W
-	CallProgress1=X1
-	CallProgress2=X2
-	CallProgress3=X3
-	CallProgress4=X4
-	EchoOff=E0
-	VerboseText=V1
-	QuietOff=Q0
-	QuietOn=Q1
-	DialCommandStateModifier=;
-	OnLine=O
-	ResetConfiguration=Z
-	ReturnToFactoryDefs=&F
-	DCDOnDuringLink=&C1
-	DTRHangUp=&D2
-	DSRAlwaysOn=&S0
-	RTSCTSHandshake=&K3
-	XonXoffHandshake=&K4
-	EscapeCharacter=+
-	EscapeGuardPeriod=S12
-	NoDialTone=NO DIAL TONE
-	Busy=BUSY
-	NoAnswer=NO ANSWER
-	Carrier=CARRIER
-	Connect=CONNECT
-	CompressionClass5=COMPRESSION:CLASS 5
-	CompressionV42bis=COMPRESSION:V.42 bis
-	CompressionNone=COMPRESSION:NONE
-	ProtocolLAPD=PROTOCOL:LAPD
-	ProtocolALT=PROTOCOL:ALT
-	ProtocolALTCELLULAR=PROTOCOL:ALT-CELLULAR
-	ProtocolNone=PROTOCOL:NONE
-	MessageCentreNumber=+44123456789
-	MessageValidityPeriod=1440
-	MessageDeliveryReport=FALSE
-	MinimumSignalLevel=9905
-	CommRole=0
-	SIRSettings=0
-	Agent=mRouterAgent.agt
-	FIELD_COUNT=69
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 12
-	Name=mRouterRs232Bearer
-	IfName=PPP
-	PortName=COMM::0
-	TSYName=MM
-	CSYName=ECUART
-	LastSocketActivityTimeout=9999
-	LastSessionClosedTimeout=180
-	LastSocketClosedTimeout=30
-	DataBits=8
-	StopBits=1
-	Parity=NONE
-	Rate=115200
-	Handshaking=4
-	SpecialRate=0
-	XonChar=0
-	XoffChar=0
-	FaxClassPref=AUTO
-	SpeakerPref=NEVER
-	SpeakerVolPref=QUIET
-	ModemInitString=AT
-	DataInitString=AT
-	FaxInitString=AT
-	DialPauseLength=S8=
-	SpeakerVolContorlLow=L0
-	SpeakerVolControlMedium=L1
-	SpeakerVolControlHigh=L2
-	SpeakerAlwaysOff=M0
-	SpeakerOnUntilCarrier=M1
-	SpeakerAlwaysOn=M2
-	SpeakerOnAfterUntilCarrier=M3
-	DialToneWaitModifier=W
-	CallProgress1=X1
-	CallProgress2=X2
-	CallProgress3=X3
-	CallProgress4=X4
-	EchoOff=E0
-	VerboseText=V1
-	QuietOff=Q0
-	QuietOn=Q1
-	DialCommandStateModifier=;
-	OnLine=O
-	ResetConfiguration=Z
-	ReturnToFactoryDefs=&F
-	DCDOnDuringLink=&C1
-	DTRHangUp=&D2
-	DSRAlwaysOn=&S0
-	RTSCTSHandshake=&K3
-	XonXoffHandshake=&K4
-	EscapeCharacter=+
-	EscapeGuardPeriod=S12
-	NoDialTone=NO DIAL TONE
-	Busy=BUSY
-	NoAnswer=NO ANSWER
-	Carrier=CARRIER
-	Connect=CONNECT
-	CompressionClass5=COMPRESSION:CLASS 5
-	CompressionV42bis=COMPRESSION:V.42 bis
-	CompressionNone=COMPRESSION:NONE
-	ProtocolLAPD=PROTOCOL:LAPD
-	ProtocolALT=PROTOCOL:ALT
-	ProtocolALTCELLULAR=PROTOCOL:ALT-CELLULAR
-	ProtocolNone=PROTOCOL:NONE
-	MessageCentreNumber=+44123456789
-	MessageValidityPeriod=1440
-	MessageDeliveryReport=FALSE
-	MinimumSignalLevel=9905
-	CommRole=0
-	SIRSettings=0
-	Agent=mRouterAgent.agt
-	FIELD_COUNT=69
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 13
-	Name=mRouterIrBearer
-	IfName=PPP
-	PortName=IRCOMM::0
-	TSYName=MM
-	CSYName=IRCOMM
-	LastSocketActivityTimeout=9999
-	LastSessionClosedTimeout=180
-	LastSocketClosedTimeout=30
-	DataBits=8
-	StopBits=1
-	Parity=NONE
-	Rate=115200
-	Handshaking=4
-	SpecialRate=0
-	XonChar=0
-	XoffChar=0
-	FaxClassPref=AUTO
-	SpeakerPref=NEVER
-	SpeakerVolPref=QUIET
-	ModemInitString=AT
-	DataInitString=AT
-	FaxInitString=AT
-	DialPauseLength=S8=
-	SpeakerVolContorlLow=L0
-	SpeakerVolControlMedium=L1
-	SpeakerVolControlHigh=L2
-	SpeakerAlwaysOff=M0
-	SpeakerOnUntilCarrier=M1
-	SpeakerAlwaysOn=M2
-	SpeakerOnAfterUntilCarrier=M3
-	DialToneWaitModifier=W
-	CallProgress1=X1
-	CallProgress2=X2
-	CallProgress3=X3
-	CallProgress4=X4
-	EchoOff=E0
-	VerboseText=V1
-	QuietOff=Q0
-	QuietOn=Q1
-	DialCommandStateModifier=;
-	OnLine=O
-	ResetConfiguration=Z
-	ReturnToFactoryDefs=&F
-	DCDOnDuringLink=&C1
-	DTRHangUp=&D2
-	DSRAlwaysOn=&S0
-	RTSCTSHandshake=&K3
-	XonXoffHandshake=&K4
-	EscapeCharacter=+
-	EscapeGuardPeriod=S12
-	NoDialTone=NO DIAL TONE
-	Busy=BUSY
-	NoAnswer=NO ANSWER
-	Carrier=CARRIER
-	Connect=CONNECT
-	CompressionClass5=COMPRESSION:CLASS 5
-	CompressionV42bis=COMPRESSION:V.42 bis
-	CompressionNone=COMPRESSION:NONE
-	ProtocolLAPD=PROTOCOL:LAPD
-	ProtocolALT=PROTOCOL:ALT
-	ProtocolALTCELLULAR=PROTOCOL:ALT-CELLULAR
-	ProtocolNone=PROTOCOL:NONE
-	MessageCentreNumber=+44123456789
-	MessageValidityPeriod=1440
-	MessageDeliveryReport=FALSE
-	MinimumSignalLevel=9905
-	CommRole=0
-	SIRSettings=0
-	Agent=mRouterAgent.agt
-	FIELD_COUNT=69
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 14
-	Name=mRouterBtBearer
-	IfName=PPP
-	PortName=BTCOMM::0
-	TSYName=MM
-	CSYName=BTCOMM
-	LastSocketActivityTimeout=9999
-	LastSessionClosedTimeout=180
-	LastSocketClosedTimeout=30
-	DataBits=8
-	StopBits=1
-	Parity=NONE
-	Rate=115200
-	Handshaking=4
-	SpecialRate=0
-	XonChar=0
-	XoffChar=0
-	FaxClassPref=AUTO
-	SpeakerPref=NEVER
-	SpeakerVolPref=QUIET
-	ModemInitString=AT
-	DataInitString=AT
-	FaxInitString=AT
-	DialPauseLength=S8=
-	SpeakerVolContorlLow=L0
-	SpeakerVolControlMedium=L1
-	SpeakerVolControlHigh=L2
-	SpeakerAlwaysOff=M0
-	SpeakerOnUntilCarrier=M1
-	SpeakerAlwaysOn=M2
-	SpeakerOnAfterUntilCarrier=M3
-	DialToneWaitModifier=W
-	CallProgress1=X1
-	CallProgress2=X2
-	CallProgress3=X3
-	CallProgress4=X4
-	EchoOff=E0
-	VerboseText=V1
-	QuietOff=Q0
-	QuietOn=Q1
-	DialCommandStateModifier=;
-	OnLine=O
-	ResetConfiguration=Z
-	ReturnToFactoryDefs=&F
-	DCDOnDuringLink=&C1
-	DTRHangUp=&D2
-	DSRAlwaysOn=&S0
-	RTSCTSHandshake=&K3
-	XonXoffHandshake=&K4
-	EscapeCharacter=+
-	EscapeGuardPeriod=S12
-	NoDialTone=NO DIAL TONE
-	Busy=BUSY
-	NoAnswer=NO ANSWER
-	Carrier=CARRIER
-	Connect=CONNECT
-	CompressionClass5=COMPRESSION:CLASS 5
-	CompressionV42bis=COMPRESSION:V.42 bis
-	CompressionNone=COMPRESSION:NONE
-	ProtocolLAPD=PROTOCOL:LAPD
-	ProtocolALT=PROTOCOL:ALT
-	ProtocolALTCELLULAR=PROTOCOL:ALT-CELLULAR
-	ProtocolNone=PROTOCOL:NONE
-	MessageCentreNumber=+44123456789
-	MessageValidityPeriod=1440
-	MessageDeliveryReport=FALSE
-	MinimumSignalLevel=9905
-	CommRole=0
-	SIRSettings=0
-	Agent=mRouterAgent.agt
-	FIELD_COUNT=69
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 15
-	Name=mRouterUsbBearer
-	IfName=PPP
-	PortName=ACM::0
-	TSYName=MM
-	CSYName=ECACM
-	LastSocketActivityTimeout=9999
-	LastSessionClosedTimeout=180
-	LastSocketClosedTimeout=30
-	DataBits=8
-	StopBits=1
-	Parity=NONE
-	Rate=115200
-	Handshaking=4
-	SpecialRate=0
-	XonChar=0
-	XoffChar=0
-	FaxClassPref=AUTO
-	SpeakerPref=NEVER
-	SpeakerVolPref=QUIET
-	ModemInitString=AT
-	DataInitString=AT
-	FaxInitString=AT
-	DialPauseLength=S8=
-	SpeakerVolContorlLow=L0
-	SpeakerVolControlMedium=L1
-	SpeakerVolControlHigh=L2
-	SpeakerAlwaysOff=M0
-	SpeakerOnUntilCarrier=M1
-	SpeakerAlwaysOn=M2
-	SpeakerOnAfterUntilCarrier=M3
-	DialToneWaitModifier=W
-	CallProgress1=X1
-	CallProgress2=X2
-	CallProgress3=X3
-	CallProgress4=X4
-	EchoOff=E0
-	VerboseText=V1
-	QuietOff=Q0
-	QuietOn=Q1
-	DialCommandStateModifier=;
-	OnLine=O
-	ResetConfiguration=Z
-	ReturnToFactoryDefs=&F
-	DCDOnDuringLink=&C1
-	DTRHangUp=&D2
-	DSRAlwaysOn=&S0
-	RTSCTSHandshake=&K3
-	XonXoffHandshake=&K4
-	EscapeCharacter=+
-	EscapeGuardPeriod=S12
-	NoDialTone=NO DIAL TONE
-	Busy=BUSY
-	NoAnswer=NO ANSWER
-	Carrier=CARRIER
-	Connect=CONNECT
-	CompressionClass5=COMPRESSION:CLASS 5
-	CompressionV42bis=COMPRESSION:V.42 bis
-	CompressionNone=COMPRESSION:NONE
-	ProtocolLAPD=PROTOCOL:LAPD
-	ProtocolALT=PROTOCOL:ALT
-	ProtocolALTCELLULAR=PROTOCOL:ALT-CELLULAR
-	ProtocolNone=PROTOCOL:NONE
-	MessageCentreNumber=+44123456789
-	MessageValidityPeriod=1440
-	MessageDeliveryReport=FALSE
-	MinimumSignalLevel=9905
-	CommRole=0
-	SIRSettings=0
-	Agent=mRouterAgent.agt
-	FIELD_COUNT=69
-END_ADD
-
-
-############################################################
-## LANBearer
-## 
-[LANBearer]
-ADD_SECTION
-# COMMDB_ID = 1
-	Name=EKA1 Assabet on-board Ethernet
-	IfName=ethint
-	LDDFilename=ethercard
-	LDDName=EtherCard
-	PDDFilename=EtherSmc
-	PDDName=EtherCard.Smc
-	PacketDriverName=EtherPkt.drv
-	LastSocketActivityTimeout=-1
-	LastSessionClosedTimeout=-1
-	LastSocketClosedTimeout=-1
-	Agent=nullagt.agt
-	FIELD_COUNT=11
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 2
-	Name=EKA2 Assabet on-board Ethernet
-	IfName=ethint
-	LDDFilename=enet
-	LDDName=Ethernet
-	PDDFilename=ethernet
-	PDDName=Ethernet.Assabet
-	PacketDriverName=EtherPkt.drv
-	LastSocketActivityTimeout=-1
-	LastSessionClosedTimeout=-1
-	LastSocketClosedTimeout=-1
-	Agent=nullagt.agt
-	FIELD_COUNT=11
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 3
-	Name=EKA1 emulator Ethernet
-	IfName=ethint
-	LDDFilename=ethercard
-	LDDName=Ethercard
-	PDDFilename=etherwins
-	PDDName=Ethercard.wins
-	PacketDriverName=EtherPkt.drv
-	LastSocketActivityTimeout=-1
-	LastSessionClosedTimeout=-1
-	LastSocketClosedTimeout=-1
-	Agent=nullagt.agt
-	FIELD_COUNT=11
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 4
-	Name=EKA2 emulator Ethernet
-	IfName=ethint
-	LDDFilename=enet
-	LDDName=Ethernet
-	PDDFilename=ethernet
-	PDDName=Ethernet.Wins
-	PacketDriverName=EtherPkt.drv
-	LastSocketActivityTimeout=-1
-	LastSessionClosedTimeout=-1
-	LastSocketClosedTimeout=-1
-	Agent=nullagt.agt
-	FIELD_COUNT=11
-END_ADD
-
-
-############################################################
-## Location
-## 
-[Location]
-ADD_TEMPLATE
-	Name=Default Location
-	IntlPrefixCode=+
-	NatPrefixCode=0
-	NatCode=44
-	Mobile=TRUE
-	UsePulseDial=FALSE
-	WaitForDialTone=FALSE
-	PauseAfterDialout=0
-	FIELD_COUNT=8
-END_TEMPLATE
-
-ADD_SECTION
-# COMMDB_ID = 2
-	Name=Office
-	IntlPrefixCode=00
-	NatPrefixCode=0
-	NatCode=44
-	AreaCode=171
-	DialOutCode=9,
-	Mobile=FALSE
-	UsePulseDial=FALSE
-	WaitForDialTone=FALSE
-	PauseAfterDialout=0
-	FIELD_COUNT=10
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 3
-	Name=Office Direct Dial
-	IntlPrefixCode=00
-	NatPrefixCode=0
-	NatCode=44
-	AreaCode=171
-	Mobile=FALSE
-	UsePulseDial=FALSE
-	WaitForDialTone=FALSE
-	PauseAfterDialout=0
-	FIELD_COUNT=9
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 4
-	Name=Mobile
-	IntlPrefixCode=+
-	NatPrefixCode=0
-	NatCode=44
-	Mobile=TRUE
-	UsePulseDial=FALSE
-	WaitForDialTone=FALSE
-	PauseAfterDialout=0
-	FIELD_COUNT=8
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 5
-	Name=Home
-	IntlPrefixCode=00
-	NatPrefixCode=0
-	NatCode=44
-	AreaCode=181
-	Mobile=FALSE
-	UsePulseDial=TRUE
-	WaitForDialTone=TRUE
-	PauseAfterDialout=0
-	FIELD_COUNT=9
-END_ADD
-
-
-############################################################
-## Chargecard
-## 
-[Chargecard]
-ADD_SECTION
-# COMMDB_ID = 1
-	Name=Dummy BT Chargecard
-	AccountNumber=144,12345678
-	Pin=0000
-	LocalRule=HG
-	NatRule=HFG
-	IntlRule=HEFG
-	FIELD_COUNT=6
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 2
-	Name=Dummy Mercury Chargecard
-	AccountNumber=0500800800,,12345678
-	Pin=****
-	LocalRule=HG
-	NatRule=J,K,0FG
-	IntlRule=HEFG
-	FIELD_COUNT=6
-END_ADD
-
-
-############################################################
-## GlobalSettings
-## 
-[GlobalSettings]
-ADD_SECTION
-# COMMDB_ID = 1
-	Name=DefaultRecordName-1
-	WAPAccessPoint=1
-	ConnectionAttempts=2
-	RedialAttempts=3
-	SmsBearer=1
-	SmsReceiveMode=2
-	GPRSAttachMode=1
-	AcceptIncomingGprs=1
-	GPRSClassCBearer=GSM
-	ModemForDataAndFax=2
-	ModemForPhoneServicesAndSMS=2
-	LocationForDataAndFax=2
-	LocationForPhoneServicesAndSMS=2
-	MaxMBufHeap=2
-	DefaultNetwork=1
-	BearerAvailabilityCheckTSY=mm
-	FIELD_COUNT=16
-END_ADD
-
-
-############################################################
-## DialOutISP
-## 
-[DialOutISP]
-ADD_TEMPLATE
-	Name=Default Dial Out ISP
-	DialResolution=TRUE
-	UseLoginScript=FALSE
-	PromptForLogin=TRUE
-	DisplayPCT=FALSE
-	IfPromptForAuth=TRUE
-	IfCallbackEnabled=FALSE
-	CallbackTimeout=0
-	IpAddrFromServer=TRUE
-	IpDNSAddrFromServer=TRUE
-	EnableIPHeaderComp=FALSE
-	EnableLCPExtension=FALSE
-	DisablePlainTextAuth=FALSE
-	EnableSWComp=FALSE
-	BearerService=0
-	BearerProtocol=UNSPECIFIED
-	RlpVersion=0
-	IwfToMs=0
-	MsToIwf=0
-	AckTimer=0
-	RetransmissionAttempts=0
-	ResequencePeriod=0
-	V42Compression=0
-	V42Codewords=0
-	V42MaxLength=0
-	Asymmetry=0
-	UserInitUpgrade=FALSE
-	UseEdge=FALSE
-	FIELD_COUNT=28
-END_TEMPLATE
-
-ADD_SECTION
-# COMMDB_ID = 2
-	Name=NT RAS
-	Description=Test
-	Type=INTERNETONLY
-	DialResolution=TRUE
-	UseLoginScript=TRUE
-	LoginScript=CHARMAP \[windows-1252\]\nLOOP 10\n{\nSEND "CLIENT"+<0x0d>\nWAIT 3\n{\n"SERVER" OK\n}\n}\nEXIT KErrNoAnswer$\n\nOK:\nEXIT\n
-	PromptForLogin=FALSE
-	DisplayPCT=FALSE
-	IfNetworks=ip
-	IfPromptForAuth=FALSE
-	IfAuthName=RasUser
-	IfAuthPass=pass
-	AuthRetries=0
-	IfCallbackEnabled=FALSE
-	CallbackTimeout=0
-	IpAddrFromServer=TRUE
-	IpDNSAddrFromServer=TRUE
-	EnableIPHeaderComp=FALSE
-	EnableLCPExtension=FALSE
-	DisablePlainTextAuth=FALSE
-	EnableSWComp=FALSE
-	BearerService=0
-	BearerProtocol=UNSPECIFIED
-	RlpVersion=0
-	IwfToMs=0
-	MsToIwf=0
-	AckTimer=0
-	RetransmissionAttempts=0
-	ResequencePeriod=0
-	V42Compression=0
-	V42Codewords=0
-	V42MaxLength=0
-	Asymmetry=0
-	UserInitUpgrade=FALSE
-	UseEdge=FALSE
-	FIELD_COUNT=35
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 3
-	Name=ISP01
-	Description=PlaceHolder for ISP01
-	Type=INTERNETONLY
-	DialResolution=TRUE
-	UseLoginScript=FALSE
-	PromptForLogin=FALSE
-	DisplayPCT=FALSE
-	IfNetworks=ip
-	IfPromptForAuth=TRUE
-	IfAuthName=xxx
-	IfAuthPass=yyy
-	AuthRetries=0
-	IfCallbackEnabled=FALSE
-	CallbackTimeout=0
-	IpAddrFromServer=TRUE
-	IpDNSAddrFromServer=TRUE
-	EnableIPHeaderComp=FALSE
-	EnableLCPExtension=FALSE
-	DisablePlainTextAuth=FALSE
-	EnableSWComp=FALSE
-	BearerService=0
-	BearerProtocol=UNSPECIFIED
-	RlpVersion=0
-	IwfToMs=0
-	MsToIwf=0
-	AckTimer=0
-	RetransmissionAttempts=0
-	ResequencePeriod=0
-	V42Compression=0
-	V42Codewords=0
-	V42MaxLength=0
-	Asymmetry=0
-	UserInitUpgrade=FALSE
-	UseEdge=FALSE
-	FIELD_COUNT=34
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 4
-	Name=ISP02
-	Description=PlaceHolder for ISP02
-	Type=INTERNETONLY
-	DialResolution=TRUE
-	UseLoginScript=FALSE
-	PromptForLogin=FALSE
-	DisplayPCT=FALSE
-	IfNetworks=ip
-	IfPromptForAuth=TRUE
-	IfAuthName=xxx
-	IfAuthPass=yyy
-	AuthRetries=0
-	IfCallbackEnabled=FALSE
-	CallbackTimeout=0
-	IpAddrFromServer=TRUE
-	IpDNSAddrFromServer=TRUE
-	EnableIPHeaderComp=FALSE
-	EnableLCPExtension=FALSE
-	DisablePlainTextAuth=FALSE
-	EnableSWComp=FALSE
-	BearerService=0
-	BearerProtocol=UNSPECIFIED
-	RlpVersion=0
-	IwfToMs=0
-	MsToIwf=0
-	AckTimer=0
-	RetransmissionAttempts=0
-	ResequencePeriod=0
-	V42Compression=0
-	V42Codewords=0
-	V42MaxLength=0
-	Asymmetry=0
-	UserInitUpgrade=FALSE
-	UseEdge=FALSE
-	FIELD_COUNT=34
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 5
-	Name=ISP03
-	Description=PlaceHolder for ISP03
-	Type=INTERNETONLY
-	DialResolution=TRUE
-	UseLoginScript=FALSE
-	PromptForLogin=FALSE
-	DisplayPCT=FALSE
-	IfNetworks=ip
-	IfPromptForAuth=TRUE
-	IfAuthName=xxx
-	IfAuthPass=yyy
-	AuthRetries=0
-	IfCallbackEnabled=FALSE
-	CallbackTimeout=0
-	IpAddrFromServer=TRUE
-	IpDNSAddrFromServer=TRUE
-	EnableIPHeaderComp=FALSE
-	EnableLCPExtension=FALSE
-	DisablePlainTextAuth=FALSE
-	EnableSWComp=FALSE
-	BearerService=0
-	BearerProtocol=UNSPECIFIED
-	RlpVersion=0
-	IwfToMs=0
-	MsToIwf=0
-	AckTimer=0
-	RetransmissionAttempts=0
-	ResequencePeriod=0
-	V42Compression=0
-	V42Codewords=0
-	V42MaxLength=0
-	Asymmetry=0
-	UserInitUpgrade=FALSE
-	UseEdge=FALSE
-	FIELD_COUNT=34
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 6
-	Name=ISP04
-	Description=PlaceHolder for ISP04
-	Type=INTERNETONLY
-	DialResolution=TRUE
-	UseLoginScript=FALSE
-	PromptForLogin=FALSE
-	DisplayPCT=FALSE
-	IfNetworks=ip
-	IfPromptForAuth=TRUE
-	IfAuthName=xxx
-	IfAuthPass=yyy
-	AuthRetries=0
-	IfCallbackEnabled=FALSE
-	CallbackTimeout=0
-	IpAddrFromServer=TRUE
-	IpDNSAddrFromServer=TRUE
-	EnableIPHeaderComp=FALSE
-	EnableLCPExtension=FALSE
-	DisablePlainTextAuth=FALSE
-	EnableSWComp=FALSE
-	BearerService=0
-	BearerProtocol=UNSPECIFIED
-	RlpVersion=0
-	IwfToMs=0
-	MsToIwf=0
-	AckTimer=0
-	RetransmissionAttempts=0
-	ResequencePeriod=0
-	V42Compression=0
-	V42Codewords=0
-	V42MaxLength=0
-	Asymmetry=0
-	UserInitUpgrade=FALSE
-	UseEdge=FALSE
-	FIELD_COUNT=34
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 7
-	Name=ISP05
-	Description=PlaceHolder for ISP05
-	Type=INTERNETONLY
-	DialResolution=TRUE
-	UseLoginScript=FALSE
-	PromptForLogin=FALSE
-	DisplayPCT=FALSE
-	IfNetworks=ip
-	IfPromptForAuth=TRUE
-	IfAuthName=xxx
-	IfAuthPass=yyy
-	AuthRetries=0
-	IfCallbackEnabled=FALSE
-	CallbackTimeout=0
-	IpAddrFromServer=TRUE
-	IpDNSAddrFromServer=TRUE
-	EnableIPHeaderComp=FALSE
-	EnableLCPExtension=FALSE
-	DisablePlainTextAuth=FALSE
-	EnableSWComp=FALSE
-	BearerService=0
-	BearerProtocol=UNSPECIFIED
-	RlpVersion=0
-	IwfToMs=0
-	MsToIwf=0
-	AckTimer=0
-	RetransmissionAttempts=0
-	ResequencePeriod=0
-	V42Compression=0
-	V42Codewords=0
-	V42MaxLength=0
-	Asymmetry=0
-	UserInitUpgrade=FALSE
-	UseEdge=FALSE
-	FIELD_COUNT=34
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 8
-	Name=mRouterDialOutIsp
-	Description=mRouterDialOutIsp
-	Type=INTERNETONLY
-	DialResolution=TRUE
-	UseLoginScript=FALSE
-	PromptForLogin=FALSE
-	DisplayPCT=FALSE
-	IfNetworks=ip
-	IfPromptForAuth=FALSE
-	IfAuthName=IfAuthPass=
-	IfAuthPass=AuthRetries=0
-	AuthRetries=0
-	IfCallbackEnabled=FALSE
-	CallbackTimeout=0
-	IpAddrFromServer=TRUE
-	IpDNSAddrFromServer=TRUE
-	EnableIPHeaderComp=FALSE
-	EnableLCPExtension=FALSE
-	DisablePlainTextAuth=FALSE
-	EnableSWComp=FALSE
-	BearerService=0
-	BearerProtocol=UNSPECIFIED
-	RlpVersion=0
-	IwfToMs=0
-	MsToIwf=0
-	AckTimer=0
-	RetransmissionAttempts=0
-	ResequencePeriod=0
-	V42Compression=0
-	V42Codewords=0
-	V42MaxLength=0
-	Asymmetry=0
-	UserInitUpgrade=FALSE
-	UseEdge=FALSE
-	FIELD_COUNT=34
-END_ADD
-
-
-############################################################
-## DialInISP
-## 
-[DialInISP]
-ADD_TEMPLATE
-	Name=Default Dial In ISP
-	UseLoginScript=FALSE
-	IpAddrFromServer=TRUE
-	IpDNSAddrFromServer=TRUE
-	EnableIPHeaderComp=FALSE
-	EnableLCPExtension=FALSE
-	DisablePlainTextAuth=FALSE
-	EnableSWComp=FALSE
-	UseEdge=FALSE
-	FIELD_COUNT=9
-END_TEMPLATE
-
-ADD_SECTION
-# COMMDB_ID = 2
-	Name=Dial In ISP01
-	UseLoginScript=FALSE
-	IpAddrFromServer=TRUE
-	IpDNSAddrFromServer=TRUE
-	EnableIPHeaderComp=FALSE
-	EnableLCPExtension=FALSE
-	DisablePlainTextAuth=FALSE
-	EnableSWComp=FALSE
-	UseEdge=FALSE
-	FIELD_COUNT=9
-END_ADD
-
-
-############################################################
-## OutgoingGPRS
-## 
-[OutgoingGPRS]
-ADD_SECTION
-# COMMDB_ID = 1
-	Name=GPRS01
-	APN=gprs01APNPlaceHolder
-	PDPType=IPV4
-	ReqPrecedence=0
-	ReqDelay=0
-	ReqReliability=0
-	ReqPeakThroughput=0
-	ReqMeanThroughput=0
-	MinPrecedence=0
-	MinDelay=0
-	MinReliability=0
-	MinPeakThroughput=0
-	MinMeanThroughput=0
-	DataCompression=FALSE
-	HeaderCompression=FALSE
-	GprsUseEdge=FALSE
-	AnonymousAccess=FALSE
-	IfNetworks=ip
-	IfPromptForAuth=FALSE
-	AuthRetries=1
-	IpAddrFromServer=TRUE
-	IpDNSAddrFromServer=FALSE
-	EnableLCPExtension=FALSE
-	DisablePlainTextAuth=FALSE
-	GprsAccessPointType=0
-	QosWarningTimeout=0
-	FIELD_COUNT=26
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 2
-	Name=GPRS02
-	APN=gprs02APNPlaceHolder
-	PDPType=IPV4
-	ReqPrecedence=0
-	ReqDelay=0
-	ReqReliability=0
-	ReqPeakThroughput=0
-	ReqMeanThroughput=0
-	MinPrecedence=0
-	MinDelay=0
-	MinReliability=0
-	MinPeakThroughput=0
-	MinMeanThroughput=0
-	DataCompression=FALSE
-	HeaderCompression=FALSE
-	GprsUseEdge=FALSE
-	AnonymousAccess=FALSE
-	IfNetworks=ip
-	IfPromptForAuth=FALSE
-	AuthRetries=1
-	IpAddrFromServer=TRUE
-	IpDNSAddrFromServer=FALSE
-	EnableLCPExtension=FALSE
-	DisablePlainTextAuth=FALSE
-	GprsAccessPointType=0
-	QosWarningTimeout=0
-	FIELD_COUNT=26
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 3
-	Name=GPRS03
-	APN=gprs03APNPlaceHolder
-	PDPType=IPV4
-	ReqPrecedence=0
-	ReqDelay=0
-	ReqReliability=0
-	ReqPeakThroughput=0
-	ReqMeanThroughput=0
-	MinPrecedence=0
-	MinDelay=0
-	MinReliability=0
-	MinPeakThroughput=0
-	MinMeanThroughput=0
-	DataCompression=FALSE
-	HeaderCompression=FALSE
-	GprsUseEdge=FALSE
-	AnonymousAccess=FALSE
-	IfNetworks=ip
-	IfPromptForAuth=FALSE
-	AuthRetries=1
-	IpAddrFromServer=TRUE
-	IpDNSAddrFromServer=FALSE
-	EnableLCPExtension=FALSE
-	DisablePlainTextAuth=FALSE
-	GprsAccessPointType=0
-	QosWarningTimeout=0
-	FIELD_COUNT=26
-END_ADD
-
-
-############################################################
-## IncomingGPRS
-## 
-[IncomingGPRS]
-ADD_SECTION
-# COMMDB_ID = 1
-	Name=Incoming GPRS Settings PlaceHolder
-	APN=Test
-	PDPType=IPV4
-	PDPAddress=0.0.0.0
-	ReqPrecedence=1
-	ReqDelay=1
-	ReqReliability=1
-	ReqPeakThroughput=1
-	ReqMeanThroughput=1
-	MinPrecedence=1
-	MinDelay=1
-	MinReliability=1
-	MinPeakThroughput=1
-	MinMeanThroughput=1
-	DataCompression=FALSE
-	HeaderCompression=FALSE
-	GprsUseEdge=FALSE
-	AnonymousAccess=FALSE
-	IfNetworks=ip
-	IfPromptForAuth=FALSE
-	IfAuthName=RasUser
-	IfAuthPass=pass
-	AuthRetries=1
-	IpAddrFromServer=TRUE
-	IpDNSAddrFromServer=TRUE
-	IpNameServer1=0.0.0.0
-	IpNameServer2=0.0.0.0
-	EnableLCPExtension=FALSE
-	DisablePlainTextAuth=FALSE
-	FIELD_COUNT=29
-END_ADD
-
-
-############################################################
-## DefaultGPRS
-## 
-[DefaultGPRS]
-ADD_SECTION
-# COMMDB_ID = 1
-	Name=Dummy Default GPRS Settings
-	Usage=1
-	APN=Access point name
-	PDPType=IPV6
-	PDPAddress=www.wid.com
-	Precedence=1
-	Delay=1
-	Reliability=1
-	PeakThroughput=1
-	MeanThroughput=1
-	MinPrecedence=1
-	MinDelay=1
-	MinReliability=1
-	MinPeakThroughput=1
-	MinMeanThroughput=1
-	DataCompression=TRUE
-	HeaderCompression=TRUE
-	GprsUseEdge=FALSE
-	AnonymousAccess=TRUE
-	FIELD_COUNT=19
-END_ADD
-
-
-############################################################
-## LANService
-## 
-[LANService]
-ADD_SECTION
-# COMMDB_ID = 1
-	Name=Ethernet
-	IfNetworks=ip,ip6
-	IpNetMask=255.255.255.0
-	IpGateway=194.72.6.1
-	IpAddrFromServer=TRUE
-	IpAddr=192.168.0.100
-	IpDNSAddrFromServer=FALSE
-	IpNameServer1=194.72.6.51
-	IpNameServer2=194.72.6.52
-	FIELD_COUNT=9
-END_ADD
-
-
-############################################################
-## IAP
-## 
-[IAP]
-ADD_SECTION
-# COMMDB_ID = 1
-	Name=NT RAS with Null Modem
-	IAPServiceType=DialOutISP
-	IAPService=2
-	IAPBearerType=ModemBearer
-	IAPBearer=2
-	IAPNetwork=1
-	IAPNetworkWeighting=0
-	Location=2
-	FIELD_COUNT=8
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 2
-	Name=CSD IAP PlaceHolder01
-	IAPServiceType=DialOutISP
-	IAPService=3
-	IAPBearerType=ModemBearer
-	IAPBearer=2
-	IAPNetwork=1
-	IAPNetworkWeighting=0
-	Location=2
-	FIELD_COUNT=8
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 3
-	Name=CSD IAP PlaceHolder02
-	IAPServiceType=DialOutISP
-	IAPService=4
-	IAPBearerType=ModemBearer
-	IAPBearer=2
-	IAPNetwork=1
-	IAPNetworkWeighting=0
-	Location=2
-	FIELD_COUNT=8
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 4
-	Name=GPRS IAP PlaceHolder01
-	IAPServiceType=OutgoingGPRS
-	IAPService=1
-	IAPBearerType=ModemBearer
-	IAPBearer=8
-	IAPNetwork=1
-	IAPNetworkWeighting=0
-	Location=4
-	FIELD_COUNT=8
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 5
-	Name=GPRS IAP PlaceHolder02
-	IAPServiceType=OutgoingGPRS
-	IAPService=2
-	IAPBearerType=ModemBearer
-	IAPBearer=8
-	IAPNetwork=1
-	IAPNetworkWeighting=0
-	Location=4
-	FIELD_COUNT=8
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 6
-	Name=mRouter Rs232
-	IAPServiceType=DialOutISP
-	IAPService=8
-	IAPBearerType=ModemBearer
-	IAPBearer=12
-	IAPNetwork=2
-	IAPNetworkWeighting=0
-	Location=2
-	FIELD_COUNT=8
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 7
-	Name=mRouter Ir
-	IAPServiceType=DialOutISP
-	IAPService=8
-	IAPBearerType=ModemBearer
-	IAPBearer=13
-	IAPNetwork=2
-	IAPNetworkWeighting=0
-	Location=2
-	FIELD_COUNT=8
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 8
-	Name=mRouter BT
-	IAPServiceType=DialOutISP
-	IAPService=8
-	IAPBearerType=ModemBearer
-	IAPBearer=14
-	IAPNetwork=2
-	IAPNetworkWeighting=0
-	Location=2
-	FIELD_COUNT=8
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 9
-	Name=mRouter USB
-	IAPServiceType=DialOutISP
-	IAPService=8
-	IAPBearerType=ModemBearer
-	IAPBearer=15
-	IAPNetwork=2
-	IAPNetworkWeighting=0
-	Location=2
-	FIELD_COUNT=8
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 10
-	Name=mRouter Wins
-	IAPServiceType=DialOutISP
-	IAPService=8
-	IAPBearerType=ModemBearer
-	IAPBearer=11
-	IAPNetwork=2
-	IAPNetworkWeighting=0
-	Location=2
-	FIELD_COUNT=8
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 11
-	Name=VPN IAP
-	IAPServiceType=VpnService
-	IAPService=2
-	IAPBearerType=VirtualBearer
-	IAPBearer=2
-	IAPNetwork=1
-	IAPNetworkWeighting=0
-	Location=2
-	FIELD_COUNT=8
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 12
-	Name=EKA1 Assabet on-board ethernet
-	IAPServiceType=LANService
-	IAPService=1
-	IAPBearerType=LANBearer
-	IAPBearer=1
-	IAPNetwork=1
-	IAPNetworkWeighting=0
-	Location=2
-	FIELD_COUNT=8
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 13
-	Name=EKA2 Assabet on-board ethernet
-	IAPServiceType=LANService
-	IAPService=1
-	IAPBearerType=LANBearer
-	IAPBearer=2
-	IAPNetwork=1
-	IAPNetworkWeighting=0
-	Location=2
-	FIELD_COUNT=8
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 14
-	Name=EKA1 emulator ethernet
-	IAPServiceType=LANService
-	IAPService=1
-	IAPBearerType=LANBearer
-	IAPBearer=3
-	IAPNetwork=1
-	IAPNetworkWeighting=0
-	Location=2
-	FIELD_COUNT=8
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 15
-	Name=EKA2 emulator ethernet
-	IAPServiceType=LANService
-	IAPService=1
-	IAPBearerType=LANBearer
-	IAPBearer=4
-	IAPNetwork=1
-	IAPNetworkWeighting=0
-	Location=2
-	FIELD_COUNT=8
-END_ADD
-
-
-############################################################
-## ConnectionPreferences
-## 
-[ConnectionPreferences]
-ADD_SECTION
-# COMMDB_ID = 1
-	Name=DefaultRecordName-1
-	Ranking=0
-	Direction=OUTGOING
-	BearerSet=CSD
-	DialogPref=PROMPT
-	IAP=1
-	FIELD_COUNT=6
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 2
-	Name=DefaultRecordName-2
-	Ranking=1
-	Direction=OUTGOING
-	BearerSet=CSD
-	DialogPref=PROMPT
-	IAP=1
-	FIELD_COUNT=6
-END_ADD
-
-
-############################################################
-## Proxies
-## 
-[Proxies]
-ADD_SECTION
-# COMMDB_ID = 1
-	Name=DefaultRecordName-1
-	ISP=2
-	ProxyServiceType=DialOutISP
-	UseProxyServer=TRUE
-	ProxyServerName=www.dummyproxy.com
-	ProtocolName=http
-	PortNumber=80
-	Exceptions=www.dummyproxy.com/exception
-	FIELD_COUNT=8
-END_ADD
-
-
-############################################################
-## WAPAccessPoint
-## 
-[WAPAccessPoint]
-ADD_TEMPLATE
-	Name=Default Dial In ISP
-	CurrentBearer=WAPIPBearer
-	FIELD_COUNT=2
-END_TEMPLATE
-
-ADD_SECTION
-# COMMDB_ID = 2
-	Name=Dummy WAP Settings
-	CurrentBearer=WAPIPBearer
-	StartPage=www.wapstart.com
-	FIELD_COUNT=3
-END_ADD
-
-
-############################################################
-## WAPIPBearer
-## 
-[WAPIPBearer]
-ADD_TEMPLATE
-	Name=DefaultRecordName-1
-	AccessPointId=0
-	IAP=0
-	WSPOption=CONNECTIONLESS
-	Security=FALSE
-	ProxyPortNumber=0
-	FIELD_COUNT=6
-END_TEMPLATE
-
-ADD_SECTION
-# COMMDB_ID = 2
-	Name=DefaultRecordName-2
-	AccessPointId=2
-	GatewayAddress=www.wapgateway.com
-	IAP=2
-	WSPOption=CONNECTIONORIENTED
-	Security=FALSE
-	ProxyPortNumber=1
-	FIELD_COUNT=7
-END_ADD
-
-
-############################################################
-## WAPSMSBearer
-## 
-[WAPSMSBearer]
-ADD_TEMPLATE
-	Name=DefaultRecordName-1
-	AccessPointId=0
-	WSPOption=CONNECTIONLESS
-	Security=FALSE
-	FIELD_COUNT=4
-END_TEMPLATE
-
-ADD_SECTION
-# COMMDB_ID = 2
-	Name=DefaultRecordName-2
-	AccessPointId=2
-	GatewayAddress=+4412345678901
-	ServiceCentreAddress=+442071234567
-	WSPOption=CONNECTIONORIENTED
-	Security=FALSE
-	FIELD_COUNT=6
-END_ADD
-
-
-############################################################
-## SecureSocketTable
-## 
-[SecureSocketTable]
-ADD_SECTION
-# COMMDB_ID = 1
-	Name=DefaultRecordName-1
-	ProtocolName=ssl3.0
-	ProtoLibrary=ssladaptor.dll
-	FIELD_COUNT=3
-END_ADD
-
-ADD_SECTION
-# COMMDB_ID = 2
-	Name=DefaultRecordName-2
-	ProtocolName=tls1.0
-	ProtoLibrary=ssladaptor.dll
-	FIELD_COUNT=3
-END_ADD
-
-
-############################################################
-## VirtualBearer
-## 
-[VirtualBearer]
-ADD_TEMPLATE
-	Name=Default VPN Bearer
-	IfName=VPN.nif
-	LastSocketActivityTimeout=180
-	LastSessionClosedTimeout=30
-	LastSocketClosedTimeout=60
-	Agent=VPN.agt
-	FIELD_COUNT=6
-END_TEMPLATE
-
-ADD_SECTION
-# COMMDB_ID = 2
-	Name=VPN Bearer1
-	IfName=ppp.nif
-	LastSocketActivityTimeout=-1
-	LastSessionClosedTimeout=-1
-	LastSocketClosedTimeout=-1
-	Agent=ntras.agt
-	FIELD_COUNT=6
-END_ADD
-
-
-############################################################
-## VpnService
-## 
-[VpnService]
-ADD_TEMPLATE
-	Name=Default VPN
-	Policy=DefaultVPNpolicy
-	HomeIAP=1
-	HomeNetwork=0
-	FIELD_COUNT=4
-END_TEMPLATE
-
-ADD_SECTION
-# COMMDB_ID = 2
-	Name=VPN1
-	Policy=VPNpolicy1
-	HomeIAP=2
-	HomeNetwork=1
-	FIELD_COUNT=4
-END_ADD
-
Binary file messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/sms.rsc has changed
--- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/testmsg.h	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,600 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- * 
- * Description:
- */
-
-#ifndef TEST_MSG_H
-#define TEST_MSG_H
-//Headers 
-#include <e32svr.h>
-#include <SMUTHDR.H>
-#include <msvapi.h>
-#include <smut.h>
-#include <msvstd.h>
-#include <rsendas.h>
-#include <rsendasmessage.h>
-#include <SMSCLNT.H>
-#include <csmsaccount.h> 
-//#include <MTMStore.h>
-#include <mtclreg.h>
-#include <mtclbase.h>
-#include <txtrich.h> 				// CRichText
-#include <msvids.h>            // for Message type IDs
-#include <mmsclient.h>       // for CMmsClientMtm
-#include <CMsvMimeHeaders.h>        //Attachemt mimeheader
-#include <MMsvAttachmentManager.h>  //Attachment manager
-#include <MMsvAttachmentManagerSync.h>
-#include <f32file.h>                //parse
-#include <utf.h>
-
-#include <e32base.h>
-#include <e32property.h>
-#include <simtsy.h>
-#include <etelmm.h>
-#include <es_ini.h>
-#include <commsdattypesv1_1.h>
-#include <commsdat.h>
-
-#include <Qtdebug>
-#include <xqconversions.h>
-#include "testsmsplugin.ini"
-
-using namespace CommsDat;
-
-const TInt KMsvTestUidPhonePwrValue = 0x100052C5;
-enum TMsvTestPhoneStatus
-    {
-    EMsvTestPhoneOff = 0,
-    EMsvTestPhoneOn
-    };
-
-class TestMsg : public MMsvSessionObserver
-{
-public:
-
-    TestMsg();
-    ~TestMsg();
-
-    void createSCSettings();
-
-    void createSMS();
-    void createMMS();
-
-    void deleteMessage(int msgId);
-
-    void initSimTsyL();
-
-public: //MMsvSessionObserver
-
-    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2,
-                             TAny* aArg3);
-
-private:
-
-    void initL();
-    void createSMSL(TMsvId aFolderId, TBool aUnReadFlag);
-    void createMMSL(TMsvId aFolderId, TBool aUnReadFlag);
-    void initializeSimTsyL(TInt aTestNumber, HBufC* aTsyName);
-
-private:
-
-    CMsvSession* iSession;
-    CClientMtmRegistry* iMtmRegistry;
-    CSmsClientMtm *smsClientMtm;
-};
-
-//---------------------------------------------------------------
-// TestMsg::TestMsg
-//---------------------------------------------------------------
-TestMsg::TestMsg()
-{
-    int err;
-    TRAP(err,initL());
-    #ifdef _DEBUG_TRACES_
-qDebug() << "Error in initialization:" << err;
-#endif
-
-}
-
-//---------------------------------------------------------------
-// TestMsg::TestMsg
-//---------------------------------------------------------------
-TestMsg::~TestMsg()
-{
-    if(smsClientMtm)
-    {
-        delete smsClientMtm;
-        smsClientMtm = NULL;
-    }
-    
-    if (iMtmRegistry)
-    {
-        delete iMtmRegistry;
-        iMtmRegistry = NULL;
-    }
-
-    if (iSession)
-    {
-        delete iSession;
-        iSession = NULL;
-    }
-}
-
-//---------------------------------------------------------------
-// TestMsg::createSCSettings
-//---------------------------------------------------------------
-void TestMsg::createSCSettings()
-{
-    smsClientMtm = static_cast<CSmsClientMtm*> (iMtmRegistry->NewMtmL(KUidMsgTypeSMS));
-
-    TMsvSelectionOrdering ordering;
-
-    CMsvEntry* root = CMsvEntry::NewL(smsClientMtm->Session(),
-                                      KMsvRootIndexEntryId,
-                                      ordering);
-
-    CSmsAccount* smsAccount = CSmsAccount::NewLC();
-
-    CSmsSettings* settings = CSmsSettings::NewL();
-    CleanupStack::PushL(settings);
-    smsAccount->LoadSettingsL(*settings);
-
-    TMsvEntry entry;
-    entry.iMtm = KUidMsgTypeSMS;
-    entry.iType = KUidMsvServiceEntry;
-    entry.SetReadOnly(EFalse);
-    entry.SetVisible(EFalse);
-    entry.iDate.UniversalTime();
-    entry.iDetails.Set(_L("Nokiatest"));
-
-    root->SetEntryL(KMsvRootIndexEntryId);
-    root->CreateL(entry);
-
-    QString serviceCenter01(SERVICE_CENTER_01);
-    QString serviceCenter02(SERVICE_CENTER_02);
-    HBufC* sC01 = XQConversions::qStringToS60Desc(serviceCenter01);
-    HBufC* sC02 = XQConversions::qStringToS60Desc(serviceCenter02);
-    CleanupStack::PushL(sC01);
-    CleanupStack::PushL(sC02);
-    settings->AddServiceCenterL(_L("Nokia"), *sC01);
-    settings->AddServiceCenterL(_L("Nokia"), *sC02);
-    CleanupStack::PopAndDestroy(sC02);
-    CleanupStack::PopAndDestroy(sC01);
-    settings->SetDefaultServiceCenter(1);
-    settings->SetValidityPeriod(ESmsVPWeek);
-    settings->SetReplyQuoted(ETrue);
-    settings->SetRejectDuplicate(ETrue);
-    settings->SetDelivery(ESmsDeliveryImmediately);
-    settings->SetDeliveryReport(EFalse);
-    settings->SetReplyPath(EFalse);
-    settings->SetMessageConversion(ESmsConvPIDNone);
-    settings->SetCanConcatenate(ETrue);
-    settings->SetCharacterSet(TSmsDataCodingScheme::ESmsAlphabet7Bit);
-    settings->SetValidityPeriodFormat(TSmsFirstOctet::ESmsVPFInteger);
-    settings->SetStatusReportHandling(CSmsSettings::EMoveReportToInboxVisible);
-    settings->SetSpecialMessageHandling(CSmsSettings::EMoveReportToInboxVisible);
-    settings->SetSmsBearer(CSmsSettings::ESmsBearerCircuitPreferred);
-    settings->SetCommDbAction(CSmsSettings::ENone);
-    settings->SetSmsBearerAction(CSmsSettings::ENone);
-    smsAccount->SaveSettingsL(*settings);
-
-    CleanupStack::PopAndDestroy(settings);
-    CleanupStack::PopAndDestroy(smsAccount);
-}
-
-//---------------------------------------------------------------
-// TestMsg::createSMS
-//---------------------------------------------------------------
-void TestMsg::createSMS()
-{
-    int err;
-    TRAP(err,createSMSL(KMsvGlobalInBoxIndexEntryId,ETrue));
-    #ifdef _DEBUG_TRACES_
-qDebug() << "Error in creating SMS:" << err;
-#endif
-
-}
-
-//---------------------------------------------------------------
-// TestMsg::createMMS
-//---------------------------------------------------------------
-void TestMsg::createMMS()
-{
-    int err;
-    TRAP(err,createMMSL(KMsvGlobalInBoxIndexEntryId,ETrue));
-    #ifdef _DEBUG_TRACES_
-qDebug() << "Error in creating MMS:" << err;
-#endif
-
-}
-
-//---------------------------------------------------------------
-// TestMsg::initL
-//---------------------------------------------------------------
-void TestMsg::initL()
-{
-    iSession = CMsvSession::OpenSyncL(*this);
-    iMtmRegistry = CClientMtmRegistry::NewL(*iSession);
-}
-
-//---------------------------------------------------------------
-// TestMsg::createSMSL
-//---------------------------------------------------------------
-void TestMsg::createSMSL(TMsvId aFolderId, TBool aUnReadFlag)
-{
-    CSmsClientMtm *smsClientMtm =
-            static_cast<CSmsClientMtm*> (iMtmRegistry->NewMtmL(KUidMsgTypeSMS));
-    CleanupStack::PushL(smsClientMtm);
-    //Create entry from this index entry
-
-    smsClientMtm->SwitchCurrentEntryL(aFolderId);
-    smsClientMtm->CreateMessageL(KUidMsgTypeSMS.iUid);
-    TMsvEntry indexEntry = smsClientMtm->Entry().Entry();
-    indexEntry.SetInPreparation(ETrue);
-    indexEntry.iMtm = KUidMsgTypeSMS;
-    indexEntry.iType = KUidMsvMessageEntry;
-    indexEntry.iServiceId = smsClientMtm->ServiceId();
-    indexEntry.iDate.HomeTime();
-    //AddBody
-    QString body(TEST_MSG_BODY);
-
-    HBufC* bodyText = XQConversions::qStringToS60Desc(body);
-    if (bodyText)
-    {
-        CleanupStack::PushL(bodyText);
-        CRichText & body = smsClientMtm->Body();
-        body.Reset();
-        body.InsertL(0, *bodyText);
-
-        TBuf<32> buf;
-        buf.Copy(bodyText->Left(32));
-        indexEntry.iDescription.Set(buf);
-
-        CleanupStack::PopAndDestroy(bodyText);
-    }
-
-    // Add addressee
-    //Add Address
-    QString recipient(TEST_MSG_FROM1);
-    // convert from QString to HBufC 
-    HBufC* addr = XQConversions::qStringToS60Desc(recipient);
-    if (addr)
-    {
-        CleanupStack::PushL(addr);
-        TBuf<32> name;
-        name.Copy(addr->Left(32));
-        indexEntry.iDetails.Set(name);
-
-        if (aFolderId == KMsvDraftEntryId || aFolderId
-                == KMsvGlobalOutBoxIndexEntryId)
-        {
-            smsClientMtm->AddAddresseeL(*addr, TPtrC());
-            indexEntry.SetSendingState(KMsvSendStateWaiting);
-        }
-        else if (aFolderId == KMsvSentEntryId || aFolderId
-                == KMsvGlobalInBoxIndexEntryId)
-        {
-            CSmsHeader& smsHeader = smsClientMtm->SmsHeader();
-            smsHeader.SetFromAddressL(*addr);
-        }
-        CleanupStack::PopAndDestroy(addr);
-    }
-
-    // final fine tuning
-    indexEntry.SetAttachment(EFalse);
-    indexEntry.SetVisible(ETrue);
-    indexEntry.SetInPreparation(EFalse);
-
-    if (aFolderId == KMsvGlobalInBoxIndexEntryId)
-    {
-        if (aUnReadFlag)
-        {
-            indexEntry.SetUnread(ETrue);
-        }
-        indexEntry.SetNew(ETrue);
-    }
-    indexEntry.SetComplete(ETrue);
-    smsClientMtm->Entry().ChangeL(indexEntry);
-    smsClientMtm->SaveMessageL();
-
-    CleanupStack::PopAndDestroy(smsClientMtm);
-}
-
-//---------------------------------------------------------------
-// TestMsg::createMMSL
-//---------------------------------------------------------------
-void TestMsg::createMMSL(TMsvId aFolderId, TBool aUnReadFlag)
-{
-    CMmsClientMtm
-            *mmsClientMtm =
-                    static_cast<CMmsClientMtm*>
-    (iMtmRegistry->NewMtmL(KUidMsgTypeMultimedia));
-    CleanupStack::PushL(mmsClientMtm);
-    //Create entry from this index entry
-
-    mmsClientMtm->SwitchCurrentEntryL(aFolderId);
-    mmsClientMtm->CreateMessageL(mmsClientMtm->DefaultServiceL());
-
-    TMsvEntry indexEntry = mmsClientMtm->Entry().Entry();
-    indexEntry.SetInPreparation(ETrue);
-    indexEntry.iMtm = KUidMsgTypeMultimedia;
-    indexEntry.iType = KUidMsvMessageEntry;
-    indexEntry.iServiceId = mmsClientMtm->DefaultServiceL();
-    indexEntry.iDate.HomeTime();
-
-    //Subject
-    QString subject(TEST_MSG_SUBJECT);
-
-    HBufC* sub = XQConversions::qStringToS60Desc(subject);
-    if (sub)
-    {
-        CleanupStack::PushL(sub);
-
-        TBuf<32> buf;
-        buf.Copy(sub->Left(32));
-        indexEntry.iDescription.Set(buf);
-
-        mmsClientMtm->SetSubjectL(*sub);
-        CleanupStack::PopAndDestroy(sub);
-    }
-
-    // Add addressee
-    //Add Address
-    QString recipient(TEST_MSG_FROM1);
-    // convert from QString to HBufC 
-    HBufC* addr = XQConversions::qStringToS60Desc(recipient);
-    if (addr)
-    {
-        CleanupStack::PushL(addr);
-        TBuf<32> name;
-        name.Copy(addr->Left(32));
-        indexEntry.iDetails.Set(name);
-
-        if (aFolderId == KMsvDraftEntryId || aFolderId
-                == KMsvGlobalOutBoxIndexEntryId)
-        {
-            mmsClientMtm->AddAddresseeL(*addr);
-            indexEntry.SetSendingState(KMsvSendStateWaiting);
-        }
-        else if (aFolderId == KMsvSentEntryId || aFolderId
-                == KMsvGlobalInBoxIndexEntryId)
-        {
-            mmsClientMtm->SetSenderL(*addr);
-            mmsClientMtm->AddAddresseeL(*addr);
-        }
-        CleanupStack::PopAndDestroy(addr);
-    }
-
-    // final fine tuning
-    indexEntry.SetVisible(ETrue);
-    indexEntry.SetInPreparation(EFalse);
-
-    if (aFolderId == KMsvGlobalInBoxIndexEntryId)
-    {
-        if (aUnReadFlag)
-        {
-            indexEntry.SetUnread(ETrue);
-        }
-        indexEntry.SetNew(ETrue);
-    }
-
-    //body text
-    QString bodyText(TEST_MSG_BODY);
-    HBufC* text = XQConversions::qStringToS60Desc(bodyText);
-    if (text)
-    {
-        CleanupStack::PushL(text);
-
-        //we may need some conversion of text here
-        const TInt KMmsMaxBytesPerCharacter = 4;
-        HBufC8* buffer = HBufC8::NewL( text->Length() * KMmsMaxBytesPerCharacter );
-        CleanupStack::PushL( buffer );
-        TPtr8 buf8 = buffer->Des();
-
-        // get an access to the message store
-        CMsvStore* store = mmsClientMtm->Entry().EditStoreL();
-        CleanupStack::PushL(store);
-
-        CMsvMimeHeaders* mimeHeaders = CMsvMimeHeaders::NewL();
-        CleanupStack::PushL( mimeHeaders );
-
-        CMsvAttachment* attaInfo = CMsvAttachment::NewL(CMsvAttachment::EMsvFile);
-        CleanupStack::PushL( attaInfo );
-
-        TPtrC8 contentType;
-        contentType.Set( KMmsTextPlain );
-
-        TInt position = contentType.Find( KMmsSlash8 );
-        mimeHeaders->SetContentTypeL( contentType.Left( position ) );
-        mimeHeaders->SetContentSubTypeL( contentType.Mid( position + 1 ) );
-        attaInfo->SetMimeTypeL( contentType );
-        attaInfo->SetAttachmentNameL( _L("body.txt") );
-
-        mimeHeaders->SetMimeCharset( KMmsUtf8 );
-        mimeHeaders->SetSuggestedFilenameL( _L("body.txt") );
-
-        // if conversion fails, something is really seriously wrong
-        TInt error = CnvUtfConverter::ConvertFromUnicodeToUtf8( buf8, *text );
-
-        attaInfo->SetSize( buf8.Length() );
-        mimeHeaders->StoreL( *attaInfo ); // Mime headers are streamed into atta info
-
-        MMsvAttachmentManagerSync& attaManSync = store->AttachmentManagerExtensionsL();
-        RFile textFile;
-
-        attaManSync.CreateAttachmentL( _L("body.txt"), textFile, attaInfo );
-        CleanupStack::Pop( attaInfo ); //ownership was transferred.
-
-        CleanupClosePushL( textFile );
-
-        //get attachement id, we need it incase of failure
-        TMsvAttachmentId attachmentId = attaInfo->Id();
-        // Now our file handle is open for writing
-        if ( buf8.Length()> 0 )
-        {
-            textFile.Write( buf8 );
-            error = textFile.Flush();
-        }
-        // we must always close
-        CleanupStack::PopAndDestroy( &textFile ); // close textFile
-        CleanupStack::PopAndDestroy( mimeHeaders );
-
-        store->CommitL();
-        CleanupStack::PopAndDestroy(store);
-        CleanupStack::PopAndDestroy( buffer );
-        CleanupStack::PopAndDestroy(text);
-    }
-
-    indexEntry.SetComplete(ETrue);
-    mmsClientMtm->Entry().ChangeL(indexEntry);
-    mmsClientMtm->SaveMessageL();
-
-    // cleanup    
-    CleanupStack::PopAndDestroy(mmsClientMtm);
-}
-
-void TestMsg::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/,
-                                  TAny* /*aArg2*/, TAny* /*aArg3*/)
-{
-}
-
-void TestMsg::deleteMessage(int msgId)
-{
-    CMsvEntry* cEntry = iSession->GetEntryL(KMsvGlobalInBoxIndexEntryId);
-    CleanupStack::PushL(cEntry);
-
-    CMsvEntry* entry = iSession->GetEntryL(msgId);
-    CleanupStack::PushL(entry);
-
-    TMsvEntry tEntry = entry->Entry();
-    tEntry.SetReadOnly(EFalse);
-    entry->ChangeL(tEntry);
-
-    cEntry->DeleteL(msgId);
-    CleanupStack::PopAndDestroy(entry);
-    CleanupStack::PopAndDestroy(cEntry);
-
-}
-
-void TestMsg::initSimTsyL()
-{
-    _LIT(KDefaultTsyName, "SIM");
-    TPtrC defaultTsyName(KDefaultTsyName);
-    HBufC* defaultTsyNameBuf = defaultTsyName.AllocLC();
-    TInt testNumber = 0;
-
-    initializeSimTsyL(testNumber, defaultTsyNameBuf);
-
-    CMDBSession* dbSession = CMDBSession::NewL(CMDBSession::LatestVersion());
-    CleanupStack::PushL(dbSession);
-
-    CMDBRecordLink<CCDModemBearerRecord>
-            *modemBearerRecordSet = new (ELeave) CMDBRecordLink<
-                    CCDModemBearerRecord> (KCDTIdGlobalSettingsRecord
-                    | KCDTIdModemPhoneServicesSMS);
-    CleanupStack::PushL(modemBearerRecordSet);
-
-    modemBearerRecordSet->SetRecordId(1);
-    //Load field container with data from database
-    TRAPD(err, modemBearerRecordSet->LoadL(*dbSession));
-    CCDModemBearerRecord
-            *modemRecord =
-                    static_cast<CCDModemBearerRecord*>
-    (CCDRecordBase::RecordFactoryL(KCDTIdModemBearerRecord));
-    CleanupStack::PushL(modemRecord);
-
-    /*!
-     * Set the record ID to that previously read from
-     * CCDGlobalSettingsRecord.iModemForPhoneServicesAndSMS
-     */
-    modemRecord->SetRecordId(*modemBearerRecordSet);
-
-    //Load record container with data from database
-    modemRecord->LoadL(*dbSession);
-
-    modemRecord->iTsyName.SetMaxLengthL(defaultTsyNameBuf->Des().Length());
-    modemRecord->iTsyName = defaultTsyNameBuf->Des();
-    modemRecord->ModifyL(*dbSession);
-
-    CleanupStack::PopAndDestroy(4);
-}
-
-void TestMsg::initializeSimTsyL(TInt aTestNumber, HBufC* aTsyName)
-{
-    //Initialize TSY using the System Agent
-    TInt testState;
-    if (KErrNone != RProperty::Get(KUidPSSimTsyCategory,
-                                   KPSSimTsyTestNumber,
-                                   testState))
-    {
-        User::LeaveIfError(RProperty::Define(KUidPSSimTsyCategory,
-                                             KPSSimTsyTestNumber,
-                                             RProperty::EInt));
-    }
-
-    User::LeaveIfError(RProperty::Set(KUidPSSimTsyCategory,
-                                      KPSSimTsyTestNumber,
-                                      aTestNumber));
-    if (KErrNone != RProperty::Get(KUidSystemCategory,
-                                   KMsvTestUidPhonePwrValue,
-                                   testState))
-    {
-        User::LeaveIfError(RProperty::Define(KUidSystemCategory,
-                                             KMsvTestUidPhonePwrValue,
-                                             RProperty::EInt));
-    }
-    User::LeaveIfError(RProperty::Set(KUidSystemCategory,
-                                      KMsvTestUidPhonePwrValue,
-                                      EMsvTestPhoneOn));
-
-    User::LeaveIfError(RProperty::Get(KUidPSSimTsyCategory,
-                                      KPSSimTsyTestNumber,
-                                      aTestNumber));
-
-    RTelServer etelServer;
-    TInt err = etelServer.Connect();
-
-    if (err != KErrNone)
-    {
-        return;
-    }
-    User::LeaveIfError(etelServer.LoadPhoneModule(aTsyName->Des()));
-
-    /*!
-     * Find the phone corresponding to this TSY and open a number of
-     * handles on it
-     */
-    TInt numPhones;
-    User::LeaveIfError(etelServer.EnumeratePhones(numPhones));
-    TBool found = EFalse;
-
-    RMobilePhone iPhone;
-    while (!found && numPhones--)
-    {
-        TName phoneTsy;
-        User::LeaveIfError(etelServer.GetTsyName(numPhones, phoneTsy));
-        if (phoneTsy.CompareF(aTsyName->Des()) == KErrNone)
-        {
-            found = ETrue;
-            RTelServer::TPhoneInfo info;
-            User::LeaveIfError(etelServer.GetPhoneInfo(numPhones, info));
-            CleanupClosePushL(iPhone);
-            User::LeaveIfError(iPhone.Open(etelServer, info.iName));
-            User::LeaveIfError(iPhone.Initialise());
-            CleanupStack::PopAndDestroy(&iPhone);
-        }
-    }
-}
-
-#endif //TEST_MSG_H
--- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/testsmsplugin.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,249 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- * 
- * Description:
- */
-
-#include "testsmsplugin.h"
-#include <QtTest/QtTest>
-#include "debugtraces.h"
-
-#include <QTimer>
-#include <QSignalSpy>
-
-#include "convergedmessage.h"
-#include "TestMsg.h"
-#include "convergedmessageid.h"
-#include "unieditorsmsplugin.h"
-#include "messageserviceaction.h"
-//---------------------------------------------------------------
-// TestSmsPlugin::initTestCase
-//---------------------------------------------------------------
-void TestSmsPlugin::initTestCase()
-{
-    msgPlugin = new UniEditorSmsPlugin();
-    testMsg = new TestMsg();
-  //  QVERIFY(msgPlugin != 0);
-    smsId = -1;
-    mmsId = -1;
-}
-
-//---------------------------------------------------------------
-// TestSmsPlugin::cleanupTestCase
-//---------------------------------------------------------------
-void TestSmsPlugin::cleanupTestCase()
-{
-    delete msgPlugin;
-    delete testMsg;
-}
-
-//---------------------------------------------------------------
-// TestSmsPlugin::init
-//---------------------------------------------------------------
-
-void TestSmsPlugin::init()
-{
-}
-
-//---------------------------------------------------------------
-// TestSmsPlugin::cleanup
-//---------------------------------------------------------------
-void TestSmsPlugin::cleanup()
-{
-}
-
-//---------------------------------------------------------------
-// TestSmsPlugin::testSendSMS
-//---------------------------------------------------------------
-void TestSmsPlugin::testSendReceiveSMS()
-{ 
-    testMsg->createSCSettings();
-    
-    testMsg->initSimTsyL();
-    //TODO: Should uncomment the watcher code below while executing the test case in text shell mode. 
-    //Also the watcher code should be commented while executing in UI mode.
-  /*  RProcess watcherProcess;
-    _LIT(KWatcherExe, "z:\\system\\libs\\watcher.exe");
-    User::LeaveIfError(watcherProcess.Create(KWatcherExe, KNullDesC));
-    watcherProcess.Resume();
-    QTest::qWait(5000);*/
-    TBool result = msgPlugin->validateService(ETrue);
-    result = msgPlugin->validateService(EFalse);
-    result = msgPlugin->isServiceValid();
-    createAndSend(msgPlugin->messageType());
-    testReceived(msgPlugin->messageType());
-}
-
-//---------------------------------------------------------------
-// TestSmsPlugin::createAndSend
-//---------------------------------------------------------------
-void TestSmsPlugin::createAndSend(int type)
-{
-
-    ConvergedMessage message;
-    message.setMessageType((ConvergedMessage::MessageType) type);
-    message.setBodyText(QString(TEST_MSG_BODY));
-    ConvergedMessageAddress address1;
-    address1.setAddress(QString(TEST_MSG_TO3));
-    
-    message.addToRecipient(address1);
-    message.setPriority(ConvergedMessage::Normal);
-    if (type == ConvergedMessage::Mms)
-    {
-        ConvergedMessageAddress address2;
-        address2.setAddress(QString(TEST_MSG_FROM2));
-        address2.setAlias(QString(TEST_MSG_ALIAS2));
-        message.addCcRecipient(address2);
-        message.addBccRecipient(address2);
-
-        message.setSubject(QString(TEST_MSG_SUBJECT));
-        message.setPriority(ConvergedMessage::Normal);
-    }
-
-    int ret = -1;
-    QBENCHMARK 
-    {
-    long int id = msgPlugin->convertTo(&message);
-    msgPlugin->send(id);
-    }
-}
-	
-//---------------------------------------------------------------
-// TestSmsPlugin::testReceived
-//---------------------------------------------------------------
-void TestSmsPlugin::testReceived(int type)
-{
-MessageServiceAction* messageAction = new MessageServiceAction(this);    
-    QVERIFY(messageAction != 0);
-
-    //register user defined object to meta system.
-    qRegisterMetaType<ConvergedMessage*>("ConvergedMessage*");
-
-    //signal spy.
-    //listen to added event
-    QSignalSpy spyAdd( messageAction,
-            SIGNAL(messageAdded(ConvergedMessage*, QString)));
-    //signal spy.
-    //listen to updated event
-        QSignalSpy spyUpdate( messageAction,
-                SIGNAL(messageUpdated(ConvergedMessage*, QString)));
-    //will force stub_clientmanager to emit messageUpdated.
-    messageAction->registerForNotification();
-    //register user defined object to meta system.
-
-    // wait for the response to come
-    QTest::qWait(5000);
-
-    //check signals
-    int countAdd = -1;
-    countAdd = spyAdd.count();
-
-    ConvergedMessage* message = 0;
-    QString serviceId("");
-    
-    if (countAdd)
-    {
-        //verify added event
-        void * temp = const_cast<void*> (spyAdd.at(0).at(0).data());
-        message = *reinterpret_cast<ConvergedMessage*(*)> (temp);
-        serviceId = spyAdd.at(0).at(1).toString();
-        QVERIFY(message != 0);
-        validateMsg(*message, serviceId);
-    }
-
-    int countUpdate = -1;
-    countUpdate = spyUpdate.count();
-    message = 0;
-
-    for (int i = countUpdate; i > 0; --i)
-    {
-        //verify updated event
-        void * temp = const_cast<void*> (spyUpdate.at(i-1).at(0).data());
-        message = *reinterpret_cast<ConvergedMessage*(*)> (temp);
-        if (ConvergedMessage::Inbox == message->location())
-        {
-            serviceId = spyUpdate.at(i-1).at(1).toString();
-            break;
-        }
-    }
-    if (message)
-    {
-        validateMsg(*message, serviceId);
-    }
-    delete message;
-}
-
-//---------------------------------------------------------------
-// TestSmsPlugin::validateMsg
-//---------------------------------------------------------------
-void TestSmsPlugin::validateMsg(const ConvergedMessage& message,
-                                const QString& serviceId)
-{
-#ifdef _DEBUG_TRACES_
-		qDebug() << "....message received.....";
-#endif
-
-    //process incoming messages
-    if (message.location() == ConvergedMessage::Inbox)
-    {
-        int msgId;
-        if (message.id())
-        {
-            msgId = message.id()->getId();
-        }
-        ConvergedMessageAddressList array = message.toAddressList();
-        if (array.count() > 0)
-        {
-            if (array[0])
-                QCOMPARE(array[0]->address(),QString(TEST_MSG_FROM1));
-        }
-        ConvergedMessageAddress *fromAddr = message.fromAddress();
-        if (fromAddr)
-        {
-            QCOMPARE(fromAddr->address(),QString(TEST_MSG_FROM1));
-        }
-
-        QCOMPARE(serviceId,QString(TEST_SERVICE_ID));
-
-        if (message.messageType() == ConvergedMessage::Mms)
-        {
-            mmsId = msgId;
-            QCOMPARE(message.subject(), QString(TEST_MSG_SUBJECT));
-        }
-        else if (message.messageType() == ConvergedMessage::Sms)
-        {
-            smsId = msgId;
-            QCOMPARE(message.bodyText(), QString(TEST_MSG_BODY));
-        }
-    }
-    else if (message.location() == ConvergedMessage::Sent)
-    {
-        ConvergedMessageAddressList array = message.toAddressList();
-        if (array.count() > 0)
-        {
-            if (array[0])
-                QCOMPARE(array[0]->address(),QString(TEST_MSG_FROM1));
-        }
-
-        QCOMPARE(serviceId,QString(TEST_SERVICE_ID));
-
-        if (message.messageType() == ConvergedMessage::Mms)
-        {
-            QCOMPARE(message.subject(), QString(TEST_MSG_SUBJECT));
-        }
-        else if (message.messageType() == ConvergedMessage::Sms)
-        {
-            QCOMPARE(message.bodyText(), QString(TEST_MSG_BODY));
-        }
-    }
-}
--- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/testsmsplugin.h	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- * 
- * Description:
- */
-
-#ifndef TEST_SMS_PLUGIN_H
-#define TEST_SMS_PLUGIN_H
-
-#ifdef BUILD_TEST_DLL
-#define TEST_EXPORT Q_DECL_EXPORT
-#else
-#define TEST_EXPORT Q_DECL_IMPORT
-#endif
-
-#include <QObject>
-#include <e32const.h>
-
-class UniEditorSmsPlugin;
-class ConvergedMessage;
-class TestMsg;
-
-class TEST_EXPORT TestSmsPlugin: public QObject
-    {
-    Q_OBJECT
-
-private slots:
-    //called by frame work.
-    void initTestCase();//called before the first testfunction is executed.
-    void cleanupTestCase();//called after the last testfunction was executed.
-    void init();//called before each testfunction is executed.
-    void cleanup();//called after every testfunction.
-
-    //test cases.
-    void testSendReceiveSMS(); //test sending & Receiveig of sms
-
-private:
-    void createAndSend(int type);
-    void testReceived(int type);
-    void validateMsg(const ConvergedMessage& message, const QString& serviceId);
-    
-private:
-    UniEditorSmsPlugin* msgPlugin;
-    TestMsg *testMsg;
-    int smsId;
-    int mmsId;
-    };
-#endif //TEST_SMS_PLUGIN_H
--- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/testsmsplugin.ini	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-//this file is used to provide predefined set of input data.
-
-//eg.
-const char TEST_SERVICE_SMS[]     = "SMS";
-const char TEST_SERVICE_ID[]      = "messaging.mserver";
-const char TEST_SERVICE_SMS_ID[]  = "messaging.mserver.sms";
-const char TEST_SERVICE_MMS_ID[]  = "messaging.mserver.mms";
-const char TEST_SERVICE_MMS[]     = "MMS";
-const char TEST_MSG_BODY[]        = "TestTextE_1_2";
-const char TEST_MSG_RECIEPIENT[]  = "Javaid Nabi<+919741596546>";
-const char TEST_MSG_FROM1[]       = "+44111111111";
-const char SERVICE_CENTER_01[]    = "+447802000332";
-const char SERVICE_CENTER_02[]    = "+919845087001";
-const char TEST_MSG_ALIAS1[]      = "Javaid Nabi";
-const char TEST_MSG_FROM2[]       = "9797979797";
-const char TEST_MSG_ALIAS2[]      = "Rajesh Batchu";
-const char TEST_MSG_SUBJECT[]     = "Message Subject";
-const char TEST_SERVICE_NAME_MMS[] 	= "messaging.mserver.testservice.MMS";
-const char TEST_SENDER[]			= "DummySender";
-const char TEST_ATTACHMENT[]		= "c:/sample.txt";
-const char TEST_ATTACHMENT2[]		= "c:/HelloWorld.smil";
-const char TEST_ATTACHMENT3[]		= "c:/ImageFile.smil";
-const char TEST_ATTACHMENT4[]		= "c:/SmileyFace.gif";
-const char TEST_ATTACHMENT5[]		= "c:/testfile.txt";
-const char TEST_MSG_TO3[]       = "SS<+44111111111>";
-const char TEST_CC[]			= "DummyCCAddress";
-const char TEST_BCC[]			= "DummyBCCAddress";
\ No newline at end of file
--- a/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/testsmsplugin.pro	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:
-#
-
-QT += testlib
-QT -= gui
-
-TEMPLATE = lib
-TARGET = test-sms-plugin
-
-
-INCLUDEPATH += .
-INCLUDEPATH += ../../../../../../inc
-INCLUDEPATH += ../../../../unieditorutils/inc
-INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-
-DEFINES += BUILD_TEST_DLL
-
-SOURCES += \
-  testsmsplugin.cpp \
-  ../../src/unieditorsmsplugin.cpp \
-  ../../src/unieditorsmsplugin_p.cpp  
-         
-
-# Input
-HEADERS += \
-  testsmsplugin.h \
-  testmsg.h \
-  ../../inc/unieditorsmsplugin.h \
-  ../../inc/unieditorsmsplugin_p.h 
-               
-   
-SYMBIAN_PLATFORMS = WINSCW ARMV5
-    symbian {
-    TARGET.CAPABILITY = CAP_GENERAL_DLL
-    TARGET.EPOCSTACKSIZE = 0x8000
-    TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000
-    TARGET.EPOCALLOWDLLDATA = 1
-	}
-   
-defBlock = \      
-	  "$${LITERAL_HASH}if defined(EABI)" \
-	  "DEFFILE  ../eabi/test_sms_plugin.def" \
-             "$${LITERAL_HASH}else" \
-             "DEFFILE  ../bwins/test_sms_plugin.def" \
-             "$${LITERAL_HASH}endif"
-	
-MMP_RULES += defBlock    
-    
- LIBS += -leuser \
-    -lconvergedmessageutils \
-    -lxqutils \
-    -lMsgMedia \
-    -leditorgenutils \
-    -lcone \
-    -leikcoctl \
-    -leikcore \
-    -leikdlg \
-    -lmsgs \
-    -letext \
-    -lgsmu \
-    -lmmsgenutils \
-    -lefsrv \
-    -lestor \
-    -lsmcm \
-    -lCommonEngine \
-    -lbafl \
-    -lCdlEngine \
-    -lFeatMgr \
-    -lapmime \
-    -lapgrfx \
-    -lcharconv \
-    -lInetProtUtil \
-		-lsmildtd \  
-		-lxmldom \
-  	-lxmlparser \
-  	-lcone \
-  	-lQtCore \
-  	-letel \
-  	-lcommdb \
-  	-lcommsdat \
-  	-letelmm \
-  	-lgenericclient 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testunieditorsmsplugin/data/TestUnieditorSMSPluginSample.txt	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,1 @@
+TestTextE_1_1
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testunieditorsmsplugin/data/TestUnieditorSMSPluginSample.vcf	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,33 @@
+BEGIN:VCARD
+VERSION:2.1
+N;LANGUAGE=en-us:name;test
+FN:test name
+ORG:nokia
+TITLE:sse
+TEL;CELL;VOICE:98465465214
+X-MS-OL-DEFAULT-POSTAL-ADDRESS:0
+EMAIL;PREF;INTERNET:testname@nokia.com
+X-MS-CARDPICTURE;TYPE=JPEG;ENCODING=BASE64:
+ /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQY
+ GBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYa
+ KCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAAR
+ CACUACcDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAA
+ AgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkK
+ FhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWG
+ h4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl
+ 5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREA
+ AgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYk
+ NOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOE
+ hYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk
+ 5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD6UdwpAPU0oIwSTxVeQ7nOPoKRj2B4FAEk
+ k4/g59zREMgk9fWoFGSKsr8qc+maAIJPnmx6cUUkIy5aigBw4yfSkpT93680lABEMtUs52xk
+ evFJAOabcHkLQA1DsiJ70US8Kq0UAK3Xim0vagdfpQBYhHy5qufmm/GrJ+SP6Cq0PLE0AJMc
+ vj0opjNlyfeigCTtTohyKb2qaEfyxQAlw2EA9ajT5YyfWluDlwPQUFSVCryeM0AV6KmEaLy5
+ 59KKAFHJxU0ZwoxyTzSBoz0Xn6UOSqEjigBDGN2X5J7CmSSEYCjbSRZLEnkgUyQgufSgBEG5
+ vmNFNAycCigCzEPmH50s56D8adEvyk/hTJGXeeMkcc9BQAkQIXPvUeFX7xyfQVK5Pl4OBwBx
+ UFAAXPRcKPaimUUAaJ4TJ7VUA3MPerMxxGfeoI+pPoKACY8Adjk1FT5fv49OKZQAyiiigC3c
+ HkD0psXC89zSSHLNTjwn0H86AISckmkoPWigBlFFFAFoPuIBHWnOVI5xzTI+pPoKSTqB6CgA
+ 2Ken6GmGP3/MU09aAxHQkUABRscc/Q0Ubz3AP4UUATp9xvwpj/fb60UUARnrRRRQAyiiigD/
+ 2Q==
+
+END:VCARD
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testunieditorsmsplugin/data/TestUnieditorSMSPluginSample.vcs	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,18 @@
+BEGIN:VCALENDAR
+VERSION:1.0
+BEGIN:VEVENT
+UID:3ECjzCAm4EI6h72lU94XL2
+SUMMARY:Nokia Meet
+DESCRIPTION:Wow...
+DTSTART:20100827T023000Z
+DTEND:20100827T103000Z
+X-EPOCAGENDAENTRYTYPE:APPOINTMENT
+CLASS:PRIVATE
+LOCATION:Nokia
+SEQUENCE:0
+X-METHOD:NONE
+LAST-MODIFIED:20100818T131951Z
+PRIORITY:2
+X-SYMBIAN-LUID:6
+END:VEVENT
+END:VCALENDAR
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testunieditorsmsplugin/inc/testunieditorsmsplugin.h	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,200 @@
+/*
+ * 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: Main test class declaration for UnieditorSMSPlugin
+ */
+
+#ifndef TEST_UNIEDITORSMS_PLUGIN_H
+#define TEST_UNIEDITORSMS_PLUGIN_H
+
+#ifdef BUILD_TESTUNIEDITORSMSPLUGIN_DLL
+#define TEST_EXPORT Q_DECL_EXPORT
+#else
+#define TEST_EXPORT Q_DECL_IMPORT
+#endif
+
+#include <QObject>
+#include <e32const.h>
+#include <e32svr.h>
+#include <SMSCLNT.H>
+#include <csmsaccount.h> 
+#include <mtclreg.h>
+#include <mtclbase.h>
+#include <txtrich.h>           	// CRichText
+#include <msvids.h>            	// for Message type IDs
+#include <mmsclient.h>       	// for CMmsClientMtm
+#include <CMsvMimeHeaders.h>        //Attachemt mimeheader
+#include <MMsvAttachmentManager.h>  //Attachment manager
+#include <MMsvAttachmentManagerSync.h>
+
+class CMsvSession;
+class CClientMtmRegistry; 
+class CSmsClientMtm;
+class UniEditorSmsPlugin;
+class ConvergedMessage;
+
+//Main Tets Class Declaration
+class TEST_EXPORT TestUnieditorSMSPlugin: public QObject, public MMsvSessionObserver
+    {
+    Q_OBJECT
+
+public: //MMsvSessionObserver
+    /**
+	 * Handles the various events while sending SMS
+	 **/  
+    virtual void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
+    
+private slots:
+	/**
+	 * Initialises the whole Test
+	 **/  
+    void initTestCase();//called before the first testfunction is executed.
+    
+    /**
+	 * Initialises each Test Case
+	 **/ 
+    void init();//called before each testfunction is executed.
+    
+    /**
+	 * Create a SMS
+	 **/ 
+    void CreateSMS();
+    
+    /**
+	 * Send and Test the created SMS
+	 **/ 
+	void SendAndTestSMS();
+	
+	/**
+	 * Create a SMS with Text Attachment
+	 **/ 
+    void CreateSMSWithTextAttachment();
+    
+    /**
+	 * Test the SMS with Text Attachment
+	 **/ 
+    void TestSMSWithTextAttachment();
+    
+    /**
+	 * Create a SMS with VCard Attachment
+	 **/
+    void CreateSMSWithVCardAttachment();
+    
+    /**
+	 * Test the SMS with VCard Attachment
+	 **/
+    void TestSMSWithVCardAttachment();
+    
+    /**
+	 * Create a SMS with VCal Attachment
+	 **/
+    void CreateSMSWithVCalAttachment();
+    
+    /**
+	 * Test the SMS with VCal Attachment
+	 **/
+    void TestSMSWithVCalAttachment();
+    
+    /**
+	 * Create an Email SMS
+	 **/
+    void CreateEmailSMS();
+    
+    /**
+	 * Test the Email SMS
+	 **/
+	void TestEmailSMS();
+	
+	/**
+	 * Create a SMS
+	 **/
+	void CreateSMSForExtraOptions();
+	
+	/**
+	 * Test the SMS
+	 **/
+	void TestSMSForExtraOptions();
+    
+	/**
+	 * Cleans up each Test Case
+	 **/ 
+    void cleanup();//called after every testfunction.
+    
+    /**
+	 * Cleans up the whole Test Case
+	 **/  
+    void cleanupTestCase();//called after the last testfunction was executed.
+    
+private:
+    /**
+	 * Creates the Service Center Settings
+	 **/  
+    void createSCSettingsL();
+    
+    /**
+	 * Initialise the SMS MTM
+	 **/
+    void initL();
+    
+    /**
+	 * Create the SMS Service
+	 **/
+    TMsvId CreateSmsServiceL();
+    
+    /**
+	 * Returns SMS Service Id
+	 **/
+    TMsvId ServiceIdL();
+    
+    /**
+	 * Creates default SIMTSY Settings
+	 **/
+    void CreateDefaultSettingsL(TMsvId aServiceId);
+    
+    /**
+	 * Reads the default SIMTSY Settings
+	 **/
+    void ReadDefaultSettingsFromSharedDataL(CSmsSettings* aServiceSettings);
+    
+private:
+    /**
+	 * iCenRepSession
+	 **/  
+    CRepository* iCenRepSession;
+    
+    /**
+	 * iSession - SMS MTM Session
+	 **/  
+    CMsvSession* iSession;
+    
+    /**
+	 * iMtmRegistry - SMS MTM Registry
+	 **/  
+	CClientMtmRegistry* iMtmRegistry;
+	
+	/**
+	 * iSmsClientMtm - SMS MTM
+	 **/  
+	CSmsClientMtm* iSmsClientMtm;
+    
+	/**
+	 * msgPlugin - SMS Unieditor Plugin
+	 **/  
+	UniEditorSmsPlugin* msgPlugin;
+    
+	/**
+	 * smsId - Id of the SMS
+	 **/  
+	TMsvId smsId;
+    };
+#endif //TEST_UNIEDITORSMS_PLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testunieditorsmsplugin/inc/testunieditorsmsplugin.ini	Fri Sep 17 08:28:39 2010 +0300
@@ -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: Input data Set File for TestUnieditorSMSPlugin test cases
+ */
+
+const char TEST_MSG_BODY[]        = "TestTextE_1_1";
+const char TEST_MSG_FROM1[]       = "+44111111111";
+const char SERVICE_CENTER_01[]    = "+447802000332";
+const char SERVICE_CENTER_02[]    = "+919845087001";
+const char TEST_MSG_ALIAS1[]      = "Javaid Nabi";
+const char TEST_MSG_SUBJECT[]     = "Message Subject";
+const char TEST_TEXT_ATTACHMENT[]		= "c:\\data\\TestUnieditorSMSPluginSample.txt";
+const char TEST_VCAL_ATTACHMENT[]		= "c:\\data\\TestUnieditorSMSPluginSample.vcs";
+const char TEST_VCARD_ATTACHMENT[]		= "c:\\data\\TestUnieditorSMSPluginSample.vcf";
+const char TEST_MSG_TO1[]       = "SS<+44111111111>";
+const char TEST_MSG_TO2[]       = "+44111111111";
+const char TEST_MSG_TO3[]       = "test@test.com";
+
+const TInt KDefDeliveryReport = 1;
+const TInt KDefValidityPeriod = 1440;
+const TInt KDefMessageConversion = 0;
+const TInt KDefPreferredConnection = 3;
+const TInt KDefReplyViaSameCentre = 0;
+
+_LIT( KSmsService,         "Sms Service" );
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testunieditorsmsplugin/src/testunieditorsmsplugin.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,888 @@
+/*
+ * 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: Main test class definition for UnieditorSMSPlugin
+ */
+
+#include <QtTest/QtTest>
+#include <QTimer>
+#include <QSignalSpy>
+#include "debugtraces.h"
+#include <etelmm.h>
+#include <xqconversions.h>
+#include <SenduiMtmUids.h>
+#include <e32base.h>
+#include <e32property.h>
+#include <etelmm.h>
+#include <es_ini.h>
+#include <SenduiMtmUids.h>
+#include <centralrepository.h>
+#include <MessagingInternalCRKeys.h>    
+#include <startupdomainpskeys.h>
+#include "convergedmessage.h"
+#include "convergedmessageid.h"
+#include "unieditorsmsplugin.h"
+#include "testunieditorsmsplugin.h"
+#include "testunieditorsmsplugin.ini"
+
+//---------------------------------------------------------------
+// TestUnieditorSMSPlugin::HandleSessionEventL
+//---------------------------------------------------------------
+void TestUnieditorSMSPlugin::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
+{
+	
+}
+
+//---------------------------------------------------------------
+// TestUnieditorSMSPlugin::initTestCase
+//---------------------------------------------------------------
+void TestUnieditorSMSPlugin::initTestCase()
+{
+	//Initialise SMS MTM
+	initL();
+	
+	//Initialise Service Center Settings 
+	createSCSettingsL();
+	
+	//Instantiate Unieditor SMS plugin
+	msgPlugin = new UniEditorSmsPlugin;
+    QVERIFY2(msgPlugin != NULL, "SMS Unieditor Plugin Not created");
+    
+    //Validate SMS services
+    QVERIFY(msgPlugin->validateService() != 0);
+	QVERIFY(msgPlugin->isServiceValid() != 0);
+}
+
+//---------------------------------------------------------------
+// TestUnieditorSMSPlugin::init
+//---------------------------------------------------------------
+void TestUnieditorSMSPlugin::init()
+{
+}
+
+//---------------------------------------------------------------
+// TestUnieditorSMSPlugin::CreateSMS
+//---------------------------------------------------------------
+void TestUnieditorSMSPlugin::CreateSMS()
+{
+	//Setting Encoding settings for Unicode
+	msgPlugin->setEncodingSettings(EFalse, ESmsEncodingNone, -1);
+			
+	//Constructing a new SMS
+	ConvergedMessage message;
+	message.setBodyText(QString(TEST_MSG_BODY));
+	
+	ConvergedMessageAddress address1;
+	address1.setAddress(QString(TEST_MSG_TO1));
+	address1.setAlias(QString(TEST_MSG_ALIAS1));
+	message.addToRecipient(address1);
+	
+	message.setPriority(ConvergedMessage::Normal);
+	
+	//Sending SMS to drafts folder
+	smsId = msgPlugin->convertTo(&message);
+	QVERIFY(smsId != -1);
+}
+
+//---------------------------------------------------------------
+// TestUnieditorSMSPlugin::SendAndTestSMS
+//---------------------------------------------------------------
+void TestUnieditorSMSPlugin::SendAndTestSMS()
+{
+	QTest::qWait(1000);
+		
+	//Checking SMS in drafts folder
+	CMsvEntry* rootentry = iSession->GetEntryL(KMsvDraftEntryId);
+	CMsvEntrySelection* messages = rootentry->ChildrenL();	
+	TInt count = rootentry->Count();
+	
+	QVERIFY(count > 0);
+	
+	TMsvId draftMsgId = messages->At(count - 1);
+	QVERIFY2(draftMsgId == smsId, "SMS Not Sent to Drafts Folder");
+		
+	ConvergedMessage* message = msgPlugin->convertFrom(draftMsgId);
+	QVERIFY(message != NULL);
+	QVERIFY(QString(TEST_MSG_TO1).contains(message->fromAddress()->address(), Qt::CaseInsensitive) == true);
+	QVERIFY(QString(TEST_MSG_ALIAS1).contains(message->fromAddress()->alias(), Qt::CaseInsensitive) == true);
+	QVERIFY(QString(TEST_MSG_BODY).compare(message->bodyText(), Qt::CaseInsensitive) == 0);
+	
+	TInt numOfRemainingChars;
+	TInt numOfPDUs;
+	TBool unicodeMode;
+	TSmsEncoding alternativeEncodingType;
+	
+	QString bodyMessage = message->bodyText();
+	QVERIFY(msgPlugin->getNumPDUs(bodyMessage, numOfRemainingChars, numOfPDUs, unicodeMode, alternativeEncodingType) == true);
+	QVERIFY(numOfPDUs  == 1);
+	QVERIFY(unicodeMode == 0);
+	QVERIFY(alternativeEncodingType == ESmsEncodingNone);
+	
+	delete message;
+	
+	QVERIFY(msgPlugin->send(smsId) == true);
+	
+	QTest::qWait(1000);
+			
+	//Checking SMS in outbox folder
+	rootentry = iSession->GetEntryL(KMsvGlobalOutBoxIndexEntryId);
+	messages = rootentry->ChildrenL();	
+	count = rootentry->Count();
+	
+	QVERIFY(count > 0);
+	TMsvId outboxMsgId = messages->At(count - 1);
+	
+	QVERIFY2(outboxMsgId == smsId, "SMS Not Sent to Outbox Folder");
+	message = msgPlugin->convertFrom(outboxMsgId);
+	QVERIFY(message != NULL);
+	qDebug("conversion OK");
+	QVERIFY(QString(TEST_MSG_TO1).contains(message->fromAddress()->address(), Qt::CaseInsensitive) == true);
+	QVERIFY(QString(TEST_MSG_ALIAS1).contains(message->fromAddress()->alias(), Qt::CaseInsensitive) == true);
+	delete message;
+}
+
+//---------------------------------------------------------------
+// TestUnieditorSMSPlugin::CreateSMSWithTextAttachment
+//---------------------------------------------------------------
+void TestUnieditorSMSPlugin::CreateSMSWithTextAttachment()
+{
+	msgPlugin->setEncodingSettings(ETrue, ESmsEncodingNone, -1);
+			
+	//Constructing SMS with text attachment
+	ConvergedMessage message;
+	
+	ConvergedMessageAddress address;
+	address.setAddress(QString(TEST_MSG_TO2));
+	message.addToRecipient(address);
+	
+	message.setPriority(ConvergedMessage::Normal);
+	
+	ConvergedMessageAttachmentList attachmentList;    
+	
+	//Add a text attachment to attachment list. 
+	QString attachmentPath = TEST_TEXT_ATTACHMENT;
+	ConvergedMessageAttachment* attachment = 
+		new ConvergedMessageAttachment(attachmentPath, ConvergedMessageAttachment::EAttachment);
+	
+	attachmentList.append(attachment);
+	//Add attachments' list
+	message.addAttachments(attachmentList);
+	
+	smsId = msgPlugin->convertTo(&message);
+	QVERIFY(smsId != -1);
+	
+	QVERIFY(msgPlugin->send(smsId) == true);
+}
+
+//---------------------------------------------------------------
+// TestUnieditorSMSPlugin::TestSMSWithTextAttachment
+//---------------------------------------------------------------
+void TestUnieditorSMSPlugin::TestSMSWithTextAttachment()
+{
+	QTest::qWait(1000);
+		
+	CMsvEntry* rootentry = iSession->GetEntryL(KMsvGlobalOutBoxIndexEntryId);
+	CMsvEntrySelection* messages = rootentry->ChildrenL();	
+	TInt count = rootentry->Count();
+	
+	QVERIFY(count > 0);
+	TMsvId outboxMsgId = messages->At(count - 1);
+		
+	QVERIFY2(outboxMsgId == smsId, "SMS Not Sent to Outbox Folder");
+	ConvergedMessage* message = msgPlugin->convertFrom(outboxMsgId);
+	QVERIFY(message != NULL);
+	QVERIFY(QString(TEST_MSG_TO2).contains(message->fromAddress()->address(), Qt::CaseInsensitive) == true);
+	delete message;
+
+	qDebug("Text Attachment SMS Sending passed");
+}
+
+//---------------------------------------------------------------
+// TestUnieditorSMSPlugin::CreateSMSWithVCardAttachment
+//---------------------------------------------------------------
+void TestUnieditorSMSPlugin::CreateSMSWithVCardAttachment()
+{
+	msgPlugin->setEncodingSettings(ETrue, ESmsEncodingNone, -1);
+		
+	//Constructing SMS with VCard attachment
+	ConvergedMessage message;
+	
+	ConvergedMessageAddress address;
+	address.setAddress(QString(TEST_MSG_TO2));
+	message.addToRecipient(address);
+	
+	message.setPriority(ConvergedMessage::Normal);
+	
+	ConvergedMessageAttachmentList attachmentList;    
+	
+	//Add a vcard attachment to attachment list. 
+	QString attachmentPath = TEST_VCARD_ATTACHMENT;
+	ConvergedMessageAttachment* attachment = 
+		new ConvergedMessageAttachment(attachmentPath, ConvergedMessageAttachment::EAttachment);
+	
+	attachmentList.append(attachment);
+	//Add attachments' list
+	message.addAttachments(attachmentList);
+	
+	smsId = msgPlugin->convertTo(&message);
+	QVERIFY(smsId != -1);
+}
+
+//---------------------------------------------------------------
+// TestUnieditorSMSPlugin::TestSMSWithVCardAttachment
+//---------------------------------------------------------------
+void TestUnieditorSMSPlugin::TestSMSWithVCardAttachment()
+{
+	QTest::qWait(1000);
+	
+	//Verifying a SMS with VCard attachment
+	CMsvEntry* rootentry = iSession->GetEntryL(KMsvDraftEntryId);
+	CMsvEntrySelection* messages = rootentry->ChildrenL();	
+	TInt count = rootentry->Count();
+	
+	QVERIFY(count > 0);
+
+	TMsvId draftMsgId = messages->At(count - 1);
+	QVERIFY2(draftMsgId == smsId, "SMS Not Sent to Drafts Folder");
+		
+	ConvergedMessage* message = msgPlugin->convertFrom(draftMsgId);
+	QVERIFY(message != NULL);
+	QVERIFY(QString(TEST_MSG_TO2).contains(message->fromAddress()->address(), Qt::CaseInsensitive) == true);
+	QVERIFY(message->attachments().count() == 1);
+	QVERIFY(message->attachments()[0]->attachmentType() == ConvergedMessageAttachment::EAttachment);
+	QVERIFY(message->attachments()[0]->filePath().contains(QString(TEST_VCARD_ATTACHMENT).mid(QString(TEST_VCARD_ATTACHMENT).indexOf(QString("TestUnieditorSMSPluginSample.vcf"), 0, Qt::CaseInsensitive)), Qt::CaseInsensitive) == true);
+	delete message;
+	message = NULL;
+	qDebug("VCard Attachment SMS passed");
+	
+	msgPlugin->deleteDraftsEntry(draftMsgId);
+	
+	message = msgPlugin->convertFrom(draftMsgId);
+	QVERIFY(message == NULL);
+	
+	qDebug("Draft SMS deleted Sucessfully");
+}
+
+//---------------------------------------------------------------
+// TestUnieditorSMSPlugin::CreateSMSWithVCalAttachment
+//---------------------------------------------------------------
+void TestUnieditorSMSPlugin::CreateSMSWithVCalAttachment()
+{
+	msgPlugin->setEncodingSettings(EFalse, ESmsEncodingNone, -1);
+			
+	//Constructing SMS with VCal attachment
+	ConvergedMessage message;
+	
+	ConvergedMessageAddress address;
+	address.setAddress(QString(TEST_MSG_TO1));
+	message.addToRecipient(address);
+	
+	message.setPriority(ConvergedMessage::Normal);
+	
+	ConvergedMessageAttachmentList attachmentList;    
+	
+	//Add a vcal attachment to attachment list. 
+	QString attachmentPath = TEST_VCAL_ATTACHMENT;
+	ConvergedMessageAttachment* attachment = 
+		new ConvergedMessageAttachment(attachmentPath, ConvergedMessageAttachment::EAttachment);
+	
+	attachmentList.append(attachment);
+	//Add attachments' list
+	message.addAttachments(attachmentList);
+	
+	smsId = msgPlugin->convertTo(&message);
+	QVERIFY(smsId != -1);
+}
+
+//---------------------------------------------------------------
+// TestUnieditorSMSPlugin::TestSMSWithVCalAttachment
+//---------------------------------------------------------------
+void TestUnieditorSMSPlugin::TestSMSWithVCalAttachment()
+{
+	QTest::qWait(1000);
+	
+	//Verifying a SMS with VCal attachment
+	CMsvEntry* rootentry = iSession->GetEntryL(KMsvDraftEntryId);
+	CMsvEntrySelection* messages = rootentry->ChildrenL();	
+	TInt count = rootentry->Count();
+	
+	QVERIFY(count > 0);
+	
+	TMsvId draftMsgId = messages->At(count - 1);
+	QVERIFY2(draftMsgId == smsId, "SMS Not Sent to Drafts Folder");
+	
+	ConvergedMessage* message = msgPlugin->convertFrom(draftMsgId);
+	QVERIFY(message != NULL);
+	QVERIFY(QString(TEST_MSG_TO1).contains(message->fromAddress()->address(), Qt::CaseInsensitive) == true);
+	QVERIFY(message->attachments().count() == 1);
+	QVERIFY(message->attachments()[0]->attachmentType() == ConvergedMessageAttachment::EAttachment);
+	QVERIFY(message->attachments()[0]->filePath().contains(QString(TEST_VCAL_ATTACHMENT).mid(QString(TEST_VCAL_ATTACHMENT).indexOf(QString("TestUnieditorSMSPluginSample.vcs"), 0, Qt::CaseInsensitive)), Qt::CaseInsensitive) == true);
+	delete message;
+	message = NULL;
+	
+	qDebug("VCal Attachment SMS passed");
+	
+	msgPlugin->deleteDraftsEntry(draftMsgId);
+	
+	message = msgPlugin->convertFrom(draftMsgId);
+	QVERIFY(message == NULL);
+	
+	qDebug("Draft SMS deleted Sucessfully");
+}
+
+//---------------------------------------------------------------
+// TestUnieditorSMSPlugin::CreateEmailSMS
+//---------------------------------------------------------------
+void TestUnieditorSMSPlugin::CreateEmailSMS()
+{
+	//Constructing a SMS - Email
+	ConvergedMessage message;
+		
+	ConvergedMessageAddress address1;
+	address1.setAddress(QString(TEST_MSG_TO3));
+	message.addToRecipient(address1);
+	
+	ConvergedMessageAddress address2;
+	address2.setAddress(QString(TEST_MSG_TO2));
+	message.addToRecipient(address2);
+	
+	message.setPriority(ConvergedMessage::Normal);
+	
+	message.setSubject(QString(TEST_MSG_SUBJECT));
+	
+	message.setBodyText(QString(TEST_MSG_BODY));
+	
+	smsId = msgPlugin->convertTo(&message);
+	QVERIFY(smsId != -1);
+}
+
+//---------------------------------------------------------------
+// TestUnieditorSMSPlugin::TestEmailSMS
+//---------------------------------------------------------------
+void TestUnieditorSMSPlugin::TestEmailSMS()
+{
+	QTest::qWait(1000);
+			
+	//Verifying Email SMS
+	CMsvEntry* rootentry = iSession->GetEntryL(KMsvDraftEntryId);
+	CMsvEntrySelection* messages = rootentry->ChildrenL();	
+	TInt count = rootentry->Count();
+	
+	QVERIFY(count > 0);
+	
+	TMsvId draftMsgId = messages->At(count - 1);
+	QVERIFY2(draftMsgId == smsId, "SMS Not Sent to Drafts Folder");
+		
+	ConvergedMessage* message = msgPlugin->convertFrom(draftMsgId);
+	QVERIFY(message != NULL);
+	QVERIFY(QString(TEST_MSG_TO1).contains(message->fromAddress()->address(), Qt::CaseInsensitive) == true);
+	QVERIFY(QString(TEST_MSG_BODY).compare(message->bodyText(), Qt::CaseInsensitive) == 0);
+	QVERIFY(QString(TEST_MSG_SUBJECT).compare(message->subject(), Qt::CaseInsensitive) == 0);
+	delete message;
+	
+	qDebug("Creation EMail passed");
+	
+	QVERIFY(msgPlugin->send(smsId) == true);
+	
+	QTest::qWait(1000);
+}
+
+//---------------------------------------------------------------
+// TestUnieditorSMSPlugin::CreateSMSForExtraOptions
+//---------------------------------------------------------------
+void TestUnieditorSMSPlugin::CreateSMSForExtraOptions()
+{
+	ConvergedMessage message;
+	message.setBodyText(QString(TEST_MSG_BODY));
+	
+	ConvergedMessageAddress address1;
+	address1.setAddress(QString(TEST_MSG_TO2));
+	message.addToRecipient(address1);
+	
+	ConvergedMessageAddress address2;
+	address2.setAddress(QString(TEST_MSG_TO1));
+	message.addFromRecipient(address2);
+	
+	message.setPriority(ConvergedMessage::Normal);
+	
+	smsId = msgPlugin->convertTo(&message);
+	QVERIFY(smsId != -1);
+}
+
+//---------------------------------------------------------------
+// TestUnieditorSMSPlugin::TestSMSForExtraOptions
+//---------------------------------------------------------------
+void TestUnieditorSMSPlugin::TestSMSForExtraOptions()
+{
+	QTest::qWait(1000);
+				
+	CMsvEntry* rootentry = iSession->GetEntryL(KMsvDraftEntryId);
+	CMsvEntrySelection* messages = rootentry->ChildrenL();	
+	TInt count = rootentry->Count();
+	
+	QVERIFY(count > 0);
+	
+	TMsvId draftMsgId = messages->At(count - 1);
+	QVERIFY2(draftMsgId == smsId, "SMS Not Sent to Drafts Folder");
+		
+	QVERIFY(msgPlugin->messageType() == ConvergedMessage::Sms);
+	
+	//Verifying SMS for Forwarding
+	ConvergedMessage* message = msgPlugin->convertFrom(draftMsgId, UniEditorPluginInterface::Forward);
+	QVERIFY(message != NULL);
+	QVERIFY(QString(TEST_MSG_TO1).contains(message->fromAddress()->address(), Qt::CaseInsensitive) == true);
+	QVERIFY(message->toAddressList().count() == 1);
+	QVERIFY(message->toAddressList()[0]->address().contains(QString(TEST_MSG_TO2), Qt::CaseInsensitive) == true);
+	QVERIFY(QString(TEST_MSG_BODY).compare(message->bodyText(), Qt::CaseInsensitive) == 0);
+	delete message;
+	
+	qDebug("SMS for Forward Passed");
+	
+	//Verifying SMS for Reply from Drafts
+	message = msgPlugin->convertFrom(draftMsgId, UniEditorPluginInterface::Reply);
+	QVERIFY(message != NULL);
+	QVERIFY(QString(TEST_MSG_TO1).contains(message->fromAddress()->address(), Qt::CaseInsensitive) == true);
+	QVERIFY(message->toAddressList().count() == 1);
+	QVERIFY(message->toAddressList()[0]->address().contains(QString(TEST_MSG_TO2), Qt::CaseInsensitive) == true);
+	QVERIFY(message->bodyText().contains(QString(TEST_MSG_BODY), Qt::CaseInsensitive) == true);
+	delete message;
+	
+	qDebug("SMS for Reply - ESmsSubmit Passed");
+	
+	QVERIFY(msgPlugin->send(smsId) == true);
+	
+	QTest::qWait(1000);
+			
+	rootentry = iSession->GetEntryL(KMsvGlobalOutBoxIndexEntryId);
+	messages = rootentry->ChildrenL();	
+	count = rootentry->Count();
+	
+	QVERIFY(count > 0);
+	TMsvId outboxMsgId = messages->At(count - 1);
+	
+	//Verifying SMS for Reply when SMS is sent
+	message = msgPlugin->convertFrom(outboxMsgId, UniEditorPluginInterface::Reply);
+	QVERIFY(message != NULL);
+	QVERIFY(QString(TEST_MSG_TO1).contains(message->fromAddress()->address(), Qt::CaseInsensitive) == true);
+	QVERIFY(message->toAddressList().count() == 1);
+	QVERIFY(message->toAddressList()[0]->address().contains(QString(TEST_MSG_TO2), Qt::CaseInsensitive) == true);
+	QVERIFY(message->bodyText().compare(QString(""), Qt::CaseInsensitive) == 0);
+	delete message;
+	
+	qDebug("SMS for Reply - ESmsDeliver Passed");	
+	
+	iSmsClientMtm->Entry().DeleteL(smsId);
+	QTest::qWait(1000);
+}
+
+//---------------------------------------------------------------
+// TestUnieditorSMSPlugin::cleanup
+//---------------------------------------------------------------
+void TestUnieditorSMSPlugin::cleanup()
+{
+	
+}
+
+//---------------------------------------------------------------
+// TestUnieditorSMSPlugin::cleanupTestCase
+//---------------------------------------------------------------
+void TestUnieditorSMSPlugin::cleanupTestCase()
+{
+	//Cleanup
+	delete msgPlugin;
+    
+    if(iSmsClientMtm)
+	{
+		delete iSmsClientMtm;
+		iSmsClientMtm = NULL;
+	}
+	
+	if (iMtmRegistry)
+	{
+		delete iMtmRegistry;
+		iMtmRegistry = NULL;
+	}
+ 
+	if (iSession)
+	{
+		delete iSession;
+		iSession = NULL;
+	}
+
+	if (iCenRepSession)
+	{
+		delete iCenRepSession;
+		iCenRepSession = NULL;
+	}
+}
+
+//---------------------------------------------------------------
+// TestUnieditorSMSPlugin::createSCSettingsL
+//---------------------------------------------------------------
+void TestUnieditorSMSPlugin::createSCSettingsL()
+{
+	qDebug("TestUnieditorSMSPlugin::createSCSettingsL enter");
+		
+	TMsvSelectionOrdering ordering;
+
+	CMsvEntry* root = CMsvEntry::NewL(iSmsClientMtm->Session(),
+									  KMsvRootIndexEntryId,
+									  ordering);
+
+	CSmsAccount* smsAccount = CSmsAccount::NewLC();
+
+	CSmsSettings* settings = CSmsSettings::NewL();
+	CleanupStack::PushL(settings);
+	smsAccount->LoadSettingsL(*settings);
+
+	TMsvEntry entry;
+	entry.iMtm = KUidMsgTypeSMS;
+	entry.iType = KUidMsvServiceEntry;
+	entry.SetReadOnly(EFalse);
+	entry.SetVisible(EFalse);
+	entry.iDate.UniversalTime();
+	entry.iDetails.Set(_L("Nokiatest"));
+
+	root->SetEntryL(KMsvRootIndexEntryId);
+	root->CreateL(entry);
+
+	QString serviceCenter01(SERVICE_CENTER_01);
+	QString serviceCenter02(SERVICE_CENTER_02);
+	HBufC* sC01 = XQConversions::qStringToS60Desc(serviceCenter01);
+	HBufC* sC02 = XQConversions::qStringToS60Desc(serviceCenter02);
+	CleanupStack::PushL(sC01);
+	CleanupStack::PushL(sC02);
+	settings->AddServiceCenterL(_L("Nokia"), *sC01);
+	settings->AddServiceCenterL(_L("Nokia"), *sC02);
+	CleanupStack::PopAndDestroy(sC02);
+	CleanupStack::PopAndDestroy(sC01);
+	settings->SetDefaultServiceCenter(1);
+	settings->SetValidityPeriod(ESmsVPWeek);
+	settings->SetReplyQuoted(ETrue);
+	settings->SetRejectDuplicate(ETrue);
+	settings->SetDelivery(ESmsDeliveryImmediately);
+	settings->SetDeliveryReport(EFalse);
+	settings->SetReplyPath(EFalse);
+	settings->SetMessageConversion(ESmsConvPIDNone);
+	settings->SetCanConcatenate(ETrue);
+	settings->SetCharacterSet(TSmsDataCodingScheme::ESmsAlphabet7Bit);
+	settings->SetValidityPeriodFormat(TSmsFirstOctet::ESmsVPFInteger);
+	settings->SetStatusReportHandling(CSmsSettings::EMoveReportToInboxVisible);
+	settings->SetSpecialMessageHandling(CSmsSettings::EMoveReportToInboxVisible);
+	settings->SetSmsBearer(CSmsSettings::ESmsBearerCircuitPreferred);
+	settings->SetCommDbAction(CSmsSettings::ENone);
+	settings->SetSmsBearerAction(CSmsSettings::ENone);
+	
+	// Save settings
+	CMsvStore* msvstore = root->EditStoreL();
+	CleanupStack::PushL(msvstore);
+
+	TInt maxTries(5);
+	TBool done(EFalse);
+	while (maxTries && !done)
+	{
+		qDebug("TestUnieditorSMSPlugin::CreateDefaultSettingsL b4");
+		TRAPD( err, smsAccount->SaveSettingsL( *settings ) );	
+		qDebug("TestUnieditorSMSPlugin::CreateDefaultSettingsL after");
+		if (err == KErrNone)
+		{
+			qDebug("TestUnieditorSMSPlugin::CreateDefaultSettingsL settings saved");
+
+			done = ETrue;
+		}
+		else if (err == KErrLocked)
+		{
+			qDebug("TestUnieditorSMSPlugin::CreateDefaultSettingsL KErrLocked");
+
+			// Wait a while and retry.
+			User::After(100000); // 0.1 seconds
+			maxTries--;
+		}
+		else
+		{
+		qDebug("TestUnieditorSMSPlugin::CreateDefaultSettingsL leaving - ");
+		qDebug() << err;
+			User::Leave(err);
+		}
+	}
+
+	msvstore->CommitL();
+	CleanupStack::PopAndDestroy(msvstore);
+	
+	CleanupStack::PopAndDestroy(settings);
+	CleanupStack::PopAndDestroy(smsAccount);
+	
+	qDebug("TestUnieditorSMSPlugin::createSCSettingsL exit");
+}
+
+//---------------------------------------------------------------
+// TestUnieditorSMSPlugin::initL
+//---------------------------------------------------------------
+void TestUnieditorSMSPlugin::initL()
+{
+	iCenRepSession = CRepository::NewL(KCRUidSmum);
+
+    // initialise
+    iSession = CMsvSession::OpenSyncL(*this);
+
+    // Create the SMS Service   
+    TMsvId serviceId = CreateSmsServiceL();
+
+    // Update the SMS cenrep with the default settings.
+    CreateDefaultSettingsL(serviceId);
+
+    iMtmRegistry = CClientMtmRegistry::NewL(*iSession); 
+    iSmsClientMtm = STATIC_CAST( CSmsClientMtm*, iMtmRegistry->NewMtmL( KUidMsgTypeSMS ));
+}
+
+//---------------------------------------------------------------
+// TestUnieditorSMSPlugin::CreateSmsServiceL
+//---------------------------------------------------------------
+TMsvId TestUnieditorSMSPlugin::CreateSmsServiceL()
+    {
+	qDebug("TestUnieditorSMSPlugin::CreateSmsServiceL enter");
+		 
+	TMsvId serviceEntryId = KMsvNullIndexEntryId;
+	TInt err = KErrNone;
+	TRAP( err, serviceEntryId = ServiceIdL());
+
+	// If no service, create one
+	if (err == KErrNotFound)
+		{
+		TMsvEntry entry;
+		entry.iMtm = KUidMsgTypeSMS;
+		entry.iType = KUidMsvServiceEntry;
+		entry.SetReadOnly(EFalse);
+		entry.SetVisible(EFalse);
+		entry.iDate.HomeTime();
+		entry.iDetails.Set(KSmsService);
+		CMsvEntry* root = iSession->GetEntryL(KMsvRootIndexEntryId);
+		CleanupStack::PushL(root);
+
+		// In case no root store, create one...
+		if (!root->HasStoreL())
+			{
+			// --- The entry does not have a store. EditStoreL() will create one ---
+			CMsvStore* store = root->EditStoreL();
+			CleanupStack::PushL(store);
+			store->CommitL();
+			CleanupStack::PopAndDestroy(); // store
+			store = NULL; // destroyed
+			}
+		root->CreateL(entry);
+		CleanupStack::PopAndDestroy(); // root
+		serviceEntryId = entry.Id();
+
+		}
+	
+	qDebug("TestUnieditorSMSPlugin::CreateSmsServiceL exit");
+	return serviceEntryId;
+	}
+
+//---------------------------------------------------------------
+// TestUnieditorSMSPlugin::ServiceIdL
+//---------------------------------------------------------------
+TMsvId TestUnieditorSMSPlugin::ServiceIdL()
+{
+	qDebug("TestUnieditorSMSPlugin::ServiceIdL enter");
+		
+	TMsvId id = KMsvNullIndexEntryId;
+	CMsvEntry* root = iSession->GetEntryL(KMsvRootIndexEntryId);
+	CleanupStack::PushL(root);
+	TSmsUtilities::ServiceIdL(*root, id);
+	CleanupStack::PopAndDestroy(root);
+	
+	qDebug("TestUnieditorSMSPlugin::ServiceIdL exit");
+	return id;
+}
+
+//---------------------------------------------------------------
+// TestUnieditorSMSPlugin::CreateDefaultSettingsL
+//---------------------------------------------------------------
+void TestUnieditorSMSPlugin::CreateDefaultSettingsL(TMsvId aServiceId)
+{
+	qDebug("TestUnieditorSMSPlugin::CreateDefaultSettingsL enter");
+
+	CSmsSettings* serviceSettings = CSmsSettings::NewL();
+	CleanupStack::PushL(serviceSettings);
+	CSmsAccount* smsAccount = CSmsAccount::NewLC();
+
+	// Read the RFS related settings from shared data.
+	TInt originalCount = 0;
+	smsAccount->LoadSettingsL(*serviceSettings);
+	originalCount = serviceSettings->ServiceCenterCount();
+
+	if (!originalCount)
+		{
+		qDebug("Original count = 0");
+
+		ReadDefaultSettingsFromSharedDataL(serviceSettings);
+
+		// Rest of the sms settings, which are fixed.
+		serviceSettings->SetValidityPeriodFormat(TSmsFirstOctet::ESmsVPFInteger); //relative
+		serviceSettings->SetDelivery(ESmsDeliveryImmediately);
+		serviceSettings->SetCanConcatenate(ETrue);
+		serviceSettings->SetStatusReportHandling(CSmsSettings::EMoveReportToInboxInvisible);
+		serviceSettings->SetSpecialMessageHandling(CSmsSettings::EMoveReportToInboxVisible);
+		serviceSettings->SetRejectDuplicate(ETrue);
+		TInt descriptionLength = KSmsDescriptionLength;
+
+		// Read the value for description length 
+		CRepository* repository = CRepository::NewLC(KCRUidMuiuSettings);
+		if (KErrNone == repository->Get(KMuiuDescriptionLength,
+				descriptionLength))
+			{
+			//Make sure value is not zero
+			descriptionLength = Max(descriptionLength, KSmsDescriptionLength);
+			}
+		CleanupStack::PopAndDestroy(); // repository
+		serviceSettings->SetDescriptionLength(descriptionLength);
+
+		// Set saving to commsdb
+		serviceSettings->SetCommDbAction(CSmsSettings::EStoreToCommDb);
+		serviceSettings->SetSmsBearerAction(CSmsSettings::EStoreToCommDb);
+
+		}
+
+	// Save settings
+	CMsvEntry* service = iSession->GetEntryL(aServiceId);
+	CleanupStack::PushL(service);
+	CMsvStore* msvstore = service->EditStoreL();
+	CleanupStack::PushL(msvstore);
+
+	TInt maxTries(5);
+	TBool done(EFalse);
+	while (maxTries && !done)
+		{
+		TRAPD( err, smsAccount->SaveSettingsL( *serviceSettings ) );
+		if (err == KErrNone)
+			{
+			qDebug("TestUnieditorSMSPlugin::CreateDefaultSettingsL settings saved");
+
+			done = ETrue;
+			}
+		else if (err == KErrLocked)
+			{
+			qDebug("TestUnieditorSMSPlugin::CreateDefaultSettingsL KErrLocked");
+
+			// Wait a while and retry.
+			User::After(100000); // 0.1 seconds
+			maxTries--;
+			}
+		else
+			{
+			User::Leave(err);
+			}
+		}
+
+	msvstore->CommitL();
+	CleanupStack::PopAndDestroy(2); // msvstore, service
+	CleanupStack::PopAndDestroy(2); // serviceSettings, smsAccount
+
+	qDebug("TestUnieditorSMSPlugin::CreateDefaultSettingsL Exit"); 
+}
+
+//---------------------------------------------------------------
+// TestUnieditorSMSPlugin::ReadDefaultSettingsFromSharedDataL
+//---------------------------------------------------------------
+void TestUnieditorSMSPlugin::ReadDefaultSettingsFromSharedDataL(CSmsSettings* aServiceSettings)
+    {
+	qDebug("TestUnieditorSMSPlugin::ReadDefaultSettingsFromSharedDataL Enter"); 
+
+	if ( iCenRepSession )
+		{
+		TInt readedSetting;
+
+		// Delivery report 
+		if (iCenRepSession->Get(KSmumDeliveryReport, readedSetting) != KErrNone)
+			{
+			readedSetting = KDefDeliveryReport;
+			}
+		aServiceSettings->SetDeliveryReport(readedSetting);
+
+		// Validity period
+		if (iCenRepSession->Get(KSmumValidityPeriod, readedSetting) != KErrNone)
+			{
+			readedSetting = KDefValidityPeriod;
+			}
+		aServiceSettings->SetValidityPeriod(readedSetting);
+
+		// Message conversion
+		if (iCenRepSession->Get(KSmumMessageConversion, readedSetting)
+				!= KErrNone)
+			{
+			readedSetting = KDefMessageConversion;
+			}
+		aServiceSettings->SetMessageConversion((TSmsPIDConversion) readedSetting);
+
+		// Preferred connection
+		if (iCenRepSession->Get(KSmumPreferredConnection, readedSetting)
+				!= KErrNone)
+			{
+			readedSetting = KDefPreferredConnection;
+			}
+		aServiceSettings->SetSmsBearer((CSmsSettings::TMobileSmsBearer) readedSetting);
+
+		// Reply via same centre 
+		if (iCenRepSession->Get(KSmumRemoveReplyViaSameCentre, readedSetting)
+				!= KErrNone)
+			{
+			if (iCenRepSession->Get(KSmumReplyViaSameCentre, readedSetting)
+					!= KErrNone)
+				{
+				readedSetting = KDefReplyViaSameCentre;
+				}
+			}
+		else
+			{
+			if (!readedSetting)
+				{
+				if (iCenRepSession->Get(KSmumReplyViaSameCentre, readedSetting)
+						!= KErrNone)
+					{
+					readedSetting = KDefReplyViaSameCentre;
+					}
+				}
+			}
+		aServiceSettings->SetReplyPath(readedSetting);
+		}
+
+	qDebug("TestUnieditorSMSPlugin::ReadDefaultSettingsFromSharedDataL Exit"); 
+    }
+
+//---------------------------------------------------------------
+// main
+// main entry point
+//---------------------------------------------------------------
+int main(int argc, char *argv[])
+    { 
+	int ret = -1;
+	QCoreApplication app(argc, argv);
+	QObject* tc = new TestUnieditorSMSPlugin();
+	
+#ifdef __WINSCW__
+	char *new_argv[3]; 
+	QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log";	
+	QByteArray bytes = str.toAscii();	
+	char arg1[] = "-o";	
+	new_argv[0] = argv[0];	
+	new_argv[1] = arg1;	
+	new_argv[2] = bytes.data();	
+	ret = QTest::qExec(tc, 3, new_argv);
+#else
+	ret = QTest::qExec(tc, argc, argv);	
+#endif
+	
+	delete tc;
+	return ret;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testunieditorsmsplugin/testunieditorsmsplugin.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,126 @@
+#
+# 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: Test Case Project Definition for UnieditorSMSPlugin
+#
+
+QT += testlib
+QT -= gui
+
+TEMPLATE = app
+TARGET = testunieditorsmsplugin
+
+CONFIG += hb
+CONFIG += symbian_test
+CONFIG += qtestlib
+
+INCLUDEPATH += ./inc
+INCLUDEPATH += ../../../../../../../inc
+INCLUDEPATH += ../../../../editorgenutils/inc
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+DEFINES += BUILD_TESTUNIEDITORSMSPLUGIN_DLL
+
+SOURCES += \
+  ./src/testunieditorsmsplugin.cpp \
+  ../../src/unieditorsmsplugin.cpp \
+  ../../src/unieditorsmsplugin_p.cpp  
+         
+
+# Input
+HEADERS += \
+  ./inc/testunieditorsmsplugin.h \
+  ../../inc/unieditorsmsplugin.h \
+  ../../inc/unieditorsmsplugin_p.h 
+               
+   
+SYMBIAN_PLATFORMS = WINSCW ARMV5
+    symbian {
+    TARGET.UID3 =  0xE2b6e30a
+    TARGET.CAPABILITY = All -TCB -DRM
+    TARGET.EPOCSTACKSIZE = 0x8000
+    TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000
+    VENDORID =  VID_DEFAULT
+    BLD_INF_RULES.prj_exports += "data/TestUnieditorSMSPluginSample.txt c:/data/TestUnieditorSMSPluginSample.txt"
+    BLD_INF_RULES.prj_exports += "data/TestUnieditorSMSPluginSample.vcf c:/data/TestUnieditorSMSPluginSample.vcf"
+    BLD_INF_RULES.prj_exports += "data/TestUnieditorSMSPluginSample.vcs c:/data/TestUnieditorSMSPluginSample.vcs"
+    }
+   
+LIBS += -leuser \
+    -lconvergedmessageutils \
+    -lMsgMedia \
+    -leditorgenutils \
+    -lcone \
+    -leikcoctl \
+    -leikcore \
+    -leikdlg \
+    -lmsgs \
+    -letext \
+    -lgsmu \
+    -lmmsgenutils \
+    -lefsrv \
+    -lestor \
+    -lsmcm \
+    -lCommonEngine \
+    -lbafl \
+    -lCdlEngine \
+    -lFeatMgr \
+    -lapmime \
+    -lunidatamodelloader \
+    -lxqutils \
+    -lQtContacts \
+    -lxqutils \
+    -lapgrfx \
+    -lcharconv \
+    -lInetProtUtil \
+		-lsmildtd \  
+		-lxmldom \
+  	-lxmlparser \
+  	-lcone \
+  	-lQtCore \
+  	-letel \
+  	-letelmm \
+  	-lcentralrepository
+
+packageheader = "$${LITERAL_HASH}{\"TestUnieditorSMSPlugin\"},(0xE2b6e30a),1,0,0,TYPE=SA"
+
+vendorinfo = \
+			"; Localised Vendor name" \
+			"%{\"Nokia\"}" \
+			"; Unique Vendor name" \
+			":\"Nokia\"" 
+			
+dependencyinfo = \
+				"; Default HW/platform dependencies" \
+				"[0x101F7961],0,0,0,{\"S60ProductID\"}" \
+				"[0x2001E61C],4,6,3,{"Qt"}
+				
+default_deployment.pkg_prerules =	packageheader \
+									vendorinfo \
+									dependencyinfo 
+
+#Copy the dependent DLL
+symbian: {
+	addFile1.sources = ./data/TestUnieditorSMSPluginSample.txt
+	addFile1.path = C:/data/
+	DEPLOYMENT += addFile1
+	
+	addFile2.sources = ./data/TestUnieditorSMSPluginSample.vcf
+	addFile2.path = C:/data/
+	DEPLOYMENT += addFile2
+	
+	addFile3.sources = ./data/TestUnieditorSMSPluginSample.vcs
+	addFile3.path = C:/data/
+	DEPLOYMENT += addFile3
+	}
+	
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/tsrc.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,21 @@
+#
+# 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: Project file for testunieditorsmsplugin
+#
+
+TEMPLATE = subdirs
+
+SUBDIRS += testunieditorsmsplugin
+
+CONFIG += ordered
\ No newline at end of file
--- a/messagingapp/shareui/inc/shareuiprivate.h	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/shareui/inc/shareuiprivate.h	Fri Sep 17 08:28:39 2010 +0300
@@ -35,6 +35,7 @@
 class HbListViewItem;
 class HbTextItem;
 class HbIconItem;
+class QTranslator;
 
 #define SERVICE_INTERFACE "com.nokia.symbian.IFileShare"
 #define SHARE_OP "send(QVariant)"
@@ -228,6 +229,18 @@
     XQApplicationManager mAppManager;
     
     /**
+     * Translator member variable
+     * Owned
+     */ 
+    QTranslator* mTranslator;
+    
+    /**
+     * Translator member variable
+     * Owned
+     */
+    QTranslator* mTranslator_comm;
+    
+    /**
      * Whether to launch the sending application as embedded or not.
      */
     bool mIsEmbedded;  
--- a/messagingapp/shareui/shareui.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/shareui/shareui.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -55,6 +55,8 @@
     
 SOURCES += shareui.cpp \
     	   shareuiprivate.cpp
+    	   
+TRANSLATIONS = share.ts
 
 LIBS += -lxqservice \
         -lxqserviceutil
--- a/messagingapp/shareui/src/shareuiprivate.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/shareui/src/shareuiprivate.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -23,6 +23,9 @@
 #include <QStringList>
 #include <QGraphicsLinearLayout>
 
+#include <QTranslator>
+#include <QLocale>
+#include <hbapplication.h>
 #include <HbAction>
 #include <HbDialog>
 #include <HbLabel>
@@ -39,20 +42,12 @@
 // USER INCLUDES
 #include "shareuiprivate.h"
 
-// Localized Constants
-//#define LOC_SEND_SELECTED_ITEM  hbTrId("txt_shareui_send_selected_item")
-//#define LOC_BUTTON_CANCEL       hbTrId("txt_shareui_button_cancel")
-//#define LOC_NO_SERVICES         hbTrId("txt_shareui_no_services")
-//#define LOC_NO_FILES            hbTrId("txt_shareui_no_files")
-//#define LOC_SERVICE_ERROR       hbTrId("txt_shareui_service_error")
-//#define LOC_PROTECTED_CONTENT   hbTrId("txt_shareui_protected_content")
-
-#define LOC_SEND_SELECTED_ITEM  hbTrId("Send selected item")
-#define LOC_BUTTON_CANCEL       hbTrId("Cancel")
-#define LOC_NO_SERVICES         hbTrId("No services found.")
-#define LOC_NO_FILES            hbTrId("No files found.")
-#define LOC_SERVICE_ERROR       hbTrId("Service error.")
-#define LOC_PROTECTED_CONTENT   hbTrId("Protected content.")
+#define LOC_TITLE_SHARING_METHODS  hbTrId("txt_share_title_sharing_methods")
+#define LOC_BUTTON_CANCEL       hbTrId("txt_common_button_cancel")
+#define LOC_NO_SERVICES         hbTrId("txt_shareui_no_services ")
+#define LOC_SERVICE_ERROR       hbTrId("txt_shareui_service_error")
+#define LOC_PROTECTED_CONTENT   hbTrId("txt_shareui_protected_content")
+#define LOC_NO_FILES            hbTrId("txt_shareui_no_files")
 
 const QString LIST_ITEM_TITLE("qtc_list_item_title_normal");
 
@@ -64,6 +59,18 @@
     mContentItemModel = 0;
     mContentListView = 0;
     mSharePopup = 0;
+    
+    QString locale = QLocale::system().name();
+    QString path = "z:/resource/qt/translations/";
+        
+    mTranslator = new QTranslator();
+    mTranslator_comm = new QTranslator();
+    
+    bool result = mTranslator->load(path + QString("share_") + locale);
+    result = mTranslator_comm->load(path + QString("common_") + locale);
+    qApp->installTranslator(mTranslator);
+    qApp->installTranslator(mTranslator_comm);
+    
     }
 
 /**
@@ -71,6 +78,8 @@
  */
 ShareUiPrivate::~ShareUiPrivate()
     {
+    delete mTranslator;
+    delete mTranslator_comm;
     }
 
 /**
@@ -205,7 +214,7 @@
     mSharePopup = new HbDialog();
     // make it delete itself on close
     mSharePopup->setAttribute( Qt::WA_DeleteOnClose, true );
-    HbTextItem* heading = new HbTextItem(LOC_SEND_SELECTED_ITEM, mSharePopup);
+    HbTextItem* heading = new HbTextItem(LOC_TITLE_SHARING_METHODS, mSharePopup);
     QColor color = HbColorScheme::color( LIST_ITEM_TITLE );
     heading->setTextColor( color );
     heading->setAlignment(Qt::AlignCenter);
--- a/messagingappbase/obexmtms/Group/bld.inf	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingappbase/obexmtms/Group/bld.inf	Fri Sep 17 08:28:39 2010 +0300
@@ -24,12 +24,12 @@
 PRJ_PLATFORMS
 DEFAULT
 
-#include "../obexmtm/obexutil/group/BLD.INF"
-#include "../obexmtm/obexclient/group/BLD.INF"
-#include "../obexmtm/obexserver/group/BLD.INF"
-#include "../btmtm/btclient/group/BLD.INF"
-#include "../btmtm/btserver/group/BLD.INF"
-#include "../irmtm/irclient/group/BLD.INF"
-#include "../irmtm/irserver/group/BLD.INF"
+#include "../obexmtm/obexutil/group/bld.inf"
+#include "../obexmtm/obexclient/group/bld.inf"
+#include "../obexmtm/obexserver/group/bld.inf"
+#include "../btmtm/btclient/group/bld.inf"
+#include "../btmtm/btserver/group/bld.inf"
+#include "../irmtm/irclient/group/bld.inf"
+#include "../irmtm/irserver/group/bld.inf"
 #include "../Rom/bld.inf"
 #include "../TObexMTM/GROUP/bld.inf"
--- a/messagingappbase/smilparser/GROUP/bld.inf	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingappbase/smilparser/GROUP/bld.inf	Fri Sep 17 08:28:39 2010 +0300
@@ -26,6 +26,6 @@
 
 // Subproject builds
 #include "../SMILdtd/GROUP/bld.inf"
-#include "../Rom/BLD.INF"
+#include "../Rom/bld.inf"
 
 PRJ_MMPFILES
--- a/messagingappbase/smilparser/SMILdtd/SRC/Smildtd.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingappbase/smilparser/SMILdtd/SRC/Smildtd.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -19,7 +19,7 @@
 // 
 //
 
-#include "smildtd.h"
+#include "SmilDtd.h"
 #include "SmilData.h"
 #include <stringpool.h>
 #include "smilelements.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmsengine/applicationadapter/bld/bld.inf	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build information file
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+WINSCW ARMV5
+
+
+PRJ_MMPFILES
+
+mmsapplicationadapter.mmp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmsengine/clientmtm/bld/bld.inf	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build information file
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+WINSCW ARMV5
+
+
+PRJ_MMPFILES
+
+mmsclient.mmp
+
+
+PRJ_EXPORTS
+
+../inc/mmsnotificationclient.h |../../../inc/mmsnotificationclient.h
Binary file mmsengine/conf/CI_mmsengine.confml has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmsengine/genutils/bld/bld.inf	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build information file
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+WINSCW ARMV5
+
+
+PRJ_MMPFILES
+
+mmsgenutils.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmsengine/group/bld.inf	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build information file
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+WINSCW ARMV5
+
+
+
+PRJ_EXPORTS
+
+../rom/MmsEngine.iby CORE_APP_LAYER_IBY_EXPORT_PATH(MmsEngine.iby)
+../inc/mmsgenutils.h |../../inc/mmsgenutils.h
+../inc/mmsmsventry.h |../../inc/mmsmsventry.h
+../inc/mmsmsventry.inl |../../inc/mmsmsventry.inl
+../inc/mmsattachmentwaiter.h |../../inc/mmsattachmentwaiter.h
+../inc/mmsattachmenthandler.h |../../inc/mmsattachmenthandler.h
+../inc/mmscmds.h |../../inc/mmscmds.h
+backup_registration.xml /epoc32/data/z/private/100058DB/backup_registration.xml
+../loc/MmsUi.loc APP_LAYER_LOC_EXPORT_PATH(mmsui.loc)
+
+
+../conf/mmsengine.confml APP_LAYER_CONFML(mmsengine.confml)
+../conf/CI_mmsengine.confml APP_LAYER_CONFML(CI_mmsengine.confml)
+../conf/mmsengine_100058DB.crml APP_LAYER_CRML(mmsengine_100058db.crml)
+../conf/mmsengine_101FB0D5.crml APP_LAYER_CRML(mmsengine_101fb0d5.crml)
+../conf/mmsengine_101FB0D5.crml APP_LAYER_CRML(mmsengine_101fb0d9.crml)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmsengine/mmscodec/bld/bld.inf	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build information file
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+WINSCW ARMV5
+
+
+PRJ_MMPFILES
+mmscodec.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmsengine/mmscodecclient/bld/bld.inf	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build information file
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+WINSCW ARMV5
+
+
+PRJ_MMPFILES
+
+mmscodecclient.mmp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmsengine/mmsconninit/bld/bld.inf	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build information file
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+WINSCW ARMV5
+
+
+PRJ_MMPFILES
+
+mmsconninit.mmp
+
--- a/mmsengine/mmsengine.pro	Thu Sep 02 20:23:03 2010 +0300
+++ b/mmsengine/mmsengine.pro	Fri Sep 17 08:28:39 2010 +0300
@@ -46,8 +46,7 @@
 #### loc file needed for rsc generation
     "./loc/MmsUi.loc                              APP_LAYER_LOC_EXPORT_PATH(mmsui.loc)" \
 #### Export confml and crml files ####
-    "./conf/mmsengine.confml                      APP_LAYER_CONFML(mmsengine.confml)" \
-    "./conf/CI_mmsengine.confml                   APP_LAYER_CONFML(CI_mmsengine.confml)" \
+    "./conf/mmsengine.confml                      APP_LAYER_CONFML(mmsengine.confml)" \    
     "./conf/mmsengine_100058DB.crml               APP_LAYER_CRML(mmsengine_100058db.crml)" \
     "./conf/mmsengine_101FB0D5.crml               APP_LAYER_CRML(mmsengine_101fb0d5.crml)" \
     "./conf/mmsengine_101FB0D5.crml               APP_LAYER_CRML(mmsengine_101fb0d9.crml)"    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmsengine/mmshttptransport/bld/bld.inf	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build information file
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+WINSCW ARMV5
+
+
+PRJ_MMPFILES
+
+mmstransport.mmp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmsengine/mmsmessage/bld/bld.inf	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build information file
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+WINSCW ARMV5
+
+
+PRJ_MMPFILES
+
+mmsmessage.mmp
+
+
+PRJ_EXPORTS
+
+../inc/mmsheaders.h |../../../inc/mmsheaders.h
+../inc/mmsheaders.inl |../../../inc/mmsheaders.inl
+../inc/mmssendingchain.h |../../../inc/mmssendingchain.h
+../inc/mmssendingchain.inl |../../../inc/mmssendingchain.inl
+../inc/mmsdeleteresultarray.h |../../../inc/mmsdeleteresultarray.h
+../inc/mmsdeleteresultarray.inl |../../../inc/mmsdeleteresultarray.inl
\ No newline at end of file
--- a/mmsengine/mmsmessage/bld/mmsmessage.mmp	Thu Sep 02 20:23:03 2010 +0300
+++ b/mmsengine/mmsmessage/bld/mmsmessage.mmp	Fri Sep 17 08:28:39 2010 +0300
@@ -42,7 +42,6 @@
 SOURCE          mmscliententry.cpp
 SOURCE          mmsserverentry.cpp
 SOURCE          mmsdrm.cpp
-//SOURCE          mmsownnumber.cpp
 
 USERINCLUDE     ../inc
 USERINCLUDE     ../../inc
@@ -63,8 +62,6 @@
 LIBRARY         mmsserversettings.lib
 LIBRARY         charconv.lib
 LIBRARY         centralrepository.lib
-//LIBRARY         VPbkEng.lib
-
 LIBRARY         caf.lib
 LIBRARY         cafutils.lib
 LIBRARY         drmrights.lib
--- a/mmsengine/mmsmessage/inc/mmsownnumber.h	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-// End of File
--- a/mmsengine/mmsmessage/src/mmsmessageoperation.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/mmsengine/mmsmessage/src/mmsmessageoperation.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -32,9 +32,7 @@
 #include    "mmssettings.h"
 #include    "mmsheaders.h"
 #include    "mmsgenutils.h"
-#include    "mmsownnumber.h"
 
-// EXTERNAL DATA STRUCTURES
 
 // EXTERNAL FUNCTION PROTOTYPES  
 extern void gPanic( TMmsPanic aPanic );
--- a/mmsengine/mmsmessage/src/mmsownnumber.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,546 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:   Check id any of given numbers is caller's own number
-*
-*/
-
-
-
-
-// INCLUDE FILES
-#include    "mmsownnumber.h"
-#include    "mmsgenutils.h"
-#include    <e32std.h>
-#include    <badesca.h>
-#include    <centralrepository.h>
-#include    <telconfigcrkeys.h>
-
-#include    <CVPbkContactManager.h>
-#include    <VPbkContactStoreUris.h>
-#include    <CVPbkContactStoreUriArray.h>
-#include    <MVPbkContactLinkArray.h>
-#include    <MVPbkContactLink.h>
-#include    <TVPbkContactStoreUriPtr.h>
-#include    <MVPbkContactStoreList.h>
-#include    <MVPbkContactOperationBase.h>
-#include    <MVPbkStoreContact.h>
-#include    <MVPbkFieldType.h>
-#include    <MVPbkContactFieldTextData.h>
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CMmsOwnNumber::CMmsOwnNumber
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-CMmsOwnNumber::CMmsOwnNumber()
-    : CActive( EPriorityNormal ),
-    iIndex( KErrNotFound )
-    {
-    CActiveScheduler::Add(this);
-    }
-
-// -----------------------------------------------------------------------------
-// CMmsOwnNumber::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void CMmsOwnNumber::ConstructL( RFs* aFs )
-    {
-    iFs = aFs;
-    
-    // The function is supposed to get a descriptor with packed URIs.
-    // As we only have one URI we assume it is packed enough
-    CVPbkContactStoreUriArray* storeArray = CVPbkContactStoreUriArray::NewLC();
-    TVPbkContactStoreUriPtr uriPtr( VPbkContactStoreUris::SimGlobalOwnNumberUri() );
-    storeArray->AppendL( uriPtr );
-    
-    // TEST TRY ALSO DEFAULT DATABASE AS SIM DATABASE DOES NOT WORK IN WINS
-    
-/*    
-    TVPbkContactStoreUriPtr uriPtr2( VPbkContactStoreUris::DefaultCntDbUri() );
-    storeArray->AppendL( uriPtr2 );
-*/    
-    // END OF TEST
-    
-    iNumberOfStores = storeArray->Count();
-    iNumberOfOpenStores = iNumberOfStores; // otimistic
-    
-    // Open the database with the URI that specifies our own number
-    iContactManager = CVPbkContactManager::NewL( *storeArray, aFs );
-    
-	CleanupStack::PopAndDestroy( storeArray );
-	
-	iContactList = &(iContactManager->ContactStoresL());
-	
-	//Let's find the number of digits to match
-    iDigitsToMatch = KMmsNumberOfDigitsToMatch ;
-
-    CRepository* repository = NULL;
-    TInt error = KErrNone;
-    TRAP( error, repository = CRepository::NewL( KCRUidTelConfiguration ));
-    if ( error == KErrNone)
-        {
-        error = repository->Get( KTelMatchDigits, iDigitsToMatch );
-        delete repository;
-        if( error != KErrNone )
-            {
-            iDigitsToMatch=KMmsNumberOfDigitsToMatch;
-            }
-    	}
-    }
-
-// -----------------------------------------------------------------------------
-// CMmsOwnNumber::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CMmsOwnNumber* CMmsOwnNumber::NewL( RFs* aFs )
-    {
-    CMmsOwnNumber* self = new( ELeave ) CMmsOwnNumber;
-    
-    CleanupStack::PushL( self );
-    self->ConstructL( aFs );
-    CleanupStack::Pop( self );
-
-    return self;
-    }
-
-    
-// Destructor
-CMmsOwnNumber::~CMmsOwnNumber()
-    {
-	Cancel();
-	delete iContact;
-	delete iOperation;
-	delete iResultArray;
-	delete iContactManager;
-    }
-    
-// ---------------------------------------------------------
-// CMmsOwnNumber::DoCancel
-// ---------------------------------------------------------
-//
-void CMmsOwnNumber::DoCancel()
-    {
-	delete iOperation;
-	iOperation = NULL;
-	TRequestStatus* s=&iStatus;
-    User::RequestComplete(s, KErrCancel);
-    }
-
-// ---------------------------------------------------------
-// CMmsOwnNumber::RunL
-// ---------------------------------------------------------
-//
-void CMmsOwnNumber::RunL()
-    {
-    
-    delete iOperation;
-    iOperation = NULL;
-    
-    if ( iStatus != KErrNone )
-        {
-#ifdef _DEBUG
-        TMmsGenUtils::Log( _L("OwnNumber: RunL status: %d "), iStatus.Int() );
-#endif
-
-       	// Exit current scheduler loop, resuming execution of the StartL() function
-      	iActiveSchedulerWait.AsyncStop();
-      	return;
-        }
-    
-    switch ( iState )
-        {
-        case EMmsOwnNumberOpening:
-            {
-            iState = EMmsOwnNumberSearching;
-            iMatch = EFalse;
-            SearchL();
-            break;
-            }
-        case EMmsOwnNumberSearching:
-            {
-            iState = EMmsOwnNumberCheckingDuplicates;
-            CheckDuplicatesL();
-            break;
-            }
-        case EMmsOwnNumberCheckingDuplicates:
-            {
-            iState = EMmsOwnNumberIdle;
-            iContactList->CloseAll( *this );
-            break;
-            }
-        default:
-            {
-            break;
-            }
-        }
-    if ( !IsActive() )
-        {
-       	// Exit current scheduler loop, resuming execution of the StartL() function
-        delete iResultArray;
-        iResultArray = NULL;
-      	iActiveSchedulerWait.AsyncStop();
-        }
-    }
-    
-// ---------------------------------------------------------
-// CMmsOwnNumber::RunError
-// ---------------------------------------------------------
-//
-
-#ifdef _DEBUG
-TInt CMmsOwnNumber::RunError( TInt aError )
-#else
-TInt CMmsOwnNumber::RunError( TInt /* aError */ )
-#endif
-    {
-#ifdef _DEBUG
-    TMmsGenUtils::Log( _L("OwnNumber: RunError: %d "), aError );
-    TMmsGenUtils::Log( _L("OwnNumber: state: %d "), iState );
-#endif
-    delete iOperation;
-    iOperation = NULL;
-    delete iResultArray;
-    iResultArray = NULL;
-  	iActiveSchedulerWait.AsyncStop();	//Exit current scheduler loop, resuming execution of the Start() function
-  	return KErrNone;
-    }
-
-// ---------------------------------------------------------
-// CMmsOwnNumber::FindCompleteL
-// ---------------------------------------------------------
-//
-void CMmsOwnNumber::FindCompleteL( MVPbkContactLinkArray* aResults )
-    {
-#ifdef _DEBUG
-    TMmsGenUtils::Log( _L("OwnNumber::FindCompleteL ") );
-#endif
-    iResultArray = aResults;
-    iContactToMatch = iResultArray->Count(); // point beyound the array
-    iMatch = EFalse;
-    
-    // check the result array for matches and set our index accordingly
-    if ( iResultArray->Count() == 0 )
-        {
-        // we are responsible for the results array if we did not leave.
-        delete iResultArray;
-        iResultArray = 0;
-        // no match found - this is not our own number
-        iNumberToMatch++;
-        if ( iNumberToMatch < iNumberList->MdcaCount() )
-            {
-            // try the next one
-            iState = EMmsOwnNumberOpening;
-            }
-        }
-    else
-        {
-        // we found at least one match.
-        // What do we do now...
-        // Analyze the result in detail or just say "This is our own number"...
-        
-        // First approximation: Say this is our own.
-        // Actually exact match cases should be checked, too (short number)
-        // And possible email match, but that needs a different search function
-                
-        // save the match and return to RunL
-        // It will stop the active scheduler and allow the code to return to caller
-        iIndex = iNumberToMatch;
-        if ( iNumberList->MdcaPoint( iNumberToMatch ).Length() < iDigitsToMatch ||
-            iResultArray->Count() > 1 )
-            {
-            // need exact match, start from first item in the array
-            iContactToMatch = 0;
-            }
-        }
-    TRequestStatus* s=&iStatus;
-    User::RequestComplete( s, KErrNone );
-    }
-    
-// ---------------------------------------------------------
-// CMmsOwnNumber::FindFailed
-// ---------------------------------------------------------
-//
-void CMmsOwnNumber::FindFailed(TInt aError)
-    {
-#ifdef _DEBUG
-    TMmsGenUtils::Log( _L("OwnNumber: FindFailed: %d "), aError );
-#endif
-    iIndex = aError;
- 	TRequestStatus* s=&iStatus;
-    iNumberToMatch++;
-    if ( iNumberToMatch < iNumberList->MdcaCount() )
-        {
-        // try the next one
-        iState = EMmsOwnNumberOpening;
-        }
-    User::RequestComplete( s, KErrNone );
-    }
-    
-// ---------------------------------------------------------
-// CMmsOwnNumber::OpenComplete
-// ---------------------------------------------------------
-//
-void CMmsOwnNumber::OpenComplete()
-    {
-    // if opening fails, StoreUnavailable is called
-#ifdef _DEBUG
-    TMmsGenUtils::Log( _L("OwnNumber::OpenCompleteL") );
-#endif
-	TRequestStatus* s=&iStatus;
-    User::RequestComplete( s, KErrNone );
-    }
-    
-// ---------------------------------------------------------
-// CMmsOwnNumber::StoreReady
-// ---------------------------------------------------------
-//
-void CMmsOwnNumber::StoreReady(MVPbkContactStore& /*aContactStore*/)
-    {
-    // Nothing to do here
-#ifdef _DEBUG
-    TMmsGenUtils::Log( _L("OwnNumber::StoreReady") );
-#endif
-    }
-    
-// ---------------------------------------------------------
-// CMmsOwnNumber::StoreUnavailable
-// ---------------------------------------------------------
-//
-void CMmsOwnNumber::StoreUnavailable(MVPbkContactStore& /*aContactStore*/, TInt /*aReason*/)
-    {
-#ifdef _DEBUG
-    TMmsGenUtils::Log( _L("OwnNumber::StoreUnavailable") );
-#endif
-    iNumberOfOpenStores--;
-    }
-    
-// ---------------------------------------------------------
-// CMmsOwnNumber::HandleStoreEventL
-// ---------------------------------------------------------
-//
-void CMmsOwnNumber::HandleStoreEventL(
-    MVPbkContactStore& /*aContactStore*/, 
-    TVPbkContactStoreEvent /*aStoreEvent*/)
-    {
-    
-    }
-    
-// ---------------------------------------------------------
-// CMmsOwnNumber::VPbkSingleContactOperationComplete
-// ---------------------------------------------------------
-//
-void CMmsOwnNumber::VPbkSingleContactOperationComplete(
-    MVPbkContactOperationBase& /*aOperation*/,
-    MVPbkStoreContact* aContact)    
-    {
-#ifdef _DEBUG
-    TMmsGenUtils::Log( _L("OwnNumber::VPbkSingleContactOperationComplete") );
-#endif
-    iContact = aContact;
-    
-    MVPbkBaseContactFieldCollection& fields = iContact->Fields();
-    
-    TInt fieldCount = fields.FieldCount();
-    
-    TInt i;
-    
-/*    
-    const TInt maxMatchPriority = iContactManager->FieldTypes().MaxMatchPriority();
-*/    
-    for ( i = 0; i < fieldCount && !iMatch ; i++ )
-        {
-        const MVPbkBaseContactField& field = fields.FieldAt( i );
-/*        
-        const MVPbkFieldType* fieldType = field.MatchFieldType( maxMatchPriority );
-*/        
-        const MVPbkContactFieldData& fieldData =  field.FieldData();
-        
-        // I could not figure out how to check the actual field type
-        // (phone number or email or what), we must try all text fields
-        if ( fieldData.DataType() == EVPbkFieldStorageTypeText )
-            {
-            const MVPbkContactFieldTextData& textData = MVPbkContactFieldTextData::Cast(fieldData);
-            // Now we finally have the data we can compare with our own data
-            if ( textData.Text().Compare( iNumberList->MdcaPoint( iNumberToMatch ) ) == 0 )
-                {
-                // exact match.
-                iMatch = ETrue;
-                }
-            }
-        }
-    
-    delete iContact;
-    iContact = NULL;
-    
-    iContactToMatch++;
-    
-    if ( !iMatch && iContactToMatch < iResultArray->Count() )
-        {
-        iState = EMmsOwnNumberSearching;
-        }
-    else if ( !iMatch )
-        {
-        // This was not an exact match
-        iIndex = KErrNotFound;
-        delete iResultArray;
-        iResultArray = 0;
-        iNumberToMatch++;
-        if ( iNumberToMatch < iNumberList->MdcaCount() )
-            {
-            // try the next one if any left
-            iState = EMmsOwnNumberOpening;
-            }
-        }
-    else
-        {
-        // keep LINT happy.
-        }
-        
- 	TRequestStatus* s=&iStatus;
-    User::RequestComplete( s, KErrNone );
-    }
-
-// ---------------------------------------------------------
-// CMmsOwnNumber::
-// ---------------------------------------------------------
-//
-void CMmsOwnNumber::VPbkSingleContactOperationFailed(
-    MVPbkContactOperationBase& /*aOperation*/, 
-#ifdef _DEBUG
-    TInt aError)
-#else    
-    TInt /*aError*/)
-#endif
-    {
-#ifdef _DEBUG
-    TMmsGenUtils::Log( _L("OwnNumber: ContactOperationFailed: %d "), aError );
-#endif
-    // If not found iMatch stays false
-    iContactToMatch++;
-    
- 	TRequestStatus* s=&iStatus;
-    User::RequestComplete( s, KErrNone );
-    }
-
-    
-// ---------------------------------------------------------
-// CMmsOwnNumber::StartL
-// ---------------------------------------------------------
-//
-TInt CMmsOwnNumber::StartL( const CDesCArray& aNumberList )
-    {
-    iIndex = KErrNotFound;
-    delete iOperation;
-    iOperation = NULL;
-    
-    if ( aNumberList.MdcaCount() <= 0)
-        {
-        return iIndex; // no contacts, not found
-        }
-    iNumberList = &aNumberList;
-    iNumberToMatch = 0;
-    iContactToMatch = 0;
-        
-    iContactList->OpenAllL( *this );
-        
-    // We must set ourselves to pending because we don't give our status to anybody
-    // When search is complete, the functions call our callbacks, and we complete ourselves
-    iState = EMmsOwnNumberOpening;
-    iStatus = KRequestPending;
-	SetActive();
-	iActiveSchedulerWait.Start();	//Re-enter the active scheduler--execution halts here until RunL is called
-	
-	// after iActiveSchedulerWait has been stopped execution continues here
-	
-	return iIndex; // return the possible index of caller's number
-    }
-    
-// ---------------------------------------------------------
-// CMmsOwnNumber::SearchL
-// ---------------------------------------------------------
-//
-void CMmsOwnNumber::SearchL()
-    {
-#ifdef _DEBUG
-    TMmsGenUtils::Log( _L("OwnNumber::SearchL") );
-#endif
-  	// Try checking number of open stores to see if anything was opened
-    if ( iNumberOfOpenStores > 0 )
-        {
-        iOperation = iContactManager->MatchPhoneNumberL(
-            iNumberList->MdcaPoint( iNumberToMatch ), iDigitsToMatch, *this );
-    
-        // We must set ourselves to pending because we don't give our status to anybody
-        // When search is complete, the functions call our callbacks, and we complete ourselves
-        iStatus = KRequestPending;
-	    SetActive();
-        }
-    // If we do not become active, RunL stops ActiveSchedulerWait
-    }
-    
-// ---------------------------------------------------------
-// CMmsOwnNumber::CheckDuplicatesL
-// ---------------------------------------------------------
-//
-void CMmsOwnNumber::CheckDuplicatesL()
-    {
-    // If more than one contact found or length of number is less than the 
-    // match number length, check for exact match
-    
-    // The match array is in iResultArray
-    
-#ifdef _DEBUG
-    TMmsGenUtils::Log( _L("OwnNumber::CheckDuplicatesL") );
-#endif
-    delete iContact;
-    iContact = NULL;
-    
-    TInt count = 0;
-    if ( iResultArray )
-        {
-        count = iResultArray->Count();
-        }
-    
-    if (  iContactToMatch < count )
-        {
-        iMatch = EFalse;
-        iState = EMmsOwnNumberSearching;
-        iOperation = iContactManager->RetrieveContactL(
-                iResultArray->At( iContactToMatch ),
-                *this);
-        iStatus = KRequestPending;
-        SetActive();
-        }
-    else
-        {
-        delete iResultArray;
-        iResultArray = NULL;
-        iStatus = KRequestPending;
-        SetActive();
- 	    TRequestStatus* s=&iStatus;
-        User::RequestComplete( s, KErrNone );
-        }
-    
-    }
-    
-    
-    
-// ========================== OTHER EXPORTED FUNCTIONS =========================
-
-//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmsengine/mmspushhandler/bld/bld.inf	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build information file
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+WINSCW ARMV5
+
+
+PRJ_MMPFILES
+
+mmspushhandler.mmp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmsengine/mmsserver/bld/bld.inf	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build information file
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+WINSCW ARMV5
+
+
+PRJ_MMPFILES
+mmsserver.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmsengine/mmsserversettings/bld/bld.inf	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build information file
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+WINSCW ARMV5
+
+
+PRJ_MMPFILES
+
+mmsserversettings.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mmsengine/mmswatcher/bld/bld.inf	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build information file
+*
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+WINSCW ARMV5
+
+
+PRJ_MMPFILES
+
+mmswatcher.mmp
--- a/package_definition.xml	Thu Sep 02 20:23:03 2010 +0300
+++ b/package_definition.xml	Fri Sep 17 08:28:39 2010 +0300
@@ -1,186 +1,173 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<SystemDefinition schema="3.0.0">
-  <package id="messaging" name="Messaging Apps" levels="mail eng base ui">
-    <collection id="mobilemessaging" name="Mobile Messaging" level="ui">
-      <component id="audiomsg" filter="s60" name="Audio Message">
-        <unit bldFile="mobilemessaging/audiomsg/group"/>
-      </component>
-      <component id="msgmedia" filter="s60" name="Message Media">
-        <unit bldFile="mobilemessaging/msgmedia/group"/>
-      </component>
-      <component id="unieditor" filter="s60" name="Unified Editor">
-        <unit bldFile="mobilemessaging/unieditor/group"/>
-      </component>
-      <component id="mmsui" filter="s60" name="MMS UI">
-        <unit bldFile="mobilemessaging/mmsui/group"/>
-      </component>
-      <component id="postcard" filter="s60" name="Postcard">
-        <unit bldFile="mobilemessaging/postcard/group"/>
-      </component>
-      <component id="smilui" filter="s60" name="SMIL UI">
-        <unit bldFile="mobilemessaging/smilui/group"/>
-      </component>
-      <component id="smum" filter="s60" name="SMS UI MTM and UI Data MTM" class="plugin">
-        <unit bldFile="mobilemessaging/smum/group"/>
-      </component>
-      <component id="smsui" filter="s60" name="SMS UI">
-        <unit bldFile="mobilemessaging/smsui/group"/>
-		<!-- does this bld.inf need to be included in the group one? -->
-        <!-- <unit bldFile="mobilemessaging/smsui/viewer"/> -->
-      </component>
-      <component id="smsmtm" name="SMS MTM" purpose="optional" class="plugin">
-        <unit bldFile="mobilemessaging/smsmtm/group" mrp="mobilemessaging/smsmtm/group/messaging_sms.mrp"/>
-      </component>
-    </collection>
-    <collection id="mmsengine" name="MMS Engine" level="eng">
-      <component id="mmsconninit" filter="s60" name="MMS Connection Initiator">
-        <!-- <unit bldFile="mmsengine/mmsconninit/bld"/> -->
-      </component>
-      <component id="genutils" filter="s60" name="General Utils">
-        <!-- <unit bldFile="mmsengine/genutils/bld"/> -->
-      </component>
-      <component id="mmsserversettings" filter="s60" name="MMS Server Settings">
-        <!-- <unit bldFile="mmsengine/mmsserversettings/bld"/> -->
-      </component>
-      <component id="mmsmessage" filter="s60" name="MMS Message">
-        <!-- <unit bldFile="mmsengine/mmsmessage/bld"/> -->
-      </component>
-      <component id="mmshttptransport" filter="s60" name="MMS HTTP Transport">
-        <!-- <unit bldFile="mmsengine/mmshttptransport/bld"/> -->
-      </component>
-      <component id="mmscodec" filter="s60" name="MMS Codec">
-        <!-- <unit bldFile="mmsengine/mmscodec/bld"/> -->
-      </component>
-      <component id="mmsserver" filter="s60" name="MMS Server">
-        <!-- <unit bldFile="mmsengine/mmsserver/bld"/> -->
-      </component>
-      <component id="clientmtm" filter="s60" name="MMS Client MTM" class="plugin">
-        <!-- <unit bldFile="mmsengine/clientmtm/bld"/> -->
-      </component>
-      <component id="mmswatcher" filter="s60" name="MMS Watcher" class="plugin">
-        <!-- <unit bldFile="mmsengine/mmswatcher/bld"/> -->
-      </component>
-      <component id="mmspushhandler" filter="s60" name="MMS Push Handler" class="plugin">
-        <!-- <unit bldFile="mmsengine/mmspushhandler/bld"/> -->
-      </component>
-      <component id="applicationadapter" filter="s60" name="MMS Application Adapter">
-        <!-- <unit bldFile="mmsengine/applicationadapter/bld"/> -->
-      </component>
-      <component id="mmscodecclient" filter="s60" name="MMS Codec Client">
-        <!-- <unit bldFile="mmsengine/mmscodecclient/bld"/> -->
-      </component>
-      <component id="mmssettings" name="MMS Settings" introduced="9.2" purpose="optional">
-        <unit bldFile="mmsengine/mmssettings/group" mrp="mmsengine/mmssettings/group/messaging_mmssettings.mrp"/>
-      </component>
-      <component id="mmsconf" name="MMS Configuration" purpose="optional">
-		<unit bldFile="mmsengine/mmsconf" mrp="mmsengine/mmsconf/messaging_mmssettings-config.mrp"/>
-      </component>
-      <component id="mmsengine_build" filter="s60" name="MMS Engine Build">
-	   <!-- this bld.inf should be broken up into the individual other components -->
-        <unit bldFile="mmsengine/group"/>
-      </component>
-    </collection>
-    <collection id="messagingappbase" name="Messaging App Base" level="base">
-      <component id="msgavkon" filter="s60" name="Messaging Avkon UI">
-        <unit bldFile="messagingappbase/msgavkon/group"/>
-      </component>
-      <component id="mce" filter="s60" name="Message Center Application">
-        <unit bldFile="messagingappbase/mce/group"/>
-      </component>
-      <component id="mceextraitems" filter="s60" name="Message Center Extra Items">
-        <unit bldFile="messagingappbase/mceextraitems/group"/>
-      </component>
-      <component id="mcesettings" filter="s60" name="Message Center Settings">
-        <unit bldFile="messagingappbase/mcesettings/group"/>
-      </component>
-      <component id="msgerrorwatcher" filter="s60" name="Messaging Error Watcher" class="plugin">
-        <unit bldFile="messagingappbase/msgerrorwatcher/group"/>
-      </component>
-      <component id="ncnlist" filter="s60" name="New Contacts Note List">
-        <unit bldFile="messagingappbase/ncnlist/group"/>
-      </component>
-      <component id="schemeplugin" filter="s60" name="Scheme Handler Plugin" class="plugin">
-        <unit bldFile="messagingappbase/schemeplugin/group"/>
-      </component>
-      <component id="sendui" filter="s60" name="Send UI" class="plugin">
-        <unit bldFile="messagingappbase/sendui/group"/>
-		<!-- do these bld.infs need to be included in the group one? -->
-        <!-- <unit bldFile="messagingappbase/sendui/drmlinksender/group"/> -->
-        <!-- <unit bldFile="messagingappbase/sendui/genericmtmplugin/group"/> -->
-        <!-- <unit bldFile="messagingappbase/sendui/meetingrequestsender/group"/> -->
-      </component>
-      <component id="smilengine" filter="s60" name="SMIL Engine">
-        <unit bldFile="messagingappbase/smilengine/group"/>
-      </component>
-      <component id="bium" filter="s60" name="BIO UI MTM" class="plugin">
-        <unit bldFile="messagingappbase/bium/group"/>
-      </component>
-      <component id="smartmessaging" filter="s60" name="Smart Messaging">
-        <unit bldFile="messagingappbase/smartmessaging/group"/>
-      </component>
-      <component id="msgeditor" filter="s60" name="Messaging Editor">
-        <unit bldFile="messagingappbase/msgeditor/group"/>
-      </component>
-      <component id="smilparser" name="SMIL Parser" introduced="7.0s" purpose="optional">
-        <unit bldFile="messagingappbase/smilparser/GROUP" mrp="messagingappbase/smilparser/GROUP/messaging_gmxml.mrp"/>
-      </component>
-      <component id="obexmtms" name="OBEX MTMs" introduced="7.0s" purpose="optional" class="plugin">
-        <unit bldFile="messagingappbase/obexmtms/Group" mrp="messagingappbase/obexmtms/Group/messaging_obex.mrp"/>
-      </component>
-    </collection>
-    <collection id="email" name="Email" level="mail">
-		<!-- use commonemail instead -->
-      <component id="alwaysonlineemailplugin" filter="s60" name="Always Online Mail Plugin" class="plugin" deprecated="^3">
-        <unit bldFile="email/alwaysonlineemailplugin/group"/>
-      </component>
-      <component id="emailnotificationhandler" filter="s60" name="Email Notification Handler" class="plugin" deprecated="^3">
-        <unit bldFile="email/emailnotificationhandler/group"/>
-      </component>
-      <component id="imum" filter="s60" name="Internet Mail UI MTM" class="plugin" deprecated="^3">
-        <unit bldFile="email/imum/group"/>
-		<!-- do these bld.infs need to be included in the group one? -->
-        <!-- <unit bldFile="email/imum/domainapi/group"/> -->
-        <!-- <unit bldFile="email/imum/mtms/group"/> -->
-        <!-- <unit bldFile="email/imum/utils/group"/> -->
-      </component>
-      <component id="mail" filter="s60" name="Mail Application" deprecated="^3">
-        <unit bldFile="email/mail/group"/>
-      </component>
-      <component id="pop3andsmtpmtm" name="POP3 and SMTP MTM" purpose="optional" class="plugin" deprecated="^3">
-        <unit bldFile="email/pop3andsmtpmtm/group" mrp="email/pop3andsmtpmtm/group/messaging_email.mrp"/>
-      </component>
-      <component id="imap4mtm" name="IMAP4 MTM" introduced="9.2" purpose="optional" class="plugin" deprecated="^3">
-        <unit bldFile="email/imap4mtm/group" mrp="email/imap4mtm/group/messaging_email_imap.mrp"/>
-      </component>
-    </collection>
-    <collection id="messaging_info" name="Messaging Apps Info" level="ui">
-      <component id="messaging_test" filter="s60" name="Messaging Apps Test" purpose="development">
-        <!-- <unit bldFile="tsrc/group"/> -->
-      </component>
-      <component id="msg_plat" name="Messaging Apps Platform APIs"  filter="s60" class="api">
-        <unit bldFile="msg_plat/group"/>
-        <unit bldFile="msg_plat/messaging_center_ui_utilities_api/tsrc/group"/>
-        <unit bldFile="msg_plat/messaging_editor_api/tsrc/group"/>
-        <unit bldFile="msg_plat/messaging_media_resolver_api/tsrc/group"/>
-        <unit bldFile="msg_plat/mms_application_api/tsrc/group"/>
-        <unit bldFile="msg_plat/mms_codec_client_api/tsrc/group"/>
-        <unit bldFile="msg_plat/mms_conformance_api/tsrc/group"/>
-        <unit bldFile="msg_plat/mms_server_settings_api/tsrc/group"/>
-        <!-- <unit bldFile="msg_plat/email_domain_utilities_api/tsrc/group"/> -->
-        <!-- <unit bldFile="msg_plat/send_ui_meeting_request_api/tsrc/group"/> -->
-        <unit bldFile="msg_plat/smil_engine_api/tsrc/group"/>
-        <unit bldFile="msg_plat/unified_editor_video_conversion_api/tsrc/group"/>
-      </component>
-      <component id="msg_pub" name="Messaging Apps Public APIs" filter="s60" class="api">
-        <unit bldFile="msg_pub/group"/>
-        <unit bldFile="msg_pub/mms_client_mtm_api/tsrc/group"/>
-        <unit bldFile="msg_pub/plugin_bio_control_api/tsrc/group"/>
-        <!-- <unit bldFile="msg_pub/mms_client_mtm_api/tsrc/bc/group"/> -->
-        <!-- <unit bldFile="msg_pub/plugin_bio_control_api/tsrc/bc/group"/> -->
-      </component>
-      <component id="messaging_metadata" name="Messaging Apps Metadata" class="config" introduced="^2" purpose="development" target="desktop">
-        <unit mrp="messaging_info/messaging_metadata/messaging_metadata.mrp"/>
-      </component>
-    </collection>
-  </package>
+<SystemDefinition schema="3.0.0" xmlns:qt="http://www.nokia.com/qt">
+ <package id="messaging" name="Messaging Apps" levels="plugin eng base app api">
+  <collection id="msg_plat" name="Messaging Apps Platform APIs" level="api">
+   <component id="messaging_media_resolver_api" name="Messaging Media Resolver API" class="api" filter="s60">
+    <meta rel="Api" href="msg_plat/messaging_media_resolver_api/messaging_media_resolver_api.metaxml"/>
+    <unit base="msg_plat/messaging_media_resolver_api"/>
+   </component>
+   <component id="mms_application_api" name="MMS Application API" class="api" filter="s60">
+    <meta rel="Api" href="msg_plat/mms_application_api/mms_application_api.metaxml"/>
+    <unit base="msg_plat/mms_application_api"/>
+   </component>
+   <component id="mms_codec_client_api" name="MMS Codec Client API" class="api" filter="s60">
+    <meta rel="Api" href="msg_plat/mms_codec_client_api/mms_codec_client_api.metaxml"/>
+    <unit base="msg_plat/mms_codec_client_api"/>
+   </component>
+   <component id="mms_conformance_api" name="MMS Conformance API" class="api" filter="s60">
+    <meta rel="Api" href="msg_plat/mms_conformance_api/mms_conformance_api.metaxml"/>
+    <unit base="msg_plat/mms_conformance_api"/>
+   </component>
+   <component id="mms_engine_settings_api" name="MMS Engine Settings API" class="api" filter="s60">
+    <meta rel="Api" href="msg_plat/mms_engine_settings_api/mms_engine_settings_api.metaxml"/>
+    <unit base="msg_plat/mms_engine_settings_api"/>
+   </component>
+   <component id="mms_server_settings_api" name="MMS Server Settings API" class="api" filter="s60">
+    <meta rel="Api" href="msg_plat/mms_server_settings_api/mms_server_settings_api.metaxml"/>
+    <unit base="msg_plat/mms_server_settings_api"/>
+   </component>
+   <component id="conversation_services_client_api" name="Conversation Services Client API" class="api" filter="s60" introduced="^4">
+    <unit base="msg_plat/conversation_services_client_api"/>
+   </component>
+   <component id="conversation_services_plugin_api" name="Conversation Services Plugin API" class="api" filter="s60" introduced="^4">
+    <unit base="msg_plat/conversation_services_plugin_api"/>
+   </component>
+   <component id="conversation_services_utilities_api" name="Conversation Services Utilities API" class="api" filter="s60" introduced="^4">
+    <unit base="msg_plat/conversation_services_utilities_api"/>
+   </component>
+   <component id="shareui_api" name="Share UI API" class="api" filter="s60" introduced="^4">
+    <unit base="msg_plat/shareui_api"/>
+   </component>
+   <component id="messaging_history_api" name="Messaging History API" class="api" filter="s60" introduced="^4">
+    <unit base="msg_plat/messaging_history_api"/>
+   </component>
+   <component id="msg_plat_build" name="Messaging Apps Platform APIs Build" class="api" filter="s60" introduced="^4">
+	<!-- break this up into the above units and replace their base attributes with bldFile, etc -->
+    <unit bldFile="msg_plat" qt:proFile="msg_plat.pro"/>
+   </component>
+  </collection>
+  <collection id="msg_pub" name="Messaging Apps Public APIs" level="api">
+   <component id="mms_client_mtm_api" name="MMS Client MTM API" class="api" filter="s60">
+    <meta rel="Api" href="msg_pub/mms_client_mtm_api/mms_client_mtm_api.metaxml"/>
+    <unit base="msg_pub/mms_client_mtm_api"/>
+   </component>
+   <component id="msg_smil_dtd_api" name="Messaging SMIL DTD API" class="api" filter="s60" introduced="^4">
+    <unit base="msg_pub/msg_smil_dtd_api"/>
+   </component>
+   <component id="msg_pub_build" name="Messaging Apps Public APIs Build" class="api" filter="s60" introduced="^4">
+	<!-- break this up into the above units and replace their base attributes with bldFile, etc -->
+    <unit bldFile="msg_pub" qt:proFile="msg_pub.pro"/>
+   </component>
+  </collection>
+  <collection id="mobilemessaging" name="Mobile Messaging" level="plugin">
+   <component id="smsmtm" name="SMS MTM" purpose="optional" class="plugin">
+    <unit bldFile="mobilemessaging/smsmtm/group" mrp="mobilemessaging/smsmtm/group/messaging_sms.mrp"/>
+   </component>
+  </collection>
+  <collection id="messagingappbase" name="Messaging App Base" level="base">
+   <component id="messagingappbase_build" filter="s60" name="Messaging App Base Build"  introduced="^4">
+	<!-- break this up into the below components -->
+    <unit bldFile="messagingappbase" qt:proFile="messagingappbase.pro"/>
+   </component>
+   <component id="msgmedia" filter="s60" name="Message Media">
+      <unit base="messagingappbase/msgmedia"/>
+   </component>
+   <component id="smilparser" name="SMIL Parser" introduced="7.0s" purpose="optional">
+    <unit bldFile="messagingappbase/smilparser/GROUP" mrp="messagingappbase/smilparser/GROUP/messaging_gmxml.mrp"/>
+   </component>
+   <component id="obexmtms" name="OBEX MTMs" introduced="7.0s" purpose="optional" class="plugin">
+    <unit bldFile="messagingappbase/obexmtms/Group" mrp="messagingappbase/obexmtms/Group/messaging_obex.mrp"/>
+   </component>
+  </collection>
+  <collection id="mmsengine" name="MMS Engine" level="eng">
+   <component id="mmsconninit" filter="s60" name="MMS Connection Initiator">
+    <unit bldFile="mmsengine/mmsconninit/bld"/>
+   </component>
+   <component id="genutils" filter="s60" name="General Utils">
+    <unit bldFile="mmsengine/genutils/bld"/>
+   </component>
+   <component id="mmsserversettings" filter="s60" name="MMS Server Settings">
+    <unit bldFile="mmsengine/mmsserversettings/bld"/>
+   </component>
+   <component id="mmsmessage" filter="s60" name="MMS Message">
+    <unit bldFile="mmsengine/mmsmessage/bld"/>
+   </component>
+   <component id="mmshttptransport" filter="s60" name="MMS HTTP Transport">
+    <unit bldFile="mmsengine/mmshttptransport/bld"/>
+   </component>
+   <component id="mmscodec" filter="s60" name="MMS Codec">
+    <unit bldFile="mmsengine/mmscodec/bld"/>
+   </component>
+   <component id="mmsserver" filter="s60" name="MMS Server">
+    <unit bldFile="mmsengine/mmsserver/bld"/>
+   </component>
+   <component id="clientmtm" filter="s60" name="MMS Client MTM" class="plugin">
+    <unit bldFile="mmsengine/clientmtm/bld"/>
+   </component>
+   <component id="mmswatcher" filter="s60" name="MMS Watcher" class="plugin">
+    <unit bldFile="mmsengine/mmswatcher/bld"/>
+   </component>
+   <component id="mmspushhandler" filter="s60" name="MMS Push Handler" class="plugin">
+    <unit bldFile="mmsengine/mmspushhandler/bld"/>
+   </component>
+   <component id="applicationadapter" filter="s60" name="MMS Application Adapter">
+    <unit bldFile="mmsengine/applicationadapter/bld"/>
+   </component>
+   <component id="mmscodecclient" filter="s60" name="MMS Codec Client">
+    <unit bldFile="mmsengine/mmscodecclient/bld"/>
+   </component>
+   <component id="mmssettings" name="MMS Settings" introduced="9.2" purpose="optional">
+    <unit bldFile="mmsengine/mmssettings/group" mrp="mmsengine/mmssettings/group/messaging_mmssettings.mrp"/>
+   </component>
+   <component id="mmsconf" name="MMS Configuration" purpose="optional">
+    <unit bldFile="mmsengine/mmsconf" mrp="mmsengine/mmsconf/messaging_mmssettings-config.mrp"/>
+   </component>
+   <component id="mmsengine_build" filter="s60" name="MMS Engine Build">
+    <unit bldFile="mmsengine/group"/>
+   </component>
+  </collection>
+  <collection id="messagingapp" name="Messaging Application" level="app">
+   <component id="messaging_conf" filter="s60" name="Messaging Application Configuration" class="config" introduced="^4">
+    <unit bldFile="messagingapp/conf" qt:proFile="messaging_conf.pro"/>
+   </component>
+     <component id="msgutils" filter="s60" name="Messaging Utils" introduced="^4">
+      <unit bldFile="messagingapp/msgutils" qt:proFile="msgutils.pro"/>
+     </component>
+     <component id="msgappfw" filter="s60" name="Messaging Application Framework" introduced="^4">
+      <unit bldFile="messagingapp/msgappfw" qt:proFile="msgappfw.pro"/>
+     </component>
+     <component id="msgsettings" filter="s60" name="Messaging Settings" introduced="^4">
+      <unit bldFile="messagingapp/msgsettings" qt:proFile="msgsettings.pro"/>
+     </component>
+     <component id="msgnotifications" filter="s60" name="Messaging Notifications" introduced="^4">
+      <unit bldFile="messagingapp/msgnotifications" qt:proFile="msgnotifications.pro"/>
+     </component>
+     <component id="smartmessaging" filter="s60" name="Smart Messaging">
+      <unit bldFile="messagingapp/smartmessaging" qt:proFile="smartmessaging.pro"/>
+     </component>
+     <component id="shareui" filter="s60" name="Shared UI" introduced="^4">
+      <unit bldFile="messagingapp/shareui" qt:proFile="shareui.pro"/>
+     </component>
+     <component id="msgui" filter="s60" name="Messaging UI" introduced="^4">
+      <unit bldFile="messagingapp/msgui" qt:proFile="msgui.pro"/>
+     </component>
+     <component id="msgservices" filter="s60" name="Messaging Services" introduced="^4">
+      <unit bldFile="messagingapp/msgservices" qt:proFile="msgservices.pro"/>
+     </component>
+  </collection>
+  <collection id="email" name="Email" level="plugin">
+   <!-- use commonemail instead -->
+   <component id="pop3andsmtpmtm" name="POP3 and SMTP MTM" purpose="optional" class="plugin" deprecated="^3">
+    <unit bldFile="email/pop3andsmtpmtm/group" mrp="email/pop3andsmtpmtm/group/messaging_email.mrp"/>
+   </component>
+   <component id="imap4mtm" name="IMAP4 MTM" introduced="9.2" purpose="optional" class="plugin" deprecated="^3">
+    <unit bldFile="email/imap4mtm/group" mrp="email/imap4mtm/group/messaging_email_imap.mrp"/>
+   </component>
+  </collection>
+  <collection id="messaging_info" name="Messaging Apps Info" level="api">
+   <component id="messaging_metadata" name="Messaging Apps Metadata" class="config" introduced="^2" purpose="development" target="desktop">
+    <unit mrp="messaging_info/messaging_metadata/messaging_metadata.mrp"/>
+   </component>
+  </collection>
+ </package>
 </SystemDefinition>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/package_map.xml	Fri Sep 17 08:28:39 2010 +0300
@@ -0,0 +1,1 @@
+<PackageMap root="sf" layer="app"/>