Revision: 201015
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 03 May 2010 12:29:07 +0300
changeset 25 84d9eb65b26f
parent 23 238255e8b033
child 27 e4592d119491
child 37 518b245aa84c
child 79 2981cb3aa489
Revision: 201015 Kit: 201018
email/pop3andsmtpmtm/group/messaging_email.history.xml
email/pop3andsmtpmtm/imapservermtm/bmarm/IMPSU.DEF
email/pop3andsmtpmtm/imapservermtm/bwins/IMPSU.DEF
email/pop3andsmtpmtm/imapservermtm/eabi/impsU.DEF
email/pop3andsmtpmtm/imapservermtm/group/IMPS.mmp
email/pop3andsmtpmtm/imapservermtm/group/bld.inf
email/pop3andsmtpmtm/imapservermtm/group/messaging_email_imap.mrp
email/pop3andsmtpmtm/imapservermtm/inc/FLDINDEX.H
email/pop3andsmtpmtm/imapservermtm/inc/FLDSYNC.H
email/pop3andsmtpmtm/imapservermtm/inc/IMAPCOMP.H
email/pop3andsmtpmtm/imapservermtm/inc/IMAPIO.H
email/pop3andsmtpmtm/imapservermtm/inc/IMAPOFFL.H
email/pop3andsmtpmtm/imapservermtm/inc/IMAPSESS.H
email/pop3andsmtpmtm/imapservermtm/inc/IMAPSYNC.H
email/pop3andsmtpmtm/imapservermtm/inc/IMPSMTM.H
email/pop3andsmtpmtm/imapservermtm/inc/IMPSPAN.H
email/pop3andsmtpmtm/imapservermtm/inc/IMPSUTIL.H
email/pop3andsmtpmtm/imapservermtm/inc/cimapcanceltimer.h
email/pop3andsmtpmtm/imapservermtm/inc/mimapsessionobserver.h
email/pop3andsmtpmtm/imapservermtm/src/FLDINDEX.CPP
email/pop3andsmtpmtm/imapservermtm/src/FLDSYNC.CPP
email/pop3andsmtpmtm/imapservermtm/src/IMAPCOMP.CPP
email/pop3andsmtpmtm/imapservermtm/src/IMAPIO.CPP
email/pop3andsmtpmtm/imapservermtm/src/IMAPOFFL.CPP
email/pop3andsmtpmtm/imapservermtm/src/IMAPSESS.CPP
email/pop3andsmtpmtm/imapservermtm/src/IMAPSYNC.CPP
email/pop3andsmtpmtm/imapservermtm/src/IMPSMAIN.CPP
email/pop3andsmtpmtm/imapservermtm/src/IMPSMTM.CPP
email/pop3andsmtpmtm/imapservermtm/src/IMPSUTIL.CPP
email/pop3andsmtpmtm/imapservermtm/src/cimapcanceltimer.cpp
email/pop3andsmtpmtm/imapservermtm/test/data/EmbeddedMsg.txt
email/pop3andsmtpmtm/imapservermtm/test/data/EmbeddedMsgNoReceived.txt
email/pop3andsmtpmtm/imapservermtm/test/data/EmbeddedMsgNoReceivedNoDate.txt
email/pop3andsmtpmtm/imapservermtm/test/data/ImapAttachmentTest.ini
email/pop3andsmtpmtm/imapservermtm/test/data/ImapBadlyFormedAddress.txt
email/pop3andsmtpmtm/imapservermtm/test/data/ImapBadlyFormedAddressTest.ini
email/pop3andsmtpmtm/imapservermtm/test/data/ImapDecode.ini
email/pop3andsmtpmtm/imapservermtm/test/data/ImapGetMailAndAttachment.txt
email/pop3andsmtpmtm/imapservermtm/test/data/ImapMissingOffset.txt
email/pop3andsmtpmtm/imapservermtm/test/data/ImapMissingOffsetTest.ini
email/pop3andsmtpmtm/imapservermtm/test/data/ImapNewMsgDuringSyncIdleCancel.txt
email/pop3andsmtpmtm/imapservermtm/test/data/ImapNewMsgDuringSyncIdleCancelTest.ini
email/pop3andsmtpmtm/imapservermtm/test/data/ImapUTCTest.ini
email/pop3andsmtpmtm/imapservermtm/test/data/NOTES.txt
email/pop3andsmtpmtm/imapservermtm/test/data/NOTES01.txt
email/pop3andsmtpmtm/imapservermtm/test/data/NoReceived.txt
email/pop3andsmtpmtm/imapservermtm/test/data/TEST.bat
email/pop3andsmtpmtm/imapservermtm/test/data/config.txt
email/pop3andsmtpmtm/imapservermtm/test/data/mail1_Base64.txt
email/pop3andsmtpmtm/imapservermtm/test/data/mail1_Base64_body.txt
email/pop3andsmtpmtm/imapservermtm/test/data/mail1_UUEncoded.txt
email/pop3andsmtpmtm/imapservermtm/test/data/mail1_UUEncoded_attachment.jpg
email/pop3andsmtpmtm/imapservermtm/test/data/mail1_UUEncoded_body.txt
email/pop3andsmtpmtm/imapservermtm/test/data/mail2_Base64.txt
email/pop3andsmtpmtm/imapservermtm/test/data/mail2_Base64_body.txt
email/pop3andsmtpmtm/imapservermtm/test/data/multipleReceived.txt
email/pop3andsmtpmtm/imapservermtm/test/data/noReceivednoDate.txt
email/pop3andsmtpmtm/imapservermtm/test/data/partialDownload.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0001.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0002.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0003.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0004.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0005.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0006.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0007.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0008.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0009.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0010.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0011.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0012.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0013.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0014.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0015.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0016.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0017.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0018.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0019.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0020.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0021.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0022.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0023.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0024.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0025.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0026.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0027.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0028.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0029.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0030.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0031.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0032.txt
email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0033.txt
email/pop3andsmtpmtm/imapservermtm/test/group/T_ConnectAndSyncAfterDisconnect.mmp
email/pop3andsmtpmtm/imapservermtm/test/group/T_DEF059571_IMAP_MISSINGOFFSET.iby
email/pop3andsmtpmtm/imapservermtm/test/group/T_DEF059571_IMAP_MISSINGOFFSET.mmp
email/pop3andsmtpmtm/imapservermtm/test/group/T_DEF062024_IMAP_ATTACHMENTCANNOTBEOPENED.iby
email/pop3andsmtpmtm/imapservermtm/test/group/T_DEF062024_IMAP_ATTACHMENTCANNOTBEOPENED.mmp
email/pop3andsmtpmtm/imapservermtm/test/group/T_DEF075510_Offline_Populate.mmp
email/pop3andsmtpmtm/imapservermtm/test/group/T_DEF079867_OfflineDelete.mmp
email/pop3andsmtpmtm/imapservermtm/test/group/T_DUMP.mmp
email/pop3andsmtpmtm/imapservermtm/test/group/T_DecodeServer.iby
email/pop3andsmtpmtm/imapservermtm/test/group/T_DecodeServer.mmp
email/pop3andsmtpmtm/imapservermtm/test/group/T_IMPS01.mmp
email/pop3andsmtpmtm/imapservermtm/test/group/T_IMPSSECURESOCKET.mmp
email/pop3andsmtpmtm/imapservermtm/test/group/T_INC083099_Enquire_Email_Structure.mmp
email/pop3andsmtpmtm/imapservermtm/test/group/T_ImapBadlyFormedAddress.iby
email/pop3andsmtpmtm/imapservermtm/test/group/T_ImapBadlyFormedAddress.mmp
email/pop3andsmtpmtm/imapservermtm/test/group/T_ImapNewMsgDuringSyncIdleCancel.iby
email/pop3andsmtpmtm/imapservermtm/test/group/T_ImapNewMsgDuringSyncIdleCancel.mmp
email/pop3andsmtpmtm/imapservermtm/test/group/T_PARSE_UTC_IMAP.iby
email/pop3andsmtpmtm/imapservermtm/test/group/T_PARSE_UTC_IMAP.mmp
email/pop3andsmtpmtm/imapservermtm/test/group/T_PartialDownloadSpoofServer.iby
email/pop3andsmtpmtm/imapservermtm/test/group/T_PartialDownloadSpoofServer.mmp
email/pop3andsmtpmtm/imapservermtm/test/group/T_imapIO.mmp
email/pop3andsmtpmtm/imapservermtm/test/group/bld.inf
email/pop3andsmtpmtm/imapservermtm/test/inc/DecodeIMapClient.h
email/pop3andsmtpmtm/imapservermtm/test/inc/EventHandler.h
email/pop3andsmtpmtm/imapservermtm/test/inc/IMapClient.h
email/pop3andsmtpmtm/imapservermtm/test/inc/ImapSpoofServer.h
email/pop3andsmtpmtm/imapservermtm/test/inc/ScriptFileProcessor.h
email/pop3andsmtpmtm/imapservermtm/test/inc/TESTENV.h
email/pop3andsmtpmtm/imapservermtm/test/inc/T_DEF059571_IMAP_Client.h
email/pop3andsmtpmtm/imapservermtm/test/inc/T_DEF059571_IMAP_MissingOffsetServer.h
email/pop3andsmtpmtm/imapservermtm/test/inc/T_DEF059571_IMAP_MissingOffsetStep.h
email/pop3andsmtpmtm/imapservermtm/test/inc/T_DEF062024_IMAP21cnServer_AttachmentCannotBeOpenedStep.h
email/pop3andsmtpmtm/imapservermtm/test/inc/T_DEF062024_IMAPClient.h
email/pop3andsmtpmtm/imapservermtm/test/inc/T_DEF062024_Imap_AttachmentCannotBeOpenedServer.h
email/pop3andsmtpmtm/imapservermtm/test/inc/T_DecodeServer.h
email/pop3andsmtpmtm/imapservermtm/test/inc/T_ImapBadlyFormedAddressClient.h
email/pop3andsmtpmtm/imapservermtm/test/inc/T_ImapBadlyFormedAddressServer.h
email/pop3andsmtpmtm/imapservermtm/test/inc/T_ImapBadlyFormedAddressStep.h
email/pop3andsmtpmtm/imapservermtm/test/inc/T_ImapNewMsgDuringSyncIdleCancelClient.h
email/pop3andsmtpmtm/imapservermtm/test/inc/T_ImapNewMsgDuringSyncIdleCancelServer.h
email/pop3andsmtpmtm/imapservermtm/test/inc/T_ImapNewMsgDuringSyncIdleCancelStep.h
email/pop3andsmtpmtm/imapservermtm/test/inc/T_LOG.h
email/pop3andsmtpmtm/imapservermtm/test/inc/T_PARSE_UTC_IMAPServer.h
email/pop3andsmtpmtm/imapservermtm/test/inc/T_PARSE_UTC_IMAPStep.h
email/pop3andsmtpmtm/imapservermtm/test/inc/T_PartialDownloadImapClient.h
email/pop3andsmtpmtm/imapservermtm/test/inc/T_PartialDownloadSpoofServer.h
email/pop3andsmtpmtm/imapservermtm/test/inc/T_PartialDownloadStep.h
email/pop3andsmtpmtm/imapservermtm/test/inc/t_test_decode_step.h
email/pop3andsmtpmtm/imapservermtm/test/scripts/T_DEF059571_IMAP_MISSINGOFFSET.script
email/pop3andsmtpmtm/imapservermtm/test/scripts/T_DEF062024_IMAP_ATTACHMENTCANNOTBEOPENED.script
email/pop3andsmtpmtm/imapservermtm/test/scripts/T_IMAP_DECODE.script
email/pop3andsmtpmtm/imapservermtm/test/scripts/T_ImapBadlyFormedAddress.script
email/pop3andsmtpmtm/imapservermtm/test/scripts/T_ImapNewMsgDuringSyncIdleCancel.script
email/pop3andsmtpmtm/imapservermtm/test/scripts/T_PARSE_UTC_IMAP.script
email/pop3andsmtpmtm/imapservermtm/test/scripts/T_PartialDownload.script
email/pop3andsmtpmtm/imapservermtm/test/src/DecodeImapClient.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/IMapClient.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/ImapSpoofServer.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/ScriptFileProcessor.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_ConnectAndSyncAfterDisconnect.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_DEF059571_IMAP_Client.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_DEF059571_IMAP_MissingOffsetServer.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_DEF059571_IMAP_MissingOffsetStep.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_DEF062024_IMAP21cnServer_AttachmentCannotBeOpenedStep.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_DEF062024_IMAPClient.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_DEF062024_Imap_AttachmentCannotBeOpenedServer.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_DEF075510_Offline_Populate.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_DEF079867_OfflineDelete.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_DUMP.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_DecodeServer.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_IMPS01.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_INC083099_Enquire_Email_Structure.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_ImapBadlyFormedAddressClient.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_ImapBadlyFormedAddressServer.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_ImapBadlyFormedAddressStep.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_ImapNewMsgDuringSyncIdleCancelClient.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_ImapNewMsgDuringSyncIdleCancelServer.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_ImapNewMsgDuringSyncIdleCancelStep.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_LOG.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_PARSE_UTC_IMAPServer.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_PARSE_UTC_IMAPStep.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_PartialDownloadImapClient.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_PartialDownloadSpoofServer.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_PartialDownloadStep.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/T_impssecuresocket.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/t_imapio.cpp
email/pop3andsmtpmtm/imapservermtm/test/src/t_test_decode_step.cpp
email/pop3andsmtpmtm/imapservermtm/test/testrom/bld.inf
email/pop3andsmtpmtm/imapservermtm/test/testrom/t_imps.iby
email/pop3andsmtpmtm/imapservermtm/test/testrom/t_imps_prepare_for_test.bat
email/pop3andsmtpmtm/popservermtm/src/POPS.CPP
inc/convergedmessage.h
inc/msgnotificationdialogpluginkeys.h
inc/unidatamodelloader.h
inc/unidatamodelplugininterface.h
inc/unieditorplugininterface.h
inc/unieditorpluginloader.h
messaging_info/messaging_metadata/messaging_metadata.mrp
messagingapp/conf/messaging.confml
messagingapp/conf/messaging_101F87EB.crml
messagingapp/conf/messaging_101F87EC.crml
messagingapp/conf/messaging_101F87ED.crml
messagingapp/conf/messaging_101F87EE.crml
messagingapp/conf/messaging_101F87EF.crml
messagingapp/conf/messaging_101F8873.crml
messagingapp/conf/messaging_101F8F28.crml
messagingapp/conf/messaging_102071F2.crml
messagingapp/conf/messaging_102072E2.crml
messagingapp/conf/messaging_102072E5.crml
messagingapp/conf/messaging_102824A0.crml
messagingapp/conf/messaging_1028281E.crml
messagingapp/conf/messaging_conf.pro
messagingapp/messagingapp.pro
messagingapp/msgappfw/bwins/msghistoryu.def
messagingapp/msgappfw/client/bwins/csserverclientapiu.def
messagingapp/msgappfw/client/eabi/csserverclientapiu.def
messagingapp/msgappfw/client/group/ABLD.BAT
messagingapp/msgappfw/client/src/ccsrequesthandler.cpp
messagingapp/msgappfw/client/src/rcssession.cpp
messagingapp/msgappfw/msghistory/src/msghistoryprivate.cpp
messagingapp/msgappfw/msghistory/src/msgitem.cpp
messagingapp/msgappfw/plugin/group/ABLD.BAT
messagingapp/msgappfw/plugin/inc/ccsmsghandler.h
messagingapp/msgappfw/plugin/src/ccsmsghandler.cpp
messagingapp/msgappfw/server/inc/ccscontactsresolver.h
messagingapp/msgappfw/server/inc/ccsconversation.h
messagingapp/msgappfw/server/inc/ccsconversationcache.h
messagingapp/msgappfw/server/inc/ccsconversationcachehelper.h
messagingapp/msgappfw/server/inc/ccsconversationcontact.h
messagingapp/msgappfw/server/inc/ccsconversationdeletehandler.h
messagingapp/msgappfw/server/inc/ccsconversationmarkreadhandler.h
messagingapp/msgappfw/server/inc/ccssession.h
messagingapp/msgappfw/server/src/ccscontactsresolver.cpp
messagingapp/msgappfw/server/src/ccsconversation.cpp
messagingapp/msgappfw/server/src/ccsconversationcache.cpp
messagingapp/msgappfw/server/src/ccsconversationcachehelper.cpp
messagingapp/msgappfw/server/src/ccsconversationcontact.cpp
messagingapp/msgappfw/server/src/ccsconversationdeletehandler.cpp
messagingapp/msgappfw/server/src/ccsconversationmarkreadhandler.cpp
messagingapp/msgappfw/server/src/ccssession.cpp
messagingapp/msgappfw/utils/bwins/csutilsu.def
messagingapp/msgappfw/utils/eabi/csutilsu.def
messagingapp/msgappfw/utils/group/ABLD.BAT
messagingapp/msgappfw/utils/src/ccsclientconversation.cpp
messagingapp/msgappfw/utils/src/ccsdebug.cpp
messagingapp/msgnotifications/inc/msginfodefs.h
messagingapp/msgnotifications/msgerrornotifier/inc/msgerrornotifier.h
messagingapp/msgnotifications/msgerrornotifier/inc/msgerrornotifiersvc.h
messagingapp/msgnotifications/msgerrornotifier/msgerrornotifier.pro
messagingapp/msgnotifications/msgerrornotifier/rom/msgerrornotifier.iby
messagingapp/msgnotifications/msgerrornotifier/service_conf.xml
messagingapp/msgnotifications/msgerrornotifier/src/main.cpp
messagingapp/msgnotifications/msgerrornotifier/src/msgerrornotifier.cpp
messagingapp/msgnotifications/msgerrornotifier/src/msgerrornotifiersvc.cpp
messagingapp/msgnotifications/msgindicatorplugin/inc/msgindicator.h
messagingapp/msgnotifications/msgindicatorplugin/inc/msgindicator_p.h
messagingapp/msgnotifications/msgindicatorplugin/inc/msgindicatorplugin.h
messagingapp/msgnotifications/msgindicatorplugin/msgindicatorplugin.pro
messagingapp/msgnotifications/msgindicatorplugin/src/msgindicator.cpp
messagingapp/msgnotifications/msgindicatorplugin/src/msgindicator_p.cpp
messagingapp/msgnotifications/msgindicatorplugin/src/msgindicatorplugin.cpp
messagingapp/msgnotifications/msgnotificationdialogplugin/inc/msgnotificationdialogwidget.h
messagingapp/msgnotifications/msgnotificationdialogplugin/src/msgnotificationdialogplugin.cpp
messagingapp/msgnotifications/msgnotificationdialogplugin/src/msgnotificationdialogwidget.cpp
messagingapp/msgnotifications/msgnotifications.pro
messagingapp/msgnotifications/msgnotifier/inc/msgnotifier.h
messagingapp/msgnotifications/msgnotifier/inc/msgnotifier_p.h
messagingapp/msgnotifications/msgnotifier/inc/msgstorehandler.h
messagingapp/msgnotifications/msgnotifier/msgnotifier.pro
messagingapp/msgnotifications/msgnotifier/src/main.cpp
messagingapp/msgnotifications/msgnotifier/src/msgnotifier.cpp
messagingapp/msgnotifications/msgnotifier/src/msgnotifier_p.cpp
messagingapp/msgnotifications/msgnotifier/src/msgstorehandler.cpp
messagingapp/msgsettings/bwins/msgsettingsmwu.def
messagingapp/msgsettings/bwins/settingsviewu.def
messagingapp/msgsettings/eabi/msgsettingsmwu.def
messagingapp/msgsettings/eabi/settingsviewu.def
messagingapp/msgsettings/msgsettings.pro
messagingapp/msgsettings/msgsettingsmw/inc/mmssettingprivate.h
messagingapp/msgsettings/msgsettingsmw/inc/msgsettingengine.h
messagingapp/msgsettings/msgsettingsmw/inc/msgsettingsutil.h
messagingapp/msgsettings/msgsettingsmw/inc/smssettingsprivate.h
messagingapp/msgsettings/msgsettingsmw/msgsettingsmw.pro
messagingapp/msgsettings/msgsettingsmw/rom/msgsettingsmw.iby
messagingapp/msgsettings/msgsettingsmw/src/mmssettingsprivate.cpp
messagingapp/msgsettings/msgsettingsmw/src/msgsettingengine.cpp
messagingapp/msgsettings/msgsettingsmw/src/msgsettingsutil.cpp
messagingapp/msgsettings/msgsettingsmw/src/smssettingsprivate.cpp
messagingapp/msgsettings/msgsettingsmw/stub_sis/msgsettingsmw_stub.pkg
messagingapp/msgsettings/msgsettingsmw/stub_sis/msgsettingsmw_stub.sis
messagingapp/msgsettings/msgsettingsmw/tsrc/ut/bwins/t_msgsettingsmwu.def
messagingapp/msgsettings/msgsettingsmw/tsrc/ut/ut_msgsettingsmw/t_msgsettingengine.cpp
messagingapp/msgsettings/msgsettingsmw/tsrc/ut/ut_msgsettingsmw/t_msgsettingengine.h
messagingapp/msgsettings/msgsettingsmw/tsrc/ut/ut_msgsettingsmw/t_msgsettingsmw.pro
messagingapp/msgsettings/msgsettingsplugin.deprecated/inc/msgadvancedsettingsform.h
messagingapp/msgsettings/msgsettingsplugin.deprecated/inc/msgadvancedsettingsview.h
messagingapp/msgsettings/msgsettingsplugin.deprecated/inc/msgsettingsdataformcustomitem.h
messagingapp/msgsettings/msgsettingsplugin.deprecated/inc/msgsettingsform.h
messagingapp/msgsettings/msgsettingsplugin.deprecated/inc/msgsettingsplugin.h
messagingapp/msgsettings/msgsettingsplugin.deprecated/inc/msgsettingsview.h
messagingapp/msgsettings/msgsettingsplugin.deprecated/inc/msgsettingsviewmanager.h
messagingapp/msgsettings/msgsettingsplugin.deprecated/inc/msgsmscentersettingsform.h
messagingapp/msgsettings/msgsettingsplugin.deprecated/inc/msgsmscenterview.h
messagingapp/msgsettings/msgsettingsplugin.deprecated/msgsettingsplugin.pro
messagingapp/msgsettings/msgsettingsplugin.deprecated/rom/msgsettingsplugin.iby
messagingapp/msgsettings/msgsettingsplugin.deprecated/src/msgadvancedsettingsform.cpp
messagingapp/msgsettings/msgsettingsplugin.deprecated/src/msgadvancedsettingsview.cpp
messagingapp/msgsettings/msgsettingsplugin.deprecated/src/msgsettingsdataformcustomitem.cpp
messagingapp/msgsettings/msgsettingsplugin.deprecated/src/msgsettingsform.cpp
messagingapp/msgsettings/msgsettingsplugin.deprecated/src/msgsettingsplugin.cpp
messagingapp/msgsettings/msgsettingsplugin.deprecated/src/msgsettingsview.cpp
messagingapp/msgsettings/msgsettingsplugin.deprecated/src/msgsettingsviewmanager.cpp
messagingapp/msgsettings/msgsettingsplugin.deprecated/src/msgsmscentersettingsform.cpp
messagingapp/msgsettings/msgsettingsplugin.deprecated/src/msgsmscenterview.cpp
messagingapp/msgsettings/msgsettingsplugin.deprecated/stub_sis/msgsettingsplugin_stub.pkg
messagingapp/msgsettings/msgsettingsplugin.deprecated/stub_sis/msgsettingsplugin_stub.sis
messagingapp/msgsettings/settingsview/inc/mmssettingprivate.h
messagingapp/msgsettings/settingsview/inc/msgadvancedsettingsform.h
messagingapp/msgsettings/settingsview/inc/msgadvancedsettingsview.h
messagingapp/msgsettings/settingsview/inc/msgsettingengine.h
messagingapp/msgsettings/settingsview/inc/msgsettingsform.h
messagingapp/msgsettings/settingsview/inc/msgsettingsview.h
messagingapp/msgsettings/settingsview/inc/msgsettingsviewmanager.h
messagingapp/msgsettings/settingsview/inc/msgsmscentersettingsform.h
messagingapp/msgsettings/settingsview/inc/msgsmscenterview.h
messagingapp/msgsettings/settingsview/inc/smssettingsprivate.h
messagingapp/msgsettings/settingsview/settingsview.pro
messagingapp/msgsettings/settingsview/src/mmssettingsprivate.cpp
messagingapp/msgsettings/settingsview/src/msgadvancedsettingsform.cpp
messagingapp/msgsettings/settingsview/src/msgadvancedsettingsview.cpp
messagingapp/msgsettings/settingsview/src/msgsettingengine.cpp
messagingapp/msgsettings/settingsview/src/msgsettingsform.cpp
messagingapp/msgsettings/settingsview/src/msgsettingsview.cpp
messagingapp/msgsettings/settingsview/src/msgsettingsviewmanager.cpp
messagingapp/msgsettings/settingsview/src/msgsmscentersettingsform.cpp
messagingapp/msgsettings/settingsview/src/msgsmscenterview.cpp
messagingapp/msgsettings/settingsview/src/smssettingsprivate.cpp
messagingapp/msgui/appengine/appengine.pro
messagingapp/msgui/appengine/inc/conversationmsgstorehandler.h
messagingapp/msgui/appengine/inc/conversationsengine.h
messagingapp/msgui/appengine/inc/conversationsengine_p.h
messagingapp/msgui/appengine/inc/conversationsenginedefines.h
messagingapp/msgui/appengine/inc/conversationsengineutility.h
messagingapp/msgui/appengine/inc/conversationsmodel.h
messagingapp/msgui/appengine/inc/conversationssummarymodel.h
messagingapp/msgui/appengine/src/conversationmsgstorehandler.cpp
messagingapp/msgui/appengine/src/conversationsengine.cpp
messagingapp/msgui/appengine/src/conversationsengine_p.cpp
messagingapp/msgui/appengine/src/conversationsengineutility.cpp
messagingapp/msgui/appengine/src/conversationsmodel.cpp
messagingapp/msgui/appengine/src/conversationssummarymodel.cpp
messagingapp/msgui/appengine/src/draftsmodel.cpp
messagingapp/msgui/bwins/appengineu.def
messagingapp/msgui/bwins/conversationviewu.def
messagingapp/msgui/bwins/msguiutilsu.def
messagingapp/msgui/bwins/unifiededitoru.def
messagingapp/msgui/bwins/unifiedvieweru.def
messagingapp/msgui/conversationview/conversationview.pro
messagingapp/msgui/conversationview/conversationview.qrc
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/resources/bubble_frames/qtg_fr_convlist_received_highlight_b.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_highlight_bl.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_highlight_br.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_highlight_c.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_highlight_l.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_highlight_r.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_highlight_t.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_highlight_tl.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_highlight_tr.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_normal_b.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_normal_bl.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_normal_br.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_normal_c.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_normal_l.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_normal_r.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_normal_t.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_normal_tl.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_normal_tr.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_pressed_b.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_pressed_bl.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_pressed_br.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_pressed_c.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_pressed_l.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_pressed_r.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_pressed_t.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_pressed_tl.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_pressed_tr.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_highlight_b.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_highlight_bl.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_highlight_br.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_highlight_c.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_highlight_l.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_highlight_r.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_highlight_t.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_highlight_tl.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_highlight_tr.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_normal_b.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_normal_bl.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_normal_br.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_normal_c.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_normal_l.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_normal_r.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_normal_t.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_normal_tl.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_normal_tr.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_pressed_b.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_pressed_bl.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_pressed_br.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_pressed_c.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_pressed_l.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_pressed_r.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_pressed_t.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_pressed_tl.svg
messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_pressed_tr.svg
messagingapp/msgui/conversationview/resources/icons/audio_icon.png
messagingapp/msgui/conversationview/resources/icons/play_icon.png
messagingapp/msgui/conversationview/resources/icons/qtg_large_avatar.svg
messagingapp/msgui/conversationview/resources/icons/qtg_large_music_player.png
messagingapp/msgui/conversationview/resources/icons/qtg_mono_forward.svg
messagingapp/msgui/conversationview/resources/icons/qtg_mono_send.png
messagingapp/msgui/conversationview/resources/icons/qtg_small_attachment.svg
messagingapp/msgui/conversationview/resources/icons/qtg_small_fail.png
messagingapp/msgui/conversationview/resources/icons/qtg_small_offline.svg
messagingapp/msgui/conversationview/resources/icons/qtg_small_online.svg
messagingapp/msgui/conversationview/resources/icons/qtg_small_priority_high.svg
messagingapp/msgui/conversationview/resources/icons/qtg_small_priority_low.svg
messagingapp/msgui/conversationview/resources/icons/video_icon.png
messagingapp/msgui/conversationview/resources/new_item_frames/qtg_fr_list_new_item_b.svg
messagingapp/msgui/conversationview/resources/new_item_frames/qtg_fr_list_new_item_c.svg
messagingapp/msgui/conversationview/resources/new_item_frames/qtg_fr_list_new_item_t.svg
messagingapp/msgui/conversationview/resources/qtg_anim_loading.axml
messagingapp/msgui/conversationview/resources/xml/conversationview_effect.fxml
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/msgconversationwidget.cpp
messagingapp/msgui/conversationview/src/msgeditorwidget.cpp
messagingapp/msgui/eabi/appengineu.def
messagingapp/msgui/eabi/conversationviewu.def
messagingapp/msgui/eabi/msguiutilsu.def
messagingapp/msgui/eabi/unifiededitoru.def
messagingapp/msgui/eabi/unifiedvieweru.def
messagingapp/msgui/inc/msgbaseview.h
messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgcontactcardwidget.css
messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgcontactcardwidget.widgetml
messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgconversationviewitem.css
messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgconversationviewitem.widgetml
messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgconversationwidget.css
messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgconversationwidget.widgetml
messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgeditorwidget.css
messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgeditorwidget.widgetml
messagingapp/msgui/layoutplugins/layoutplugins.pro
messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitoraddress.css
messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitoraddress.widgetml
messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitorbody.css
messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitorbody.widgetml
messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitorsubject.css
messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitorsubject.widgetml
messagingapp/msgui/msgapp/inc/draftslistview.h
messagingapp/msgui/msgapp/inc/msglistview.h
messagingapp/msgui/msgapp/inc/msglistviewitem.h
messagingapp/msgui/msgapp/inc/msgserviceinterface.h
messagingapp/msgui/msgapp/inc/msgviewmanager.h
messagingapp/msgui/msgapp/messaging_service.xml
messagingapp/msgui/msgapp/msgapp.pro
messagingapp/msgui/msgapp/msgapp.qrc
messagingapp/msgui/msgapp/resources/chat.svg
messagingapp/msgui/msgapp/resources/conversations.svg
messagingapp/msgui/msgapp/resources/find.svg
messagingapp/msgui/msgapp/resources/hblistviewitem.css
messagingapp/msgui/msgapp/resources/icons/qtg_large_message.svg
messagingapp/msgui/msgapp/resources/icons/qtg_mono_chat_buddies.png
messagingapp/msgui/msgapp/resources/icons/qtg_mono_create_message.png
messagingapp/msgui/msgapp/resources/icons/qtg_mono_search.png
messagingapp/msgui/msgapp/resources/icons/qtg_mono_sort.png
messagingapp/msgui/msgapp/resources/messaging_en_GB
messagingapp/msgui/msgapp/resources/msglistviewitem.css
messagingapp/msgui/msgapp/resources/msglistviewitem.widgetml
messagingapp/msgui/msgapp/resources/new_msg.svg
messagingapp/msgui/msgapp/resources/newitem_frames/qtg_fr_list_new_item_b.svg
messagingapp/msgui/msgapp/resources/newitem_frames/qtg_fr_list_new_item_c.svg
messagingapp/msgui/msgapp/resources/newitem_frames/qtg_fr_list_new_item_t.svg
messagingapp/msgui/msgapp/resources/qtg_large_message.svg
messagingapp/msgui/msgapp/resources/qtg_small_offline.svg
messagingapp/msgui/msgapp/resources/qtg_small_online.svg
messagingapp/msgui/msgapp/resources/slide_in_from_screen_bottom.fxml
messagingapp/msgui/msgapp/resources/translations/messaging_en_GB
messagingapp/msgui/msgapp/resources/xml/hblistviewitem.css
messagingapp/msgui/msgapp/resources/xml/msglistviewitem.css
messagingapp/msgui/msgapp/resources/xml/msglistviewitem.widgetml
messagingapp/msgui/msgapp/src/draftslistview.cpp
messagingapp/msgui/msgapp/src/msglistview.cpp
messagingapp/msgui/msgapp/src/msglistviewitem.cpp
messagingapp/msgui/msgapp/src/msgserviceinterface.cpp
messagingapp/msgui/msgapp/src/msgviewmanager.cpp
messagingapp/msgui/msguiutils/inc/matchphnumberutil.h
messagingapp/msgui/msguiutils/inc/mmsconformancecheck.h
messagingapp/msgui/msguiutils/inc/msgaudiofetcherutil.h
messagingapp/msgui/msguiutils/inc/msgcontactsutil.h
messagingapp/msgui/msguiutils/inc/msgimagefetcherutil.h
messagingapp/msgui/msguiutils/inc/msgmediautil.h
messagingapp/msgui/msguiutils/inc/msgsendutil.h
messagingapp/msgui/msguiutils/inc/msguiutilsmanager.h
messagingapp/msgui/msguiutils/msguiutils.pro
messagingapp/msgui/msguiutils/src/matchphnumberutil.cpp
messagingapp/msgui/msguiutils/src/mmsconformancecheck.cpp
messagingapp/msgui/msguiutils/src/msgaudiofetcherutil.cpp
messagingapp/msgui/msguiutils/src/msgcontactsutil.cpp
messagingapp/msgui/msguiutils/src/msgimagefetcherutil.cpp
messagingapp/msgui/msguiutils/src/msgmediautil.cpp
messagingapp/msgui/msguiutils/src/msgsendutil.cpp
messagingapp/msgui/msguiutils/src/msguiutilsmanager.cpp
messagingapp/msgui/unifiededitor/inc/mmsinsertcheckoperation.h
messagingapp/msgui/unifiededitor/inc/msgattachmentcontainer.h
messagingapp/msgui/unifiededitor/inc/msgmonitor.h
messagingapp/msgui/unifiededitor/inc/msgmonitor.inl
messagingapp/msgui/unifiededitor/inc/msgtypenotifier.h
messagingapp/msgui/unifiededitor/inc/msgunieditoraddress.h
messagingapp/msgui/unifiededitor/inc/msgunieditorattachment.h
messagingapp/msgui/unifiededitor/inc/msgunieditorbody.h
messagingapp/msgui/unifiededitor/inc/msgunieditorsubject.h
messagingapp/msgui/unifiededitor/inc/msgunieditorview.h
messagingapp/msgui/unifiededitor/inc/msgunifiededitorlineedit.h
messagingapp/msgui/unifiededitor/resources/qgn_indi_mce_tb_audio.svg
messagingapp/msgui/unifiededitor/resources/qtg_mono_attach.svg
messagingapp/msgui/unifiededitor/resources/qtg_mono_contacts.svg
messagingapp/msgui/unifiededitor/resources/qtg_mono_send.svg
messagingapp/msgui/unifiededitor/resources/qtg_small_attachment.svg
messagingapp/msgui/unifiededitor/resources/qtg_small_priority_high.svg
messagingapp/msgui/unifiededitor/resources/qtg_small_priority_low.svg
messagingapp/msgui/unifiededitor/src/mmsinsertcheckoperation.cpp
messagingapp/msgui/unifiededitor/src/msgattachmentcontainer.cpp
messagingapp/msgui/unifiededitor/src/msgmonitor.cpp
messagingapp/msgui/unifiededitor/src/msgtypenotifier.cpp
messagingapp/msgui/unifiededitor/src/msgunieditoraddress.cpp
messagingapp/msgui/unifiededitor/src/msgunieditorattachment.cpp
messagingapp/msgui/unifiededitor/src/msgunieditorbody.cpp
messagingapp/msgui/unifiededitor/src/msgunieditorprocessimageoperation.cpp
messagingapp/msgui/unifiededitor/src/msgunieditorsubject.cpp
messagingapp/msgui/unifiededitor/src/msgunieditorview.cpp
messagingapp/msgui/unifiededitor/src/msgunifiededitorlineedit.cpp
messagingapp/msgui/unifiededitor/unifiededitor.pro
messagingapp/msgui/unifiededitor/unifiededitor.qrc
messagingapp/msgui/unifiedviewer/inc/unifiedviewer.h
messagingapp/msgui/unifiedviewer/inc/univieweraddresscontainer.h
messagingapp/msgui/unifiedviewer/inc/univiewerbodywidget.h
messagingapp/msgui/unifiedviewer/inc/univiewerdetailswidget.h
messagingapp/msgui/unifiedviewer/inc/univiewerfeeder.h
messagingapp/msgui/unifiedviewer/inc/univiewerfeeder_p.h
messagingapp/msgui/unifiedviewer/inc/univiewerheadercontainer.h
messagingapp/msgui/unifiedviewer/inc/univiewertextitem.h
messagingapp/msgui/unifiedviewer/inc/univiewslidewidget.h
messagingapp/msgui/unifiedviewer/resources/layouts/univieweraddresswidget.css
messagingapp/msgui/unifiedviewer/resources/layouts/univiewerbodywidget.css
messagingapp/msgui/unifiedviewer/resources/layouts/univiewerbodywidget.widgetml
messagingapp/msgui/unifiedviewer/resources/layouts/univiewerbodywidget_color.css
messagingapp/msgui/unifiedviewer/resources/layouts/univiewerdetailswidget.css
messagingapp/msgui/unifiedviewer/resources/layouts/univiewerdetailswidget_color.css
messagingapp/msgui/unifiedviewer/resources/layouts/univiewermediawidget_color.css
messagingapp/msgui/unifiedviewer/src/unifiedviewer.cpp
messagingapp/msgui/unifiedviewer/src/univieweraddresscontainer.cpp
messagingapp/msgui/unifiedviewer/src/univieweraddresswidget.cpp
messagingapp/msgui/unifiedviewer/src/univiewerbodywidget.cpp
messagingapp/msgui/unifiedviewer/src/univiewerdetailswidget.cpp
messagingapp/msgui/unifiedviewer/src/univiewerfeeder.cpp
messagingapp/msgui/unifiedviewer/src/univiewerfeeder_p.cpp
messagingapp/msgui/unifiedviewer/src/univiewerheadercontainer.cpp
messagingapp/msgui/unifiedviewer/src/univiewertextitem.cpp
messagingapp/msgui/unifiedviewer/src/univiewslidewidget.cpp
messagingapp/msgui/unifiedviewer/unifiedviewer.pro
messagingapp/msgui/unifiedviewer/unifiedviewer.qrc
messagingapp/msgutils/bwins/convergedmessageutilsu.def
messagingapp/msgutils/bwins/unidatamodelloaderu.def
messagingapp/msgutils/bwins/unieditorutilsu.def
messagingapp/msgutils/bwins/unifieddatamodelu.def
messagingapp/msgutils/convergedmessageutils/inc/convergedmessageimpl.h
messagingapp/msgutils/convergedmessageutils/src/convergedmessage.cpp
messagingapp/msgutils/convergedmessageutils/src/convergedmessageimpl.cpp
messagingapp/msgutils/eabi/convergedmessageutilsu.def
messagingapp/msgutils/eabi/unidatamodelloaderu.def
messagingapp/msgutils/eabi/unieditorutilsu.def
messagingapp/msgutils/eabi/unifieddatamodelu.def
messagingapp/msgutils/msgutils.pro
messagingapp/msgutils/unidatamodel/unidatamodel.pro
messagingapp/msgutils/unidatamodel/unimmsdataplugin/UniDataModel.rss
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/ConformanceChecker.h
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/MsgAttachmentUtils.h
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniDataModel.h
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniDataModel.inl
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniDataUtils.h
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniDataUtils.inl
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniDrmInfo.h
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniDrmInfo.inl
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniMimeInfo.h
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniMimeInfo.inl
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniModelConst.h
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniObject.h
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniObject.inl
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniObjectList.h
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniObjectList.inl
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniSmil.hrh
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniSmil.rh
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniSmilList.h
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniSmilList.inl
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniSmilModel.h
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniSmilModel.inl
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniSmilParams.h
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniSmilParams.inl
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniSmilSlide.h
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniSmilUtils.h
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniTextObject.h
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniTextObject.inl
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/sessioneventhandler.h
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/smilliterals.h
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/unimmsdataplugin.h
messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/unimmsdataplugin_p.h
messagingapp/msgutils/unidatamodel/unimmsdataplugin/rom/unimmsdataplugin.iby
messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/ConformanceChecker.cpp
messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/MsgAttachmentUtils.cpp
messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/UniDataModel.cpp
messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/UniDataUtils.cpp
messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/UniDrmInfo.cpp
messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/UniMimeInfo.cpp
messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/UniObject.cpp
messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/UniObjectList.cpp
messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/UniSmilList.cpp
messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/UniSmilModel.cpp
messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/UniSmilParams.cpp
messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/UniSmilSlide.cpp
messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/UniSmilUtils.cpp
messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/UniTextObject.cpp
messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/sessioneventhandler.cpp
messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/unimmsdataplugin.cpp
messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/unimmsdataplugin_p.cpp
messagingapp/msgutils/unidatamodel/unimmsdataplugin/tsrc/bwins/test_unidatamodel_mms_pluginu.def
messagingapp/msgutils/unidatamodel/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/photo.jpg
messagingapp/msgutils/unidatamodel/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/testunidatamodelmmsplugin.cpp
messagingapp/msgutils/unidatamodel/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/testunidatamodelmmsplugin.h
messagingapp/msgutils/unidatamodel/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/testunidatamodelmmsplugin.ini
messagingapp/msgutils/unidatamodel/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/testunidatamodelmmsplugin.pro
messagingapp/msgutils/unidatamodel/unimmsdataplugin/unimmsdataplugin.pro
messagingapp/msgutils/unidatamodel/unismsdataplugin/inc/sessioneventhandler.h
messagingapp/msgutils/unidatamodel/unismsdataplugin/inc/unismsdataplugin.h
messagingapp/msgutils/unidatamodel/unismsdataplugin/inc/unismsdataplugin_p.h
messagingapp/msgutils/unidatamodel/unismsdataplugin/rom/unismsdataplugin.iby
messagingapp/msgutils/unidatamodel/unismsdataplugin/src/sessioneventhandler.cpp
messagingapp/msgutils/unidatamodel/unismsdataplugin/src/unismsdataplugin.cpp
messagingapp/msgutils/unidatamodel/unismsdataplugin/src/unismsdataplugin_p.cpp
messagingapp/msgutils/unidatamodel/unismsdataplugin/tsrc/bwins/test_unidatamodel_sms_pluginu.def
messagingapp/msgutils/unidatamodel/unismsdataplugin/tsrc/testunidatamodelsmsplugin/testunidatamodelsmsplugin.cpp
messagingapp/msgutils/unidatamodel/unismsdataplugin/tsrc/testunidatamodelsmsplugin/testunidatamodelsmsplugin.h
messagingapp/msgutils/unidatamodel/unismsdataplugin/tsrc/testunidatamodelsmsplugin/testunidatamodelsmsplugin.ini
messagingapp/msgutils/unidatamodel/unismsdataplugin/tsrc/testunidatamodelsmsplugin/testunidatamodelsmsplugin.pro
messagingapp/msgutils/unidatamodel/unismsdataplugin/unismsdataplugin.pro
messagingapp/msgutils/unidatamodel/univcaldataplugin/BioMtm.rsc
messagingapp/msgutils/unidatamodel/univcaldataplugin/inc/sessioneventhandler.h
messagingapp/msgutils/unidatamodel/univcaldataplugin/inc/univcaldataplugin.h
messagingapp/msgutils/unidatamodel/univcaldataplugin/inc/univcaldataplugin_p.h
messagingapp/msgutils/unidatamodel/univcaldataplugin/prov.rsc
messagingapp/msgutils/unidatamodel/univcaldataplugin/rom/univcaldataplugin.iby
messagingapp/msgutils/unidatamodel/univcaldataplugin/src/sessioneventhandler.cpp
messagingapp/msgutils/unidatamodel/univcaldataplugin/src/univcaldataplugin.cpp
messagingapp/msgutils/unidatamodel/univcaldataplugin/src/univcaldataplugin_p.cpp
messagingapp/msgutils/unidatamodel/univcaldataplugin/tsrc/bwins/test_unidatamodel_vcal_pluginu.def
messagingapp/msgutils/unidatamodel/univcaldataplugin/tsrc/testunidatamodelvcalplugin/BioMtm.rsc
messagingapp/msgutils/unidatamodel/univcaldataplugin/tsrc/testunidatamodelvcalplugin/testunidatamodelvcalplugin.cpp
messagingapp/msgutils/unidatamodel/univcaldataplugin/tsrc/testunidatamodelvcalplugin/testunidatamodelvcalplugin.h
messagingapp/msgutils/unidatamodel/univcaldataplugin/tsrc/testunidatamodelvcalplugin/testunidatamodelvcalplugin.ini
messagingapp/msgutils/unidatamodel/univcaldataplugin/tsrc/testunidatamodelvcalplugin/testunidatamodelvcalplugin.pro
messagingapp/msgutils/unidatamodel/univcaldataplugin/tsrc/testunidatamodelvcalplugin/vcal1.txt
messagingapp/msgutils/unidatamodel/univcaldataplugin/univcaldataplugin.pro
messagingapp/msgutils/unidatamodelloader/rom/unidatamodelloader.iby
messagingapp/msgutils/unidatamodelloader/src/unidatamodelloader.cpp
messagingapp/msgutils/unidatamodelloader/unidatamodelloader.pro
messagingapp/msgutils/unidatautils/bwins/unidatamodelloaderu.def
messagingapp/msgutils/unidatautils/bwins/unidatamodelu.def
messagingapp/msgutils/unidatautils/eabi/unidatamodelloaderu.def
messagingapp/msgutils/unidatautils/eabi/unidatamodelu.def
messagingapp/msgutils/unidatautils/unidatamodel/UniDataModel.rss
messagingapp/msgutils/unidatautils/unidatamodel/inc/ConformanceChecker.h
messagingapp/msgutils/unidatautils/unidatamodel/inc/MsgAttachmentUtils.h
messagingapp/msgutils/unidatautils/unidatamodel/inc/UniDataModel.h
messagingapp/msgutils/unidatautils/unidatamodel/inc/UniDataModel.inl
messagingapp/msgutils/unidatautils/unidatamodel/inc/UniDataUtils.h
messagingapp/msgutils/unidatautils/unidatamodel/inc/UniDataUtils.inl
messagingapp/msgutils/unidatautils/unidatamodel/inc/UniDrmInfo.h
messagingapp/msgutils/unidatautils/unidatamodel/inc/UniDrmInfo.inl
messagingapp/msgutils/unidatautils/unidatamodel/inc/UniMimeInfo.h
messagingapp/msgutils/unidatautils/unidatamodel/inc/UniMimeInfo.inl
messagingapp/msgutils/unidatautils/unidatamodel/inc/UniModelConst.h
messagingapp/msgutils/unidatautils/unidatamodel/inc/UniObject.h
messagingapp/msgutils/unidatautils/unidatamodel/inc/UniObject.inl
messagingapp/msgutils/unidatautils/unidatamodel/inc/UniObjectList.h
messagingapp/msgutils/unidatautils/unidatamodel/inc/UniObjectList.inl
messagingapp/msgutils/unidatautils/unidatamodel/inc/UniSmil.hrh
messagingapp/msgutils/unidatautils/unidatamodel/inc/UniSmil.rh
messagingapp/msgutils/unidatautils/unidatamodel/inc/UniSmilList.h
messagingapp/msgutils/unidatautils/unidatamodel/inc/UniSmilList.inl
messagingapp/msgutils/unidatautils/unidatamodel/inc/UniSmilModel.h
messagingapp/msgutils/unidatautils/unidatamodel/inc/UniSmilModel.inl
messagingapp/msgutils/unidatautils/unidatamodel/inc/UniSmilParams.h
messagingapp/msgutils/unidatautils/unidatamodel/inc/UniSmilParams.inl
messagingapp/msgutils/unidatautils/unidatamodel/inc/UniSmilSlide.h
messagingapp/msgutils/unidatautils/unidatamodel/inc/UniSmilUtils.h
messagingapp/msgutils/unidatautils/unidatamodel/inc/UniTextObject.h
messagingapp/msgutils/unidatautils/unidatamodel/inc/UniTextObject.inl
messagingapp/msgutils/unidatautils/unidatamodel/inc/smilliterals.h
messagingapp/msgutils/unidatautils/unidatamodel/rom/unidatamodel.iby
messagingapp/msgutils/unidatautils/unidatamodel/src/ConformanceChecker.cpp
messagingapp/msgutils/unidatautils/unidatamodel/src/MsgAttachmentUtils.cpp
messagingapp/msgutils/unidatautils/unidatamodel/src/UniDataModel.cpp
messagingapp/msgutils/unidatautils/unidatamodel/src/UniDataUtils.cpp
messagingapp/msgutils/unidatautils/unidatamodel/src/UniDrmInfo.cpp
messagingapp/msgutils/unidatautils/unidatamodel/src/UniMimeInfo.cpp
messagingapp/msgutils/unidatautils/unidatamodel/src/UniObject.cpp
messagingapp/msgutils/unidatautils/unidatamodel/src/UniObjectList.cpp
messagingapp/msgutils/unidatautils/unidatamodel/src/UniSmilList.cpp
messagingapp/msgutils/unidatautils/unidatamodel/src/UniSmilModel.cpp
messagingapp/msgutils/unidatautils/unidatamodel/src/UniSmilParams.cpp
messagingapp/msgutils/unidatautils/unidatamodel/src/UniSmilSlide.cpp
messagingapp/msgutils/unidatautils/unidatamodel/src/UniSmilUtils.cpp
messagingapp/msgutils/unidatautils/unidatamodel/src/UniTextObject.cpp
messagingapp/msgutils/unidatautils/unidatamodel/unidatamodel.pro
messagingapp/msgutils/unidatautils/unidatamodelloader/rom/unidatamodelloader.iby
messagingapp/msgutils/unidatautils/unidatamodelloader/src/unidatamodelloader.cpp
messagingapp/msgutils/unidatautils/unidatamodelloader/unidatamodelloader.pro
messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/inc/unibiomessagedataplugin.h
messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/inc/unibiomessagedataplugin_p.h
messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/prov.rsc
messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/rom/unibiomessagedataplugin.iby
messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/src/unibiomessagedataplugin.cpp
messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/src/unibiomessagedataplugin_p.cpp
messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/bwins/test_unidatamodel_vcal_pluginu.def
messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/testunidatamodelvcalplugin/BioMtm.rsc
messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/testunidatamodelvcalplugin/testunidatamodelvcalplugin.cpp
messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/testunidatamodelvcalplugin/testunidatamodelvcalplugin.h
messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/testunidatamodelvcalplugin/testunidatamodelvcalplugin.ini
messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/testunidatamodelvcalplugin/testunidatamodelvcalplugin.pro
messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/testunidatamodelvcalplugin/vcal1.txt
messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/unibiomessagedataplugin.pro
messagingapp/msgutils/unidatautils/unidatamodelplugins/unidatamodelplugins.pro
messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/inc/unimmsdataplugin.h
messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/inc/unimmsdataplugin_p.h
messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/rom/unimmsdataplugin.iby
messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/src/unimmsdataplugin.cpp
messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/src/unimmsdataplugin_p.cpp
messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/bwins/test_unidatamodel_mms_pluginu.def
messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/photo.jpg
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/unimmsdataplugin.pro
messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/inc/unismsdataplugin.h
messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/inc/unismsdataplugin_p.h
messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/rom/unismsdataplugin.iby
messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/src/unismsdataplugin.cpp
messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/src/unismsdataplugin_p.cpp
messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/tsrc/bwins/test_unidatamodel_sms_pluginu.def
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/unismsdataplugin.pro
messagingapp/msgutils/unidatautils/unidatautils.pro
messagingapp/msgutils/unieditorplugins/bwins/unieditorpluginloaderu.def
messagingapp/msgutils/unieditorplugins/eabi/unieditorpluginloaderu.def
messagingapp/msgutils/unieditorplugins/unieditormmsplugin/inc/sessioneventhandler.h
messagingapp/msgutils/unieditorplugins/unieditormmsplugin/inc/unieditormmsplugin.h
messagingapp/msgutils/unieditorplugins/unieditormmsplugin/inc/unieditormmsplugin_p.h
messagingapp/msgutils/unieditorplugins/unieditormmsplugin/rom/unieditormmsplugin.iby
messagingapp/msgutils/unieditorplugins/unieditormmsplugin/src/sessioneventhandler.cpp
messagingapp/msgutils/unieditorplugins/unieditormmsplugin/src/unieditormmsplugin.cpp
messagingapp/msgutils/unieditorplugins/unieditormmsplugin/src/unieditormmsplugin_p.cpp
messagingapp/msgutils/unieditorplugins/unieditormmsplugin/tsrc/bwins/test_mms_pluginu.def
messagingapp/msgutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/mms.rsc
messagingapp/msgutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/not.rsc
messagingapp/msgutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/testmmsplugin.cpp
messagingapp/msgutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/testmmsplugin.h
messagingapp/msgutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/testmmsplugin.ini
messagingapp/msgutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/testmmsplugin.pro
messagingapp/msgutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/testmsg.h
messagingapp/msgutils/unieditorplugins/unieditormmsplugin/unieditormmsplugin.pro
messagingapp/msgutils/unieditorplugins/unieditorpluginloader/rom/unieditorpluginloader.iby
messagingapp/msgutils/unieditorplugins/unieditorpluginloader/src/unieditorpluginloader.cpp
messagingapp/msgutils/unieditorplugins/unieditorpluginloader/unieditorpluginloader.pro
messagingapp/msgutils/unieditorplugins/unieditorplugins.pro
messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/inc/sessioneventhandler.h
messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/inc/unieditorsmsplugin.h
messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/inc/unieditorsmsplugin_p.h
messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/rom/unieditorsmsplugin.iby
messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/src/sessioneventhandler.cpp
messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/src/unieditorsmsplugin.cpp
messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/src/unieditorsmsplugin_p.cpp
messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/tsrc/bwins/test_sms_pluginu.def
messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/1000102C.txt
messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/100058DB.txt
messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/101FB0D5.txt
messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/101FB0D9.txt
messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/cccccc00.cre
messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/ced_simtsy.cfg
messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/sms.rsc
messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/testmsg.h
messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/testsmsplugin.cpp
messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/testsmsplugin.h
messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/testsmsplugin.ini
messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/testsmsplugin.pro
messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/unieditorsmsplugin.pro
messagingapp/msgutils/unieditorutils/bwins/editorgenutilsu.def
messagingapp/msgutils/unieditorutils/bwins/unieditorpluginloaderu.def
messagingapp/msgutils/unieditorutils/eabi/editorgenutilsu.def
messagingapp/msgutils/unieditorutils/eabi/unieditorpluginloaderu.def
messagingapp/msgutils/unieditorutils/editorgenutils/editorgenutils.pro
messagingapp/msgutils/unieditorutils/editorgenutils/inc/MuiuOperationWait.h
messagingapp/msgutils/unieditorutils/editorgenutils/inc/UniEditorGenUtils.h
messagingapp/msgutils/unieditorutils/editorgenutils/inc/muiuutilsdefines.h
messagingapp/msgutils/unieditorutils/editorgenutils/rom/editorgenutils.iby
messagingapp/msgutils/unieditorutils/editorgenutils/src/MuiuOperationWait.cpp
messagingapp/msgutils/unieditorutils/editorgenutils/src/UniEditorGenUtils.cpp
messagingapp/msgutils/unieditorutils/inc/MuiuOperationWait.h
messagingapp/msgutils/unieditorutils/inc/UniEditorGenUtils.h
messagingapp/msgutils/unieditorutils/inc/muiuutilsdefines.h
messagingapp/msgutils/unieditorutils/rom/unieditorutils.iby
messagingapp/msgutils/unieditorutils/src/MuiuOperationWait.cpp
messagingapp/msgutils/unieditorutils/src/UniEditorGenUtils.cpp
messagingapp/msgutils/unieditorutils/unieditorpluginloader/rom/unieditorpluginloader.iby
messagingapp/msgutils/unieditorutils/unieditorpluginloader/src/unieditorpluginloader.cpp
messagingapp/msgutils/unieditorutils/unieditorpluginloader/unieditorpluginloader.pro
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/inc/unieditormmsplugin.h
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/inc/unieditormmsplugin_p.h
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/rom/unieditormmsplugin.iby
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/src/unieditormmsplugin.cpp
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/src/unieditormmsplugin_p.cpp
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/bwins/test_mms_pluginu.def
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/mms.rsc
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/not.rsc
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/testmmsplugin.cpp
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/testmmsplugin.h
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/testmmsplugin.ini
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/testmmsplugin.pro
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/testmsg.h
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/unieditormmsplugin.pro
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorplugins.pro
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/inc/unieditorsmsplugin.h
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/inc/unieditorsmsplugin_p.h
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/rom/unieditorsmsplugin.iby
messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/src/unieditorsmsplugin.cpp
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/unieditorsmsplugin.pro
messagingapp/msgutils/unieditorutils/unieditorutils.pro
messagingapp/shareui/inc/shareuiprivate.h
messagingapp/shareui/shareui.pro
messagingapp/shareui/src/shareui.cpp
messagingapp/shareui/src/shareuiprivate.cpp
messagingappbase/messagingappbase.pro
messagingappbase/msgmedia/src/MmsConformance.cpp
messagingappbase/msgmedia/src/MsgMediaInfo.cpp
messagingappbase/msgmedia/src/MsgMediaResolver.cpp
messagingappbase/mtmregistry/mtmregistry.mmp
messagingappbase/mtmregistry/mtmregistry.pro
messagingappbase/mtmregistry/resource/bioregistry.rss
messagingappbase/mtmregistry/resource/mmsregistry.rss
messagingappbase/mtmregistry/resource/notregistry.rss
messagingappbase/mtmregistry/resource/smsregistry.rss
messagingappbase/mtmregistry/rom/mtmregistry.iby
messagingappbase/obexmtms/Group/messaging_obex.history.xml
messagingappbase/obexmtms/Rom/obex.hby
messagingappbase/obexmtms/btmtm/btclient/group/btcmtm.mmp
messagingappbase/obexmtms/btmtm/btserver/group/btsmtm.mmp
messagingappbase/obexmtms/irmtm/irclient/group/ircmtm.MMP
messagingappbase/obexmtms/irmtm/irserver/group/IRSMTM.MMP
messagingappbase/obexmtms/obexmtm/obexclient/group/obexClientMtm.mmp
messagingappbase/obexmtms/obexmtm/obexclient/source/obexClientMtm.cpp
messagingappbase/obexmtms/obexmtm/obexserver/group/obexServerMtm.mmp
messagingappbase/obexmtms/obexmtm/obexutil/group/obexMtmUtil.mmp
messagingappbase/rom/Provisioning.iby
messagingappbase/rom/RFSPlugins.iby
messagingappbase/rom/Sms.rsc
messagingappbase/rom/mms.rsc
messagingappbase/smilparser/GROUP/messaging_gmxml.history.xml
messagingappbase/smilparser/GROUP/messaging_gmxml.mrp
messagingappbase/smilparser/Rom/Gmxml.iby
messagingappbase/smilparser/SMILdtd/GROUP/smildtd.mmp
messagingappbase/smilparser/SMILdtd/GROUP/smiltranslatortest.mmp
messagingappbase/smilparser/SMILdtd/GROUP/t_smil_dom.mmp
messagingappbase/smilparser/SMILdtd/tsrc/smiltranslatortest.cpp
messagingappbase/smsmtm/clientmtm/bmarm/SMCMU.DEF
messagingappbase/smsmtm/clientmtm/bwins/SMCMU.DEF
messagingappbase/smsmtm/clientmtm/bwins/V1.5_SMCMU.DEF
messagingappbase/smsmtm/clientmtm/bwins/V2_SMCMU.DEF
messagingappbase/smsmtm/clientmtm/eabi/smcmU.DEF
messagingappbase/smsmtm/clientmtm/eabi/v1.5_smcmu.def
messagingappbase/smsmtm/clientmtm/eabi/v2_smcmu.def
messagingappbase/smsmtm/clientmtm/group/1000102C.txt
messagingappbase/smsmtm/clientmtm/group/smcm.mmp
messagingappbase/smsmtm/clientmtm/group/test.bat
messagingappbase/smsmtm/clientmtm/inc/SMCMMAIN.H
messagingappbase/smsmtm/clientmtm/inc/SMSCLNT.H
messagingappbase/smsmtm/clientmtm/inc/SMSCLNT.INL
messagingappbase/smsmtm/clientmtm/inc/SMUTHDR.H
messagingappbase/smsmtm/clientmtm/inc/SMUTHDR.INL
messagingappbase/smsmtm/clientmtm/inc/SMUTSET.H
messagingappbase/smsmtm/clientmtm/inc/SMUTSET.INL
messagingappbase/smsmtm/clientmtm/inc/csmsaccount.h
messagingappbase/smsmtm/clientmtm/inc/csmsemailfields.h
messagingappbase/smsmtm/clientmtm/inc/csmsgetdetdescinterface.h
messagingappbase/smsmtm/clientmtm/inc/csmsgetdetdescinterface.inl
messagingappbase/smsmtm/clientmtm/inc/csmssendmessageoperation.h
messagingappbase/smsmtm/clientmtm/inc/smscmds.h
messagingappbase/smsmtm/clientmtm/inc/smut.h
messagingappbase/smsmtm/clientmtm/inc/smutsimparam.h
messagingappbase/smsmtm/clientmtm/inc/tmsvsmsentry.h
messagingappbase/smsmtm/clientmtm/inc/tmsvsmsentry.inl
messagingappbase/smsmtm/clientmtm/src/SMCMMAIN.CPP
messagingappbase/smsmtm/clientmtm/src/SMSCLNT.CPP
messagingappbase/smsmtm/clientmtm/src/SMUTHDR.CPP
messagingappbase/smsmtm/clientmtm/src/SMUTSET.CPP
messagingappbase/smsmtm/clientmtm/src/csmsaccount.cpp
messagingappbase/smsmtm/clientmtm/src/csmsemailfields.cpp
messagingappbase/smsmtm/clientmtm/src/csmssendmessageoperation.cpp
messagingappbase/smsmtm/clientmtm/src/smut.cpp
messagingappbase/smsmtm/clientmtm/src/smutsimparam.cpp
messagingappbase/smsmtm/clientmtm/test/Unittef/group/t_sms_header_and_body_Sql_migration.iby
messagingappbase/smsmtm/clientmtm/test/Unittef/group/t_sms_header_and_body_Sql_migration.mmp
messagingappbase/smsmtm/clientmtm/test/Unittef/inc/csmsheaderbodySqlstorerestore.h
messagingappbase/smsmtm/clientmtm/test/Unittef/script/t_sms_header_and_body_Sql_migration.script
messagingappbase/smsmtm/clientmtm/test/Unittef/src/csmsheaderbodySqlmigration.cpp
messagingappbase/smsmtm/clientmtm/test/Unittef/src/csmsheaderbodySqlstorerestore.cpp
messagingappbase/smsmtm/clientmtm/test/bwins/APIGATHERERSERVERU.DEF
messagingappbase/smsmtm/clientmtm/test/group/smcmsuite_gsm.iby
messagingappbase/smsmtm/clientmtm/test/group/smcmsuite_gsm.mmp
messagingappbase/smsmtm/clientmtm/test/inc/smcmserver.h
messagingappbase/smsmtm/clientmtm/test/inc/smcmstepbase.h
messagingappbase/smsmtm/clientmtm/test/inc/smcmstepfind.h
messagingappbase/smsmtm/clientmtm/test/inc/smcmstepfindalias.h
messagingappbase/smsmtm/clientmtm/test/inc/smcmstepforward.h
messagingappbase/smsmtm/clientmtm/test/inc/smcmstepforwardemail.h
messagingappbase/smsmtm/clientmtm/test/inc/smcmstepinitialise.h
messagingappbase/smsmtm/clientmtm/test/inc/smcmstepquerycapabilities.h
messagingappbase/smsmtm/clientmtm/test/inc/smcmstepreply.h
messagingappbase/smsmtm/clientmtm/test/inc/smcmstepreplyemail.h
messagingappbase/smsmtm/clientmtm/test/inc/smcmstepsettings.h
messagingappbase/smsmtm/clientmtm/test/scripts/smcmsuite_gsm.script
messagingappbase/smsmtm/clientmtm/test/src/smcmserver.cpp
messagingappbase/smsmtm/clientmtm/test/src/smcmstepbase.cpp
messagingappbase/smsmtm/clientmtm/test/src/smcmstepfind.cpp
messagingappbase/smsmtm/clientmtm/test/src/smcmstepfindalias.cpp
messagingappbase/smsmtm/clientmtm/test/src/smcmstepforward.cpp
messagingappbase/smsmtm/clientmtm/test/src/smcmstepforwardemail.cpp
messagingappbase/smsmtm/clientmtm/test/src/smcmstepinitialise.cpp
messagingappbase/smsmtm/clientmtm/test/src/smcmstepquerycapabilities.cpp
messagingappbase/smsmtm/clientmtm/test/src/smcmstepreply.cpp
messagingappbase/smsmtm/clientmtm/test/src/smcmstepreplyemail.cpp
messagingappbase/smsmtm/clientmtm/test/src/smcmstepsettings.cpp
messagingappbase/smsmtm/conf/smsmtm.confml
messagingappbase/smsmtm/conf/smsmtm_1000102c.crml
messagingappbase/smsmtm/group/GtSmsMtm.hby
messagingappbase/smsmtm/group/GtSmsMtm.iby
messagingappbase/smsmtm/group/messaging_sms.history.xml
messagingappbase/smsmtm/group/messaging_sms.mrp
messagingappbase/smsmtm/servermtm/bmarm/SMSSU.DEF
messagingappbase/smsmtm/servermtm/bwins/SMSSU.DEF
messagingappbase/smsmtm/servermtm/eabi/smssU.DEF
messagingappbase/smsmtm/servermtm/group/SMSS.rss
messagingappbase/smsmtm/servermtm/group/smss.mmp
messagingappbase/smsmtm/servermtm/group/smss.rls
messagingappbase/smsmtm/servermtm/inc/SMSRecipientSend.h
messagingappbase/smsmtm/servermtm/inc/SMSSERV.H
messagingappbase/smsmtm/servermtm/inc/SMSSOUTB.H
messagingappbase/smsmtm/servermtm/inc/SMSSPAN.H
messagingappbase/smsmtm/servermtm/inc/SMSSSEND.H
messagingappbase/smsmtm/servermtm/inc/SMSSchSend.h
messagingappbase/smsmtm/servermtm/inc/SMSSendSession.h
messagingappbase/smsmtm/servermtm/inc/SmssSimUtils.h
messagingappbase/smsmtm/servermtm/inc/SmssSimUtils.inl
messagingappbase/smsmtm/servermtm/inc/smss.hrh
messagingappbase/smsmtm/servermtm/inc/smssactive.h
messagingappbase/smsmtm/servermtm/src/SMSRecipientSend.cpp
messagingappbase/smsmtm/servermtm/src/SMSSERV.CPP
messagingappbase/smsmtm/servermtm/src/SMSSMAIN.CPP
messagingappbase/smsmtm/servermtm/src/SMSSOUTB.CPP
messagingappbase/smsmtm/servermtm/src/SMSSSEND.CPP
messagingappbase/smsmtm/servermtm/src/SMSSchSend.cpp
messagingappbase/smsmtm/servermtm/src/SMSSendSession.cpp
messagingappbase/smsmtm/servermtm/src/SmssSimUtils.cpp
messagingappbase/smsmtm/servermtm/src/TextRecipientSend.cpp
messagingappbase/smsmtm/servermtm/src/WapRecipientSend.cpp
messagingappbase/smsmtm/servermtm/src/smssactive.cpp
messagingappbase/smsmtm/smsgetdetdescdefault/group/smsgetdetdescdefault.mmp
messagingappbase/smsmtm/smsgetdetdescdefault/inc/csmsgetdetdescdefault.h
messagingappbase/smsmtm/smsgetdetdescdefault/src/10282fa6.rss
messagingappbase/smsmtm/smsgetdetdescdefault/src/csmsgetdetdescdefault.cpp
messagingappbase/smsmtm/test/class0smsnotifier/group/class0smsTxtnotifier.mmp
messagingappbase/smsmtm/test/class0smsnotifier/group/class0smsUINotifier.iby
messagingappbase/smsmtm/test/class0smsnotifier/group/class0smsUInotifier.mmp
messagingappbase/smsmtm/test/class0smsnotifier/group/v2_eabiu.def
messagingappbase/smsmtm/test/class0smsnotifier/group/v2_winsu.def
messagingappbase/smsmtm/test/class0smsnotifier/inc/class0smsTxtnotifier.h
messagingappbase/smsmtm/test/class0smsnotifier/inc/class0smsUInotifier.h
messagingappbase/smsmtm/test/class0smsnotifier/src/2000C382.rss
messagingappbase/smsmtm/test/class0smsnotifier/src/class0smsTxtnotifier.cpp
messagingappbase/smsmtm/test/class0smsnotifier/src/class0smsUInotifier.cpp
messagingappbase/smsmtm/test/data/ConfigFiles/14IndicationsConfig.txt
messagingappbase/smsmtm/test/data/ConfigFiles/ReplyToConfig.txt
messagingappbase/smsmtm/test/data/ServerMtm_ErrorRetryHandling.ini
messagingappbase/smsmtm/test/data/T_SmsSendRecv.html
messagingappbase/smsmtm/test/data/bif/giraffe.rss
messagingappbase/smsmtm/test/data/bif/koala.rss
messagingappbase/smsmtm/test/data/bif/smcm.bmp
messagingappbase/smsmtm/test/data/ems/anims.mbm
messagingappbase/smsmtm/test/data/ems/pics.mbm
messagingappbase/smsmtm/test/data/script/EricssonT300.txt
messagingappbase/smsmtm/test/data/script/Nokia8210.txt
messagingappbase/smsmtm/test/data/script/ReadMe.txt
messagingappbase/smsmtm/test/data/script/biofication.script
messagingappbase/smsmtm/test/data/script/logo1.olp
messagingappbase/smsmtm/test/data/script/nbs.script
messagingappbase/smsmtm/test/data/script/sendrecv.script
messagingappbase/smsmtm/test/data/script/sendrecv_ems.script
messagingappbase/smsmtm/test/data/script/simparameter.script
messagingappbase/smsmtm/test/data/script/smcmsimtsytest_config.txt
messagingappbase/smsmtm/test/data/script/sms.script
messagingappbase/smsmtm/test/data/script/smsenum.script
messagingappbase/smsmtm/test/data/script/smssc_config.txt
messagingappbase/smsmtm/test/data/script/t_SmsReplyTo.script
messagingappbase/smsmtm/test/data/script/t_SmsSpecialIndications.script
messagingappbase/smsmtm/test/data/script/t_smcs2.script
messagingappbase/smsmtm/test/data/script/tone1.rtp
messagingappbase/smsmtm/test/data/script/tone2.rtp
messagingappbase/smsmtm/test/data/script/tone3.rtp
messagingappbase/smsmtm/test/data/script/wap.script
messagingappbase/smsmtm/test/data/t_smcmrecvmanual.html
messagingappbase/smsmtm/test/group/T_CSmsSettings.mmp
messagingappbase/smsmtm/test/group/T_SmcmFail.mmp
messagingappbase/smsmtm/test/group/T_SmsCancel.mmp
messagingappbase/smsmtm/test/group/T_SmsDeliver.mmp
messagingappbase/smsmtm/test/group/T_SmsDeliverLastSegmentReport.mmp
messagingappbase/smsmtm/test/group/T_SmsEnum.mmp
messagingappbase/smsmtm/test/group/T_SmsRegress.mmp
messagingappbase/smsmtm/test/group/T_SmsSc.mmp
messagingappbase/smsmtm/test/group/T_SmsSendAs.mmp
messagingappbase/smsmtm/test/group/T_SmsSendNbs.mmp
messagingappbase/smsmtm/test/group/T_SmsSendRecv.mmp
messagingappbase/smsmtm/test/group/T_SmsSendText.mmp
messagingappbase/smsmtm/test/group/T_SmsSendWap.mmp
messagingappbase/smsmtm/test/group/T_schsms.mmp
messagingappbase/smsmtm/test/group/T_smcm1.mmp
messagingappbase/smsmtm/test/group/T_smcm2.mmp
messagingappbase/smsmtm/test/group/T_smcmsimtsytest.mmp
messagingappbase/smsmtm/test/group/t_SmsReplyToServer.mmp
messagingappbase/smsmtm/test/group/t_SmsSpecialIndicationsServer.mmp
messagingappbase/smsmtm/test/group/t_smcmrecvmanual.mmp
messagingappbase/smsmtm/test/group/t_smcs2_server.mmp
messagingappbase/smsmtm/test/group/t_smsbiofication.mmp
messagingappbase/smsmtm/test/group/t_smsdetails.mmp
messagingappbase/smsmtm/test/group/t_smsinit.mmp
messagingappbase/smsmtm/test/inc/T_SchSms.h
messagingappbase/smsmtm/test/inc/T_SmcmFail.h
messagingappbase/smsmtm/test/inc/T_SmsCancel.h
messagingappbase/smsmtm/test/inc/T_SmsEnum.h
messagingappbase/smsmtm/test/inc/T_SmsRegress.h
messagingappbase/smsmtm/test/inc/T_SmsSc.h
messagingappbase/smsmtm/test/inc/T_SmsSendAs.h
messagingappbase/smsmtm/test/inc/T_SmsSendBase.h
messagingappbase/smsmtm/test/inc/T_SmsSendNbs.h
messagingappbase/smsmtm/test/inc/T_SmsSendRecv.h
messagingappbase/smsmtm/test/inc/T_SmsSendText.h
messagingappbase/smsmtm/test/inc/T_SmsSendWap.h
messagingappbase/smsmtm/test/inc/T_smcm.h
messagingappbase/smsmtm/test/inc/T_smcmsimtsytest.h
messagingappbase/smsmtm/test/inc/T_smut.h
messagingappbase/smsmtm/test/inc/T_smutTE.h
messagingappbase/smsmtm/test/inc/t_SmsReplyToServer.h
messagingappbase/smsmtm/test/inc/t_SmsReplyToStep.h
messagingappbase/smsmtm/test/inc/t_SmsSpecialIndicationsServer.h
messagingappbase/smsmtm/test/inc/t_SmsSpecialIndicationsStep.h
messagingappbase/smsmtm/test/inc/t_smcmrecvmanual.h
messagingappbase/smsmtm/test/inc/t_smcs2_server.h
messagingappbase/smsmtm/test/inc/t_smsbiofication.h
messagingappbase/smsmtm/test/inc/t_smsdeliver.h
messagingappbase/smsmtm/test/inc/t_smsdeliverlastsegmentreport.h
messagingappbase/smsmtm/test/inc/t_smsdetails.h
messagingappbase/smsmtm/test/inc/t_smsinit.h
messagingappbase/smsmtm/test/inc/t_testSmsBase_Step.h
messagingappbase/smsmtm/test/inc/t_testSmsEmailFields_Step.h
messagingappbase/smsmtm/test/inc/t_testSmsEmsExtensions_step.h
messagingappbase/smsmtm/test/inc/t_testSmsSettings_Step.h
messagingappbase/smsmtm/test/inc/t_testSmsUtilities_Step.h
messagingappbase/smsmtm/test/inc/t_testsmsHeader_step.h
messagingappbase/smsmtm/test/inc/t_testsmsentry_step.h
messagingappbase/smsmtm/test/inc/t_testsmsnumber_step.h
messagingappbase/smsmtm/test/src/T_CSmsSettings.cpp
messagingappbase/smsmtm/test/src/T_SchSms.cpp
messagingappbase/smsmtm/test/src/T_SmcmFail.cpp
messagingappbase/smsmtm/test/src/T_SmsCancel.cpp
messagingappbase/smsmtm/test/src/T_SmsEnum.cpp
messagingappbase/smsmtm/test/src/T_SmsRegress.cpp
messagingappbase/smsmtm/test/src/T_SmsSc.cpp
messagingappbase/smsmtm/test/src/T_SmsSendAs.cpp
messagingappbase/smsmtm/test/src/T_SmsSendBase.cpp
messagingappbase/smsmtm/test/src/T_SmsSendNbs.cpp
messagingappbase/smsmtm/test/src/T_SmsSendRecv.cpp
messagingappbase/smsmtm/test/src/T_SmsSendText.cpp
messagingappbase/smsmtm/test/src/T_SmsSendWap.cpp
messagingappbase/smsmtm/test/src/T_smcm.cpp
messagingappbase/smsmtm/test/src/T_smcmsimtsytest.cpp
messagingappbase/smsmtm/test/src/T_smut.cpp
messagingappbase/smsmtm/test/src/T_smutTE.cpp
messagingappbase/smsmtm/test/src/t_SmsReplyToServer.cpp
messagingappbase/smsmtm/test/src/t_SmsReplyToStep.cpp
messagingappbase/smsmtm/test/src/t_SmsSpecialIndicationsServer.cpp
messagingappbase/smsmtm/test/src/t_SmsSpecialIndicationsStep.cpp
messagingappbase/smsmtm/test/src/t_smcmrecvmanual.cpp
messagingappbase/smsmtm/test/src/t_smcs2_server.cpp
messagingappbase/smsmtm/test/src/t_smsbiofication.cpp
messagingappbase/smsmtm/test/src/t_smsdeliver.cpp
messagingappbase/smsmtm/test/src/t_smsdeliverlastsegmentreport.cpp
messagingappbase/smsmtm/test/src/t_smsdetails.cpp
messagingappbase/smsmtm/test/src/t_smsinit.cpp
messagingappbase/smsmtm/test/src/t_testSmsBase_Step.cpp
messagingappbase/smsmtm/test/src/t_testSmsEmailFields_Step.cpp
messagingappbase/smsmtm/test/src/t_testSmsEmsExtensions_step.cpp
messagingappbase/smsmtm/test/src/t_testSmsEntry_Step.cpp
messagingappbase/smsmtm/test/src/t_testSmsNumber_Step.cpp
messagingappbase/smsmtm/test/src/t_testSmsSettings_Step.cpp
messagingappbase/smsmtm/test/src/t_testSmsUtilities_Step.cpp
messagingappbase/smsmtm/test/src/t_testsmsHeader_step.cpp
messagingappbase/smsmtm/test/testrom/t_smcm.iby
messagingappbase/smsmtm/test/testrom/t_smcm_prepare_for_test.bat
mmsengine/conf/messaging.confml
mmsengine/conf/messaging_101F87EB.crml
mmsengine/conf/messaging_101F87EC.crml
mmsengine/conf/messaging_101F87ED.crml
mmsengine/conf/messaging_101F87EE.crml
mmsengine/conf/messaging_101F87EF.crml
mmsengine/conf/messaging_101F8873.crml
mmsengine/conf/messaging_101F8F28.crml
mmsengine/conf/messaging_102071F2.crml
mmsengine/conf/messaging_102072E2.crml
mmsengine/conf/messaging_102072E5.crml
mmsengine/conf/messaging_102824A0.crml
mmsengine/conf/messaging_1028281E.crml
mmsengine/mmscodec/src/mmsdecode.cpp
mmsengine/mmsconf/messaging_mmssettings-config.history.xml
mmsengine/mmsconf/mmssettings_10202d4c.crml
mmsengine/mmsconninit/src/mmsconninit.cpp
mmsengine/mmsengine.pro
mmsengine/mmsmessage/src/mmsheaders.cpp
mmsengine/mmspushhandler/src/CMmsPushHandler.cpp
mmsengine/mmsserver/src/mmsmmboxlist.cpp
mmsengine/mmsserversettings/bld/MmsRegistry.rss
mmsengine/mmsserversettings/bld/NotRegistry.rss
mmsengine/mmsserversettings/bld/mmsserversettings.mmp
mmsengine/mmssettings/group/mmsgenericsettings.mmp
mmsengine/mmssettings/src/cmmssettings.cpp
mmsengine/mmssettings/test/group/T_MmsSettings.mmp
mmsengine/mmssettings/test/inc/T_MmsSettings.h
mmsengine/rom/MmsEngine.iby
msg_plat/conversation_services_client_api/inc/ccsrequesthandler.h
msg_plat/conversation_services_client_api/inc/rcssession.h
msg_plat/conversation_services_utilities_api/inc/ccsclientconversation.h
msg_plat/conversation_services_utilities_api/inc/ccsdefs.h
msg_plat/messaging_history_api/inc/msgitem.h
msg_plat/shareui_api/inc/shareuidialog.h
--- a/email/pop3andsmtpmtm/group/messaging_email.history.xml	Fri Apr 16 14:56:15 2010 +0300
+++ b/email/pop3andsmtpmtm/group/messaging_email.history.xml	Mon May 03 12:29:07 2010 +0300
@@ -7,6 +7,9 @@
     Modified IMAP/POP server MTM API to delete the old messages for new CMail  UI. 
   </defect>
  
+  <defect number="PDEF145102" title="Mail connection is disconnected with mVPN in MCL follow up" revision="157">
+   Handling cancel in   CAPA command 
+  </defect>
   <defect number="PDEF137958" title="Denial of Service vulnerability in mail retrieval" revision="156">
    Restricting the field size of the header to 5000, to avoid DOS condition.
   </defect>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/bmarm/IMPSU.DEF	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+	NewL__15CImap4ServerMtmR17CRegisteredMtmDllP15CMsvServerEntry @ 1 NONAME R3UNUSED ; CImap4ServerMtm::NewL(CRegisteredMtmDll &, CMsvServerEntry *)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/bwins/IMPSU.DEF	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+	?NewL@CImap4ServerMtm@@SAPAV1@AAVCRegisteredMtmDll@@PAVCMsvServerEntry@@@Z @ 1 NONAME ; public: static class CImap4ServerMtm * __cdecl CImap4ServerMtm::NewL(class CRegisteredMtmDll &,class CMsvServerEntry *)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/eabi/impsU.DEF	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,33 @@
+EXPORTS
+	_ZN15CImap4ServerMtm4NewLER17CRegisteredMtmDllP15CMsvServerEntry @ 1 NONAME
+	_ZTI11CImap4Utils @ 2 NONAME ; #<TI>#
+	_ZTI14CActiveWrapper @ 3 NONAME ; #<TI>#
+	_ZTI15CImImap4Session @ 4 NONAME ; #<TI>#
+	_ZTI15CImap4ServerMtm @ 5 NONAME ; #<TI>#
+	_ZTI16CImImap4Compound @ 6 NONAME ; #<TI>#
+	_ZTI17CIdleTimeoutTimer @ 7 NONAME ; #<TI>#
+	_ZTI17CImImap4DirStruct @ 8 NONAME ; #<TI>#
+	_ZTI18CImImap4FolderSync @ 9 NONAME ; #<TI>#
+	_ZTI19CImImap4FolderIndex @ 10 NONAME ; #<TI>#
+	_ZTI19CImImap4Synchronise @ 11 NONAME ; #<TI>#
+	_ZTI20CImap4OffLineControl @ 12 NONAME ; #<TI>#
+	_ZTI24CImImap4SessionDummyRead @ 13 NONAME ; #<TI>#
+	_ZTI7CImapIO @ 14 NONAME ; #<TI>#
+	_ZTI9CImapAtom @ 15 NONAME ; #<TI>#
+	_ZTV11CImap4Utils @ 16 NONAME ; #<VT>#
+	_ZTV14CActiveWrapper @ 17 NONAME ; #<VT>#
+	_ZTV15CImImap4Session @ 18 NONAME ; #<VT>#
+	_ZTV15CImap4ServerMtm @ 19 NONAME ; #<VT>#
+	_ZTV16CImImap4Compound @ 20 NONAME ; #<VT>#
+	_ZTV17CIdleTimeoutTimer @ 21 NONAME ; #<VT>#
+	_ZTV17CImImap4DirStruct @ 22 NONAME ; #<VT>#
+	_ZTV18CImImap4FolderSync @ 23 NONAME ; #<VT>#
+	_ZTV19CImImap4FolderIndex @ 24 NONAME ; #<VT>#
+	_ZTV19CImImap4Synchronise @ 25 NONAME ; #<VT>#
+	_ZTV20CImap4OffLineControl @ 26 NONAME ; #<VT>#
+	_ZTV24CImImap4SessionDummyRead @ 27 NONAME ; #<VT>#
+	_ZTV7CImapIO @ 28 NONAME ; #<VT>#
+	_ZTV9CImapAtom @ 29 NONAME ; #<VT>#
+	_ZTI23CImImap4SessionIdleRead @ 30 NONAME ; #<TI>#
+	_ZTV23CImImap4SessionIdleRead @ 31 NONAME ; #<VT>#
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/group/IMPS.mmp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,43 @@
+// Copyright (c) 2003-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:
+// imps.dll IMAP4 server MTM
+// 
+//
+
+/**
+ @file
+*/
+
+
+TARGET          imps.dll
+TARGETTYPE      dll
+
+CAPABILITY ReadDeviceData WriteDeviceData ProtServ NetworkControl NetworkServices LocalServices ReaduserData WriteUserData
+TARGETPATH      \system\libs
+UID             0x10003C5E 0x10003C4E
+VENDORID 0x70000001
+SOURCEPATH      ..\src
+SOURCE          impsmain.cpp impsmtm.cpp imapsess.cpp fldindex.cpp imapio.cpp fldsync.cpp
+SOURCE          imapsync.cpp imapcomp.cpp imapoffl.cpp impsutil.cpp
+SOURCE			cimapcanceltimer.cpp
+USERINCLUDE     ..\inc ../../clientmtms/inc ../../servermtmutils/inc
+SYSTEMINCLUDE   \epoc32\include
+LIBRARY         euser.lib efsrv.lib msgs.lib imut.lib 
+LIBRARY         imcm.lib bafl.lib charconv.lib
+LIBRARY         esock.lib commdb.lib
+LIBRARY         etext.lib 
+
+
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/group/bld.inf	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,34 @@
+// Copyright (c) 1999-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:
+//
+
+
+PRJ_PLATFORMS
+
+PRJ_EXPORTS
+#ifdef SYMBIAN_OLD_EXPORT_LOCATION
+..\inc\impsmtm.h
+#endif
+#ifdef SYMBIAN_OLD_EXPORT_LOCATION
+..\inc\mimapsessionobserver.h
+#endif
+
+PRJ_MMPFILES
+
+imps.mmp
+
+#include "..\test\group\bld.inf"
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/group/messaging_email_imap.mrp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,29 @@
+#
+# 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: 
+#
+
+component	messaging_email_imap
+
+source	\sf\app\messaging\email\imap4mtmservermtm
+
+binary	\sf\app\messaging\email\imap4mtmservermtm\group	all
+exports	\sf\app\messaging\email\imap4mtmservermtm\group	
+
+notes_source	\component_defs\release.src
+
+
+ipr E 
+ipr T \sf\app\messaging\email\imap4mtmservermtm\test
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/inc/FLDINDEX.H	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,89 @@
+// Copyright (c) 1998-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:
+// IMAP Folder indexing header
+// 
+//
+
+#if !defined(__FLDINDEX_H__)
+#define __FLDINDEX_H__
+
+#if !defined(__E32STD_H__)
+#include <e32std.h>
+#endif
+#if !defined(__E32BASE_H__)
+#include <e32base.h>
+#endif
+
+// We need this for TMsvId
+#include <msvstd.h>
+
+// Actual entries stored in the index
+class CImImap4IndexEntry:public CBase
+/**
+@internalComponent
+@released
+*/
+	{
+public:
+	CImImap4IndexEntry();
+	CImImap4IndexEntry(CImImap4IndexEntry& aFrom);
+
+	CImImap4IndexEntry& operator=(CImImap4IndexEntry& aFrom);
+
+public:
+	TUint32			iUid;
+	TMsvId			iMsvId;
+	};
+
+class CImImap4FolderIndex:public CBase
+/**
+@internalComponent
+@released
+*/
+	{
+public:
+	CImImap4FolderIndex();
+	~CImImap4FolderIndex();
+
+	// Clear index
+	void Reset();
+
+	// Note number of entries
+	void SetSizeL(const TUint aEntries);
+	TInt Size();
+
+	// Access an entry directly
+	CImImap4IndexEntry& operator[] (const TInt aIndex);
+
+	// Sort index by UID
+	void Sort();
+
+	// Expunge a message
+	void Expunge(const TUint aMsgNr);
+
+private:
+	// Set a UID for a message number
+	void SetUid(const TUint aMsgNr, const TUint aMsgUid);
+
+	// Set a TMsvId for a message number
+	void SetMsvId(const TUint aMsgnr, const TMsvId aMsvId);
+
+	// Find a message number
+	TUint FindMsg(const TUint aMsgUid);
+
+private:
+	TInt								iSize;
+	CArrayFix<CImImap4IndexEntry>*		iIndex;
+	};
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/inc/FLDSYNC.H	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,110 @@
+// Copyright (c) 1998-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:
+// CImImap4FolderSync header
+// 
+//
+
+#if !defined(__FLDSYNC_H__)
+#define __FLDSYNC_H__
+
+#include <mentact.h>
+#include <msventry.h>
+
+// Forward declarations
+class CImImap4Session;
+class CImImap4DirStruct;
+class TImap4SyncProgress;
+
+// Maximum depth of folder tree to sync to
+const TInt KFolderDepth=8;
+
+// States
+/**
+@internalComponent
+@released
+*/
+enum TFolderSyncState
+	{
+	ETreeSync=1,
+	};
+
+class CImImap4FolderSync : public CMsgActive
+/**
+@internalComponent
+@released
+*/
+	{
+public:
+	~CImImap4FolderSync();
+	static CImImap4FolderSync* NewLC(CImImap4Session *aSession);
+	static CImImap4FolderSync* NewL(CImImap4Session *aSession);
+	void ConstructL(CImImap4Session *aSession);
+
+	// Mirror folder tree of remote server
+	void SynchroniseTreeL(TRequestStatus& aStatus, const TMsvId aRoot, const TBool aNewFoldersAreInvisible);
+
+	// Set serverentry to use
+	void SetEntry(CMsvServerEntry* aEntry);
+
+	// increment relevant entries in the progress structure
+	void IncProgress(TImap4SyncProgress& aProgress);
+	void ResetStats();
+	
+private:
+	CImImap4FolderSync();
+	void DoRunL();
+	void DoCancel();
+	TBool ProcessDirListL();
+	void BuildLocalL(const TMsvId aFolder, const TBool aDoThisOne);
+	void OrphanedFolderCheckL();
+
+	// Set entry, leave if error (not related to setentry() which sets iEntry)
+	void SetEntryL(const TMsvId aId);
+
+	// Change entry, leave if error
+	void ChangeEntryL(const TMsvEntry& aEntry);
+	
+	// Change entry in bulk mode (i.e. no index file commit), leave if error
+	void ChangeEntryBulkL(const TMsvEntry& aEntry);
+
+	// Get children, leave if error
+	void GetChildrenL(CMsvEntrySelection& aSelection);
+
+private:
+	// IMAP4 session to use
+	CImImap4Session*		iSession;
+
+	// Tree synchronisation state
+	TFolderSyncState		iState;
+	TMsvId					iServiceId;
+	TMsvId					iFolderId;
+	TInt					iFolderLevel;
+	CArrayPtr<CImImap4DirStruct>* iFolderList;
+	CMsvEntrySelection*		iFolderContents;
+	CArrayFix<TMsvId>*		iFolderIds[KFolderDepth];
+	TInt					iFolderPosition[KFolderDepth];
+	CArrayFix<TMsvId>*		iLocalFolders;
+	TBool					iNewFoldersAreInvisible;
+
+	// Access to message database
+	CMsvServerEntry*		iEntry;
+
+	// Current request status
+	TRequestStatus*			iRequestStatus;
+
+	TInt					iOrphanedFolders;
+	TInt					iNewFolders;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/inc/IMAPCOMP.H	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,125 @@
+// Copyright (c) 1998-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:
+// CImImap4Compound header
+// 
+//
+
+#if !defined(__IMAPCOMP_H__)
+#define __IMAPCOMP_H__
+
+#include <mentact.h>
+#include <msventry.h>
+#include <imapset.h>
+
+// Forward declarations
+class CImImap4Session;
+
+class CImImap4Compound : public CMsgActive
+/**
+@internalComponent
+@released
+*/
+	{
+public:
+	~CImImap4Compound();
+	static CImImap4Compound* NewL(CImImap4Session* aSession);
+	void ConstructL(CImImap4Session* aSession);
+	void SetSession(CImImap4Session* aSession);
+	void SetEntry(CMsvServerEntry* aEntry);
+
+	// The compound operations we provide
+	void CopyToLocalL(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination);
+	void MoveToLocalL(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination);
+	void CopyWithinServiceL(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination);
+	void CopyWithinServiceL(TRequestStatus& aStatus, const CMsvEntrySelection& aSourceSel, const TMsvId aDestination);
+	void MoveWithinServiceL(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination);
+	void MoveWithinServiceL(TRequestStatus& aStatus, const CMsvEntrySelection& aSourceSel, const TMsvId aDestination);
+	void CopyFromLocalL(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination);
+	void MoveFromLocalL(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination);
+	void DeleteL(TRequestStatus& aStatus, const TMsvId aSource);
+	void DeleteL(TRequestStatus& aStatus, const CMsvEntrySelection& aSourceSel);
+	void DeleteFolderL(TRequestStatus& aStatus, const TMsvId aSource);
+	void NewOnlySyncL(TRequestStatus& aStatus, const TMsvId aFolder);
+	void FullSyncL(TRequestStatus& aStatus, const TMsvId aFolder);
+	void SelectL(TRequestStatus& aStatus, const TMsvId aFolder);
+	void SynchroniseL(TRequestStatus& aStatus);
+	void CreateL(TRequestStatus& aStatus, const TMsvId aParent, const TDesC& aLeafName, const TBool aFolder);
+	void RenameL(TRequestStatus& aStatus, const TMsvId aTarget, const TDesC& aNewName);
+	void PopulateL(TRequestStatus& aStatus, const TMsvId aSource, TImImap4GetPartialMailInfo aGetPartialMailInfo);
+	void SetMessageCount(const TInt aCount);
+	// Compound operations for when called from the Synchronise task
+	void SyncCopyToLocalL(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination);
+
+	void UpdatePartialMailInfoToDefaults(TMsvId aDestination);
+	// Progress reporting
+	TImap4GenericProgress Progress();
+
+private:
+	CImImap4Compound();
+	void DoRunL();
+	TBool DoRunLoopL();
+	void DoCancel();
+
+	TMsvId FindFolderL(const TMsvId aMessage);
+	void GenericCopyL(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination, TInt* aSequence);
+	void GenericCopyL(TRequestStatus& aStatus, const CMsvEntrySelection& aSourceSel, const TMsvId aDestination, TInt* aSequence);
+	void SetEntryL(const TMsvId aId);
+
+	// Sequences of operations
+	TInt SeqPopulateAttachment[3];
+	TInt SeqCopyToLocal[7];
+	TInt SeqMoveToLocal[8];
+	TInt SeqCopyWithinService[8];
+	TInt SeqMoveWithinService[9];
+	TInt SeqCopyFromLocal[4];
+	TInt SeqMoveFromLocal[8];
+	TInt SeqDelete[6];
+	TInt SeqDeleteFolder[8];
+	TInt SeqNewSync[6];
+	TInt SeqFullSync[6];
+	TInt SeqSelect[3];
+	TInt SeqSynchronise[5];
+	TInt SeqCreate[5];
+	TInt SeqRename[5];
+	TInt SeqSyncCopyToLocal[3];
+
+private:
+	// IMAP4 session to use
+	CImImap4Session*		iSession;
+
+	// Internal state
+	TInt					iStep;
+	TInt*					iSequence;
+	TMsvId					iSource;
+	TInt					iSelectionStillToCopy;
+ 	TInt					iSelectionStillToDelete;
+ 	TInt					iMessageSelection;
+ 	CMsvEntrySelection*		iSourceSel;	
+	TMsvId					iSourceFolder;
+	TMsvId					iDestinationFolder;
+	TFileName				iLeafName;
+	TBool					iFolder;
+	TBool					iIdleBeforeCommand;
+	TBool					iPopulateCommand;
+	TBool 					iIdleBeforeFirstPopulate;
+	TInt 					iMsgCount;
+		
+	// Access to message database
+	CMsvServerEntry*		iEntry;
+
+	// saved partial populate info
+	TImImap4GetPartialMailInfo	iGetPartialMailInfo;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/inc/IMAPIO.H	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,272 @@
+// Copyright (c) 1998-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:
+// CImapIO header
+// 
+//
+
+#if !defined(__IMAPIO_H__)
+#define __IMAPIO_H__
+
+#include <e32base.h>
+#include <e32cons.h>
+#include <mentact.h>
+#include <imsk.h>
+#include <iapprefs.h>
+
+// Receive buffer size (max to read in one go). Should really be MTU related,
+// as that's what we'll get in a chunk.
+const TInt KReceiveBuffer=2048;
+
+// Transmit buffer to keep data static when sending
+const TInt KTransmitBuffer=1024;
+
+// What we return with if we find an EOL and have been asked to do a partial
+// read
+const TInt KErrFoundEOL=1;
+
+// States of async machine
+/**
+@internalComponent
+@released
+*/
+enum TIOState
+	{
+	EIOStateDisconnected,
+	EIOStateConnectQueued,
+	EIOStateConnected,
+	EIOStateReadQueued,
+	EIOStateWriteQueued,
+	EIOStateDummyQueued
+	};
+
+// States of reply parser
+/**
+@internalComponent
+@released
+*/
+enum TIOParserState
+	{
+	EIOStateAtomWait,
+	EIOStateInAtom,
+	EIOStateWaitLF,
+	EIOStateLiteralLength,
+	EIOStateLiteralSkip,
+	EIOStateLiteralFetch
+	};
+
+class CImapAtom : public CBase
+/**
+@internalComponent
+@released
+*/
+	{
+public:
+	CImapAtom();
+	~CImapAtom();
+
+	void		Set(const TDesC8& aAtom);
+	void		AddChild(CImapAtom *aNewChild);
+	void		AddNext(CImapAtom *aNewNext);
+
+	// Get child/next pointers
+	CImapAtom*	Child();
+	CImapAtom*	Next();
+
+	// As above, but with leave if null
+	CImapAtom*	ToChildL();
+	CImapAtom*	ToNextL();
+
+	TPtrC8		Atom();
+	TBool		Compare(const TDesC8& aValue);
+	TBool       CompareTail(const TDesC8& aValue);
+	TInt		Value(TUint& aValue);
+	TInt		Value(TInt& aValue);
+	TInt		Value(TInt32& aValue);
+	void		FixupL(const HBufC8 *aNewBuffer, const TText8 *aOldBuffer);
+	TPtrC8		AtomNoAngleBrackets();
+
+private:
+	TPtrC8		iAtom;
+	CImapAtom*	iChild;
+	CImapAtom*	iNext;
+	};
+
+
+class CImapIO : public CMsgActive
+/**
+@internalComponent
+@released
+*/
+	{
+public:
+	~CImapIO();
+
+	static CImapIO*	NewLC(TInt aId);
+	static CImapIO*	NewL(TInt aId);
+
+	// Queue a connect
+	void ConnectL(TRequestStatus& aStatus, const TDesC& aHost, const TUint aPort, const CImIAPPreferences& aPrefs, TBool aSSLWrappedSocket);
+
+	// Queue a line read
+	TInt GetReply(TRequestStatus& aStatus);
+	TInt GetReply(TRequestStatus& aStatus, const TInt aFetchSize, const TBool aPartialReturn);
+
+	// Queue a line write
+	TInt Send(TRequestStatus& aStatus, TRefByValue<const TDesC8> aFmt,...);
+	void SendL(TRequestStatus& aStatus, TRefByValue<const TDesC8> aFmt,...);
+	void SendWithTimeoutL(TRequestStatus& aStatus, TInt aTimeout, TRefByValue<const TDesC8> aFmt,...);
+
+	// Logging
+	void PerformLogging(TBool aLogging);
+
+	// Queue a dummy read for connection status notification
+	void QueueDummy(TRequestStatus& aStatus);
+
+	// Get the root atom of the parse tree
+	CImapAtom*	RootAtom();
+
+	// Get bytes in/out totals
+	TInt RXbytes(const TBool aReset);
+	TInt TXbytes(const TBool aReset);
+
+	// Disconnect
+	void Disconnect();
+
+	// Security
+	void SetTLSResponseL();
+	
+	// From IMSK
+	void LogText(const TDesC8& aString);	
+	void LogText(TRefByValue<const TDesC8> aFmt,...);
+	
+/**
+	@fn				TInt GetIAPValue(TUint32& aIap)
+	Intended Usage	:	Gets the value of the currently connecting/connected IAP
+	@param			aIap will be value of the currently connecting/connected IAP or KErrNotFound if an error occurs 
+	@return			KErrNone if succesful, KErrNotFound is the session does not exist or a system-wide error code.
+
+	*/
+	TInt GetIAPValue(TUint32& aIap);
+
+/**
+	@fn				GetRConnectionName()
+	Intended Usage	:	On return, the unique name of the RConnection.
+	@since			9.1
+	@return			KErrNone if succesful, or another of the system-wide error codes. 
+	*/	
+	TInt GetRConnectionName(TName &aName);
+	
+/**
+	@fn				GetLastSocketActivityTimeout(TUint32& aTimeout)
+	Intended Usage	:	Returns the last socket activity timeout value
+	@since			9.1
+	@param			aTimeout is a return argument containing the timeout if it was found
+	@post				aTimeout will be filled with the timeout value
+	@return			Returns KErrNone, KErrNotFound or KErrBadHandle
+	*/
+	TInt GetLastSocketActivityTimeout(TUint32& aTimeout);
+
+/**
+	@fn				TInt GetConnectionStage()
+	Intended Usage	:	Gets the stage of the connection process as defined in nifvar.h and csdprog.h
+	@since			7.0s
+	@return         The current connection stage, KErrNotFound is the session does not exist or a system-wide error code.
+
+	*/
+	TInt GetConnectionStage();
+	
+/**
+	@fn				SetPrimaryTextServerSession(CImTextServerSession* aPrimaryTextServerSession)
+	Intended Usage	:	Sets the local primaryTextSeverSession from PrimarySession's TextServerSession.
+						Going to be use on the secondary session
+	@since			9.2
+	@param			aPrimaryTextServerSession is to store the primary session's TextServerSession
+	*/	
+	void SetPrimaryTextServerSession(CImTextServerSession* aPrimaryTextServerSession);
+
+/**
+	@fn				GetTextServerSession()
+	Intended Usage	:	Returns CImTextServerSession
+	@since			9.2
+	@return			CImTextServerSession 
+	*/	
+	CImTextServerSession* GetTextServerSession();
+
+private:
+	CImapIO(TInt aId);
+	void ConstructL();
+	void DoComplete(TInt& /*aStatus*/);
+	void DoRunL();
+	void DoCancel();
+	void ProcessBufferL();
+	void QueueRead();
+	void BufferAppendL(const TChar aChar);
+
+	void PushL(CImapAtom *aItem);
+	CImapAtom* PopL();
+
+	void AddAtomL();
+	void AddAtomL(const TInt);
+	TInt Send(TRequestStatus& aStatus, const TDesC8& aCommand);
+	TInt SendWithTimeout(TRequestStatus& aStatus, TInt aTimeout, const TDesC8& aCommand);
+
+private:
+	TIOState				iState;
+	TIOParserState			iParserState;
+	TBool					iParserQuoted;
+	TBool					iGotEscape;
+	TInt					iLineStatus;
+	TInt					iLiteralSkip;
+	TInt					iLiteralLength;
+	TInt					iBytesRead;
+	TInt					iBytesToRead;
+	TBool					iReturnPartialLine;
+
+	HBufC8*					iBuffer;
+	TInt					iBufferSize;
+	TBuf8<KReceiveBuffer>	iReceive;
+	TBuf8<KTransmitBuffer>	iTransmit;
+	TInt					iLen;
+	TBuf8<1>				iDummyBuffer;
+
+	CImapAtom*				iRootAtom;
+	CImapAtom*				iAtom;
+	TPtrC8					iCurrentAtom;
+	TInt					iAtomStart;
+
+	CArrayPtrFlat<CImapAtom>	iAtomStack;
+	TBool					iNextIsChild;
+
+	// Byte I/O totals
+	TInt					iTXbytes;
+	TInt					iRXbytes;
+
+	// Actual connection
+	CImTextServerSession*	iSession;
+
+	// Extra logging
+	CImLog*					iImapLog;
+
+	// Atom array
+	RPointerArray<CImapAtom> iAtomArray;
+
+	TInt					iID;
+	
+	// Take ownership of primary session's Textserversession object
+	// Only going to be set on the secondary session 
+	CImTextServerSession* 	iPrimaryTextServerSession;
+	
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/inc/IMAPOFFL.H	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,138 @@
+// Copyright (c) 1998-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:
+// IMAP4 Offline Operations.
+// 
+//
+
+#if !defined(__IMAPOFFL_H__)
+#define __IMAPOFFL_H__
+
+
+class CImImap4Session;
+class CMsvServerEntry;
+class CMsvEntrySelection;
+
+// enums for use with MtmFunctionId
+enum
+	{
+	EFnOffLineOpMoveDelete,
+	EFnOffLineOpPopulate
+	};
+
+class CImap4OffLineControl : public CMsgActive
+/**
+@internalComponent
+@released
+*/
+	{
+public:
+	enum TImap4OpType
+		{
+		EImap4OpCopyToLocal,
+		EImap4OpMoveToLocal,
+		EImap4OpCopyFromLocal,
+		EImap4OpMoveFromLocal,
+		EImap4OpCopyWithinService,
+		EImap4OpMoveWithinService,
+		EImap4OpPopulate,
+		EImap4OpDelete,
+		EImap4OpUndelete,
+		EImap4OpMoveTypeDelete
+		};
+
+public:
+	static CImap4OffLineControl* NewL(CMsvServerEntry* aEntry, CImImap4Session *aSession);
+	static CImap4OffLineControl* NewLC(CMsvServerEntry* aEntry, CImImap4Session *aSession);
+	~CImap4OffLineControl();
+	void ConstructL();
+
+	// add the given offline operation to the appropriate place
+	void StoreOfflineCommandL(TImap4OpType aOperation,
+							  const CMsvEntrySelection& aSelection,
+							  TMsvId aDestination,
+							  TRequestStatus& aStatus);
+
+	void StoreOfflineCommandL(TImap4OpType aOperation,
+							  const CMsvEntrySelection& aSelection,
+							  TMsvId aDestination,
+							  const TDesC8& aParams,
+							  TRequestStatus& aStatus);
+	
+		// aSelection contains a list of folders and services. Remove any
+	// offline operations contained within them
+	void CancelOffLineOperationsL(const CMsvEntrySelection& aSelection);
+
+	TMsvId IdIsLocalL(TMsvId aId);
+	
+	CImOffLineOperationArray* OffLineOpArrayL(TMsvId aId);
+	void SetOffLineOpArrayL(TMsvId aId, CImOffLineOperationArray& aArray);
+	
+	TBool FindShadowIdsL(const CImOffLineOperation& aOp, CMsvEntrySelection& aSelection);
+	TMsvId FindShadowIdL(const CImOffLineOperation& aOp);
+
+private:
+	CImap4OffLineControl(CMsvServerEntry* aEntry, CImImap4Session *aSession);
+
+	TBool OffLineOpIsCopy(const CImOffLineOperation& aOp);
+
+	TImDisconnectedOperationType OffLineOpToDisconnectedOp(const CImOffLineOperation& aOp);
+
+	TInt PosVal(const CImOffLineOperation& aOp);
+
+	void SaveOperationL(const CImOffLineOperation& aOperation);
+
+	TBool FindOffLineOpByIdL(TMsvId aId, TMsvId aDestFolder,
+							CImOffLineOperation& aOp, TBool aDelete);
+
+	void UndeleteOperationL(TMsvId aId, TMsvId aDestId, TBool aConvertMoveToCopy,
+							TImDisconnectedOperationType aDisconnected =ENoDisconnectedOperations);
+
+	void MakeCopyMoveShadowL(const CImOffLineOperation& aOp);
+	void MakeShadowL(const CImOffLineOperation& aOp);
+
+	void UndoOfflineOpL(const CImOffLineOperation& aOp, TBool aClearMultiples);
+
+	void SetEntryL(TMsvId aId);
+	void ChangeEntryL(TMsvEntry& aEntry);
+	void DeleteEntryL(TMsvId aId);
+
+	TMsvId FolderOfL(TMsvId aId);
+	TMsvId FindOffLineSaveFolderL(TMsvId aId, TMsvId aDestId);
+	TMsvId MessageOfL(TMsvId aId);
+	TMsvId ServiceOfL(TMsvId aId);
+
+	void PrepareLocalOpL(TMsvId aId);
+	TBool DoLocalOpL();
+
+protected:
+	void DoCancel();
+	void DoRunL();
+	void DoComplete(TInt& aError);
+
+private:
+	CMsvServerEntry* iEntry;			// passed into constructor
+	CImImap4Session* iSession;			// passed into constructor
+	
+	CMsvEntrySelection* iCopyDirect;		// created in constructor and reused as necessary
+	CMsvEntrySelection* iMoveDirect;		// created in constructor and reused as necessary
+	CMsvEntrySelection* iMoveToLocalDirect;	// created in constructor and reused as necessary
+	
+	TMsvId iDestination;		// store for copy/move destination
+	TMsvId iServiceId;
+
+	//TMsvId iArrayFolder;
+	//CImOffLineOperationArray* iArray;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/inc/IMAPSESS.H	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,784 @@
+// Copyright (c) 1998-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:
+// CImImap4Session header
+// 
+//
+
+#if !defined(__IMAPSESS_H__)
+#define __IMAPSESS_H__
+
+#include <e32base.h>
+#include <e32cons.h>
+#include <mentact.h>
+#include <msvstd.h>
+#include <miuthdr.h>
+#include <imcvcodc.h>
+#include <imcvsend.h>
+#include "impsmtm.h"
+#include <miutatch.h>
+#include <cimcaf.h>
+
+#include "imapio.h"
+#include "fldindex.h"
+
+// Forward declarations
+class CMsvBodyText;
+class CRichText;
+class CParaFormatLayer;
+class CCharFormatLayer;
+class CImQPDecode;
+class CImImap4Settings;
+class CImImap4Synchronise;
+class CImImap4FolderSync;
+class CImCalculateMsgSize;
+class CImSendConvert;
+class CImConvertCharconv;
+class CCnvCharacterSetConverter;
+class CImConvertHeader;
+class CImapCancelTimer;
+class MImapSessionObserver;
+
+// States of ImapSession
+/**
+@internalComponent
+@released
+*/
+enum TImapState
+	{
+	EImapStateDisconnected=0,
+
+	EImapStateConnectWait,
+	EImapStateGreetingWait,
+	EImapStateCapabilityWait,
+	EImapStateLoginSendUser,
+	EImapStateLoginSendPassword, // 5
+	EImapStateLoginWait,
+	EImapStateNoSelect,
+	EImapStateSelectWait,
+	EImapStateSelected,
+	EImapStateCreateWait,		// 10
+	EImapStateDeleteWait,
+	EImapStateDeleteAllWait,
+	EImapStateDeleteFolderWait,
+	EImapStateRenameWait,
+	EImapStateSynchroniseWait,	// 15
+	EImapStateFetchWait,
+	EImapStateListWait,
+	EImapStateLsubWait,
+	EImapStateSubscribeWait,
+	EImapStateUnsubscribeWait,	// 20
+	EImapStateSeparatorWait,
+	EImapStateCommandWait,
+	EImapStateAppendSizeWait,
+	EImapStateAppendPromptWait,
+	EImapStateAppendWait,		// 25
+	EImapStateAppendResultWait,
+	EImapStateDeleteMarkWait,
+	EImapStateExpungeWait,
+	EImapStateExpungeAllWait,
+	EImapStateCloseWait,		// 30
+	EImapStateLogoutWait,
+	EImapStateMoveEntryWait,
+	EImapStateStartTLSWait,
+	EImapStateSetSeenWait,
+	EImapStateClearSeenWait,	// 35
+	EImapStateSendLiteral,
+	EImapStateIdleWait,
+	EImapStateIdling,
+	EImapStateStopIdleWait,
+	EImapStateFetchCancelWait	// 40
+	};
+
+// States of a synchronise
+/**
+@internalComponent
+@released
+*/
+enum TImapSyncState
+	{
+	ENotSyncing=0,
+
+	ESyncOld,
+	ESyncNew,
+	EFetching,
+	ESyncSearch,	
+	ESyncListOld,	
+	ESyncListNew,
+	EGettingStructure
+	};
+
+// Modes updating Seen flag
+enum TSeenFlagUpdateMode
+	{
+	EClearSeenFlag=0,
+	ESetSeenFlag
+	};
+
+
+// Positive completion errors
+const TInt KErrIMAPNO				=1;
+const TInt KErrRFC2231Encoded		=2;
+
+// IMAP text
+_LIT(KIMAP_INBOX, "INBOX");
+_LIT8(KIMAP_OK, "OK");
+
+//TDes8 over flow handler
+class TDes8OverflowHandler : public TDes8Overflow
+/**
+@internalComponent
+@released
+*/
+	{
+	public:
+		void Overflow(TDes8&){return;} //nullifies USER:23 panic
+	};
+
+//cached TMsvEntry data
+class TMsvCacheData
+/**
+@internalComponent
+@released
+*/
+	{
+public:
+	TBool iOrphan;
+	TUint32 iUid;
+	};
+
+// Remote directory structure
+class CImImap4DirStruct : public CBase
+/**
+@internalComponent
+@released
+*/
+	{
+public:
+	CImImap4DirStruct();
+	~CImImap4DirStruct();
+
+	void SetLeafnameL(const TDesC& aName);
+	TPtrC Leafname();
+	
+private:
+	HBufC*			iLeafname;
+
+public:	
+	TBool			iIsMailbox;
+	TBool			iIsFolder;
+	};
+
+// Class which will defeat the timeout
+class CIdleTimeoutTimer : public CTimer
+/**
+@internalComponent
+@released
+*/
+	{
+public:
+	static CIdleTimeoutTimer* NewL(CImImap4Session& aOperation);
+private:
+	CIdleTimeoutTimer(CImImap4Session& aOperation);
+	void RunL();
+private:
+	CImImap4Session& iOperation;
+	};
+
+class CImImap4SessionDummyRead : public CActive
+/**
+@internalComponent
+@released
+*/
+	{
+public:
+	static CImImap4SessionDummyRead* NewL(CImImap4Session& aOperation, CImapIO& aImapIO, TInt aPriority);
+	~CImImap4SessionDummyRead();
+	void Start();
+
+private:
+	CImImap4SessionDummyRead(CImImap4Session& aOperation, CImapIO& aImapIO, TInt aPriority);
+	void DoCancel();
+	void RunL();
+
+	CImImap4Session& iSession;
+	CImapIO& iImapIO;
+	};
+
+
+class CImImap4SessionIdleRead : public CActive
+/**
+@internalComponent
+@released
+*/
+	{
+public:
+	static CImImap4SessionIdleRead* NewL(CImImap4Session& aOperation, TInt aPriority);
+	~CImImap4SessionIdleRead();
+	void Start(TRequestStatus& aStatus);
+
+private:
+	CImImap4SessionIdleRead(CImImap4Session& aOperation, TInt aPriority);
+	void DoCancel();
+	void RunL();
+
+	CImImap4Session& iOperation;
+	TRequestStatus* iOperationStatus;
+	};
+
+
+// The session class
+class CImImap4Session : public CMsgActive
+/**
+@internalComponent
+@released
+*/
+	{
+public: // functions
+	// construct/destruct
+	~CImImap4Session();
+	static CImImap4Session *NewL(TInt aId, MImapSessionObserver& aObserver);
+	static CImImap4Session *NewLC(TInt aId, MImapSessionObserver& aObserver);
+
+	// Return the service settings of the current service
+	CImImap4Settings* ServiceSettings();
+
+	// Connect & disconnect to/from a server, and 'are we connected' status
+	void ConnectL(TRequestStatus& aStatus, const TMsvId aService);
+	void DisconnectL(TRequestStatus& aStatus);
+	TBool Connected();
+	TBool Busy();
+	TBool IsCancelling() const;
+	void CancelAndIdleL(TBool aReissueIdle);
+
+	// Folder information/manipulation
+	void ListL(TRequestStatus& aStatus, const TMsvId aFolder, CArrayPtr<CImImap4DirStruct>* aList);
+	void LsubL(TRequestStatus& aStatus);
+	void LocalSubscribeL(const TMsvId aTarget, const TBool aSubscribe);
+	void RemoteSubscribeL(TRequestStatus& aStatus, const TMsvId aTarget, const TBool aSubscribe);
+	void Create(TRequestStatus& aStatus, const TMsvId aParent, const TDesC& aLeafName, const TBool aFolder);	
+	void CreateL(TRequestStatus& aStatus, const TMsvId aParent, const TDesC& aLeafName, const TBool aFolder);
+	void Rename(TRequestStatus& aStatus, const TMsvId aTarget, const TDesC& aNewName);
+	void RenameL(TRequestStatus& aStatus, const TMsvId aTarget, const TDesC& aNewName);
+	
+	void Delete(TRequestStatus& aStatus, const TMsvId aTarget);
+	void Delete(TRequestStatus& aRequestStatus, const CMsvEntrySelection& aTargetSel);
+	void DeleteL(TRequestStatus& aRequestStatus, const CMsvEntrySelection& aTargetSel);
+	void DeleteAllMessagesL(TRequestStatus& aStatus);
+
+	// Append to a folder
+	void Append(TRequestStatus& aStatus, const TMsvId aEntry, const TMsvId aDestination);
+	void AppendL(TRequestStatus& aStatus, const TMsvId aEntry, const TMsvId aDestination);
+
+	// Folder selection
+	void Select(TRequestStatus& aStatus, const TMsvId aFolder, const TBool aReadWrite);
+	void SelectL(TRequestStatus& aStatus, const TMsvId aFolder, const TBool aReadWrite);
+
+	// Post-folder selection commands
+	void Synchronise(TRequestStatus& aStatus, const TBool aNewOnly);
+	void SynchroniseL(TRequestStatus& aStatus, const TBool aNewOnly);
+	void Copy(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination, TBool aUnSelectIfSameFolder);
+	void CopyL(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination, TBool aUnSelectIfSameFolder);
+	void Close(TRequestStatus& aStatus, const TBool aExpunge);
+	void CloseL(TRequestStatus& aStatus, const TBool aExpunge);
+	void FetchBody(TRequestStatus& aRequestStatus, const TMsvId aPart,TImImap4GetPartialMailInfo aGetPartialMailInfo);
+
+	void StartIdle(TRequestStatus& aRequestStatus);
+	void StartIdleL(TRequestStatus& aRequestStatus);
+	void StopIdle(TRequestStatus& aRequestStatus);
+	void SyncStopIdleL(TRequestStatus& aRequestStatus);
+	void StopIdleL(TRequestStatus& aRequestStatus);
+
+	void DoIdleRead(TRequestStatus& aIdleReadStatus);
+	void CancelIdleRead();
+	void IdleReadError(TInt aError);
+	void IdleTimerExpiredL();
+	void CancelTimerExpired();
+
+	// Progress
+	void IncSyncStats(TImap4SyncProgress& aSync);
+	TImap4GenericProgress Progress();
+	void ResetStats();
+
+	TBool FolderChanged() const;
+	TBool ImapIdleSupported() const;
+	TBool IsIdling() const;
+	
+	// Save msvserverentry that Mtm hands us
+	void SetEntry(CMsvServerEntry *aEntry);
+
+	// Log stuff
+	void LogText(const TDesC8& aString);
+	void LogText(TRefByValue<const TDesC8> aFmt,...);
+
+	// Orphan a local message
+	void OrphanMessageL(const TMsvId aMessage);
+
+	// Delete a local message
+	void DeleteMessageL(const TMsvId aMessage);
+
+	// Copy a message, leaving the structure behind (with a new TMsvId)
+	void CopyMessage(TRequestStatus& aStatus, const TMsvId iSourceFolder, const TMsvId iSource, const TMsvId iDestinationFolder, TMsvId* iNewSource, const TBool aRemoveOriginal);
+
+	// Park entries
+	void Park();
+
+	void ReissueIdleL();
+	void ReissueDummy();
+
+	void DummyComplete(TInt aError);
+	TInt CommandFailure() const;
+
+	// Calculate the total size of the messages to be downloaderd in this selection.
+	TInt CalculateDownloadSizeL(const CMsvEntrySelection& aSelection);
+
+	// This selection should not be deleted during a synchronisation
+	void SetSynchronisationSelectionL(CMsvEntrySelection& aSelection);
+
+	void SetInbox(TMsvId aInbox);
+	TMsvId GetInbox();
+	
+	// Only going to be set on the secondary session
+	void SetPrimarySession(CActiveWrapper* aPrimarySession);
+	
+	// Returns Current TextServerSession 
+	CImTextServerSession* GetTextServerSession();
+		
+private:	
+	CImImap4Session(MImapSessionObserver& aObserver);
+	void ConstructL(TInt aId);
+
+	void RunL();
+	void DoRunL();
+	void DoComplete(TInt& aStatus);
+
+	// The get more/send some calls
+	void GetReply(const TBool aPartial);
+	void SendMessageL(const TDesC8 &theMessage);
+	void SendUntaggedMessageL(const TDesC8 &theMessage);
+	void SendUntaggedMessageWithTimeoutL(const TDesC8 &theMessage, TInt aTimeout);
+	void NewTag();
+	void NewTagSent();
+	
+	void LostConnection(TInt aError);
+	void IssueIdleRead();	
+
+	void Fail(const TInt aError);
+	void DoDisconnect();
+
+	// Construct full mailbox/folder path from a TMsvId
+	HBufC8* MakePathL(const TMsvId aTarget, const TBool aIncludeLeaf);
+
+	// Cancel current operation
+	void DoCancel();
+
+	// convert to and from Modified UTF-7 if needed
+	HBufC* DoUnModUTF7LC(TDesC8& aBuffer);
+
+	// Enquote string if needed
+	void DoQuoteL(HBufC8*& aBuffer);
+
+	// Update last sync date on folder
+	void SyncCompleteL();
+
+	// Get children of a folder: ONLY the message ones, though
+	void GetMessageChildrenL(const TMsvId aFolder, CMsvEntrySelection* aChildren);
+
+	// Make sorted folder index
+	void MakeSortedFolderIndexL(TBool aUseCachedEntryData=EFalse);
+
+	// Show atom tree (debug only)
+	void showtree(CImapAtom* aAtom,TInt aIndent);
+
+	// Reset subscription flags (recursive)
+	void ResetSubscriptionFlagsL(const TMsvId aFolder);
+
+	// Start new synchronise phase
+	void SynchroniseNewL();
+	void SynchroniseNewL(const TUint32 aLowUid,const TUint32 aHighUid);
+
+	// Process replies
+	TInt ProcessGreetingL();
+	TInt ProcessCommandReplyL();
+	TInt ProcessContinuationResponse(CImapAtom *aAtom);
+	TInt ProcessUntaggedL(CImapAtom* aAtom, const TBool aCancelled);
+	TInt ProcessFetchL(const TUint aMsgnr, CImapAtom* aAtom);
+	void ProcessListL(CImapAtom* aAtom);
+	void ProcessLsubL(CImapAtom* aAtom);
+	TBool ProcessFlagsL(CImapAtom* aAtom, TMsvEmailEntry& aMessage);
+	void AppendExtendL(HBufC8** aBufferPtr, const TDesC8& aText, TBool aOnStack=ETrue);
+	void ProcessAddressL(HBufC8** aBuffer, CImapAtom* aAtom);
+	
+	// processing address list using envelope
+	void ProcessAddressListL(HBufC8** aBuffer, CDesCArray& aWhere, CImapAtom* aAtom);
+	// proccessing address list without using envelope
+	void ProcessAddressListL(CDesCArray& aWhere, HBufC8** aAddresses);
+
+	void ProcessEnvelopeL(CImHeader* aHeader, TMsvEntry& aEntry, CImapAtom *aAtom);
+	void ProcessHeaderExtraL(CImHeader* aHeader, CImMimeHeader* aMimeHeader, TMsvEmailEntry* aEntry, TPtrC8 aText);
+	void ProcessSearchL(CImapAtom *aAtom);
+
+	// generate a file name for an attachment based on its type
+	void GetDefaultFilename(TDes& aName, const TMsvEmailEntry& aMessage, const CImMimeHeader* mime);
+
+	void BuildTreeL(TMsvId aParent, CImapAtom *aAtom, const TDesC8& aPath,
+		            const TMsvId aThisMessage, TInt& aAttachments, TBool& aIsMHTML, TInt& aRelatedAttachments);
+	void BuildTreeOneL(const TMsvId aParent, CImapAtom *aAtom, const TDesC8& aPath,
+			           const TMsvId aThisMessage, TInt& aAttachments, TBool& aIsMHTML, TInt& aRelatedAttachments);
+
+	// Fetch helpers
+	// AddFetchItem adds item and appropriate fetchable children to
+	// the current fetch list
+	void AddFetchItemL(TMsvId aPart, TImap4GetMailOptions aPartTypes, TBool& aHasTextParts);
+	void AddFetchItemL(TMsvId aPart, TImImap4GetPartialMailInfo aGetPartialMailInfo, TBool& aHasTextParts);
+
+	// FetchAnItem issues command to fetch a fetchable part
+	void FetchAnItemL(const TMsvId aItem);
+
+	// Decode received data
+	void DecodeAndStoreL(const TPtrC8& aData, const TBool aEndOfStream);
+	TInt WriteToAttachmentL(const TDesC8& aText);
+	void WriteToBodyL(const TDesC8& aText);
+
+	// Helper function to decode UUEncoded attachment in MIME emails
+	TBool CheckUUEStartL(const TDesC8& aSourceLine);
+
+	// Called when we get a tagged completion code
+	void CommandCompleteL(TInt aResult);
+
+	// Dummy read operation queueing
+	void IssueDummy();
+	void CancelDummy();
+
+	// Set entry, leave if error (not related to setentry() which sets iEntry)
+	void SetEntryL(const TMsvId aId);
+
+	// Change entry, leave if error
+	void ChangeEntryL(const TMsvEntry& aEntry);
+
+	// Change entry, leave if error
+	void ChangeEntryBulkL(const TMsvEntry& aEntry);
+	// Get children, leave if error
+	void GetChildrenL(CMsvEntrySelection& aSelection);
+
+	// Scan content-type list for filename information, copy if necessary
+	TInt FindFilename(const CImMimeHeader& aMimeInfo, TPtrC8& aFilename);
+
+	// call FindFilename, default if necessary and QP decode it
+	void FindFilenameDecodeL(const CImMimeHeader& aMimeInfo, TFileName& aFilename);
+
+	// Copy a message, leaving the structure behind (with a new TMsvId) - use CopyMessage() instead
+	void CopyMessageL(TRequestStatus& aStatus, const TMsvId iSourceFolder, const TMsvId iSource, const TMsvId iDestinationFolder, TMsvId* iNewSource, const TBool aRemoveOriginal);
+
+	// private leaving versions of public non-leaving versions
+	void FetchBodyL(TRequestStatus& aStatus, const TMsvId aPart);
+	void DeleteL(TRequestStatus& aStatus, const TMsvId aTarget);
+
+	void DeleteEntryL( const TMsvId aTarget);
+
+	// convenience function to fix up the colon-separated header list
+	// into a space separated list
+	void ColonSeparatorToSpace(TDes8& buf);
+	void StripSpace(HBufC8* aBuf);
+
+	void PropagateCompleteFlagL(TMsvId aId, TBool aDoBodyText, TBool aPartialFetched);
+	void SendLoginL();
+	void SendCapabilityL();
+	TPtrC FileNameFromRFC2231(const TDesC8& aEncodedFileName);
+	static void SetMessageFlagsL(TMsvEmailEntry& aMessageEntry, CImapAtom* aRootAtom);
+
+	void FetchLargeHeaderL(TUint aUid, TBool aRange);  
+	void FetchHeaderL(TUint aUid);
+   
+  	void DoFetchL();
+
+	// Set or clear a set of message \Seen flags
+	TBool ProcessSeenFlagsL(TSeenFlagUpdateMode aUpdateMode);
+
+	// Search through all Sibling Atoms for an Attachment
+	TBool DoesAtomContainAttachment(CImapAtom *aAtom);
+	TInt32 Minimum(TInt32 aThisPartTypeSizeLimit,TInt32 aTotalMailSizeLimit);
+	TInt32 GetFetchSizeL(TInt32 aSizeLeft, TInt32 aSizeDownLoaded);
+	void AttachFooterInfoL();
+	void CheckForDiskSpaceL(TInt aSizeToBeDownloaded);
+	TInt32 FetchSize(TInt32 aMinimumLimit,TInt32 aSizeDownLoaded, TInt32 aSizeLeft);
+	void CheckForPartialPopulate(TImImap4GetPartialMailInfo aGetPartialMailInfo);
+	void RemoveHtmlPart(TMsvId aPart);
+	void ProcessFooterMessageL(TInt aSizeLeft);
+	
+	void DoSynchroniseL(TBool aNewOnly);
+	void DoStartIdleL();
+	void DoStopIdleL();
+	void DoDisconnectL();
+	void CreateAttachmentInfoL(TMsvEmailEntry& aMsvEmailEntry);
+	void CreateUidStringL();
+	void DoSelectL(const TMsvId aFolder, const TBool aReadWrite);	
+private:
+	enum TImap4SecurityState
+		{
+		EUnknown,
+		ENegotiating,
+		ESecure,
+		EUnsecure
+		};
+	
+private:
+	// Copy of the service's settings
+	CImImap4Settings*		iServiceSettings;
+	// Copy of the service's iap settings
+	CImIAPPreferences*		iPrefs;
+
+	// Our connection
+	CImapIO*				iImapIO;
+
+	// FS handle
+	RFs						iFs;
+
+	// Current state and line being processed
+	TImapState				iState;
+	TImapState				iSavedState;
+	TBool					iSendQueued;
+	TBool					iReceiveQueued;
+	TBool					iGotWholeLine;
+	TInt					iCommandsOutstanding;
+	TBool					iSizeWait;
+
+	// Generic space to store completion information about commands in progress
+	TBool					iCommandFlags[4];
+	TMsvId					iCommandIds[4];
+	TBuf<256>				iCommandBuf;
+	TInt					iCommandSize;
+
+	// Synchronisation state
+	TImapSyncState			iSyncState;
+	TInt					iFolderPosition;
+	TUint					iHighestUid;
+	TInt32					iSyncLimit;
+
+	// Current tag
+	TInt					iTag;
+	TInt					iCancelledTag;
+
+	// Mailbox hierarchy
+	TBuf8<1>				iHierarchySeparator;
+	TBuf8<64>				iFolderPath;
+
+	// List bits
+	CArrayPtr<CImImap4DirStruct>* iList;
+
+	// Seen IMAP4rev1 capability?
+	// IMAP capabilities
+	TBool					iSeenVersion;
+	TBool					iCapabilityStartTLS;
+	TBool					iCapabilityLoginDisabled;
+	TBool					iCapabilityIdleSupport;
+
+	TImap4SecurityState		iSecurityState;
+
+	// Host/username/password
+	TBuf<64>				iHost;
+	TInt					iPort;
+	HBufC8* 				iUsername;
+	HBufC8* 				iPassword;
+	TBool					iLiteralUsername;
+	TBool					iLiteralPassword;
+
+	// Mailbox state information from remote host
+	TMsvId					iMailboxId;
+	//TBool					iMailboxIsInbox;
+	CImImap4FolderIndex		iFolderIndex;
+	TBool					iMailboxReceivedExpunge;
+	TBool					iMailboxReceivedExists;
+	TBool					iMailboxReceivedFlags;
+	TBufC8<128>				iMailboxName;
+	TInt					iMailboxSize;
+	TInt					iMailboxRecent;
+	TBool					iMailboxWritable;
+	TUint					iUidValidity;
+	TUint					iUidNext;
+	CArrayFix<TMsvId>*		iDeletedUids;
+	TBool					iSomeUnread;
+
+	CArrayFix<TUint32>*		iSearchList;
+	TUint32					iMissingUidLow;
+	TUint32					iMissingUidHigh;
+
+	// Fetch in progress
+	TMsvId					iMessageId;
+	//TMsvId				iMessageDestination;
+	TUint					iMessageUid;
+	TUint					iMessageFetching;
+	
+	CBufBase*				iBodyBuf;
+	CMsvBodyText*			iBodyText;
+	CRichText*				iMessageBody;
+	CParaFormatLayer*		iParaLayer;
+	CCharFormatLayer*		iCharLayer;
+	
+	CArrayFix<TMsvId>*		iFetchList;
+	TBool					iFetchIsText;
+	TFileName				iAttachmentName;
+	CImMimeHeader*			iAttachmentMimeInfo;
+
+	TImAttachmentFile*		iAttachmentFile;
+	TImAttachmentFileState	iAttachmentFileState;
+	HBufC*					iAttachmentFullPath;
+	TInt					iSizeOfThisPart;
+	TInt					iDecodedSizeOfAllParts;
+	TInt 					iSizeLeftToFetch;
+	
+	// Bool to indicate that we are in between of a UUEncoded start and end tag.
+	TBool					iUUDecoding;
+	
+	// Decoder used for fetch in progres
+	TImCodecB64				iB64Decoder;
+	TImCodecUU				iUUDecoder;
+	TImCodecQP				iQPDecoder;
+	TImEncodingType			iEncodingType;
+	HBufC8*					iPartialLine;
+	HBufC*					iDefaultAttachmentName;
+
+	// Characterset conversion
+	CImConvertCharconv*		iCharConv;
+	CCnvCharacterSetConverter* iCharacterConverter;
+	CImConvertHeader*		iHeaderConverter;
+	TBool					iPreparedToConvert;
+	TBuf8<20>				iLeftOver;
+
+	// Bits used when appending
+	CImCalculateMsgSize*	iMessageSizer;
+	CImSendMessage*			iMessageSender;
+	TTime					iMessageDate;
+	HBufC8*					iLineBuffer;
+
+	// Tree of atoms
+	CImapAtom*				iRootAtom;
+
+	// Access to message database
+	CMsvServerEntry*		iEntry;
+	CMsvServerEntry*		iMoveEntry;
+	TMsvId					iMoveSource;		// What we're moving
+	TMsvId					iMoveSourceFolder;	// Where we're moving it from
+	TMsvId*					iNewSource;			// Where we save the newly created TMsvId in the source folder
+	CMsvEntrySelection*		iSelection;
+	CMsvEntrySelection*		iSynchronisationSelection;
+
+	// Dummy operation issued to CImapIO to notify us of connection problems?
+	CImImap4SessionDummyRead*	iDummyRead;
+	
+	// Used to issue and handle responses for IMAP IDLE
+	CImImap4SessionIdleRead* iIdleRead;
+
+	TBool					iUseIdleCommand;
+	CIdleTimeoutTimer*		iIdleTimer;
+	TBool					iReissueIdle;
+	TBool					iDisconnectAfterIdleStopped;
+	TMsvId					iInbox;
+	TBool 					iIdleTimerExpired;
+
+	// Hideous kludge for brain-dead CC:Mail servers
+	TBool					iTalkingToCCMail;
+	TBool					iTalkingToOpenMail;
+
+	TRequestStatus*			iRequestStatus;
+	TUint					iCharset;
+
+	TInt					iHeadersFetched;
+	TInt					iOrphanedMessages;
+	TInt					iRemoteMessagesDeleteTagged;
+	TInt					iMsgsDone;
+	TInt					iCheckDiskSpaceCounter;
+	TInt					iCurrentDrive;
+
+	CArrayFixFlat<TMsvCacheData>* iCachedEntryData;
+	CArrayFixFlat<TMsvId>* iSetSeenList;
+	CArrayFixFlat<TMsvId>* iClearSeenList;
+
+ 	TBool					iJustSentFetch;
+ 
+ 	// 
+ 	TImap4GetMailOptions	iGetOptions;
+	TImImap4GetPartialMailInfo	iGetPartialMailInfo;
+ 	TMsvId					iGetPart;
+
+	// If a Copy/Move/Delete fails with IMAP server. 
+	// Store the fact. May need information.
+	TInt					iCommandFailure;
+
+	// bearer timeout value in microseconds
+	TInt					iIdleTimeout;
+
+	TInt					iStore8BitData;
+	TBool					iFetchPartialMail;
+	TInt32					iBodyTextSize;
+	TInt32					iHtmlEntrySize;
+	TInt32					iBodyPartRemainingSize;
+	HBufC*					iFooterString;
+	TBool					iIsDiskSpaceChecked;
+	TMsvId					iHtmlEntryPart; 
+	TInt32					iSizeOfToBeFetchedAttachments;
+	// if set, the there is no IDLE reissued after a synch
+	TBool					iCompoundStopIdle;
+	CImCaf*					iCaf;
+
+	TBool					iIsICalendar;
+	TBool					iIsVCalendar;
+
+	HBufC8*					iUidString;
+	
+	// test to see if the uid is present in the fetch response. If it is, then it is part
+	// of the fetch command sent by the client. Otherwise it is a server message flag update,
+	// so just process flags
+	TBool iFoundUid;
+
+	// Indicates that we are stopping idle at the request of the synchronise active object
+	TBool iStoppingIdleForSync;
+
+	// Observer for callback notifications from session
+	MImapSessionObserver& iObserver;
+	
+	// Only going to be set on the secondary session to take ownership of primarysession
+	CActiveWrapper*			iPrimarySession; 
+	
+protected:
+	// Progress information
+	TImap4GenericProgress	iProgress;
+
+	// The service we're connected to
+	TMsvId					iServiceId;
+	// If we sent FETCH BODY MIME
+	TBool					iParsedTime;
+	CImapCancelTimer*		iCancelTimer;
+	TBool					iCancelAndIdle;
+	};
+
+#if 0
+class CImImapMoveWait: public CActive
+	{
+public:
+	CImImapMoveWait();
+	~CImImapMoveWait();
+	inline void Start();
+protected:
+	void RunL();
+	void DoCancel();
+	};
+
+inline void CImImapMoveWait::Start()
+	{
+	SetActive();
+	}
+#endif
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/inc/IMAPSYNC.H	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,226 @@
+// Copyright (c) 1998-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:
+// CImImap4Synchronise header
+// 
+//
+
+#if !defined(__IMAPSYNC_H__)
+#define __IMAPSYNC_H__
+
+#include <mentact.h>
+#include <msventry.h>
+#include <imapset.h>
+
+// Forward declarations
+class CImImap4Session;
+class CImImap4FolderSync;
+class CImap4OffLineControl;
+class CImap4Utils;
+
+// List of folders to be synchronised
+class TImImap4SyncList
+/**
+@internalComponent
+@released
+*/
+	{
+public:
+	TMsvId				iFolder;
+	TTime				iLastSync;
+	TBool				iNotSelectable;
+	};
+
+class CImImap4Synchronise : public CMsgActive
+/**
+@internalComponent
+@released
+*/
+	{
+public:
+// States
+enum TSynchroniseState
+	{
+	ESyncStateIdle=1,
+	EInboxSelect,
+	EInboxPendingOps,
+	EInboxSync,
+	ESynchroniseFolderTree,		// this must be in the correct place
+	ECheckRemoteSubscription,
+	EProcessRemoteSubscription,
+	EUpdateRemoteSubscription,
+	EFolderSelect,
+	EFolderPendingOps,
+	EFolderSynchronise,
+	EInboxEarlyDeletes,
+	EFolderEarlyDeletes,
+	EFolderEarlyExpunge,
+	EEndSelectInbox,
+	EInboxLateExpunge,
+	EFolderLateDeletes,
+	EFolderLateExpunge,
+	EInboxLogMessage,
+	EFolderLogMessage,
+	EStartIdle,
+	ESynchronise,
+	ESynchroniseTree,
+	ESynchroniseDeletes
+	};
+
+public:
+	~CImImap4Synchronise();
+	static CImImap4Synchronise* NewLC(CImImap4Session *aSession);
+	static CImImap4Synchronise* NewL(CImImap4Session *aSession);
+	void ConstructL(CImImap4Session *aSession);
+
+	// Mirror folder tree of remote server
+	void SynchroniseL(TRequestStatus& aStatus, TMsvId aRoot, TBool aNewInvisible, TBool aPerformDeletes, TBool aConnectAndSync = EFalse);
+	void SynchroniseDeletesL(TRequestStatus& aStatus, TMsvId aServiceId);
+	void SynchroniseTreeL(TRequestStatus& aStatus, TMsvId aServiceId, TBool aNewFoldersAreInvisible);
+
+	// Set serverentry to use
+	void SetEntry(CMsvServerEntry* aEntry);
+
+	// set OffLineControl to use
+	void SetOffLineControl(CImap4OffLineControl *aOffLine);
+	void SetUtils(CImap4Utils *aUtils);
+	
+	// Progress
+	TImap4SyncProgress Progress();
+
+private:
+	CImImap4Synchronise();
+	void DoRunL();
+	void DoCancel();
+	void DoComplete(TInt& aStatus);
+
+	// once round the state machine, returns whether to go round again
+	TBool DoRunLoopL();
+
+	// do the appropriate offline operation
+	void DoOpL(const CImOffLineOperation& aOp);
+
+	// finish up the op just done (send log message, append delete
+	// etc.)
+	void DonePendingOpL();
+
+	// process the next one in the outstanding ops list. Returns ETrue
+	// if finished
+	TBool NextPendingOpL();
+	
+	// process pending deletes of the type given in the given
+	// folder. Returns ETrue if any items were deleted
+	TBool MatchDeleteOp(const CImOffLineOperation& aOp , TBool aMoveDeletesOnly );
+	TBool ProcessPendingDeleteOpsL( TMsvId aFolder, TBool aMoveDeletesOnly );
+	TBool ProcessPendingDeleteOpsListL( TBool aMoveDeletesOnly );
+	
+	// Add folders to 'to do' list according to prevailing strategy
+	void AddLocalFoldersL(const TMsvId aFolder);
+
+	// helper function for AddLocalFolders
+	void AddIfNotThereL(TMsvId aFolder, CArrayFix<TImImap4SyncList>* aFolderList);
+
+	// Sort to-do list
+	void SortFolderListL();
+
+	// Set entry, leave if error (not related to setentry() which sets iEntry)
+	void SetEntryL(const TMsvId aId);
+
+	// Change entry, leave if error
+	void ChangeEntryL(const TMsvEntry& aEntry);
+	
+	// Change entry in bulk mode (i.e. no index file commit), leave if error
+	void ChangeEntryBulkL(const TMsvEntry& aEntry);
+
+	// Get children, leave if error
+	void GetChildrenL(CMsvEntrySelection& aSelection);
+
+	// make aId and its parents visible
+	void MakeVisibleL(TMsvId aId);
+	
+	// get the offlineOpArray from the id and set up iOutstandingOps and Folder
+	TBool RefreshOutstandingOpsL(TMsvId aId);
+
+	void ResetStats();
+	void GetInboxL();
+
+private:
+	// IMAP4 session to use
+	CImImap4Session*		iSession;
+
+	// Folder tree synchronisation
+	CImImap4FolderSync*		iFolderSync;
+
+	// Compound operation used for multi-step IMAP operations
+	CImImap4Compound*		iCompound;
+
+	// Synchronisation state
+	TSynchroniseState		iState;
+	TMsvId					iServiceId;
+	TMsvId					iFolderId;
+	TMsvId					iInbox;
+	TBool					iNewFoldersAreInvisible;
+	TBool					iPerformDeletes;
+
+	// Folders to synchronise
+	TFolderSyncType			iSynchroniseStrategy;
+	TFolderSubscribeType	iSubscribeStrategy;
+	CArrayFix<TImImap4SyncList>*	iFolderList;
+	// temporary list of folders to be added to iFolderList at end
+	CArrayFix<TImImap4SyncList>*	iFolderListDest;
+
+	// List of folders to subscribe or unsubscribe from
+	CArrayFix<TMsvId>*		iSubscribeList;
+	CArrayFix<TMsvId>*		iUnsubscribeList;
+
+	// List of outstanding operations on inbox/other folder
+	CImOffLineOperationArray* iOutstandingOps;
+	// current folder p=being processed
+	TMsvId				    iOutstandingOpsFolder;
+
+	// list of ids that need to be deleted because they were the
+	// source of a move
+	CArrayFix<TMsvId>*		iOutstandingMoveTypeDeletes;
+	CArrayFix<TMsvId>*		iOutstandingLocalDeletes;
+
+	// source id of current operation if it was a move and so should
+	// be deleted afterwards
+	TMsvId					iMovedId;
+
+	// shadow id of current operation - to be deleted when op finishes
+	TMsvId					iShadowId;
+	
+	// Access to message database
+	CMsvServerEntry*		iEntry;
+	
+	// Timer for new mail check
+	RTimer					iCheckMailbox;
+
+	// Current request status
+	TRequestStatus*			iRequestStatus;
+
+	// pointer to offline control object held by MTM
+	CImap4OffLineControl*	iOffLineControl;
+
+	TImap4SyncProgress		iProgress;
+
+	CImap4Utils*			iUtils;
+
+	TBool					iIdleBeforeCommand;
+	
+	 // Flag to indicate Pending Operation/s are done on folder, need to sync Inbox
+	TBool                   iPendingOpOnFolder;
+	
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/inc/IMPSMTM.H	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,284 @@
+// Copyright (c) 1998-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 __IMPSMTM_H__
+#define __IMPSMTM_H__
+
+#include <mtsr.h>
+#include <msvstd.h>
+
+#include <imapset.h>
+#include <imapcmds.h>
+#include "mimapsessionobserver.h"
+
+#include <offop.h>
+
+// Forward declarations
+class CImImap4Session;
+class CImImap4FolderSync;
+class CImImap4Synchronise;
+class CImap4ServerMtm;
+class CImImap4Compound;
+class CImap4OffLineControl;
+class CImap4Utils;
+
+//******************
+// MActiveWrapperObserver - A Mixin class which provides mechanism to communicate to CActiveOwner
+//******************
+class MActiveWrapperObserver
+/**
+@internalComponent
+@released
+*/
+	{
+public:	
+	virtual void RequestCompleted(TInt aChildActiveObjectID, TInt aError)=0;
+	virtual void Activate()=0;
+	virtual void NonCompletedFailureOnSession(TInt aId)=0;
+	};
+
+//*******************
+// CActiveWrapper - The wrapper class which owns a CmsgActive and signals its Cactive parent
+//*******************
+
+// CActiveWrapper is the 'thin' CActive object which wraps each of your CMsgActive objects
+class CActiveWrapper : public CActive, public MImapSessionObserver
+/**
+@internalComponent
+@released
+*/
+	{
+public:
+	static CActiveWrapper* NewL(TInt aID);
+	void StartL(MActiveWrapperObserver* aManager);
+	~CActiveWrapper();
+	TRequestStatus* SessionStatus();
+	void SetEntry(CMsvServerEntry* aEntry);
+	
+	// Return of current imap4session
+	CImImap4Session* GetImap4Session();
+	
+protected:
+	void RunL();
+	void DoCancel();
+	void DoComplete(TInt aStatus);
+
+private:
+	CActiveWrapper(TInt aID);
+	void ConstructL();
+
+	// From MImapSessionObserver
+	void NonCompletedFailure();
+private:
+	TInt iID;							// my unique ID which my parent uses to identify me
+	MActiveWrapperObserver* iParentPtr;	// handle to my parent (and hence its Completed() function)
+
+protected:
+	// The session which CActiveWrapper owns
+	CImImap4Session*	iSession;
+
+	// Class for compound operations
+	CImImap4Compound*	iCompound;
+
+	// Full synchronise class (only ever instantiated on primary session)
+	CImImap4Synchronise*	iFullSync;
+
+private:
+	friend class CImap4ServerMtm;
+	};
+
+// package buffer for progress info.
+typedef TPckgBuf<TImap4CompoundProgress> TImap4ProgressBuf;
+
+// States that MTM can be in
+/**
+@internalComponent
+@released
+*/
+enum TMtmState
+	{
+	EMtmStateIdle=0,
+	EMtmStateCopyToLocal,
+	EMtmStateCopyFromLocal,
+	EMtmStateCopyWithinService,
+	EMtmStateMoveToLocal,
+	EMtmStateMoveFromLocal,
+	EMtmStateMoveWithinService,
+	EMtmStateDeleteAfterMove,
+	EMtmStateDelete,
+	EMtmStateDeleteFolder,
+	EMtmStateCreateFolder,
+	EMtmStateRenameFolder,
+	EMtmStatePrimaryConnect,
+	EMtmStateSecondaryConnect,
+	EMtmStateForegroundSync,
+	EMtmStateMiscCommand,
+	EMtmStateWaitingForBackgroundToFinish,
+	EMtmStateSyncCompleted,
+	EMtmStatePopulate,
+	EMtmStateLogging,
+	EMtmStateOffLineDelete,
+	EMtmStateOffLineUndelete,
+	EMtmStateOffLineCopyToLocal,
+	EMtmStateOffLineMoveToLocal,
+	EMtmStateOffLineCopyFromLocal,
+	EMtmStateOffLineMoveFromLocal,
+	EMtmStateOffLineCopyWithinService,
+	EMtmStateOffLineMoveWithinService,
+	EMtmStateOffLinePopulate,
+	EMtmStateSecondarySessionIdle
+	};
+
+class CImap4ServerMtm : public CBaseServerMtm, public MActiveWrapperObserver
+/**
+@internalTechnology
+@released
+*/
+	{
+public:
+	IMPORT_C static CImap4ServerMtm* NewL(CRegisteredMtmDll& aRegisteredMtmDll,CMsvServerEntry* aEntry);
+	~CImap4ServerMtm();
+
+	void CopyToLocalL(const CMsvEntrySelection& aSelection,TMsvId aDestination, TRequestStatus& aStatus);
+	void CopyFromLocalL(const CMsvEntrySelection& aSelection,TMsvId aDestination, TRequestStatus& aStatus);
+	void CopyWithinServiceL(const CMsvEntrySelection& aSelection,TMsvId aDestination, TRequestStatus& aStatus);
+	void MoveToLocalL(const CMsvEntrySelection& aSelection,TMsvId aDestination, TRequestStatus& aStatus);
+	void MoveFromLocalL(const CMsvEntrySelection& aSelection,TMsvId aDestination, TRequestStatus& aStatus);
+	void MoveWithinServiceL(const CMsvEntrySelection& aSelection,TMsvId aDestination, TRequestStatus& aStatus);
+	void DeleteAllL(const CMsvEntrySelection& aSelection, TRequestStatus& aStatus);
+	void CreateL(TMsvEntry aNewEntry, TRequestStatus& aStatus);
+	void ChangeL(TMsvEntry aNewEntry, TRequestStatus& aStatus);
+	//
+	void StartCommandL(CMsvEntrySelection& aSelection, TInt aCommand, const TDesC8& aParameter, TRequestStatus& aStatus);
+	//
+	TBool CommandExpected();
+	//
+	const TDesC8& Progress();
+
+	// What state we're in
+	enum
+		{
+		EBothIdle=0,
+		EPrimaryBusy,
+		EBothBusy,
+		ESecondaryBusy
+		};
+protected:
+	void DoCancel();
+	void DoRunL();
+	void DoComplete(TInt aError);
+	
+	// From MActiveWrapperObserver
+	void RequestCompleted(TInt aId, TInt aCode);
+	void Activate();
+	void NonCompletedFailureOnSession(TInt aId);
+
+private:
+	CImap4ServerMtm(CRegisteredMtmDll& aRegisteredMtmDll,CMsvServerEntry* aEntry);
+	void ConstructL();
+	TInt CheckSelectionL(const CMsvEntrySelection& aSelection,
+					 	 CMsvEntrySelection* aLocalCopy,
+				 		 const TBool aMessages,
+				 		 const TBool aParts,
+						 const TBool aFolders,
+						 const TBool aIsInService);
+//	void SaveOperationL(CImOffLineOperation& aOperation);
+	void MessageErrorL(const TMsvId aMessageId, const TInt aError);
+	TInt SetLocalSubscription(const TMsvId aFolder, const TBool aSubscribed);
+	void MtmCommandL(const TInt aType,const CMsvEntrySelection& aSelection, TMsvId aDestination, TRequestStatus& aStatus);
+	void MarkOnOrOfflineL(const TBool aOnline);
+	void ChangeVisibilityL(TMsvId aParent, TBool aInvisible);
+	void ChangeVisibilityL(TMsvId aParent, TBool aInvisible, TBool aRecurse, TUid aType);
+	void PropagateInvisibleFlagL(TMsvId aId);
+	void GoneOffline();
+
+	// Set entry, leave if error (not related to setentry() which sets iEntry)
+	void SetEntryL(const TMsvId aId);
+
+	// Change entry, leave if error
+	void ChangeEntryL(const TMsvEntry& aEntry);
+
+	// Get children, leave if error
+	void GetChildrenL(CMsvEntrySelection& aSelection);
+
+	void DeleteEntryL(TMsvId aId);
+	void UndeleteAllL(const CMsvEntrySelection& aSelection, TRequestStatus& aStatus);
+
+	// now used instead of ChangeL
+	TBool RenameFolderL(TMsvId aId, const TImap4RenameFolder& aRename);
+
+	// load or reload service settings
+	void LoadSettingsL(TMsvId aId);
+
+	void ClearNewFlagL(TMsvId aParent);
+
+	TBool PruneMessages(const CMsvEntrySelection& aSelection);
+	TBool IsPartialPopulate(TDes8& aParameter);
+
+private:
+	TInt						iProgressMsgsToDo;
+	TInt						iProgressMsgsDone;
+	TInt						iProgressErrorCode;
+	TImap4ProgressBuf			iProgressBuf;
+
+	TImap4GenericProgress::TImap4GenericProgressState	iLastSessionState;
+	TImap4GenericProgress::TImap4GenericProgressOp		iRequestedOperation;
+
+	TMsvId						iServiceId;
+
+	// Copy of the service's settings
+	CImImap4Settings*			iServiceSettings;
+
+	// Internal state for multipart operations
+	TMtmState					iState;
+	TMtmState					iSavedState;
+	TInt						iLastCommand;
+	CMsvEntrySelection*			iSelection;
+	CMsvEntrySelection*			iOneSelection;
+	TMsvId						iDestination;
+
+	// The two sessions that we can deal with
+	CActiveWrapper*				iPrimarySession;
+	CActiveWrapper*				iSecondarySession;
+
+	// the object that manages our offline operations
+	CImap4OffLineControl*		iOffLineControl;
+	
+	// The session the last command was issued to
+	CActiveWrapper*				iCurrentSession;
+	TInt						iId;
+	TInt						iCode;
+
+	// State of sessions
+	//TInt						iSessionState;
+	TBool						iBackgroundSyncInProgress;
+	TBool						iBatchInProgress;
+
+	// Can we be deleted now?
+	TBool						iCanBeDeletedNow;
+
+	// Should we clear New flag on messages?
+	TBool						iClearNewFlagOnNextSync;
+
+	TRequestStatus*				iRequest;
+
+	TImap4GetMailOptions		iGetMailOptions;
+
+	CImap4Utils*				iUtils;
+
+	TInt						iTotalSize;
+	TImImap4GetPartialMailInfo	iPartialMailInfo;
+	};
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/inc/IMPSPAN.H	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,80 @@
+// Copyright (c) 1998-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:
+//
+
+#if !defined(__IMPSPAN_H__)
+#define __IMPSPAN_H__
+
+#if !defined(__E32BASE_H__)
+#include <e32base.h>
+#endif
+
+/**
+@internalComponent
+@released
+*/
+enum TImpsPanic
+	{
+	ETxtcNoBodyText,
+	EUnknownTag,
+	EOpenWhenNotClosed,
+	ESelectWhenNotReady,
+	EFetchWhenNotSelected,
+	EUnknownState,
+	EAlreadySending,
+	ESendingAlready,
+	EConnectWhenConnected,
+	EIOWhenNotReady,
+	EAtomStackOverflow,
+	EAtomStackUnderflow,
+	ECantChangeUID,
+	ECantChangeMsvId,
+	EMsgnrOutOfRange,
+	EIndexEmpty,
+	ECreateWhenNotReady,
+	ERenameWhenNotReady,
+	EDeleteWhenNotReady,
+	ESubscribeWhenNotReady,
+	ECloseWhenNotSelected,
+	ENotLoggedOn,
+	ECopyNotFromSelectedFolder,
+	ESyncWhenNotSelected,
+	ENotImplementedYet,
+	ECommandCompleteInUnknownState,
+	ERunLInUnknownState,
+	EUnknownEncodingMethod,
+	EInvalidStatus,
+	ECouldntFindFolder,
+	ECopyWhenNotSelected,
+	EDeleteOfUnknownType,
+	ECannotGetMoveEntry,
+	EUnknownMsvType,
+	EInvalidService,
+	EInvalidMsvTypeToCommand,
+	EInvalidInbox,
+	EBadUseOfImap4Op,
+	EBadUseOfOffLineOp,
+	KStorableAtomAlreadyUsed,
+	KStorableAtomNotSet,
+	KInvalidDummyComplete,
+	KIncorrectNoOfUidsFromUidSearch,
+	KSettingSeenFlagToExistingState,
+	KErrorBuildingStoreFlagsCommand,
+	KMaxBufferLengthExceeded,
+	ECancelFetchWhenNotFetching
+	};
+
+GLREF_C void gPanic(TImpsPanic aPanic);
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/inc/IMPSUTIL.H	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,51 @@
+// Copyright (c) 1998-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:
+// IMAP4 utils
+// 
+//
+
+#if !defined(__IMPSUTIL_H__)
+#define __IMPSUTIL_H__
+
+class CImap4Utils : public CBase
+/**
+@internalComponent
+@released
+*/
+	{
+public:
+	static CImap4Utils* NewL(CMsvServerEntry* aEntry);
+	~CImap4Utils();
+	
+	// prepare the iLogMessage block with details of the next message
+	void SetUpLogMessageL(TMsvId aId);
+
+	// clear details recorded so that SendLog won't do anything
+	void ClearLogMessage();
+	
+	// log the event previously set up
+	TBool SendLogMessageL(TInt aError, TRequestStatus &aStatus);
+
+private:
+	void ConstructL(CMsvServerEntry* aEntry);
+	
+private:
+	// logging object (maybe NULL)
+	CImLogMessage*			iLogMessage;
+
+	// Access to message database
+	CMsvServerEntry*		iEntry;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/inc/cimapcanceltimer.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,43 @@
+// Copyright (c) 2005-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 __CIMAPCANCELTIMER_H__
+#define __CIMAPCANCELTIMER_H__
+
+#include <e32base.h>
+
+class CImImap4Session;
+
+/**
+@internalTechnology
+@released
+*/
+NONSHARABLE_CLASS(CImapCancelTimer) : public CTimer
+	{
+public:
+	static CImapCancelTimer* NewL(CImImap4Session& aSession);
+	virtual ~CImapCancelTimer();
+
+private:	// methods from CActive
+	virtual void RunL();
+	
+private:
+	CImapCancelTimer(CImImap4Session& aSession);
+	
+private:
+	CImImap4Session& iSession;
+	};
+
+#endif	//__CIMAPCANCELTIMER_H__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/inc/mimapsessionobserver.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,38 @@
+// Copyright (c) 2006-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 __MIMAPSESSIONOBSERVER_H__
+#define __MIMAPSESSIONOBSERVER_H__
+
+/**
+Provides an API to allow the session to provide callback notifications to its
+parent.
+
+@internalComponent
+@released
+*/
+class MImapSessionObserver
+	{
+public:
+	/**
+	Provides notification of a failure that occurs on the session while the
+	parent does not have an outstanding asynchronous operation running on it.
+	For example, this could be used to notify of an error that occurs during
+	the cancel and idle operation.
+	*/
+	virtual void NonCompletedFailure()=0;
+	};
+
+#endif	//__MIMAPSESSIONOBSERVER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/src/FLDINDEX.CPP	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,163 @@
+// Copyright (c) 1998-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:
+// IMAP Folder indexing
+// 
+//
+
+#include "fldindex.h"
+#include "impspan.h"
+
+// Illegal UID we use for marker
+const TUint KIllegalUID	= 0xffffffff;
+
+CImImap4IndexEntry::CImImap4IndexEntry()
+	{
+	// Default values
+	iUid=0;
+	iMsvId=-1;
+	}
+
+CImImap4IndexEntry::CImImap4IndexEntry(CImImap4IndexEntry& aFrom)
+	{
+	// Copy entry
+	iUid=aFrom.iUid;
+	iMsvId=aFrom.iMsvId;
+	}
+
+CImImap4IndexEntry& CImImap4IndexEntry::operator=(CImImap4IndexEntry& aFrom)
+	{
+	// Copy entry
+	iUid=aFrom.iUid;
+	iMsvId=aFrom.iMsvId;
+	return(*this);
+	}
+
+CImImap4FolderIndex::CImImap4FolderIndex()
+	{
+	__DECLARE_NAME(_S("CImImap4FolderIndex"));
+	}
+
+CImImap4FolderIndex::~CImImap4FolderIndex()
+	{
+	// Dispose of index
+	delete iIndex;
+	}
+
+void CImImap4FolderIndex::Reset()
+	{
+	// Dispose of index
+	delete iIndex;
+	iIndex=NULL;
+	iSize=0;
+	}
+
+void CImImap4FolderIndex::SetSizeL(const TUint aEntries)
+	{
+	// Set number of entries
+	if (!iIndex)
+		{
+		// Create new array (granularity 8 entries)
+		iIndex=new (ELeave) CArrayFixFlat<CImImap4IndexEntry>(8);
+		}
+
+	// Alter size, filling unused entries with 0xffffffff
+	CImImap4IndexEntry blank;
+	blank.iUid=KIllegalUID;
+	blank.iMsvId=0;
+	iIndex->ResizeL(aEntries,blank);
+
+	// Save new size
+	iSize=aEntries;
+	}
+
+TInt CImImap4FolderIndex::Size()
+	{
+	// Return current size
+	return(iSize);
+	}
+
+void CImImap4FolderIndex::SetUid(const TUint aMsgNr, const TUint aMsgUid)
+	{
+	__ASSERT_ALWAYS(aMsgNr<=TUint(iSize),gPanic(EMsgnrOutOfRange));
+
+	// Is UID already set?
+	if ((*iIndex)[aMsgNr-1].iUid!=KIllegalUID && (*iIndex)[aMsgNr-1].iUid!=aMsgUid)
+		{
+		// CHANGING a UID? No way!
+		gPanic(ECantChangeUID);
+		}
+
+	// Set a UID for a message number
+	(*iIndex)[aMsgNr-1].iUid=aMsgUid;
+	}
+
+void CImImap4FolderIndex::SetMsvId(const TUint aMsgNr, const TMsvId aMsvId)
+	{
+	__ASSERT_ALWAYS(aMsgNr<=TUint(iSize),gPanic(EMsgnrOutOfRange));
+
+	// Is MsvId already set?
+	if ((*iIndex)[aMsgNr-1].iMsvId!=0 && (*iIndex)[aMsgNr-1].iMsvId!=aMsvId)
+		{
+		// CHANGING a MsvId? No way!
+		gPanic(ECantChangeMsvId);
+		}
+
+	// Set a MsvId for a message number
+	(*iIndex)[aMsgNr-1].iMsvId=aMsvId;
+	}
+
+void CImImap4FolderIndex::Expunge(const TUint aMsgNr)
+	{
+	__ASSERT_ALWAYS(aMsgNr<=TUint(iSize),gPanic(EMsgnrOutOfRange));
+
+	// Remove entry from index
+	iIndex->Delete(aMsgNr-1);
+	iSize--;
+	}
+
+TUint CImImap4FolderIndex::FindMsg(const TUint aMsgUid)
+	{
+	__ASSERT_ALWAYS(iSize>0,gPanic(EIndexEmpty));
+
+	// Replace this with a binary search...
+	TInt i=0;
+	do
+		{
+		// UID match?
+		if ((*iIndex)[i].iUid==aMsgUid)
+			return(i+1);
+
+		i++;
+		}
+	while(i<iSize);
+
+	// Failure (0 not a legal message number)
+	return(0);
+	}
+
+// Access entry directly
+CImImap4IndexEntry& CImImap4FolderIndex::operator[] (const TInt aIndex)
+	{
+	return((*iIndex)[aIndex]);
+	}
+
+// Sort index by UID
+void CImImap4FolderIndex::Sort()
+	{
+	// Sorting object
+	TKeyArrayFix uidKey(_FOFF(CImImap4IndexEntry,iUid),ECmpTUint32);
+
+	// Perform the sort
+	iIndex->Sort(uidKey);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/src/FLDSYNC.CPP	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,514 @@
+// Copyright (c) 1998-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:
+// IMAP4 folder list synchronise
+// This class deals with keeping the local mirror folder tree in sync with the
+// remote server's directory structure.
+// 980914 - Modifications to local tree traverse so that it will not
+// look for children below message level: previously, it was
+// picking up attachment folders in messages!
+// 990304 - Orphaned folder check no longer orphans the inbox: we
+// basically never touch it. The problem with orphaning it
+// comes about with servers which have a namespace (ie
+// folder path) of INBOX, which means we never "see" the
+// actual inbox as we are inside it. We still know it
+// exists, though.
+// 990502 - Was calling CMsgActive::Cancel() as opposed to DoCancel().
+// 
+//
+
+#include <e32base.h>
+#include <e32cons.h>
+#include <mentact.h>
+#include "fldsync.h"
+#include "impspan.h"
+#include "imapsess.h"
+
+#ifdef _DEBUG
+#define LOG_COMMANDS(a) a
+#define DBG(a) a
+#define PRINTING
+#else
+#define LOG_COMMANDS(a)
+#define DBG(a)
+#undef PRINTING
+#endif
+
+// Priority of MsgActive object
+const TInt EFolderSyncPriority=1;
+
+
+// Debugging of folder tree traversal
+#undef DEBUG_FOLDERSYNC
+
+CImImap4FolderSync::CImImap4FolderSync():CMsgActive(EFolderSyncPriority)
+	{
+	__DECLARE_NAME(_S("CImImap4FolderSync"));
+	}
+
+CImImap4FolderSync::~CImImap4FolderSync()
+	{
+	// Global bits
+	delete iFolderContents;
+
+	if (iFolderList)
+		iFolderList->ResetAndDestroy();
+	delete iFolderList;
+
+	// Get rid of bits at each level
+	for(TInt a=0;a<KFolderDepth;a++)
+		delete iFolderIds[a];
+
+	// Delete local folder list
+	delete iLocalFolders;
+	}
+
+CImImap4FolderSync* CImImap4FolderSync::NewLC(CImImap4Session *aSession)
+	{
+	CImImap4FolderSync* self=new (ELeave) CImImap4FolderSync();
+	CleanupStack::PushL(self);
+
+	// Non-trivial constructor
+	self->ConstructL(aSession);
+	return self;
+	}
+
+CImImap4FolderSync* CImImap4FolderSync::NewL(CImImap4Session *aSession)
+	{
+	CImImap4FolderSync* self=NewLC(aSession);
+	CleanupStack::Pop();
+	return self;
+	}
+
+// The non-trivial constructor
+void CImImap4FolderSync::ConstructL(CImImap4Session *aSession)
+	{
+	// Save session
+	iSession=aSession;
+
+	// We're an active object...
+	CActiveScheduler::Add(this);
+
+	// One-off bits
+	iFolderList=new (ELeave) CArrayPtrFlat<CImImap4DirStruct>(8);
+	iFolderContents=new (ELeave) CMsvEntrySelection;
+
+	// ...and per-level bits
+	for(TInt a=0;a<KFolderDepth;a++)
+		iFolderIds[a]=new (ELeave) CArrayFixFlat<TMsvId>(8);
+
+	// Local folder list
+	iLocalFolders=new (ELeave) CArrayFixFlat<TMsvId>(16);
+	}
+
+// Do setentry, leave if there is an error
+void CImImap4FolderSync::SetEntryL(const TMsvId aId)
+	{
+	User::LeaveIfError(iEntry->SetEntry(aId));
+	}
+
+// Change entry, leave if error
+void CImImap4FolderSync::ChangeEntryL(const TMsvEntry& aEntry)
+	{
+	User::LeaveIfError(iEntry->ChangeEntry(aEntry));
+	}
+
+// Change entry in bulk mode (i.e. no index file commit), leave if error
+void CImImap4FolderSync::ChangeEntryBulkL(const TMsvEntry& aEntry)
+	{
+	User::LeaveIfError(iEntry->ChangeEntryBulk(aEntry));
+	}
+// Get children, leave if error
+void CImImap4FolderSync::GetChildrenL(CMsvEntrySelection& aSelection)
+	{
+	User::LeaveIfError(iEntry->GetChildren(aSelection));
+	}
+
+// Set the entry to use to talk to the server
+void CImImap4FolderSync::SetEntry(CMsvServerEntry* aEntry)
+	{
+	// Save it
+	iEntry=aEntry;
+	}
+
+// Build list of local folders
+void CImImap4FolderSync::BuildLocalL(const TMsvId aFolder, const TBool aDoThisOne)
+	{
+	// Select it
+	SetEntryL(aFolder);
+	TMsvEmailEntry entry=iEntry->Entry();
+
+	// If we're a folder, set the flag
+	if (entry.iType==KUidMsvFolderEntry && aDoThisOne)
+		{
+		// Add to list
+		iLocalFolders->AppendL(iEntry->Entry().Id());
+		}
+
+	// If current entry is a message, don't look for children
+	if (entry.iType==KUidMsvMessageEntry)
+		return;
+
+	// Any children?
+	CMsvEntrySelection *children=new (ELeave) CMsvEntrySelection;
+	CleanupStack::PushL(children);
+	GetChildrenL(*children);
+	if (children->Count())
+		{
+		// Do each in turn
+		for(TInt child=0;child<children->Count();child++)
+			BuildLocalL((*children)[child],ETrue);
+		}
+	CleanupStack::PopAndDestroy();
+	}
+
+// Called when async child completes
+void CImImap4FolderSync::DoRunL()
+	{
+	if (ProcessDirListL())
+		{
+		// Done whole list, check to see what has vanished on the
+		// server with regard to what's in the mirror: basically,
+		// see what's still flagged in the tree.
+		OrphanedFolderCheckL();
+
+		// All done!
+		Complete(KErrNone);
+		}
+	else
+		{
+		// Otherwise, another command has been issued
+		SetActive();
+		}
+	}
+
+// Cancel this operation
+void CImImap4FolderSync::DoCancel()
+	{
+	DBG((iSession->LogText(_L8("CImImap4FolderSync::DoCancel()"))));
+
+	// Cancel any outstanding session operation
+	iSession->Cancel();
+
+	// ...and parent
+	CMsgActive::DoCancel();
+	}
+
+// Check for orphaned folders
+void CImImap4FolderSync::OrphanedFolderCheckL()
+	{
+	DBG((iSession->LogText(_L8("CImImap4FolderSync::OrphanedFolderCheckL()"))));
+
+	// Set stats
+	iOrphanedFolders=iLocalFolders->Count();
+
+	// Selection for storing children
+	CMsvEntrySelection *children=new CMsvEntrySelection;
+	CleanupStack::PushL(children);
+
+	// Any folders left in iLocalFolders are orphans
+	for(TInt a=0;a<iLocalFolders->Count();a++)
+		{
+		// Go to this folder
+		if (iEntry->SetEntry((*iLocalFolders)[a])!=KErrNone)
+			{
+			// Probably been removed already (nested?)
+			continue;
+			}
+		TMsvEmailEntry entry=iEntry->Entry();
+
+		// Is it the INBOX? If so, ignore it
+		if (entry.Parent()==iServiceId &&
+			entry.iDetails.CompareF(KIMAP_INBOX)==0)
+			continue;
+
+		// Check all the entries in the folder
+		TInt subfolders=0;
+		children->Reset();
+		GetChildrenL(*children);
+		if (children->Count())
+			{
+			// Check each message
+			for(TInt a=0;a<children->Count();a++)
+				{
+				SetEntryL((*children)[a]);
+				TMsvEmailEntry child=iEntry->Entry();
+				if (child.iType==KUidMsvMessageEntry)
+					{
+					// Orphan this message: it may delete it, if there
+					// are no downloaded bodyparts
+
+					DBG((iSession->LogText(_L8("Orphaning message %x"),(*children)[a])));
+
+					iSession->OrphanMessageL((*children)[a]);
+					}
+				else if (child.iType==KUidMsvFolderEntry)
+					{
+					// There's a subfolder
+					subfolders++;
+					}
+				}
+			}
+
+		// Check number of children again: if all the orphaned children
+		// have been deleted (ie, they had no downloaded body parts)
+		// then we can delete the folder locally, otherwise we just have
+		// to mark it as orphaned.
+		SetEntryL((*iLocalFolders)[a]);
+		GetChildrenL(*children);
+		if ((children->Count() || subfolders>0) && !entry.Orphan())
+			{
+
+			DBG((iSession->LogText(_L8("Orphaning folder %x"),(*iLocalFolders)[a])));
+
+			// Orphan folder
+			TMsvEmailEntry message=iEntry->Entry();
+			message.SetOrphan(ETrue);
+			ChangeEntryL(message);
+			}
+		else
+			{
+
+			DBG((iSession->LogText(_L8("Deleting folder %x"),(*iLocalFolders)[a])));
+
+			// Delete folder
+			SetEntryL(iEntry->Entry().Parent());
+			iEntry->DeleteEntry((*iLocalFolders)[a]);
+			}
+		}
+
+	// Get rid of children list
+	CleanupStack::PopAndDestroy();
+
+	// Remove list
+	iLocalFolders->Reset();
+
+	DBG((iSession->LogText(_L8("CImImap4FolderSync::OrphanedFolderCheckL() done"))));
+	}
+
+// Process returned directory list
+TBool CImImap4FolderSync::ProcessDirListL()
+	{
+	// We've got a list, and the mirror folder ID that the contents belong to:
+	// process it, and mirror the folder structure
+
+	// First, find the existing children of this folder from the message server
+	SetEntryL(iFolderId);
+	GetChildrenL(*iFolderContents);
+	TInt noofchildren=iFolderContents->Count();
+
+	// Number of items in reply from server
+	TInt noofreplies=iFolderList->Count();
+
+#ifdef DEBUG_FOLDERSYNC
+	iSession->LogText(_L("Level %d: Server has %d entries, mirror has %d"),
+					  iFolderLevel,noofreplies,noofchildren);
+#endif
+
+	// Empty the 'to do' array
+	iFolderIds[iFolderLevel]->Reset();
+
+	// ...for each entry in reply
+	for(TInt replyentry=0;replyentry<noofreplies;replyentry++)
+		{
+		// Does this already exist?
+		TInt a;
+		TMsvId thisentry;
+		for(a=0;a<noofchildren;a++)
+			{
+			// See if the details field matches the server folder name.
+			// For the INBOX folder the match should be case insensitive, all other folders
+			// we must perform a case sensitive match
+			SetEntryL(thisentry=(*iFolderContents)[a]);
+			TPtrC entryName = iEntry->Entry().iDetails;
+			TPtrC svrFolderName = (*iFolderList)[replyentry]->Leafname();
+			TBool foldersMatch = EFalse;
+			if(svrFolderName.CompareF(KIMAP_INBOX)==0)
+				{
+				// Server folder is the INBOX
+				foldersMatch = (entryName.CompareF(svrFolderName)==0);
+				}
+			else
+				{
+				// Server folder is not the INBOX
+				foldersMatch = (entryName.Compare(svrFolderName)==0);
+				}
+				
+			if (foldersMatch)
+				{
+				// Update mailbox flag as necessary, but NOT if it's the inbox, which is
+				// *ALWAYS* a mailbox
+				TMsvEmailEntry folder=iEntry->Entry();
+				if ((*iFolderList)[replyentry]->iIsMailbox!=folder.Mailbox())
+					{
+					if (folder.Parent()!=iServiceId ||
+					    folder.iDetails.CompareF(KIMAP_INBOX)!=0)
+						{
+						folder.SetMailbox((*iFolderList)[replyentry]->iIsMailbox);
+						ChangeEntryBulkL(folder);
+						}
+					else
+						{
+						DBG((iSession->LogText(_L8("Skipping Mailbox flag twiddle for folder %x (=%d)"),
+						  folder.Id(),(*iFolderList)[replyentry]->iIsMailbox)));
+						}
+					}
+
+				// Exists: remove from local folders list
+				for(TInt b=0;b<iLocalFolders->Count();b++)
+					{
+					// Found it?
+					if ((*iLocalFolders)[b]==thisentry)
+						{
+						// Remove from list
+						iLocalFolders->Delete(b,1);
+						break;
+						}
+					}
+
+				// Exit loop
+				break;
+				}
+			}
+
+		// Found a match?
+		if (a==noofchildren)
+			{
+			// No, create it
+			TMsvEmailEntry message;
+			
+			// All flags unset (urrgh!)
+			message.SetMtmData1(0);
+			message.SetMtmData2(0);
+			message.SetMtmData3(0);
+
+			message.iType=KUidMsvFolderEntry;
+			message.iMtm=iEntry->Entry().iMtm;
+			message.iServiceId=iServiceId;
+			message.iSize=0;
+			message.iDetails.Set((*iFolderList)[replyentry]->Leafname());
+			message.SetValidUID(EFalse);
+			message.SetComplete(ETrue);
+
+			// Visibility
+			if (iNewFoldersAreInvisible)
+				message.SetVisible(EFalse);
+
+			// Is a mailbox? (basically, is it selectable?).
+			message.SetMailbox((*iFolderList)[replyentry]->iIsMailbox);
+
+#ifdef DEBUG_FOLDERSYNC
+			iSession->LogText(_L("Creating folder '%S'"),&message.iDetails);
+#endif
+			SetEntryL(iFolderId);
+			User::LeaveIfError(iEntry->CreateEntryBulk(message));
+
+			// Increment stats
+			iNewFolders++;
+			
+			// Get the ID, incase we're going into this level
+			thisentry=message.Id();
+			}
+
+		// Does this have children? (and are we at the end of our nesting levels?)
+		if ((*iFolderList)[replyentry]->iIsFolder && iFolderLevel<(KFolderDepth-1))
+			{
+#ifdef DEBUG_FOLDERSYNC
+			iSession->LogText(_L("Adding folder to todolist, level %d"),iFolderLevel);
+#endif
+			// Add it to the list to scan at this level
+			iFolderIds[iFolderLevel]->AppendL(thisentry);
+			}
+		}
+
+#ifdef DEBUG_FOLDERSYNC
+	iSession->LogText(_L("Level %d: %d items in todolist"),iFolderLevel,iFolderIds[iFolderLevel]->Count());
+#endif
+
+	// Anything in our 'to do' queue?
+	while(!iFolderIds[iFolderLevel]->Count())
+		{
+#ifdef DEBUG_FOLDERSYNC
+		iSession->LogText(_L("Nothing to do at level %d"),iFolderLevel);
+#endif
+		// Nothing at this level: are we at the top?
+		if (iFolderLevel==0)
+			{
+#ifdef DEBUG_FOLDERSYNC
+			iSession->LogText(_L("At level 0: completing"));
+#endif
+			// All done!
+			// Commit any outstanding bulk creates
+			SetEntryL(iFolderId);
+			iEntry->CompleteBulk();
+			return(ETrue);
+			}
+
+#ifdef DEBUG_FOLDERSYNC
+		iSession->LogText(_L("Going up a level"));
+#endif
+		// Not at the top: back up a level
+		iFolderLevel--;
+		}
+
+	// Something to process: remove it from todo list
+	iFolderId=(*iFolderIds[iFolderLevel])[0];
+	iFolderIds[iFolderLevel]->Delete(0,1);
+
+	// Nest & issue command
+	iFolderLevel++;
+	iSession->ListL(iStatus,iFolderId,iFolderList);
+
+#ifdef DEBUG_FOLDERSYNC
+	iSession->LogText(_L("Stuff to do at level %d - scanning dir %x"),iFolderLevel,iFolderId);
+#endif
+	return(EFalse);
+	}
+
+// Synchronise mirror tree with remote server
+void CImImap4FolderSync::SynchroniseTreeL(TRequestStatus& aStatus, const TMsvId aService, const TBool aNewFoldersAreInvisible)
+	{
+	LOG_COMMANDS((iSession->LogText(_L8("COMMAND CImImap4FolderSync::SychroniseTree (serviceid=%x)"),aService)));
+
+	Queue(aStatus);
+
+	// Note where this list came from
+	iServiceId=aService;
+	iFolderId=iServiceId;
+	iFolderLevel=0;
+
+	// Save invisibility state
+	iNewFoldersAreInvisible=aNewFoldersAreInvisible;
+
+	// Set flags on all folders, so we can tell which ones aren't matched by the
+	// list returned from the server.
+	iLocalFolders->Reset();
+	BuildLocalL(iServiceId,EFalse);
+
+	// List this tree
+	iSession->ListL(iStatus,iFolderId,iFolderList);
+	SetActive();
+	}
+
+void CImImap4FolderSync::IncProgress(TImap4SyncProgress& aProgress)
+	{
+	aProgress.iNewFolders+=iNewFolders;
+	aProgress.iOrphanedFolders+=iOrphanedFolders;
+	}
+
+void CImImap4FolderSync::ResetStats()
+	{
+	// initialise counts
+	iNewFolders=0;
+	iOrphanedFolders=0;
+	}	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/src/IMAPCOMP.CPP	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,993 @@
+// Copyright (c) 1998-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:
+// IMAP4 compound operations
+// This class wraps up operations which require more than one IMAP command
+// (the imapsess.cpp class deals with single IMAP commands generally),
+// allowing increased neatness in the higher classes.
+// 
+//
+
+#include <e32base.h>
+#include <e32cons.h>
+#include <mentact.h>
+#include "impspan.h"
+#include "imapsess.h"
+#include <imapset.h>
+#include "imapcomp.h"
+
+#ifdef _DEBUG
+#define LOG_COMMANDS(a) a
+#define DBG(a) a
+#define PRINTING
+#else
+#define LOG_COMMANDS(a)
+#define DBG(a)
+#undef PRINTING
+#endif
+
+// Priority of MsgActive object
+const TInt ECompoundPriority=1;
+
+
+// Operations that can be chained
+enum
+	{
+	EFinished=0,
+	ESelectSourceMailboxRW,
+	ESelectSourceMailboxRO,
+	ESelectDestinationMailboxRW,
+	ESelectDestinationMailboxRO,
+	EFetchMessage,
+	ECopyMessage,
+	EAppendMessage,
+	EDeleteMessage,
+	EDeleteLocalMessage,
+	EDeleteAllMessages,
+	ENewSyncFolder,
+	ESyncFolder,
+	EInboxDuplicateMove,
+	EInboxDuplicateCopy,
+	ECloseFolderWithoutExpunge,
+	EDeleteFolder,
+	EStartIdle,
+	EStopIdle,
+	ECreate,
+	ERename,
+	ESelectInbox
+	};
+
+//DS - Split EInboxDuplicate into EInboxDuplicateCopy and EInboxDuplicateMove to allow
+//use of either CMsvServerEntry::CopyL or MoveL depending on what operation the user
+//is attempting.
+
+CImImap4Compound::CImImap4Compound():CMsgActive(ECompoundPriority)
+	{
+	__DECLARE_NAME(_S("CImImap4Compound"));
+	}
+
+CImImap4Compound::~CImImap4Compound()
+	{
+	// We don't delete iSession as we don't own it, we were just passed it to use.
+	delete iSourceSel;
+	}
+
+CImImap4Compound* CImImap4Compound::NewL(CImImap4Session* aSession)
+	{
+	CImImap4Compound* self=new (ELeave) CImImap4Compound();
+	CleanupStack::PushL(self);
+
+	// Non-trivial constructor
+	self->ConstructL(aSession);
+	CleanupStack::Pop();
+	return self;
+	}
+
+// The non-trivial constructor
+void CImImap4Compound::ConstructL(CImImap4Session* aSession)
+	{
+	// Save session & entry
+	iSession=aSession;
+	
+	iPopulateCommand=EFalse;
+	iIdleBeforeFirstPopulate = EFalse;
+	// We're an active object...
+	CActiveScheduler::Add(this);
+
+	// Initialise static sequences. There must be a better way
+	// than this without causing complaints :-(
+	SeqCopyToLocal[0]=EStopIdle;
+	SeqCopyToLocal[1]=ESelectSourceMailboxRO;
+	SeqCopyToLocal[2]=EFetchMessage;
+	SeqCopyToLocal[3]=EInboxDuplicateCopy;
+	SeqCopyToLocal[4]=ESelectInbox;
+	SeqCopyToLocal[5]=EStartIdle;
+	SeqCopyToLocal[6]=EFinished;
+
+	SeqMoveToLocal[0]=EStopIdle;
+	SeqMoveToLocal[1]=ESelectSourceMailboxRW;
+	SeqMoveToLocal[2]=EFetchMessage;
+	SeqMoveToLocal[3]=EInboxDuplicateMove;
+	SeqMoveToLocal[4]=EDeleteMessage;
+	SeqMoveToLocal[5]=ESelectInbox;
+	SeqMoveToLocal[6]=EStartIdle;
+	SeqMoveToLocal[7]=EFinished;
+
+	SeqCopyWithinService[0]=EStopIdle;
+	SeqCopyWithinService[1]=ESelectSourceMailboxRO;
+	SeqCopyWithinService[2]=ECopyMessage;
+	SeqCopyWithinService[3]=ESelectDestinationMailboxRO;
+	SeqCopyWithinService[4]=ENewSyncFolder;
+	SeqCopyWithinService[5]=ESelectInbox;
+	SeqCopyWithinService[6]=EStartIdle;
+	SeqCopyWithinService[7]=EFinished;
+
+	SeqMoveWithinService[0]=EStopIdle;
+	SeqMoveWithinService[1]=ESelectSourceMailboxRW;
+	SeqMoveWithinService[2]=ECopyMessage;
+	SeqMoveWithinService[3]=EDeleteMessage;
+	SeqMoveWithinService[4]=ESelectDestinationMailboxRO;
+	SeqMoveWithinService[5]=ENewSyncFolder;
+	SeqMoveWithinService[6]=ESelectInbox;
+	SeqMoveWithinService[7]=EStartIdle;
+	SeqMoveWithinService[8]=EFinished;
+
+	SeqCopyFromLocal[0]=EAppendMessage;
+	SeqCopyFromLocal[1]=ESelectDestinationMailboxRO;
+	SeqCopyFromLocal[2]=ENewSyncFolder;
+	SeqCopyFromLocal[3]=EFinished;
+
+	SeqMoveFromLocal[0]=EStopIdle;
+	SeqMoveFromLocal[1]=EAppendMessage;
+	SeqMoveFromLocal[2]=EDeleteLocalMessage;
+	SeqMoveFromLocal[3]=ESelectDestinationMailboxRO;
+	SeqMoveFromLocal[4]=ENewSyncFolder;
+	SeqMoveFromLocal[5]=ESelectInbox;
+	SeqMoveFromLocal[6]=EStartIdle;
+	SeqMoveFromLocal[7]=EFinished;
+
+	SeqDelete[0]=EStopIdle;
+	SeqDelete[1]=ESelectSourceMailboxRW;
+	SeqDelete[2]=EDeleteMessage; // Explicit expunge
+	SeqDelete[3]=ESelectInbox;
+	SeqDelete[4]=EStartIdle;
+	SeqDelete[5]=EFinished;
+
+	SeqDeleteFolder[0]=EStopIdle;
+	SeqDeleteFolder[1]=ESelectSourceMailboxRW;
+	SeqDeleteFolder[2]=EDeleteAllMessages;
+	SeqDeleteFolder[3]=ECloseFolderWithoutExpunge;
+	SeqDeleteFolder[4]=EDeleteFolder;
+	SeqDeleteFolder[5]=ESelectInbox;
+	SeqDeleteFolder[6]=EStartIdle;
+	SeqDeleteFolder[7]=EFinished;
+
+	SeqNewSync[0]=EStopIdle;
+	SeqNewSync[1]=ESelectSourceMailboxRW;
+	SeqNewSync[2]=ENewSyncFolder;
+	SeqNewSync[3]=ESelectInbox;
+	SeqNewSync[4]=EStartIdle;
+	SeqNewSync[5]=EFinished;
+
+	SeqFullSync[0]=EStopIdle;
+	SeqFullSync[1]=ESelectSourceMailboxRW;
+	SeqFullSync[2]=ESyncFolder;
+	SeqFullSync[3]=ESelectInbox;
+	SeqFullSync[4]=EStartIdle;
+	SeqFullSync[5]=EFinished;
+
+	SeqSelect[0]=EStopIdle;
+	SeqSelect[1]=ESelectSourceMailboxRW;
+	SeqSelect[2]=EFinished;
+
+	SeqSynchronise[0]=EStopIdle;
+	SeqSynchronise[1]=ESyncFolder;
+	SeqSynchronise[2]=ESelectInbox;
+	SeqSynchronise[3]=EStartIdle;
+	SeqSynchronise[4]=EFinished;
+
+	SeqCreate[0]=EStopIdle;
+	SeqCreate[1]=ECreate;
+	SeqCreate[2]=ESelectInbox;
+	SeqCreate[3]=EStartIdle;
+	SeqCreate[4]=EFinished;
+
+	SeqRename[0]=EStopIdle;
+	SeqRename[1]=ERename;
+	SeqRename[2]=ESelectInbox;
+	SeqRename[3]=EStartIdle;
+	SeqRename[4]=EFinished;
+
+	// operations when done as part of a synchronisation process
+	SeqSyncCopyToLocal[0]=EFetchMessage;
+	SeqSyncCopyToLocal[1]=EInboxDuplicateCopy;
+	SeqSyncCopyToLocal[2]=EFinished;
+	}
+
+// Set a new session
+void CImImap4Compound::SetSession(CImImap4Session* aSession)
+	{
+	iSession=aSession;
+	}
+
+// Set entry for access to server's database
+void CImImap4Compound::SetEntry(CMsvServerEntry* aEntry)
+	{
+	iEntry=aEntry;
+	}
+
+// Do setentry, leave if there is an error
+void CImImap4Compound::SetEntryL(const TMsvId aId)
+	{
+#ifdef PRINTING
+	TInt error=iEntry->SetEntry(aId);
+	if (error)
+		iSession->LogText(_L8("SetEntryL(%x) returned %d"),aId,error);
+	User::LeaveIfError(error);
+#else
+	User::LeaveIfError(iEntry->SetEntry(aId));
+#endif
+	}
+
+
+// Called when async child completes
+void CImImap4Compound::DoRunL()
+	{
+	DBG((iSession->LogText(_L8("COMPOUND dorunl, step %d, status=%d"),iStep,iStatus.Int())));
+
+	// Are we still connected? Worth checking...
+	if (!iSession->Connected())
+		{
+		Complete(KErrDisconnected);
+		return;
+		}
+
+	// Any error from last operation?
+	if (iStep>0 && iStatus.Int()!=KErrNone)
+		{
+		switch(iSequence[iStep-1])
+			{
+		// If we get KErrIMAPNO from a selection state, we need to report this as KErrNotFound
+		case ESelectSourceMailboxRW:
+		case ESelectSourceMailboxRO:
+		case ESelectDestinationMailboxRW:
+		case ESelectDestinationMailboxRO:
+		case ESelectInbox:
+			if (iStatus.Int()==KErrIMAPNO)
+				{
+				Complete(KErrNotFound);
+				break;
+				}
+
+			// Fall through
+
+		default:
+			// Complete with this error
+			Complete(iStatus.Int());
+			break;
+			}
+
+		// Reset step (shouldn't really be necessary, but it looks neat!)
+		iStep=0;
+		return;
+		}
+
+	while (!IsActive() && !DoRunLoopL())
+		{
+		// do nothing in the body of this
+		}
+	}
+
+// Called when async child completes
+TBool CImImap4Compound::DoRunLoopL()
+	{
+        DBG((iSession->LogText(_L8("CImImap4Compound::DoRunLoopL(): step to execute: %d"), iSequence[iStep])));
+
+	switch(iSequence[iStep++])
+		{
+	case EFinished:
+		// All done
+		DBG((iSession->LogText(_L8("COMPOUND finished"))));
+
+		Complete(KErrNone);
+		iStep=0;
+		return ETrue;
+
+	case ESelectSourceMailboxRW:
+		iSession->Select(iStatus,iSourceFolder,ETrue);
+		break;
+
+	case ESelectSourceMailboxRO:
+		iSession->Select(iStatus,iSourceFolder,EFalse);
+		break;
+
+	case ESelectDestinationMailboxRW:
+		iSession->Select(iStatus,iDestinationFolder,ETrue);
+		break;
+
+	case ESelectDestinationMailboxRO:
+		iSession->Select(iStatus,iDestinationFolder,EFalse);
+		break;
+
+	case ESelectInbox:
+		{
+		// Selecting inbox before starting IDLE command
+		if (iSession->ImapIdleSupported()==EFalse || iIdleBeforeCommand==EFalse || iIdleBeforeFirstPopulate == EFalse || iMsgCount > 0)
+			{
+			return EFalse;
+			}
+
+		TMsvId inbox = iSession->GetInbox();
+                DBG((iSession->LogText(_L8("CImImap4Compound::DoRunLoopL(): selecting inbox"))));
+		iSession->Select(iStatus,inbox,ETrue);
+		break;
+		}
+
+	case ECreate:
+		iSession->Create(iStatus,iSource,iLeafName,iFolder);
+		break;
+
+	case ERename:
+		iSession->Rename(iStatus,iSource,iLeafName);
+		break;
+
+	case EFetchMessage:
+		{
+		// Don't fetch the message if it is marked for delete
+		SetEntryL(iSource);
+
+		TMsvEmailEntry entry = static_cast<TMsvEmailEntry> (iEntry->Entry()); 
+		
+		if (((TMsvEmailEntry)iEntry->Entry()).DisconnectedOperation() == EDisconnectedDeleteOperation)
+			return EFalse;
+
+		// Don't attempt to fetch the message if it has either been fully or partially downloaded, unless this is a populate command.
+        if ( entry.Complete() && entry.PartialDownloaded() && !iPopulateCommand )
+   			return EFalse;
+
+		// We fetch to the mirror in all cases
+                DBG((iSession->LogText(_L8("CImImap4Compound::DoRunLoopL(): fetching message"))));
+		iSession->FetchBody(iStatus,iSource,iGetPartialMailInfo);
+		
+		break;
+		}
+
+	case ECopyMessage:
+		if (iSequence==SeqCopyWithinService || iSequence==SeqMoveWithinService)
+			{
+			if (iSelectionStillToCopy-->0) 
+				{
+				 // Copy all messages before moving onto next step.
+				iSession->Copy(iStatus,(*iSourceSel)[iSelectionStillToCopy],iDestinationFolder,ETrue);
+				if (iSelectionStillToCopy>0)
+					iStep--; // still copying.
+				}
+			}
+		else
+			iSession->Copy(iStatus,iSource,iDestinationFolder,ETrue);
+		break;
+
+	case EAppendMessage:
+		iSession->Append(iStatus,iSource,iDestinationFolder);
+		break;
+
+	case EDeleteMessage:
+		// Deletes a message remotely
+		if (iSequence==SeqMoveWithinService && iSession->CommandFailure()==KErrIMAPNO)
+			{
+			DBG((iSession->LogText(_L8("Copy failed, Cancelling Delete"))));
+			// Copy failed, so do not continue with delete.
+			return EFalse;
+			}
+		
+		if (iSelectionStillToDelete>1)
+			iSession->Delete(iStatus,*iSourceSel);
+		else
+			iSession->Delete(iStatus,iSource);
+		iSelectionStillToDelete=0;
+		break;
+
+	case EDeleteLocalMessage:
+		// Deletes a message locally: only for messages not within the service
+		iSession->DeleteMessageL(iSource);
+
+		// As this is an instant operation, loop
+		return EFalse;
+
+	case EDeleteAllMessages:
+		// Deletes all messages/folder (must have no subfolders)
+		iSession->DeleteAllMessagesL(iStatus);
+		break;
+
+	case EDeleteFolder:
+		// Delete the folder
+		iSession->Delete(iStatus,iSourceFolder);
+		break;
+
+	case ENewSyncFolder:
+		// New only sync.
+
+		// if the current folder hasn't actually changed then don't
+		// bother with the Sync
+		if (!iSession->FolderChanged())
+			return EFalse;
+		
+		// This used to do just that, new only messages, but it causes a lot of problems 
+		// with sync limits, as for that to work deletes need to be taken into account also.
+		// This will fix that.
+                DBG((iSession->LogText(_L8("CImImap4Compound::DoRunLoopL(): ESyncNewFolder: synchronising"))));
+		iSession->Synchronise(iStatus,EFalse);
+		break;
+
+	case ESyncFolder:
+		// Full sync
+                DBG((iSession->LogText(_L8("CImImap4Compound::DoRunLoopL(): ESyncFolder: synchronising"))));
+		iSession->Synchronise(iStatus,EFalse);
+		break;
+
+	case ECloseFolderWithoutExpunge:
+		// Close current folder
+		iSession->Close(iStatus,EFalse);
+		break;
+
+	case EInboxDuplicateCopy:
+	case EInboxDuplicateMove:
+		{
+		// SJM: if we asked to fetch to the mirror then we can skip
+		// this stage
+		if (iDestinationFolder == KMsvNullIndexEntryId)
+			{
+			return EFalse;
+			}
+		
+		// Move the message to the destination (the local inbox) then duplicate it
+		// back to the original folder for the mirror.
+		iEntry->SetEntry(iSource);
+		TMsvId sourcefolder=iEntry->Entry().Parent();
+
+		// Do the move & copy back structure: we update iSource here as the message
+		// in the mirror is actually a recreated one with a new TMsvId. We may want
+		// to delete this (if we're doing a MoveToLocal, for example) and so we need
+		// the correct TMsvId
+		
+#if 1
+		// always copy so that on a move the delete happens on the original correctly
+		iSession->CopyMessage(iStatus,sourcefolder,iSource,iDestinationFolder,
+							  &iSource,EFalse);
+#else
+		//DS - Added the iSequence[iStep]==EInboxDuplicateMove to represent whether or not
+		//to remove the original (i.e. copy or move).
+		iSession->CopyMessage(iStatus,sourcefolder,iSource,iDestinationFolder,
+							  &iSource,iSequence[iStep-1]==EInboxDuplicateMove);
+#endif
+		break;
+		}
+
+	case EStartIdle:
+		 // if there are more messages(iMsgCount) to populate don't go to IDLE state.
+		if (iSession->ImapIdleSupported()==EFalse || iIdleBeforeCommand==EFalse || iIdleBeforeFirstPopulate == EFalse || iMsgCount > 0)
+			{
+			return EFalse;
+			}
+                DBG((iSession->LogText(_L8("CImImap4Compound::DoRunLoopL(): EStartIdle: calling StartIdle()"))));
+        iIdleBeforeFirstPopulate = EFalse;
+		iSession->StartIdle(iStatus);
+		break;
+
+	case EStopIdle:
+		if (iSession->ImapIdleSupported()==EFalse || iSession->IsIdling()==EFalse)
+			{
+                        DBG((iSession->LogText(_L8("CImImap4Compound::DoRunLoopL(): EStopIdle: not idling or waitng for idle"))));
+			iIdleBeforeCommand = EFalse;
+		
+			// If last message being fetched , then should start IDLE after that.
+			if (iMsgCount == 1 )
+				{
+				iIdleBeforeCommand = ETrue;	
+				}
+
+			return EFalse;
+			}
+		
+ 		iIdleBeforeFirstPopulate = ETrue;//Are we "IDLE" before first populate..
+		iIdleBeforeCommand = ETrue;
+                DBG((iSession->LogText(_L8("CImImap4Compound::DoRunLoopL(): EStopIdle: Calling StopIdle()"))));
+		iSession->StopIdle(iStatus);
+		break;
+
+	default:
+		gPanic(EUnknownState);
+		return ETrue;
+		}
+
+	// Next step in sequence...
+        DBG((iSession->LogText(_L8("CImImap4Compound::DoRunLoopL(): Setting active"))));
+	SetActive();
+	return EFalse;
+	}
+
+// Called when parent wants to cancel us
+void CImImap4Compound::DoCancel()
+	{
+	DBG((iSession->LogText(_L8("CImImap4Compound::DoCancel()"))));
+
+	// Cancel any session object we're using
+	switch( iSequence[iStep-1] )
+		{
+	case EStopIdle:
+	case ESelectSourceMailboxRO:
+	case EFetchMessage:
+	case EInboxDuplicateCopy:
+	case ESelectInbox:
+	case EStartIdle:
+		{
+		TRAP_IGNORE(iSession->CancelAndIdleL(iIdleBeforeFirstPopulate));
+		} break;
+		
+	default:
+		iSession->Cancel();
+		}
+
+	iIdleBeforeFirstPopulate = EFalse;
+	iMsgCount = 0;
+	// ...and parent
+	CMsgActive::DoCancel();
+	}
+
+// Store an offline operation in the correct place
+TMsvId CImImap4Compound::FindFolderL(const TMsvId aMessage)
+	{
+	DBG((iSession->LogText(_L8("FindFolderL(%x)"),aMessage)));
+
+	// Find folder that encloses this message (has Mailbox flag set), or service,
+	// whichever we find first
+	SetEntryL(aMessage);
+	TMsvEmailEntry entry;
+	do
+		{
+		// Visit this entry
+		SetEntryL(iEntry->Entry().Parent());
+		entry=iEntry->Entry();
+
+		DBG((iSession->LogText(_L8("  At %x, type=%x, mailbox=%d"),entry.Id(),entry.iType,entry.Mailbox())));
+
+		// A folder & a mailbox, or a service?
+		if (entry.iType==KUidMsvFolderEntry &&
+			entry.Mailbox())
+			{
+			// This'll do!
+			return(entry.Id());
+			}
+		}
+	while(iEntry->Entry().iType!=KUidMsvServiceEntry && entry.Id()!=KMsvRootIndexEntryId);
+
+	DBG((iSession->LogText(_L8("  Failed"))));
+
+	return(NULL);
+	}
+
+void CImImap4Compound::GenericCopyL(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination, TInt* aSequence)
+	{
+        DBG((iSession->LogText(_L8("CImImap4Compound::GenericCopyL()"))));
+ 	Queue(aStatus);
+
+	// Save parameters
+	iSource=aSource;
+	iDestinationFolder=aDestination;
+	iSourceFolder=FindFolderL(iSource);
+	iMessageSelection=iSelectionStillToCopy=iSelectionStillToDelete=-1;
+
+	// Find the offending source folder
+	if (iSourceFolder == NULL &&
+		aSequence != SeqMoveFromLocal && aSequence != SeqCopyFromLocal)
+		{
+		Complete(KErrNotFound);
+		return;
+		}
+
+	// Select it
+	iStep=0;
+	iSequence=aSequence;
+	DoRunL();
+	}
+
+void CImImap4Compound::GenericCopyL(TRequestStatus& aStatus, const CMsvEntrySelection& aSourceSel, const TMsvId aDestination, TInt* aSequence)
+	{
+	DBG((iSession->LogText(_L8("CImImap4Compound::GenericCopyL()"))));
+ 	Queue(aStatus);
+
+	// Save parameters
+	iSource=aSourceSel[0];
+	delete iSourceSel;
+	iSourceSel = NULL;
+	iSourceSel=aSourceSel.CopyL();
+	iDestinationFolder=aDestination;
+	iMessageSelection=iSelectionStillToCopy=iSelectionStillToDelete=aSourceSel.Count();
+
+	// Check that selection elements are contiguous. Just call Copy on contiguous selections.
+	
+	iSourceFolder=FindFolderL((*iSourceSel)[iSelectionStillToCopy-1]);
+
+	// Find the offending source folder
+	if (iSourceFolder == NULL &&
+		aSequence != SeqMoveFromLocal && aSequence != SeqCopyFromLocal)
+		{
+		Complete(KErrNotFound);
+		return;
+		}
+
+	// Select it
+	iStep=0;
+	iSequence=aSequence;
+	DoRunL();
+	}
+
+// CopyToLocal
+void CImImap4Compound::CopyToLocalL(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination)
+	{
+	LOG_COMMANDS((iSession->LogText(_L8("COMPOUND CopyToLocal(%x to %x)"),aSource,aDestination)));
+
+	iPopulateCommand=EFalse;
+	
+	UpdatePartialMailInfoToDefaults(aDestination);
+
+	// Kick off the copy	
+	GenericCopyL(aStatus,aSource,aDestination,SeqCopyToLocal);		
+	}
+
+void CImImap4Compound::PopulateL(TRequestStatus& aStatus, const TMsvId aSource, TImImap4GetPartialMailInfo aGetPartialMailInfo)
+	{
+	LOG_COMMANDS((iSession->LogText(_L8("COMPOUND Populate(%x,%d)"),aSource,aGetPartialMailInfo.iGetMailBodyParts)));
+	
+	iPopulateCommand = ETrue;
+	// Set options and kick off the copy to ourselves
+	iGetPartialMailInfo = aGetPartialMailInfo;
+	GenericCopyL(aStatus,aSource,KMsvNullIndexEntryId,SeqCopyToLocal);
+	
+	if(iMsgCount > 0)
+		{
+		iMsgCount--;	
+		}
+	
+	}
+
+// MoveToLocal
+void CImImap4Compound::MoveToLocalL(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination)
+	{
+	LOG_COMMANDS((iSession->LogText(_L8("COMPOUND MoveToLocal(%x to %x)"),aSource,aDestination)));
+
+
+	//Partial populate option is implemented only for the populate command. moving a partially
+	//populated message will delete the unpopulated message from the remote server. UI takes care 
+	// of notifying this and ask for confirmation whether user still wants to move the message.
+
+	iPopulateCommand=EFalse;
+	
+	UpdatePartialMailInfoToDefaults(aDestination);
+
+	// We can't do a MoveToLocal if the destination is in the service: this possibility
+	// if filtered out by the things calling us, so we don't have to worry about it here.
+	// We know the destination is therefore a local folder.
+	GenericCopyL(aStatus,aSource,aDestination,SeqMoveToLocal);
+	}
+
+// CopyWithinService
+void CImImap4Compound::CopyWithinServiceL(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination)
+	{
+	LOG_COMMANDS((iSession->LogText(_L8("COMPOUND CopyWithinService(%x to %x)"),aSource,aDestination)));
+
+	GenericCopyL(aStatus,aSource,aDestination,SeqCopyWithinService);
+	}
+
+void CImImap4Compound::CopyWithinServiceL(TRequestStatus& aStatus, const CMsvEntrySelection& aSourceSel, const TMsvId aDestination)
+	{
+	LOG_COMMANDS((iSession->LogText(_L8("COMPOUND CopyWithinService(to %x)"),aDestination)));
+
+	GenericCopyL(aStatus,aSourceSel,aDestination,SeqCopyWithinService);
+	}
+
+// MoveWithinService
+void CImImap4Compound::MoveWithinServiceL(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination)
+	{
+	LOG_COMMANDS((iSession->LogText(_L8("COMPOUND MoveWithinService(%x to %x)"),aSource,aDestination)));
+
+	GenericCopyL(aStatus,aSource,aDestination,SeqMoveWithinService);
+	}
+
+void CImImap4Compound::MoveWithinServiceL(TRequestStatus& aStatus, const CMsvEntrySelection& aSourceSel, const TMsvId aDestination)
+	{
+	LOG_COMMANDS((iSession->LogText(_L8("COMPOUND MoveWithinService(to %x)"),aDestination)));
+
+	GenericCopyL(aStatus,aSourceSel,aDestination,SeqMoveWithinService);
+	}
+
+// CopyFromLocal
+void CImImap4Compound::CopyFromLocalL(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination)
+	{
+	LOG_COMMANDS((iSession->LogText(_L8("COMPOUND CopyFromLocal(%x to %x)"),aSource,aDestination)));
+
+	GenericCopyL(aStatus,aSource,aDestination,SeqCopyFromLocal);
+	}
+
+// MoveFromLocal
+void CImImap4Compound::MoveFromLocalL(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination)
+	{
+	LOG_COMMANDS((iSession->LogText(_L8("COMPOUND MoveFromLocal(%x to %x)"),aSource,aDestination)));
+
+	GenericCopyL(aStatus,aSource,aDestination,SeqMoveFromLocal);
+	}
+
+// SyncCopyToLocal
+void CImImap4Compound::SyncCopyToLocalL(TRequestStatus& aStatus, const TMsvId aSource, const TMsvId aDestination)
+	{
+	LOG_COMMANDS((iSession->LogText(_L8("COMPOUND SyncCopyToLocal(%x to %x)"),aSource,aDestination)));
+
+	iPopulateCommand=EFalse;
+	
+	UpdatePartialMailInfoToDefaults(aDestination);
+
+	// Kick off the copy	
+	GenericCopyL(aStatus,aSource,aDestination,SeqSyncCopyToLocal);		
+	}
+
+// Delete
+void CImImap4Compound::DeleteL(TRequestStatus& aStatus, const TMsvId aSource)
+	{
+	LOG_COMMANDS((iSession->LogText(_L8("COMPOUND Delete(%x)"),aSource)));
+
+	Queue(aStatus);
+
+	// Save parameters
+	iSource=aSource;
+	iMessageSelection=iSelectionStillToDelete=1;
+
+	// Find the offending source folder
+	if ((iSourceFolder=FindFolderL(iSource))==NULL)
+		{
+		Complete(KErrNotFound);
+		return;
+		}
+
+	// Select it
+	iStep=0;
+	iSequence=SeqDelete;
+	DoRunL();
+	}
+
+// Delete
+void CImImap4Compound::DeleteL(TRequestStatus& aStatus, const CMsvEntrySelection& aSourceSel)
+	{
+	LOG_COMMANDS( (iSession->LogText(_L8("COMPOUND Delete selection"))));
+
+	Queue(aStatus);
+
+	// Save parameters
+	iSource=aSourceSel[0];
+	delete iSourceSel;
+	iSourceSel = NULL;
+	iSourceSel=aSourceSel.CopyL();
+	iMessageSelection=iSelectionStillToDelete=aSourceSel.Count();
+
+	// Find the offending source folder
+	if ((iSourceFolder=FindFolderL(iSource))==NULL)
+		{
+		Complete(KErrNotFound);
+		return;
+		}
+
+	// Select it
+	iStep=0;
+	iSequence=SeqDelete;
+	DoRunL();
+	}
+
+// Delete all in folder, then folder itself
+void CImImap4Compound::DeleteFolderL(TRequestStatus& aStatus, const TMsvId aSource)
+	{
+	LOG_COMMANDS((iSession->LogText(_L8("COMPOUND DeleteFolder(%x)"),aSource)));
+
+	Queue(aStatus);
+
+	// Save parameters
+	iSourceFolder=aSource;
+	iSequence=SeqDeleteFolder;
+
+	// The folder might be a mailbox (in which case it needs selecting, messages
+	// deleting, closing, then deletion of the folder) or it might be a \Noselect
+	// folder, which we just delete.
+	User::LeaveIfError(iEntry->SetEntry(aSource));
+	TMsvEmailEntry folder=iEntry->Entry();
+	if (!folder.Mailbox())
+		{
+		DBG((iSession->LogText(_L8("Folder is marked \\NoSelect: just delete it"))));
+
+		// Skip the first few steps
+		iStep=2;
+		}
+	else
+		{
+		DBG((iSession->LogText(_L8("Folder is a mailbox: deleting messages and folder"))));
+
+		// Start from folder selection
+		iStep=0;
+		}
+
+	DoRunL();
+	}
+
+void CImImap4Compound::CreateL(TRequestStatus& aStatus, const TMsvId aParent, const TDesC& aLeafName, const TBool aFolder)
+	{
+	LOG_COMMANDS((iSession->LogText(_L8("COMPOUND Create(%x)"),aParent)));
+
+	Queue(aStatus);
+
+	iStep=0;
+	iSequence=SeqCreate;
+	iSource=aParent;
+	iLeafName=aLeafName;
+	iFolder=aFolder;
+	DoRunL();	
+	}
+
+void CImImap4Compound::RenameL(TRequestStatus& aStatus, const TMsvId aTarget, const TDesC& aNewName)
+	{
+	LOG_COMMANDS((iSession->LogText(_L8("COMPOUND Rename(%x)"),aTarget)));
+
+	Queue(aStatus);
+
+	iStep=0;
+	iSequence=SeqRename;
+	iSource=aTarget;
+	iLeafName=aNewName;
+	DoRunL();	
+	}
+
+void CImImap4Compound::SynchroniseL(TRequestStatus& aStatus)
+	{
+	LOG_COMMANDS((iSession->LogText(_L8("COMPOUND Synchronise"))));
+
+	Queue(aStatus);
+
+	iStep=0;
+	iSequence=SeqSynchronise;
+	DoRunL();	
+	}
+
+void CImImap4Compound::SelectL(TRequestStatus& aStatus, const TMsvId aFolder)
+	{
+	LOG_COMMANDS((iSession->LogText(_L8("COMPOUND Select(%x)"),aFolder)));
+
+	Queue(aStatus);
+
+	iStep=0;
+	iSequence=SeqSelect;
+	iSourceFolder=aFolder;
+	DoRunL();
+	}
+
+void CImImap4Compound::NewOnlySyncL(TRequestStatus& aStatus, const TMsvId aFolder)
+	{
+	LOG_COMMANDS((iSession->LogText(_L8("COMPOUND NewOnlySync(%x)"),aFolder)));
+
+	Queue(aStatus);
+
+	if (iSession->ImapIdleSupported())
+		{
+		// Igmore sync as Imap Idle is supported
+		Complete(KErrNone);
+		return;
+		}
+
+	// Check folder is a mailbox
+	User::LeaveIfError(iEntry->SetEntry(aFolder));
+	TMsvEmailEntry mbcheck=iEntry->Entry();
+	if (!mbcheck.Mailbox())
+		{
+		// Not a mailbox, so we can't sync it
+		Complete(KErrNotSupported);
+		return;
+		}
+
+	// Select it
+	iStep=0;
+	iSequence=SeqNewSync;
+	iSourceFolder=aFolder;
+	DoRunL();
+	}
+
+void CImImap4Compound::FullSyncL(TRequestStatus& aStatus, const TMsvId aFolder)
+	{
+	LOG_COMMANDS((iSession->LogText(_L8("COMPOUND FullSync(%x)"),aFolder)));
+
+	Queue(aStatus);
+
+	// Check folder is a mailbox
+	User::LeaveIfError(iEntry->SetEntry(aFolder));
+	TMsvEmailEntry mbcheck=iEntry->Entry();
+	if (!mbcheck.Mailbox())
+		{
+		do
+			{
+			// Ensure visibility
+			if (!mbcheck.Visible())
+				{
+				mbcheck.SetVisible(ETrue);
+				User::LeaveIfError(iEntry->ChangeEntryBulk(mbcheck));
+				}
+
+			// Move up one
+			User::LeaveIfError(iEntry->SetEntry(mbcheck.Parent()));
+			mbcheck=iEntry->Entry();
+			}
+		while(mbcheck.iType!=KUidMsvServiceEntry && mbcheck.Id()!=KMsvRootIndexEntryId);
+
+		// Not a mailbox, so we can't sync it
+		Complete(KErrNone);
+		return;
+		}
+
+	// Select it
+	iStep=0;
+	iSequence=SeqFullSync;
+	iSourceFolder=aFolder;
+	DoRunL();
+	}
+
+// Report progress
+TImap4GenericProgress CImImap4Compound::Progress()
+	{
+	// First, ask session (updates byte counts & stuff)
+	TImap4GenericProgress progress=iSession->Progress();
+	if (iSequence==SeqDelete || iSequence==SeqCopyWithinService)
+		{
+		progress.iMsgsToDo=iMessageSelection;
+		progress.iMsgsDone=iMessageSelection-iSelectionStillToCopy;
+		}
+	else if (iSequence==SeqMoveWithinService)
+		{
+		// DEL done in one go in imapsess, 
+		// just have progress for the COPY part of the MOVE command.
+		progress.iMsgsToDo=iMessageSelection;
+		progress.iMsgsDone=iMessageSelection-iSelectionStillToCopy;
+		}
+
+	// don't believe there's any point in modifying the operation
+	// since it'll be set correctly in the Mtm handler.
+#if 0
+	// Now, overlay our current operation (move or copy, at least)
+	if (iSequence==SeqCopyToLocal || iSequence==SeqCopyWithinService ||
+		iSequence==SeqCopyFromLocal)
+		progress.iOperation=TImap4Progress::ECopying;
+	else if (iSequence==SeqMoveToLocal || iSequence==SeqMoveWithinService ||
+			 iSequence==SeqMoveFromLocal)
+		progress.iOperation=TImap4Progress::EMoving;
+#endif
+
+	// Return the modified progress
+	return(progress);
+	}
+
+void CImImap4Compound::UpdatePartialMailInfoToDefaults(TMsvId aDestination)
+	{	
+	iGetPartialMailInfo.iTotalSizeLimit= KMaxTInt;
+	iGetPartialMailInfo.iBodyTextSizeLimit = KMaxTInt;
+	iGetPartialMailInfo.iAttachmentSizeLimit = KMaxTInt;
+	iGetPartialMailInfo.iGetMailBodyParts = EGetImap4EmailBodyTextAndAttachments;		 
+	iGetPartialMailInfo.iPartialMailOptions=ENoSizeLimits;
+	iGetPartialMailInfo.iDestinationFolder=aDestination;
+	}
+
+void CImImap4Compound::SetMessageCount(const TInt aCount)
+	{
+	iMsgCount = aCount;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/src/IMAPIO.CPP	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,1128 @@
+// Copyright (c) 1998-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:
+// This deals with connection to the server, sending commands, and parsing the
+// returned server data. The data returned is buffered in iBuffer: this is
+// simply back-to-back data, with a tree which describes the structure
+// containing TPtrC's which identify the data belonging to each atom.
+// This class owns both the buffer and the tree, and deals with destroying them
+// as necessary. The client can request the base of the tree for it to parse
+// when a line has been received.
+// 980708 - modified to store flavour of ([ in parent atom
+// 980802 - partial read behavior modified (see release.txt)
+// 990112 - added cancel debug printing
+// 990304 - Tweaks to parsing of escape characters
+// 990415 - Now happy with ('s in the middle on non-quoted atoms.
+// This only generally happens with non-parsable text
+// (eg, after an OK response).
+// 
+//
+
+#include "imapio.h"
+#include "impspan.h"
+#include <imsk.h>
+#include <imcvtext.h>
+#include <msvstore.h>
+#include "imapsess.h"
+
+#define IMAPLOG
+
+#ifdef _DEBUG
+#define DBG(a) a
+#else
+#define DBG(a)
+#endif
+
+// Initial parser buffer size & granularity
+const TInt KIOBufferSize=1280;
+const TInt KIOBufferGranularity=256;
+
+// Specifies how long a socket is allowed to be inactive before we close it
+// down. This handles the situation where the mail server closes down the
+// connection, but we don't receive any indication of that. It has been seen
+// when connected using GPRS, and a long telephone call is then made.
+const TInt KImapSendInactivityTimeMinutes = 30;
+const TInt KImapReceiveInactivityTimeMinutes = 30;
+
+// The CImapAtom class contains a TPtrC which points to the data 'owned' by 
+// this atom in the buffer. It also contains next (sibling) and child pointers,
+// with which the tree is constructed.
+CImapAtom::CImapAtom()
+	{
+	__DECLARE_NAME(_S("CImapAtom"));
+	}
+
+CImapAtom::~CImapAtom()
+	{
+	}
+
+void CImapAtom::Set(const TDesC8& aAtom)
+	{
+	// Save this atom in here
+	iAtom.Set(aAtom);
+	}
+
+void CImapAtom::AddChild(CImapAtom *aNewChild)
+	{
+	// Set child pointer
+	iChild=aNewChild;
+	}
+
+void CImapAtom::AddNext(CImapAtom *aNewNext)
+	{
+	// Set next pointer
+	iNext=aNewNext;
+	}
+
+CImapAtom *CImapAtom::Child()
+	{
+	return(iChild);
+	}
+
+CImapAtom *CImapAtom::Next()
+	{
+	return(iNext);
+	}
+
+// ToChildL and ToNextL provide clients with a neat way of traversing the tree
+// in a direction that *should* exist: if it doesn't, a Leave occurs.
+CImapAtom *CImapAtom::ToChildL()
+	{
+	if (!iChild)
+		User::Leave(KErrNotFound);
+	return(iChild);
+	}
+
+CImapAtom *CImapAtom::ToNextL()
+	{
+	if (!iNext)
+		User::Leave(KErrNotFound);
+	return(iNext);
+	}
+
+// Makes things look neater: do a CompareF
+TBool CImapAtom::Compare(const TDesC8& aVal)
+	{
+	// Compare and return result
+	return(iAtom.CompareF(aVal)==0);
+	}
+
+// Compare the right hand side of the atom with the match string.
+TBool CImapAtom::CompareTail(const TDesC8& aVal)
+	{
+	if (aVal.Length() > iAtom.Length())
+		return EFalse;
+	TPtrC8 ptr = iAtom.Right(aVal.Length());
+	return(ptr.CompareF(aVal)==0);
+	}
+
+// Makes things look neater: lex a decimal atom to a TUint
+TInt CImapAtom::Value(TUint& aVal)
+	{
+	// Turn it into a value
+	TLex8 lex(iAtom);
+
+	return(lex.Val(aVal));
+	}
+
+// Makes things look neater: lex a decimal atom to a TInt
+TInt CImapAtom::Value(TInt& aVal)
+	{
+	// Turn it into a value
+	TLex8 lex(iAtom);
+
+	return(lex.Val(aVal));
+	}
+
+// Makes things look neater: lex a decimal atom to a TInt32
+TInt CImapAtom::Value(TInt32& aVal)
+	{
+	// Turn it into a value
+	TLex8 lex(iAtom);
+
+	return(lex.Val(aVal));
+	}
+
+// Return descriptor
+TPtrC8 CImapAtom::Atom()
+	{
+	return(iAtom);
+	}
+
+// Fixup descriptor pointers
+void CImapAtom::FixupL(const HBufC8 *aNewBuffer, const TText8 *aOldBuffer)
+	{
+   // Fixup descriptor pointers
+	CArrayFixFlat<CImapAtom*>* atomStack = new (ELeave) CArrayFixFlat<CImapAtom*>(10);
+	CleanupStack::PushL(atomStack);
+
+	atomStack->AppendL(this);
+	CImapAtom* currentAtom;
+	while (atomStack->Count() != 0)
+   		{
+		// Pop the top atom off of the stack
+		currentAtom = (*atomStack)[atomStack->Count() - 1];
+ 		atomStack->ResizeL(atomStack->Count() - 1);
+ 
+		// Fix up the current atom
+		if (currentAtom->Atom().Length()>0)
+			{
+			// Find offset from start of old buffer
+			TInt start=(currentAtom->Atom().Ptr()-aOldBuffer);
+
+ 			// Make new descriptor & assign it
+			TPtrC8 bufptr(aNewBuffer->Ptr()+start,currentAtom->Atom().Length());
+			currentAtom->iAtom.Set(bufptr); // Note that we are setting the real iAtom not the copy returned by Atom()
+			}
+ 
+		// Add the first sibling to the stack,
+		// subsequent siblings are added when this sibling is visited
+		CImapAtom* siblingAtom = currentAtom->Next();
+		if (siblingAtom)
+			atomStack->AppendL(siblingAtom);
+
+   
+		// Add child to the stack
+		CImapAtom* childAtom = currentAtom->Child();
+		if (childAtom)
+			atomStack->AppendL(childAtom);
+   		}
+   
+	CleanupStack::PopAndDestroy(atomStack);
+   	}
+
+// The IO processing class
+CImapIO::CImapIO(TInt aId) : CMsgActive(1), iBufferSize(KIOBufferSize), iAtomStack(8), iID(aId),iPrimaryTextServerSession(NULL)
+	{
+	__DECLARE_NAME(_S("CImapIO"));
+	}
+
+CImapIO::~CImapIO()
+	{
+	// Make sure we're cancelled
+	Disconnect();
+
+	delete iSession;
+
+	// Dispose of buffer
+	delete iBuffer;
+
+	// Delete any atom tree that may still exist
+	delete iRootAtom;
+
+	// Get rid of log
+	delete iImapLog;
+	// delete the atom array
+	iAtomArray.ResetAndDestroy();
+	}
+
+// Create and call non-trivial contructor
+CImapIO *CImapIO::NewLC(TInt aId)
+	{
+	CImapIO* self=new (ELeave) CImapIO(aId);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+
+CImapIO *CImapIO::NewL(TInt aId)
+	{
+	CImapIO* self=NewLC(aId);
+	CleanupStack::Pop();
+	return self;
+	}
+
+// The non-trivial constructor
+void CImapIO::ConstructL()
+	{
+	// Get initial buffer
+	iBuffer=HBufC8::NewL(iBufferSize);
+	
+	// We're an active object...
+	CActiveScheduler::Add(this);
+	}
+
+// Called when an asynchronous child exits with status>=0
+void CImapIO::DoRunL()
+	{
+	DBG((LogText(_L8("CImapIO::DoRunL(state=%d, status=%d)"),iState,iStatus.Int())));
+
+	switch(iState)
+		{
+	case EIOStateConnectQueued:
+		// Connect has finished: OK?
+		if (iStatus.Int()==KErrNone)
+			{
+			// Done! We're connected
+			iState=EIOStateConnected;
+			}
+		else
+			{
+			// Close connection and report fail
+			iSession->Disconnect();
+			}
+		break;
+
+	case EIOStateReadQueued:
+		// Process it
+		iState=EIOStateConnected;
+		iRXbytes+=iReceive.Length();
+		ProcessBufferL();
+		break;
+
+	case EIOStateWriteQueued:
+		// Sent! Return error code directly
+		iState=EIOStateConnected;
+		break;
+
+	case EIOStateConnected:
+	case EIOStateDisconnected:
+	case EIOStateDummyQueued:
+		// Never happens, but pleases the compiler
+		break;
+		}
+	}
+
+// Called when an asynchronous child exits with status <KErrNone
+void CImapIO::DoComplete(TInt& /*aStatus*/)
+	{
+	// note this message might not get reported if the socket has closed
+
+	// pass all status codes up as given. KErrNone and KErrEOL (1)
+	// will be ignored. All others will cause a disconnect either in
+	// CImImap4Session's IdleReadError(), DummyComplete() or DoComplete().
+	}	
+
+// Called when parent wants to cancel an operation
+void CImapIO::DoCancel()
+	{
+
+	DBG((LogText(_L8("CImapIO::DoCancel(state=%d)"),iState)));
+	
+	if (iSession)
+		{
+		// Cancel actions
+		switch(iState)
+			{
+		case EIOStateConnectQueued:
+			// Cancel session and disconnect
+			iSession->Cancel();
+			iState=EIOStateDisconnected;
+			break;
+
+		case EIOStateReadQueued:
+		case EIOStateWriteQueued:
+			// Cancel it at the session level: this will return the cancelled error
+			// upwards, which should cause the above DoComplete to return
+			iSession->Cancel();
+			iState=EIOStateConnected;
+			break;
+
+		case EIOStateConnected:
+		case EIOStateDisconnected:
+			// Never happens, but pleases the compiler
+			break;
+		case EIOStateDummyQueued:
+			break;
+			}
+		}
+	else
+		iState=EIOStateDisconnected;
+
+	// Get msgactive to finish up
+	CMsgActive::DoCancel();
+
+	DBG((LogText(_L8("CImapIO::DoCancel done"))));
+
+	}
+
+// Return the root atom
+CImapAtom *CImapIO::RootAtom()
+	{
+	// Return it
+	return(iRootAtom);
+	}
+
+// Deal with the atom stack: this is used when building the atom tree
+void CImapIO::PushL(CImapAtom *aAtom)
+	{
+	iAtomStack.AppendL(aAtom);
+	}
+
+CImapAtom *CImapIO::PopL()
+	{
+	// Check it isn't empty
+	if (iAtomStack.Count()==0)
+		User::Leave(KErrUnderflow);
+
+	TInt count = iAtomStack.Count();
+	CImapAtom* atom = iAtomStack[count-1];
+	iAtomStack.Delete(count-1);
+	return(atom);
+	}
+
+// Add to the parsed buffer
+void CImapIO::BufferAppendL(const TChar aChar)
+	{
+	// Does buffer need extending?
+	if (iBuffer->Length()==iBufferSize)
+		{
+		HBufC8 *oldbuffer=iBuffer;
+		const TText8 *oldbufptr=iBuffer->Ptr();
+
+		// Extend by granularity amount
+		iBufferSize+=KIOBufferGranularity;
+		iBuffer=iBuffer->ReAllocL(iBufferSize);
+
+		// Buffer moved?
+		if (iBuffer!=oldbuffer)
+			{
+			// Fixup buffer tree pointers
+			iRootAtom->FixupL(iBuffer,oldbufptr);
+			}
+		}
+
+	// Append the data
+	iBuffer->Des().Append(aChar);
+	}
+
+// Add the last atom appended to the buffer to the tree.
+void CImapIO::AddAtomL()
+	{
+	// Add it
+	AddAtomL(iBuffer->Length()-iAtomStart);
+	}
+
+// Add the last atom, given a length
+void CImapIO::AddAtomL(const TInt aLength)
+	{
+	// Note buffer position in an atom
+	TPtrC8 bufptr(iBuffer->Ptr()+iAtomStart,aLength);
+
+	// Make a new current atom
+	CImapAtom *newAtom=new (ELeave) CImapAtom();
+
+	iAtomArray.AppendL(newAtom);
+	// Set pointers in it
+	newAtom->Set(bufptr);
+
+	// Add it as a child/sibling to the current atom
+	if (iNextIsChild)
+		iAtom->AddChild(newAtom);
+	else
+		iAtom->AddNext(newAtom);
+
+	// The next item should be a sibling
+	iNextIsChild=EFalse;
+
+	// Make new current
+	iAtom=newAtom;
+	}
+
+// Process the received buffer, creating atoms as we go
+void CImapIO::ProcessBufferL()
+	{
+	// Process the buffer
+	TChar byte;
+
+	DBG((LogText(_L8("CImapIO::ProcessBuffer(iParserState=%d, Length=%d)"),iParserState,iReceive.Length())));
+
+	for(TInt pos=0;pos<iReceive.Length();pos++)
+		{
+		// Note that we've processed stuff
+		iBytesRead++;
+
+		// Byte to process
+		byte=iReceive[pos];
+
+		switch(iParserState)
+			{
+		case EIOStateAtomWait:
+			switch(byte)
+				{
+			case '(':
+			case '[':
+			case '<':
+				{
+				// Make a new current atom
+				CImapAtom *newAtom=new (ELeave) CImapAtom();
+
+				iAtomArray.AppendL(newAtom);
+				// Add it as a sibling to the current atom
+				if (iNextIsChild)
+					iAtom->AddChild(newAtom);
+				else
+					iAtom->AddNext(newAtom);
+
+				// The next item should be a child
+				iNextIsChild=ETrue;
+
+				// Push current atom onto atom stack, make new current
+				iAtom=newAtom;
+				PushL(iAtom);
+
+				// Store the open bracket in the buffer, so we can tell what it is
+				TPtrC8 bufptr(iBuffer->Ptr()+iBuffer->Length(),1);
+				BufferAppendL(byte);
+				iAtom->Set(bufptr);
+
+				break;
+				}
+
+			case ')':
+			case ']':
+				// End of this nesting level: pop last atom off stack and
+				// make it the new current one
+				iAtom=PopL();
+
+				// Any new atoms will be siblings, not children
+				iNextIsChild=EFalse;
+
+				break;
+
+			case '{':
+				// Start of a literal length
+				iLiteralLength=0;
+				iParserState=EIOStateLiteralLength;
+				break;
+
+			case ' ':
+				// Whitespace. Ignore! This state only happens with whitespace
+				// after a close )] or a endquote "
+				break;
+
+			case '\r':
+				// Newline after a close )] or endquote "
+				iParserState=EIOStateWaitLF;
+				break;
+
+			case '\"':
+				// Quotes: we don't keep them, so the atom starts at the next
+				// character.
+				iAtomStart=iBuffer->Length();
+				iParserState=EIOStateInAtom;
+				iParserQuoted=ETrue;
+				iGotEscape=EFalse;
+				break;
+
+			default:
+				// Start new atom in buffer
+				iAtomStart=iBuffer->Length();
+				BufferAppendL(byte);
+				iParserState=EIOStateInAtom;
+				iParserQuoted=EFalse;
+				break;
+				}
+			break;
+
+		case EIOStateInAtom:
+			if (iParserQuoted)
+				{
+				// Look for another quote
+				if (byte=='\"')
+					{
+					// Just had an escape character?
+					if (iGotEscape)
+						{
+						// Add the character
+						BufferAppendL(byte);
+						iGotEscape=EFalse;
+						}
+					else
+						{
+						// It's the terminator: Add the atom, minus the quotes
+						AddAtomL();
+						iParserState=EIOStateAtomWait;
+						}
+					}
+				// fix for INC51597 and DEF053082:if a " has been missed out by the server, this will end the atom at a \r
+				else if(!iGotEscape && byte == '\r')
+					{
+					AddAtomL();
+					iParserState = EIOStateWaitLF;
+					}
+				else
+					{
+					// Escape character?
+					if (!iGotEscape && byte=='\\')
+						{
+						// Got one
+						iGotEscape=ETrue;
+						}
+					else
+						{
+						// Add to buffer
+						BufferAppendL(byte);
+						iGotEscape=EFalse;
+						}
+					}
+				}
+			else
+				{
+				if (byte==' ' || byte=='\r')
+					{
+					AddAtomL();
+				
+					// Either go back to looking for an atom, or a LF
+					iParserState=(byte=='\r')?EIOStateWaitLF:EIOStateAtomWait;
+					}
+				else if (byte=='(' || byte=='[')
+					{
+					// Add this atom
+					AddAtomL();
+
+					// Make a new current atom
+					CImapAtom *newAtom=new (ELeave) CImapAtom();
+					iAtomArray.AppendL(newAtom);
+
+					// Add it as a sibling to the current atom
+					if (iNextIsChild)
+						iAtom->AddChild(newAtom);
+					else
+						iAtom->AddNext(newAtom);
+
+					// The next item should be a child
+					iNextIsChild=ETrue;
+
+					// Push current atom onto atom stack, make new current
+					iAtom=newAtom;
+					PushL(iAtom);
+
+					// Store the open bracket in the buffer, so we can tell what it is
+					TPtrC8 bufptr(iBuffer->Ptr()+iBuffer->Length(),1);
+					BufferAppendL(byte);
+					iAtom->Set(bufptr);
+
+					iParserState=EIOStateAtomWait;
+					}
+				else if (byte==')' || byte==']' || byte == '>')
+					{
+					// Although these bytes usually indicate the end of an atom,
+					// they can also legitimately appear in a text field.
+					// If this is the end of an atom, then it must be a child or
+					// sibling atom in which case there will be an entry on the atom
+					// stack. If there is no entry on the atom stack, then this must
+					// be a text field so just add the byte to the buffer.
+					if (iAtomStack.Count() > 0)
+						{
+						// Add this atom
+						AddAtomL();
+
+						// End of this nesting level: pop last atom off stack and
+						// make it the new current one
+						iAtom=PopL();
+
+						// Any new atoms will be siblings, not children
+						iNextIsChild=EFalse;
+
+						iParserState=EIOStateAtomWait;
+						}
+					else
+						{
+						BufferAppendL(byte);
+						}
+					}
+				else
+					{
+					// Add to buffer
+					BufferAppendL(byte);
+					}
+				}
+			break;
+
+		case EIOStateWaitLF:
+			// After LF, this is end of line, finish!
+			if (byte=='\n')
+				{
+				// Remove everything from the buffer, we've finished
+				iReceive.Delete(0,pos+1);
+
+				// Reset bytes read count & complete
+				iBytesRead=0;
+
+				// Complete with KErrFoundEOL
+				DBG((LogText(_L8("CImapIO::ProcessBuffer: Complete in EIOStateWaitLF"))));
+				Complete(KErrFoundEOL);
+				return;
+				}
+			break;
+
+		case EIOStateLiteralLength:
+			// Digit?
+			if (byte.IsDigit())
+				{
+				// Add it to the total
+				iLiteralLength=(iLiteralLength*10)+(byte-(TChar)'0');
+				if (iLiteralLength <0)
+					User::Leave(KErrCorrupt);
+				}
+			else if (byte=='}')
+				{
+				// Need to skip CR, LF
+				iLiteralSkip=2;
+				iParserState=EIOStateLiteralSkip;
+
+				// Add the atom (with the length we know, but no data) to the
+				// structure now, so that the partial structure can be parsed.
+				iAtomStart=iBuffer->Length();
+				AddAtomL(iLiteralLength);
+				}
+			break;
+
+		case EIOStateLiteralSkip:
+			// Skipping...
+			if (--iLiteralSkip==0)
+				{
+				// Is literal 0 bytes long?
+				if (iLiteralLength==0)
+					{
+					// Nothing to follow
+					iParserState=EIOStateAtomWait;
+					}
+				else
+					{
+					// Non-empty literal: go into fetch state
+					iParserState=EIOStateLiteralFetch;
+					}
+				}
+			break;
+
+		case EIOStateLiteralFetch:
+			// Fetching
+			
+			TInt fetchLength(0);
+			if(KReceiveBuffer<iLiteralLength)
+				{
+				fetchLength = KReceiveBuffer;
+				}
+			else
+				{
+				fetchLength = iLiteralLength;
+				}
+			
+			if(fetchLength > iReceive.Length()-pos)
+				{
+				fetchLength = iReceive.Length()-pos;
+				}
+// 			need to extend buffer ?
+			DBG((LogText(_L8(">>> CImapIO::ProcessBufferL(1):buflen=%d:buffsize=%d:litlen=%d:fetchlen=%d"), iBuffer->Length(),iBufferSize, iLiteralLength,fetchLength)));
+			if (iBuffer->Length() + iLiteralLength > iBufferSize)
+				{
+				HBufC8 *oldbuffer=iBuffer;
+				const TText8 *oldbufptr=iBuffer->Ptr();
+			
+				// Extend by extra amount + round up by KIOBufferGranularity
+				iBufferSize += iLiteralLength;
+				iBufferSize += (KIOBufferGranularity - (iBufferSize % KIOBufferGranularity));
+				iBuffer=iBuffer->ReAllocL(iBufferSize);
+
+				// Buffer moved?
+				if (iBuffer!=oldbuffer)
+					{
+					// Fixup buffer tree pointers
+					iRootAtom->FixupL(iBuffer,oldbufptr);
+					}
+				DBG((LogText(_L8(">>> CImapIO::ProcessBufferL(2):buflen=%d:buffsize=%d:litlen=%d:fetchlen=%d"), iBuffer->Length(),iBufferSize, iLiteralLength,fetchLength)));
+				}
+			iBuffer->Des().Append(iReceive.Mid(pos,fetchLength));
+			// adjust loop to account for data copy
+			pos+=fetchLength-1;
+			iLiteralLength-=fetchLength; 			
+			DBG((LogText(_L8(">>> CImapIO::ProcessBufferL(3):buflen=%d:buffsize=%d:litlen=%d:fetchlen=%d"), iBuffer->Length(),iBufferSize, iLiteralLength,fetchLength)));
+			if (iLiteralLength==0)
+				{
+				// Atom is already saved (we add literal atoms before they
+				// are stored)
+				iParserState=EIOStateAtomWait;
+				}
+			break;
+			}
+		}
+	
+	iReceive.Zero();
+	// At start of line, or if we're not doing a partial return, we need to
+	// queue another read here
+	if (iBytesRead==0 || !iReturnPartialLine)
+		{
+		// We've processed this buffer: queue a read. We only complete (above)
+		// when we've had a whole reply, including terminating CRLF.
+		DBG((LogText(_L8("CImapIO::ProcessBufferL(): queuing read, iBytesRead=%d, iReturnPartialLine is %d"), iBytesRead, iReturnPartialLine)));
+                QueueRead();
+		}
+	else
+		{
+		// Have we got 'enough' of the partial line?
+		if (iBytesRead<iBytesToRead)
+			{
+			// Not enough yet: queue another partial read, for the remainder
+			iBytesToRead-=iBytesRead;
+			QueueRead();
+			}
+		else
+			{
+			// Partial line parsed: return success (client will requeue)
+			DBG((LogText(_L8("CImapIO::ProcessBuffer: Complete on partial line"))));
+			Complete(KErrNone);
+			}
+		}
+	}
+
+void CImapIO::QueueRead()
+	{
+	// Fill buffer
+	iLen=iBytesToRead;
+	iSession->ReceiveBinaryData(iStatus,iReceive,iLen);
+	iState=EIOStateReadQueued;
+	SetActive();
+	}
+
+// Close connection
+void CImapIO::Disconnect()
+	{
+	DBG((LogText(_L8("CImapIO::Disconnect(state=%d)"),iState)));
+
+	// Reset state
+	iState=EIOStateDisconnected;
+
+	// Delete session to stop timeouts (this will disconnect too)
+	delete iSession;
+	iSession=NULL;
+	}
+
+void CImapIO::SetTLSResponseL()
+	{
+	DBG((LogText(_L8("CImapIO::SetTLSResponseL"))));
+
+	iSession->SetSSLTLSResponseL(KIMAP_OK);
+	}
+
+/**
+	@fn				TInt GetIAPValue(TUint32& aIap)
+	Intended Usage	:	Gets the value of the currently connecting/connected IAP
+	@param			aIap will be value of the currently connecting/connected IAP or KErrNotFound if an error occurs 
+	@return			KErrNone if succesful, KErrNotFound is the session does not exist or a system-wide error code.
+	
+	*/
+TInt CImapIO::GetIAPValue(TUint32& aIap)
+	{
+	return (iSession) ? (iSession->GetIAPValue(aIap)) : (KErrNotFound);
+	}
+
+/**
+	@fn				TInt GetRConnectionName(TName &aName)
+	Intended Usage	:	On return, the unique name of the RConnection.
+	@since			9.1
+	@return			KErrNone if succesful, or another of the system-wide error codes. 
+	*/
+TInt CImapIO::GetRConnectionName(TName &aName)
+	{
+	return (iSession) ? (iSession->GetRConnectionName(aName)) : (KErrNotFound);
+	}
+
+// Returns the last socket activity timeout value for the session connection
+TInt CImapIO::GetLastSocketActivityTimeout(TUint32& aTimeout)
+	{
+	return (iSession) ? (iSession->GetLastSocketActivityTimeout(aTimeout)) : (KErrNotFound);
+	}
+
+/**
+	@fn				TInt GetConnectionStage()
+	Intended Usage	:	Gets the stage of the connection process as defined in nifvar.h and csdprog.h
+	@since			7.0s
+	@return         The current connection stage, KErrNotFound is the session does not exist or a system-wide error code
+
+	*/
+TInt CImapIO::GetConnectionStage()
+	{
+	return (iSession) ? (iSession->GetConnectionStage()) : (KErrNotFound);
+	}
+
+
+// Parent wants to queue a connection
+void CImapIO::ConnectL(TRequestStatus& aStatus, const TDesC& aHost, const TUint aPortNum, const CImIAPPreferences& aPrefs, TBool aSSLWrappedSocket)
+	{
+	// Have to be disconnected to connect...
+	__ASSERT_DEBUG(iState==EIOStateDisconnected,gPanic(EConnectWhenConnected));
+	if(!(iState==EIOStateDisconnected))
+		{
+		User::LeaveIfError(KErrInUse);// Connect when connected
+		}
+	// Queue request
+	Queue(aStatus);
+
+	// Delete current session (there shouldn't be one really)
+	delete iSession;
+	iSession=NULL;
+
+	// Reconstruct it
+	iSession=CImTextServerSession::NewL(KImapSendInactivityTimeMinutes, KImapReceiveInactivityTimeMinutes);
+	
+	// check local textseverssion is active.
+	if(iPrimaryTextServerSession)
+		{
+		// Providing primarysession's textserversession
+		// Going to be set on the secondary session
+		iSession->SetPrimaryTextServerSession(iPrimaryTextServerSession);	
+		}
+
+	// Ask session to connect (it does the resolving bit)
+	if(aSSLWrappedSocket)
+		{
+		iSession->SSLQueueConnectL(iStatus,aHost,aPortNum,aPrefs);
+		}
+	else
+		{
+		iSession->QueueConnectL(iStatus,aHost,aPortNum,aPrefs);
+		}
+
+	SetActive();
+	iState=EIOStateConnectQueued;
+	}
+
+// Parent wants the next line, all nicely parsed. When this completes, the
+// parent calls RootAtom() to get the root of the parse tree.
+TInt CImapIO::GetReply(TRequestStatus& aStatus)
+	{
+	// Call with maximum buffer size: no partial returns
+	return(GetReply(aStatus,KReceiveBuffer,EFalse));
+	}
+	
+TInt CImapIO::GetReply(TRequestStatus& aStatus, const TInt aFetchSize, const TBool aPartialReturn)
+	{
+	DBG((LogText(_L8("CImapIO::GetReply (aFetchSize=%d, aPartialReturn=%d)"),aFetchSize,aPartialReturn)));
+
+	// Disconnected?
+	if (iState==EIOStateDisconnected)
+		return(KErrDisconnected);
+
+	// Have to be connected & not busy
+	__ASSERT_ALWAYS(iState==EIOStateConnected,gPanic(EIOWhenNotReady));
+	
+	// Queue request
+	Queue(aStatus);
+
+	// Save max number of bytes to read in next request
+	iBytesToRead=aFetchSize;
+
+	// Partial return required? (ie return tree in as-is state when read
+	// completes)
+	iReturnPartialLine=aPartialReturn;
+
+	// Still busy (last request cancelled?), or still building tree?
+	if (iBytesRead)
+		{
+		// Carry on with this one, return it when ready
+		}
+	else
+		{
+		// New line
+
+		// Blank output buffer
+		iBuffer->Des().Zero();
+
+		// Delete existing tree
+		if (iRootAtom!=NULL)
+			{
+
+			// remove atoms from atom tree
+			iAtomArray.ResetAndDestroy();
+			
+			delete iRootAtom;
+			iRootAtom=NULL;
+			}
+
+		// Reset (empty) atom stack
+		iAtomStack.Reset();
+
+		// Reset state
+		iParserState=EIOStateAtomWait;
+
+		// First created atom will be child of root
+		iRootAtom=new CImapAtom();
+		iAtom=iRootAtom;
+		iNextIsChild=ETrue;
+		}
+
+	// Anything in receive buffer? Deal with it if we can
+	TRAPD(err,ProcessBufferL());
+	if (err!=KErrNone)
+		{
+		// An error has occurred: return this
+		DBG((LogText(_L8("CImapIO::ProcessBuffer: Complete in GetReply err %d"),err)));
+		Complete(KErrGeneral);
+		}
+
+	return(KErrNone);
+	}
+
+// Send with structure
+TInt CImapIO::Send(TRequestStatus &aStatus, TRefByValue<const TDesC8> aFmt,...)
+	{
+	VA_LIST list;
+	VA_START(list,aFmt);
+	iTransmit.Zero();
+	iTransmit.AppendFormatList(aFmt,list);
+
+	return(Send(aStatus, iTransmit));
+	}
+
+// Send with structure
+void CImapIO::SendL(TRequestStatus &aStatus, TRefByValue<const TDesC8> aFmt,...)
+	{
+	VA_LIST list;
+	VA_START(list,aFmt);
+	iTransmit.Zero();
+	iTransmit.AppendFormatList(aFmt,list);
+
+	User::LeaveIfError(Send(aStatus, iTransmit));
+	}
+
+// Send with structure, specifying the transport-idle timeout to be used.
+void CImapIO::SendWithTimeoutL(TRequestStatus &aStatus, TInt aTimeout, TRefByValue<const TDesC8> aFmt,...)
+	{
+	VA_LIST list;
+	VA_START(list,aFmt);
+	iTransmit.Zero();
+	iTransmit.AppendFormatList(aFmt,list);
+
+	User::LeaveIfError(SendWithTimeout(aStatus, aTimeout, iTransmit));
+	}
+
+// Send a string
+TInt CImapIO::Send(TRequestStatus& aStatus, const TDesC8& aLine)
+	{
+	// Disconnected?
+	if (iState==EIOStateDisconnected)
+		return(KErrDisconnected);
+
+	if (iState!=EIOStateConnected)
+		{
+		return(KErrNotReady);
+		}
+		
+	// We're queuing a send
+	iState=EIOStateWriteQueued;
+
+	Queue(aStatus);
+	iTXbytes+=aLine.Length();
+	iSession->Send(iStatus,aLine);
+	SetActive();
+
+	return(KErrNone);
+	}
+
+// Send a string, specifying the transport-idle timeout to be used
+TInt CImapIO::SendWithTimeout(TRequestStatus& aStatus, TInt aTimeout, const TDesC8& aLine)
+	{
+	// Disconnected?
+	if (iState==EIOStateDisconnected)
+		return(KErrDisconnected);
+
+	if (iState!=EIOStateConnected)
+		{
+		return(KErrNotReady);
+		}
+		
+	// We're queuing a send
+	iState=EIOStateWriteQueued;
+
+	Queue(aStatus);
+	iTXbytes+=aLine.Length();
+	iSession->SendWithTimeout(iStatus, aTimeout, aLine);
+	SetActive();
+
+	return(KErrNone);
+	}
+
+// Logging calls: passed through to IMSK
+void CImapIO::LogText(const TDesC8& aString)
+	{
+	// Log the text
+	if (iSession)
+		iSession->LogText(aString);
+	else
+		{
+#if defined(IMAPLOG)
+		// Log it to secondary log file (so that we get logging after
+		// connection close)
+		if (!iImapLog)
+			{
+			TBuf<64> buf;
+			buf.AppendFormat(_L("c:\\logs\\Email\\imaplog%d.txt"),iID);
+			TRAP_IGNORE(iImapLog=CImLog::NewL(buf, EAppend));
+			}
+		
+		if (iImapLog)
+			iImapLog->AppendComment(aString);
+#endif
+		}
+	}
+
+void CImapIO::LogText(TRefByValue<const TDesC8> aFmt,...)
+	{
+	VA_LIST list;
+	VA_START(list,aFmt);
+	TBuf8<1024> aBuf;
+
+	aBuf.AppendFormatList(aFmt,list);
+	LogText(aBuf);
+	}
+
+// Pass Logging onto the Session
+void CImapIO::PerformLogging(TBool aLogging)
+	{
+	iSession->PerformLogging(aLogging);
+	}
+
+// Bytes in/out
+TInt CImapIO::RXbytes(const TBool aReset)
+	{
+	TInt b=iRXbytes;
+	if (aReset) iRXbytes=0;
+	return(b);
+	}
+
+TInt CImapIO::TXbytes(const TBool aReset)
+	{
+	TInt b=iTXbytes;
+	if (aReset) iTXbytes=0;
+	return(b);
+	}
+
+// Setting of current primaryTextServerSession, going to be use on the secondary session
+void CImapIO::SetPrimaryTextServerSession(CImTextServerSession* aPrimaryTextServerSession)
+	{
+	iPrimaryTextServerSession=aPrimaryTextServerSession;
+	}
+
+// Retruns the current textserversession
+CImTextServerSession* CImapIO::GetTextServerSession()
+	{
+	return iSession;
+	}
+
+// Return descriptor, without any enclosing brackets < >
+TPtrC8 CImapAtom::AtomNoAngleBrackets()
+	{
+	TPtrC8 atom = iAtom;
+	TInt len = atom.Length();
+
+	if (len>2 && atom[0]==KImcvLeftChevron && atom[len-1]==KImcvRightChevron)
+		{
+		atom.Set(atom.Mid(1,len-2));
+		}
+	return(atom);
+	}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/src/IMAPOFFL.CPP	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,1236 @@
+// Copyright (c) 1998-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:
+// IMAP4 Offline operations.
+// 
+//
+
+#include "impspan.h"
+
+#include <msventry.h>
+#include <imapset.h>
+#include <miutset.h>
+#include <offop.h>
+#include <msvreg.h>
+#include <imapcmds.h>
+
+#include "imapsess.h"
+#include "imapoffl.h"
+
+#ifdef _DEBUG
+#define DBG(a) iSession->LogText a
+#define PRINTING
+#else
+#define DBG(a)
+#undef PRINTING
+#endif
+
+// ----------------------------------------------------------------------
+
+#ifdef PRINTING
+
+LOCAL_D TPtrC8 OffLineOpTypeString(const CImOffLineOperation& aOp)
+	{
+	switch (aOp.OpType())
+		{
+	case CImOffLineOperation::EOffLineOpNone:
+		return _L8("None");
+
+	case CImOffLineOperation::EOffLineOpCopyToLocal:
+		return _L8("CopyToLocal");
+	case CImOffLineOperation::EOffLineOpCopyFromLocal:
+		return _L8("CopyFromLocal");
+	case CImOffLineOperation::EOffLineOpCopyWithinService:
+		return _L8("CopyWithinService");
+
+	case CImOffLineOperation::EOffLineOpMoveToLocal:
+		return _L8("MoveToLocal");
+	case CImOffLineOperation::EOffLineOpMoveFromLocal:
+		return _L8("MoveFromLocal");
+	case CImOffLineOperation::EOffLineOpMoveWithinService:
+		return _L8("MoveWithinService");
+
+	case CImOffLineOperation::EOffLineOpDelete:
+		return _L8("Delete");
+
+	case CImOffLineOperation::EOffLineOpChange:
+		return _L8("Change");
+	case CImOffLineOperation::EOffLineOpCreate:
+		return _L8("Create");
+
+	case CImOffLineOperation::EOffLineOpMtmSpecific:
+		switch (aOp.MtmFunctionId())
+			{
+		case EFnOffLineOpMoveDelete:
+			return _L8("MoveDelete");
+		case EFnOffLineOpPopulate:
+			return _L8("Populate");
+		default:
+			return _L8("UnknownMtmSpecific");
+			}
+	default:
+		break;
+		}
+	return _L8("Unknown");
+	}
+
+LOCAL_D TPtrC8 Imap4OpTypeString(CImap4OffLineControl::TImap4OpType aOpType)
+	{
+	switch (aOpType)
+		{
+	case CImap4OffLineControl::EImap4OpCopyToLocal:
+		return _L8("CopyToLocal");
+	case CImap4OffLineControl::EImap4OpCopyFromLocal:
+		return _L8("CopyFromLocal");
+	case CImap4OffLineControl::EImap4OpCopyWithinService:
+		return _L8("CopyWithinService");
+
+	case CImap4OffLineControl::EImap4OpMoveToLocal:
+		return _L8("MoveToLocal");
+	case CImap4OffLineControl::EImap4OpMoveFromLocal:
+		return _L8("MoveFromLocal");
+	case CImap4OffLineControl::EImap4OpMoveWithinService:
+		return _L8("MoveWithinService");
+
+	case CImap4OffLineControl::EImap4OpDelete:
+		return _L8("Delete");
+
+	case CImap4OffLineControl::EImap4OpMoveTypeDelete:
+		return _L8("MoveDelete");
+	case CImap4OffLineControl::EImap4OpPopulate:
+		return _L8("Populate");
+
+	default:
+		break;
+		}
+	return _L8("Unknown");
+	}
+#endif
+
+// ----------------------------------------------------------------------
+// construction/destruction routines
+
+CImap4OffLineControl* CImap4OffLineControl::NewL(CMsvServerEntry* aEntry, CImImap4Session *aSession)
+	{
+	CImap4OffLineControl* self = NewLC(aEntry,aSession);
+	CleanupStack::Pop(); // self
+	return self;
+	}
+
+CImap4OffLineControl* CImap4OffLineControl::NewLC(CMsvServerEntry* aEntry, CImImap4Session *aSession)
+	{
+	CImap4OffLineControl* self = new (ELeave) CImap4OffLineControl(aEntry,aSession);
+	CleanupStack::PushL(self);
+	CActiveScheduler::Add(self);
+
+	self->ConstructL();
+
+	return self;
+	}
+
+CImap4OffLineControl::CImap4OffLineControl(CMsvServerEntry* aEntry, CImImap4Session *aSession)
+	: CMsgActive(EPriorityStandard), iEntry(aEntry), iSession(aSession)
+	{
+	}
+
+void CImap4OffLineControl::ConstructL()
+	{
+	iCopyDirect = new (ELeave) CMsvEntrySelection;
+	iMoveDirect = new (ELeave) CMsvEntrySelection;
+	iMoveToLocalDirect = new (ELeave) CMsvEntrySelection;
+	}
+
+CImap4OffLineControl::~CImap4OffLineControl()
+	{
+	delete iCopyDirect;
+	delete iMoveDirect;
+	delete iMoveToLocalDirect;
+	}
+
+// ----------------------------------------------------------------------
+
+// public routines
+
+// Store an offline copy/move/delete command: we need to determine which
+// folder the offline command should be stored in dependent on the
+// source of the command.
+
+// CopyToLocal can contain whole messages or parts (but not embedded
+// messages). It can also be a copy to NULL, in which case it means
+// just populate the mirror
+
+// TODO: Pass in the GetMailOptions to the copy to mirror option
+
+// Any item can contain whole messages, but not folders, and can
+// contain shadow ids
+
+void CImap4OffLineControl::StoreOfflineCommandL(TImap4OpType aOperation,
+												const CMsvEntrySelection& aSelection,
+												TMsvId aDestination,
+												TRequestStatus& aStatus)
+	{
+	TBuf8<128> params = _L8("");
+	StoreOfflineCommandL( aOperation, aSelection, aDestination, params, aStatus );
+	}
+
+void CImap4OffLineControl::StoreOfflineCommandL(TImap4OpType aOperation,
+												const CMsvEntrySelection& aSelection,
+												TMsvId aDestination,
+												const TDesC8& aParams,
+												TRequestStatus& aStatus)
+	{
+#ifdef PRINTING
+	TPtrC8 p = Imap4OpTypeString(aOperation);
+	DBG((_L8("StoreOfflineCommand: op %S %d entries to %x param bytes %d"),
+		 &p, aSelection.Count(), aDestination, aParams.Length()));
+#endif
+		
+	Queue(aStatus);
+
+	iDestination = aDestination;
+
+	// work our which service we are dealing with
+	iServiceId = ServiceOfL( aOperation == EImap4OpCopyFromLocal ||
+							 aOperation == EImap4OpMoveFromLocal ?
+							 aDestination : aSelection[0] );
+
+	// clear list of Direct operations to do after storing
+	// commands
+	iCopyDirect->Reset();
+	iMoveDirect->Reset();
+	iMoveToLocalDirect->Reset();
+	
+	for (TInt i = 0; i < aSelection.Count(); i++)
+		{
+		CImOffLineOperation op;
+			
+		// See if the message is in fact a shadow
+		TMsvId origId = aSelection[i];
+		SetEntryL(origId);
+
+		TMsvId shadowId = KMsvNullIndexEntryId;
+		TMsvId shadowParentId = KMsvNullIndexEntryId;
+		TMsvEmailEntry entry = iEntry->Entry();
+		if (entry.iRelatedId)
+			{
+			shadowId = origId;
+			shadowParentId = entry.Parent();
+			origId = entry.iRelatedId;
+
+			// it is possible that the original has been deleted by
+			// now (if it were local). If so then skip this operation
+			TInt err = iEntry->SetEntry(origId);
+			if (err != KErrNone)
+				origId = KMsvNullIndexEntryId;
+			else
+				entry = iEntry->Entry();
+			}
+
+		if (origId != KMsvNullIndexEntryId)
+			{
+			// entry contains original (not shadow) message details
+		
+			// it is an undo type operation if we are copying or moving a
+			// shadow back to its original folder and the original is
+			// invisible or deleted
+			TBool undeleteOp = shadowId != KMsvNullIndexEntryId &&
+				entry.Parent() == iDestination &&
+				(!entry.Visible() || entry.DisconnectedOperation() == EDisconnectedDeleteOperation);
+
+			// Make operation & save it
+			switch(aOperation)
+				{
+			case EImap4OpCopyToLocal:
+				if (undeleteOp)
+					{
+					UndeleteOperationL(origId, shadowParentId, ETrue);
+					}
+				else if (IdIsLocalL(origId) || entry.Complete())
+					{
+					// either direct local copy or copy from mirror of completely populated message
+					// either way, add new entry to todo array
+					iCopyDirect->AppendL(origId);
+					}
+				else
+					{
+					op.SetCopyToLocal(origId,iDestination);
+					SaveOperationL(op);
+					}
+				break;
+
+			case EImap4OpCopyFromLocal:
+			case EImap4OpCopyWithinService:
+				if (undeleteOp)
+					{
+					UndeleteOperationL(origId, shadowParentId, ETrue);
+					}
+				else if (IdIsLocalL(origId))
+					{
+					op.SetCopyFromLocal(origId,iDestination);
+					SaveOperationL(op);
+					}
+				else
+					{
+					op.SetCopyWithinService(origId,iDestination);
+					SaveOperationL(op);
+					}
+				break;
+
+			case EImap4OpMoveToLocal:
+				if (undeleteOp)
+					{
+					UndeleteOperationL(origId, shadowParentId, EFalse);
+					DeleteEntryL(shadowId);
+					}
+				else if (IdIsLocalL(origId))
+					{
+					CImOffLineOperation origOp;
+					if (FindOffLineOpByIdL( origId, shadowParentId, origOp, ETrue /* delete op */) == 0)
+						User::Leave(KErrNotSupported);
+
+					if ( OffLineOpIsCopy(origOp) )
+						// add new local to local copy op
+						iCopyDirect->AppendL(origId);
+					else
+						// direct local move
+						iMoveDirect->AppendL(origId);
+
+					DeleteEntryL(shadowId);
+					}
+				else if (entry.Complete())
+					{
+					//	Not local, but completely populated
+					iMoveToLocalDirect->AppendL(origId);
+					}
+				else
+					{
+					op.SetMoveToLocal(origId,iDestination);
+					SaveOperationL(op);
+					}
+				break;
+
+			case EImap4OpMoveFromLocal:
+			case EImap4OpMoveWithinService:
+				if (undeleteOp)
+					{
+					UndeleteOperationL(origId, shadowParentId, EFalse);
+
+					// this one can fail depending on what kind of
+					// undelete operation it was
+					CImOffLineOperation origOp;
+					FindOffLineOpByIdL( origId, shadowParentId, origOp, ETrue /* delete op */);
+
+					DeleteEntryL(shadowId);
+					}
+				else if (shadowId)
+					{
+					CImOffLineOperation origOp;
+					if (FindOffLineOpByIdL( origId, shadowParentId, origOp, ETrue /* delete op */) == 0)
+						User::Leave(KErrNotSupported);
+			
+					// Clean disconnected flags
+					SetEntryL(origId);
+					TMsvEmailEntry entry = iEntry->Entry();
+					if (entry.DisconnectedOperation() != EDisconnectedMultipleOperation)
+						{
+						entry.SetDisconnectedOperation(ENoDisconnectedOperations);
+						ChangeEntryL(entry);
+						}
+					
+					// if shadow was the result of a copy then change
+					// original copy to point to new destination
+
+					// if shadow was result of a move then change move to
+					// point to new destination
+					if ( OffLineOpIsCopy(origOp) )
+						{
+						if (IdIsLocalL(origId))
+							op.SetCopyFromLocal(origId,iDestination);
+						else
+							op.SetCopyWithinService(origId,iDestination);
+						}
+					else
+						{
+						if (IdIsLocalL(origId))
+							op.SetMoveFromLocal(origId,iDestination);
+						else
+							op.SetMoveWithinService(origId,iDestination);
+						}
+
+					SaveOperationL(op);
+					DeleteEntryL(shadowId);
+					}
+				else
+					{
+					if (IdIsLocalL(origId))
+						op.SetMoveFromLocal(origId,iDestination);
+					else
+						op.SetMoveWithinService(origId,iDestination);
+					SaveOperationL(op);
+					}
+				break;
+
+			case EImap4OpDelete:
+				// we treat shadows and real items the same for deletion
+				// currently
+				op.SetDelete( shadowId ? shadowId : origId );
+				SaveOperationL(op);
+				break;
+			
+			case EImap4OpUndelete:
+				if (shadowId)
+					{
+					UndeleteOperationL(shadowId, shadowParentId, EFalse);
+					}
+				else
+					{
+					// if the entry is not a shadow then we need to
+					// replace the disconnected op flags with the original
+					// flags before it was deleted.
+					CImOffLineOperation origOp;
+
+					// this searches the list before the delete is
+					// removed.  However since deletes are stored at
+					// the end of the list then if there are any other
+					// operations it will return the other, and a
+					// count of 2 or greater.
+					TInt count = FindOffLineOpByIdL(origId, KMsvNullIndexEntryId, origOp, EFalse);
+
+					TImDisconnectedOperationType disconnectedType = ENoDisconnectedOperations;
+					if (count == 2)
+						disconnectedType = OffLineOpToDisconnectedOp( origOp );
+					else if (count > 2)
+						disconnectedType = EDisconnectedMultipleOperation;
+
+					UndeleteOperationL(origId, KMsvNullIndexEntryId, EFalse, disconnectedType);
+					}
+				break;
+
+			case EImap4OpPopulate:
+				/* easy one, just populate the original */
+				op.SetMtmSpecificCommandL(origId, iDestination, EFnOffLineOpPopulate, aParams);
+				SaveOperationL(op);
+				break;
+
+			case EImap4OpMoveTypeDelete:
+				__ASSERT_DEBUG(0, gPanic(EBadUseOfImap4Op));
+				break;
+				}
+			}
+		}
+
+	// if there are entries left over then they are ones we added to
+	// be done immediately
+	if (!DoLocalOpL())
+		{
+		// Request has been queued, complete immediately
+		Complete(KErrNone);
+		}
+	}
+
+// Cancel offline operations queued in the folders/service mentioned
+// in the selection
+
+void CImap4OffLineControl::CancelOffLineOperationsL(const CMsvEntrySelection& aSelection)
+	{
+	DBG((_L8("CancelOfflineOperations: %d entries"), aSelection.Count()));
+		
+	for (TInt i = 0; i < aSelection.Count(); i++)
+		{
+		TMsvId id = aSelection[i];
+
+		SetEntryL(id);
+		TMsvEmailEntry entry = iEntry->Entry();
+		if (entry.iType == KUidMsvFolderEntry)
+			{
+			CImOffLineOperationArray* array = OffLineOpArrayL(id);
+			CleanupStack::PushL(array);
+
+			if (array->CountOperations())
+				{
+				// remove the queued ops
+				while (array->CountOperations())
+					{
+					CImOffLineOperation thisOp;
+					thisOp.CopyL(array->Operation(0));
+					
+					UndoOfflineOpL(thisOp, ETrue);
+					
+					array->Delete(0);
+					}
+				
+				// write back empty array to store
+				SetOffLineOpArrayL(id, *array);
+				}
+
+			CleanupStack::PopAndDestroy(); // array
+			}
+#if 0
+		else
+			{
+			CImOffLineOperation op;
+			while (FindOffLineOpByIdL(id, KMsvNullIndexEntryId, op, ETrue))
+				{
+				CMsvEntrySelection* selection=new (ELeave) CMsvEntrySelection;
+				CleanupStack::PushL(selection);
+				}
+		
+			CleanupStack::PopAndDestroy(); // selection
+			}
+#endif
+		
+		}
+	}
+
+// ----------------------------------------------------------------------
+
+TImDisconnectedOperationType CImap4OffLineControl::OffLineOpToDisconnectedOp(const CImOffLineOperation& aOp)
+	{
+	TImDisconnectedOperationType type;
+	switch (aOp.OpType())
+		{
+	case CImOffLineOperation::EOffLineOpMoveToLocal:
+		type = EDisconnectedMoveToOperation;
+		break;
+	case CImOffLineOperation::EOffLineOpMoveFromLocal:
+		type = EDisconnectedMoveFromOperation;
+		break;
+	case CImOffLineOperation::EOffLineOpMoveWithinService:
+		type = EDisconnectedMoveWithinServiceOperation;
+		break;
+
+	case CImOffLineOperation::EOffLineOpCopyToLocal:
+		type = EDisconnectedCopyToOperation;
+		break;
+	case CImOffLineOperation::EOffLineOpCopyFromLocal:
+		type = EDisconnectedCopyFromOperation;
+		break;
+	case CImOffLineOperation::EOffLineOpCopyWithinService:
+		type = EDisconnectedCopyWithinServiceOperation;
+		break;
+		
+	case CImOffLineOperation::EOffLineOpDelete:
+		type = EDisconnectedDeleteOperation;
+		break;
+
+	case CImOffLineOperation::EOffLineOpMtmSpecific:
+		type = EDisconnectedSpecialOperation;
+		break;
+	default:
+		type = EDisconnectedUnknownOperation;
+		break;
+		}
+	return type;
+	}
+
+// This returns TRUE is it is a strict copy operation. Populate can be
+// considered False by the callers of this function.
+
+TBool CImap4OffLineControl::OffLineOpIsCopy(const CImOffLineOperation& aOp)
+	{
+	switch (aOp.OpType())
+		{
+	case CImOffLineOperation::EOffLineOpCopyToLocal:
+	case CImOffLineOperation::EOffLineOpCopyFromLocal:
+	case CImOffLineOperation::EOffLineOpCopyWithinService:
+		return ETrue;
+	case CImOffLineOperation::EOffLineOpMtmSpecific:
+		if (aOp.MtmFunctionId() == EFnOffLineOpPopulate)
+			{
+			return ETrue;
+			}
+	    break; 
+	
+	default:
+		break;
+		}
+	return EFalse;
+	}
+
+TInt CImap4OffLineControl::PosVal(const CImOffLineOperation& aOp)
+	{
+	switch (aOp.OpType())
+		{	
+	case CImOffLineOperation::EOffLineOpMtmSpecific: // populate
+		switch (aOp.MtmFunctionId())
+			{
+		case EFnOffLineOpMoveDelete:
+			return 5;
+		case EFnOffLineOpPopulate:
+			return 0;
+			}
+		break;
+
+	case CImOffLineOperation::EOffLineOpCopyToLocal:
+	case CImOffLineOperation::EOffLineOpCopyWithinService:
+		return 1;
+	case CImOffLineOperation::EOffLineOpCopyFromLocal:
+		return 2;
+		
+	case CImOffLineOperation::EOffLineOpMoveToLocal:
+	case CImOffLineOperation::EOffLineOpMoveWithinService:
+		return 3;
+
+	case CImOffLineOperation::EOffLineOpMoveFromLocal:
+		return 4;	
+
+	case CImOffLineOperation::EOffLineOpDelete:
+		return 6;
+	default:
+		break;
+		}
+	return 6;
+	}
+
+// ----------------------------------------------------------------------
+
+// Do setentry, leave if there is an error
+void CImap4OffLineControl::SetEntryL(TMsvId aId)
+	{
+	User::LeaveIfError(iEntry->SetEntry(aId));
+	}
+
+// Change entry, leave if error
+void CImap4OffLineControl::ChangeEntryL(TMsvEntry& aEntry)
+	{
+	User::LeaveIfError(iEntry->ChangeEntry(aEntry));
+	}
+
+// remove an id, leave if error, moves to the parent first
+void CImap4OffLineControl::DeleteEntryL(TMsvId aId)
+	{
+	SetEntryL(aId);
+	SetEntryL(iEntry->Entry().Parent());
+	User::LeaveIfError(iEntry->DeleteEntry(aId));
+	}
+
+// Find the folder that encloses this message or message part. Note
+// that this must be a real folder, not a folder component of a
+// message, and that it may not be in our service.
+TMsvId CImap4OffLineControl::FolderOfL(TMsvId aId)
+	{
+	SetEntryL( MessageOfL(aId) );
+	return iEntry->Entry().Parent();
+	}
+
+// If the message is not in our service then return the destination
+// folder. Otherwise return its own parent folder.
+TMsvId CImap4OffLineControl::FindOffLineSaveFolderL(TMsvId aId, TMsvId aDestId)
+	{
+	TMsvId folder = FolderOfL(aId);
+	if (ServiceOfL(folder) == iServiceId)
+		return folder;
+	return aDestId;
+	}
+
+// Find the top level message that holds this message part. Can be
+// itself if it is a real message itself. This is located by finding
+// the message that is highest up the tree.
+TMsvId CImap4OffLineControl::MessageOfL(TMsvId aId)
+	{
+	TMsvId current=aId;
+	TMsvId msg=aId;
+	while(current!=KMsvRootIndexEntryIdValue)
+		{
+		// Visit this entry
+		SetEntryL(current);
+
+		TMsvEmailEntry entry = iEntry->Entry();
+		
+		// if service then searched far enough
+		if (entry.iType==KUidMsvServiceEntry)
+			break;
+
+		// if message type then store it
+		if (entry.iType==KUidMsvMessageEntry)
+			msg = entry.Id();
+		
+		// Go upwards
+		current=entry.Parent();
+		}
+
+	return msg;
+	}
+
+// return the id of the service containing this id
+TMsvId CImap4OffLineControl::ServiceOfL(TMsvId aId)
+	{
+	TMsvId current=aId;
+	while(current!=KMsvRootIndexEntryIdValue)
+		{
+		// Visit this entry
+		SetEntryL(current);
+
+		TMsvEmailEntry entry = iEntry->Entry();
+		
+		// if service then searched far enough
+		if (entry.iType==KUidMsvServiceEntry)
+			break;
+
+		// Go upwards
+		current=entry.Parent();
+		}
+
+	return current;
+	}
+
+// is this id in the local service?
+TMsvId CImap4OffLineControl::IdIsLocalL(TMsvId aId)
+	{
+	return ServiceOfL(aId) == KMsvLocalServiceIndexEntryIdValue;
+	}
+
+// ----------------------------------------------------------------------
+
+// simple functions to get and set the offline array on an id. More
+// efficient open and modify versions are possible and used elsewhere
+
+CImOffLineOperationArray* CImap4OffLineControl::OffLineOpArrayL(TMsvId aId)
+	{
+	SetEntryL(aId);
+
+	CImOffLineOperationArray* array = CImOffLineOperationArray::NewL();
+
+	// if no store then return an empty array (easier for higher
+	// layers than a NULL pointer).
+	if (iEntry->HasStoreL())
+		{
+		CleanupStack::PushL(array);
+		
+		CMsvStore* store = iEntry->ReadStoreL();
+		CleanupStack::PushL(store);
+	
+		CImOffLineArrayStore arraystore(*array);
+		arraystore.RestoreL(*store);
+
+		CleanupStack::PopAndDestroy(); // store
+		CleanupStack::Pop();		   // array
+		}
+	
+	DBG((_L8("OffLineOpArrayL: folder 0x%x count %d"), aId, array->CountOperations()));
+
+	return array;
+	}
+
+void CImap4OffLineControl::SetOffLineOpArrayL(TMsvId aId, CImOffLineOperationArray& aArray)
+	{
+	DBG((_L8("SetOffLineOpArrayL: folder 0x%x count %d"), aId, aArray.CountOperations()));
+
+	SetEntryL( aId );
+
+	CMsvStore* store=iEntry->EditStoreL();
+	CleanupStack::PushL(store);
+
+	CImOffLineArrayStore arraystore(aArray);
+	arraystore.StoreL(*store);
+
+	store->CommitL();
+
+	CleanupStack::PopAndDestroy(); // store
+	}
+
+// ----------------------------------------------------------------------
+
+// Save offline operation
+void CImap4OffLineControl::SaveOperationL(const CImOffLineOperation& aOperation)
+	{
+	DBG((_L8("SaveOperation:")));
+
+	// We need an array, to store the current offline operations of this folder
+    CImOffLineOperationArray *array=CImOffLineOperationArray::NewL();
+	CleanupStack::PushL(array);
+	CImOffLineArrayStore arraystore(*array);
+
+	// find where to store the op
+	TMsvId storehere = FindOffLineSaveFolderL(aOperation.MessageId(), aOperation.TargetMessageId());
+	SetEntryL(storehere);
+
+	// open the store
+	CMsvStore *store=iEntry->EditStoreL();
+	CleanupStack::PushL(store);
+
+	arraystore.RestoreL(*store);
+
+	// we add this operation after others of the same type
+	TInt insertBefore = PosVal(aOperation) + 1;
+	TBool done = EFalse;
+	
+	for(TInt a=0; a<array->CountOperations(); a++)
+		{
+		if (insertBefore <= PosVal(array->Operation(a)))
+			{
+			array->InsertOperationL(MUTABLE_CAST(CImOffLineOperation&, aOperation), a);
+			done = ETrue;
+			break;
+			}
+		}
+	
+	if (!done)
+		array->AppendOperationL(aOperation);
+
+	// write back
+	arraystore.StoreL(*store);
+	store->CommitL();
+
+	// Dispose of store & array
+	CleanupStack::PopAndDestroy(2);
+
+	// make the shadow
+	MakeShadowL(aOperation);
+	}
+
+// returns ETrue if a matching Op was found
+
+TInt CImap4OffLineControl::FindOffLineOpByIdL(TMsvId aId, TMsvId aDestFolder,
+										  CImOffLineOperation& aOp, TBool aDelete)
+	{
+    CImOffLineOperationArray *array=CImOffLineOperationArray::NewL();
+	CleanupStack::PushL(array);
+	CImOffLineArrayStore arraystore(*array);
+
+	SetEntryL(FindOffLineSaveFolderL(aId, aDestFolder));
+	CMsvStore *store=aDelete ? iEntry->EditStoreL() : iEntry->ReadStoreL();
+	CleanupStack::PushL(store);
+
+	arraystore.RestoreL(*store);
+
+	// look in the array for an operation on this Id and optionally to
+	// the matching folder
+	TInt found = 0;
+	TInt foundAt = -1;
+	for(TInt a=0; a<array->CountOperations(); a++)
+		{
+		if (array->Operation(a).MessageId() == aId &&
+			(aDestFolder == KMsvNullIndexEntryId ||
+			 aDestFolder == array->Operation(a).TargetMessageId()) )
+			{
+			// only write out the first operation found
+			if (found == 0)
+				{
+				foundAt = a;
+				aOp.CopyL( array->Operation(a) );
+				}
+			found++;
+			}
+		}
+
+	// optionally now delete the operation from the array
+	if (aDelete && foundAt != -1)
+		{
+		array->Delete(foundAt);
+		
+		arraystore.StoreL(*store);
+		store->CommitL();
+		}
+	
+	CleanupStack::PopAndDestroy(2);	// store, array
+
+	return found;
+	}
+
+// this means remove the cause of the delete, ie remove delete or
+// change move to copy, unless ConvertToCopy is False in which case
+// delete any move operation rather than convert it.
+
+// there can only be one relevant operation in the array as the UI or
+// MTM should have prevented further operations
+
+// Deleting any shadow entry should be done outside this function
+
+void CImap4OffLineControl::UndeleteOperationL(TMsvId aId, TMsvId aDestId, TBool aConvertMoveToCopy,
+										 TImDisconnectedOperationType aDisconnected)
+	{
+	DBG((_L8("UndeleteOperation: Id %x CvtMove %d type %d"),
+		 aId, aConvertMoveToCopy, aDisconnected));
+
+	// We need an array, to store the current offline operations of this folder
+    CImOffLineOperationArray *array=CImOffLineOperationArray::NewL();
+	CleanupStack::PushL(array);
+	CImOffLineArrayStore arraystore(*array);
+
+	SetEntryL(FindOffLineSaveFolderL(aId, aDestId));
+	DBG((_L8("UndeleteOperation: opending savefolder store %x"), iEntry->Entry().Id() ));
+	CMsvStore *store=iEntry->EditStoreL();
+	CleanupStack::PushL(store);
+
+	arraystore.RestoreL(*store);
+
+	// look in the array for a delete or move operation on this Id
+	CImOffLineOperation thisOp;
+	for(TInt a=0; a<array->CountOperations(); a++)
+		{
+		thisOp.CopyL(array->Operation(a));
+
+		if (thisOp.MessageId() == aId)
+			{
+			TBool finish = ETrue;
+			TBool isDelete = EFalse;
+			
+			switch (thisOp.OpType())
+				{
+				// if move then convert it to an equivalent copy
+			case CImOffLineOperation::EOffLineOpMoveToLocal:
+				thisOp.SetCopyToLocal(aId, thisOp.TargetMessageId());
+				break;
+
+			case CImOffLineOperation::EOffLineOpMoveFromLocal:
+				thisOp.SetCopyFromLocal(aId, thisOp.TargetMessageId());
+				break;
+
+			case CImOffLineOperation::EOffLineOpMoveWithinService:
+				thisOp.SetCopyWithinService(aId, thisOp.TargetMessageId());
+				break;
+
+				// if delete then get rid of the pending operation
+			case CImOffLineOperation::EOffLineOpDelete:
+				isDelete = ETrue;
+				break;
+
+			default:
+				finish = EFalse;
+				break;
+				}
+
+			if (finish)
+				{
+				// remove the existing operation
+				array->Delete(a);
+
+				// potentially add a new one
+				if (!isDelete)
+					{
+					// it's become a copy so insert at head of list
+					if (aConvertMoveToCopy)
+						array->InsertOperationL(thisOp, 0);
+					}
+
+				// exit 'for' loop and so we don't need to fix up the
+				// iterator
+				break;
+				}
+			}
+		}
+
+	DBG((_L8("UndeleteOperation: write store")));
+
+	// write back offline op array
+	arraystore.StoreL(*store);
+	store->CommitL();
+	
+	CleanupStack::PopAndDestroy(2);	// store, array
+
+	DBG((_L8("UndeleteOperation: ensure visible")));
+
+	// then make the item visible and update its pending operation
+	// type
+	SetEntryL(aId);
+	TMsvEmailEntry entry = iEntry->Entry();
+
+	entry.SetDisconnectedOperation(aDisconnected);
+	entry.SetVisible(ETrue);
+
+	ChangeEntryL(entry);
+
+	DBG((_L8("UndeleteOperation: done")));
+	}
+
+// Make shadow for offline operation - this shadow indicates what
+// *will* happen at the next sync
+
+// Note if we want to copy the entire structure of the message then
+// there is a ready made function Imap4Session->CopyMessageL() to do
+// this
+void CImap4OffLineControl::MakeCopyMoveShadowL(const CImOffLineOperation& aOp)
+	{
+	// get copy of the original message
+	SetEntryL(aOp.MessageId());
+	TMsvEmailEntry origMsg = iEntry->Entry();
+
+	// check this is a real message, we don't make shadows of parts
+	if (origMsg.iType != KUidMsvMessageEntry)
+		return;
+
+	// if this is not a copy to mirror only operation then make shadow
+	if ( aOp.OpType() != CImOffLineOperation::EOffLineOpMtmSpecific )
+		{
+		// copy out the non embedded data
+		HBufC* details = origMsg.iDetails.AllocL();
+		CleanupStack::PushL(details);
+		HBufC* description = origMsg.iDescription.AllocL();
+		CleanupStack::PushL(description);
+
+		// set up the new message, clearing any disconnected op flags
+		// it may have
+		TMsvEmailEntry newMsg = origMsg;
+		newMsg.iRelatedId = aOp.MessageId();
+		newMsg.SetComplete(EFalse);
+		newMsg.SetDisconnectedOperation(ENoDisconnectedOperations);
+		// ensure that this one is visible (may be copied from one
+		// that wasn't)
+		newMsg.SetVisible(ETrue);
+		
+		// create shadow entry
+		SetEntryL(aOp.TargetMessageId());
+
+		newMsg.iDetails.Set(details->Des());
+		newMsg.iDescription.Set(description->Des());
+		User::LeaveIfError(iEntry->CreateEntry(newMsg));
+		
+		CleanupStack::PopAndDestroy(2);	// description, details
+		}
+	
+	// set flags on the original message
+	SetEntryL(origMsg.Id());
+
+	if (origMsg.DisconnectedOperation() == ENoDisconnectedOperations)
+		origMsg.SetDisconnectedOperation( OffLineOpToDisconnectedOp(aOp) );
+	else
+		origMsg.SetDisconnectedOperation( EDisconnectedMultipleOperation );
+
+	// make original invisible if this was a move operation
+	if (!OffLineOpIsCopy(aOp))
+		origMsg.SetVisible(EFalse);
+
+	// write back changes
+	ChangeEntryL(origMsg);
+	}
+
+void CImap4OffLineControl::MakeShadowL(const CImOffLineOperation& aOp)
+	{
+	DBG((_L8("MakeShadow: of %x in folder %x"), aOp.MessageId(), aOp.TargetMessageId()));
+
+	switch (aOp.OpType())
+		{
+	case CImOffLineOperation::EOffLineOpMtmSpecific: // populate
+	case CImOffLineOperation::EOffLineOpMoveToLocal:
+	case CImOffLineOperation::EOffLineOpMoveFromLocal:
+	case CImOffLineOperation::EOffLineOpMoveWithinService:
+	case CImOffLineOperation::EOffLineOpCopyToLocal:
+	case CImOffLineOperation::EOffLineOpCopyFromLocal:
+	case CImOffLineOperation::EOffLineOpCopyWithinService:
+		MakeCopyMoveShadowL(aOp);
+		break;
+		
+	case CImOffLineOperation::EOffLineOpDelete:
+		// Set the pending operation to Delete, we don't care if there
+		// were other operations already pending
+		{
+		SetEntryL(aOp.MessageId());
+		TMsvEmailEntry msg = iEntry->Entry();
+		msg.SetDisconnectedOperation(EDisconnectedDeleteOperation);
+		ChangeEntryL(msg);
+		}
+		break;
+	
+	case CImOffLineOperation::EOffLineOpNone:
+	case CImOffLineOperation::EOffLineOpChange:
+	case CImOffLineOperation::EOffLineOpCreate:
+		__ASSERT_DEBUG(0, gPanic(EBadUseOfOffLineOp));
+		break;
+		}
+
+	}
+
+// look in the folder for an item whose iRelatedId matches
+TBool CImap4OffLineControl::FindShadowIdsL(const CImOffLineOperation& aOp, CMsvEntrySelection& aSelection)
+	{
+	CMsvEntrySelection* selection=new (ELeave) CMsvEntrySelection;
+	CleanupStack::PushL(selection);
+
+	SetEntryL(aOp.TargetMessageId());
+	User::LeaveIfError(iEntry->GetChildren(*selection));
+
+	TBool foundOne = EFalse;
+	for(TInt child=0;child<selection->Count();child++)
+		{
+		TMsvId childId = (*selection)[child];
+		SetEntryL(childId);
+		TMsvEntry message = iEntry->Entry();
+		if (message.iRelatedId == aOp.MessageId())
+			{
+			aSelection.InsertL(0, childId);
+			foundOne = ETrue;
+			}
+		}
+
+	CleanupStack::PopAndDestroy();
+
+	return foundOne;
+	}
+
+TMsvId CImap4OffLineControl::FindShadowIdL(const CImOffLineOperation& aOp)
+	{
+	CMsvEntrySelection* selection=new (ELeave) CMsvEntrySelection;
+	CleanupStack::PushL(selection);
+
+	TMsvId id = KMsvNullIndexEntryId;
+
+	// the target folder might have been deleted - in which case just
+	// return that the id was not found
+	if (iEntry->SetEntry(aOp.TargetMessageId()) == KErrNone)
+		{
+		User::LeaveIfError(iEntry->GetChildren(*selection));
+		for(TInt child=0;child<selection->Count();child++)
+			{
+			TMsvId childId = (*selection)[child];
+			SetEntryL(childId);
+			TMsvEntry message = iEntry->Entry();
+			if (message.iRelatedId == aOp.MessageId())
+				{
+				id = childId;
+				break;
+				}
+			}
+		}
+
+	CleanupStack::PopAndDestroy();
+
+	return id;
+	}
+
+void CImap4OffLineControl::UndoOfflineOpL(const CImOffLineOperation& aOp, TBool aClearMultiples)
+	{
+#ifdef PRINTING
+	TPtrC8 p = OffLineOpTypeString(aOp);
+	DBG((_L8("UndoOfflineOp: %S Id %x TargetFolder %x"),
+		 &p, aOp.MessageId(), aOp.TargetMessageId()));
+#endif
+	
+	// get the first id related to the source of this message, unless
+	// it has no destination (ie it is a delete op)
+	if (aOp.TargetMessageId())
+		{
+		TMsvId id = FindShadowIdL(aOp);
+		if (id != KMsvNullIndexEntryId)
+			{
+			SetEntryL(aOp.TargetMessageId());
+			iEntry->DeleteEntry(id);
+			}
+		}
+
+	// remove the disconnected op flags from the source entry and make
+	// it visible (does't harm if it was visible anyway), if it has
+	// multiple ops then we leave it as we don't know what to do.
+
+	// entry might not exist if it was a shadow
+	if (iEntry->SetEntry(aOp.MessageId()) == KErrNone)
+		{
+		TMsvEmailEntry entry = iEntry->Entry();
+		if (!entry.Visible() || aClearMultiples ||
+			entry.DisconnectedOperation() != EDisconnectedMultipleOperation)
+			{
+			entry.SetDisconnectedOperation(ENoDisconnectedOperations);
+			entry.SetVisible(ETrue);
+			ChangeEntryL(entry);
+			}
+		}
+	}
+
+void CImap4OffLineControl::PrepareLocalOpL(TMsvId aId)
+	{
+	SetEntryL(aId);
+
+	// clear the disconnected op flag
+	TMsvEmailEntry entry = iEntry->Entry();
+	entry.SetDisconnectedOperation(ENoDisconnectedOperations);
+	ChangeEntryL(entry);
+		
+	SetEntryL(iEntry->Entry().Parent());
+	}
+
+TBool CImap4OffLineControl::DoLocalOpL()
+	{
+	if (iCopyDirect->Count())
+		{
+		TMsvId id = (*iCopyDirect)[0];
+
+		DBG((_L8("CImap4OffLineControl::DoLocalOp Copy id %x to do %d"),
+			 id, iCopyDirect->Count()));
+
+		PrepareLocalOpL(id);
+		
+		SetActive();
+		iEntry->CopyEntryL(id, iDestination, iStatus);
+		return ETrue;
+		}
+
+	if (iMoveDirect->Count())
+		{
+		TMsvId id = (*iMoveDirect)[0];
+
+		DBG((_L8("CImap4OffLineControl::DoLocalOp Move id %x to do %d"),
+			 id, iMoveDirect->Count()));
+
+		PrepareLocalOpL(id);
+
+		SetActive();
+		iEntry->MoveEntryL(id, iDestination, iStatus);
+		return ETrue;
+		}
+
+	if (iMoveToLocalDirect->Count())
+		{
+		TMsvId id = (*iMoveToLocalDirect)[0];
+	
+		DBG((_L8("CImap4OffLineControl::DoDirectMoveToLocalOp Move id %x to do %d"),
+			 id, iMoveToLocalDirect->Count()));
+	
+		PrepareLocalOpL(id);
+	
+		SetActive();
+		iEntry->CopyEntryL(id, iDestination, iStatus);	//	I do mean Copy
+		return ETrue;
+		}
+	
+	return EFalse;
+	}
+
+// ----------------------------------------------------------------------
+
+void CImap4OffLineControl::DoCancel()
+	{
+	CMsgActive::DoCancel();
+	}
+
+void CImap4OffLineControl::DoComplete(TInt& /*aStatus*/)
+	{
+
+	}
+
+void CImap4OffLineControl::DoRunL()
+	{
+	DBG((_L8("CImap4OffLineControl::DoRunL")));
+
+	// successfully copied/moved the item
+	
+	// Remove completed item from selection
+	if (iCopyDirect->Count())
+		iCopyDirect->Delete(0,1);
+	else if (iMoveDirect->Count())
+		iMoveDirect->Delete(0,1);
+	else
+		{
+		//	We managed to do the copy portion of a move to local
+		//	Now we need to queue up a delete of the original which
+		//	is still in the remote mailbox.
+		CImOffLineOperation op;
+		op.SetDelete((*iMoveToLocalDirect)[0]);
+		iMoveToLocalDirect->Delete(0,1);
+		SaveOperationL(op);
+		}
+
+	// Operation done. Do next one in selection
+	DoLocalOpL();
+	}
+
+// ----------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/src/IMAPSESS.CPP	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,10210 @@
+// Copyright (c) 1998-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:
+// Deal with a connection to an IMAP4rev1 server
+// This involves logging in, issuing commands and parsing responses into
+// suitable return formats as necessary, and updating the message server's
+// database.
+// 
+//
+
+#include <msvstd.h>
+#include <miuthdr.h>
+#include <miut_err.h>
+#include <msventry.h>
+#include <imcvutil.h>
+
+#include <txtetext.h>
+
+#include <cmsvbodytext.h>
+#include <txtrich.h>
+#include <imcvtext.h>
+#include <imcvsend.h>
+#include <imcm.rsg>		// resource definition for IMCV
+#include <barsread.h>	// TResourceReader
+#include <msvapi.h>
+
+#include "impsmtm.h"
+
+#include "imapsess.h"
+#include "impspan.h"
+#include "fldindex.h"
+#include <imapset.h>
+#include <miutlog.h>
+#include <msvstore.h>
+#include <commdb.h>
+#include <commdbconnpref.h>
+#include <mmsvattachmentmanager.h>
+#include <mmsvattachmentmanagersync.h>
+#include <cemailaccounts.h>
+#ifdef __WINS__
+#include <e32wins.h>    // for maxfilename lengths
+#include <msvapi.h>
+#endif
+
+#ifdef _DEBUG
+#define LOG_COMMANDS(a) a
+#define DBG(a) a
+#define PRINTING
+#else
+#define LOG_COMMANDS(a)
+#define DBG(a)
+#undef PRINTING
+#endif
+
+#include "cimapcanceltimer.h"
+#include "mimapsessionobserver.h"
+
+// For the "UID SEARCH" command, the reply is of the form:
+// "* SEARCH 1234547890 1234567891 ......."
+//      :         :
+//  |---9---|	  :
+//           |---11----|
+//
+// Here the untagged headers is 9 characters and each UID part may be up to 11 characters.
+// So if we wanted to limit the number of replies recieved in a single search so that it is
+// no larger is size than a single body fetch part....
+
+// Maximum number of UIDs acceptable in a single reply.
+const TInt KImapUidSearchSize=(5120-9)/11;
+
+// Initial size of buffer in which the "Real name <user@host>" strings
+// are built before they're put into the CImHeader and the size by
+// which to increment the buffer when necessary
+const TInt KImapAddressSizeInc=256;
+
+// Initial size of the buffer containing the UID Search list
+const TInt KUidListStringSize=256;
+
+// Illegal UID we use for marker
+const TUint KIllegalUID	= 0xffffffff;
+
+// Idle time when waiting for a cancelled fetch to complete (microseconds)
+const TInt KImapFetchCancelIdleTime	= 10000000;	// 10 seconds
+
+// Idle time (seconds) when waiting for a DONE command to complete
+// when coming out of IMAP IDLE state.
+const TInt KImapDoneInactivityTimeSeconds = 5;
+
+// IMAP text
+_LIT8(KIMAP_UNTAGGED, "*");
+_LIT8(KIMAP_CONTINUATION, "+");
+_LIT8(KIMAP_BODY, "BODY");
+_LIT8(KIMAP_BODYPEEK, "BODY.PEEK");
+_LIT8(KIMAP_BODYSTRUCTURE, "BODYSTRUCTURE");
+_LIT8(KIMAP_BYE, "BYE");
+_LIT8(KIMAP_CAPABILITY, "CAPABILITY");
+_LIT8(KIMAP_EXISTS, "EXISTS");
+_LIT8(KIMAP_EXPUNGE, "EXPUNGE");
+_LIT8(KIMAP_FETCH, "FETCH");
+_LIT8(KIMAP_FLAGS, "FLAGS"); 
+_LIT8(KIMAP_HEADERFIELDS, "HEADER.FIELDS");
+
+_LIT8(KIMAP_ALERT, "ALERT");
+_LIT8(KIMAP_LIST, "LIST");
+_LIT8(KIMAP_LSUB, "LSUB");
+_LIT8(KIMAP_NIL, "NIL");
+_LIT8(KIMAP_NO, "NO");
+_LIT8(KIMAP_PREAUTH, "PREAUTH");
+_LIT8(KIMAP_READWRITE, "READ-WRITE");
+_LIT8(KIMAP_READONLY, "READ-ONLY");
+_LIT8(KIMAP_RECENT, "RECENT");
+_LIT8(KIMAP_RFC822SIZE, "RFC822.SIZE");
+_LIT8(KIMAP_UID, "UID");
+_LIT8(KIMAP_UIDVALIDITY, "UIDVALIDITY");
+_LIT8(KIMAP_UIDNEXT, "UIDNEXT");
+_LIT8(KIMAP_MIME, "MIME");
+_LIT8(KIMAP_SEARCH, "SEARCH");
+
+// IMAP capabilities
+_LIT8(KIMAP_VERSION, "IMAP4rev1");
+_LIT8(KIMAP_STARTTLS, "STARTTLS");
+_LIT8(KIMAP_LOGINDISABLED, "LOGINDISABLED");
+_LIT8(KIMAP_IDLE, "IDLE");
+
+// IMAP commands (trailing spaces, except for those which take no params)
+_LIT8(KIMAPC_CLOSE, "CLOSE");
+_LIT8(KIMAPC_LOGOUT, "LOGOUT");
+_LIT8(KIMAPC_SUBSCRIBE, "SUBSCRIBE ");
+_LIT8(KIMAPC_UNSUBSCRIBE, "UNSUBSCRIBE ");
+_LIT8(KIMAPC_IDLE, "IDLE");
+_LIT8(KIMAPC_DONE, "DONE");
+
+// IMAP flags
+_LIT8(KIMAPFLAG_NOSELECT, "\\Noselect");
+_LIT8(KIMAPFLAG_NOINFERIORS, "\\Noinferiors");
+_LIT8(KIMAPFLAG_ANSWERED, "\\Answered");
+_LIT8(KIMAPFLAG_DELETED, "\\Deleted");
+_LIT8(KIMAPFLAG_DRAFT, "\\Draft");
+_LIT8(KIMAPFLAG_FLAGGED, "\\Flagged");
+_LIT8(KIMAPFLAG_RECENT, "\\Recent");
+_LIT8(KIMAPFLAG_SEEN, "\\Seen");
+_LIT8(KIMAPFLAG_UNREAD, "\\Unread");
+
+// MIME message types
+_LIT8(KMIME_MESSAGE, "MESSAGE");
+_LIT8(KMIME_RFC822, "RFC822");
+_LIT8(KMIME_TEXT, "TEXT");
+_LIT8(KMIME_HTML, "HTML");
+_LIT8(KMIME_XVCARD, "X-VCARD");
+_LIT8(KMIME_VCALENDAR, "X-VCALENDAR");
+_LIT8(KMIME_ICALENDAR, "CALENDAR");
+_LIT8(KMIME_NAME, "NAME");
+_LIT8(KMIME_NAME_RFC2231, "NAME*");
+_LIT8(KMIME_FILENAME, "FILENAME");
+_LIT8(KMIME_FILENAME_RFC2231, "FILENAME*");
+_LIT8(KMIME_ATTACHMENT, "ATTACHMENT");
+_LIT8(KMIME_DELIVERY_STATUS, "DELIVERY-STATUS");
+_LIT8(KMIME_ALTERNATIVE, "ALTERNATIVE");
+_LIT8(KMIME_RELATED, "RELATED");
+_LIT8(KMIME_IMAGE, "IMAGE");
+_LIT8(KMIME_AUDIO, "AUDIO");
+_LIT8(KMIME_VIDEO, "VIDEO");
+_LIT8(KMIME_APPLICATION, "APPLICATION");
+
+// Encoding types
+_LIT8(KMIME_BASE64, "BASE64");
+
+// Multipart types
+_LIT8(KMIME_MIXED, "MIXED");
+
+// for first stage download (to view in folder list)
+_LIT8(KImapFetchSmallHeaderToEnd, "%d UID FETCH %d:* (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From %S)])\r\n");
+_LIT8(KImapFetchSmallHeaderRange,"%d UID FETCH %d:%d (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From %S)])\r\n");
+_LIT8(KImapFetchSmallHeaderRangeRefined,"%d UID FETCH %S (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From %S)])\r\n");
+
+// for second stage download (to view when downloading whole email)
+_LIT8(KImapFetchLargeHeader, "%d UID FETCH %d (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Reply-to To Cc Bcc Message-ID %S)])\r\n");
+_LIT8(KImapFetchLargeHeaderRange, "%d UID FETCH %d:* (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Reply-to To Cc Bcc Message-ID %S)])\r\n");
+
+// Use %S so we can specify a refined FETCH based on a previous refined SEARCH
+_LIT8(KImapFetchLargeHeaderRangeRefined, "%d UID FETCH %S (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Reply-to To Cc Bcc Message-ID %S)])\r\n");
+// Constants for fetching body
+_LIT8(KImapFetchBodyPeek, "%d UID FETCH %d (BODY.PEEK[%S]<%d.%d>)\r\n");
+_LIT8(KImapFetchBody,     "%d UID FETCH %d (BODY[%S]<%d.%d>)\r\n");
+_LIT8(KImapFetchMimeBodyPeek, "%d UID FETCH %u (BODY.PEEK[%S]<0.%d> BODY.PEEK[%S.MIME])\r\n");
+_LIT8(KImapFetchMimeBody,     "%d UID FETCH %u (BODY[%S]<0.%d> BODY[%S.MIME])\r\n");
+
+// Constants for sending commands 
+_LIT8(KImapCommand, "%S\r\n");
+
+// The maximum number of octets to be uuencoded on each line is 45
+const TInt KUuDecodedLineLength = 45;	
+
+const TInt KBodyTextChunkSizeBytes = 512;
+const TInt KKiloByteSize = 1024;
+// UIDs are  32bit integers, which takes maximum 10 decimal digits.
+// KMaxUint32Chars is used to check whether the string containg the UID 
+// list has allocated enough memory when creating it.
+const TInt KMaxUint32Chars = 10;
+
+// Processing to remove illegal characters from a filename
+LOCAL_C void StripIllegalCharactersFromFileName(TDes16& aName)
+    {
+    TInt length=aName.Length();
+    for(TInt index=0; index < length; index++)
+        {
+		//parse extracted filename and replace any illegal chars  with a default
+        TUint charr=(TUint)aName[index];
+        if(	charr == '*' || charr == '\\' || charr == '<' || charr == '>' ||
+            charr == ':'  || charr == '"' || charr == '/' || charr == '|' ||
+			charr == '?' || charr < ' ')
+            {
+            aName[index] = KImcvDefaultChar;
+            }
+        }
+   }
+
+
+// We don't do the async notifications yet: they make everything a bit more wobbly
+// SJM actually I guess we do do them now!
+#define ASYNC_NOTIFICATIONS
+
+// do we automatically set the iRelatedId of each object to itself? No
+// for now as it confuses the offline handling code which assumes it
+// is a shadow entry if iRelatedId is set.
+#define SET_RELATED_ID	0
+
+// This is very nasty but necessary as the flag returning functions
+// return 0 or not-zero not 0 or 1
+
+#define FIXBOOL(a)		(a?ETrue:EFalse)
+
+// Directory structure
+CImImap4DirStruct::CImImap4DirStruct()
+	{
+	}
+
+CImImap4DirStruct::~CImImap4DirStruct()
+	{
+	// Get rid of leaf
+	delete iLeafname;
+	}
+
+void CImImap4DirStruct::SetLeafnameL(const TDesC& aName)
+	{
+	// Make buffer, set it
+	iLeafname=HBufC::NewL(aName.Length());
+	*iLeafname=aName;
+	}
+
+TPtrC CImImap4DirStruct::Leafname()
+	{
+	// Return it
+	return(*iLeafname);
+	}
+
+CImImap4Session::CImImap4Session(MImapSessionObserver& aObserver) // construct high-priority active object
+	: CMsgActive(1), iState(EImapStateDisconnected), iCancelledTag(-1),
+	  iSecurityState(EUnknown), iCharset(KCharacterSetIdentifierUtf8),
+	  iObserver(aObserver),iPrimarySession(NULL)
+	{
+	__DECLARE_NAME(_S("CImImap4Session"));
+	}
+
+CImImap4Session* CImImap4Session::NewLC(TInt aId, MImapSessionObserver& aObserver)
+
+	{
+	CImImap4Session* self=new (ELeave) CImImap4Session(aObserver);
+
+	CleanupStack::PushL(self);
+	self->ConstructL(aId);
+	return self;
+	}
+
+CImImap4Session* CImImap4Session::NewL(TInt aId, MImapSessionObserver& aObserver)
+	{
+	CImImap4Session* self=NewLC(aId, aObserver);
+	CleanupStack::Pop();
+	return self;
+	}
+
+void CImImap4Session::ConstructL(TInt aId)
+	{
+	// Add to active scheduler
+	CActiveScheduler::Add(this);
+
+	// Get FS
+	User::LeaveIfError(iFs.Connect());
+
+	// Get somewhere to store service settings
+	iServiceSettings=new (ELeave) CImImap4Settings;
+
+	// Get an IO processor
+	iImapIO=CImapIO::NewL(aId);
+
+	// Message selection
+	iSelection=new (ELeave) CMsvEntrySelection;
+
+	// List of messages to delete on folder close
+	iDeletedUids=new (ELeave) CArrayFixFlat<TMsvId>(8);
+
+	// List of messages to fetch in single fetch operation
+	iFetchList=new (ELeave) CArrayFixFlat<TMsvId>(8);
+
+	// List of messages who's Seen status has changed
+	iSetSeenList=new (ELeave) CArrayFixFlat<TMsvId>(8);
+	iClearSeenList=new (ELeave) CArrayFixFlat<TMsvId>(8);
+
+	RResourceFile resFile;
+	OpenResourceFileL(resFile,iFs);	// NB leaves if file not found
+
+	// make sure the resource file will be closed if anything goes wrong
+	// CloseResourceFile is declared in IMCVDLL.H and defined in IMCVDLL.CPP
+	TCleanupItem close(CloseResourceFile,&resFile);
+	CleanupStack::PushL(close);
+		
+	// Read iStore8BitData flag.
+	HBufC8* buf = resFile.AllocReadLC( STORE_8BIT_BODY_TEXT );
+	TResourceReader reader;
+	reader.SetBuffer(buf);
+	iStore8BitData = reader.ReadInt8();
+	CleanupStack::PopAndDestroy(buf);
+
+	buf=resFile.AllocReadLC(DEFAULT_ATTACHMENT_NAME);
+	reader.SetBuffer(buf);
+	iDefaultAttachmentName=reader.ReadTPtrC().AllocL();
+	CleanupStack::PopAndDestroy(2, &resFile); // buf, resFile (Close resfile)
+
+	if (!iStore8BitData)
+		{
+		// CRichText bits
+		iParaLayer=CParaFormatLayer::NewL();
+		iCharLayer=CCharFormatLayer::NewL();
+		}
+
+	// Create converter objects
+	iCharacterConverter=CCnvCharacterSetConverter::NewL();
+	iCharConv=CImConvertCharconv::NewL(*iCharacterConverter, iFs);
+	iHeaderConverter=CImConvertHeader::NewL(*iCharConv); 
+
+	// we assume that this message is MIME as we have no way of
+	// detecting otherwise (without sending a new FETCH to the
+	// server to get the MIME-Version).
+	iHeaderConverter->SetMessageType(ETrue);
+
+	// Get timer to defeat IMSK timeout
+	iDummyRead = CImImap4SessionDummyRead::NewL(*this, *iImapIO, Priority());
+	
+	iIdleRead =  CImImap4SessionIdleRead::NewL(*this, Priority());
+	
+	// List of message UIDs in a folder
+	iSearchList=new (ELeave) CArrayFixFlat<TUint32>(8);		// For granularity of 8, 32 bytes are allocated each time.
+	iSyncLimit = KImImapSynchroniseAll;
+	// set up progress types
+	iProgress.iType=EImap4GenericProgressType;
+	iCurrentDrive = MessageServer::CurrentDriveL(iFs);
+
+	iIdleTimerExpired = EFalse;
+
+	iIdleTimer = CIdleTimeoutTimer::NewL(*this);
+	iReissueIdle = EFalse;
+	iDisconnectAfterIdleStopped = EFalse;
+	iFetchPartialMail=EFalse;
+	iCaf = new (ELeave) CImCaf(iFs);
+
+	iIsICalendar = EFalse;
+	iIsVCalendar = EFalse;
+	
+	iUidString = HBufC8::NewL(KUidListStringSize);
+	
+	iCancelTimer = CImapCancelTimer::NewL(*this);
+	}
+
+CImImap4Session::~CImImap4Session()
+	{
+	Cancel(); // make sure we're cancelled
+
+	delete iDummyRead;
+	delete iIdleRead;
+
+	// No settings
+	delete iServiceSettings;
+	delete iPrefs;
+
+	// Get rid of connection
+	delete iImapIO;
+
+	// Get rid of message body bits
+	delete iBodyBuf;
+	delete iMessageBody;
+	delete iBodyText;
+	delete iParaLayer;
+	delete iCharLayer;
+	
+	// Message selection
+	delete iSelection;
+
+	// List of messages to delete
+	delete iDeletedUids;
+
+	// List of messages to fetch
+	delete iFetchList;
+
+	// List of seen flags to set/clear
+	delete iSetSeenList;
+	delete iClearSeenList;
+
+	// Partial line: used when doing Q-P decoding, as it works on a line at a time.
+	delete iPartialLine;
+
+	// Any attachment info (ie: there was a fetch in progress)
+	delete iAttachmentFile;
+	delete iAttachmentFullPath;
+	delete iAttachmentMimeInfo;
+	delete iDefaultAttachmentName;
+	delete iFooterString;
+	
+	// Any message sizer left over (ie: we've been deleted in the middle of
+	// an append operation)
+	delete iMessageSizer;
+	delete iMessageSender;
+	delete iLineBuffer;
+
+	// Characterset conversion
+	delete iHeaderConverter;
+	delete iCharConv;
+	delete iCharacterConverter;
+
+	// CMsvServerEntry used for moves
+	delete iMoveEntry;
+
+	//cached TMsvEntry data
+	delete iCachedEntryData;
+
+	// List of message UIDs in a folder
+	delete iSearchList;
+
+	// Selection passed during synchronisation
+	delete iSynchronisationSelection;
+
+	delete iIdleTimer;
+	delete iCaf;
+	delete iUidString;
+	iFs.Close();
+	
+	delete iCancelTimer;
+	
+	//Delete Username and Password
+	delete iUsername;
+	delete iPassword;
+	
+	// Note: iList is owned by a caller, not us - we don't delete it
+	}
+
+// Logging calls: passed through to ImapIO
+void CImImap4Session::LogText(const TDesC8& aString)
+	{
+	// Log the text
+	iImapIO->LogText(aString);
+	}
+
+void CImImap4Session::LogText(TRefByValue<const TDesC8> aFmt,...)
+	{
+	VA_LIST list;
+	VA_START(list,aFmt);
+	TBuf8<1024> aBuf;
+	//handles the data over flow panics. returns immediately without performing any action.
+	TDes8OverflowHandler overFlowHandler;
+	
+	aBuf.AppendFormatList(aFmt,list, &overFlowHandler);
+	LogText(aBuf);
+	}
+
+// Do setentry, leave if there is an error
+void CImImap4Session::SetEntryL(const TMsvId aId)
+	{
+#ifdef PRINTING
+	TInt error=iEntry->SetEntry(aId);
+	if (error)
+		LogText(_L8("SetEntryL(%x) returned %d"),aId,error);
+	User::LeaveIfError(error);
+#else
+	User::LeaveIfError(iEntry->SetEntry(aId));
+#endif
+	}
+
+// Change entry, leave if error
+void CImImap4Session::ChangeEntryL(const TMsvEntry& aEntry)
+	{
+#ifdef PRINTING
+	TInt error=iEntry->ChangeEntry(aEntry);
+	if (error)
+		LogText(_L8("ChangeEntryL(%x) returned %d"),aEntry.Id(),error);
+	User::LeaveIfError(error);
+#else
+	User::LeaveIfError(iEntry->ChangeEntry(aEntry));
+#endif
+	}
+
+// Change entry in bulk mode (i.e. no index file commit), leave if error
+void CImImap4Session::ChangeEntryBulkL(const TMsvEntry& aEntry)
+	{
+#ifdef PRINTING
+	TInt error=iEntry->ChangeEntryBulk(aEntry);
+	if (error)
+		LogText(_L8("ChangeEntryL(%x) returned %d"),aEntry.Id(),error);
+	User::LeaveIfError(error);
+#else
+	User::LeaveIfError(iEntry->ChangeEntryBulk(aEntry));
+#endif
+	}
+// Get children, leave if error
+void CImImap4Session::GetChildrenL(CMsvEntrySelection& aSelection)
+	{
+#ifdef PRINTING
+	TInt error=iEntry->GetChildren(aSelection);
+	if (error)
+		LogText(_L8("GetChildrenL() returned %d"),error);
+	User::LeaveIfError(error);
+#else
+	User::LeaveIfError(iEntry->GetChildren(aSelection));
+#endif
+	}
+
+// This can be called after Select() has completed to find out if the
+// folder has changed in any way since the last sync
+TBool CImImap4Session::FolderChanged() const
+	{
+	return iMailboxReceivedExists ||
+		iMailboxReceivedExpunge ||
+		iMailboxReceivedFlags;
+	}
+
+TBool CImImap4Session::ImapIdleSupported() const
+	{
+	return iUseIdleCommand && iCapabilityIdleSupport;
+	}
+
+TBool CImImap4Session::IsIdling() const
+	{
+	return(iState==EImapStateIdling);
+	}
+
+// Transfers the current selection into the iFolderIndex, and sorts it by
+// UID.
+void CImImap4Session::MakeSortedFolderIndexL(TBool aUseCachedEntryData)
+	{
+		
+	TInt noofchildren=iSelection->Count();
+	
+	// Reset folder index
+	iFolderIndex.SetSizeL(noofchildren);
+	TInt a=0;
+
+	if(!aUseCachedEntryData)
+		{ //can't rely on iCachedEntryData
+		TMsvEntry* entryPtr;
+		TMsvId id;
+		for(a=0;a<noofchildren;a++)
+			{
+			// Save UID/TMsvId of this entry
+			id=(*iSelection)[a];
+			User::LeaveIfError(iEntry->GetEntryFromId(id,entryPtr));
+			iFolderIndex[a].iUid=((TMsvEmailEntry)(*entryPtr)).UID();
+			iFolderIndex[a].iMsvId=id;
+			}
+		}
+	else
+		{
+		for(a=0;a<noofchildren;a++)
+			{
+			// Save UID/TMsvId of this entry
+			iFolderIndex[a].iUid=(*iCachedEntryData)[a].iUid;
+			iFolderIndex[a].iMsvId=(*iSelection)[a];
+			}
+		}
+
+	// Sort it by UID
+	iFolderIndex.Sort();
+
+	// Check for any duplicate UIDs (ie, a dud netscape server)
+	TMsvEntry* entryPtr;
+	TMsvEntry* nextEntryPtr;
+	for(a=1;a<noofchildren;a++)
+		{
+		if(iFolderIndex[a].iUid!=0 && iFolderIndex[a].iUid==iFolderIndex[a-1].iUid)
+			{
+			if(!aUseCachedEntryData)
+				{
+				// get the TMsvEntry for the message/folder
+				User::LeaveIfError(iEntry->GetEntryFromId(iFolderIndex[a].iMsvId,entryPtr));
+				User::LeaveIfError(iEntry->GetEntryFromId(iFolderIndex[a-1].iMsvId,nextEntryPtr));
+				// check if type of TMsvEntry and type of next TMsvEntry are both Messages
+				if( entryPtr->iType.iUid == nextEntryPtr->iType.iUid && entryPtr->iType.iUid == KUidMsvMessageEntryValue)
+					{
+					User::Leave(KErrCorrupt);
+					}
+				}
+			else
+				{
+				User::Leave(KErrCorrupt);
+				}
+			}
+			
+		}
+
+#ifdef PRINTING
+	LogText(_L8("MakeSortedFolderIndex done: index list follows. children=%d"),noofchildren);
+	for(a=0;a<noofchildren;a++)
+		LogText(_L8("  MsvId=%8x   UID=%d"),iFolderIndex[a].iMsvId,iFolderIndex[a].iUid);
+#endif
+	}
+
+HBufC* CImImap4Session::DoUnModUTF7LC(TDesC8& aBuffer)
+	{
+	iCharConv->PrepareToConvertToFromOurCharsetL(KCharacterSetIdentifierImapUtf7);
+
+	// unicode version won't be longer than the original (in chars)
+	HBufC* text=HBufC::NewL(aBuffer.Length());
+	CleanupStack::PushL(text);
+
+	//LogText(_L8("DoUnModUTF7LC: from %S"),&aBuffer);
+
+	TInt numUC, indexUC;
+	TPtr des = text->Des();
+	iCharConv->ConvertToOurCharsetL(aBuffer, des, numUC, indexUC);
+
+	//LogText(_L8("DoUnModUTF7LC: to   %S len %d numUC %d"),&des, des.Length(), numUC);
+	
+	return text;
+	}
+
+// Enquote a string (being sent as a string literal) if required
+void CImImap4Session::DoQuoteL(HBufC8*& aBuffer)
+	{
+	// Null string? Nothing to do
+	if (!aBuffer->Length() || !aBuffer->Des().Length()) return;
+
+	// Anything needing quoting in there?
+	if (aBuffer->Des().Locate('\\')==KErrNotFound &&
+		aBuffer->Des().Locate('\"')==KErrNotFound) return;
+
+	// Run through string, inserting quote characters as needed
+	for(TInt a=0;a<aBuffer->Des().Length();a++)
+		{
+		if (aBuffer->Des()[a]=='\\' || aBuffer->Des()[a]=='\"')
+			{
+			HBufC8 *newbuf=aBuffer->ReAllocL(aBuffer->Des().Length()+1);
+
+			// Been moved due to realloc?
+			if (newbuf!=aBuffer)
+				{
+				// In all cases when DoQuoteL() is called, the buffer is on the top of
+				// the cleanup stack: change this to indicate the correct entry
+				CleanupStack::Pop();
+				CleanupStack::PushL(aBuffer=newbuf);
+				}
+
+			aBuffer->Des().Insert(a,_L8("\\"));
+			a++;
+			}
+		}
+	}
+
+TInt CImImap4Session::FindFilename(const CImMimeHeader& aMimeInfo, TPtrC8& aFilename)
+	{
+	// Look in content-type list
+	const CDesC8Array& ctype=aMimeInfo.ContentTypeParams();
+
+	DBG((LogText(_L8("FindFilename: Checking %d entries in content-type list"),
+				ctype.Count())));
+
+	TInt tuple=0;
+	while(tuple<ctype.Count())
+		{
+#ifdef PRINTING
+		TPtrC8 t1=ctype[tuple],t2=ctype[tuple+1];
+		LogText(_L8("  %S %S"),&t1,&t2);
+#endif
+		// Look for "name xxx"
+		if (ctype[tuple].CompareF(KMIME_NAME)==0)
+			{
+			// Got it: report that we found it
+			aFilename.Set(ctype[tuple+1]);
+			TBuf8<KMaxFileName>buf(aFilename);
+			buf.Trim();
+			if(buf.Length()==0)
+				{
+				return(KErrNotFound);
+				}
+
+			return(KErrNone);
+			}
+		else if (ctype[tuple].CompareF(KMIME_NAME_RFC2231)==0)
+			{
+			// Got it: report that we found it
+			aFilename.Set(ctype[tuple+1]);
+			return(KErrRFC2231Encoded);
+			}
+		tuple+=2;
+		}
+
+	// Not found in the content type, try content disposition
+	tuple=0;
+	const CDesC8Array& cdisp=aMimeInfo.ContentDispositionParams();
+	while(tuple<cdisp.Count())
+		{
+#ifdef PRINTING
+		TPtrC8 t1=cdisp[tuple],t2=cdisp[tuple+1];
+		LogText(_L8("  %S %S"),&t1,&t2);
+#endif
+		// Look for "filename xxx"
+		if (cdisp[tuple].CompareF(KMIME_FILENAME)==0)
+			{
+			// Got it: report that we found it
+			aFilename.Set(cdisp[tuple+1]);
+			return(KErrNone);
+			}
+		else if (cdisp[tuple].CompareF(KMIME_FILENAME_RFC2231)==0)
+			{
+			// Got it: report that we found it
+			aFilename.Set(cdisp[tuple+1]);
+			return(KErrRFC2231Encoded);
+			}
+
+		tuple+=2;
+		}
+
+	// Didn't find it
+	return(KErrNotFound);
+	}
+	
+void CImImap4Session::FindFilenameDecodeL(const CImMimeHeader& aMimeInfo, TFileName& aFileName)
+	{
+	// Make an attachment name
+	aFileName.Zero();
+
+	TPtrC8 origFileName;
+
+	// Look for filename in Content-Type list
+	TInt err = FindFilename(aMimeInfo, origFileName);
+	if (KErrNotFound == err)
+		{
+		// Fall back to simple "attachment" (language specific)
+		aFileName=iDefaultAttachmentName->Des();
+		}
+	else if (KErrRFC2231Encoded == err)
+		{
+		// A file name has been found but it is encoded (RFC2231)
+		// Use the default file name but append the file extension so that its type can be recognised
+		aFileName=iDefaultAttachmentName->Des();
+		TInt dotPos = origFileName.Length() - 1;
+		TBool dotFound = EFalse;
+		
+		// Find the extension
+		while ((dotPos != 0) && (!dotFound))
+			{
+			if (origFileName[dotPos] == '.')
+				{
+				dotFound = ETrue;
+				// Extension found: append it to the filename
+				TInt extensionLength = origFileName.Length() - dotPos;
+				if ((aFileName.Length() + extensionLength) <= aFileName.MaxLength())
+					{
+					HBufC* extension = HBufC::NewLC(extensionLength);
+					extension->Des().Copy(origFileName.Right(extensionLength));
+					aFileName.Append(*extension);
+					CleanupStack::PopAndDestroy(extension);
+					}
+				}
+
+			--dotPos;
+			}
+		}
+	else
+		{
+		// Run it through the QP decoder
+		HBufC *decoded=HBufC::NewLC(origFileName.Length());
+		TPtr decoded_ptr(decoded->Des());
+
+		// Decode filename from the header
+		iHeaderConverter->DecodeHeaderFieldL(origFileName, decoded_ptr);
+		
+		DBG((LogText(_L8("FindFilenameDecode: '%S' to '%S' "),&origFileName,&decoded_ptr)));
+
+		// Need to do a check on the filename length here.
+		// If it is too long, set to the max possible, keeping extension.
+		TFileName path;
+			
+		TInt fileNameLength = path.Length() + decoded_ptr.Length();
+
+		if( fileNameLength > KMaxFileName)
+			{
+#ifdef __WINS__
+			TFileName winsFileName;
+			TFileName mailStoreDrive;
+			TDriveUnit drive(MessageServer::CurrentDriveL(iFs));
+			mailStoreDrive.Append(drive.Name());
+			mailStoreDrive.Append(KPathDelimiter);
+			MapEmulatedFileName(winsFileName, mailStoreDrive);
+			TInt prefixLen = winsFileName.Length();
+#else
+			TInt prefixLen = 0;
+#endif
+			// Crop the Old File Name
+			TInt lengthToCrop = (fileNameLength - KMaxFileName) + prefixLen;
+			// Use LocateReverse rather than TParsePtr as decoded_ptr may be > 256 chars
+			TInt dot = decoded_ptr.LocateReverse( '.' );
+			TPtrC extension = decoded_ptr.Mid(dot != KErrNotFound ? dot : decoded_ptr.Length());
+			TInt newFileNameLength = decoded_ptr.Length() - extension.Length() - lengthToCrop;
+			TPtrC newFileName=decoded_ptr.Left(newFileNameLength);
+
+			// Create the New File Name (ie File Name & Extension)
+			aFileName.Zero();
+			aFileName.Append(newFileName);
+			aFileName.Append(extension);
+			}
+		else
+			{
+			aFileName.Copy(decoded_ptr);
+			}
+		CleanupStack::PopAndDestroy(); // decoded
+		}
+	}
+
+// Update iDate in iMailboxId to show the time now (last sync time)
+void CImImap4Session::SyncCompleteL()
+	{
+        DBG((LogText(_L8("CImImap4Session::SyncCompleteL()"))));
+	// Find entry
+	SetEntryL(iMailboxId);
+	TMsvEmailEntry message=iEntry->Entry();
+
+	// Find 'now'
+	TTime now;
+	now.UniversalTime();
+	message.iDate=now;
+
+	// Check to see if there has been a change in the number of messages in the remote folder.
+	TBool folderSizeChanged=(message.RemoteFolderEntries()!=iMailboxSize);
+
+	// Set 'unread' flag on folder if there are any unread messages within it
+	if (FIXBOOL(message.Unread())!=iSomeUnread || !message.Visible() || folderSizeChanged)
+		{
+		// Update flags
+		message.SetUnread(iSomeUnread);
+		message.SetVisible(ETrue);
+		message.SetRemoteFolderEntries(iMailboxSize);
+ 		ChangeEntryBulkL(message);
+		}
+
+	// we need to ensure the hierarchy of folders containing this one
+	// is now visible. Note previously this incorrectly only did this
+	// when we were not in DisconncetedUserMode
+	do
+		{
+		// Move up one
+		SetEntryL(message.Parent());
+		message=iEntry->Entry();
+
+		// Ensure visibility
+		if (!message.Visible())
+			{
+			message.SetVisible(ETrue);
+			ChangeEntryL(message);
+			}
+		}
+	while(message.iType!=KUidMsvServiceEntry);
+	
+	// Before we got back to the idle state, we need to commit any
+	// outstanding entries to the index file to complete the bulk
+	// synchronization operation
+	iEntry->CompleteBulk();
+
+	if (iReissueIdle)
+		{
+		iState=EImapStateSelected;
+		DoStartIdleL();
+		}
+	}
+
+// Reset subscription flags for all children, and recurse into folders
+void CImImap4Session::ResetSubscriptionFlagsL(const TMsvId aFolder)
+	{
+	// Do this one
+	SetEntryL(aFolder);
+	TMsvEmailEntry entry=iEntry->Entry();
+
+	// A folder or service? If not, return
+	if (entry.iType!=KUidMsvServiceEntry &&
+		entry.iType!=KUidMsvFolderEntry)
+		return;
+
+	// Reset flag if needed
+	if (entry.Subscribed())
+		{
+		// Reset flag and save
+		entry.SetSubscribed(EFalse);
+		ChangeEntryL(entry);
+		}
+
+	// Any children?
+	CMsvEntrySelection *children=new (ELeave) CMsvEntrySelection;
+	CleanupStack::PushL(children);
+	GetChildrenL(*children);
+	if (children->Count())
+		{
+		// Do each in turn
+		for(TInt child=0;child<children->Count();child++)
+			ResetSubscriptionFlagsL((*children)[child]);
+		}
+	CleanupStack::PopAndDestroy();
+	}
+	
+TBool CImImap4Session::IsCancelling() const
+	{
+	return iCancelAndIdle;
+	}
+	
+void CImImap4Session::CancelAndIdleL(TBool aReissueIdle)
+	{
+	// Flag that a cancel and idle command has been requested.
+	iCancelAndIdle = ETrue;
+
+	switch( iState )
+		{
+	case EImapStateFetchWait:
+		{
+		// Stop requesting fetches and wait for the current fetches to be completed.
+		iState = EImapStateFetchCancelWait;
+		iReissueIdle = aReissueIdle;
+		
+		// Start an idle timer - this is ensure that if the GPRS session is currently
+		// suspended we don't hang forever waiting for the remaining fetch data to be
+		// received.
+		iCancelTimer->After(KImapFetchCancelIdleTime);
+		
+		// Delete any partially downloaded attachments
+		if ( iAttachmentFileState == EFileIsOpen )
+			{
+			iAttachmentFileState=EFileIsIncomplete;
+			if(iCaf->Processing())
+				{
+				iCaf->EndProcessingL();
+				}
+			else
+				{
+				iAttachmentFile->CloseFile();
+				}
+			CMsvStore* store = iEntry->EditStoreL(); 
+			CleanupStack::PushL(store);
+			// Could be multiple attachments in the folder.
+			TInt i;
+			TInt attachmentCount = store->AttachmentManagerL().AttachmentCount();
+			for(i=0;i<attachmentCount;i++)
+				{
+				// Remove [0] as array is shuffled. Once index [n] is removed n+1 becomes n
+				store->AttachmentManagerExtensionsL().RemoveAttachmentL(0);
+				}
+			if(attachmentCount)			
+				store->CommitL();
+			CleanupStack::PopAndDestroy(store);
+			TMsvEmailEntry message=iEntry->Entry();
+
+			CreateAttachmentInfoL((TMsvEmailEntry&)iEntry->Entry());
+			ChangeEntryBulkL(message);
+			}
+	
+		DBG((LogText(_L8("CImImap4Session::CancelAndIdleL() - fetch cancel; continue to process requested fetches - no more parts to be requested"))));
+		} break;
+		
+	case EImapStateIdleWait:
+		{
+		// Not much to do - already issued IDLE command, just wait for the IDLE 
+		// command to 'start'.
+		// NOTE - set the iReissueIdle flag to ensure that IssueIdleRead is 
+		// called when we get the server response.
+		iReissueIdle = aReissueIdle;
+		
+		// Start an idle timer - this is ensure that if the GPRS session is currently
+		// suspended we don't hang forever waiting for the remaining data to be
+		// received.
+		iCancelTimer->After(KImapFetchCancelIdleTime);		
+		
+		DBG((LogText(_L8("CImImap4Session::CancelAndIdleL() - waiting for IDLE - continue"))));
+		} break;
+		
+	case EImapStateIdling:
+		{
+		// Nothing much to do here - already IDLE-ing! Unset the cancel-and-idle flag
+		iCancelAndIdle = EFalse;
+		DBG((LogText(_L8("CImImap4Session::CancelAndIdleL() - already IDLE-ing - do nothing"))));
+		} break;
+	
+	case EImapStateStopIdleWait:
+		{
+		// Need to wait for the current IDLE command to complete, then re-issue
+		// another one!!
+		iReissueIdle = aReissueIdle;
+
+		// Start an idle timer - this is ensure that if the GPRS session is currently
+		// suspended we don't hang forever waiting for the remaining data to be
+		// received.
+		iCancelTimer->After(KImapFetchCancelIdleTime);
+		
+		DBG((LogText(_L8("CImImap4Session::CancelAndIdleL() - IDLE stop requested - wait for response and then re-issue IDLE command"))));
+		} break;
+		
+	case EImapStateSelectWait:
+		{
+		// Waiting for select to complete - issue IDLE once select completes.
+		// A check will be made to ensure that the selected mailbox is the inbox.
+
+		iReissueIdle = aReissueIdle;
+
+		// Start an idle timer - this is ensure that if the GPRS session is currently
+		// suspended we don't hang forever waiting for the remaining data to be
+		// received.
+		iCancelTimer->After(KImapFetchCancelIdleTime);
+		
+		DBG((LogText(_L8("CImImap4Session::CancelAndIdleL() - cancel select - wait for response and then issue IDLE command"))));		
+		} break;
+		
+	case EImapStateSelected:
+		{
+		// A mailbox has been selected - does IDLE need to be re-issued?
+		iReissueIdle = aReissueIdle;
+		
+		if( iReissueIdle )
+			{
+			// Yep, need to re-issue the IDLE (as was IDLE-ing before).
+			// For this need to be in the INBOX as a writable-select.
+			
+			// First reset counts to safe values here to avoid reporting left
+			// over values from previous fetch. Correct values will be set up
+			// once headers have been fetched and parts counted (taken from SelectL).
+			iProgress.iPartsToDo=iProgress.iBytesToDo=1;
+			iProgress.iPartsDone=iProgress.iBytesDone=0;
+
+			// Do the select (if we really need to) or skip if possible.
+			if( iMailboxId==GetInbox() && iMailboxWritable )
+				{
+				DBG((LogText(_L8("Need to re-issue IDLE command"))));
+
+				// No need to do the select - so re-issue the IDLE
+				DoStartIdleL();				
+				}
+			else
+				{
+				DBG((LogText(_L8("Need to issue IDLE - first select Inbox (writable)"))));
+			
+				// Looks like we need to do the select...
+				DoSelectL(GetInbox(), ETrue);
+				}
+			}		
+		else
+			{
+			DBG((LogText(_L8("Do not re-issue IDLE - cancel completed"))));
+			
+			// Cancelling completed - stay in this mailbox and do not issue idle.
+			iCancelAndIdle = EFalse;
+			}			
+		} break;
+		
+	case EImapStateMoveEntryWait:
+		{
+		// We're cancelling a move entry: we need to stop it specifically
+		iMoveEntry->Cancel();
+		iState=iSavedState;	
+		
+		// Recurse (yuk!) into method with the new 'saved' state.	
+		CancelAndIdleL(aReissueIdle);
+		return;
+		}
+		// No break statement required due to return statement
+
+	default:
+		// For all other states - just do a 'normal' cancel - this will probably
+		// disconnect the session.
+		iCancelAndIdle = EFalse;
+		Cancel();
+		return;
+		}
+
+	// Need to complete the parent/observer.
+	CMsgActive::DoCancel();
+	}
+	
+// Called when parent wants to cancel current operation
+void CImImap4Session::DoCancel()
+	{
+	DBG((LogText(_L8("CImImap4Session::DoCancel() called whilst in state %d"),iState)));
+
+	if(IsIdling())
+		{
+		iIdleRead->Cancel();
+		}
+	else 
+		{
+		if(iAttachmentFile && iAttachmentFileState==EFileIsOpen)
+			{
+			DBG((LogText(_L8("CImImap4Session::DoCancel() closing attachment file"))));
+			if(iCaf->Processing())
+				{
+				TRAP_IGNORE(iCaf->EndProcessingL());
+				}
+			else
+				{
+				iAttachmentFile->CloseFile();
+				}
+			iAttachmentFileState=EFileNotOpen;
+			}
+	
+		// What were we about to do?
+		switch(iState)
+			{
+		case EImapStateConnectWait:
+		case EImapStateGreetingWait:
+		case EImapStateLoginSendUser:
+		case EImapStateLoginSendPassword:
+		case EImapStateLoginWait:
+			DoDisconnect();
+			break;
+			
+		case EImapStateSelectWait:
+			// Selecting: fail back to noselect
+			iState=EImapStateNoSelect;
+			break;
+
+		case EImapStateMoveEntryWait:
+			// We're cancelling a move entry: we need to stop it specifically
+			iMoveEntry->Cancel();
+			iState=iSavedState;
+			break;
+
+
+		default:
+			// Something else: disconnect for safety
+			DoDisconnect();
+			break;
+			}
+
+		// Note tag which we've cancelled: anything outstanding, basically,
+		// which means anything up to (and including) the last command issued,
+		// which is iTag
+		iCancelledTag=iTag;
+
+		iImapIO->Cancel();
+		}
+ 
+	iIdleTimer->Cancel();
+
+	DBG((LogText(_L8("CImImap4Session::DoCancel() finished 1"))));
+
+	// ...ask parent to finish up
+	CMsgActive::DoCancel();
+
+	DBG((LogText(_L8("CImImap4Session::DoCancel() finished 2"))));
+	}
+
+// Disconnect and complete with an error code
+void CImImap4Session::Fail(const TInt aError)
+	{
+	DBG((LogText(_L8("CImImap4Session::Fail(%d)"),aError)));
+	DoDisconnect();
+        DBG((LogText(_L8("-----------------------------------------------------------"))));
+	DBG((LogText(_L8("CImap4Session::Fail(): calling Complete()"))));
+	DBG((LogText(_L8("-----------------------------------------------------------"))));
+	Complete(aError);
+	}
+	
+void CImImap4Session::DoDisconnect()
+	{
+	DBG(LogText (_L8("CImImap4Session::DoDisconnect()")));
+	iImapIO->Disconnect();
+	iState = EImapStateDisconnected;
+	iSecurityState = EUnknown;
+	iCommandsOutstanding = 0;
+	iSendQueued = EFalse;
+	iReceiveQueued = EFalse;
+	iReissueIdle = EFalse;
+	iCancelAndIdle = EFalse;
+	iIdleTimer->Cancel(); 
+	iIdleTimerExpired = EFalse;
+	}
+
+void CImImap4Session::DummyComplete(TInt aError)
+	{
+	DBG(LogText(_L8("+ CImImap4Session::DummyComplete(err=%d)"), aError));
+	if(aError >= KErrNone)
+		{ // Got a response, let's have a look at it
+		CImapAtom* p=iImapIO->RootAtom()->Child();
+		if (!p)
+			{
+			aError = KErrNotFound;
+			return;
+			}
+
+		if (p->Compare(KIMAP_UNTAGGED))
+			{
+			// Process it, it could be something useful
+			TRAP( aError, ProcessUntaggedL(p->ToNextL(),EFalse) );
+			DBG( LogText(_L8("Dummy read untagged msg processed with %d"), aError) );
+			}
+		else
+			{
+			// Got a valid response that wasn't untagged... uhoh!
+			DBG( LogText(_L8("Dummy read received a non-untagged response!")) );
+			aError = KErrCorrupt;
+			}
+		}
+
+	if(aError < KErrNone)
+		{
+		// If the dummy read returned an error then the line was probably dropped,
+		// or, if the read returned something that was rubbish then the server is 
+		// not playing by the rules.
+		// Either way, let's disconnect.
+		LostConnection(aError);
+
+		// Can't report the error, no one to report to
+ 		}
+	DBG( LogText(_L8("- CImImap4Session::DummyComplete()")) );
+	}
+
+void CImImap4Session::LostConnection(TInt /*aError*/)
+	{
+	// the line must have been dropped so call DoDisconnect to ensure state is up
+	// to date
+	DoDisconnect();
+
+	// mark service as offline immediately
+	// the returned error code ignored
+	if (iEntry->SetEntry(iServiceId))
+		{
+		TMsvEntry entry=iEntry->Entry();
+		entry.SetConnected(EFalse);
+		iEntry->ChangeEntry(entry);
+		}
+	}
+
+
+void CImImap4Session::IdleReadError(TInt aError)
+	{	
+	 // Read completed with an error, probably lost the connection
+	DBG(LogText(_L8("IMAP Idle outstanding read completed with %d"), aError));
+
+	LostConnection(aError);
+
+	// Stop the idle timer so that it does not try to restart the idle when it expires
+	iIdleTimer->Cancel();
+	}
+ 
+
+void CImImap4Session::IssueIdleRead()
+	{
+	__ASSERT_DEBUG(IsIdling() && !IsActive(), gPanic(EBadUseOfImap4Op));
+	DBG((LogText(_L8("Idle read issued"))));
+	iIdleRead->Start(iStatus);
+	DBG((LogText(_L8("******************************************************************"))));
+	DBG((LogText(_L8("CImImap4Session::IssueIdleRead(): waiting for iIdleRead to wake me"))));
+	DBG((LogText(_L8("******************************************************************"))));
+ 	SetActive();
+ 	}
+	
+
+void CImImap4Session::IssueDummy()
+	{
+#ifdef ASYNC_NOTIFICATIONS
+	// Issue a dummy read from the CImapIO class so we can check the connection
+	// status. ONLY IF WE'RE CONNECTED!
+	if (iState>=EImapStateNoSelect)
+		{
+		iDummyRead->Start();
+		}
+#endif
+	}
+
+void CImImap4Session::CancelDummy()
+	{
+#ifdef ASYNC_NOTIFICATIONS
+	// Cancel it!
+	iDummyRead->Cancel();
+#endif
+	}
+
+void CImImap4Session::ReissueIdleL()
+	{
+	DBG((LogText(_L8("CImImap4Session::Re-issueIdle(): State: %d"), iState)));
+ 	Cancel();
+ 
+        DBG((LogText(_L8("CImImap4Session::ReIssueIdle(): setting iReissueIdle to true"))));
+ 	iReissueIdle=ETrue;
+	DoStopIdleL();
+	}
+
+void CImImap4Session::ReissueDummy()
+	{
+	IssueDummy();
+	}
+
+
+void CImImap4Session::DoComplete(TInt& aStatus)
+	{
+	DBG((LogText(_L8("CImImap4Session::DoComplete(iState=%d, aStatus=%d)"),iState,aStatus)));
+
+	if (iState == EImapStateSelected)
+		{
+		iCompoundStopIdle = EFalse;
+		iStoppingIdleForSync = EFalse;
+		}
+
+	if( iState != EImapStateFetchCancelWait &&
+		iAttachmentFile && iAttachmentFileState==EFileIsOpen )
+		{
+		// Do not close the attachment file if we're cancelling the fetch - we 
+		// will still be receiving data and if this completes the attachment
+		// then we want the attachment file available for that.
+		
+		DBG((LogText(_L8("CImImap4Session::DoComplete closing attachment file"))));
+		if(iCaf->Processing())
+			{
+			TRAP_IGNORE(iCaf->EndProcessingL());						
+			}
+		else
+			{
+			iAttachmentFile->CloseFile();
+			}
+		iAttachmentFileState=EFileNotOpen;
+		}
+
+	// All ok?
+	if (aStatus==KErrNone)
+		{
+		// Everything is fine. However, we need to queue a dummy read from the
+		// CImapIO layer to ensure that we get notified if the connection dies
+		// unexpectedly		
+
+		// Update the progress error code first.
+		iProgress.iErrorCode=aStatus;
+
+		if (ImapIdleSupported()==EFalse)
+			{
+			IssueDummy();
+			}
+
+		if (IsIdling())
+			{
+			IssueIdleRead();
+			}
+
+		return;
+		}
+		
+	if( iCancelAndIdle )
+		{
+		// Record the error code and exit the method - ensure that we don't
+		// disconnect.
+		iProgress.iErrorCode=aStatus;
+		return;
+		}
+
+	// Some error has ocurred. Deal with it.
+	switch(iState)
+		{
+	case EImapStateCreateWait:
+	case EImapStateRenameWait:
+	case EImapStateDeleteWait:
+	case EImapStateSubscribeWait:
+		// A 'KErrIMAPNO' error isn't fatal to the connection
+		if (aStatus==KErrCancel)
+			{
+			// Back to previous state: these commands won't have
+			// disturbed it.
+			iState=iSavedState;
+			return;
+			}
+		else if (aStatus==KErrIMAPNO)
+			{
+			// Report error
+			if (iState == EImapStateDeleteWait)
+				iProgress.iErrorCode=KErrImapCantDeleteFolder;
+			else
+				iProgress.iErrorCode=KErrNotSupported;
+			aStatus=iProgress.iErrorCode;
+
+			// Back to previous state
+			iState=iSavedState;
+			return;
+			}
+
+		// Otherwise, process as per normal
+		break;
+
+	case EImapStateSelectWait:
+	case EImapStateSynchroniseWait:
+		// KErrIMAPNO isn't fatal, we just go back to the selected state
+		if (aStatus==KErrIMAPNO)
+			{
+			iState=EImapStateSelected;
+			return;
+			}
+		break;
+
+	case EImapStateMoveEntryWait:
+		// We're done with the moveentry
+
+		// Park the move entry again
+		iMoveEntry->SetEntry(NULL);
+		break;
+		
+	case EImapStateIdleWait:
+	case EImapStateStopIdleWait:
+		if (iIdleTimerExpired)
+			{
+			// error has occurred following re-issue of an IDLE command
+			// Notify the server MTM that the error has occurred as there
+			// is no outstanding asynchonous request on this session.
+			// (IDLE is issued autonomously by the IMAP Session).
+			iObserver.NonCompletedFailure();
+			}
+		break;	
+
+	case EImapStateFetchCancelWait:
+		// record the error (i.e. cancel) for progress and do not disconnect.
+		iProgress.iErrorCode=aStatus;
+		// drop through to next case... (as that is returning and so not disconnecting).
+	case EImapStateNoSelect:
+	case EImapStateSelected:
+	case EImapStateIdling:
+		return;
+
+	default:
+		break;
+		}
+
+	// If we get here with an error, then we need to disconnect.
+	// Earlier on, if there was a time when disconnection wasn't
+	// required, we would have returned.
+	DoDisconnect();
+	
+	// Save error code in progress
+	iProgress.iErrorCode=aStatus;
+	}
+
+// Copy a message: in fact, we move the entire message to the destination, but
+// then recreate the empty shell (no parts fetched) of the source
+void CImImap4Session::CopyMessage(TRequestStatus& aRequestStatus, const TMsvId aSourceFolder, const TMsvId aSource, const TMsvId aDestinationFolder, TMsvId* aNewSource, const TBool aRemoveOriginal)
+	{
+	TInt err=KErrNone;
+	if (!Connected())
+		{
+		Queue(aRequestStatus);
+		err=KErrDisconnected;
+		}
+	else
+		TRAP(err,CopyMessageL(aRequestStatus, aSourceFolder, aSource, aDestinationFolder, aNewSource, aRemoveOriginal));
+	if (err!=KErrNone)
+		{
+		// park moveentry if it fails to get going
+		if (iMoveEntry)
+			iMoveEntry->SetEntry(NULL);
+                DBG((LogText(_L8("-----------------------------------------------------------"))));
+		DBG((LogText(_L8("CImap4Session::CopyMessage(): calling Complete()"))));
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+
+		Complete(err);
+		}
+	}
+
+void CImImap4Session::CopyMessageL(TRequestStatus& aRequestStatus, const TMsvId aSourceFolder, const TMsvId aSource, const TMsvId aDestinationFolder, TMsvId* aNewSource, const TBool aRemoveOriginal)
+	{
+	LOG_COMMANDS((LogText(_L8("COMMAND CopyMessage(%x (in %x) to %x)"),aSource,aSourceFolder,aDestinationFolder)));
+
+	Queue(aRequestStatus);
+
+	// Get a moveentry if we don't already have one
+	if (!iMoveEntry)
+		{
+		// Get a MoveEntry: we need to ask for one as a child of this entry, so
+		// move it to the root and ask for a child in the local service, which should
+		// always be there.
+		SetEntryL(KMsvRootIndexEntryId);
+
+		// Get child
+		iMoveEntry=iEntry->NewEntryL(KMsvLocalServiceIndexEntryId);
+		}
+
+	// Do the move, using the iMoveEntry CMsvServerEntry object, after parking our original
+	// one
+	iEntry->SetEntry(NULL);
+	User::LeaveIfError(iMoveEntry->SetEntry(aSourceFolder));	
+
+	DBG((LogText(_L8("About to call iEntry->MoveEntry(%x,%x) when in folder %x"),aSource,aDestinationFolder,aSourceFolder)));
+
+	// We're moving - note bits for bottom half handling
+	iMoveSource=aSource;
+	iMoveSourceFolder=aSourceFolder;
+	iNewSource=aNewSource;
+
+	// Cancel any dummy operation that might be outstanding
+	if (ImapIdleSupported()==EFalse)
+		{
+		CancelDummy();
+		}
+
+	// Trap around this so we can park moveentry if it fails
+	//DS - now selectively either Copy or Move.
+	aRemoveOriginal?
+		iMoveEntry->MoveEntryL(aSource,aDestinationFolder,iStatus):
+		iMoveEntry->CopyEntryL(aSource,aDestinationFolder,iStatus);
+
+	// Move into the new state and go active
+	iSavedState=iState;
+	iState=EImapStateMoveEntryWait;
+	if (!IsActive()) SetActive();
+	}
+
+#if 0
+// Debug only: print out a representation of the parse tree
+void CImImap4Session::showtree(CImapAtom *root,int indent)
+	{
+	TInt b=0;
+
+	// Run through children
+	do
+		{
+		TPtrC8 atom=root->Atom();
+		LogText(_L8("%03d Sibling %d: '%S'"),indent,b++,&atom);
+
+		if (root->Child())
+			showtree(root->Child(),indent+2);
+
+		root=root->Next();
+		}
+	while(root);
+	}
+#endif
+
+// Parse greeting message
+TInt CImImap4Session::ProcessGreetingL()
+	{
+	CImapAtom* p=iRootAtom->ToChildL();
+
+	// Should be a '*'
+	if (!p->Compare(KIMAP_UNTAGGED))
+		User::Leave(KErrGeneral);
+	
+	// Greeting line can be:
+	// * BYE ... (server busy)
+	// * PREAUTH ... (no login needed)
+	// * OK ... (normal)
+	p=p->ToNextL();
+	if (p->Compare(KIMAP_BYE))
+		{
+		// Server is busy
+		return(KErrImapServerBusy);
+		}
+	else if (p->Compare(KIMAP_PREAUTH))
+		{
+		// Already authorised, straight into Noselect
+		iSavedState=EImapStateNoSelect;
+		}
+	else if (p->Compare(KIMAP_OK))
+		{
+		// Need to login
+		iSavedState=EImapStateLoginWait;
+
+		// Is this a CC:Mail server? (paranoid mode)
+		if (p->Next())
+			{
+			if (p->Next()->Compare(_L8("CC:Mail")))
+				{
+				// We are, note it.
+				iTalkingToCCMail=ETrue;
+
+				DBG((LogText(_L8("We're talking to a CC:Mail server, modified fetch strategy enabled."))));
+				}
+			else if (p->Next()->Compare(_L8("OpenMail")) )
+				{
+				iTalkingToOpenMail=ETrue;
+				DBG((LogText(_L8("We're talking to an OpenMail server, modified fetch strategy enabled."))));
+				}
+			}
+		}
+
+	// Looks ok
+	return(KErrNone);
+	}
+
+// Parse select reply messages
+TInt CImImap4Session::ProcessCommandReplyL()
+	{
+	CImapAtom *p=iRootAtom->ToChildL();
+
+	// Which command does this reply belong to?
+	TInt thisis=iTag-(iCommandsOutstanding-1);
+
+	// A cancelled command?
+	TBool cancelled(EFalse);
+	if (thisis<=iCancelledTag)
+		{
+		cancelled=ETrue;
+		}
+
+	// '+' indicates ideling
+	if (p->Compare(KIMAP_CONTINUATION))
+		{
+		return(ProcessContinuationResponse(p->ToNextL()));
+		}
+
+	// '*' indicates an untagged message
+	if (p->Compare(KIMAP_UNTAGGED))
+		{
+		// Process it
+		return(ProcessUntaggedL(p->ToNextL(),cancelled));
+		}
+	
+	// If we got here, it's a tagged reply.
+	// Check it's the one we're expecting
+	TInt tag(0);
+	TInt error(p->Value(tag));
+	if (error!=KErrNone)
+		{
+		// Problem parsing
+		return error;
+		}
+	
+	// Some command sequencing debugging
+	DBG((LogText(_L8("Expecting tag %d, got tag %d"),thisis,tag)));
+
+	// One less outstanding command
+	iCommandsOutstanding--;
+
+	// If the tagged reply is for a command that had been cancelled,
+	// and there are still commands outstanding, then don't complete:
+	// instead, just keep reading replies.
+	if (tag < iCancelledTag + 1)
+		{
+		return KErrNotReady;
+		}
+
+	// Move on to result
+	p=p->ToNextL();
+
+#ifdef PRINTING
+	// Print success of failure
+	TPtrC8 n=p->Atom();
+	LogText(_L8("Result for command tag %d is '%S'"),iTag,&n);
+#endif
+	// If it's OK, pass it to untagged processor
+	if (p->Compare(KIMAP_OK))
+		{		
+		// It might have stuff like 'READ-WRITE' in it... but only if
+		// the next atom has a child (ie open bracket)
+		if (p->Next() && p->Next()->Child())
+			{
+			DBG((LogText(_L8("CImap4Session::ProcessCommandReply(): OK recieved with children"))));
+ 			// Ignore the return code: we've got our tagged reply!
+			ProcessUntaggedL(p,EFalse);
+			}
+		else
+			{
+			// received ok response
+			DBG((LogText(_L8("CImap4Session::ProcessCommandReply(): OK received - no children"))));
+			}
+		return(KErrNone);
+		}
+	else if (p->Compare(KIMAP_NO))
+		{
+		// The server didn't like this
+		return(KErrIMAPNO);
+		}
+
+	// It's not OK: there's been an error
+	return(KErrGeneral);
+	}
+
+// Parse Continuation Response
+TInt CImImap4Session::ProcessContinuationResponse(CImapAtom* /*aAtom*/)
+	{
+	if (iState==EImapStateIdleWait)
+		{
+		iState = EImapStateIdling;
+		if(!iIdleTimer->IsActive())
+			{
+			iIdleTimer->After(iIdleTimeout);
+			}
+		return KErrNone;
+		}
+	else
+		{
+		return KErrArgument;
+		}
+	}
+
+// Parse untagged messages
+TInt CImImap4Session::ProcessUntaggedL(CImapAtom *aAtom, const TBool aCancelled)
+	{
+	DBG((LogText(_L8("CImap4Session::ProcessUntaggedL(): running..."))));
+
+	CImapAtom *p=aAtom;
+
+	// Look at first atom
+	if (static_cast<TChar>(p->Atom()[0]).IsDigit())
+		{
+		// First atom is a number
+		TUint  msgnr(0);
+
+		// Got it ok?
+		if (p->Value(msgnr)!=KErrNone)
+			User::Leave(KErrArgument);
+
+		// Next atom will be one of:
+		// EXISTS, RECENT, FETCH, etc
+		p=p->ToNextL();
+		if (p->Compare(KIMAP_EXISTS))
+			{
+			// Mailbox size changed?
+			DBG((LogText(_L8("Mailbox size now %d was %d"),msgnr,iMailboxSize)));
+
+			// Note it
+			if (iMailboxSize != static_cast<TInt>(msgnr) )
+				{
+				// Set it to EXISTS
+				iMailboxSize=msgnr;
+
+				// if the EXISTS didn't report a change in size then
+				// pretend it wasn't received
+				iMailboxReceivedExists=ETrue;
+				}
+
+			// Resize index
+			iFolderIndex.SetSizeL(iMailboxSize);
+			}
+		else if (p->Compare(KIMAP_EXPUNGE))
+			{
+			// Note it
+			iMailboxReceivedExpunge=ETrue;
+			}
+		else if (p->Compare(KIMAP_RECENT))
+			{
+			// Note it
+			iMailboxRecent=msgnr;
+			}
+		else if (!aCancelled && p->Compare(KIMAP_FETCH))
+			{
+			// Process fetch: any fetch data following?
+			if (p->Next() && p->Next()->Child())
+				{
+				// Got an open bracket situation, looks good
+				return(ProcessFetchL(msgnr,p->Next()->Child()));
+				}
+			else
+				User::Leave(KErrGeneral);
+			}
+		else
+			{
+#ifdef PRINTING
+			// Unknown
+			TPtrC8 a=p->Atom();
+			LogText(_L8("Unknown reply '* %d %S'"),msgnr,&a);
+#endif
+			}
+		}
+	else
+		{
+		// First atom not a number. Is it OK?
+		if (p->Compare(KIMAP_OK))
+			{
+			// OK *can* be followed by bracketed attrib or attrib/value pair
+			// however, this is not always the case: for example, EXAMINE'ing
+			// a new folder with Netscape IMAP4rev1 Service 3.56 gives this
+			// response:
+			// 24/01/99 13:44:58 >> 53 EXAMINE "Thingy/trevor"
+			// 24/01/99 13:44:59 << * OK Reset UID sequence counter.
+			// This is totally legal in the spec, but not awfully useful to us as
+			// plain text messages are server-specific and are really for carbon-
+			// based lifeforms to read.
+			if ((p=p->Next())==NULL)
+				{
+				// No message. Just '* OK'. What a pointless waste of bandwidth.
+				return(KErrNotReady);
+				}
+
+			// Is this the start of a bracketed construct?
+			if (p->Compare(_L8("(")) ||
+				p->Compare(_L8("[")))
+				{
+				CImapAtom* child=p->ToChildL();
+
+				if (child->Compare(KIMAP_UIDVALIDITY))
+					{
+					// Save it
+					child=child->ToNextL();
+					if (child->Value(iUidValidity)!=KErrNone)
+						User::Leave(KErrArgument);
+					}
+				else if (child->Compare(KIMAP_UIDNEXT))
+					{
+					// Save it
+					child=child->ToNextL();
+					if (child->Value(iUidNext)!=KErrNone)
+						User::Leave(KErrArgument);
+					}
+				else if (child->Compare(KIMAP_READWRITE))
+					{
+					// Note read-write open
+					iMailboxWritable=ETrue;
+					}
+				else if (child->Compare(KIMAP_READONLY))
+					{
+					// Note read-only open
+					iMailboxWritable=EFalse;
+					}
+				else if (child->Compare(KIMAP_ALERT))
+					{
+ 					// alerts to be handled here, but return with no error until then
+					LogText(_L8("Alert received- SessionState:iState %d"),iState);	
+					if(iState==EImapStateIdling)
+						{
+						return KErrNone;
+						}
+					}
+				else
+					{
+#ifdef PRINTING
+					TPtrC8 unk=p->Atom();
+					LogText(_L8("* OK [%S ???]"),&unk);
+#endif
+					}
+				}
+			else
+				{
+#ifdef PRINTING
+				TPtrC8 unk=p->Atom();				
+				LogText(_L8("* OK %S ???"),&unk);
+#endif
+
+				if(iState==EImapStateIdling)
+					{
+					return(KErrNotReady);
+					}	
+				}
+			}
+		else if (!aCancelled && p->Compare(KIMAP_LIST))
+			{
+			// Ignore it unless we've got somewhere to save it
+			ProcessListL(p->ToNextL());
+			}
+		else if (!aCancelled && p->Compare(KIMAP_LSUB))
+			{
+			// Process subscription list reply
+			ProcessLsubL(p->ToNextL());
+			}
+		else if (!aCancelled && p->Compare(KIMAP_SEARCH))
+			{
+			// Process UID search reply
+			// Need to check that we actually received a list of UIDs in the response
+			// because under certain circumstances we can get a reply that lists no UIDs.
+			// This can happen if the search command specifies a set of UIDs but none
+			// of them can be found on the server because they have all been expunged.
+			// It can also happen if the search command includes a search string but
+			// no messages on the server match it.
+			if (p->Next())
+				{
+				ProcessSearchL(p->ToNextL());
+				}
+			}
+		else if (p->Compare(KIMAP_BYE))
+			{
+			// Are we already logging out?
+			if (iState!=EImapStateLogoutWait)
+				{
+				// Unexpected disconnection
+				// WRITE!
+				}
+			}
+		else if (p->Compare(KIMAP_NO))
+			{
+#ifdef PRINTING
+			// NO message from server. Display it.
+			LogText(_L8("Got NO:"));
+			while((p=p->Next())!=NULL)
+				{
+				TPtrC8 word(p->Atom());
+				LogText(_L8(" %S"),&word);
+				}
+#endif
+			if(iState==EImapStateIdling)
+					{
+					// ignore this and remain in IDLE.
+					return KErrNotReady;
+					}
+			}
+		else if (!aCancelled && p->Compare(KIMAP_FLAGS))
+			{
+			// FLAGS response during folder open
+			iMailboxReceivedFlags=ETrue;
+#ifdef PRINTING
+			LogText(_L8("Got FLAGS:"));
+			p=p->ToNextL();
+			p=p->ToChildL();
+			do
+				{
+				TPtrC8 word(p->Atom());
+				LogText(_L8(" %S"),&word);
+				p=p->Next();
+				}
+			while(p!=NULL);
+#endif
+			}
+		else if (p->Compare(KIMAP_CAPABILITY))
+			{
+			// clear here just for good measure
+			iSeenVersion=EFalse;
+			iCapabilityIdleSupport = EFalse;
+			iCapabilityStartTLS=EFalse;
+			iCapabilityLoginDisabled=EFalse;
+			
+			// CAPABILITY reply
+			while((p=p->Next())!=NULL)
+				{
+				if (p->Compare(KIMAP_VERSION))
+					iSeenVersion=ETrue;
+				else if (p->Compare(KIMAP_IDLE))
+					iCapabilityIdleSupport = ETrue;
+				else if (p->Compare(KIMAP_STARTTLS))
+					iCapabilityStartTLS=ETrue;
+				else if (p->Compare(KIMAP_LOGINDISABLED))
+					iCapabilityLoginDisabled=ETrue;
+				}
+			}
+		else
+			{
+#ifdef PRINTING
+			// Unknown
+			TPtrC8 a=p->Atom();
+			LogText(_L8("Unknown reply '* %S'"),&a);
+#endif
+			}
+		}
+
+	return(KErrNotReady);
+	}
+
+// Fill in a CImHeader from an envelope atom
+void CImImap4Session::ProcessEnvelopeL(CImHeader* aHeader, TMsvEntry& aEntry, CImapAtom *aAtom)
+	{
+	CImapAtom *q=aAtom->ToChildL();
+	TPtrC8 tptr;
+	// ensure that nothing is placed on the cleanup stack between here
+	// and calls to ProcessAddress/ProcessAddressList
+	HBufC8 *address=HBufC8::NewLC(KImapAddressSizeInc);
+
+	DBG((LogText(_L8("Processing envelope data"))));
+
+	// Parse date information
+	tptr.Set(q->Atom());
+	TImRfc822DateField date;
+	date.ParseDateField(tptr,aEntry.iDate);
+	q=q->ToNextL();
+
+	// Subject in CImHeader (TMsvEntry is later on after post-processing)
+	if (!q->Compare(KIMAP_NIL))
+		aHeader->SetSubjectL(q->Atom());
+	q=q->ToNextL();
+
+	// From information: both in CImHeader and TMsvEntry
+	if (q->Child())
+		{
+		DBG((LogText(_L8("Processing 'From' information"))));
+
+		ProcessAddressL(&address,q->ToChildL());
+		aHeader->SetFromL(address->Des());
+		}
+	else
+		{
+		// No From information. Set blank
+		aHeader->SetFromL(_L(""));
+		}
+	q=q->ToNextL();
+
+	// Discard sender information
+	q=q->ToNextL();
+
+	// ReplyTo information
+	if (q->Child())
+		{
+		DBG((LogText(_L8("Processing 'ReplyTo' information"))));
+
+		// Replyto exists
+		ProcessAddressL(&address,q->ToChildL());
+		aHeader->SetReplyToL(address->Des());
+		}
+	else
+		{
+		// No replyto. Use From info
+		aHeader->SetReplyToL(aHeader->From());
+		}
+	q=q->ToNextL();
+
+	// To information
+	DBG((LogText(_L8("Processing 'To' information"))));
+
+	ProcessAddressListL(&address,aHeader->ToRecipients(),q->Child());
+	q=q->ToNextL();
+			
+	// CC list
+	DBG((LogText(_L8("Processing 'CC' information"))));
+
+	ProcessAddressListL(&address,aHeader->CcRecipients(),q->Child());
+	q=q->ToNextL();
+
+	// BCC list
+	DBG((LogText(_L8("Processing 'BCC' information"))));
+
+	ProcessAddressListL(&address,aHeader->BccRecipients(),q->Child());
+	q=q->ToNextL();
+
+	// In-Reply-To
+	q=q->ToNextL();
+
+	// Message-Id
+	aHeader->SetImMsgIdL(q->AtomNoAngleBrackets());
+
+	// Decode any QP encoding in header fields
+	iHeaderConverter->DecodeAllHeaderFieldsL(*aHeader);
+
+	// Set from line in TMsvEntry
+	aEntry.iDetails.Set(aHeader->From());
+
+	// Set subject in TMsvEntry
+	aEntry.iDescription.Set(aHeader->Subject());
+
+	// Get rid of buffer
+	CleanupStack::PopAndDestroy();
+
+	DBG((LogText(_L8("Finished processing envelope information"))));
+	}
+
+void CImImap4Session::StripSpace(HBufC8* aBuf)
+	{
+	TInt len = aBuf->Length();
+	TInt in = 0;
+	TInt out = 0;
+	TPtr8 p = aBuf->Des();
+	while (in < len)
+		{
+		TUint8 c = p[in++];
+		if (c > ' ')
+			p[out++] = c;
+		}
+	// we could shrink the buffer here but we won't bother because it
+	// is going to get copied and freed anyway
+	}
+
+// Fill in a CImHeader from the extra header fields atoms, currently
+// Priority and Receipt info. aText is an extract direct from the
+// message header, ie lines of name: value\r\n terminated with an
+// empty line. Not known whether the lines can be folded so assume
+// they may.
+void CImImap4Session::ProcessHeaderExtraL(CImHeader* aHeader, CImMimeHeader* aMimeHeader, TMsvEmailEntry* aEntry, TPtrC8 aText)
+	{
+#ifdef _DEBUG
+	TPtrC8 dump = aText.Left(256);
+	DBG((LogText(_L8("Processing HeaderExtra data '%S'"), &dump)));
+#endif
+
+	// utils class
+	CImcvUtils* utils=CImcvUtils::NewLC();
+
+	TPtrC8 line = aText;
+	HBufC8* valueBuf = NULL;
+
+	TPtrC8 name;
+
+	TBool foundReplyToPrompt = EFalse;
+	// Check for content-type Application/xxx
+	// There may be a CAF agent ready to consume the content if it's DRM
+	// If aMimeHeader is set then this is the mime header prior to the actual mime section download
+	if(aMimeHeader && aMimeHeader->ContentType().MatchF(KImcvApplication) == 0)
+		{		
+		// CAF registration requires concatenated content-type and subtype
+		// The type and subtype have been received and stored.
+		// Create buffer for concatenating. + 1 creates space for '/' 
+		HBufC8* buf = HBufC8::NewLC(aMimeHeader->ContentSubType().Length() + aMimeHeader->ContentType().Length() + 1);
+		TPtr8 ptr(buf->Des());
+		ptr.Copy(aMimeHeader->ContentType());
+		ptr.Append(KImcvForwardSlash);
+		ptr.Append(aMimeHeader->ContentSubType());
+		// Registration does not necessarily succeed but we don't care at this point.
+		iCaf->RegisterL(ptr);
+		CleanupStack::PopAndDestroy(buf);
+		}
+
+	while (line.Length())
+		{
+		TBool processPrevious = valueBuf != NULL;
+		TPtrC8 current;
+
+		TInt len = line.Find(KImcvCRLF);
+		if (len > 0)
+			{
+			// split line into this one and the rest
+			current.Set(line.Left(len));
+			line.Set(line.Mid(len+2));
+
+			// handle folded headers
+			if (current[0] <= ' ' && valueBuf)
+				{
+				HBufC8* buf=valueBuf->ReAllocL( valueBuf->Length() + current.Length() );
+				if (buf!=valueBuf)
+					{
+					CleanupStack::Pop();
+					CleanupStack::PushL(valueBuf=buf);
+					}
+				valueBuf->Des().Append( current );
+
+				processPrevious = EFalse;
+				}
+			}
+		else
+			{
+			// set line to null
+			line.Set(line.Left(0));
+			}
+		
+		// find matching headers, can only be set if valueBuf was
+		// non-null
+		if (processPrevious)
+			{
+			// Dont put the following line back in as will cause a panic if the subject
+			// field is too long. Defect EXT-53KD67.
+			//DBG((LogText(_L8("header: name %S value %S"), &name, valueBuf)));
+
+			if (aEntry)
+				{
+				CDesC8ArrayFlat* array = new(ELeave) CDesC8ArrayFlat(4);
+			  	CleanupStack::PushL(array);
+			  	CImcvUtils::PriorityFieldsL(*array);
+			  	for (TInt i(0); i<array->Count(); i++)
+				  	{
+					if(name.CompareF((*array)[i])==0)
+				  		{
+						aEntry->SetPriority(utils->EvaluatePriorityText(*valueBuf));
+				  		}
+				  	}
+			  	CleanupStack::PopAndDestroy(array); 
+				}
+
+			if (aHeader)
+				{
+				CImcvUtils* imcvUtils = CImcvUtils::NewLC();
+				if (imcvUtils->EvaluateReturnReceiptFields(name))
+					{
+					aHeader->SetReceiptAddressL(*valueBuf);
+
+					// Only set Receipt flag if this email has not
+					// been 'seen' by somebody - to prevent multiple
+					// notifications
+					if (!aEntry->SeenIMAP4Flag())
+						aEntry->SetReceipt(ETrue);
+					}
+					
+				if((name.CompareF(KImcvFromPrompt))==0)
+					{
+					// Set from line in TMsvEntry
+					aHeader->SetFromL(*valueBuf);
+					}
+				else if((name.CompareF(KImcvSubjectPrompt))==0)
+					{
+					// Set subject in TMsvEntry
+					aHeader->SetSubjectL(*valueBuf);
+					}
+				else if((name.CompareF(KImcvDatePrompt))==0)
+					{
+					if(!iParsedTime)
+						{
+						// Set date in TMsvEntry
+						TImRfc822DateField date;
+						date.ParseDateField(*valueBuf,aEntry->iDate);	
+						}
+					}
+				else if((name.CompareF(KImcvReceivedPrompt))==0)
+					{
+					if(!iParsedTime)
+						{
+						// Set date in TMsvEntry
+						TImRfc822DateField date;
+						
+						//remove the data before the comma, to just leave the date				
+						TPtr8 ptr(valueBuf->Des());
+						TInt lPos=ptr.Locate(';');	
+						ptr = ptr.Right(ptr.Length()-lPos-2);				
+						date.ParseDateField(ptr,aEntry->iDate);
+						iParsedTime=ETrue;	
+						}
+					}
+				else if((name.CompareF(KImcvReplyToPrompt))==0)
+					{
+					aHeader->SetReplyToL(*valueBuf);
+					foundReplyToPrompt = ETrue;
+					}
+				else if((name.CompareF(KImcvMessageIdPrompt))==0)
+					aHeader->SetImMsgIdL(*valueBuf);
+				else if((name.CompareF(KImcvToPrompt))==0)
+					ProcessAddressListL(aHeader->ToRecipients(), &valueBuf);
+				else if((name.CompareF(KImcvCcPrompt))==0)
+					ProcessAddressListL(aHeader->CcRecipients(), &valueBuf);
+				else if((name.CompareF(KImcvBccPrompt))==0)
+					ProcessAddressListL(aHeader->BccRecipients(), &valueBuf);
+
+				CleanupStack::PopAndDestroy(); // imcvUtils
+
+				// we are currently ignoring DispositionOptions as
+				// there is nowhere to store it
+				}
+
+			if (aMimeHeader)
+				{
+				// Check to see if this extra header data should be passed to the CAF agent				
+				if(iCaf->Registered())
+					{
+					iCaf->AddToMetaDataL(name,valueBuf->Des());
+					}
+				if (name.CompareF(KImcvContentBase) == 0)
+					{
+					StripSpace(valueBuf);
+					aMimeHeader->SetContentBaseL(*valueBuf);
+					}
+				else if (name.CompareF(KImcvContentLocation) == 0)
+					{
+					StripSpace(valueBuf);
+
+					HBufC *decoded=HBufC::NewLC(valueBuf->Length());
+					TPtr decoded_ptr(decoded->Des());
+
+					iHeaderConverter->DecodeHeaderFieldL(*valueBuf,decoded_ptr);
+					aMimeHeader->SetContentLocationL(*decoded);
+					CleanupStack::PopAndDestroy(); // decoded
+					}
+				}
+
+			CleanupStack::PopAndDestroy(); // valueBuf
+			valueBuf = NULL;
+			}
+
+		if (current.Length() && current[0] > ' ')
+			{
+			// split this line into name and value
+			TInt colon = current.Locate(':');
+
+			name.Set(current.Left(colon+1)); // include the colon
+			TPtrC8 value = current.Mid(colon+1);
+			
+			// skip any initial WS in the value
+			while (value.Length() != 0 && value[0] <= ' ')
+				value.Set(value.Mid(1));
+
+			valueBuf = value.AllocLC();
+			}
+		}	
+
+	if (aHeader)
+		{
+		// If no reply to information, use the From value
+		if (!foundReplyToPrompt)
+			{
+			aHeader->SetReplyToL(aHeader->From());
+			}
+
+		// Decode any QP encoding in header fields
+		iHeaderConverter->DecodeAllHeaderFieldsL(*aHeader);
+
+		// Set from line in TMsvEntry
+		aEntry->iDetails.Set(aHeader->From());
+
+		// Set subject in TMsvEntry
+		aEntry->iDescription.Set(aHeader->Subject());
+		}	
+
+	// just in case 
+	if (valueBuf)
+		CleanupStack::PopAndDestroy(); // valueBuf
+
+	// pop off the items allocated
+	CleanupStack::PopAndDestroy(); // utils
+	
+	DBG((LogText(_L8("Finished processing HeaderExtra"))));
+	}
+
+// adapted this function from the one in CImRecvConvert
+void CImImap4Session::GetDefaultFilename(TDes& aName, const TMsvEmailEntry& aMessage, const CImMimeHeader* mime)
+	{
+	aName = *iDefaultAttachmentName;
+
+	// Add on appropriate extension
+	if (aMessage.iType == KUidMsvEmailTextEntry)
+		{
+		aName.Append(KTextExtension);
+		}
+	else if (aMessage.MHTMLEmail())
+		{
+		aName.Append(KHtmlExtension);
+		}
+	else if (aMessage.VCard() || aMessage.VCalendar())
+		{
+		aName.Append(KVCardExtension);
+		}
+	else if (aMessage.ICalendar())
+		{
+		aName.Append(KICalExtension);
+		}
+	else if ( aMessage.iType == KUidMsvAttachmentEntry )
+		{
+ 		if ( (mime->ContentSubType()==KImcvBmp) ||
+			 (mime->ContentSubType()==KImcvGif) ||
+			 (mime->ContentSubType()==KImcvJpeg) ||
+			 (mime->ContentSubType()==KImcvTiff) ||
+			 (mime->ContentSubType()==KImcvWav) )
+			{
+			TBuf<KMaxExtensionLength> buf;
+			buf.Copy(mime->ContentSubType());
+			aName.Append(KImcvFullStop);
+			aName.Append(buf);
+			}
+		}
+	}
+
+TBool CImImap4Session::DoesAtomContainAttachment(CImapAtom *aAtom)
+// Check through all of this Atom's Siblings to see if they contain an attachment
+	{
+	TBool hasAttachment = EFalse;
+	CImapAtom* currentAtom = aAtom;
+
+	// Search through all of the Sibling Atoms
+	while (currentAtom != NULL)
+		{
+		// Check if there is a Child Atom with an Attachment
+		if (currentAtom->Child() != NULL)
+			{
+			if (currentAtom->Child()->Compare(KMIME_ATTACHMENT))
+				{
+				// This Sibling contains an Attachment.
+				hasAttachment = ETrue;
+				break;
+				}
+			}
+
+		// Move onto the next sibling
+		currentAtom = currentAtom->Next();
+		}
+
+	return hasAttachment;
+	}
+
+// Build a single entry
+void CImImap4Session::BuildTreeOneL(const TMsvId aParent, CImapAtom *aAtom, const TDesC8& aPath,
+									const TMsvId aThisMessage, TInt& aAttachments, TBool& aIsMHTML, TInt& aRelatedAttachments)
+	{
+	DBG((LogText(_L8("BuildTreeOneL(message=%x, parent=%x)"),aThisMessage,aParent)));
+
+	// First, is this actually an entry, or another level of nesting?
+	if (aAtom->Child())
+		{
+		// Another level of nesting? Call BuildTreeL()
+		BuildTreeL(aParent,aAtom,aPath,aThisMessage,aAttachments,aIsMHTML, aRelatedAttachments);
+		return;
+		}
+
+	// Skeleton for new entry
+	SetEntryL(aParent);
+
+	TFileName attachmentFilename;	//	DS somewhere to store an attachment filename
+	TMsvEmailEntry message;
+	message.iSize=0;
+	message.iMtm=KUidMsgTypeIMAP4;
+	message.iServiceId=iServiceId;
+	message.SetUID(iMessageUid);
+	message.SetValidUID(ETrue);
+	message.SetComplete(EFalse);
+
+	// Reply from server is in this form:
+	// TYPE SUBTYPE (PARAM1 VALUE1 ...) ID DESCRIPTION ENCODING OCTETS
+	//
+	// Text parts:
+	// TYPE SUBTYPE (PARAM1 VALUE1 ...) ID DESCRIPTION ENCODING OCTETS NLINES
+
+	// Save mime TYPE/SUBTYPE
+	CImMimeHeader *mime=CImMimeHeader::NewLC();
+	CImapAtom *type=aAtom;
+	CImapAtom *subtype=aAtom->Next();
+	mime->SetContentTypeL(type->Atom());
+	mime->SetContentSubTypeL(subtype->Atom());
+
+#ifdef PRINTING
+	TPtrC8 mt=type->Atom(),ms=subtype->Atom();
+	LogText(_L8("  MIME type %S/%S"),&mt,&ms);
+#endif
+
+	// We start by assuming the data will be stored as a binary
+	// attachment
+	message.iType=KUidMsvAttachmentEntry;
+	if (type->Compare(KMIME_TEXT))
+		{
+		// text/html?
+		if (subtype->Compare(KMIME_HTML))
+			{
+			//  If this Atom doesn't contain an Attachment, then this is a MHTML Message.
+			if (!DoesAtomContainAttachment(subtype))
+				{
+				message.iType=KUidMsvEmailHtmlEntry;
+				aIsMHTML=ETrue;	
+				}	
+			}
+		// text/x-vcard?
+		else if (subtype->Compare(KMIME_XVCARD))
+			{
+			// Set vCard flag in message
+			message.SetVCard(ETrue);
+
+			// Defaults to binary
+			}
+		// text/x-vcalendar
+		else if (subtype->Compare(KMIME_VCALENDAR))
+			{
+			// Set vCalendar flag in message
+			message.SetVCalendar(ETrue);
+			iIsVCalendar = ETrue;
+			
+			// Defaults to binary
+			}
+		// text/calendar
+		else if (subtype->Compare(KMIME_ICALENDAR))
+			{
+			// Set iCalendar flag in message
+			message.SetICalendar(ETrue);
+			iIsICalendar = ETrue;
+			
+			// Defaults to binary
+			}
+		else
+			message.iType=KUidMsvEmailTextEntry;
+		}
+
+	// ...and mime path
+	mime->SetRelativePathL(aPath);
+
+	DBG((LogText(_L8("  MIME path %S"),&aPath)));
+
+	// Parameter list
+	CImapAtom *parameter=subtype->ToNextL();
+
+	TUint charset = KUidMsvCharsetNone;
+
+	// Store parameter stuff
+	if (!parameter->Compare(KIMAP_NIL))
+		{
+		DBG((LogText(_L8("  Parameter list:"))));
+
+		// Process list
+		CImapAtom *type_param=parameter->ToChildL();
+		while(type_param && type_param->Next())
+			{
+			CImapAtom *type_value;
+			type_value=type_param->ToNextL();
+
+			// All items are 2-tuples (parameter value (...)): get both, and store
+			TPtrC8 param=type_param->Atom();
+			TPtrC8 value=type_value->Atom();
+
+			DBG((LogText(_L8("    %S %S"),&param,&value)));
+		
+			mime->ContentTypeParams().AppendL(param);
+			mime->ContentTypeParams().AppendL(value);
+		
+			// Have we come across a 'NAME' tuple? If so, force the MIME type of this
+			// entry to be an attachment.
+			if ((param.CompareF(KMIME_NAME)==0)
+				|| (param.CompareF(KMIME_NAME_RFC2231) == 0))
+				{
+				DBG((LogText(_L8("It has an attachment filename, therefore this is an attachment"))));
+
+				FindFilenameDecodeL(*mime,attachmentFilename);
+				StripIllegalCharactersFromFileName(attachmentFilename);
+				message.iDetails.Set(attachmentFilename);
+
+				// If embedded message do not save as an attachment
+				if (message.iType!=KUidMsvMessageEntry)
+					message.iType=KUidMsvAttachmentEntry;
+				}
+			else if (param.CompareF(KImcvCharset)==0)
+				{
+				// Set the Mime charset from the parameter value
+				if (value.Length() != 0)
+					{
+					charset = iCharConv->GetMimeCharsetUidL(value);
+					}
+				}
+
+
+			// Next item
+			type_param=type_value->Next();
+			}
+		}
+
+	mime->SetMimeCharset(charset);
+
+	// ID: save it
+	CImapAtom *id=parameter->ToNextL();
+	if (!id->Compare(_L8("NIL")))
+		mime->SetContentIDL(id->AtomNoAngleBrackets());
+
+	// Description: save it
+	CImapAtom *description=id->ToNextL();
+	if (!description->Compare(_L8("NIL")))
+		mime->SetContentDescriptionL(description->Atom());
+
+	// Encoding
+	CImapAtom *encoding=description->ToNextL();
+	mime->SetContentTransferEncodingL(encoding->Atom());
+
+#ifdef PRINTING
+	TPtrC8 enc=encoding->Atom();
+	LogText(_L8("  Encoding %S"),&enc);
+#endif
+
+	// Octets (encoded form)
+	CImapAtom *octets=encoding->ToNextL();
+	TInt actualsize;
+	if (octets->Value(actualsize)!=KErrNone)
+		User::Leave(KErrGeneral);
+
+	// Twiddle this to show *decoded* size: this is basically the size of
+	// this part, multiplied by 6/8 if it's BASE64 encoded. For all other
+	// encodings, we leave the size as-is as there's no hard & fast rule
+	// which can be applied.
+	if (encoding->Compare(KMIME_BASE64))
+		message.iSize=(actualsize*6)/8;
+	else
+		message.iSize=actualsize;
+
+	// Add into total message size
+	iDecodedSizeOfAllParts+=message.iSize;
+
+	// Store *remote* size in a dodgy place
+	message.iBioType=actualsize;
+
+	//If any part of email (text/plain mime, text/html mime, attachment....) 
+	// is empty then should not fetch it.
+	if(actualsize == 0)
+		{
+		message.SetComplete(ETrue);
+		}
+
+#ifdef PRINTING
+	LogText(_L8("  Octets %d"),message.iBioType);
+
+	TPtrC8 type_p=type->Atom(),subtype_p=subtype->Atom();
+	LogText(_L8("Building mime stuff: %S/%S"),&type_p,&subtype_p);
+#endif
+
+	// MD5 block will start after any optional parts
+	CImapAtom *md5;
+
+	if (type->Compare(KMIME_MESSAGE) && subtype->Compare(KMIME_RFC822))
+		{
+		// Skip RFC822 header, which should *all* be present
+		// Like this for clarity
+		CImapAtom *envelope=octets->ToNextL();
+		CImapAtom *structure=envelope->ToNextL();
+		CImapAtom *nooflines=structure->ToNextL();
+
+		// embedded message - marked as a message
+		message.iType=KUidMsvMessageEntry;
+
+		iDecodedSizeOfAllParts-=message.iSize;
+
+		// Next atom is MD5 - IF PRESENT
+		md5=nooflines->Next();
+		}
+	else
+		{
+		// Find MD5 block: if this part is TEXT/* we have number of lines next
+		if (type->Compare(KMIME_TEXT))
+			{
+			// Number of lines is next atom, followed by MD5 - IF PRESENT
+			CImapAtom *nooflines=octets->ToNextL();
+			md5=nooflines->Next();
+			}
+		else		
+			md5=octets->Next();
+		}
+
+	// Do we have any extended fields? If so, deal with them
+	if (md5)
+		{
+		// Next (if present) is Content-Disposition, closely followed by language
+		CImapAtom *disposition=md5->Next();
+		CImapAtom *language=(disposition==NULL)?NULL:disposition->Next();
+		language=language; // Stop .aer warnings: we know it's not used (yet)
+
+		DBG((LogText(_L8("Processing content-disposition"))));
+
+		// Store disposition stuff
+		if (disposition && !disposition->Compare(KIMAP_NIL))
+			{
+			// Process list
+			CImapAtom *pos=disposition->Child();
+			while(pos)
+				{
+				// Single item (eg "INLINE") or 2-tuple (eg ("FILENAME" "blah.gif"))?
+				if (pos->Child())
+					{
+					// Tuple
+					CImapAtom* tuple = pos->ToChildL();
+					while(tuple)
+						{
+						mime->ContentDispositionParams().AppendL(tuple->Atom());
+						mime->ContentDispositionParams().AppendL(tuple->ToNextL()->Atom());
+
+						// Filename? If so, force this as an attachment
+						if ((tuple->Atom().CompareF(KMIME_FILENAME)==0)
+							|| (tuple->Atom().CompareF(KMIME_FILENAME_RFC2231)==0))
+							{
+							DBG((LogText(_L8("It has an attachment filename, therefore this is an attachment"))));
+							FindFilenameDecodeL(*mime,attachmentFilename);
+							StripIllegalCharactersFromFileName(attachmentFilename);
+							message.iDetails.Set(attachmentFilename);
+
+							// If embedded message do not save as an attachment
+							if (message.iType!=KUidMsvMessageEntry)
+								message.iType=KUidMsvAttachmentEntry;
+							}
+
+						// Skip to next tuple
+						tuple = tuple->ToNextL()->Next();
+						}
+					}
+				else
+					{
+					// Single item
+					mime->ContentDispositionParams().AppendL(pos->Atom());
+					mime->ContentDispositionParams().AppendL(_L8(""));
+					}
+			
+				// Skip to next entry
+				pos=pos->Next();
+				}
+			}
+		}
+
+	// Now we're working on the type
+	if (message.iType==KUidMsvMessageEntry)
+		{
+		// MESSAGE/RFC822
+		// This means that the next atom will be the envelope info, and the
+		// one following that will be the body structure of the embedded
+		// message.
+		//
+		// This is an entire message-within-a-message and so gets treated like
+		// an actual mail (has it's own multipartdata thing)
+	
+		// Make CImHeader bits
+		CImHeader *messageheader=CImHeader::NewLC();
+		CImapAtom *envelope=octets->ToNextL();
+		ProcessEnvelopeL(messageheader,message,envelope);
+
+		// Create message
+		User::LeaveIfError(iEntry->CreateEntryBulk(message));
+		SetEntryL(message.Id());
+
+		// Store CImHeader bits
+		CMsvStore* entryStore=iEntry->EditStoreL();
+		CleanupStack::PushL(entryStore);
+		messageheader->StoreL(*entryStore);
+		mime->StoreL(*entryStore);
+		entryStore->CommitL();
+		CleanupStack::PopAndDestroy(3);
+
+#if SET_RELATED_ID
+		//	DS - Set message's iRelatedId to messageId to allow later UI kludges
+		TMsvEntry changeEntry(iEntry->Entry());
+		changeEntry.iRelatedId=changeEntry.Id();
+		ChangeEntryBulkL(changeEntry);
+#endif
+		// Descend into attachments of this embedded message
+		CImapAtom *structure=envelope->ToNextL();
+		TInt attachments=0;
+		TBool isMHTML=EFalse;
+
+		BuildTreeL(message.Id(),structure->ToChildL(),aPath,message.Id(),attachments,isMHTML,aRelatedAttachments);
+		DBG((LogText(_L8("Build embedded message id %x attachments %d MHTML %d"),message.Id(),attachments,isMHTML)));
+
+		// Save attachment and MHTML flags
+		if (attachments>0 || isMHTML)
+			{
+			SetEntryL(message.Id());
+			TMsvEmailEntry thisMessage=iEntry->Entry();
+
+			if (attachments>0)
+				{
+				thisMessage.SetAttachment(ETrue);
+				}
+
+			if (isMHTML)
+				{
+				thisMessage.SetMHTMLEmail(ETrue);
+				}
+
+			ChangeEntryBulkL(thisMessage);
+			}
+
+		// we are now counting embedded messages as attachments
+		aAttachments++;
+		}
+	else
+		{
+		// Something else - create an attachment entry
+		SetEntryL(aParent);
+
+		// save parent folder type
+		TImEmailFolderType parentFolderType = ((TMsvEmailEntry)iEntry->Entry()).MessageFolderType();
+	
+		// set attachment and HTML flags on item
+		if ( message.iType==KUidMsvAttachmentEntry)
+			message.SetAttachment(ETrue);
+
+		if ( message.iType==KUidMsvEmailHtmlEntry)
+			message.SetMHTMLEmail(ETrue);
+
+		// ensure there is a filename if it is a non-text item (which
+		// also controls iFetchIsText, the flag used in DecodeAndStore
+		// to say whether to stream to a file or RichText store.
+		if (message.iType!=KUidMsvEmailTextEntry && message.iDetails.Length() == 0)
+			{
+			// use iAttachmentName for temporary buffer
+			GetDefaultFilename(iAttachmentName, message, mime);
+			message.iDetails.Set(iAttachmentName);
+			}
+		
+		User::LeaveIfError(iEntry->CreateEntryBulk(message));
+		SetEntryL(message.Id());
+		
+		DBG((LogText(_L8("Created attachment id %x as child of %x - type %d"),message.Id(),aParent, parentFolderType)));
+
+#if SET_RELATED_ID
+		//	DS - Set message's iRelatedId to messageId to allow later UI kludges
+		TMsvEntry changeEntry(iEntry->Entry());
+		changeEntry.iRelatedId=changeEntry.Id();
+		ChangeEntryBulkL(changeEntry);
+#endif
+
+		DBG((LogText(_L8("Streaming MIME info into id %x"),iEntry->Entry().Id())));
+
+		// Stream the MIME info out into the message
+		// This will either stream it to the actual message (if the above if
+		// evaluated to True, the entry is still set to the message), or to
+		// the newly created child
+		CMsvStore* entryStore=iEntry->EditStoreL();
+		CleanupStack::PushL(entryStore);
+		mime->StoreL(*entryStore);
+		entryStore->CommitL();	
+		CleanupStack::PopAndDestroy(2, mime);
+
+    	// This entry is NOT an attachment in the following cases - 
+		// 1)	This is an attachment whose parent is a MULTIPART/RELATED folder.
+		//		In this case, this entry could be a image entity for an MHTML
+		//		entry with the same parent.
+		// 2)	This is an MHTML entry whose parent is a MULTIPART/ALTERNATIVE 
+		//		folder. In this case, this entry is the MHTML alternative to a
+		//		text entry with the same parent.
+		// 3)	This is an MHTML entry whose parent is MESSAGE folder. In this
+		//		case, the message is a simple MHTML message with no text 
+		//		alternative or embedded image.
+		// 4)	This is an MHTML entry whose parent is a MULTIPART/RELATED folder.
+		//		In this case, this entry is the MHTML for the message.
+		// 5)	This is an MHTML entry whose parent is a MULTIPART/MIXED folder.
+		//		In this case, this entry is the MHTML for the message. It cannot
+		//		be the attachment it self as then it would be of type attachment.
+		// Therefore, an entry is only an attachment if is of type attachment and
+		// its parent is not a MULTIPART/RELATED folder.
+    	if( message.iType==KUidMsvAttachmentEntry && parentFolderType != EFolderTypeRelated )
+			{
+    		++aAttachments;
+			}
+		// if it is related we might want to include it if the message
+		// turns out not to be MHTML
+		else if ( message.iType==KUidMsvAttachmentEntry &&
+			parentFolderType == EFolderTypeRelated )
+			{
+			++aRelatedAttachments;
+			}
+		}
+
+	DBG((LogText(_L8("BuildTreeOneL done: created id %x, attachments so far %d"), message.Id(), aAttachments)));
+	}
+
+// Build attachment tree below a message
+void CImImap4Session::BuildTreeL(TMsvId aParent, CImapAtom *aAtom, const TDesC8& aPath,
+								 const TMsvId aThisMessage, TInt& aAttachments, TBool& aIsMHTML, TInt& aRelatedAttachments)
+	{
+	DBG((LogText(_L8("BuildTreeL(message=%x, parent=%x"),aThisMessage,aParent)));
+
+	// One attachment only?
+	if (aAtom->Child()==NULL)
+		{
+		// Deal with the single entry (doesn't use AllocL)
+		HBufC8* newpath=HBufC8::NewLC(aPath.Length()+4);
+		*newpath=aPath;
+		if (aPath.Length())
+			newpath->Des().Append(_L8("."));
+		newpath->Des().AppendNum(1);
+		BuildTreeOneL(aParent,aAtom,newpath->Des(),aThisMessage,aAttachments,aIsMHTML, aRelatedAttachments);
+		CleanupStack::PopAndDestroy();
+		}
+	else
+		{
+		// Nest down a level: create a folder
+		SetEntryL(aParent);
+		TMsvEmailEntry message;
+		message.iMtm=KUidMsgTypeIMAP4;
+		message.iServiceId=iServiceId;
+		message.iType=KUidMsvFolderEntry;
+		message.iSize=0;
+		message.SetComplete(EFalse);
+		User::LeaveIfError(iEntry->CreateEntryBulk(message));
+
+		DBG((LogText(_L8("Created attachment folder id %x as child of %x"),message.Id(),aParent)));
+
+		aParent=message.Id();
+
+		// CC:Mail server doesn't respond to BODYSTRUCTURE correctly:
+		// it gives the same response as FETCH BODY, ie it doesn't have
+		// all the extended MIME stuff.
+		// Skip to the last 4 atoms: this is the multipart type & stuff
+		CImapAtom *multipart=aAtom;
+		while(multipart && multipart->Child()!=NULL)
+			multipart=multipart->Next();
+
+		// Got anything?
+		if (multipart)
+			{
+			// Parse multipart type string, do this first so
+			// information is available when parsing children
+			TImEmailFolderType ft=EFolderTypeUnknown;
+			if (multipart->Compare(KImcvRelated))
+				ft=EFolderTypeRelated;
+			if (multipart->Compare(KImcvMixed))
+				ft=EFolderTypeMixed;
+			if (multipart->Compare(KImcvParallel))
+				ft=EFolderTypeParallel;
+			if (multipart->Compare(KImcvAlternative))
+				ft=EFolderTypeAlternative;
+			if (multipart->Compare(KImcvDigest))
+				ft=EFolderTypeDigest;
+			
+			SetEntryL(aParent);
+			
+			// ...and save it
+			TMsvEmailEntry folder=iEntry->Entry();
+			folder.SetMessageFolderType(ft);
+#if SET_RELATED_ID
+			//	DS - Set message's iRelatedId to messageId to allow later UI kludges
+			folder.iRelatedId=folder.Id();
+#endif
+			ChangeEntryBulkL(folder);
+
+			// Process the multipart object
+			TInt subnr=1;
+			while(aAtom && aAtom!=multipart)
+				{
+				// Tag or child?
+				if (aAtom->Child())
+					{
+					// Process item (doesn't use AllocL)
+					HBufC8* newpath=HBufC8::NewLC(aPath.Length()+4);
+					*newpath=aPath;
+					if (aPath.Length())
+						newpath->Des().Append(_L8("."));
+					newpath->Des().AppendNum(subnr++);
+					BuildTreeOneL(aParent,aAtom->ToChildL(),newpath->Des(),
+								  aThisMessage,aAttachments,aIsMHTML, aRelatedAttachments);
+					CleanupStack::PopAndDestroy();
+					}
+		
+				// Next item
+				aAtom=aAtom->Next();
+				}
+			}
+		}
+	}
+
+
+// convert text from its charset and write to richtext store. aText
+// can span multiple and partial lines
+void CImImap4Session::WriteToBodyL(const TDesC8& aText)
+	{
+	TInt pos = iMessageBody->DocumentLength();
+
+	// Add bits of body text, converting along the way, till no characters left
+	// .. to convert.
+
+	// Convert text before writing to body.
+	TInt rem = 0;
+
+	// there will be a max of one output char per input byte
+	HBufC16* text16=HBufC16::NewLC(aText.Length());
+	TPtr16 ptr16=text16->Des();
+
+	if (!iPreparedToConvert)
+		{
+		ptr16.Copy(aText);
+		iMessageBody->InsertL(pos, ptr16);
+		}
+	else
+		{
+		TInt unconvertedChars, firstPos; // not used 
+		rem = iCharConv->ConvertToOurCharsetL(aText, ptr16, 
+											  unconvertedChars, firstPos);
+		if (rem < 0) // error
+			{
+			// Copy unconverted characters.
+			ptr16.Copy(aText);
+			iMessageBody->InsertL(pos, ptr16);
+			}
+		else if (rem && rem < iLeftOver.MaxLength())
+			iLeftOver.Copy(aText.Right(rem));	
+
+		// convert CRLF to ELineBreak
+		TInt start = 0;
+		TInt length = ptr16.Length();
+		TInt i;
+		for (i=1; i<length; i++)
+			{
+			if (ptr16[i-1] == KImcvCR && ptr16[i] == KImcvLF)
+				{
+				ptr16[i-1] = CEditableText::ELineBreak;
+
+				// write this line to body
+				TPtrC ptr = ptr16.Mid(start, i-start);
+				iMessageBody->InsertL(pos, ptr);
+				pos += ptr.Length();
+				start = i+1;
+				}
+			}
+
+		if (start != i)
+			{
+			TPtrC ptr = ptr16.Mid(start, i-start);
+			iMessageBody->InsertL(pos, ptr);
+			}
+		}
+
+	CleanupStack::PopAndDestroy(); // text16
+	}
+	
+// convert text from its charset and write to file, return error code
+// from write
+TInt CImImap4Session::WriteToAttachmentL(const TDesC8& aText)
+	{
+	TInt error;
+	
+	// Convert text before writing to attachment.
+	TInt rem = 0;
+
+	// there will be a max of one output char per input byte
+	HBufC16* text16=HBufC16::NewLC(aText.Length());
+	TPtr16 ptr16=text16->Des();
+
+	if (!iPreparedToConvert)
+		{
+		if(iCaf->Processing())
+			{
+			error = iCaf->WriteData(aText);
+			}
+		else
+			{
+			error = iAttachmentFile->WriteFile(aText);
+			}
+		}
+	else
+		{
+		TInt unconvertedChars, firstPos; // not used 
+		rem = iCharConv->ConvertToOurCharsetL(aText, ptr16, 
+											  unconvertedChars, firstPos);
+		if (rem < 0) // error
+			{
+			ptr16.Copy(aText);  // Copy unconverted characters.
+			}
+		else if (rem && rem < iLeftOver.MaxLength())
+			{
+			// any remainder is due to partial code sequence not lack of space
+			iLeftOver.Copy(aText.Right(rem));
+			}
+
+		TPtrC8 text8((TUint8*) text16->Des().Ptr(), text16->Des().Size());
+		if(iCaf->Processing())
+			{
+			error = iCaf->WriteData(text8);
+			}
+		else
+			{
+			error = iAttachmentFile->WriteFile(text8);
+			}
+		}
+
+	CleanupStack::PopAndDestroy(); // text16
+
+	return error;
+	}
+
+// Copied and adapted this function from the one in CImRecvConvert
+TBool CImImap4Session::CheckUUEStartL(const TDesC8& aSourceLine)
+	{
+	// Checks if the descriptor contains the UUE begin header
+	// Extracts the file name if it is
+	
+	TInt sourceLength = aSourceLine.Length();
+	if(sourceLength < KImcvUueStart().Length()+3) // can't be "begin ###", it's not long enough; 3=length of ###
+		return EFalse;
+
+	if(!aSourceLine.Left(KImcvUueStart().Length()).CompareF(KImcvUueStart)) // start of line might be UUE boundary
+		{
+		// we also need to check that the next three chars are numbers - Unix file access code
+		const TUint8* sourceLinePtr = aSourceLine.Ptr();
+		TInt length=KImcvUueStart().Length();// this defines length as 6 ie. "b e g i n  " 
+		if( TChar(sourceLinePtr[length]).IsDigit() && 
+			TChar(sourceLinePtr[length+1]).IsDigit() && 
+			TChar(sourceLinePtr[length+2]).IsDigit() )
+			{
+			// Found 'begin ###' at the start of a line - assume this is a UUencode header
+			// The attachment name in this header is ignored. We use the value from the MIME header
+			return ETrue;
+			}
+		}
+		
+	return EFalse;
+	}
+
+
+// Decode and store received data
+void CImImap4Session::DecodeAndStoreL(const TPtrC8& aBodyData, const TBool aEndOfStream)
+	{
+	DBG((LogText(_L8("DecodeAndStore(%d bytes, endofstream=%d, encoding=%d, iLeftOver=%d)"),aBodyData.Length(),aEndOfStream,iEncodingType,iLeftOver.Length())));
+
+	// Somewhere to store decoded data, at least as long as source (plus anything we have left
+	// in the partial line buffer which may now get consumed)
+	TInt outputbuffersize=aBodyData.Length()+4;
+	if (iPartialLine)
+		outputbuffersize+=iPartialLine->Des().Length();
+
+	HBufC8* decoded=HBufC8::NewLC(outputbuffersize);
+	TPtr8 decoded_ptr=decoded->Des();
+
+	// Bump progress: bytesdone is *encoded* length, so we just use the encoded length
+	iProgress.iBytesDone+=aBodyData.Length();
+	// Which decoder are we using?
+	switch(iEncodingType)
+		{
+		case EEncodingTypeNone:
+		case EEncodingType7Bit:
+		case EEncodingType8Bit:
+		case EEncodingTypeBinary:
+		case EEncodingTypeUnknown:
+			// Nothing to do, just copy data
+			decoded->Des().Append(aBodyData);
+			break;
+
+		case EEncodingTypeBASE64:
+			// Decode Base64 data: just filter it through decoder, it
+			// ignores line breaks anyway.
+			iB64Decoder.Decode(aBodyData,decoded_ptr);
+			break;
+
+		case EEncodingTypeUU:
+			{
+			TPtrC8 bodydata=aBodyData;
+
+			// Got a partial buffer?
+			if (!iPartialLine)
+				{
+				// Allocate buffer
+				iPartialLine=HBufC8::NewL(KUuDecodedLineLength);
+				iUUDecoding = EFalse;
+				}
+			
+			// Decode UUEncoded data: line by line
+			TBool decodeEnded = EFalse;
+			TInt position=0;
+			while ( bodydata.Length() && !decodeEnded )
+				{
+				// Find() returns the start of "\r\n". The decoding algorithm
+				// requires that the encoded line contains the "\r\n".
+				TInt lineEnd = bodydata.Find( _L8("\r\n") );
+				if (lineEnd != KErrNotFound)
+					{
+					lineEnd = lineEnd + 2;
+					AppendExtendL( &iPartialLine, bodydata.Left( lineEnd ), EFalse);
+				
+					bodydata.Set( bodydata.Mid( lineEnd ) );
+				
+					// Check for a well-formated  begin-tag
+					if ( CheckUUEStartL( iPartialLine->Des() ) )
+						{
+						iUUDecoding = ETrue;
+						}
+					else if ( iPartialLine->Compare( KImcvUueEnd ) != 0 && iUUDecoding )
+						{
+						// Every malformatted string is decoded as an empty string 
+						// with length 0. Appending such a string is harmless.
+						TPtr8 destination((unsigned char*)decoded_ptr.Ptr()+position,0,outputbuffersize-position);
+						iUUDecoder.Decode(*iPartialLine,destination);
+						position+=destination.Length();			
+						}
+					else if ( iUUDecoding )
+						{
+						decodeEnded = ETrue;
+						iUUDecoding = EFalse;	
+						}
+					
+					iPartialLine->Des().Zero();
+					}
+				else
+					{
+					AppendExtendL( &iPartialLine, bodydata, EFalse);
+					
+					// advance to end of bodydata
+  					bodydata.Set(bodydata.Ptr()+bodydata.Length(), 0);
+					}
+				}
+			decoded->Des().SetLength(position);	
+			break;
+			}
+
+		case EEncodingTypeQP:
+			{
+			TPtrC8 bodydata=aBodyData;
+
+			// Got a partial buffer?
+			if (!iPartialLine)
+				{
+				// Allocate buffer
+				iPartialLine=HBufC8::NewL(256);
+				}
+
+			// Build buffer to decode: basically, QP decoder wants CRLF terminated
+			// lines, so we build them in the iPartialLine buffer. There may be
+			// stuff already there from previous data packet - so we just append.
+			TInt position=0;
+			while(bodydata.Length())
+				{
+				// Find a line break
+				TInt lineend=bodydata.Find(_L8("\r\n"));
+
+				// No break?
+				if (lineend==KErrNotFound && !aEndOfStream)
+					{
+					// Stick it all in the partialline buffer, we should get a CRLF
+					// soon...
+					AppendExtendL( &iPartialLine,bodydata, EFalse);
+					break;
+					}
+				else
+					{
+					if (lineend==KErrNotFound)
+						{
+						// Append whole thing left to buffer
+						AppendExtendL( &iPartialLine,bodydata, EFalse);
+
+						// advance to end of bodydata
+						bodydata.Set(bodydata.Ptr()+bodydata.Length(), 0);
+						}
+					else
+						{
+						// Append to buffer up to that point (including the \r\n)
+						AppendExtendL( &iPartialLine,bodydata.Left(lineend+2), EFalse);
+
+						// Remove from the buffer we're working on (including the \r\n)
+						bodydata.Set(bodydata.Ptr()+lineend+2,bodydata.Length()-lineend-2);
+						}
+
+					// Decode & skip on in buffer
+					TPtr8 destination((unsigned char*)decoded_ptr.Ptr()+position,0,outputbuffersize-position);
+					iQPDecoder.Decode(*iPartialLine,destination);
+					position+=destination.Length();
+					iPartialLine->Des().Zero();
+					}
+				}
+
+			// Update decoded
+			decoded->Des().SetLength(position);
+			break;
+			}
+		}
+
+	// put back any partially converted data
+	if (iLeftOver.Length())
+		{
+		decoded->Des().Insert(0, iLeftOver);
+		iLeftOver.SetLength(0);
+		}
+
+	// What format is it? TEXT/* we put into a richtext thingy, otherwise just
+	// stream it to store
+	if (iFetchIsText)
+		{
+		if(aEndOfStream && (iMessageBody || iBodyBuf) && iBodyPartRemainingSize)
+			{
+			CleanupStack::Pop();// decoded 
+			TInt newSize = decoded->Size() + iFooterString->Size();
+			decoded = decoded->ReAlloc(newSize);
+			CleanupStack::PushL(decoded);
+			decoded->Des().Append(*iFooterString);
+			delete iFooterString;
+			iFooterString = NULL;
+			}
+		// Got somewhere to put it? Store it!
+		if (iStore8BitData)
+			{
+			if (decoded->Length() && iBodyBuf)
+				iBodyBuf->InsertL(iBodyBuf->Size(), *decoded);
+			}
+		else
+			{
+			if (decoded->Length() && iMessageBody)
+				WriteToBodyL(decoded->Des());
+			}
+		
+		
+		// Got the whole thing buffered?
+		if (aEndOfStream && (iMessageBody || iBodyBuf))
+			{
+			DBG((LogText(_L8("Doing StoreBodyTextL()"))));
+
+			// The whole message is built in iMessageBody or iBodyBuf.  Store it.
+			SetEntryL(iMessageId);
+			CMsvStore *entryStore=iEntry->EditStoreL();
+			CleanupStack::PushL(entryStore);
+			if (iStore8BitData)
+				iBodyText->StoreL(*entryStore, *iBodyBuf);
+			else
+				entryStore->StoreBodyTextL(*iMessageBody);
+			entryStore->CommitL();
+			CleanupStack::PopAndDestroy();
+
+			// Get rid of body copy, etc
+			delete iBodyBuf;
+			iBodyBuf = NULL;
+			delete iMessageBody;
+			iMessageBody=NULL;
+			}
+		}
+	else
+		{
+		// Select the entry
+		SetEntryL(iMessageId);
+
+		// Save it direct to store
+		if (iAttachmentFileState==EFileNotOpen)
+			{
+			// Get and set Attachment File path
+			TFileName filepath;
+	
+			// Retrieving the attachment name from an earlier saved one
+			// If it's a CAF interested file then this will get overidden
+			CMsvStore* store = iEntry->ReadStoreL();
+			CleanupStack::PushL(store);
+			MMsvAttachmentManager& attachmentMgr = store->AttachmentManagerL();
+			if(attachmentMgr.AttachmentCount())
+				{
+				// get the file path 	
+				CMsvAttachment* attachment = attachmentMgr.GetAttachmentInfoL(0);
+				CleanupStack::PushL(attachment);
+				filepath = attachment->FilePath();
+				CleanupStack::PopAndDestroy(attachment);
+				}
+
+			if (iAttachmentFullPath)
+				{
+				delete iAttachmentFullPath;
+				iAttachmentFullPath=NULL;
+				}
+			if(attachmentMgr.AttachmentCount())
+				{
+				TParse fileParser;
+				User::LeaveIfError(fileParser.Set(filepath, NULL, NULL));
+				iAttachmentFullPath=fileParser.DriveAndPath().AllocL();
+				}
+			// We've already extracted the attachment file name in
+			// BuildTree so just copy it out of details
+			iAttachmentName=iEntry->Entry().iDetails;			
+			if(attachmentMgr.AttachmentCount())
+				{
+			DBG((LogText(_L8("name '%S', '%S'"),iAttachmentFullPath,&iAttachmentName)));
+				}
+			if (!iAttachmentFile)
+					iAttachmentFile=new (ELeave) TImAttachmentFile(iFs);
+			CleanupStack::PopAndDestroy(store); // store opened above
+			store = iEntry->EditStoreL(); 
+			CleanupStack::PushL(store);
+			// Could be multiple attachments in the folder.
+			TInt attachmentCount = store->AttachmentManagerL().AttachmentCount();
+			for(TInt i=0;i<attachmentCount;i++)
+				{
+				// Remove [0] as array is shuffled. Once index [n] is removed n+1 becomes n
+				store->AttachmentManagerExtensionsL().RemoveAttachmentL(0);
+				}
+			if(attachmentCount)			
+				store->CommitL();
+
+			// Now create the attachment entry
+			CMsvAttachment* attachment = CMsvAttachment::NewL(CMsvAttachment::EMsvFile);
+			CleanupStack::PushL(attachment);
+			attachment->SetAttachmentNameL(iAttachmentName);
+			
+			// Need to create the MIME-type information - first get the MIME headers
+			CImMimeHeader* mimeHeaders = CImMimeHeader::NewLC();
+			mimeHeaders->RestoreL(*store);
+
+			HBufC8* buf = HBufC8::NewLC(mimeHeaders->ContentSubType().Length() + mimeHeaders->ContentType().Length() + 1);
+			TPtr8 ptr(buf->Des());
+			ptr.Copy(mimeHeaders->ContentType());
+			ptr.Append(KImcvForwardSlash);
+			ptr.Append(mimeHeaders->ContentSubType());
+		
+			attachment->SetMimeTypeL(ptr);
+			
+			CleanupStack::PopAndDestroy(2, mimeHeaders);
+
+			
+			RFile file;	
+			if(iCaf->Registered())
+				{
+				iCaf->PrepareProcessingL(); // Init the CAF import file session
+				RFile startFile;
+				TFileName suggestedFileName;
+				if(iCaf->GetSuggestedAttachmentFileName(suggestedFileName) == KErrNone) // CAF agent may provide a filename
+					{
+					store->CreateShareProtectedAttachmentL(suggestedFileName,startFile,attachment);
+					}
+				else
+					{
+					store->CreateShareProtectedAttachmentL(iAttachmentName,startFile,attachment);
+					}
+				iCaf->StartProcessing(iDefaultAttachmentName->Des(),attachment->FilePath(),*iEntry,startFile); // Init the CAF session
+				startFile.Close();
+				}
+			else
+				{
+				// Normal behaviour
+				store->AttachmentManagerExtensionsL().CreateAttachmentL(iAttachmentName,file,attachment);
+				iAttachmentFile->SetFileHandle(file,TImAttachmentFile::EImFileWrite);
+				}
+
+			// CreateAttachmentL takes ownership of CMsvAttachment so if call was successful we can pop it here
+			CleanupStack::Pop(attachment);
+			
+			iAttachmentFileState = EFileIsOpen;	
+			store->CommitL();
+			CleanupStack::PopAndDestroy(store);	
+
+			if (iAttachmentFileState!=EFileIsOpen)
+				{
+				DBG((LogText(_L8("Couldn't open file!"))));
+				}
+			}	
+
+		if (iAttachmentFileState==EFileIsOpen && decoded->Length())
+			{
+			// write decoded data into a file if there is any data there to write
+			TInt error=WriteToAttachmentL(decoded->Des());
+
+			if (error!=KErrNone)
+				{
+				// the file write failed, (eg.there is no space left set new file state 
+				// and skip any remaining encoded data in message
+				iAttachmentFileState=EFileIsIncomplete;
+
+				DBG((LogText(_L8("Failed to write %d bytes to attachment file (error=%d): deleting it"),decoded->Length(),error)));
+				if(iCaf->Processing())
+					{
+					iCaf->EndProcessingL();
+					}
+				else
+					{
+					iAttachmentFile->CloseFile();
+					}
+
+				CMsvStore* store = iEntry->EditStoreL(); 
+				CleanupStack::PushL(store);
+				// Could be multiple attachments in the folder.
+				TInt i;
+				TInt attachmentCount = store->AttachmentManagerL().AttachmentCount();
+				for(i=0;i<attachmentCount;i++)
+					{
+					// Remove [0] as array is shuffled. Once index [n] is removed n+1 becomes n
+					store->AttachmentManagerExtensionsL().RemoveAttachmentL(0);
+					}
+				if(attachmentCount)			
+					store->CommitL();
+				CleanupStack::PopAndDestroy(store);
+				TMsvEmailEntry message=iEntry->Entry();
+				message.SetAttachment(EFalse);
+				ChangeEntryBulkL(message);
+
+				// Leave with the error
+				User::Leave(error);
+				}
+			else
+				{
+				DBG((LogText(_L8("Written %d bytes to attachment file"),decoded->Length())));
+				}
+			}
+
+		// Finished?
+		if ((aEndOfStream) && (iAttachmentFileState == EFileIsOpen))
+			{
+			DBG((LogText(_L8("Closing attachment file"))));
+			if(iCaf->Processing())
+				{
+				iCaf->EndProcessingL();
+				}
+			else
+				{
+				iAttachmentFile->CloseFile();
+				}
+			iAttachmentFileState=EFileNotOpen;
+			}
+		}
+
+	// Free memory
+	CleanupStack::PopAndDestroy();
+	}
+
+// Given that aId has become complete see if we can propagate the
+// Complete state and partial fetch state flag up
+void CImImap4Session::PropagateCompleteFlagL(TMsvId aId, TBool aDoBodyText,TBool aPartialFetched)
+	{
+	CMsvEntrySelection* selection=new (ELeave) CMsvEntrySelection;
+	CleanupStack::PushL(selection);
+	
+	// get the siblings of this id
+	SetEntryL(aId);
+	TMsvId parent = iEntry->Entry().Parent();
+
+	// finish if we've managed to reach the top
+	if (parent == KMsvRootIndexEntryId)
+		return;
+
+	SetEntryL(parent);
+
+	// finish if we've reached a service
+	if (iEntry->Entry().iType == KUidMsvServiceEntry)
+		return;
+
+	GetChildrenL(*selection);
+
+	TBool complete=ETrue;
+	TBool bodyTextComplete=ETrue;
+	TBool partiallyFetched=EFalse;
+
+	TBool related=((TMsvEmailEntry) iEntry->Entry()).MessageFolderType()==EFolderTypeRelated ? 
+																					ETrue:EFalse;
+	for (TInt i=0; i < selection->Count(); i++)
+		{
+		SetEntryL((*selection)[i]);
+		if (!iEntry->Entry().Complete())
+			{
+			complete=EFalse;
+			if((iEntry->Entry().iType==KUidMsvFolderEntry) && aPartialFetched)
+				complete=ETrue;
+			// The current part is not complete so...
+			// if it is either a text part or a HTML part then the body
+			// text is marked as being incomplete.
+			//
+			// This code means that, if present, then both the text/plain
+			// and text/html alternatives need to be downloaded before
+			// the body text is marked as being complete.
+			if ((iEntry->Entry().iType == KUidMsvEmailTextEntry)
+				|| (iEntry->Entry().iType == KUidMsvEmailHtmlEntry ) || related )
+				{
+				if(aPartialFetched)
+					{
+					complete = ETrue;
+					bodyTextComplete=ETrue;
+					}
+				else
+					bodyTextComplete=EFalse;
+				}
+
+			break;
+			}
+		}
+	
+	CleanupStack::PopAndDestroy(); // selection
+
+	// if all the siblings were complete then make the parent
+	// complete and continue up.
+	if (complete || ((aDoBodyText || related) && bodyTextComplete))
+		{
+		SetEntryL(parent);
+		TMsvEmailEntry entry = iEntry->Entry();
+
+		// check whether parent is complete, this wil prevent us
+		// checking all the messages in a real folder as they will all
+		// be initialised to Complete
+		if (!entry.Complete())
+			{
+			if (complete || ((iEntry->Entry().iType==KUidMsvFolderEntry) && aPartialFetched))
+				entry.SetComplete(ETrue);
+			if(aPartialFetched)
+				{	
+				if((iEntry->Entry().iType != KUidMsvAttachmentEntry) &&
+						(iEntry->Entry().iType != KUidMsvEmailExternalBodyEntry))
+					{
+					entry.SetPartialDownloaded(ETrue);
+					}
+				partiallyFetched = ETrue;
+				}
+			else
+				{
+				entry.SetPartialDownloaded(EFalse);
+				partiallyFetched = EFalse;
+				}
+			entry.SetBodyTextComplete(ETrue);
+			ChangeEntryL(entry);
+		
+			PropagateCompleteFlagL(parent, related|aDoBodyText,partiallyFetched);
+			}
+		else if (entry.PartialDownloaded())
+			{
+			entry.SetPartialDownloaded(EFalse);
+			ChangeEntryL(entry);
+			PropagateCompleteFlagL(parent, related|aDoBodyText,partiallyFetched);
+			}
+		}	
+	}
+
+void CImImap4Session::CreateAttachmentInfoL(TMsvEmailEntry& aMsvEmailEntry)
+	{
+	// create an empty attachment to store the attachment infomation, for the case
+	// where the attachment is not downloaded due to download limits.
+	CMsvStore* store = iEntry->EditStoreL();
+	CleanupStack::PushL(store);
+
+	MMsvAttachmentManager& attachmentMgr = store->AttachmentManagerL();
+	
+	// Check to see if this entry already has an attachment - if so, then don't
+	// add it again!
+	if( attachmentMgr.AttachmentCount() == 0 )
+		{
+		MMsvAttachmentManagerSync& attachmentMgrSync = store->AttachmentManagerExtensionsL();
+		
+		// Now create the attachment entry
+		CMsvAttachment* attachment = CMsvAttachment::NewL(CMsvAttachment::EMsvFile);
+		CleanupStack::PushL(attachment);
+						
+		// Need to create the MIME-type information - first get the MIME headers
+		CImMimeHeader* mimeHeaders = CImMimeHeader::NewLC();
+		mimeHeaders->RestoreL(*store);
+
+		HBufC8* buf = HBufC8::NewLC(mimeHeaders->ContentSubType().Length() + mimeHeaders->ContentType().Length() + 1);
+		TPtr8 ptr(buf->Des());
+		ptr.Copy(mimeHeaders->ContentType());
+		ptr.Append(KImcvForwardSlash);
+		ptr.Append(mimeHeaders->ContentSubType());
+	
+		attachment->SetMimeTypeL(ptr);
+		
+		CleanupStack::PopAndDestroy(2, mimeHeaders);
+
+		attachment->SetComplete(EFalse);
+		attachment->SetSize(aMsvEmailEntry.iSize);
+		attachment->SetAttachmentNameL(aMsvEmailEntry.iDetails);
+		RFile file;
+		attachmentMgrSync.CreateAttachmentL(aMsvEmailEntry.iDetails,file,attachment);
+		CleanupStack::Pop(attachment); // ownership passed to attachment manager
+		file.Close();
+		store->CommitL();
+		}
+	CleanupStack::PopAndDestroy(store);
+	}
+
+
+// Parse fetch messages
+TInt CImImap4Session::ProcessFetchL(const TUint aMsgnr, CImapAtom *aAtom)
+	{
+	CImapAtom *p=aAtom;
+	CImapAtom *attribute;
+	CImapAtom *structure=NULL;
+	CImapAtom *flags=NULL;
+	CImapAtom *bodydata=NULL;
+	CImapAtom *header=NULL;
+	TInt error=KErrNotReady;
+	TInt rfc822size=0;
+	TBool foundUnwantedMimeHeader=EFalse;
+	TBool wholeMessage=EFalse;
+	TInt fetchSizeBytes = static_cast<TInt>(iServiceSettings->FetchSize());
+
+	// Fetch data consists of attribute/value pairs
+	while(p!=NULL)
+		{
+		// Get attribute & value
+		attribute=p;
+		// broken servers can give us just an attribute rather than an
+		// attribute pair, if so then just finish the scan here and
+		// process what we've got
+		p=p->Next();
+		if (p==NULL)
+			break;
+
+		// Work on attributes
+		if (attribute->Compare(KIMAP_UID))
+			{
+			iFoundUid = ETrue;
+
+			// Lex it ok?
+			if (p->Value(iMessageUid)!=KErrNone)
+				User::Leave(KErrArgument);
+
+			// Skip to next attribute
+			p=p->Next();
+			}
+	
+		else if (attribute->Compare(KIMAP_BODY))
+			{
+			// some example responses
+
+			// expected without extra header fields
+			// * 1 FETCH (UID 1 BODY[2]<0> {1024}
+
+			// expected with extra (empty) header fields
+			// * 2 FETCH (UID 35 BODY[1.HEADER.FIELDS ("CONTENT-BASE" "CONTENT-LOCATION")] "" BODY[1]<0> {60}
+
+			// unwanted BODYSTRUCTURE info
+			// * 3 FETCH (UID 2 BODY ("text" "plain" ("CHARSET" "us-ascii") NIL NIL "7bit" 4337 67) BODY[1]<0> {1024}
+
+			// unwanted nested BODYSTRUCTURE info
+			// * 4 FETCH (UID 1 BODY (("text" "plain" ("CHARSET" "us-ascii") NIL NIL "7bit" 1346 53)
+			// ("text" "plain" ("NAME" "install.ins") NIL NIL "7bit" 5156 215) "MIXED")
+			// BODY[2]<0> {1024}
+
+			// unwanted BODYSTRUCTURE info and complete message
+			// * 5 FETCH (UID 2 BODY ("text" "plain" ("CHARSET" "us-ascii") NIL NIL "7bit" 4337 67) BODY[1] {1550}
+
+			// Body part is across & down one (it's in [])
+			CImapAtom* bodypart=p->ToChildL();
+
+			if (bodypart->CompareTail(KIMAP_HEADERFIELDS))
+				{
+				// Got BODY[HEADER.FIELDS ("header1" "header2" ...)] {LEN} data ...
+				// or  BODY[<part>.HEADER.FIELDS ("header1" "header2" ...)] {LEN} data ...
+				header=p->ToNextL();
+#ifdef PRINTING
+				TPtrC8 bpt=bodypart->Next()->Child()->Atom();
+				LogText(_L8("Found header fields (%S...)"),&bpt);
+#endif
+				// Skip to next attribute
+				p=header->Next();
+				}
+			else if (bodypart->CompareTail(KIMAP_MIME))
+				{
+				// Got BODY[MIME] {LEN} data ...
+				// or  BODY[<part>.MIME] {LEN} data ...
+				header=p->ToNextL();
+
+        		DBG((LogText(_L8("Found MIME header fields"))));
+        		
+       				// Skip to next attribute
+				p=header->Next();
+				}
+			else if (bodypart->Child() != NULL || bodypart->Next() != NULL)
+				{
+				// we've been unexpectedly returned a BODY () response
+				// which we don't want, so just skip it
+				DBG((LogText(_L8("Unexpected BODY response, ignoring"))));
+				p=p->Next();
+				}
+			else
+				{
+				// is body data, ie BODY[part]<offset> or BODY[part]
+
+				// Offset is next atom
+				CImapAtom* offset=p->ToNextL();
+
+				// there may not be an offset in which case offset is
+				// actually bodydata
+				
+				// Get the offset
+				TUint offsetn=0;
+				// see if this is an offset
+				if( offset->Child() != NULL )
+					{
+					TLex8 lex(offset->Child()->Atom());				
+					if( lex.Val(offsetn)!=KErrNone ) 
+						{
+						error=KErrGeneral;
+						break;
+						}
+
+					// Body data is next atom
+					bodydata=offset->Next();
+					}
+				else
+					{
+					// if not an offset then this is not a partial
+					// message
+					bodydata=offset;
+					wholeMessage=ETrue;
+					}
+								
+				// Additional code added to address additional unrequested non-RFC data sent by the 
+				// imap server caused problems in downloading the email and any attachments.
+				// Upto this point the BODY tag has correctly been interpreted.
+				// 
+				// We may however have an unwanted MIME header data which we will need to process or get rid of.					
+				// If we have  an unwanted mime header then we currently have the bodydata atom storing:
+				//
+				// BODY[x.MIME]<offset> 
+				// MIME_HEADER_INFO
+				// BODY_DATA
+				//
+				// or
+				//
+				// BODY.PEEK[x.MIME]<offset>
+				// BODY_DATA
+				// 
+				// The problem here is that the BODY or BODY.PEEK tag will be read as the actual body data.
+				// We need to move the bodydata pointer to the beginning of the MIME_HEADER_INFO.
+				// When decoding the information we will send the data after the header info to be decoded.
+				
+				CImapAtom* nextbodypart = NULL;
+				CImapAtom* mimetest =NULL;
+				
+				// Check if the unwanted body tag is "BODY" or "BODY.PEEK"
+				if((bodydata->Compare(KIMAP_BODY)) || (bodydata->Compare(KIMAP_BODYPEEK))) //we have an extra body tag
+					{
+					//find out if it is MIME
+					nextbodypart=bodydata->Next();
+					if(nextbodypart)
+						{
+						mimetest = nextbodypart->Child();
+						if(mimetest)
+							{
+							if (mimetest->CompareTail(KIMAP_MIME)) 
+								{
+								
+								// Unrequested tag is "BODY.PEEK"														
+								if((bodydata->Compare(KIMAP_BODYPEEK)))
+									{
+									LogText(_L8("UNEXPECTED RESPONSE: TAG \"BODY.PEEK\"- Found unwanted additional \"BODY.PEEK\" tag in the FETCH response"));
+									LogText(_L8("PROCESSING UNEXPECTED RESPONSE: TAG \"BODY.PEEK\" - Additional MIME header data NOT expected to PREFIX the bodypart - unlike additional \"BODY\" tag"));
+									// Not expecting additional / unwanted mime header info at the beginning of the body of the message part
+									// Hence, no additional processing required on body data
+									foundUnwantedMimeHeader=EFalse;
+									}
+								else // Unrequested tag is "BODY"
+									{
+									LogText(_L8("UNEXPECTED RESPONSE: TAG \"BODY\" Found unwanted additional \"BODY\" tag in the FETCH response"));
+									LogText(_L8("PROCESSING UNEXPECTED RESPONSE: TAG \"BODY\"- Expecting UNWANTED MIME HEADER DATA prefixing the BODY DATA of the message part"));
+									// Expecting additional / unwanted mime header info at the beginning of the body data of the message part.
+									// Hence, the atom pointed to by bodydata pointer will be parsed / truncated appropriately to extract just 
+									// the bodypart later.
+									foundUnwantedMimeHeader=ETrue;						
+									}
+								//we may have an offset that we need to ignore
+								CImapAtom* possOffset = nextbodypart->Next();
+								TLex8 lex(possOffset->Atom());
+								if (lex.Get()=='<') //has an offset
+									{
+									// Body data is next atom
+									bodydata=possOffset->Next();
+									}
+								else 
+									{						
+									bodydata=possOffset;
+									}
+								}
+							}							
+						}
+					}//end of code addressing
+				
+
+#ifdef PRINTING
+				TPtrC8 bpt=bodypart->Atom();
+				LogText(_L8("Found body part [%S] iSizeWait %d"),&bpt,iSizeWait);
+#endif
+				if (iSizeWait && bodydata!=NULL)
+					{
+					// No longer waiting for the size
+					iSizeWait=EFalse;
+
+					// Size of this part
+					TUint sizen=bodydata->Atom().Length();
+
+					DBG((LogText(_L8("  offset=%d, length=%d"),offsetn,sizen)));
+					TInt fetchSize = fetchSizeBytes;
+					
+					// In CC:Mail workaround mode?
+					if (iTalkingToCCMail || iTalkingToOpenMail)
+						{
+						// How much message is there left to fetch?
+						TInt sizeleft=iSizeOfThisPart-(offsetn+sizen);
+							
+						if (sizeleft>0)
+							{
+							if( iState != EImapStateFetchCancelWait )
+								{
+								// Limit chunk size
+								if(iFetchPartialMail)
+									{
+									fetchSize = GetFetchSizeL(sizeleft,offsetn+sizen);
+									if(fetchSize > fetchSizeBytes )
+										{
+										fetchSize = fetchSizeBytes;
+										}
+									}
+								else
+									{
+									if (sizeleft>fetchSizeBytes)
+										{
+										fetchSize=fetchSizeBytes;
+										}
+									}	
+								// Issue new fetch command
+								NewTag();
+								TPtrC8 bp(bodypart->Atom());
+								if (iServiceSettings->UpdatingSeenFlags())
+									{
+									iImapIO->SendL(iStatus,KImapFetchBodyPeek,
+												iTag,iMessageFetching,&bp,(offsetn+sizen),sizeleft);
+									}
+								else
+									{
+									iImapIO->SendL(iStatus,KImapFetchBody,
+												iTag,iMessageFetching,&bp,(offsetn+sizen),sizeleft);
+									}
+
+								NewTagSent();
+
+								// Get the rest of this line uninterrupted
+								error=KErrWrite;
+								}
+							}
+						else
+							{
+							// Got the whole message
+							TInt sizeleft=iSizeOfThisPart-(offsetn+sizen);
+							if(iFetchPartialMail && (sizeleft || !iHtmlEntryPart))
+								{
+								ProcessFooterMessageL(sizeleft);
+								}
+							}
+						}
+					else
+						{
+						// Anything more to get? We decide this on wether we got near to
+						// our requested packet size on the last fetch: if we were within
+						// 100 bytes of the requested size, we ask for another load just
+						// in case the server is serving us line by line. Otherwise, we
+						// assume that was the end of the data and flush it out.
+						
+						// Check whether we have downloaded the message completely or not,
+						// before sending the FETCH command again.
+						iSizeLeftToFetch = iSizeOfThisPart-(offsetn+sizen);
+						if ((fetchSizeBytes-sizen)<100 && iSizeLeftToFetch>0)
+							{
+							if( iState != EImapStateFetchCancelWait )
+								{
+								TInt sizeleft=iSizeOfThisPart-(offsetn+sizen);
+								fetchSize=sizeleft;
+								if(iFetchPartialMail)
+									{
+									fetchSize = GetFetchSizeL(sizeleft,offsetn+sizen);
+									}
+								if(fetchSize > fetchSizeBytes)
+									{
+									fetchSize = fetchSizeBytes;
+									}
+								// Yes, issue a new fetch command
+								NewTag();
+								TPtrC8 bp(bodypart->Atom());
+								if (iServiceSettings->UpdatingSeenFlags())
+									{
+									iImapIO->SendL(iStatus,KImapFetchBodyPeek,
+											   iTag,iMessageFetching,&bp,(offsetn+sizen),fetchSize);
+									
+									}
+								else
+									{
+									iImapIO->SendL(iStatus,KImapFetchBody,
+											   iTag,iMessageFetching,&bp,(offsetn+sizen),fetchSize);
+									}
+								NewTagSent();
+
+								// Get the rest of this line uninterrupted
+								error=KErrWrite;
+								}
+							}
+						else
+							{
+							// Got the whole message
+							TInt sizeleft = iSizeOfThisPart-(offsetn+sizen);
+							
+							if(iFetchPartialMail && (sizeleft || !iHtmlEntryPart))
+								{
+								ProcessFooterMessageL(sizeleft);
+								}
+							}
+						}
+					}
+
+				// Finish processing here if we didn't get everything
+				if (!iGotWholeLine)
+					break;	
+
+				// Skip to next attribute
+				p=bodydata->Next();
+				}
+			}
+		else if (attribute->Compare(KIMAP_BODYSTRUCTURE))
+			{
+			// Body structure: Save it until later when we have created
+			// the message - then we can create the attachment tree
+			// underneath it
+			structure=p->ToChildL();
+
+			// Skip to next attribute
+			p=p->Next();
+			}
+		else if (attribute->Compare(KIMAP_FLAGS))
+			{
+			// Process flag list later
+			flags=p;
+
+			// Skip to next attribute
+			p=p->Next();
+			}
+		else if (attribute->Compare(KIMAP_RFC822SIZE))
+			{
+			// Save total message size
+			if (p->Value(rfc822size)!=KErrNone)
+				User::Leave(KErrGeneral);
+
+			// Skip to next attribute
+			p=p->Next();
+			}
+
+		else
+			{
+#ifdef PRINTING
+			TPtrC8 att=attribute->Atom();
+			LogText(_L8("Unknown attribute '%S'"),&att);
+			//showtree(attribute,0);
+#endif
+			}
+		}
+
+	DBG((LogText(_L8("About to process, error=%d, iGotWholeLine=%d, iSyncState=%d, bodydata=%x, wholeMessage=%d"),
+			error,iGotWholeLine,iSyncState,(int)bodydata,wholeMessage)));
+
+		// No error?
+	if ((error==KErrNotReady || error==KErrWrite) && iGotWholeLine)
+		{
+		// check to see if uid is present in server message. If not present, we are getting a
+		// message flag update
+		if(!iFoundUid)
+			{
+#ifdef PRINTING
+			DBG((LogText(_L8("UID not present in Fetch, so process flags"))));
+#endif
+
+			// this is just a message flag update	
+
+			TInt msgnr = aMsgnr;
+
+			// if the aMsgnr index into the local message array points to a valid message entry
+			if((msgnr < iFolderIndex.Size()) && (iFolderIndex[aMsgnr-1].iMsvId != 0))
+				{
+
+#ifdef PRINTING			
+				for(TInt i=0; i<iFolderIndex.Size(); i++)
+					{
+					DBG((LogText(_L8("iFolderIndex[%d].iMsvId=%d"), i, iFolderIndex[i].iMsvId)));	
+					}
+#endif
+				// Mirror flags and ensure that the message is visible
+				// as it might have been made invisible by
+				// unsubscribing.
+
+				// set the current entry to be the message pointed to by aMsgnr
+				SetEntryL(iFolderIndex[aMsgnr - 1].iMsvId);
+
+#ifdef PRINTING	
+				DBG((LogText(_L8("SetEntry for aMsgnr: %d with msvid %d"), aMsgnr-1, iFolderIndex[aMsgnr-1].iMsvId)));
+#endif
+
+				TMsvEmailEntry message=iEntry->Entry();
+
+				// since there is no uid associated with this server response, we just need to update flags
+				if (ProcessFlagsL(flags,message)|| !message.Visible())
+					{
+					message.SetVisible(ETrue);
+					ChangeEntryL(message);
+					}
+
+#ifdef PRINTING			
+				DBG((LogText(_L8("check for deleted imap 4 flags"))));
+#endif
+
+				if (message.DeletedIMAP4Flag())
+					{
+					iRemoteMessagesDeleteTagged++;
+					}
+				}
+
+			return(KErrNotReady);
+			}
+
+		// What synchronisation state are we in?
+		switch(iSyncState)
+			{
+		case ENotSyncing:
+			// Ignore it
+			break;
+
+		case EFetching:
+			{
+			if (header)
+				{
+				ProcessHeaderExtraL(NULL,iAttachmentMimeInfo,NULL,header->Atom());
+
+				// Store CImMimeHeader info
+				SetEntryL(iMessageId);
+				CMsvStore* entryStore=iEntry->EditStoreL();
+				CleanupStack::PushL(entryStore);
+				iAttachmentMimeInfo->StoreL(*entryStore);
+				entryStore->CommitL();
+				CleanupStack::PopAndDestroy(entryStore);
+				}
+
+			// Now, decode the body data and store it: completion can't be
+			// indicated by 'complete' as we may have been called with a partial line,
+			// so we just rely on the same 'early a full buffer' indicator as
+			// we do when issuing the pipelined fetches above
+
+			TBool endOfStream = EFalse;
+			if (iTalkingToCCMail || iTalkingToOpenMail)
+				{
+				// As we'll never get the 0 byte terminating read with CC:mail, we have to use
+				// our own definition of "end of file", which is simply a packet smaller than
+				// the maximum fetch size
+				if (bodydata)
+					{
+					endOfStream=bodydata->Atom().Length()!=fetchSizeBytes;
+					DecodeAndStoreL(bodydata->Atom(),endOfStream);
+					}
+				}
+			else
+				{
+				// Here, we'll treat anything 100 or more bytes shy of the maximum packet size as
+				// end of file. If we're closer than that, a new read will have been issued which will
+				// return 0 bytes, which *will* cause the EOF to be signalled.
+				if (bodydata)
+					{
+					endOfStream=wholeMessage || (!((fetchSizeBytes-bodydata->Atom().Length())<100) || (iSizeLeftToFetch == 0));
+					
+					// depending on whether or not we found an unwanted mime header we need to get rid of it.
+					// This is done in response to the imap server issues where the server was sending additional information.
+					// At this point we know how big the extra header is and we can calculate the correct size of the bodydata by subtracting the 
+					// size of the header. 
+					if(foundUnwantedMimeHeader)
+						{
+						foundUnwantedMimeHeader=EFalse;
+						//calculate size of actual bodydata without the additional header
+						TInt length = bodydata->Atom().Length() - header->Atom().Length();
+						//call decode and store, but only pass in the data we are interested in i.e.: skip the additional header.
+						DecodeAndStoreL(bodydata->Atom().Right(length),endOfStream);
+						}
+					else //bodydata only points to the data
+						{
+						DecodeAndStoreL(bodydata->Atom(),endOfStream);
+						}
+					}
+				}
+
+			// Update flags on message: it should have been marked as read if it wasn't
+			// already
+			if (flags || endOfStream && ( iState != EImapStateFetchCancelWait ))
+				{
+				// SJM 19990922: Previously this only set the Unread
+				// flag in a rather inefficient way. Change to use new
+				// return value of ProcessFlags
+				SetEntryL(iMessageId);
+				TMsvEmailEntry message=iEntry->Entry();
+
+				TBool hasBodyText = message.iType == KUidMsvEmailTextEntry || message.iType == KUidMsvEmailHtmlEntry;
+				TBool partiallyDownloaded = EFalse;
+				if (endOfStream)
+					{
+					message.SetComplete(ETrue);
+					if(iFetchPartialMail && iBodyPartRemainingSize && message.iType == KUidMsvEmailTextEntry) 
+						{
+						message.SetPartialDownloaded(ETrue);
+						partiallyDownloaded = ETrue;
+						}
+					else
+						{
+						message.SetPartialDownloaded(EFalse);
+						}
+
+					if (hasBodyText)
+						message.SetBodyTextComplete(ETrue);
+					}
+				
+				// Process flags in this fetch response
+				TBool changed = EFalse;
+				if (flags)
+					changed = ProcessFlagsL(flags,message);
+
+				if (changed || endOfStream)
+					ChangeEntryBulkL(message);
+
+				if (endOfStream)
+					{
+					//iMessagePartsFetchOK++;
+					PropagateCompleteFlagL(iMessageId, hasBodyText, partiallyDownloaded);
+					}
+				}
+			break;
+			}
+
+		case ESyncListNew:
+		case ESyncOld:
+			// Got a message's details
+			
+			// check folder position is not out of bounds and that we have not run out of the local index.
+			if (iFolderPosition >= iFolderIndex.Size())
+				{
+				// All done/ array was out of bounds
+				DBG((LogText(_L8("ERROR - Position %d was out of bounds for the FolderIndex arrays size (%d)"),iFolderPosition,iFolderIndex.Size())));
+				iSyncState = ENotSyncing;
+				break;
+				}
+
+			// Collecting UIDs of messages in the folder
+			DBG((LogText(_L8("At pos %d, expecting UID %u, got UID %u"),
+							 iFolderPosition,iFolderIndex[iFolderPosition].iUid,iMessageUid)));
+
+			// Messages deleted from remote mailbox?
+			while(iFolderPosition<iFolderIndex.Size() &&
+				  iMessageUid>iFolderIndex[iFolderPosition].iUid)
+				{
+				// Orphan this message
+				DBG((LogText(_L8("Orphaning UID %u"),iFolderIndex[iFolderPosition].iUid)));
+
+				if (iFolderIndex[iFolderPosition].iUid != KIllegalUID)
+					{
+					// Do it
+					OrphanMessageL(iFolderIndex[iFolderPosition].iMsvId);
+					}  
+				else
+					{
+					DBG((LogText(_L8("Illegal UID, do not delete."))));
+					}
+
+				// Remove it from the index
+				iFolderIndex.Expunge(iFolderPosition+1);
+
+				// Increment stats
+				iOrphanedMessages++;
+				}
+
+			// Run out of local index?
+			if (iFolderPosition>=iFolderIndex.Size())
+				{
+				// All done
+				iSyncState=ENotSyncing;
+				}
+			// In sync again?
+			else if (iMessageUid==iFolderIndex[iFolderPosition].iUid)
+				{
+				// Fine, mirror flag information onto local message
+				DBG((LogText(_L8("Match UID %u, mirroring flags"),iMessageUid)));
+
+				// Mirror flags and ensure that the message is visible
+				// as it might have been made invisible by
+				// unsubscribing.
+				SetEntryL(iFolderIndex[iFolderPosition].iMsvId);
+				TMsvEmailEntry message=iEntry->Entry();
+				if (ProcessFlagsL(flags,message)|| !message.Visible())
+                    {
+                    message.SetVisible(ETrue);
+					ChangeEntryBulkL(message);
+       				}
+
+				if (message.DeletedIMAP4Flag())
+					iRemoteMessagesDeleteTagged++;
+				
+				// Next message
+				iFolderPosition++;
+
+				// Update counters.
+				iMsgsDone++;
+				iHeadersFetched++;
+				}
+			else if (iMessageUid<iHighestUid)
+				{
+				// If we are seeing uids below the oldest mirrored message, then it is likely
+				// that the sync limit has changed. The following code captures the range of 
+				// "missing" messages.
+				if (iMessageUid<iMissingUidLow || iMissingUidLow==0)
+					iMissingUidLow=iMessageUid;
+				if (iMessageUid>iMissingUidHigh || iMissingUidHigh==0)
+					iMissingUidHigh=iMessageUid;
+				}
+			break;
+
+		case EGettingStructure:
+			{
+			error = KErrNone;
+			User::LeaveIfError(iEntry->SetEntry(iGetPart));
+
+			if (!(iEntry->Entry().Owner()))
+				{
+				TMsvEmailEntry entry = iEntry->Entry();
+				
+				//reset flag for new message
+				iParsedTime=EFalse;
+				//initialise the time-stamp to the current UTC time
+				entry.iDate.UniversalTime();
+
+				// Make a CImHeader to populate with the data
+				CImHeader *messageheader=CImHeader::NewLC();
+				if (header)
+					ProcessHeaderExtraL(messageheader,NULL,&entry,header->Atom());
+
+				// Set correct 'remote size' in CImHeader
+				messageheader->SetRemoteSize(rfc822size);
+
+				// Create a message store.
+				CMsvStore* entryStore=iEntry->EditStoreL();
+				CleanupStack::PushL(entryStore);
+
+				// Store the RFC822 header information.
+				messageheader->StoreL(*entryStore);
+				entryStore->CommitL();
+				CleanupStack::PopAndDestroy(entryStore);
+
+				TInt attachments=0;
+				TInt relatedAttachments=0;
+				TBool isMHTML=EFalse;
+				iDecodedSizeOfAllParts = 0;
+
+				// Create the message entry structure under the root message
+				BuildTreeL(entry.Id(),structure,_L8(""),entry.Id(),attachments,isMHTML,relatedAttachments);
+				if(isMHTML==EFalse)
+					attachments+=relatedAttachments;
+
+				// Now that the structure has been created we can set the real message attributes.
+				// The MHTML, attachment flags and size were estimated (hopefully correctly) when the envelope was downloaded.
+				entry.iSize = iDecodedSizeOfAllParts;
+				entry.SetMHTMLEmail(isMHTML);
+				entry.SetAttachment(attachments);
+				entry.SetICalendar(iIsICalendar);
+				entry.SetVCalendar(iIsVCalendar);
+
+				/* If IDLE is enabled for the account , a new session is not created,
+				   so iIsICalendar,iIsVCalendar are not initialised to EFalse 
+				   when we fetch a new message, so do it HERE */
+
+				iIsICalendar = EFalse;
+				iIsVCalendar = EFalse;
+
+				User::LeaveIfError(iEntry->SetEntry(entry.Id()));
+				User::LeaveIfError(iEntry->ChangeEntryBulk(entry));
+				CleanupStack::PopAndDestroy(messageheader);
+				}
+
+			if (ImapIdleSupported()==EFalse)
+				{
+				CancelDummy();
+				}
+
+			DoFetchL();
+			iJustSentFetch = ETrue;
+			}
+			break;
+
+		case ESyncNew:
+			{
+			// Got a message's details
+
+			// First, let's check we asked for it: for example, the UW server
+			// gives us messages not in the correct range!
+			if (iMessageUid<=iHighestUid) 
+				{
+				DBG((LogText(_L8("Searching local messages for %d"),iMessageUid)));
+				while (iFolderPosition<iFolderIndex.Size())
+					{
+					if (iMessageUid==iFolderIndex[iFolderPosition].iUid)
+						{
+						DBG((LogText(_L8("Got duplicate UID %d - ignoring"),iMessageUid)));
+						return(error);
+						}
+					else if (iFolderIndex[iFolderPosition].iUid>iMessageUid || iFolderIndex[iFolderPosition].iMsvId==-1)
+						break;
+					iFolderPosition++;
+					}
+				}
+
+			// Update counters.
+			iMsgsDone++;
+			iHeadersFetched++;
+
+			// Creating messages in current folder: create this one
+			SetEntryL(iMailboxId);
+
+			// Check to see we have at least the minimum free disk space available
+			if (--iCheckDiskSpaceCounter <= 0)
+				{
+				// If we are running low on disk space then leave
+				ImCheckDiskSpace::LeaveIfLowDiskL(iFs, iCurrentDrive);
+				iCheckDiskSpaceCounter = KCheckDiskSpaceEveryNMessages;
+				}
+	
+			TMsvEmailEntry message;
+			message.iType=KUidMsvMessageEntry;
+			message.iMtm=KUidMsgTypeIMAP4;
+			message.iServiceId=iServiceId;
+			message.SetUID(iMessageUid);
+			message.SetValidUID(ETrue);
+			message.SetComplete(EFalse);
+			message.SetUnread(ETrue);
+			
+			//reset flag for new message
+			iParsedTime=EFalse;
+			//initialise the time-stamp to the current UTC time
+			message.iDate.UniversalTime();
+
+			// Process message flags
+			ProcessFlagsL(flags,message);
+
+			if (message.DeletedIMAP4Flag())
+				iRemoteMessagesDeleteTagged++;
+				
+			// Size of root message entry gets twiddled later
+			message.iSize=0;
+
+			// Set new flag
+			message.SetNew(ETrue);
+
+			// initialise the send state since the constructor sets it
+			// to StateUnknown
+			message.SetSendingState(KMsvSendStateNotApplicable);
+			
+			// Make a CImHeader to populate with the data
+			CImHeader *messageheader=CImHeader::NewLC();
+
+			if (header)
+				{
+				ProcessHeaderExtraL(messageheader,NULL,&message,header->Atom());
+				}
+
+			// Set correct 'remote size' in CImHeader
+			messageheader->SetRemoteSize(rfc822size);
+
+			// Save message size & attachment flag
+  			SetMessageFlagsL(message, structure);
+
+			// Create message
+			User::LeaveIfError(iEntry->CreateEntryBulk(message));
+			SetEntryL(iMessageId=message.Id());
+
+
+#if SET_RELATED_ID
+			// DS - Set message's iRelatedId to messageId to allow later UI kludges
+			message.iRelatedId=iMessageId;
+#endif
+			ChangeEntryBulkL(message);
+			CleanupStack::PopAndDestroy(messageheader);
+			break;
+			}
+		default:
+			// ESyncListNew and ESyncSearch should not result in a FETCH reply.
+			__ASSERT_DEBUG(EFalse,gPanic(EUnknownState));
+			break;
+			}
+		}
+
+	return(error);
+	}
+
+// code originally from void CImRecvConvert::ParseRecipientListL(...)
+void CImImap4Session::ProcessAddressListL(CDesCArray& aWhere, HBufC8** aAddresses)
+ 	{
+	TInt length((*aAddresses)->Length());
+ 	HBufC8* pBuf=HBufC8::NewLC(length);
+ 	TPtrC8 source((*aAddresses)->Ptr(), length);
+ 	const TUint8* ptr(source.Ptr());
+ 	const TUint8* lastCharPtr(ptr + source.Length() - 1);
+ 	TUint8 lookFor(0);
+ 	TInt count(0);
+ 	TBool finishedEntry(EFalse);
+ 
+ 	// get past white space
+ 	while(*ptr&&((*ptr==KImcvSP)||(*ptr==KImcvSemiColon))) ptr++;
+ 
+ 	// Entries are separated by commas or semicolons.
+ 	// Separators do not count if they appear within
+ 	// "", <>, () or embedded series of these, eg "(one, two)"
+ 	// so we need to keep track of these, including nesting.
+ 	while(*ptr && ptr <= lastCharPtr)
+ 		{
+ 		if(pBuf->Length()==0)
+ 			{
+ 			finishedEntry = EFalse;
+ 			}
+ 
+ 		switch(*ptr)
+ 			{
+ 			case KImcvLeftBracket:
+ 				if(lookFor==KImcvRightBracket)
+ 					{ // We've already had a "(", so now we need another one
+ 					count++;
+ 					}
+ 				else if(lookFor==0)
+ 					{ //We weren't looking for anything else, now we need to
+ 					lookFor = KImcvRightBracket;
+ 					count = 1;
+ 					}
+ 				// else we were already looking for something else, ignore this
+ 				break;
+ 			case KImcvLeftChevron:
+ 				if(lookFor==KImcvRightChevron)
+ 					{ //We've already had a "<", so now we need another one
+ 					count++;
+ 					}
+ 				else if(lookFor==0)
+ 					{ //We weren't looking for anything else
+ 					lookFor = KImcvRightChevron;
+ 					count = 1;
+ 					}
+ 				// else we were already looking for something else, ignore this
+ 				break;
+ 			case KImcvDoubleQuote:
+ 				if(lookFor==KImcvDoubleQuote)
+ 					{ // We already had a quote, so this matches it
+ 					lookFor = 0;
+ 					}
+ 				else if(lookFor==0)
+ 					{ //We weren't looking for anything else
+ 					lookFor = KImcvDoubleQuote;
+ 					}
+ 				// else we were already looking for something else, ignore this
+ 				break;
+ 			case KImcvRightBracket:
+ 			case KImcvRightChevron:
+ 				if(*ptr == lookFor)
+ 					{ //If we have found what we were looking for, decrease the count
+ 					count--;
+ 					if(count==0)
+ 						{ // Got everything, now we're not looking for anything
+ 						lookFor = 0;
+ 						}
+ 					// else keep looking for the same thing	again
+ 					}
+ 				// else we're looking for something else, ignore it
+ 				break;
+ 			case KImcvComma:
+ 			case KImcvSemiColon:
+ 				// If we're not looking for anything, we're finished
+ 				if (lookFor == 0)
+ 					finishedEntry = ETrue;
+ 				// else this comma or semicolon is part of a different token, ignore it
+ 				break;
+ 			}
+ 
+ 		if(!finishedEntry)
+ 			{
+ 			pBuf->Des().Append((TChar)*ptr);
+ 			// move to the next character
+ 			ptr++;
+ 			}
+ 		else
+ 			{
+ 			// that's it! store the address away
+#ifdef UNICODE
+ 			HBufC16* pBuf16 = HBufC16::NewLC(pBuf->Des().Length());
+ 			pBuf16->Des().Copy(pBuf->Des());
+ 			aWhere.AppendL( (HBufC16&) *pBuf16 );
+ 			CleanupStack::PopAndDestroy(pBuf16); // pBuf16
+#else
+			aWhere.AppendL( *pBuf );
+#endif			
+ 			pBuf->Des().SetLength(0);
+ 			finishedEntry = EFalse; //Ready for next entry
+ 
+ 			// get past the separator
+ 			ptr++;
+ 
+ 			// get past white space (& any other separators)
+ 			while(*ptr && (*ptr==KImcvSP || *ptr==KImcvTab || *ptr==KImcvComma || *ptr==KImcvSemiColon)) ptr++;
+ 			}
+ 		}
+ 		// catch the last name in the list
+ 		if (pBuf)
+ 			{
+ 			TInt recipientLength(pBuf->Length());
+ 			if (recipientLength > 0)
+ 				{
+#ifdef UNICODE
+ 				HBufC16* pBuf16 = HBufC16::NewLC(recipientLength);
+ 				pBuf16->Des().Copy(*pBuf);
+ 				aWhere.AppendL(*pBuf16);
+ 				CleanupStack::PopAndDestroy(pBuf16); // pBuf16
+#else
+ 				aWhere.AppendL( *pBuf );
+#endif
+ 				}
+ 			}
+ 		CleanupStack::PopAndDestroy(pBuf); // pBuf
+ 	}
+
+void CImImap4Session::ProcessFooterMessageL(TInt aSizeLeft)
+	{
+	TUid type = iEntry->Entry().iType;	
+	if (type == KUidMsvEmailTextEntry)
+		{
+		if(iHtmlEntrySize)
+			{
+			iBodyPartRemainingSize = aSizeLeft + iHtmlEntrySize;
+			}
+		else
+			{
+			iBodyPartRemainingSize = aSizeLeft;
+			}
+		// Message has both text and html and if sizeleft = 0 ,
+		// then there could be only html part left on server
+		// Message has only plain text, then footer message not required if sizeleft = 0
+		if(iBodyPartRemainingSize)
+			AttachFooterInfoL();
+		}
+	}
+
+void CImImap4Session::AttachFooterInfoL()
+	{
+	DBG((LogText(_L8("AttachFooterInfoL(): Footer Sting for this partially downloaded message"))));
+	RResourceFile resFile;
+	OpenResourceFileL(resFile,iFs);	// NB leaves if file not found
+	const TInt KNoOfDigitsInMailSize = 10; // maximum length for no of digits for remaining body parts size
+	_LIT(KIntegerDirective,"%d");
+	// make sure the resource file will be closed if anything goes wrong
+	// CloseResourceFile is declared in IMCMMAIN.H and defined in IMCMMAIN.CPP
+	TCleanupItem close(CloseResourceFile,&resFile);
+	CleanupStack::PushL(close);
+		
+	// Read the string for remaining mail size for footer
+	HBufC8* buf = NULL;
+	buf = resFile.AllocReadLC( PARTIAL_DOWNLOAD_FOOTER_MESSAGE );
+	TResourceReader reader;
+	reader.SetBuffer(buf);
+	// Check if %d is not found in the resource string (To avoid problems due to localisation)
+	if(buf->Find((TDesC8&)KIntegerDirective) == KErrNotFound)
+		{
+		iFooterString = (reader.ReadTPtrC()).AllocL();
+		}
+	else
+		{
+		HBufC* resourceBuf = (reader.ReadTPtrC()).AllocL();
+		iFooterString = HBufC::NewL(resourceBuf->Length()+KNoOfDigitsInMailSize);
+		iFooterString->Des().Format(*resourceBuf,(iBodyPartRemainingSize / KKiloByteSize));
+		delete resourceBuf;
+		}
+	CleanupStack::PopAndDestroy(2); // buf, resFile (Close resfile)
+	}
+
+// Set the following attributes of the given message entry for the IMAP information contained in atom tree:
+// iSize
+// 
+void CImImap4Session::SetMessageFlagsL(TMsvEmailEntry& aMessageEntry, CImapAtom* aRootAtom)
+	{
+	CArrayFixFlat<CImapAtom*>* atomStack = new (ELeave) CArrayFixFlat<CImapAtom*>(10);
+	CleanupStack::PushL(atomStack);
+	atomStack->AppendL(aRootAtom);
+
+	TBool hasAttachments = EFalse;
+	TBool hasHtml = EFalse;
+	TBool possibleHtml = EFalse;
+	TBool afterRelated = EFalse;
+	TBool afterAlternative = EFalse;
+	TBool htmlAfterAltRel = EFalse;
+	TBool hasICalendar = EFalse;
+	TBool hasVCalendar = EFalse;
+	TInt size = 0;
+
+	CImapAtom* currentAtom;
+
+	TBool doneAllSiblings;
+	TBool base64;
+	TInt index;
+	TBool numeric;
+	TInt atomValue;
+	TBool foundSize;
+	
+	// the root atom is of these types, the message body is an attachment
+	if(aRootAtom->Compare(KMIME_IMAGE) || 
+		aRootAtom->Compare(KMIME_AUDIO) || 
+		aRootAtom->Compare(KMIME_APPLICATION)||
+		aRootAtom->Compare(KMIME_VIDEO))
+		{
+		hasAttachments = ETrue;
+		}
+	
+	while (atomStack->Count() != 0)
+   		{
+		// Pop the top atom off of the stack
+		currentAtom = (*atomStack)[atomStack->Count() - 1];
+ 		atomStack->ResizeL(atomStack->Count() - 1);
+		base64 = EFalse;
+ 
+		// Run through all the sibling atoms unless this atom is a message/rfc822
+		if( currentAtom->Compare(KMIME_MESSAGE) && currentAtom->Next()->Compare(KMIME_RFC822) )
+			doneAllSiblings = ETrue;
+		else
+			doneAllSiblings = EFalse;
+		foundSize = EFalse;
+		possibleHtml = EFalse;
+		TInt siblingIndex = 0;
+		while (!doneAllSiblings)
+			{
+			// If a previous Sibling Atom has a HTML tag, then this could possibly 
+			// be an HTML message.  So we need to check all Sibling Atoms (ie the 
+			// current atom) to see if they contain Attachments (ie check their 
+			// child atoms for the Tag "ATTACHMENT"). If an attachment is found 
+			// then ignore the HTML flag. If none of the siblings contain an 
+			// attachment, then set the HTML flag, as this is a MHTML message.
+			if (possibleHtml)
+				{
+				// Check if the Child has an Attachment
+				if (currentAtom->Child() != NULL)
+					{
+					if (currentAtom->Child()->Compare(KMIME_ATTACHMENT))
+						{
+						// This Sibling contains an Attachment, so ignore the HTML flag.
+						possibleHtml = EFalse;
+						}
+					}
+
+				// Check if we have searched all Sibling Atoms
+				if (possibleHtml && currentAtom->Next() == NULL)
+					{
+					// None of the Siblings have attachments, so set the HTML flag.
+					hasHtml = ETrue;
+					possibleHtml = EFalse;
+					}
+					
+				}
+
+			// If there is a child atom then add it to the stack, we will check it later
+			if (currentAtom->Child() != NULL)
+				atomStack->AppendL(currentAtom->Child());
+
+			// If we pass a related atom then we may have an html message
+			// remember for later
+			if (currentAtom->Compare(KMIME_RELATED))
+				afterRelated = ETrue;
+
+			// If we pass an alternative atom then we may have an html message
+			// remember for later
+			if (currentAtom->Compare(KMIME_ALTERNATIVE))
+				afterAlternative = ETrue;
+
+			// If we find an html under a related or alternative then we
+			// can ignore the mixed section and assume that we have an html mail
+			if (afterAlternative || afterRelated)
+				{
+				if (currentAtom->Compare(KMIME_HTML))
+					htmlAfterAltRel = ETrue;
+				}
+
+			// MIXED ? If so then this email probably contains attachments
+			// or if there is a message/delivery-status then that is an
+			// attachment. 
+			if (currentAtom->Compare(KMIME_MIXED) || currentAtom->Compare(KMIME_DELIVERY_STATUS))
+				{
+				hasAttachments = ETrue;
+				}
+		
+			// HTML ?  If so this email could be an HTML message.  To make sure 
+			// we need to check this Atom's siblings
+			if (currentAtom->Compare(KMIME_HTML))
+				possibleHtml = ETrue;		
+
+			// Does this sibling atom say that the data is base64 encoded ?
+			// If so then we need to remember it to calculate the size.
+			if (currentAtom->Compare(KMIME_BASE64))
+				base64 = ETrue;
+			
+			if (currentAtom->Compare(KMIME_ICALENDAR))
+				hasICalendar = ETrue;
+			
+			if (currentAtom->Compare(KMIME_VCALENDAR))
+				hasVCalendar = ETrue;
+
+			// If this is the first numeric value of the current siblings then it is a size
+			// and must be added to the message size total
+			// Note that this size must be multiplied by 3/4 if it is base64
+			if (!foundSize && siblingIndex == 6)
+				{
+				index = currentAtom->Atom().Length();
+				
+				if (index != 0)
+					numeric = ETrue;
+				else
+					// If the atom is of 0 length then it can't possibly be numeric.
+					numeric = EFalse;
+
+				while ((index--) && (numeric))
+					{
+					if ((currentAtom->Atom()[index] < '0')
+						|| (currentAtom->Atom()[index] > '9'))
+						numeric = EFalse;
+					}
+
+				if (numeric)
+					{
+					TLex8 lex(currentAtom->Atom());
+					User::LeaveIfError(lex.Val(atomValue));
+					if (base64)
+						atomValue = (atomValue * 3) / 4;
+					size += atomValue;
+					foundSize = ETrue;
+					}
+				}
+
+			siblingIndex++;
+			currentAtom = currentAtom->Next();
+			if (currentAtom == NULL)
+				doneAllSiblings = ETrue;
+			}
+   		}
+
+	// Set the size
+	aMessageEntry.iSize = size;
+
+	// Set the Attachment, MHTML, ICalendar and VCalendar flags, if required.
+	if (hasAttachments)
+		{
+		aMessageEntry.SetAttachment(ETrue);
+		}
+
+	if( hasHtml || htmlAfterAltRel )
+		{
+		aMessageEntry.SetMHTMLEmail(ETrue);
+		}
+
+	if(hasICalendar)
+		{
+		aMessageEntry.SetICalendar(ETrue);
+		}
+		
+	if(hasVCalendar)
+		{
+		aMessageEntry.SetVCalendar(ETrue);
+		}
+		
+	CleanupStack::PopAndDestroy(atomStack);
+   	}
+
+TInt32 CImImap4Session::GetFetchSizeL(TInt32 aSizeLeft, TInt32 aSizeDownLoaded)
+{
+	TInt fetchSizeBytes = static_cast<TInt>(iServiceSettings->FetchSize());	
+	TInt32 minimumLimit = fetchSizeBytes;
+	TInt32 fetchSize = fetchSizeBytes;
+	TUid type = iEntry->Entry().iType;
+
+	if(iGetPartialMailInfo.iPartialMailOptions == ENoSizeLimits)
+		{
+		return KMaxTInt;
+		}
+	
+	if (type == KUidMsvEmailTextEntry  || type == KUidMsvEmailHtmlEntry)
+		{
+		if(type == KUidMsvEmailHtmlEntry)
+			{
+//			iHtmlEntrySize = iSizeOfThisPart;
+			minimumLimit = Minimum(iGetPartialMailInfo.iBodyTextSizeLimit,iGetPartialMailInfo.iTotalSizeLimit-iBodyTextSize);
+			}
+		else
+			{
+			// store body text size so that we can check whether html part for 
+			// this message can be downloaded 
+			// text size + html size < iBodyTextSizeLimit then download html part
+			iBodyTextSize = iSizeOfThisPart;
+			minimumLimit = Minimum(iGetPartialMailInfo.iBodyTextSizeLimit,iGetPartialMailInfo.iTotalSizeLimit);
+			}
+		// check disk space
+		if(!iIsDiskSpaceChecked)
+			{
+			CheckForDiskSpaceL(minimumLimit);
+			iIsDiskSpaceChecked = ETrue;
+			}
+
+		fetchSize = FetchSize(minimumLimit,aSizeDownLoaded,aSizeLeft);
+		}
+	else if (type == KUidMsvAttachmentEntry || type == KUidMsvEmailExternalBodyEntry)
+		{
+		minimumLimit = Minimum(iGetPartialMailInfo.iAttachmentSizeLimit,
+						iGetPartialMailInfo.iTotalSizeLimit-(iBodyTextSize+iHtmlEntrySize));
+
+		if(!iIsDiskSpaceChecked)
+			{
+			CheckForDiskSpaceL(minimumLimit);
+			iIsDiskSpaceChecked = ETrue;
+			}
+
+		fetchSize = FetchSize(minimumLimit,aSizeDownLoaded,aSizeLeft);
+		}
+	return fetchSize;
+	}
+
+TInt32 CImImap4Session::FetchSize(TInt32 aMinimumLimit,TInt32 aSizeDownLoaded, TInt32 aSizeLeft)
+	{
+	TInt fetchSizeBytes = static_cast<TInt>(iServiceSettings->FetchSize());	
+	TInt32 fetchSize = fetchSizeBytes;
+	if(aSizeLeft > (aMinimumLimit-aSizeDownLoaded))
+		{
+		if((aMinimumLimit-aSizeDownLoaded) < fetchSizeBytes)
+			{
+			fetchSize = aMinimumLimit-aSizeDownLoaded;
+			}
+		}
+	else
+		{
+		if(aSizeLeft < fetchSizeBytes)
+			{
+			fetchSize = aSizeLeft;
+			}
+		}
+	return fetchSize;
+	}
+
+// Process an address list structure into a CImHeader
+void CImImap4Session::ProcessAddressListL(HBufC8 **aBufferPtr, CDesCArray& aWhere, CImapAtom *aAtom)
+	{
+	while(aAtom)
+		{
+		// Process this address and add it to ToRecipients()
+		ProcessAddressL(aBufferPtr,aAtom);
+
+#ifdef UNICODE
+		HBufC *newaddress=HBufC::NewL((*aBufferPtr)->Length());
+		CleanupStack::PushL(newaddress);
+		newaddress->Des().Copy((*aBufferPtr)->Des());
+		aWhere.AppendL(newaddress->Des());
+		CleanupStack::PopAndDestroy();
+#else
+		aWhere.AppendL((*aBufferPtr)->Des());
+#endif
+
+		// Next address
+		aAtom=aAtom->Next();
+		}
+	}
+
+void CImImap4Session::AppendExtendL(HBufC8** aBufferPtr, const TDesC8& aText, TBool aOnStack)
+	{
+	HBufC8 *buffer = *aBufferPtr;
+	TInt32 space = buffer->Des().MaxLength() - (buffer->Des().Length() + aText.Length());
+	if (space < 0)
+		{
+		TInt32 inc = (-space) + KImapAddressSizeInc - ((-space) % KImapAddressSizeInc);
+		TInt32 newSize = buffer->Des().MaxLength() + inc;
+		HBufC8 *newBuf = buffer->ReAllocL(newSize);
+
+		if (aOnStack && newBuf!=buffer)
+			{
+			CleanupStack::Pop();
+			CleanupStack::PushL(newBuf);
+			}
+		
+		*aBufferPtr = buffer = newBuf;
+		}
+	buffer->Des().Append(aText);
+	}
+
+// Process an address structure into a buffer
+void CImImap4Session::ProcessAddressL(HBufC8** aBufferPtr, CImapAtom *aAtom)
+	{
+	// Erase buffer
+	(*aBufferPtr)->Des().Zero();
+
+	// Descend into address
+	aAtom=aAtom->ToChildL();
+
+	// Save name
+	CImapAtom* name=aAtom;
+	aAtom=aAtom->ToNextL();
+
+	// Skip route
+	aAtom=aAtom->ToNextL();
+
+	// Save user
+	CImapAtom* user=aAtom;
+	aAtom=aAtom->ToNextL();
+
+	// Save host
+	CImapAtom* host=aAtom;
+
+	// Build address string: is there a name?
+	if (name->Compare(_L8("")) || name->Compare(_L8("NIL")))
+		{
+		// No, just save user@host
+		AppendExtendL(aBufferPtr, user->Atom());
+		AppendExtendL(aBufferPtr, _L8("@"));
+		AppendExtendL(aBufferPtr, host->Atom());
+		}
+	else
+		{
+		// Yes, in the form 'Name <user@host>'
+		AppendExtendL(aBufferPtr, _L8("\""));
+		AppendExtendL(aBufferPtr, name->Atom());
+		AppendExtendL(aBufferPtr, _L8("\""));
+		AppendExtendL(aBufferPtr, _L8(" <"));
+		AppendExtendL(aBufferPtr, user->Atom());
+		AppendExtendL(aBufferPtr, _L8("@"));
+		AppendExtendL(aBufferPtr, host->Atom());
+		AppendExtendL(aBufferPtr, _L8(">"));
+		}
+
+#ifdef PRINTING
+	TPtrC8 addr=(*aBufferPtr)->Des();
+	if (addr.Length() > 256)
+		addr.Set(addr.Ptr(), 256);
+	LogText(_L8("  address '%S'"),&addr);
+#endif
+	}
+
+// SJM 19990922. Previous version of this function used SetUnread
+// rather than SetIMAP4Unread or SetIMAP4Flags. This meant that the
+// IMAP4Unread flag itself was never set. This seems like a bug.
+
+TBool CImImap4Session::ProcessFlagsL(CImapAtom* aAtom, TMsvEmailEntry& aMessage)
+	{
+	TBool unread = EFalse;
+    TBool seen = EFalse;
+	TBool answered = EFalse;
+	TBool flagged = EFalse;
+	TBool deleted = EFalse;
+	TBool draft = EFalse;
+	TBool recent = EFalse;
+	TBool flagsUpdated = EFalse;
+
+	// Descend
+	aAtom=aAtom->Child();
+
+	// Process flags
+	while(aAtom!=NULL)
+		{
+		// Check for standard IMAP flags
+		if (aAtom->Compare(KIMAPFLAG_ANSWERED))
+			answered = ETrue;
+		else if (aAtom->Compare(KIMAPFLAG_DELETED))
+			deleted = ETrue;
+		else if (aAtom->Compare(KIMAPFLAG_DRAFT))
+			draft = ETrue;
+		else if (aAtom->Compare(KIMAPFLAG_FLAGGED))
+			flagged = ETrue;
+		else if (aAtom->Compare(KIMAPFLAG_RECENT))
+			recent = ETrue;
+		else if (aAtom->Compare(KIMAPFLAG_SEEN))
+			seen = ETrue;
+		else if (aAtom->Compare(KIMAPFLAG_UNREAD))
+			{
+			unread = ETrue;
+
+			// There is at least one unread message in this folder
+			iSomeUnread=ETrue;
+			}
+
+		// Next atom
+		aAtom=aAtom->Next();
+		}
+
+
+	TBool oUnread, oSeen, oAnswered, oFlagged, oDeleted, oDraft, oRecent;
+	aMessage.GetIMAP4Flags(oUnread, oSeen, oAnswered, oFlagged, oDeleted, oDraft, oRecent);
+
+	// Are we configured to update the \seen flag on the server?
+	if (iServiceSettings->UpdatingSeenFlags())
+		{
+		// Make a note to update the servers \Seen flag if CHANGED on the client
+		//  and different to the servers version
+		if ( FIXBOOL(aMessage.Unread()) == seen && FIXBOOL(oSeen) == seen)
+			{
+			if (aMessage.Unread())
+				iClearSeenList->AppendL(aMessage.Id());
+			else
+				iSetSeenList->AppendL(aMessage.Id());
+			}
+		}
+
+	if ( FIXBOOL(oUnread) != unread || FIXBOOL(oSeen) != seen || FIXBOOL(oAnswered) != answered
+		 || FIXBOOL(oFlagged) != flagged || FIXBOOL(oDeleted) != deleted
+		 || FIXBOOL(oDraft) != draft || FIXBOOL(oRecent) != recent )
+		{
+		aMessage.SetIMAP4Flags(unread, seen, answered, flagged, deleted, draft, recent);
+		flagsUpdated = ETrue;
+		}
+
+	// Are we configured to update the \seen flag on the server?
+	if (iServiceSettings->UpdatingSeenFlags())
+		{
+		// Now copy the inverse of the \Seen flag down to the clients Unread flag 
+		//  except when LastSyncSeen is set (ie when the client version is more up to date)
+		//  This means that the client Read status ALWAYS reflects the IMAP \Seen state
+		if ( FIXBOOL(aMessage.Unread()) == seen && FIXBOOL(oSeen) != seen)
+			{
+			aMessage.SetUnread(!seen);
+			flagsUpdated = ETrue;
+			}
+		}
+
+	return flagsUpdated;
+	}
+
+// Process output from list command
+void CImImap4Session::ProcessListL(CImapAtom *aAtom)
+	{
+	// Just getting hierarchy separator?
+	if (iState==EImapStateSeparatorWait)
+		{
+		// Save it away
+		aAtom=aAtom->ToNextL();
+
+		// Is it one character long? (all should be) - if not, ignore it
+		if (aAtom->Atom().Length()!=1)
+			return;
+
+		// Save it for local use
+		iHierarchySeparator=aAtom->Atom();
+
+		// Update service entry
+  		CEmailAccounts* account = CEmailAccounts::NewLC();
+		TImapAccount id;
+		id.iImapAccountId = iEntry->Entry().MtmData2();  // iMtmData2 of the service entry contains TImapAccountId
+		id.iImapAccountName = iEntry->Entry().iDetails;
+		id.iImapService = iEntry->Entry().iServiceId;
+		id.iSmtpService = iEntry->Entry().iRelatedId;
+
+  		account->LoadImapSettingsL(id, *iServiceSettings);
+  		
+  		// Set new path separator
+  		iServiceSettings->SetPathSeparator(iHierarchySeparator[0]);
+  		id.iImapAccountName = KNullDesC;    // So that account name is not updated
+  		account->SaveImapSettingsL(id, *iServiceSettings);
+  		CleanupStack::PopAndDestroy(account);    
+		return;
+		}
+
+	// Anywhere to save it?
+	if (!iList) return;
+
+	// Getting hierarchy from server - process the lot
+	CImapAtom *fl;
+	CImImap4DirStruct *entry=new (ELeave) CImImap4DirStruct;
+	CleanupStack::PushL(entry);
+
+	// List reply is of the form: * LIST (flags) "pathsep" "path"
+
+	// At the start, it's a mailbox
+	entry->iIsMailbox=ETrue;
+	entry->iIsFolder=ETrue;
+
+	// Process flags
+	if ((fl=aAtom->Child())!=NULL)
+		{
+		while(fl)
+			{
+			// Check flags
+			if (fl->Compare(KIMAPFLAG_NOSELECT))
+				{
+				// \Noselect means it isn't a mailbox
+				entry->iIsMailbox=EFalse;
+				}
+			else if (fl->Compare(KIMAPFLAG_NOINFERIORS))
+				{
+				// \Noinferiors means it can't be a folder
+				entry->iIsFolder=EFalse;
+				}
+
+			// Next flag
+			fl=fl->Next();
+			}
+		}
+
+	// Path separator: only save this if it is a valid length
+	aAtom=aAtom->ToNextL();
+	if (aAtom->Atom().Length()==1)
+		iHierarchySeparator=aAtom->Atom();
+
+	// Path
+	aAtom=aAtom->ToNextL();
+	TPtrC8 path(aAtom->Atom());
+
+	// In case server has returned us the parent when we asked for children,
+	// ignore items which are too small to be path(separator)child names.
+	if (path.Length()>iCommandBuf.Length())
+		{
+		// CC:Mail has an annoying habit of not listening to us when we ask for
+		// children, and returning siblings instead: this takes some extra CPU
+		// time, so we only do it if we're talking to a CC:Mail server, but here
+		// we check that the returned path is actually what we asked for before
+		// proceding.
+		if (iTalkingToCCMail)
+			{
+			// Check path starts with iCommandBuf's contents
+#ifdef UNICODE
+			HBufC8 *narrow=HBufC8::NewL(iCommandBuf.Length());
+			narrow->Des().Copy(iCommandBuf);
+			if (path.Find(*narrow)!=0)
+				{
+				// Nope. Ignore this. Silly server.
+				delete narrow;
+				CleanupStack::PopAndDestroy();
+				return;
+				}
+			delete narrow;
+#else
+			if (path.Find(iCommandBuf)!=0)
+				{
+				// Nope. Ignore this. Silly server.
+				CleanupStack::PopAndDestroy();
+				return;
+				}
+#endif
+			}
+			
+		// Add leaf, ignoring the path that all servers return before
+		// the leaf.
+
+		// Removed the UNICODE special case since we might need to
+		// modify the buffer now to do the UnModUTF7.
+#if 1
+		TPtrC8 leaf = path.Mid(iCommandBuf.Length());
+		HBufC* text = DoUnModUTF7LC( leaf );
+		entry->SetLeafnameL(text->Des());
+
+		CleanupStack::PopAndDestroy();
+#else
+		HBufC *newleaf=HBufC::NewL(path.Length()-iCommandBuf.Length());
+		CleanupStack::PushL(newleaf);
+		newleaf->Des().Copy(path.Mid(iCommandBuf.Length()));
+		entry->SetLeafnameL(newleaf->Des());
+		CleanupStack::PopAndDestroy();
+#endif
+
+		// If there's anything there (might just be the path), then add it to array
+		if (entry->Leafname().Length()>0)
+			{
+			// Add to array
+			iList->AppendL(entry);
+
+			// It's in the array now
+			CleanupStack::Pop();
+			}
+		else
+			{
+			// Get rid of it - it's not needed
+			CleanupStack::PopAndDestroy();
+			}
+		}
+	else
+		{
+		// Get rid of it - it's not needed
+		CleanupStack::PopAndDestroy();
+		}
+	}
+
+// Process output from list command
+void CImImap4Session::ProcessLsubL(CImapAtom *aAtom)
+	{
+	// Process the lot: it'll be a full path which we need to cut up
+	// Reply is of the form: * LSUB (flags) "pathsep" "path"
+
+	// Skip flags
+	aAtom=aAtom->ToNextL();
+
+	// We already know the path separator, so skip it
+	aAtom=aAtom->ToNextL();
+
+	// Strip folder path: to do this we just remove the start of the path from
+	// the returned string, so we need the length of it.
+	TInt pathlength=iFolderPath.Length();
+
+	// If the length is non-zero, this means that there is a folderpath, and
+	// we will need to strip both it, and the following path separator character.
+	// If there is no path, we don't want to strip anything, so we don't
+	// increment it at all.
+	if (pathlength)
+		pathlength++;
+
+	// Get a (possibly wide) copy of the path, skipping the prefix
+	TPtrC8 skippedPrefix(aAtom->Atom().Mid(pathlength));
+	HBufC* basePath = DoUnModUTF7LC( skippedPrefix );
+	TPtrC path(basePath->Des());
+	
+	// Go down through path
+	TMsvId where=iServiceId;
+	while(where)
+		{
+		// Truncate this bit of path: look for a hierarchy separator
+		TInt separator=path.Locate(iHierarchySeparator[0]);
+		TPtrC element(path);
+
+		// Anything?
+		if (separator!=KErrNotFound)
+			{
+			// Truncate this element there
+			element.Set(element.Ptr(),separator);
+			}
+
+		// Try to find this element at the search level
+		SetEntryL(where);
+		GetChildrenL(*iSelection);
+
+		// Nothing? Give up.
+		if (!iSelection->Count())
+			break;				// out of while
+
+		// Check all the children
+		TInt a;
+		for(a=0;a<iSelection->Count();a++)
+			{
+			// This one?
+			SetEntryL((*iSelection)[a]);
+
+			if (iEntry->Entry().iDetails.Compare(element)==0)
+				{
+				// Found it! Are we at the end, ie no more elements?
+				if (separator==KErrNotFound)
+					{
+					// Set subscribed flag
+					TMsvEmailEntry message=iEntry->Entry();
+					if (!message.Subscribed())
+						{
+						// It needs changing, do it
+						message.SetSubscribed(ETrue);
+						ChangeEntryL(message);
+						}
+
+					// All done: this will exit the loop
+					where=0;
+					break;
+					}
+				else
+					{
+					// Update path
+					where=(*iSelection)[a];
+					path.Set(path.Ptr()+separator+1,path.Length()-separator-1);
+
+					// Exit loop
+					break;
+					}
+				}
+			}
+
+		if (a==iSelection->Count())
+			{
+			// Didn't find it. Humm
+			DBG((LogText(_L8("Didn't find entry '%S': tree out of date?"),&element)));
+
+			break;				// out of while
+			}
+		}
+
+	CleanupStack::PopAndDestroy();
+	}
+
+void CImImap4Session::SendLoginL()
+	{
+	// We need to login in as few steps as possible, ie avoid using
+	// literals if possible as this incurrs a RTT delay as we have to
+	// wait for server's OK before sending the literal.
+
+	// Set up to send a command
+	NewTag();
+
+	// No need to quote? Do it in one line if we can,
+	if (!iLiteralUsername && !iLiteralPassword)
+		{
+		// Send login line. Turn off logging before sending
+		iImapIO->PerformLogging(EFalse);
+		iImapIO->SendL(iStatus,_L8("%d LOGIN %S %S\r\n"),iTag,iUsername,iPassword);
+		iImapIO->PerformLogging(ETrue);
+		}
+	else
+		{
+		if (iLiteralUsername)
+			{
+			// Send literal username
+			iImapIO->SendL(iStatus,_L8("%d LOGIN {%d}\r\n"),iTag,iUsername->Length());
+			iState=EImapStateLoginSendUser;
+			}
+		else
+			{
+			// Send username and literal password. Turn off logging before sending
+			iImapIO->PerformLogging(EFalse);
+			iImapIO->SendL(iStatus,_L8("%d LOGIN %S {%d}\r\n"),iTag,iUsername,iPassword->Length());
+			iImapIO->PerformLogging(ETrue);
+			
+			iState=EImapStateLoginSendPassword;
+			}
+		}
+
+	// Don't complete yet!
+	NewTagSent();
+	}
+
+void CImImap4Session::SendCapabilityL()
+	{
+	// Check server capabilities
+	iState=EImapStateCapabilityWait;
+	iSeenVersion=EFalse;
+
+	// Send the command
+	NewTag();
+	iImapIO->SendL(iStatus,_L8("%d CAPABILITY\r\n"),iTag);
+	NewTagSent();
+	}
+
+void CImImap4Session::StartIdle(TRequestStatus& aRequestStatus)
+	{
+        DBG((LogText(_L8("CImImap4Session::StartIdle()"))));
+	TInt err=KErrNone;
+	if (!Connected() || iState==EImapStateIdleWait)
+		{
+		Queue(aRequestStatus);
+		err=KErrDisconnected;
+		}
+	else
+		TRAP(err,StartIdleL(aRequestStatus));
+	if (err!=KErrNone)
+                {
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+		DBG((LogText(_L8("CImap4Session::StartIdle(): calling Complete()"))));
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+		
+
+		Complete(err);
+                }
+	}
+
+void CImImap4Session::StartIdleL(TRequestStatus& aRequestStatus)
+	{
+        DBG((LogText(_L8("CImImap4Session::StartIdleL()"))));
+	Queue(aRequestStatus);
+	DoStartIdleL();
+	}
+
+void CImImap4Session::DoStartIdleL()
+	{
+        DBG((LogText(_L8("CImImap4Session::DoStartIdleL()"))));
+ 	__ASSERT_DEBUG(ImapIdleSupported(), gPanic(EBadUseOfImap4Op));
+ 	if(!ImapIdleSupported())
+	 	{
+	 	User::LeaveIfError(KErrGeneral);//Bad use of Imap4Op
+	 	}
+ 	__ASSERT_DEBUG(iState==EImapStateSelected, gPanic(ESyncWhenNotSelected));
+	if(!(iState==EImapStateSelected))
+		{
+		User::LeaveIfError(KErrArgument);// Sync when not selected .
+		}
+	// Reset flags 	
+	iMailboxReceivedExists=EFalse;
+	iMailboxReceivedExpunge=EFalse;
+	iMailboxReceivedFlags=EFalse;
+	
+	iState=EImapStateIdleWait;
+	SendMessageL(KIMAPC_IDLE);
+	}
+
+void CImImap4Session::StopIdle(TRequestStatus& aRequestStatus)
+	{
+        DBG((LogText(_L8("CImImap4Session::StopIdle()"))));
+	TInt err(KErrNone);
+	if (!Connected())
+		{
+		Queue(aRequestStatus);
+		err=KErrDisconnected;
+		}
+	else
+		{
+		// stop idle is only called by compound command
+		// so flag this 
+		iCompoundStopIdle = ETrue;
+		TRAP(err,StopIdleL(aRequestStatus));
+		}
+	if (err!=KErrNone)
+		{
+                DBG((LogText(_L8("-----------------------------------------------------------"))));
+		DBG((LogText(_L8("CImap4Session::StopIdle(): calling Complete()"))));
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+		Complete(err);
+		}
+	}
+
+void CImImap4Session::SyncStopIdleL(TRequestStatus& aRequestStatus)
+	{
+	DBG(LogText(_L8("CImImap4Session::SyncStopIdleL (state=%d)"), iState));
+	iStoppingIdleForSync = ETrue;
+	StopIdleL(aRequestStatus);
+	}
+
+void CImImap4Session::StopIdleL(TRequestStatus& aRequestStatus)
+	{
+        DBG((LogText(_L8("CImImap4Session::StopIdleL()"))));
+	Cancel();
+	Queue(aRequestStatus);
+	DoStopIdleL();
+	}
+
+void CImImap4Session::DoStopIdleL()
+	{
+	DBG(LogText(_L8("CImImap4Session::DoStopIdleL(state=%d)"),iState)) ;
+	__ASSERT_DEBUG(ImapIdleSupported(), gPanic(EBadUseOfImap4Op));
+	if(!ImapIdleSupported())
+		{
+		User::LeaveIfError(KErrGeneral);//Bad Use of Imap4Op
+		}
+	__ASSERT_DEBUG(IsIdling(), gPanic(EInvalidStatus));
+	if(!IsIdling())
+		{
+		User::LeaveIfError(KErrGeneral); // Invalid Status
+		}
+
+	iIdleTimer->Cancel();
+	iState=EImapStateStopIdleWait;
+
+	SendUntaggedMessageWithTimeoutL(KIMAPC_DONE, KImapDoneInactivityTimeSeconds);
+	}
+
+// Process output from search command
+// V2 version could alter significantly and become #ifdef-unreadable
+void CImImap4Session::ProcessSearchL(CImapAtom *aAtom)
+	{
+	// Process the reply from a uid search command into an fixed array of uids.
+	// The data is recieved as a series of atoms containing numerical only data.
+	// If non-numerical data is recieved, then this function will leave.
+	// Use the key to do inserts in sequence. Takes care of duplicates
+	TKeyArrayFix key(0,ECmpTInt32);
+	TUint atomUid;
+	while (aAtom)
+		{
+		if (aAtom->Atom().Length()>0)
+			{
+			// Check for numerical value.
+			TChar atomChar(aAtom->Atom()[0]);
+			if (atomChar.IsDigit() && aAtom->Value(atomUid)==KErrNone)
+				{
+				// Append it to the end search UID list
+				// Put in sequence no duplicates
+				TRAPD(err,iSearchList->InsertIsqL(static_cast<TUint32>(atomUid),key));
+				if(err != KErrNone && err != KErrAlreadyExists)
+					{
+					User::Leave(err);
+					}
+				}
+			else
+				// Not a number or cant get its value.
+				User::Leave(KErrArgument);
+			}
+		else
+			{
+			// Null atom.
+			User::Leave(KErrArgument);
+			}
+		aAtom=aAtom->Next();
+		}
+
+	DBG((LogText(_L8("UID search found %d UIDs in remote folder"),iSearchList->Count())));
+	}
+
+// A tag has completed OK
+void CImImap4Session::CommandCompleteL(TInt aResult)
+	{
+	DBG((LogText(_L8("CImImap4Session::CommandComplete(state=%d, result=%d)"),iState,aResult)));
+	iCommandFailure=aResult;
+	
+	// Data has been received from the remote server - can cancel the cancel-timer,
+	// cancel wasn't cos of hanging due to GPRS suspend.
+	iCancelTimer->Cancel();
+
+	switch(iState)
+		{
+	case EImapStateCapabilityWait:
+		// Did we see the correct version ID?
+		if (!iSeenVersion)
+			{
+			// No - not in any of the lines between issuing the capability
+			// command and the completion of the command
+			Fail(KErrImapServerVersion);
+			return;
+			}
+
+		// Move into whatever logon state is required
+		iState=iSavedState;
+
+		// Need to login?
+		if (iState==EImapStateLoginWait)
+			{
+			switch (iSecurityState)
+				{
+			case ESecure:
+			case EUnsecure:
+				// shouldn't ever get here...
+				SendLoginL();
+				break;
+
+			case ENegotiating:
+				SendLoginL();
+				iSecurityState=ESecure;
+				break;
+
+			case EUnknown:
+				if (iServiceSettings->SecureSockets())
+					{
+					if (iCapabilityStartTLS)
+						{
+						// send StartTLS
+						NewTag();
+						iImapIO->SetTLSResponseL();
+						iImapIO->SendL(iStatus,_L8("%d STARTTLS\r\n"),iTag);
+						NewTagSent();
+						iState=EImapStateStartTLSWait;
+						iSendQueued=EFalse; // no need to queue 'send' cause session will take care of the response.
+						}
+					else
+						Fail(KErrImapServerNoSecurity);
+					}
+				else
+					{
+					if (iCapabilityLoginDisabled)
+						Fail(KErrImapServerLoginDisabled);
+					else
+						{
+						SendLoginL();
+						iSecurityState=EUnsecure;
+						}
+					}
+				break;
+				}
+
+			return;
+			}
+		break;
+
+	case EImapStateStartTLSWait:
+		SendCapabilityL();
+		iSecurityState = ENegotiating;
+		return;
+	
+	case EImapStateSelectWait:
+		switch(aResult)
+			{
+		case KErrNone:
+			// Select OK
+			DBG((LogText(_L8("CImImap4Session::CommandCompleteL(): setting iState to EImapStateSelected"))));
+			iState=EImapStateSelected;
+			if( iCancelAndIdle )
+				{
+				if( iReissueIdle )
+					{
+					// Need to re-issue the IDLE command - probably due to a cancel
+					// during a populate commmand and session was IDLE before the
+					// command.
+					// As the populate could have been for a message not in the Inbox,
+					// (and this is the completion of SELECT command for appropriate
+					// mailbox) need to ensure IDLE started in inbox.
+
+					// Do the select (if we really need to) or skip if possible.
+					if( iMailboxId==GetInbox() && iMailboxWritable )
+						{
+						DBG((LogText(_L8("Need to re-issue IDLE command"))));
+
+						// No need to do the select - so re-issue the IDLE
+						DoStartIdleL();				
+						}
+					else
+						{
+						DBG((LogText(_L8("Need to issue IDLE - first select Inbox (writable)"))));
+
+						// Looks like we need to do the select...
+						DoSelectL(GetInbox(), ETrue);
+						}
+					}
+				else
+					{
+					DBG((LogText(_L8("Do not re-issue IDLE - cancel completed"))));
+					
+					// Cancelling completed - stay in this mailbox and do not issue idle.
+					iCancelAndIdle = EFalse;
+					}
+				}
+			break;
+
+		case KErrIMAPNO:
+			DBG((LogText(_L8("CImap4Session::CommandComplete(): iState=EImapStateSelectWait"))));
+			DBG((LogText(_L8("-----------------------------------------------------------"))));
+			DBG((LogText(_L8("CImap4Session::CommandComplete(): calling Complete()"))));
+			DBG((LogText(_L8("-----------------------------------------------------------"))));
+			// Select failed
+			Complete(KErrIMAPNO);
+			return;
+			}
+		break;
+
+	case EImapStateSeparatorWait:
+	case EImapStateCloseWait:
+		// Back to unselected
+		iState=EImapStateNoSelect;
+		break;
+
+	case EImapStateCommandWait:
+	case EImapStateListWait:
+	case EImapStateLsubWait:
+	case EImapStateAppendResultWait:
+		// Restore old state: could have been selected/unselected
+		iState=iSavedState;
+		break;
+		
+	case EImapStateFetchCancelWait:
+		// No more parts to fetch - reset the fetch list
+		iFetchList->Reset();
+
+		// Dispose of any buffers we've got left
+		delete iPartialLine;
+		iPartialLine=NULL;
+		delete iAttachmentFile;
+		iAttachmentFile=NULL;
+		delete iAttachmentFullPath;
+		iAttachmentFullPath=NULL;
+		delete iAttachmentMimeInfo;
+		iAttachmentMimeInfo=NULL;
+		
+		// Ensure attachment file state correct so that any re-fetch will be ok
+		iAttachmentFileState=EFileNotOpen;
+
+		// All done - ensure any changes are committed to disk
+		iEntry->CompleteBulk();
+
+		// Back in selected state - do we need to move back to inbox?
+		iState=EImapStateSelected;
+		iSyncState=ENotSyncing;
+		if( iCancelAndIdle )
+			{
+			if( iReissueIdle )
+				{
+				// Need to re-issue the IDLE command - probably due to a cancel
+				// during a populate commmand and session was IDLE before the
+				// command.
+				// As the populate could have been for a message not in the Inbox,
+				// (and this is the completion of SELECT command for appropriate
+				// mailbox) need to ensure IDLE started in inbox.
+
+				// Do the select (if we really need to) or skip if possible.
+				if( iMailboxId==GetInbox() && iMailboxWritable )
+					{
+					DBG((LogText(_L8("Need to re-issue IDLE command"))));
+
+					// No need to do the select - so re-issue the IDLE
+					DoStartIdleL();				
+					}
+				else
+					{
+					DBG((LogText(_L8("Need to issue IDLE - first select Inbox (writable)"))));
+
+					// Looks like we need to do the select...
+					DoSelectL(GetInbox(), ETrue);
+					}
+				}
+			else
+				{
+				DBG((LogText(_L8("Do not re-issue IDLE - cancel completed"))));
+				
+				// Cancelling completed - stay in this mailbox and do not issue idle.
+				iCancelAndIdle = EFalse;
+				}
+			}
+		break;
+
+	case EImapStateFetchWait:
+		// Fetch has completed: any more parts to go?
+		iProgress.iPartsDone++;
+
+		if (iFetchList->Count())
+			{
+			// Yes, fetch next one
+			FetchAnItemL((*iFetchList)[0]);
+			iFetchList->Delete(0,1);
+			return;
+			}
+
+		// Dispose of any buffers we've got left
+		delete iPartialLine;
+		iPartialLine=NULL;
+		delete iAttachmentFile;
+		iAttachmentFile=NULL;
+		delete iAttachmentFullPath;
+		iAttachmentFullPath=NULL;
+		delete iAttachmentMimeInfo;
+		iAttachmentMimeInfo=NULL;
+		// All done - ensure any changes are committed to disk
+		iEntry->CompleteBulk();
+		iState=EImapStateSelected;
+		iSyncState=ENotSyncing;
+		break;
+
+	case EImapStateLoginWait:
+		switch(aResult)
+			{
+		case KErrNone:
+			// Login OK: do we know the separator character?
+			if (!iHierarchySeparator.Length())
+				{
+				// No, ask server for it
+				NewTag();
+				iImapIO->SendL(iStatus,_L8("%d LIST \"\" \"\"\r\n"),iTag);
+				NewTagSent();
+				iState=EImapStateSeparatorWait;
+				return;
+				}
+				
+			iState=EImapStateNoSelect;
+			break;
+
+		case KErrIMAPNO:
+		case KErrImapBadLogon:
+			// Bad username/password
+			Fail(KErrImapBadLogon);
+			return;
+			}
+		break;
+	case EImapStateSelected:
+		{
+		// reset flag after stop idle completes
+		iCompoundStopIdle = EFalse;
+		iStoppingIdleForSync = EFalse;
+		}
+	case EImapStateCreateWait:
+	case EImapStateRenameWait:
+	case EImapStateDeleteWait:
+	case EImapStateSubscribeWait:
+		// Modification operation has happened: did it go OK?
+		if (aResult==KErrNone)
+			{
+			TMsvEmailEntry message;
+			SetEntryL(iCommandIds[0]);
+
+			switch(iState)
+				{
+			case EImapStateCreateWait:
+				{
+				// We need to create the actual folder, as it now exists on the server
+				message.iType=KUidMsvFolderEntry;
+				message.iMtm=KUidMsgTypeIMAP4;
+				message.iServiceId=iServiceId;
+				message.SetMtmData1(0);
+				message.SetMtmData2(0);
+				message.SetMtmData3(0);
+				message.SetValidUID(EFalse);
+				message.SetMailbox(ETrue); // Default to creating a mailbox
+				message.SetComplete(ETrue);
+				message.iSize=0;
+				message.iDetails.Set(iCommandBuf);
+				iEntry->CreateEntry(message);
+				// Save the created id in the progress buffer
+				iProgress.iReturnedMsvId=message.Id();
+				break;
+				}
+
+			case EImapStateRenameWait:
+				{
+				// Modify the entry
+				message=iEntry->Entry();
+				message.iDetails.Set(iCommandBuf);
+				ChangeEntryL(message);
+				break;
+				}
+
+			case EImapStateDeleteWait:
+				// Delete the entry: we are set to the parent currently
+				iEntry->DeleteEntry(iCommandIds[1]);
+				break;
+
+			case EImapStateSubscribeWait:
+				// Set/reset the subscription flag
+				message=iEntry->Entry();
+				message.SetSubscribed(iCommandFlags[0]);
+				ChangeEntryL(message);
+				break;
+
+			default: // To stop AER warnings
+				break;
+				}
+
+			// Back to previous state
+			iState=iSavedState;
+			}
+		DBG((LogText(_L8("CImap4Session::CommandComplete(): iState=EImapStateSubscribeWait"))));
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+		DBG((LogText(_L8("CImap4Session::CommandComplete(): calling Complete()"))));
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+		Complete(aResult);
+		return;
+
+	case EImapStateDeleteAllWait:
+		// Expunge the folder by closing
+		NewTag();
+		iImapIO->SendL(iStatus,_L8("%d CLOSE\r\n"),iTag);
+		NewTagSent();
+		iState=EImapStateDeleteFolderWait;
+		return;
+
+	case EImapStateDeleteFolderWait:
+		{
+		// Delete all children in folder locally as they have all been expunged
+		SetEntryL(iMailboxId);
+		GetChildrenL(*iSelection);
+		TInt a=0;
+		while(a<iSelection->Count())
+			iEntry->DeleteEntry((*iSelection)[a++]);
+		iSelection->Reset();
+
+		// Back to unselected as we've closed the folder
+		iState=EImapStateNoSelect;
+		break;
+		}
+
+	case EImapStateSynchroniseWait:
+		{
+		if (aResult==KErrNone && iSyncState==ESyncSearch)
+			{
+			iFolderPosition+=KImapUidSearchSize;
+			// Check to see if we have all the messages.
+			if (iFolderPosition>=iMailboxSize)
+				{
+				DBG((LogText(_L8("UID search complete"))));
+
+				// Set the mailbox size to the number of UIDs returned by the search
+				iMailboxSize = iSearchList->Count();
+
+				iSyncState=ESyncListOld;
+				// We have the full list of remote UIDs - fall through.
+				}
+			else
+				{
+				// Should be able to hit this code if KImapUidSearchSize is reduced to < the size
+				// of the remote mailbox (iMailboxSize)
+				// SearchString non 0 means a refined UID SEARCH is required
+				DBG((LogText(_L8("UID search - get next manageable block of UIDs"))));
+				NewTag();
+				if(iServiceSettings->SearchString().Length() != 0)
+					{
+					// Refined search required
+					// Still uses the indexes but appends user specified search criteria
+					_LIT8(KSearchString,"%d UID SEARCH %d:%d %S\r\n");
+					TPtrC8 ptr = iServiceSettings->SearchString();
+					iImapIO->SendL(iStatus,KSearchString,iTag,iFolderPosition+1,Min(iMailboxSize,iFolderPosition+KImapUidSearchSize),&ptr);
+					}
+				else
+					// Normal unrefined SEARCH. Will pull back all the UIDs between indexes
+					{
+					_LIT8(KSearchString,"%d UID SEARCH %d:%d\r\n");
+					iImapIO->SendL(iStatus,KSearchString,iTag,iFolderPosition+1,Min(iMailboxSize,iFolderPosition+KImapUidSearchSize));
+					}
+				NewTagSent();
+				return;
+				}
+			}
+
+		if (aResult==KErrNone && iSyncState==ESyncListOld)
+			{
+			// At this point the remote command to search out folder UIDs has completed. This
+			// list will contain all UIDs for messages in the remote folder. This may be too
+			// many, and if so, the list is truncated to only include the N most recent 
+			// messages in accordance with the synchronisation limit.
+
+			TInt local=0;
+			TInt remote=0;
+			// if no UID Search string defined then the old logic is used
+			TInt syncThresh = 0;
+			if(iServiceSettings->SearchString().Length() != 0)
+				{
+				syncThresh = 0;
+				}
+			else	// If no search string is set we will use the old behaviour
+				{
+				syncThresh=(iSyncLimit<iMailboxSize)?iMailboxSize-iSyncLimit:0;	
+				}
+			TBool orphanThis=EFalse;
+			TBool folderPositionFound=EFalse;
+			iFolderPosition=0;
+
+			// At this stage (prior to truncation), we have a full list of all the message
+			// UIDs in the remote folder. We also have a list of all UIDs for messages in
+			// the local folder. With these lists, we can establish which local messages
+			// have been orphaned and which have not using the following rules.
+
+			// * If the remote message is no longer there:
+			//		(1) Then the local message is orphaned (always).
+			// * If the remote message is still there and it is not one of the N most recent:
+			//		(2) If the local message has body parts do nothing.
+			//		(3) If the local message does not have body parts, then it is orphaned
+			//		    unless is is a message we have selected for download.
+			// * If the remote message is still there and it is one of the N most recent:
+			//		(4) Do nothing.
+
+			// Search through the local folder list while checking the remote folder list.
+			while (local<iFolderIndex.Size() && iFolderIndex[local].iMsvId!=-1)
+				{
+				orphanThis=EFalse;	// Default orphaning of this message to false.
+
+				// Find next uid in remote folder uid list that is >= local entry uid.
+				while (remote<iMailboxSize)
+					{
+					if (remote < iSearchList->Count() &&
+					    (*iSearchList)[remote]>=iFolderIndex[local].iUid)
+						break;
+					remote++;
+					}
+
+				// Within scope of search list?
+				if (remote<iMailboxSize)
+					{
+					TBool inSyncRange=(remote>=syncThresh);
+					TBool uidMatch=((*iSearchList)[remote]==iFolderIndex[local].iUid);
+					TBool uidNewer=((*iSearchList)[remote]>iFolderIndex[local].iUid);
+
+					// Folder position must point to 1st old local message that matches a
+					// remote message that will be sync'ed.
+					if (uidMatch && inSyncRange && !folderPositionFound)
+						{
+						iFolderPosition=local;
+						folderPositionFound=ETrue;
+						}
+
+					if (uidNewer)
+						{
+						// Here the next remote uid is greater than the local uid indicating that
+						// a message has been removed on the remote folder and that this local
+						// message should be orphaned. See case (1) above.
+						
+						DBG((LogText(_L8("Message no longer available on remote server, orphaning"))));
+						orphanThis=ETrue;
+						}
+					else if (uidMatch && !inSyncRange)
+						{
+						// Here the remote uid matches the local uid, but the message falls outside
+						// of the N most recent messages. See cases (2) & (3).
+
+						DBG((LogText(_L8("Local message old (%u)"),iFolderIndex[local].iUid)));
+
+						SetEntryL(iFolderIndex[local].iMsvId);
+						TMsvEmailEntry message(iEntry->Entry());
+						TBool inSyncSelection = EFalse;
+
+						// Is the message part of the synchronisation selection?
+						// If so, we will want to view the message after the sync so don't delete.
+						if (iSynchronisationSelection && iSynchronisationSelection->Count() > 1)
+							{
+							if (iSynchronisationSelection->Find(iFolderIndex[local].iMsvId) != KErrNotFound)
+								{
+								inSyncSelection = ETrue;
+								}
+							}
+
+						// Does message have any downloaded parts?
+						if (!message.Complete() && 
+							!message.BodyTextComplete() && 
+							!inSyncSelection)
+							{
+							// The local message does not have any body parts and
+							// is not selected for download, so it is orphaned.
+							// See case (3) above.
+
+							DBG((LogText(_L8("Local message (%u) is only header and not selected for download, deleting"),iFolderIndex[local].iUid)));
+							orphanThis=ETrue;
+							}
+						}
+					}
+				else
+					{
+					// Outside of scope of search list, so none of the remaining local
+					// messages are present in the remote folder and therefore are orphaned.
+					// See case (1) above.
+
+					DBG((LogText(_L8("Message no longer available on remote server, orphaning"))));
+					orphanThis=ETrue;
+					}
+
+				// Orphan this one?
+				if (orphanThis)
+					{
+					OrphanMessageL(iFolderIndex[local].iMsvId);
+					iFolderIndex.Expunge(local+1);
+					iOrphanedMessages++;
+					}
+				else
+					{
+					// If we have arrive here, then the local message is one of the N most 
+					// recent and still exists remotely OR it exists remotely, is not one of
+					// the N most recent and the local message had body parts.
+					// See cases (2) & (4) above.
+
+					local++;
+					}
+				} // End of the big while()
+
+			// Trim the list down to the most recent UIDs consistant with the sync limit.
+			if (syncThresh && iSearchList->Count() > syncThresh)
+				iSearchList->Delete(0,syncThresh);
+
+			// So now "iFolderIndex" will only have messages that are in the remote folder.
+			// And therefore, the highest UID stored in "iFolderIndex" will be the most 
+			// recent old message. Also, the lowest UID in "iSearchList" will be the oldest
+			// sync'able remote message.
+
+			// Are there any old messages left?
+			if (iFolderIndex.Size() && folderPositionFound)
+				{
+				DBG((LogText(_L8("Updating flags for %d old messages (UIDs %u to %u)"),
+						iFolderIndex.Size(),(*iSearchList)[0],iHighestUid)));
+
+				// Re-assign highest UID, the previous highest may no longer exist.
+				iHighestUid=iFolderIndex[iFolderIndex.Size()-1].iUid;
+				iSyncState=ESyncListNew;
+
+				// Fetch old messages.
+				NewTag();
+				// If a UID search string has been specified, the we should create the UID FETCH
+				// string from the UID integer list otherwise they'll all come down.
+				if(iServiceSettings->SearchString().Length() != 0)
+					{
+					CreateUidStringL(); // Construct the UID string from the UID list
+					TPtrC8 ptr(iUidString->Des());
+					_LIT8(KFetchString,"%d UID FETCH %S (UID FLAGS)\r\n");
+					iImapIO->SendL(iStatus,KFetchString,iTag,&ptr);
+					}
+				else
+					{
+					_LIT8(KFetchString,"%d UID FETCH %d:%d (UID FLAGS)\r\n");
+					iImapIO->SendL(iStatus,KFetchString,iTag,(*iSearchList)[0],iHighestUid);
+					}
+				NewTagSent();
+				return;
+				}
+			else
+				{
+				DBG((LogText(_L8("No old message headers to update"))));
+
+				iSyncState=ESyncListNew;
+				iHighestUid=0;
+				// All remote messages are new - fall through.
+				}
+			}
+
+		if (aResult==KErrNone && iSyncState==ESyncListNew)
+			{
+			// At this point, the remote command to fetch all old messages has completed. 
+			// Now we can look at fetching all new messages. 'iHighestUid' will contain the
+			// highest UID of the old messages. The top entry in 'iSearchList' will contain
+			// the highest UID in the remote folder. This gives us the range of UID to fetch
+			// for new messages.
+
+			// First check are there any new messages to fetch? If 'iHighestUid' is the highest
+			// UID locally and remotely, then we finished sync'ing when we completed the old
+			// sync.
+			if (iSearchList->Count() == 0)
+				{
+				DBG((LogText(_L8("Search List is empty"))));				
+				}
+			else if (iHighestUid<(*iSearchList)[iSearchList->Count()-1])
+				{
+				TUint32 uidLow=iHighestUid;
+				TUint32 uidHigh=(*iSearchList)[iSearchList->Count()-1];
+
+				// Only want new messages.
+				uidLow++;
+
+				// Are there only new messages (and no old)?
+				if (iHighestUid==0)
+					{
+					// Set this to ensure range is correct.
+					uidLow=(*iSearchList)[0];
+					}
+				
+				// Perform the new sync.
+				SynchroniseNewL(uidLow,uidHigh);
+				return;
+				}
+			else
+				{
+				DBG((LogText(_L8("No new message headers to sync"))));
+
+				// Synchronisation complete - fall through.
+				}
+			iSyncState=ESyncNew;
+			}
+
+		// Synchronising: moving on to the next state?
+		if (aResult==KErrNone && iSyncState==ESyncOld)
+			{
+			// At this point, the remote command to list old messages has
+			// completed: however, if there was a 'gap' at the end (ie messages at
+			// the end of our copy of the mailbox had been deleted) we won't have
+			// noticed it until this point as we woulnd't have got back in sync which
+			// happens when we get a UID which isn't sequential.
+			// So, as we now know there are no more messages in the range we know about
+			// locally, anything else must have been deleted remotely.
+			while(iFolderPosition<iFolderIndex.Size())
+				{
+				// Orphan this message
+				DBG((LogText(_L8("Orphaning UID %u"),iFolderIndex[iFolderPosition].iUid)));
+
+				// Do it
+				OrphanMessageL(iFolderIndex[iFolderPosition].iMsvId);
+
+				// Remove it from the index
+				iFolderIndex.Expunge(iFolderPosition+1);
+
+				// Increment stats
+				iOrphanedMessages++;
+				}
+
+			// Anything to new sync? If we've processed all the messages up to
+			// iMailboxSize, then there's nothing left that might possibly be
+			// new
+			if (iMsgsDone<iMailboxSize)
+				{
+				// Do new sync
+				SynchroniseNewL();
+				return;
+				}
+
+			iSyncState=ESyncNew;
+			}
+
+		if (aResult==KErrNone && iSyncState==ESyncNew)
+			{
+			// If there were any "missing" messages found during the sync that we should have
+			// mirrored previously, get these now.
+			if (iMissingUidLow!=0 && iMissingUidHigh!=0)
+				{
+				DBG((LogText(_L8("Missing messages detected %d - %d"),iMissingUidLow,iMissingUidHigh)));
+
+				SynchroniseNewL(iMissingUidLow,iMissingUidHigh);
+				iMissingUidLow=iMissingUidHigh=0;
+				return;
+				}
+			}
+
+		// If we got a NO response in the course of the sync, we've not fully sync'ed the folder,
+		// so we shouldn't update the last sync date, etc. BUT as NO isn't a fatal response, we should
+		// not disconnect.
+		if (aResult!=KErrIMAPNO)
+			{
+			// Are we configured to update the \seen flag on the server?
+			if (iServiceSettings->UpdatingSeenFlags())
+				{
+				DBG((LogText(_L8("Sync completed: updating servers flags"))));
+
+				// Now drop through to EImapStateSetSeenWait case
+				iState = EImapStateSetSeenWait;
+				iSyncState=ENotSyncing;
+				}
+			else
+				{
+				// Not updating servers \seen flags - use old code to continue after sync
+				// Back to selected state
+				iState=EImapStateSelected;
+				iSyncState=ENotSyncing;
+
+				// We've synchronised the folder. Update iDate field to
+				// indicate last sync date of this folder.
+				// This also updates the 'folders done' count
+				SyncCompleteL();
+                                DBG((LogText(_L8("CImap4Session::CommandComplete(): iState=EImapStateSynchroniseWait"))));
+				DBG((LogText(_L8("-----------------------------------------------------------"))));
+				DBG((LogText(_L8("CImap4Session::CommandComplete(): calling Complete()"))));
+				DBG((LogText(_L8("-----------------------------------------------------------"))));
+				Complete(aResult);		
+				return;
+				}
+			}
+		else
+			{
+			// NO isn't a fatal response.Ignore it,continue...
+			iState=EImapStateSelected;
+			iSyncState=ENotSyncing;
+            DBG((LogText(_L8("CImap4Session::CommandComplete(): iState=EImapStateSynchroniseWait, aResult == KErrIMAPNO"))));
+			DBG((LogText(_L8("-----------------------------------------------------------"))));
+			DBG((LogText(_L8("CImap4Session::CommandComplete(): calling Complete()"))));
+			DBG((LogText(_L8("-----------------------------------------------------------"))));
+			Complete(aResult);
+			return;
+			}
+		}
+
+	case EImapStateSetSeenWait:    // Only a valid state when iServiceSettings->UpdatingSeenFlags() is true
+		// We may not be able to set all the seen flags due to a large list, 
+		//  so call ProcessSeenFlagsL until False is returned
+		if (ProcessSeenFlagsL(ESetSeenFlag))
+			{
+			// More have been processed - wait for response in same state.
+			return;
+			}
+		// Now drop through to EImapStateClearSeenWait state
+		iState=EImapStateClearSeenWait;
+		iSyncState=ENotSyncing;
+
+	case EImapStateClearSeenWait:  // Only a valid state when iServiceSettings->UpdatingSeenFlags() is true
+		// We may not be able to clear all the seen flags due to a large list, 
+		//  so call ProcessSeenFlagsL until False is returned
+		if (ProcessSeenFlagsL(EClearSeenFlag))
+			{
+			// More have been processed - wait for response in same state.
+			return;
+			}
+
+		// All seen flags processed - return to selected state
+		// Will only arrive here if iServiceSettings->UpdatingSeenFlags() is true
+		iState=EImapStateSelected;
+		iSyncState=ENotSyncing;
+
+		// We've synchronised the folder. Update iDate field to
+		// indicate last sync date of this folder.
+		// This also updates the 'folders done' count
+		SyncCompleteL();
+		DBG((LogText(_L8("CImap4Session::CommandComplete(): iState=EImapStateClearSeenWait"))));
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+		DBG((LogText(_L8("CImap4Session::CommandComplete(): calling Complete()"))));
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+		Complete(aResult);
+		return;
+
+	case EImapStateLogoutWait:
+		DoDisconnect();
+		break;
+
+	case EImapStateDeleteMarkWait:
+		// Messages marked for deletion OK, send close command
+		SendMessageL(KIMAPC_CLOSE);
+		iState=EImapStateExpungeWait;
+		return;
+
+	case EImapStateExpungeWait:
+		{
+		DBG((LogText(_L8("Close completed OK: expunging messages locally"))));
+
+		// Expunge the messages locally, the close was successful
+		for(TInt a=0;a<iFolderIndex.Size();a++)
+			{
+			// If it's got a valid MsvId, delete it!
+			if (iFolderIndex[a].iMsvId)
+				{
+				DBG((LogText(_L8("Expunging message %x"),iFolderIndex[a].iMsvId)));
+
+				DeleteMessageL(iFolderIndex[a].iMsvId);
+				}
+			}
+
+		// Back to unselected state (close sucessful)
+		iState=EImapStateNoSelect;
+		break;
+		}
+
+	case EImapStateIdleWait:
+		{
+		DBG((LogText(_L8("CImImap4Session::CommandCompleteL(): iState = EImapStateIdleWait"))));
+ 		if (iCompoundStopIdle) 
+			{
+			// the reply from server is missed if
+			// compound command
+			GetReply(EFalse);
+			}
+		break;		
+		}
+
+	case EImapStateIdling:
+		{
+		DBG((LogText(_L8("CImImap4Session::CommandCompleteL(): iState = EImapStateIdling"))));
+ 		if (iReissueIdle)
+			{
+			// IDLE command has been re-issued after synchronise OR a re-issue
+			// after a cancel-and-idle (if idling before).
+			// NOTE - also unset cancel-and-idle flag here too.
+			iReissueIdle = EFalse;
+			iCancelAndIdle	= EFalse;
+			IssueIdleRead();
+			}
+		break;		
+		}
+
+	case EImapStateStopIdleWait:
+		{
+		DBG((LogText(_L8("Idling completed OK"))));
+		
+		iState=EImapStateSelected;
+
+		if (FolderChanged())
+			{
+			DBG((LogText(_L8("CImImap4Session::CommandCompleteL(): FolderChanged"))));
+
+			// If the folder has changed then we are going to do a synchronise to
+			// ensure we have up to date message information. At the end of the
+			// synchronise we would normally reissue the idle command, however
+			// we don't want to do this if we are stopping idle due to a
+			// compound command or a sync command. The compound / sync active
+			// objects will reissue the idle themselves.
+			if(!iCompoundStopIdle && !iStoppingIdleForSync)
+				{
+				DBG((LogText(_L8("CImImap4Session::CommandComplete(): ReissueIdle = true"))));
+				iReissueIdle=ETrue;
+				}
+			DoSynchroniseL(EFalse);
+			return;
+			}
+		else if (iReissueIdle)
+			{
+			if( !iCancelAndIdle && !iIdleTimerExpired )
+				{
+				// Don't unset the iReissueIdle flag - need it to be true to ensure
+				// that IssueIdleRead is issued once 'Done' is received.
+				// FYI - IssueIdleRead is normally called in the DoComplete method 
+				// when the StartIdle request completes. If we've cancel-and-idle-ed,
+				// then DoComplete won't be called when we do actually go idle.
+				DBG((LogText(_L8("CImImap4Session::CommandComplete(): ReissueIdle = false"))));
+				iReissueIdle = EFalse;
+				}
+			iIdleTimerExpired = EFalse;
+			DoStartIdleL();
+			return;
+			}
+		else if (iDisconnectAfterIdleStopped)
+			{
+			iDisconnectAfterIdleStopped=EFalse; 
+			DoDisconnectL();
+			return;
+			}
+
+		break;		
+		}
+		
+	default:
+		gPanic(ECommandCompleteInUnknownState);
+		return;
+		}
+
+	// Completing an operation upwards: ensure iEntry is not pointing to anything
+	SetEntryL(NULL);
+        
+        DBG((LogText(_L8("CImap4Session::CommandComplete(): End of method"))));
+	DBG((LogText(_L8("-----------------------------------------------------------"))));
+	DBG((LogText(_L8("CImap4Session::CommandComplete(): calling Complete()"))));
+	DBG((LogText(_L8("-----------------------------------------------------------"))));
+	
+	Complete(KErrNone);
+	}
+	
+	
+/* 
+Overrides CMsgActive::RunL() to allow check for errored completion of
+autonomously initiated IO requests, specifically the reissue of IDLE
+commands on idle timeout.
+*/
+void CImImap4Session::RunL()
+	{
+	TInt status=iStatus.Int();
+	if (status < KErrNone &&
+		iIdleTimerExpired && 
+		(iState==EImapStateIdleWait || iState==EImapStateStopIdleWait))
+		{
+		DoComplete(status);
+		}
+	else
+		{
+		// Behave exactly as CMsgActive::RunL
+		if (status>=KErrNone)
+			{
+			TRAPD(error,DoRunL());      // continue operations, may re-queue
+			__ASSERT_DEBUG(error==KErrNone || !IsActive(),User::Invariant());   // must not requeue in error situations
+			if (IsActive())             // requeud
+				return;
+			status=error;
+			}
+		Complete(status);
+		}
+	}
+
+	
+
+// A child async process has completed
+void CImImap4Session::DoRunL()
+	{
+	DBG((LogText(_L8("CImImap4Session::DoRunL(status=%d, state=%d)"),iStatus.Int(),iState)));
+
+	// Did we have a send queued? If so, this is just the send completion: we
+	// now queue a receive and clear the send flag
+	if (iSendQueued)
+		{
+                DBG((LogText(_L8("CImImap4Session::DoRunL(): iSendQueued"))));
+
+		// No send queued anymore...
+		iSendQueued=EFalse;
+		// Any problems sending?
+		if(iStatus.Int()!=KErrNone)
+			{
+			// Yes, humm...
+			DBG((LogText(_L8("Error during send %d"),iStatus.Int())));
+
+			// We have to Fail() here, as the connection might be screwed:
+			// we just don't know. Fail() will disconnect us and reset our
+			// internal state.
+			Fail(KErrImapSendFail);
+			}
+		else
+			{
+			// Have we just issued a partial fetch, ie waiting for body
+			// size?
+			if (iSizeWait)
+				{
+				// Queue partial line fetch
+				GetReply(ETrue);
+				}
+			else
+				{
+				// Queue full line read
+				GetReply(EFalse);
+				}
+			}	
+		return;
+		}
+
+	// Was a receive queued? If so, we need to get the new root pointer
+	if (iReceiveQueued)
+		{
+                DBG((LogText(_L8("CImImap4Session::DoRunL(): iReceiveQueued"))));
+ 		// Not anymore
+		iReceiveQueued=EFalse;
+
+		// Get root
+		iRootAtom=iImapIO->RootAtom();
+                 
+                DBG((LogText(_L8("CImImap4Session::DoRunL(): Got root"))));
+
+		// Did we get the whole line?
+		if (iStatus.Int()==KErrFoundEOL)
+			{
+                        DBG((LogText(_L8("CImImap4Session::DoRunL(): got the whole line"))));
+			iGotWholeLine=ETrue;
+			iStatus=KErrNone;
+			}
+		else
+                        {
+			DBG((LogText(_L8("CImImap4Session::DoRunL(): didn't got the whole line"))));			
+			iGotWholeLine=EFalse;
+                        }
+		}
+
+	// Problems with connection?
+	if (iStatus.Int()!=KErrNone)
+		{
+		DBG((LogText(_L8("CImImap4Session::DoRunL(): Problems with connection"))));
+                if (iState==EImapStateConnectWait)
+			Fail(KErrImapConnectFail);
+		else
+			Fail(KErrImapServerFail);
+
+		return;
+		}
+        
+        DBG((LogText(_L8("CImImap4Session::DoRunL(): checking iState"))));
+
+	switch(iState)
+		{
+	// Waiting for connect response
+	case EImapStateConnectWait:
+		{
+		// Get the bearer idle timeout
+		TUint32 timeout;
+		User::LeaveIfError(iImapIO->GetLastSocketActivityTimeout(timeout));
+
+		// Sets timeout to iMtmData1. This is used by Imcm.
+		SetEntryL(iServiceId);
+		TMsvEntry entry = iEntry->Entry();
+		entry.SetMtmData1(timeout);
+		iEntry->ChangeEntry(entry);
+		DBG((LogText(_L8("IdleTimeout %d"),timeout)));
+
+		// Connected, queue receive for greeting line
+		iState=EImapStateGreetingWait;
+		GetReply(ETrue);
+		break;
+		}
+
+	// Waiting for greeting line
+	case EImapStateGreetingWait:
+		{
+		TInt result=KErrNone; // To stop .AER warnings...
+
+		// Process line
+		TRAPD(err,result=ProcessGreetingL());
+		if (err!=KErrNone)
+			Fail(KErrImapServerFail);
+		else if (result!=KErrNone)
+			{
+			// Greeting process returned an error
+			DBG((LogText(_L8("CImap4Session::CommandComplete(): iState=EImapStateGreetingWait"))));
+			DBG((LogText(_L8("-----------------------------------------------------------"))));
+			DBG((LogText(_L8("CImap4Session::CommandComplete(): calling Complete()"))));
+			DBG((LogText(_L8("-----------------------------------------------------------"))));
+
+                        Complete(result);
+			}
+		else
+			{
+			SendCapabilityL();
+			}
+		break;
+		}
+
+	// Waiting for continuation response to send username
+	case EImapStateLoginSendUser:
+		{
+		// Looking for a '+'
+		CImapAtom *p=iRootAtom->ToChildL();
+
+		// '*' indicates an untagged message
+		if (p->Compare(KIMAP_UNTAGGED))
+			{
+			// Process it
+			TRAPD(err,ProcessUntaggedL(p->ToNextL(),EFalse));
+
+			// A problem here is a server fail, nothing else
+			if (err!=KErrNone)
+				Fail(KErrImapServerFail);
+			}
+		else if (p->Compare(KIMAP_CONTINUATION))
+			{
+			// Send username literal
+
+			// Literal password?
+			if (iLiteralPassword)
+				{
+				// Turn off logging before sending
+				iImapIO->PerformLogging(EFalse);
+				iImapIO->SendL(iStatus,_L8("%S {%d}\r\n"),iUsername,iPassword->Length());
+				iImapIO->PerformLogging(ETrue);
+	
+				iState=EImapStateLoginSendPassword;
+				}
+			else
+				{
+				// Turn off logging before sending
+				iImapIO->PerformLogging(EFalse);
+				iImapIO->SendL(iStatus,_L8("%S %S\r\n"),iUsername,iPassword);
+				iImapIO->PerformLogging(ETrue);
+				
+				iState=EImapStateLoginWait;
+				}
+
+			iSendQueued=ETrue;
+                        DBG((LogText(_L8("*******************************************************"))));
+			DBG((LogText(_L8("CImap4Session::DoRunL(): waiting for iImapIO to wake me"))));
+			DBG((LogText(_L8("*******************************************************"))));
+
+			SetActive();
+			}
+		break;
+		}
+
+	// Waiting for continuation response to send password
+	case EImapStateLoginSendPassword:
+		{
+		// Looking for a '+'
+		CImapAtom *p=iRootAtom->ToChildL();
+
+		// '*' indicates an untagged message
+		if (p->Compare(KIMAP_UNTAGGED))
+			{
+			// Process it
+			TRAPD(err,ProcessUntaggedL(p->ToNextL(),EFalse));
+
+			// A problem here is a server fail, nothing else
+			if (err!=KErrNone)
+				Fail(KErrImapServerFail);
+			}
+		else if (p->Compare(KIMAP_CONTINUATION))
+			{
+			// Send password literal
+			iSendQueued=ETrue;
+                        DBG((LogText(_L8("*******************************************************"))));
+			DBG((LogText(_L8("CImap4Session::DoRunL(): waiting for iImapIO to wake me"))));
+			DBG((LogText(_L8("*******************************************************"))));
+
+			SetActive();
+			// Turn off logging before sending
+			iImapIO->PerformLogging(EFalse);
+			iImapIO->SendL(iStatus,_L8("%S\r\n"),iPassword);
+			iImapIO->PerformLogging(ETrue);
+			
+			iState=EImapStateLoginWait;
+			}
+		break;
+		}
+
+	case EImapStateSetSeenWait:		// Wait for setting the send flags response
+	case EImapStateClearSeenWait:   // Wait for clearing the send flags response
+	case EImapStateCapabilityWait:	// Wait for reply to capability command
+	case EImapStateLoginWait:		// Wait for reply to login command
+	case EImapStateCommandWait:		// Generic OK/BAD command issued, wait for response
+	case EImapStateCreateWait:		// Create command issued, wait for response
+	case EImapStateRenameWait:		// Rename command issued, wait for response
+	case EImapStateDeleteWait:		// Delete command issued, wait for response
+	case EImapStateDeleteAllWait:	// DeleteAll command issued, wait for response
+	case EImapStateDeleteFolderWait:// DeleteAll has issued a folder delete, wait for response
+	case EImapStateSeparatorWait:	// Wait for reply to null list command
+	case EImapStateSubscribeWait:	// Wait for subscription command reply
+	case EImapStateSelectWait:		// Wait for all select information
+	case EImapStateSynchroniseWait:	// Wait for synchronise
+	case EImapStateListWait:		// Wait for all list information
+	case EImapStateLsubWait:		// Wait for all lsub information
+	case EImapStateAppendResultWait:// Wait for append result
+	case EImapStateDeleteMarkWait:	// Marking messages for deletion before CLOSE
+	case EImapStateExpungeWait:		// Messages expunged: remove them locally
+	case EImapStateExpungeAllWait:	// Messages expunged from remote, remove them
+	case EImapStateCloseWait:		// Wait for close to finish
+	case EImapStateLogoutWait:		// Wait for logout
+	case EImapStateStartTLSWait:	// Wait for starttls to return
+	case EImapStateIdleWait:
+	case EImapStateIdling:
+	case EImapStateStopIdleWait:
+		{
+		TInt result=KErrNone; // To stop .AER warnings...
+
+		// Process it
+		TRAPD(err,result=ProcessCommandReplyL());
+		if (err!=KErrNone)
+			{
+			// check for TLS errors
+			if (iState == EImapStateCapabilityWait && iSecurityState == ENegotiating)
+				err = KErrImapTLSNegotiateFailed;
+			
+			// We've had a fail during reply processing: pass it on
+			Fail(err);
+			}
+		else
+			{
+			switch(result)
+				{
+			case KErrNotReady:
+				{
+				if (IsIdling() && FolderChanged())
+					{
+                    DBG((LogText(_L8("CImImap4Session::DoRunL(): Calling DoStopIdleL"))));
+					DoStopIdleL();
+					}
+				else if (IsIdling())
+					{
+					IssueIdleRead();
+					return;
+					}
+				else
+					{
+					// Need the next line/part of line
+					GetReply(EFalse);
+					}
+				break;
+				}
+
+			default:
+				// Complete it if there's no error or if it's just a 'NO'
+				// reply (ie, KErrNotSupported)
+				if (result>=KErrNone || result==KErrNotSupported)
+					{
+					DBG((LogText(_L8("CImImap4Session::DoRunL(): No error - calling CommandComplete()"))));
+					CommandCompleteL(result);
+					}
+				else
+					Fail(result);
+				break;
+				}
+			}
+		break;
+		}
+
+	case EImapStateAppendSizeWait:	// Work out the size of the append
+		{
+		// Sizing operation completed, get the size
+		iCommandSize=iMessageSizer->MessageSize();
+		delete iMessageSizer;
+		iMessageSizer=NULL;
+
+		DBG((LogText(_L8("Sized message to %d bytes"),iCommandSize)));
+
+		iProgress.iBytesToDo=iCommandSize;
+		iProgress.iBytesDone=0;
+		
+		// Make a sender, to actually send the text
+		delete iMessageSender;
+		iMessageSender=NULL;
+		iMessageSender=CImSendMessage::NewL(/*iFs,*/*iEntry);
+
+		// Change in API, should be retrieving iSettings.SendCopyToSelf(), 
+		// instead using default ESendNoCopy.
+		iMessageSender->InitialiseL(iCommandIds[0], ESendAsMimeEmail, 
+									iMessageDate, iHost, iCharset, ESendNoCopy);
+
+		// Make path to the message's destination, and send command
+		HBufC8* path=MakePathL(iCommandIds[1],ETrue);
+
+		// Reset the entry to first param(message id), as it will be changed to 
+		// second param(directory id) in the MakePathL function. This entry 
+		// will be sent to destination as message(line by line) by CImSendMessage class.
+		SetEntryL(iCommandIds[0]);
+		
+		CleanupStack::PushL(path);
+		DoQuoteL(path);
+		TPtrC8 pathptr=path->Des();
+		NewTag();
+		iImapIO->SendL(iStatus,_L8("%d APPEND \"%S\" {%d}\r\n"),iTag,&pathptr,iCommandSize);
+		NewTagSent();
+		CleanupStack::PopAndDestroy();
+
+		// Append the actual message
+		iState=EImapStateAppendPromptWait;
+		break;
+		}
+
+	case EImapStateAppendPromptWait: // Wait for prompt before sending message body
+		{
+		// Looking for a '+'
+		CImapAtom *p=iRootAtom->ToChildL();
+
+		// '*' indicates an untagged message
+		if (p->Compare(KIMAP_UNTAGGED))
+			{
+			// Process it
+			TRAPD(err,ProcessUntaggedL(p->ToNextL(),EFalse));
+			if (err!=KErrNone)
+				Fail(err);
+			}
+		else if (p->Compare(KIMAP_CONTINUATION))
+			{
+			// Start sending message body: move into sending body state
+			iState=EImapStateAppendWait;
+
+			// Make line buffer
+			delete iLineBuffer;
+			iLineBuffer=NULL;
+			iLineBuffer=HBufC8::NewL(KImMailMaxBufferSize);
+
+			// Send first line: Must be more than one line, so we don't bother
+			// with checking the return code.
+			TInt padcount=0;
+			TPtr8 line=iLineBuffer->Des();
+			iMessageSender->NextLineL(line,padcount);
+			iImapIO->SendL(iStatus,_L8("%S"),&line);
+
+			DBG((LogText(_L8("CImap4Session::DoRunL(): iState = EImapStateAppendWait"))));
+			DBG((LogText(_L8("*******************************************************"))));
+			DBG((LogText(_L8("CImap4Session::DoRunL(): waiting for iImapIO to wake me"))));
+			DBG((LogText(_L8("*******************************************************"))));
+
+                        SetActive();
+			iSendQueued=EFalse; // We want to come back to here - we've not sent a command
+			iProgress.iBytesDone+=line.Length();
+
+			DBG((LogText(_L8("Sent: %d '%S'"),line.Length(),&line)));
+			}
+		break;
+		}
+
+	case EImapStateAppendWait:
+		{
+		// Send line of message
+		TInt padcount=0;
+		TPtr8 line=iLineBuffer->Des();
+		if (iMessageSender->NextLineL(line,padcount)==KImCvFinished)
+			{
+			// Send last line, plus CRLF to terminate command
+			iImapIO->SendL(iStatus,_L8("%S\r\n"),&line);
+			iProgress.iBytesDone+=line.Length();
+
+			DBG((LogText(_L8("Sent: %d '%S'"),line.Length(),&line)));
+			DBG((LogText(_L8("Total bytes sent %d plus the CRLF"),iProgress.iBytesDone)));
+
+			delete iLineBuffer;
+			iLineBuffer=NULL;
+			delete iMessageSender;
+			iMessageSender=NULL;
+			iSendQueued=ETrue;
+			iState=EImapStateAppendResultWait;
+			}
+		else
+			{
+			// Send a line
+			iImapIO->SendL(iStatus,_L8("%S"),&line);
+			iSendQueued=EFalse;
+			iProgress.iBytesDone+=line.Length();
+
+			DBG((LogText(_L8("Sent: %d '%S'"),line.Length(),&line)));
+			}
+
+                DBG((LogText(_L8("CImap4Session::DoRunL(): iState = EImapStateAppendWait"))));
+		DBG((LogText(_L8("*******************************************************"))));
+		DBG((LogText(_L8("CImap4Session::DoRunL(): waiting for iImapIO to wake me"))));
+		DBG((LogText(_L8("*******************************************************"))));
+
+		SetActive();
+		break;
+		}
+
+	case EImapStateFetchCancelWait:
+	case EImapStateFetchWait:// Wait for body length/data
+		{
+		TInt result=KErrNone; // To stop .AER warnings...
+
+		// Process it
+		TRAPD(err,result=ProcessCommandReplyL());
+	
+		if (err!=KErrNone)
+			Fail(err);
+		else
+			{
+			//LogText(_L8("ProcessCommandReplyL() returned %d\n"),result);
+			switch(result)
+				{
+			case KErrNotReady:
+				// Still waiting for body size, another partial fetch
+				if (iSizeWait)
+					GetReply(ETrue);
+				else
+					GetReply(EFalse);
+				break;
+			case KErrImapInvalidServerResponse:
+				// Nothing to do , return back
+				break;
+
+			case KErrWrite:
+				// Process has issued a command of its own, nothing for us to
+				// do here
+				break;
+
+			default:
+				// Complete it
+				if (!iCommandsOutstanding)
+					{
+					DBG((LogText(_L8("CImap4Session::DoRunL(): No commands outstanding- calling CommandComplete()"))));
+ 					CommandCompleteL(result);
+					}
+				else
+					{
+					if (iJustSentFetch)
+ 						{
+						DBG((LogText(_L8("CImap4Session::DoRunL(): Just sent fetch"))));
+   						iJustSentFetch = EFalse;
+  						}
+  					else
+  						{
+  						// Get next fetch result
+						DBG((LogText(_L8("CImap4Session::DoRunL(): NOT just sent fetch"))));
+   						iSizeWait=ETrue;
+  						GetReply(ETrue);
+  						}
+					}
+				break;
+				}
+			}
+		break;
+		}
+
+	case EImapStateMoveEntryWait:
+		{
+		// We're done with the moveentry
+
+		// Park the move entry again
+		iMoveEntry->SetEntry(NULL);
+
+		// Copy the structure: the MsvId is still the same, it's just not in the same
+		// place.
+
+		//DS - Selectively using a copy or a move depending on user intention, so no need for this
+		//"copy structure back to mirror" malarky.
+		//		TMsvId newid=CopyLevelL(iMoveSource,iMoveSourceFolder);
+	
+		// Note this ID in the iRelatedId, so that higher levels know where we are again...
+
+		//DS iMoveSource could be either the same message moved to a different place
+		//or still the original message - could employ some logic for differentiating if there
+		//is some need to twiddle flags etc, but I'll leave that for someone else to do...
+		SetEntryL(iMoveSource);
+		TMsvEntry entry=iEntry->Entry();
+
+		entry=iEntry->Entry();
+		entry.SetNew(EFalse);
+		ChangeEntryL(entry);
+
+		// Park iEntry
+		SetEntryL(NULL);
+
+		// Inform caller of new ID
+		//DS as far as I can tell, this isn't used!
+		//*iNewSource=newid;
+
+		// Back to previous state
+		iState=iSavedState;
+		break;
+		}
+
+	default:
+		gPanic(ERunLInUnknownState);
+		return;
+		}
+        DBG((LogText(_L8("CImImap4Session::DoRunL(): exiting..."))));
+	}
+
+
+// The IMAP Idle case for doing a "GetReply". 
+// Called by CImImap4SessionIdleRead::Start() to get the whole thing going.
+void CImImap4Session::DoIdleRead(TRequestStatus& aIdleReadStatus)
+	{
+	// Unlike a normal read, give the reponse to the CImImap4SessionIdleRead when done
+	iImapIO->GetReply(aIdleReadStatus);
+	iReceiveQueued=ETrue;
+	}
+
+void CImImap4Session::CancelIdleRead()
+	{
+	// Undo what DoIdleRead() did
+	iImapIO->Cancel();
+	iReceiveQueued=EFalse;
+	}
+
+// The standard case for a normal transaction "GetReply"
+// Queue request from IO layer to get the next atom
+void CImImap4Session::GetReply(const TBool aPartialReturn)
+	{
+	// Cancel any dummy operation
+	if (ImapIdleSupported()==EFalse)
+		{
+		CancelDummy();
+		}
+
+	// Queue the receive
+	if (aPartialReturn)
+		{
+		// Get a partial line, as we need to see how much data is on its way
+		// for flood control/issuing next fetch command to keep it streaming.
+		iImapIO->GetReply(iStatus,80,ETrue);
+		}
+	else
+		{
+		// Get a *whole* line, we don't want a partial return
+		iImapIO->GetReply(iStatus);
+		}
+
+	// Note that we have ???
+	iReceiveQueued=ETrue;
+        DBG((LogText(_L8("*******************************************************"))));
+	DBG((LogText(_L8("CImap4Session::GetReply(): waiting for iImapIO to wake me"))));
+	DBG((LogText(_L8("*******************************************************"))));
+
+	SetActive();
+	}
+
+// Make a new tag, and queue send
+void CImImap4Session::NewTag()
+	{
+	if (ImapIdleSupported()==EFalse)
+		{
+		// Cancel any dummy operation that might be outstanding
+		CancelDummy();
+		}
+
+	// Make a new tag
+	iTag++;
+
+	// One more outstanding command
+	iCommandsOutstanding++;
+	}
+
+void CImImap4Session::NewTagSent()
+	{
+	// Go active and note that a send has been queued
+	SetActive();
+	iSendQueued=ETrue;
+	}
+
+// Queue sending of a command line
+void CImImap4Session::SendMessageL(const TDesC8& aMessage)
+	{
+	__ASSERT_DEBUG(iSendQueued==EFalse,gPanic(EAlreadySending));
+	if(!(iSendQueued==EFalse))
+		{	
+		User::LeaveIfError(KErrInUse);//Already Sending
+		}
+	// Make a new tag
+	NewTag();
+	iImapIO->SendL(iStatus,_L8("%d %S\r\n"),iTag,&aMessage);
+	NewTagSent();
+	}
+
+void CImImap4Session::SendUntaggedMessageL(const TDesC8 &aMessage)
+	{
+	__ASSERT_DEBUG(iSendQueued==EFalse,gPanic(EAlreadySending));
+	if(!(iSendQueued==EFalse))
+		{
+		User::LeaveIfError(KErrInUse); // Already Sending
+		}
+	if (ImapIdleSupported()==EFalse)
+		{
+		// Cancel any dummy operation that might be outstanding
+		CancelDummy();
+		}
+
+	iImapIO->SendL(iStatus,KImapCommand,&aMessage);
+	DBG((LogText(_L8("*******************************************************"))));
+	DBG((LogText(_L8("CImap4Session::SendUntaggedMessageL(): waiting for iImapIO to wake me"))));
+	DBG((LogText(_L8("*******************************************************"))));
+
+	SetActive();
+	iSendQueued=ETrue;
+	}
+
+/**
+Allows a untagged message to be sent to the server with a short idle timeout applied.
+This is used when a fast response is expected
+*/
+void CImImap4Session::SendUntaggedMessageWithTimeoutL(const TDesC8 &aMessage, TInt aTimeout)
+	{
+	__ASSERT_ALWAYS(iSendQueued==EFalse,gPanic(EAlreadySending));
+	if(!(iSendQueued==EFalse))
+		{
+		User::LeaveIfError(KErrInUse); // Already Sending
+		}
+	if (ImapIdleSupported()==EFalse)
+		{
+		// Cancel any dummy operation that might be outstanding
+		CancelDummy();
+		}
+
+	iImapIO->SendWithTimeoutL(iStatus, aTimeout, KImapCommand, &aMessage);
+	DBG((LogText(_L8("*******************************************************"))));
+	DBG((LogText(_L8("CImap4Session::SendUntaggedMessageWithTimeoutL(): waiting for iImapIO to wake me"))));
+	DBG((LogText(_L8("*******************************************************"))));
+
+	SetActive();
+	iSendQueued=ETrue;
+	}
+
+// Construct a full mailbox path, given a TMsvId
+// This is expensive in memory movement terms, as it works UP the path,
+// inserting new data at the start. This is based on the principle that it's
+// more expensive to find an entry in the index with SetEntryL() than it is to
+// move some bytes about, otherwise we'd find the path upwards then create the
+// string downwards.
+HBufC8* CImImap4Session::MakePathL(const TMsvId aTarget, const TBool aIncludeLeaf)
+	{
+	__ASSERT_DEBUG(iState>=EImapStateNoSelect,gPanic(ENotLoggedOn));
+	if(!(iState>=EImapStateNoSelect))
+		{
+		User::LeaveIfError(KErrGeneral);
+		}
+	// Making a path: we start with nothing
+	HBufC8 *path=HBufC8::NewLC(256);
+	TBool skipfirst=ETrue;
+	TMsvId traverse=aTarget;
+
+	// Move to the entry
+	SetEntryL(traverse);
+
+	// Skipping the leaf?
+	if (!aIncludeLeaf && iEntry->Entry().iType!=KUidMsvServiceEntry)
+		{
+		// Up a level before we generate the path
+		SetEntryL(traverse=iEntry->Entry().Parent());
+		}
+
+	// check and see if we are dealing with the INBOX, in which case
+	// return immediately
+	if (iEntry->Entry().Parent()==iServiceId &&
+		iEntry->Entry().iDetails.CompareF(KIMAP_INBOX)==0)
+		{
+		path->Des().Insert(0,_L8("INBOX"));
+		CleanupStack::Pop();
+		return path;
+		}
+
+	iCharConv->PrepareToConvertToFromOurCharsetL(KCharacterSetIdentifierImapUtf7);
+	
+	// While we can still go up within this service...
+	while(iEntry->Entry().iType!=KUidMsvServiceEntry)
+		{
+		// Add the name of this component to the path
+   		if (!skipfirst)
+			path->Des().Insert(0,iHierarchySeparator);
+		else
+			skipfirst=EFalse;
+
+		// this should be a better sized allocation but the path is
+		// fixed to 256 anyway so this will do
+		HBufC8* utf7=HBufC8::NewL(256);
+		CleanupStack::PushL(utf7);
+
+		TInt numUC, indexUC;
+		TPtr8 des = utf7->Des();
+		iCharConv->ConvertFromOurCharsetL(iEntry->Entry().iDetails, des, numUC, indexUC);
+		path->Des().Insert(0,utf7->Des());
+
+		CleanupStack::PopAndDestroy();
+
+		// Go up a level
+		SetEntryL(traverse=iEntry->Entry().Parent());
+		}
+	
+	// Add the path at the very start, if it exists
+	if (iFolderPath.Length())
+		{
+		// Anything there already? If not, don't bother with the separator
+		if (path->Des().Length()) path->Des().Insert(0,iHierarchySeparator);
+		path->Des().Insert(0,iFolderPath);
+		}
+
+	// Pop it off cleanup stack
+	CleanupStack::Pop();
+
+	// Return the path
+	return(path);
+	}
+
+// Queue a connection
+void CImImap4Session::ConnectL(TRequestStatus& aRequestStatus, const TMsvId aService)
+	{
+	LOG_COMMANDS((LogText(_L8("COMMAND Connect(%x)"),aService)));
+	__ASSERT_DEBUG(iState==EImapStateDisconnected,gPanic(EOpenWhenNotClosed));
+	if(!(iState==EImapStateDisconnected))
+		{
+		User::LeaveIfError(KErrInUse); // Open when not closed.
+		}
+	// Any progress we give now should be related to this connect, so we need to 
+	// clear any previous progress first.
+	ResetStats();
+
+	Queue(aRequestStatus);
+
+	// Get host details from server
+	iServiceId=aService;
+	SetEntryL(iServiceId);
+
+  	// get the iap preferences
+  	CEmailAccounts* account = CEmailAccounts::NewLC();
+  	if (iPrefs == NULL)
+  		{
+  		iPrefs = CImIAPPreferences::NewLC();
+  		CleanupStack::Pop(iPrefs);
+  		}	
+
+	TImapAccount id;
+	id.iImapAccountId = iEntry->Entry().MtmData2();  // iMtmData2 of the service entry contains TImapAccountId
+	id.iImapAccountName = iEntry->Entry().iDetails;
+	id.iImapService = iEntry->Entry().iServiceId;
+	id.iSmtpService = iEntry->Entry().iRelatedId;
+
+  	account->LoadImapSettingsL(id, *iServiceSettings);
+    account->LoadImapIapSettingsL(id, *iPrefs);	
+  	CleanupStack::PopAndDestroy(account);
+
+	// Copy details
+	delete iUsername;	//need to delete iUsername first, just in case already it has a value.
+	iUsername = NULL;
+	iUsername=iServiceSettings->LoginName().AllocL();
+	delete iPassword;	//need to delete iPassword first, just in case already it has a value.
+	iPassword = NULL;
+	iPassword=iServiceSettings->Password().AllocL();
+	iFolderPath=iServiceSettings->FolderPath();
+	iHost=iServiceSettings->ServerAddress();
+	iPort=iServiceSettings->Port();
+	iUseIdleCommand = iServiceSettings->ImapIdle();
+
+	iIdleTimeout = iServiceSettings->ImapIdleTimeout();	
+	DBG((LogText(_L8("ImapIdleTimeout %d"),iIdleTimeout)));
+	// convert from seconds to microseconds
+	iIdleTimeout *= 1000000;
+
+	// Path separator: we store it as a string locally
+	iHierarchySeparator.Zero();
+	if (iServiceSettings->PathSeparator())
+		{
+		// Append to string
+		iHierarchySeparator.Append(iServiceSettings->PathSeparator());
+		}
+
+	// Any characters that will need quoting in them?
+	iLiteralUsername=EFalse;
+	int a;
+	TPtr8 userName = iUsername->Des();
+	for(a=0;a<iUsername->Length();a++)
+		{
+		if (userName[a]<=32  || userName[a]>=127 || userName[a]=='\"' || userName[a]=='%'  ||
+		    userName[a]=='(' || userName[a]==')' || userName[a]=='*'  || userName[a]=='\\' ||
+		    userName[a]=='{' || userName[a]=='}' )
+			{
+			iLiteralUsername=ETrue;
+			break;
+			}
+		}
+
+	iLiteralPassword=EFalse;
+	TPtr8 passWord = iPassword->Des();
+	for(a=0;a<iPassword->Length();a++)
+		{
+		if (passWord[a]<=32  || passWord[a]>=127 || passWord[a]=='\"' || passWord[a]=='%'  ||
+		    passWord[a]=='(' || passWord[a]==')' || passWord[a]=='*'  || passWord[a]=='\\' ||
+		    passWord[a]=='{' || passWord[a]=='}' )
+			{
+			iLiteralPassword=ETrue;
+			break;
+			}
+		}
+	
+	// Until we know we're seeing CC:Mail...
+	iTalkingToCCMail=EFalse;
+	iTalkingToOpenMail=EFalse;
+
+	// Start the connect
+	iState=EImapStateConnectWait;
+	iSendQueued=EFalse;
+	TBool sslWrappedSocket=iServiceSettings->SSLWrapper();
+	
+	// if local primarysession is active then set the local textserversion of ImapIO object.
+	if(iPrimarySession)
+		{
+		// Setting of PrimaryTextServerSession, Going to be set on the secondary session.
+		iImapIO->SetPrimaryTextServerSession(iPrimarySession->GetImap4Session()->GetTextServerSession());		
+		}
+	iImapIO->ConnectL(iStatus,iHost,iPort,*iPrefs, sslWrappedSocket);
+	
+#ifdef PRINTING
+	// Log version number now logfile is open
+	LogText(_L8("IMPS release 022.8"));
+
+	// Log connection destination
+	LogText(_L8("Connection queued to %S, port %d"),&iHost,iPort);
+
+	// Note any literal usage
+	if (iLiteralUsername)
+		LogText(_L8("Username contains unusual characters: using literal for username"));
+	if (iLiteralPassword)
+		LogText(_L8("Password contains unusual characters: using literal for password"));
+#endif
+	SetActive();
+	}
+
+// Queue a disconnection
+void CImImap4Session::DisconnectL(TRequestStatus& aRequestStatus)
+	{
+	LOG_COMMANDS((LogText(_L8("COMMAND Disconnect"))));
+	Cancel();
+
+	Queue(aRequestStatus);
+
+	// What are we doing at the moment?
+	if (iState<EImapStateNoSelect)
+		{
+		DoDisconnect();
+                DBG((LogText(_L8("-----------------------------------------------------------"))));
+		DBG((LogText(_L8("CImap4Session::DisconnectL(): calling Complete()"))));
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+
+		Complete(KErrNone);
+		}
+	else if (IsIdling())
+		{
+		iDisconnectAfterIdleStopped = ETrue;
+		DoStopIdleL();
+		}
+	else
+		{
+		DoDisconnectL();
+		}
+	}
+
+void CImImap4Session::DoDisconnectL()
+	{
+	// Send logout command
+	iState=EImapStateLogoutWait;
+	SendMessageL(KIMAPC_LOGOUT);
+	}
+
+// Are we connected?
+TBool CImImap4Session::Connected()
+	{
+	LOG_COMMANDS((LogText(_L8("COMMAND Connected?"))));
+
+	if (iState>=EImapStateNoSelect)
+		return(ETrue);
+	return(EFalse);
+	}
+
+// Are we busy?
+TBool CImImap4Session::Busy()
+	{
+	LOG_COMMANDS((LogText(_L8("COMMAND Busy?"))));
+
+	if (iState==EImapStateDisconnected ||
+		iState==EImapStateNoSelect ||
+		iState==EImapStateSelected ||
+		iState==EImapStateIdling)
+		return(EFalse);
+	return(ETrue);
+	}
+
+// Setting of PrimarySession, Going to be set on the secondary session.
+void CImImap4Session::SetPrimarySession(CActiveWrapper* aPrimarySession)
+	{
+	iPrimarySession=aPrimarySession;
+	}
+
+// Return of current textserversession
+CImTextServerSession* CImImap4Session::GetTextServerSession()
+	{
+	return iImapIO->GetTextServerSession();
+	}
+
+// Return the service settings
+CImImap4Settings* CImImap4Session::ServiceSettings()
+	{
+	// Return them
+	return(iServiceSettings);
+	}
+
+// List folder structure
+void CImImap4Session::ListL(TRequestStatus& aRequestStatus, const TMsvId aFolder, CArrayPtr<CImImap4DirStruct>* aList)
+	{
+	LOG_COMMANDS((LogText(_L8("COMMAND List(%x)"),aFolder)));
+	__ASSERT_DEBUG(iState==EImapStateNoSelect || iState==EImapStateSelected,gPanic(ESelectWhenNotReady));
+	if(!(iState==EImapStateNoSelect || iState==EImapStateSelected))
+		{
+		User::LeaveIfError(KErrNotReady);// Select when not ready
+		}
+	Queue(aRequestStatus);
+
+	// Form the path
+	HBufC8* path=NULL;
+	TRAPD(err,path=MakePathL(aFolder,ETrue));
+	if (err!=KErrNone)
+		{
+                DBG((LogText(_L8("-----------------------------------------------------------"))));
+		DBG((LogText(_L8("CImap4Session::ListL(): calling Complete()"))));
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+
+		Complete(err);
+		return;
+		}
+	CleanupStack::PushL(path);
+
+	// Empty path? If not, append hierarchy separator
+	if (path->Length())
+		{
+		// Get more space
+		HBufC8 *rpath=path->ReAllocL(path->Length()+1);
+
+		// Moved?
+		if (path!=rpath)
+			{
+			// Get rid of old one and push new one
+			CleanupStack::Pop();
+			CleanupStack::PushL(path=rpath);
+			}
+
+		path->Des().Append(iHierarchySeparator);
+		}
+
+	// Save path, as we take this off replies to get the leaf: we need to
+	// do this *before* we quote it as replies will be unquoted by the
+	// time we process them.
+	iCommandBuf.Copy(*path);
+
+	// Quote it
+	DoQuoteL(path);
+
+	// Send the command
+	NewTag();	
+	iImapIO->SendL(iStatus,_L8("%d LIST \"\" \"%S%%\"\r\n"),iTag,path);
+	NewTagSent();
+
+	// Save list pointer to add to, and reset it
+	iList=aList;
+	iList->ResetAndDestroy();
+	
+	// Dispose of path
+	CleanupStack::PopAndDestroy();
+
+	// Save last state (selected/unselected) for restoring afterwards
+	iSavedState=iState;
+	iState=EImapStateListWait;
+	}
+	
+// Update subscribed bits on local folder structure
+// Local structure must have been refreshed before this is used:
+// if folders listed in the LSUB reply don't exist, they're ignored
+// silently.
+void CImImap4Session::LsubL(TRequestStatus& aRequestStatus)
+	{
+	LOG_COMMANDS((LogText(_L8("COMMAND Lsub"))));
+	__ASSERT_DEBUG(iState==EImapStateNoSelect || iState==EImapStateSelected,gPanic(ESelectWhenNotReady));
+	if(!(iState==EImapStateNoSelect || iState==EImapStateSelected))
+		{
+		User::LeaveIfError(KErrNotReady);
+		}
+	
+	Queue(aRequestStatus);
+
+	// First, we need to go through the entire service, resetting all
+	// the 'remote subscribed' flags.
+	ResetSubscriptionFlagsL(iServiceId);
+
+	// Build a buffer to quote the folder path (it may be necessary)
+	HBufC8* path=HBufC8::NewL(iFolderPath.Length()+1);
+	CleanupStack::PushL(path);
+	path->Des().Append(iFolderPath);
+	if (iFolderPath.Length())
+		path->Des().Append(iHierarchySeparator);
+
+	// Quote it
+	DoQuoteL(path);
+
+	// Send the command to list all of the folders in the tree: we
+	// can't do it hierarchically, as the servers aren't clever enough
+	// to tell us at parent levels about folders that contain subscribed
+	// children. Pah.
+	NewTag();
+
+	// Make a Des & send it
+	TPtrC8 pathdes(path->Des());
+	iImapIO->SendL(iStatus,_L8("%d LSUB \"\" \"%S*\"\r\n"),
+				  iTag,&pathdes);
+	NewTagSent();
+
+	// Clear up
+	CleanupStack::PopAndDestroy();
+
+	// Wait for reply
+	iSavedState=iState;
+	iState=EImapStateLsubWait;
+	}
+
+
+// Create a mailbox or folder
+void CImImap4Session::Create(TRequestStatus& aRequestStatus, const TMsvId aParent, const TDesC& aLeafName, const TBool aFolder)
+	{
+	TInt err=KErrNone;
+	if (!Connected())
+		{
+		Queue(aRequestStatus);
+		err=KErrDisconnected;
+		}
+	else
+		TRAP(err,CreateL(aRequestStatus, aParent, aLeafName, aFolder));
+	if (err!=KErrNone)
+                {
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+		DBG((LogText(_L8("CImap4Session::Create(): calling Complete()"))));
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+
+		Complete(err);
+                }
+	}
+
+// Create a mailbox or folder
+void CImImap4Session::CreateL(TRequestStatus& aRequestStatus, const TMsvId aParent, const TDesC& aLeafName, const TBool aFolder)
+	{
+	LOG_COMMANDS((LogText(_L8("COMMAND Create(%x,%S,%d)"),aParent,&aLeafName,aFolder)));
+	__ASSERT_DEBUG(iState==EImapStateNoSelect || iState==EImapStateSelected,gPanic(ECreateWhenNotReady));
+	if(!(iState==EImapStateNoSelect || iState==EImapStateSelected))
+		{
+		User::LeaveIfError(KErrNotReady);
+		}
+	Queue(aRequestStatus);
+
+	// Make the path
+	iSavedState=iState;
+	iState=EImapStateCreateWait;
+	HBufC8 *path=NULL; // To stop .AER warnings...
+	TRAPD(err,path=MakePathL(aParent,ETrue));
+	if (err!=KErrNone)
+		{
+                DBG((LogText(_L8("-----------------------------------------------------------"))));
+		DBG((LogText(_L8("CImap4Session::CreateL(): calling Complete()"))));
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+
+		Complete(err);
+		return;
+		}
+	CleanupStack::PushL(path);
+
+	// Increase length of buffer for full name
+	TInt encodedLeafMaxSize = 2+aLeafName.Size()*4/3 + 1;
+	HBufC8* rpath=path->ReAllocL(path->Length()+2+encodedLeafMaxSize);
+	
+	// Moved?
+	if (rpath!=path)
+		{
+		// Destroy old one and push new one
+		CleanupStack::Pop();
+		CleanupStack::PushL(path=rpath);
+		}
+
+	// Path not blank? Put a separator in there
+	if (path->Des().Length())
+		path->Des().Append(iHierarchySeparator);
+
+	iCharConv->PrepareToConvertToFromOurCharsetL(KCharacterSetIdentifierImapUtf7);
+
+	// Add leafname, via the utf7 encoder
+	HBufC8* utf7=HBufC8::NewL(encodedLeafMaxSize);
+	CleanupStack::PushL(utf7);
+	
+	TInt numUC, indexUC;
+	TPtr8 des = utf7->Des();
+	iCharConv->ConvertFromOurCharsetL(aLeafName, des, numUC, indexUC);
+	path->Des().Append(des);
+
+	CleanupStack::PopAndDestroy(); // utf7
+
+	// Put a trailing hierarchy separator on there too if necessary
+	if (aFolder)
+		path->Des().Append(iHierarchySeparator);
+
+	// Quote it if necessary
+	DoQuoteL(path);
+	TPtrC8 pathdes(path->Des());
+
+	// Creating a folder
+	NewTag();
+	iImapIO->SendL(iStatus,_L8("%d CREATE \"%S\"\r\n"),iTag,&pathdes);
+	NewTagSent();
+
+	// Save what type of create we were doing
+	iCommandFlags[0]=aFolder;
+	iCommandIds[0]=aParent;
+	iCommandBuf=aLeafName;
+
+	// Free memory
+	CleanupStack::PopAndDestroy();
+	}
+
+// Rename a mailbox
+void CImImap4Session::Rename(TRequestStatus& aRequestStatus, const TMsvId aTarget, const TDesC& aNewName)
+	{
+	TInt err=KErrNone;
+	if (!Connected())
+		{
+		Queue(aRequestStatus);
+		err=KErrDisconnected;
+		}
+	else
+		TRAP(err,RenameL(aRequestStatus, aTarget, aNewName));
+	if (err!=KErrNone)
+		Complete(err);
+	}
+
+// Rename a mailbox
+void CImImap4Session::RenameL(TRequestStatus& aRequestStatus, const TMsvId aTarget, const TDesC& aNewName)
+	{
+	LOG_COMMANDS((LogText(_L8("COMMAND Rename(%x,%S)"),aTarget,&aNewName)));
+	__ASSERT_DEBUG(iState==EImapStateNoSelect || iState==EImapStateSelected,gPanic(ERenameWhenNotReady));
+	if(!(iState==EImapStateNoSelect || iState==EImapStateSelected))
+	{
+		User::LeaveIfError(KErrNotReady);
+	}
+	
+	Queue(aRequestStatus);
+
+	// Make the paths
+	HBufC8* path=NULL; // To stop .AER warnings...
+	TRAPD(err,path=MakePathL(aTarget,ETrue));
+	if (err!=KErrNone)
+		{
+		Complete(err);
+		return;
+		}
+	CleanupStack::PushL(path);
+
+	DoQuoteL(path);
+
+	HBufC8* newpath=NULL; // To stop .AER warnings...
+	TRAP(err,newpath=MakePathL(aTarget,EFalse));
+	if (err!=KErrNone)
+		{
+		CleanupStack::PopAndDestroy();
+		Complete(err);
+		return;
+		}
+	CleanupStack::PushL(newpath);
+
+	// Extend buffer for new name
+	TInt encodedLeafMaxSize = 2+aNewName.Size()*4/3 + 1;
+	HBufC8* rnewpath=newpath->ReAllocL(newpath->Length()+2+encodedLeafMaxSize);
+
+	// Moved?
+	if (rnewpath!=newpath)
+		{
+		// Destroy old one and push new one
+		CleanupStack::Pop();
+		CleanupStack::PushL(newpath=rnewpath);
+		}
+
+	if (newpath->Length())
+		newpath->Des().Append(iHierarchySeparator);
+	
+	iCharConv->PrepareToConvertToFromOurCharsetL(KCharacterSetIdentifierImapUtf7);
+
+	// Add leafname, via the utf7 encoder
+	HBufC8* utf7=HBufC8::NewL(encodedLeafMaxSize);
+	CleanupStack::PushL(utf7);
+	
+	TInt numUC, indexUC;
+	TPtr8 des = utf7->Des();
+	iCharConv->ConvertFromOurCharsetL(aNewName, des, numUC, indexUC);
+	newpath->Des().Append(des);
+
+	CleanupStack::PopAndDestroy(); // utf7
+
+	DoQuoteL(newpath);
+
+	// Save rename parameters
+	iCommandIds[0]=aTarget;
+	iCommandBuf=aNewName;			// this is still the original, unencoded name
+
+	// Set states	
+	iSavedState=iState;
+	iState=EImapStateRenameWait;
+
+	// Send the command
+	NewTag();
+	TPtrC8 pathdes(path->Des());
+	TPtrC8 newpathdes(newpath->Des());
+	iImapIO->SendL(iStatus,_L8("%d RENAME \"%S\" \"%S\"\r\n"),iTag,&pathdes,&newpathdes);
+	NewTagSent();
+
+	// Free memory
+	CleanupStack::PopAndDestroy(2);
+	}
+
+// Delete a message/mailbox
+void CImImap4Session::Delete(TRequestStatus& aRequestStatus, const CMsvEntrySelection& aTargetSel)
+	{
+	TInt err=KErrNone;
+	if (!Connected())
+		err=KErrDisconnected;
+	else
+		TRAP(err,DeleteL(aRequestStatus,aTargetSel));
+	if (err!=KErrNone)
+		{
+		Queue(aRequestStatus);
+		Complete(err);
+		}
+	}
+
+// Delete a message/mailbox
+void CImImap4Session::Delete(TRequestStatus& aRequestStatus, const TMsvId aTarget)
+	{
+	TInt err=KErrNone;
+	if (!Connected())
+		err=KErrDisconnected;
+	else
+		TRAP(err,DeleteL(aRequestStatus,aTarget));
+	if (err!=KErrNone)
+		{
+		Queue(aRequestStatus);
+		Complete(err);
+		}
+	}
+void CImImap4Session::DeleteEntryL( const TMsvId aTarget)
+	{
+	LOG_COMMANDS((LogText(_L8("COMMAND Delete(%x)"),aTarget)));
+
+	// Move to the entry in question
+	SetEntryL(aTarget);
+
+	LOG_COMMANDS((	LogText(_L8("COMMAND Delete(message)"))));
+	__ASSERT_DEBUG(iState==EImapStateSelected,gPanic(EDeleteWhenNotReady));	
+	if(!(iState==EImapStateSelected))
+	{
+		User::LeaveIfError(KErrNotReady);
+	}
+	
+	// SJM, remove check for right mailbox as we may be trying to
+	// delete a moved entry which is in fact no longer in the
+	// right mailbox.
+#if 0
+	// Check we're in the right mailbox
+	if (iEntry->Entry().Parent()!=iMailboxId)
+		{
+		// Nope.
+		Queue(aRequestStatus);
+		Complete(KErrImapWrongFolder);
+		return;
+		}
+#endif
+	
+	// Set deleted flag on this entry
+	TMsvEmailEntry entry=iEntry->Entry();
+	entry.SetDeletedIMAP4Flag(ETrue);
+	ChangeEntryL(entry);
+	}
+
+void CImImap4Session::DeleteL(TRequestStatus& aRequestStatus, const CMsvEntrySelection& aTargetSel)
+	{
+	LOG_COMMANDS((LogText(_L8("COMMAND Delete (%x)"),aTargetSel[0])));
+
+	// Move to the entry in question
+	SetEntryL(aTargetSel[0]);
+
+    CMsvEntrySelection* sel=aTargetSel.CopyL();
+	delete iSelection;
+	iSelection=sel;
+
+	// Only deleting message seletion currently
+	if (iEntry->Entry().iType==KUidMsvMessageEntry)
+		{
+		// Set delete flag on all selected entries.
+		TInt count=iSelection->Count();
+		while (count--)
+			DeleteEntryL((*iSelection)[count]);
+
+		// Force a folder close with expunge
+		CloseL(aRequestStatus,ETrue);
+		}
+	else
+		{
+		LOG_COMMANDS((	LogText(_L8("COMMAND Delete - Can only delete selection of Messages"))));
+
+		// Deleting selection of entries whicxh are not messages
+		Queue(aRequestStatus);
+		Complete(KErrNotSupported);
+		}
+	}
+
+void CImImap4Session::DeleteL(TRequestStatus& aRequestStatus, const TMsvId aTarget)
+	{
+	LOG_COMMANDS((LogText(_L8("COMMAND Delete(%x)"),aTarget)));
+
+	// Move to the entry in question
+	SetEntryL(aTarget);
+
+	// A message?
+	if (iEntry->Entry().iType==KUidMsvMessageEntry)
+		{
+		DeleteEntryL(aTarget);
+
+		// Temporary: force a folder close with expunge
+		CloseL(aRequestStatus,ETrue);
+		}
+	// A folder?
+	else if (iEntry->Entry().iType==KUidMsvFolderEntry)
+		{
+		LOG_COMMANDS((	LogText(_L8("COMMAND Delete(folder)"))));
+                __ASSERT_DEBUG(iState==EImapStateNoSelect,gPanic(EDeleteWhenNotReady));
+		if(!(iState==EImapStateNoSelect))
+			{
+			User::LeaveIfError(KErrNotReady);
+			}
+		
+		Queue(aRequestStatus);
+
+		// Save IDs of parent and target for actually doing the local delete when
+		// the remote one completes successfully.
+		iCommandIds[0]=iEntry->Entry().Parent();
+		iCommandIds[1]=aTarget;
+
+		// Get path to delete
+		HBufC8* path=NULL; // To stop .AER warnings...
+		path=MakePathL(aTarget,ETrue);
+		CleanupStack::PushL(path);
+		DoQuoteL(path);
+
+		// Set state
+		iSavedState=iState;
+		iState=EImapStateDeleteWait;
+
+		// Send command
+		NewTag();
+		TPtrC8 pathdes(path->Des());
+		iImapIO->SendL(iStatus,_L8("%d DELETE \"%S\"\r\n"),iTag,&pathdes);
+		NewTagSent();
+
+		// Destroy buffer
+		CleanupStack::PopAndDestroy();
+		}
+	// Something else?
+	else
+		{
+		LOG_COMMANDS((	LogText(_L8("COMMAND Delete(unknown)"))));
+
+		// Delete of something that isn't a folder or a message. Erk!
+		Queue(aRequestStatus);
+		Complete(KErrNotSupported);
+		}
+	}
+
+// Delete everything in this folder
+void CImImap4Session::DeleteAllMessagesL(TRequestStatus& aRequestStatus)
+	{
+	LOG_COMMANDS((LogText(_L8("COMMAND DeleteAllMessages(%x)"),iMailboxId)));
+
+	// We have to be selected
+	__ASSERT_DEBUG(iState==EImapStateSelected,gPanic(EDeleteWhenNotReady));
+	if(!(iState==EImapStateSelected))
+		{
+		User::LeaveIfError(KErrNotReady);
+		}
+	
+	Queue(aRequestStatus);
+
+	// We're going to send a command of one style or another
+	NewTag();
+
+	// Are there any messages remotely to delete?
+	if (iMailboxSize==0)
+		{
+		// No: just do a close
+		iState=EImapStateCommandWait;
+		iSavedState=EImapStateNoSelect;
+		iImapIO->SendL(iStatus,_L8("%d CLOSE\r\n"),iTag);
+		}
+	else
+		{
+		// DeleteAllMessages is a special case: we want to delete everything,
+		// regardless of wether it's in the mirror or not. So, we set deleted
+		// flags on everything then expunge the folder
+		iState=EImapStateDeleteAllWait;
+
+		// Send command: we go into deleteall wait as the next
+		iImapIO->SendL(iStatus,_L8("%d STORE 1:* +FLAGS (\\Deleted)\r\n"),iTag);
+		}
+
+	// Sent it
+	NewTagSent();
+	}
+
+// Select a folder
+void CImImap4Session::Select(TRequestStatus& aRequestStatus, const TMsvId aFolder, const TBool aReadWrite)
+	{
+	TInt err=KErrNone;
+	if (!Connected())
+		{
+		Queue(aRequestStatus);
+		err=KErrDisconnected;
+		}
+	else
+		TRAP(err,SelectL(aRequestStatus, aFolder, aReadWrite));
+	if (err!=KErrNone)
+                {
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+		DBG((LogText(_L8("CImap4Session::Select(): calling Complete()"))));
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+
+		Complete(err);
+                }
+	}
+
+void CImImap4Session::SelectL(TRequestStatus& aRequestStatus, const TMsvId aFolder, const TBool aReadWrite)
+	{
+	LOG_COMMANDS((LogText(_L8("COMMAND Select(%x (rw=%d), in state %d. Current mailbox=%x)"),aFolder,aReadWrite?1:0,iState,iMailboxId)));
+
+	if (!(iState==EImapStateNoSelect || iState==EImapStateSelected))
+		{
+		User::LeaveIfError(KErrNotReady);
+		}
+	Queue(aRequestStatus);
+	
+	// reset counts to safe values here to avoid reporting left over
+	// values from previous fetch. Correct values will be set up once
+	// headers have been fetched and parts counted.
+	iProgress.iPartsToDo=iProgress.iBytesToDo=1;
+	iProgress.iPartsDone=iProgress.iBytesDone=0;
+	
+	// Do the select
+
+	// Is it already selected and the read/write state is compatible?
+	// Skip the command if possible!
+	if (iMailboxId==aFolder && iState==EImapStateSelected &&
+		((aReadWrite && iMailboxWritable) || !aReadWrite))
+		{
+		if (ImapIdleSupported())
+			{
+                        DBG((LogText(_L8("-----------------------------------------------------------"))));
+			DBG((LogText(_L8("CImap4Session::SelectL(): calling Complete()"))));
+			DBG((LogText(_L8("-----------------------------------------------------------"))));
+
+			Complete(KErrNone);
+			return;
+			}
+		else
+			{
+			// Just NOOP it so that we know about any mailbox size changes
+			NewTag();
+			iImapIO->SendL(iStatus,_L8("%d NOOP\r\n"),iTag);
+			iState=EImapStateSelectWait;
+			NewTagSent();
+			return;
+			}
+		}
+	
+	// Ok looks as if the SELECT actually needs to be done.
+	DoSelectL(aFolder, aReadWrite);
+	}
+
+void CImImap4Session::DoSelectL(const TMsvId aFolder, const TBool aReadWrite)
+	{
+	NewTag();	
+
+	// We should always get an EXISTS after a SELECT but just in case
+	// we will force it true here. This ensures that a NewOnlySync
+	// will always do the sync when it involves selecting a new folder
+	iMailboxReceivedExists=ETrue;
+
+	// Store name of new mailbox
+	iMailboxId=aFolder;
+
+	// Get rid of old index and reset everything
+	iFolderIndex.Reset();
+	iMailboxSize=0;
+	iMsgsDone=0;
+	iMailboxRecent=0;
+	iUidValidity=0;
+	iUidNext=0;
+
+	// Is it special-case inbox?
+	SetEntryL(iMailboxId);
+#if 0
+	if (iEntry->Entry().Parent()==iServiceId && iEntry->Entry().iDetails.CompareF(KIMAP_INBOX)==0)
+		{
+		// Inbox: no path prepended
+		iImapIO->SendL(iStatus,aReadWrite?_L8("%d SELECT INBOX\r\n"):_L8("%d EXAMINE INBOX\r\n"),iTag);
+		iMailboxIsInbox=ETrue;
+		}
+	else
+		{
+#endif
+		// Create path and send select command
+		HBufC8* path=MakePathL(iMailboxId,ETrue);
+		CleanupStack::PushL(path);
+		DoQuoteL(path);
+		TPtrC8 pathptr=path->Des();
+		iImapIO->SendL(iStatus,aReadWrite?_L8("%d SELECT \"%S\"\r\n"):_L8("%d EXAMINE \"%S\"\r\n"),iTag,&pathptr);
+		CleanupStack::PopAndDestroy();
+#if 0
+		iMailboxIsInbox=EFalse;
+		}
+#endif
+	// Sent command
+	iState=EImapStateSelectWait;
+	NewTagSent();
+	}
+
+// Copy a message to a new folder
+void CImImap4Session::Copy(TRequestStatus& aRequestStatus, const TMsvId aSource, const TMsvId aDestination, TBool aUnSelectIfSameFolder)
+	{
+	TInt err=KErrNone;
+	if (!Connected())
+		{
+		Queue(aRequestStatus);
+		err=KErrDisconnected;
+		}
+	else
+		TRAP(err,CopyL(aRequestStatus, aSource, aDestination, aUnSelectIfSameFolder));
+	if (err!=KErrNone)
+                {
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+		DBG((LogText(_L8("CImap4Session::Copy(): calling Complete()"))));
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+
+		Complete(err);
+                }
+	}
+
+void CImImap4Session::CopyL(TRequestStatus& aRequestStatus, const TMsvId aSource, const TMsvId aDestination, TBool aUnSelectIfSameFolder)
+	{
+	LOG_COMMANDS((LogText(_L8("COMMAND Copy(%x,%x)"),aSource,aDestination)));
+	__ASSERT_DEBUG(iState==EImapStateSelected,gPanic(ECopyWhenNotSelected));
+	if(!(iState==EImapStateSelected))
+		{
+		User::LeaveIfError(KErrArgument);//Copy when not selected
+		}
+	
+	Queue(aRequestStatus);
+
+	// Make destination folder path
+	HBufC8 *command=NULL; // To stop .AER warnings...
+	TRAPD(err,command=MakePathL(aDestination,ETrue));
+	if (err!=KErrNone)
+		{
+                DBG((LogText(_L8("-----------------------------------------------------------"))));
+		DBG((LogText(_L8("CImap4Session::CopyL(): calling Complete()"))));
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+
+		Complete(err);
+		return;
+		}
+	CleanupStack::PushL(command);
+	DoQuoteL(command);
+
+	// Check that source is in the folder we have got selected: this also
+	// ensures it's actually a message, as the parent of attachments wouldn't
+	// be the folder we have selected...
+	SetEntryL(aSource);
+	__ASSERT_DEBUG(iEntry->Entry().Parent()==iMailboxId,gPanic(ECopyNotFromSelectedFolder));
+	if(!(iEntry->Entry().Parent()==iMailboxId))
+			{
+			User::LeaveIfError(KErrGeneral);
+			}
+	// Make command
+	TMsvEmailEntry entry=iEntry->Entry();
+	NewTag();
+	TPtrC8 commanddes(command->Des());
+	iImapIO->SendL(iStatus,_L8("%d UID COPY %u \"%S\"\r\n"),iTag,entry.UID(),&commanddes);
+	NewTagSent();
+
+	// If we're copying to the currently selected folder, pretend we've unselected it.
+	// This ensures we'll pick up on any changes in the next new sync
+	if (aUnSelectIfSameFolder && iMailboxId==aDestination && iState==EImapStateSelected)
+		{
+		// Return to 'no select' state after this
+		iSavedState=EImapStateNoSelect;
+		}
+	else
+		{
+		// Save existing selected/unselected state
+		iSavedState=iState;
+		}
+
+	// Set up state
+	iState=EImapStateCommandWait;
+
+	// Delete buffer
+	CleanupStack::PopAndDestroy();
+	}
+
+// Copy a message to a new folder
+void CImImap4Session::Append(TRequestStatus& aRequestStatus, const TMsvId aSource, const TMsvId aDestination)
+	{
+	TInt err=KErrNone;
+	if (!Connected())
+		{
+		Queue(aRequestStatus);
+		err=KErrDisconnected;
+		}
+	else
+		TRAP(err,AppendL(aRequestStatus, aSource, aDestination));
+	if (err!=KErrNone)
+		Complete(err);
+	}
+	
+void CImImap4Session::AppendL(TRequestStatus& aRequestStatus, const TMsvId aSource, const TMsvId aDestination)
+	{
+	LOG_COMMANDS((LogText(_L8("COMMAND Append(%x,%x)"),aSource,aDestination)));
+
+	Queue(aRequestStatus);
+
+	// Check that source is a complete message
+	SetEntryL(aSource);
+
+	// Check it's a message
+	if (iEntry->Entry().iType!=KUidMsvMessageEntry)
+		{
+		// Can't do it!
+		Complete(KErrGeneral);
+		return;
+		}
+
+	// Cancel any dummy operation that might be outstanding
+	if (ImapIdleSupported()==EFalse)
+		{
+		CancelDummy();
+		}
+
+	// Size message for sending using a CImCalculateMessageSize
+	delete iMessageSizer;
+	iMessageSizer=NULL;
+	iMessageSizer=CImCalculateMsgSize::NewL(iFs,*iEntry);
+
+	// Start sizing operation, using MIME: save source & destination for next step
+	// Use iHost (hostname of remote server) as the domain name seed for the MsgId
+	iCommandIds[0]=aSource;
+	iCommandIds[1]=aDestination;
+	iMessageDate=iEntry->Entry().iDate;
+	iMessageSizer->StartL(iStatus,iCommandIds[0], ESendAsMimeEmail, 
+												  iMessageDate, iHost, iCharset);
+
+	// If we're appending to the currently selected folder, pretend we've unselected it.
+	// This ensures we'll pick up on any changes in the next new sync
+	if (iMailboxId==aDestination && iState==EImapStateSelected)
+		{
+		// Return to 'no select' state after this
+		iSavedState=EImapStateNoSelect;
+		}
+	else
+		{
+		// Save existing selected/unselected state
+		iSavedState=iState;
+		}
+
+	iState=EImapStateAppendSizeWait;
+	if (!IsActive()) SetActive();
+	}
+
+// Close a selected folder
+void CImImap4Session::Close(TRequestStatus& aRequestStatus, const TBool aExpunge)
+	{
+	TInt err=KErrNone;
+	if (!Connected())
+		{
+		Queue(aRequestStatus);
+		err=KErrDisconnected;
+		}
+	else
+		TRAP(err,CloseL(aRequestStatus, aExpunge));
+	if (err!=KErrNone)
+		Complete(err);
+	}
+
+void CImImap4Session::CloseL(TRequestStatus& aRequestStatus, const TBool aExpunge)
+	{
+	LOG_COMMANDS((LogText(_L8("COMMAND Close(%d)"),aExpunge)));
+
+	Queue(aRequestStatus);
+
+	// Folder currently open? Just complete if we're not selected
+	if (iState==EImapStateNoSelect)
+		{
+		Complete(KErrNone);
+		return;
+		}
+
+	// Expunging? If not, just send close command
+	if (!aExpunge)
+		{
+		// Send close
+		SendMessageL(KIMAPC_CLOSE);
+		iSavedState=EImapStateNoSelect;
+		iState=EImapStateCommandWait;
+		}
+	else
+		{
+		// The deletion strategy will build up runs of UIDs in order to make the
+		// most efficient use of bandwidth. However, as UIDs are not necessarily
+		// contiguous, so we use their sorted position in the mirror to decide on
+		// runs. UIDs will be allocated on an increasing basis,as the server cannot
+		// have magically invented new UIDs between 2 existing ones.
+		// UIds can miss from run by using email sync limits.
+		//
+		// We use TInt64's because AppendNum() cannot take a TUint32, which is
+		// what a UID is.
+		SetEntryL(iMailboxId);
+		GetChildrenL(*iSelection);
+		TRAPD(err,MakeSortedFolderIndexL());
+		if (err!=KErrNone)
+			{
+			Complete(err);
+			return;
+			}
+		TInt pos=0;
+		TInt run=0;
+		TInt64 last=0;
+		TInt deleted=0;
+
+		// Build command
+		HBufC8* command=HBufC8::NewLC(256);
+
+		// Start command
+		command->Des().Append(_L8("UID STORE "));
+
+		while(pos<iFolderIndex.Size())
+			{
+			// Look for messages with deleted flag set
+			SetEntryL(iFolderIndex[pos].iMsvId);
+			if (((TMsvEmailEntry)iEntry->Entry()).DeletedIMAP4Flag())
+				{
+				LOG_COMMANDS((LogText(_L8("Message #%d marked as deleted"),pos+1)));
+
+				deleted++;
+				// If uids are missing from run
+				if ((pos > 0 )&& (((TUint)iFolderIndex[pos].iUid - (TUint)iFolderIndex[pos-1].iUid) > 1))
+				{
+				// Breaking a run
+				if(run > 1)
+					{
+					// A run of at least 2 is a range. Append 'last' UID,
+					// after removing comma and append a comma 
+					command->Des().Delete(command->Des().Length()-1,1);
+					command->Des().Append(_L8(":"));
+					command->Des().AppendNum(last);
+					command->Des().Append(_L8(","));
+					}
+				// run broken
+				run = 0;
+				}
+
+				// This one is deleted. Are we in a run?
+				if (!run)
+					{
+					// No, start of a run/single item. Add to command
+					// Enough room for this?
+					if ((command->Length()+32)>command->Size())
+						{
+						// Extend buffer
+						HBufC8* rcommand=command->ReAllocL(command->Size()+64);
+						
+						// Moved?
+						if (rcommand!=command)
+							{
+							// Destroy old one and push new one
+							CleanupStack::Pop();
+							CleanupStack::PushL(command=rcommand);
+							}
+						}
+
+					// Single number, plus a comma to terminate
+					TInt64 uid=(TUint)((TMsvEmailEntry)iEntry->Entry()).UID();
+					command->Des().AppendNum(uid);
+					command->Des().Append(_L8(","));
+
+					// A run of 1 :-)
+					run++;
+					}
+				else
+					{
+					// We're in a run already. Extend it: it will be terminated
+					// when the run is broken or we exit.
+					last=(TUint)iFolderIndex[pos].iUid;
+					run++;
+					}
+				}
+			else
+				{
+				// Mark this MsvId as 0 (so it will be kept in local expunge)
+				iFolderIndex[pos].iMsvId=0;
+
+				// Breaking a run?
+				if (run>1)
+					{
+					// A run of at least 2 is a range. Append 'last' UID,
+					// after removing comma
+					command->Des().Delete(command->Des().Length()-1,1);
+					command->Des().Append(_L8(":"));
+					command->Des().AppendNum(last);
+					command->Des().Append(_L8(","));
+					}
+
+				// Run broken
+				run=0;
+				}
+
+			// Next message
+			pos++;
+			}
+
+		// Anything deleted?
+		if (deleted)
+			{
+			// Remove the last character in the command string
+			command->Des().Delete(command->Des().Length()-1,1);	
+
+			// A run to complete?
+			if (run>1)
+				{
+				// A run of at least 2 is a range. Append 'last' UID.
+				command->Des().Append(_L8(":"));
+				command->Des().AppendNum(last);
+				}
+
+			// Append flags & send command
+			command->Des().Append(_L8(" +FLAGS (\\Deleted)"));
+			SendMessageL(command->Des());
+			iState=EImapStateDeleteMarkWait;
+			}
+		else
+			{
+			// Nothing to do: Just close the folder
+			iState=EImapStateCloseWait;
+			SendMessageL(KIMAPC_CLOSE);
+			}
+
+		// Get rid of command buffer
+		CleanupStack::PopAndDestroy();
+		}
+	}
+
+// Orphan a local message
+void CImImap4Session::OrphanMessageL(const TMsvId aMessage)
+	{
+	DBG((LogText(_L8("OrphanMessageL(%x)"),aMessage)));
+
+	// We no longer orphan the messages based on whether they have been downloaded.
+ 	// That was just delaying the inevitable and causing other problems
+ 	DeleteMessageL(aMessage);
+	DBG((LogText(_L8("  Deleting message"))));
+	}
+
+// Delete a local message
+void CImImap4Session::DeleteMessageL(const TMsvId aMessage)
+	{
+	DBG((LogText(_L8("CImImap4Session::DeleteMessageL(%x)"),aMessage)));
+
+ 	if(aMessage == KMsvNullIndexEntryId)
+		{
+		DBG((LogText(_L8("Attempted delete of null entry(%d)"),aMessage)));
+ 		return;
+		}
+	// Delete message and all subparts: first, move to parent
+	DBG((LogText(_L8("  SetEntry(%x)"),aMessage)));
+	SetEntryL(aMessage);
+
+	DBG((LogText(_L8("  SetEntry(%x)"),iEntry->Entry().Parent())));
+	SetEntryL(iEntry->Entry().Parent());
+
+	// Do it
+	DBG((LogText(_L8("  About to DeleteEntry(%x)"),aMessage)));
+	// Do not leave when entry is in use 
+	TInt err (iEntry->DeleteEntry(aMessage));
+	if(err==KErrInUse)
+		{
+		DBG((LogText(_L8("CImImap4Session::DeleteMessageL() dont leave if err = KErrInUse"))));
+		}
+	else
+		{
+		User::LeaveIfError(err);
+		}
+	
+	DBG((LogText(_L8("  Done!"))));
+	}
+
+// Get MESSAGE ONLY children of a folder. Ignore shadows as they are
+// not going to be synced against the server
+void CImImap4Session::GetMessageChildrenL(const TMsvId aFolder, CMsvEntrySelection* aChildren)
+	{	
+	// Get *all* the children
+	SetEntryL(aFolder);
+	GetChildrenL(*aChildren);
+
+	if(iCachedEntryData)
+		{
+		delete iCachedEntryData;
+		iCachedEntryData = 0;
+		}
+	iCachedEntryData = new(ELeave) CArrayFixFlat<TMsvCacheData>(5);
+
+	// Go through them, checking to see if they're messages and removing ones that aren't
+	TInt pos=0;
+	while(pos<aChildren->Count())
+		{
+		TMsvEntry* entryPtr;
+		TMsvId id = (*aChildren)[pos];
+		User::LeaveIfError(iEntry->GetEntryFromId(id,entryPtr));
+
+		// Is it a message? And is it real (not shadow)
+		if (entryPtr->iType!=KUidMsvMessageEntry ||
+			entryPtr->iRelatedId != KMsvNullIndexEntryId )
+			{
+			// No, remove it
+			aChildren->Delete(pos,1);
+			}
+		else
+			{
+			//cache two parts of the TMsvEntry data to avoid having to refind it later
+			TMsvCacheData data;
+			data.iOrphan = ((TMsvEmailEntry)(*entryPtr)).Orphan();
+			data.iUid = ((TMsvEmailEntry)(*entryPtr)).UID();
+			iCachedEntryData->AppendL(data);
+			// Next entry
+			pos++;
+			}
+		}
+	}
+
+// Synchronise a folder
+void CImImap4Session::Synchronise(TRequestStatus& aRequestStatus, TBool aNewOnly)
+	{
+        DBG((LogText(_L8("CImImap4Session::Synchronise()"))));
+	TInt err=KErrNone;
+	if (!Connected())
+		{
+		Queue(aRequestStatus);
+		err=KErrDisconnected;
+		}
+	else
+		TRAP(err,SynchroniseL(aRequestStatus, aNewOnly));
+	if (err!=KErrNone)
+                {
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+		DBG((LogText(_L8("CImap4Session::Synchronise(): calling Complete()"))));
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+
+
+		Complete(err);
+	        }
+       }
+
+void CImImap4Session::SynchroniseL(TRequestStatus& aRequestStatus, TBool aNewOnly)
+	{
+	__ASSERT_DEBUG(iState==EImapStateSelected,gPanic(ESyncWhenNotSelected));
+	if(!(iState==EImapStateSelected))
+		{
+		User::LeaveIfError(KErrArgument);// Sync when not selected .
+		}
+	
+	Queue(aRequestStatus);
+
+	DoSynchroniseL(aNewOnly);
+	}
+
+void CImImap4Session::DoSynchroniseL(TBool aNewOnly)
+	{
+	LOG_COMMANDS((LogText(_L8("COMMAND Synchronise"))));
+	__ASSERT_DEBUG(iState==EImapStateSelected,gPanic(ESyncWhenNotSelected));
+	if(!(iState==EImapStateSelected))
+			{
+			User::LeaveIfError(KErrArgument);// Sync when not selected .
+			}
+	// clear flags that may have been be set by SELECT or NOOP to say
+	// that a sync is required
+	iMailboxReceivedExists=EFalse;
+	iMailboxReceivedExpunge=EFalse;
+	iMailboxReceivedFlags=EFalse;
+
+	// Some pre-bits that need doing - get the children & count them
+	SetEntryL(iMailboxId);
+
+	TMsvEmailEntry message=iEntry->Entry();
+	GetMessageChildrenL(iMailboxId,iSelection);
+	TInt noofchildren=iSelection->Count();
+
+	if (!aNewOnly && noofchildren)
+		{
+		// Delete any orphaned messages completely at this point
+		DBG((LogText(_L8("Looking for orphans in %d local messages"),noofchildren)));
+
+		TInt pos=0;
+		while(pos<noofchildren)
+			{
+			if((*iCachedEntryData)[pos].iOrphan)
+				{
+				DBG((LogText(_L8("  Deleting orphan %x"),(*iSelection)[pos])));
+
+				// Delete it
+				SetEntryL(iMailboxId);
+				iEntry->DeleteEntry((*iSelection)[pos]);				
+				// Remove it from selection
+				iSelection->Delete(pos,1);
+				noofchildren--;
+				}
+			else
+				{
+				// Move on to next entry
+				pos++;
+				}
+			}
+		}
+
+	// First thing we have to do: check the UIDVALIDITY of the mirror and the
+	// remote folder match. If not, we have to orphan everything in the mirror
+	// and start again.
+	// We also do this if there are 0 messages in the remote mailbox (0 EXISTS)
+	// and there are messages locally
+	if (!message.ValidUID() || iUidValidity!=message.UID() || iMailboxSize==0)
+		{
+		// They don't match: do we have local children?
+#ifdef PRINTING
+		if (!iMailboxSize)
+			LogText(_L8("No remote messages"));
+		else
+			LogText(_L8("UIDVALIDITY changed: local %u, remote %u"),
+			    message.UID(),iUidValidity);
+#endif
+
+		// If we were doing a new-only sync, change this to a full sync as the
+		// UIDVALIDITY shows major changes
+		aNewOnly=EFalse;
+
+		if (noofchildren)
+			{
+		    // We've got local children: orphan them
+			DBG((LogText(_L8("Orphaning %d local messages"),noofchildren)));
+
+			for(TInt a=0;a<noofchildren;a++)
+				{
+				// ...we should be skipping locally generated messages
+				OrphanMessageL((*iSelection)[a]);
+				}
+
+			// Reget the number of children as this may have changed due to
+			// the orphaning process
+			GetMessageChildrenL(iMailboxId,iSelection);
+			noofchildren=iSelection->Count();
+			}
+
+		// Now, we match the remote's UIDVALIDITY: reset the pointer as it may
+		// well have been used by the orphaning process above.
+		SetEntryL(iMailboxId);
+		if (message.UID()!=iUidValidity || !message.ValidUID())
+			{
+			// Do the change if necessary
+			message.SetUID(iUidValidity);
+			message.SetValidUID(ETrue);
+			ChangeEntryBulkL(message);
+			}
+		}
+
+	// We've processed none of the remote messages yet
+	iMsgsDone=0;
+
+	// Any remote messages? If not, complete now as there's nothing else to do
+	if (iMailboxSize==0)
+		{
+		// This folder is now sync'ed
+		// No need to set seen flags as no messages in remote mailbox
+		SyncCompleteL(); 
+		DBG((LogText(_L8("CImap4Session::DoSynchroniseL(): iMailboxSize=0, folder now synched"))));
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+		DBG((LogText(_L8("CImap4Session::DoSynchroniseL(): calling Complete()"))));
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+
+		Complete(KErrNone);
+		return;
+		}
+
+	// Start the synchronise with sync'ing old messages: are there any
+	// messages in our mirror folder?
+	DBG((LogText(_L8("CImImap4Session::DoSynchroniseL(): Setting iState to EImapStateSynchroniseWait"))));
+ 	iState=EImapStateSynchroniseWait;
+	iSomeUnread=EFalse;
+	iHighestUid=0;
+
+	// Zero the "missing" message range limits.
+	iMissingUidLow=0;
+	iMissingUidHigh=0;
+
+	// Clear RX byte counter
+	iImapIO->RXbytes(ETrue);
+
+	// Any children?
+	iFolderIndex.Reset();
+	if (noofchildren>0) 
+		{
+		// Children exist, we need to do an old-sync to check all the messages
+		// are still there.
+		
+		// Build an index of UIDs/TMsvIds currently in the mirror folder, and
+		// sort this by UID: this is the order in which we expect the fetch to
+		// return UIDs - any missing have been deleted on the server. They may
+		// well not be in UID order in the index because locally-appended
+		// messages will not have been added to the index in UID order.
+		TRAPD(err,MakeSortedFolderIndexL(ETrue));
+		if (err!=KErrNone)
+			{
+			DBG((LogText(_L8("CImap4Session::DoSynchroniseL(): children exist, need to do old sync"))));
+			DBG((LogText(_L8("-----------------------------------------------------------"))));
+			DBG((LogText(_L8("CImap4Session::DoSynchroniseL(): calling Complete()"))));
+			DBG((LogText(_L8("-----------------------------------------------------------"))));
+
+			Complete(err);
+			return;
+			}
+
+		// Find the highest UID in the index
+		iHighestUid=iFolderIndex[noofchildren-1].iUid;
+		}
+
+	// Retrieve folder synchronisation limit.
+	if (iEntry->Entry().Parent()==iServiceId && iEntry->Entry().iDetails.CompareF(KIMAP_INBOX)==0)
+		{
+		DBG((LogText(_L8("Folder sync of inbox folder"))));
+
+		// Leave iSyncLimit at the maximum if a Search String is set
+		// If no Search String is set and this is the inbox, then use the inbox sync limit.
+		if(iServiceSettings->SearchString().Length() == 0)
+			{
+			iSyncLimit=iServiceSettings->InboxSynchronisationLimit();	
+			}
+		}
+	else
+		{
+		// Otherwise use the folder sync limit.
+		// Leave iSyncLimit at the maximum if a Search String is set
+		DBG((LogText(_L8("Folder sync of non-inbox folder"))));
+		
+		if(iServiceSettings->SearchString().Length() == 0)
+			{
+			iSyncLimit=iServiceSettings->MailboxSynchronisationLimit();
+			}
+		}
+		
+	// Get the user defined UID SEARCH string if there is one
+	// Do a refined search if there's a string
+	if(iServiceSettings->SearchString().Length() != 0)
+		{
+		iSyncState=ESyncSearch;
+		iFolderPosition=0;
+		iSearchList->Reset();
+		NewTag();
+		// Refined search
+		_LIT8(KSearchString,"%d UID SEARCH 1:%d %S\r\n");
+		TPtrC8 ptr = iServiceSettings->SearchString();
+		iImapIO->SendL(iStatus,KSearchString,iTag,Min(iMailboxSize,KImapUidSearchSize),&ptr);
+		NewTagSent();
+		return;
+		}
+	else // if no search string we use the old behaviour
+	// Check the folder synchronisation limit.
+	if (iSyncLimit>KImImapSynchroniseNone)
+		{
+		DBG((LogText(_L8("Folder sync limited to %d messages"),iSyncLimit)));
+
+		// Limited folder synchronisation, perform a UID search.
+		iSyncState=ESyncSearch;
+		iFolderPosition=0;
+
+		// Reset the search list.
+		iSearchList->Reset();
+
+		// Perform a UID search on this folder.
+		NewTag();
+		iImapIO->SendL(iStatus,_L8("%d UID SEARCH 1:%d\r\n"),iTag,Min(iMailboxSize,KImapUidSearchSize));
+		NewTagSent();
+		return;
+		}
+	else if (iSyncLimit==KImImapSynchroniseNone)
+		{
+		DBG((LogText(_L8("No folder sync required"))));
+
+		// No synchronisation required.
+		// This folder is now sync'ed
+		SyncCompleteL();
+		// Back to selected state
+		iState=EImapStateSelected;
+		iSyncState=ENotSyncing;
+		DBG((LogText(_L8("CImap4Session::DoSynchroniseL(): iSyncLimit=KImImapSynchroniseNone, no sync required"))));
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+		DBG((LogText(_L8("CImap4Session::DoSynchroniseL(): calling Complete()"))));
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+ 
+		Complete(KErrNone);
+		return;
+		}
+	else if (iSyncLimit<=KImImapSynchroniseAll)
+		{
+		DBG((LogText(_L8("Full folder sync required"))));
+   
+		// Full synchronisation required - fall through.
+		}
+
+	if (noofchildren>0) 
+		{
+		if (!aNewOnly && iHighestUid>0)
+			{
+			// Do old sync
+			iSyncState=ESyncOld;
+			iFolderPosition=0;
+			NewTag();
+			// If a UID Search String is used it looks like this is FULL sync only 
+			// so leave as is
+			iImapIO->SendL(iStatus,_L8("%d UID FETCH 1:%d (UID FLAGS)\r\n"),
+						  iTag,iHighestUid);
+			NewTagSent();
+			return;
+			}
+		}
+
+	// Do new sync
+	SynchroniseNewL();
+	}
+
+void CImImap4Session::ColonSeparatorToSpace(TDes8& buf)
+	{
+	TInt colon;
+	while ((colon = buf.Locate(':')) != KErrNotFound)
+		buf.Replace(colon,1,_L8(" "));
+	buf.TrimRight();
+	}
+
+// Do second stage of sync with uid list, ie new synchronise.
+void CImImap4Session::SynchroniseNewL(const TUint32 aLowUid,const TUint32 aHighUid)
+	{
+        DBG((LogText(_L8("CImImap4Session::SynchroniseNewL()"))));
+ 	iSyncState=ESyncNew;
+	iCheckDiskSpaceCounter = 0;
+	iFolderPosition = 0;
+
+	// First, resize folder index to hold all messages in the folder,
+	// as opposed to the old sync list. This will preserve the old
+	// contents of the index, which is what we want as it's up-to-date
+	// and correct.
+	iFolderIndex.SetSizeL(iMailboxSize);
+	
+	DBG((LogText(_L8("Synchronising new messages (UIDs %u to %u)"),aLowUid,aHighUid)));
+
+	// Create list of priority fields to request
+	TBuf8<256> priorityFields;
+	CDesC8ArrayFlat* array = new(ELeave) CDesC8ArrayFlat(4);
+	CleanupStack::PushL(array);
+	CImcvUtils::PriorityFieldsL(*array);
+	for (TInt i=0; i<array->Count(); i++)
+		{
+		priorityFields.Append((*array)[i]);
+		}
+	CleanupStack::PopAndDestroy(array);
+	ColonSeparatorToSpace(priorityFields);
+	
+	// Send command
+	NewTag();
+
+	// If a UID search string has been specified, the we should create the UID FETCH
+	// string from the UID integer list.
+	if(iServiceSettings->SearchString().Length() != 0)
+		{
+		CreateUidStringL();
+		TPtrC8 ptr(iUidString->Des());
+		iImapIO->SendL(iStatus,KImapFetchSmallHeaderRangeRefined,iTag,&ptr, &priorityFields);
+		}
+	else
+		{
+		iImapIO->SendL(iStatus,KImapFetchSmallHeaderRange,iTag,aLowUid,aHighUid, &priorityFields);
+		}
+	NewTagSent();
+	}
+
+// Do second stage of sync, ie new synchronise.
+void CImImap4Session::SynchroniseNewL()
+	{
+	iSyncState=ESyncNew;
+	iCheckDiskSpaceCounter = 0;
+	iFolderPosition = 0;
+
+	// First, resize folder index to hold all messages in the folder,
+	// as opposed to the old sync list. This will preserve the old
+	// contents of the index, which is what we want as it's up-to-date
+	// and correct.
+	iFolderIndex.SetSizeL(iMailboxSize);
+
+	// fetch just the header of the new mails
+	FetchHeaderL(iHighestUid+1);
+	}
+
+// Build the fetch list
+void CImImap4Session::AddFetchItemL(TMsvId aPart, TImap4GetMailOptions aPartTypes, TBool& aHasTextParts)
+	{
+	DBG((LogText(_L8("AddFetchItemL(id %x, parts=%d)"),aPart,aPartTypes)));
+
+	// Is this part fetchable?
+	SetEntryL(aPart);
+
+	// if the part is complete, then this means everything below it is
+	// complete and therefore we don't need to fetch anything.
+	if ( iEntry->Entry().iType != KUidMsvFolderEntry && iEntry->Entry().Complete()
+		&& !(((TMsvEmailEntry)iEntry->Entry()).PartialDownloaded()))
+		{
+		DBG((LogText(_L8("Skipping, already complete"))));
+
+		// If this is an attachment which has been marked complete because it has
+  		// zero size, we still need to add it to the attachment manager.
+ 		if ((iEntry->Entry().iType == KUidMsvAttachmentEntry ||
+ 		      iEntry->Entry().iType == KUidMsvEmailExternalBodyEntry) &&
+ 		     (iEntry->Entry().iSize == 0))
+ 			{
+ 				DBG((LogText(_L8("Creating zero length attachment"))));
+   				CreateAttachmentInfoL((TMsvEmailEntry&)iEntry->Entry());
+  			}
+
+		return;
+		}
+
+	TBool addChildren = EFalse;
+	TBool addPart = EFalse;
+	
+	TUid type = iEntry->Entry().iType;
+	if (type == KUidMsvFolderEntry || type == KUidMsvMessageEntry)
+		{
+		// don't fetch anything - just let it recurse
+		addChildren = ETrue;
+		}
+	else if (type == KUidMsvEmailTextEntry || type == KUidMsvEmailHtmlEntry)
+		{
+		aHasTextParts = ETrue;
+		
+		if (aPartTypes == EGetImap4EmailBodyText ||
+			aPartTypes == EGetImap4EmailBodyTextAndAttachments ||
+			aPartTypes == EGetImap4EmailBodyAlternativeText)
+			{
+			addPart = ETrue;
+			}
+		}
+	else if (type == KUidMsvAttachmentEntry || type == KUidMsvEmailExternalBodyEntry)
+		{
+		if (aPartTypes == EGetImap4EmailBodyTextAndAttachments ||
+			aPartTypes == EGetImap4EmailAttachments)
+			{
+			addPart = ETrue;
+			}
+		else
+			{
+			SetEntryL(iEntry->Entry().Parent());
+			TImEmailFolderType folderType = static_cast<TMsvEmailEntry>((iEntry->Entry())).MessageFolderType();
+			SetEntryL(aPart);
+			
+			if( folderType==EFolderTypeRelated )
+				{
+			// if asked for bodytext and it is an attachment then
+			// fetch it if attachment is in a folder of
+			// Multipart/Related as it is most likely part of an MHTML
+			// document
+				addPart = ETrue;
+				}
+			else if( ( folderType == EFolderTypeAlternative || folderType == EFolderTypeUnknown ) && aPartTypes == EGetImap4EmailBodyAlternativeText)
+				{
+				// if non-HTML text alternative parts are requested, the alternative
+				// folder is checked and get the mime content type for the part
+				CMsvStore* store = iEntry->ReadStoreL();
+				CleanupStack::PushL(store);
+				CImMimeHeader* mimeHeaders = CImMimeHeader::NewLC();
+				mimeHeaders->RestoreL(*store);
+				
+				if( mimeHeaders->ContentType().CompareF(KMIME_TEXT)==0 )
+					{
+					// This is a alternative text part, and should be treated
+					// as a text part
+					addPart = ETrue;
+					}
+					
+				CleanupStack::PopAndDestroy(2, store); // mimeHeaders, store
+				}
+
+			// Store needs to be closed before calling CreateAttachmentInfoL
+			if(!addPart)
+				{
+				CreateAttachmentInfoL((TMsvEmailEntry&)iEntry->Entry());
+				}		
+			}
+		}
+	else
+		{
+		__ASSERT_DEBUG(0, gPanic(EUnknownMsvType));
+
+		// for anything else, if not debug mode then fetch anyway
+		addPart = ETrue;
+		}
+
+	if (addPart)
+		{
+		iFetchList->AppendL(aPart);
+		
+		// Add this part's size to the size total
+		iProgress.iBytesToDo+=iEntry->Entry().iBioType;
+		}
+	
+	if (addChildren)
+		{
+		// Check the children
+		CMsvEntrySelection *selection=new (ELeave) CMsvEntrySelection;
+		CleanupStack::PushL(selection);
+		GetChildrenL(*selection);
+		
+		DBG((LogText(_L8("...ID %x has %d children"),iEntry->Entry().Id(),selection->Count())));
+		
+		for(TInt a=0;a<selection->Count();a++)
+			{
+			// Process child
+			AddFetchItemL((*selection)[a],aPartTypes,aHasTextParts);
+			}
+		CleanupStack::PopAndDestroy();
+		}
+	}
+
+void CImImap4Session::AddFetchItemL(TMsvId aPart, TImImap4GetPartialMailInfo aGetPartialMailInfo, TBool& aHasTextParts)
+	{
+	DBG((LogText(_L8("AddFetchItemL(id %x, parts=%d)"),aPart,aGetPartialMailInfo.iPartialMailOptions)));
+
+	// Is this part fetchable?
+	SetEntryL(aPart);
+
+	//if the part is complete, then this means everything below it is
+	// complete and therefore we don't need to fetch anything.
+	if (iEntry->Entry().iType != KUidMsvFolderEntry && iEntry->Entry().Complete())
+		{
+		DBG((LogText(_L8("Skipping, already complete"))));
+		// If this is an attachment which has been marked complete because it has
+  		// zero size, we still need to add it to the attachment manager.
+ 		if ((iEntry->Entry().iType == KUidMsvAttachmentEntry ||
+ 		      iEntry->Entry().iType == KUidMsvEmailExternalBodyEntry) &&
+ 		     (iEntry->Entry().iSize == 0))
+ 			{
+ 				DBG((LogText(_L8("Creating zero length attachment"))));
+   				CreateAttachmentInfoL((TMsvEmailEntry&)iEntry->Entry());
+	  		}
+
+		return;
+		}
+
+	TBool addChildren = EFalse;
+	TBool addPart = EFalse;
+	
+	TUid type = iEntry->Entry().iType;
+	if (type == KUidMsvFolderEntry || type == KUidMsvMessageEntry)
+		{
+		// don't fetch anything - just let it recurse
+		addChildren = ETrue;
+		}
+	else if (type == KUidMsvEmailTextEntry) 
+		{
+		aHasTextParts = ETrue;
+		
+		if(aGetPartialMailInfo.iPartialMailOptions == ENoSizeLimits)
+			addPart = ETrue;
+		else if (aGetPartialMailInfo.iPartialMailOptions == ECumulative)
+			{
+			if(iGetPartialMailInfo.iTotalSizeLimit > 0)
+				{
+				addPart = ETrue;
+				iBodyTextSize = iEntry->Entry().iBioType;
+				}
+			}
+		else if (aGetPartialMailInfo.iPartialMailOptions == EBodyTextOnly ||
+				aGetPartialMailInfo.iPartialMailOptions == EBodyTextAndAttachments ||
+				aGetPartialMailInfo.iPartialMailOptions == EBodyAlternativeText )
+			{
+			addPart = ETrue;
+			iBodyTextSize = iEntry->Entry().iBioType;
+			}
+		}
+	else if (type == KUidMsvEmailHtmlEntry)
+		{
+		aHasTextParts = ETrue;
+
+		iHtmlEntrySize = iEntry->Entry().iBioType;
+		if(aGetPartialMailInfo.iPartialMailOptions == ENoSizeLimits)
+			addPart = ETrue;
+		else if (aGetPartialMailInfo.iPartialMailOptions == ECumulative)
+			{
+			if((iGetPartialMailInfo.iTotalSizeLimit > 0 ) && 
+				((iBodyTextSize + iEntry->Entry().iBioType) <= iGetPartialMailInfo.iTotalSizeLimit))
+				{
+				addPart = ETrue;
+				}
+			}
+		else if (aGetPartialMailInfo.iPartialMailOptions == EBodyTextOnly ||
+				aGetPartialMailInfo.iPartialMailOptions == EBodyTextAndAttachments ||
+				aGetPartialMailInfo.iPartialMailOptions == EBodyAlternativeText )
+				
+			{	
+			if(iBodyTextSize + iEntry->Entry().iBioType <=
+				Minimum(iGetPartialMailInfo.iBodyTextSizeLimit,iGetPartialMailInfo.iTotalSizeLimit))
+				{
+				addPart = ETrue;
+				}
+			}
+		// In case of html entry, store html entry id to check later,(when attaching partial footer 
+		// message)if whole body text is downloaded and the html size is not to be downloaded 
+		if(addPart)
+			iHtmlEntryPart = aPart;
+		}
+	else if (type == KUidMsvAttachmentEntry || type == KUidMsvEmailExternalBodyEntry)
+		{
+		
+		if(aGetPartialMailInfo.iPartialMailOptions == ENoSizeLimits)
+			addPart = ETrue;
+		else if (aGetPartialMailInfo.iPartialMailOptions == ECumulative)
+			{
+			if(iGetPartialMailInfo.iTotalSizeLimit > 0 && 
+				((iBodyTextSize + iSizeOfToBeFetchedAttachments + iEntry->Entry().iBioType) <= iGetPartialMailInfo.iTotalSizeLimit))
+				{
+				addPart = ETrue;
+				if((iBodyTextSize + iSizeOfToBeFetchedAttachments + iEntry->Entry().iBioType + iHtmlEntrySize) 
+						>= iGetPartialMailInfo.iTotalSizeLimit)
+					{
+					RemoveHtmlPart(iHtmlEntryPart);
+					}
+				iSizeOfToBeFetchedAttachments+=iEntry->Entry().iBioType;
+				}	
+			else
+				{
+				CreateAttachmentInfoL((TMsvEmailEntry&)iEntry->Entry());
+				// for Ecumulative option ,after the body part downloading, check if there is any 
+				// attachment which can be downloaded , then check if the html part can be included.
+				if((iBodyTextSize + iSizeOfToBeFetchedAttachments + iHtmlEntrySize) >= iGetPartialMailInfo.iTotalSizeLimit)
+					{
+					RemoveHtmlPart(iHtmlEntryPart);
+					}
+				}
+			}
+		else if (aGetPartialMailInfo.iPartialMailOptions == EAttachmentsOnly ||
+				aGetPartialMailInfo.iPartialMailOptions == EBodyTextAndAttachments)
+				
+			{
+			if(iEntry->Entry().iBioType <= 
+				Minimum(iGetPartialMailInfo.iAttachmentSizeLimit,iGetPartialMailInfo.iTotalSizeLimit))
+				{
+				addPart = ETrue;
+				}
+			else
+				{
+				CreateAttachmentInfoL((TMsvEmailEntry&)iEntry->Entry());
+				}
+			}
+		else
+			{
+			SetEntryL(iEntry->Entry().Parent());
+			TImEmailFolderType folderType = static_cast<TMsvEmailEntry>((iEntry->Entry())).MessageFolderType();
+			SetEntryL(aPart);
+			
+			if( folderType==EFolderTypeRelated )
+				{
+				// if asked for bodytext and it is an attachment then
+				// fetch it if attachment is in a folder of
+				// Multipart/Related as it is most likely part of an MHTML
+				// document
+				addPart = ETrue;
+				}
+			else if( folderType==EFolderTypeAlternative && 
+					 aGetPartialMailInfo.iPartialMailOptions==EBodyAlternativeText &&
+					 iEntry->Entry().iBioType <= Minimum(iGetPartialMailInfo.iAttachmentSizeLimit,
+					 									 iGetPartialMailInfo.iTotalSizeLimit) )
+				{
+				// if non-HTML text alternative parts are requested, the alternative
+				// folder is checked and get the mime content type for the part
+				CMsvStore* store = iEntry->ReadStoreL();
+				CleanupStack::PushL(store);
+				CImMimeHeader* mimeHeaders = CImMimeHeader::NewLC();
+				mimeHeaders->RestoreL(*store);
+				
+				if( mimeHeaders->ContentType().CompareF(KMIME_TEXT)==0 )
+					{
+					// This is a alternative text part, and should be treated
+					// as a text part
+					addPart = ETrue;
+					}
+					
+				CleanupStack::PopAndDestroy(2, store); // mimeHeaders, store
+				}
+				
+			if(!addPart)
+				{
+				CreateAttachmentInfoL((TMsvEmailEntry&)iEntry->Entry());
+				}
+			}
+		}
+	else
+		{
+		__ASSERT_DEBUG(0, gPanic(EUnknownMsvType));
+
+		// for anything else, if not debug mode then fetch anyway
+		addPart = ETrue;
+		}
+
+	if (addPart)
+		{
+		iFetchList->AppendL(aPart);
+		// Add this part's size to the size total
+		iProgress.iBytesToDo+=iEntry->Entry().iBioType;
+		}
+
+	if (addChildren)
+		{
+		// Check the children
+		CMsvEntrySelection *selection=new (ELeave) CMsvEntrySelection;
+		CleanupStack::PushL(selection);
+		GetChildrenL(*selection);
+			
+		DBG((LogText(_L8("...ID %x has %d children"),iEntry->Entry().Id(),selection->Count())));
+		
+		for(TInt a=0;a<selection->Count();a++)
+			{
+			// Process child
+			AddFetchItemL((*selection)[a],aGetPartialMailInfo,aHasTextParts);
+			}
+		CleanupStack::PopAndDestroy();
+		}
+	}
+
+void CImImap4Session::RemoveHtmlPart(TMsvId aPart)
+	{
+	// removes the html part from the download list only if it exists in the list
+	if(aPart)
+		{
+		TInt aIndex = 0;
+		TKeyArrayFix sortKey(0, ECmpTInt32);
+		iFetchList->Find(aPart,sortKey,aIndex);
+		iFetchList->Delete(aIndex,1);
+		iHtmlEntryPart=0;
+		}
+	}
+
+// Checks for the minimum size limit between message type size limit 
+// (attachment size limit/body text sizelimit)
+TInt32 CImImap4Session::Minimum(TInt32 aThisPartTypeSizeLimit,TInt32 aTotalMailSizeLimit)
+	{
+	if(aTotalMailSizeLimit > 0)
+		{
+		if(aThisPartTypeSizeLimit > aTotalMailSizeLimit)
+			return aTotalMailSizeLimit;
+		else
+			return aThisPartTypeSizeLimit;
+		}
+	else
+		return aThisPartTypeSizeLimit;
+	}
+
+// Issue command to fetch an item in the fetch list
+void CImImap4Session::FetchAnItemL(const TMsvId aPart)
+	{
+	DBG((LogText(_L8("FetchAnItemL(%x)"),aPart)));
+
+	// set the iFoundUid member variable to false to show that a UID has not been
+	// found in the fetch response yet
+	iFoundUid = EFalse;
+
+	// Get part ID and read the MIME header so we can work out encoding style
+	iMessageId=aPart;
+	SetEntryL(iMessageId);
+	CMsvStore *store=iEntry->ReadStoreL();
+	CleanupStack::PushL(store);
+	
+	iIsDiskSpaceChecked = EFalse;
+	// Get MIME header
+	if (!iAttachmentMimeInfo)
+		iAttachmentMimeInfo=CImMimeHeader::NewL();
+	iAttachmentMimeInfo->RestoreL(*store);
+		
+
+	// We don't reset the stats here, as they're stats for a single
+	// fetch operation, which may include multiple parts of the same
+	// message. Stats initialisation is done in the FetchBody()
+	// function.
+
+	// Find the UID we need to fetch
+	TMsvEmailEntry entry = iEntry->Entry();
+	iMessageFetching=entry.UID();
+
+	// check there is enough disk space for this part (plus slop)
+	// iBioType contains remote size which will never be less than the
+	// local size so is a safe value to use
+	if(!iFetchPartialMail)
+		{
+		CheckForDiskSpaceL(entry.iBioType);
+		}
+
+	// Save encoding type
+	iEncodingType=iAttachmentMimeInfo->ContentTransferEncoding();
+	iB64Decoder.Initialise();
+
+	// Clear QP buffer
+	if (iPartialLine && iPartialLine->Length())
+		iPartialLine->Des().Zero();
+
+	// Is this a text fetch? (if so, save as a richtext in the database, as
+	// opposed to a separate file). Default to being an attachment.
+
+	// SJM: This code used to check for an attachment filename and
+	// force FetchIsTest False in that case. This is unnecessary as
+	// this check is already done in BuildTreeOne and reflected in the
+	// entry.iType.
+
+	iFetchIsText = EFalse;
+	if (entry.iType == KUidMsvEmailTextEntry)
+		{
+		iFetchIsText = ETrue;
+		// New message body
+		if (iStore8BitData)
+			{
+			delete iBodyBuf;
+			iBodyBuf = NULL;
+			iBodyBuf = CBufSeg::NewL(KBodyTextChunkSizeBytes);
+			delete iBodyText;
+			iBodyText = NULL;
+			iBodyText = CMsvBodyText::NewL();
+			}
+		else
+			{
+			delete iMessageBody;
+			iMessageBody = NULL;
+			iMessageBody=CRichText::NewL(iParaLayer, iCharLayer);
+			}
+		}
+
+	// Waiting for size
+	iSizeWait=ETrue;
+
+	// Size of item (mainly for CC:Mail bug workaround) */
+	iSizeOfThisPart=entry.iBioType;
+
+	// if going into richtext only then setup charset conversion
+	iPreparedToConvert=EFalse;
+	TInt fetchSizeBytes = static_cast<TInt>(iServiceSettings->FetchSize()); 
+	// If this was a partially fetched message then there is some already fetched 
+	// message content in the message store
+	TInt32 fetchSize = fetchSizeBytes;
+
+	if (iFetchIsText)
+		{
+
+		TUint charsetId = iAttachmentMimeInfo->MimeCharset();
+		
+		if (iStore8BitData)
+			{
+			iBodyText->SetDefaultCharacterSet(iCharConv->SystemDefaultCharset());
+			if (charsetId == KUidMsvCharsetNone)
+				iBodyText->SetCharacterSet(0);
+			else
+				iBodyText->SetCharacterSet(charsetId);
+			}
+		else
+			{
+			if (charsetId == KUidMsvCharsetNone)
+				charsetId = iCharConv->SystemDefaultCharset();
+			}
+		
+		iAttachmentMimeInfo->SetMimeCharset(charsetId);
+		if (!iStore8BitData)
+			{
+			if (charsetId != KUidMsvCharsetNone)
+				iPreparedToConvert = iCharConv->PrepareToConvertToFromOurCharsetL(charsetId);
+			}
+		}
+
+	// ensure nothing left over
+	iLeftOver.SetLength(0);
+
+	DBG((LogText(_L8("Starting fetch for body part (MsvId=%x, iSizeOfThisPart=%d, iFetchIsText=%d, convert=%d)"),
+				 iMessageId,iSizeOfThisPart,iFetchIsText, iPreparedToConvert)));
+
+	// Issue fetch command
+	NewTag();
+	TPtrC8 path=iAttachmentMimeInfo->RelativePath();
+
+	if(iFetchPartialMail)
+		fetchSize = GetFetchSizeL(iSizeOfThisPart,0); // As this is the first time 0 size downloaded already
+
+	if(fetchSize > fetchSizeBytes)
+		fetchSize = fetchSizeBytes;
+	
+	//Some servers dont support MIME.And it contains single body type.
+	//Using KImapFetchBodyPeek/KImapFetchBody to fetch the body of mails.
+	if(iProgress.iPartsToDo == 1)
+		{
+		if (iServiceSettings->UpdatingSeenFlags())
+			{
+			iImapIO->SendL(iStatus,KImapFetchBodyPeek, iTag,iMessageFetching,&path,0,fetchSize);
+			}
+		else
+			{
+			iImapIO->SendL(iStatus,KImapFetchBody, iTag,iMessageFetching,&path,0,fetchSize);
+			}
+		}
+	else
+		{
+		if (iServiceSettings->UpdatingSeenFlags())
+			{
+			iImapIO->SendL(iStatus,KImapFetchMimeBodyPeek, iTag,iMessageFetching,&path,fetchSize,&path);	
+			}		
+		else
+			{
+			iImapIO->SendL(iStatus,KImapFetchMimeBody, iTag,iMessageFetching,&path,fetchSize,&path);
+			}
+		}
+	NewTagSent();
+	CleanupStack::PopAndDestroy();
+	}
+
+void CImImap4Session::CheckForDiskSpaceL(TInt aSizeToBeDownloaded)
+	{
+	TInt needSpace = 0;
+	TVolumeInfo volumeInfo;
+	User::LeaveIfError(iFs.Volume(volumeInfo, iCurrentDrive));
+
+	needSpace = KMinimumDiskSpaceForSync + aSizeToBeDownloaded;
+	if (volumeInfo.iFree < needSpace)
+		User::Leave(KErrDiskFull);
+	}
+
+// Fetch body for partial download
+void CImImap4Session::FetchBody(TRequestStatus& aRequestStatus, const TMsvId aPart,
+								TImImap4GetPartialMailInfo aGetPartialMailInfo)
+	{
+	LOG_COMMANDS((LogText(_L8("COMMAND FetchBody(%x)"),aPart)));
+	TInt err=KErrNone;
+
+	CheckForPartialPopulate(aGetPartialMailInfo);
+	if (!Connected())
+		{
+		Queue(aRequestStatus);
+		err=KErrDisconnected;
+		}
+	else
+		{
+		TRAP(err,FetchBodyL(aRequestStatus, aPart));
+		}
+	if (err!=KErrNone)
+                {
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+		DBG((LogText(_L8("CImap4Session::FetchBody(): calling Complete()"))));
+		DBG((LogText(_L8("-----------------------------------------------------------"))));
+
+
+		Complete(err);
+                }
+	}
+
+// Checks if the partial mail download parameters are set to default 
+// and the full download mail option is set, then this is a request for full download. 
+void CImImap4Session::CheckForPartialPopulate(TImImap4GetPartialMailInfo aGetPartialMailInfo)
+	{
+	if(aGetPartialMailInfo.iPartialMailOptions == ENoSizeLimits &&
+		aGetPartialMailInfo.iTotalSizeLimit == KMaxTInt &&
+		aGetPartialMailInfo.iBodyTextSizeLimit == KMaxTInt && 
+		aGetPartialMailInfo.iAttachmentSizeLimit == KMaxTInt && 
+		(aGetPartialMailInfo.iGetMailBodyParts == EGetImap4EmailHeaders || 
+		aGetPartialMailInfo.iGetMailBodyParts == EGetImap4EmailBodyText ||
+		aGetPartialMailInfo.iGetMailBodyParts == EGetImap4EmailBodyTextAndAttachments ||
+		aGetPartialMailInfo.iGetMailBodyParts == EGetImap4EmailAttachments ||
+		aGetPartialMailInfo.iGetMailBodyParts == EGetImap4EmailBodyAlternativeText))
+		{
+		DBG((LogText(_L8("Populate option = %d)"),aGetPartialMailInfo.iGetMailBodyParts)));
+		iFetchPartialMail = EFalse;
+		iGetOptions = aGetPartialMailInfo.iGetMailBodyParts;
+		}
+	else
+		{
+		DBG((LogText(_L8("Populate option = %d)"),aGetPartialMailInfo.iPartialMailOptions)));
+		iFetchPartialMail = ETrue;
+		iGetPartialMailInfo = aGetPartialMailInfo;
+		}
+	}
+
+void CImImap4Session::FetchBodyL(TRequestStatus& aRequestStatus, const TMsvId aPart)
+	{
+	__ASSERT_DEBUG(iState==EImapStateSelected,gPanic(EFetchWhenNotSelected));
+	if(!(iState==EImapStateSelected))
+		{
+		User::LeaveIfError(KErrArgument);// Fetch when not selected .
+		}
+	iGetPart = aPart;
+	
+	Queue(aRequestStatus);
+
+	// if we only want headers then there is nothing to do as they
+	// have already been fetched on synchronisation. We complete here
+	// and then the Compound object will copy the structure across
+	if(!iFetchPartialMail)
+		{
+		if (iGetOptions == EGetImap4EmailHeaders)
+			{
+                        DBG((LogText(_L8("-----------------------------------------------------------"))));
+			DBG((LogText(_L8("CImap4Session::FetchBodyL(): calling Complete()"))));
+			DBG((LogText(_L8("-----------------------------------------------------------"))));
+
+			Complete(KErrNone);
+			return;
+			}
+		}
+	// Get some basic info on what we're fetching
+	SetEntryL(aPart);
+
+	// First, check that we're in the right folder: this involves working up from the
+	// base part looking for a folder which matches the current iMailboxId. If we get
+	// to the service without finding the current folder, then we're not in the
+	// right place...
+  	TBool messageFound = EFalse;
+  	while((iEntry->Entry().Id()!=iMailboxId) && (!messageFound))
+		{
+		// Reached the service?
+		if (iEntry->Entry().iType==KUidMsvServiceEntry)
+			{
+			// Didn't find the folder - we must have the wrong one selected
+			Complete(KErrImapWrongFolder);
+
+			DBG((LogText(_L8("In the wrong folder!"))));
+
+			return;
+			}
+
+		// Reached the message ?
+		if (iEntry->Entry().iType==KUidMsvMessageEntry)
+			{
+			iMessageUid = ((TMsvEmailEntry&)iEntry->Entry()).UID();
+ 			iSyncState = EGettingStructure;
+  			iState = EImapStateFetchWait;
+  			if (!(iEntry->Entry().Owner()))
+  				{
+  				// If there are no child entries then we need to fetch the envelope and some headers (again.)
+  				// We can generate the message structure and header stores from the envelope and headers after they have been fetched.
+  				if (ImapIdleSupported()==EFalse)
+					{
+					CancelDummy();
+					}
+  				// We don't know the size of the body part yet as there is no structure.
+  				// The envelope will be fetched shortly so clear the progress information for now.
+  				// Set the iBytesToDo to 1 rather than 0 to avoid any possible division by 0 errors
+  				iProgress.iBytesToDo=1;
+  				iProgress.iBytesDone=0;
+  				FetchLargeHeaderL(iMessageUid, EFalse);
+  				}
+  			else
+  				{
+  				// If the structure is already present then do the fetch
+  				if (ImapIdleSupported()==EFalse)
+					{
+					CancelDummy();
+					}
+  				DoFetchL();
+  				messageFound = ETrue;
+  				}
+   			}
+
+		// Up a level
+		SetEntryL(iEntry->Entry().Parent());
+		}
+	}
+
+// Set/reset local subscribed flag
+void CImImap4Session::LocalSubscribeL(const TMsvId aTarget, const TBool aSubscribe)
+	{
+	LOG_COMMANDS((LogText(_L8("COMMAND LocalSubscribe(%d,%d)"),aTarget,aSubscribe)));
+
+	// Set/reset subscribed flag
+	SetEntryL(aTarget);
+	TMsvEmailEntry message=iEntry->Entry();
+
+	// Change only if necessary
+	if (message.Subscribed()!=aSubscribe)
+		{
+		message.SetSubscribed(aSubscribe);
+		ChangeEntryL(message);
+		}
+	}
+
+// Set/reset remote subscribed flag
+void CImImap4Session::RemoteSubscribeL(TRequestStatus& aRequestStatus, const TMsvId aTarget, const TBool aSubscribe)
+	{
+	LOG_COMMANDS((LogText(_L8("COMMAND RemoteSubscribe(%d,%d)"),aTarget,aSubscribe)));
+	__ASSERT_DEBUG(iState==EImapStateNoSelect || iState==EImapStateSelected,gPanic(ESubscribeWhenNotReady));
+	if(!(iState==EImapStateNoSelect || iState==EImapStateSelected))
+		{
+		User::LeaveIfError(KErrInUse);// Subscribe when not ready.
+		}
+	Queue(aRequestStatus);
+	
+	// Save ID for updating subscription flag when the remote one completes
+	// successfully.
+	iCommandIds[0]=aTarget;
+	iCommandFlags[0]=aSubscribe;
+
+	// Get path to delete
+	HBufC8* path=NULL; // To stop .AER warnings...
+	TRAPD(err,path=MakePathL(aTarget,ETrue));
+	if (err!=KErrNone)
+		{
+		Complete(err);
+		return;
+		}
+	CleanupStack::PushL(path);
+	DoQuoteL(path);
+
+	// Set state
+	iSavedState=iState;
+	iState=EImapStateSubscribeWait;
+
+	// Send command
+	NewTag();
+	TPtrC8 pathdes(path->Des());
+	if(aSubscribe)
+		iImapIO->SendL(iStatus,_L8("%d %S\"%S\"\r\n"),iTag,&KIMAPC_SUBSCRIBE,&pathdes);
+	else
+		iImapIO->SendL(iStatus,_L8("%d %S\"%S\"\r\n"),iTag,&KIMAPC_UNSUBSCRIBE,&pathdes);
+	NewTagSent();
+
+	// Destroy buffer
+	CleanupStack::PopAndDestroy();
+	}
+
+// Reset sync/fetch stats
+void CImImap4Session::ResetStats()
+	{
+	// Reset all the stats
+	iHeadersFetched=0;
+	iOrphanedMessages=0;
+	iRemoteMessagesDeleteTagged=0;
+	iMsgsDone=0;
+
+	iProgress.iState = TImap4GenericProgress::EIdle;
+	iProgress.iImap4SubStateProgress = TImap4GenericProgress::EIdle;
+	iProgress.iMsgsToDo = iProgress.iMsgsDone = 0;
+	iProgress.iPartsToDo = iProgress.iPartsDone = 0;
+	iProgress.iBytesToDo = iProgress.iBytesDone = 0;
+	iProgress.iErrorCode = KErrNone;
+	iProgress.iReturnedMsvId = 0;
+	iProgress.iTotalSize = 0;
+	}
+
+// Return progress
+
+// Msgs ToDo/Done are only setup when doing a Synchronise command, ie
+// in state EImapStateSynchroniseWait.
+
+// Parts/Bytes ToDo/Done are set up and used in a FetchBody command,
+// ie in state EImapStateFetchWait.
+
+// BytesToDo/Done are used in Append command.
+
+void CImImap4Session::IncSyncStats(TImap4SyncProgress& aSync)
+	{
+	// do the synchronising stats
+	aSync.iHeadersFetched += iHeadersFetched;
+	aSync.iOrphanedMessages += iOrphanedMessages;
+	aSync.iRemoteMessagesDeleteTagged += iRemoteMessagesDeleteTagged;
+
+	if(iServiceSettings->SearchString().Length() != 0)
+		{
+		aSync.iMsgsToDo=iMailboxSize;	
+		}
+	else
+		{
+		aSync.iMsgsToDo=(iSyncLimit<=0)?iMailboxSize:Min(iMailboxSize,iSyncLimit);	
+		}
+	aSync.iMsgsDone = Min(iMsgsDone,aSync.iMsgsToDo);
+	}
+
+TImap4GenericProgress CImImap4Session::Progress()
+	{
+	// update the state with what we're doing
+	if (iState==EImapStateDisconnected)
+		{
+		iProgress.iState=TImap4GenericProgress::EDisconnected;
+		}
+	else if (iState<EImapStateNoSelect)
+		{
+		iProgress.iState = TImap4GenericProgress::EConnecting;
+		// If we're in the connecting state, get the stage and IAP values
+		//  and store them in iMsgsDone and iMsgsToDo to be accessed via
+		//  TImap4GenericProgress::ConnectionState() and TImap4GenericProgress::ConnectionIAP()
+		iProgress.iMsgsDone = iImapIO->GetConnectionStage();
+		TUint32 iap;
+		TInt err = iImapIO->GetIAPValue(iap);
+		if (err == KErrNone)
+			{
+			iProgress.iMsgsToDo = iap;
+			}
+		else
+			{
+			iProgress.iMsgsToDo = err;
+			}
+		}
+	else if (iState==EImapStateNoSelect || iState==EImapStateSelected || iState==EImapStateIdling)
+		{
+		iProgress.iState=TImap4GenericProgress::EIdle;
+		}
+	else
+		{
+		switch(iState)
+			{
+		case EImapStateFetchWait:
+			iProgress.iState=TImap4GenericProgress::EFetching;
+			break;
+
+		case EImapStateAppendSizeWait:
+		case EImapStateAppendPromptWait:
+		case EImapStateAppendWait:
+		case EImapStateAppendResultWait:
+			iProgress.iState=TImap4GenericProgress::EAppending;
+			break;
+
+		case EImapStateSynchroniseWait:
+			iProgress.iState=TImap4GenericProgress::ESyncing;
+			break;
+
+		case EImapStateLogoutWait:
+			iProgress.iState=TImap4GenericProgress::EDisconnecting;
+			break;
+
+		case EImapStateDeleteWait:
+		case EImapStateDeleteAllWait:
+		case EImapStateDeleteFolderWait:
+		case EImapStateDeleteMarkWait:
+		case EImapStateExpungeWait:
+		case EImapStateExpungeAllWait:
+			iProgress.iState = TImap4GenericProgress::EDeleting;
+			break;
+
+		case EImapStateSelectWait:
+			iProgress.iState = TImap4GenericProgress::ESelecting;
+			break;
+
+		default:
+			// Just 'busy' otherwise
+			iProgress.iState=TImap4GenericProgress::EBusy;
+			break;
+			}
+		}
+
+	return iProgress;
+	}
+
+// Set entry pointer
+void CImImap4Session::SetEntry(CMsvServerEntry *aEntry)
+	{
+	// Take note of this CMsvServerEntry
+	iEntry=aEntry;
+
+	// Park entry
+	iEntry->SetEntry(NULL);
+	}
+
+// Park entries
+void CImImap4Session::Park()
+	{
+	// Park normal entry
+	iEntry->SetEntry(NULL);
+
+	// Park moveentry if it exists
+	if (iMoveEntry) iMoveEntry->SetEntry(NULL);
+	}
+
+TInt CImImap4Session::CommandFailure() const
+	{
+	return iCommandFailure;
+	}
+
+void CImImap4Session::FetchHeaderL(TUint aUid)
+	{
+	iFolderIndex.SetSizeL(iMailboxSize);
+
+	// Create list of priority fields to request
+	TBuf8<256> priorityFields;
+	CDesC8ArrayFlat* array = new(ELeave) CDesC8ArrayFlat(4);
+	CleanupStack::PushL(array);
+	CImcvUtils::PriorityFieldsL(*array);
+	for (TInt i=0; i<array->Count(); i++)
+		{
+		priorityFields.Append((*array)[i]);
+		}
+	CleanupStack::PopAndDestroy(array);
+	ColonSeparatorToSpace(priorityFields);
+
+	NewTag();
+	
+	iImapIO->SendL(iStatus, KImapFetchSmallHeaderToEnd,iTag,aUid, &priorityFields);	  	
+  	NewTagSent();
+	}
+
+void CImImap4Session::FetchLargeHeaderL(TUint aUid, TBool aRange)
+ 	{
+  	// First, resize folder index to hold all messages in the folder,
+  	// as opposed to the old sync list. This will preserve the old
+  	// contents of the index, which is what we want as it's up-to-date
+  	// and correct.
+	iFolderIndex.SetSizeL(iMailboxSize);
+
+  	// build list of header fields we want note that
+  	// ReceiptFieldStrings returns strings colon terminated which we
+  	// convert to spaces for the fetch
+  	TBuf8<256> buf;
+  
+  	CDesC8ArrayFlat* array = new(ELeave) CDesC8ArrayFlat(4);
+  	CleanupStack::PushL(array);
+  
+  	CImcvUtils::ReceiptFieldsL(*array);
+  	TInt i;
+  	for (i=0; i<array->Count(); i++)
+  		buf.Append((*array)[i]);
+  
+  	CImcvUtils::PriorityFieldsL(*array);
+  	for (i=0; i<array->Count(); i++)
+  		buf.Append((*array)[i]);
+  
+  	CleanupStack::PopAndDestroy(); // array
+  
+  	ColonSeparatorToSpace(buf);
+  	
+  	// Send command
+  	NewTag();
+  	if (!aRange)
+  		{
+  		// We only want one envelope
+  		iImapIO->SendL(iStatus, KImapFetchLargeHeader, iTag, aUid, &buf);
+  		}
+  	else
+  		{
+		// If a UID search string has been specified, then we should create the UID FETCH
+		// string from the UID integer list.
+		if(iServiceSettings->SearchString().Length() !=0)
+			{
+			CreateUidStringL();
+			TPtrC8 ptr(iUidString->Des());
+ 			iImapIO->SendL(iStatus, KImapFetchLargeHeaderRangeRefined,iTag,&ptr,&buf);
+ 			}
+ 		else
+ 			{
+	  		iImapIO->SendL(iStatus, KImapFetchLargeHeaderRange,iTag,aUid, &buf);
+ 			}		
+  		}
+  	NewTagSent();
+   	}
+ 
+void CImImap4Session::DoFetchL()
+ 	{
+	DBG((LogText(_L8("CImap4Session::DoFetchL(): running..."))));
+
+ 	User::LeaveIfError(iEntry->SetEntry(iGetPart));
+ 	TUid type=iEntry->Entry().iType;
+ 
+ 	// if we are not asking for a Message type then override the get
+	// options to ensure that this is fetched
+ 	if(!iFetchPartialMail)
+		{
+		if (type != KUidMsvMessageEntry)
+ 			iGetOptions = EGetImap4EmailBodyTextAndAttachments;
+		}
+ 
+ 	User::LeaveIfError(iEntry->SetEntry(iServiceId));
+ 				
+ 	// What have we been asked to fetch? Build a list of parts to fetch: if the
+ 	// part requested has any children, that is.
+ 	// Reset stats
+ 	iProgress.iBytesToDo=0;
+ 	iProgress.iBytesDone=0;
+ 	iFetchList->Reset();
+	iHtmlEntryPart = 0;
+	iBodyTextSize = 0;
+	iHtmlEntrySize = 0;
+	iBodyPartRemainingSize = 0;
+	iFooterString = NULL;
+	iSizeOfToBeFetchedAttachments=0;
+	TBool hasTextParts = EFalse;
+	if(iFetchPartialMail)
+		{
+		DBG((LogText(_L8("Using partial mail options"))));
+		AddFetchItemL(iGetPart,iGetPartialMailInfo,hasTextParts);
+		DBG((LogText(_L8("Found %d parts to fetch (options=%d)"),iFetchList->Count(),iGetPartialMailInfo.iPartialMailOptions)));
+		}
+	else
+		{
+ 		AddFetchItemL(iGetPart,iGetOptions,hasTextParts);
+		DBG((LogText(_L8("Found %d parts to fetch (options=%d)"),iFetchList->Count(),iGetOptions)));
+		}
+		
+	if( !hasTextParts && type == KUidMsvMessageEntry )
+		{
+		// There are no text parts to this message - need to set body text 
+		// complete flag to true otherwise UI may allow such a message to 
+		// repeatedly be 'fetched' even though there is no text to fetch!
+		//
+		// So, set body text complete and message complete flags on the entry
+		// specified by iGetPart.
+		DBG((LogText(_L8("Message %d has no text parts - setting complete flag and body text complete flag to ETrue"),iGetPart)));
+
+	 	User::LeaveIfError(iEntry->SetEntry(iGetPart));
+		TMsvEmailEntry message = iEntry->Entry();
+
+		message.SetBodyTextComplete(ETrue);
+		
+		ChangeEntryL(message);
+
+		// NOTE - not sure if necessary, but changing back to service entry to 
+		// ensure consistent behaviour.
+	 	User::LeaveIfError(iEntry->SetEntry(iServiceId));
+		}
+		
+	// Any parts at all?
+ 	if (iFetchList->Count() == 0 || iState == EImapStateFetchCancelWait)
+ 		{
+ 		// No, complete the fetch.
+ 		if( iState != EImapStateFetchCancelWait )
+ 			{
+			iState=EImapStateSelectWait;
+			iSyncState=ENotSyncing;
+ 			}
+		
+ 		if( iCommandsOutstanding )
+ 			{
+ 			// Waiting for tagged response for fetch command that got the
+ 			// email structure
+	 		GetReply(EFalse);
+ 			}
+ 		else
+ 			{
+ 			// Message structure already known - therefore not waiting for the
+ 			// tagged response, complete immediately
+ 			CommandCompleteL(KErrNone);
+ 			}
+ 		return;
+ 		}
+ 
+ 	// Part count for stats
+ 	if (iFetchList->Count() > 0)
+ 		{
+ 		iProgress.iPartsToDo=iFetchList->Count();
+ 		iProgress.iPartsDone=0;
+ 
+ 		// Do the fetch
+ 		iState=EImapStateFetchWait;
+ 		iSyncState=EFetching;
+ 
+ 		DBG((LogText(_L8("Starting body fetch of %d parts (%d bytes)"),
+ 					 iProgress.iPartsToDo,iProgress.iBytesToDo)));
+ 
+ 		// Make the command to send to the server
+ 		FetchAnItemL((*iFetchList)[0]);
+ 		iFetchList->Delete(0,1);
+ 		}
+
+	}
+
+TInt CImImap4Session::CalculateDownloadSizeL(const CMsvEntrySelection& aSelection)
+	{
+	TInt totalSize = 0;
+
+	// Do a quick tally on the size of messages which are to be copied / moved.
+	TInt count=aSelection.Count();
+	while (count--)
+		{
+		SetEntryL(aSelection.At(count));
+		// Only add the size up if the message is not complete.
+		if(!iEntry->Entry().Complete())
+			{
+			totalSize += iEntry->Entry().iSize;
+			}
+		}
+	return totalSize;
+	}
+
+void CImImap4Session::SetSynchronisationSelectionL(CMsvEntrySelection &aSelection)
+	{
+	// Used by the server mtm to prevent any messages selected for retrieval
+	// from being deleted during a synchronisation with a synchronisation limit set.
+	delete iSynchronisationSelection;
+	iSynchronisationSelection = 0;
+	iSynchronisationSelection = aSelection.CopyL();
+	}
+
+void CImImap4Session::SetInbox(TMsvId aInbox)
+	{
+	iInbox=aInbox;
+	}
+
+TMsvId CImImap4Session::GetInbox()
+	{
+	return iInbox;
+	}
+
+// Set or clear the \Seen flags on the server (aSettingsFlag = ETrue -> Sets the flag)
+// Returns False if no messages need to be processed
+TBool CImImap4Session::ProcessSeenFlagsL(TSeenFlagUpdateMode aUpdateMode)
+	{
+	CArrayFixFlat<TMsvId>* pendingList;
+	TBool settingFlag = (aUpdateMode == ESetSeenFlag);
+
+	// Point pendingList to the correct list
+	pendingList = (settingFlag ? iSetSeenList: iClearSeenList);
+	
+	// Exit if nothing to process
+	if (!pendingList->Count())
+		{
+		return EFalse;
+		}
+	
+	#ifdef PRINTING
+		_LIT8(KCommandProcessFlags, "COMMAND ProcessSeenFlags(%d)");
+		LOG_COMMANDS((LogText(KCommandProcessFlags, aUpdateMode)));
+	#endif
+
+	_LIT8(KStoreFlagsSetCommand, "%d UID STORE %S +FLAGS (\\Seen)\r\n");
+	_LIT8(KStoreFlagsClearCommand, "%d UID STORE %S -FLAGS (\\Seen)\r\n");
+	const TInt KMaxUIDsToProcess = 50;
+	const TInt KMaxCharsPerUID = 12;
+
+	// Ensure that the buffer passed to CImapIO does not exceed 1024
+	__ASSERT_DEBUG(KMaxUIDsToProcess * KMaxCharsPerUID < 1024 - (KStoreFlagsSetCommand().Length() + 10), gPanic(KMaxBufferLengthExceeded));
+
+	TInt pos = 0;
+	TInt stored = 0;
+	TInt run = 0;
+	TInt UID;
+	TInt lastUID = -1;
+	TInt listCount = pendingList->Count();
+	TBool haveSentCommand = EFalse;
+	TMsvEmailEntry message;
+	HBufC8* command=HBufC8::NewLC(KMaxUIDsToProcess * KMaxCharsPerUID);
+	TPtr8 commandDes = command->Des();
+
+	// Build up a list of UID's who's \Seen flag needs changing.
+	// To save bandwidth, group contiguous blocks of UID's together,
+	// e.g. 1:6,8:12,14 instead of 1,2,3,4,5,6,8,9,10,12,14
+	while(pos < listCount && stored < KMaxUIDsToProcess)
+		{
+		SetEntryL(pendingList->At(pos));
+		message = iEntry->Entry();
+		UID = static_cast<TInt>(message.UID());
+
+		// Should never have the state when the list contains flags that match the servers flag
+		__ASSERT_DEBUG(FIXBOOL(message.Unread()) != settingFlag, gPanic(KSettingSeenFlagToExistingState));
+
+		// Set the Seen flag for the message
+		message.SetSeenIMAP4Flag(settingFlag);
+		ChangeEntryL(message);
+		// If not first time through and the UID follows the previous one
+		if (pos !=0 && UID == lastUID+1)
+			{
+			// We are in a run
+			run++;
+			}
+		else
+			{
+			// If we were in a run
+			if (run)
+				{
+				// Append a ':' followed by the UID at the end of the run
+				commandDes.Append(TChar(':'));
+				commandDes.AppendNum(lastUID);
+				stored++;
+				// Reset the run count
+				run = 0;
+				}
+			// Append ',' only if not the first time through
+			if (pos!=0)
+				{
+				commandDes.Append(TChar(','));
+				}
+			// Append the current UID
+			commandDes.AppendNum(UID);
+			stored++;
+			}
+		// Next message
+		pos++;
+		lastUID = UID;
+		} // end while
+
+	// If we are at the end of the list but still in a run, add the last uid to the command buffer
+	if (run)
+		{
+		commandDes.Append(TChar(':'));
+		commandDes.AppendNum(lastUID);
+		}
+
+	// Anything stored?
+	if (stored)
+		{
+		// Get a new tag
+		NewTag();
+
+		if (settingFlag)
+			iImapIO->SendL(iStatus,KStoreFlagsSetCommand, iTag, command);
+		else
+			iImapIO->SendL(iStatus,KStoreFlagsClearCommand, iTag, command);
+
+		// Send the command
+		NewTagSent();
+		// Remove the processed flags from the list (pos = num_to_remove)
+		pendingList->Delete(0, pos);
+		haveSentCommand = ETrue;
+		}
+	else
+		{
+		// Should never have the state when the list contained flags but we never sent the 'STORE FLAGS' command to the server
+		__ASSERT_DEBUG(FIXBOOL(message.Unread()) != settingFlag, gPanic(KErrorBuildingStoreFlagsCommand));
+		}
+
+	// Get rid of command buffer
+	CleanupStack::PopAndDestroy(command);
+	return haveSentCommand;
+	}
+// Creates an IMAP4 defined optimised string of UIDs from the integer list of UIDs
+// retrieved by the UID SEARCH command.
+// Example: If the input array is 123 125 126 127 300 302 303 304 308
+// The output string will be "123,125:127,300,302,303:304,308
+// For the time being at least, keep the string as a class instance variable for possible re-use
+void CImImap4Session::CreateUidStringL()
+	{
+	iUidString->Des().Zero();
+	TPtr8 ptr(iUidString->Des());
+	TUint32* current = &iSearchList->At(0); // Loop iterator
+	TUint32* start(NULL); // Keep track of the start of a UID sequence
+	TInt count = iSearchList->Count(); // Quick access
+	while(current < &iSearchList->At(0) + count) // Loop till the end of the integer list
+		{
+		// Check for room to add 2 integers plus 2 separators.
+		// If not enough room then reallocate 
+		if((ptr.MaxLength() - ptr.Length()) < (KMaxUint32Chars)+2)
+			{
+			iUidString = iUidString->ReAllocL(ptr.MaxLength()*2); // Make sure this time
+			ptr.Set(iUidString->Des());
+			}
+		start = current; // Mark the start of a possible sequence
+		if(current != &iSearchList->At(0)) // If it's the first time through the loop don't append separator
+			{
+			ptr.Append(',');
+			}
+		ptr.AppendNum(*start); // First integer always written
+		// Loop until end of sequence or end of list.
+		// will loop through 125 126 127
+		while(current < &iSearchList->At(count-1) && *current == (*(current+1))-1)
+			{
+			++current;
+			}
+		// If there was a run then current won't equal start.
+		// That being the case, append the sequence separator followed by last in sequence
+		// 125:127
+		// If there's no sequence, the next int is written by ptr.AppendNum(*start)
+		if(current != start)
+			{
+			ptr.Append(':');
+			ptr.AppendNum(*current);
+			}
+		++current;
+		}	
+	}
+
+void CImImap4Session::IdleTimerExpiredL()
+	{
+	iIdleTimerExpired = ETrue;
+	ReissueIdleL();
+	}
+
+void CImImap4Session::CancelTimerExpired()
+	{
+	Cancel();
+	if (iState != EImapStateDisconnected)
+		{
+		DoDisconnect();
+		}
+	iObserver.NonCompletedFailure();
+	}
+
+	
+CIdleTimeoutTimer::CIdleTimeoutTimer(CImImap4Session& aOperation)
+: CTimer(EPriorityHigh), iOperation(aOperation)
+	{}
+
+void CIdleTimeoutTimer::RunL()
+	{
+	iOperation.IdleTimerExpiredL();
+	}
+
+CIdleTimeoutTimer* CIdleTimeoutTimer::NewL(CImImap4Session& aOperation)
+	{
+	CIdleTimeoutTimer* self = new(ELeave) CIdleTimeoutTimer(aOperation);
+	CleanupStack::PushL(self);
+	self->ConstructL(); // CTimer
+	CActiveScheduler::Add(self);
+	CleanupStack::Pop();
+	return self;
+	}
+
+
+CImImap4SessionDummyRead* CImImap4SessionDummyRead::NewL(CImImap4Session& aSession, CImapIO& aImapIO, TInt aPriority)
+	{
+	CImImap4SessionDummyRead* self = new (ELeave) CImImap4SessionDummyRead(aSession, aImapIO, aPriority);
+	return self;
+	}
+
+CImImap4SessionDummyRead::CImImap4SessionDummyRead(CImImap4Session& aSession, CImapIO& aImapIO, TInt aPriority)
+: CActive(aPriority), iSession(aSession), iImapIO(aImapIO)
+	{
+	DBG(iSession.LogText(_L8("+ CImImap4SessionDummyRead()") ) );
+	CActiveScheduler::Add(this);
+	DBG(iSession.LogText(_L8("- CImImap4SessionDummyRead()") ) );
+	}
+
+CImImap4SessionDummyRead::~CImImap4SessionDummyRead()
+	{
+	DBG(iSession.LogText(_L8("+ ~CImImap4SessionDummyRead") ) );
+	Cancel();
+	DBG(iSession.LogText(_L8("- ~CImImap4SessionDummyRead") ) );
+	}
+
+void CImImap4SessionDummyRead::Start()
+	{
+	DBG( iSession.LogText( _L8("+ CImImap4SessionDummyRead::Start()") ) );
+	if(IsActive())
+		{ 
+		// already have an outstanding dummy read, ignore this
+		DBG( iSession.LogText( _L8("CImImap4SessionDummyRead::Start():Already active") ) );
+		return;
+		}
+
+	DBG( iSession.LogText( _L8("+ CImImap4SessionDummyRead::Start()") ) );
+	// As the spec is ambiguous about when we can get untagged responses,
+	// we can get them any time, so ask for a proper reply
+	iImapIO.GetReply(iStatus);
+        
+        DBG((iSession.LogText(_L8("*******************************************************"))));
+	DBG((iSession.LogText(_L8("CImap4SessionDummyRead::Start(): waiting for iImapIO to wake me"))));
+	DBG((iSession.LogText(_L8("*******************************************************"))));
+
+ 	SetActive();
+	DBG( iSession.LogText( _L8("- CImImap4SessionDummyRead::Start()") ) );
+	}
+
+void CImImap4SessionDummyRead::DoCancel()
+	{
+	DBG( iSession.LogText( _L8("+ CImImap4SessionDummyRead::DoCancel()") ) );
+	iImapIO.Cancel();
+	DBG( iSession.LogText( _L8("- CImImap4SessionDummyRead::DoCancel()") ) );
+	}
+
+void CImImap4SessionDummyRead::RunL()
+	{
+	//Inform iOperation that the dummy read has completed.
+
+	//Under normal conditions the dummy read should never complete.
+	//However, if it does complete it is likely that iStatus != KErrNone.
+	DBG( iSession.LogText( _L8("+ CImImap4SessionDummyRead::RunL()") ) );
+	iSession.DummyComplete(iStatus.Int());
+	if (iStatus.Int() >= KErrNone) 
+		{ 
+		DBG( iSession.LogText(_L8(" CImImap4SessionDummyRead::RunL() There might be more data coming, issue dummy reading again.")) ); 
+		iSession.ReissueDummy(); 
+		}
+	DBG( iSession.LogText( _L8("- CImImap4SessionDummyRead::RunL()") ) );
+	}
+	
+
+CImImap4SessionIdleRead* CImImap4SessionIdleRead::NewL(CImImap4Session& aOperation, TInt aPriority)
+	{
+	CImImap4SessionIdleRead* self = new (ELeave) CImImap4SessionIdleRead(aOperation, aPriority);
+	return self;
+	}
+
+CImImap4SessionIdleRead::CImImap4SessionIdleRead(CImImap4Session& aOperation, TInt aPriority)
+: CActive(aPriority), iOperation(aOperation)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+CImImap4SessionIdleRead::~CImImap4SessionIdleRead()
+	{
+	Cancel();
+	}
+
+void CImImap4SessionIdleRead::Start(TRequestStatus& aStatus)
+	{
+	// Store the status for completion later
+	iOperationStatus = &aStatus;
+	*iOperationStatus = KRequestPending;
+
+	// Issue the read with *our* status
+	iOperation.DoIdleRead(iStatus);
+        DBG((iOperation.LogText(_L8("*******************************************************"))));
+	DBG((iOperation.LogText(_L8("CImap4SessionIdleRead::Start(): waiting for iOperation to wake me"))));
+	DBG((iOperation.LogText(_L8("*******************************************************"))));
+
+	SetActive();
+	}
+
+void CImImap4SessionIdleRead::DoCancel()
+	{
+	DBG(iOperation.LogText(_L8("CImImap4SessionIdleRead::DoCancel()")));
+
+	// Cancel the idle read we started
+	iOperation.CancelIdleRead();
+        DBG((iOperation.LogText(_L8("-----------------------------------------------------------"))));
+	DBG((iOperation.LogText(_L8("CImap4SessionIdleRead::DoCancel(): calling request complete"))));
+	DBG((iOperation.LogText(_L8("-----------------------------------------------------------"))));
+
+	User::RequestComplete(iOperationStatus, KErrCancel);
+	}
+
+void CImImap4SessionIdleRead::RunL()
+	{
+	TInt err = iStatus.Int();
+	DBG(iOperation.LogText(_L8("CImImap4SessionIdleRead::RunL(iStatus=%d)"),err));
+
+	if(err < KErrNone)
+		{ // Special case for error
+		// Need to do this because if read completed with an error,
+		// the RequestComplete would not handle this by itself as 
+		// the RunL would not be called and neither would the 
+		// DoComplete (because the session's iReport is NULL...)
+		iOperation.IdleReadError(err);
+		}
+        DBG((iOperation.LogText(_L8("-----------------------------------------------------------"))));
+	DBG((iOperation.LogText(_L8("CImap4SessionIdleRead::RunL(): calling request complete"))));
+	DBG((iOperation.LogText(_L8("-----------------------------------------------------------"))));
+
+	User::RequestComplete(iOperationStatus, err);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/src/IMAPSYNC.CPP	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,1604 @@
+// Copyright (c) 1998-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:
+// IMAP4 connect & synchronise operation control
+// This class deals with stepping through a synchronise operation - this
+// involves:
+// 1. Select inbox
+// 2. Perform any outstanding operations on inbox
+// 3. Synchronise inbox
+// 4. Synchronise folder list
+// 5. Build list of folders to synchronise, sorted by 'last sync' date
+// (oldest first), and outstanding operations (folders with outstanding
+// operations are first, whatever their date).
+// 6. Mirror subscription flags as necessary
+// 7. For each folder in the 'to synchronise' list...
+// i)   Select folder
+// ii)  Perform any outstanding operations
+// iii) Synchronise folder
+// 8. Reselect inbox
+// 
+//
+
+#include <e32base.h>
+#include <e32cons.h>
+#include <mentact.h>
+#include "impspan.h"
+#include "imapsess.h"
+#include "imapsync.h"
+#include "fldsync.h"
+#include <imapset.h>
+#include <offop.h>
+#include "imapcomp.h"
+#include "imapoffl.h"
+#include "impsutil.h"
+
+#ifdef _DEBUG
+#define DBG(a) iSession->LogText a
+#define PRINTING
+#else
+#define DBG(a)
+#undef PRINTING
+#endif
+
+// Inbox name for newly created one
+_LIT(KInbox, "Inbox");
+#ifdef PRINTING
+LOCAL_C const TText8* SynchroniseStateString(CImImap4Synchronise::TSynchroniseState aState)
+	{
+	switch (aState)
+		{
+	case CImImap4Synchronise::ESyncStateIdle:
+		return _S8("Idle");
+	case CImImap4Synchronise::EInboxSelect:
+		return _S8("InboxSelect");
+	case CImImap4Synchronise::EInboxPendingOps:
+		return _S8("InboxPendingOps");
+	case CImImap4Synchronise::EInboxSync:
+		return _S8("InboxSync");
+	case CImImap4Synchronise::ESynchroniseFolderTree:
+		return _S8("SynchroniseFolderTree");
+	case CImImap4Synchronise::ECheckRemoteSubscription:
+		return _S8("CheckRemoteSubscription");
+	case CImImap4Synchronise::EProcessRemoteSubscription:
+		return _S8("ProcessRemoteSubscription");
+	case CImImap4Synchronise::EUpdateRemoteSubscription:
+		return _S8("UpdateRemoteSubscription");
+	case CImImap4Synchronise::EFolderSelect:
+		return _S8("FolderSelect");
+	case CImImap4Synchronise::EFolderPendingOps:
+		return _S8("FolderPendingOps");
+	case CImImap4Synchronise::EFolderSynchronise:
+		return _S8("FolderSynchronise");
+	case CImImap4Synchronise::EInboxEarlyDeletes:
+		return _S8("InboxEarlyDeletes");
+	case CImImap4Synchronise::EFolderEarlyDeletes:
+		return _S8("FolderEarlyDeletes");
+	case CImImap4Synchronise::EFolderEarlyExpunge:
+		return _S8("FolderEarlyExpunge");
+	case CImImap4Synchronise::EInboxLateExpunge:
+		return _S8("InboxLateExpunge");
+	case CImImap4Synchronise::EFolderLateDeletes:
+		return _S8("FolderLateDeletes");
+	case CImImap4Synchronise::EFolderLateExpunge:
+		return _S8("FolderLateExpunge");
+#if 0
+	case CImImap4Synchronise::EInboxLateNewSync:
+		return _S8("InboxLateNewSync");
+	case CImImap4Synchronise::EFolderLateNewSync:
+		return _S8("FolderLateNewSync");
+#endif
+	case CImImap4Synchronise::EEndSelectInbox:
+		return _S8("EndSelectInbox");
+	case CImImap4Synchronise::EInboxLogMessage:
+		return _S8("InboxLogMessage");
+	case CImImap4Synchronise::EFolderLogMessage:
+  		return _S8("FolderLogMessage");
+	case CImImap4Synchronise::EStartIdle:
+		return _S8("StartIdle");
+	case CImImap4Synchronise::ESynchronise:
+		return _S8("Synchronise");	
+	case CImImap4Synchronise::ESynchroniseTree:
+		return _S8("SynchroniseTree");		
+	case CImImap4Synchronise::ESynchroniseDeletes:
+		return _S8("SynchroniseDeletes");		
+		}
+	return _S8("Unknown");
+	}
+#endif
+
+CImImap4Synchronise::CImImap4Synchronise()
+	: CMsgActive(1), iState(ESyncStateIdle)
+	{
+	__DECLARE_NAME(_S("CImImap4Synchronise"));
+	}
+
+CImImap4Synchronise::~CImImap4Synchronise()
+	{
+	// Global bits
+	delete iFolderList;
+	delete iFolderListDest;
+	delete iFolderSync;
+	delete iSubscribeList;
+	delete iUnsubscribeList;
+	delete iOutstandingOps;
+	delete iCompound;
+	delete iOutstandingMoveTypeDeletes;
+	delete iOutstandingLocalDeletes;
+
+	// We don't delete iSession as we don't own it, we were just
+	// passed it to use.  similarly iOffLineControl
+	}
+
+CImImap4Synchronise* CImImap4Synchronise::NewLC(CImImap4Session *aSession)
+	{
+	CImImap4Synchronise* self=new (ELeave) CImImap4Synchronise();
+	CleanupStack::PushL(self);
+
+	// Non-trivial constructor
+	self->ConstructL(aSession);
+	return self;
+	}
+
+CImImap4Synchronise* CImImap4Synchronise::NewL(CImImap4Session *aSession)
+	{
+	CImImap4Synchronise* self=NewLC(aSession);
+	CleanupStack::Pop();
+	return self;
+	}
+
+// The non-trivial constructor
+void CImImap4Synchronise::ConstructL(CImImap4Session *aSession)
+	{
+	// Save session
+	iSession=aSession;
+
+	// We're an active object...
+	CActiveScheduler::Add(this);
+
+	// One-off bits
+	iFolderList=new (ELeave) CArrayFixFlat<TImImap4SyncList>(16);
+	iFolderListDest=new (ELeave) CArrayFixFlat<TImImap4SyncList>(16);
+	iFolderSync=CImImap4FolderSync::NewL(iSession);
+	iSubscribeList=new (ELeave) CArrayFixFlat<TMsvId>(4);
+	iUnsubscribeList=new (ELeave) CArrayFixFlat<TMsvId>(4);
+	iOutstandingMoveTypeDeletes=new (ELeave) CArrayFixFlat<TMsvId>(4);
+	iOutstandingLocalDeletes=new (ELeave) CArrayFixFlat<TMsvId>(4);
+
+	// Compound operation
+	iCompound=CImImap4Compound::NewL(iSession);
+
+	// Make a thread-local timer
+	iCheckMailbox.CreateLocal();
+
+	iProgress.iType=EImap4SyncProgressType;
+
+	iIdleBeforeCommand = EFalse;
+	}
+
+void CImImap4Synchronise::SetOffLineControl(CImap4OffLineControl* aOffLineControl)
+	{
+	iOffLineControl = aOffLineControl;
+	}
+
+void CImImap4Synchronise::SetUtils(CImap4Utils* aUtils)
+	{
+	iUtils = aUtils;
+	}
+
+// Set the entry to use to talk to the server
+void CImImap4Synchronise::SetEntry(CMsvServerEntry* aEntry)
+	{
+	// Save it
+	iEntry=aEntry;
+	
+	// Tell compound about it
+	iCompound->SetEntry(iEntry);
+	}
+
+// Do setentry, leave if there is an error
+void CImImap4Synchronise::SetEntryL(const TMsvId aId)
+	{
+	User::LeaveIfError(iEntry->SetEntry(aId));
+	}
+
+// Change entry, leave if error
+void CImImap4Synchronise::ChangeEntryL(const TMsvEntry& aEntry)
+	{
+	User::LeaveIfError(iEntry->ChangeEntry(aEntry));
+	}
+
+// Change entry in bulk mode (i.e no index file commit. no notify),
+// leave if error
+void CImImap4Synchronise::ChangeEntryBulkL(const TMsvEntry& aEntry)
+	{
+	User::LeaveIfError(iEntry->ChangeEntryBulk(aEntry));
+	}
+// Get children, leave if error
+void CImImap4Synchronise::GetChildrenL(CMsvEntrySelection& aSelection)
+	{
+	User::LeaveIfError(iEntry->GetChildren(aSelection));
+	}
+
+// Given an id of a folder or the service then restore the offline
+// operation array out of it. Returns the number of operations in the
+// array
+TBool CImImap4Synchronise::RefreshOutstandingOpsL(TMsvId aId)
+	{
+	if (iOutstandingOps)
+		{
+		delete iOutstandingOps;
+		iOutstandingOps=NULL;
+		}
+	
+	iOutstandingOps = iOffLineControl->OffLineOpArrayL(aId);
+	iOutstandingOpsFolder = aId;
+
+	// reset the count
+	iProgress.iMsgsToDo = iOutstandingOps->CountOperations();
+	iProgress.iMsgsDone = 0;
+	
+	iMovedId = KMsvNullIndexEntryId;
+	iShadowId = KMsvNullIndexEntryId;
+
+	return iProgress.iMsgsToDo;
+	}
+
+// Called when async child completes with an error
+#ifdef PRINTING
+void CImImap4Synchronise::DoComplete(TInt& aStatus)
+#else
+void CImImap4Synchronise::DoComplete(TInt& /*aStatus*/)
+#endif
+	{
+	DBG((_L8("CImImap4Synchronise::DoComplete(state=%s, istatus=%d)"),
+		 SynchroniseStateString(iState),aStatus));
+
+	// No alteration of the error code
+	}
+
+// This routine sets up iShadowId which will be deleted when the
+// operation completes successfully
+void CImImap4Synchronise::DoOpL(const CImOffLineOperation& aOp)
+	{
+	iShadowId = iMovedId = KMsvNullIndexEntryId;
+	
+	// clean the disconnected op flags and ensure its visible and get
+	// an entry copy
+	SetEntryL(aOp.MessageId());
+	TMsvEmailEntry entry = iEntry->Entry();
+	entry.SetVisible(ETrue);
+	entry.SetDisconnectedOperation(ENoDisconnectedOperations);
+	ChangeEntryBulkL(entry);
+
+	// check and see if there is a shadow and whether it has been
+	// removed or marked for deletion
+	TBool shadowOK = ETrue;
+	if ( aOp.OpType() != CImOffLineOperation::EOffLineOpMtmSpecific &&
+		 aOp.OpType() != CImOffLineOperation::EOffLineOpDelete )
+		{
+		iShadowId = iOffLineControl->FindShadowIdL(aOp);
+
+		shadowOK = iShadowId != KMsvNullIndexEntryId &&
+			iEntry->SetEntry(iShadowId) == KErrNone &&
+			((TMsvEmailEntry)iEntry->Entry()).DisconnectedOperation() != EDisconnectedDeleteOperation;
+		}
+
+	iUtils->ClearLogMessage();
+	
+	// Deal with operation
+	switch(aOp.OpType())
+		{
+	case CImOffLineOperation::EOffLineOpCopyToLocal:
+		// do the copy, if not a message
+		if (entry.iType != KUidMsvMessageEntry ||
+			// or the shadow exists
+			shadowOK )
+			{
+			iUtils->SetUpLogMessageL(aOp.MessageId());
+			SetActive();
+			iCompound->SyncCopyToLocalL(iStatus,aOp.MessageId(),aOp.TargetMessageId());
+			}
+		break;
+		
+	case CImOffLineOperation::EOffLineOpCopyFromLocal:
+		if (shadowOK)
+			{
+			SetActive();
+			iSession->Append(iStatus,aOp.MessageId(),aOp.TargetMessageId());
+			}
+		break;
+
+	case CImOffLineOperation::EOffLineOpCopyWithinService:
+		if (shadowOK)
+			{
+			SetActive();
+			iSession->Copy(iStatus,aOp.MessageId(),aOp.TargetMessageId(),EFalse);
+			}
+		break;
+		
+	case CImOffLineOperation::EOffLineOpMoveToLocal:
+		if (shadowOK)
+			{
+			iUtils->SetUpLogMessageL(aOp.MessageId());
+			SetActive();
+			iCompound->SyncCopyToLocalL(iStatus,aOp.MessageId(),aOp.TargetMessageId());
+			}
+		// even if the shadow has been removed we still want to delete
+		// the original
+		iMovedId=aOp.MessageId();
+		break;
+
+	case CImOffLineOperation::EOffLineOpMoveFromLocal:
+		if (shadowOK)
+			{
+			SetActive();
+			iSession->Append(iStatus,aOp.MessageId(),aOp.TargetMessageId());
+			}
+		// even if the shadow has been removed we still want to delete
+		// the original
+		iMovedId=aOp.MessageId();
+		break;
+
+	case CImOffLineOperation::EOffLineOpMoveWithinService:
+		if (shadowOK)
+			{
+			SetActive();
+			iSession->Copy(iStatus,aOp.MessageId(),aOp.TargetMessageId(),EFalse);
+			}
+		// even if the shadow has been removed we still want to delete
+		// the original, unless the folder itself has been removed
+		if (iEntry->SetEntry(aOp.TargetMessageId()) == KErrNone)
+			iMovedId=aOp.MessageId();
+		break;
+
+	case CImOffLineOperation::EOffLineOpMtmSpecific:
+		switch (aOp.MtmFunctionId())
+			{
+		case EFnOffLineOpPopulate:
+			{
+			TImap4GetMailOptions options;
+			TPckgC<TImap4GetMailOptions> package(options);
+			package.Set(aOp.MtmParameters());
+			
+			// Copy TImImap4GetMailOptions information into TImImap4GetPartialMailInfo
+			TImImap4GetPartialMailInfo imap4GetPartialMailInfo;	
+			imap4GetPartialMailInfo.iGetMailBodyParts = package();
+			// Set to default
+			imap4GetPartialMailInfo.iMaxEmailSize = KMaxTInt;
+			// Set the remaining members to default so that the server can check 
+			// if these are defaults, then this package is for TImImap4GetMailInfo
+			imap4GetPartialMailInfo.iTotalSizeLimit	= KMaxTInt;
+			imap4GetPartialMailInfo.iBodyTextSizeLimit = KMaxTInt;
+			imap4GetPartialMailInfo.iAttachmentSizeLimit = KMaxTInt;
+			imap4GetPartialMailInfo.iPartialMailOptions = ENoSizeLimits;
+			
+			TPckgBuf<TImImap4GetPartialMailInfo> partialPackage(imap4GetPartialMailInfo);
+	
+			iUtils->SetUpLogMessageL(aOp.MessageId());
+			SetActive();
+			iSession->FetchBody(iStatus,aOp.MessageId(),partialPackage());
+			break;
+			}
+		default:
+			break;
+			}
+		break;
+
+	case CImOffLineOperation::EOffLineOpDelete:
+	default:
+		break;
+		}
+	}
+
+void CImImap4Synchronise::MakeVisibleL(TMsvId aId)
+	{
+	DBG((_L8("  This folder isn't selectable, just making it visible")));
+
+	// Just make it visible
+	SetEntryL(aId);
+	TMsvEmailEntry mbcheck=iEntry->Entry();
+				
+	do
+		{
+		// Ensure visibility
+		if (!mbcheck.Visible())
+			{
+			mbcheck.SetVisible(ETrue);
+			ChangeEntryBulkL(mbcheck);
+			}
+
+		// Move up one
+		SetEntryL(mbcheck.Parent());
+		mbcheck=iEntry->Entry();
+		}
+	while(mbcheck.iType!=KUidMsvServiceEntry && mbcheck.Id()!=KMsvRootIndexEntryId);
+	}
+
+void CImImap4Synchronise::DonePendingOpL()
+	{
+	// if we've done one then...
+	if (iProgress.iMsgsDone != 0)
+		{
+		// if this was a move then append a delete
+		if (iMovedId != KMsvNullIndexEntryId)
+			{
+			SetEntryL(iMovedId);
+			if (iEntry->Entry().Parent() == iOutstandingOpsFolder)
+				{
+				DBG((_L8("Append MoveDelete for %x"), iMovedId));
+				iOutstandingMoveTypeDeletes->AppendL(iMovedId);
+				}
+			else
+				{
+				// if this id was from a MoveFrom (ie its parent is not
+				// this folder) then put it in a different pending array
+				DBG((_L8("Append LocalDelete for %x"), iMovedId));
+				iOutstandingLocalDeletes->AppendL(iMovedId);
+				}
+			}
+		
+		// delete the shadowid if there is one, ignore errors
+		if (iShadowId != KMsvNullIndexEntryId &&
+			iEntry->SetEntry(iShadowId) == KErrNone &&
+			iEntry->SetEntry(iEntry->Entry().Parent()) == KErrNone)
+			{
+			iEntry->DeleteEntry(iShadowId);
+			}
+
+		if (iUtils->SendLogMessageL(KErrNone,iStatus))
+			SetActive();
+		}
+	}
+
+TBool CImImap4Synchronise::NextPendingOpL()
+	{
+	TBool finished = EFalse;
+	
+	// Any operations in outstanding list?
+	if (iOutstandingOps->CountOperations())
+		{
+		DBG((_L8("Outstanding operations on this folder (%d)"),
+			 iOutstandingOps->CountOperations()));
+
+		// Fetch operation
+		CImOffLineOperation thisop;
+		thisop.CopyL(iOutstandingOps->Operation(0));
+
+		// when we get to one of the Delete operations then it is time
+		// to stop
+		if (thisop.OpType() == CImOffLineOperation::EOffLineOpDelete ||
+			(thisop.OpType() == CImOffLineOperation::EOffLineOpMtmSpecific &&
+			 thisop.MtmFunctionId() == EFnOffLineOpMoveDelete))
+			{
+			DBG((_L8("Reached delete op. Finished")));
+			finished = ETrue;
+			}
+		else
+			{
+			// remove from list and save back
+			iOutstandingOps->Delete(0);
+			iOffLineControl->SetOffLineOpArrayL(iOutstandingOpsFolder, *iOutstandingOps);
+
+			// and execute
+			DoOpL(thisop);
+			iProgress.iMsgsDone++;
+			}
+		}
+	else
+		{
+		// No more operations to do, return to what we should be doing next
+		finished = ETrue;
+		}
+
+	// when we are about to finish this folder then tidy up
+	if (finished)
+		{
+		// add the list of pending deletes to the front of the
+		// offline op array
+		for (TInt i = 0; i < iOutstandingMoveTypeDeletes->Count(); i++)
+			{
+			TMsvId id = (*iOutstandingMoveTypeDeletes)[i];
+			TBuf8<128> paramBuf(_L8(""));
+			CImOffLineOperation thisop;
+
+			// if we are doing deletes on connection then store this
+			// as a delete and we will do all deletes at the end of
+			// the sync.
+
+			// if we are doing deletes on disconnection then store
+			// this as a special code - it will still get done at end
+			// of sync, but real deletes will be done on
+			// disconnection.
+			if (iPerformDeletes)
+				thisop.SetDelete(id);
+			else
+				thisop.SetMtmSpecificCommandL(id, EFnOffLineOpMoveDelete, 0, paramBuf);
+
+			iOutstandingOps->InsertOperationL(thisop, 0);
+			}
+
+		// if there were outstanding move type deletes then clear
+		// their array and save back the main outstanding ops list
+		if (iOutstandingMoveTypeDeletes->Count())
+			{
+			iOutstandingMoveTypeDeletes->Reset();
+
+			iOffLineControl->SetOffLineOpArrayL(iOutstandingOpsFolder, *iOutstandingOps);
+			}
+		}
+
+	return finished;
+	}
+
+TBool CImImap4Synchronise::MatchDeleteOp(const CImOffLineOperation& aOp , TBool aMoveDeletesOnly )
+	{
+	return (aOp.OpType() == CImOffLineOperation::EOffLineOpMtmSpecific && aOp.MtmFunctionId() == EFnOffLineOpMoveDelete) ||
+		(!aMoveDeletesOnly && aOp.OpType() == CImOffLineOperation::EOffLineOpDelete);
+	}
+
+TBool CImImap4Synchronise::ProcessPendingDeleteOpsL( TMsvId aFolder, TBool aMoveDeletesOnly )
+	{
+	TBool hadDeletes = EFalse;
+
+	DBG((_L8("CImImap4Synchronise::ProcessPendingDeleteOpsL: Folder %x aMoveDeletesOnly=%d"),
+		 aFolder, aMoveDeletesOnly));
+		
+	// get the current offline operations of this folder
+	if (RefreshOutstandingOpsL(aFolder))
+		{
+		// Fetch operation
+		CImOffLineOperation thisop;
+		thisop.CopyL(iOutstandingOps->Operation(0));
+
+		// check delete type
+		if (MatchDeleteOp(thisop, aMoveDeletesOnly))
+			{
+			do
+				{
+				// if can't find the entry then just skip it so it is
+				// removed from array
+				if (iEntry->SetEntry(thisop.MessageId()) == KErrNone)
+					{
+					// set its server deleted flag
+					TMsvEmailEntry entry=iEntry->Entry();
+					entry.SetDeletedIMAP4Flag(ETrue);
+					iEntry->ChangeEntry(entry);
+					}
+
+				// remove from the array and write back immediately
+				iOutstandingOps->Delete(0);
+				iOffLineControl->SetOffLineOpArrayL(iOutstandingOpsFolder, *iOutstandingOps);
+
+				// check for finish
+				if (iOutstandingOps->CountOperations() == 0)
+					break;
+			
+				// get next op
+				thisop.CopyL(iOutstandingOps->Operation(0));
+				}
+			while (MatchDeleteOp(thisop, aMoveDeletesOnly));
+					
+			hadDeletes = ETrue;
+			}
+		}
+
+	return hadDeletes;
+	}
+
+TBool CImImap4Synchronise::ProcessPendingDeleteOpsListL( TBool aMoveDeletesOnly )
+	{
+	while (iProgress.iFoldersDone < iProgress.iFoldersToDo)
+		{
+		TImImap4SyncList next=(*iFolderList)[iProgress.iFoldersDone++];
+
+		if (ProcessPendingDeleteOpsL( next.iFolder, aMoveDeletesOnly ))
+			{
+			iSession->SelectL(iStatus, next.iFolder, ETrue);
+			SetActive();
+
+			return ETrue;
+			}
+		}
+	return EFalse;
+	}
+
+// Called when async child completes with >=KErrNone
+void CImImap4Synchronise::DoRunL()
+	{
+	DBG((_L8("CImImap4Synchronise::DoRunL(istatus=%d)"), iStatus.Int()));
+	
+	while (!IsActive() && !DoRunLoopL())
+		{
+		// do nothing in the body of this
+		}
+	}
+
+TBool CImImap4Synchronise::DoRunLoopL()
+	{
+	DBG((_L8("CImImap4Synchronise::DoRunLoopL(state=%s)"),
+		SynchroniseStateString(iState)));
+
+	TBool done = EFalse;
+	
+	// DoRunL is only called
+	switch(iState)
+		{
+	case EInboxSelect:
+		iProgress.iState=TImap4SyncProgress::ESyncInbox;
+
+		// if select failed then skip past INBOX ops
+		if (iStatus.Int() == KErrIMAPNO)
+			{
+			iState = ESynchroniseFolderTree;
+			iProgress.iFoldersNotFound++;
+			}
+		else
+			{
+			// Deal with operations in the array
+			if (RefreshOutstandingOpsL(iInbox))
+				iState=EInboxPendingOps;
+			else
+				iState=EInboxSync;
+			}
+		break;
+
+	case EInboxPendingOps:
+		iProgress.iState=TImap4SyncProgress::EProcessingPendingOps;
+		
+		iState = EInboxLogMessage;
+		DonePendingOpL();
+		break;
+		
+	case EInboxLogMessage:
+		if (NextPendingOpL())
+			iState = EInboxSync;
+		else
+			iState = EInboxPendingOps;
+		break;
+
+	case EInboxSync:
+		iProgress.iState=TImap4SyncProgress::ESyncInbox;
+		
+		//Once pending operations are done on folder/s, sync the Inbox 
+		if(iPendingOpOnFolder)
+			{
+			// reset iPendingOpOnFolder flag
+			iPendingOpOnFolder=EFalse;
+			if (iSession->ImapIdleSupported() && iIdleBeforeCommand)
+				{
+				// change the state to EStartIdle, if ImapIdle supported
+				iState = EStartIdle;
+				}
+			else
+				{
+				// else  change the state to EEndSelectInbox
+				iState = EEndSelectInbox;
+				}
+			}
+		else
+			{
+			// After inbox sync, start folder tree sync
+			iState=ESynchroniseFolderTree;
+			}
+
+		// mark inbox as having been done
+		iProgress.iFoldersDone++;
+
+		// Start the sync of the current folder (ie, the inbox)
+		DBG((_L8("CImImap4Sync::DoRunLoopL(): Calling iSession->SynchroniseL()")));
+                iSession->SynchroniseL(iStatus,EFalse);
+		SetActive();
+		break;
+
+	case ESynchroniseFolderTree:
+		iProgress.iState=TImap4SyncProgress::ESyncFolderTree;
+
+		// After this, check the remote folder subscription if needed
+		iState=ECheckRemoteSubscription;
+		
+		// Update folder tree
+		iFolderSync->SetEntry(iEntry);
+		iFolderSync->SynchroniseTreeL(iStatus,iServiceId,iNewFoldersAreInvisible);
+		SetActive();
+		break;
+
+	case ECheckRemoteSubscription:
+		iProgress.iState=TImap4SyncProgress::ECheckRemoteSubscription;
+
+		// Check the remote subscription/build local folder list,
+		// dependent on strategy in use
+		iState=EProcessRemoteSubscription;
+
+		// Do we need to know what folders are subscribed remotely?
+		if (iSynchroniseStrategy==EUseLocal && 
+			(iSubscribeStrategy==EUpdateNeither || iSubscribeStrategy==EUpdateLocal))
+			{
+			// No we don't: just add the folders (done in this state)
+			}
+		else
+			{
+			// Update our list of remotely subscribed folders
+			iSession->LsubL(iStatus);
+			SetActive();
+			}
+		break;
+
+	case EProcessRemoteSubscription:
+		iProgress.iState=TImap4SyncProgress::ECheckRemoteSubscription;
+
+		// Build (from local folders) and sort the list
+		SortFolderListL();
+
+		iProgress.iFoldersDone=0;
+		iProgress.iFoldersToDo=iFolderList->Count();
+
+		// Any remote subscribing/unsubscribing to do?
+		if (iSubscribeList->Count() || iUnsubscribeList->Count())
+			{
+			// Yes, do them
+			iState=EUpdateRemoteSubscription;
+			}
+		else
+			{
+			// Start folder selection
+			iState=EFolderSelect;
+			}
+		break;
+
+	case EUpdateRemoteSubscription:
+		iProgress.iState=TImap4SyncProgress::EUpdateRemoteSubscription;
+		
+		// Any subscription to do?
+		if (iSubscribeList->Count())
+			{
+			// Take it off the head
+			TMsvId folder=(*iSubscribeList)[0];
+			iSubscribeList->Delete(0,1);
+
+			// Subscribe to it
+			iSession->RemoteSubscribeL(iStatus,folder,ETrue);
+			SetActive();
+			}
+		// ...or unsubscription?
+		else if (iUnsubscribeList->Count())
+			{
+			// Take it off the head
+			TMsvId folder=(*iUnsubscribeList)[0];
+			iUnsubscribeList->Delete(0,1);
+
+			// Unsubscribe from it
+			iSession->RemoteSubscribeL(iStatus,folder,EFalse);
+			SetActive();
+			}
+		else
+			{
+			// All done, select the first folder
+			iState=EFolderSelect;
+			}
+		break;
+
+	case EFolderSelect:
+		iProgress.iState=TImap4SyncProgress::ESyncOther;
+
+		// Anything to do...
+		while (iProgress.iFoldersDone < iProgress.iFoldersToDo)
+			{
+			// Select the next folder
+			// Get next folder to-do
+			TImImap4SyncList next=(*iFolderList)[iProgress.iFoldersDone++];
+
+			DBG((_L8("Next folder to select is %x"),next.iFolder));
+
+			// Is this a selectable folder?
+			if (next.iNotSelectable)
+				{
+				MakeVisibleL(next.iFolder);
+				}
+			else
+				{
+				// Select it
+                                DBG((_L8("CImImap4Sync::DoRunLoopL(): Calling iSession->SelectL()")));
+ 				iSession->SelectL(iStatus,next.iFolder,ETrue);
+				SetActive();
+
+				// get the current offline operations of this folder
+				if (RefreshOutstandingOpsL(next.iFolder))
+					{
+					iState=EFolderPendingOps;
+					// set iPendingOpOnFolder flag, according this flag will syncing the Inbox.
+  	  				iPendingOpOnFolder=ETrue;					
+					}
+				else
+					{
+					iState=EFolderSynchronise;
+					}
+
+				// stop loop
+				break;
+				}
+			}
+
+		// Run out of folders to sync?
+		if (iState == EFolderSelect)
+			iState = EInboxEarlyDeletes;
+		break;
+
+	case EFolderPendingOps:
+		iProgress.iState=TImap4SyncProgress::EProcessingPendingOps;
+
+		if (iStatus.Int() == KErrIMAPNO)
+			{
+			iState = EFolderSelect;
+			iProgress.iFoldersNotFound++;
+			}
+		else
+			{
+			iState = EFolderLogMessage;
+			DonePendingOpL();
+			}
+		break;
+
+	case EFolderLogMessage:
+		if (NextPendingOpL())
+			{
+			// Where a pending operation involves a folder that is also the currently
+			// selected mailbox, the IMAP session may have deselected the mailbox
+			// during the operation. Just in case this has happened, we need to select it
+			// again now.
+			DBG((_L8("CImImap4Sync::DoRunLoopL(): Calling select after pending ops")));
+			TImImap4SyncList next=(*iFolderList)[iProgress.iFoldersDone - 1];
+			iSession->SelectL(iStatus,next.iFolder,ETrue);
+			SetActive();
+
+			iState = EFolderSynchronise;
+			}
+		else
+			iState = EFolderPendingOps;
+		break;
+
+	case EFolderSynchronise:
+		iProgress.iState=TImap4SyncProgress::ESyncOther;
+
+		if (iStatus.Int() == KErrIMAPNO)
+			iProgress.iFoldersNotFound++;
+		else
+			{
+			iSession->SynchroniseL(iStatus,EFalse);
+			SetActive();
+			}
+
+		// back to select next folder
+		iState=EFolderSelect;
+		break;
+
+	case EInboxEarlyDeletes:
+		{
+		iProgress.iState=TImap4SyncProgress::EDeleting;
+
+		// get rid of the FromLocal message sources
+		for (TInt i = 0; i < iOutstandingLocalDeletes->Count(); i++)
+			{
+			TMsvId id = (*iOutstandingLocalDeletes)[i];
+			iSession->DeleteMessageL(id);
+			}
+
+		iOutstandingLocalDeletes->Reset();
+
+		// then do the inbox deletes
+		iProgress.iFoldersDone = 0;
+		if (ProcessPendingDeleteOpsL(iInbox, !iPerformDeletes))
+			{
+			iState = EFolderEarlyExpunge;
+
+			iSession->SelectL(iStatus, iInbox, ETrue);
+			SetActive();
+			}
+		else
+			{
+	        // DEF045009
+            if (iSession->ServiceSettings()->DeleteEmailsWhenDisconnecting())
+                 iState = EFolderLateDeletes;
+            else
+                 iState = EFolderEarlyDeletes;
+			}
+  		break;
+		}
+
+	case EFolderEarlyDeletes:
+		iProgress.iState=TImap4SyncProgress::EDeleting;
+
+		// if we are doing deletes on connection then all deletes will
+		// be marked Delete
+		if (ProcessPendingDeleteOpsListL(!iPerformDeletes))
+			{
+			iState = EFolderEarlyExpunge;
+			}
+		else
+			{
+			if (iSession->ImapIdleSupported() && iIdleBeforeCommand)
+				{
+				iState = EStartIdle;
+				}
+			else
+				{
+				iState = EEndSelectInbox;
+				}
+
+			// All done: reselect inbox r/w
+			iSession->SelectL(iStatus,iInbox,ETrue);
+			SetActive();
+			}
+		break;
+
+	case EFolderEarlyExpunge:
+		iProgress.iState=TImap4SyncProgress::EDeleting;
+
+		if (iStatus.Int() == KErrIMAPNO)
+			iProgress.iFoldersNotFound++;
+		else
+			{
+			// expunge the folder
+			iSession->Close(iStatus, ETrue);
+			SetActive();
+			}
+
+		// back to select next folder
+		iState=EFolderEarlyDeletes;
+		break;
+		
+	case EEndSelectInbox:
+		iProgress.iState=TImap4SyncProgress::EIdle;
+
+		// Finish sync operation
+		iState=ESyncStateIdle;
+		Complete(KErrNone);
+		done = ETrue;
+		break;
+
+	case EInboxLateExpunge:
+		iProgress.iState=TImap4SyncProgress::EDeleting;
+
+		if (iStatus.Int() == KErrIMAPNO)
+			iProgress.iFoldersNotFound++;
+		else
+			{
+			iSession->Close(iStatus, ETrue);
+			SetActive();
+			}
+
+		iState = EFolderLateDeletes;
+		iProgress.iFoldersDone = 0;
+		break;
+
+	case EFolderLateDeletes:
+		iProgress.iState=TImap4SyncProgress::EDeleting;
+
+		if (ProcessPendingDeleteOpsListL( EFalse ) )
+			{
+			iState = EFolderLateExpunge;
+			}			
+		else
+			{
+			iProgress.iState=TImap4SyncProgress::EIdle;
+			
+			if(iPendingOpOnFolder)
+				{
+				iSession->SelectL(iStatus,iInbox,ETrue);
+				iState=EInboxSync;
+				SetActive();
+				}
+			else if (iSession->ImapIdleSupported() && iIdleBeforeCommand)
+				{
+				iSession->SelectL(iStatus,iInbox,ETrue);
+				iState = EStartIdle;			
+				SetActive();
+				}
+			else
+				{
+				iState=ESyncStateIdle;
+				Complete(KErrNone);
+				done = ETrue;
+				}
+			}
+		break;
+
+	case EFolderLateExpunge:
+		iProgress.iState=TImap4SyncProgress::EDeleting;
+
+		if (iStatus.Int() == KErrIMAPNO)
+			{
+			iState = EFolderLateDeletes;
+			iProgress.iFoldersNotFound++;
+			}
+		else
+			{
+			iSession->Close(iStatus, ETrue);
+			SetActive();
+
+			iState = EFolderLateDeletes;
+			}
+		break;
+
+	case EStartIdle:
+		iState = EEndSelectInbox;
+
+		iSession->StartIdleL(iStatus);
+		SetActive();
+		break;
+
+	case ESynchronise:
+		// Synchronise with the inbox
+		iSession->SelectL(iStatus,iInbox,ETrue);
+		iState=EInboxSelect;
+		SetActive();
+		break;
+
+	case ESynchroniseTree:
+		if (iSession->ImapIdleSupported())
+			{
+			iState = EStartIdle;
+			}
+		else
+			{
+			iState = EEndSelectInbox;
+			}
+
+		iFolderSync->SetEntry(iEntry);
+		iFolderSync->SynchroniseTreeL(iStatus, iServiceId, iNewFoldersAreInvisible);
+		SetActive();
+		break;
+
+	case ESynchroniseDeletes:
+		if (ProcessPendingDeleteOpsL( iInbox, EFalse ))
+			{
+			iSession->SelectL(iStatus,iInbox,ETrue);
+
+			iState = EInboxLateExpunge;
+			SetActive();
+			}
+		else if (ProcessPendingDeleteOpsListL( EFalse ) )
+			{
+			iState = EFolderLateExpunge;
+			}
+		else
+			{
+			iProgress.iState=TImap4SyncProgress::EIdle;
+
+			iState=ESyncStateIdle;
+			Complete(KErrNone);
+			done = ETrue;
+			}
+		break;
+
+	default:
+		gPanic(EUnknownState);
+		done = ETrue;
+		break;
+		}
+
+	return done;
+	}
+
+void CImImap4Synchronise::GetInboxL()
+	{
+	// First of all, synchronise the inbox
+	CMsvEntrySelection *findinbox=new (ELeave) CMsvEntrySelection;
+	CleanupStack::PushL(findinbox);
+	SetEntryL(iServiceId);
+	GetChildrenL(*findinbox);
+	
+	// Find inbox	
+	TMsvId inboxid=0;
+	for(TInt a=0;a<findinbox->Count();a++)
+		{
+		SetEntryL((*findinbox)[a]);
+		if (iEntry->Entry().iDetails.CompareF(KIMAP_INBOX)==0)
+			{
+			inboxid=(*findinbox)[a];
+			TMsvEmailEntry e=iEntry->Entry();
+
+			DBG((_L8("INBOX found with id %x (mailbox=%d)"),inboxid,e.Mailbox()));
+
+			// Mailbox flag not set? It always should be. This will 'repair' it.
+			if (!e.Mailbox())
+				{
+				// Set it
+				e.SetMailbox(ETrue);
+				User::LeaveIfError(iEntry->ChangeEntry(e));
+				}
+
+			break;
+			}
+		}
+
+	// Clean up
+	CleanupStack::PopAndDestroy();
+
+	// Not found/no entries?
+	if ((iInbox=inboxid)==0)
+		{
+		// Create an inbox entry below the service. This is a local-only
+		// creation as the server *WILL* have an inbox.
+		SetEntryL(iServiceId);
+		TMsvEmailEntry entry;
+
+		entry.iType=KUidMsvFolderEntry;
+		entry.iMtm=KUidMsgTypeIMAP4;
+		entry.iServiceId=iServiceId;
+		entry.SetMtmData1(0);
+		entry.SetMtmData2(0);
+		entry.SetMtmData3(0);
+		entry.iSize=0;
+		entry.SetUID(0);
+		entry.SetValidUID(EFalse);
+		entry.SetMailbox(ETrue);
+		entry.SetLocalSubscription(ETrue);
+		entry.SetComplete(ETrue);
+		entry.iDetails.Set(KInbox);
+		User::LeaveIfError(iEntry->CreateEntryBulk(entry));
+
+		// Set inbox ID
+		iInbox=entry.Id();
+
+		DBG((_L8("INBOX created with id %x"),iInbox));
+		}
+	}
+
+void CImImap4Synchronise::SynchroniseTreeL(TRequestStatus& aStatus, TMsvId aServiceId, TBool aNewFoldersAreInvisible)
+	{
+	DBG((_L8("CImImap4Synchronise::SynchroniseTreeL")));
+
+	__ASSERT_DEBUG(aServiceId!=KMsvNullIndexEntryId, gPanic(EInvalidService));
+
+	Queue(aStatus);
+
+	iServiceId = aServiceId;
+	iNewFoldersAreInvisible = aNewFoldersAreInvisible;
+
+	GetInboxL();
+	ResetStats();
+	iSession->SetInbox(iInbox);
+
+	iProgress.iState=TImap4SyncProgress::ESyncFolderTree;
+	
+	if (iSession->IsIdling())
+		{
+		iState=ESynchroniseTree;
+		iSession->SyncStopIdleL(iStatus);
+		SetActive();
+		}
+	else
+		{
+		iFolderSync->SetEntry(iEntry);
+		iFolderSync->SynchroniseTreeL(iStatus, iServiceId, aNewFoldersAreInvisible);
+
+		iState=EEndSelectInbox;
+		SetActive();
+		}
+	}
+
+void CImImap4Synchronise::ResetStats()
+	{
+	iProgress.iFoldersToDo = iProgress.iFoldersDone = 0;
+	iProgress.iMsgsToDo = iProgress.iMsgsDone = 0;
+	iProgress.iHeadersFetched = iProgress.iOrphanedFolders = 0;
+	iProgress.iNewFolders = iProgress.iOrphanedMessages = 0;
+	iProgress.iRemoteMessagesDeleteTagged = 0;
+
+	iProgress.iMessagesFetchedOK = iProgress.iMessagePartsFetchedOK = 0;
+	iProgress.iMessagePartsNotFound = iProgress.iFoldersNotFound = 0;
+	iProgress.iErrorCode = KErrNone;
+
+	// also reset the counts in the ImapSession
+	iSession->ResetStats();
+	iFolderSync->ResetStats();
+	}
+
+void CImImap4Synchronise::SynchroniseDeletesL(TRequestStatus& aStatus, TMsvId aServiceId)
+	{
+	DBG((_L8("CImImap4Synchronise::SynchroniseDeletesL")));
+
+	__ASSERT_DEBUG(aServiceId!=KMsvNullIndexEntryId, gPanic(EInvalidService));
+
+	iServiceId = aServiceId;
+
+	ResetStats();
+
+	// Get the list of folders which need to be synchronized
+	iProgress.iFoldersToDo=iFolderList->Count();
+
+	GetInboxL();
+	iSession->SetInbox(iInbox);
+	
+	Queue(aStatus);
+
+	iProgress.iState=TImap4SyncProgress::EDeleting;
+	
+	if (iSession->IsIdling())
+		{
+		iState=ESynchroniseDeletes;
+
+		iSession->SyncStopIdleL(iStatus);
+		SetActive();
+		}
+	else
+		{
+		if (ProcessPendingDeleteOpsL( iInbox, EFalse ))
+			{
+			iSession->SelectL(iStatus,iInbox,ETrue);
+
+			iState = EInboxLateExpunge;
+			SetActive();
+			}
+		else if (ProcessPendingDeleteOpsListL( EFalse ) )
+			{
+			iState = EFolderLateExpunge;
+			}
+		else
+			{
+			iProgress.iState=TImap4SyncProgress::EIdle;
+			Complete(KErrNone);
+			}
+		}
+	}
+
+// Synchronise mirror tree with remote server
+void CImImap4Synchronise::SynchroniseL(TRequestStatus& aStatus, TMsvId aService, TBool aNewInvisible, TBool aPerformDeletes, TBool aConnectAndSync)
+	{
+	DBG((_L8("CImImap4Synchronise::SynchroniseL(service=%x,newInvisible=%d,performDeletes=%d)"),
+		 aService, aNewInvisible, aPerformDeletes));
+
+	Queue(aStatus);
+
+	// Note where this list came from
+	iServiceId=aService;
+	iFolderId=iServiceId;
+
+	// Note the invisibility
+	iNewFoldersAreInvisible=aNewInvisible;
+	iPerformDeletes = aPerformDeletes;
+
+	iIdleBeforeCommand = aConnectAndSync;
+	
+	// set iPendingOpOnFolder flag
+	iPendingOpOnFolder=EFalse;
+	
+	// Get the synchronise settings
+	iSynchroniseStrategy=iSession->ServiceSettings()->Synchronise();
+	iSubscribeStrategy=iSession->ServiceSettings()->Subscribe();
+
+	DBG((_L8("iSynchroniseStrategy=%d, iSubscribeStrategy=%d"),
+		iSynchroniseStrategy,iSubscribeStrategy));
+
+	GetInboxL();
+	ResetStats();
+	iSession->SetInbox(iInbox);
+
+	// Reset stats: 1 folder to do (inbox)
+	iProgress.iFoldersToDo=1;
+	iProgress.iState=TImap4SyncProgress::ESyncInbox;
+	
+	if (iSession->IsIdling())
+		{
+		iIdleBeforeCommand=ETrue;
+		iState=ESynchronise;
+
+		iSession->SyncStopIdleL(iStatus);
+		SetActive();
+		}
+	else
+		{
+		// Synchronise with the inbox
+		iSession->SelectL(iStatus,iInbox,ETrue);
+		iState=EInboxSelect;
+		SetActive();
+		}
+	}
+
+void CImImap4Synchronise::SortFolderListL()
+	{
+	// Clear list of folders to sync, and subscribe/unsubscribe lists
+	iFolderList->Reset();
+	iFolderListDest->Reset();
+	iSubscribeList->Reset();
+	iUnsubscribeList->Reset();
+
+	// Add folders
+	AddLocalFoldersL(iServiceId);
+
+	// Sort it by last-sync date (oldest first)
+	TKeyArrayFix timeKey(_FOFF(TImImap4SyncList,iLastSync),ECmpTInt64);
+
+	// Perform the sort on each of the lists separately
+	iFolderList->Sort(timeKey);
+	iFolderListDest->Sort(timeKey);
+
+	// Merge the two lists and clear the second one
+	for(TInt i=0; i<iFolderListDest->Count(); i++) 
+		iFolderList->AppendL((*iFolderListDest)[i]);
+	iFolderListDest->Reset();
+	}
+
+void CImImap4Synchronise::AddIfNotThereL(TMsvId aFolder, CArrayFix<TImImap4SyncList>* aFolderList)
+	{
+	// first see if we already have this folder and return if we do
+	for (TInt i=0; i < aFolderList->Count(); i++)
+		{
+		if ((*aFolderList)[i].iFolder == aFolder)
+			return;
+		}
+
+	// don't add the inbox or service
+	if (aFolder == iInbox || aFolder == iServiceId)
+		return;
+	
+	// visit folder
+	SetEntryL(aFolder);
+	TMsvEmailEntry entry=iEntry->Entry();
+
+	// not there so add it
+	TImImap4SyncList add;
+	add.iFolder=aFolder;
+	add.iNotSelectable=EFalse;
+	add.iLastSync=entry.iDate;
+	// previously we adjusted the date of source folders to bring them
+	// earlier in the list. No need to do this now as they
+	// automatically appear before subscriptions/destinations
+
+	// If this is a \NoSelect marked folder, then we need to note this, so
+	// that at sync time we just make the folder visible, as opposed to
+	// trying to select it
+	if (!entry.Mailbox())
+		add.iNotSelectable=ETrue;
+	
+	DBG((_L8("Adding folder '%S' to synchronise todo list (mailbox=%d)"),
+					   &entry.iDetails, entry.Mailbox()?1:0));
+
+	aFolderList->AppendL(add);
+	}
+
+// Add local (subscribed) folders to the 'to do' iFolderList. Recursive.
+void CImImap4Synchronise::AddLocalFoldersL(const TMsvId aFolder)
+	{
+	// Select the entry
+	SetEntryL(aFolder);
+	TMsvEmailEntry entry=iEntry->Entry();
+
+	// Is it actually a folder or service? If not, ignore it. 
+	if (entry.iType!=KUidMsvServiceEntry &&
+		entry.iType!=KUidMsvFolderEntry)
+		return;
+
+	DBG((_L8("CImImap4Synchronise::AddLocalFolders(%x), iSync=%d iSubs=%d"),
+					   aFolder,iSynchroniseStrategy,iSubscribeStrategy));
+
+	// What we do now depends on the strategy
+	TBool addthisone=EFalse;
+	switch(iSynchroniseStrategy)
+		{
+	case EUseLocal:
+		// Is it locally subscribed?
+		if (entry.LocalSubscription())
+			addthisone=ETrue;
+		break;
+
+	case EUseRemote:
+		// Is it remotely subscribed?
+		if (entry.Subscribed())
+			addthisone=ETrue;
+		break;
+
+	case EUseCombination:
+		// Either will do
+		if (entry.LocalSubscription() || entry.Subscribed())
+			addthisone=ETrue;
+		break;
+		}
+
+	// Any outstanding operations?
+	RefreshOutstandingOpsL(aFolder);
+
+	if (!entry.Orphan())
+		{
+		// check each and add the folder and destination folders. Add
+		// source folders to one list, destination and just subscribed
+		// ones to the second list, the two lists are merged
+		// together before use
+		if (iOutstandingOps->CountOperations())
+			{
+			AddIfNotThereL(aFolder, iFolderList);
+		
+			for(TInt a=0; a<iOutstandingOps->CountOperations(); a++)
+				{
+				TMsvId dest = iOutstandingOps->Operation(a).TargetMessageId();
+				if (dest != KMsvNullIndexEntryId)
+					AddIfNotThereL(dest, iFolderListDest);
+				}
+			}
+
+		// add subscribed afterwards
+		if (addthisone)
+			AddIfNotThereL(aFolder, iFolderListDest);
+		}	
+
+	// Any children?
+	CMsvEntrySelection *children=new (ELeave) CMsvEntrySelection;
+	CleanupStack::PushL(children);
+	GetChildrenL(*children);
+	TInt noofchildren=children->Count();
+
+	if (!entry.Orphan() && aFolder != iInbox && aFolder != iServiceId)
+		{
+		if (addthisone)
+			{
+			// Do updating
+			switch(iSubscribeStrategy)
+				{
+			case EUpdateNeither:
+				break;
+
+			case EUpdateLocal:
+			case EUpdateBoth:
+				if (!entry.LocalSubscription())
+					{
+					// Update local subscription flag
+					entry.SetLocalSubscription(ETrue);
+					SetEntryL(aFolder);
+					ChangeEntryBulkL(entry);
+					}
+
+				// Doing both?
+				if (iSubscribeStrategy!=EUpdateBoth)
+					break;
+
+				// Fall through...
+
+			case EUpdateRemote:
+				if (!entry.Subscribed())
+					{
+					// Queue subscribe command
+					iSubscribeList->AppendL(aFolder);
+
+					DBG((_L8("Adding folder '%S' to remote subscribe todo list"),&entry.iDetails));
+					}
+				break;
+				}
+			}
+		else // if (!addthisone)
+			{
+			// Do updating
+			switch(iSubscribeStrategy)
+				{
+			case EUpdateNeither:
+				break;
+
+			case EUpdateLocal:
+			case EUpdateBoth:
+				if (entry.LocalSubscription())
+					{
+					// Update local subscription flag
+					entry.SetLocalSubscription(EFalse);
+					SetEntryL(aFolder);
+					ChangeEntryBulkL(entry);
+					}
+
+				// Doing both?
+				if (iSubscribeStrategy!=EUpdateBoth)
+					break;
+
+				// Fall through...
+
+			case EUpdateRemote:
+				if (entry.Subscribed())
+					{
+					// Queue subscribe command
+					iUnsubscribeList->AppendL(aFolder);
+
+					DBG((_L8("Adding folder '%S' to remote unsubscribe todo list"),&entry.iDetails));
+					}
+				break;
+				}
+
+			// This folder is not subscribed, but has children. 
+			// If any children are messages, then delete.
+			if (noofchildren)
+				{
+				DBG((_L8("Checking unsubscribed folder (%S) for messages"),&entry.iDetails));
+
+				// This folder is not subscribed to, so check if it has any messages.
+				// Do each in turn
+				TInt child = children->Count();
+				while (child--)
+					{
+					SetEntryL((*children)[child]);
+					TMsvEmailEntry entry=iEntry->Entry();
+
+					// Is it a message?
+					if (entry.iType==KUidMsvMessageEntry)
+						{
+						DBG((_L8("Deleting unsubscribed folder message(%x)"),(*children)[child]));
+
+						// Yup its a message - delete it!
+						iSession->DeleteMessageL((*children)[child]);
+						}
+					}
+
+				// If we've some children then get the children list
+				// again
+				SetEntryL(aFolder);
+				GetChildrenL(*children);
+				noofchildren=children->Count();
+				}
+			}
+		}
+	
+	// Any children?
+	if (noofchildren)
+		{
+		// Do each in turn
+		for(TInt child=0;child<children->Count();child++)
+			AddLocalFoldersL((*children)[child]);
+		}
+
+	CleanupStack::PopAndDestroy(children);
+	}
+
+// Report progress
+TImap4SyncProgress CImImap4Synchronise::Progress()
+	{
+	TImap4SyncProgress progress = iProgress;
+	
+	// Make sure we don't get stuck in sync folder mode. Fix for DEF053846.
+	if (iProgress.iState == TImap4SyncProgress::ESyncFolderTree && !iFolderSync->IsActive())
+		{
+		iProgress.iState = TImap4SyncProgress::EIdle;
+		}
+	
+	// get the info from the folder sync
+	// currently OrphanedFolders and NewFolders
+	if (iState >= ESynchroniseFolderTree)
+		iFolderSync->IncProgress(progress);
+
+	// get info from the session (note overwrites the msgs counts).
+	iSession->IncSyncStats(progress);
+
+	// when synchronising (ie getting new headers) then we use the
+	// counts from the session otherwise use our own count
+	if (iProgress.iState != TImap4SyncProgress::ESyncOther &&
+		iProgress.iState != TImap4SyncProgress::ESyncInbox )
+		{
+		progress.iMsgsDone=iProgress.iMsgsDone;
+		progress.iMsgsToDo=iProgress.iMsgsToDo;
+		}
+
+	// Return the modified progress
+	return(progress);
+	}
+
+// Called when parent wants to cancel current operation
+void CImImap4Synchronise::DoCancel()
+	{
+	DBG((_L8("CImImap4Synchronise::DoCancel() called. Cancelling session")));
+
+	// Cancel any outstanding ops
+	iFolderSync->Cancel();
+	iCompound->Cancel();
+	iSession->Cancel();
+
+	// Not doing nuffink
+	iState=ESyncStateIdle;
+
+	// Parent
+	CMsgActive::DoCancel();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/src/IMPSMAIN.CPP	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,51 @@
+// Copyright (c) 1998-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:
+// IMPSMAIN.CPP 
+//
+
+#include <e32std.h>
+#include <barsc.h>		// RResourceFile
+#include <bautils.h>	// Bafl::
+#include <msvutils.h>
+#include <miuthdr.h>
+#include "impspan.h"
+#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS  
+#include "timrfc822datefield.h"
+#endif
+
+GLDEF_C void gPanic(TImpsPanic aPanic)
+	{
+	User::Panic(_L("IMPS"),aPanic);
+	}
+
+GLDEF_C void OpenResourceFileL(RResourceFile& rFile, RFs& anFs)
+	{
+//	NB need to check on all drives - won't necessarily be on
+	//	the same one as IMPS.DLL
+	//
+	TFileName fileName(KImEngineResourceFile);
+	MsvUtils::AddPathAndExtensionToResFileL(fileName);
+	BaflUtils::NearestLanguageFile( anFs, fileName );
+	if (BaflUtils::FileExists(anFs,fileName))
+		{
+		rFile.OpenL(anFs,fileName);		// Qualified: no leavescan error
+		return;
+		}
+	User::Leave(KErrNotFound);
+	}
+
+GLDEF_C void CloseResourceFile( TAny* file )
+	{
+	((RResourceFile*)file)->Close();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/src/IMPSMTM.CPP	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,2246 @@
+// Copyright (c) 1998-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 "impspan.h"
+
+#include "impsmtm.h"
+#include <msventry.h>
+#include <imapset.h>
+#include <miutset.h>
+#include <offop.h>
+#include <msvreg.h>
+#include <imapcmds.h>
+#include <logwrap.h>
+#include <imcvutil.h>
+#include <cemailaccounts.h>
+
+#include "imapsess.h"
+#include "fldsync.h"
+#include "imapsync.h"
+#include "imapcomp.h"
+#include "imapoffl.h"
+#include "impsutil.h"
+
+#ifdef _DEBUG
+#define LOG_COMMANDS(a) iPrimarySession->iSession->LogText a
+#define DBG(a) a
+#define PRINTING
+#else
+#define LOG_COMMANDS(a)
+#define DBG(a)
+#undef PRINTING
+#endif
+
+// Type of MTM request: used only in this file
+enum
+	{
+	EMtmCopyToLocal=1,
+	EMtmMoveToLocal,
+	EMtmCopyFromLocal,
+	EMtmMoveFromLocal,
+	EMtmCopyWithinService,
+	EMtmMoveWithinService,
+	EMtmPopulate
+	};
+
+// Code for the active wrapper
+CActiveWrapper* CActiveWrapper::NewL(TInt aID)
+	{
+	CActiveWrapper* self=new(ELeave)CActiveWrapper(aID);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CActiveScheduler::Add( self );
+	CleanupStack::Pop();
+	return self;
+	}
+
+CActiveWrapper::CActiveWrapper(TInt aID) : CActive(0), iID(aID)
+	{
+	}
+
+void CActiveWrapper::ConstructL()
+	{
+	// The object is a session
+	iSession=CImImap4Session::NewL(iID, *this);
+
+	// Get a compound operation
+	iCompound=CImImap4Compound::NewL(iSession);
+
+	// If we're the primary session, we get a fullsync object too
+	if (iID==1)
+		iFullSync=CImImap4Synchronise::NewL(iSession);
+	}
+
+void CActiveWrapper::StartL(MActiveWrapperObserver* aManager)
+	{
+	DBG((iSession->LogText(_L8("CActiveWrapper::StartL(ID=%d)"),iID)));
+
+	// The request has already been issued with our iStatus, so here all we
+	// do is note down the completion information and do a SetActive()
+	iParentPtr=aManager;
+	// Activate the observer as well, in case the request is cancelled.
+	iParentPtr->Activate();
+	SetActive();
+	}
+
+// Pointer to ActiveWrapper's iStatus, so direct commands to session (see above)
+// use the correct iStatus.
+TRequestStatus* CActiveWrapper::SessionStatus()
+	{
+	// Return the pointer
+	return(&iStatus);
+	}
+
+// Set entry pointers for classes the wrapper owns
+void CActiveWrapper::SetEntry(CMsvServerEntry* aEntry)
+	{
+	iSession->SetEntry(aEntry);
+	iCompound->SetEntry(aEntry);
+	if (iFullSync)
+		iFullSync->SetEntry(aEntry);
+	}
+
+void CActiveWrapper::DoCancel()
+	{
+	DBG((iSession->LogText(_L8("CActiveWrapper::DoCancel(ID=%d)"),iID)));
+
+	// Cancel anything we might have outstanding
+	if (iFullSync)
+		iFullSync->Cancel();
+	iCompound->Cancel();
+	if( !iSession->IsCancelling())
+		{
+		// Can only cancel the session if we're not waiting for a cancelled fetch
+		// to complete.
+		iSession->Cancel();	
+		}
+
+	// Tell parent we've completed: DON'T complete it ourselves.
+	iParentPtr->RequestCompleted(iID,KErrCancel);
+	}
+
+#ifdef PRINTING
+void CActiveWrapper::DoComplete(TInt aStatus)
+#else
+void CActiveWrapper::DoComplete(TInt /*aStatus*/)
+#endif
+	{
+	DBG((iSession->LogText(_L8("CActiveWrapper::DoComplete(%d, id=%d)"),aStatus,iID)));
+	}
+
+void CActiveWrapper::RunL()
+	{
+	// IMPORTANT: The contents of this CActiveWrapper::RunL() MUST NOT ever User::Leave()
+	DBG((iSession->LogText(_L8("ActiveWrapper RunL(ID=%d, result=%d)"),iID,iStatus.Int())));
+
+	TInt error=iStatus.Int();
+	Cancel(); // Obvious to do it here
+	iParentPtr->RequestCompleted(iID,error);
+	}
+
+CActiveWrapper::~CActiveWrapper()
+	{
+	Cancel();
+	delete iSession;
+	delete iCompound;
+	delete iFullSync;
+	}
+
+void CActiveWrapper::NonCompletedFailure()
+	{
+	DBG((iSession->LogText(_L8("ActiveWrapper::NonCompletedFailure (%d)"), iID)));
+
+	// A failure has occured on the session, but there is no outstanding asynchronous
+	// request on it. This can happen if for instance we get a disconnect while doing
+	// a cancel and idle operation. Pass the failure on to the parent.
+
+	iParentPtr->NonCompletedFailureOnSession(iID);
+	}
+
+// Return of current imap session
+CImImap4Session* CActiveWrapper::GetImap4Session()
+	{
+	return iSession;	
+	}
+
+// -----------------------------------------------------------------------
+
+// The actual MTM
+EXPORT_C CImap4ServerMtm* CImap4ServerMtm::NewL(CRegisteredMtmDll& aRegisteredMtmDll,CMsvServerEntry* aEntry)
+	{
+	CImap4ServerMtm* self=new CImap4ServerMtm(aRegisteredMtmDll,aEntry);
+	if (self==NULL)
+		{
+		aRegisteredMtmDll.ReleaseLibrary();
+		User::Leave(KErrNoMemory);
+		}
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop();
+	return self;
+	}
+
+void CImap4ServerMtm::ConstructL()
+	{
+	// Make an Imap4 session: make it under the activewrapper, so we can have
+	// more than one at a time
+
+	// The primary session is the one that does the full sync
+	iPrimarySession=CActiveWrapper::NewL(1);
+
+	// The secondary session is used if we get fetch requests while the
+	// primary session is busy
+	iSecondarySession=CActiveWrapper::NewL(2);
+
+	// create an offline op controller
+	iOffLineControl=CImap4OffLineControl::NewL(iServerEntry, iPrimarySession->iSession);
+
+	// create the utils object
+	iUtils = CImap4Utils::NewL(iServerEntry);
+	
+	// tell the FullSync session about them
+	iPrimarySession->iFullSync->SetOffLineControl(iOffLineControl);
+	iPrimarySession->iFullSync->SetUtils(iUtils);
+
+	// Get an entry selection
+	iSelection=new (ELeave) CMsvEntrySelection;
+
+	// We're disconnected at first
+	iLastSessionState=TImap4GenericProgress::EDisconnected;
+
+	// We need to see invisible entries
+	TMsvSelectionOrdering invisible;
+	invisible=iServerEntry->Sort();
+	invisible.SetShowInvisibleEntries(ETrue);
+	iServerEntry->SetSort(invisible);
+
+	// Tell sessions and foldersync about it
+	iPrimarySession->SetEntry(iServerEntry);
+	iSecondarySession->SetEntry(iServerEntry);
+	}
+
+// MTM destructor: clean up - this involves removing the sessions.
+CImap4ServerMtm::~CImap4ServerMtm()
+	{
+	// We may still be active
+	Cancel();
+
+	// Ensure service is marked as offline (if the serviceid was initialised, anyway)
+	if (iServiceId && iServiceSettings)
+		{
+		// Make stuff invisible as necessary
+		TRAP_IGNORE(MarkOnOrOfflineL(EFalse));
+
+		// Get rid of settings
+		delete iServiceSettings;
+		}
+
+	// Clean up
+	delete iSelection;
+	delete iOneSelection;
+	delete iPrimarySession;
+	delete iSecondarySession;
+	delete iOffLineControl;
+	delete iUtils;
+	}
+
+// Do setentry, leave if there is an error
+void CImap4ServerMtm::SetEntryL(const TMsvId aId)
+	{
+	User::LeaveIfError(iServerEntry->SetEntry(aId));
+	}
+
+// Change entry, leave if error
+void CImap4ServerMtm::ChangeEntryL(const TMsvEntry& aEntry)
+	{
+	User::LeaveIfError(iServerEntry->ChangeEntry(aEntry));
+	}
+
+// Get children, leave if error
+void CImap4ServerMtm::GetChildrenL(CMsvEntrySelection& aSelection)
+	{
+	User::LeaveIfError(iServerEntry->GetChildren(aSelection));
+	}
+
+// remove an id, leave if error, moves to the parent first
+void CImap4ServerMtm::DeleteEntryL(TMsvId aId)
+	{
+	SetEntryL(aId);
+	SetEntryL(iServerEntry->Entry().Parent());
+	User::LeaveIfError(iServerEntry->DeleteEntry(aId));
+	}
+
+// Hierarchically make all folders visible/invisible: we go down until we can't
+// find any more folders, so this won't affect messages with subfolders.
+//
+// We don't use the bulk functions as we don't want to affect messages in the
+// folder, and we have to scan the entries to check for recursion anyway.
+void CImap4ServerMtm::ChangeVisibilityL(TMsvId aParent, TBool aInvisible)
+	{
+	ChangeVisibilityL(aParent, aInvisible, ETrue, KUidMsvFolderEntry);
+	}
+
+void CImap4ServerMtm::ChangeVisibilityL(TMsvId aParent, TBool aInvisible, TBool aRecurse, TUid aType)
+	{
+	DBG((iPrimarySession->iSession->LogText(_L8("ChangeVisibilityL(%x, %d)"),aParent,aInvisible)));
+
+	// Get children at this level
+	CMsvEntrySelection* selection=new (ELeave) CMsvEntrySelection;
+	CleanupStack::PushL(selection);
+
+	CMsvEntrySelection* folders=new (ELeave) CMsvEntrySelection;
+	CleanupStack::PushL(folders);
+
+	SetEntryL(aParent);
+	GetChildrenL(*selection);
+
+	if (selection->Count())
+		{
+		DBG((iPrimarySession->iSession->LogText(_L8("  Found %d children"),selection->Count())));
+
+		for(TInt child=0;child<selection->Count();child++)
+			{
+			// Move to this child
+			SetEntryL((*selection)[child]);
+			TMsvEntry message=iServerEntry->Entry();
+
+			DBG((iPrimarySession->iSession->LogText(_L8("  type %x visible %d"),message.iType,message.Visible())));
+			
+			// Is this the type we want to change?
+			if (message.iType==aType)
+				{
+				// Add to selection to do bulk change on, if necessary
+				if ((message.Visible() && aInvisible) ||
+					(!message.Visible() && !aInvisible))
+					{
+					DBG((iPrimarySession->iSession->LogText(_L8("  Adding %x to change list"),message.Id())));
+
+					folders->AppendL(message.Id());
+					}
+				}
+			
+			// Recurse downwards
+			if (aRecurse && message.iType==KUidMsvFolderEntry)
+				ChangeVisibilityL(message.Id(),aInvisible,aRecurse,aType);
+			}
+
+		// Change its visibility off all children if necessary
+		if (folders->Count())
+			{
+			// Do the change to the invisible flag (actual constant for the
+			// flag we want is private :( )
+			SetEntryL(aParent);
+			User::LeaveIfError(iServerEntry->ChangeAttributes(*folders,
+								aInvisible?0:KMsvVisibilityAttribute,
+								aInvisible?KMsvVisibilityAttribute:0));
+			}
+		}
+
+	// Release the service entry
+	SetEntryL(KMsvNullIndexEntryId);
+
+	// Get rid of selection
+	CleanupStack::PopAndDestroy(2);
+	}
+void CImap4ServerMtm::ClearNewFlagL(TMsvId aParent)
+	{
+	// Get children at this level
+	CMsvEntrySelection* selection=new (ELeave) CMsvEntrySelection;
+	CleanupStack::PushL(selection);
+	CMsvEntrySelection* msgs=new (ELeave) CMsvEntrySelection;
+	CleanupStack::PushL(msgs);
+	SetEntryL(aParent);
+	GetChildrenL(*selection);
+	// for each child
+	TInt count=selection->Count();
+	for(TInt child=0;child<count;child++)
+		{
+		SetEntryL((*selection)[child]);
+		TMsvEntry entry=iServerEntry->Entry();
+		if (entry.New()&& entry.iType==KUidMsvMessageEntry)
+			msgs->AppendL(entry.Id());
+		// if this is a folder then recurse
+		if (entry.iType==KUidMsvFolderEntry)
+			ClearNewFlagL((*selection)[child]);
+		}
+	if (msgs->Count())// change attribute only when it has finished looking at all the children
+		{
+		SetEntryL(aParent);
+		User::LeaveIfError(iServerEntry->ChangeAttributes(*msgs,0,KMsvNewAttribute));
+		iPrimarySession->iSession->LogText(_L8("number of new msgs = (%d)"),msgs->Count());
+		}
+	CleanupStack::PopAndDestroy(2); // selection,msgs
+	}
+
+
+
+// Mark service as on or offline
+void CImap4ServerMtm::MarkOnOrOfflineL(const TBool aOnline)
+	{
+	// Mark service entry as on/offline	
+	SetEntryL(iServiceId);
+	TMsvEntry entry=iServerEntry->Entry();
+	entry.SetConnected(aOnline);
+	ChangeEntryL(entry);
+
+	// Release the service entry
+	SetEntryL(KMsvNullIndexEntryId);
+
+	// Going offline?
+	if (!aOnline && iServiceSettings->DisconnectedUserMode())
+		{
+		// We're an expert user going offline: don't touch anything
+		return;
+		}
+
+	// Mark all immediate children of the service as invisible
+	if (!aOnline)
+		ChangeVisibilityL(iServiceId,!aOnline);
+	}
+
+// Do the misc bits we need to when we've gone offline
+void CImap4ServerMtm::GoneOffline()
+	{
+	DBG((iPrimarySession->iSession->LogText(_L8("GoneOffline called"))));
+
+	// Cancel sessions: parking might be dangerous otherwise
+	iPrimarySession->Cancel();
+	iSecondarySession->Cancel();
+
+	// Park entries (in case a move entry has been left somewhere dangerous by a
+	// leave)
+	iPrimarySession->iSession->Park();
+	iSecondarySession->iSession->Park();
+
+	// Only do this is we have a valid service - we may not, due to being called
+	// both by the state machine and the progress entry
+	if (iServiceId)
+		{
+		// Offline, make folders invisible if we're not a disconnected mode user
+		TRAP_IGNORE(MarkOnOrOfflineL(EFalse));
+	
+		// Clear serviceid, it's not valid anymore
+		iServiceId=0;
+		}
+
+	// Settings can be dumped now
+	delete iServiceSettings;
+	iServiceSettings=NULL;
+
+	// We can now be deleted
+	iCanBeDeletedNow=ETrue;
+	}
+
+// Check selection: all entries should be of appropriate
+// type. Messages in this context means complete messages, not RFC888
+// parts of another message. parts means attachment or text
+// bodies. Make a local copy of valid entries
+
+TInt CImap4ServerMtm::CheckSelectionL(const CMsvEntrySelection& aSelection,
+									  CMsvEntrySelection* aLocalCopy,
+									  const TBool aMessages,
+									  const TBool aParts,
+									  const TBool aFolders,
+									  const TBool aIsInService)
+	{
+	// Reset copy selection
+	aLocalCopy->Reset();
+
+	// Check all entries are messages
+	for(TInt a=0;a<aSelection.Count();a++)
+		{
+		// Does entry exist?
+		TBool addIt = EFalse;
+
+		if (iServerEntry->SetEntry(aSelection[a])==KErrNone)
+			{
+			TUid type = iServerEntry->Entry().iType;
+			if ((aMessages && type==KUidMsvMessageEntry) ||
+				(aParts && (type==KUidMsvEmailTextEntry || type==KUidMsvAttachmentEntry || type==KUidMsvMessageEntry)) ||
+				(aFolders && type==KUidMsvFolderEntry))
+				{
+				TBool inEnclosingMessage=EFalse;
+
+				// Do we need to check if it's in the local service or
+				// if it is a complete message
+				if (aIsInService || (!aParts && type==KUidMsvMessageEntry))
+					{
+					// Work up the tree until we get to the service or the root
+					do
+						{
+						SetEntryL(iServerEntry->Entry().Parent());
+						if (iServerEntry->Entry().iType==KUidMsvMessageEntry)
+							inEnclosingMessage=ETrue;
+						}
+					while(iServerEntry->Entry().iType!=KUidMsvServiceEntry &&
+						  iServerEntry->Entry().Id()!=KMsvRootIndexEntryId);		
+	
+					// Are we at the service that this MTM referrs to?
+					// SJM: if offline iServiceId==0 so allow all
+					if (!aIsInService || iServiceId==0 || iServerEntry->Entry().Id()==iServiceId)
+						{
+						// it's OK if it is not a message type (in
+						// which case it has already been checked and
+						// passed) or it is not within an enclosing message
+						if (type!=KUidMsvMessageEntry || !inEnclosingMessage || aParts)
+							addIt = ETrue;
+						}
+					}
+				else
+					{
+					// Add to local copy
+					addIt = ETrue;
+					}
+				}
+			}
+
+		if (addIt)
+			aLocalCopy->AppendL(aSelection[a]);
+#ifdef _DEBUG
+		// UI shouldn't really be giving us bogus items so panic
+		else
+			gPanic(EInvalidMsvTypeToCommand);
+#endif
+		}
+
+	// Anything to do?
+	if (!aLocalCopy->Count())
+		{
+		// Nothing valid to work with
+		User::RequestComplete(iRequest,KErrNotSupported);
+		return(KErrNotSupported);
+		}
+	
+	// All OK, the selection isn't empty
+	return(KErrNone);
+	}
+
+// aId has been unsubscribed. If it has no visible child folders then
+// make it invisible and check its parent with the same test
+void CImap4ServerMtm::PropagateInvisibleFlagL(TMsvId aId)
+	{
+	DBG((iPrimarySession->iSession->LogText(_L8("PropagateInvisibleFlagL: 0x%x"), aId)));
+
+	// finish if we've reached the top
+	if (aId == KMsvRootIndexEntryId)
+		return;
+	
+	SetEntryL(aId);
+
+	// finish if we've reached a service
+	if (iServerEntry->Entry().iType == KUidMsvServiceEntry)
+		return;
+
+	// return if we've found a subscribed folder since we can't make
+	// it invisible
+	if (((TMsvEmailEntry)iServerEntry->Entry()).LocalSubscription())
+		return;
+	
+	// check the children of this unsubscribed folder
+	CMsvEntrySelection* selection=new (ELeave) CMsvEntrySelection;
+	CleanupStack::PushL(selection);
+
+	GetChildrenL(*selection);
+
+	TBool visible=EFalse;
+	for (TInt i=0; i < selection->Count(); i++)
+		{
+		SetEntryL((*selection)[i]);
+
+		// look for a visible folder
+		TMsvEmailEntry entry = (TMsvEmailEntry)iServerEntry->Entry();
+		if (entry.iType == KUidMsvFolderEntry && entry.Visible())
+			{
+			visible=ETrue;
+			break;
+			}
+		}
+	
+	CleanupStack::PopAndDestroy(); // selection
+
+	// if no child folders were visible then make this folder
+	// invisible and continue up
+	if (!visible)
+		{
+		SetEntryL(aId);
+		
+		// make this invisible
+		TMsvEntry entry = iServerEntry->Entry();
+		entry.SetVisible(EFalse);
+		ChangeEntryL(entry);
+
+		// go up
+		PropagateInvisibleFlagL(entry.Parent());
+		}
+	}
+
+// Simply change local subscription flag on a folder immediately: This is used
+// as opposed to ChangeL() as this operation can occur offline.
+
+// SJM: If SubscribeStrategy is UpdateRemote or UpdateBoth then doing
+// this should trigger a RemoteSubscription?
+
+TInt CImap4ServerMtm::SetLocalSubscription(const TMsvId aFolder, TBool aSubscribed)
+	{
+	TInt err;
+
+	// Move to the entry
+	if ((err=iServerEntry->SetEntry(aFolder))!=KErrNone)
+		return(err);
+
+	// Check it's a folder
+	if (iServerEntry->Entry().iType!=KUidMsvFolderEntry)
+		return(KErrNotSupported);
+
+	DBG((iPrimarySession->iSession->LogText(_L8("SetLocalSubscription: 0x%x %d"), aFolder, aSubscribed)));
+		
+	// Twiddle flag
+	TMsvEmailEntry entry=iServerEntry->Entry();
+	entry.SetLocalSubscription(aSubscribed);
+	return(iServerEntry->ChangeEntry(entry));
+	}
+
+
+// Perform a general move/copy function: this tidies up a lot of the Copy/Move
+// MTM specifics into one place
+void CImap4ServerMtm::MtmCommandL(const TInt aType,const CMsvEntrySelection& aSelection,
+								  TMsvId aDestination, TRequestStatus& aStatus)
+	{
+	iRequest=&aStatus;
+	// reset error code
+	iProgressErrorCode=KErrNone;
+	
+	// Is source remote? Ensure we check it's from our service
+	TBool checksource=ETrue;
+	if (aType==EMtmCopyFromLocal || aType==EMtmMoveFromLocal)
+		checksource=EFalse;
+
+	// we can only handle parts of messages on Populate
+	TBool handleParts=EFalse;
+	if (aType==EMtmPopulate||aType==EMtmCopyToLocal)
+		handleParts=ETrue;
+	
+	// Check selection contains messages, or maybe parts
+	if (CheckSelectionL(aSelection,iSelection,ETrue,handleParts,EFalse,checksource))
+		return;
+
+	// Save destination
+	iDestination=aDestination;
+
+	// Are we online?
+	if (!iPrimarySession->iSession->Connected())
+		{
+		iProgressMsgsToDo=iSelection->Count();
+		iProgressMsgsDone=0;
+
+		// set state for dorunl
+		switch(aType)
+			{
+		case EMtmCopyToLocal:			
+			iState=iSavedState=EMtmStateOffLineCopyToLocal;
+			iRequestedOperation=TImap4GenericProgress::EOffLineCopyToLocal;
+			break;
+
+		case EMtmCopyFromLocal:
+			iState=iSavedState=EMtmStateOffLineCopyFromLocal;
+			iRequestedOperation=TImap4GenericProgress::EOffLineCopyFromLocal;
+			break;
+
+		case EMtmCopyWithinService:
+			iState=iSavedState=EMtmStateOffLineCopyWithinService;
+			iRequestedOperation=TImap4GenericProgress::EOffLineCopyWithinService;
+			break;
+
+		case EMtmMoveToLocal:
+			iState=iSavedState=EMtmStateOffLineMoveToLocal;
+			iRequestedOperation=TImap4GenericProgress::EOffLineMoveToLocal;
+			break;
+
+		case EMtmMoveFromLocal:
+			iState=iSavedState=EMtmStateOffLineMoveFromLocal;
+			iRequestedOperation=TImap4GenericProgress::EOffLineMoveFromLocal;
+			break;
+
+		case EMtmMoveWithinService:
+			iState=iSavedState=EMtmStateOffLineMoveWithinService;
+			iRequestedOperation=TImap4GenericProgress::EOffLineMoveWithinService;
+			break;
+
+		case EMtmPopulate:
+			{
+			iState=iSavedState=EMtmStateOffLinePopulate;
+			iRequestedOperation=TImap4GenericProgress::EOffLinePopulate;
+			break;
+			}
+		default:
+			break;
+			}
+		TRequestStatus* pS=(&iStatus);
+		User::RequestComplete(pS,KErrNone);
+		SetActive();
+		}
+	else
+		{
+		TRequestStatus* status;
+
+		// Default to primary session
+		iCurrentSession=iPrimarySession;
+		status=iCurrentSession->SessionStatus();
+
+		// Initialise messages to do, etc
+		iProgressMsgsToDo=iSelection->Count();
+		iProgressMsgsDone=0;
+
+		switch(aType)
+			{
+		case EMtmPopulate:
+		case EMtmCopyToLocal:
+			// We're online: is the primary session busy?
+ 			if( iBackgroundSyncInProgress || iCurrentSession->iSession->IsCancelling() ||
+ 							 		iPrimarySession->iSession->Busy())
+				{
+				DBG((iPrimarySession->iSession->LogText(_L8("Primary session busy, using secondary"))));
+
+				// We'll have to use the secondary session
+				iCurrentSession=iSecondarySession;
+
+				// Is the secondary session connected?
+				if (!iCurrentSession->iSession->Connected())
+					{
+					DBG((iPrimarySession->iSession->LogText(_L8("Connecting secondary"))));
+
+					// We need to connect the secondary session before
+					// continuing with the fetch. Do it. The source message
+					// selection has been checked and stored in iSelection,
+					// so it should be safe until the connect goes through
+					// for later issue.
+					iState=EMtmStateSecondaryConnect;
+					iSavedState=aType == EMtmPopulate ? EMtmStatePopulate : EMtmStateCopyToLocal;
+
+					// Issue the connect
+					iCurrentSession->StartL(this);
+					status=iCurrentSession->SessionStatus();
+					// Providing the reference of primary session 
+					iCurrentSession->iSession->SetPrimarySession(iPrimarySession);
+					iCurrentSession->iSession->ConnectL(*status,iServiceId);
+					break;
+					}
+				else if( iCurrentSession->iSession->IsCancelling() )
+					{
+					// Opps! Cannot do the populate currently - server busy.
+					DBG((iPrimarySession->iSession->LogText(_L8("Secondary already cancelling"))));
+					
+					User::RequestComplete(iRequest,KErrServerBusy);
+					return;
+					}
+
+				DBG((iPrimarySession->iSession->LogText(_L8("Secondary already connected, reusing"))));
+				}
+
+			// Calculate the total size of the messages to be downloaded in this selection.
+			iTotalSize = iCurrentSession->iSession->CalculateDownloadSizeL(*iSelection);
+
+			// Select relevant folder
+			iCurrentSession->StartL(this);
+			status=iCurrentSession->SessionStatus();
+			iUtils->SetUpLogMessageL((*iSelection)[0]);
+			if (aType == EMtmPopulate)
+				{
+				iState = EMtmStatePopulate;
+				// compound need to know the number of msgs to suspend imap idle calls if > 1
+				if(iProgressMsgsToDo > 0)
+					{
+					iCurrentSession->iCompound->SetMessageCount(iProgressMsgsToDo);
+					}
+				DBG((iPrimarySession->iSession->LogText(_L8("CImapMTM::MTMCommandL(): Calling iCurrentSession->iCompound->Populate()"))));
+ 				iCurrentSession->iCompound->PopulateL(*status,(*iSelection)[0],iPartialMailInfo);
+				}
+			else
+				{
+				iState = EMtmStateCopyToLocal;
+				iCurrentSession->iCompound->CopyToLocalL(*status,(*iSelection)[0],iDestination);
+				}
+			break;
+
+		case EMtmMoveToLocal:
+			// We're online, are we busy? (it's a write op, and so we must use the
+			// primary session)
+			if( iBackgroundSyncInProgress || iCurrentSession->iSession->IsCancelling() )
+				{
+				// Can't do it, we're busy
+				User::RequestComplete(iRequest,KErrServerBusy);
+				return;
+				}
+
+			// Calculate the total size of the messages to be downloaded in this selection.
+			iTotalSize = iCurrentSession->iSession->CalculateDownloadSizeL(*iSelection);
+
+			// Select relevant folder
+			iCurrentSession->StartL(this);
+			iState=EMtmStateMoveToLocal;
+			iUtils->SetUpLogMessageL((*iSelection)[0]);
+			iCurrentSession->iCompound->MoveToLocalL(*status,(*iSelection)[0],iDestination);
+			break;
+
+		case EMtmCopyFromLocal:
+		case EMtmMoveFromLocal:
+
+			// As this is a write operation, is must be done on the primary session:
+			// is it free?
+			if( iBackgroundSyncInProgress || iCurrentSession->iSession->IsCancelling() )
+				{
+				// Can't do it
+				User::RequestComplete(iRequest,KErrServerBusy);
+				return;
+				}
+
+			// Calculate the total size of the messages to be downloaded in this selection.
+			iTotalSize = iCurrentSession->iSession->CalculateDownloadSizeL(*iSelection);
+
+			iState=(aType==EMtmCopyFromLocal)?EMtmStateCopyFromLocal:EMtmStateMoveFromLocal;
+
+
+			// Start the first operation
+			iCurrentSession->StartL(this);
+			if (aType==EMtmCopyFromLocal)
+				iCurrentSession->iCompound->CopyFromLocalL(*status,(*iSelection)[0],iDestination);
+			else
+				iCurrentSession->iCompound->MoveFromLocalL(*status,(*iSelection)[0],iDestination);
+			break;
+
+		case EMtmCopyWithinService:
+		case EMtmMoveWithinService:
+			// As this is a write operation, is must be done on the primary session:
+			// is it free?
+			if( iBackgroundSyncInProgress || iCurrentSession->iSession->IsCancelling() )
+				{
+				// Can't do it
+				User::RequestComplete(iRequest,KErrServerBusy);
+				return;
+				}
+
+			// Set the state, as we may be dealing with multiple entries
+			iState=(aType==EMtmCopyWithinService)?EMtmStateCopyWithinService:
+												  EMtmStateMoveWithinService;
+
+			// Do the copy with the compound
+			iCurrentSession->StartL(this);
+			if (aType==EMtmCopyWithinService)
+				iCurrentSession->iCompound->CopyWithinServiceL(*status,*iSelection,iDestination);
+			else
+				iCurrentSession->iCompound->MoveWithinServiceL(*status,*iSelection,iDestination);
+			break;
+			}
+		}
+	}
+
+
+// CopyToLocal fetches message parts into the mirror: aDestination is currently
+// not used. This is the only command which can cause the second session to
+// connect, as it is for fetching *only* (not 'modifiable' commands which may
+// cause the current synchronisation in the primary session to hiccup). This
+// also rules out MoveToLocal, as it involves a delete on the remote server.
+void CImap4ServerMtm::CopyToLocalL(const CMsvEntrySelection& aSelection,TMsvId aDestination, TRequestStatus& aStatus)
+	{
+	aStatus=KRequestPending;
+
+	LOG_COMMANDS((_L8("MTMCOMMAND CopyToLocal(%d items to %x)"),aSelection.Count(),aDestination));
+
+	iRequestedOperation=TImap4GenericProgress::ECopyToLocal;
+	iGetMailOptions=EGetImap4EmailBodyTextAndAttachments;
+	MtmCommandL(EMtmCopyToLocal,aSelection,aDestination,aStatus);
+	}
+
+// Move To Local moves a message from the remote server to a local folder:
+// this is performed as a fetch, then a delete on the remote server.
+void CImap4ServerMtm::MoveToLocalL(const CMsvEntrySelection& aSelection,TMsvId aDestination, TRequestStatus& aStatus)
+	{
+	aStatus=KRequestPending;
+
+	LOG_COMMANDS((_L8("MTMCOMMAND MoveToLocal(%d items to %x)"),aSelection.Count(),aDestination));
+
+	// We can't do a 'movetolocal' with the destination being the same as the
+	// source, as then the mirror will be out of sync. We must be moving to somewhere
+	// outside this service. Check this.
+	if (!iOffLineControl->IdIsLocalL(aDestination))
+		{
+		TRequestStatus* status=&aStatus;
+		User::RequestComplete(status,KErrNotSupported);
+		}
+	else
+		{
+		iRequestedOperation=TImap4GenericProgress::EMoveToLocal;
+		iGetMailOptions=EGetImap4EmailBodyTextAndAttachments;
+		MtmCommandL(EMtmMoveToLocal,aSelection,aDestination,aStatus);
+		}
+	}
+
+// CopyFromLocal appends entire messages in the mirror to the server.
+void CImap4ServerMtm::CopyFromLocalL(const CMsvEntrySelection& aSelection,TMsvId aDestination, TRequestStatus& aStatus)
+	{
+	aStatus=KRequestPending;
+
+	LOG_COMMANDS((_L8("MTMCOMMAND CopyFromLocal(%d items to %x)"),aSelection.Count(),aDestination));
+
+	iRequestedOperation=TImap4GenericProgress::ECopyFromLocal;
+	MtmCommandL(EMtmCopyFromLocal,aSelection,aDestination,aStatus);
+	}
+
+// Does a CopyFromLocal (ie, IMAP APPEND of the message), then deletes the local message
+// if it was sucessful.
+void CImap4ServerMtm::MoveFromLocalL(const CMsvEntrySelection& aSelection,TMsvId aDestination, TRequestStatus& aStatus)
+	{
+	aStatus=KRequestPending;
+
+	LOG_COMMANDS((_L8("MTMCOMMAND MoveFromLocal(%d items to %x)"),aSelection.Count(),aDestination));
+
+	iRequestedOperation=TImap4GenericProgress::EMoveFromLocal;
+	MtmCommandL(EMtmMoveFromLocal,aSelection,aDestination,aStatus);
+	}
+
+// CopyWithinService copies entire messages to other folders on the server, using
+// the IMAP COPY command.
+void CImap4ServerMtm::CopyWithinServiceL(const CMsvEntrySelection& aSelection,TMsvId aDestination, TRequestStatus& aStatus)
+	{
+	aStatus=KRequestPending;
+
+	LOG_COMMANDS((_L8("MTMCOMMAND CopyWithinService(%d items to %x)"),aSelection.Count(),aDestination));
+
+	iRequestedOperation=TImap4GenericProgress::ECopyWithinService;
+	MtmCommandL(EMtmCopyWithinService,aSelection,aDestination,aStatus);
+	}
+
+// MoveWithinService copies entire messages to other folders on the server, using
+// the IMAP COPY command, then deletes the original if the copy was sucessful,
+// so performing a move.
+void CImap4ServerMtm::MoveWithinServiceL(const CMsvEntrySelection& aSelection,TMsvId aDestination, TRequestStatus& aStatus)
+	{
+	aStatus=KRequestPending;
+
+	LOG_COMMANDS((_L8("MTMCOMMAND MoveWithinService(%d items to %x)"),aSelection.Count(),aDestination));
+
+	iRequestedOperation=TImap4GenericProgress::EMoveWithinService;
+	MtmCommandL(EMtmMoveWithinService,aSelection,aDestination,aStatus);
+	}
+
+void CImap4ServerMtm::UndeleteAllL(const CMsvEntrySelection& aSelection, TRequestStatus& aStatus)
+	{
+	aStatus = KRequestPending;
+	LOG_COMMANDS((_L8("MTMCOMMAND UndeleteAll(%d items)"),aSelection.Count()));
+	if(IsActive())
+		{
+		TRequestStatus* request = &aStatus;
+		User::RequestComplete(request,KErrImapServerBusy);
+		return;
+		}
+		
+	iRequest=&aStatus;
+	iProgressErrorCode=KErrNone;
+
+	// Check selection contains only messages in the service
+	if (CheckSelectionL(aSelection,iSelection,ETrue,EFalse,EFalse,ETrue))
+		return;
+
+	iRequestedOperation=TImap4GenericProgress::EOffLineUndelete;
+
+	iProgressMsgsToDo=iSelection->Count();
+	iProgressMsgsDone=0;
+	iState=iSavedState=EMtmStateOffLineUndelete;
+
+	TRequestStatus* pS=(&iStatus);
+	User::RequestComplete(pS,KErrNone);
+	SetActive();
+	}
+
+
+void CImap4ServerMtm::DeleteAllL(const CMsvEntrySelection& aSelection, TRequestStatus& aStatus)
+	{
+	aStatus=KRequestPending;
+
+	LOG_COMMANDS((_L8("MTMCOMMAND DeleteAll(%d items)"),aSelection.Count()));
+
+	iRequest=&aStatus;
+	// reset error code
+	iProgressErrorCode=KErrNone;
+
+	if (PruneMessages(aSelection))
+		// Was this call to DeleteAllL an instruction to delete local parts of a message ?
+		// If so then we don't need to continue.
+		return;
+   
+	// Are we online?
+	if (!iPrimarySession->iSession->Connected())
+		{
+		// SJM: Surely we need something like...
+		// Check selection contains only messages - not folders
+		if (CheckSelectionL(aSelection,iSelection,ETrue,EFalse,EFalse,EFalse))
+			return;
+
+		iRequestedOperation=TImap4GenericProgress::EOffLineDelete;
+
+		iProgressMsgsToDo=iSelection->Count();
+		iProgressMsgsDone=0;
+		iState=iSavedState=EMtmStateOffLineDelete;
+
+		TRequestStatus* pS=(&iStatus);
+		User::RequestComplete(pS,KErrNone);
+		SetActive();
+		}
+	else
+		{
+		iRequestedOperation=TImap4GenericProgress::EDelete;
+
+		// We need to do this in the primary session: is it busy?
+		if (iBackgroundSyncInProgress || iPrimarySession->iSession->IsCancelling() ||
+		    iPrimarySession->iSession->Busy())
+			{
+			// It's busy, we can't do it
+			User::RequestComplete(iRequest,KErrServerBusy);
+			return;
+			}
+
+		// Message or folder to delete?
+		DBG((iPrimarySession->iSession->LogText(_L8("First is %x"),aSelection[0])));
+
+		SetEntryL(aSelection[0]);
+		if (iServerEntry->Entry().iType==KUidMsvMessageEntry)
+			{
+			DBG((iCurrentSession->iSession->LogText(_L8("Delete message"))));
+
+			// Check selection contains only messages
+			if (CheckSelectionL(aSelection,iSelection,ETrue,EFalse,EFalse,ETrue))
+				return;
+
+			iProgressMsgsToDo=iSelection->Count();
+			iProgressMsgsDone=0;
+			// Select parent folder of message
+			iCurrentSession=iPrimarySession;
+			iState=iSavedState=EMtmStateDelete;
+			TRequestStatus* status=iCurrentSession->SessionStatus();
+			iCurrentSession->iCompound->DeleteL(*status,*iSelection);
+			iCurrentSession->StartL(this);
+			}
+		else if (iServerEntry->Entry().iType==KUidMsvFolderEntry)
+			{
+			DBG((iCurrentSession->iSession->LogText(_L8("Delete folder"))));
+
+			// Check selection contains only folders
+			if (CheckSelectionL(aSelection,iSelection,EFalse,EFalse,ETrue,ETrue))
+				return;
+
+			// Delete folder
+			iCurrentSession=iPrimarySession;
+			iState=iSavedState=EMtmStateDeleteFolder;
+			TRequestStatus* status=iCurrentSession->SessionStatus();
+			iCurrentSession->iCompound->DeleteFolderL(*status,(*iSelection)[0]);
+			iCurrentSession->StartL(this);
+			}
+		else
+			gPanic(EDeleteOfUnknownType);
+		}
+	}
+
+// Create: make a folder or mailbox. Can only happen online
+void CImap4ServerMtm::CreateL(TMsvEntry aNewEntry, TRequestStatus& aStatus)
+	{
+	LOG_COMMANDS((_L8("MTMCOMMAND Create(parent %x)"),aNewEntry.Parent()));
+
+	aStatus=KRequestPending;
+	iRequest=&aStatus;
+	// reset error code
+	iProgressErrorCode=KErrNone;
+
+	// Creating a folder?
+	if (aNewEntry.iType!=KUidMsvFolderEntry)
+		{
+		// No - illegal op
+		User::RequestComplete(iRequest,KErrNotSupported);
+		return;
+		}
+
+	// Are we online and not busy?
+	if( iBackgroundSyncInProgress || iPrimarySession->iSession->IsCancelling() )
+		{
+		User::RequestComplete(iRequest,KErrServerBusy);
+		return;
+		}
+
+	// Folder or mailbox?
+	TBool isfolder=ETrue;
+	if (((TMsvEmailEntry)aNewEntry).Mailbox())
+		isfolder=EFalse;
+
+	// Use primary session: issue create folder command
+	iState=EMtmStateCreateFolder;
+	iCurrentSession=iPrimarySession;
+	TRequestStatus* status=iCurrentSession->SessionStatus();
+	iCurrentSession->iCompound->CreateL(*status,aNewEntry.Parent(),aNewEntry.iDetails,isfolder);
+	iCurrentSession->StartL(this);
+	}
+
+void CImap4ServerMtm::ChangeL(TMsvEntry aNewEntry, TRequestStatus& aStatus)
+	{
+	LOG_COMMANDS((_L8("MTMCOMMAND Change(%x)"),aNewEntry.Id()));
+
+	User::LeaveIfError(iServerEntry->SetEntry( aNewEntry.Id() ));
+	User::LeaveIfError(iServerEntry->ChangeEntry( aNewEntry ));
+
+	iRequest=&aStatus;
+	// reset error code
+	iProgressErrorCode=KErrNone;
+	
+	User::RequestComplete(iRequest, KErrNone);
+	}
+
+// SJM: Old ChangeL entry. used to be able to update flags as well as
+// rename folder. Change to only rename folder as its not obvious how
+// you'd pass the flags across
+TBool CImap4ServerMtm::RenameFolderL(TMsvId aId, const TImap4RenameFolder& aRename)
+	{
+	LOG_COMMANDS((_L8("MTMCOMMAND RenameFolder(%x) to %S"),aId,&aRename.iNewName));
+
+	// Are we online and not busy?
+	if( iBackgroundSyncInProgress || iPrimarySession->iSession->IsCancelling() )
+		{
+		User::RequestComplete(iRequest,KErrServerBusy);
+		return EFalse;
+		}
+
+	// Issue a rename command on this object
+	iState=EMtmStateRenameFolder;
+	iCurrentSession=iPrimarySession;
+	TRequestStatus* status=iCurrentSession->SessionStatus();
+	iCurrentSession->iCompound->RenameL(*status, aId, aRename.iNewName);
+	return ETrue;
+	}
+
+// id can be either the service or anything below it. If it is not the
+// service then we move up the tree until we find the service.
+void CImap4ServerMtm::LoadSettingsL(TMsvId aId)
+	{
+	// Old settings shouldn't be hanging about, but...
+	if (iServiceSettings)
+		{
+		delete iServiceSettings;
+		iServiceSettings=NULL;
+		}
+
+	// Get somewhere to store service settings
+	iServiceSettings=new (ELeave) CImImap4Settings;
+
+	// find the service
+	SetEntryL(aId);
+	while (iServerEntry->Entry().iType != KUidMsvServiceEntry)
+		SetEntryL(iServerEntry->Entry().Parent());
+
+	// Get settings for this service
+	CEmailAccounts* account = CEmailAccounts::NewLC();
+	TImapAccount id;
+	id.iImapAccountId = iServerEntry->Entry().MtmData2();  // iMtmData2 of the service entry contains TImapAccountId
+	id.iImapAccountName = iServerEntry->Entry().iDetails;
+	id.iImapService = iServerEntry->Entry().iServiceId;
+	id.iSmtpService = iServerEntry->Entry().iRelatedId;
+
+	account->LoadImapSettingsL(id, *iServiceSettings);
+   	CleanupStack::PopAndDestroy(account);    
+	}
+
+void CImap4ServerMtm::StartCommandL(CMsvEntrySelection& aSelection, TInt aCommand, const TDesC8& aParameter, TRequestStatus& aStatus)
+	{
+	LOG_COMMANDS((_L8("MTMCOMMAND StartCommand(%x)"),aCommand));
+	
+	iTotalSize = 0;
+	aStatus=KRequestPending;
+	iRequest=&aStatus;
+	// reset error code
+	iProgressErrorCode=KErrNone;
+	
+	if(iPrimarySession->iSession->IsActive())
+		LOG_COMMANDS((_L8("CImap4ServerMTM::StartCommand(): iPrimarySession->iSession is ACTIVE")));
+	else
+		LOG_COMMANDS((_L8("CImap4ServerMTM::StartCommand(): iPrimarySession->iSession is NOT ACTIVE")));
+
+        
+	// Who are we sending this request to? Get their session
+	iCurrentSession=iPrimarySession;
+	TRequestStatus* status=iCurrentSession->SessionStatus();
+	
+	// Certain commands require that we are online: check that we're online (the command may have
+	// been queued when we were online, but we've lost the connection now)
+	if (aCommand==KIMAP4MTMSynchronise || aCommand==KIMAP4MTMFullSync ||
+		aCommand==KIMAP4MTMInboxNewSync || aCommand==KIMAP4MTMFolderFullSync ||
+		aCommand==KIMAP4MTMRenameFolder || aCommand==KIMAP4MTMDisconnect ||
+		aCommand==KIMAP4MTMSyncTree || aCommand==KIMAP4MTMSelect)
+		{
+		if (!iPrimarySession->iSession->Connected())
+			{
+			// Can't hack this!
+			User::RequestComplete(iRequest,KErrDisconnected);
+			return;
+			}
+		}
+	
+	// Save command, as when it completes we would like to know what happened...
+	iState=EMtmStateMiscCommand;
+	TBool notComplete=EFalse;
+	switch(iLastCommand=aCommand)
+		{
+		case KIMAP4MTMIsConnected:
+			// Are we connected?
+			User::RequestComplete(iRequest,
+								  iPrimarySession->iSession->Connected()?KErrNone:KErrDisconnected);
+			break;
+
+		case KIMAP4MTMBusy:
+			// Are we busy?
+			if (iBackgroundSyncInProgress ||
+				iSecondarySession->iSession->Busy())
+				User::RequestComplete(iRequest,KErrServerBusy);
+			else
+				User::RequestComplete(iRequest,KErrNone);
+			break;
+
+		case KIMAP4MTMConnect:
+		case KIMAP4MTMConnectAndSynchronise:
+			if (iPrimarySession->iSession->Busy() ||
+			    iPrimarySession->iSession->Connected())
+				{
+				User::RequestComplete(iRequest,KErrServerBusy);
+				}
+			else
+				{
+				iServiceId=aSelection[0];
+
+				LoadSettingsL(iServiceId);
+
+				// We want to hang around for this one
+				iCanBeDeletedNow=EFalse;
+
+				// The selection passed through will be any messages selected for download.
+				// Inform the session about these as they may potentially be deleted during sync.
+				iCurrentSession->iSession->SetSynchronisationSelectionL(aSelection);
+
+				// Queue a connect
+				iRequestedOperation=TImap4GenericProgress::EConnect;
+				iCurrentSession->iSession->ConnectL(*status,iServiceId);
+
+				notComplete = ETrue;
+				}
+			break;
+
+		case KIMAP4MTMStartBatch:
+			// We're about to receive multiple commands from the client: ensure we
+			// stay loaded by faking the CommandExpected() result to be ETrue
+			iBatchInProgress=ETrue;
+			User::RequestComplete(iRequest,KErrNone);
+			break;
+
+		case KIMAP4MTMEndBatch:
+			// Stop faking the CommandExpected(), the client has finished with their
+			// batch of commands.
+			iBatchInProgress=EFalse;
+			User::RequestComplete(iRequest,KErrNone);
+			break;
+
+		case KIMAP4MTMCancelBackgroundSynchronise:
+			// Anything to cancel?
+			if (iBackgroundSyncInProgress)
+				{
+				// Cancel it
+				iPrimarySession->Cancel();
+				iBackgroundSyncInProgress=EFalse;
+				User::RequestComplete(iRequest,KErrCancel);
+				}
+			else
+				User::RequestComplete(iRequest,KErrNone);
+			break;
+
+		case KIMAP4MTMSelect:
+			// Queue a selection command
+			iRequestedOperation=TImap4GenericProgress::ESelect;
+			iCurrentSession->iCompound->SelectL(*status,aSelection[0]);
+			notComplete = ETrue;
+			break;
+
+		case KIMAP4MTMSynchronise:
+			// Queue a synchronise operation
+			iRequestedOperation=TImap4GenericProgress::ESync;
+			if (iClearNewFlagOnNextSync)
+				{
+				ClearNewFlagL(iServiceId);
+				iClearNewFlagOnNextSync = EFalse;
+				}
+			
+			iCurrentSession->iCompound->SynchroniseL(*status);
+			notComplete = ETrue;
+			break;
+
+		case KIMAP4MTMSyncTree:
+			// Queue a Synchronise Tree operation
+			if (iBackgroundSyncInProgress)
+				{
+				User::RequestComplete(iRequest,KErrServerBusy);
+				return;
+				}
+			
+			iRequestedOperation=TImap4GenericProgress::ESync;
+			iCurrentSession->iFullSync->SynchroniseTreeL(*status,iServiceId,ETrue);
+			notComplete = ETrue;
+			break;
+			
+		case KIMAP4MTMLocalSubscribe:
+			// Change local subscription flag on a folder
+			User::RequestComplete(iRequest,SetLocalSubscription(aSelection[0],ETrue));
+			break;
+
+		case KIMAP4MTMLocalUnsubscribe:
+			{
+			// Change local subscription flag on a folder
+			TMsvId folder = aSelection[0];
+			TInt err=SetLocalSubscription(folder,EFalse);
+			if(err==KErrNone)
+				{
+				// if we don't have any service settings then load
+				// them
+				TBool loadedSettings = EFalse;
+				if (iServiceSettings==NULL)
+					{
+					LoadSettingsL(folder);
+					loadedSettings = ETrue;
+					}
+
+				// if synchronisation setting is not remote only then
+				// update the invisibility flags
+				if (iServiceSettings->Synchronise() != EUseRemote)
+					{
+					PropagateInvisibleFlagL(folder);
+					ChangeVisibilityL(folder,ETrue,EFalse,KUidMsvMessageEntry);
+					}
+
+				// if we loaded settings especially then free them
+				// again
+				if (loadedSettings)
+					{
+					delete iServiceSettings;
+					iServiceSettings=NULL;
+					}
+				}
+			User::RequestComplete(iRequest,err);
+			break;
+			}
+
+		case KIMAP4MTMFullSync:
+			// Do a full synchronise if we're not doing one already
+			if (iBackgroundSyncInProgress)
+				{
+				// We're busy, go away
+				User::RequestComplete(iRequest,KErrServerBusy);
+				}
+			else
+				{
+				iRequestedOperation=TImap4GenericProgress::ESync;
+				if (iClearNewFlagOnNextSync)
+					{
+					ClearNewFlagL(iServiceId);
+					iClearNewFlagOnNextSync = EFalse;
+					}
+
+				// SJM: Note new folders should always be invisible as
+				// they are not subscribed
+				iCurrentSession->iFullSync->SynchroniseL(*status,iServiceId, ETrue,
+														 !iServiceSettings->DeleteEmailsWhenDisconnecting());
+				iState=EMtmStateForegroundSync;
+				notComplete = ETrue;
+				}
+			break;
+
+		case KIMAP4MTMPopulate:
+			// this function is just a copy to mirror.
+			{
+			iRequestedOperation=TImap4GenericProgress::EPopulate;
+			if (aParameter.Length() > 0)
+				{
+				TImImap4GetPartialMailInfo imap4GetPartialMailInfo;	
+				TPckgC<TImImap4GetPartialMailInfo> paramPartialPack(imap4GetPartialMailInfo);
+				paramPartialPack.Set(aParameter);
+				iPartialMailInfo = paramPartialPack();
+				}
+
+			MtmCommandL(EMtmPopulate,aSelection,KMsvNullIndexEntryId,aStatus);
+			break;
+			}
+			
+		case KIMAP4MTMInboxNewSync:
+			if (iBackgroundSyncInProgress)
+				{
+				// We're busy, go away
+				User::RequestComplete(iRequest,KErrServerBusy);
+				}
+			else
+				{
+				// First of all, find the inbox
+				CMsvEntrySelection *findinbox=new (ELeave) CMsvEntrySelection;
+				CleanupStack::PushL(findinbox);
+				SetEntryL(iServiceId);
+				GetChildrenL(*findinbox);
+				TMsvId inbox=0;
+				for(TInt a=0;a<findinbox->Count();a++)
+					{
+					SetEntryL((*findinbox)[a]);
+					if (iServerEntry->Entry().iDetails.CompareF(KIMAP_INBOX)==0)
+						{
+						inbox=(*findinbox)[a];
+						break;
+						}
+					}
+
+				// Clean up
+				CleanupStack::PopAndDestroy();
+			
+				// Found it?
+				if (inbox)
+					{
+					// Start a new-only sync of the inbox
+					iRequestedOperation=TImap4GenericProgress::ESync;
+					iCurrentSession->iCompound->NewOnlySyncL(*status,inbox);
+					notComplete = ETrue;
+					}
+				else
+					{
+					// Couldn't find it!
+					User::RequestComplete(iRequest,KErrNotFound);
+					}
+				}
+			break;
+
+		case KIMAP4MTMFolderFullSync:
+			// Start a full sync of the folder
+			iRequestedOperation=TImap4GenericProgress::ESync;
+			iCurrentSession->iCompound->FullSyncL(*status,aSelection[0]);
+			notComplete = ETrue;
+			break;
+
+		case KIMAP4MTMWaitForBackground:
+			// Wait for background operation to complete: is one running?
+			if (!iBackgroundSyncInProgress)
+				{
+				// No, just return
+				User::RequestComplete(iRequest,KErrNone);
+				}
+			else
+				{
+				// Otherwise, wait for completion
+				iState=EMtmStateWaitingForBackgroundToFinish;
+				// Activate instead of SetActive()
+				Activate();
+				}
+			break;
+
+		case KIMAP4MTMDisconnect:
+			// if we want to delete emails on disconnect and we've
+			// finished the background sync			
+			if ( iServiceSettings->DeleteEmailsWhenDisconnecting() &&
+				 !(iBackgroundSyncInProgress || iPrimarySession->iSession->IsCancelling()) )
+				{
+				// Disconnecting
+				iRequestedOperation=TImap4GenericProgress::EDelete;
+			
+				iPrimarySession->iFullSync->SynchroniseDeletesL(*status, iServiceId);
+				iPrimarySession->StartL(this);
+				}
+			else
+				{
+				// Disconnecting
+				iRequestedOperation=TImap4GenericProgress::EDisconnect;
+			
+				// Cancel both sessions
+				iPrimarySession->Cancel();
+
+				// No sync in progress now...
+				if (iBackgroundSyncInProgress)
+					iBackgroundSyncInProgress=EFalse;
+
+				// Disconnect both sessions
+				status=iPrimarySession->SessionStatus();
+				iPrimarySession->iSession->DisconnectL(*status);
+				iPrimarySession->StartL(this);
+				}
+
+			// kill off the secondary session whatever
+			iSecondarySession->Cancel();
+			status=iSecondarySession->SessionStatus();
+			iSecondarySession->iSession->DisconnectL(*status);
+			iSecondarySession->StartL(this);
+			break;
+
+		case KIMAP4MTMRenameFolder:
+			{
+			TImap4RenameFolder cmd;
+			TPckgC<TImap4RenameFolder> package(cmd);
+			package.Set(aParameter);
+			if (RenameFolderL(aSelection[0], package()))
+				notComplete = ETrue;
+			break;
+			}
+
+		case KIMAP4MTMUndeleteAll:
+			UndeleteAllL(aSelection, aStatus);
+			break;
+			
+		case KIMAP4MTMCancelOffLineOperations:
+			iOffLineControl->CancelOffLineOperationsL(aSelection);
+			User::RequestComplete(iRequest,KErrNone);
+			break;
+			
+		default:
+			User::RequestComplete(iRequest,KErrNotSupported);
+			break;
+		}
+
+	if (notComplete)
+		{
+		// Stuff to do!
+		iCurrentSession->StartL(this);
+		}
+	}
+
+// Are we finished yet?
+TBool CImap4ServerMtm::CommandExpected()
+	{
+	// ...basically, when we're disconnected we can be deleted
+	return (!iCanBeDeletedNow || iBatchInProgress);
+	}
+
+// Report progress information back to client
+const TDesC8& CImap4ServerMtm::Progress()
+	{
+	TImap4CompoundProgress progress;
+
+	// get generic status from the current session, this writes a
+	// complete GenericProgressState out apart from iOperation.  note
+	// that if we do a populate whilst background syncing (for
+	// example) then this will give details of the populate. If we are
+	// only syncing then this will give details about the sync
+	// operation
+	CActiveWrapper *session = NULL;
+	
+	if(iState==EMtmStateSecondarySessionIdle)
+		{
+		session = iPrimarySession;
+		}
+	else
+		{
+		session = iCurrentSession ? iCurrentSession : iPrimarySession;
+		}
+
+	progress.iGenericProgress = session->iCompound->Progress();
+
+	// read the sync status whatever state we are in to ensure that
+	// the structure is not left uninitialised
+	progress.iSyncProgress=iPrimarySession->iFullSync->Progress();
+	  
+	// Have we gone from non-disconnected to disconnected all of a sudden? If we have, this
+	// means that the lower layers have detected a disconnection.
+	// ignore this transition if the last thing we did is ask for a disconnection.
+	if (iLastSessionState!=TImap4GenericProgress::EDisconnected &&
+		progress.iGenericProgress.iState==TImap4GenericProgress::EDisconnected &&
+		iRequestedOperation!=TImap4GenericProgress::EDisconnect)
+		{
+		// Kick ourselves so we know we're disconnected now
+		LOG_COMMANDS((_L8("CImap4ServerMtm::Progress: Session %d suddenly disconnected"), iCurrentSession->iID));
+		
+		if(iCurrentSession->iID != 2)
+			{
+			GoneOffline();
+			}
+		}
+
+	// Save this operation to check next time
+	iLastSessionState=progress.iGenericProgress.iState;
+
+	// Put error into progress buffer
+	if( progress.iGenericProgress.iErrorCode == KErrNone )
+		progress.iGenericProgress.iErrorCode=iProgressErrorCode;
+
+	// If we're copying or moving, *we* (the mtm) keep track of the
+	// messages done: this is because these operations involve many
+	// more operations at MTM level (ie, syncs, etc) which also fiddle
+	// with the msgsdone total, as they would during a full sync.
+	switch (iRequestedOperation)
+		{
+	case TImap4GenericProgress::EMoveWithinService:
+	case TImap4GenericProgress::ECopyWithinService:
+		break;
+	case TImap4GenericProgress::EMoveToLocal:
+	case TImap4GenericProgress::ECopyToLocal:
+	case TImap4GenericProgress::EMoveFromLocal:
+	case TImap4GenericProgress::ECopyFromLocal:
+	case TImap4GenericProgress::EPopulate:
+	case TImap4GenericProgress::EDelete:	
+	case TImap4GenericProgress::EOffLineDelete:
+	case TImap4GenericProgress::EOffLineUndelete:
+	case TImap4GenericProgress::EOffLineCopyToLocal:
+	case TImap4GenericProgress::EOffLineMoveToLocal:
+	case TImap4GenericProgress::EOffLineCopyFromLocal:
+	case TImap4GenericProgress::EOffLineMoveFromLocal:
+	case TImap4GenericProgress::EOffLineCopyWithinService:
+	case TImap4GenericProgress::EOffLineMoveWithinService:
+	case TImap4GenericProgress::EOffLinePopulate:
+		progress.iGenericProgress.iMsgsToDo=iProgressMsgsToDo;
+		progress.iGenericProgress.iMsgsDone=iProgressMsgsDone;
+		break;
+	default:
+		break;
+		}
+
+#ifdef PRINTING
+	// Log the error we're returning
+	if (iProgressErrorCode!=KErrNone)
+		{
+		iPrimarySession->iSession->LogText(_L8("Progress errorcode=%d, laststate=%d currentstate=%d"),
+										   iProgressErrorCode,iLastSessionState,progress.iGenericProgress.iState);
+		}
+#endif
+
+	// put in the operation we've been asked to perform
+	progress.iGenericProgress.iOperation=iRequestedOperation;
+
+	// Copy the Sync iTotalSize flag into the Generic Total Size field, if the progress val is 0;
+	progress.iGenericProgress.iTotalSize = iTotalSize;
+
+	// construct the progress buffer
+	iProgressBuf=TImap4ProgressBuf(progress);
+	return iProgressBuf;
+	}
+
+void CImap4ServerMtm::DoCancel()
+	{
+	DBG((iPrimarySession->iSession->LogText(_L8("CImap4ServerMtm::DoCancel() when in state %d"),iState)));
+
+	// What are we doing?
+	switch(iState)
+		{
+	case EMtmStateCopyFromLocal:
+	case EMtmStateMoveFromLocal:
+	case EMtmStateCopyToLocal:
+	case EMtmStateMoveToLocal:
+	case EMtmStateCopyWithinService:
+	case EMtmStateMoveWithinService:
+	case EMtmStatePopulate:
+		// These all use the compound objects: cancel this
+		iPrimarySession->Cancel();
+		iSecondarySession->Cancel();
+		break;
+
+	case EMtmStateMiscCommand:
+		// What was the actual misc command?
+		switch(iLastCommand)
+			{
+		case KIMAP4MTMConnect:
+		case KIMAP4MTMConnectAndSynchronise:
+			// Kill primary only
+			iPrimarySession->Cancel();
+			break;
+
+		default:
+			// Cancel both sessions...
+			iPrimarySession->Cancel();
+			iSecondarySession->Cancel();
+			}
+		break;
+
+	case EMtmStateSecondaryConnect:
+		// Cancel secondary session
+		iSecondarySession->Cancel();
+		break;
+
+	case EMtmStateOffLineCopyToLocal:
+	case EMtmStateOffLineMoveToLocal:
+		iServerEntry->Cancel();
+		iOffLineControl->Cancel();
+		break;
+	case EMtmStateSecondarySessionIdle:
+		return;
+	
+	case EMtmStateDelete:
+	case EMtmStateDeleteFolder:
+	default:
+		// Cancel everything in sight
+		iPrimarySession->Cancel();
+		iSecondarySession->Cancel();
+		break;
+		}
+
+	DBG((iPrimarySession->iSession->LogText(_L8("CImap4ServerMtm::DoCancel() finished"))));
+
+	// Park entries
+	iPrimarySession->iSession->Park();
+	iSecondarySession->iSession->Park();
+
+	if (iRequest)
+		User::RequestComplete(iRequest,KErrCancel);
+	}
+
+void CImap4ServerMtm::DoRunL()
+	{
+#ifdef PRINTING
+	CImImap4Session* logsession=(iId==2)?iSecondarySession->iSession:iPrimarySession->iSession;
+	logsession->LogText(_L8("CImap4ServerMtm::DoRunL(id=%d, status=%d, state=%d)"),
+						iId,iStatus.Int(),iState);
+#endif
+
+	// Status for kicking off next command
+	TRequestStatus* status=iCurrentSession->SessionStatus();
+
+	// What were we doing?
+	switch(iState)
+		{
+	case EMtmStateMiscCommand:
+		// A misc command has completed: do we need to do anything next?
+		switch(iLastCommand)
+			{
+		case KIMAP4MTMConnect:
+		case KIMAP4MTMConnectAndSynchronise:
+			{
+			// Problems?
+			if (iCode!=KErrNone)
+				{
+				// Mark ourselves as offline, and unloadable
+				GoneOffline();
+
+				// Tell world about the error, via progress and
+				// Completion code
+				iProgressErrorCode=iCode;
+
+				// If doing a connect and sync, the caller is completed after the connect
+				// phase and the sync continues in the background. If we get an error during that
+				// sync we need to ensure we don't try to complete the caller again by checking
+				// that iRequest is not null.
+				if (iRequest != NULL)
+					{
+					User::RequestComplete(iRequest,iCode);
+					}
+				return;
+				}
+
+			// Connect was successful: update connected bit in the service entry
+			// Ignore errors, it's not the end of the world
+			TRAP_IGNORE(MarkOnOrOfflineL(ETrue));
+
+			// Mark that we need to clear new flag before next sync
+			iClearNewFlagOnNextSync = ETrue;
+			
+			// Do we need to kick off sync?
+			if (iLastCommand==KIMAP4MTMConnectAndSynchronise)
+				{
+				DBG((logsession->LogText(_L8("Kicking off background synchronise"))));
+
+				// Start full sync
+				if (iClearNewFlagOnNextSync)
+					{
+					ClearNewFlagL(iServiceId);
+					iClearNewFlagOnNextSync = EFalse;
+					}
+				// SJM: New folders should always be invisible as they are not subscribed
+				iCurrentSession->iFullSync->SynchroniseL(*status,iServiceId,ETrue,
+					!iServiceSettings->DeleteEmailsWhenDisconnecting(), ETrue);
+				iCurrentSession->StartL(this);
+
+				// Carry on as normal, completing request back to client.
+				// The synchronise will continue in the background.
+				iBackgroundSyncInProgress=ETrue;
+				}
+
+			break;
+			}
+
+		case KIMAP4MTMDisconnect:
+			// Disconnecting but marked as busy - that means we were
+			// carrying out the pending deletes
+			if (iRequestedOperation == TImap4GenericProgress::EDelete)
+				{
+				iRequestedOperation = TImap4GenericProgress::EDisconnect;
+
+				// Disconnect primary sessions
+				status=iPrimarySession->SessionStatus();
+				iPrimarySession->iSession->DisconnectL(*status);
+				iPrimarySession->StartL(this);
+				return;
+				}
+
+			// Disconnecting session 1? (primary session). If so, then clear the
+			// connected bit in the service entry.
+			if (iId==1 && iServiceId && iServiceSettings)
+				{
+				// Do "we've gone offline" stuff
+				GoneOffline();
+				}
+			break;
+			}
+		break;
+
+	case EMtmStateCopyToLocal:
+	case EMtmStateMoveToLocal:
+	case EMtmStatePopulate:
+		// if no message sent then trigger null event to get to next
+		// state
+		SetActive();
+		if (!iUtils->SendLogMessageL(iCode,iStatus))
+			{
+			TRequestStatus* status = &iStatus;
+			User::RequestComplete(status, KErrNone);
+			}
+
+		// send log message
+		iSavedState = iState;
+		iState = EMtmStateLogging;
+		return;
+
+	case EMtmStateLogging:
+		// done logging, restore old state
+		iState = iSavedState;
+		// and deliberately fall through to next case
+
+	case EMtmStateCopyFromLocal:
+	case EMtmStateMoveFromLocal:
+	case EMtmStateCopyWithinService:
+	case EMtmStateMoveWithinService:
+		// Note any error in the appropriate message
+		MessageErrorL((*iSelection)[0],iCode);
+		
+		// Note any error in the appropriate message
+		MessageErrorL((*iSelection)[0],iCode);
+		
+		// Remove completed item from selection
+		if (iState==EMtmStateCopyWithinService || iState==EMtmStateMoveWithinService)
+			{
+			TInt count=iSelection->Count();
+			iSelection->Delete(0,count);
+			iProgressMsgsDone+=count;
+			}
+		else
+			{
+			iSelection->Delete(0,1);
+			iProgressMsgsDone++;
+			}
+
+		// One more message done
+
+		// Operation done. Do next one in selection
+		if (iSelection->Count())
+			{
+			// Do the copy with the compound
+			status=iCurrentSession->SessionStatus();
+			switch(iState)
+				{
+			case EMtmStateCopyFromLocal:
+				iCurrentSession->iCompound->CopyFromLocalL(*status,(*iSelection)[0],iDestination);
+				break;
+
+			case EMtmStateMoveFromLocal:
+				iCurrentSession->iCompound->MoveFromLocalL(*status,(*iSelection)[0],iDestination);
+				break;
+
+			case EMtmStateCopyToLocal:
+				iUtils->SetUpLogMessageL((*iSelection)[0]);
+				iCurrentSession->iCompound->CopyToLocalL(*status,(*iSelection)[0],iDestination);
+				break;
+
+			case EMtmStateMoveToLocal:
+				iUtils->SetUpLogMessageL((*iSelection)[0]);
+				iCurrentSession->iCompound->MoveToLocalL(*status,(*iSelection)[0],iDestination);
+				break;
+
+			case EMtmStateCopyWithinService:
+				// Will copy all messages in one go.
+				break;
+
+			case EMtmStateMoveWithinService:
+				// Will copy all messages in one go.
+				break;
+
+			case EMtmStatePopulate:
+				iUtils->SetUpLogMessageL((*iSelection)[0]);
+				iCurrentSession->iCompound->PopulateL(*status,(*iSelection)[0],iPartialMailInfo);
+				break;
+
+			default: // Keep gcc quiet
+				break;
+				}
+
+			iCurrentSession->StartL(this);
+			return;
+			}
+		else if(iCurrentSession == iSecondarySession)
+			{
+			iSecondarySession->Cancel();
+			status = iSecondarySession->SessionStatus();
+			iSecondarySession->iSession->DisconnectL(*status);
+			iSecondarySession->StartL(this);
+			iState = EMtmStateSecondarySessionIdle;
+			iSavedState = EMtmStateSecondarySessionIdle;
+			}
+
+		break;		
+	
+	case EMtmStateDelete:
+		{
+		// Problems?
+		if (iCode!=KErrNone)
+			{
+			// Store the error on this one
+			MessageErrorL((*iSelection)[0],iCode);
+
+			// Continue through selection
+			}
+
+		// Delete completed.
+ 		TInt count=iSelection->Count();
+ 		iSelection->Delete(0,count);
+ 		iProgressMsgsDone+=count;
+
+		DBG((iCurrentSession->iSession->LogText(_L8("iMsgsDone now %d"),iProgressMsgsDone)));		
+ 		break;
+		}
+	case EMtmStateDeleteFolder:
+		// Delete completed: do the next one
+		iSelection->Delete(0,1);
+
+		// One more message done
+		iProgressMsgsDone++;
+
+		DBG((iCurrentSession->iSession->LogText(_L8("iMsgsDone now %d"),iProgressMsgsDone)));
+
+		// Anything left to do?
+		if (!iSelection->Count())
+			break;
+
+		iCurrentSession->iCompound->DeleteFolderL(*status,(*iSelection)[0]);
+		iCurrentSession->StartL(this);
+		return;
+
+	case EMtmStateOffLineDelete:
+	case EMtmStateOffLineUndelete:
+	case EMtmStateOffLineCopyToLocal:
+	case EMtmStateOffLineMoveToLocal:
+	case EMtmStateOffLineCopyFromLocal:
+	case EMtmStateOffLineMoveFromLocal:
+	case EMtmStateOffLineCopyWithinService:
+	case EMtmStateOffLineMoveWithinService:
+	case EMtmStateOffLinePopulate:
+		{		
+		if(iProgressMsgsDone == iProgressMsgsToDo)
+			break;
+		
+		if(iOneSelection)
+			delete iOneSelection;
+		iOneSelection=new (ELeave) CMsvEntrySelection;
+		iOneSelection->AppendL((*iSelection)[iProgressMsgsDone]);		
+		
+		CImap4OffLineControl::TImap4OpType opType=CImap4OffLineControl::EImap4OpDelete; //have to initialise to something!
+		switch(iState)
+			{
+		case EMtmStateOffLineDelete:
+			opType=CImap4OffLineControl::EImap4OpDelete;
+			break;
+		case EMtmStateOffLineUndelete:
+			opType=CImap4OffLineControl::EImap4OpUndelete;
+			break;
+		case EMtmStateOffLineCopyToLocal:
+			opType=CImap4OffLineControl::EImap4OpCopyToLocal;
+			break;
+		case EMtmStateOffLineMoveToLocal:
+			opType=CImap4OffLineControl::EImap4OpMoveToLocal;
+			break;
+		case EMtmStateOffLineCopyFromLocal:
+			opType=CImap4OffLineControl::EImap4OpCopyFromLocal;
+			break;
+		case EMtmStateOffLineMoveFromLocal:
+			opType=CImap4OffLineControl::EImap4OpMoveFromLocal;
+			break;
+		case EMtmStateOffLineCopyWithinService:
+			opType=CImap4OffLineControl::EImap4OpCopyWithinService;
+			break;
+		case EMtmStateOffLineMoveWithinService:
+			opType=CImap4OffLineControl::EImap4OpMoveWithinService;
+			break;
+		case EMtmStateOffLinePopulate:
+			opType=CImap4OffLineControl::EImap4OpPopulate;
+			break;
+		default:
+			break;
+			}
+		
+		if(iState == EMtmStateOffLineDelete || iState == EMtmStateOffLineUndelete)
+			{
+			iOffLineControl->StoreOfflineCommandL(opType, *iOneSelection, KMsvNullIndexEntryId, iStatus);
+			}
+		else if(iState == EMtmStateOffLinePopulate)
+			{
+			TPckgBuf<TImap4GetMailOptions> package(iGetMailOptions);
+			iOffLineControl->StoreOfflineCommandL(opType, *iOneSelection, iDestination, package, iStatus);
+			}
+		else
+			{	
+			iOffLineControl->StoreOfflineCommandL(opType, *iOneSelection, iDestination, iStatus);
+			}
+
+		iProgressMsgsDone++;
+		SetActive();
+		return;
+		}
+	case EMtmStateSecondaryConnect:
+		// We've now connected the secondary session. Issue the
+		// saved command and continue;
+		switch(iState=iSavedState)
+			{
+		case EMtmStateCopyToLocal:
+			// We've just connected, so first thing to do is to do the
+			// folder selection. No need to check the selection, as
+			// we know it contains at least 1 item from the originally
+			// issued command.
+			iUtils->SetUpLogMessageL((*iSelection)[0]);
+			iCurrentSession->iCompound->CopyToLocalL(*status,(*iSelection)[0],iDestination);
+			iCurrentSession->StartL(this);
+			return;
+		
+		case EMtmStatePopulate:
+			iUtils->SetUpLogMessageL((*iSelection)[0]);
+			iCurrentSession->iCompound->PopulateL(*status,(*iSelection)[0],iPartialMailInfo);
+			iCurrentSession->StartL(this);
+			return;
+		
+		default:
+			break;
+			}
+		break;
+
+	case EMtmStateSyncCompleted:	// FALL THROUGH
+	default:
+		break;
+		}
+
+	// Async request completed (from wrapper): also return it in the progress
+	DBG((logsession->LogText(_L8("ID %d completed with code %d"),iId,iCode)));
+
+	iProgressErrorCode=iCode;
+
+	// Park entry
+	iServerEntry->SetEntry(KMsvNullIndexEntryId);
+
+	// Only complete if we have an iRequest: we may not (ie, 2 sessions
+	// disconnecting at once)
+	if (iRequest)
+		User::RequestComplete(iRequest,KErrNone);
+	}
+
+void CImap4ServerMtm::DoComplete(TInt aStatus)
+	{
+#ifdef PRINTING
+	iPrimarySession->iSession->LogText(_L8("CImap4ServerMtm::DoComplete(%d)"),aStatus);
+#endif
+
+	// Park entry
+	iServerEntry->SetEntry(KMsvNullIndexEntryId);
+	if (iRequest)
+		User::RequestComplete(iRequest,aStatus);
+	}
+
+// Save error code in a message
+void CImap4ServerMtm::MessageErrorL(const TMsvId aMessageId, const TInt aError)
+	{
+	// Save error code: if we can't access this entry, then it's probably something to do
+	// with the error we're trying to report: ignore it silently
+	// SJM: this used to be != KerrNone - surely shome mistake
+	if (iServerEntry->SetEntry(aMessageId)==KErrNone)
+		{
+		TMsvEntry entry=iServerEntry->Entry();
+
+		// Save unnecessary writes...
+		if (entry.iError!=aError)
+			{
+			entry.iError=aError;
+			ChangeEntryL(entry);
+			}
+		}
+	}
+
+// Mixin - a child has completed
+void CImap4ServerMtm::RequestCompleted(TInt aId, TInt aCode)
+	{
+#ifdef PRINTING
+	CImImap4Session* logsession=(aId==2)?iSecondarySession->iSession:iPrimarySession->iSession;
+	logsession->LogText(_L8("CImap4ServerMtm::RequestCompleted(id=%d, result=%d, state=%d)"),aId,aCode,iState);
+#endif
+	// Is this the background sync completeing?
+	if (aId==1 && iBackgroundSyncInProgress)
+		{
+		// Not in progress any more, boyo
+		iBackgroundSyncInProgress=EFalse;
+
+		// Is anyone in the forground waiting for this to happen?
+		if (iState==EMtmStateWaitingForBackgroundToFinish)
+			{
+			// Yes: we need to complete ourselves by falling through
+			// Reset state first
+			iState=EMtmStateIdle;
+
+			// Any errors from the background sync aren't interesting to us
+			aCode=KErrNone;
+			}
+		// Makes the secondary session request, when primary completes background sync
+		else if (iState == EMtmStateSecondaryConnect || iState == EMtmStateCopyToLocal || iState == EMtmStatePopulate)
+			{
+			iProgressErrorCode=aCode;
+			return;	
+			}			
+		else if( aCode == KErrNone )
+			{
+			// Complete with the state EMtmStateSyncCompleted.  
+			// When this is caught in the DoRunL, it does nothing.
+			iState = EMtmStateSyncCompleted;
+			
+			// NOTE - only do this if there are no errors - if there is an error 
+			// then DoRunL must handle appropriately in the previous state.
+			}
+		}
+
+	// Are we doing a disconnect? If so, we will get completions from both sessions, and we're only
+	// interested in the primary one, really
+	if (iLastCommand==KIMAP4MTMDisconnect && aId!=1)
+		{
+		// Silently ignore
+		return;
+		}
+
+	// Is the code >0? If so, truncate it to 0 as it's IMPS-specific info
+	if (aCode>KErrNone)
+		aCode=KErrNone;
+
+	// Save stuff
+	iCode=aCode;
+	iId=aId;
+
+	// Set the current session to the one which has just completed so
+	// that when DoRunL() is called it knows which to deal with
+	if (aId==1)
+		iCurrentSession=iPrimarySession;
+	else
+		iCurrentSession=iSecondarySession;
+
+	// Complete *ourselves*
+	TRequestStatus *a=&iStatus;
+    User::RequestComplete(a,aCode);
+	
+	// The activation may need to be done here.
+	// e.g. the primary session already completed and then the secondary completes.
+	// e.g. EMtmCopyToLocal is started whilst we are online and a background 
+	// sync is in progress.  One completes and then the other.
+    if(!IsActive())
+    	{
+    	SetActive();
+    	}    
+	}
+	
+// This function allows a CActiveWrapper to set the CImap4ServerMtm active 
+// when it starts a request, as opposed to just when one finishes. This means
+// that Cancel()s are handled properly.
+void CImap4ServerMtm::Activate()
+	{
+	// Object may already be active as there is a primary and secondary session.
+	if(!IsActive())
+		{
+		iStatus = KRequestPending;
+		SetActive();
+		}
+	}
+
+#ifdef PRINTING
+void CImap4ServerMtm::NonCompletedFailureOnSession(TInt aId)
+#else
+void CImap4ServerMtm::NonCompletedFailureOnSession(TInt /*aId*/)
+#endif
+	{
+#ifdef PRINTING
+	CImImap4Session* logsession=(aId==2)?iSecondarySession->iSession:iPrimarySession->iSession;
+	logsession->LogText(_L8("CImap4ServerMtm::NonCompletedFailureOnSession (id=%d)"), aId);
+#endif
+
+	// A failure has occured on the session, but there is no outstanding asynchronous
+	// request on it. This can happen if for instance we get a disconnect while doing
+	// a cancel and idle operation. We need to go offline immediately.
+	GoneOffline();
+	}
+
+CImap4ServerMtm::CImap4ServerMtm(CRegisteredMtmDll& aRegisteredMtmDll, CMsvServerEntry* aEntry):
+	CBaseServerMtm(aRegisteredMtmDll,aEntry)
+	{
+	__DECLARE_NAME(_S("CImap4ServerMtm"));
+
+	// We can be deleted: at the start, we're not connected
+	iCanBeDeletedNow=ETrue;
+
+	// Add us to the scheduler
+	CActiveScheduler::Add(this);
+	}
+TBool CImap4ServerMtm::PruneMessages(const CMsvEntrySelection& aSelection)
+	{
+	TInt index = aSelection.Count();
+	
+	// See if the parent of the first entry is a message.
+	// If it is then we need to prune the entries, ie. delete them locally.
+	if (index == 0)
+		return EFalse;
+
+	TInt err = iServerEntry->SetEntry(aSelection[0]);
+
+	if (err == KErrNone)
+		{
+		err = iServerEntry->SetEntry(iServerEntry->Entry().Parent());
+		if (KUidMsvMessageEntry != iServerEntry->Entry().iType)
+			// The parent of the given entry was not a message, so we don't prune it.
+			return EFalse;
+		}
+
+	while ((index--) && (err==KErrNone))
+		{
+		// Go to the required entry
+		err = iServerEntry->SetEntry(aSelection[index]);
+
+		if (KErrNone == err)
+			{
+			// Go to the parent entry to see if it is a message entry
+			iServerEntry->SetEntry(iServerEntry->Entry().Parent());
+			TMsvEmailEntry entry = iServerEntry->Entry();
+
+			// assert that (KUidMsvMessageEntry == entry.iType)
+
+			// Clear the complete flag because we are about to delete the child parts.
+			entry.SetComplete(EFalse);
+			entry.SetBodyTextComplete(EFalse);
+			err = iServerEntry->ChangeEntry(entry);
+
+			if (KErrNone == err)
+				{
+				// Delete the body of the message.
+				iServerEntry->DeleteEntry(aSelection[index]);
+				}
+			}
+		}
+
+	User::RequestComplete(iRequest, err);
+
+	return ETrue;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/src/IMPSUTIL.CPP	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,103 @@
+// Copyright (c) 1998-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:
+// IMAP4 utils.
+// 
+//
+
+#include <e32base.h>
+#include <msvstd.h>
+#include <miuthdr.h>
+#include <imcvutil.h>
+#include <msventry.h>
+#include <logwrap.h>
+
+#include "impsutil.h"
+
+CImap4Utils* CImap4Utils::NewL(CMsvServerEntry* aEntry) 
+	{
+	CImap4Utils* self=new (ELeave) CImap4Utils();
+	CleanupStack::PushL(self);
+	self->ConstructL(aEntry);
+	CleanupStack::Pop();
+	return self;
+	}
+
+CImap4Utils::~CImap4Utils()
+	{
+	delete iLogMessage;
+	}
+
+void CImap4Utils::ConstructL(CMsvServerEntry* aEntry)
+	{
+	iEntry = aEntry;
+	
+	// get the logger (discard errors)
+	TRAPD(err,iLogMessage=CImLogMessage::NewL(iEntry->FileSession()));
+	}
+
+void CImap4Utils::ClearLogMessage()
+	{
+	if (iLogMessage)
+		iLogMessage->LogEvent().SetLink(KLogNullLink);
+	}
+
+// Helper function to set up the iLogEntry object 
+void CImap4Utils::SetUpLogMessageL(TMsvId aId)
+	{
+	if (iLogMessage)
+		{
+		TBuf<KLogMaxSharedStringLength> string;
+
+		// if the entry isn't there then setup what we can of the log
+		// message anyway
+		if (iEntry->SetEntry(aId) == KErrNone)
+			{
+			TMsvEmailEntry entry = iEntry->Entry();
+			iLogMessage->LogEvent().SetRemoteParty(entry.iDetails);
+			iLogMessage->LogEvent().SetSubject(entry.iDescription);
+			}
+		else
+			{
+			iLogMessage->GetString(string, R_LOG_REMOTE_UNKNOWN);
+			iLogMessage->LogEvent().SetRemoteParty(string);
+
+			iLogMessage->GetString(string, R_LOG_SUBJECT_NONE);
+			iLogMessage->LogEvent().SetSubject(string);
+			}
+		
+		// Set up the log event.
+		iLogMessage->LogEvent().SetEventType(KLogMailEventTypeUid);
+
+		iLogMessage->GetString(string, R_LOG_DIR_FETCHED);
+		iLogMessage->LogEvent().SetDirection(string);
+
+		iLogMessage->LogEvent().SetLink(aId);
+		}
+	}
+
+// Send the log message set up by SetUpLogMessageL()
+TBool CImap4Utils::SendLogMessageL(TInt aError, TRequestStatus &aStatus)
+	{
+	if (iLogMessage && iLogMessage->LogEvent().Link() != KLogNullLink)
+		{
+		// Run the iLogMessage operation.
+		iLogMessage->Start(aError, aStatus);
+
+		return ETrue;
+		}
+
+	return EFalse;
+	}
+
+// eof IMPSUTIL.CPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/src/cimapcanceltimer.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,47 @@
+// Copyright (c) 2005-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 "cimapcanceltimer.h"
+
+#include "imapsess.h"
+
+CImapCancelTimer* CImapCancelTimer::NewL(CImImap4Session& aSession)
+	{
+	CImapCancelTimer* self = new (ELeave) CImapCancelTimer(aSession);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+	
+CImapCancelTimer::~CImapCancelTimer()
+	{
+	Cancel();
+	}
+
+CImapCancelTimer::CImapCancelTimer(CImImap4Session& aSession)
+: CTimer(CActive::EPriorityHigh), iSession(aSession)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+/*
+ * methods from CActive
+ */
+ 
+void CImapCancelTimer::RunL()
+	{
+	iSession.CancelTimerExpired();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/EmbeddedMsg.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,134 @@
+<< * OK Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 (lon-cn-exchng2k.msexchange2k.closedtest.intra) ready.
+>> 1 CAPABILITY
+<< * CAPABILITY IMAP4 IMAP4rev1 IDLE LOGIN-REFERRALS MAILBOX-REFERRALS NAMESPACE LITERAL+ UIDPLUS CHILDREN AUTH=NTLM
+<< 1 OK CAPABILITY completed.
+>> 2 LOGIN davids davids
+<< 2 OK LOGIN completed.
+>> 3 SELECT "INBOX"
+<< * 1 EXISTS
+<< * 0 RECENT
+<< * FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
+<< * OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags
+<< * OK [UIDVALIDITY 1378] UIDVALIDITY value
+<< 3 OK [READ-WRITE] SELECT completed.
+>> 4 UID FETCH 1:* (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Priority X-Priority X-MSMail-Priority Importance)])
+<< * 1 FETCH (UID 201 FLAGS (\Seen) BODYSTRUCTURE ((("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 0 1 NIL NIL NIL)("TEXT" "HTML" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 338 6 NIL NIL NIL) "alternative" ("boundary" "----=_NextPart_001_002C_01C53C44.A6DB26B0") NIL NIL)("MESSAGE" "RFC822" ("name" "an embedded message.eml") NIL NIL "7BIT" 1593 ("Fri, 8 Apr 2005 14:08:36 +0100" "an embedded message" (("IMAP" NIL "davids" "msexchange2k.closedtest.intra")) (("IMAP" NIL "davids" "msexchange2k.closedtest.intra")) (("IMAP" NIL "davids" "msexchange2k.closedtest.intra")) (("David Test Account" NIL "davids" "msexchange2k.closedtest.intra")) NIL NIL NIL "<001701c53c3c$12daf150$0100a8c0@intra>") (("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 21 1 NIL NIL NIL)("TEXT" "HTML" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 382 7 NIL NIL NIL) "alternative" ("boundary" "----=_NextPart_000_0014_01C53C44.74982D60") NIL NIL) 27 NIL ("attachment" ("filename" "an embedded message.eml")) NIL) "mixed" ("boundary" "----=_NextPart_000_002B_01C53C44.A6DB26B0") NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From)] {313}
+<< Received: from LONDAVIDS02 ([10.23.163.107]) by lon-cn-exchng2k.msexchange2k.closedtest.intra with Microsoft SMTPSVC(5.0.2195.5329);
+<< 	 Fri, 8 Apr 2005 14:06:49 +0100
+<< Date: Fri, 8 Apr 2005 14:10:00 +0100
+<< Subject: this message contains an embedded message
+<< From: "IMAP" <davids@msexchange2k.closedtest.intra>
+<< 
+<< )
+<< 4 OK FETCH completed.
+>> 5 LIST "" "%"
+<< * LIST (\Marked \HasNoChildren) "/" "Big Test inbox"
+<< * LIST (\HasNoChildren) "/" Calendar
+<< * LIST (\HasNoChildren) "/" Contacts
+<< * LIST (\HasNoChildren) "/" "Deleted Items"
+<< * LIST (\HasNoChildren) "/" Drafts
+<< * LIST (\Marked \HasNoChildren) "/" INBOX
+<< * LIST (\HasNoChildren) "/" Journal
+<< * LIST (\HasNoChildren) "/" Notes
+<< * LIST (\HasNoChildren) "/" Outbox
+<< * LIST (\Marked \HasNoChildren) "/" "Sent Items"
+<< * LIST (\HasNoChildren) "/" Tasks
+<< * LIST (\Noselect) "/" "Public Folders/"
+<< 5 OK LIST completed.
+>> 6 LIST "" "Big Test inbox/%"
+<< 6 OK LIST completed.
+>> 7 LIST "" "Calendar/%"
+<< 7 OK LIST completed.
+>> 8 LIST "" "Contacts/%"
+<< 8 OK LIST completed.
+>> 9 LIST "" "Deleted Items/%"
+<< 9 OK LIST completed.
+>> 10 LIST "" "Drafts/%"
+<< 10 OK LIST completed.
+>> 11 LIST "" "INBOX/%"
+<< 11 OK LIST completed.
+>> 12 LIST "" "Journal/%"
+<< 12 OK LIST completed.
+>> 13 LIST "" "Notes/%"
+<< 13 OK LIST completed.
+>> 14 LIST "" "Outbox/%"
+<< 14 OK LIST completed.
+>> 15 LIST "" "Sent Items/%"
+<< 15 OK LIST completed.
+>> 16 LIST "" "Tasks/%"
+<< 16 OK LIST completed.
+>> 17 LIST "" "Public Folders//%"
+<< 17 NO This a special mailbox and can not be selected or used as the destination for mailbox operations.
+>> 18 IDLE
+<< + IDLE accepted, awaiting DONE command.
+>> DONE
+<< 18 OK IDLE completed.
+>> 19 UID FETCH 201 (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Reply-to To Cc Bcc Message-ID Return-Receipt-To X-Return-Receipt-To Disposition-Notification-To Disposition-Notification-Options Priority X-Priority X-MSMail-Priority Importance)])
+<< * 1 FETCH (UID 201 FLAGS (\Seen) BODYSTRUCTURE ((("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 0 1 NIL NIL NIL)("TEXT" "HTML" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 338 6 NIL NIL NIL) "alternative" ("boundary" "----=_NextPart_001_002C_01C53C44.A6DB26B0") NIL NIL)("MESSAGE" "RFC822" ("name" "an embedded message.eml") NIL NIL "7BIT" 1593 ("Fri, 8 Apr 2005 14:08:36 +0100" "an embedded message" (("IMAP" NIL "davids" "msexchange2k.closedtest.intra")) (("IMAP" NIL "davids" "msexchange2k.closedtest.intra")) (("IMAP" NIL "davids" "msexchange2k.closedtest.intra")) (("David Test Account" NIL "davids" "msexchange2k.closedtest.intra")) NIL NIL NIL "<001701c53c3c$12daf150$0100a8c0@intra>") (("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 21 1 NIL NIL NIL)("TEXT" "HTML" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 382 7 NIL NIL NIL) "alternative" ("boundary" "----=_NextPart_000_0014_01C53C44.74982D60") NIL NIL) 27 NIL ("attachment" ("filename" "an embedded message.eml")) NIL) "mixed" ("boundary" "----=_NextPart_000_002B_01C53C44.A6DB26B0") NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From Reply-to To Cc Bcc Message-ID Return-Receipt-To X-Return-Receipt-To Disposition-Notification-To Disposition-Notification-Options Priority X-Priority X-MSMail-Priority Importance)] {472}
+<< Received: from LONDAVIDS02 ([10.23.163.107]) by lon-cn-exchng2k.msexchange2k.closedtest.intra with Microsoft SMTPSVC(5.0.2195.5329);
+<< 	 Fri, 8 Apr 2005 14:06:49 +0100
+<< Date: 
+<< Fri, 8 Apr 2005 14:10:00 +0100
+<< Subject: this message contains an embedded message
+<< From: "IMAP" <davids@msexchange2k.closedtest.intra>
+<< To: "David Test Account" <davids@msexchange2k.closedtest.intra>
+<< Message-ID: <002f01c53c3c$45276080$0100a8c0@intra>
+<< X-Priority: 3
+<< X-MSMail-Priority: Normal
+<< 
+<< )
+<< 19 OK FETCH completed.
+>> 20 UID FETCH 201 (BODY[1.2]<0.20480> BODY[1.2.MIME])
+<< * 1 FETCH (BODY[1.2]<0> {338}
+<< <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<< <HTML><HEAD>
+<< <META http-equiv=3DContent-Type content=3D"text/html; =
+<< charset=3Diso-8859-1">
+<< <META content=3D"MSHTML 6.00.2800.1458" name=3DGENERATOR>
+<< <STYLE></STYLE>
+<< </HEAD>
+<< <BODY bgColor=3D#ffffff>
+<< <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML>
+<<  BODY[1.2.MIME] {96}
+<< Content-Type: text/html;
+<< 	charset="iso-8859-1"
+<< Content-Transfer-Encoding: quoted-printable
+<< 
+<<  UID 201)
+<< 20 OK FETCH completed.
+>> 21 UID FETCH 201 (BODY[2.1]<0.20480> BODY[2.1.MIME])
+<< * 1 FETCH (BODY[2.1]<0> {21}
+<< an embedded message
+<<  BODY[2.1.MIME] {97}
+<< Content-Type: text/plain;
+<< 	charset="iso-8859-1"
+<< Content-Transfer-Encoding: quoted-printable
+<< 
+<<  UID 201)
+<< 21 OK FETCH completed.
+>> 22 UID FETCH 201 (BODY[2.2]<0.20480> BODY[2.2.MIME])
+<< * 1 FETCH (BODY[2.2]<0> {382}
+<< <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<< <HTML><HEAD>
+<< <META http-equiv=3DContent-Type content=3D"text/html; =
+<< charset=3Diso-8859-1">
+<< <META content=3D"MSHTML 6.00.2800.1458" name=3DGENERATOR>
+<< <STYLE></STYLE>
+<< </HEAD>
+<< <BODY bgColor=3D#ffffff>
+<< <DIV><FONT face=3DArial size=3D2><FONT size=3D1>
+<< <P>an embedded message</P></FONT></FONT></DIV></BODY></HTML>
+<<  BODY[2.2.MIME] {96}
+<< Content-Type: text/html;
+<< 	charset="iso-8859-1"
+<< Content-Transfer-Encoding: quoted-printable
+<< 
+<<  UID 201)
+<< 22 OK FETCH completed.
+>> 23 IDLE
+<< + IDLE accepted, awaiting DONE command.
+>> DONE
+<< 23 OK IDLE completed.
+>> 24 LOGOUT
+<< * BYE Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 signing off.
+<< 24 OK LOGOUT completed.
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/EmbeddedMsgNoReceived.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,134 @@
+<< * OK Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 (lon-cn-exchng2k.msexchange2k.closedtest.intra) ready.
+>> 1 CAPABILITY
+<< * CAPABILITY IMAP4 IMAP4rev1 IDLE LOGIN-REFERRALS MAILBOX-REFERRALS NAMESPACE LITERAL+ UIDPLUS CHILDREN AUTH=NTLM
+<< 1 OK CAPABILITY completed.
+>> 2 LOGIN davids davids
+<< 2 OK LOGIN completed.
+>> 3 SELECT "INBOX"
+<< * 1 EXISTS
+<< * 0 RECENT
+<< * FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
+<< * OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags
+<< * OK [UNSEEN 1] Is the first unseen message
+<< * OK [UIDVALIDITY 1378] UIDVALIDITY value
+<< 3 OK [READ-WRITE] SELECT completed.
+>> 4 UID FETCH 1:* (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Priority X-Priority X-MSMail-Priority Importance)])
+<< * 1 FETCH (UID 202 FLAGS (\Seen) BODYSTRUCTURE ((("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 0 1 NIL NIL NIL)("TEXT" "HTML" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 338 6 NIL NIL NIL) "alternative" ("boundary" "----=_NextPart_001_002C_01C53C44.A6DB26B0") NIL NIL)("MESSAGE" "RFC822" ("name" "an embedded message.eml") NIL NIL "7BIT" 1425 ("Fri, 8 Apr 2005 14:10:01 +0100" "an embedded message" (("IMAP" NIL "davids" "msexchange2k.closedtest.intra")) (("IMAP" NIL "davids" "msexchange2k.closedtest.intra")) (("IMAP" NIL "davids" "msexchange2k.closedtest.intra")) (("David Test Account" NIL "davids" "msexchange2k.closedtest.intra")) NIL NIL NIL "<001701c53c3c$12daf150$0100a8c0@intra>") (("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 21 1 NIL NIL NIL)("TEXT" "HTML" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 382 7 NIL NIL NIL) "alternative" ("boundary" "----=_NextPart_000_0014_01C53C44.74982D60") NIL NIL) 24 NIL ("attachment" ("filename" "an embedded message.eml")) NIL) "mixed" ("boundary" "----=_NextPart_000_002B_01C53C44.A6DB26B0") NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From)] {313}
+<< Received: from LONDAVIDS02 ([10.23.163.107]) by lon-cn-exchng2k.msexchange2k.closedtest.intra with Microsoft SMTPSVC(5.0.2195.5329);
+<< 	 Fri, 8 Apr 2005 14:06:49 +0100
+<< Date: Fri, 8 Apr 2005 14:10:00 +0100
+<< Subject: this message contains an embedded message
+<< From: "IMAP" <davids@msexchange2k.closedtest.intra>
+<< 
+<< )
+<< 4 OK FETCH completed.
+>> 5 LIST "" "%"
+<< * LIST (\Marked \HasNoChildren) "/" "Big Test inbox"
+<< * LIST (\HasNoChildren) "/" Calendar
+<< * LIST (\HasNoChildren) "/" Contacts
+<< * LIST (\HasNoChildren) "/" "Deleted Items"
+<< * LIST (\HasNoChildren) "/" Drafts
+<< * LIST (\Marked \HasNoChildren) "/" INBOX
+<< * LIST (\HasNoChildren) "/" Journal
+<< * LIST (\HasNoChildren) "/" Notes
+<< * LIST (\HasNoChildren) "/" Outbox
+<< * LIST (\Marked \HasNoChildren) "/" "Sent Items"
+<< * LIST (\HasNoChildren) "/" Tasks
+<< * LIST (\Noselect) "/" "Public Folders/"
+<< 5 OK LIST completed.
+>> 6 LIST "" "Big Test inbox/%"
+<< 6 OK LIST completed.
+>> 7 LIST "" "Calendar/%"
+<< 7 OK LIST completed.
+>> 8 LIST "" "Contacts/%"
+<< 8 OK LIST completed.
+>> 9 LIST "" "Deleted Items/%"
+<< 9 OK LIST completed.
+>> 10 LIST "" "Drafts/%"
+<< 10 OK LIST completed.
+>> 11 LIST "" "INBOX/%"
+<< 11 OK LIST completed.
+>> 12 LIST "" "Journal/%"
+<< 12 OK LIST completed.
+>> 13 LIST "" "Notes/%"
+<< 13 OK LIST completed.
+>> 14 LIST "" "Outbox/%"
+<< 14 OK LIST completed.
+>> 15 LIST "" "Sent Items/%"
+<< 15 OK LIST completed.
+>> 16 LIST "" "Tasks/%"
+<< 16 OK LIST completed.
+>> 17 LIST "" "Public Folders//%"
+<< 17 NO This a special mailbox and can not be selected or used as the destination for mailbox operations.
+>> 18 IDLE
+<< + IDLE accepted, awaiting DONE command.
+>> DONE
+<< 18 OK IDLE completed.
+>> 19 UID FETCH 202 (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Reply-to To Cc Bcc Message-ID Return-Receipt-To X-Return-Receipt-To Disposition-Notification-To Disposition-Notification-Options Priority X-Priority X-MSMail-Priority Importance)])
+<< * 1 FETCH (UID 202 FLAGS (\Seen) BODYSTRUCTURE ((("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 0 1 NIL NIL NIL)("TEXT" "HTML" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 338 6 NIL NIL NIL) "alternative" ("boundary" "----=_NextPart_001_002C_01C53C44.A6DB26B0") NIL NIL)("MESSAGE" "RFC822" ("name" "an embedded message.eml") NIL NIL "7BIT" 1425 ("Fri, 8 Apr 2005 14:10:01 +0100" "an embedded message" (("IMAP" NIL "davids" "msexchange2k.closedtest.intra")) (("IMAP" NIL "davids" "msexchange2k.closedtest.intra")) (("IMAP" NIL "davids" "msexchange2k.closedtest.intra")) (("David Test Account" NIL "davids" "msexchange2k.closedtest.intra")) NIL NIL NIL "<001701c53c3c$12daf150$0100a8c0@intra>") (("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 21 1 NIL NIL NIL)("TEXT" "HTML" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 382 7 NIL NIL NIL) "alternative" ("boundary" "----=_NextPart_000_0014_01C53C44.74982D60") NIL NIL) 24 NIL ("attachment" ("filename" "an embedded message.eml")) NIL) "mixed" ("boundary" "----=_NextPart_000_002B_01C53C44.A6DB26B0") NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From Reply-to To Cc Bcc Message-ID Return-Receipt-To X-Return-Receipt-To Disposition-Notification-To Disposition-Notification-Options Priority X-Priority X-MSMail-Priority Importance)] {472}
+<< aeceived: from LONDAVIDS02 ([10.23.163.107]) by lon-cn-exchng2k.msexchange2k.closedtest.intra with Microsoft SMTPSVC(5.0.2195.5329);
+<< 	 Fri, 8 Apr 2005 14:06:49 +0100
+<< Date: Fri, 8 Apr 2005 14:10:01 +0100
+<< Subject: this message contains an embedded message
+<< From: "IMAP" <davids@msexchange2k.closedtest.intra>
+<< To: "David Test Account" <davids@msexchange2k.closedtest.intra>
+<< Message-ID: <002f01c53c3c$45276080$0100a8c0@intra>
+<< X-Priority: 3
+<< X-MSMail-Priority: Normal
+<< 
+<< )
+<< 19 OK FETCH completed.
+>> 20 UID FETCH 202 (BODY[1.2]<0.20480> BODY[1.2.MIME])
+<< * 1 FETCH (BODY[1.2]<0> {338}
+<< <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<< <HTML><HEAD>
+<< <META http-equiv=3DContent-Type content=3D"text/html; =
+<< charset=3Diso-8859-1">
+<< <META content=3D"MSHTML 6.00.2800.1458" name=3DGENERATOR>
+<< <STYLE></STYLE>
+<< </HEAD>
+<< <BODY bgColor=3D#ffffff>
+<< <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML>
+<<  BODY[1.2.MIME] {96}
+<< Content-Type: text/html;
+<< 	charset="iso-8859-1"
+<< Content-Transfer-Encoding: quoted-printable
+<< 
+<<  UID 202)
+<< 20 OK FETCH completed.
+>> 21 UID FETCH 202 (BODY[2.1]<0.20480> BODY[2.1.MIME])
+<< * 1 FETCH (BODY[2.1]<0> {21}
+<< an embedded message
+<<  BODY[2.1.MIME] {97}
+<< Content-Type: text/plain;
+<< 	charset="iso-8859-1"
+<< Content-Transfer-Encoding: quoted-printable
+<< 
+<<  UID 202)
+<< 21 OK FETCH completed.
+>> 22 UID FETCH 202 (BODY[2.2]<0.20480> BODY[2.2.MIME])
+<< * 1 FETCH (BODY[2.2]<0> {382}
+<< <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<< <HTML><HEAD>
+<< <META http-equiv=3DContent-Type content=3D"text/html; =
+<< charset=3Diso-8859-1">
+<< <META content=3D"MSHTML 6.00.2800.1458" name=3DGENERATOR>
+<< <STYLE></STYLE>
+<< </HEAD>
+<< <BODY bgColor=3D#ffffff>
+<< <DIV><FONT face=3DArial size=3D2><FONT size=3D1>
+<< <P>an embedded message</P></FONT></FONT></DIV></BODY></HTML>
+<<  BODY[2.2.MIME] {96}
+<< Content-Type: text/html;
+<< 	charset="iso-8859-1"
+<< Content-Transfer-Encoding: quoted-printable
+<< 
+<<  UID 202)
+<< 22 OK FETCH completed.
+>> 23 IDLE
+<< + IDLE accepted, awaiting DONE command.
+>> DONE
+<< 23 OK IDLE completed.
+>> 24 LOGOUT
+<< * BYE Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 signing off.
+<< 24 OK LOGOUT completed.
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/EmbeddedMsgNoReceivedNoDate.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,135 @@
+<< * OK Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 (lon-cn-exchng2k.msexchange2k.closedtest.intra) ready.
+>> 1 CAPABILITY
+<< * CAPABILITY IMAP4 IMAP4rev1 IDLE LOGIN-REFERRALS MAILBOX-REFERRALS NAMESPACE LITERAL+ UIDPLUS CHILDREN AUTH=NTLM
+<< 1 OK CAPABILITY completed.
+>> 2 LOGIN davids davids
+<< 2 OK LOGIN completed.
+>> 3 SELECT "INBOX"
+<< * 1 EXISTS
+<< * 0 RECENT
+<< * FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
+<< * OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags
+<< * OK [UNSEEN 1] Is the first unseen message
+<< * OK [UIDVALIDITY 1378] UIDVALIDITY value
+<< 3 OK [READ-WRITE] SELECT completed.
+>> 4 UID FETCH 1:* (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Priority X-Priority X-MSMail-Priority Importance)])
+<< * 1 FETCH (UID 202 FLAGS (\Seen) BODYSTRUCTURE ((("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 0 1 NIL NIL NIL)("TEXT" "HTML" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 338 6 NIL NIL NIL) "alternative" ("boundary" "----=_NextPart_001_002C_01C53C44.A6DB26B0") NIL NIL)("MESSAGE" "RFC822" ("name" "an embedded message.eml") NIL NIL "7BIT" 1425 ("" "an embedded message" (("IMAP" NIL "davids" "msexchange2k.closedtest.intra")) (("IMAP" NIL "davids" "msexchange2k.closedtest.intra")) (("IMAP" NIL "davids" "msexchange2k.closedtest.intra")) (("David Test Account" NIL "davids" "msexchange2k.closedtest.intra")) NIL NIL NIL "<001701c53c3c$12daf150$0100a8c0@intra>") (("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 21 1 NIL NIL NIL)("TEXT" "HTML" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 382 7 NIL NIL NIL) "alternative" ("boundary" "----=_NextPart_000_0014_01C53C44.74982D60") NIL NIL) 24 NIL ("attachment" ("filename" "an embedded message.eml")) NIL) "mixed" ("boundary" "----=_NextPart_000_002B_01C53C44.A6DB26B0") NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From)] {313}
+<< Received: from LONDAVIDS02 ([10.23.163.107]) by lon-cn-exchng2k.msexchange2k.closedtest.intra with Microsoft SMTPSVC(5.0.2195.5329);
+<< 	 Fri, 8 Apr 2005 14:06:49 +0100
+<< Date: Fri, 8 Apr 2005 14:10:00 +0100
+<< Subject: this message contains an embedded message
+<< From: "IMAP" <davids@msexchange2k.closedtest.intra>
+<< 
+<< )
+<< 4 OK FETCH completed.
+>> 5 LIST "" "%"
+<< * LIST (\Marked \HasNoChildren) "/" "Big Test inbox"
+<< * LIST (\HasNoChildren) "/" Calendar
+<< * LIST (\HasNoChildren) "/" Contacts
+<< * LIST (\HasNoChildren) "/" "Deleted Items"
+<< * LIST (\HasNoChildren) "/" Drafts
+<< * LIST (\Marked \HasNoChildren) "/" INBOX
+<< * LIST (\HasNoChildren) "/" Journal
+<< * LIST (\HasNoChildren) "/" Notes
+<< * LIST (\HasNoChildren) "/" Outbox
+<< * LIST (\Marked \HasNoChildren) "/" "Sent Items"
+<< * LIST (\HasNoChildren) "/" Tasks
+<< * LIST (\Noselect) "/" "Public Folders/"
+<< 5 OK LIST completed.
+>> 6 LIST "" "Big Test inbox/%"
+<< 6 OK LIST completed.
+>> 7 LIST "" "Calendar/%"
+<< 7 OK LIST completed.
+>> 8 LIST "" "Contacts/%"
+<< 8 OK LIST completed.
+>> 9 LIST "" "Deleted Items/%"
+<< 9 OK LIST completed.
+>> 10 LIST "" "Drafts/%"
+<< 10 OK LIST completed.
+>> 11 LIST "" "INBOX/%"
+<< 11 OK LIST completed.
+>> 12 LIST "" "Journal/%"
+<< 12 OK LIST completed.
+>> 13 LIST "" "Notes/%"
+<< 13 OK LIST completed.
+>> 14 LIST "" "Outbox/%"
+<< 14 OK LIST completed.
+>> 15 LIST "" "Sent Items/%"
+<< 15 OK LIST completed.
+>> 16 LIST "" "Tasks/%"
+<< 16 OK LIST completed.
+>> 17 LIST "" "Public Folders//%"
+<< 17 NO This a special mailbox and can not be selected or used as the destination for mailbox operations.
+>> 18 IDLE
+<< + IDLE accepted, awaiting DONE command.
+>> DONE
+<< 18 OK IDLE completed.
+>> 19 UID FETCH 202 (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Reply-to To Cc Bcc Message-ID Return-Receipt-To X-Return-Receipt-To Disposition-Notification-To Disposition-Notification-Options Priority X-Priority X-MSMail-Priority Importance)])
+<< * 1 FETCH (UID 202 FLAGS (\Seen) BODYSTRUCTURE ((("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 0 1 NIL NIL NIL)("TEXT" "HTML" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 338 6 NIL NIL NIL) "alternative" ("boundary" "----=_NextPart_001_002C_01C53C44.A6DB26B0") NIL NIL)("MESSAGE" "RFC822" ("name" "an embedded message.eml") NIL NIL "7BIT" 1425 ("" "an embedded message" (("IMAP" NIL "davids" "msexchange2k.closedtest.intra")) (("IMAP" NIL "davids" "msexchange2k.closedtest.intra")) (("IMAP" NIL "davids" "msexchange2k.closedtest.intra")) (("David Test Account" NIL "davids" "msexchange2k.closedtest.intra")) NIL NIL NIL "<001701c53c3c$12daf150$0100a8c0@intra>") (("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 21 1 NIL NIL NIL)("TEXT" "HTML" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 382 7 NIL NIL NIL) "alternative" ("boundary" "----=_NextPart_000_0014_01C53C44.74982D60") NIL NIL) 24 NIL ("attachment" ("filename" "an embedded message.eml")) NIL) "mixed" ("boundary" "----=_NextPart_000_002B_01C53C44.A6DB26B0") NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From Reply-to To Cc Bcc Message-ID Return-Receipt-To X-Return-Receipt-To Disposition-Notification-To Disposition-Notification-Options Priority X-Priority X-MSMail-Priority Importance)] {472}
+<< aeceived: from LONDAVIDS02 ([10.23.163.107]) by lon-cn-exchng2k.msexchange2k.closedtest.intra with Microsoft SMTPSVC(5.0.2195.5329);
+<< 	 Fri, 8 Apr 2005 14:06:49 +0100
+<< aate: 
+<< Fri, 8 Apr 2005 14:10:01 +0100
+<< Subject: this message contains an embedded message
+<< From: "IMAP" <davids@msexchange2k.closedtest.intra>
+<< To: "David Test Account" <davids@msexchange2k.closedtest.intra>
+<< Message-ID: <002f01c53c3c$45276080$0100a8c0@intra>
+<< X-Priority: 3
+<< X-MSMail-Priority: Normal
+<< 
+<< )
+<< 19 OK FETCH completed.
+>> 20 UID FETCH 202 (BODY[1.2]<0.20480> BODY[1.2.MIME])
+<< * 1 FETCH (BODY[1.2]<0> {338}
+<< <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<< <HTML><HEAD>
+<< <META http-equiv=3DContent-Type content=3D"text/html; =
+<< charset=3Diso-8859-1">
+<< <META content=3D"MSHTML 6.00.2800.1458" name=3DGENERATOR>
+<< <STYLE></STYLE>
+<< </HEAD>
+<< <BODY bgColor=3D#ffffff>
+<< <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML>
+<<  BODY[1.2.MIME] {96}
+<< Content-Type: text/html;
+<< 	charset="iso-8859-1"
+<< Content-Transfer-Encoding: quoted-printable
+<< 
+<<  UID 202)
+<< 20 OK FETCH completed.
+>> 21 UID FETCH 202 (BODY[2.1]<0.20480> BODY[2.1.MIME])
+<< * 1 FETCH (BODY[2.1]<0> {21}
+<< an embedded message
+<<  BODY[2.1.MIME] {97}
+<< Content-Type: text/plain;
+<< 	charset="iso-8859-1"
+<< Content-Transfer-Encoding: quoted-printable
+<< 
+<<  UID 202)
+<< 21 OK FETCH completed.
+>> 22 UID FETCH 202 (BODY[2.2]<0.20480> BODY[2.2.MIME])
+<< * 1 FETCH (BODY[2.2]<0> {382}
+<< <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<< <HTML><HEAD>
+<< <META http-equiv=3DContent-Type content=3D"text/html; =
+<< charset=3Diso-8859-1">
+<< <META content=3D"MSHTML 6.00.2800.1458" name=3DGENERATOR>
+<< <STYLE></STYLE>
+<< </HEAD>
+<< <BODY bgColor=3D#ffffff>
+<< <DIV><FONT face=3DArial size=3D2><FONT size=3D1>
+<< <P>an embedded message</P></FONT></FONT></DIV></BODY></HTML>
+<<  BODY[2.2.MIME] {96}
+<< Content-Type: text/html;
+<< 	charset="iso-8859-1"
+<< Content-Transfer-Encoding: quoted-printable
+<< 
+<<  UID 202)
+<< 22 OK FETCH completed.
+>> 23 IDLE
+<< + IDLE accepted, awaiting DONE command.
+>> DONE
+<< 23 OK IDLE completed.
+>> 24 LOGOUT
+<< * BYE Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 signing off.
+<< 24 OK LOGOUT completed.
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/ImapAttachmentTest.ini	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,7 @@
+[Section1]
+
+TheString =String1
+
+ScriptFile = c:\msgtest\imap\ImapGetMailAndAttachment.txt
+AttachmentSourcePath = c:\msgtest\TestFramework\ScriptedTestCases\AttachmentAPIScripts\data\test.vcf
+AttachmentIndex = 0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/ImapBadlyFormedAddress.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,78 @@
+<< * OK Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 (lon-cn-exchng2k.msexchange2k.closedtest.intra) ready.
+>> 1 CAPABILITY
+<< * CAPABILITY IMAP4 IMAP4rev1 IDLE LOGIN-REFERRALS MAILBOX-REFERRALS NAMESPACE LITERAL+ UIDPLUS CHILDREN AUTH=NTLM
+<< 1 OK CAPABILITY completed.
+>> 2 LOGIN roberth roberth
+<< 2 OK LOGIN completed.
+>> 3 SELECT "INBOX"
+<< * 2 EXISTS
+<< * 0 RECENT
+<< * FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
+<< * OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags
+<< * OK [UNSEEN 1] Is the first unseen message
+<< * OK [UIDVALIDITY 1913] UIDVALIDITY value
+<< 3 OK [READ-WRITE] SELECT completed.
+>> 4 UID FETCH 1:* (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Priority X-Priority X-MSMail-Priority Importance)])
+<< * 1 FETCH (UID 1 FLAGS () BODYSTRUCTURE (("TEXT" "PLAIN" ("CHARSET" "us-ascii") NIL NIL "QUOTED-PRINTABLE" 958 56 NIL NIL NIL)("TEXT" "HTML" ("CHARSET" "us-ascii") NIL NIL "QUOTED-PRINTABLE" 12432 27 NIL NIL NIL) "ALTERNATIVE" ("BOUNDARY" "----=_NextPart_000_0001_01C620EC.AE94DD00") NIL NIL) BODY[HEADER.FIELDS ("RECEIVED" "DATE" "SUBJECT" "FROM")] {319}
+<< Received: from localhost (S0106009027a555bb.vc.shawcable.net [24.87.43.86])
+<< 	by moonlight.nebula.fi (8.11.6/8.11.6) with SMTP id k0O8lPE26127
+<< 	for <johannes@nomasi.com>; Tue, 24 Jan 2006 10:47:32 +0200
+<< From: "Damien Gray" <bmo@beadedbottlecovers.com>
+<< Subject: 0EM Software
+<< Date: Tue, 24 Jan 2006 00:47:28 -0800
+<< 
+<< )
+<< * OK [PARSE] Unterminated mailbox: jasonvor3e-mail@toggo.de
+<< * OK [PARSE] Unexp)cted char]cters at end of address: @k.st>
+<< * 2 FETCH (UID 2 FLAGS () BODYSTRUCTURE (("TEXT" "PLAIN" ("CHARSET" "us-ascii") NIL NIL "QUOTED-PRINTABLE" 958 56 NIL NIL NIL)("TEXT" "HTML" ("CHARSET" "us-ascii") NIL NIL "QUOTED-PRINTABLE" 12432 27 NIL NIL NIL) "ALTERNATIVE" ("BOUNDARY" "----=_NextPart_000_0001_01C620EC.AE94DD00") NIL NIL) BODY[HEADER.FIELDS ("RECEIVED" "DATE" "SUBJECT" "FROM")] {332}
+<< Received: from localhost (S0106009027a555bb.vc.shawcable.net [24.87.43.86])
+<< 	by moonlight.nebula.fi (8.11.6/8.11.6) with SMTP id k0O8lPE26127
+<< 	for <jasonvor3e-mail@toggo.de@k.st>; Tue, 24 Jan 2006 10:47:32 +0200
+<< From: "Damien Gray" <jasonvor3e-mail@toggo.de@k.st>
+<< Subject: 0EM Software
+<< Date: Tue, 24 Jan 2006 00:47:28 -0800
+<< 
+<< )
+<< 4 OK FETCH completed.
+>> 5 LIST "" "%"
+<< * LIST (\HasNoChildren) "/" Calendar
+<< * LIST (\HasNoChildren) "/" Contacts
+<< * LIST (\HasNoChildren) "/" "Deleted Items"
+<< * LIST (\Marked \HasNoChildren) "/" Drafts
+<< * LIST (\Marked \HasNoChildren) "/" INBOX
+<< * LIST (\HasNoChildren) "/" Journal
+<< * LIST (\HasNoChildren) "/" Notes
+<< * LIST (\HasNoChildren) "/" Outbox
+<< * LIST (\Marked \HasNoChildren) "/" "Sent Items"
+<< * LIST (\HasNoChildren) "/" Tasks
+<< * LIST (\Noselect) "/" "Public Folders/"
+<< 5 OK LIST completed.
+>> 6 LIST "" "Calendar/%"
+<< 6 OK LIST completed.
+>> 7 LIST "" "Contacts/%"
+<< 7 OK LIST completed.
+>> 8 LIST "" "Deleted Items/%"
+<< 8 OK LIST completed.
+>> 9 LIST "" "Drafts/%"
+<< 9 OK LIST completed.
+>> 10 LIST "" "INBOX/%"
+<< 10 OK LIST completed.
+>> 11 LIST "" "Journal/%"
+<< 11 OK LIST completed.
+>> 12 LIST "" "Notes/%"
+<< 12 OK LIST completed.
+>> 13 LIST "" "Outbox/%"
+<< 13 OK LIST completed.
+>> 14 LIST "" "Sent Items/%"
+<< 14 OK LIST completed.
+>> 15 LIST "" "Tasks/%"
+<< 15 OK LIST completed.
+>> 16 LIST "" "Public Folders//%"
+<< 16 NO This a special mailbox and can not be selected or used as the destination for mailbox operations.
+>> 17 IDLE
+<< + IDLE accepted, awaiting DONE command.
+>> DONE
+<< 17 OK IDLE completed.
+>> 18 LOGOUT
+<< * BYE Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 signing off.
+<< 18 OK LOGOUT completed.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/ImapBadlyFormedAddressTest.ini	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,5 @@
+[Section1]
+
+TheString =String1
+ScriptFile = c:\msgtest\imap\ImapBadlyFormedAddress.txt
+ExpectedEntryCount = 2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/ImapDecode.ini	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,22 @@
+// BufferType = [TBufferType::EBodyBuffer|TBufferType::EAttachmentBuffer] [path to reference file] [Allow junk at end: 1|0]
+// more than 1 buffer can be given, but everything must be on one line
+
+[SectionOne]
+
+ScriptFile = c:\msgtest\imap\mail1_Base64.txt
+// BufferType, path to reference file, AllowJunkAtTheEnd (1 or 0)
+BufferFile = TBufferType::EBodyBuffer c:\msgtest\imap\mail1_Base64_body.txt 0 
+FetchWholeMessage = True
+
+[SectionTwo]
+
+ScriptFile = c:\msgtest\imap\mail2_Base64.txt
+BufferFile = TBufferType::EBodyBuffer c:\msgtest\imap\mail2_Base64_body.txt 1
+FetchWholeMessage = True
+
+[SectionThree]
+
+ScriptFile = c:\msgtest\imap\mail1_UUEncoded.txt
+BufferFile = TBufferType::EBodyBuffer c:\msgtest\imap\mail1_UUEncoded_body.txt 0 TBufferType::EAttachmentBuffer c:\msgtest\imap\mail1_UUEncoded_attachment.jpg 0
+FetchWholeMessage = True
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/ImapGetMailAndAttachment.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,132 @@
+<< * OK Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 (lon-cn-exchng2k.msexchange2k.closedtest.intra) ready.
+>> 1 CAPABILITY
+<< * CAPABILITY IMAP4 IMAP4rev1 IDLE LOGIN-REFERRALS MAILBOX-REFERRALS NAMESPACE LITERAL+ UIDPLUS CHILDREN AUTH=NTLM
+<< 1 OK CAPABILITY completed.
+>> 2 LOGIN davids davids
+<< 2 OK LOGIN completed.
+>> 3 SELECT "INBOX"
+<< * 1 EXISTS
+<< * 0 RECENT
+<< * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
+<< * OK [PERMANENTFLAGS (\Deleted \Seen \*)] Limited
+<< * OK [UIDVALIDITY 1] UIDs valid
+<< 3 OK [READ-WRITE] SELECT completed.
+>> 4 UID FETCH 1:* (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Priority X-Priority X-MSMail-Priority Importance)])
+<< * 1 FETCH (UID 3263 FLAGS (\Seen) BODYSTRUCTURE ((("text" "plain" ("charset" "US-ASCII") NIL NIL "7bit" 1023 19 NIL NIL NIL) ("text" "html" ("charset" "US-ASCII") NIL NIL "7bit" 1060 24 NIL NIL NIL) "alternative" ("boundary" " _alternative 0056713280257037_ ") NIL NIL) ("application" "octet-stream" ("name" "test.vcf") NIL NIL "base64" 496 NIL ("attachment" ("filename" "test.vcf")) NIL) "mixed" ("boundary" " _mixed 0056713280257037_ ") NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From)] {463}
+<< Received: from smtp01.symbian.com([10.2.100.7]) by 21cn.com(AIMC 2.9.5.6)
+<< 	with SMTP id jm10842cd95ba; Thr, 07 Jul 2005 23:46:59 +0800
+<< Received: from smtp01.symbian.com([206.165.101.41]) by 21cn.com(AIMC 2.9.5.8)
+<< 	with SMTP id AISP action; Thr, 07 Jul 2005 23:35:00 +0800
+<< Received: from ([10.23.58.99])
+<< 	by smtp01.symbian.com with ESMTP  id KP-GCN69.10474314;
+<< 	Thu, 07 Jul 2005 16:44:12  -0100
+<< Date: Thu, 7 Jul 2005 16:44:10 +0100
+<< Subject: Bismillah 2
+<< 
+<< )
+<< 4 OK UID FETCH completed.
+>> 5 LIST "" "%"
+<< * LIST (\Marked) "/" Inbox
+<< * LIST (\Marked) "/" Sent
+<< * LIST (\Marked) "/" Draft
+<< * LIST (\Marked) "/" Trash
+<< * LIST (\Marked) "/" Junkmail
+<< * LIST (\Marked) "/" Drafts
+<< * LIST (\Marked) "/" "Junk E-mail"
+<< * LIST (\Marked) "/" "Sent Items"
+<< 5 OK LIST completed.
+>> 6 LIST "" "INBOX/%"
+<< 6 OK LIST completed.
+>> 7 LIST "" "Sent/%"
+<< 7 OK LIST completed.
+>> 8 LIST "" "Draft/%"
+<< 8 OK LIST completed.
+>> 9 LIST "" "Trash/%"
+<< 9 OK LIST completed.
+>> 10 LIST "" "Junkmail/%"
+<< 10 OK LIST completed.
+>> 11 LIST "" "Drafts/%"
+<< 11 OK LIST completed.
+>> 12 LIST "" "Junk E-mail/%"
+<< 12 OK LIST completed.
+>> 13 LIST "" "Sent Items/%"
+<< 13 OK LIST completed.
+>> 14 IDLE
+<< + IDLE accepted, awaiting DONE command.
+>> DONE
+<< 14 OK IDLE completed.
+>> 15 UID FETCH 3263 (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Reply-to To Cc Bcc Message-ID Return-Receipt-To X-Return-Receipt-To Disposition-Notification-To Disposition-Notification-Options Priority X-Priority X-MSMail-Priority Importance)])
+<< * 1 FETCH (UID 3263 FLAGS (\Seen) BODYSTRUCTURE ((("text" "plain" ("charset" "US-ASCII") NIL NIL "7bit" 1023 19 NIL NIL NIL) ("text" "html" ("charset" "US-ASCII") NIL NIL "7bit" 1060 24 NIL NIL NIL) "alternative" ("boundary" " _alternative 0056713280257037_ ") NIL NIL) ("application" "octet-stream" ("name" "test.vcf") NIL NIL "base64" 634 NIL ("attachment" ("filename" "test.vcf")) NIL) "mixed" ("boundary" " _mixed 0056713280257037_ ") NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From Reply-to To Cc Bcc Message-ID Return-Receipt-To X-Return-Receipt-To Disposition-Notification-To Disposition-Notification-Options Priority X-Priority X-MSMail-Priority Importance)] {632}
+<< Received: from smtp01.symbian.com([10.2.100.7]) by 21cn.com(AIMC 2.9.5.6) with SMTP id jm10842cd95ba;
+<< 	 Thr, 07 Jul 2005 23:46:59 +0800
+<< Received: from smtp01.symbian.com([206.165.101.41]) by 21cn.com(AIMC 2.9.5.8) with SMTP id AISP action;
+<< 	 Thr, 07 Jul 2005 23:35:00 +0800
+<< Received: from ([10.23.58.99]) by smtp01.symbian.com with ESMTP  id KP-GCN69.10474314;
+<< 	 Thu, 07 Jul 2005 16:44:12  -0100
+<< Date: Thu, 7 Jul 2005 16:44:10 +0100
+<< Subject: Bismillah 2
+<< From: Sihem.Merah@symbian.com
+<< FROM: sihem.merah@symbian.com
+<< To: cacb2@21cn.com
+<< Message-ID: <OF08FC53DA.8C7AEAC2-ON80257037.00566BEC-80257037.00567134@Symbian.com>
+<< 
+<< )
+<< 15 OK UID FETCH completed.
+>> 16 UID FETCH 3263 (BODY[1.1]<0.20480> BODY[1.1.MIME])
+<< * 1 FETCH (BODY[1.1]<0.20480> BODY[1.1.MIME]<0> {1023}
+<< Content-Type: text/plain;
+<< 	charset="US-ASCII"
+<< 
+<< 
+<< 
+<< 
+<< ---- ********************************************************************** Symbian Software Ltd is a company registered in England and Wales with registered number 4190020 and registered office at 2-6 Boundary Row, Southwark, London,  SE1 8HP, UK. This message is intended only for use by the named addressee and may contain privileged and/or confidential information. If you are not the named addressee you should not disseminate, copy or take any action in reliance on it. If you have received this message in error please notify postmast er@symbian.com and delete the message and any attachments accompanying it immediately. Neither Symbian nor any of its subsidiaries accepts liability for any corruption, interception, amendment, tampering or viruses occurring to this message in transit or for any message sent by its employees which is not in compliance with Symbian corporate policy. **********************************************************************
+<< 
+<<  BODY[1.1.MIME] {50}
+<< Content-Type: text/plain;
+<< 	charset="US-ASCII"
+<< 
+<<  UID 3263)
+<< 16 OK UID FETCH completed.
+>> 17 UID FETCH 3263 (BODY[1.2]<0.20480> BODY[1.2.MIME])
+<< * 1 FETCH (BODY[1.2]<0.20480> BODY[1.2.MIME]<0> {1060}
+<< Content-Type: text/html;
+<< 	charset="US-ASCII"
+<< 
+<< <HTML><BODY>
+<< <P><hr size=1></P>
+<< <P><STRONG>
+<< ****************************************** Symbian Software Ltd is a company registered in England and Wales with registered number 4190020 and registered office at 2-6 Boundary Row, Southwark, London,  SE1 8HP, UK. This message is intended only for use by the named addressee and may contain privileged and/or confidential information. If you are not the named addressee you should not disseminate, copy or take any action in reliance on it. If you have received this message in error please notify postmaster@symbian.com and delete the message and any attachments accompanying it immediately. Neither Symbian nor any of its subsidiaries accepts liability for any corruption, interception, amendment, tampering or viruses occurring to this message in transit or for any message sent by its employees which is not in compliance with Symbian corporate policy. **********************************************************************
+<< </STRONG></P>
+<< </BODY></HTML>
+<< 
+<<  BODY[1.2.MIME] {49}
+<< Content-Type: text/html;
+<< 	charset="US-ASCII"
+<< 
+<<  UID 3263)
+<< 17 OK UID FETCH completed.
+>> 18 UID FETCH 3263 (BODY[2]<0.20480> BODY[2.MIME])
+<< * 1 FETCH (BODY[2]<0.20480> BODY[2.MIME]<0> {634}
+<< Content-Type: application/octet-stream;
+<< 	name="test.vcf"
+<< Content-Disposition: attachment; filename="test.vcf"
+<< Content-Transfer-Encoding: base64
+<< 
+<< QkVHSU46VkNBUkQNClZFUlNJT046Mi4xDQpOOlRlc3Rpbmc7U3ltYmlhbjtWY2FyZDtNcg0KRk46U3ltYmlhbiBWY2FyZCBUZXN0aW5nDQpOSUNLTkFNRTpTeW1ieQ0KVEVMO0hPTUU7Vk9JQ0U6MDEyMjMwMTIyMw0KVEVMO0NFTEw7Vk9JQ0U6MDc5ODA5ODA5ODANCkFEUjtIT01FOjs7O0NhbWJyaWRnZTs7O0VuZ2xhbmQNCkxBQkVMO0hPTUU7RU5DT0RJTkc9UVVPVEVELVBSSU5UQUJMRTpDYW1icmlkZ2U9MEQ9MEFFbmdsYW5kDQpVUkw7SE9NRTpodHRwOi8vd3d3LnN5bWJpYW4uY29tDQpFTUFJTDtQUkVGO0lOVEVSTkVUOnN5bWJ2Y2FyZHRlc3RAc3ltYmlhbi5jb20NClJFVjoyMDAyMTAwMVQxNTE0MDVaDQpFTkQ6VkNBUkQNCg==
+<< 
+<<  BODY[2.MIME] {150}
+<< Content-Type: application/octet-stream;
+<< 	name="test.vcf"
+<< Content-Disposition: attachment; filename="test.vcf"
+<< Content-Transfer-Encoding: base64
+<< 
+<<  UID 3263)
+<< 18 OK UID FETCH completed.
+>> 19 IDLE
+<< + IDLE accepted, awaiting DONE command.
+>> DONE
+<< 19 OK IDLE completed.
+>> 20 LOGOUT
+<< * BYE Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 signing off.
+<< 20 OK LOGOUT completed.
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/ImapMissingOffset.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,125 @@
+<< * OK Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 (lon-cn-exchng2k.msexchange2k.closedtest.intra) ready.
+>> 1 CAPABILITY
+<< * CAPABILITY IMAP4 IMAP4rev1 IDLE LOGIN-REFERRALS MAILBOX-REFERRALS NAMESPACE LITERAL+ UIDPLUS CHILDREN AUTH=NTLM
+<< 1 OK CAPABILITY completed.
+>> 2 LOGIN ralphs ralphs
+<< 2 OK LOGIN completed.
+>> 3 SELECT "INBOX"
+<< * 1 EXISTS
+<< * 0 RECENT
+<< * FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
+<< * OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags
+<< * OK [UNSEEN 1] Is the first unseen message
+<< * OK [UIDVALIDITY 1913] UIDVALIDITY value
+<< 3 OK [READ-WRITE] SELECT completed.
+>> 4 UID FETCH 1:* (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Priority X-Priority X-MSMail-Priority Importance)])
+<< * 1 FETCH (UID 118 FLAGS () BODYSTRUCTURE (("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 164 3 NIL NIL NIL)("TEXT" "HTML" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 785 14 NIL NIL NIL) "alternative" ("boundary" "----=_NextPart_000_0009_01C53F6D.916815F0") NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From)] {315}
+<< Received: from RONMARTINP02 (ron-martinp02.ron.uiq.intra [10.80.181.57])
+<<           by ron-jonasp02 with SMTP (Mailtraq/2.1.0.1302) id ___15151358
+<<           for test@ron-jonasp02; Tue, 12 Apr 2005 05:40:28 -0700
+<< Date: Tue, 12 Apr 2005 14:40:27 +0200
+<< Subject: parser-objekt
+<< From: "JonasP" <test@ron-jonasp02>
+<< 
+<< )
+<< 4 OK FETCH completed.
+>> 5 LIST "" "%"
+<< * LIST (\HasNoChildren) "/" Calendar
+<< * LIST (\HasNoChildren) "/" Contacts
+<< * LIST (\HasNoChildren) "/" "Deleted Items"
+<< * LIST (\Marked \HasNoChildren) "/" Drafts
+<< * LIST (\Marked \HasNoChildren) "/" INBOX
+<< * LIST (\HasNoChildren) "/" Journal
+<< * LIST (\HasNoChildren) "/" Notes
+<< * LIST (\HasNoChildren) "/" Outbox
+<< * LIST (\Marked \HasNoChildren) "/" "Sent Items"
+<< * LIST (\HasNoChildren) "/" Tasks
+<< * LIST (\Noselect) "/" "Public Folders/"
+<< 5 OK LIST completed.
+>> 6 LIST "" "Calendar/%"
+<< 6 OK LIST completed.
+>> 7 LIST "" "Contacts/%"
+<< 7 OK LIST completed.
+>> 8 LIST "" "Deleted Items/%"
+<< 8 OK LIST completed.
+>> 9 LIST "" "Drafts/%"
+<< 9 OK LIST completed.
+>> 10 LIST "" "INBOX/%"
+<< 10 OK LIST completed.
+>> 11 LIST "" "Journal/%"
+<< 11 OK LIST completed.
+>> 12 LIST "" "Notes/%"
+<< 12 OK LIST completed.
+>> 13 LIST "" "Outbox/%"
+<< 13 OK LIST completed.
+>> 14 LIST "" "Sent Items/%"
+<< 14 OK LIST completed.
+>> 15 LIST "" "Tasks/%"
+<< 15 OK LIST completed.
+>> 16 LIST "" "Public Folders//%"
+<< 16 NO This a special mailbox and can not be selected or used as the destination for mailbox operations.
+>> 17 IDLE
+<< + IDLE accepted, awaiting DONE command.
+>> DONE
+<< 17 OK IDLE completed.
+>> 18 UID FETCH 118 (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Reply-to To Cc Bcc Message-ID Return-Receipt-To X-Return-Receipt-To Disposition-Notification-To Disposition-Notification-Options Priority X-Priority X-MSMail-Priority Importance)])
+<< * 1 FETCH (UID 118 FLAGS () BODYSTRUCTURE (("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 164 3 NIL NIL NIL)("TEXT" "HTML" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 785 14 NIL NIL NIL) "alternative" ("boundary" "----=_NextPart_000_0009_01C53F6D.916815F0") NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From Reply-to To Cc Bcc Message-ID Return-Receipt-To X-Return-Receipt-To Disposition-Notification-To Disposition-Notification-Options Priority X-Priority X-MSMail-Priority Importance)] {442}
+<< Received: from RONMARTINP02 (ron-martinp02.ron.uiq.intra [10.80.181.57])
+<<           by ron-jonasp02 with SMTP (Mailtraq/2.1.0.1302) id ___15151358
+<<           for test@ron-jonasp02; Tue, 12 Apr 2005 05:40:28 -0700
+<< Date: Tue, 12 Apr 2005 14:40:27 +0200
+<< Subject: parser-objekt
+<< From: "JonasP" <test@ron-jonasp02>
+<< To: <test@ron-jonasp02>
+<< Message-ID: <000c01c53f5c$cde8e2e0$39b5500a@ron.uiq.intra>
+<< X-Priority: 3
+<< X-MSMail-Priority: Normal
+<< 
+<< )
+>> 19 UID FETCH 118 (BODY[1]<0.20480> BODY[1.MIME])
+<< 18 OK FETCH completed.
+<< * 1 FETCH (BODY[1]<0> {166}
+<< 0705555542
+<< 
+<< 
+<< 
+<< ________________________________________________________________________
+<< Delivered using the Free Personal Edition of Mailtraq (www.mailtraq.com)
+<<  BODY[1.MIME] {97}
+<< Content-Type: text/plain;
+<< 	charset="iso-8859-1"
+<< Content-Transfer-Encoding: quoted-printable
+<< 
+<<  UID 118 FLAGS (\Seen))
+<< 19 OK FETCH completed.
+>> 20 UID FETCH 118 (BODY[2]<0.20480> BODY[2.MIME])
+<< * 1 FETCH (BODY[2] {785}
+<< <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<< <HTML><HEAD>
+<< <META content=3D"text/html; charset=3Diso-8859-1" =
+<< http-equiv=3DContent-Type>
+<< <META content=3D"MSHTML 5.00.3700.6699" name=3DGENERATOR>
+<< <STYLE></STYLE>
+<< </HEAD>
+<< <BODY bgColor=3D#ffffff>
+<< <DIV><FONT face=3DArial size=3D2>0705555542</FONT></DIV>
+<< <DIV>&nbsp;</DIV><a style=3D"text-decoration: none" href=3Dhttp://www.mailtraq.com><p =
+<< style=3D"font-size: 8pt; font-family: Verdana, sans-serif; color: =
+<< #aaaaaa; text-decor
+<< ation: none; border-color: #dddddd; border-style: =
+<< solid; border-top-width: 1px; border-right-width: 0px; border-bottom-width: =
+<< 0px; border-left-width: 0px; line-height: 9pt">
+<< Delivered using the Free Personal Edition of Mailtraq (www.mailtraq.com)</font></a></BODY></HTML> BODY[2.MIME] {96}
+<< Content-Type: text/html;
+<< 	charset="iso-8859-1"
+<< Content-Transfer-Encoding: quoted-printable
+<< 
+<<  UID 118)
+<< 20 OK FETCH completed.
+>> 21 IDLE
+<< + IDLE accepted, awaiting DONE command.
+>> DONE
+<< 21 OK IDLE completed.
+>> 22 LOGOUT
+<< * BYE Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 signing off.
+<< 22 OK LOGOUT completed.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/ImapMissingOffsetTest.ini	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,5 @@
+[Section1]
+
+TheString =String1
+ScriptFile = c:\msgtest\imap\ImapMissingOffset.txt
+ExpectedEntryCount = 1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/ImapNewMsgDuringSyncIdleCancel.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,187 @@
+<< * OK Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 (lon-cn-exchng2k.msexchange2k.closedtest.intra) ready.
+>> 1 CAPABILITY
+<< * CAPABILITY IMAP4 IMAP4rev1 IDLE LOGIN-REFERRALS MAILBOX-REFERRALS NAMESPACE LITERAL+ UIDPLUS CHILDREN AUTH=NTLM
+<< 1 OK CAPABILITY completed.
+>> 2 LOGIN roberth roberth
+<< 2 OK LOGIN completed.
+>> 3 SELECT "INBOX"
+<< * 1 EXISTS
+<< * 0 RECENT
+<< * FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
+<< * OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags
+<< * OK [UNSEEN 1] Is the first unseen message
+<< * OK [UIDVALIDITY 1913] UIDVALIDITY value
+<< 3 OK [READ-WRITE] SELECT completed.
+>> 4 UID FETCH 1:* (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Priority X-Priority X-MSMail-Priority Importance)])
+<< * 1 FETCH (UID 1 FLAGS () BODYSTRUCTURE (("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 164 3 NIL NIL NIL)("TEXT" "HTML" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 785 14 NIL NIL NIL) "alternative" ("boundary" "----=_NextPart_000_0009_01C53F6D.916815F0") NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From)] {315}
+<< Received: from RONMARTINP02 (ron-martinp02.ron.uiq.intra [10.80.181.57])
+<<           by ron-jonasp02 with SMTP (Mailtraq/2.1.0.1302) id ___15151358
+<<           for test@ron-jonasp02; Tue, 12 Apr 2005 05:40:28 -0700
+<< Date: Tue, 12 Apr 2005 14:40:27 +0200
+<< Subject: parser-objekt
+<< From: "JonasP" <test@ron-jonasp02>
+<< 
+<< )
+<< 4 OK FETCH completed.
+>> 5 LIST "" "%"
+<< * LIST (\HasNoChildren) "/" Calendar
+<< * LIST (\HasNoChildren) "/" Contacts
+<< * LIST (\HasNoChildren) "/" "Deleted Items"
+<< * LIST (\Marked \HasNoChildren) "/" Drafts
+<< * LIST (\Marked \HasNoChildren) "/" INBOX
+<< * LIST (\HasNoChildren) "/" Journal
+<< * LIST (\HasNoChildren) "/" Notes
+<< * LIST (\HasNoChildren) "/" Outbox
+<< * LIST (\Marked \HasNoChildren) "/" "Sent Items"
+<< * LIST (\HasNoChildren) "/" Tasks
+<< * LIST (\Noselect) "/" "Public Folders/"
+<< 5 OK LIST completed.
+>> 6 LIST "" "Calendar/%"
+<< 6 OK LIST completed.
+>> 7 LIST "" "Contacts/%"
+<< 7 OK LIST completed.
+>> 8 LIST "" "Deleted Items/%"
+<< 8 OK LIST completed.
+>> 9 LIST "" "Drafts/%"
+<< 9 OK LIST completed.
+>> 10 LIST "" "INBOX/%"
+<< 10 OK LIST completed.
+>> 11 LIST "" "Journal/%"
+<< 11 OK LIST completed.
+>> 12 LIST "" "Notes/%"
+<< 12 OK LIST completed.
+>> 13 LIST "" "Outbox/%"
+<< 13 OK LIST completed.
+>> 14 LIST "" "Sent Items/%"
+<< 14 OK LIST completed.
+>> 15 LIST "" "Tasks/%"
+<< 15 OK LIST completed.
+>> 16 LIST "" "Public Folders//%"
+<< 16 NO This a special mailbox and can not be selected or used as the destination for mailbox operations.
+>> 17 IDLE
+<< + IDLE accepted, awaiting DONE command.
+>> DONE
+<< * 2 EXISTS
+<< * 1 RECENT
+<< 17 OK IDLE completed.
+>> 18 UID FETCH 1:1 (UID FLAGS)
+<< * 1 FETCH (FLAGS (\Seen) UID 1)
+<< 18 OK Completed
+>> 19 UID FETCH 2:* (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Priority X-Priority X-MSMail-Priority Importance)])
+<< * 2 FETCH (UID 2 FLAGS () BODYSTRUCTURE (("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 164 3 NIL NIL NIL)("TEXT" "HTML" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 785 14 NIL NIL NIL) "alternative" ("boundary" "----=_NextPart_000_0009_01C53F6D.916815F0") NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From)] {315}
+<< Received: from RONMARTINP02 (ron-martinp02.ron.uiq.intra [10.80.181.57])
+<<           by ron-jonasp02 with SMTP (Mailtraq/2.1.0.1302) id ___15151358
+<<           for test@ron-jonasp02; Tue, 12 Apr 2005 05:40:28 -0700
+<< Date: Tue, 12 Apr 2005 14:40:27 +0200
+<< Subject: parser-objekt
+<< From: "JonasP" <test@ron-jonasp02>
+<< 
+<< )
+<< 19 OK Completed
+>> 20 UID FETCH 1:2 (UID FLAGS)
+<< * 1 FETCH (FLAGS (\Seen) UID 1)
+<< * 2 FETCH (FLAGS (\Seen) UID 2)
+<< 20 OK Completed
+>> 21 LIST "" "%"
+<< * LIST (\HasNoChildren) "/" Calendar
+<< * LIST (\HasNoChildren) "/" Contacts
+<< * LIST (\HasNoChildren) "/" "Deleted Items"
+<< * LIST (\Marked \HasNoChildren) "/" Drafts
+<< * LIST (\Marked \HasNoChildren) "/" INBOX
+<< * LIST (\HasNoChildren) "/" Journal
+<< * LIST (\HasNoChildren) "/" Notes
+<< * LIST (\HasNoChildren) "/" Outbox
+<< * LIST (\Marked \HasNoChildren) "/" "Sent Items"
+<< * LIST (\HasNoChildren) "/" Tasks
+<< * LIST (\Noselect) "/" "Public Folders/"
+<< 21 OK LIST completed.
+>> 22 LIST "" "Calendar/%"
+<< 22 OK LIST completed.
+>> 23 LIST "" "Contacts/%"
+<< 23 OK LIST completed.
+>> 24 LIST "" "Deleted Items/%"
+<< 24 OK LIST completed.
+>> 25 LIST "" "Drafts/%"
+<< 25 OK LIST completed.
+>> 26 LIST "" "INBOX/%"
+<< 26 OK LIST completed.
+>> 27 LIST "" "Journal/%"
+<< 27 OK LIST completed.
+>> 28 LIST "" "Notes/%"
+<< 28 OK LIST completed.
+>> 29 LIST "" "Outbox/%"
+<< 29 OK LIST completed.
+>> 30 LIST "" "Sent Items/%"
+<< 30 OK LIST completed.
+>> 31 LIST "" "Tasks/%"
+<< 31 OK LIST completed.
+>> 32 LIST "" "Public Folders//%"
+<< 32 NO This a special mailbox and can not be selected or used as the destination for mailbox operations.
+>> 33 IDLE
+<< + IDLE accepted, awaiting DONE command.
+>> DONE
+<< * 3 EXISTS
+<< * 1 RECENT
+<< 33 OK IDLE completed.
+>> 34 UID FETCH 1:2 (UID FLAGS)
+<< * 1 FETCH (FLAGS (\Seen) UID 1)
+<< * 2 FETCH (FLAGS (\Seen) UID 2)
+<< 34 OK Completed
+>> 35 UID FETCH 3:* (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Priority X-Priority X-MSMail-Priority Importance)])
+<< * 3 FETCH (UID 3 FLAGS () BODYSTRUCTURE (("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 164 3 NIL NIL NIL)("TEXT" "HTML" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 785 14 NIL NIL NIL) "alternative" ("boundary" "----=_NextPart_000_0009_01C53F6D.916815F0") NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From)] {315}
+<< Received: from RONMARTINP02 (ron-martinp02.ron.uiq.intra [10.80.181.57])
+<<           by ron-jonasp02 with SMTP (Mailtraq/2.1.0.1302) id ___15151358
+<<           for test@ron-jonasp02; Tue, 12 Apr 2005 05:40:28 -0700
+<< Date: Tue, 12 Apr 2005 14:40:27 +0200
+<< Subject: parser-objekt
+<< From: "JonasP" <test@ron-jonasp02>
+<< 
+<< )
+<< 35 OK Completed
+>> 36 UID FETCH 1:3 (UID FLAGS)
+<< * 1 FETCH (FLAGS (\Seen) UID 1)
+<< * 2 FETCH (FLAGS (\Seen) UID 2)
+<< * 3 FETCH (FLAGS (\Seen) UID 3)
+<< 36 OK Completed
+>> 37 LIST "" "%"
+<< * LIST (\HasNoChildren) "/" Calendar
+<< * LIST (\HasNoChildren) "/" Contacts
+<< * LIST (\HasNoChildren) "/" "Deleted Items"
+<< * LIST (\Marked \HasNoChildren) "/" Drafts
+<< * LIST (\Marked \HasNoChildren) "/" INBOX
+<< * LIST (\HasNoChildren) "/" Journal
+<< * LIST (\HasNoChildren) "/" Notes
+<< * LIST (\HasNoChildren) "/" Outbox
+<< * LIST (\Marked \HasNoChildren) "/" "Sent Items"
+<< * LIST (\HasNoChildren) "/" Tasks
+<< * LIST (\Noselect) "/" "Public Folders/"
+<< 37 OK LIST completed.
+>> 38 LIST "" "Calendar/%"
+<< 38 OK LIST completed.
+>> 39 LIST "" "Contacts/%"
+<< 39 OK LIST completed.
+>> 40 LIST "" "Deleted Items/%"
+<< 40 OK LIST completed.
+>> 41 LIST "" "Drafts/%"
+<< 41 OK LIST completed.
+>> 42 LIST "" "INBOX/%"
+<< 42 OK LIST completed.
+>> 43 LIST "" "Journal/%"
+<< 43 OK LIST completed.
+>> 44 LIST "" "Notes/%"
+<< 44 OK LIST completed.
+>> 45 LIST "" "Outbox/%"
+<< 45 OK LIST completed.
+>> 46 LIST "" "Sent Items/%"
+<< 46 OK LIST completed.
+>> 47 LIST "" "Tasks/%"
+<< 47 OK LIST completed.
+>> 48 LIST "" "Public Folders//%"
+<< 48 NO This a special mailbox and can not be selected or used as the destination for mailbox operations.
+>> 49 IDLE
+<< + IDLE accepted, awaiting DONE command.
+>> DONE
+<< 49 OK IDLE completed.
+>> 50 LOGOUT
+<< * BYE Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 signing off.
+<< 50 OK LOGOUT completed.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/ImapNewMsgDuringSyncIdleCancelTest.ini	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,5 @@
+[Section1]
+
+TheString =String1
+ScriptFile = c:\msgtest\imap\ImapNewMsgDuringSyncIdleCancel.txt
+ExpectedEntryCount = 3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/ImapUTCTest.ini	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,40 @@
+[SectionOne]
+
+TheString =StringOne
+
+ScriptFile = c:\msgtest\imap\multipleReceived.txt
+ExpectedTime = 20050305:085212.000000
+FetchWholeMessage = False
+
+[SectionTwo]
+
+ScriptFile = c:\msgtest\imap\noReceived.txt
+ExpectedTime = 20050306:141348.000000
+FetchWholeMessage = False
+
+[SectionThree]
+
+ScriptFile = c:\msgtest\imap\noReceivednoDate.txt
+ExpectedTime = UTC-TIME
+FetchWholeMessage = False
+
+[SectionFour]
+
+ScriptFile = c:\msgtest\imap\EmbeddedMsg.txt
+ExpectedTime =  20050307:130649.000000
+ExpectedTime2 = 20050307:130836.000000
+FetchWholeMessage = True
+
+[SectionFive]
+
+ScriptFile = c:\msgtest\imap\EmbeddedMsgNoReceived.txt
+ExpectedTime =  20050307:131001.000000
+ExpectedTime2 = 20050307:131001.000000
+FetchWholeMessage = True
+
+[SectionSix]
+
+ScriptFile = c:\msgtest\imap\EmbeddedMsgNoReceivedNoDate.txt
+ExpectedTime =  UTC-TIME
+ExpectedTime2 = UTC-TIME
+FetchWholeMessage = True
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/NOTES.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,43 @@
+Notes on T_IMPS harness 07-Aug-1998
+-----------------------
+
+This harness drives the IMPS.DLL component through connecting to an IMAP
+server, performing various synchronising and fetching tasks, and then
+disconnection. After disconnection, the local folder structure is dumped
+to the file:
+
+c:\system\messages\zac.txt
+
+...which can be used to check the server database has been formed correctly.
+
+When run, you get offered a selection of IMAP servers to connect to: if you
+have no existing server in your database, pick one of these to create a new
+service entry and run against this.
+
+If you have created a service entry in a previous session, and wish to run
+against this existing service entry (with its associated data - messages,
+folder structure, etc) then key '0', which searches the root of the database
+for the first IMAP service, then uses this for the connection. This allows
+synchronisation to be tested -
+
+ - Blank database
+ - Create new service entry, connect and synchronise trees and inbox
+ - Disconnect
+ - Using another client, alter the inbox/folder tree
+ - Connect again, using option '0'
+ - Client synchronises changes on the remote server back to the database
+
+The current operation sequence is this:
+
+ 1. Connect to server (checks hierarchy separator if necessary)
+ 2. Perform full sync operation, which conists of
+    - Select inbox
+    - Sync inbox
+    - Sync folder tree
+    - Check remote folder subscriptions
+      For each subscribed folder:
+      - Select folder
+      - Sync folder
+ 3. Logout
+ 4. Disconnect
+ 5. Create text file showing database structure (zac.txt)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/NOTES01.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,108 @@
+
+Test Suite Notes
+----------------
+
+Automated tests
+---------------
+
+To run the tests, run up the code and select 'y' to clean the message
+folder.
+
+Select 1 and then 2,3 or 4 depending on which IMAP server you are
+connecting to (add extras as necessary to the function
+CActiveConsole::SelectImap4ServerEntryL()).
+
+select 7 (automation)
+select 1 (this will connect and put the server in a known state).
+select 2 (runs offline tests without dialling)
+select 3 (connects and runs more tests)
+select X X to exit
+
+
+OffLine tests
+-------------
+
+States 0-699: Test combinations of offline Move/Copy/Delete operations
+checking that
+ 1) Op Queue in folders are correct
+ 2) Shadow items are created correctly
+ 3) Visibilities are updated correctly
+ 4) DisconnectedOp flags are updated correctly
+
+Each combination tests that the individual op gives the right results
+and that the combination resolves correctly.
+
+Combinations checked are
+ 10: MoveFromLocal + CopyTolocal == CopyFromLocal
+ 20: CopyFromLocal + CopyToLocal == Immediate Copy
+100: CopyToLocal + CopyFromLocal == CopyToLocal + CopyWithinService
+200: CopyWithinService + CopyWithinService
+203: MoveWithinService + CopyWithinService
+300: MoveFromLocal + MoveToLocal (same folder) == nothing
+310: CopyFromLocal + MoveToLocal == immediate copy
+320: MoveFromLocal + MoveToLocal == immediate move
+400: MoveToLocal + MoveFromLocal (same folder) == nothing
+410: MoveToLocal + MoveFromLocal == MoveWithinService
+420: CopyToLocal + Delete + MoveFromLocal == nothing
+500: MoveWithinService + MoveWithinService (same folder) == nothing
+510: MoveWithinService + MoveWithinService == MoveWithinService
+600: Delete + Undelete = nothing
+
+State 700: Check message flags
+
+Check that the various test messages have the correct flags etc. set
+
+ 1) Check priority values
+ 2) Check return receipt addresses
+ 3) Check disposition addresses
+ 4) Check MHTML flags TODO
+ 5) Check Attachment flags TODO
+
+States 701-710: Test right result given when performing ops offline.
+
+ KErrDisconnected: KIMAP4MTMIsConnected, KIMAP4MTMSynchronise,
+ KIMAP4MTMFullSync, KIMAP4MTMRenameFolder, KIMAP4MTMDisconnect,
+ KIMAP4MTMSyncTree, KIMAP4MTMSelect
+
+ KErrNone: KIMAP4MTMBusy, KIMAP4MTMCancelBackgroundSynchronise
+
+States 711-717: Test LocalSubscription/LocalUnsubscription
+
+ Subscribe and unsubscribe folders and check visibility changes
+
+States 800-899: Test Populate options
+
+ Test Populate option is inserted into queue correctly.
+
+
+Synchronise tests
+-----------------
+
+States 0-99: Set up assortment of offline operations to do when going
+on line including
+
+ CopyToLocal
+ CopyWithinService
+ MoveToLocal
+ MoveWithinService
+ Delete
+ Populate (4 flag variations)
+ Multiple CopyWithinService to same folder
+ CopyToLocal and then delete ghost
+ CopyWithinService and then delete ghost
+ MoveToLocal and then delete ghost
+ MoveWithinService and then delete ghost
+  
+States 100-102: Go online and wait for sync to end
+
+State 103: Check that
+ 1) all the above happened 
+ 2) Queues are updated correctly
+ 3) Disconnected Op Flags are updated correctly
+ 4) Complete flags are updated correctly
+ 5) Shadows are removed
+ 6) Check delete happened (if deleting on connection).
+
+States 200-299: check that the logging worked as expected.
+
+State 300: Check delete happened (if deleting on disconnection).
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/NoReceived.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,67 @@
+<< * OK Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 (lon-cn-exchng2k.msexchange2k.closedtest.intra) ready.
+>> 1 CAPABILITY
+<< * CAPABILITY IMAP4 IMAP4rev1 IDLE LOGIN-REFERRALS MAILBOX-REFERRALS NAMESPACE LITERAL+ UIDPLUS CHILDREN AUTH=NTLM
+<< 1 OK CAPABILITY completed.
+>> 2 LOGIN davids davids
+<< 2 OK LOGIN completed.
+>> 3 SELECT "INBOX"
+<< * 1 EXISTS
+<< * 0 RECENT
+<< * FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
+<< * OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags
+<< * OK [UNSEEN 1] Is the first unseen message
+<< * OK [UIDVALIDITY 1378] UIDVALIDITY value
+<< 3 OK [READ-WRITE] SELECT completed.
+>> 4 UID FETCH 1:* (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Priority X-Priority X-MSMail-Priority Importance)])
+<< * 1 FETCH (UID 196 FLAGS (\Seen) BODYSTRUCTURE (("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 36 1 NIL NIL NIL)("TEXT" "HTML" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 372 7 NIL NIL NIL) "alternative" ("boundary" "----=_NextPart_000_0009_01C53B84.6642C1A0") NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From)] {109}
+<< Date: Thu, 7 Apr 2005 15:13:48 +0100
+<< Subject: test2
+<< From: "IMAP" <davids@msexchange2k.closedtest.intra>
+<< 
+<< )
+<< 4 OK FETCH completed.
+>> 5 LIST "" "%"
+<< * LIST (\Marked \HasNoChildren) "/" "Big Test inbox"
+<< * LIST (\HasNoChildren) "/" Calendar
+<< * LIST (\HasNoChildren) "/" Contacts
+<< * LIST (\HasNoChildren) "/" "Deleted Items"
+<< * LIST (\HasNoChildren) "/" Drafts
+<< * LIST (\Marked \HasNoChildren) "/" INBOX
+<< * LIST (\HasNoChildren) "/" Journal
+<< * LIST (\HasNoChildren) "/" Notes
+<< * LIST (\HasNoChildren) "/" Outbox
+<< * LIST (\Marked \HasNoChildren) "/" "Sent Items"
+<< * LIST (\HasNoChildren) "/" Tasks
+<< * LIST (\Noselect) "/" "Public Folders/"
+<< 5 OK LIST completed.
+>> 6 LIST "" "Big Test inbox/%"
+<< 6 OK LIST completed.
+>> 7 LIST "" "Calendar/%"
+<< 7 OK LIST completed.
+>> 8 LIST "" "Contacts/%"
+<< 8 OK LIST completed.
+>> 9 LIST "" "Deleted Items/%"
+<< 9 OK LIST completed.
+>> 10 LIST "" "Drafts/%"
+<< 10 OK LIST completed.
+>> 11 LIST "" "INBOX/%"
+<< 11 OK LIST completed.
+>> 12 LIST "" "Journal/%"
+<< 12 OK LIST completed.
+>> 13 LIST "" "Notes/%"
+<< 13 OK LIST completed.
+>> 14 LIST "" "Outbox/%"
+<< 14 OK LIST completed.
+>> 15 LIST "" "Sent Items/%"
+<< 15 OK LIST completed.
+>> 16 LIST "" "Tasks/%"
+<< 16 OK LIST completed.
+>> 17 LIST "" "Public Folders//%"
+<< 17 NO This a special mailbox and can not be selected or used as the destination for mailbox operations.
+>> 18 IDLE
+<< + IDLE accepted, awaiting DONE command.
+>> DONE
+<< 18 OK IDLE completed.
+>> 19 LOGOUT
+<< * BYE Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 signing off.
+<< 19 OK LOGOUT completed.
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/TEST.bat	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,23 @@
+@rem
+@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description:
+@rem
+
+if not exist \epoc32\wins\c\logs\email\nul md \epoc32\wins\c\logs\email\
+if not exist \epoc32\wins\c\logs\msgtest\nul md \epoc32\wins\c\logs\msgtest\
+
+if not exist \epoc32\wins\c\mailtest\nul md \epoc32\wins\c\mailtest
+if not exist \epoc32\wins\c\mailtest\rfc822\nul md \epoc32\wins\c\mailtest\rfc822
+copy \msg\impstsrc\rfc_*.txt \epoc32\wins\c\mailtest\rfc822\*.* >nul
+copy \msg\impstsrc\config.txt \epoc32\wins\c\mailtest\rfc822\config.txt
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/config.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,4 @@
+To: test@chaos.org.uk
+Server: utter.chaos.org.uk
+From: sjm@ant.co.uk
+Subject: Test: 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/mail1_Base64.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,130 @@
+<< * OK Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 (lon-cn-exchng2k.msexchange2k.closedtest.intra) ready.
+>> 1 CAPABILITY
+<< * CAPABILITY IMAP4 IMAP4rev1 IDLE LOGIN-REFERRALS MAILBOX-REFERRALS NAMESPACE LITERAL+ UIDPLUS CHILDREN AUTH=NTLM
+<< 1 OK CAPABILITY completed.
+>> 2 LOGIN davids davids
+<< 2 OK LOGIN completed.
+>> 3 SELECT "INBOX"
+<< * 1 EXISTS
+<< * 0 RECENT
+<< * FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
+<< * OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags
+<< * OK [UIDVALIDITY 1378] UIDVALIDITY value
+<< 3 OK [READ-WRITE] SELECT completed.
+>> 4 UID FETCH 1:* (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Priority X-Priority X-MSMail-Priority Importance)])
+<< * 1 FETCH (UID 32461 FLAGS (\Recent) BODYSTRUCTURE ("TEXT" "PLAIN" ("charset" "ISO-2022-JP") NIL NIL "BASE64" 1489 25 NIL NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From)] {309}
+<< Received: from [127.0.0.1] ([10.23.179.168]) by lon-cn-exchng2k.msexchange2k.closedtest.intra with Microsoft SMTPSVC(5.0.2195.5329);
+<< 	 Wed, 6 Jul 2005 12:08:21 +0100
+<< Date: Tue, 01 Feb 2005 16:38:02 +0900
+<< Subject: =?ISO-2022-JP?B?QVNDSUkxMDAwGyRCSjg7ehsoQg==?=
+<< From: tomonori <tomonori1000@yahoo.co.jp>
+<< 
+<< )
+<< 4 OK FETCH completed.
+>> 5 LIST "" "%"
+<< * LIST (\Marked \HasNoChildren) "/" "Big Test inbox"
+<< * LIST (\HasNoChildren) "/" Calendar
+<< * LIST (\HasNoChildren) "/" Contacts
+<< * LIST (\HasNoChildren) "/" "Deleted Items"
+<< * LIST (\HasNoChildren) "/" Drafts
+<< * LIST (\Marked \HasNoChildren) "/" INBOX
+<< * LIST (\HasNoChildren) "/" Journal
+<< * LIST (\HasNoChildren) "/" Notes
+<< * LIST (\HasNoChildren) "/" Outbox
+<< * LIST (\Marked \HasNoChildren) "/" "Sent Items"
+<< * LIST (\HasNoChildren) "/" Tasks
+<< * LIST (\Noselect) "/" "Public Folders/"
+<< 5 OK LIST completed.
+>> 6 LIST "" "Big Test inbox/%"
+<< 6 OK LIST completed.
+>> 7 LIST "" "Calendar/%"
+<< 7 OK LIST completed.
+>> 8 LIST "" "Contacts/%"
+<< 8 OK LIST completed.
+>> 9 LIST "" "Deleted Items/%"
+<< 9 OK LIST completed.
+>> 10 LIST "" "Drafts/%"
+<< 10 OK LIST completed.
+>> 11 LIST "" "INBOX/%"
+<< 11 OK LIST completed.
+>> 12 LIST "" "Journal/%"
+<< 12 OK LIST completed.
+>> 13 LIST "" "Notes/%"
+<< 13 OK LIST completed.
+>> 14 LIST "" "Outbox/%"
+<< 14 OK LIST completed.
+>> 15 LIST "" "Sent Items/%"
+<< 15 OK LIST completed.
+>> 16 LIST "" "Tasks/%"
+<< 16 OK LIST completed.
+>> 17 LIST "" "Public Folders//%"
+<< 17 NO This a special mailbox and can not be selected or used as the destination for mailbox operations.
+>> 18 IDLE
+<< + IDLE accepted, awaiting DONE command.
+>> DONE
+<< 18 OK IDLE completed.
+>> 19 UID FETCH 32461 (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Reply-to To Cc Bcc Message-ID Return-Receipt-To X-Return-Receipt-To Disposition-Notification-To Disposition-Notification-Options Priority X-Priority X-MSMail-Priority Importance)])
+<< * 1 FETCH (UID 32461 FLAGS (\Recent) BODYSTRUCTURE ("TEXT" "PLAIN" ("charset" "ISO-2022-JP") NIL NIL "BASE64" 1489 25 NIL NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From Reply-to To Cc Bcc Message-ID Return-Receipt-To X-Return-Receipt-To Disposition-Notification-To Disposition-Notification-Options Priority X-Priority X-MSMail-Priority Importance)] {405}
+<< Received: from [127.0.0.1] ([10.23.179.168]) by lon-cn-exchng2k.msexchange2k.closedtest.intra with Microsoft SMTPSVC(5.0.2195.5329);
+<< 	 Wed, 6 Jul 2005 12:08:21 +0100
+<< Date: 
+<< Tue, 01 Feb 2005 16:38:02 +0900
+<< Subject: =?ISO-2022-JP?B?QVNDSUkxMDAwGyRCSjg7ehsoQg==?=
+<< From: tomonori <tomonori1000@yahoo.co.jp>
+<< To: mot1008jp@yahoo.co.jp
+<< Message-ID: <JG2005020116374116.5681349@yahoo.co.jp>
+<< X-Priority: 3
+<< 
+<< )
+<< 19 OK FETCH completed.
+>> 20 UID FETCH 32461 (BODY[1]<0.20480> BODY[1.MIME])
+<< * 1 FETCH (BODY[1]<0> {1489}
+<< YWJjZGVmZ2hpamFiY2RlZmdoaWphYmNkZWZnaGlqYWJjZGVmZ2hpamFiY2RlZmdoaWphYmNk
+<< ZWZnaGlqYWJjZGVmZ2hpamFiY2RlZmdoaWphYmNkZWZnaGlqYWJjZGVmZ2hpamFiY2RlZmdo
+<< aWphYmNkZWZnaGlqYWJjZGVmZ2hpamFiY2RlZmdoaWphYmNkZWZnaGlqYWJjZGVmZ2hpamFi
+<< Y2RlZmdoaWphYmNkZWZnaGlqYWJjZGVmZ2hpamFiY2RlZmdoaWphYmNkZWZnaGlqYWJjZGVm
+<< Z2hpamFiY2RlZmdoaWphYmNkZWZnaGlqYWJjZGVmZ2hpamFiY2RlZmdoaWphYmNkZWZnaGlq
+<< YWJjZGVmZ2hpamFiY2RlZmdoaWphYmNkZWZnaGlqYWJjZGVmZ2hpamFiY2RlZmdoaWphYmNk
+<< ZWZnaGlqYWJjZGVmZ2hpamFiY2RlZmdoaWphYmNkZWZnaGlqYWJjZGVmZ2hpamFiY2RlZmdo
+<< aWphYmNkZWZnaGlqYWJjZGVmZ2hpamFiY2RlZmdoaWphYmNkZWZnaGlqYWJjZGVmZ2hpamFi
+<< Y2RlZmdoaWphYmNkZWZnaGlqYWJjZGVmZ2hpamFiY2RlZmdoaWphYmNkZWZnaGlqYWJjZGVm
+<< Z2hpamFiY2RlZmdoaWphYmNkZWZnaGlqYWJjZGVmZ2hpamFiY2RlZmdoaWphYmNkZWZnaGlq
+<< YWJjZGVmZ2hpamFiY2RlZmdoaWphYmNkZWZnaGlqYWJjZGVmZ2hpamFiY2RlZmdoaWphYmNk
+<< ZWZnaGlqYWJjZGVmZ2hpamFiY2RlZmdoaWphYmNkZWZnaGlqYWJjZGVmZ2hpamFiY2RlZmdo
+<< aWphYmNkZWZnaGlqYWJjZGVmZ2hpamFiY2RlZmdoaWphYmNkZWZnaGlqYWJjZGVmZ2hpamFi
+<< Y2RlZmdoaWphYmNkZWZnaGlqYWJjZGVmZ2hpamFiY2RlZmdoaWphYmNkZWZnaGlqYWJjZGVm
+<< Z2hpamFiY2RlZmdoaWphYmNkZWZnaGlqYWJjZGVmZ2hpamFiY2RlZmdoaWphYmNkZWZnaGlq
+<< YWJjZGVmZ2hpamFiY2RlZmdoaWphYmNkZWZnaGlqYWJjZGVmZ2hpamFiY2RlZmdoaWphYmNk
+<< ZWZnaGlqYWJjZGVmZ2hpamFiY2RlZmdoaWphYmNkZWZnaGlqYWJjZGVmZ2hpamFiY2RlZmdo
+<< aWphYmNkZWZnaGlqYWJjZGVmZ2hpamFiY2RlZmdoaWphYmNkZWZnaGlqYWJjZGVmZ2hpamFi
+<< Y2RlZmdoaWphYmNkZWZnaGlqYWJjZGUxMjM0NQ==
+<< __________________________________
+<< Let's Celebrate Together!
+<< Yahoo! JAPAN
+<< http://pr.mail.yahoo.co.jp/so2005/
+<< 
+<<  BODY[1.MIME] {687}
+<< Received: from [127.0.0.1] ([10.23.179.168]) by lon-cn-exchng2k.msexchange2k.closedtest.intra with Microsoft SMTPSVC(5.0.2195.5329);
+<< 	 Wed, 6 Jul 2005 12:08:21 +0100
+<< MIME-Version: 1.0
+<< Date: Tue, 01 Feb 2005 16:38:02 +0900
+<< Subject: =?ISO-2022-JP?B?QVNDSUkxMDAwGyRCSjg7ehsoQg==?=
+<< From: tomonori <tomonori1000@yahoo.co.jp>
+<< To: mot1008jp@yahoo.co.jp
+<< Message-ID: <JG2005020116374116.5681349@yahoo.co.jp>
+<< Content-Type: text/plain; charset=ISO-2022-JP
+<< Content-Transfer-Encoding: Base64
+<< X-Mailer: JsvMail 5.5 (Shuriken Pro3 Trial)
+<< X-Priority: 3
+<< Return-Path: tomjan@msexchange2k.closedtest.intra
+<< X-OriginalArrivalTime: 06 Jul 2005 11:08:21.0640 (UTC) FILETIME=[0568A880:01C5821B]
+<< 
+<<  UID 32461 FLAGS (\Seen \Recent))
+<< 20 OK FETCH completed.
+>> 21 IDLE
+<< + IDLE accepted, awaiting DONE command.
+>> DONE
+<< 21 OK IDLE completed.
+>> 22 LOGOUT
+<< * BYE Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 signing off.
+<< 22 OK LOGOUT completed.
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/mail1_Base64_body.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,1 @@
+abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde12345
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/mail1_UUEncoded.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,3305 @@
+<< * OK Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 (lon-cn-exchng2k.msexchange2k.closedtest.intra) ready.
+>> 1 CAPABILITY
+<< * CAPABILITY IMAP4 IMAP4rev1 IDLE LOGIN-REFERRALS MAILBOX-REFERRALS NAMESPACE LITERAL+ UIDPLUS CHILDREN AUTH=NTLM
+<< 1 OK CAPABILITY completed.
+>> 2 LOGIN davids davids
+<< 2 OK LOGIN completed.
+>> 3 SELECT "INBOX"
+<< * 1 EXISTS
+<< * 0 RECENT
+<< * FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
+<< * OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags
+<< * OK [UNSEEN 1] Is the first unseen message
+<< * OK [UIDVALIDITY 1589] UIDVALIDITY value
+<< 3 OK [READ-WRITE] SELECT completed.
+>> 4 UID FETCH 1:* (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Priority X-Priority X-MSMail-Priority Importance)])
+<< * 1 FETCH (UID 32475 FLAGS () BODYSTRUCTURE (("TEXT" "PLAIN" ("CHARSET" "US-ASCII") NIL NIL "7BIT" 9 1 NIL NIL NIL)("IMAGE" "JPEG" ("x-mac-type" "4A504547" "x-mac-creator" "4A565752" "name" "screen.jpg") NIL NIL "X-UUENCODE" 201017 NIL ("attachment" ("filename" "screen.jpg")) NIL) "mixed" ("boundary" "=====================_11834497==_") NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From)] {819}
+<< Received: from [127.0.0.1] ([10.23.179.168]) by lon-cn-exchng2k.msexchange2k.closedtest.intra with Microsoft SMTPSVC(5.0.2195.5329);
+<< 	 Mon, 11 Jul 2005 15:41:16 +0100
+<< Received: from mx3.messagingengine.com (mx3.internal [10.202.2.202])
+<< 	 by server2.messagingengine.com (Cyrus v2.3-alpha) with LMTPA;
+<< 	 Tue, 05 Apr 2005 07:47:35 -0400
+<< Received: from smtp003.mail.ukl.yahoo.com (smtp003.mail.ukl.yahoo.com [217.12.11.34])
+<< 	by mx3.messagingengine.com (Postfix) with SMTP id A956E5A0CB3
+<< 	for <l_luchford@fastmail.co.uk>; Tue,  5 Apr 2005 07:47:34 -0400 (EDT)
+<< Received: from unknown (HELO lon-leel03.yahoo.co.uk) 
+<< (l?luchford@80.7.227.13 with login)
+<<   by smtp003.mail.ukl.yahoo.com with SMTP; 5 Apr 2005 11:47:22 -0000
+<< Date: Tue, 05 Apr 2005 12:47:19 +0100
+<< Subject:
+<< From: Lee Luchford <l_luchford@yahoo.co.uk>
+<< 
+<< )
+<< 4 OK FETCH completed.
+>> 5 LIST "" "%"
+<< * LIST (\Marked \HasNoChildren) "/" "Big Test inbox"
+<< * LIST (\HasNoChildren) "/" Calendar
+<< * LIST (\HasNoChildren) "/" Contacts
+<< * LIST (\HasNoChildren) "/" "Deleted Items"
+<< * LIST (\HasNoChildren) "/" Drafts
+<< * LIST (\Marked \HasNoChildren) "/" INBOX
+<< * LIST (\HasNoChildren) "/" Journal
+<< * LIST (\HasNoChildren) "/" Notes
+<< * LIST (\HasNoChildren) "/" Outbox
+<< * LIST (\Marked \HasNoChildren) "/" "Sent Items"
+<< * LIST (\HasNoChildren) "/" Tasks
+<< * LIST (\Noselect) "/" "Public Folders/"
+<< 5 OK LIST completed.
+>> 6 LIST "" "Big Test inbox/%"
+<< 6 OK LIST completed.
+>> 7 LIST "" "Calendar/%"
+<< 7 OK LIST completed.
+>> 8 LIST "" "Contacts/%"
+<< 8 OK LIST completed.
+>> 9 LIST "" "Deleted Items/%"
+<< 9 OK LIST completed.
+>> 10 LIST "" "Drafts/%"
+<< 10 OK LIST completed.
+>> 11 LIST "" "INBOX/%"
+<< 11 OK LIST completed.
+>> 12 LIST "" "Journal/%"
+<< 12 OK LIST completed.
+>> 13 LIST "" "Notes/%"
+<< 13 OK LIST completed.
+>> 14 LIST "" "Outbox/%"
+<< 14 OK LIST completed.
+>> 15 LIST "" "Sent Items/%"
+<< 15 OK LIST completed.
+>> 16 LIST "" "Tasks/%"
+<< 16 OK LIST completed.
+>> 17 LIST "" "Public Folders//%"
+<< 17 NO This a special mailbox and can not be selected or used as the destination for mailbox operations.
+>> 18 IDLE
+<< + IDLE accepted, awaiting DONE command.
+>> DONE
+<< 18 OK IDLE completed.
+>> 19 UID FETCH 32475 (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Reply-to To Cc Bcc Message-ID Return-Receipt-To X-Return-Receipt-To Disposition-Notification-To Disposition-Notification-Options Priority X-Priority X-MSMail-Priority Importance)])
+<< * 1 FETCH (UID 32475 FLAGS () BODYSTRUCTURE (("TEXT" "PLAIN" ("CHARSET" "US-ASCII") NIL NIL "7BIT" 9 1 NIL NIL NIL)("IMAGE" "JPEG" ("x-mac-type" "4A504547" "x-mac-creator" "4A565752" "name" "screen.jpg") NIL NIL "X-UUENCODE" 201017 NIL ("attachment" ("filename" "screen.jpg")) NIL) "mixed" ("boundary" "=====================_11834497==_") NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From Reply-to To Cc Bcc Message-ID Return-Receipt-To X-Return-Receipt-To Disposition-Notification-To Disposition-Notification-Options Priority X-Priority X-MSMail-Priority Importance)] {920}
+<< Received: from [127.0.0.1] ([10.23.179.168]) by lon-cn-exchng2k.msexchange2k.closedtest.intra with Microsoft SMTPSVC(5.0.2195.5329);
+<< 	 Mon, 11 Jul 2005 15:41:16 +0100
+<< Received: from mx3.messagingengine.com (mx3.internal [10.202.2.202])
+<< 	 by server2.messagingengine.com (Cyrus v2.3-alpha) with LMTPA;
+<< 	 Tue, 05 Apr 2005 07:47:35 -0400
+<< Received: from smtp003.mail.ukl.yahoo.com (smtp003.mail.ukl.yahoo.com [217.12.11.34])
+<< 	
+<< by mx3.messagingengine.com (Postfix) with SMTP id A956E5A0CB3
+<< 	for <l_luchford@fastmail.co.uk>; Tue,  5 Apr 2005 07:47:34 -0400 (EDT)
+<< Received: from unknown (HELO lon-leel03.yahoo.co.uk) (l?luchford@80.7.227.13 with login)
+<<   by smtp003.mail.ukl.yahoo.com with SMTP; 5 Apr 2005 11:47:22 -0000
+<< Date: Tue, 05 Apr 2005 12:47:19 +0100
+<< Subject:
+<< From: Lee Luchford <l_luchford@yahoo.co.uk>
+<< To: l_luchford@fastmail.co.uk
+<< Message-Id: <6.2.1.2.0.20050405124701.0274a008@pop.mail.yahoo.co.uk>
+<< 
+<< )
+<< 19 OK FETCH completed.
+>> 20 UID FETCH 32475 (BODY[1]<0.20480> BODY[1.MIME])
+<< * 1 FETCH (BODY[1]<0> {9} some text  BODY[1.MIME] {48} Content-Type: text/plain; charset="us-ascii" UID 32489 FLAGS (\Seen))
+<< 20 OK FETCH completed.
+>> 21 UID FETCH 32475 (BODY[2]<0.20480> BODY[2.MIME])
+<< * 1 FETCH (BODY[2]<0> {201017}
+<< 
+<< begin 600 screen.jpg
+<< M_]C_X``02D9)1@`!`0$!+`$L``#_VP!#``@&!@<&!0@'!P<)"0@*#!0-#`L+
+<< M#!D2$P\4'1H?'AT:'!P@)"XG("(L(QP<*#<I+#`Q-#0T'R<Y/3@R/"XS-#+_
+<< MVP!#`0D)"0P+#!@-#1@R(1PA,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R
+<< M,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C+_P``1"`,`!``#`2(``A$!`Q$!_\0`
+<< M'P```04!`0$!`0$```````````$"`P0%!@<("0H+_\0`M1```@$#`P($`P4%
+<< M!`0```%]`0(#``01!1(A,4$&$U%A!R)Q%#*!D:$((T*QP152T?`D,V)R@@D*
+<< M%A<8&1HE)B<H*2HT-38W.#DZ0T1%1D=(24I35%565UA96F-D969G:&EJ<W1U
+<< M=G=X>7J#A(6&AXB)BI*3E)66EYB9FJ*CI*6FIZBIJK*SM+6VM[BYNL+#Q,7&
+<< MQ\C)RM+3U-76U]C9VN'BX^3EYN?HZ>KQ\O/T]?;W^/GZ_\0`'P$``P$!`0$!
+<< M`0$!`0````````$"`P0%!@<("0H+_\0`M1$``@$"!`0#!`<%!`0``0)W``$"
+<< M`Q$$!2$Q!A)!40=A<1,B,H$(%$*1H;'!"2,S4O`58G+1"A8D-.$E\1<8&1HF
+<< M)R@I*C4V-S@Y.D-$149'2$E*4U155E=865IC9&5F9VAI:G-T=79W>'EZ@H.$
+<< MA8:'B(F*DI.4E9:7F)F:HJ.DI::GJ*FJLK.TM;:WN+FZPL/$Q<;'R,G*TM/4
+<< MU=;7V-G:XN/DY>;GZ.GJ\O/T]?;W^/GZ_]H`#`,!``(1`Q$`/P#$HHHKZ`\0
+<< MZ/2_!>I:OIL5_;S6:0R%@OFR[3D'![5;_P"%=:Q_S\Z=_P"!'_UJU[&62'X8
+<< MVTD3LCB23#*<$?O!WKFEUJ[9YE%]=X@V>8V]]J[V*IENG+*5'/48KR:V-G3F
+<< MTVDKV/1AAZ;BK[LT5^'.IF-R]Y8!P!L`F!!YYR>W'UIT'PXU!I"+B^LHTQP8
+<< MY`YS]"1_.L*'Q8+B^%G%JUP9R"RJ7<!@/[I/![G@]!GI6S$VL30)/'=3F-W$
+<< M:G[3R6)P!C.<_P!.>E)XNM;?<TEA(1=I+5%S_A6LG_05B_[Y7_XNC_A6LG_0
+<< M5B_[Y7_XNJ<9UJ2]:S6:[,ZYW)YI&/?.<8]_<4YAK2P^:;FXV^6)<"XRVP_Q
+<< M;<YQ^%3]:K?S?D'U:EV_,M?\*UD_Z"L7_?*__%T?\*UD_P"@K%_WRO\`\75.
+<< M:35K="TUY*A`!*&Z^<9Z?+NSW]*K_P!I7_\`S^W/_?UO\:/K5;^;\@^KTNWY
+<< MFI_PK63_`*"L7_?*_P#Q='_"M9/^@K%_WRO_`,75%Y]5CM8[EKFZ$,A(5_-.
+<< M"1^/%/GDU>V&9[J>,[0^UKC#8/`XSGM^'>CZU6_F_(/J]+M^9;_X5K)_T%8O
+<< M^^5_^+H_X5K)_P!!6+_OE?\`XNLW^TK[_G]N/^_K?XT?VE??\_MQ_P!_6_QH
+<< M^M5OYOR#ZO2[?F:7_"M9/^@K%_WRO_Q='_"M9/\`H*Q?]\K_`/%UF_VC??\`
+<< M/[<?]_6_QJ>TN-2O+E+>*\GWN<#,S`#]:/K5;^;\@^KTNWYEO_A6LG_05B_[
+<< MY7_XNC_A6LG_`$%8O^^5_P#BZJSSZC`D<AOIGBESLD65L-CKP>?S%/B.KS>1
+<< MY=Q<'S]WE_O_`+VWKWXH^M5OYOR#ZO2[?F3_`/"M9/\`H*Q?]\K_`/%T?\*U
+<< MD_Z"L7_?*_\`Q=47O;^/;F]F.Y0PVSD_G@\'VI/[1O?^?RX_[^M_C1]:K?S?
+<< MD'U>EV_,O_\`"M9/^@K%_P!\K_\`%T?\*UD_Z"L7_?*__%U0_M&]_P"?RX_[
+<< M^M_C5N8ZK%?FR%W/)-D#"2M@Y&>]'UJM_-^0?5Z7;\R3_A6LG_05B_[Y7_XN
+<< MC_A6LG_05B_[Y7_XNJTMSJ$.-][(<]-ESO\`Y$TQKZ_4X:ZN0<`X,C=#R*/K
+<< M5;^;\@^KTNWYES_A6LG_`$%8O^^5_P#BZ/\`A6LG_05B_P"^5_\`BZIF^OU"
+<< MDW5R`PR"9&Y'3^E6'DOX[**Y;4)`LN=B>:^XX.#[?K1]:K?S?D'U>EV_,D_X
+<< M5K)_T%8O^^5_^+H_X5K)_P!!6+_OE?\`XNJG]H7O_/W<?]_#_C1_:%[_`,_=
+<< MQ_W\/^-'UJM_-^0?5Z7;\RW_`,*UD_Z"L7_?*_\`Q='_``K63_H*Q?\`?*__
+<< M`!=-22^DLY;E=0D(BQO3S'W#)P/;]:K_`&^\_P"?N?\`[^'_`!H^M5OYOR#Z
+<< MO2[?F6O^%:R?]!6+_OE?_BZ/^%:R?]!6+_OE?_BZ1Y+Z.SCN6U"0"7.Q/,?<
+<< M<'!]OUILTNI6Z1O)=2[9,[66?<#CKT-'UJM_-^0?5Z7;\Q__``K63_H*Q?\`
+<< M?*__`!='_"M9/^@K%_WRO_Q=0RW5]#*T;7<Q*GJ)&P1V(]C1'>7DDBI]ME7<
+<< M0-S2D`>YH^M5OYOR#ZO2[?F3?\*UD_Z"L7_?*_\`Q='_``K63_H*Q?\`?*__
+<< M`!=-AEU*><P1W$_FC/RM*5/'7J:6234HH5F>XG\MB55Q*2"1]#1]:K?S?D'U
+<< M>EV_,7_A6LG_`$%8O^^5_P#BZ/\`A6LG_05B_P"^5_\`BZD\O5U!+33(`H8[
+<< MY]N`>F<GVIO_`!-`7#3S)L;:Q>?:,^F2>:/K5;^;\@^K4NWYC?\`A6LG_05B
+<< M_P"^5_\`BZ/^%:R?]!6+_OE?_BZ<&U(H'^U.%)(#-<`!L=<9//U%*?[46+S#
+<< M/-MV"3`FR=OKC.<4?6JW\WY!]6I=OS&?\*UD_P"@K%_WRO\`\71_PK63_H*Q
+<< M?]\K_P#%TXOJ*Q"1KF15*[@&GP2/4`G-)YM^;K[.MU*SDX'[T@-Z8)/?M1]:
+<< MK?S?D'U>EV_,3_A6LG_05B_[Y7_XNC_A6LG_`$%8O^^5_P#BZDD.IQ1O(TT^
+<< MQ&V,1+G!].#2;M2`A)FG'GG$>9#\WZ^]'UJM_-^0?5J7;\QG_"M9/^@K%_WR
+<< MO_Q='_"M9/\`H*Q?]\K_`/%U+_Q,_/D@\Z821KN8&;``]<YQWI?^)GN8&:8!
+<< M5#%C-A<'H<YQ1]:K?S?D'U:EV_,A_P"%:R?]!6+_`+Y7_P"+H_X5K)_T%8O^
+<< M^5_^+J8?VB4+_:6V!MNXW(QG&<9S2%]06,2-<2*I7<`T^"1ZX)S1]:K?S?D'
+<< MU:EV_,B_X5K)_P!!6+_OE?\`XNC_`(5K)_T%8O\`OE?_`(NI9'U"%29+B12`
+<< M"5,_S#/MG-*CW[QB3[1(J,2`7GVYQZ9/-'UJM_-^0?5Z7;\R'_A6LG_05B_[
+<< MY7_XNC_A6LG_`$%8O^^5_P#BZL'^TEB\PS2XV>9@39.WUQG.*60:C#DR3RJ%
+<< M(#'SL[<],@$D4?6JW\WY!]6I=OS*W_"M9/\`H*Q?]\K_`/%T?\*UD_Z"L7_?
+<< M*_\`Q=3W$EY;L@:[D8.@=2LC=#]:B^V77_/S-_WV:/K5;^;\@^KTNWYC?^%:
+<< MR?\`05B_[Y7_`.+H_P"%:R?]!6+_`+Y7_P"+I_VRZ_Y^9O\`OLT"\NO^?F;_
+<< M`+[-'UJM_-^0?5Z7;\QG_"M9/^@K%_WRO_Q='_"M9/\`H*Q?]\K_`/%T_P"V
+<< M77_/S-_WV:7[9<_\_$W_`'V:/K5;^;\@^KTNWYD?_"M9/^@K%_WRO_Q='_"M
+<< M9/\`H*Q?]\K_`/%U)]LN?^?B;_OLTOVNY_Y^)?\`OLT?6JW\WY!]7I=OS(O^
+<< M%:R?]!6+_OE?_BZ/^%:R?]!6+_OE?_BZE^UW/_/Q+_WV:7[7<_\`/Q+_`-]F
+<< MCZU6_F_(/J]+M^9#_P`*UD_Z"L7_`'RO_P`71_PK63_H*Q?]\K_\74PN[G_G
+<< MXE_[[-+]KN?^?B7_`+[-'UJM_-^0?5Z7;\R#_A6LG_05B_[Y7_XNC_A6LG_0
+<< M5B_[Y7_XNK'VNY_Y^)?^^S1]KN?^?B7_`+[-'UJM_-^0?5Z7;\RO_P`*UD_Z
+<< M"L7_`'RO_P`71_PK63_H*Q?]\K_\75G[5<?\_$O_`'V:/M5Q_P`_$O\`WV:/
+<< MK5;^;\@^KTNWYE;_`(5K)_T%8O\`OE?_`(NC_A6LG_05B_[Y7_XNK7VJX_Y[
+<< MR_\`?9H%U<?\]Y?^^S1]:K?S?D'U>EV_,J_\*UD_Z"L7_?*__%T?\*UD_P"@
+<< MK%_WRO\`\75K[5<?\]Y?^^S2_:KC_GO+_P!]FCZU6_F_(/J]+M^94_X5K)_T
+<< M%8O^^5_^+H_X5K)_T%8O^^5_^+JW]JN/^>\O_?9I?M-Q_P`]Y?\`OLT?6JW\
+<< MWY!]7I=OS*?_``K63_H*Q?\`?*__`!='_"M9/^@K%_WRO_Q=7/M-Q_SWE_[[
+<< M-+]IG_Y[R?\`?9H^M5OYOR#ZO2[?F4O^%:R?]!6+_OE?_BZ/^%:R?]!6+_OE
+<< M?_BZO?:9_P#GO)_WV:/M,_\`SWD_[[-'UJM_-^0?5Z7;\RC_`,*UD_Z"L7_?
+<< M*_\`Q='_``K63_H*Q?\`?*__`!=7_M,__/:3_OLT?:9_^>TG_?1H^M5OYOR#
+<< MZO2[?F4/^%:R?]!6+_OE?_BZ/^%:R?\`05B_[Y7_`.+K0^TS_P#/:3_OHT?:
+<< M)_\`GM)_WT:/K5;^;\@^KTNWYF?_`,*UD_Z"L7_?*_\`Q='_``K63_H*Q?\`
+<< M?*__`!=:/VB?_GM)_P!]&C[1/_SVD_[Z-'UJM_-^0?5Z7;\S._X5K)_T%8O^
+<< M^5_^+H_X5K)_T%8O^^5_^+K1^T3_`//:3_OHTOVB;_GM)_WT:/K5;^;\@^KT
+<< MNWYF;_PK63_H*Q?]\K_\71_PK63_`*"L7_?*_P#Q=:7VB;_GM)_WT:7[1-_S
+<< MVD_[Z-'UJM_-^0?5Z7;\S,_X5K)_T%8O^^5_^+H_X5K)_P!!6+_OE?\`XNM/
+<< M[1-_SUD_[Z-+Y\W_`#UD_P"^C1]:K?S?D'U>EV_,R_\`A6LG_05B_P"^5_\`
+<< MBZ/^%:R?]!6+_OE?_BZU?/F_YZO_`-]&CSYO^>K_`/?1H^M5OYOR#ZO2[?F9
+<< M7_"M9/\`H*Q?]\K_`/%T?\*UD_Z"L7_?*_\`Q=:WGS?\]7_[Z-'GS?\`/5_^
+<< M^C1]:K?S?D'U>EV_,R?^%:R?]!6+_OE?_BZ/^%:R?]!6+_OE?_BZU_/E_P">
+<< MK_\`?1H$\O\`SU?_`+Z-'UJM_-^0?5Z7;\S(_P"%:R?]!6+_`+Y7_P"+H_X5
+<< MK)_T%8O^^5_^+K8\Z7_GJ_\`WT:/.E_YZO\`]]&CZU6_F_(/J]+M^9C_`/"M
+<< M9/\`H*Q?]\K_`/%T?\*UD_Z"L7_?*_\`Q=;'G2_\]7_[Z-+YTO\`ST?_`+Z-
+<< M'UJM_-^0?5Z7;\S&_P"%:R?]!6+_`+Y7_P"+H_X5K)_T%8O^^5_^+K9\Z7_G
+<< MH_\`WT:7SI?^>C_]]&CZU6_F_(/J]+M^9B_\*UD_Z"L7_?*__%T?\*UD_P"@
+<< MK%_WRO\`\76V)I?^>C_]]&CSI/\`GH__`'T:/K5;^;\@^KTNWYF)_P`*UD_Z
+<< M"L7_`'RO_P`71_PK63_H*Q?]\K_\76YYLG_/1_\`OHT>;)_ST?\`[Z-'UJM_
+<< M-^0?5Z7;\S#_`.%:R?\`05B_[Y7_`.+H_P"%:R?]!6+_`+Y7_P"+K=\V3_GH
+<< MWYT>;)_ST;\Z/K5;^;\@^KTNWYF%_P`*UD_Z"L7_`'RO_P`71_PK63_H*Q?]
+<< M\K_\76]YLG_/1OSH$LG]]OSH^M5OYOR#ZO2[?F8/_"M9/^@K%_WRO_Q='_"M
+<< M9/\`H*Q?]\K_`/%UO^;)_?;\Z/,D_OM^='UJM_-^0?5Z7;\S`_X5K)_T%8O^
+<< M^5_^+H_X5K)_T%8O^^5_^+K?\R3^^WYTOF/_`'V_.CZU6_F_(/J]+M^9S_\`
+<< MPK63_H*Q?]\K_P#%T?\`"M9/^@K%_P!\K_\`%UT'F/\`WV_.E\Q_[[?G1]:K
+<< M?S?D'U>EV_,Y[_A6LG_05B_[Y7_XNC_A6LG_`$%8O^^5_P#BZZNS43&4RM(5
+<< M1-V%?!)R!Z'UJ?9;>ES_`-_A_P#$TOK=;^;\O\@^K4NQQO\`PK63_H*Q?]\K
+<< M_P#%T?\`"M9/^@K%_P!\K_\`%UT@N8V\0C3PDPB%D]RS&4%BPD1`!\O`^9L]
+<< M<\=,<\M#\1[&X@CG@\(>-)89%#I(EHK*RD9!!'4$4?6ZW\WY?Y!]6I=B7_A6
+<< MLG_05B_[Y7_XNC_A6LG_`$%8O^^5_P#BZUM/UF'5M5T>*TCGCM+^R6\S*X+@
+<< M,R!1P,`X8YZ\X].;\NIZ1#J\&E2RW,=Y<1M+"CN0)`OW@K;-I8=2H.0.<8YH
+<< M^MUOYOP7^0?5J78YK_A6LG_05B_[Y7_XNJK>!X4U9--?6%6=X&G!\C<H4,J\
+<< MD,>26_0^V=RX\2:=<:7%>:.\MQ')?)9B9G/EGYPK%3M&\=0&4D9[G!%174P@
+<< M\5"<Q)*8]'E<!R<9#H>Q!H^MUOYOP0?5J78YWQ%X3CT#2_MG]IK<DRI&(TA*
+<< M_>/4DFN9KL/$$\ES\/\`3[B9MTLKV[NV,9)`)/%<?7?A*LZD6Y,X\33C!KE0
+<< M4445UG,%%%%`'H5M_P`DNM_^NDG_`*-6O*H+WQ'`EUI7DS":XQ#+*BL(I8@/
+<< ME4OT"*,\#D[B,99MWL6@6)U+P!9V@(&]YCDOM&`X;K@^GH:A;P>B>9NEB7RV
+<< M"OFY<;2<8!_<\$Y&/J*\#$TZ=1SA4BG=_-6=]#W,)/V4H5DDY):75[77]>1Y
+<< M7-H6GC4H8+(W5U-"\%P;R:U>'YPP\U"3\I`V?+MS_K%QG:[GO[&ZMH=-MHY+
+<< MA1(EZL[+M;(48![8SW^GOQ6K_P`(A'_SVB_\"6_^,T?\(A'_`,]HO_`EO_C-
+<< M94XRA!0E)RMM>VB[:67GZM@W*4Y3D[N3OJ9VG:]-]LMA>2A88P0\@4[G&#MW
+<< M$<G!/ZYJ*\U51##':A"QLU@DD(;</5>>/QQWZUK?\(A'_P`]HO\`P);_`.,T
+<< M?\(@G_/:+_P);_XS5:`9E[?075A*+@VLUV2GERP1LK''4L2!V]/RK+\U/(\O
+<< M[/'N_P">N6W=?KCVZ5T__"(I_P`]HO\`P);_`.,TO_"(I_SVB_\``E__`(S3
+<< MN@,:+5YK2UAB@967RL,KKD*^]B&'N,@__JK0;5K-K8"60RL8;8.I4DL5<EQS
+<< MP>/7K5G_`(1%/^>T/_@2_P#\9H_X1)/^>T/_`($O_P#&:6@%(:C&EY>S/?"9
+<< M)(91"I#,%)((&&&/Z<4MIJD`BMVGFP5:9KF+:?WY;IP!@^G.*N?\(DG_`#VA
+<< M_P#`E_\`XS1_PB2?\]H?_`E__C-&@%$:A:?V=;1RG+1-'F.$MM=0<G<I`7/Y
+<< MY/M5J/5;1;N-Y;GS<7,DBOM8^7&5("\C/7'`XXJ7_A$T_P">T/\`X$O_`/&:
+<< M/^$33_GM#_X$O_\`&:-`,B>]\_1X(1<L)$9_-1BW[S+`@^A[]:EL-3BM]*GB
+<< M<9N$S]G;G*[A@[3CY<=??-:7_")I_P`]8?\`P)?_`.,T?\(HO_/6'_P)?_XS
+<< M3T`KP:G:+)#ND38+6*)VRZNI!).TJ/SZ9XYHM=0LQ+92/<,HMWFW>:"68-T/
+<< M`()YYJS_`,(HO_/6'_P)?_XS1_PBB_\`/6'_`,"7_P#C-+0"C!>6:::T'FY5
+<< MK9E\N3>3YN<\#[H'H>M#:A;#Q-]M#EH,@;@I_N8Z?6KW_"*+_P`]8?\`P)?_
+<< M`.,T?\(JO_/6'_P)?_XS1H!SQ6.!U820W`YRHW@?CP#^537=S#+*A2WBPJQY
+<< M(+\X4`KR>G;UXZUM_P#"*K_SUA_\"7_^,TO_``BJ_P#/6'_P)?\`^,T[@8ES
+<< M<PRV\")!$K+'@D%\H=S'`R?0^_6KPREAH\Y5O*BD9I'"DA1O'6KO_"++_P`]
+<< M8?\`P)?_`.,T?\(LO_/6'_P)?_XS0!0>_CN1J$+S*JRD>2Y0A=H<MS@9SSGI
+<< M5N?5K<S;H;A@#=H[8##*!`#^HZ5)_P`(N/\`GK!_X$O_`/&:7_A%Q_SU@_\`
+<< M`E__`(S2T`HA1_9VK2QH5@D=#$=N`1O/2LP2)Y.SR(]W_/3+;OYX_2NA_P"$
+<< M7'_/6#_P)?\`^,T?\(N/^>L'_@2__P`9IW`SKB)I-&TY@"$4R!GP2%RW?%.-
+<< MU$EE%;QW85HX90S+&2'W$';R,CIUJ_\`\(P/^>L'_@2__P`9H_X1@?\`/6#_
+<< M`,"7_P#C-(#'5([F.%Y9?*5/W4C[=V.I4^_I[;:8T-N(2RW6Y]BD)Y9&2>HS
+<< M[>O>MS_A&!_SU@_\"7_^,T?\(R/^>L'_`($/_P#&:=P*%G-%'J%O?2R!$*D.
+<< M2"3O"X/3J3D-GWIBZE):PQPP2(ZA"""I(#;V(89[]#_^JM+_`(1D?\]8/_`A
+<< M_P#XS1_PC/\`TU@_\"'_`/C-&@%>74;=[)U9A+(T$2E7#?,P))R>/7UJ.VU(
+<< MRR.UV]L8WE#,DD;$CC&5P,=..?2KG_"-?]-8/_`A_P#XS2_\(U_TU@_\"'_^
+<< M,TM`*D%Y;!/+F\AK4%RD;(QD4'.`#T]._P"-*U];-$L2L$<VBQ&;!.T]U(]#
+<< MZ@5:_P"$:_Z:P?\`@0__`,9H_P"$;_Z:P?\`@0__`,9HT`S+MX;F*W=9D5HX
+<< M%0HP;)(STP,?K1;LC/:W#L%$+A9"03T.5/Y9'_`16G_PC?\`TU@_\"'_`/C-
+<< M+_PC?_32#_P(?_XS3N!1DU'R))#`ZR*\TC,K*=K*P7&0<>]3PZE"5MIIY6>>
+<< M%96(P>6)X'3TS]*G_P"$<_Z:6_\`X$/_`/&:/^$<_P"FEO\`^!#_`/QFEH!7
+<< M6^M-BODAOLK0F-LD<$;1D`=>:AAU"1F;>ULL>Q4$<J,RX'3ID\>_K5[_`(1S
+<< M_II;_P#@0_\`\9H_X1T_\]+?_P`"'_\`C-&@%>2ZM6@ECMY(H@9]ZB2,L,;0
+<< M.!@XYJ,743V1CN#!(RQ;8RJ-O![#.,8'^<U=_P"$=/\`STM__`A__C-'_".G
+<< M_GI;_P#@0_\`\9HT`J37,%Q`5N'@:8LH$L4;9'J6R!GCM4<K02VD$*W"J86<
+<< M9=6&X$Y!&`:O_P#".G_GI;_^!#__`!FC_A'C_P`]+?\`\"'_`/C-&@%*XOE$
+<< M42P!23;+$[X.1ZCT_2EOKWSYYH[95*3%<L`=SX'`Y]_05=_X1X_\]+?_`,"'
+<< M_P#C-'_"/'_GI;_^!#__`!FC0"AJ:E6M58$$6Z`@]NM4:W?^$?/_`#TM_P#P
+<< M(?\`^,T?\(^?^>EO_P"!#_\`QFG<##I16W_PC[?\]+?_`,"'_P#C-+_8#?\`
+<< M/2W_`/`A_P#XS1<+&'2UM_V`W_/2W_\``A__`(S1_8#?\]+;_P`"'_\`C-%P
+<< ML8E+6U_8+?\`/2V_\"'_`/C-+_8+?\]+;_P(?_XS1<+&)2UM?V"W_/2V_P#`
+<< MA_\`XS1_83?\]+;_`,"'_P#C-%PL8PHK9_L)O^>EM_X$/_\`&J/["?\`YZ6W
+<< M_@0__P`:HN%C'HK9_L-_^>EM_P"!#_\`QJC^PW_YZ6W_`($/_P#&J+A8QZ*V
+<< M/[#?^_;?^!#_`/QJC^Q'_OVW_@0__P`:HN%C(I16M_8C_P!^V_\``A__`(U2
+<< M_P!B/_?MO_`A_P#XU1<+&12UK?V*_P#?MO\`P(?_`.-4?V*_]^V_\"'_`/C5
+<< M%PL9-+6K_8K_`-^V_P#`A_\`XU2_V-)_?M?_``(?_P"-47"QDBEK5_L:3^_:
+<< M_P#@0_\`\:H_L:3^_:_^!#__`!JBX6,L45J?V/)_?M?_``(?_P"-4?V/)_?M
+<< M?_`A_P#XU1<+&916I_8\G]^U_P#`A_\`XU1_8\G]^U_\"'_^-47"QF4"M/\`
+<< MLB3^_:_^!#__`!JC^R)/[]K_`.!#_P#QJBX6,VE%:/\`9$O]^U_\"'_^-4O]
+<< MDR_W[7_P(?\`^-47"QFTM:/]DR_W[7_P(?\`^-4?V3+_`'[7_P`"'_\`C5%P
+<< ML9U+6A_94O\`?M?_``(?_P"-4O\`94O]^U_\"'_^-47"QG"EK0_LJ7^_:_\`
+<< M@0__`,:H_LN7^_:?^!#_`/QJBX6*`HJ__9<O]^T_\")/_C5']ES?WK3_`,")
+<< M/_C5%PL4:*O_`-F3?WK3_P`")/\`XU1_9DW]ZT_\")/_`(U1<+%&E%7?[,F_
+<< MO6G_`($2?_&J/[-F_O6G_@1)_P#&J+A8I4M7/[-F_O6G_@1)_P#&J7^S9O[U
+<< MI_X$2?\`QJBX6*5+5S^S9O[UI_W_`)/_`(U1_9TW]ZT_[_R?_&J+A8ITM6_[
+<< M.G_O6G_?^3_XU2_V?/\`WK3_`+_R?_&J+A8J"BK?]GS_`-ZT_P"_\G_QJC^S
+<< MY_[UI_W_`)/_`(U1<+%6BK7V"?\`O6?_`'_D_P#C5'V"?^]9_P#?^3_XU1<+
+<< M%:BK7V"?^]9_]_Y/_C5'V"?^]9_]_P"3_P"-47"Q6I15C[#/_>L_^_\`)_\`
+<< M&J/L,_\`>L_^_P#)_P#&J+A8KTM3_8;C^]9_]_Y/_C5+]BN/[UG_`-_Y/_C5
+<< M%PL5Z6I_L5Q_>L_^_P#)_P#&J/L5Q_>L_P#O_)_\:HN%B"EJ;['<?WK/_O\`
+<< MR?\`QJE^QW']ZS_[_P`G_P`:HN%A]I+'#%=22NJ((AEF.`/G7O7*_P#"7:U_
+<< M;?V7_A'+;^S_`+3Y?VW^V(/]5NQYGE]>GS;>O:NAN=(%Y&([J#39T!W!99'8
+<< M`^N#%[U5_P"$6T__`*!>B?D?_C-)V8#8KRV;Q?),+B$Q+I+AG#C:#Y\7?\16
+<< M/H.OS:7X=TS3Y]%NVFM;2*!V2[LRI94"G&9QQD5M?\(MI_\`T"]$_(__`!FC
+<< M_A%M/_Z!>B?D?_C-&@&1X3C-OK?ABU=D,UMH\4,H1PX5U:($9!(X-'BW2[?Q
+<< M=Y&F76I6$.C+^]F>.1&N7D&0JIN!6-1G)89)^[@`DG;B\.VL&_R;#2(_,0H^
+<< MPL-RGJ#B'D>U1_\`"+:?_P!`O1/R/_QF@#!E:>'P_I5A>7.G3SVVHV\<;V)"
+<< MK)$K@*QC`Q&<8RHRH['!P+&NWUK8:^K74Z1++I$L2%C@%BZX'Z&MB/PU912+
+<< M)'IVC(Z$,K+D$$="#Y-<SXQ\2V7A+Q#97NHB8QO9M`/L\(F.XN#T9X^/E//Z
+<< M>@`FL_\`)-M*_P"W;_T$5R==GXDOHM4^'NFZG"&$=Y+',H9=IVEV`R,G!P!D
+<< M9/.>:XRO3P'PR//QGQ(****[SC"BNIC;38=&TJ6XMX1/;6[7:_(O^DDS2($?
+<< M/+@,L7']SS/:FZQI5BNH:G=(_E6]O-<QR1*54K*)"(E08P%(9#CKB.7'W16?
+<< MM%>UC3DTN=KX*_Y%"P_[>?ZU/??\Q?\`["MO_P"R5!X*_P"10L/^WG^M3WW_
+<< M`#%_^PK;_P#LE>+6_B2]6>K2^"/HC%M[Z^N!:/<^)=$TUM0U"YLK&VGT^1WD
+<< M,4SQ@;O/7)(0<X`RRKU(!?X6U^YUFS\K4]/N-/U:"*-[FWFMY(A\X.&3>`2I
+<< M*N/8JPR1ACEZ%XHLH=031]2U#1K?2X[G4&DEENHH[B"9[F[4X8SI)"=C)AEC
+<< M8D2'E>HOZ$NBP:]/8:!JD>HV%CH]C;+.MV+@Y62Z.&<$C.".!@`$``#`K-K0
+<< MM,U+_7M'TN=8-0U:QM)F7>([BY2-BN2,X)'&0?RJ:#4;.ZNYK6WN$EFA4-($
+<< MY"@LZ=>F=T;@CJ"ISBL6?2[V[\87T\.H7UA#]@M4$EO'$5E827!(S)&W*@CI
+<< MC[W/45S%Q;Z\;V^ES?00O.$GG\B>1O(6YOR@41LLA`W6_P!QAA64GY,YD9Z7
+<< M56_U*PTN!9]0O;:TA9M@DN)5C4M@G&21S@'\JK>'ENDT*V6\FFFE&[#S1&-R
+<< MFX[,JS,P^7;]\E_[WS9%9WBY)?\`B2RQR7T*PWY>2:QMC/)$IMYESMV/P2P7
+<< M[I^]VZT`:YU?3O[(EU9+R&73XHWE:XA;S$VIG<05SG&#T]*GAO+6YD>."YAE
+<< M>/[ZHX8K\S+R!T^9''U4CL:X3Q09=1TB^60:[<02Z28[`16]Q&\MS^]63S8X
+<< MU7&?W/$BA3D[1C=5W0K2Y3Q7/>:DFHAY?-BM7)F\LA+J[.)`/EVB-XMGF<8(
+<< MV46`[2JLFI6$,'GRWMLD.YT\QI5"[D#%QG/50CY]-IST-6JX76-*U.-M;CM4
+<< MF^SVMM=WU@(0V\7$\9"[&`R7#_:B1DX\Z/'8*`=U17GTEEXCO-3U.&/4KR"[
+<< MF^UQJOV>=8DC*R"!O-,GE#&83F)/,SP?^6AK4L/[=N=9L+B;SHK2ZD;4&C;>
+<< MIA01O&('!X5L/;OLZ;UG.>%%`'6U5M=2L+V>X@M+VVN)K9MD\<4JNT39(PP!
+<< M^4Y!Z^AJU7$&&?4-?N[98]4AMI=<#S/&L]L'B%CL!$B[<KYL8'!QD+V89`.W
+<< MHKA8?[5&J:>DW]HW(CN9(H[8_:81'$MS(%F:=?DE_=*GR2\L%!!R^'SK*W\2
+<< MM:@2:CJ@NY&M5O!':3)Y4IN(=Y5Y79&`7SO]2GE%<EAMV"BP'I"312O*D<B.
+<< MT3;)%5@2C8#8/H<,#]"/6GUS>BZ>FG^)=7#K?"29D>!GDF>)X1#"F222ADW(
+<< MP^;]X0,]#FNDH&4M/UC3-6\S^S=1L[SRL>9]FG639G.,[2<9P?RJ[7GUGH>M
+<< M+X3T.>6[FAO(+:SM84L[8Q2V\;S6YE\S<7W,%C&?E48#[E(.!H7$5[!K30Q'
+<< M5#<QW=LMB=\SP&S`B$OF-DQEO^/CF0[SQCG90(ZZ*:*="\,B2*&9"R,"`RDJ
+<< MPX[@@@^A!HEFB@0/-(D:EE0,[``LQ"J.>Y)`'J2*\T,>N2'9!J.HI!#)<Q63
+<< M)%<73M*MW.N&9957A1"!]H)0_0/G4O[26]MK^*Z35WU!;U990AN!%]E2\1U,
+<< M6W]WO$*J?W?[S(/\6ZBP'=52U#6-,TGR_P"TM1L[/S<^7]IG6/?C&<;B,XR/
+<< MSJ>S\O[#;^3YWE>6NSS]_F8QQNW_`#;O7=SGKS6+J]R+#Q3IEY+!>26XLKJ)
+<< MGMK26?:S/;E01&K$9"-U]*`.@J&UNX+V%I;=]Z+))$3@CYD<HPY]&4C\*\^N
+<< MM/\`$%LT,"7%Y91"-GL(;:VEG\MVFE98SY4BQKL0P+B4M%Q@':&R&TU+[+J%
+<< MMHZ:O%JDMSJ7G!S/'#Y;FX,1C+XB#%S`04^;DGINHL!Z/17$7U_<ZCK4LT2:
+<< MTFBA;9;D);7,#XQ=$^6H42$[S;[C&,XQGY0:VO!\QG\/!_,N9%%W=I&URSF0
+<< M(MQ(JAM_S9"@#YN1CF@#3O\`4K#2X%GU"]MK2%FV"2XE6-2V"<9)'.`?RJ2T
+<< MO+6_M4NK.YAN;=\[)87#HV#@X(X/((_"L[Q5#+<>#];@@C>6:2PG1(T4LS,8
+<< MV```ZDFLGQ/]O^W77D_VCYOV)?[*^R>;Y?VO,F?-V?+M_P!1_KODQGMOH`Z>
+<< M\NX+"QN+RZ?R[>WC:65\$[549)P.3P.U35YWKL.J7%AJL$4>J2ZC(M^ES'MF
+<< M:!K8QS"`1@_NBQ_T?_5_/US_`!UNZ+]K_P"$IU#S?MES%^\/VJ7[1!''\X"1
+<< M+"_[M\*#B6/J%Y`+;F`.GJ&*\M9_)\JYAD\^,S0['!\Q./F7U7YEY''S#UJ:
+<< MO/GTSQ#9;_[/;R_[.W:;8_NBVV*7?L894[D7=9;F.2/L\O7G>`=W;7EK>QF2
+<< MTN89T&,M$X8<J&'(]592/8@]Z+J[@LH5EN'V(TD<0."?F=PBCCU9@/QKCK31
+<< M9V\2OIK?VI#HMLLJ6RPW4\**JPV2Q@,K#(SYV,D\[^^:SP-2OK73WUB+5WU1
+<< M[G39852*<0B,&W:4R*@\I6#B<G>`PP.@"T6`]'HKSZ'^V5M(9HO[7-S!;)<:
+<< MNDGG?O+B.6%V2`-\IW*MRH$7R'*@\%:VM$MM=BUM8]2FWQ06TDCLC.8Y'G9&
+<< MVJ6Z^6\<X`ZK&\0Y):@#IZA2\M9([>1+F%DN<>0P<$2Y4L-I_B^4$\=@34U>
+<< M<)HNOVOA;PS)9WFHS7T-L?+M)H80EM+]AF"9_=@C#E5^=B.<')H`]!GNX+::
+<< MVBE?:]S(8H1@G<P1GQ[?*C'GTJ:O*M3BU6WT.XNHKS49H;?SIHY7M;F`P.+*
+<< MZ!8&>1Y>IB&>$!QMRQ:NU\.[OMU[]E_M'^R_+B\K^T//\SSLR>9CS_WFW;Y7
+<< M^SG..=U%@.@HHHH&%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4
+<< M444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!11
+<< M10`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%
+<< M`!1110`4444`%%%%`#HT,LJ1KC+$*,^]2>3'_P`_,7Y-_P#$T6G_`!^0?]=%
+<< M_G7,Z[XX\.^&KY+/5]1^S7#QB54\B1\J20#E5(ZJ?RH$;MY-;V0@WSHS3W$=
+<< MO&J*V2SL%'4=.<GV'<\5'J&I:1I/E_VEK>G6?FY\O[3-Y>_&,XW`9QD?G63J
+<< M%W!?V_AZ\M7\RWN-2LI8GP1N5G!!P>1P>]>?>.A]NUC6[JZ\4:7;MI"LMEI=
+<< M[9V\S.#!%(=OF<Y9N`<$C!`ZD4[`>IRZMIJV%O>V^H6]W!<3)!$]LQ<.S/LX
+<< M.,8!SGGL>_%:1MU7&Z>)20&P0W&1GL*X4Z9+H_AS2;.:*VA8:RL@BMF)CC5[
+<< MEG55)5>`&`Z#I6QX\@@N=#,4FG7E]<-Y/V1+/*RQS[1LD63&(MIY+G@#.<YP
+<< M0#>E6&&)Y9+N((BEF.U^`.O\->0?$RT@\3'3&5Y8A+8FZ@)7H<%L/V`VY[]<
+<< M#/-;V@6.HV;:U_PD<$UQK[6ASJ8&^WE@QQ'$0JB/!SN0@$GYN1TY#XB:B^G^
+<< M&-'$9PUSI$=OG)Z':3^@(JHVN)G33C'P:\,@$'$</([_`#M7-UTDW_)&/#'_
+<< M`%R@_P#0VKFZ]+`_#(\_&?$@HHHKO.,<\DDBHKNS+&NU`3D*,DX'H,DG\35B
+<< M6_GGM3!(V[=,T\DA)+RN0!ECGG'./3>WK56BE9#N>L^$)HK?P98R32)'&/M(
+<< M+.P`&<@<GWJ*?5K:?[9AD7[3?Q3KNGB^1%VYW8;V/3/2K'@G/_"+Z0`2,SRC
+<< M(.#@N*N#4KQK:U?SY`TM]/&Q#G[BA\+U]A[\5X5;^)+U9[%+X(^B(/[3L/\`
+<< MG]MO^_J_XT?VG8?\_MM_W]7_`!J^;RX#A#<R[B-P&\YQQS^H_.JMGK]OJ,DT
+<< M=EJ\5R\!VS+!<AS&>>&`/'0]?0U@FGL:&5?V?AC5)UGU"WTB[F5=@DN$BD8+
+<< MDG&3GC)/YU=AO-+MX(X(+FSBAC4(D:2*JJH&``!T`%:?VNY_Y^)?^^S38KVY
+<< MD@23SY1N+C&\_P`+LG_LN?QI@4?[3L/^?VV_[^K_`(U5O_["U2!8-0_LV[A5
+<< MMXCN-DBAL$9P<\X)_.MK[7<_\_$O_?9H^UW/_/Q+_P!]F@#%L/["TN!H-/\`
+<< M[-M(6;>8[?9&I;`&<#'.`/RJU_:=A_S^VW_?U?\`&M#[7<_\_$O_`'V:/M=S
+<< M_P`_$O\`WV:-`,_^T[#_`)_;;_OZO^-9G]F^$_MWVW[%HOVOS/.\_P`J+S-^
+<< M<[MV,[L\YZYKH_M=S_S\2_\`?9H^UW/_`#\2_P#?9H`S_P"T[#_G]MO^_J_X
+<< MT?VG8?\`/[;?]_5_QJ.[\7Z7873VMYXBL[:X3&^*:]5'7(R,@MD<$'\:DL/%
+<< M.GZI.T&GZ];7<RKO,=O>+(P7(&<`GC)'YT`']IV'_/[;?]_5_P`:I6T/AVSO
+<< MI;VUCTN"[FSYL\2QK(^3D[F')R1DY[UMM>W*M$//E/F2QQ_?/&YPN?PSFG?:
+<< M[G_GXE_[[-`&?_:=A_S^VW_?U?\`&C^T[#_G]MO^_J_XUH?:[G_GXE_[[-'V
+<< MNY_Y^)?^^S1H!G_VG8?\_MM_W]7_`!H_M.P_Y_;;_OZO^-3ZC?W-K;631>4T
+<< MMS>"!GFC\S`('//I]:S;CQ%);W1MS=6+/N**/L\*%B&*D!7F#'Y@1TY(XS7/
+<< M5Q5*E-0E>[5]$WI\DPZ797M--\)V%TEU9V6BVUPF=DL,42.N1@X(&1P2/QK3
+<< M_M.P_P"?VV_[^K_C65J/BJZM;+3[RT>QNH+T,R,;/9@#'8D^OZ52'C74O^>%
+<< MC_X#BGAL32Q,7*D[I:;-?FD-IQW-^&\TNW@C@@N;.*&-0B1I(JJJ@8``'0`4
+<< M_P#M.P_Y_;;_`+^K_C7/CQIJ7_/"Q_\``<4H\9ZE_P`\+'_OP*Z>4FYO_P!I
+<< MV'_/[;?]_5_QJEJ$/AW5O+_M*/2[SRL^7]I6.39G&<;LXS@?E5`^+M55$=K6
+<< MT"/G:QMN&QUQ0/&.H_\`/"R_[\"CE"YI6']A:7`T&G_V;:0LV\QV^R-2V`,X
+<< M&.<`?E5K^T[#_G]MO^_J_P"-8@\8:C_SPLO^_`I1XOU#_GA9?]^!1RA<U+N;
+<< M1K^U>UO);"YMWQOBF9'1L'(R#P>0#^%/AO-+MX(X(+FSBAC4(D:2*JJH&``!
+<< MT`%9(\6ZA_SQL_\`OP*</%E__P`\;/\`[\"CE"Y=O_["U2!8-0_LV[A5MXCN
+<< M-DBAL$9P<\X)_.BP_L+2X&@T_P#LVTA9MYCM]D:EL`9P,<X`_*J8\5W_`/SQ
+<< ML_\`OP*4>*K_`/YXV?\`WX%'*%S5_M.P_P"?VV_[^K_C1_:=A_S^VW_?U?\`
+<< M&LQ?$]^[!5@M"Q.`!`.:<?$U^K%6@M`0<$&`<4N4=S1_M.P_Y_;;_OZO^-8O
+<< M]@^"?^@3X?\`_`>'_"K(\37O_/&T_P"_`I1XEO?^>5I_WX%.PKEJTFT:PM4M
+<< M;.6PMK=,[(H61$7)R<`<#DD_C4W]IV'_`#^VW_?U?\:HCQ)>_P#/*T_[\"E'
+<< MB.\_YY6O_?@4<H7+O]IV'_/[;?\`?U?\:/[3L/\`G]MO^_J_XU3'B*\_YY6O
+<< M_?A:</$-W_SRM?\`OPM+E'<M?VG8?\_MM_W]7_&LB'1_!UO/'/!IVA131L'2
+<< M1((596!R""!P0:O#Q!=_\\K7_OPM*->N_P#GG;?]^5IV%<EFO-+N()()[FSE
+<< MAD4H\;R*RLI&""#U!%/_`+3L/^?VV_[^K_C40UN\*EA#;D#J?('%*NM7;L%6
+<< M&W)/80+2Y1W)/[3L/^?VV_[^K_C1_:=A_P`_MM_W]7_&HQK=U_SSMO\`ORM+
+<< M_;5S_P`\[;_ORM'*%Q_]IV'_`#^VW_?U?\:/[3L/^?VV_P"_J_XTG]LW/_/.
+<< MW_[\K_A2_P!KW'_/.W_[\K_A1RA</[3L/^?VV_[^K_C1_:=A_P`_MM_W]7_&
+<< ME&K7']RW_P"_*_X4X:K<?W+?_ORO^%'*%QG]IV'_`#^VW_?U?\:/[3L/^?VV
+<< M_P"_J_XU(-4G_N0?]^5_PI1J<_\`<@_[\K_A1RA<B_M.P_Y_;;_OZO\`C1_:
+<< M=A_S^VW_`']7_&M-S<([(T]B&4X(\D]?^^:J:EJ7]EZ;<7T\UH8H$+LJ098X
+<< M[#Y>IZ<T6"Y7_M.P_P"?VV_[^K_C1_:=A_S^VW_?U?\`&KMQ>+:3&*XO]+BD
+<< M'570`^G]VJMYK<%GIMU??;=/FBMD+NL,09O8#Y>IZ<XHL%QG]IV'_/[;?]_5
+<< M_P`:/[3L/^?VV_[^K_C6A')</"DADLT#@D!H><9([*?2G;YO^>]C_P!^#_\`
+<< M$46"YF_VG8?\_MM_W]7_`!H_M.P_Y_;;_OZO^-8NM:U-J6EV,UB@E/\`:L*1
+<< MK&JQ&5EF(`SQ@%E&,X[$XK:^V^+_`/H6[S_P8P__`!=%@N']IV'_`#^VW_?U
+<< M?\:/[3L/^?VV_P"_J_XT?;?%_P#T+=Y_X,8?_BZ/MOB__H6[S_P8P_\`Q=%@
+<< MN']IV'_/[;?]_5_QH_M.P_Y_;;_OZO\`C1]M\7_]"W>?^#&'_P"+H^V^+_\`
+<< MH6[S_P`&,/\`\718+A_:=A_S^VW_`']7_&C^T[#_`)_;;_OZO^-'VWQ?_P!"
+<< MW>?^#&'_`.+H^V^+_P#H6[S_`,&,/_Q=%@N']IV'_/[;?]_5_P`:/[3L/^?V
+<< MV_[^K_C1]M\7_P#0MWG_`(,8?_BZ/MOB_P#Z%N\_\&,/_P`718+A_:=A_P`_
+<< MMM_W]7_&C^T[#_G]MO\`OZO^-'VWQ?\`]"W>?^#&'_XNC[;XO_Z%N\_\&,/_
+<< M`,718+A_:=A_S^VW_?U?\:/[3L/^?VV_[^K_`(U"VK>*U=E_X1O4"5X.V]B.
+<< M._9J/[7\6?\`0LZE_P"!<?\`\518+DW]IV'_`#^VW_?U?\:/[3L/^?VV_P"_
+<< MJ_XU+I.KW>IZ3'?,TL.^62/R_.WXV':>1QUSTS]:LQ7MS);P2^?*/-B23&\\
+<< M;E#8_6D!1_M.P_Y_;;_OZO\`C1_:=A_S^VW_`']7_&M!;NY:-9%N)2C`%6#G
+<< M!'L:/M=S_P`_$O\`WV:F,HR5XNX]3/\`[3L/^?VV_P"_J_XT?VG8?\_MM_W]
+<< M7_&K]K-++K<(>61O]'<9+G(!EAS5<:E>-;6K^?(&EOIXV(<_<4/A>OL/?BKL
+<< M(@_M.P_Y_;;_`+^K_C1_:=A_S^VW_?U?\:G;6XT<H^J(K*<$&X`(/YTL>LK-
+<< M((XM2#N>BK/DG\,T@*_]IV'_`#^VW_?U?\:/[3L/^?VV_P"_J_XUH?:[G_GX
+<< ME_[[-5?[=A_Z"L?_`($#_&@"'^T[#_G]MO\`OZO^-']IV'_/[;?]_5_QJ:37
+<< MH(HEEDU:-(WD$2NUP`"YY"@YZ^U6OM=S_P`_$O\`WV:-!V9G_P!IV'_/[;?]
+<< M_5_QH_M.P_Y_;;_OZO\`C6A]KN?^?B7_`+[-'VNY_P"?B7_OLT:",_\`M.P_
+<< MY_;;_OZO^-']IV'_`#^VW_?U?\:NR7\L,9DENW1!U9I"`/QS4']NP_\`05C_
+<< M`/`@?XT`0_VG8?\`/[;?]_5_QH_M.P_Y_;;_`+^K_C5];V=T#I=2,K#((D)!
+<< M%(U[<JT0\^4^9+'']\\;G"Y_#.:`*/\`:=A_S^VW_?U?\:/[3L/^?VV_[^K_
+<< M`(UH?:[G_GXE_P"^S1]KN?\`GXE_[[-&@&?_`&G8?\_MM_W]7_&C^T[#_G]M
+<< MO^_J_P"-:'VNY_Y^)?\`OLU'-J3VZ!YKUHU)P"\N!G\30!3_`+3L/^?VV_[^
+<< MK_C1_:=A_P`_MM_W]7_&K4.K"X<I#J'F,!DA)LG'X&IOM=S_`,_$O_?9H`S_
+<< M`.T[#_G]MO\`OZO^-']IV'_/[;?]_5_QJW-JAM]OGWYBW=-\VW/YFHO[=A_Z
+<< M"L?_`($#_&@"'^T[#_G]MO\`OZO^-']IV'_/[;?]_5_QK0^UW/\`S\2_]]FC
+<< M[7<_\_$O_?9HT`S_`.T[#_G]MO\`OZO^-']IV'_/[;?]_5_QJ==;C=PB:HC,
+<< MQP`+@$D_G5G[7<_\_$O_`'V:`,_^T[#_`)_;;_OZO^-']IV'_/[;?]_5_P`:
+<< MT/M=S_S\2_\`?9H^UW/_`#\2_P#?9HT`S_[3L/\`G]MO^_J_XT?VG8?\_MM_
+<< MW]7_`!K0^UW/_/Q+_P!]FFQ7MS)`DGGRC<7&-Y_A=D_]ES^-`%'^T[#_`)_;
+<< M;_OZO^-']IV'_/[;?]_5_P`:T/M=S_S\2_\`?9H^UW/_`#\2_P#?9HT`S_[3
+<< ML/\`G]MO^_J_XT?VG8?\_MM_W]7_`!K0^UW/_/Q+_P!]FFQ7MS);P2^?*/-B
+<< M23&\\;E#8_6@"C_:=A_S^VW_`']7_&C^T[#_`)_;;_OZO^-13>,M(MYI(9O$
+<< MEC'+&Q1T>^0,K`X((+<$40^,M(N)HX8?$EC)+(P1$2^0LS$X``#<DU?LI[V8
+<< M7)?[3L/^?VV_[^K_`(T?VG8?\_MM_P!_5_QJP;_4Y+Q[>US(4C5V+W#+U)`'
+<< M`/I^HJ3S=>_YYQGZ7C'_`-E^GYCU%38"D=3L]I\O4H(GQ\LBRH2I[$9R,CW!
+<< M%8G]GVO_`$-NH?\`@7%_\374>;KW_/.,_2\8_P#LOT_,>HI]Q>S6D)EN;PQ(
+<< MD0DD=I2%0;=Q))QP/7CI0!R1TNQ:2%W\4WKM#*DT>^YA8*ZG*G!3'!%._L^U
+<< M_P"AMU#_`,"XO_B:U/\`A-]$_P"AHT__`,&"?_%59LO$]CJ<QAL-<M[N55WE
+<< M(+M9&"Y`S@'IR/SJW3FE=IBT,'^R]/>:!Y_$MW<+#*DRQRW414LI!&?E]JGN
+<< MX+>[NGG;Q5>1[CPD5S$JJ`,``;>@`'OZYK=@O=8NE=[=`T:R.@+73`G:Q'3:
+<< M?3]1ZU+YNO?\\XS]+QC_`.R_3\QZBH&<LVFV;H4?Q7?LK#!!NXB"/^^:P_$7
+<< M@K3O%&J:5HLU]<0VEKIV^*6$*[-M95&<X'(;.17H\3ZTT\:R!$C9PK.MTS8!
+<< M.,XV\]?U'J*YN*<W7C*TN&!!ETEG()SUD0]:`,?Q'81Z5\.=*TZ&1I(K298$
+<< M=QAF"S.H)QWXKC*[[QM_R)UM_P!?K?\`H^2N!KU,!\+/.QGQ(****[SC"BBB
+<< M@#USP3_R*^C_`/7Q)_Z&*5/^//3_`/L(W/\`)Z3P3_R*^C_]?$G_`*&*5/\`
+<< MCST__L(W/\GKP:W\27JSV:7P1]$1.8(GN8[GSRTD$DD<=M"[N%66/=\B"0N&
+<< M+)NPI`')7YFK!U=;^\@OO$\$[V>JZ=I)DD2[T:ZPR0/+)L6=T@4K(L@5D,9^
+<< MZ&'*!A?\0V+W6I6[2:;=WMF]E/;RBU2UD9&:6WD4E+D["/W+=CCCH<$9)TF.
+<< MQT;6X-+\-:S]KU#3)[%#):Z1`H,BX!+0%'QD#C)'L2!CGITH0;DMV:.YW%1V
+<< MO_'C%_OS?^CI*DJ.U_X\8O\`?F_]'250&=!J&JW<4EY::*;NQ$\MNGD72"<M
+<< M'(T;%DDV($W(V")"<8./O;<"]BUVXN;^+2([_3M>5$E;^UKM6@$,ID52L<1D
+<< MCRICP.%;*@L6RP?)U.S\57=K/HLF@S2:3'>W4RI'/`5NO,G>17<-(#@!AA".
+<< MHW')VA*FD_#I=1N]NIZ!#IUFG,FY83)-_LJ8RVT>K9!`X7D[EXXU:ZJ\KC=7
+<< M_K6_Z%65CU6O)?#T'AA/%'B67Q%%I"K)=2>2^H+$`S"YN0^TOU(&S..VW/:O
+<< M6J\2\6^"_&=QJ,JZ/:3F(W=S.9H;N.-9%ED+KP7#9`)!R.N<9'-=$^:\>7O^
+<< MC$:?B&'PT_BCPU+X<72"D=U']H;3HX6`)N;;8&*@[3]_'0\,.FX'T'Q5JEUH
+<< MWAZ:]LQ";A988T\Y2R#?*B$D`@GACW%>:Z/X0\1P'P]]HTB_%S!<*^HSS7\<
+<< MD;`7,;HRKYI^[&K`X4')[]:](\6Z;<ZMX;N+6S0//YD,JH6`W^7*CE03QDA2
+<< M!G`R1D@<T7G:5]^GW?Y@<7:^$[_P_P"!K?QL^L->W=[#:2R,3=I<!9S`A0.E
+<< MX@;'RGD#)4#*C&W.^%]Y>7WBUKB]NY[B:2P=W:6>23+%+/+?.S?,1C)[X```
+<< M"@9-IX*\7QZQ>7LV@LJE]]MY)LPV3*NX.Q;.#$9!P<[MO.,UZ'X"\$KX;LH[
+<< MR]._5I8%1\$@0KY<8,>`Y4D&,9<=?I23J.2NK(5CKY?]9:_]?<'_`*-6I*CE
+<< M_P!9:_\`7W!_Z-6B<2M;R"%@LI0A&/0-C@UJ!3LB&U-K:1XMMH99P`%W/Y@.
+<< MT8W9R#(^3C@*OK6A5)M-#QML1(_-:3ROM#^8\`98@),C=\X\LX`/\75>E7Y"
+<< MAE<Q@A"3M![#M38(P/''_(J1_P#7=_\`T"N:T>WT^72+.2=+8R(IR'E"[L,Y
+<< M&Y?M*9_%1QZ]:[?7-$NM?T2.SM"@D\YV)<X&-H']16+9^#/&VGVJ6MIK20VZ
+<< M9VQC:0,DD]5)ZD_G5\L90M(Y:M/FJW<;JWEO?S/&-5_Y#?AW_KI%_P"TZ]?'
+<< M^D:-_P`OMGY-K_NP2?RR6S^O?OD7?P;UNZO["Z^U6J"TD#A!D[@"N!G/'W?>
+<< MMX?#_6_2V_[^_P#UJZ<14C.G3C%ZI:_>/#QE&+YE:[;^]ME<V>F[;69(\B]E
+<< MC6.++?N@"`_/?GCMUXIWV.SW`_94P+\VNW>^"OKUZ_ISTJY-X(\07'E^:ULW
+<< MEH(U^?&%'0=*8/`.M>EO_P!_/_K5RG0.-C$T-G;21%K9&N%:8D@Q@,<'(X'3
+<< MN*KM9))Y#E3*%LHV\L[I&))Q\HW#@?7`]*G'@+6O2W_[^?\`UJ4>`]:]+?\`
+<< M[^?_`%J+`,ETZSMY=H@#AKQ8?F9N%90>,$>M5K&)8-1OXHR2Z12K#_>W#@8]
+<< M\9Z5>'@36?2W_P"_G_UJ4>!M9](/^_G_`-:@!L<CQQV9GAGDN##*KE1F5`6X
+<< M;GGU`^M5IH_+UJS'G2R9,;8F.73)^Z?Y_C5P>!]8_NP?]_/_`*U.'@C6/[L'
+<< M_?RBP$4T?G7ET;B&=ECCE>,3.=I((^[TP/Q]*C:SMV5@(@I-G]H!#'Y6]!D]
+<< M/KZ]:M#P3K']V#_OY2CP5J_]V#_OY0`U+&&.ZED2(B-9(3"V3@Y(S@]Z([&*
+<< M>ZD,B[Q)-(-R`DICU.<#\C3_`/A"]7_NP_\`?RG?\(9J_P#=A_[^46`@,4=Q
+<< M+IZR(/*,2J9`3R0#\N>G7\:$M(#&'EA*/Y#NT88C!!X//-6!X.U;^[#_`-_*
+<< M4>#]6_N0_P#?RBP&./*:5B=T:$D@*-V/;DBK%E#%/.\1Y+(WEDY'S=NE:0\(
+<< M:K_<B_[^4H\(ZK_<B_[^4"&16]KYT+19Q(YV%68':%Y_6H?L\)3:(P#]F\W<
+<< M"<[OY5:'A+5?[D7_`'\IP\)ZI_<B_P"^Q1892NX(XH4>-=H)QAP0_3WX/X5(
+<< MMM&4WA"5^S[MP)QO_P`]JM#PKJG]R/\`[[%*/"VI_P!R/_OL4`1>3&D<R!=L
+<< M1,?[S/WAGDYZ4Z.*..[0+$ZD,PR00",'U)J0>%]3_P"><?\`WV*</#&I_P#/
+<< M./\`[[%%@,^>-4CB;9L=@=R\\<\=:C%:H\,ZE_SSC_[[%+_PC6I?\\T_[[%`
+<< MC+%.%:G_``CFI?\`/-/^^Q2_\([J/_/-/^^Q3`S!3A6D/#VH_P#/-/\`OL4H
+<< M\/ZA_P`\E_[[%`&<*<*T1H&H?\\E_P"^Q2C0=0_YY+_WV*`,KQ5XLT3PO>#^
+<< MV;W[-]HDD\K]T[[MI&?N@X^\.OK65K>K6.N?#V]U+39_/M)HF\N38RYP^T\,
+<< M`>H/:M>7P;K4TSROK6J;W8LV)X@,GV"8%07'@#4;NW>"XU74Y(I!M9&GC((_
+<< M[YJ;#N:-\^GQZU?F]%F7_=B/[2J-QNESC=_P'./:L+Q&]K)X6\0&T%L(_(@!
+<< M^SJJKG,O]WC/2M8^$M>,TDHU[5U>1BS;+B-03]`N*AN_`^KW]L]M=ZUJT\#C
+<< M#1R7,;`_@5IV`?XBCL9?"<B:E837]HUNPDM8(6EDE^=L!57G=G&#Q@\Y&,CD
+<< M/"FFZO9^(;=_%5O>7=V;8C3+II/M$=HG\<4C*BA9B,9E.0X&`>,'M;SPGK%Y
+<< M,'&I7T"*NU8H)8U51U_NY/))Y)Z^E5_^$(U?_H-:K_X$1_\`Q-*P7.=TG_D#
+<< M:'_V'(O_`$I:O9:\PO=#?P]:Z';2,QC&KV[!Y&4DYFW$G&!U:O2?M=M_S\1?
+<< M]]BF(FHJ'[7;?\_$7_?8H^UVW_/Q%_WV*8$U%0_:[;_GXB_[[%'VNV_Y^(O^
+<< M^Q0!-14/VNV_Y^(O^^Q1]KMO^?B+_OL4`345#]KMO^?B+_OL4?:[;_GXB_[[
+<< M%`$U%0_:[;_GXB_[[%'VNV_Y^(O^^Q0!SWB>:\M[2>:PM$N[I&9H[=YO*$AV
+<< MIQNP<''3(QG&2.HXWP;XIU7Q0EQ/=^'7TJUB9HE>:X+.\BG#*$*+P"""2>HQ
+<< MS@XZ3Q!XBM[;47MELM1N"K;C);VCR)RJ\!@,'IV_QK)_X2>+_H$ZS_X`/_A4
+<< M,HF\)?\`(G6G_7S=?^C35Y85N-'MH7)"R642$CK@Q**I^%HI8?"-FDT4D3_:
+<< M+AMDB%6`,F1D'D<$&M"V_P"0?9?]>D/_`*+6A@4;_6;'1=-N]6U&:6.V3;'-
+<< M=.FX'#;``J#/WB<_+U/ITE_M:Q_MO^QO/_XF'V;[5Y.QO]5NV[LXQUXQG-<!
+<< M\6-+NKO31#IVGR3F:WD9D@L7F+2B:W*G*<(^SS<.V?E\Q1]^L6Z\):SHOBSP
+<< M^%NKS49;6^MG-Y%93;FAD^257FW,`B"%3L)'_'P^`!Q7/AL-&A!QCU;?;T7R
+<< M5EZ+1):#<FV>T67_`"'(/^N#?^C8:ST_X\]/_P"PC<_R>M"R_P"0Y!_UP;_T
+<< M;#6>G_'GI_\`V$;G^3UT=!$UO/=PP0"W>Y()G/EQE]N?.DY(2)SW'<=*SU2Y
+<< MVB2'3H[F5[F*65=VUBXN9\?>4'D#:2<$#J,9Q<^S23011RV<KI&\I&'MB&+2
+<< M.P.)">S>@ZTEC:WJ,()+58+?SHR9#<Q?ZI999&R$/4APN%&/H*H1>92AVL4+
+<< M#J4)*Y[X)`S^5<QX@U;4=&T>`F?49--ETN!R(Y)H$@8;?NRPV;E2=G\<O\9R
+<< M`,&NFK`UK0K+Q)INFVVIQ:LGV.W2)4@BLF"L,;F5Y%9USM`."`0H!'7,HI;J
+<< MYY[I-]JE]XNT?Q!XCE62"\G*1W$FT",B(E%.U0H9CY9R,$A2/45ZOJ?_`""K
+<< MS_K@_P#Z":Y?5?"5YJ5WIPL]1EL]/M;A'>"YMH)'?;"$\T84KYA.[.?E^;<`
+<< M",'J[Z-YM/N8HQEWB95&>I(.*IQ45&SO_74TJU?:.]K?E_7_``YDW_B31/#W
+<< MB#4=.U;3]&N!&ZF!8186S1J1NP_G76YCAEYV)T)`((H7Q)H=CJ-UI;7*Q3PZ
+<< MB;3R5A?"O*[F-1@8P0I]ACG%;&L6-[J&N)J%KXA@MHXMGDPM#>$#;S\ZQW,<
+<< M;Y.>J<C`.0*X>^\$ZE=>+K_54FM5MYM;MK]%9VW>7%Y@;@+C)WC`S]2.E=.'
+<< MA1J.2K2MIIZW7Z7.=W6QW,O^LM?^ON#_`-&K44FJWME;^;--=-`L@5YI3+P"
+<< MP7/RPA<=_O'T!-2S!_W+(AD*3Q2;00"0LBD\D@=`>IJ!;/\`>M++83.[D[LO
+<< M9'(/&W)!;&..M<B+86$OGK&BN!';6%L''<R.BE1TZ!58]>XJ>7_66O\`U]P?
+<< M^C5HLK8:?I=K8H`NQ`\N"#ND898DC@XSM'7@"B7_`%EK_P!?<'_HU:.H="2N
+<< M:F\61?:8&ABD,(R)5<`$],$<]1S_`)Z=+64WAO2Y+JW8P"*WB#&1$=RTYXVK
+<< MDD[1UR1_^H5NH,T8)XKF%)H7#QN,JPJ3S?(S+YGE[027SC`[\TYW+D<*JJ`J
+<< MHHPJJ.@`[`4VD,S(KR[G&BS7=K>75U<&5T^52%#*ZJJYP0,!6R3TYSQ4^G2R
+<< MNES%<2AIH+EXL<!M@P58XXYR<$#!Q4FFVSV&FP6Q>,M'O7<A.6!8G)XX.&QC
+<< M)Z=:=8V[6=B\;2JTDUQ)<NJ9VH6P`N3C)`'7`ZTV(BU*[GL;-YK,XNWQ#%@9
+<< M8EF'"]R>,X]J=?7US;:M=V4L]S<6OV8E8W(+2L&"LHZ!LJ2Q'--U.S:_TZ:V
+<< M1PK.!@GID$'^E6$@9=6NM0:2)/,MQ`D4)8]6#,<D#`'W>G/M0M@(M/+/I-E(
+<< M8'A4P(JAP`6PH!8`'H2#@G&>M5YA-?7=[9QL?)CLF+%<8\QSM4,<''!S@8)Q
+<< M6B26.223TYJJMHPU=KS='L:V,)#9!4[@P(P#DGIV^O:CJ!3U6_E,.M63EI+6
+<< M,+]FA50,1E3@A>/E4JO(&1WK7<L[>8T#V_F?.(I``R@]`0"<'':J]I;M;O?S
+<< MM*N^[D3]VF?E5`0,DXY.<X[8ZU.268LQ))Y)/>AL$9E_/J-NWG1);>1'%*\A
+<< M>0X`&-N<J,,20``3G/;J':B]W9:)',IE^UQQ1RRK(@R20"P(P,`9/N,=:MW,
+<< M/VBUF@W;?,1DW8SC(Q5:XTY[O2+?3VD@B)CBCDD4LP0+C)`VC).WITYZ]Z`+
+<< M[;-Q\N19$S\KJ<AAV(J*U_X\8O\`?F_]'258N)?.N)),G#,2,]<=JKVO_'C%
+<< M_OS?^CI*0%-+R*XEC9II8!N1U0Q.,P[OFE;Y>5VAL=AU)!QAYN9+H7*VFY7M
+<< MT#,)(RI9F!*(`V.N,D^G3D\$&E10P7"//(_FP&V"@8V)\O.23DX0=AZ=``)[
+<< M2U6U2<F9I99V5G.TJ%QN.!EF)Y<\D\]3DDDO0"Q(H25U5@P4D!AW]ZAMO^0?
+<< M9?\`7I#_`.BUJ2J-REY+X;6/3Y4AO6TY%MY'&520PC:3P>`<=C]*0'*V4.@1
+<< MI#+=:%::C<3:I<)<$6L,C)YE_-%$TQ>)B$+;$X;=@$JIV-6GK]CX1L+&VLK/
+<< M3=/BUR*YL9S)%IZQO&/M=N&'F+&H#`2IE>&VNI*X;G-M-$U:PLW>S&I6]A+>
+<< MF:;3(9X4NY$*#<QN`=_FF;YLF8CR_EY^[6A8>%KP:7ID&J:Y=W$EKY<DB+%;
+<< M[6D$B3/^\\D2$-+&K,2VYB,L2>:V=625N;\S.+<MXV^[[M'NON[-G3:<,ZW<
+<< M\9_T:/M_M/[?Y]^A\\L_"W@_7KZ^EO+*.YU1M5O1<JT\B/(/M$OE[1YJ@Y`"
+<< MAE#`L"#RIW>AZ<,ZW<\9_P!&C[?[3^W^??H>#NO`?B3PFT$_@F[2X!G#307!
+<< MP\B@%8P[EB'C1&VA,#AB1EBA!2J2A\,FBVKM+H-_X1'P5:PV]]HUK"=3LM4L
+<< M0SQ32L%WW<:<*SNK#ET)&X;D89RI!ZOQSQX.UW_L%2_^B#61H7PVO-%MS:KK
+<< M-G-!+=VMQ,[6$AF=8)%>.,.T[`*`JJ/E.`>,Y&[I];L(M4L+K3YV=8;JU\AV
+<< M0@,%:/:<9SS@U,ZM2=G4E=@DEL<G<GPK::E?PR>&='/D7#".W\BU\YC')M\C
+<< MR_(R))5RT*;BTJIG<G)J_!;Z3_;V@W^EZ+9:5]KTZ_,D-M$B,-LUL`LH51B1
+<< M>0R\[&W+DXR=%;3649F7Q9JJEN6(M[(9^O\`H])%IMR=4BU"^UF^U":&"2")
+<< M;A(%5%=D9O\`5QIDYC7KFG*K)JS;"Q!K!*_#7Q,PX/V6_P"?PD_Q_7WPW,WO
+<< MP]\&02E5TJV4?/\`>NF[,X'6Z'H/\\'M%TTZQX2U73!+Y)O1=6_F[=VS>77.
+<< M.,XW=,^W?#0RZ)XEF8DZ[I^3G[ME<CJ6/:[_`-OW_'(W.G6J4U:$FO1B:3,7
+<< MPWX9T7P]X]M#H]FEN);:[279(S@A)[7;U=\$;SW4\C(Z;I-/_P"1FTW_`+`Q
+<< M_P#0XZW=.T/4X_$5OJFHZG:W/E1R11QP6CQX\V6)R2SRR<#RU``P/F)SR-V%
+<< MI_\`R,VF_P#8&/\`Z''4SG*;O)W8TK$'C;_D3K;_`*_6_P#1\E<#7?>-O^1.
+<< MMO\`K];_`-'R5P->C@/A9Y^,^)!1117><84444`>K>$WEC\&:<\"!Y5EF*`D
+<< M`9W=\D#]14L=MJ*K;(\&Y(9I)B`\(+,^[//FG`^;].M+X)_Y%?1_^OB3_P!#
+<< M%4=;U.;2_#$=]&!(\6H7+[7)PQ^?K^9KP:W\27JSV:7P1]#9S=?\^,G_`'_@
+<< M_P#CE&;K_GQD_P"_\'_QRH?[(\9_\\]!_P#`B;_XBC^R/&?_`#ST'_P(F_\`
+<< MB*RL:7)LW7_/C)_W_@_^.4BBY1`BV$@4%B!Y\'=BQ_Y:>I-1?V1XS_YYZ#_X
+<< M$3?_`!%']D>,_P#GGH/_`($3?_$4["N39NO^?&3_`+_P?_'*,W7_`#XR?]_X
+<< M/_CE0_V1XS_YYZ#_`.!$W_Q%']D>,_\`GGH/_@1-_P#$4K#N39NO^?&3_O\`
+<< MP?\`QRC-U_SXR?\`?^#_`..5#_9'C/\`YYZ#_P"!$W_Q%']D>,_^>>@_^!$W
+<< M_P`118+DV;K_`)\9/^_\'_QRC-U_SXR?]_X/_CE0_P!D>,_^>>@_^!$W_P`1
+<< M1_9'C/\`YYZ#_P"!$W_Q%%@N3`W.1NLW4=R9H3C\`^?RJV;256*L8@1P095X
+<< M_6L]=+\61NKW*:*(%.9/+GE+;>^`4QG%<9XQM=7UGXJV^CZ?J]W80/:F:7R)
+<< MV3@2/N(`(&[`'7TII+5R=DB7*VQZ";1V*DF+*NKC]\O!4@@]?4"E^S2?WHO^
+<< M_J_XUY5JGA;77OK>R\/^+-7GNY%9S%?7#PB1`!\T;YVOC(R!GAE/0C/)ZK%X
+<< MVTCQ%;:#/K-\^HW/E^5''?N02[%5&XD`<BKH1IUGRJ5GV::)E4<=;'T#]FD_
+<< MO1?]_5_QH^S2?WHO^_J_XU\]ZL/'&AP">_U/4%A\]K9I(=2\Y4E49,;%'.UL
+<< M?PG!Z^AI;T>-]-@TN>]U/4((=54/9R/J6%=2%.2=_P`@PZ\MC&?8UU?4;_:1
+<< M'M_(^DK"06N-^PXW?=E3OM]_8U>_M&+T_P#(B?\`Q5?,.K_\)IH,$$VHZQ=1
+<< MK<*KQ!-765G1@2KA4D)*G!^;&/>F:[)XT\,WR66L:EJ5M</&)53[>7RI)`.5
+<< M8CJI_*FL$^DD)U_(^H?[1B]/_(B?_%4?VC%Z?^1$_P#BJ^;;&Q\;ZC8Z7<6N
+<< MLWDDNJR2I96WV]Q)*(AEWR3M51@CE@2>@(YJAJ=UXNT=+:2\U:_$-RI:":+4
+<< M#-'(`<-M='*D@]1G(XSU%"P;;MS(/;+L?4/]HQ>G_D1/_BJ/[1B]/_(B?_%5
+<< M\Q:C<>*--TS3-2?7[R6TU*-G@DBO)>"C;71@<$,IQGC!SP36:/$NO?\`0;U+
+<< M_P`"G_QIK`R>T@]NET/J_P#M&+T_\B)_\51_:,7I_P"1$_\`BJ^4?^$EU[_H
+<< M-ZE_X%/_`(T[_A)-=_Z#6H_^!3_XT_J$_P"87MUV/JS^T8O3_P`B)_\`%4?V
+<< MC%Z?^1$_^*KY4'B37?\`H-:C_P"!3_XTO_"2:[_T&M1_\"G_`,:/J$_Y@]NN
+<< MQ]5?VC%Z?^1$_P#BJ/[1B]/_`"(G_P`57RM_PD>N_P#0:U'_`,"G_P`:=_PD
+<< M>N?]!G4?_`I_\:/J$_Y@]NNQ]3_VC%_=_P#(B?\`Q5']HQ?W?_(B?_%5\L_\
+<< M)'KG_09U'_P*?_&E'B+7/^@SJ'_@4_\`C1]0G_,'MUV/J7^T8O[O_D1/_BJ3
+<< M^T4_NC_OZG_Q5?+H\1:W_P!!G4/_``*?_&E'B+6_^@QJ'_@2_P#C2^H3_F#Z
+<< MPNQ]0_VBG]T?]_4_^*I/[17^XO\`W]3_`!KYA_X2'6_^@QJ'_@2_^-+_`,)#
+<< MK7_08U#_`,"7_P`:/J$_Y@^L1['TX=2'9%_[_)_C1_:7^PG_`'^3_&OF0>(-
+<< M:_Z#&H?^!+_XT[_A(-:_Z"]__P"!+_XT?4)_S#^L1['TS_:7^PG_`'^3_&C^
+<< MTA_<7_OZG^-?,_\`PD&M?]!>_P#_``)?_&E&OZS_`-!>_P#_``)?_&CZA/\`
+<< MF%]8CV/IC^T4_NC_`+^I_C2_VBG]T?\`?U/_`(JOF@:_K/\`T%K_`/\``E_\
+<< M:4:_K/\`T%K_`/\``E_\:/J,_P"8/K$>Q]+_`-HQ_P!T?]_4_P#BJ/[1B_N_
+<< M^1$_^*KYI&O:Q_T%K_\`\"7_`,:<->UC_H+7W_@0_P#C1]1G_,'UA=CZ4_M&
+<< M+^[_`.1$_P#BJ/[1B]/_`"(G_P`57S8->UC_`*"M]_X$/_C2_P!NZQ_T%;[_
+<< M`,"'_P`:/J,^X?6%V/I+^T8O3_R(G_Q5']HQ>G_D1/\`XJOF\:[J_P#T%;[_
+<< M`,"'_P`:7^W=7_Z"M]_X$/\`XT?49]P]NNQ]'_VC%Z?^1$_^*H_M&+T_\B)_
+<< M\57SE_;FK_\`04OO_`A_\:4:YJW_`$%+W_P(?_&CZC/N'UA=CZ,_M&+T_P#(
+<< MB?\`Q5']HQ>G_D1/_BJ^=!K>K?\`04O?_`A_\:<-;U;_`*"E[_X$/_C1]1GW
+<< M#ZPNQ]$_VC%Z?^1$_P#BJ/[1B]/_`"(G_P`57SO_`&WJW_03O?\`P(;_`!IW
+<< M]M:K_P!!.]_[_M_C2^I2[A]878^AO[1B]/\`R(G_`,51_:,7I_Y$3_XJOGH:
+<< MUJO_`$$[S_O^W^-*-:U7_H)WG_?]O\:/J4^X?6%V/H3^T8O3_P`B)_\`%4?V
+<< MC%Z?^1$_^*KY]&LZI_T$KS_O^W^-+_;.J?\`02O/^_[?XT?4I]P^L1['L7BF
+<< MUFUI-.%H\4;6MY%<,9)E'"L"<8)YXJQNO/\`GZ_\F1_C7BW]L:I_T$KS_O\`
+<< MM_C3AK&J?]!*\_[_`+?XTOJ,NX?6%V/9]UY_S]?^3(_QHW7G_/U_Y,C_`!KQ
+<< MG^V-3_Z"-W_W_;_&E_MC4_\`H(W?_?\`;_&CZC+N'UE=CV7=>?\`/U_Y,C_&
+<< MC=>?\_7_`),C_&O&QJ^I_P#01N_^_P"W^-.&KZE_T$;O_O\`-_C1]1EW#ZRN
+<< MQ[%NO/\`GZ_\F1_C1NO/^?K_`,F1_C7CPU;4O^@A=_\`?YO\:=_:VI?]!"[_
+<< M`._S?XT?49=P^LKL>O[KS_GZ_P#)D?XT;KS_`)^O_)D?XUY#_:VH_P#00NO^
+<< M_P`W^-*-5U'_`)_[K_O\W^-'U&7</K*['KNZ\_Y^O_)D?XT;KS_GZ_\`)D?X
+<< MUY)_:NH_\_\`=?\`?YO\:4:KJ/\`S_W7_?YO\:/J,NX?65V/6MUY_P`_7_DR
+<< M/\:-UY_S]?\`DR/\:\F&J:A_S_W7_?YO\:<-4U#_`)_KK_O\W^-+ZC+N'UE=
+<< MCU22.XEQYDR/CING4X_6HUM'2-(U,05$5%'G+P`,`=?05Y@-4U#_`)_KG_O\
+<< MW^-*-3U#_G^N?^_K?XT?49=P^LKL>G_9I/[T7_?U?\:/LTG]Z+_OZO\`C7F0
+<< MU.__`.?ZY_[^M_C2_P!IW_\`S^W/_?UO\:/J,NX_K*['I26T\5X+B-X`RPLB
+<< M[I%(W%T89&1D?(>]58],NE6V1[BV9(9I)B`5!9GW9YWG`^;].M<`-2O_`/G]
+<< MN?\`OZW^-.&I7W_/[<_]_6_QH^I2[B^LKL>D_9I/[T7_`']7_&C[-)_>B_[^
+<< MK_C7F_\`:-]_S^W'_?UO\:=_:-]_S^7'_?UO\:/J,NX?65V/1OLTG]Z+_OZO
+<< M^-'V:3^]%_W]7_&O.AJ-[_S^7'_?UO\`&E&H7O\`S^7'_?UO\:7U&7<?UE=C
+<< MT3[-)_>B_P"_J_XT?9I/[T7_`']7_&O/1J%[_P`_EQ_W]/\`C2_VA>_\_<__
+<< M`'\/^-'U*7</K*['H/V:3^]%_P!_5_QH^S2?WHO^_J_XUP'V^\_Y^Y_^_A_Q
+<< MI1?WG_/W/_W\-'U*7</K*['??9I/[T7_`']7_&C[-)_>B_[^K_C7!"^O/^?N
+<< M?_OX:7[==_\`/U/_`-_#1]2EW#ZRNQWGV:3^]%_W]7_&D-H[%23%E75Q^^7@
+<< MJ00>OJ!7#?;KO_GZG_[^&E^W7?\`S]3_`/?PT?4I=Q?65V.Y^S2?WHO^_J_X
+<< MT?9I/[T7_?U?\:X<7MW_`,_4W_?PTHO;K_GYF_[^&CZE+N'UE=CM_LTG]Z+_
+<< M`+^K_C1]FD_O1?\`?U?\:XH7EU_S\S?]_#2_;+K_`)^9O^^S1]2EW#ZRNQVG
+<< MV:3^]%_W]7_&C[-)_>B_[^K_`(UQOVRY_P"?F;_OLTHN[G_GXE_[[-'U*7</
+<< MK*['8_9I/[T7_?U?\:/LTG]Z+_OZO^-<>+NY_P"?B7_OLTX7=S_S\2_]]FCZ
+<< ME+N'UE=CKOLTG]Z+_OZO^-'V:3^]%_W]7_&N2%U<?\]Y?^^S3OM5Q_SWE_[[
+<< M-'U*7</K*['5_9I/[T7_`']7_&C[-)_>B_[^K_C7*_:KC_GO+_WV:7[3/_SW
+<< MD_[[-+ZE+N'UE=CJ?LTG]Z+_`+^K_C1]FD_O1?\`?U?\:YC[3/\`\]I/^^S2
+<< M_:)_^>TG_?1H^ION'UE=CIOLTG]Z+_OZO^-(MHZ($4Q!06('G+W8L>_J37-B
+<< MXG_Y[2?]]&G?:)O^>TG_`'T:/J<NX?65V.C^S2?WHO\`OZO^-'V:3^]%_P!_
+<< M5_QKG1/-_P`]9/\`OHTOGS?\]7_[Z-'U-]P^LKL=#]FD_O1?]_5_QI%M'2-(
+<< MU,05$5%'G+P`,`=?05@B>7_GJ_\`WT:432_\]7_[Z-'U.7</K*[&]]FD_O1?
+<< M]_5_QH^S2?WHO^_J_P"-80FE_P">C_\`?1IWG2_\]'_[Z-'U-]P^LKL;L<,D
+<< M1)46NX\%F,9)]LGZG\ZD_?\`_3K_`.0JY_S9/^>C_G3A+)_ST;\Z/J<NX?65
+<< MV-[]_P#].O\`Y"J.2&:5]S-#G@<2(.G'8UC"63^^WYTHD?\`OM^='U.7</K*
+<< M[&M]FD_O1?\`?U?\:/LTG]Z+_OZO^-9?F/\`WV_.EWO_`'F_.CZF^X?65V-=
+<< M$EC0*@M`.O\`RR_$T[]__P!.O_D*L@.W]X_G6C+%;13/'BX.QBN?-'./^`UG
+<< M4H^S^)EPJ\^R)@;A6#*;4$<@CRN*QSHL_P#PDD6H*UJMNEFUOL65002ZL,`<
+<< M`8%-UZ^CTK0KV^ABE:6&(L@>4;=W09PO(]N/PK/\0^*['P_K;Z6-#\1:E,D0
+<< ME9M/B6554LRC=TP24:L^6/<OFEV)_$7AR\U?08K"WEM5E2X,I,DX"X\UW[9Y
+<< MPPKF?^%=:Q_S\Z=_X$?_`%JTD\;6UYI&L3V^C:S8W=A`DHBU-!%NWE@K`#DC
+<< M*'/3IC/ITE]>6&D:.=1OVN1!'&9)7BRVU0Q&=JJQP,9)[#)Z"NBE4=.+Y7^!
+<< MC4IJHUS(XG_A76L?\_.G?^!'_P!:JFI^"]1TG3;B_N;FQ,,"%V$<VYC[`8ZU
+<< MW8UK1'U"TL(KF6:YNX#<0K#+Y@,0_P"6A*J0JG.`20">!DUSNJ:@^J>`=3NG
+<< M39N$BJN<X592HY[G`&3_`"J_K52S:?X$?5X7LU^)P=%%%>J><>N>"?\`D5]'
+<< M_P"OB3_T,5B>+O\`D1'_`.ORZ_\`9JV_!/\`R*^C_P#7Q)_Z&*S];TZ?5O"\
+<< M5A;;!-/?W**9&"J/O<D^E>#6_BR]6>S3_AQ]#IM<L+/5_&6CZ=J5I!>V)T^]
+<< MG-M<QB2,R+);*K[6R-P#N`>H#-ZFL.>Z70]:U8>'GM%`M])LH=^Z:*$R7]S"
+<< MZ[0X.$+,`@8!=H48`Q76:E%I&LVZV^J:=:7T"N'6.Z6&50V",@,2,X)&?<T)
+<< M%I$:(B:=:*B)$BJ%A`58FW1`<\!&.5'\)Y&*BY1Q>I>(M2OHK*SOQ:.D^IQ!
+<< M&@B:,HUIJEM;N3EFW"1FW@<;`-I+_>JQ<^,M>M8KZ[8Z:\$":G=I$+9PWDV,
+<< M_E-&6\PC?(&4A\83:?D?/'6&+2&*%M.M"4=G0E8?E9I!*Q'/!,BJY/=E!ZC-
+<< M#Q:1(CH^G6C(Z2HRE82&65MTH//(=AEA_$>3FBX')^(?'>KZ3+?W5G9QW&EA
+<< M+R&UGD@"*+BW@ED8%O.+N-]O(F/*0=PYP-]C6M;UFV2^T&\:2>XD2VW7^D6,
+<< MX:"&=IE=A&C2NKJL#[7&1ODCRH`).IJV@^'-9%\]QI5HMY>V\EO)?1I`+@*\
+<< M9C)$AR<[3COQQTK0TV+2-&MVM]+TZTL8&<NT=JL,2EL`9(4@9P`,^PHN!YWI
+<< ML=H_@K1M<N;*TU.TT_PY:O-;W$CP76GK$KEI[8;"=\FTA6!CR8$(<C!7J+KQ
+<< M1KB^++BUM=,C;2;.]M[&>9S$H+2K$V[S&F4J1YRX01/N*@!@7^78EL]"F^P^
+<< M;I%C)_9^/L6Z.$_9L8QY?/R8VKTQ]T>E221:1-JD.J2Z=:/J$*;(KMEA,J+S
+<< MPKYR!\S<`]SZT7`Y]/%.L2Z=,RRZ5]J:6-HA$CS,(7#ONCB#C[4NQ"RNCJ77
+<< MS/W8>(QM'I_B+4M4UVYTW2QHUI/,[7+7B1-=12JEM9'JK1F0DW(`DR/DC4;>
+<< M<CH'L]"DL[JSDTBQ>UNY3/<PM'"4FD)!+NN<,V0#D\\"B^L]"U.*2*_TBQNX
+<< MY)1.Z3QPR!I`H0.03RP4!<]<#'2BX'*VOC?6-4TF;5_LMC#I@GL;?R,N\S?:
+<< MH;8_?R%7RVN,YVG>!C"8W'!\0WFGV7QC\S5+R*SM'TF6)I97"`;GD'4\9YKT
+<< MRZ_L^:VNE-G`3,PF?(C.^10NQSSRPV)@]1M7'05P'B_P+9>+/$L]S<2RQO;Q
+<< MK&2)]@(+R$<>6YSP>X[4[1DG&3M<3OT,/7_&5M%JEEJ,6K:'>+97.^WB@U#Y
+<< MI69'3Y\C]VN'?G+_`#,I8J`YKFO$GB;3;_XKZ'K2R/%:VWV1KE9(R'@*3.75
+<< MEQG<HZ@?AVKI/^%.Z5_S^2_^!?\`]STI^#NF,VYKZ=FP%RUZ2<`8`YM^@```
+<< M[5TT_JZ:G-MS77;2UK-7:\[JWG?IA&G*$?9TTE'MYW,.YUSPW&WB&U;5?MEO
+<< MXEU>*2:2VBD3[':I.9"Y+H"SD,1M52!M)R>`;'C'QMX?\4:'XCM5$UO<#4HK
+<< MRQ;>76[(40$X\L;%\I0V&.<GKQBM3_A3NE?\_DO_`(%__<]'_"GM+_Y_)?\`
+<< MP+/_`,CUT*OA[IW?]6_R#DJ;&$-?\/7?C/P1=W6H.ECI>EVL=U*D3YCGA#L%
+<< MQM)(W;`2`1@G![BMXO\`%.C^*?"=FT4<UIJ=MJ5RXM&D\T-%.3*[[MBCA\*!
+<< MU`ZYZUT__"G]+_Y_)?\`P+/_`,CT?\*@TO\`Y_)/_`L__(]-8B@FG=Z"]G4M
+<< M8BL-7L;;6?`?BVXG\O2+733IEQ)L9VAGBCD7#A0<;MX*CJ1DX`K)T7Q!I^@Z
+<< M9I6B6?B-()A?RZA/JT5F\D=L3"T2QK&ZAI"PZG:`-PQG!(W/^%0Z9_S^2?\`
+<< M@6?_`)'I?^%0Z9_S^2?^!9_^1ZGV]#JW_5_\Q\DSD]1_XE7PHTO3+KY;O4=1
+<< M;4XH^C)`(_+!<'!&X\J0""`3GM7&"O7_`/A46F?\_DG_`(%G_P"1Z7_A4>F?
+<< M\_<G_@6?_D>M8XRE'J2Z,V>0BEKUW_A4FF_\_;_^!9_^1Z7_`(5+IO\`S]O_
+<< M`.!9_P#D>G]>I"]A,\B%.KUS_A4VF_\`/V__`(%G_P",4?\`"IM-_P"?M_\`
+<< MP+/_`,8H^NT@]A,\DIPKUK_A4^G?\_;_`/@6?_C%'_"J-._Y^W_\"S_\8H^N
+<< MT@]A,\F%.%>L?\*IT[_G[?\`\"S_`/&*/^%5:?\`\_;?^!9_^,4?7:0>PF>4
+<< M"G"O5O\`A5>G_P#/VW_@6?\`XQ2_\*LT_P#Y^F_\"S_\8H^NT@]A,\J%**]4
+<< M_P"%66'_`#]-_P"!9_\`C%+_`,*ML/\`GZ;_`,"S_P#&*/KM(/83/+!3A7J/
+<< M_"KK#_GZ/_@6?_C%+_PJ^P_Y^C_X%G_XQ2^NT@]A,\NI17J/_"L+'_GZ/_@4
+<< M?_C%'_"L;'_GZ/\`X%'_`.,4?7:0>PF>8"E%>G_\*RL?^?H_^!1_^,4?\*SL
+<< MO^?H_P#@4?\`XQ1]=I!["9YD*45Z;_PK.R_Y^?\`R:/_`,8H_P"%:67_`#\_
+<< M^31_^,4?7:0>PF>:"G"O2O\`A6ME_P`_/_DT?_C%'_"MK/\`Y^?_`":/_P`8
+<< MH^N4@]A,\V%.%>D?\*WL_P#GY_\`)H__`!BE_P"%<6?_`#\_^33?_&*/KE(/
+<< M83/-Q3A7HW_"N;3_`)^1_P"!3?\`QBE_X5S:?\_(_P#`IO\`XQ1]<I!["9YR
+<< M*<*]$_X5U:?\_(_\"F_^,4O_``KNT_Y^!_X%-_\`&*7URD'L)GG@I17H?_"O
+<< M+7_GX'_@4W_QBC_A7MK_`,_`_P#`IO\`XQ1]<I!["9Y\*45Z#_PKZU_Y^%_\
+<< M"F_^,4?\*_MO^?A?_`IO_C%'URD+V$S@!3A7??\`"`6W_/PO_@4W_P`8I?\`
+<< MA`;;_GX7_P`"F_\`C%'URD'L)G`THKO?^$!M_P#GX7_P*;_XQ2_\(%;_`//P
+<< MG_@4W_QBCZY2#V$S@Q2BN[_X0.W_`.?A/_`IO_C%+_P@EO\`\]T_\"F_^,TO
+<< MKE(/83.%%**[G_A!8/\`GNG_`($M_P#&:7_A!H/^>Z?^!+?_`!FCZY2#V$SA
+<< MQ3A7;_\`"#0?\]T_\"6_^,T?\(/!_P`]X_\`P);_`.,T?7*0>PF<2*<*[7_A
+<< M"(?^>\?_`($M_P#&:/\`A"8?^>\?_@2W_P`9H^MT@]A,XL4X5V?_``A4/_/>
+<< M/_P);_XS1_PA<7_/>/\`\"6_^,T?7*0>PF<:*<*['_A#(O\`GM'_`.!+?_&:
+<< M7_A#(O\`GM%_X$M_\9H^MT@]A,XX4X5U_P#PAL?_`#VB_P#`EO\`XS2_\(='
+<< M_P`]HO\`P);_`.,TOK=(/83.0%.KK?\`A#X_^>T7_@2W_P`9I?\`A$(_^>T7
+<< M_@2W_P`9H^MT@]A,Y,4HKJ_^$13_`)[1?^!+?_&:7_A$D_Y[0_\`@2__`,9H
+<< M^MT@]A,Y44HKJO\`A$D_Y[0_^!+_`/QFC_A$U_YZP_\`@2__`,9H^MTP]A,Y
+<< M<4X5T_\`PBB_\]8?_`E__C-'_"*K_P`]8?\`P)?_`.,T?6Z8>PF<R*<*Z7_A
+<< M%E_YZP_^!+__`!FE_P"$7'_/6#_P)?\`^,T?6Z8>PF<T*<*Z/_A&!_SU@_\`
+<< M`E__`(S2_P#",C_GK!_X$O\`_&:/K=,/83.=%+70_P#"-?\`36#_`,"'_P#C
+<< M-+_PC7_36#_P(?\`^,TOK=,/83.>I170?\(W_P!-(/\`P(?_`.,TO_".?]-+
+<< M?_P(?_XS1];IA["9@"G"MW_A'3_STM__``(?_P",TO\`PCQ_YZ6__@0__P`9
+<< MH^MTP]A,PA3A6Y_PCQ_YZ6__`($/_P#&:/\`A'V_YZ6__@0__P`9H^MTP]A,
+<< MQ!3A6U_8#?\`/2W_`/`A_P#XS1_8+?\`/2V_\"'_`/C-'UJF'L)F.*45L?V$
+<< MW_/2V_\``A__`(U2_P!AO_STMO\`P(?_`.-4OK5,/83,@4HK6_L1_P"_;?\`
+<< M@0__`,:I?[%?^_;?^!#_`/QJCZU3#V$S*I16I_8LG]^U_P#`A_\`XU2_V-)_
+<< M?M?_``(?_P"-4?6J8>PF9E**T_['D_OVO_@0_P#\:H_LB3^_:_\`@0__`,:H
+<< M^M4P]A,SA2BM'^R9?[]K_P"!#_\`QJC^RI?[]K_X$/\`_&J/K5,/83*`I15_
+<< M^RY?[]I_X$/_`/&J/[+F_O6G_@1)_P#&J7UJF'L)E(4X5<_LR;^]:?\`@1)_
+<< M\:I?[-F_O6G_`($2?_&J/K5,/83*8IPJU_9TW]ZT_P"_\G_QJE_L^?\`O6G_
+<< M`'_D_P#C5'UJF'L)E44X58^P3_WK/_O_`"?_`!JE^PS_`-ZS_P"_\G_QJCZU
+<< M3#V$R`4HJ?[%<?WK/_O_`"?_`!JC['<?WK/_`+_R?_&J/K-,/83(A2BI?L=Q
+<< MZV?_`'_D_P#C5'V2Y];/_O\`R?\`QJCZS3#V$Q@K/\6^([[2[_9I.E6^JLTL
+<< M@F!U&*W,)!&/O=<Y/TQ[UJ?9;GULO^_\G_QJL_\`X1?3_P#H%:)_WR?_`(S7
+<< M/6J0J6U-:4)POH9&K:N^I>`;N2]A@LKZ2)M]HMTDQ3#<?,O!R`#QTS[5=U;4
+<< MVTSQQJETEG)>0S6\,.8+BW4H\<DY8,))%/21?7O6=KL_A/PR(3J\&B6PF=TC
+<< M_<2/DJ%+#Y8#T$B?G[&L;_A,?AS_`,]M$_\``.?_`.1JQY(]S;FEV+FKWK7U
+<< MMXBO9+9K1)=/MX(DFGA=W9'F9L"-VX`D7K[UVFL7LMMI"+92V*Z@8"85O)BD
+<< M>2[#+8!.!R<#KC&1U'G_`/PF/PY_Y[:)_P"`<_\`\C5)/XY^']U,TUQ=Z/-*
+<< MWWGDM;AF/;DFVJK1Y6KDWES7L7O"V@0^$-0<66K:;<V5ZN^^,@CAD2<=&B"#
+<< M'EG)'EG[G4$Y()_S3&__`.VW_HYJS?\`A,?AS_SVT3_P#G_^1JV[N]TW4_AI
+<< MJ%YI!@-B=\<?D(RH=I4D@,JD<L1RHZ=\TO=BGKO_`)CU;6AS.B:1_;,US$)_
+<< M*>.'?&-F[S)"ZHB=1C+.!GH.]2W>@2VVCVU^LOF,Z-)/%M`\E?W>TYS\VX31
+<< MGCIN]CBC:WGV:WO8O+W?:H1%G.-N)$?/O]S'XUIV>N>9<1-?'.)KJYG?'^O\
+<< MV,!H\`?+NVE=PZ;\\8KVI<Z=UL>4N6UGN=YX>M9X/!NG0R,8)&WR!@-Q"MAE
+<< M(PPZ@CN",^U3)IGEF(K??ZHLR`V[D`G.3@S8).3SUJ/PY<2W?A6TN9VWS33S
+<< MR.V`,L7R3@>]:0+!3LL;JZ/I`5&WZ[O\]:\2K?VDO5GK4[<B]"'R9O\`G^C_
+<< M`/`,_P#QVCR9O^?Z/_P#/_QVIMTW_0"U/_ON.C=-_P!`+4_^^XZS+(?)F_Y_
+<< MH_\`P#/_`,=H\F;_`)_H_P#P#/\`\=J;=-_T`M3_`.^XZ-TW_0"U/_ON.@"'
+<< MR9O^?Z/_`,`S_P#':/)F_P"?Z/\`\`S_`/':FW3?]`+4_P#ON.C=-_T`M3_[
+<< M[CH`A\F;_G^C_P#`,_\`QVCR9O\`G^C_`/`,_P#QVIMTW_0"U/\`[[CHW3?]
+<< M`+4_^^XZ`(?)F_Y_H_\`P#/_`,=H\F;_`)_H_P#P#/\`\=J;=-_T`M3_`.^X
+<< MZ-TW_0"U/_ON.@"$12@@F\1@.H%H1G\?,./R-32_\A74_K#_`.A34;I>^C:C
+<< M&.[N\>%]SCM1+_R%=3^L/_H4U`&;JNJC2Q:`6=S=S74_D116^P,6V.YY=E`&
+<< MU&[U5_X2`B_T^SDT^:WGNI`C1S2Q;X@4G<$A&;KY!]!\W!)#`/US1(M;DTM+
+<< MF"VN+6VNS/-#<('5U\F5!\I!!.YU//I6%K'@;[==O'8?8[#3WMA`$BCQY>8K
+<< MQ&(0`#K=*<9&<-TXR@.JL-2L-4@:?3[VVNX5;89+>59%#8!QD$\X(_.K587A
+<< M[1Y]/GN[FYA2*:=8X\"_GO&*H6(S)+C`RYPH48Y.3G"[M`S/U751I8M`+.YN
+<< MYKJ?R(HK?8&+;'<\NR@#:C=ZI:OXIM-$T&34-05+*Y\B62&QN[B-))60$[05
+<< M9@2>.F?O#OQ1XGT>76(M.$=E8WJVUWY\EM?,5CD7RI$Z['Y!<'IVK+U+0=8N
+<< M-/OXK.STN%M0TL:<\`NG6.U5/-"%"(OG&)?N[4QMP"<\`C:MO$FG7.L-I7G)
+<< M%>!2R1O+'F4!Y4.S#')!A8D=0",X.0->N;T70[_2-7N+DFVEANVE$O[QE:)?
+<< MM%Q,A4;3O)$X!!*[=O!;-=)0!5U*_BTO2[O4)U=H;6!YW5`"Q55+'&<<X%0O
+<< MK%NFM#2BC^>5C;<64+AQ*1C+`D_N'R`">0>F2-"N(?P)*V@)I:72(#/*'D.6
+<< MVQ?8Y+2(@8&6V>46'`W;\$#`H`ZJTUC3+^-)+/4;.Y1Y#"C0SJX9PNXJ"#RV
+<< MT$XZX&:G@O+6ZQ]GN89LQI,/+<-E&SM;C^$X.#T.#7(_\(A=SQO.6^Q7ADC"
+<< MO'J=Q=.J!9(W82RC(8)/*4`4`.`26!P-K1-"_LF^OYO,S%)LAMD!XC@4NZKC
+<< M`QM>610!P$6,=0<@&U6?JNJC2Q:`6=S=S74_D116^P,6V.YY=E`&U&[UH5D:
+<< MYHD6MR:6ES!;7%K;79GFAN$#JZ^3*@^4@@G<ZGGTH&3C6;2)+0:@Z:;<W;%(
+<< M;6[FC61V!Q@;6(8\CH3]X=^*M+>6K>7MN83YDC0IAQ\SKNW*/5AL;(ZC:?0U
+<< MRGB3PI=WFGRZ?H\5M#9/:/!%;)=R6<=N[;MS[8E(E#;AE6P!L/7>U6M0\)?;
+<< MYM5C-QY=I=6TRVZ?>$$\R%)9`G`Z`$8.<RSY/ST"->+7M'GM#=PZM8R6P9D,
+<< MR7*%`RJ78;@<9"@L?0`GI4%MXDTZYUAM*\Y(KP*62-Y8\R@/*AV88Y(,+$CJ
+<< M`1G!R!F/X>O]2\06>KZE!8QF&>%FMTE:9=L4=QM<,R+\V^=3C'&S.23@0+X3
+<< MOQ'J]L9;;R=6@N;>63<VZW5YKF1&5<?.2+@`@E<;>"V>`#H4U[1Y=/EU"/5K
+<< M%[*)MDERMRAC1N."V<`_,/S'K5V&:*X@CG@D26&10Z2(P964C(((Z@BN._X1
+<< M>^$;W2V<*ZAYD9A8ZW=2/%L60!Q+(C9_UK#RS'MY8L6SM'76<4\-C;Q75Q]I
+<< MN$C599]@3S&`Y;:.!D\X'3-`$U9%QKCP:]#I/]DWTC3*9$N$:'RRBE`[<R!L
+<< M*9%!&W)YP#6O6?-82R>(K+4`R>3!:7$#*2=Q:1X6&/;$;9^HH&/CUC3)?MGE
+<< MZC9O]BS]JVSJ?(QG._GY<;6ZXZ'TJK_PD5@]W;"&XMI;*:TN+HWJ3J8U6%HU
+<< M;D<8_>')SQM/X82>%=3:TTZ"1[-?['MHX+5EE9OM6R6"0%_E'E9^S*,#S,;R
+<< M>=OS%SX5O[R^GU"Z@LY);CS'>U2]EB"/FT";9E0-Q]EWY"@Y(&",M0(ZZTO+
+<< M6_M4NK.YAN;=\[)87#HV#@X(X/((_"IJI:3!?6^F0Q:E=?:KL;C)+A1U8D+\
+<< MJJ#M!"YVKG&<#.*NT#*L=_%)JEQIX5_.@@BG9B!M*R,ZC'OF-L_456L/$.F7
+<< M\>G[+N&*XO[9+F"UED59F1EW`[,Y/`.<9'!]*JW7ABPU+Q%<ZAJ>GV-["UI!
+<< M!"MQ"LC(RO*S?>'`(=.G7'L*PM)\$W=@UE'/Y,R+]DDED^W7"HCP1Q)@0+A)
+<< M.800[$$;AE3M`((Z#1_%&F:M;V`^VV<6H7=M'/\`8?M*M*F^,28V\$X!SG'3
+<< MFMJN!T'P]K$%M)H\\%LEK!=V,CW7FON=H(+4GRT*`,I:+;NW#&3Q\N#WU`!1
+<< M110,****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BB
+<< MB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****
+<< M`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`
+<< M****`"BBB@`HHHH`****`/$_CK_J]'_Z^[O_`-%6M>.HH:15)P"<9KV+XZ_Z
+<< MO1_^ON[_`/15K7CJ-MD5N>"#Q5K8GJ=K;^!Q_9\>HLS/"TD:A"=N"[A1NXR.
+<< MH[5(-*MX8S'-%8@-(\(\N0[D98BP8Y."#C'0?XW8]:TZX\-K`&;SP\9QYP5-
+<< MJL"<@D#IGMFLB;7;22RCL5MK.U9+B283Q-E@&C*;,;.F<'K_`(UC7I5()/?^
+<< MMQRJ0JQY8JW];?\`!.1F4+.ZKC`8X`[5[SX/_P"2`2?]=;C_`-"6O!#]X_7U
+<< MS7O?@_\`Y(!)_P!=;C_T):VZ$HR****^A/$/5O"?_(EZ=_UTF_\`0JU&LVO%
+<< MV@7!"\D1.Z_GM(_7WK+\)_\`(EZ=_P!=)O\`T*G^)[B:T\&:I/;R-'+'L974
+<< MX(/->!6_BR]6>U2_AQ]$7O[$?_GE??\`?Z7_`!H_L1_^>5]_W^E_QJ7_`(0*
+<< M/_H8]>_[_P`?_P`;H_X0*/\`Z&/7O^_\?_QNHL5<B_L1_P#GE??]_I?\:/[$
+<< M?_GE??\`?Z7_`!J7_A`H_P#H8]>_[_Q__&ZCG\#+%;RR+XAUYV1"P7STY('3
+<< MB(G\@3[&BP7$_L1_^>5]_P!_I?\`&C^Q'_YY7W_?Z7_&I?\`A`H_^ACU[_O_
+<< M`!__`!NC_A`H_P#H8]>_[_Q__&Z+!<B_L1_^>5]_W^E_QH_L1_\`GE??]_I?
+<< M\:6/P,KO,I\0Z\`C[0?/3YAM!SS$/4CC(XZYR!)_P@4?_0QZ]_W_`(__`(W1
+<< M8+D7]B/_`,\K[_O]+_C1_8C_`//*^_[_`$O^-5QX8TTWPL_^$JUT3,Q1`TJ!
+<< M78`DJK&/#,`K<`D_*W]TXKZWX9BL/#^M7UGXFUB6YTZVED*&YC8+(L?F!7`3
+<< M(X*G'!PP]::BV[!<T!I#1$2>7>#;\V6EE(X]<G%23B0ZIJ?E>5NW0_ZUV4?>
+<< MF]%;^58G_"$:UI3Q7M[XY9[>*5"T<EKL$N6`"9,G!8D*.O)'!K=E_P"0KJ?U
+<< MA_\`0IJ35NH)W(=MW_TX_P#?^3_XU1MN_P#IQ_[_`,G_`,:IS-MP`I9V.%1>
+<< MK'T'^<``D\"LK3?$5A>Z'::G/<VUJL]LEPZ/.O[K<H8@DXZ9Z\=*D9I[;O\`
+<< MZ<?^_P#)_P#&J-MW_P!./_?^3_XU5#4M9-A?6UG%IUY?7%Q')*J6QB&U4*!B
+<< M3(ZCK(O3-/MM=TJ[>SCAU"V,U[`MQ;0M(%DEC()#!#AL8![=CZ4`7-MW_P!.
+<< M/_?^3_XU1MN_^G'_`+_R?_&JS)/$5@=2M;&TN+:ZFDNS:SK%.K-;L(I7^8#.
+<< M#F(C!QW],5J0S17$$<\$B2PR*'21&#*RD9!!'4$4`)MN_P#IQ_[_`,G_`,:H
+<< MVW?_`$X_]_Y/_C5244`1[;O_`*<?^_\`)_\`&J-MW_TX_P#?^3_XU3)+ZTAD
+<< M,<MU`CCJK2`$?A4%AJMO?R311L/,B<@C.=R@X#`]P?\`/;(!:VW?_3C_`-_Y
+<< M/_C5&V[_`.G'_O\`R?\`QJI**`(]MW_TX_\`?^3_`.-4;;O_`*<?^_\`)_\`
+<< M&J)6EW1101-+-,^Q%&/0DGD@<`$XR,].*B1-7%U*K6*RV\65D=98D>-_E(4K
+<< MYC#E6SU&..#G(=@)=MW_`-./_?\`D_\`C5&V[_Z<?^_\G_QJH(K\2:I<:<\$
+<< MD4\$,<S;F1@5=G48*L><QMD'VJ>'_CYO/]R#^<U`!MN_^G'_`+_R?_&J-MW_
+<< M`-./_?\`D_\`C50WET+<(N)"6R6\M<L%'4@'J>0._7.#C!Y2]UBY@8S2SO9/
+<< M"@:81L\Z1$CK*Y&P=<D`#&,@XP*$KA<[';=_]./_`'_D_P#C5&V[_P"G'_O_
+<< M`"?_`!JL#2/%*7?AU[^\BQ=V\XM)X(1G=.6545<G`W[XR,G"[\%N":T/[<MK
+<< M:Q^UZNO]C(9/+4:A/"NXXR,%79?7C.>#Q2`O[;O_`*<?^_\`)_\`&J-MW_TX
+<< M_P#?^3_XU4+ZE81:A%I\E[;)>RKOCMFE42.O/(7.2/E/Y'TJ&77M'@M!=S:M
+<< M8QVQ94$SW*!"S*'4;B<9*D,/4$'I0!<VW?\`TX_]_P"3_P"-4R5KF&)Y9&L0
+<< MB*68^=)P!U_Y95GZ/XBL-7EN+:.XMEO;>>>.2U6=6D58Y6CW%>H!P#T_B'7K
+<< M5W4_^05>?]<'_P#030!']ME_N1?]\W'_`,9H^VR_W(O^^;C_`.,UK75Q-%%9
+<< M6]OL66Z?RE=XRX3$;.3L!!;A2,9'WL\C[^;JNOW.@6%S>:@+&X@MD:5WAD='
+<< M=!DX6,JPW8SC+X/4D`G//5Q="E-0J.S92A*6R(_MLO\`<B_[YN/_`(S1]ME_
+<< MN1?]\W'_`,9K>O;RWT^PN;Z[D$=M;Q--+(03M102QP,D\9]<Y[Y^>#3=7MM6
+<< M$AMXKU=F-WVJRFM\[NF/,0;NO.,]><Y^?JL09'VV7^Y%_P!\W'_QFC[;+_<B
+<< M_P"^;C_XS6U'J,,VKW.F*K^=!!%<.QP5*R-(J@<DYS&V>/XA][)W&FZC#JMJ
+<< M]Q"KA%GFMR'QDM'*T;'@G@E3CKPPSR<.6`Q?MLO]R+_OFX_^,T?;9?[D7_?-
+<< MQ_\`&:Z;K[Y_'/\`/U]^O?/SLE/[ESG^$\Y_^O[^O?OGYUH,QWBO4=D;["&4
+<< MX(\^3K_WZI-MW_TX_P#?^3_XU4]^[+>2*B[Y9)BD:9QN8G^7<^@!-4-1']F:
+<< M>NH7^I/;1"&1IHW18O*92H!.5;Y!\V3D[B5VYW`$2N!8VW?_`$X_]_Y/_C5&
+<< MV[_Z<?\`O_)_\:KC_!?C-O%&L:K'Y+06D:QO9^<"LDZ_,'DP3]W[G`X&1DDG
+<< M)["'_CYO/]R#^<U`!MN_^G'_`+_R?_&J-MW_`-./_?\`D_\`C55YVMXFO;BZ
+<< M\QHX(HB%$SH.3)G[K#).T#FL[1[^YU'3)]HE+VOEC(E4/*2IXR4('*GMZ`GJ
+<< M26`V=MW_`-./_?\`D_\`C5&V[_Z<?^_\G_QJDM?M+64,MW$D,TBAC&K9('8G
+<< MCC/7'..]8VH1W%YXEMK&*^FM4D@+EHR3C:';ID9^[B@#:VW?_3C_`-_Y/_C5
+<< M&V[_`.G'_O\`R?\`QJLVS:X,5];1W+W)L615D4A'F+!R0Q;>!@C'3MVK1M?M
+<< M+64,MW$D,TBAC&K9('8GCC/7'..]`"[;O_IQ_P"_\G_QJC;=_P#3C_W_`)/_
+<< M`(U4%_)>0Q&2TC24JI.QL_,>,#(Y`ZY(#'IA369_PE%O<0PQZ=$;G49F*"R+
+<< MA6B*XW&4C(15R/F&0<KMW;ER`;6V[_Z<?^_\G_QJC;=_]./_`'_D_P#C5.C#
+<< MB-1(RM(`-S*N`3WP,G'YFHGO;:.Z%JTRBX*>8L7\;+D+D#J>2!QW(]12`?MN
+<< M_P#IQ_[_`,G_`,:HVW?_`$X_]_Y/_C58LOBFT262.+;.T<AA98BS`29QY9D"
+<< MF%7)P`K2`Y9>F16O9WEO?VB7-M)YD3YP<$$$'!!!Y!!!!!P000<$4P'[;O\`
+<< MZ<?^_P#)_P#&J-MW_P!./_?^3_XU1:_\>,7^_-_Z.DKG[J_OEOI+>&_B,WE2
+<< M7*VJ1R2S>2LWE;MD<#G&X@=2>">@."P'0;;O_IQ_[_R?_&J-MW_TX_\`?^3_
+<< M`.-5S\TVKPZA=:>-1MIKRT:);B*W664Q&4,4WE;<A00I.20!QDC(SH^&[N>_
+<< M\+:1>73^9<7%E#+*^`-S,@).!P.3VH:L!?VW?_3C_P!_Y/\`XU1MN_\`IQ_[
+<< M_P`G_P`:J2BD!'MN_P#IQ_[_`,G_`,:HVW?_`$X_]_Y/_C5244`1[;O_`*<?
+<< M^_\`)_\`&J-MW_TX_P#?^3_XU4E%`$>V[_Z<?^_\G_QJC;=_]./_`'_D_P#C
+<< M5244`1[;O_IQ_P"_\G_QJC;=_P#3C_W_`)/_`(U4E%`$>V[_`.G'_O\`R?\`
+<< MQJC;=_\`3C_W_D_^-5)10!'MN_\`IQ_[_P`G_P`:HVW?_3C_`-_Y/_C5244`
+<< M1[;O_IQ_[_R?_&J-MW_TX_\`?^3_`.-5)10!'MN_^G'_`+_R?_&J-MW_`-./
+<< M_?\`D_\`C5244`1[;O\`Z<?^_P#)_P#&J-MW_P!./_?^3_XU4E%`$>V[_P"G
+<< M'_O_`"?_`!JC;=_]./\`W_D_^-5)10!'MN_^G'_O_)_\:HVW?_3C_P!_Y/\`
+<< MXU4E%`$>V[_Z<?\`O_)_\:HVW?\`TX_]_P"3_P"-5)10!'MN_P#IQ_[_`,G_
+<< M`,:HVW?_`$X_]_Y/_C5244`1[;O_`*<?^_\`)_\`&J-MW_TX_P#?^3_XU4E%
+<< M`$>V[_Z<?^_\G_QJC;=_]./_`'_D_P#C5244`1[;O_IQ_P"_\G_QJC;=_P#3
+<< MC_W_`)/_`(U4E%`$>V[_`.G'_O\`R?\`QJC;=_\`3C_W_D_^-5)10!'MN_\`
+<< MIQ_[_P`G_P`:HVW?_3C_`-_Y/_C5244`1[;O_IQ_[_R?_&J-MW_TX_\`?^3_
+<< M`.-5)10!'MN_^G'_`+_R?_&J-MW_`-./_?\`D_\`C5244`1[;O\`Z<?^_P#)
+<< M_P#&J-MW_P!./_?^3_XU4E%`$>V[_P"G'_O_`"?_`!JC;=_]./\`W_D_^-5)
+<< M10!'MN_^G'_O_)_\:HVW?_3C_P!_Y/\`XU4E%`$>V[_Z<?\`O_)_\:HVW?\`
+<< MTX_]_P"3_P"-5)10!'MN_P#IQ_[_`,G_`,:HVW?_`$X_]_Y/_C5244`1[;O_
+<< M`*<?^_\`)_\`&J-MW_TX_P#?^3_XU4E%`'#^._AU<>-8;+&K6=F]O/-(1MDD
+<< M!#I"HYVC_GD>W<5Q?_#/]W_T,UC_`.`\E>V44^8+'B?_``S_`'F,?\)/8_\`
+<< M@/)1_P`,_P!W_P!#-8_^`\E>V44<S"QXG_PS_=_]#-8_^`\E=C#X??PM\);_
+<< M`$:2ZCNFMI9<S1J55MPC;@'G^+'X5W=<_P"*?^1-US_KJW_HN&FG<5CS2BBB
+<< MOHCPSU;PG_R)>G?]=)O_`$*D\7_\B)J_T3^M+X3_`.1+T[_KI-_Z%2>+_P#D
+<< M1-7^B?UKP*W\67JSV:7\->B/1:***1057OUWZ=<KMW9B8;=N[/!XQM;/_?)^
+<< MAZ58JO?KOTZY7;NS$PV[=V>#QC:V?^^3]#TH`L4444`4X_.2YN?+AC*M*"S,
+<< M2I^[&,CY.>-W<\@#/9:^J76H6VC7EQ'%`DL=N[AA*3M(4'/*<X^;Z[1_>.VY
+<< M;KMGNSMQNE!SMQGY%&?NC/YMTZ\8$D\$=S;RV\R[HI4*.N<9!&".*`/&O%K3
+<< M:6NM;+>\":3:+/97K7@(:5&!C!C\D*=C0JV"QP"/^>C5YX_B'5-)6^L[**9[
+<< MZ\@FM[^-@Q\V(A_,=U/S[U/FL=WS(RR;B06W^]2?"SPC+&T<EC>.C@JRMJET
+<< M00>H(\RM2?PWH&K2:M>Q6]O]KU.U?3KJ]M]ID*+N1EW<@,#D'C.44'.T`=.'
+<< MQ'LHRC:_-^!TT<3[*E4I\J?.K>AG^);B6[\0V&F1V4]Y:VL9O;Q(2@$3,2EN
+<< MT@=@&C!69\*&8/#&0!@967_D*ZG]8?\`T*:K=WIMS8VS3W7BO4C$"%*3K:*D
+<< MA8A50D0@_,2%X())P.:I3B0ZIJ?E>5NW0_ZUV4?>F]%;^5<LD<R,W5[&\N$2
+<< MXTV[:VOH`PCRY$<BG&4<<\':,-@E2`>1E6P(?"&H:KX>BM];\1ZWYMS;*MY;
+<< MB6`H'*C>H_=G@'/<_6NMVW?_`$X_]_Y/_C5&V[_Z<?\`O_)_\:J=2CG_`!'H
+<< M4NJ:II]V-+TO4X;>">-K?4'*J&=HB&7]V_($;#H/O5GS^%M9>33XI+W[<EM)
+<< M9N;F:^FB($+1EP8%#)*S%&;<YSF3'\`-=AMN_P#IQ_[_`,G_`,:HVW?_`$X_
+<< M]_Y/_C5`')?\(M?W>D:1HU[]F2STQE03PSLSSQK;RQ;BA3:"2R$H2ZD%@=PX
+<< M;J[3[5]E07GD_:!D.8<[&P>&`/(R,'&3C.,MC)=MN_\`IQ_[_P`G_P`:JEJ.
+<< MJ1Z2L;7]UIT"R$A2TTN"1_VRHL!3USP=H?B+4+&^U.Q2:>S;*$])%Y^1Q_$N
+<< M3G![^Q8'=KG_`/A+])_Z"NE?]_Y?_C5'_"7Z3_T%=*_[_P`O_P`:HLPNB[=>
+<< M'].O;J2YN#=>8^,^7*JC@`="I]*;H^@6^FS2WDA\R5F=;:,MGRTR1N8C&6(Z
+<< M#MUZXQ4_X2_2?^@KI7_?^7_XU1_PE^D_]!72O^_\O_QJGJ+0Z"J]I86=CYS6
+<< M]LBR3-EGQD@?W5_NC.3Q_("L?_A+])_Z"NE?]_Y?_C5'_"7Z3_T%=*_[_P`O
+<< M_P`:I68[HV)M3L-(OM.N]2O;>SMA.P,MQ*L:Y,4F!DG&:Y!O$/AW0]5U.YTG
+<< M5M%>.[??NDUMF8C:,[A\P9MV\YR3\Y%:_P#PE^D_]!72O^_\O_QJC_A+])_Z
+<< M"NE?]_Y?_C5-70C.\*ZO:ZUXKURYM+F&XB6TM$WQ.&&0TYYP??\`E76P_P#'
+<< MS>?[D'\YJP_^$OTG_H*Z5_W_`)?_`(U2#Q;I"L[#5=*RX4-^_EYVYQ_RR_VC
+<< M^=%F!HZJ@2`W1M?M(B1PT8!+[2.2F.=XP,8YZXYQ7$Z9\08K.WN/#EK8M>7=
+<< MS<2;,8#99CD3Q_?4KR2%5L*,X!!`Z;_A+])_Z"NE?]_Y?_C5'_"7Z3_T%=*_
+<< M[_R__&J%=!H<_P"![$Z?X9U'0UMX;O48V5KB"Z?9!-&ZB-&#!7^5HX^F#E@W
+<< M\)!JR?"%ZCPW4,-M$4:8)IUKJ$UI#;I((00DL2@D;H2Q78`3*3U7+:-OXCT"
+<< MS\W[->Z)!YTAEE\J21=[GJS8AY8]R>:F_P"$OTG_`*"NE?\`?^7_`.-4K,9E
+<< MS^%-2$FGV\4D,EI:269C(O9X4ACA:,L@@&Y9,[&(9VW#>!GY`:M:?X>O]$T_
+<< M0?L$%C+<Z?8-9RPM*T,;L_E,\@8(QSNBZ%>=Y)((P;7_``E^D_\`05TK_O\`
+<< MR_\`QJC_`(2_2?\`H*Z5_P!_Y?\`XU19AH%OH5U#_9NZ2$_9=6N[U\$\I+]H
+<< MV@<?>_?+GMP>3QG6U/\`Y!5Y_P!<'_\`0363_P`)?I/_`$%=*_[_`,O_`,:I
+<< MDWBG1IX9(9-5TS9(I5MMQ*#@C!Q^YHLPNCIM3L+V]MK(Z?=V]M<02>8&N+9I
+<< MD8&-TQM#I_STSU_`Y^;%BTS3+O07&LVEI>W,DMPD]P8]C28ED4_,&+!<`#&X
+<< M\#&2.0X>.=&50HU+3L#C'VI__C'U_,^IK'GO?`-S<27%Q8^&9IY7+R22(&9V
+<< M)R2Q-MDDGDD]<GU-<.-P'UA7A+EEWM?]473J*+U5T2R2WVLVOC'0[3S)0=(4
+<< M6L+RL[&647"GYG8D9*J,$@#V)8-J:OX9BCM[8V]K>ZK;+=":[L+F]>Y^TH(Y
+<< M`JJMQ(4XDD1\$X^4'YB%WT--\0>$=&$@TO\`L*R$N/,^S.8]^.!NVVXSC)Z^
+<< MI]3F_P#\)WH__03T\_6ZD/\`[0^OYGU-=6'I2I4HPD[M=>Y,Y*4FTK&%'X6U
+<< M*.Y$MSI7VS34\ISIH>-A)$)+YH[<(S^6?*%Q;'!.P;/E+87=1'@>_G2+?IU[
+<< M;PGSELK:U:T'V`M=3R!BS^88LI)#AK?<PV]"0@;J_P#A.]'_`.@GIY^MU(?_
+<< M`&A]?S/J:/\`A.]'_P"@GIY^MU(?_:'U_,^IK8DS;OPO+_PCUP&TV[N;V;5K
+<< MFZ:*/R9UE0S3O$)4FD"O#B16V!@0S[AM8EFZ^PAEM=!M8)XK6&:*V1'CM`1"
+<< MC!0"(\]$!.![$>OSX7_"=Z/_`-!/3S];J0_^T/K^9]32'QUHS*0=3L,'@_Z7
+<< M)_\`&/K^9]32LP+OB`2*TMQ%YA:WG:4K&T@9AR"`8_GZ$_=R3TP<XK`UCQ+I
+<< MVOVEJ;^S2\@D!E#P#SXXG4X&PKD-CYOF!ZKR`>!:E\9:3+,\G]J:4-[%L>?+
+<< MQG_ME63=W?@V_N7N;R/PS<W#XWRS(SLV!@9)AR>`!0KH#.\`V<M_K<_B`IL@
+<< M6V-JCI(6BN&+*69!DA`!&N0N02Q&XE#7H$/_`!\WG^Y!_.:L/_A+])_Z"NE?
+<< M]_Y?_C5(/%ND*SL-5TK+A0W[^7G;G'_++_:/YT68%G7---W:W$QNVCC2(/Y0
+<< MB#;V0.1EL@C[Q'?K6-K>OW,^N7CJUK-$LK)$SP1RC8&.,%@>._'K6C_PE^D_
+<< M]!72O^_\O_QJIO\`A.;+_H.Z?_X%3?\`QJA7`O:.[2Z'93/C?(KLV!@?ZQQP
+<< M!P!@`8'`Q27>G+=3I/%.UM<J"GGJN]@A5@5`R!SNZ]1VK.?QGILK;I-8TQST
+<< MRUQ,?_:5-_X2_2?^@KI7_?\`E_\`C5*SN.Z*TCV7AZUDMT>:>Y:YY>.4Q,$5
+<< M$897++U9@,@]ZZ#3IVN],MKIL@S!B`>2`'91DC&3A>N!]!68GC73XEVQZUIJ
+<< M#KA;F8?^TJ:_C/396W2:QICGIEKB8_\`M*F[L1:UW5)--LQ]GA::[FREM$O6
+<< M63'"`X(!/)R>%568\+@T+?PY+I;1W]K>32ZENS>.W*W:YR4V%L+CG8<_*3R6
+<< MW.6?_P`)?I/_`$%=*_[_`,O_`,:H_P"$OTG_`*"NE?\`?^7_`.-4K,=T;T<B
+<< M2QK)&ZO&X#*RG(8'H0:P]=M-8NC<0Z?;6+13P;//ENVAF@?$BEHR(GVG;(1N
+<< MSGDC&.K?^$OTG_H*Z5_W_E_^-4?\)?I/_05TK_O_`"__`!JA)H+HG5-0M_"L
+<< M<$NG0-=I$L+VNFL!'MR%/E^9L`&WD`].G..9?#MG/9:+$ETGEW,TDMS+%D'R
+<< MGED:4ID'!VERN>^,\9JG_P`)?I/_`$%=*_[_`,O_`,:H_P"$OTG_`*"NE?\`
+<< M?^7_`.-46871N6O_`!XQ?[\W_HZ2N3N/$^EQZI+9OK42+':SQ/%)X@%C`LWV
+<< MO=M(B!F63:"=W3`VX^9L7U\6Z0B!%U72@H+$#SY>[%C_`,LO4FE_X2_2?^@K
+<< MI7_?^7_XU35Q$%YXRT.Z\0ZHZ^(+9[0R6C0--XB6"'"I)O,4<0W'!9=R2G;(
+<< M3U`45GZ7X.T/Q%X9\)7VIV*33V=A;E">DB^4/D<?Q+DYP>_L6!U_^$OTG_H*
+<< MZ5_W_E_^-4?\)?I/_05TK_O_`"__`!JAW8:'045S_P#PE^D_]!72O^_\O_QJ
+<< MC_A+])_Z"NE?]_Y?_C5*S'<Z"BN?_P"$OTG_`*"NE?\`?^7_`.-4?\)?I/\`
+<< MT%=*_P"_\O\`\:HLPN=!17/_`/"7Z3_T%=*_[_R__&J/^$OTG_H*Z5_W_E_^
+<< M-4687.@HKG_^$OTG_H*Z5_W_`)?_`(U1_P`)?I/_`$%=*_[_`,O_`,:HLPN=
+<< M!17/_P#"7Z3_`-!72O\`O_+_`/&J/^$OTG_H*Z5_W_E_^-4687.@HKG_`/A+
+<< M])_Z"NE?]_Y?_C5'_"7Z3_T%=*_[_P`O_P`:HLPN=!17/_\`"7Z3_P!!72O^
+<< M_P#+_P#&J/\`A+])_P"@KI7_`'_E_P#C5%F%SH**Y_\`X2_2?^@KI7_?^7_X
+<< MU1_PE^D_]!72O^_\O_QJBS"YT%%<_P#\)?I/_05TK_O_`"__`!JC_A+])_Z"
+<< MNE?]_P"7_P"-4687.@HKG_\`A+])_P"@KI7_`'_E_P#C5'_"7Z3_`-!72O\`
+<< MO_+_`/&J+,+G045S_P#PE^D_]!72O^_\O_QJC_A+])_Z"NE?]_Y?_C5%F%SH
+<< M**Y__A+])_Z"NE?]_P"7_P"-4?\`"7Z3_P!!72O^_P#+_P#&J+,+G045S_\`
+<< MPE^D_P#05TK_`+_R_P#QJC_A+])_Z"NE?]_Y?_C5%F%SH**Y_P#X2_2?^@KI
+<< M7_?^7_XU1_PE^D_]!72O^_\`+_\`&J+,+G045S__``E^D_\`05TK_O\`R_\`
+<< MQJC_`(2_2?\`H*Z5_P!_Y?\`XU19A<Z"BN?_`.$OTG_H*Z5_W_E_^-4?\)?I
+<< M/_05TK_O_+_\:HLPN=!17/\`_"7Z3_T%=*_[_P`O_P`:H_X2_2?^@KI7_?\`
+<< ME_\`C5%F%SH**Y__`(2_2?\`H*Z5_P!_Y?\`XU1_PE^D_P#05TK_`+_R_P#Q
+<< MJBS"YT%%<_\`\)?I/_05TK_O_+_\:H_X2_2?^@KI7_?^7_XU19A<Z"BN?_X2
+<< M_2?^@KI7_?\`E_\`C5'_``E^D_\`05TK_O\`R_\`QJBS"YT%%<__`,)?I/\`
+<< MT%=*_P"_\O\`\:H_X2_2?^@KI7_?^7_XU19A<Z"BN?\`^$OTG_H*Z5_W_E_^
+<< M-4?\)?I/_05TK_O_`"__`!JBS"YT%%<__P`)?I/_`$%=*_[_`,O_`,:H_P"$
+<< MOTG_`*"NE?\`?^7_`.-4687.@HKG_P#A+])_Z"NE?]_Y?_C5'_"7Z3_T%=*_
+<< M[_R__&J+,+G045S_`/PE^D_]!72O^_\`+_\`&J/^$OTG_H*Z5_W_`)?_`(U1
+<< M9A<Z"BN?_P"$OTG_`*"NE?\`?^7_`.-4?\)?I/\`T%=*_P"_\O\`\:HLPN=!
+<< M16#'XJTV:5(HM2TQY'8*J+-,2Q/0`>5R:VWBO4=D;["&4X(\^3K_`-^J5F%Q
+<< M]%1[;O\`Z<?^_P#)_P#&J-MW_P!./_?^3_XU18"2BH]MW_TX_P#?^3_XU1MN
+<< M_P#IQ_[_`,G_`,:HL!)7/^*?^1-US_KJW_HN&MS;=_\`3C_W_D_^-5A>)PX\
+<< M&:WYGE[O-;/EL2O^KAZ$@']*:!GFM%%%?1GA'JWA/_D2]._ZZ3?^A4GB_P#Y
+<< M$35_HG]:7PG_`,B7IW_72;_T*D\7_P#(B:O]$_K7@5OXLO5GLTOX:]$>BT44
+<< M4B@JO?KOTZY7;NS$PV[=V>#QC:V?^^3]#TJQ5>_7?IURNW=F)AMV[L\'C&UL
+<< M_P#?)^AZ4`6****`*<?G)<W/EPQE6E!9F)4_=C&1\G/&[N>0!GLLBO>';N@@
+<< M'3.)B<?=S_#[O^0Z9.TMUVSW9VXW2@YVXS\BC/W1G\VZ=>,"Q0!SGCP:P?!.
+<< MI#03,NH;4VF$$N$WKYFT`@D^7OQM^;/W?FQ7DGPK\17D7C>TT;3H3]AN8W:^
+<< MC3YXHPL64D7'3I&N[@%712"=NSW$:M8F^%GYX$S,40,I"NP!)56(PS`*W`)/
+<< MRM_=.(-+TK1=/O\`5;C2[:TBN[JX#W[0XW-+L!&_'0[6#8X^^6ZL2>B%?DI2
+<< MIV^*WX'53Q/)0G1Y4^:VOI_7Y_+%\2W$MWXAL-,CLI[RUM8S>WB0E`(F8E+=
+<< MI`[`-&"LSX4,P>&,@#`RLO\`R%=3^L/_`*%-71ZC/#;:?,\\L<2$;`SL%!9C
+<< MM4<]RQ``[D@5SDO_`"%=3^L/_H4U<K.9&5_;MK_PD/\`8WES>;Y>[S\#R=_7
+<< MR=V?];L^?;C.WGI4!\4:8=;;38[VSD\FVGGNI%N5/V;RFC4AQ_#]]N21C8?P
+<< MS/\`A%-2^W?VE_;$WVO^UOMODXC\C9GRL?ZO?N^S?)UQNYSWJJ/"VL-'I=L_
+<< MV%8=(M$@MY!.Y:Y:.:WD7>NS]V&%O@X+[=_\6.9&;NF^*-,U.:\6*]LS%#<B
+<< M"&5+E6$_R1'*_P#`YE3`SSCN<5=CUC3)?MGEZC9O]BS]JVSJ?(QG._GY<;6Z
+<< MXZ'TK"TSP]?_`/"4MKFIP6*L6G=(XI6E,3/';1@JS(O.(),\#AP.<FL^R\$S
+<< MVM@MO+:PW1M;9+>!GU>Z!EVO&P<'D6_,2MM0-S@;@%^8`ZH:]H[):.NK6)6\
+<< M8I;,+E,3L#M(3GYCD@<=Z&_Y';PS_P!=;C_T0]8L.B:XE_8W3WB?:@J+>7HG
+<< M^:2)9'<0&'RQ&P`;:)1L;DG`Y4W=;@ENM:TBWA7=+*EXB+D#+&VD`'/O36X,
+<< M[)O%>C*Q7[3(V#C<EM*RGW!"X(]QQ2Q^*]%DGAA^V&-YG$<?G0O&&<\!<LH&
+<< M2>`,\G`'-<0_BS4&=BMKXJ1220O_``CURVT>F=XS^54$AU3Q/K>E6\-KK>VV
+<< MOX;Z:?5+*:VCC2.1'8+YA;D[``J]ST`#,+(/1]0\4:3I>HFQNYITF6)9Y&6T
+<< ME>.&-BP#R2*I2-<H_+$`!23P,U<U/4H=*M4N)UD9'N(+<!`"=TLJQ*>2.-S@
+<< MGVSUZ5AW7]K6'C*^O+31)[Z&\T^UMXYEGBCCCDCDN"?,W-O"XE0Y5'.,X!(P
+<< M:;>$IH_"NH^'K>&,SOX<ATJ/4I)"JSLJ3(%,8R4"EMV><^;CG;0,[2BJ>DZE
+<< M#K.C6.J6ZR+!>V\=Q&L@`8*ZA@#@D9P?4U<H`****`"BBB@`HHHH`****`"B
+<< MBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`***
+<< M*`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH
+<< M`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`
+<< MHHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`AN_^/.?_KFW\JY#5_$NDZ/J
+<< M$EK?:GI=G)DLL=P\4;%<D`X;G'!Y]JZ^[_X\Y_\`KFW\JX+Q=X4TCQ6_D:M;
+<< M>:(+@R1NK;77YOF7<.=K`8(_'@@$2QHJZ]JD.HZ9I<]G<V\]M+J5N!+;%2KX
+<< MDY&Y>O(_,>U=)=_\?D__`%T;^=<UXAABM['2(((TBACU&U1(T4*JJ'```'0`
+<< M5TMW_P`?D_\`UT;^=3T&5G<@A41I)""0BD`X'4Y)``]R>X'4BL2^U-M(D6_E
+<< MO(KFUGE6-[>!O,\O.%5HS@%FW9RF#D8*_,"KT?%VH6UC?:;%JDBQ:3=SK'<O
+<< M+Q&5"R?(S=@TAA)7^)5;.55L7-)\(:;I&L7=_!&BK)*)+>VCC"16I\M48HHX
+<< MW-M.6]"0,9;<]`+MWK)ANGMK/3KS498L><+4Q`0DC(#&1U&X@YP,D`@G`9<V
+<< M4U*PEU"73X[VV>]B7?);+*ID1>.2N<@?,/S'K7/Z_H&J3Q:DFD2(&OV\[S6O
+<< MIK5[><1"(,#$I\Q<*IV-CE3R<@+-:Z'?Q:A:I(;;[%:7]Q?QS+(QDD:7SOD*
+<< M;<*!YY^;<<[!P-WRH#I*Y_Q3_P`B;KG_`%U;_P!%PUT%<_XI_P"1-US_`*ZM
+<< M_P"BX::!GFE%%6ETV^>>&!;*Y::=/,BC$3%I$P3N48Y&`>1Z5]'>QX=CTSPG
+<< M_P`B7IW_`%TF_P#0J3Q?_P`B)J_T3^M+X3_Y$O3O^NDW_H5)XO\`^1$U?Z)_
+<< M6O`K?Q9>K/8I?PUZ(]%HHHI%!5>_7?IURNW=F)AMV[L\'C&UL_\`?)^AZ58J
+<< MO?KOTZY7;NS$PV[=V>#QC:V?^^3]#TH`L4444`4X_.2YN?+AC*M*"S,2I^[&
+<< M,CY.>-W<\@#/9:^J76H6VC7EQ'%`DL=N[AA*3M(4'/*<X^;Z[1_>.VY;KMGN
+<< MSMQNE!SMQGY%&?NC/YMTZ\8$D\$=S;RV\R[HI4*.N<9!&".*`/&O%K3:6NM;
+<< M+>\":3:+/97K7@(:5&!C!C\D*=C0JV"QP"/^>C5R_@_Q#JFD^.-,L[**9[Z\
+<< MNTM[^-@Q\V(R'S'=3\^]3YK'=\R,LFXD%M_K\GPL\(RQM')8WCHX*LK:I=$$
+<< M'J"/,K>L]*T4ZS=:]9VUHVH7"?99[R+!9A&Q4H2.X8;3W^0`_=`'12K^SA.%
+<< MK\R.JAB?94YPY4^96]#%\2W$MWXAL-,CLI[RUM8S>WB0E`(F8E+=I`[`-&"L
+<< MSX4,P>&,@#`S'>/,FKWRP(LI<H679,Q7#28/R1L.=Q[C[IKJ-1GAMM/F>>6.
+<< M)"-@9V"@LQVJ.>Y8@`=R0*YR7_D*ZG]8?_0IJYF<R*NZ^_Y]/_(-S_\`&*-U
+<< M]_SZ?^0;G_XQ52]U^PL+XV<HO)+@1K*R6UE-/M5BP4DQHP&2C=?2K.I7\6EZ
+<< M7=ZA.KM#:P/.ZH`6*JI8XSCG`J=.PQVZ^_Y]/_(-S_\`&*-U]_SZ?^0;G_XQ
+<< M3;J_BM+BQ@D5RUY.8(RH&`PC>3GVQ&?QQ5JBZ`K[K[_GT_\`(-S_`/&*8L4W
+<< M]H6M])92-/:EC"52Y`4LNTDC[.<\$C\?IBW11=!8L_VSJ7_/K+_WQ/\`_(U'
+<< M]LZE_P`^LO\`WQ/_`/(U5J*.8+%G^V=2_P"?67_OB?\`^1J/[9U+_GUE_P"^
+<< M)_\`Y&JM11S!8L_VSJ7_`#ZR_P#?$_\`\C4?VSJ7_/K+_P!\3_\`R-5:BCF"
+<< MQ9_MG4O^?67_`+XG_P#D:C^V=2_Y]9?^^)__`)&JM11S!8L_VSJ7_/K+_P!\
+<< M3_\`R-1_;.I?\^LO_?$__P`C56HHY@L6?[9U+_GUE_[XG_\`D:C^V=2_Y]9?
+<< M^^)__D:JU%',%BS_`&SJ7_/K+_WQ/_\`(U']LZE_SZR_]\3_`/R-5:BCF"Q9
+<< M_MG4O^?67_OB?_Y&H_MG4O\`GUE_[XG_`/D:JU%',%BS_;.I?\^LO_?$_P#\
+<< MC4?VSJ7_`#ZR_P#?$_\`\C56HHY@L6?[9U+_`)]9?^^)_P#Y&H_MG4O^?67_
+<< M`+XG_P#D:JU%',%BS_;.I?\`/K+_`-\3_P#R-1_;.I?\^LO_`'Q/_P#(U<?_
+<< M`,)UIG_'OY%Y_:WVG[-_9.Q?M6_KG;NV[-OS^9NV;>^>*Z>G<5B:X\03VEE]
+<< MLGFM4M]BR;S<-C:P!!_U'N*R_P#A8NF_]!;3_P#P)?\`^1ZS?%'_`"(,O_8/
+<< MA_\`0$K;\2^(7T"TN[^07L\<4RHL%K\TCEY`BA5R,G+#BBX6*W_"Q=-_Z"VG
+<< M_P#@2_\`\CT?\+%TW_H+:?\`^!+_`/R/0WBNT22?S-3$=O#;0W)NGG`A*2LZ
+<< MH0^<<E#[<C&<U(_BG3XGB237K9&E@^T1JUXH+Q8+>8.>5PI.>F`?2BX6(_\`
+<< MA8NF_P#06T__`,"7_P#D>C_A8NF_]!;3_P#P)?\`^1ZGD\1VD7V/S-9A3[;C
+<< M[+NN@//SC&SGYL[EZ9ZCUJ[]KN?^?B7_`+[-',%C+_X6+IO_`$%M/_\``E__
+<< M`)'H_P"%BZ;_`-!;3_\`P)?_`.1ZTA?7#7D%J)YC+-NV_,<<#/)[=A]2*=]K
+<< MN?\`GXE_[[-%PL9?_"Q=-_Z"VG_^!+__`"/1_P`+%TW_`*"VG_\`@2__`,CU
+<< MJ?:[G_GXE_[[-'VNY_Y^)?\`OLT<P6,O_A8NF_\`06T__P`"7_\`D>C_`(6+
+<< MIO\`T%M/_P#`E_\`Y'K4^UW/_/Q+_P!]FC[7<_\`/Q+_`-]FCF"QE_\`"Q=-
+<< M_P"@MI__`($O_P#(]'_"Q=-_Z"VG_P#@2_\`\CUJ?:[G_GXE_P"^S1]KN?\`
+<< MGXE_[[-',%C+_P"%BZ;_`-!;3_\`P)?_`.1Z/^%BZ;_T%M/_`/`E_P#Y'K4^
+<< MUW/_`#\2_P#?9H^UW/\`S\2_]]FCF"QE_P#"Q=-_Z"VG_P#@2_\`\CT?\+%T
+<< MW_H+:?\`^!+_`/R/6I]KN?\`GXE_[[-'VNY_Y^)?^^S1S!8R_P#A8NF_]!;3
+<< M_P#P)?\`^1Z/^%BZ;_T%M/\`_`E__D>M3[7<_P#/Q+_WV:/M=S_S\2_]]FCF
+<< M"QE_\+%TW_H+:?\`^!+_`/R/1_PL73?^@MI__@2__P`CUJ?:[G_GXE_[[-'V
+<< MNY_Y^)?^^S1S!8R_^%BZ;_T%M/\`_`E__D>C_A8NF_\`06T__P`"7_\`D>M3
+<< M[7<_\_$O_?9H^UW/_/Q+_P!]FCF"QE_\+%TW_H+:?_X$O_\`(]'_``L73?\`
+<< MH+:?_P"!+_\`R/6I]KN?^?B7_OLT?:[G_GXE_P"^S1S!8R_^%BZ;_P!!;3__
+<< M``)?_P"1Z/\`A8NF_P#06T__`,"7_P#D>M3[7<_\_$O_`'V:/M=S_P`_$O\`
+<< MWV:.8+&7_P`+%TW_`*"VG_\`@2__`,CT?\+%TW_H+:?_`.!+_P#R/6I]KN?^
+<< M?B7_`+[-'VNY_P"?B7_OLT<P6,O_`(6+IO\`T%M/_P#`E_\`Y'H_X6+IO_06
+<< MT_\`\"7_`/D>M3[7<_\`/Q+_`-]FC[7<_P#/Q+_WV:.8+&7_`,+%TW_H+:?_
+<< M`.!+_P#R/1_PL73?^@MI_P#X$O\`_(]:GVNY_P"?B7_OLT?:[G_GXE_[[-',
+<< M%C+_`.%BZ;_T%M/_`/`E_P#Y'H_X6+IO_06T_P#\"7_^1ZU/M=S_`,_$O_?9
+<< MH^UW/_/Q+_WV:.8+&7_PL73?^@MI_P#X$O\`_(]'_"Q=-_Z"VG_^!+__`"/6
+<< MI]KN?^?B7_OLT?:[G_GXE_[[-',%C+_X6+IO_06T_P#\"7_^1Z/^%BZ;_P!!
+<< M;3__``)?_P"1ZK^,+RZ'A#5,7,W,!4_.>0>"/RKH;JZN%NYE6>4`.P`#GCFB
+<< MX6,;_A8NF_\`06T__P`"7_\`D>C_`(6+IO\`T%M/_P#`E_\`Y'K4^UW/_/Q+
+<< M_P!]FC[7<_\`/Q+_`-]FCF"QE_\`"Q=-_P"@MI__`($O_P#(]'_"Q=-_Z"VG
+<< M_P#@2_\`\CUJ?:[G_GXE_P"^S1]KN?\`GXE_[[-',%C+_P"%BZ;_`-!;3_\`
+<< MP)?_`.1Z/^%BZ;_T%M/_`/`E_P#Y'K4^UW/_`#\2_P#?9H^UW/\`S\2_]]FC
+<< MF"QE_P#"Q=-_Z"VG_P#@2_\`\CT?\+%TW_H+:?\`^!+_`/R/4FH^(+BQG@MH
+<< MH[Z]NIE>1(+>10VQ2H9LNZK@%T&,Y^;@'!Q`_C"TM01J6IIIL@8)Y=Y>Q*V[
+<< M8CD<.>0)%!_/D$$EPL/_`.%BZ;_T%M/_`/`E_P#Y'H_X6+IO_06T_P#\"7_^
+<< M1ZM)KL,NH2Z?'JJ/>Q+ODMEN`9$7CDKG('S#\QZU36ZN&\:C=<2G9I,A7+GY
+<< M29XLX],X'Y47"P[_`(6+IO\`T%M/_P#`E_\`Y'H_X6+IO_06T_\`\"7_`/D>
+<< MF:KXGO-+O+2V%AJEV;IO+B>WEB"E]KN5^>12#M1CG&/?/%79-=AA@\^7542'
+<< M<Z>8UP`NY`Q<9SU4(^?3:<]#1<+%7_A8NF_]!;3_`/P)?_Y'H_X6+IO_`$%M
+<< M/_\``E__`)'J1/%.GRZ?+J$>O6SV43;)+E;Q3&C<<%LX!^8?F/6KL.HR7$$<
+<< M\%XTL,BATD27<K*1D$$'D$47"QG?\+%TW_H+:?\`^!+_`/R/1_PL73?^@MI_
+<< M_@2__P`CUJ?:[G_GXE_[[-'VNY_Y^)?^^S1S!8R_^%BZ;_T%M/\`_`E__D>C
+<< M_A8NF_\`06T__P`"7_\`D>M3[7<_\_$O_?9H^UW/_/Q+_P!]FCF"QE_\+%TW
+<< M_H+:?_X$O_\`(]'_``L73?\`H+:?_P"!+_\`R/6I]KN?^?B7_OLT?:[G_GXE
+<< M_P"^S1S!8R_^%BZ;_P!!;3__``)?_P"1Z/\`A8NF_P#06T__`,"7_P#D>M3[
+<< M7<_\_$O_`'V:/M=S_P`_$O\`WV:.8+&7_P`+%TW_`*"VG_\`@2__`,CT?\+%
+<< MTW_H+:?_`.!+_P#R/6I]KN?^?B7_`+[-'VNY_P"?B7_OLT<P6,O_`(6+IO\`
+<< MT%M/_P#`E_\`Y'H_X6+IO_06T_\`\"7_`/D>FK=7#>-1NN)3LTF0KES\I,\6
+<< M<>F<#\J2X\70VFO-I-S<W$++:?:VN9'"PA<M\I8M][$;MC'W48]C1<+#_P#A
+<< M8NF_]!;3_P#P)?\`^1Z/^%BZ;_T%M/\`_`E__D>H=-\:6E_865U+>RZ>]Y(\
+<< M,-M?RB*9G1S&R[=W+;AC`R>13-6\;6VE7T-E]O2:Z+/YUNMXBR1(L#R[B&(P
+<< M,(!EBH^8$FBX6+/_``L73?\`H+:?_P"!+_\`R/1_PL73?^@MI_\`X$O_`/(]
+<< M5M-\8G4=0N+9+A,1W;6BJMZ#,KIYFXR1G&T$Q-MP6+#YB%`.+J>*=/ET^74(
+<< M]>MGLHFV27*WBF-&XX+9P#\P_,>M%PL1_P#"Q=-_Z"VG_P#@2_\`\CT?\+%T
+<< MW_H+:?\`^!+_`/R/4FB^(9-;TW[=!<-Y+3S1HR3[U=8Y60,".H8+G\>_6M#[
+<< M7<_\_$O_`'V:.8+&7_PL73?^@MI__@2__P`CT?\`"Q=-_P"@MI__`($O_P#(
+<< M]:GVNY_Y^)?^^S1]KN?^?B7_`+[-',%C'G\?Z5<6\D$FK6.R12C;;R13@C!P
+<< M1`"#[CFN;W>!O^?BV_\`!O=?_&J[S[7<_P#/Q+_WV:/M=S_S\2_]]FCF"QPL
+<< M4W@B&:.9+BTWQNLB[M5N6`8'(.#%@\@5KR^,M)EF>3^U-*&]BV//EXS_`-LJ
+<< MZ/[7<_\`/Q+_`-]FLGPO=7!\,6;_`&B7<[W#,=YRQ-Q+DGU-%TP,_P#X2_2?
+<< M^@KI7_?^7_XU1_PE^D_]!72O^_\`+_\`&JZ;[7<_\_$O_?9H^UW/_/Q+_P!]
+<< MFE=#U.9_X2_2?^@KI7_?^7_XU1_PE^D_]!72O^_\O_QJNF^UW/\`S\2_]]FC
+<< M[7<_\_$O_?9HN@U.9_X2_2?^@KI7_?\`E_\`C51:]/%=_#[5+N&>&:*=W97A
+<< M+%>%C7JRKGE3VQ75_:[G_GXE_P"^S6)XV=G\#WS.Q9B'R2<G^"A6`\IKM;37
+<< MH(=:TM#)'NB^PQI<DC$41CB\U=V?EP4QCH`\N>M<517T$X*6YXL9..QZWX;F
+<< M\_P?IK^5''@NFV-<`[<+GZG&2>Y)J'Q?_P`B)J_T3^M+X3_Y$O3O^NDW_H5)
+<< MXO\`^1$U?Z)_6O#J_P`67JSUZ?\`#7H>BT444AA5>_7?IURNW=F)AMV[L\'C
+<< M&UL_]\GZ'I5BJ]^N_3KE=N[,3#;MW9X/&-K9_P"^3]#TH`L4444`4X_.2YN?
+<< M+AC*M*"S,2I^[&,CY.>-W<\@#/99%>\.W=!`.F<3$X^[G^'W?\ATR=I;KMGN
+<< MSMQNE!SMQGY%&?NC/YMTZ\8%B@#G/'@U@^"=2&@F9=0VIM,()<)O7S-H!!)\
+<< MO?C;\V?N_-BO)/A7XBO(O&]IHVG0G[#<QNU]&GSQ1A8LI(N.G2-=W`*NBD$[
+<< M=GN(U:Q-\+/SP)F8H@92%=@"2JL1AF`5N`2?E;^Z<0:7I6BZ??ZK<:7;6D5W
+<< M=7`>_:'&YI=@(WXZ':P;''WRW5B3T0K\E*5.WQ6_`ZJ>)Y*$Z/*GS6U]/Z_/
+<< MY8OB6XEN_$-AID=E/>6MK&;V\2$H!$S$I;M('8!HP5F?"AF#PQD`8&5E_P"0
+<< MKJ?UA_\`0IJV]7U;3=/C2WO=0M+:>[#);1S3*C3-P,("<L<L!@>H]:QS;W-S
+<< MJ^J):K$S@Q$B5R@QNF[@&N9G,CFKG0!?^*;N\N3>1VYLK>*)[:]E@W,KS%@1
+<< M&ZDX#IU]>.]<]JWAO4KJWU**WTO_`(F$GVYI-0WQC[7%+',(H-V[>=IDA&'`
+<< M4>5P?E7/I/\`9&L?\\;'_P`"7_\`C=5+&*\U(3FS-A*()?)D(N)``V`V.8^>
+<< M&4Y'!S4[.Q5FU='`ZCX;U*XNR+72_*U3[3>R?VYOC7Y)(KA85WAO-^7S(EQM
+<< MP-G'`!HT_P`'L9[-&TZ\BT\7JR3V]RUM&,""=2WEVP"%6,D:G))<<,-J\^D_
+<< MV1K'_/&Q_P#`E_\`XW1_9&L?\\;'_P`"7_\`C=%F+0Y#1=*N+7Q3J%V;';!+
+<< MYA:[O(XC<R,S@JL<D;$F$`<+(`RX0`D<+T]6/[(UC_GC8_\`@2__`,;H_LC6
+<< M/^>-C_X$O_\`&Z+,+HKT58_LC6/^>-C_`.!+_P#QNC^R-8_YXV/_`($O_P#&
+<< MZ+,+E>BK']D:Q_SQL?\`P)?_`.-T?V1K'_/&Q_\``E__`(W19A<KT58_LC6/
+<< M^>-C_P"!+_\`QNC^R-8_YXV/_@2__P`;HLPN5Z*L?V1K'_/&Q_\``E__`(W1
+<< M_9&L?\\;'_P)?_XW19A<KT58_LC6/^>-C_X$O_\`&Z/[(UC_`)XV/_@2_P#\
+<< M;HLPN5Z*L?V1K'_/&Q_\"7_^-T?V1K'_`#QL?_`E_P#XW19A<KT58_LC6/\`
+<< MGC8_^!+_`/QNC^R-8_YXV/\`X$O_`/&Z+,+E>BK']D:Q_P`\;'_P)?\`^-T?
+<< MV1K'_/&Q_P#`E_\`XW19A<KT58_LC6/^>-C_`.!+_P#QNC^R-8_YXV/_`($O
+<< M_P#&Z+,+E>BK']D:Q_SQL?\`P)?_`.-T?V1K'_/&Q_\``E__`(W19A<XK_A#
+<< M+K[=_;7]N3?\)#YF?MGEGR/)S_Q[^1NQY6/]K=N^;=FNMJQ_9&L?\\;'_P`"
+<< M7_\`C=']D:Q_SQL?_`E__C=%F%T<OXH_Y$&7_L'P_P#H"5=\3M;WQDMDOK1)
+<< M(]0@F822@8$5PDC#ZX0@>_I5+Q1_R(,O_8/A_P#0$KI;K1]`2YD@M?"VDS&+
+<< M`D9[0*`Q`(`VQMDX()Z=1UYQ-2I"FN:;L!YY_9$]M?:BUKJMA]A;R$MK=;]H
+<< M':%3,YB:1!F)5>8;=@/R1JAX)-,TW0FMK>59=1TU6DGM9=HO6EVB._EN6!=@
+<< M&8[)``3R6!SCK7?6=GX=>*?^TO!UI92Q2LORZ:)4=!RKJPCZ$'D$`@@CD`$M
+<< MM-)\/:E?RQV5GX8:(.&B06$,C2Q;+=RRE9.FV0C)4?ZR,X(`,A"I"I\#N)W1
+<< MP$_AN.2:Z+7UA,E[YT<JG5)H$C1KB>4$I&1YV5GP48J!M(#?,2.Z_M.P_P"?
+<< MVV_[^K_C6C'X-LQL\S3?#C8V[]NC!<_ZO=CYSC.)<=<;TZ[#OC_X1338'MDN
+<< M;/PP'E=45?[(5#*P5&8)F0\[4G('.`RGGRVWWRA<HPWFD17;7;7:-.RA0PN$
+<< M&T`DX'&1R<]34MQJ^GS3O(MW;(&.=OG*>>]78_!MF-GF:;X<;&W?MT8+G_5[
+<< ML?.<9Q+CKC>G78=Y'X-LQL\S3?#C8V[]NC!<_P"KW8^<XSB7'7&].NP[SE"Y
+<< MG?VG8?\`/[;?]_5_QH_M.P_Y_;;_`+^K_C6C'X-LQL\S3?#C8V[]NC!<_P"K
+<< MW8^<XSB7'7&].NP[Y-)\.^'K[1K&[?0M&=Y[>.5FCLH=I+*#D;2XQSV9AZ,>
+<< MM'*%S*_M.P_Y_;;_`+^K_C1_:=A_S^VW_?U?\:Z'_A$_#?\`T+^E?^`4?^%'
+<< M_")^&_\`H7]*_P#`*/\`PHY0N<]_:=A_S^VW_?U?\:/[3L/^?VV_[^K_`(UT
+<< M/_")^&_^A?TK_P``H_\`"C_A$_#?_0OZ5_X!1_X4<H7.>_M.P_Y_;;_OZO\`
+<< MC1_:=A_S^VW_`']7_&NA_P"$3\-_]"_I7_@%'_A1_P`(GX;_`.A?TK_P"C_P
+<< MHY0N<]_:=A_S^VW_`']7_&C^T[#_`)_;;_OZO^-=#_PB?AO_`*%_2O\`P"C_
+<< M`,*/^$3\-_\`0OZ5_P"`4?\`A1RA<Y[^T[#_`)_;;_OZO^-']IV'_/[;?]_5
+<< M_P`:Z'_A$_#?_0OZ5_X!1_X4?\(GX;_Z%_2O_`*/_"CE"YSW]IV'_/[;?]_5
+<< M_P`:/[3L/^?VV_[^K_C70_\`")^&_P#H7]*_\`H_\*/^$3\-_P#0OZ5_X!1_
+<< MX4<H7.>_M.P_Y_;;_OZO^-']IV'_`#^VW_?U?\:Z'_A$_#?_`$+^E?\`@%'_
+<< M`(4?\(GX;_Z%_2O_``"C_P`*.4+G/?VG8?\`/[;?]_5_QH_M.P_Y_;;_`+^K
+<< M_C70_P#")^&_^A?TK_P"C_PH_P"$3\-_]"_I7_@%'_A1RA<Y[^T[#_G]MO\`
+<< MOZO^-']IV'_/[;?]_5_QKH?^$3\-_P#0OZ5_X!1_X4?\(GX;_P"A?TK_`,`H
+<< M_P#"CE"YSW]IV'_/[;?]_5_QH_M.P_Y_;;_OZO\`C70_\(GX;_Z%_2O_``"C
+<< M_P`*/^$3\-_]"_I7_@%'_A1RA<Y[^T[#_G]MO^_J_P"-']IV'_/[;?\`?U?\
+<< M:Z'_`(1/PW_T+^E?^`4?^%'_``B?AO\`Z%_2O_`*/_"CE"YSW]IV'_/[;?\`
+<< M?U?\:/[3L/\`G]MO^_J_XUT/_")^&_\`H7]*_P#`*/\`PH_X1/PW_P!"_I7_
+<< M`(!1_P"%'*%SGO[3L/\`G]MO^_J_XT?VG8?\_MM_W]7_`!KH?^$3\-_]"_I7
+<< M_@%'_A1_PB?AO_H7]*_\`H_\*.4+G/?VG8?\_MM_W]7_`!H_M.P_Y_;;_OZO
+<< M^-=#_P`(GX;_`.A?TK_P"C_PH_X1/PW_`-"_I7_@%'_A1RA<X7Q;?6DWA348
+<< MXKJ!W,7"K("3R.U=!>ZA9)?W"/>6ZLLK`@RJ"#D^];7_``B?AO\`Z%_2O_`*
+<< M/_"C_A$_#?\`T+^E?^`4?^%'*%SGO[3L/^?VV_[^K_C1_:=A_P`_MM_W]7_&
+<< MNA_X1/PW_P!"_I7_`(!1_P"%'_")^&_^A?TK_P``H_\`"CE"YSW]IV'_`#^V
+<< MW_?U?\:/[3L/^?VV_P"_J_XUT/\`PB?AO_H7]*_\`H_\*/\`A$_#?_0OZ5_X
+<< M!1_X4<H7.>_M.P_Y_;;_`+^K_C1_:=A_S^VW_?U?\:Z'_A$_#?\`T+^E?^`4
+<< M?^%'_")^&_\`H7]*_P#`*/\`PHY0N</KTMKJ$$,`M-"U2$,7:/4+H*J,!@%1
+<< MY;Y."WICWS6%'IU]9PO:C4=+U.UFD1[H7-\T+W.RW@B&\A'RK-'(S+_%E020
+<< M64^J_P#")^&_^A?TK_P"C_PH_P"$3\-_]"_I7_@%'_A18+GFFG:5;V>O"YDO
+<< M+-X([NXNXYFU.5CNE,AVBWR(T(\TC?EL@'@%LKL17ELWB^287$)B727#.'&T
+<< M'SXN_P"(KL_^$3\-_P#0OZ5_X!1_X4?\(GX;_P"A?TK_`,`H_P#"G8+G':C)
+<< M:W=]I$\=_9A;.[:>0-,,E3!+'Q[YD'X9KF-;M[6XMO%+PS[H8[2X%I;%P0UQ
+<< M+`/,>-1U!&`".=\EQG.ZO6/^$3\-_P#0OZ5_X!1_X5'/X:\*VMO+<7&B:-#!
+<< M$A>222UB544#)))&``.<TN4+GF.HZ=+JUY_:ES=:;#=1M"$M;?5)$5U19USY
+<< MZJKH3]H)P%/W,9^8[>AT1K'2])BM6N[-6#/(RI=-(`SNSGYW8LYRQRQQDY.%
+<< MS@=;)X:\*PO"DNB:,CS/LB5K6(%VVEL+QR=JL<#L">U2?\(GX;_Z%_2O_`*/
+<< M_"CE"YSW]IV'_/[;?]_5_P`:/[3L/^?VV_[^K_C70_\`")^&_P#H7]*_\`H_
+<< M\*/^$3\-_P#0OZ5_X!1_X4<H7.>_M.P_Y_;;_OZO^-']IV'_`#^VW_?U?\:Z
+<< M'_A$_#?_`$+^E?\`@%'_`(4?\(GX;_Z%_2O_``"C_P`*.4+G/?VG8?\`/[;?
+<< M]_5_QH_M.P_Y_;;_`+^K_C70_P#")^&_^A?TK_P"C_PH_P"$3\-_]"_I7_@%
+<< M'_A1RA<Y[^T[#_G]MO\`OZO^-']IV'_/[;?]_5_QKH?^$3\-_P#0OZ5_X!1_
+<< MX4?\(GX;_P"A?TK_`,`H_P#"CE"YSW]IV'_/[;?]_5_QH_M.P_Y_;;_OZO\`
+<< MC70_\(GX;_Z%_2O_``"C_P`*/^$3\-_]"_I7_@%'_A1RA<XR*\MF\7R3"XA,
+<< M2Z2X9PXV@^?%W_$54OM.TO4]8NKB\O;-K:6"U1%$JEMT3S,X.1C:RR[#ZJS@
+<< MX!Y[[_A$_#?_`$+^E?\`@%'_`(4?\(GX;_Z%_2O_``"C_P`*=@N>5/H\BP:M
+<< M;Q:AI;IJ\<]O,[W14VZ//<2*ZC:?,;;<<J2HRGWCG(9J^D7-]82Z7!>Z0+7S
+<< M[ZX2X>\(<M<1W`"F,(0`&GQG<<A<XYP/6/\`A$_#?_0OZ5_X!1_X5'#X:\*W
+<< M*%X-$T:5`[(62UB8!E8JPX'4,"".Q!%%@N>:ZAHL6H:(FFMJUA%F]OYGD$H;
+<< M:EPMRJX'&6'GKD9`X//3,=OIA@N(]32;35O8)T=89=8GN1*JQS)AII`2H_?L
+<< M0`AY4Y)W?+ZE_P`(GX;_`.A?TK_P"C_PJ.'PUX5N4+P:)HTJ!V0LEK$P#*Q5
+<< MAP.H8$$=B"*+!<X_0)8K#2C%>7E@MP]S<3NL-P'1?,F>0`,0I.`X&<#I6G_:
+<< M=A_S^VW_`']7_&NA_P"$3\-_]"_I7_@%'_A1_P`(GX;_`.A?TK_P"C_PI<H7
+<< M.>_M.P_Y_;;_`+^K_C1_:=A_S^VW_?U?\:Z'_A$_#?\`T+^E?^`4?^%'_")^
+<< M&_\`H7]*_P#`*/\`PHY0N<]_:=A_S^VW_?U?\:/[3L/^?VV_[^K_`(UT/_")
+<< M^&_^A?TK_P``H_\`"C_A$_#?_0OZ5_X!1_X4<H7.>_M.P_Y_;;_OZO\`C6;X
+<< M<O+:W\,:>DUQ#&Q,Y`=P#C[1+ZUV?_")^&_^A?TK_P``H_\`"C_A$_#?_0OZ
+<< M5_X!1_X4<H7.>_M.P_Y_;;_OZO\`C1_:=A_S^VW_`']7_&NA_P"$3\-_]"_I
+<< M7_@%'_A1_P`(GX;_`.A?TK_P"C_PHY0N<]_:=A_S^VW_`']7_&C^T[#_`)_;
+<< M;_OZO^-=#_PB?AO_`*%_2O\`P"C_`,*/^$3\-_\`0OZ5_P"`4?\`A1RA<Y[^
+<< MT[#_`)_;;_OZO^-4/%\L<W@&]DB=70A\,IR#]SO78?\`")^&_P#H7]*_\`H_
+<< M\*YCQ[:6UCX-U"VM+>*W@0-MBA0(JY"$X`X'))HM8+GDE%%%?1'AGJWA/_D2
+<< M]._ZZ3?^A4GB_P#Y$35_HG]:7PG_`,B7IW_72;_T*D\7_P#(B:O]$_K7@5OX
+<< MLO5GLTOX:]$>BT444B@JO?KOTZY7;NS$PV[=V>#QC:V?^^3]#TJQ5>_7?IUR
+<< MNW=F)AMV[L\'C&UL_P#?)^AZ4`6****`*<?G)<W/EPQE6E!9F)4_=C&1\G/&
+<< M[N>0!GLM?5+K4+;1KRXCB@26.W=PPE)VD*#GE.<?-]=H_O';<MUVSW9VXW2@
+<< MYVXS\BC/W1G\VZ=>,"2>".YMY;>9=T4J%'7.,@C!'%`'C7BUIM+76MEO>!-)
+<< MM%GLKUKP$-*C`Q@Q^2%.QH5;!8X!'_/1JY?P?XAU32?'&F6=E%,]]>7:6]_&
+<< MP8^;$9#YCNI^?>I\UCN^9&63<2"V_P!2;P%X#GNCI\D%XSRDQ!)-2O-DIPQ*
+<< M`F3:QPKY4$GY6_NG'5VNE:*OB"^UBUMK3^UG1+6[N(\&3"@,$;T.UD/J1LSD
+<< M!<=%*O[.$X6OS(ZJ&)]E3G#E3YE;T.=\5WGV/QMH'_$RL;'SK"]B_P!+7/GY
+<< MDM?W4?SKB1NQ^;H?E-0:SI#ZYJMQ8K,L*O<0EY"N2%`N<X!XSZ>G7M75ZOJV
+<< MFZ?&EO>ZA:6T]V&2VCFF5&F;@80$Y8Y8#`]1ZUR>MMK<6I74^@:>]]>0W$+F
+<< M%98X_DQ<`DER`1D@8!SSQCJ,8.2DG%V9P5HQE3:DKKL9NNM=Z5IL=CI&D0"#
+<< M[3%:I=FWRL!DN6A5G+',IR`2J\Y8;L`\P^#]%CT/XIB&&ZEN8Y-)N7:69LR2
+<< M2>=;[W8]"3P.`!@`#(`)AU&U\77I6&;2?$*6LEZMRMD;S3-F]9!,$!X<@,I/
+<< MWLX'/>M#P;I/B?\`X3QM6UG1IK"U73IK=?,N(9!N:6)@`$=CT0Y)[CKR!7/2
+<< MI-3E4>[[_+1?F:2:M&*6B_R-R\\0ZQ:7/B/4"]BVD:'+B6V%N_GRQBVBF=EE
+<< M\S;N'F-A2F#M`++G<!OB7X;BUB\T^:Y\O[+YX>7S(WRT*LTH\I7,PVB.3ED"
+<< MG;P3N7=H2^$X)]3O[B74;YK/4)5FNM./E>1,PC2/#?)YFTB-,KOVM@@@J2"Z
+<< MV\/Q(\EQ8ZUJ$=I.99X((9(S%')+N9I5.PE\L[L%<NF6R%^5<;#,D^,Y&UG2
+<< M&:SNX+:_LKI[>S+02R7LBM;&(QM'(RD%9).=P``9FPJ[A8L/&$\EK.UUI%V\
+<< MYU.YL;-;?R@+PQRS#";I/E*QPDL9-@)!VYR!4EKX"T>WE>:4SW$TOGM/(Y2,
+<< MRR2M"QE/EJH60&WB(9`I!&[ECNJ2/P?%%;B*/5]25X[@W=O+^YW6\[!_-D7]
+<< MW@F3S9"P8,HW_($P,`%=O'UDIG9=,U)X+2W^T7\ZB+;9*))8W#@R;F*-!+GR
+<< MP^=OR[LC/65Q8\`AM2O5.IW::7=V4=O=0(8]UZQEN))S*3'E0YG/^J*8W-C;
+<< MA<=I0`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`>
+<< M8>*/^1!E_P"P?#_Z`E=K'<PP:AJ:R2*K?:%(!(!/[J.N*\4?\B#+_P!@^'_T
+<< M!*ZO7;+PU?Z@&U+0;#5+N-`A>:W@=HUY(7=(1ZDX'3.>,C/'C*<9T[2E97+B
+<< M[,DO+R*2"0"56RI``;KZ<?Y_P\WT.]M;=/";7GB?^PXUT1D%QY\`Y^SZ<?+_
+<< M`'QD5<Y+8"QGC.W!+OU]CI?P\O$F\SPUH5E+#*T3PW=C;HV1T(X(92"""I(Y
+<< MQP00.EM]-N;%VCL9[2"SWKLM_L[D1HJQ*$3]YM4;4D`"J!EU.,JWF+!T84TW
+<< M&5[V'.7-;0X.;QKK*ZCH+W$\&GW4W]GPW>E74Z0O,\YC$CQ0-$965?-*[O-7
+<< M#1,"IV'=&=8U#4+;PY>6NJQZEKQO1)<:6[0@:?,UC=%XMBA7!!W`)*^28PI=
+<< M?F8>B1PZP-GF7UBV-N_;9NN?]7NQ^].,XEQUQO3KL.\CAU@;/,OK%L;=^VS=
+<< M<_ZO=C]Z<9Q+CKC>G78=_:9G%_\`"9B))[0:[&]V^L6%O8I<B..XGMV:V28^
+<< M654D[S<JWR@JRNORE,+EZ5XNU*X\.6MS:^+;&]FN-*2XO[F^FMXHM-G+P#9O
+<< MCCQ$S"2?:)%?YHUX(#`^D1PZP-GF7UBV-N_;9NN?]7NQ^].,XEQUQO3KL.^O
+<< MIFF7^EZ=96$%U8K:VL44*(MI)PB",8!,I/19<9SC>F<[#O`#PM?'4O#EI=F2
+<< M^E\S>1)?+")7`=@&_<_NRI`!5EX92IR<YJQH4GF^'M,D\SS-]I$V_?OW90<[
+<< MM[Y^N]\_WFZDCAU@;/,OK%L;=^VS=<_ZO=C]Z<9Q+CKC>G78=]BPMWM-.MK:
+<< M67S9(HDC:3+'>0`"?G9FY_VF8^I)YH`L4444`%%%%`!1110`4444`%%%%`!1
+<< M110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%
+<< M%`!1110`4444`%%%%`'G^M^'/^$@^(=_^XT.7R-*L_\`D*Z5]MQNENON?O$V
+<< M].>N>.F.<?Q5KU[/HNOVS:IYMU)%JEO=Z1MC_P!$M4AN/*GVA?-7?Y<'S.Q4
+<< M^=P!N3'K%%`'D^O:]>_VK:W$6J?:-=L]0U`P>']L9VB*UO!"_EJHF.]5C/+8
+<< M;S<@`%<6-,USQ%?7-C90^);&XANM06`WMI)'>E5-M<NZ>8L$408>5&RC:S*3
+<< ME]RLJGU"B@`HHHH`****`"BBB@`HHHH`****`"N3\5W-C;>*?!;7-Y'#.VIR
+<< MI%&]QL#AK69?N9PQW-&H."07`&-^#UE%`'FZ6_\`9OCM'7^RG:UN[F\U754N
+<< M<7,=J\4K)%<@IA8U+PA0TAR(58*`IV8=U!#!X?F.KQ1Q:U/X<BN=,6[4+/\`
+<< MVI*;B2<VRMRLYE>(E8\$$QC`PHKUR_L;?4].N;"\C\RUNHGAF3<1N1@0PR.1
+<< MD$]*L4`>?VFH>$Y?&EQ=P:CI5C<V,MP+F1[I!>7;J'$JR;CO%O&`Q"MWC4J%
+<< M2-2^/(?#ZZ/HFG:]/8Z;KMQIZ7MU>:G,L,ED\S,\LD"R$;+AI3)@H!L*@MPD
+<< M:-ZA?V-OJ>G7-A>1^9:W43PS)N(W(P(89'(R">E6*`/']7_X];W^RO\`D;OM
+<< M>K_:?LO_`!__`&?RKO[/OV_O/+S]EV9X_P!3M_AJ34=/\,WU_-)IEYX?M?#=
+<< MJ]I,':S6XTPW)2\202!&6-7VO"2Q8'(A')*`^N44`<WX?DL6\$;GAM--T]$N
+<< M%9[,_98/*5W'GQE2/+1U'F@AN`X(8_>/'P:GX9D^'/@NWU.31IY)],C2V.J2
+<< MJ;2)DCC661U9@K.APH4?/EBH**9&7U2B@#DPU\UA-8>'=>COKB/3+(VYNVS\
+<< MC/(#<&<(P=Y$4X.U@&C!*D,0>326+3OAS:MK$T%@MMXK'E%M2=PVW4R7WNX4
+<< MO@"4_-NR$#G!^[ZQ10`4444`%%%%`!1110`5PWQ'_P"16U/Z'^4==S7#?$?_
+<< M`)%;4_H?Y1TF-'CU%%%?0GAGJWA/_D2]._ZZ3?\`H5)XO_Y$35_HG]:7PG_R
+<< M)>G?]=)O_0J3Q?\`\B)J_P!$_K7@5OXLO5GLTOX:]$>BT444B@JO?KOTZY7;
+<< MNS$PV[=V>#QC:V?^^3]#TJQ5>_7?IURNW=F)AMV[L\'C&UL_]\GZ'I0!8HHH
+<< MH`IQ^<ES<^7#&5:4%F8E3]V,9'R<\;NYY`&>RU]4NM0MM&O+B.*!)8[=W#"4
+<< MG:0H.>4YQ\WUVC^\=MRW7;/=G;C=*#G;C/R*,_=&?S;IUXP))X([FWEMYEW1
+<< M2H4=<XR",$<4`>->+6FTM=:V6]X$TFT6>RO6O`0TJ,#&#'Y(4[&A5L%C@$?\
+<< M]&KE_!_B'5-)\<:99V44SWUY=I;W\;!CYL1D/F.ZGY]ZGS6.[YD99-Q(+;_7
+<< MY/A9X1EC:.2QO'1P596U2Z((/4$>96]9Z5HIUFZUZSMK1M0N$^RSWD6"S"-B
+<< MI0D=PPVGO\@!^Z`.BE7]G"<+7YD=5#$^RISARI\RMZ'.^*[S['XVT#_B96-C
+<< MYUA>Q?Z6N?/S):_NH_G7$C=C\W0_*:VM*_Y&'5O]R+_T.6K6KZMINGQI;WNH
+<< M6EM/=ADMHYIE1IFX&$!.6.6`P/4>M5=*_P"1AU;_`'(O_0Y:YNIS&?=^)K6U
+<< MGVZCXET/3)%EE,4%V^QRBN\88YF7<#M/;&1ZBMJQU-&M&:]N;9)DDE1\'8,(
+<< M[@'!)(R(V/7L?2HX[/4[0F.VNK8Q23R.-]J6*;V9^3YHSR<<#N..IJYI]J]G
+<< M:>5)*LKF221F5-H)=RQP,G'WO6F(XB[OM0U&\>X:WU"6W>4QPQ)'*('B.=KR
+<< M*,;DV\E>6=C@[5JI-XDN_#EE<:E8VS^7Y4E[>:7=C8X`.6FB/"@ME6D497+%
+<< MERV?,Z/4)M;TRX-KIV@2ZC:#YXY8[F*/8"<["'(^Z<XP,`;1V-<5XRT3Q/XI
+<< MT]8T\)S1W"9"-)=V[*5/4'Y_4!A_M*I[5YU/$8B"]E*%U?=)W^^[7X;%^SB_
+<< M>OJ=]XL\3_\`"+6MA<M9_:(9[ORIV\W9Y$*Q22R2XP=VU(F.T<GH.<`U]-\:
+<< M6]_XHO\`1W@\F.*5(;.XWEOM;XG$@V[?DV-:SKR>=F1P5SL:CIGV^^TFY\[R
+<< M_P"S[MKG;MSYF898MN<\?ZW.>?NX[Y'/ZGX1\BQN(](7&ZTT^QLXL_\`'G]G
+<< MF9DGRS?O/+\P/L/WO*VDG=7HD&IJGB);;0FU'38H[U_MJ6*1R2-"IE-R+=@6
+<< MVL0%<GD*<[>,YS4:>*8K3SK?6H/LFHP^63;6N^[\U9-^PQ;4#OQ')D;`P\MR
+<< M1M`8R:EX=6;PQ;:+I<L=BEF]JUJTD;3*@MY(W12-P+#]V!]X'GK5.7PM>3SQ
+<< M:K)J<#:_%*DB7/V0BW"HDL:IY/F;MH6>4_ZS=O;.=H"``T$\4:3++:Q033SR
+<< M7.-J06DLABRQ3]Z%4^3\RLI\S;@HX/*MB.X\7Z':V%E>R7<A@OK=;FV\NWE=
+<< MI8V>)%(55+9+3Q#;C/S=.#BGIGA:\T:_6\L=3@\RX_Y"`GM"XES/+.?*Q(/*
+<< M^:XE`W>9@;.I4EL]/`5YOTJ&768&L=(BBM[*-;(K)Y<=Q;2CS'\PAF(M57(5
+<< M1EB<=J`-R/Q?H<J3.+N1?*3=B2WE1G^8*50,H,CAV5&1<LKL$(#$"HW\::(G
+<< MDKOOGFE\S%O%IMR\R;-F[?$L9=.)(S\P&0ZD9!%9=]\/H=0@6&>\CD1'O)!'
+<< M+;!T=I[V.[4.I;YD5H@C+QO!/*U<T'P>FBZC;7J/8QM'%<QO!8:>MK"3*8.5
+<< M4$D8%N,[BQ)8\@`*`"2U\:Z9<76JQL9!!8O'LN8HI)8KA'BA="CJNUG8S!5C
+<< M4LS<$`[A6Y8WL6H6<=U"DZ1OG`G@>%Q@D<HX##IW'/7I7)V'@6;3=!ET>*\T
+<< MV[M)K>W66/4=-,Z--%'#%OV^8HV%(%(0Y(8[MQ`VUTFB::^D:/!92WD]Y)'N
+<< M+3SR,[,68L0"[,VT9PH9F(4`$DC)`-"BBB@`HHHH`****`"BBB@`HHHH`***
+<< M*`"BBB@#S#Q1_P`B#+_V#X?_`$!*[FW<)?:GEL?Z2/\`T3%7#>*/^1!E_P"P
+<< M?#_Z`E=7KNAZ#?:@)[]=0^TE!D65S=1\<X++"P&>HW$9.,9XXX\73]I3M>UF
+<< M7%V9:OK@FVE&[Y2I'!Z_Y_S[\CH%H-3T[P%83W-]':MX:>9DM+V:VW.HLPI)
+<< MB92<!VZ^IK5T[PGX3U:&66RFU6012M#*IU>]1HW7JK*T@*GH>1R""."#6W+X
+<< M4\/W&G6-A=:+8W=K81"&U2[@6?RD``P"X)Z*OUP,T82@Z2;O>]ASDI6LCB_^
+<< M$V\2+$RV5C'?16-N]U-=2"%%N8//G2)R[31+$'C@#^8JR*?,W!```VQJ7B_4
+<< MM,&I(^GQR3Z4EW>77RLD;VJ1EX=C<D.Y:-<D;28;G'W!GJ+S2=-U"XM;B]T^
+<< MTN9[1]]M)-"KM"V0<H2,J<J#D>@]*L""%;A[A8HQ.Z*CR!1N95)*@GJ0"S$#
+<< MMN/K789GE^K^*-<L7L[K7=,C6?2KB2^C0&*%I5^P7QVE$FG*C,1PY;G)`7Y"
+<< M3N7>O>)+77K7P[]JTIKZ>6$_;?L,@C6.2*[?;Y7G9+`VGWM^,/\`=^7)ZBQT
+<< M+1],BCBL-*L;2..4SHD%ND860J4+@`<,5)7/7!QTK/N/!'ANXM;2S_L:QBL;
+<< M:[-Y]CBM8UAED,31Y=-N&X?/KE5YXH`YM?&6O37,Z1'342U>"TEW6SL9)I;Z
+<< M>R\Q3Y@VH&B638=Q()7>/OU'<>.O$3/.ECI4$_\`9D4DE])^[2.39<3PGYI)
+<< MT\A3]F9MV)MH?D'9\_>)I.FQHB)I]HJ(D2*HA4!5B;=$!QP$8Y4?PGD8J.;0
+<< MM'N);:6;2K&22UE:>W=[="8I&;>SJ2/E8M\Q(Y)YZT`<'XA\4:]#X5U:\>XM
+<< M%@N7U6QM5M87BGMF@2Z*2F7S"&.+;H%7EP0?EP?1+%+R.SC6_G@GNAG?)!"8
+<< MD;DXPI9B.,?Q'UXZ4+86:>7MM(%\J5YX\1@;)'W;G'HQWOD]3N;U-%C86>F6
+<< M<=G86D%I:QYV0P1B-%R23A1P,DD_C0!8HHHH`****`"BBB@`HHHH`****`"B
+<< MBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`***
+<< M*`"BBB@`HHHH`X/7+/5-3\=7EO:1R7$$&F6K^6==NM/5&>6Y!($"L')"`$G&
+<< M-HZYXS_%_B+4IO"&LR2BT_L^^35--B@6)A+$T$-S^\:3<0X;[.WRA%QY@^8[
+<< M?F]($$*W#W"Q1B=T5'D"C<RJ25!/4@%F(';<?6J;Z%H\EY=7DFE6+W5W$8+F
+<< M9K="\T9`!1VQEEP`,'C@4`<'XB\1:E$=/\12BT?3]/U/41%8K$RRLUM;7J9:
+<< M;<1AO*8X$8QN`R=N6N1>)_%POK32KFPL8+ZYNTB62Y5$VQO#<.6\J*>4_*;?
+<< M()=0^64;,%Z[#^PM'_MC^U_[*L?[3_Y_?LZ>=]W;]_&[[O'7IQ18Z%H^F11Q
+<< M6&E6-I''*9T2"W2,+(5*%P`.&*DKGK@XZ4`:%%%%`!1110`4444`%%%%`!11
+<< M10`5R_B2V?4-1CM+"^ODU7R@T(AN6CALAD_Z1*JD"3)&%CDW!RF`%7S6'45E
+<< MZEX:T'6;A;C5-$TV^G5`BR75JDK!<DX!8$XR2<>YH`YNVU37G^)UO;7UC?6]
+<< MC):7JPQ"2$P%$D@V3G#EV8@\Y4;?,50O$CGF[>YN7\)ZCJ:7EW#/:^'$\06Z
+<< MP7#QI'=W+74\A*J0)$#*@"2;P`N.<MGTS6-&L];TZ[L[I,?:;2:S,R`>8D<H
+<< M`<*Q!QG"GTRHR#BI+S2=-U"XM;B]T^TN9[1]]M)-"KM"V0<H2,J<J#D>@]*`
+<< M,.SMGN?%#7FGWU])!!+(M[/-<L\,QPRBWBBSY8\L[=TBJ"#'L)=FEV\_I=L^
+<< MJ>'-'-C?7R:S?V@U(+!<M'!8/<.TSSNBD>8N]RJ12;]_EA>!YKCJ-0\$>&]0
+<< MBO\`.C6,%U?1312WL%K&LX\U65V#[<[B&;DYSGG-7-2\-:#K-PMQJFB:;?3J
+<< M@19+JU25@N2<`L"<9)./<T`>?ZYJVI:;H,_B"UU"[74);W5[9BTS/$(X([TQ
+<< M!86)C4J;>+Y@H)VG).YLW-6TV^3Q'_8>EZA.;6+[+=_9;S7+F%[AG2]5T6<;
+<< MY?\`EE$^P?+^Z8X&23WD>DZ;#JDVJ1:?:)J$R;);M85$KKQPSXR1\J\$]AZ5
+<< M7C\-:##I<VEQ:)IJ:?,^^6T6U01.W'+)C!/RKR1V'I0!7\/NM[X8\JW>[M75
+<< M[BV9WN6N9(I4D>-RLDNXN`ZL5+CIMRH^Z.?CN[Z7X8>$;X:C=I<.^CM/(KY:
+<< MX$DL*NKL020V\DX()Z$D$@]I]@L_[._L[[)!]A\KR/LWECR_+QMV;>FW'&.F
+<< M*IR>&M!FTN'2Y=$TU]/A??%:-:H8D;GE4Q@'YFY`[GUH`KZO=JIU&"]U&.UL
+<< M4M[=O]%=A=[GD=2N`"<2;51-@WEMX4AMI'/VVFWLFLZ=H^HW6I0V%S;WE[':
+<< M+J,HG@V-;(B/<(^]S^\E8C>5!DV@L$1J["\TG3=12=+[3[2Z2=$299X5<2*C
+<< M%D#9'(5B2`>A)(JG_P`(GX;_`+._L[_A']*^P^;Y_P!F^Q1^7YF-N_;C&['&
+<< M>N*`#PG?7&I^#=#O[R3S+JZT^WFF?:!N=HU+'`X&23TK8HHH`****`"BBB@`
+<< MKAOB/_R*VI_0_P`HZ[FN&^(__(K:G]#_`"CI,:/'J***^A/#/5O"?_(EZ=_U
+<< MTF_]"I/%_P#R(FK_`$3^M+X3_P"1+T[_`*Z3?^A4GB__`)$35_HG]:\"M_%E
+<< MZL]FE_#7HCT6BBBD4%5[]=^G7*[=V8F&W;NSP>,;6S_WR?H>E6*KWZ[].N5V
+<< M[LQ,-NW=G@\8VMG_`+Y/T/2@"Q1110!3C\Y+FY\N&,JTH+,Q*G[L8R/DYXW=
+<< MSR`,]ED5[P[=T$`Z9Q,3C[N?X?=_R'3)VENNV>[.W&Z4'.W&?D49^Z,_FW3K
+<< MQ@6*`.<\>#6#X)U(:"9EU#:FTP@EPF]?,V@$$GR]^-OS9^[\V*\D^%?B*\B\
+<< M;VFC:="?L-S&[7T:?/%&%BRDBXZ=(UW<`JZ*03MV>_5EZ3I6BV5QJ%_I-M:1
+<< MRW]PSW<UOC][*A*-N([A@V1_>+$\EB>B%?DI2IV^*WX'53Q/)0G1Y4^:VOI_
+<< M7Y_+G?%=Y]C\;:!_Q,K&Q\ZPO8O]+7/GYDM?W4?SKB1NQ^;H?E-;6E?\C#JW
+<< M^Y%_Z'+5[5;^SL;/_3+N"W\\^1#YT@3S)&!VHN>K'!P!R:HZ5_R,.K?[D7_H
+<< M<M<W4YC4N%W3VAVYVRDYVYQ\C#/W3C\UZ]><&Q5>X7=/:';G;*3G;G'R,,_=
+<< M./S7KUYP;%,057L%V:=;+MVXB4;=NW'`XQM7'_?(^@Z58JC965M]CMF:UB#B
+<< M-"28@""`O^RN/N+V'W1P,```K7HFN]2>U$[10Q0I)A"REF8N.2K`\!.F<<G.
+<< M>,58+*_TVXN98=6:2*?:P@ND>98V`P2C%\@$8R"2.,@#+$LU,7VD7YFTK0);
+<< M^*>%(V6T>&/RRFX#<)'3.0R@8SPI''%9[ZMXA?)_X0S5@Q[_`&FS_P#CWT_S
+<< MC'CU85_:N44S:'+U9O>'-7?7-%6]DA6)_/G@95.03%*\18>F=F<=LXR<9K%A
+<< M\?P7%C87/]D7UM_:'V:2T6[:(>?#+-#$9`8W?&WSXSM;:3N`'<B_X)L;S3_#
+<< M$<-_:O:W#75W,87=69%DN))%R4)7.UAT)KE-&^'VI6.G:9;_`&31M->S2S2X
+<< M-C*S#4&BN+>4RR_NDPX6&0+G?S,WS+R3ZT+\JN8GH!U;35MTN&U"T$#V[722
+<< M&9=K0J`6D!S@H`RDMT&X>M9Y\7Z#]MTNW74[1TU1)39W"3H8IFC=$**V[YG+
+<< M2``#/W6]*Y.;P-K=W8Z7ILYL4M='T];2WFAO95DNC'-:R*6Q&#!N%K@E6<H7
+<< MR-VWG4TCPMJ&DZI:ZK%!:"=GF2Z@?4+B<A)?LX,GGRAFD=1;+A2J##`9&S<]
+<< M`=)%KNCS?;O*U6QD_L_/VW;<(?LV,Y\SGY,;6ZX^Z?2J9\7Z#]MTNW74[1TU
+<< M1)39W"3H8IFC=$**V[YG+2``#/W6]*YM/!>L/8Z5;2O8I_85I%;63+,[?;/+
+<< MFMI0T@V#R<_9%&!YF/,)YVX;0L?#VL6WB,>(9$L3=7,LHN;1;A]D,<B6J%DD
+<< M\O,C`6@.TH@/F$;AMRP!J>%O%.F^*]&MKVRNK1YWMXI;FVAN5E:V9USL?'((
+<< M.1R!]T\5':>*ENY;ASI-];Z;;RW$4NISR6Z0)Y+.CL?WN\+N1ADK[G`YJOH/
+<< MAN\TO_A&//D@;^RM$?3Y]C$[I#]FP5R!E?W+<G!Y''7%/0_#VI:%J6H7,/A_
+<< MP^\]Q<7DO]HK=,EQ*LDKRQH^("<9**?G.`N0#@"@#J+S5M-TY)WOM0M+5($1
+<< MYFGF5!&KL50MD\!F!`)ZD$"LO2_&.CZIK5YI4>H6(NHI46VC6[1GNHV@CF$B
+<< M+U*X<C(R/D)SZ9<'A34M+ALQ8C39WL+W[="#NMEF9X9(7B;`?8B+(/+(W81$
+<< MC(&S>;#^'=2N;?46F-I%/>ZQ8:CL25G5%A%KYB[BH).8'QP,Y7.,G`!L-XET
+<< M%4O7;6]-"6#A+QC=)BW8L5`DY^0E@1@XY&*)/$N@PZ7#JDNMZ:FGS/LBNVND
+<< M$3MSPKYP3\K<`]CZ5Q?_``@^OSZQ:7=W/!(UOY?F7,FI3S&Y9;NUF9Q"R;+?
+<< M*V[_`"1DJ"RKT4$7-5L=0\.>(KOQ-!#'>FXN)(X[54N&.R2"U4LQAAE8$-:$
+<< M8VX(<?,#P0#K$UW1Y+RULX]5L7NKN(3VT*W"%YHR"0Z+G++@$Y''!JG?^(I+
+<< M769-+M-$U+49XK>.XE:U:!519&D50?-E0DYB?H#VKC_#O@'4+*'2_MD,9&RP
+<< MGN`^I7"BWE@A@0I]GC/E2G=`")"W!8?*P0!NHO/"&FZMXJN]4U?3--U"![*W
+<< MMX%NH%E:-D>9G(W*0`1(G0\[3GH*`+&L^*=-TJRUAHKJTNM0TNREO)=/6Y42
+<< M[43=\R\E0<KR1_$*+WQ3IMMXBT[0HKJTGU"ZN#%+;+<KYL"B"27>R<G'R*.<
+<< M??!SV/-ZQX+UC4M)N]'C>Q2U674+JVN6F??))=1W"A'CV815-T?F#,3Y8^4;
+<< MOE-5\%ZQJ=J=%WV,6F&[U"Y^V^<[3?Z5%<KM\G9M^5KGKYG(3/&<``ZR'Q+H
+<< M-S9&]@UO39;0.R&=+I&0,J&1AN!QD("Q'8`GI6I7!V7@BX;5K#4+VTM$-O>Q
+<< M3R1RZE<Z@Q6.&X5"))QP1).&"A1MVEMQ)`7O*`"BBB@`HHHH`\P\4?\`(@R_
+<< M]@^'_P!`2NVBAA>_U-Y8HV(N%Y=0<#R8_6N)\4?\B#+_`-@^'_T!*ZK7='MY
+<< M+[[4WB>^T?S1S'#)`J2,,#=^]C8YP%'!QP.,\GBQE)U*=DTK/J7%V8_4+*P:
+<< M*9C8VN[:?G,*YSSWQ_G\\8.C7&K:IIW@FS77+ZS^U>'VO+F:%8I))I%%J`6:
+<< M5'_YZN3W)/6KUOX4^WVPFMO&^M7,!+*'C:S=25.UAD08X((/TQ6D/!ND_P!G
+<< M:39LU]_Q*K06=M-#?2V\GEX0$,T3)NSY:$]LCH*,'AI4;N5M;#G).UC'3QU>
+<< M+8WLS:=!/_9$4TVIR"<Q9CCFGBW0IM;<S?9I&V,R@94;VR2-"3Q1?BQU#4H-
+<< M&^T6%O+);0^3+))<22I-Y+;HDB;;&&#L64NVQ<["3M&A=>%M&O/($EGLCAB6
+<< M`0P2O#&\2_=BD1"%DC&2`C@J`S#&&.1_#&FM+=2(;Z#[5DR);:A<0H"6#EE1
+<< M'"HQ89+*`3ELD[FSVF98T34O[7T>"^\RQD\W=\UA=?:83AB/EDVKNZ<\#!R.
+<< MV:T*KV-C;Z=9QVMK'Y<*9(!8L22269F.2S$DDL22222235B@`HHHH`****`"
+<< MBBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`**
+<< M**`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@#A]>OM<D\97-AI\FN&UA
+<< MT^VFV:4MC\KO)."7-SSR(UQM]#GJ*K^*?%]XOAG69(;7[-:RQ:A9V5Y%=$3K
+<< M<013EF9`H"+FWDVL'8_<X&3M[A+&WCU&:_6/%U-%'#(^X_,B%RHQTX,C_G["
+<< MLNY\(:'=O=-/:22)=)*LD)N)?*'F*5D9(]VQ'8,^74!CO?GYCD`YO7/%]Y;W
+<< M.GZJ;7RM"M-0O4E>*Z)GG^SVUV'5HMH7;OA8KF0YVH2`3\MBW\=:G.UO;GPS
+<< M.+RYNUMH@QFAA.Z*:0-OGAC8[?).\!#A6!&]ODK<E\(:'/?_`&R:TDD.^1_(
+<< M>XE-OND1DD/D%O*RPD?)V\EV)Y)-26GA?2;.>&X2&>6XAE\Y)[F[EGD#!'0#
+<< M?(Q8J%EDPI.T%V(&3F@#8HHHH`****`"BBB@`HHHH`****`"N7\97&K:;ITN
+<< MK6-]/%#:1&0Q111&,%0S-)<%\N80%4%80),%L;B1MZBLO4O#VF:M<+/>02,X
+<< M01N$GDC69`20DJJP$J<M\KAA\S<?,<@%>RO+Y_&NL6$]Q&]G%96<]M$L6TQE
+<< MVG5]S9)8DQCT`&!C.2>+@U[66\.7VJQ:I/%]CT0>(8X=J2"4W#W,P@E9U+&-
+<< M%C2,;"AQNZ?*%[34/#,%T^KWEG=7=GJFHV1LS=I<RL(AM(1ECWA05)+#`!R6
+<< MY&XDR77A;1KSR!)9[(X8E@$,$KPQO$OW8I$0A9(QD@(X*@,PQACD`P]*N=:@
+<< M\2B/7+K684N+VYCLXV6R-I.H,C1(I0&8'R5W98KRA!/(!IVEWK-UX<TF]LM:
+<< MG&H:G$U]96`C1PQE<S;9W<,WV>)9(T)3RS@8&6>-!T&H>$K*YBOY+*2>ROKF
+<< M*989TGD9+66164S1Q;@B299B64*QW-S\S9DN?".CW-Q'.L=W:O';QVJBPOI[
+<< M11$A8HFV)U&%WMCCC-`')ZMXIUG2M)GU^.\\[?=ZG:K82Q)Y$8MH[ID92H$F
+<< MXFU3=ER/G?`'R[="ZUS5/#VHWVE&>^U=A%:R174EEYSP&4W`9G2VC4M&H@&`
+<< M%R6?!90=R=`?"VC->37,EGYOF[RT$LKO`"X(=EA8F-68,^Y@H)WODG<V;&F:
+<< M+9:1YIM5G:27`>:YN9+B1@,X7?(S-M&6(7.`68@9)R`9_A34KS7/`.DZB9L7
+<< M]UI\;M-/;D#SB@RQ3Y<KNR>,`CH<$&N?2^\4:GX>\)7]M)JLD=UI0FOWTQ;(
+<< M2-.R0E"1<?*%.9ON]\=J[2#2[2UT:+2;=)(;.*W%M&L<KJR1A=H`<'<"!_%G
+<< M/?.:SU\(Z.FEV6G11W<4%BACMGBOITEC0XR@E5P^SA?E+8^5>/E7`!GW]_K%
+<< M_P"&$D\/&[N4DM[&>VU&-H!/<H\@\["2*J*XB&[Y@`3)@`;:QVN?$D[P1V5U
+<< MXGF2W>>/48U73!=03%8&A1BP$13RV=LH6.7`)XP.P?PYI#I*GV&-$DMX;8K$
+<< M2@2.%F:()M(V%&=BK+@@X(/`Q7/A'1S;I$([M'1V?[3'?3I<,6`!W3AQ(P(5
+<< M!AF(PB#^!<`&AI-S#>Z-8W=O=27<$]O')'<R*%:964$.0`H!(.<8'7H.E7*C
+<< M@@AM;>*WMXHX8(D"1QQJ%5%`P``.``.,5)0`4444`%%%%`!7#?$?_D5M3^A_
+<< ME'7<UPWQ'_Y%;4_H?Y1TF-'CU%%=/'IEJ?#UO</:6P1K*6::Y$Y\Y9!)(B8C
+<< MW_=+"-2=A'S'D=1[\I*.YXL8N1U_A/\`Y$O3O^NDW_H5)XO_`.1$U?Z)_6K'
+<< MA^TDLO".F12%2S!I1M/&'"N/QPPJOXO_`.1$U?Z)_6O"JN]67J>Q3_AKT/1:
+<< M***0PJO?KOTZY7;NS$PV[=V>#QC:V?\`OD_0]*L57OUWZ=<KMW9B8;=N[/!X
+<< MQM;/_?)^AZ4`6****`*<?G)<W/EPQE6E!9F)4_=C&1\G/&[N>0!GLLBO>';N
+<< M@@'3.)B<?=S_``^[_D.F3M+==L]V=N-TH.=N,_(HS]T9_-NG7C`L4`<YX\&L
+<< M'P3J0T$S+J&U-IA!+A-Z^9M`()/E[\;?FS]WYL5Y)\*_$5Y%XWM-&TZ$_8;F
+<< M-VOHT^>*,+%E)%QTZ1KNX!5T4@G;L]Q&K6)OA9^>!,S%$#*0KL`255B,,P"M
+<< MP"3\K?W3B#2]*T73[_5;C2[:TBN[JX#W[0XW-+L!&_'0[6#8X^^6ZL2>B%?D
+<< MI2IV^*WX'53Q/)0G1Y4^:VOI_7Y_+)\03PV?B[2;BZEC@@DTZ]M4DE8*K3/)
+<< M;%(P3P78(Y"]3M..AJ]I7_(PZM_N1?\`H<M7M5O[.QL_],NX+?SSY$/G2!/,
+<< MD8':BYZL<'`')JCI7_(PZM_N1?\`H<M<W4YC2NE0W-B6"Y$Y*Y/?RWZ<CMGL
+<< MWT[BU5>X;;/:#=C=*1C=C/R,<?>&?R;ITXR+%,13N[\VUQ#;I:3W$LJ.X6(H
+<< M,!2H).YA_>%4]%U&*6WL;6*VD2)[0202AHVCDC4*,J5=^/F4C)/'<TW6[)[N
+<< MY@S;7DT!@DCD-G<^1(I+QL,.'1A]P]#['@UD^$=!_LJQTFTC2^:VM;+8;F>Z
+<< MWB5_W."@$K[$/ED[`=H!QW-`&Y>S7<M^UI;2^2L<2RNZD;F+%@!RK#`VG/&>
+<< M1TP<U+9M<LKFY,UQ;7MO)M:%9G\N2(XPPRD>&4G!'`()/)!`%?4[Z/P_J;2O
+<< M9ZI<Q7$$:(UM;3W>"F[(;:&*\,O7&>3R<UGR>+[=P<:7K^??1+O'_HO_`#^>
+<< M?'JRQ*JMQO;T_I&T(Q>YTVB:O%KFEK?11O&#++"R/CAXY&C;'J-R'![C'`Z5
+<< M0A\;>';C1]+U:+4-UCJMVME92^3(/-F+,H7&W*\HPR0!QUJ'P#'-%X3C\ZWG
+<< M@9[R\E$<\31.%>ZE9258`C*D'D=ZYVP\!W%IH.CS>1_Q,HXM)2:WWC]T\4ML
+<< M;E]V[#92VA&!T\GY<ESGUH7Y5?<Q/2*Y^;QMX=M]'U35I=0VV.E7;65[+Y,A
+<< M\J8,JE<;<MRZC(!'/6L_P?IFRZFG\[S;'3/-TK2_EV[(5E_>#KDX*1P_-DG[
+<< M+O!_>&L>_P#`=Q=Z#K$WD?\`$RDBU9(;?>/WKRRW)MGW;L+A+F88/7SOFP4&
+<< M*`](J,S*MPD!$F]T9P1&Q7"D`Y;&`?F&`3D\XS@X\_O-&UAA;Z6-+U(10:GJ
+<< M-\VH65Q`GR3QW901%I`XE!N$7+*`&!.<#)SXO"&L"*W\K1+2UM(TF#6T,4%O
+<< M)/"9[)FCF2-C$TLL<$ZDJ1&PVAM@)4`'JE%9^B0P6^CP16VD?V1"N[;8[(E\
+<< MKYCGB)F3D_-P3UYYS6A0`4444`%%%%`!1110`4444`%%%%`!1110`4444`>8
+<< M>*/^1!E_[!\/_H"5V\42RZEJ3N9"PF6,$2,,*(D('!Z99C^)KB/%'_(@R_\`
+<< M8/A_]`2NNU31M;FOY9M*UFTLX)L-)%<6#3DN`%R")4P,*O!![\\X''BZ4ZL$
+<< MH;W_`,RXM)ZC)M-LK1+N2T26"29C+*T5Q(F^3`&Y@&`)P%&3[>V<_3]<UJ?0
+<< M_`=PMS:,^KI"M\TUL69R;5IV9-KJ%)\MAT(^<''RX,C^'?%DBE7\2Z40>O\`
+<< MQ)W_`/DBKEMX2$&F^%[0ZK=J=`2,(84C5;AEB\HEPRL0"I<84C&\\Y`(6#H3
+<< MI7YO(<W%VL9=[XHUO2[JZM;M;&2;RED79;2QK;EI8DPI=LWN!-G]T$)9`F%:
+<< M5`*__"=7PBCL2N;^264+=II%S(!'&L3,S6:DS1MF=4"NR@@>9NPR*VY)X-MK
+<< M@EKO4M2NGC0)9O-(A:S`D20;&V9<AX83F7S"?+&<Y;<#P?%&XNH=7U*+5"[M
+<< M+J2^2990ZQJRLIC,0&(81\J`_NQSRV[M,SH()X;JWBN+>6.:"5`\<D;!E=2,
+<< M@@C@@CG-257L+&WTS3K:PLX_+M;6)(84W$[44`*,GDX`'6K%`!1110`4444`
+<< M%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4
+<< M444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`'%Z_P")=4L_%4VEVD\<
+<< M$$5E!<;AH=UJ#,SO,I!\AP$`$0QD<Y/I1XD\:BUT'69+*"[@>.WO([+4&2,Q
+<< M274$<K,BKN+Y4Q2<N@4^6<$Y7=U$>FPQ:S<ZHK2>?<6\-NZDC:%C:1E(XSG,
+<< MK9Y[#IWP[[P+8:A%=VT][??89_M+):*T82"6=9%EE0[-Y8B:7AF91O.%X7`!
+<< M3U?QJ+74=/D2"[@T>.]N8[S4&2,Q2+!;W#2(JAC+E9(NNP9\LX)!&XL_B9HU
+<< M^$2UMKNXNGN%MUMK5X+EBSQRNA+12,@!\EQRPVX!;:IW5<N_`MA?3E;B]OGT
+<< MTRW$W]F[HQ#OG25)3N">;\WGRG[_``6XP``+D'AH+=6=W>:MJ5_<6EQY\;W#
+<< M1@?ZJ2/;LC14`Q,YR`&)VY)"@``W****`"BBB@`HHHH`****`"BBB@`K'U;4
+<< M[RQUK0+6&&!K74+N2WN)'8[TQ!+(NU0,<F/DD\8Q@YRNQ67JFBC5+_2KLW]W
+<< M;G3K@W"1PB/;*Q0H0^Y&.-KNORD??)Z@$`'/VOC&9_%EOID]UIH>YO;BS&E@
+<< M%;NW6-966=R7^9'6(,!Y:\3(=QQ\V?%XPUIM$N]4B>T:"STS^W62>$L\]M,\
+<< M[PP@JRB)UBB52Q$@RW0[<MU&K:+=W(OKRSOY#J0MY!I@N0A@LIC&5#J`F22>
+<< MI;>0"P7`9@:]SX*TV:WCM+>>[L[/[%'IT]M"ZE;FU0,%B<NK,``\@W(5;YSE
+<< ML@$`%RSU.\F\6ZKI4T,"6MK:6MQ;NC$N_F-,K;L@`8,6`!GUSSA>?BU[Q`WA
+<< MRPUB"6QE6^W7%G:RPLT]X)7>2&W7:56)EAV!G/F`?.S?+&6;8O\`0;T7FM:M
+<< MI>JSQZG>Z?\`9;>.81F"%T#&)N(RW#NY.2V=YX.%`C?P?%%<6DNF:OJ6F):6
+<< M26,$5OY,BI$IZ#SHW()PH8@C=L3.=HH`Q]1\:ZEI=E/K4L%I/I_VB_M8K-49
+<< M)5:U2X;>TNXA@WV5OE$8QY@Y.WYK%YXQF\-W%W8Z_=:;+<JENUM<*#90.TQF
+<< M`1R[N$"BW=B^XY!PJE@`^A-X*TVZ>:.ZGNY]/D>>1=/9U$4<DZNLKJRJ),L)
+<< M9>"Y`\PX`PNW0TK11IMQ<7<U_=ZA>7")&]S=",-Y:%BB`1HBX!=SG&?F.20`
+<< M``5_#>MS:_X*TW68/LDUW=622E$D*Q><5^9-PW%0'RIX8C!X)%<WK'Q&_LCX
+<< M>:7J\OV%=9U'2OML$,\OE0EA$KOC)RW+J%0$LQ8#@;G7L+#24TSP];:-9W,\
+<< M<=K:):PS_*9%"H%5N5VEA@'E<9[8XJG#X7MHO!1\*O=W<UF;)K'SG*"41%2@
+<< M&54+D*<`[>PSDY)`#4?%>FZ987.H3&0V$-O!.EVNWR)_.=D14D)"YR%R20H#
+<< MJ20"2,/3O%M_K7A7^UK;4-#MO)N[F"YFC$EZ@*3%(HXT1D9V=2A!R"V5VH?,
+<< M&WL$M=FHS7GVB=O-BCB\EGS&FPN=RKV8[\$]PJ^E8<W@^)C:M::OJ5D]M<75
+<< MRC0^2_SW$A=SB2-AD;G52`"%9AD[CD`W+":XN-.MIKRU^R74D2/-;^8)/*<@
+<< M%DW#AL'(R.N*L5'!&T-O%$\TD[H@5I9`H9R!]X[0!D]>`!Z`5)0`4444`%%%
+<< M%`!7#?$?_D5M3^A_E'7<UPWQ'_Y%;4_H?Y1TF-'CU6DU"ZC>V99<&V0QQ?*"
+<< M`A+$J1CY@2[9!SD$CIQ56BOH6KGB7L>L^%Y))?!NG-([.P:506.3@$`#Z``#
+<< M\*C\7_\`(B:O]$_K2^$_^1+T[_KI-_Z%2>+_`/D1-7^B?UKP*W\67JSV*?\`
+<< M#7H>BT444B@JO?KOTZY7;NS$PV[=V>#QC:V?^^3]#TJQ5>_7?IURNW=F)AMV
+<< M[L\'C&UL_P#?)^AZ4`6****`*<?G)<W/EPQE6E!9F)4_=C&1\G/&[N>0!GLM
+<< M?5+K4+;1KRXCB@26.W=PPE)VD*#GE.<?-]=H_O';<MUVSW9VXW2@YVXS\BC/
+<< MW1G\VZ=>,"2>".YMY;>9=T4J%'7.,@C!'%`'C7BUIM+76MEO>!-)M%GLKUKP
+<< M$-*C`Q@Q^2%.QH5;!8X!'_/1JY?P?XAU32?'&F6=E%,]]>7:6]_&P8^;$9#Y
+<< MCNI^?>I\UCN^9&63<2"V_P!2;P%X#GNCI\D%XSRDQ!)-2O-DIPQ*`F3:QPKY
+<< M4$GY6_NG'5VNE:*OB"^UBUMK3^UG1+6[N(\&3"@,$;T.UD/J1LSD!<=%*O[.
+<< M$X6OS(ZJ&)]E3G#E3YE;T,GQ!/#9^+M)N+J6.""33KVU225@JM,\EL4C!/!=
+<< M@CD+U.TXZ&KVE?\`(PZM_N1?^ARU>U6_L[&S_P!,NX+?SSY$/G2!/,D8':BY
+<< MZL<'`')JCI7_`",.K?[D7_H<M<W4YC4N`QGM"#(`)23M)`(V-][`.1TZX&<<
+<< MYP#8JO<+NGM#MSME)SMSCY&&?NG'YKUZ\X-BF(*AM&=K.!I"Q<QJ6+#!SCG/
+<< M"_R'T'2IJHV5O(+.VQ<2Q@1I^["*`N`O&-@(^Z>P^\>!QM`([V]NA=_9;-%W
+<< MI&LDDCJ&`#$@`#<O]T\YXP.#GBK:ZCK,-Q=+?Z>LUN-K6\UJ40XQ\RNK2'!!
+<< M&0P/(;&!MR:6J:WIGAK5W;6=6BMUN+>(0O=R)'O*%]P7@`_>4GT+CH,8SY?B
+<< M!X3;D>)-))'0?:T_GGV_SV\>K7K1JOE;-H03W.MTS4[;5[!;RT9FB+O&=RX*
+<< MNCE'4_1E8<<''!(YJ--=T>2SM;R/5;%[6[E$%M,MPA2:0D@(C9PS9!&!SP:Q
+<< M/AS-%<>#8YH9$DBDOKYT=&!5E-W,001U!KDM-\&WEKX5\.RM#.8[?^R9X[`J
+<< M<VUP9K?[2YCV_)M6/=GJ#+<EN&KUH-N*;,3UBLM/$N@R7%W;IK>FM/9([W4:
+<< MW2%H%0X<N,Y4*>"3C'>L?PJFI2WLHNKV2>TTE'TV&02LWVM@X)ED)X=U18D+
+<< M#&)?M(QC%<_<Z#KTGA/6;G[1)&]G<:Q=Z9:VUH\=UYSM=(C>9O.X%9690J*<
+<< ME""<?-0'I$T\-L@>>6.)"ZH&=@H+,P51SW+$`#N2!4E>;ZG8S:A::E#>QZY)
+<< MJBZ@DTP1KH0BSCODD4P[?W7F"!4(\K]Z2#_'NJQ->WUKYUC;IKC?:M5TV:P8
+<< MP7,FVS'V42!Y"#Y?W)]ZR$-RQ8?-D@'H%%>5RV'B"+PKX7%SJ6LHLMEYNI2R
+<< M0W=Q.+HI"$0I;/'*H"B4==N1EP78,=C21K*^+K%;^34M0D%O&)WD2>SCL\6X
+<< MW$JA-M<%Y">%)9"_!=4^0`[RBBB@`HHHH`****`"BBB@`HHHH`****`"BBB@
+<< M#S#Q1_R(,O\`V#X?_0$KLI;.+4M0O3=8E$,HBC5T1@B^6C'`8'!)8Y/?CT%<
+<< M;XH_Y$&7_L'P_P#H"5U>IV_B2'49WT>VTN>VG(D8W=W)"ZMM52`%B?(P@.<C
+<< MJ>.`:XL92G4I\L%U+BTGJ,BTQ-&MKE--O;JWC=WG\E?+:-7/+;05.T$@D@8&
+<< M2Q[DU2M?'$PM_!S7EC&1KMDMQ=7$<A5;9F$*J`F"6#2W$:=?ESD\`D++;^-I
+<< MD96TW0,-U(U2;G_R7_S^`J?3_!B_V-HECJDD<R6>A2:1=0Q[MLPD6`.0^00/
+<< MW)'0'YL\8I8*G5IW53RMJ.;CIRAHOCF#5--O=0FL+N*WAO?L]N;6"6[:>)HD
+<< MFBF*1H60,DBG!'RY`)SQ5BR\4+J/BR/3+.2TGLS;SRF:%V<L56T="#@+@K=$
+<< M\;@1M.X'*BGJW@?^T;Z\N_M%C/\`:;LW'V74K#[5;#,,,63'O7,@\CY7SP)'
+<< M7!SFJ^B>#I?"#0ZA#+/JLEM:?9A;01)&\F8K.'<"\@48^R;L$_QXZK\W<9G4
+<< M:EK>G:1O^W7'E;+2:];Y&;$,.WS&X!Z;UXZG/`/-8^N>-K+1KIH$7[3)%*D4
+<< M\2"0R(6EM5.U50[\+=HV`<DX4`DDJ2Z>?$^HV-Y?Z/?:8VG2A\7;0M]H3(DV
+<< M#RI6VXEA@DR?^>87D,U9\?PXM[=8/LM[Y36^\Q9B+#*RVSVX8%N5C2SAC(!!
+<< M<`G*L2:`-#3?&5K<ZUJ%A=+/`L=W%#;2/8SQH5D@AD59)&7:DA>4J$8JW*C&
+<< M2,]!?7UOIUG)=74GEPI@$A2Q))`5549+,20`H!))``)-89\+S2V]ZMQ?QM/>
+<< M:G9ZC(\=N54-`+?*A2Y.&-OZG&_OCF.^GO\`Q#9R:5-X6GMHY\9EU:&UNK9=
+<< MI#?/$EQN;I@8Z$@]!0!H+XHTDV=Y=/-/#'96GVVX$]I+$\<.9!N*,H;_`)8R
+<< M<8SQG&",QQ>+]#EN)X3=R0B!YD>>YMY88"T182!974(Q78Y(5CPC'HI(RQX2
+<< M?[5X>M[B2>]CL?.FN+V>=G9CYL<J0@,Q?;YJQNK%F*K;!"6#DF2^\#PZCHT>
+<< MEW%]((/MM]=2-'&`S+=+<J4&20"HN?O8.=G3G@`Z#3=3@U6W:>WCNT17*$75
+<< MI+;MG`/"R*I(YZXQU]#4=UK5E8ZC!97+3QR3;0DAMI/)RQVJIEV^6K$\!2P)
+<< M)4`989IF\US2[=%N["36YY'8[]+ABMEB4`8#+/<9))SR"?H.^'=^#Y?$&K6^
+<< MM3106<GVNWNC'J-DD]Y;^3(A\N*9)2L<;>7G:-W,CGJV``;@\7:.UN]PDEV\
+<< M0=4C9+&=OM!8$CR,)^_&U6;,>X;1NZ<U(/%&DF\AM3-.LDNP9>TE5(V<`I'(
+<< MY7;'(=RX1RK?.HQEAG+M_"FI6NFZ=9PZM:8T=XSI3/8L=BK$\.)\2CS28Y#R
+<< MOE_,,XQ\M2/X6O)KQVFU.`VMU=VU_>QI:$.]Q"(MIC8R$)&3!'E2KG[PW<@J
+<< M`7+CQ?H=K865[)=R&"^MUN;;R[>5VEC9XD4A54MDM/$-N,_-TX.*Z^--/DUG
+<< M3K"&*[D%ZDV6%K,)()(VA`62+9NC!$P;<^T`;3T8&LM/`5YOTJ&768&L=(BB
+<< MM[*-;(K)Y<=Q;2CS'\PAF(M57(51EB<=JU%\+S0>)YM=M;^-9YKAF>.6W+KY
+<< M+QVR.@PX(?-JA#\@;B"K<&@#I****`"BBB@`HHHH`****`"BBB@`HHHH`***
+<< M*`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`./\0^-_P"Q
+<< M/$+:3G0X=MI%<^;JNK_8]^]Y%VH/*?=CR\DY'WA5C7_&=EIVDZR]E+OOK*TN
+<< M)(3+;R""66*-F,:R8".P*-N16W#8_3:V-B'3/*\0WNK>=G[3:06WE;?N^4\S
+<< M;LYYSYV,8XV]\\<WJ?@2;4[*[TUM5C33W>]GME%J3+'-<I,KEWWX=!]HE(4*
+<< MI^YEC@[@"YJ7C.RM-:T^RBE_<O=RQ7EU+;R+!&D<$TC[9R!'N5H@&&XXPX(!
+<< M!Q8?QKH,42O/=3V[/*(4AN+.:*9G9790(V0.=PC<+@?,RE5RW%9>H>!)M2!L
+<< M)M5C713<7EQY"6I%QNN8YUD'FE]N`;ER/W?0*#G!)DTGP,FFWUG>`Z5;R6]V
+<< M+AH],TI;2.0"&:(`@,S%OWY.2Q&%`"@EB0#L****`"BBB@`HHHH`****`"BB
+<< MB@`K#U_6K[1D:YATR.XLX4#S2/<['<EL".!`K&24G`"L4!+H`Q).W<KG]6T;
+<< M6+O7(-1L=4L8H[>+;%!>6#SB*0[@TBE9D^8J0N2"0`P!`=@0"O9^+_M?BAM'
+<< M^RP#][)#Y:W6Z[BV!OWLT&T>7"VWY7W'/F1<#?QGQ^.KPZ9<:@-.@GM;6T;5
+<< M)Y//,1-BTDWD/$NUM\C10EBK&/!*C(R0MB\\-ZI8Q37.FW,%U]AEN]2TRS>#
+<< M:[7<JS?+)*9`K1[IY,`*A'RY;@EBX\"[=._LVPU'R;&;2H='NQ/!YLCV\8=5
+<< M,;!E"28EDRQ5QG;\HP00#07Q%<+XHCTBXL8$6?>8@EV)+E44-^^DA"X2%BA`
+<< M?>>6C!`+$+GKXLU0:#'K7]E03V#[YUE%QY;S0-*PMQ#'AB\SQ^6=C&/+2*H.
+<< M20EC6-)UUFDO[>]@O9-/\^[TNT>V".UP8I$1))-X5HQYK``*A^[ER02T?_"*
+<< M:E9/I*:3JUHEII=E':VT.H6+7!1E4H904EC&]DPN2#@!MN`[`@$=YXZ_LZ*;
+<< M4+O3O^)0LMW;Q2Q3[IVDMEF:3=$5"JI^SR[2')/R9`R=M?5O'=YH<\=EJ5AI
+<< M5K?-+$"\VJE+1(Y$G96:9H00V;9UV[,?,GS<D"Q>>!?[1BFT^[U'_B4-+=W$
+<< M444&V=9+E9EDW2EBK*/M$NT!`1\F2<'=<CT+6DN+G4CK5H-6F2&'?'8$6YBC
+<< M,A"M$92Y.9G.5D7D)Q@,'`-2QOKBXT.._DMX)9GB,J16%R)TE')7RY&"!MPQ
+<< M@G:.>N.:P[SQQ#9^!;7Q$;&26YN=,_M"/3XI`6VB(2/EB``B@C+D=P`"S*IV
+<< M-,TJ;2M$>S@N8VNW>><SO$2GG2NTC'8&!V;W.%W9Q@;B>:PYO`-G?^`;;PWJ
+<< M@L;VZM-/:QMK][$$P938LBJS,58`(3AADKGC@``Z"[U/9+=6=E#]KU*"**7[
+<< M,6\L;9&949G(P%RCDXW,`IPI)`/-S?$&&W\*WNK&SCN[FW29XX;"Y$T-RL2!
+<< MWDCF*J#$H8*SE1AP4`9MH;H'TR[B26'3KZ.RMUMX8K.W2U0I;M&S$\<;D92B
+<< M%1MP$.TJ3D8=_P"`;/6=%U:#6!8WFIZCYKB]-B-MM(T*0AHD9F9<+%&3\^2P
+<< M)R.``#L**C@@AM;>*WMXHX8(D"1QQJ%5%`P``.``.,5)0`4444`%%%%`!7#?
+<< M$?\`Y%;4_H?Y1UW-<-\1_P#D5M3^A_E'28T>/4445]">&>K>$_\`D2]._P"N
+<< MDW_H5)XO_P"1$U?Z)_6E\)_\B7IW_72;_P!"I/%__(B:O]$_K7@5OXLO5GLT
+<< MOX:]$>BT444B@JO?KOTZY7;NS$PV[=V>#QC:V?\`OD_0]*L57OUWZ=<KMW9B
+<< M8;=N[/!XQM;/_?)^AZ4`6****`*<?G)<W/EPQE6E!9F)4_=C&1\G/&[N>0!G
+<< MLM?5+K4+;1KRXCB@26.W=PPE)VD*#GE.<?-]=H_O';<MUVSW9VXW2@YVXS\B
+<< MC/W1G\VZ=>,"2>".YMY;>9=T4J%'7.,@C!'%`'C7BUIM+76MEO>!-)M%GLKU
+<< MKP$-*C`Q@Q^2%.QH5;!8X!'_`#T:N7\'^(=4TGQQIEG913/?7EVEO?QL&/FQ
+<< M&0^8[J?GWJ?-8[OF1EDW$@MO]2;P%X#GNCI\D%XSRDQ!)-2O-DIPQ*`F3:QP
+<< MKY4$GY6_NG'5VNE:*OB"^UBUMK3^UG1+6[N(\&3"@,$;T.UD/J1LSD!<=%*O
+<< M[.$X6OS(ZJ&)]E3G#E3YE;T,GQ!/#9^+M)N+J6.""33KVU225@JM,\EL4C!/
+<< M!=@CD+U.TXZ&KVE?\C#JW^Y%_P"ARU>U6_L[&S_TR[@M_//D0^=($\R1@=J+
+<< MGJQP<`<FJ.E?\C#JW^Y%_P"ARUS=3F-*Z`-S8_,HQ.>"JG/[M^F3D?\``<G\
+<< M,D6JKW#;9[0;L;I2,;L9^1CC[PS^3=.G&18IB*]U?V=EL^UW<%OOSM\V0)NQ
+<< MUQGZBJNCWUG-9V]M!>6TTT<"[TB=,C``/RH2!SZ<"J>N7#VVHVK17]G8S-;3
+<< M+'->)OC!WPD@KO0G@'^(>O.,5C^#Y=1>UT2#4=5L[W4H=.(G:+YV3_CWW+(P
+<< MD;>^0_S@@$\[>.0#I[W47@G%O;P>=,%#N&+!54D@<JK')(.!CL>1QFG:Z].;
+<< MFYAO],N;81E3%-#')-',I'/1`58$$$$8P5()R0$\XV^M77VNXAW&V@P54IT,
+<< MF>"3WR?Q`]RLU]"0<2ICT##GV_S_`/K\>KC*L*K2>G]?/\3:%/F-2TO+:_ME
+<< MN;29)H6)`9#GD$A@?0@@@@\@@@\BIZYCX?\`_(I_]Q"__P#2R:N*\,:#J5KX
+<< M(TG5+#3[338WTRT2Y7279I[Z%W@:663;&C"585FV[2[YF;8P;&[UH.\4V8GK
+<< M$,$-LA2"*.)"[.510H+,Q9CQW+$DGN234E>-SOH.JZ[::1H/AOPC=01ZG%)B
+<< MTN$:WNU:VOMHF*0D*ZB,MMP^"PY[UZAX>TV;2=$ALYVC+J\CB.(DI"K.S+$A
+<< M('R1JP1>!P@^5>@H#4HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`
+<< M"BBB@#S#Q1_R(,O_`&#X?_0$KO9_,GN9E\UE6-@JA2R_P@Y.",]?T^M<%XH_
+<< MY$&7_L'P_P#H"5W%VU[;W<OD:?+<I(0X>.2,8X`Q\S#GC]16%52<;1[E((S=
+<< M644@6Z\U=Q=1,A8KGL&W9QGUSC./04]/$&FI;:8][>VEE/J2*;:":=5:1F"_
+<< M*@."QRP'`[CUJD\NI.I']BW0S_TUA_\`BZS-5\*:AJFBP6\;012CPY>:6RRN
+<< M?EFF6`*>`?E'E-D_3`-%%25^8)6Z'02>)=!ATN'5)=;TU-/F?9%=M=((G;GA
+<< M7S@GY6X!['TJO>^*=-MO$6G:%%=6D^H75P8I;9;E?-@4022[V3DX^11SC[X.
+<< M>QP]3\*:Q)K5]J.F2P6UY<W;/;Z@+MU>TC:"VC;,)C:.;)@)*/@<+AE8Y6OJ
+<< MO@O6-3M3HN^QBTPW>H7/VWSG:;_2HKE=OD[-ORM<]?,Y"9XS@;DG86.NZ/J<
+<< M4<MAJMC=QR2F!'@N$D#2!2Y0$'E@H+8ZX&>E1W/B70;.WCN+K6]-@@D2-TDE
+<< MND565PQ0@DX(8(Y![[3CH:YO4/"FL:Y>2ZI=RP:;?G[/#$ME=NXCC47$<D@D
+<< M,:D2>7=R[0%P'1"202!)9^"IK+Q%:W\4\?V>UO088RY^2U6"Y"H!MP"LMVZJ
+<< M!\HB2,=0<@&Q_P`)3IJ7MVL]U:0Z?;V5K>#4'N5$3K.\JK\QXQ^[&#GG>/QC
+<< MM?%EG<>$+[Q+LWV-I]K?-NXE\V."21=R'@'<(]PYQ\W7O7/V_@O6+'6GU>![
+<< M&::*[:Y@@>9T63=-?DJSA#LPEZIR%;+(1P"&K0A\-ZQ<>%;W0[R2QMX]2BU/
+<< M[2\+/,8I+B9GCV$A-RJLC[L@$D+CC-`&POBSPV_E[?$&E-YL3SQXO8SOC3=N
+<< M<<\J-CY/0;6]#4C^)=!CN+2W?6]-6>]1'M8VND#3JYPA09RP8\`C.>U8=UX>
+<< MUC5+V>^NDL;::;^S,Q17#RJOV6\DF?YC&N<HRXX'S9!P!DX?_"+Z]_:'B32(
+<< MK>T-IJUD\4M[),ZB%9KN^?Y%\LB1U2=2REDYP,X;-`'IE%%%`!1110`4444`
+<< M%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4
+<< M444`%%%%`!1110`4444`%%%%`&'?^(I+769-+M-$U+49XK>.XE:U:!519&D5
+<< M0?-E0DYB?H#VHUGQ3INE66L-%=6EUJ&EV4MY+IZW*B7:B;OF7DJ#E>2/XA5>
+<< M\\(:;JWBJ[U35],TW4('LK>W@6Z@65HV1YF<C<I`!$B=#SM.>@K#UCP7K&I:
+<< M3=Z/&]BEJLNH75M<M,^^22ZCN%"/'LPBJ;H_,&8GRQ\HW?*`=)>^*=-MO$6G
+<< M:%%=6D^H75P8I;9;E?-@4022[V3DX^11SC[X.>QL0^)=!N;(WL&MZ;+:!V0S
+<< MI=(R!E0R,-P.,A`6([`$]*Y/5?!>L:G:G1=]C%IAN]0N?MOG.TW^E17*[?)V
+<< M;?E:YZ^9R$SQG`DLO!%PVK6&H7MI:(;>]BGDCEU*YU!BL<-PJ$23C@B2<,%"
+<< MC;M+;B2`H!WE%%%`!1110`4444`%%%%`!1110`5GWVL6^GZGI=A*D[3:E*\4
+<< M+)$2BE(VD.YNB\(<#J>PP&(T*P]=L-2O-6\/SV45H\%C>M<7)FG9&VF&2+"`
+<< M(P8XE+<E?N@?Q9`!(OB!/[8CL)M/OK>.>5X+>[F15CGE569E4;O,'"2$,R!2
+<< M$R"05W5[/Q7;W/\`90DMIT;5;NY@M&C4O&R1>8RRE\`!72,.O7(<8R`6&?+_
+<< M`,))IEYJVM7.D6.HM%%<&U\B^D,WDJ"T<,</DD!G*IO.\DMSR%1%D'AW4K"T
+<< M\&6-D;2Y@T1T%S--*T+.JV[P910K`DB0M@L/N@9YR`#0M_%%M<ZHEH+2[2":
+<< MXEM(+U@GE33Q[_,C4!BX(\J7EE"G8<$Y7=3'C1%TPZC)I-\UBGG2RW4(5H8K
+<< M9)'59]S%=ZLB>8!&'.TC@[E+9]UI.L:1$US':P7EKI-W?:Q;+#*YGNY)5N"(
+<< M/+V83FX(#!G)V#Y1NPL@T#7M.M]$TZUATW4]-TJR@B1+F[>UWW$8QYCJL4@8
+<< M`*A09`5LDAB$*@&A-XUTVU>:2Z@NX-/C>>-=09%,4DD"NTJ*JL9,J(I>2@!\
+<< MLX)RNZQ!XHMMEY_:%I=Z9/:)'));W(1W*2,RQE?*9PQ9D90H)8D8V\KGG]1\
+<< M%:EJEE/HLL]I!I_VB_NHKQ79Y6:Z2X78T6T!0OVIOF$ASY8X&[Y=!?"TNM:I
+<< M/JGB&".WG*0)!%IVH3`QF+S_`-YYRB)LL+EU*XQ@=3G``-RPUBWU#P];:W$D
+<< MXM;BT2[5/*+R!&0.!L3)+8/1<Y/`S6>/%D$^G:3<V.G7U[-JEH+V"TA\I9!#
+<< MA"68NZH,&6,$;B<MP"`2)/#>D7/AWP5INE)Y<]Y96218>X<H\H7D;V!8)NZ<
+<< M?*,`+@`5CP^%M0'@K0M+E@M!JFGVZ6AN8-0N(1$@4*75X@CN#L1C$2@)`^;Y
+<< M0U`'26VMZ=>:<M]:W'GPM:)>A8D9I#"X)1O+`W_,%;`QDD$`9&*SQXL@GT[2
+<< M;FQTZ^O9M4M!>P6D/E+((<(2S%W5!@RQ@C<3EN`0"1)IFCS:%;_9;""TE@M=
+<< M,M[2T>9BL\K1"0!97"D;,%,$*<%I#CD"L>'PMJ`\%:%I<L%H-4T^W2T-S!J%
+<< MQ"(D"A2ZO$$=P=B,8B4!('S?*&H`ZRPOK?4].MK^SD\RUNHDFA?:1N1@"IP>
+<< M1D$=:L53TG38=&T:QTNW:1H+*WCMXVD(+%44*"<`#.!Z"KE`!1110`4444`%
+<< M<-\1_P#D5M3^A_E'7<UPWQ'_`.16U/Z'^4=)C1X]1117T)X9ZMX3_P"1+T[_
+<< M`*Z3?^A4GB__`)$35_HG]:7PG_R)>G?]=)O_`$*D\7_\B)J_T3^M>!6_BR]6
+<< M>S2_AKT1Z+1112*"J]^N_3KE=N[,3#;MW9X/&-K9_P"^3]#TJQ5>_7?IURNW
+<< M=F)AMV[L\'C&UL_]\GZ'I0!8HHHH`IQ^<ES<^7#&5:4%F8E3]V,9'R<\;NYY
+<< M`&>RU]4NM0MM&O+B.*!)8[=W#"4G:0H.>4YQ\WUVC^\=MRW7;/=G;C=*#G;C
+<< M/R*,_=&?S;IUXP))X([FWEMYEW12H4=<XR",$<4`>->+6FTM=:V6]X$TFT6>
+<< MRO6O`0TJ,#&#'Y(4[&A5L%C@$?\`/1JY?P?XAU32?'&F6=E%,]]>7:6]_&P8
+<< M^;$9#YCNI^?>I\UCN^9&63<2"V_U)O`7@.>Z.GR07C/*3$$DU*\V2G#$H"9-
+<< MK'"OE02?E;^Z<=7:Z5HJ^(+[6+6VM/[6=$M;NXCP9,*`P1O0[60^I&S.0%QT
+<< M4J_LX3A:_,CJH8GV5.<.5/F5O0R?$$\-GXNTFXNI8X()-.O;5))6"JTSR6Q2
+<< M,$\%V".0O4[3CH:O:5_R,.K?[D7_`*'+5[5;^SL;/_3+N"W\\^1#YT@3S)&!
+<< MVHN>K'!P!R:HZ5_R,.K?[D7_`*'+7-U.8U+C?Y]IL^[YIW_>Z;&]..N/O<?C
+<< MBK%<?]@O)?,DL_#NAWZM<7!>:]N3%)N\^08P('R,`<Y]L<<[&CB:'3WCM;>#
+<< MRDN+@(ID*`8EEXP%.!PH^A/H`6(HGQA$-+M-1%OF&[C\V&.,2RR[3@\I'$Q!
+<< M&Y<XR!GJ>M5K7Q_975_%:K!*'9T1E>&>)E#NL8($L2`X9UR`<@9.#C%>?Z;X
+<< MUL],T72X97\F:V5X$F>VG>"XC(0!XW2(GG8,J0"#D'D&I;3Q!;ZEXMMK993<
+<< M7TDULJVL-I<J\8%Q#(SMYD2`*$C8Y]OQKIA"C*GS.6MMCDG4Q"K*"A[O<]:U
+<< M/0M'UORO[6TJQO\`R<^7]KMTEV9QG&X'&<#IZ"L__A!/!_\`T*FA_P#@NA_^
+<< M)JGXX34ICX?M]*O9+6[DU,E")61)&2VGE1)=O)B+QH&'<9QS@UAZ;K.L6/B'
+<< M4=5OWG%C<Q6-Y<V=P7_T"WE>ZC4JA.(F4)`\V3@;9CDX6N8ZST"QL+/3+..S
+<< ML+2"TM8\[(8(Q&BY))PHX&22?QJQ7+WNL:HO@E=4E3[#//+&6)BVO9VLDZ@N
+<< MZOD+)'`VY]V55D8D%11=VS>'6LK31YI_M6K78MA-J5W<7J0[8I9=VQY<\B,K
+<< MA67[P)SMP0#J**\[7QEKTUS.D1TU$M7@M)=UL[&2:6^GLO,4^8-J!HEDV'<2
+<< M"5WC[]#>,M>:+6+M#IJP:'9/<7436SEKMHI[J)PC>8!$&%KD9$FW?SNQR`>B
+<< M45YWXI\5ZDG@6[N(3'#//<:M9>9%N5HU@BO#&Z$'(?-NA)]S@#C%C6O$OBC2
+<< M+U[."TM-0>PLDOKVX2)((G5WE`7,MROD`+"<O^]ZD[1C#`'>45A^&M2U+5HK
+<< MZYO5M$@2]N;6V2$-N*Q3R1[W).`2%`VC^Z3GYMJ;E`!1110`4444`%%%%`!1
+<< M110`4444`%%%%`!1110!YAXH_P"1!E_[!\/_`*`E=O/+?75[<1V\YMXK=Q'\
+<< MA7+DJK$G<C<?,``,=#UR,<1XH_Y$&7_L'P_^@)73:AK:Z)JEY%/I^J3>>ZS1
+<< MO::?-<)MV(O)C4@'*-P2#T[$&N+&.I[/]W>]^A<;7U+-O<:WIT%P+R2TOPLC
+<< M/%(TABD$9Y"L%3!(Y`(`X`R,@DR6GBW2+H:`IFDAGUZW-Q8021G<ZB,2,"5R
+<< MJD*PZGZ9K!N/%<$T3J-+U_+`CG1+O`S_`-L_\_EBKI_A>^U'P_X3ADCDLWM?
+<< M#AA,TB?-:W8-G)"3&2"2KPEMIX^3#=<%8*59W]K?I:Z'-15K'::5K>G:W]M_
+<< MLZX\[[#=R65Q\C+LF3&Y>0,XR.1D>]7)YEMK>6=Q(4C0NPCC9V(`SPJ@EC[`
+<< M$GM7!V'AZ]\,>)9M0L-&GN=-B\RUMK:VFC,GE-;V*(W[UU&T&UD4Y;=G:<$$
+<< MD<__`,(5K?\`87V2/1?-OO\`A'_L<DU^ML_E.+'RA%:2J^^/,A^8.-AS(P*Y
+<< M^?N,SV"BN7\/:6;#6K^2[T3_`$^26X<ZUB%O/B>8O'%OW>;\J%%PRA1Y>`2`
+<< MN>HH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"B
+<< MBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`Q]0
+<< M\3Z;IFHFPG%])=+$LS)::?<7.U&+!23$C`9*-U]#5S5M2AT;1K[5+A9&@LK>
+<< M2XD6,`L512Q`R0,X'J*P[KPP-3\97U_=F^CM6T^UAA>TU":VW.LEP7!$3J3@
+<< M.GWO4X[UR^N>$]6O+758+71_^)G+_:+2ZIOB'VZ":*=8+??N\P[3)`-K@(OD
+<< M\'Y4R`>B7NI0V-UIUO*LA>_N#;Q%0,!A%)+EN>FV-AQGDCZBY7E^J^$]6NKX
+<< MK9Z/Y.L_:]0E_P"$BWQ+^[EAN5@7S`WG_)YL"XV87R^,A5)-,\"N;FQ1]+OH
+<< M=+&H++<6MV]I$-JVURC-Y5H%C*L9(D;)9G'RLH1?F`/4****`"BBB@`HHHH`
+<< M****`"BBB@`JG=:K8V5_8V%Q<QQW=^[I:PG[TI1"[8'H%')Z<@=2`;E<_P"(
+<< M8KV76O#4EKIT]U#;:@TUQ)&\:B%#!+%DAG!/,H/R@\*W?`(!J0:K8W6J7FF0
+<< M7,<EY9)&]S$O)B$F[9N[`D*3CKC!Z$9RQXST8*3++/'MEFCD_P!'=Q"(I7B,
+<< MDK(&6*,M&Y#N5!"L?X6Q3N[V?1?$OB/7;S3+L:7;Z/"PN4:(B0P&>1U5=^[.
+<< M)0!D`95N1P3AR^%M9L?#TVC1V?VN2_\`#5MHAG@E01V\L:3*SR;RK>7^^!!1
+<< M6;"M\H.`0#M(?$.F7&J'3HYY#/O:-7,$@BD=<[D24KL=QM;*JQ(V/D?*V*8\
+<< M9Z,%)EEGCVRS1R?Z.[B$12O$9)60,L49:-R'<J"%8_PMC+URXN[35AKMWI5W
+<< M%;:*D]S<3BY26":W6&7`AC+Y6<ETRQ1"`'3S"I&^N+#6-.T;1/#MSHEWJ6F6
+<< M>F0171L)8-MU*J[#$WFR1GRAM!(`/F;@#A0RN`=(?%.C+>36TEYY7E;PT\L3
+<< MI`2@)=5F8"-F4*^Y0Q(V/D#:V*[^--$CB5G>^61Y1"MN=-N1.S%78$0^7YFT
+<< MB.3#;=OR,,Y!KE]6\+:SJNDSZ!'9^3LN]3NEOY94\B07,=TJ*H4F3<#=)NR@
+<< M'R/@GY=UR_TF[UC5+C6[SPYJ014MHHK6/44M[M6C^T[I$:*7801<A<&1>-YQ
+<< MPH8`ZS^VK(:/_:DC3PVO0">VDBD)W;0HC90Y8M@*NW+$C`.1FF?%VCBW2427
+<< M;N[LGV:.QG>X4J`3N@"&10`R'+*!AT/\:YSY=+U>?P5!;S))+>07L-VD$DH:
+<< M7R8KM9DB+DX:41(J9+$%QDN02]9\FBZK)+?:W;V>I66J7MZ3;I#-;"2"%H((
+<< MV$Q?S(PA>V1B4$C@;<#EEH`ZR]UO3K'1UU:6XWV+^7Y<MNC3^9YC*J;`@);<
+<< M64#`.<U3/BW2EMTF9=2!=V5(#I=SY[;0"S"+R]Y0;E!?;M!8#.3BL=?"RV>B
+<< M?V4^E2:@+73-.M_M45XUL]T;=W8*@5LQNA&]3N`8R!2P`)!!!J\&C7%O<:/K
+<< M-Q87%P3!;1ZJ!?VT86/`:4S#<#(LS9$Q(5D7!!(0`["">&ZMXKBWECF@E0/'
+<< M)&P974C(((X((YS4E9^A6=QI_A[3+*\,!NK>TBBF-N@2,NJ`-L4``+D'``&!
+<< MV%:%`!1110`4444`%<-\1_\`D5M3^A_E'7<UPWQ'_P"16U/Z'^4=)C1X]111
+<< M7T)X9ZMX3_Y$O3O^NDW_`*%2>+_^1$U?Z)_6E\)_\B7IW_72;_T*D\7_`/(B
+<< M:O\`1/ZUX%;^++U9[-+^&O1'HM%%%(H*KWZ[].N5V[LQ,-NW=G@\8VMG_OD_
+<< M0]*L57OUWZ=<KMW9B8;=N[/!XQM;/_?)^AZ4`6****`*<?G)<W/EPQE6E!9F
+<< M)4_=C&1\G/&[N>0!GLM?5+K4+;1KRXCB@26.W=PPE)VD*#GE.<?-]=H_O';<
+<< MMUVSW9VXW2@YVXS\BC/W1G\VZ=>,"2>".YMY;>9=T4J%'7.,@C!'%`'C7BUI
+<< MM+76MEO>!-)M%GLKUKP$-*C`Q@Q^2%.QH5;!8X!'_/1JY?P?XAU32?'&F6=E
+<< M%,]]>7:6]_&P8^;$9#YCNI^?>I\UCN^9&63<2"V_U^3X6>$98VCDL;QT<%65
+<< MM4NB"#U!'F5O6>E:*=9NM>L[:T;4+A/LL]Y%@LPC8J4)'<,-I[_(`?N@#HI5
+<< M_9PG"U^9'50Q/LJ<X<J?,K>AD^()X;/Q=I-Q=2QP02:=>VJ22L%5IGDMBD8)
+<< MX+L$<A>IVG'0U>TK_D8=6_W(O_0Y:UKO_CSG_P"N;?RK)TK_`)&'5O\`<B_]
+<< M#EKFZG,6+K2=*:YA:73[0R32G<3#'ESM8G.X9/3/'.1Z9K0@@AMH5AMXHXHE
+<< M^ZD:A5'?@"H[AML]H-V-TI&-V,_(QQ]X9_)NG3C(L4Q'#V/@.]T.[N3H>M10
+<< M6,NWR[6[M&G\G&?NL)5]<<@G"KDDY);>>$M9UVP+2:YI\:W-N4W16$F55UQD
+<< M8N2I(&,'D?*.M;VN/(+VW"6]]=`6\K_9K*X$+R$/$`<ET7@,QY;U[UC^#M3N
+<< MM2L=%U&:ROK>2]T_S9(I;GS$D)\@^8@,KX3YVQDAL`Y&<9`.PD@AF>%Y8HW>
+<< M%]\3,H)1MI7*^AVLPR.Q([U3U+1K/5()HITV^?Y2SO&`&FCC?>(G)!W1G+*5
+<< M/!5W'\1K(UG7)(;G[.]S)I2HD<AE9(G9R^[Y>25`&PYZDGI@#YLB3Q"49%C\
+<< M374S.P7$=O:DC/?DC].?:@3=COJQX?"?ANWL[FSA\/Z5':W6W[1"EE&$EVG*
+<< M[E`PV#R,]*S/`>OWNO6&J&^9'>SOVMHW"A69/+C<%L<9S(1P!P!QG).=!KNJ
+<< MZ&;B?7Y=2:YCMS<36TGV86GDI)&+B>`QJ9=D2ON59"'92!@MDJ#.P32=-C1$
+<< M33[141(D51"H"K$VZ(#C@(QRH_A/(Q6>?"&@OKQUF73+26["((C)`C"%EDDE
+<< MWI\N5=GE9F(/)`/7DY>I>-WM-[0V$`M?M<UNE_>W+06@$6U',DHC?RF\TO&H
+<< M8`-Y9(;E0U-/&6JZ?I,UQ>6$=X\VL75CIYB>1FD$<UQQ(D4+,@5(<`J)"V`6
+<< MV\D`'6?V%H_]L?VO_95C_:?_`#^_9T\[[NW[^-WW>.O3BHU\-:"J62+HFFA+
+<< M!R]FHM4Q;L6#$Q\?(2P!R,<C-<V/'E_(ZA-`\I5BMO-%W/)!(LL]Q);Q`(T6
+<< M?++QAM[;6V.&V$_+6A?>(;BX\'27MJOV2^ENQI@8$2"WG:Y%JTBY'SJKDL`0
+<< M-P`R%SP`=)#!#;(4@BCB0NSE44*"S,68\=RQ))[DDU)7+PQ7NJWU_8VFL7VF
+<< M6ND2QV:>1Y<TDY\F.4O(\Z2$\2*H[Y5B6;<`LGB:]OK30=6U,126IT=_MD#+
+<< M-D7D4<:O(K`<`,#+%\P.T@.!D+@`Z2BBB@`HHHH`****`"BBB@`HHHH`****
+<< M`"BBB@#S#Q1_R(,O_8/A_P#0$KNKF^O9+N:&R1%6!@CO(@?<Q4-@#>N``PYY
+<< MSD],<\+XH_Y$&7_L'P_^@)71W_B?1-`U:_M]5U2TLIY95FC2XF6,NGEHNX9Z
+<< MC*L,C^Z:XL9.<*?N=RXJ[+]KJNJV\$_]JZ;O:.1MDUHR!7CZJ2K/E6&<$9(.
+<< M,@\X$LOBOP_;Z=8W]UK5C:6M_$)K5[N=8/-0@'(#D'HR_3(S7-77C[PI+$X7
+<< MQ'I1+*0!]KC']??_`#WJ:!9ZQ/IW@*?298+?R_#3I)/<VCSQC<+,A<*Z88[2
+<< M1D]%;CN%@JM2=^?I8<XI6L>D53O-4M+&XM;>9Y#/=/MBCBB>1CR`6(4$J@+*
+<< M"YPJ[ADC(KS^WT?6=)\3V>G6VHZDEG8O:6]A&MG/*LEHD<:R%Y%D2V4DB;/F
+<< M(9!U7)\H58\.Z#>R7'@VYU6769KF/1YI[J:>XE1DN";/$<FTJ,81AY;<-L8L
+<< M&;<Q[C,]$HKRM(_$,UG8Q6LWB""^=+5=;E83'9=&ZMMS0^:#'L"_:B?*!BVX
+<< MW`KMK8OH=0MKS68+4ZR=6CMW30")+A[<H+50OF,286?SO-YG)8G;GC90!WE%
+<< M<?X%AOHOM_G7U]=6A\OROM=G<V^U_FWX^U2O,>/+]$&!MRQ?'84`%%%%`!11
+<< M10`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%
+<< M`!1110`4444`%%%%`!1110`4444`%%%%`!1110!EZEXET'1KA;?5-;TVQG9`
+<< MZQW5TD3%<D9`8@XR",^QJY?WUOIFG7-_>2>7:VL3S3/M)VHH)8X')P`>E<W<
+<< MZ/J%[XZU&X@U34M,@_LRS026L4)69A+<D@F6-QE0RG"X^^,]17+^(X-9NM-U
+<< MJWABUF;5)4U)+N,K.UN]H8K@6XC!_<ES_HHQ'^\SNS_RTH`],N+ZWM)[2&>3
+<< M9)=RF&`;2=[A&D(XZ?*C'GT]<58KRO68-9FU&)[.+67\30WNH/$S+.;1(_L]
+<< MTMJ5W?Z,#AK<9ZY)#<EZDTS3]:N+FQMEU;7'TR74%$SBUN[4JOV:Y\P%KF62
+<< M;:Q\D$_*JG:4(DR0`>H4444`%%%%`!1110`4444`%%%%`!4<D\,+PI++&CS/
+<< MLB5F`+MM+87U.U6.!V!/:I*Y?Q,L0\2^$;@V4\TT.H2YGALWE\F-K>5#N=5.
+<< MQ2[Q9R0#C/120`:D/B70;G5#I<&MZ;+J`=D-HETC2AESN&P'.1@Y&.,&@>)-
+<< M%S;J^J6D+W-Q+:P)-*(VFECD,;HBM@L0XQQGMCJ*S[N95UN_UK5!)!I>A6[>
+<< M4TD;89R@>6<#!W!8RJ*R\@M.N#D5Q\FDZEI_AJ_TZYT^[;4-6\+V]@ODPM,)
+<< M+[%R9O,D0%4)>=29'(5BS'<<,0`>D1ZMILVJ3:7%J%H^H0IOEM%F4RHO'+)G
+<< M('S+R1W'K5<>)-%S;J^J6D+W-Q+:P)-*(VFECD,;HBM@L0XQQGMCJ*YO^V--
+<< M36)[G4;.^TZRT>6ZN(8_[*N%CWJLGG7+RB/8=RM+M4,<ARQW.RK'GJ@L-#TW
+<< MP_J^EWT+7.E0C6;JVTZ:Z>Y)W>9#YD*/\S.TK.Y.?WA*Y:0N@!WD>K:;-JDV
+<< MEQ:A:/J$*;Y;19E,J+QRR9R!\R\D=QZU3_X2SPW_`&=_:/\`PD&E?8?-\C[3
+<< M]MC\OS,;MF[.-V.<=<5P>N:3J6I:#/X?M=/NVU"*]U>Y8-"R1&.>.]$169@(
+<< MV+&XB^4,2-QR!M;&AJ,:ZOX@F\0(OB"SM+=+1(;JUTYA.DJ"\5\P31%W3;<J
+<< M,K&W+@]%<J`=Y8W]GJ=G'>6%W!=VLF=DT$@D1L$@X8<'!!'X57NM=T>QTZ#4
+<< M;S5;&WL9]ODW,UPB1R;AN7:Q.#D`D8ZBJ>F2S7/A-WUVWDG1DG#I+;%GGMPS
+<< M!"\(7)=X@I9`H.6(VC[HX^PCN8/#7@RXD76=-%KH[6<]Q::<\MU%*!`/*,+1
+<< M.0C&)R6,?6-,,`V'`/3*R[SQ+H.GV]K<7NMZ;;07:;[:2:Z1%F7`.4).&&&!
+<< MR/4>M8^AVBV>C+9ZIIUW&D.A6D5U8A&GM%`64/%$N7,C]5898E?*ZYJGI(OW
+<< M^&/AO2;:"^M;NZM+?3YI&ADADLPL>)G.0&1@J.$;!&\Q]5.:`.T@GANK>*XM
+<< MY8YH)4#QR1L&5U(R""."".<U)4<$$-K;Q6]O%'#!$@2..-0JHH&``!P`!QBI
+<< M*`"BBB@`HHHH`*X;XC_\BMJ?T/\`*.NYKAOB/_R*VI_0_P`HZ3&CQZBBBOH3
+<< MPSUGPN@3P;IP617&Z4Y7.,D@D<@<CI^'&1S4?B__`)$35_HG]:D\+B,>#=.\
+<< MMF9=TN2RX.<C(ZGC.>>_7CI4?B__`)$35_HG]:\"K_%EZL]JG_#7H>BT444A
+<< MA5>_7?IURNW=F)AMV[L\'C&UL_\`?)^AZ58JO?KOTZY7;NS$PV[=V>#QC:V?
+<< M^^3]#TH`L4444`4X_.2YN?+AC*M*"S,2I^[&,CY.>-W<\@#/99%>\.W=!`.F
+<< M<3$X^[G^'W?\ATR=I;KMGNSMQNE!SMQGY%&?NC/YMTZ\8%B@#G/'@U@^"=2&
+<< M@F9=0VIM,()<)O7S-H!!)\O?C;\V?N_-BO)/A7XBO(O&]IHVG0G[#<QNU]&G
+<< MSQ1A8LI(N.G2-=W`*NBD$[=GOU9>DZ5HME<:A?Z3;6D<M_<,]W-;X_>RH2C;
+<< MB.X8-D?WBQ/)8GHA7Y*4J=OBM^!U4\3R4)T>5/FMKZ?U^?R=J^E6.H1I/>6T
+<< M=P]J&D@$OS+&_!#A3QO&.&QE<G!&XYJZ5_R,.K?[D7_H<M7M5O[.QL_],NX+
+<< M?SSY$/G2!/,D8':BYZL<'`')JCI7_(PZM_N1?^ARUS=3F-2X+">T`$A!E(.T
+<< M$@#8WWL$8'3KD9QQG!%BJ]PNZ>T.W.V4G.W./D89^Z<?FO7KS@V*8BK=:?;W
+<< MDD<DOFAXPRJT4SQD`XR,J1G[H_*H;#3H(?*N@T[SF+;OEEE/!P3A9&)7)`XZ
+<< M\55UN]>TN8,W-Y#`()))!9VWGR,0\:C"!'8_?/0>YX%9/A'7O[5L=)NXWOEM
+<< MKJRWFVGM=@B?]S@(1$F]!YA&\#:0,]C0!I:YX8&M7<5U%K.JZ7,B>6[Z?,B>
+<< M:N<@-N5NA)QC'WCG/&,IO`$[J5;QMXK96&"#=0D$?]^JU=0UN47'V:Q:&&1$
+<< M21WO(9,$/G:%48)/RG)/3&.3G;GS:[JL&WS+_2?F8*-MG<-U]<'@>_2B]A-V
+<< MW-G2-(T_PQI`MK8,(PV^::3YI)I#@%W('+'CM@``````9B:;I=E;W;:9J%W#
+<< MJ$MN\,%[=S37K6Y8=5$S-@;@I*C`;:N<X&(-"\23>)-!U5YX(XY+*\^REHR<
+<< M286-PV#]WB3&,GIG/.!S&AZWJ<UGHEUJC6<J:S&AB%K`T1@<PF7:VYVW+M5A
+<< MD8(('!W$K+=BDCLI=+\.RZ=8Z<WGBQL8A!%;+<3K&T8`79(H;$JX4##[@1GU
+<< M.2;2_#L_VC/GIY\HG/E7$\?E2?-EXMK#RF;>^XIM+[FW9R:XW0];U/6[6Z4-
+<< M9V]Q)'#>V3F!I$6UF+>6)%W@F7$;[L$*,K@GD5##K>NS>$M*NHFTZ36-8\LV
+<< MH:!X[>/=$92K_.S'"HX!'4E>`,FB["QW$>E>&8EPD.,^06):0EC#*TT;,<Y9
+<< MO,=G+'EBQW$U)<VFB3Z)=:4DDD$%P\LN^+=OCE=S(949@=KB1MZG^$@8Q@5R
+<< MUSKN_P`*P:O8Q_/>QP_9%G'`><JL?F`'[H9UW8).,XS6?)J^JV/]LW4D]M/I
+<< MVBL$E1X"+B=%MXY7?>&"!OG)"[`#@#*YR"["QVMU8Z3J?D3ZA<SB^6)8Y9["
+<< M>XL_-QSR(W!*@EBJL6V[C@\DFQ<Z-9:K;W*6\GEP7MXD^H`*Q-R$1%\ODX"L
+<< M(XU88(9-RXRVX<EK.J3VFFWU]"DT2Z7())Q)&-MQ"J*\FSU^1FVD%?WB8)P#
+<< MGM]%_P"/-_\`KH?Y"A.X-&E1115""BBB@`HHHH`****`"BBB@`HHHH`****`
+<< M/,/%'_(@R_\`8/A_]`2N\NM4E2YD@M;83&+`D9RZ@,0"`-J-DX()Z=1UYQP?
+<< MBC_D09?^P?#_`.@)7:QW,,&H:FLDBJWVA2`2`3^ZCKBQE:=*G>&]RXJ["S\0
+<< M,\4_]I:==64L4K+\L4DJ.@Y5U8+T(/((!!!'(`)UH)X;JWBN+>6.:"5`\<D;
+<< M!E=2,@@C@@CG-8=Y>1202`2JV5(`#=?3C_/^')R:3INI?"3P:]_I]I=/&FCH
+<< MC3PJY57FME<#(X#+P1W'!I8+$3K7Y^EASARV/3*CFGAMD#SRQQ(75`SL%!9F
+<< M"J.>Y8@`=R0*X>YU>?3O$#:=:W\=H]M>VEG8:'''$JW-FPA$DP3;YA"!YOF1
+<< M@B^1R/E?.&^O7NIVFE1RZI]NDN);"XU.UVQ_\2NZ%]:8@PBADSOF&V4LW[KK
+<< ME6SW&9ZQ17'^!=:NM7^W_:]2_M":+RR\UI+!-8!FW$I;R1JK\#&Y9<LN5Y8'
+<< M<W84`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1
+<< M110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%1S
+<< MSPVMO+<7$L<,$2%Y))&"JB@9))/``'.:X/6_#G_"0?$._P#W&AR^1I5G_P`A
+<< M72OMN-TMU]S]XFWISUSQTQSC^*M>O9]%U^V;5/-NI(M4M[O2-L?^B6J0W'E3
+<< M[0OFKO\`+@^9V*GSN`-R8`/5))X87A266-'F?9$K,`7;:6POJ=JL<#L">U25
+<< MY/KVO7O]JVMQ%JGVC7;/4-0,'A_;&=HBM;P0OY:J)CO58SRV&\W(`!7%C3-<
+<< M\17US8V4/B6QN(;K4%@-[:21WI53;7+NGF+!%$&'E1LHVLRDY?<K*I`/4***
+<< M*`"BBB@`HHHH`****`"BBB@`HHKD_%=S8VWBGP6US>1PSMJ<J11O<;`X:UF7
+<< M[F<,=S1J#@D%P!C?@@'43P0W5O+;W$4<T$J%)(Y%#*ZD8((/!!'&*(9X;E"\
+<< M$L<J!V0LC!@&5BK#CN&!!'8@BO,]/FL[3QH+R:YL8KI-0O3>H0$OH+=1.5DN
+<< MI2<M;8$912BA0T'SML&_+NH(8/#\QU>*.+6I_#D5SIBW:A9_[4E-Q).;96Y6
+<< M<RO$2L>""8Q@844`>P3P0W5O+;W$4<T$J%)(Y%#*ZD8((/!!'&*(9X;E"\$L
+<< M<J!V0LC!@&5BK#CN&!!'8@BN#M-0\)R^-+B[@U'2K&YL9;@7,CW2"\NW4.)5
+<< MDW'>+>,!B%;O&I4*D:E\>0^'UT?1-.UZ>QTW7;C3TO;J\U.989+)YF9Y9(%D
+<< M(V7#2F3!0#85!;A(T8`]8HKQ_5_^/6]_LK_D;OM>K_:?LO\`Q_\`V?RKO[/O
+<< MV_O/+S]EV9X_U.W^&I-1T_PS?7\TFF7GA^U\-VKVDP=K-;C3#<E+Q)!($98U
+<< M?:\)+%@<B$<DH"`>N45P<KPO\,X/)LK2TL%O84F2TB$=M):K>J)90HX$$D0>
+<< M0Y)78YRS#).'-;:7LN[ZWAT.^\.QZ@\&G:;=/MLYR]O;G=;!(Y`\@DCN%"(A
+<< M):27!!W!@#UBBN+L!XC3P_'ID.I1GQ!#H^G^=;W9_P!3(2ZRRF8*X9V".!D.
+<< M`T8)!#'//V.F0WG@:/3]0TC39M3FUB_L=->XQ?&%FN93)+NF3YBBI(^&_P!8
+<< M(ER0SX`!ZI15>PL;?3-.MK"SC\NUM8DAA3<3M10`HR>3@`=:L4`%%%%`!111
+<< M0`5PWQ'_`.16U/Z'^4==S7#?$?\`Y%;4_H?Y1TF-'CU%%%?0GAGLNE6\5KX8
+<< MTJ.%=JF%9",D_,T:,QY]22:S_%__`"(FK_1/ZU-X;N);KP?ILDS;F!>,'`'R
+<< MKA5''H`!4/B__D1-7^B?UKY^II4=^Y[4/@5NQZ+1110,*KWZ[].N5V[LQ,-N
+<< MW=G@\8VMG_OD_0]*L57OUWZ=<KMW9B8;=N[/!XQM;/\`WR?H>E`%BBBB@"G'
+<< MYR7-SY<,95I069B5/W8QD?)SQN[GD`9[+(KWAV[H(!TSB8G'W<_P^[_D.F3M
+<< M+==L]V=N-TH.=N,_(HS]T9_-NG7C`L4`<YX\&L'P3J0T$S+J&U-IA!+A-Z^9
+<< MM`()/E[\;?FS]WYL5Y)\*_$5Y%XWM-&TZ$_8;F-VOHT^>*,+%E)%QTZ1KNX!
+<< M5T4@G;L]^K+TG2M%LKC4+_2;:TCEO[AGNYK?'[V5"4;<1W#!LC^\6)Y+$]$*
+<< M_)2E3M\5OP.JGB>2A.CRI\UM?3^OS^63X@GAL_%VDW%U+'!!)IU[:I)*P56F
+<< M>2V*1@G@NP1R%ZG:<=#5[2O^1AU;_<B_]#EJ]JM_9V-G_IEW!;^>?(A\Z0)Y
+<< MDC`[47/5C@X`Y-4=*_Y&'5O]R+_T.6N;J<QI73(+FQ#%<F<A<COY;].#VSW7
+<< MZ]C:JO<-MGM!NQNE(QNQGY&./O#/Y-TZ<9%BF(IW=@;FXAN$NY[>6)'0-$$.
+<< M0Q4D'<I_NBJNDZ7';1V<Z7+2)%;>5#$@C\J-#M.$V(N1\J@>W:FZUJO]F2Q&
+<< M6_L;"U\IY);F]'R+AHU`SO4#)D[GTK-\,>)X-9M=/N+?4K.YLKBVW93B2&0>
+<< M5B.0^8_S_O0""<YQUS0`_P`3>&+_`%F\BN=/U2ULSY8CE2ZTY;M7VDE2`S+M
+<< M(W/SSG(Z8YP_^$!\0]O$>BJ>Q7PW&"/H1)D&NKO==5)/)TY(+R8*KN#<K&B*
+<< MP)4[N<DXR`!TY.,C-*7Q)J$`4RZ?IT>Y@J[]509)Z`?+UHO83=MQ=*\-1>'?
+<< M#D]G`[W-S/+Y]S-MQYLIV@D+SM`"J`!T"C))R3RT7@)1HYTNYN-4N[9;1K2W
+<< M$ZH#;HR&,E-L8!;:<;F#$#('#-GLO#/B2+Q+:7<L<#PO:7)M95+;E+!5?*GC
+<< M(VNO4#G/'<TO#_BF\U*UTBYU/3(+&'68EDL6@NS/EC$9=D@,:;6V!B,;E^1@
+<< M2#M#)JY5S'L_!VGZ;JD>H:?HZ64RP/`5MK98U=69&^;"\D%!CTR?6H?^$%T^
+<< M2#2H+O3FO8=,M#:01W<"R*5(C&X@K][$8Y&.K>M;VC>*;S7K.^:RTR!+I/+G
+<< MLHY[LJEU9R$^5<%EC8Q[PDGR%2PVX.,@U7C\7ZI)X-T_6$T*";4M4\LZ=IL-
+<< M_P#ZX/'YN&E:-0C!%D8@@CY,`DD"ERA<S#X0$/AV71[&&6V3S'GMW$.1!*93
+<< M,A"@`%4?!"],*`<\TQ?"-Q/<7%Q=/?".]9);S3DVM;NXC1"-WEAV7"+D9`;!
+<< M!&"5KKKWQ#;Q>%UURR7[7'<11O9)DQ_:'E*B%,D?)O9T&2/EW9.`#4=SJNI:
+<< M=JVB6-Q;6D\%^YMY+N.5HV680RRDB$JPV$1?\],C=WQDG*%SF]3\.WU[:75H
+<< MOVAH+^=?M0FW$)!M57CC&.`X3'48,C,#D`'L=(C>*T=9$9#O)PPQV%4HM?6:
+<< M_P!'DA:.72=8M]UI.%96\W9YJJ0>2'B#L,A=OE$$DNH&Y32L%PHHHIB"BBB@
+<< M`HHHH`****`"BBB@`HHHH`****`/,/%'_(@R_P#8/A_]`2NKUVR\-7^H!M2T
+<< M&PU2[C0(7FMX':->2%W2$>I.!TSGC(SRGBC_`)$&7_L'P_\`H"5W-NX2^U/+
+<< M8_TD?^B8JX\76E2IWCW+BKLYRQTOX>7B3>9X:T*REAE:)X;NQMT;(Z$<$,I!
+<< M!!4D<XX((':P00VMO%;V\4<,$2!(XXU"JB@8``'``'&*R;ZX)MI1N^4J1P>O
+<< M^?\`/OSO@Z>9;?P);K+(('\+N[QACM9E%F%)'0D!F`/;<?6C"8B=:_-TL.<.
+<< M6QWE%>3QZOK<<?C&Z34?,M;#3[R4V\YE9F*W>HJGENLBF+`C0$@$[54`KM!K
+<< M4TC6=2TYH8=D=KI,NL7D;7CVK7`EFDU&9!#\CJ83]W$C*R$N`<$`-V&9Z)11
+<< M10`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%
+<< M`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`45P>N
+<< M6>J:GXZO+>TCDN((-,M7\LZ[=:>J,\MR"0(%8.2$`).,;1USQG^+_$6I3>$-
+<< M9DE%I_9]\FJ:;%`L3"6)H(;G]XTFXAPWV=OE"+CS!\QV_,`>F45YGXB\1:E$
+<< M=/\`$4HM'T_3]3U$16*Q,LK-;6UZF6FW$8;RF.!&,;@,G;EKD7B?Q<+ZTTJY
+<< ML+&"^N;M(EDN51-L;PW#EO*BGE/RFWR"74/EE&S!>@#T"BBB@`HHHH`****`
+<< M"BBB@`HHHH`***X/Q?<W(N/$L\=Y=POHVA1W]D(;AXU6<FY)9U4@2C]S'\KA
+<< MEX/'S-D`[2_L;?4].N;"\C\RUNHGAF3<1N1@0PR.1D$]*L5P<3ZO9>-]/@GB
+<< MU)I[N]NC/<?:P]K)9A)6C"P^9F,H3;*S^6OS<%CO^?G[>YN7\)ZCJ:7EW#/:
+<< M^'$\06ZP7#QI'=W+74\A*J0)$#*@"2;P`N.<MD`]4O[&WU/3KFPO(_,M;J)X
+<< M9DW$;D8$,,CD9!/2K%<O9VSW/BAKS3[Z^D@@ED6]GFN6>&8X91;Q19\L>6=N
+<< MZ15!!CV$NS2[>?TNV?5/#FCFQOKY-9O[0:D%@N6C@L'N':9YW12/,7>Y5(I-
+<< M^_RPO`\UP`>D45Y7KFK:EIN@S^(+74+M=0EO=7MF+3,\0C@CO3$%A8F-2IMX
+<< MOF"@G:<D[FS<U;3;Y/$?]AZ7J$YM8OLMW]EO-<N87N&=+U719QOE_P"643[!
+<< M\O[IC@9)(!Z117+V5U9/X)8S7%]8P12R6T["[DGF\Q)VC>-)6S(^YU9$(PY#
+<< M+M"M@#/?3YXM.AL[N?57N+F622PTE-4E22-<(/WURC&0JAW,S;F53-L`D(BR
+<< M`=Q16/9KJ/[W3+K5H)9HM/@!N845+GSF\Q7F,9!15)52@P1D.#D"N;CN[Z7X
+<< M8>$;X:C=I<.^CM/(KY:X$DL*NKL020V\DX()Z$D$@@'>4444`%%%%`!1110`
+<< M5PWQ'_Y%;4_H?Y1UW-<-\1_^16U/Z'^4=)C1X]1117T)X9ZMX3_Y$O3O^NDW
+<< M_H5)XO\`^1$U?Z)_6E\)_P#(EZ=_UTF_]"I/%_\`R(FK_1/ZUX%;^++U9[-+
+<< M^&O1'?\`VNV_Y^(O^^Q39+^SAB>66[@2-%+,[2`!0.I)["N(\8^*_P#A$=!F
+<< MU21;J5(HXU2*'=@L5``)'"+GJQ_4D`X^JZO=ZQ\+?MUU(?,N]/BGD16.T,RJ
+<< MQP"3QDU%R['J/VNV_P"?B+_OL57O[FV?3KE?.B;,3#;D-G@\8PV?^^3]#TK(
+<< MGN)T=52:15$:8`8@?=%1_:[G_GXE_P"^S1S!8Z/[7;?\_$7_`'V*/M=M_P`_
+<< M$7_?8KG/M=S_`,_$O_?9H^UW/_/Q+_WV:.8+&O'=(ES<^6UL5:4%F:7:?NQC
+<< M(^7GC=W/(`SV5\5^TLWDAK(RJJLZ)=;BH8@9QMZ9W@>NT>IVXOVNY_Y^)?\`
+<< MOLUE:$[2>,/$!=BS&*TSDY)XD'_UNGMSG:PF%C8\=RZHW@G41H$KC4"J;#!R
+<< M^S>GF;0""3Y9;&WYLD;?FQ7FWPYG\1:-XOL].&BWUII5V&6]\R!A`C+$3&R'
+<< M``/"+NXR&52"0NSUCK[Y_'/\_7WZ]\_.=??/XY_GZ^_7OGY^B&(<*4J=E[WZ
+<< M'33Q#A1G1LO>MKUT_K\RCJBL_B[3[A06@32+]&D`RJLTEJ5!/3)`)`[X-6=*
+<< M_P"1AU;_`'(O_0Y:=*?W+G/\)YS_`/7]_7OWS\[=*_Y&'5O]R+_T.6L.IS&I
+<< M<-MGM!NQNE(QNQGY&./O#/Y-TZ<9%BJ]PNZ>T.W.V4G.W./D89^Z<?FO7KS@
+<< MV*8BC>6=S+>075K<11/%&\9$L)D!#%#V9<?<_6J>C:/+I\=@I>)+>SL_LL%N
+<< MD3*8T^3`+&1\X"`=?Q-7+R\N8KR"UM;>*5Y8WD)EF,8`4H.RMG[_`.E4="U1
+<< MKNWTU4B@-G=60N+::*0G?&`F,J8TVY#@XP,>@H`SO%.BZY>ZA'<Z/%ILZM$J
+<< M2I>W,T&TJ6*E6B!)SO;(.,8'7/&"?#7C0\C3O#8;LQU:]./P*D?G7>W^J)8L
+<< ML:6US=S$;C%;(&95Y^8Y(`&00.><'&<'%+_A(9?^@!K'_?I/_BZ`(/!OAM_#
+<< M6DS17$RRWEY<&ZN?+_U:N55=J9Y*A449/).3@9VC-MO!6I+X<MM)N]>C8Z?9
+<< M&VTV>TM&@:"0P-")F_>L7=58XP4'S,<$[2O0Z'KUEX@MIYK(R`V\QMYDD7!2
+<< M0`-CC(/RLIR"1SZY%4M#\60:W%92OIU]I\>H1+-8O>>5BY4KOPIC=L-M^;:V
+<< MUB`Q`(5MH!'H_@O3_#^LPWNERW<,"61LWMI;J:=64,IBQYCD*(P)``!_RU/3
+<< MO73P-`]EX;L[N_NY(-$LC;HMO/+;&279&@FS&X((59%QD\2MSZW-/\60:M9W
+<< M\^GZ=?7$EI*$2`>4CW49.%GB+.%:%OF*N2`VQL9(Q5<>-H/^$2A\0G1M5\NY
+<< MV&TLD2*2YNE=0P,:)(<_*68@D,`C$C`H`/\`A%'L_!/]A6-SYDEI+Y^GFX9B
+<< MB&.?SK>)R2S&-=L:'G)5>,'&+ATV^U/5M/U&]GCAM+1_M-O9"WQ/'*T+1D22
+<< M"1D8`22<*HYV_,0#NN7VLV=EH<FKA_M-J(A+%]F(<W&[&Q8^<,SDJ%`/S%@!
+<< MUJG;^)89+IM/DMY/[3CN%MI;>`AQN\J*5W5CMS$BS+EV"\X`&YE5@",:9J,^
+<< MIZ$E]-]HCTJ(W$M[M6,W-T8VA&$!.%VO,S#`P6CVD@,!T%9=UK<-M<6.WRY;
+<< M.YN'M'N8Y`1#,"0JMV`+*T><Y$A1<$M\NI0`4444`%%%%`!1110`4444`%%%
+<< M%`!1110`4444`>8>*/\`D09?^P?#_P"@)75Z[H>@WVH">_74/M)09%E<W4?'
+<< M."RPL!GJ-Q&3C&>..4\4?\B#+_V#X?\`T!*[:*&%[_4WEBC8BX7EU!P/)C]:
+<< MX\75]E3O:^O4N*NS%T[PGX3U:&66RFU6012M#*IU>]1HW7JK*T@*GH>1R"".
+<< M"#6^_AO19M&M-'N-+M+K3[-$2"WNHA,J!%VKC?GD+QGKR:HZA96#13,;&UW;
+<< M3\YA7.>>^/\`/YXP;+Q/<:)X/\):SJ,\]Q8RZ(QNE&'FEG6V6X#DMC/R0W`/
+<< MS<LZY!ZJL'7]K?W;6L$X..YV$VA:/<16T4VE6,D=K$T%NCVZ$11LNQD4$?*I
+<< M7Y2!P1QTH70M'348]172K%;Z+?Y=R+=!(F\LS8;&1DNY/J6;U-<?8>+M16.V
+<< M69OM-Q8VB6E^C!8TN;Z2[%I&ZL%)6/S(+@DX&%=2$)^5=2U\77T_B"'0FT:/
+<< M[<'E6[:.\W0P",6[E@Q0,X*7*_P@[QMQM)<=I!UE%<G\.];FUOPAILDGF/Y-
+<< ME;1RSSR$RRS>2K.64\@?,I#,<ODL!M*L_64`%%%%`!1110`4444`%%%%`!11
+<< M10`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%
+<< M`!1110`4444`%%%%`!1110`4444`1B"%;A[A8HQ.Z*CR!1N95)*@GJ0"S$#M
+<< MN/K5-]"T>2\NKR32K%[J[B,%S,UNA>:,@`H[8RRX`&#QP*Y?7K[7)/&5S8:?
+<< M)KAM8=/MIMFE+8_*[R3@ES<\\B-<;?0YZBJ_BGQ?>+X9UF2&U^S6LL6H6=E>
+<< M171$ZW$$4Y9F0*`BYMY-K!V/W.!D[0#L/["T?^V/[7_LJQ_M/_G]^SIYWW=O
+<< MW\;ON\=>G%%CH6CZ9%'%8:58VD<<IG1(+=(PLA4H7``X8J2N>N#CI7'ZYXOO
+<< M+>YT_53:^5H5IJ%ZDKQ71,\_V>VNPZM%M"[=\+%<R'.U"0"?EL6_CK4YVM[<
+<< M^&9Q>7-VMM$&,T,)W132!M\\,;';Y)W@(<*P(WM\E`'<4444`%%%%`!1110`
+<< M4444`%%%%`!5.\TG3=0N+6XO=/M+F>T??;230J[0MD'*$C*G*@Y'H/2KE8>M
+<< MWE]:Z[X;BM[B-+2[O98+J,Q9:0?9II%PV?E`:/)XR>.0`0P!8U#P]INHV6KV
+<< M[6T<#ZM;FWO+B!%6612A0$MCDJI(&<XJQ>:3INH7%K<7NGVES/:/OMI)H5=H
+<< M6R#E"1E3E0<CT'I7)Z=K>K2^*(/-N)S8W.H75DNY(OLC"(386'`\\3#R?F,G
+<< M[L[9=I.8\X\&O:RWAR^U6+5)XOL>B#Q#'#M202FX>YF$$K.I8QHL:1C84.-W
+<< M3Y0H!V&H>"/#>H17^=&L8+J^BFBEO8+6-9QYJLKL'VYW$,W)SG/.:N:EX:T'
+<< M6;A;C5-$TV^G5`BR75JDK!<DX!8$XR2<>YK/ADU,^+#'#JDEW`CM]N@,,:6]
+<< MJA4F-$(&\SG]V2"[#:78A-\0K#M+O6;KPYI-[9:U.-0U.)KZRL!&CAC*YFVS
+<< MNX9OL\2R1H2GEG`P,L\:``[2/2=-AU2;5(M/M$U"9-DMVL*B5UXX9\9(^5>"
+<< M>P]*KQ^&M!ATN;2XM$TU-/F??+:+:H(G;CEDQ@GY5Y([#TKB]6\4ZSI6DSZ_
+<< M'>>=ON]3M5L)8D\B,6T=TR,I4"3<3:INRY'SO@#Y=MC4Y?%%MK#Z-I^HZKJ$
+<< M<'V:ZN)X4LENQ%*MTI5?,1(MH>&$_=W?,_)&``#M)M)TVYTL:7/I]I+IX14%
+<< MH\*M$%7&T;",8&!@8XP*SSX+\*M;I;MX:T8P([.D9L(MJLP`8@;<`D*H)[[1
+<< MZ5)HMQ+>^'`]O?3S70\V+S[^)"Z3*[(RR+%L5MCJ5.P@';PQSN/+I?>*-3\/
+<< M>$K^VDU62.ZTH37[Z8MD)&G9(2A(N/E"G,WW>^.U`':#2=-6W>W73[00/;K:
+<< MO&(5VM"H(6,C&"@#,`O0;CZU7D\-:#-I<.ERZ)IKZ?"^^*T:U0Q(W/*IC`/S
+<< M-R!W/K6>WB&:W\/C4K2SN]5L_L5M-:W2*3)=M*2"6CC3<H4>6[%4/#MA,KMK
+<< ME[#6?%.N:=8W-O+K,L<=QJ,%Y)IUG;6SLZ7`$'R7@X01[P<$D$88E@:`/3**
+<< MIZ3<PWNC6-W;W4EW!/;QR1W,BA6F5E!#D`*`2#G&!UZ#I5R@`HHHH`****`"
+<< MN&^(_P#R*VI_0_RCKN:X;XC_`/(K:G]#_*.DQH\>HHHKZ$\,]6\)_P#(EZ=_
+<< MUTF_]"I?%<;S>"=4BB1GD?8JHHR6)S@`=S2>$_\`D2]._P"NDW_H56-2369(
+<< MHTTC4[>P.[=(\EJ9F;`P`,.N.ISUSQT[^!6_BR]6>S2_AQ]$4K[Q'9W0D@DT
+<< M?5IH'C$3J^G.5D7;M(((Y!YX/:L35+V&3PE+HVG:-J\:K;K!`C64F%50`!DY
+<< M/08R:[L37L,,$<UX\LPAC\R125#OL&Y@,G&3DXR<4?:[G_GXE_[[-9FAA7'B
+<< MF!IOETO6&`55W"PDP<`#/3VJ+_A)XO\`H$ZS_P"`#_X5T7VNY_Y^)?\`OLT?
+<< M:[G_`)^)?^^S2T`YW_A)XO\`H$ZS_P"`#_X4?\)/%_T"=9_\`'_PKHOM=S_S
+<< M\2_]]FC[7<_\_$O_`'V:-`.=_P"$GB_Z!.L_^`#_`.%3>%YS<:]K5Z]O<VT,
+<< MT=NJ?:86C+%1(#@-UZ^AZ^^T[GVNY_Y^)?\`OLT?:[G_`)^)?^^S3N!?,L?.
+<< M9$]_F'O]??U[]<_.&6/G,B>_S#W^OOZ]^N?GH?:[G_GXE_[[-<WJNH^(KGQ1
+<< M#I6EZRMDAT^2[=I8#/DK+&F`-ZX_UF<Y/3I0!V$LJ&)P)%)P?XOK[_7OZ]<_
+<< M.NE?\C#JW^Y%_P"ARUQ<4GB:.^BBO/&5E*F]1);_`&+8SKD94?O3@D=\'KTK
+<< MM-*_Y&'5O]R+_P!#EIK<1J7"[I[0[<[92<[<X^1AG[IQ^:]>O.#8JK=*AN;$
+<< ML%R)R5R>_EOTY';/9OIW%JJ$8^M:5_:<L0EL+&_M?*>.6VO3\C9:-@<;&!P8
+<< M^X]*S?#'AB#1K73[>WTVSMK*WMMN$YDFD/E8DD'EI\_[H$DC.<=,5O7=^;:X
+<< MAMTM)[B65'<+$4&`I4$G<P_O"JNDZJMU'9PB&7$MMYT4Y='29!M&Y661R<[U
+<< M())SGJ:`.?\`$^GZG:ZBDVCZ%/>0S0HCBQN((&C,>X#=YO!!5P!CIL[<9Y^:
+<< MT\23[3)X,UB0H0R"34K`J&'0XX_0@^]>E:AJMEI:HUW,4\PD*JHSL<=3A03@
+<< M<<].1ZU0_P"$MT;_`)[S_P#@)-_\31:XFK[E#P'H%YH.CW9O]J7-_=F\>!2&
+<< M\C*(@0L.&.(P21QDD`D#<<VR\->)AX7TS3Y9--LKS1+(II\UO.TPEN1;/`DC
+<< M[XE"(`[':`Y)(Y`4A^PT[5+'5H'FL;A)D1S&^,@HXP2K`\J<$'!'0@]"*IZ-
+<< MXHTG7]G]GS3GS(A/%Y]I+!YT9Q\\?F*N]1N7)7(&Y<_>&09E^'O!\_AK68);
+<< M;5[N[T]=,6Q>*[\K<HB8?9PNR->%5YP222=R]<<5X?!^IG3?"-B^KR62:)9;
+<< M97LO+9FN1$D2LOFQL"FQIQR`?F4XXXW(/%&DW=GJ-U:S3W,>G7;V5R(+261T
+<< MF4@,H15+-C<.5!'?.`:KMXUT&/PO)XEENIX=(CV$W$UG-'N#%0K*K(&93O7#
+<< M`$<]>#0!GCPWJ-A\/8='23[==:9*DMFI95,\=O<"6WB9L*`Q2.-"V,`DGG',
+<< MFF:%<VWB+4_$MD\8.KW$#R0SJZ&2V6")%W!EW1RHPE8#&"&*M@D-'TE_?6^F
+<< M:=<W]Y)Y=K:Q/-,^TG:B@EC@<G`!Z5'I^I0Z@)E19(Y[=UCN8)`-T,AC2382
+<< M"5)"R+RI(YZF@##U"PO+BVL-)-I!&TVJF]EEM(R(HH8KG[0K-G`,CE8U89R6
+<< MD=P&"&NHJF=2A364TMUD6>2W:XB8@;9%5@K@8.05+QYR!G>,9PV+E`!1110`
+<< M4444`%%%%`!1110`4444`%%%%`!1110!YAXH_P"1!E_[!\/_`*`E=;K.@I<W
+<< MQNE\1:CI7F`;H[=X`CL,#=^\C8YP%'!Q\HXSDGDO%'_(@R_]@^'_`-`2N]*A
+<< M[RZ+%LAPH^8CC:IQ^9/YUSUN7E]Y7UZE(PH_!\ES$'C\9ZY+&<@%?LC#C@_\
+<< ML/;'X5MVN@6-MX?T_1662:TL$MUB\QOF)@*M&Q*XR0R*?0XZ8XJ%X(H5F:$/
+<< M&SDNQ21ERV,9.#R>!5&7Q,VE6FBWFJ21IIUSI\LMS<E"6$Z1+*``O8QI<,?E
+<< M_@`R"0"4'!WY8V"5^IL2Z)IT\5_');Y6_E6>X(=@3(JHJNI!RC*(TP5P05!&
+<< M#S4=AX>TS3;B.YMH)/M$:2)Y\L\DLC"0QEM[NQ+G]U&`6)("`#`&*Y=?&NI/
+<< M!I82"T-P$MH]738V+>XDO8K4HGS<C<MX`1N&8E.<$;KGBCQ#K&G?\)!_9KV,
+<< M?]DZ5%J0^TV[R^;G[3N3Y9%Q_J4P><9;@Y&.@DZ"PT33M,^S?8K?R?LUHEE'
+<< MM=O]2N-BMD_-MYP6R1N;!&YLZ%<?JWCNP\)2P6'B"\@EOO*\^XE@$=NB1%F"
+<< ML(Y92[\*WRQ^8WR]!N4&23Q]91&X:73-22"![DM.1$5,-O(8[B8`2;MB-MR,
+<< M;SN&U6YP`=917/V'BR"^U%;9M.OK>&6[GLK>[F\HQSS0F0.JA7+CB*0@LJC"
+<< M]<D`]!0`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444
+<< M`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`%=+&WC
+<< MU&:_6/%U-%'#(^X_,B%RHQTX,C_G["LNY\(:'=O=-/:22)=)*LD)N)?*'F*5
+<< MD9(]VQ'8,^74!CO?GYCG'U_Q+JEGXJFTNTGC@@BLH+C<-#NM09F=YE(/D.`@
+<< M`B&,CG)]*/$GC46N@ZS)907<#QV]Y'9:@R1F*2Z@CE9D5=Q?*F*3ET"GRS@G
+<< M*[@#8E\(:'/?_;)K220[Y'\A[B4V^Z1&20^06\K+"1\G;R78GDDU):>%])LY
+<< MX;A(9Y;B&7SDGN;N6>0,$=`-\C%BH663"D[078@9.:P]7\:BUU'3Y$@NX-'C
+<< MO;F.\U!DC,4BP6]PTB*H8RY62+KL&?+."01N+/XF:-?A$M;:[N+I[A;=;:U>
+<< M"Y8L\<KH2T4C(`?)<<L-N`6VJ=U`':4444`%%%%`!1110`4444`%%%%`!6?J
+<< M&BV6J7EA=72SF:PE,UN8[F2,*Y&,E58!N"1\P/#,.C'.A7)^)/$6I:;<:LUD
+<< M+00:-IBZE<I-$SM<JQF_=HP91$<0'YB'^^/E^7Y@"YJ'A*RN8K^2RDGLKZYB
+<< MF6&=)Y&2UED5E,T<6X(DF68EE"L=S<_,V;%UX6T:\\@26>R.&)8!#!*\,;Q+
+<< M]V*1$(62,9("."H#,,88YP[7QC,_BRWTR>ZTT/<WMQ9C2P"MW;K&LK+.Y+_,
+<< MCK$&`\M>)D.XX^;/B\8:TVB7>J1/:-!9Z9_;K)/"6>>VF>=X80591$ZQ1*I8
+<< MB09;H=N6`.@NO!EG]GU#^S;S4M/N[M+@I+'J%P8X99@VZ00^8$SN<M@`<\C!
+<< MYJQ<^$='N;B.=8[NU>.WCM5%A?3VBB)"Q1-L3J,+O;''&:C74-8C\41V4AL9
+<< MK>7>SV\$;^9:0@-LFDE+;6WLH4)L4Y9L%A$Q./%KWB!O#EAK$$MC*M]NN+.U
+<< MEA9I[P2N\D-NNTJL3+#L#.?,`^=F^6,LP!T!\+:,UY-<R6?F^;O+02RN\`+@
+<< MAV6%B8U9@S[F"@G>^2=S9C'A'1Q;O$8[MW=U?[3)?3O<*5!`VSES(H`9QA6`
+<< MP[C^-L\_J/C74M+LI]:E@M)]/^T7]K%9JC)*K6J7#;VEW$,&^RM\HC&/,')V
+<< M_,:IXC\2Z7?_`-ELUI<3H\$LU[:Z/<3K%#*ESC-O'(SDA[=1NW8_>C@8R0#L
+<< M(=+M+;2SIT"216Y1E.R5U<[LEF\P'?O)))?.XDDYSS6>OA'1TTNRTZ*.[B@L
+<< M4,=L\5].DL:'&4$JN'V<+\I;'RKQ\JXDL;N_OO#D<]K=V-U?2943FWD@B4[R
+<< MK;HBS.&09!C+`EE*DIGY<.SU_7M2N+33K:;35DG2XGAU-K1V@NH8C"-R0^:&
+<< M4%IR`QD((BW#*R*0`=1:Z58V-PT]I;1P.;>*UQ'\JB*(N8T"C@`>8_0=_88I
+<< MS^%])G@2+R9X=DLTRR6UW+!(&E<R2#S$8-M9SN*YVY"\?*,1Z-K\VN:-;WEO
+<< MITD<]QIEO?1K,Q$#-*K$1>:%)RI7YCMX#*<'.*RWU[6)_`.E^(X;JQMI)=/B
+<< MNKB%K%[@S22(I6.%1,GS%CM5226+*.O4`ZR""&UMXK>WBCA@B0)''&H544#`
+<< M``X``XQ4E5[#[9_9UM_:/D?;O*3[1]GSY?F8&[9GG;G.,\XJQ0`4444`%%%%
+<< M`!7#?$?_`)%;4_H?Y1UW-<-\1_\`D5M3^A_E'28T>/4445]">&>K>$_^1+T[
+<< M_KI-_P"A5JUE>$_^1+T[_KI-_P"A5JU\_7_BR]6>U2_AQ]#@/BZ_B!)='_L(
+<< M:MS&_G?V>LI_ACV[MGXXS[U/X6OM>M_`D`OH+IM0\BZEW7)D:X^61L91E+$X
+<< M*X'<8KO;AE:;`8$JB!@#T.Q3_45GWT+E#<P^<9H8WVQQ%09,X.WYN.2H[CZB
+<< MNJ6-E.A3P[C&T'>]M7=WU[H?\-NHE=]N]CG?!VJ:UJ5]J/\`:<=XEO''#Y'V
+<< MFS,&6)DWXRJD\!/7'XU`;O61X%E\2IK,QGETE[PV[P1&*)C"7'EX4,-K8QO+
+<< M\`@@D[AJZ$VK3:O?W%_9WEI:M!`D,=S-&^7#2ER`CL!PT8SQG'M2'PG"VFRZ
+<< M8^J:BVG-;/;16H>-4A1D*``A`S;5)`WEAT)R0".>O)2JN2M\MOD-8B6)7MI0
+<< MY'+[.UO(?-XLTZW\02:--O%RJEEV/'*SD1^80(T8R@[03R@!Q@$DKD'BFW-I
+<< M:3_8+[-RQ"QJBN=H7?O5E8K(-A#`1L[$;L`E6"C^%K=[Q)?M]\MM'/+<):(Z
+<< MJBR2K(KL'"B0$^;(?O\`!/&```'PM;M9I;/?WS?OVFE<.J^:2P8Y55"H=RJP
+<< M9%5PP+!@S,3B,JVVK7TUKING&?\`XF?VUK:[DV+OV0$L\K1X^5956/T"_:$(
+<< M)^7=#8^/M&DFTZR-Q,\MQ';CS)WA63?*BL@:,,&+'>F2B%`6Z@!L=!%I5K%J
+<< M\^IJG^D31K&W`P,=6'&=S`(&.>1'&/X16?I_A:WTL6\=I?WT=M$L0D@#J%G:
+<< M-%17=@N[.V-`0K*IV\@@MD`9!XRTRXA@DC$W[Z.UD53MS^_=5"XW?>7S(RX[
+<< M"1#SN%._YJ-'_P!@.?\`]*+>I(/"VF6_V7RXL?9KE[A?E7G/1#Q]Q,1[1V\F
+<< M+^X*@\V,?$9,NHVZ+,IYZ$W%O@?7D?F*:`UY=4ETO3Y/*E@C^U:O';-YP3YE
+<< M:%<A=\L?S<<;=[>B-VW=*_Y&'5O]R+_T.6N3N-3B%PVF;M1@G_M**??'8W;1
+<< M2)Y:+M,D3(N">N\L@Q\RG''6:5_R,.K?[D7_`*'+30C4N&VSV@W8W2D8W8S\
+<< MC''WAG\FZ=.,BQ5>X#&>T(,@`E).TD`C8WWL`Y'3K@9QSG`-BJ$8NMV3W=S!
+<< MFVO)H#!)'(;.Y\B127C88<.C#[AZ'V/!K)\(Z#_95CI-I&E\UM:V6PW,]UO$
+<< MK_N<%`)7V(?+)V`[0#CN:Z:ZU"WLY(XY?-+R!F58H7D)`QDX4''WA^=0V&I1
+<< M7'E6SF<77E;V$L#INQ@,0610>2.@'7H*`.7\37-SH6K"6VM]9DCN8(T$EG:2
+<< MWN#&7!#!6!7AU.2>3GJ<FL&;Q+J$NTF#Q;\A#!4T&ZCR1V)#]/P(]C7>ZKJE
+<< MS#=?9+-[:*5(UEDDN59EVL6``"\Y^4Y)(QQUSQC3>(=5@&9+_1AR%XM;@\_@
+<< M:3MU$[6U%^'&DWNF:+?SWT#0-J-\UW%#(,2)&8XT&]?X6.PG'4`C.#D#,T^P
+<< M\2#PEH-O'HDEIJ'AVRWQ+=RPNMW<K:20)&OER'"%G)+,5(PH`.XE-_P7XG?Q
+<< M3I]]-)"D;V=XUJ63($F$1]P!SM^_C&3TSQG`W;"^M]3TZVO[.3S+6ZB2:%]I
+<< M&Y&`*G!Y&01UIC.3\+>&M:\-ZS;17%Y:7VGC1XK$RQ6I@:,V[?N0<RMN++-,
+<< M20`/D'3/->U\/^(QI'@>RMWM+%](LA+<R7$/V@+<+`L"QX65,@K+,<@D91>>
+<< M>>T>^MX]1AL&DQ=31231IM/S(A0,<].#(GY^QJQ0!PZZ3JEA\,;/3[J'S[K1
+<< MI8&"6\>7N(+2Y5T*("W[R2*)2%S]YL'';0T.:ZC\0:N\>FSSZ;JEVEY;:G#-
+<< M`T#1_9(4!_UF_EHR!A2.0<XYKJ*IZ9JMCK-E'>:?<QW$#HCAEZ@.BNNX'E25
+<< M=6P0#AAZT`<W!;[KGP;I4-C]ADTR(7MQ:>;YPM(Q;/`L1<9RQ:7"D\,(9#G*
+<< MX/8444`%%1PSPW*%X)8Y4#LA9&#`,K%6''<,"".Q!%9<_BG1K:*^EGO/+ALM
+<< MXEE:)PC%%=G6-L8E91')N5"Q7800",4`;%%%4[S5M-T^XM;>]U"TMI[M]EM'
+<< M-,J-,V0,("<L<L!@>H]:`+E%4[W5;'3K>]GNKF-$LK<W5R!\S1Q88[RHR<?(
+<< M^..=IQTJ2ZOK>R\@7$FUIY5AB4*69W/8`<G`!8^BJS'`!(`+%%5X;^SN/L_D
+<< M7<$OVF(SP;)`WFQC;EUQ]Y?G7D<?,/440WUO/>7-I')_I%MM,L94J0&&589Z
+<< MJ<$!AD95AG*D``L4444`%%%%`!1110!YAXH_Y$&7_L'P_P#H"5VVJ0R02M<#
+<< M5;6RAD(!%S%D%\8X.]>RCCV-<3XH_P"1!E_[!\/_`*`E<M\1->U72/%>LS"8
+<< MRPI)_H,)NKY6#QV]L9%40RHB*$G>3=U^5P3R,:4,/]8DX_,'*VIZ>KF=UB3Q
+<< M-I+NY"JJQ`EB>P_>\FM&Y\.6=]H5EI5[^]CM?*PP49;9@,,$'Y77<C#NCLO0
+<< MUYIX4^W>(O[:TW4;^4:??1VLMFVZ64RP?:9E$GEW;R[#($!*D$%<5T^C>(-2
+<< MTWP!9LD4VNZN;VXT^SAGG6.2Z\J:51NE(VAA#$S%F^\4]6Y52@J,W!!S-HZ"
+<< M3PIIKIJ0421O?7$=R9(]H:&2-E="G&,"4&7:P8%Y')!W$&,^$X)].U:VOM1O
+<< MKV;5+0V4]W-Y2R"'#@*H1%08,LA!VDY;DD``#>-=!7[.?M4[1SVD5Z)ELYFC
+<< MC@DW;))'";8E.UCERN`I)P!0WC708_MAENIXH[3SQ)-+9S)&QAW>:J.4"R,N
+<< MQSM0DX1B`0#4`6-0\/I?:B;V/4+ZRDEB6"Y%HZK]HB4L54L5+)CS)/FC*-\Y
+<< MYR%Q3N/!6FW-K<6[SW82>WU"W8AUR%O)1+*1\O4,,+Z#KGK5R;Q1I,%G;7CS
+<< M3FSN-Q2Z2TE>$*IP9&D"E4C[AV(4K\P)7FH[?Q3I\TR6Y:22X>XEAV6D$TX3
+<< M9,\0:0K'^[!9&&6PN5?#,%+4`4]$\)RV-U]IU#49[CRM0N[VUM!L$,#32RD,
+<< M"$#EO+E8$,S+EFP.%(ZBN;U7Q9!;`P6@D%XE[;6[1W=K+$'1[F.&1HRP42!1
+<< M)]Y"P!9,\,,E[XD-KXQ_LJ62.VL[>R6\N9Y+:1U96\X<R@A(`ODDY?._=@8(
+<< MR0#I**Y]_&N@Q1*\]U/;L\HA2&XLYHIF=E=E`C9`YW"-PN!\S*57+<4'QKH*
+<< MRS1M=3KY,KQ.[6<P0&-BDC;RFTQHPP\F=B9&XC<,@'0453U+5+32;=9KMY`'
+<< M<)&D43RR2-@G"(@+,<`D@`X"D]`37/Z5XZT^?3A<:@\D+M<7((2TFQ!#'<21
+<< M(\_RGR05C))DVC*OTVD``ZRBL^UUJROM1GLK9IY)(=P>06TGDY4[642[?+9@
+<< M>"H8D$,",J<:%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%
+<< M%`!1110`4444`%%%%`!1110`4444`%%%<_XG\2_\(_\`95VV*>?O/VC4KW[)
+<< M;+MQ\AEV/^\;=E5QR$<Y&WD`Z"BN;7Q?#-J.BV<.GW>_4'"3^<HC-DS6[SK'
+<< M(.?WNU.4'W006(RF^2]\3_9O$,^A6]G]HU`6D-Q;QB7;YF]Y58MP=D:>6"S\
+<< M_?``+%58`Z"BN/T;QQ_:OB&32_L]C\MW<VNRVO\`SKF+R7=?,FAV#RXV\OAM
+<< MQYDC'\61V%`%./388M9N=45I//N+>&W=21M"QM(RD<9SF5L\]AT[X=]X%L-0
+<< MBN[:>]OOL,_VEDM%:,)!+.LBRRH=F\L1-+PS,HWG"\+@U3QI;Z+XHETS4(/)
+<< ML(M/^UO?[RV'Q,WE^6%)_P!7;S/NS_!C&2,U]%\>17MBTNK6?]G7<?R/8PL]
+<< MW,)!-<1%56./Y_\`CV=ODW'`<D!5W,`6+OP+87TY6XO;Y]-,MQ-_9NZ,0[YT
+<< ME24[@GF_-Y\I^_P6XP``+D'AH+=6=W>:MJ5_<6EQY\;W#1@?ZJ2/;LC14`Q,
+<< MYR`&)VY)"@`7Q?H;/=1B[D$MHB-/$UO*'CWJC1J5*Y#OYBA4QN8[E`)5@`^+
+<< MM'%NDHDNW=W9/LT=C.]PI4`G=`$,B@!D.64##H?XUR`;E%<WJ_C73-,LM4EC
+<< M,D\]C;SRJIBD2*=XD9FB28KL9QL8%5)(VOD?*V(]$\4M=ZLFCWD<\ETUHER+
+<< ME-,N+9&W23KM:-PQAP(1@NWSY^6@#J**YO4/%T.F/J"7,,<3VM[;VZK).$,D
+<< M,BHS3C(X1%,Y)Y&+>0Y&&VR'Q;913WJ7$<^V&[:W@^RP273W`1(S(ZI&I.U'
+<< M<QL>0K+@D$XH`Z"BL-?&&@2/=)%J4<QM41Y?)1I``ZHT>"H(8N)$V`9+G(7)
+<< M5@,^+QD7T/Q7JZVDC0:,\AAAEADMI)%2UCF(<2#<I+.P!VCC!P>I`.LHKGT\
+<< M2/82M;^(;:"PN#$9X?LL[7*3(&1"%/EJQDWR1C9M^;S$"ECN"R'Q=HXMTE$E
+<< MV[N[)]FCL9WN%*@$[H`AD4`,ARR@8=#_`!KD`W****`"L/6/"]MK%Q-+)=W<
+<< M"75N+2]BA*;;N`%L1ON4E1^\D&4*-\YYX7&Y6'K^M7VC(US#ID=Q9PH'FD>Y
+<< MV.Y+8$<"!6,DI.`%8H"70!B2=H`:MHMW<B^O+._D.I"WD&F"Y"&"RF,94.H"
+<< M9))ZEMY`+!<!F!KW/@K39K>.TMY[NSL_L4>G3VT+J5N;5`P6)RZLP`#R#<A5
+<< MOG.6R`18&M7T?B"WL+G3(X[>Z>5+=TN=\^(P29)(@N$B.``P=CF2(%5+$+AQ
+<< M^.KPZ9<:@-.@GM;6T;5)Y//,1-BTDWD/$NUM\C10EBK&/!*C(R0H!H2^&-2L
+<< MXM6GT;Q%?)=W?VB:**Y2W:$3NI"%F\DR%4.P#+'"HJ\J,5(_@^**XM)=,U?4
+<< MM,2TLDL8(K?R9%2)3T'G1N03A0Q!&[8F<[14B^(KA?%$>D7%C`BS[S$$NQ)<
+<< MJBAOWTD(7"0L4(#[SRT8(!8A<]?%FJ#08]:_LJ">P??.LHN/+>:!I6%N(8\,
+<< M7F>/RSL8QY:15!R2$`+DW@K3;IYH[J>[GT^1YY%T]G411R3JZRNK*HDRPEEX
+<< M+D#S#@#"[9$\+%?.G;7=5;4I?+']H;H5D5$W[4V+&(F4>;)]Y&Y?.<JA7/O/
+<< M'7]G13:A=Z=_Q*%EN[>*6*?=.TELLS2;HBH55/V>7:0Y)^3(&3MKZMX[O-#G
+<< MCLM2L-*M;YI8@7FU4I:)'(D[*S3-""&S;.NW9CYD^;D@`&Y/X7MIO#$NA+=W
+<< M<44SF26="ADD=I/-D+!E*$.Q;<NW:0S+M`XJ-_#$TGDS-XBU4W\/F+'?;+;S
+<< M%B?86BV^3Y>TF-&SMW9'WL$BM"QOKBXT.._DMX)9GB,J16%R)TE')7RY&"!M
+<< MPQ@G:.>N.:R_^$K8^$]"UU=-D<:H]DK1+*N+<7#(NYF."P4N!P,DXX`R0`:%
+<< MKH<.GV[6]A=7=K`ME%901K('6W6,.%=`X8;\.`2V<[%R#CFO8^%[:RT;1M+:
+<< M[N[BWTET:+SBG[T(K+&L@50&"95AP#NC1LDC)T)-2A6XN[2%9+B\MK=;AK:,
+<< M`,RN7"`%B%RQC<<D8QS@'-8;^*[AO"6EZ]%9V,,-Y:174TFH:B+:"V#JI"F3
+<< M8Q+$N`/D`.#D@[0P!U%%5["Z^W:=;7GV>>W\^))?)N$V21[@#M=>S#.".QJQ
+<< M0`4444`%%%%`!7#?$?\`Y%;4_H?Y1UW-<-\1_P#D5M3^A_E'28T>/5I^&_\`
+<< MD:-(_P"OV'_T,5F45]`U=6/$3L[GK^C7C7_ABSNU@)EEDE:10ZC?)D;VRQ`&
+<< M6W-C@#.!VJQFZ_Y\9/\`O_!_\<K%T.*[F^'UE'8W4=K<F279-)#YJK\XSE<C
+<< M/&1U[T@T'QJRAE\06I!Y!&C'G_R+7@U4E4DO,]FF[P7H/U/PS::O=_:;S3+L
+<< MR[0N8=2$(('J$F`)]^O3TJG_`,(+I7_0,U+_`,'3_P#R14LFE>+H94BE\36*
+<< M2.I94;2,%@,9('F\@9'YBD_LOQ;_`-#/8_\`@I_^VUF61_\`""Z5_P!`S4O_
+<< M``=/_P#)%'_""Z5_T#-2_P#!T_\`\D5)_9?BW_H9['_P4_\`VVC^R_%O_0SV
+<< M/_@I_P#MM%P(_P#A!=*_Z!FI?^#I_P#Y(H_X072O^@9J7_@Z?_Y(J3^R_%O_
+<< M`$,]C_X*?_MM']E^+?\`H9['_P`%/_VVBX$?_""Z5_T#-2_\'3__`"11_P`(
+<< M+I7_`$#-2_\`!T__`,D4]M-\5HA=_%-@JJ,DG2<`#_O[5;;KW_0ZZ1_X+A_\
+<< M>H`F_P"$%TK_`*!FI?\`@Z?_`.2*NVGAJSLK*ZM(-(G\NZ&V9GOD>1AV&]I2
+<< MPQDD8(P22,$DUF;=>_Z'72/_``7#_P"/4;=>_P"AUTC_`,%P_P#CU`%NV\&:
+<< M9:W4-Q'IVH(\3JZL^KLX!!R"5\\Y'M@Y]#7;:5_R,.K?[D7_`*'+7"6@UK[9
+<< M!YOB[2YX_,7?$E@%:09Y4'S3@GIG!KN]*_Y&'5O]R+_T.6FMQ&I<+NGM#MSM
+<< ME)SMSCY&&?NG'YKUZ\X-BJMT`;FQ^91B<\%5.?W;],G(_P"`Y/X9(M50C#UQ
+<< M)#>VY2XOK4&WE3[396XF>,EXB!@HZ\A6'*^O>L?P=IEUIMCHNG37M]<266G^
+<< M5)++;>6D9'D#RT)B3*?(V,@M@G)SC'675_9V6S[7=P6^_.WS9`F['7&?J*KZ
+<< M7J%C<V\,%O<VCRI$I:&!T^0``?=5C@#IU(]S0!R_BR"R%_"EU-XB:;R5+26.
+<< MCK>(ZC(4,3;R*&!WGC!^<YXV@<;#Y+ZO/#(_B<6A@B9!!X>M3<6[MO+>:%M<
+<< MJ"`FTJ.N[)KUF^U.2WN1:VMN)YP@D<,6544D@9*JQR2#@8[')'&<:QM](L;U
+<< M+V32;JVU%#)NFACN)O-#G)W.%S(.G#CY2.!@`GGEB(*?+S+S_K8Z*7LN67M$
+<< M[]+=_/7^OP=CP7;:7::#Y&DV=];Q+*?-:_M7@FGDP,R,'52V>!D#`QM&`H`X
+<< M'PA]NCM[6S3^W$UJTETN!86^TBVAMQ:VAG1U/[A6VF<X;Y\D8^;;7K-G>VVH
+<< M6J7-I,LT+$@,I[@D$'T((((/(((/(I\<$,+S/%%&CS/OE95`+MM"Y;U.U5&3
+<< MV`':NA.^J.<\_P#"D%PWBK2KB[BUDZDFCW":K)>+<^0MTSVQ(B,G[H`LLA`A
+<< M^4A>.`*IZY_;_P!EU7[#_;G]M_\`$Q\_9Y_D_9O*G^S>3_RQ\S/V3'E?O,YS
+<< MSYE>H44`<_HUE/IGB'4K&-[Y],%I;30M=SRW'[YGF$@$DA9ONI%\N<#(.!N)
+<< M.&DESI3^+])T:QN[?4)G+Z3Y=@XM\K80K'B0IY*@/&5PS`9&*[RHX9X;E"\$
+<< ML<J!V0LC!@&5BK#CN&!!'8@B@#SM+*YU#6K*UL'\1IX<>[B\TSSWL,P<079D
+<< MR\A$PCR+7OL+<#G=5>ZO=?T[1?$<<R:X\D^GW%GI)A@GG<21SWBH<H"58QM;
+<< M8D?!?@[F()'J%%`'D?B"?5+70O$%QJLOB"$16]^^E26K72[)A<W1S(8>B"/[
+<< M*5,OR;?N\;JDUO1-3B\&Z@ME;ZJUQ?ZAK/VBW5YG5HS'?^5B+)559FB(V@!F
+<< M*'DXKU"^^QM9R17_`)!M9L0.D^-DF\A`A!X.XL%QWSCO5B@#R?4X?%?G^(98
+<< M[[5?MWE:ALM[>SN=OE;)?LVR4R^1N_U!'DIYN[@_\M#6IXBTRYLT\16"1ZE?
+<< M2:OH26-I.8GG,UQNNBPD=5VQ#,Z<ML0`X7"J0OHE%`')VMK:3?$'Q'#)IDA@
+<< MO=,M$G>2Q<07+*9@X+E=CG9)$,9/''\)`N:I\GC3P_)/S:M%=PQ`\C[41&R$
+<< M#LWE)<X;L"PS\V#T%1S00W*!)XHY4#JX5U#`,K!E//<,`0>Q`-`'!V=L]OIU
+<< M_-+I6JV\-WI4\NGK9;C<Z=!A<VJ`C$<Q+*ZJ.X\O[L$9/0/\_P`0X?L_'DZ5
+<< M)]MV\9WRI]GW?WO]7=8Z[<MTW\]!4<<$,+S/%%&CS/OE95`+MM"Y;U.U5&3V
+<< M`':@"2BBB@`HHHH`****`/,/%'_(@R_]@^'_`-`2M3Q3X9MH;Z363<:DZ7-P
+<< M?M$5KIT%XR!X%B;8K0.X#"*-6&2""<^V7XH_Y$&7_L'P_P#H"5J>*YM-L[F;
+<< M5M6>=E@NH[2)%N;:%0-L<XP;AE4'<A^ZP8Y4]8XVCJG.4&W$&BEH^H:?H]XU
+<< MPB^++G,$%LJ3>'YHUCBB+E51888U`_>-U!_+BI_#GA5=:T?2[K46U*UBM;K4
+<< MIH[4//9R;YKES'*=K(ZD1EP`1R)CT[T(3IMO9V>K^'[QV^SZQ:Z:)8Y;5XY4
+<< M=[>)R/(R`K1@85L8ROR`1P^7Z)J6K:;HUNMQJFH6EC`SA%DNIEB4M@G`+$#.
+<< M`3CV-*4G)W8'#V_@+4K:;4='@U"./0;G3$L&>:)I93"9KH^3&QERACBF1`S!
+<< MP?E.."*D_P"$(U36-'OM/U._@MK5KO4Y;2**VS)&;AKA%=W\PAUV7#-M"J<E
+<< M03P0>DT;Q3INJV6CM+=6EKJ&J645Y%I[7*F7:Z;OE7@L!AN0/X35/1O'6CZC
+<< MX>37+S4=*L;&:4)"[:@AQE`ZI*2%"38)W1@MC'4T@*_C+P/_`,)9YW^D6*^=
+<< M:&U_T^P^U?9\[OWD'SKY4AW<MSG9'TV\D?@AX]4MKI+^")8KN6Y>:"V:.[</
+<< M<R7'DF828,.7"LC(P;!/!(*[&M>*-'T&*Y^VWT`NH;22\%DLJ>?+&BLS%$)!
+<< M/"-[<'GBI%\2Z"R63KK>FE+]REFPNDQ<,&"D1\_.0Q`P,\G%`')V_P`-/)U2
+<< M"[^W6(\CRQYL6G;+FYV7,$^^XE\P^;(?L^"VU>9&;':NDU#PU#J=QK;7%Q((
+<< M-6TR/3I$C`#(JF?+!CD9(G].-O?/%B_\0Z;IFLZ?I=[<QV\^H)(;9I75%=D:
+<< M-=@R02Y,HP`#G!].8]4\4:/I&F0ZC<WT!M9O*:.1)4PT;R1Q^:"2`8P94);H
+<< M`?<9`,^+PM>2Z]::WJ6IP37T$J$BVM##&T:17"*NUI'(;-TY+;B"%4;1R37N
+<< MO`OVFQN[;^T=OVBTU6VW>1G;]MF$N[&[G9C&/XNOR]*ZR">&ZMXKBWECF@E0
+<< M/')&P974C(((X((YS4E`&'J6BWU[*MS'J<:W%M>B[L/-MM\<(,!A9'564R`[
+<< MY6!W*06'4+@X:>`KQ;&]MFUF`_VK%-;ZFPLB-\<DT\O[D>9^Z8?:9!EO,'"G
+<< M'!![BB@#'TC2;S2;JYC6]@DTR26:XCA-L1,DDLIE;,F_:R[G?`V`X*\G!)V*
+<< M**`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHH
+<< MH`****`"BBB@`HHHH`*Q]6TF\NM1M-2TV]@M;ZVBEMP;FV,\;1R&-F^570[L
+<< MQ)@[L8W<'((V**`.33X>:#!+X?FALK3S]'>(_:9;5'GN%C@:*,.X`.02C@]C
+<< M&,`<$7+WPQ]I\0SZ[;WGV?4#:0V]O((MWE['E9@W(WQOY@#)Q]P$$,%9;E[K
+<< M]C8ZWIVCR-(]Y?.51(UW",!)'#.>B@B)PN>6(.`0K$1WOB2SL=1GT]XYY+N.
+<< M*&2.&-06N&E,H1$R1EOW+DYPJJ-Q(4,0`9^G>%KRUU&![G4X)K&UU"ZU"UAB
+<< MM#'(LDQFR'<R,&4">08"J<A3G@@]17/V'BR"^U%;9M.OK>&6[GLK>[F\HQSS
+<< M0F0.JA7+CB*0@LJC"]<D`]!0!CS^'K>[UJZO[IO-CGBLT$."NQ[::29'W`\_
+<< M,Z\?['.0<5AQ>!)K74I-3M-5C6\6X:XMS+:EXT9I;QR'4."PVWKJ,,O*!N02
+<< MM;&M>(I-&O[*T71-2OC>OY<,EJT`4R;'<H?,E4@A8V;.,=!G/%7'UW1X[RZL
+<< MY-5L4NK2(SW,+7"!X8P`2[KG*K@@Y/'(H`RV\+S366II/?QM=WM[;Z@)4MRJ
+<< M)-"D`7Y"Y)0O;@D;@<,5W9&ZL^\\#7-^'EFU*T2^N;AI[F^@LWCGB)CBB_T5
+<< MQ+N@.R)0<F0,<Y&WY*W-9\4:/H$]K%J5]!;^?*L1>25$6'<DKJTA8C:K>2Z@
+<< M]VX]<&K:\=,U&TL(-*OM1NKJ*694M#"-J1F,,299$'65>F>]`&'J?@2;4[*[
+<< MTUM5C33W>]GME%J3+'-<I,KEWWX=!]HE(4*I^YEC@[N@.E3)XE.K6]S&J36Z
+<< M6]U#)$6+K&9&C*,&&P[I6W9#9``&WDD7Q)HI2R9]4M(3?.8[:.>41/*X8*R!
+<< M&PV\,=I7&0>"`>*D;7='349-.;5;%;Z+9YEL;A!(F\JJY7.1DN@'J67U%`&?
+<< MJ_A'3M;UA;V^7S(6M'MIX,L/-RKHC;@PQM2>Y7`Z^=D\HN*\7A:\L8-,FT[4
+<< MX$U.TBGCFN+FT,L=PT[I+._EK(I5FD0,,-M4,PQTQL7&NZ/:7D=G<ZK8PW4L
+<< MOD1PR7"*[R84[`I.2V'0XZ_.OJ*CD\2Z##I<.J2ZWIJ:?,^R*[:Z01.W/"OG
+<< M!/RMP#V/I0!CV7@>'3M!N=*M;Z38UQ:7%M)+&&,;6T=NL8<`C>"ULI;&W(8@
+<< M8ZU(/"UY<:!XEL+_`%."2ZUWS-\\%H8TBW6Z0#"&1B<",'[W.>U;']NZ/_;'
+<< M]D?VK8_VG_SY?:$\[[N[[F=WW>>G3FH_#WB'3?$^C0:II=S'-!*BEE5U9HF*
+<< MAMC[20K@,,C/%`&7=>%KS55^T:MJ<$VI0[/L<MO:&*&';+',,QF1B^YX8]WS
+<< MCY4`782S-''X4U*WOVUBWU:T&M2O*9Y9+%FMV5T@0A8A*&4XMH>3(W._CY@%
+<< MZRB@#/DM-1;[3LU39YEW%+%_HZGRH5\O?%_M;]LGS'D>9Q]T58MX;B.>[>>Z
+<< M\Z.64/`GEA?)38H*9'WOF#-D_P!_'0"K%%`!7/ZMHVL7>N0:C8ZI8Q1V\6V*
+<< M"\L'G$4AW!I%*S)\Q4A<D$@!@"`[`]!6/K/B!-$WR2Z??36L,1GNKJ%%\NVB
+<< M&<LQ9@6P%8E8P[`#D?,NX`RY-*\3:8^LZE8WVFW]S.DTD,,UBRRN0KF"$R^>
+<< M%"*2!PJ@Y8G#.S&.X\"[=._LVPU'R;&;2H='NQ/!YLCV\8=5,;!E"28EDRQ5
+<< MQG;\HP0=A?$"?VQ'83:??6\<\KP6]W,BK'/*JLS*HW>8.$D(9D"D)D$@KNRU
+<< M\=VWV62Y?3KMX($DN;B:`HR06@EE2.X)9E+HZPO(!&'.!T.5+`$FL:3KK-)?
+<< MV][!>R:?Y]WI=H]L$=K@Q2(B22;PK1CS6``5#]W+D@EH_P#A%-2LGTE-)U:T
+<< M2TTNRCM;:'4+%K@HRJ4,H*2QC>R87)!P`VW`=@=1?$"?VQ'83:??6\<\KP6]
+<< MW,BK'/*JLS*HW>8.$D(9D"D)D$@KNSQXT1=,.HR:3?-8IYTLMU"%:&*V21U6
+<< M?<Q7>K(GF`1ASM(X.Y2P!7O/`O\`:,4VGW>H_P#$H:6[N(HHH-LZR7*S+)NE
+<< M+%64?:)=H"`CY,DX.ZY'H6M)<7.I'6K0:M,D,.^.P(MS%&9"%:(RER<S.<K(
+<< MO(3C`8.3>-=-M7FDNH+N#3XWGC74&13%))`KM*BJK&3*B*7DH`?+."<KNCE\
+<< M:+!/%9R:#JJZG+*D:6&;<R%725U?=YOE[2()1]_=E>G()`-33-*FTK1'LX+F
+<< M-KMWGG,[Q$IYTKM(QV!@=F]SA=V<8&XGFL<^%-23P1I'A^'5K19].>U/VI[%
+<< MF61;=U>,>6)0028TR=QS\V`,C'00W[-I9OKJQN[0JC.]NZK+*H7/:(N&)`R`
+<< MI).0.O%98\603Z=I-S8Z=?7LVJ6@O8+2'RED$.$)9B[J@P98P1N)RW`(!(`-
+<< M22"^^T7<L-[&J26ZI;Q20;EAE!?,AP07!W(-N1]S@C<:Q]/T+6M)\-:1IECK
+<< M5H)]/MQ;-)-8%XID4`*2@E#!P%`R'P<ME>5VW)/$^EC1X]2@G^TQRQ6\L,47
+<< M$D@G;;!\K8V[V.T%MHSG)`!(KIXI,T3+;Z%JL]]%*8KBR180\!"H_P`SF01<
+<< MK)&0`Y)W<#Y7V@&II.FPZ-HUCI=NTC065O';QM(06*HH4$X`&<#T%7*KV%];
+<< MZGIUM?V<GF6MU$DT+[2-R,`5.#R,@CK5B@`HHHH`****`"N&^(__`"*VI_0_
+<< MRCKN:X;XC_\`(K:G]#_*.DQH\>HHHKZ$\,]6\)_\B7IW_72;_P!"H\5W.JV[
+<< M69T9))KM@H\@PAHG7RQG>YQLQU'S#)XP>QX3_P"1+T[_`*Z3?^A5->>'9;FY
+<< M:>3Q'J$+.`1'&ZA4&!@`"/L,>ON2:\"M_%EZL]FE_#CZ&+I4DLOB33Y)Y+B2
+<< M5M)<NUQ"(9-WFIG*`#'/'T[GJ=_4+^+3;-KF57<!DC5$`W.[L$11G`R68#)(
+<< M`SR0.:RK*QL;+Q%'LU>[U&[:UE`,C*RHBR(&&=J\[N,<XPV<5<U^TGO-*"6R
+<< M>9+%<V]P(P0"XBF20J">-Q"$#)`R1D@<UDS0FT^_DO?,6;3[RQE3!V7(0[@<
+<< MX(9&93T/&<CN`"";M<7XDU:)[>S;6;&&TLTN=[V&H7=NLEZHC=2`A?RV57>)
+<< MOF?JI.`0N[,M/#\FIZ5J=_;10W)?3F72&BN4=()1-=-&J%6V*\0>)`PX3!"M
+<< MC-%@/0;6[@O86EMWWHLDD1."/F1RC#GT92/PHO+N"PL;B\NG\NWMXVEE?!.U
+<< M5&2<#D\#M7":AX3N74))8336XO;V>:*T2U<SO-(KQ2E;@%#M3=&2<.#PN5))
+<< M+SPGJ]U%<6^W=%+;-;XGN/,S<&R\K[8TN`S?\\2FT9_UF,T`=OJ?_(*O/^N#
+<< M_P#H)K!TC2M'_L'2B^BVEQ<2VD;G%O&6;Y5RQ+8[D=\\UH^5##H5ZL.F?V>O
+<< MD?ZK;&N<1*!]PD?*`$_X!QQ@F+1ED31-$N$B:4+8(A5"`>50YY(&/E/?N*8$
+<< MD.CZ%-(T?]B62.J!F#VB#&2PQT_V3[>F:=-H>A0(';1K`@NJ<6J=68`=O>GS
+<< MVTUR\C/`-L@@!0L#PLA+`_\``2,_D,U%]@F5H_+A"CS"7P0,J)D*9]<(#CT'
+<< M%`%B/0M'AE26+2K%)$8,KK;H"I'0@XX-='I7_(PZM_N1?^ARUS-O8;;I9)+=
+<< M,;YG8D`Y;S`4/UQG![9-=-I7_(PZM_N1?^ARTT)FI<-MGM!NQNE(QNQGY&./
+<< MO#/Y-TZ<9%BJ]QO\^TV?=\T[_O=-C>G'7'WN/QQ5BJ$8.N7#VVHVK17]G8S-
+<< M;3+'->)OC!WPD@KO0G@'^(>O.,5C^#Y=1>UT2#4=5L[W4H=.(G:+YV3_`(]]
+<< MRR,)&WOD/\X(!/.WCF?6OB!8Z3<>5'`;K9,T4BQRCS,K]_:@R3MYSNV=B,@Y
+<< M#H_B+HDFE)J`COO*=8R!]G)Y=59%)!V@D,IP3_$,XI0ESMJ.MC-58-M)[$NH
+<< M+<MJ=]"=2BM9WMK0B9(NBAY"X`+=2`P!SQN'!QSPS:7K]]X@M?[0,)TN.\C>
+<< M1O-$DA,`#I,A>1BBRR`*8^0`F>K;CZCJ>A:/K?E?VMI5C?\`DY\O[7;I+LSC
+<< M.-P.,X'3T%9__"">#_\`H5-#_P#!=#_\37*\-*\G&6_E_P`$Z(3C'=7(/A__
+<< M`,BG_P!Q"_\`_2R:N>LKK1['16O#;Z5<?$6#3Y)9(9T1[Z2\6%BZA1^\*D@A
+<< M0GRE,;/DVUZ!8V%GIEG'9V%I!:6L>=D,$8C1<DDX4<#))/XU8KIBN5)&9YNF
+<< MLW]]K5EI6E>+)[[3;B[B0ZM`MK*^XP7;O"&6+ROE\B!L;=P\SDX9<9<^M:A;
+<< M3>(M6DUJ2UOK?1[F"S!2$"_DM)K]=Q#(=SHJQR,(]H!?D;2!7KE%4!Y_XBUG
+<< M5M%EN()M>\N\M]/%S81"&)!JMVS2DVZHREF5=L*A(V$@$HRS,RM5>_A^T?#>
+<< MY@^S077F>)73R+@XCESK!&USAOE/0\'@]#TKTBB@#S?43>^%-)2UCNK'0?MM
+<< MV]Q&([R.WL;-%C1#`LLMNZ[G;,H41+D^:<_*2\>B^)=<U+31XAFU.10;W2[?
+<< M^SDAB%OMN8K,R')7S<@W+D?/U"YR`0?3**`/'[37]=U>TMQJ=_8S;[O3IKFS
+<< MAG$LEC/]NMOW3*L*>3C+@I*\CDIP3L<GV"BB@`HHHH`****`"BBB@`HHHH`*
+<< M***`"BBB@#S#Q1_R(,O_`&#X?_0$K1\5ZCID,MYIUYXEL]$NGNTN4-S/-$9(
+<< MO)5,CRIHF(W`C.XC*GC(R,[Q1_R(,O\`V#X?_0$JIXT\?ZEIFO:O9.)X+#3&
+<< M23S8+!G#H8X@=TGVJ+)#W"951P"I)QG&E"C*K)QB$G8D34]*N-)T_1K+Q/9:
+<< MYJ#ZW97"I;7$TK^6D\3/Q+-*^%5&8X8``$X&"3W6L6&I?VS8ZOI<5I<3VUO/
+<< M:M;W4[0*5E:)MX=4<Y!A`V[>=Q.1C!X/0]<UK79==T^V-S%J%@\"0O++);`.
+<< M9Y(Y/O37"N!Y>`P5ANR"*ZK1_'$3Z'I\NLPR)J=P;F-X-.M)[I6:WE\J1U"(
+<< M6";MI&[IN`R>M*I3=.7*P3N8NB_#V^TUM/BN#!<1I]AEGD&I7*)');Q0IA;9
+<< M<1RY,`8.Y!&X95@@#7)?!FH)HWA>-#'/=Z1IGV"6*/4[BQ5R5ARXFB4N0##C
+<< M:5P=V3@J`>X@GANK>*XMY8YH)4#QR1L&5U(R""."".<U)4`</%X.O[71]5\/
+<< M6_V$:9JEIY+W2O(KVI%HEL`D)#;U_=*WS2@_,1SMRUR;2=>NM>L=42*TTRX*
+<< M1QWT]OJ#SB2%)';R?*>$(X(;_691U+MC(&'ZRB@#GY-/UAM:T[5F%C)-;_:K
+<< M62(2/&HMY9HV5P=K9D5(4!7`!9F^90!G+?PIJ1BO'4::L]Y<0:@Z)N4130SI
+<< M,L*M@DQ,0Q+X!$CR2;#YNQ.HCU*&76;G2U63S[>WAN'8@;2LC2*H'.<YB;/'
+<< M<=>U/1O%&DZ_L_L^:<^9$)XO/M)8/.C./GC\Q5WJ-RY*Y`W+G[PR`:D!F:WB
+<< M:XCCCG*`R)&Y=5;'(#$`D9[X&?05)110`453TS4H=5M7N(%D5$N)[<AP`=T4
+<< MK1,>">-R$CVQTZ5<H`****`"BJZ7UO)J,U@LF;J&*.:1-I^5'+A3GIR8W_+W
+<< M%9[>*-)36)-+::=;B*5()'-I*(4D=594,VWRPQ#I@;LDLHZD"@#8HJGI.I0Z
+<< MSHUCJENLBP7MO'<1K(`&"NH8`X)&<'U-7*`"BJ>IZE#I5JEQ.LC(]Q!;@(`3
+<< MNEE6)3R1QN<$^V>O2KE`!1110`4444`%%%%`!1110`4444`%%%%`!1110`44
+<< M44`%%%%`!1110`4444`%%%9^IZU9:1Y0NFG:27)2&VMI+B1@,9;9&K-M&5!;
+<< M&`64$Y(R`8^I^#;6[\2Z;K5NT\4T6H"\NP+Z=$DVV[Q*1&&V;L^4#P,J&!)!
+<< M()>^&[QO&4_B:RD@6[33X;2W61CMD422O+')P=JMNBPZY963."N5?0'BG1FO
+<< M(;:.\\WS=@6>*)W@!<`HK3*#&K,&3:I8$[TP#N7-B[UO3K&6ZBN+C9):Q132
+<< MH$8G;(S)&%`'S,S(RA5RQ.!C)&0#E]$\(7FG^(?MK66E6NW4+N[DO[60FYO8
+<< MY7E*PRCRUPH\U&^^XS"O'0KW%8]EXHTF_P!1:Q@FG\X2R0!I;26..22,L'1)
+<< M&4([`H_"DG"L>@)&Q0!EZKILU]J.AW$31A+"]:XE#$Y*FWFBPO'7=(IYQP#]
+<< M#S=EX0OM.UR2]CB@N%AN[N^MI)M4N<-)-YI"?9\&*+'G%3(-Y(!.S+_+U']M
+<< MZ=_PD/\`8'VC_B9_9/MOD;&_U._9NW8V_>XQG/M4>A>(=,\2V$=_I,\EQ:2)
+<< MO28P2(K#>R'!91DAD;(ZC@GA@2`<_!X4U+2X;,6(TV=["]^W0@[K99F>&2%X
+<< MFP'V(BR#RR-V$1(R!LWG4UFRUC_A(=-U;2;:QN?L]I<VTD5W=/!_K'A8,"L;
+<< MYQY)&"!U%=!10!P=SX*U**UU2SLY[2=-;LGM+Z>9VB-NSRW$CR1H%;>-UT^$
+<< M9EP$4%VR2+C^'M8&GW6EQI8M:KJ!U.VN&N'#R2?;!=")X_+(1<Y3>&8\!MO.
+<< MT=1?WUOIFG7-_>2>7:VL3S3/M)VHH)8X')P`>E5].U9+Z5[:2VGL[Z.))I;2
+<< M?:7C1V=4)*,R')B?HQQCG%`'%W7@W7M3E\07=T--MI]4LKZW2**Y>54::"TB
+<< M0EC&IQFV<GCC<,9YQ8U7P9J$_B*[UB`QS&2XD:.W74[BQ.QX+5"S2PJ6R&M3
+<< M\F""'!R"N*ZR36].B^T[[C'V:[BLI?D;Y9I?+V+TYSYT?(X&[DC!Q8M[ZWNY
+<< M[N&"3?):2B&<;2-CE%D`YZ_*ZGCU]<T`<G9^#+FQT:XTZ&2T"'4].N8=F]5$
+<< M5LMHK##%B"?L[X!9NJY;J1N>%]/O-'\/6>DW@@/V")+6&6&0MYT:(JJ[`J-C
+<< M'!)4%@/[QK8K+;7[&*'6IYVDA@T=RMW(RY``A28LH&20%D';.0>.F0#4HK/T
+<< MS6K+5_-%JTZR18+PW-M);R*#G#;)%5MIPP#8P2K`'(.-"@`HHHH`*YO7+/7K
+<< MG6;:2UL]-O=-@19$M[F]>W_T@,3O<+#('"@(4&0`V6()"%>DK+U+Q#IFDW"P
+<< M7D\BN4$CE())%A0D@/*RJ1$G#?,Y4?*W/RG`!AZQ9ZQ;ZG)KXTVQFDTR*>:*
+<< M2S9Q=7\8CDV6C+L.%W.K9#N"T:D("V%IS>"M2MM&?2+*>TG@N]"@T2YN)G:)
+<< MH5B65?.1`K"0D3$["R8V`;CNRO40^(=,N-4.G1SR&?>T:N8)!%(ZYW(DI78[
+<< MC:V55B1L?(^5L4QXST8*3++/'MEFCD_T=W$(BE>(R2L@98HRT;D.Y4$*Q_A;
+<< M`!GZQ9ZQ;ZG)KXTVQFDTR*>:*2S9Q=7\8CDV6C+L.%W.K9#N"T:D("V%C&@:
+<< M]IUOHFG6L.FZGINE64$2)<W;VN^XC&/,=5BD#`!4*#("MDD,0A7H(?$.F7&J
+<< M'3HYY#/O:-7,$@BD=<[D24KL=QM;*JQ(V/D?*V*8\9Z,%)EEGCVRS1R?Z.[B
+<< M$12O$9)60,L49:-R'<J"%8_PM@`P]1\%:EJEE/HLL]I!I_VB_NHKQ79Y6:Z2
+<< MX78T6T!0OVIOF$ASY8X&[Y;%YX;U+5KB[U+5-&\/W<\B6\2Z;=2-<0%8C,=X
+<< ME:(%'S<'_EFW"$9^?*;A\4Z,MY-;27GE>5O#3RQ.D!*`EU69@(V90K[E#$C8
+<< M^0-K8KOXTT2.)6=[Y9'E$*VYTVY$[,5=@1#Y?F;2(Y,-MV_(PSD&@"QHNGWF
+<< MC^'!:@0272>:\4`D*PQ[G9TA5MI(C0,L8(7[J@A1]T8>F:!KVD:7X:DBATV?
+<< M4-*TQ]-E@:[=(G4^3^\63RB<_N%^4I_&?F^7YNHAU2TFTLZDSR6]HJ,[O=Q/
+<< M;E%7.2RR!2H&"<D#CGI5.7Q1I,>G6-\LT\\-_$)[9;:TEFDDC(!W^6BEPH#+
+<< MDD8!90<$@4`8Z^$[RWT&VTJ![&3[#:::D%PR&.2XDM)?,*R$9VQG:H7&XJ7D
+<< M.#P#7N-!\22M<2&UTJ>'4KMKK4+!KZ1$.V*&*./S?))DC(B9G4HF<A3E0P?L
+<< M/M]G_9W]H_:X/L/E>?\`:?,'E^7C=OW=-N.<],5GR^)]-CTZQOT%]<6M]$)K
+<< M=[33[B?<A`()$:$KD,/O8[^AH`U(#,UO$UQ'''.4!D2-RZJV.0&(!(SWP,^@
+<< MJ2J]A?6^IZ=;7]G)YEK=1)-"^TC<C`%3@\C((ZU8H`****`"BBB@`KAOB/\`
+<< M\BMJ?T/\HZ[FN&^(_P#R*VI_0_RCI,:/'J***^A/#/5O"?\`R)>G?]=)O_0J
+<< MM:]+#-!/9KJB65P\"*)%=0\9*#G!_P#K'T(/-5?"?_(EZ=_UTF_]"J2ZT31O
+<< M)EO)M*LI)&FC4EK9"69VP221]3[UX%;^++U9[5+^''T.8\)6CV&JV%G))%))
+<< M!I]PK-$X=3_I`(((]00?7FNXJE;:9IMCJ%VME86T#POY)DBA5"PPK'H.F3T]
+<< MJXNRD\':-I/@NQU+P]ICW.LV-NL<[:9#)F3RHR2[%=V69QSSR><#FL]RST&B
+<< MN7T6U\):Y_:'V7POI"?8;V2RE\W2[<9=,9*X4_+SQG!]JU/^$8\.?]"UH?\`
+<< MX+(/_B*0&I167_PC'AS_`*%K0_\`P60?_$4?\(QX<_Z%K0__``60?_$4:`:,
+<< MT23PR0R;MDBE6VG!P1@XJ2WAL;2VBMH+>5(HD$:+YV<*!@#)7TK*_P"$8\.?
+<< M]"UH?_@L@_\`B*/^$8\.?]"UH?\`X+(/_B*`-K=;?\\I?^_H_P#B:-UM_P`\
+<< MI?\`OZ/_`(FL7_A&/#G_`$+6A_\`@L@_^(H_X1CPY_T+6A_^"R#_`.(H`V2U
+<< MOM.V*4'L3(#_`.RU>TK_`)&'5O\`<B_]#EKFHO#N@02I+#X?T:*5&#))'IT*
+<< MLC#D$$+D$>HKI=*_Y&'5O]R+_P!#EJD)G-ZA:ZH;[36TSP_I5[#-J=TMU+<O
+<< MM9@/M!"N1"^Q`5C(?.2VU<8.:ZC1Q-#I[QVMO!Y27%P$4R%`,2R\8"G`X4?0
+<< MGT`,EUI.E-<PM+I]H9)I3N)ACRYVL3G<,GIGCG(],UH000VT*PV\4<42_=2-
+<< M0JCOP!5"/';+2YI_#VGW4>FM/?'38TN?-MKIW>==RO$Q210FTH!M(XSZ5!:>
+<< M%BR+90Q6OV:XOKJ"Q:XU6[13Y$OEQH54&/>$B&T')81YYVFIM6\):5X4MX;6
+<< MZU/2[D`^5#]KT:&6?8,;5:1Y%#%5V#C!P0=H!J[HEAX9$+G6)+^%)),Q2PR2
+<< M6%M&N`-HC@F*J,[F+D`?,<FNEU.=*_YMG.J3BV][^2T_S.N\<)J4Q\/V^E7L
+<< MEK=R:F2A$K(DC);3RHDNWDQ%XT##N,XYP:P]-UG6+'Q#J.JW[SBQN8K&\N;.
+<< MX+_Z!;RO=1J50G$3*$@>;)P-LQR<+7HDD$,SPO+%&[POOB9E!*-M*Y7T.UF&
+<< M1V)'>J>I:-9ZI!-%.FWS_*6=XP`TT<;[Q$Y(.Z,Y92IX*NX_B-<QT'-Z_/J6
+<< MJ?#^%YY;O2KC4+VT0-:LT%Q;PS7D:J#G)641,`PY&[<.16&WC+75UR6TM[?S
+<< MM7>*SL9K5`&C@N%^W/+(D3RQY5U@4KN="4:-N<!3Z9-!#<H$GBCE0.KA74,`
+<< MRL&4\]PP!![$`U3N-"T>[^V?:=*L9OMVS[7YENC?:-GW/,R/FV]LYQVH`X>V
+<< MU_Q3<76M7\"P"XLM$5VTSRS<>;<)+>HNSRI2L;,T2[D!<]$W97-6-1^(-Y9I
+<< M<74&F^?:)Y]W`2I43V<5O,2X<$CF:%?G`*^7<0'[SBNT72=-5[)UT^T#V"%+
+<< M-A"N;=2H4B/CY`5`&!C@8J2&PL[?[/Y%I!%]FB,$&R,+Y49VY1<?=7Y%X''R
+<< MCT%`''W?B'Q)9:]:^']^E7-]/+#_`*5]GDAC2.2*[;_5^8Y+*;7=]X!@VWY/
+<< MOU)X)U*:2YOM.=8X(H[W49(Q(#ON<WTN70@X")G:PY;+C(0;#)TECH6CZ9%'
+<< M%8:58VD<<IG1(+=(PLA4H7``X8J2N>N#CI5A;"S3R]MI`OE2O/'B,#9(^[<X
+<< M]&.]\GJ=S>IH`\GU--4NO"_BB[CCU58T_MI;NZNK_P`RVG@4W*)%%$9&V,K"
+<< M+GRTXC8;L'#=!K/CS4='OKJ\33_MFB+]JBBD\M8<S6\,LCKYGFLS?/;R)S"H
+<< M[AB`-_<&PLVLYK,VD!M9M_FPF,;)-Y)?<O0[BS$YZY.>M5_["T?^V/[7_LJQ
+<< M_M/_`)_?LZ>=]W;]_&[[O'7IQ0!S>L:OXKTRXL=+MTM-2U"Z2>X,UK8A5CBC
+<< M,2[3')=)DEI<[O,XP!L.2PDTWQ-JEYK6EK>P0:=8ZA$AMD6/[6+MS!YKA+F-
+<< M]B;3N&&3YPA*DY.S8_X1/PW_`&=_9W_"/Z5]A\WS_LWV*/R_,QMW[<8W8XSU
+<< MQ5R/2=-AU2;5(M/M$U"9-DMVL*B5UXX9\9(^5>">P]*`+E%%%`!1110`4444
+<< M`%%%%`!1110`4444`>8>*/\`D09?^P?#_P"@)47C+P-)JWB&2YO;.SN;6YNI
+<< M3;,^HF`H9+2*)BZ_9WY7[.64AOO;<CTE\4?\B#+_`-@^'_T!*]%U#3;#5K4V
+<< MNI65M>6Y(8Q7,2R(2.APP(JZ-65)N40:N<3X4T)]#O$66+3K:TAL;6SA2VO?
+<< M/)\MY79W)6(98R`G"G)!/M53PUHNH:D-+N[2_N]/@MWUJ.6YM1"6W/?J50B5
+<< M'&"$<Y`_A'(S@]7_`,()X/\`^A4T/_P70_\`Q-;%C86>F6<=G86D%I:QYV0P
+<< M1B-%R23A1P,DD_C1.;G+F8)6//\`_A")K3Q?!+;6U]]EMI;46$T,EL([6UBC
+<< MC4PM)(K7(R4DRB':XDP2-\A%=_!5U;>#?#5A!HOVK48+11<6]XL%S9?:#'&A
+<< M>Y61P[;0I5&B)**"`"N$;U"BH`\OUSPGJUY:ZK!:Z/\`\3.7^T6EU3?$/MT$
+<< MT4ZP6^_=YAVF2`;7`1?)X/RIG0UCPI-;RZC9:1HL":!<Q6AEL[."VR[JTYD:
+<< M**4>3YF?LNYG'**<$LJX]`HH`X?P#HFK:5<74FI6\\,;6D<$`G>(NJI=7C(A
+<< M$1V+MBEAX7"C.%X&!GV^A>(M4\%:-HXLI]%OM'T\HES/<1_/<?8Y+=?+,+N5
+<< M4&0N7."-J@*=Q*^D44`>;Z3X2N]-TZ[O-.T^^MKJUEBN[&TNS9Q>9*@D$BB.
+<< MV41)YL<AB\QBS<@D#RT)KZSX"OVNK5`;Z^Q:*L=Q:&UC\J\:662>X)F5V@WO
+<< M(C;H`6&T\?)&*]0HH`\ONO">K/'J22:/]JN+K[6NEW&^(_V7.]W=2+<99@T>
+<< M5E@;=$&?]UR`54'/?P[=:SH^M+H_A_R+Z2[UI)]1_<1_;U=KN-(=P;>W[QXC
+<< MB0*H\K.>%S[!10!YOJ'@O48YK\>'[2#3)'NYH;2X@981#:OI[*%!3YEC^UG?
+<< ML`^_\^,\U7TSP(&N;&.?1)_[)&H+-/9:DEB$`6VN5\SR+=1'RTD0W99SM&0`
+<< M@)]0HH`X/PYX9GTSQ0+Z^T:.4;);:QN!Y3'3XDN;ID`R=R(T,T2*(\X"[6"@
+<< M"M"W\+SW/B+6;N_N[M+";4X+N&R4Q>5,8X+?;(QVF0$2Q=-P!V#(()W=910!
+<< MY/;>%?$$/_",-+IDZWVG1:;`MQ:BSV0P1^5YZ2RO^_W?Z\8B.QE*CG<^=CP[
+<< MX;O?"VG:--IVA0)=0^'Y$O[>!XX?M5ZH@,:R,.&;(F`<Y`W-S\W/H%%`'G^N
+<< M^';JZ\0R3MX?_M"XDU6QNK34_P!P?L5O&\!DCW.PD7F.9MJ*0?,]68#/M_">
+<< MK+8P11Z/]GF@M(XM7??$/[<D6:!W;*L?,WI%<+F?83]HP<!GQZA10!GZ)#!;
+<< MZ/!%;:1_9$*[MMCLB7ROF.>(F9.3\W!/7GG-:%%%`!1110`4444`%%%%`!11
+<< M10`4444`%%%%`!1110`4444`%%%%`!1110`5S_B>;5A]EM;#3;ZYM)M_VN6P
+<< MFBCF11C"*9)$V[\G+J2RA2!AF#KT%%`'#W7AB:ZU&QBTV"^TFPDEM+^[@_T;
+<< M[,&@,>V/:-TGF8AB3",L8"[@6(*O8U#1-1'CZ7Q);V_VF.VT^WABMF=0)F#W
+<< M'F%,GY9E5U"LV%(D=,@.63L**`//]"T#4;;Q#'*^FWT'DZK?7<MQ<WBRVTD,
+<< MCS[!#%YC>7(?-C)8(AP)`6^8AO0***`./UOPC_PD'B&_DNUV6DEI9QQRYSNV
+<< MO=+/'@,"-T,[)N[>9N'S+QSZ^$]635+JYO-'^W:<UVTLUCOB;[9&;G475=KL
+<< M$.#<VTN'('''S+BO4**`//\`_A$Y6M==NH='^SO<W=HT-FSIS9I%:^=;JH8Q
+<< MKO$,D97(5]JAB4"D9]]X5OY[7_1/#VV%KN22PTB[BM9;"T5HH4_TB'?\OSI*
+<< MZM`69?,8D$LR-ZA10!Y?KGA/5KRUU6"UT?\`XF<O]HM+JF^(?;H)HIU@M]^[
+<< MS#M,D`VN`B^3P?E3/26OABRTOQK%>VOA^T%I]BCM[6:WAB46#*T[R'!(*B3S
+<< M@/W8.2&W8&">LHH`XOQ'X2OM8UN46E[)96=Y;F2:2,<1W,:21Q.5#`LY,T;A
+<< MNJFRCYSM*TY/#MTT&G7FK>'_`.V5F^U7%]IA\B5DN)GC>,GS65'\F-6@#YSM
+<< MVA0%)`]`HH`\WL/!FJ6^BZF;^+[;JLDMB))&N/,^V010V@N$7><?O3#*AW;=
+<< M^%WG:`18M_#MU_PA7C:QL?#_`/97]I^?]AT_]PGWK.*(<1L47,BMW[Y.,UZ!
+<< M10!P^M:9JWB1UU`Z5/9+:Q>0;&YEB:2\C:XMY9D^1V0*T<!C`9L.9&#;%&6S
+<< MU\-3).+BY\*?:M",LY@\/XMF^REDMPK^6SB$8:*Y/RL2//SC+/CTBB@#/DN]
+<< M17[3LTO?Y=W%%%_I"CS86\O?+_L[-TGRGD^7Q]X58MYKB2>[2>U\F.*4)`_F
+<< M!O.38I+X'W?F++@_W,]"*L44`%<OXD?4KC48[$Z%?:AHIB#S"TEMQ]H<DCRI
+<< M!+*A$8`!(`._<%)"AE?J**`.+URXN[35AKMWI5W%;:*D]S<3BY26":W6&7`A
+<< MC+Y6<ETRQ1"`'3S"I&_+E\+:S8^'IM&CL_M<E_X:MM$,\$J".WEC296>3>5;
+<< MR_WP(**S85OE!P#Z110!Q>N7%W::L-=N]*NXK;14GN;B<7*2P36ZPRX$,9?*
+<< MSDNF6*(0`Z>85(WUQ8:QIVC:)X=N=$N]2TRSTR"*Z-A+!MNI5788F\V2,^4-
+<< MH)`!\S<`<*&5^\HH`\WU;PMK.JZ3/H$=GY.R[U.Z6_EE3R)!<QW2HJA29-P-
+<< MTF[*`?(^"?EW7+_2;O6-4N-;O/#FI!%2VBBM8]12WNU:/[3ND1HI=A!%R%P9
+<< M%XWG'"AN\HH`Q]%74;'PX/ML4\]U'YKQP&17F\O>QBB9V;#2!-B%BQ!8$EC]
+<< MX\WHUAK&D:7X2NY=$NYI].T>33;FRBE@\U7/D8<%I`A3]PW1L_.O'WMO>44`
+<< M<OX<TFX\/:=##+IOG75GHEE:M<6\X/VIX1*#$BN5"[2<AFV[O-YQMXIV&D:G
+<< M/\.=`\.W5A);%[>&QU-7DC8QP)'B4?*Q#"0)Y8*G<HF#<%2*[2B@`HHHH`**
+<< M**`"BBB@`KAOB/\`\BMJ?T/\HZ[FN&^(_P#R*VI_0_RCI,:/'J***^A/#/5O
+<< M"?\`R)>G?]=)O_0JT;[_`)!3?]?=O_Z'6=X3_P"1+T[_`*Z3?^A5HWW_`""F
+<< M_P"ONW_]#KP*W\67JSVJ7\./H@_YBNJ_]?9_]`2O.-1\'MXMTWX?1W%N\FEP
+<< MZ0%NY$E"-$7M8O+(R<D[E'8CCD8KT?\`YBNJ_P#7V?\`T!*K>"_!?A6Z\"^'
+<< MKBX\-:--/+IEL\DDEA$S.QB4DDE<DD\YJ$4>=Z9X9\5VG@[4[*]M;:YO+S7/
+<< MM-V,0R&>W)0N\2N/+#$KD!P,#/`.*Q7\`^(;FVC@ETIWMH9]6:WBN)8/W22P
+<< M+Y'RJVQ3Y@)PH`5N>!S7O7_"">#_`/H5-#_\%T/_`,31_P`()X/_`.A4T/\`
+<< M\%T/_P`33L%SPN+P)XDBTR:S6S>*R\_2YY+2*:+$WEP[;G:C$QEM^UCO^5B@
+<< M/.!7H/@G2)M%T6>WE@N;=7NY98H+B>.1HT)XXC54C!(+;%R!NZ\X'9_\()X/
+<< M_P"A4T/_`,%T/_Q-'_"">#_^A4T/_P`%T/\`\32L%RA15_\`X03P?_T*FA_^
+<< M"Z'_`.)H_P"$$\'_`/0J:'_X+H?_`(FCE"Y0HJ__`,()X/\`^A4T/_P70_\`
+<< MQ-'_``@G@_\`Z%30_P#P70__`!-'*%RA6GI7_(PZM_N1?^ARU#)X+\*VL;7%
+<< MOX:T:&>(%XY([")61AR""%R"#SFIM*_Y&'5O]R+_`-#EH2LPN:5Y(8WMBH9C
+<< MYC816`+_`+MS@990>G?/K@8W!S7$J[L64[8SC!3G&[_:[[1_WV/?!<%A/:`"
+<< M0@RD':"0!L;[V",#IUR,XXS@BQ5".`DT#0]4U*^U/6+599;&69(Y07#(GF%M
+<< MN$89Y8GD'K7$>+[W4;2WDL+>TM)=,N87+3VHDD^SA48A))>5+$[>,Y`ZCYE-
+<< M>N-H;#[=&DF8KIBY);#*Q.3C@C&?;O\`B<&R\%Z9'J3&\NI;NS69VBLI7,T,
+<< M3L>1N(P,G@J<GMG#$'LP\Z,(R<E=_P#`W];Z_P!6>,N?VB_E_7_AOZ[:'C34
+<< MKC3TT5(+Z^LH[K4##/+86HN)B@MYG`5#')GYD7.%.`#T&366/&][9:)HY%E)
+<< MJ=WJ*3SV\GERXEM4<".5Q!#(P=TDA8CRU7+-G80%/:7%C;W<]I-/'ODM)3-`
+<< M=Q&QRC1D\=?E=ASZ^N*S[GPOI-SN)AGA8RO-OM;N6W=6?&\*T;*55BH9E!"L
+<< MPW$%N:XS8S[?Q-JFII=S:5H.^.UB'F07MS]GN?/:W698O+V,H_UD:DLXP2W!
+<< M"C='_P`)LM[+$FB6D=ZET\$-I/+,T,;RR0/<E7^0L@$*HP(5LF4+@88C8@\/
+<< M:9:7\5Y:026KQH$$5M/)%`0$V#="K"-B%`4$J2`JC^$8KVWABT7P_;:9>O)<
+<< M21N9Y+J)WMY&N'+-)*C(P:,LSR9"D`!ROW3B@#EW\9:AI&L:K9/827E_->[E
+<< M@1[B6*!$M+,NJF*&1\;YLC]VH.6)*D@'4\3:QJ4FE^')=,35;234[M1);P16
+<< MZW:H;::781/F-6!1=V3_``D`YK4D\(Z/("?+NTE9P[7$5]/'.Q\M(^95<.05
+<< MBCR,X8H&.2,U8O\`P]IFHV5G9RP20P63A[5;2>2V,)",@VF)E(&UF7`.,&@#
+<< MC].\9ZN;VWTZ.WCO[Z9UMP+FX$"(0]]DN4B;]Z%M-K[<QEON849;M-%U/^U]
+<< M,%T8?)D666WEC#;@LD4C1OM;`RNY&P2`2,$@'@5[?PMHUK>6]W#9[;BWVF.0
+<< MRN3D"8;FR?F8_:)B6;)8N223@C0L[&WT^!H;6/RXVEDF(W$Y>1VD<\^K,Q]L
+<< M\<4`6****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@#S#Q1_P`B#+_V
+<< M#X?_`$!*]/KS#Q1_R(,O_8/A_P#0$KT^DAL****8@HHHH`****`"BBB@`HHH
+<< MH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@
+<< M`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"
+<< MBBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`**
+<< M**`"BBB@`KAOB/\`\BMJ?T/\HZ[FN&^(_P#R*VI_0_RCI,:/'J*T=#M+2]U1
+<< M8KXS"U6*663R"-^$C9^,\9^6M-_#$:Z:ZK<K)J0N`H"/F)XRDI0+QN+N8LKV
+<< M(D3'WN/>E-1=F>,H-JZ.R\)_\B7IW_72;_T*M&^_Y!3?]?=O_P"AU1\+QR1>
+<< M#=.61&1BTK`,,'!((/T((/XU>OO^04W_`%]V_P#Z'7AUOXLO5GKTOX<?1!_S
+<< M%=5_Z^S_`.@)6GX$_P"2>>&O^P5:_P#HI:S/^8KJO_7V?_0$K3\"?\D\\-?]
+<< M@JU_]%+4(IG044450@HHHH`****`"BBB@"&[_P"/.?\`ZYM_*LG2O^1AU;_<
+<< MB_\`0Y:UKO\`X\Y_^N;?RK)TK_D8=6_W(O\`T.6EU&:5X0CVTC(S".1F.V,N
+<< M1^[?H`I/MQCKC)SM+FO(EW92?Y<YQ`YZ;O;G[I^N1_>&6W3(+FQ#%<F<A<CO
+<< MY;].#VSW7Z]C:IB/-_'GB$6UP;2.[129%#N<NL(S@X7(#-C)Y/4XR,<\[X6U
+<< M^.W\26T2W:SI<W$<+KG9YHW81B.<$':V,GH1G!-:NL>&+BUABO;N_M;"X$["
+<< M6XU"^$<<K[RR-$XRRMM'.0.@(&<D[7A31/MMPFIRZO8W\<$IR+2?[5YD@4;3
+<< M)*W)*@Y"XXPISVKV'4HTZ+C'72WS_KS/&C0K3K*<EK>_R[=_P-_Q7?ZEINDP
+<< MSZ7+:1SO>VUNQNH&E7;+,D60%=#D%PW7^$COD8^K>/A::-JMW!IEW";=+V.S
+<< MN;H1F"XN+992R`)(7`_<R'+!00IY!(!Z#7M%&O6$=HU_=V02XBN!):B/<6C<
+<< M.@.]&&`RJW3^$#ID&G<^#M+O-.CL+GSY;5;NZNF0OC>;@3B120`=N+A\8P1A
+<< M>>#GQSV3/U;XC:3H,L$.KP3V-P\7GS03SVZO;Q;F4,1YO[S.QCMB\QN.0"5!
+<< ML-XV@;`M=&U6Z9M0ETZ-42)/-FC\XOM,DB@J!`QW9Q\P`^8,JV'\+&259FUW
+<< M51<-$(+J=&A1[N)6=E5BL8V;?,<!HMC?-UR`18A\-V<'V+;).?L>H7&H1Y8<
+<< MR3>=N!X^Z//?`Z\+R><@&'J'Q0\/:885NWDB=D9[A))(8VM@LCQOE6D!D(>.
+<< M08A\P_)QG<F[8\-:U=ZS%?-=6$D`M[VYMXY\IY<ZQSR1@J`Y8$!!NW!<D\9%
+<< M5U\&VT$TDMIJ6I6AN'D-UY$B`W"/-+-L+%"R`-/*`T91@&^\2`1J:;I*:7+=
+<< M^1<SFWN)6F6V?:4A=V9Y"IV[OF=F8[F;'1=HXH`Y?PCXIU;5M#36;\_:(3:0
+<< MS26MIHEQ;NA?!)1Y)")U4;B?+!)P-N20K:DGC")KBVAT_2-2U+[4DTMN]MY*
+<< MK+%&8PTJF21,H6E4*?XL%AE2K$TSPE)IFEQZ6GB/69;&*W2VCB8P(8XUVC"O
+<< M'$K@[5V[MV0&)!#885Y_!\ZZSI\VF:O=Z;96MO<Q*D'E,T0D:`K%&)(W`B'E
+<< M,<=5RJKA`%`!7TSQJ+R\U!;2"[U<37"R:?!:I'&WV7[+:R,Y,K(,;K@<$[OW
+<< M@XP#BQ_PL/1397U^B79L+-(6:[:,1Q.9DB>%59R!EA,O7`3!+E`5+20>!;"P
+<< M82:3>WVF3+A8Y(&C<QQ>5#$8@)4<%2+:$Y(+97[V"0;$'@[2[32;K3;7SX;>
+<< M:6":/:^3;O#'"D10L#G;Y$;?-NR0<Y!Q0!3TKX@Z5K5Q9VUA;W=Q/<O*A6'R
+<< MY5B,9BW[Y$=H\!9T;(8CJOW\(>LK'LO#Z6FHP:A-J%]>WD44T1EN74[Q(8B?
+<< ME555<>2@`4*/O$@LQ-;%`!1110`4444`%%%%`!1110`4444`%%%%`'F'BC_D
+<< M09?^P?#_`.@)7I]>8>*/^1!E_P"P?#_Z`E>GTD-A1113$%%%%`!1110`4444
+<< M`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`
+<< M4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1
+<< M110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%
+<< M%`!1110`4444`%<-\1_^16U/Z'^4==S7#?$?_D5M3^A_E'28T>2VEW)93-+&
+<< M%+-%)$=PXPZ%#^.&-6K/5)(V2*XEF\@W$$LDL3?OD$095V$G`(5CCZ#IBLZB
+<< MOH'%,\1-H]=T"[DOO"]G<R!5:2:8A$&%0;N%4=E`P`.P`%6K[_D%-_U]V_\`
+<< MZ'6=X3_Y$O3O^NDW_H5:-]_R"F_Z^[?_`-#KP:JM5EZL]FG_``UZ!_S%=5_Z
+<< M^S_Z`E:?@3_DGGAK_L%6O_HI:S/^8KJO_7V?_0$K3\"?\D\\-?\`8*M?_12U
+<< M"*9T%%%%4(****`"BBB@`HHHH`AN_P#CSG_ZYM_*LG2O^1AU;_<B_P#0Y:UK
+<< MO_CSG_ZYM_*LG2O^1AU;_<B_]#EI=1F/J?C&UTV^M(=1UW2K&2>[FCBBF^4Q
+<< MHGF@229F7Y#Y97.,;BHZ\CHK'4T:T9KVYMDF225'P=@PCN`<$DC(C8]>Q]*J
+<< MOH=R9H'%S:,+:[EN[?S+9RT;OY@.2)`#\LKCD=_6M+3[5[.T\J2597,DDC,J
+<< M;02[EC@9./O>M,1XCXAT>V\3_'V;3KZ^8&)K5X+::,R1SQHB22Q9S\GR^8P&
+<< M,$ENA/-7P/#::!\=/[*T>9Q;.DT%S&?F$;A"SQ*[`,RJZ`!L*3M'4?>Z+QAI
+<< M?BG0/B7_`,))H]I=W>F7TEI]M^Q6Z23!(R-T2\E\$1@DC:IW`$G%0>"=#\2:
+<< MY\35\6:MI$VDV=K$T4*3I^\<"/RU5BY$CMM?)E8'.TCC@#ZM5U]3=YKD]G:U
+<< MU\7I:][_`.=[.QS6U\[_`*GH_BSQ/_PBUK87+6?VB&>[\J=O-V>1"L4DLDN,
+<< M'=M2)CM')Z#G`-?3?&EO?^*+_1W@\F.*5(;.XWEOM;XG$@V[?DV-:SKR>=F1
+<< MP5SL:CIGV^^TFY\[R_[/NVN=NW/F9AEBVYSQ_K<YY^[COD<_J?A'R+&XCTA<
+<< M;K33[&SBS_QY_9YF9)\LW[SR_,#[#][RMI)W5\H=)H:WXJM],\-3ZS:^1/'%
+<< M=K:$W$QMXU?[0+=R[E3M56W$G!X7CCFLO3_'BW6I6,=PMI':3I,AN+65KF&6
+<< M42VL<7DR@#>A:YV,=HPZL.BDG8U+PZLWABVT72Y8[%+-[5K5I(VF5!;R1NBD
+<< M;@6'[L#[P//6L>;P)-=WK:E<ZK&=0=VG=HK4K$9@]HT9"%R0@^Q1AEW$MN;#
+<< M+Q@`W+OQ1I-G/-;O-/+<0R^2\%M:2SR!@B.3LC4L5"RQY8#:"Z@G)Q5.U\:Z
+<< M9<76JQL9!!8O'LN8HI)8KA'BA="CJNUG8S!5C4LS<$`[A6/=?#V;4+J74=1N
+<< MM&O]0DN))<7>D&6U57B@C.(FER''V9,-OZ,XQR"-`>"V@M[FTM-0CCM)7MKE
+<< M%>U7<ES;B$1M\A1/*Q;QYC55/+891@``T#XNT<6Z2B2[=W=D^S1V,[W"E0"=
+<< MT`0R*`&0Y90,.A_C7./?^/X(TU$V<,DPL[VRB$\5O+/%/!,UL2Z.B[2^VX.U
+<< M`68[0V"#BK$?A34K>_;6+?5K0:U*\IGEDL6:W972!"%B$H93BVAY,C<[^/F`
+<< M6.U\"_V?9KIUEJ.W31+8W!2:#?,9+8VX7YPRC:R6R@C;D,Q;./EH`U+SQ/:1
+<< M>%=5URT22<:?;S2R6\J/!(&1-^QU=0R$C!&5Z,#@@C.>/%&I1^(M/T2^L+2W
+<< MNYKA!-Y%PTZ>2\%TZ%6*(0^^U((*D8(P23\MR]\,?;-+\4V7VS9_;V_Y_*SY
+<< M&ZVC@Z9^;_5[NW7';-1WW@O39;2TM-+2/18(+B6=O[-A6%BSV\L&Y2N`K@2!
+<< M@V#]P#Z`%@>+M'-N\IDNT='5/LTEC.EPQ8$C;`4$C`A7.54C".?X&Q(/%&DF
+<< M\AM3-.LDNP9>TE5(V<`I'(Y7;'(=RX1RK?.HQEAGF[#X>S:=?OJ5I=:-9WBO
+<< M"]NECI!@MU9$G0F2,2DN2MRXR&7!5>H!!N'P,DOB,:S<'2I;B66&YN)GTI7G
+<< M$L:(O[F1F;RHSY:G:0S#+X<$@J`=!IFM66L>:;%IY(X\$3-;21QR`YPT;LH6
+<< M13C.Y"1@@YP1G0KG_#'AM_#_`-J+W,!6?8$M;*!K>T@"YYCA,CA&8L2Q4@-@
+<< M'&<EN@H`****`"BBB@`HHHH`****`"BBB@#S#Q1_R(,O_8/A_P#0$KT^O,/%
+<< M'_(@R_\`8/A_]`2O3Z2&PHHHIB"BBB@`HHHH`****`"BBB@`HHHH`****`"B
+<< MBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`***
+<< M*`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH
+<< M`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"N&^(_
+<< M_(K:G]#_`"CKN:X;XC_\BMJ?T/\`*.DQH\>HHHKZ$\,]6\)_\B7IW_72;_T*
+<< MM&^_Y!3?]?=O_P"AUG>$_P#D2]._ZZ3?^A5HWW_(*;_K[M__`$.O`K?Q9>K/
+<< M:I?PX^B#_F*ZK_U]G_T!*T_`G_)//#7_`&"K7_T4M9G_`#%=5_Z^S_Z`E6_`
+<< MUG$WP\\-Y>?YM*MLXG<=8OKQ]X_3`_NC$(IG4457:SB;=EY_FSG$[CKN]^/O
+<< M'Z8']T8&LXFW9>?YLYQ.XZ[O?C[Q^F!_=&*$6**KM9Q-NR\_S9SB=QUW>_'W
+<< MC],#^Z,8>KZL+#68-+BT;6;^>YMY+A&M+F-5VJVUQ^\F0@@S+V_B7'W?E`.D
+<< MHK+TUEU2P%U)::E8N[R(UO=2LDB$.ZG[KD8.25*D@C81T7%BYMUCMYI4CNYG
+<< M",PBBN&5G.&^5<L`"=Q`R0!\O(VC`!<HKEUU^SO=.L;G3K#5;^:_M$O1:6\X
+<< M62*&0,59R\JHF2[`#=DE?E!$9*V+K5].73K:[MEOKUKZ5H+>WMYF2220"1G3
+<< M#N@C90)<ABI4IM^\JB@#:N_^/.?_`*YM_*LG2O\`D8=6_P!R+_T.6H]2U&*W
+<< MU%]/MK+4+RX$0FG,,RA+9)#(JNXDD7()$O"!B-@X&$J32O\`D8=6_P!R+_T.
+<< M6EU&;E%%%,04444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4
+<< M444`%%%%`!1110`4444`>8>*/^1!E_[!\/\`Z`E>GUYAXH_Y$&7_`+!\/_H"
+<< M5Z?20V%%%%,04444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`
+<< M4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1
+<< M110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%
+<< M%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`5PWQ'_Y%;4_H?Y1UW-<-
+<< M\1_^16U/Z'^4=)C1X]1117T)X9ZMX3_Y$O3O^NDW_H5:-]_R"F_Z^[?_`-#K
+<< M.\)_\B7IW_72;_T*M&^_Y!3?]?=O_P"AUX%;^++U9[5+^''T0?\`,5U7_K[/
+<< M_H"5I^!/^2>>&O\`L%6O_HI:S/\`F*ZK_P!?9_\`0$J[X&AD/@#PTPN95']E
+<< MVIV`+C_51\?=SV/?^(^V(13.FHJNMO*NW-[.V,9R$YQM_P!GOM/_`'V?;`MO
+<< M*NW-[.V,9R$YQM_V>^T_]]GVQ0CC_&^A7&MZC;>?I4]_8PQ?N?L=O82R)(2?
+<< M,W_;`0%($>WR^<A]W\-8^K>'M6U*ST.QU?2-<OEMM$N+"]N;#4(HWDF<PIOR
+<< MTRF16$+OAP0=Z;ESN"^D+;RKMS>SMC&<A.<;?]GOM/\`WV?;`MO*NW-[.V,9
+<< MR$YQM_V>^T_]]GVP`</?Z7-KWB;3=4U;P3.\,>GWD,\3S6T@<^:K01R#S`'X
+<< MC9@IW(CRJ<Y!9:]KHU_+9Z7/XG\)SZ](FE6UJ8)VM;A[>XC,@FD)EE"_O=T9
+<< MW*26V?-@@"N\8"!X$FU*17E<)&KF,&5@H8@?+R=J.2!V+'C`VR+;RKMS>SMC
+<< M&<A.<;?]GOM/_?9]L`'%^&K#6/#NEZ7=RZ)=W$YT>TTVYLHI8!+"]OYF'!:0
+<< M(R-YC=&!&%X.YME?5_"T@M_#RWGAJ/7C!J=Y?7<<:P.L2SB9C$#.R;QYDL?.
+<< M!GRMQ"G:*[Q;>5=N;V=L8SD)SC;_`+/?:?\`OL^V(V`@>!)M2D5Y7"1JYC!E
+<< M8*&('R\G:CD@=BQXP-H!B^(+/?JL-S_8]]/^[5?MEA?>3LPQ.)T\Q/,C7.0/
+<< MWGWI!M&?GM:5_P`C#JW^Y%_Z'+3KJ\ACO6TE[^[-XUF]RJM``KQJ45COV;2<
+<< MD94'(\S.`-N&Z5_R,.K?[D7_`*'+2ZC-RBBBF(****`"BBB@`HHHH`****`"
+<< MBBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`/,/%'_(@R_P#8
+<< M/A_]`2O3Z\P\4?\`(@R_]@^'_P!`2O3Z2&PHHHIB"BBB@`HHHH`****`"BBB
+<< M@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`
+<< M"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`*
+<< M***`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HH
+<< MHH`****`"N&^(_\`R*VI_0_RCKN:X;XC_P#(K:G]#_*.DQH\>HHHKZ$\,]6\
+<< M)_\`(EZ=_P!=)O\`T*M&^_Y!3?\`7W;_`/H=9WA/_D2]._ZZ3?\`H5:-]_R"
+<< MF_Z^[?\`]#KP*W\67JSVJ7\./H@_YBNJ_P#7V?\`T!*S?"&L^(+?P3H$,>E:
+<< M,T:Z9;!&DU2969?*7!*BV8`D8X!./4UI?\Q75?\`K[/_`*`E96@K,W@70UMW
+<< M5)CI%IL9AD`^0G^?\:SO8LU;SQ5K]C9RW,ND:(4C&2%U:<D^@'^B]S3=.\6^
+<< M(-2TJRU"/1=&CCN[>.X1)-6FW*KJ&`.+4C.".A-85S'-%X-D2X#"8-\^XY.?
+<< M-Z^_UHL8YI?ASHB6X8S'2['9M.#GRX^?;ZT[BL3Z[>:]/+-?ZA;V8LX8%6*V
+<< MLO$-Y;%7W-N8M%`N_=F,`-PNS(QN-8OA;7_$FO65MJJ6B-;-:7%F]K/KMQ'(
+<< M$>17A+;8CMD2+@2??=75RW2MW65F7PS*MPZO,%3>RC`)W#_/^%8GA?\`XE6D
+<< M^&[L?+::CIUK;W'8).(E\IST`W#,9)R21`HHN%BU=6?B74+#PW!?VEM--H^#
+<< M)<1^(+J%[H^0T18E(@0Q+!MV2?O+G#MFYJI\1ZMK-O>S:?%%!';O$]M:^)KR
+<< MW61BRE'/EQ*,J`XZ<[QD_**7Q/'?W<%II]C:I<"><-<K*[1QF!!N*LX5AAFV
+<< M(5(.Y6<8QEEPI]0\2:9X>"/#>&ZM[*\M1Y,+W3/<KL^RN6V$OE-Q+X"[B0P4
+<< M_*%=CL;%JWBZ*ZCDN(+:>%;2XLWB_M^Y7<CRAHCD0\21H"GF??;.XMD56NEU
+<< M62S\,#Q+'MM=&=%N[^SUJX$LFZ(PM*V%CV@,XD9R^502<D%@:9&IV&J:]LN-
+<< M46"?5(Y)9H[(2-'`;9<-"!&1(?,58R,/A5R0#EZZB!I)_#\3:W;PK+):@WL&
+<< MW?&"4_>+C)RO4=\CUHNPL=!K?A^+4M5L]6EN)T^P6UPBQ0RO'O9VB8%BC#<H
+<< M\K!1@5;=STIVE?\`(PZM_N1?^ARUC>!/$#ZWX,:.X,WVJUAVAIWW23P%<P3D
+<< MYRV],98@9=9!@8(&SI7_`",.K?[D7_H<M5U$;E%%%,04444`%%%%`!1110`4
+<< M444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`>8>*/^1!
+<< ME_[!\/\`Z`E>GUYAXH_Y$&7_`+!\/_H"5Z?20V%%%%,04444`%%%%`!1110`
+<< M4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1
+<< M110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%
+<< M%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444
+<< M`%%%%`!1110`5PWQ'_Y%;4_H?Y1UW-<-\1_^16U/Z'^4=)C1X]1117T)X9ZQ
+<< MX11G\&Z<J*68R38`&3]ZM2YL+Z>)85C9(_-21\PL2=IR`#D8_(U@:&;U?A]9
+<< M'3H[>2[\R7RUN'9(S\XSDJ"1QGMUJ'SO&W_/CX?_`/`V;_XU7@5OXLO5GM4O
+<< MX<?1'2Q6%\);B::-GDGE\QMD+*!P!@`D^GK7(VW@KQ;:V5M:1^(AY=M!'!'_
+<< M`,2V0?(BA5Z3`=`*L^=XV_Y\?#__`(&S?_&J/.\;?\^/A_\`\#9O_C59ED$G
+<< M@SQ9-&8Y=?5T/56TZ4@_AY]-MO!7BVULK:TC\1#R[:"."/\`XEL@^1%"KTF`
+<< MZ`59\[QM_P`^/A__`,#9O_C5'G>-O^?'P_\`^!LW_P`:HN!!)X,\631F.77U
+<< M=#U5M.E(/X>?3QX.\3#PU%H0U.S%O%;);QRC29/-38`$<'S\!U(#`XX(!%2>
+<< M=XV_Y\?#_P#X&S?_`!JCSO&W_/CX?_\``V;_`.-4`3?V!XV_Z#]M_P""8_\`
+<< MQVC^P/&W_0?MO_!,?_CM0^=XV_Y\?#__`(&S?_&J/.\;?\^/A_\`\#9O_C5`
+<< M$W]@>-O^@_;?^"8__':JZCX0\6ZK82V-YKEO);3`++'_`&.R[UR"5)$N0#T.
+<< M"#@\$'FI/.\;?\^/A_\`\#9O_C5'G>-O^?'P_P#^!LW_`,:H`M1Z%XKAUB+4
+<< MFU:UB01>3<QPZ6Z">+<&PQ:5N1AMIQ\N]_4UUNE?\C#JW^Y%_P"ARUQMO+XO
+<< M-S$+FRT-;<N/-,5W*6"YYV@Q@$XZ9(KLM*_Y&'5O]R+_`-#EIH3-RBBBJ$%%
+<< M%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`444
+<< M4`%%%%`'F'BC_D09?^P?#_Z`E>GUYAXH_P"1!E_[!\/_`*`E>GTD-A1113$%
+<< M%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`44
+<< M44`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!111
+<< M0`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`
+<< M!1110`4444`%%%%`!1110`4444`%<-\1_P#D5M3^A_E'7<UPWQ'_`.16U/Z'
+<< M^4=)C1X]1117T)X9ZMX3_P"1+T[_`*Z3?^A5)XI\0W^A_8S9'[0\@518J7\V
+<< M8;`28]N<;>IR",=P<9C\)_\`(EZ=_P!=)O\`T*IKS2_$5Q<M+%K5G;Q,!LB-
+<< MJI*K@8R3)DG&/3Z#I7@5OXLO5GLTOX<?0R=.U.XU3Q#IMQ/>QW6_2I'W0EO+
+<< M!,J9VAB2.@!SSQR!T&'%9:4++1#>:AIFFM?)?RRWFISS;&:&=$1%"SQ*#M<G
+<< MO]WIUKI;73;FS\21S:CJ\%W=M9R+'%%"$(3>A+$AB.N!SC.3Z5I^`M,\W2M&
+<< MU;SL?9HM0MO*V_>\VZ5MV<\8\G&,<[NV.91;*9T+P3:"XM[R*[EO+)XH+D6_
+<< MVT^9,T8DVQ(&8N=OSE5+E5Y;@9J-[/X;I*L3/.)#$)V3S[O,499T+R#/[M5:
+<< M-U<O@1D8?:2,])<^%YGO+F_M+^.*\;4QJ-N9;<R1QM]E6V*NH=2X*AR,,N"1
+<< MU`(--/`NW3->M3J.9-9T][66008$<CR7,CNJ[ON[KIL*3D!0"Q)S3$<FEIX:
+<< MN-5MK<6$EE`UQ=VTCS3W<FZ2&]M[9`A#J"'$Q&X9"L1DG8P,FK+X#M+97M8I
+<< MPWFP,9KJ2]B@>W:YABDE25F5'4+,"&5B.0>1747'@7SKVWE74=L-O=RW,:&#
+<< M+?O+RWNV4MN&?GA=0<#"NO4J2V'I7A37+^[TR"\CDL-+T:WB@LQ<P1>>RI<6
+<< MTJAC'/(KG;:[6;$>"P(4Y(4`DM]*\%WFN:?IMMIM\_VR*X=F>>\C>!XO*.R2
+<< M-B&CRLH8%]O\.,[UK/U?P[86R>(M0L[2!+'0,^=;3373R76VW2=ML@G41Y$@
+<< M091\$;N<[1W%OX8^S>*I]>2\S)-+(6B,7`C>&W0J#G[VZUC8-TP67;DAA7U3
+<< MPM>7S:Q;V^IP0:;K6?M\4EH9)OFB6%O*D$BA/D1<;D?#9/(.T`''W6F>'X_$
+<< MLFE)I4ZJ-5M]-#^;>28WVYN&?*O@Y`"8'^K_`-8Q*D+5SQ%X(MK75M'@TM;2
+<< M&#4+@VK"Z^US,C"&:7>"MR@(Q$%VX[DY[5UG_",?\3S^TOMG_,5_M+R_*_Z<
+<< MOLNS.?\`@><>V.]:&HZ9]OOM)N?.\O\`L^[:YV[<^9F&6+;G/'^MSGG[N.^0
+<< M`<LV@>#;.\*01S+>PW7V9`;FX8"X$'V@+RV#^[^;GCMUXK=TK_D8=6_W(O\`
+<< MT.6LU=$EN/$>J:M<6\]K:1GS;>WD=#YMT(GA>Y^4L=IA\M%4L.CDH&PU:6E?
+<< M\C#JW^Y%_P"ARTNHS<HHHIB"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@
+<< M`HHHH`****`"BBB@`HHHH`****`"BBB@#S#Q1_R(,O\`V#X?_0$KT^O,/%'_
+<< M`"(,O_8/A_\`0$KT^DAL****8@HHHH`****`"BBB@`HHHH`****`"BBB@`HH
+<< MHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB
+<< M@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`
+<< M"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`KAOB/_
+<< M`,BMJ?T/\HZ[FN&^(_\`R*VI_0_RCI,:/'J***^A/#/5O"?_`")>G?\`72;_
+<< M`-"K2UE+N2TF2PFCANV@4122+N56V#J/_P!?T/0YOA/_`)$O3O\`KI-_Z%3;
+<< M[PWI4YEO[I+AW:1$8_:YLDL=HP-V`!Z<8`X]*\"M_%EZL]FE_#CZ'/\`A2WN
+<< M[75;"&_61;M=/N?-\PY8L;G.2>^>N>^<U-I>F_VI'X6@_L32M7VVFK/Y&IOM
+<< MC7_2X1N!\N3YN<=!P3SV.]8Z#IFEZE<M:1.)X<P.[32..0K$#<3[=NU.\):G
+<< M!I_AK2%CTN?4=3D^VF&.V$0D6$7'[P[I&10NXQ9&[))4X."1*+9<.LZE;ZG<
+<< M:+IR:;:P)J<6E6'^BL5MU6R%RS,JNH<$#8JKLV]<MTK/;QKKQBUB=(--\C1+
+<< M)[JZ+(^ZX:*>ZB=$&["!Q;;@Q+>7G!$F<CI+:;1]?EO]*N=%PTD4-W>V][:I
+<< MAV9GC4.#D.RFVQNY4A4*LPP:N7MMHNE:->SW5G:0Z?#9&.X`MP5^S1JQV%0.
+<< M452^%P1R<#FF(\[.H7D6LZ;<WA@OMVH:C;PK<1EO+C.LV<2Y)8Y9.2A&`N$&
+<< M/ER9-7\1:]J&F:%*XTV2#5TL]2M;98GB:%A>V6R-Y=SAAB?!81C[N0O:NL6^
+<< MTR[U@JWAF=YEEB6[NOLT+_9;AEA=4DPQ<L`MN2Z!D&U"6PA*T_"WA70VN[O7
+<< M%62\NWN)[=Y;NTMHVWQ7!WL?)C0.3+"KAGW$;01M);(!'I^K:Q=?$"VTRYNH
+<< M/]`BO8KLPQ.D=U\ME(C*A<[&7[1C)+\!\8W_`"Y_B&PL[K3?B#JMQ:03:EIG
+<< MF?8+R2,--:;;"&1?*<\IAV9QM(PS$]37<7`TNTOK0SP0)=7=V3`WDY9YQ"V6
+<< MR!PWE(R[C_"-N>@JG?V>@W7BK3TO='M+G5#;R7%M=RVR.T2PO'P'/S*0TP(Q
+<< M[GCN`<G=)>7'CJ0>?`87\2V\&R6$N?+BTTS["=PRH<[T&,))E_F)Q6QXOT+1
+<< M]3\0>%I;_2K&[DDU!X'>>W20M&+2Y<(21RH8!L=,C/6NH^P6?G^?]D@\[S?/
+<< M\SRQN\S9Y>_/][9\N>NWCI4DD$,SPO+%&[POOB9E!*-M*Y7T.UF&1V)'>@#B
+<< M9-9U*;QEJ6C62:;:P+)/+<R-:L\DZQP6)ZAU`<BX*[B#@(@P<<[VE?\`(PZM
+<< M_N1?^ARTV&ZT>\U+78K:W@74]//E73[$$A\R&-PV1\VUE6-<G&3%C^$4[2O^
+<< M1AU;_<B_]#EI=1FY1113$%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1
+<< M110`4444`%%%%`!1110`4444`%%%%`'F'BC_`)$&7_L'P_\`H"5Z?7F'BC_D
+<< M09?^P?#_`.@)7I])#84444Q!1110`4444`%%%%`!1110`4444`%%%%`!1110
+<< M`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!
+<< M1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%
+<< M%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!7#?$?_D5
+<< MM3^A_E'7<UPWQ'_Y%;4_H?Y1TF-'CU%%%?0GAGJWA/\`Y$O3O^NDW_H5:-]_
+<< MR"F_Z^[?_P!#K.\)_P#(EZ=_UTF_]"K1OO\`D%-_U]V__H=>!6_BR]6>U2_A
+<< MQ]$'_,5U7_K[/_H"5E>%8KVVTK0=9M=.GU"."+4;5X+9XUD!END8-^\=%VCR
+<< M6!^;.67`(R1J_P#,5U7_`*^S_P"@)65X5EO;G2M!T:UU&?3XYXM1NGGMDC:0
+<< MF*Z10O[Q'7:?.8GY<Y5<$#(,(IFPESK=IXFNM5D\,7T\=YI]M$$M;BV8Q-'+
+<< M<-M??(GS;94)V[E!R`S`9/+^*/"OB#4M5U.XM=,G^UW<5[!+/`+.*WG@:UF2
+<< M!"_%PS;C!N#DH'4D?*J$=QI-QJ,?B:_TJ]OOM<=MI]K*CF)4+,\MRI9L?Q%8
+<< MXP<87*DA5!Q67XE^(5EHLNKZ;&(QJEI933VXDFB=9)$@,P4QI)YJC:I.651Q
+<< MP>5S0B2[T>XM]<MUT;2)['9+;[;NUNPEGY";!(LMON`,AC5HU(C?`\KYUQ\F
+<< M'J'@2^N=&N([.UCAU._O=52XN))NEM.MWY2DY)$1=X'\M>`QW%=V36Q#J&IQ
+<< M:W#%J6I:E8`/!';Q7%C')!<HR)N,\T:;$G,C2H`LB#<(\(P(#QVGCQ+'3+^X
+<< MU>WOG2VN]11;E855)#!).XA3D%F$,1.[&P[2"^_(H`KSZ-JVM>-+;7+W0?)L
+<< MK>6R=+>>:*24^6+Q"Q4,55D>XCDX8_*N02_R#'B\(:D'L@GAOR;JVT_R=5O-
+<< MUN/[7<7%J\@R'W2>:D,X_?!<^9AL;FQVFK^*&L?$^F:+;6DD\L]Q"MQPO$4L
+<< M=TP926'*M;$MG^'H"2`,MO'1?6M/F6ROH](N=/EFMRRP_P"GNTUM'`8\.67/
+<< MG8_>>7_K!NQ@[0#/7P;>W4X,=C_9NE7<L]JVF_NQ]DLI4MS*N$8JN][61<1D
+<< MD?:O,R&4BI-.\$W=WX@AO/$EO'J$;I=_:1*$\N60"SAC9XP=K"1;9I@I!"%@
+<< M/O(IK<?QU80>=%<65]#>013/):,L;2!X_)Q$-KE6D?[3#L"DY+XR&XH;QU82
+<< M:F=/T^ROM2N&WF+[&L;)*%CMY2P<N%"[+E"&8@'!`.2H8`YG0O!^NPV_V[4)
+<< MY[2^D-M]O<7(,ES''9VV<LN=["XA9/F.-DD^/O@UV6E?\C#JW^Y%_P"ARUSN
+<< MG^/+>[U+78;F?_B6R&W?2;C8?WJ2PVP*;0N5P]S"<MU\[L$..BTK_D8=6_W(
+<< MO_0Y:749N4444Q!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%
+<< M%`!1110`4444`%%%%`!1110!YAXH_P"1!E_[!\/_`*`E>GUYAXH_Y$&7_L'P
+<< M_P#H"5Z?20V%%%%,04444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!
+<< M1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%
+<< M%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`444
+<< M4`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`5PWQ'_Y%;4_H?Y1
+<< MUW-<-\1_^16U/Z'^4=)C1X]1117T)X9ZMX3_`.1+T[_KI-_Z%6C??\@IO^ON
+<< MW_\`0ZSO"?\`R)>G?]=)O_0JT;[_`)!3?]?=O_Z'7@5OXLO5GM4OX<?1!_S%
+<< M=5_Z^S_Z`E5O".BC4O".EW<-_=Z?>6[W<:7-J(RWEO<,70B1'7!*(<XS\HP0
+<< M"0;/_,5U7_K[/_H"5;^'G_(DV?\`UUN/_1\E0BF2'PE(EZ;RU\1ZS;7#VZ03
+<< MR*8)#-M>1PS>9$V#NE?A=J@$````"OJ7@&RU,2P2ZGJ4=@[W,@LHS%Y:27$<
+<< MJ2N&,9?)\^5L%B`6Z8``ZRBJ$8][X?2^U%;B;4+XVHECG>PWJ87EC*LC9*EU
+<< MPR(=JLJDKD@[FW5[GP=I=YIT=A<^?+:K=W5TR%\;S<"<2*2`#MQ</C&",+SP
+<< M<]!10!S=OX-MHM4&JS:EJ5WJ(>%_M,\B$@Q>:HPJH$4%)Y$("@8.X8?+FNO@
+<< M&R4P*VIZD\%I;_9["!C%MLE$D4B%"(]S%&@BQYA?.WYMV3GK**`.?A\(6"3V
+<< M]S<2SWEY'=F[DN9Q'ON'V*@#A5"[1Y<+`*%^:&-N67)DTOPIIND7L-U:"1'A
+<< M2X15^4+MF>-L'`'"+#'&@_A10O.!C<HH`YFP\':7H>EK%#Y\WV8K-"TS\HZ6
+<< MBVH/R@`YC7G(/+$\<8M:5_R,.K?[D7_H<M:UW_QYS_\`7-OY5DZ5_P`C#JW^
+<< MY%_Z'+2ZC-RBBBF(****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`H
+<< MHHH`****`"BBB@`HHHH`****`/,/%'_(@R_]@^'_`-`2O3Z\P\4?\B#+_P!@
+<< M^'_T!*]/I(;"BBBF(****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`
+<< MHHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"B
+<< MBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`***
+<< M*`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`*X;XC_\BMJ?T/\`
+<< M*.NYKAOB/_R*VI_0_P`HZ3&CQZBBBOH3PSU;PG_R)>G?]=)O_0JT;[_D%-_U
+<< M]V__`*'6=X3_`.1+T[_KI-_Z%6C??\@IO^ONW_\`0Z\"M_%EZL]JE_#CZ(/^
+<< M8KJO_7V?_0$JW\//^1)L_P#KK<?^CY*J?\Q75?\`K[/_`*`E6_AY_P`B39_]
+<< M=;C_`-'R5"*9U%%%%4(****`"BBB@`HHHH`AN_\`CSG_`.N;?RK)TK_D8=6_
+<< MW(O_`$.6M:[_`./.?_KFW\JR=*_Y&'5O]R+_`-#EI=1FY1113$%%%%`!1110
+<< M`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`'
+<< MF'BC_D09?^P?#_Z`E>GUYAXH_P"1!E_[!\/_`*`E>GTD-A1113$%%%%`!111
+<< M0`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`
+<< M!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%
+<< M%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`4444`%%%%`!1110`44
+<< M44`%%%%`!1110`4444`%<-\1_P#D5M3^A_E'7<UPWQ'_`.16U/Z'^4=)C1X]
+<< M1117T)X9ZMX3_P"1+T[_`*Z3?^A5HWW_`""F_P"ONW_]#K.\)_\`(EZ=_P!=
+<< M)O\`T*M&^_Y!3?\`7W;_`/H=>!6_BR]6>U2_AQ]$'_,5U7_K[/\`Z`E6_AY_
+<< MR)-G_P!=;C_T?)53_F*ZK_U]G_T!*M_#S_D2;/\`ZZW'_H^2H13.HHHHJA!1
+<< M110`4444`%%%%`$-W_QYS_\`7-OY5DZ5_P`C#JW^Y%_Z'+6M=_\`'G/_`-<V
+<< M_E63I7_(PZM_N1?^ARTNHS<HHHIB"BBB@`HHHH`****`"BBB@`HHHH`****`
+<< M"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@#S#Q1_R(,O_`&#X?_0$KT^O
+<< M,/%'_(@R_P#8/A_]`2O3Z2&PHHHIB"BBB@`HHHH`****`"BBB@`HHHH`****
+<< M`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`
+<< M****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`H
+<< MHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"N&
+<< M^(__`"*VI_0_RCKN:X;XC_\`(K:G]#_*.DQH\>HHHKZ$\,]6\)_\B7IW_72;
+<< M_P!"K1OO^04W_7W;_P#H=9WA/_D2]._ZZ3?^A5HWW_(*;_K[M_\`T.O`K?Q9
+<< M>K/:I?PX^B#_`)BNJ_\`7V?_`$!*Q_"EQKT'AJU%GJ>FPV[23LD<VER3.O[Z
+<< M0'+BX0'D$_='&.O6MC_F*ZK_`-?9_P#0$K,\,@MX3L@&*DFX`88R/](EYYK,
+<< MLT)M6\1PP32G6M(80J6<+HLA(P,X_P"/OKBL_1_%'B74?#RZO=:MH=G'NGWY
+<< MTJ1E18I7C+%C=#`^0M[9J.&QFL-#U.*=_,9O-<29^^"@Y/OUK(TZTGO_`(37
+<< M5G:IYEQ<0ZE%$F0-S-<7``R>!R>].XK'63ZIXEM[>29]9TDK&A<@:))G`&?^
+<< M?NN>\,>-O&'B);P27.AVDL$K!4_LZ:3S(@[H),_:!C+QR#;U&W/0BC0=#O/#
+<< MO@+^S+[4'O9X;9P7/W8QM.$0XR57H,\_0849&A_Z#X4LM=7_`)A]W>_:/>U:
+<< MY?S?^^=J2<`L?*VC[QHN%CK[O7?$UA:O=7FN^';:W3&^6;39$1<G`R3<X')`
+<< M_&BTUWQ-?VJ75GKOAVYMWSLEATV1T;!P<$7.#R"/PJIXKM+N]T%HK%)GN%N;
+<< M:51`8Q)A)T=BOF?)N`4D;N,BLBPT_6[*-M0*WUP[ZI]KEMI)(5N)8OLP@"ML
+<< M*Q$APKXSC:H/WN*5V.QT4FN^)HI&CDUWPZCKLRK:;("-[%4X^T_Q,"!ZD8%/
+<< M.K^*UG2`ZQH`F=6=8SI<NYE!`)`^T\@%ES]1ZUR\6E:]+IUG%=B:1TMM'\P2
+<< M3AOWT5P7N#][EMH4D_Q8&,XJUIVFZFGC1KZ\AN658+N,W+7`:%E>:)H5CCW9
+<< M4B-,,=BY*Y);J2["QVFBZU=:A;ZII^I>1_:%F@<O`C(DL4BG9(%+-M^99$VE
+<< MB?W>[@,!6=J+>9K%S$NGV5PR?,7N%4GEF&!E&_NG\ZQ-1U"ZC\9:;'I=L+B>
+<< M")Q?'>%"6TI52N>0&W!)0"`6$+`'D@R>-GGCT[Q3+;74UM/%I[2)+"0'4KYK
+<< M<$@XSC&1R,\$'!#N!H>3)_T!](_[X7_XU1Y,G_0'TC_OA?\`XU7.>)8IXM4O
+<< M-2ED>;3K2P26>W@U>>UEA56E9W$<?#EE``W,N3&1D=:VM3O+_P#M2STS3Y+:
+<< M":>":X,UQ"TJA8VC7;M#)R3*#G/&W&#G(5P+/DR?]`?2/^^%_P#C5'DR?]`?
+<< M2/\`OA?_`(U7'Z)KE_)]MUR,6R65[?V(DM&C9I`T]O:KD2[@,+Y@.-G.T\C/
+<< M#(_%.O0I/%;V4-R;'SYKN7(6-P+F=`-TLX,*XA)S^\"AON@*`34#L_)D_P"@
+<< M/I'_`'PO_P`:H\F3_H#Z1_WPO_QJN<U+4=8O-*FO+:[MK6'^U(K2&,0.75DO
+<< MDA+.XD&Y6"ME`J\-C/&3.LVIFXUN]A@2^U2R:&PA1`$0*8XI)'57<8),I)7>
+<< M-PBC7((W4`;GDR?]`?2/^^%_^-4>3)_T!](_[X7_`.-5AVU\9KS0=2CN$GFO
+<< M)Y]/N'2V>V5U597YC<E@R/"5&XG&^3CYN*NKE[NXU>=I9HWAU&PTR,PRM&4A
+<< M>2W>3:RD,K/YQ#%2,A$_NYH`Z;R9/^@/I'_?"_\`QJCR9/\`H#Z1_P!\+_\`
+<< M&JYFZO[W2=:33=/2;4((Y%,*373E_.:VN9#"92W/^KB;$F[;YN>FS;2?7[T:
+<< MW:3320M=P6UY;W#O9O!'99:T8M*I=BRJ&!W(VT@CYE7,@-0.S\F3_H#Z1_WP
+<< MO_QJCR9/^@/I'_?"_P#QJLG6;>6\\8:%`#;&&."XN6CN8#*NY)(`&4;AMD`9
+<< MMK\[<GCFLR+Q+XCN=+T1H+*VDO=3M&O2+>(2+%&JQ#&))HLDF7.=WR_=PWWZ
+<< M+@=3Y,G_`$!](_[X7_XU1Y,G_0'TC_OA?_C5<S:^+-9O;^*2+3(5T]9+:&=O
+<< M.B=`TR1.2)O-&<><``L;;]HPWS_+KZMJM_8ZQ9Q;4M]-D:)&NGMVG$DKOM$7
+<< MRN#$>F'964E@#@@!B[`O^3)_T!](_P"^%_\`C5'DR?\`0'TC_OA?_C5<S9>*
+<< M-333-/N-0>SDEU33A=6PMK5E\N4M"B1D-(=^Y[A!G<@&WD@'*OT[Q!KFI7G]
+<< MD&*VL=1B:8RRW%OO4JBP,!Y:3':2+E>?,;[G3YL*:@='Y,G_`$!](_[X7_XU
+<< M1Y,G_0'TC_OA?_C58>G>(=7O->$<E@B:7)=W%I'(QC4[HC(-P;S2SDF(_)Y2
+<< MX!)R0N6M:G]MU'P?;E+VS2[G^RLTT%V\$,I,D998Y5RP5^54C).X>M%P-+R9
+<< M/^@/I'_?"_\`QJCR9/\`H#Z1_P!\+_\`&JH>'[B&"*XLIM\%U%=^0Z37\ET'
+<< MD,2R@1O+\S#80<8&"&XXR<M;*_N;>XNM'O;Z6TD5`SS73,]]^\0R/#DA804$
+<< MBJ4V*QDR-JJC$N!T?DR?]`?2/^^%_P#C5'DR?]`?2/\`OA?_`(U6!I>H:C%X
+<< M<\0SVMI>,]G),+"WNY/M$C%(5)0NKL9/WOF#[Y(.5XVX&7K4T=N@MK&35YKF
+<< M]^SO#?2:JX@NT-S;J^PQR'R\^:!E8U`!;:,<$`[/R9/^@/I'_?"__&J/)D_Z
+<< M`^D?]\+_`/&JY:%KBT@,\K.+O3=8@M5C:=IPD<X@5X_.?#RJ1,)/FQAPHP50
+<< M9[>BX%'R9/\`H#Z1_P!\+_\`&J/)D_Z`^D?]\+_\:J]12N%BCY,G_0'TC_OA
+<< M?_C5'DR?]`?2/^^%_P#C57J*+A8K&6^)4FSLB%P%7S/E&.F%\O'&!CZ5+]MU
+<< M/_GTL?\`OH?_`!NI**+@1_;=3_Y]+'_OH?\`QNC[;J?_`#Z6/_?0_P#C=244
+<< M7`C^VZG_`,^EC_WT/_C='VW4_P#GTL?^^A_\;J2BBX$?VW4_^?2Q_P"^A_\`
+<< M&Z/MNI_\^EC_`-]#_P"-U)11<"/[;J?_`#Z6/_?0_P#C='VW4_\`GTL?^^A_
+<< M\;J2BBX$?VW4_P#GTL?^^A_\;H^VZG_SZ6/_`'T/_C=2447`C^VZG_SZ6/\`
+<< MWT/_`(W1]MU/_GTL?^^A_P#&ZDHHN!']MU/_`)]+'_OH?_&Z/MNI_P#/I8_]
+<< M]#_XW4E%%P(_MNI_\^EC_P!]#_XW1]MU/_GTL?\`OH?_`!NI**+@1_;=3_Y]
+<< M+'_OH?\`QNC[;J?_`#Z6/_?0_P#C=2447`C^VZG_`,^EC_WT/_C='VW4_P#G
+<< MTL?^^A_\;J2BBX$?VW4_^?2Q_P"^A_\`&Z/MNI_\^EC_`-]#_P"-U)11<"/[
+<< M;J?_`#Z6/_?0_P#C='VW4_\`GTL?^^A_\;J2BBX$?VW4_P#GTL?^^A_\;H^V
+<< MZG_SZ6/_`'T/_C=2447`C^VZG_SZ6/\`WT/_`(W1]MU/_GTL?^^A_P#&ZDHH
+<< MN!']MU/_`)]+'_OH?_&Z/MNI_P#/I8_]]#_XW4E%%P(_MNI_\^EC_P!]#_XW
+<< M1]MU/_GTL?\`OH?_`!NI**+@1_;=3_Y]+'_OH?\`QNC[;J?_`#Z6/_?0_P#C
+<< M=2447`C^VZG_`,^EC_WT/_C='VW4_P#GTL?^^A_\;J2BBX$?VW4_^?2Q_P"^
+<< MA_\`&Z/MNI_\^EC_`-]#_P"-U)11<"/[;J?_`#Z6/_?0_P#C='VW4_\`GTL?
+<< M^^A_\;J2BBX$?VW4_P#GTL?^^A_\;H^VZG_SZ6/_`'T/_C=2447`C^VZG_SZ
+<< M6/\`WT/_`(W1]MU/_GTL?^^A_P#&ZDHHN!']MU/_`)]+'_OH?_&Z/MNI_P#/
+<< MI8_]]#_XW4E%%P(_MNI_\^EC_P!]#_XW1]MU/_GTL?\`OH?_`!NI**+@1_;=
+<< M3_Y]+'_OH?\`QNC[;J?_`#Z6/_?0_P#C=2447`C^VZG_`,^EC_WT/_C='VW4
+<< M_P#GTL?^^A_\;J2BBX"7%]=V\-I^XM6FN"1MPH5<;CUV9/"^G>F?;=3_`.?2
+<< MQ_[Z'_QNC4?]9I/^^W_H,M<?-+?+\,M<D&IWGVNW_M';=[E\T^7-+CG&!PH'
+<< MR@8'W=N!A@=A]MU/_GTL?^^A_P#&Z/MNI_\`/I8_]]#_`.-UR7B6*>+5+S4I
+<< M9'FTZTL$EGMX-7GM9855I6=Q''PY90`-S+DQD9'6I_$NHWEEXBTJ.&X>WM);
+<< M2Z^U7`Y6V0/!^]*G@D9VAB"$WEFRJL"`=-]MU/\`Y]+'_OH?_&Z/MNI_\^EC
+<< M_P!]#_XW7"L+VT\07T\<UR+.UU2SLTE;4II&17CMUV>0WR.&,AR[-N&\MRRC
+<< M/?4@(_MNI_\`/I8_]]#_`.-T?;=3_P"?2Q_[Z'_QNI**+@1_;=3_`.?2Q_[Z
+<< M'_QNC[;J?_/I8_\`?0_^-U)11<"&^U2YM=5&GP6]M-*[!(]P5-['><#Y2!Q&
+<< MQY(].M9][XK_`+-N6MKZ70K6=>L4^I6R,/P(S5+QC>QZ9K:7\V1#;W*/(5P2
+<< MJE;A2P&<MC.2!DX!.,`U!/XUTC9=V]MJ&DRPR3RNDG]JVR9#L6'#."#SW'!^
+<< ME=-"G">DFEZ_\.CFQ-:=**<(.7H;5EK]SJ!;[-#IT@"JX>.9)$=26`961"I&
+<< M58=<@J:N?;=3_P"?2Q_[Z'_QNN8\(7=K<W-REO<6TSQ6L0F-M*LJ*S3W+`;E
+<< M)!^4J>">M<YJ,FN_\([K_DW]X+>234+P70F?S+?[/+*OE(XX125M\+W7S^1\
+<< MM9U8J-1QB[I&U*3E!2DK-GI7VW4_^?2Q_P"^A_\`&Z/MNI_\^EC_`-]#_P"-
+<< MUC6VKW\VM#2VMT6:&>5[F38P3[/C,14Y^\Q=!R,$Q3@?=%,^S#6M9U."^GO(
+<< MA9R(EO#;7<MOF-HU;S#Y;*6RY=<DD?N\``ALY%FY]MU/_GTL?^^A_P#&Z/MN
+<< MI_\`/I8_]]#_`.-UQ^J>*M3L--N=31+-K<R7MO!`8FWH]ND[!V?=AE8VY^4*
+<< MI&\?,=O+-3\4ZQI$&H--]AN&M&FMAL@>,-*MHUTLG+G"X`0IUSEMP^[3`[/[
+<< M;J?_`#Z6/_?0_P#C='VW4_\`GTL?^^A_\;KG%UO4[3Q%::+>-9W#RR1EYX8&
+<< MB&QXKE@H4NWS!K<<YP0V,#&3F1>(M374-?U-I(6M--LI'>SVM^\\J>\1=K;L
+<< M(Q$2[CM;.!P,"@#MOMNI_P#/I8_]]#_XW1]MU/\`Y]+'_OH?_&ZX^/Q!XE%W
+<< M;:=/9V<-W/<I&'G54PC13MN\N.:0_*8<@E@'R5^7&ZNTI`1_;=3_`.?2Q_[Z
+<< M'_QNC[;J?_/I8_\`?0_^-U)11<"/[;J?_/I8_P#?0_\`C='VW4_^?2Q_[Z'_
+<< M`,;J2BBX$?VW4_\`GTL?^^A_\;H^VZG_`,^EC_WT/_C=2447`C^VZG_SZ6/_
+<< M`'T/_C=97C"2YE\#7[W"Q(=K`)%R/X><[1Z^G:M:::*VA,TS$("!\HRS,>BJ
+<< M.['L/Y`$U@>*)YIO!VK"9HPZ*088SGR#\OR$_P`3="3ZG'&,!H#S:BBBOHSP
+<< MCU3PQ+'#X'T^25U1!)-EF.`/F'>K%S?VL\2PKJ-FD?FI(^6!)VG(`.X8_(U'
+<< MX1=D\&Z<R,58238(.#]ZKFI>(%TF.%[NYN_WTGE1+#'+,[MM9L!4!/16/3M7
+<< M@5OXLO5GM4OX<?1%>*_M1+<33:C9O)/+YC;&"@<`8`+'T]:JI8>%$ACB+!U0
+<< M$+NO\XR2Q^F22>.,DUJV&M_VE`TMM=7!"ML=)`\;HV`<,C`,IP0>0,@@]"*M
+<< M?:[G_GXE_P"^S6=RS!^P^$O[L?\`X'4V/3O",42Q(J[%+%5.H$XW,7;&>F69
+<< MCCWK9GU9K::VBENY5>YD,4(W,=S!&?'M\J,>?2I_M=S_`,_$O_?9HN%C!^P^
+<< M$O[L?_@=5NPE\/:9:"ULY(XX0[N%^V*>68LQR1GEF)_&M/[7<_\`/Q+_`-]F
+<< MC[7<_P#/Q+_WV:+@8UK'X;LK2&UM[B2."&-8XT&IMA5`P!U]!4OFZ#_S]R_^
+<< M#,_XUJ?:[G_GXE_[[-'VNY_Y^)?^^S1<#+\W0?\`G[E_\&9_QH\W0?\`G[E_
+<< M\&9_QK4^UW/_`#\2_P#?9H^UW/\`S\2_]]FBX&7:'0+:XGDM74W5T5#NUX)'
+<< M<@849.3@=E'&23U)S;U#2K74+Z_6^6UFMIMJ-!<1EPVUV;)&TCJ1CW%33333
+<< MPR1/<3['4JVV5E.#QP0<C\*P/^$0T7_GWG_\"YO_`(NBX&K)H.D2_8_,M].?
+<< M[%C[+NM\^1C&-GR_+C:O3'0>E/O]'TW5(%@U".QNX5;>([B$R*&P1G!4\X)_
+<< M.L?_`(1#1?\`GWG_`/`N;_XNC_A$-%_Y]Y__``+F_P#BZ6@&K_8.D?VG_:?V
+<< M?3O[0_Y^OL_[W[NW[^W/3CKTXJ"#PQI$<-JLRVEU+;2/-'/<Q;Y%E=][N#L^
+<< M5B_S?+@`]```!1_X1#1?^?>?_P`"YO\`XNC_`(1#1?\`GWG_`/`N;_XNGH!J
+<< MOH.D275Q=/;Z<UQ<QF&>4V^7E0@`JQVY9<`#!XX%02>&-(ED;>MHUN]LEL]J
+<< MT6Z%TC8M&-A3`V$MC&!\W.<+AVG^!_#\P4RVD[??S_ILPZ;<?Q^YJ\W@#PT.
+<< MEE/_`.!T_P#\732$V5HM$LH;Z&ZCGB3[/;&V@B12L<*$@L%`7OL0<Y`"#&,G
+<< M++KP]IM[=RSW36\ZSP+!/!+&7CE5&+)N5E/*EFQC'WCG.%Q9/@'PYCBRG_\`
+<< M`V?_`.+J,^`_#O\`SZ3_`/@;/_\`%T<HN8:N@Z0MC'9+;Z<+2/=L@%O^[7<&
+<< M#87;@9#L#ZACZFGVNCZ;8I$EI'8VZPJR1+%"4"*Q#,%PO`)`)QU(%,/@7P\/
+<< M^7.?_P`#9_\`XNF'P+X?'_+I/_X&S_\`Q='*',68M-LH/)\HVD?D1F&'9&1Y
+<< M:<?*OR\+\J\#CY1Z5#<Z#I%Y8Q65U;Z=/:0X\J"6WW1I@8&U2N!@'`QVJ!O`
+<< M^@\8M;@?]ODW_P`743>"=#`.+>?/_7Y-_P#%T^0.8OOH^FRZA%J$D=B][$NR
+<< M.Y:$F1%YX#;<@?,?S/K0^CZ;+J$6H21V+WL2[([EH29$7G@-MR!\Q_,^M9C>
+<< M"]%[03_^!<W_`,73#X,T<#_CWG_\"YO_`(NCD%SHLZ3X2T/1M+_L^TAL1"\"
+<< MP3L8/FN%"[?WF$&\D$YSZGUI_P#PBOA[[#]B_L[2/LGF>=Y'V0>7OQC=MV8W
+<< M8XSUQ6>?!VD#_EC.,_\`3W+_`/%4P^$-)'6&?_P+E_\`BJ?('.C=31]-BU"7
+<< M4(X[%+V5=DERL)$CKQP6VY(^4?D/2G_V;9?8?L6;3[)Y?D^1Y9\O9C&W;MQM
+<< MQQCIBN>_X1'2?^>-P/\`MZE_^*IA\):6/^65Q_X%2_\`Q5'('.CH;?1]-M((
+<< M(+:.QAAMV+PQQPE5B8@@E0%X)#-T_O'UJK;>%?#UGYOV73M(@\Z,PR^5:!=Z
+<< M'JK83E3CD'BLC_A$]+.?W-P/^WJ7_P"*I#X3TOM'.?\`MZE_^*HY&'.CJ8;.
+<< MWMX(X();>*&-0B1HC*JJ!@``+P`*SG\*^'I)+B1].TAGN<^>QM`3+E@QW'9\
+<< MWS`'GN`:Q?\`A%-,'6*?_P`"I?\`XJC_`(133/\`GE<?^!4O_P`51[-ASHWD
+<< M\/:;"]@+=K>W@L6>2"W@C*1J[`J6P%ZX9QCI\Y)!."-#R8_^?F+\F_\`B:Y'
+<< M_A%-,Q_JI\>OVJ7_`.*H_P"$4TP8_=3_`/@7+_\`%4>S#G1UWDQ_\_,7Y-_\
+<< M31Y,?_/S%^3?_$UR0\*:4<_NY_\`P*E_^*H_X132_P#GC/\`3[5+_P#%4>S#
+<< MG1UODQ_\_,7Y-_\`$T>3'_S\Q?DW_P`37)CPKI73RI\_]?4O_P`52CPGI7'[
+<< MF?\`\"Y?_BJ/9ASHZOR8_P#GYB_)O_B:/)C_`.?F+\F_^)KEAX2TK',,_P#X
+<< M%R__`!5`\):3U\F?'_7W-_\`%4>S#G1U/DQ_\_,7Y-_\31Y,?_/S%^3?_$UR
+<< MX\):0>D%Q_X%R_\`Q5*/".DXY@N/K]KF_P#BJ/9ASG3^3'_S\Q?DW_Q-'DQ_
+<< M\_,7Y-_\37-KX/T@\FWN/_`N;_XJG#P=HY'^HGS_`-?<W_Q5'('.CHO)C_Y^
+<< M8OR;_P")H\F/_GYB_)O_`(FL$>"]&[P3_P#@7-_\53E\%Z(>MO/_`.!<W_Q=
+<< M+D'SFYY,?_/S%^3?_$T>3'_S\Q?DW_Q-8X\$Z&3_`,>UQ_X&3?\`Q52+X'T$
+<< MG_CVN,?]?DW_`,71R!SFIY,?_/S%^3?_`!-'DQ_\_,7Y-_\`$UGKX%T`_P#+
+<< MK/\`^!LW_P`73QX#\/9YM)__``-G_P#BZ7*',7?)C_Y^8OR;_P")H\F/_GYB
+<< M_)O_`(FJP\!>'#_RYS_^!L__`,74@\`>&S_RY3_^!L__`,71RAS$ODQ_\_,7
+<< MY-_\31Y,?_/S%^3?_$TP?#_PSWLI_P#P.G_^+J3_`(5YX9_Y\9__``.G_P#B
+<< MZ.4=Q/)C_P"?F+\F_P#B:/)C_P"?F+\F_P#B:YKQEX2T;28M+:R@GB,]]%#)
+<< M_I<S;D9@".6/8T__`(1#1?\`GWG_`/`N;_XNDU89T7DQ_P#/S%^3?_$T>3'_
+<< M`,_,7Y-_\37._P#"(:+_`,^\_P#X%S?_`!='_"(:+_S[S_\`@7-_\72T`Z+R
+<< M8_\`GYB_)O\`XFCR8_\`GYB_)O\`XFN=_P"$0T7_`)]Y_P#P+F_^+H_X1#1?
+<< M^?>?_P`"YO\`XNC0#HO)C_Y^8OR;_P")H\F/_GYB_)O_`(FN=_X1#1?^?>?_
+<< M`,"YO_BZ/^$0T7_GWG_\"YO_`(NC0#HO)C_Y^8OR;_XFCR8_^?F+\F_^)KG?
+<< M^$0T7_GWG_\``N;_`.+H_P"$0T7_`)]Y_P#P+F_^+HT`Z+R8_P#GYB_)O_B:
+<< M/)C_`.?F+\F_^)KG?^$0T7_GWG_\"YO_`(NC_A$-%_Y]Y_\`P+F_^+HT`Z+R
+<< M8_\`GYB_)O\`XFCR8_\`GYB_)O\`XFN=_P"$0T7_`)]Y_P#P+F_^+H_X1#1?
+<< M^?>?_P`"YO\`XNC0#HO)C_Y^8OR;_P")H\F/_GYB_)O_`(FN=_X1#1?^?>?_
+<< M`,"YO_BZ/^$0T7_GWG_\"YO_`(NC0#HO)C_Y^8OR;_XFCR8_^?F+\F_^)KG?
+<< M^$0T7_GWG_\``N;_`.+H_P"$0T7_`)]Y_P#P+F_^+HT`Z+R8_P#GYB_)O_B:
+<< M/)C_`.?F+\F_^)KG?^$0T7_GWG_\"YO_`(NC_A$-%_Y]Y_\`P+F_^+HT`Z+R
+<< M8_\`GYB_)O\`XFCR8_\`GYB_)O\`XFN=_P"$0T7_`)]Y_P#P+F_^+H_X1#1?
+<< M^?>?_P`"YO\`XNC0#HO)C_Y^8OR;_P")H\F/_GYB_)O_`(FN=_X1#1?^?>?_
+<< M`,"YO_BZ/^$0T7_GWG_\"YO_`(NC0#HO)C_Y^8OR;_XFCR8_^?F+\F_^)KG?
+<< M^$0T7_GWG_\``N;_`.+H_P"$0T7_`)]Y_P#P+F_^+HT`Z+R8_P#GYB_)O_B:
+<< M/)C_`.?F+\F_^)KG?^$0T7_GWG_\"YO_`(NC_A$-%_Y]Y_\`P+F_^+HT`Z+R
+<< M8_\`GYB_)O\`XFCR8_\`GYB_)O\`XFN=_P"$0T7_`)]Y_P#P+F_^+H_X1#1?
+<< M^?>?_P`"YO\`XNC0#HO)C_Y^8OR;_P")H\F/_GYB_)O_`(FN=_X1#1?^?>?_
+<< M`,"YO_BZ/^$0T7_GWG_\"YO_`(NC0#HO)C_Y^8OR;_XFCR8_^?F+\F_^)KG?
+<< M^$0T7_GWG_\``N;_`.+H_P"$0T7_`)]Y_P#P+F_^+HT`Z+R8_P#GYB_)O_B:
+<< M/)C_`.?F+\F_^)KG?^$0T7_GWG_\"YO_`(NH+SPKI,-ONB@E#ET0%KJ8@;F"
+<< M]-X]:>@'4^3'_P`_,7Y-_P#$T>3'_P`_,7Y-_P#$UQK>&--2^BLVE47$L;RH
+<< MFZXY5"H8Y\W'!=?S^M3?\(;:>J_]_+C_`./4:`=1=0+/+8A9XP("69B&P<AQ
+<< M@<?[0JFGAO0XM/ET^.RTM+*5M\ELMKB-VXY*[,$_*/R'I7)W^D:)ILZPW4Y5
+<< MMN]RBW3K$F2-\C+(1&O#?,Y`^5N?E."]TG0=.GE@NKR))HK22]DC#W+,L"$!
+<< MG($IXR>/7!QG!H`Z^30=(E^Q^9;Z<_V+'V7=;Y\C&,;/E^7&U>F.@]*M&SMV
+<< MG2<RVYF1619"C;E4D$@';P"57/T'I7GXL-&,#S"'4MJLJD'3M1#9()&%W9(^
+<< M4Y(&!QGJ,W=/\.Z7JEFMW:2%H69T^<74;!E8JP*M*""&4CD=J-`.FA\-Z';W
+<< MD=Y!9:7%=1J$2=+7:ZJ%V@!@F0`OR_3BM#R8_P#GYB_)O_B:X#^S="^W?9/.
+<< MDW>9Y/F^5>>1OSMV^=YGE[MWRXW9W?+UXJ[=>&--LH5EN)51&DCB!W7!^9W"
+<< M*.)>[,!^-&@'9>3'_P`_,7Y-_P#$T>3'_P`_,7Y-_P#$UPT^B:';:G;:9+>V
+<< MZWUSGR;?SIS(P"LV=OG9"X1N3QD8ZU=_X0VT]5_[^7'_`,>HT`ZSR8_^?F+\
+<< MF_\`B:/)C_Y^8OR;_P")KD;WPIIMI)%&PQ^X::20RSD8&T\*)<]&]3TJ`>&]
+<< M,*2,79`B%V\P72G:.I`,O./;U%%D!M^(]`_MVXEGBOH[>6.9)K9F#??4R<G`
+<< MX&'X(Y!&<<8-:STJ]AM=ESH_ANXN)(1'<7`N)$:8XPQ.+;OR<=OPK/7PSIS1
+<< MN^754QG>MTN<]`,R\GV%3V7A+3+DRLQ<K$NYDW7$;')P/O2<#GKCL:`+FBZ+
+<< M>6%ZNXZ=9V*QR9@MI68,[,A4[1!&``%89Y/S8[5LG3;(VLMJ3:&WEW^9$8SL
+<< M?>27R-N#N))/KDYKCX_#NGM;PR,&W2QK)LC^TR%01WVR_7ZX-.;PWI:G_6AE
+<< MP"70W+*`1GEA+@<<\GIS0!U=OI5O;WEY=B[5YKIE+,^X[550H1?EX4'<V/[S
+<< ML>],U#0=(U;R_P"TK?3KSRL^7]IM_,V9QG&Y3C.!^5<\GA&Q=G574F-MK?/<
+<< M<'`/_/7T(HN_"FFV][-!C:L"*6=I9VWL68<`2_[/`Y/-`'0OH.D275Q=/;Z<
+<< MUQ<QF&>4V^7E0@`JQVY9<`#!XX%,U+P]INJ6%W:3M;J+I7#RI&0X9HS$7!*G
+<< MYMAVY]..G%<XGAG39&50^'9MH5_M*G.">AESC`//3@T3>&=-@D\MW^?C"K]I
+<< M8G.<<"7_`&6_*@#HT\-Z'%I\NGQV6EI92MODMEM<1NW')79@GY1^0]*?!H.D
+<< M6WV7R+?3HOLF_P"S>7;[?)W_`'MF%^7/?'6L*R\(:;<"20EF2,99`]PC9R!C
+<< MF7CJ#R.GUJC'X?TYHH68.'DB64H@NGVANG(D]C^5`'5VF@Z181I'9V^G6R)(
+<< M9D6&WV!7*[2P`7AMI(SUP<5=\F/_`)^8OR;_`.)KBG\-Z8CA0[.2@<>4+IQM
+<< M.<'*RGK@U.?"-B)5B+KO92P&^XZ#&?\`EK[BC0#KO)C_`.?F+\F_^)H\F/\`
+<< MY^8OR;_XFN,C\,Z;+*8U?YMQ7)^T@$C.0"9<$\'IZ&M'_A#-)B"K+'*[[0Q9
+<< M;F91R,]-Y]?6C0#HO)C_`.?F+\F_^)H\F/\`Y^8OR;_XFN;?PIH443RRQRQQ
+<< M(-SNUY-A1_WU_P#KZ"N,\66%MI^IV<=B+J"&6W,A1YI-V=PQG+'!QVS54X<\
+<< ME%$SGR1<F>K^3'_S\Q?DW_Q-'DQCDW,9'LK9_E7AN&_Y[3_]_G_QHPW_`#VG
+<< M_P"_S_XUU_4*G='-]<AV9Z\]M=3S),\JQ2;BJM&2?LT??R\@9D;NYQCL.F,G
+<< MQ+"\'@G4HV2*-%C(CBBY"+D8&3RQZDD]R>V*\WPW_/:?_O\`/_C2,A=2K2S%
+<< M2,$&9L$?G3^HU.Z#ZY#LQU%%%>J>:>K>$_\`D2]._P"NDW_H55_$=E<WMUH2
+<< M6TUS;E+]G>XMT5FB7[/,,_,K*`20O(_B]<5SFE^-H]*T2UTX:;-,82[-()%4
+<< M$LV<`?3%6?\`A8B_]`>?_O\`)7B5J-1U)-1>[/6IU8*"3:V&7]GJUO:W\,,]
+<< MX$.K*;F]\B1Y9X?LJ8?;`48XDV)^ZV\)\V<.32U>37X="M_*FU'[5;VTLMI.
+<< MEE=.]P^YMB-''(=FU5BP;C>6W_,,AP=#_A8B_P#0'G_[_)1_PL1?^@//_P!_
+<< MDK/V-7^5_<7[6G_,BEJMAJ&HWT<$;:I'K1N[T+.QN!;0Q-!<+`X8?NE(#0\K
+<< M\V2<_-NKJO#5S/J-G/JSB9+;49$N;.*9@7CA,,:@$`D+DJS8!/WN<$D#G+OQ
+<< MQ9W]J]K>>'S<V[XWQ3-&Z-@Y&0>#R`?PJ;_A8B_]`>?_`+_)1["K_*_N#VM/
+<< M^9';T5Q'_"Q%_P"@//\`]_DH_P"%B+_T!Y_^_P`E'L*O\K^X?M:?\R.WHKB/
+<< M^%B+_P!`>?\`[_)1_P`+$7_H#S_]_DH]A5_E?W![6G_,CMZ*XC_A8B_]`>?_
+<< M`+_)1_PL1?\`H#S_`/?Y*/85?Y7]P>UI_P`R.WHKB/\`A8B_]`>?_O\`)1_P
+<< ML1?^@//_`-_DH]A5_E?W![6G_,CMZ*XC_A8B_P#0'G_[_)1_PL1?^@//_P!_
+<< MDH]A5_E?W![6G_,CMZ*XC_A8B_\`0'G_`._R4?\`"Q%_Z`\__?Y*/85?Y7]P
+<< M>UI_S(Z2^TB:]N#(-8U*W3M%!(BHOT!4GGW-5O\`A')?^A@UG_O\G_Q%8G_"
+<< MQ%_Z`\__`'^2C_A8B_\`0'G_`._R4>QJ_P`K^X7M:?\`,C;_`.$<E_Z&#6?^
+<< M_P`G_P`11_PCDO\`T,&L_P#?Y/\`XBL3_A8B_P#0'G_[_)1_PL1?^@//_P!_
+<< MDH]C5_E?W![6G_,C;_X1R7_H8-9_[_)_\11_PCDO_0P:S_W^3_XBL3_A8B_]
+<< M`>?_`+_)1_PL1?\`H#S_`/?Y*/8U?Y7]P>UI_P`R-O\`X1R7_H8-9_[_`"?_
+<< M`!%'_".2_P#0P:S_`-_D_P#B*Q/^%B+_`-`>?_O\E'_"Q%_Z`\__`'^2CV-7
+<< M^5_<'M:?\R-O_A')?^A@UG_O\G_Q%'_".2_]#!K/_?Y/_B*Q/^%B+_T!Y_\`
+<< MO\E'_"Q%_P"@//\`]_DH]C5_E?W![6G_`#(V_P#A')?^A@UG_O\`)_\`$4?\
+<< M(Y+_`-#!K/\`W^3_`.(K$_X6(O\`T!Y_^_R4?\+$7_H#S_\`?Y*/8U?Y7]P>
+<< MUI_S(V_^$<E_Z&#6?^_R?_$4?\(Y+_T,&L_]_D_^(K$_X6(O_0'G_P"_R4?\
+<< M+$7_`*`\_P#W^2CV-7^5_<'M:?\`,C;_`.$<E_Z&#6?^_P`G_P`11_PCDO\`
+<< MT,&L_P#?Y/\`XBL3_A8B_P#0'G_[_)1_PL1?^@//_P!_DH]C5_E?W![6G_,C
+<< M;_X1R7_H8-9_[_)_\11_PCDO_0P:S_W^3_XBL3_A8B_]`>?_`+_)1_PL1?\`
+<< MH#S_`/?Y*/8U?Y7]P>UI_P`R-O\`X1R7_H8-9_[_`"?_`!%'_".2_P#0P:S_
+<< M`-_D_P#B*Q/^%B+_`-`>?_O\E'_"Q%_Z`\__`'^2CV-7^5_<'M:?\R-O_A')
+<< M?^A@UG_O\G_Q%'_".2_]#!K/_?Y/_B*Q/^%B+_T!Y_\`O\E:UIK^JWUE'>6W
+<< MAR=X)"0C_:HAD@X/!.:4J<XJ\E8J,X2T3)?^$<E_Z&#6?^_R?_$4?\(Y+_T,
+<< M&L_]_D_^(H_M?6O^A9G_`/`N'_XJC^U]:_Z%F?\`\"X?_BJC4H/^$<E_Z&#6
+<< M?^_R?_$4?\(Y+_T,&L_]_D_^(H_M?6O^A9G_`/`N'_XJC^U]:_Z%F?\`\"X?
+<< M_BJ-0#_A')?^A@UG_O\`)_\`$4?\(Y+_`-#!K/\`W^3_`.(H_M?6O^A9G_\`
+<< M`N'_`.*H_M?6O^A9G_\``N'_`.*HU`/^$<E_Z&#6?^_R?_$4?\(Y+_T,&L_]
+<< M_D_^(H_M?6O^A9G_`/`N'_XJC^U]:_Z%F?\`\"X?_BJ-0#_A')?^A@UG_O\`
+<< M)_\`$4?\(Y+_`-#!K/\`W^3_`.(H_M?6O^A9G_\``N'_`.*H_M?6O^A9G_\`
+<< M`N'_`.*HU`/^$<E_Z&#6?^_R?_$4?\(Y+_T,&L_]_D_^(H_M?6O^A9G_`/`N
+<< M'_XJC^U]:_Z%F?\`\"X?_BJ-0#_A')?^A@UG_O\`)_\`$4?\(Y+_`-#!K/\`
+<< MW^3_`.(H_M?6O^A9G_\``N'_`.*H_M?6O^A9G_\``N'_`.*HU`/^$<E_Z&#6
+<< M?^_R?_$4?\(Y+_T,&L_]_D_^(H_M?6O^A9G_`/`N'_XJC^U]:_Z%F?\`\"X?
+<< M_BJ-0#_A')?^A@UG_O\`)_\`$4?\(Y+_`-#!K/\`W^3_`.(H_M?6O^A9G_\`
+<< M`N'_`.*H_M?6O^A9G_\``N'_`.*HU`3_`(1E7F@>?5]4N%AE298Y9$*EE((S
+<< M\GM6[6'_`&OK7_0LS_\`@7#_`/%4?VOK7_0LS_\`@7#_`/%4@-RBL1]4UQ'9
+<< M&\,SAE."/M</7_OJD_M?6O\`H69__`N'_P"*HL!N45@3:YK$$$DS^&+HK&I8
+<< MA+B-V(`SPH))/L!DU5_X2O4O[,_M#_A%=3\C^[C][][;_JL;^O\`L].>G-%@
+<< M.IHKF1XFU0P/,/"VH;5@6<@LH;:02`%ZEOE.4`W#C(Y&6?\`"5ZE_:?]G_\`
+<< M"*ZGY_\`>Q^Z^[N_UN-G3_:Z\=>*+!<ZFBL/^U]:_P"A9G_\"X?_`(JC^U]:
+<< M_P"A9G_\"X?_`(JBP&Y17.P>(-4N;^6RA\.3M<1;-Z?:HAC?G;R3CG!I\VN:
+<< MQ!!),_ABZ*QJ6(2XC=B`,\*"23[`9-%@-^BN=;Q#JR^9GPO>_)(L1Q*AR6VX
+<< M(]5^898<#G)&TX&\0ZLOF9\+WOR2+$<2H<EMN"/5?F&6'`YR1M."P'145RTO
+<< MBO4HI($;PKJ9,\C1(4&X`JVTEB!A5ST9L`CD$CFGW_B;5-.@6:?PMJ#J6V@6
+<< M[+.V<$_=CR0..N,?G18+G345S+^)M4CM(KEO"VH&.1=RA65G`VEN4'S*<`\$
+<< M`YPO4@477B;5+-)6E\+:@PB56;RF64D,2!M"YW'(Y`R0,$X!!HL!TU%<R/$V
+<< MJ&!YAX6U#:L"SD%E#;2"0`O4M\IR@&X<9'(R+XFU1D5AX6U##+&PRR@XD.%R
+<< M#T(/W@>5'+8'-%@N=-16!%KFL3(67PQ=`!F7Y[B-3D$@\$CC(X/0C!&00:99
+<< M>(-4U&U^U6OAR>2'YOF^U1#HVT\$YZ\46"YT5%8?]KZU_P!"S/\`^!</_P`5
+<< M1_:^M?\`0LS_`/@7#_\`%46`W**Y;4/%>I:;Y?G^%=3?S,X^S#S\8QU\L-CK
+<< MWQG\*+OQ7J5E&[R^%=38)((B(1YIR5W9`0$E<'[PXSQG/%%@N=317._\)#JW
+<< MV[[)_P`(O>^;Y?F[O-3R\9QC?]W=_LYSCG&*CL/$VJ:C`TT'A;4$4-M(N&6!
+<< MLX!^[)@D<]<8_*BP'345A_VOK7_0LS_^!</_`,539=;U>&)Y9/#<X1%+,?M<
+<< M7`'7O18#>HKF)/%5]%I0U-_#\XLS&)?,^TQ_=."#C.>X[5G_`/"Q%_Z`\_\`
+<< MW^2JC3G+X5<F4XQW=CMZ*XC_`(6(O_0'G_[_`"4?\+$7_H#S_P#?Y*OV%7^5
+<< M_<+VM/\`F1V]5=0_X]D_Z[P_^C%KDO\`A8B_]`>?_O\`)37^(,;A0VC3$*RN
+<< M`9DZ@@C]0*/85?Y7]P>UI_S(V=7N18>*=,O)8+R2W%E=1,]M:2S[69[<J"(U
+<< M8C(1NOI6<R:C->7VJ0RZIQJEFMI`PD1%MW6W$I\L@9&&DSN!V%20%;<2?\+-
+<< M/_0%;_R%_A1_PLT_]`5O_(7^%'L*G\K^X7M:?\R+OB.^22<Z/<V]\+">#-U-
+<< M;V,T_FHQ*F%3&K;20#N)P0I&WEMR8M[H>JW/BB]>^L$GMKZPOX'GM;@F00MY
+<< M*QQJ'0*C87(4N5+/*V0.#=_X6:?^@*W_`)"_PH_X6:?^@*W_`)"_PH]A4_E?
+<< MW![6G_,@AEO8K?4AHPU3[+*MM!;27J3/)#/)(R2RA9QO*HK1/@_(=IP1\QKI
+<< M+/[#8?9]&M?E^SVR[(1N;RXE^5<GG&<$#)RVUL9VG'-_\+-/_0%;_P`A?X4?
+<< M\+-/_0%;_P`A?X4>PJ?RO[@]K3_F1=T:].G>9I<UE?-=M?W,@"6KF/9)</(K
+<< M>:1Y>-C!B-V>HQN^6N?2'5)X=/0QZI).&M'U9;A9B@N5NK9LQ[_EV@"X)\KY
+<< M``,\;:T_^%FG_H"M_P"0O\*/^%FG_H"M_P"0O\*/85/Y7]P>UI_S(VM8AEEU
+<< M3P^\<;NL5^[R,JDA%^S3KD^@RP'U(]:UZX[_`(6:?^@*W_D+_"C_`(6:?^@*
+<< MW_D+_"CV%3^5_<'M:?\`,CI-=5GN"B*69M/D``&23MCJO>VTP28;YK@M:3*&
+<< M91E3\N`-H'7WSTX[USY^(X:Z%RVC2F4(4!+QD`''&.G\(_*I/^%FG_H"M_Y"
+<< M_P`*?L:G\K^X/:T_YD=`S&6S8*]S,4EC<F6$H<!P3@;1G@'ID_I6E9SK/%=%
+<< M4D"B,<NA3)W+V.#^F.?K7&_\+-/_`$!6_P#(7^%(WQ-9D9?['D`;@[6C&>_8
+<< M4O85/Y7]P>UI_P`R-RPD^SQ02R)(4DLX54I&S\C=G[H./O#K2SES!J$)AF$E
+<< MR"8U"%AS&JX+#('((Y/Z5@0_$A;>".&/1'$<:A%!:,X`&!R1DT__`(6:?^@*
+<< MW_D+_"G[&I_*_N#VM/\`F1T<,PAO;I'2;,DRE2(F*D;$'4#'4&EU56;6+[:I
+<< M;:8'(`R<+*Y/'?@&N;_X6:?^@*W_`)"_PJ-?B.%N);C^QI3+*`'9GC.<$D=>
+<< MGWC1[&I_*_N#VM/^9'2-&UY+<21*R@I%Y9E0IET9F&01G&2OZTPP2R_9Y09(
+<< MGFN#*Q51F,>6RC((.#@*#GN3[5A?\+-/_0%;_P`A?X4?\+-/_0%;_P`A?X4O
+<< M85?Y7]P>UI_S(ZW38WC745?<QR/WC#!?_5\\8'MP.WKFLO3[>61(76::%?L4
+<< M`RBKAC\W]X'IQ^=8K?$UF1E_L>0!N#M:,9[]A38?B0MO!'#'HCB.-0B@M&<`
+<< M#`Y(R:?L:G\K^X/:T_YD;<!:&6!W%S`OV6$;(H2X)&[*GY21C([@\U),ERTT
+<< MMVL`(20%26/F!$R"`N,'.7QS_$/:L/\`X6:?^@*W_D+_``H_X6:?^@*W_D+_
+<< M``H]C4_E?W![6G_,C=C#20FU$<@D%T9"6C(4*)2V<D8.1TQGK]<;%ZZ19EE=
+<< M8XDB1G=NBC:/\^_05Q7_``LT_P#0%;_R%_A4,_Q#2ZEBDFT:9S$X=`94VA@,
+<< M`E>AP.F1QSCK2]A4_E?W![6'\R.@N;EYI=[[81"!*B3#*VR]II1WD.?DCYQG
+<< MOGYN.\<'=J^G'=,V;,G,_P#K#\P^]_M>OO5I/'%JGE_\22=MDIG&^=6W2'^)
+<< MLGYC[G..U8>O:U_;NHV]P+:6$10F,^;('+'(.<YR?QK>A2FJD6XLRK5(.FTF
+<< MC.HHHKV#RPHHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HH
+<< MHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB
+<< M@`KU;PG_`,B7IW_72;_T*O*:]0\/3M;^!-.=$#L9I$"EL#+2!>N#ZUQ8_P#A
+<< M+U.O!_Q'Z&W157S+_P#Y]K;_`,"&_P#B*/,O_P#GVMO_``(;_P"(KR#TRU15
+<< M7S+_`/Y]K;_P(;_XBCS+_P#Y]K;_`,"&_P#B*`+5%5?,O_\`GVMO_`AO_B*/
+<< M,O\`_GVMO_`AO_B*`+5%5?,O_P#GVMO_``(;_P"(H\R__P"?:V_\"&_^(H`M
+<< M455\R_\`^?:V_P#`AO\`XBCS+_\`Y]K;_P`"&_\`B*`+5%5?,O\`_GVMO_`A
+<< MO_B*/,O_`/GVMO\`P(;_`.(H`M455\R__P"?:V_\"&_^(H\R_P#^?:V_\"&_
+<< M^(H`M455\R__`.?:V_\``AO_`(BCS+__`)]K;_P(;_XB@"U157S+_P#Y]K;_
+<< M`,"&_P#B*/,O_P#GVMO_``(;_P"(H`M455\R_P#^?:V_\"&_^(H\R_\`^?:V
+<< M_P#`AO\`XB@"G=>*(&O)RFF:PZ&1BK"PDPPSUY&:A_X2>+_H$ZS_`.`#_P"%
+<< M:7F7_P#S[6W_`($-_P#$4>9?_P#/M;?^!#?_`!%`C-_X2>+_`*!.L_\`@`_^
+<< M%'_"3Q?]`G6?_`!_\*TO,O\`_GVMO_`AO_B*/,O_`/GVMO\`P(;_`.(H`S?^
+<< M$GB_Z!.L_P#@`_\`A1_PD\7_`$"=9_\``!_\*TO,O_\`GVMO_`AO_B*/,O\`
+<< M_GVMO_`AO_B*`,W_`(2>+_H$ZS_X`/\`X4?\)/%_T"=9_P#`!_\`"M+S+_\`
+<< MY]K;_P`"&_\`B*/,O_\`GVMO_`AO_B*`,OP_=[O$FJ:G):WD%L4MR/.MG5CL
+<< MW[L+C+'IP,]13O\`A)XO^@3K/_@`_P#A6EYE_P#\^UM_X$-_\11YE_\`\^UM
+<< M_P"!#?\`Q%,#-_X2>+_H$ZS_`.`#_P"%'_"3Q?\`0)UG_P``'_PK2\R__P"?
+<< M:V_\"&_^(H\R_P#^?:V_\"&_^(I`9O\`PD\7_0)UG_P`?_"C_A)XO^@3K/\`
+<< MX`/_`(5I>9?_`//M;?\`@0W_`,11YE__`,^UM_X$-_\`$4`9O_"3Q?\`0)UG
+<< M_P``'_PH_P"$GB_Z!.L_^`#_`.%:7F7_`/S[6W_@0W_Q%'F7_P#S[6W_`($-
+<< M_P#$4`9O_"3Q?]`G6?\`P`?_``H_X2>+_H$ZS_X`/_A6EYE__P`^UM_X$-_\
+<< M11YE_P#\^UM_X$-_\10!F_\`"3Q?]`G6?_`!_P#"F^'KO^R/"(:ZM;S>[RA8
+<< M8[9VDYF+#*XR!CG)Q^HK4\R__P"?:V_\"&_^(H\R_P#^?:V_\"&_^(I@9O\`
+<< MPD\7_0)UG_P`?_"C_A)XO^@3K/\`X`/_`(5I>9?_`//M;?\`@0W_`,11YE__
+<< M`,^UM_X$-_\`$4@,W_A)XO\`H$ZS_P"`#_X4?\)/%_T"=9_\`'_PK2\R_P#^
+<< M?:V_\"&_^(I\TD\&GK<211^8THC5%D)')4`D[?\`:].U`&5_PD\7_0)UG_P`
+<< M?_"C_A)XO^@3K/\`X`/_`(5+?:Q/8,BR6]LSL0`HNMN,YQDLH`S@X&<G!QG!
+<< MPW3=;EU1KB.&WMTGMGVS0O<Y9,\JWRJ058<@@GN.""!'M8<_)?7L.S&?\)/%
+<< M_P!`G6?_```?_"H;SQ"EQ93PII6L!I(V0$V$F,D8]*V/,O\`_GVMO_`AO_B*
+<< M/,O_`/GVMO\`P(;_`.(JQ'.ZI&\/PP\J5&21-/B5D88*D*N01V-<!7IWBQ9C
+<< MX(U&2941F1E"HY88&WG)`]?TKS&O3R_[7R.#&_9"BBBO1.$****`"BBB@`HH
+<< MHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB@`HHHH`****`"BBB
+<< M@`HHHH`****`"BBB@#N_^%<1_P#0=B_\!F_QH_X5Q'_T'8O_``&;_&NSO=2&
+<< MFV=K))</#$Q2(;2>7>78HP/5F45ROB/XG:;H,420WKZE?7`S#:VDX8G*[E9S
+<< MG"(05YYX.0"`:\3ZY67VOR/7CA*<FHQC=OU*W_"N(_\`H.Q?^`S?XT?\*XC_
+<< M`.@[%_X#-_C4?A+XK'Q)=6EG=6=[IUQ>K(]H?.,L4RI]X!Q@AAAN".@'/(%=
+<< M,?%^EBZEM3XBLQ<1;_,B-ZN]-@)?(W9&T`D^F#FA8RJ]I?D3'#T9*Z7XG._\
+<< M*XC_`.@[%_X#-_C1_P`*XC_Z#L7_`(#-_C79PZC)<01SP7C2PR*'21)=RLI&
+<< M000>013_`+7<_P#/Q+_WV:/KE;O^"']6I=CB?^%<1_\`0=B_\!F_QH_X5Q'_
+<< M`-!V+_P&;_&NGEUDWFASWEAJ1GA:&0QSP3[E)`(X8'L1^E4O#?\`R"=*_P"P
+<< M0O\`."G];K=_P0?5J78Q?^%<1_\`0=B_\!F_QH_X5Q'_`-!V+_P&;_&NN+DZ
+<< MA?Q@`)%/L0#L-BG^9/YTDDBQCG))Z`#)-"Q==NR?X(3P]%*[1R7_``KB/_H.
+<< MQ?\`@,W^-'_"N(_^@[%_X#-_C6PWB*R^TK"'P"<&4X*H??!Z>_;OCK6NA+(K
+<< M$8)&2/2KJ5L33MSZ7\C.E##5;\FMO,Y#_A7$?_0=B_\``9O\:/\`A7$?_0=B
+<< M_P#`9O\`&NANM8M;1I%E8H40-N<$*>6'7V*G^F3Q4<&H7B23MJ&GW-K:+M\N
+<< MZEA,:G.!A@2=O)X)_'&.:=3%*/,]OE^`*&'<N5:OYF%_PKB/_H.Q?^`S?XT?
+<< M\*XC_P"@[%_X#-_C785C7.KRM.T=KY,:*S*99E9MQ7.X!1CICJ3V/!ZUQU\T
+<< ME0ASU)67H=5+`1JRY81NS(_X5Q'_`-!V+_P&;_&C_A7$?_0=B_\``9O\:U[;
+<< M6)1,L=T89(W*@30@KM+?=!4YX)[@]QP.M:\DBQ1/(YPB`LQ]`*5'-95X<].=
+<< MUZ!5P$:4N6<;,Y'_`(5Q'_T'8O\`P&;_`!H_X5Q'_P!!V+_P&;_&MW4M3FTY
+<< M4!AMWNI"OEV1G*3RYY*JK+@OM#$#=@D8SWJZUU$DT44OF0R3$K$LT31[R`20
+<< MNX#)P"<#L">U..9RD[*?X&?U6GV.5_X5Q'_T'8O_``&;_&C_`(5Q'_T'8O\`
+<< MP&;_`!KI-6OAI>CWM^0K"V@>8AB0#M4GD@$CIV!^AKS@_%R]2X@MY/#?ESW2
+<< MJ]G&\TX:[5@VQHAY&6#%0H/<L.V2.F&(Q$MI?DB7AJ2Z?F='_P`*XC_Z#L7_
+<< M`(#-_C1_PKB/_H.Q?^`S?XUG^$/B:GBOQ#)I2V,$05682QW#OO`[@-&O'3K@
+<< M\CCKCOI)$BC:21U2-`69F.`H'4DTI8JO%V<OR#ZM2['(_P#"N(_^@[%_X#-_
+<< MC1_PKB/_`*#L7_@,W^-=*-5TXV!OA?VILQC-QYR^6,XQ\V<<Y'YBI;2\M;^U
+<< M2ZL[F&YMWSLEA<.C8.#@C@\@C\*A8VL]I?D5]5I=OS.5_P"%<1_]!V+_`,!F
+<< M_P`:/^%<1_\`0=B_\!F_QI_C;Q/>^&UMWM5@*-!/-)YL1<XCV<##+_>/Y"LJ
+<< MR^(5TR-;7EO!]ME7?;R1*?+`#*K[@&8':&W`AL.`0"/E+)XZJNOX(Z(97SQ4
+<< MHQO?S\[?F:7_``KB/_H.Q?\`@,W^-'_"N(_^@[%_X#-_C5KPGKFI:U-J0O%M
+<< M3!;.D4<L"%-SD%F4@LW13&<]/F]CC8OM22SD$>T.YC9]N[!XX';H3GGV-3/,
+<< M*D(\\I67R(>7+VCI*.J\SG?^%<1_]!V+_P`!F_QH_P"%<1_]!V+_`,!F_P`:
+<< MG'B><7;QS^1!'&X24F-F,6>AZC</?`]:Z>-BR_,`&'4*VX?GZ=_QJWC:R:3>
+<< MZNM.GW&*PU)W26SLSD?^%<1_]!V+_P`!F_QH_P"%<1_]!V+_`,!F_P`:ZV9V
+<< MB@DD2)YF52PC0@,Y`Z#)`R?<@>]<]9>-]*O)[&/;<P+>,T*R3H%6.Y4\VTG.
+<< M4E]`0`W\)-/ZY6[_`)!]6I=BG_PKB/\`Z#L7_@,W^-'_``KB/_H.Q?\`@,W^
+<< M-=4',7AZZF4#S(H;AT)[-Y[X/ZU>BD>*TE:-V0[T&5..S4_K=;O^"#ZM2['#
+<< M_P#"N(_^@[%_X#-_C1_PKB/_`*#L7_@,W^-9&J_&'4M+NKS_`(E3R6-M<R6A
+<< MO?M,RQ&5,GRR?)(#D#H"1R.<9-0)\;+S^V+73Y+!4:X*8?[7,,*_W#AH03N4
+<< MJR]B'7)'.-/;8BU^9?@+ZO2[?F;W_"N(_P#H.Q?^`S?XT?\`"N(_^@[%_P"`
+<< MS?XUU.H>([32?+_M+68;/S<^7]INA'OQC.-Q&<9'YU=^UW/_`#\2_P#?9K+Z
+<< MY6[_`((?U:EV.)_X5Q'_`-!V+_P&;_&NFL=&CLM!M=+^WQ/Y$OF>9L8;OG#8
+<< MQCCICK6A]KN?^?B7_OLT?:[G_GXE_P"^S45,14J*TF7"C"#O%!Y,?_/S%^3?
+<< M_$T>3'_S\Q?DW_Q-<=JLTLUSXO\`-E>3;ID:KO8G`V2G`_$G\ZT;7PSX6&F6
+<< M+2Z';37,MNDC!7VDY'+'+A1SVSS@X[[<)2C!<TGH:'0>3'_S\Q?DW_Q-'DQ_
+<< M\_,7Y-_\37.P:/X)EN[BUGT*WLY8=IQ</A9%8<,C!RK<Y!&<@KR`&!&FG@KP
+<< MG)&LD>BVC(PW*P=R".><[O\`..W.U0G"?PNX:E_R8_\`GYB_)O\`XFCR8_\`
+<< MGYB_)O\`XFJ1\#^%N?\`B16H_P"!/QU_VO\`#H>G.T/@?PMS_P`2*U'_``)^
+<< M.O\`M?X=#TYVW8+EWR8_^?F+\F_^)H\F/_GYB_)O_B:I'P/X6Y_XD5J/^!/Q
+<< MU_VO\.AZ<[9K3PQH6EW/VJPTFWMYU20"1=Q*@HV<9)QZ=CP?<`L%R?R8_P#G
+<< MYB_)O_B:/)C_`.?F+\F_^)ITMS+!;VX26105QM0GDER!P._2L5_$MS<Q!=,:
+<< MZN+EHO,6%59V[=0",`9&23CH!DFM:="=36*T_`SG5A#23U9L>3'_`,_,7Y-_
+<< M\31Y,?\`S\Q?DW_Q-5;75KN8)%<FYM;SRP[V\KD,HSC(]1D=?IG'2BPUV'5(
+<< M&GT_54NX5;89+>X$BAL`XR"><$?G635G9FB=]2UY,?\`S\Q?DW_Q-'DQ_P#/
+<< MS%^3?_$U!!JS7,US%%=RL]M((IAN8;6**^/?Y74\>M3_`&NY_P"?B7_OLT@#
+<< MR8_^?F+\F_\`B:/)C_Y^8OR;_P")H^UW/_/Q+_WV:QO!<TK>''F,KF5GG8N6
+<< M.XDW!R<T`;/DQ_\`/S%^3?\`Q-'DQ_\`/S%^3?\`Q-5Y-:CANTM)=35+F1=R
+<< M0M/AV&<9"YR1GBHSXAMAJ(TXZQ$+X]+;[2/-/&[[N<].>G2E=#6I<\F/_GYB
+<< M_)O_`(FCR8_^?F+\F_\`B:I7/B.TLKH6MWK,,%P8S,(I;H*^P`DM@G.T!6)/
+<< M3@^E$OB.TAC@DEUF&-+B-IH6>Z`$B*NYF4YY4+R2.`.:8B[Y,?\`S\Q?DW_Q
+<< M-'DQ_P#/S%^3?_$U5L-=AU2!I]/U5+N%6V&2WN!(H;`.,@GG!'YU:^UW/_/Q
+<< M+_WV:`#R8_\`GYB_)O\`XFCR8_\`GYB_)O\`XFL&>XFF\<6Z232.JZ;*5#,2
+<< M`3(F<?D/RK<U757L9)G>>;_6%8XT8Y<Y.%49]OH`"3@`FFE=V1,YQA%RD[)#
+<< MO)C_`.?F+\F_^)H\F/\`Y^8OR;_XFL3_`(236,[_`+&WE[ON_;#YFW/IMVYQ
+<< MVW8]ZO6WB!+FU\\7SQ@2+$ZRR;6CD;`",,\,=RX'?<,9R,Z5*,Z:O-6.3"YC
+<< MA<7)QH34FB[Y,?\`S\Q?DW_Q-'DQ_P#/S%^3?_$T?:[G_GXE_P"^S3(M1DG0
+<< MO#>-(H9D+)+D!E)5AP>H((/H0:R.T?Y,?_/S%^3?_$T>3'_S\Q?DW_Q-'VNY
+<< M_P"?B7_OLUA^,+RZ'A#5,7,W,!4_.>0>"/RH`W/)C_Y^8OR;_P")H\F/_GYB
+<< M_)O_`(FGB62*SC\N1TS(^=K$9X6L67Q)>N^+)))HO^>TEP45O]W`8D=>2`.X
+<< MR#6E.E*H[05SFQ6,H82'/7FHHU_)C_Y^8OR;_P")H\F/_GYB_)O_`(FLRS\1
+<< M3S3I;73RVUPY(C!FW)*>3A&XR<`G!`.`>H!-36WB.TO+Z6RM=9AGNX<^;!%=
+<< M!I$P<'<H.1@G!SWJ9PE!\LE9ET,12Q%-5*4KQ?4N^3'_`,_,7Y-_\31Y,?\`
+<< MS\Q?DW_Q-'VNY_Y^)?\`OLT?:[G_`)^)?^^S4FP>3'_S\Q?DW_Q-'DQ_\_,7
+<< MY-_\31]KN?\`GXE_[[-8WA::634==E>5VD%]-\[,2>(4`Y]@!0!L^3'_`,_,
+<< M7Y-_\31Y,?\`S\Q?DW_Q-9VI>)XM.98C>E[C!9XS.WR#(`!"JS9.X8&.F3VK
+<< M/7QW;M!?;KWR)8+8SH\D["-C\P"G>$8-E<XQR.0:X)9A"-_<EH^WG:]KWM?K
+<< M87-#FY>97WM<Z'R8_P#GYB_)O_B:/)C_`.?F+\F_^)K#T_QA#)X>M=6U#5[:
+<< MVAG9D$K7(2-F#,,`ENN%/?L:V8=1DN((YX+QI89%#I(DNY64C(((/((KNB[I
+<< M,8_R8_\`GYB_)O\`XFFW-M'<6L<'VJ)=DHDW88YPRG'3_9_6G?:[G_GXE_[[
+<< M-'VNY_Y^)?\`OLTP,RZT-+C6;+45U"%&MG#[?+<E@(Y4QG'`/FY_X`/PATKP
+<< MVFFZWJFI'4XI3?[/D\IUV;6D;KSG_6>W3WXCUFYGD\0>'XWGD9#/,Q5G)&1"
+<< MV#C\3^=:]9JE"+YDM=QW)O)C_P"?F+\F_P#B:/)C_P"?F+\F_P#B:AHK0"MJ
+<< M^DG5])O-/?4H8TGR(R(F/EKQU&/F/')XZ]@`*YC_`(5Q'_T'8O\`P&;_`!KL
+<< M**UIUIT[\C,YTH3^)''_`/"N(_\`H.Q?^`S?XT?\*XC_`.@[%_X#-_C7845I
+<< M]<K=_P`C/ZK2[''_`/"N(_\`H.Q?^`S?XT?\*XC_`.@[%_X#-_C7854U)5>T
+<< M".H96FB!!&01YBT?7*W?\@^K4NQS7_"N(_\`H.Q?^`S?XT?\*XC_`.@[%_X#
+<< M-_C71R6-A&%`T^!W<[4C2%2SMZ#_`#QR3@"LG0P+RSDO-1L-,2VGDDDL9(8L
+<< M![=<#<2>.X(;C((.%.0)6.JN7+S:^B#ZK2[%+_A7$?\`T'8O_`9O\:/^%<1_
+<< M]!V+_P`!F_QK4U?['8V4$L-C8!IYHXE>YC"(FX_>;C(`[^E<_HGB"'4M0MK>
+<< M;1[%5GG\@%(P"I\J63/.<_ZK&/\`:SGC!U6)KN/-?3Y&4H8>-14G\3]2Y_PK
+<< MB/\`Z#L7_@,W^-'_``KB/_H.Q?\`@,W^-=-_9EA_SY6W_?I?\*CN+/3;:VEN
+<< M);*#RXD+MMMPQP!DX`!)/L!FH^N5OYOP1J\-26Z.=_X5Q'_T'8O_``&;_&C_
+<< M`(5Q'_T'8O\`P&;_`!H75K*YUG2X+33[4VEY<-$6FLVCD`$,C_=8`@[D'4=/
+<< MP-87C?QI:Z#JB:3I&E6$UZKH+B2YM_W<>X950!@DD$'.<`>ISMK!XJOC&U1=
+<< M[7OM;3=F.'CA\0OW2OJUUW1N_P#"N(_^@[%_X#-_C1_PKB/_`*#L7_@,W^-8
+<< M7@GQK;:YJS:-K.DV-O?R$FW:WM\(^%R5(.<'`)!S@CT(&[T/^S+#_GRMO^_2
+<< M_P"%:XB>*P\_9U'KOT::>S36C3-OJM.[3CJO4YG_`(5Q'_T'8O\`P&;_`!H_
+<< MX5Q'_P!!V+_P&;_&ND6QTQF"K:VA)S@"->QP?R/%*VGZ<B%WL[5549),2@`?
+<< ME6'URMW_``0?5J78YK_A7$?_`$'8O_`9O\:/^%<1_P#0=B_\!F_QI)-8LI=5
+<< M^QV6F:<\)*IYY(+(Y(X,87^Z0?O9Y&16PCZ3);W3):6;7%JA::`*I*\'';H=
+<< MIP<=CW!`?UNMW_!!]6I=C(_X5Q'_`-!V+_P&;_&C_A7$?_0=B_\``9O\:QYO
+<< M%2VQE+Z3I4RQ6C71\E<Y`B,NS/9N-IX.#GKBN^_LRP_Y\K;_`+]+_A52Q->&
+<< MC?Y&5&&'K)RIZI:=3F?^%<1_]!V+_P`!F_QH_P"%<1_]!V+_`,!F_P`:U-7N
+<< M-'TFPNKAK*VGE@C+_9HHT,CG'`"^IKF-/\;Z3=ZW_95SX9DL[@);R,)4C)"S
+<< M-$L?`_Z[(2#R!GN,5/UNMW_!&OU:EV_,T_\`A7$?_0=B_P#`9O\`&C_A7$?_
+<< M`$'8O_`9O\:Z.:STNW@DGGMK.*&-2[R/&JJJ@9))/0`5DZ7J6BZKJ$EDFEB&
+<< M559D\Z&/]XJ[=QP"60CS(SM<*WSCCKA?7*W?\$'U:EV*7_"N(_\`H.Q?^`S?
+<< MXT?\*XC_`.@[%_X#-_C6[>PZ;8Q(S:?#(SML2-(DRQP3CG`Z`GD]O6L_S5W;
+<< MO[!LO+SG&]?,Q]-FW=[;L9[]ZVIU<545X:_)'#BL3E^$DHUY*+?J4O\`A7$?
+<< M_0=B_P#`9O\`&C_A7$?_`$'8O_`9O\:W+%-+U".4QV$"/$_ERQM$FY&P&P<9
+<< M'W64]>XJU_9EA_SY6W_?I?\`"LGBZZ=F_P`$=D*%"<5**NGYG,_\*XC_`.@[
+<< M%_X#-_C1_P`*XC_Z#L7_`(#-_C6^8-(%\++[/:?:C$9O*$2Y"`@;CQP,G'OS
+<< MZ&I_[,L/^?*V_P"_2_X4OKE;^;\BWA*:WC^9S/\`PKB/_H.Q?^`S?XT?\*XC
+<< M_P"@[%_X#-_C73?V98?\^5M_WZ7_``H_LRP_Y\K;_OTO^%'URMW_``0OJU+L
+<< M<S_PKB/_`*#L7_@,W^-'_"N(_P#H.Q?^`S?XUTW]F6'_`#Y6W_?I?\*/[,L/
+<< M^?*V_P"_2_X4?7*W?\$'U:EV.9_X5Q'_`-!V+_P&;_&C_A7$?_0=B_\``9O\
+<< M:Z;^S+#_`)\K;_OTO^%6K.SMK=;EX;>&-C%@E$`.-Z^E'URMW_!!]6I=B#6Y
+<< M3%I]FP)!,L"\3"+K<`=3UZ_=ZM]T<FOG7QXB6=[I;V]G+IV8WRYTA;'=\B9Q
+<< MCEF&2#V!/R\$5[]JU]>,\5M%X?DOH8@I\QIHE4N&W@@,V>#@Y('(XZ`UR5AX
+<< M8LM-U!+^W\"2-=1JJQR3Z@LQ0+C;MWN<%0J@$<@#`J*4J4=9PYGZNWFFNM]O
+<< MGZ'7&M4A'E@[?)77H]U\F>?_``Y6U_X2+P4\&JM<2EK\7%DX&;5PC8*]]KJ4
+<< M/IE6YR2!T5II.OV-I/X;T*YOM1T.XL+Z/R+W2FM#;%E)C`ED"[V9WQZ8R<`<
+<< MCM9Q=7.IVVIR^#2U];9\FX^TPB1059<;MV2N';@\9.>M7?[7UK_H69__``+A
+<< M_P#BJYZ<.16O?5OIU;?X7_S,E%+1*QQL/VVV\'>'+"TL]7AB.U=0N)4OFDM9
+<< M%@'RK$CI(4+<#:?+4CIG&(/!\'BO4]8T;^VKK7;6"+2=\VX-&LDL=VVU)-RX
+<< MW&,+GHS+U."<]S_:^M?]"S/_`.!</_Q5']KZU_T+,_\`X%P__%58SFO`.G2:
+<< M3X!N;"[M[ZWU&"*9;F.X\WRP=\FWR]W[L@CDF/@Y!/:NK\-_\@G2O^P0O\X*
+<< MJ7.HZU<6LT'_``C<Z^8C)N^U0G&1C^]6AHEM-::?I\4Z;'BTX0.,@X?,7''^
+<< MZWY4`7?^8KJO_7V?_0$KG/%.IM&K64`_>%?F)R!D@X7/3H"?P]JZ**.42W$T
+<< MTB/)/+YC;$*@<`8`)/IZU5N=(M;N69I@S).JB6+/ROMY4^H(]B*WPU6%*ISR
+<< M5[?U_7F<V*HRK4_9Q=K_`-?UY'G-O:W(M1-''8Q0Q1?O20\83`Z,=@#,<D9&
+<< M[/KTKTVP69-.M5N<^>L2"3+;CNP,\]^>]5+?P_IEK*DB6Y9D(*>=*\H4CD$!
+<< MB0#[CFM.M,5BE62BMEZ?H3A<,Z3<I;OU_4S!%X:N[&.]U">'[?9338`NF21-
+<< MDSL,*,\\YZ9Y'M6#J.OSZC:7YU":T\V6T58L920@3(5!7<1R"QX&>.N!70:E
+<< MH=AJB'SX0LA(/G1@*_'O^G-+;Z'IMM;I"+.&3:.7E0.S'U)/4U2Q5/V=I)M^
+<< M>R]!NC5]I>,K1\EOZFA7)VR3QV=FD?F@QQM%,J]$9%*GI_M#K7652N=,BGF,
+<< MR2S6\IQN>%A\W&.5(*GMSC/`&<5\]F>!EBX)1>J/7P6)6'FW):,Y^=+F2QN4
+<< MF$VYX$B1&&`TKC;CGON(^F>:Z34/^0;=?]<7_D:CMM,B@F$SRS7$HSM>9A\O
+<< M&.%`"COSC/)&<5=J<OR^6&I2C)ZR_`,9BE7FFEHCGO&:74NDZA800>?#<^;(
+<< MUZCH1!D[@Y7.\LF`5"*Q)C3D?+MJ2^*++Q-J'AAX&*7,5^XGMY&!=,VDY!R.
+<< M&0C!5AP0?7-:7_"'^&/^A<TC_P``8O\`XFH8/!FC6NOVVKV]OY,EK&R001`)
+<< M%&6&"P4#(X)&,[<LQV[B2?5C"$X6K/WH_"TOP:OU[]#SHP]G)NGM)W=_T_R_
+<< MR)_%T;R^#-<CC1GD>PG5549+$H<`"O`-4U7Q!=W5Q=66AZM97%U+)=3R+)<?
+<< M+<22QR,\2KM5%W0IM!#$=2S%4*?3%%-.QHT>&_#BWE;XHS:@NDW&GVUQ;.YC
+<< M>W,4:2L%+I&,8"!M^T=0H&<D&O1?B)/?VGAE;JQMY)E@G62X$9`*Q`-EN01P
+<< M=IR00"`Q!"FNMHIIP<E[2/-'JNZ[:$3IQG!PELSQ4R_\)@5^R2P:9X=TZ%;=
+<< M+JXD$:HJ@^5$TN"-^&V@G<(P_P#$S?O.K^&=G!$VJWNEBY30[WR9;6.9]P1_
+<< MGWJ/4@>6">>1M+,4-=_17-0I2H*4(2M%]-+7UU_'^KLZL57E7E#I&.R6W_#]
+<< MWU]$D<%\3K#4KBPCN]/M9)EMK2Z\R2.1$,60A#?,P/\`">F3Q7GJII-]J[);
+<< MR6#Q7"%3$]ZTS*""-HW[BP52S#)'S[6^4+M/O]96OZ#!X@LXK:>YN+?RI1*L
+<< MEN5#`[67^)6&,,>U:2C?8Z,/BU!*%2-X_IU_K_@G,?#348IH]6TY8XC-;SB>
+<< M:>.;?YA<NJ@C'RE4B12!Z9ZDU?\`%I^QWMO?3-MM9$\AG_N-DD9^N?TKH]-L
+<< M(M+TNTT^!G:&U@2!&<@L550HSC'.!4MQ;PW=N]O<1)+#(,.CC((^E17HQK4W
+<< M3EU,Z>*<,1[9+Y>IY$='N+^Z:*VN!';O)F:[FNP^X=<D8R".G?\`K7JFE2B>
+<< MS\V/)MV($#$8+H%"AC]<$CV(K'M_`/ARVN_M"6)8YW"-Y&9!_P`!)Q73````
+<< M#`%$85&XNI*_*K+Y[]7_`)+HC*HZ*E)T8VYG=[?I_P`/W&31+/!)"Y<+(I4E
+<< M'*,`1CA@00?<'(K+LO#&C:?/8S6MBD;6$#06HW,5A5CEBJDX#-W?&X]R:UZ*
+<< MV,BN_P#R*]__`->]S_Z/>KR_\><O_71/Y-5%XII-(>T1TC,HE20LF["M*[#&
+<< M".<$&DO[ZZM+4)::;+>N[@D)(B!``>I8CKGMZ'IW8CP+7M2U:'7;OR-!U![J
+<< MTO)8H;B.2:.)X!>-<@%8]K%O,/WM^`N,*&`<8UM;ZA>7?AUKC2;]+NRF6&:=
+<< MH&"O`KJ8RQ(R64%TR>`B1@8VFOH/^U]:_P"A9G_\"X?_`(JC^U]:_P"A9G_\
+<< M"X?_`(JG<5B/[2-%UG4Y[Z"\E%Y(CV\UM:2W&(UC5?+/EJQ7#AVP0!^\R"26
+<< MQ2L?M_\`PD,6[^T?M?VVX^V>9YOV;[)^]\G9G]UN_P"/?[GS_>S_`!UH_P!K
+<< MZU_T+,__`(%P_P#Q5']KZU_T+,__`(%P_P#Q5(9?M=1^T_8O]#O(OM5L;C][
+<< M%M\G&SY).?E?Y^G^RWI4]G<_;+&WNO)F@\Z-9/*G7;(F1G:P[,,X(]:R?[7U
+<< MK_H69_\`P+A_^*H_M?6O^A9G_P#`N'_XJE8#-U#_`(^?&/\`V#H__1<M=#;"
+<< M0Z?"RJ9(A96AFC49,B!9>,=^<''/`/!^Y6)#I^HZD_B!KBS^PM?VJ01"657`
+<< M8*ZDDH3Q\P[?G70W&@Z;>VMI%=S2,]M"(A);W=Q;EP`!\WED9Z<9)QEL8SQ%
+<< M2+=FNCOJ)JZ:?4Y[P[X@M-,\27EHXETVSU'R_LUM+`\(\_Y]QV-@Q[P`!N`W
+<< MM&YY/S'G/$8M#X-\,_;Q#]C_`.$QD\_S\>7Y?VFYW;LX&W`.<D#`ZG'R]=J/
+<< M@#P]?6\H6287#1&-);B]N;@*"0<%7)!!*KG&#U(*MM9=CPSI<7AOP]:Z4M^+
+<< MIH=[//)N!D=W+LW"\?,?4G'<D`C5TZ?\5/WWNNGDU^J?7KVBFG"/L^BV?7YG
+<< MEFJZA<VOAWQ59>'%8Z'K.HV^FZ$(POD&64$70CWX"QL5<!AA-W*@8)6UID$)
+<< M\!>._#&HZ3Y1T+[3<V-M=)'*;2*6)Y(0'!;,@^<DY)&>O'R>P?:(QTEB]N6_
+<< M^)]A^7;"[3[1&.DL7MRW_P`3[#\NV%VER['%^%]8\/>$_!'AN&=H;&2]TP7F
+<< MV&W;]Z8X%DFD.P'+!1DDG)P.X^3H=+\2:1KTL\.F78N'MX(Y9`(V4*DT+/&<
+<< ME0.5&<#D="!]U=/[1&.DL7MRW_Q/L/R[87:UIHB#^]CX5@`-V>5(_NCV_P#U
+<< M8`+C,W4KF.TMK">:18XDFA+NYP%'GC))]*R;N?2O#,A?PQ-;K<W+!7_?-.FQ
+<< M>NX$_+C/7)[^N1-JFHWP=;:WT*:\A6/8TAFB57R22`&;.,''('?ZGG'TV9]0
+<< M6[_X1.X3&"84O(1$Q'<KGZ>W%=.&KQIIJ=VNU]'ZG/7ISG\#2??MZ&AHMW%=
+<< M:K:;)(&:/3W1EA<L%_?G'4D\C!Y/.<UE:1:2ZK=6L4J:O;V8DU25P#<6>6>Z
+<< M1XB<;"<H[$9_VNX.->"YO[9R\'A`Q.1@M'/`IQZ<&I_[7UK_`*%F?_P+A_\`
+<< MBJPJR4IN459=NQM!-12D[OOW.4T0:DT_VF>+5X]=N;FQE<F*>.W:/R+83EA@
+<< M0[L"8<_,"`!R%KNDU'?Y'^AWB^=<R6_S18V;-_SMSPC>7\I[[T]:H?VOK7_0
+<< MLS_^!</_`,51_:^M?]"S/_X%P_\`Q504:UK<_:H6D\F:'$DD>V9=I.URNX#^
+<< MZ<9![@@UG^"O^15/UF_]*#4/]KZU_P!"S/\`^!</_P`51HOV_1O"PB;3)9[M
+<< MFD'D)+&"H:4N"6+8Z>F>2/?`!YSJ_B&YT?Q)K5G>:>YU.Y:2"R\Q5E6:VE;!
+<< M`C(/F,VV,`<CY0N!M97S;[P]MVVD]XTGBRXS<6T-M=YEM95.=CC&=[%D?S,X
+<< MX9@0J;I/6/[7UK_H69__``+A_P#BJ/[7UK_H69__``+A_P#BJQ]BH5_;8?W'
+<< MUMUTL]^]V_G;8T53EPOU6FN5-W;6[UO_`%YZO4Q_&JS3W4]O!:7DSOH.HPJ8
+<< MK:1T+N(RB[@NW<?+?`SG@?WAG,\5>%KJ&QE:WBFNPOVJ&RBB4R>1`UG<G:`!
+<< M\N9)`@`XVI`O45U?]KZU_P!"S/\`^!</_P`51_:^M?\`0LS_`/@7#_\`%5L9
+<< MCK>UNM-N)]3OY/MUW<_9[4BRMC&JH)&"G:78\&9F9MV-HZ<'-U]1V>?_`*'>
+<< M-Y-S';_+%G?OV?.O/*+YGS'ML?TJA_:^M?\`0LS_`/@7#_\`%4?VOK7_`$+,
+<< M_P#X%P__`!5(`?\`Y'N'_L&2?^C4J3Q6)+?58=0%K-<0PO+%(((S)(F]EPP0
+<< M`LP^7!V@D;LXQDBO8KJ5WXG6_N],DLXDLWA^>9'RQ=2/ND]@?RJS<ZSJ\EU,
+<< M\?AJY*,[%2UU"#C/&1N.*TIS=.2E'='/B\+#%494*FTNQCVOB+1+V:.&UU>P
+<< MFFD^Y''<(S-WX`.:I3VL\EOJ&M+$9(9+RPC6*W0S2;+:[S(Y5`3GEOE&2`HS
+<< M@Y4;-[=:EJ%I):W7A6:2&0#(^V1`@@Y!!#9!!`((Y!`(Y%4M'@U/19+MX=#U
+<< M*;[2X8BXOX6VX&`!R"3C`W-EB%4%C@8Z:^,=:'*U8\3*^'J>7XCVT9.6EM>G
+<< M^?Z>=](]<NKN]DGN+1=74O9#^R!%#<1#[6&D#>:H``7(A_UPV8SCC=5W04&D
+<< M)J0DM=1>Z?47,B`2O'MFN7,;Q[CLVA7#/LZ`'=R,5;_M?6O^A9G_`/`N'_XJ
+<< MC^U]:_Z%F?\`\"X?_BJXSZ,OOJ.SS_\`0[QO)N8[?Y8L[]^SYUYY1?,^8]MC
+<< M^E4/&/\`R*.I?]<OZBC^U]:_Z%F?_P`"X?\`XJJ&M3:YJVC75@OAZ:-IDVAS
+<< M=0D`_P#?5"`ZC4[=[OP_-;1E0\RS1J6Z`E`!FN._X2/2[;]SJ%S'I=PHPUO?
+<< M,(6';Y=V`ZY!&Y25..":Z?4=1O;9(8;/2)KS!9V=9HT49P`/F;)/'ICI^%#^
+<< MU]:_Z%F?_P`"X?\`XJNC#XF5&]E>YX^;9-1S)1YY-..UO,R[E1K4^FVMG+`Z
+<< M/-%?>=Y@(,<,L;_)CEB25&1P`22>@:.S6:YMETR*TO([Z#6IKKSI;:2...+[
+<< M8[LRR%0#OB8H`I)(DP?EW$,ETV[?58;^+P]J-NR3_:&BAU"$1O)_>VDG83EL
+<< M[-N[<V[=DUM_VOK7_0LS_P#@7#_\52Q%9UI\QKE.71R^A["+OJW?O?\`+30Y
+<< MJR77[S5KE(IKRVEFMI+EH9HKI88+I)8FCB,LC,KH<R*WDA59=W&-N.GTFYNE
+<< MMX;J[AO#+JERTBQ%3BT3RR45P?\`5_)&H8<CS'..#3?[7UK_`*%F?_P+A_\`
+<< MBJ/[7UK_`*%F?_P+A_\`BJP/3+Z:CO\`(_T.\7SKF2W^:+&S9O\`G;GA&\OY
+<< M3WWIZU6\)_\`'YKO_7_/_P"B5J'^U]:_Z%F?_P`"X?\`XJC0?M^GVVJW<^F2
+<< M^?<7,DL=LLL98AHU4?-NVCG/?H.G:@##DB\_QYJT1A\U'@C#(8O,!'[KMY<G
+<< M\A]1WY;QS"+>&ZB6$0HMBFU!%Y8&1*>GE1]R?X3]>PZ>^TJ_OM4EU#^QM6MY
+<< MY0`QM]1A3@`#''..!WJE>>%[F_@DBN=)UJ7S$*%GU*!FQ@]SGU/YGUKHISA&
+<< MI&;Z6."5*?LY0Y=6WKY-W(?!HMH_A]X>N6N-4M;I5NHXY]/LFN&"-,2ZL/+D
+<< M4`E4.2`?EX/6N@MCK4^IVEG=2^4]S';ZA?)%*2;5D4!XE()"H[I'@<[@+GGI
+<< M2:!'J/AS1+?2K/P[>/!!NVM->0%CN8L<D$#J3VJ^-1U59WG'A603.JHT@N8=
+<< MS*"2`3GD`LV/J?6HKS4ZLI+9MO\`$[EHCG=+M=9MK33Y2VKF=+;3)7$\TTG[
+<< MV64I=!@Q(.(P,J>(_O`*237:)J._R/\`0[Q?.N9+?YHL;-F_YVYX1O+^4]]Z
+<< M>M4/[7UK_H69_P#P+A_^*H_M?6O^A9G_`/`N'_XJL1D-Y<_:M?T"3R9H<75U
+<< M'MF7:3M1UW`?W3C(/<$&NBKF_P#B:ZCKNE3SZ/):0VKR,[M/&XPT;*.%.>I%
+<< M=)0P"BBB@84444`%%%%`!574/^/9/^N\/_HQ:M5%/`;E%C#JF)$<LV<85@QZ
+<< M`^E`&=#JXT7Q([ZG9>78W!$<.IAE98RP0".3^)`65N>5RXYRQ%8_A&UO;'P-
+<< MX>%_=(<VLCQ)(C.+5`8!L8D@DAE9CG&PMM'RH*[&:SM[B"2">6WEAD4H\;HS
+<< M*RD8((*\@BLS0_#%AX?BFBM;YY$DE:11.[/Y0;&43Y>!D9.<DDDDD\UC2HJG
+<< M.4E]K_@_Y_+\ANYG>)[:_N=)CAAM);V3?EOLIA1E/9L3[D*XR"#DY((Z5YM9
+<< M:_%9ZC97QN&5+>X27[//-8!^5:-@8X=LA?;(V`<;3U'&*]O6WA1`B7$*JHP`
+<< M%8`#_OFJ.K:'::S:I:W5YB$2*[)&SKYF/X6^7I_@*UDY<K433#QH^WC*LKQZ
+<< M^GX?F8VF>,=,U'^TYC<6]O96+HK7$UPJYW="RG!0$XQGKGU!%9>H:A+K-RKG
+<< M]U;0N3;RV>HR%;E">&=5"J1@`X)<<G\>A'A*QAMK^WL]2DLX[QU<K#R(F!R2
+<< MBLA`SWR#[8P,4?\`A!4_Z&O4O^^(/_D>O/Q='%U:?LZ;2ON[O\++^MCS<^HU
+<< M\3)T\O:C!VU;:?IL_F[V>MDD8D7_`",WA[_K]D_])IZX#QS,L?Q.U4._RL\`
+<< MV;<[CY4>/88.#G\J]@L_!5O:ZG:7TGB"\NFM7:2..98PFXHR9.R%3T<]Z/%'
+<< M@/1O%AMY+VZ:"Y@/R7%L2LFWKM)*$$9YZ<'IC)SW9+36#H3HU]5)-:6>]FMU
+<< MY>JW3N&04:N5PAS6;C*^E[?I_EWNCQOP(3_PM#2%+`@-*%4?P#R)/EXXXZ<5
+<< MZQJ7AO5+CQ:=;MM<O(H%L'@2VB$64?<C87>C+M;;R2-P(7DCA;7A;P#HGA(S
+<< MR6-R9KF;AKBY)9PG]P80`+GG@<G&<X&.E\F/_GYB_)O_`(FN_&XB-:<>3:,5
+<< M'6RO9;V6B]/Q/0JS]I4E4:MS-OOOYG(ZQX8N]1T:]LK2_DLV>TDMU5%C\N=G
+<< M4EG?*,R[F8[MN">3DG&,SQ1Y^E>%-*T&>6]U*ZFEA!OI`@!,4L<C;R2.2H;`
+<< M&YB%)).":]!\F/\`Y^8OR;_XFJ][I=GJ-G):7<D,L$@PRG>.AR""!D$$`@CD
+<< M$`CD5R$'CRVL&CZS9S3:0D4KZG_:!OE\D;;06X5RQW;PH<[CD8)/&6(![G0]
+<< M,-KX:OKF/2@E[?37$\D>U8IIXVFD9%8GH_EO@;ONDX.,$5?L?`VC6=U'=RW4
+<< MMY>(5)FN9I"&*9V9C4"/Y<_+\O!YZ\UT/DQ_\_,7Y-_\30V"/#M2D:*6YTV\
+<< M-U82-&T,J75QI4#%73J#M!VX;!*Y[C.0:[W0O'5KK%WI=@@C:ZN8"\S[Q&H9
+<< M5R?+4DEP>N`3A2#S@X["XLXY[:6'[:L?F(5WQ[@RY&,@[>#618>#])TRZM+F
+<< MSN?*DMXVC8JS?O@?^>GR\\\]NW8`#.HZDI*VW4[<(L'"C-5(^]]FU[;/?5>5
+<< MO/?30X24^&HM;UQ=;@T1[A]1>2-[J2W,NPQQK@[VW`95B`0.I/>N8M+K2(-;
+<< MO;^T6QGNYM2:5GAU`O-.B7HE"1P[,%F$:A<-@Y'/.*]8N?!2W+OGQ7JB0L?E
+<< M@5HRB*.BC="3@#`&2>@K4T;0+71;:6**_,\DTIFFGG)+RN0%R<(!]U5'`'3U
+<< MR3T2J7BH]CR:6%C3JSJIN\K7N]-.W8S_`!)')>Q66BJZ1PZO.]E<.4+,L1@E
+<< M=MG(`8A,`G(&<X/2N$\=7.CZ=I]I=^'I9KK5+29KF35E/F,!Y+D`/T*,\BL4
+<< MC'E#Y\A>17INK:!I>NV0M-2,$\(=9%YD5D=3PRLH!4^X(X)'>LO3/`FC:=.M
+<< MQ-='4+B-@T<M[EO+(((*JJ!`P(R&V[N2,XXKR<1@ZU7$PJJHU&/V?/77S_2W
+<< M4ZU))6L-\27$=B]O>2.%$<<BDMTP2A_/@5S.A^+X=3U>ZLKE[:V(6-K9'D"R
+<< M2[BX(P3R1M!X_O5V'B+PG9^)(K>.XU6:V$#%E-L<9SZ[HV':J6E?#W1M,M]0
+<< MMWOY;Z*_2-)5NCT"%BNW9&N""Q.>H(!&,5Z6&J5Z-=S<[PZ1Z;?YZGR^/X>6
+<< M-Q%2K-VYK6?562Z?(ATJ[6&WU?Q).[+9+"8Q%U8+;M+O<CH"26&WL$&2"2J\
+<< M;JM[XF_X230-;N+4?:[B2<:=I!)#1)Y17<PR,L?,#,#C`7DKR%])T7PQ::'+
+<< M>R0:I<3_`&MP[+<RNX3`P`/ER>,#<Q+$*N2<"M?R8_\`GYB_)O\`XFBNW5FY
+<< M7/I<K4<#AXT5%.RM^'^>O1^AS/AOPV=),VH:A,+S6KOFYN3R%''R)P,*,#L,
+<< MX'``55Z"IO)C_P"?F+\F_P#B:/)C_P"?F+\F_P#B:E*VB-)SE.7-+<YGQT8!
+<< MX#UW[1+Y2?8I<-YICRVT[1D$=6P,?Q9QSG%9?B:]\-WM];6]S?:=#<36RS1W
+<< M]S<(/L\+$[9+<L<>:Q!PR=-H9B=J*W=>3'_S\Q?DW_Q-'DQ_\_,7Y-_\33(.
+<< M9O\`^T[U;^WTN\AG9+U8YXI':V,,7DHQC2548[B2K;@,@2,`5(!'(^7KK^"?
+<< M"LRPV9LXH],*1"]>,M+YT84OB,[E*[.,X4LYPY5"/5/)C_Y^8OR;_P")H\F/
+<< M_GYB_)O_`(F@"&IH?]5<?]<Q_P"A+1Y,?_/S%^3?_$TX".**;]^CEE"@*&_O
+<< '`]Q[4`?_V0``
+<< `
+<< end
+<<  UID 32475)
+<< 21 OK FETCH completed.
+>> 22 IDLE
+<< + IDLE accepted, awaiting DONE command.
+>> DONE
+<< 22 OK IDLE completed.
+>> 23 LOGOUT
+<< * BYE Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 signing off.
+<< 23 OK LOGOUT completed.
Binary file email/pop3andsmtpmtm/imapservermtm/test/data/mail1_UUEncoded_attachment.jpg has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/mail2_Base64.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,113 @@
+<< * OK Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 (lon-cn-exchng2k.msexchange2k.closedtest.intra) ready.
+>> 1 CAPABILITY
+<< * CAPABILITY IMAP4 IMAP4rev1 IDLE LOGIN-REFERRALS MAILBOX-REFERRALS NAMESPACE LITERAL+ UIDPLUS CHILDREN AUTH=NTLM
+<< 1 OK CAPABILITY completed.
+>> 2 LOGIN davids davids
+<< 2 OK LOGIN completed.
+>> 3 SELECT "INBOX"
+<< * 1 EXISTS
+<< * 0 RECENT
+<< * FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
+<< * OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags
+<< * OK [UNSEEN 1] Is the first unseen message
+<< * OK [UIDVALIDITY 1589] UIDVALIDITY value
+<< 3 OK [READ-WRITE] SELECT completed.
+>> 4 UID FETCH 1:* (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Priority X-Priority X-MSMail-Priority Importance)])
+<< * 1 FETCH (UID 32462 FLAGS () BODYSTRUCTURE ("TEXT" "PLAIN" ("charset" "ISO-2022-JP") NIL NIL "BASE64" 257 5 NIL NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From)] {309}
+<< Received: from [127.0.0.1] ([10.23.179.168]) by lon-cn-exchng2k.msexchange2k.closedtest.intra with Microsoft SMTPSVC(5.0.2195.5329);
+<< 	 Wed, 6 Jul 2005 16:53:40 +0100
+<< Date: Tue, 01 Feb 2005 16:38:05 +0900
+<< Subject: =?ISO-2022-JP?B?QVNDSUkxMDAwGyRCSjg7ehsoQg==?=
+<< From: tomonori <tomonori1000@yahoo.co.jp>
+<< 
+<< )
+<< 4 OK FETCH completed.
+>> 5 LIST "" "%"
+<< * LIST (\Marked \HasNoChildren) "/" "Big Test inbox"
+<< * LIST (\HasNoChildren) "/" Calendar
+<< * LIST (\HasNoChildren) "/" Contacts
+<< * LIST (\HasNoChildren) "/" "Deleted Items"
+<< * LIST (\HasNoChildren) "/" Drafts
+<< * LIST (\Marked \HasNoChildren) "/" INBOX
+<< * LIST (\HasNoChildren) "/" Journal
+<< * LIST (\HasNoChildren) "/" Notes
+<< * LIST (\HasNoChildren) "/" Outbox
+<< * LIST (\Marked \HasNoChildren) "/" "Sent Items"
+<< * LIST (\HasNoChildren) "/" Tasks
+<< * LIST (\Noselect) "/" "Public Folders/"
+<< 5 OK LIST completed.
+>> 6 LIST "" "Big Test inbox/%"
+<< 6 OK LIST completed.
+>> 7 LIST "" "Calendar/%"
+<< 7 OK LIST completed.
+>> 8 LIST "" "Contacts/%"
+<< 8 OK LIST completed.
+>> 9 LIST "" "Deleted Items/%"
+<< 9 OK LIST completed.
+>> 10 LIST "" "Drafts/%"
+<< 10 OK LIST completed.
+>> 11 LIST "" "INBOX/%"
+<< 11 OK LIST completed.
+>> 12 LIST "" "Journal/%"
+<< 12 OK LIST completed.
+>> 13 LIST "" "Notes/%"
+<< 13 OK LIST completed.
+>> 14 LIST "" "Outbox/%"
+<< 14 OK LIST completed.
+>> 15 LIST "" "Sent Items/%"
+<< 15 OK LIST completed.
+>> 16 LIST "" "Tasks/%"
+<< 16 OK LIST completed.
+>> 17 LIST "" "Public Folders//%"
+<< 17 NO This a special mailbox and can not be selected or used as the destination for mailbox operations.
+>> 18 IDLE
+<< + IDLE accepted, awaiting DONE command.
+>> DONE
+<< 18 OK IDLE completed.
+>> 19 UID FETCH 32462 (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Reply-to To Cc Bcc Message-ID Return-Receipt-To X-Return-Receipt-To Disposition-Notification-To Disposition-Notification-Options Priority X-Priority X-MSMail-Priority Importance)])
+<< * 1 FETCH (UID 32462 FLAGS () BODYSTRUCTURE ("TEXT" "PLAIN" ("charset" "ISO-2022-JP") NIL NIL "BASE64" 257 5 NIL NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From Reply-to To Cc Bcc Message-ID Return-Receipt-To X-Return-Receipt-To Disposition-Notification-To Disposition-Notification-Options Priority X-Priority X-MSMail-Priority Importance)] {405}
+<< Received: from [127.0.0.1] ([10.23.179.168]) by lon-cn-exchng2k.msexchange2k.closedtest.intra with Microsoft SMTPSVC(5.0.2195.5329);
+<< 	 Wed, 6 Jul 2005 16:53:40 +0100
+<< Date: 
+<< Tue, 01 Feb 2005 16:38:05 +0900
+<< Subject: =?ISO-2022-JP?B?QVNDSUkxMDAwGyRCSjg7ehsoQg==?=
+<< From: tomonori <tomonori1000@yahoo.co.jp>
+<< To: mot1008jp@yahoo.co.jp
+<< Message-ID: <JG2005020116374116.5681349@yahoo.co.jp>
+<< X-Priority: 3
+<< 
+<< )
+<< 19 OK FETCH completed.
+>> 20 UID FETCH 32462 (BODY[1]<0.20480> BODY[1.MIME])
+<< * 1 FETCH (BODY[1]<0> {257}
+<< VGhpcyBpcyBhIHRlc3QgbWVzc2FnZS4gTGV0cyBtYWtlIGl0IGEgcmVhbGx5IGxvbmcgbWVzc2FnZSBhbmQgaG9wZSBpdCBpcyBkZWNvZGVkIGNvcnJlY3RseSB3aXRoIElNQVAgISEh
+<< __________________________________
+<< Let's Celebrate Together!
+<< Yahoo! JAPAN
+<< http://pr.mail.yahoo.co.jp/so2005/
+<< 
+<<  BODY[1.MIME] {687}
+<< Received: from [127.0.0.1] ([10.23.179.168]) by lon-cn-exchng2k.msexchange2k.closedtest.intra with Microsoft SMTPSVC(5.0.2195.5329);
+<< 	 Wed, 6 Jul 2005 16:53:40 +0100
+<< MIME-Version: 1.0
+<< Date: Tue, 01 Feb 2005 16:38:05 +0900
+<< Subject: =?ISO-2022-JP?B?QVNDSUkxMDAwGyRCSjg7ehsoQg==?=
+<< From: tomonori <tomonori1000@yahoo.co.jp>
+<< To: mot1008jp@yahoo.co.jp
+<< Message-ID: <JG2005020116374116.5681349@yahoo.co.jp>
+<< Content-Type: text/plain; charset=ISO-2022-JP
+<< Content-Transfer-Encoding: Base64
+<< X-Mailer: JsvMail 5.5 (Shuriken Pro3 Trial)
+<< X-Priority: 3
+<< Return-Path: tomjan@msexchange2k.closedtest.intra
+<< X-OriginalArrivalTime: 06 Jul 2005 15:53:40.0421 (UTC) FILETIME=[E0FF5750:01C58242]
+<< 
+<<  UID 32462 FLAGS (\Seen))
+<< 20 OK FETCH completed.
+>> 21 IDLE
+<< + IDLE accepted, awaiting DONE command.
+>> DONE
+<< 21 OK IDLE completed.
+>> 22 LOGOUT
+<< * BYE Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 signing off.
+<< 22 OK LOGOUT completed.
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/mail2_Base64_body.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,1 @@
+This is a test message. Lets make it a really long message and hope it is decoded correctly with IMAP !!!
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/multipleReceived.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,73 @@
+<< * OK Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 (lon-cn-exchng2k.msexchange2k.closedtest.intra) ready.
+>> 1 CAPABILITY
+<< * CAPABILITY IMAP4 IMAP4rev1 IDLE LOGIN-REFERRALS MAILBOX-REFERRALS NAMESPACE LITERAL+ UIDPLUS CHILDREN AUTH=NTLM
+<< 1 OK CAPABILITY completed.
+>> 2 LOGIN davids davids
+<< 2 OK LOGIN completed.
+>> 3 SELECT "INBOX"
+<< * 1 EXISTS
+<< * 0 RECENT
+<< * FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
+<< * OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags
+<< * OK [UNSEEN 1] Is the first unseen message
+<< * OK [UIDVALIDITY 1378] UIDVALIDITY value
+<< 3 OK [READ-WRITE] SELECT completed.
+>> 4 UID FETCH 1:* (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Priority X-Priority X-MSMail-Priority Importance)])
+<< * 1 FETCH (UID 194 FLAGS (\Seen) BODYSTRUCTURE (("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 20 1 NIL NIL NIL)("TEXT" "HTML" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 355 6 NIL NIL NIL) "alternative" ("boundary" "----=_NextPart_000_0009_01C53A8E.CBCBDF30") NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From)] {617}
+<< Received: from LONDAVIDS02 ([10.23.163.107]) by lon-cn-exchng2k.msexchange2k.closedtest.intra with Microsoft SMTPSVC(5.0.2195.5329);
+<< 	 Wed, 6 Apr 2005 09:52:12 +0100
+<< Received: from LONDAVIDS02 ([10.23.163.107]) by lon-cn-exchng2k.msexchange2k.closedtest.intra with Microsoft SMTPSVC(5.0.2195.5329);
+<< 	 Wed, 6 Apr 2005 09:52:32 +0100
+<< Received: from LONDAVIDS02 ([10.23.163.107]) by lon-cn-exchng2k.msexchange2k.closedtest.intra with Microsoft SMTPSVC(5.0.2195.5329);
+<< 	 Wed, 6 Apr 2005 09:22:32 +0100
+<< Date: Wed, 6 Apr 2005 09:55:42 +0100
+<< Subject: test1 msg
+<< From: "IMAP" <davids@msexchange2k.closedtest.intra>
+<< 
+<< )
+<< 4 OK FETCH completed.
+>> 5 LIST "" "%"
+<< * LIST (\Marked \HasNoChildren) "/" "Big Test inbox"
+<< * LIST (\HasNoChildren) "/" Calendar
+<< * LIST (\HasNoChildren) "/" Contacts
+<< * LIST (\HasNoChildren) "/" "Deleted Items"
+<< * LIST (\HasNoChildren) "/" Drafts
+<< * LIST (\Marked \HasNoChildren) "/" INBOX
+<< * LIST (\HasNoChildren) "/" Journal
+<< * LIST (\HasNoChildren) "/" Notes
+<< * LIST (\HasNoChildren) "/" Outbox
+<< * LIST (\Marked \HasNoChildren) "/" "Sent Items"
+<< * LIST (\HasNoChildren) "/" Tasks
+<< * LIST (\Noselect) "/" "Public Folders/"
+<< 5 OK LIST completed.
+>> 6 LIST "" "Big Test inbox/%"
+<< 6 OK LIST completed.
+>> 7 LIST "" "Calendar/%"
+<< 7 OK LIST completed.
+>> 8 LIST "" "Contacts/%"
+<< 8 OK LIST completed.
+>> 9 LIST "" "Deleted Items/%"
+<< 9 OK LIST completed.
+>> 10 LIST "" "Drafts/%"
+<< 10 OK LIST completed.
+>> 11 LIST "" "INBOX/%"
+<< 11 OK LIST completed.
+>> 12 LIST "" "Journal/%"
+<< 12 OK LIST completed.
+>> 13 LIST "" "Notes/%"
+<< 13 OK LIST completed.
+>> 14 LIST "" "Outbox/%"
+<< 14 OK LIST completed.
+>> 15 LIST "" "Sent Items/%"
+<< 15 OK LIST completed.
+>> 16 LIST "" "Tasks/%"
+<< 16 OK LIST completed.
+>> 17 LIST "" "Public Folders//%"
+<< 17 NO This a special mailbox and can not be selected or used as the destination for mailbox operations.
+>> 18 IDLE
+<< + IDLE accepted, awaiting DONE command.
+>> DONE
+<< 18 OK IDLE completed.
+>> 19 LOGOUT
+<< * BYE Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 signing off.
+<< 19 OK LOGOUT completed.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/noReceivednoDate.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,66 @@
+<< * OK Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 (lon-cn-exchng2k.msexchange2k.closedtest.intra) ready.
+>> 1 CAPABILITY
+<< * CAPABILITY IMAP4 IMAP4rev1 IDLE LOGIN-REFERRALS MAILBOX-REFERRALS NAMESPACE LITERAL+ UIDPLUS CHILDREN AUTH=NTLM
+<< 1 OK CAPABILITY completed.
+>> 2 LOGIN davids davids
+<< 2 OK LOGIN completed.
+>> 3 SELECT "INBOX"
+<< * 1 EXISTS
+<< * 0 RECENT
+<< * FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
+<< * OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags
+<< * OK [UNSEEN 1] Is the first unseen message
+<< * OK [UIDVALIDITY 1378] UIDVALIDITY value
+<< 3 OK [READ-WRITE] SELECT completed.
+>> 4 UID FETCH 1:* (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Priority X-Priority X-MSMail-Priority Importance)])
+<< * 1 FETCH (UID 198 FLAGS (\Seen) BODYSTRUCTURE (("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 50 1 NIL NIL NIL)("TEXT" "HTML" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 389 7 NIL NIL NIL) "alternative" ("boundary" "----=_NextPart_000_001A_01C53B8F.44B87AB0") NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From)] {71}
+<< Subject: test3
+<< From: "IMAP" <davids@msexchange2k.closedtest.intra>
+<< 
+<< )
+<< 4 OK FETCH completed.
+>> 5 LIST "" "%"
+<< * LIST (\Marked \HasNoChildren) "/" "Big Test inbox"
+<< * LIST (\HasNoChildren) "/" Calendar
+<< * LIST (\HasNoChildren) "/" Contacts
+<< * LIST (\HasNoChildren) "/" "Deleted Items"
+<< * LIST (\HasNoChildren) "/" Drafts
+<< * LIST (\Marked \HasNoChildren) "/" INBOX
+<< * LIST (\HasNoChildren) "/" Journal
+<< * LIST (\HasNoChildren) "/" Notes
+<< * LIST (\HasNoChildren) "/" Outbox
+<< * LIST (\Marked \HasNoChildren) "/" "Sent Items"
+<< * LIST (\HasNoChildren) "/" Tasks
+<< * LIST (\Noselect) "/" "Public Folders/"
+<< 5 OK LIST completed.
+>> 6 LIST "" "Big Test inbox/%"
+<< 6 OK LIST completed.
+>> 7 LIST "" "Calendar/%"
+<< 7 OK LIST completed.
+>> 8 LIST "" "Contacts/%"
+<< 8 OK LIST completed.
+>> 9 LIST "" "Deleted Items/%"
+<< 9 OK LIST completed.
+>> 10 LIST "" "Drafts/%"
+<< 10 OK LIST completed.
+>> 11 LIST "" "INBOX/%"
+<< 11 OK LIST completed.
+>> 12 LIST "" "Journal/%"
+<< 12 OK LIST completed.
+>> 13 LIST "" "Notes/%"
+<< 13 OK LIST completed.
+>> 14 LIST "" "Outbox/%"
+<< 14 OK LIST completed.
+>> 15 LIST "" "Sent Items/%"
+<< 15 OK LIST completed.
+>> 16 LIST "" "Tasks/%"
+<< 16 OK LIST completed.
+>> 17 LIST "" "Public Folders//%"
+<< 17 NO This a special mailbox and can not be selected or used as the destination for mailbox operations.
+>> 18 IDLE
+<< + IDLE accepted, awaiting DONE command.
+>> DONE
+<< 18 OK IDLE completed.
+>> 19 LOGOUT
+<< * BYE Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 signing off.
+<< 19 OK LOGOUT completed.
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/partialDownload.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,114 @@
+19/07/05 12:40:19 << * OK Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 (lon-cn-exchng2k.msexchange2k.closedtest.intra) ready.
+19/07/05 12:40:19 >> 1 CAPABILITY
+19/07/05 12:40:19 << * CAPABILITY IMAP4 IMAP4rev1 IDLE LOGIN-REFERRALS MAILBOX-REFERRALS NAMESPACE LITERAL+ UIDPLUS CHILDREN AUTH=NTLM
+19/07/05 12:40:19 << 1 OK CAPABILITY completed.
+19/07/05 12:40:19 >> 2 LOGIN davids davids
+19/07/05 12:40:19 << 2 OK LOGIN completed.
+19/07/05 12:40:19 >> 3 SELECT "INBOX"
+19/07/05 12:40:19 << * 2 EXISTS
+19/07/05 12:40:19 << * 0 RECENT
+19/07/05 12:40:19 << * FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
+19/07/05 12:40:19 << * OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] Permanent flags
+19/07/05 12:40:19 << * OK [UIDVALIDITY 1378] UIDVALIDITY value
+19/07/05 12:40:19 << 3 OK [READ-WRITE] SELECT completed.
+19/07/05 12:40:19 >> 4 UID FETCH 1:* (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Priority X-Priority X-MSMail-Priority Importance)])
+19/07/05 12:40:19 << * 1 FETCH (UID 325 FLAGS (\Seen) BODYSTRUCTURE (("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 13 1 NIL NIL NIL)("TEXT" "HTML" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 374 7 NIL NIL NIL) "alternative" ("boundary" "----=_NextPart_000_0048_01C58BA5.75BDE0D0") NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From)] {285}
+19/07/05 12:40:19 << Received: from LONDAVIDS02 ([10.23.163.109]) by lon-cn-exchng2k.msexchange2k.closedtest.intra with Microsoft SMTPSVC(5.0.2195.5329);
+19/07/05 12:40:19 << 	 Mon, 18 Jul 2005 14:28:14 +0100
+19/07/05 12:40:19 << Date: Mon, 18 Jul 2005 14:32:01 +0100
+19/07/05 12:40:19 << Subject: 2nd message
+19/07/05 12:40:19 << From: "IMAP" <davids@msexchange2k.closedtest.intra>
+19/07/05 12:40:19 << 
+19/07/05 12:40:19 << )
+19/07/05 12:40:19 << * 2 FETCH (UID 329 FLAGS (\Seen) BODYSTRUCTURE (("APPLICATION" "X-ZIP-COMPRESSED" ("name" " ") NIL NIL "BASE64" 13684 NIL ("attachment" ("filename" " ")) NIL) "mixed" ("boundary" "----=_NextPart_000_0007_01C34BA8.F979BDC0") NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From)] {314}
+19/07/05 12:40:19 << Received: from [10.32.179.130] (HELO LONCHRISGI01)
+19/07/05 12:40:19 <<   by LON-msgtest06.intra (CommuniGate Pro SMTP 4.0.6)
+19/07/05 12:40:19 <<   with SMTP id 180189 for smtp@lon-msgtest06.intra; Wed, 16 Jul 2003 14:46:07 +0100
+19/07/05 12:40:19 << Date: Wed, 16 Jul 2003 14:46:00 +0100
+19/07/05 12:40:19 << Subject: attachment only email
+19/07/05 12:40:19 << From: "Chris Gibson" <chris.gibson@symbian.com>
+19/07/05 12:40:19 << 
+19/07/05 12:40:19 << )
+19/07/05 12:40:19 << 4 OK FETCH completed.
+19/07/05 12:40:19 >> 5 LIST "" "%"
+19/07/05 12:40:19 << * LIST (\Marked \HasNoChildren) "/" "Big Test inbox"
+19/07/05 12:40:20 << * LIST (\HasNoChildren) "/" Calendar
+19/07/05 12:40:20 << * LIST (\HasNoChildren) "/" Contacts
+19/07/05 12:40:20 << * LIST (\HasNoChildren) "/" "Deleted Items"
+19/07/05 12:40:20 << * LIST (\HasNoChildren) "/" Drafts
+19/07/05 12:40:20 << * LIST (\Marked \HasNoChildren) "/" INBOX
+19/07/05 12:40:20 << * LIST (\HasNoChildren) "/" Journal
+19/07/05 12:40:20 << * LIST (\HasNoChildren) "/" Notes
+19/07/05 12:40:20 << * LIST (\HasNoChildren) "/" Outbox
+19/07/05 12:40:20 << * LIST (\Marked \HasNoChildren) "/" "Sent Items"
+19/07/05 12:40:20 << * LIST (\HasNoChildren) "/" Tasks
+19/07/05 12:40:20 << * LIST (\Noselect) "/" "Public Folders/"
+19/07/05 12:40:20 << 5 OK LIST completed.
+19/07/05 12:40:20 >> 6 LIST "" "Big Test inbox/%"
+19/07/05 12:40:20 << 6 OK LIST completed.
+19/07/05 12:40:20 >> 7 LIST "" "Calendar/%"
+19/07/05 12:40:20 << 7 OK LIST completed.
+19/07/05 12:40:20 >> 8 LIST "" "Contacts/%"
+19/07/05 12:40:20 << 8 OK LIST completed.
+19/07/05 12:40:20 >> 9 LIST "" "Deleted Items/%"
+19/07/05 12:40:20 << 9 OK LIST completed.
+19/07/05 12:40:20 >> 10 LIST "" "Drafts/%"
+19/07/05 12:40:20 << 10 OK LIST completed.
+19/07/05 12:40:20 >> 11 LIST "" "INBOX/%"
+19/07/05 12:40:20 << 11 OK LIST completed.
+19/07/05 12:40:20 >> 12 LIST "" "Journal/%"
+19/07/05 12:40:20 << 12 OK LIST completed.
+19/07/05 12:40:20 >> 13 LIST "" "Notes/%"
+19/07/05 12:40:20 << 13 OK LIST completed.
+19/07/05 12:40:20 >> 14 LIST "" "Outbox/%"
+19/07/05 12:40:20 << 14 OK LIST completed.
+19/07/05 12:40:20 >> 15 LIST "" "Sent Items/%"
+19/07/05 12:40:20 << 15 OK LIST completed.
+19/07/05 12:40:20 >> 16 LIST "" "Tasks/%"
+19/07/05 12:40:20 << 16 OK LIST completed.
+19/07/05 12:40:20 >> 17 LIST "" "Public Folders//%"
+19/07/05 12:40:20 << 17 NO This a special mailbox and can not be selected or used as the destination for mailbox operations.
+19/07/05 12:40:20 >> 18 IDLE
+19/07/05 12:40:20 << + IDLE accepted, awaiting DONE command.
+19/07/05 12:40:21 >> DONE
+19/07/05 12:40:21 << 18 OK IDLE completed.
+19/07/05 12:40:21 >> 19 UID FETCH 325 (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Reply-to To Cc Bcc Message-ID Return-Receipt-To X-Return-Receipt-To Disposition-Notification-To Disposition-Notification-Options Priority X-Priority X-MSMail-Priority Importance)])
+19/07/05 12:40:21 << * 1 FETCH (UID 325 FLAGS (\Seen) BODYSTRUCTURE (("TEXT" "PLAIN" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 13 1 NIL NIL NIL)("TEXT" "HTML" ("charset" "iso-8859-1") NIL NIL "QUOTED-PRINTABLE" 374 7 NIL NIL NIL) "alternative" ("boundary" "----=_NextPart_000_0048_01C58BA5.75BDE0D0") NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From Reply-to To Cc Bcc Message-ID Return-Receipt-To X-Return-Receipt-To Disposition-Notification-To Disposition-Notification-Options Priority X-Priority X-MSMail-Priority Importance)] {444}
+19/07/05 12:40:21 << Received: from LONDAVIDS02 ([10.23.163.109]) by lon-cn-exchng2k.msexchange2k.closedtest.intra with Microsoft SMTPSVC(5.0.2195.5329);
+19/07/05 12:40:21 << 	 Mon, 18 Jul 2005 14:28:14 +0100
+19/07/05 12:40:21 << Date: Mon, 18 Jul 2005 14:32:01 +0100
+19/07/05 12:40:21 << Subject: 2nd message
+19/07/05 12:40:21 << From: "IMAP" <davids@msexchange2k.closedtest.intra>
+19/07/05 12:40:21 << To: "David Test Account" <davids@msexchange2k.closedtest.intra>
+19/07/05 12:40:21 << Message-ID: <004b01c58b9d$140a1aa0$0100a8c0@intra>
+19/07/05 12:40:21 << X-Priority: 3
+19/07/05 12:40:21 << X-MSMail-Priority: Normal
+19/07/05 12:40:21 << 
+19/07/05 12:40:21 << )
+19/07/05 12:40:21 << 19 OK FETCH completed.
+19/07/05 12:40:21 >> 20 IDLE
+19/07/05 12:40:21 << + IDLE accepted, awaiting DONE command.
+19/07/05 12:40:21 >> DONE
+19/07/05 12:40:21 << 20 OK IDLE completed.
+19/07/05 12:40:21 >> 21 UID FETCH 329 (UID FLAGS BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (Received Date Subject From Reply-to To Cc Bcc Message-ID Return-Receipt-To X-Return-Receipt-To Disposition-Notification-To Disposition-Notification-Options Priority X-Priority X-MSMail-Priority Importance)])
+19/07/05 12:40:21 << * 2 FETCH (UID 329 FLAGS (\Seen) BODYSTRUCTURE (("APPLICATION" "X-ZIP-COMPRESSED" ("name" " ") NIL NIL "BASE64" 13684 NIL ("attachment" ("filename" " ")) NIL) "mixed" ("boundary" "----=_NextPart_000_0007_01C34BA8.F979BDC0") NIL NIL) BODY[HEADER.FIELDS (Received Date Subject From Reply-to To Cc Bcc Message-ID Return-Receipt-To X-Return-Receipt-To Disposition-Notification-To Disposition-Notification-Options Priority X-Priority X-MSMail-Priority Importance)] {440}
+19/07/05 12:40:21 << Received: from [10.32.179.130] (HELO LONCHRISGI01)
+19/07/05 12:40:21 <<   by LON-msgtest06.intra (CommuniGate Pro SMTP 4.0.6)
+19/07/05 12:40:21 <<   with SMTP id 180189 for smtp@lon-msgtest06.intra; Wed, 16 Jul 2003 14:46:07 +0100
+19/07/05 12:40:21 << Date: Wed, 16 Jul 2003 14:46:00 +0100
+19/07/05 12:40:21 << Subject: attachment only email
+19/07/05 12:40:21 << From: "Chris Gibson" <chris.gibson@symbian.com>
+19/07/05 12:40:21 << To: <smtp@lon-msgtest06.intra>
+19/07/05 12:40:21 << Message-ID: <000b01c34ba0$97cab280$82b3200a@intra>
+19/07/05 12:40:21 << X-Priority: 3
+19/07/05 12:40:21 << X-MSMail-Priority: Normal
+19/07/05 12:40:21 << 
+19/07/05 12:40:21 << )
+19/07/05 12:40:21 << 21 OK FETCH completed.
+19/07/05 12:40:21 >> 22 IDLE
+19/07/05 12:40:21 << + IDLE accepted, awaiting DONE command.
+19/07/05 12:40:21 >> DONE
+19/07/05 12:40:21 << 22 OK IDLE completed.
+19/07/05 12:40:21 >> 23 LOGOUT
+19/07/05 12:40:22 << * BYE Microsoft Exchange 2000 IMAP4rev1 server version 6.0.6249.0 signing off.
+19/07/05 12:40:22 << 23 OK LOGOUT completed.
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0001.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,101 @@
+Subject: Test: MHTML 1 image
+Date: Wed, 26 Apr 2000 11:43:25 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPOEFECBAA.simon.middleton@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: multipart/related;
+	boundary="----=_NextPart_000_0051_01BFB923.AACFEB10"
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: Normal
+X-OlkEid: F3248B20CF16883BCB24D411858F0090279B54F3
+Status: RO
+X-Status: 
+X-Keywords:
+
+This is a multi-part message in MIME format.
+
+------=_NextPart_000_0051_01BFB923.AACFEB10
+Content-Type: multipart/alternative;
+	boundary="----=_NextPart_001_0052_01BFB923.AACFEB10"
+
+
+------=_NextPart_001_0052_01BFB923.AACFEB10
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+
+
+
+
+--
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 716413 - fax +44 1223 716401 - web http://www.ant.co.uk
+
+
+
+------=_NextPart_001_0052_01BFB923.AACFEB10
+Content-Type: text/html;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: quoted-printable
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HTML><HEAD><TITLE></TITLE>
+<META content=3D"text/html; charset=3Diso-8859-1" =
+http-equiv=3DContent-Type>
+<META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR></HEAD>
+<BODY><IMG align=3Dbaseline alt=3D"" border=3D0 hspace=3D0=20
+src=3D"cid:036254310@26042000-0934"><BR><BR>
+<P><FONT size=3D2>--<BR>Simon Middleton, Senior Software Engineer, ANT=20
+Ltd.<BR>phone +44 1223 716413 - fax +44 1223 716401 - web <A=20
+href=3D"http://www.ant.co.uk"=20
+target=3D_blank>http://www.ant.co.uk</A><BR></FONT></P></BODY></HTML>
+
+------=_NextPart_001_0052_01BFB923.AACFEB10--
+
+------=_NextPart_000_0051_01BFB923.AACFEB10
+Content-Type: image/gif;
+	name="antlogo_right.gif"
+Content-Transfer-Encoding: base64
+Content-ID: <036254310@26042000-0934>
+
+R0lGODlhVgBWAPf/AP////7+/v79/f38/P37+/z6+/z5+vv39/ry8/nx8vnw8vj4+Pj09Pfz8/fy
+8vXv8PLq6/Lp6u3i4+zg4erd3+rc3unp6enb3enX2ePj4+Hh4eG5vuDg4N/Hyt7e3t7Kzd3d3d3H
+yt3Gyd3FyN2ts9zc3NzGydvb29vEyNrCxtrCxdnZ2dnAxNi+wtfX19e+wdbW1ta8wNayttTU1NPT
+09LS0tDQ0M+rsM7Ozs2tssrKysmnrMelqcaVm8SfpcOeo8KRmMKGjcCZnr+Xnb6SmL2Tmb17hLyS
+l7yRl7m5ubl8hbi4uLh7hLeHjbZ4gLWGjbS0tLSFi7N3gLJsda9ye66urq1xeaysrKtibKp3fqdw
+eKZfaKVaZKRLV6JYYaBYYp9FUZxPWZxOWJtcZZtbZJlZY5lYYpdUXpdIU5dFUJZUXZVTXJVHUZNQ
+WZJJUo5IUY5HUo46RY44RI2NjYxCTYtCTItBTIoiL4k9SYY6RYU4Q4UtOIM1QYM0QIIyPoGBgYAw
+PIAsOH4sOX4rOHsnM3omMnclMHchLncfLHYfLHUeK3UdKnUaJ3R0dHQXJHNzc3MaKHMZJ3IVIXAV
+Im5ubm4TIG4THm4SH21tbWxsbGwPHWwOHGtra2sNG2oNGWhoaGgMGWZmZmVlZWRkZAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAVgBWAAAI/wBJCRxI
+sKDBgwgTKlzIsKHDhxAjShwIoKLFixgzatzIsaPHjxcJghxJsqRJjSJPqlzJ0mLKljBjenwps6ZN
+ADRv6gRpwUPGnDuDaswQKsNPikKTZnQRqpFPjECVBmXa1ChUpFKTuqAUqunTkFiz7qTa1elRgWKD
+eujKtpFVsGjT3sTBtu1bl2Hlwtxat+xXvHH1wlzb1+9ZUoIHF277t2LUxCSrLC5713FeyCWhTPZ6
+WOWDFylCix5NurTp06JfQKioebLZq4FLvtBEu7bt27hz6769g/Xm13ARn2yxu7hx4zd8u66M8zJI
+4sejS9eUHEDrxcABCzeZYrr34tWvF//Objk2Sejf09sO/7txc/Mj0atXz3555+Hz89fH7v6xx+75
+0accf/eZJB9tliDiSG6OIIIIIw4y6CCEFEZI3YDj9efcRwfi4UMKMtCB2xAdpABaCkcIchuJJrYI
+Wgci7jcec/51JN8Zq1XUwBS3pZARBSLW9gFHXFxoXXsFlgQgbQdkFIdtPlpUXQdQEmmkeH2R9952
+JclX0QaakFDREbZRgUFFmlTSApq1+UiFJhXFcUdFRcqYpYbwPWdbRU5oYgiftx0BAASaHNIBAAfY
+diiZFaEBRkVhXPkbjRt65CUARmjCR0VN2GaJEIgWeigAtvnkA5wApNFFRVhI6hqeXJL/tCSqTliy
+KQCd2gZqooiMatsheyCCahiOCLIHI64SCFus8e2JqaacerqrqKHmBultdtalZY0cXdrnrbkiCCqh
+hlaLW0VgYIthlpTmyaGzRtgabW2fhlouqdYCEOl662oLq0qzAgrubdP2yua5+qp75KtJngcvtLhK
+a++hiea7b23ZMtZws7VV1MMZWswr7qDUVoxwuvwujF27zOrZcUbhalJvovfqdm3KWPq7MUgBZ5Sp
+rqEajC/CF9OWsWHLqnTpGZr4URGP9E5brsm33Yxxvxonjd/LTN9aZNQkT20zAChfrfKMO7/LNcRj
+SEyzrxYrnHPWwQHsLNNOp0pw0HAT/y03klobeDfEQY78trlVJ4wz4HVvrUkcFXUduW148BD2qH7g
+hkdFUiBr9tyUpW3pywBIfrAmFFR0OAAeIFxR258zrp3dtFnUdh4W2ZY6moRIUBEFrgMAu9FYI924
+4LTtYYkltVVSCfP0Og99ms/jZonzlfzNcOBdBijg2eyKbqP36R3NGfeykv+d+dtWOr7607H/r+Pw
+H8c+y0rXL5384nM0q/674R/6RjIbABrHcuDT2QBHAoEGOPCBEIygBCdIQQhaBHRV6R9mOILB9rlr
+gx5JguzK0zKOZKAKUEihClfIwha68IUwTMIcRrglkpBlMzjMoQ536BYNVuSGOwyiEJl5OD+P0GWI
+SEzi9o7HEQ9wRYlQhKIHS2gRwkTxikjs4QKriMUuDnGKHAGiF8e4xNlphC9kTGMZSagRK6rxjdrC
+H0Ys0BRKNOKOeMyjHvfIxz768Y9+/IMcL+KCDHjAkB5IpCIXychGOvKRkIzkI5lTQxBKhVuWjAkm
+M9mSTXJyJZ785ElCKcqSTOSUqEylKlfJyla68pWsDAgAOw==
+
+------=_NextPart_000_0051_01BFB923.AACFEB10--
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0002.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,51 @@
+Subject: Test: MHTML no images
+Date: Tue, 11 Apr 2000 19:45:09 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPIEDFCBAA.sjm@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: multipart/alternative;
+	boundary="----=_NextPart_000_0059_01BFB923.AAE3E840"
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: Normal
+X-OlkEid: F3448B20D116883BCB24D411858F0090279B54F3
+Status: RO
+X-Status: 
+X-Keywords:
+
+This is a multi-part message in MIME format.
+
+------=_NextPart_000_0059_01BFB923.AAE3E840
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+
+Simple MIME HTML with no images
+
+
+--
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 716413 - fax +44 1223 716401 - web http://www.ant.co.uk
+
+
+
+------=_NextPart_000_0059_01BFB923.AAE3E840
+Content-Type: text/html;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: quoted-printable
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HTML><HEAD><TITLE></TITLE>
+<META content=3D"text/html; charset=3Diso-8859-1" =
+http-equiv=3DContent-Type>
+<META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR></HEAD>
+<BODY><FONT face=3DArial size=3D2>Simple MIME HTML with no =
+images<BR><BR></FONT>
+<P><FONT size=3D2>--<BR>Simon Middleton, Senior Software Engineer, ANT=20
+Ltd.<BR>phone +44 1223 716413 - fax +44 1223 716401 - web <A=20
+href=3D"http://www.ant.co.uk"=20
+target=3D_blank>http://www.ant.co.uk</A><BR></FONT></P></BODY></HTML>
+
+------=_NextPart_000_0059_01BFB923.AAE3E840--
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0003.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,24 @@
+Subject: Test: MoveFromLocalAndDelete
+Date: Thu, 3 Feb 2000 18:10:21 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPGEKMCAAA.sjm@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: Normal
+X-OlkEid: F3848B20D516883BCB24D411858F0090279B54F3
+Status: RO
+X-Status: 
+X-Keywords:
+
+
+
+-- 
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 567813 - fax +44 1223 567801 - web http://www.ant.co.uk
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0004.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,24 @@
+Subject: Test: MoveToLocalAndDelete
+Date: Thu, 3 Feb 2000 18:10:06 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPAEKMCAAA.sjm@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: Normal
+X-OlkEid: F3A48B20D716883BCB24D411858F0090279B54F3
+Status: RO
+X-Status: 
+X-Keywords:
+
+
+
+-- 
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 567813 - fax +44 1223 567801 - web http://www.ant.co.uk
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0005.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,24 @@
+Subject: Test: CopyWithinServiceAndDelete
+Date: Thu, 3 Feb 2000 18:09:46 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPMEKLCAAA.sjm@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: Normal
+X-OlkEid: F3C48B20D916883BCB24D411858F0090279B54F3
+Status: RO
+X-Status: 
+X-Keywords:
+
+
+
+-- 
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 567813 - fax +44 1223 567801 - web http://www.ant.co.uk
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0006.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,24 @@
+Subject: Test: CopyFromLocalAndDelete
+Date: Thu, 3 Feb 2000 18:09:28 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPIEKLCAAA.sjm@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: Normal
+X-OlkEid: F3E48B20DB16883BCB24D411858F0090279B54F3
+Status: RO
+X-Status: 
+X-Keywords:
+
+
+
+-- 
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 567813 - fax +44 1223 567801 - web http://www.ant.co.uk
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0007.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,24 @@
+Subject: Test: CopyToLocalAndDelete
+Date: Thu, 3 Feb 2000 18:09:13 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPEEKLCAAA.sjm@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: Normal
+X-OlkEid: F3048C20DD16883BCB24D411858F0090279B54F3
+Status: RO
+X-Status: 
+X-Keywords:
+
+
+
+-- 
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 567813 - fax +44 1223 567801 - web http://www.ant.co.uk
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0008.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,24 @@
+Subject: Test: CopyWithinFolder
+Date: Thu, 3 Feb 2000 13:35:57 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPAEKLCAAA.sjm@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: Normal
+X-OlkEid: F3248C20DF16883BCB24D411858F0090279B54F3
+Status: RO
+X-Status: 
+X-Keywords:
+
+
+
+-- 
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 567813 - fax +44 1223 567801 - web http://www.ant.co.uk
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0009.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,142 @@
+Subject: Test: Attachment
+Date: Wed, 17 Nov 1999 12:46:16 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPMEDMCAAA.imaptest@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: multipart/mixed;
+	boundary="----=_NextPart_000_0063_01BFB923.AB395B40"
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: Normal
+X-OlkEid: F3448C20E216883BCB24D411858F0090279B54F3
+Status: RO
+X-Status: 
+X-Keywords:
+
+This is a multi-part message in MIME format.
+
+------=_NextPart_000_0063_01BFB923.AB395B40
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+
+This message contains another message with two attachments, plus a text and
+a vcf attachment of its own.
+
+--
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 567813 - fax +44 1223 567801 - web http://www.ant.co.uk
+
+------=_NextPart_000_0063_01BFB923.AB395B40
+Content-Type: message/rfc822
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment
+
+From: "Simon Middleton" <sjm@ant.co.uk>
+To: "imaptest" <imaptest@ant.co.uk>
+Subject: Test: Attachment
+Date: Mon, 18 Oct 1999 17:41:30 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPOEBICAAA.sjm@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: multipart/mixed;
+	boundary="----=_NextPart_000_0060_01BFB923.AB395B40"
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: Normal
+
+This is a multi-part message in MIME format.
+
+------=_NextPart_000_0060_01BFB923.AB395B40
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+
+
+Test text plus two images
+
+-- 
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 567813 - fax +44 1223 567801 - web http://www.ant.co.uk
+
+------=_NextPart_000_0060_01BFB923.AB395B40
+Content-Type: image/gif;
+	name="email-button-no.gif"
+Content-Transfer-Encoding: base64
+Content-Disposition: attachment;
+	filename="email-button-no.gif"
+
+R0lGODdhggAiALMAAAEBAcWaZK1aAF5XSt7OsMy8oLyDQTEtJ86tgdnJq4R6aOTTtKeahLJrHdTE
+p8CxlywAAAAAggAiAAAE/3DJSSu5OOvNu/9gKHpVaZ7SlRBJ67rs2sZvbd94rtdxP9sEB22lSiyM
+qGSKUAgYGg2BdEqtWq/YrHbL7UqhDQMCqUS1AlEq1MBuu9/wuHxOr9vv8HHZlECkBQ0BCA4FhA6H
+iImKi4wJhYyNBY6OkJOQl5iHPAR7FCwGXwEPBY+ZppcJp5qrqZWSqqeTMJydRwlpBqSGhaWwmJO9
+qJLDlIvDvqovLLULn4C8vIaJPzDU1jUOLdnbq9mtitipNt44RdVEORjMEqC5hNGaF+tJ5qS6L4g7
+MjIZ8/5KfQS4O5aN1r8yBBgcWMhAEhGFBwawANHsoEUzCZ6UcmjwIr0CAP9CDhDHAiQABbNmaPDI
+0oIDAYO+rWiphElIka0chUSpjcGAAwAiMlDRkeZBAk60HSpq1AKBBzdF6oJ68lCBAVFvjiTStFOB
+EhcCBAjijWnXCQmoYt35oO1OUmsHjPK5s6DZsxQQgCVgoAbeEyyoKmBwU4Hbk4cH2CMF9EDZvyY4
+BYgcgN/dv2nZKihMGHHnhos3A3iQSh7kChkrdkQw8TLewGwZdAaw1rBo0KMefF562gKCsfIMOuiN
+AvZJBm1FF9bNNvcDrAcexCPejC9w09TpZUbclrnWto2RJw95gFSL7AHtus7ebLvh7gWUD/Ye9Cf5
+UdN7pwpjmb32zooVMAr/YyJ1R1dUckWzXktMPDHGDP5pp5ts79gjm2xt2aPbfLrkB1kq7dCwYHYx
+gEPJYva8U+EuXP1VEhjEYBdhZNook4ouxxBklTgzdYWBIwF8sY0L6wS3kpFHclBdBuW4wM00hACj
+0gZLGlklCCs0gcsxLTKjAToTgckPEUSNScOQ5LTyilLQmMdRma0RFSeZY8rw2x+B7GjXHgjg4eef
+gAYKKBRVBDLMI+d1wkKfhHrh6KOQRtrFGqLgmA8Zig6BzKacduqLlDlKI0SRPyr1jaeopopqNLyQ
+NKJT+Kgq66y+PBJMl16Weio3MnWTk6/APtlrsPkQ+2ux3SDL6yJkWsSkGK76RCvttNRW+4M6LHEy
+wrbcduvtt8xEAAA7
+
+------=_NextPart_000_0060_01BFB923.AB395B40
+Content-Type: image/gif;
+	name="email-button-yes.gif"
+Content-Transfer-Encoding: base64
+Content-Disposition: attachment;
+	filename="email-button-yes.gif"
+
+R0lGODdhggAiALMAAAQEA8WaZK1aAN7OsGVdUMu8oCsoIryDQcKwktrJrI2Cb0xGPKWZguTTtNPE
+p7JrHSwAAAAAggAiAAAE/7DJSascOOvNu/9fAo6YSHLNYK2slYjv8M50bd94rsd7X8s3VUrYKqYa
+hcDh8RA4n9CodEqtWq/Y7PNxOARERmMi0IQyu+i0es1uu9/wuJyNAIct5GcX4SgkCg5/fw6EgYaC
+fn6GhYGJCYuMjIiPj5GWl5SHjpuVL4owdxUvB05cgH2EjoSdiYWVjYKWnrGXkqq0kLKcua5+gj9E
+YSoJpAIHgMjIqLWrrbDOtszSjdOM0Ii6g640oRcOTQ8F4n3Iv4E+OLmKvK7nh+6vq/Do6MGhYwLh
+heV+Gd0UQkq8kMfu3A4gMxDGUMHwn0MWAxAYS7XMzsMWERcY2AjohYKNBv8UOECokMTFk0ZkLFG2
+yh7KChgKAJiJ4JSCmQtuGCyQwYQMDS+DUngkgA8koUVk3ASwQByDmQYIMQBJdaPIBAwIGABgYIEC
+oEi7uRygZOCqsBgfLZipoMBWAAxOzZxLV0GCpXTZ+kNrxIEFDAECDDjEF6Knt2sBECAnU7G4UwgY
+ONhK4E8BBhr7uSxMAcGRCgdqcGbx6DJdA4/FUS6AIHKymQTitr58bvNosisGHGgAwzZnGeIIABge
+lzXr4Vw3AqgpLjFyA7F9YRi9YnfDCQh++v5tGcHwBbPFIXiLfPnj8eWRxw1EHWCDwP6I+G0v5jhT
+44+HE2gdmfl5BgoQkFj/U4FsF5ZuAQxhIH0A/eEdU8xZRhkD/IlXgAIK8NfaWgRaRF0CEhU4HYOh
+DPZgU+MAMlxXC7TYIgFucbWAgG+1dQ59L3Cx0IIkXnDXio8R8mB63xWgFZE2FtjeI6TUEUOPJYLI
+wJTiVBLZlABiCWAqkWFY3Cke8qWSMTSMCGVSg0USwz6pnWJNm2De1gAC4Lhi5plFzGAQDGaxxE6Q
+tfEo1mBL5LNNAg4xpOgIRzCqwUCU8GlNH/E0k0lLGwyhaUMg6FmoMW6OJOgE2p1Q6gl6HtonnKgk
+A+iOpnLAJwJ5lBKAmojegUAaSszh66/ABgsHE1E8EICfI4k1xhJlaOHsbLPQRovFGQHw4acJ//Rk
+VicEtaPmIpXK8wq3soDbrbkFYcKMMqEmm61Al6r7rTTh0lvNufLiK80p/GL6kLbk3ivwwAQXbLCd
+owKk7cEMN+ywwT699Ci89FRs8cUY/xAxUovG6vHHIIfMaDcRAAA7
+
+------=_NextPart_000_0060_01BFB923.AB395B40--
+
+------=_NextPart_000_0063_01BFB923.AB395B40
+Content-Type: text/x-vcard;
+	name="Borris.vcf"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment;
+	filename="Borris.vcf"
+
+BEGIN:VCARD
+VERSION:2.1
+N:;Borris
+FN:Borris
+NICKNAME:borris
+EMAIL;PREF;INTERNET:borris@ant.co.uk
+REV:19991109T134421Z
+END:VCARD
+
+------=_NextPart_000_0063_01BFB923.AB395B40
+Content-Type: text/plain;
+	name="New Text Document.txt"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment;
+	filename="New Text Document.txt"
+
+A piece of text
+
+------=_NextPart_000_0063_01BFB923.AB395B40--
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0010.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,142 @@
+Subject: Test: Attachment no text
+Date: Wed, 17 Nov 1999 12:45:49 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPEEDMCAAA.imaptest@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: multipart/mixed;
+	boundary="----=_NextPart_000_006D_01BFB923.AB40FC60"
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: Normal
+X-OlkEid: F3848C20E516883BCB24D411858F0090279B54F3
+Status: RO
+X-Status: 
+X-Keywords:
+
+This is a multi-part message in MIME format.
+
+------=_NextPart_000_006D_01BFB923.AB40FC60
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+
+This message contains another message with two attachments, plus a text and
+a vcf attachment of its own.
+
+--
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 567813 - fax +44 1223 567801 - web http://www.ant.co.uk
+
+------=_NextPart_000_006D_01BFB923.AB40FC60
+Content-Type: message/rfc822
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment
+
+From: "Simon Middleton" <sjm@ant.co.uk>
+To: "imaptest" <imaptest@ant.co.uk>
+Subject: Test: Attachment
+Date: Mon, 18 Oct 1999 17:41:30 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPOEBICAAA.sjm@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: multipart/mixed;
+	boundary="----=_NextPart_000_006A_01BFB923.AB40FC60"
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: Normal
+
+This is a multi-part message in MIME format.
+
+------=_NextPart_000_006A_01BFB923.AB40FC60
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+
+
+Test text plus two images
+
+-- 
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 567813 - fax +44 1223 567801 - web http://www.ant.co.uk
+
+------=_NextPart_000_006A_01BFB923.AB40FC60
+Content-Type: image/gif;
+	name="email-button-no.gif"
+Content-Transfer-Encoding: base64
+Content-Disposition: attachment;
+	filename="email-button-no.gif"
+
+R0lGODdhggAiALMAAAEBAcWaZK1aAF5XSt7OsMy8oLyDQTEtJ86tgdnJq4R6aOTTtKeahLJrHdTE
+p8CxlywAAAAAggAiAAAE/3DJSSu5OOvNu/9gKHpVaZ7SlRBJ67rs2sZvbd94rtdxP9sEB22lSiyM
+qGSKUAgYGg2BdEqtWq/YrHbL7UqhDQMCqUS1AlEq1MBuu9/wuHxOr9vv8HHZlECkBQ0BCA4FhA6H
+iImKi4wJhYyNBY6OkJOQl5iHPAR7FCwGXwEPBY+ZppcJp5qrqZWSqqeTMJydRwlpBqSGhaWwmJO9
+qJLDlIvDvqovLLULn4C8vIaJPzDU1jUOLdnbq9mtitipNt44RdVEORjMEqC5hNGaF+tJ5qS6L4g7
+MjIZ8/5KfQS4O5aN1r8yBBgcWMhAEhGFBwawANHsoEUzCZ6UcmjwIr0CAP9CDhDHAiQABbNmaPDI
+0oIDAYO+rWiphElIka0chUSpjcGAAwAiMlDRkeZBAk60HSpq1AKBBzdF6oJ68lCBAVFvjiTStFOB
+EhcCBAjijWnXCQmoYt35oO1OUmsHjPK5s6DZsxQQgCVgoAbeEyyoKmBwU4Hbk4cH2CMF9EDZvyY4
+BYgcgN/dv2nZKihMGHHnhos3A3iQSh7kChkrdkQw8TLewGwZdAaw1rBo0KMefF562gKCsfIMOuiN
+AvZJBm1FF9bNNvcDrAcexCPejC9w09TpZUbclrnWto2RJw95gFSL7AHtus7ebLvh7gWUD/Ye9Cf5
+UdN7pwpjmb32zooVMAr/YyJ1R1dUckWzXktMPDHGDP5pp5ts79gjm2xt2aPbfLrkB1kq7dCwYHYx
+gEPJYva8U+EuXP1VEhjEYBdhZNook4ouxxBklTgzdYWBIwF8sY0L6wS3kpFHclBdBuW4wM00hACj
+0gZLGlklCCs0gcsxLTKjAToTgckPEUSNScOQ5LTyilLQmMdRma0RFSeZY8rw2x+B7GjXHgjg4eef
+gAYKKBRVBDLMI+d1wkKfhHrh6KOQRtrFGqLgmA8Zig6BzKacduqLlDlKI0SRPyr1jaeopopqNLyQ
+NKJT+Kgq66y+PBJMl16Weio3MnWTk6/APtlrsPkQ+2ux3SDL6yJkWsSkGK76RCvttNRW+4M6LHEy
+wrbcduvtt8xEAAA7
+
+------=_NextPart_000_006A_01BFB923.AB40FC60
+Content-Type: image/gif;
+	name="email-button-yes.gif"
+Content-Transfer-Encoding: base64
+Content-Disposition: attachment;
+	filename="email-button-yes.gif"
+
+R0lGODdhggAiALMAAAQEA8WaZK1aAN7OsGVdUMu8oCsoIryDQcKwktrJrI2Cb0xGPKWZguTTtNPE
+p7JrHSwAAAAAggAiAAAE/7DJSascOOvNu/9fAo6YSHLNYK2slYjv8M50bd94rsd7X8s3VUrYKqYa
+hcDh8RA4n9CodEqtWq/Y7PNxOARERmMi0IQyu+i0es1uu9/wuJyNAIct5GcX4SgkCg5/fw6EgYaC
+fn6GhYGJCYuMjIiPj5GWl5SHjpuVL4owdxUvB05cgH2EjoSdiYWVjYKWnrGXkqq0kLKcua5+gj9E
+YSoJpAIHgMjIqLWrrbDOtszSjdOM0Ii6g640oRcOTQ8F4n3Iv4E+OLmKvK7nh+6vq/Do6MGhYwLh
+heV+Gd0UQkq8kMfu3A4gMxDGUMHwn0MWAxAYS7XMzsMWERcY2AjohYKNBv8UOECokMTFk0ZkLFG2
+yh7KChgKAJiJ4JSCmQtuGCyQwYQMDS+DUngkgA8koUVk3ASwQByDmQYIMQBJdaPIBAwIGABgYIEC
+oEi7uRygZOCqsBgfLZipoMBWAAxOzZxLV0GCpXTZ+kNrxIEFDAECDDjEF6Knt2sBECAnU7G4UwgY
+ONhK4E8BBhr7uSxMAcGRCgdqcGbx6DJdA4/FUS6AIHKymQTitr58bvNosisGHGgAwzZnGeIIABge
+lzXr4Vw3AqgpLjFyA7F9YRi9YnfDCQh++v5tGcHwBbPFIXiLfPnj8eWRxw1EHWCDwP6I+G0v5jhT
+44+HE2gdmfl5BgoQkFj/U4FsF5ZuAQxhIH0A/eEdU8xZRhkD/IlXgAIK8NfaWgRaRF0CEhU4HYOh
+DPZgU+MAMlxXC7TYIgFucbWAgG+1dQ59L3Cx0IIkXnDXio8R8mB63xWgFZE2FtjeI6TUEUOPJYLI
+wJTiVBLZlABiCWAqkWFY3Cke8qWSMTSMCGVSg0USwz6pnWJNm2De1gAC4Lhi5plFzGAQDGaxxE6Q
+tfEo1mBL5LNNAg4xpOgIRzCqwUCU8GlNH/E0k0lLGwyhaUMg6FmoMW6OJOgE2p1Q6gl6HtonnKgk
+A+iOpnLAJwJ5lBKAmojegUAaSszh66/ABgsHE1E8EICfI4k1xhJlaOHsbLPQRovFGQHw4acJ//Rk
+VicEtaPmIpXK8wq3soDbrbkFYcKMMqEmm61Al6r7rTTh0lvNufLiK80p/GL6kLbk3ivwwAQXbLCd
+owKk7cEMN+ywwT699Ci89FRs8cUY/xAxUovG6vHHIIfMaDcRAAA7
+
+------=_NextPart_000_006A_01BFB923.AB40FC60--
+
+------=_NextPart_000_006D_01BFB923.AB40FC60
+Content-Type: text/x-vcard;
+	name="Borris.vcf"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment;
+	filename="Borris.vcf"
+
+BEGIN:VCARD
+VERSION:2.1
+N:;Borris
+FN:Borris
+NICKNAME:borris
+EMAIL;PREF;INTERNET:borris@ant.co.uk
+REV:19991109T134421Z
+END:VCARD
+
+------=_NextPart_000_006D_01BFB923.AB40FC60
+Content-Type: text/plain;
+	name="New Text Document.txt"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment;
+	filename="New Text Document.txt"
+
+A piece of text
+
+------=_NextPart_000_006D_01BFB923.AB40FC60--
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0011.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,142 @@
+Subject: Test: Attachment text
+Date: Wed, 17 Nov 1999 12:45:14 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPMEDLCAAA.imaptest@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: multipart/mixed;
+	boundary="----=_NextPart_000_0077_01BFB923.AB489D80"
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: Normal
+X-OlkEid: F3C48C20E816883BCB24D411858F0090279B54F3
+Status: RO
+X-Status: 
+X-Keywords:
+
+This is a multi-part message in MIME format.
+
+------=_NextPart_000_0077_01BFB923.AB489D80
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+
+This message contains another message with two attachments, plus a text and
+a vcf attachment of its own.
+
+--
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 567813 - fax +44 1223 567801 - web http://www.ant.co.uk
+
+------=_NextPart_000_0077_01BFB923.AB489D80
+Content-Type: message/rfc822
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment
+
+From: "Simon Middleton" <sjm@ant.co.uk>
+To: "imaptest" <imaptest@ant.co.uk>
+Subject: Test: Attachment
+Date: Mon, 18 Oct 1999 17:41:30 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPOEBICAAA.sjm@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: multipart/mixed;
+	boundary="----=_NextPart_000_0074_01BFB923.AB489D80"
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: Normal
+
+This is a multi-part message in MIME format.
+
+------=_NextPart_000_0074_01BFB923.AB489D80
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+
+
+Test text plus two images
+
+-- 
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 567813 - fax +44 1223 567801 - web http://www.ant.co.uk
+
+------=_NextPart_000_0074_01BFB923.AB489D80
+Content-Type: image/gif;
+	name="email-button-no.gif"
+Content-Transfer-Encoding: base64
+Content-Disposition: attachment;
+	filename="email-button-no.gif"
+
+R0lGODdhggAiALMAAAEBAcWaZK1aAF5XSt7OsMy8oLyDQTEtJ86tgdnJq4R6aOTTtKeahLJrHdTE
+p8CxlywAAAAAggAiAAAE/3DJSSu5OOvNu/9gKHpVaZ7SlRBJ67rs2sZvbd94rtdxP9sEB22lSiyM
+qGSKUAgYGg2BdEqtWq/YrHbL7UqhDQMCqUS1AlEq1MBuu9/wuHxOr9vv8HHZlECkBQ0BCA4FhA6H
+iImKi4wJhYyNBY6OkJOQl5iHPAR7FCwGXwEPBY+ZppcJp5qrqZWSqqeTMJydRwlpBqSGhaWwmJO9
+qJLDlIvDvqovLLULn4C8vIaJPzDU1jUOLdnbq9mtitipNt44RdVEORjMEqC5hNGaF+tJ5qS6L4g7
+MjIZ8/5KfQS4O5aN1r8yBBgcWMhAEhGFBwawANHsoEUzCZ6UcmjwIr0CAP9CDhDHAiQABbNmaPDI
+0oIDAYO+rWiphElIka0chUSpjcGAAwAiMlDRkeZBAk60HSpq1AKBBzdF6oJ68lCBAVFvjiTStFOB
+EhcCBAjijWnXCQmoYt35oO1OUmsHjPK5s6DZsxQQgCVgoAbeEyyoKmBwU4Hbk4cH2CMF9EDZvyY4
+BYgcgN/dv2nZKihMGHHnhos3A3iQSh7kChkrdkQw8TLewGwZdAaw1rBo0KMefF562gKCsfIMOuiN
+AvZJBm1FF9bNNvcDrAcexCPejC9w09TpZUbclrnWto2RJw95gFSL7AHtus7ebLvh7gWUD/Ye9Cf5
+UdN7pwpjmb32zooVMAr/YyJ1R1dUckWzXktMPDHGDP5pp5ts79gjm2xt2aPbfLrkB1kq7dCwYHYx
+gEPJYva8U+EuXP1VEhjEYBdhZNook4ouxxBklTgzdYWBIwF8sY0L6wS3kpFHclBdBuW4wM00hACj
+0gZLGlklCCs0gcsxLTKjAToTgckPEUSNScOQ5LTyilLQmMdRma0RFSeZY8rw2x+B7GjXHgjg4eef
+gAYKKBRVBDLMI+d1wkKfhHrh6KOQRtrFGqLgmA8Zig6BzKacduqLlDlKI0SRPyr1jaeopopqNLyQ
+NKJT+Kgq66y+PBJMl16Weio3MnWTk6/APtlrsPkQ+2ux3SDL6yJkWsSkGK76RCvttNRW+4M6LHEy
+wrbcduvtt8xEAAA7
+
+------=_NextPart_000_0074_01BFB923.AB489D80
+Content-Type: image/gif;
+	name="email-button-yes.gif"
+Content-Transfer-Encoding: base64
+Content-Disposition: attachment;
+	filename="email-button-yes.gif"
+
+R0lGODdhggAiALMAAAQEA8WaZK1aAN7OsGVdUMu8oCsoIryDQcKwktrJrI2Cb0xGPKWZguTTtNPE
+p7JrHSwAAAAAggAiAAAE/7DJSascOOvNu/9fAo6YSHLNYK2slYjv8M50bd94rsd7X8s3VUrYKqYa
+hcDh8RA4n9CodEqtWq/Y7PNxOARERmMi0IQyu+i0es1uu9/wuJyNAIct5GcX4SgkCg5/fw6EgYaC
+fn6GhYGJCYuMjIiPj5GWl5SHjpuVL4owdxUvB05cgH2EjoSdiYWVjYKWnrGXkqq0kLKcua5+gj9E
+YSoJpAIHgMjIqLWrrbDOtszSjdOM0Ii6g640oRcOTQ8F4n3Iv4E+OLmKvK7nh+6vq/Do6MGhYwLh
+heV+Gd0UQkq8kMfu3A4gMxDGUMHwn0MWAxAYS7XMzsMWERcY2AjohYKNBv8UOECokMTFk0ZkLFG2
+yh7KChgKAJiJ4JSCmQtuGCyQwYQMDS+DUngkgA8koUVk3ASwQByDmQYIMQBJdaPIBAwIGABgYIEC
+oEi7uRygZOCqsBgfLZipoMBWAAxOzZxLV0GCpXTZ+kNrxIEFDAECDDjEF6Knt2sBECAnU7G4UwgY
+ONhK4E8BBhr7uSxMAcGRCgdqcGbx6DJdA4/FUS6AIHKymQTitr58bvNosisGHGgAwzZnGeIIABge
+lzXr4Vw3AqgpLjFyA7F9YRi9YnfDCQh++v5tGcHwBbPFIXiLfPnj8eWRxw1EHWCDwP6I+G0v5jhT
+44+HE2gdmfl5BgoQkFj/U4FsF5ZuAQxhIH0A/eEdU8xZRhkD/IlXgAIK8NfaWgRaRF0CEhU4HYOh
+DPZgU+MAMlxXC7TYIgFucbWAgG+1dQ59L3Cx0IIkXnDXio8R8mB63xWgFZE2FtjeI6TUEUOPJYLI
+wJTiVBLZlABiCWAqkWFY3Cke8qWSMTSMCGVSg0USwz6pnWJNm2De1gAC4Lhi5plFzGAQDGaxxE6Q
+tfEo1mBL5LNNAg4xpOgIRzCqwUCU8GlNH/E0k0lLGwyhaUMg6FmoMW6OJOgE2p1Q6gl6HtonnKgk
+A+iOpnLAJwJ5lBKAmojegUAaSszh66/ABgsHE1E8EICfI4k1xhJlaOHsbLPQRovFGQHw4acJ//Rk
+VicEtaPmIpXK8wq3soDbrbkFYcKMMqEmm61Al6r7rTTh0lvNufLiK80p/GL6kLbk3ivwwAQXbLCd
+owKk7cEMN+ywwT699Ci89FRs8cUY/xAxUovG6vHHIIfMaDcRAAA7
+
+------=_NextPart_000_0074_01BFB923.AB489D80--
+
+------=_NextPart_000_0077_01BFB923.AB489D80
+Content-Type: text/x-vcard;
+	name="Borris.vcf"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment;
+	filename="Borris.vcf"
+
+BEGIN:VCARD
+VERSION:2.1
+N:;Borris
+FN:Borris
+NICKNAME:borris
+EMAIL;PREF;INTERNET:borris@ant.co.uk
+REV:19991109T134421Z
+END:VCARD
+
+------=_NextPart_000_0077_01BFB923.AB489D80
+Content-Type: text/plain;
+	name="New Text Document.txt"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment;
+	filename="New Text Document.txt"
+
+A piece of text
+
+------=_NextPart_000_0077_01BFB923.AB489D80--
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0012.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,168 @@
+Subject: Test: Attachment all
+Date: Wed, 17 Nov 1999 12:44:54 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPEEDLCAAA.imaptest@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: multipart/mixed;
+	boundary="----=_NextPart_000_0081_01BFB923.AB5065B0"
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: Normal
+X-OlkEid: F3048D20EB16883BCB24D411858F0090279B54F3
+Status: RO
+X-Status: 
+X-Keywords:
+
+This is a multi-part message in MIME format.
+
+------=_NextPart_000_0081_01BFB923.AB5065B0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+
+This message contains another message with two attachments, plus a text and
+a vcf attachment of its own.
+
+--
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 567813 - fax +44 1223 567801 - web http://www.ant.co.uk
+
+------=_NextPart_000_0081_01BFB923.AB5065B0
+Content-Type: message/rfc822
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment
+
+From: "Simon Middleton" <sjm@ant.co.uk>
+To: "imaptest" <imaptest@ant.co.uk>
+Subject: Test: Attachment
+Date: Mon, 18 Oct 1999 17:41:30 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPOEBICAAA.sjm@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: multipart/mixed;
+	boundary="----=_NextPart_000_007E_01BFB923.AB4EDF10"
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: Normal
+
+This is a multi-part message in MIME format.
+
+------=_NextPart_000_007E_01BFB923.AB4EDF10
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+
+
+Test text plus two images
+
+-- 
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 567813 - fax +44 1223 567801 - web http://www.ant.co.uk
+
+------=_NextPart_000_007E_01BFB923.AB4EDF10
+Content-Type: image/gif;
+	name="email-button-no.gif"
+Content-Transfer-Encoding: base64
+Content-Disposition: attachment;
+	filename="email-button-no.gif"
+
+R0lGODdhggAiALMAAAEBAcWaZK1aAF5XSt7OsMy8oLyDQTEtJ86tgdnJq4R6aOTTtKeahLJrHdTE
+p8CxlywAAAAAggAiAAAE/3DJSSu5OOvNu/9gKHpVaZ7SlRBJ67rs2sZvbd94rtdxP9sEB22lSiyM
+qGSKUAgYGg2BdEqtWq/YrHbL7UqhDQMCqUS1AlEq1MBuu9/wuHxOr9vv8HHZlECkBQ0BCA4FhA6H
+iImKi4wJhYyNBY6OkJOQl5iHPAR7FCwGXwEPBY+ZppcJp5qrqZWSqqeTMJydRwlpBqSGhaWwmJO9
+qJLDlIvDvqovLLULn4C8vIaJPzDU1jUOLdnbq9mtitipNt44RdVEORjMEqC5hNGaF+tJ5qS6L4g7
+MjIZ8/5KfQS4O5aN1r8yBBgcWMhAEhGFBwawANHsoEUzCZ6UcmjwIr0CAP9CDhDHAiQABbNmaPDI
+0oIDAYO+rWiphElIka0chUSpjcGAAwAiMlDRkeZBAk60HSpq1AKBBzdF6oJ68lCBAVFvjiTStFOB
+EhcCBAjijWnXCQmoYt35oO1OUmsHjPK5s6DZsxQQgCVgoAbeEyyoKmBwU4Hbk4cH2CMF9EDZvyY4
+BYgcgN/dv2nZKihMGHHnhos3A3iQSh7kChkrdkQw8TLewGwZdAaw1rBo0KMefF562gKCsfIMOuiN
+AvZJBm1FF9bNNvcDrAcexCPejC9w09TpZUbclrnWto2RJw95gFSL7AHtus7ebLvh7gWUD/Ye9Cf5
+UdN7pwpjmb32zooVMAr/YyJ1R1dUckWzXktMPDHGDP5pp5ts79gjm2xt2aPbfLrkB1kq7dCwYHYx
+gEPJYva8U+EuXP1VEhjEYBdhZNook4ouxxBklTgzdYWBIwF8sY0L6wS3kpFHclBdBuW4wM00hACj
+0gZLGlklCCs0gcsxLTKjAToTgckPEUSNScOQ5LTyilLQmMdRma0RFSeZY8rw2x+B7GjXHgjg4eef
+gAYKKBRVBDLMI+d1wkKfhHrh6KOQRtrFGqLgmA8Zig6BzKacduqLlDlKI0SRPyr1jaeopopqNLyQ
+NKJT+Kgq66y+PBJMl16Weio3MnWTk6/APtlrsPkQ+2ux3SDL6yJkWsSkGK76RCvttNRW+4M6LHEy
+wrbcduvtt8xEAAA7
+
+------=_NextPart_000_007E_01BFB923.AB4EDF10
+Content-Type: image/gif;
+	name="email-button-yes.gif"
+Content-Transfer-Encoding: base64
+Content-Disposition: attachment;
+	filename="email-button-yes.gif"
+
+R0lGODdhggAiALMAAAQEA8WaZK1aAN7OsGVdUMu8oCsoIryDQcKwktrJrI2Cb0xGPKWZguTTtNPE
+p7JrHSwAAAAAggAiAAAE/7DJSascOOvNu/9fAo6YSHLNYK2slYjv8M50bd94rsd7X8s3VUrYKqYa
+hcDh8RA4n9CodEqtWq/Y7PNxOARERmMi0IQyu+i0es1uu9/wuJyNAIct5GcX4SgkCg5/fw6EgYaC
+fn6GhYGJCYuMjIiPj5GWl5SHjpuVL4owdxUvB05cgH2EjoSdiYWVjYKWnrGXkqq0kLKcua5+gj9E
+YSoJpAIHgMjIqLWrrbDOtszSjdOM0Ii6g640oRcOTQ8F4n3Iv4E+OLmKvK7nh+6vq/Do6MGhYwLh
+heV+Gd0UQkq8kMfu3A4gMxDGUMHwn0MWAxAYS7XMzsMWERcY2AjohYKNBv8UOECokMTFk0ZkLFG2
+yh7KChgKAJiJ4JSCmQtuGCyQwYQMDS+DUngkgA8koUVk3ASwQByDmQYIMQBJdaPIBAwIGABgYIEC
+oEi7uRygZOCqsBgfLZipoMBWAAxOzZxLV0GCpXTZ+kNrxIEFDAECDDjEF6Knt2sBECAnU7G4UwgY
+ONhK4E8BBhr7uSxMAcGRCgdqcGbx6DJdA4/FUS6AIHKymQTitr58bvNosisGHGgAwzZnGeIIABge
+lzXr4Vw3AqgpLjFyA7F9YRi9YnfDCQh++v5tGcHwBbPFIXiLfPnj8eWRxw1EHWCDwP6I+G0v5jhT
+44+HE2gdmfl5BgoQkFj/U4FsF5ZuAQxhIH0A/eEdU8xZRhkD/IlXgAIK8NfaWgRaRF0CEhU4HYOh
+DPZgU+MAMlxXC7TYIgFucbWAgG+1dQ59L3Cx0IIkXnDXio8R8mB63xWgFZE2FtjeI6TUEUOPJYLI
+wJTiVBLZlABiCWAqkWFY3Cke8qWSMTSMCGVSg0USwz6pnWJNm2De1gAC4Lhi5plFzGAQDGaxxE6Q
+tfEo1mBL5LNNAg4xpOgIRzCqwUCU8GlNH/E0k0lLGwyhaUMg6FmoMW6OJOgE2p1Q6gl6HtonnKgk
+A+iOpnLAJwJ5lBKAmojegUAaSszh66/ABgsHE1E8EICfI4k1xhJlaOHsbLPQRovFGQHw4acJ//Rk
+VicEtaPmIpXK8wq3soDbrbkFYcKMMqEmm61Al6r7rTTh0lvNufLiK80p/GL6kLbk3ivwwAQXbLCd
+owKk7cEMN+ywwT699Ci89FRs8cUY/xAxUovG6vHHIIfMaDcRAAA7
+
+------=_NextPart_000_007E_01BFB923.AB4EDF10--
+
+------=_NextPart_000_0081_01BFB923.AB5065B0
+Content-Type: text/x-vcard;
+	name="Borris.vcf"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment;
+	filename="Borris.vcf"
+
+BEGIN:VCARD
+VERSION:2.1
+N:;Borris
+FN:Borris
+NICKNAME:borris
+EMAIL;PREF;INTERNET:borris@ant.co.uk
+REV:19991109T134421Z
+END:VCARD
+
+------=_NextPart_000_0081_01BFB923.AB5065B0
+Content-Type: text/plain;
+	name="New Text Document.txt"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment;
+	filename="New Text Document.txt"
+
+A piece of text
+
+------=_NextPart_000_0081_01BFB923.AB5065B0--
+
+From imaptest@gi.ant.co.uk Mon Nov  1 15:17:29 1999 +0100
+From: "Simon Middleton" <sjm@ant.co.uk>
+To: "imaptest" <imaptest@ant.co.uk>
+Subject: Test
+Date: Mon, 1 Nov 1999 16:18:56 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPMECGCAAA.sjm@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: Normal
+X-OlkEid: F3648D20EE16883BCB24D411858F0090279B54F3
+Status: RO
+X-Status: 
+X-Keywords:
+
+
+
+-- 
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 567813 - fax +44 1223 567801 - web http://www.ant.co.uk
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0013.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,18 @@
+Subject: Test: X-Return-Receipt-To
+Date: Thu, 28 Oct 1999 17:40:53 +0100
+Message-ID: <199910281640.RAA18480@ped.ant.co.uk>
+MIME-Version: 1.0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+X-Return-Receipt-To: sjm@ant.co.uk
+X-OlkEid: F3848D20F016883BCB24D411858F0090279B54F3
+Status: RO
+X-Status: 
+X-Keywords:
+
+Test X-Return-Receipt-To
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0014.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,20 @@
+Subject: Test: Importance
+Date: Thu, 28 Oct 1999 17:25:33 +0100
+Message-ID: <199910281625.RAA18220@ped.ant.co.uk>
+MIME-Version: 1.0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Priority: 1 (Highest)
+X-MSMail-Priority: High
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: High
+X-OlkEid: F3048E20F716883BCB24D411858F0090279B54F3
+Status: RO
+X-Status: 
+X-Keywords:
+
+Test importance high
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0015.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,20 @@
+Subject: Test: X-Priority
+Date: Thu, 28 Oct 1999 17:25:16 +0100
+Message-ID: <199910281625.RAA18216@ped.ant.co.uk>
+MIME-Version: 1.0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Priority: 1 (Highest)
+X-MSMail-Priority: High
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: High
+X-OlkEid: F3448E20FA16883BCB24D411858F0090279B54F3
+Status: RO
+X-Status: 
+X-Keywords:
+
+Test X-Priority 1
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0016.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,24 @@
+Subject: Test: Delete
+Date: Mon, 18 Oct 1999 12:38:12 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPCEBICAAA.sjm@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: Normal
+X-OlkEid: F3A48E20FF16883BCB24D411858F0090279B54F3
+Status: RO
+X-Status: 
+X-Keywords:
+
+
+
+-- 
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 567813 - fax +44 1223 567801 - web http://www.ant.co.uk
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0017.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,24 @@
+Subject: Test: MoveWithinService
+Date: Mon, 18 Oct 1999 12:37:51 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPOEBHCAAA.sjm@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: Normal
+X-OlkEid: F3C48E200117883BCB24D411858F0090279B54F3
+Status: RO
+X-Status: 
+X-Keywords:
+
+
+
+-- 
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 567813 - fax +44 1223 567801 - web http://www.ant.co.uk
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0018.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,24 @@
+Subject: Test: MoveFromLocal
+Date: Mon, 18 Oct 1999 12:37:40 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPKEBHCAAA.sjm@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: Normal
+X-OlkEid: F3048F200417883BCB24D411858F0090279B54F3
+Status: RO
+X-Status: 
+X-Keywords:
+
+
+
+-- 
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 567813 - fax +44 1223 567801 - web http://www.ant.co.uk
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0019.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,24 @@
+Subject: Test: MoveToLocal
+Date: Mon, 18 Oct 1999 12:37:30 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPGEBHCAAA.sjm@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: Normal
+X-OlkEid: F3248F200617883BCB24D411858F0090279B54F3
+Status: RO
+X-Status: 
+X-Keywords:
+
+
+
+-- 
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 567813 - fax +44 1223 567801 - web http://www.ant.co.uk
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0020.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,24 @@
+Subject: Test: CopyWithinService
+Date: Mon, 18 Oct 1999 12:37:16 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPCEBHCAAA.sjm@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: Normal
+X-OlkEid: F3648F200917883BCB24D411858F0090279B54F3
+Status: RO
+X-Status: 
+X-Keywords:
+
+
+
+-- 
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 567813 - fax +44 1223 567801 - web http://www.ant.co.uk
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0021.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,24 @@
+Subject: Test: CopyFromLocal
+Date: Mon, 18 Oct 1999 12:36:57 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPOEBGCAAA.sjm@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: Normal
+X-OlkEid: F3848F200B17883BCB24D411858F0090279B54F3
+Status: RO
+X-Status: 
+X-Keywords:
+
+
+
+-- 
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 567813 - fax +44 1223 567801 - web http://www.ant.co.uk
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0022.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,22 @@
+Subject: Test: CopyToLocal
+Date: Mon, 18 Oct 1999 12:35:57 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPKEBGCAAA.sjm@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: Normal
+X-OlkEid: F3A48F200D17883BCB24D411858F0090279B54F3
+Status: RO
+X-Status: 
+X-Keywords:
+
+-- 
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 567813 - fax +44 1223 567801 - web http://www.ant.co.uk
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0023.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,11 @@
+Subject: Test: Priority
+Priority: High
+Message-Id: <E12p9Fp-0001nH-00@gi.ant.co.uk>
+Date: Tue, 9 May 2000 13:36:49 +0100
+Status: RO
+X-Status: 
+X-Keywords:
+
+Test of high priority
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0024.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,11 @@
+Subject: Test: Precedence
+Precedence: First-Class
+Message-Id: <E12p9hX-0001qT-00@gi.ant.co.uk>
+Date: Tue, 9 May 2000 14:05:27 +0100
+Status: RO
+X-Status: 
+X-Keywords:
+
+Test precedence first class
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0025.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,18 @@
+Subject: Test: Return-Receipt-To
+Date: Thu, 28 Oct 1999 17:31:58 +0100
+Message-ID: <199910281631.RAA18318@ped.ant.co.uk>
+MIME-Version: 1.0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+X-OlkEid: F3049B201D104EA1AB25D411858F0090279B54F3
+Status: RO
+X-Status: 
+X-Keywords:
+Return-Receipt-To: sjm@ant.co.uk
+
+Test return receipt to.
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0026.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,18 @@
+Subject: Test: Disposition-Notification-To
+Date: Thu, 4 May 2000 11:30:00 +0100
+Message-ID: <E12nItM-0006Ja-00@gi.ant.co.uk>
+MIME-Version: 1.0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+X-OlkEid: F3A4A5202D3879D2AE25D411858F0090279B54F3
+Disposition-Notification-To: <sjm@ant.co.uk>
+Status: RO
+X-Status: 
+X-Keywords:
+
+Test of Disposition-Notification-To
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0027.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,25 @@
+To: "imaptest" <imaptest@ant.co.uk>
+Subject: Test: MoveWithinServiceAndDelete
+Date: Thu, 3 Feb 2000 18:10:34 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPIEKMCAAA.sjm@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
+Importance: Normal
+X-OlkEid: F3648B20D316883BCB24D411858F0090279B54F3
+Status: RO
+X-Status: 
+X-Keywords:
+
+
+
+-- 
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 567813 - fax +44 1223 567801 - web http://www.ant.co.uk
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0028.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,23 @@
+From: "Simon Middleton" <simon.middleton@ant.co.uk>
+To: "imaptest" <imaptest@ant.co.uk>
+Subject: Test: UTF-8
+Date: Mon, 22 May 2000 12:15:40 +0100
+Message-ID: <NDBBIFEJDMIMAHCMBDJPIEIPCBAA.simon.middleton@ant.co.uk>
+MIME-Version: 1.0
+Content-Type: text/plain;
+	charset="utf-8"
+Content-Transfer-Encoding: quoted-printable
+
+
+
+Here is some text in UTF-8. The
+accented characters will take more than one byte
+
+=C3=A1=C3=A9=C3=AD=C3=B3=C3=BA=C3=A1=C3=A9=C3=AD=C3=B3=C3=BA=C3=A1=C3=A9=C3=
+=AD=C3=B3=C3=BA
+
+--=20
+Simon Middleton, Senior Software Engineer, ANT Ltd.
+phone +44 1223 716413 - fax +44 1223 716401 - web http://www.ant.co.uk
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0029.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,158 @@
+Return-Path: <test@psion7.demon.co.uk>
+Received: from punt-1.mail.demon.net by mailstore for test@psion7.demon.co.uk
+          id 958072990:11:15232:0; Thu, 11 May 2000 19:23:10 GMT
+Received: from tele-post-20.mail.demon.net ([194.217.242.20])
+          by punt-1.mail.demon.net  id aa1115172; 11 May 2000 19:23 GMT
+Received: from psion4.demon.co.uk ([194.222.246.223])
+        by tele-post-20.mail.demon.net with smtp (Exim 2.12 #2)
+        id 12pyY0-000GGH-0K; Thu, 11 May 2000 19:23:01 +0000
+Message-ID: <000801bfbb70$382e1a60$330e970a@INTRA>
+From: "psion7.demon.co.uk" <ibrahim.rahman@symbian.com>
+To: <test@psion7.demon.co.uk>
+Subject: SHIFT JIS TEXT
+Date: Thu, 11 May 2000 18:42:03 +0100
+MIME-Version: 1.0
+Content-Type: multipart/mixed;
+        boundary="----=_NextPart_000_0005_01BFBB78.99C49490"
+
+This is a multi-part message in MIME format.
+
+------=_NextPart_000_0005_01BFBB78.99C49490
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/plain;
+        charset="iso-2022-jp"
+
+
+=1B$B%a%G%#%"9)K<%7%U%H#J#I#S$X%"%/%;%9$$$?$@$-$^$7$F$"$j$,$H$&$4$6$$$^$9=
+!#=1B(B
+=1B$B!!%a%G%#%"9)K<%7%U%H#J#I#S$O!"%$%s%?!<%M%C%H%[!<%`%Z!<%8MQ$N%3%"%G%6=
+%$%s!&%`!<%S%s%0%/%j%C%W!&%P%J!<!&%m%4%?%$%W!&%\%?%s!&GX7J$J$I!"%*%j%8%J%=
+j%F%#!<$KIY$s$@H~$7$$%3%s%F%s%D$r@h?J$N5;=3DQ$H%"%$%G%"$GC0G0$K@):n$$$?$7=
+$^$9!#$9$Y$F%&%'%V%G%6%$%J!<$NH/0F$r$b$H$K<j:n6H$G$R$H$D$R$H$D;~4V$r$+$1$=
+F;E>e$2$^$9!#%a%G%#%"9)K<%7%U%H#J#I#S$K$42CF~$$$?$@$-$^$9$H!"@$3&$N$I$3$K=
+$b$J$$$"$J$?$N%5%$%H$@$1$N9bIJ0L$J%G%6%$%s$r@lMQ$N!V>pJs%U%l!<%`!W$H$7$F;=
+HMQ$9$k$3$H$,$G$-$^$9!#=1B(B
+=1B$B!!%3%s%F%s%D$N<+F099?77@Ls$rIU2C$5$l$^$9$H!"#1%3%s%F%s%D$KBP$7$F#4<o=
+N`$N%P%j%(!<%7%g%s$r@):n$7!"Ev<R%a%G%#%"%5!<%P$K<}MF$7$^$9!#%a%G%#%"%5!<%=
+P$O$*5R$5$^$N%[!<%`%Z!<%8$K2hA|$rD>@\%j%s%/$7!"I=3D<($7$^$9!#$?$H$($*5R$5=
+$^$,$*K:$l$K$J$C$F$$$F$b$=3D$l$i$N2hA|$O%a%G%#%"%5!<%PFb$GDj4|E*$K%j%U%l%=
+C%7%e$5$l!"$*5R$5$^$N%[!<%`%Z!<%8$KI=3D<($5$l$^$9!#J8;zDL$j<+F099?7$5$l$?=
+2hA|$,$*5R$5$^$N%[!<%`%Z!<%8$r>o$K?7A/$J0u>]$KJ]$A$^$9!#=3D5C10L$N<+F099?=
+7%W%m%0%i%`$O7n#42s$NF~$lBX$(!&#1$+7n%5%$%/%k!#7nC10L$N<+F099?7%W%m%0%i%`=
+$O7n#12s$NF~$lBX$(!&#4$+7n%5%$%/%k$G$9!#MQES$K1~$8$FA*Br$G$-$^$9$,!"$"$i$=
+f$kLL$G8z2LE*$J=3D5C10L$N<+F099?7%W%m%0%i%`$r$*$9$9$a$$$?$7$^$9!#=1B(B
+
+=1B$B!!<+F099?7%W%m%0%i%`$NI=3D<(%5%s%W%k=1B(B=20
+
+------=_NextPart_000_0005_01BFBB78.99C49490
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html;
+        charset="iso-2022-jp"
+Content-Disposition: attachment
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HTML><HEAD>
+<META content=3D"text/html; charset=3Diso-2022-jp" =
+http-equiv=3DContent-Type>
+<META content=3D"MSHTML 5.00.2919.6307" name=3DGENERATOR>
+<STYLE></STYLE>
+</HEAD>
+<BODY bgColor=3D#e1e0d2>
+<DIV><FONT face=3DArial=20
+size=3D2><BR>=1B$B%a%G%#%"9)K<%7%U%H#J#I#S$X%"%/%;%9$$$?$@$-$^$7$F$"$j$,$=
+H$&$4$6$$$^$9!#=1B(B<BR>=1B$B!!%a%G%#%"9)K<%7%U%H#J#I#S$O!"%$%s%?!<%M%C%H=
+%[!<%`%Z!<%8MQ$N%3%"%G%6%$%s!&%`!<%S%s%0%/%j%C%W!&%P%J!<!&%m%4%?%$%W!&%\%=
+?%s!&GX7J$J$I!"%*%j%8%J%j%F%#!<$KIY$s$@H~$7$$%3%s%F%s%D$r@h?J$N5;=3DQ$H%"=
+%$%G%"$GC0G0$K@):n$$$?$7$^$9!#$9$Y$F%&%'%V%G%6%$%J!<$NH/0F$r$b$H$K<j:n6H$=
+G$R$H$D$R$H$D;~4V$r$+$1$F;E>e$2$^$9!#%a%G%#%"9)K<%7%U%H#J#I#S$K$42CF~$$$?=
+$@$-$^$9$H!"@$3&$N$I$3$K$b$J$$$"$J$?$N%5%$%H$@$1$N9bIJ0L$J%G%6%$%s$r@lMQ$=
+N!V>pJs%U%l!<%`!W$H$7$F;HMQ$9$k$3$H$,$G$-$^$9!#=1B(B<BR>=1B$B!!%3%s%F%s%D=
+$N<+F099?77@Ls$rIU2C$5$l$^$9$H!"#1%3%s%F%s%D$KBP$7$F#4<oN`$N%P%j%(!<%7%g%=
+s$r@):n$7!"Ev<R%a%G%#%"%5!<%P$K<}MF$7$^$9!#%a%G%#%"%5!<%P$O$*5R$5$^$N%[!<=
+%`%Z!<%8$K2hA|$rD>@\%j%s%/$7!"I=3D<($7$^$9!#$?$H$($*5R$5$^$,$*K:$l$K$J$C$=
+F$$$F$b$=3D$l$i$N2hA|$O%a%G%#%"%5!<%PFb$GDj4|E*$K%j%U%l%C%7%e$5$l!"$*5R$5=
+$^$N%[!<%`%Z!<%8$KI=3D<($5$l$^$9!#J8;zDL$j<+F099?7$5$l$?2hA|$,$*5R$5$^$N%=
+[!<%`%Z!<%8$r>o$K?7A/$J0u>]$KJ]$A$^$9!#=3D5C10L$N<+F099?7%W%m%0%i%`$O7n#4=
+2s$NF~$lBX$(!&#1$+7n%5%$%/%k!#7nC10L$N<+F099?7%W%m%0%i%`$O7n#12s$NF~$lBX$=
+(!&#4$+7n%5%$%/%k$G$9!#MQES$K1~$8$FA*Br$G$-$^$9$,!"$"$i$f$kLL$G8z2LE*$J=3D=
+5C10L$N<+F099?7%W%m%0%i%`$r$*$9$9$a$$$?$7$^$9!#=1B(B</FONT></DIV>
+<DIV>&nbsp;</DIV>
+<DIV><FONT face=3DArial =
+size=3D2>=1B$B!!<+F099?7%W%m%0%i%`$NI=3D<(%5%s%W%k=1B(B =
+</FONT></DIV></BODY></HTML>
+
+------=_NextPart_000_0005_01BFBB78.99C49490
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/plain;
+        charset="gb2312"
+
+=A1=A1=A1=A1=D5=E2=C0=EF=CA=C7=A1=B0=D6=D0=B9=FA=CE=C4=D3=E9=CD=F8=A1=B1=D3=
+=EB=D6=D0=D1=EB=C8=CB=C3=F1=B9=E3=B2=A5=B5=E7=CC=A8=CE=C4=D2=D5=B5=F7=C6=B5=
+=C1=AA=BA=CF=D6=F7=B0=EC=B5=C4=CD=F8=C9=CF=A1=B0=D6=D0=B9=FA=C1=F7=D0=D0=B8=
+=E8=C7=FA=B0=F1=A1=B1=BD=DA=C4=BF=A1=A3
+=A1=A1=A1=A1=D4=DA=A1=B0=D6=D0=B9=FA=CE=C4=D3=E9=CD=F8=A1=B1=BF=AA=CD=A8=D6=
+=AE=BC=CA=A3=AC=CE=D2=C3=C7=BD=F7=CF=F2=B9=D8=D0=C4=D6=D0=B9=FA=D4=AD=B4=B4=
+=B8=E8=C7=FA=B5=C4=CD=F8=C9=CF=CC=FD=D6=DA=C5=F3=D3=D1=B1=ED=CA=BE=C8=C8=C1=
+=D2=B5=C4=BB=B6=D3=AD=A1=A3=C8=C3=CE=D2=C3=C7=D4=DA=D2=F2=CC=D8=CD=F8=C9=CF=
+=B9=B2=CD=AC=B9=D8=D7=A2=BA=CD=CC=BD=CC=D6=D6=D0=B9=FA=D4=AD=B4=B4=B8=E8=C7=
+=FA=B5=C4=B7=A2=D5=B9=BA=CD=C7=B0=BE=B0=A1=A3
+=A1=A1=A1=A1=CE=D2=C3=C7=BD=AB=B2=BB=B6=CF=B7=E1=B8=BB=A1=B0=D6=D0=B9=FA=C1=
+=F7=D0=D0=B8=E8=C7=FA=B0=F1=A1=B1=B5=C4=CD=F8=C9=CF=C4=DA=C8=DD=A3=AC=D2=B2=
+=BF=D2=C7=D0=B5=D8=CF=A3=CD=FB=CC=FD=B5=BD=C4=E3=C3=C7=B5=C4=BD=A8=D2=E9=A3=
+=AC=C8=C3=CE=D2=C3=C7=D2=BB=C6=F0=C5=AC=C1=A6=B0=D1=A1=B0=D6=D0=B9=FA=C1=F7=
+=D0=D0=B8=E8=C7=FA=B0=F1=A1=B1=B0=EC=B5=C3=B8=FC=BA=C3=A3=A1
+=A1=A1=A1=A1=D6=D0=D1=EB=B9=E3=B2=A5=B5=E7=CC=A8=C1=AA=CF=B5=C8=CB=A3=BA=D5=
+=C5=B6=AB=A1=A2=D5=C2=D3=A8=D3=A8=A1=A1=A1=A1=C1=AA=CF=B5=B5=E7=BB=B0=A3=BA=
+66092324
+=A1=A1=A1=A1=D6=D0=B9=FA=CE=C4=D3=E9=CD=F8=C1=AA=CF=B5=C8=CB=A3=BA=D5=C5=CC=
+=CE=A1=A2=BD=AD=D4=A8=C1=B9=A1=A1=C1=AA=CF=B5=B5=E7=BB=B0=A3=BA62354138=A1=
+=A264227627
+ 
+------=_NextPart_000_0005_01BFBB78.99C49490
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/html;
+        charset="gb2312"
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HTML><HEAD>
+<META content=3D"text/html; charset=3Dgb2312" http-equiv=3DContent-Type>
+<META content=3D"MSHTML 5.00.2919.6307" name=3DGENERATOR>
+<STYLE></STYLE>
+</HEAD>
+<BODY bgColor=3D#e1e0d2>
+<DIV><FONT face=3DArial size=3D2><FONT color=3D#004080 =
+size=3D4>=A1=A1=A1=A1</FONT><FONT=20
+color=3D#ff0000 size=3D7>=D5=E2</FONT><FONT color=3D#004080 =
+size=3D4>=C0=EF=CA=C7=A1=B0</FONT><A=20
+href=3D"http://www.chinacue.com.cn/" target=3D_top><FONT color=3D#ff0000 =
+
+size=3D4><STRONG>=D6=D0=B9=FA=CE=C4=D3=E9=CD=F8</STRONG></FONT></A><FONT =
+color=3D#004080=20
+size=3D4>=A1=B1=D3=EB</FONT><FONT color=3D#ff0000=20
+size=3D4><STRONG>=D6=D0=D1=EB=C8=CB=C3=F1=B9=E3=B2=A5=B5=E7=CC=A8=CE=C4=D2=
+=D5=B5=F7=C6=B5</STRONG></FONT><FONT color=3D#004080=20
+size=3D4>=C1=AA=BA=CF=D6=F7=B0=EC=B5=C4=CD=F8=C9=CF=A1=B0=D6=D0=B9=FA=C1=F7=
+=D0=D0=B8=E8=C7=FA=B0=F1=A1=B1=BD=DA=C4=BF=A1=A3</FONT><BR><FONT =
+color=3D#004080=20
+size=3D4>=A1=A1=A1=A1=D4=DA=A1=B0=D6=D0=B9=FA=CE=C4=D3=E9=CD=F8=A1=B1=BF=AA=
+=CD=A8=D6=AE=BC=CA=A3=AC=CE=D2=C3=C7=BD=F7=CF=F2=B9=D8=D0=C4=D6=D0=B9=FA=D4=
+=AD=B4=B4=B8=E8=C7=FA=B5=C4=CD=F8=C9=CF=CC=FD=D6=DA=C5=F3=D3=D1=B1=ED=CA=BE=
+=C8=C8=C1=D2=B5=C4=BB=B6=D3=AD=A1=A3=C8=C3=CE=D2=C3=C7=D4=DA=D2=F2=CC=D8=CD=
+=F8=C9=CF=B9=B2=CD=AC=B9=D8=D7=A2=BA=CD=CC=BD=CC=D6=D6=D0=B9=FA=D4=AD=B4=B4=
+=B8=E8=C7=FA=B5=C4=B7=A2=D5=B9=BA=CD=C7=B0=BE=B0=A1=A3<BR>=A1=A1=A1=A1=CE=
+=D2=C3=C7=BD=AB=B2=BB=B6=CF=B7=E1=B8=BB=A1=B0=D6=D0=B9=FA=C1=F7=D0=D0=B8=E8=
+=C7=FA=B0=F1=A1=B1=B5=C4=CD=F8=C9=CF=C4=DA=C8=DD=A3=AC=D2=B2=BF=D2=C7=D0=B5=
+=D8=CF=A3=CD=FB=CC=FD=B5=BD=C4=E3=C3=C7=B5=C4=BD=A8=D2=E9=A3=AC=C8=C3=CE=D2=
+=C3=C7=D2=BB=C6=F0=C5=AC=C1=A6=B0=D1=A1=B0=D6=D0=B9=FA=C1=F7=D0=D0=B8=E8=C7=
+=FA=B0=F1=A1=B1=B0=EC=B5=C3=B8=FC=BA=C3=A3=A1</FONT><BR>=A1=A1=A1=A1<FONT=
+=20
+color=3D#ff0000 =
+size=3D4>=D6=D0=D1=EB=B9=E3=B2=A5=B5=E7=CC=A8=C1=AA=CF=B5=C8=CB=A3=BA=D5=C5=
+=B6=AB=A1=A2=D5=C2=D3=A8=D3=A8=A1=A1=A1=A1=C1=AA=CF=B5=B5=E7=BB=B0=A3=BA6=
+6092324</FONT><BR>=A1=A1=A1=A1<FONT=20
+color=3D#ff0000=20
+size=3D4>=D6=D0=B9=FA=CE=C4=D3=E9=CD=F8=C1=AA=CF=B5=C8=CB=A3=BA=D5=C5=CC=CE=
+=A1=A2=BD=AD=D4=A8=C1=B9=A1=A1=C1=AA=CF=B5=B5=E7=BB=B0=A3=BA62354138=A1=A2=
+64227627</FONT><BR></FONT></DIV></BODY></HTML>
+
+------=_NextPart_000_0005_01BFBB78.99C49490--
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0030.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,271 @@
+Received: from (serv.ant.co.uk) [62.254.220.194] 
+	by utter.chaos.org.uk with esmtp (Exim 2.02 #1)
+	id 16d7kx-00023M-00 (Debian); Tue, 19 Feb 2002 10:44:19 +0000
+Message-ID: <001101c1b932$5db23cf0$1c9223c1@eggpl>
+From: "Simon Middleton" <simon.middleton@antlimited.com>
+To: <test@chaos.org.uk>
+Subject: Test: 30
+Date: Tue, 19 Feb 2002 10:44:11 -0000
+MIME-Version: 1.0
+Content-Type: multipart/mixed;
+	boundary="----=_NextPart_000_000E_01C1B932.5D79C7D0"
+
+This is a multi-part message in MIME format.
+
+------=_NextPart_000_000E_01C1B932.5D79C7D0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+
+Test with loads of nested attachments
+
+
+------=_NextPart_000_000E_01C1B932.5D79C7D0
+Content-Type: message/rfc822;
+	name="Test 8.eml"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment;
+	filename="Test 8.eml"
+
+Message-ID: <00bb01c1b8a1$f1825320$1c9223c1@eggpl>
+From: "Simon Middleton" <simon.middleton@antlimited.com>
+To: "Simon Middleton" <simon.middleton@antlimited.com>
+Subject: Test 8
+Date: Mon, 18 Feb 2002 17:30:22 -0000
+MIME-Version: 1.0
+Content-Type: multipart/mixed;
+	boundary="----=_NextPart_000_00B8_01C1B8A1.F14E71E0"
+
+This is a multi-part message in MIME format.
+
+------=_NextPart_000_00B8_01C1B8A1.F14E71E0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+
+
+
+------=_NextPart_000_00B8_01C1B8A1.F14E71E0
+Content-Type: message/rfc822;
+	name="Test 7.eml"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment;
+	filename="Test 7.eml"
+
+Message-ID: <00a901c1b89f$dac59fe0$1c9223c1@eggpl>
+From: "Simon Middleton" <simon.middleton@antlimited.com>
+To: "Simon Middleton" <simon.middleton@antlimited.com>
+Subject: Test 7
+Date: Mon, 18 Feb 2002 17:15:24 -0000
+MIME-Version: 1.0
+Content-Type: multipart/mixed;
+	boundary="----=_NextPart_000_00A6_01C1B89F.DA995FC0"
+
+This is a multi-part message in MIME format.
+
+------=_NextPart_000_00A6_01C1B89F.DA995FC0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+
+
+
+------=_NextPart_000_00A6_01C1B89F.DA995FC0
+Content-Type: message/rfc822;
+	name="Test 6.eml"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment;
+	filename="Test 6.eml"
+
+Message-ID: <009b01c1b89f$99b8a3d0$1c9223c1@eggpl>
+From: "Simon Middleton" <simon.middleton@antlimited.com>
+To: "Simon Middleton" <simon.middleton@antlimited.com>
+Subject: Test 6
+Date: Mon, 18 Feb 2002 17:13:35 -0000
+MIME-Version: 1.0
+Content-Type: multipart/mixed;
+	boundary="----=_NextPart_000_0098_01C1B89F.998DEA50"
+
+This is a multi-part message in MIME format.
+
+------=_NextPart_000_0098_01C1B89F.998DEA50
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+
+
+
+------=_NextPart_000_0098_01C1B89F.998DEA50
+Content-Type: message/rfc822;
+	name="Test 5.eml"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment;
+	filename="Test 5.eml"
+
+Message-ID: <006f01c1b89d$ae736960$1c9223c1@eggpl>
+From: "Simon Middleton" <simon.middleton@antlimited.com>
+To: "Simon Middleton" <simon.middleton@antlimited.com>
+Subject: Test 5
+Date: Mon, 18 Feb 2002 16:59:51 -0000
+MIME-Version: 1.0
+Content-Type: multipart/mixed;
+	boundary="----=_NextPart_000_006C_01C1B89D.AE34B2B0"
+
+This is a multi-part message in MIME format.
+
+------=_NextPart_000_006C_01C1B89D.AE34B2B0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+
+
+
+------=_NextPart_000_006C_01C1B89D.AE34B2B0
+Content-Type: message/rfc822;
+	name="Test 4.eml"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment;
+	filename="Test 4.eml"
+
+Message-ID: <005601c1b89c$24e4ade0$1c9223c1@eggpl>
+From: "Simon Middleton" <simon.middleton@antlimited.com>
+To: "Simon Middleton" <simon.middleton@antlimited.com>
+Subject: Test 4
+Date: Mon, 18 Feb 2002 16:48:51 -0000
+MIME-Version: 1.0
+Content-Type: multipart/mixed;
+	boundary="----=_NextPart_000_0053_01C1B89C.24AC38C0"
+
+This is a multi-part message in MIME format.
+
+------=_NextPart_000_0053_01C1B89C.24AC38C0
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+
+
+
+------=_NextPart_000_0053_01C1B89C.24AC38C0
+Content-Type: message/rfc822;
+	name="Test 3.eml"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment;
+	filename="Test 3.eml"
+
+Message-ID: <004801c1b89b$fb363540$1c9223c1@eggpl>
+From: "Simon Middleton" <simon.middleton@antlimited.com>
+To: "Simon Middleton" <simon.middleton@antlimited.com>
+Subject: Test 3
+Date: Mon, 18 Feb 2002 16:47:41 -0000
+MIME-Version: 1.0
+Content-Type: multipart/mixed;
+	boundary="----=_NextPart_000_0045_01C1B89B.FB00A650"
+
+This is a multi-part message in MIME format.
+
+------=_NextPart_000_0045_01C1B89B.FB00A650
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+
+
+
+------=_NextPart_000_0045_01C1B89B.FB00A650
+Content-Type: message/rfc822;
+	name="Test 2.eml"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment;
+	filename="Test 2.eml"
+
+Message-ID: <003201c1b89b$aa023e80$1c9223c1@eggpl>
+From: "Simon Middleton" <simon.middleton@antlimited.com>
+To: "Simon Middleton" <simon.middleton@antlimited.com>
+Subject: Test 2
+Date: Mon, 18 Feb 2002 16:45:25 -0000
+MIME-Version: 1.0
+Content-Type: multipart/mixed;
+	boundary="----=_NextPart_000_002F_01C1B89B.A9D16A80"
+
+This is a multi-part message in MIME format.
+
+------=_NextPart_000_002F_01C1B89B.A9D16A80
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+
+
+
+------=_NextPart_000_002F_01C1B89B.A9D16A80
+Content-Type: message/rfc822;
+	name="Test 1.eml"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment;
+	filename="Test 1.eml"
+
+Message-ID: <001801c1b89b$7c958560$1c9223c1@eggpl>
+From: "Simon Middleton" <simon.middleton@antlimited.com>
+To: "Simon Middleton" <simon.middleton@antlimited.com>
+Subject: Test 1
+Date: Mon, 18 Feb 2002 16:44:03 -0000
+MIME-Version: 1.0
+Content-Type: multipart/mixed;
+	boundary="----=_NextPart_000_0015_01C1B89B.790E8180"
+
+This is a multi-part message in MIME format.
+
+------=_NextPart_000_0015_01C1B89B.790E8180
+Content-Type: text/plain;
+	charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+
+test
+
+
+------=_NextPart_000_0015_01C1B89B.790E8180
+Content-Type: application/octet-stream;
+	name="setup.bat"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment;
+	filename="setup.bat"
+
+subst r: /d
+subst r: d:\projects\Symbian\6.0_new
+subst s: /d
+subst s: d:\projects\Symbian\6.1
+subst t: /d
+subst t: d:\projects\Symbian\6.2
+
+------=_NextPart_000_0015_01C1B89B.790E8180--
+
+
+
+------=_NextPart_000_002F_01C1B89B.A9D16A80--
+
+
+
+------=_NextPart_000_0045_01C1B89B.FB00A650--
+
+
+
+------=_NextPart_000_0053_01C1B89C.24AC38C0--
+
+
+
+------=_NextPart_000_006C_01C1B89D.AE34B2B0--
+
+
+
+------=_NextPart_000_0098_01C1B89F.998DEA50--
+
+
+
+------=_NextPart_000_00A6_01C1B89F.DA995FC0--
+
+
+
+------=_NextPart_000_00B8_01C1B8A1.F14E71E0--
+
+
+
+------=_NextPart_000_000E_01C1B932.5D79C7D0--
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0031.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,51 @@
+Received: from (serv.ant.co.uk) [62.254.220.194] 
+	by utter.chaos.org.uk with esmtp (Exim 3.12 #1)
+	id 17T0Av-0004yC-00 (Debian); Fri, 12 Jul 2002 13:09:33 +0000
+Message-ID: <3D2ED49A.8090809@antlimited.com>
+Date: Fri, 12 Jul 2002 14:07:38 +0100
+From: Simon Middleton <simon.middleton@antlimited.com>
+MIME-Version: 1.0
+To: test@chaos.org.uk
+Subject: Test: 31
+Content-Type: multipart/mixed;
+ boundary="------------070806080104050908060303"
+
+This is a multi-part message in MIME format.
+--------------070806080104050908060303
+Content-Type: text/plain; charset=us-ascii; format=flowed
+Content-Transfer-Encoding: 7bit
+
+There is a text attachment to this with a numeric name to trigger bad 
+sizing code.
+
+-- 
+Simon Middleton, Senior Software Engineer
+
+ANT Limited, Cambridge Business Park, Cowley Road, Cambridge CB4-0WZ, UK
+Tel: +44 (0)1223 716413             Fax: +44 (0)1223 716401
+<simon.middleton@antlimited.com>    http://www.antlimited.com
+
+
+
+* LEGAL DISCLAIMER *
+
+This message (which includes any files transmitted with it) is
+confidential and contains information which may be legally
+privileged. It is intended for the stated addressee(s) only. Access to
+this email by anyone else is unauthorised. If you are not the intended
+addressee, any disclosure, copying or storage of the contents of this
+email, or any action taken (or not taken) in reliance on it, is
+unauthorised and is unlawful. If you are not the addressee, please
+delete the original and any copies and inform the sender immediately.
+
+--------------070806080104050908060303
+Content-Type: text/plain;
+ name="1769046492"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: inline;
+ filename="1769046492"
+
+here is some text
+
+--------------070806080104050908060303--
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0032.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,48 @@
+Received: from (serv.ant.co.uk) [62.254.220.194] 
+	by utter.chaos.org.uk with esmtp (Exim 3.12 #1)
+	id 17eDlJ-0000dZ-00 (Debian); Mon, 12 Aug 2002 11:53:29 +0000
+Date: 12 Aug 2002 12:53:28 +0100
+Message-Id: <lfwuqwl2dj.fsf@restaur.ant.co.uk>
+From: Simon Middleton  <simon.middleton@antlimited.com>
+To: test@chaos.org.uk
+Subject: Test: 32
+MIME-Version: 1.0
+Content-Type: multipart/mixed;
+ boundary="------------090005000508020204050502"
+
+This is a multi-part message in MIME format.
+--------------090005000508020204050502
+Content-Type: text/plain; charset=us-ascii; format=flowed
+Content-Transfer-Encoding: 7bit
+
+
+-- 
+Simon Middleton, Senior Software Engineer
+
+ANT Limited, Cambridge Business Park, Cowley Road, Cambridge CB4-0WZ, UK
+Tel: +44 (0)1223 716413             Fax: +44 (0)1223 716401
+<simon.middleton@antlimited.com>    http://www.antlimited.com
+
+
+
+* LEGAL DISCLAIMER *
+
+This message (which includes any files transmitted with it) is
+confidential and contains information which may be legally
+privileged. It is intended for the stated addressee(s) only. Access to
+this email by anyone else is unauthorised. If you are not the intended
+addressee, any disclosure, copying or storage of the contents of this
+email, or any action taken (or not taken) in reliance on it, is
+unauthorised and is unlawful. If you are not the addressee, please
+delete the original and any copies and inform the sender immediately.
+
+--------------090005000508020204050502
+Content-Type: text/plain;
+ name="This is just a scribble but the real point of this picture is to test out what happens when we download an email with a really large attachment filename_it still didn't work so Im going to make this attachment nam__________________________________and now there is even more text from steve after the underscores this will ensure that the filename is definaitely more than 256 characters in length.txt"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: inline;
+ filename="This is just a scribble but the real point of this picture is to test out what happens when we download an email with a really large attachment filename_it still didn't work so Im going to make this attachment nam__________________________________and now there is even more text from steve after the underscores this will ensure that the filename is definaitely more than 256 characters in length.txt"
+
+
+--------------090005000508020204050502--
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/data/rfc_0033.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,48 @@
+Received: from (serv.ant.co.uk) [62.254.220.194] 
+	by utter.chaos.org.uk with esmtp (Exim 3.12 #1)
+	id 17eDmq-0000dc-00 (Debian); Mon, 12 Aug 2002 11:55:04 +0000
+Date: 12 Aug 2002 12:55:02 +0100
+Message-Id: <lfvg6gl2ax.fsf@restaur.ant.co.uk>
+From: Simon Middleton  <simon.middleton@antlimited.com>
+To: test@chaos.org.uk
+Subject: Test: 33
+MIME-Version: 1.0
+Content-Type: multipart/mixed;
+ boundary="------------090005000508020204050502"
+
+This is a multi-part message in MIME format.
+--------------090005000508020204050502
+Content-Type: text/plain; charset=us-ascii; format=flowed
+Content-Transfer-Encoding: 7bit
+
+
+-- 
+Simon Middleton, Senior Software Engineer
+
+ANT Limited, Cambridge Business Park, Cowley Road, Cambridge CB4-0WZ, UK
+Tel: +44 (0)1223 716413             Fax: +44 (0)1223 716401
+<simon.middleton@antlimited.com>    http://www.antlimited.com
+
+
+
+* LEGAL DISCLAIMER *
+
+This message (which includes any files transmitted with it) is
+confidential and contains information which may be legally
+privileged. It is intended for the stated addressee(s) only. Access to
+this email by anyone else is unauthorised. If you are not the intended
+addressee, any disclosure, copying or storage of the contents of this
+email, or any action taken (or not taken) in reliance on it, is
+unauthorised and is unlawful. If you are not the addressee, please
+delete the original and any copies and inform the sender immediately.
+
+--------------090005000508020204050502
+Content-Type: text/plain;
+ name="This is just a scribble but the real point of this picture is to test out what happens when we download an email with a really large attachment filename_it still didn't work so Im going to make this attachment nam__________________________________.txt"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: inline;
+ filename="This is just a scribble but the real point of this picture is to test out what happens when we download an email with a really large attachment filename_it still didn't work so Im going to make this attachment nam__________________________________.txt"
+
+
+--------------090005000508020204050502--
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/group/T_ConnectAndSyncAfterDisconnect.mmp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,51 @@
+
+// Copyright (c) 2006-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:
+//
+
+
+
+TARGET        T_ConnectAndSyncAfterDisconnect.exe
+TARGETTYPE    exe
+
+CAPABILITY All -TCB
+
+
+TARGETPATH      \system\libs
+
+UID             0x10003C5E 0x10003C4E
+
+VENDORID 0x70000001
+
+SOURCEPATH      ..\src
+SOURCE	         T_ConnectAndSyncAfterDisconnect.cpp	
+
+
+
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgsrvnstore/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/base/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/email/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/sms/inc
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
+LIBRARY         euser.lib efsrv.lib msgs.lib 
+
+LIBRARY       imut.lib imcm.lib imps.lib
+
+LIBRARY			EmailTestUtils.lib MsvTestUtils.lib	bafl.lib
+
+
+
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/group/T_DEF059571_IMAP_MISSINGOFFSET.iby	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,27 @@
+/*
+* 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 __T_DEF059571_IMAP_MISSINGOFFSET__
+#define __T_DEF059571_IMAP_MISSINGOFFSET__
+
+file=ABI_DIR\BUILD_DIR\T_DEF059571_Imap_MissingOffset.exe 	System\bin\T_DEF059571_Imap_MissingOffset.exe 
+
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\T_DEF059571_IMAP_MISSINGOFFSET.script msgtest\imap\T_DEF059571_IMAP_MISSINGOFFSET.script
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\ImapMissingOffset.txt msgtest\imap\ImapMissingOffset.txt
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\ImapMissingOffsetTest.ini msgtest\imap\ImapMissingOffsetTest.ini
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/group/T_DEF059571_IMAP_MISSINGOFFSET.mmp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,48 @@
+// Copyright (c) 2005-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:
+// Using relative paths for sourcepath and user includes
+// 
+//
+
+TARGET      T_DEF059571_Imap_MissingOffset.exe 
+TARGETTYPE  exe
+UID         0x1000007A 0x103F777E
+VENDORID    0x70000001
+
+
+CAPABILITY All -TCB
+
+SOURCEPATH  ..\src
+SOURCE		T_DEF059571_IMAP_MissingOffsetServer.cpp
+SOURCE		T_DEF059571_IMAP_MissingOffsetStep.cpp
+SOURCE		T_DEF059571_IMAP_Client.cpp
+
+USERINCLUDE   ..\inc
+USERINCLUDE   ..\..\inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgsrvnstore/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/base/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/email/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/sms/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/tools/spoofserver/inc
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_ESTLIB_SYSTEMINCLUDE  
+LIBRARY     euser.lib
+LIBRARY		testexecuteutils.lib
+LIBRARY		testexecutelogclient.lib
+LIBRARY		msgs.lib efsrv.lib etext.lib imcm.lib bafl.lib
+LIBRARY		EmailTestUtils.lib MsvTestUtils.lib imut.lib insock.lib esock.lib estor.lib Spoofserver.lib
+
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/group/T_DEF062024_IMAP_ATTACHMENTCANNOTBEOPENED.iby	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,27 @@
+/*
+* 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 __T_DEF062024_IMAP_ATTACHMENTCANNOTBEOPENED__
+#define __T_DEF062024_IMAP_ATTACHMENTCANNOTBEOPENED__
+
+file=ABI_DIR\BUILD_DIR\T_DEF062024_Imap_AttachmentCannotBeOpened.exe	System\bin\T_DEF062024_Imap_AttachmentCannotBeOpened.exe
+
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\T_DEF062024_IMAP_ATTACHMENTCANNOTBEOPENED.script msgtest\imap\T_DEF062024_IMAP_ATTACHMENTCANNOTBEOPENED.script
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\uploadAttachment.txt msgtest\imap\ImapGetMailAndAttachment.txt
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\ImapUTCTest2.ini msgtest\imap\ImapAttachmentTest.ini
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/group/T_DEF062024_IMAP_ATTACHMENTCANNOTBEOPENED.mmp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,47 @@
+// Copyright (c) 2005-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:
+// Using relative paths for sourcepath and user includes
+// 
+//
+
+TARGET       T_DEF062024_Imap_AttachmentCannotBeOpened.exe 
+TARGETTYPE  exe
+UID             0x1000007A 0x102F777E
+VENDORID 0x70000001
+
+CAPABILITY All -TCB
+
+SOURCEPATH  ..\src
+SOURCE		T_DEF062024_Imap_AttachmentCannotBeOpenedServer.cpp
+SOURCE		T_DEF062024_IMAP21cnServer_AttachmentCannotBeOpenedStep.cpp
+SOURCE		T_DEF062024_IMAPClient.cpp
+
+USERINCLUDE   ..\inc
+USERINCLUDE   ..\..\inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgsrvnstore/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/base/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/email/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/sms/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/tools/spoofserver/inc
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_ESTLIB_SYSTEMINCLUDE  
+LIBRARY     	euser.lib
+LIBRARY		testexecuteutils.lib
+LIBRARY		testexecutelogclient.lib
+LIBRARY		msgs.lib efsrv.lib etext.lib imcm.lib bafl.lib
+LIBRARY		EmailTestUtils.lib MsvTestUtils.lib imut.lib insock.lib esock.lib estor.lib Spoofserver.lib
+
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/group/T_DEF075510_Offline_Populate.mmp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,56 @@
+
+// Copyright (c) 2006-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:
+//
+
+
+
+TARGET        T_DEF075510_Offline_Populate.exe
+TARGETTYPE    exe
+
+CAPABILITY All -TCB
+
+
+TARGETPATH      \system\libs
+
+UID             0x10003C5E 0x10003C4E
+
+VENDORID 0x70000001
+
+SOURCEPATH      ..\src
+SOURCE	         T_DEF075510_Offline_Populate.cpp	
+
+
+
+USERINCLUDE   ..\inc
+USERINCLUDE   ..\..\inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgsrvnstore/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/base/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/email/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/sms/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/tools/spoofserver/inc
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_ESTLIB_SYSTEMINCLUDE  
+
+LIBRARY         euser.lib efsrv.lib msgs.lib 
+
+LIBRARY       imut.lib imcm.lib imps.lib
+
+LIBRARY			EmailTestUtils.lib MsvTestUtils.lib	bafl.lib
+
+
+
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/group/T_DEF079867_OfflineDelete.mmp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,54 @@
+/*
+* 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:
+*
+*/
+
+
+TARGET        T_DEF079867_OfflineDelete.exe
+TARGETTYPE    exe
+
+CAPABILITY All -TCB
+
+
+TARGETPATH      \system\libs
+
+UID             0x10003C5E 0x10003C4E
+
+VENDORID 0x70000001
+
+SOURCEPATH      ..\src
+SOURCE	       T_DEF079867_OfflineDelete.cpp	
+
+
+USERINCLUDE   ..\inc
+USERINCLUDE   ..\..\inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgsrvnstore/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/base/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/email/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/sms/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/tools/spoofserver/inc
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_ESTLIB_SYSTEMINCLUDE  
+LIBRARY         euser.lib efsrv.lib msgs.lib 
+
+LIBRARY        imut.lib imcm.lib    imps.lib
+
+LIBRARY			EmailTestUtils.lib MsvTestUtils.lib	bafl.lib
+
+
+
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/group/T_DUMP.mmp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,39 @@
+/*
+* 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:
+*
+*/
+
+TARGET        T_DUMP.EXE
+TARGETTYPE    exe
+
+CAPABILITY All -TCB
+SOURCEPATH	..\src
+SOURCE        T_DUMP.CPP T_LOG.CPP
+USERINCLUDE   ..\inc
+USERINCLUDE   ..\..\inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgsrvnstore/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/base/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/email/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/sms/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/tools/spoofserver/inc
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_ESTLIB_SYSTEMINCLUDE  
+
+LIBRARY       euser.lib etext.lib efsrv.lib imcm.lib msgs.lib
+
+VENDORID 0x70000001
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/group/T_DecodeServer.iby	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,30 @@
+/*
+* 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 __T_DECODESERVER__
+#define __T_DECODESERVER__
+
+file=ABI_DIR\BUILD_DIR\T_DecodeServer.exe	System\bin\T_DecodeServer.exe
+
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\T_IMAP_DECODE.script msgtest\imap\T_IMAP_DECODE.script
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\mail1_Base64.txt msgtest\imap\mail1_Base64.txt
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\mail1_Base64_body.txt msgtest\imap\mail1_Base64_body.txt
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\mail2_Base64.txt msgtest\imap\mail2_Base64.txt
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\mail2_Base64_body.txt msgtest\imap\mail2_Base64_body.txt
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\ImapDecode.ini msgtest\imap\ImapDecode.ini
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/group/T_DecodeServer.mmp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,54 @@
+// Copyright (c) 2005-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:
+// Using relative paths for sourcepath and user includes
+// 
+//
+
+#if (defined WINS && !defined EKA2)
+TARGET      T_DecodeServer.dll
+TARGETTYPE  dll
+UID             0x1000008d 0x101F777E
+VENDORID 0x70000001
+#else
+TARGET       T_DecodeServer.exe
+TARGETTYPE  exe
+UID             0x1000007A 0x101F777E
+VENDORID 0x70000001
+#endif
+
+CAPABILITY All -TCB
+
+SOURCEPATH  ..\src
+SOURCE		T_DecodeServer.cpp
+SOURCE		t_test_decode_step.cpp
+SOURCE		DecodeImapClient.cpp
+
+USERINCLUDE   ..\inc
+USERINCLUDE   ..\..\inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgsrvnstore/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/base/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/email/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/sms/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/tools/spoofserver/inc
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_ESTLIB_SYSTEMINCLUDE  
+LIBRARY     	euser.lib
+LIBRARY		testexecuteutils.lib
+LIBRARY		testexecutelogclient.lib
+LIBRARY		msgs.lib efsrv.lib etext.lib imcm.lib bafl.lib charconv.lib
+LIBRARY		EmailTestUtils.lib MsvTestUtils.lib imut.lib insock.lib esock.lib estor.lib Spoofserver.lib
+
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/group/T_IMPS01.mmp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,42 @@
+// Copyright (c) 2006-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:
+//
+
+TARGET        t_imps01.exe
+TARGETTYPE    exe
+
+CAPABILITY NetworkServices LocalServices ReadUserData ReadDeviceData WriteDeviceData NetworkControl ProtServ
+
+SOURCEPATH	..\src
+SOURCE        T_IMPS01.CPP T_LOG.CPP
+USERINCLUDE   ..\inc
+USERINCLUDE   ..\..\inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgsrvnstore/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/base/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/email/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/sms/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/tools/spoofserver/inc
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_ESTLIB_SYSTEMINCLUDE  
+
+LIBRARY       euser.lib etext.lib efsrv.lib msgs.lib imcm.lib logcli.lib
+LIBRARY		EmailTestUtils.lib MsvTestUtils.lib bafl.lib 
+
+EPOCSTACKSIZE 0x4000
+
+UID    0x1000007a 0x1000484B
+VENDORID 0x70000001
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/group/T_IMPSSECURESOCKET.mmp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,40 @@
+/*
+* 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:
+*
+*/
+
+TARGET        t_impssecuresocket.exe
+TARGETTYPE    exe
+
+CAPABILITY All -TCB
+SOURCEPATH	..\src
+SOURCE        t_impssecuresocket.CPP 
+USERINCLUDE   ..\inc
+USERINCLUDE   ..\..\inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgsrvnstore/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/base/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/email/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/sms/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/tools/spoofserver/inc
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_ESTLIB_SYSTEMINCLUDE  
+LIBRARY       euser.lib efsrv.lib msgs.lib imcm.lib 
+LIBRARY		EmailTestUtils.lib MsvTestUtils.lib  securesocket.lib bafl.lib
+EPOCSTACKSIZE 0x4000
+
+VENDORID 0x70000001
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/group/T_INC083099_Enquire_Email_Structure.mmp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,52 @@
+
+// Copyright (c) 2006-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:
+// T_INC083099_ENQUIRE_EMAIL__STRUCTURE.MMP
+// 
+//
+
+
+
+TARGET       T_INC083099_Enquire_Email_Structure.exe
+TARGETTYPE    exe
+
+CAPABILITY All -TCB
+
+
+TARGETPATH      \system\libs
+
+UID             0x10003C5E 0x10003C4E
+
+VENDORID 0x70000001
+
+SOURCEPATH      ..\src
+SOURCE	           T_INC083099_Enquire_Email_Structure.cpp
+
+USERINCLUDE		..\..\inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgsrvnstore/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/base/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/email/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/sms/inc
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
+
+LIBRARY         euser.lib efsrv.lib msgs.lib 
+
+LIBRARY       imut.lib imcm.lib imps.lib  etext.lib  
+LIBRARY			EmailTestUtils.lib MsvTestUtils.lib	bafl.lib charconv.lib 
+
+
+
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/group/T_ImapBadlyFormedAddress.iby	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,27 @@
+/*
+* 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 __T_IMAPBADLYFORMEDADDRESS__
+#define __T_IMAPBADLYFORMEDADDRESS__
+
+file=ABI_DIR\BUILD_DIR\T_ImapBadlyFormedAddress.exe	System\bin\T_ImapBadlyFormedAddress.exe 
+
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\T_ImapBadlyFormedAddress.script msgtest\imap\T_ImapBadlyFormedAddress.script
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\ImapBadlyFormedAddress.txt msgtest\imap\ImapBadlyFormedAddress.txt
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\ImapBadlyFormedAddress.ini msgtest\imap\ImapBadlyFormedAddress.ini
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/group/T_ImapBadlyFormedAddress.mmp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,46 @@
+// Copyright (c) 2006-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:
+//
+
+TARGET      T_ImapBadlyFormedAddress.exe 
+TARGETTYPE  exe
+UID         0x1000007A 0x101F777E
+VENDORID    0x70000001
+
+
+CAPABILITY All -TCB
+
+SOURCEPATH  ..\src
+SOURCE		T_ImapBadlyFormedAddressServer.cpp
+SOURCE		T_ImapBadlyFormedAddressStep.cpp
+SOURCE		T_ImapBadlyFormedAddressClient.cpp
+
+USERINCLUDE   ..\inc
+USERINCLUDE   ..\..\inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgsrvnstore/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/base/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/email/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/sms/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/tools/spoofserver/inc
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_ESTLIB_SYSTEMINCLUDE  
+
+LIBRARY     euser.lib
+LIBRARY		testexecuteutils.lib
+LIBRARY		testexecutelogclient.lib
+LIBRARY		msgs.lib efsrv.lib etext.lib imcm.lib bafl.lib
+LIBRARY		EmailTestUtils.lib MsvTestUtils.lib imut.lib insock.lib esock.lib estor.lib Spoofserver.lib
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/group/T_ImapNewMsgDuringSyncIdleCancel.iby	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,27 @@
+/*
+* 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 __T_IMAPNEWMSGDURINGSYNCIDLECANCEL__
+#define __T_IMAPNEWMSGDURINGSYNCIDLECANCEL__
+
+file=ABI_DIR\BUILD_DIR\T_ImapNewMsgDuringSyncIdleCancel.exe	System\bin\T_ImapNewMsgDuringSyncIdleCancel.exe 
+
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\T_ImapNewMsgDuringSyncIdleCancel.script msgtest\imap\T_ImapNewMsgDuringSyncIdleCancel.script
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\ImapNewMsgDuringSyncIdleCancel.txt msgtest\imap\ImapNewMsgDuringSyncIdleCancel.txt
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\ImapNewMsgDuringSyncIdleCancel.ini msgtest\imap\ImapNewMsgDuringSyncIdleCancel.ini
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/group/T_ImapNewMsgDuringSyncIdleCancel.mmp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,47 @@
+// Copyright (c) 2005-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:
+// Using relative paths for sourcepath and user includes
+// 
+//
+
+TARGET      T_ImapNewMsgDuringSyncIdleCancel.exe 
+TARGETTYPE  exe
+UID         0x1000007A 0x101F777E
+VENDORID    0x70000001
+
+
+CAPABILITY All -TCB
+
+SOURCEPATH  ..\src
+SOURCE		T_ImapNewMsgDuringSyncIdleCancelServer.cpp
+SOURCE		T_ImapNewMsgDuringSyncIdleCancelStep.cpp
+SOURCE		T_ImapNewMsgDuringSyncIdleCancelClient.cpp
+
+USERINCLUDE   ..\inc
+USERINCLUDE   ..\..\inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgsrvnstore/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/base/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/email/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/sms/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/tools/spoofserver/inc
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_ESTLIB_SYSTEMINCLUDE  
+LIBRARY     euser.lib
+LIBRARY		testexecuteutils.lib
+LIBRARY		testexecutelogclient.lib
+LIBRARY		msgs.lib efsrv.lib etext.lib imcm.lib bafl.lib
+LIBRARY		EmailTestUtils.lib MsvTestUtils.lib imut.lib insock.lib esock.lib estor.lib Spoofserver.lib
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/group/T_PARSE_UTC_IMAP.iby	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,32 @@
+/*
+* 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 __T_PARSE_UTC_IMAP__
+#define __T_PARSE_UTC_IMAP__
+
+file=ABI_DIR\BUILD_DIR\T_ImapParseUtcServer.exe	System\bin\T_ImapParseUtcServer.exe
+
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\T_PARSE_UTC_IMAP.script msgtest\imap\T_PARSE_UTC_IMAP.script
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\multipleReceived.txt msgtest\imap\multipleReceived.txt
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\NoReceived.txt msgtest\imap\NoReceived.txt
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\noReceivednoDate.txt msgtest\imap\noReceivednoDate.txt
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\EmbeddedMsg.txt msgtest\imap\EmbeddedMsg.txt
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\EmbeddedMsgNoReceived.txt msgtest\imap\EmbeddedMsgNoReceived.txt
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\EmbeddedMsgNoReceivedNoDate.txt msgtest\imap\EmbeddedMsgNoReceivedNoDate.txt
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\ImapUTCTest.ini msgtest\imap\ImapUTCTest.ini
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/group/T_PARSE_UTC_IMAP.mmp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,56 @@
+// Copyright (c) 2004-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:
+// T_ImapParseUtcServer.mmp
+// Using relative paths for sourcepath and user includes
+// 
+//
+
+#if (defined WINS && !defined EKA2)
+TARGET      T_ImapParseUtcServer.dll
+TARGETTYPE  dll
+UID             0x1000008d 0x101F777E
+VENDORID 0x70000001
+#else
+TARGET       T_ImapParseUtcServer.exe
+TARGETTYPE  exe
+UID             0x1000007A 0x101F777E
+VENDORID 0x70000001
+#endif
+
+CAPABILITY All -TCB
+
+SOURCEPATH  ..\src
+SOURCE		T_PARSE_UTC_IMAPServer.cpp
+SOURCE		T_PARSE_UTC_IMAPStep.cpp
+SOURCE		ImapSpoofServer.cpp
+SOURCE		IMapClient.cpp
+SOURCE		ScriptFileProcessor.cpp
+
+USERINCLUDE   ..\..\inc
+USERINCLUDE   ..\inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgsrvnstore/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/base/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/email/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/sms/inc
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_ESTLIB_SYSTEMINCLUDE  
+LIBRARY     euser.lib
+LIBRARY		testexecuteutils.lib
+LIBRARY		testexecutelogclient.lib
+LIBRARY		msgs.lib efsrv.lib etext.lib imcm.lib bafl.lib
+LIBRARY		EmailTestUtils.lib MsvTestUtils.lib imut.lib insock.lib esock.lib estor.lib
+
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/group/T_PartialDownloadSpoofServer.iby	Mon May 03 12:29:07 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:
+*
+*/
+
+#ifndef __T_SPOOFSERVER__
+#define __T_SPOOFSERVER__
+
+file=ABI_DIR\BUILD_DIR\T_PartialDownLoadSpoofServer.exe	System\bin\T_PartialDownLoadSpoofServer.exe
+
+data=EPOCROOT##Epoc32\winscw\c\msgtest\imap\T_PartialDownload.script msgtest\imap\T_PartialDownload.script
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/group/T_PartialDownloadSpoofServer.mmp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,48 @@
+// Copyright (c) 2005-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:
+// Using relative paths for sourcepath and user includes
+// 
+//
+
+TARGET       T_PartialDownloadSpoofServer.exe
+TARGETTYPE  exe
+UID             0x1000007A 0x101F777E
+VENDORID 0x70000001
+
+
+CAPABILITY All -TCB
+
+SOURCEPATH  ..\src
+SOURCE		T_PartialDownLoadSpoofServer.cpp
+SOURCE		T_PartialDownLoadStep.cpp
+SOURCE		T_PartialDownLoadImapClient.cpp
+
+USERINCLUDE   ..\inc
+USERINCLUDE   ..\..\inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgsrvnstore/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/base/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/email/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/sms/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/tools/spoofserver/inc
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_ESTLIB_SYSTEMINCLUDE  
+LIBRARY     	euser.lib
+LIBRARY		testexecuteutils.lib
+LIBRARY		testexecutelogclient.lib
+LIBRARY		msgs.lib efsrv.lib etext.lib imcm.lib bafl.lib
+LIBRARY		EmailTestUtils.lib MsvTestUtils.lib imut.lib insock.lib esock.lib estor.lib Spoofserver.lib
+
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/group/T_imapIO.mmp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,38 @@
+/*
+* 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:
+*
+*/
+
+TARGET        T_imapIO.EXE
+TARGETTYPE    exe
+
+CAPABILITY All -TCB
+SOURCEPATH	..\src
+SOURCE        T_imapIO.CPP ..\..\src\imapio.cpp
+USERINCLUDE   ..\inc
+USERINCLUDE   ..\..\inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgsrvnstore/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/base/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/email/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/server/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/sms/inc
+USERINCLUDE		../../../../../../../mw/messagingmw/messagingfw/msgtest/tools/spoofserver/inc
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_ESTLIB_SYSTEMINCLUDE  
+LIBRARY       euser.lib imut.lib imcm.lib msgs.lib emailtestutils.lib msvtestutils.lib
+
+VENDORID 0x70000001
+
+SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/group/bld.inf	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,134 @@
+// Copyright (c) 2005-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:
+//
+
+
+PRJ_TESTMMPFILES
+
+t_imps01.mmp	manual
+t_dump.mmp	manual
+t_impssecuresocket.mmp  manual
+t_imapio.mmp  manual
+T_PARSE_UTC_IMAP.mmp manual
+t_decodeserver.mmp manual
+T_DEF062024_IMAP_ATTACHMENTCANNOTBEOPENED.mmp manual
+T_PartialDownloadSpoofServer.mmp manual
+T_DEF059571_IMAP_MISSINGOFFSET.mmp manual
+T_ImapNewMsgDuringSyncIdleCancel.mmp manual
+T_ImapBadlyFormedAddress.mmp manual
+T_DEF079867_OfflineDelete.mmp manual
+T_DEF075510_Offline_Populate.mmp  manual 
+T_INC083099_Enquire_Email_Structure.mmp
+T_ConnectAndSyncAfterDisconnect.mmp manual
+
+PRJ_TESTEXPORTS
+
+..\scripts\T_PARSE_UTC_IMAP.script				\epoc32\wins\c\msgtest\imap\T_PARSE_UTC_IMAP.script
+..\scripts\T_PARSE_UTC_IMAP.script				\epoc32\winscw\c\msgtest\imap\T_PARSE_UTC_IMAP.script
+
+..\scripts\T_IMAP_DECODE.script				\epoc32\wins\c\msgtest\imap\T_IMAP_DECODE.script
+..\scripts\T_IMAP_DECODE.script				\epoc32\winscw\c\msgtest\imap\T_IMAP_DECODE.script
+
+..\data\multipleReceived.txt					\epoc32\wins\c\msgtest\imap\multipleReceived.txt
+..\data\multipleReceived.txt					\epoc32\winscw\c\msgtest\imap\multipleReceived.txt
+
+..\data\NoReceived.txt						\epoc32\wins\c\msgtest\imap\NoReceived.txt
+..\data\NoReceived.txt						\epoc32\winscw\c\msgtest\imap\NoReceived.txt
+
+..\data\noReceivednoDate.txt					\epoc32\wins\c\msgtest\imap\noReceivednoDate.txt
+..\data\noReceivednoDate.txt					\epoc32\winscw\c\msgtest\imap\noReceivednoDate.txt
+
+..\data\EmbeddedMsg.txt						\epoc32\wins\c\msgtest\imap\EmbeddedMsg.txt
+..\data\EmbeddedMsg.txt						\epoc32\winscw\c\msgtest\imap\EmbeddedMsg.txt
+
+..\data\EmbeddedMsgNoReceived.txt				\epoc32\wins\c\msgtest\imap\EmbeddedMsgNoReceived.txt
+..\data\EmbeddedMsgNoReceived.txt				\epoc32\winscw\c\msgtest\imap\EmbeddedMsgNoReceived.txt
+
+..\data\EmbeddedMsgNoReceivedNoDate.txt				\epoc32\wins\c\msgtest\imap\EmbeddedMsgNoReceivedNoDate.txt
+..\data\EmbeddedMsgNoReceivedNoDate.txt				\epoc32\winscw\c\msgtest\imap\EmbeddedMsgNoReceivedNoDate.txt
+
+..\data\mail1_Base64.txt					\epoc32\wins\c\msgtest\imap\mail1_Base64.txt
+..\data\mail1_Base64.txt					\epoc32\winscw\c\msgtest\imap\mail1_Base64.txt
+
+..\data\mail1_Base64_body.txt					\epoc32\wins\c\msgtest\imap\mail1_Base64_body.txt
+..\data\mail1_Base64_body.txt					\epoc32\winscw\c\msgtest\imap\mail1_Base64_body.txt
+
+..\data\mail2_Base64.txt					\epoc32\wins\c\msgtest\imap\mail2_Base64.txt
+..\data\mail2_Base64.txt					\epoc32\winscw\c\msgtest\imap\mail2_Base64.txt
+
+..\data\mail2_Base64_body.txt					\epoc32\wins\c\msgtest\imap\mail2_Base64_body.txt
+..\data\mail2_Base64_body.txt					\epoc32\winscw\c\msgtest\imap\mail2_Base64_body.txt
+
+..\data\mail1_UUEncoded.txt					\epoc32\wins\c\msgtest\imap\mail1_UUEncoded.txt
+..\data\mail1_UUEncoded.txt					\epoc32\winscw\c\msgtest\imap\mail1_UUEncoded.txt
+
+..\data\mail1_UUEncoded_body.txt				\epoc32\wins\c\msgtest\imap\mail1_UUEncoded_body.txt
+..\data\mail1_UUEncoded_body.txt				\epoc32\winscw\c\msgtest\imap\mail1_UUEncoded_body.txt
+
+..\data\mail1_UUEncoded_attachment.jpg				\epoc32\wins\c\msgtest\imap\mail1_UUEncoded_attachment.jpg
+..\data\mail1_UUEncoded_attachment.jpg				\epoc32\winscw\c\msgtest\imap\mail1_UUEncoded_attachment.jpg
+
+..\data\ImapUTCTest.ini						\epoc32\wins\c\msgtest\imap\ImapUTCTest.ini
+..\data\ImapUTCTest.ini						\epoc32\winscw\c\msgtest\imap\ImapUTCTest.ini
+
+..\data\ImapDecode.ini						\epoc32\wins\c\msgtest\imap\ImapDecode.ini
+..\data\ImapDecode.ini						\epoc32\winscw\c\msgtest\imap\ImapDecode.ini
+
+
+..\Group\T_PARSE_UTC_IMAP.iby   				\epoc32\rom\include\T_PARSE_UTC_IMAP.iby
+..\Group\T_DecodeServer.iby   					\epoc32\rom\include\T_DecodeServer.iby
+
+//Test harness for defect DEF062024
+..\scripts\T_DEF062024_IMAP_ATTACHMENTCANNOTBEOPENED.script	\epoc32\winscw\c\msgtest\imap\T_DEF062024_IMAP_ATTACHMENTCANNOTBEOPENED.script
+..\data\ImapGetMailAndAttachment.txt				\epoc32\winscw\c\msgtest\imap\ImapGetMailAndAttachment.txt
+..\data\ImapAttachmentTest.ini					\epoc32\winscw\c\msgtest\imap\ImapAttachmentTest.ini
+..\Group\T_DEF062024_IMAP_ATTACHMENTCANNOTBEOPENED.iby   	\epoc32\rom\include\T_DEF062024_IMAP_ATTACHMENTCANNOTBEOPENED.iby
+
+..\scripts\T_PartialDownload.script				\epoc32\wins\c\msgtest\imap\T_PartialDownload.script
+..\scripts\T_PartialDownload.script				\epoc32\winscw\c\msgtest\imap\T_PartialDownload.script
+
+..\data\partialDownload.txt					\epoc32\wins\c\msgtest\imap\partialDownload.txt
+..\data\partialDownload.txt					\epoc32\winscw\c\msgtest\imap\partialDownload.txt
+
+// test harness exports for DEF059571
+..\scripts\T_DEF059571_IMAP_MISSINGOFFSET.script		\epoc32\wins\c\msgtest\imap\T_DEF059571_IMAP_MISSINGOFFSET.script
+..\scripts\T_DEF059571_IMAP_MISSINGOFFSET.script		\epoc32\winscw\c\msgtest\imap\T_DEF059571_IMAP_MISSINGOFFSET.script
+
+..\data\ImapMissingOffset.txt					\epoc32\wins\c\msgtest\imap\ImapMissingOffset.txt
+..\data\ImapMissingOffset.txt					\epoc32\winscw\c\msgtest\imap\ImapMissingOffset.txt
+
+..\data\ImapMissingOffsetTest.ini				\epoc32\wins\c\msgtest\imap\ImapMissingOffsetTest.ini
+..\data\ImapMissingOffsetTest.ini				\epoc32\winscw\c\msgtest\imap\ImapMissingOffsetTest.ini
+
+// Test harness exports for test of receiving new messages indications while synchronise command is cancelling IMAP idle
+
+..\scripts\T_ImapNewMsgDuringSyncIdleCancel.script		\epoc32\wins\c\msgtest\imap\T_ImapNewMsgDuringSyncIdleCancel.script
+..\scripts\T_ImapNewMsgDuringSyncIdleCancel.script		\epoc32\winscw\c\msgtest\imap\T_ImapNewMsgDuringSyncIdleCancel.script
+
+..\data\ImapNewMsgDuringSyncIdleCancel.txt			\epoc32\wins\c\msgtest\imap\ImapNewMsgDuringSyncIdleCancel.txt
+..\data\ImapNewMsgDuringSyncIdleCancel.txt			\epoc32\winscw\c\msgtest\imap\ImapNewMsgDuringSyncIdleCancel.txt
+
+..\data\ImapNewMsgDuringSyncIdleCancelTest.ini		\epoc32\wins\c\msgtest\imap\ImapNewMsgDuringSyncIdleCancelTest.ini
+..\data\ImapNewMsgDuringSyncIdleCancelTest.ini		\epoc32\winscw\c\msgtest\imap\ImapNewMsgDuringSyncIdleCancelTest.ini
+
+// Test harness exports for test of receiving mail with badly formed email address
+
+..\scripts\T_ImapBadlyFormedAddress.script	\epoc32\wins\c\msgtest\imap\T_ImapBadlyFormedAddress.script
+..\scripts\T_ImapBadlyFormedAddress.script	\epoc32\winscw\c\msgtest\imap\T_ImapBadlyFormedAddress.script
+
+..\data\ImapBadlyFormedAddress.txt	\epoc32\wins\c\msgtest\imap\ImapBadlyFormedAddress.txt
+..\data\ImapBadlyFormedAddress.txt	\epoc32\winscw\c\msgtest\imap\ImapBadlyFormedAddress.txt
+
+..\data\ImapBadlyFormedAddressTest.ini	\epoc32\wins\c\msgtest\imap\ImapBadlyFormedAddressTest.ini
+..\data\ImapBadlyFormedAddressTest.ini	\epoc32\winscw\c\msgtest\imap\ImapBadlyFormedAddressTest.ini
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/DecodeIMapClient.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,91 @@
+// Copyright (c) 2005-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:
+// imapclient.h
+// 
+//
+
+#ifndef __IMAPCLIENT_H__
+#define __IMAPCLIENT_H__
+
+#include <e32cons.h>
+#include <e32const.h>
+#include <in_sock.h>
+#include <nifman.h>
+#include "emailtestutils.h"
+#include <iapprefs.h>
+#include <cemailaccounts.h>
+#include "impsmtm.h"
+#include <imapconnectionobserver.h>
+#include "cspoofserver.h"
+
+// For loading the serial comms device drivers 
+#if defined (__WINS__)
+	#define PDD_NAME		_L("ECDRV")
+	#define LDD_NAME		_L("ECOMM")
+#else
+	#define PDD_NAME		_L("EUART1")
+	#define LDD_NAME		_L("ECOMM")
+#endif
+
+class TDummySessionObserver : public CBase , public MMsvSessionObserver
+	{
+public:
+	void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
+	};
+
+class CActiveImapClient : public CActive , public MMsvImapConnectionObserver
+	{
+
+public:
+	
+	IMPORT_C static CActiveImapClient* NewL(MImapTestEventHandler* aOwner,TBool aFetchWholeMessage);
+	IMPORT_C static CActiveImapClient* NewLC(MImapTestEventHandler* aOwner,TBool aFetchWholeMessage);
+	void StartL();
+	void CreateImapAccountL();
+	~CActiveImapClient();
+	TImapAccount GetAccount();
+
+private:
+	CActiveImapClient();
+	IMPORT_C void ConstructL(MImapTestEventHandler* aOwner,TBool aFetchWholeMessage);
+	virtual void DoCancel();
+	virtual void RunL();
+	virtual TInt RunError(TInt aError);
+	
+	//implementation of pure virtual inherited from MMsvImapConnectionObserver 
+	virtual void HandleImapConnectionEvent(TImapConnectionEvent aConnectionState);
+private:
+
+	enum TIMAPClientState 
+		{
+		EFetch=0,	
+		EDisconnect, 
+		EComplete
+		};
+		
+	CEmailAccounts* iAccounts;
+	TImapAccount iImapAccount;
+	CImap4ServerMtm* iImapServerMtm;
+	CMsvSession* iSession;
+	CBaseMtm* iClientMtm;
+	CClientMtmRegistry*	iClientRegistry;
+	TDummySessionObserver*	iSessionObserver;
+	CMsvOperation* iMsvOperation;
+	TIMAPClientState iNextStep;
+	CMsvEntrySelection* iSelection;
+	TBool iFetchWholeMessage;
+	MImapTestEventHandler* iOwner;
+	};
+
+#endif  //__IMAPCLIENT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/EventHandler.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,26 @@
+// Copyright (c) 2005-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 __EVENTHANDLER_H__
+#define __EVENTHANDLER_H__
+
+class MImapTestEventHandler
+	{
+public:
+	virtual void HandleEvent(TInt aEventCode)=0;
+	};
+	
+#endif //__EVENTHANDLER_H__
+	
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/IMapClient.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,87 @@
+// Copyright (c) 2005-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 __IMAPCLIENT_H__
+#define __IMAPCLIENT_H__
+
+#include <e32cons.h>
+#include <e32const.h>
+#include <in_sock.h>
+#include <nifman.h>
+#include "emailtestutils.h"
+#include <iapprefs.h>
+#include <cemailaccounts.h>
+#include "impsmtm.h"
+#include <imapconnectionobserver.h>
+#include "eventhandler.h"
+
+// For loading the serial comms device drivers 
+#if defined (__WINS__)
+	#define PDD_NAME		_L("ECDRV")
+	#define LDD_NAME		_L("ECOMM")
+#else
+	#define PDD_NAME		_L("EUART1")
+	#define LDD_NAME		_L("ECOMM")
+#endif
+
+class TDummySessionObserver : public CBase , public MMsvSessionObserver
+	{
+public:
+	void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
+	};
+
+class CActiveImapClient : public CActive , public MMsvImapConnectionObserver
+	{
+
+public:
+	
+	IMPORT_C static CActiveImapClient* NewL(MImapTestEventHandler* aOwner,TBool aFetchWholeMessage);
+	IMPORT_C static CActiveImapClient* NewLC(MImapTestEventHandler* aOwner,TBool aFetchWholeMessage);
+	void StartL();
+	void CreateImapAccountL();
+	~CActiveImapClient();
+	TImapAccount GetAccount();
+
+private:
+	CActiveImapClient();
+	IMPORT_C void ConstructL(MImapTestEventHandler* aOwner,TBool aFetchWholeMessage);
+	virtual void DoCancel();
+	virtual void RunL();
+	virtual TInt RunError(TInt aError);
+	
+	//implementation of pure virtual inherited from MMsvImapConnectionObserver 
+	virtual void HandleImapConnectionEvent(TImapConnectionEvent aConnectionState);
+private:
+
+	enum TIMAPClientState 
+		{
+		EFetch,	EDisconnect , EComplete
+		};
+		
+	CEmailAccounts* iAccounts;
+	TImapAccount iImapAccount;
+	CImap4ServerMtm* iImapServerMtm;
+	CMsvSession* iSession;
+	CBaseMtm* iClientMtm;
+	CClientMtmRegistry*	iClientRegistry;
+	TDummySessionObserver*	iSessionObserver;
+	CMsvOperation* iMsvOperation;
+	TIMAPClientState iNextStep;
+	CMsvEntrySelection* iSelection;
+	TBool iFetchWholeMessage;
+	MImapTestEventHandler* iOwner;
+	};
+
+#endif  //__IMAPCLIENT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/ImapSpoofServer.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,74 @@
+// Copyright (c) 2005-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:
+// imapserver.h
+// 
+//
+
+#ifndef __IMAPSPOOFSERVER_H__
+#define __IMAPSPOOFSERVER_H__
+
+#include <e32cons.h>
+#include <e32const.h>
+#include <in_sock.h>
+#include <nifman.h>
+#include "scriptfileprocessor.h"
+#include "eventhandler.h"
+
+// Definitions
+const TInt KMaxBufferSize = 2048;
+const TInt KListeningSocketQueueSize = 1;
+
+//
+// CImapSpoofServer
+//
+
+class CImapSpoofServer : public CActive 
+	{
+
+public:
+	
+	IMPORT_C static CImapSpoofServer* NewL(MImapTestEventHandler* aOwner,const TDesC& aScriptFile);
+	IMPORT_C static CImapSpoofServer* NewLC(MImapTestEventHandler* aOwner,const TDesC& aScriptFile);
+	void StartL();
+	~CImapSpoofServer();
+private:
+	CImapSpoofServer();
+	void ConstructL(MImapTestEventHandler* aOwner,const TDesC& aScriptFile);
+	void IssueWrite();
+	void IssueRead();
+	//Implemented functions from CActive
+	virtual void DoCancel();
+	virtual void RunL();
+	virtual IMPORT_C TInt RunError(TInt aError);
+
+private:
+
+	enum TIMAPServerState 
+		{
+		EIdle, EWriting, EReading
+		};
+		
+	TIMAPServerState iServerStatus;
+	RSocket iListeningSocket;
+	RSocket iServiceSocket;
+	RSocketServ iSocketServer;
+	TBuf8<KMaxBufferSize> iBuffer; 
+	TBuf8<KMaxBufferSize> iNextLine;
+	TSockXfrLength iReadLength;
+	CScriptFileProcessor* iScriptFileProcessor;
+	MImapTestEventHandler* iOwner;
+	};
+
+#endif  //__IMAPSPOOFSERVER_H__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/ScriptFileProcessor.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,52 @@
+// Copyright (c) 2005-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 __SCRIPTFILEPROCESSOR_H__
+#define __SCRIPTFILEPROCESSOR_H__
+
+#include <e32cons.h>
+#include <s32file.H>
+
+//
+// CScriptFileProcessor
+//
+ 
+class CScriptFileProcessor : public CBase
+	{	
+public:	
+
+	enum TDataDirection 
+		{
+		EFromServer, EFromClient
+		};	
+
+	static CScriptFileProcessor* NewL(const TDesC& aScriptFile);
+	static CScriptFileProcessor* NewLC(const TDesC& aScriptFile);
+	~CScriptFileProcessor();
+	TInt ReadLine(TDes8& aLine);
+	CScriptFileProcessor::TDataDirection DataDirection()const;
+private:
+	CScriptFileProcessor();	
+	void ConstructL(const TDesC& aScriptFile);
+	TInt ProcessLine(TDes8& aLine);
+private:
+	RFileReadStream iFileReadStream;
+	RFs iFSession;
+	RFile iFile;
+	TDataDirection iDataDirection;
+	};
+
+
+#endif //__SCRIPTFILEPROCESSOR_H__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/TESTENV.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,78 @@
+// Copyright (c) 1996-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 _TESTENV_H_
+#define _TESTENV_H_
+
+#include <e32std.h>
+#include <e32test.h>
+#include <c32comm.h>
+#include <in_sock.h>
+
+extern RTest Test;
+extern RSocketServ SocketServer;
+extern RHeap* TestHeap;
+
+const TInt KEchoPort = 7;
+const TInt KChargenPort = 19;
+const TInt KDiscardPort = 9;
+const TInt KTestPort = 9;
+
+const TInt KSmallBufSize = 256;
+const TInt KLargeBufSize = 2048;
+const TInt KHugeBufSize = 16384;
+
+typedef TBuf8<KSmallBufSize> TSmallBuf;
+typedef TBuf8<KLargeBufSize> TLargeBuf;
+typedef TBuf8<KHugeBufSize> THugeBuf;
+
+
+void CommInitL(TBool aEnhanced);
+TInt AsyncStart();
+
+#define TEST(a) DoTest((a), __FILE__, __LINE__, 0)
+#define TESTE(a,b) DoTest((a), __FILE__, __LINE__, b)
+void WaitKey();
+void DoTest(TBool aCondition, char* aFile, TInt aLine, TInt aErr);
+
+void SockStart();
+void SockClose();
+
+#define IPADDR(a,b,c,d) (TUint32)(((a)<<24)|((b)<<16)|((c)<<8)|(d))
+
+
+void StripeMem(TUint8 *aBuf, TInt aStartPos, TInt anEndPos, TUint aStartChar, TUint anEndChar, TInt aOffset=0);
+void StripeDes(TDes8 &aBuf, TInt aStartPos, TInt anEndPos, TUint aStartChar, TUint anEndChar, TInt aOffset=0);
+TBool CheckMem(TUint8 *aBuf, TInt aStartPos, TInt anEndPos, TUint aStartChar, TUint anEndChar, TInt aOffset=0);
+TBool CheckDes(TDes8 &aBuf, TInt aStartPos, TInt anEndPos, TUint aStartChar, TUint anEndChar, TInt aOffset=0);
+void StripeMem32(TUint *aBuf, TInt aStartPos, TInt aEndPos);
+void StripeDes32(TDes8 &aBuf, TInt aStartPos, TInt anEndPos);
+
+
+class TIoBuf : public TPtr8
+	{
+public:
+	TIoBuf();
+	~TIoBuf();
+	TInt Alloc(TUint aSize);
+	};
+
+void OutputInetAddr(TDes& aBuf, TUint32 aAddr);
+void GetHostByName(TNameRecord& aRecord, const TDesC& aHost);
+void GetHostByAddr(TNameRecord& aRecord, const TInetAddr& aAddr);
+void GetHostName(THostName& aName);
+void GetHostAddr(TInetAddr& aAddr);
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/T_DEF059571_IMAP_Client.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,89 @@
+// Copyright (c) 2005-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 __T_DEF059571_IMAPCLIENT_H__
+#define __T_DEF059571_IMAPCLIENT_H__
+
+#include <e32cons.h>
+#include <e32const.h>
+#include <in_sock.h>
+#include <nifman.h>
+#include "emailtestutils.h"
+#include <iapprefs.h>
+#include <cemailaccounts.h>
+#include "impsmtm.h"
+#include <imapconnectionobserver.h>
+#include "cspoofserver.h"
+
+// For loading the serial comms device drivers 
+#if defined (__WINS__)
+	#define PDD_NAME		_L("ECDRV")
+	#define LDD_NAME		_L("ECOMM")
+#else
+	#define PDD_NAME		_L("EUART1")
+	#define LDD_NAME		_L("ECOMM")
+#endif
+
+class TDummySessionObserver : public CBase , public MMsvSessionObserver
+	{
+public:
+	void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
+	};
+
+class CActiveImapClient : public CActive , public MMsvImapConnectionObserver
+	{
+
+public:
+	
+	IMPORT_C static CActiveImapClient* NewL(MImapTestEventHandler* aOwner);
+	IMPORT_C static CActiveImapClient* NewLC(MImapTestEventHandler* aOwner);
+	void StartL();
+	void CreateImapAccountL();
+	~CActiveImapClient();
+	TImapAccount GetImapAccount();
+
+private:
+	CActiveImapClient(MImapTestEventHandler* aOwner);
+	void ConstructL();
+
+	// From CActive
+	virtual void DoCancel();
+	virtual void RunL();
+	virtual TInt RunError(TInt aError);
+	
+	//implementation of pure virtual inherited from MMsvImapConnectionObserver 
+	virtual void HandleImapConnectionEvent(TImapConnectionEvent aConnectionState);
+private:
+
+	enum TIMAPClientState 
+		{
+		EFetch = 0,	
+		EDisconnect, 
+		EComplete
+		};
+		
+	CEmailAccounts* iAccounts;
+	TImapAccount iImapAccount;
+	CMsvSession* iSession;
+	CBaseMtm* iClientMtm;
+	CClientMtmRegistry*	iClientRegistry;
+	TDummySessionObserver*	iSessionObserver;
+	CMsvOperation* iMsvOperation;
+	TIMAPClientState iNextStep;
+	CMsvEntrySelection* iSelection;
+	MImapTestEventHandler* iOwner;
+	};
+
+#endif  //__T_DEF059571_IMAPCLIENT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/T_DEF059571_IMAP_MissingOffsetServer.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,40 @@
+// Copyright (c) 2005-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:
+// t_def057591_imap_missingoffsetserver.h
+// 
+//
+
+#ifndef __T_DEF057591_IMAP_MISSINGOFFSETSERVER_H__
+#define __T_DEF057591_IMAP_MISSINGOFFSETSERVER_H__
+
+#include <testexecuteserverbase.h>
+ 
+//
+// CImapMissingOffsetServer
+//
+
+class CImapMissingOffsetServer : public CTestServer
+	{
+public:
+	static CImapMissingOffsetServer* NewL();
+	~CImapMissingOffsetServer();
+	virtual CTestStep* CreateTestStep(const TDesC& aStepName);
+	RFs& Fs();	
+private:
+	CImapMissingOffsetServer();
+private:
+	RFs iFs;
+	};
+
+#endif  //__T_DEF057591_IMAP_MISSINGOFFSETSERVER_H__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/T_DEF059571_IMAP_MissingOffsetStep.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,79 @@
+// Copyright (c) 2005-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 __T_DEF059571_IMAP_MISSINGOFFSETSTEP_H__
+#define __T_DEF059571_IMAP_MISSINGOFFSETSTEP_H__
+ 
+#include <test\testexecutestepbase.h>
+#include "emailtestutils.h"
+#include "smstestutils.h"
+#include <stdlib.h>
+#include <msvapi.h>
+#include <smuthdr.h> 
+#include <iapprefs.h>
+#include "t_def059571_imap_missingoffsetserver.h"
+#include "t_def059571_imap_client.h"
+
+/**
+@SYMTestCaseID DEF059571
+@SYMTestType UT
+@SYMTestPriority High
+@SYMDEF DEF059571
+@SYMTestCaseDependencies SpoofServer.dll
+@SYMTestCaseDesc IMAP Test of fetch response with no offset parameter and html content
+@SYMTestActions 
+Downloads an email message from spoof server simulating a fetch response with no offset 
+parameter and HTML content bodytext, 1st character of which is "<"
+Verifies that the messages where successfully fetched.
+@SYMTestExpectedResults The message should be correctly fetched.
+*/
+
+//
+// CTestImapMissingOffsetStep
+//
+
+class CTestImapMissingOffsetStep : public CTestStep , MImapTestEventHandler
+	{
+public:
+	CTestImapMissingOffsetStep();
+	~CTestImapMissingOffsetStep();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+private:
+	void GetDetailsFromIniFileL();
+	void CreateImapAccountL();
+	void PrintEntryTime(TTime* aTIme);
+	TInt GetEntryCountL();
+	virtual void TestComplete(TInt aErrorCode);
+	
+private:
+	CSpoofServer* iSpoofServer;
+	CActiveImapClient* iImapClient;
+	CConsoleBase* iConsole;
+	CActiveScheduler* iScheduler;
+	TMsvId	iImapService;
+	CEmailTestUtils* iTestUtils;
+	CMsvSession* iSession;
+	TInt iMessageEntryCount;
+	TDummySessionObserver* iSessionObserver;
+	TPtrC16 iScriptFile;
+	TInt iExpectedEntryCount;
+	};
+
+ 		
+_LIT(KTestImapMissingOffset,"TestImapMissingOffset");
+	
+#endif  //__T_DEF059571_IMAP_MISSINGOFFSETSTEP_H__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/T_DEF062024_IMAP21cnServer_AttachmentCannotBeOpenedStep.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,70 @@
+// Copyright (c) 2005-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:
+// t_DEF062024_IMAP21cnServer_AttachmentCannotBeOpened.h
+// 
+//
+
+#ifndef __T_DEF062024_IMAP21CNSERVER_ATTACHMENTCANNOTBEOPENEDSTEP_H__
+#define __T_DEF062024_IMAP21CNSERVER_ATTACHMENTCANNOTBEOPENEDSTEP_H__
+ 
+#include <test\testexecutestepbase.h>
+#include "emailtestutils.h"
+#include "smstestutils.h"
+#include <stdlib.h>
+#include <msvapi.h>
+#include <smuthdr.h> 
+#include <iapprefs.h>
+#include "T_DEF062024_Imap_AttachmentCannotBeOpenedServer.h"
+#include "t_def062024_imapclient.h"
+
+//
+// CTestImapAttachmentStep
+//
+
+class CTestImapAttachmentStep : public CTestStep , MImapTestEventHandler
+	{
+public:
+	CTestImapAttachmentStep();
+	~CTestImapAttachmentStep();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+private:
+	void GetDetailsFromIniFileL();
+	void CreateImapAccountL();
+	void PrintEntryTime(TTime* aTIme);
+	TVerdict CheckAttachmentL();
+	virtual void TestComplete(TInt aErrorCode);
+	
+private:
+	CSpoofServer* iSpoofServer;
+	CActiveImapClient* iImapClient;
+	CConsoleBase* iConsole;
+	CActiveScheduler* iScheduler;
+	TMsvId	iImapService;
+	CEmailTestUtils* iTestUtils;
+	CMsvSession* iSession;
+	TInt iMessageEntryCount;
+	TDummySessionObserver* iSessionObserver;
+	TPtrC16 iScriptFile;
+	// Path of the source file originally attached to the email fetched
+	TPtrC16 iAttachmentSourcePath;
+	// Index of the attachment we want to check in this email
+	TInt iAttachmentIndex;
+	};
+
+ 		
+_LIT(KTestImapAttachment,"TestImapAttachment");
+	
+#endif  //__T_DEF062024_IMAP21CNSERVER_ATTACHMENTCANNOTBEOPENEDSTEP_H__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/T_DEF062024_IMAPClient.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,92 @@
+// Copyright (c) 2005-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 __T_DEF062024_IMAPCLIENT_H__
+#define __T_DEF062024_IMAPCLIENT_H__
+
+#include <e32cons.h>
+#include <e32const.h>
+#include <in_sock.h>
+#include <nifman.h>
+#include "emailtestutils.h"
+#include <iapprefs.h>
+#include <cemailaccounts.h>
+#include "impsmtm.h"
+#include <imapconnectionobserver.h>
+#include "cspoofserver.h"
+
+// For loading the serial comms device drivers 
+#if defined (__WINS__)
+	#define PDD_NAME		_L("ECDRV")
+	#define LDD_NAME		_L("ECOMM")
+#else
+	#define PDD_NAME		_L("EUART1")
+	#define LDD_NAME		_L("ECOMM")
+#endif
+
+class TDummySessionObserver : public CBase , public MMsvSessionObserver
+	{
+public:
+	void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
+	};
+
+class CActiveImapClient : public CActive , public MMsvImapConnectionObserver
+	{
+
+public:
+	
+	IMPORT_C static CActiveImapClient* NewL(MImapTestEventHandler& aObserver);
+	IMPORT_C static CActiveImapClient* NewLC(MImapTestEventHandler& aObserver);
+	void StartL();
+	void CreateImapAccountL();
+	~CActiveImapClient();
+	TImapAccount GetAccount();
+	// Return iMessageId, the message ID of the email being fetched with its attachment
+	TMsvId GetMessageId();
+
+private:
+	CActiveImapClient(MImapTestEventHandler& aObserver);
+	void ConstructL();
+	
+	// From CActive
+	virtual void DoCancel();
+	virtual void RunL();
+	virtual TInt RunError(TInt aError);
+	
+	//implementation of pure virtual inherited from MMsvImapConnectionObserver 
+	virtual void HandleImapConnectionEvent(TImapConnectionEvent aConnectionState);
+private:
+
+	enum TIMAPClientState 
+		{			
+		EFetch=0,
+		EDisconnect, 
+		EComplete
+		};
+		
+	CEmailAccounts* iAccounts;
+	TImapAccount iImapAccount;
+	CMsvSession* iSession;
+	CBaseMtm* iClientMtm;
+	CClientMtmRegistry*	iClientRegistry;
+	TDummySessionObserver*	iSessionObserver;
+	CMsvOperation* iMsvOperation;
+	TIMAPClientState iState;
+	CMsvEntrySelection* iSelection;
+	MImapTestEventHandler& iObserver;
+	TMsvId iMessageId;
+	};
+
+#endif  //__T_DEF062024_IMAPCLIENT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/T_DEF062024_Imap_AttachmentCannotBeOpenedServer.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,37 @@
+// Copyright (c) 2005-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 __T_DEF062024_IMAP_ATTACHMENTCANNOTBEOPENEDSERVER_H__
+#define __T_DEF062024_IMAP_ATTACHMENTCANNOTBEOPENEDSERVER_H__
+
+#include <testexecuteserverbase.h>
+ 
+//
+// ImapAttachmentServer
+//
+
+class CImapAttachmentServer : public CTestServer
+	{
+public:
+	static CImapAttachmentServer* NewL();
+	~CImapAttachmentServer();
+	virtual CTestStep* CreateTestStep(const TDesC& aStepName);
+	RFs& Fs();	
+private:
+	CImapAttachmentServer();
+private:
+	RFs iFs;
+	};
+#endif  //__T_DEF062024_IMAP_ATTACHMENTCANNOTBEOPENEDSERVER_H__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/T_DecodeServer.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,34 @@
+// Copyright (c) 2005-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 __T_DECODESERVER_H__
+#define __T_DECODESERVER_H__
+
+#include <testexecuteserverbase.h>
+ 
+//
+// ParseUTCServer
+//
+
+class CImapDecodeServer : public CTestServer
+	{
+public:
+	static CImapDecodeServer* NewL();
+	virtual CTestStep* CreateTestStep(const TDesC& aStepName);
+	RFs& Fs();	
+private:
+	RFs iFs;
+	};
+#endif  //__T_SPOOFSERVER_H__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/T_ImapBadlyFormedAddressClient.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,83 @@
+// Copyright (c) 2006-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 __T_IMAPADLYFORMEDADDRESSCLIENT_H__
+#define __T_IMAPADLYFORMEDADDRESSCLIENT_H__
+
+#include <e32base.h>
+#include <msvapi.h>
+#include <imapconnectionobserver.h>
+#include "cspoofserver.h"
+#include <cemailaccounts.h>
+
+class CClientMtmRegistry;
+
+// For loading the serial comms device drivers 
+#if defined (__WINS__)
+	#define PDD_NAME		_L("ECDRV")
+	#define LDD_NAME		_L("ECOMM")
+#else
+	#define PDD_NAME		_L("EUART1")
+	#define LDD_NAME		_L("ECOMM")
+#endif
+
+class TDummySessionObserver : public CBase, public MMsvSessionObserver
+	{
+public:
+	void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
+	};
+
+class CImapBadlyFormedAddressClient : public CActive, public MMsvImapConnectionObserver
+	{
+public:
+	IMPORT_C static CImapBadlyFormedAddressClient* NewL(MImapTestEventHandler* aOwner);
+	IMPORT_C static CImapBadlyFormedAddressClient* NewLC(MImapTestEventHandler* aOwner);
+	~CImapBadlyFormedAddressClient();
+	void StartL();
+	void CreateImapAccountL();
+	TImapAccount GetImapAccount();
+
+private:
+	CImapBadlyFormedAddressClient(MImapTestEventHandler* aOwner);
+	void ConstructL();
+
+	// From CActive
+	virtual void DoCancel();
+	virtual void RunL();
+	virtual TInt RunError(TInt aError);
+	
+	//implementation of pure virtual inherited from MMsvImapConnectionObserver 
+	virtual void HandleImapConnectionEvent(TImapConnectionEvent aConnectionState);
+
+private:
+	enum TIMAPClientState 
+		{
+		EDisconnect, 
+		EComplete
+		};
+		
+	CEmailAccounts* iAccounts;
+	TImapAccount iImapAccount;
+	CMsvSession* iSession;
+	CBaseMtm* iClientMtm;
+	CClientMtmRegistry*	iClientRegistry;
+	TDummySessionObserver*	iSessionObserver;
+	CMsvOperation* iMsvOperation;
+	TIMAPClientState iNextStep;
+	CMsvEntrySelection* iSelection;
+	MImapTestEventHandler* iOwner;
+	};
+
+#endif  //__T_IMAPADLYFORMEDADDRESSCLIENT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/T_ImapBadlyFormedAddressServer.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,36 @@
+// Copyright (c) 2006-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 __T_IMAPADLYFORMEDADDRESSSERVER_H__
+#define __T_IMAPADLYFORMEDADDRESSSERVER_H__
+
+#include <testexecuteserverbase.h>
+
+class CImapBadlyFormedAddressServer : public CTestServer
+	{
+public:
+	static CImapBadlyFormedAddressServer* NewL();
+	~CImapBadlyFormedAddressServer();
+	virtual CTestStep* CreateTestStep(const TDesC& aStepName);
+	RFs& Fs();
+
+private:
+	CImapBadlyFormedAddressServer();
+
+private:
+	RFs iFs;
+	};
+
+#endif  //__T_IMAPADLYFORMEDADDRESSSERVER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/T_ImapBadlyFormedAddressStep.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,59 @@
+// Copyright (c) 2006-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 __T_IMAPADLYFORMEDADDRESSSTEP_H__
+#define __T_IMAPADLYFORMEDADDRESSSTEP_H__
+
+#include <testexecutestepbase.h>
+#include "cspoofserver.h"
+#include <msvapi.h>
+
+class CImapBadlyFormedAddressClient;
+class CEmailTestUtils;
+class TDummySessionObserver;
+
+class CImapBadlyFormedAddressStep : public CTestStep, MImapTestEventHandler
+	{
+public:
+	CImapBadlyFormedAddressStep();
+	~CImapBadlyFormedAddressStep();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+
+private:
+	void GetDetailsFromIniFileL();
+	void CreateImapAccountL();
+	void PrintEntryTime(TTime* aTIme);
+	TInt GetEntryCountL();
+	virtual void TestComplete(TInt aErrorCode);
+	
+private:
+	CSpoofServer* iSpoofServer;
+	CImapBadlyFormedAddressClient* iImapClient;
+	CConsoleBase* iConsole;
+	CActiveScheduler* iScheduler;
+	TMsvId iImapService;
+	CEmailTestUtils* iTestUtils;
+	CMsvSession* iSession;
+	TInt iMessageEntryCount;
+	TDummySessionObserver* iSessionObserver;
+	TPtrC16 iScriptFile;
+	TInt iExpectedEntryCount;
+	};
+
+_LIT(KTestImapBadlyFormedAddress,"TestImapBadlyFormedAddress");
+
+#endif  //__T_IMAPADLYFORMEDADDRESSSTEP_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/T_ImapNewMsgDuringSyncIdleCancelClient.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,85 @@
+// Copyright (c) 2005-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 __T_IMAPNEWMSGDURINGSYNCIDLECANCELCLIENT_H__
+#define __T_IMAPNEWMSGDURINGSYNCIDLECANCELCLIENT_H__
+
+#include <e32base.h>
+#include <msvapi.h>
+#include <imapconnectionobserver.h>
+#include "cspoofserver.h"
+#include <cemailaccounts.h>
+
+class CClientMtmRegistry;
+
+// For loading the serial comms device drivers 
+#if defined (__WINS__)
+	#define PDD_NAME		_L("ECDRV")
+	#define LDD_NAME		_L("ECOMM")
+#else
+	#define PDD_NAME		_L("EUART1")
+	#define LDD_NAME		_L("ECOMM")
+#endif
+
+class TDummySessionObserver : public CBase, public MMsvSessionObserver
+	{
+public:
+	void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
+	};
+
+class CImapNewMsgDuringSyncIdleCancelClient : public CActive, public MMsvImapConnectionObserver
+	{
+public:
+	IMPORT_C static CImapNewMsgDuringSyncIdleCancelClient* NewL(MImapTestEventHandler* aOwner);
+	IMPORT_C static CImapNewMsgDuringSyncIdleCancelClient* NewLC(MImapTestEventHandler* aOwner);
+	~CImapNewMsgDuringSyncIdleCancelClient();
+	void StartL();
+	void CreateImapAccountL();
+	TImapAccount GetImapAccount();
+
+private:
+	CImapNewMsgDuringSyncIdleCancelClient(MImapTestEventHandler* aOwner);
+	void ConstructL();
+
+	// From CActive
+	virtual void DoCancel();
+	virtual void RunL();
+	virtual TInt RunError(TInt aError);
+	
+	//implementation of pure virtual inherited from MMsvImapConnectionObserver 
+	virtual void HandleImapConnectionEvent(TImapConnectionEvent aConnectionState);
+
+private:
+	enum TIMAPClientState 
+		{
+		ESync1 = 0,
+		ESync2,
+		EDisconnect, 
+		EComplete
+		};
+		
+	CEmailAccounts* iAccounts;
+	TImapAccount iImapAccount;
+	CMsvSession* iSession;
+	CBaseMtm* iClientMtm;
+	CClientMtmRegistry*	iClientRegistry;
+	TDummySessionObserver*	iSessionObserver;
+	CMsvOperation* iMsvOperation;
+	TIMAPClientState iNextStep;
+	CMsvEntrySelection* iSelection;
+	MImapTestEventHandler* iOwner;
+	};
+
+#endif  //__T_IMAPNEWMSGDURINGSYNCIDLECANCELCLIENT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/T_ImapNewMsgDuringSyncIdleCancelServer.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,36 @@
+// Copyright (c) 2005-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 __T_IMAPNEWMSGDURINGSYNCIDLECANCELSERVER_H__
+#define __T_IMAPNEWMSGDURINGSYNCIDLECANCELSERVER_H__
+
+#include <testexecuteserverbase.h>
+
+class CImapNewMsgDuringSyncIdleCancelServer : public CTestServer
+	{
+public:
+	static CImapNewMsgDuringSyncIdleCancelServer* NewL();
+	~CImapNewMsgDuringSyncIdleCancelServer();
+	virtual CTestStep* CreateTestStep(const TDesC& aStepName);
+	RFs& Fs();
+
+private:
+	CImapNewMsgDuringSyncIdleCancelServer();
+
+private:
+	RFs iFs;
+	};
+
+#endif  //__T_IMAPNEWMSGDURINGSYNCIDLECANCELSERVER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/T_ImapNewMsgDuringSyncIdleCancelStep.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,59 @@
+// Copyright (c) 2005-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 __T_IMAPNEWMSGDURINGSYNCIDLECANCELSTEP_H__
+#define __T_IMAPNEWMSGDURINGSYNCIDLECANCELSTEP_H__
+
+#include <testexecutestepbase.h>
+#include "cspoofserver.h"
+#include <msvapi.h>
+
+class CImapNewMsgDuringSyncIdleCancelClient;
+class CEmailTestUtils;
+class TDummySessionObserver;
+
+class CImapNewMsgDuringSyncIdleCancelStep : public CTestStep, MImapTestEventHandler
+	{
+public:
+	CImapNewMsgDuringSyncIdleCancelStep();
+	~CImapNewMsgDuringSyncIdleCancelStep();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+
+private:
+	void GetDetailsFromIniFileL();
+	void CreateImapAccountL();
+	void PrintEntryTime(TTime* aTIme);
+	TInt GetEntryCountL();
+	virtual void TestComplete(TInt aErrorCode);
+	
+private:
+	CSpoofServer* iSpoofServer;
+	CImapNewMsgDuringSyncIdleCancelClient* iImapClient;
+	CConsoleBase* iConsole;
+	CActiveScheduler* iScheduler;
+	TMsvId iImapService;
+	CEmailTestUtils* iTestUtils;
+	CMsvSession* iSession;
+	TInt iMessageEntryCount;
+	TDummySessionObserver* iSessionObserver;
+	TPtrC16 iScriptFile;
+	TInt iExpectedEntryCount;
+	};
+
+_LIT(KTestImapNewMsgDuringSyncIdleCancel,"TestImapNewMsgDuringSyncIdleCancel");
+
+#endif  //__T_IMAPNEWMSGDURINGSYNCIDLECANCELSTEP_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/T_LOG.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,129 @@
+// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+
+class COutputter : public CBase
+	{
+public:
+	static COutputter* NewL(RTest* aTest);
+	~COutputter();
+	
+	void SetRFs( RFs* aFs);
+	void SetFilePrefix( TUint aNum );
+	void SetFileL( const TDesC& leafname, TBool aUnicode=EFalse );
+	void UnSetFile();
+	void PrintL( const TDesC8& aText );
+	void PrintL( const TDesC16& aText );
+	void Printf( TRefByValue<const TDesC> aFmt,... );
+	void PrintIfNotNullL( const TDesC& aLabel, const TDesC8& aValue );
+	void PrintIfNotNullL( const TDesC& aLabel, const TDesC16& aValue );
+	void PrintListL( const TDesC& aLabel, CDesC8Array& aList );
+	void PrintListL( const TDesC& aLabel, CDesC16Array& aList );
+	void PrintDataL( const TDesC8& aData );
+
+private:
+	void ConstructL();
+	
+private:
+	TInt iFilesOpen;
+	RFile iFile[4];
+	RTest* iTest;
+	RFs* iFs;
+	TDes16Overflow* iOverflow;
+	TBuf<9> iPrefix;
+	TBool iUnicode;
+
+public:
+	TBool iUseFiles;
+	};
+
+//----------------------------------------------------------------------------------------
+
+typedef TBool(*MsgMatchFn)( CMsvServerEntry* aEntry);
+
+//----------------------------------------------------------------------------------------
+
+class CMsgOutputter : public CBase
+	{
+public:
+	static CMsgOutputter* NewL( COutputter* aPutter, CMsvServerEntry* aEntry );
+	~CMsgOutputter();
+	void DumpL( TMsvId aId,
+				TInt aSummary,
+				TInt aParts,
+				TBool aRecurse,
+				TBool aShowIds,
+				MsgMatchFn aMatch =0);
+
+private:
+	CMsgOutputter( COutputter* aPutter, CMsvServerEntry* aEntry );
+//	void ConstructL(CMsvServer* aServer);
+	
+	void BodyDataL(CMsvStore& aFileStore);
+	void MimeHeaderL(CMsvStore& aFileStore);
+	void HeaderL(CMsvStore& aFileStore);
+	void MultipartDataL(CMsvStore& aFileStore);
+	void SettingsL(const TMsvEntry& aEntry);
+	void Imap4SettingsL(const TMsvEntry& aEntry);
+	void QueuedOpsL( CMsvStore& aFileStore );
+
+	TPtrC PriorityString( const TMsvEmailEntry& entry );
+	TPtrC DisconnectedOpString( const TMsvEmailEntry& entry );
+	TPtrC TypeString( const TMsvEmailEntry& entry );
+	void FlagsString( TBuf<8>&other, const TMsvEmailEntry& entry );
+	void IMAP4FlagsString( TBuf<7>&other, const TMsvEmailEntry& entry );
+	TPtrC SubscribeTypeString( TFolderSubscribeType aType );
+	TPtrC SyncTypeString( TFolderSyncType aType );
+	TPtrC OffLineOpTypeString(CImOffLineOperation::TOffLineOpType op);
+	TPtrC GetMailOptionsString( TImap4GetMailOptions aOpts );
+
+	void OutputPartsL(TBuf<5>& aStreams);
+	void RemoveRichtextFormatting(TDes& aSourceLine);
+
+	void DumpRecurseL();
+
+private:
+	// passed in on init
+	COutputter* iPutter;
+
+	// created in constructor
+	CMsvServerEntry* iEntry;
+	TMsvId iMsgId;
+
+	// behaviour flags
+	TInt iSummary;
+	TInt iParts;
+	TBool iRecurse;
+	TBool iShowIds;
+	MsgMatchFn iMatch;
+	
+	// context info
+	TInt iDepth;				// depth into the recursion
+
+	// statistics info
+	TInt iEntryCount;
+	TInt iFileCount;
+
+public:
+	enum
+		{
+		ENone = 0,
+		EToScreen,
+		EToOneFile,
+		EToMultipleFiles
+		};
+
+	};
+
+//----------------------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/T_PARSE_UTC_IMAPServer.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,36 @@
+// Copyright (c) 2005-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:
+// t_parse_utc_imap_server.h
+// 
+//
+
+#ifndef __T_PARSE_UTC_IMAP_SERVER_H__
+#define __T_PARSE_UTC_IMAP_SERVER_H__
+
+#include <testexecuteserverbase.h>
+ 
+//
+// ParseUTCServer
+//
+
+class CParseUTCServer : public CTestServer
+	{
+public:
+	static CParseUTCServer* NewL();
+	virtual CTestStep* CreateTestStep(const TDesC& aStepName);
+	RFs& Fs();	
+private:
+	RFs iFs;
+	};
+#endif  //__T_PARSE_UTC_IMAP_SERVER_H__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/T_PARSE_UTC_IMAPStep.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,76 @@
+// Copyright (c) 2005-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:
+// t_parse_utc_imap_step.h
+// 
+//
+
+#ifndef __T_PARSE_UTC_IMAP_STEP_H__
+#define __T_PARSE_UTC_IMAP_STEP_H__
+ 
+#include <test\testexecutestepbase.h>
+#include "emailtestutils.h"
+#include "smstestutils.h"
+#include <stdlib.h>
+#include <msvapi.h>
+#include <smuthdr.h> 
+#include <iapprefs.h>
+#include "t_parse_utc_imapserver.h"
+#include "imapspoofserver.h"
+#include "imapclient.h"
+#include "eventhandler.h"
+//
+// CTestUTCParse
+//
+
+class CTestUTCParse : public CTestStep , MImapTestEventHandler
+	{
+public:
+	CTestUTCParse();
+	~CTestUTCParse();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+private:
+	void GetDetailsFromIniFileL();
+	void WriteStoreL();
+	void CreateImapAccountL();
+	void PrintEntryTime(TTime* aTIme);
+	void TraverseL(const TMsvId aTMsvId);
+	TVerdict CheckTimeStamps();
+	virtual void HandleEvent(TInt aEventCode);
+	
+private:
+	CImapSpoofServer* iImapServer;
+	CActiveImapClient* iImapClient;
+	CConsoleBase* iConsole;
+	CActiveScheduler* iScheduler;
+	TMsvId	iImapService;
+	CEmailTestUtils* iTestUtils;
+	CMsvSession* iSession;
+	TInt iMessageEntryCount;
+	TDummySessionObserver* iSessionObserver;
+	TPtrC16 iScriptFile;
+	TTime iExpectedTimeStamp;
+	TTime iExpectedTimeStamp2;
+	TTime iActualTimeStamp;
+	TTime iActualTimeStamp2;
+	TBool iExpectedTimeStampIsNow;
+	TBool iExpectedTimeStampIsNow2;	
+	TBool iFetchWholeMessage;
+	};
+
+ 		
+_LIT(KTestUTCParse,"TestUTCParse");
+	
+#endif  //__T_PARSE_UTC_IMAP_STEP_H__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/T_PartialDownloadImapClient.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,88 @@
+// Copyright (c) 2005-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 __T_PARTIALDOWNLOADIMAPCLIENT_H__
+#define __T_PARTIALDOWNLOADIMAPCLIENT_H__
+
+#include <e32cons.h>
+#include <e32const.h>
+#include <in_sock.h>
+#include <nifman.h>
+#include "emailtestutils.h"
+#include <iapprefs.h>
+#include <cemailaccounts.h>
+#include "impsmtm.h"
+#include <imapconnectionobserver.h>
+#include "cspoofserver.h"
+
+// For loading the serial comms device drivers 
+#if defined (__WINS__)
+	#define PDD_NAME		_L("ECDRV")
+	#define LDD_NAME		_L("ECOMM")
+#else
+	#define PDD_NAME		_L("EUART1")
+	#define LDD_NAME		_L("ECOMM")
+#endif
+
+class TDummySessionObserver : public CBase , public MMsvSessionObserver
+	{
+public:
+	void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
+	};
+
+class CPartialDownLoadImapClient : public CActive , public MMsvImapConnectionObserver
+	{
+
+public:
+	
+	static CPartialDownLoadImapClient* NewL(MImapTestEventHandler& aObserver,TBool aFetchWholeMessage);
+	static CPartialDownLoadImapClient* NewLC(MImapTestEventHandler& aObserver,TBool aFetchWholeMessage);
+	void StartL();
+	void CreateImapAccountL();
+	~CPartialDownLoadImapClient();
+	TImapAccount GetImapAccount();
+
+private:
+	CPartialDownLoadImapClient(MImapTestEventHandler& aObserver,TBool aFetchWholeMessage);
+	void ConstructL();
+	virtual void DoCancel();
+	virtual void RunL();
+	virtual TInt RunError(TInt aError);
+	
+	//implementation of pure virtual inherited from MMsvImapConnectionObserver 
+	virtual void HandleImapConnectionEvent(TImapConnectionEvent aConnectionState);
+private:
+
+	enum TIMAPClientState 
+		{
+		EFetch=0,	
+		EDisconnect, 
+		EComplete
+		};
+		
+	CEmailAccounts* iAccounts;
+	TImapAccount iImapAccount;
+	CMsvSession* iSession;
+	CBaseMtm* iClientMtm;
+	CClientMtmRegistry*	iClientRegistry;
+	TDummySessionObserver*	iSessionObserver;
+	CMsvOperation* iMsvOperation;
+	TIMAPClientState iNextStep;
+	CMsvEntrySelection* iSelection;
+	MImapTestEventHandler& iObserver;
+	TBool iFetchWholeMessage;
+	};
+
+#endif  //__T_PARTIALDOWNLOADIMAPCLIENT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/T_PartialDownloadSpoofServer.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,31 @@
+// Copyright (c) 2005-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 __T_PARTIALDOWNLOADSPOOFSERVER_H__
+#define __T_PARTIALDOWNLOADSPOOFSERVER_H__
+
+#include <testexecuteserverbase.h>
+ 
+
+class CPartialDownloadSpoofServer : public CTestServer
+	{
+public:
+	static CPartialDownloadSpoofServer* NewL();
+	virtual CTestStep* CreateTestStep(const TDesC& aStepName);
+	RFs& Fs();	
+private:
+	RFs iFs;
+	};
+#endif  //__T_PARTIALDOWNLOADSPOOFSERVER_H__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/T_PartialDownloadStep.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,73 @@
+// Copyright (c) 2005-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 __T_PARTIALDOWNLOADSTEP_H__
+#define __T_PARTIALDOWNLOADSTEP_H__
+ 
+#include <test\testexecutestepbase.h>
+#include "emailtestutils.h"
+#include "smstestutils.h"
+#include <stdlib.h>
+#include <msvapi.h>
+#include <smuthdr.h> 
+#include <iapprefs.h>
+#include "t_partialdownloadspoofserver.h"
+#include "t_partialdownloadimapclient.h"
+
+/**
+@SYMTestCaseID DEF06342
+@SYMTestType UT
+@SYMTestPriority High
+@SYMDEF DEF06342
+@SYMTestCaseDependencies SpoofServer.dll
+@SYMTestCaseDesc IMAP Test of partial fetching of empty messages.
+@SYMTestActions Sets partial download limits to 2 bytes. 
+Downloads the first message which has no body and an attachment greater than 2 bytes.
+Downloads a second message.
+Verifies that the messages where successfully fetched.
+@SYMTestExpectedResults Both messages should be fetched..
+*/
+
+class CPartialDownloadStep : public CTestStep , MImapTestEventHandler
+	{
+public:
+	CPartialDownloadStep();
+	~CPartialDownloadStep();
+	virtual TVerdict doTestStepPreambleL();
+	virtual TVerdict doTestStepPostambleL();
+	virtual TVerdict doTestStepL();
+private:
+	void GetDetailsFromIniFileL();
+	void CreateImapAccountL();
+	virtual void TestComplete(TInt aErrorCode);
+	TInt GetEntryCountL();
+private:
+	CSpoofServer* iSpoofServer;
+	CPartialDownLoadImapClient* iImapClient;
+	CConsoleBase* iConsole;
+	CActiveScheduler* iScheduler;
+	TMsvId	iImapService;
+	CEmailTestUtils* iTestUtils;
+	CMsvSession* iSession;
+	TInt iMessageEntryCount;
+	TDummySessionObserver* iSessionObserver;
+	TPtrC16 iScriptFile;
+	TBool iFetchWholeMessage;
+	};
+
+ 		
+_LIT(KTestPartialDownLoad,"TestPartialDownLoad");
+	
+#endif  //__T_PARTIALDOWNLOADSTEP_H__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/inc/t_test_decode_step.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,91 @@
+// Copyright (c) 2005-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 __T_TEST_DECODE_STEP_H__
+#define __T_TEST_DECODE_STEP_H__
+ 
+#include <test\testexecutestepbase.h>
+#include "emailtestutils.h"
+#include "smstestutils.h"
+#include <stdlib.h>
+#include <msvapi.h>
+#include <smuthdr.h> 
+#include <iapprefs.h>
+#include "t_decodeserver.h"
+#include "decodeimapclient.h"
+
+const TInt KMaxBufferSize = 5000;
+
+
+enum TBufferType 
+	{
+	EUndefinedBuffer = -1,
+	EBodyBuffer = 0,
+	EAttachmentBuffer = 1
+	};
+
+class TBuffer
+	{
+public:
+	TBuf8< KMaxBufferSize > iBuffer;
+	TBufferType iBufferType;
+	TBool iAllowJunkAtEnd;
+	};
+
+//
+// CTestDecode
+//
+
+class CTestDecode : public CTestStep , MImapTestEventHandler
+	{
+public:
+	CTestDecode( );
+	virtual ~CTestDecode( );
+	virtual TVerdict doTestStepPreambleL( );
+	virtual TVerdict doTestStepPostambleL( );
+	virtual TVerdict doTestStepL( );
+private:
+	void GetDetailsFromIniFileL( );
+	void CreateImapAccountL( );
+	void TraverseL( const TMsvId aTMsvId );
+	TVerdict CheckBuffer( const TDesC8& aActualBuffer, 
+						  const TDesC8& aExpectedBuffer, 
+						  TBool aAllowJunkAtEnd );
+	virtual void TestComplete( TInt aErrorCode );
+	
+	TBufferType ConvertToBufferType( const TDesC& aBufferTypeDesc );
+	
+private:
+	CSpoofServer* iSpoofServer;
+	CActiveImapClient* iImapClient;
+	CConsoleBase* iConsole;
+	CActiveScheduler* iScheduler;
+	TMsvId	iImapService;
+	CEmailTestUtils* iTestUtils;
+	CMsvSession* iSession;
+	TDummySessionObserver* iSessionObserver;
+	TPtrC16 iScriptFile;
+	TBool iFetchWholeMessage;
+
+	CDesC8ArraySeg* iActualPartsBuffer;
+	CArrayFixSeg< TBuffer >* iExpectedPartsBuffer;
+
+	RFs iFs;
+	};
+
+ 		
+_LIT( KTestDecode, "TestDecode" );
+	
+#endif  //__T_TEST_DECODE_STEP_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/scripts/T_DEF059571_IMAP_MISSINGOFFSET.script	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,39 @@
+//
+// 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:
+//
+//! @file
+//! @SYMTestCaseID DEF059571
+//! @SYMTestType UT
+//! @SYMTestPriority High
+//! @SYMDEF DEF062024
+//! @SYMDEF T_DEF062024_Imap_MissingOffsetInfiniteLoop.exe
+//! @SYMTestCaseDesc Implements an IMAP server to facilitate offline testing of imap parsing. 
+//! The sever contains and retrieves an email with two body parts the second being HTML. The fetch resonse from the server
+//! is missing the offset parameter ie 
+//!         << * 1 FETCH (BODY[2] {785}         is received, rather than the more typical:
+//!         << * 1 FETCH (BODY[2] <0> {785}  
+//! The aim of the test is to check that the bodydata is correctly fetched, specifically in the case that the body data
+//! is HTML starting with the "<" character. The size of the received data is compared to confirm correct download.
+//! @SYMTestActions  1. The Server is started and listens on port 143.
+//! 				 2. The client connects to the server, requests a sync and a populate
+//! 				 3. The server reads the protocol information from a file specified in the ini file (ImapMissingOffsetTest.ini).
+//! 				 4. The client disconnects.
+//! 				 5. The size of the bodyparts downloaded is compared with known correct values.
+//! @SYMTestExpectedResults The bodyparts should have the same size source file originally attached.
+
+PRINT Run T_DEF059571_Imap_MissingOffset Test 
+LOAD_SUITE T_DEF059571_Imap_MissingOffset -SharedData
+
+RUN_TEST_STEP 1000 T_DEF059571_Imap_MissingOffset TestImapMissingOffset c:\msgtest\imap\ImapMissingOffsetTest.ini Section1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/scripts/T_DEF062024_IMAP_ATTACHMENTCANNOTBEOPENED.script	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,35 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+//! @file
+//! @SYMTestCaseID DEF062024
+//! @SYMTestType UT
+//! @SYMTestPriority High
+//! @SYMDEF DEF062024
+//! @SYMDEF T_DEF062024_Imap_AttachmentCannotBeOpened.exe
+//! @SYMTestCaseDesc Implements an IMAP server to facilitate offline testing of imap parsing. 
+//! The sever contains and retrieves an email with an attachment (a v-card), the aim of th test is to check that this
+//! attachmenet is fetched correctly by comparing its size and centent to the size and content of the source file attached.
+//! @SYMTestActions  1. The Server is started and listens on port 143.
+//! 				 2. The client connects to the server, requests a sync and a populate
+//! 				 3. The server reads the protocol information from a file specified in the ini file (ImapAttachmentTest.ini).
+//! 				 4. The client disconnects.
+//! 				 5. The attachment of the mail fetched is compared with the corresponding source file. The test passes if its size and content is exactly the same as the size and content of the file originally attached to this email, otherwise itv fails.
+//! @SYMTestExpectedResults The attachment file should have the same size and content as the source file originally attached.
+
+PRINT Run T_DEF062024_Imap_AttachmentCannotBeOpened Test 
+LOAD_SUITE T_DEF062024_Imap_AttachmentCannotBeOpened -SharedData
+
+RUN_TEST_STEP 1000 T_DEF062024_Imap_AttachmentCannotBeOpened TestImapAttachment c:\msgtest\imap\ImapAttachmentTest.ini Section1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/scripts/T_IMAP_DECODE.script	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,22 @@
+//
+// 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:
+//
+
+PRINT Run all T_DecodeServer Tests 
+LOAD_SUITE T_DecodeServer -SharedData
+
+RUN_TEST_STEP 1000 T_DecodeServer TestDecode c:\msgtest\imap\ImapDecode.ini  SectionOne
+RUN_TEST_STEP 1000 T_DecodeServer TestDecode c:\msgtest\imap\ImapDecode.ini  SectionTwo
+RUN_TEST_STEP 1000 T_DecodeServer TestDecode c:\msgtest\imap\ImapDecode.ini  SectionThree
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/scripts/T_ImapBadlyFormedAddress.script	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,35 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+//! @file
+//! @SYMTestCaseID DEF079017
+//! @SYMTestType UT
+//! @SYMTestPriority High
+//! @SYMDEF DEF079017
+//! @SYMTestCaseDesc IMAP spoof server test. Checks that a response containing a text atom which itself contains
+//! end of atom characters is handled correctly.
+//! The server connects and syncs. During the sync phase, the server returns an OK [PARSE] response to indicate
+//! that an email address is invalid. The text field after this then contains the end of atome characters ')', ']'. '>'
+//! @SYMTestActions 1. The Server is started and listens on port 143.
+//! 2. The client connects to the server, and performs a sync.
+//! 3. During the sync, a OK [PARSE] response is returned containing end of atom characters.
+//! 4. Two email headers are fetched during the sync
+//! 5. The client disconnects
+//! @SYMTestExpectedResults Client should have fetched two message headers
+
+PRINT Run T_ImapBadlyFormedAddress Test 
+LOAD_SUITE T_ImapBadlyFormedAddress -SharedData
+
+RUN_TEST_STEP 1000 T_ImapBadlyFormedAddress TestImapBadlyFormedAddress c:\msgtest\imap\ImapBadlyFormedAddressTest.ini Section1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/scripts/T_ImapNewMsgDuringSyncIdleCancel.script	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,39 @@
+//
+// 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:
+//
+//! @file
+//! @SYMTestCaseID DEF067159
+//! @SYMTestType UT
+//! @SYMTestPriority High
+//! @SYMDEF DEF067159
+//! @SYMTestCaseDesc IMAP spoof server test that checks that a new message indication is correctly handled if idle read is being cancelled during a sync
+//! The server waits for the idle read to be cancelled by the sync command, and then sends a '* 2 EXISTS' command to indicate that
+//! a new message has arrived.
+//! @SYMTestActions 1. The Server is started and listens on port 143.
+//! 2. The client connects to the server, requests a sync and a populate.
+//! 3. Client / server interact to complete the sync and populate. One message is fetched.
+//! 4. The client requests a full sync (causing the idle read cancel).
+//! 5. The server indicates a new message has arrived
+//! 6. Client / server interact to complete the full sync. The new message is fetched
+//! 7. The client requests a full sync (causing the idle read cancel).
+//! 8. The server indicates a new message has arrived
+//! 9. Client / server interact to complete the full sync. The new message is fetched
+//! 10. The client disconnects.
+//! @SYMTestExpectedResults Client should have fetched three messages
+
+PRINT Run T_ImapNewMsgDuringSyncIdleCancel Test 
+LOAD_SUITE T_ImapNewMsgDuringSyncIdleCancel -SharedData
+
+RUN_TEST_STEP 1000 T_ImapNewMsgDuringSyncIdleCancel TestImapNewMsgDuringSyncIdleCancel c:\msgtest\imap\ImapNewMsgDuringSyncIdleCancelTest.ini Section1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/scripts/T_PARSE_UTC_IMAP.script	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,34 @@
+//
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Nokia Corporation - initial contribution.
+//
+// Contributors:
+//
+// Description:
+//
+//! @file
+//! @SYMTestCaseID MSG-IMAP-0243
+//! @SYMTestType UT
+//! @SYMTestPriority High
+//! @SYMPREQ 234
+//! @SYMDEF T_ImapParseUtcServer.exe
+//! @SYMTestCaseDesc Each test case tests for correct parsing of date header information by the IMAP system.
+//! @SYMTestActions Connects to the dummy IMAP server using loop back address, syncs known emails from the server.
+//! @SYMTestExpectedResults Tests that the dates used to time-stamp message store entries are as expected.
+
+PRINT Run all T_Parse_UTCServer Tests 
+LOAD_SUITE T_ImapParseUtcServer -SharedData
+
+RUN_TEST_STEP 1000 T_ImapParseUtcServer TestUTCParse c:\msgtest\imap\ImapUTCTest.ini  SectionOne
+RUN_TEST_STEP 1000 T_ImapParseUtcServer TestUTCParse c:\msgtest\imap\ImapUTCTest.ini  SectionTwo
+RUN_TEST_STEP 1000 T_ImapParseUtcServer TestUTCParse c:\msgtest\imap\ImapUTCTest.ini  SectionThree
+RUN_TEST_STEP 1000 T_ImapParseUtcServer TestUTCParse c:\msgtest\imap\ImapUTCTest.ini  SectionFour
+RUN_TEST_STEP 1000 T_ImapParseUtcServer TestUTCParse c:\msgtest\imap\ImapUTCTest.ini  SectionFive
+RUN_TEST_STEP 1000 T_ImapParseUtcServer TestUTCParse c:\msgtest\imap\ImapUTCTest.ini  SectionSix
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/scripts/T_PartialDownload.script	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,20 @@
+//
+// 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:
+//
+
+PRINT Run all T_PartialDownload Tests 
+LOAD_SUITE T_PartialDownLoadSpoofServer -SharedData
+
+RUN_TEST_STEP 1000 T_PartialDownLoadSpoofServer TestPartialDownLoad
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/DecodeImapClient.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,225 @@
+// Copyright (c) 2005-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:
+// imapclient.cpp
+// 
+//
+
+#include "decodeimapclient.h"
+
+_LIT(KLoopbackAddress,"127.0.0.1");
+
+void TDummySessionObserver::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
+	{
+	}
+ 
+TImapAccount CActiveImapClient::GetAccount()
+	{
+	return iImapAccount;
+	}
+
+CActiveImapClient::CActiveImapClient() : CActive(EPriorityStandard)
+	{
+	}
+
+EXPORT_C CActiveImapClient* CActiveImapClient::NewL(MImapTestEventHandler* aOwner,TBool aFetchWholeMessage)
+	{
+	CActiveImapClient* self = NewLC(aOwner,aFetchWholeMessage);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+EXPORT_C CActiveImapClient* CActiveImapClient::NewLC(MImapTestEventHandler* aOwner,TBool aFetchWholeMessage)
+	{
+	CActiveImapClient* self = new(ELeave) CActiveImapClient;
+	CleanupStack::PushL(self);
+	self->ConstructL(aOwner,aFetchWholeMessage);
+	return self;
+	}
+	
+CActiveImapClient::~CActiveImapClient()
+	{
+	Cancel();
+	delete iMsvOperation;	
+	delete iSelection;
+	delete iClientMtm;
+	delete iClientRegistry;	
+	delete iSession;
+	delete iSessionObserver;
+	delete iAccounts;
+	}
+	
+	
+void CActiveImapClient::ConstructL(MImapTestEventHandler* aOwner,TBool aFetchWholeMessage)
+	{
+	CActiveScheduler::Add(this); 
+	iFetchWholeMessage=aFetchWholeMessage;
+	iOwner=aOwner;
+	//create an account
+	iAccounts = CEmailAccounts::NewL();	
+	CreateImapAccountL();
+	// Session observer. Needed to create a session
+	iSessionObserver = new (ELeave) TDummySessionObserver;
+	// Session. Needed to create a client registry.
+	iSession=CMsvSession::OpenSyncL(*iSessionObserver);
+	// Client registry. Needed to get the MTM component
+	iClientRegistry=CClientMtmRegistry::NewL(*iSession,KMsvDefaultTimeoutMicroSeconds32);
+	//get the client mtm
+	iClientMtm=iClientRegistry->NewMtmL(KUidMsgTypeIMAP4);	
+	
+	// Load the serial comms device drivers.  If this is not done,
+	// connecting via NT-RAS returns KErrNotFound (-1).
+	TInt driverErr;
+	driverErr=User::LoadPhysicalDevice(PDD_NAME);
+	if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists)
+		User::Leave(driverErr);
+	driverErr=User::LoadLogicalDevice(LDD_NAME);
+	if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists)
+		User::Leave(driverErr);
+	}
+	
+void CActiveImapClient::CreateImapAccountL()
+	{
+	//create objects and initialise with the defaults
+	CImImap4Settings* imap4Settings=new(ELeave)CImImap4Settings;
+	CleanupStack::PushL(imap4Settings);
+	CImSmtpSettings* smtpSettings=new(ELeave)CImSmtpSettings;
+	CleanupStack::PushL(smtpSettings);
+	CImIAPPreferences* imapIap = CImIAPPreferences::NewLC();
+	CImIAPPreferences* smtpIap = CImIAPPreferences::NewLC();
+	
+	iAccounts->PopulateDefaultImapSettingsL(*imap4Settings, *imapIap);
+	iAccounts->PopulateDefaultSmtpSettingsL(*smtpSettings, *smtpIap);
+	
+	//override some of the defaults
+	imap4Settings->SetPasswordL(_L8("davids"));
+	imap4Settings->SetLoginNameL(_L8("davids"));
+	imap4Settings->SetServerAddressL(KLoopbackAddress);
+	imap4Settings->SetFolderPathL(_L8(""));
+	imap4Settings->SetSynchronise(EUseLocal);
+	
+	//create the account
+	iImapAccount = iAccounts->CreateImapAccountL(_L("TestAccount"), *imap4Settings, *imapIap, EFalse);
+	TSmtpAccount smtpAccount;
+	smtpAccount = iAccounts->CreateSmtpAccountL(iImapAccount, *smtpSettings, *smtpIap, EFalse);
+
+	//clean up
+	CleanupStack::PopAndDestroy(smtpIap);
+	CleanupStack::PopAndDestroy(imapIap);	
+	CleanupStack::PopAndDestroy(smtpSettings);
+	CleanupStack::PopAndDestroy(imap4Settings); 
+	}
+
+void CActiveImapClient::StartL()
+	{
+	
+	//if we are to collect the whole email then the next operation will be to fetch it
+	iNextStep=(!iFetchWholeMessage? EDisconnect:EFetch);
+	iSelection = new (ELeave) CMsvEntrySelection;
+	TPckg<MMsvImapConnectionObserver*> param(this);
+	//select the imap service entry
+	iSelection->AppendL(iImapAccount.iImapService);
+	//make the service entry the current context
+	iClientMtm->SwitchCurrentEntryL(iImapAccount.iImapService);
+	//sync the account
+	iMsvOperation = iClientMtm->InvokeAsyncFunctionL(KIMAP4MTMConnectAndSyncCompleteAfterFullSync,*iSelection,param,iStatus);			
+	SetActive();
+	}
+	
+void CActiveImapClient::DoCancel()
+	{	
+	__ASSERT_DEBUG(iMsvOperation!=NULL, User::Panic(_L("CActiveImapClient"), -3));
+	iMsvOperation->Cancel();
+	}
+
+void CActiveImapClient::RunL()
+	{
+
+	TPckg<MMsvImapConnectionObserver*> param(this);
+	TImImap4GetMailInfo imap4GetMailInfo;
+	imap4GetMailInfo.iMaxEmailSize = KMaxTInt;
+	imap4GetMailInfo.iDestinationFolder = KMsvGlobalInBoxIndexEntryIdValue;
+	imap4GetMailInfo.iGetMailBodyParts = EGetImap4EmailBodyTextAndAttachments;
+			
+	TPckgBuf<TImImap4GetMailInfo> package(imap4GetMailInfo);
+	
+	CMsvEntry* inboxEntry=NULL;
+	CMsvEntry* imapService=NULL;
+	TMsvSelectionOrdering ordering;
+	
+	switch(iNextStep)
+		{
+		//connect and sync	
+		case EDisconnect:
+			iNextStep=EComplete;
+			delete iMsvOperation;
+			iMsvOperation=NULL;
+			iMsvOperation = iClientMtm->InvokeAsyncFunctionL(KIMAP4MTMDisconnect,*iSelection,param,iStatus);	
+			SetActive();
+			break;	
+			
+		case EFetch:
+			iNextStep=EDisconnect;
+			// message in remote inbox					
+			//create a CMsvEntry for the service entry
+			imapService = CMsvEntry::NewL(*iSession, iImapAccount.iImapService,ordering);
+			CleanupStack::PushL(imapService);
+			//retrieve the inbox from the imap service entry
+			CMsvEntrySelection* msvEntrySelection;
+			msvEntrySelection=imapService->ChildrenL();
+			CleanupStack::PushL(msvEntrySelection);
+			//create a CMsvEntry for the inbox entry
+			inboxEntry = CMsvEntry::NewL(*iSession, (*msvEntrySelection)[0],ordering);
+			CleanupStack::PopAndDestroy(msvEntrySelection);
+			CleanupStack::PushL(inboxEntry);
+			//retrieve the message from the inboxEntry service entry
+			msvEntrySelection=inboxEntry->ChildrenL();
+			CleanupStack::PushL(msvEntrySelection);
+			//append the message entry to our selection
+			iSelection->AppendL((*msvEntrySelection)[0]);
+			//cleanup
+			CleanupStack::PopAndDestroy(msvEntrySelection);
+			CleanupStack::PopAndDestroy(inboxEntry);
+			CleanupStack::PopAndDestroy(imapService);
+
+			package = imap4GetMailInfo;
+			delete iMsvOperation;
+			iMsvOperation=NULL;
+			iMsvOperation = iClientMtm->InvokeAsyncFunctionL(KIMAP4MTMCopyMailSelectionWhenAlreadyConnected, *iSelection, package, iStatus);	
+			SetActive();
+			break;
+		
+		case EComplete:
+			//inform the owning object that the process is complete
+			iOwner->TestComplete(KErrNone);
+			break;
+			
+		default:
+			__ASSERT_DEBUG(0, User::Panic(_L("CActiveImapClient unknown state"), KErrUnknown));
+			break;			
+		}
+	}
+	
+TInt CActiveImapClient::RunError(TInt aError)
+	{
+	iOwner->TestComplete(aError);
+	return KErrNone;
+	}
+	
+void CActiveImapClient::HandleImapConnectionEvent(TImapConnectionEvent /*aConnectionState*/)
+	{
+	//this method does nothing
+	}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/IMapClient.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,228 @@
+// Copyright (c) 2005-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 "imapclient.h"
+
+_LIT(KLoopbackAddress,"127.0.0.1");
+//_LIT(KMSExchangeAddress,"10.22.64.6");
+
+void TDummySessionObserver::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
+	{
+	}
+ 
+TImapAccount CActiveImapClient::GetAccount()
+	{
+	return iImapAccount;
+	}
+
+CActiveImapClient::CActiveImapClient() : CActive(EPriorityStandard)
+	{
+	}
+
+EXPORT_C CActiveImapClient* CActiveImapClient::NewL(MImapTestEventHandler* aOwner,TBool aFetchWholeMessage)
+	{
+	CActiveImapClient* self = NewLC(aOwner,aFetchWholeMessage);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+EXPORT_C CActiveImapClient* CActiveImapClient::NewLC(MImapTestEventHandler* aOwner,TBool aFetchWholeMessage)
+	{
+	CActiveImapClient* self = new(ELeave) CActiveImapClient;
+	CleanupStack::PushL(self);
+	self->ConstructL(aOwner,aFetchWholeMessage);
+	return self;
+	}
+	
+CActiveImapClient::~CActiveImapClient()
+	{
+	Cancel();
+	delete iMsvOperation;	
+	delete iSelection;
+	delete iClientMtm;
+	delete iClientRegistry;	
+	delete iSession;
+	delete iSessionObserver;
+	delete iAccounts;
+	}
+	
+	
+void CActiveImapClient::ConstructL(MImapTestEventHandler* aOwner,TBool aFetchWholeMessage)
+	{
+	CActiveScheduler::Add(this); 
+	iFetchWholeMessage=aFetchWholeMessage;
+	iOwner=aOwner;
+	//create an account
+	iAccounts = CEmailAccounts::NewL();	
+	CreateImapAccountL();
+	// Session observer. Needed to create a session
+	iSessionObserver = new (ELeave) TDummySessionObserver;
+	// Session. Needed to create a client registry.
+	iSession=CMsvSession::OpenSyncL(*iSessionObserver);
+	// Client registry. Needed to get the MTM component
+	iClientRegistry=CClientMtmRegistry::NewL(*iSession,KMsvDefaultTimeoutMicroSeconds32);
+	//get the client mtm
+	iClientMtm=iClientRegistry->NewMtmL(KUidMsgTypeIMAP4);	
+	
+	// Load the serial comms device drivers.  If this is not done,
+	// connecting via NT-RAS returns KErrNotFound (-1).
+	TInt driverErr;
+	driverErr=User::LoadPhysicalDevice(PDD_NAME);
+	if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists)
+		User::Leave(driverErr);
+	driverErr=User::LoadLogicalDevice(LDD_NAME);
+	if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists)
+		User::Leave(driverErr);
+	}
+	
+void CActiveImapClient::CreateImapAccountL()
+	{
+	//create objects and initialise with the defaults
+	CImImap4Settings* imap4Settings=new(ELeave)CImImap4Settings;
+	CleanupStack::PushL(imap4Settings);
+	CImSmtpSettings* smtpSettings=new(ELeave)CImSmtpSettings;
+	CleanupStack::PushL(smtpSettings);
+	CImIAPPreferences* imapIap = CImIAPPreferences::NewLC();
+	CImIAPPreferences* smtpIap = CImIAPPreferences::NewLC();
+	
+	iAccounts->PopulateDefaultImapSettingsL(*imap4Settings, *imapIap);
+	iAccounts->PopulateDefaultSmtpSettingsL(*smtpSettings, *smtpIap);
+	
+	//override some of the defaults
+	imap4Settings->SetPasswordL(_L8("davids"));
+	imap4Settings->SetLoginNameL(_L8("davids"));
+	imap4Settings->SetServerAddressL(KLoopbackAddress);
+	imap4Settings->SetFolderPathL(_L8(""));
+	imap4Settings->SetSynchronise(EUseLocal);
+	
+	//create the account
+	iImapAccount = iAccounts->CreateImapAccountL(_L("TestAccount"), *imap4Settings, *imapIap, EFalse);
+	TSmtpAccount smtpAccount;
+	smtpAccount = iAccounts->CreateSmtpAccountL(iImapAccount, *smtpSettings, *smtpIap, EFalse);
+
+	//clean up
+	CleanupStack::PopAndDestroy(smtpIap);
+	CleanupStack::PopAndDestroy(imapIap);	
+	CleanupStack::PopAndDestroy(smtpSettings);
+	CleanupStack::PopAndDestroy(imap4Settings); 
+	}
+
+void CActiveImapClient::StartL()
+	{
+	
+	//if we are to collect the whole email then the next operation will be to fetch it
+	iNextStep=(!iFetchWholeMessage? EDisconnect:EFetch);
+		
+	iSelection = new (ELeave) CMsvEntrySelection;
+	TPckg<MMsvImapConnectionObserver*> param(this);
+	//select the imap service entry
+	iSelection->AppendL(iImapAccount.iImapService);
+	//make the service entry the current context
+	iClientMtm->SwitchCurrentEntryL(iImapAccount.iImapService);
+	//sync the account
+	iMsvOperation = iClientMtm->InvokeAsyncFunctionL(KIMAP4MTMConnectAndSyncCompleteAfterFullSync,*iSelection,param,iStatus);			
+	SetActive();
+	}
+	
+void CActiveImapClient::DoCancel()
+	{	
+	__ASSERT_DEBUG(iMsvOperation!=NULL, User::Panic(_L("CActiveImapClient"), -3));
+	iMsvOperation->Cancel();
+	}
+
+void CActiveImapClient::RunL()
+	{
+
+	TPckg<MMsvImapConnectionObserver*> param(this);
+	TImImap4GetMailInfo imap4GetMailInfo;
+	imap4GetMailInfo.iMaxEmailSize = KMaxTInt;
+	imap4GetMailInfo.iDestinationFolder = KMsvGlobalInBoxIndexEntryIdValue;
+	imap4GetMailInfo.iGetMailBodyParts = EGetImap4EmailBodyTextAndAttachments;
+			
+	TPckgBuf<TImImap4GetMailInfo> package(imap4GetMailInfo);
+	
+	CMsvEntry* inboxEntry=NULL;
+	CMsvEntry* imapService=NULL;
+	TMsvSelectionOrdering ordering;
+	
+	switch(iNextStep)
+		{
+		//connect and sync	
+		case EDisconnect:
+			iNextStep=EComplete;
+			delete iMsvOperation;
+			iMsvOperation=NULL;
+			iMsvOperation = iClientMtm->InvokeAsyncFunctionL(KIMAP4MTMDisconnect,*iSelection,param,iStatus);	
+			SetActive();
+			break;	
+			
+		case EFetch:
+			iNextStep=EDisconnect;
+			// message in remote inbox					
+			//create a CMsvEntry for the service entry
+			imapService = CMsvEntry::NewL(*iSession, iImapAccount.iImapService,ordering);
+			CleanupStack::PushL(imapService);
+			//retrieve the inbox from the imap service entry
+			CMsvEntrySelection* msvEntrySelection;
+			msvEntrySelection=imapService->ChildrenL();
+			CleanupStack::PushL(msvEntrySelection);
+			//create a CMsvEntry for the inbox entry
+			inboxEntry = CMsvEntry::NewL(*iSession, (*msvEntrySelection)[0],ordering);
+			CleanupStack::PopAndDestroy(msvEntrySelection);
+			CleanupStack::PushL(inboxEntry);
+			//retrieve the message from the inboxEntry service entry
+			msvEntrySelection=inboxEntry->ChildrenL();
+			CleanupStack::PushL(msvEntrySelection);
+			//append the message entry to our selection
+			iSelection->AppendL((*msvEntrySelection)[0]);
+			//cleanup
+			CleanupStack::PopAndDestroy(msvEntrySelection);
+			CleanupStack::PopAndDestroy(inboxEntry);
+			CleanupStack::PopAndDestroy(imapService);
+
+	 
+			package = imap4GetMailInfo;
+			delete iMsvOperation;
+			iMsvOperation=NULL;
+			iMsvOperation = iClientMtm->InvokeAsyncFunctionL(KIMAP4MTMCopyMailSelectionWhenAlreadyConnected, *iSelection, package, iStatus);	
+			SetActive();
+			break;
+		
+		case EComplete:
+			//inform the owning object that the process is complete
+			iOwner->HandleEvent(KErrNone);
+			break;
+			
+		default:
+			__ASSERT_DEBUG(0, User::Panic(_L("CActiveImapClient unknown state"), KErrUnknown));
+			break;			
+		}
+
+	}
+	
+	
+TInt CActiveImapClient::RunError(TInt aError)
+	{
+	iOwner->HandleEvent(aError);
+	return KErrNone;
+	}
+	
+void CActiveImapClient::HandleImapConnectionEvent(TImapConnectionEvent /*aConnectionState*/)
+	{
+	//this method does nothing
+	}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/ImapSpoofServer.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,160 @@
+// Copyright (c) 2005-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:
+// imapserver.cpp
+// 
+//
+ 
+#include "imapspoofserver.h"
+
+//
+// CImapSpoofServer
+//
+
+const TInt KImapPortNumber = 143;
+
+CImapSpoofServer::CImapSpoofServer() : CActive(EPriorityStandard)
+	{
+	iServerStatus=EIdle;
+	}
+
+EXPORT_C CImapSpoofServer* CImapSpoofServer::NewL(MImapTestEventHandler* aOwner,const TDesC& aScriptFile)
+	{
+	CImapSpoofServer* self = NewLC(aOwner,aScriptFile);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+EXPORT_C CImapSpoofServer* CImapSpoofServer::NewLC(MImapTestEventHandler* aOwner,const TDesC& aScriptFile)
+	{
+	CImapSpoofServer* self = new(ELeave) CImapSpoofServer;
+	CleanupStack::PushL(self);
+	self->ConstructL(aOwner,aScriptFile);
+	return self;
+	}
+	
+CImapSpoofServer::~CImapSpoofServer()
+	{
+	Cancel();	
+	iListeningSocket.Close();
+	iServiceSocket.Close();
+	iSocketServer.Close();
+	delete iScriptFileProcessor;
+	}
+
+EXPORT_C TInt CImapSpoofServer::RunError(TInt aError)
+	{
+	iOwner->HandleEvent(aError);
+	return KErrNone;
+	}
+
+void CImapSpoofServer::ConstructL(MImapTestEventHandler* aOwner,const TDesC& aScriptFile)
+	{
+	CActiveScheduler::Add(this); 
+	iOwner=aOwner;
+	//connect to the socket server
+	User::LeaveIfError(iSocketServer.Connect());
+	//create the script file processor
+	iScriptFileProcessor = CScriptFileProcessor::NewL(aScriptFile);	
+	}
+
+void CImapSpoofServer::DoCancel()
+	{
+	iListeningSocket.CancelAccept();
+	}
+	
+void CImapSpoofServer::StartL()
+	{
+	iServerStatus = EWriting;
+	//set up the listening socket
+	User::LeaveIfError(iListeningSocket.Open(iSocketServer, KAfInet, KSockStream, KProtocolInetTcp));
+	//bind the listener to any address from port 143
+	TSockAddr address;
+	address.SetPort(KImapPortNumber);
+	iListeningSocket.Bind(address);
+	//listen for incomming connections
+	iListeningSocket.Listen(KListeningSocketQueueSize);
+	//accept incomming connections and use iServiceSocket to communicate with it.
+	User::LeaveIfError(iServiceSocket.Open(iSocketServer));
+	iListeningSocket.Accept(iServiceSocket,iStatus);
+	SetActive();	
+	}
+
+	
+void CImapSpoofServer::IssueWrite()
+	{			
+    iBuffer.Zero();
+  	iBuffer.Append(iNextLine);
+	iBuffer.Append(_L("\r\n"));
+	iServiceSocket.Write(iBuffer, iStatus);
+	SetActive();
+	}
+
+void CImapSpoofServer::IssueRead()
+	{
+    iBuffer.Zero();
+  	iServiceSocket.RecvOneOrMore(iBuffer, 0, iStatus,iReadLength);
+  	SetActive();
+	}
+ 
+void CImapSpoofServer::RunL()
+	{	
+	
+	CScriptFileProcessor::TDataDirection direction;
+
+	if (iStatus == KErrNone)
+		{		
+		iBuffer.TrimAll();
+		if(iServerStatus==EReading)
+			{
+			if(iNextLine!=iBuffer)
+				{
+				iOwner->HandleEvent(KErrCorrupt);		
+				}		
+			}
+		//read next line of script file
+		//if weve reached the end of the file then inform the owning object
+		TInt err = iScriptFileProcessor->ReadLine(iNextLine);
+		
+		if(err==KErrEof)
+			{
+			iOwner->HandleEvent(KErrEof);	
+			}
+		else if(err==KErrNone)
+			{
+			direction=iScriptFileProcessor->DataDirection();
+		
+    		//if we are sending then write the line, else read 
+    		if(direction==CScriptFileProcessor::EFromServer)
+    			{
+    			iServerStatus=EWriting;	
+    			IssueWrite();
+    			}
+    		else if(direction==CScriptFileProcessor::EFromClient)
+    			{
+    			iServerStatus=EReading;
+    			IssueRead();
+    			}    	
+			}
+		else
+			{
+			iOwner->HandleEvent(err);	
+			}
+		}	
+	else
+		{
+		iOwner->HandleEvent(iStatus.Int());		
+		}
+		
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/ScriptFileProcessor.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,128 @@
+// Copyright (c) 2005-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 "scriptfileprocessor.h"
+
+
+const TChar KDelimiter=0x0A;
+//
+//CScriptFileProcessor
+//
+
+CScriptFileProcessor* CScriptFileProcessor::NewLC(const TDesC& aScriptFile)
+	{
+	CScriptFileProcessor* self=new (ELeave)CScriptFileProcessor;
+	CleanupStack::PushL(self);
+	self->ConstructL(aScriptFile);
+	return self;
+	}
+
+
+CScriptFileProcessor* CScriptFileProcessor::NewL(const TDesC& aScriptFile)
+	{
+	CScriptFileProcessor* self=CScriptFileProcessor::NewLC(aScriptFile);
+	CleanupStack::Pop(self);
+	return self;
+	}
+	
+void CScriptFileProcessor::ConstructL(const TDesC& aScriptFile)
+	{
+	User::LeaveIfError(iFSession.Connect());
+    User::LeaveIfError(iFile.Open(iFSession, aScriptFile, EFileRead));
+    iFileReadStream.Attach(iFile);   
+	}
+
+CScriptFileProcessor::CScriptFileProcessor()
+	{
+	}	
+CScriptFileProcessor::~CScriptFileProcessor()
+	{
+	iFile.Close();
+	iFileReadStream.Close();
+	iFSession.Close();
+	}
+	
+//
+//DataDirection
+//
+ 
+CScriptFileProcessor::TDataDirection CScriptFileProcessor::DataDirection() const
+	{
+	return iDataDirection; 	
+	}
+
+//
+//ProcessLine
+//
+
+ TInt CScriptFileProcessor::ProcessLine(TDes8& aLine)
+	{
+		
+	//get the direction of the data
+	const TInt KSpecifierLength=3;	
+	_LIT8(KFromServer,"<< ");
+	_LIT8(KFromClient,">> ");
+	
+	//if the data is from the server then the specifier should be at the begining of the line
+	TInt pos;
+	pos=aLine.Find(KFromServer);
+	if(pos==0)
+		{
+		iDataDirection=EFromServer;	
+		}
+	else 
+		{
+		//if the data is from the client then the specifier should be at the begining of the line
+		pos=aLine.Find(KFromClient);
+		if(pos==0)
+			{
+			iDataDirection=EFromClient;	
+			}	
+		else
+			{
+			//there has been an error, the spefifier was not found
+			return KErrNotFound;
+			}
+		} 
+		
+	//trim the specifier from the start of the line	
+	aLine=aLine.Right(aLine.Length()-KSpecifierLength);
+	//trim off trailing \r\n
+	aLine.TrimRight();
+	
+	return KErrNone;
+	}
+	
+//
+//ReadLine
+//
+	
+TInt CScriptFileProcessor::ReadLine(TDes8& aLine)
+ {
+ 
+	aLine.Zero();
+	//read the line
+ 	TRAPD(err, iFileReadStream.ReadL(aLine, KDelimiter));
+ 	if (err != KErrNone)
+    	{
+     	return err; 
+     	} 
+    //process the line
+    err=ProcessLine(aLine);
+ 
+    // Haven't reached end of the file yet
+ 	return err; 
+ }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_ConnectAndSyncAfterDisconnect.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,356 @@
+// Copyright (c) 2006-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:
+// Name of test harness: T_ConnectAndSyncAfterDisconnect.cpp 
+// Component: imapservermtm
+// Output files produced by running test harness:
+// <DRIVE>:\msglogs\T_ConnectAndSyncAfterDisconnect.WINSCW.DEB.LOG
+// 
+//
+
+
+#include "EmailTestUtils.h"
+#include <ImapConnectionObserver.H>
+#include <cemailaccounts.h>
+
+
+_LIT(KAt ,"@");
+_LIT8(KFolderPath, "");
+_LIT(KServer, ".intra");
+_LIT(KConnectAndSyncAfterDisconnect, " Testing ConnectAndSyncAfterDisconnect");
+_LIT(KMsgCompleted, "\t CopyL completed with : %d");
+_LIT(KMsgSend, "\t messages to send in the outbox = : %d");
+_LIT(KProgressError, "\t Progress error = %d");
+	
+RTest test(KConnectAndSyncAfterDisconnect);
+TImapAccount imapAccount;
+LOCAL_D TMsvId imap4Service;
+LOCAL_D TMsvId smtpService;
+LOCAL_D CEmailTestUtils* testUtils;
+LOCAL_D CTrapCleanup* theCleanup;
+
+#if defined (__WINS__)
+	#define PDD_NAME		_L("ECDRV")
+	#define LDD_NAME		_L("ECOMM")
+#else
+	#define PDD_NAME		_L("EUART1")
+	#define LDD_NAME		_L("ECOMM")
+#endif
+	// local variables etc //
+
+class TDummySessionObserver : public CBase , public MMsvSessionObserver
+	{
+public:
+	void HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
+		{}
+	};
+	
+
+class CDummyConnectionObserver : public MMsvImapConnectionObserver
+	{
+		void HandleImapConnectionEvent(TImapConnectionEvent /*aConnectionEvent*/)
+		{}
+	};
+
+// Disconnect from ImapServer
+LOCAL_C void DisconnectImapServerL()
+	{
+	test.Printf(_L("DisConnecting to IMAP server                      \n"));
+	CTestActive* testActive = new (ELeave) CTestActive();
+	CleanupStack::PushL(testActive);
+ 	
+  	CMsvEntrySelection *msvSelection = new(ELeave) CMsvEntrySelection;
+	CleanupStack::PushL(msvSelection);
+	msvSelection->AppendL(imap4Service);
+
+	TBuf8 <1> aParameter;
+  	CMsvOperation* msvOperation = testUtils->iImapClientMtm->InvokeAsyncFunctionL(KIMAP4MTMDisconnect,*msvSelection, aParameter, testActive->iStatus);
+	testUtils->WriteComment(_L("Dissconnect from IMAP server  "));
+	CleanupStack::PushL(msvOperation);
+
+	testActive->StartL();
+	CActiveScheduler::Start();
+	CleanupStack::PopAndDestroy(3,testActive);//msvOperation,msvSelection,children,testActive
+	}
+
+
+LOCAL_C void ConnectAndFullSyncImapServerL()
+	{
+	CTestActive* testActive = new(ELeave) CTestActive();
+	CleanupStack::PushL(testActive);
+	
+	CMsvEntrySelection * msvSelection = new(ELeave) CMsvEntrySelection;
+	CleanupStack::PushL(msvSelection);
+	
+	test.Printf(_L("Connecting to IMAP server             \n"));
+	msvSelection->AppendL(imap4Service);
+	
+	CDummyConnectionObserver *dummyObserver = new(ELeave)CDummyConnectionObserver; 
+	CleanupStack::PushL(dummyObserver);
+	TPckg<MMsvImapConnectionObserver*> aParameter(dummyObserver);
+  	
+  	CMsvOperation* msvOperation = testUtils->iImapClientMtm->InvokeAsyncFunctionL(KIMAP4MTMConnectAndSyncCompleteAfterDisconnect,*msvSelection, aParameter, testActive->iStatus);
+   	testUtils->WriteComment(_L(" Connect to Imap server and Sync the mails  "));
+	CleanupStack::PushL(msvOperation);
+	
+	testActive->StartL();
+	CActiveScheduler::Start();
+
+   	CleanupStack::PopAndDestroy(4,testActive);//msvOperation,dummyObserver,msvSelection,testActive
+   	}
+
+
+//	
+LOCAL_C void CreateNewSmtpSettingsL()
+	{
+	testUtils->iMsvEntry->SetEntryL(smtpService);
+	TMsvId serviceId = smtpService;
+	//overwrite the settings with test code one.  Don't want the default settings.
+	CImSmtpSettings* settings = new(ELeave) CImSmtpSettings();
+	CleanupStack::PushL(settings);
+	CEmailAccounts* accounts = CEmailAccounts::NewLC();
+	TSmtpAccount smtpAccountId;
+	accounts->GetSmtpAccountL( serviceId, smtpAccountId);
+	accounts->LoadSmtpSettingsL(smtpAccountId, *settings);
+	TInt serverLength = testUtils->MachineName().Length();
+	HBufC* serverad = HBufC::NewL(serverLength + 7 ); // 7 is the length of KServerAddress
+	CleanupStack::PushL(serverad);
+	serverad->Des().Copy(testUtils->MachineName());
+	serverad->Des().Append(KServer);	
+    settings->SetServerAddressL(*serverad);
+    HBufC* emailaddress = HBufC::NewL(serverLength + 8 + serverad->Des().Length() + 1 );
+   	CleanupStack::PushL(emailaddress);
+   	emailaddress->Des().Copy(testUtils->MachineName());
+   	emailaddress->Des().Append(KAt);
+   	emailaddress->Des().Append(*serverad);
+   	settings->SetEmailAddressL(*emailaddress);
+	settings->SetReplyToAddressL(*emailaddress);
+	settings->SetReceiptAddressL(*emailaddress);
+	settings->SetEmailAliasL(_L("Test Account"));
+	settings->SetBodyEncoding(EMsgOutboxMIME);
+	settings->SetRequestReceipts(EFalse);
+	settings->SetPort(25);
+	TSmtpAccount smtpAccount;
+ 	accounts->GetSmtpAccountL(smtpService, smtpAccount);
+	accounts->SaveSmtpSettingsL(smtpAccount, *settings);
+	CleanupStack::PopAndDestroy(emailaddress);
+	CleanupStack::PopAndDestroy(serverad);
+	CleanupStack::PopAndDestroy(2,settings);
+	testUtils->WriteComment(_L("Created New SmtpSettings  "));	
+		
+	}
+LOCAL_C void CreateNewPlaintextMessageL()
+	{
+	CTestActive* testActive = new(ELeave) CTestActive();
+	CleanupStack::PushL(testActive);
+	TMsvEmailTypeList msvEmailTypeList = 0;
+	TMsvPartList partList = (KMsvMessagePartBody | KMsvMessagePartAttachments);
+	CImEmailOperation* emailOperation = CImEmailOperation::CreateNewL(testActive->iStatus, *(testUtils->iMsvSession),KMsvGlobalOutBoxIndexEntryId, partList, msvEmailTypeList, KUidMsgTypeSMTP);
+	CleanupStack::PushL(emailOperation);
+	TestMsvOperationTimer* testMsvOperationTimer = TestMsvOperationTimer::NewLC(test.Console(), emailOperation, test);
+	testActive->StartL();
+	testMsvOperationTimer->IssueRequest();
+	CActiveScheduler::Start();
+	//check progress
+	TMsvId temp;
+	TPckgC<TMsvId> paramPack(temp);
+	const TDesC8& progBuf = emailOperation->ProgressL();
+	paramPack.Set(progBuf);
+	TMsvId newMessageId;
+	newMessageId = paramPack();
+	test(newMessageId != NULL);
+	testUtils->WriteComment(_L("\t Created New plaintext message"));
+	testUtils->iMsvEntry->SetEntryL(newMessageId);
+    CMsvStore* store = testUtils->iMsvEntry->EditStoreL();
+	CleanupStack::PushL(store);
+	CImHeader* header = CImHeader::NewLC();
+	header->RestoreL(*store);
+	
+	TInt serverLength = testUtils->MachineName().Length();
+	HBufC* serverad = HBufC::NewL(serverLength + 7 ); // 7 is the length of KServerAddress
+	CleanupStack::PushL(serverad);
+	serverad->Des().Copy(testUtils->MachineName());
+	serverad->Des().Append(KServer);	
+    HBufC* emailaddress = HBufC::NewL(serverLength + 8 + serverad->Des().Length() + 1 );
+   	CleanupStack::PushL(emailaddress);
+   	emailaddress->Des().Copy(testUtils->MachineName());
+   	emailaddress->Des().Append(KAt);
+   	emailaddress->Des().Append(*serverad);
+   	header->ToRecipients().AppendL(*emailaddress);
+   	
+	header->SetSubjectL(_L("Test sending message using CMsvEntry::CopyL!!"));
+	header->StoreL(*store);
+	store->CommitL();
+	CleanupStack::PopAndDestroy(emailaddress);
+	CleanupStack::PopAndDestroy(serverad);
+	CleanupStack::PopAndDestroy(5,testActive); // header,store,testMsvOperationTimer,emailOperation,testActive
+	
+		
+	}
+LOCAL_C void SendSmtpMessageL()
+	{
+	CTestActive* testActive = new (ELeave) CTestActive();
+	CleanupStack::PushL(testActive);
+	testUtils->iMsvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);
+	testUtils->InstantiateSmtpClientMtmL();
+	CMsvEntrySelection* sendSel = testUtils->iMsvEntry->ChildrenL();
+	CleanupStack::PushL(sendSel);
+	TInt count = sendSel->Count();
+	test(count >= 1);
+	testUtils->Printf(KMsgSend, count);
+	testUtils->iSmtpClientMtm->SetCurrentEntryL(testUtils->iMsvSession->GetEntryL(KMsvGlobalOutBoxIndexEntryId));
+	CMsvOperation* msvOperation = testUtils->iSmtpClientMtm->Entry().CopyL(*sendSel, smtpService, testActive->iStatus);
+	CleanupStack::PushL(msvOperation);
+	testActive->StartL();
+	CActiveScheduler::Start();
+
+	//check progress
+    testUtils->Printf(KMsgCompleted, testActive->iStatus.Int()); 
+
+	CMsvEntrySelection* sendSelc = testUtils->iMsvEntry->ChildrenL();
+	TInt noOfMessages = sendSelc->Count();
+
+	// Check Whether the mails in Outbox is Zero (i.e. mails has been sent..).
+    test(noOfMessages == 0);
+  	delete sendSelc;
+ 	TImSmtpProgress temp;	
+	TPckgC<TImSmtpProgress> paramPack(temp);
+	const TDesC8& progBuf = msvOperation->ProgressL();
+	paramPack.Set(progBuf);
+	TImSmtpProgress progress = paramPack();	
+	
+	testUtils->Printf(KProgressError, progress.Error()); 
+
+	test(progress.Error()==0);
+	CleanupStack::PopAndDestroy(3,testActive); //msvOperation,sendsel,testActive
+	}
+	
+LOCAL_C void CreateandSendMessageL()
+	{
+	test.Next(_L("Test sending message to server "));
+	CreateNewSmtpSettingsL();
+	testUtils->iMsvEntry->SetEntryL(smtpService);
+	CreateNewPlaintextMessageL();
+	SendSmtpMessageL();
+	}
+
+LOCAL_C void TestConnectAndSyncAfterDisconnectL()
+	{
+	CreateandSendMessageL();
+	// Tests start here
+	testUtils->iImapClientMtm->SwitchCurrentEntryL(imap4Service);
+	// connect, do full sync and then  so that the inbox can be synced
+    test.Printf(_L("Connecting to IMAP server            \n"));
+    ConnectAndFullSyncImapServerL();
+    //Check if disconnects immediately
+    DisconnectImapServerL();
+	}
+
+LOCAL_C void InitL()
+	{
+	// Load the serial comms device drivers.  If this is not done,
+	// connecting via NT-RAS returns KErrNotFound (-1).
+	TInt driverErr;
+	driverErr=User::LoadPhysicalDevice(PDD_NAME);
+	if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists)
+		User::Leave(driverErr);
+	driverErr=User::LoadLogicalDevice(LDD_NAME);
+	if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists)
+		User::Leave(driverErr);
+
+	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
+	CActiveScheduler::Install(scheduler);
+	CleanupStack::PushL(scheduler);
+	testUtils = CEmailTestUtils::NewLC(test);
+	testUtils->CreateAllTestDirectories();
+	testUtils->FileSession().SetSessionPath(_L("C:\\"));
+	testUtils->CleanMessageFolderL();
+	testUtils->GoServerSideL();
+    testUtils->ClearEmailAccountsL();
+	test.Next(_L("Create Data Component FileStores"));
+	testUtils->CreateSmtpServerMtmRegL();
+	//	Loading the DLLs
+	testUtils->CreateRegistryObjectAndControlL();
+	testUtils->InstallSmtpMtmGroupL();
+	testUtils->GoClientSideL();
+	// Create Services
+	smtpService = testUtils->CreateSmtpServiceL();
+	imap4Service = testUtils->CreateImapServiceL();
+	CEmailAccounts* accounts = CEmailAccounts::NewLC();
+	TSmtpAccount smtpAccount;
+	accounts->GetSmtpAccountL(smtpService, smtpAccount);
+	accounts->SetDefaultSmtpAccountL(smtpAccount);
+    testUtils->WriteComment(_L("Create  Imap   Services           ")); 
+	// Delete any *.scr files in c:\logs\email directory.
+	testUtils->DeleteScriptFilesFromLogsDirL();
+
+	testUtils->iMsvEntry->SetEntryL(imap4Service);
+	//overwrite the settings with test code one.  Don't want the default settings.
+	CImImap4Settings* settings = new(ELeave) CImImap4Settings();
+	CleanupStack::PushL(settings);
+	settings->Reset();
+	TInt serverLength = testUtils->MachineName().Length();
+	HBufC* serverad = HBufC::NewL(serverLength + 7 ); // 7 is the length of KServerAddress
+	CleanupStack::PushL(serverad);
+	serverad->Des().Copy(testUtils->MachineName());
+	serverad->Des().Append(KServer);
+	settings->SetServerAddressL(*serverad);
+	CleanupStack::PopAndDestroy(serverad); 
+	settings->SetDeleteEmailsWhenDisconnecting(ETrue);
+	settings->SetAcknowledgeReceipts(ETrue);
+	settings->SetAutoSendOnConnect(ETrue);
+	settings->SetLoginNameL(testUtils->MachineName());
+	settings->SetPasswordL(testUtils->MachineName());
+   	settings->SetPort(143);
+	settings->SetFolderPathL(KFolderPath);
+	accounts->GetImapAccountL(imap4Service, imapAccount);
+	accounts->SaveImapSettingsL(imapAccount, *settings);
+	CleanupStack::PopAndDestroy(2,accounts); //accounts,settings
+	test.Printf(_L("Instantiating IMAP4 Client MTM"));
+	testUtils->InstantiateImapClientMtmL();
+	}
+	
+LOCAL_C void Closedown()
+	{
+     
+	CleanupStack::PopAndDestroy(2);  //testUtils, scheduler 
+	}
+
+LOCAL_C void doMainL()
+	{
+	test.Start(_L("Test - ConnectAndSyncAfterDisconnect"));
+	InitL();
+  	testUtils->TestStart(1);
+	TestConnectAndSyncAfterDisconnectL();
+ 	testUtils->TestFinish(1);
+
+	testUtils->TestHarnessCompleted();
+
+	Closedown();		
+	}
+
+
+GLDEF_C TInt E32Main()
+	{
+	__UHEAP_MARK;
+	theCleanup=CTrapCleanup::New();
+	TRAPD(ret,doMainL());		
+	test(ret==KErrNone);
+	delete theCleanup;	
+	test.Console()->SetPos(0, 13);
+	test.End();
+	test.Close();
+	__UHEAP_MARKEND;
+	return(KErrNone);
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_DEF059571_IMAP_Client.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,227 @@
+// Copyright (c) 2005-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 "T_def059571_IMAP_client.h"
+
+_LIT(KLoopbackAddress,"127.0.0.1");
+
+void TDummySessionObserver::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
+	{
+	}
+	
+CActiveImapClient::CActiveImapClient(MImapTestEventHandler* aOwner)
+ : CActive(EPriorityStandard), iOwner(aOwner)
+	{
+	CActiveScheduler::Add(this); 	
+	}
+
+EXPORT_C CActiveImapClient* CActiveImapClient::NewL(MImapTestEventHandler* aOwner)
+	{
+	CActiveImapClient* self = NewLC(aOwner);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+EXPORT_C CActiveImapClient* CActiveImapClient::NewLC(MImapTestEventHandler* aOwner)
+	{
+	CActiveImapClient* self = new(ELeave) CActiveImapClient(aOwner);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+	
+CActiveImapClient::~CActiveImapClient()
+	{
+	Cancel();
+	delete iMsvOperation;	
+	delete iSelection;
+	delete iClientMtm;
+	delete iClientRegistry;	
+	delete iSession;
+	delete iSessionObserver;
+	delete iAccounts;
+	}
+	
+	
+void CActiveImapClient::ConstructL()
+	{	
+	// create an account
+	iAccounts = CEmailAccounts::NewL();	
+	CreateImapAccountL();
+	// Session observer. Needed to create a session
+	iSessionObserver = new (ELeave) TDummySessionObserver;
+	// Session. Needed to create a client registry.
+	iSession=CMsvSession::OpenSyncL(*iSessionObserver);
+	// Client registry. Needed to get the MTM component
+	iClientRegistry=CClientMtmRegistry::NewL(*iSession,KMsvDefaultTimeoutMicroSeconds32);
+	// get the client mtm
+	iClientMtm=iClientRegistry->NewMtmL(KUidMsgTypeIMAP4);	
+	
+	// Load the serial comms device drivers.  If this is not done,
+	// connecting via NT-RAS returns KErrNotFound (-1).
+	TInt driverErr;
+	driverErr=User::LoadPhysicalDevice(PDD_NAME);
+	if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists)
+		User::Leave(driverErr);
+	driverErr=User::LoadLogicalDevice(LDD_NAME);
+	if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists)
+		User::Leave(driverErr);
+	}
+	
+TImapAccount CActiveImapClient::GetImapAccount()
+	{
+	return iImapAccount;
+	}
+	
+void CActiveImapClient::CreateImapAccountL()
+	{
+	// create objects and initialise with the defaults
+	CImImap4Settings* imap4Settings=new(ELeave)CImImap4Settings;
+	CleanupStack::PushL(imap4Settings);
+	CImSmtpSettings* smtpSettings=new(ELeave)CImSmtpSettings;
+	CleanupStack::PushL(smtpSettings);
+	CImIAPPreferences* imapIap = CImIAPPreferences::NewLC();
+	CImIAPPreferences* smtpIap = CImIAPPreferences::NewLC();
+	
+	iAccounts->PopulateDefaultImapSettingsL(*imap4Settings, *imapIap);
+	iAccounts->PopulateDefaultSmtpSettingsL(*smtpSettings, *smtpIap);
+	
+	// override some of the defaults
+	imap4Settings->SetPasswordL(_L8("ralphs"));
+	imap4Settings->SetLoginNameL(_L8("ralphs"));
+	imap4Settings->SetServerAddressL(KLoopbackAddress);
+	imap4Settings->SetFolderPathL(_L8(""));
+	imap4Settings->SetSynchronise(EUseLocal);
+	
+	// create the account
+	iImapAccount = iAccounts->CreateImapAccountL(_L("TestAccount"), *imap4Settings, *imapIap, EFalse);
+	TSmtpAccount smtpAccount;
+	smtpAccount = iAccounts->CreateSmtpAccountL(iImapAccount, *smtpSettings, *smtpIap, EFalse);
+
+	// clean up
+	CleanupStack::PopAndDestroy(smtpIap);
+	CleanupStack::PopAndDestroy(imapIap);	
+	CleanupStack::PopAndDestroy(smtpSettings);
+	CleanupStack::PopAndDestroy(imap4Settings); 
+	}
+
+void CActiveImapClient::StartL()
+	{
+	
+	// we are to collect the whole email: the next operation will be to fetch it
+	iNextStep = EFetch;
+	iSelection = new (ELeave) CMsvEntrySelection;
+	TPckg<MMsvImapConnectionObserver*> param(this);
+	// select the imap service entry
+	iSelection->AppendL(iImapAccount.iImapService);
+	// make the service entry the current context
+	iClientMtm->SwitchCurrentEntryL(iImapAccount.iImapService);
+	// sync the account
+	iMsvOperation = iClientMtm->InvokeAsyncFunctionL(KIMAP4MTMConnectAndSyncCompleteAfterFullSync,*iSelection,param,iStatus);			
+	SetActive();
+	}
+	
+void CActiveImapClient::DoCancel()
+	{	
+	__ASSERT_DEBUG(iMsvOperation!=NULL, User::Panic(_L("CActiveImapClient"), -3));
+	iMsvOperation->Cancel();
+	}
+
+void CActiveImapClient::RunL()
+	{
+
+	TPckg<MMsvImapConnectionObserver*> param(this);
+	TImImap4GetMailInfo imap4GetMailInfo;
+	imap4GetMailInfo.iMaxEmailSize = KMaxTInt;
+	imap4GetMailInfo.iDestinationFolder = KMsvGlobalInBoxIndexEntryIdValue;
+	imap4GetMailInfo.iGetMailBodyParts = EGetImap4EmailBodyTextAndAttachments;
+			
+	TPckgBuf<TImImap4GetMailInfo> package(imap4GetMailInfo);
+	
+	CMsvEntry* inboxEntry=NULL;
+	CMsvEntry* imapService=NULL;
+	TMsvSelectionOrdering ordering;
+	
+	switch(iNextStep)
+		{
+		// connect and sync	
+		case EDisconnect:
+			{
+			iNextStep=EComplete;
+			delete iMsvOperation;
+			iMsvOperation=NULL;
+			iMsvOperation = iClientMtm->InvokeAsyncFunctionL(KIMAP4MTMDisconnect,*iSelection,param,iStatus);	
+			SetActive();
+			break;	
+			}
+		case EFetch:
+			{
+			iNextStep=EDisconnect;
+			// message in remote inbox					
+			// create a CMsvEntry for the service entry
+			imapService = CMsvEntry::NewL(*iSession, iImapAccount.iImapService,ordering);
+			CleanupStack::PushL(imapService);
+			// retrieve the inbox from the imap service entry
+			CMsvEntrySelection* msvEntrySelection;
+			msvEntrySelection=imapService->ChildrenL();
+			CleanupStack::PushL(msvEntrySelection);
+			// create a CMsvEntry for the inbox entry
+			inboxEntry = CMsvEntry::NewL(*iSession, (*msvEntrySelection)[0],ordering);
+			CleanupStack::PopAndDestroy(msvEntrySelection);
+			CleanupStack::PushL(inboxEntry);
+			// retrieve the message from the inboxEntry service entry
+			msvEntrySelection=inboxEntry->ChildrenL();
+			CleanupStack::PushL(msvEntrySelection);
+			// append the message entry to our selection
+			iSelection->AppendL((*msvEntrySelection)[0]);
+			// cleanup
+			CleanupStack::PopAndDestroy(msvEntrySelection);
+			CleanupStack::PopAndDestroy(inboxEntry);
+			CleanupStack::PopAndDestroy(imapService);
+
+			package = imap4GetMailInfo;
+			delete iMsvOperation;
+			iMsvOperation=NULL;
+			iMsvOperation = iClientMtm->InvokeAsyncFunctionL(KIMAP4MTMCopyMailSelectionWhenAlreadyConnected, *iSelection, package, iStatus);	
+			SetActive();
+			break;
+			}
+		case EComplete:
+			{
+			// inform the owning object that the process is complete
+			iOwner->TestComplete(KErrNone);
+			break;
+			}
+		default:
+			{
+			__ASSERT_DEBUG(0, User::Panic(_L("CActiveImapClient unknown state"), KErrUnknown));
+			break;			
+			}
+		}
+	}
+	
+TInt CActiveImapClient::RunError(TInt aError)
+	{
+	iOwner->TestComplete(aError);
+	return KErrNone;
+	}
+	
+void CActiveImapClient::HandleImapConnectionEvent(TImapConnectionEvent /*aConnectionState*/)
+	{
+	// this method does nothing
+	}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_DEF059571_IMAP_MissingOffsetServer.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,85 @@
+// Copyright (c) 2005-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 "T_DEF059571_IMAP_MissingOffsetServer.h"
+#include "T_DEF059571_IMAP_MissingOffsetStep.h"
+
+_LIT(KServerName,"T_DEF059571_IMAP_MissingOffset");
+
+CImapMissingOffsetServer* CImapMissingOffsetServer::NewL()
+	{
+	CImapMissingOffsetServer * server = new (ELeave) CImapMissingOffsetServer();
+	CleanupStack::PushL(server);
+	server->ConstructL(KServerName);
+
+	CleanupStack::Pop(server);
+	return server;
+	}
+
+CImapMissingOffsetServer::CImapMissingOffsetServer()
+	{}
+
+CImapMissingOffsetServer::~CImapMissingOffsetServer()
+	{}
+
+LOCAL_C void MainL()
+	{
+	CActiveScheduler* sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CleanupStack::PushL(sched);
+	CActiveScheduler::Install(sched);
+	CImapMissingOffsetServer* server = NULL;
+	// Create the CTestServer derived server
+	TRAPD(err,server = CImapMissingOffsetServer::NewL());
+	CleanupStack::PushL(server);
+	if(!err)
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	CleanupStack::PopAndDestroy(2,sched);
+	}
+
+GLDEF_C TInt E32Main()
+	{
+	__UHEAP_MARK;
+	
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAPD(err,MainL());
+	delete cleanup;
+	
+	__UHEAP_MARKEND;
+	return err;
+    }
+
+RFs& CImapMissingOffsetServer::Fs()
+	{
+	return iFs;
+	};	
+
+CTestStep* CImapMissingOffsetServer::CreateTestStep(const TDesC& aStepName)
+	{
+	CTestStep* testStep = NULL;
+	
+	if(aStepName == KTestImapMissingOffset)
+		testStep = new CTestImapMissingOffsetStep();
+
+	return testStep;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_DEF059571_IMAP_MissingOffsetStep.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,166 @@
+// Copyright (c) 2005-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:
+// t_parse_def059571_missingoffsetstep.cpp
+// 
+//
+
+#include <testexecutelog.h>
+#include "t_def059571_imap_missingoffsetstep.h"
+
+RTest test(_L("IMAP Missing Offset and HTML Test"));
+
+const TInt KSizeDateTimeBuffer = 45;
+const TInt KImapPort = 143;
+ 
+LOCAL_C void FormatDateTime(TDes& aBuffer, const TTime& aTime)
+	{ 
+	aBuffer.Zero();
+	_LIT(KFormat4,"%/0%1%/1%2%/2%3%/3 %-B%:0%J%:1%T%:2%S%:3%+B");
+	aTime.FormatL(aBuffer,KFormat4); 
+	}
+		
+CTestImapMissingOffsetStep::~CTestImapMissingOffsetStep()
+	{
+	delete iConsole;
+	delete iSpoofServer;	
+	delete iTestUtils;
+	delete iImapClient;	
+	delete iScheduler;
+	if(iSession!=NULL)
+		iSession->CloseMessageServer();
+	delete iSession;
+	delete iSessionObserver;
+	}
+
+CTestImapMissingOffsetStep::CTestImapMissingOffsetStep()
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KTestImapMissingOffset);
+	}
+
+void CTestImapMissingOffsetStep::TestComplete(TInt aEventCode)
+	{
+	CActiveScheduler::Stop();	
+	
+	if(aEventCode!=KErrNone && aEventCode!=KErrEof)
+		{
+		ERR_PRINTF2(_L("Error: %d"),aEventCode);	
+		}
+	}
+
+void CTestImapMissingOffsetStep::PrintEntryTime(TTime* aTIme)
+	{
+	TBuf<KSizeDateTimeBuffer> dateTimeString;
+	FormatDateTime(dateTimeString,*aTIme); 
+	INFO_PRINTF2(_L("%S"),&dateTimeString);	
+	}
+		
+void CTestImapMissingOffsetStep::GetDetailsFromIniFileL()
+	{
+	// get the script file path
+	_LIT(KScriptFile,"ScriptFile");	
+	if(!GetStringFromConfig(ConfigSection(),KScriptFile,iScriptFile))
+		{
+		_LIT(KErrorScriptFile, "Error reading script file path from ini file");
+		ERR_PRINTF1(KErrorScriptFile);
+		User::Leave(KErrArgument);
+		}
+	// get the expected number of mails
+	_LIT(KExpectedCountString, "ExpectedEntryCount");
+	if(!GetIntFromConfig(ConfigSection(),KExpectedCountString,iExpectedEntryCount))
+		{
+		_LIT(KErrorExpectedCount, "Error reading expected entry count from ini file");
+		ERR_PRINTF1(KErrorExpectedCount);
+		User::Leave(KErrArgument);	
+		}
+	}
+
+TVerdict CTestImapMissingOffsetStep::doTestStepPreambleL()
+	{
+	SetTestStepResult(EPass);
+	iScheduler = new (ELeave) CActiveScheduler;
+	CActiveScheduler::Install(iScheduler);
+	
+	iTestUtils = CEmailTestUtils::NewL(test);
+	iTestUtils->FileSession().SetSessionPath(_L("C:\\"));
+	iTestUtils->CleanMessageFolderL();
+	iTestUtils->ClearEmailAccountsL();
+	
+	iTestUtils->GoClientSideL();
+	
+	// start the imap server
+	GetDetailsFromIniFileL();
+	iConsole=Console::NewL(_L("IMAP Missing Offset Test"),TSize(KConsFullScreen,KConsFullScreen));
+	iSpoofServer = CSpoofServer::NewL(*this,iScriptFile);
+	iSpoofServer->StartL(KImapPort);
+		
+	// start the imap client
+	iImapClient = CActiveImapClient::NewL(this);
+	iImapClient->StartL();
+	
+	CActiveScheduler::Start();
+	return TestStepResult();
+	}
+
+TInt CTestImapMissingOffsetStep::GetEntryCountL()
+	{
+	TImapAccount imapAccount=iImapClient->GetImapAccount();
+	
+	TMsvSelectionOrdering ordering;	
+
+	// open the imap service entry
+	CMsvEntry* imapService = CMsvEntry::NewL(*iSession,imapAccount.iImapService,ordering);
+	CleanupStack::PushL(imapService);
+	// get its children
+	CMsvEntrySelection* msvEntrySelection;
+	msvEntrySelection=imapService->ChildrenL();
+	// open its child inbox entry
+	CMsvEntry* inboxEntry = CMsvEntry::NewL(*iSession, (*msvEntrySelection)[0],ordering);
+    CleanupStack::PushL(inboxEntry);
+    
+    // get the childeren of the inbox
+    delete msvEntrySelection;
+    msvEntrySelection=NULL;
+    msvEntrySelection=inboxEntry->ChildrenL();
+    // the count should be 1
+    TInt count=msvEntrySelection->Count();
+    
+    delete msvEntrySelection;
+    msvEntrySelection=NULL;	
+	CleanupStack::PopAndDestroy(2,imapService);
+	
+	return count;
+	}
+
+
+TVerdict CTestImapMissingOffsetStep::doTestStepL()
+	{
+	TVerdict result;
+	// Session observer. Needed to create a session
+	iSessionObserver = new (ELeave) TDummySessionObserver;
+	// Session. Needed to create a client registry.
+	iSession=CMsvSession::OpenSyncL(*iSessionObserver);
+	// get entry count
+	TInt entryCount=GetEntryCountL();
+	result = (entryCount==iExpectedEntryCount? EPass:EFail);
+	SetTestStepResult(result);
+	return TestStepResult();
+	}
+
+TVerdict CTestImapMissingOffsetStep::doTestStepPostambleL()
+	{
+	return TestStepResult();
+	}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_DEF062024_IMAP21cnServer_AttachmentCannotBeOpenedStep.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,250 @@
+// Copyright (c) 2005-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 sever contains and retrieves an email with an attachment (a v-card), the aim of th test is to check that this
+// attachmenet is fetched correctly by comparing its size and centent to the size and content of the source file attached.
+// 2. The client connects to the server, requests a sync and a populate
+// 3. The server reads the protocol information from a file specified in the ini file (ImapAttachmentTest.ini).
+// 4. The client disconnects.
+// 5. The attachment of the mail fetched is compared with the corresponding source file. The test passes if its size and content is exactly the same as the size and content of the file originally attached to this email, otherwise itv fails.
+// 
+//
+
+/**
+ @SYMTestCaseID DEF062024   
+ @SYMTestType UT					
+ @SYMTestPriority High			
+ @SYMDEF DEF062024					
+ @SYMTestCaseDesc Implements an IMAP server to facilitate offline testing of imap parsing. 
+ @SYMTestActions  1. The Server is started and listens on port 143.
+ @SYMTestExpectedResults The attachment file should have the same size and content as the source file originally attached.
+*/
+
+#include <testexecutelog.h>
+#include "t_DEF062024_IMAP21cnServer_AttachmentCannotBeOpenedStep.h"
+
+
+RTest test(_L("IMAP Get and check attachment Test"));
+const TInt KImapPort = 143;
+const TInt KChunkReadFile = 512;
+const TInt KSizeDateTimeBuffer = 45;
+
+ 
+LOCAL_C void FormatDateTime(TDes& aBuffer, const TTime& aTime)
+	{ 
+	aBuffer.Zero();
+	_LIT(KFormat4,"%/0%1%/1%2%/2%3%/3 %-B%:0%J%:1%T%:2%S%:3%+B");
+	aTime.FormatL(aBuffer,KFormat4); 
+	}
+		
+CTestImapAttachmentStep::~CTestImapAttachmentStep()
+	{
+	delete iConsole;
+	delete iSpoofServer;	
+	delete iTestUtils;
+	delete iImapClient;	
+	delete iScheduler;
+	iSession->CloseMessageServer();
+	delete iSession;
+	delete iSessionObserver;
+	}
+
+CTestImapAttachmentStep::CTestImapAttachmentStep()
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KTestImapAttachment);
+	}
+
+void CTestImapAttachmentStep::TestComplete(TInt aErrorCode)
+	{
+	CActiveScheduler::Stop();	
+	
+	if(aErrorCode!=KErrNone && aErrorCode!=KErrEof)
+		{
+		ERR_PRINTF2(_L("Error: %d"),aErrorCode);	
+		}
+	}
+ 
+		
+void CTestImapAttachmentStep::PrintEntryTime(TTime* aTIme)
+	{
+	TBuf<KSizeDateTimeBuffer> dateTimeString;
+	FormatDateTime(dateTimeString,*aTIme); 
+	_LIT(KDateTimeString, "%S");
+	INFO_PRINTF2(KDateTimeString,&dateTimeString);	
+	}
+		
+		
+void CTestImapAttachmentStep::GetDetailsFromIniFileL()
+	{
+	//get the script file path
+	_LIT(KScriptFile,"ScriptFile");	
+	if(!GetStringFromConfig(ConfigSection(),KScriptFile,iScriptFile))
+		{
+		_LIT(KErrorScriptFile, "Error reading script file path from ini file");
+		ERR_PRINTF1(KErrorScriptFile);
+		User::Leave(KErrArgument);	
+		}
+	// get the source path of the file attached to the mail
+	_LIT(KSourceAttach,"AttachmentSourcePath");
+	if(!GetStringFromConfig(ConfigSection(),KSourceAttach,iAttachmentSourcePath))
+		{
+		_LIT(KErrorSourceAttach, "Error reading attachment source file path from ini file");
+		ERR_PRINTF1(KErrorSourceAttach);
+		User::Leave(KErrArgument);	
+		}
+	// get the index of the attachment in this mail
+	_LIT(KAttachIndex, "AttachmentIndex");
+	if(!GetIntFromConfig(ConfigSection(),KAttachIndex,iAttachmentIndex))
+		{
+		_LIT(KErrorAttachIndex, "Error reading attachment index from ini file");
+		ERR_PRINTF1(KErrorAttachIndex);
+		User::Leave(KErrArgument);	
+		}
+	}	
+
+TVerdict CTestImapAttachmentStep::doTestStepPreambleL()
+	{
+	SetTestStepResult(EPass);
+	iScheduler = new (ELeave) CActiveScheduler;
+	CActiveScheduler::Install(iScheduler);
+	
+	iTestUtils = CEmailTestUtils::NewL(test);	
+	iTestUtils->FileSession().SetSessionPath(_L("C:\\"));
+	iTestUtils->CleanMessageFolderL();
+	iTestUtils->ClearEmailAccountsL();
+	
+	iTestUtils->GoClientSideL();	
+	
+	//start the imap server
+	GetDetailsFromIniFileL();
+	_LIT(KIMAPTest, "IMAP Email Attachment Test");
+	iConsole=Console::NewL(KIMAPTest,TSize(KConsFullScreen,KConsFullScreen));
+	iSpoofServer = CSpoofServer::NewL(*this,iScriptFile);
+	iSpoofServer->StartL(KImapPort);
+	//start the imap client
+	iImapClient = CActiveImapClient::NewL(*this);
+	iImapClient->StartL();
+	
+	CActiveScheduler::Start();
+	return TestStepResult();
+	}
+
+TVerdict CTestImapAttachmentStep::CheckAttachmentL() 
+	{
+	TVerdict result = EPass;
+	// Session observer. Needed to create a session
+	iSessionObserver = new (ELeave) TDummySessionObserver;
+	// Session. Needed to create a client registry.
+	iSession=CMsvSession::OpenSyncL(*iSessionObserver);
+	CMsvEntry* entry = iSession->GetEntryL(iImapClient->GetMessageId());
+	CleanupStack::PushL(entry);
+	CImEmailMessage* emailMsg = CImEmailMessage::NewL(*entry);
+	CleanupStack::PushL(emailMsg);
+	MMsvAttachmentManager& manager = emailMsg->AttachmentManager();
+	TInt attachmentCount = manager.AttachmentCount();
+	// Get the file attachment
+	RFile fileAttachment = manager.GetAttachmentFileL(iAttachmentIndex);
+	CleanupClosePushL(fileAttachment);
+	RFs fs;
+	User::LeaveIfError(fs.Connect());
+	CleanupClosePushL(fs);
+	RFile dataFile;
+	// Open the source file attached to the email
+	User::LeaveIfError(dataFile.Open(fs, iAttachmentSourcePath, EFileRead|EFileShareReadersOnly));
+	CleanupClosePushL(fs);
+	TInt fileSize = 0;
+	TInt attachmentSize = 0;
+	// Get the size of the source file
+	User::LeaveIfError(dataFile.Size(fileSize));
+	// Get the size of the attachment file
+	User::LeaveIfError(fileAttachment.Size(attachmentSize));
+	
+	// Check the sizes first, the source and attachment files must have the same size
+	if(fileSize!=attachmentSize)
+		{
+		result = EFail;				
+		}
+	else
+		{
+		// We compare the contents
+		TInt compare;
+		TBuf8<KChunkReadFile> dataBuffer;
+		TBuf8<KChunkReadFile> attachmentData;
+		if(fileSize < KChunkReadFile)
+			{			
+			dataFile.Read(0,dataBuffer);
+			fileAttachment.Read(0,attachmentData);
+			
+			compare = attachmentData.Compare(dataBuffer);
+			if(compare!=0)
+				{
+				result = EFail;
+				}
+			else
+				{
+				result = EPass;
+				}				
+			}
+		else
+			{
+			// The size of the files is big, we read them by chunks and compare them
+			TInt bytesRead = KChunkReadFile;
+			TInt ii = 0;
+			while (bytesRead < fileSize)	
+				{
+				// Get the i-th chunk of data of the source file
+				dataFile.Read(ii*KChunkReadFile,dataBuffer);
+				// Get the i-th chunk of data of the attachment file
+				fileAttachment.Read(ii*KChunkReadFile,attachmentData);
+				
+				// Compare the chunks
+				compare = attachmentData.Compare(dataBuffer);
+				if(compare != 0)
+					{
+					result = EFail;
+					break;
+					}
+				else
+					result = EPass;
+				bytesRead += KChunkReadFile;
+				++ii;
+				}
+			}		
+		}
+		
+	CleanupStack::PopAndDestroy(5, entry);
+	
+	return result;	
+	}
+		
+TVerdict CTestImapAttachmentStep::doTestStepL()
+	{
+	TVerdict result;	
+	
+	result = CheckAttachmentL();
+	
+	SetTestStepResult(result);
+	
+	return TestStepResult();
+	}
+	
+
+TVerdict CTestImapAttachmentStep::doTestStepPostambleL()
+	{
+	return TestStepResult();
+	}
+	
+	
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_DEF062024_IMAPClient.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,230 @@
+// Copyright (c) 2005-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:
+// IMAPClient.cpp
+// 
+//
+
+#include "t_def062024_imapclient.h"
+
+_LIT(KLoopbackAddress,"127.0.0.1");
+
+void TDummySessionObserver::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
+	{
+	}
+ 
+TImapAccount CActiveImapClient::GetAccount()
+	{
+	return iImapAccount;
+	}
+
+CActiveImapClient::CActiveImapClient(MImapTestEventHandler& aObserver)
+ : CActive(EPriorityStandard), iObserver(aObserver)
+	{
+	CActiveScheduler::Add(this); 	
+	}
+
+EXPORT_C CActiveImapClient* CActiveImapClient::NewL(MImapTestEventHandler& aObserver)
+	{
+	CActiveImapClient* self = NewLC(aObserver);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+EXPORT_C CActiveImapClient* CActiveImapClient::NewLC(MImapTestEventHandler& aObserver)
+	{
+	CActiveImapClient* self = new(ELeave) CActiveImapClient(aObserver);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+	
+CActiveImapClient::~CActiveImapClient()
+	{
+	Cancel();
+	delete iMsvOperation;	
+	delete iSelection;
+	delete iClientMtm;
+	delete iClientRegistry;	
+	delete iSession;
+	delete iSessionObserver;
+	delete iAccounts;
+	}
+	
+	
+void CActiveImapClient::ConstructL()
+	{	
+	//create an account
+	iAccounts = CEmailAccounts::NewL();	
+	CreateImapAccountL();
+	// Session observer. Needed to create a session
+	iSessionObserver = new (ELeave) TDummySessionObserver;
+	// Session. Needed to create a client registry.
+	iSession=CMsvSession::OpenSyncL(*iSessionObserver);
+	// Client registry. Needed to get the MTM component
+	iClientRegistry=CClientMtmRegistry::NewL(*iSession,KMsvDefaultTimeoutMicroSeconds32);
+	//get the client mtm
+	iClientMtm=iClientRegistry->NewMtmL(KUidMsgTypeIMAP4);	
+	
+	// Load the serial comms device drivers.  If this is not done,
+	// connecting via NT-RAS returns KErrNotFound (-1).
+	TInt driverErr;
+	driverErr=User::LoadPhysicalDevice(PDD_NAME);
+	if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists)
+		User::Leave(driverErr);
+	driverErr=User::LoadLogicalDevice(LDD_NAME);
+	if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists)
+		User::Leave(driverErr);
+	}
+	
+void CActiveImapClient::CreateImapAccountL()
+	{
+	//create objects and initialise with the defaults
+	CImImap4Settings* imap4Settings=new(ELeave)CImImap4Settings;
+	CleanupStack::PushL(imap4Settings);
+	CImSmtpSettings* smtpSettings=new(ELeave)CImSmtpSettings;
+	CleanupStack::PushL(smtpSettings);
+	CImIAPPreferences* imapIap = CImIAPPreferences::NewLC();
+	CImIAPPreferences* smtpIap = CImIAPPreferences::NewLC();
+	
+	iAccounts->PopulateDefaultImapSettingsL(*imap4Settings, *imapIap);
+	iAccounts->PopulateDefaultSmtpSettingsL(*smtpSettings, *smtpIap);
+	
+	//override some of the defaults
+	imap4Settings->SetPasswordL(_L8("davids"));
+	imap4Settings->SetLoginNameL(_L8("davids"));
+	imap4Settings->SetServerAddressL(KLoopbackAddress);
+	imap4Settings->SetFolderPathL(_L8(""));
+	imap4Settings->SetSynchronise(EUseLocal);
+	
+	//create the account
+	iImapAccount = iAccounts->CreateImapAccountL(_L("TestAccount"), *imap4Settings, *imapIap, EFalse);
+	TSmtpAccount smtpAccount;
+	smtpAccount = iAccounts->CreateSmtpAccountL(iImapAccount, *smtpSettings, *smtpIap, EFalse);
+
+	//clean up
+	CleanupStack::PopAndDestroy(4,imap4Settings);  
+	}
+
+// Return iMessageId, the message ID of the email being fetched with its attachment
+TMsvId CActiveImapClient::GetMessageId()
+	{
+	return iMessageId;
+	}
+
+void CActiveImapClient::StartL()
+	{	
+	//we are to collect the whole email then the next operation will be to fetch it
+	iState = EFetch;
+	iSelection = new (ELeave) CMsvEntrySelection;
+	TPckg<MMsvImapConnectionObserver*> param(this);
+	//select the imap service entry
+	iSelection->AppendL(iImapAccount.iImapService);
+	//make the service entry the current context
+	iClientMtm->SwitchCurrentEntryL(iImapAccount.iImapService);
+	//sync the account
+	iMsvOperation = iClientMtm->InvokeAsyncFunctionL(KIMAP4MTMConnectAndSyncCompleteAfterFullSync,*iSelection,param,iStatus);			
+	SetActive();
+	}
+	
+void CActiveImapClient::DoCancel()
+	{	
+	__ASSERT_DEBUG(iMsvOperation!=NULL, User::Panic(_L("CActiveImapClient"), -3));
+	iMsvOperation->Cancel();
+	}
+
+void CActiveImapClient::RunL()
+	{
+	User::LeaveIfError(iStatus.Int());
+	switch(iState)
+		{
+		//connect and sync	
+		case EDisconnect:
+			{
+			iState = EComplete;
+			TPckg<MMsvImapConnectionObserver*> param(this);
+			delete iMsvOperation;
+			iMsvOperation = NULL;
+			iMsvOperation = iClientMtm->InvokeAsyncFunctionL(KIMAP4MTMDisconnect,*iSelection,param,iStatus);	
+			SetActive();
+			break;		
+			}
+		case EFetch:
+			{
+			iState = EDisconnect;
+			TImImap4GetMailInfo imap4GetMailInfo;
+			imap4GetMailInfo.iMaxEmailSize = KMaxTInt;
+			imap4GetMailInfo.iDestinationFolder = KMsvGlobalInBoxIndexEntryIdValue;
+			imap4GetMailInfo.iGetMailBodyParts = EGetImap4EmailBodyTextAndAttachments;					
+			TPckgBuf<TImImap4GetMailInfo> package(imap4GetMailInfo);			
+			CMsvEntry* inboxEntry = NULL;
+			CMsvEntry* imapService = NULL;
+			TMsvSelectionOrdering ordering;
+			// message in remote inbox					
+			//create a CMsvEntry for the service entry
+			imapService = CMsvEntry::NewL(*iSession, iImapAccount.iImapService,ordering);
+			CleanupStack::PushL(imapService);
+			//retrieve the inbox from the imap service entry
+			CMsvEntrySelection* msvEntrySelection;
+			msvEntrySelection=imapService->ChildrenL();
+			CleanupStack::PushL(msvEntrySelection);
+			//create a CMsvEntry for the inbox entry
+			inboxEntry = CMsvEntry::NewL(*iSession, (*msvEntrySelection)[0],ordering);
+			CleanupStack::PopAndDestroy(msvEntrySelection);
+			CleanupStack::PushL(inboxEntry);
+			//retrieve the message from the inboxEntry service entry
+			msvEntrySelection=inboxEntry->ChildrenL();
+			CleanupStack::PushL(msvEntrySelection);
+			//append the message entry to our selection
+			iSelection->Reset();
+			//We store the message Id of the email we want to check attachment
+			iMessageId = (*msvEntrySelection)[0];
+			iSelection->AppendL(iMessageId);
+			//cleanup
+			CleanupStack::PopAndDestroy(msvEntrySelection);
+			CleanupStack::PopAndDestroy(inboxEntry);
+			CleanupStack::PopAndDestroy(imapService);
+
+			package = imap4GetMailInfo;
+			delete iMsvOperation;
+			iMsvOperation = NULL;
+			iMsvOperation = iClientMtm->InvokeAsyncFunctionL(KIMAP4MTMPopulate, *iSelection, package, iStatus);	
+			SetActive();
+			break;
+			}
+		case EComplete:
+			{//inform the owning object that the process is complete
+			iObserver.TestComplete(KErrNone);
+			break;
+			}
+		default:
+			{
+			__ASSERT_DEBUG(0, User::Panic(_L("CActiveImapClient unknown state"), KErrUnknown));
+			break;			
+			}
+		}
+	}
+	
+TInt CActiveImapClient::RunError(TInt aError)
+	{
+	iObserver.TestComplete(aError);
+	return KErrNone;
+	}
+	
+void CActiveImapClient::HandleImapConnectionEvent(TImapConnectionEvent /*aConnectionState*/)
+	{
+	//this method does nothing
+	}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_DEF062024_Imap_AttachmentCannotBeOpenedServer.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,89 @@
+// Copyright (c) 2005-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 "T_DEF062024_Imap_AttachmentCannotBeOpenedServer.h"
+#include "t_DEF062024_IMAP21cnServer_AttachmentCannotBeOpenedStep.h"
+
+_LIT(KServerName,"T_DEF062024_Imap_AttachmentCannotBeOpened");
+
+CImapAttachmentServer* CImapAttachmentServer::NewL()
+	{
+	CImapAttachmentServer * server = new (ELeave) CImapAttachmentServer();
+	CleanupStack::PushL(server);
+	server-> ConstructL(KServerName);
+	CleanupStack::Pop(server);
+	return server;
+	}
+
+CImapAttachmentServer::CImapAttachmentServer()
+	{}
+
+CImapAttachmentServer::~CImapAttachmentServer()
+	{}
+
+
+LOCAL_C void MainL()
+	{
+	CActiveScheduler* sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CleanupStack::PushL(sched);
+	CActiveScheduler::Install(sched);
+	CImapAttachmentServer* server = NULL;
+	// Create the CTestServer derived server
+	TRAPD(err,server = CImapAttachmentServer::NewL());
+	CleanupStack::PushL(server);
+	if(!err)
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	CleanupStack::PopAndDestroy(2,sched);
+	}
+
+
+GLDEF_C TInt E32Main()
+	{
+	__UHEAP_MARK;
+	
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAPD(err,MainL());
+	delete cleanup;
+	
+	__UHEAP_MARKEND;
+	return err;
+    }
+
+
+RFs& CImapAttachmentServer::Fs()
+	{
+	return iFs;
+	};	
+
+CTestStep* CImapAttachmentServer::CreateTestStep(const TDesC& aStepName)
+	{
+		
+	CTestStep* testStep = NULL;
+	
+	if(aStepName == KTestImapAttachment)
+		testStep = new CTestImapAttachmentStep();
+
+
+	return testStep;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_DEF075510_Offline_Populate.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,427 @@
+// Copyright (c) 2006-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:
+// Name of test harness: T_DEF075510_Offline_Populate.cpp 
+// Component: imapservermtm
+// Output files produced by running test harness:
+// <DRIVE>:\msglogs\T_DEF075510_Offline_Populate.WINSCW.DEB.LOG
+// 
+//
+
+
+#include "EmailTestUtils.h"
+#include <ImapConnectionObserver.H>
+#include <cemailaccounts.h>
+
+
+_LIT(KAt ,"@");
+_LIT8(KFolderPath, "");
+_LIT(KServer, ".intra");
+_LIT(KVisible, "OFFLINE POPULATE  MESSAGE VISIBILITY FLAG SET TO : %d");
+_LIT(KImoffpopulate, " Testing Offline_Populate");
+_LIT(KMsgCompleted, "\t CopyL completed with : %d");
+_LIT(KMsgSend, "\t messages to send in the outbox = : %d");
+_LIT(KProgressError, "\t Progress error = %d");
+	
+RTest test(KImoffpopulate);
+TImapAccount imapAccount;
+LOCAL_D TMsvId imap4Service;
+LOCAL_D TMsvId smtpService;
+LOCAL_D CEmailTestUtils* testUtils;
+LOCAL_D CTrapCleanup* theCleanup;
+
+#if defined (__WINS__)
+	#define PDD_NAME		_L("ECDRV")
+	#define LDD_NAME		_L("ECOMM")
+#else
+	#define PDD_NAME		_L("EUART1")
+	#define LDD_NAME		_L("ECOMM")
+#endif
+	// local variables etc //
+
+class TDummySessionObserver : public CBase , public MMsvSessionObserver
+	{
+public:
+	void HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/){}
+	};
+	
+
+class CDummyConnectionObserver : public MMsvImapConnectionObserver
+	{
+		void HandleImapConnectionEvent(TImapConnectionEvent /*aConnectionEvent*/){}
+	};
+
+// Disconnect from ImapServer
+LOCAL_C void DisconnectImapServerL()
+	{
+	test.Printf(_L("DisConnecting to IMAP server                      \n"));
+	CTestActive* testActive = new (ELeave) CTestActive();
+	CleanupStack::PushL(testActive);
+ 	
+  	CMsvEntrySelection *msvSelection = new(ELeave) CMsvEntrySelection;
+	CleanupStack::PushL(msvSelection);
+	msvSelection->AppendL(imap4Service);
+
+	TBuf8 <1> aParameter;
+  	CMsvOperation* msvOperation = testUtils->iImapClientMtm->InvokeAsyncFunctionL(KIMAP4MTMDisconnect,*msvSelection, aParameter, testActive->iStatus);
+	testUtils->WriteComment(_L("Dissconnect from IMAP server  "));
+	CleanupStack::PushL(msvOperation);
+
+	testActive->StartL();
+	CActiveScheduler::Start();
+	CleanupStack::PopAndDestroy(3,testActive);//msvOperation,msvSelection,children,testActive
+	}
+
+
+LOCAL_C void ConnectAndFullSyncImapServerL()
+	{
+	CTestActive* testActive = new(ELeave) CTestActive();
+	CleanupStack::PushL(testActive);
+	
+	CMsvEntrySelection * msvSelection = new(ELeave) CMsvEntrySelection;
+	CleanupStack::PushL(msvSelection);
+	
+	test.Printf(_L("Connecting to IMAP server             \n"));
+	msvSelection->AppendL(imap4Service);
+	
+	CDummyConnectionObserver *dummyObserver = new(ELeave)CDummyConnectionObserver; 
+	CleanupStack::PushL(dummyObserver);
+	TPckg<MMsvImapConnectionObserver*> aParameter(dummyObserver);
+  	
+  	CMsvOperation* msvOperation = testUtils->iImapClientMtm->InvokeAsyncFunctionL(KIMAP4MTMConnectAndSyncCompleteAfterFullSync,*msvSelection, aParameter, testActive->iStatus);
+  	testUtils->WriteComment(_L(" Connect to Imap server and Sync the mails  "));
+	CleanupStack::PushL(msvOperation);
+	
+	testActive->StartL();
+	CActiveScheduler::Start();
+
+   	CleanupStack::PopAndDestroy(4,testActive);//msvOperation,dummyObserver,msvSelection,testActive
+   	}
+
+LOCAL_C void PopulateMessagesWhenOfflineL(CMsvEntrySelection & aSelection)
+	{
+	testUtils->WriteComment(_L("Testing Offline_Populat "));
+
+	CTestActive* testActive = new(ELeave) CTestActive();
+	CleanupStack::PushL(testActive);
+	TBuf8 <1> aParameter;
+	TMsvSelectionOrdering ordering;
+	
+	TDummySessionObserver *sessionObserver = new (ELeave) TDummySessionObserver;
+	// Session. Needed to create a client registry.
+	CMsvSession* session = CMsvSession::OpenSyncL(*sessionObserver);
+    CMsvOperation*	msvOperation = testUtils->iImapClientMtm->InvokeAsyncFunctionL(KIMAP4MTMPopulate, aSelection, aParameter, testActive->iStatus);	
+	testUtils->WriteComment(_L("Populate mails from  the  Imap Server When Offline "));
+	testActive->StartL();
+	CActiveScheduler::Start();	// Start the populate all mail active object
+	CMsvEntry*	inboxEntry1 = CMsvEntry::NewL(*session, (aSelection)[0],ordering);
+	CleanupStack::PushL(inboxEntry1);
+
+	TMsvEmailEntry entry = inboxEntry1->Entry();
+	TBool visible = entry.Visible();
+	test(visible == 1);
+	testUtils->Printf(KVisible, visible);
+
+	CleanupStack::PopAndDestroy(inboxEntry1);
+	
+    delete msvOperation;
+    delete sessionObserver;
+    delete session;
+	CleanupStack::PopAndDestroy(testActive);
+	
+	}
+	
+	
+//	
+LOCAL_C void CreateNewSmtpSettingsL()
+	{
+	testUtils->iMsvEntry->SetEntryL(smtpService);
+	TMsvId serviceId = smtpService;
+	//overwrite the settings with test code one.  Don't want the default settings.
+	CImSmtpSettings* settings = new(ELeave) CImSmtpSettings();
+	CleanupStack::PushL(settings);
+	CEmailAccounts* accounts = CEmailAccounts::NewLC();
+	TSmtpAccount smtpAccountId;
+	accounts->GetSmtpAccountL( serviceId, smtpAccountId);
+	accounts->LoadSmtpSettingsL(smtpAccountId, *settings);
+	TInt serverLength = testUtils->MachineName().Length();
+	HBufC* serverad = HBufC::NewL(serverLength + 7 ); // 7 is the length of KServerAddress
+	CleanupStack::PushL(serverad);
+	serverad->Des().Copy(testUtils->MachineName());
+	serverad->Des().Append(KServer);	
+    settings->SetServerAddressL(*serverad);
+    HBufC* emailaddress = HBufC::NewL(serverLength + 8 + serverad->Des().Length() + 1 );
+   	CleanupStack::PushL(emailaddress);
+   	emailaddress->Des().Copy(testUtils->MachineName());
+   	emailaddress->Des().Append(KAt);
+   	emailaddress->Des().Append(*serverad);
+   	settings->SetEmailAddressL(*emailaddress);
+	settings->SetReplyToAddressL(*emailaddress);
+	settings->SetReceiptAddressL(*emailaddress);
+	settings->SetEmailAliasL(_L("Test Account"));
+	settings->SetBodyEncoding(EMsgOutboxMIME);
+	settings->SetRequestReceipts(EFalse);
+	settings->SetPort(25);
+	TSmtpAccount smtpAccount;
+ 	accounts->GetSmtpAccountL(smtpService, smtpAccount);
+	accounts->SaveSmtpSettingsL(smtpAccount, *settings);
+	CleanupStack::PopAndDestroy(emailaddress);
+	CleanupStack::PopAndDestroy(serverad);
+	CleanupStack::PopAndDestroy(2,settings);
+	testUtils->WriteComment(_L("Created New SmtpSettings  "));	
+		
+	}
+LOCAL_C void CreateNewPlaintextMessageL()
+	{
+	CTestActive* testActive = new(ELeave) CTestActive();
+	CleanupStack::PushL(testActive);
+	TMsvEmailTypeList msvEmailTypeList = 0;
+	TMsvPartList partList = (KMsvMessagePartBody | KMsvMessagePartAttachments);
+	CImEmailOperation* emailOperation = CImEmailOperation::CreateNewL(testActive->iStatus, *(testUtils->iMsvSession),KMsvGlobalOutBoxIndexEntryId, partList, msvEmailTypeList, KUidMsgTypeSMTP);
+	CleanupStack::PushL(emailOperation);
+	TestMsvOperationTimer* testMsvOperationTimer = TestMsvOperationTimer::NewLC(test.Console(), emailOperation, test);
+	testActive->StartL();
+	testMsvOperationTimer->IssueRequest();
+	CActiveScheduler::Start();
+	//check progress
+	TMsvId temp;
+	TPckgC<TMsvId> paramPack(temp);
+	const TDesC8& progBuf = emailOperation->ProgressL();
+	paramPack.Set(progBuf);
+	TMsvId newMessageId;
+	newMessageId = paramPack();
+	test(newMessageId != NULL);
+	testUtils->WriteComment(_L("\t Created New plaintext message"));
+	testUtils->iMsvEntry->SetEntryL(newMessageId);
+    CMsvStore* store = testUtils->iMsvEntry->EditStoreL();
+	CleanupStack::PushL(store);
+	CImHeader* header = CImHeader::NewLC();
+	header->RestoreL(*store);
+	
+	TInt serverLength = testUtils->MachineName().Length();
+	HBufC* serverad = HBufC::NewL(serverLength + 7 ); // 7 is the length of KServerAddress
+	CleanupStack::PushL(serverad);
+	serverad->Des().Copy(testUtils->MachineName());
+	serverad->Des().Append(KServer);	
+    HBufC* emailaddress = HBufC::NewL(serverLength + 8 + serverad->Des().Length() + 1 );
+   	CleanupStack::PushL(emailaddress);
+   	emailaddress->Des().Copy(testUtils->MachineName());
+   	emailaddress->Des().Append(KAt);
+   	emailaddress->Des().Append(*serverad);
+   	header->ToRecipients().AppendL(*emailaddress);
+   	
+	header->SetSubjectL(_L("Test sending message using CMsvEntry::CopyL!!"));
+	header->StoreL(*store);
+	store->CommitL();
+	CleanupStack::PopAndDestroy(emailaddress);
+	CleanupStack::PopAndDestroy(serverad);
+	CleanupStack::PopAndDestroy(5,testActive); // header,store,testMsvOperationTimer,emailOperation,testActive
+	
+		
+	}
+LOCAL_C void SendSmtpMessageL()
+	{
+	CTestActive* testActive = new (ELeave) CTestActive();
+	CleanupStack::PushL(testActive);
+	testUtils->iMsvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);
+	testUtils->InstantiateSmtpClientMtmL();
+	CMsvEntrySelection* sendSel = testUtils->iMsvEntry->ChildrenL();
+	CleanupStack::PushL(sendSel);
+	TInt count = sendSel->Count();
+	test(count >= 1);
+	testUtils->Printf(KMsgSend, count);
+	testUtils->iSmtpClientMtm->SetCurrentEntryL(testUtils->iMsvSession->GetEntryL(KMsvGlobalOutBoxIndexEntryId));
+	CMsvOperation* msvOperation = testUtils->iSmtpClientMtm->Entry().CopyL(*sendSel, smtpService, testActive->iStatus);
+	CleanupStack::PushL(msvOperation);
+	testActive->StartL();
+	CActiveScheduler::Start();
+
+	//check progress
+    testUtils->Printf(KMsgCompleted, testActive->iStatus.Int()); 
+
+	CMsvEntrySelection* sendSelc = testUtils->iMsvEntry->ChildrenL();
+	TInt noOfMessages = sendSelc->Count();
+
+	// Check Whether the mails in Outbox is Zero (i.e. mails has been sent..).
+    test(noOfMessages == 0);
+  	delete sendSelc;
+ 	TImSmtpProgress temp;	
+	TPckgC<TImSmtpProgress> paramPack(temp);
+	const TDesC8& progBuf = msvOperation->ProgressL();
+	paramPack.Set(progBuf);
+	TImSmtpProgress progress = paramPack();	
+	
+	testUtils->Printf(KProgressError, progress.Error()); 
+
+	test(progress.Error()==0);
+	CleanupStack::PopAndDestroy(3,testActive); //msvOperation,sendsel,testActive
+	}
+	
+LOCAL_C void CreateandSendMessageL()
+	{
+	test.Next(_L("Test sending message to server "));
+	CreateNewSmtpSettingsL();
+	testUtils->iMsvEntry->SetEntryL(smtpService);
+	CreateNewPlaintextMessageL();
+	SendSmtpMessageL();
+	}
+
+LOCAL_C void TestOfflinePopulateL()
+	{
+	CreateandSendMessageL();
+	// Tests start here
+	testUtils->iImapClientMtm->SwitchCurrentEntryL(imap4Service);
+	// connect, do full sync and then  so that the inbox can be synced
+    test.Printf(_L("Connecting to IMAP server            \n"));
+    
+    ConnectAndFullSyncImapServerL();
+    
+    CMsvEntry* imapService=NULL;
+    CMsvEntry* inboxEntry=NULL;
+    TMsvSelectionOrdering ordering;
+	
+	TDummySessionObserver *sessionObserver = new (ELeave) TDummySessionObserver;
+	// Session. Needed to create a client registry.
+	CMsvSession* session = CMsvSession::OpenSyncL(*sessionObserver);
+
+	// message in remote inbox					
+	//create a CMsvEntry for the service entry
+	imapService = CMsvEntry::NewL(*session, imapAccount.iImapService,ordering);
+	CleanupStack::PushL(imapService);
+	//retrieve the inbox from the imap service entry
+	CMsvEntrySelection* msvEntrySelection =imapService->ChildrenL();
+	CleanupStack::PushL(msvEntrySelection);
+ 
+	
+	//create a CMsvEntry for the inbox entry
+	inboxEntry = CMsvEntry::NewL(*session, (*msvEntrySelection)[0],ordering);
+	TBuf8 <1> aParameter;	    
+				
+	CleanupStack::PopAndDestroy(msvEntrySelection);
+	CleanupStack::PushL(inboxEntry);
+			
+	//retrieve the message from the inboxEntry service entry
+    CMsvEntrySelection* selection = inboxEntry->ChildrenL();
+    
+    DisconnectImapServerL();
+      
+    PopulateMessagesWhenOfflineL(*selection);
+    ConnectAndFullSyncImapServerL();
+    
+    CleanupStack::PopAndDestroy(inboxEntry);
+	CleanupStack::PopAndDestroy(imapService);
+    
+    delete sessionObserver;
+    delete session;
+    delete selection;
+   
+	}
+
+LOCAL_C void InitL()
+	{
+	// Load the serial comms device drivers.  If this is not done,
+	// connecting via NT-RAS returns KErrNotFound (-1).
+	TInt driverErr;
+	driverErr=User::LoadPhysicalDevice(PDD_NAME);
+	if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists)
+		User::Leave(driverErr);
+	driverErr=User::LoadLogicalDevice(LDD_NAME);
+	if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists)
+		User::Leave(driverErr);
+
+	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
+	CActiveScheduler::Install(scheduler);
+	CleanupStack::PushL(scheduler);
+	testUtils = CEmailTestUtils::NewLC(test);
+	testUtils->CreateAllTestDirectories();
+	testUtils->FileSession().SetSessionPath(_L("C:\\"));
+	testUtils->CleanMessageFolderL();
+	testUtils->GoServerSideL();
+    testUtils->ClearEmailAccountsL();
+	test.Next(_L("Create Data Component FileStores"));
+	testUtils->CreateSmtpServerMtmRegL();
+	//	Loading the DLLs
+	testUtils->CreateRegistryObjectAndControlL();
+	testUtils->InstallSmtpMtmGroupL();
+	testUtils->GoClientSideL();
+	// Create Services
+	smtpService = testUtils->CreateSmtpServiceL();
+	imap4Service = testUtils->CreateImapServiceL();
+	CEmailAccounts* accounts = CEmailAccounts::NewLC();
+	TSmtpAccount smtpAccount;
+	accounts->GetSmtpAccountL(smtpService, smtpAccount);
+	accounts->SetDefaultSmtpAccountL(smtpAccount);
+    testUtils->WriteComment(_L("Create  Imap   Services           ")); 
+	// Delete any *.scr files in c:\logs\email directory.
+	testUtils->DeleteScriptFilesFromLogsDirL();
+
+	testUtils->iMsvEntry->SetEntryL(imap4Service);
+	//overwrite the settings with test code one.  Don't want the default settings.
+	CImImap4Settings* settings = new(ELeave) CImImap4Settings();
+	CleanupStack::PushL(settings);
+	settings->Reset();
+	TInt serverLength = testUtils->MachineName().Length();
+	HBufC* serverad = HBufC::NewL(serverLength + 7 ); // 7 is the length of KServerAddress
+	CleanupStack::PushL(serverad);
+	serverad->Des().Copy(testUtils->MachineName());
+	serverad->Des().Append(KServer);
+	settings->SetServerAddressL(*serverad);
+	CleanupStack::PopAndDestroy(serverad); 
+	settings->SetDeleteEmailsWhenDisconnecting(ETrue);
+	settings->SetAcknowledgeReceipts(ETrue);
+	settings->SetAutoSendOnConnect(ETrue);
+	settings->SetLoginNameL(testUtils->MachineName());
+	settings->SetPasswordL(testUtils->MachineName());
+   	settings->SetPort(143);
+	settings->SetFolderPathL(KFolderPath);
+	accounts->GetImapAccountL(imap4Service, imapAccount);
+	accounts->SaveImapSettingsL(imapAccount, *settings);
+	CleanupStack::PopAndDestroy(2,accounts); //accounts,settings
+	test.Printf(_L("Instantiating IMAP4 Client MTM"));
+	testUtils->InstantiateImapClientMtmL();
+	}
+
+LOCAL_C void Closedown()
+	{
+     
+	CleanupStack::PopAndDestroy(2);  //testUtils, scheduler 
+	}
+
+LOCAL_C void doMainL()
+	{
+	test.Start(_L("IMAP4 - Offline Populate"));
+	InitL();
+  	testUtils->TestStart(1);
+	TestOfflinePopulateL();
+ 	testUtils->TestFinish(1);
+
+	testUtils->TestHarnessCompleted();
+
+	Closedown();		
+	}
+
+
+GLDEF_C TInt E32Main()
+	{
+	__UHEAP_MARK;
+	theCleanup=CTrapCleanup::New();
+	TRAPD(ret,doMainL());		
+	test(ret==KErrNone);
+	delete theCleanup;	
+	test.Console()->SetPos(0, 13);
+	test.End();
+	test.Close();
+	__UHEAP_MARKEND;
+	return(KErrNone);
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_DEF079867_OfflineDelete.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,484 @@
+// Copyright (c) 2006-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:
+// T_DEF079867_OFFLINE_DELETE.CPP
+// Name of test harness: T_DEF079867_Offline_Delete.cpp 
+// Component: imapservermtm
+// Output files produced by running test harness:
+// <DRIVE>:\msglogs\T_DEF079867_Offline_Delete.WINSCW.DEB.LOG
+// 
+//
+
+
+#include "EmailTestUtils.h"
+#include <ImapConnectionObserver.H>
+#include <cemailaccounts.h>
+
+
+_LIT(KAt ,"@");
+_LIT(KDelete ,"Offline Deleted File = %d");
+_LIT8(KFolderPath, "");
+_LIT(KServer, ".intra");
+_LIT(KImOffDelete, " Testing Offline_Delete");
+_LIT(KMsgCompleted, "\t CopyL completed with : %d");
+_LIT(KMsgSend, "\t messages to send in the outbox = : %d");
+_LIT(KProgressError, "\t Progress error = %d");
+	
+RTest test(KImOffDelete);
+TImapAccount imapAccount;
+LOCAL_D TMsvId imap4Service;
+LOCAL_D TMsvId smtpService;
+LOCAL_D CEmailTestUtils* testUtils;
+LOCAL_D CTrapCleanup* theCleanup;
+
+#if defined (__WINS__)
+	#define PDD_NAME		_L("ECDRV")
+	#define LDD_NAME		_L("ECOMM")
+#else
+	#define PDD_NAME		_L("EUART1")
+	#define LDD_NAME		_L("ECOMM")
+#endif
+	// local variables etc //
+
+class TDummySessionObserver : public CBase , public MMsvSessionObserver
+	{
+public:
+	void HandleSessionEventL(TMsvSessionEvent, TAny*, TAny*, TAny*)
+		{
+		}
+	};
+	
+
+class CDummyConnectionObserver : public MMsvImapConnectionObserver
+	{
+		void HandleImapConnectionEvent(TImapConnectionEvent)
+		{
+		}
+	};
+
+// Disconnect from ImapServer
+LOCAL_C void DisconnectImapServerL()
+	{
+	test.Printf(_L("DisConnecting to IMAP server                      \n"));
+	CTestActive* testActive = new (ELeave) CTestActive();
+	CleanupStack::PushL(testActive);
+ 	
+  	CMsvEntrySelection *msvSelection = new(ELeave) CMsvEntrySelection;
+	CleanupStack::PushL(msvSelection);
+	msvSelection->AppendL(imap4Service);
+
+	TBuf8 <1> aParameter;
+  	CMsvOperation* msvOperation = testUtils->iImapClientMtm->InvokeAsyncFunctionL(KIMAP4MTMDisconnect,*msvSelection, aParameter, testActive->iStatus);
+	testUtils->WriteComment(_L("Dissconnect from IMAP server  "));
+	CleanupStack::PushL(msvOperation);
+
+	testActive->StartL();
+	CActiveScheduler::Start();
+	CleanupStack::PopAndDestroy(3,testActive);//msvOperation,msvSelection,children,testActive
+	}
+
+
+LOCAL_C void ConnectAndFullSyncImapServerL()
+	{
+	CTestActive* testActive = new(ELeave) CTestActive();
+	CleanupStack::PushL(testActive);
+	
+	CMsvEntrySelection * msvSelection = new(ELeave) CMsvEntrySelection;
+	CleanupStack::PushL(msvSelection);
+	
+	test.Printf(_L("Connecting to IMAP server             \n"));
+	msvSelection->AppendL(imap4Service);
+	
+	CDummyConnectionObserver *dummyObserver = new(ELeave)CDummyConnectionObserver; 
+	CleanupStack::PushL(dummyObserver);
+	TPckg<MMsvImapConnectionObserver*> aParameter(dummyObserver);
+  	
+  	CMsvOperation* msvOperation = testUtils->iImapClientMtm->InvokeAsyncFunctionL(KIMAP4MTMConnectAndSyncCompleteAfterFullSync,*msvSelection, aParameter, testActive->iStatus);
+  	testUtils->WriteComment(_L(" Connect to Imap server and Sync the mails  "));
+	CleanupStack::PushL(msvOperation);
+	
+	testActive->StartL();
+	CActiveScheduler::Start();
+
+   	CleanupStack::PopAndDestroy(4,testActive);//msvOperation,dummyObserver,msvSelection,testActive
+   	}
+
+LOCAL_C void	ConnectAndSyncCompleteAfterConnectL()
+	{
+	CTestActive* testActive = new(ELeave) CTestActive();
+	CleanupStack::PushL(testActive);
+	
+	CMsvEntrySelection * msvSelection = new(ELeave) CMsvEntrySelection;
+	CleanupStack::PushL(msvSelection);
+	
+	test.Printf(_L("Connecting to IMAP server             \n"));
+	msvSelection->AppendL(imap4Service);
+	
+	CDummyConnectionObserver *dummyObserver = new(ELeave)CDummyConnectionObserver; 
+	CleanupStack::PushL(dummyObserver);
+	TPckg<MMsvImapConnectionObserver*> aParameter(dummyObserver);
+  	
+  	CMsvOperation* msvOperation = testUtils->iImapClientMtm->InvokeAsyncFunctionL(KIMAP4MTMConnectAndSyncCompleteAfterConnect,*msvSelection, aParameter, testActive->iStatus);
+  	testUtils->WriteComment(_L(" Connect to Imap server and Sync the mails  "));
+	CleanupStack::PushL(msvOperation);
+	
+	testActive->StartL();
+	CActiveScheduler::Start();
+
+   	CleanupStack::PopAndDestroy(4,testActive);//msvOperation,dummyObserver,msvSelection,testActive	
+		
+	}
+	
+
+LOCAL_C void OfflineDeleteL(CMsvEntry &	aInboxEntry)
+	{
+    CTestActive* testActive = new(ELeave) CTestActive();
+	CleanupStack::PushL(testActive); 
+    TBuf8 <1> aParameter;
+   
+   	CMsvEntrySelection*	children = aInboxEntry.ChildrenL();
+	CleanupStack::PushL(children);
+    
+	
+	CMsvOperation* msvOperation =	aInboxEntry.DeleteL(children[0],testActive->iStatus);
+	testUtils->Printf(KDelete, aInboxEntry.Count());
+	CleanupStack::PushL(msvOperation);
+	testActive->StartL();
+	CActiveScheduler::Start();
+	
+	ConnectAndSyncCompleteAfterConnectL();
+	
+	CMsvOperation* msvOperation1 =  testUtils->iImapClientMtm->InvokeAsyncFunctionL(KIMAP4MTMUndeleteAll , children[0], aParameter, testActive->iStatus);
+	CleanupStack::PushL(msvOperation1);
+	testActive->StartL();
+	CActiveScheduler::Start();
+	
+	CleanupStack::PopAndDestroy(msvOperation1);
+	CleanupStack::PopAndDestroy(3,testActive);
+	
+	}
+	
+//	
+LOCAL_C void CreateNewSmtpSettingsL()
+	{
+	testUtils->iMsvEntry->SetEntryL(smtpService);
+	TMsvId serviceId = smtpService;
+	//overwrite the settings with test code one.  Don't want the default settings.
+	CImSmtpSettings* settings = new(ELeave) CImSmtpSettings();
+	CleanupStack::PushL(settings);
+	
+	CEmailAccounts* accounts = CEmailAccounts::NewLC();
+	TSmtpAccount smtpAccountId;
+	
+	accounts->GetSmtpAccountL( serviceId, smtpAccountId);
+	accounts->LoadSmtpSettingsL(smtpAccountId, *settings);
+	
+	TInt serverLength = testUtils->MachineName().Length();
+	HBufC* serverad = HBufC::NewL(serverLength + 7 ); // 7 is the length of KServerAddress
+	CleanupStack::PushL(serverad);
+	
+	serverad->Des().Copy(testUtils->MachineName());
+	serverad->Des().Append(KServer);	
+    settings->SetServerAddressL(*serverad);
+    
+    HBufC* emailaddress = HBufC::NewL(serverLength + 8 + serverad->Des().Length() + 1 );
+   	CleanupStack::PushL(emailaddress);
+   	
+   	emailaddress->Des().Copy(testUtils->MachineName());
+   	emailaddress->Des().Append(KAt);
+   	emailaddress->Des().Append(*serverad);
+   	
+   	settings->SetEmailAddressL(*emailaddress);
+	settings->SetReplyToAddressL(*emailaddress);
+	settings->SetReceiptAddressL(*emailaddress);
+	settings->SetEmailAliasL(_L("Test Account"));
+	settings->SetBodyEncoding(EMsgOutboxMIME);
+	settings->SetRequestReceipts(EFalse);
+	settings->SetPort(25);
+	
+	TSmtpAccount smtpAccount;
+ 	accounts->GetSmtpAccountL(smtpService, smtpAccount);
+	accounts->SaveSmtpSettingsL(smtpAccount, *settings);
+	
+	CleanupStack::PopAndDestroy(emailaddress);
+	CleanupStack::PopAndDestroy(serverad);
+	CleanupStack::PopAndDestroy(2,settings);
+	testUtils->WriteComment(_L("Created New SmtpSettings  "));	
+	}
+	
+	
+LOCAL_C void CreateNewPlaintextMessageL()
+	{
+	CTestActive* testActive = new(ELeave) CTestActive();
+	CleanupStack::PushL(testActive);
+	
+	TMsvEmailTypeList msvEmailTypeList = 0;
+	TMsvPartList partList = (KMsvMessagePartBody | KMsvMessagePartAttachments);
+	
+	CImEmailOperation* emailOperation = CImEmailOperation::CreateNewL(testActive->iStatus, *(testUtils->iMsvSession),KMsvGlobalOutBoxIndexEntryId, partList, msvEmailTypeList, KUidMsgTypeSMTP);
+	CleanupStack::PushL(emailOperation);
+	TestMsvOperationTimer* testMsvOperationTimer = TestMsvOperationTimer::NewLC(test.Console(), emailOperation, test);
+	
+	testActive->StartL();
+	testMsvOperationTimer->IssueRequest();
+	CActiveScheduler::Start();
+	
+	//check progress
+	TMsvId temp;
+	TPckgC<TMsvId> paramPack(temp);
+	
+	const TDesC8& progBuf = emailOperation->ProgressL();
+	paramPack.Set(progBuf);
+	
+	TMsvId newMessageId;
+	newMessageId = paramPack();
+	
+	test(newMessageId != NULL);
+	testUtils->WriteComment(_L("\t Created New plaintext message"));
+	testUtils->iMsvEntry->SetEntryL(newMessageId);
+    
+    CMsvStore* store = testUtils->iMsvEntry->EditStoreL();
+	CleanupStack::PushL(store);
+	CImHeader* header = CImHeader::NewLC();
+	header->RestoreL(*store);
+	
+	TInt serverLength = testUtils->MachineName().Length();
+	HBufC* serverad = HBufC::NewL(serverLength + 7 ); // 7 is the length of KServerAddress
+	CleanupStack::PushL(serverad);
+	
+	serverad->Des().Copy(testUtils->MachineName());
+	serverad->Des().Append(KServer);	
+    
+    HBufC* emailaddress = HBufC::NewL(serverLength + 8 + serverad->Des().Length() + 1 );
+   	CleanupStack::PushL(emailaddress);
+   	
+   	emailaddress->Des().Copy(testUtils->MachineName());
+   	emailaddress->Des().Append(KAt);
+   	emailaddress->Des().Append(*serverad);
+   	header->ToRecipients().AppendL(*emailaddress);
+   	
+	header->SetSubjectL(_L("Test sending message using CMsvEntry::CopyL!!"));
+	header->StoreL(*store);
+	store->CommitL();
+	
+	CleanupStack::PopAndDestroy(emailaddress);
+	CleanupStack::PopAndDestroy(serverad);
+	CleanupStack::PopAndDestroy(5,testActive); // header,store,testMsvOperationTimer,emailOperation,testActive
+	}
+	
+	
+LOCAL_C void SendSmtpMessageL()
+	{
+	CTestActive* testActive = new (ELeave) CTestActive();
+	CleanupStack::PushL(testActive);
+	
+	testUtils->iMsvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);
+	testUtils->InstantiateSmtpClientMtmL();
+	
+	CMsvEntrySelection* sendSel = testUtils->iMsvEntry->ChildrenL();
+	CleanupStack::PushL(sendSel);
+	
+	TInt count = sendSel->Count();
+	test(count >= 1);
+	testUtils->Printf(KMsgSend, count);
+	testUtils->iSmtpClientMtm->SetCurrentEntryL(testUtils->iMsvSession->GetEntryL(KMsvGlobalOutBoxIndexEntryId));
+	
+	CMsvOperation* msvOperation = testUtils->iSmtpClientMtm->Entry().CopyL(*sendSel, smtpService, testActive->iStatus);
+	CleanupStack::PushL(msvOperation);
+	
+	testActive->StartL();
+	CActiveScheduler::Start();
+
+	//check progress
+    testUtils->Printf(KMsgCompleted, testActive->iStatus.Int()); 
+
+	CMsvEntrySelection* sendSelc = testUtils->iMsvEntry->ChildrenL();
+	TInt noOfMessages = sendSelc->Count();
+
+	// Check Whether the mails in Outbox is Zero (i.e. mails has been sent..).
+    test(noOfMessages == 0);
+  	delete sendSelc;
+ 	TImSmtpProgress temp;	
+	TPckgC<TImSmtpProgress> paramPack(temp);
+	const TDesC8& progBuf = msvOperation->ProgressL();
+	paramPack.Set(progBuf);
+	TImSmtpProgress progress = paramPack();	
+	
+	testUtils->Printf(KProgressError, progress.Error()); 
+	test(progress.Error()==0);
+	CleanupStack::PopAndDestroy(3,testActive); //msvOperation,sendsel,testActive
+	}
+	
+LOCAL_C void CreateandSendMessageL()
+	{
+	test.Next(_L("Test sending message to server "));
+	CreateNewSmtpSettingsL();
+	
+	testUtils->iMsvEntry->SetEntryL(smtpService);
+	
+	CreateNewPlaintextMessageL();
+	SendSmtpMessageL();
+	}
+
+LOCAL_C void TestOfflineDeleteL()
+	{
+	CreateandSendMessageL();
+	// Tests start here
+	testUtils->iImapClientMtm->SwitchCurrentEntryL(imap4Service);
+	// connect, do full sync and then  so that the inbox can be synced
+    test.Printf(_L("Connecting to IMAP server            \n"));
+    
+    ConnectAndFullSyncImapServerL();
+    
+    CMsvEntry* imapService=NULL;
+    CMsvEntry* inboxEntry=NULL;
+    TMsvSelectionOrdering ordering;
+	
+	TDummySessionObserver *sessionObserver = new (ELeave) TDummySessionObserver;
+	// Session. Needed to create a client registry.
+	CMsvSession* session = CMsvSession::OpenSyncL(*sessionObserver);
+
+	// message in remote inbox					
+	//create a CMsvEntry for the service entry
+	imapService = CMsvEntry::NewL(*session, imapAccount.iImapService,ordering);
+	CleanupStack::PushL(imapService);
+	//retrieve the inbox from the imap service entry
+	CMsvEntrySelection* msvEntrySelection =imapService->ChildrenL();
+	CleanupStack::PushL(msvEntrySelection);
+ 
+	//create a CMsvEntry for the inbox entry
+	inboxEntry = CMsvEntry::NewL(*session, (*msvEntrySelection)[0],ordering);
+	CleanupStack::PushL(inboxEntry);
+	TBuf8 <1> aParameter;	    
+
+    CMsvEntrySelection * selection = inboxEntry->ChildrenL();//no of msg
+    CleanupStack::PushL(selection);
+    
+    DisconnectImapServerL();
+    
+    OfflineDeleteL(*inboxEntry); 
+
+	CleanupStack::PopAndDestroy(4,imapService);//selection,inboxEntry,msvEntrySelection
+    
+    delete sessionObserver;
+    delete session;
+  
+	}
+
+LOCAL_C void InitL()
+	{
+	// Load the serial comms device drivers.  If this is not done,
+	// connecting via NT-RAS returns KErrNotFound (-1).
+	TInt driverErr;
+	driverErr=User::LoadPhysicalDevice(PDD_NAME);
+	if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists)
+		User::Leave(driverErr);
+	driverErr=User::LoadLogicalDevice(LDD_NAME);
+	if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists)
+		User::Leave(driverErr);
+
+	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
+	CActiveScheduler::Install(scheduler);
+	CleanupStack::PushL(scheduler);
+	
+	testUtils = CEmailTestUtils::NewLC(test);
+	testUtils->CreateAllTestDirectories();
+	testUtils->FileSession().SetSessionPath(_L("C:\\"));
+	testUtils->CleanMessageFolderL();
+	testUtils->GoServerSideL();
+    testUtils->ClearEmailAccountsL();
+	test.Next(_L("Create Data Component FileStores"));
+	testUtils->CreateSmtpServerMtmRegL();
+	
+	//	Loading the DLLs
+	testUtils->CreateRegistryObjectAndControlL();
+	testUtils->InstallSmtpMtmGroupL();
+	testUtils->GoClientSideL();
+	
+	// Create Services
+	smtpService = testUtils->CreateSmtpServiceL();
+	imap4Service = testUtils->CreateImapServiceL();
+	CEmailAccounts* accounts = CEmailAccounts::NewLC();
+	TSmtpAccount smtpAccount;
+	
+	accounts->GetSmtpAccountL(smtpService, smtpAccount);
+	accounts->SetDefaultSmtpAccountL(smtpAccount);
+    
+    testUtils->WriteComment(_L("Create  Imap   Services           ")); 
+	
+	// Delete any *.scr files in c:\logs\email directory.
+	testUtils->DeleteScriptFilesFromLogsDirL();
+	testUtils->iMsvEntry->SetEntryL(imap4Service);
+	
+	//overwrite the settings with test code one.  Don't want the default settings.
+	CImImap4Settings* settings = new(ELeave) CImImap4Settings();
+	CleanupStack::PushL(settings);
+	
+	settings->Reset();
+	
+	TInt serverLength = testUtils->MachineName().Length();
+	HBufC* serverad = HBufC::NewL(serverLength + 7 ); // 7 is the length of KServerAddress
+	CleanupStack::PushL(serverad);
+	
+	serverad->Des().Copy(testUtils->MachineName());
+	serverad->Des().Append(KServer);
+	settings->SetServerAddressL(*serverad);
+	CleanupStack::PopAndDestroy(serverad); 
+	
+	settings->SetDeleteEmailsWhenDisconnecting(ETrue);
+	settings->SetAcknowledgeReceipts(ETrue);
+	settings->SetAutoSendOnConnect(ETrue);
+	settings->SetLoginNameL(testUtils->MachineName());
+	settings->SetPasswordL(testUtils->MachineName());
+   	settings->SetPort(143);
+	settings->SetFolderPathL(KFolderPath);
+	
+	accounts->GetImapAccountL(imap4Service, imapAccount);
+	accounts->SaveImapSettingsL(imapAccount, *settings);
+	CleanupStack::PopAndDestroy(2,accounts); //accounts,settings
+	
+	test.Printf(_L("Instantiating IMAP4 Client MTM"));
+	testUtils->InstantiateImapClientMtmL();
+	}
+
+LOCAL_C void Closedown()
+	{
+	CleanupStack::PopAndDestroy(2);  //testUtils, scheduler 
+	}
+
+LOCAL_C void doMainL()
+	{
+	test.Start(_L("IMAP4 - Offline Delete"));
+	InitL();
+  	testUtils->TestStart(1);
+	TestOfflineDeleteL();
+ 	testUtils->TestFinish(1);
+	testUtils->TestHarnessCompleted();
+	Closedown();		
+	}
+
+
+GLDEF_C TInt E32Main()
+	{
+	__UHEAP_MARK;
+	theCleanup=CTrapCleanup::New();
+	TRAPD(ret,doMainL());		
+	test(ret==KErrNone);
+	delete theCleanup;	
+	test.Console()->SetPos(0, 13);
+	test.End();
+	test.Close();
+	__UHEAP_MARKEND;
+	return(KErrNone);
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_DUMP.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,303 @@
+// Copyright (c) 1998-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:
+// Testing Recieving of messages
+// 
+//
+
+#include <e32test.h>
+#include <f32fsys.h>
+#include <s32file.h>
+#include <e32base.h>
+#include <txtetext.h>
+#include <txtrich.h>
+#include <bautils.h>
+#include <miuthdr.h>
+#include <miutmsg.h>
+#include <miutset.h>  //KUidMsgTypePOP3
+#include <imutdll.h>	
+#include <imcvtext.h>
+#include <imcvrecv.h>
+#include <imcvsend.h>
+
+#include <imapset.h>
+
+//Oyster includes
+#include <msvstd.h>
+#include <msvids.h>
+#include <msvuids.h>
+#include <msvruids.h>
+#include <msvreg.h>
+
+#include "msvindexadapter.h"
+
+#include "msvserv.h"
+#include <msventry.h> 
+#include <msvapi.h>
+#include <mtclbase.h>
+#include <offop.h>
+
+#include "t_log.h"
+
+//----------------------------------------------------------------------------------------
+
+_LIT(KFilePathMailTest, "c:\\mailtest\\");
+
+//----------------------------------------------------------------------------------------
+
+LOCAL_D RTest test(_L("T_DUMP test harness"));
+
+LOCAL_D CTrapCleanup* theCleanup;
+LOCAL_D RFs theFs;	
+LOCAL_C CActiveScheduler* theScheduler;
+
+class CTestTimer;
+LOCAL_D	CTestTimer* timer;
+
+class CDummyMsvSessionObserver;
+
+LOCAL_C CMsvServer* theServer;
+
+//----------------------------------------------------------------------------------------
+
+class CDummyMsvSessionObserver : public CBase, public MMsvSessionObserver
+	{
+public:
+	void HandleSessionEvent(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
+		{};
+	};
+class CTestTimer : public CTimer
+	{
+public:
+	static CTestTimer* NewL();
+private:
+	CTestTimer();
+	void RunL();	
+	};
+
+CTestTimer::CTestTimer() : CTimer(EPriorityLow) {}
+
+void CTestTimer::RunL()
+	{
+	CActiveScheduler::Stop();
+	}
+
+CTestTimer* CTestTimer::NewL()
+	{
+	CTestTimer* self = new(ELeave) CTestTimer();
+	CleanupStack::PushL(self);
+	self->ConstructL(); // CTimer
+	CActiveScheduler::Add(self);
+	CleanupStack::Pop();
+	return self;
+	}
+
+class CTestActive : public CActive
+	{
+public:
+	CTestActive();
+	void ConstructL();
+//	void ChangeEntryL(TMsvId aId);
+	~CTestActive();
+private:
+	void RunL();
+	void DoCancel();
+private:
+//	CImCalculateMsgSize* iMsgSize;
+	};
+
+LOCAL_C CTestActive* active;
+
+//ctestactive
+CTestActive::CTestActive()
+: CActive(EPriorityStandard)
+	
+	{
+	__DECLARE_NAME(_S("CTestActive"));
+	}
+
+CTestActive::~CTestActive()
+	{
+	Cancel();
+//	delete iMsgSize;
+	}
+
+void CTestActive::ConstructL()
+	{
+	CActiveScheduler::Add(this);	
+//	iMsgSize = CImCalculateMsgSize::NewL(theFs, *sEntry);
+	}
+
+#if 0
+void CTestActive::ChangeEntryL(TMsvId /*aId*/)
+	{
+//	TTime time;
+//	iMsgSize->StartL(iStatus, aId, ENoAlgorithm, time, domainName);
+	SetActive();
+	}
+#endif
+
+void CTestActive::RunL()
+	{
+//	TInt32 size=iMsgSize->MessageSize();
+//	test.Printf(TRefByValue<const TDesC>_L("message size is %d\n\n"), size);
+	CActiveScheduler::Stop();
+	}
+
+void CTestActive::DoCancel()
+	{
+//	iMsgSize->Cancel();
+	}
+
+//----------------------------------------------------------------------------------------
+LOCAL_C void CreateAllTestDirectories()
+//----------------------------------------------------------------------------------------	
+	{
+	// create c:\mailtest, c:\mailtest\imcv c:\mailtest\attach\ directories used by this test harness
+	RFs s;
+	TFileName buffer;
+	if(!s.Connect())
+		{
+		TBool stop=EFalse;
+		s.SetSessionPath(_L("c:\\"));
+		if(!s.MkDir(KFilePathMailTest))
+			{
+			buffer=KFilePathMailTest;
+			test.Printf(TRefByValue<const TDesC>_L("Created %S directory\n"),&buffer);
+			stop=ETrue;
+			}
+#if 0
+		if(!s.MkDirAll(KTestMessageDir))
+			{
+			buffer=KTestMessageDir;
+			test.Printf(TRefByValue<const TDesC>_L("Created %S directory\n"),&buffer);
+			stop=ETrue;
+			}
+		if(!s.MkDirAll(KLogsDir))
+			{
+			buffer=KLogsDir;
+			test.Printf(TRefByValue<const TDesC>_L("Created %S directory\n"),&buffer);
+			stop=ETrue;
+			}
+#endif
+		if(stop)
+			{
+			test.Printf(_L("[Press any key to continue...]\n\n"));
+			test.Getch();
+			}
+		s.Close();
+		}
+	}
+
+//----------------------------------------------------------------------------------------
+LOCAL_C void Up()
+//----------------------------------------------------------------------------------------
+	{
+	theScheduler = new (ELeave)CActiveScheduler;
+	CActiveScheduler::Install( theScheduler );
+	CleanupStack::PushL(theScheduler);
+
+	User::LeaveIfError(theFs.Connect());
+	theFs.SetSessionPath(_L("C:\\"));
+
+#if 0
+	theFs.SetSessionPath( KFilePathMailTest );
+
+	// Delete out the logs
+	CFileMan* fileMan=CFileMan::NewL(theFs);
+	fileMan->Delete(KLogsDir, CFileMan::ERecurse);
+	delete fileMan;
+#endif
+	
+	// create a CMsvServer
+	timer = CTestTimer::NewL();
+	theServer = CMsvServer::NewL();
+	CleanupStack::PushL(theServer);
+
+	timer->After(100000);
+	CActiveScheduler::Start();
+	delete timer;
+
+	active = new (ELeave) CTestActive();
+	CleanupStack::PushL(active);
+	active->ConstructL();	
+	}
+
+//----------------------------------------------------------------------------------------
+LOCAL_C void Down()
+//----------------------------------------------------------------------------------------
+	{
+	test.Printf(_L("---------------------\n"));
+	test.Printf(_L("      Going down     \n"));
+	test.Printf(_L("---------------------\n"));
+	CleanupStack::PopAndDestroy(3);  //active, msvserver, theScheduler
+	theFs.Close();
+	}
+
+//----------------------------------------------------------------------------------------
+LOCAL_C void doMainL()
+//----------------------------------------------------------------------------------------
+	{
+	CreateAllTestDirectories();
+	Up();
+
+	test.Console()->ClearScreen();
+	test.Console()->SetPos(0, 0);
+	test.Printf(_L("---------------------\n"));
+	test.Printf(_L("    Message dumper   \n"));
+	test.Printf(_L("---------------------\n"));
+		
+	__UHEAP_MARK;
+	COutputter* putter = COutputter::NewL( &test );
+	CleanupStack::PushL(putter);
+
+	putter->SetRFs( &theFs );
+	theFs.SetSessionPath( KFilePathMailTest );
+
+	CMsvServerEntry* entry = CMsvServerEntry::NewL( *theServer, KMsvNullIndexEntryId );
+	CleanupStack::PushL(entry);
+
+	// enable invisible entries
+	TMsvSelectionOrdering sort = entry->Sort();
+	sort.SetShowInvisibleEntries(ETrue);
+	entry->SetSort(sort);
+	
+	CMsgOutputter* dumper = CMsgOutputter::NewL( putter, entry );
+	CleanupStack::PushL(dumper);
+
+	dumper->DumpL( KMsvRootIndexEntryId, CMsgOutputter::EToOneFile,
+				   CMsgOutputter::EToOneFile, ETrue, ETrue);
+
+	CleanupStack::PopAndDestroy(3); // dumper, putter, entry
+	__UHEAP_MARKEND;
+
+	Down();
+	}
+
+//----------------------------------------------------------------------------------------
+GLDEF_C TInt E32Main()
+//----------------------------------------------------------------------------------------
+	{	
+	__UHEAP_MARK;
+	test.Start(_L("T_DUMP Test harness"));
+	theCleanup=CTrapCleanup::New();
+
+	TRAPD(ret,doMainL());
+
+	test(ret==KErrNone);
+	delete theCleanup;
+	test.End();
+	test.Close();
+	__UHEAP_MARKEND;
+	return(KErrNone);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_DecodeServer.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,81 @@
+// Copyright (c) 2005-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 "t_decodeserver.h"
+#include "t_test_decode_step.h"
+
+_LIT(KServerName,"T_DecodeServer");
+CImapDecodeServer* CImapDecodeServer::NewL()
+	{
+	CImapDecodeServer * server = new (ELeave) CImapDecodeServer();
+	CleanupStack::PushL(server);
+	server-> ConstructL(KServerName);
+
+	CleanupStack::Pop(server);
+	return server;
+	}
+	
+LOCAL_C void MainL()
+	{
+	CActiveScheduler* sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(sched);
+	CImapDecodeServer* server = NULL;
+	// Create the CTestServer derived server
+	TRAPD(err,server = CImapDecodeServer::NewL());
+	if(!err)
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	delete server;
+	delete sched;
+	}
+
+
+GLDEF_C TInt E32Main()
+	{
+	__UHEAP_MARK;
+	
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAPD(err,MainL());
+	delete cleanup;
+	
+	__UHEAP_MARKEND;
+	return err;
+    }
+
+
+RFs& CImapDecodeServer::Fs()
+	{
+	return iFs;
+	};	
+
+CTestStep* CImapDecodeServer::CreateTestStep(const TDesC& aStepName)
+	{
+		
+	CTestStep* testStep = NULL;
+	
+	if(aStepName == KTestDecode)
+		testStep = new CTestDecode();
+
+
+	return testStep;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_IMPS01.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,7972 @@
+// Copyright (c) 1998-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 <logcli.h>
+#include <logview.h>
+
+#include "EmailTestUtils.h"
+#include <commdb.h>
+#include <bacline.h>
+#include <cemailaccounts.h>
+
+
+
+#include "t_log.h"
+
+// For loading the serial comms device drivers 
+#if defined (__WINS__)
+	#define PDD_NAME		_L("ECDRV")
+	#define LDD_NAME		_L("ECOMM")
+#else
+	#define PDD_NAME		_L("EUART1")
+	#define LDD_NAME		_L("ECOMM")
+#endif
+
+// --------------------------------------------------------------------------
+
+//#define _DEBUG_MTMCOMMAND_
+
+// Static variables
+
+LOCAL_D RTest test(_L("IMPS.dll Testrig"));
+LOCAL_D RFs theFs;
+
+// LOCAL_C CMsvServer* theServer;
+
+_LIT(KFolderNameToEncode, "áéíóú");
+
+_LIT(KMessageNameTest, "Test: 12");
+_LIT(KMessageNameAttachment, "Test: 9");
+
+_LIT(KMessageNamePriority,"Test: 23");
+_LIT(KMessageNameXPriority,"Test: 15");
+_LIT(KMessageNamePrecedence,"Test: 24");
+_LIT(KMessageNameImportance,"Test: 14");
+
+_LIT(KMessageNameMimeHTML, "Test: 2");
+
+
+LOCAL_D const TUid KUidImQueuedOperationList = {0x10001794};	// 2648441492 dec.
+
+_LIT(KTestParams,"-testparams");
+enum TCmdLineArgs
+	{
+	EArgProgramName,
+	EArgTestParams,
+	EArgRemoveMsgStore,
+	EArgMainMenu
+	};
+
+// --------------------------------------------------------------------------
+
+class TestScheduler : public CActiveScheduler
+	{
+public:
+	void Error (TInt aError) const;
+	};
+
+void TestScheduler::Error(TInt anError) const
+	{
+	test.Printf(_L("Scheduler Error %d"), anError );
+	CActiveScheduler::Stop();
+	}
+
+// -------------------------------------------------------------------------
+
+class TestUiTimer : public CTimer
+	{
+public:
+	static TestUiTimer* NewL( CConsoleBase*, CBaseServerMtm* &aImppServerMtm );
+	~TestUiTimer();
+
+	void RunL();
+	void DoCancel();
+	void ConstructL();
+	void IssueRequest();
+	void Dump();
+	TPtrC StateName(TImap4GenericProgress::TImap4GenericProgressState aState);
+	TPtrC OpName(TImap4GenericProgress::TImap4GenericProgressOp aOp);
+	TPtrC SyncStateName(TImap4SyncProgress::TImap4SyncProgressState aState);
+
+	CConsoleBase*				iConsole;
+	CBaseServerMtm*				&iImppServerMtm;
+	TTimeIntervalMicroSeconds32 period;
+protected:
+	TestUiTimer( CConsoleBase* , CBaseServerMtm* &aImppServerMtm );
+
+	TInt iCount;
+	TBool iClosing;
+	TBool iDoneConnecting;
+	};
+
+// --------------------------------------------------------------------------
+
+enum TImap4OpType
+	{
+	EImap4OpCopyToLocal,
+	EImap4OpMoveToLocal,
+	EImap4OpCopyFromLocal,
+	EImap4OpMoveFromLocal,
+	EImap4OpCopyWithinService,
+	EImap4OpMoveWithinService,
+	EImap4OpMoveWithinServiceToInbox,
+	EImap4OpPopulate,
+	EImap4OpDelete,
+	EImap4OpUndelete,
+	EImap4OpCopyWithinFolder,
+	EImap4OpCopyToLocalAndDelete,
+	EImap4OpMoveToLocalAndDelete,
+	EImap4OpCopyFromLocalAndDelete,
+	EImap4OpMoveFromLocalAndDelete,
+	EImap4OpCopyWithinServiceAndDelete,
+	EImap4OpMoveWithinServiceAndDelete
+	};
+
+enum TDebugLevel
+	{
+	EDebugLevel0=0,
+	EDebugLevel1,
+	EDebugLevel2,
+	EDebugLevel3,
+	EDebugLevel4,
+	EDebugLevel5,
+	EDebugLevel6,
+	EDebugLevel7,
+	EDebugLevel8,
+	EDebugLevel9
+	};
+class CActiveConsole;
+class CTestRefreshMBox : public CActive
+	{
+public:
+	static CTestRefreshMBox* NewLC(CCommandLineArguments* aCmdLineArgs);
+	static CTestRefreshMBox* NewL(CCommandLineArguments* aCmdLineArgs);
+
+	// Destruction
+	~CTestRefreshMBox();
+	
+	// Issue request
+	void StartL();
+	void EnterStateL(TInt aState);
+
+	// Cancel request.
+	// Defined as pure virtual by CActive;
+	// implementation provided by this class.
+	void DoCancel();
+
+	// Service  request.
+	// Defined as pure virtual by CActive;
+	// implementation provided by this class,
+	void RunL();
+	TInt NumBadMessages();
+
+	void ModifyImap4SynchronisationLimitsL(TInt aInboxSyncLimit,TInt aMailboxSyncLimit);
+	void FindImap4SettingsL();
+	void CreateDefaultServiceL(CImImap4Settings* aSettings);
+	void CreateServiceL( const CImImap4Settings* aSettings,
+						 const TDesC& aDetails, const TDesC& aDescription,
+						 const TBool aLocalOnly =EFalse);
+	void QueueOpL(TImap4OpType aOp);
+	void UnQueueOpL(TImap4OpType aOp);
+	void QueueLocalToLocalOpL(TImap4OpType aOp);
+
+ 	CMsvServerEntry* ServerEntry();
+	void SelectServiceIdL();
+	TMsvId iServiceId;
+	void DoCancelOffLineOpsL();
+	
+	void SetConsole(CActiveConsole* aConsole) {iConsole=aConsole;} 
+
+	CEmailTestUtils*		iTestUtils;
+	TInt iDebugLevel;
+
+private:
+    void EndOfTest();  
+	void SetSubscriptionsL( TFolderSyncType aSync, TFolderSubscribeType aSubscribe );
+	void FindAttachmentL();
+	void FindMessagesInSelectionL();
+
+	void DoConnectL();
+	void DoConnectAndSyncL();
+	void DoFullSyncL();
+	void DoInboxNewSyncL();
+	void DoSyncTreeL();
+	void DoFetchInboxL();
+	void DoDisconnectL();
+	void DoWaitForBackgroundL();
+	void DoFetchAttachmentL();
+    void DoFetchAttachedMessageL();
+	void DoRenameFolderL();
+	void DoAutomatedOffLineOpsL();
+	void DoAutomatedSyncOpsL();
+	void DoFetchTestL();
+	void DoFolderRemoveL();
+	void DoFolderRemoveL(TMsvId aParent, const TDesC& aName);
+	void DoFolderCreateL();
+	void DoFolderCreateL(TMsvId aParent, const TDesC& aName);
+	void DoAutomatedSecondaryConnectOpsL();
+	void DoCopyMessagesL();
+
+	TBool StateMachineCheckServerContentsL();
+	void DoCheckServerContentsL();
+
+	TBool StateMachineNSynchronisationL();
+	void DoNSynchronisationRegressionL();
+	void DoNSynchronisationTestsL();
+	void DoNSynchronisationSpecialTestsL();
+	void DoNSynchronisationPerformanceTestsL();
+	void DoNSynchronisationOneOffTestsL();
+
+	void StartTimerL();
+	void ClearTimer();
+	void ConstructL();
+	TPtrC TestMsgName(TImap4OpType aOpType, TImap4GetMailOptions aOptions);
+	void TestFolders(TImap4OpType aOpType,
+					 TMsvId& srcFolder, TMsvId& destination);
+	
+	TMsvId FindMessageByNameL(TMsvId aSrcFolder, const TDesC& aName);
+	TMsvId FindMessageByOpL(TMsvId aSrcFolder, TImap4OpType aOp);
+	TMsvId FindMessageByOpL(TMsvId aSrcFolder, TImap4OpType aOp, TImap4GetMailOptions aOptions);
+	TMsvId FindFolderByNameL(TMsvId aSrcFolder, const TDesC& aName);
+	TMsvId FindByNameL(TMsvId aSrcFolder, const TDesC& aName, TBool aSearchOnDetails);
+	
+	TMsvId CountMessagesByNameL(TMsvId aSrcFolder, const TDesC& aName);
+	TInt CountMessagesByOpL(TMsvId aSrcFolder, TImap4OpType aOp);
+
+
+protected:
+	// Data members defined by this class
+	CBaseServerMtm*			iImppServerMtm;
+	CMsvServerEntry*		iEntry;
+	CMsvEntrySelection*		iSelection;
+	TInt					iState;
+
+private:
+	CMsvServerEntry* SetEntryL(TMsvId aFolder, const TDesC& aName);
+	CImHeader* GetHeaderLC();
+	CImImap4Settings* GetImap4SettingsLC();
+
+	TBool HandleSyncStateL();
+	TBool HandleOffLineStateL();
+	TBool TestSecondaryConnectStateMachineL();
+
+	void NextState(TInt aInc);
+	void NextState();
+	void PerformOpL( TImap4OpType aOpType, const TDesC8& aParams);
+	void PerformSpecialOpL(TMsvId aId, TImap4Cmds aCommand);
+	
+	void DoOpByIdL( TImap4OpType aOpType, TMsvId aId );
+	void DoOpByIdL( TImap4OpType aOpType, TMsvId aId, const TDesC8& aParams );
+	void DoOpL( TImap4OpType aOpType, const TDesC& aName, TMsvId aSourceFolder, TMsvId aDestFolder, const TDesC8& aParams);
+	void DoOpL( TImap4OpType aOpType, TMsvId aSourceFolder, TMsvId aDestFolder, const TDesC8& aParams);
+	void DoOpL( TImap4OpType aOpType, TMsvId aSourceFolder, TMsvId aDestFolder);
+	void DoOpL( TImap4OpType aOpType, TMsvId aSourceFolder, TMsvId aDestFolder, TImap4GetMailOptions aOptions);
+	void DoOpNamedL( TImap4OpType aOpType, TMsvId aSrcFolder, TMsvId aDestFolder, const TDesC8& params);
+	void DoOpNamedL( TImap4OpType aOpType, TMsvId aSrcFolder, TMsvId aDestFolder);
+	void DoOpNamedL( TImap4OpType aOpType, TMsvId aSrcFolder, TMsvId aDestFolder, TImap4GetMailOptions aOptions);
+
+	TBool TestQueueL( TMsvId aFolder, CImOffLineOperation::TOffLineOpType aOpType, TMsvId aMessage, TMsvId aTarget, TInt aFnId,	const TDesC8& aParams );
+	TBool TestQueueL( TMsvId aFolder, CImOffLineOperation::TOffLineOpType aOpType, TMsvId aMessage, TMsvId aTarget, TImap4GetMailOptions aOptions );
+	TBool TestQueueL( TMsvId aFolder, CImOffLineOperation::TOffLineOpType aOpType, TMsvId aMessage, TMsvId aTarget );
+	TBool TestQueueEmptyL( TMsvId aFolder );
+	TMsvId FindShadowL( TMsvId aFolder, TMsvId aSourceId );
+	TBool TestShadowL( TMsvId aFolder, TMsvId aSourceId );
+	TBool TestVisible( TMsvId aSourceId );
+	TBool TestInvisible( TMsvId aSourceId );
+	TBool TestComplete( TMsvId aSourceId );
+	TBool TestExists( TMsvId aSourceId );
+	TImDisconnectedOperationType TestDisconnectedFlags( TMsvId aSourceId );
+	TBool TestSubscribed( TMsvId aSourceId );
+	TBool TestNotSubscribed( TMsvId aSourceId );
+	TBool TestLocalSubscription( TMsvId aSourceId );
+	TBool TestNotLocalSubscription( TMsvId aSourceId );
+
+	void TestPriorityAndReceiptAddressL();
+
+	void DebugFormatL(TInt aDebugLevel,TRefByValue<const TDesC> aFmt,...);
+	void DebugUidListL(TInt aDebugLevel);
+
+	TMsvId iRemoteInbox;
+
+	TMsvId iRemoteFolder1;
+	TMsvId iRemoteFolder2;
+	TMsvId iLocalFolder1;
+	TMsvId iLocalFolder2;
+
+	TInt iOpState;
+	TInt iTestNum;
+	TMsvId iSourceId;
+	TMsvId iSourceFolder;
+	TMsvId iDestFolder;
+	TMsvId iOrigSourceId;
+
+	CLogClient *iLogClient;
+	CLogViewEvent *iLogView;
+	CLogFilter *iLogFilter;
+
+	TUint32 iMessageUid;
+	TInt iSyncLimit;
+	TTime iTimeStamp;
+	
+private:
+	CTestRefreshMBox();
+	TestUiTimer*			iTimer;
+
+	TBool					iRenamedFolder;
+	
+	CActiveConsole*			iConsole;
+	CCommandLineArguments*	iCmdLineArgs;	
+
+public:
+	enum
+		{
+		EImapTestConnect,
+		EImapTestConnectAndSync,
+		EImapTestFullSync,
+		EImapTestInboxNewSync,
+		EImapTestSyncTree,
+		EImapTestDisconnect,
+		EImapTestFetchInbox,
+		EImapTestOffLineOp,
+		EImapTestWaitForBackground,
+		EImapTestFetchAttachment,
+		EImapTestCancelOffLineOps,
+		EImapTestRenameFolder,
+		EImapTestAutoOffLineOp,
+		EImapTestAutoSyncOp,
+		EImapTestFetchTest,
+		EImapTestFolderDelete,
+		EImapTestFolderCreate,
+		EImapTestCheckServerContents,
+		EImapTestAutoSecondaryConnect,
+		EImapTestLocalSubscribe,
+		EImapTestLocalUnsubscribe,
+        EImapTestFetchAttachedMessage,
+        EImapTestCopyMessages,
+		EImapTestNSynchronisation,	 
+		EImapTestNSynchronisationTests,			 
+		EImapTestNSynchronisationSpecialTests,
+		EImapTestNSynchronisationPerformanceTests,
+		EImapTestNSynchronisationOneOffTests
+		};
+	};
+
+// --------------------------------------------------------------------------
+
+// My derived Console, as per the example code and the stuff in T_POPC 
+
+class CActiveConsole : public CActive
+	{
+public:
+	// Construction
+	static CActiveConsole* NewLC( CTestRefreshMBox *aRefresher,CCommandLineArguments* aCmdLineArgs );
+
+	// Destruction
+	~CActiveConsole();
+
+	// Issue request
+	void RequestCharacter();
+	
+	// Cancel request.
+	// Defined as pure virtual by CActive;
+	void DoCancel();
+
+	// Service completed request.
+	// Defined as pure virtual by CActive;
+	void RunL();
+
+	// Called from RunL() to handle the completed request
+	void ProcessKeyPressL(TChar aChar); 
+
+	void DumpMessageStructureL( TMsvId aId,
+							   TInt aSummary,
+							   TInt aParts,
+							   TBool aRecurse,
+							   TBool aShowIds,
+							   MsgMatchFn aMatch =0);
+private:
+	void ConstructL();
+	CActiveConsole();
+
+	void DisplayMainMenu();
+	void DisplayImap4ServerMenu();
+	void DisplayImap4SettingsMenu();
+	void DisplayImap4DumpMenu();
+	void DisplayHousekeepingMenu();
+	void DisplayOffLineOpMenu();
+	void DisplayOffLineOpQueueMenu();
+	void DisplayOffLineOpUnQueueMenu();
+	void DisplayOffLineOpQueueLocalToLocalMenu();
+	void DisplayConnectMenu();
+	void DisplayConnect2Menu();
+	void DisplayAutomationMenu();
+	void DisplaySynchroniseMenu();
+	void DisplayDebugMenu();
+
+	void SelectImap4ServerEntryL(TChar aChar);
+	void SelectImap4SettingsEntryL(TChar aChar);
+	
+
+public:
+	TBool	iIssueCancel;
+
+private:	
+	TUint iMenuState;
+	TUint iPrevState;
+
+	CTestRefreshMBox *iRefresher;
+	
+	CCommandLineArguments*	iCmdLineArgs;
+	TInt					iLevel;
+
+	enum
+		{
+		EExit = 0,
+		EMainMenu,
+		EImap4ServerMenu,
+		EImap4SettingsMenu,
+		EImap4DumpMenu,
+		EHousekeepingMenu,
+		EOffLineOpMenu,
+		EOffLineOpQueueMenu,
+		EOffLineOpUnQueueMenu,
+		EOffLineOpQueueLocalToLocalMenu,
+		EConnectMenu,
+		EConnect2Menu,
+		EAutomationMenu,
+		ESynchroniseMenu,
+		EDebugMenu
+		};
+	};
+
+// -------------------------------------------------------------------------
+
+// Constants
+
+_LIT(KFilePathMailTest, "c:\\mailtest\\");
+
+#define KPeriod 10000	// period of timer
+
+// -------------------------------------------------------------------------
+
+TestUiTimer* TestUiTimer::NewL( CConsoleBase* aConsole, CBaseServerMtm* &aImppServerMtm)
+	{
+	TestUiTimer* self = new(ELeave) TestUiTimer( aConsole , aImppServerMtm);
+	CleanupStack::PushL(self);
+	self->iImppServerMtm = aImppServerMtm;
+	self->ConstructL();
+	CleanupStack::Pop();
+	return self;
+	}
+
+
+TestUiTimer::TestUiTimer( CConsoleBase* aConsole , CBaseServerMtm* &aImppServerMtm)
+	: CTimer(10 /*KMsgPop3RefreshMailboxPriority+1*/) , iImppServerMtm(aImppServerMtm)
+	{
+	iConsole = aConsole;
+	period = 	KPeriod;
+	iClosing = EFalse;
+	iCount = 0;
+	iDoneConnecting = EFalse;
+	}
+
+TestUiTimer::~TestUiTimer()
+	{
+	}
+
+void TestUiTimer::ConstructL()
+	{
+	CTimer::ConstructL();
+
+	CActiveScheduler::Add( this );
+	}
+
+
+void TestUiTimer::IssueRequest()
+	{
+	After( period );
+	}
+
+
+void TestUiTimer::DoCancel()
+	{
+	CTimer::DoCancel();
+	}
+
+TPtrC TestUiTimer::OpName(TImap4GenericProgress::TImap4GenericProgressOp aOp)
+	{
+	switch (aOp)
+		{
+	case TImap4GenericProgress::EConnect:
+		return _L("EConnect");
+	case TImap4GenericProgress::EDisconnect:
+		return _L("EDisconnect");
+	case TImap4GenericProgress::ESync:
+		return _L("ESync");
+	case TImap4GenericProgress::ESelect:
+		return _L("ESelect");
+		
+	case TImap4GenericProgress::ECopyToLocal:
+		return _L("ECopyToLocal");
+	case TImap4GenericProgress::ECopyWithinService:
+		return _L("ECopyWithinService");
+	case TImap4GenericProgress::ECopyFromLocal:
+		return _L("ECopyFromLocal");
+	case TImap4GenericProgress::EMoveToLocal:
+		return _L("EMoveToLocal");
+	case TImap4GenericProgress::EMoveWithinService:
+		return _L("EMoveWithinService");
+	case TImap4GenericProgress::EMoveFromLocal:
+		return _L("EMoveFromLocal");
+	case TImap4GenericProgress::EPopulate:
+		return _L("EPopulate");
+	case TImap4GenericProgress::EDelete:
+		return _L("EDelete");
+		
+	case TImap4GenericProgress::EOffLineDelete:
+	case TImap4GenericProgress::EOffLineUndelete:
+	case TImap4GenericProgress::EOffLineCopyToLocal:
+	case TImap4GenericProgress::EOffLineMoveToLocal:
+	case TImap4GenericProgress::EOffLineCopyFromLocal:
+	case TImap4GenericProgress::EOffLineMoveFromLocal:
+	case TImap4GenericProgress::EOffLineCopyWithinService:
+	case TImap4GenericProgress::EOffLineMoveWithinService:
+	case TImap4GenericProgress::EOffLinePopulate:
+		return _L("EOffLineOp");
+		
+	default:
+		test.Panic(_L("Unknown Op %d"),aOp);
+		break;
+		}
+	return _L("EUnknown");
+	}
+
+TPtrC TestUiTimer::StateName(TImap4GenericProgress::TImap4GenericProgressState aState)
+	{
+	switch (aState)
+		{
+	case TImap4GenericProgress::EDisconnected:
+		return _L("EDisconnected");
+	case TImap4GenericProgress::EConnecting:
+		return _L("EConnecting");
+	case TImap4GenericProgress::EIdle:
+		return _L("EIdle");
+	case TImap4GenericProgress::ESelecting:
+		return _L("ESelecting");
+	case TImap4GenericProgress::EFetching:
+		return _L("EFetching");
+	case TImap4GenericProgress::EAppending:
+		return _L("EAppending");
+	case TImap4GenericProgress::ECopying:
+		return _L("ECopying");
+	case TImap4GenericProgress::EDeleting:
+		return _L("EDeleting");
+	case TImap4GenericProgress::ESyncing:
+		return _L("ESyncing");
+	case TImap4GenericProgress::EDisconnecting:
+		return _L("EDisconnecting");
+	case TImap4GenericProgress::EBusy:		
+		return _L("EBusy");
+	default:
+		test.Panic(_L("Unknown State %d"),aState);
+		break;
+		}
+	return _L("EUnknown");
+	}
+
+
+TPtrC TestUiTimer::SyncStateName(TImap4SyncProgress::TImap4SyncProgressState aState)
+	{
+	switch (aState)
+		{
+	case TImap4SyncProgress::EIdle:
+		return _L("Idle");
+	case TImap4SyncProgress::EBusy:
+		return _L("Busy");
+	case TImap4SyncProgress::EConnecting:
+		return _L("Connecting");
+	case TImap4SyncProgress::EDisconnecting:
+		return _L("Disconnecting");
+	case TImap4SyncProgress::ESyncInbox:
+		return _L("SyncInbox");
+	case TImap4SyncProgress::ESyncFolderTree:
+		return _L("SyncFolderTree");
+	case TImap4SyncProgress::ECheckRemoteSubscription:
+		return _L("CheckRemoteSubscription");
+	case TImap4SyncProgress::EUpdateRemoteSubscription:
+		return _L("UpdateRemoteSubscription");
+	case TImap4SyncProgress::ESyncOther:
+		return _L("SyncOther");
+	case TImap4SyncProgress::EDeleting:
+		return _L("Deleting");
+	case TImap4SyncProgress::EProcessingPendingOps:
+		return _L("ProcPending");
+	default:
+		test.Panic(_L("Unknown SyncState %d"),aState);
+		break;
+		}
+	return _L("EUnknown");
+	}
+
+void TestUiTimer::Dump()
+	{
+	// display the current progress
+	TImap4CompoundProgress temp;	
+	TPckgC<TImap4CompoundProgress> paramPack(temp);
+
+	const TDesC8& progBuf = iImppServerMtm->Progress();	
+	paramPack.Set(progBuf);
+	TImap4CompoundProgress progress=paramPack();	
+
+	test.Console()->SetPos(0, 15);
+
+	if ( progress.iGenericProgress.iState == TImap4GenericProgress::EConnecting &&
+		 progress.iGenericProgress.iErrorCode == KErrNone )
+		{
+		if ( iDoneConnecting )
+			return;
+		iDoneConnecting = ETrue;
+		}
+	
+	TPtrC opName = OpName(progress.iGenericProgress.iOperation);
+	TPtrC stateName = StateName(progress.iGenericProgress.iState);
+
+	test.Printf(_L("%-11S: %-14S M %3d/%3d P %2d/%2d B %6d/%6d T %6d Err %d\n"),
+				&opName, &stateName,
+				progress.iGenericProgress.iMsgsDone, progress.iGenericProgress.iMsgsToDo,
+				progress.iGenericProgress.iPartsDone, progress.iGenericProgress.iPartsToDo,
+				progress.iGenericProgress.iBytesDone, progress.iGenericProgress.iBytesToDo,
+				progress.iGenericProgress.iTotalSize,
+				progress.iGenericProgress.iErrorCode);
+	
+	TPtrC syncName = SyncStateName(progress.iSyncProgress.iState);
+	test.Printf(_L("           : %-14S M %3d/%3d F %2d/%2d   \n"),
+				&syncName,
+				progress.iSyncProgress.iMsgsDone, progress.iSyncProgress.iMsgsToDo,
+				progress.iSyncProgress.iFoldersDone, progress.iSyncProgress.iFoldersToDo);
+	}
+
+void TestUiTimer::RunL()
+	{
+	Dump();
+	IssueRequest();
+	};
+
+// -------------------------------------------------------------------------
+
+// CTestRefresh CActive object
+CTestRefreshMBox::CTestRefreshMBox() // construct low-priority active object
+	: CActive(-3)
+	{
+	}
+
+CTestRefreshMBox  *CTestRefreshMBox::NewLC(CCommandLineArguments* aCmdLineArgs)
+	{
+	CTestRefreshMBox* self=new (ELeave) CTestRefreshMBox();
+	
+	CleanupStack::PushL(self);
+	self->iCmdLineArgs = aCmdLineArgs;
+	self->ConstructL();
+	return self;
+	}
+
+CTestRefreshMBox  *CTestRefreshMBox::NewL(CCommandLineArguments* aCmdLineArgs)
+	{
+	CTestRefreshMBox* self=NewLC(aCmdLineArgs);
+	CleanupStack::Pop();
+	return self;
+	}
+
+void CTestRefreshMBox::ConstructL()
+	{
+	iTestUtils = CEmailTestUtils::NewL(test);
+
+	iTestUtils->CreateAllTestDirectories();
+	iTestUtils->FileSession().SetSessionPath(_L("C:\\"));
+
+#if 1
+	test.Printf(_L("Remove message store? (y/N)\n"));
+	TChar choice;
+	if (iCmdLineArgs)
+		{
+		TLex lex(iCmdLineArgs->Arg(EArgRemoveMsgStore));
+		choice=lex.Get();
+		}
+	else
+		choice = test.Getch();
+	if (choice=='y' || choice=='Y')
+#endif
+		iTestUtils->Reset();
+		iTestUtils->CleanMessageFolderL();	
+		iTestUtils->ClearEmailAccountsL();
+		iTestUtils->GoClientSideL();
+	
+	iTestUtils->GoServerSideL();
+	iEntry = iTestUtils->iServerEntry;
+
+	CActiveScheduler::Add(this); // add to active scheduler
+
+	// Get server MTM.
+	iTestUtils->InstantiateImapServerMtmL();
+	iImppServerMtm = iTestUtils->iImapServerMtm;
+
+	iTestUtils->FileSession().SetSessionPath(_L("c:\\"));
+
+	test.Printf(_L("Created server mtm \n"));
+	// create an entry selection
+	iSelection = new (ELeave) CMsvEntrySelection;
+
+	test.Console()->ClearScreen(); // get rid of menu
+	User::LeaveIfError(iEntry->SetEntry(KMsvRootIndexEntryId));
+
+	// test num written to log
+	iTestNum = 1;
+
+	// default debug level
+	iDebugLevel = EDebugLevel3;
+	}
+ 
+CTestRefreshMBox::~CTestRefreshMBox()
+	{ 
+	Cancel(); // make sure we're cancelled
+
+	ClearTimer();
+
+	delete iSelection;
+	delete iTestUtils;
+	delete iLogView;
+	delete iLogClient;
+	delete iLogFilter;
+	}
+
+void  CTestRefreshMBox::DoCancel()
+	{
+	if (iTimer)
+		iTimer->Cancel();	// stop the timer
+	}
+
+void CTestRefreshMBox::StartL()
+	{
+	if (iCmdLineArgs)
+		iConsole->iIssueCancel=FALSE;
+	switch(iState)
+		{
+	case EImapTestConnect:
+		DoConnectL();
+		break;
+
+	case EImapTestConnectAndSync:
+		DoConnectAndSyncL();
+		break;
+
+	case EImapTestFullSync:
+		DoFullSyncL();
+		break;
+
+	case EImapTestInboxNewSync:
+		DoInboxNewSyncL();
+		break;
+
+	case EImapTestSyncTree:
+		DoSyncTreeL();
+		break;
+
+	case EImapTestFetchInbox:
+		DoFetchInboxL();
+		break;
+
+	case EImapTestDisconnect:
+		DoDisconnectL();
+		break;
+
+	case EImapTestAutoOffLineOp:
+		DoAutomatedOffLineOpsL();
+		break;
+
+	case EImapTestAutoSyncOp:
+		DoAutomatedSyncOpsL();
+		break;
+
+	case EImapTestAutoSecondaryConnect:
+		DoAutomatedSecondaryConnectOpsL();
+		break;
+
+	case EImapTestOffLineOp:
+		break;
+
+	case EImapTestCancelOffLineOps:
+		DoCancelOffLineOpsL();
+		break;
+
+	case EImapTestWaitForBackground:
+		DoWaitForBackgroundL();
+		break;
+
+	case EImapTestFetchAttachment:
+		DoFetchAttachmentL();
+		break;
+
+	case EImapTestRenameFolder:
+		DoRenameFolderL();
+		break;
+
+	case EImapTestFetchTest:
+		DoFetchTestL();
+		break;
+
+	case EImapTestFolderDelete:
+		DoFolderRemoveL();
+		break;
+
+	case EImapTestFolderCreate:
+		DoFolderCreateL(iServiceId, _L("Test1"));
+		break;
+
+	case EImapTestCheckServerContents:
+		DoCheckServerContentsL();
+		break;
+
+	case EImapTestNSynchronisation:	   
+		DoNSynchronisationRegressionL();
+		break;
+
+	case EImapTestNSynchronisationTests:
+		DoNSynchronisationTestsL();
+		break;
+
+	case EImapTestNSynchronisationSpecialTests:
+		DoNSynchronisationSpecialTestsL();
+		break;
+
+	case EImapTestNSynchronisationPerformanceTests:
+		DoNSynchronisationPerformanceTestsL();
+		break;
+
+	case EImapTestNSynchronisationOneOffTests:
+		DoNSynchronisationOneOffTestsL();
+		break;
+
+    case EImapTestLocalSubscribe:
+        PerformSpecialOpL(FindFolderByNameL(iServiceId, _L("Test1")), KIMAP4MTMLocalSubscribe);
+        break;
+
+    case EImapTestLocalUnsubscribe:
+        PerformSpecialOpL(FindFolderByNameL(iServiceId, _L("Test1")), KIMAP4MTMLocalUnsubscribe);
+        break;
+
+	case EImapTestFetchAttachedMessage:
+		DoFetchAttachedMessageL();
+		break;
+		
+	case EImapTestCopyMessages:
+		DoCopyMessagesL();
+		break;
+		}
+	}
+
+void CTestRefreshMBox::EndOfTest()
+	{
+	if (iCmdLineArgs)
+		{
+		iConsole->iIssueCancel=TRUE;
+		iConsole->DoCancel();
+		}
+	}
+
+const TInt KDebugLogMaxLineSize=256;
+
+void CTestRefreshMBox::DebugFormatL(TInt aDebugLevel,TRefByValue<const TDesC> aFmt,...)
+	{
+	// Log this debug text?
+	if (aDebugLevel>iDebugLevel)
+		return;
+
+	// Build parameter list.
+	VA_LIST list;
+	VA_START(list, aFmt);
+
+	// Print to log file.
+	TBuf<KDebugLogMaxLineSize> buf;
+	TRAPD(ret,buf.FormatList(aFmt, list));		
+
+	// Log the debug buffer.
+	if (ret==KErrNone)
+		iTestUtils->WriteComment(buf);
+	else
+		iTestUtils->WriteComment(_L("ERROR: Formatting debug output"));
+	}
+
+void CTestRefreshMBox::DebugUidListL(TInt /*aDebugLevel*/)
+	{
+#if 0	// crashes on big test
+	
+	// Log this debug text?
+	if (aDebugLevel>iDebugLevel)
+		return;
+
+	// Build list of UIDs.
+	TBuf<KDebugLogMaxLineSize> buf;
+ 	TMsvEntry* entryPtr;
+	for (TInt i=0;i<iSelection->Count();i++)
+		{
+		TRAPD(ret,buf.AppendFormat(i?_L(", "):_L("UID list: ")));
+		if (!ret)
+			{
+			User::LeaveIfError(iEntry->GetEntryFromId((*iSelection)[i],entryPtr));
+			TRAPD(ret,buf.AppendFormat(_L("%d"),((TMsvEmailEntry)(*entryPtr)).UID()));		
+			if (ret!=KErrNone)
+				{
+				iTestUtils->WriteComment(_L("ERROR: Formatting debug output"));
+				return;
+				}
+			}
+		}
+
+	// Log the debug buffer.
+	iTestUtils->WriteComment(buf);
+#endif
+	}
+
+void CTestRefreshMBox::EnterStateL(TInt aState)
+	{
+	iState = aState;
+	StartL();
+	}
+
+void CTestRefreshMBox::StartTimerL()
+	{
+	if (!iTimer)
+		{
+		iTimer = TestUiTimer::NewL( test.Console(), iImppServerMtm );
+		iTimer->IssueRequest( );	// START THE OBSERVATION TIMER
+		}
+	}
+
+void CTestRefreshMBox::ClearTimer()
+	{
+	if (iTimer)
+		{
+		// output last known state before clearing
+		iTimer->Dump();
+		
+		delete iTimer;
+		iTimer = NULL;
+		}
+	}
+
+CMsvServerEntry* CTestRefreshMBox::ServerEntry()
+	{
+	return iEntry;
+	}
+
+void CTestRefreshMBox::SelectServiceIdL()
+	{
+	User::LeaveIfError(iEntry->SetEntry(iServiceId));
+	}
+
+CMsvServerEntry* CTestRefreshMBox::SetEntryL(TMsvId aFolder, const TDesC& aName)
+	{
+	TMsvId id = FindMessageByNameL(aFolder, aName);
+	User::LeaveIfError(iEntry->SetEntry(id));
+	return iEntry;
+	}
+
+void CTestRefreshMBox::DoConnectAndSyncL()
+	{
+	// Kick off connection to specified service
+	test.Console()->SetPos(0, 13);
+	test.Printf(_L("DoConnectAndSync\n"));
+
+	iSelection->Reset();
+	iSelection->AppendL(iServiceId);
+	TBuf8<128> paramBuf(_L8(""));
+
+	SetActive();
+	iImppServerMtm->StartCommandL(*iSelection,KIMAP4MTMConnectAndSynchronise,paramBuf,iStatus);
+
+	// create the progress Timer object
+	StartTimerL();
+	}
+
+void CTestRefreshMBox::DoConnectL()
+	{
+	// Kick off connection to specified service
+	test.Console()->SetPos(0, 13);
+	test.Printf(_L("DoConnect\n"));
+
+	iSelection->Reset();
+	iSelection->AppendL(iServiceId);
+	TBuf8<128> paramBuf(_L8(""));
+
+	SetActive();
+	iImppServerMtm->StartCommandL(*iSelection,KIMAP4MTMConnect,paramBuf,iStatus);
+
+	// create the progress Timer object
+	StartTimerL();
+	}
+
+void CTestRefreshMBox::DoFullSyncL()
+	{
+	// Kick off connection to specified service
+	test.Console()->SetPos(0, 13);
+	test.Printf(_L("DoFullSync\n"));
+
+	iSelection->Reset();
+	TBuf8<128> paramBuf(_L8(""));
+
+	SetActive();
+	iImppServerMtm->StartCommandL(*iSelection,KIMAP4MTMFullSync,paramBuf,iStatus);
+
+	// create the progress Timer object
+	StartTimerL();
+	}
+
+void CTestRefreshMBox::DoInboxNewSyncL()
+	{
+	// Kick off connection to specified service
+	test.Console()->SetPos(0, 13);
+	test.Printf(_L("DoInboxNewSync\n"));
+
+	iSelection->Reset();
+	TBuf8<128> paramBuf(_L8(""));
+
+	SetActive();
+	iImppServerMtm->StartCommandL(*iSelection,KIMAP4MTMInboxNewSync,paramBuf,iStatus);
+
+	// create the progress Timer object
+	StartTimerL();
+	}
+
+void CTestRefreshMBox::DoSyncTreeL()
+	{
+	// Kick off connection to specified service
+	test.Console()->SetPos(0, 13);
+	test.Printf(_L("DoSyncTree\n"));
+
+	iSelection->Reset();
+	TBuf8<128> paramBuf(_L8(""));
+
+	SetActive();
+	iImppServerMtm->StartCommandL(*iSelection,KIMAP4MTMSyncTree,paramBuf,iStatus);
+
+	// create the progress Timer object
+	StartTimerL();
+	}
+
+void CTestRefreshMBox::DoFetchTestL()
+	{
+	test.Console()->SetPos(0, 13);
+	test.Printf(_L("DoFetchTest\n"));
+
+	TMsvId id = FindMessageByNameL(iRemoteInbox, KMessageNameTest);
+
+	// check message is there
+	test(id != KErrNone);
+	test(id != KErrNotFound);
+
+	iSelection->Reset();
+	iSelection->AppendL(id);
+	
+	SetActive();
+	iImppServerMtm->CopyToLocalL(*iSelection, KMsvGlobalInBoxIndexEntryId, iStatus);
+
+	StartTimerL();
+	}
+
+void CTestRefreshMBox::DoFetchInboxL()
+	{
+	test.Console()->SetPos(0, 13);
+	test.Printf(_L("DoFetchInbox\n"));
+
+	User::LeaveIfError(iEntry->SetEntry( iRemoteInbox ));
+
+	User::LeaveIfError(iEntry->GetChildren(*iSelection));
+
+	// strip out any nested folders
+	TInt a=0;
+	while (a<iSelection->Count())
+		{
+		iEntry->SetEntry((*iSelection)[a]);
+		if (iEntry->Entry().iType == KUidMsvFolderEntry)
+			iSelection->Delete(a);
+		else
+			a++;
+		}
+	
+	SetActive();
+	iImppServerMtm->CopyToLocalL(*iSelection, KMsvGlobalInBoxIndexEntryId, iStatus);
+
+	StartTimerL();
+	}
+
+void CTestRefreshMBox::DoDisconnectL()
+	{
+	test.Console()->SetPos(0, 13);
+	test.Printf(_L("DoDisconnect\n"));
+
+	TBuf8<128> paramBuf(_L8(""));
+
+	SetActive();
+	iImppServerMtm->StartCommandL(*iSelection,KIMAP4MTMDisconnect,paramBuf,iStatus);
+
+	StartTimerL();
+	}
+
+void CTestRefreshMBox::DoWaitForBackgroundL()
+	{
+	test.Console()->SetPos(0, 13);
+	test.Printf(_L("DoWaitForBackground\n"));
+
+	TBuf8<128> paramBuf(_L8(""));
+
+	SetActive();
+	iImppServerMtm->StartCommandL(*iSelection,KIMAP4MTMWaitForBackground,paramBuf,iStatus);
+	}
+
+
+void CTestRefreshMBox::FindMessagesInSelectionL()
+	{
+	TInt i=0;
+	while (i<iSelection->Count())
+		{
+		User::LeaveIfError(iEntry->SetEntry((*iSelection)[i]));
+		TMsvEmailEntry entry=iEntry->Entry();
+		if (entry.iType!=KUidMsvMessageEntry)
+			iSelection->Delete(i,1);
+		else
+			i++;
+		}
+	}
+
+void CTestRefreshMBox::FindAttachmentL()
+	{
+	TMsvId id = FindMessageByNameL(iRemoteInbox, KMessageNameAttachment);
+	if (id == KErrNotFound)
+		User::Leave(KErrNotFound);
+
+	User::LeaveIfError(iEntry->SetEntry(id));
+	User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvFolderEntry, *iSelection));
+	if (iSelection->Count() == 0)
+		User::Leave(KErrNotFound);
+
+	User::LeaveIfError(iEntry->SetEntry((*iSelection)[0]));
+	User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvAttachmentEntry, *iSelection));
+	if (iSelection->Count() == 0)
+		User::Leave(KErrNotFound);
+	}
+
+void CTestRefreshMBox::DoFetchAttachmentL()
+	{
+	test.Console()->SetPos(0, 13);
+	test.Printf(_L("DoFetchAttachment\n"));
+
+	// get attachment id into selection
+	FindAttachmentL();
+	
+	SetActive();
+
+	TPckgBuf<TImap4GetMailOptions> package(EGetImap4EmailBodyTextAndAttachments);
+    iImppServerMtm->StartCommandL(*iSelection,KIMAP4MTMPopulate,package,iStatus);
+
+	// create the progress Timer object
+	StartTimerL();
+	}
+
+void CTestRefreshMBox::DoFetchAttachedMessageL()
+	{
+	test.Console()->SetPos(0, 13);
+	test.Printf(_L("DoFetchAttachedMessage\n"));
+
+	TMsvId id = FindMessageByNameL(iRemoteInbox, KMessageNameAttachment);
+	if (id == KErrNotFound)
+		User::Leave(KErrNotFound);
+
+	User::LeaveIfError(iEntry->SetEntry(id));
+	User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvFolderEntry, *iSelection));
+	if (iSelection->Count() == 0)
+		User::Leave(KErrNotFound);
+
+	User::LeaveIfError(iEntry->SetEntry((*iSelection)[0]));
+	User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+	if (iSelection->Count() == 0)
+		User::Leave(KErrNotFound);
+
+	SetActive();
+	TPckgBuf<TImap4GetMailOptions> package(EGetImap4EmailBodyTextAndAttachments);
+    iImppServerMtm->StartCommandL(*iSelection,KIMAP4MTMPopulate,package,iStatus);
+
+	// create the progress Timer object
+	StartTimerL();
+	}
+
+void CTestRefreshMBox::DoCopyMessagesL()
+	{
+	test.Console()->SetPos(0, 13);
+	test.Printf(_L("DoCopyMessages\n"));
+
+	iSelection->Reset();
+
+	User::LeaveIfError(iEntry->SetEntry( iRemoteInbox ));
+	User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+
+	SetActive();
+	iImppServerMtm->CopyWithinServiceL(*iSelection, iRemoteFolder2, iStatus);
+
+	// create the progress Timer object
+	StartTimerL();
+	}
+
+void CTestRefreshMBox::DoFolderCreateL()
+	{
+	DoFolderCreateL(iServiceId, KMessageNameTest);
+	}
+
+void CTestRefreshMBox::DoFolderCreateL(TMsvId aParent, const TDesC& aName)
+	{
+	test.Console()->SetPos(0, 13);
+	test.Printf(_L("DoFolderCreate\n"));
+
+	// visit service
+	User::LeaveIfError(iEntry->SetEntry(aParent));
+
+	// create the msventry
+	TMsvEmailEntry newEntry;
+	newEntry.iType=KUidMsvFolderEntry;
+	newEntry.iMtm=iEntry->Entry().iMtm;
+	newEntry.iServiceId=iServiceId;
+	newEntry.iSize=0;
+	newEntry.iDetails.Set(aName);
+	newEntry.SetMailbox(ETrue);
+	newEntry.SetValidUID(EFalse);
+	newEntry.SetComplete(ETrue);
+	newEntry.SetVisible(ETrue);
+	User::LeaveIfError(iEntry->CreateEntry(newEntry));
+
+	// tell the IMAP server about it
+	SetActive();
+	TRAPD(err, iImppServerMtm->CreateL(newEntry,iStatus));
+	if (err != KErrNone)
+		test.Printf(_L("Op FolderCreate left with error %d\n"), err);
+	
+	StartTimerL();
+	}
+
+void CTestRefreshMBox::DoFolderRemoveL()
+	{
+	DoFolderRemoveL(iServiceId, _L("Test1"));
+	}
+
+void CTestRefreshMBox::DoFolderRemoveL(TMsvId aParent, const TDesC& aName)
+	{
+	test.Console()->SetPos(0, 13);
+	test.Printf(_L("DoFolderRemove\n"));
+
+	TMsvId id = FindFolderByNameL(aParent, aName);
+	if (id == KErrNotFound)
+		{
+		test.Printf(_L("Can't find folder '%S'\n"),&aName);
+		return;
+		}
+
+	iSelection->Reset();
+	iSelection->AppendL(id);
+
+	TBuf8<128> params(_L8(""));
+	TRAPD(err, PerformOpL(EImap4OpDelete,params));
+	if (err != KErrNone)
+		test.Printf(_L("Op FolderDelete left with error %d\n"), err);
+
+	StartTimerL();
+	}
+
+TPtrC CTestRefreshMBox::TestMsgName(TImap4OpType aOpType,
+									TImap4GetMailOptions aOptions=EGetImap4EmailBodyTextAndAttachments)
+	{
+	switch (aOpType)
+		{
+	case EImap4OpCopyToLocal:
+		return _L("Test: 22");
+	case EImap4OpCopyFromLocal:
+		return _L("Test: 21");
+	case EImap4OpCopyWithinService:
+		return _L("Test: 20");
+			
+	case EImap4OpMoveToLocal:
+		return _L("Test: 19");
+	case EImap4OpMoveFromLocal:
+		return _L("Test: 18");
+	case EImap4OpMoveWithinServiceToInbox:
+	case EImap4OpMoveWithinService:
+		return _L("Test: 17");
+
+	case EImap4OpDelete:
+		return _L("Test: 16");
+
+	case EImap4OpPopulate:
+		switch (aOptions)
+			{
+		case EGetImap4EmailHeaders:
+			return _L("Test: 9");
+		case EGetImap4EmailBodyText:
+			return _L("Test: 11");
+		case EGetImap4EmailBodyTextAndAttachments:
+			return _L("Test: 12");
+		case EGetImap4EmailAttachments:
+			return _L("Test: 10");
+			}
+		return _L("Test: 9");
+
+	case EImap4OpCopyWithinFolder:
+		return _L("Test: 8");
+
+	case EImap4OpCopyToLocalAndDelete:
+		return _L("Test: 7");
+	case EImap4OpCopyFromLocalAndDelete:
+		return _L("Test: 6");
+	case EImap4OpCopyWithinServiceAndDelete:
+		return _L("Test: 5");
+			
+	case EImap4OpMoveToLocalAndDelete:
+		return _L("Test: 4");
+	case EImap4OpMoveFromLocalAndDelete:
+		return _L("Test: 3");
+	case EImap4OpMoveWithinServiceAndDelete:
+		return _L("Test: 27");
+	default:
+		break;
+		}
+	return _L("");
+	}
+
+void CTestRefreshMBox::TestFolders(TImap4OpType aOpType,
+								   TMsvId& srcFolder, TMsvId& destination)
+	{
+	if (aOpType == EImap4OpCopyToLocal ||
+		aOpType == EImap4OpMoveToLocal)
+		{
+		destination = iLocalFolder1;
+		srcFolder = iRemoteInbox;
+		}
+	else if (aOpType == EImap4OpCopyFromLocal ||
+		aOpType == EImap4OpMoveFromLocal)
+		{
+		destination = iRemoteFolder1;
+		srcFolder = KMsvGlobalInBoxIndexEntryId;
+		}
+	else if (aOpType == EImap4OpCopyWithinService ||
+		aOpType == EImap4OpMoveWithinService)
+		{
+		destination = iRemoteFolder2;
+		srcFolder = iRemoteInbox;
+		}
+	else if (aOpType == EImap4OpMoveWithinServiceToInbox)
+		{
+		destination = iRemoteInbox;
+		srcFolder = iRemoteFolder2;
+		}
+	else
+		{
+		destination = iRemoteInbox;
+		srcFolder = iRemoteInbox;
+		}
+	}
+
+
+TMsvId CTestRefreshMBox::CountMessagesByNameL(TMsvId aSrcFolder, const TDesC& aName)
+	{
+	CMsvEntrySelection* children = new (ELeave) CMsvEntrySelection;
+	CleanupStack::PushL(children);
+
+	User::LeaveIfError(iEntry->SetEntry( aSrcFolder ));
+	User::LeaveIfError(iEntry->GetChildren( *children ));
+
+	TInt r = 0;
+	for (TInt i=0; i < children->Count(); i++)
+		{
+		User::LeaveIfError(iEntry->SetEntry( (*children)[i] ));
+		if ( iEntry->Entry().iDescription.Compare(aName) == 0 )
+			r++;
+		}
+
+	CleanupStack::PopAndDestroy();
+
+	return r;
+	}
+
+// searches on Description field
+TMsvId CTestRefreshMBox::FindMessageByNameL(TMsvId aSrcFolder, const TDesC& aName)
+	{
+	return FindByNameL(aSrcFolder, aName, EFalse);
+	}
+
+// searches on Details field
+TMsvId CTestRefreshMBox::FindFolderByNameL(TMsvId aSrcFolder, const TDesC& aName)
+	{
+	CMsvEntrySelection* children = new (ELeave) CMsvEntrySelection;
+	CleanupStack::PushL(children);
+	TMsvId r = KErrNotFound;
+	User::LeaveIfError(iEntry->SetEntry( aSrcFolder ));
+	iEntry->GetChildrenWithType(KUidMsvFolderEntry, *children);
+
+	children->InsertL(0, aSrcFolder);
+	
+	for (TInt i=0; i < children->Count(); i++)
+		{
+		r = FindByNameL((*children)[i], aName, ETrue);
+		if(r != KErrNotFound)
+			break;
+		}
+
+	CleanupStack::PopAndDestroy();
+	return r;
+	}
+
+// searches on Details or Description field and recurses
+TMsvId CTestRefreshMBox::FindByNameL(TMsvId aSrcFolder, const TDesC& aName, TBool aSearchOnDetails)
+	{
+	CMsvEntrySelection* children = new (ELeave) CMsvEntrySelection;
+	CleanupStack::PushL(children);
+
+	User::LeaveIfError(iEntry->SetEntry( aSrcFolder ));
+	User::LeaveIfError(iEntry->GetChildren( *children ));
+
+	// isolate up to the first slash if any
+	TPtrC match = aName;
+	TPtrC remains = _L("");
+	TInt slash = aName.Locate('/');
+	if (slash != -1)
+		{
+		match.Set(aName.Left(slash));
+		remains.Set(aName.Mid(slash+1));
+		}
+	
+	TMsvId r = KErrNotFound;
+	for (TInt i=0; i < children->Count(); i++)
+		{
+		User::LeaveIfError(iEntry->SetEntry( (*children)[i] ));
+		if ( ( aSearchOnDetails && iEntry->Entry().iDetails.Compare(match) == 0 ) ||
+			 (!aSearchOnDetails && iEntry->Entry().iDescription.Compare(match) == 0 ) )
+			{
+			r = (*children)[i];
+			if (remains.Length())
+				r = FindByNameL(r, remains, aSearchOnDetails);
+			break;
+			}
+		}
+
+	CleanupStack::PopAndDestroy();
+
+	return r;
+	}
+
+TMsvId CTestRefreshMBox::FindMessageByOpL(TMsvId aSrcFolder, TImap4OpType aOp)
+	{
+	TPtrC name = TestMsgName(aOp);
+	return FindMessageByNameL(aSrcFolder, name);
+	}
+	
+TMsvId CTestRefreshMBox::FindMessageByOpL(TMsvId aSrcFolder, TImap4OpType aOp, TImap4GetMailOptions aOptions)
+	{
+	TPtrC name = TestMsgName(aOp, aOptions);
+	return FindMessageByNameL(aSrcFolder, name);
+	}
+	
+TInt CTestRefreshMBox::CountMessagesByOpL(TMsvId aSrcFolder, TImap4OpType aOp)
+	{
+	TPtrC name = TestMsgName(aOp);
+	return CountMessagesByNameL(aSrcFolder, name);
+	}
+	
+/* ----------------------------------------------------------------------- */
+
+CImHeader* CTestRefreshMBox::GetHeaderLC()
+	{
+	CImHeader* messageheader=CImHeader::NewLC();
+
+	CMsvStore* entryStore=iEntry->ReadStoreL();
+	CleanupStack::PushL(entryStore);
+	
+	messageheader->RestoreL(*entryStore);
+	
+	CleanupStack::PopAndDestroy(); // store
+
+	return messageheader;
+	}
+
+
+void CTestRefreshMBox::TestPriorityAndReceiptAddressL()
+	{
+	iTestUtils->TestStart(iTestNum, _L("TestPriorities"));
+
+	SetEntryL(iRemoteInbox, KMessageNamePriority);
+	test(iEntry->Entry().Priority() == EMsvHighPriority );
+	SetEntryL(iRemoteInbox, KMessageNameXPriority);
+	test(iEntry->Entry().Priority() == EMsvHighPriority );
+	SetEntryL(iRemoteInbox, KMessageNamePrecedence);
+	test(iEntry->Entry().Priority() == EMsvHighPriority );
+	SetEntryL(iRemoteInbox, KMessageNameImportance);
+	test(iEntry->Entry().Priority() == EMsvHighPriority );
+
+	iTestUtils->TestFinish(iTestNum++);
+
+	iTestUtils->TestStart(iTestNum, _L("TestReceipts"));
+
+#if 0
+	CImHeader *hdr;
+
+	SetEntryL(iRemoteInbox, KMessageNameReturnReceiptTo);
+	hdr=GetHeaderLC();
+	test( hdr->ReceiptAddress().Compare( KReceiptAddress ) == 0);
+	CleanupStack::PopAndDestroy(); // hdr
+	
+	// these tests won't work anymore as the CImMailHeader store that
+	// holds this information is not available at this point
+	SetEntryL(iRemoteInbox, KMessageNameXReturnReceiptTo);
+	hdr=GetHeaderLC();
+	test( hdr->ReceiptAddress().Compare( KReceiptAddress ) == 0);
+	CleanupStack::PopAndDestroy(); // hdr
+
+	SetEntryL(iRemoteInbox, KMessageNameDispositionNotificationTo);
+	hdr=GetHeaderLC();
+	test( hdr->ReceiptAddress().Compare( KReceiptAddress ) == 0 ||
+		  hdr->ReceiptAddress().Compare( KReceiptAddress1 ) == 0);
+	CleanupStack::PopAndDestroy(); // hdr
+
+#endif
+	iTestUtils->TestFinish(iTestNum++);
+
+	iTestUtils->TestStart(iTestNum, _L("Test MHTML flags"));
+
+	// check mime html has mime and not attachment flag
+	SetEntryL(iRemoteInbox, KMessageNameMimeHTML);
+	TMsvEmailEntry entry = (TMsvEmailEntry)iEntry->Entry();
+	test(entry.MHTMLEmail());
+	test(!entry.Attachment());
+
+	iTestUtils->TestFinish(iTestNum++);
+	
+	iTestUtils->TestStart(iTestNum, _L("Test modified UTF7"));
+
+	// check the encoded folder name worked
+	test(FindFolderByNameL(iServiceId, KFolderNameToEncode) != KErrNone);
+
+	iTestUtils->TestFinish(iTestNum++);
+	}
+
+void CTestRefreshMBox::PerformSpecialOpL(TMsvId aId, TImap4Cmds aCommand)
+	{
+#if defined (_DEBUG_MTMCOMMAND_)
+	TBuf<256> buf;
+	buf.Format(_L("MTMCommand %d on id %d\n"), aCommand, aId);
+	iTestUtils->WriteComment(buf);
+#endif
+
+	iSourceId = aId;
+
+	TBuf8<128> paramBuf(_L8(""));
+	iSelection->Reset();
+	iSelection->AppendL(aId);
+	iImppServerMtm->StartCommandL(*iSelection,aCommand,paramBuf,iStatus);
+	SetActive();
+	}
+
+/* ----------------------------------------------------------------------- */
+
+void CTestRefreshMBox::PerformOpL( TImap4OpType aOpType, const TDesC8& aParams)
+	{
+	TBuf<256> buf;
+	buf.Format(_L("Command %d on id %d (total %d) to folder %d\n"), aOpType,
+			   iSelection->Count() ? (*iSelection)[0] : 0,
+			   iSelection->Count(), iDestFolder);
+	iTestUtils->WriteComment(buf);
+
+	SetActive();
+	switch (aOpType)
+		{
+	case EImap4OpCopyToLocal:
+	case EImap4OpCopyToLocalAndDelete:
+		iImppServerMtm->CopyToLocalL(*iSelection, iDestFolder, iStatus);
+		break;
+	case EImap4OpCopyFromLocal:
+	case EImap4OpCopyFromLocalAndDelete:
+		iImppServerMtm->CopyFromLocalL(*iSelection, iDestFolder, iStatus);
+		break;
+	case EImap4OpCopyWithinFolder:
+	case EImap4OpCopyWithinService:
+	case EImap4OpCopyWithinServiceAndDelete:
+		iImppServerMtm->CopyWithinServiceL(*iSelection, iDestFolder, iStatus);
+		break;	
+		
+	case EImap4OpMoveToLocal:
+	case EImap4OpMoveToLocalAndDelete:
+		iImppServerMtm->MoveToLocalL(*iSelection, iDestFolder, iStatus);
+		break;
+	case EImap4OpMoveFromLocal:
+	case EImap4OpMoveFromLocalAndDelete:
+		iImppServerMtm->MoveFromLocalL(*iSelection, iDestFolder, iStatus);
+		break;
+	case EImap4OpMoveWithinService:
+	case EImap4OpMoveWithinServiceAndDelete:
+	case EImap4OpMoveWithinServiceToInbox:
+		iImppServerMtm->MoveWithinServiceL(*iSelection, iDestFolder, iStatus);
+		break;
+
+	case EImap4OpDelete:
+		iImppServerMtm->DeleteAllL(*iSelection, iStatus);
+		break;
+
+	case EImap4OpUndelete:
+		iImppServerMtm->StartCommandL(*iSelection,KIMAP4MTMUndeleteAll,aParams,iStatus);
+		break;
+
+	case EImap4OpPopulate:
+		iImppServerMtm->StartCommandL(*iSelection,KIMAP4MTMPopulate,aParams,iStatus);
+		break;
+
+	default:
+		break;
+		}
+	}
+
+void CTestRefreshMBox::DoOpByIdL( TImap4OpType aOpType, TMsvId aId )
+	{
+	iSourceId = aId;
+
+	TBuf8<128> paramBuf(_L8(""));
+
+	iSelection->Reset();
+	iSelection->AppendL(iSourceId);
+
+	TRAPD(err, PerformOpL(aOpType,paramBuf));
+	if (err != KErrNone)
+		test.Printf(_L("Op %d left with error %d\n"), aOpType, err);
+	}
+
+void CTestRefreshMBox::DoOpByIdL( TImap4OpType aOpType, TMsvId aId, const TDesC8& aParams )
+	{
+	iSourceId = aId;
+
+	iSelection->Reset();
+	iSelection->AppendL(iSourceId);
+
+	TRAPD(err, PerformOpL(aOpType,aParams));
+	if (err != KErrNone)
+		test.Printf(_L("Op %d left with error %d\n"), aOpType, err);
+	}
+
+void CTestRefreshMBox::DoOpL( TImap4OpType aOpType, const TDesC& aName, TMsvId aSourceFolder, TMsvId aDestFolder, const TDesC8& aParams)
+	{
+	iSourceFolder = aSourceFolder;
+	iDestFolder = aDestFolder;
+	iSourceId = FindMessageByNameL(iSourceFolder, aName);
+	if (iSourceId == KErrNotFound)
+		{
+		test.Printf(_L("Can't find message '%S'\n"), &aName);
+		return;
+		}
+	
+	iSelection->Reset();
+	iSelection->AppendL(iSourceId);
+
+	TRAPD(err, PerformOpL(aOpType,aParams));
+	if (err != KErrNone)
+		test.Printf(_L("Op %d left with error %d\n"), aOpType, err);
+	}
+
+void CTestRefreshMBox::DoOpL( TImap4OpType aOpType, TMsvId aSourceFolder, TMsvId aDestFolder, const TDesC8& aParams)
+	{
+	DoOpL(aOpType, KMessageNameTest, aSourceFolder, aDestFolder, aParams);
+	}
+
+void CTestRefreshMBox::DoOpL( TImap4OpType aOpType, TMsvId aSourceFolder, TMsvId aDestFolder)
+	{
+	TBuf8<128> paramBuf(_L8(""));
+	DoOpL( aOpType, aSourceFolder, aDestFolder, paramBuf );
+	}
+
+void CTestRefreshMBox::DoOpL( TImap4OpType aOpType, TMsvId aSourceFolder, TMsvId aDestFolder, TImap4GetMailOptions aOptions)
+	{
+	TPckgBuf<TImap4GetMailOptions> package(aOptions);	
+	DoOpL(aOpType, KMessageNameTest, aSourceFolder, aDestFolder, package);
+	}
+
+void CTestRefreshMBox::DoOpNamedL( TImap4OpType aOpType, TMsvId aSrcFolder, TMsvId aDestFolder, const TDesC8& aParams)
+	{
+	TPtrC msgName = TestMsgName(aOpType);
+	DoOpL(aOpType, msgName, aSrcFolder, aDestFolder, aParams);
+	}
+
+void CTestRefreshMBox::DoOpNamedL( TImap4OpType aOpType, TMsvId aSrcFolder, TMsvId aDestFolder)
+	{
+	TBuf8<128> paramBuf(_L8(""));
+	DoOpNamedL( aOpType, aSrcFolder, aDestFolder, paramBuf );
+	}
+
+void CTestRefreshMBox::DoOpNamedL( TImap4OpType aOpType, TMsvId aSrcFolder, TMsvId aDestFolder, TImap4GetMailOptions aOptions)
+	{
+	TPckgBuf<TImap4GetMailOptions> package(aOptions);	
+	TPtrC msgName = TestMsgName(aOpType, aOptions);
+	DoOpL( aOpType, msgName, aSrcFolder, aDestFolder, package );
+	}
+
+TBool CTestRefreshMBox::TestQueueL( TMsvId aFolder, CImOffLineOperation::TOffLineOpType aOpType,
+									TMsvId aMessage, TMsvId aTarget,
+									TInt aFnId,	const TDesC8& aParams )
+	{
+	if (iEntry->SetEntry( aFolder ) != KErrNone)
+		{
+		test.Printf(_L("Can't select folder %d\n"), aFolder);
+		return EFalse;
+		}
+
+	if (!iEntry->HasStoreL())
+		return EFalse;
+	
+	CImOffLineOperationArray* ops=CImOffLineOperationArray::NewL();
+	CleanupStack::PushL(ops);
+
+	CMsvStore* fileStore = iEntry->ReadStoreL();
+	CleanupStack::PushL(fileStore);
+	
+	CImOffLineArrayStore arraystore(*ops);
+	arraystore.RestoreL(*fileStore);
+
+	TBool found = EFalse;
+	for (TInt opNum=0; opNum < ops->CountOperations() && !found; opNum++)
+		{
+		const CImOffLineOperation& op = ops->Operation(opNum);
+
+		if (op.OpType() == aOpType &&
+			op.MessageId() == aMessage &&
+			op.TargetMessageId() == aTarget)
+			{
+			if ( aOpType != CImOffLineOperation::EOffLineOpMtmSpecific )
+				found = ETrue;
+			else if ( op.MtmFunctionId() == aFnId && 
+					  op.MtmParameters() == aParams )
+				found = ETrue;
+			}
+		}
+		
+	CleanupStack::PopAndDestroy(2); // filestore, ops
+
+	return found;
+	}
+
+TBool CTestRefreshMBox::TestQueueL( TMsvId aFolder, CImOffLineOperation::TOffLineOpType aOpType,
+									TMsvId aMessage, TMsvId aTarget, TImap4GetMailOptions aOptions )
+	{
+	TPckgBuf<TImap4GetMailOptions> package(aOptions);	
+	return TestQueueL( aFolder, aOpType, aMessage, aTarget, 1, package );
+	}
+
+TBool CTestRefreshMBox::TestQueueL( TMsvId aFolder, CImOffLineOperation::TOffLineOpType aOpType,
+									TMsvId aMessage, TMsvId aTarget )
+	{
+	TBuf8<128> params(_L8(""));
+	return TestQueueL( aFolder, aOpType, aMessage, aTarget, 0, params );
+	}
+
+TBool CTestRefreshMBox::TestQueueEmptyL( TMsvId aFolder )
+	{
+	if (iEntry->SetEntry( aFolder ) != KErrNone)
+		{
+		test.Printf(_L("Can't select folder %d\n"), aFolder);
+		return EFalse;
+		}
+
+	if (!iEntry->HasStoreL())
+		return ETrue;
+	
+	CImOffLineOperationArray* ops=CImOffLineOperationArray::NewL();
+	CleanupStack::PushL(ops);
+
+	CMsvStore* fileStore = iEntry->ReadStoreL();
+	CleanupStack::PushL(fileStore);
+	
+	CImOffLineArrayStore arraystore(*ops);
+	arraystore.RestoreL(*fileStore);
+	
+	TInt count = ops->CountOperations();
+		
+	CleanupStack::PopAndDestroy(2); // filestore, ops
+
+	return count == 0;
+	}
+
+TMsvId CTestRefreshMBox::FindShadowL( TMsvId aFolder, TMsvId aSourceId )
+	{
+	if (iEntry->SetEntry( aFolder ) != KErrNone)
+		{
+		test.Printf(_L("Can't select folder %d\n"), aFolder);
+		return KMsvNullIndexEntryId;
+		}
+
+	CMsvEntrySelection *contents=new CMsvEntrySelection;
+	CleanupStack::PushL(contents);
+
+	User::LeaveIfError(iEntry->GetChildren(*contents));
+
+	TMsvId id = KMsvNullIndexEntryId;
+	for(TInt a=0;a<contents->Count();a++)
+		{
+		User::LeaveIfError(iEntry->SetEntry((*contents)[a]));
+		if (iEntry->Entry().iRelatedId == aSourceId)
+			{
+			id = (*contents)[a];
+			break;
+			}
+		}
+	
+	CleanupStack::PopAndDestroy(); // contents
+
+	return id;
+	}
+
+TBool CTestRefreshMBox::TestShadowL( TMsvId aFolder, TMsvId aSourceId )
+	{
+	return FindShadowL(aFolder,aSourceId) != KMsvNullIndexEntryId;
+	}
+
+TBool CTestRefreshMBox::TestComplete( TMsvId aSourceId )
+	{
+	if (iEntry->SetEntry( aSourceId ) != KErrNone)
+		{
+		test.Printf(_L("Can't select id %d\n"), aSourceId);
+		return EFalse;
+		}
+	return iEntry->Entry().Complete();
+	}
+
+TBool CTestRefreshMBox::TestVisible( TMsvId aSourceId )
+	{
+	if (iEntry->SetEntry( aSourceId ) != KErrNone)
+		{
+		test.Printf(_L("Can't select id %d\n"), aSourceId);
+		return EFalse;
+		}
+	return iEntry->Entry().Visible();
+	}
+
+TBool CTestRefreshMBox::TestInvisible( TMsvId aSourceId )
+	{
+	if (iEntry->SetEntry( aSourceId ) != KErrNone)
+		{
+		test.Printf(_L("Can't select id %d\n"), aSourceId);
+		return EFalse;
+		}
+	return !iEntry->Entry().Visible();
+	}
+
+TBool CTestRefreshMBox::TestSubscribed( TMsvId aSourceId )
+	{
+	if (iEntry->SetEntry( aSourceId ) != KErrNone)
+		{
+		test.Printf(_L("Can't select id %d\n"), aSourceId);
+		return EFalse;
+		}
+	return ((TMsvEmailEntry)iEntry->Entry()).Subscribed();
+	}
+
+TBool CTestRefreshMBox::TestNotSubscribed( TMsvId aSourceId )
+	{
+	if (iEntry->SetEntry( aSourceId ) != KErrNone)
+		{
+		test.Printf(_L("Can't select id %d\n"), aSourceId);
+		return EFalse;
+		}
+	return !((TMsvEmailEntry)iEntry->Entry()).Subscribed();
+	}
+
+TBool CTestRefreshMBox::TestLocalSubscription( TMsvId aSourceId )
+	{
+	if (iEntry->SetEntry( aSourceId ) != KErrNone)
+		{
+		test.Printf(_L("Can't select id %d\n"), aSourceId);
+		return EFalse;
+		}
+	return ((TMsvEmailEntry)iEntry->Entry()).LocalSubscription();
+	}
+
+TBool CTestRefreshMBox::TestNotLocalSubscription( TMsvId aSourceId )
+	{
+	if (iEntry->SetEntry( aSourceId ) != KErrNone)
+		{
+		test.Printf(_L("Can't select id %d\n"), aSourceId);
+		return EFalse;
+		}
+	return !((TMsvEmailEntry)iEntry->Entry()).LocalSubscription();
+	}
+
+TBool CTestRefreshMBox::TestExists( TMsvId aSourceId )
+	{
+	return iEntry->SetEntry( aSourceId ) == KErrNone;
+	}
+
+TImDisconnectedOperationType CTestRefreshMBox::TestDisconnectedFlags( TMsvId aSourceId )
+	{
+	if (iEntry->SetEntry( aSourceId ) != KErrNone )
+		return EDisconnectedUnknownOperation;
+	return ((TMsvEmailEntry)iEntry->Entry()).DisconnectedOperation();
+	}
+
+void CTestRefreshMBox::DoCancelOffLineOpsL()
+	{
+	test.Console()->SetPos(0, 13);
+	test.Printf(_L("DoCancelOffLineOps %x %x %x\n"), iRemoteInbox, iRemoteFolder1, iRemoteFolder2);
+
+	iSelection->Reset();
+	iSelection->AppendL(iRemoteInbox);
+	iSelection->AppendL(iRemoteFolder1);
+	iSelection->AppendL(iRemoteFolder2);
+
+	TBuf8<128> paramBuf(_L8(""));
+	SetActive();
+	iImppServerMtm->StartCommandL(*iSelection,KIMAP4MTMCancelOffLineOperations,paramBuf,iStatus);
+	}
+
+void CTestRefreshMBox::NextState(TInt aInc)
+	{
+	iOpState /= aInc;
+	iOpState += 1;
+	iOpState *= aInc;
+	}
+
+void CTestRefreshMBox::NextState()
+	{
+	NextState(1);
+	}
+
+TBool CTestRefreshMBox::HandleOffLineStateL()
+	{
+	TBool more = ETrue;
+	switch (iOpState)
+		{
+		// clear offline ops to start with
+	case 0:
+		DoCancelOffLineOpsL();
+		NextState(10);
+		break;
+
+		// COPYTOLOCAL tests   --------------------------------------------------
+		// move from local and copy back, which converts to a copyfromlocal
+	case 10:
+		iTestUtils->TestStart(iTestNum, _L("MoveFromLocal + CopyTolocal == CopyFromLocal"));
+
+		DoOpL( EImap4OpMoveFromLocal, KMsvGlobalInBoxIndexEntryId, iRemoteFolder1 );
+		iOrigSourceId = iSourceId;
+		NextState();
+		break;
+
+	case 11:
+		test(TestQueueL( iRemoteFolder1, CImOffLineOperation::EOffLineOpMoveFromLocal, iOrigSourceId, iRemoteFolder1 ));
+		test(TestShadowL( iRemoteFolder1, iOrigSourceId ));
+		test(TestInvisible( iOrigSourceId ));
+		test(TestDisconnectedFlags( iOrigSourceId ) == EDisconnectedMoveFromOperation );
+
+		DoOpL( EImap4OpCopyToLocal, iRemoteFolder1, KMsvGlobalInBoxIndexEntryId );
+		NextState();
+		break;
+
+	case 12:
+		test(TestQueueL( iRemoteFolder1, CImOffLineOperation::EOffLineOpCopyFromLocal, iOrigSourceId, iRemoteFolder1 ));
+		test(TestShadowL( iRemoteFolder1, iOrigSourceId ));
+		test(TestVisible( iOrigSourceId ));
+		// failed
+		//test(TestDisconnectedFlags( iOrigSourceId ) == EDisconnectedCopyFromOperation );
+		
+		iTestUtils->TestFinish(iTestNum++);
+
+		DoCancelOffLineOpsL();
+		NextState(10);
+		break;
+
+		// copy from local and copy back to new folder, doing immediate copy
+	case 20:
+		iTestUtils->TestStart(iTestNum, _L("CopyFromLocal + CopyToLocal == Immediate Copy"));
+
+		DoOpL( EImap4OpCopyFromLocal, KMsvGlobalInBoxIndexEntryId, iRemoteFolder1 );
+		iOrigSourceId = iSourceId;
+		NextState();
+		break;
+
+	case 21:
+		test(TestQueueL( iRemoteFolder1, CImOffLineOperation::EOffLineOpCopyFromLocal, iOrigSourceId, iRemoteFolder1 ));
+		test(TestShadowL( iRemoteFolder1, iOrigSourceId ));
+		test(TestVisible( iOrigSourceId ));
+		test(TestDisconnectedFlags( iOrigSourceId ) == EDisconnectedCopyFromOperation );
+
+		DoOpL( EImap4OpCopyToLocal, iRemoteFolder1, iLocalFolder1 );
+		NextState();
+		break;
+		
+	case 22:
+		{
+		// check message has been copied and then delete it, do this
+		// first in case other test fail
+		TMsvId newId = FindMessageByNameL( iLocalFolder1, KMessageNameTest );
+		test(newId != KErrNotFound);
+
+		iEntry->SetEntry( newId );
+		iEntry->SetEntry( iEntry->Entry().Parent() );
+		iEntry->DeleteEntry( newId );
+			
+		test(TestQueueL( iRemoteFolder1, CImOffLineOperation::EOffLineOpCopyFromLocal, iOrigSourceId, iRemoteFolder1 ));
+		test(TestShadowL( iRemoteFolder1, iOrigSourceId ));
+		test(TestVisible( iOrigSourceId ));
+		// failed
+		// test(TestDisconnectedFlags( iOrigSourceId ) == EDisconnectedCopyFromOperation );
+
+		iTestUtils->TestFinish(iTestNum++);
+
+		DoCancelOffLineOpsL();
+		NextState(100);
+		break;
+		}
+		
+		// copy back from local to service
+		// COPYFROMLOCAL tests --------------------------------------------------
+		
+		// copy to local and copy back to new folder
+		
+	case 100:
+		// copy fresh to local
+		iTestUtils->TestStart(iTestNum, _L("CopyToLocal + CopyFromLocal == CopyToLocal + CopyWithinService"));
+
+		DoOpL( EImap4OpCopyToLocal, iRemoteInbox, iLocalFolder1 );
+		iOrigSourceId = iSourceId;
+		NextState();
+		break;
+
+	case 101:
+		test(TestQueueL( iRemoteInbox, CImOffLineOperation::EOffLineOpCopyToLocal, iSourceId, iLocalFolder1 ));
+		test(TestShadowL( iLocalFolder1, iSourceId ));
+		test(TestDisconnectedFlags( iSourceId ) == EDisconnectedCopyToOperation );
+
+		// copy back from local to service
+		DoOpL( EImap4OpCopyFromLocal, iLocalFolder1, iRemoteFolder1 );
+		NextState();
+		break;
+
+	case 102:
+		test(TestQueueL( iRemoteInbox, CImOffLineOperation::EOffLineOpCopyToLocal, iOrigSourceId, iLocalFolder1 ));
+		test(TestQueueL( iRemoteInbox, CImOffLineOperation::EOffLineOpCopyWithinService, iOrigSourceId, iRemoteFolder1 ));
+		test(TestShadowL( iLocalFolder1, iOrigSourceId ));
+		test(TestShadowL( iRemoteFolder1, iOrigSourceId ));
+		test(TestDisconnectedFlags( iOrigSourceId ) == EDisconnectedMultipleOperation );
+
+		iTestUtils->TestFinish(iTestNum++);
+
+		DoCancelOffLineOpsL();
+		NextState(100);
+		break;
+
+		// COPYWITHINSERVICE tests ----------------------------------------------
+
+		// copy within service and copy on to new folder
+	case 200:
+		// copy fresh within service
+		iTestUtils->TestStart(iTestNum, _L("CopyWithinService + CopyWithinService"));
+
+		DoOpL( EImap4OpCopyWithinService, iRemoteInbox, iRemoteFolder1 );
+		iOrigSourceId = iSourceId;
+		NextState();
+		break;
+
+	case 201:
+		test(TestQueueL( iRemoteInbox, CImOffLineOperation::EOffLineOpCopyWithinService, iSourceId, iRemoteFolder1 ));
+		test(TestShadowL( iRemoteFolder1, iSourceId ));
+		test(TestDisconnectedFlags( iSourceId ) == EDisconnectedCopyWithinServiceOperation );
+		
+		// copy on to new location
+		DoOpL( EImap4OpCopyWithinService, iRemoteFolder1, iRemoteFolder2 );
+		NextState();
+		break;
+
+	case 202:
+		test(TestQueueL( iRemoteInbox, CImOffLineOperation::EOffLineOpCopyWithinService, iOrigSourceId, iRemoteFolder1 ));
+		test(TestQueueL( iRemoteInbox, CImOffLineOperation::EOffLineOpCopyWithinService, iOrigSourceId, iRemoteFolder2 ));
+		test(TestShadowL( iRemoteFolder1, iOrigSourceId ));
+		test(TestShadowL( iRemoteFolder2, iOrigSourceId ));
+		test(TestDisconnectedFlags( iOrigSourceId ) == EDisconnectedMultipleOperation );
+
+		iTestUtils->TestFinish(iTestNum++);
+
+		DoCancelOffLineOpsL();
+		NextState();
+		break;
+
+	case 203:
+		// move item to folder1
+		iTestUtils->TestStart(iTestNum, _L("MoveWithinService + CopyWithinService"));
+
+		DoOpL( EImap4OpMoveWithinService, iRemoteInbox, iRemoteFolder1 );
+		iOrigSourceId = iSourceId;
+		NextState();
+		break;
+
+	case 204:
+		// copy this ghost entry to folder2
+		DoOpL( EImap4OpCopyWithinService, iRemoteFolder1, iRemoteFolder2 );
+		NextState();
+		break;
+
+	case 205:
+		// check that the new ghost is visible and otherwise correct
+		test(TestQueueL( iRemoteInbox, CImOffLineOperation::EOffLineOpMoveWithinService, iOrigSourceId, iRemoteFolder1 ));
+		test(TestQueueL( iRemoteInbox, CImOffLineOperation::EOffLineOpCopyWithinService, iOrigSourceId, iRemoteFolder2 ));
+		test(TestShadowL( iRemoteFolder1, iOrigSourceId ));
+		test(TestShadowL( iRemoteFolder2, iOrigSourceId ));
+		test(TestDisconnectedFlags( iOrigSourceId ) == EDisconnectedMultipleOperation );
+		test(TestInvisible( iOrigSourceId ));
+		test(TestVisible( iSourceId ));
+		test(TestVisible( FindMessageByNameL( iRemoteFolder2, KMessageNameTest ) ));
+		
+		iTestUtils->TestFinish(iTestNum++);
+
+		DoCancelOffLineOpsL();
+		NextState(100);
+		break;
+
+		// MOVETOLOCAL tests   --------------------------------------------------
+
+		// move from local and move back to undo
+	case 300:
+		iTestUtils->TestStart(iTestNum, _L("MoveFromLocal + MoveToLocal (same folder) == nothing"));
+
+		DoOpL( EImap4OpMoveFromLocal, KMsvGlobalInBoxIndexEntryId, iRemoteFolder1 );
+		iOrigSourceId = iSourceId;
+		NextState();
+		break;
+		
+	case 301:
+		test(TestQueueL( iRemoteFolder1, CImOffLineOperation::EOffLineOpMoveFromLocal, iOrigSourceId, iRemoteFolder1 ));
+		test(TestInvisible( iOrigSourceId ));
+		test(TestShadowL( iRemoteFolder1, iOrigSourceId ));
+
+		// move back to local
+		DoOpL( EImap4OpMoveToLocal, iRemoteFolder1, KMsvGlobalInBoxIndexEntryId );
+		NextState();
+		break;
+		
+	case 302:
+		// check net result is nothing
+		test(TestQueueEmptyL( iRemoteFolder1 ));
+		test(TestDisconnectedFlags( iOrigSourceId ) == ENoDisconnectedOperations );
+		test(!TestExists( iSourceId ));
+		test(TestVisible( iOrigSourceId ));
+
+		iTestUtils->TestFinish(iTestNum++);
+
+		DoCancelOffLineOpsL();
+		NextState(10);
+		break;
+
+		// copy from local and move back to new folder, results in
+		// direct local copy
+	case 310:
+		iTestUtils->TestStart(iTestNum, _L("CopyFromLocal + MoveToLocal == immediate copy"));
+
+		DoOpL( EImap4OpCopyFromLocal, KMsvGlobalInBoxIndexEntryId, iRemoteFolder1 );
+		iOrigSourceId = iSourceId;
+		NextState();
+		break;
+
+	case 311:
+		test(TestQueueL( iRemoteFolder1, CImOffLineOperation::EOffLineOpCopyFromLocal, iOrigSourceId, iRemoteFolder1 ));
+		test(TestShadowL( iRemoteFolder1, iOrigSourceId ));
+		test(TestVisible( iOrigSourceId ));
+		test(TestDisconnectedFlags( iOrigSourceId ) == EDisconnectedCopyFromOperation );
+
+		DoOpL( EImap4OpMoveToLocal, iRemoteFolder1, iLocalFolder1 );
+		NextState();
+		break;
+		
+	case 312:
+		{
+		// check message has been copied and then delete it, do this
+		// first in case other tests fail
+		TMsvId newId = FindMessageByNameL( iLocalFolder1, KMessageNameTest );
+		test(newId != KErrNotFound);
+
+		iEntry->SetEntry( newId );
+		iEntry->SetEntry( iEntry->Entry().Parent() );
+		iEntry->DeleteEntry( newId );
+		
+		test(TestQueueEmptyL( iRemoteFolder1 ));
+		test(!TestExists( iSourceId ));
+		test(TestVisible( iOrigSourceId ));
+		test(TestDisconnectedFlags( iOrigSourceId ) == ENoDisconnectedOperations );
+		
+		iTestUtils->TestFinish(iTestNum++);
+
+		DoCancelOffLineOpsL();
+		NextState(10);
+		break;
+		}
+		
+		// move from local and move back to new folder
+	case 320:
+		iTestUtils->TestStart(iTestNum, _L("MoveFromLocal + MoveToLocal == immediate move"));
+
+		DoOpL( EImap4OpMoveFromLocal, KMsvGlobalInBoxIndexEntryId, iRemoteFolder1 );
+		iOrigSourceId = iSourceId;
+		NextState();
+		break;
+		
+	case 321:
+		test(TestQueueL( iRemoteFolder1, CImOffLineOperation::EOffLineOpMoveFromLocal, iOrigSourceId, iRemoteFolder1 ));
+		test(TestInvisible( iOrigSourceId ));
+		test(TestShadowL( iRemoteFolder1, iOrigSourceId ));
+
+		// move back to local
+		DoOpL( EImap4OpMoveToLocal, iRemoteFolder1, iLocalFolder1 );
+		NextState();
+		break;
+		
+	case 322:
+		{
+		// check message has been moved and then move it back, do this
+		// first in case other tests fail
+		TMsvId newId = FindMessageByNameL( iLocalFolder1, KMessageNameTest );
+		test(newId == iOrigSourceId);
+
+		iEntry->SetEntry( newId );
+		iEntry->SetEntry( iEntry->Entry().Parent() );
+		iEntry->MoveEntryWithinService( newId, KMsvGlobalInBoxIndexEntryId );
+		
+		test(TestQueueEmptyL( iRemoteFolder1 ));
+		test(!TestExists( iSourceId ));
+		test(TestExists( iOrigSourceId ));
+		test(TestDisconnectedFlags( iOrigSourceId ) == ENoDisconnectedOperations );
+
+		iTestUtils->TestFinish(iTestNum++);
+
+		DoCancelOffLineOpsL();
+		NextState(100);
+		break;
+		}		
+		// MOVEFROMLOCAL tests --------------------------------------------------
+
+		// move to local and move back to undo
+	case 400:
+		// move fresh to local
+		iTestUtils->TestStart(iTestNum, _L("MoveToLocal + MoveFromLocal (same folder) == nothing"));
+
+		DoOpL( EImap4OpMoveToLocal, iRemoteInbox, iLocalFolder1 );
+		iOrigSourceId = iSourceId;
+		NextState();
+		break;
+
+	case 401:
+		test(TestQueueL( iRemoteInbox, CImOffLineOperation::EOffLineOpMoveToLocal, iSourceId, iLocalFolder1 ));
+		test(TestShadowL( iLocalFolder1, iSourceId ));
+		test(TestInvisible( iSourceId ));
+		test(TestDisconnectedFlags( iSourceId ) == EDisconnectedMoveToOperation );
+		
+		// move back to original location
+		DoOpL( EImap4OpMoveFromLocal, iLocalFolder1, iRemoteInbox );
+		NextState();
+		break;
+
+	case 402:
+		test(TestQueueEmptyL( iRemoteInbox ));
+		test(!TestShadowL( iLocalFolder1, iOrigSourceId ));
+		test(TestVisible( iOrigSourceId ));
+		test(TestDisconnectedFlags( iOrigSourceId ) == ENoDisconnectedOperations );
+
+		iTestUtils->TestFinish(iTestNum++);
+
+		DoCancelOffLineOpsL();
+		NextState(10);
+		break;
+
+		// move to local and move back to new folder
+	case 410:
+		// move fresh to local
+		iTestUtils->TestStart(iTestNum, _L("MoveToLocal + MoveFromLocal == MoveWithinService"));
+
+		DoOpL( EImap4OpMoveToLocal, iRemoteInbox, iLocalFolder1 );
+		iOrigSourceId = iSourceId;
+		NextState();
+		break;
+
+	case 411:
+		test(TestQueueL( iRemoteInbox, CImOffLineOperation::EOffLineOpMoveToLocal, iSourceId, iLocalFolder1 ));
+		test(TestShadowL( iLocalFolder1, iSourceId ));
+		test(TestInvisible( iSourceId ));
+		test(TestDisconnectedFlags( iSourceId ) == EDisconnectedMoveToOperation );
+		
+		// move back to new folder
+		DoOpL( EImap4OpMoveFromLocal, iLocalFolder1, iRemoteFolder1 );
+		NextState();
+		break;
+
+	case 412:
+		test(TestQueueL( iRemoteInbox, CImOffLineOperation::EOffLineOpMoveWithinService, iOrigSourceId, iRemoteFolder1 ));
+		test(!TestShadowL( iLocalFolder1, iOrigSourceId ));
+		test(TestShadowL( iRemoteFolder1, iOrigSourceId ));
+		test(TestInvisible( iOrigSourceId ));
+		test(TestDisconnectedFlags( iOrigSourceId ) == EDisconnectedMoveWithinServiceOperation );
+
+		iTestUtils->TestFinish(iTestNum++);
+
+		DoCancelOffLineOpsL();
+		NextState(10);
+		break;
+
+		// copy to local, delete original, and move back to undo
+	case 420:
+		// copy to local
+		iTestUtils->TestStart(iTestNum, _L("CopyToLocal + Delete + MoveFromLocal == nothing"));
+
+		DoOpL( EImap4OpCopyToLocal, iRemoteInbox, iLocalFolder1 );
+		iOrigSourceId = iSourceId;
+		NextState();
+		break;
+
+	case 421:
+		// delete original
+		DoOpL( EImap4OpDelete, iRemoteInbox, KMsvNullIndexEntryId );
+		NextState();
+		break;
+		
+	case 422:
+		// move original back
+		DoOpL( EImap4OpMoveFromLocal, iLocalFolder1, iRemoteInbox );
+		NextState();
+		break;
+
+	case 423:
+		// check net result is nothing
+		test(TestQueueEmptyL( iRemoteInbox ));
+		test(TestDisconnectedFlags( iOrigSourceId ) == ENoDisconnectedOperations );
+		test(!TestExists( iSourceId ));
+		test(TestVisible( iOrigSourceId ));
+
+		iTestUtils->TestFinish(iTestNum++);
+
+		DoCancelOffLineOpsL();
+		NextState(100);
+		break;
+
+
+		// MOVEWITHINSERVICE tests ----------------------------------------------
+
+		// move within sercice and move back to undo
+	case 500:
+		// move fresh within service
+		iTestUtils->TestStart(iTestNum, _L("MoveWithinService + MoveWithinService (same folder) == nothing"));
+
+		DoOpL( EImap4OpMoveWithinService, iRemoteInbox, iRemoteFolder1 );
+		iOrigSourceId = iSourceId;
+		NextState();
+		break;
+
+	case 501:
+		test(TestQueueL( iRemoteInbox, CImOffLineOperation::EOffLineOpMoveWithinService, iSourceId, iRemoteFolder1 ));
+		test(TestShadowL( iRemoteFolder1, iSourceId ));
+		test(TestInvisible( iSourceId ));
+		test(TestDisconnectedFlags( iSourceId ) == EDisconnectedMoveWithinServiceOperation );
+		
+		// move back to original location -- undo
+		DoOpL( EImap4OpMoveWithinService, iRemoteFolder1, iRemoteInbox );
+		NextState();
+		break;
+
+	case 502:
+		test(TestQueueEmptyL( iRemoteInbox ));
+		test(!TestShadowL( iRemoteFolder1, iOrigSourceId ));
+		test(TestVisible( iOrigSourceId ));
+		test(TestDisconnectedFlags( iOrigSourceId ) == ENoDisconnectedOperations );
+
+		iTestUtils->TestFinish(iTestNum++);
+
+		DoCancelOffLineOpsL();
+		NextState(10);
+		break;
+
+		// move within service and move on to new folder
+	case 510:
+		// move fresh within service
+		iTestUtils->TestStart(iTestNum, _L("MoveWithinService + MoveWithinService == MoveWithinService"));
+
+		DoOpL( EImap4OpMoveWithinService, iRemoteInbox, iRemoteFolder1 );
+		iOrigSourceId = iSourceId;
+		NextState();
+		break;
+
+	case 511:
+		test(TestQueueL( iRemoteInbox, CImOffLineOperation::EOffLineOpMoveWithinService, iSourceId, iRemoteFolder1 ));
+		test(TestShadowL( iRemoteFolder1, iSourceId ));
+		test(TestInvisible( iSourceId ));
+		test(TestDisconnectedFlags( iSourceId ) == EDisconnectedMoveWithinServiceOperation );
+		
+		// move back to new folder
+		DoOpL( EImap4OpMoveWithinService, iRemoteFolder1, iRemoteFolder2 );
+		NextState();
+		break;
+
+	case 512:
+		test(TestQueueL( iRemoteInbox, CImOffLineOperation::EOffLineOpMoveWithinService, iOrigSourceId, iRemoteFolder2 ));
+		test(!TestShadowL( iRemoteFolder1, iOrigSourceId ));
+		test(TestShadowL( iRemoteFolder2, iOrigSourceId ));
+		test(TestInvisible( iOrigSourceId ));
+		test(TestDisconnectedFlags( iOrigSourceId ) == EDisconnectedMoveWithinServiceOperation );
+
+		iTestUtils->TestFinish(iTestNum++);
+
+		DoCancelOffLineOpsL();
+		NextState(100);
+		break;
+		
+		// DELETE/UNDELETE tests ----------------------------------------------
+
+		// DELETE tests
+	case 600:
+		iTestUtils->TestStart(iTestNum, _L("Delete + Undelete = nothing"));
+
+		DoOpL( EImap4OpDelete, iRemoteInbox, KMsvNullIndexEntryId );
+		iOrigSourceId = iSourceId;
+		NextState();
+		break;
+
+	case 601:
+		test(TestQueueL( iRemoteInbox, CImOffLineOperation::EOffLineOpDelete, iSourceId, KMsvNullIndexEntryId ));
+		test(TestDisconnectedFlags( iSourceId ) == EDisconnectedDeleteOperation );
+
+		// undelete it
+		DoOpL( EImap4OpUndelete, iRemoteInbox, KMsvNullIndexEntryId );
+		NextState();
+		break;
+
+	case 602:
+		test(TestQueueEmptyL( iRemoteInbox ));
+		test(TestDisconnectedFlags( iOrigSourceId ) == ENoDisconnectedOperations );
+
+		iTestUtils->TestFinish(iTestNum++);
+
+		DoCancelOffLineOpsL();
+		NextState(100);
+		break;
+
+		// ----------------------------------------------------------------------
+		// other things we can do offline
+	case 700:
+		// check flags on messages in the mirror
+		TestPriorityAndReceiptAddressL();		
+
+		iTestUtils->TestStart(iTestNum, _L("Offline op errors"));
+
+		// check the return codes from the some of the special functions
+		PerformSpecialOpL(0, KIMAP4MTMIsConnected);
+		NextState();
+		break;
+
+	case 701:
+		test(iStatus.Int() == KErrDisconnected);
+
+		PerformSpecialOpL(0, KIMAP4MTMSynchronise);
+		NextState();
+		break;
+		
+	case 702:
+		test(iStatus.Int() == KErrDisconnected);
+		PerformSpecialOpL(0, KIMAP4MTMFullSync);
+		NextState();
+		break;
+		
+	case 703:
+		test(iStatus.Int() == KErrDisconnected);
+		PerformSpecialOpL(0, KIMAP4MTMInboxNewSync);
+		NextState();
+		break;
+		
+	case 704:
+		test(iStatus.Int() == KErrDisconnected);
+		PerformSpecialOpL(0, KIMAP4MTMFolderFullSync);
+		NextState();
+		break;
+		
+	case 705:
+		test(iStatus.Int() == KErrDisconnected);
+		PerformSpecialOpL(0, KIMAP4MTMRenameFolder);
+		NextState();
+		break;
+		
+	case 706:
+		test(iStatus.Int() == KErrDisconnected);
+		PerformSpecialOpL(0, KIMAP4MTMDisconnect);
+		NextState();
+		break;
+		
+	case 707:
+		test(iStatus.Int() == KErrDisconnected);
+		PerformSpecialOpL(0, KIMAP4MTMSyncTree);
+		NextState();
+		break;
+		
+	case 708:
+		test(iStatus.Int() == KErrDisconnected);
+		PerformSpecialOpL(0, KIMAP4MTMBusy);
+		NextState();
+		break;
+		
+	case 709:
+ 		test(iStatus.Int() == KErrNone);
+		PerformSpecialOpL(0, KIMAP4MTMSelect);
+		NextState();
+		break;
+		
+	case 710:
+		test(iStatus.Int() == KErrDisconnected);
+		PerformSpecialOpL(0, KIMAP4MTMCancelBackgroundSynchronise);
+		NextState(100);
+		break;
+#if 0
+		// test local subscription code
+	case 711:
+		test(iStatus.Int() == KErrNone);
+		PerformSpecialOpL(FindFolderByNameL(iServiceId, _L("TestHier1")), KIMAP4MTMLocalSubscribe);
+		NextState();
+		break;
+		
+	case 712:
+		test(iStatus.Int() == KErrNone);
+		test(TestLocalSubscription(iSourceId));
+		PerformSpecialOpL(FindFolderByNameL(iServiceId, _L("TestHier1/TestHier2")), KIMAP4MTMLocalSubscribe);
+		NextState();
+		break;
+		
+	case 713:
+		test(iStatus.Int() == KErrNone);
+		test(TestLocalSubscription(iSourceId));
+		PerformSpecialOpL(FindFolderByNameL(iServiceId, _L("TestHier1/TestHier2/TestHier3")), KIMAP4MTMLocalSubscribe);
+		NextState();
+		break;
+		
+	case 714:
+		test(iStatus.Int() == KErrNone);
+		test(TestLocalSubscription(iSourceId));
+		PerformSpecialOpL(FindFolderByNameL(iServiceId, _L("TestHier1")), KIMAP4MTMLocalUnsubscribe);
+		NextState();
+		break;
+		
+	case 715:
+		test(iStatus.Int() == KErrNone);
+		test(TestNotLocalSubscription(iSourceId));
+		test(TestVisible(iSourceId));
+		PerformSpecialOpL(FindFolderByNameL(iServiceId, _L("TestHier1/TestHier2")), KIMAP4MTMLocalUnsubscribe);
+		NextState();
+		break;
+		
+	case 716:
+		test(iStatus.Int() == KErrNone);
+		test(TestNotLocalSubscription(iSourceId));
+		test(TestVisible(iSourceId));
+		PerformSpecialOpL(FindFolderByNameL(iServiceId, _L("TestHier1/TestHier2/TestHier3")), KIMAP4MTMLocalUnsubscribe);
+		NextState();
+		break;
+		
+	case 717:
+		test(iStatus.Int() == KErrNone);
+		test(TestNotLocalSubscription(iSourceId));
+		test(TestInvisible(iSourceId));
+		test(TestInvisible(FindMessageByNameL(iSourceId, KMessageNameTest)));
+		test(TestInvisible(FindFolderByNameL(iServiceId, _L("TestHier1/TestHier2"))));
+		test(TestInvisible(FindFolderByNameL(iServiceId, _L("TestHier1"))));
+
+		iTestUtils->TestFinish(iTestNum++);
+
+		DoCancelOffLineOpsL();
+		NextState(100);
+		break;
+#endif
+		// POPULATE tests   --------------------------------------------------
+
+		// copy to mirror
+	case 800:
+		test(iStatus.Int() == KErrNone);
+		iTestUtils->TestFinish(iTestNum++);
+
+		iTestUtils->TestStart(iTestNum, _L("Populate default"));
+
+		DoOpL( EImap4OpPopulate, iRemoteInbox, KMsvNullIndexEntryId );
+		iOrigSourceId = iSourceId;
+		NextState();
+		break;
+
+	case 801:
+		test(TestQueueL( iRemoteInbox, CImOffLineOperation::EOffLineOpMtmSpecific, iSourceId, KMsvNullIndexEntryId, EGetImap4EmailBodyTextAndAttachments ));
+		test(TestDisconnectedFlags( iSourceId ) == EDisconnectedSpecialOperation );
+
+		iTestUtils->TestFinish(iTestNum++);
+
+		DoCancelOffLineOpsL();
+		NextState();
+		break;
+
+	case 802:
+		iTestUtils->TestStart(iTestNum, _L("Populate headers"));
+
+		DoOpL( EImap4OpPopulate, iRemoteInbox, KMsvNullIndexEntryId, EGetImap4EmailHeaders );
+		NextState();
+		break;
+
+	case 803:
+		test(TestQueueL( iRemoteInbox, CImOffLineOperation::EOffLineOpMtmSpecific, iSourceId, KMsvNullIndexEntryId, EGetImap4EmailHeaders ));
+		test(TestDisconnectedFlags( iSourceId ) == EDisconnectedSpecialOperation );
+
+		iTestUtils->TestFinish(iTestNum++);
+
+		DoCancelOffLineOpsL();
+		NextState();
+		break;
+
+	case 804:
+		iTestUtils->TestStart(iTestNum, _L("Populate BodyText"));
+
+		DoOpL( EImap4OpPopulate, iRemoteInbox, KMsvNullIndexEntryId, EGetImap4EmailBodyText );
+		NextState();
+		break;
+
+	case 805:
+		test(TestQueueL( iRemoteInbox, CImOffLineOperation::EOffLineOpMtmSpecific, iSourceId, KMsvNullIndexEntryId, EGetImap4EmailBodyText ));
+		test(TestDisconnectedFlags( iSourceId ) == EDisconnectedSpecialOperation );
+
+		iTestUtils->TestFinish(iTestNum++);
+
+		DoCancelOffLineOpsL();
+		NextState();
+		break;
+
+	case 806:
+		iTestUtils->TestStart(iTestNum, _L("Populate Attachments"));
+
+		DoOpL( EImap4OpPopulate, iRemoteInbox, KMsvNullIndexEntryId, EGetImap4EmailAttachments );
+		NextState();
+		break;
+
+	case 807:
+		test(TestQueueL( iRemoteInbox, CImOffLineOperation::EOffLineOpMtmSpecific, iSourceId, KMsvNullIndexEntryId, EGetImap4EmailAttachments ));
+		test(TestDisconnectedFlags( iSourceId ) == EDisconnectedSpecialOperation );
+
+		iTestUtils->TestFinish(iTestNum++);
+
+		DoCancelOffLineOpsL();
+		NextState();
+		break;
+
+	case 808:
+		iTestUtils->TestStart(iTestNum, _L("Populate All"));
+
+		DoOpL( EImap4OpPopulate, iRemoteInbox, KMsvNullIndexEntryId, EGetImap4EmailBodyTextAndAttachments );
+		NextState();
+		break;
+
+	case 809:
+		test(TestQueueL( iRemoteInbox, CImOffLineOperation::EOffLineOpMtmSpecific, iSourceId, KMsvNullIndexEntryId, EGetImap4EmailBodyTextAndAttachments ));
+		test(TestDisconnectedFlags( iSourceId ) == EDisconnectedSpecialOperation );
+
+		iTestUtils->TestFinish(iTestNum++);
+
+		DoCancelOffLineOpsL();
+		NextState(100);
+		break;
+
+	case 900:
+		// done
+		iTestUtils->TestHarnessCompleted();
+		EndOfTest();  
+		
+		// done
+		test.Console()->SetPos(0, 13);
+		test.Printf(_L("Finished offline tests\n"));
+		more = EFalse;
+		break;
+		
+	default:
+		NextState(100);
+		break;
+		}
+
+	return more;
+	}
+
+void CTestRefreshMBox::DoAutomatedOffLineOpsL()
+	{
+	if (iServiceId==NULL)
+		{
+		test.Printf(_L("No service ID\n"));
+		return;
+		}
+
+	if (iRemoteFolder1<=KMsvNullIndexEntryId)
+		iRemoteFolder1=FindFolderByNameL(iServiceId,_L("Test1"));
+		
+	if (iRemoteFolder2<=KMsvNullIndexEntryId)	
+		iRemoteFolder2=FindFolderByNameL(iServiceId,_L("Test2"));
+
+	if (iRemoteFolder1<=KMsvNullIndexEntryId ||
+		iRemoteFolder2<=KMsvNullIndexEntryId)	
+		{
+		test.Printf(_L("Don't have both the remote folders\n"));
+		}
+	else
+		{
+		iOpState = 0;
+		iState = EImapTestAutoOffLineOp;
+		
+		HandleOffLineStateL();
+		}
+	}
+
+TBool CTestRefreshMBox::HandleSyncStateL()
+	{
+	TBool more = ETrue;
+
+	switch (iOpState)
+		{
+		// test basic commands
+	case 0:
+		iTestUtils->TestStart(iTestNum, _L("Setup offline ops"));
+
+		DoOpNamedL(EImap4OpCopyToLocal, iRemoteInbox, iLocalFolder1);
+		NextState();
+		break;
+
+	case 1:
+		test(iStatus.Int() == KErrNone);
+		DoOpNamedL(EImap4OpCopyWithinService, iRemoteInbox, iRemoteFolder1);
+		NextState();
+		break;
+		
+	case 2:
+		test(iStatus.Int() == KErrNone);
+		DoOpNamedL(EImap4OpMoveToLocal, iRemoteInbox, iLocalFolder1);
+		NextState();
+		break;
+		
+	case 3:
+		test(iStatus.Int() == KErrNone);
+		DoOpNamedL(EImap4OpMoveWithinService, iRemoteInbox, iRemoteFolder1);
+		NextState();
+		break;
+		
+		// test populate options
+	case 4:
+		test(iStatus.Int() == KErrNone);
+		DoOpNamedL(EImap4OpDelete, iRemoteInbox, KMsvNullIndexEntryId);
+		NextState();
+		break;
+		
+	case 5:
+		test(iStatus.Int() == KErrNone);
+		DoOpNamedL(EImap4OpPopulate, iRemoteInbox, KMsvNullIndexEntryId, EGetImap4EmailHeaders);
+		NextState();
+		break;
+
+	case 6:
+		test(iStatus.Int() == KErrNone);
+		DoOpNamedL(EImap4OpPopulate, iRemoteInbox, KMsvNullIndexEntryId, EGetImap4EmailBodyText);
+		NextState();
+		break;
+		
+	case 7:
+		test(iStatus.Int() == KErrNone);
+		DoOpNamedL(EImap4OpPopulate, iRemoteInbox, KMsvNullIndexEntryId, EGetImap4EmailBodyTextAndAttachments);
+		NextState();
+		break;
+
+	case 8:
+		test(iStatus.Int() == KErrNone);
+		DoOpNamedL(EImap4OpPopulate, iRemoteInbox, KMsvNullIndexEntryId, EGetImap4EmailAttachments);
+		NextState();
+		NextState();
+		break;
+
+		// get one specific attachment
+	case 9:
+		{
+		test(iStatus.Int() == KErrNone);
+		TPckgBuf<TImap4GetMailOptions> package(EGetImap4EmailAttachments);	
+		FindAttachmentL();
+		DoOpByIdL(EImap4OpPopulate, (*iSelection)[0], package);
+		NextState();
+		break;
+		}
+
+		// test multiple copies to the same folder as the source
+	case 10:
+		test(iStatus.Int() == KErrNone);
+		DoOpNamedL(EImap4OpCopyWithinFolder, iRemoteInbox, iRemoteInbox);
+		NextState();
+		break;
+		
+	case 11:
+		test(iStatus.Int() == KErrNone);
+		DoOpNamedL(EImap4OpCopyWithinFolder, iRemoteInbox, iRemoteInbox);
+		NextState();
+		break;
+
+		// test out operations where the ghost gets deleted
+	case 12:
+		test(iStatus.Int() == KErrNone);
+		iTestUtils->TestFinish(iTestNum++);
+
+		iTestUtils->TestStart(iTestNum, _L("Setup ghost deletes"));
+		DoOpNamedL(EImap4OpCopyToLocalAndDelete, iRemoteInbox, iLocalFolder1);
+		NextState();
+		break;
+
+	case 13:
+		{
+		test(iStatus.Int() == KErrNone);
+		TMsvId id = FindShadowL(iLocalFolder1, iSourceId);
+		test(id!=KMsvNullIndexEntryId);
+
+		iEntry->SetEntry(iLocalFolder1);
+		iEntry->DeleteEntry(id);
+
+		DoOpNamedL(EImap4OpCopyWithinServiceAndDelete, iRemoteInbox, iRemoteFolder1);
+		NextState();
+		break;
+		}
+		
+	case 14:
+		test(iStatus.Int() == KErrNone);
+		DoOpByIdL(EImap4OpDelete, FindShadowL(iRemoteFolder1, iSourceId));
+		NextState();
+		break;
+
+	case 15:
+		test(iStatus.Int() == KErrNone);
+		DoOpNamedL(EImap4OpMoveToLocalAndDelete, iRemoteInbox, iLocalFolder1);
+		NextState();
+		break;
+	case 16:
+		{
+		test(iStatus.Int() == KErrNone);
+		TMsvId id = FindShadowL(iLocalFolder1, iSourceId);
+		test(id!=KMsvNullIndexEntryId);
+
+		iEntry->SetEntry(iLocalFolder1);
+		iEntry->DeleteEntry(id);
+
+		DoOpNamedL(EImap4OpMoveWithinServiceAndDelete, iRemoteInbox, iRemoteFolder1);
+		NextState();
+		break;
+		}
+		
+	case 17:
+		test(iStatus.Int() == KErrNone);
+		DoOpByIdL(EImap4OpDelete, FindShadowL(iRemoteFolder1, iSourceId));
+		NextState();
+		break;
+
+		// delete a message from folder 2
+	case 18:
+		{
+		test(iStatus.Int() == KErrNone);
+
+		TPtrC testMsg = TestMsgName(EImap4OpDelete);
+		TMsvId id = FindMessageByNameL(iRemoteFolder2, testMsg);
+		DoOpByIdL(EImap4OpDelete, id);
+		NextState();
+		break;
+		}
+		
+		// and move a message out of folder2
+	case 19:
+		{
+		test(iStatus.Int() == KErrNone);
+
+		// uses KMessageNameTest
+		DoOpL(EImap4OpMoveWithinService, iRemoteFolder2, iRemoteFolder1 );
+		NextState();
+		break;
+		}
+		
+	case 20:
+		{
+		test(iStatus.Int() == KErrNone);
+		iTestUtils->TestFinish(iTestNum++);
+
+		TDateTime dateTime;
+		dateTime.Set(2100, EJanuary, 1, 0, 0, 0, 0);
+		TTime date(dateTime);
+		if (!iLogClient)
+			iLogClient = CLogClient::NewL(iTestUtils->FileSession());
+		SetActive();
+		iLogClient->ClearLog(date, iStatus);
+		NextState(100);
+		break;
+		}
+		
+		// go online and check the results
+	case 100:
+		test(iStatus.Int() == KErrNone);
+
+		iTestUtils->TestStart(iTestNum, _L("Go online"));
+		DoConnectAndSyncL();
+		NextState();
+		break;
+
+	case 101:
+		test(iStatus.Int() == KErrNone);
+		PerformSpecialOpL(0, KIMAP4MTMIsConnected);
+		NextState();
+		break;
+		
+	case 102:
+		test(iStatus.Int() == KErrNone);
+		PerformSpecialOpL(0, KIMAP4MTMWaitForBackground);
+		NextState();
+		break;
+		
+	case 103:
+		{
+		test(iStatus.Int() == KErrNone);
+		iTestUtils->TestFinish(iTestNum++);
+
+		TMsvId copy;
+		TMsvId orig;
+
+		// check out the CopyToLocal to see if it happened correctly
+		iTestUtils->TestStart(iTestNum, _L("CopyToLocal"));
+
+		copy = FindMessageByOpL(iLocalFolder1, EImap4OpCopyToLocal);
+		test(copy!=KErrNotFound);
+		test(TestDisconnectedFlags(copy)==ENoDisconnectedOperations);
+		test(TestComplete(copy));
+
+		orig = FindMessageByOpL(iRemoteInbox, EImap4OpCopyToLocal);
+		test(orig!=KErrNotFound);
+		test(!TestShadowL(iLocalFolder1, orig));
+		test(TestDisconnectedFlags(orig)==ENoDisconnectedOperations);
+		test(TestComplete(orig));
+
+		test(!TestQueueL(iRemoteInbox, CImOffLineOperation::EOffLineOpCopyToLocal, orig, iLocalFolder1 ));
+
+		iTestUtils->TestFinish(iTestNum++);
+
+		// check out the CopyWithinService to see if it happened correctly
+		iTestUtils->TestStart(iTestNum, _L("CopyWithinService"));
+
+		copy = FindMessageByOpL(iRemoteFolder1, EImap4OpCopyWithinService);
+		test(copy!=KErrNotFound);
+		test(TestDisconnectedFlags(copy)==ENoDisconnectedOperations);
+
+		orig = FindMessageByOpL(iRemoteInbox, EImap4OpCopyWithinService);
+		test(orig!=KErrNotFound);
+		test(!TestShadowL(iRemoteFolder1, orig));
+		test(TestDisconnectedFlags(orig)==ENoDisconnectedOperations);
+
+		test(!TestQueueL(iRemoteInbox, CImOffLineOperation::EOffLineOpCopyWithinService, orig, iRemoteFolder1 ));
+		iTestUtils->TestFinish(iTestNum++);
+
+		// check out the MoveToLocal to see if it happened correctly
+		iTestUtils->TestStart(iTestNum, _L("MoveToLocal"));
+
+		copy = FindMessageByOpL(iLocalFolder1, EImap4OpMoveToLocal);
+		test(copy!=KErrNotFound);
+		test(TestDisconnectedFlags(copy)==ENoDisconnectedOperations);
+		test(TestComplete(copy));
+
+		orig = FindMessageByOpL(iRemoteInbox, EImap4OpMoveToLocal);
+		test(orig==KErrNotFound);
+
+		test(!TestQueueL(iRemoteInbox, CImOffLineOperation::EOffLineOpMoveToLocal, KMsvNullIndexEntryId, iLocalFolder1 ));
+		iTestUtils->TestFinish(iTestNum++);
+
+		// check out the MoveWithinService to see if it happened correctly
+		iTestUtils->TestStart(iTestNum, _L("MoveWithinService"));
+
+		copy = FindMessageByOpL(iRemoteFolder1, EImap4OpMoveWithinService);
+		test(copy!=KErrNotFound);
+		test(TestDisconnectedFlags(copy)==ENoDisconnectedOperations);
+
+		orig = FindMessageByOpL(iRemoteInbox, EImap4OpMoveWithinService);
+		test(orig==KErrNotFound);
+
+		test(!TestQueueL(iRemoteInbox, CImOffLineOperation::EOffLineOpMoveWithinService, KMsvNullIndexEntryId, iRemoteFolder1 ));
+		iTestUtils->TestFinish(iTestNum++);
+		
+		// check out the populate tests
+		iTestUtils->TestStart(iTestNum, _L("Populate"));
+
+		orig = FindMessageByOpL(iRemoteInbox, EImap4OpPopulate, EGetImap4EmailHeaders);
+		test(orig!=KErrNotFound);
+		test(TestDisconnectedFlags(orig)==ENoDisconnectedOperations);	
+		test(!TestComplete(orig));
+			
+		test(!TestQueueL(iRemoteInbox, CImOffLineOperation::EOffLineOpMtmSpecific, orig, KMsvNullIndexEntryId, EGetImap4EmailHeaders ));
+
+		orig = FindMessageByOpL(iRemoteInbox, EImap4OpPopulate, EGetImap4EmailBodyText);
+		test(orig!=KErrNotFound);
+		test(TestDisconnectedFlags(orig)==ENoDisconnectedOperations);	
+		test(!TestComplete(orig));
+
+		test(!TestQueueL(iRemoteInbox, CImOffLineOperation::EOffLineOpMtmSpecific, orig, KMsvNullIndexEntryId, EGetImap4EmailBodyText ));
+
+		orig = FindMessageByOpL(iRemoteInbox, EImap4OpPopulate, EGetImap4EmailAttachments);
+		test(orig!=KErrNotFound);
+		test(TestDisconnectedFlags(orig)==ENoDisconnectedOperations);	
+		test(!TestComplete(orig));
+
+		test(!TestQueueL(iRemoteInbox, CImOffLineOperation::EOffLineOpMtmSpecific, orig, KMsvNullIndexEntryId, EGetImap4EmailAttachments ));
+
+		orig = FindMessageByOpL(iRemoteInbox, EImap4OpPopulate, EGetImap4EmailBodyTextAndAttachments);
+		test(orig!=KErrNotFound);
+		test(TestDisconnectedFlags(orig)==ENoDisconnectedOperations);	
+		test(TestComplete(orig));
+		
+		test(!TestQueueL(iRemoteInbox, CImOffLineOperation::EOffLineOpMtmSpecific, orig, KMsvNullIndexEntryId, EGetImap4EmailBodyTextAndAttachments ));
+#if 0
+		// specific attachment
+		FindAttachmentL();
+		orig = (*iSelection)[0];
+		test(orig!=KErrNotFound);
+		test(TestDisconnectedFlags(orig)==ENoDisconnectedOperations);	
+		test(TestComplete(orig));
+		test(!TestQueueL(iRemoteInbox, CImOffLineOperation::EOffLineOpMtmSpecific, orig, KMsvNullIndexEntryId, EGetImap4EmailBodyTextAndAttachments ));
+#endif		
+
+		iTestUtils->TestFinish(iTestNum++);
+
+		// check out the CopyWithinFolder to see if it happened
+		// correctly, made 2 copies so there should be 3 of them in
+		// total
+		iTestUtils->TestStart(iTestNum, _L("CopyWithinFolder"));
+
+		test( CountMessagesByOpL(iRemoteInbox, EImap4OpCopyWithinFolder) == 3 );
+
+		// check each of the versions for the right flags
+		CMsvEntrySelection* children = new (ELeave) CMsvEntrySelection;
+		CleanupStack::PushL(children);
+			
+		User::LeaveIfError(iEntry->SetEntry( iRemoteInbox ));
+		User::LeaveIfError(iEntry->GetChildren( *children ));
+		
+		TPtrC name = TestMsgName( EImap4OpCopyWithinFolder );
+		for (TInt i=0; i < children->Count(); i++)
+		{
+			User::LeaveIfError(iEntry->SetEntry( (*children)[i] ));
+			if ( iEntry->Entry().iDescription.Compare( name ) == 0 )
+			{
+				TMsvId id = (*children)[i];
+				test(iEntry->Entry().iRelatedId == KMsvNullIndexEntryId);
+				test(TestDisconnectedFlags(id)==ENoDisconnectedOperations);
+			}
+		}
+		CleanupStack::PopAndDestroy();
+		iTestUtils->TestFinish(iTestNum++);
+
+		// check out the ghost deletion tests
+		iTestUtils->TestStart(iTestNum, _L("Ghost deletion"));
+
+		orig = FindMessageByOpL(iRemoteInbox, EImap4OpCopyToLocalAndDelete);	
+		test(orig!=KErrNotFound);
+		test(TestDisconnectedFlags(orig)==ENoDisconnectedOperations);	
+		
+		copy = FindMessageByOpL(iLocalFolder1, EImap4OpCopyToLocalAndDelete);
+		test(copy==KErrNotFound);
+
+		test(!TestQueueL(iRemoteInbox, CImOffLineOperation::EOffLineOpCopyToLocal, orig, iLocalFolder1 ));
+
+
+		orig = FindMessageByOpL(iRemoteInbox, EImap4OpCopyWithinServiceAndDelete);	
+		test(orig!=KErrNotFound);
+		test(TestDisconnectedFlags(orig)==ENoDisconnectedOperations);
+		
+		copy = FindMessageByOpL(iRemoteFolder1, EImap4OpCopyWithinServiceAndDelete);
+		test(copy==KErrNotFound);
+
+		test(!TestQueueL(iRemoteInbox, CImOffLineOperation::EOffLineOpCopyWithinService, orig, iRemoteFolder1 ));
+
+		
+		orig = FindMessageByOpL(iRemoteInbox, EImap4OpMoveToLocalAndDelete);	
+		test(orig==KErrNotFound);
+		
+		copy = FindMessageByOpL(iLocalFolder1, EImap4OpMoveToLocalAndDelete);
+		test(copy==KErrNotFound);
+
+		test(!TestQueueL(iRemoteInbox, CImOffLineOperation::EOffLineOpMoveToLocal, orig, iLocalFolder1 ));
+
+
+		orig = FindMessageByOpL(iRemoteInbox, EImap4OpMoveWithinServiceAndDelete);	
+		test(orig==KErrNotFound);
+		
+		copy = FindMessageByOpL(iRemoteFolder1, EImap4OpMoveWithinServiceAndDelete);
+		test(copy==KErrNotFound);
+
+		test(!TestQueueL(iRemoteInbox, CImOffLineOperation::EOffLineOpMoveWithinService, orig, iRemoteFolder1 ));
+
+		test(iStatus.Int() == KErrNone);
+		iTestUtils->TestFinish(iTestNum++);
+
+		// check the folder 2 operations
+		iTestUtils->TestStart(iTestNum, _L("Move from non-Inbox folder"));
+
+		copy = FindMessageByNameL(iRemoteFolder1, KMessageNameTest);
+		test(copy!=KErrNotFound);
+
+		//orig = FindMessageByNameL(iRemoteFolder2, KMessageNameTest);
+		//test(orig==KErrNotFound);
+		
+		iTestUtils->TestFinish(iTestNum++);
+
+		// check the deleted item
+		iTestUtils->TestStart(iTestNum, _L("Delete (on connect)"));
+
+		CImImap4Settings* settings = GetImap4SettingsLC();
+
+		orig = FindMessageByOpL(iRemoteInbox, EImap4OpDelete);
+		test( settings->DeleteEmailsWhenDisconnecting() ?
+			  orig!=KErrNotFound : orig==KErrNotFound );
+
+		CleanupStack::PopAndDestroy(); // settings
+		iTestUtils->TestFinish(iTestNum++);
+#if 0
+		iTestUtils->TestStart(iTestNum, _L("Logging"));
+
+		// set up the logview to test the logging messages
+		if (!iLogView)
+			{
+			iLogView = CLogViewEvent::NewL(*iLogClient);
+			if (!iLogFilter)
+				{
+				iLogFilter = CLogFilter::NewL();
+				iLogFilter->SetEventType(KLogMailEventTypeUid);
+				}
+			}
+		SetActive();
+		iLogView->SetFilterL(*iLogFilter, iStatus);
+		NextState(100);
+		break;
+		}
+
+	case 200:
+		// CopyToLocaL/MoveToLocal and 4 brands of Populate
+		test.Printf(_L("LogEvent: %d\n"), iLogView->CountL());
+		test(iLogView->CountL() == 6 );
+
+		SetActive();
+		test(iLogView->FirstL(iStatus) != EFalse);
+		NextState();
+		break;
+
+		// IMAPOFFL rules say that the order is populate, copytolocal,
+		// movetolocal, within that it is in order of usage. The
+		// LogView events come out most recent first (ie reverse
+		// order) thus leading to the order we see here.
+	case 201:
+		{
+		// check MoveToLocal
+		const CLogEvent& logEvent = iLogView->Event();
+
+		//TPtrC remoteParty = logEvent.RemoteParty();
+		//TPtrC direction = logEvent.Direction();
+		//TPtrC subject = logEvent.Subject();
+		//test.Printf(_L("LogEvent: '%S' '%S' '%S'\n"), &remoteParty, &subject, &direction);
+
+		test(logEvent.RemoteParty() == KTestRemoteParty);
+		test(logEvent.Subject() == TestMsgName(EImap4OpMoveToLocal));
+		test(logEvent.Direction() == _L("Fetched"));
+
+		SetActive();
+		test(iLogView->NextL(iStatus) != EFalse);
+		NextState();
+		break;
+		}
+		
+	case 202:
+		{
+		// check CopyToLocal
+		const CLogEvent& logEvent = iLogView->Event();
+		test(logEvent.RemoteParty() == KTestRemoteParty);
+		test(logEvent.Subject() == TestMsgName(EImap4OpCopyToLocal));
+		test(logEvent.Direction() == _L("Fetched"));
+
+		SetActive();
+		test(iLogView->NextL(iStatus) != EFalse);
+		NextState();
+		NextState();
+		break;
+		}
+		
+	case 203:
+		{
+		// check Populate single attachment
+		const CLogEvent& logEvent = iLogView->Event();
+		//test(logEvent.RemoteParty() == KTestRemoteParty);
+		//test(logEvent.Subject() == TestMsgName(EImap4OpPopulate, EGetImap4EmailAttachments));
+		test(logEvent.Direction() == _L("Fetched"));
+
+		SetActive();
+		test(iLogView->NextL(iStatus) != EFalse);
+		NextState();
+		break;
+		}
+		
+	case 204:
+		{
+		// check Populate
+		const CLogEvent& logEvent = iLogView->Event();
+		test(logEvent.RemoteParty() == KTestRemoteParty);
+		test(logEvent.Subject() == TestMsgName(EImap4OpPopulate, EGetImap4EmailAttachments));
+		test(logEvent.Direction() == _L("Fetched"));
+
+		SetActive();
+		test(iLogView->NextL(iStatus) != EFalse);
+		NextState();
+		break;
+		}
+		
+	case 205:
+		{
+		// check Populate
+		const CLogEvent& logEvent = iLogView->Event();
+		test(logEvent.RemoteParty() == KTestRemoteParty);
+		test(logEvent.Subject() == TestMsgName(EImap4OpPopulate, EGetImap4EmailBodyTextAndAttachments));
+		test(logEvent.Direction() == _L("Fetched"));
+
+		SetActive();
+		test(iLogView->NextL(iStatus) != EFalse);
+		NextState();
+		break;
+		}
+		
+	case 206:
+		{
+		// check Populate
+		const CLogEvent& logEvent = iLogView->Event();
+		test(logEvent.RemoteParty() == KTestRemoteParty);
+		test(logEvent.Subject() == TestMsgName(EImap4OpPopulate, EGetImap4EmailBodyText));
+		test(logEvent.Direction() == _L("Fetched"));
+
+		SetActive();
+		test(iLogView->NextL(iStatus) != EFalse);
+		NextState();
+		break;
+		}
+
+	case 207:
+		{
+		// check Populate
+		const CLogEvent& logEvent = iLogView->Event();
+		test(logEvent.RemoteParty() == KTestRemoteParty);
+		test(logEvent.Subject() == TestMsgName(EImap4OpPopulate, EGetImap4EmailHeaders));
+		test(logEvent.Direction() == _L("Fetched"));
+
+		iTestUtils->TestFinish(iTestNum++);
+#endif
+		// now disconnect and test deletion
+		iTestUtils->TestStart(iTestNum, _L("Disconnect"));
+ 		DoDisconnectL();
+		NextState(100);
+		break;
+		}
+		
+	case 200:
+		{
+		test(iStatus.Int() == KErrNone);
+		iTestUtils->TestFinish(iTestNum++);
+
+		// check the deleted item
+		CImImap4Settings* settings = GetImap4SettingsLC();
+
+		iTestUtils->TestStart(iTestNum, _L("Delete (on disconnect)"));
+
+		if (settings->DeleteEmailsWhenDisconnecting())
+			{
+			TMsvId orig = FindMessageByOpL(iRemoteInbox, EImap4OpDelete);
+			test( orig==KErrNotFound );
+			}
+
+		iTestUtils->TestFinish(iTestNum++);
+
+		CleanupStack::PopAndDestroy(); // settings
+
+		// now setup for some further tests
+		iTestUtils->TestStart(iTestNum, _L("MoveWithinServiceToInbox"));
+		DoOpNamedL(EImap4OpMoveWithinServiceToInbox, iRemoteFolder1, iRemoteInbox);
+		NextState();
+		break;
+		}
+
+	case 201:
+		test(iStatus.Int() == KErrNone);
+		DoConnectAndSyncL();
+		NextState();
+		break;
+
+	case 202:
+		test(iStatus.Int() == KErrNone);
+		PerformSpecialOpL(0, KIMAP4MTMWaitForBackground);
+		NextState();
+		break;
+		
+	case 203:
+		test(iStatus.Int() == KErrNone);
+		PerformSpecialOpL(iRemoteInbox, KIMAP4MTMSelect);
+		NextState();
+		break;
+
+	case 204:
+		test(iStatus.Int() == KErrNone);
+		PerformSpecialOpL(iRemoteInbox, KIMAP4MTMSynchronise);
+		NextState();
+		break;
+		
+	case 205:
+		{
+		test(iStatus.Int() == KErrNone);
+
+		// see if new message exists
+		TMsvId orig = FindMessageByOpL(iRemoteInbox, EImap4OpMoveWithinServiceToInbox);
+		test(orig!=KErrNotFound);
+
+		// check old message doesn't exist
+		orig = FindMessageByOpL(iRemoteFolder1, EImap4OpMoveWithinServiceToInbox);
+		test(orig==KErrNotFound);
+
+		iTestUtils->TestFinish(iTestNum++);
+
+		// done
+		iTestUtils->TestHarnessCompleted();
+		EndOfTest();  
+		
+		test.Console()->SetPos(0, 13);
+		test.Printf(_L("Finished sync tests\n"));
+		more = EFalse;
+		break;
+		}		
+
+	default:
+		NextState(100);
+		break;
+		}
+	return more; 
+	}
+
+void CTestRefreshMBox::DoAutomatedSyncOpsL()
+	{
+	if (iServiceId==NULL)
+		{
+		test.Printf(_L("No service ID\n"));
+		return;
+		}
+
+	if (iRemoteFolder1<=KMsvNullIndexEntryId)
+		iRemoteFolder1=FindFolderByNameL(iServiceId,_L("Test1"));
+		
+	if (iRemoteFolder2<=KMsvNullIndexEntryId)	
+		iRemoteFolder2=FindFolderByNameL(iServiceId,_L("Test2"));
+
+	if (iRemoteFolder1<=KMsvNullIndexEntryId ||
+		iRemoteFolder2<=KMsvNullIndexEntryId)	
+		{
+		test.Printf(_L("Don't have both the remote folders\n"));
+		}
+	else
+		{
+		iOpState = 0;
+		iState = EImapTestAutoSyncOp;
+		HandleSyncStateL();
+		}
+	}
+
+/* ----------------------------------------------------------------------- */
+
+void CTestRefreshMBox::DoAutomatedSecondaryConnectOpsL()
+	{
+	if (iServiceId==NULL)
+		{
+		test.Printf(_L("No service ID\n"));
+		return;
+		}
+
+	if (iRemoteFolder1<=KMsvNullIndexEntryId)
+		iRemoteFolder1=FindFolderByNameL(iServiceId,_L("Test1"));
+		
+	if (iRemoteFolder2<=KMsvNullIndexEntryId)	
+		iRemoteFolder2=FindFolderByNameL(iServiceId,_L("Test2"));
+
+	if (iRemoteFolder1<=KMsvNullIndexEntryId ||
+		iRemoteFolder2<=KMsvNullIndexEntryId)	
+		{
+		test.Printf(_L("Don't have both the remote folders\n"));
+		}
+	else
+		{
+		iOpState = 0;
+		iState = EImapTestAutoSecondaryConnect;
+		
+		TestSecondaryConnectStateMachineL();
+		}
+	}
+
+TBool CTestRefreshMBox::TestSecondaryConnectStateMachineL()
+	{
+	TBool more = ETrue;
+	TPckgBuf<TImap4GetMailOptions> package(EGetImap4EmailBodyText);
+	TMsvId id;
+
+	switch (iOpState)
+		{
+	case 0:
+		iTestUtils->TestStart(iTestNum, _L("Test Secondary connection"));
+
+		// subscribe to the backup folder initially to lengthen the
+		// background sync time
+		id = FindFolderByNameL(iServiceId, _L("TestBigFolder"));
+		PerformSpecialOpL(id, KIMAP4MTMLocalSubscribe);
+		NextState();
+		break;
+		
+	case 1:
+		DoConnectAndSyncL();
+		NextState(100);
+		break;
+
+	case 100:
+		test(iStatus.Int() == KErrNone);
+
+		id = FindMessageByNameL(iRemoteInbox, _L("Test: 3"));
+		DoOpByIdL(EImap4OpPopulate, id, package);
+		NextState();
+		break;
+
+	case 101:
+		test(iStatus.Int() == KErrNone);
+
+		id = FindMessageByNameL(iRemoteInbox, _L("Test: 4"));
+		DoOpByIdL(EImap4OpPopulate, id, package);
+		NextState();
+		break;
+
+	case 102:
+		test(iStatus.Int() == KErrNone);
+
+		id = FindMessageByNameL(iRemoteInbox, _L("Test: 5"));
+		DoOpByIdL(EImap4OpPopulate, id, package);
+		NextState();
+		break;
+
+		// at this point the server should still be busy with the
+		// background sync. So check that we get ServerBusy replies
+		// from everyone. This tests that the ServerBusy check happens
+		// correctly and also tht the 3 fetches above all happened
+		// whilst background syncing
+	case 103:
+		test(iStatus.Int() == KErrNone);
+		PerformSpecialOpL(0, KIMAP4MTMBusy);
+		NextState();
+		break;
+
+	case 104:
+		test(iStatus.Int() == KErrServerBusy);
+		PerformSpecialOpL(0, KIMAP4MTMFullSync);
+		NextState();
+		break;
+
+	case 105:
+		test(iStatus.Int() == KErrServerBusy);
+		PerformSpecialOpL(0, KIMAP4MTMSyncTree);
+		NextState();
+		break;
+
+	case 106:
+		test(iStatus.Int() == KErrServerBusy);
+		PerformSpecialOpL(0, KIMAP4MTMInboxNewSync);
+		NextState();
+		break;
+		
+	case 107:
+		test(iStatus.Int() == KErrServerBusy);
+
+		// and then wait for the background sync to finish before
+		// disconnecting
+		PerformSpecialOpL(0, KIMAP4MTMCancelBackgroundSynchronise);
+		NextState();
+		break;
+		
+	case 108:
+		test(iStatus.Int() == KErrCancel);
+		// just check busy returns OK this time
+		PerformSpecialOpL(0, KIMAP4MTMBusy);
+		NextState(100);
+		break;
+		
+	case 200:
+		test(iStatus.Int() == KErrNone);
+		DoDisconnectL();
+		NextState();
+		break;
+		
+	case 201:
+		id = FindFolderByNameL(iServiceId, _L("TestBigFolder"));
+		PerformSpecialOpL(id, KIMAP4MTMLocalUnsubscribe);
+		NextState();
+		break;
+		
+	case 202:
+		iTestUtils->TestFinish(iTestNum++);
+		iTestUtils->TestHarnessCompleted();
+		EndOfTest();  
+		// done
+		test.Console()->SetPos(0, 13);
+		test.Printf(_L("Finished sync tests\n"));
+		more = EFalse;
+		break;
+		}
+	return more;
+	}
+
+/* ----------------------------------------------------------------------- */
+
+/*
+
+  When we connect to the server the first time we will find that we
+  have all the messages we require in the INBOX and no other folders
+  present.
+
+  So we copy the messages to the Backup folder and create our other
+  required test folders.
+
+  On subsequent occasions we wish to copy any missing messages from
+  Backup to INBOX and delete any excess messages from inbox and from
+  the other test folders.
+
+  */
+
+TBool CTestRefreshMBox::StateMachineCheckServerContentsL()
+	{
+	TBool more = ETrue;
+	TMsvId id;
+	
+	while (!IsActive() && more)
+		{
+		switch (iOpState)
+			{
+		case 0:
+			iTestUtils->TestStart(iTestNum, _L("Check server contents"));
+			
+			// start with nothing subscribed locally and update remote
+			// to be the same
+			SetSubscriptionsL( EUseLocal, EUpdateNeither );
+	
+			DoConnectL();
+			NextState();
+			break;
+
+		case 1:
+			test(iStatus.Int() == KErrNone);
+			DoSyncTreeL();
+			NextState(10);
+			break;
+
+			// create directories
+		case 10:
+			id = FindFolderByNameL(iServiceId, _L("Backup"));
+			if (id == KErrNotFound)
+				DoFolderCreateL(iServiceId,_L("Backup"));
+			NextState();
+			break;
+
+		case 11:
+			id = FindFolderByNameL(iServiceId, _L("Test1"));
+			if (id == KErrNotFound)
+				DoFolderCreateL(iServiceId,_L("Test1"));
+			NextState();
+			break;
+
+		case 12:
+			id = FindFolderByNameL(iServiceId, _L("Test2"));
+			if (id == KErrNotFound)
+				DoFolderCreateL(iServiceId,_L("Test2"));
+			NextState();
+			break;
+
+		case 13:
+			id = FindFolderByNameL(iServiceId, KFolderNameToEncode);
+			if (id == KErrNotFound)
+				DoFolderCreateL(iServiceId, KFolderNameToEncode);
+			NextState();
+			break;
+
+		case 14:
+			DoFolderCreateL(iServiceId,_L("Test3"));
+			NextState();
+			break;
+
+		case 15:
+			test( FindFolderByNameL(iServiceId,_L("Test3")) != KErrNotFound );
+			DoFolderRemoveL(iServiceId,_L("Test3"));
+			NextState();
+			break;
+
+			// resync to see folder deletion
+		case 16:
+			DoSyncTreeL();
+			NextState();
+			break;
+
+		case 17:
+			test( FindFolderByNameL(iServiceId,_L("Test3")) == KErrNotFound );
+			NextState(10);
+			break;
+
+#if 0
+		case 13:
+			id = FindFolderByNameL(iServiceId, _L("TestHier1"));
+			if (id == KErrNotFound)
+				DoFolderCreateL(iServiceId,_L("TestHier1/"));
+			NextState();
+			break;
+
+		case 14:
+			{
+			TMsvId id1 = FindFolderByNameL(iServiceId, _L("TestHier1"));
+			id = FindFolderByNameL(id1, _L("TestHier2"));
+			if (id == KErrNotFound)
+				DoFolderCreateL(id1, _L("TestHier2/"));
+			NextState();
+			break;
+			}
+
+		case 15:
+			{
+			TMsvId id1 = FindFolderByNameL(iServiceId, _L("TestHier1"));
+			TMsvId id2 = FindFolderByNameL(id1, _L("TestHier2"));
+			id = FindFolderByNameL(id2, _L("TestHier3"));
+			if (id == KErrNotFound)
+				DoFolderCreateL(id2, _L("TestHier3"));
+			NextState();
+			break;
+			}
+
+		case 16:
+			{
+			TMsvId id1 = FindFolderByNameL(iServiceId, _L("TestHier1"));
+			TMsvId id2 = FindFolderByNameL(id1, _L("TestHier2"));
+			TMsvId id3 = FindFolderByNameL(id2, _L("TestHier3"));
+
+			TMsvId id = FindMessageByNameL(iRemoteInbox, KMessageNameTest);
+			iSelection->Reset();
+			iSelection->AppendL(id);
+			iImppServerMtm->CopyWithinServiceL(*iSelection, id3, iStatus);
+			SetActive();
+			
+			NextState();
+			break;
+			}
+#endif
+
+			// Sync some folders
+		case 20:
+			id = FindFolderByNameL(iServiceId, _L("Backup"));
+			PerformSpecialOpL(id, KIMAP4MTMSelect);
+			NextState();
+			break;
+
+		case 21:
+			id = FindFolderByNameL(iServiceId, _L("Backup"));
+			PerformSpecialOpL(id, KIMAP4MTMSynchronise);
+			NextState();
+			break;
+
+		case 22:
+			id = FindFolderByNameL(iServiceId, _L("Test1"));
+			PerformSpecialOpL(id, KIMAP4MTMSelect);
+			NextState();
+			break;
+
+		case 23:
+			id = FindFolderByNameL(iServiceId, _L("Test1"));
+			PerformSpecialOpL(id, KIMAP4MTMSynchronise);
+			NextState();
+			break;
+
+		case 24:
+			id = FindFolderByNameL(iServiceId, _L("Test2"));
+			PerformSpecialOpL(id, KIMAP4MTMSelect);
+			NextState();
+			break;
+
+		case 25:
+			id = FindFolderByNameL(iServiceId, _L("Test2"));
+			PerformSpecialOpL(id, KIMAP4MTMSynchronise);
+			NextState();
+			break;
+
+		case 26:
+			PerformSpecialOpL(iRemoteInbox, KIMAP4MTMSelect);
+			NextState();
+			break;
+
+		case 27:
+			PerformSpecialOpL(iRemoteInbox, KIMAP4MTMSynchronise);
+			NextState(10);
+			break;
+
+			// take copy of inbox into Backup
+		case 30:
+			id = FindFolderByNameL(iServiceId, _L("Backup"));
+			User::LeaveIfError(iEntry->SetEntry(id));
+			User::LeaveIfError(iEntry->GetChildren(*iSelection));
+			if (iSelection->Count() == 0)
+				{
+				User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+				User::LeaveIfError(iEntry->GetChildren(*iSelection));
+				iImppServerMtm->CopyWithinServiceL(*iSelection, id, iStatus);
+				SetActive();
+				}
+			NextState();
+			break;
+			
+			// clean out Test1 directory
+		case 31:
+			id = FindFolderByNameL(iServiceId, _L("Test1"));
+			User::LeaveIfError(iEntry->SetEntry(id));
+			User::LeaveIfError(iEntry->GetChildren(*iSelection));
+			if (iSelection->Count() != 0)
+				{
+				iImppServerMtm->DeleteAllL(*iSelection, iStatus);
+				SetActive();
+				}
+			NextState();
+			break;
+
+			// clean out Test2 directory
+		case 32:
+			id = FindFolderByNameL(iServiceId, _L("Test2"));
+			User::LeaveIfError(iEntry->SetEntry(id));
+			User::LeaveIfError(iEntry->GetChildren(*iSelection));
+			if (iSelection->Count() != 0)
+				{
+				iImppServerMtm->DeleteAllL(*iSelection, iStatus);
+				SetActive();
+				}
+			NextState();
+			break;
+
+			// clean out inbox
+		case 33:
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+			if (iSelection->Count() != 0)
+				{
+				iImppServerMtm->DeleteAllL(*iSelection, iStatus);
+				SetActive();
+				}
+			NextState();
+			break;
+
+			// take copy of backup into inbox
+		case 34:
+			id = FindFolderByNameL(iServiceId, _L("Backup"));
+			User::LeaveIfError(iEntry->SetEntry(id));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+			if (iSelection->Count() != 0)
+				{
+				iImppServerMtm->CopyWithinServiceL(*iSelection, iRemoteInbox, iStatus);
+				SetActive();
+				}
+			NextState(10);
+			break;
+
+			// fetch Test message to Local
+		case 40:
+			id = FindMessageByNameL(KMsvGlobalInBoxIndexEntryId, KMessageNameTest);
+			// fetch if not already present locally
+			if (id == KErrNotFound)
+				DoFetchTestL();
+			NextState();
+			break;
+
+			// fetch Test messages to Test2
+		case 41:
+			{
+			TMsvId test2Id = FindFolderByNameL(iServiceId, _L("Test2"));
+			iSelection->Reset();
+
+			id = FindMessageByNameL(test2Id, KMessageNameTest);
+			if (id == KErrNotFound)
+				{
+				id = FindMessageByNameL(iRemoteInbox, KMessageNameTest);
+				iSelection->AppendL(id);
+				}
+
+			TPtrC testMsg = TestMsgName(EImap4OpDelete);
+			id = FindMessageByNameL(test2Id, testMsg);
+			if (id == KErrNotFound)
+				{
+				id = FindMessageByNameL(iRemoteInbox, testMsg);
+				iSelection->AppendL(id);
+				}
+
+			if (iSelection->Count())
+				{
+				SetActive();
+				iImppServerMtm->CopyWithinServiceL(*iSelection, test2Id, iStatus);
+				}
+
+			NextState();
+			break;
+			}
+
+			// fetch message with dodgy numeric id in it
+		case 42:
+			{
+			iTestUtils->WriteComment(_L("Check message with numeric attachment"));
+			
+			TMsvId id = FindMessageByNameL(iRemoteInbox, _L("Test: 31"));
+
+			// first test that the size is small before fetching
+			User::LeaveIfError(iEntry->SetEntry(id));
+			test(iEntry->Entry().iSize > 0 );
+			test(iEntry->Entry().iSize < 1024 );
+			
+			TPckgBuf<TImap4GetMailOptions> package(EGetImap4EmailBodyTextAndAttachments);	
+			DoOpByIdL( EImap4OpPopulate, id, package );
+			
+			NextState();
+			break;
+			}
+			
+		case 43:
+			{
+			TMsvId id = FindMessageByNameL(iRemoteInbox, _L("Test: 31"));
+
+			// now test that the size is small after fetching
+			User::LeaveIfError(iEntry->SetEntry(id));
+			test(TestComplete(id));
+			test(iEntry->Entry().iSize > 0 );
+			test(iEntry->Entry().iSize < 1024 );
+
+			NextState();
+			break;
+			}
+
+			// Fetch message with attachment name > 256 chars
+		case 44:
+			{
+			iTestUtils->WriteComment(_L("Check message with attachment name > 256 chars"));
+
+			TMsvId id = FindMessageByNameL(iRemoteInbox, _L("Test: 32"));
+
+			TPckgBuf<TImap4GetMailOptions> package(EGetImap4EmailBodyTextAndAttachments);	
+			DoOpByIdL( EImap4OpPopulate, id, package );
+
+			NextState();
+			break;
+			}
+
+		case 45:
+			{
+			TMsvId id = FindMessageByNameL(iRemoteInbox, _L("Test: 32"));
+
+			test(TestComplete(id));
+
+			NextState();
+			break;
+			}
+			
+			// Fetch message with attachment name slightly < 256 chars
+		case 46:
+			{
+			iTestUtils->WriteComment(_L("Check message with attachment name nearly 256 chars"));
+			
+			TMsvId id = FindMessageByNameL(iRemoteInbox, _L("Test: 33"));
+
+			TPckgBuf<TImap4GetMailOptions> package(EGetImap4EmailBodyTextAndAttachments);	
+			DoOpByIdL( EImap4OpPopulate, id, package );
+
+			NextState();
+			break;
+			}
+
+		case 47:
+			{
+			TMsvId id = FindMessageByNameL(iRemoteInbox, _L("Test: 33"));
+
+			test(TestComplete(id));
+
+			NextState(100);
+			break;
+			}
+			
+			// check subscription code
+			// all subscriptions should have been cleared by the previous connect
+		case 100:
+			DoDisconnectL();
+			NextState();
+			break;
+
+			// set Test1 locally subscribed and Test2 unsubscribed and
+			// mirror this to the server
+		case 101:
+			iTestUtils->WriteComment(_L("Check subscriptions"));
+			SetSubscriptionsL( EUseLocal, EUpdateRemote );
+
+			id = FindFolderByNameL(iServiceId, _L("Test1"));
+			PerformSpecialOpL(id, KIMAP4MTMLocalSubscribe);
+			NextState();
+			break;
+
+		case 102:
+			id = FindFolderByNameL(iServiceId, _L("Test2"));
+			PerformSpecialOpL(id, KIMAP4MTMLocalUnsubscribe);
+			NextState();
+			break;
+
+		case 103:
+			DoConnectL();
+			NextState();
+			break;
+
+		case 104:
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 105:
+			id = FindFolderByNameL(iServiceId, _L("Test1"));
+			test( TestLocalSubscription(id) );
+			test( TestSubscribed(id) );
+
+			id = FindFolderByNameL(iServiceId, _L("Test2"));
+			test( TestNotLocalSubscription(id) );
+			test( TestNotSubscribed(id) );
+
+			DoDisconnectL();
+			NextState(10);
+			break;
+
+
+			// locally unsubscribe Test1 and subscribe Test2 and then
+			// get the server versions
+		case 110:
+			SetSubscriptionsL( EUseRemote, EUpdateLocal );
+
+			id = FindFolderByNameL(iServiceId, _L("Test1"));
+			PerformSpecialOpL(id, KIMAP4MTMLocalUnsubscribe);
+			NextState();
+			break;
+			
+		case 111:
+			id = FindFolderByNameL(iServiceId, _L("Test2"));
+			PerformSpecialOpL(id, KIMAP4MTMLocalSubscribe);
+			NextState();
+			break;
+
+		case 112:
+			id = FindFolderByNameL(iServiceId, _L("Test1"));
+			test( TestNotLocalSubscription(id) );
+
+			id = FindFolderByNameL(iServiceId, _L("Test2"));
+			test( TestLocalSubscription(id) );
+
+			DoConnectL();
+			NextState();
+			break;
+
+		case 113:
+			DoFullSyncL();
+			NextState();
+			break;
+
+			// which should leave us back at Test1 subscribed and
+			// Test2 unsubscribed
+		case 114:
+			id = FindFolderByNameL(iServiceId, _L("Test1"));
+			test( TestLocalSubscription(id) );
+			test( TestSubscribed(id) );
+
+			id = FindFolderByNameL(iServiceId, _L("Test2"));
+			test( TestNotLocalSubscription(id) );
+			test( TestNotSubscribed(id) );
+
+			DoDisconnectL();
+			NextState(10);
+			break;
+
+			// then locally subscribe Test2 (so both are now
+			// subscribed) and update both
+		case 120:
+			SetSubscriptionsL( EUseCombination, EUpdateBoth );
+
+			id = FindFolderByNameL(iServiceId, _L("Test2"));
+			PerformSpecialOpL(id, KIMAP4MTMLocalSubscribe);
+
+			NextState();
+			break;
+
+		case 121:
+			id = FindFolderByNameL(iServiceId, _L("Test2"));
+			test( TestLocalSubscription(id) );
+
+			DoConnectL();
+			NextState();
+			break;
+
+		case 122:
+			DoFullSyncL();
+			NextState();
+			break;
+
+			// which should leave us with both subscribed
+		case 123:
+			id = FindFolderByNameL(iServiceId, _L("Test1"));
+			test( TestLocalSubscription(id) );
+			test( TestSubscribed(id) );
+
+			id = FindFolderByNameL(iServiceId, _L("Test2"));
+			test( TestLocalSubscription(id) );
+			test( TestSubscribed(id) );
+
+			DoDisconnectL();
+			NextState(100);
+			break;
+
+		case 200:
+			test(iStatus.Int() == KErrNone);
+
+			iTestUtils->TestFinish(iTestNum++);
+
+			// done
+			iTestUtils->TestHarnessCompleted();
+			EndOfTest();  
+			
+			// done
+			test.Console()->SetPos(0, 13);
+			test.Printf(_L("Finished check server contents\n"));
+			more = EFalse;
+			break;
+
+		default:
+			NextState(100);
+			break;
+			}
+		}
+	return more; 
+	}
+
+void CTestRefreshMBox::DoCheckServerContentsL()
+	{
+	if (iServiceId==NULL)
+		{
+		test.Printf(_L("No service ID\n"));
+		return;
+		}
+
+	iOpState = 0;
+	iState = EImapTestCheckServerContents;
+	StateMachineCheckServerContentsL();
+	}
+
+/* ----------------------------------------------------------------------- */
+
+_LIT(KPerformFullSync,				"Performing full synchronisation"		);
+_LIT(KConnectToRemoteServer,		"Connect to remote server"				);
+_LIT(KDisconnectFromRemoteServer,	"Disconnect from remote server"			);
+
+const TInt KTestImapLimitedSyncSize1	=10;
+const TInt KTestImapTestInboxSize		=20;
+const TInt KTestImapTestBigFolderSize	=1200;
+// much bigger increment due to having to switch back and forth between client and 
+// server side which takes a lot of time
+const TInt KTestImapSyncIncrementSize	=100;
+
+TBool CTestRefreshMBox::StateMachineNSynchronisationL()
+	{
+	TBool more = ETrue;
+	TMsvId id;
+	
+	while (!IsActive() && more)
+		{
+		switch (iOpState)
+			{
+
+		// ----------------------------------------------------------------------------------- //
+
+		case 0:			
+			iTestUtils->TestStart(iTestNum, _L("N-Synchronisation tests: Regression tests (use cases SA1-SA5)"));
+
+
+
+			// Start with nothing subscribed locally updating neither.
+			DebugFormatL(EDebugLevel2,_L("Sync Strategy=EUseLocal, Subscribe Stategy=EUpdateNeither"));
+			SetSubscriptionsL( EUseLocal, EUpdateNeither );
+
+			// Set synchronisation settings to "sync to all".
+			ModifyImap4SynchronisationLimitsL(KImImapSynchroniseAll,KImImapSynchroniseAll);
+	
+			// Connect to remote server.
+			DebugFormatL(EDebugLevel2,KConnectToRemoteServer);
+			DoConnectL();
+			NextState();
+			break;
+
+		case 1:			
+			// Connection OK?
+			DebugFormatL(EDebugLevel2,_L("Connection status=%d"),iStatus.Int());
+			test(iStatus.Int() == KErrNone);
+
+			// Perform full synchronisation.
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState(10);
+			break;
+
+		case 10:
+			// Check for backup folder and create it if it doesnt exist
+			id = FindFolderByNameL(iServiceId, _L("Backup"));
+			if (id == KErrNotFound)
+				{
+				DebugFormatL(EDebugLevel2,_L("Creating folder 'backup'"));
+				DoFolderCreateL(iServiceId,_L("Backup"));
+				}
+			else
+				DebugFormatL(EDebugLevel2,_L("Found folder 'backup'"));
+			NextState();
+			break;
+
+		case 11:
+			// Select remote backup folder
+			DebugFormatL(EDebugLevel2,_L("Selecting folder 'backup'"));
+			id = FindFolderByNameL(iServiceId, _L("Backup"));
+			PerformSpecialOpL(id, KIMAP4MTMSelect);
+			NextState();
+			break;
+
+		case 12:
+			// Synchronise with remote backup folder
+			DebugFormatL(EDebugLevel2,_L("Synchronising folder 'backup'"));
+			id = FindFolderByNameL(iServiceId, _L("Backup"));
+			PerformSpecialOpL(id, KIMAP4MTMSynchronise);
+			NextState();
+			break;
+
+		case 13:
+			// Delete contents of backup folder
+			id = FindFolderByNameL(iServiceId, _L("Backup"));
+			User::LeaveIfError(iEntry->SetEntry(id));
+			User::LeaveIfError(iEntry->GetChildren(*iSelection));
+			if (iSelection->Count()>0)
+				{
+				DebugFormatL(EDebugLevel2,_L("Deleting folder 'backup' contents"));
+				iImppServerMtm->DeleteAllL(*iSelection, iStatus);
+				SetActive();
+				}
+			NextState();
+			break;
+
+		case 14:
+			// Select remote inbox
+			DebugFormatL(EDebugLevel2,_L("Selecting remote inbox"));
+			PerformSpecialOpL(iRemoteInbox, KIMAP4MTMSelect);
+			NextState();
+			break;
+
+		case 15:
+			// Sync with remote inbox
+			DebugFormatL(EDebugLevel2,_L("Synchronising remote inbox"));
+			PerformSpecialOpL(iRemoteInbox, KIMAP4MTMSynchronise);
+			NextState(10);
+			break;
+				 
+		case 20:	
+			// Backup contents of inbox to backup folder
+			id = FindFolderByNameL(iServiceId, _L("Backup"));
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+			if (iSelection->Count())
+				{
+				DebugFormatL(EDebugLevel2,_L("Moving contents of inbox to 'backup'"));
+				DebugUidListL(EDebugLevel3);
+				iImppServerMtm->MoveWithinServiceL(*iSelection, id, iStatus);
+				SetActive();
+				}
+			NextState();
+			break;
+
+		case 21:	
+			// Unsubscribe from "backup" folder.
+			DebugFormatL(EDebugLevel2,_L("Unsubscribe from folder 'backup'"));
+			id = FindFolderByNameL(iServiceId, _L("Backup"));
+			PerformSpecialOpL(id, KIMAP4MTMLocalUnsubscribe);
+			NextState();
+			break;
+
+		//
+		// Use case SA-1: Sync-to-all, with an empty local and remote mailbox
+		//
+		case 22:
+			DebugFormatL(EDebugLevel0,_L("Use case SA-1: Sync-to-all, with an empty local and remote mailbox"));
+
+			// Perform a full synchronisation.
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 23:
+			// Check inbox for empty
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry,*iSelection));
+			DebugFormatL(EDebugLevel1,_L("Checking inbox for empty - found %d messages"),iSelection->Count());
+			test(iSelection->Count()==0);
+			NextState(10);
+
+			DebugFormatL(EDebugLevel0,_L("Use case SA-1: Pass"));
+			break;
+
+		//
+		// Use case SA-2: Sync-to-all, with 1 email in the remote mailbox
+		//
+		case 30:
+			DebugFormatL(EDebugLevel0,_L("Use case SA-2: Sync-to-all, with 1 email in remote mailbox"));
+
+			// Locate "TestInbox" in local folder list.
+			id = FindFolderByNameL(iServiceId,_L("TestInbox"));
+			DebugFormatL(EDebugLevel1,_L("Locating 'TestInbox' in local store (%d)"),id);
+			test( id != KErrNotFound );
+
+			// Subscribe to "TestInbox"
+			DebugFormatL(EDebugLevel2,_L("Subscribe to 'TestInbox'"));
+	        PerformSpecialOpL(id, KIMAP4MTMLocalSubscribe);
+			NextState();
+			break;
+
+		case 31:
+			// Perform a full synchronisation.
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 32:	
+			// Copy 1 new email into remote mailbox
+			id = FindFolderByNameL(iServiceId, _L("TestInbox"));
+			User::LeaveIfError(iEntry->SetEntry(id));
+			User::LeaveIfError(iEntry->GetChildren(*iSelection));
+
+			// Check that there are 20 messages in the test inbox, if not then someone has
+			// broken it!
+			DebugFormatL(EDebugLevel1,_L("'TestInbox' contains %d messages when 20 expected"),iSelection->Count());
+			test(iSelection->Count()==KTestImapTestInboxSize);
+
+			// Trim the list of messages down to 1 message only
+			DebugFormatL(EDebugLevel2,_L("Trim 'TestInbox' contents list to 1 messaged"));
+			iSelection->Delete(1,iSelection->Count()-1);
+			DebugUidListL(EDebugLevel3);
+
+			// Copy it over to the inbox.
+			DebugFormatL(EDebugLevel2,_L("Copy 1 message from 'TestInbox' to remote inbox"));
+			iImppServerMtm->CopyWithinServiceL(*iSelection, iRemoteInbox, iStatus);
+			SetActive();
+
+			NextState();
+			break;
+
+		case 33:
+			// Perform a full sync
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 34:
+			// Check inbox for 1 new email
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry,*iSelection));
+			DebugFormatL(EDebugLevel1,_L("Inbox contains %d messages when 1 expected"),iSelection->Count());
+			DebugUidListL(EDebugLevel3);
+			test(iSelection->Count()==1);
+			NextState();
+			break;
+
+		case 35:
+			// Perform a full sync
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 36:
+			// Check inbox for 1 new email (again)
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+			DebugFormatL(EDebugLevel1,_L("(recheck) Inbox contains %d messages when 1 expected"),iSelection->Count());
+			DebugUidListL(EDebugLevel3);
+			test(iSelection->Count()==1);
+			NextState();
+
+			DebugFormatL(EDebugLevel0,_L("Use case SA-2: Pass"));
+			break;
+
+		//
+		// Use case SA-3: Sync-to-all, where mail has been deleted from remote mailbox by 
+		// another client.
+		//
+		case 37:
+			DebugFormatL(EDebugLevel0,_L("Use case SA-3: Sync-to-all, where mail has been deleted from remote mailbox"));
+
+			// Check inbox contains
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry,*iSelection));
+			DebugFormatL(EDebugLevel1,_L("Inbox contains %d messages when 1 expected"),iSelection->Count());
+			DebugUidListL(EDebugLevel3);
+			test(iSelection->Count()==1);
+
+			// Delete message from inbox.
+			DebugFormatL(EDebugLevel1,_L("Deleting message from inbox"));
+			iImppServerMtm->DeleteAllL(*iSelection, iStatus);
+			SetActive();
+
+			NextState();
+			break;
+
+		case 38:
+			// Perform a full sync
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 39:
+			// Check inbox for empty
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+			DebugFormatL(EDebugLevel1,_L("Inbox contains %d messages when 0 expected"),iSelection->Count());
+			test(iSelection->Count()==0);
+			NextState(10);
+
+			DebugFormatL(EDebugLevel0,_L("Use case SA-3: Pass"));
+			break;
+
+		//
+		// Use case SA-4: Sync-to-all, with some new mail in remote inbox 
+		//
+		case 40:	
+			DebugFormatL(EDebugLevel0,_L("Use case SA-4: Sync-to-all, with some new mail in remote inbox"));
+
+			// Copy contents of remote test inbox to remote inbox
+			id = FindFolderByNameL(iServiceId, _L("TestInbox"));
+			User::LeaveIfError(iEntry->SetEntry(id));
+			User::LeaveIfError(iEntry->GetChildren(*iSelection));
+
+			// Check that there are 20 messages in the test inbox, if not then someone has
+			// broken it!
+			DebugFormatL(EDebugLevel1,_L("'TestInbox' contains %d messages when 20 expected"),iSelection->Count());
+			test(iSelection->Count()==KTestImapTestInboxSize);
+
+			// Trim list down to 5 oldest
+			DebugFormatL(EDebugLevel2,_L("Select 5 messages from list"));
+			iSelection->Delete(5,iSelection->Count()-5);
+			DebugUidListL(EDebugLevel3);
+
+			// Copy messages to inbox.
+			DebugFormatL(EDebugLevel2,_L("Copy 5 messages to remote inbox"));
+			iImppServerMtm->CopyWithinServiceL(*iSelection, iRemoteInbox, iStatus);
+			SetActive();
+
+			NextState();
+			break;
+
+		case 41:
+			// Perform a full sync
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 42:
+			// Check inbox for 5 new messages
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+			DebugFormatL(EDebugLevel1,_L("Inbox contains %d messages when 5 expected"),iSelection->Count());
+			test(iSelection->Count()==5);
+
+			NextState();
+			break;
+
+		case 43:
+			// Perform a full sync
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 44:
+			// Check inbox for 5 new messages (again)
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+			DebugFormatL(EDebugLevel1,_L("(recheck) Inbox contains %d messages when 5 expected"),iSelection->Count());
+			test(iSelection->Count()==5);
+
+			NextState(10);
+
+			DebugFormatL(EDebugLevel0,_L("Use case SA-4: Pass"));
+			break;
+
+		//
+		// Use case SA-5: Sync-to-all, with new & old mail in the remote inbox, and some mail
+		// deleted from remote inbox
+		//
+		case 50:
+			DebugFormatL(EDebugLevel0,_L("Use case SA-5: Sync-to-all, with new & old mail in the remote inbox, and some mail deleted"));
+
+			// Check contents of inbox.
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+			DebugFormatL(EDebugLevel1,_L("Inbox contains %d messages when 5 expected"),iSelection->Count());
+			test(iSelection->Count()==5);
+
+			// Trim list down to 1 message
+			DebugFormatL(EDebugLevel2,_L("Trim list to 1 message only"));
+			iSelection->Delete(1,iSelection->Count()-1);
+			DebugUidListL(EDebugLevel3);
+
+			// Delete message from inbox.
+			DebugFormatL(EDebugLevel2,_L("Deleting 1 message from inbox"));
+			iImppServerMtm->DeleteAllL(*iSelection, iStatus);
+			SetActive();
+
+			NextState();
+			break;
+
+		case 51:	
+			// Copy contents of remote test inbox to remote inbox.
+			id = FindFolderByNameL(iServiceId, _L("TestInbox"));
+			User::LeaveIfError(iEntry->SetEntry(id));
+			User::LeaveIfError(iEntry->GetChildren(*iSelection));
+
+			// Check that there are 20 messages in the test inbox.
+			DebugFormatL(EDebugLevel1,_L("'TestInbox' contains %d messages when 20 expected"),iSelection->Count());
+			test(iSelection->Count()==KTestImapTestInboxSize);
+			DebugUidListL(EDebugLevel3);
+
+			// Get 2 newer messages from list.
+			DebugFormatL(EDebugLevel2,_L("Trim list to 2 messages only"));
+			iSelection->Delete(0,5);
+			iSelection->Delete(2,iSelection->Count()-2);
+			DebugUidListL(EDebugLevel3);
+
+			// Copy messages to inbox.
+			DebugFormatL(EDebugLevel2,_L("Copy 2 messages from 'TestInbox' to remote inbox"));
+			iImppServerMtm->CopyWithinServiceL(*iSelection, iRemoteInbox, iStatus);
+			SetActive();
+
+			NextState();
+			break;
+
+		case 52:
+			// Perform a full sync.
+			DebugFormatL(EDebugLevel2,_L("Perform a full synchronisation"));
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 53:
+			// Check inbox for 5 + 2 - 1 = 6 messages.
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+			DebugFormatL(EDebugLevel1,_L("Inbox contains %d messages when 6 expected"),iSelection->Count());
+			test(iSelection->Count()==6);
+			DebugUidListL(EDebugLevel3);
+			
+			NextState(10);
+
+			DebugFormatL(EDebugLevel0,_L("Use case SA-5: Pass"));
+			break;
+
+		case 60:
+			// Disconnect
+			DebugFormatL(EDebugLevel2,KDisconnectFromRemoteServer);
+			DoDisconnectL();
+			NextState();
+			break;
+
+		// ----------------------------------------------------------------------------------- //
+
+		case 100:
+			iTestUtils->TestStart(iTestNum, _L("N-Synchronisation tests: New functionality tests (use cases SA10-SA16)"));
+
+			// Reset service settings to limit synchronisation.
+			ModifyImap4SynchronisationLimitsL(KTestImapLimitedSyncSize1,KImImapSynchroniseAll);
+
+			// Connect to remote server.
+			DebugFormatL(EDebugLevel2,KConnectToRemoteServer);
+			DoConnectL();
+
+			NextState();
+			break;
+
+		case 101:
+			// Perform a full synchronisation with remote server.
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState(10);
+			break;
+
+		//
+		// Use case SA-10: Sync-to-limit, with an empty local and remote mailbox
+		//
+		case 110:
+			DebugFormatL(EDebugLevel0,_L("Use case SA-10: Sync-to-limit, with an empty local and remote mailbox"));
+
+			// Delete contents of inbox
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+			if (iSelection->Count())
+				{
+				DebugFormatL(EDebugLevel2,_L("Deleting messages from inbox"));
+				iImppServerMtm->DeleteAllL(*iSelection, iStatus);
+				SetActive();
+				}
+			NextState();
+			break;
+
+		case 111:
+			// Perform a full synchronisation with remote server.
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 112:
+			// Check inbox for empty
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+			DebugFormatL(EDebugLevel1,_L("Inbox contains %d messages when 0 expected"),iSelection->Count());
+			test(iSelection->Count()==0);
+
+			NextState(10);
+
+			DebugFormatL(EDebugLevel0,_L("Use case SA-10: Pass"));
+			break;
+
+		//
+		// Use case SA-11: Sync-to-limit, with 1 email in the remote inbox
+		//
+		case 120:	
+			DebugFormatL(EDebugLevel0,_L("Use case SA-11: Sync-to-limit, with 1 email in the remote inbox"));
+
+			// Copy 1 new email into remote mailbox
+			id = FindFolderByNameL(iServiceId, _L("TestInbox"));
+			User::LeaveIfError(iEntry->SetEntry(id));
+			User::LeaveIfError(iEntry->GetChildren(*iSelection));
+
+			// Check that there are 20 messages in "TestInbox".
+			DebugFormatL(EDebugLevel1,_L("'TestInbox' contains %d messages when 20 expected"),iSelection->Count());
+			test(iSelection->Count()==KTestImapTestInboxSize);
+
+			// Trim the list of messages down to 1 message only
+			DebugFormatL(EDebugLevel2,_L("Trim list to 1 messages only"));
+			iSelection->Delete(1,iSelection->Count()-1);
+			DebugUidListL(EDebugLevel3);
+
+			// Copy it over to the inbox.
+			DebugFormatL(EDebugLevel2,_L("Copy 1 messages to remote inbox"));
+			iImppServerMtm->CopyWithinServiceL(*iSelection, iRemoteInbox, iStatus);
+			SetActive();
+
+			NextState();
+			break;
+
+		case 121:
+			// Perform a full synchronisation with remote server.
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 122:
+			// Check inbox for 1 new message
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+			test(iSelection->Count()==1);
+			DebugUidListL(EDebugLevel3);
+			NextState();
+			break;
+
+		case 123:
+			// Perform a full synchronisation with remote server.
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 124:
+			// Build list of remote inbox messages.
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+			DebugFormatL(EDebugLevel1,_L("Inbox contains %d messages when 1 expected"),iSelection->Count());
+			// Check inbox for 1 new message.
+			test(iSelection->Count()==1);
+			DebugUidListL(EDebugLevel3);
+
+			NextState(10);
+
+			DebugFormatL(EDebugLevel0,_L("Use case SA-11: Pass"));
+			break;
+
+		//
+		// Use case SA-12: Sync-to-limit, where mail has been deleted from remote mailbox
+		// by another mail client
+		//
+		case 130:
+			DebugFormatL(EDebugLevel0,_L("Use case SA-12: Sync-to-limit, where mail has been deleted from remote mailbox"));
+
+			// Build a list of messages in remote inbox
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+
+			// Check that inbox contains 1 message.
+			DebugFormatL(EDebugLevel1,_L("Inbox contains %d messages when 1 expected"),iSelection->Count());
+			test(iSelection->Count()==1);
+			DebugUidListL(EDebugLevel3);
+			
+			// Delete message from inbox
+			DebugFormatL(EDebugLevel2,_L("Deleting messages from inbox"));
+			iImppServerMtm->DeleteAllL(*iSelection, iStatus);
+			SetActive();
+
+			NextState();
+			break;
+
+		case 131:
+			// Perform a full sync
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 132:
+			// Check inbox for empty
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+			DebugFormatL(EDebugLevel1,_L("Inbox contains %d messages when 0 expected"),iSelection->Count());
+			test(iSelection->Count()==0);
+
+			NextState(10);
+
+			DebugFormatL(EDebugLevel0,_L("Use case SA-12: Pass"));
+			break;
+
+		//
+		// Use case SA-13: Sync-to-all, with some new mail in remote inbox 
+		//
+		case 140:	
+			DebugFormatL(EDebugLevel0,_L("Use case SA-13: Sync-to-all, with some new mail in remote inbox"));
+
+			// Copy contents of remote test inbox to remote inbox
+			id = FindFolderByNameL(iServiceId, _L("TestInbox"));
+			User::LeaveIfError(iEntry->SetEntry(id));
+			User::LeaveIfError(iEntry->GetChildren(*iSelection));
+
+			// Check that there are 20 messages in "TestInbox".
+			DebugFormatL(EDebugLevel1,_L("'TestInbox' contains %d messages when 20 expected"),iSelection->Count());
+			test(iSelection->Count()==KTestImapTestInboxSize);
+			DebugUidListL(EDebugLevel3);
+
+			// Trim list down to 5 oldest
+			DebugFormatL(EDebugLevel2,_L("Trim list to 5 messages only"));
+			iSelection->Delete(5,iSelection->Count()-5);
+			DebugUidListL(EDebugLevel3);
+
+			// Copy 5 messages to inbox.
+			DebugFormatL(EDebugLevel2,_L("Copy 5 messages from 'TestInbox' to remote inbox"));
+			iImppServerMtm->CopyWithinServiceL(*iSelection, iRemoteInbox, iStatus);
+
+			SetActive();
+			NextState();
+			break;
+
+		case 141:
+			// Perform a full sync
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 142:
+			// Check inbox for 5 new messages
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+			DebugFormatL(EDebugLevel1,_L("Inbox contains %d messages when 5 expected"),iSelection->Count());
+			test(iSelection->Count()==5);
+			DebugUidListL(EDebugLevel3);
+
+			NextState();
+			break;
+
+		case 143:
+			// Perform a full sync
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 144:
+			// Check inbox for 5 new messages (again)
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+			DebugFormatL(EDebugLevel1,_L("(recheck) Inbox contains %d messages when 5 expected"),iSelection->Count());
+			test(iSelection->Count()==5);
+
+			NextState(10);
+
+			DebugFormatL(EDebugLevel0,_L("Use case SA-13: Pass"));
+			break;
+
+		//
+		// Use case SA-14: Sync-to-all, with new & old mail in the remote mailbox, and
+		// some mail deleted from remote mailbox
+		//
+		case 150:
+			DebugFormatL(EDebugLevel0,_L("Use case SA-14: Sync-to-all, with new & old mail in the remote mailbox, and some mail deleted"));
+
+			// Build list of inbox messages
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+			DebugFormatL(EDebugLevel1,_L("Inbox contains %d messages when 5 expected"),iSelection->Count());
+			test(iSelection->Count()==5);
+
+			// Trim list down to 1 message
+			DebugFormatL(EDebugLevel2,_L("Trim list to 1 message only"));
+			iSelection->Delete(1,iSelection->Count()-1);
+			DebugUidListL(EDebugLevel3);
+
+			// Delete message from inbox
+			DebugFormatL(EDebugLevel2,_L("Deleting message from inbox"));
+			iImppServerMtm->DeleteAllL(*iSelection, iStatus);
+			SetActive();
+
+			NextState();
+			break;
+
+		case 151:	
+			// Build a list of messages in "TestInbox"
+			id = FindFolderByNameL(iServiceId, _L("TestInbox"));
+			User::LeaveIfError(iEntry->SetEntry(id));
+			User::LeaveIfError(iEntry->GetChildren(*iSelection));
+
+			// Check that there are 20 messages in the test inbox.
+			test(iSelection->Count()==KTestImapTestInboxSize);
+
+			// Get 2 newer messages from list
+			DebugFormatL(EDebugLevel2,_L("Trim list to 2 messages only"));
+			iSelection->Delete(0,5);
+			iSelection->Delete(2,iSelection->Count()-2);
+			DebugUidListL(EDebugLevel3);
+
+			// Copy 2 messages from "TestInbox" to remote inbox
+			iImppServerMtm->CopyWithinServiceL(*iSelection, iRemoteInbox, iStatus);
+			SetActive();
+
+			NextState();
+			break;
+
+		case 152:
+			// Perform a full sync
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 153:
+			// Check inbox for 5 + 2 - 1 = 6 messages
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+			DebugFormatL(EDebugLevel1,_L("Inbox contains %d messages when 6 expected"),iSelection->Count());
+			test(iSelection->Count()==6);
+			DebugUidListL(EDebugLevel3);
+
+			NextState(10);
+
+			DebugFormatL(EDebugLevel0,_L("Use case SA-14: Pass"));
+			break;
+
+		//
+		// Use case SA-15: Sync-to-all, with email > limit in remote mailbox
+		//
+		case 160:	
+			DebugFormatL(EDebugLevel0,_L("Use case SA-15: Sync-to-all, with email > limit in remote mailbox"));
+
+			// Build list of messages in "TestInbox".
+			id = FindFolderByNameL(iServiceId, _L("TestInbox"));
+			User::LeaveIfError(iEntry->SetEntry(id));
+			User::LeaveIfError(iEntry->GetChildren(*iSelection));
+
+			// Check that there are 20 messages in "TestInbox".
+			DebugFormatL(EDebugLevel1,_L("'TestInbox' contains %d messages when 20 expected"),iSelection->Count());
+			test(iSelection->Count()==KTestImapTestInboxSize);
+			DebugUidListL(EDebugLevel3);
+
+			// Get 5 newer messages from list
+			// Trim the list of messages down to 1 message only
+			DebugFormatL(EDebugLevel2,_L("Trim list to 5 messages only"));
+			iSelection->Delete(0,7);
+			iSelection->Delete(5,iSelection->Count()-5);
+			DebugUidListL(EDebugLevel3);
+
+			// Copy messages to inbox.
+			DebugFormatL(EDebugLevel2,_L("Copy 5 messages to remote inbox"));
+			iImppServerMtm->CopyWithinServiceL(*iSelection, iRemoteInbox, iStatus);
+			SetActive();
+
+			NextState();
+			break;
+
+		case 161:
+			// Perform a full sync
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 162:
+			{
+			// Build list of messages in remote inbox.
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+
+			// Check inbox for 10 messages.
+			DebugFormatL(EDebugLevel1,_L("Local Inbox contains %d messages when 10 expected"),iSelection->Count());
+			test(iSelection->Count()==KTestImapLimitedSyncSize1);
+			DebugUidListL(EDebugLevel3);
+
+			// Check that remote message count is what we expect it to be (= 11)
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+	//		TMsvEmailEntry message=iEntry->Entry();
+	//		DebugFormatL(EDebugLevel1,_L("Remote Inbox contains %d messages when 11 expected"),message.RemoteFolderEntries());
+	//		test(message.RemoteFolderEntries()==KTestImapLimitedSyncSize1+1);
+
+			NextState(10);
+
+			DebugFormatL(EDebugLevel0,_L("Use case SA-15: Pass"));
+			break;
+			}
+
+		//
+		// Use case SA-16: Sync-to-all, with populated email > limit in remote mailbox
+		//
+		case 170:
+			DebugFormatL(EDebugLevel0,_L("Use case SA-16: Sync-to-all, with populated email > limit in remote mailbox"));
+
+			// Check inbox for 10 messages
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+			DebugFormatL(EDebugLevel1,_L("Local Inbox contains %d messages when 10 expected"),iSelection->Count());
+			test(iSelection->Count()==KTestImapLimitedSyncSize1);
+
+			// Locate oldest message is inbox message list.
+			DebugFormatL(EDebugLevel2,_L("Trim list to 1 message only"));
+			iSelection->Delete(1,iSelection->Count()-1);
+			DebugUidListL(EDebugLevel3);
+
+			// Download body parts for oldest message
+			DebugFormatL(EDebugLevel2,_L("Populating message in inbox"));
+			iImppServerMtm->CopyToLocalL(*iSelection, KMsvGlobalInBoxIndexEntryId, iStatus);
+			SetActive();
+
+			NextState();
+			break;
+
+		case 171:	
+			// Copy contents of remote test inbox to remote inbox
+
+			// Build list of messages in "TestInbox".
+			id = FindFolderByNameL(iServiceId, _L("TestInbox"));
+			User::LeaveIfError(iEntry->SetEntry(id));
+			User::LeaveIfError(iEntry->GetChildren(*iSelection));
+
+			// Get 1 newer messages from list
+			DebugFormatL(EDebugLevel2,_L("Trim list next newest message only"));
+			iSelection->Delete(0,12);
+			iSelection->Delete(1,iSelection->Count()-1);
+			DebugUidListL(EDebugLevel3);
+
+			// Copy messages to inbox.
+			DebugFormatL(EDebugLevel2,_L("Copy message to remote inbox"));
+			iImppServerMtm->CopyWithinServiceL(*iSelection, iRemoteInbox, iStatus);
+			SetActive();
+
+			NextState();
+			break;
+
+		case 172:
+			// Perform a full sync
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 173:
+			{
+			// Build list of messages in local inbox.
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+			// Check inbox for 11 messages.
+			DebugFormatL(EDebugLevel1,_L("Local Inbox contains %d messages when 11 expected"),iSelection->Count());
+			test(iSelection->Count()==KTestImapLimitedSyncSize1+1);
+			DebugUidListL(EDebugLevel3);
+
+			// Check that remote message count is what we expect it to be (= 12)
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+//			TMsvEmailEntry message=iEntry->Entry();
+//			DebugFormatL(EDebugLevel1,_L("Remote Inbox contains %d messages when 12 expected"),message.RemoteFolderEntries());
+//			test(message.RemoteFolderEntries()==KTestImapLimitedSyncSize1+2);
+
+			NextState(10);
+
+			DebugFormatL(EDebugLevel0,_L("Use case SA-16: Pass"));
+			break;
+			}
+
+		case 180:
+			// Disconnect
+			DebugFormatL(EDebugLevel2,KDisconnectFromRemoteServer);
+			DoDisconnectL();
+			NextState();
+			break;
+
+		// ----------------------------------------------------------------------------------- //
+
+		//
+		// Special Case 1: Sync-to-limit, with large remote mailbox (1200 messages)
+		//
+		case 200:
+			iTestUtils->TestStart(iTestNum, _L("N-Synchronisation tests: Special case tests"));
+
+			DebugFormatL(EDebugLevel0,_L("Special case 1: Sync-to-limit, with large remote mailbox (1200 messages)"));
+
+			// Reset service settings to limit synchronisation.
+			DebugFormatL(EDebugLevel2,_L("Sync Strategy=EUseLocal, Subscribe Stategy=EUpdateNeither"));
+			SetSubscriptionsL(EUseLocal, EUpdateNeither);
+			ModifyImap4SynchronisationLimitsL(KTestImapLimitedSyncSize1,KTestImapLimitedSyncSize1);
+
+			// Connect to remote server.
+			DebugFormatL(EDebugLevel2,KConnectToRemoteServer);
+			DoConnectL();
+			NextState();
+			break;
+
+		case 201:
+			// Perform a full synchronisation with remote server.
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 202:
+			// Check for "big" folder in local folder list
+			iRemoteFolder1 = FindFolderByNameL(iServiceId, _L("TestBigFolder"));
+			if (iRemoteFolder1==KErrNotFound)
+				iRemoteFolder1 = FindFolderByNameL(iServiceId, _L("INBOX/TestBigFolder"));
+			if (iRemoteFolder1==KErrNotFound)
+				iRemoteFolder1 = FindFolderByNameL(iServiceId, _L("Mail/TestBigFolder"));
+			if (iRemoteFolder1 == KErrNotFound)
+				DoFolderCreateL(iServiceId,_L("TestBigFolder"));
+			iRemoteFolder1 = FindFolderByNameL(iServiceId, _L("TestBigFolder"));
+
+			DebugFormatL(EDebugLevel1,_L("Checking for 'TestBigFolder' in local folder list (%d)"),iRemoteFolder1);
+			test(iRemoteFolder1!=KErrNotFound);
+
+			NextState();
+			break;
+
+		case 203:
+			// Select remote "big" folder
+			DebugFormatL(EDebugLevel1,_L("Select remote 'TestBigFolder'"));
+			PerformSpecialOpL(iRemoteFolder1, KIMAP4MTMSelect);
+			NextState();
+			break;
+
+		case 204:
+			// Synchronise with remote "big" folder
+			DebugFormatL(EDebugLevel1,_L("Synchronise with remote 'TestBigFolder'"));
+			PerformSpecialOpL(iRemoteFolder1, KIMAP4MTMSynchronise);
+			NextState();
+			break;
+
+		case 205:
+			{
+			// Build list of messages in local "TestBigFolder".
+			User::LeaveIfError(iEntry->SetEntry(iRemoteFolder1));
+			User::LeaveIfError(iEntry->GetChildren(*iSelection));
+			// Check big folder for 10 messages
+			DebugFormatL(EDebugLevel1,_L("Local 'TestBigFolder' contains %d messages when 10 expected"),iSelection->Count());
+			test(iSelection->Count()==KTestImapLimitedSyncSize1);
+			DebugUidListL(EDebugLevel3);
+
+			// Check that remote message count is what we expect it to be (= 1200)
+			TMsvEmailEntry message=iEntry->Entry();
+			DebugFormatL(EDebugLevel1,_L("Remote 'TestBigFolder' contains %d messages when 1200 expected"),message.RemoteFolderEntries());
+			test(message.RemoteFolderEntries()==KTestImapTestBigFolderSize);
+
+			NextState();
+
+			break;
+			}
+
+		case 206:	
+			// Unsubscribe from "big" folder
+			DebugFormatL(EDebugLevel1,_L("Unsubscribe from 'TestBigFolder'"));
+			PerformSpecialOpL(iRemoteFolder1, KIMAP4MTMLocalUnsubscribe);
+
+			NextState();
+
+			DebugFormatL(EDebugLevel0,_L("Special case 1: Pass"));
+			break;
+
+		case 207:
+			// Disconnect
+			DebugFormatL(EDebugLevel2,KDisconnectFromRemoteServer);
+			DoDisconnectL();
+			NextState(10);
+			break;
+
+		//
+		// Special Case 2: Sync-to-limit changed to Sync-to-all.
+		//
+		case 210:
+			DebugFormatL(EDebugLevel0,_L("Special case 2: Sync-to-limit changed to Sync-to-all"));
+
+			// Set synchronisation settings to "sync to all".
+			SetSubscriptionsL( EUseLocal, EUpdateNeither );
+			ModifyImap4SynchronisationLimitsL(KImImapSynchroniseAll,KImImapSynchroniseAll);
+
+			// Connect to remote server.			
+			DebugFormatL(EDebugLevel2,KConnectToRemoteServer);
+			DoConnectL();
+			NextState();
+			break;
+
+		case 211:
+			// Connected ok?
+			DebugFormatL(EDebugLevel1,_L("Connected? (%d)"),iStatus.Int());
+			test(iStatus.Int() == KErrNone);
+
+			// Perform a full synchronisation with remote server.
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 212:
+			// Build a list of local inbox messages.
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+
+			// Only want messages in selection list.
+			FindMessagesInSelectionL();
+			if (iSelection->Count())
+				{
+				// Delete all messages from inbox.
+				DebugFormatL(EDebugLevel2,_L("Deleting messages from inbox"));
+				DebugUidListL(EDebugLevel3);
+				iImppServerMtm->DeleteAllL(*iSelection, iStatus);
+				SetActive();
+				}
+			NextState();
+			break;
+
+		case 213:
+			// Locate "TestInbox" in local folder list.
+			iRemoteFolder1 = FindFolderByNameL(iServiceId, _L("TestInbox"));
+			if (iRemoteFolder1==KErrNotFound)
+				iRemoteFolder1 = FindFolderByNameL(iServiceId, _L("INBOX/TestInbox"));
+			if (iRemoteFolder1==KErrNotFound)
+				iRemoteFolder1 = FindFolderByNameL(iServiceId, _L("Mail/TestInbox"));
+			DebugFormatL(EDebugLevel1,_L("Checking for 'TestInbox' in local folder list (%d)"),iRemoteFolder1);
+			test(iRemoteFolder1!=KErrNotFound);
+
+			// Subscribe to "TestInbox".
+	        PerformSpecialOpL(iRemoteFolder1, KIMAP4MTMLocalSubscribe);
+			NextState();
+			break;
+
+		case 214:
+			// Perform a full sync to get contents of "TestInbox".
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 215:	
+			// Build list of messages in "TestInbox".
+			User::LeaveIfError(iEntry->SetEntry(iRemoteFolder1));
+			User::LeaveIfError(iEntry->GetChildren(*iSelection));
+
+			// Check for correct number of messages in "TestInbox".
+			DebugFormatL(EDebugLevel1,_L("'TestInbox' contains %d messages when 20 expected"),iSelection->Count());
+			test(iSelection->Count()==KTestImapTestInboxSize);
+			DebugUidListL(EDebugLevel3);
+
+			// Copy contents of remote "TestInbox" to remote inbox.
+			DebugFormatL(EDebugLevel1,_L("Copying contents of 'TestInbox' to remote inbox"));
+			iImppServerMtm->CopyWithinServiceL(*iSelection, iRemoteInbox, iStatus);
+			SetActive();
+
+			NextState();
+			break;
+
+		case 216:
+			// Perform a full synchronisation with remote server.
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 217:
+			// Build list of messages in local inbox.
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+
+			// Check for correct number of messages in folder
+			FindMessagesInSelectionL();
+			DebugFormatL(EDebugLevel1,_L("Local Inbox contains %d messages when 20 expected"),iSelection->Count());
+			test(iSelection->Count()==KTestImapTestInboxSize);
+			DebugUidListL(EDebugLevel3);
+
+			// Disconnect from remote server.
+			DebugFormatL(EDebugLevel2,KDisconnectFromRemoteServer);
+			DoDisconnectL();
+			NextState();
+			break;
+
+		case 218:
+			// Set synchronisation settings to "sync to N".
+			ModifyImap4SynchronisationLimitsL(KTestImapLimitedSyncSize1,KTestImapLimitedSyncSize1);
+
+			// Connect to remote server.
+			DebugFormatL(EDebugLevel2,KConnectToRemoteServer);
+			DoConnectL();
+			NextState();
+			break;
+
+		case 219:
+			// Perform a full synchronisation with remote server.
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 220:
+			// Build list of messages in local inbox.
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+
+			// Check for correct number of messages in folder
+			FindMessagesInSelectionL();
+			DebugFormatL(EDebugLevel1,_L("Local Inbox contains %d messages when 10 expected"),iSelection->Count());
+			test(iSelection->Count()==KTestImapLimitedSyncSize1);
+			DebugUidListL(EDebugLevel3);
+
+			// Disconnect from remote server.
+			DebugFormatL(EDebugLevel2,KDisconnectFromRemoteServer);
+			DoDisconnectL();
+			NextState();
+			break;
+
+		case 221:
+			// Set synchronisation settings to "sync to all".
+			ModifyImap4SynchronisationLimitsL(KImImapSynchroniseAll,KImImapSynchroniseAll);
+
+			// Connect to remote server.
+			DebugFormatL(EDebugLevel2,KConnectToRemoteServer);
+			DoConnectL();
+			NextState();
+			break;
+
+		case 222:
+			// Perform a full synchronisation with remote server.
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 223:
+			// Build list of messages in local inbox.
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+
+			// Check for correct number of messages in folder
+			FindMessagesInSelectionL();
+			DebugFormatL(EDebugLevel1,_L("Local Inbox contains %d messages when 20 expected"),iSelection->Count());
+			test(iSelection->Count()==KTestImapTestInboxSize);
+			DebugUidListL(EDebugLevel3);
+
+			// Disconnect from remote server.
+			DebugFormatL(EDebugLevel2,KDisconnectFromRemoteServer);
+			DoDisconnectL();
+			NextState(10);
+
+			DebugFormatL(EDebugLevel0,_L("Special case 2: Pass"));
+			break;
+
+		//
+		// Special Case 3: Sync-to-all changed to Sync-to-limit.
+		//
+		case 230:
+			DebugFormatL(EDebugLevel2,_L("Special case 3: Sync-to-all changed to Sync-to-limit"));
+
+			// Set synchronisation settings to "sync to N".
+			ModifyImap4SynchronisationLimitsL(KTestImapLimitedSyncSize1,KTestImapLimitedSyncSize1);
+
+			// Connect to remote server.
+			DebugFormatL(EDebugLevel2,KConnectToRemoteServer);
+			DoConnectL();
+
+			NextState();
+			break;
+
+		case 231:
+			// Perform a full synchronisation with remote server.
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 232:
+			// Build list of messages in local inbox.
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+
+			// Check for correct number of messages in folder
+			FindMessagesInSelectionL();
+			DebugFormatL(EDebugLevel1,_L("Local Inbox contains %d messages when 10 expected"),iSelection->Count());
+			test(iSelection->Count()==KTestImapLimitedSyncSize1);
+			DebugUidListL(EDebugLevel3);
+
+			// Disconnect from remote server.
+			DebugFormatL(EDebugLevel2,KDisconnectFromRemoteServer);
+			DoDisconnectL();
+
+			NextState(10);
+
+			DebugFormatL(EDebugLevel0,_L("Special case 3: Pass"));
+			break;
+
+		//
+		// Special Case 4: Sync-to-limit, limit increased
+		//
+		case 240:
+			DebugFormatL(EDebugLevel0,_L("Special case 4: Sync-to-limit, limit increased"));
+
+			// Set synchronisation settings to "sync to N".
+			ModifyImap4SynchronisationLimitsL(KTestImapLimitedSyncSize1+5,KTestImapLimitedSyncSize1+5);
+
+			// Connect to remote server.
+			DebugFormatL(EDebugLevel2,KConnectToRemoteServer);
+			DoConnectL();
+			NextState();
+			break;
+
+		case 241:
+			// Perform a full synchronisation with remote server.
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 242:
+			// Build list of messages in local inbox.
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+
+			// Check for correct number of messages in folder
+			FindMessagesInSelectionL();
+			DebugFormatL(EDebugLevel1,_L("Local Inbox contains %d messages when 15 expected"),iSelection->Count());
+			test(iSelection->Count()==KTestImapLimitedSyncSize1+5);
+			DebugUidListL(EDebugLevel3);
+
+			NextState(10);
+						
+			DebugFormatL(EDebugLevel0,_L("Special case 4: Pass"));
+			break;
+
+		//
+		// Special Case 5: Sync-to-limit, with populated message and limit decreased, then increased
+		//
+		case 250:
+			{
+			DebugFormatL(EDebugLevel0,_L("Special case 5: Sync-to-limit, with populated message and limit decreased, then increased"));
+
+			// Build list of messages in local inbox.
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+
+			// Locate the oldest message.
+			TMsvId msvId;
+			iMessageUid=0;
+			for (TInt i=0;i<iSelection->Count();i++)
+				{
+				TMsvEntry* entryPtr;
+				User::LeaveIfError(iEntry->GetEntryFromId((*iSelection)[i],entryPtr));
+				TUint32 uid=((TMsvEmailEntry)(*entryPtr)).UID();
+				if (iMessageUid>uid || iMessageUid==0)
+					{
+					iMessageUid=uid;
+					msvId=(*iSelection)[i];
+					}
+				}
+
+			// Download body parts for oldest message
+			iSelection->Reset();
+			iSelection->AppendL(msvId);
+			DebugFormatL(EDebugLevel1,_L("Populating 1 message in inbox"));
+			DebugUidListL(EDebugLevel3);
+			iImppServerMtm->CopyToLocalL(*iSelection, KMsvGlobalInBoxIndexEntryId, iStatus);
+			SetActive();
+
+			NextState();
+			break;
+			}
+
+		case 251:
+			// Disconnect
+			DebugFormatL(EDebugLevel2,KDisconnectFromRemoteServer);
+			DoDisconnectL();
+			NextState();
+			break;
+
+		case 252:
+			// Reset synchronisation settings limit
+			ModifyImap4SynchronisationLimitsL(KTestImapLimitedSyncSize1,KTestImapLimitedSyncSize1);
+			DebugFormatL(EDebugLevel2,KConnectToRemoteServer);
+			DoConnectL();
+			NextState();
+			break;
+
+		case 253:
+			// Perform a full synchronisation with remote server.
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 254:
+			// Build list of messages in local inbox.
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+
+			// Check for correct number of messages in folder
+			FindMessagesInSelectionL();
+			DebugFormatL(EDebugLevel1,_L("Local Inbox contains %d messages when 11 expected"),iSelection->Count());
+			test(iSelection->Count()==KTestImapLimitedSyncSize1+1);
+			DebugUidListL(EDebugLevel3);
+
+			// Disconnect from remote server.
+			DebugFormatL(EDebugLevel2,KDisconnectFromRemoteServer);
+			DoDisconnectL();
+			NextState();
+			break;
+
+		case 255:
+			// Reset synchronisation settings limit.
+			ModifyImap4SynchronisationLimitsL(KImImapSynchroniseAll,KImImapSynchroniseAll);
+
+			// Connect to remote server.
+			DebugFormatL(EDebugLevel2,KConnectToRemoteServer);
+			DoConnectL();
+			NextState();
+			break;
+
+		case 256:
+			// Perform a full synchronisation with remote server.
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 257:
+			// Build list of messages in local inbox.
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+
+			// Check for correct number of messages in folder
+			FindMessagesInSelectionL();
+			DebugFormatL(EDebugLevel1,_L("Local Inbox contains %d messages when 20 expected"),iSelection->Count());
+			test(iSelection->Count()==KTestImapTestInboxSize);
+			DebugUidListL(EDebugLevel3);
+
+			// Disconnect from remote server.
+			DebugFormatL(EDebugLevel2,KDisconnectFromRemoteServer);
+			DoDisconnectL();
+
+			NextState(10);
+
+			DebugFormatL(EDebugLevel0,_L("Special case 5: Pass"));
+			break;
+
+		//
+		// Special Case 6: Sync-to-limit, with populated message deleted from remote folder
+		//
+		case 260:
+			DebugFormatL(EDebugLevel0,_L("Special case 6: Sync-to-limit, with populated message deleted from remote folder"));
+
+			// Connect to remote server.
+			ModifyImap4SynchronisationLimitsL(KTestImapLimitedSyncSize1,KTestImapLimitedSyncSize1);
+			DebugFormatL(EDebugLevel2,KConnectToRemoteServer);
+			DoConnectL();
+
+			NextState();
+			break;
+
+		case 261:
+			// Perform a full synchronisation with remote server.
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 262:
+			{
+			// Build list of messages in local inbox.
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+
+			// Check for correct number of messages in folder
+			FindMessagesInSelectionL();
+			DebugFormatL(EDebugLevel1,_L("Local Inbox contains %d messages when 11 expected"),iSelection->Count());
+			test(iSelection->Count()==KTestImapLimitedSyncSize1+1);
+			DebugUidListL(EDebugLevel3);
+
+			// Locate the message with body parts
+			TMsvId msvId=-1;
+			for (TInt i=0;i<iSelection->Count();i++)
+				{
+				User::LeaveIfError(iEntry->SetEntry((*iSelection)[i]));
+				TMsvEmailEntry entry(iEntry->Entry());
+				if (entry.BodyTextComplete())
+					{
+					msvId=(*iSelection)[i];
+					break;
+					}
+				}
+			// Found?
+			DebugFormatL(EDebugLevel1,_L("Populated message located (%d)"),msvId);
+			test(msvId!=-1);
+
+			// Add message with body parts to deletion list.
+			iSelection->Reset();
+			iSelection->AppendL(msvId);
+
+			// Delete message.
+			DebugFormatL(EDebugLevel1,_L("Delete populated message"),iSelection->Count());
+			DebugUidListL(EDebugLevel3);
+			iImppServerMtm->DeleteAllL(*iSelection, iStatus);
+			SetActive();
+
+			NextState();
+			break;
+			}
+
+		case 263:
+			// Perform a full synchronisation with remote server.
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 264:
+			// Build list of messages in local inbox.
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+
+			// Check for correct number of messages in folder
+			FindMessagesInSelectionL();
+			DebugFormatL(EDebugLevel1,_L("Local Inbox contains %d messages when 10 expected"),iSelection->Count());
+			test(iSelection->Count()==KTestImapLimitedSyncSize1);
+			DebugUidListL(EDebugLevel3);
+
+			// Disconnect from remote server.
+			DebugFormatL(EDebugLevel2,KDisconnectFromRemoteServer);
+			DoDisconnectL();
+
+			NextState(10);
+
+			DebugFormatL(EDebugLevel0,_L("Special case 6: Pass"));
+			break;
+
+		//
+		// Special Case 7: Sync-to-none, with empty local folder & empty remote folder
+		//
+		case 270:
+			DebugFormatL(EDebugLevel0,_L("Special case 7: Sync-to-none, with empty local folder & empty remote folder"));
+
+			// Reset synchronisation settings limit to "sync-to-all".
+			ModifyImap4SynchronisationLimitsL(KImImapSynchroniseAll,KImImapSynchroniseAll);
+
+			// Connect to remote server.
+			DebugFormatL(EDebugLevel2,KConnectToRemoteServer);
+			DoConnectL();
+			NextState();
+			break;
+
+		case 271:
+			// Perform a full synchronisation with remote server.
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 272:
+			// Build list of messages in inbox.
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+			FindMessagesInSelectionL();
+			if (iSelection->Count())
+				{
+				// Delete all messages from inbox.
+				DebugFormatL(EDebugLevel1,_L("Delete messages in inbox"));
+				DebugUidListL(EDebugLevel3);
+				iImppServerMtm->DeleteAllL(*iSelection, iStatus);
+				SetActive();
+				}
+			NextState();
+			break;
+
+		case 273:
+			// Perform a full synchronisation with remote server.
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 274:
+			// Build list of messages in local inbox.
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+
+			// Check for correct number of messages in folder
+			FindMessagesInSelectionL();
+			DebugFormatL(EDebugLevel1,_L("Local Inbox contains %d messages when 0 expected"),iSelection->Count());
+			test(iSelection->Count()==0);
+
+			// Disconnect from remote server.
+			DebugFormatL(EDebugLevel2,KDisconnectFromRemoteServer);
+			DoDisconnectL();
+			NextState();
+			break;
+
+		case 275:
+			// Reset synchronisation settings limit
+			ModifyImap4SynchronisationLimitsL(KImImapSynchroniseNone,KImImapSynchroniseAll);
+
+			// Connect to remote server.
+			DebugFormatL(EDebugLevel2,KConnectToRemoteServer);
+			DoConnectL();
+			NextState();
+			break;
+
+		case 276:
+			// Perform a full synchronisation with remote server.
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 277:
+			// Build list of messages in local inbox.
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+
+			// Check for correct number of messages in folder.
+			FindMessagesInSelectionL();
+			DebugFormatL(EDebugLevel1,_L("Local Inbox contains %d messages when 0 expected"),iSelection->Count());
+			test(iSelection->Count()==0);
+
+			NextState(10);
+
+			DebugFormatL(EDebugLevel0,_L("Special case 7: Pass"));
+			break;
+
+		//
+		// Special Case 8: Sync-to-none, with new messages in remote folder
+		//
+		case 280:
+			DebugFormatL(EDebugLevel0,_L("Special case 8: Sync-to-none, with new messages in remote folder"));
+
+			// Build a list of messages in "TestInbox".
+			id = FindFolderByNameL(iServiceId, _L("TestInbox"));
+			User::LeaveIfError(iEntry->SetEntry(id));
+			User::LeaveIfError(iEntry->GetChildren(*iSelection));
+
+			// Check that there are 20 messages in the test inbox.
+			DebugFormatL(EDebugLevel1,_L("'TestInbox' contains %d messages when 20 expected"),iSelection->Count());
+			test(iSelection->Count()==KTestImapTestInboxSize);
+			DebugUidListL(EDebugLevel3);
+
+			// Get 5 messages from the list and copy to inbox.
+			DebugFormatL(EDebugLevel2,_L("Select 5 messages from 'TestInbox' message list"));
+			iSelection->Delete(5,iSelection->Count()-5);
+			DebugUidListL(EDebugLevel3);
+			DebugFormatL(EDebugLevel1,_L("Copy 5 messages from 'TestInbox' to remote inbox"));
+			iImppServerMtm->CopyWithinServiceL(*iSelection, iRemoteInbox, iStatus);
+			SetActive();
+
+			NextState();
+			break;
+
+		case 281:
+			// Perform a full synchronisation with remote server.
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 282:
+			// Build list of messages in local inbox.
+			User::LeaveIfError(iEntry->SetEntry(iRemoteInbox));
+			User::LeaveIfError(iEntry->GetChildrenWithType(KUidMsvMessageEntry, *iSelection));
+
+			// Check for correct number of messages in folder
+			FindMessagesInSelectionL();
+
+#if 0
+			// skip this test as we've set InboxSync to None which
+			// means that the copied messages won't ever show up (due
+			// to to the copy itself or due to the Sync after) this
+			// looks like it might be a problem in the design of the sync
+			// code but can't tell for sure
+			DebugFormatL(EDebugLevel1,_L("Local Inbox contains %d messages when 5 expected"),iSelection->Count());
+			test(iSelection->Count()==5);
+#endif
+			// Disconnect from remote server.
+			DebugFormatL(EDebugLevel2,KDisconnectFromRemoteServer);
+			DoDisconnectL();
+
+			NextState(10);
+
+			DebugFormatL(EDebugLevel0,_L("Special case 8: Pass"));
+			break;
+
+		//
+		// Special Case 9: Unsubscribed folder contents auto-deleted
+		//
+		case 290:
+			DebugFormatL(EDebugLevel0,_L("Special case 9: Unsubscribed folder contents auto-deleted"));
+
+			// Reset synchronisation settings limit to sync-to-all
+			SetSubscriptionsL(EUseLocal, EUpdateBoth);
+			ModifyImap4SynchronisationLimitsL(KImImapSynchroniseAll,KImImapSynchroniseAll);
+
+			// Connect to remote server
+			DebugFormatL(EDebugLevel2,KConnectToRemoteServer);
+			DoConnectL();
+			NextState();
+			break;
+
+		case 291:
+			// Perform a full synchronisation with remote server.
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 292:
+			// Build list of messages in "TestInbox"
+			id = FindFolderByNameL(iServiceId, _L("TestInbox"));
+			User::LeaveIfError(iEntry->SetEntry(id));
+			User::LeaveIfError(iEntry->GetChildren(*iSelection));
+
+			// Check that there are 20 messages in "TestInbox"
+			DebugFormatL(EDebugLevel1,_L("'TestInbox' contains %d messages when 20 expected"),iSelection->Count());
+			test(iSelection->Count()==KTestImapTestInboxSize);
+			DebugUidListL(EDebugLevel2);
+
+			// Unsubscribe 
+			DebugFormatL(EDebugLevel1,_L("Unsubscribe from 'TestInbox'"));
+			PerformSpecialOpL(id, KIMAP4MTMLocalUnsubscribe);
+			NextState();
+			break;
+
+		case 293:
+			// Perform a full synchronisation with remote server.
+			DebugFormatL(EDebugLevel2,KPerformFullSync);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 294:
+			// Build list of messages in "TestInbox".
+			id = FindFolderByNameL(iServiceId, _L("TestInbox"));
+			User::LeaveIfError(iEntry->SetEntry(id));
+			User::LeaveIfError(iEntry->GetChildren(*iSelection));
+
+			// Check that "TestInbox" is empty.
+			DebugFormatL(EDebugLevel1,_L("'TestInbox' contains %d messages when 0 expected"),iSelection->Count());
+			test(iSelection->Count()==0);
+
+			// Disconnect from remote server.
+			DebugFormatL(EDebugLevel2,KDisconnectFromRemoteServer);
+			DoDisconnectL();
+			NextState();
+
+			DebugFormatL(EDebugLevel0,_L("Special case 9: Pass"));
+			break;
+
+		// ----------------------------------------------------------------------------------- //
+
+		//
+		// Performance test
+		//
+		case 300:			
+			// Connect and unsubscribe 
+			iTestUtils->TestStart(iTestNum, _L("N-Synchronisation tests: Large mailbox sync performance test"));
+
+			SetSubscriptionsL( EUseCombination, EUpdateNeither );
+
+			// Set synchronisation settings to "sync to all".
+			ModifyImap4SynchronisationLimitsL(iSyncLimit,iSyncLimit);
+	
+			DoConnectL();
+			NextState();
+			break;
+
+		case 301:			
+			// Synchronise with remote inbox
+			test(iStatus.Int()==KErrNone);
+			DoFullSyncL();
+			NextState();
+			break;
+
+		case 302:
+			// Check for "big" folder and create it if it doesnt exist
+			id = FindFolderByNameL(iServiceId, _L("TestBigFolder"));
+			if (id == KErrNotFound)
+				DoFolderCreateL(iServiceId,_L("TestBigFolder"));
+			NextState();
+			break;
+
+		case 303:
+			// Disconnect
+			DoDisconnectL();
+			NextState(10);
+			break;
+
+		case 310:
+			// Reset service settings to limit synchronisation.
+			iTimeStamp.UniversalTime();
+			ModifyImap4SynchronisationLimitsL(iSyncLimit,iSyncLimit);
+			DoConnectL();
+			NextState();
+			break;
+
+		case 311:
+			// Select remote "big" folder
+			id = FindFolderByNameL(iServiceId, _L("TestBigFolder"));
+			PerformSpecialOpL(id, KIMAP4MTMSelect);
+			NextState();
+			break;
+
+		case 312:
+			// Synchronise with remote "big" folder
+			id = FindFolderByNameL(iServiceId, _L("TestBigFolder"));
+			PerformSpecialOpL(id, KIMAP4MTMSynchronise);
+			NextState();
+			break;
+
+		case 313:
+			{
+			// Check big folder for N messages
+			id = FindFolderByNameL(iServiceId, _L("TestBigFolder"));
+			User::LeaveIfError(iEntry->SetEntry(id));
+			User::LeaveIfError(iEntry->GetChildren(*iSelection));
+			if (iSelection->Count()!=iSyncLimit)
+				{
+				DebugFormatL(EDebugLevel0,_L("WARNING: %d messages detected in local folder when %d were expected"),iSelection->Count(),iSyncLimit);
+				iOpState=399;
+				break;
+				}
+
+			// Check that remote message count is what we expect it to be (= 1200)
+			User::LeaveIfError(iEntry->SetEntry(id));
+//			TMsvEmailEntry message=iEntry->Entry();
+//			test(message.RemoteFolderEntries()==KTestImapTestBigFolderSize);
+			NextState();
+			break;
+			}
+
+		case 314:
+			// Disconnect
+			DoDisconnectL();
+			NextState();
+			break;
+
+		case 315:
+			{
+			TTime theCurrentTime;
+			theCurrentTime.UniversalTime();
+			TTimeIntervalSeconds interval;
+			theCurrentTime.SecondsFrom(iTimeStamp,interval);
+
+			DebugFormatL(EDebugLevel0,_L("%d,%d"),iSyncLimit,interval.Int());
+			if (iSyncLimit<KTestImapTestBigFolderSize)
+				{
+				iSyncLimit+=KTestImapSyncIncrementSize;
+				iOpState=310;
+				}
+			else
+				NextState(10);
+			break;
+			}
+
+
+		case 399:
+			// Disconnect
+			DoDisconnectL();
+			NextState();
+			break;
+
+#if 0
+			// ----------------------------------------------------------------------------------- //
+
+			// The following test case doesn't actually test anything
+			// currently as it would fail. It was a testbed to
+			// reproduce the problem and may become a test case if the
+			// problem is fixed.
+			
+		case 400:			
+			// Connect and unsubscribe 
+			iTestUtils->TestStart(iTestNum, _L(""));
+
+			SetSubscriptionsL( EUseCombination, EUpdateNeither );
+
+			// Set synchronisation settings to "sync to all".
+			ModifyImap4SynchronisationLimitsL(KImImapSynchroniseAll,KImImapSynchroniseAll);
+	
+			DoConnectL();
+			NextState();
+			break;
+
+		case 401:
+			test(iStatus.Int()==KErrNone);
+			id = FindFolderByNameL(iServiceId, _L("TestInbox"));
+			PerformSpecialOpL(id, KIMAP4MTMSelect);
+			NextState();
+			break;
+
+		case 402:			
+			// Synchronise with remote inbox
+			test(iStatus.Int()==KErrNone);
+			id = FindFolderByNameL(iServiceId, _L("TestInbox"));
+			PerformSpecialOpL(id, KIMAP4MTMSynchronise);
+			NextState();
+			break;
+
+		case 403:
+			// Disconnect
+			DoDisconnectL();
+			NextState();
+			break;
+
+		case 404:			
+			// Set synchronisation settings to 10
+			ModifyImap4SynchronisationLimitsL(10,10);
+
+			DoConnectL();
+			NextState();
+			break;
+
+		case 405:
+			test(iStatus.Int()==KErrNone);
+			id = FindFolderByNameL(iServiceId, _L("TestInbox"));
+			PerformSpecialOpL(id, KIMAP4MTMSelect);
+			NextState();
+			break;
+
+		case 406:			
+			// Synchronise with remote inbox
+			test(iStatus.Int()==KErrNone);
+			id = FindFolderByNameL(iServiceId, _L("TestInbox"));
+			PerformSpecialOpL(id, KIMAP4MTMSynchronise);
+			NextState();
+			break;
+
+		case 407:
+			// Build list of messages in "TestInbox".
+			id = FindFolderByNameL(iServiceId, _L("TestInbox"));
+			User::LeaveIfError(iEntry->SetEntry(id));
+			User::LeaveIfError(iEntry->GetChildren(*iSelection));
+
+			// Check that "TestInbox" is full
+			DebugFormatL(EDebugLevel1,_L("'TestInbox' contains %d messages when 20 expected"),iSelection->Count());
+			test(iSelection->Count()==KTestImapTestInboxSize);
+
+			// select first 3 only
+			iSelection->Delete(3,iSelection->Count()-3);
+
+			// populate
+				{
+				TPckgBuf<TImap4GetMailOptions> package(EGetImap4EmailBodyTextAndAttachments);
+				iDestFolder=0;
+				PerformOpL( EImap4OpPopulate, package );
+				}
+			NextState();
+			break;
+			
+
+		case 408:
+			// should check the 3 messages are populated correctly
+			// however it will fail currently
+
+			// Disconnect
+			DoDisconnectL();
+			NextState(100);
+			break;
+#endif
+			// ----------------------------------------------------------------------------------- //
+
+		case 400:
+			test(iStatus.Int() == KErrNone);
+
+			iTestUtils->TestFinish(iTestNum++);
+
+			// done
+			iTestUtils->TestHarnessCompleted();
+			EndOfTest();  
+			// done
+			test.Console()->SetPos(0, 13);
+			test.Printf(_L("Finished sync test\n"));
+			more = EFalse;
+			break;
+
+		default:
+			iOpState=400;
+			break;
+			}
+		}
+	return more; 
+	}
+
+void CTestRefreshMBox::DoNSynchronisationRegressionL()
+	{
+	if (iServiceId==NULL)
+		{
+		test.Printf(_L("No service ID\n"));
+		return;
+		}
+
+	iOpState = 0;
+	iState = EImapTestNSynchronisation;
+	StateMachineNSynchronisationL();
+	}
+
+void CTestRefreshMBox::DoNSynchronisationTestsL()
+	{
+	if (iServiceId==NULL)
+		{
+		test.Printf(_L("No service ID\n"));
+		return;
+		}
+
+	iOpState = 100;
+	iState = EImapTestNSynchronisation;
+	StateMachineNSynchronisationL();
+	}
+
+void CTestRefreshMBox::DoNSynchronisationSpecialTestsL()
+	{
+	if (iServiceId==NULL)
+		{
+		test.Printf(_L("No service ID\n"));
+		return;
+		}
+
+	iOpState = 200;
+	iState = EImapTestNSynchronisation;
+	StateMachineNSynchronisationL();
+	}
+
+void CTestRefreshMBox::DoNSynchronisationPerformanceTestsL()
+	{
+	if (iServiceId==NULL)
+		{
+		test.Printf(_L("No service ID\n"));
+		return;
+		}
+
+	iOpState = 300;
+	iState = EImapTestNSynchronisation;
+	iSyncLimit = KTestImapSyncIncrementSize;
+	StateMachineNSynchronisationL();
+	}
+
+void CTestRefreshMBox::DoNSynchronisationOneOffTestsL()
+	{
+	if (iServiceId==NULL)
+		{
+		test.Printf(_L("No service ID\n"));
+		return;
+		}
+
+	iOpState = 400;
+	iState = EImapTestNSynchronisation;
+	iSyncLimit = KImImapSynchroniseAll;
+	StateMachineNSynchronisationL();
+	}
+
+/* ----------------------------------------------------------------------- */
+
+void CTestRefreshMBox::QueueOpL(TImap4OpType aOpType)
+	{
+	TMsvId srcFolder, destination;
+	TestFolders(aOpType, srcFolder, destination);
+	
+	TPtrC msgName = TestMsgName(aOpType);
+	TMsvId id = FindMessageByNameL(srcFolder, msgName);
+	if (id == KErrNotFound)
+		{
+		test.Printf(_L("Can't find message %S\n"), &msgName);
+		return;
+		}
+	
+	iSelection->Reset();
+	iSelection->InsertL(0, id);
+	
+	iState = EImapTestOffLineOp;
+
+	switch (aOpType)
+		{
+	case EImap4OpCopyToLocal:
+		iImppServerMtm->CopyToLocalL(*iSelection, destination, iStatus);
+		break;
+	case EImap4OpCopyFromLocal:
+		iImppServerMtm->CopyFromLocalL(*iSelection, destination, iStatus);
+		break;
+	case EImap4OpCopyWithinService:
+	case EImap4OpCopyWithinFolder:
+		iImppServerMtm->CopyWithinServiceL(*iSelection, destination, iStatus);
+		break;
+			
+	case EImap4OpMoveToLocal:
+		iImppServerMtm->MoveToLocalL(*iSelection, destination, iStatus);
+		break;
+	case EImap4OpMoveFromLocal:
+		iImppServerMtm->MoveFromLocalL(*iSelection, destination, iStatus);
+		break;
+	case EImap4OpMoveWithinService:
+	case EImap4OpMoveWithinServiceToInbox:
+		iImppServerMtm->MoveWithinServiceL(*iSelection, destination, iStatus);
+		break;
+
+	case EImap4OpDelete:
+		iImppServerMtm->DeleteAllL(*iSelection, iStatus);
+		break;
+
+	case EImap4OpUndelete:
+		break;
+
+	case EImap4OpPopulate:
+		{
+		TBuf8<128> paramBuf(_L8(""));
+		iImppServerMtm->StartCommandL(*iSelection, KIMAP4MTMPopulate, paramBuf, iStatus);
+		break;
+		}
+
+	default:
+		break;
+		}
+
+	SetActive();
+	}
+
+void CTestRefreshMBox::QueueLocalToLocalOpL(TImap4OpType aOpType)
+	{
+	TMsvId srcFolder, dummy;
+
+	TImap4OpType origOpType = aOpType == EImap4OpCopyToLocal ?
+		EImap4OpCopyFromLocal :
+		EImap4OpMoveFromLocal;
+
+	// source of the operation is the destination of the previous op
+	TestFolders(origOpType, dummy, srcFolder);
+
+	// destination is the local test folder
+	TMsvId destination = iLocalFolder1;
+	
+	TPtrC msgName = TestMsgName(origOpType);
+	TMsvId id = FindMessageByNameL(srcFolder, msgName);
+
+	// park
+	User::LeaveIfError(iEntry->SetEntry( NULL ));
+	
+	iSelection->Reset();
+	iSelection->InsertL(0, id);
+	
+	// server mtm commands can complete before returning
+	iState = EImapTestOffLineOp;
+	SetActive();
+
+	switch (aOpType)
+		{
+	case EImap4OpCopyToLocal:
+		iImppServerMtm->CopyToLocalL(*iSelection, destination, iStatus);
+		break;
+			
+	case EImap4OpMoveToLocal:
+		iImppServerMtm->MoveToLocalL(*iSelection, destination, iStatus);
+		break;
+
+	default:
+		break;
+		}
+	}
+
+void CTestRefreshMBox::UnQueueOpL(TImap4OpType aOpType)
+	{
+	TMsvId srcFolder, destination;
+	TestFolders(aOpType, destination, srcFolder);
+
+	TPtrC msgName = TestMsgName(aOpType);
+	TMsvId id = FindMessageByNameL(srcFolder, msgName);
+	
+	iSelection->Reset();
+	iSelection->InsertL(0, id);
+	
+	// server mtm commands can complete before returning
+	iState = EImapTestOffLineOp;
+	SetActive();
+
+	switch (aOpType)
+		{
+	case EImap4OpCopyToLocal:
+		iImppServerMtm->DeleteAllL(*iSelection, iStatus);
+		break;
+	case EImap4OpCopyFromLocal:
+		iImppServerMtm->DeleteAllL(*iSelection, iStatus);
+		break;
+	case EImap4OpCopyWithinService:
+		iImppServerMtm->DeleteAllL(*iSelection, iStatus);
+		break;
+			
+	case EImap4OpMoveToLocal:
+		iImppServerMtm->MoveFromLocalL(*iSelection, destination, iStatus);
+		break;
+	case EImap4OpMoveFromLocal:
+		iImppServerMtm->MoveToLocalL(*iSelection, destination, iStatus);
+		break;
+	case EImap4OpMoveWithinService:
+		iImppServerMtm->MoveWithinServiceL(*iSelection, destination, iStatus);
+		break;
+
+	case EImap4OpDelete:
+		{
+		TBuf8<128> paramBuf(_L8(""));
+		iImppServerMtm->StartCommandL(*iSelection,KIMAP4MTMUndeleteAll,paramBuf,iStatus);
+		break;
+		}
+
+	case EImap4OpPopulate:
+	case EImap4OpUndelete:
+		break;
+
+	default:
+		break;
+		}
+
+	// park
+	User::LeaveIfError(iEntry->SetEntry( NULL ));
+	}
+
+void CTestRefreshMBox::DoRenameFolderL()
+	{
+	TImap4RenameFolder cmd;
+	cmd.iNewName = iRenamedFolder ? _L("Test1") : _L("Test1Renamed");
+
+	test.Console()->SetPos(0, 13);
+	test.Console()->Printf(_L("DoRenamefolder to %S\n"), &cmd.iNewName);
+
+	iSelection->Reset();
+	iSelection->InsertL(0, iRemoteFolder1);
+
+	iState = EImapTestRenameFolder;
+	SetActive();
+
+	TPckgBuf<TImap4RenameFolder> package(cmd);
+	iImppServerMtm->StartCommandL(*iSelection,KIMAP4MTMRenameFolder,package,iStatus);
+
+	iRenamedFolder = !iRenamedFolder;
+	}
+
+void CTestRefreshMBox::RunL()
+	{
+	TInt anError=iStatus.Int();
+
+	test.Console()->SetPos(0, 13);
+	test.Console()->Printf(_L("                                           "));
+	test.Console()->SetPos(0, 13);
+	
+	switch(iState)
+		{
+	case EImapTestConnectAndSync:
+		test.Console()->Printf(_L("Connected: err %d (%d)\n"),anError);
+		if (anError == KErrNone)
+			{
+			iState = EImapTestWaitForBackground;
+			StartL();
+			}
+		else
+			ClearTimer();
+		break;
+
+	case EImapTestFetchInbox:
+		test.Console()->Printf(_L("FetchedInbox: err %d\n"),anError);
+		
+		ClearTimer();
+		break;
+			
+	case EImapTestDisconnect:
+		test.Console()->Printf(_L("Disconnected: err %d\n"),anError);
+
+		ClearTimer();
+		break;
+
+	case EImapTestOffLineOp:
+		test.Console()->Printf(_L("Done OffLineOp %d\n"),anError);
+		break;
+
+	case EImapTestWaitForBackground:
+		test.Console()->Printf(_L("Background Sync finished %d\n"),anError);
+		
+		ClearTimer();
+		break;
+		
+	case EImapTestFetchAttachment:
+		test.Console()->Printf(_L("Fetch attachment finished %d\n"),anError);
+		
+		ClearTimer();
+		break;
+
+	case EImapTestFetchAttachedMessage:
+		test.Console()->Printf(_L("Fetch attached message finished %d\n"),anError);
+		
+		ClearTimer();
+		break;
+
+	case EImapTestCancelOffLineOps:
+		test.Console()->Printf(_L("Cancelled offline ops %d\n"),anError);
+		break;
+		
+	case EImapTestRenameFolder:
+		test.Console()->Printf(_L("Renamed folder %d\n"),anError);
+		break;
+		
+	case EImapTestAutoOffLineOp:
+		{
+		test.Console()->Printf(_L("Done Op %d next state %d\n"),anError,iOpState);
+
+		TBool more = EFalse;
+		TRAPD(err, more = HandleOffLineStateL());
+		if (err != KErrNone)
+			test.Console()->Printf(_L("Op left with error %d\n"), err);
+		if (!more)
+			test.Console()->Printf(_L("Completed Offline tests %d\n"),anError);
+		break;
+		}
+	
+	case EImapTestAutoSyncOp:
+		{
+		test.Console()->Printf(_L("Done Op %d next state %d\n"),anError,iOpState);
+
+		TBool more = EFalse;
+		TRAPD(err, more = HandleSyncStateL());
+		if (err != KErrNone)
+			test.Console()->Printf(_L("Op left with error %d\n"), err);
+		if (!more)
+			{
+			test.Console()->Printf(_L("Completed Sync tests %d\n"),anError);
+			ClearTimer();
+			}
+		break;
+		}
+	
+	case EImapTestAutoSecondaryConnect:
+		{
+		test.Console()->Printf(_L("Done Op %d next state %d\n"),anError,iOpState);
+
+		TBool more = EFalse;
+		TRAPD(err, more = TestSecondaryConnectStateMachineL());
+		if (err != KErrNone)
+			test.Console()->Printf(_L("Op left with error %d\n"), err);
+		if (!more)
+			{
+			test.Console()->Printf(_L("Completed SecondaryConnect tests %d\n"),anError);
+			ClearTimer();
+			}
+		break;
+		}
+	
+	case EImapTestCheckServerContents:
+		{
+		test.Console()->Printf(_L("Done Op %d next state %d\n"),anError,iOpState);
+
+		TBool more = EFalse;
+		TRAPD(err, more = StateMachineCheckServerContentsL());
+		if (err != KErrNone)
+			test.Console()->Printf(_L("Op left with error %d\n"), err);
+		if (!more)
+			{
+			test.Console()->Printf(_L("Completed CheckServerContents tests %d\n"),anError);
+			ClearTimer();
+			}
+		break;
+		}
+
+	case EImapTestNSynchronisation:
+		{
+		test.Console()->Printf(_L("Done Op %d next state %d\n"),anError,iOpState);
+
+		TBool more = EFalse;
+		TRAPD(err, more = StateMachineNSynchronisationL());
+		if (err != KErrNone)
+			test.Console()->Printf(_L("Op left with error %d\n"), err);
+		if (!more)
+			{
+			test.Console()->Printf(_L("Completed N-Synchronisation Tests %d\n"),anError);
+			ClearTimer();
+			}
+		break;
+		}
+	
+	case EImapTestFetchTest:
+		test.Console()->Printf(_L("Fetched test message: err %d\n"),anError);
+		ClearTimer();
+		break;
+
+	case EImapTestFolderDelete:
+		test.Console()->Printf(_L("Folder deleted: err %d\n"),anError);
+		ClearTimer();
+		break;
+		
+	case EImapTestFolderCreate:
+		test.Console()->Printf(_L("Folder created: err %d\n"),anError);
+		ClearTimer();
+		break;
+		
+	default:
+		test.Console()->Printf(_L("Command in state %d completed: err %d\n"),iState,anError);
+		ClearTimer();
+		break;
+		}
+	}
+
+
+// --------------------------------------------------------------------------
+
+CImImap4Settings* CTestRefreshMBox::GetImap4SettingsLC()
+	{
+	SelectServiceIdL();
+
+	TBool setTimer = (iTimer != NULL);
+	ClearTimer();	
+	iTestUtils->GoClientSideL();
+	
+	CImImap4Settings* settings = new (ELeave)CImImap4Settings();
+	CleanupStack::PushL(settings);
+	CEmailAccounts* accounts = CEmailAccounts::NewLC();
+	TImapAccount imapAccountId;
+	accounts->GetImapAccountL(iServiceId, imapAccountId);
+	accounts->LoadImapSettingsL(imapAccountId, *settings);
+	CleanupStack::PopAndDestroy(); // fileStore/accounts
+
+	// go server side
+	iTestUtils->GoServerSideL();
+	iEntry = iTestUtils->iServerEntry;
+	iTestUtils->InstantiateImapServerMtmL();
+	iImppServerMtm = iTestUtils->iImapServerMtm;
+	User::LeaveIfError(iEntry->SetEntry(iServiceId));
+	
+	// start the display timer	
+	if (setTimer)
+		StartTimerL();	
+
+	return settings;
+	}
+	
+void CTestRefreshMBox::SetSubscriptionsL( TFolderSyncType aSync, TFolderSubscribeType aSubscribe )
+	{
+	SelectServiceIdL();
+
+	TBool setTimer = (iTimer != NULL);
+	ClearTimer();	
+	iTestUtils->GoClientSideL();
+	
+	CImImap4Settings* settings = new (ELeave)CImImap4Settings();
+	CleanupStack::PushL(settings);
+
+	CEmailAccounts* accounts = CEmailAccounts::NewLC();
+	TImapAccount imapAccountId;
+	accounts->GetImapAccountL(iServiceId, imapAccountId);
+	accounts->LoadImapSettingsL(imapAccountId, *settings);
+
+	settings->SetSynchronise(aSync);
+	settings->SetSubscribe(aSubscribe);
+
+	accounts->SaveImapSettingsL(imapAccountId, *settings);
+
+	CleanupStack::PopAndDestroy(2, settings); // fileStore/accounts, settings
+	
+	// go server side
+	iTestUtils->GoServerSideL();
+	iEntry = iTestUtils->iServerEntry;
+	iTestUtils->InstantiateImapServerMtmL();
+	iImppServerMtm = iTestUtils->iImapServerMtm;
+	User::LeaveIfError(iEntry->SetEntry(iServiceId));
+
+	// start the display timer	
+	if (setTimer)
+		StartTimerL();	
+	}
+
+// --------------------------------------------------------------------------
+
+void CTestRefreshMBox::ModifyImap4SynchronisationLimitsL(TInt aInboxSyncLimit,TInt aMailboxSyncLimit)
+	{
+	DebugFormatL(EDebugLevel2,_L("  Modifying synchronisation limits: Inbox=%d, Folders=%d"),aInboxSyncLimit,aMailboxSyncLimit);
+
+	// Already have a service id
+	User::LeaveIfError(iEntry->SetEntry(iServiceId));
+
+	TBool setTimer = (iTimer != NULL);
+	ClearTimer();	
+	iTestUtils->GoClientSideL();
+
+	CImImap4Settings* settings = new CImImap4Settings();
+	CleanupStack::PushL(settings);
+
+	CEmailAccounts* accounts = CEmailAccounts::NewLC();
+	TImapAccount imapAccountId;
+	accounts->GetImapAccountL(iServiceId, imapAccountId);
+	accounts->LoadImapSettingsL(imapAccountId, *settings);
+
+	settings->SetInboxSynchronisationLimit(aInboxSyncLimit);
+	settings->SetMailboxSynchronisationLimit(aMailboxSyncLimit);
+
+	accounts->SaveImapSettingsL(imapAccountId, *settings);
+
+	CleanupStack::PopAndDestroy(2, settings); // entryStore/accounts, settings
+	
+	// go server side
+	iTestUtils->GoServerSideL();
+	iEntry = iTestUtils->iServerEntry;
+	iTestUtils->InstantiateImapServerMtmL();
+	iImppServerMtm = iTestUtils->iImapServerMtm;
+	User::LeaveIfError(iEntry->SetEntry(iServiceId));
+
+	// start the display timer	
+	if (setTimer)
+		StartTimerL();	
+	}
+
+void CTestRefreshMBox::FindImap4SettingsL()
+	{
+	TMsvId serviceId = 0;
+	TMsvId inboxId = 0;
+	TMsvId test1Id = 0;
+	TMsvId test2Id = 0;
+	TMsvId localtestId = 0;
+
+	// Search for first IMAP service entry
+	CMsvEntrySelection *contents=new CMsvEntrySelection;
+	CleanupStack::PushL(contents);
+
+ 	iEntry->SetEntry( KMsvRootIndexEntryId );
+	
+	iEntry->GetChildren(*contents);
+	TInt a,noofchildren=contents->Count();
+	if (noofchildren==0)
+		{
+		test.Printf(_L("No root children to examine\n"));
+		}
+	else
+		{
+		// Scan children to find first last service entry
+		for(a=0;a<noofchildren;a++)
+			{
+			iEntry->SetEntry((*contents)[a]);
+			if (iEntry->Entry().iType==KUidMsvServiceEntry &&
+				iEntry->Entry().iMtm==KUidMsgTypeIMAP4)
+				{
+				// Found it!
+				serviceId=(*contents)[a];
+				}
+			}
+
+		if (serviceId)
+			{
+			// Find inbox
+			iEntry->GetChildren(*contents);
+			noofchildren=contents->Count();
+			for(a=0;a<noofchildren;a++)
+				{
+				iEntry->SetEntry((*contents)[a]);
+				if (iEntry->Entry().iDetails.Compare(_L("Inbox"))==0)
+					inboxId=(*contents)[a];
+				
+				if (iEntry->Entry().iDetails.Compare(_L("Test1"))==0)
+					test1Id=(*contents)[a];
+
+				if (iEntry->Entry().iDetails.Compare(_L("Test2"))==0)
+					test2Id=(*contents)[a];
+				}
+			}
+		
+		iEntry->SetEntry( KMsvLocalServiceIndexEntryId );
+		iEntry->GetChildren(*contents);
+		noofchildren=contents->Count();
+		for(a=0;a<noofchildren;a++)
+			{
+			iEntry->SetEntry((*contents)[a]);
+			if (iEntry->Entry().iDetails.Compare(_L("LocalTest"))==0)
+				localtestId=(*contents)[a];
+			}
+		}
+
+	if (serviceId && inboxId/* && localtestId*/)
+		{
+		iServiceId = serviceId;
+		iRemoteInbox = inboxId;
+		iRemoteFolder1 = test1Id;
+		iRemoteFolder2 = test2Id;
+		iLocalFolder1 = localtestId;
+		test.Printf(_L("Service 0x%x inbox 0x%x Test1 0x%x Test2 0x%x"), iServiceId, iRemoteInbox, iRemoteFolder1, iRemoteFolder2);
+		}
+	else
+		{
+		test.Printf(_L("Couldn't find one of IMAP service entry, INBOX or Test Folders\nPress any key..."));
+		test.Getch();
+		}
+
+	CleanupStack::PopAndDestroy(); // contents
+
+	User::LeaveIfError(iEntry->SetEntry(NULL));
+	}
+
+
+void CTestRefreshMBox::CreateDefaultServiceL(CImImap4Settings* aSettings)
+	{
+	// need to be client side
+	iTestUtils->GoClientSideL();
+
+	// to create email accounts
+	CEmailAccounts* accounts = CEmailAccounts::NewLC();
+
+	// use test utilities to create 'default' service
+	iServiceId = iTestUtils->CreateImapServiceL();
+
+	// load default settings
+	TImapAccount imapAccountId;
+	accounts->GetImapAccountL(iServiceId, imapAccountId);
+	accounts->LoadImapSettingsL(imapAccountId, *aSettings);
+	
+	// cleanup
+	CleanupStack::PopAndDestroy(accounts);
+	}
+
+void CTestRefreshMBox::CreateServiceL(const CImImap4Settings* aSettings,
+									  const TDesC& aDetails, 
+									  const TDesC& aDescription,
+									  const TBool aLocalOnly)
+	{
+	// this has to go before the Set's apparently
+	iTestUtils->iMsvEntry->SetEntryL(KMsvRootIndexEntryId);
+
+	if (!aLocalOnly)
+		{
+		// to create email accounts
+		CEmailAccounts* accounts = CEmailAccounts::NewLC();
+		
+		// use test utilities to find 'default' service
+		iServiceId = iTestUtils->FindImapServiceL();
+
+		// update details/description
+		iTestUtils->iMsvEntry->SetEntryL(iServiceId);		
+		TMsvEntry entry = iTestUtils->iMsvEntry->Entry();
+		entry.iDetails.Set(aDetails);
+		entry.iDescription.Set(aDescription);
+		iTestUtils->iMsvEntry->ChangeL(entry);		
+
+		// update settings
+		TImapAccount imapAccountId;
+		accounts->GetImapAccountL(iServiceId, imapAccountId);
+		accounts->SaveImapSettingsL(imapAccountId, *aSettings);
+		CleanupStack::PopAndDestroy(accounts);
+		}
+
+	// go back to server side
+	iTestUtils->GoServerSideL();
+	iEntry = iTestUtils->iServerEntry;
+	iTestUtils->InstantiateImapServerMtmL();
+	iImppServerMtm = iTestUtils->iImapServerMtm;
+	User::LeaveIfError(iEntry->SetEntry(iServiceId));
+
+	// Create inbox
+	TMsvEmailEntry msg;
+	msg.iType=KUidMsvFolderEntry;
+	msg.iMtm=KUidMsgTypeIMAP4;
+	msg.iServiceId=iServiceId;
+	msg.SetMtmData1(0);
+	msg.SetMtmData2(0);
+	msg.SetMtmData3(0);
+	msg.iSize=0;
+	msg.SetUID(0);
+	msg.SetValidUID(EFalse);
+	msg.SetMailbox(ETrue);
+	if (!aLocalOnly)
+		{
+		msg.iDetails.Set(_L("INBOX"));
+		User::LeaveIfError(iEntry->CreateEntry(msg));
+		iRemoteInbox=msg.Id();
+		}
+	
+	User::LeaveIfError(iEntry->SetEntry(KMsvLocalServiceIndexEntryId));
+	msg.iDetails.Set(_L("LocalTest"));
+	User::LeaveIfError(iEntry->CreateEntry(msg));
+	iLocalFolder1=msg.Id();
+
+	// park
+	User::LeaveIfError(iEntry->SetEntry(KMsvNullIndexEntryId));	
+	}
+	
+
+
+// --------------------------------------------------------------------------
+
+
+// ActiveConsole definitions
+
+CActiveConsole* CActiveConsole::NewLC(CTestRefreshMBox *aRefresher,CCommandLineArguments* aCmdLineArgs)
+	{
+	CActiveConsole* self = new(ELeave) CActiveConsole();
+	CleanupStack::PushL(self);
+	self->iRefresher = aRefresher;
+	self->iCmdLineArgs = aCmdLineArgs;
+	self->iLevel = EArgMainMenu;
+	self->iIssueCancel = TRUE;
+	self->ConstructL();
+	return self;
+	}
+
+CActiveConsole::CActiveConsole()
+	:CActive(0)
+	{
+	}
+
+void CActiveConsole::ConstructL()
+	{
+	// add any other initialisation here
+	CActiveScheduler::Add(this);
+	DisplayMainMenu();
+	}
+
+CActiveConsole::~CActiveConsole()
+	{
+	Cancel();
+	}
+
+void CActiveConsole::DoCancel()
+	{
+	test.Console()->ReadCancel();
+	}
+
+void CActiveConsole::RequestCharacter()
+    {
+	test.Console()->Read(iStatus); 
+    SetActive();
+    }
+
+LOCAL_C TBool MatchSubscribed(CMsvServerEntry* aEntry)
+	{
+	TMsvEmailEntry entry = aEntry->Entry();
+	return entry.Subscribed() || entry.LocalSubscription();
+	}
+
+LOCAL_C TBool MatchQueue(CMsvServerEntry* aEntry)
+	{
+	TBool match = EFalse;
+	if (aEntry->HasStoreL())
+		{
+		CMsvStore* fileStore = aEntry->ReadStoreL();
+		CleanupStack::PushL(fileStore);
+
+		match = fileStore->IsPresentL(KUidImQueuedOperationList);
+
+		CleanupStack::PopAndDestroy();
+		}
+	return match;
+	}
+
+void CActiveConsole::ProcessKeyPressL(TChar aChar) 
+	{
+	if (iCmdLineArgs)
+		{
+		TLex lex(iCmdLineArgs->Arg(iLevel++));
+		aChar=lex.Get();
+		}
+	switch (iMenuState)
+		{
+	case EMainMenu:
+		switch (aChar)
+			{
+		case '1':
+			DisplayImap4ServerMenu();
+			break;
+		case '2':
+			if (iRefresher->iServiceId)
+				DisplayImap4SettingsMenu();
+			break;
+		case '3':
+			if (iRefresher->iServiceId)
+				DisplayConnectMenu();
+			break;
+		case '4':
+			if (iRefresher->iServiceId)
+				DisplayOffLineOpMenu();
+			break;
+		case '5':
+			DisplayImap4DumpMenu();
+			break;
+		case '6':
+			DisplayHousekeepingMenu();
+			break;
+		case '7':
+			DisplayAutomationMenu();
+			break;
+		case '8':
+			DisplaySynchroniseMenu();
+			break;
+		case '9':
+			DisplayDebugMenu();
+			break;
+
+		case 'r':
+		case 'R':
+			DisplayMainMenu();
+			break;
+			
+		case 'X':
+		case 'x':
+			iMenuState=EExit;
+			break;
+			}
+		break;
+
+	case EImap4DumpMenu:
+		switch (aChar)
+			{
+		case '1':
+			DumpMessageStructureL( KMsvRootIndexEntryId,
+								  CMsgOutputter::EToOneFile,
+								  CMsgOutputter::ENone,
+								  ETrue, ETrue );
+			break;
+		case '2':
+			if (iRefresher->iServiceId)
+				DumpMessageStructureL( iRefresher->iServiceId,
+									  CMsgOutputter::EToScreen,
+									  CMsgOutputter::ENone,
+									  ETrue, ETrue,
+									  MatchSubscribed );
+			break;
+		case '3':
+			if (iRefresher->iServiceId)
+				DumpMessageStructureL( iRefresher->iServiceId,
+									  CMsgOutputter::EToScreen,
+									  CMsgOutputter::EToOneFile,
+									  ETrue, ETrue,
+									  MatchQueue );
+			break;
+		case 'r':
+		case 'R':
+			DisplayImap4DumpMenu();
+			break;
+			
+		case 'X':
+		case 'x':
+			DisplayMainMenu();
+			break;
+			}
+		break;
+
+	case EImap4ServerMenu:
+		switch (aChar)
+			{
+		case 'r':
+		case 'R':
+			DisplayImap4ServerMenu();
+			break;
+			
+		case 'X':
+		case 'x':
+			DisplayMainMenu();
+			break;
+
+		default:
+			SelectImap4ServerEntryL(aChar);	
+			break;
+			}
+		break;
+
+	case EImap4SettingsMenu:
+		switch (aChar)
+			{
+		case 'r':
+		case 'R':
+			DisplayImap4SettingsMenu();
+			break;
+			
+		case 'X':
+		case 'x':
+			DisplayMainMenu();
+			break;
+
+		case '0':
+			DumpMessageStructureL( iRefresher->iServiceId,
+								  CMsgOutputter::ENone,
+								  CMsgOutputter::EToScreen,
+								  EFalse, ETrue );
+			break;
+			
+		default:
+			SelectImap4SettingsEntryL(aChar);	
+			break;
+			}			
+		break;
+
+	case EHousekeepingMenu:
+		switch (aChar)
+			{
+		case 'r':
+		case 'R':
+			DisplayHousekeepingMenu();
+			break;
+			
+		case 'X':
+		case 'x':
+			DisplayMainMenu();
+			break;
+			
+		default:
+			SelectImap4SettingsEntryL(aChar);	
+			break;
+			}			
+		break;
+
+	case EOffLineOpMenu:
+		switch (aChar)
+			{
+		case 'r':
+		case 'R':
+			DisplayOffLineOpMenu();
+			break;
+			
+		case 'X':
+		case 'x':
+			DisplayMainMenu();
+			break;
+
+		case '1':
+			DisplayOffLineOpQueueMenu();
+			break;
+		case '2':
+			DisplayOffLineOpUnQueueMenu();
+			break;
+		case '3':
+			DisplayOffLineOpQueueLocalToLocalMenu();
+			break;
+		case '4':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestCancelOffLineOps);
+			break;
+		case '5':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestAutoOffLineOp);
+			break;
+			
+		case '6':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestAutoSyncOp);
+			break;
+			
+		default:
+			break;
+			}			
+		break;
+
+	case EOffLineOpQueueMenu:
+		switch (aChar)
+			{
+		case 'r':
+		case 'R':
+			DisplayOffLineOpQueueMenu();
+			break;
+			
+		case 'X':
+		case 'x':
+			DisplayOffLineOpMenu();
+			break;
+
+		case '1':
+			iRefresher->QueueOpL(EImap4OpCopyToLocal);
+			break;
+		case '2':
+			iRefresher->QueueOpL(EImap4OpCopyFromLocal);
+			break;
+		case '3':
+			iRefresher->QueueOpL(EImap4OpCopyWithinService);
+			break;
+			
+		case '4':
+			iRefresher->QueueOpL(EImap4OpMoveToLocal);
+			break;
+		case '5':
+			iRefresher->QueueOpL(EImap4OpMoveFromLocal);
+			break;
+		case '6':
+			iRefresher->QueueOpL(EImap4OpMoveWithinService);
+			break;
+
+		case '7':
+			iRefresher->QueueOpL(EImap4OpDelete);
+			break;
+		case '8':
+			iRefresher->QueueOpL(EImap4OpCopyWithinFolder);
+			break;
+			
+		default:
+			break;
+			}			
+		break;
+
+	case EOffLineOpQueueLocalToLocalMenu:
+		switch (aChar)
+			{
+		case 'r':
+		case 'R':
+			DisplayOffLineOpQueueLocalToLocalMenu();
+			break;
+			
+		case 'X':
+		case 'x':
+			DisplayOffLineOpMenu();
+			break;
+
+		case '1':
+			iRefresher->QueueLocalToLocalOpL(EImap4OpCopyToLocal);
+			break;
+		case '2':
+			iRefresher->QueueLocalToLocalOpL(EImap4OpMoveToLocal);
+			break;
+
+		default:
+			break;
+			}			
+		break;
+
+	case EOffLineOpUnQueueMenu:
+		switch (aChar)
+			{
+		case 'r':
+		case 'R':
+			DisplayOffLineOpUnQueueMenu();
+			break;
+			
+		case 'X':
+		case 'x':
+			DisplayOffLineOpMenu();
+			break;
+
+		case '1':
+			iRefresher->UnQueueOpL(EImap4OpCopyToLocal);
+			break;
+		case '2':
+			iRefresher->UnQueueOpL(EImap4OpCopyFromLocal);
+			break;
+		case '3':
+			iRefresher->UnQueueOpL(EImap4OpCopyWithinService);
+			break;
+			
+		case '4':
+			iRefresher->UnQueueOpL(EImap4OpMoveToLocal);
+			break;
+		case '5':
+			iRefresher->UnQueueOpL(EImap4OpMoveFromLocal);
+			break;
+		case '6':
+			iRefresher->UnQueueOpL(EImap4OpMoveWithinService);
+			break;
+
+		case '7':
+			iRefresher->UnQueueOpL(EImap4OpDelete);
+			break;
+			
+		default:
+			break;
+			}			
+		break;
+
+	case EConnectMenu:
+		switch (aChar)
+			{
+		case 'r':
+		case 'R':
+			DisplayConnectMenu();
+			break;
+			
+		case 'X':
+		case 'x':
+			DisplayMainMenu();
+			break;
+
+		case '1':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestConnect);
+			break;
+		case '2':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestDisconnect);
+			break;
+		case '3':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestConnectAndSync);
+			break;
+		case '4':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestFullSync);
+			break;
+		case '5':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestSyncTree);
+			break;
+		case '6':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestFetchTest);
+			break;
+        case '7':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestLocalSubscribe);
+			break;
+        case '8':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestLocalUnsubscribe);
+			break;
+		case '0':
+			DisplayConnect2Menu();
+			break;
+			
+		default:
+			break;
+			}
+		break;
+			
+	case EConnect2Menu:
+		switch (aChar)
+			{
+		case 'r':
+		case 'R':
+			DisplayConnect2Menu();
+			break;
+			
+		case 'X':
+		case 'x':
+			DisplayConnectMenu();
+			break;
+
+		case '1':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestFetchInbox);
+			break;
+		case '2':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestFetchAttachment);
+			break;
+		case '3':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestRenameFolder);
+			break;
+		case '4':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestFolderDelete);
+			break;
+		case '5':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestFolderCreate);
+			break;
+		case '6':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestInboxNewSync);
+			break;
+		case '7':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestFetchAttachedMessage);
+			break;
+		case '8':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestCopyMessages);
+			break;
+		default:
+			break;
+			}			
+		break;
+
+	case EAutomationMenu:
+		switch (aChar)
+			{
+		case 'r':
+		case 'R':
+			DisplayAutomationMenu();
+			break;
+			
+		case 'X':
+		case 'x':
+			DisplayMainMenu();
+			break;
+
+		case '1':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestCheckServerContents);
+			break;
+			
+		case '2':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestAutoOffLineOp);
+			break;
+			
+		case '3':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestAutoSyncOp);
+			break;
+
+		case '4':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestAutoSecondaryConnect);
+			break;
+			
+		default:
+			break;
+			}			
+		break;
+
+	case ESynchroniseMenu:
+		switch (aChar)
+			{
+		case 'r':
+		case 'R':
+			DisplaySynchroniseMenu();
+			break;
+			
+		case 'X':
+		case 'x':
+			DisplayMainMenu();
+			break;
+
+		case '1':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestNSynchronisation);
+			break;
+			
+		case '2':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestNSynchronisationTests);
+			break;
+			
+		case '3':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestNSynchronisationSpecialTests);
+			break;
+
+		case '4':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestNSynchronisationPerformanceTests);
+			break;
+			
+		case '5':
+			iRefresher->EnterStateL(CTestRefreshMBox::EImapTestNSynchronisationOneOffTests);
+			break;
+			
+		default:
+			break;
+			}			
+		break;
+
+	case EDebugMenu:
+		switch (aChar)
+			{
+		case 'r':
+		case 'R':
+			DisplayDebugMenu();
+			break;
+			
+		case 'X':
+		case 'x':
+			DisplayMainMenu();
+			break;
+
+		case '1':
+			iRefresher->iDebugLevel=(iRefresher->iDebugLevel<EDebugLevel9?iRefresher->iDebugLevel+1:iRefresher->iDebugLevel);
+			DisplayDebugMenu();
+			break;
+			
+		case '2':
+			iRefresher->iDebugLevel=(iRefresher->iDebugLevel>EDebugLevel0?iRefresher->iDebugLevel-1:iRefresher->iDebugLevel);
+			DisplayDebugMenu();
+			break;
+
+		default:
+			break;
+			}			
+		break;
+		}
+	}
+
+void CActiveConsole::RunL() 
+	{
+ 	TRAPD(err,ProcessKeyPressL(TChar(test.Console()->KeyCode())));
+	if ( err != KErrNone )
+		test.Printf(_L("Something left with error %d\n"), err);
+	test(err == KErrNone);
+
+	if (iMenuState==EExit)
+		CActiveScheduler::Stop();
+	else
+		{
+ 		RequestCharacter();
+		if (iCmdLineArgs && iIssueCancel)
+			DoCancel();
+		}
+	}
+
+// --------------------------------------------------------------------------
+
+// Menu display functions
+
+void CActiveConsole::DisplayMainMenu()	
+	{
+	iMenuState=EMainMenu;
+	
+	test.Console()->ClearScreen();
+	test.Console()->SetPos(0, 0);
+	
+	test.Printf(_L("Options :\n\n"));
+	test.Printf(_L(" 1 : IMAP Server menu\n"));
+	if (iRefresher->iServiceId)
+		{
+		test.Printf(_L(" 2 : IMAP Settings menu\n"));
+		test.Printf(_L(" 3 : Connect\n"));
+		test.Printf(_L(" 4 : OffLine Ops\n"));
+		}
+	else
+		test.Printf(_L("\n\n\n"));
+	test.Printf(_L(" 5 : Dump menu\n"));
+	test.Printf(_L(" 6 : Housekeeping\n"));
+	if (iRefresher->iServiceId)
+		{
+		test.Printf(_L(" 7 : Automation\n"));
+		test.Printf(_L(" 8 : Synchronisation\n"));
+		}
+	test.Printf(_L(" 9 : Debug logging\n"));
+	test.Console()->SetPos(0, 12);
+	test.Printf(_L(" X : Exit\n"));
+	}
+
+void CActiveConsole::DisplayImap4ServerMenu()
+	{
+	if (iMenuState != EImap4ServerMenu)
+		{
+		iPrevState = iMenuState;
+		iMenuState = EImap4ServerMenu;
+		}
+	
+	test.Console()->ClearScreen();
+	test.Console()->SetPos(0,0);
+	test.Printf(_L("Options :\n\n"));
+	test.Printf(_L(" 0 : Trmai01 server uding SSLTLS\n"));
+	test.Printf(_L(" 1 : Use a previously created service entry\n"));
+	test.Printf(_L(" 2 : ANT IMAP server\n"));
+	test.Printf(_L(" 3 : Chaos IMAP server\n"));
+	test.Printf(_L(" 4 : Symbian PIPEX IMAP server\n"));
+	test.Printf(_L(" 5 : Dale's Totalise IMAP server\n"));
+	test.Printf(_L(" 6 : Innosoft TLS IMAP server\n"));
+	test.Printf(_L(" 7 : MS Imap test\n"));
+	test.Printf(_L(" 8 : NTMail test\n"));
+	test.Printf(_L(" a : lon-msgtest06.intra for Synchronise Tests\n"));
+	test.Console()->SetPos(0, 12);
+	test.Printf(_L(" X : Main menu\n"));
+	}
+
+void CActiveConsole::DisplayImap4DumpMenu()
+	{
+	if (iMenuState != EImap4DumpMenu)
+		{
+		iPrevState = iMenuState;
+		iMenuState = EImap4DumpMenu;
+		}
+
+	test.Console()->ClearScreen();
+	test.Console()->SetPos(0,0);
+	test.Printf(_L("Options :\n\n"));
+	test.Printf(_L(" 1 : Dump structure\n"));
+	test.Printf(_L(" 2 : Dump subscribed\n"));
+	test.Printf(_L(" 3 : Dump queued\n"));
+	test.Console()->SetPos(0, 12);
+	test.Printf(_L(" X : Main menu\n"));
+	}
+
+void CActiveConsole::DisplayImap4SettingsMenu()
+	{
+	if (iMenuState != EImap4SettingsMenu)
+		{
+		iPrevState = iMenuState;
+		iMenuState = EImap4SettingsMenu;
+		}
+	
+	test.Console()->ClearScreen();
+	test.Console()->SetPos(0,0);
+	test.Printf(_L("Options :\n\n"));
+	test.Printf(_L(" 1 : Set DisconnectedUserMode\n"));
+	test.Printf(_L(" 2 : Set SynchroniseStrategy\n"));
+	test.Printf(_L(" 3 : Set SubscribeStrategy\n"));
+	test.Printf(_L(" 4 : Set IAP index\n"));
+	test.Printf(_L(" 5 : Set Delete emails\n"));
+	test.Printf(_L(" 6 : Set Get Mail Options\n"));
+	test.Printf(_L(" 7 : Set SecureSockets\n"));
+	test.Printf(_L(" 8 : Set FolderPath\n"));
+	test.Printf(_L(" 9 : Set Password\n"));
+	test.Printf(_L(" 0 : Show settings\n"));
+	test.Console()->SetPos(0, 12);
+	test.Printf(_L(" X : Main menu\n"));
+	}
+
+void CActiveConsole::DisplayHousekeepingMenu()
+	{
+	if (iMenuState != EHousekeepingMenu)
+		{
+		iPrevState = iMenuState;
+		iMenuState = EHousekeepingMenu;
+		}
+
+	test.Console()->ClearScreen();
+	test.Console()->SetPos(0,0);
+	test.Printf(_L("Options :\n\n"));
+	test.Console()->SetPos(0, 12);
+	test.Printf(_L(" X : Main menu\n"));
+	}
+
+void CActiveConsole::DisplayOffLineOpMenu()
+	{
+	if (iMenuState != EOffLineOpMenu)
+		{
+		iPrevState = iMenuState;
+		iMenuState = EOffLineOpMenu;
+		}
+
+	test.Console()->ClearScreen();
+	test.Console()->SetPos(0,0);
+	test.Printf(_L("Options :\n\n"));
+	test.Printf(_L(" 1 : Queue Op\n"));
+	test.Printf(_L(" 2 : UnQueue Op\n"));
+	test.Printf(_L(" 3 : Queue back to local\n"));
+	test.Printf(_L(" 4 : Cancel all ops\n"));
+	test.Printf(_L(" 5 : Automated OffLine ops\n"));
+	test.Printf(_L(" 6 : Automated Sync ops\n"));
+	test.Console()->SetPos(0, 12);
+	test.Printf(_L(" X : Main menu\n"));
+	}
+
+void CActiveConsole::DisplayOffLineOpQueueMenu()
+	{
+	if (iMenuState != EOffLineOpQueueMenu)
+		{
+		iPrevState = iMenuState;
+		iMenuState = EOffLineOpQueueMenu;
+		}
+
+	test.Console()->ClearScreen();
+	test.Console()->SetPos(0,0);
+	test.Printf(_L("Options :\n\n"));
+	test.Printf(_L(" 1 : Queue CopyToLocal\n"));
+	test.Printf(_L(" 2 : Queue CopyFromLocal\n"));
+	test.Printf(_L(" 3 : Queue CopyWithinService\n"));
+	test.Printf(_L(" 4 : Queue MoveToLocal\n"));
+	test.Printf(_L(" 5 : Queue MoveFromLocal\n"));
+	test.Printf(_L(" 6 : Queue MoveWithinService\n"));
+	test.Printf(_L(" 7 : Queue Delete\n"));
+	test.Printf(_L(" 8 : Queue CopyWithinFolder\n"));
+	test.Console()->SetPos(0, 12);
+	test.Printf(_L(" X : Main menu\n"));
+	}
+
+void CActiveConsole::DisplayOffLineOpQueueLocalToLocalMenu()
+	{
+	if (iMenuState != EOffLineOpQueueLocalToLocalMenu)
+		{
+		iPrevState = iMenuState;
+		iMenuState = EOffLineOpQueueLocalToLocalMenu;
+		}
+
+	test.Console()->ClearScreen();
+	test.Console()->SetPos(0,0);
+	test.Printf(_L("Options :\n\n"));
+	test.Printf(_L(" 1 : Queue CopyToLocal\n"));
+	test.Printf(_L(" 2 : Queue MoveToLocal\n"));
+	test.Console()->SetPos(0, 12);
+	test.Printf(_L(" X : Main menu\n"));
+	}
+
+void CActiveConsole::DisplayOffLineOpUnQueueMenu()
+	{
+	if (iMenuState != EOffLineOpUnQueueMenu)
+		{
+		iPrevState = iMenuState;
+		iMenuState = EOffLineOpUnQueueMenu;
+		}
+
+	test.Console()->ClearScreen();
+	test.Console()->SetPos(0,0);
+	test.Printf(_L("Options :\n\n"));
+	test.Printf(_L(" 1 : UnQueue CopyToLocal\n"));
+	test.Printf(_L(" 2 : UnQueue CopyFromLocal\n"));
+	test.Printf(_L(" 3 : UnQueue CopyWithinService\n"));
+	test.Printf(_L(" 4 : UnQueue MoveToLocal\n"));
+	test.Printf(_L(" 5 : UnQueue MoveFromLocal\n"));
+	test.Printf(_L(" 6 : UnQueue MoveWithinService\n"));
+	test.Printf(_L(" 7 : UnQueue Delete\n"));
+	test.Console()->SetPos(0, 12);
+	test.Printf(_L(" X : Main menu\n"));
+	}
+
+void CActiveConsole::DisplayConnectMenu()
+	{
+	if (iMenuState != EConnectMenu)
+		{
+		iPrevState = iMenuState;
+		iMenuState = EConnectMenu;
+		}
+
+	test.Console()->ClearScreen();
+	test.Console()->SetPos(0,0);
+	test.Printf(_L("Options :\n\n"));
+	test.Printf(_L(" 1 : Connect\n"));
+	test.Printf(_L(" 2 : Disconnect\n"));
+	test.Printf(_L(" 3 : ConnectAndSync\n"));
+	test.Printf(_L(" 4 : FullSync\n"));
+	test.Printf(_L(" 5 : SyncTree\n"));
+	test.Printf(_L(" 6 : Fetch Test message\n"));
+	test.Printf(_L(" 7 : Subscribe Test1\n"));
+	test.Printf(_L(" 8 : UnSubscribe Test1\n"));
+	test.Printf(_L("\n"));
+	test.Printf(_L(" 0 : More options\n"));
+	test.Console()->SetPos(0, 12);
+	test.Printf(_L(" X : Main menu\n"));
+	}
+
+
+void CActiveConsole::DisplayConnect2Menu()
+	{
+	if (iMenuState != EConnect2Menu)
+		{
+		iPrevState = iMenuState;
+		iMenuState = EConnect2Menu;
+		}
+
+	test.Console()->ClearScreen();
+	test.Console()->SetPos(0,0);
+	test.Printf(_L("Options :\n\n"));
+	test.Printf(_L(" 1 : Fetch inbox\n"));
+	test.Printf(_L(" 2 : Fetch attachment\n"));
+	test.Printf(_L(" 3 : Rename folder\n"));
+	test.Printf(_L(" 4 : Delete folder\n"));
+	test.Printf(_L(" 5 : Create folder\n"));
+	test.Printf(_L(" 6 : InboxNewSync\n"));
+	test.Printf(_L(" 7 : Fetch attached message\n"));
+	test.Printf(_L(" 8 : Copy messages\n"));
+	test.Console()->SetPos(0, 12);
+	test.Printf(_L(" X : Connect menu\n"));
+	}
+
+void CActiveConsole::DisplayAutomationMenu()
+	{
+	if (iMenuState != EAutomationMenu)
+		{
+		iPrevState = iMenuState;
+		iMenuState = EAutomationMenu;
+		}
+
+	test.Console()->ClearScreen();
+	test.Console()->SetPos(0,0);
+	test.Printf(_L("Options :\n\n"));
+	test.Printf(_L(" 1 : Check server contents\n"));
+	test.Printf(_L(" 2 : Test offline operations\n"));
+	test.Printf(_L(" 3 : Test online operations\n"));
+	test.Printf(_L(" 4 : Check Secondary Connect\n"));
+	test.Console()->SetPos(0, 12);
+	test.Printf(_L(" X : Main menu\n"));
+	}
+
+void CActiveConsole::DisplaySynchroniseMenu()
+	{
+	if (iMenuState != ESynchroniseMenu)
+		{
+		iPrevState = iMenuState;
+		iMenuState = ESynchroniseMenu;
+		}
+
+	test.Console()->ClearScreen();
+	test.Console()->SetPos(0,0);
+	test.Printf(_L("Options :\n\n"));
+	test.Printf(_L(" 1 : N-Synchronisation regression tests (use cases SA-1 - SA5)\n"));
+	test.Printf(_L(" 2 : N-Synchronisation new functionality (use cases SA-10 - SA16)\n"));
+	test.Printf(_L(" 3 : N-Synchronisation special cases\n"));
+	test.Printf(_L(" 4 : N-Synchronisation performance tests\n"));
+	test.Printf(_L(" 5 : N-Synchronisation one off tests\n"));
+	test.Console()->SetPos(0, 12);
+	test.Printf(_L(" X : Main menu\n"));
+	}
+
+void CActiveConsole::DisplayDebugMenu()
+	{
+	if (iMenuState != EDebugMenu)
+		{
+		iPrevState = iMenuState;
+		iMenuState = EDebugMenu;
+		}
+
+	test.Console()->ClearScreen();
+	test.Console()->SetPos(0,0);
+	test.Printf(_L("Options :\n\n"));
+	test.Printf(_L("Debug log level = %d\n\n"),iRefresher->iDebugLevel);
+	test.Printf(_L(" 1 : Increase debug level\n"));
+	test.Printf(_L(" 2 : Decrease debug level\n"));
+	test.Console()->SetPos(0, 12);
+	test.Printf(_L(" X : Main menu\n"));
+	}
+
+// --------------------------------------------------------------------------
+
+// Complex menu selection functions
+
+
+// Set up iServiceId;
+void CActiveConsole::SelectImap4ServerEntryL(TChar aChar)
+	{
+	CImImap4Settings* settings = new CImImap4Settings();
+	
+	CleanupStack::PushL(settings);
+
+	iRefresher->CreateDefaultServiceL(settings);
+
+	switch(aChar)
+		{
+	case '0':	// trmai01.  using secure sockets
+		settings->SetServerAddressL(_L("trmai01.it.cellulardata.com"));
+		settings->SetLoginNameL(_L8("rahman"));
+		settings->SetPasswordL(_L8("ibrSym"));
+		settings->SetFolderPathL(_L8(""));
+		settings->SetPort(143);
+		settings->SetPathSeparator('/');
+		settings->SetDisconnectedUserMode(ETrue);
+		settings->SetDeleteEmailsWhenDisconnecting(ETrue);
+		settings->SetGetMailOptions(EGetImap4EmailBodyTextAndAttachments);
+		settings->SetSecureSockets(ETrue);
+		settings->SetSubscribe(EUpdateNeither);
+		settings->SetSynchronise(EUseCombination);
+		iRefresher->CreateServiceL( settings, _L("trmai01"), _L("trmai01") );
+		break;	
+	case '1':	// Existing entry in database
+		iRefresher->FindImap4SettingsL();
+		iRefresher->CreateServiceL( settings, _L(""), _L(""), ETrue );
+		break;
+
+	case '2':	// Gi
+		settings->SetServerAddressL(_L("serv.ant.co.uk"));
+		settings->SetLoginNameL(_L8("imaptest"));
+		settings->SetPasswordL(_L8("imap.ant"));
+		settings->SetFolderPathL(_L8("Mail"));
+		settings->SetPort(143);
+		settings->SetPathSeparator('/');
+		settings->SetDisconnectedUserMode(ETrue);
+		settings->SetDeleteEmailsWhenDisconnecting(ETrue);
+		settings->SetGetMailOptions(EGetImap4EmailBodyTextAndAttachments);
+		settings->SetSecureSockets(EFalse);
+		settings->SetSubscribe(EUpdateNeither);
+		settings->SetSynchronise(EUseCombination);
+		iRefresher->CreateServiceL( settings, _L("UW IMAP"), _L("imaptest@serv") );
+
+		break;
+
+	case '3':	// Chaos
+		settings->SetServerAddressL(_L("utter.chaos.org.uk"));
+		settings->SetLoginNameL(_L8("test"));
+		settings->SetPasswordL(_L8("testtest"));
+		settings->SetFolderPathL(_L8("~/mail"));
+		settings->SetPort(143);
+		settings->SetPathSeparator('/');
+		settings->SetDisconnectedUserMode(ETrue);
+		settings->SetDeleteEmailsWhenDisconnecting(ETrue);
+		settings->SetGetMailOptions(EGetImap4EmailBodyTextAndAttachments);
+		settings->SetSecureSockets(EFalse);
+		settings->SetSubscribe(EUpdateNeither);
+		settings->SetSynchronise(EUseLocal);
+		iRefresher->CreateServiceL( settings, _L("Chaos server"), _L("test@Chaos") );
+
+		break;
+
+	case '4':	// pipex
+		settings->SetServerAddressL(_L("imap.dial.pipex.com"));
+		settings->SetLoginNameL(_L8("mdgi05"));
+		settings->SetPasswordL(_L8("charexaz"));
+		settings->SetFolderPathL(_L8(""));
+		settings->SetPort(143);
+		settings->SetPathSeparator('/');
+		settings->SetDisconnectedUserMode(ETrue);
+		settings->SetDeleteEmailsWhenDisconnecting(ETrue);
+		settings->SetGetMailOptions(EGetImap4EmailBodyTextAndAttachments);
+		settings->SetSecureSockets(EFalse);
+		settings->SetSubscribe(EUpdateNeither);
+		settings->SetSynchronise(EUseCombination);
+		iRefresher->CreateServiceL( settings, _L("pipex"), _L("pipex") );
+		break;
+
+	case '5':	// totalise
+		settings->SetServerAddressL(_L("mail.totalise.co.uk"));
+		settings->SetLoginNameL(_L8("dale.self"));
+		settings->SetPasswordL(_L8("plimsole"));
+		settings->SetFolderPathL(_L8(""));
+		settings->SetPort(143);
+		settings->SetPathSeparator('/');
+		settings->SetDisconnectedUserMode(ETrue);
+		settings->SetDeleteEmailsWhenDisconnecting(ETrue);
+		settings->SetGetMailOptions(EGetImap4EmailBodyTextAndAttachments);
+		settings->SetSecureSockets(EFalse);
+		settings->SetSubscribe(EUpdateNeither);
+		settings->SetSynchronise(EUseCombination);
+		iRefresher->CreateServiceL( settings, _L("totalise"), _L("totalise") );
+		break;
+
+	case '6':	// innosoft TLS
+		settings->SetServerAddressL(_L("eljefe.innosoft.com"));
+		settings->SetLoginNameL(_L8("symbian"));
+		settings->SetPasswordL(_L8("simon"));
+		settings->SetFolderPathL(_L8(""));
+		settings->SetPort(143);
+		settings->SetPathSeparator('/');
+		settings->SetDisconnectedUserMode(ETrue);
+		settings->SetDeleteEmailsWhenDisconnecting(ETrue);
+		settings->SetGetMailOptions(EGetImap4EmailBodyTextAndAttachments);
+		settings->SetSecureSockets(ETrue);
+		settings->SetSubscribe(EUpdateNeither);
+		settings->SetSynchronise(EUseCombination);
+		iRefresher->CreateServiceL( settings, _L("innosoft"), _L("innosoft") );
+		break;
+
+	case '7':	// MS IMap
+		settings->SetServerAddressL(_L("10.22.64.6"));
+		settings->SetLoginNameL(iRefresher->iTestUtils->MachineName());
+		settings->SetPasswordL(iRefresher->iTestUtils->MachineName());
+		settings->SetFolderPathL(_L8(""));
+		settings->SetPort(143);
+		settings->SetPathSeparator('/');
+		settings->SetDisconnectedUserMode(ETrue);
+		settings->SetDeleteEmailsWhenDisconnecting(ETrue);
+		settings->SetGetMailOptions(EGetImap4EmailBodyTextAndAttachments);
+		settings->SetSecureSockets(EFalse);
+		settings->SetSubscribe(EUpdateNeither);
+		settings->SetSynchronise(EUseCombination);
+		iRefresher->CreateServiceL( settings, _L("peterc"), _L("peterc") );
+		break;
+
+	case '8':	// Gordanotest
+		settings->SetServerAddressL(_L("mail.ntmailtest.com"));
+		settings->SetLoginNameL(_L8("Simon.Middleton"));
+		settings->SetPasswordL(_L8("password"));
+		settings->SetFolderPathL(_L8(""));
+		settings->SetPort(143);
+		settings->SetPathSeparator('/');
+		settings->SetDisconnectedUserMode(ETrue);
+		settings->SetDeleteEmailsWhenDisconnecting(ETrue);
+		settings->SetGetMailOptions(EGetImap4EmailBodyTextAndAttachments);
+		settings->SetSecureSockets(EFalse);
+		settings->SetSubscribe(EUpdateNeither);
+		settings->SetSynchronise(EUseCombination);
+		iRefresher->CreateServiceL( settings, _L("ntmail"), _L("ntmail") );
+		break;
+
+	case '9':	// SendMail Inc		// Works with new sync menu
+		settings->SetServerAddressL(_L("mailconnect.sendmail.com"));
+		settings->SetLoginNameL(_L8("user4@mailconnect.sendmail.com"));
+		settings->SetPasswordL(_L8("user4"));
+		settings->SetFolderPathL(_L8(""));
+		settings->SetPort(143);
+		settings->SetPathSeparator('/');
+		settings->SetDisconnectedUserMode(ETrue);
+		settings->SetDeleteEmailsWhenDisconnecting(ETrue);
+		settings->SetGetMailOptions(EGetImap4EmailBodyTextAndAttachments);
+		settings->SetSecureSockets(EFalse);
+		settings->SetSubscribe(EUpdateNeither);
+		settings->SetSynchronise(EUseLocal);
+		iRefresher->CreateServiceL( settings, _L("Sendmail"), _L("Sendmail") );
+		break;
+	
+	case 'a':  // Fast mail reliable server for testing.
+		settings->SetServerAddressL(_L("lon-cn-exchng2k.msexchange2k.closedtest.intra"));
+		settings->SetFolderPathL(_L8(""));
+		settings->SetLoginNameL(iRefresher->iTestUtils->MachineName());
+		settings->SetPasswordL(iRefresher->iTestUtils->MachineName());
+		settings->SetPort(143);
+		settings->SetPathSeparator('/');
+		settings->SetDisconnectedUserMode(ETrue);
+		settings->SetDeleteEmailsWhenDisconnecting(ETrue);
+		settings->SetGetMailOptions(EGetImap4EmailBodyTextAndAttachments);
+		settings->SetSecureSockets(EFalse);
+		settings->SetSubscribe(EUpdateNeither);
+		settings->SetSynchronise(EUseCombination);
+		iRefresher->CreateServiceL( settings, _L("lon-cn-exchng2k.msexchange2k.closedtest.intra"), 
+		                            _L("lon-toqirk01@msexchange2k.closedtest.intra") );
+
+		break;
+
+	default:
+		iMenuState=EImap4ServerMenu;
+		break;
+		}
+
+	CleanupStack::PopAndDestroy();	// settings
+	
+
+	DisplayMainMenu();
+	}
+
+
+
+void CActiveConsole::SelectImap4SettingsEntryL(TChar aChar)
+	{
+	iRefresher->SelectServiceIdL();
+
+	iRefresher->iTestUtils->GoClientSideL();
+	CMsvEntry* entry = iRefresher->iTestUtils->iMsvEntry; 
+	entry->SetEntryL(iRefresher->iServiceId);
+
+	CImImap4Settings* settings = new (ELeave)CImImap4Settings();
+	CleanupStack::PushL(settings);
+
+	CEmailAccounts* accounts = CEmailAccounts::NewLC();
+	TImapAccount imapAccountId;
+	accounts->GetImapAccountL(iRefresher->iServiceId, imapAccountId);
+	accounts->LoadImapSettingsL(imapAccountId, *settings);
+
+	TInt choice;
+	switch (aChar)
+		{
+	case '1':
+		test.Printf(_L("DisconnectedUserMode: 0=Off 1=On [%d]"), settings->DisconnectedUserMode()?1:0);
+		choice = test.Getch();
+		settings->SetDisconnectedUserMode(choice=='0'?EFalse:
+										  choice=='1'?ETrue:
+										  settings->DisconnectedUserMode());
+		break;
+
+	case '2':
+		test.Printf(_L("Synchronise: Use 0=Combination 1=Local 2=Remote [%d]"), settings->Synchronise());
+		choice = test.Getch();
+		settings->SetSynchronise(choice=='0'?EUseCombination:
+								 choice=='1'?EUseLocal:
+								 choice=='2'?EUseRemote:
+								 settings->Synchronise());
+		break;
+
+	case '3':
+		test.Printf(_L("Subscribe: Update 0=Neither 1=Local 2=Remote 3=Both [%d]"), settings->Subscribe());
+		choice = test.Getch();
+		settings->SetSubscribe(choice=='0'?EUpdateNeither:
+							   choice=='1'?EUpdateLocal:
+							   choice=='2'?EUpdateRemote:
+							   choice=='2'?EUpdateBoth:
+							   settings->Subscribe());
+		break;
+
+	case '4':
+		test.Printf(_L("IAP index: [%d]"), entry->Entry().MtmData1());
+		choice = test.Getch();
+		if (choice >= '0' && choice <= '9')
+			{
+			TMsvEmailEntry e = entry->Entry();
+			e.SetMtmData1(choice-'0');
+			entry->ChangeL(e);
+			}
+		break;
+
+	case '5':
+		test.Printf(_L("Delete emails: When 0=Connecting 1=Disconnecting [%d]"),
+					settings->DeleteEmailsWhenDisconnecting()?1:0);
+		choice = test.Getch();
+		settings->SetDeleteEmailsWhenDisconnecting(choice=='0'?EFalse:
+												   choice=='1'?ETrue:
+												   settings->DeleteEmailsWhenDisconnecting());
+		break;
+
+	case '6':
+		test.Printf(_L("Get Mail Options: 0=Headers 1=BodyText 2=Everything 3=Attachments [%d]"),
+					settings->GetMailOptions());
+		choice = test.Getch();
+		settings->SetGetMailOptions(choice=='0'?EGetImap4EmailHeaders:
+									choice=='1'?EGetImap4EmailBodyText:
+									choice=='2'?EGetImap4EmailBodyTextAndAttachments:
+									choice=='3'?EGetImap4EmailAttachments:
+									settings->GetMailOptions());
+		break;
+
+	case '7':
+		test.Printf(_L("SecureSockets: 0=Off 1=On [%d]"), settings->SecureSockets()?1:0);
+		choice = test.Getch();
+		settings->SetSecureSockets(choice=='0'?EFalse:
+								   choice=='1'?ETrue:
+								   settings->SecureSockets());
+		break;
+
+	case '8':
+		{
+		const TPtrC8 path = settings->FolderPath();
+		test.Printf(_L("FolderPath: 0=\"\" 1=\"Mail\" [%S]"), &path);
+		choice = test.Getch();
+		if (choice=='0'||choice=='1')
+			settings->SetFolderPathL(choice=='0'?_L8(""):_L8("Mail"));
+		break;
+		}
+
+	case '9':
+		{
+		const TPtrC8 password = settings->Password();
+		test.Printf(_L("Password: 0=!foobar 1=rubbish [%S]"), &password);
+		choice = test.Getch();
+		if (choice=='0'||choice=='1')
+			settings->SetPasswordL(choice=='0'?_L8("!foobar"):_L8("rubbish"));
+		break;
+		}
+		}
+
+	accounts->SaveImapSettingsL(imapAccountId, *settings);
+
+	test.Printf(_L("\nUpdated settings\n"));
+	
+	CleanupStack::PopAndDestroy(2, settings); // fileStore/accounts, settings
+	
+	// go server side
+	iRefresher->iTestUtils->GoServerSideL();
+	iRefresher->iTestUtils->InstantiateImapServerMtmL();
+	}
+
+// --------------------------------------------------------------------------
+
+void CActiveConsole::DumpMessageStructureL( TMsvId aId,
+										   TInt aSummary,
+										   TInt aParts,
+										   TBool aRecurse,
+										   TBool aShowIds,
+										   MsgMatchFn aMatch )
+	{
+	COutputter* putter = COutputter::NewL( &test );
+	CleanupStack::PushL(putter);
+
+	putter->SetRFs( &theFs );
+	theFs.SetSessionPath( KFilePathMailTest );
+
+	CMsgOutputter* dumper = CMsgOutputter::NewL( putter, iRefresher->ServerEntry() );
+	CleanupStack::PushL(dumper);
+	
+	dumper->DumpL( aId, aSummary, aParts, aRecurse, aShowIds, aMatch );
+
+	CleanupStack::PopAndDestroy(2); // dumper, putter
+	}
+
+// --------------------------------------------------------------------------
+
+LOCAL_C void doMainL()
+	{
+	// Handle command line arguments
+	CCommandLineArguments* cmdLineArg=CCommandLineArguments::NewLC();
+	TInt count = cmdLineArg->Count();
+	TBool isCmdLine=FALSE;
+	if (count>2)	// Command line arguments?
+		{
+		if (!(cmdLineArg->Arg(EArgTestParams).Compare(KTestParams)))
+			isCmdLine=TRUE;
+		}	
+
+	TestScheduler* theScheduler = new (ELeave) TestScheduler;
+	CleanupStack::PushL(theScheduler);
+
+	CActiveScheduler::Install( theScheduler );
+
+	User::LeaveIfError(theFs.Connect());
+	theFs.SetSessionPath(_L("C:\\"));
+
+	
+	// Load the serial comms device drivers.  If this is not done,
+	// connecting to a IMAP4 server returns KErrNotFound (-1).
+	TInt err;
+	err=User::LoadPhysicalDevice(PDD_NAME);
+	if (err!=KErrNone && err!=KErrAlreadyExists)
+		User::Leave(err);
+	err=User::LoadLogicalDevice(LDD_NAME);
+	if (err!=KErrNone && err!=KErrAlreadyExists)
+		User::Leave(err);
+	
+	
+	CTestRefreshMBox* refresher = CTestRefreshMBox::NewLC(isCmdLine ? cmdLineArg:NULL);
+
+
+
+	test((refresher->ServerEntry())->Entry().Id()==KMsvRootIndexEntryId);
+	test.Console()->SetPos(0, 17);
+
+	// Create and start the active console
+	CActiveConsole* activeConsole = CActiveConsole::NewLC(refresher,isCmdLine ? cmdLineArg:NULL);
+	refresher->SetConsole(activeConsole);
+	activeConsole->RequestCharacter();
+	if (isCmdLine)
+		activeConsole->DoCancel();
+
+	// Main program
+	CActiveScheduler::Start();
+
+	// Cleanup exit
+	test.Printf(_L("---------------------\n"));
+	test.Printf(_L("      Going down     \n"));
+	test.Printf(_L("---------------------\n"));
+
+	test.Printf(_L("Deleting activeconsole\n"));
+	CleanupStack::PopAndDestroy();	// activeConsole
+	
+	test.Printf(_L("Deleting Refresher\n"));
+	CleanupStack::PopAndDestroy();	// refresher
+
+	test.Printf(_L("Deleting scheduler\n"));
+	CleanupStack::PopAndDestroy();	// scheduler
+
+	test.Printf(_L("Deleting command line args\n"));
+	CleanupStack::PopAndDestroy();	// cmdLineArg
+
+	test.Printf(_L("Closing FS\n"));
+	theFs.Close();
+	}
+
+
+_LIT(KMessage, "T_IMPS01 - Test Harness");
+
+GLDEF_C TInt E32Main()
+	{
+	__UHEAP_MARK;
+
+	test.Start(KMessage);
+	CTrapCleanup* theCleanup=CTrapCleanup::New();
+	
+	TRAPD(ret,doMainL());		
+	
+	test(ret==KErrNone);
+	
+	delete theCleanup;	
+	
+	test.Console()->SetPos(0, 13);
+	test.End();
+	test.Close();
+	
+	__UHEAP_MARKEND;
+	return(KErrNone);
+	}
+
+// --------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_INC083099_Enquire_Email_Structure.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,509 @@
+// Copyright (c) 2006-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:
+// T_INC083099_ENQUIRE_EMAIL__STRUCTURE.CPP
+// Name of test harness: T_INC083099_Enquire_Email_Structure.cpp
+// Component: imapservermtm
+// Output files produced by running test harness:
+// <DRIVE>:\msglogs\T_INC083099_ENQUIRE_EMAIL__STRUCTURE.WINSCW.DEB.LOG
+// 
+//
+
+
+
+
+
+
+#include "EmailTestUtils.h"
+#include <ImapConnectionObserver.H>
+#include <cemailaccounts.h>
+#include <cmsvmimeheaders.h>
+
+_LIT(KAttachment1, "C:\\mailtest\\IMCM\\rfc82201.txt");
+_LIT(KAttachment2, "C:\\mailtest\\IMCM\\rfc82202.txt");
+_LIT(KAttachment3, "C:\\mailtest\\IMCM\\rfc82203.txt");
+_LIT(KAttachmentFileName1, "rfc82201.txt");
+_LIT(KAttachmentFileName2, "rfc82202.txt");
+_LIT(KAttachmentFileName3, "rfc82203.txt");
+_LIT(KBodytextId," BodytextID  = %d");
+_LIT(KTotalNoOfAttachment," TotalNoOFAttachment   = %d");
+
+_LIT(KAt ,"@");
+_LIT8(KFolderPath, "");
+_LIT(KServer, ".intra");
+_LIT(KImpopulate, " Testing Unable to enquire email entry structure");
+_LIT(KMsgCompleted, "\t CopyL completed with : %d");
+_LIT(KMsgSend, "\t messages to send in the outbox = : %d");
+_LIT(KProgressError, "\t Progress error = %d");
+	
+RTest test(KImpopulate);
+TImapAccount imapAccount;
+LOCAL_D TMsvId imap4Service;
+LOCAL_D TMsvId smtpService;
+LOCAL_D CEmailTestUtils* testUtils;
+LOCAL_D CTrapCleanup* theCleanup;
+
+#if defined (__WINS__)
+	#define PDD_NAME		_L("ECDRV")
+	#define LDD_NAME		_L("ECOMM")
+#else
+	#define PDD_NAME		_L("EUART1")
+	#define LDD_NAME		_L("ECOMM")
+#endif
+	// local variables etc //
+
+class TDummySessionObserver : public CBase , public MMsvSessionObserver
+	{
+public:
+	void HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*Arg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
+		{}
+	};
+	
+class CDummyConnectionObserver : public MMsvImapConnectionObserver
+	{
+		void HandleImapConnectionEvent(TImapConnectionEvent /*aConnectionEvent*/)
+		{}
+	};
+// Disconnect from ImapServer
+LOCAL_C void DisconnectImapServerL()
+	{
+	test.Printf(_L("DisConnecting to IMAP server                      \n"));
+	CTestActive* testActive = new (ELeave) CTestActive();
+	CleanupStack::PushL(testActive);
+ 	
+  	CMsvEntrySelection *msvSelection = new(ELeave) CMsvEntrySelection;
+	CleanupStack::PushL(msvSelection);
+	msvSelection->AppendL(imap4Service);
+
+	TBuf8 <1> aParameter;
+  	CMsvOperation* msvOperation = testUtils->iImapClientMtm->InvokeAsyncFunctionL(KIMAP4MTMDisconnect,*msvSelection, aParameter, testActive->iStatus);
+	testUtils->WriteComment(_L("Dissconnect from IMAP server  "));
+	CleanupStack::PushL(msvOperation);
+
+	testActive->StartL();
+	CActiveScheduler::Start();
+	CleanupStack::PopAndDestroy(3,testActive);//msvOperation,msvSelection,children,testActive
+	}
+
+
+LOCAL_C void ConnectAndFullSyncImapServerL()
+	{
+	CTestActive* testActive = new(ELeave) CTestActive();
+	CleanupStack::PushL(testActive);
+	
+	CMsvEntrySelection * msvSelection = new(ELeave) CMsvEntrySelection;
+	CleanupStack::PushL(msvSelection);
+	
+	test.Printf(_L("Connecting to IMAP server             \n"));
+	msvSelection->AppendL(imap4Service);
+	
+	CDummyConnectionObserver *dummyObserver = new(ELeave)CDummyConnectionObserver; 
+	CleanupStack::PushL(dummyObserver);
+	TPckg<MMsvImapConnectionObserver*> aParameter(dummyObserver);
+  	
+  	CMsvOperation* msvOperation = testUtils->iImapClientMtm->InvokeAsyncFunctionL(KIMAP4MTMConnectAndSyncCompleteAfterFullSync,*msvSelection, aParameter, testActive->iStatus);
+  	testUtils->WriteComment(_L(" Connect to Imap server and Sync the mails  "));
+	CleanupStack::PushL(msvOperation);
+	
+	testActive->StartL();
+	CActiveScheduler::Start();
+
+   	CleanupStack::PopAndDestroy(4,testActive);//msvOperation,dummyObserver,msvSelection,testActive
+   	}
+
+LOCAL_C void PopulateMessagesL(CMsvEntrySelection & aSelection)
+	{
+	testUtils->WriteComment(_L("Testing PopulateMessages "));
+
+	CTestActive* testActive = new(ELeave) CTestActive();
+	CleanupStack::PushL(testActive);
+	TBuf8 <1> aParameter;
+	TMsvSelectionOrdering ordering;
+	
+	TDummySessionObserver *sessionObserver = new (ELeave) TDummySessionObserver;
+	// Session. Needed to create a client registry.
+	CMsvSession* session = CMsvSession::OpenSyncL(*sessionObserver);
+    CMsvOperation*	msvOperation = testUtils->iImapClientMtm->InvokeAsyncFunctionL(KIMAP4MTMPopulate, aSelection, aParameter, testActive->iStatus);	
+	testUtils->WriteComment(_L("Populate mails from  the  Imap Server "));
+	testActive->StartL();
+	CActiveScheduler::Start();	// Start the populate all mail active object
+    delete msvOperation;
+    delete sessionObserver;
+    delete session;
+	CleanupStack::PopAndDestroy(testActive);
+	
+	}
+	
+LOCAL_C void CreateNewSmtpSettingsL()
+	{
+	testUtils->iMsvEntry->SetEntryL(smtpService);
+	TMsvId serviceId = smtpService;
+	//overwrite the settings with test code one.  Don't want the default settings.
+	CImSmtpSettings* settings = new(ELeave) CImSmtpSettings();
+	CleanupStack::PushL(settings);
+	CEmailAccounts* accounts = CEmailAccounts::NewLC();
+	TSmtpAccount smtpAccountId;
+	accounts->GetSmtpAccountL( serviceId, smtpAccountId);
+	accounts->LoadSmtpSettingsL(smtpAccountId, *settings);
+	TInt serverLength = testUtils->MachineName().Length();
+	HBufC* serverad = HBufC::NewL(serverLength + 7 ); // 7 is the length of KServerAddress
+	CleanupStack::PushL(serverad);
+	serverad->Des().Copy(testUtils->MachineName());
+	serverad->Des().Append(KServer);	
+    settings->SetServerAddressL(*serverad);
+    HBufC* emailaddress = HBufC::NewL(serverLength + 8 + serverad->Des().Length() + 1 );
+   	CleanupStack::PushL(emailaddress);
+   	emailaddress->Des().Copy(testUtils->MachineName());
+   	emailaddress->Des().Append(KAt);
+   	emailaddress->Des().Append(*serverad);
+   	settings->SetEmailAddressL(*emailaddress);
+	settings->SetReplyToAddressL(*emailaddress);
+	settings->SetReceiptAddressL(*emailaddress);
+	settings->SetEmailAliasL(_L("Test Account"));
+	settings->SetBodyEncoding(EMsgOutboxMIME);
+	settings->SetRequestReceipts(EFalse);
+	settings->SetPort(25);
+	TSmtpAccount smtpAccount;
+ 	accounts->GetSmtpAccountL(smtpService, smtpAccount);
+	accounts->SaveSmtpSettingsL(smtpAccount, *settings);
+	CleanupStack::PopAndDestroy(emailaddress);
+	CleanupStack::PopAndDestroy(serverad);
+	CleanupStack::PopAndDestroy(2,settings);
+	testUtils->WriteComment(_L("Created New SmtpSettings  "));	
+		
+	}
+	
+	
+LOCAL_C void CreateNewPlaintextMessageL()
+	{
+	CTestActive* testActive = new(ELeave) CTestActive();
+	CleanupStack::PushL(testActive);
+	TMsvEmailTypeList msvEmailTypeList = 0;
+	TMsvPartList partList = (KMsvMessagePartBody | KMsvMessagePartAttachments);
+	CImEmailOperation* emailOperation = CImEmailOperation::CreateNewL(testActive->iStatus, *(testUtils->iMsvSession),KMsvGlobalOutBoxIndexEntryId, partList, msvEmailTypeList, KUidMsgTypeSMTP);
+	CleanupStack::PushL(emailOperation);
+	TestMsvOperationTimer* testMsvOperationTimer = TestMsvOperationTimer::NewLC(test.Console(), emailOperation, test);
+	testActive->StartL();
+	testMsvOperationTimer->IssueRequest();
+	CActiveScheduler::Start();
+	//check progress
+	TMsvId temp;
+	TPckgC<TMsvId> paramPack(temp);
+	const TDesC8& progBuf = emailOperation->ProgressL();
+	paramPack.Set(progBuf);
+	TMsvId newMessageId;
+	newMessageId = paramPack();
+	test(newMessageId != NULL);
+	CImEmailMessage* imEmailMessage = CImEmailMessage::NewLC(*(testUtils->iMsvEntry));
+	// Make sure you are set on the Message Id
+	testUtils->iMsvEntry->SetEntryL(newMessageId);
+	CMsvAttachment* attachmentInfo = CMsvAttachment::NewL(CMsvAttachment::EMsvFile);
+	CleanupStack::PushL(attachmentInfo);
+	attachmentInfo->SetAttachmentNameL(KAttachmentFileName1());
+	CleanupStack::Pop(attachmentInfo);	 // ownership passed to attachment manager
+	imEmailMessage->AttachmentManager().AddAttachmentL(KAttachment1, attachmentInfo, testActive->iStatus);
+	testActive->StartL();
+	CActiveScheduler::Start();	// wait for the asynch operation to complete
+	if (testActive->iStatus.Int())
+		{
+		testUtils->WriteComment(_L("CreateNewPlaintextMessageWithIncompleteAttachmentL failed"));
+		testUtils->TestHarnessFailed(testActive->iStatus.Int());
+		}
+	testUtils->iMsvEntry->SetEntryL(newMessageId);
+	CMsvAttachment* attachmentInfo1 = CMsvAttachment::NewL(CMsvAttachment::EMsvFile);
+	CleanupStack::PushL(attachmentInfo1);
+	attachmentInfo1->SetAttachmentNameL(KAttachmentFileName2());
+    CleanupStack::Pop(attachmentInfo1);	 // ownership passed to attachment manager
+	imEmailMessage->AttachmentManager().AddAttachmentL(KAttachment2, attachmentInfo1, testActive->iStatus);
+	testActive->StartL();
+	CActiveScheduler::Start();	// wait for the asynch operation to complete
+	if (testActive->iStatus.Int())
+		{
+		testUtils->WriteComment(_L("CreateNewPlaintextMessageWithIncompleteAttachmentL failed"));
+		testUtils->TestHarnessFailed(testActive->iStatus.Int());
+		}
+	testUtils->iMsvEntry->SetEntryL(newMessageId);
+	CMsvAttachment* attachmentInfo2 = CMsvAttachment::NewL(CMsvAttachment::EMsvFile);
+	CleanupStack::PushL(attachmentInfo2);
+	attachmentInfo2->SetAttachmentNameL(KAttachmentFileName3());
+    CleanupStack::Pop(attachmentInfo2);	 // ownership passed to attachment manager
+	imEmailMessage->AttachmentManager().AddAttachmentL(KAttachment3, attachmentInfo2, testActive->iStatus);
+	testActive->StartL();
+	CActiveScheduler::Start();	// wait for the asynch operation to complete
+	if (testActive->iStatus.Int())
+		{
+		testUtils->WriteComment(_L("CreateNewPlaintextMessageWithIncompleteAttachmentL failed"));
+		testUtils->TestHarnessFailed(testActive->iStatus.Int());
+		}	
+	const TDesC8& progBuf2 = imEmailMessage->ProgressL();	
+	paramPack.Set(progBuf2);
+	TMsvId attachmentId = paramPack();
+	testUtils->WriteComment(_L("\t Created New plaintext message"));
+	testUtils->iMsvEntry->SetEntryL(attachmentId);
+	
+    imEmailMessage->GetAttachmentsListL(testActive->iStatus, newMessageId, CImEmailMessage::EAllAttachments, CImEmailMessage::EThisMessageOnly);	
+  	testActive->StartL();
+	CActiveScheduler::Start();	// wait for the asynch operation to complete
+    const CMsvEntrySelection& selection = imEmailMessage->Selection();
+	testUtils->Printf(KTotalNoOfAttachment , selection.Count());
+	imEmailMessage->GetBodyTextEntryIdL(testActive->iStatus,newMessageId,CImEmailMessage::EThisMessageOnly);
+	testActive->StartL();
+	CActiveScheduler::Start();	// wait for the asynch operation to complete
+	const CMsvEntrySelection& selection1 = imEmailMessage->Selection();
+	TInt count = imEmailMessage->Selection().Count();
+    if( count > 0)
+			{
+			// Get the Id of the body text
+			// The body text part Id is present at index 0.  Not checking for other
+			//  Ids, as currently only Plain text part is verified.
+			TMsvId	iBodyTextId = imEmailMessage->Selection().At(0);
+			testUtils->Printf(KBodytextId, iBodyTextId);
+			}
+	CleanupStack::PopAndDestroy(); // imEmailMessage  
+		testUtils->iMsvEntry->SetEntryL(attachmentId);
+    CMsvStore* store1 = testUtils->iMsvEntry->EditStoreL();
+	CleanupStack::PushL(store1);
+	CImMimeHeader *Head1 = CImMimeHeader::NewLC();
+    Head1->RestoreL(*store1);
+	const TPtrC8 contentSubType = Head1->ContentSubType();
+	store1->CommitL();
+    
+    if(contentSubType.Size() == 0 )
+    {
+    testUtils->Printf(_L("ContentSubType Has NO SUB CONTENT****") );
+    test(contentSubType.Size() != 0);
+    }
+    else
+    {
+    testUtils->Printf(_L("ContentSubType Has ****SUB CONTENT****"));	
+    }
+   	CleanupStack::PopAndDestroy(2, store1);//store1,Head1,Buffer
+    testUtils->iMsvEntry->SetEntryL(newMessageId);
+    CMsvStore* store = testUtils->iMsvEntry->EditStoreL();
+	CleanupStack::PushL(store);
+	CImHeader* header = CImHeader::NewLC();
+	header->RestoreL(*store);
+	TInt serverLength = testUtils->MachineName().Length();
+	HBufC* serverad = HBufC::NewL(serverLength + 7 ); // 7 is the length of KServerAddress
+	CleanupStack::PushL(serverad);
+	serverad->Des().Copy(testUtils->MachineName());
+	serverad->Des().Append(KServer);	
+    HBufC* emailaddress = HBufC::NewL(serverLength + 8 + serverad->Des().Length() + 1 );
+   	CleanupStack::PushL(emailaddress);
+   	emailaddress->Des().Copy(testUtils->MachineName());
+   	emailaddress->Des().Append(KAt);
+   	emailaddress->Des().Append(*serverad);
+   	header->ToRecipients().AppendL(*emailaddress);
+	header->SetSubjectL(_L("Test sending message using CMsvEntry::CopyL!!"));
+	header->StoreL(*store);
+	store->CommitL();
+	CleanupStack::PopAndDestroy(emailaddress);
+	CleanupStack::PopAndDestroy(serverad);
+	CleanupStack::PopAndDestroy(5,testActive); // header,store,testMsvOperationTimer,emailOperation,testActive
+	
+		
+	}
+LOCAL_C void SendSmtpMessageL()
+	{
+	CTestActive* testActive = new (ELeave) CTestActive();
+	CleanupStack::PushL(testActive);
+	testUtils->iMsvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);
+	testUtils->InstantiateSmtpClientMtmL();
+	CMsvEntrySelection* sendSel = testUtils->iMsvEntry->ChildrenL();
+	CleanupStack::PushL(sendSel);
+	TInt count = sendSel->Count();
+	test(count >= 1);
+	testUtils->Printf(KMsgSend, count);
+	testUtils->iSmtpClientMtm->SetCurrentEntryL(testUtils->iMsvSession->GetEntryL(KMsvGlobalOutBoxIndexEntryId));
+	CMsvOperation* msvOperation = testUtils->iSmtpClientMtm->Entry().CopyL(*sendSel, smtpService, testActive->iStatus);
+	CleanupStack::PushL(msvOperation);
+	testActive->StartL();
+	CActiveScheduler::Start();
+	//check progress
+    testUtils->Printf(KMsgCompleted, testActive->iStatus.Int()); 
+	CMsvEntrySelection* sendSelc = testUtils->iMsvEntry->ChildrenL();
+	TInt noOfMessages = sendSelc->Count();
+	// Check Whether the mails in Outbox is Zero (i.e. mails has been sent..).
+    test(noOfMessages == 0);
+  	delete sendSelc;
+ 	TImSmtpProgress temp;	
+	TPckgC<TImSmtpProgress> paramPack(temp);
+	const TDesC8& progBuf = msvOperation->ProgressL();
+	paramPack.Set(progBuf);
+	TImSmtpProgress progress = paramPack();	
+	testUtils->Printf(KProgressError, progress.Error()); 
+	test(progress.Error()==0);
+	CleanupStack::PopAndDestroy(3,testActive); //msvOperation,sendsel,testActive
+	}
+	
+LOCAL_C void CreateandSendMessageL()
+	{
+	test.Next(_L("Test sending message to server "));
+	CreateNewSmtpSettingsL();
+	testUtils->iMsvEntry->SetEntryL(smtpService);
+	CreateNewPlaintextMessageL();
+	SendSmtpMessageL();
+	}
+
+LOCAL_C void TestPopulateL()
+	{
+	CreateandSendMessageL();
+	// Tests start here
+	testUtils->iImapClientMtm->SwitchCurrentEntryL(imap4Service);
+	// connect, do full sync and then  so that the inbox can be synced
+    test.Printf(_L("Connecting to IMAP server            \n"));
+    
+    ConnectAndFullSyncImapServerL();
+    
+    CMsvEntry* imapService=NULL;
+    CMsvEntry* inboxEntry=NULL;
+    TMsvSelectionOrdering ordering;
+	
+	TDummySessionObserver *sessionObserver = new (ELeave) TDummySessionObserver;
+	// Session. Needed to create a client registry.
+	CMsvSession* session = CMsvSession::OpenSyncL(*sessionObserver);
+
+	// message in remote inbox					
+	//create a CMsvEntry for the service entry
+	imapService = CMsvEntry::NewL(*session, imapAccount.iImapService,ordering);
+	CleanupStack::PushL(imapService);
+	//retrieve the inbox from the imap service entry
+	CMsvEntrySelection* msvEntrySelection =imapService->ChildrenL();
+	CleanupStack::PushL(msvEntrySelection);
+ 
+	
+	//create a CMsvEntry for the inbox entry
+	inboxEntry = CMsvEntry::NewL(*session, (*msvEntrySelection)[0],ordering);
+	TBuf8 <1> aParameter;	    
+				
+	CleanupStack::PopAndDestroy(msvEntrySelection);
+	CleanupStack::PushL(inboxEntry);
+			
+	//retrieve the message from the inboxEntry service entry
+    CMsvEntrySelection* selection = inboxEntry->ChildrenL();
+    
+    DisconnectImapServerL();
+      
+    PopulateMessagesL(*selection);
+    ConnectAndFullSyncImapServerL();
+    
+    CleanupStack::PopAndDestroy(inboxEntry);
+	CleanupStack::PopAndDestroy(imapService);
+    
+    delete sessionObserver;
+    delete session;
+    delete selection;
+   
+	}
+
+LOCAL_C void InitL()
+	{
+	// Load the serial comms device drivers.  If this is not done,
+	// connecting via NT-RAS returns KErrNotFound (-1).
+	TInt driverErr;
+	driverErr=User::LoadPhysicalDevice(PDD_NAME);
+	if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists)
+		User::Leave(driverErr);
+	driverErr=User::LoadLogicalDevice(LDD_NAME);
+	if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists)
+		User::Leave(driverErr);
+
+	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
+	CActiveScheduler::Install(scheduler);
+	CleanupStack::PushL(scheduler);
+	testUtils = CEmailTestUtils::NewLC(test);
+	testUtils->CreateAllTestDirectories();
+	testUtils->FileSession().SetSessionPath(_L("C:\\"));
+	testUtils->CleanMessageFolderL();
+	testUtils->GoServerSideL();
+    testUtils->ClearEmailAccountsL();
+	test.Next(_L("Create Data Component FileStores"));
+	testUtils->CreateSmtpServerMtmRegL();
+	//	Loading the DLLs
+	testUtils->CreateRegistryObjectAndControlL();
+	testUtils->InstallSmtpMtmGroupL();
+	testUtils->GoClientSideL();
+	// Create Services
+	smtpService = testUtils->CreateSmtpServiceL();
+	imap4Service = testUtils->CreateImapServiceL();
+	CEmailAccounts* accounts = CEmailAccounts::NewLC();
+	TSmtpAccount smtpAccount;
+	accounts->GetSmtpAccountL(smtpService, smtpAccount);
+	accounts->SetDefaultSmtpAccountL(smtpAccount);
+    testUtils->WriteComment(_L("Create  Imap   Services           ")); 
+	// Delete any *.scr files in c:\logs\email directory.
+	testUtils->DeleteScriptFilesFromLogsDirL();
+
+	testUtils->iMsvEntry->SetEntryL(imap4Service);
+	//overwrite the settings with test code one.  Don't want the default settings.
+	CImImap4Settings* settings = new(ELeave) CImImap4Settings();
+	CleanupStack::PushL(settings);
+	settings->Reset();
+	TInt serverLength = testUtils->MachineName().Length();
+	HBufC* serverad = HBufC::NewL(serverLength + 7 ); // 7 is the length of KServerAddress
+	CleanupStack::PushL(serverad);
+	serverad->Des().Copy(testUtils->MachineName());
+	serverad->Des().Append(KServer);
+	settings->SetServerAddressL(*serverad);
+	CleanupStack::PopAndDestroy(serverad); 
+	settings->SetDeleteEmailsWhenDisconnecting(ETrue);
+	settings->SetAcknowledgeReceipts(ETrue);
+	settings->SetAutoSendOnConnect(ETrue);
+	settings->SetLoginNameL(testUtils->MachineName());
+	settings->SetPasswordL(testUtils->MachineName());
+   	settings->SetPort(143);
+	settings->SetFolderPathL(KFolderPath);
+	accounts->GetImapAccountL(imap4Service, imapAccount);
+	accounts->SaveImapSettingsL(imapAccount, *settings);
+	CleanupStack::PopAndDestroy(2,accounts); //accounts,settings
+	test.Printf(_L("Instantiating IMAP4 Client MTM"));
+	testUtils->InstantiateImapClientMtmL();
+	}
+
+LOCAL_C void Closedown()
+	{
+     
+	CleanupStack::PopAndDestroy(2);  //testUtils, scheduler 
+	}
+
+
+LOCAL_C void doMainL()
+	{
+	test.Start(_L("Unable to enquire email entry structure "));
+	InitL();
+  	testUtils->TestStart(1);
+	TestPopulateL();
+	
+
+ 	testUtils->TestFinish(1);
+
+	testUtils->TestHarnessCompleted();
+
+	Closedown();		
+	}
+
+
+GLDEF_C TInt E32Main()
+	{
+	__UHEAP_MARK;
+	theCleanup=CTrapCleanup::New();
+	TRAPD(ret,doMainL());		
+	test(ret==KErrNone);
+	delete theCleanup;	
+	test.Console()->SetPos(0, 13);
+	test.End();
+	test.Close();
+	__UHEAP_MARKEND;
+	return(KErrNone);
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_ImapBadlyFormedAddressClient.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,192 @@
+// Copyright (c) 2006-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:
+// T_ImapBadlyFormedAddress.cpp
+// 
+//
+
+#include "T_ImapBadlyFormedAddressClient.h"
+
+#include <mtclbase.h>
+#include <mtclreg.h>
+#include <miutset.h>
+#include <imapset.h>
+#include <smtpset.h>
+#include <iapprefs.h>
+#include <imapcmds.h>
+
+_LIT(KLoopbackAddress,"127.0.0.1");
+
+void TDummySessionObserver::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
+	{
+	}
+	
+CImapBadlyFormedAddressClient::CImapBadlyFormedAddressClient(MImapTestEventHandler* aOwner)
+ : CActive(EPriorityStandard), iOwner(aOwner)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+EXPORT_C CImapBadlyFormedAddressClient* CImapBadlyFormedAddressClient::NewL(MImapTestEventHandler* aOwner)
+	{
+	CImapBadlyFormedAddressClient* self = NewLC(aOwner);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+EXPORT_C CImapBadlyFormedAddressClient* CImapBadlyFormedAddressClient::NewLC(MImapTestEventHandler* aOwner)
+	{
+	CImapBadlyFormedAddressClient* self = new(ELeave) CImapBadlyFormedAddressClient(aOwner);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+	
+CImapBadlyFormedAddressClient::~CImapBadlyFormedAddressClient()
+	{
+	Cancel();
+	delete iMsvOperation;	
+	delete iSelection;
+	delete iClientMtm;
+	delete iClientRegistry;	
+	delete iSession;
+	delete iSessionObserver;
+	delete iAccounts;
+	}
+	
+	
+void CImapBadlyFormedAddressClient::ConstructL()
+	{
+	// create an account
+	iAccounts = CEmailAccounts::NewL();	
+	CreateImapAccountL();
+	// Session observer. Needed to create a session
+	iSessionObserver = new (ELeave) TDummySessionObserver;
+	// Session. Needed to create a client registry.
+	iSession=CMsvSession::OpenSyncL(*iSessionObserver);
+	// Client registry. Needed to get the MTM component
+	iClientRegistry=CClientMtmRegistry::NewL(*iSession,KMsvDefaultTimeoutMicroSeconds32);
+	// get the client mtm
+	iClientMtm=iClientRegistry->NewMtmL(KUidMsgTypeIMAP4);	
+	
+	// Load the serial comms device drivers.  If this is not done,
+	// connecting via NT-RAS returns KErrNotFound (-1).
+	TInt driverErr;
+	driverErr=User::LoadPhysicalDevice(PDD_NAME);
+	if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists)
+		User::Leave(driverErr);
+	driverErr=User::LoadLogicalDevice(LDD_NAME);
+	if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists)
+		User::Leave(driverErr);
+	}
+	
+TImapAccount CImapBadlyFormedAddressClient::GetImapAccount()
+	{
+	return iImapAccount;
+	}
+	
+void CImapBadlyFormedAddressClient::CreateImapAccountL()
+	{
+	// create objects and initialise with the defaults
+	CImImap4Settings* imap4Settings=new(ELeave)CImImap4Settings;
+	CleanupStack::PushL(imap4Settings);
+	CImSmtpSettings* smtpSettings=new(ELeave)CImSmtpSettings;
+	CleanupStack::PushL(smtpSettings);
+	CImIAPPreferences* imapIap = CImIAPPreferences::NewLC();
+	CImIAPPreferences* smtpIap = CImIAPPreferences::NewLC();
+	
+	iAccounts->PopulateDefaultImapSettingsL(*imap4Settings, *imapIap);
+	iAccounts->PopulateDefaultSmtpSettingsL(*smtpSettings, *smtpIap);
+	
+	// override some of the defaults
+	imap4Settings->SetPasswordL(_L8("roberth"));
+	imap4Settings->SetLoginNameL(_L8("roberth"));
+	imap4Settings->SetServerAddressL(KLoopbackAddress);
+	imap4Settings->SetFolderPathL(_L8(""));
+	imap4Settings->SetSynchronise(EUseLocal);
+	
+	// create the account
+	iImapAccount = iAccounts->CreateImapAccountL(_L("TestAccount"), *imap4Settings, *imapIap, EFalse);
+	TSmtpAccount smtpAccount;
+	smtpAccount = iAccounts->CreateSmtpAccountL(iImapAccount, *smtpSettings, *smtpIap, EFalse);
+
+	// clean up
+	CleanupStack::PopAndDestroy(smtpIap);
+	CleanupStack::PopAndDestroy(imapIap);	
+	CleanupStack::PopAndDestroy(smtpSettings);
+	CleanupStack::PopAndDestroy(imap4Settings); 
+	}
+
+void CImapBadlyFormedAddressClient::StartL()
+	{
+	// we are to collect the whole email: the next operation will be to fetch it
+	iNextStep = EDisconnect;
+	iSelection = new (ELeave) CMsvEntrySelection;
+	TPckg<MMsvImapConnectionObserver*> param(this);
+	// select the imap service entry
+	iSelection->AppendL(iImapAccount.iImapService);
+	// make the service entry the current context
+	iClientMtm->SwitchCurrentEntryL(iImapAccount.iImapService);
+	// sync the account
+	iMsvOperation = iClientMtm->InvokeAsyncFunctionL(KIMAP4MTMConnectAndSyncCompleteAfterFullSync,*iSelection,param,iStatus);
+	SetActive();
+	}
+
+void CImapBadlyFormedAddressClient::DoCancel()
+	{	
+	__ASSERT_DEBUG(iMsvOperation!=NULL, User::Panic(_L("CImapBadlyFormedAddressClient"), -3));
+	iMsvOperation->Cancel();
+	}
+
+void CImapBadlyFormedAddressClient::RunL()
+	{
+	TPckg<MMsvImapConnectionObserver*> param(this);
+	
+	switch(iNextStep)
+		{
+		case EDisconnect:
+			{
+			// We have finished, so do a disconnect
+			iNextStep=EComplete;
+			delete iMsvOperation;
+			iMsvOperation=NULL;
+			iMsvOperation = iClientMtm->InvokeAsyncFunctionL(KIMAP4MTMDisconnect,*iSelection,param,iStatus);
+			SetActive();
+			break;
+			}
+
+		case EComplete:
+			{
+			// inform the owning object that the process is complete
+			iOwner->TestComplete(KErrNone);
+			break;
+			}
+
+		default:
+			{
+			__ASSERT_DEBUG(0, User::Panic(_L("CImapBadlyFormedAddressClient unknown state"), KErrUnknown));
+			break;			
+			}
+		}
+	}
+	
+TInt CImapBadlyFormedAddressClient::RunError(TInt aError)
+	{
+	iOwner->TestComplete(aError);
+	return KErrNone;
+	}
+	
+void CImapBadlyFormedAddressClient::HandleImapConnectionEvent(TImapConnectionEvent /*aConnectionState*/)
+	{
+	// this method does nothing
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_ImapBadlyFormedAddressServer.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,85 @@
+// Copyright (c) 2006-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 "T_ImapBadlyFormedAddressServer.h"
+#include "T_ImapBadlyFormedAddressStep.h"
+
+_LIT(KServerName,"T_ImapBadlyFormedAddress");
+
+CImapBadlyFormedAddressServer* CImapBadlyFormedAddressServer::NewL()
+	{
+	CImapBadlyFormedAddressServer * server = new (ELeave) CImapBadlyFormedAddressServer();
+	CleanupStack::PushL(server);
+	server->ConstructL(KServerName);
+
+	CleanupStack::Pop(server);
+	return server;
+	}
+
+CImapBadlyFormedAddressServer::CImapBadlyFormedAddressServer()
+	{}
+
+CImapBadlyFormedAddressServer::~CImapBadlyFormedAddressServer()
+	{}
+
+LOCAL_C void MainL()
+	{
+	CActiveScheduler* sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CleanupStack::PushL(sched);
+	CActiveScheduler::Install(sched);
+	CImapBadlyFormedAddressServer* server = NULL;
+	// Create the CTestServer derived server
+	TRAPD(err,server = CImapBadlyFormedAddressServer::NewL());
+	CleanupStack::PushL(server);
+	if(!err)
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	CleanupStack::PopAndDestroy(2,sched);
+	}
+
+GLDEF_C TInt E32Main()
+	{
+	__UHEAP_MARK;
+	
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAPD(err,MainL());
+	delete cleanup;
+	
+	__UHEAP_MARKEND;
+	return err;
+    }
+
+RFs& CImapBadlyFormedAddressServer::Fs()
+	{
+	return iFs;
+	};	
+
+CTestStep* CImapBadlyFormedAddressServer::CreateTestStep(const TDesC& aStepName)
+	{
+	CTestStep* testStep = NULL;
+	
+	if(aStepName == KTestImapBadlyFormedAddress)
+		testStep = new CImapBadlyFormedAddressStep();
+
+	return testStep;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_ImapBadlyFormedAddressStep.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,166 @@
+// Copyright (c) 2006-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 "T_ImapBadlyFormedAddressStep.h"
+#include "T_ImapBadlyFormedAddressClient.h"
+
+#include "emailtestutils.h"
+
+#include <e32test.h>
+
+RTest test(_L("IMAP receive new message while synch is cancelling idle"));
+
+const TInt KSizeDateTimeBuffer = 45;
+const TInt KImapPort = 143;
+ 
+LOCAL_C void FormatDateTime(TDes& aBuffer, const TTime& aTime)
+	{ 
+	aBuffer.Zero();
+	_LIT(KFormat4,"%/0%1%/1%2%/2%3%/3 %-B%:0%J%:1%T%:2%S%:3%+B");
+	aTime.FormatL(aBuffer,KFormat4); 
+	}
+
+CImapBadlyFormedAddressStep::CImapBadlyFormedAddressStep()
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KTestImapBadlyFormedAddress);
+	}
+
+CImapBadlyFormedAddressStep::~CImapBadlyFormedAddressStep()
+	{
+	delete iConsole;
+	delete iSpoofServer;	
+	delete iTestUtils;
+	delete iImapClient;	
+	delete iScheduler;
+	if(iSession!=NULL)
+		iSession->CloseMessageServer();
+	delete iSession;
+	delete iSessionObserver;
+	}
+
+void CImapBadlyFormedAddressStep::TestComplete(TInt aEventCode)
+	{
+	CActiveScheduler::Stop();
+
+	if(aEventCode!=KErrNone && aEventCode!=KErrEof)
+		{
+		ERR_PRINTF2(_L("Error: %d"),aEventCode);	
+		}
+	}
+
+void CImapBadlyFormedAddressStep::PrintEntryTime(TTime* aTIme)
+	{
+	TBuf<KSizeDateTimeBuffer> dateTimeString;
+	FormatDateTime(dateTimeString,*aTIme); 
+	INFO_PRINTF2(_L("%S"),&dateTimeString);	
+	}
+		
+void CImapBadlyFormedAddressStep::GetDetailsFromIniFileL()
+	{
+	// get the script file path
+	_LIT(KScriptFile,"ScriptFile");	
+	if(!GetStringFromConfig(ConfigSection(),KScriptFile,iScriptFile))
+		{
+		_LIT(KErrorScriptFile, "Error reading script file path from ini file");
+		ERR_PRINTF1(KErrorScriptFile);
+		User::Leave(KErrArgument);
+		}
+
+	// get the expected number of mails
+	_LIT(KExpectedCountString, "ExpectedEntryCount");
+	if(!GetIntFromConfig(ConfigSection(),KExpectedCountString,iExpectedEntryCount))
+		{
+		_LIT(KErrorExpectedCount, "Error reading expected entry count from ini file");
+		ERR_PRINTF1(KErrorExpectedCount);
+		User::Leave(KErrArgument);	
+		}
+	}
+
+TVerdict CImapBadlyFormedAddressStep::doTestStepPreambleL()
+	{
+	SetTestStepResult(EPass);
+	iScheduler = new (ELeave) CActiveScheduler;
+	CActiveScheduler::Install(iScheduler);
+	
+	iTestUtils = CEmailTestUtils::NewL(test);
+	iTestUtils->FileSession().SetSessionPath(_L("C:\\"));
+	iTestUtils->CleanMessageFolderL();
+	iTestUtils->ClearEmailAccountsL();
+	
+	iTestUtils->GoClientSideL();
+	
+	// start the imap server
+	GetDetailsFromIniFileL();
+	iConsole=Console::NewL(_L("IMAP Receive New Msg During Sync Idle Cancel"),TSize(KConsFullScreen,KConsFullScreen));
+	iSpoofServer = CSpoofServer::NewL(*this,iScriptFile);
+	iSpoofServer->StartL(KImapPort);
+		
+	// start the imap client
+	iImapClient = CImapBadlyFormedAddressClient::NewL(this);
+	iImapClient->StartL();
+	
+	CActiveScheduler::Start();
+	return TestStepResult();
+	}
+
+TInt CImapBadlyFormedAddressStep::GetEntryCountL()
+	{
+	TImapAccount imapAccount=iImapClient->GetImapAccount();
+	
+	TMsvSelectionOrdering ordering;	
+
+	// open the imap service entry
+	CMsvEntry* imapService = CMsvEntry::NewL(*iSession,imapAccount.iImapService,ordering);
+	CleanupStack::PushL(imapService);
+	// get its children
+	CMsvEntrySelection* msvEntrySelection;
+	msvEntrySelection=imapService->ChildrenL();
+	// open its child inbox entry
+	CMsvEntry* inboxEntry = CMsvEntry::NewL(*iSession, (*msvEntrySelection)[0],ordering);
+	CleanupStack::PushL(inboxEntry);
+    
+   // get the childeren of the inbox
+   delete msvEntrySelection;
+   msvEntrySelection=NULL;
+   msvEntrySelection=inboxEntry->ChildrenL();
+   TInt count=msvEntrySelection->Count();
+
+	delete msvEntrySelection;
+	msvEntrySelection=NULL;	
+	CleanupStack::PopAndDestroy(2,imapService);
+
+	return count;
+	}
+
+
+TVerdict CImapBadlyFormedAddressStep::doTestStepL()
+	{
+	TVerdict result;
+	// Session observer. Needed to create a session
+	iSessionObserver = new (ELeave) TDummySessionObserver;
+	// Session. Needed to create a client registry.
+	iSession=CMsvSession::OpenSyncL(*iSessionObserver);
+	// get entry count
+	TInt entryCount=GetEntryCountL();
+	result = (entryCount==iExpectedEntryCount? EPass:EFail);
+	SetTestStepResult(result);
+	return TestStepResult();
+	}
+
+TVerdict CImapBadlyFormedAddressStep::doTestStepPostambleL()
+	{
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_ImapNewMsgDuringSyncIdleCancelClient.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,245 @@
+// Copyright (c) 2005-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:
+// T_ImapNewMsgDuringSyncIdleCancel.cpp
+// The server waits for the idle read to be cancelled by the sync command, and then sends a '* 2 EXISTS' command to indicate that
+// a new message has arrived.
+// 2. The client connects to the server, requests a sync and a populate.
+// 3. Client / server interact to complete the sync and populate. One message is fetched.
+// 4. The client requests a full sync (causing the idle read cancel).
+// 5. The server indicates a new message has arrived
+// 6. Client / server interact to complete the full sync. The new message is fetched
+// 7. The client requests a full sync (causing the idle read cancel).
+// 8. The server indicates a new message has arrived
+// 9. Client / server interact to complete the full sync. The new message is fetched
+// 10. The client disconnects.
+// 
+//
+
+/**
+ @SYMTestCaseID DEF067159
+ @SYMTestType UT
+ @SYMTestPriority High
+ @SYMDEF DEF067159
+ @SYMTestCaseDesc IMAP spoof server test that checks that a new message indication is correctly handled if idle read is being cancelled during a sync
+ @SYMTestActions 1. The Server is started and listens on port 143.
+ @SYMTestExpectedResults Client should have fetched three messages
+*/
+
+#include "T_ImapNewMsgDuringSyncIdleCancelClient.h"
+
+#include <mtclbase.h>
+#include <mtclreg.h>
+#include <miutset.h>
+#include <imapset.h>
+#include <smtpset.h>
+#include <iapprefs.h>
+#include <imapcmds.h>
+
+_LIT(KLoopbackAddress,"127.0.0.1");
+
+void TDummySessionObserver::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
+	{
+	}
+	
+CImapNewMsgDuringSyncIdleCancelClient::CImapNewMsgDuringSyncIdleCancelClient(MImapTestEventHandler* aOwner)
+ : CActive(EPriorityStandard), iOwner(aOwner)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+EXPORT_C CImapNewMsgDuringSyncIdleCancelClient* CImapNewMsgDuringSyncIdleCancelClient::NewL(MImapTestEventHandler* aOwner)
+	{
+	CImapNewMsgDuringSyncIdleCancelClient* self = NewLC(aOwner);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+EXPORT_C CImapNewMsgDuringSyncIdleCancelClient* CImapNewMsgDuringSyncIdleCancelClient::NewLC(MImapTestEventHandler* aOwner)
+	{
+	CImapNewMsgDuringSyncIdleCancelClient* self = new(ELeave) CImapNewMsgDuringSyncIdleCancelClient(aOwner);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+	
+CImapNewMsgDuringSyncIdleCancelClient::~CImapNewMsgDuringSyncIdleCancelClient()
+	{
+	Cancel();
+	delete iMsvOperation;	
+	delete iSelection;
+	delete iClientMtm;
+	delete iClientRegistry;	
+	delete iSession;
+	delete iSessionObserver;
+	delete iAccounts;
+	}
+	
+	
+void CImapNewMsgDuringSyncIdleCancelClient::ConstructL()
+	{
+	// create an account
+	iAccounts = CEmailAccounts::NewL();	
+	CreateImapAccountL();
+	// Session observer. Needed to create a session
+	iSessionObserver = new (ELeave) TDummySessionObserver;
+	// Session. Needed to create a client registry.
+	iSession=CMsvSession::OpenSyncL(*iSessionObserver);
+	// Client registry. Needed to get the MTM component
+	iClientRegistry=CClientMtmRegistry::NewL(*iSession,KMsvDefaultTimeoutMicroSeconds32);
+	// get the client mtm
+	iClientMtm=iClientRegistry->NewMtmL(KUidMsgTypeIMAP4);	
+	
+	// Load the serial comms device drivers.  If this is not done,
+	// connecting via NT-RAS returns KErrNotFound (-1).
+	TInt driverErr;
+	driverErr=User::LoadPhysicalDevice(PDD_NAME);
+	if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists)
+		User::Leave(driverErr);
+	driverErr=User::LoadLogicalDevice(LDD_NAME);
+	if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists)
+		User::Leave(driverErr);
+	}
+	
+TImapAccount CImapNewMsgDuringSyncIdleCancelClient::GetImapAccount()
+	{
+	return iImapAccount;
+	}
+	
+void CImapNewMsgDuringSyncIdleCancelClient::CreateImapAccountL()
+	{
+	// create objects and initialise with the defaults
+	CImImap4Settings* imap4Settings=new(ELeave)CImImap4Settings;
+	CleanupStack::PushL(imap4Settings);
+	CImSmtpSettings* smtpSettings=new(ELeave)CImSmtpSettings;
+	CleanupStack::PushL(smtpSettings);
+	CImIAPPreferences* imapIap = CImIAPPreferences::NewLC();
+	CImIAPPreferences* smtpIap = CImIAPPreferences::NewLC();
+	
+	iAccounts->PopulateDefaultImapSettingsL(*imap4Settings, *imapIap);
+	iAccounts->PopulateDefaultSmtpSettingsL(*smtpSettings, *smtpIap);
+	
+	// override some of the defaults
+	imap4Settings->SetPasswordL(_L8("roberth"));
+	imap4Settings->SetLoginNameL(_L8("roberth"));
+	imap4Settings->SetServerAddressL(KLoopbackAddress);
+	imap4Settings->SetFolderPathL(_L8(""));
+	imap4Settings->SetSynchronise(EUseLocal);
+	
+	// create the account
+	iImapAccount = iAccounts->CreateImapAccountL(_L("TestAccount"), *imap4Settings, *imapIap, EFalse);
+	TSmtpAccount smtpAccount;
+	smtpAccount = iAccounts->CreateSmtpAccountL(iImapAccount, *smtpSettings, *smtpIap, EFalse);
+
+	// clean up
+	CleanupStack::PopAndDestroy(smtpIap);
+	CleanupStack::PopAndDestroy(imapIap);	
+	CleanupStack::PopAndDestroy(smtpSettings);
+	CleanupStack::PopAndDestroy(imap4Settings); 
+	}
+
+void CImapNewMsgDuringSyncIdleCancelClient::StartL()
+	{
+	
+	// we are to collect the whole email: the next operation will be to fetch it
+	iNextStep = ESync1;
+	iSelection = new (ELeave) CMsvEntrySelection;
+	TPckg<MMsvImapConnectionObserver*> param(this);
+	// select the imap service entry
+	iSelection->AppendL(iImapAccount.iImapService);
+	// make the service entry the current context
+	iClientMtm->SwitchCurrentEntryL(iImapAccount.iImapService);
+	// sync the account
+	iMsvOperation = iClientMtm->InvokeAsyncFunctionL(KIMAP4MTMConnectAndSyncCompleteAfterFullSync,*iSelection,param,iStatus);
+	SetActive();
+	}
+	
+void CImapNewMsgDuringSyncIdleCancelClient::DoCancel()
+	{	
+	__ASSERT_DEBUG(iMsvOperation!=NULL, User::Panic(_L("CImapNewMsgDuringSyncIdleCancelClient"), -3));
+	iMsvOperation->Cancel();
+	}
+
+void CImapNewMsgDuringSyncIdleCancelClient::RunL()
+	{
+	TPckg<MMsvImapConnectionObserver*> param(this);
+	
+	switch(iNextStep)
+		{
+		case ESync1:
+			{
+			// First step is to do a full sync. This will cause the cancel idle to be sent, at
+			// which point the spoof server will respond to indicate a new message has been
+			// received. Without the defect fix, this step will panic.
+			iNextStep=ESync2;
+			delete iMsvOperation;
+			iMsvOperation=NULL;
+			iMsvOperation = iClientMtm->InvokeAsyncFunctionL(KIMAP4MTMFullSync, *iSelection, param, iStatus);
+			SetActive();
+			break;
+			}
+
+		case ESync2:
+			{
+			// Try to do another full sync. As before, this will cause the cancel idle to be
+			// sent, at which point the spoof server will respond to indicate a new message
+			// has been received.
+			// This step is used to make sure that we have left the session state machine in
+			// the correct state after the first step so that further operations can be
+			// performed. It also makes it easy to spot when the test fails as for a failure,
+			// the panic in the first step will mean only 2 messages are downloaded, whereas
+			// for the successful case, 3 messages will be downloaded.
+			iNextStep=EDisconnect;
+			delete iMsvOperation;
+			iMsvOperation=NULL;
+			iMsvOperation = iClientMtm->InvokeAsyncFunctionL(KIMAP4MTMFullSync, *iSelection, param, iStatus);
+			SetActive();
+			break;
+			}
+
+		case EDisconnect:
+			{
+			// We have finished, so do a disconnect
+			iNextStep=EComplete;
+			delete iMsvOperation;
+			iMsvOperation=NULL;
+			iMsvOperation = iClientMtm->InvokeAsyncFunctionL(KIMAP4MTMDisconnect,*iSelection,param,iStatus);
+			SetActive();
+			break;
+			}
+
+		case EComplete:
+			{
+			// inform the owning object that the process is complete
+			iOwner->TestComplete(KErrNone);
+			break;
+			}
+
+		default:
+			{
+			__ASSERT_DEBUG(0, User::Panic(_L("CImapNewMsgDuringSyncIdleCancelClient unknown state"), KErrUnknown));
+			break;			
+			}
+		}
+	}
+	
+TInt CImapNewMsgDuringSyncIdleCancelClient::RunError(TInt aError)
+	{
+	iOwner->TestComplete(aError);
+	return KErrNone;
+	}
+	
+void CImapNewMsgDuringSyncIdleCancelClient::HandleImapConnectionEvent(TImapConnectionEvent /*aConnectionState*/)
+	{
+	// this method does nothing
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_ImapNewMsgDuringSyncIdleCancelServer.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,107 @@
+// Copyright (c) 2005-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 server waits for the idle read to be cancelled by the sync command, and then sends a '* 2 EXISTS' command to indicate that
+// a new message has arrived.
+// 2. The client connects to the server, requests a sync and a populate.
+// 3. Client / server interact to complete the sync and populate. One message is fetched.
+// 4. The client requests a full sync (causing the idle read cancel).
+// 5. The server indicates a new message has arrived
+// 6. Client / server interact to complete the full sync. The new message is fetched
+// 7. The client requests a full sync (causing the idle read cancel).
+// 8. The server indicates a new message has arrived
+// 9. Client / server interact to complete the full sync. The new message is fetched
+// 10. The client disconnects.
+// 
+//
+
+/**
+ @SYMTestCaseID DEF067159
+ @SYMTestType UT
+ @SYMTestPriority High
+ @SYMDEF DEF067159
+ @SYMTestCaseDesc IMAP spoof server test that checks that a new message indication is correctly handled if idle read is being cancelled during a sync
+ @SYMTestActions 1. The Server is started and listens on port 143.
+ @SYMTestExpectedResults Client should have fetched three messages
+*/
+
+#include "T_ImapNewMsgDuringSyncIdleCancelServer.h"
+#include "T_ImapNewMsgDuringSyncIdleCancelStep.h"
+
+_LIT(KServerName,"T_ImapNewMsgDuringSyncIdleCancel");
+
+CImapNewMsgDuringSyncIdleCancelServer* CImapNewMsgDuringSyncIdleCancelServer::NewL()
+	{
+	CImapNewMsgDuringSyncIdleCancelServer * server = new (ELeave) CImapNewMsgDuringSyncIdleCancelServer();
+	CleanupStack::PushL(server);
+	server->ConstructL(KServerName);
+
+	CleanupStack::Pop(server);
+	return server;
+	}
+
+CImapNewMsgDuringSyncIdleCancelServer::CImapNewMsgDuringSyncIdleCancelServer()
+	{}
+
+CImapNewMsgDuringSyncIdleCancelServer::~CImapNewMsgDuringSyncIdleCancelServer()
+	{}
+
+LOCAL_C void MainL()
+	{
+	CActiveScheduler* sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CleanupStack::PushL(sched);
+	CActiveScheduler::Install(sched);
+	CImapNewMsgDuringSyncIdleCancelServer* server = NULL;
+	// Create the CTestServer derived server
+	TRAPD(err,server = CImapNewMsgDuringSyncIdleCancelServer::NewL());
+	CleanupStack::PushL(server);
+	if(!err)
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	CleanupStack::PopAndDestroy(2,sched);
+	}
+
+GLDEF_C TInt E32Main()
+	{
+	__UHEAP_MARK;
+	
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAPD(err,MainL());
+	delete cleanup;
+	
+	__UHEAP_MARKEND;
+	return err;
+    }
+
+RFs& CImapNewMsgDuringSyncIdleCancelServer::Fs()
+	{
+	return iFs;
+	};	
+
+CTestStep* CImapNewMsgDuringSyncIdleCancelServer::CreateTestStep(const TDesC& aStepName)
+	{
+	CTestStep* testStep = NULL;
+	
+	if(aStepName == KTestImapNewMsgDuringSyncIdleCancel)
+		testStep = new CImapNewMsgDuringSyncIdleCancelStep();
+
+	return testStep;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_ImapNewMsgDuringSyncIdleCancelStep.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,188 @@
+// Copyright (c) 2005-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 server waits for the idle read to be cancelled by the sync command, and then sends a '* 2 EXISTS' command to indicate that
+// a new message has arrived.
+// 2. The client connects to the server, requests a sync and a populate.
+// 3. Client / server interact to complete the sync and populate. One message is fetched.
+// 4. The client requests a full sync (causing the idle read cancel).
+// 5. The server indicates a new message has arrived
+// 6. Client / server interact to complete the full sync. The new message is fetched
+// 7. The client requests a full sync (causing the idle read cancel).
+// 8. The server indicates a new message has arrived
+// 9. Client / server interact to complete the full sync. The new message is fetched
+// 10. The client disconnects.
+// 
+//
+
+/**
+ @SYMTestCaseID DEF067159
+ @SYMTestType UT
+ @SYMTestPriority High
+ @SYMDEF DEF067159
+ @SYMTestCaseDesc IMAP spoof server test that checks that a new message indication is correctly handled if idle read is being cancelled during a sync
+ @SYMTestActions 1. The Server is started and listens on port 143.
+ @SYMTestExpectedResults Client should have fetched three messages
+*/
+
+#include "T_ImapNewMsgDuringSyncIdleCancelStep.h"
+#include "T_ImapNewMsgDuringSyncIdleCancelClient.h"
+
+#include "emailtestutils.h"
+
+#include <e32test.h>
+
+RTest test(_L("IMAP receive new message while synch is cancelling idle"));
+
+const TInt KSizeDateTimeBuffer = 45;
+const TInt KImapPort = 143;
+ 
+LOCAL_C void FormatDateTime(TDes& aBuffer, const TTime& aTime)
+	{ 
+	aBuffer.Zero();
+	_LIT(KFormat4,"%/0%1%/1%2%/2%3%/3 %-B%:0%J%:1%T%:2%S%:3%+B");
+	aTime.FormatL(aBuffer,KFormat4); 
+	}
+
+CImapNewMsgDuringSyncIdleCancelStep::CImapNewMsgDuringSyncIdleCancelStep()
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KTestImapNewMsgDuringSyncIdleCancel);
+	}
+
+CImapNewMsgDuringSyncIdleCancelStep::~CImapNewMsgDuringSyncIdleCancelStep()
+	{
+	delete iConsole;
+	delete iSpoofServer;	
+	delete iTestUtils;
+	delete iImapClient;	
+	delete iScheduler;
+	if(iSession!=NULL)
+		iSession->CloseMessageServer();
+	delete iSession;
+	delete iSessionObserver;
+	}
+
+void CImapNewMsgDuringSyncIdleCancelStep::TestComplete(TInt aEventCode)
+	{
+	CActiveScheduler::Stop();
+
+	if(aEventCode!=KErrNone && aEventCode!=KErrEof)
+		{
+		ERR_PRINTF2(_L("Error: %d"),aEventCode);	
+		}
+	}
+
+void CImapNewMsgDuringSyncIdleCancelStep::PrintEntryTime(TTime* aTIme)
+	{
+	TBuf<KSizeDateTimeBuffer> dateTimeString;
+	FormatDateTime(dateTimeString,*aTIme); 
+	INFO_PRINTF2(_L("%S"),&dateTimeString);	
+	}
+		
+void CImapNewMsgDuringSyncIdleCancelStep::GetDetailsFromIniFileL()
+	{
+	// get the script file path
+	_LIT(KScriptFile,"ScriptFile");	
+	if(!GetStringFromConfig(ConfigSection(),KScriptFile,iScriptFile))
+		{
+		_LIT(KErrorScriptFile, "Error reading script file path from ini file");
+		ERR_PRINTF1(KErrorScriptFile);
+		User::Leave(KErrArgument);
+		}
+
+	// get the expected number of mails
+	_LIT(KExpectedCountString, "ExpectedEntryCount");
+	if(!GetIntFromConfig(ConfigSection(),KExpectedCountString,iExpectedEntryCount))
+		{
+		_LIT(KErrorExpectedCount, "Error reading expected entry count from ini file");
+		ERR_PRINTF1(KErrorExpectedCount);
+		User::Leave(KErrArgument);	
+		}
+	}
+
+TVerdict CImapNewMsgDuringSyncIdleCancelStep::doTestStepPreambleL()
+	{
+	SetTestStepResult(EPass);
+	iScheduler = new (ELeave) CActiveScheduler;
+	CActiveScheduler::Install(iScheduler);
+	
+	iTestUtils = CEmailTestUtils::NewL(test);
+	iTestUtils->FileSession().SetSessionPath(_L("C:\\"));
+	iTestUtils->CleanMessageFolderL();
+	iTestUtils->ClearEmailAccountsL();
+	
+	iTestUtils->GoClientSideL();
+	
+	// start the imap server
+	GetDetailsFromIniFileL();
+	iConsole=Console::NewL(_L("IMAP Receive New Msg During Sync Idle Cancel"),TSize(KConsFullScreen,KConsFullScreen));
+	iSpoofServer = CSpoofServer::NewL(*this,iScriptFile);
+	iSpoofServer->StartL(KImapPort);
+		
+	// start the imap client
+	iImapClient = CImapNewMsgDuringSyncIdleCancelClient::NewL(this);
+	iImapClient->StartL();
+	
+	CActiveScheduler::Start();
+	return TestStepResult();
+	}
+
+TInt CImapNewMsgDuringSyncIdleCancelStep::GetEntryCountL()
+	{
+	TImapAccount imapAccount=iImapClient->GetImapAccount();
+	
+	TMsvSelectionOrdering ordering;	
+
+	// open the imap service entry
+	CMsvEntry* imapService = CMsvEntry::NewL(*iSession,imapAccount.iImapService,ordering);
+	CleanupStack::PushL(imapService);
+	// get its children
+	CMsvEntrySelection* msvEntrySelection;
+	msvEntrySelection=imapService->ChildrenL();
+	// open its child inbox entry
+	CMsvEntry* inboxEntry = CMsvEntry::NewL(*iSession, (*msvEntrySelection)[0],ordering);
+	CleanupStack::PushL(inboxEntry);
+    
+   // get the childeren of the inbox
+   delete msvEntrySelection;
+   msvEntrySelection=NULL;
+   msvEntrySelection=inboxEntry->ChildrenL();
+   TInt count=msvEntrySelection->Count();
+
+	delete msvEntrySelection;
+	msvEntrySelection=NULL;	
+	CleanupStack::PopAndDestroy(2,imapService);
+
+	return count;
+	}
+
+
+TVerdict CImapNewMsgDuringSyncIdleCancelStep::doTestStepL()
+	{
+	TVerdict result;
+	// Session observer. Needed to create a session
+	iSessionObserver = new (ELeave) TDummySessionObserver;
+	// Session. Needed to create a client registry.
+	iSession=CMsvSession::OpenSyncL(*iSessionObserver);
+	// get entry count
+	TInt entryCount=GetEntryCountL();
+	result = (entryCount==iExpectedEntryCount? EPass:EFail);
+	SetTestStepResult(result);
+	return TestStepResult();
+	}
+
+TVerdict CImapNewMsgDuringSyncIdleCancelStep::doTestStepPostambleL()
+	{
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_LOG.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,1118 @@
+// Copyright (c) 1998-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 <e32test.h>
+#include <f32fsys.h>
+#include <s32file.h>
+#include <e32base.h>
+#include <txtetext.h>
+#include <txtrich.h>
+#include <bautils.h>
+#include <miuthdr.h>
+#include <miutmsg.h>
+#include <miutset.h>  //KUidMsgTypePOP3
+#include <imutdll.h>	
+#include <imcvtext.h>
+#include <imcvrecv.h>
+#include <imcvsend.h>
+
+#include <imapset.h>
+
+//Oyster includes
+#include <msvstd.h>
+#include <msvids.h>
+#include <msvuids.h>
+#include <msvruids.h>
+#include <msvreg.h>
+
+#include <msventry.h> 
+#include <msvapi.h>
+#include <mtclbase.h>
+#include <cemailaccounts.h>
+#include <pop3set.h>
+
+#include <offop.h>
+
+#include "t_log.h"
+
+//----------------------------------------------------------------------------------------
+
+_LIT( KFileNameCombined, "Entry_All.txt");
+
+_LIT( KFileNameBody, "Entry_Bodys.txt");
+_LIT( KFileNameHeader, "Entry_Header.txt");
+_LIT( KFileNameMimeHeader, "Entry_MimeHeader.txt");
+_LIT( KFileNameSettings, "Entry_Settings.txt");
+
+_LIT( KFileNameEntryStruct, "Entry_Zac.txt");
+
+//----------------------------------------------------------------------------------------
+
+_LIT(KPerCentS, "%S");
+_LIT(KCRLF, "\r\n");
+
+
+//----------------------------------------------------------------------------------------
+
+// nicked from IMCM::OFFOP.CPP
+
+LOCAL_D const TUid KUidImQueuedOperationList = {0x10001794};	// 2648441492 dec.
+
+//----------------------------------------------------------------------------------------
+// Handy conversion routines between 8 and 16bit worlds
+
+#define Ptr8From16( aText ) TPtrC8( (const TUint8 *)(aText).Ptr(), (aText).Size() )
+#define Ptr16From8( aText ) TPtrC16( (const TUint16 *)(aText).Ptr(), (aText).Size()/2 )
+
+LOCAL_C HBufC16* HBuf16From8LC( const TDesC8& aText )
+	{
+	HBufC16* pOutputLine = HBufC16::NewLC( aText.Length() );
+	TPtr16 pOutput = pOutputLine->Des();
+	pOutput.Zero();
+
+	TUint8 theChar;
+	TInt i=0;
+	
+	while(i<aText.Length())
+		{
+		theChar=aText[i++];
+		pOutput.Append( (TUint16)theChar );
+		}
+
+	return pOutputLine;
+	}
+
+// Note this function will lose data if fed text other than ISO-8859-1
+LOCAL_C HBufC8* HBuf8From16LC( const TDesC16& aText )
+	{
+	HBufC8* pOutputLine = HBufC8::NewLC( aText.Length() );
+	TPtr8 pOutput = pOutputLine->Des();
+	pOutput.Zero();
+
+	TUint16 theChar;
+	TInt i=0;
+	
+	while(i<aText.Length())
+		{
+		theChar=aText[i++];
+		pOutput.Append( (TUint8)theChar );
+		}
+
+	return pOutputLine;
+	}
+
+//----------------------------------------------------------------------------------------
+
+class COutputterOverflow: public TDes16Overflow
+	{
+public:
+	COutputterOverflow( COutputter* aPutter );
+	void Overflow(TDes16& aDes);
+private:
+	COutputter* iPutter;
+	};
+
+//----------------------------------------------------------------------------------------
+//----------------------------------------------------------------------------------------
+
+COutputterOverflow::COutputterOverflow( COutputter* aPutter )
+	{
+	iPutter = aPutter;
+	}
+
+void COutputterOverflow::Overflow(TDes16 &aDes)
+	{
+	TRAPD(ret,iPutter->PrintL( _L("\r\n\r\n\r\n") ));
+	TRAP(ret,iPutter->PrintL( _L("Overflow when outputting data")));
+	TRAP(ret,iPutter->PrintL( aDes ));
+	TRAP(ret,iPutter->PrintL( _L("\r\n\r\n\r\n")));
+	}
+
+//----------------------------------------------------------------------------------------
+
+COutputter* COutputter::NewL(RTest* aTest)
+	{
+	COutputter* putter = new (ELeave) COutputter;
+	CleanupStack::PushL(putter);
+
+	putter->iTest = aTest;
+	putter->iUseFiles = ETrue;
+	putter->ConstructL();
+
+	CleanupStack::Pop();
+	return putter;
+	}
+
+void COutputter::ConstructL()
+	{
+	iOverflow = new(ELeave) COutputterOverflow( this );
+	iPrefix.FillZ();
+	}
+
+COutputter::~COutputter()
+	{
+	while ( iFilesOpen > 0 )
+		UnSetFile();
+
+	delete iOverflow;
+	}
+
+void COutputter::SetRFs(RFs* aFs)
+	{
+	iFs = aFs;
+	}
+
+void COutputter::UnSetFile()
+	{
+	if ( iFilesOpen > 0 )
+		iFile[--iFilesOpen].Close();
+	}
+
+void COutputter::SetFilePrefix( TUint aNum )
+	{
+	iPrefix.Format( _L("%08x_"), aNum);
+	}
+
+void COutputter::SetFileL( const TDesC& aLeafName, TBool aUnicode )
+	{
+	if ( iUseFiles )
+		{
+		if (iFilesOpen >= 4)
+			iTest->Panic( _L("Too many open files") );
+
+		RFile& file = iFile[iFilesOpen++];
+
+		TFileName name = iPrefix;
+		name += aLeafName;
+		
+		TInt err = file.Open( *iFs, name, EFileShareAny | EFileStreamText | EFileWrite);
+		if (err == KErrNotFound) // file does not exist - create it
+			err = file.Create( *iFs, name, EFileShareAny | EFileStreamText | EFileWrite);
+		User::LeaveIfError(err);
+
+		// not sure what this is for - but it was in originally
+		TInt offset=0;
+		(*iTest)(file.Seek(ESeekEnd, offset)==KErrNone);
+
+		iUnicode=aUnicode;
+		}
+	iPrefix.FillZ();
+	}
+
+void COutputter::PrintL( const TDesC8& aText ) // should be L
+ 	{
+	if ( iFilesOpen > 0 )
+		{
+		if (iUnicode)
+			{
+			HBufC16 *buf = HBuf16From8LC( aText );
+			iFile[iFilesOpen-1].Write( Ptr8From16(*buf) );
+			CleanupStack::PopAndDestroy(); // buf
+			}
+		else
+			iFile[iFilesOpen-1].Write( aText );
+		}
+	else
+		{
+#if _UNICODE
+		HBufC16 *buf = HBuf16From8LC( aText );
+		PrintL( *buf );
+		CleanupStack::PopAndDestroy(); // buf
+#else
+		TInt len = aText.Length();
+		for ( TInt pos = 0; pos < len; pos += 256 )
+			{
+			TPtrC ptr = aText.Mid( pos, len-pos<256?len-pos:256 );
+			iTest->Printf( KPerCentS, &ptr );
+			}
+#endif
+		}
+	}
+
+void COutputter::PrintL( const TDesC16& aText ) // should be L
+	{
+	if ( iFilesOpen > 0 )
+		{
+		if (iUnicode)
+			iFile[iFilesOpen-1].Write( Ptr8From16( aText ) );
+		else
+			{
+			HBufC8 *buf = HBuf8From16LC( aText );
+			iFile[iFilesOpen-1].Write( *buf );
+			CleanupStack::PopAndDestroy(); // buf
+			}
+		}
+	else
+		{
+#if _UNICODE
+		// write data in chunks to ensure no overrun of underlying
+		// Printf function
+		TInt len = aText.Length();
+		for ( TInt pos = 0; pos < len; pos += 256 )
+			{
+			TPtrC ptr = aText.Mid( pos, len-pos<256?len-pos:256 );
+			iTest->Printf( KPerCentS, &ptr );
+			}
+#else
+		HBufC8 *buf = HBuf8From16LC( aText );
+		PrintL( *buf );
+		CleanupStack::PopAndDestroy(); // buf
+#endif
+		}
+	}
+
+void COutputter::Printf( TRefByValue<const TDesC> aFmt, ... )
+	{
+	TBuf<1024> buf;
+
+	VA_LIST list;
+	VA_START( list, aFmt );
+	buf.AppendFormatList( aFmt, list, iOverflow );
+	VA_END( list );
+	
+	TRAP_IGNORE(PrintL( buf ));
+	}
+
+void COutputter::PrintIfNotNullL( const TDesC& aLabel, const TDesC8& aValue )
+	{
+	if ( aValue.Length() )
+		{
+		PrintL( aLabel );
+		PrintL( aValue );
+		PrintL( KCRLF );
+		}	
+	}
+
+void COutputter::PrintIfNotNullL( const TDesC& aLabel, const TDesC16& aValue )
+	{
+	if ( aValue.Length() )
+		{
+		PrintL( aLabel );
+		PrintL( aValue );
+		PrintL( KCRLF );
+		}	
+	}
+
+void COutputter::PrintListL( const TDesC& aLabel, CDesC8Array& aList )
+	{
+	for(TInt i=0; i < aList.Count(); i++)
+		{
+		PrintL(aLabel);
+		PrintL(aList[i]);
+		PrintL(KCRLF);
+		}
+	}
+
+void COutputter::PrintListL( const TDesC& aLabel, CDesC16Array& aList )
+	{
+	for(TInt i=0; i < aList.Count(); i++)
+		{
+		PrintL(aLabel);
+		PrintL(aList[i]);
+		PrintL(KCRLF);
+		}
+	}
+
+void COutputter::PrintDataL( const TDesC8& aData )
+	{
+	TInt i;
+	for(i=0; i < aData.Length(); i++)
+		{
+		Printf(_L("%02x "), aData[i]);
+		if ((i&7)==7)
+			PrintL(KCRLF);
+		}
+	if ((i&7)!=0)
+		PrintL(KCRLF);
+	}
+
+void CMsgOutputter::RemoveRichtextFormatting(TDes& aSourceLine)
+	{
+	TUint16* ptr = (TUint16*)aSourceLine.Ptr();
+	TUint16* start = ptr;
+
+	TInt totalLength = aSourceLine.Length();
+	do {
+		if(*ptr==CEditableText::EParagraphDelimiter || *ptr==CEditableText::ELineBreak || *ptr==CEditableText::EPageBreak)
+			*ptr=0x0A;
+		} while((++ptr-start)<totalLength);
+	}
+
+//----------------------------------------------------------------------------------------
+void CMsgOutputter::BodyDataL( CMsvStore& aFileStore )
+//----------------------------------------------------------------------------------------
+	{
+	CParaFormatLayer* paraLayer = CParaFormatLayer::NewL();
+	CleanupStack::PushL(paraLayer);
+
+	CCharFormatLayer* charLayer = CCharFormatLayer::NewL();
+	CleanupStack::PushL(charLayer);
+
+	CRichText* body = CRichText::NewL(paraLayer,charLayer);
+	CleanupStack::PushL(body);
+
+	aFileStore.RestoreBodyTextL(*body);
+
+	HBufC* pBodyText = HBufC::NewLC(body->DocumentLength()+(body->DocumentLength()/70)+1);
+
+	if ( iParts==EToMultipleFiles )
+		iPutter->SetFileL( KFileNameBody );
+	iPutter->Printf( _L("*** %08x *************** RichText Data ***************\r\n"), iMsgId);
+	iPutter->Printf( _L("Size >>> %d\r\n"), body->DocumentLength());
+	
+	TPtr pBody = pBodyText->Des();
+	body->Extract(pBody, 0);
+	RemoveRichtextFormatting(pBody);
+	iPutter->PrintL( pBody );
+	
+	iPutter->PrintL(_L("\r\n********************* end of Body ***********************\r\n"));
+	
+	CleanupStack::PopAndDestroy(4); // pBodyText, paraLayer, charLayer, body
+
+	if ( iParts==EToMultipleFiles )
+		iPutter->UnSetFile();
+	}
+
+
+//----------------------------------------------------------------------------------------
+void CMsgOutputter::MimeHeaderL( CMsvStore& aFileStore )
+//----------------------------------------------------------------------------------------
+	{
+	if ( iParts==EToMultipleFiles )
+		iPutter->SetFileL( KFileNameMimeHeader );
+
+	iPutter->Printf(_L("*** %08x ************* Mime Header ******************\r\n"), iMsgId);
+
+	CImMimeHeader* mimeHeader = CImMimeHeader::NewLC();
+	mimeHeader->RestoreL(aFileStore);
+	
+	iPutter->Printf(_L("Version: %d\r\n"),mimeHeader->Version());
+
+	iPutter->PrintIfNotNullL( _L("Content-Type: "), mimeHeader->ContentType() );
+	iPutter->PrintIfNotNullL( _L("Content-Type,SubType: "), mimeHeader->ContentSubType() );
+	iPutter->PrintIfNotNullL( _L("Content-Disposition: "), mimeHeader->ContentDisposition() );
+	iPutter->PrintIfNotNullL( _L("Content-Description: "), mimeHeader->ContentDescription() );
+	iPutter->PrintIfNotNullL( _L("Content-Base: "), mimeHeader->ContentBase() );
+	iPutter->PrintIfNotNullL( _L("Content-ID: "), mimeHeader->ContentID() );
+	iPutter->PrintIfNotNullL( _L("Content-Location: "), mimeHeader->ContentLocation() );
+
+	if ( mimeHeader->ContentTransferEncoding() )
+		iPutter->Printf( _L("Content-Transfer-Encoding: %d\r\n"), mimeHeader->ContentTransferEncoding() );
+
+	iPutter->PrintListL( _L("ContentTypeParams: "), mimeHeader->ContentTypeParams() );
+	iPutter->PrintListL( _L("ContentDispositionParams: "), mimeHeader->ContentDispositionParams() );
+
+	iPutter->PrintL(_L("******************** end of MIME Header ****************\r\n"));
+	if ( iParts==EToMultipleFiles )
+		iPutter->UnSetFile();
+
+	CleanupStack::PopAndDestroy(); // mimeHeader
+	}
+
+//----------------------------------------------------------------------------------------
+void CMsgOutputter::HeaderL( CMsvStore& aFileStore )
+//----------------------------------------------------------------------------------------
+	{
+	if ( iParts==EToMultipleFiles )
+		iPutter->SetFileL( KFileNameHeader );
+	iPutter->Printf( _L("*** %08x ************* Rfc822 Header ****************\r\n"), iMsgId);
+
+	CImHeader* header = CImHeader::NewLC();
+	
+	TUint emptySize = header->DataSize();
+	header->RestoreL(aFileStore);
+
+	TUint size = header->DataSize()-emptySize;
+
+	iPutter->Printf(_L("Size >>> %d\r\n"), size);
+	iPutter->PrintIfNotNullL(_L("Subject: "), header->Subject());
+	iPutter->PrintIfNotNullL(_L("ID: "), header->ImMsgId());
+	iPutter->PrintIfNotNullL(_L("From: "), header->From());
+	iPutter->PrintIfNotNullL(_L("Reply-To: "), header->ReplyTo());
+	iPutter->PrintIfNotNullL(_L("Return-Receipt-To: "), header->ReceiptAddress());
+
+	iPutter->PrintListL(_L("To: "), header->ToRecipients());
+	iPutter->PrintListL(_L("Cc: "), header->CcRecipients());
+	iPutter->PrintListL(_L("Bcc: "), header->BccRecipients());
+	
+	iPutter->PrintL(_L("******************** end of RFC822 header **************\r\n"));
+
+	if ( iParts==EToMultipleFiles )
+		iPutter->UnSetFile();
+	CleanupStack::PopAndDestroy(); // header
+	}
+
+TPtrC CMsgOutputter::SyncTypeString( TFolderSyncType aType )
+	{
+	switch (aType)
+		{
+	case EUseCombination:
+		return _L("UseCombination");
+		
+	case EUseLocal:
+		return _L("UseLocal");
+
+	case EUseRemote:
+		return _L("UseRemote");
+		}
+	return _L("");
+	}
+
+TPtrC CMsgOutputter::SubscribeTypeString( TFolderSubscribeType aType )
+	{
+	switch (aType)
+		{
+	case EUpdateNeither:
+		return _L("UpdateNeither");
+		
+	case EUpdateLocal:
+		return _L("UpdateLocal");
+
+	case EUpdateRemote:
+		return _L("UpdateRemote");
+
+	case EUpdateBoth:
+		return _L("UpdateBoth");
+		}
+	return _L("");
+	}
+
+TPtrC CMsgOutputter::GetMailOptionsString( TImap4GetMailOptions aOpts )
+	{
+	switch (aOpts)
+		{
+	case EGetImap4EmailHeaders:
+		return _L("GetImap4EmailHeaders");
+	case EGetImap4EmailBodyText:
+		return _L("GetImap4EmailBodyText");
+	case EGetImap4EmailBodyTextAndAttachments:
+		return _L("GetImap4EmailBodyTextAndAttachments");
+	case EGetImap4EmailAttachments:
+		return _L("GetImap4EmailAttachments");
+		}
+	return _L("");
+	}
+
+//----------------------------------------------------------------------------------------
+void CMsgOutputter::Imap4SettingsL(const TMsvEntry& aEntry)
+//----------------------------------------------------------------------------------------
+	{
+	if ( iParts==EToMultipleFiles )
+		iPutter->SetFileL( KFileNameSettings );
+	iPutter->Printf(_L("*** %08x ************* Settings ****************\r\n"), iMsgId);
+
+	CImImap4Settings* settings = new (ELeave)CImImap4Settings();
+	CleanupStack::PushL(settings);
+	CEmailAccounts* accounts = CEmailAccounts::NewLC();
+	
+	TImapAccount imapAccountId;
+	accounts->GetImapAccountL(aEntry.Id(), imapAccountId);
+	accounts->LoadImapSettingsL(imapAccountId, *settings);
+	CleanupStack::PopAndDestroy(accounts);
+
+	iPutter->Printf(         _L("IAP index:                     %u\r\n"), iEntry->Entry().MtmData1());
+	iPutter->PrintIfNotNullL( _L("LoginName:                     "), settings->LoginName());
+	iPutter->PrintIfNotNullL( _L("Password:                      "), settings->Password());
+	iPutter->PrintIfNotNullL( _L("FolderPath:                    "), settings->FolderPath());
+	iPutter->Printf(         _L("PathSeparator:                 %c\r\n"), settings->PathSeparator());
+	iPutter->Printf(         _L("DisconnectedUserMode:          %u\r\n"), settings->DisconnectedUserMode()?1:0);
+	iPutter->PrintIfNotNullL( _L("Synchronise:                   "), SyncTypeString(settings->Synchronise()));
+	iPutter->PrintIfNotNullL( _L("Subscribe:                     "), SubscribeTypeString(settings->Subscribe()));
+	iPutter->Printf(         _L("AutoSendOnConnect:             %u\r\n"), settings->AutoSendOnConnect()?1:0);
+	iPutter->Printf(         _L("MaxEmailSize:                  %u\r\n"), settings->MaxEmailSize());
+	iPutter->Printf(         _L("DeleteEmailsWhenDisconnecting: %u\r\n"), settings->DeleteEmailsWhenDisconnecting()?1:0);
+	iPutter->Printf(         _L("AcknowledgeReceipts:           %u\r\n"), settings->AcknowledgeReceipts()?1:0);
+	iPutter->PrintIfNotNullL( _L("GetMailOptions:                "), GetMailOptionsString(settings->GetMailOptions()));
+
+	iPutter->PrintIfNotNullL( _L("Server:                        "), settings->ServerAddress());
+	iPutter->Printf(         _L("Port:                          %u\r\n"), settings->Port());
+	iPutter->Printf(         _L("Secure:                        %u\r\n"), settings->SecureSockets()?1:0);
+	
+	iPutter->PrintL(_L("******************** end of Settings **************\r\n"));
+	if ( iParts==EToMultipleFiles )
+		iPutter->UnSetFile();
+
+	CleanupStack::PopAndDestroy(); // settings
+	}
+
+
+//----------------------------------------------------------------------------------------
+void CMsgOutputter::SettingsL(const TMsvEntry& aEntry)
+//----------------------------------------------------------------------------------------
+	{
+	if ( iParts==EToMultipleFiles )
+		iPutter->SetFileL( KFileNameSettings );
+	iPutter->Printf(_L("*** %08x ************* Settings ****************\r\n"), iMsgId);
+
+	CImBaseEmailSettings* settings(NULL);
+	
+	CEmailAccounts* accounts = CEmailAccounts::NewLC();
+	
+	
+	if (aEntry.iMtm == KUidMsgTypeIMAP4)
+		{
+		CImImap4Settings* imap4Settings = new(ELeave) CImImap4Settings;
+		TImapAccount imapAccountId;
+		accounts->GetImapAccountL(aEntry.Id(), imapAccountId);
+		accounts->LoadImapSettingsL(imapAccountId, *imap4Settings);
+		settings = imap4Settings;
+		}
+	else if (aEntry.iMtm == KUidMsgTypePOP3)
+		{
+		CImPop3Settings* pop3Settings = new(ELeave) CImPop3Settings;
+		TPopAccount pop3AccountId;
+		accounts->GetPopAccountL(aEntry.Id(), pop3AccountId);
+		accounts->LoadPopSettingsL(pop3AccountId, *pop3Settings);
+		settings = pop3Settings;
+		}
+	else if (aEntry.iMtm == KUidMsgTypeSMTP)
+		{
+		CImSmtpSettings* smtpSettings = new(ELeave) CImSmtpSettings;
+		TSmtpAccount smtpAccountId;
+		accounts->GetSmtpAccountL(aEntry.Id(), smtpAccountId);
+		accounts->LoadSmtpSettingsL(smtpAccountId, *smtpSettings);
+		settings = smtpSettings;
+		}
+	else
+		{
+		User::Leave(KErrNotFound);
+		}
+
+	iPutter->Printf(         _L("IAP index: %u\r\n"), iEntry->Entry().MtmData1());
+	iPutter->PrintIfNotNullL( _L("Server:    "), settings->ServerAddress());
+	iPutter->Printf(         _L("Port:      %u\r\n"), settings->Port());
+	iPutter->Printf(         _L("Secure:    %u\r\n"), settings->SecureSockets());
+	
+	iPutter->PrintL(_L("******************** end of Settings **************\r\n"));
+	if ( iParts==EToMultipleFiles )
+		iPutter->UnSetFile();
+	
+	CleanupStack::PopAndDestroy(); // settings
+
+	CleanupStack::PopAndDestroy(accounts);
+	}
+
+
+TPtrC CMsgOutputter::OffLineOpTypeString(CImOffLineOperation::TOffLineOpType op)
+	{
+	switch (op)
+		{
+	case CImOffLineOperation::EOffLineOpNone:
+		return _L("None");
+
+	case CImOffLineOperation::EOffLineOpCopyToLocal:
+		return _L("CopyToLocal");
+	case CImOffLineOperation::EOffLineOpCopyFromLocal:
+		return _L("CopyFromLocal");
+	case CImOffLineOperation::EOffLineOpCopyWithinService:
+		return _L("CopyWithinService");
+
+	case CImOffLineOperation::EOffLineOpMoveToLocal:
+		return _L("MoveToLocal");
+	case CImOffLineOperation::EOffLineOpMoveFromLocal:
+		return _L("MoveFromLocal");
+	case CImOffLineOperation::EOffLineOpMoveWithinService:
+		return _L("MoveWithinService");
+
+	case CImOffLineOperation::EOffLineOpDelete:
+		return _L("Delete");
+
+	case CImOffLineOperation::EOffLineOpChange:
+		return _L("Change");
+	case CImOffLineOperation::EOffLineOpCreate:
+		return _L("Create");
+
+	case CImOffLineOperation::EOffLineOpMtmSpecific:
+		return _L("MtmSpecific");
+
+	default:
+		break;
+		}
+	return _L("Unknown");
+	}
+
+//----------------------------------------------------------------------------------------
+void CMsgOutputter::QueuedOpsL( CMsvStore& aFileStore )
+//----------------------------------------------------------------------------------------
+	{
+	if ( iParts==EToMultipleFiles )
+		iPutter->SetFileL( KFileNameSettings );
+	iPutter->Printf(_L("*** %08x ************* Queued operations ****************\r\n"), iMsgId);
+
+	CImOffLineOperationArray* ops=CImOffLineOperationArray::NewL();
+	CleanupStack::PushL(ops);
+
+	CImOffLineArrayStore arraystore(*ops);
+	arraystore.RestoreL(aFileStore);
+	
+	for (TInt opNum=0; opNum < ops->CountOperations(); opNum++)
+		{
+		const CImOffLineOperation& op = ops->Operation(opNum);
+		iPutter->PrintL(         _L("------------------\r\n"));
+		iPutter->Printf(        _L("Operation %d\r\n"), opNum);
+		iPutter->PrintIfNotNullL(_L("OpType:   "), OffLineOpTypeString(op.OpType()));
+		iPutter->Printf(        _L("Message:  %08x\r\n"), op.MessageId());
+		iPutter->Printf(        _L("Target:   %08x\r\n"), op.TargetMessageId());
+		if (op.OpType() == CImOffLineOperation::EOffLineOpMtmSpecific)
+			{
+			iPutter->Printf(        _L("Function: %d\r\n"), op.MtmFunctionId());
+			iPutter->Printf(        _L("Data:     %d bytes\r\n"), op.MtmParameters().Length());
+			iPutter->PrintDataL(op.MtmParameters());
+			}
+		}
+	
+	iPutter->PrintL(_L("******************** end of Queued operations **************\r\n"));
+	if ( iParts==EToMultipleFiles )
+		iPutter->UnSetFile();
+	
+	CleanupStack::PopAndDestroy(); // ops
+	}
+
+
+//----------------------------------------------------------------------------------------
+
+TPtrC CMsgOutputter::TypeString( const TMsvEmailEntry& entry )
+	{
+	TPtrC type;
+	if(entry.iType == KUidMsvRootEntry)
+		type.Set(_L("ROOT"));
+	else if(entry.iType == KUidMsvServiceEntry)
+		type.Set(_L("SERVICE"));
+	else if(entry.iType == KUidMsvFolderEntry)
+		type.Set(_L("FOLDER"));
+	else if(entry.iType == KUidMsvMessageEntry)
+		type.Set(_L("MESSAGE"));
+	else if(entry.iType == KUidMsvEmailTextEntry)
+		type.Set(_L("TEXT"));
+	else if(entry.iType == KUidMsvAttachmentEntry)
+		type.Set(_L("ATTACHMENT"));
+	else if(entry.iType == KUidMsvEmailHtmlEntry)
+		type.Set(_L("HTML"));
+	else
+		type.Set(_L("UNKNOWN"));
+	return type;
+	}
+
+TPtrC CMsgOutputter::PriorityString( const TMsvEmailEntry& entry )
+	{
+	TPtrC priority;
+	TMsvPriority temp=entry.Priority();
+	if(temp==EMsvHighPriority)
+		priority.Set(_L("Hi"));
+	else if(temp==EMsvMediumPriority)
+		priority.Set(_L("Me"));
+	else if(temp==EMsvLowPriority)
+		priority.Set(_L("Lo"));
+	else
+		priority.Set(_L("No"));
+	return priority;
+	}
+
+TPtrC CMsgOutputter::DisconnectedOpString( const TMsvEmailEntry& entry )
+	{
+	TImDisconnectedOperationType opType = entry.DisconnectedOperation();
+	switch (opType)
+		{
+	case ENoDisconnectedOperations:
+		return _L("Non");
+	case EDisconnectedCreateOperation:
+		return _L("Cre");
+	case EDisconnectedDeleteOperation:
+		return _L("Del");
+	case EDisconnectedChangeOperation:
+		return _L("Cha");
+	case EDisconnectedCopyToOperation:
+		return _L("CTo");
+	case EDisconnectedCopyFromOperation:
+		return _L("CFr");
+	case EDisconnectedCopyWithinServiceOperation:
+		return _L("CWi");
+	case EDisconnectedMoveToOperation:
+		return _L("MTo");
+	case EDisconnectedMoveFromOperation:
+		return _L("MFr");
+	case EDisconnectedMoveWithinServiceOperation:
+		return _L("MWi");
+	case EDisconnectedSpecialOperation:
+		return _L("Spe");
+	case EDisconnectedUnknownOperation:
+		return _L("Unk");
+	case EDisconnectedMultipleOperation:
+		return _L("Mul");
+	default:
+		break;
+		}
+	return _L("");
+	}
+
+void CMsgOutputter::FlagsString( TBuf<8>& other, const TMsvEmailEntry& entry )
+	{
+	other = _L("--------");
+
+	if(entry.Visible())
+		other.Replace(0, 1, _L("V"));
+	if(entry.Complete())
+		other.Replace(7, 1, _L("C"));
+
+	if (entry.iType == KUidMsvFolderEntry)
+		{
+		if(entry.Subscribed())
+			other.Replace(1, 1, _L("S")); // subscribed on server
+		if(entry.LocalSubscription())
+			other.Replace(2, 1, _L("L")); // subscribed to locally
+		if(entry.ValidUID())
+			other.Replace(3, 1, _L("I"));
+		}
+	else
+		{
+		if(entry.New())
+			other.Replace(1, 1, _L("N"));
+		if(entry.Unread())
+			other.Replace(2, 1, _L("U"));
+		if(entry.Receipt())
+			other.Replace(3, 1, _L("R"));
+		if(entry.Orphan())
+			other.Replace(4, 1, _L("O"));
+		if(entry.MHTMLEmail())
+			other.Replace(5, 1, _L("M"));
+		if(entry.Attachment())
+			other.Replace(6, 1, _L("A"));
+		}
+	}
+
+void CMsgOutputter::IMAP4FlagsString( TBuf<7>& other, const TMsvEmailEntry& entry )
+	{
+	other = _L("-------");
+
+	if(entry.UnreadIMAP4Flag())
+		other.Replace(0, 1, _L("U"));
+	if(entry.SeenIMAP4Flag())
+		other.Replace(1, 1, _L("S"));
+	if(entry.AnsweredIMAP4Flag())
+		other.Replace(2, 1, _L("A"));
+	if(entry.FlaggedIMAP4Flag())
+		other.Replace(3, 1, _L("F"));
+	if(entry.DeletedIMAP4Flag())
+		other.Replace(4, 1, _L("X"));
+	if(entry.DraftIMAP4Flag())
+		other.Replace(5, 1, _L("D"));
+	if(entry.RecentIMAP4Flag())
+		other.Replace(6, 1, _L("R"));
+	}
+
+void CMsgOutputter::OutputPartsL(TBuf<5>& aStreams)
+	{
+	aStreams=_L("-----");
+
+	if(iEntry->HasStoreL())
+		{
+		CMsvStore* fileStore = iEntry->ReadStoreL();
+		CleanupStack::PushL(fileStore);
+		
+		TMsvEmailEntry entry = iEntry->Entry(); // Get Details
+
+		iPutter->SetFilePrefix(entry.Id());
+		
+		if (iParts == EToOneFile)
+			iPutter->SetFileL(KFileNameCombined);
+		
+		// messages
+		if(fileStore->IsPresentL(KUidMsgFileIMailHeader))
+			{
+			if (iParts!=ENone)
+				HeaderL(*fileStore);
+			aStreams.Replace(0, 1, _L("H"));
+			}
+		if(fileStore->IsPresentL(KUidMsgFileMimeHeader))
+			{
+			if (iParts!=ENone)
+				MimeHeaderL(*fileStore);
+			aStreams.Replace(1, 1, _L("M"));
+			}
+		if(fileStore->IsPresentL(KMsvEntryRichTextBody))
+			{
+			if (iParts!=ENone)
+				BodyDataL(*fileStore);
+			aStreams.Replace(2, 1, _L("B"));
+			}
+		if(entry.Attachment())
+			aStreams.Replace(3, 1, _L("A"));
+
+		// services
+		if(fileStore->IsPresentL(KUidMsvServiceEntry))
+			{
+			if (iParts!=ENone)
+				{
+				if (entry.iMtm==KUidMsgTypeIMAP4)
+					Imap4SettingsL(entry);
+				else
+					SettingsL(entry);
+				}
+			aStreams.Replace(0, 1, _L("S"));
+			}
+
+		// folders and services
+		if(fileStore->IsPresentL(KUidImQueuedOperationList))
+			{
+			if (iParts!=ENone)
+				QueuedOpsL(*fileStore);
+			aStreams.Replace(1, 1, _L("Q"));
+			}
+
+		if (iParts == EToOneFile)
+			iPutter->UnSetFile();
+
+		CleanupStack::PopAndDestroy(); // fileStore
+		}
+	}
+
+CMsgOutputter* CMsgOutputter::NewL( COutputter* aPutter, CMsvServerEntry* aEntry )
+	{
+	CMsgOutputter* self = new(ELeave) CMsgOutputter(aPutter,aEntry);
+	return self;
+	}
+
+CMsgOutputter::CMsgOutputter( COutputter* aPutter, CMsvServerEntry* aEntry )
+	: iPutter(aPutter), iEntry(aEntry)
+	{
+	}
+
+CMsgOutputter::~CMsgOutputter()
+	{
+	}
+
+void CMsgOutputter::DumpL( TMsvId aId, TInt aSummary,
+						   TInt aParts,
+						   TBool aRecurse, TBool aShowIds,
+						   MsgMatchFn aMatch )
+	{
+	iEntry->SetEntry(aId);
+
+	iSummary = aSummary;
+	iParts = aParts;
+	iRecurse = aRecurse;
+	iShowIds = aShowIds;
+	iMatch = aMatch;
+
+	if (iSummary == EToOneFile)
+		{
+		iPutter->SetFileL( KFileNameEntryStruct );
+		iPutter->PrintL( _L8("Store: (H)eader (M)ime header (B)ody (A)ttachment (S)ervice data (Q)ueuedops\r\n") );
+		iPutter->PrintL( _L8("Flags: (V)isible (C)omplete (S)ubscribed (L)ocalsubscribe validu(I)d\r\n") );
+		iPutter->PrintL( _L8("Flags: (N)ew (U)nread (R)eceipt (O)rphan (M)html (A)ttachment\r\n") );
+		iPutter->PrintL( _L8("IMAP4: (U)nread (S)een (A)nswered (F)lagged (X)Deleted (D)raft (R)ecent\r\n") );
+		iPutter->PrintL( _L8("\r\n") );
+		}
+
+	__UHEAP_MARK;
+	DumpRecurseL();
+	__UHEAP_MARKEND;
+
+	if (iSummary == EToOneFile)
+		iPutter->UnSetFile();
+
+	// park
+	iEntry->SetEntry(KMsvNullIndexEntryId);
+	}
+
+void CMsgOutputter::DumpRecurseL()
+	{
+	const TMsvEmailEntry entry = iEntry->Entry(); // Get Details
+
+	// we may not want to show ids because they are not persistent
+	// over message store wipes
+	iMsgId = iShowIds ? entry.Id() : 0;
+
+//	TBool matchThis = iMatch ? (*iMatch)(entry) : ETrue;
+	TBool matchThis = iMatch ? (*iMatch)(iEntry) : ETrue;
+
+	TBuf<5> streams;
+	if (matchThis)
+		OutputPartsL(streams);
+	
+	// find the children
+	CMsvEntrySelection* msvSelection = new (ELeave) CMsvEntrySelection;
+	CleanupStack::PushL(msvSelection);
+	User::LeaveIfError( iEntry->GetChildren(*msvSelection) );
+	
+	TInt attachCount = msvSelection->Count(); 	// For each child ..
+
+	if (matchThis && iSummary != ENone)
+		{
+		// get information about the entry
+		TPtrC type = TypeString( entry );
+		TPtrC priority = PriorityString( entry );
+
+		TBuf<7> imap4flags;
+		IMAP4FlagsString(imap4flags, entry);
+
+		TBuf<8> other;
+		FlagsString(other, entry);
+
+		TPtrC discOp = DisconnectedOpString(entry);
+		
+		// indent according to depth
+		TInt i;
+		for(i=0; i<iDepth; i++)
+			iPutter->PrintL(_L(" "));
+
+		iPutter->Printf( _L("%S"), &type );
+
+		for(i=iDepth + type.Length(); i<8+10; i++)
+			iPutter->PrintL(_L(" "));
+
+		iPutter->Printf( _L(" %08x [%3d], Size=%8d, Store=%S, D=%S, P=%S, F=%S, I4F=%S, R=%08x, uid=%08x, mtm=%08x"),
+						 entry.Id(),
+						 attachCount, 
+						 entry.iSize,
+						 &streams,
+						 &discOp,
+						 &priority,
+						 &other,
+						 &imap4flags,
+						 entry.iRelatedId,
+						 entry.UID(),
+						 entry.iMtm);
+
+		iPutter->Printf( _L(", '%S'"), &entry.iDescription );
+		iPutter->Printf( _L(", '%S'"), &entry.iDetails );
+		iPutter->PrintL( KCRLF );
+		}
+	
+	if ( iRecurse )
+		{
+		iDepth++;
+
+		for(TInt j=0; j<attachCount; j++)
+			{
+			iEntryCount++;
+
+			iEntry->SetEntry((*msvSelection)[j]);
+		
+			__UHEAP_MARK;
+			DumpRecurseL();
+			__UHEAP_MARKEND;
+			}	
+
+		iDepth--;
+		}
+
+	CleanupStack::PopAndDestroy(); // msvSelection
+}
+
+//----------------------------------------------------------------------------------------
+//----------------------------------------------------------------------------------------
+
+class CTextFile : public RFile
+	{
+public:
+	CTextFile();
+	~CTextFile();
+
+	TInt ReadChar(TDes& aDes);
+	TPtrC ReadLineL();
+	void SetUnicodeL();
+	
+private:
+	HBufC *iBuf;
+	TBool iFileIsUnicode;
+	};
+
+CTextFile::CTextFile()
+	{
+#if _UNICODE
+	iFileIsUnicode = ETrue;
+#else
+	iFileIsUnicode = EFalse;
+#endif
+	}
+
+CTextFile::~CTextFile()
+	{
+	if (iBuf != NULL)
+		delete iBuf;
+	}
+
+void CTextFile::SetUnicodeL()
+	{
+	TBuf8<2> c;
+	User::LeaveIfError(Read(c,2));
+
+	TInt pos = 0;
+	User::LeaveIfError(Seek(ESeekAddress,pos));
+
+	// OK this is not guaranteed to work but it will in all cases
+	// where we have created the files
+	iFileIsUnicode = c[1] == 0;
+	}
+
+TInt CTextFile::ReadChar(TDes& aDes)
+	{
+	TInt err;
+	if (iFileIsUnicode)
+		{
+		TBuf8<2> c;
+		err = Read(c, 2);
+	
+		aDes[0] = c[0];
+#if _UNICODE
+		aDes[0] |= c[1] << 8;
+		// truncate the high byte if in non-Unicode build
+#endif
+		}
+	else
+		{
+#if _UNICODE
+		TBuf8<1> c;
+		err = Read(c, 1);
+		aDes[0] = c[0];
+#else
+		err = Read(aDes, 1);
+#endif
+		}
+
+	return err;
+	}
+
+TPtrC CTextFile::ReadLineL()
+	{
+	if (iBuf == NULL)
+		iBuf = HBufC::NewL(512);
+
+	TBuf<1> c;
+	TBool finished = EFalse;
+	do
+		{
+		User::LeaveIfError(ReadChar(c));
+		
+		if (c.Length() && c[0] != 0xA0)
+			{
+			TPtr16 des = iBuf->Des();
+			if (iBuf->Length() == des.MaxLength())
+				iBuf = iBuf->ReAllocL(iBuf->Length()*2);
+			
+			des.Append(c);
+			}
+		else
+			finished = ETrue;
+		}
+	while (!finished);
+
+	return iBuf->Des();
+	}
+
+//----------------------------------------------------------------------------------------
+
+// eof T_LOG.CPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_PARSE_UTC_IMAPServer.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,85 @@
+// Copyright (c) 2005-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 "t_parse_utc_imapserver.h"
+#include "t_parse_utc_imapstep.h"
+
+_LIT(KServerName,"T_ImapParseUtcServer");
+CParseUTCServer* CParseUTCServer::NewL()
+	{
+	CParseUTCServer * server = new (ELeave) CParseUTCServer();
+	CleanupStack::PushL(server);
+	server-> ConstructL(KServerName);
+
+	CleanupStack::Pop(server);
+	return server;
+	}
+	
+LOCAL_C void MainL()
+
+	{
+	RProcess().DataCaging(RProcess::EDataCagingOn);
+	RProcess().SecureApi(RProcess::ESecureApiOn);
+	CActiveScheduler* sched=NULL;
+	sched=new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(sched);
+	CParseUTCServer* server = NULL;
+	// Create the CTestServer derived server
+	TRAPD(err,server = CParseUTCServer::NewL());
+	if(!err)
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	delete server;
+	server = NULL;
+	delete sched;
+	}
+
+
+GLDEF_C TInt E32Main()
+	{
+	__UHEAP_MARK;
+	
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAPD(err,MainL());
+	delete cleanup;
+	
+	__UHEAP_MARKEND;
+	return err;
+    }
+
+
+RFs& CParseUTCServer::Fs()
+	{
+	return iFs;
+	};	
+
+CTestStep* CParseUTCServer::CreateTestStep(const TDesC& aStepName)
+	{
+		
+	CTestStep* testStep = NULL;
+	
+	if(aStepName == KTestUTCParse)
+		testStep = new CTestUTCParse();
+
+
+	return testStep;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_PARSE_UTC_IMAPStep.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,307 @@
+// Copyright (c) 2005-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 sever contains emails with multiple or missing date header fields to ensure that the IAMP
+// parser correctly parses the data. The first received header should be used where present, 
+// the date header when its not. The current UTC time should be used if neither are present.
+// 2. The client connects to the server and request a sync.
+// 3. The server reads the protocol information from a file specified in the ini file (mapUTCTest.ini).
+// 4. The client disconnects.
+// 5. The message store is traversed to see if the correct timestamps have been given to the 
+// message entries.
+// 
+//
+
+/**
+ @SYMTestCaseID MSG-IMAP-0243
+ @SYMTestType UT
+ @SYMTestPriority High
+ @SYMPREQ 234
+ @SYMTestCaseDesc Implements an IMAP server to facilitate offline testing of imap parsing. 
+ @SYMTestActions  1. The Server is started and listens on port 143.
+ @SYMTestExpectedResults The timestamps of the message entries should be the same as in the ini file.
+*/
+
+#include <testexecutelog.h>
+#include "t_parse_utc_imapstep.h"
+
+
+_LIT(KUTCTest,"UTC-TIME");
+_LIT(KTestMessageDir,"rfc822\\parse\\");
+RTest test(_L("UTC Parse Test"));
+
+ 
+LOCAL_C void FormatDateTime(TDes& aBuffer, const TTime& aTime)
+	{ 
+	aBuffer.Zero();
+	_LIT(KFormat4,"%/0%1%/1%2%/2%3%/3 %-B%:0%J%:1%T%:2%S%:3%+B");
+	aTime.FormatL(aBuffer,KFormat4); 
+	}
+		
+CTestUTCParse::~CTestUTCParse()
+	{
+	delete iConsole;
+	delete iImapServer;	
+	delete iTestUtils;
+	delete iImapClient;	
+	delete iScheduler;
+	iSession->CloseMessageServer();
+	delete iSession;
+	delete iSessionObserver;
+	}
+
+CTestUTCParse::CTestUTCParse()
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KTestUTCParse);
+	}
+	
+
+
+void CTestUTCParse::HandleEvent(TInt aEventCode)
+	{
+	CActiveScheduler::Stop();	
+	
+	if(aEventCode!=KErrNone && aEventCode!=KErrEof)
+		{
+		ERR_PRINTF2(_L("Error: %d"),aEventCode);	
+		}
+	
+	}
+
+		
+void CTestUTCParse::PrintEntryTime(TTime* aTIme)
+	{
+	TBuf<45> lDateTimeString;
+	FormatDateTime(lDateTimeString,*aTIme); 
+	INFO_PRINTF2(_L("%S"),&lDateTimeString);	
+	}
+		
+		
+void CTestUTCParse::GetDetailsFromIniFileL()
+	{
+	
+	//get the script file path
+	if(!GetStringFromConfig(ConfigSection(),_L("ScriptFile"),iScriptFile))
+	
+		{
+		ERR_PRINTF1(_L("Error reading script file path from ini file"));
+		User::Leave(KErrArgument);	
+		}
+
+	TPtrC16 expectedTime;
+	//get the expected time stamp
+	if(!GetStringFromConfig(ConfigSection(),_L("ExpectedTime"),expectedTime))
+	
+		{
+		ERR_PRINTF1(_L("Error reading expected time stamp file path from ini file"));
+		User::Leave(KErrArgument);	
+		}
+	else
+		{
+		TInt pos=expectedTime.Find(KUTCTest);
+		
+		if(pos!=KErrNotFound)
+			{
+			iExpectedTimeStampIsNow=ETrue;
+			iExpectedTimeStamp.UniversalTime();
+			}
+		else
+			{
+			iExpectedTimeStampIsNow=EFalse;
+			iExpectedTimeStamp.Set(expectedTime);			
+			}
+		
+		}
+		
+	//get the script file path
+	if(!GetBoolFromConfig(ConfigSection(),_L("FetchWholeMessage"),iFetchWholeMessage))
+	
+		{
+		ERR_PRINTF1(_L("Error reading script file path from ini file"));
+		User::Leave(KErrArgument);	
+		}
+	//if the test contains an embedded test then get the expected timestamp for the 
+	//embedded message
+	if(iFetchWholeMessage==1)
+		{		
+		if(!GetStringFromConfig(ConfigSection(),_L("ExpectedTime2"),expectedTime))
+			{
+			ERR_PRINTF1(_L("Error reading expected time stamp file path from ini file"));
+			User::Leave(KErrArgument);	
+			}
+		else
+			{
+			TInt pos=expectedTime.Find(KUTCTest);
+		
+			if(pos!=KErrNotFound)
+				{
+				iExpectedTimeStampIsNow2=ETrue;
+				iExpectedTimeStamp2.UniversalTime();
+				}
+			else
+				{
+				iExpectedTimeStampIsNow2=EFalse;
+				iExpectedTimeStamp2.Set(expectedTime);			
+				}				
+			}
+		}
+		
+	}
+	
+
+void CTestUTCParse::WriteStoreL()
+	{
+	//create the entry_structure file
+	TParse parsedFileName;
+	TFileName lName(KTestMessageDir);
+	iTestUtils->ResolveLogFile(lName, parsedFileName);
+	iTestUtils->FindChildrenL(KMsvRootIndexEntryIdValue, parsedFileName.FullName(), ETrue, EFalse);	
+	}
+ 	
+void CTestUTCParse::TraverseL(const TMsvId aTMsvId)
+	{
+	//open the entry, dont sort
+	TMsvSelectionOrdering ordering;	
+	ordering.SetSorting(EMsvSortByNone);
+	CMsvEntry* entry = CMsvEntry::NewL(*iSession, aTMsvId,ordering);
+	CleanupStack::PushL(entry);
+	
+	//retrieve the entries children
+	CMsvEntrySelection* msvEntrySelection;
+	msvEntrySelection=entry->ChildrenL();
+	CleanupStack::PushL(msvEntrySelection);
+	TInt count = entry->Count();
+	
+	CMsvEntry* child;
+	TMsvEntry childDetails;
+
+	//for each child test if its a message entry
+	for(TInt i=0;i<count;i++)
+		{
+		child=iSession->GetEntryL((*msvEntrySelection)[i]);
+		childDetails=child->Entry();
+		
+		if(childDetails.iType==KUidMsvMessageEntry)
+			{
+			iMessageEntryCount++;
+			//if this is the first timestamp the us iActualTimeStamp, else use iActualTimeStamp2
+			if(iActualTimeStamp==0)
+				{
+				iActualTimeStamp=childDetails.iDate;
+				PrintEntryTime(&childDetails.iDate);	
+				}
+			else
+				{
+				iActualTimeStamp2=childDetails.iDate;
+				PrintEntryTime(&childDetails.iDate);	
+				}
+			}
+		//recursive call
+		TraverseL(childDetails.Id());
+		
+		delete child;
+		}
+			
+	CleanupStack::PopAndDestroy(msvEntrySelection);
+	CleanupStack::PopAndDestroy(entry);
+		
+	}
+	
+
+TVerdict CTestUTCParse::doTestStepPreambleL()
+	{
+	
+	SetTestStepResult(EPass);
+	iScheduler = new (ELeave) CActiveScheduler;
+	CActiveScheduler::Install(iScheduler);
+	
+	iTestUtils = CEmailTestUtils::NewL(test);
+	iTestUtils->FileSession().SetSessionPath(_L("C:\\"));
+	iTestUtils->CleanMessageFolderL();
+	iTestUtils->ClearEmailAccountsL();
+	
+	iTestUtils->GoClientSideL();
+	
+	//start the imap server
+	GetDetailsFromIniFileL();
+	iConsole=Console::NewL(_L("IMAP UTC Parse Test"),TSize(KConsFullScreen,KConsFullScreen));
+	iImapServer = CImapSpoofServer::NewL(this,iScriptFile);
+	iImapServer->StartL();
+		
+	//start the imap client
+	iImapClient = CActiveImapClient::NewL(this,iFetchWholeMessage);
+	iImapClient->StartL();
+	
+	CActiveScheduler::Start();
+
+	return TestStepResult();
+	}
+
+	
+TVerdict CTestUTCParse::CheckTimeStamps()
+	{
+	TVerdict lResult;
+	
+	if(iExpectedTimeStampIsNow==EFalse)
+		{
+		lResult = (iActualTimeStamp==iExpectedTimeStamp? EPass:EFail);
+		}
+	else
+		{
+		TTimeIntervalMicroSeconds difference;
+		difference=iExpectedTimeStamp.MicroSecondsFrom(iActualTimeStamp);
+		lResult = (difference<5000000? EPass:EFail);	
+		}
+		
+	// If there is an embedded message, check the times on that as well
+	if ((lResult == EPass) && (iFetchWholeMessage))
+		{
+		if(iExpectedTimeStampIsNow2==EFalse)
+			{
+			lResult = (iActualTimeStamp2==iExpectedTimeStamp2 ? EPass:EFail);
+			}
+		else
+			{
+			TTimeIntervalMicroSeconds difference;
+			difference=iExpectedTimeStamp2.MicroSecondsFrom(iActualTimeStamp2);
+			lResult = (difference<5000000? EPass:EFail);
+			}
+		}
+
+	return lResult;	
+	}
+		
+TVerdict CTestUTCParse::doTestStepL()
+	{
+	TVerdict result;
+	// Session observer. Needed to create a session
+	iSessionObserver = new (ELeave) TDummySessionObserver;
+	// Session. Needed to create a client registry.
+	iSession=CMsvSession::OpenSyncL(*iSessionObserver);
+	// Client registry. Needed to get the MTM component
+	TraverseL(iImapClient->GetAccount().iImapService);
+	WriteStoreL();
+	
+	result=CheckTimeStamps();
+
+	SetTestStepResult(result);
+	
+	return TestStepResult();
+	}
+	
+
+TVerdict CTestUTCParse::doTestStepPostambleL()
+	{
+	return TestStepResult();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_PartialDownloadImapClient.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,218 @@
+// Copyright (c) 2005-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 "t_partialdownloadimapclient.h"
+
+_LIT(KLoopbackAddress,"127.0.0.1");
+
+void TDummySessionObserver::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
+	{
+	}
+
+CPartialDownLoadImapClient::CPartialDownLoadImapClient(MImapTestEventHandler& aObserver,TBool aFetchWholeMessage) 
+: CActive(EPriorityStandard), iObserver(aObserver), iFetchWholeMessage(aFetchWholeMessage) 
+	{
+	CActiveScheduler::Add(this);
+	}
+
+CPartialDownLoadImapClient* CPartialDownLoadImapClient::NewL(MImapTestEventHandler& aObserver,TBool aFetchWholeMessage)
+	{
+	CPartialDownLoadImapClient* self = NewLC(aObserver,aFetchWholeMessage);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+CPartialDownLoadImapClient* CPartialDownLoadImapClient::NewLC(MImapTestEventHandler& aObserver,TBool aFetchWholeMessage)
+	{
+	CPartialDownLoadImapClient* self = new(ELeave) CPartialDownLoadImapClient(aObserver,aFetchWholeMessage);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+	
+CPartialDownLoadImapClient::~CPartialDownLoadImapClient()
+	{
+	Cancel();
+	delete iMsvOperation;	
+	delete iSelection;
+	delete iClientMtm;
+	delete iClientRegistry;	
+	delete iSession;
+	delete iSessionObserver;
+	delete iAccounts;
+	}
+	
+TImapAccount CPartialDownLoadImapClient::GetImapAccount()
+	{
+	return iImapAccount;	
+	}
+	
+void CPartialDownLoadImapClient::ConstructL()
+	{
+	//create an account
+	iAccounts = CEmailAccounts::NewL();	
+	CreateImapAccountL();
+	// Session observer. Needed to create a session
+	iSessionObserver = new (ELeave) TDummySessionObserver;
+	// Session. Needed to create a client registry.
+	iSession=CMsvSession::OpenSyncL(*iSessionObserver);
+	// Client registry. Needed to get the MTM component
+	iClientRegistry=CClientMtmRegistry::NewL(*iSession,KMsvDefaultTimeoutMicroSeconds32);
+	//get the client mtm
+	iClientMtm=iClientRegistry->NewMtmL(KUidMsgTypeIMAP4);	
+	
+	// Load the serial comms device drivers.  If this is not done,
+	// connecting via NT-RAS returns KErrNotFound (-1).
+	TInt driverErr;
+	driverErr=User::LoadPhysicalDevice(PDD_NAME);
+	if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists)
+		{
+		User::Leave(driverErr);	
+		}
+	driverErr=User::LoadLogicalDevice(LDD_NAME);
+	if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists)
+		{
+		User::Leave(driverErr);	
+		}
+	}
+	
+void CPartialDownLoadImapClient::CreateImapAccountL()
+	{
+	//create objects and initialise with the defaults
+	CImImap4Settings* imap4Settings=new(ELeave)CImImap4Settings;
+	CleanupStack::PushL(imap4Settings);
+	CImSmtpSettings* smtpSettings=new(ELeave)CImSmtpSettings;
+	CleanupStack::PushL(smtpSettings);
+	CImIAPPreferences* imapIap = CImIAPPreferences::NewLC();
+	CImIAPPreferences* smtpIap = CImIAPPreferences::NewLC();
+	
+	iAccounts->PopulateDefaultImapSettingsL(*imap4Settings, *imapIap);
+	iAccounts->PopulateDefaultSmtpSettingsL(*smtpSettings, *smtpIap);
+	
+	//override some of the defaults
+	imap4Settings->SetPasswordL(_L8("davids"));
+	imap4Settings->SetLoginNameL(_L8("davids"));
+	imap4Settings->SetServerAddressL(KLoopbackAddress);
+	imap4Settings->SetFolderPathL(_L8(""));
+	imap4Settings->SetSynchronise(EUseLocal);
+	
+	imap4Settings->SetPartialMailOptionsL(ECumulative);
+	imap4Settings->SetAttachmentSizeLimitL(2);
+	
+	//create the account
+	iImapAccount = iAccounts->CreateImapAccountL(_L("TestAccount"), *imap4Settings, *imapIap, EFalse);
+	TSmtpAccount smtpAccount;
+	smtpAccount = iAccounts->CreateSmtpAccountL(iImapAccount, *smtpSettings, *smtpIap, EFalse);
+
+	//clean up
+	CleanupStack::PopAndDestroy(4,imap4Settings); 
+	}
+
+void CPartialDownLoadImapClient::StartL()
+	{
+	//if we are to collect the whole email then the next operation will be to fetch it
+	iNextStep=(!iFetchWholeMessage? EDisconnect:EFetch);
+	iSelection = new (ELeave) CMsvEntrySelection;
+	TPckg<MMsvImapConnectionObserver*> param(this);
+	//select the imap service entry
+	iSelection->AppendL(iImapAccount.iImapService);
+	//make the service entry the current context
+	iClientMtm->SwitchCurrentEntryL(iImapAccount.iImapService);
+	//sync the account
+	iMsvOperation = iClientMtm->InvokeAsyncFunctionL(KIMAP4MTMConnectAndSyncCompleteAfterFullSync,*iSelection,param,iStatus);			
+	SetActive();
+	}
+	
+void CPartialDownLoadImapClient::DoCancel()
+	{	
+	__ASSERT_DEBUG(iMsvOperation!=NULL, User::Invariant());
+	iMsvOperation->Cancel();
+	}
+
+void CPartialDownLoadImapClient::RunL()
+	{
+	User::LeaveIfError(iStatus.Int());
+	
+	TPckg<MMsvImapConnectionObserver*> param(this);
+	TImImap4GetPartialMailInfo imapGetPartialMailInfo;
+	imapGetPartialMailInfo.iPartialMailOptions=ECumulative;
+	imapGetPartialMailInfo.iBodyTextSizeLimit = 2;	
+	imapGetPartialMailInfo.iAttachmentSizeLimit = 2;
+	TPckgBuf<TImImap4GetPartialMailInfo> package(imapGetPartialMailInfo);
+	
+	CMsvEntry* inboxEntry=NULL;
+	CMsvEntry* imapService=NULL;
+	TMsvSelectionOrdering ordering;
+	
+	switch(iNextStep)
+		{
+		//connect and sync	
+		case EDisconnect:
+			delete iMsvOperation;
+			iMsvOperation=NULL;
+			iMsvOperation = iClientMtm->InvokeAsyncFunctionL(KIMAP4MTMDisconnect,*iSelection,param,iStatus);	
+			SetActive();
+			iNextStep=EComplete;
+			break;	
+			
+		case EFetch:
+			// message in remote inbox					
+			//create a CMsvEntry for the service entry
+			imapService = CMsvEntry::NewL(*iSession, iImapAccount.iImapService,ordering);
+			CleanupStack::PushL(imapService);
+			//retrieve the inbox from the imap service entry
+			CMsvEntrySelection* msvEntrySelection;
+			msvEntrySelection=imapService->ChildrenL();
+			CleanupStack::PushL(msvEntrySelection);
+			//create a CMsvEntry for the inbox entry
+			inboxEntry = CMsvEntry::NewL(*iSession, (*msvEntrySelection)[0],ordering);
+			CleanupStack::PopAndDestroy(msvEntrySelection);
+			CleanupStack::PushL(inboxEntry);
+			//retrieve the message from the inboxEntry service entry
+			iSelection=inboxEntry->ChildrenL();
+
+			CleanupStack::PopAndDestroy(inboxEntry);
+			CleanupStack::PopAndDestroy(imapService);
+			delete iMsvOperation;
+			iMsvOperation=NULL;
+			iMsvOperation = iClientMtm->InvokeAsyncFunctionL(KIMAP4MTMPopulate, *iSelection, package, iStatus);	
+			SetActive();
+			iNextStep=EDisconnect;
+			break;
+		
+		case EComplete:
+			//inform the owning object that the process is complete
+			iObserver.TestComplete(KErrNone);
+			break;
+			
+		default:
+			__ASSERT_DEBUG(0, User::Panic(_L("CPartialDownLoadImapClient unknown state"), KErrUnknown));
+			break;			
+		}
+	}
+	
+TInt CPartialDownLoadImapClient::RunError(TInt aError)
+	{
+	iObserver.TestComplete(aError);
+	return KErrNone;
+	}
+	
+void CPartialDownLoadImapClient::HandleImapConnectionEvent(TImapConnectionEvent /*aConnectionState*/)
+	{
+	//this method does nothing
+	}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_PartialDownloadSpoofServer.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,81 @@
+// Copyright (c) 2005-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 "t_partialdownloadspoofserver.h"
+#include "t_partialdownloadstep.h"
+
+_LIT(KServerName,"T_PartialDownloadSpoofServer");
+CPartialDownloadSpoofServer* CPartialDownloadSpoofServer::NewL()
+	{
+	CPartialDownloadSpoofServer * server = new (ELeave) CPartialDownloadSpoofServer();
+	CleanupStack::PushL(server);
+	server-> ConstructL(KServerName);
+
+	CleanupStack::Pop(server);
+	return server;
+	}
+	
+LOCAL_C void MainL()
+	{
+	CActiveScheduler* sched=new(ELeave) CActiveScheduler;
+	CActiveScheduler::Install(sched);
+	CPartialDownloadSpoofServer* server = NULL;
+	// Create the CTestServer derived server
+	TRAPD(err,server = CPartialDownloadSpoofServer::NewL());
+	if(err==KErrNone)
+		{
+		// Sync with the client and enter the active scheduler
+		RProcess::Rendezvous(KErrNone);
+		sched->Start();
+		}
+	delete server;
+	delete sched;
+	}
+
+
+GLDEF_C TInt E32Main()
+	{
+	__UHEAP_MARK;
+	
+	CTrapCleanup* cleanup = CTrapCleanup::New();
+	if(cleanup == NULL)
+		{
+		return KErrNoMemory;
+		}
+	TRAPD(err,MainL());
+	delete cleanup;
+	
+	__UHEAP_MARKEND;
+	return err;
+    }
+
+
+RFs& CPartialDownloadSpoofServer::Fs()
+	{
+	return iFs;
+	};	
+
+CTestStep* CPartialDownloadSpoofServer::CreateTestStep(const TDesC& aStepName)
+	{
+		
+	CTestStep* testStep = NULL;
+	
+	if(aStepName == KTestPartialDownLoad)
+		{
+		testStep = new CPartialDownloadStep();		
+		}
+
+	return testStep;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_PartialDownloadStep.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,129 @@
+// Copyright (c) 2005-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 <testexecutelog.h>
+#include "t_partialdownloadstep.h"
+
+RTest test(_L("Partial Download Test"));
+const TInt KImapPort = 143;
+const TInt KEntryCount=2; 
+
+CPartialDownloadStep::~CPartialDownloadStep()
+	{
+	delete iConsole;
+	delete iSpoofServer;	
+	delete iTestUtils;
+	delete iImapClient;	
+	delete iScheduler;
+	iSession->CloseMessageServer();
+	delete iSession;
+	delete iSessionObserver;
+	}
+
+CPartialDownloadStep::CPartialDownloadStep()
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName(KTestPartialDownLoad);
+	}
+
+void CPartialDownloadStep::TestComplete(TInt aErrorCode)
+	{
+	CActiveScheduler::Stop();	
+	
+	if(aErrorCode!=KErrNone && aErrorCode!=KErrEof)
+		{
+		ERR_PRINTF2(_L("Error: %d"),aErrorCode);	
+		}
+	}
+
+	
+TVerdict CPartialDownloadStep::doTestStepPreambleL()
+	{
+	SetTestStepResult(EPass);
+	iScheduler = new (ELeave) CActiveScheduler;
+	CActiveScheduler::Install(iScheduler);
+	
+	iTestUtils = CEmailTestUtils::NewL(test);
+	iTestUtils->FileSession().SetSessionPath(_L("C:\\"));
+	iTestUtils->CleanMessageFolderL();
+	iTestUtils->ClearEmailAccountsL();
+	
+	iTestUtils->GoClientSideL();	
+	//start the imap server
+	iConsole=Console::NewL(_L("IMAP UTC Parse Test"),TSize(KConsFullScreen,KConsFullScreen));
+	iSpoofServer = CSpoofServer::NewL(*this,_L("c:\\msgtest\\imap\\partialDownload.txt"));
+	iSpoofServer->StartL(KImapPort);
+	//start the imap client
+	iImapClient = CPartialDownLoadImapClient::NewL(*this,ETrue);
+	iImapClient->StartL();
+	
+	CActiveScheduler::Start();
+	return TestStepResult();
+	}
+
+TInt CPartialDownloadStep::GetEntryCountL()
+	{
+	
+	TImapAccount imapAccount=iImapClient->GetImapAccount();
+	
+	TMsvSelectionOrdering ordering;	
+
+	//open the imap service entry
+	CMsvEntry* imapService = CMsvEntry::NewL(*iSession,imapAccount.iImapService,ordering);
+	CleanupStack::PushL(imapService);
+	//get its children
+	CMsvEntrySelection* msvEntrySelection;
+	msvEntrySelection=imapService->ChildrenL();
+	//open its child inbox entry
+	CMsvEntry* inboxEntry = CMsvEntry::NewL(*iSession, (*msvEntrySelection)[0],ordering);
+    CleanupStack::PushL(inboxEntry);
+    
+    //get the childeren of the inbox
+    delete msvEntrySelection;
+    msvEntrySelection=NULL;
+    msvEntrySelection=inboxEntry->ChildrenL();
+    //the count should be 2
+    TInt count=msvEntrySelection->Count();
+    
+    delete msvEntrySelection;
+    msvEntrySelection=NULL;	
+	CleanupStack::PopAndDestroy(2,imapService);
+	
+	return count;
+	}
+
+TVerdict CPartialDownloadStep::doTestStepL()
+	{
+	TVerdict result;
+	// Session observer. Needed to create a session
+	iSessionObserver = new (ELeave) TDummySessionObserver;
+	// Session. Needed to create a client registry.
+	iSession=CMsvSession::OpenSyncL(*iSessionObserver);
+	//get entry count
+	TInt entryCount=GetEntryCountL();
+	result = (entryCount==KEntryCount? EPass:EFail);
+	SetTestStepResult(result);
+	return TestStepResult();
+	}
+	
+
+TVerdict CPartialDownloadStep::doTestStepPostambleL()
+	{
+	return TestStepResult();
+	}
+	
+	
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/T_impssecuresocket.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,384 @@
+// Copyright (c) 2001-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:
+// Brief description of test harness:
+// Tests SSL/TLS functionality in IMPS
+// Input files required to run test harness:
+// None
+// Output files produced by running test harness:
+// <DRIVE>:\msglogs\T_IMPSSECURESOCKET.<PLATFORM>.<VARIANT>.LOG.txt
+// Description of how to build test harness:
+// cd \messaging\msg\imps\
+// bldmake bldfiles
+// abld test build T_IMPSSECURESOCKET
+// Description of how to run test harness:
+// The following instructions are the same for all platforms:
+// 2. Build the test utilities:
+// cd \messaging\msg\testutils\group\
+// bldmake bldfiles
+// abld build
+// WINS running instructions:
+// 1. \epoc32\release\wins\<VARIANT>\T_IMPSSECURESOCKET.exe can be used at the command prompt
+// or executable can be run from Windows Explorer.
+// All other platform running instructions:
+// 1. Copy \epoc32\release\<PLATFORM>\<VARIANT>\T_IMPSSECURESOCKET.exe onto the other platform
+// 2. Copy \epoc32\release\<PLATFORM>\<VARIANT>\MSVTESTUTILS.DLL into 
+// <DRIVE>:\system\libs on the other platform
+// 3. Copy \epoc32\release\<PLATFORM>\<VARIANT>\EMAILTESTUTILS.DLL into 
+// <DRIVE>:\system\libs on the other platform
+// 5. Run T_IMPSSECURESOCKET.exe on the other platform with the CF card
+// 
+//
+
+#include "EmailTestUtils.h"
+#include <miutmsg.h>
+#include "impsmtm.h"
+#include <securesocket.h>
+#include <bacline.h>
+#include <cemailaccounts.h>
+
+// For loading the serial comms device drivers 
+#if defined (__WINS__)
+	#define PDD_NAME		_L("ECDRV")
+	#define LDD_NAME		_L("ECOMM")
+#else
+	#define PDD_NAME		_L("EUART1")
+	#define LDD_NAME		_L("ECOMM")
+#endif
+
+
+LOCAL_D CTrapCleanup* theCleanup;
+LOCAL_D CEmailTestUtils* testUtils; 
+LOCAL_D CActiveScheduler* scheduler;
+LOCAL_D RFs theFs;	
+LOCAL_D TMsvId	imapService;
+
+
+_LIT(KImpsTest, "T_IMPSSECURESOCKET - IMPS SecureSockets Functionality Testing");
+
+RTest test(KImpsTest);
+
+_LIT(KTestParams,"-testparams");
+enum TCmdLineArgs
+	{
+	EArgProgramName,
+	EArgTestParams,
+	EArgServerAddress,
+	EArgLogin,
+	EArgPassword,
+	EArgEnd
+	};
+
+
+LOCAL_C TInt readConsoleLineBuf(const TDesC& aPrompt, TDes& aBuf)
+	{
+	test.Printf(_L("\n "));
+	TBool quit = EFalse;
+	_LIT(KDeleteChar, "\b \b");
+
+	test.Printf(aPrompt);
+	while (!quit)
+		{
+		TKeyCode k = test.Getch();
+		TChar key = k;
+		switch (key)
+			{
+		case EKeyBackspace:
+			if (aBuf.Length() > 0)
+				{
+				test.Printf(KDeleteChar);
+				aBuf = aBuf.Left(aBuf.Length() - 1);
+				}
+			break;
+		case EKeyEnter:
+			if (aBuf.Length())
+				quit = ETrue;
+			else
+				test.Printf(_L("\nLogin, password and server address cannot be zero length "));
+			break;
+		default:
+			test.Printf(_L("%c"), key);
+			aBuf.Append(key);
+			break;
+			}
+		}
+	return(KErrNone);
+	}
+
+
+
+class CImpsTestHarness : public CActive
+	{
+public:
+	static CImpsTestHarness* NewLC();
+	void SetUpImpsServiceL();
+	~CImpsTestHarness();
+	void StartTestL();
+	void EndTestL();
+	void RunL();
+	void DoCancel();
+private:
+	CImpsTestHarness();
+	void ConstructL();
+private:
+	TInt				iTestError;
+	TInt				iTestNumber;
+	CImap4ServerMtm*	imapServerMtm;
+	CMsvEntrySelection* iSel;
+	TImap4Cmds iCommand;
+	};
+
+
+//
+
+CImpsTestHarness  *CImpsTestHarness::NewLC()
+	{
+	CImpsTestHarness* self=new (ELeave) CImpsTestHarness();
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	return self;
+	}
+
+CImpsTestHarness::~CImpsTestHarness()
+	{
+	delete iSel;
+	}
+
+CImpsTestHarness::CImpsTestHarness()
+	: CActive(-1)
+	{
+	}
+
+void CImpsTestHarness::ConstructL()
+	{
+	CActiveScheduler::Add(this); // add to active scheduler
+	testUtils->CreateAllTestDirectories();
+	testUtils->FileSession().SetSessionPath(_L("C:\\"));
+	testUtils->CleanMessageFolderL();
+	testUtils->GoServerSideL();
+	// Get server MTM.
+	testUtils->Reset();
+	testUtils->CleanMessageFolderL();
+	testUtils->GoServerSideL();
+	SetUpImpsServiceL();
+	testUtils->InstantiateImapServerMtmL();
+	imapServerMtm=(CImap4ServerMtm*)testUtils->iImapServerMtm;
+	}
+
+void CImpsTestHarness::SetUpImpsServiceL()
+	{
+	// Handle command line arguments
+	CCommandLineArguments* cmdLineArg=CCommandLineArguments::NewLC();
+	TInt count = cmdLineArg->Count();
+	TBool isCmdLine=FALSE;
+	if (count>2)	// Command line arguments?
+		{
+		if ((!(cmdLineArg->Arg(EArgTestParams).Compare(KTestParams))) && count==EArgEnd)
+			isCmdLine=TRUE;
+		}	
+
+	imapService=testUtils->CreateImapServiceL();
+	testUtils->iServerEntry->SetEntry(imapService);
+
+	CImImap4Settings* settings = new(ELeave) CImImap4Settings();
+	CleanupStack::PushL(settings);
+	settings->Reset();
+
+
+	TBuf<100> buf;
+	if (isCmdLine)
+		{
+		TLex lex(cmdLineArg->Arg(EArgServerAddress));
+		buf=lex.NextToken();
+		test.Printf(_L("Server address: %S\n"),&buf);
+		}
+	else
+		{
+		readConsoleLineBuf(_L("Server address: "),buf);
+		}
+	settings->SetServerAddressL(buf);
+	buf.Zero();
+	if (isCmdLine)
+		{
+		TLex lex(cmdLineArg->Arg(EArgLogin));
+		buf=lex.NextToken();
+		test.Printf(_L("Login: %S\n"),&buf);
+		}
+	else
+		{
+		readConsoleLineBuf(_L("login: "),buf);
+		}
+	TBuf8<64> data;
+	data.Copy(buf);
+	settings->SetLoginNameL(testUtils->MachineName());
+	data.Zero();
+	buf.Zero();
+	if (isCmdLine)
+		{
+		TLex lex(cmdLineArg->Arg(EArgPassword));
+		buf=lex.NextToken();
+		test.Printf(_L("Password: %S\n"),&buf);
+		}
+	else
+		{
+		readConsoleLineBuf(_L("password: "),buf);
+		}
+	data.Copy(buf);
+	settings->SetPasswordL(testUtils->MachineName());
+
+	settings->SetFolderPathL(_L8(""));
+	settings->SetPort(143);
+	settings->SetPathSeparator('/');
+	settings->SetDisconnectedUserMode(ETrue);
+	settings->SetDeleteEmailsWhenDisconnecting(ETrue);
+	settings->SetGetMailOptions(EGetImap4EmailBodyTextAndAttachments);
+	settings->SetSecureSockets(ETrue); 
+	settings->SetSubscribe(EUpdateNeither);
+	settings->SetSynchronise(EUseCombination);
+	
+	CEmailAccounts* accounts = CEmailAccounts::NewLC();
+ 	TImapAccount imapAccount;
+ 	accounts->GetImapAccountL(imapService, imapAccount);						
+ 	accounts->SaveImapSettingsL(imapAccount, *settings);
+	CleanupStack::PopAndDestroy(3, settings); // accounts, settings, cmdLineArg
+	}
+
+void CImpsTestHarness::StartTestL()
+	{
+	testUtils->TestStart(1);
+	iSel = new (ELeave) CMsvEntrySelection;
+	iSel->AppendL(imapService);
+	TBuf8<128> parameter;
+	testUtils->WriteComment(_L("Calling KIMAP4MTMConnect ")); 
+	iCommand=KIMAP4MTMConnect;
+	imapServerMtm->StartCommandL(*iSel, iCommand, parameter, iStatus);
+	SetActive();
+	}
+
+void CImpsTestHarness::EndTestL()
+	{
+	testUtils->TestFinish(1, iTestError);
+	}
+
+
+void  CImpsTestHarness::DoCancel()
+	{
+	imapServerMtm->Cancel();
+	}
+
+void CImpsTestHarness::RunL()
+	{
+	TImap4CompoundProgress temp;	
+	TPckgC<TImap4CompoundProgress> paramPack(temp);
+
+	const TDesC8& progBuf = imapServerMtm->Progress();	
+	paramPack.Set(progBuf);
+	TImap4CompoundProgress progress=paramPack();	
+	TInt err=progress.iGenericProgress.iErrorCode;
+
+	if (iStatus.Int()!=KErrNone || iCommand==KIMAP4MTMDisconnect || err)
+		{
+		testUtils->TestFinish(1,err);
+		CActiveScheduler::Stop();
+		return;
+		}
+	if (iCommand==KIMAP4MTMConnect)
+		{
+		testUtils->WriteComment(_L("Calling KIMAP4MTMInboxNewSync ")); 
+		iCommand=KIMAP4MTMInboxNewSync;
+		TBuf8<128> parameter;
+		imapServerMtm->StartCommandL(*iSel, iCommand, parameter, iStatus);
+		SetActive();
+		return;
+		}
+
+	if (iCommand==KIMAP4MTMInboxNewSync)
+		{
+		iCommand=KIMAP4MTMDisconnect;
+		TBuf8<128> parameter;
+		imapServerMtm->StartCommandL(*iSel, iCommand, parameter, iStatus);
+		SetActive();
+		return;
+
+		}
+	}
+
+//
+
+LOCAL_C void Init()
+	{
+	scheduler = new (ELeave) CActiveScheduler;
+	CActiveScheduler::Install( scheduler );
+
+	User::LeaveIfError(theFs.Connect());
+	theFs.SetSessionPath(_L("C:\\"));
+	}
+	
+LOCAL_C void Closedown()
+	{
+	theFs.Close();
+	CleanupStack::PopAndDestroy(testUtils);
+	delete scheduler;
+	CSecureSocketLibraryLoader::Unload();
+	}
+
+
+LOCAL_C void doMainL()
+	{
+	Init();
+
+
+	// Load the serial comms device drivers.  If this is not done,
+	// connecting via NT-RAS returns KErrNotFound (-1).
+	TInt driverErr;
+	driverErr=User::LoadPhysicalDevice(PDD_NAME);
+	if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists)
+		User::Leave(driverErr);
+	driverErr=User::LoadLogicalDevice(LDD_NAME);
+	if (driverErr!=KErrNone && driverErr!=KErrAlreadyExists)
+		User::Leave(driverErr);
+
+
+	theFs.SetSessionPath(_L("c:\\"));
+	theFs.MkDir(_L("c:\\logs\\"));
+	theFs.MkDir(_L("c:\\logs\\email\\"));
+	testUtils = CEmailTestUtils::NewLC(test);
+	testUtils->WriteComment(_L("T_IMPSECURESOCKETS  - Testing IMPS secure sockets"));
+	testUtils->WriteComment(_L("Before you run this test harness, please create commdb dat file ")); 
+	testUtils->WriteComment(_L("with server details which supports TLS."));
+	CImpsTestHarness* impsTestHarness = CImpsTestHarness::NewLC();
+	impsTestHarness->StartTestL();
+ 	CActiveScheduler::Start();
+	testUtils->TestHarnessCompleted();
+	CleanupStack::PopAndDestroy(impsTestHarness); 
+	Closedown();
+	}
+
+
+GLDEF_C TInt E32Main()
+	{
+	test.Title();
+	test.Start(_L("Testing IMPS Secure Socket connection"));
+	__UHEAP_MARK;
+
+	theCleanup=CTrapCleanup::New();
+	test (theCleanup!=NULL);
+	TRAPD(ret,doMainL());		
+	test (ret==KErrNone);
+	delete theCleanup;
+
+	__UHEAP_MARKEND;
+	test.End();
+	return 0;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/t_imapio.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,118 @@
+// Copyright (c) 1998-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:
+// T_ImapIoProgress.CPP
+// 
+//
+
+#include <e32test.h>
+#include <e32base.h>
+#include "impspan.h"
+#include "imapio.h"
+#include "emailtestutils.h"
+
+//----------------------------------------------------------------------------------------
+
+LOCAL_D RTest test(_L("T_ImapIO Test Harness"));
+TInt testNum = 1;
+LOCAL_D CTrapCleanup* theCleanup;
+LOCAL_D RFs theFs;	
+LOCAL_C CActiveScheduler* theScheduler;
+CEmailTestUtils* testUtils;
+TMsvId serviceId;
+ 
+GLDEF_C void gPanic( TImpsPanic aReason)
+	{
+	User::Panic(_L("T_ImapIO") ,aReason);
+	}
+
+//----------------------------------------------------------------------------------------
+LOCAL_C void testImapIOProgress()
+//----------------------------------------------------------------------------------------
+	{
+	CImapIO* imapIO = CImapIO::NewL(0);
+	CleanupStack::PushL(imapIO);
+	
+	testUtils->TestStart(testNum, _L("Test Progress With Disconnect"));
+
+	TRequestStatus status;
+	CImIAPPreferences* prefs = CImIAPPreferences::NewLC();
+	testUtils->WriteComment(_L("Creating an CImapIO object and leave it in a connecting state...\n"));
+	imapIO->ConnectL(status, _L("localhost"), 143, *prefs, EFalse);
+
+	TUint32 iap;
+	TInt returnValue;
+	testUtils->WriteComment(_L("Checking GetIAPValue returns a valid value...\n"));
+	returnValue = imapIO->GetIAPValue(iap);
+	test(returnValue != KErrNotFound);
+	testUtils->WriteComment(_L("Checking GetConnectionStage returns a valid value...\n"));
+	returnValue = imapIO->GetConnectionStage();
+	test(returnValue != KErrNotFound);
+
+	// Disconnect deletes its iSession. This sets up the conditions for the test
+	// of behaviour change.
+	testUtils->WriteComment(_L("Disconnect the CImapIO object. This removes its CImTextServerSession.\n"));
+	imapIO->Disconnect();
+
+	testUtils->WriteComment(_L("Checking GetIAPValue still returns KErrNotFound value after disconnect...\n"));
+	returnValue = imapIO->GetIAPValue(iap);
+	test(returnValue == KErrNotFound);
+	testUtils->WriteComment(_L("Checking GetConnectionStage still returns KErrNotFound value after disconnect...\n"));
+	returnValue = imapIO->GetConnectionStage();
+	test(returnValue == KErrNotFound);
+
+	testUtils->TestFinish(testNum++);
+	CleanupStack::PopAndDestroy(); // prefs
+	CleanupStack::PopAndDestroy(); // imapIO
+	
+	}
+
+//----------------------------------------------------------------------------------------
+LOCAL_C void doMainL()
+//----------------------------------------------------------------------------------------
+	{
+		
+	__UHEAP_MARK;
+	theScheduler = new(ELeave) CActiveScheduler;
+	CleanupStack::PushL(theScheduler);
+
+	CActiveScheduler::Install( theScheduler );
+
+	testUtils = CEmailTestUtils::NewL(test);
+	CleanupStack::PushL(testUtils);
+
+	test.SetLogged(ETrue);
+	testImapIOProgress();
+	testUtils->TestHarnessCompleted();
+	
+	CleanupStack::PopAndDestroy(2);
+	__UHEAP_MARKEND;
+	}
+
+//----------------------------------------------------------------------------------------
+GLDEF_C TInt E32Main()
+//----------------------------------------------------------------------------------------
+	{	
+	__UHEAP_MARK;
+	test.Start(_L("T_ImapIO Test Harness"));
+	theCleanup=CTrapCleanup::New();
+
+	TRAPD(ret,doMainL());
+
+	test(ret==KErrNone);
+	delete theCleanup;
+	test.End();
+	test.Close();
+	__UHEAP_MARKEND;
+	return(KErrNone);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/src/t_test_decode_step.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,354 @@
+// Copyright (c) 2005-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 <testexecutelog.h>
+#include "t_test_decode_step.h"
+#include "MIUTMSG.H"
+#include <utf.h>
+
+RTest test(_L("Decode Test"));
+const TInt KImapPort = 143;
+
+ 
+CTestDecode::~CTestDecode()
+	{
+	delete iConsole;
+	delete iSpoofServer;	
+	delete iTestUtils;
+	delete iImapClient;	
+	delete iScheduler;
+	iSession->CloseMessageServer( );
+	delete iSession;
+	delete iSessionObserver;
+	
+	delete iExpectedPartsBuffer;
+	delete iActualPartsBuffer;
+	
+	iFs.Close( );
+	}
+
+CTestDecode::CTestDecode()
+	{
+	// Call base class method to set up the human readable name for logging
+	SetTestStepName( KTestDecode );
+	
+	iFs.Connect( );
+	}
+
+void CTestDecode::TestComplete( TInt aErrorCode )
+	{
+	CActiveScheduler::Stop();	
+	
+	if( aErrorCode != KErrNone && aErrorCode != KErrEof )
+		{
+		ERR_PRINTF2( _L( "Error: %d" ), aErrorCode );	
+		}
+	}
+	
+TBufferType CTestDecode::ConvertToBufferType(const TDesC& aBufferTypeDesc)
+	{
+	if ( aBufferTypeDesc.CompareF( _L( "TBufferType::EBodyBuffer" ) ) == KErrNone )
+		{
+		return ( TBufferType ) EBodyBuffer;
+		}
+	else if ( aBufferTypeDesc.CompareF( _L( "TBufferType::EAttachmentBuffer" ) ) == KErrNone )
+		{
+		return ( TBufferType ) EAttachmentBuffer;
+		}
+	return ( TBufferType ) EUndefinedBuffer;
+	}
+
+void CTestDecode::GetDetailsFromIniFileL()
+	{
+	
+	//get the script file path
+	if( !GetStringFromConfig( ConfigSection( ) , 
+							  _L( "ScriptFile" ),
+							  iScriptFile ) )
+		{
+		ERR_PRINTF1( _L( "Error reading script file path from ini file" ) );
+		User::Leave( KErrArgument );	
+		
+		}
+	
+	TPtrC parameter;
+
+	if( GetStringFromConfig( ConfigSection( ),
+							 _L( "BufferFile" ),
+							 parameter ) )
+		{
+		TLex parser( parameter );
+		parser.SkipSpace( );
+		
+		while ( !parser.Eos( ) )
+			{
+			TBuffer* buffer = new ( ELeave ) TBuffer();
+			CleanupStack::PushL( buffer );
+		
+			TPtrC arg;
+
+			parser.SkipSpace( );
+			
+			if (parser.Eos())
+				{
+				ERR_PRINTF1( _L( "Invalid Argument for BufferFile" ) );
+				User::Leave( KErrArgument );	
+				}
+			
+			arg.Set( parser.NextToken( ) );
+		
+			buffer->iBufferType = ConvertToBufferType( arg );
+
+			arg.Set( parser.NextToken( ) );
+
+			parser.SkipSpace( );
+		
+			User::LeaveIfError( parser.Val( buffer->iAllowJunkAtEnd ) );
+
+			RFile file;
+			file.Open( iFs, arg, EFileRead );
+			CleanupClosePushL( file );
+		
+			file.Read( buffer->iBuffer );
+			iExpectedPartsBuffer->AppendL( *buffer );
+		
+			CleanupStack::PopAndDestroy( 1 );	//file
+			CleanupStack::Pop( buffer );
+			
+			parser.SkipSpace( );
+			
+			}
+		}
+	else
+		{
+		ERR_PRINTF1( _L( "Error reading buffer file path from ini file" ) );
+		User::Leave( KErrArgument );
+		
+		}
+	
+	//get the script file path
+	if( !GetBoolFromConfig( ConfigSection( ),
+							_L( "FetchWholeMessage" ),
+							iFetchWholeMessage ) )
+		{
+		ERR_PRINTF1( _L( "Error reading \"FetchWholeMessage\"-argument from ini file" ) );
+		User::Leave( KErrArgument );
+		
+		}
+	}
+
+void CTestDecode::TraverseL( const TMsvId aTMsvId )
+	{
+	//open the entry, dont sort
+	TMsvSelectionOrdering ordering;	
+	ordering.SetSorting( EMsvSortByNone );
+	CMsvEntry* entry = CMsvEntry::NewL( *iSession, aTMsvId,ordering );
+	CleanupStack::PushL( entry );
+	
+	//retrieve the entries children
+	CMsvEntrySelection* msvEntrySelection;
+	msvEntrySelection=entry->ChildrenL( );
+	CleanupStack::PushL( msvEntrySelection );
+	TInt count = entry->Count( );
+	
+	CMsvEntry* child;
+	TMsvEntry childDetails;
+
+	//for each child test if its a message entry
+	for( TInt i = 0; i < count; i++ )
+		{
+		child=iSession->GetEntryL( ( *msvEntrySelection ) [ i ] );
+		CleanupStack::PushL( child );
+		childDetails=child->Entry( );
+		
+		if( childDetails.iType == KUidMsvMessageEntry )
+			{
+			//First Check the body
+			CParaFormatLayer* paraFormatLayer = CParaFormatLayer::NewL( );
+			CleanupStack::PushL( paraFormatLayer );
+			CCharFormatLayer* charFormatLayer = CCharFormatLayer::NewL( );
+			CleanupStack::PushL( charFormatLayer );
+			CRichText* richText = CRichText::NewL( paraFormatLayer, charFormatLayer );
+			CleanupStack::PushL( richText );
+
+			CImEmailMessage* emailMessage = CImEmailMessage::NewLC( *child );
+			
+			emailMessage->GetBodyTextL( child->EntryId( ), 
+										CImEmailMessage::EThisMessageOnly,
+										*richText, 
+										*paraFormatLayer, 
+										*charFormatLayer );
+										
+			emailMessage->GetAttachmentsListL( child->EntryId( ),
+											   CImEmailMessage::EAllAttachments,
+											   CImEmailMessage::EThisMessageOnly );
+
+			TDes* buffer16;
+			buffer16 = new( ELeave ) TBuf<5000>( );
+			CleanupStack::PushL( buffer16 );
+			richText->Extract( *buffer16, 0 );
+			TBuf8<KMaxBufferSize> buffer8;
+			TInt unconverted =  CnvUtfConverter::ConvertFromUnicodeToUtf8( buffer8, 
+																	   	   *buffer16 );
+			iActualPartsBuffer->AppendL( buffer8 );
+			CleanupStack::PopAndDestroy( buffer16 );
+
+			MMsvAttachmentManager& attachmentMgr = emailMessage->AttachmentManager();
+			RPointerArray<CMsvAttachment> attachmentInfoArray;
+			attachmentInfoArray.Reset();
+			CMsvAttachment* attachmentInfo;
+			
+			for (TInt i= 0; i< attachmentMgr.AttachmentCount();i++)
+				{
+				attachmentInfo = attachmentMgr.GetAttachmentInfoL(i);
+				attachmentInfoArray.Append(attachmentInfo);
+				
+				TDes8* buffer;									
+				buffer = new( ELeave ) TBuf8<5000>( );
+				CleanupStack::PushL( buffer );
+			
+				RFile file;
+				file.Open( iFs, attachmentInfo->FilePath( ), EFileRead );
+				CleanupClosePushL( file );
+		
+				file.Read( *buffer );
+				
+				iActualPartsBuffer->AppendL( *buffer );
+		
+				CleanupStack::PopAndDestroy( 2, buffer );	//file, buffer
+			
+			}
+			
+			//if this is the first timestamp the us iActualTimeStamp, else use iActualTimeStamp2
+			CleanupStack::PopAndDestroy( 4, paraFormatLayer );	
+
+			}
+
+		//recursive call
+		TraverseL( childDetails.Id( ) );
+		
+		CleanupStack::PopAndDestroy( child );
+		}
+			
+	CleanupStack::PopAndDestroy( msvEntrySelection );
+	CleanupStack::PopAndDestroy( entry );	
+	}
+
+
+TVerdict CTestDecode::doTestStepPreambleL( )
+	{
+	SetTestStepResult( EFail );
+	
+	iScheduler = new ( ELeave ) CActiveScheduler;
+	CActiveScheduler::Install( iScheduler );
+	
+	iTestUtils = CEmailTestUtils::NewL( test );
+	iTestUtils->FileSession( ).SetSessionPath( _L( "C:\\" ) );
+	iTestUtils->CleanMessageFolderL( );
+	iTestUtils->ClearEmailAccountsL( );
+	
+	iTestUtils->GoClientSideL( );
+	
+	//initialize the buffers
+	iExpectedPartsBuffer = new( ELeave) CArrayFixSeg< TBuffer >( 1 );	// granularity of 1, very often there 
+	iActualPartsBuffer = new( ELeave) CDesC8ArraySeg( 1 );				// will beonly 1 message part
+
+	//start the imap server
+	GetDetailsFromIniFileL( );
+	iConsole=Console::NewL( _L( "Decode Test" ),TSize( KConsFullScreen, KConsFullScreen ) );
+	iSpoofServer = CSpoofServer::NewL(*this,iScriptFile);
+	iSpoofServer->StartL(KImapPort);
+	//start the imap client
+	iImapClient = CActiveImapClient::NewL(this,iFetchWholeMessage);
+	iImapClient->StartL();
+	
+	CActiveScheduler::Start();
+	SetTestStepResult( EPass );
+	return TestStepResult();
+	}
+
+TVerdict CTestDecode::CheckBuffer( const TDesC8& aActualBuffer, 
+								   const TDesC8& aExpectedBuffer, 
+								   TBool aAllowJunkAtEnd )
+	{
+	TVerdict result = EFail;
+	
+	TInt compareResult = aExpectedBuffer.Compare( aActualBuffer );
+	if ( compareResult == 0)
+		{
+		INFO_PRINTF1( _L( "Decoded buffer does match reference file" ) );
+		result = EPass;
+		}
+	else if ( compareResult == aExpectedBuffer.Length( )-aActualBuffer.Length( ) &&
+			  aAllowJunkAtEnd )
+		{
+		WARN_PRINTF1( _L( "Decoded buffer math reference file, but contains extra \"junk\" at the end" ) );
+		result = EPass;
+		}
+	else
+		{
+		INFO_PRINTF1( _L( "Decoded buffer does not match reference file" ) );
+		}
+	
+	return result;
+	
+	}
+		
+TVerdict CTestDecode::doTestStepL( )
+	{
+
+	TVerdict result = EPass;
+
+	// Session observer. Needed to create a session
+	iSessionObserver = new (ELeave) TDummySessionObserver;
+	// Session. Needed to create a client registry.
+	iSession=CMsvSession::OpenSyncL(*iSessionObserver);
+	// Client registry. Needed to get the MTM component
+	TraverseL(iImapClient->GetAccount().iImapService);	
+
+	// Check every message-part (we expect them to be in the same order 
+	// as defined in the .ini configuration file)
+	TInt partsCount = iExpectedPartsBuffer->Count( );
+	if ( partsCount != iActualPartsBuffer->Count( ) )
+		{
+		ERR_PRINTF1( _L( "Number of expected parts does not mach actual number of parts" ) );
+		User::Leave( KErrGeneral );
+		}
+
+	// Stop as soon as a test fail, we don't care about the rest.
+	for ( TInt i=0; ( ( i < partsCount ) && ( result != EFail ) ); i++ )
+		{
+		TBuffer expectedPart = iExpectedPartsBuffer->At( i );
+		result = CheckBuffer( iActualPartsBuffer->MdcaPoint( i ), 
+							  expectedPart.iBuffer,
+							  expectedPart.iAllowJunkAtEnd );
+		
+		}
+	
+	SetTestStepResult( result );
+	return TestStepResult( );
+	
+	}
+	
+
+TVerdict CTestDecode::doTestStepPostambleL()
+	{
+	return TestStepResult( );
+	
+	}
+	
+	
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/testrom/bld.inf	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,21 @@
+// Copyright (c) 2002-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:
+//
+
+PRJ_TESTEXPORTS
+
+t_imps_prepare_for_test.bat 	\epoc32\data\z\system\msgtest\urel\t_imps_prepare_for_test.bat
+t_imps_prepare_for_test.bat 	\epoc32\data\z\system\msgtest\udeb\t_imps_prepare_for_test.bat
+t_imps.iby 			\epoc32\rom\include\t_imps.iby 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/testrom/t_imps.iby	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+REM
+REM T_IMPS.IBY
+REM
+
+REM data
+
+REM harnesses
+file=ABI_DIR\BUILD_DIR\T_IMPS01.exe				System\MsgTest\T_IMPS01.exe
+file=ABI_DIR\BUILD_DIR\T_IMPSSECURESOCKET.exe 	System\MsgTest\T_IMPSSECURESOCKET.exe
+file=ABI_DIR\BUILD_DIR\MsvTestUtils.dll                 System\Libs\MsvTestUtils.dll
+file=ABI_DIR\BUILD_DIR\EmailTestUtils.dll                 System\MsgTest\EmailTestUtils.dll
+
+file=ABI_DIR\DEBUG_DIR\ced.exe				Sys\Bin\ced.exe
+file=ABI_DIR\BUILD_DIR\T_DEF079867_OfflineDelete.exe	System\MsgTest\T_DEF079867_OfflineDelete.exe
+file=ABI_DIR\BUILD_DIR\T_DEF075510_Offline_populate.exe	System\MsgTest\T_DEF075510_Offline_populate.exe
+file=ABI_DIR\BUILD_DIR\T_INC083099_Enquire_Email_Structure.exe	System\MsgTest\T_INC083099_Enquire_Email_Structure.exe
+file=ABI_DIR\BUILD_DIR\T_ConnectAndSyncAfterDisconnect.exe	System\MsgTest\T_ConnectAndSyncAfterDisconnect.exe
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email/pop3andsmtpmtm/imapservermtm/test/testrom/t_imps_prepare_for_test.bat	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,16 @@
+rem Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem NOTE! Do not use tabs here!
+rem 
+rem
--- a/email/pop3andsmtpmtm/popservermtm/src/POPS.CPP	Fri Apr 16 14:56:15 2010 +0300
+++ b/email/pop3andsmtpmtm/popservermtm/src/POPS.CPP	Mon May 03 12:29:07 2010 +0300
@@ -208,7 +208,17 @@
 		iSocket->Disconnect();
 		iSocketConnected=EFalse;
 		}
-	iSocket->Cancel();	// clear a pending socket call
+	
+	if(iState == EPopCapabilities || iState == EWaitingForReply)
+	    {
+	    if(iPopCapabilities)
+	        {
+	        iPopCapabilities->Cancel();
+	        }
+	    }
+	
+	iSocket->Cancel();  // clear a pending socket call
+
 	CMsgActive::DoCancel();
 	}
 
--- a/inc/convergedmessage.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/inc/convergedmessage.h	Mon May 03 12:29:07 2010 +0300
@@ -47,17 +47,25 @@
         {        
         Sms = 0x00,
         Mms = 0x01,
-        MmsNotification = 0x02,
-        Audio = 0x03,
-        BioMsg = 0x04,
-        BT = 0x05,
-        RingingTone = 0x06,
-        Provisioning = 0x07,
-		VCard = 0x08,
-        VCal = 0x09,
+        MmsNotification = 0x02,        
+        BioMsg = 0x03,
+        BT = 0x04,
         None = 0x50,
         IM = 0x51 
         };
+    
+    /**
+     * Enum defining possible Message sub-types
+     * Ex. vCard, vCal etc..
+     */
+    enum MessageSubType
+    {
+        RingingTone = 0x00,
+        Provisioning = 0x01,
+        VCard = 0x02,
+        VCal = 0x03,
+        Audio = 0x04
+    };
 
     /**
 
@@ -124,6 +132,24 @@
         SentState = 0x08,
         NotApplicable = 0x09
         };
+    
+    /**
+     * Enum defining MMS Notification's Msg State
+     * @attention This enum can have values from 0 to 255 only
+     * Add any new states only at the bottom of this enum
+     */
+    enum MmsNotificationState
+        {
+        NotifNull              = 0x00, // unknown status
+        NotifReadyForFetching  = 0x01, // first state when received in inbox
+        NotifRetrieving        = 0x02, // when MM is fetching ongoin
+        NotifForwarding        = 0x03, // forwarding without retrival
+        NotifForwarded         = 0x04, // state after successful forwarding
+        NotifWaiting           = 0x05, // when settings changed manual->automatic
+        NotifExpired           = 0x06, // expired time has exceed
+        NotifFailed            = 0x07, // when fetching has failed (forwarding?)
+        NotifDeleted           = 0x08  // when msg deleted from server
+        };
 
 public:
 
@@ -172,6 +198,18 @@
      * @param type message type
      */
     void setMessageType(MessageType type);
+    
+    /**
+     * Get the message sub-type
+     * @return message sub-type
+     */
+    MessageSubType messageSubType() const;
+
+    /**
+     * Set the message sub-type
+     * @param type message sub-type
+     */
+    void setMessageSubType(MessageSubType type);
 
     /**
      * Get the message priority
--- a/inc/msgnotificationdialogpluginkeys.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/inc/msgnotificationdialogpluginkeys.h	Mon May 03 12:29:07 2010 +0300
@@ -19,9 +19,7 @@
 
 // Keys for the parameters passed to Notification framework
 
-const QString KFirstNameKey = "firstName";
-const QString KLastNameKey = "lastName";
-const QString KNickNameKey = "nickName";
+const QString KDisplayNameKey = "displayName";
 const QString KConversationIdKey = "conversationId";
 const QString KMessageTypeKey = "messageType";
 const QString KMessageBodyKey = "messageBody";
--- a/inc/unidatamodelloader.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/inc/unidatamodelloader.h	Mon May 03 12:29:07 2010 +0300
@@ -19,10 +19,11 @@
 #define UNI_DATA_MODEL_LOADER_H
 
 #include <QMap>
+#include "convergedmessage.h"
 
 //Forward declarations
 class UniDataModelPluginInterface;
-
+class QPluginLoader;
 
 
 #ifdef BUILD_DLL_DATA_MODEL
@@ -38,7 +39,7 @@
 /**
  * Loads all the data model plugins.
  */
-class UNI_DATA_MODEL_LOADER_EXPORT UniDataModelLoader
+class UNI_DATA_MODEL_LOADER_EXPORT UniDataModelLoader 
 {
 public:
     /**
@@ -55,19 +56,13 @@
      * Gets the  data model intended plugin.
      * @param messageType
      */
-    UniDataModelPluginInterface* getDataModelPlugin(const QString& messageType);
-
-    /**
-     * Loads plugins
-     */
-    void loadPlugins();
+    UniDataModelPluginInterface* getDataModelPlugin(ConvergedMessage::MessageType messageType);
 
 private:
     /**
-     * This shall store all the message types
-     * mapped to plugin instance
+     * Keep a list of all the pluginloaders used
      */
-    QMap<QString, UniDataModelPluginInterface*> mDataModelPluginMap;
+    QList<QPluginLoader* > mPluginLoaderList;
 };
 
 #endif //UNI_DATA_MODEL_LOADER_H
--- a/inc/unidatamodelplugininterface.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/inc/unidatamodelplugininterface.h	Mon May 03 12:29:07 2010 +0300
@@ -232,60 +232,10 @@
     virtual QDateTime timeStamp()=0;
 
     /**
-     * Adds object into smil model
-     * @param slide number
-     * @param UniMessageInfo obj
-     */
-    virtual void addObject( int aslideNum,UniMessageInfo* aInfo )=0;
-
-    /**
-     * Adds text object into smil model
-     * @param slide number
-     * @param text
-     */    
-    virtual void addTextObject(int aSlideNum,QString aText )=0;
-
-    /**
-     * Adds slide into smil model
-     * @param slide number
-     */    
-    virtual void addSlide( int aSlideNum )=0;
-
-    /**
-     * Compose Smil
-     * @param Edit store
-     */    
-    virtual void composeSmil(CMsvStore& aEditStore)=0;
-
-    /**
-     * Save Objects inside smil model 
-     */        
-    virtual void saveObjects()=0;
-
-    /**
-     *  Get the smil attachment index
-     *  @return TMsvAttachmentId
-     */        
-    virtual TMsvAttachmentId getSmilAttachmentByIndex()=0;
-    
-    /**
      *  Restores the model for editing purpose
      *  @param CBaseMtm
      */        
     virtual void restore(CBaseMtm& mtm)=0;
-
-    /**
-     * Add attachment 
-     * @param UniMessageInfo
-     */
-    virtual void addAttachment( UniMessageInfo* aInfo )=0;
-    
-    /**
-     * Remove slide from smil model 
-     * @param slide number
-     */
-    virtual void removeSlide(int aSlideNumber)=0;
-
 	
 		/**
      * Subject associated with the message
--- a/inc/unieditorplugininterface.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/inc/unieditorplugininterface.h	Mon May 03 12:29:07 2010 +0300
@@ -20,12 +20,24 @@
 
 #include <QtPlugin>
 #include <msvstd.h>
+#include <gsmuelem.h>
 #include "convergedmessage.h"
 
 
 class UniEditorPluginInterface
 {
 public:
+    
+    /**
+     * Enum defining EditorOperation 
+     * @attention This enum can have values from 0 to 2 only.
+     */
+    enum EditorOperation
+    {
+        Forward = 0, 
+        ReplyAll, 
+        Default 
+    };
 
     /**
      * Destructor
@@ -41,13 +53,17 @@
 	virtual ConvergedMessage::MessageType messageType()=0;
 
     /**
-     * Converts message from message store into ConvergedMessage
+     * Converts message from message store into ConvergedMessage 
+     * based on the operation
      * @param TMsvId id
+     * @param aOperation operation type
      * @return ConvergedMessage object is returned in successfull cases and 
      *         NULL is returned in failure cases. The ownership of the object
      *         is transferred to the caller. 
      */
-    virtual ConvergedMessage* convertFrom( TMsvId aId )=0;
+    virtual ConvergedMessage* convertFrom( TMsvId aId,
+        UniEditorPluginInterface::EditorOperation aOperation
+        =UniEditorPluginInterface::Default)=0;
 
     /**
      * delete entry from drafts folder
@@ -81,6 +97,19 @@
      * @return true/false
      */
     virtual TBool validateService( TBool aEmailOverSms = EFalse ) = 0;
+    
+    /*
+     * Turkish SMS(PREQ2265) specific...
+     */
+    virtual void setEncodingSettings(TBool aUnicodeMode,
+        TSmsEncoding aAlternativeEncodingType, TInt charSupportType)=0;
+
+    /**
+     * for deciding on reduced or full charset support
+     */
+    virtual bool getNumPDUs(QString& aBuf, TInt& aNumOfRemainingChars,
+        TInt& aNumOfPDUs, TBool& aUnicodeMode,
+        TSmsEncoding& aAlternativeEncodingType)=0;
 
 };
 
--- a/inc/unieditorpluginloader.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/inc/unieditorpluginloader.h	Mon May 03 12:29:07 2010 +0300
@@ -54,23 +54,12 @@
      * @param messageType
      */
     UniEditorPluginInterface* getUniEditorPlugin(ConvergedMessage::MessageType messageType);
-
-    /**
-     * Loads plugins
-     */
-    void loadPlugins();
-
+ 
 private:
     /**
-     * This shall store all the message types
-     * mapped to plugin instance
-     */
-    QMap<int, UniEditorPluginInterface*> mEditorPluginMap;
-	
-    /**
      * Keep a list of all the pluginloaders used
      */
-    QList<QPluginLoader* > mPluginLoaderList;
+    QList<QPluginLoader* > mPluginLoaderList;    
 };
 
 #endif //UNI_EDITOR_LOADER_H
--- a/messaging_info/messaging_metadata/messaging_metadata.mrp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messaging_info/messaging_metadata/messaging_metadata.mrp	Mon May 03 12:29:07 2010 +0300
@@ -17,5 +17,6 @@
 component           messaging_metadata
 source   \sf\app\messaging\messaging_info\messaging_metadata 
 source   \sf\app\messaging\package_definition.xml
+source   \sf\app\messaging\distribution.policy.s60
 notes_source      \component_defs\release.src
 ipr T 
Binary file messagingapp/conf/messaging.confml has changed
Binary file messagingapp/conf/messaging_101F87EB.crml has changed
Binary file messagingapp/conf/messaging_101F87EC.crml has changed
Binary file messagingapp/conf/messaging_101F87ED.crml has changed
Binary file messagingapp/conf/messaging_101F87EE.crml has changed
Binary file messagingapp/conf/messaging_101F87EF.crml has changed
Binary file messagingapp/conf/messaging_101F8873.crml has changed
Binary file messagingapp/conf/messaging_101F8F28.crml has changed
Binary file messagingapp/conf/messaging_102071F2.crml has changed
Binary file messagingapp/conf/messaging_102072E2.crml has changed
Binary file messagingapp/conf/messaging_102072E5.crml has changed
Binary file messagingapp/conf/messaging_102824A0.crml has changed
Binary file messagingapp/conf/messaging_1028281E.crml has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/conf/messaging_conf.pro	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,40 @@
+#
+# 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 = subdirs
+
+# Platforms
+SYMBIAN_PLATFORMS = WINSCW ARMV5
+
+# Build.inf rules
+symbian{
+		BLD_INF_RULES.prj_exports += \
+    "$${LITERAL_HASH}include <platform_paths.hrh>" \
+    "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)" \
+		"messaging_101F87EE.crml APP_LAYER_CRML(messaging_101F87EE.crml)" \
+		"messaging_101F87EF.crml APP_LAYER_CRML(messaging_101F87EF.crml)" \
+		"messaging_101F8873.crml APP_LAYER_CRML(messaging_101F8873.crml)" \
+		"messaging_102071F2.crml APP_LAYER_CRML(messaging_102071F2.crml)" \
+		"messaging_102072E2.crml APP_LAYER_CRML(messaging_102072E2.crml)" \
+		"messaging_102072E5.crml APP_LAYER_CRML(messaging_102072E5.crml)" \
+		"messaging_102824A0.crml APP_LAYER_CRML(messaging_102824A0.crml)" \
+		"messaging_1028281E.crml APP_LAYER_CRML(messaging_1028281E.crml)" \
+		"messaging_101F8F28.crml APP_LAYER_CRML(messaging_101F8F28.crml)"
+		}
+
--- a/messagingapp/messagingapp.pro	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/messagingapp.pro	Mon May 03 12:29:07 2010 +0300
@@ -21,6 +21,7 @@
 
 CONFIG += ordered
 
+SUBDIRS += conf/messaging_conf.pro
 SUBDIRS += msgutils/msgutils.pro
 SUBDIRS += msgappfw/msgappfw.pro
 SUBDIRS += msgsettings/msgsettings.pro
--- a/messagingapp/msgappfw/bwins/msghistoryu.def	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/bwins/msghistoryu.def	Mon May 03 12:29:07 2010 +0300
@@ -7,11 +7,11 @@
 	?trUtf8@MsgHistory@@SA?AVQString@@PBD0H@Z @ 6 NONAME ; class QString MsgHistory::trUtf8(char const *, char const *, int)
 	?setId@MsgItem@@QAEXH@Z @ 7 NONAME ; void MsgItem::setId(int)
 	?setDirection@MsgItem@@QAEXW4MsgDirection@1@@Z @ 8 NONAME ; void MsgItem::setDirection(enum MsgItem::MsgDirection)
-	?isAttributeSet@MsgItem@@QBE?AW4MsgAttribute@1@W421@@Z @ 9 NONAME ; enum MsgItem::MsgAttribute MsgItem::isAttributeSet(enum MsgItem::MsgAttribute) const
-	?subscribe@MsgHistory@@QAE_NH@Z @ 10 NONAME ; bool MsgHistory::subscribe(int)
-	?messagesReady@MsgHistory@@IAEXAAV?$QList@VMsgItem@@@@@Z @ 11 NONAME ; void MsgHistory::messagesReady(class QList<class MsgItem> &)
-	?trUtf8@MsgHistory@@SA?AVQString@@PBD0@Z @ 12 NONAME ; class QString MsgHistory::trUtf8(char const *, char const *)
-	?messageChanged@MsgHistory@@IAEXAAVMsgItem@@@Z @ 13 NONAME ; void MsgHistory::messageChanged(class MsgItem &)
+	?subscribe@MsgHistory@@QAE_NH@Z @ 9 NONAME ; bool MsgHistory::subscribe(int)
+	?messagesReady@MsgHistory@@IAEXAAV?$QList@VMsgItem@@@@@Z @ 10 NONAME ; void MsgHistory::messagesReady(class QList<class MsgItem> &)
+	?trUtf8@MsgHistory@@SA?AVQString@@PBD0@Z @ 11 NONAME ; class QString MsgHistory::trUtf8(char const *, char const *)
+	?messageChanged@MsgHistory@@IAEXAAVMsgItem@@@Z @ 12 NONAME ; void MsgHistory::messageChanged(class MsgItem &)
+	?isAttributeSet@MsgItem@@QBE_NW4MsgAttribute@1@@Z @ 13 NONAME ; bool MsgItem::isAttributeSet(enum MsgItem::MsgAttribute) const
 	?markRead@MsgHistory@@QAE_NH@Z @ 14 NONAME ; bool MsgHistory::markRead(int)
 	??1MsgItem@@UAE@XZ @ 15 NONAME ; MsgItem::~MsgItem(void)
 	?getMessages@MsgHistory@@QAE_NH@Z @ 16 NONAME ; bool MsgHistory::getMessages(int)
--- a/messagingapp/msgappfw/client/bwins/csserverclientapiu.def	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/client/bwins/csserverclientapiu.def	Mon May 03 12:29:07 2010 +0300
@@ -23,4 +23,5 @@
 	?GetConversationsL@CCSRequestHandler@@QAEXPAVCCsClientConversation@@@Z @ 22 NONAME ; void CCSRequestHandler::GetConversationsL(class CCsClientConversation *)
 	?GetConversationIdL@CCSRequestHandler@@QAEHH@Z @ 23 NONAME ; int CCSRequestHandler::GetConversationIdL(int)
 	?NewL@CCSRequestHandler@@SAPAV1@XZ @ 24 NONAME ; class CCSRequestHandler * CCSRequestHandler::NewL(void)
+	?GetConversationFromMessageIdL@CCSRequestHandler@@QAEPAVCCsClientConversation@@H@Z @ 25 NONAME ; class CCsClientConversation * CCSRequestHandler::GetConversationFromMessageIdL(int)
 
--- a/messagingapp/msgappfw/client/eabi/csserverclientapiu.def	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/client/eabi/csserverclientapiu.def	Mon May 03 12:29:07 2010 +0300
@@ -15,18 +15,19 @@
 	_ZN17CCSRequestHandler25RemoveCachingStatusEventLEP24MCsCachingStatusObserver @ 14 NONAME
 	_ZN17CCSRequestHandler26GetConversationUnreadListLEP13RPointerArrayI21CCsClientConversationE @ 15 NONAME
 	_ZN17CCSRequestHandler26RequestCachingStatusEventLEP24MCsCachingStatusObserver @ 16 NONAME
-	_ZN17CCSRequestHandler29GetConversationIdFromAddressLER7TDesC16 @ 17 NONAME
-	_ZN17CCSRequestHandler30RemoveConversationChangeEventLEP29MCsConversationChangeObserverP21CCsClientConversation @ 18 NONAME
-	_ZN17CCSRequestHandler31RequestConversationChangeEventLEP29MCsConversationChangeObserverP21CCsClientConversation @ 19 NONAME
-	_ZN17CCSRequestHandler34RemoveConversationListChangeEventLEP33MCsConversationListChangeObserver @ 20 NONAME
-	_ZN17CCSRequestHandler35RequestConversationListChangeEventLEP33MCsConversationListChangeObserver @ 21 NONAME
-	_ZN17CCSRequestHandler4NewLEv @ 22 NONAME
-	_ZN17CCSRequestHandler5NewLCEv @ 23 NONAME
-	_ZNK17CCSRequestHandler7VersionEv @ 24 NONAME
-	_ZTI17CCSRequestHandler @ 25 NONAME
-	_ZTI22CCsNotificationHandler @ 26 NONAME
-	_ZTI29CCsConversationChangeObserver @ 27 NONAME
-	_ZTV17CCSRequestHandler @ 28 NONAME
-	_ZTV22CCsNotificationHandler @ 29 NONAME
-	_ZTV29CCsConversationChangeObserver @ 30 NONAME
+	_ZN17CCSRequestHandler29GetConversationFromMessageIdLEi @ 17 NONAME
+	_ZN17CCSRequestHandler29GetConversationIdFromAddressLER7TDesC16 @ 18 NONAME
+	_ZN17CCSRequestHandler30RemoveConversationChangeEventLEP29MCsConversationChangeObserverP21CCsClientConversation @ 19 NONAME
+	_ZN17CCSRequestHandler31RequestConversationChangeEventLEP29MCsConversationChangeObserverP21CCsClientConversation @ 20 NONAME
+	_ZN17CCSRequestHandler34RemoveConversationListChangeEventLEP33MCsConversationListChangeObserver @ 21 NONAME
+	_ZN17CCSRequestHandler35RequestConversationListChangeEventLEP33MCsConversationListChangeObserver @ 22 NONAME
+	_ZN17CCSRequestHandler4NewLEv @ 23 NONAME
+	_ZN17CCSRequestHandler5NewLCEv @ 24 NONAME
+	_ZNK17CCSRequestHandler7VersionEv @ 25 NONAME
+	_ZTI17CCSRequestHandler @ 26 NONAME
+	_ZTI22CCsNotificationHandler @ 27 NONAME
+	_ZTI29CCsConversationChangeObserver @ 28 NONAME
+	_ZTV17CCSRequestHandler @ 29 NONAME
+	_ZTV22CCsNotificationHandler @ 30 NONAME
+	_ZTV29CCsConversationChangeObserver @ 31 NONAME
 
--- a/messagingapp/msgappfw/client/group/ABLD.BAT	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-@ECHO OFF
-
-REM Bldmake-generated batch file - ABLD.BAT
-REM ** DO NOT EDIT **
-
-perl -S ABLD.PL "\sf\app\messaging\messagingapp\msgappfw\client\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9
-if errorlevel==1 goto CheckPerl
-goto End
-
-:CheckPerl
-perl -v >NUL
-if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed?
-goto End
-
-:End
--- a/messagingapp/msgappfw/client/src/ccsrequesthandler.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/client/src/ccsrequesthandler.cpp	Mon May 03 12:29:07 2010 +0300
@@ -35,6 +35,7 @@
 #include "ccsconversationchangeobserver.h"
 
 const TInt  KSmallIpcBuffer = 256; //256 bytes
+const TInt KBigIpcBuffer = 2048; // 2K
 
 // ========================= MEMBER FUNCTIONS ==================================
 
@@ -294,6 +295,10 @@
     {
     PRINT ( _L("Enter CCSRequestHandler::HandleGetConversationListOverflow") );
 
+	if ( !iListResultsBuffer )
+        {
+		return;
+		}
     TInt error = KErrNone;
 
     // New buffer size is now stored in results buffer
@@ -314,11 +319,8 @@
     stream.Close();
 
     // Delete and recreate the results buffer
-    if ( iListResultsBuffer )
-        {
-        delete iListResultsBuffer;
-        iListResultsBuffer = NULL;
-        }
+    delete iListResultsBuffer;
+    iListResultsBuffer = NULL;
 
     // Buffer created for the new size
     TRAP(error, 
@@ -343,6 +345,10 @@
     {
     PRINT ( _L("Enter CCSRequestHandler::HandleGetConversationOverflow") );
 
+	   if ( !iConvResultsBuffer )
+        {
+				return;
+				}
     TInt error = KErrNone;
 
     // New buffer size is now stored in results buffer
@@ -364,11 +370,8 @@
     stream.Close();
 
     // Delete and recreate the results buffer
-    if ( iConvResultsBuffer )
-        {
-        delete iConvResultsBuffer;
-        iConvResultsBuffer = NULL;
-        }
+    delete iConvResultsBuffer;
+    iConvResultsBuffer = NULL;
 
     // Buffer created for the new size
     TRAP(error, 
@@ -1193,6 +1196,40 @@
     
     return conversationId;
     }
+	
+// -----------------------------------------------------------------------------
+// CCSRequestHandler::GetConversationFromMessageIdL()
+// -----------------------------------------------------------------------------
+EXPORT_C CCsClientConversation* CCSRequestHandler::GetConversationFromMessageIdL(TInt aMessageId)        
+{    
+    // Create a buffer to store the results.
+    if(iResultsBuffer)
+    {
+        delete iResultsBuffer;
+        iResultsBuffer = NULL;
+    }
+    iResultsBuffer = HBufC8::NewL(KBigIpcBuffer);
+
+    // Send the request
+    iSession.GetConversationFromMessageIdL(aMessageId, iResultsBuffer->Des());
+
+    // Parse the results
+    RDesReadStream resultStream(iResultsBuffer->Des());
+    resultStream.PushL();
+    CCsClientConversation* clientConversation = CCsClientConversation::NewL();
+    CleanupStack::PushL(clientConversation);
+    clientConversation->InternalizeL(resultStream);
+    CleanupStack::Pop(clientConversation);
+    
+    // Cleanup
+    delete iResultsBuffer;
+    iResultsBuffer = NULL;
+    resultStream.Pop();
+    resultStream.Close();
+
+    return clientConversation;
+}
+
 // -----------------------------------------------------------------------------
 // CCSRequestHandler::GetMessagingHistoryL()
 // -----------------------------------------------------------------------------
@@ -1210,8 +1247,7 @@
     GetConversationsL(clientConversation);
     
     //delete 
-    if ( clientConversation )
-        delete clientConversation;
+    delete clientConversation;
     if( entry )
         delete entry;  
         
--- a/messagingapp/msgappfw/client/src/rcssession.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/client/src/rcssession.cpp	Mon May 03 12:29:07 2010 +0300
@@ -125,10 +125,7 @@
 void RCsSession::ShutdownServerL()
 {
     TIpcArgs args;
-    TRequestStatus status;
-    SendReceive(EShutdown, args, status);
-    User::WaitForRequest(status);
-
+    User::LeaveIfError (SendReceive(EShutdown, args));
     PRINT ( _L("RCsSession::ShutdownServerL - ServerShutDown") );
 }
 
@@ -164,14 +161,8 @@
   PRINT( _L("Enter RCsSession::GetConversationEntryListL") );
 
   TIpcArgs args(&aOverflow, &aResultsBuffer);
-
-  TRequestStatus status;
-
   // Initiate the request
-  SendReceive(EGetConversationUnreadList, args, status);
-
-  User::WaitForRequest(status);
-
+  User::LeaveIfError (SendReceive(EGetConversationUnreadList, args));
   PRINT( _L("End RCsSession::GetConversationEntryListL") );
   }
 
@@ -225,13 +216,8 @@
 void RCsSession::GetCachingStatusL(TPtr8 aResultsBuffer)
 {
     TIpcArgs args(TIpcArgs::ENothing, &aResultsBuffer);
-
-    TRequestStatus status;
-
     // Initiate the request
-    SendReceive(EGetCachingStatus, args, status);
-
-    User::WaitForRequest(status);
+    User::LeaveIfError (SendReceive(EGetCachingStatus, args));
 }
 
 // ----------------------------------------------------------------------------
@@ -242,13 +228,8 @@
 void RCsSession::GetTotalUnreadCountL(TPtr8 aResultsBuffer)
     {
     TIpcArgs args(TIpcArgs::ENothing, &aResultsBuffer);
-
-    TRequestStatus status;
-
     // Initiate the request
-    SendReceive(EGetTotalUnreadCount, args, status);
-
-    User::WaitForRequest(status);
+    User::LeaveIfError (SendReceive(EGetTotalUnreadCount, args));
     }
 
 // ----------------------------------------------------------------------------
@@ -260,12 +241,10 @@
 {
     TIpcArgs args(TIpcArgs::ENothing, TIpcArgs::ENothing);
 
-    TRequestStatus status;
+    // Initiate the request
+    User::LeaveIfError ( SendReceive(ESetConversationListChangeObserver, args));
 
-    // Initiate the request
-    SendReceive(ESetConversationListChangeObserver, args, status);
-
-    User::WaitForRequest(status);
+  
 }
 
 // ----------------------------------------------------------------------------
@@ -276,13 +255,8 @@
 void RCsSession::ResetConversationListChangeObserverL()
 {
     TIpcArgs args(TIpcArgs::ENothing, TIpcArgs::ENothing);
-
-    TRequestStatus status;
-
     // Initiate the request
-    SendReceive(EResetConversationListChangeObserver, args, status);
-
-    User::WaitForRequest(status);
+    User::LeaveIfError ( SendReceive(EResetConversationListChangeObserver, args));
 }
 
 // ----------------------------------------------------------------------------
@@ -295,13 +269,8 @@
                                                 const TDes8& aClientConversation)
 {
     TIpcArgs args(&aClientConversation);
-
-    TRequestStatus status;
-
     // Initiate the request
-    SendReceive(ESetConversationChangeObserver, args, status);
-
-    User::WaitForRequest(status);
+    User::LeaveIfError (SendReceive(ESetConversationChangeObserver, args));
 }
 
 // ----------------------------------------------------------------------------
@@ -314,13 +283,8 @@
                                                   const TDes8& aClientConversation)
 {
     TIpcArgs args(&aClientConversation);
-
-    TRequestStatus status;
-
     // Initiate the request
-    SendReceive(EResetConversationChangeObserver, args, status);
-
-    User::WaitForRequest(status);
+    User::LeaveIfError (SendReceive(EResetConversationChangeObserver, args));
 }
 
 // ----------------------------------------------------------------------------
@@ -332,12 +296,8 @@
 {
     TIpcArgs args(TIpcArgs::ENothing, TIpcArgs::ENothing);
 
-    TRequestStatus status;
-
     // Initiate the request
-    SendReceive(ESetCachingStatusObserver, args, status);
-
-    User::WaitForRequest(status);
+    User::LeaveIfError (SendReceive(ESetCachingStatusObserver, args));
 }
 
 // ----------------------------------------------------------------------------
@@ -349,12 +309,8 @@
 {
     TIpcArgs args(TIpcArgs::ENothing, TIpcArgs::ENothing);
 
-    TRequestStatus status;
-
     // Initiate the request
-    SendReceive(EResetCachingStatusObserver, args, status);
-
-    User::WaitForRequest(status);
+    User::LeaveIfError (SendReceive(EResetCachingStatusObserver, args));
 }
 
 // ----------------------------------------------------------------------------
@@ -387,12 +343,8 @@
 {
     TIpcArgs args(TIpcArgs::ENothing, TIpcArgs::ENothing);
 
-    TRequestStatus status;
-
     // Initiate the request
-    SendReceive(ERemoveChangeEvent, args, status);
-
-    User::WaitForRequest(status);
+    User::LeaveIfError ( SendReceive(ERemoveChangeEvent, args));
 }
 
 // ----------------------------------------------------------------------------
@@ -420,16 +372,11 @@
     {
     PRINT( _L("Enter RCsSession::GetConversationIdL") );
 
-    TRequestStatus status;
+
     TIpcArgs args(aContactId, &aResultsBuffer);
 
     // Initiate the request
-    SendReceive(EGetConversationId,
-            args,
-            status );
-
-    User::WaitForRequest(status);
-
+    User::LeaveIfError (SendReceive(EGetConversationId, args) );
     PRINT( _L("End RCsSession::GetConversationIdL") );
     }
 
@@ -440,18 +387,29 @@
     {
     PRINT( _L("Enter RCsSession::GetConversationIdFromAddressL") );
 
-    TRequestStatus status;
     TIpcArgs args(&aContactAddress, &aResultsBuffer);
 
     // Initiate the request
-    SendReceive(EGetConversationIdFromAddress,
-            args,
-            status );
-
-    User::WaitForRequest(status);
+    User::LeaveIfError (SendReceive(EGetConversationIdFromAddress,
+            args ));
 
     PRINT( _L("End RCsSession::GetConversationIdFromAddressL") );
     }
+	
+// ----------------------------------------------------------------------------
+// RCsSession::GetConversationFromMessageIdL
+// ----------------------------------------------------------------------------
+void RCsSession::GetConversationFromMessageIdL(TInt aMessageId, TPtr8 aResultsBuffer)
+    {
+    PRINT( _L("Enter RCsSession::GetConversationFromMessageIdL") );
+    
+    TIpcArgs args(aMessageId, &aResultsBuffer);
+
+    // Initiate the request
+    User::LeaveIfError (SendReceive(EGetConversationFromMessageId, args ) );
+    PRINT( _L("End RCsSession::GetConversationFromMessageIdL") );
+    }
+	
 // ----------------------------------------------------------------------------
 // RCsSession::MarkConversationReadL
 // ----------------------------------------------------------------------------
--- a/messagingapp/msgappfw/msghistory/src/msghistoryprivate.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/msghistory/src/msghistoryprivate.cpp	Mon May 03 12:29:07 2010 +0300
@@ -106,10 +106,8 @@
     clientConversation->SetConversationEntryL(entry);
 
     handler->RequestConversationChangeEventL(this, clientConversation);
-    if ( clientConversation )
-        delete clientConversation;
-    if( entry )
-        delete entry;        
+    delete clientConversation;
+    delete entry;        
     if ( err == KErrNone )
         return ETrue;
 
@@ -132,10 +130,9 @@
     clientConversation->SetConversationEntryL(entry);
 
     handler->RemoveConversationChangeEventL(this, clientConversation);
-    if ( clientConversation )
-        delete clientConversation;
-    if( entry )
-        delete entry;
+    delete clientConversation;
+		
+	delete entry;
     if ( err == KErrNone )
         return ETrue;
 
--- a/messagingapp/msgappfw/msghistory/src/msgitem.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/msghistory/src/msgitem.cpp	Mon May 03 12:29:07 2010 +0300
@@ -99,17 +99,17 @@
 // MsgItem::isAttributeSet
 //@ see header
 // ---------------------------------------------------------------------------
-MsgItem::MsgAttribute MsgItem::isAttributeSet
+bool MsgItem::isAttributeSet
 (MsgItem::MsgAttribute attribute) const
     {
-    return (MsgItem::MsgAttribute)(mAttributes & attribute );
+    return (mAttributes & attribute );
     }
 
 // ---------------------------------------------------------------------------
 // MsgItem::setId
 //@ see header
 // ---------------------------------------------------------------------------
-void MsgItem::setId(const int id)
+void MsgItem::setId(int id)
     {
     mId = id;
     }
--- a/messagingapp/msgappfw/plugin/group/ABLD.BAT	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-@ECHO OFF
-
-REM Bldmake-generated batch file - ABLD.BAT
-REM ** DO NOT EDIT **
-
-perl -S ABLD.PL "\sf\app\messaging\messagingapp\msgappfw\plugin\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9
-if errorlevel==1 goto CheckPerl
-goto End
-
-:CheckPerl
-perl -v >NUL
-if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed?
-goto End
-
-:End
--- a/messagingapp/msgappfw/plugin/inc/ccsmsghandler.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/plugin/inc/ccsmsghandler.h	Mon May 03 12:29:07 2010 +0300
@@ -55,13 +55,11 @@
 enum TMsgHandlerState
     {
     EReadInbox,
-    EProcessInbox,
     EReadSent,
-    EProcessSent,
-    EReadDraft,
     EProcessDraft,
     EReadOutbox,
-    EProcessOutbox,
+    ESortEntries,
+    EProcessEntries,
     EComplete
     };
 
@@ -186,6 +184,7 @@
      * @param aEntry, TMsvEntry
      */
     TCsType ExtractCsType( const TMsvEntry& aEntry);
+
 	
 private: //Data
 
@@ -249,6 +248,11 @@
     CMsvEntrySelection* iMessages;
 
     /**
+     * Master array for holding all the messages 
+     */
+   RArray<TMsvId>* iMessageArray;
+
+    /**
      * State
      */
     TMsgHandlerState iState;
--- a/messagingapp/msgappfw/plugin/src/ccsmsghandler.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/plugin/src/ccsmsghandler.cpp	Mon May 03 12:29:07 2010 +0300
@@ -32,8 +32,13 @@
 #include <e32const.h>
 #include <SendUiConsts.h>
 #include <pushentry.h> // For services messages
+#include <e32cmn.h>
 
-// NOTE:- DRAFTS AND OUTBOX ENTRIES ARE NOT HANDLED IN THE PLUGIN
+
+//CONSTANTS
+const TInt KMessageArrayGranularity = 50;
+
+// NOTE:- DRAFT ENTRIES ARE NOT HANDLED IN THE PLUGIN
 
 // ============================== MEMBER FUNCTIONS ============================
 // ----------------------------------------------------------------------------
@@ -114,6 +119,14 @@
         delete iMessages;
         iMessages = NULL;
         }
+    
+    if(iMessageArray)
+    {
+        iMessageArray->Reset();
+        iMessageArray->Close();
+        delete iMessageArray;
+        iMessageArray = NULL;
+    }
 
     PRINT ( _L("End CCsMsgHandler::~CCsMsgHandler") );
     }
@@ -145,6 +158,8 @@
 
     iState = EReadInbox;
 
+    iMessageArray = new (ELeave)RArray <TMsvId>(KMessageArrayGranularity);
+
     iMessageCount = 0;
 
     PRINT ( _L("End CCsMsgHandler::ConstructL") );
@@ -554,25 +569,31 @@
         ProcessEntryL(aEvent, KNullDesC, description, aEntry);       
         }
 
-    if ( tmpBuffer )
-        {
-        delete tmpBuffer;
-        }
+    delete tmpBuffer;
 
     PRINT ( _L("Exit CCsMsgHandler::ExtractAddressesL") );
     }
 
 // -----------------------------------------------------------------------------
+// CCsMsgHandler::CompareOrder()
+// Method for determining the sorting behaviour of RArray of TMsvId's  
+// -----------------------------------------------------------------------------
+//
+static TInt CompareOrder(const TMsvId& aFirst, const TMsvId& aSecond)
+    {
+    return aSecond - aFirst;
+    }
+// -----------------------------------------------------------------------------
 // CCsMsgHandler::UploadMsgL()
 // State machine to upload all messages 
 // -----------------------------------------------------------------------------
 //
 TInt CCsMsgHandler::UploadMsgL() 
+{
+    switch ( iState ) 
     {
-    switch ( iState ) 
+        case EReadInbox:
         {
-        case EReadInbox:
-            {
             iRootEntry = iSession->GetEntryL(KMsvGlobalInBoxIndexEntryId);
 
             // Set sort order
@@ -580,42 +601,24 @@
             order.SetSorting(EMsvSortById);
             iRootEntry->SetSortTypeL(order);
 
-            iMessages = iRootEntry->ChildrenL();	
+            iMessages = iRootEntry->ChildrenL();
             iMessageCount = iRootEntry->Count();
-
-            if ( iMessageCount ) 
-                iState = EProcessInbox;
-            else
+            if(iMessageCount)
+            {
+                for(int i = 0; i < iMessageCount; i ++)
                 {
-                iState = EReadSent;
-                CleanupL();
+                    iMessageArray->Append(iMessages->At(i));
                 }
-
-            return 1;
             }
 
-        case EProcessInbox:
-            {
-            iMessageCount = iMessageCount - 1;
-            TMsvEntry entry = iRootEntry->ChildDataL(iMessages->At(iMessageCount));
-            if(IsMtmSupported(entry.iMtm.iUid))
-                {
-                ProcessResultsL(entry);  
-                }
-
-            if ( iMessageCount ) 
-                iState = EProcessInbox;
-            else 
-                {
-                iState = EReadSent;
-                CleanupL();
-                }
+            iState = EReadSent;
+            CleanupL();              
 
             return 1;
-            }
+        }
 
         case EReadSent:
-            {
+        {
             iRootEntry = iSession->GetEntryL(KMsvSentEntryId);
 
             // Set sort order
@@ -625,88 +628,75 @@
 
             iMessages = iRootEntry->ChildrenL();    
             iMessageCount = iRootEntry->Count();
-
-            if ( iMessageCount ) 
-                iState = EProcessSent;
-            else
+            if(iMessageCount)
+            {
+                for(int i = 0; i < iMessageCount; i++ )
                 {
-                iState = EReadOutbox;
-                CleanupL();
+                    iMessageArray->Append(iMessages->At(i));
                 }
-
-            return 1;
             }
 
-        case EProcessSent:
-            {
-            iMessageCount = iMessageCount - 1;
-            TMsvEntry entry = iRootEntry->ChildDataL(iMessages->At(iMessageCount));
-            if(IsMtmSupported(entry.iMtm.iUid))
-                {
-                ProcessResultsL(entry);  
-                }
+            iState = EReadOutbox;
+            CleanupL();
 
-            if ( iMessageCount ) 
-                iState = EProcessSent;
-            else 
-                {
-                iState = EReadOutbox;
-                CleanupL();
-                }
+            return 1;
+        }
 
-            return 1;        
-            }
-            
         case EReadOutbox:
-            {
+        {
             iRootEntry = iSession->GetEntryL(KMsvGlobalOutBoxIndexEntryId);
-            
+
             // Set sort order
             TMsvSelectionOrdering order;
             order.SetSorting(EMsvSortById);
             iRootEntry->SetSortTypeL(order);
-            
-            iMessages = iRootEntry->ChildrenL();    
+
+            iMessages = iRootEntry->ChildrenL();  
             iMessageCount = iRootEntry->Count();
-            
-            if ( iMessageCount ) 
-                iState = EProcessOutbox;
-            else
-                {
-                iState = EComplete;
-                iMsgObserver->HandleCachingCompleted();
-                CleanupL();
-                return 0; // DONE
-                }
-            
-            return 1;
-            }
-            
-        case EProcessOutbox:
+
+            if(iMessageCount)
             {
-            iMessageCount = iMessageCount - 1;
-            TMsvEntry entry = iRootEntry->ChildDataL(iMessages->At(iMessageCount));
-            if(IsMtmSupported(entry.iMtm.iUid))
-                {
-                ProcessResultsL(entry);  
-                }
-            
-            if ( iMessageCount ) 
-                iState = EProcessOutbox;
-            else 
+                for(int i = 0; i < iMessageCount; i ++)
                 {
-                iState = EComplete;
-                iMsgObserver->HandleCachingCompleted();
-                CleanupL();
-                return 0; // DONE
+                    iMessageArray->Append(iMessages->At(i));
                 }
-            
-            return 1;        
+                iMessageCount=0;
             }
+            iState = ESortEntries;
+            CleanupL();
+
+            return 1;
+        }
+        case ESortEntries:
+        {
+             //Sort the elements in the array by descending order of TMsvId's
+            TLinearOrder<TMsvId> order(CompareOrder);
+            iMessageArray->Sort(order);
+            iState = EProcessEntries;
+            return 1;
         }
+        
+        case EProcessEntries:
+        { 
+            //Process one entry at a time in sequence
+            //Process the first element in the array on each call, till the end
+            if(iMessageArray->Count())
+            {
+                ProcessResultsL(iSession->GetEntryL(iMessageArray->operator[](0))->Entry());
+                iMessageArray->Remove(0);
+            }
+            else
+            {
+                iMsgObserver->HandleCachingCompleted();
+                return 0; //DONE 
+            }
 
-    return 0;
+            iState = EProcessEntries;
+            return 1; 
+        }
     }
+    return 0;    
+}
 
 // -----------------------------------------------------------------------------
 // CCsMsgHandler::UploadMsg()
@@ -792,6 +782,10 @@
         {
         case KSenduiMtmSmsUidValue:            
             type = ECsSMS;
+            if (aEntry.iBioType == KMsgBioUidVCard.iUid)
+                {
+                type = ECsBioMsg_VCard;
+                }
             break;
         case KSenduiMtmBtUidValue:
             type = ECsBlueTooth;
--- a/messagingapp/msgappfw/server/inc/ccscontactsresolver.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/server/inc/ccscontactsresolver.h	Mon May 03 12:29:07 2010 +0300
@@ -41,17 +41,15 @@
 class CCsContactDetail
 {
 public:
+    
 	/**
 	 * Constructor
 	 */
-    CCsContactDetail():contactId(-1),firstName(QString()),
-					lastName(QString()),nickName(QString()){};
+    CCsContactDetail():contactId(-1),displayName(QString()){};
+    
 public:
-	int contactId;
-	QString firstName;
-	QString lastName;
-	QString nickName;
-	QString companyName;
+    int contactId;
+	QString displayName;
 	QStringList addressList;
 };
 
--- a/messagingapp/msgappfw/server/inc/ccsconversation.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/server/inc/ccsconversation.h	Mon May 03 12:29:07 2010 +0300
@@ -68,28 +68,12 @@
     void SetConversationId(TCsConversationEntryID aCsConversationEntryID);
 
     /**
-     * GetFirstName
-     * Returns the first name of the Conversation
+     * GetDisplayName
+     * Returns the display name of the Conversation
      * 
      * @return First name of conversation
      */
-    HBufC* GetFirstName() const;
-
-    /**
-     * GetLastName
-     * Returns the last name of this Conversation
-     * 
-     * @return last name of conversation
-     */
-    HBufC* GetLastName() const;
-
-    /**
-     * GetNickName
-     * Returns the nick name of this Conversation
-     * 
-     * @return nick name of conversation
-     */
-    HBufC* GetNickName() const;
+    HBufC* GetDisplayName() const;
 
     /**
      * GetContactId
@@ -98,6 +82,7 @@
      * 
      * @return - integer type contact Id
      */
+    
     TInt32 GetContactId() const;
 
     /**
@@ -152,8 +137,9 @@
      * @param aFirstName first name
      * @param aLastName last name
      */
-    void AddContactDetailsL(TInt32 aContactId, const TDesC& aFirstName,
-                            const TDesC& aLastName, const TDesC& aNickName);
+    void AddContactDetailsL(
+            TInt32 aContactId, 
+            const TDesC& aDisplayName);
 
     /**
      * AddContactDetailsL
--- a/messagingapp/msgappfw/server/inc/ccsconversationcache.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/server/inc/ccsconversationcache.h	Mon May 03 12:29:07 2010 +0300
@@ -187,6 +187,13 @@
      * @return The conversation id
      */
     TInt GetConversationIdFromAddressL(TDesC& aContactAddress);
+    
+    /**
+     * Get conversation from message-id
+     * @param aMessageId Message id
+     * @return CCsClientConversation The conversation 
+     */
+    CCsClientConversation* GetConversationFromMessageIdL(TInt aMessageId);
 
 private:
 
--- a/messagingapp/msgappfw/server/inc/ccsconversationcachehelper.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/server/inc/ccsconversationcachehelper.h	Mon May 03 12:29:07 2010 +0300
@@ -193,8 +193,7 @@
      * @param aLastName contact last name
      */
     void AddNewConversationL(CCsConversationEntry* aConversationEntry,
-                             TInt32 aContactId, const HBufC* aFirstName,
-                             const HBufC* aLastName, const HBufC* aNickName);
+                             TInt32 aContactId, const HBufC* aDisplayName);
 
     /**
      * GetPendingEventCount
--- a/messagingapp/msgappfw/server/inc/ccsconversationcontact.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/server/inc/ccsconversationcontact.h	Mon May 03 12:29:07 2010 +0300
@@ -29,7 +29,7 @@
 /** 
  * CS Server Conversation Contact Details class
  * This shall hold all the details of contact associated with a 
- * conversation like name, numbers and contact link
+ * conversation like name, numbers and contact id
  */
 class CCsConversationContact : public CBase
 {
@@ -46,52 +46,20 @@
     ~CCsConversationContact();
 
     /**
-     * GetFirstName
+     * GetDisplayName
      * Get the first name of contact
      *  
      * @return  returns the First name        
      */
-    HBufC* GetFirstName() const;
-
-    /**
-     * GetLastName
-     * Get the last name of contact 
-     *   
-     * @return  returns last name      
-     */
-    HBufC* GetLastName() const;
-    
-    /**
-     * GetNickName
-     * Get the nick name of contact 
-     *   
-     * @return  returns nick name      
-     */
-    HBufC* GetNickName() const;
+    HBufC* GetDisplayName() const;
 
     /**
-     * SetFirstNameL
+     * SetDisplayNameL
      * Set the first name of contact  
      * 
-     * @param aFirstName first name       
-     */
-    void SetFirstNameL(const TDesC& aFirstName);
-
-    /**
-     * SetLastNameL
-     * Set the last name of contact  
-     *   
-     * @param aLastName  last name     
+     * @param aDisplayName first name       
      */
-    void SetLastNameL(const TDesC& aLastName);
-    
-    /**
-     * SetNickNameL
-     * Set the nick name of contact  
-     *   
-     * @param aNickName  nick name     
-     */
-    void SetNickNameL(const TDesC& aNickName);
+    void SetDisplayNameL(const TDesC& aDisplayName);
 
     /**
      * GetContactId
@@ -155,21 +123,7 @@
      * Conversation first name
      * Own.
      */
-    HBufC* iFirstName;
-
-    /**
-     * iLastName
-     * Conversation last name
-     * Own.
-     */
-    HBufC* iLastName;
-
-    /**
-     * iNickName
-     * Conversation nick name
-     * Own.
-     */
-    HBufC* iNickName;
+    HBufC* iDisplayName;   
 
     /**
      * iContactId
--- a/messagingapp/msgappfw/server/inc/ccsconversationdeletehandler.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/server/inc/ccsconversationdeletehandler.h	Mon May 03 12:29:07 2010 +0300
@@ -71,13 +71,13 @@
 public: // From CActive
     void RunL();
     void DoCancel();
-
+		
 private:    
     CCsConversationDeleteHandler();
     void ConstructL(CCsConversationCache* aCache,
             MCsConversationDeleteObserver* aObserver);
     void IssueRequest();
-    void DeleteOneMessageL();
+    void DeleteOneMessage();
     
 private:
     /**
--- a/messagingapp/msgappfw/server/inc/ccsconversationmarkreadhandler.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/server/inc/ccsconversationmarkreadhandler.h	Mon May 03 12:29:07 2010 +0300
@@ -71,6 +71,7 @@
 public: // From CActive
     void RunL();
     void DoCancel();
+    TInt RunError(TInt aError);
 
 private:    
     CCsConversationMarkReadHandler();
--- a/messagingapp/msgappfw/server/inc/ccssession.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/server/inc/ccssession.h	Mon May 03 12:29:07 2010 +0300
@@ -345,6 +345,15 @@
      * @param aMessage RMessage instance
      */
     void GetConversationIdfromAddressL(const RMessage2& aMessage);
+	
+	/**
+     * GetConversationFromMessageIdL
+     * Get the conversation from message-id
+     * 
+     * @param aMessage RMessage instance
+     */
+    void GetConversationFromMessageIdL(const RMessage2& aMessage);
+    
     /**
      * MarkConversationReadL
      * Service method to mark a conversation as read.
--- a/messagingapp/msgappfw/server/src/ccscontactsresolver.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/server/src/ccscontactsresolver.cpp	Mon May 03 12:29:07 2010 +0300
@@ -16,16 +16,12 @@
  */
 
 // SYSTEM INCLUDES
-//#include <QtContacts> 
 #include "qtcontacts.h" 
 #include "qcontactdetailfilter.h"
-#include "qcontactdetail.h"
+#include <QList>
 
-#include <QList>
 // USER INCLUDES
 #include "ccscontactsresolver.h"
-#include "qcontactnickname.h"
-#include "qcontactorganization.h"
 // ======================== Member Functions ====================
 
 // ----------------------------------------------------------------------------
@@ -55,31 +51,26 @@
         CCsContactDetail &contactDetail)
     {
     QContactDetailFilter phoneFilter;
-    phoneFilter.setDetailDefinitionName(QContactPhoneNumber::DefinitionName, QContactPhoneNumber::FieldNumber);
+    phoneFilter.setDetailDefinitionName(
+            QContactPhoneNumber::DefinitionName, 
+            QContactPhoneNumber::FieldNumber);
+    
     phoneFilter.setValue(address);
     phoneFilter.setMatchFlags(QContactFilter::MatchEndsWith);
 
-    QList<QContactLocalId> matchingContacts = mPhonebookManager->contacts(phoneFilter);
-
-    if ( matchingContacts.count() > 0 ) {		
-    // Fill the contact details
-    contactDetail.contactId = matchingContacts.at(0);
-    QContact match = mPhonebookManager->contact(matchingContacts.at(0));
-
-    QContactName nameDetails = match.detail(QContactName::DefinitionName);
+    QList<QContactSortOrder> sortOrder;
+    QList<QContact> matchingContacts = mPhonebookManager->contacts(
+                                                phoneFilter,
+                                                sortOrder,
+                                                QStringList());
 
-    QContactName name = match.detail(QContactName::DefinitionName);
-    contactDetail.firstName = name.first();
-    contactDetail.lastName = name.last();
-    
-    contactDetail.nickName = match.detail<QContactNickname>().nickname();
-    
-    //campany name QContactOrganization
-    contactDetail.companyName = match.detail<QContactOrganization>().name();
-    
-    return true;
-
-    }		
+    if ( matchingContacts.count() > 0 ) {	        
+        QContact match = matchingContacts.at(0);
+        // Fill the contact details        
+        contactDetail.contactId = match.localId();
+        contactDetail.displayName = match.displayLabel();   
+        return true;
+    }
     return false;
     }
 
@@ -94,10 +85,9 @@
     // Fetch back the persisted contact
     QContact contact = mPhonebookManager->contact(contactId);
     contactDetail.contactId = contact.localId(); 
-    QContactName name = contact.detail(QContactName::DefinitionName);
-    contactDetail.firstName = name.first();
-    contactDetail.lastName = name.last();
     
+    contactDetail.displayName = contact.displayLabel();
+        
     QList<QContactPhoneNumber> numbers = contact.details<QContactPhoneNumber>();
     int numberCount = numbers.count();
 
@@ -105,13 +95,7 @@
         {
         QString phoneNumber= numbers.at(a).number();
         contactDetail.addressList.append(phoneNumber);
-        }
-    
-    QContactNickname nickName = contact.detail(QContactName::DefinitionName);
-    contactDetail.nickName = nickName.nickname();
-    
-    //company name QContactOrganization
-    contactDetail.companyName = contact.detail<QContactOrganization>().name();
+        }    
     }
 
 // EOF
--- a/messagingapp/msgappfw/server/src/ccsconversation.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/server/src/ccsconversation.cpp	Mon May 03 12:29:07 2010 +0300
@@ -118,20 +118,15 @@
     }
 
 // ----------------------------------------------------------------------------
-// Get the Conversation Entry First name from Coversation Detail class
+// Get the Conversation Entry Display name from Coversation Detail class
 // ----------------------------------------------------------------------------
 HBufC*
-CCsConversation::GetFirstName()const
+CCsConversation::GetDisplayName()const
     {
-    HBufC* fn = iContact->GetFirstName();
+    HBufC* fn = iContact->GetDisplayName();
     if ( fn && fn->Length() > 0 )
        return fn;
 
-    // If last name is present don't promote phone number as first name
-    HBufC* ln = iContact->GetLastName();
-    if ( ln && ln->Length() > 0 )
-       return NULL;
-
 	RPointerArray<TDesC> pnoList;
 	iContact->GetPhoneNumberList(pnoList);
 	if(pnoList.Count())
@@ -143,24 +138,6 @@
     }
 
 // ----------------------------------------------------------------------------
-// Get the Conversation Entry Last name from Coversation Detail class
-// ----------------------------------------------------------------------------
-HBufC*
-CCsConversation::GetLastName() const
-    {    
-    return iContact->GetLastName();
-    }
-
-// ----------------------------------------------------------------------------
-// Get the Conversation Entry Nick name from Coversation Detail class
-// ----------------------------------------------------------------------------
-HBufC*
-CCsConversation::GetNickName() const
-    {    
-    return iContact->GetNickName();
-    }
-
-// ----------------------------------------------------------------------------
 // CCsConversation::GetContactId
 // Get the Conversation Entry Contact Id from Coversation Detail class
 // ----------------------------------------------------------------------------
@@ -276,14 +253,10 @@
 void
 CCsConversation::AddContactDetailsL(
         TInt32  aContactId,
-        const TDesC& aFirstName,
-		const TDesC& aLastName,
-		const TDesC& aNickName)
+        const TDesC& aDisplayName)
     {
-    iContact->SetFirstNameL(aFirstName);
-    iContact->SetLastNameL(aLastName);
-    iContact->SetContactId (aContactId);
-    iContact->SetNickNameL(aNickName);
+    iContact->SetDisplayNameL(aDisplayName);
+    iContact->SetContactId (aContactId);    
     }
 
 // ----------------------------------------------------------------------------
--- a/messagingapp/msgappfw/server/src/ccsconversationcache.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/server/src/ccsconversationcache.cpp	Mon May 03 12:29:07 2010 +0300
@@ -424,9 +424,7 @@
     CCsClientConversation* clientConversation = CCsClientConversation::NewL();
     CleanupStack::PushL(clientConversation);
 
-    clientConversation->SetFirstNameL(aConversation->GetFirstName());
-    clientConversation->SetLastNameL(aConversation->GetLastName());
-    clientConversation->SetNickNameL(aConversation->GetNickName());
+    clientConversation->SetDisplayNameL(aConversation->GetDisplayName());
     clientConversation->SetConversationEntryId(aConversation->GetConversationId());
     clientConversation->SetConversationEntryL(aConversationEntry);
     clientConversation->SetContactId(aConversation->GetContactId());
@@ -640,4 +638,35 @@
     }
     return -1;
     }
+
+// ----------------------------------------------------------------------------
+// CCsConversationCache::GetConversationFromMessageIdL
+// ---------------------------------------------------------------------------
+CCsClientConversation* CCsConversationCache::GetConversationFromMessageIdL(TInt aMessageId)
+{
+    TInt conversationCount = iConversationList->Count();
+
+    for ( TInt loop = 0; loop < conversationCount; loop++ )
+    {
+        CCsConversation* conversation =
+            static_cast<CCsConversation*>((*iConversationList)[loop]);
+
+        // Get the conversation entries
+        RPointerArray<CCsConversationEntry> entryList;
+        conversation->GetEntryListL(&entryList);
+
+        for ( TInt loop1 = 0; loop1 < entryList.Count(); loop1++ )
+        {
+            TInt messageId = entryList[loop1]->EntryId();
+            if ( messageId == aMessageId )
+            {
+                CCsClientConversation *clientConv = CreateClientConvLC(conversation, entryList[loop1]);
+                CleanupStack::Pop();
+                return clientConv;
+            }
+        }
+    }
+    return NULL;
+}
+
 //end of file
--- a/messagingapp/msgappfw/server/src/ccsconversationcachehelper.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/server/src/ccsconversationcachehelper.cpp	Mon May 03 12:29:07 2010 +0300
@@ -247,7 +247,7 @@
 void CCsConversationCacheHelper::HandleSpecialConversationL()
 {
     CCsConversationEntry* conEntry =
-            iConversationEvent->ClientConversation()->GetConversationEntry();
+        iConversationEvent->ClientConversation()->GetConversationEntry();
 
     if (ECsBlueTooth == conEntry->GetType())
     {
@@ -290,8 +290,7 @@
 TUint8 CCsConversationCacheHelper::NeedsSpecialProcessing(
                                                           CCsConversationEntry* aConversationEntry)
 {
-    if (aConversationEntry->Contact() == NULL
-            && aConversationEntry->IsAttributeSet(ECsAttributeDraft))
+    if (ECsBlueTooth == aConversationEntry->GetType())
     {
         return 1;
     }
@@ -343,33 +342,17 @@
             if (cIndex == KErrNotFound)
             {
                 // Add as new conversation
-                HBufC* firstName = NULL;
-                if(!contactDetail.firstName.isEmpty())
-                {
-                    firstName=S60QConversions::qStringToS60Desc(contactDetail.firstName);
-                }
-                HBufC* lastName=NULL;
-                if(!contactDetail.lastName.isEmpty())
+                HBufC* displayName = NULL;
+                if(!contactDetail.displayName.isEmpty())
                 {
-                    lastName=S60QConversions::qStringToS60Desc(contactDetail.lastName);
+                    displayName=S60QConversions::qStringToS60Desc(contactDetail.displayName);
                 }
-                
-                HBufC* nickName=NULL;
-                if(!contactDetail.nickName.isEmpty())
-                {
-                    nickName=S60QConversions::qStringToS60Desc(contactDetail.nickName);
-                }
-                
                 TRAPD(error, AddNewConversationL( aConverastionEvent->
                                 ClientConversation()->GetConversationEntry(),
                                 contactId,
-                                firstName,
-                                lastName,
-                                nickName));
+                                displayName));
 
-                if (firstName) delete firstName;
-                if (lastName) delete lastName;
-                if (nickName) delete nickName;
+                if (displayName) delete displayName;                
 
                 if (error != KErrNone)
                 {
@@ -380,8 +363,9 @@
             {
                 // this is when two contacts are having same contact Id,
                 // in that case it should add into an existing conversation
-                TRAPD(error, AddConversationEntryL( aConverastionEvent->
-                                ClientConversation()->GetConversationEntry(), cIndex));
+                TRAPD(error, AddConversationEntryL( 
+                        aConverastionEvent->ClientConversation(
+                                )->GetConversationEntry(), cIndex));
                 if (error != KErrNone)
                 {
                     // handle error
@@ -412,8 +396,16 @@
 
     CCsConversation* conversation = (*conversationList)[aConversationIndex];
 
-    CCsConversationEntry* prevLatestEntry =
-            conversation->GetLatestEntryL()->CloneL();
+    CCsConversationEntry* prevLatestEntry = conversation->GetLatestEntryL();
+
+    if (prevLatestEntry)
+    {
+        prevLatestEntry = prevLatestEntry->CloneL();
+    }
+    else
+    {
+        prevLatestEntry = aConEntry->CloneL();
+    }
 
     CleanupStack::PushL(prevLatestEntry);
 
@@ -567,9 +559,7 @@
 void CCsConversationCacheHelper::AddNewConversationL(
                                                      CCsConversationEntry* aConversationEntry,
                                                      TInt32 aContactId,
-                                                     const HBufC* aFirstName,
-                                                     const HBufC* aLastName,
-                                                     const HBufC* aNickName)
+                                                     const HBufC* aDisplayName)
 {
     CCsConversation* conversation = CCsConversation::NewL();
     CleanupStack::PushL(conversation);
@@ -583,9 +573,7 @@
 
     // fill firstname and lastname and contact Id
     conversation->AddContactDetailsL(aContactId,
-                                     *aFirstName,
-                                     *aLastName,
-                                     *aNickName);
+                                     *aDisplayName);
 
     // fill the phone number
     if (aConversationEntry->Contact())
--- a/messagingapp/msgappfw/server/src/ccsconversationcontact.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/server/src/ccsconversationcontact.cpp	Mon May 03 12:29:07 2010 +0300
@@ -42,9 +42,7 @@
 void
 CCsConversationContact::ConstructL()
     {
-    iFirstName = NULL;
-    iLastName = NULL;
-    iNickName = NULL;
+    iDisplayName = NULL;
     iContactId = KErrNotFound;
     iPhoneNumberList = new (ELeave) RPointerArray<HBufC> ();
     }
@@ -69,22 +67,10 @@
 // ----------------------------------------------------------------------------
 CCsConversationContact::~CCsConversationContact()
     {
-    if(iFirstName)
-        {
-        delete iFirstName;
-        iFirstName = NULL;
-        }
-
-    if(iLastName)
+    if(iDisplayName)
         {
-        delete iLastName;
-        iLastName = NULL;
-        }
-    
-    if(iNickName)
-        {
-        delete iNickName;
-        iNickName = NULL;
+        delete iDisplayName;
+        iDisplayName = NULL;
         }
 
     if (iPhoneNumberList)
@@ -97,46 +83,26 @@
     }
 
 // ----------------------------------------------------------------------------
-// CCsConversationContact::GetFirstName
-// get the first name of the conversation
+// CCsConversationContact::GetDisplayName
+// get the display name of the conversation
 // ----------------------------------------------------------------------------
 HBufC*
-CCsConversationContact::GetFirstName() const
+CCsConversationContact::GetDisplayName() const
     {
-    return iFirstName;
-    }
-
-// ----------------------------------------------------------------------------
-// CCsConversationContact::GetLastName
-// get the last name of the conversation
-// ----------------------------------------------------------------------------
-HBufC*
-CCsConversationContact::GetLastName() const
-    {
-    return iLastName;
+    return iDisplayName;
     }
 
 // ----------------------------------------------------------------------------
-// CCsConversationContact::GetNickName
-// get the nick name of the conversation
-// ----------------------------------------------------------------------------
-HBufC*
-CCsConversationContact::GetNickName() const
-    {
-    return iNickName;
-    }
-
-// ----------------------------------------------------------------------------
-// CCsConversationContact::SetFirstNameL
-// Sets the first name of the conversation
+// CCsConversationContact::SetDisplayNameL
+// Sets the display name of the conversation
 // ----------------------------------------------------------------------------
 void
-CCsConversationContact::SetFirstNameL(
-        const TDesC& aFirstName)
+CCsConversationContact::SetDisplayNameL(
+        const TDesC& aDisplayName)
     {
-    if( &aFirstName )
+    if( &aDisplayName )
         {
-        TRAPD(error, iFirstName = aFirstName.AllocL());
+        TRAPD(error, iDisplayName = aDisplayName.AllocL());
         if(error != KErrNone)
             {
             // handle error
@@ -148,47 +114,6 @@
     }
 
 // ----------------------------------------------------------------------------
-// CCsConversationContact::SetLastNameL
-// Sets the first name of the conversation
-// ----------------------------------------------------------------------------
-void
-CCsConversationContact::SetLastNameL(
-        const TDesC& aLastName)
-    {
-    if( &aLastName )
-        {
-        TRAPD(error, iLastName = aLastName.AllocL());
-        if(error != KErrNone)
-            {
-            // handle error
-            // call panic
-            PRINT1 ( _L("CCsConversationContact::SetLastNameL - Error:%d"),
-                    error );
-            }
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CCsConversationContact::SetNickNameL
-// Sets the first name of the conversation
-// ----------------------------------------------------------------------------
-void
-CCsConversationContact::SetNickNameL(
-        const TDesC& aNickName)
-    {
-    if( &aNickName )
-        {
-        TRAPD(error, iNickName = aNickName.AllocL());
-        if(error != KErrNone)
-            {
-            // handle error
-            // call panic
-            PRINT1 ( _L("CCsConversationContact::SetNickNameL - Error:%d"),
-                    error );
-            }
-        }
-    }
-// ----------------------------------------------------------------------------
 // CCsConversationContact::GetContactId
 // get the phonebook Contact Id link for the conversation
 // ----------------------------------------------------------------------------
--- a/messagingapp/msgappfw/server/src/ccsconversationdeletehandler.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/server/src/ccsconversationdeletehandler.cpp	Mon May 03 12:29:07 2010 +0300
@@ -110,11 +110,13 @@
 // ----------------------------------------------------------------------------
 // Delete a message
 // ----------------------------------------------------------------------------
-void CCsConversationDeleteHandler::DeleteOneMessageL()
+void CCsConversationDeleteHandler::DeleteOneMessage()
     {
     CCsConversationEntry* entry = 
             static_cast<CCsConversationEntry*>((*iConversationEntryList)[iDeletedCount]);
+            
     TInt id = entry->EntryId();
+    
     if ( ECsSendStateSending != entry->GetSendState() )
         {
         iSession->RemoveEntry(id);
@@ -144,7 +146,7 @@
         
         case EDeleteNext:
             iDeletedCount--;
-            DeleteOneMessageL();
+            DeleteOneMessage();
             if ( iDeletedCount > 0 )
                 {
                 iState = EDeleteNext;
--- a/messagingapp/msgappfw/server/src/ccsconversationmarkreadhandler.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/server/src/ccsconversationmarkreadhandler.cpp	Mon May 03 12:29:07 2010 +0300
@@ -114,7 +114,8 @@
         TRAPD(err, cEntry = iSession->GetEntryL(id));
         if ( err == KErrNotFound )
            return;
-        
+        CleanupStack::PushL(cEntry);
+        	
         TMsvEntry entry = cEntry->Entry();
         if ( entry.Unread() ) 
            {
@@ -125,7 +126,7 @@
             }
            cEntry->ChangeL( entry );
            }
-        delete cEntry;
+        CleanupStack::PopAndDestroy(cEntry);
         }
     }
 
@@ -176,8 +177,21 @@
             // Notify observers
             iObserver->MarkReadComplete(this);
             break;
-        }
     }
+}
+
+TInt CCsConversationMarkReadHandler::RunError(TInt aError)
+{
+  iMarkReadCount = 0;
+  iConversationEntryList->ResetAndDestroy();
+  iConversationEntryList->Close();
+  delete iConversationEntryList;
+  iConversationEntryList = NULL;  
+            
+  // Notify observer
+  iObserver->MarkReadComplete(this);
+  return KErrNone;
+}
 
 // ----------------------------------------------------------------------------
 // DoCancel
--- a/messagingapp/msgappfw/server/src/ccssession.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/server/src/ccssession.cpp	Mon May 03 12:29:07 2010 +0300
@@ -225,9 +225,14 @@
             break;
             
         case EGetConversationIdFromAddress:
-            PRINT ( _L("Received function EGetConversationId") )
+            PRINT ( _L("Received function EGetConversationIdFromAddress") )
             GetConversationIdfromAddressL(aMessage);
             break;
+			
+		case EGetConversationFromMessageId:
+            PRINT ( _L("Received function EGetConversationFromMessageId") )
+            GetConversationFromMessageIdL(aMessage);
+            break;
 
         case EUserMarkReadConversation:
             PRINT ( _L("Received function EUserMarkReadConversation") )
@@ -1405,6 +1410,62 @@
     aMessage.Complete(EGetConversationIdComplete);
     delete des;
 }
+
+// ----------------------------------------------------------------------------
+// GetConversationFromMessageIdL
+// ----------------------------------------------------------------------------
+void CCsSession::GetConversationFromMessageIdL(const RMessage2& aMessage)
+    {
+    // create a new buffer for writing into stream
+    CBufFlat* buf = CBufFlat::NewL(KBigBuffer);
+    CleanupStack::PushL(buf);
+
+    RBufWriteStream writeStream(*buf);
+    writeStream.PushL();
+
+    // Get the message id
+    TInt messageId = aMessage.Int0();
+    CCsConversationCache* cache = iServer->ConversationCacheInterface();
+    CCsClientConversation* conversation = cache->GetConversationFromMessageIdL(messageId);
+    
+    // if no conversation exists for given message-id, 
+    // create a dummy conversation and complete response
+    if(conversation == NULL)
+    {
+        //create dummy conversation
+        conversation = CCsClientConversation::NewL();
+        CleanupStack::PushL(conversation);
+        conversation->SetConversationEntryId(-1);
+        CCsConversationEntry* entry = CCsConversationEntry::NewL();
+		CleanupStack::PushL(entry);
+        entry->SetEntryId(-1);
+        conversation->SetConversationEntryL(entry); // clone
+		CleanupStack::PopAndDestroy(entry);
+    }
+    else
+    {
+        CleanupStack::PushL(conversation);
+    }
+
+    // Externalize 
+    conversation->ExternalizeL(writeStream);
+    
+    // Results are already packed in the stream
+    writeStream.CommitL();
+    
+    // Create a heap descriptor from the buffer
+    HBufC8* des = HBufC8::NewLC(buf->Size());
+    CleanupStack::Pop(des);
+    TPtr8 ptr(des->Des());
+    buf->Read(0, ptr, buf->Size());
+    
+    CleanupStack::PopAndDestroy(3, buf); // conversation, writestream, buf
+    
+    aMessage.Write(1, *des);
+    aMessage.Complete(EGetConversationFromMessageIdComplete);
+    delete des;
+    }
+
 // ----------------------------------------------------------------------------
 // CCsSession::GetConversationIdfromAddressL
 // ----------------------------------------------------------------------------
--- a/messagingapp/msgappfw/utils/bwins/csutilsu.def	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/utils/bwins/csutilsu.def	Mon May 03 12:29:07 2010 +0300
@@ -13,44 +13,40 @@
 	?GetConversationEntryId@CCsClientConversation@@QBEHXZ @ 12 NONAME ; int CCsClientConversation::GetConversationEntryId(void) const
 	?EntryId@CCsConversationEntry@@QBEHXZ @ 13 NONAME ; int CCsConversationEntry::EntryId(void) const
 	?CompareByConversationEntryId@CCsClientConversation@@SAHABV1@0@Z @ 14 NONAME ; int CCsClientConversation::CompareByConversationEntryId(class CCsClientConversation const &, class CCsClientConversation const &)
-	?InternalizeL@CCsConversationEntry@@UAEXAAVRReadStream@@@Z @ 15 NONAME ; void CCsConversationEntry::InternalizeL(class RReadStream &)
-	?__LatencyMarkEnd@CCsDebugWrapper@@SAXV?$TRefByValue@$$CBVTDesC16@@@@@Z @ 16 NONAME ; void CCsDebugWrapper::__LatencyMarkEnd(class TRefByValue<class TDesC16 const >)
-	?SetSendState@CCsConversationEntry@@QAEXABE@Z @ 17 NONAME ; void CCsConversationEntry::SetSendState(unsigned char const &)
-	?SetConversationEntryId@CCsClientConversation@@QAEXH@Z @ 18 NONAME ; void CCsClientConversation::SetConversationEntryId(int)
-	?IsEmpty@CCsDebugArr@@QAEHXZ @ 19 NONAME ; int CCsDebugArr::IsEmpty(void)
-	?GetContactId@CCsClientConversation@@QBEJXZ @ 20 NONAME ; long CCsClientConversation::GetContactId(void) const
-	?SetNickNameL@CCsClientConversation@@QAEXPBVHBufC16@@@Z @ 21 NONAME ; void CCsClientConversation::SetNickNameL(class HBufC16 const *)
+	?GetDisplayName@CCsClientConversation@@QBEPAVHBufC16@@XZ @ 15 NONAME ; class HBufC16 * CCsClientConversation::GetDisplayName(void) const
+	?InternalizeL@CCsConversationEntry@@UAEXAAVRReadStream@@@Z @ 16 NONAME ; void CCsConversationEntry::InternalizeL(class RReadStream &)
+	?__LatencyMarkEnd@CCsDebugWrapper@@SAXV?$TRefByValue@$$CBVTDesC16@@@@@Z @ 17 NONAME ; void CCsDebugWrapper::__LatencyMarkEnd(class TRefByValue<class TDesC16 const >)
+	?SetSendState@CCsConversationEntry@@QAEXABE@Z @ 18 NONAME ; void CCsConversationEntry::SetSendState(unsigned char const &)
+	?SetConversationEntryId@CCsClientConversation@@QAEXH@Z @ 19 NONAME ; void CCsClientConversation::SetConversationEntryId(int)
+	?IsEmpty@CCsDebugArr@@QAEHXZ @ 20 NONAME ; int CCsDebugArr::IsEmpty(void)
+	?GetContactId@CCsClientConversation@@QBEJXZ @ 21 NONAME ; long CCsClientConversation::GetContactId(void) const
 	?Contact@CCsConversationEntry@@QBEPAVHBufC16@@XZ @ 22 NONAME ; class HBufC16 * CCsConversationEntry::Contact(void) const
 	?GetConversationEntry@CCsClientConversation@@QBEPAVCCsConversationEntry@@XZ @ 23 NONAME ; class CCsConversationEntry * CCsClientConversation::GetConversationEntry(void) const
 	?__LatencyMarkStartL@CCsDebugWrapper@@SAXV?$TRefByValue@$$CBVTDesC16@@@@@Z @ 24 NONAME ; void CCsDebugWrapper::__LatencyMarkStartL(class TRefByValue<class TDesC16 const >)
 	?CompareById@CCsConversationEntry@@SAHABV1@0@Z @ 25 NONAME ; int CCsConversationEntry::CompareById(class CCsConversationEntry const &, class CCsConversationEntry const &)
-	?GetNickName@CCsClientConversation@@QBEPAVHBufC16@@XZ @ 26 NONAME ; class HBufC16 * CCsClientConversation::GetNickName(void) const
-	?GetSendState@CCsConversationEntry@@QBEEXZ @ 27 NONAME ; unsigned char CCsConversationEntry::GetSendState(void) const
-	?SetType@CCsConversationEntry@@QAEXABE@Z @ 28 NONAME ; void CCsConversationEntry::SetType(unsigned char const &)
-	?Push@CCsDebugArr@@QAEXAAVCCsDebug@@@Z @ 29 NONAME ; void CCsDebugArr::Push(class CCsDebug &)
-	??1CCsClientConversation@@UAE@XZ @ 30 NONAME ; CCsClientConversation::~CCsClientConversation(void)
-	?CompareByUnreadAttrib@CCsConversationEntry@@SAHABV1@0@Z @ 31 NONAME ; int CCsConversationEntry::CompareByUnreadAttrib(class CCsConversationEntry const &, class CCsConversationEntry const &)
-	?SetTimeStampL@CCsConversationEntry@@QAEX_J@Z @ 32 NONAME ; void CCsConversationEntry::SetTimeStampL(long long)
-	?SetLastNameL@CCsClientConversation@@QAEXPBVHBufC16@@@Z @ 33 NONAME ; void CCsClientConversation::SetLastNameL(class HBufC16 const *)
-	?SetFirstNameL@CCsClientConversation@@QAEXPBVHBufC16@@@Z @ 34 NONAME ; void CCsClientConversation::SetFirstNameL(class HBufC16 const *)
-	?Pop@CCsDebugArr@@QAEPAVCCsDebug@@XZ @ 35 NONAME ; class CCsDebug * CCsDebugArr::Pop(void)
-	?SetContactL@CCsConversationEntry@@QAEXABVTDesC16@@@Z @ 36 NONAME ; void CCsConversationEntry::SetContactL(class TDesC16 const &)
-	?SetConversationDir@CCsConversationEntry@@QAEXE@Z @ 37 NONAME ; void CCsConversationEntry::SetConversationDir(unsigned char)
-	?SetEntryId@CCsConversationEntry@@QAEXH@Z @ 38 NONAME ; void CCsConversationEntry::SetEntryId(int)
-	?SetDescriptionL@CCsConversationEntry@@QAEXABVTDesC16@@@Z @ 39 NONAME ; void CCsConversationEntry::SetDescriptionL(class TDesC16 const &)
-	?InternalizeL@CCsClientConversation@@UAEXAAVRReadStream@@@Z @ 40 NONAME ; void CCsClientConversation::InternalizeL(class RReadStream &)
-	?SetContactId@CCsClientConversation@@QAEXJ@Z @ 41 NONAME ; void CCsClientConversation::SetContactId(long)
-	?ConversationDir@CCsConversationEntry@@QBEEXZ @ 42 NONAME ; unsigned char CCsConversationEntry::ConversationDir(void) const
-	?GetLastName@CCsClientConversation@@QBEPAVHBufC16@@XZ @ 43 NONAME ; class HBufC16 * CCsClientConversation::GetLastName(void) const
-	?ExternalizeL@CCsConversationEntry@@UBEXAAVRWriteStream@@@Z @ 44 NONAME ; void CCsConversationEntry::ExternalizeL(class RWriteStream &) const
-	?GetUnreadMessageCount@CCsClientConversation@@QBEGXZ @ 45 NONAME ; unsigned short CCsClientConversation::GetUnreadMessageCount(void) const
-	?IsAttributeSet@CCsConversationEntry@@QBEHG@Z @ 46 NONAME ; int CCsConversationEntry::IsAttributeSet(unsigned short) const
-	?NewL@CCsConversationEntry@@SAPAV1@XZ @ 47 NONAME ; class CCsConversationEntry * CCsConversationEntry::NewL(void)
-	?TimeStamp@CCsConversationEntry@@QBE_JXZ @ 48 NONAME ; long long CCsConversationEntry::TimeStamp(void) const
-	?CloneL@CCsConversationEntry@@QBEPAV1@XZ @ 49 NONAME ; class CCsConversationEntry * CCsConversationEntry::CloneL(void) const
-	?NewL@CCsDebugArr@@SAPAV1@XZ @ 50 NONAME ; class CCsDebugArr * CCsDebugArr::NewL(void)
-	?CompareByTimeStamp@CCsClientConversation@@SAHABV1@0@Z @ 51 NONAME ; int CCsClientConversation::CompareByTimeStamp(class CCsClientConversation const &, class CCsClientConversation const &)
-	?UnMark@CCsDebug@@QAAXV?$TRefByValue@$$CBVTDesC16@@@@ZZ @ 52 NONAME ; void CCsDebug::UnMark(class TRefByValue<class TDesC16 const >, ...)
-	?ExternalizeL@CCsClientConversation@@UBEXAAVRWriteStream@@@Z @ 53 NONAME ; void CCsClientConversation::ExternalizeL(class RWriteStream &) const
-	?GetFirstName@CCsClientConversation@@QBEPAVHBufC16@@XZ @ 54 NONAME ; class HBufC16 * CCsClientConversation::GetFirstName(void) const
+	?GetSendState@CCsConversationEntry@@QBEEXZ @ 26 NONAME ; unsigned char CCsConversationEntry::GetSendState(void) const
+	?SetType@CCsConversationEntry@@QAEXABE@Z @ 27 NONAME ; void CCsConversationEntry::SetType(unsigned char const &)
+	?Push@CCsDebugArr@@QAEXAAVCCsDebug@@@Z @ 28 NONAME ; void CCsDebugArr::Push(class CCsDebug &)
+	??1CCsClientConversation@@UAE@XZ @ 29 NONAME ; CCsClientConversation::~CCsClientConversation(void)
+	?CompareByUnreadAttrib@CCsConversationEntry@@SAHABV1@0@Z @ 30 NONAME ; int CCsConversationEntry::CompareByUnreadAttrib(class CCsConversationEntry const &, class CCsConversationEntry const &)
+	?SetTimeStampL@CCsConversationEntry@@QAEX_J@Z @ 31 NONAME ; void CCsConversationEntry::SetTimeStampL(long long)
+	?Pop@CCsDebugArr@@QAEPAVCCsDebug@@XZ @ 32 NONAME ; class CCsDebug * CCsDebugArr::Pop(void)
+	?SetContactL@CCsConversationEntry@@QAEXABVTDesC16@@@Z @ 33 NONAME ; void CCsConversationEntry::SetContactL(class TDesC16 const &)
+	?SetConversationDir@CCsConversationEntry@@QAEXE@Z @ 34 NONAME ; void CCsConversationEntry::SetConversationDir(unsigned char)
+	?SetEntryId@CCsConversationEntry@@QAEXH@Z @ 35 NONAME ; void CCsConversationEntry::SetEntryId(int)
+	?SetDescriptionL@CCsConversationEntry@@QAEXABVTDesC16@@@Z @ 36 NONAME ; void CCsConversationEntry::SetDescriptionL(class TDesC16 const &)
+	?InternalizeL@CCsClientConversation@@UAEXAAVRReadStream@@@Z @ 37 NONAME ; void CCsClientConversation::InternalizeL(class RReadStream &)
+	?SetContactId@CCsClientConversation@@QAEXJ@Z @ 38 NONAME ; void CCsClientConversation::SetContactId(long)
+	?ConversationDir@CCsConversationEntry@@QBEEXZ @ 39 NONAME ; unsigned char CCsConversationEntry::ConversationDir(void) const
+	?ExternalizeL@CCsConversationEntry@@UBEXAAVRWriteStream@@@Z @ 40 NONAME ; void CCsConversationEntry::ExternalizeL(class RWriteStream &) const
+	?GetUnreadMessageCount@CCsClientConversation@@QBEGXZ @ 41 NONAME ; unsigned short CCsClientConversation::GetUnreadMessageCount(void) const
+	?IsAttributeSet@CCsConversationEntry@@QBEHG@Z @ 42 NONAME ; int CCsConversationEntry::IsAttributeSet(unsigned short) const
+	?NewL@CCsConversationEntry@@SAPAV1@XZ @ 43 NONAME ; class CCsConversationEntry * CCsConversationEntry::NewL(void)
+	?TimeStamp@CCsConversationEntry@@QBE_JXZ @ 44 NONAME ; long long CCsConversationEntry::TimeStamp(void) const
+	?SetDisplayNameL@CCsClientConversation@@QAEXPBVHBufC16@@@Z @ 45 NONAME ; void CCsClientConversation::SetDisplayNameL(class HBufC16 const *)
+	?CloneL@CCsConversationEntry@@QBEPAV1@XZ @ 46 NONAME ; class CCsConversationEntry * CCsConversationEntry::CloneL(void) const
+	?NewL@CCsDebugArr@@SAPAV1@XZ @ 47 NONAME ; class CCsDebugArr * CCsDebugArr::NewL(void)
+	?CompareByTimeStamp@CCsClientConversation@@SAHABV1@0@Z @ 48 NONAME ; int CCsClientConversation::CompareByTimeStamp(class CCsClientConversation const &, class CCsClientConversation const &)
+	?UnMark@CCsDebug@@QAAXV?$TRefByValue@$$CBVTDesC16@@@@ZZ @ 49 NONAME ; void CCsDebug::UnMark(class TRefByValue<class TDesC16 const >, ...)
+	?ExternalizeL@CCsClientConversation@@UBEXAAVRWriteStream@@@Z @ 50 NONAME ; void CCsClientConversation::ExternalizeL(class RWriteStream &) const
 
--- a/messagingapp/msgappfw/utils/eabi/csutilsu.def	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/utils/eabi/csutilsu.def	Mon May 03 12:29:07 2010 +0300
@@ -23,42 +23,38 @@
 	_ZN20CCsConversationEntryD2Ev @ 22 NONAME
 	_ZN21CCsClientConversation12InternalizeLER11RReadStream @ 23 NONAME
 	_ZN21CCsClientConversation12SetContactIdEl @ 24 NONAME
-	_ZN21CCsClientConversation12SetLastNameLEPK7HBufC16 @ 25 NONAME
-	_ZN21CCsClientConversation12SetNickNameLEPK7HBufC16 @ 26 NONAME
-	_ZN21CCsClientConversation13SetFirstNameLEPK7HBufC16 @ 27 NONAME
-	_ZN21CCsClientConversation18CompareByTimeStampERKS_S1_ @ 28 NONAME
-	_ZN21CCsClientConversation21SetConversationEntryLEPK20CCsConversationEntry @ 29 NONAME
-	_ZN21CCsClientConversation21SetUnreadMessageCountEt @ 30 NONAME
-	_ZN21CCsClientConversation22SetConversationEntryIdEi @ 31 NONAME
-	_ZN21CCsClientConversation28CompareByConversationEntryIdERKS_S1_ @ 32 NONAME
-	_ZN21CCsClientConversation4NewLEv @ 33 NONAME
-	_ZN21CCsClientConversationD0Ev @ 34 NONAME
-	_ZN21CCsClientConversationD1Ev @ 35 NONAME
-	_ZN21CCsClientConversationD2Ev @ 36 NONAME
-	_ZN8CCsDebug4NewLEv @ 37 NONAME
-	_ZNK20CCsConversationEntry11DescriptionEv @ 38 NONAME
-	_ZNK20CCsConversationEntry12ExternalizeLER12RWriteStream @ 39 NONAME
-	_ZNK20CCsConversationEntry12GetSendStateEv @ 40 NONAME
-	_ZNK20CCsConversationEntry14IsAttributeSetEt @ 41 NONAME
-	_ZNK20CCsConversationEntry15ConversationDirEv @ 42 NONAME
-	_ZNK20CCsConversationEntry6CloneLEv @ 43 NONAME
-	_ZNK20CCsConversationEntry7ContactEv @ 44 NONAME
-	_ZNK20CCsConversationEntry7EntryIdEv @ 45 NONAME
-	_ZNK20CCsConversationEntry7GetTypeEv @ 46 NONAME
-	_ZNK20CCsConversationEntry9TimeStampEv @ 47 NONAME
-	_ZNK21CCsClientConversation11GetLastNameEv @ 48 NONAME
-	_ZNK21CCsClientConversation11GetNickNameEv @ 49 NONAME
-	_ZNK21CCsClientConversation12ExternalizeLER12RWriteStream @ 50 NONAME
-	_ZNK21CCsClientConversation12GetContactIdEv @ 51 NONAME
-	_ZNK21CCsClientConversation12GetFirstNameEv @ 52 NONAME
-	_ZNK21CCsClientConversation20GetConversationEntryEv @ 53 NONAME
-	_ZNK21CCsClientConversation21GetUnreadMessageCountEv @ 54 NONAME
-	_ZNK21CCsClientConversation22GetConversationEntryIdEv @ 55 NONAME
-	_ZNK21CCsClientConversation6CloneLEv @ 56 NONAME
-	_ZTI11CCsDebugArr @ 57 NONAME
-	_ZTI20CCsConversationEntry @ 58 NONAME
-	_ZTI21CCsClientConversation @ 59 NONAME
-	_ZTV11CCsDebugArr @ 60 NONAME
-	_ZTV20CCsConversationEntry @ 61 NONAME
-	_ZTV21CCsClientConversation @ 62 NONAME
+	_ZN21CCsClientConversation15SetDisplayNameLEPK7HBufC16 @ 25 NONAME
+	_ZN21CCsClientConversation18CompareByTimeStampERKS_S1_ @ 26 NONAME
+	_ZN21CCsClientConversation21SetConversationEntryLEPK20CCsConversationEntry @ 27 NONAME
+	_ZN21CCsClientConversation21SetUnreadMessageCountEt @ 28 NONAME
+	_ZN21CCsClientConversation22SetConversationEntryIdEi @ 29 NONAME
+	_ZN21CCsClientConversation28CompareByConversationEntryIdERKS_S1_ @ 30 NONAME
+	_ZN21CCsClientConversation4NewLEv @ 31 NONAME
+	_ZN21CCsClientConversationD0Ev @ 32 NONAME
+	_ZN21CCsClientConversationD1Ev @ 33 NONAME
+	_ZN21CCsClientConversationD2Ev @ 34 NONAME
+	_ZN8CCsDebug4NewLEv @ 35 NONAME
+	_ZNK20CCsConversationEntry11DescriptionEv @ 36 NONAME
+	_ZNK20CCsConversationEntry12ExternalizeLER12RWriteStream @ 37 NONAME
+	_ZNK20CCsConversationEntry12GetSendStateEv @ 38 NONAME
+	_ZNK20CCsConversationEntry14IsAttributeSetEt @ 39 NONAME
+	_ZNK20CCsConversationEntry15ConversationDirEv @ 40 NONAME
+	_ZNK20CCsConversationEntry6CloneLEv @ 41 NONAME
+	_ZNK20CCsConversationEntry7ContactEv @ 42 NONAME
+	_ZNK20CCsConversationEntry7EntryIdEv @ 43 NONAME
+	_ZNK20CCsConversationEntry7GetTypeEv @ 44 NONAME
+	_ZNK20CCsConversationEntry9TimeStampEv @ 45 NONAME
+	_ZNK21CCsClientConversation12ExternalizeLER12RWriteStream @ 46 NONAME
+	_ZNK21CCsClientConversation12GetContactIdEv @ 47 NONAME
+	_ZNK21CCsClientConversation14GetDisplayNameEv @ 48 NONAME
+	_ZNK21CCsClientConversation20GetConversationEntryEv @ 49 NONAME
+	_ZNK21CCsClientConversation21GetUnreadMessageCountEv @ 50 NONAME
+	_ZNK21CCsClientConversation22GetConversationEntryIdEv @ 51 NONAME
+	_ZNK21CCsClientConversation6CloneLEv @ 52 NONAME
+	_ZTI11CCsDebugArr @ 53 NONAME
+	_ZTI20CCsConversationEntry @ 54 NONAME
+	_ZTI21CCsClientConversation @ 55 NONAME
+	_ZTV11CCsDebugArr @ 56 NONAME
+	_ZTV20CCsConversationEntry @ 57 NONAME
+	_ZTV21CCsClientConversation @ 58 NONAME
 
--- a/messagingapp/msgappfw/utils/group/ABLD.BAT	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-@ECHO OFF
-
-REM Bldmake-generated batch file - ABLD.BAT
-REM ** DO NOT EDIT **
-
-perl -S ABLD.PL "\sf\app\messaging\messagingapp\msgappfw\utils\group\\" %1 %2 %3 %4 %5 %6 %7 %8 %9
-if errorlevel==1 goto CheckPerl
-goto End
-
-:CheckPerl
-perl -v >NUL
-if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed?
-goto End
-
-:End
--- a/messagingapp/msgappfw/utils/src/ccsclientconversation.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/utils/src/ccsclientconversation.cpp	Mon May 03 12:29:07 2010 +0300
@@ -41,8 +41,7 @@
 void CCsClientConversation::ConstructL()
     {
     iConversationEntryID = 0;
-    iFirstName = NULL;
-    iLastName = NULL;
+    iDisplayName = NULL;
     iContactId = KErrNotFound;
     iConversationEntry = NULL;
     iUnreadMessagesCount = 0;
@@ -67,21 +66,10 @@
 // ----------------------------------------------------------------------------
 EXPORT_C CCsClientConversation::~CCsClientConversation()
     {
-    if (iNickName)
-        {
-        delete iNickName;
-        iNickName = NULL;
-        }
-    
-    if (iLastName)
+    if (iDisplayName)
         {
-        delete iLastName;
-        iLastName = NULL;
-        }
-    if (iFirstName)
-        {
-        delete iFirstName;
-        iFirstName = NULL;
+        delete iDisplayName;
+        iDisplayName = NULL;
         }
     if (iConversationEntry)
         {
@@ -111,68 +99,25 @@
     }
 
 // ----------------------------------------------------------------------------
-// CCsClientConversation::GetFirstName
-// this shall return the conversation first name of the object
-// ----------------------------------------------------------------------------
-EXPORT_C HBufC* CCsClientConversation::GetFirstName() const
-    {
-    return iFirstName;
-    }
-
-// ----------------------------------------------------------------------------
-// CCsClientConversation::SetFirstNameL
-// this function shall set conversation first name in the object
+// CCsClientConversation::GetDisplayName
+// this shall return the conversation name of the object
 // ----------------------------------------------------------------------------
-EXPORT_C void
-CCsClientConversation::SetFirstNameL(const HBufC* aFirstName)
+EXPORT_C HBufC* CCsClientConversation::GetDisplayName() const
     {
-    if (aFirstName)
-        {
-        iFirstName = aFirstName->AllocL();
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CCsClientConversation::GetLastName
-// this shall return the conversation Last name of the object
-// ----------------------------------------------------------------------------
-EXPORT_C HBufC* CCsClientConversation::GetLastName() const
-    {
-    return iLastName;
+    return iDisplayName;
     }
 
 // ----------------------------------------------------------------------------
-// CCsClientConversation::SetLastNameL
-// this function shall set conversation Last name in the object
+// CCsClientConversation::SetDisplayNameL
+// this function shall set conversation name in the object
 // ----------------------------------------------------------------------------
 EXPORT_C void
-CCsClientConversation::SetLastNameL(const HBufC* aLastName)
-    {
-    if (aLastName)
-        {
-        iLastName = aLastName->AllocL();
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// CCsClientConversation::GetNickName
-// this shall return the conversation nick name of the object
-// ----------------------------------------------------------------------------
-EXPORT_C HBufC* CCsClientConversation::GetNickName() const
+CCsClientConversation::SetDisplayNameL(
+                           const HBufC* aDisplayName)
     {
-    return iNickName;
-    }
-
-// ----------------------------------------------------------------------------
-// CCsClientConversation::SetNickNameL
-// this function shall set conversation nick name in the object
-// ----------------------------------------------------------------------------
-EXPORT_C void
-CCsClientConversation::SetNickNameL(const HBufC* aNickName)
-    {
-    if (aNickName)
+    if (aDisplayName)
         {
-        iNickName = aNickName->AllocL();
+        iDisplayName = aDisplayName->AllocL();
         }
     }
 
@@ -232,8 +177,7 @@
     CleanupStack::PushL(cloneObject);
 
     cloneObject->SetConversationEntryId(iConversationEntryID);
-    cloneObject->SetFirstNameL(iFirstName);
-    cloneObject->SetLastNameL(iLastName);
+    cloneObject->SetDisplayNameL(iDisplayName);
     cloneObject->SetContactId(iContactId);
     cloneObject->SetConversationEntryL(iConversationEntry);
     cloneObject->SetUnreadMessageCount(iUnreadMessagesCount);
@@ -253,33 +197,11 @@
     aStream.WriteInt32L(iConversationEntryID);
     aStream.WriteUint16L(iUnreadMessagesCount);
 
-    if (iFirstName)
-        {
-        // now write the display name
-        aStream.WriteInt8L(iFirstName->Length());
-        aStream << *iFirstName;
-        }
-    else
-        {
-        aStream.WriteInt8L(0);
-        }
-    
-    if (iLastName)
+    if (iDisplayName)
         {
         // now write the display name
-        aStream.WriteInt8L(iLastName->Length());
-        aStream << *iLastName;
-        }
-    else
-        {
-        aStream.WriteInt8L(0);
-        }
-    
-    if (iNickName)
-        {
-        // now write the display name
-        aStream.WriteInt8L(iNickName->Length());
-        aStream << *iNickName;
+        aStream.WriteInt8L(iDisplayName->Length());
+        aStream << *iDisplayName;
         }
     else
         {
@@ -308,25 +230,12 @@
     iConversationEntryID = aStream.ReadInt32L();
     iUnreadMessagesCount = aStream.ReadUint16L();
     // read first name
-    TInt lenFirstname = aStream.ReadInt8L();
-    if (lenFirstname > 0)
-        {
-        iFirstName = HBufC::NewL(aStream, lenFirstname);
-        }
-    // read last name
-    TInt lenLastname = aStream.ReadInt8L();
-    if (lenLastname > 0)
+    TInt lenName = aStream.ReadInt8L();
+    if (lenName > 0)
         {
-        iLastName = HBufC::NewL(aStream, lenLastname);
+        iDisplayName = HBufC::NewL(aStream, lenName);
         }
-    
-    //read nick name
-    TInt lenNickname = aStream.ReadInt8L();
-    if (lenNickname > 0)
-        {
-        iNickName = HBufC::NewL(aStream, lenNickname);
-        }
-    
+        
     // read contact link
     iContactId = aStream.ReadInt32L();    
         
--- a/messagingapp/msgappfw/utils/src/ccsdebug.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgappfw/utils/src/ccsdebug.cpp	Mon May 03 12:29:07 2010 +0300
@@ -81,7 +81,7 @@
 		delete dbg;			  	
     }
     
-    if ( dbgArr->IsEmpty() )
+    if ( !dbgArr && dbgArr->IsEmpty() )
     {
         delete dbgArr;
         Dll::SetTls( NULL );
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/inc/msginfodefs.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,156 @@
+/*
+ * 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: Interface between msgindicatorplugin and msgnotifier.
+ *
+ */
+
+
+#ifndef MSGINFODEFS_H
+#define MSGINFODEFS_H
+
+#include <QMetaType>
+#include <QString>
+#include <QStringList>
+#include <QByteArray>
+#include <QDataStream>
+
+
+/**
+ * Indicator types
+ */
+enum IndicatorTypes
+{
+    Unknown = 0, 
+    NewIndicatorPlugin = 1, 
+    FailedIndicatorPlugin = 2, 
+    PendingIndicatorPlugin = 3
+};
+
+
+/**
+ * return the indicator name
+ * @return QString the name of the indicator
+ */
+inline QString indicatorName(IndicatorTypes type)
+{
+    switch(type){
+   	case NewIndicatorPlugin:
+          return QString("com.nokia.messaging.newindicatorplugin");
+    case FailedIndicatorPlugin:
+    	    return QString("com.nokia.messaging.failedindicatorplugin");
+    case PendingIndicatorPlugin:
+          return QString("com.nokia.messaging.pendingindicatorplugin");
+    default:
+    	    return QString();
+    }
+}
+
+/**
+ * Interface class used by indications between msgnotifier 
+ * and msgindications.
+ * @class MsgInfo
+ * 
+ */
+class MsgInfo
+{
+public:
+    MsgInfo() {
+       mMsgCount = 0; 
+       mIndicatorType = Unknown; 
+       mConversationId = -1;
+       mFromSingle = false;
+       mDescription = QString();  
+       mMessageType = 0;
+    }
+    virtual ~MsgInfo(){}
+    
+    /**
+     * the count of messages
+     */
+    int mMsgCount;
+    
+    /**
+     * The type of indicator
+     */
+    IndicatorTypes mIndicatorType;
+    
+    /**
+     * The indicator type in int.
+     */
+    int mIndicatorTypeInt;
+    
+    /**
+     * The conversation id.
+     */
+    int mConversationId;
+    
+    /**
+     * The message type
+     */
+    int mMessageType;
+    
+    /**
+     * Indication of number of senders/recipients
+     * True if one, false if many
+     */
+    bool mFromSingle;
+    
+    /**
+     * List of Names of the contacts, or phone numbers 
+     */
+    QStringList mDisplayName;
+    
+    /**
+     * Any body text if present
+     */
+    QString mDescription;
+    // TODO: check if the serialize/deserialize is okay
+    /**
+     * serialize
+     * @param stream QDataStream serialize into this data stream.
+     */
+    inline void serialize(QDataStream& stream) const
+       {
+        stream << mMsgCount;
+        stream << mIndicatorType;
+        stream << mDisplayName;
+        stream << mConversationId;
+        stream << mFromSingle;
+        stream << mDisplayName;
+        stream << mDescription;
+       }
+
+    /**
+     * deserialize
+     * @param stream QDataStream deserialize from this data stream.
+     */
+    inline void deserialize(QDataStream& stream)
+       {
+        int indicatorType;
+        stream >> mMsgCount;
+        stream >> indicatorType;
+        stream >> mDisplayName;
+        stream >> mConversationId;
+        stream >> mFromSingle;
+        stream >> mDisplayName;
+        stream >> mDescription;
+        
+        mIndicatorType = static_cast<IndicatorTypes>(indicatorType);
+       }
+};
+
+
+Q_DECLARE_METATYPE(MsgInfo)
+
+#endif 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrornotifier/inc/msgerrornotifier.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: 
+ *
+ */
+
+#ifndef MSGERRORNOTIFIER_H
+#define MSGERRORNOTIFIER_H
+
+#include <QObject>
+class MsgErrorNotifierSvc;
+
+class MsgErrorNotifier: public QObject
+{
+Q_OBJECT
+
+public:
+    /**
+     * Constructor
+     */
+    MsgErrorNotifier(QObject *parent = 0);
+
+    /**
+     * Destructor
+     */
+    ~MsgErrorNotifier();
+
+private:
+    /**
+     * Own. The notifier service that pops up a window for
+     * failed message.
+     */
+    MsgErrorNotifierSvc* mErrorNotifier;
+};
+
+#endif // MSGERRORNOTIFIER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrornotifier/inc/msgerrornotifiersvc.h	Mon May 03 12:29:07 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 MSGERRORNOTIFIERSVC_H_
+#define MSGERRORNOTIFIERSVC_H_
+
+#include <QObject>
+#include <xqserviceprovider.h>
+#include <qvariant.h>
+
+class MsgErrorNotifierSvc: public XQServiceProvider
+{
+
+Q_OBJECT
+
+public:
+    /**
+     * constructor
+     */
+    MsgErrorNotifierSvc(QObject* parent = 0);
+
+    /**
+     * destructor
+     */
+    virtual ~MsgErrorNotifierSvc();
+
+public slots:
+
+    /**
+     * The service slot for displaying the error note.
+     * @param displayParams QVariantList with contact name
+     * and conversation id.
+     */
+    void displayErrorNote(QVariantList displayParams);
+
+};
+
+#endif /* MSGERRORNOTIFIERSVC_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrornotifier/msgerrornotifier.pro	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,39 @@
+# 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: Message Error Notifier Exe Pro File
+
+TEMPLATE = app
+TARGET = msgerrornotifier
+CONFIG += hb service
+
+INCLUDEPATH += . inc ../inc
+INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+HEADERS += inc/msgerrornotifier.h \
+		   inc/msgerrornotifiersvc.h
+		   
+SOURCES += src/main.cpp \
+    	   src/msgerrornotifier.cpp \
+           src/msgerrornotifiersvc.cpp
+           
+LIBS += -lxqservice \
+	    -lxqserviceutil
+
+SERVICE.FILE = service_conf.xml
+SERVICE.OPTIONS = embeddable
+SERVICE.OPTIONS += hidden
+
+symbian:TARGET.UID3 = 0x2001FE74
+
+
+BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
+                             ".\rom\msgerrornotifier.iby CORE_APP_LAYER_IBY_EXPORT_PATH(msgerrornotifier.iby)"
+                             
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrornotifier/rom/msgerrornotifier.iby	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,24 @@
+/*
+ * 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 __MSG_ERRORNOTIFIER_IBY__
+#define __MSG_ERRORNOTIFIER_IBY__
+
+file=ABI_DIR\UREL\msgerrornotifier.exe          SHARED_LIB_DIR\msgerrornotifier.exe
+data=DATAZ_\resource\apps\msgerrornotifier.rsc  resource\apps\msgerrornotifier.rsc
+data=DATAZ_\private\10003a3f\import\apps\msgerrornotifier_reg.rsc   private\10003a3f\import\apps\msgerrornotifier_reg.rsc
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrornotifier/service_conf.xml	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<service>
+  <name>messaging</name>
+  <filepath>No path</filepath>
+  <description>Messaging Error Notifier Service</description>
+  <interface>
+     <name>com.nokia.symbian.MsgErrorNotifier</name>
+     <version>1.0</version>
+     <description>Interface which will display the needed error note.</description>
+   </interface>
+</service>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrornotifier/src/main.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,27 @@
+/*
+ * 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 "msgerrornotifier.h"
+
+#include <hbapplication.h>
+
+int main(int argc, char *argv[])
+{
+    HbApplication a(argc, argv);
+    MsgErrorNotifier w;
+    return a.exec();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrornotifier/src/msgerrornotifier.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,38 @@
+/*
+ * 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 "msgerrornotifier.h"
+#include "msgerrornotifiersvc.h"
+
+//-------------------------------------------------------
+// Constructor
+//-------------------------------------------------------
+MsgErrorNotifier::MsgErrorNotifier(QObject *parent) :
+    QObject(parent)
+{
+    mErrorNotifier = new MsgErrorNotifierSvc();
+}
+
+//-------------------------------------------------------
+// Destructor
+//-------------------------------------------------------
+MsgErrorNotifier::~MsgErrorNotifier()
+{
+    if (mErrorNotifier) {
+        delete mErrorNotifier;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgerrornotifier/src/msgerrornotifiersvc.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,109 @@
+/*
+ * 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 "msgerrornotifiersvc.h"
+#include <QVariant>
+#include <HbMessageBox>
+#include <HbDialog>
+#include <hbdevicemessagebox.h>
+#include <HbAction>
+#include <xqservicerequest.h>
+#include <xqaiwrequest.h>
+#include <xqappmgr.h>
+#include <ccsdefs.h>
+
+#define LOC_VIEW hbTrId("txt_messaging_button_view")
+#define LOC_CANCEL hbTrId("txt_common_button_cancel")
+#define LOC_SEND_FAILURE hbTrId("txt_messaging_list_message_sending_failed")
+
+//---------------------------------------------------------
+// Constructor
+//---------------------------------------------------------
+MsgErrorNotifierSvc::MsgErrorNotifierSvc(QObject* parent) :
+    XQServiceProvider(QLatin1String("messaging.com.nokia.symbian.MsgErrorNotifier"), parent)
+{
+    publishAll();
+
+}
+//---------------------------------------------------------
+// Destructor
+//---------------------------------------------------------
+MsgErrorNotifierSvc::~MsgErrorNotifierSvc()
+{
+
+}
+
+//---------------------------------------------------------
+// displayErrorNote
+// @see msgerrornotifiersvc.h
+//---------------------------------------------------------
+void MsgErrorNotifierSvc::displayErrorNote(QVariantList displayParams)
+{
+
+    HbDeviceMessageBox messageBox(HbMessageBox::MessageTypeWarning);
+    QVariant first = displayParams[0];
+    QVariant second = displayParams[1];
+    QVariant third = displayParams[2];
+
+    int convId = second.toInt();
+    qint64 id = convId;
+    QString errorNote;
+    
+    int msgType = third.toInt();
+    if (msgType == ECsMmsNotification)
+    {
+        errorNote.append("Message Retrieval Failed!");//TODO: use logical str name
+    }
+    else
+    {
+        errorNote.append(LOC_SEND_FAILURE);
+        errorNote.append(QChar(QChar::LineSeparator));
+
+        QString contactName = first.toString();
+        errorNote.append(contactName);        
+    }
+    
+    messageBox.setTimeout(HbPopup::NoTimeout);
+    messageBox.setText(errorNote);
+    HbAction* actionView = new HbAction(LOC_VIEW);
+    messageBox.setPrimaryAction(actionView);
+
+    HbAction* actionQuit = new HbAction(LOC_CANCEL);
+    actionQuit->setCommandRole(HbAction::QuitRole);
+    messageBox.setSecondaryAction(actionQuit);
+
+    setCurrentRequestAsync();
+
+    HbAction* result = messageBox.exec();
+
+    // TODO: use XQAiwrequest
+    if (result->commandRole() != HbAction::QuitRole) {
+        QList<QVariant> args;
+        QString serviceName("com.nokia.services.hbserviceprovider");
+        QString operation("open(qint64)");
+        XQAiwRequest* request;
+        XQApplicationManager appManager;
+        request = appManager.create(serviceName, "conversationview", operation, false); // embedded
+        if (request == NULL) {
+            return;
+        }
+        args << QVariant(id);
+        request->setArguments(args);
+        request->send();
+        delete request;
+    }
+}
--- a/messagingapp/msgnotifications/msgindicatorplugin/inc/msgindicator.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgnotifications/msgindicatorplugin/inc/msgindicator.h	Mon May 03 12:29:07 2010 +0300
@@ -19,65 +19,33 @@
 #define MSGINDICATOR_H
 
 #include <QObject>
-
+#include <QRunnable>
 #include <hbindicatorinterface.h>
 
+#include "msginfodefs.h"
 class MsgIndicatorPrivate;
 
-/**
- * Utility class used pass indication data 
- * from private to Qt- class.
- */
-class IndicatorData
-    {
+class ServiceRequestSenderTask : public QRunnable
+{
 public:
     /**
      * Constructor
      */
-    IndicatorData():mFromSingle(false),
-    mConversationId(-1),
-    mUnreadMsgCount(0){};
-    
-    /**
-     * Message from single contact or many
-     */
-    bool mFromSingle; 
-    
-    /**
-     * Conversation id
-     */
-    int mConversationId; 
-    
-    /**
-     * Unread message count
-     */
-    int mUnreadMsgCount;
+    ServiceRequestSenderTask(qint64 conversationId);
     
     /**
-     * First name
-     */
-    QString mFirstName; 
-    
-    /**
-     * Last name
-     */
-    QString mLastName; 
-    
-    /**
-     * Nick name
+     * Destructor
      */
-    QString mNickName; 
-    
+    ~ServiceRequestSenderTask();
+     
     /**
-     * Phone number
+     * create and send service request
      */
-    QString mContactNum; 
-    
-    /**
-     * Description
-     */
-    QString mDescription;
-    };
+     void run();
+
+private: 
+     qint64 mConvId;
+};
 
 /**
  * Message indicator class. 
@@ -105,6 +73,7 @@
      * @see HbIndicatorInterface
      */
     QVariant indicatorData(int role) const;
+
     
 protected:
     /**
@@ -117,8 +86,28 @@
      * Prepares the display name from stream.
      * @param IindicatorData inidcator data.
      */
-    QString prepareDisplayName(IndicatorData& indicatorData) const;
+    QString prepareDisplayName(MsgInfo& indicatorData) const;
     
+    /**
+     * Gets the primary text for an indicator type
+     * @param data MsgInfo the message information.
+     * @return QString the primary text
+     */
+    QString getPrimaryText(MsgInfo& data);
+
+    /**
+     * Gets the primary text for unread messages
+     * @param data MsgInfo the message information.
+     */
+    QString getUnreadPrimaryText(MsgInfo& data);
+    
+    /**
+     * Get the secondary Text for messages.
+     * @param type The type of the indicator
+     * @return QString the secondary text
+     */
+    QString getSecondaryText(MsgInfo& info);
+
 private:
     
     /**
@@ -132,6 +121,11 @@
     mutable qint64 mConversationId;
     
     /**
+     * Message type
+     */
+    mutable int mMessageType;
+
+    /**
      * Message from single or multiple contact
      */
     mutable bool mConversationFromSingleContact;
@@ -141,6 +135,27 @@
      * Owned.
      */
     MsgIndicatorPrivate* d_ptr;
+   
+    /**
+     * Primary Text
+     * 
+     */
+    QString mPrimaryText;
+    
+    /**
+     * Secondary Text
+     */
+    QString mSecondaryText;
+    
+    /**
+     * Number of messages
+     */    
+    int mCount;
+    
+    /**
+     * Indicator type
+     */
+    int mIndicatorType;
 };
 
 #endif // MSGINDICATOR_H
--- a/messagingapp/msgnotifications/msgindicatorplugin/inc/msgindicator_p.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgnotifications/msgindicatorplugin/inc/msgindicator_p.h	Mon May 03 12:29:07 2010 +0300
@@ -18,7 +18,7 @@
 
 #ifndef MSGINDICATOR_PRIVATE_H
 #define MSGINDICATOR_PRIVATE_H
-
+#include "msginfodefs.h"
 class MsgIndicator;
 class CCSRequestHandler;
 class IndicatorData;
@@ -44,14 +44,14 @@
     * Get the information required to show the inidctaions
     * @pamam indicatorData indicator data which will be filled
     */
-    void getIndicatorInfo(IndicatorData& indicatorData);
+    void getIndicatorInfo(MsgInfo& indicatorData);
 
     /**
      * Get the information required to show the inidctaions. 
      * Calls conversation sever to fetch the information.
-     * @pamam indicatorData indicator data which will be filled.
+     * @param indicatorData indicator data which will be filled.
      */
-    void getIndicatorInfoL(IndicatorData& indicatorData);
+    void getIndicatorInfoL(MsgInfo& indicatorData);
     
 private : 
     /**
--- a/messagingapp/msgnotifications/msgindicatorplugin/inc/msgindicatorplugin.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgnotifications/msgindicatorplugin/inc/msgindicatorplugin.h	Mon May 03 12:29:07 2010 +0300
@@ -29,10 +29,10 @@
  * Message indicator plugin class. 
  * Main class of message indicator plugin. 
  */
-class MsgIndicatorPlugin : public QObject, public HbIndicatorPluginInterface
+class MsgIndicatorPlugin: public QObject, public HbIndicatorPluginInterface
 {
-    Q_OBJECT
-    Q_INTERFACES(HbIndicatorPluginInterface)
+Q_OBJECT
+Q_INTERFACES(HbIndicatorPluginInterface)
 
 public:
     /**
@@ -59,12 +59,19 @@
      * @see HbIndicatorPluginInterface
      */
     HbIndicatorInterface* createIndicator(const QString &indicatorType);
-    
+
     /**
      * @see HbIndicatorPluginInterface
      */
     int error() const;
-    
+
+    /**
+     * Returns the indices of plugin types.
+     * @param indicatorType QString the type of indicator
+     * @return int the indicator type as an index.
+     */
+    int typeIndex(const QString &indicatorType) const;
+
 private:
     Q_DISABLE_COPY(MsgIndicatorPlugin)
     
@@ -81,4 +88,3 @@
 };
 
 #endif // MSGINDICATORPLUGIN_H
-
--- a/messagingapp/msgnotifications/msgindicatorplugin/msgindicatorplugin.pro	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgnotifications/msgindicatorplugin/msgindicatorplugin.pro	Mon May 03 12:29:07 2010 +0300
@@ -20,6 +20,7 @@
 CONFIG += hb
 
 INCLUDEPATH += .
+INCLUDEPATH += ../inc
 DEPENDPATH += .
 INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
 INCLUDEPATH += ../../../inc
@@ -28,7 +29,7 @@
 
 HEADERS += inc/msgindicatorplugin.h \
 		   inc/msgindicator.h \
-		   inc/msgindicator_p.h
+		   inc/msgindicator_p.h 
 		   
 SOURCES += src/msgindicatorplugin.cpp \
 		   src/msgindicator.cpp \
--- a/messagingapp/msgnotifications/msgindicatorplugin/src/msgindicator.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgnotifications/msgindicatorplugin/src/msgindicator.cpp	Mon May 03 12:29:07 2010 +0300
@@ -14,83 +14,139 @@
  * Description:
  *
  */
+
 #include "msgindicator.h" 
 #include "msgindicator_p.h"   
+#include "msginfodefs.h"
+#include "debugtraces.h"
 
 #include <QThreadPool>
 #include <QRunnable>
 #include <QByteArray>
 #include <QProcess>
-#include "debugtraces.h"
+#include <QFileInfo>
+#include <qvariant.h>
+#include <xqaiwrequest.h>
+#include <xqappmgr.h>
+#include <ccsdefs.h>
 
-#include <xqservicerequest.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")
 
-//----------------------------------------------------------------------
-class ServiceRequestSenderTask : public QRunnable
- {
-public:
-     ServiceRequestSenderTask(qint64 conversationId):mConvId(conversationId)  {}
-     
-     void run()
-     {
-     XQServiceRequest snd(
-            "com.nokia.services.hbserviceprovider.conversationview",
-                "open(qint64)",false);
-		  snd << mConvId;
-		  bool res=snd.send();    
-     }
-     
-     ~ServiceRequestSenderTask()
+/**
+ * The number of indicators.
+ */
+static const int MsgIndicatorCount = 4;
+
+/**
+ * The attibutes of an indicator.
+ */
+struct MsgIndicatorInfo
+{
+    QString icon;
+    QString primaryText;
+    QString secondaryText;
+};
+
+/**
+ * Array of Indicator information elements
+ */
+
+//TODO: Localize
+
+
+// TODO: get regular icons, thes are placeholders.hanlde later
+static const MsgIndicatorInfo IndicatorInfo[MsgIndicatorCount] = { 
+    { "", "", "" }, 
+    { "qtg_large_new_message", "newindicatorplugin", "%1 unread messages" }, 
+    { "qtg_small_fail", "failedindicatorplugin", "%1 Failed message%2" }, 
+    { "qtg_small_outbox","pendingindicatorplugin", "%1 Outgoing message%2" }
+};
+
+// ----------------------------------------------------------------------------
+// ServiceRequestSenderTask::ServiceRequestSenderTask
+// @see msgindicator.h
+// ----------------------------------------------------------------------------   
+ServiceRequestSenderTask::ServiceRequestSenderTask(qint64 conversationId):
+mConvId(conversationId)
      {     
      }
-     
- private: 
- 	qint64 mConvId;    
- };
- 
-//----------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
+// ServiceRequestSenderTask::~ServiceRequestSenderTask
+// @see msgindicator.h
+// ----------------------------------------------------------------------------   
+ServiceRequestSenderTask::~ServiceRequestSenderTask()
+     {     
+     }
 
+// ----------------------------------------------------------------------------
+// ServiceRequestSenderTask::run
+// @see msgindicator.h
+// ----------------------------------------------------------------------------   
+void ServiceRequestSenderTask::run()
+     {
+     QList<QVariant> args;
+     QString serviceName("com.nokia.services.hbserviceprovider");
+     QString operation("open(qint64)");
+     XQAiwRequest* request;
+     XQApplicationManager appManager;
+     request = appManager.create(serviceName, "conversationview", operation, false); // embedded
+     if ( request == NULL )
+         {
+         return;       
+         }
+     args << QVariant(mConvId);
+     request->setArguments(args);
+     request->send();
+     delete request;
+     }
 
 // ----------------------------------------------------------------------------
 // MsgIndicator::MsgIndicator
 // @see msgindicator.h
 // ----------------------------------------------------------------------------
 MsgIndicator::MsgIndicator(const QString &indicatorType) :
-HbIndicatorInterface(indicatorType,
-        HbIndicatorInterface::GroupPriorityHigh,
-        InteractionActivated)
-    {
+    HbIndicatorInterface(indicatorType, HbIndicatorInterface::GroupPriorityHigh,
+        InteractionActivated),
+		mIndicatorType(NULL)
+{
     d_ptr = new MsgIndicatorPrivate(this);
-    }
+}
 
 // ----------------------------------------------------------------------------
 // MsgIndicator::~MsgIndicator
 // @see msgindicator.h
 // ----------------------------------------------------------------------------
 MsgIndicator::~MsgIndicator()
-    {
+{
     delete d_ptr;
-    }
+}
 
 // ----------------------------------------------------------------------------
 // MsgIndicator::handleInteraction
 // @see msgindicator.h
 // ----------------------------------------------------------------------------
 bool MsgIndicator::handleInteraction(InteractionType type)
+  {
+  bool handled = false;
+  if (type == InteractionActivated)
     {
-    bool handled = false;
-    if (type == InteractionActivated) 
-        {
-        QThreadPool::globalInstance()->start(
-        	new ServiceRequestSenderTask(mConversationId)); 
-        handled = true;   
-        }
+    QThreadPool::globalInstance()->start(new ServiceRequestSenderTask(
+        mConversationId));
+    handled = true;
+    }
     return handled;
-    }
+}
 
 // ----------------------------------------------------------------------------
 // MsgIndicator::indicatorData
@@ -98,49 +154,22 @@
 // ----------------------------------------------------------------------------
 QVariant MsgIndicator::indicatorData(int role) const
 {
-switch(role)
+    switch (role) {
+    case PrimaryTextRole:
+    {
+        return mPrimaryText;
+    }
+    case SecondaryTextRole:
     {
-    case TextRole: 
-        {
-        mConversationId = -100;
-        
-        IndicatorData data;
-        d_ptr->getIndicatorInfo(data);
-             
-        mConversationFromSingleContact = data.mFromSingle;
-        mBodyText = data.mDescription;
-        
-        if (mConversationFromSingleContact)
-            {
-            mConversationId = (int)data.mConversationId;
-            QString name = prepareDisplayName(data);
-            name.append(QString(" (%1)").arg(data.mUnreadMsgCount));
-            return name;
-            }
-        else 
-            {
-            QString text = QString("%1 new messages").arg(data.mUnreadMsgCount);
-            return text;
-            }   
-        }
-    case SecondaryTextRole:
-        {
-        if (mConversationFromSingleContact)
-            {
-            return mBodyText;
-            }
-        else 
-            {
-            return QString();
-            }   
-        }
-    case IconNameRole:
-        {
-        QString iconName("z:/resource/messaging/message.svg");
-        return iconName;
-        }
-    default: 
-        return QVariant();      
+        return mSecondaryText;
+    }
+    case DecorationNameRole:
+    {
+        return IndicatorInfo[mIndicatorType].icon;
+
+    }
+    default:
+        return QVariant();
     }
 }
 
@@ -148,71 +177,156 @@
 // MsgIndicator::handleClientRequest
 // @see msgindicator.h
 // ----------------------------------------------------------------------------
-bool MsgIndicator::handleClientRequest( RequestType type, 
-        const QVariant &parameter)
-    {
-    Q_UNUSED(parameter);
+bool MsgIndicator::handleClientRequest(RequestType type, const QVariant &parameter)
+{
+
     bool handled(false);
     switch (type) {
-        case RequestActivate:
-            {
-            emit dataChanged();
-            handled =  true;
-            }
+    case RequestActivate:
+    {
+        QByteArray dataArray = parameter.toByteArray();
+        QDataStream messageStream(&dataArray, QIODevice::ReadOnly);
+        MsgInfo info;
+        info.deserialize(messageStream);
 
-            break;
-        case RequestDeactivate:
-            {
-            // reset data 
-            mConversationId = -100;
-            mBodyText =  QString();
-            emit deactivate();
-            }
-            break;
-        default:
-            break;
+        mCount = info.mMsgCount;
+        mIndicatorType = info.mIndicatorType;
+        mPrimaryText = getPrimaryText(info);
+        mSecondaryText = getSecondaryText(info);
+        mConversationId = info.mConversationId;
+        emit
+        dataChanged();
+        handled = true;
+    }
+        break;
+
+    case RequestDeactivate:
+    {
+        // reset data 
+        mConversationId = -100;
+        mBodyText = QString();
+        emit deactivate();
+    }
+        break;
+    default:
+        break;
     }
 
     return handled;
-    }
+}
 
 // ----------------------------------------------------------------------------
 // MsgIndicator::prepareDisplayName
 // @see msgindicator.h
 // ----------------------------------------------------------------------------
-QString MsgIndicator::prepareDisplayName(IndicatorData& indicatorData) const
-
-    {
+QString MsgIndicator::prepareDisplayName(MsgInfo& indicatorData) const
+{
     //Set the Contact Name/Number
-    QString firstName(indicatorData.mFirstName);
-    QString lastName(indicatorData.mLastName);
-    QString contactAddress(indicatorData.mContactNum);
-    QString nickName(indicatorData.mNickName);
 
     QString displayName;
 
-    if (!nickName.isEmpty())
-        {
-        displayName.append(nickName);
+    if (ECsBlueTooth == indicatorData.mMessageType) {
+        displayName = LOC_RECEIVED_FILES;
+    }
+    else {
+        indicatorData.mDisplayName.removeDuplicates();
+        indicatorData.mDisplayName.sort();
+        displayName = indicatorData.mDisplayName.at(0);
+
+        for (int i = 1; i < indicatorData.mDisplayName.count(); ++i) {
+            displayName += QString(", ") + indicatorData.mDisplayName.at(i);
         }
-    else if ( firstName.isEmpty() && lastName.isEmpty())
-        {
-        displayName.append(contactAddress);
-        }
-    else if (lastName.isEmpty() && !firstName.isEmpty())
-        {
-        displayName.append(firstName);
+    }
+    return displayName;
+}
+
+// ----------------------------------------------------------------------------
+// MsgIndicator::getPrimaryText
+// @see msgindicator.h
+// ----------------------------------------------------------------------------
+QString MsgIndicator::getPrimaryText(MsgInfo& data)
+{
+    if (data.mIndicatorType == NewIndicatorPlugin) {
+        return getUnreadPrimaryText(data);
+    }
+    else {
+        QString primaryText;
+        if (mCount >= 1) {
+            if (data.mIndicatorType == FailedIndicatorPlugin) {
+                primaryText += QString("%1 ").arg(mCount);
+                primaryText += (mCount > 1)? 
+                    LOC_FAILED_MULTIPLE_MESSAGES : LOC_FAILED_SINGLE_MESSAGE;
+            }
+            else {
+                primaryText += QString("%1 ").arg(mCount);
+                primaryText += (mCount > 1)? 
+                    LOC_OUTGOING_MULTIPLE_MESSAGES : LOC_OUTGOING_SINGLE_MESSAGE;
+            }
         }
-    else if (firstName.isEmpty() && !lastName.isEmpty())
-        {
-        displayName.append(lastName);
+        return primaryText;
+    }
+}
+
+// ----------------------------------------------------------------------------
+// MsgIndicator::getUnreadPrimaryText
+// @see msgindicator.h
+// ----------------------------------------------------------------------------
+QString MsgIndicator::getUnreadPrimaryText(MsgInfo& data)
+{
+    mConversationId = -100;
+    
+    d_ptr->getIndicatorInfo(data);
+
+    mConversationFromSingleContact = data.mFromSingle;
+    mBodyText = data.mDescription;
+
+    if (mConversationFromSingleContact) {
+        mConversationId = (int) data.mConversationId;
+        QString name = data.mDisplayName.at(0);
+        name.append(QString(" (%1)").arg(data.mMsgCount));
+        return name;
+    }
+    else {
+        QString text = QString("%1 ").arg(mCount) + LOC_UNREAD_MULTIPLE_MESSAGES;
+        return text;
+    }
+
+}
+
+// ----------------------------------------------------------------------------
+// MsgIndicator::getSecondaryText
+// @see msgindicator.h
+// ----------------------------------------------------------------------------
+QString MsgIndicator::getSecondaryText(MsgInfo& info)
+{
+    QString secondaryText("");
+
+    if (info.mIndicatorType == NewIndicatorPlugin) {
+        secondaryText = info.mDescription;
+
+        if (info.mFromSingle) {
+            if (ECsBlueTooth == info.mMessageType) {
+                QFileInfo fname(secondaryText);
+                secondaryText = fname.fileName();
+            }
         }
-    else
-        {
-        // If both first Name and last name are present
-        displayName.append(firstName);
-        displayName.append(" ");
-        displayName.append(lastName);
+        else {
+            info.mConversationId = -100;
         }
-    return displayName;
     }
+    else {
+        info.mDisplayName.removeDuplicates();
+        info.mDisplayName.sort();
+        int count = info.mDisplayName.count();
+        if (count > 1) {
+            info.mConversationId = -100;
+        }
+
+        secondaryText.append(info.mDisplayName.at(0));
+        for (int i = 1; i < info.mDisplayName.count(); ++i) {
+            secondaryText.append(", ");
+            secondaryText.append(info.mDisplayName.at(i));
+        }
+    }
+    return secondaryText;
+}
--- a/messagingapp/msgnotifications/msgindicatorplugin/src/msgindicator_p.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgnotifications/msgindicatorplugin/src/msgindicator_p.cpp	Mon May 03 12:29:07 2010 +0300
@@ -24,113 +24,125 @@
 #include "debugtraces.h"
 #include "s60qconversions.h"
 
+#define LOC_RECEIVED_FILES hbTrId("Received Files")
+
 // ----------------------------------------------------------------------------
 // MsgIndicatorPrivate::MsgIndicatorPrivate
 // @see MsgIndicatorPrivate.h
 // ----------------------------------------------------------------------------
-MsgIndicatorPrivate::MsgIndicatorPrivate(MsgIndicator* inidcator):
-	q_ptr(inidcator),mCvServer(NULL)
-    {
+MsgIndicatorPrivate::MsgIndicatorPrivate(MsgIndicator* inidcator) :
+    q_ptr(inidcator), mCvServer(NULL)
+{
     TRAP_IGNORE(initL());
-    }
+}
 
 // ----------------------------------------------------------------------------
 // MsgIndicatorPrivate::~MsgIndicatorPrivate
 // @see MsgIndicatorPrivate.h
 // ----------------------------------------------------------------------------
 MsgIndicatorPrivate::~MsgIndicatorPrivate()
-    {
-    if(mCvServer)
-        {
+{
+    if (mCvServer) {
         delete mCvServer;
         mCvServer = NULL;
-        }
     }
+}
 
 // ----------------------------------------------------------------------------
 // MsgIndicatorPrivate::initL()
 // @see MsgIndicatorPrivate.h
 // ----------------------------------------------------------------------------
 void MsgIndicatorPrivate::initL()
-    {
+{
     mCvServer = CCSRequestHandler::NewL();
-    }
+}
 
 // ----------------------------------------------------------------------------
 // MsgIndicatorPrivate::getIndicatorInfo
 // @see MsgIndicatorPrivate.h
 // ----------------------------------------------------------------------------
-void MsgIndicatorPrivate::getIndicatorInfo(IndicatorData& indicatorData)
-    {
+void MsgIndicatorPrivate::getIndicatorInfo(MsgInfo& indicatorData)
+{
     TRAP_IGNORE(getIndicatorInfoL(indicatorData));
-    }
-    
+}
+
 // ----------------------------------------------------------------------------
 // MsgIndicatorPrivate::getIndicatorInfoL
 // @see MsgIndicatorPrivate.h
 // ----------------------------------------------------------------------------
-void MsgIndicatorPrivate::getIndicatorInfoL(IndicatorData& indicatorData)
-    { 
-    RPointerArray<CCsClientConversation> *clientConversationList = 
-                                    new RPointerArray<CCsClientConversation> ();
-    CleanupStack::PushL(clientConversationList);   
+void MsgIndicatorPrivate::getIndicatorInfoL(MsgInfo& indicatorData)
+{
+    RPointerArray<CCsClientConversation> *clientConversationList = new RPointerArray<
+        CCsClientConversation> ();
+    CleanupStack::PushL(clientConversationList);
     mCvServer->GetConversationUnreadListL(clientConversationList);
     CleanupStack::Pop();
-    
+
+    QStringList nameList;    
     int count = clientConversationList->Count();
-    int msgCount = 0;
-    if(count== 1)
-        {    
-        indicatorData.mFromSingle = true;
+    
+    indicatorData.mMsgCount = 0;
+    
+    for (int loop = 0; loop < count; ++loop) {
         
         CCsClientConversation* conversation =
-        static_cast<CCsClientConversation*> ((*clientConversationList)[0]);
+            static_cast<CCsClientConversation*> ((*clientConversationList)[loop]);
         
         CCsConversationEntry* convEntry = conversation->GetConversationEntry();
-        
-        indicatorData.mUnreadMsgCount = conversation->GetUnreadMessageCount();
-        indicatorData.mConversationId = conversation->GetConversationEntryId();
-        
-        HBufC* firstName =conversation->GetFirstName();
-        HBufC* lastName = conversation->GetLastName();    
-        HBufC* number =  convEntry->Contact();
-        HBufC* decription = convEntry->Description();
+
+        indicatorData.mMsgCount += conversation->GetUnreadMessageCount();
+        indicatorData.mConversationId = static_cast<int>(conversation->GetConversationEntryId());
         
-        if(firstName)
-            {
-            indicatorData.mFirstName = S60QConversions::s60DescToQString(*firstName);
-            }
-        if(lastName)
-            {
-            indicatorData.mLastName = S60QConversions::s60DescToQString(*lastName);
-            }
-        if(number)
-            {
-            indicatorData.mContactNum  =  S60QConversions::s60DescToQString(*number);
+        HBufC* description = convEntry->Description();
+        if (description && (count == 1)) {
+            // Only take the description from convEntry when there is one entry.
+            // description will contain the name list when there are more entries.
+            QString descText;
+            descText = S60QConversions::s60DescToQString(*description);
+            descText.replace(QChar::ParagraphSeparator, QChar::LineSeparator);
+            descText.replace('\r', QChar::LineSeparator);
+            indicatorData.mDescription = descText;
+        }
+
+        if((indicatorData.mMessageType = static_cast<int>(convEntry->GetType()))==ECsBlueTooth){
+            // if we have bluetooth messages, nameList should contain the LOC_RECEVED_FILES
+            // string. DisplayName/number are not needed.
+            nameList.append(LOC_RECEIVED_FILES);
+            indicatorData.mMessageType = ECsBlueTooth ;
+            continue;
+        }
+        else { // non-bluetooth
+            HBufC* displayName = conversation->GetDisplayName();
+            HBufC* number = convEntry->Contact();
+
+            if (displayName) {
+                nameList.append(S60QConversions::s60DescToQString(*displayName));
             }
-        if(decription)
-            {
-            indicatorData.mDescription  = S60QConversions::s60DescToQString(*decription);
+            else if (number) {
+                nameList.append(S60QConversions::s60DescToQString(*number));
             }
+        }
+    }
+
+    nameList.removeDuplicates();
+    nameList.sort();
+    
+    if (nameList.count() > 1) {
+        // more than 1 sender. Concatenate the names in the description 
         
-        }
-    else
-        {
         indicatorData.mFromSingle = false;
-        for (int loop = 0; loop < count; ++loop)
-            {
-            CCsClientConversation* conversation =
-            static_cast<CCsClientConversation*> ((*clientConversationList)[loop]);
-            msgCount += conversation->GetUnreadMessageCount();
-            }
-        indicatorData.mUnreadMsgCount = msgCount;
-        }
-    
-    // Clean & destroy clientConversationList
-       clientConversationList->ResetAndDestroy();
-       delete clientConversationList;
+        indicatorData.mDescription = nameList.join(QString(", "));
+        indicatorData.mMessageType = ECsSMS;
+    }
+    else{
+        // only 1 sender.
+        // displayname will have the name of the sender.
+        // description will contain latest message if more than 1 message
+        indicatorData.mFromSingle = true;    
+        indicatorData.mDisplayName.append(nameList.at(0));
     }
     
-
+    clientConversationList->ResetAndDestroy();
+    delete clientConversationList;
+}
 
-
--- a/messagingapp/msgnotifications/msgindicatorplugin/src/msgindicatorplugin.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgnotifications/msgindicatorplugin/src/msgindicatorplugin.cpp	Mon May 03 12:29:07 2010 +0300
@@ -18,6 +18,8 @@
 #include "msgindicatorplugin.h"
 
 #include "msgindicator.h"
+#include "msginfodefs.h"
+
 #include <QtPlugin>
 #include <QVariant>
 
@@ -27,9 +29,13 @@
 // MsgIndicatorPlugin::MsgIndicatorPlugin
 // @see msgindicatorplugin.h
 // ----------------------------------------------------------------------------
-MsgIndicatorPlugin::MsgIndicatorPlugin() : mError(0)
+MsgIndicatorPlugin::MsgIndicatorPlugin() :
+    mError(0)
 {
-   
+    mIndicatorTypes.append(QString("com.nokia.messaging.newindicatorplugin"));
+    mIndicatorTypes.append(QString("com.nokia.messaging.failedindicatorplugin"));
+    mIndicatorTypes.append(QString("com.nokia.messaging.pendingindicatorplugin"));
+
 }
 
 // ----------------------------------------------------------------------------
@@ -47,9 +53,7 @@
 // ----------------------------------------------------------------------------
 QStringList MsgIndicatorPlugin::indicatorTypes() const
 {
-  QStringList types; 
-  types << "com.nokia.messaging.indicatorplugin/1.0";
-  return types;
+    return mIndicatorTypes;
 }
 
 // ----------------------------------------------------------------------------
@@ -72,10 +76,13 @@
 // MsgIndicatorPlugin::createIndicator
 // @see msgindicatorplugin.h
 // ----------------------------------------------------------------------------
-HbIndicatorInterface* MsgIndicatorPlugin::createIndicator(
-        const QString &indicatorType)
+HbIndicatorInterface* MsgIndicatorPlugin::createIndicator(const QString &indicatorType)
 {
-    HbIndicatorInterface *indicator = new MsgIndicator(indicatorType);
+    HbIndicatorInterface *indicator = NULL;
+    int index(typeIndex(indicatorType));
+    if (index >= 0) {
+        indicator = new MsgIndicator(indicatorType);
+    }
 
     return indicator;
 }
@@ -89,6 +96,16 @@
     return mError;
 }
 
-
-
-
+// ----------------------------------------------------------------------------
+// MsgIndicatorPlugin::typeIndex
+// @see msgindicatorplugin.h
+// ----------------------------------------------------------------------------
+int MsgIndicatorPlugin::typeIndex(const QString &indicatorType) const
+{
+    for (int i = 0; i < mIndicatorTypes.count(); ++i) {
+        if (mIndicatorTypes.at(i) == indicatorType) {
+            return i;
+        }
+    }
+    return -1;
+}
--- a/messagingapp/msgnotifications/msgnotificationdialogplugin/inc/msgnotificationdialogwidget.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgnotifications/msgnotificationdialogplugin/inc/msgnotificationdialogwidget.h	Mon May 03 12:29:07 2010 +0300
@@ -20,12 +20,37 @@
 
 #include <QObject>
 #include <QVariantMap>
-
-
+#include <QRunnable>
 #include <hbdevicedialoginterface.h>
 #include <hbdevicedialog.h>
 #include <hbnotificationdialog.h>
 
+
+/**
+ * Class for sending service request
+ */
+class ServiceRequestSenderTask : public QRunnable
+{
+public:
+    /**
+     * Constructor
+     */
+    ServiceRequestSenderTask(qint64 conversationId);
+    
+    /**
+     * Destructor
+     */
+    ~ServiceRequestSenderTask();
+     
+    /**
+     * create and send service request
+     */
+     void run();
+
+private: 
+     qint64 mConvId;
+};
+
 /**
  * Message notification widget class. 
  * Widget shown for the new message notifications. 
--- a/messagingapp/msgnotifications/msgnotificationdialogplugin/src/msgnotificationdialogplugin.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgnotifications/msgnotificationdialogplugin/src/msgnotificationdialogplugin.cpp	Mon May 03 12:29:07 2010 +0300
@@ -26,7 +26,7 @@
 static const struct {
     const char *mTypeString;
 } dialogInfos[] = {
-    {"com.nokia.messaging.newmsgnotificationdialog/1.0"}
+    {"com.nokia.messaging.newmsgnotificationdialog"}
 };
 
 // Constants
--- a/messagingapp/msgnotifications/msgnotificationdialogplugin/src/msgnotificationdialogwidget.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgnotifications/msgnotificationdialogplugin/src/msgnotificationdialogwidget.cpp	Mon May 03 12:29:07 2010 +0300
@@ -25,6 +25,9 @@
 #include <hbicon.h>
 #include <hbpopup.h>
 #include <xqservicerequest.h>
+#include <xqaiwrequest.h>
+#include <xqappmgr.h>
+
 #include "convergedmessage.h"
 
 #include "msgnotificationdialogpluginkeys.h"
@@ -33,33 +36,49 @@
 const int NoError = 0;
 const int ParameterError = 10000;
 
-
-//----------------------------------------------------------------
+const QString BT_ICON("qtg_large_bluetooth");
+const QString SMS_ICON("qtg_large_new_message");
+const QString MMS_ICON("qtg_large_new_message");
+const QString RINGTONE_ICON("qtg_large_tone");
+const QString VCARD_ICON("qtg_large_new_message");
+// ----------------------------------------------------------------------------
+// ServiceRequestSenderTask::ServiceRequestSenderTask
+// @see msgnotificationdialogwidget.h
+// ----------------------------------------------------------------------------   
+ServiceRequestSenderTask::ServiceRequestSenderTask(qint64 conversationId):
+mConvId(conversationId)
+     {     
+     }
 
-class ServiceRequestSenderTask : public QRunnable
- {
-public:
-     ServiceRequestSenderTask(qint64 conversationId):mConvId(conversationId)  {}
-     
-     void run()
-     {
-     XQServiceRequest snd(
-            "com.nokia.services.hbserviceprovider.conversationview",
-                "open(qint64)",false);
-		  snd << mConvId;
-		  bool res=snd.send();    
-     }
-     
-     ~ServiceRequestSenderTask()
+// ----------------------------------------------------------------------------
+// ServiceRequestSenderTask::~ServiceRequestSenderTask
+// @see msgnotificationdialogwidget.h
+// ----------------------------------------------------------------------------   
+ServiceRequestSenderTask::~ServiceRequestSenderTask()
      {     
      }
      
- private: 
- 	qint64 mConvId;    
- };
-
-// ------------------------------------------------------------------------
-
+// ----------------------------------------------------------------------------
+// ServiceRequestSenderTask::run
+// @see msgnotificationdialogwidget.h
+// ----------------------------------------------------------------------------   
+void ServiceRequestSenderTask::run()
+     {
+     QList<QVariant> args;
+     QString serviceName("com.nokia.services.hbserviceprovider");
+     QString operation("open(qint64)");
+     XQAiwRequest* request;
+     XQApplicationManager appManager;
+     request = appManager.create(serviceName, "conversationview", operation, false); // not embedded
+     if ( request == NULL )
+         {
+         return;       
+         }
+     args << QVariant(mConvId);
+     request->setArguments(args);
+     request->send();
+     delete request;
+     }
 
 
 // ----------------------------------------------------------------------------
@@ -110,26 +129,46 @@
     int messageType = parameters.value(KMessageTypeKey).toInt();
     if( messageType == ECsSMS)
         {
-        HbIcon icon(":/sms.svg");
+        HbIcon icon(SMS_ICON);
         setIcon(icon);
-        setText(parameters.value(KMessageBodyKey).toString());    
+        QString messageBody;
+        messageBody = parameters.value(KMessageBodyKey).toString();
+        messageBody.replace(QChar::ParagraphSeparator, QChar::LineSeparator);
+        messageBody.replace('\r', QChar::LineSeparator);
+        setText(messageBody);    
         }
     else if(messageType == ECsMMS)
         {
-        HbIcon icon(":/mms.svg");
+        HbIcon icon(MMS_ICON);
+        setIcon(icon);
+        setText(parameters.value(KMessageSubjectKey).toString());       
+        }
+    else if(messageType == ECsMmsNotification)
+        {
+        HbIcon icon(MMS_ICON);
         setIcon(icon);
         setText(parameters.value(KMessageSubjectKey).toString());       
         }
     else if(messageType == ECsRingingTone)
         {
-        HbIcon icon(":/ringingtone.svg");
+        HbIcon icon(RINGTONE_ICON);
         setIcon(icon);
         setText(parameters.value(KMessageBodyKey).toString());      
         }
+    else if(messageType == ECsBlueTooth)
+        {
+        HbIcon icon(BT_ICON); // show default for other message types
+        setIcon(icon);
+        setText(parameters.value(KMessageBodyKey).toString());    
+        }
+    else if(messageType == ECsBioMsg_VCard)
+        {
+        HbIcon icon(VCARD_ICON); // show default for other message types
+        setIcon(icon);
+        setText(parameters.value(KMessageBodyKey).toString());    
+        }
     else
         {
-        HbIcon icon(":/sms.svg"); // show default for other message types
-        setIcon(icon);
         setText(parameters.value(KMessageBodyKey).toString());    
         }
     
@@ -219,37 +258,15 @@
                                                 const QVariantMap &parameters)
 {
     //Set the Contact Name/Number
-    QString firstName = parameters.value(KFirstNameKey).toString();
-    QString lastName = parameters.value(KLastNameKey).toString();
+    QString displayName = parameters.value(KDisplayNameKey).toString();
     QString contactAddress = parameters.value(KContactAddressKey).toString();
-    QString nickName = parameters.value(KNickNameKey).toString();
     
-    QString displayName;
-    
-    if (!nickName.isEmpty())
+    if (displayName.isEmpty())
     {
-        displayName.append(nickName);
-    }
-    else if ( firstName.isEmpty() && lastName.isEmpty())
-    {
-        displayName.append(contactAddress);
-    }
-    else if (lastName.isEmpty() && !firstName.isEmpty())
-    {
-        displayName.append(firstName);
-    }
-    else if (firstName.isEmpty() && !lastName.isEmpty())
-    {
-        displayName.append(lastName);
+        setTitle(contactAddress);
     }
     else
     {
-        // If both first Name and last name are present
-        displayName.append(firstName);
-        displayName.append(" ");
-        displayName.append(lastName);
-    }
-    
-    // set the display name
-    setTitle(displayName);
+        setTitle(displayName);
+    }    
 }
--- a/messagingapp/msgnotifications/msgnotifications.pro	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgnotifications/msgnotifications.pro	Mon May 03 12:29:07 2010 +0300
@@ -19,4 +19,6 @@
 SYMBIAN_PLATFORMS = WINSCW ARMV5
 SUBDIRS += msgnotificationdialogplugin/msgnotificationdialogplugin.pro
 SUBDIRS += msgindicatorplugin/msgindicatorplugin.pro
-SUBDIRS += msgnotifier/msgnotifier.pro
\ No newline at end of file
+SUBDIRS += msgnotifier/msgnotifier.pro
+SUBDIRS += msgerrornotifier/msgerrornotifier.pro
+
--- a/messagingapp/msgnotifications/msgnotifier/inc/msgnotifier.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgnotifications/msgnotifier/inc/msgnotifier.h	Mon May 03 12:29:07 2010 +0300
@@ -23,6 +23,7 @@
 #include <QObject>
 #include <QString>
 #include <QQueue>
+#include "msginfodefs.h"
 
 // CLASS DECLARATION
 class MsgNotifierPrivate;
@@ -34,50 +35,51 @@
  * private class to qt - class.
  */
 class NotificationData
-    {
+{
 public:
     /**
      * constrcutor
      */
-    NotificationData():
-    mConversationId(-1),mMsgType(-1)
-        {};
+    NotificationData() :
+        mConversationId(-1), mMsgType(-1)
+    {
+    }
+    
     /**
      * Conversation id
      */
     int mConversationId;
-    
+
     /**
      * Message type
      */
     int mMsgType;
-    
+
     /**
      * Description
      */
     QString mDescription;
     
     /**
-     * First name
+     * Display name
      */
-    QString mFirstName;
-    
-    /**
-     * Last name
-     */
-    QString mLastName;
+    QString mDisplayName;
     
     /**
      * Contact Number
      */
     QString mContactNum;
  
+    /**
+     * MsvEntry Id
+     */
+   int msvEntryId;
     };
 
 
-class MsgNotifier : public QObject
-    {
-    Q_OBJECT
+class MsgNotifier: public QObject
+{
+Q_OBJECT
 
 public:
     /**
@@ -98,23 +100,39 @@
      */
     void displayNewMessageNotification(NotificationData& data);
 
-
     /**
-     * updateIndications
+     * updateUnreadIndications
      * Activate/Deactivate message indications based on unread message count.
      * if unreadCount is zero then deactivate else activate.
      * @param unreadCount unread count.
      */
-    void updateIndications(int unreadCount);
+    void updateUnreadIndications(int unreadCount);
+
+    /**
+     * updateOutboxIndications
+     * Activate/Deactivate message indications based on outbox 
+     * message count.
+     * @param indicatorData The indicator data for displaying the indication.
+     */
+    void updateOutboxIndications(MsgInfo& indicatorData);
 
 private:
+    
+    /**
+     * Get display-name of a contact from VCard.
+     * @param filePath, VCard file-path
+     * @return display-name
+     */
+    QString getVcardDisplayName(const QString& filePath);
+    
+private:
 
     /**
      * Object of private implementation.
      * Owned.
      */
-    MsgNotifierPrivate* d_ptr;  
-    
+    MsgNotifierPrivate* d_ptr;
+
     /**
      * Sim settings handler
      */
@@ -122,5 +140,4 @@
 };
 
 #endif // MSGNOTIFIER_H
-
 //EOF
--- a/messagingapp/msgnotifications/msgnotifier/inc/msgnotifier_p.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgnotifications/msgnotifier/inc/msgnotifier_p.h	Mon May 03 12:29:07 2010 +0300
@@ -24,6 +24,11 @@
 // CLASS DECLARATION
 class MsgNotifier;
 class CCSRequestHandler;
+class MsgStoreHandler;
+
+/**
+ * @class MsgNotifierPrivate
+ */
 
 class MsgNotifierPrivate : public MCsConversationListChangeObserver
     {
@@ -44,22 +49,27 @@
      * AddConversationList
      * This is for handling new conversation event
      * asynchronously from the server 
+     * @param aClientConversation CCsClientConversation The conversation object
      */
-    void AddConversationList(
-            const CCsClientConversation& aClientConversation);
+    void
+            AddConversationList(
+                    const CCsClientConversation& aClientConversation);
 
     /**  
      * DeleteConversationList
      * This is for handling delete conversation event
      * asynchronously from the server 
+     * @param aClientConversation CCsClientConversation The conversation object
      */
     void DeleteConversationList(
-            const CCsClientConversation& aClientConversation) ;
+            const CCsClientConversation& aClientConversation);
 
     /**  
      * ModifyConversationList
      * This is for handling modify conversation asynchronously
      * from the server 
+     * @param aClientConversation CCsClientConversation The conversation object
+     * 
      */
     void ModifyConversationList(
             const CCsClientConversation& aClientConversation);
@@ -70,6 +80,27 @@
      */
     void RefreshConversationList();
 
+public:
+
+    /**
+     * updateFailedIndications
+     * Activate/Deactivate message indications based on pending message count
+     */
+    void updateOutboxIndications();
+
+    /**
+     * displayOutboxIndications
+     * Display the outbox indications based on the data in MsgInfo
+     */
+    void displayOutboxIndications(MsgInfo data);
+
+    /**
+     * displayFailedNote
+     * Popup a message box when a message is not successfully sent.
+     * @param msgInfo MsgInfo The message information object
+     */
+    void displayFailedNote(MsgInfo msgInfo);
+
 private:
     /**
      * Does all the initializations. 
@@ -77,6 +108,11 @@
     void initL();
 
     /**
+     * Initializes the conversation store handler 
+     */
+    void initConvStoreHandler();
+
+    /**
      * Process conversation entry for showing the notification.
      * @param aClientConversation conversation entry
      */
@@ -85,23 +121,27 @@
     /**
      * updateIndications
      * Activate/Deactivate message indications based on unread message count
+     * @param bootup, true, if called on bootup else false
      */
-    void updateIndications();
+    void updateUnreadIndications(bool bootup = false);
 
 private:
 
     /**
      * Pointer to msgnotifier
      */
-    MsgNotifier* q_ptr;  
+    MsgNotifier* q_ptr;
 
     /**
      * Conversation server client 
      */
     CCSRequestHandler* mCvServer;
 
+    /**
+     * Pointer to Conversation Msg Store Handler.
+     */
+    MsgStoreHandler* iMsgStoreHandler;
     };
 
 #endif // MSGNOTIFIER_PRIVATE_H
-
 //EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgnotifier/inc/msgstorehandler.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  Wrapper classes which encapsulates Message store functions
+ *
+ */
+
+#ifndef MSG_STORE_HANDLER_H
+#define MSG_STORE_HANDLER_H
+
+// INCLUDE FILES
+#include <msvapi.h>
+#include <ccsdefs.h>
+#include <QString>
+
+//USER INCLUDES
+#include "msginfodefs.h"
+
+// FORWARD DECLARATIONS
+class CMsvSession;
+class MMsvSessionObserver;
+class OutboxIndicatorData;
+class MsgNotifierPrivate;
+class CCSRequestHandler;
+class CMsvEntrySelection;
+
+// CONSTANTS
+
+/**
+ * @class MsgStoreHandler
+ * handles the Messaging store for outbox events.
+ */
+class MsgStoreHandler: public MMsvSessionObserver, public MMsvEntryObserver
+{
+public:
+
+    /**
+     * Default constructor.
+     */
+    explicit MsgStoreHandler(MsgNotifierPrivate* notifier, CCSRequestHandler* aHandler);
+
+    /**
+     * Destructor
+     */
+    virtual ~MsgStoreHandler();
+    
+    /**
+     * Get the number of entries in the outbox that are in the failed or resend state.
+     * @param indicatorData, MsgInfo Return parameter.
+     */
+    TInt GetOutboxEntriesL(MsgInfo& aFailedIndicatorData, 
+                           MsgInfo& aPendingIndicatorData);
+
+    /*
+     * Get unread message count.
+     */
+    int GetUnreadMessageCountL();
+
+public:
+    /**
+     * From MMsvSessionObserver. HandleSessionEventL.
+     */
+    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
+
+    /**
+     * from MMsvEntryObserver, HandleEntryEventL
+     */
+    virtual void HandleEntryEventL(TMsvEntryEvent aEvent, TAny *aArg1, TAny *aArg2, TAny *aArg3);
+
+private:
+
+    /**
+     * UpdateOutboxIndications()
+     * @
+     */
+     void UpdateOutboxIndications();
+
+     /**
+      * Initializes the MsgStoreHandler class.     
+      */
+     void InitL();
+     
+    /**
+     * Process the indicator data to retrieve relevant details of the conversation
+     * @param msgId, message id.
+     * @param indicatorData data retrieved about the outbox entry
+     * 
+     */
+    void ProcessIndicatorDataL(TMsvId msgId, MsgInfo& indicatorData);
+    
+    /**
+     * Get MMS notification status.
+     * @param aMsvId MMS notification status.
+     */
+    TCsMmsNotificationMsgState MmsNotificationStatus(TMsvEntry entry);
+
+    /**
+     * verifys the current operation status
+     *@param aEntry, TMsvEntry
+     */
+    TBool OperationFinished(const TMsvEntry& aEntry) const;
+
+    /**
+     * verifys the current operation status
+     * @param aEntry, TMsvEntry
+     */
+    TBool OperationOngoing(const TMsvEntry& aEntry) const;
+
+private:
+    /**
+     * Own. Msv Session
+     */
+    CMsvSession* iMsvSession;
+
+    /**
+     * Own. Msv Entry
+     */
+    CMsvEntry* iMsvEntry;
+
+    /**
+     * Not Owned. Message notifier.
+     */
+    MsgNotifierPrivate* iNotifier;
+
+    /**
+     * Not Owned. Request handler
+     */
+    CCSRequestHandler* iRequestHandler;
+    
+    /**
+     * List of messages in Fialed states
+     */
+    CMsvEntrySelection* iFailedMessages;
+    
+    /**
+     * List of messages for which failed note shown
+     */
+    CMsvEntrySelection* iFailedNotes;
+};
+
+#endif // MSG_STORE_HANDLER_H
+// EOF
--- a/messagingapp/msgnotifications/msgnotifier/msgnotifier.pro	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgnotifications/msgnotifier/msgnotifier.pro	Mon May 03 12:29:07 2010 +0300
@@ -17,14 +17,15 @@
 TEMPLATE = app
 TARGET = msgnotifier
 
-DEPENDPATH += ../../../
+
 DEPENDPATH += . src
 HEADERS += $$PUBLIC_HEADERS
 INCLUDEPATH += . inc ../../../inc 
 INCLUDEPATH +=../../msgutils/s60qconversions/inc
-
 INCLUDEPATH += ../../msgsettings/msginit/inc
-
+INCLUDEPATH += ../inc
+INCLUDEPATH += $$APP_LAYER_INCLUDEPATH
+INCLUDEPATH += $$MW_LAYER_INCLUDEPATH
 symbian:
 {
 TARGET.CAPABILITY = ALL -TCB
@@ -37,20 +38,33 @@
     BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
     "rom/msgnotifier.iby  CORE_APP_LAYER_IBY_EXPORT_PATH(msgnotifier.iby)"
 }
+
 QT -= gui
-CONFIG += hb
-CONFIG += NO_ICON
+CONFIG += NO_ICON hb
 
 # Input
 SOURCES += 	src/main.cpp \
 			src/msgnotifier.cpp \
-			src/msgnotifier_p.cpp
+			src/msgnotifier_p.cpp \
+			src/msgstorehandler.cpp
 
 HEADERS +=  inc/msgnotifier.h  \
-  		    inc/msgnotifier_p.h 
-  
+  		    inc/msgnotifier_p.h \
+  		    inc/msgstorehandler.h 
 
 LIBS += -lcsserverclientapi \
         -ls60qconversions \
         -lcsutils \
-        -lmsginit
+        -lmsginit \
+        -lmsgs \
+        -letext \
+        -lsmcm \
+        -ls60qconversions \
+        -lmmsmessage \
+        -lmmsserversettings \
+        -lmmscli \
+        -lxqservice \
+        -lQtContacts \
+        -lQtVersit \
+        -lunidatamodelloader 
+        
--- a/messagingapp/msgnotifications/msgnotifier/src/main.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgnotifications/msgnotifier/src/main.cpp	Mon May 03 12:29:07 2010 +0300
@@ -26,67 +26,63 @@
 
 const QString debugFileName("c:/msgnotifier.txt");
 
-
 #ifdef _DEBUG_TRACES_
 void debugInit(QtMsgType type, const char *msg)
- {
- 
- QFile ofile(debugFileName);
-    if (!ofile.open(QIODevice::Append | QIODevice::Text))
-    {
+{
+
+    QFile ofile(debugFileName);
+    if (!ofile.open(QIODevice::Append | QIODevice::Text)) {
         qFatal("error opening results file");
         return;
     }
     QDateTime dt = QDateTime::currentDateTime();
 
     QTextStream out(&ofile);
-    switch (type)
-    {
-        case QtDebugMsg:
+    switch (type) {
+    case QtDebugMsg:
         out << "\n DEBUG:";
         out << msg;
         break;
-        case QtWarningMsg:
+    case QtWarningMsg:
         out << "\n WARN:";
         out << msg;
         break;
-        case QtCriticalMsg:
+    case QtCriticalMsg:
         out << "\n ";
         out << dt.toString("dd/MM/yyyy hh:mm:ss.zzz:ap");
         out << " CRITICAL:";
         out << msg;
         break;
-        case QtFatalMsg:
+    case QtFatalMsg:
         out << "\n FATAL:";
         out << msg;
         abort();
         break;
-        default:
+    default:
         out << " No Log Selection Type:";
         out << msg;
         break;
 
     }
- }
+}
 #endif
 
-int main(int argc,char *argv[])
+int main(int argc, char *argv[])
 {
-    QCoreApplication app(argc,argv);
-    
+    QCoreApplication app(argc, argv);
+
 #ifdef _DEBUG_TRACES_
-	//Debug Logs
-		QFile ofile;
+    //Debug Logs
+    QFile ofile;
     if (ofile.exists(debugFileName)) {
-    ofile.remove(debugFileName);
+        ofile.remove(debugFileName);
     }
-	qInstallMsgHandler(debugInit);
+    qInstallMsgHandler(debugInit);
 #endif
-
-    // create harvester 
-    QPointer<MsgNotifier> msgNotifier = new MsgNotifier();   
-    int r = app.exec();    
+	  // TODO: Get notifications at startup time.handled later
+    QPointer<MsgNotifier> msgNotifier = new MsgNotifier();
+    int r = app.exec();
     delete msgNotifier;
     return r;
- }
- 
+}
+
--- a/messagingapp/msgnotifications/msgnotifier/src/msgnotifier.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgnotifications/msgnotifier/src/msgnotifier.cpp	Mon May 03 12:29:07 2010 +0300
@@ -19,78 +19,114 @@
 // SYSTEM INCLUDES
 #include <hbdevicedialog.h>
 #include <hbindicator.h>
-
-
+#include <qfileinfo.h>
+#include <qversitcontactimporter.h>
+#include <qversitreader.h>
+#include <qtcontacts.h>
+QTM_USE_NAMESPACE
 //USER INCLUDES
 #include "msgnotifier.h"
 #include "msgnotifier_p.h"
 #include "msgsimnumberdetector.h"
 #include "msgnotificationdialogpluginkeys.h"
+#include "msginfodefs.h"
+#include "ccsdefs.h"
+#include "unidatamodelloader.h"
+#include "unidatamodelplugininterface.h"
 #include "debugtraces.h"
 
+// LOCALIZATION CONSTANTS
+#define LOC_RECEIVED_FILES           hbTrId("txt_messaging_title_received_files")
+#define LOC_BUSINESS_CARD           hbTrId("txt_messaging_dpopinfo_business_card")
+#define CARD_SEPERATOR "-"
+
 // plugin ids 
-const QString InidcationsPluginId
-                          ("com.nokia.messaging.indicatorplugin/1.0");
-const QString NotificationPluginId
-                          ("com.nokia.messaging.newmsgnotificationdialog/1.0");
+const QString IndicationsPluginId("com.nokia.messaging.newindicatorplugin");
+const QString PendingMsgPluginId("com.nokia.messaging.pendingindicatorplugin");
+const QString FailedMsgPluginId("com.nokia.messaging.failedindicatorplugin");
+const QString NotificationPluginId("com.nokia.messaging.newmsgnotificationdialog");
 
 // ----------------------------------------------------------------------------
 // MsgNotifier::MsgNotifier
 // @see MsgNotifier.h
 // ----------------------------------------------------------------------------
-MsgNotifier::MsgNotifier(QObject* parent):QObject(parent)
-    {
+MsgNotifier::MsgNotifier(QObject* parent) :
+    QObject(parent)
+{
     QDEBUG_WRITE("MsgNotifier::MsgNotifier : Enter")
-    
-     d_ptr = new MsgNotifierPrivate(this); 
-     
-     mSimHandler = new MsgSimNumDetector();
-     
-    QDEBUG_WRITE("MsgNotifier::MsgNotifier : Exit") 
-    }
+
+    d_ptr = new MsgNotifierPrivate(this);
+
+    mSimHandler = new MsgSimNumDetector();
+
+    QDEBUG_WRITE("MsgNotifier::MsgNotifier : Exit")
+}
 
 // ----------------------------------------------------------------------------
 // MsgNotifier::~MsgNotifier
 // @see MsgNotifier.h
 // ----------------------------------------------------------------------------
 MsgNotifier::~MsgNotifier()
-    {
+{
     QDEBUG_WRITE("MsgNotifier::~MsgNotifier : Enter")
-    
+
     delete d_ptr;
     delete mSimHandler;
-    
+
     QDEBUG_WRITE("MsgNotifier::~MsgNotifier : Enter")
-    }
-
-
+}
 
 // ----------------------------------------------------------------------------
 // MsgNotifier::displayNewMessageNotification
 // @see MsgNotifier.h
 // ----------------------------------------------------------------------------
 void MsgNotifier::displayNewMessageNotification(NotificationData& data)
-    {  
+{
     QDEBUG_WRITE("MsgNotifier::displayNewMessageNotification : Enter")
     QDEBUG_WRITE("MsgNotifier::displayNewMessageNotification :"
     																				" Printing notification data")
     
-    QDEBUG_WRITE_FORMAT("First Name : ", data.mFirstName);
-    QDEBUG_WRITE_FORMAT("Last Name : ", data.mLastName);
+    QDEBUG_WRITE_FORMAT("Name : ", data.mDisplayName);
     QDEBUG_WRITE_FORMAT("Number : ", data.mContactNum);
     QDEBUG_WRITE_FORMAT("Description : ", data.mDescription);
     QDEBUG_WRITE_FORMAT("Type : ", data.mMsgType);
     QDEBUG_WRITE_FORMAT("Conv Id : ", data.mConversationId);
-    
+    QDEBUG_WRITE_FORMAT("Msv Entry Id : ", data.msvEntryId);
     // Fill data to variant map
     QVariantMap notificationData;
-    notificationData[QString(KFirstNameKey)] = data.mFirstName ;
-    notificationData[QString(KLastNameKey)] = data.mLastName;
-    notificationData[QString(KNickNameKey)] = QString();
+    
+    //incase of BT messages show filename as description
+    QString description;
+    if ( ECsBlueTooth == data.mMsgType)
+        {
+        data.mDisplayName = LOC_RECEIVED_FILES;  
+        QFileInfo fileinfo(data.mDescription);
+        description = fileinfo.fileName();
+        }
+    else if ( ECsBioMsg_VCard == data.mMsgType)
+        {
+        UniDataModelLoader* pluginLoader = new UniDataModelLoader;
+        UniDataModelPluginInterface* bioMsgPlugin = pluginLoader->getDataModelPlugin(ConvergedMessage::BioMsg);
+        bioMsgPlugin->setMessageId(data.msvEntryId);
+        if (bioMsgPlugin->attachmentCount() > 0) 
+            {
+            UniMessageInfoList attList = bioMsgPlugin->attachmentList();
+            QString attachmentPath = attList[0]->path();
+            description = LOC_BUSINESS_CARD;
+            description.append(CARD_SEPERATOR);
+            description.append(getVcardDisplayName(attachmentPath));
+            } 
+        delete pluginLoader;
+        }
+    else
+        {
+        description =  data.mDescription;
+        }
+    notificationData[QString(KDisplayNameKey)] = data.mDisplayName ;
     notificationData[QString(KConversationIdKey)] = data.mConversationId;
     notificationData[QString(KMessageTypeKey)] = data.mMsgType;
-    notificationData[QString(KMessageBodyKey)] =  data.mDescription;
-    notificationData[QString(KMessageSubjectKey)] = QString();
+    notificationData[QString(KMessageBodyKey)] = description;
+    notificationData[QString(KMessageSubjectKey)] = description;
     notificationData[QString(KContactAddressKey)] = data.mContactNum;
 
     // call device dialog to show notification
@@ -105,24 +141,95 @@
 // MsgNotifier::updateIndications
 // @see MsgNotifier.h
 // ----------------------------------------------------------------------------
-void MsgNotifier::updateIndications(int unreadCount)
-    {
-    QDEBUG_WRITE("MsgNotifier::updateIndications  Enter")
-    
-    HbIndicator indicator; 
-    if(unreadCount)
-        {
-        indicator.activate(InidcationsPluginId);      
-        QDEBUG_WRITE("MsgNotifier::updateIndications Indications Activated")
-        }
-    else
-        {
-        indicator.deactivate(InidcationsPluginId);
-        QDEBUG_WRITE("MsgNotifier::updateIndications Indications Deactivated")
-        }
-    
-    QDEBUG_WRITE("MsgNotifier::updateIndications  Exit")
+void MsgNotifier::updateUnreadIndications(int unreadCount)
+{
+    QDEBUG_WRITE("MsgNotifier::updateUnreadIndications  Enter")
+
+    HbIndicator indicator;
+    if (unreadCount) {
+        QByteArray dataArray;
+        QDataStream messageStream(&dataArray, QIODevice::WriteOnly | QIODevice::Append);
+        MsgInfo info;
+        info.mIndicatorType = NewIndicatorPlugin;
+        
+        // only the unread count is used for unread indications as of now.
+        // the other values are not needed.
+        
+        info.mMsgCount = unreadCount;
+        info.mConversationId = -1;
+        
+        info.serialize(messageStream);
+        QVariant parameter(dataArray);
+        
+        indicator.activate(IndicationsPluginId, parameter);
+        QDEBUG_WRITE("MsgNotifier::updateUnreadIndications Indications Activated")
+    }
+    else {
+        indicator.deactivate(IndicationsPluginId);
+        QDEBUG_WRITE("MsgNotifier::updateUnreadIndications Indications Deactivated")
     }
 
+    QDEBUG_WRITE("MsgNotifier::updateUnreadIndications  Exit")
+}
+
+// ----------------------------------------------------------------------------
+// MsgNotifier::updateOutboxIndications
+// @see MsgNotifier.h
+// ----------------------------------------------------------------------------
+void MsgNotifier::updateOutboxIndications(MsgInfo& data)
+{
+    QDEBUG_WRITE("MsgNotifier::updateOutboxIndications  Enter")
+
+    HbIndicator indicator;
+    if (data.mMsgCount) {
+        QByteArray dataArray;
+        QDataStream messageStream(&dataArray, QIODevice::WriteOnly | QIODevice::Append);
+        data.serialize(messageStream);
+        QVariant parameter(dataArray);
+        indicator.activate(indicatorName(data.mIndicatorType), parameter);
+        QDEBUG_WRITE("MsgNotifier::updateOutboxIndications Indications Activated")
+    }
+    else {
+        indicator.deactivate(indicatorName(data.mIndicatorType));
+        QDEBUG_WRITE("MsgNotifier::updateOutboxIndications Indications Deactivated")
+    }
+
+    QDEBUG_WRITE("MsgNotifier::updateOutboxIndications  Exit")
+}
+
+//---------------------------------------------------------------
+// MsgNotifier::getVcardDisplayName
+// @see header
+//---------------------------------------------------------------
+QString MsgNotifier::getVcardDisplayName(const QString& filePath)
+{
+    QString displayName;
+    //open file for parsing
+    QFile file(filePath);
+    if (!file.open(QIODevice::ReadOnly)) {
+        return displayName;
+    }
+    // parse contents
+    QVersitReader reader;
+    reader.setDevice(&file);
+    if (reader.startReading()) {
+        if (reader.waitForFinished()) {
+            QList<QVersitDocument> versitDocuments = reader.results();
+            // Use the resulting document
+            if (versitDocuments.count() > 0) {
+                QVersitContactImporter importer;
+                QList<QContact> contacts = importer.importContacts(versitDocuments);
+                // get display-name
+                if (contacts.count() > 0) {
+                    QContactManager* contactManager = new QContactManager("symbian");
+                    displayName = contactManager->synthesizedDisplayLabel(contacts[0]);
+                    delete contactManager;
+                }
+            }
+        }
+    }
+    file.close();
+    return displayName;
+}
 
 //EOF
--- a/messagingapp/msgnotifications/msgnotifier/src/msgnotifier_p.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgnotifications/msgnotifier/src/msgnotifier_p.cpp	Mon May 03 12:29:07 2010 +0300
@@ -21,14 +21,17 @@
 #include <ccsclientconversation.h>
 #include <ccsrequesthandler.h>
 #include <ccsconversationentry.h>
+#include <xqservicerequest.h>
+#include <QString>
 
 //USER INCLUDES
 #include "msgnotifier.h"
 #include "msgnotifier_p.h"
 #include "s60qconversions.h"
-
+#include "msgstorehandler.h"
+#include "msginfodefs.h"
 #include <QtDebug>
-  
+
 #define QDEBUG_WRITE(str) {qDebug() << str;}
 #define QDEBUG_WRITE_FORMAT(str, val) {qDebug() << str << val;}
 #define QCRITICAL_WRITE(str) {qCritical() << str;}
@@ -38,13 +41,13 @@
 // MsgNotifierPrivate::MsgNotifierPrivate
 // @see MsgNotifierPrivate.h
 // ----------------------------------------------------------------------------
-MsgNotifierPrivate::MsgNotifierPrivate(MsgNotifier* MsgNotifier):
-q_ptr(MsgNotifier),
-mCvServer(NULL)
+MsgNotifierPrivate::MsgNotifierPrivate(MsgNotifier* MsgNotifier) :
+    q_ptr(MsgNotifier), mCvServer(NULL), iMsgStoreHandler(NULL)
 {
-QDEBUG_WRITE("MsgNotifierPrivate::MsgNotifierPrivate : Enter")
-TRAP_IGNORE(initL());
-QDEBUG_WRITE("MsgNotifierPrivate::MsgNotifierPrivate : Exit")
+    QDEBUG_WRITE("MsgNotifierPrivate::MsgNotifierPrivate : Enter")
+
+    TRAP_IGNORE(initL());
+    QDEBUG_WRITE("MsgNotifierPrivate::MsgNotifierPrivate : Exit")
 }
 
 // ----------------------------------------------------------------------------
@@ -53,14 +56,18 @@
 // ----------------------------------------------------------------------------
 MsgNotifierPrivate::~MsgNotifierPrivate()
 {
-QDEBUG_WRITE("MsgNotifierPrivate::~MsgNotifierPrivate : Enter")	
-if(mCvServer)
-    {
-    mCvServer->RemoveConversationListChangeEventL (this);
-    delete mCvServer;
-    mCvServer = NULL;
+    QDEBUG_WRITE("MsgNotifierPrivate::~MsgNotifierPrivate : Enter")
+    if (mCvServer) {
+        mCvServer->RemoveConversationListChangeEventL(this);
+        delete mCvServer;
+        mCvServer = NULL;
     }
-QDEBUG_WRITE("MsgNotifierPrivate::~MsgNotifierPrivate : Exit")    
+
+    if (iMsgStoreHandler) {
+        delete iMsgStoreHandler;
+        iMsgStoreHandler = NULL;
+    }
+    QDEBUG_WRITE("MsgNotifierPrivate::~MsgNotifierPrivate : Exit")
 }
 
 // ----------------------------------------------------------------------------
@@ -68,66 +75,67 @@
 // @see MsgNotifierPrivate.h
 // ----------------------------------------------------------------------------
 void MsgNotifierPrivate::initL()
-    {
+{
     QDEBUG_WRITE("MsgNotifierPrivate::initL : Enter")
-    
+
     mCvServer = CCSRequestHandler::NewL();
     mCvServer->RequestConversationListChangeEventL(this);
-    updateIndications();
-    
+    iMsgStoreHandler = new MsgStoreHandler(this, mCvServer);
+    updateUnreadIndications(true); 
+    updateOutboxIndications();
+
     QDEBUG_WRITE("MsgNotifierPrivate::initL : Exit")
-    }
+}
 
 // ----------------------------------------------------------------------------
 // MsgNotifierPrivate::AddConversationList
 // @see MsgNotifierPrivate.h
 // ----------------------------------------------------------------------------
 void MsgNotifierPrivate::AddConversationList(
-           const CCsClientConversation& aClientConversation)
-    {
+                  const CCsClientConversation& aClientConversation)
+{
     QDEBUG_WRITE("MsgNotifierPrivate::AddConversationList : Enter")
-    
+
     processListEntry(aClientConversation);
-    updateIndications();
-    
+    updateUnreadIndications();
+
     QDEBUG_WRITE("MsgNotifierPrivate::AddConversationList : Exit")
-    }
+}
 
 // ----------------------------------------------------------------------------
 // MsgNotifierPrivate::DeleteConversationList
 // @see MsgNotifierPrivate.h
 // ----------------------------------------------------------------------------
-void MsgNotifierPrivate::DeleteConversationList(
-           const CCsClientConversation& /*aClientConversation*/) 
-    {
-    QDEBUG_WRITE("MsgNotifierPrivate::DeleteConversationList : Enter")	
-    updateIndications();
+void MsgNotifierPrivate::DeleteConversationList( 
+	                const CCsClientConversation& /*aClientConversation*/)
+{
+    QDEBUG_WRITE("MsgNotifierPrivate::DeleteConversationList : Enter")
+    updateUnreadIndications();
     QDEBUG_WRITE("MsgNotifierPrivate::DeleteConversationList : Exit")
-    }
+}
 
 // ----------------------------------------------------------------------------
 // MsgNotifierPrivate::ModifyConversationList
 // @see MsgNotifierPrivate.h
 // ----------------------------------------------------------------------------
-void MsgNotifierPrivate:: ModifyConversationList(
-           const CCsClientConversation& aClientConversation)
-    {
+void MsgNotifierPrivate::ModifyConversationList(const CCsClientConversation& aClientConversation)
+{
     QDEBUG_WRITE("MsgNotifierPrivate::ModifyConversationList : Enter")
-    
+
     processListEntry(aClientConversation);
-    updateIndications();
-    
+    updateUnreadIndications();
+
     QDEBUG_WRITE("MsgNotifierPrivate::ModifyConversationList : Exit")
-    }
-   
+}
+
 // ----------------------------------------------------------------------------
 // MsgNotifierPrivate::RefreshConversationList
 // @see MsgNotifierPrivate.h
 // ----------------------------------------------------------------------------
 void MsgNotifierPrivate::RefreshConversationList()
-    {
-    
-    }
+{
+
+}
 
 // ----------------------------------------------------------------------------
 // MsgNotifierPrivate::processListEntry
@@ -147,9 +155,7 @@
                                                 convEntry->IsAttributeSet(ECsAttributeNewEntryAdded))
     QDEBUG_WRITE_FORMAT("MsgNotifierPrivate::processListEntry Unread Attribute",
                                                 convEntry->IsAttributeSet(ECsAttributeUnread))
-
-    bool newFlag=convEntry->IsAttributeSet(ECsAttributeNewEntryAdded);
-    
+   
     if((convEntry->ConversationDir() == ECsDirectionIncoming)
             && convEntry->IsAttributeSet(ECsAttributeNewEntryAdded) 
             && convEntry->IsAttributeSet(ECsAttributeUnread))
@@ -157,24 +163,19 @@
         QDEBUG_WRITE("processListEntry : Processing data for Notification")
         
         NotificationData notifData;
-        
+        notifData.msvEntryId = convEntry->EntryId(); 
         notifData.mConversationId = aClientConversation.GetConversationEntryId();
-        notifData.mMsgType = convEntry->GetType();
+        notifData.mMsgType = static_cast<int>(convEntry->GetType());
         
-        HBufC* firstName = aClientConversation.GetFirstName();
-        HBufC* lastName =  aClientConversation.GetLastName();
+        HBufC* displayName = aClientConversation.GetDisplayName();
         HBufC* number =  convEntry->Contact();
         HBufC* descrp =  convEntry->Description();
         
-        if(firstName)
+        if(displayName)
             {
-            notifData.mFirstName = 
-                                S60QConversions::s60DescToQString(*firstName);
-            }
-        if(lastName)
-            {
-            notifData.mLastName = S60QConversions::s60DescToQString(*lastName);
-            }
+            notifData.mDisplayName = 
+                                S60QConversions::s60DescToQString(*displayName);
+            }        
         if(number)
             {
             notifData.mContactNum =  S60QConversions::s60DescToQString(*number);
@@ -193,22 +194,97 @@
     }
 
 // ----------------------------------------------------------------------------
-// MsgNotifierPrivate::updateIndications
+// MsgNotifierPrivate::updateUnreadIndications
+// @see MsgNotifierPrivate.h
+// ----------------------------------------------------------------------------
+void MsgNotifierPrivate::updateUnreadIndications(bool bootup)
+{
+    QDEBUG_WRITE("MsgNotifierPrivate::updateIndicationsL : Enter")
+
+    int unreadCount(0);
+   if(bootup)
+   {
+       TRAP_IGNORE(unreadCount = iMsgStoreHandler->GetUnreadMessageCountL());
+   }
+   else
+   {
+       TRAP_IGNORE(unreadCount = mCvServer->GetTotalUnreadCountL());
+   }
+
+    QDEBUG_WRITE_FORMAT("MsgNotifierPrivate::"
+        "updateIndications unreadCount = ",unreadCount );
+
+    //activate or deactivate indications based on unread count
+    q_ptr->updateUnreadIndications(unreadCount);
+
+    QDEBUG_WRITE("MsgNotifierPrivate::updateIndicationsL : Exit")
+}
+
+// ----------------------------------------------------------------------------
+// MsgNotifierPrivate::updateOutboxIndications
 // @see MsgNotifierPrivate.h
 // ----------------------------------------------------------------------------
-void MsgNotifierPrivate::updateIndications()
-    {
-    QDEBUG_WRITE("MsgNotifierPrivate::updateIndicationsL : Enter")  
+void MsgNotifierPrivate::updateOutboxIndications()
+{
+
+    MsgInfo failedIndicatorData;
+    MsgInfo pendingIndicatorData;
+    TInt err = KErrNone;
+    
+    TRAP(err, iMsgStoreHandler->GetOutboxEntriesL(failedIndicatorData,pendingIndicatorData));
 
-    int unreadCount(0); 
-    TRAP_IGNORE(unreadCount = mCvServer->GetTotalUnreadCountL());
+    q_ptr->updateOutboxIndications(failedIndicatorData);
+    q_ptr->updateOutboxIndications(pendingIndicatorData);
+}
+
+
+// ----------------------------------------------------------------------------
+// MsgNotifierPrivate::displayOutboxIndications
+// @see MsgNotifierPrivate.h
+// ----------------------------------------------------------------------------
+
+void MsgNotifierPrivate::displayOutboxIndications(MsgInfo data)
+	{
+		q_ptr->updateOutboxIndications(data);
+	}
 
-    QDEBUG_WRITE_FORMAT("MsgNotifierPrivate::"
-            "updateIndications unreadCount = ",unreadCount );
+// ----------------------------------------------------------------------------
+// MsgNotifierPrivate::displayFailedNote
+// @see MsgNotifierPrivate.h
+// ----------------------------------------------------------------------------
+void MsgNotifierPrivate::displayFailedNote(MsgInfo info)
+{
+    // TODO: use XQAiwRequest
+    QDEBUG_WRITE("[MsgNotifierPrivate::handleFailedState] : entered")
+    // change to com.nokia.symbian.messaging (servicename), IMsgErrorNotifier
+    // as the service name.
+    XQServiceRequest snd("messaging.com.nokia.symbian.MsgErrorNotifier",
+        "displayErrorNote(QVariantList)", false);
 
-    //activate or deactivate indications based on unread count
-    q_ptr->updateIndications(unreadCount);
+    QVariantList args;
+    info.mDisplayName.removeDuplicates();
+    info.mDisplayName.sort();
+    
+    QString nameString;
+    
+    nameString.append(info.mDisplayName.at(0));
+    for(int i = 1; i < info.mDisplayName.count(); ++i){
+        nameString.append(", ");
+        nameString.append(info.mDisplayName.at(i));
+    }
+      
+    //Even if name string is empty we shall add name into args
+    QVariant nameV(nameString);
+    args << nameV;
 
-    QDEBUG_WRITE("MsgNotifierPrivate::updateIndicationsL : Exit")
-    }
+    QDEBUG_WRITE("[MsgNotifierPrivate::handleFailedState] : name and contactnumber")
+
+    args << info.mConversationId;
+    args << info.mMessageType;
+    snd << args;
+    snd.send();
+    QDEBUG_WRITE("[MsgNotifierPrivate::handleFailedState] : left")
+
+}
+
 //EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgnotifications/msgnotifier/src/msgstorehandler.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,397 @@
+/*
+ * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  Message Store Handling for Indications
+ *
+ */
+
+#include "msgstorehandler.h"
+#include "s60qconversions.h"
+#include "msgnotifier_p.h"
+#include <ccsrequesthandler.h>
+#include <ccsconversationentry.h>
+#include <ccsclientconversation.h>
+
+#include <msvids.h>
+#include <mmsconst.h>
+#include <SendUiConsts.h>
+#include <msvsearchsortquery.h>
+#include <msvsearchsortoperation.h>
+
+// CONSTANTS
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// Default constructor.
+// ---------------------------------------------------------
+//
+MsgStoreHandler::MsgStoreHandler(MsgNotifierPrivate* notifier, CCSRequestHandler* aCvServer) :
+    iMsvSession(NULL), iNotifier(notifier), iRequestHandler(aCvServer)
+{
+    TRAP_IGNORE(InitL());
+}
+
+// ---------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------
+//
+MsgStoreHandler::~MsgStoreHandler()
+{
+    if (iMsvEntry) {
+        delete iMsvEntry;
+        iMsvEntry = NULL;
+    }
+
+    if (iMsvSession) {
+        delete iMsvSession;
+        iMsvSession = NULL;
+    }
+
+    if (iFailedMessages) {
+        delete iFailedMessages;
+        iFailedMessages = NULL;
+    }
+
+    if (iFailedNotes) {
+        delete iFailedNotes;
+        iFailedNotes = NULL;
+    }
+}
+
+// ---------------------------------------------------------
+// InitL( )
+// Initialize the Store handler.
+// ---------------------------------------------------------
+void MsgStoreHandler::InitL()
+{
+    iMsvSession = CMsvSession::OpenSyncL(*this);
+    iMsvEntry = iMsvSession->GetEntryL(KMsvGlobalOutBoxIndexEntryId);
+    iMsvEntry->AddObserverL(*this);
+
+    iFailedMessages = new (ELeave) CMsvEntrySelection;
+    iFailedNotes = new (ELeave) CMsvEntrySelection;
+}
+
+// ---------------------------------------------------------
+// MsgStoreHandler::HandleSessionEventL()
+// ---------------------------------------------------------
+//
+void MsgStoreHandler::HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* /*aArg3*/)
+{
+    CMsvEntrySelection* selection = NULL;
+    TMsvId parent;
+
+    //args
+    if (aArg1 == NULL || aArg2 == NULL) {
+        return;
+    }
+
+    //start, processing the event
+    selection = (CMsvEntrySelection*) aArg1;
+    parent = *(TMsvId*) aArg2;
+
+    // Return when not (outbox or inbox) and  event not EMsvEntriesChanged
+    if (!(parent == KMsvGlobalOutBoxIndexEntryIdValue || parent == KMsvGlobalInBoxIndexEntryIdValue)
+        && aEvent != EMsvEntriesChanged) {
+        return;
+    }
+
+    //Handling for outbox entries
+    if( parent == KMsvGlobalOutBoxIndexEntryIdValue )
+    {
+        CMsvEntry* rootEntry = iMsvSession->GetEntryL(KMsvGlobalOutBoxIndexEntryId);
+
+        for (TInt i = 0; i < selection->Count(); ++i) {
+            TMsvEntry entry = rootEntry->ChildDataL(selection->At(i));
+
+            if ((entry.iMtm == KSenduiMtmSmsUid) || (entry.iMtm == KSenduiMtmMmsUid)) {
+                TUint sendingState = entry.SendingState();
+                TInt index = iFailedMessages->Find(entry.Id());
+
+                if (sendingState == KMsvSendStateFailed && KErrNotFound == index) {
+                    iFailedMessages->AppendL(entry.Id());
+                    iFailedNotes->AppendL(entry.Id());
+                }
+                else if (sendingState != KMsvSendStateFailed && KErrNotFound != index) {
+                    iFailedMessages->Delete(index);
+                    iFailedMessages->Compress();
+                }
+                if (iFailedNotes->Count()) {
+                    MsgInfo aInfo;
+                    ProcessIndicatorDataL(iFailedNotes->At(0), aInfo);
+                    iNotifier->displayFailedNote(aInfo);
+                    iFailedNotes->Delete(0);
+                    iFailedNotes->Compress();
+                }
+            }
+        }//end for
+    }
+    else
+    {
+        TMsvEntry entry;
+        TMsvId service;
+        TInt error= KErrNone;
+        for (TInt i = 0; i < selection->Count(); ++i)
+        {
+            error = iMsvSession->GetEntry(selection->At(i), service, entry);
+
+            if (error == KErrNone && entry.iMtm == KUidMsgMMSNotification && MmsNotificationStatus(
+                entry) == EMsgStatusFailed)
+            {
+                MsgInfo aInfo;
+                                
+                //Fill aInfo with appropriate data
+                aInfo.mMessageType = ECsMmsNotification;
+
+                ProcessIndicatorDataL(entry.Id(),aInfo);
+                iNotifier->displayFailedNote(aInfo);
+            }
+        }
+    }
+}
+
+// ---------------------------------------------------------
+// MsgStoreHandler::HandleEntryEventL()
+// ---------------------------------------------------------
+
+void MsgStoreHandler::HandleEntryEventL(TMsvEntryEvent aEvent, TAny* /*aArg1*/, TAny* /*aArg2*/,
+    TAny* /*aArg3*/)
+{
+    switch (aEvent) {
+    case EMsvChildrenChanged:
+    case EMsvDeletedChildren:
+    {
+        UpdateOutboxIndications();
+        break;
+    }
+    default:
+        break;
+
+    }
+}
+
+// ---------------------------------------------------------
+// UpdateOutboxIndications()
+// Outgoing Pending message/messages
+// ---------------------------------------------------------
+void MsgStoreHandler::UpdateOutboxIndications()
+{
+    MsgInfo failedIndicatorData;
+    MsgInfo pendingIndicatorData;
+
+    TInt err = KErrNone;
+
+    TRAP(err, GetOutboxEntriesL(failedIndicatorData, pendingIndicatorData));
+
+    if (err == KErrNone) {
+        iNotifier->displayOutboxIndications(failedIndicatorData);
+        iNotifier->displayOutboxIndications(pendingIndicatorData);
+    }
+}
+
+// ---------------------------------------------------------
+// GetOutboxEntries()
+// Outgoing Pending message/messages
+// ---------------------------------------------------------
+TInt MsgStoreHandler::GetOutboxEntriesL(MsgInfo& aFailedIndicatorData,
+    MsgInfo& aPendingIndicatorData)
+{
+    CMsvEntry* rootEntry = iMsvSession->GetEntryL(KMsvGlobalOutBoxIndexEntryId);
+    CMsvEntrySelection* messages = rootEntry->ChildrenL();
+
+    TInt failedMessageCount = 0;
+    TInt pendingMessageCount = 0;
+
+    for (TInt i = 0; i < messages->Count(); ++i) {
+        TMsvEntry entry = rootEntry->ChildDataL(messages->At(i));
+        if ((entry.iMtm != KSenduiMtmSmsUid) && (entry.iMtm != KSenduiMtmMmsUid)) {
+            continue;
+        }
+
+        if (entry.SendingState() == KMsvSendStateFailed) {
+            ++failedMessageCount;
+        }
+        else {
+            ++pendingMessageCount;
+        }
+
+        if (entry.SendingState() == KMsvSendStateFailed) {
+            ProcessIndicatorDataL(entry.Id(), aFailedIndicatorData);
+        }
+        else {
+            ProcessIndicatorDataL(entry.Id(), aPendingIndicatorData);
+        }
+       
+    }
+
+    aFailedIndicatorData.mFromSingle = (failedMessageCount > 1) ? false : true;
+    aPendingIndicatorData.mFromSingle = (pendingMessageCount > 1) ? false : true;
+    aFailedIndicatorData.mIndicatorType = FailedIndicatorPlugin;
+    aPendingIndicatorData.mIndicatorType = PendingIndicatorPlugin;
+    aFailedIndicatorData.mMsgCount = failedMessageCount;
+    aPendingIndicatorData.mMsgCount = pendingMessageCount;
+
+    return KErrNone;
+}
+
+// ---------------------------------------------------------
+// ProcessIndicatorData()
+// Process the data in the MsgInfo object. 
+// ---------------------------------------------------------
+
+void MsgStoreHandler::ProcessIndicatorDataL(TMsvId msgId, MsgInfo& indicatorData)
+{
+    CCsClientConversation* conversation = iRequestHandler->GetConversationFromMessageIdL(msgId);
+    if (conversation == NULL)
+        return;
+
+    indicatorData.mConversationId = conversation->GetConversationEntryId();
+    CCsConversationEntry* convEntry = conversation->GetConversationEntry();
+
+    //check for valid data
+    if ((indicatorData.mConversationId == -1) || (convEntry == NULL)) {
+        delete conversation;
+        return;
+    }
+    
+    //set indicator data
+    HBufC* displayName = conversation->GetDisplayName();
+
+    if (displayName) {
+        indicatorData.mDisplayName.append(S60QConversions::s60DescToQString(*displayName));
+    }
+    else {
+        HBufC* number = convEntry->Contact();
+        if (number)
+            indicatorData.mDisplayName.append(S60QConversions::s60DescToQString(*number));
+    }
+    delete conversation;
+}
+
+// ---------------------------------------------------------
+// GetUnreadMessageCountL()
+// Get Unread message count.
+// ---------------------------------------------------------
+
+int MsgStoreHandler::GetUnreadMessageCountL()
+{
+    //Create  the query/operation object
+    CMsvSearchSortOperation *operation = CMsvSearchSortOperation::NewL(*iMsvSession);
+    CleanupStack::PushL(operation);
+    CMsvSearchSortQuery *query = CMsvSearchSortQuery::NewL();
+    CleanupStack::PushL(query);
+
+    //set the query options
+    query->SetParentId(KMsvGlobalInBoxIndexEntryId);
+    query->SetResultType(EMsvResultAsTMsvEntry);
+    query->AddSearchOptionL(EMsvUnreadMessages, ETrue);
+    CleanupStack::Pop(query);
+
+    CMsvOperationWait* wait = CMsvOperationWait::NewLC();
+    //ownership of Query transferred to Operation  
+    operation->RequestL(query, EFalse, wait->iStatus);
+    wait->Start();
+    CActiveScheduler::Start();
+
+    //Get No of entries
+    int count = operation->GetResultCountL();
+    CleanupStack::PopAndDestroy(2, operation);
+
+    return count;
+}
+
+// ---------------------------------------------------------
+// MsgStoreHandler::MmsNotificationStatus
+// ---------------------------------------------------------
+//
+TCsMmsNotificationMsgState MsgStoreHandler::
+MmsNotificationStatus( TMsvEntry entry )
+    {   
+    TCsMmsNotificationMsgState status = EMsgStatusNull;
+
+    // operationMask includes operation type. It is not bitmap but ordinal number. 
+    // It does not include operation status and result
+    TInt operationMask = (entry.iMtmData2 & KMmsOperationIdentifier) ;
+
+    // Note! Ongoing operation resets every bit of operation type, operation status
+    // and result. E.g. If message has been forwarded and then fetching starts, 
+    // information about forwarding is lost
+
+    if( ( entry.iMtmData1 & KMmsMessageTypeMask ) == KMmsMessageMNotificationInd )
+        {
+        if(     operationMask == KMmsOperationFetch 
+                &&  OperationOngoing( entry ) )
+            { 
+            // It's in retrieving state
+            status = EMsgStatusRetrieving;
+            }
+        else if(    operationMask == KMmsOperationForward
+                &&  OperationOngoing( entry ) )
+            { 
+            // It's in forwarding state
+            status = EMsgStatusForwarding;
+            }
+        else if(    operationMask == KMmsOperationForward
+                &&  OperationFinished( entry )
+                &&  !( entry.iMtmData2 & KMmsOperationResult ) )
+            { 
+            // It's been forwarded succesfully
+            status = EMsgStatusForwarded;
+            }
+        else if(    operationMask == KMmsOperationFetch 
+                &&  OperationFinished( entry )
+                &&   (  entry.iMtmData2 & KMmsOperationResult 
+                ||  entry.iError ) )
+            { 
+            // Fetch has been failed
+            status = EMsgStatusFailed;
+            }
+        else if(    operationMask == KMmsOperationDelete
+                &&  OperationFinished( entry )
+                &&  !( entry.iMtmData2 & KMmsOperationResult ) )
+            { 
+            // It's been deleted succesfully
+            status = EMsgStatusDeleted;
+            }
+        else 
+            {   // Normal waiting state
+            status = EMsgStatusReadyForFetching;
+            }
+        }
+
+    return status;
+    }
+
+// ---------------------------------------------------------
+// MsgStoreHandler::OperationOngoing
+// ---------------------------------------------------------
+//
+TBool MsgStoreHandler::OperationOngoing( const TMsvEntry& aEntry ) const
+    {
+    return (    aEntry.iMtmData2 & KMmsOperationOngoing 
+            &&  !( aEntry.iMtmData2 & KMmsOperationFinished ) );
+    }
+
+// ---------------------------------------------------------
+// ConversationMsgStoreHandler::OperationFinished
+// ---------------------------------------------------------
+//
+TBool MsgStoreHandler::OperationFinished( 
+    const TMsvEntry& aEntry ) const
+    {
+    return (    aEntry.iMtmData2 & KMmsOperationFinished
+            &&  !( aEntry.iMtmData2 & KMmsOperationOngoing ) );
+    }
+
+// End of file
--- a/messagingapp/msgsettings/bwins/msgsettingsmwu.def	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-EXPORTS
-	?setDeliveryReport@MsgSettingEngine@@QAEX_N@Z @ 1 NONAME ; void MsgSettingEngine::setDeliveryReport(bool)
-	?allSMSMessageCenter@MsgSettingEngine@@QAEXAAVQStringList@@AAH@Z @ 2 NONAME ; void MsgSettingEngine::allSMSMessageCenter(class QStringList &, int &)
-	?setMMSAccesspoint@MsgSettingEngine@@QAEXH@Z @ 3 NONAME ; void MsgSettingEngine::setMMSAccesspoint(int)
-	?emailEmailGatewayAndServiceCenterNumber@MsgSettingEngine@@QAEXAAVQString@@0@Z @ 4 NONAME ; void MsgSettingEngine::emailEmailGatewayAndServiceCenterNumber(class QString &, class QString &)
-	?allMMsAcessPoints@MsgSettingEngine@@QAEXAAVQStringList@@AAH@Z @ 5 NONAME ; void MsgSettingEngine::allMMsAcessPoints(class QStringList &, int &)
-	?staticMetaObject@MsgSettingEngine@@2UQMetaObject@@B @ 6 NONAME ; struct QMetaObject const MsgSettingEngine::staticMetaObject
-	?editSmsMessageCenter@MsgSettingEngine@@QAEXAAVQString@@0H@Z @ 7 NONAME ; void MsgSettingEngine::editSmsMessageCenter(class QString &, class QString &, int)
-	?setReceiveMMSAdverts@MsgSettingEngine@@QAEX_N@Z @ 8 NONAME ; void MsgSettingEngine::setReceiveMMSAdverts(bool)
-	?tr@MsgSettingEngine@@SA?AVQString@@PBD0H@Z @ 9 NONAME ; class QString MsgSettingEngine::tr(char const *, char const *, int)
-	??1MsgSettingEngine@@UAE@XZ @ 10 NONAME ; MsgSettingEngine::~MsgSettingEngine(void)
-	??_EMsgSettingEngine@@UAE@I@Z @ 11 NONAME ; MsgSettingEngine::~MsgSettingEngine(unsigned int)
-	?advanceMmsSettings@MsgSettingEngine@@QAEXAAW4MmsCreationMode@1@AAW4MmsRetrieval@1@AA_N2@Z @ 12 NONAME ; void MsgSettingEngine::advanceMmsSettings(enum MsgSettingEngine::MmsCreationMode &, enum MsgSettingEngine::MmsRetrieval &, bool &, bool &)
-	?smsCenterNameAndNumber@MsgSettingEngine@@QAEXHAAVQString@@0@Z @ 13 NONAME ; void MsgSettingEngine::smsCenterNameAndNumber(int, class QString &, class QString &)
-	?setSMSMessageCenter@MsgSettingEngine@@QAEXH@Z @ 14 NONAME ; void MsgSettingEngine::setSMSMessageCenter(int)
-	?settingsDeliverReportAndCharEncoding@MsgSettingEngine@@QAEXAA_NAAW4CharacterEncoding@1@@Z @ 15 NONAME ; void MsgSettingEngine::settingsDeliverReportAndCharEncoding(bool &, enum MsgSettingEngine::CharacterEncoding &)
-	?setMMSRetrieval@MsgSettingEngine@@QAEXW4MmsRetrieval@1@@Z @ 16 NONAME ; void MsgSettingEngine::setMMSRetrieval(enum MsgSettingEngine::MmsRetrieval)
-	?qt_metacast@MsgSettingEngine@@UAEPAXPBD@Z @ 17 NONAME ; void * MsgSettingEngine::qt_metacast(char const *)
-	?setAnonymousMessages@MsgSettingEngine@@QAEX_N@Z @ 18 NONAME ; void MsgSettingEngine::setAnonymousMessages(bool)
-	?setCharacterEncoding@MsgSettingEngine@@QAEXW4CharacterEncoding@1@@Z @ 19 NONAME ; void MsgSettingEngine::setCharacterEncoding(enum MsgSettingEngine::CharacterEncoding)
-	?trUtf8@MsgSettingEngine@@SA?AVQString@@PBD0H@Z @ 20 NONAME ; class QString MsgSettingEngine::trUtf8(char const *, char const *, int)
-	?qt_metacall@MsgSettingEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 21 NONAME ; int MsgSettingEngine::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?setEmailSeriveCenterNumber@MsgSettingEngine@@QAEXAAVQString@@@Z @ 22 NONAME ; void MsgSettingEngine::setEmailSeriveCenterNumber(class QString &)
-	?tr@MsgSettingEngine@@SA?AVQString@@PBD0@Z @ 23 NONAME ; class QString MsgSettingEngine::tr(char const *, char const *)
-	?setMMSCreationmode@MsgSettingEngine@@QAEXW4MmsCreationMode@1@@Z @ 24 NONAME ; void MsgSettingEngine::setMMSCreationmode(enum MsgSettingEngine::MmsCreationMode)
-	??0MsgSettingEngine@@QAE@XZ @ 25 NONAME ; MsgSettingEngine::MsgSettingEngine(void)
-	?getStaticMetaObject@MsgSettingEngine@@SAABUQMetaObject@@XZ @ 26 NONAME ; struct QMetaObject const & MsgSettingEngine::getStaticMetaObject(void)
-	?metaObject@MsgSettingEngine@@UBEPBUQMetaObject@@XZ @ 27 NONAME ; struct QMetaObject const * MsgSettingEngine::metaObject(void) const
-	?setEmailGateway@MsgSettingEngine@@QAEXAAVQString@@@Z @ 28 NONAME ; void MsgSettingEngine::setEmailGateway(class QString &)
-	?trUtf8@MsgSettingEngine@@SA?AVQString@@PBD0@Z @ 29 NONAME ; class QString MsgSettingEngine::trUtf8(char const *, char const *)
-	?addSmsMessageCenter@MsgSettingEngine@@QAEXAAVQString@@0@Z @ 30 NONAME ; void MsgSettingEngine::addSmsMessageCenter(class QString &, class QString &)
-
--- a/messagingapp/msgsettings/bwins/settingsviewu.def	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgsettings/bwins/settingsviewu.def	Mon May 03 12:29:07 2010 +0300
@@ -1,16 +1,16 @@
 EXPORTS
-	?connectCloseAction@MsgSettingsView@@QAEXXZ @ 1 NONAME ; void MsgSettingsView::connectCloseAction(void)
-	?closeSettings@MsgSettingsView@@QAEXXZ @ 2 NONAME ; void MsgSettingsView::closeSettings(void)
-	?trUtf8@MsgSettingsView@@SA?AVQString@@PBD0@Z @ 3 NONAME ; class QString MsgSettingsView::trUtf8(char const *, char const *)
-	?qt_metacall@MsgSettingsView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 4 NONAME ; int MsgSettingsView::qt_metacall(enum QMetaObject::Call, int, void * *)
-	??_EMsgSettingsView@@UAE@I@Z @ 5 NONAME ; MsgSettingsView::~MsgSettingsView(unsigned int)
-	?trUtf8@MsgSettingsView@@SA?AVQString@@PBD0H@Z @ 6 NONAME ; class QString MsgSettingsView::trUtf8(char const *, char const *, int)
-	?staticMetaObject@MsgSettingsView@@2UQMetaObject@@B @ 7 NONAME ; struct QMetaObject const MsgSettingsView::staticMetaObject
-	?tr@MsgSettingsView@@SA?AVQString@@PBD0@Z @ 8 NONAME ; class QString MsgSettingsView::tr(char const *, char const *)
+	?trUtf8@MsgSettingsView@@SA?AVQString@@PBD0@Z @ 1 NONAME ; class QString MsgSettingsView::trUtf8(char const *, char const *)
+	?qt_metacall@MsgSettingsView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 2 NONAME ; int MsgSettingsView::qt_metacall(enum QMetaObject::Call, int, void * *)
+	??_EMsgSettingsView@@UAE@I@Z @ 3 NONAME ; MsgSettingsView::~MsgSettingsView(unsigned int)
+	?trUtf8@MsgSettingsView@@SA?AVQString@@PBD0H@Z @ 4 NONAME ; class QString MsgSettingsView::trUtf8(char const *, char const *, int)
+	?staticMetaObject@MsgSettingsView@@2UQMetaObject@@B @ 5 NONAME ; struct QMetaObject const MsgSettingsView::staticMetaObject
+	??0MsgSettingsView@@QAE@PAVQGraphicsItem@@@Z @ 6 NONAME ; MsgSettingsView::MsgSettingsView(class QGraphicsItem *)
+	?tr@MsgSettingsView@@SA?AVQString@@PBD0@Z @ 7 NONAME ; class QString MsgSettingsView::tr(char const *, char const *)
+	??1MsgSettingsView@@UAE@XZ @ 8 NONAME ; MsgSettingsView::~MsgSettingsView(void)
 	?metaObject@MsgSettingsView@@UBEPBUQMetaObject@@XZ @ 9 NONAME ; struct QMetaObject const * MsgSettingsView::metaObject(void) const
 	?getStaticMetaObject@MsgSettingsView@@SAABUQMetaObject@@XZ @ 10 NONAME ; struct QMetaObject const & MsgSettingsView::getStaticMetaObject(void)
-	?qt_metacast@MsgSettingsView@@UAEPAXPBD@Z @ 11 NONAME ; void * MsgSettingsView::qt_metacast(char const *)
-	??0MsgSettingsView@@QAE@PAVQGraphicsItem@@@Z @ 12 NONAME ; MsgSettingsView::MsgSettingsView(class QGraphicsItem *)
-	??1MsgSettingsView@@UAE@XZ @ 13 NONAME ; MsgSettingsView::~MsgSettingsView(void)
-	?tr@MsgSettingsView@@SA?AVQString@@PBD0H@Z @ 14 NONAME ; class QString MsgSettingsView::tr(char const *, char const *, int)
+	?tr@MsgSettingsView@@SA?AVQString@@PBD0H@Z @ 11 NONAME ; class QString MsgSettingsView::tr(char const *, char const *, int)
+	?qt_metacast@MsgSettingsView@@UAEPAXPBD@Z @ 12 NONAME ; void * MsgSettingsView::qt_metacast(char const *)
+	?onSmsCenterEditViewClosed@MsgSettingsView@@QAEXXZ @ 13 NONAME ; void MsgSettingsView::onSmsCenterEditViewClosed(void)
+	?onNewSMSCCenterClicked@MsgSettingsView@@QAEXH@Z @ 14 NONAME ; void MsgSettingsView::onNewSMSCCenterClicked(int)
 
--- a/messagingapp/msgsettings/eabi/msgsettingsmwu.def	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-EXPORTS
-	_ZN16MsgSettingEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME
-	_ZN16MsgSettingEngine11qt_metacastEPKc @ 2 NONAME
-	_ZN16MsgSettingEngine15setEmailGatewayER7QString @ 3 NONAME
-	_ZN16MsgSettingEngine15setMMSRetrievalENS_12MmsRetrievalE @ 4 NONAME
-	_ZN16MsgSettingEngine16staticMetaObjectE @ 5 NONAME DATA 16
-	_ZN16MsgSettingEngine17allMMsAcessPointsER11QStringListRi @ 6 NONAME
-	_ZN16MsgSettingEngine17setDeliveryReportEb @ 7 NONAME
-	_ZN16MsgSettingEngine17setMMSAccesspointEi @ 8 NONAME
-	_ZN16MsgSettingEngine18advanceMmsSettingsERNS_15MmsCreationModeERNS_12MmsRetrievalERbS4_ @ 9 NONAME
-	_ZN16MsgSettingEngine18setMMSCreationmodeENS_15MmsCreationModeE @ 10 NONAME
-	_ZN16MsgSettingEngine19addSmsMessageCenterER7QStringS1_ @ 11 NONAME
-	_ZN16MsgSettingEngine19allSMSMessageCenterER11QStringListRi @ 12 NONAME
-	_ZN16MsgSettingEngine19getStaticMetaObjectEv @ 13 NONAME
-	_ZN16MsgSettingEngine19setSMSMessageCenterEi @ 14 NONAME
-	_ZN16MsgSettingEngine20editSmsMessageCenterER7QStringS1_i @ 15 NONAME
-	_ZN16MsgSettingEngine20setAnonymousMessagesEb @ 16 NONAME
-	_ZN16MsgSettingEngine20setCharacterEncodingENS_17CharacterEncodingE @ 17 NONAME
-	_ZN16MsgSettingEngine20setReceiveMMSAdvertsEb @ 18 NONAME
-	_ZN16MsgSettingEngine22smsCenterNameAndNumberEiR7QStringS1_ @ 19 NONAME
-	_ZN16MsgSettingEngine26setEmailSeriveCenterNumberER7QString @ 20 NONAME
-	_ZN16MsgSettingEngine36settingsDeliverReportAndCharEncodingERbRNS_17CharacterEncodingE @ 21 NONAME
-	_ZN16MsgSettingEngine39emailEmailGatewayAndServiceCenterNumberER7QStringS1_ @ 22 NONAME
-	_ZN16MsgSettingEngineC1Ev @ 23 NONAME
-	_ZN16MsgSettingEngineC2Ev @ 24 NONAME
-	_ZN16MsgSettingEngineD0Ev @ 25 NONAME
-	_ZN16MsgSettingEngineD1Ev @ 26 NONAME
-	_ZN16MsgSettingEngineD2Ev @ 27 NONAME
-	_ZNK16MsgSettingEngine10metaObjectEv @ 28 NONAME
-	_ZTI16MsgSettingEngine @ 29 NONAME
-	_ZTV16MsgSettingEngine @ 30 NONAME
-
--- a/messagingapp/msgsettings/eabi/settingsviewu.def	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgsettings/eabi/settingsviewu.def	Mon May 03 12:29:07 2010 +0300
@@ -1,10 +1,10 @@
 EXPORTS
 	_ZN15MsgSettingsView11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME
 	_ZN15MsgSettingsView11qt_metacastEPKc @ 2 NONAME
-	_ZN15MsgSettingsView13closeSettingsEv @ 3 NONAME
-	_ZN15MsgSettingsView16staticMetaObjectE @ 4 NONAME DATA 16
-	_ZN15MsgSettingsView18connectCloseActionEv @ 5 NONAME
-	_ZN15MsgSettingsView19getStaticMetaObjectEv @ 6 NONAME
+	_ZN15MsgSettingsView16staticMetaObjectE @ 3 NONAME DATA 16
+	_ZN15MsgSettingsView19getStaticMetaObjectEv @ 4 NONAME
+	_ZN15MsgSettingsView22onNewSMSCCenterClickedEi @ 5 NONAME
+	_ZN15MsgSettingsView25onSmsCenterEditViewClosedEv @ 6 NONAME
 	_ZN15MsgSettingsViewC1EP13QGraphicsItem @ 7 NONAME
 	_ZN15MsgSettingsViewC2EP13QGraphicsItem @ 8 NONAME
 	_ZN15MsgSettingsViewD0Ev @ 9 NONAME
--- a/messagingapp/msgsettings/msgsettings.pro	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgsettings/msgsettings.pro	Mon May 03 12:29:07 2010 +0300
@@ -19,6 +19,5 @@
 
 SYMBIAN_PLATFORMS = WINSCW ARMV5
 
-SUBDIRS += msgsettingsmw/msgsettingsmw.pro
 SUBDIRS += settingsview/settingsview.pro
 SUBDIRS += msginit/msginit.pro
--- a/messagingapp/msgsettings/msgsettingsmw/inc/mmssettingprivate.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +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:  This provides the messaging mw interface for MMS
- *
- */
-
-#ifndef MMSSETTINS_PRIVATE_H
-#define MMSSETTINS_PRIVATE_H
-
-#include <smutset.h>
-#include <mmsclient.h>
-
-#include "msgsettingengine.h"
-
-/**
- * MMS setting class implements the MMSC settings
- * The settings will be stored in the central repository.
- */
-
-class MmsSettingsPrivate
-{
-public:
-
-    /**
-     * 2 phase constructor
-     */
-    static MmsSettingsPrivate* NewL();
-
-    /*
-     * Destructor
-     */
-    ~MmsSettingsPrivate();
-
-    void setDeliveryReport(TBool aReport);
-
-    void setCharacterEncoding(TBool aFlag);
-
-    void settingsDeliverReportAndCharEncoding(TBool& aReport, TBool& aFlag);
-
-    void setMMSCreationmode(MsgSettingEngine::MmsCreationMode aMode);
-
-    void setMMSRetrieval(MsgSettingEngine::MmsRetrieval aRetrieval);
-
-    void setAnonymousMessages(TBool aAnonymous);
-
-    void setReceiveMMSAdverts(TBool aReceiveAdvert);
-
-    void advanceMmsSettings(MsgSettingEngine::MmsCreationMode& aMode,
-                            MsgSettingEngine::MmsRetrieval& aRetrieval,
-                            TBool& aAnonymousStatus, TBool& aMmsAdvertsStatus);
-
-    void getAllAccessPoints(RPointerArray<HBufC>& aAccessPoints,
-                            TInt& aDefaultIndex);
-
-    void setMMSAccesspoint(TInt& aDefaultIndex);
-
-private:
-
-    /*
-     * 1st phase Constructor 
-     */
-    MmsSettingsPrivate();
-
-    /**
-     * 2nd phase constructor
-     */
-    void ConstructL();
-
-    /*
-     * Creates the repository
-     */
-    void createRepositoryL();
-
-private:
-    //nothing private data
-};
-
-#endif // MMSSETTINS_PRIVATE_H
-
--- a/messagingapp/msgsettings/msgsettingsmw/inc/msgsettingengine.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,215 +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:This class provides API m/w for msg settings plugin
- *
- */
-
-#ifndef MSGSETTINGENGINE_H_
-#define MSGSETTINGENGINE_H_
-
-#include <qobject.h>
-
-#ifdef  MSGSETTINGENGINE_DLL
-#define MSG_SETTING_ENGINE_EXPORT Q_DECL_EXPORT
-#else
-#define MSG_SETTING_ENGINE_EXPORT Q_DECL_IMPORT
-#endif
-
-//FORWARD DECLARATION
-class SmsSettingsPrivate;
-class MmsSettingsPrivate;
-
-/**
- * This class defines interfaces wrapper b/w MsgSettings UI
- * and m/w. 
- */
-class MSG_SETTING_ENGINE_EXPORT MsgSettingEngine : public QObject
-{
-Q_OBJECT
-
-public:
-    /*
-     * Enum defining Character Encoding
-     */
-    enum CharacterEncoding
-    {
-        ReducedSupport, FullSupport
-    };
-
-    /**
-     * Enum defining MmsCreation Mode
-     */
-    enum MmsCreationMode
-    {
-        Restricted, Guided, Free
-    };
-
-    /**
-     * Enum defining MmsRetrieval mode
-     */
-    enum MmsRetrieval
-    {
-        AlwaysAutomatic, AutomInHomeNetwork, Maual, Off, No
-    };
-    
-public:
-
-    /**
-     * Constructor
-     */
-    MsgSettingEngine();
-
-    /**
-     * Destructor
-     */
-    ~MsgSettingEngine();
-
-    /**
-     * for basic message settings
-     * set the deliver report
-     * @param report bool true or false
-     */
-    void setDeliveryReport(bool report);
-
-    /**
-     * set the character encoding
-     * @param encoding specifying encoding type
-     */
-    void setCharacterEncoding(MsgSettingEngine::CharacterEncoding encoding);
-
-    /**
-     * returns settings delivery report status
-     * and character encoding
-     * @param report for getting status report
-     * @param encoding for char encoding
-     */
-    void settingsDeliverReportAndCharEncoding( bool& report,
-                                 MsgSettingEngine::CharacterEncoding& encoding);
-
-    /**
-     * for advanced settings
-     * set the creation mode
-     * @mode for creation mode
-     */
-    void setMMSCreationmode(MsgSettingEngine::MmsCreationMode mode);
-
-    /**
-     * set the mms retrieval mode
-     * @param retrieval specifying mode
-     */
-    void setMMSRetrieval(MsgSettingEngine::MmsRetrieval);
-
-    /**
-     * set the anonymous message
-     * @param status true or false
-     */
-    void setAnonymousMessages(bool status);
-
-    /**
-     * set for receiving MMS Adverts
-     * @param status for true or false
-     */
-    void setReceiveMMSAdverts(bool status);
-
-    /**
-     * for view 2 mms advance settings\
-     * get all the fields of mms advance setting
-     * @param mode return for MMsCreation mode
-     * @param retrieval return for mms retrieval
-     * @param anonymous return status true or false
-     * @param mmsadverts return status true or false
-     */
-    void advanceMmsSettings(MsgSettingEngine::MmsCreationMode& mode,
-                            MsgSettingEngine::MmsRetrieval& retrieval,
-                            bool& anonymousStatus, bool& mmsAdvertsStatus);
-
-    /**
-     * get all the MMs access points
-     * @param returns all the access point names
-     * @attention to be displayed as per the index o to total count
-     * @param defaultIndex returns default selected
-     */
-    void allMMsAcessPoints(QStringList& nameList, int& defaultIndex);
-
-    /**
-     * set the default access point
-     * @param index specifying the index
-     */
-    void setMMSAccesspoint(int index);
-
-    /**
-     * get the list of all SMS Message Centres
-     * @param list of all names QString
-     * @param defaultIndex returns default selected
-     */
-    void allSMSMessageCenter(QStringList& nameList, int& defaultIndex);
-
-    /**
-     * set the default SMS message centre
-     * @param index specifying default index
-     */
-    void setSMSMessageCenter(int index);
-
-    /**
-     * for editing the SMS messafe Centre
-     * @param name specifying center name
-     * @param number specifying center number
-     * @param index specying index of message list
-     */
-    void editSmsMessageCenter(QString& centreName, QString& centreNumber,
-                              int index);
-
-    /**
-     * for add new sms message centre
-     * @param name specifying center name
-     * @param number specifying center number
-     */
-    void addSmsMessageCenter(QString& centreName, QString& centreNumber);
-
-    /**
-     * get the sms message centre namd and number
-     * @index for which center needs
-     * @param return name specifying center name
-     * @param return number specifying center number
-     */
-    void smsCenterNameAndNumber(int index, QString& centreName,
-                                QString& centreNumber);
-
-    /**
-     * set the Sms Email gateway
-     * @param gateway string
-     */
-    void setEmailGateway(QString& gateway);
-
-    /**
-     * set the sms Email Service centre number
-     * @param centre number
-     */
-    void setEmailSeriveCenterNumber(QString& centerNumber);
-
-    /**
-     * get the sms email gateway and 
-     * service centre number
-     * @param gateway return email gateway
-     * @param centreNumber return service number 
-     */
-    void emailEmailGatewayAndServiceCenterNumber(QString& gateway,
-                                                 QString& serviceNumber);
-    
-private:
-    SmsSettingsPrivate* dptr_smsSettings;
-    MmsSettingsPrivate* dptr_mmsSettings;
-};
-
-#endif /* MSGSETTINGENGINE_H_ */
--- a/messagingapp/msgsettings/msgsettingsmw/inc/msgsettingsutil.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +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:  This provides some utility functions to msgsettings m/w
- *
- */
-
-#ifndef MSGSETTINGS_UTIL_H
-#define MSGSETTINGS_UTIL_H
-
-#include <e32base.h>
-
-class MsgSettingsUtil
-{
-    
-public:
-    
-    /**
-     * Function to read email settings from CRE file
-     * @param aSmsC - sms center number
-     * @param aDestinationAddress - gateway address
-     * @return int error status
-     */
-   static TInt ReadEmailOverSmsSettingsL(
-                          TDes& aSmsc, 
-                          TDes& aDestinationAddress); 
-   
-   /**
-    * function writing gateway address into CRE file
-    * @param aDestinationAddress - gateway address
-    * @param aModifiable - writing status
-    */
-   static void WriteEmailGatewayOverSmsSettingsL(
-                             const TDes& aDestinationAddress,
-                             const TBool& aModifiable);
-   
-   /**
-    * function writing email service number
-    * @param aSmsc - service center number
-    * @param aModifiable - writing status
-    */
-   static void WriteEmailServiceNumberOverSmsSettingsL(
-                             const TDes& aSmsc,
-                             const TBool& aModifiable);   
-};
-
-#endif   //MSGSETTINGS_UTIL_H
--- a/messagingapp/msgsettings/msgsettingsmw/inc/smssettingsprivate.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:  This provides the messaging mw interface for sms
- *
- */
-
-#ifndef SMSSETTINS_H
-#define SMSSETTINS_H
-
-#include <e32base.h>
-
-/**
- * SMS setting class implements the SMSC settings
- * The settings will be stored in the central repository.
- */
-class SmsSettingsPrivate : public CBase
-{
-public:
-
-    //2phase constructor
-    static SmsSettingsPrivate* NewL();
-
-    /*
-     * Destructor
-     */
-    ~SmsSettingsPrivate();
-
-    /**
-     * sets the delivery report
-     * @param report status true or false
-     */
-    void setDeliveryReport(TBool report);
-
-    /**
-     * set the character encoding
-     * @param status true or false
-     */
-    void setCharacterEncoding(TBool status);
-
-    /**
-     * get the status of deliver report and
-     * character encoding
-     * @param report status of delivery report
-     * @param statusEncoding charcter encoding
-     */
-    void settingsDeliverReportAndCharEncoding(TBool& report,
-                                              TBool& statusEncoding);
-
-    /**
-     * get all the sms service names and 
-     * the default selected index
-     * @param accessPoints array of access names
-     * @param defaultIndex, default set index
-     */
-    void getAllSMSMessageCenter(RPointerArray<HBufC>& accessPoints,
-                                int &defaultIndex);
-
-    /**
-     * set the default index
-     * @param index default index
-     */
-    void setSMSMessageCenter(int index);
-
-    /**
-     * edit the sms service address
-     * @param address sms address number
-     * @param name sms service name
-     * @param index value to modify
-     */
-    void editSMSServiceCentre(HBufC* address, HBufC* name, TInt index);
-
-    /**
-     * add a new sms service address
-     * @param address service address number
-     * @param name service name
-     */
-    void addSmsMessageCenter(HBufC* address, HBufC* name);
-
-    /**
-     * get the service name and number by the index value
-     * @param index for the service need
-     * @param centerNumber address of the service
-     * @param centerName name of the service
-     */
-    void smsCenterNameAndNumber(int index, HBufC** centerNumber,
-                                HBufC** centerName);
-
-    /**
-     * set the sms email gateway address
-     * @param emailGateway an address
-     */
-    void setEmailGateway(HBufC* emailGateway);
-
-    /**
-     * set the sms email gateway number
-     * @param emailGateway an number
-     */
-    void setEmailSeriveCenterNumber(HBufC* emailNumber);
-
-    /**
-     * get the email gateway and service center number
-     * @param emailGateway
-     * @param serviceNumber
-     */
-    void emailEmailGatewayAndServiceCenterNumber(HBufC** emailGateway,
-                                                 HBufC** serviceNumber);
-    
-private:
-
-    /*
-     * 1st phase Constructor 
-     */
-    SmsSettingsPrivate();
-
-    /**
-     * 2nd phase constructor
-     */
-    void ConstructL();
-
-    /*
-     * Creates the repository first time
-     */
-    void createRepositoryL();
-};
-
-#endif // SMSSETTINS_H
-
--- a/messagingapp/msgsettings/msgsettingsmw/msgsettingsmw.pro	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +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:  Message settings detail 
-#
-
-TEMPLATE = lib
-TARGET = msgsettingsmw
-
-
-DEFINES += MSGSETTINGENGINE_DLL
-
-DEPENDPATH += . \
-    inc \
-    src
-    
-INCLUDEPATH += .
-INCLUDEPATH += ../../../inc
-INCLUDEPATH += ../../msgutils/s60qconversions/inc
-
-INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-
-TARGET.UID3 = 0x20026F49
-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/msgsettingsmw.iby CORE_APP_LAYER_IBY_EXPORT_PATH(msgsettingsmw.iby)" \
-     "stub_sis/msgsettingsmw_stub.sis   /epoc32/data/z/system/install/msgsettingsmw_stub.sis"
-
-
-
-HEADERS += msgsettingengine.h \
-					smssettingsprivate.h \
-					mmssettingprivate.h \
-					msgsettingsutil.h
-					
-SOURCES += msgsettingengine.cpp \
-					smssettingsprivate.cpp \
-					mmssettingsprivate.cpp \
-					msgsettingsutil.cpp
-
-LIBS += -lSmcm \
-		    -lmsgs \	
-        -ls60qconversions \
-        -lcommdb \
-        -lmmsserversettings \
-		    -lmmsgenericsettings \
-		    -lcentralrepository
-		
\ No newline at end of file
--- a/messagingapp/msgsettings/msgsettingsmw/rom/msgsettingsmw.iby	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +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 __MSGSETTINGSMW_IBY__
-#define __MSGSETTINGSMW_IBY__
-
-REM DLL
-file=ABI_DIR\UREL\msgsettingsmw.dll                   SHARED_LIB_DIR\msgsettingsmw.dll
-data=DATAZ_\system\install\msgsettingsmw_stub.sis					       system\install\msgsettingsmw_stub.sis
-
-#endif // __MSGSETTINGSMW_IBY__
--- a/messagingapp/msgsettings/msgsettingsmw/src/mmssettingsprivate.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,521 +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:  This provides the messaging mw interface for MMS
- *
- */
-
-#include <commdb.h>
-#include <commdbconnpref.h>
-#include <msvapi.h>
-#include <msvstd.h>
-#include <msvuids.h>
-#include <mmsaccount.h>
-#include <mmssettings.h>
-#include "debugtraces.h"
-
-
-#include "mmssettingprivate.h"
-
-/**
- * Message Server session event handler 
- */
-class CEventHandler : public MMsvSessionObserver
-{
-public:
-    void HandleSessionEvent(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2,
-                            TAny* aArg3);
-    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2,
-                             TAny* aArg3);
-};
-void CEventHandler::HandleSessionEvent(TMsvSessionEvent /*aEvent*/,
-                                       TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
-{
-}
-void CEventHandler::HandleSessionEventL(TMsvSessionEvent /*aEvent*/,
-                                        TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
-{
-}
-
-//two phase constructor
-MmsSettingsPrivate* MmsSettingsPrivate::NewL()
-{
-    MmsSettingsPrivate* self = new (ELeave) MmsSettingsPrivate();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;
-}
-
-//---------------------------------------------------------------
-// MmsSettingsPrivate::MmsSettingsPrivate
-// @see header
-//---------------------------------------------------------------
-MmsSettingsPrivate::MmsSettingsPrivate()
-{
-    //do nothing
-}
-
-//2nd phase constructor
-void MmsSettingsPrivate::ConstructL()
-{
-    //for debug only
-    //createRepositoryL();    
-}
-
-//---------------------------------------------------------------
-// MmsSettingsPrivate::~MmsSettingsPrivate
-// @see header
-//---------------------------------------------------------------
-MmsSettingsPrivate::~MmsSettingsPrivate()
-{
-    // do nothing
-}
-
-//---------------------------------------------------------------
-// MmsSettingsPrivate::createRepository
-// @see header
-//---------------------------------------------------------------
-void MmsSettingsPrivate::createRepositoryL()
-{
-    CEventHandler* pObserver = new (ELeave) CEventHandler();
-    CleanupStack::PushL(pObserver);
-
-    CMsvSession* iMsvSession = CMsvSession::OpenSyncL(*pObserver);
-    CleanupStack::PushL(iMsvSession);
-
-    CMmsSettings* mmsSetting = CMmsSettings::NewL();
-    CleanupStack::PushL(mmsSetting);
-
-    mmsSetting->LoadSettingsL();
-
-    TMsvId entryToBeKilled = KMsvNullIndexEntryId;
-    // Get access to root index
-    CMsvEntry* cEntry = iMsvSession->GetEntryL(KMsvRootIndexEntryId);
-    CleanupStack::PushL(cEntry);
-
-    entryToBeKilled = mmsSetting->Service();
-    cEntry->SetSortTypeL(TMsvSelectionOrdering(KMsvNoGrouping,
-                                               EMsvSortByNone,
-                                               ETrue));
-    if (entryToBeKilled == KMsvNullIndexEntryId)
-    {
-        mmsSetting->CreateNewServiceL(*iMsvSession);
-    }
-
-    CleanupStack::PopAndDestroy(); // cEntry          
-
-    mmsSetting->SetReceivingModeHome(EMmsReceivingAutomatic);
-    mmsSetting->SetReceivingModeForeign(EMmsReceivingAutomatic);
-
-    mmsSetting->SaveSettingsL();
-
-    CleanupStack::PopAndDestroy(3); // settings    
-}
-
-void MmsSettingsPrivate::setDeliveryReport(TBool aReport)
-{
-    CMmsAccount* mmsAccount = CMmsAccount::NewL();
-    CleanupStack::PushL(mmsAccount);
-
-    CMmsSettings* mmsSetting = CMmsSettings::NewL();
-    CleanupStack::PushL(mmsSetting);
-
-    mmsAccount->LoadSettingsL(*mmsSetting);
-
-    if (aReport)
-        {
-        mmsSetting->SetDeliveryReportWanted(KMmsYes);
-        }
-    else
-        {
-        mmsSetting->SetDeliveryReportWanted(KMmsNo);
-        }
-
-    //save the settings
-    mmsAccount->SaveSettingsL(*mmsSetting);
-    CleanupStack::PopAndDestroy(2);
-}
-
-void MmsSettingsPrivate::setCharacterEncoding(TBool /*aFlag*/)
-{
-    //not provided   
-}
-
-void MmsSettingsPrivate::settingsDeliverReportAndCharEncoding(TBool& aReport,
-                                                              TBool& aFlag)
-{
-    CMmsAccount* mmsAccount = CMmsAccount::NewL();
-    CleanupStack::PushL(mmsAccount);
-
-    CMmsSettings* mmsSetting = CMmsSettings::NewL();
-    CleanupStack::PushL(mmsSetting);
-
-    mmsAccount->LoadSettingsL(*mmsSetting);
-
-    TInt reportWanted = mmsSetting->DeliveryReportWanted();
-    aReport = EFalse;
-    if (KMmsYes == reportWanted)
-        {
-        aReport = ETrue;
-        }
-
-    //set the aFlag as true by default
-    aFlag = ETrue;
-
-    CleanupStack::PopAndDestroy(2);
-}
-
-void MmsSettingsPrivate::setMMSCreationmode(MsgSettingEngine::MmsCreationMode aMode)
-{
-    CMmsAccount* mMmsAccount = CMmsAccount::NewL();
-    CleanupStack::PushL(mMmsAccount);
-
-    CMmsSettings* mMmsSetting = CMmsSettings::NewL();
-    CleanupStack::PushL(mMmsSetting);
-
-    mMmsAccount->LoadSettingsL(*mMmsSetting);
-
-    TMmsCreationMode creationMode = EMmsCreationModeWarning;
-
-    if (aMode == MsgSettingEngine::Restricted)
-        creationMode = EMmsCreationModeRestricted;
-    else if (aMode == MsgSettingEngine::Free)
-        creationMode = EMmsCreationModeFree;
-
-    mMmsSetting->SetCreationMode(creationMode);
-
-    //save the settings
-    mMmsAccount->SaveSettingsL(*mMmsSetting);
-    CleanupStack::PopAndDestroy(2);
-}
-
-void MmsSettingsPrivate::setMMSRetrieval(MsgSettingEngine::MmsRetrieval aRetrieval)
-{
-    CMmsAccount* mMmsAccount = CMmsAccount::NewL();
-    CleanupStack::PushL(mMmsAccount);
-
-    CMmsSettings* mMmsSetting = CMmsSettings::NewL();
-    CleanupStack::PushL(mMmsSetting);
-
-    mMmsAccount->LoadSettingsL(*mMmsSetting);
-
-    //do your operation
-    TMmsReceivingMode receveMode = EMmsReceivingAutomatic;
-
-    if (aRetrieval == MsgSettingEngine::Maual)
-        receveMode = EMmsReceivingManual;
-    else if (aRetrieval == MsgSettingEngine::Off)
-        receveMode = EMmsReceivingPostpone;
-    else if (aRetrieval == MsgSettingEngine::No)
-        receveMode = EMmsReceivingReject;
-
-    if (aRetrieval == MsgSettingEngine::AlwaysAutomatic)
-        {
-        mMmsSetting->SetReceivingModeForeign(receveMode);
-        }
-    else
-        {
-        mMmsSetting->SetReceivingModeForeign(EMmsReceivingManual);
-        }
-
-    mMmsSetting->SetReceivingModeHome(receveMode);
-
-    //save the settings
-    mMmsAccount->SaveSettingsL(*mMmsSetting);
-    CleanupStack::PopAndDestroy(2);
-}
-
-void MmsSettingsPrivate::setAnonymousMessages(TBool aAnonymous)
-{
-    CMmsAccount* mMmsAccount = CMmsAccount::NewL();
-    CleanupStack::PushL(mMmsAccount);
-
-    CMmsSettings* mMmsSetting = CMmsSettings::NewL();
-    CleanupStack::PushL(mMmsSetting);
-
-    mMmsAccount->LoadSettingsL(*mMmsSetting);
-
-    //do your operation
-    mMmsSetting->SetAcceptAnonymousMessages(aAnonymous);
-
-    //save the settings
-    mMmsAccount->SaveSettingsL(*mMmsSetting);
-    CleanupStack::PopAndDestroy(2);
-}
-
-void MmsSettingsPrivate::setReceiveMMSAdverts(TBool aReceiveAdvert)
-{
-    CMmsAccount* mMmsAccount = CMmsAccount::NewL();
-    CleanupStack::PushL(mMmsAccount);
-
-    CMmsSettings* mMmsSetting = CMmsSettings::NewL();
-    CleanupStack::PushL(mMmsSetting);
-
-    mMmsAccount->LoadSettingsL(*mMmsSetting);
-
-    //do your operation
-    mMmsSetting->SetAcceptAdvertisementMessages(aReceiveAdvert);
-
-    //save the settings
-    mMmsAccount->SaveSettingsL(*mMmsSetting);
-    CleanupStack::PopAndDestroy(2);
-}
-
-void MmsSettingsPrivate::advanceMmsSettings(
-                                            MsgSettingEngine::MmsCreationMode& aMode,
-                                            MsgSettingEngine::MmsRetrieval& aRetrieval,
-                                            TBool& aAnonymousStatus,
-                                            TBool& aMmsAdvertsStatus)
-{
-    CMmsAccount* mMmsAccount = CMmsAccount::NewL();
-    CleanupStack::PushL(mMmsAccount);
-
-    CMmsSettings* mMmsSetting = CMmsSettings::NewL();
-    CleanupStack::PushL(mMmsSetting);
-
-    mMmsAccount->LoadSettingsL(*mMmsSetting);
-
-    //do your operation
-    TInt32 creationMode = mMmsSetting->CreationMode();
-    
-    if (creationMode == EMmsCreationModeRestricted)
-        {
-        aMode = MsgSettingEngine::Restricted;
-        }
-    else if (creationMode == EMmsCreationModeFree)
-        {
-        aMode = MsgSettingEngine::Free;
-        }
-
-    TMmsReceivingMode receveMode = mMmsSetting->ReceivingModeHome();
-    
-    if (receveMode == EMmsReceivingManual)
-        aRetrieval = MsgSettingEngine::Maual;
-    else if (receveMode == EMmsReceivingPostpone)
-        aRetrieval = MsgSettingEngine::Off;
-    else if (receveMode == EMmsReceivingReject)
-        aRetrieval = MsgSettingEngine::No;
-
-    receveMode = mMmsSetting->ReceivingModeForeign();
-    if (receveMode == EMmsReceivingAutomatic)
-        {
-        aRetrieval = MsgSettingEngine::AlwaysAutomatic;
-        }
-
-    aAnonymousStatus = mMmsSetting->AcceptAnonymousMessages();
-
-    aMmsAdvertsStatus = mMmsSetting->AcceptAdvertisementMessages();
-
-    CleanupStack::PopAndDestroy(2);
-}
-
-//---------------------------------------------------------------
-// SmsSettings::iAPSelector
-// @see header
-//---------------------------------------------------------------
-void MmsSettingsPrivate::getAllAccessPoints(
-                                            RPointerArray<HBufC>& aAccessPoints,
-                                            TInt& aDefaultIndex)
-{
-#ifdef _DEBUG_TRACES_
-		qDebug() << "Enter MmsSettingsPrivate::getAllAccessPoints: Index= " << aDefaultIndex;
-#endif
-
-    CCommsDatabase *db;
-    CCommsDbTableView *view;
-    TInt result, err;
-
-    //select the access point and store it in cenrep
-    CMmsAccount* mmsAccount = CMmsAccount::NewL();
-    CleanupStack::PushL(mmsAccount);
-
-    CMmsSettings* mMmsSetting = CMmsSettings::NewL();
-    CleanupStack::PushL(mMmsSetting);
-
-    mmsAccount->LoadSettingsL(*mMmsSetting);
-
-    //select the default access point
-    TInt32 defaultId = mMmsSetting->AccessPoint(0);
-
-    TBuf<KCommsDbSvrMaxColumnNameLength> iapName;
-    TBuf<KCommsDbSvrMaxFieldLength> serviceType;
-    TUint32 iapId = 0;
-    db = CCommsDatabase::NewL(EDatabaseTypeIAP);
-    CleanupStack::PushL(db);
-    view = db->OpenTableLC(TPtrC(IAP));
-
-    // Walk through records
-    result = view->GotoFirstRecord();
-    TInt recordIndex = 0;
-    while (result == KErrNone)
-    {
-        TRAP(err, view->ReadTextL(TPtrC(COMMDB_NAME), iapName));
-        TRAP(err, view->ReadTextL(TPtrC(IAP_SERVICE_TYPE), serviceType));
-#ifdef __WINSCW__
-        if (serviceType.CompareF(TPtrC(LAN_SERVICE)) == 0)
-        {
-            HBufC* accessPointName = iapName.Alloc();
-            aAccessPoints.AppendL(accessPointName);
-            TRAP(err, view->ReadUintL(TPtrC(COMMDB_ID), iapId));
-            
-            // check to see if this is default set for MMsAccesspoint
-            if (defaultId == iapId)
-            {
-               aDefaultIndex = recordIndex;
-            }
-            recordIndex++;
-        }
-#else
-        if(serviceType.CompareF(TPtrC(OUTGOING_GPRS)) == 0)
-        {
-            HBufC* accessPointName = iapName.Alloc();
-            aAccessPoints.AppendL(accessPointName);
-            TRAP(err, view->ReadUintL(TPtrC(COMMDB_ID), iapId));
-            
-            // check to see if this is default set for MMsAccesspoint
-            if (defaultId == iapId)
-            {
-                aDefaultIndex = recordIndex;
-            }
-        recordIndex++;
-        }
-#endif           
-        TRAP(err, result = view->GotoNextRecord());
-    }
-    CleanupStack::PopAndDestroy(4); // nMmsSettings, db,view
-#ifdef _DEBUG_TRACES_
-		qDebug() << "Exit MmsSettingsPrivate::getAllAccessPoints: Index=" 
-	          << aDefaultIndex
-	          << "\n";
-#endif
-
-}
-
-//---------------------------------------------------------------
-// MmsSettingsPrivate::setMMSAccesspoint
-// @see header
-//---------------------------------------------------------------
-void MmsSettingsPrivate::setMMSAccesspoint(TInt& aDefaultIndex)
-{
-#ifdef _DEBUG_TRACES_
-		qDebug() << "Enter MmsSettingsPrivate::setMMSAccesspoint: Index=" 
-	          << aDefaultIndex
-	          << "\n";
-#endif
-
-	          
-    //select the access point and store it in cenrep
-    CMmsAccount* mmsAccount = CMmsAccount::NewL();
-    CleanupStack::PushL(mmsAccount);
-
-    CMmsSettings* mMmsSetting = CMmsSettings::NewL();
-    CleanupStack::PushL(mMmsSetting);
-
-    mmsAccount->LoadSettingsL(*mMmsSetting);
-
-    CCommsDatabase *db;
-    CCommsDbTableView *view;
-    TInt result, err;
-
-    TCommDbConnPref prefs;
-
-    TBuf<KCommsDbSvrMaxColumnNameLength> iapName;
-    TBuf<KCommsDbSvrMaxFieldLength> serviceType;
-    TUint32 iapId = 0;
-    db = CCommsDatabase::NewL(EDatabaseTypeIAP);
-    CleanupStack::PushL(db);
-    view = db->OpenTableLC(TPtrC(IAP));
-
-    // Walk through records
-    result = view->GotoFirstRecord();
-    TInt serviceCounter = 0;
-    while (result == KErrNone)
-    {
-        TRAP(err, view->ReadTextL(TPtrC(COMMDB_NAME), iapName));
-        TRAP(err, view->ReadTextL(TPtrC(IAP_SERVICE_TYPE), serviceType));
-
-#ifdef __WINSCW__
-        if (serviceType.CompareF(TPtrC(LAN_SERVICE)) == 0 && serviceCounter
-                == aDefaultIndex)
-        {
-            TRAP(err, view->ReadUintL(TPtrC(COMMDB_ID), iapId));
-            prefs.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
-            prefs.SetDirection(ECommDbConnectionDirectionOutgoing);
-            prefs.SetIapId(iapId);
-
-            while (mMmsSetting->AccessPointCount())
-            {
-                mMmsSetting->DeleteAccessPointL(0);
-            }
-            if (iapId != 0)
-            {
-#ifdef _DEBUG_TRACES_
-		        qDebug() << "Set MMs Accesspoint IAP ID:"
-            	         << iapId;
-#endif
-
-
-                mMmsSetting->AddAccessPointL(iapId, 0);
-            }
-            mmsAccount->SaveSettingsL(*mMmsSetting);
-            serviceCounter++;
-        }
-        else if (serviceType.CompareF(TPtrC(LAN_SERVICE)) == 0)
-        	{
-        		serviceCounter++;
-        	}
-#else
-        if(serviceType.CompareF(TPtrC(OUTGOING_GPRS)) == 0 &&
-                serviceCounter == aDefaultIndex)
-        {
-            TRAP(err, view->ReadUintL(TPtrC(COMMDB_ID), iapId));
-            prefs.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
-            prefs.SetDirection(ECommDbConnectionDirectionOutgoing);
-            prefs.SetIapId(iapId);
-
-            while ( mMmsSetting->AccessPointCount() )
-            {
-#ifdef _DEBUG_TRACES_
-                qDebug() << "Set MMs Accesspoint IAP ID:"
-            	         << iapId;
-#endif
-
-                mMmsSetting->DeleteAccessPointL( 0 );
-            }
-            if ( iapId != 0 )
-            {
-                mMmsSetting->AddAccessPointL(iapId, 0);
-            }
-            mmsAccount->SaveSettingsL(*mMmsSetting);
-            serviceCounter++;
-        }
-        else if(serviceType.CompareF(TPtrC(OUTGOING_GPRS)) == 0)
-        {
-        		serviceCounter++;
-        }        	
-#endif          
-        TRAP(err, result = view->GotoNextRecord());
-    }
-
-    CleanupStack::PopAndDestroy(4); // mMmsSetting, db,view
-#ifdef _DEBUG_TRACES_
-		qDebug() << "Exit MmsSettingsPrivate::setMMSAccesspoint: Index=" 
-	          << aDefaultIndex
-	          << "\n";
-#endif
-
-}
-
-//eof
-
--- a/messagingapp/msgsettings/msgsettingsmw/src/msgsettingengine.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,531 +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:This class provides API m/w for msg settings plugin
- *
- */
-
-#include "qstringlist.h"
-#include "debugtraces.h"
-
-
-#include "msgsettingengine.h"
-#include "smssettingsprivate.h"
-#include "mmssettingprivate.h"
-#include "s60qconversions.h"
-
-//Constructor
-MsgSettingEngine::MsgSettingEngine()
-{
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Enter MsgSettingEngine::MsgSettingEngine";
-#endif
-
-
-    dptr_smsSettings = SmsSettingsPrivate::NewL();
-    dptr_mmsSettings = MmsSettingsPrivate::NewL();
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit MsgSettingEngine::MsgSettingEngine";
-#endif
-
-}
-
-//Destructor
-MsgSettingEngine::~MsgSettingEngine()
-{
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Enter MsgSettingEngine::~MsgSettingEngine";
-#endif
-
-
-    delete dptr_smsSettings;
-    delete dptr_mmsSettings;
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit MsgSettingEngine::~MsgSettingEngine";
-#endif
-
-}
-
-/**
- * for basic message settings
- * set the deliver report
- * @param report bool true or false
- */
-void MsgSettingEngine::setDeliveryReport(bool report)
-{
-#ifdef _DEBUG_TRACES_
-    qDebug() << "MsgSettingEngine::setDeliveryReport" << report;
-#endif
-
-
-    dptr_smsSettings->setDeliveryReport(report);
-    dptr_mmsSettings->setDeliveryReport(report);
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit MsgSettingEngine::setDeliveryReport";
-#endif
-
-}
-
-/**
- * set the character encoding
- * @param encoding specifying encoding type
- */
-void MsgSettingEngine::setCharacterEncoding(MsgSettingEngine::CharacterEncoding encoding)
-{
-#ifdef _DEBUG_TRACES_
-    qDebug() << "MsgSettingEngine::setCharacterEncoding: " << encoding;
-#endif
-
-
-    TBool flag = EFalse;
-
-    if (encoding == MsgSettingEngine::FullSupport)
-    {
-        flag = ETrue;
-    }
-    dptr_smsSettings->setCharacterEncoding(flag);
-    dptr_mmsSettings->setCharacterEncoding(flag);
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "MsgSettingEngine::setCharacterEncoding";
-#endif
-
-}
-
-/**
- * returns settings delivery report status
- * and character encoding
- * @param report for getting status report
- * @param encoding for char encoding
- */
-void MsgSettingEngine::settingsDeliverReportAndCharEncoding( bool& report,
-                                MsgSettingEngine::CharacterEncoding& encoding )
-{
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Enter MsgSettingEngine::settingsDeliverReportAndCharEncoding";
-#endif
-
-
-    TBool encodingStatus1;
-    TBool encodingStatus2;
-    TBool report1;
-    TBool report2;
-
-    dptr_smsSettings->settingsDeliverReportAndCharEncoding(report1,
-                                                           encodingStatus1);
-
-    dptr_mmsSettings->settingsDeliverReportAndCharEncoding(report2,
-                                                           encodingStatus2);
-
-    report = report1 && report2;
-
-    encoding = MsgSettingEngine::ReducedSupport;
-    if (encodingStatus1 && encodingStatus2)
-    {
-        encoding = MsgSettingEngine::FullSupport;
-    }
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit settingsDeliverReportAndCharEncoding: " << report << " "
-            << encoding;
-#endif
-
-}
-
-/**
- * for advanced settings
- * set the creation mode
- * @mode for creation mode
- */
-void MsgSettingEngine::setMMSCreationmode(MsgSettingEngine::MmsCreationMode mode)
-{
-#ifdef _DEBUG_TRACES_
-    qDebug() << "MsgSettingEngine::setMMSCreationmode " << mode;
-#endif
-
-
-    dptr_mmsSettings->setMMSCreationmode(mode);
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit setMMSCreationmode";
-#endif
-
-}
-
-/**
- * set the mms retrieval mode
- * @param retrieval specifying mode
- */
-void MsgSettingEngine::setMMSRetrieval(MsgSettingEngine::MmsRetrieval retrieval)
-{
-#ifdef _DEBUG_TRACES_
-    qDebug() << "MsgSettingEngine::setMMSRetrieval " << retrieval;
-#endif
-
-
-    dptr_mmsSettings->setMMSRetrieval(retrieval);
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit setMMSRetrieval";
-#endif
-
-}
-
-/**
- * set the anonymous message
- * @param status true or false
- */
-void MsgSettingEngine::setAnonymousMessages(bool status)
-{
-#ifdef _DEBUG_TRACES_
-    qDebug() << "MsgSettingEngine::setAnonymousMessages " << status;
-#endif
-
-
-    dptr_mmsSettings->setAnonymousMessages(status);
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit setAnonymousMessages";
-#endif
-
-}
-
-/**
- * set for receiving MMS Adverts
- * @param status for true or false
- */
-void MsgSettingEngine::setReceiveMMSAdverts(bool status)
-{
-#ifdef _DEBUG_TRACES_
-    qDebug() << "MsgSettingEngine::setReceiveMMSAdverts " << status;
-#endif
-
-
-    dptr_mmsSettings->setReceiveMMSAdverts(status);
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit setReceiveMMSAdverts";
-#endif
-
-}
-
-/**
- * for view 2 mms advance settings\
-* get all the fields of mms advance setting
- * @param mode return for MMsCreation mode
- * @param retrieval return for mms retrieval
- * @param anonymous return status true or false
- * @param mmsadverts return status true or false
- */
-void MsgSettingEngine::advanceMmsSettings(MsgSettingEngine::MmsCreationMode& mode,
-                                          MsgSettingEngine::MmsRetrieval& retrieval,
-                                          bool& anonymousStatus,
-                                          bool& mmsAdvertsStatus)
-{
-#ifdef _DEBUG_TRACES_
-    qDebug() << "MsgSettingEngine::setReceiveMMSAdverts";
-#endif
-
-
-    TBool anonymous_Status;
-    TBool mmsAdverts_Status;
-    dptr_mmsSettings->advanceMmsSettings(mode,
-                                         retrieval,
-                                         anonymous_Status,
-                                         mmsAdverts_Status);
-
-    anonymousStatus = (bool) anonymous_Status;
-    mmsAdvertsStatus = (bool) mmsAdverts_Status;
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit setReceiveMMSAdverts " << mode << " " << retrieval << " "
-            << anonymousStatus << " " << mmsAdvertsStatus;
-#endif
-
-}
-
-/**
- * get all the MMs access points
- * @param returns all the access point names
- * @attention to be displayed as per the index o to total count
- */
-void MsgSettingEngine::allMMsAcessPoints(QStringList& nameList,
-                                         int& defaultIndex)
-{
-#ifdef _DEBUG_TRACES_
-    qDebug() << "MsgSettingEngine::allMMsAcessPoints";
-#endif
-
-
-    RPointerArray<HBufC> accessPoints;
-    //= new(ELeave)RPointerArray<HBufC>();
-
-    dptr_mmsSettings->getAllAccessPoints(accessPoints, defaultIndex);
-
-    for (int i = 0; i < accessPoints.Count(); i++)
-        {
-        HBufC* name = static_cast<HBufC *> (accessPoints[i]);
-        QString qName = S60QConversions::s60DescToQString(name->Des());
-        nameList.append(qName);
-#ifdef _DEBUG_TRACES_
-        qDebug() << "\n " << qName;
-#endif
-
-        }
-    accessPoints.ResetAndDestroy();
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit allMMsAcessPoints count = " << nameList.count()
-            << " Default:" << defaultIndex;
-#endif
-
-}
-
-/**
- * set the default access point
- * @param index specifying the index
- */
-void MsgSettingEngine::setMMSAccesspoint(int index)
-{
-#ifdef _DEBUG_TRACES_
-    qDebug() << "MsgSettingEngine::setMMSAccesspoint " << index;
-#endif
-
-
-    dptr_mmsSettings->setMMSAccesspoint(index);
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit setMMSAccesspoint ";
-#endif
-
-}
-
-/**
- * get the list of all SMS Message Centres
- * @param list of all names QString
- */
-void MsgSettingEngine::allSMSMessageCenter(QStringList& nameList,
-                                           int& defaultIndex)
-{
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "MsgSettingEngine::allSMSMessageCenter";
-#endif
-
-
-    RPointerArray<HBufC> accessPoints;
-
-    dptr_smsSettings->getAllSMSMessageCenter(accessPoints, defaultIndex);
-
-    for (int i = 0; i < accessPoints.Count(); i++)
-        {
-        HBufC* name = accessPoints[i];
-        QString qName = S60QConversions::s60DescToQString(name->Des());
-        nameList.append(qName);
-#ifdef _DEBUG_TRACES_
-        qDebug() << "\n qName";
-#endif
-
-        }
-    accessPoints.ResetAndDestroy();
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit allSMSMessageCenter count = " << nameList.count()
-            << " Default:" << defaultIndex;
-#endif
-
-}
-
-/**
- * set the default SMS message centre
- * @param index specifying default index
- */
-void MsgSettingEngine::setSMSMessageCenter(int index)
-{
-#ifdef _DEBUG_TRACES_
-    qDebug() << "MsgSettingEngine::setSMSMessageCenter " << index;
-#endif
-
-
-    dptr_smsSettings->setSMSMessageCenter(index);
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit setSMSMessageCenter ";
-#endif
-
-}
-
-/**
- * for editing the SMS messafe Centre
- * @param name specifying center name
- * @param number specifying center number
- * @param index specying index of message list
- */
-void MsgSettingEngine::editSmsMessageCenter(QString& centreName,
-                                            QString& centreNumber, int index)
-{
-#ifdef _DEBUG_TRACES_
-    qDebug() << "MsgSettingEngine::editSmsMessageCenter " << index << " "
-            << centreName << " " << centreNumber;
-#endif
-
-    HBufC* d_addr = S60QConversions::qStringToS60Desc(centreNumber);
-    HBufC* d_name = S60QConversions::qStringToS60Desc(centreName);
-
-    dptr_smsSettings->editSMSServiceCentre(d_addr, d_name, index);
-    delete d_addr;
-    delete d_name;
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit editSmsMessageCenter ";
-#endif
-
-}
-
-/**
- * for add new sms message centre
- * @param name specifying center name
- * @param number specifying center number
- */
-void MsgSettingEngine::addSmsMessageCenter(QString& centreName,
-                                           QString& centreNumber)
-{
-#ifdef _DEBUG_TRACES_
-    qDebug() << "MsgSettingEngine::addSmsMessageCenter " << centreName << " "
-            << centreNumber;
-#endif
-
-
-    HBufC* d_addr = S60QConversions::qStringToS60Desc(centreNumber);
-    HBufC* d_name = S60QConversions::qStringToS60Desc(centreName);
-
-    dptr_smsSettings->addSmsMessageCenter(d_addr, d_name);
-    delete d_addr;
-    delete d_name;
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit addSmsMessageCenter ";
-#endif
-
-}
-
-/**
- * get the sms message centre namd and number
- * @index for which center needs
- * @param return name specifying center name
- * @param return number specifying center number
- */
-void MsgSettingEngine::smsCenterNameAndNumber(int index, QString& centreName,
-                                              QString& centreNumber)
-{
-#ifdef _DEBUG_TRACES_
-    qDebug() << "MsgSettingEngine::smsCenterNameAndNumber " << index;
-#endif
-
-
-    HBufC* d_addr;
-    HBufC* d_name;
-
-    dptr_smsSettings->smsCenterNameAndNumber(index, &d_addr, &d_name);
-
-    centreNumber = S60QConversions::s60DescToQString(d_addr->Des());
-    centreName = S60QConversions::s60DescToQString(d_name->Des());
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit smsCenterNameAndNumber " << centreNumber << " "
-            << centreName;
-#endif
-
-}
-
-/**
- * set the Sms Email gateway
- * @param gateway string
- */
-void MsgSettingEngine::setEmailGateway(QString& gateway)
-{
-#ifdef _DEBUG_TRACES_
-    qDebug() << "MsgSettingEngine::setEmailGateway " << gateway;
-#endif
-
-
-    HBufC* d_gateway = S60QConversions::qStringToS60Desc(gateway);
-
-    dptr_smsSettings->setEmailGateway(d_gateway);
-    delete d_gateway;
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit setEmailGateway ";
-#endif
-
-}
-
-/**
- * set the sms Email Service centre number
- * @param centre number
- */
-void MsgSettingEngine::setEmailSeriveCenterNumber(QString& centerNumber)
-{
-#ifdef _DEBUG_TRACES_
-    qDebug() << "MsgSettingEngine::setEmailSeriveCenterNumber " << centerNumber;
-
-#endif
-
-    HBufC* d_number = S60QConversions::qStringToS60Desc(centerNumber);
-
-    dptr_smsSettings->setEmailSeriveCenterNumber(d_number);
-    delete d_number;
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit setEmailSeriveCenterNumber ";
-#endif
-
-}
-
-/**
- * get the sms email gateway and 
- * service centre number
- * @param gateway return email gateway
- * @param centreNumber return service number 
- */
-void MsgSettingEngine::emailEmailGatewayAndServiceCenterNumber(QString& gateway,
-                                                               QString& serviceNumber)
-{
-#ifdef _DEBUG_TRACES_
-    qDebug() << "MsgSettingEngine::emailEmailGatewayAndServiceCenterNumber";
-#endif
-
-
-    HBufC* d_gateway;
-    HBufC* d_number;
-
-    dptr_smsSettings->emailEmailGatewayAndServiceCenterNumber(&d_gateway,
-                                                              &d_number);
-
-    gateway = S60QConversions::s60DescToQString(d_gateway->Des());
-    serviceNumber = S60QConversions::s60DescToQString(d_number->Des());
-
-    delete d_gateway;
-    delete d_number;
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit smsCenterNameAndNumber " << gateway << " "
-            << serviceNumber;
-#endif
-
-}
-//eof
-
--- a/messagingapp/msgsettings/msgsettingsmw/src/msgsettingsutil.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:  This provides the messaging mw interface for sms 
- *
- */
-
-#include <centralrepository.h>          // CRepository
-#include <MessagingInternalCRKeys.h>    // Keys
-#include "debugtraces.h"
-
-
-#include "msgsettingsutil.h"
-
-// read settings of email from CRE
-TInt MsgSettingsUtil::ReadEmailOverSmsSettingsL(
-                                                TDes& aSmsc, 
-                                                TDes& aDestinationAddress)
-{
-#ifdef _DEBUG_TRACES_
-    qDebug() << "MsgSettingsUtil::ReadEmailOverSmsSettingsL";
-#endif
-
-    
-    // Create storage
-    CRepository* storage = CRepository::NewLC( KCRUidSmum );
-    
-    storage->Get( KSumEmailSC, aSmsc );
-    storage->Get( KSumEmailGateway, aDestinationAddress );
-    
-    TBool modifiable = EFalse;
-    storage->Get( KSumEmailModifiable, modifiable );
-    CleanupStack::PopAndDestroy(); // storage
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit MsgSettingsUtil::ReadEmailOverSmsSettingsL";
-#endif
-
-    
-    return KErrNone;
-}
-
-
-//write email settings into CRE file
-void MsgSettingsUtil::WriteEmailGatewayOverSmsSettingsL(
-                             const TDes& aDestinationAddress,
-                             const TBool& aModifiable)
-{   
-#ifdef _DEBUG_TRACES_
-    qDebug() << "MsgSettingsUtil::WriteEmailGatewayOverSmsSettingsL";
-#endif
-
-        
-    // Create storage
-    CRepository* storage = CRepository::NewLC( KCRUidSmum );
-    
-    storage->Set( KSumEmailGateway, aDestinationAddress );
-    storage->Set( KSumEmailModifiable, aModifiable );
-    
-    CleanupStack::PopAndDestroy(); // storage
-    
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit MsgSettingsUtil::WriteEmailGatewayOverSmsSettingsL";
-#endif
-
-    return;
-}
-
-//write email settings into CRE file
-void MsgSettingsUtil::WriteEmailServiceNumberOverSmsSettingsL(
-                              const TDes& aSmsc,
-                              const TBool& aModifiable)
-{
-#ifdef _DEBUG_TRACES_
-    qDebug() << "MsgSettingsUtil::WriteEmailServiceNumberOverSmsSettingsL";
-#endif
-
-    
-    // Create storage
-    CRepository* storage = CRepository::NewLC( KCRUidSmum );
-    
-    storage->Set( KSumEmailSC, aSmsc );
-    storage->Set( KSumEmailModifiable, aModifiable );
-    
-    CleanupStack::PopAndDestroy(); // storage
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit MsgSettingsUtil::WriteEmailServiceNumberOverSmsSettingsL";
-#endif
-
-    return;
-
-}
-
-//eof
--- a/messagingapp/msgsettings/msgsettingsmw/src/smssettingsprivate.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,397 +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:  This provides the messaging mw interface for sms 
- *
- */
-
-#include <commdb.h>
-#include <commdbconnpref.h>
-#include <msvapi.h>
-#include <msvstd.h>
-#include <msvuids.h>
-#include <csmsaccount.h>
-#include <smutset.h>
-#include "debugtraces.h"
-
-
-#include "smssettingsprivate.h"
-#include "msgsettingsutil.h"
-
-
-const TInt KUniSmsSCStringLength = 50;
-
-/**
- * Message Server session event handler 
- */
-class CObserver : public MMsvSessionObserver
-{
-public:
-    void HandleSessionEvent(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/,
-                            TAny* /*aArg2*/, TAny* /*aArg3*/)
-    {
-    }
-
-    void HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/,
-                             TAny* /*aArg2*/, TAny* /*aArg3*/)
-    {
-    }
-};
-
-//two phase constructor
-SmsSettingsPrivate* SmsSettingsPrivate::NewL()
-{
-    SmsSettingsPrivate* self = new (ELeave) SmsSettingsPrivate();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;
-}
-
-//2nd phase constructor
-void SmsSettingsPrivate::ConstructL()
-{
-    createRepositoryL();
-}
-
-//---------------------------------------------------------------
-// SmsSettingsPrivate::SmsSettingsPrivate
-// @see header
-//---------------------------------------------------------------
-SmsSettingsPrivate::SmsSettingsPrivate()
-{
-    //do nothing
-}
-
-//---------------------------------------------------------------
-// SmsSettingsPrivate::~SmsSettingsPrivate
-// @see header
-//---------------------------------------------------------------
-SmsSettingsPrivate::~SmsSettingsPrivate()
-{
-    //do nothing
-}
-
-//---------------------------------------------------------------
-// SmsSettingsPrivate::createRepository
-// @see header
-//---------------------------------------------------------------
-void SmsSettingsPrivate::createRepositoryL()
-{
-    CObserver* pObserver = new (ELeave) CObserver();
-    CleanupStack::PushL(pObserver);
-
-    TMsvSelectionOrdering ordering;
-    CMsvSession* iMsvSession = CMsvSession::OpenSyncL(*pObserver);
-    CleanupStack::PushL(iMsvSession);
-    CMsvEntry* root = CMsvEntry::NewL(*iMsvSession,
-                                      KMsvRootIndexEntryId,
-                                      ordering);
-    CleanupStack::PushL(root);
-
-    //then do not create a new entry
-    TMsvId firstId;
-    TRAPD(err, TSmsUtilities::ServiceIdL(*root,firstId));
-    if (err == KErrNotFound)
-    {
-        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);
-		}
-		
-        //create a dummy entry
-    CSmsAccount* smsAccount = CSmsAccount::NewLC();
-
-    CSmsSettings* smsSettings = CSmsSettings::NewLC();
-
-    smsAccount->LoadSettingsL(*smsSettings);
-    smsSettings->SetValidityPeriod(ESmsVPMaximum);
-    smsSettings->SetReplyQuoted(ETrue);
-    smsSettings->SetRejectDuplicate(ETrue);
-    smsSettings->SetDelivery(ESmsDeliveryImmediately);
-    smsSettings->SetDeliveryReport(EFalse);
-    smsSettings->SetReplyPath(EFalse);
-    smsSettings->SetMessageConversion((TSmsPIDConversion) 0);
-    smsSettings->SetCanConcatenate(ETrue);
-    smsSettings->SetCharacterSet(TSmsDataCodingScheme::ESmsAlphabet7Bit);
-    smsSettings->SetValidityPeriodFormat(TSmsFirstOctet::ESmsVPFInteger);
-    smsSettings->SetStatusReportHandling(CSmsSettings::EMoveReportToInboxVisible);
-    smsSettings->SetSpecialMessageHandling(CSmsSettings::EMoveReportToInboxVisible);
-    smsSettings->SetSmsBearer((CSmsSettings::TMobileSmsBearer) 3);
-    smsSettings->SetCommDbAction(CSmsSettings::EStoreToCommDb);
-    smsSettings->SetSmsBearerAction(CSmsSettings::EStoreToCommDb);
-
-    smsAccount->SaveSettingsL(*smsSettings);
-
-    CleanupStack::PopAndDestroy(2);
-   	CleanupStack::PopAndDestroy(3);
-}
-
-void SmsSettingsPrivate::setDeliveryReport(TBool report)
-{
-    CSmsAccount* smsAccount = CSmsAccount::NewLC();
-    CSmsSettings* smsSettings = CSmsSettings::NewLC();
-
-    smsAccount->LoadSettingsL(*smsSettings);
-
-    smsSettings->SetDeliveryReport(report);
-
-    smsAccount->SaveSettingsL(*smsSettings);
-
-    CleanupStack::PopAndDestroy(2);
-}
-
-void SmsSettingsPrivate::setCharacterEncoding(TBool status)
-{
-    CSmsAccount* smsAccount = CSmsAccount::NewLC();
-    CSmsSettings* smsSettings = CSmsSettings::NewLC();
-
-    smsAccount->LoadSettingsL(*smsSettings);
-
-    if (status == EFalse)
-    {
-        smsSettings->SetCharacterSet(TSmsDataCodingScheme::ESmsAlphabet7Bit);
-    }
-    else
-    {
-        smsSettings->SetCharacterSet(TSmsDataCodingScheme::ESmsAlphabetUCS2);
-    }
-
-    smsAccount->SaveSettingsL(*smsSettings);
-
-    CleanupStack::PopAndDestroy(2);
-}
-
-void SmsSettingsPrivate::settingsDeliverReportAndCharEncoding(
-                                                              TBool& report,
-                                                              TBool& statusEncoding)
-{
-    CSmsAccount* smsAccount = CSmsAccount::NewLC();
-    CSmsSettings* smsSettings = CSmsSettings::NewLC();
-
-    smsAccount->LoadSettingsL(*smsSettings);
-
-    report = smsSettings->DeliveryReport();
-
-    TSmsDataCodingScheme::TSmsAlphabet charSet = smsSettings->CharacterSet();
-
-    statusEncoding = ETrue;
-    if (charSet == TSmsDataCodingScheme::ESmsAlphabet7Bit)
-    {
-        statusEncoding = EFalse;
-    }
-    CleanupStack::PopAndDestroy(2);
-}
-
-void SmsSettingsPrivate::getAllSMSMessageCenter(
-                                                RPointerArray<HBufC>& accessPoints,
-                                                TInt &defaultIndex)
-{
-    CSmsAccount* smsAccount = CSmsAccount::NewLC();
-    CSmsSettings* settings = CSmsSettings::NewLC();
-
-    smsAccount->LoadSettingsL(*settings);
-
-    //save the default index
-    defaultIndex = settings->DefaultServiceCenter();
-
-    int totalSMSc = settings->ServiceCenterCount();
-    for (int index = 0; index < totalSMSc; index++)
-    {
-        TPtrC16 name = settings->GetServiceCenter(index).Name();
-        HBufC* accessName = name.AllocL();
-        accessPoints.AppendL(accessName);
-    }
-
-    CleanupStack::PopAndDestroy(2);
-
-    return;
-}
-
-void SmsSettingsPrivate::setSMSMessageCenter(int index)
-{
-    CSmsAccount* smsAccount = CSmsAccount::NewLC();
-    CSmsSettings* smsSettings = CSmsSettings::NewLC();
-
-    smsAccount->LoadSettingsL(*smsSettings);
-    smsSettings->SetDefaultServiceCenter(index);
-    smsAccount->SaveSettingsL(*smsSettings);
-
-    CleanupStack::PopAndDestroy(2);
-}
-
-void SmsSettingsPrivate::editSMSServiceCentre(HBufC* address, HBufC* name,
-                                              TInt index)
-{
-    CSmsAccount* smsAccount = CSmsAccount::NewLC();
-    CSmsSettings* smsSettings = CSmsSettings::NewLC();
-
-    smsAccount->LoadSettingsL(*smsSettings);
-
-    TInt indexDefault = smsSettings->DefaultServiceCenter();
-    bool flag = false;
-    if (index == indexDefault)
-    {
-        flag = true;
-    }
-
-    //remove the service center
-    smsSettings->RemoveServiceCenter(index);
-    //add a new service center
-    smsSettings->AddServiceCenterL(name->Des(), address->Des());
-
-    if (flag == true)
-    {
-        smsSettings->SetDefaultServiceCenter(smsSettings->ServiceCenterCount()
-                - 1);
-    }
-    smsAccount->SaveSettingsL(*smsSettings);
-
-    CleanupStack::PopAndDestroy(2);
-}
-
-void SmsSettingsPrivate::addSmsMessageCenter(HBufC* address, HBufC* name)
-{
-    CSmsAccount* smsAccount = CSmsAccount::NewLC();
-    CSmsSettings* smsSettings = CSmsSettings::NewLC();
-
-    smsAccount->LoadSettingsL(*smsSettings);
-    smsSettings->AddServiceCenterL(name->Des(), address->Des());
-    smsAccount->SaveSettingsL(*smsSettings);
-
-    CleanupStack::PopAndDestroy(2);
-}
-
-void SmsSettingsPrivate::smsCenterNameAndNumber(int index,
-                                                HBufC** centerNumber,
-                                                HBufC** centerName)
-{
-    CSmsAccount* smsAccount = CSmsAccount::NewLC();
-    CSmsSettings* smsSettings = CSmsSettings::NewLC();
-
-    smsAccount->LoadSettingsL(*smsSettings);
-
-    TPtrC16 addr = smsSettings->GetServiceCenter(index).Address();
-    TPtrC16 name = smsSettings->GetServiceCenter(index).Name();
-
-    (*centerNumber) = addr.AllocL();
-    (*centerName) = name.AllocL();
-
-    CleanupStack::PopAndDestroy(2);
-}
-
-void SmsSettingsPrivate::setEmailGateway(HBufC* emailGateway)
-{
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Enter SmsSettingsPrivate::setEmailGateway" << emailGateway;
-#endif
-
-    
-    TBuf<KUniSmsSCStringLength> emailGateWayNumber;
-    
-    MsgSettingsUtil::WriteEmailGatewayOverSmsSettingsL( 
-                             emailGateway->Des(),
-                             ETrue );
-    
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit SmsSettingsPrivate::setEmailGateway";
-#endif
-
-    return;
-}
-
-void SmsSettingsPrivate::setEmailSeriveCenterNumber(HBufC* emailNumber)
-{
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Enter SmsSettingsPrivate::setEmailSeriveCenterNumber"
-            << emailNumber;
-#endif
-
-    
-    MsgSettingsUtil::WriteEmailServiceNumberOverSmsSettingsL(emailNumber->Des(),
-                                                             ETrue );
-    
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Enter SmsSettingsPrivate::setEmailSeriveCenterNumber";
-#endif
-
-    return;
-}
-
-void SmsSettingsPrivate::emailEmailGatewayAndServiceCenterNumber(
-                                                  HBufC** emailGateway,
-                                                  HBufC** serviceNumber)
-{
-#ifdef _DEBUG_TRACES_
-    qDebug()
-            << "Enter SmsSettingsPrivate::emailEmailGatewayAndServiceCenterNumber";
-#endif
-
-    CSmsAccount* smsAccount = CSmsAccount::NewLC();
-    CSmsSettings* smsSettings = CSmsSettings::NewLC();
-
-    smsAccount->LoadSettingsL(*smsSettings);
-
-    TBuf<KUniSmsSCStringLength> emailSmscNumber;
-    TBuf<KUniSmsSCStringLength> emailGateWayNumber;
-
-    TInt readResult = MsgSettingsUtil::ReadEmailOverSmsSettingsL(emailSmscNumber,
-                                               emailGateWayNumber);
-    if (KErrNone == readResult)
-    {
-        // In any otther case we need to show the conf pop-up window
-        if (emailSmscNumber == KNullDesC)
-        {
-            if (smsSettings->DefaultServiceCenter() > 0)
-            {
-                emailSmscNumber = smsSettings->GetServiceCenter(
-                             smsSettings->DefaultServiceCenter()).Address();
-            }
-            else
-            {
-                int totalSMSc = smsSettings->ServiceCenterCount();
-                if (totalSMSc > 0)
-                {
-                    emailSmscNumber
-                        = smsSettings->GetServiceCenter(0).Address();
-                }
-            }
-        }
-    }
-    
-    MsgSettingsUtil::WriteEmailServiceNumberOverSmsSettingsL(
-                                                             emailSmscNumber,
-                                                             ETrue);
-    
-    *emailGateway = emailGateWayNumber.AllocL();
-    *serviceNumber = emailSmscNumber.AllocL();
-    
-    CleanupStack::PopAndDestroy(2); //smssetting and smsaccount
-    
-#ifdef _DEBUG_TRACES_
-    qDebug()
-            << "Enter SmsSettingsPrivate::emailEmailGatewayAndServiceCenterNumber"
-            << serviceNumber << " " << emailGateway;
-#endif
-
-    
-}
-
-//eof
--- a/messagingapp/msgsettings/msgsettingsmw/stub_sis/msgsettingsmw_stub.pkg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description: 
-;
-; Languages
-&EN
-
-; Header
-#{"msgsettingsmw"}, (0x20026F49), 1, 0, 0, TYPE = SA
-
-; Localised Vendor name
-%{"Nokia"}
-
-; Unique Vendor name
-:"Nokia"
\ No newline at end of file
Binary file messagingapp/msgsettings/msgsettingsmw/stub_sis/msgsettingsmw_stub.sis has changed
--- a/messagingapp/msgsettings/msgsettingsmw/tsrc/ut/bwins/t_msgsettingsmwu.def	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-EXPORTS
-	?staticMetaObject@TestMsgSettingEngine@@2UQMetaObject@@B @ 1 NONAME ; struct QMetaObject const TestMsgSettingEngine::staticMetaObject
-	?TestsettingsDeliverReportAndCharEncoding@TestMsgSettingEngine@@AAEXXZ @ 2 NONAME ; void TestMsgSettingEngine::TestsettingsDeliverReportAndCharEncoding(void)
-	?TestaddSmsMessageCenter@TestMsgSettingEngine@@AAEXXZ @ 3 NONAME ; void TestMsgSettingEngine::TestaddSmsMessageCenter(void)
-	?tr@TestMsgSettingEngine@@SA?AVQString@@PBD0H@Z @ 4 NONAME ; class QString TestMsgSettingEngine::tr(char const *, char const *, int)
-	?TestsetAnonymousMessages@TestMsgSettingEngine@@AAEXXZ @ 5 NONAME ; void TestMsgSettingEngine::TestsetAnonymousMessages(void)
-	?TestallSMSMessageCenter@TestMsgSettingEngine@@AAEXXZ @ 6 NONAME ; void TestMsgSettingEngine::TestallSMSMessageCenter(void)
-	?TestsetReceiveMMSAdverts@TestMsgSettingEngine@@AAEXXZ @ 7 NONAME ; void TestMsgSettingEngine::TestsetReceiveMMSAdverts(void)
-	?TestsetEmailSeriveCenterNumber@TestMsgSettingEngine@@AAEXXZ @ 8 NONAME ; void TestMsgSettingEngine::TestsetEmailSeriveCenterNumber(void)
-	?TestsetMMSCreationmode@TestMsgSettingEngine@@AAEXXZ @ 9 NONAME ; void TestMsgSettingEngine::TestsetMMSCreationmode(void)
-	?TestemailEmailGatewayAndServiceCenterNumber@TestMsgSettingEngine@@AAEXXZ @ 10 NONAME ; void TestMsgSettingEngine::TestemailEmailGatewayAndServiceCenterNumber(void)
-	?trUtf8@TestMsgSettingEngine@@SA?AVQString@@PBD0H@Z @ 11 NONAME ; class QString TestMsgSettingEngine::trUtf8(char const *, char const *, int)
-	?TestallMMsAcessPoints@TestMsgSettingEngine@@AAEXXZ @ 12 NONAME ; void TestMsgSettingEngine::TestallMMsAcessPoints(void)
-	?qt_metacast@TestMsgSettingEngine@@UAEPAXPBD@Z @ 13 NONAME ; void * TestMsgSettingEngine::qt_metacast(char const *)
-	?TestsmsCenterNameAndNumber@TestMsgSettingEngine@@AAEXXZ @ 14 NONAME ; void TestMsgSettingEngine::TestsmsCenterNameAndNumber(void)
-	?TestvalidityPeriod@TestMsgSettingEngine@@AAEXXZ @ 15 NONAME ; void TestMsgSettingEngine::TestvalidityPeriod(void)
-	?TestsetDeliveryReport@TestMsgSettingEngine@@AAEXXZ @ 16 NONAME ; void TestMsgSettingEngine::TestsetDeliveryReport(void)
-	?TestsetSMSMessageCenter@TestMsgSettingEngine@@AAEXXZ @ 17 NONAME ; void TestMsgSettingEngine::TestsetSMSMessageCenter(void)
-	?TestsetValidityPeriod@TestMsgSettingEngine@@AAEXXZ @ 18 NONAME ; void TestMsgSettingEngine::TestsetValidityPeriod(void)
-	?TestsetMMSAccesspoint@TestMsgSettingEngine@@AAEXXZ @ 19 NONAME ; void TestMsgSettingEngine::TestsetMMSAccesspoint(void)
-	?trUtf8@TestMsgSettingEngine@@SA?AVQString@@PBD0@Z @ 20 NONAME ; class QString TestMsgSettingEngine::trUtf8(char const *, char const *)
-	?tr@TestMsgSettingEngine@@SA?AVQString@@PBD0@Z @ 21 NONAME ; class QString TestMsgSettingEngine::tr(char const *, char const *)
-	?TestsetCharacterEncoding@TestMsgSettingEngine@@AAEXXZ @ 22 NONAME ; void TestMsgSettingEngine::TestsetCharacterEncoding(void)
-	?metaObject@TestMsgSettingEngine@@UBEPBUQMetaObject@@XZ @ 23 NONAME ; struct QMetaObject const * TestMsgSettingEngine::metaObject(void) const
-	?getStaticMetaObject@TestMsgSettingEngine@@SAABUQMetaObject@@XZ @ 24 NONAME ; struct QMetaObject const & TestMsgSettingEngine::getStaticMetaObject(void)
-	?cleanupTestCase@TestMsgSettingEngine@@AAEXXZ @ 25 NONAME ; void TestMsgSettingEngine::cleanupTestCase(void)
-	?qt_metacall@TestMsgSettingEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 26 NONAME ; int TestMsgSettingEngine::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?TesteditSmsMessageCenter@TestMsgSettingEngine@@AAEXXZ @ 27 NONAME ; void TestMsgSettingEngine::TesteditSmsMessageCenter(void)
-	?TestadvanceMmsSettings@TestMsgSettingEngine@@AAEXXZ @ 28 NONAME ; void TestMsgSettingEngine::TestadvanceMmsSettings(void)
-	?TestsetEmailGateway@TestMsgSettingEngine@@AAEXXZ @ 29 NONAME ; void TestMsgSettingEngine::TestsetEmailGateway(void)
-	?TestsetMMSRetrieval@TestMsgSettingEngine@@AAEXXZ @ 30 NONAME ; void TestMsgSettingEngine::TestsetMMSRetrieval(void)
-	?initTestCase@TestMsgSettingEngine@@AAEXXZ @ 31 NONAME ; void TestMsgSettingEngine::initTestCase(void)
-
--- a/messagingapp/msgsettings/msgsettingsmw/tsrc/ut/ut_msgsettingsmw/t_msgsettingengine.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,891 +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 <QObject>
-#include <qtestcase.h>
-#include <t_msgsettingengine.h>
-#include <e32const.h>
-
-void TestMsgSettingEngine::initTestCase()
-{
-mMsgSettingEngine = new MsgSettingEngine();
-}
-
-void TestMsgSettingEngine::TestsetDeliveryReport()
-{
- mMsgSettingEngine->setDeliveryReport(ETrue);
- mMsgSettingEngine->setDeliveryReport(EFalse);
- 
- //CSmsAccount* smsAccount = CSmsAccount::NewLC();
- //smsAccount->LoadSettingsL();
- 
- 
-}
-
-void TestMsgSettingEngine::TestsetCharacterEncoding()
-{
-mMsgSettingEngine->setCharacterEncoding(MsgSettingEngine::FullSupport);
-mMsgSettingEngine->setCharacterEncoding(MsgSettingEngine::ReducedSupport);
-}
-
-void TestMsgSettingEngine::TestsettingsDeliverReportAndCharEncoding()
-{
-bool report=ETrue;
-MsgSettingEngine::CharacterEncoding encoding;
-encoding = MsgSettingEngine::FullSupport;
-
-mMsgSettingEngine->setDeliveryReport(report);
-mMsgSettingEngine->setCharacterEncoding(MsgSettingEngine::FullSupport);
-mMsgSettingEngine->settingsDeliverReportAndCharEncoding(report,encoding);
-
-encoding = MsgSettingEngine::ReducedSupport;
-mMsgSettingEngine->setCharacterEncoding(MsgSettingEngine::ReducedSupport);
-mMsgSettingEngine->settingsDeliverReportAndCharEncoding(report,encoding);
-
-report=EFalse;
-mMsgSettingEngine->setDeliveryReport(report);
-mMsgSettingEngine->setCharacterEncoding(MsgSettingEngine::ReducedSupport);
-mMsgSettingEngine->settingsDeliverReportAndCharEncoding(report,encoding);
-
-encoding = MsgSettingEngine::FullSupport;
-mMsgSettingEngine->setCharacterEncoding(MsgSettingEngine::ReducedSupport);
-mMsgSettingEngine->settingsDeliverReportAndCharEncoding(report,encoding);
-
-}
-
-void TestMsgSettingEngine::TestsetMMSCreationmode()
-{
-MsgSettingEngine::MmsCreationMode mode;
-
-mode = MsgSettingEngine::Restricted;
-mMsgSettingEngine->setMMSCreationmode(mode);
-
-mode = MsgSettingEngine::Guided;
-mMsgSettingEngine->setMMSCreationmode(mode);
-
-mode = MsgSettingEngine::Free;
-mMsgSettingEngine->setMMSCreationmode(mode);
-}
-
-void TestMsgSettingEngine::TestsetMMSRetrieval()
-{
-
-MsgSettingEngine::MmsRetrieval retrieval;
-retrieval = MsgSettingEngine::AlwaysAutomatic;
-mMsgSettingEngine->setMMSRetrieval(retrieval);
-
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->setMMSRetrieval(retrieval);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->setMMSRetrieval(retrieval);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->setMMSRetrieval(retrieval);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->setMMSRetrieval(retrieval);
-}
-
-void TestMsgSettingEngine::TestsetAnonymousMessages()
-{
-mMsgSettingEngine->setAnonymousMessages(ETrue);
-mMsgSettingEngine->setAnonymousMessages(EFalse);
- 
-}
-
-void TestMsgSettingEngine::TestsetReceiveMMSAdverts()
-{
-mMsgSettingEngine->setReceiveMMSAdverts(ETrue);     
-mMsgSettingEngine->setReceiveMMSAdverts(EFalse);
-}
-
-void TestMsgSettingEngine::TestadvanceMmsSettings()
-{
-
-MsgSettingEngine::MmsCreationMode mmsMode;
-MsgSettingEngine::MmsCreationMode mode;
-MsgSettingEngine::MmsRetrieval retrieval;      
-
-bool anonymous_Status;
-bool mmsAdverts_Status;
-
-mmsMode = MsgSettingEngine::Restricted;
-mMsgSettingEngine->setMMSCreationmode(mmsMode);
-
-mode = MsgSettingEngine::Restricted;
-retrieval = MsgSettingEngine::AlwaysAutomatic;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Free;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mmsMode = MsgSettingEngine::Free;
-mMsgSettingEngine->setMMSCreationmode(mmsMode);
-
-mode = MsgSettingEngine::Restricted;
-retrieval = MsgSettingEngine::AlwaysAutomatic;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Free;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mmsMode = MsgSettingEngine::Free;
-mMsgSettingEngine->setMMSCreationmode(mmsMode);
-
-mode = MsgSettingEngine::Restricted;
-retrieval = MsgSettingEngine::AlwaysAutomatic;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Free;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-
-MsgSettingEngine::MmsRetrieval mmsRetrieval;
-mmsRetrieval = MsgSettingEngine::AlwaysAutomatic;
-mMsgSettingEngine->setMMSRetrieval(mmsRetrieval);
-
-mmsMode = MsgSettingEngine::Restricted;
-mMsgSettingEngine->setMMSCreationmode(mmsMode);
-
-mode = MsgSettingEngine::Restricted;
-retrieval = MsgSettingEngine::AlwaysAutomatic;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Free;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-
-mmsMode = MsgSettingEngine::Free;
-mMsgSettingEngine->setMMSCreationmode(mmsMode);
-
-mode = MsgSettingEngine::Restricted;
-retrieval = MsgSettingEngine::AlwaysAutomatic;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Free;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mmsMode = MsgSettingEngine::Free;
-mMsgSettingEngine->setMMSCreationmode(mmsMode);
-
-mode = MsgSettingEngine::Restricted;
-retrieval = MsgSettingEngine::AlwaysAutomatic;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Free;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-
-mmsRetrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->setMMSRetrieval(mmsRetrieval);
-mmsMode = MsgSettingEngine::Restricted;
-mMsgSettingEngine->setMMSCreationmode(mmsMode);
-
-mode = MsgSettingEngine::Restricted;
-retrieval = MsgSettingEngine::AlwaysAutomatic;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Free;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-
-mmsMode = MsgSettingEngine::Free;
-mMsgSettingEngine->setMMSCreationmode(mmsMode);
-
-mode = MsgSettingEngine::Restricted;
-retrieval = MsgSettingEngine::AlwaysAutomatic;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Free;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mmsMode = MsgSettingEngine::Free;
-mMsgSettingEngine->setMMSCreationmode(mmsMode);
-
-mode = MsgSettingEngine::Restricted;
-retrieval = MsgSettingEngine::AlwaysAutomatic;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Free;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-
-mmsRetrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->setMMSRetrieval(mmsRetrieval);
-mmsMode = MsgSettingEngine::Restricted;
-mMsgSettingEngine->setMMSCreationmode(mmsMode);
-
-mode = MsgSettingEngine::Restricted;
-retrieval = MsgSettingEngine::AlwaysAutomatic;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Free;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-
-mmsMode = MsgSettingEngine::Free;
-mMsgSettingEngine->setMMSCreationmode(mmsMode);
-
-mode = MsgSettingEngine::Restricted;
-retrieval = MsgSettingEngine::AlwaysAutomatic;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Free;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mmsMode = MsgSettingEngine::Free;
-mMsgSettingEngine->setMMSCreationmode(mmsMode);
-
-mode = MsgSettingEngine::Restricted;
-retrieval = MsgSettingEngine::AlwaysAutomatic;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Free;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-
-mmsRetrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->setMMSRetrieval(mmsRetrieval);
-mmsMode = MsgSettingEngine::Restricted;
-mMsgSettingEngine->setMMSCreationmode(mmsMode);
-
-mode = MsgSettingEngine::Restricted;
-retrieval = MsgSettingEngine::AlwaysAutomatic;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Free;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-
-mmsMode = MsgSettingEngine::Free;
-mMsgSettingEngine->setMMSCreationmode(mmsMode);
-
-mode = MsgSettingEngine::Restricted;
-retrieval = MsgSettingEngine::AlwaysAutomatic;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Free;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mmsMode = MsgSettingEngine::Free;
-mMsgSettingEngine->setMMSCreationmode(mmsMode);
-
-mode = MsgSettingEngine::Restricted;
-retrieval = MsgSettingEngine::AlwaysAutomatic;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Free;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mmsRetrieval = MsgSettingEngine::No;
-mMsgSettingEngine->setMMSRetrieval(mmsRetrieval);
-mmsMode = MsgSettingEngine::Restricted;
-mMsgSettingEngine->setMMSCreationmode(mmsMode);
-
-mode = MsgSettingEngine::Restricted;
-retrieval = MsgSettingEngine::AlwaysAutomatic;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Free;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-
-mmsMode = MsgSettingEngine::Free;
-mMsgSettingEngine->setMMSCreationmode(mmsMode);
-
-mode = MsgSettingEngine::Restricted;
-retrieval = MsgSettingEngine::AlwaysAutomatic;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Free;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mmsMode = MsgSettingEngine::Free;
-mMsgSettingEngine->setMMSCreationmode(mmsMode);
-
-mode = MsgSettingEngine::Restricted;
-retrieval = MsgSettingEngine::AlwaysAutomatic;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Free;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mmsMode = MsgSettingEngine::Free;
-mMsgSettingEngine->setMMSCreationmode(mmsMode);
-
-mode = MsgSettingEngine::Restricted;
-retrieval = MsgSettingEngine::AlwaysAutomatic;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Guided;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-mode = MsgSettingEngine::Free;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::AutomInHomeNetwork;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Maual;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::Off;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-retrieval = MsgSettingEngine::No;
-mMsgSettingEngine->advanceMmsSettings(mode,retrieval,anonymous_Status,mmsAdverts_Status);
-
-
-
-}
-
-void TestMsgSettingEngine::TestallMMsAcessPoints()
-{
-QStringList list;
-TInt index = 0;
-mMsgSettingEngine->allMMsAcessPoints(list,index);
-
-
-
-}
-
-void TestMsgSettingEngine::TestsetMMSAccesspoint()
-{
-TInt index = 0;
-mMsgSettingEngine->setMMSAccesspoint(index);
-
-index = 1;
-mMsgSettingEngine->setMMSAccesspoint(index);
-}
-
-void TestMsgSettingEngine::TestallSMSMessageCenter()
-{
-QStringList list;
-TInt index = 0;
-mMsgSettingEngine->allSMSMessageCenter(list,index);
-}
-void TestMsgSettingEngine::TestsetSMSMessageCenter()
-{
-TInt index = 0;
-mMsgSettingEngine->setSMSMessageCenter(index);
- 
-}
-
-void TestMsgSettingEngine::TesteditSmsMessageCenter()
-{
-QString list1("text");
-QString list2("text");
-TInt index = 0;
-mMsgSettingEngine->editSmsMessageCenter(list1,list2,index);   
-
-QStringList list;
-mMsgSettingEngine->allSMSMessageCenter(list,index);
-
-mMsgSettingEngine->editSmsMessageCenter(list1,list2,index);
-
-index = 1;
-QString list3("345464");
-QString list4("ServiceCenter");
-mMsgSettingEngine->editSmsMessageCenter(list3,list4,index);
-
-
-}
-
-void TestMsgSettingEngine::TestaddSmsMessageCenter()
-{
-QString list1("text");
-QString list2("text");
-mMsgSettingEngine->addSmsMessageCenter(list1,list2);
-}
-
-void TestMsgSettingEngine::TestsmsCenterNameAndNumber()
-{
-QString list1("text");
-QString list2("text");
-TInt num = 0;
-mMsgSettingEngine->smsCenterNameAndNumber(num,list1,list2);
-}
-
-void TestMsgSettingEngine::TestsetEmailGateway()
-{
-QString list;
-mMsgSettingEngine->setEmailGateway(list);
-
-
-}
-
-void TestMsgSettingEngine::TestsetEmailSeriveCenterNumber()
-{
-QString list;
-mMsgSettingEngine->setEmailSeriveCenterNumber(list);
-}
-
-void TestMsgSettingEngine::TestemailEmailGatewayAndServiceCenterNumber()
-{
-QString list1("9239393");
-QString list2("93838339");
-//mMsgSettingEngine->emailEmailGatewayAndServiceCenterNumber(list1,list2);
-}
-
-void TestMsgSettingEngine::TestsetValidityPeriod()
-{
-/*MsgSettingEngine::ValidityPeriod period;
-period = MsgSettingEngine::OneHour;
-
-mMsgSettingEngine->setValidityPeriod(period);*/
-}
-
-void TestMsgSettingEngine::TestvalidityPeriod()
-{
-/*
-MsgSettingEngine::ValidityPeriod period;
-period=mMsgSettingEngine->validityPeriod();*/
-}
-
-void TestMsgSettingEngine::cleanupTestCase()
-{
-delete mMsgSettingEngine;
-}
--- a/messagingapp/msgsettings/msgsettingsmw/tsrc/ut/ut_msgsettingsmw/t_msgsettingengine.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#ifndef T_MESSAGESETTINGENGINE_H
-#define T_MESSAGESETTINGENGINE_H
-
-
-#ifdef BUILD_TEST_DLL
-#define TEST_EXPORT Q_DECL_EXPORT
-#else
-#define TEST_EXPORT Q_DECL_IMPORT
-#endif
-
-
-#include <QObject>
-#include "msgsettingengine.h"
-
-
-class TEST_EXPORT TestMsgSettingEngine: public QObject
-{
-    Q_OBJECT
-
-private slots:
-
-    void initTestCase();
-    
-    void TestsetDeliveryReport();
-    
-    void TestsetCharacterEncoding();
-   
-    void TestsettingsDeliverReportAndCharEncoding();
-   
-    void TestsetMMSCreationmode();
-    
-    void TestsetMMSRetrieval();
-    
-    void TestsetAnonymousMessages();
-   
-    void TestsetReceiveMMSAdverts();
-    
-    void TestadvanceMmsSettings();
-   
-    void TestallMMsAcessPoints();
-    
-    void TestsetMMSAccesspoint();
-    
-    void TestallSMSMessageCenter();
-    
-    void TestsetSMSMessageCenter();
-    
-    void TesteditSmsMessageCenter();
-    
-    void TestaddSmsMessageCenter();
-    
-    void TestsmsCenterNameAndNumber();
-    
-    void TestsetEmailGateway();
-    
-    void TestsetEmailSeriveCenterNumber();
-    
-    void TestemailEmailGatewayAndServiceCenterNumber();
-    
-    void TestsetValidityPeriod();
-    
-    void TestvalidityPeriod();    
-    
-	void cleanupTestCase();
-
-private:
-
-    MsgSettingEngine* mMsgSettingEngine;
-};
-
-#endif //T_MESSAGESETTINGENGINE_H
--- a/messagingapp/msgsettings/msgsettingsmw/tsrc/ut/ut_msgsettingsmw/t_msgsettingsmw.pro	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +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
-
-TEMPLATE = lib
-TARGET = 
-
-
-
-INCLUDEPATH += . 
-
-INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-INCLUDEPATH += ../../../inc
-
-
-
-DEFINES += BUILD_TEST_DLL 
-
-
-HEADERS += \
-					t_msgsettingengine.h
-					
-				
-
-SOURCES += \
-					 t_msgsettingengine.cpp 
-					 
-
-
-SYMBIAN_PLATFORMS = WINSCW ARMV5
-symbian {
-    TARGET.CAPABILITY = CAP_GENERAL_DLL
-    TARGET.EPOCSTACKSIZE = 0x8000
-    TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000
-    TARGET.EPOCALLOWDLLDATA = 1
-		}
-		
-LIBS+= -lmsgsettingsmw
-
--- a/messagingapp/msgsettings/msgsettingsplugin.deprecated/inc/msgadvancedsettingsform.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +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:This class is for drawing form for advanced view 
- * settings  
- *
- */
-
-#ifndef MSG_ADVANCEDSETTINGS_FORM_H_
-#define MSG_ADVANCEDSETTINGS_FORM_H_
-
-#include <hbdataform.h>
-
-class HbDataFormModelItem;
-class HbDataFormModel;
-class HbComboBox;
-class QStandardItemModel;
-class MsgSettingEngine;
-class HbLineEdit;
-
-class MsgAdvancedSettingsForm : public HbDataForm
-{
-Q_OBJECT
-public:
-    explicit MsgAdvancedSettingsForm(QGraphicsItem *parent = 0);
-
-    ~MsgAdvancedSettingsForm();
-
-signals:
-    void newSMSCCenterClicked(int);
-
-private slots:
-    void onItemActivated(const QModelIndex &index);
-    void onPressedCustomButton();
-    void changeAccessPoint(int index);
-    void onSMSCurrentIndexChanged(int index);
-    void createServiceCenterModel();
-    void changeMMSCreationMode(int index);
-    void changeMMSRetrievalMode(int index);
-    void allowAnonymousMMS();
-    void allowMMSAdverts();
-    void onLongPress(QPointF point);
-
-private:
-    void initSettingModel();
-    void initGroupPageName();
-    void addMMSGroupItem(HbDataFormModelItem* parent);
-    void addSmsMCGroupItem(HbDataFormModelItem* parent, HbDataFormModel* model);
-    void addSmsEmailGroupItem(HbDataFormModelItem* parent);
-    
-    //mms stuff
-    void activateMMSCreationMode(HbWidget* widget);
-    void activateMMSRetrievalMode(HbWidget* widget);
-    void activateMMSAnonymousMode(HbWidget* widget);
-    void activateMMSAdverts(HbWidget* widget);
-    void activateMMSAccesspoint(HbWidget* widget);
-    
-    //sms stuff
-    void activateSMSCCenterList(HbWidget* widget);
-    void activateCustomButtonListItems(HbWidget* widget, int btnIndex);
-    void updateSmsCenterModel();   
-    void fillServiceCenterModel();
-    
-    //email stuff
-    void activateEmailGateway(HbWidget* widget, HbLineEdit* &edit);
-    void activateEmailServiceCenterNo(HbWidget* widget, HbLineEdit* &edit);
-    
-public:
-    void refresh();
-    
-    /**
-     * This is for update Email fields into settings engine
-     */
-    void commitEmailChanges();
-    
-private:
-    /**
-     * different group items.
-     */
-    HbDataFormModelItem* mMMSGroup;
-    HbDataFormModelItem* mSmsMCGroup;
-    HbDataFormModelItem* mSmsEmailGroup;
-
-    /**
-     * groupitem string lists.
-     */
-    QStringList mGroupPageName;
-    QStringList mmsSettingsGroup;
-    QStringList mSmsMCSettingsGroup;
-    QStringList mSmsEmailSettingsGroup;
-
-    /**
-     * The list of smsc centers.
-     */
-    QStringList mSmsServiceList;
-
-    /**
-     * model for sms service centers.
-     */
-    QStandardItemModel* mSmsServiceCenterModel;
-
-    /**
-     * engine instance to read/write settings
-     */
-    MsgSettingEngine* mSettingEngine;
-    
-    /**
-     * sms service center combo box reference.
-     */
-    HbComboBox* mSmsCenterComboBox;
-    
-	/**
-	 * Line edit for Sms Email gateway
-	 */
-    HbLineEdit* mEditEmailGateway;
-	
-	/**
-	 * Line edit for Sms Email Service Number
-	 */
-    HbLineEdit* mEditEmailServiceNumber;
-        
-    /**
-     * default service center index.
-     */
-    int mDefaultServiceCenter;
-    
-    
-
-};
-
-#endif /* MSG_ADVANCEDSETTINGS_FORM_H_ */
--- a/messagingapp/msgsettings/msgsettingsplugin.deprecated/inc/msgadvancedsettingsview.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +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:  This class is for advanced settings view
- *
- */
-
-#ifndef MSG_ADVANCEDSETTINGS_VIEW_H_
-#define MSG_ADVANCEDSETTINGS_VIEW_H_
-
-#include <cpbasesettingview.h>
-
-class MsgAdvancedSettingsForm;
-
-class MsgAdvancedSettingsView : public CpBaseSettingView
-{
-Q_OBJECT
-public:
-    explicit MsgAdvancedSettingsView(QGraphicsItem *parent = 0);
-    ~MsgAdvancedSettingsView();
-    /**
-     * refreshes the view.
-     */
-    void refreshView();
-
-    /**
-     * This is for update Email fields into settings engine
-     */
-    void commitEmailChanges();
-    
-signals:
-    void newSMSCCenterClicked(int);
-
-private:
-    MsgAdvancedSettingsForm* mAdvancedSettingsForm;
-};
-
-#endif /* MSG_ADVANCEDSETTINGS_VIEW_H_ */
--- a/messagingapp/msgsettings/msgsettingsplugin.deprecated/inc/msgsettingsdataformcustomitem.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +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:  This class provides custom list item for the
- * DataForm
- *
- */
-
-#ifndef MSG_SETTINGS_DATAFORM_CUSTOMITEM_H
-#define MSG_SETTINGS_DATAFORM_CUSTOMITEM_H
-
-#include <hbdataformviewitem.h>
-
-class MsgSettingsDataFormCustomItem : public HbDataFormViewItem
-{
-Q_OBJECT
-
-public:
-    MsgSettingsDataFormCustomItem(QGraphicsItem *parent);
-    ~MsgSettingsDataFormCustomItem();
-
-    virtual HbAbstractViewItem* createItem();
-
-protected:
-    virtual HbWidget* createCustomWidget();
-};
-
-#endif // MSG_SETTINGS_DATAFORM_CUSTOMITEM_H
--- a/messagingapp/msgsettings/msgsettingsplugin.deprecated/inc/msgsettingsform.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +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:  This class is for first form view for msg settings  
- *
- */
-
-#ifndef MSG_SETTINGSFORM_H
-#define MSG_SETTINGSFORM_H
-
-#include <hbdataform.h>
-#include "msgsettingengine.h"
-
-class HbDataFormModelItem;
-class MsgSettingsViewManager;
-
-class MsgSettingsForm : public HbDataForm
-{
-Q_OBJECT
-public:
-    explicit MsgSettingsForm(QGraphicsItem *parent = 0);
-    ~MsgSettingsForm();
-private:
-    void initSettingModel();
-    // call these function when activated signal is emitted
-    void activateAdvanced(HbWidget *widget);
-    void activateDeliveryReports(HbWidget *widget);
-    void activateCharacterEncoding(HbWidget *widget);
-
-private slots:
-    void onItemActivated(const QModelIndex &index);
-    void onPressedAdvanced();
-    void onPressedDelReports();
-    void changeCharEncoding(int index);
-
-private:
-
-    //msg engine reference
-    MsgSettingEngine* mSettingEngine;
-    
-    //DataForm List Items
-    HbDataFormModelItem *mDeliverReports;
-    HbDataFormModelItem *mCharacterEncoding;
-    HbDataFormModelItem *mAdvancedSettings;  
-
-    //Settings View Manager
-    MsgSettingsViewManager* mSettingsViewManager;
-};
-#endif // MSG_SETTINGSFORM_H
--- a/messagingapp/msgsettings/msgsettingsplugin.deprecated/inc/msgsettingsplugin.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +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: This is for Message Settings plugin for ControlPanel
- *
- */
-
-#ifndef MSG_SETTINGS_PLUGIN_H
-#define MSG_SETTINGS_PLUGIN_H
-
-#include <cpplugininterface.h>
-class MsgSettingsPlugin : public QObject, public CpPluginInterface
-{
-Q_OBJECT
-    Q_INTERFACES(CpPluginInterface)
-public:
-    MsgSettingsPlugin();
-    ~MsgSettingsPlugin();
-    
-    virtual QList<CpSettingFormItemData*> createSettingFormItemData(CpItemDataHelper &itemDataHelper) const;
-};
-#endif // MSG_SETTINGS_PLUGIN_H
--- a/messagingapp/msgsettings/msgsettingsplugin.deprecated/inc/msgsettingsview.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +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:This is the first view for msgsettings plugin  
- *
- */
-
-#ifndef MSGSETTINGSVIEW_H
-#define MSGSETTINGSVIEW_H
-
-#include <cpbasesettingview.h>
-
-class MsgSettingsView: public CpBaseSettingView
-{
-    Q_OBJECT
-public:
-    explicit MsgSettingsView(QGraphicsItem *parent = 0);
-    ~MsgSettingsView();
-};
-#endif // MSGSETTINGSVIEW_H
--- a/messagingapp/msgsettings/msgsettingsplugin.deprecated/inc/msgsettingsviewmanager.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +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:This is the manager class for managing multiple views
- *
- */
-
-#ifndef MSGSETTINGSVIEWMANAGER_H
-#define MSGSETTINGSVIEWMANAGER_H
-
-#include <QObject>
-class MsgAdvancedSettingsView;
-class MessageCenterView;
-class MsgSMSCenterView;
-class HbAction;
-class HbView;
-
-/**
- * View manager for the messaging application. This is a singleton
- * class. Creates and activates the specified view.
- */
-class MsgSettingsViewManager : public QObject
-{
-Q_OBJECT
-
-public:
-    /**
-     * Get an instance of the view manager
-     */
-    MsgSettingsViewManager(QObject* parent = 0);
-
-    /**
-     * Destructor
-     */
-    virtual ~MsgSettingsViewManager();
-
-    /**
-     * open the advanced settings view
-     */
-    void openAdvancedView();
-
-    /**
-     * open messageCenterView
-     * @param mode display either in addition or edit mode
-     * @example 0 - displays in add mode
-     * 			1 - displays in edit mode
-     */
-    void openMessageCenterView(int mode);
-
-private slots:
-    void closeAdvancedSettingsView();
-    void openSmsCenterView(int mode);
-    void closeSMSCCenterView();
-
-private:
-
-    /**
-     * List View.
-     * Own.
-     */
-    MsgAdvancedSettingsView* mAdvancedSettingsView;
-
-    /**
-     * 
-     */
-    MsgSMSCenterView* mSMSCenterView;
-
-    /**
-     * Current active view.
-     * Now owned.
-     */
-    MessageCenterView* mMessageCenterView;
-
-    HbAction* mBackAction;
-    HbAction* mBackAction2;
-
-    HbView * mCurrentView;
-
-};
-
-#endif /* MSGSETTINGSVIEWMANAGER_H */
--- a/messagingapp/msgsettings/msgsettingsplugin.deprecated/inc/msgsmscentersettingsform.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +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:This class is for sms message center form view
- *
- */
-
-#ifndef MSGSMSCENTERSETTINGSFORM_H_
-#define MSGSMSCENTERSETTINGSFORM_H_
-
-#include <hbdataform.h>
-
-class HbLineEdit;
-class MsgSettingEngine;
-
-class MsgSMSCenterSettingsForm : public HbDataForm
-{
-Q_OBJECT
-
-public:
-    explicit MsgSMSCenterSettingsForm(int view = -1, QGraphicsItem *parent = 0);
-
-    ~MsgSMSCenterSettingsForm();
-
-    void commitChanges();
-
-private slots:
-    void onItemActivated(const QModelIndex &index);
-    void onEditingFinished();
-
-private:
-    void initSettingModel();
-    void activateTextItem(HbWidget* widget, HbLineEdit* &edit);
-
-private:
-    QString mCenterName;
-    QString mCenterNumber;
-    HbLineEdit* mEdit1;
-    HbLineEdit* mEdit2;
-    int mView;
-    MsgSettingEngine* mSettingEngine;
-
-};
-
-#endif /* MSGSMSCENTERSETTINGSFORM_H_ */
--- a/messagingapp/msgsettings/msgsettingsplugin.deprecated/inc/msgsmscenterview.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +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:This class is for sms message center view 
- *
- */
-
-#ifndef MSGSMSCENTERVIEW_H_
-#define MSGSMSCENTERVIEW_H_
-
-#include <cpbasesettingview.h>
-
-class MsgSMSCenterSettingsForm;
-
-class MsgSMSCenterView : public CpBaseSettingView
-{
-Q_OBJECT
-
-public:
-    explicit MsgSMSCenterView(int view = -1, QGraphicsItem *parent = 0);
-    ~MsgSMSCenterView();
-
-    void commitChanges();
-
-private:
-    MsgSMSCenterSettingsForm* mSMSCenterSettingsForm;
-};
-
-#endif /* MSGSMSCENTERVIEW_H_ */
--- a/messagingapp/msgsettings/msgsettingsplugin.deprecated/msgsettingsplugin.pro	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-# #####################################################################
-# Automatically generated by qmake (2.01a) Mon Aug 31 10:36:00 2009
-# #####################################################################
-TEMPLATE = lib
-TARGET = msgsettingsplugin
-DEPENDPATH += .
-INCLUDEPATH += .
-INCLUDEPATH += ../msgsettingsmw/inc
-INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-
-CONFIG += hb\
-           plugin
-           
-MOC_DIR =     moc
-OBJECTS_DIR = obj
-RCC_DIR =     rcc
-
-# Platforms
-SYMBIAN_PLATFORMS = WINSCW \
-                    ARMV5
-    
-LIBS += -lcpframework \
-        -lmsgsettingsmw
-
-INCLUDEPATH += ../../../inc
-# Input
-SOURCES += 	src/msgadvancedsettingsform.cpp \
-					 	src/msgadvancedsettingsview.cpp \
-						src/msgsettingsdataformcustomitem.cpp \
-						src/msgsettingsplugin.cpp \
-						src/msgsettingsform.cpp \
-						src/msgsettingsviewmanager.cpp \
-						src/msgsettingsview.cpp \
-						src/msgsmscentersettingsform.cpp \
-						src/msgsmscenterview.cpp
-			
-HEADERS += 	inc/msgadvancedsettingsform.h \
-					  inc/msgadvancedsettingsview.h\
-					  inc/msgsettingsdataformcustomitem.h\
-					  inc/msgsettingsplugin.h\
-					  inc/msgsettingsform.h \
-					  inc/msgsettingsviewmanager.h \
-					  inc/msgsettingsview.h \
-						inc/msgsmscentersettingsform.h \
-						inc/msgsmscenterview.h
-		   
-symbian: { 
-    TARGET.EPOCALLOWDLLDATA = 1
-    TARGET.UID3 = 0x2001FE74    
-}
-symbian { 
-    deploy.path = C:
-    qtplugins.path = /resource/qt/plugins/controlpanel
-    qtplugins.sources += qmakepluginstubs/msgsettingsplugin.qtplugin    
-    # This is for new exporting system coming in garden
-    for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)"
-}
-
-# Build.inf rules
-BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
-    "rom/msgsettingsplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(msgsettingsplugin.iby)" \
-    "stub_sis/msgsettingsplugin_stub.sis   /epoc32/data/z/system/install/msgsettingsplugin_stub.sis"
-     
-TARGET.CAPABILITY = All -TCB
-plugin.sources = msgsettingsplugin.dll
-plugin.path = \resource\qt\plugins\controlpanel
-DEPLOYMENT += plugin	
--- a/messagingapp/msgsettings/msgsettingsplugin.deprecated/rom/msgsettingsplugin.iby	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#ifndef __MSGSETTINGSPLUGIN_IBY__
-#define __MSGSETTINGSPLUGIN_IBY__
-
-#include <bldvariant.hrh>
-file=ABI_DIR\BUILD_DIR\msgsettingsplugin.dll                   SHARED_LIB_DIR\msgsettingsplugin.dll
-
-data=\epoc32\data\z\resource\qt\plugins\controlpanel\msgsettingsplugin.qtplugin   resource\qt\plugins\controlpanel\msgsettingsplugin.qtplugin
-
-#endif
--- a/messagingapp/msgsettings/msgsettingsplugin.deprecated/src/msgadvancedsettingsform.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,634 +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:This class is for drawing form for advanced view 
- * settings
- *
- */
-
-#include "msgadvancedsettingsform.h"
-#include "msgsettingengine.h"
-
-#include <hbdataformviewitem.h>
-#include <hbdataformmodelitem.h>
-#include <hbdataformmodel.h>
-#include <hbpushbutton.h>
-#include <hbcombobox.h>
-#include <hbinputeditorinterface.h>
-#include <HbLineEdit>
-#include <QStandardItemModel>
-#include "debugtraces.h"
-
-//Localized Strings
-#define LOC_ADVANCED_SETTINGS hbTrId("txt_messaging_title_advanced_settings_messaging")
-#define LOC_MMS_SETTINGS hbTrId("txt_messaging_subhead_mms_settings")
-#define LOC_SMS_CENTRE_SETTINGS hbTrId("txt_messaging_subhead_sms_message_centre_settings")
-#define LOC_MMS_CREATION_MODE hbTrId("txt_messaging_setlabel_mms_creation_mode")
-#define LOC_MMS_RETRIEVAL hbTrId("txt_messaging_setlabel_mms_retrieval")
-#define LOC_ALLOW_ANONYMOUS_MMS hbTrId("txt_messaging_setlabel_allow_anonymous_mms_message")
-#define LOC_RECEIVE_MMS_ADVERTS hbTrId("txt_messaging_setlabel_receive_mms_adverts")
-#define LOC_MMS_AP_IN_USE hbTrId("txt_messaging_setlabel_mms_access_point_in_use")
-#define LOC_SMS_CENTRE_IN_USE hbTrId("txt_messaging_setlabel_sms_message_centre_in_use")
-#define LOC_ADD_NEW hbTrId("txt_messaging_button_add_new")
-
-#define LOC_RESTRICTED hbTrId("txt_messaging_setlabel_val_restricted")
-#define LOC_GUIDED hbTrId("txt_messaging_setlabel_val_guided")
-#define LOC_FREE hbTrId("txt_messaging_setlabel_val_free")
-
-#define LOC_ALWAYS_AUTOMATIC hbTrId("txt_messaging_setlabel_val_always_automatic")
-#define LOC_AUTO_HOME_NETWORK hbTrId("txt_messaging_setlabel_val_auto_home_network")
-#define LOC_MANUAL hbTrId("txt_messaging_setlabel_val_mannual")
-#define LOC_ON hbTrId("txt_messaging_setlabel_val_on")
-#define LOC_OFF hbTrId("txt_messaging_setlabel_val_off")
-
-#define LOC_MMS_YES hbTrId("txt_messaging_setlabel_allow_anonymous_mms_val_yes")
-#define LOC_MMS_NO hbTrId("txt_messaging_setlabel_allow_anonymous_mms_val_no")
-
-
-MsgAdvancedSettingsForm::MsgAdvancedSettingsForm(QGraphicsItem *parent) :
-    HbDataForm(parent), mSmsServiceCenterModel(0), mEditEmailGateway(NULL),
-        mEditEmailServiceNumber(NULL), mDefaultServiceCenter(0)
-{
-    this->setHeading(LOC_ADVANCED_SETTINGS);
-
-    mSettingEngine = new MsgSettingEngine();
-
-    initGroupPageName();
-    initSettingModel();
-
-    connect(this, SIGNAL(activated(QModelIndex)), this, SLOT(onItemActivated(QModelIndex)));
-
-}
-
-MsgAdvancedSettingsForm::~MsgAdvancedSettingsForm()
-{
-    delete mSettingEngine;
-}
-
-void MsgAdvancedSettingsForm::initGroupPageName()
-{
-    mGroupPageName << LOC_MMS_SETTINGS 
-                   << LOC_SMS_CENTRE_SETTINGS 
-                   << tr("SMS E-mail settings");
-
-    mmsSettingsGroup << LOC_MMS_CREATION_MODE 
-                     << LOC_MMS_RETRIEVAL 
-                     << LOC_ALLOW_ANONYMOUS_MMS 
-                     << LOC_RECEIVE_MMS_ADVERTS 
-                     << LOC_MMS_AP_IN_USE;
-
-    mSmsMCSettingsGroup << LOC_SMS_CENTRE_IN_USE 
-                        << LOC_ADD_NEW;
-
-    mSmsEmailSettingsGroup << tr("E-mail gateway") << tr("E-mail service centre number");
-}
-
-void MsgAdvancedSettingsForm::initSettingModel()
-{
-    HbDataFormModel *advancedSettingsmodel = new HbDataFormModel();
-
-    mMMSGroup = new HbDataFormModelItem(HbDataFormModelItem::GroupItem, mGroupPageName.at(0), 0);
-
-    HbDataFormModelItem* rootItem = advancedSettingsmodel->invisibleRootItem();
-
-    advancedSettingsmodel->appendDataFormItem(mMMSGroup, rootItem);
-
-    addMMSGroupItem(mMMSGroup);
-
-    mSmsMCGroup = new HbDataFormModelItem(HbDataFormModelItem::GroupItem, mGroupPageName.at(1), 0);
-
-    advancedSettingsmodel->appendDataFormItem(mSmsMCGroup, rootItem);
-
-    addSmsMCGroupItem(mSmsMCGroup, advancedSettingsmodel);
-
-    mSmsEmailGroup = new HbDataFormModelItem(HbDataFormModelItem::GroupItem, mGroupPageName.at(2),
-        0);
-
-    advancedSettingsmodel->appendDataFormItem(mSmsEmailGroup, rootItem);
-
-    addSmsEmailGroupItem(mSmsEmailGroup);
-
-    this->setModel(advancedSettingsmodel);
-}
-
-void MsgAdvancedSettingsForm::addMMSGroupItem(HbDataFormModelItem* parent)
-{
-    //read settings
-    MsgSettingEngine::MmsCreationMode creationMode = MsgSettingEngine::Guided;
-    MsgSettingEngine::MmsRetrieval retrieval = MsgSettingEngine::AlwaysAutomatic;
-    bool allowAnonymous = true;
-    bool allowAdverts = true;
-
-    mSettingEngine->advanceMmsSettings(creationMode, retrieval, allowAnonymous, allowAdverts);
-    // add all the mmss group item
-    HbDataFormModelItem *mmsCreationMode = new HbDataFormModelItem(
-        HbDataFormModelItem::ComboBoxItem, mmsSettingsGroup.at(0), 0);
-
-    QStringList mmsCreationModeList;
-    mmsCreationModeList << LOC_RESTRICTED 
-                        << LOC_GUIDED 
-                        << LOC_FREE;
-
-    mmsCreationMode->setContentWidgetData("items", mmsCreationModeList);
-    mmsCreationMode->setContentWidgetData("currentIndex", int(creationMode));
-
-    HbDataFormModelItem *mmsRetrieval = new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem,
-        mmsSettingsGroup.at(1), 0);
-
-    QStringList mmsRetrievalList;
-    mmsRetrievalList << LOC_ALWAYS_AUTOMATIC 
-                     << LOC_AUTO_HOME_NETWORK 
-                     << LOC_MANUAL
-                     << LOC_OFF
-                     << LOC_ON;
-
-    mmsRetrieval->setContentWidgetData("items", mmsRetrievalList);
-    mmsRetrieval->setContentWidgetData("currentIndex", int(retrieval));
-
-    HbDataFormModelItem *anonymousMMS = new HbDataFormModelItem(
-        HbDataFormModelItem::ToggleValueItem, mmsSettingsGroup.at(2), 0);
-
-    QStringList anonymousMMSList;
-    anonymousMMSList << LOC_MMS_NO 
-                     << LOC_MMS_YES;
-
-    int defaultIndex = int(allowAnonymous);
-    int alternateIndex = (defaultIndex + 1) % anonymousMMSList.count();
-
-    anonymousMMS->setContentWidgetData("text", anonymousMMSList.at(defaultIndex));
-    anonymousMMS->setContentWidgetData("additionalText", anonymousMMSList.at(alternateIndex));
-
-    HbDataFormModelItem *mmsAdverts = new HbDataFormModelItem(HbDataFormModelItem::ToggleValueItem,
-        mmsSettingsGroup.at(3), 0);
-
-    QStringList mmsAdvertsList;
-    mmsAdvertsList << LOC_MMS_NO 
-                   << LOC_MMS_YES;
-
-    defaultIndex = int(allowAdverts);
-    alternateIndex = (defaultIndex + 1) % mmsAdvertsList.count();
-
-    mmsAdverts->setContentWidgetData("text", mmsAdvertsList.at(defaultIndex));
-    mmsAdverts->setContentWidgetData("additionalText", mmsAdvertsList.at(alternateIndex));
-
-    HbDataFormModelItem *accessPoint = new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem,
-        mmsSettingsGroup.at(4), 0);
-
-    QStandardItemModel* comboModel = new QStandardItemModel();
-
-    QStringList mmsList;
-    int defaultAccessPointIndex = -1;
-
-    mSettingEngine->allMMsAcessPoints(mmsList, defaultAccessPointIndex);
-    int accessPoints = mmsList.count();
-    for (int a = 0; a < accessPoints; ++a) {
-        QStandardItem* item = new QStandardItem();
-        item->setData(mmsList[a], Qt::DisplayRole);
-        comboModel->appendRow(item);
-    }
-    accessPoint->setModel(comboModel);
-    accessPoint->setContentWidgetData("items", mmsList);
-    if (defaultAccessPointIndex >= 0) {
-        accessPoint->setContentWidgetData("currentIndex", defaultAccessPointIndex);
-    }
-
-    parent->appendChild(mmsCreationMode);
-    parent->appendChild(mmsRetrieval);
-    parent->appendChild(anonymousMMS);
-    parent->appendChild(mmsAdverts);
-    parent->appendChild(accessPoint);
-}
-
-void MsgAdvancedSettingsForm::addSmsMCGroupItem(HbDataFormModelItem* parent,
-    HbDataFormModel* advancedSettingsmodel)
-{
-    // add all the sms message center group item
-    HbDataFormModelItem *smsMessageCenter = new HbDataFormModelItem(
-        HbDataFormModelItem::ComboBoxItem, mSmsMCSettingsGroup.at(0), 0);
-
-    mSettingEngine->allSMSMessageCenter(mSmsServiceList, mDefaultServiceCenter);
-
-    //create and fill service center model.
-    createServiceCenterModel();
-
-    smsMessageCenter->setContentWidgetData("currentIndex", mDefaultServiceCenter);
-    parent->appendChild(smsMessageCenter);
-
-    //CUSTOM SETTING ITEM HbButton
-    HbDataFormModelItem::DataItemType customButtonGeneral =
-        static_cast<HbDataFormModelItem::DataItemType> (HbDataFormModelItem::CustomItemBase + 1);
-
-    int totalServices = mSmsServiceList.count();
-    for (int index = 0; index < totalServices; index++) {
-        HbDataFormModelItem *newMessageCenters = advancedSettingsmodel->appendDataFormItem(
-            customButtonGeneral, QString(""), parent);
-
-        newMessageCenters->setData(HbDataFormModelItem::KeyRole, mSmsServiceList.at(index));
-    }
-
-    HbDataFormModelItem *newMessageCenters = advancedSettingsmodel->appendDataFormItem(
-        customButtonGeneral, QString(""), parent);
-
-    newMessageCenters->setData(HbDataFormModelItem::KeyRole, mSmsMCSettingsGroup.at(1));
-}
-
-void MsgAdvancedSettingsForm::addSmsEmailGroupItem(HbDataFormModelItem* parent)
-{
-    QString emailSmsNum = QString();
-    QString emailGatewayTxt = QString();
-
-    mSettingEngine->emailEmailGatewayAndServiceCenterNumber(emailGatewayTxt, emailSmsNum);
-
-    // add all the sms email group item
-    HbDataFormModelItem *emailGateway = new HbDataFormModelItem(HbDataFormModelItem::TextItem,
-        mSmsEmailSettingsGroup.at(0), 0);
-
-    emailGateway->setContentWidgetData("text", emailGatewayTxt);
-
-    HbDataFormModelItem *emailService = new HbDataFormModelItem(HbDataFormModelItem::TextItem,
-        mSmsEmailSettingsGroup.at(1), 0);
-    emailService->setContentWidgetData("text", emailSmsNum);
-
-    parent->appendChild(emailGateway);
-    parent->appendChild(emailService);
-}
-
-void MsgAdvancedSettingsForm::onItemActivated(const QModelIndex &index)
-{
-    HbDataFormModelItem *itemData = static_cast<HbDataFormModelItem *> (index.internalPointer());
-    // to deal with orbit change temparialy
-    if (itemData->type() > HbDataFormModelItem::GroupPageItem) {
-        HbDataFormModelItem *pageItemData = const_cast<HbDataFormModelItem *> (itemData->parent());
-        //get the widget of setting item
-        HbWidget* widget = this->dataFormViewItem(index)->dataItemContentWidget();
-        if (pageItemData) {
-            //the first one is for mms group items
-            if (pageItemData == mMMSGroup) {
-                switch (pageItemData->indexOf(itemData)) {
-                case 0: //mms creation mode
-                    activateMMSCreationMode(widget);
-                    break;
-                case 1: //mms retrieval
-                    activateMMSRetrievalMode(widget);
-                    break;
-                case 2: //anonymous msgs
-                    activateMMSAnonymousMode(widget);
-                    break;
-                case 3: //mms adverts
-                    activateMMSAdverts(widget);
-                    break;
-                case 4: //MMS Accesspoint
-                    activateMMSAccesspoint(widget);
-                    break;
-                default:
-                    break;
-                }
-            }
-            else if (pageItemData == mSmsMCGroup) {
-                //the second one is for sms message center
-                if (pageItemData->indexOf(itemData) == 0) {
-                    activateSMSCCenterList(widget);
-                }
-                else {
-                    int btnIndex = pageItemData->indexOf(itemData);
-                    activateCustomButtonListItems(widget, btnIndex);
-                }
-            }
-            else if (pageItemData == mSmsEmailGroup) {
-                switch (pageItemData->indexOf(itemData)) {
-                case 0:
-                    activateEmailGateway(widget, mEditEmailGateway);
-                    break;
-                case 1:
-                    activateEmailServiceCenterNo(widget, mEditEmailServiceNumber);
-                    break;
-                default:
-                    break;
-                }
-            }
-        }
-    }
-}
-
-void MsgAdvancedSettingsForm::activateSMSCCenterList(HbWidget* widget)
-{
-    mSmsCenterComboBox = qobject_cast<HbComboBox *> (widget);
-
-    if (mSmsCenterComboBox) {
-        mSmsCenterComboBox->setModel(mSmsServiceCenterModel);
-
-        //to avoid multiple connects.
-        disconnect(mSmsCenterComboBox, SIGNAL(currentIndexChanged(int)), this,
-            SLOT(onSMSCurrentIndexChanged(int)));
-
-        mSmsCenterComboBox->setCurrentIndex(mDefaultServiceCenter);
-
-        //map the sms message center selected
-        connect(mSmsCenterComboBox, SIGNAL(currentIndexChanged(int)), this,
-            SLOT(onSMSCurrentIndexChanged(int)));
-    }
-}
-
-void MsgAdvancedSettingsForm::onSMSCurrentIndexChanged(int index)
-{
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Enter MsgAdvancedSettingsForm::onSMSCurrentIndexChanged index=" << index << "\n";
-#endif
-
-    //set into msg settings
-    mSettingEngine->setSMSMessageCenter(index);
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit MsgAdvancedSettingsForm::onSMSCurrentIndexChanged \n";
-#endif
-
-}
-
-void MsgAdvancedSettingsForm::activateCustomButtonListItems(HbWidget* widget, int btnIndex)
-{
-    HbPushButton *btn = qobject_cast<HbPushButton *> (widget);
-
-    if (btnIndex == mSmsServiceList.count() + 1) {
-        btn->setText(mSmsMCSettingsGroup.at(1));
-    }
-    else {
-        btn->setText(mSmsServiceList.at(btnIndex - 1));
-    }
-
-    if (btn) {
-        //to avoid multiple connects.
-        disconnect(btn, SIGNAL(clicked()), this, SLOT(onPressedCustomButton()));
-
-        //activate the custom buttons
-        connect(btn, SIGNAL(clicked()), this, SLOT(onPressedCustomButton()));
-
-        disconnect(btn, SIGNAL(longPress(QPointF)), this, SLOT(onLongPress(QPointF)));
-
-        connect(btn, SIGNAL(longPress(QPointF)), this, SLOT(onLongPress(QPointF)));
-    }
-}
-
-void MsgAdvancedSettingsForm::activateMMSCreationMode(HbWidget* widget)
-{
-    HbComboBox* combo = qobject_cast<HbComboBox *> (widget);
-
-    if (combo) {
-        //to avoid multiple connects.
-        disconnect(combo, SIGNAL(currentIndexChanged(int)), this, SLOT(changeMMSCreationMode(int)));
-
-        //map the mms access points selected
-        connect(combo, SIGNAL(currentIndexChanged(int)), this, SLOT(changeMMSCreationMode(int)));
-    }
-}
-
-void MsgAdvancedSettingsForm::changeMMSCreationMode(int index)
-{
-    mSettingEngine->setMMSCreationmode(MsgSettingEngine::MmsCreationMode(index));
-}
-
-void MsgAdvancedSettingsForm::activateMMSRetrievalMode(HbWidget* widget)
-{
-    HbComboBox* combo = qobject_cast<HbComboBox *> (widget);
-
-    if (combo) {
-        //to avoid multiple connects.
-        disconnect(combo, SIGNAL(currentIndexChanged(int)), this, SLOT(changeMMSRetrievalMode(int)));
-
-        //map the mms access points selected
-        connect(combo, SIGNAL(currentIndexChanged(int)), this, SLOT(changeMMSRetrievalMode(int)));
-    }
-}
-
-void MsgAdvancedSettingsForm::changeMMSRetrievalMode(int index)
-{
-    mSettingEngine->setMMSRetrieval(MsgSettingEngine::MmsRetrieval(index));
-}
-
-void MsgAdvancedSettingsForm::activateMMSAnonymousMode(HbWidget* widget)
-{
-    HbPushButton* toggleItem = qobject_cast<HbPushButton *> (widget);
-
-    if (toggleItem) {
-        //TODO Issue in DataForm Calling the itemActivated twice
-        disconnect(toggleItem, SIGNAL(clicked()), this, SLOT(allowAnonymousMMS()));
-
-        connect(toggleItem, SIGNAL(clicked()), this, SLOT(allowAnonymousMMS()));
-    }
-}
-
-void MsgAdvancedSettingsForm::allowAnonymousMMS()
-{
-    HbPushButton *btn = qobject_cast<HbPushButton *> (sender());
-
-    if (btn) {
-        QString btnText = btn->text();
-
-        //check if the button pressed was Yes or NO
-        if (LOC_MMS_YES == btnText) {
-            mSettingEngine->setAnonymousMessages(true);
-        }
-        else {
-            mSettingEngine->setAnonymousMessages(false);
-        }
-    }
-}
-
-void MsgAdvancedSettingsForm::activateMMSAdverts(HbWidget* widget)
-{
-    HbPushButton* toggleItem = qobject_cast<HbPushButton *> (widget);
-
-    if (toggleItem) {
-        //TODO Issue in DataForm Calling the itemActivated twice
-        disconnect(toggleItem, SIGNAL(clicked()), this, SLOT(allowMMSAdverts()));
-
-        connect(toggleItem, SIGNAL(clicked()), this, SLOT(allowMMSAdverts()));
-    }
-}
-
-void MsgAdvancedSettingsForm::allowMMSAdverts()
-{
-    HbPushButton *btn = qobject_cast<HbPushButton *> (sender());
-
-    if (btn) {
-        QString btnText = btn->text();
-
-        //check if the button pressed was Yes or NO
-        if (LOC_MMS_NO == btnText) {
-            mSettingEngine->setReceiveMMSAdverts(true);
-        }
-        else {
-            mSettingEngine->setReceiveMMSAdverts(false);
-        }
-    }
-}
-
-void MsgAdvancedSettingsForm::activateMMSAccesspoint(HbWidget* widget)
-{
-    HbComboBox* accessPointCombo = qobject_cast<HbComboBox *> (widget);
-
-    //to avoid multiple connects.
-    disconnect(accessPointCombo, SIGNAL(currentIndexChanged(int)), this,
-        SLOT(changeAccessPoint(int)));
-
-    //map the mms access points selected
-    connect(accessPointCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(changeAccessPoint(int)));
-}
-
-void MsgAdvancedSettingsForm::onPressedCustomButton()
-{
-    HbPushButton *btn = qobject_cast<HbPushButton *> (sender());
-
-    if (btn) {
-        QString btnText = btn->text();
-        if (btnText == mSmsMCSettingsGroup.at(1)) {
-            // emit the signal to open add view 
-            emit newSMSCCenterClicked(-1);
-        }
-        else {
-            int index = mSmsServiceList.indexOf(btnText);
-            emit newSMSCCenterClicked(index);
-        }
-    }
-}
-
-void MsgAdvancedSettingsForm::changeAccessPoint(int index)
-{
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Enter MsgAdvancedSettingsForm::changeAccessPoint index=" << index << "\n";
-#endif
-
-    // save to the mms settings
-    mSettingEngine->setMMSAccesspoint(index);
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit MsgAdvancedSettingsForm::changeAccessPoint";
-#endif
-
-}
-
-void MsgAdvancedSettingsForm::refresh()
-{
-    int childCount = mSmsMCGroup->childCount();
-    //remove items after mSmsCenterComboBox till new center button.
-    mSmsMCGroup->removeChildren(1, childCount - 2);
-    updateSmsCenterModel();
-}
-
-void MsgAdvancedSettingsForm::commitEmailChanges()
-{
-    if (mEditEmailGateway == NULL || mEditEmailServiceNumber == NULL) {
-        return;
-    }
-
-    QString emailGateway = mEditEmailGateway->text();
-    QString emailServiceCenter = mEditEmailServiceNumber->text();
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Enter MsgAdvancedSettingsForm::commitEmailChanges " << emailGateway << " "
-        << emailServiceCenter;
-#endif
-
-    mSettingEngine->setEmailGateway(emailGateway);
-
-    //set the smsc center number
-    mSettingEngine->setEmailSeriveCenterNumber(emailServiceCenter);
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit MsgAdvancedSettingsForm::commitEmailChanges\n";
-#endif
-
-}
-
-void MsgAdvancedSettingsForm::updateSmsCenterModel()
-{
-    mSmsServiceList.clear();
-    mSettingEngine->allSMSMessageCenter(mSmsServiceList, mDefaultServiceCenter);
-
-    HbDataFormModelItem* smsCenterCombo = mSmsMCGroup->childAt(0);
-    QAbstractItemModel* mod = const_cast<QAbstractItemModel*> (this->model());
-    HbDataFormModel* advancedSettingsmodel = static_cast<HbDataFormModel*> (mod);
-    int msgCenterComboIndex = advancedSettingsmodel->indexFromItem(smsCenterCombo).row();
-
-    //clear model before refilling.
-    mSmsServiceCenterModel->clear();
-    fillServiceCenterModel();
-
-    //CUSTOM SETTING ITEM HbButton
-    HbDataFormModelItem::DataItemType customButtonGeneral =
-        static_cast<HbDataFormModelItem::DataItemType> (HbDataFormModelItem::CustomItemBase + 1);
-
-    int itemCount = mSmsServiceList.count();
-    for (int i = 0; i < itemCount; ++i) {
-        //add custom buttons.
-        HbDataFormModelItem *messageCenters = new HbDataFormModelItem(customButtonGeneral,
-            QString(), mSmsMCGroup);
-
-        messageCenters->setData(HbDataFormModelItem::KeyRole, mSmsServiceList.at(i));
-
-        advancedSettingsmodel->insertDataFormItem(msgCenterComboIndex + 1 + i, messageCenters,
-            mSmsMCGroup);
-    }
-}
-
-void MsgAdvancedSettingsForm::createServiceCenterModel()
-{
-    mSmsServiceCenterModel = new QStandardItemModel();
-
-    //to know when is model destroyed.
-    connect(mSmsServiceCenterModel, SIGNAL(destroyed()), this, SLOT(createServiceCenterModel()));
-
-    fillServiceCenterModel();
-}
-
-void MsgAdvancedSettingsForm::fillServiceCenterModel()
-{
-    QStringList serviceCenters;
-    mSettingEngine->allSMSMessageCenter(serviceCenters, mDefaultServiceCenter);
-
-    int itemCount = serviceCenters.count();
-    for (int i = 0; i < itemCount; ++i) {
-        QStandardItem *item = new QStandardItem;
-        item->setData(serviceCenters.at(i), Qt::DisplayRole);
-        mSmsServiceCenterModel->appendRow(item);
-    }
-}
-
-void MsgAdvancedSettingsForm::activateEmailGateway(HbWidget* widget, HbLineEdit* &edit)
-{
-    // editing finished SIGNAL is still not coming in week48MCL
-    HbLineEdit* editWidget = qobject_cast<HbLineEdit *> (widget);
-
-    if (editWidget) {
-        edit = editWidget;
-        //connect(edit, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
-    }
-}
-
-void MsgAdvancedSettingsForm::activateEmailServiceCenterNo(HbWidget* widget, HbLineEdit* &edit)
-{
-    // editing finished SIGNAL is still not coming in week48MCL
-    HbLineEdit* editWidget = qobject_cast<HbLineEdit *> (widget);
-
-    if (editWidget) {
-        edit = editWidget;
-        HbEditorInterface editorInterface(edit);
-        editorInterface.setUpAsPhoneNumberEditor();
-        //connect(edit, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
-    }
-}
-
-void MsgAdvancedSettingsForm::onLongPress(QPointF point)
-{
-    Q_UNUSED(point);
-}
-//eof
--- a/messagingapp/msgsettings/msgsettingsplugin.deprecated/src/msgadvancedsettingsview.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +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:  This class is for advanced settings view
- *
- */
-
-#include "msgadvancedsettingsview.h"
-#include "msgadvancedsettingsform.h"
-#include "msgsettingsdataformcustomitem.h"
-
-MsgAdvancedSettingsView::MsgAdvancedSettingsView(QGraphicsItem *parent) :
-    CpBaseSettingView(0, parent), mAdvancedSettingsForm(0)
-{
-
-    mAdvancedSettingsForm = new MsgAdvancedSettingsForm(this);
-
-    //custom prototype
-    MsgSettingsDataFormCustomItem* customPrototype = 
-            new MsgSettingsDataFormCustomItem(mAdvancedSettingsForm);
-    
-    mAdvancedSettingsForm->setItemPrototype(customPrototype);
-
-    this->setSettingForm(mAdvancedSettingsForm);
-
-    connect( mAdvancedSettingsForm, SIGNAL(newSMSCCenterClicked(int)),
-             this, SIGNAL(newSMSCCenterClicked(int)) );
-}
-
-MsgAdvancedSettingsView::~MsgAdvancedSettingsView()
-{
-}
-
-void MsgAdvancedSettingsView::refreshView()
-    {
-    mAdvancedSettingsForm->refresh();
-    }
-
-
-void MsgAdvancedSettingsView::commitEmailChanges()
-{
-    mAdvancedSettingsForm->commitEmailChanges();
-}
--- a/messagingapp/msgsettings/msgsettingsplugin.deprecated/src/msgsettingsdataformcustomitem.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +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:  This class provides custom list item for the
- * DataForm
- *
- */
-
-#include <msgsettingsdataformcustomitem.h>
-#include <hbdataformmodelitem.h>
-#include <hbpushbutton.h>
-
-MsgSettingsDataFormCustomItem::MsgSettingsDataFormCustomItem(QGraphicsItem *parent) :
-HbDataFormViewItem(parent)
-{
-}
-
-MsgSettingsDataFormCustomItem::~MsgSettingsDataFormCustomItem()
-{
-}
-
-HbAbstractViewItem* MsgSettingsDataFormCustomItem::createItem()
-{
-    return new MsgSettingsDataFormCustomItem(*this);
-}
-
-HbWidget* MsgSettingsDataFormCustomItem::createCustomWidget()
-{
-    HbDataFormModelItem::DataItemType itemType =
-    static_cast<HbDataFormModelItem::DataItemType> 
-    ( modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt() );
-    
-    switch (itemType)
-    {
-      case HbDataFormModelItem::CustomItemBase + 1:
-            { 
-            //custom button
-            QString str =
-                    modelIndex().data(HbDataFormModelItem::KeyRole).toString();
-            HbPushButton *button = new HbPushButton(str);
-    
-            return button;
-            }
-        default:
-            return 0;
-    }
-}
--- a/messagingapp/msgsettings/msgsettingsplugin.deprecated/src/msgsettingsform.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,194 +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:  This class is for first form view for msg settings
- *
- */
-
-#include "msgsettingsform.h"
-#include "msgsettingsdataformcustomitem.h"
-#include "msgsettingsviewmanager.h"
-
-#include <hbdataformmodelitem.h>
-#include <hbdataformmodel.h>
-#include <hbcombobox.h>
-#include <hbpushbutton.h>
-
-#include "debugtraces.h"
-
-//Localized constants
-#define LOC_DELIVERY_REPORTS hbTrId("txt_messaging_setlabel_delivery_reports")
-#define LOC_ON hbTrId("txt_messaging_setlabel_val_on")
-#define LOC_OFF hbTrId("txt_messaging_setlabel_val_off")
-#define LOC_REDUCED_SUPPORT hbTrId("txt_messaging_setlabel_val_reduced_support")
-#define LOC_FULL_SUPPORT hbTrId("txt_messaging_setlabel_val_full_support")
-#define LOC_ADVANCED hbTrId("txt_messaging_button_advanced")
-#define LOC_CHAR_ENCODING hbTrId("txt_messaging_setlabel_character_encoding")
-
-
-MsgSettingsForm::MsgSettingsForm(QGraphicsItem *parent) :
-    HbDataForm(parent)
-{
-    mSettingsViewManager = new MsgSettingsViewManager(0);
-
-    this->setHeading(tr("Application settings: Messaging"));
-
-    mSettingEngine = new MsgSettingEngine();
-
-    //initialize the form model
-    initSettingModel();
-
-    connect(this, SIGNAL(activated(QModelIndex)), this, SLOT(onItemActivated(QModelIndex)));
-
-}
-
-MsgSettingsForm::~MsgSettingsForm()
-{
-    delete mSettingsViewManager;
-    delete mSettingEngine;
-}
-
-void MsgSettingsForm::initSettingModel()
-{
-    HbDataFormModel *model = new HbDataFormModel(0);
-
-    mDeliverReports = new HbDataFormModelItem(HbDataFormModelItem::ToggleValueItem, 
-            LOC_DELIVERY_REPORTS, 0);
-
-    bool deliveryReoprt = false;
-    MsgSettingEngine::CharacterEncoding charEncoding = MsgSettingEngine::ReducedSupport;
-
-    mSettingEngine->settingsDeliverReportAndCharEncoding(deliveryReoprt, charEncoding);
-
-    QStringList deliveryReoprtList;
-    deliveryReoprtList << LOC_OFF << LOC_ON;
-
-    int index = int(deliveryReoprt);
-    int otherIndex = (deliveryReoprt + 1) % deliveryReoprtList.count();
-
-    mDeliverReports->setContentWidgetData("text", deliveryReoprtList.at(index));
-    mDeliverReports->setContentWidgetData("additionalText", deliveryReoprtList.at(otherIndex));
-
-    model->appendDataFormItem(mDeliverReports, model->invisibleRootItem());
-
-    // Character encoding
-    mCharacterEncoding = new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem, 
-            LOC_CHAR_ENCODING, 0);
-    QStringList charEncodingList;
-    charEncodingList << LOC_REDUCED_SUPPORT << LOC_FULL_SUPPORT;
-
-    index = int(charEncoding);
-
-    mCharacterEncoding->setContentWidgetData("items", charEncodingList);
-    mCharacterEncoding->setContentWidgetData("currentIndex", index);
-
-    model->appendDataFormItem(mCharacterEncoding, model->invisibleRootItem());
-
-    //CUSTOM SETTING ITEM HbButton
-    HbDataFormModelItem::DataItemType customItem =
-        static_cast<HbDataFormModelItem::DataItemType> (HbDataFormModelItem::CustomItemBase + 1);
-
-    mAdvancedSettings
-        = model->appendDataFormItem(customItem, QString(), model->invisibleRootItem());
-    this->setModel(model);
-}
-
-// On Item activated
-void MsgSettingsForm::onItemActivated(const QModelIndex &index)
-{
-    HbDataFormModelItem *itemData = static_cast<HbDataFormModelItem *> (index.internalPointer());
-    // to deal with orbit change temparialy
-    if (itemData->type() > HbDataFormModelItem::GroupPageItem) {
-        HbDataFormModelItem *pageItemData = const_cast<HbDataFormModelItem *> (itemData->parent());
-        //get the widget of setting item
-        HbWidget* widget = this->dataFormViewItem(index)->dataItemContentWidget();
-
-        if (itemData == mDeliverReports) {
-            activateDeliveryReports(widget);
-        }
-        else if (itemData == mCharacterEncoding) {
-            activateCharacterEncoding(widget);
-        }
-        else if (itemData == mAdvancedSettings) {
-            activateAdvanced(widget);
-        }
-    }
-}
-
-void MsgSettingsForm::activateAdvanced(HbWidget* widget)
-{
-    HbPushButton *advanced = qobject_cast<HbPushButton *> (widget);
-
-    if (advanced) {
-        advanced->setText(LOC_ADVANCED);
-        //TODO Issue in DataForm Calling the itemActivated twice
-        disconnect(advanced, SIGNAL(clicked()), this, SLOT(onPressedAdvanced()));
-
-        connect(advanced, SIGNAL(clicked()), this, SLOT(onPressedAdvanced()));
-    }
-}
-
-void MsgSettingsForm::activateDeliveryReports(HbWidget* widget)
-{
-    HbPushButton *delReports = qobject_cast<HbPushButton *> (widget);
-
-    if (delReports) {
-        //TODO Issue in DataForm Calling the itemActivated twice
-        disconnect(delReports, SIGNAL(clicked()), this, SLOT(onPressedDelReports()));
-
-        connect(delReports, SIGNAL(clicked()), this, SLOT(onPressedDelReports()));
-    }
-}
-
-void MsgSettingsForm::activateCharacterEncoding(HbWidget* widget)
-{
-    HbComboBox *charEncoding = qobject_cast<HbComboBox *> (widget);
-
-    if (charEncoding) {
-        //TODO Issue in DataForm Calling the itemActivated twice
-        disconnect(charEncoding, SIGNAL(currentIndexChanged(int)), this,
-            SLOT(changeCharEncoding(int)));
-
-        connect(charEncoding, SIGNAL(currentIndexChanged(int)), this, SLOT(changeCharEncoding(int)));
-    }
-}
-
-void MsgSettingsForm::onPressedAdvanced()
-{
-    //tell view manager to open advanced view
-    mSettingsViewManager->openAdvancedView();
-}
-
-void MsgSettingsForm::onPressedDelReports()
-{
-    HbPushButton *btn = qobject_cast<HbPushButton *> (sender());
-
-    if (btn) {
-        QString btnText = btn->text();
-
-        //check if the button pressed was On or Off
-        if (LOC_OFF == btnText) {
-            mSettingEngine->setDeliveryReport(false);
-        }
-        else {
-            mSettingEngine->setDeliveryReport(true);
-        }
-    }
-}
-
-void MsgSettingsForm::changeCharEncoding(int index)
-{
-    //set the character encoding
-    mSettingEngine->setCharacterEncoding(MsgSettingEngine::CharacterEncoding(index));
-}
-//EOF
--- a/messagingapp/msgsettings/msgsettingsplugin.deprecated/src/msgsettingsplugin.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +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: This is for Message Settings plugin for ControlPanel
- *
- */
-
-#include "msgsettingsplugin.h"
-#include "msgsettingsview.h"
-#include <cpsettingformentryitemdataimpl.h>
-#include <QFile>
-#include "debugtraces.h"
-
-#include <QDateTime>
-
-const QString debugFileName("c://ControlPanelSettings.txt");
-
-#ifdef _DEBUG_TRACES_
-void debugInit(QtMsgType type, const char *msg)
- {
- 
-	QFile ofile(debugFileName);
-    if (!ofile.open(QIODevice::Append | QIODevice::Text))
-    {
-        qFatal("error opening results file");
-        return;
-    }
-    QDateTime dt = QDateTime::currentDateTime();
-
-    QTextStream out(&ofile);
-    switch (type)
-    {
-        case QtDebugMsg:
-        out << " DEBUG:";
-        out << msg;
-        break;
-        case QtWarningMsg:
-        //out << " WARN:";
-        //out << msg;
-        break;
-        case QtCriticalMsg:
-        //out << "\n ";
-        //out << dt.toString("dd/MM/yyyy hh:mm:ss.zzz:ap");
-        //out << " CRITICAL:";
-        //out << msg;
-        break;
-        case QtFatalMsg:
-        //out << " FATAL:";
-        //out << msg;
-        //abort();
-        break;
-        default:
-        //out << " No Log Selection Type:";
-        //out << msg;
-        break;
-
-    }
- }
-#endif 
- 
-MsgSettingsPlugin::MsgSettingsPlugin()
-{
-#ifdef _DEBUG_TRACES_
-    //Debug Logs
-	  QFile ofile;
-    if (ofile.exists(debugFileName))
-    {
-      ofile.remove(debugFileName);
-    }
-
-		qInstallMsgHandler(debugInit);
-#endif		
-}
-
-MsgSettingsPlugin::~MsgSettingsPlugin()
-{
-
-}
-
-QList<CpSettingFormItemData*> MsgSettingsPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const
-{
-		QDEBUG_WRITE("Enter MsgSettingsPlugin::createSettingFormItemData\n");
-
-    return QList<CpSettingFormItemData*>() 
-            << new CpSettingFormEntryItemDataImpl<MsgSettingsView>(
-			   itemDataHelper,
-               tr("Messaging"), 
-			   tr("Message Settings"));
-}
-
-Q_EXPORT_PLUGIN2(msgsettingsplugin, MsgSettingsPlugin);
--- a/messagingapp/msgsettings/msgsettingsplugin.deprecated/src/msgsettingsview.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +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:This is the first view for msgsettings plugin 
- *
- */
-
-#include "msgsettingsview.h"
-#include "msgsettingsform.h"
-
-#include <cpbasesettingview.h>
-#include "msgsettingsdataformcustomitem.h"
-#include "debugtraces.h"
-
-
-MsgSettingsView::MsgSettingsView(QGraphicsItem *parent):
-CpBaseSettingView(0,parent)
-{
-    MsgSettingsForm* settingForm = new MsgSettingsForm(this);
-    
-    //custom prototype
-    MsgSettingsDataFormCustomItem* customPrototype = new MsgSettingsDataFormCustomItem(settingForm);
-    settingForm->setItemPrototype(customPrototype);
-    
-    this->setSettingForm(settingForm);
-}
-MsgSettingsView::~MsgSettingsView()
-{
-}
--- a/messagingapp/msgsettings/msgsettingsplugin.deprecated/src/msgsettingsviewmanager.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +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:This is the manager class for managing multiple views
- *
- */
-
-#include "msgsettingsviewmanager.h"
-#include "msgadvancedsettingsview.h"
-#include "msgsmscenterview.h"
-
-#include <hbinstance.h>
-#include <hbaction.h>
-
-MsgSettingsViewManager::MsgSettingsViewManager(QObject* parent) :
-    QObject(parent), mAdvancedSettingsView(NULL),
-    mSMSCenterView(NULL),
-    mMessageCenterView(NULL),
-    mBackAction(NULL)
-{
-    //do nothing
-}
-
-MsgSettingsViewManager::~MsgSettingsViewManager()
-{
-    if (mAdvancedSettingsView)
-    {
-        mAdvancedSettingsView->setParent(NULL);
-        delete mAdvancedSettingsView;
-    }
-
-    if (mSMSCenterView)
-    {
-        mSMSCenterView->setParent(NULL);
-        delete mSMSCenterView;
-    }
-}
-
-void MsgSettingsViewManager::openAdvancedView()
-{
-    mAdvancedSettingsView = new MsgAdvancedSettingsView();
-
-    HbMainWindow* mainWindow = hbInstance->allMainWindows().at(0);
-
-    mainWindow->addView(mAdvancedSettingsView);
-    mainWindow->setCurrentView(mAdvancedSettingsView);
-
-    //take back action from controlpanel main window.
-    mBackAction = mainWindow->softKeyAction(Hb::SecondarySoftKey);
-
-    connect(mBackAction, SIGNAL(triggered()), this, SLOT(closeAdvancedSettingsView()));
-
-    connect(mAdvancedSettingsView, SIGNAL(newSMSCCenterClicked(int)), this, SLOT(openSmsCenterView(int)));
-}
-
-void MsgSettingsViewManager::closeAdvancedSettingsView()
-{
-    disconnect(mBackAction, SIGNAL(triggered()), this, SLOT(closeAdvancedSettingsView()));
-
-    mAdvancedSettingsView->commitEmailChanges();
-    
-    HbMainWindow* mainWindow = hbInstance->allMainWindows().at(0);
-    mainWindow->removeView(mAdvancedSettingsView);
-
-    mAdvancedSettingsView->setParent(NULL);
-    delete mAdvancedSettingsView;
-    mAdvancedSettingsView = NULL;
-}
-
-void MsgSettingsViewManager::openSmsCenterView(int mode)
-{
-    HbMainWindow* mainWindow = hbInstance->allMainWindows().at(0);
-    mSMSCenterView = new MsgSMSCenterView(mode);
-    mainWindow->addView(mSMSCenterView);
-    mainWindow->setCurrentView(mSMSCenterView);
-
-    //take back action from controlpanel main window.
-    mBackAction2 = mainWindow->softKeyAction(Hb::SecondarySoftKey);
-
-    connect(mBackAction2, SIGNAL(triggered()), this, SLOT(closeSMSCCenterView()));
-}
-
-void MsgSettingsViewManager::closeSMSCCenterView()
-{
-    disconnect(mBackAction2, SIGNAL(triggered()), this, SLOT(closeSMSCCenterView()));
-
-    mSMSCenterView->commitChanges();
-    mAdvancedSettingsView->refreshView();
-    
-    HbMainWindow* mainWindow = hbInstance->allMainWindows().at(0);
-    mainWindow->removeView(mSMSCenterView);
-
-    mSMSCenterView->setParent(NULL);
-    delete mSMSCenterView;
-    mSMSCenterView = NULL;
-}
--- a/messagingapp/msgsettings/msgsettingsplugin.deprecated/src/msgsmscentersettingsform.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,157 +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:This class is for sms message center form view 
- *
- */
-
-#include "msgsmscentersettingsform.h"
-#include "msgsettingengine.h"
-
-#include <hbdataformviewitem.h>
-#include <hbdataformmodelitem.h>
-#include <hbdataformmodel.h>
-#include <hblineedit.h>
-#include <hbinputeditorinterface.h>
-
-//Localized constants
-#define LOC_NEW_SMS_CENTRE hbTrId("txt_messaging_title_new_sms_message_centre")
-#define LOC_EDIT_SMS_CENTRE hbTrId("txt_messaging_title_edit_sms_message_centre")
-#define LOC_SMS_CENTRE_NAME hbTrId("txt_messaging_setlabel_message_centre_name")
-#define LOC_SMS_CENTRE_NUMBER hbTrId("txt_messaging_setlabel_message_centre_number")
-
-
-MsgSMSCenterSettingsForm::MsgSMSCenterSettingsForm(int view, QGraphicsItem *parent) :
-    HbDataForm(parent), mEdit1(NULL), mEdit2(NULL), mView(view)
-{
-    QString heading;
-    if (mView == -1) {
-        heading = LOC_NEW_SMS_CENTRE;
-    }
-    else {
-        heading = LOC_EDIT_SMS_CENTRE;
-    }
-
-    this->setHeading(heading);
-
-    mSettingEngine = new MsgSettingEngine();
-
-    initSettingModel();
-
-    connect(this, SIGNAL(activated(QModelIndex)), this, SLOT(onItemActivated(QModelIndex)));
-}
-
-MsgSMSCenterSettingsForm::~MsgSMSCenterSettingsForm()
-{
-    delete mSettingEngine;
-}
-
-void MsgSMSCenterSettingsForm::initSettingModel()
-{
-    HbDataFormModel *settingsmodel = new HbDataFormModel();
-
-    QString centerName = QString();
-    QString centerNumber = QString();
-
-    if (mView != -1) {
-        mSettingEngine->smsCenterNameAndNumber(mView, centerName, centerNumber);
-    }
-
-    HbDataFormModelItem *messageCenterName = new HbDataFormModelItem(HbDataFormModelItem::TextItem,
-            LOC_SMS_CENTRE_NAME, 0);
-
-    messageCenterName->setContentWidgetData("text", centerName);
-
-    settingsmodel->appendDataFormItem(messageCenterName, settingsmodel->invisibleRootItem());
-
-    HbDataFormModelItem *messageCenterNumber = new HbDataFormModelItem(
-        HbDataFormModelItem::TextItem, LOC_SMS_CENTRE_NUMBER, 0);
-
-    messageCenterNumber->setContentWidgetData("text", centerNumber);
-
-    settingsmodel->appendDataFormItem(messageCenterNumber, settingsmodel->invisibleRootItem());
-
-    this->setModel(settingsmodel);
-}
-
-void MsgSMSCenterSettingsForm::onItemActivated(const QModelIndex &index)
-{
-    HbDataFormModelItem *itemData = static_cast<HbDataFormModelItem *> (index.internalPointer());
-    // to deal with orbit change temparialy
-    if (itemData->type() > HbDataFormModelItem::GroupPageItem) {
-        HbDataFormModelItem *pageItemData = const_cast<HbDataFormModelItem *> (itemData->parent());
-        //get the widget of setting item
-        HbWidget* widget = this->dataFormViewItem(index)->dataItemContentWidget();
-        if (pageItemData) {
-            switch (pageItemData->indexOf(itemData)) {
-            case 0: //name
-                activateTextItem(widget, mEdit1);
-                break;
-            case 1: //number
-                activateTextItem(widget, mEdit2);
-                break;
-
-            default:
-                break;
-            }
-        }
-    }
-}
-
-void MsgSMSCenterSettingsForm::activateTextItem(HbWidget* widget, HbLineEdit* &edit)
-{
-    HbLineEdit* editWidget = qobject_cast<HbLineEdit *> (widget);
-
-    if (editWidget) {
-        edit = editWidget;
-        // If Service center number
-        if (edit == mEdit2) {
-            HbEditorInterface editorInterface(edit);
-            editorInterface.setUpAsPhoneNumberEditor();
-        }
-        connect(edit, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
-    }
-}
-
-void MsgSMSCenterSettingsForm::onEditingFinished()
-{
-    HbLineEdit *edit1 = qobject_cast<HbLineEdit *> (sender());
-
-    if (edit1) {
-        if (edit1 == mEdit1) {
-            mCenterName = edit1->text();
-        }
-        else if (edit1 == mEdit2) {
-            mCenterNumber = edit1->text();
-        }
-    }
-}
-
-void MsgSMSCenterSettingsForm::commitChanges()
-{
-    //commit changes
-    mCenterName = mEdit1->text();
-    mCenterNumber = mEdit2->text();
-
-    if (mCenterName.isEmpty() || mCenterNumber.isEmpty()) {
-        //if mCenterName or mCenterNumber is empty do not commit.
-        return;
-    }
-
-    if (mView == -1) {
-        mSettingEngine->addSmsMessageCenter(mCenterName, mCenterNumber);
-    }
-    else {
-        mSettingEngine->editSmsMessageCenter(mCenterName, mCenterNumber, mView);
-    }
-}
--- a/messagingapp/msgsettings/msgsettingsplugin.deprecated/src/msgsmscenterview.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +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:This class is for sms message center view 
- *
- */
-
-#include "msgsmscenterview.h"
-#include "msgsmscentersettingsform.h"
-
-#include <cpbasesettingview.h>
-
-MsgSMSCenterView::MsgSMSCenterView(int view, QGraphicsItem *parent) :
-CpBaseSettingView(0, parent)
-{
-    mSMSCenterSettingsForm = new MsgSMSCenterSettingsForm(view);
-
-    this->setSettingForm(mSMSCenterSettingsForm);
-}
-
-MsgSMSCenterView::~MsgSMSCenterView()
-{
-}
-
-void MsgSMSCenterView::commitChanges()
-{
-    mSMSCenterSettingsForm->commitChanges();
-}
--- a/messagingapp/msgsettings/msgsettingsplugin.deprecated/stub_sis/msgsettingsplugin_stub.pkg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description: 
-;
-; Languages
-&EN
-
-; Header
-#{"msgsettingsplugin"}, (0x2001FE74), 1, 0, 0, TYPE = SA
-
-; Localised Vendor name
-%{"Nokia"}
-
-; Unique Vendor name
-:"Nokia"
\ No newline at end of file
Binary file messagingapp/msgsettings/msgsettingsplugin.deprecated/stub_sis/msgsettingsplugin_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgsettings/settingsview/inc/mmssettingprivate.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,81 @@
+/*
+ * 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:  This provides the messaging mw interface for MMS
+ *
+ */
+
+#ifndef MMSSETTINS_PRIVATE_H
+#define MMSSETTINS_PRIVATE_H
+
+#include <smutset.h>
+#include <mmsclient.h>
+
+#include "msgsettingengine.h"
+
+/**
+ * MMS setting class implements the MMSC settings
+ * The settings will be stored in the central repository.
+ */
+
+class MmsSettingsPrivate
+{
+public:
+
+    /**
+     * 2 phase constructor
+     */
+    static MmsSettingsPrivate* NewL();
+
+    /*
+     * Destructor
+     */
+    ~MmsSettingsPrivate();
+
+    void setMMSRetrieval(MsgSettingEngine::MmsRetrieval aRetrieval);
+
+    void setAnonymousMessages(TBool aAnonymous);
+
+    void setReceiveMMSAdverts(TBool aReceiveAdvert);
+
+    void advanceMmsSettings(MsgSettingEngine::MmsRetrieval& aRetrieval,
+                            TBool& aAnonymousStatus, TBool& aMmsAdvertsStatus);
+
+    void getAllAccessPoints(RPointerArray<HBufC>& aAccessPoints,
+                            TInt& aDefaultIndex);
+
+    void setMMSAccesspoint(TInt& aDefaultIndex);
+
+private:
+
+    /*
+     * 1st phase Constructor 
+     */
+    MmsSettingsPrivate();
+
+    /**
+     * 2nd phase constructor
+     */
+    void ConstructL();
+
+    /*
+     * Creates the repository
+     */
+    void createRepositoryL();
+
+private:
+    //nothing private data
+};
+
+#endif // MMSSETTINS_PRIVATE_H
+
--- a/messagingapp/msgsettings/settingsview/inc/msgadvancedsettingsform.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:This class is for drawing form for advanced view 
- * settings  
- *
- */
-
-#ifndef MSG_ADVANCEDSETTINGS_FORM_H_
-#define MSG_ADVANCEDSETTINGS_FORM_H_
-
-#include <hbdataform.h>
-
-class HbDataFormModelItem;
-class HbDataFormModel;
-class HbComboBox;
-class QStandardItemModel;
-class MsgSettingEngine;
-class HbLineEdit;
-
-class MsgAdvancedSettingsForm : public HbDataForm
-{
-Q_OBJECT
-public:
-    explicit MsgAdvancedSettingsForm(QGraphicsItem *parent = 0);
-
-    ~MsgAdvancedSettingsForm();
-
-signals:
-    void newSMSCCenterClicked(int);
-
-private slots:
-    
-    void onPressedCustomButton();
-    void changeAccessPoint(int index);
-    void onSMSCurrentIndexChanged(int index);
-    void createServiceCenterModel();
-    void changeMMSCreationMode(int index);
-    void changeMMSRetrievalMode(int index);
-    void allowAnonymousMMS();
-    void allowMMSAdverts();
-    void onLongPress(QPointF point);
-    void onDataChanged(const QModelIndex& topLeft,const QModelIndex& bottomRight);
-
-private:
-    void initSettingModel();
-    void initGroupPageName();
-    void addMMSGroupItem(HbDataFormModelItem* parent);
-    void addSmsMCGroupItem(HbDataFormModelItem* parent, HbDataFormModel* model);
-    void addSmsEmailGroupItem(HbDataFormModelItem* parent);
-    
-    //sms stuff
-    void activateSMSCCenterList(HbWidget* widget);
-    void activateCustomButtonListItems(HbWidget* widget, int btnIndex);
-    void updateSmsCenterModel();   
-    void fillServiceCenterModel();
-    
-    //email stuff
-    void activateEmailGateway(HbWidget* widget, HbLineEdit* &edit);
-    void activateEmailServiceCenterNo(HbWidget* widget, HbLineEdit* &edit);
-    
-public:
-    void refresh();
-    
-    /**
-     * This is for update Email fields into settings engine
-     */
-    void commitEmailChanges();
-    
-private:
-    /**
-     * different group items.
-     */
-    HbDataFormModelItem* mMMSGroup;
-    HbDataFormModelItem* mSmsMCGroup;
-    HbDataFormModelItem* mSmsEmailGroup;
-
-    /**
-     * groupitem string lists.
-     */
-    QStringList mGroupPageName;
-    QStringList mmsSettingsGroup;
-    QStringList mSmsMCSettingsGroup;
-    QStringList mSmsEmailSettingsGroup;
-
-    /**
-     * The list of smsc centers.
-     */
-    QStringList mSmsServiceList;
-
-    /**
-     * model for sms service centers.
-     */
-    QStandardItemModel* mSmsServiceCenterModel;
-
-    /**
-     * engine instance to read/write settings
-     */
-    MsgSettingEngine* mSettingEngine;
-    
-    /**
-     * sms service center combo box reference.
-     */
-    HbComboBox* mSmsCenterComboBox;
-    
-	/**
-	 * Line edit for Sms Email gateway
-	 */
-    HbLineEdit* mEditEmailGateway;
-	
-	/**
-	 * Line edit for Sms Email Service Number
-	 */
-    HbLineEdit* mEditEmailServiceNumber;
-        
-    /**
-     * default service center index.
-     */
-    int mDefaultServiceCenter;
-    
-    HbDataFormModelItem *emailGateway;
-    HbDataFormModelItem *emailService;
-    
-    
-
-};
-
-#endif /* MSG_ADVANCEDSETTINGS_FORM_H_ */
--- a/messagingapp/msgsettings/settingsview/inc/msgadvancedsettingsview.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +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:  This class is for advanced settings view
- *
- */
-
-#ifndef MSG_ADVANCEDSETTINGS_VIEW_H_
-#define MSG_ADVANCEDSETTINGS_VIEW_H_
-
-#include "msgbaseview.h"
-
-class MsgAdvancedSettingsForm;
-
-class MsgAdvancedSettingsView : public MsgBaseView
-{
-Q_OBJECT
-public:
-    explicit MsgAdvancedSettingsView(QGraphicsItem *parent = 0);
-    ~MsgAdvancedSettingsView();
-    /**
-     * refreshes the view.
-     */
-    void refreshView();
-
-    /**
-     * This is for update Email fields into settings engine
-     */
-    void commitEmailChanges();
-    
-signals:
-    void newSMSCCenterClicked(int);
-
-private:
-    MsgAdvancedSettingsForm* mAdvancedSettingsForm;
-};
-
-#endif /* MSG_ADVANCEDSETTINGS_VIEW_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgsettings/settingsview/inc/msgsettingengine.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,178 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:This class provides API m/w for msg settings plugin
+ *
+ */
+
+#ifndef MSGSETTINGENGINE_H_
+#define MSGSETTINGENGINE_H_
+
+#include <QObject.h>
+
+//FORWARD DECLARATION
+class SmsSettingsPrivate;
+class MmsSettingsPrivate;
+
+/**
+ * This class defines interfaces wrapper b/w MsgSettings UI
+ * and m/w. 
+ */
+class MsgSettingEngine : public QObject
+{
+Q_OBJECT
+
+public:
+    /*
+     * Enum defining Character Encoding
+     */
+    enum CharacterEncoding
+    {
+        ReducedSupport, FullSupport
+    };
+
+    /**
+     * Enum defining MmsRetrieval mode
+     */
+    enum MmsRetrieval
+    {
+        AlwaysAutomatic, AutomInHomeNetwork, Maual, Off, No
+    };
+    
+public:
+
+    /**
+     * Constructor
+     */
+    MsgSettingEngine();
+
+    /**
+     * Destructor
+     */
+    ~MsgSettingEngine();
+
+    /**
+     * for basic message settings
+     * set the status of service messages
+     * @param serviceMessages bool true or false
+     */
+    void setReceiveSerivceMessages(bool serviceMessages);
+
+    /**
+     * set the character encoding
+     * @param encoding specifying encoding type
+     */
+    void setCharacterEncoding(MsgSettingEngine::CharacterEncoding encoding);
+
+    /**
+     * returns settings delivery report status
+     * and character encoding
+     * @param receiveServiceMessages for getting status service messages
+     * @param encoding for char encoding
+     */
+    void settingsServiceMessagesAndCharEncoding( 
+            bool& receiveServiceMessages,
+            MsgSettingEngine::CharacterEncoding& encoding);
+    
+    /**
+     * set the mms retrieval mode
+     * @param retrieval specifying mode
+     */
+    void setMMSRetrieval(MsgSettingEngine::MmsRetrieval);
+
+    /**
+     * set the anonymous message
+     * @param status true or false
+     */
+    void setAnonymousMessages(bool status);
+
+    /**
+     * set for receiving MMS Adverts
+     * @param status for true or false
+     */
+    void setReceiveMMSAdverts(bool status);
+
+    /**
+     * for view 2 mms advance settings\
+     * get all the fields of mms advance setting
+     * @param retrieval return for mms retrieval
+     * @param anonymous return status true or false
+     * @param mmsadverts return status true or false
+     */
+    void advanceMmsSettings(MsgSettingEngine::MmsRetrieval& retrieval,
+                            bool& anonymousStatus, bool& mmsAdvertsStatus);
+
+    /**
+     * get all the MMs access points
+     * @param returns all the access point names
+     * @attention to be displayed as per the index o to total count
+     * @param defaultIndex returns default selected
+     */
+    void allMMsAcessPoints(QStringList& nameList, int& defaultIndex);
+
+    /**
+     * set the default access point
+     * @param index specifying the index
+     */
+    void setMMSAccesspoint(int index);
+
+    /**
+     * get the list of all SMS Message Centres
+     * @param list of all names QString
+     * @param defaultIndex returns default selected
+     */
+    void allSMSMessageCenter(QStringList& nameList, int& defaultIndex);
+
+    /**
+     * set the default SMS message centre
+     * @param index specifying default index
+     */
+    void setSMSMessageCenter(int index);
+
+    /**
+     * for editing the SMS messafe Centre
+     * @param name specifying center name
+     * @param number specifying center number
+     * @param index specying index of message list
+     */
+    void editSmsMessageCenter(QString& centreName, QString& centreNumber,
+                              int index);
+
+    /**
+     * for add new sms message centre
+     * @param name specifying center name
+     * @param number specifying center number
+     */
+    void addSmsMessageCenter(QString& centreName, QString& centreNumber);
+
+    /**
+     * for delete new sms message centre
+     * @param deleteIndex specifying index to delete
+     */
+    void deleteSmsMessageCenter(int deleteIndex);
+    
+    /**
+     * get the sms message centre namd and number
+     * @index for which center needs
+     * @param return name specifying center name
+     * @param return number specifying center number
+     */
+    void smsCenterNameAndNumber(int index, QString& centreName,
+                                QString& centreNumber);    
+    
+private:
+    SmsSettingsPrivate* dptr_smsSettings;
+    MmsSettingsPrivate* dptr_mmsSettings;
+};
+
+#endif /* MSGSETTINGENGINE_H_ */
--- a/messagingapp/msgsettings/settingsview/inc/msgsettingsform.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgsettings/settingsview/inc/msgsettingsform.h	Mon May 03 12:29:07 2010 +0300
@@ -20,31 +20,64 @@
 
 #include <hbdataform.h>
 #include "msgsettingengine.h"
-#include "msgsettingsviewmanager.h"
+
+class HbDataFormModelItem;
+class HbDataFormModel;
+class QStandardItemModel;
+class QStandardItemModel;
 
 class MsgSettingsForm : public HbDataForm
 {
 Q_OBJECT
 public:
-    explicit MsgSettingsForm(
-                             MsgSettingsViewManager* settingsViewManager,
-                             QGraphicsItem *parent = 0);
+    explicit MsgSettingsForm(QGraphicsItem *parent = 0);
     ~MsgSettingsForm();
+    void refreshViewForm();
+    void expandSMSSettings();
     
+signals:
+    void newSMSCCenterClicked(int);
+        
 private:
-    void initSettingModel();    
-
+    void initSettingModel();
+    void addMMSGroupItem(HbDataFormModelItem* parent);
+    void addSmsMCGroupItem(HbDataFormModelItem* parent);
+    void updateSmsMCGroupItem(HbDataFormModelItem* parent);
+    
 private slots:
-    void onPressedAdvanced();
-    void onPressedDelReports();
+    void onPressedServiceMessages();
+    void onPressedCustomButton();
     void changeCharEncoding(int index);
+    void changeAccessPoint(int index);
+    void onSMSCurrentIndexChanged(int index);
+    void changeMMSRetrievalMode(int index);
+    void allowAnonymousMMS();
+    void allowMMSAdverts();
 
 private:
+    
+    HbDataFormModel *settingsModel;
+    
+    /**
+     * SmsGroup model item
+     */
+    HbDataFormModelItem* mSmsMCGroup;
+
+    /**
+     * SMS Center gropu list
+     */
+    QStringList mSmsMCSettingsGroup;
+
+    /**
+     * The list of smsc centers.
+     */
+    QStringList mSmsServiceList;
 
     //msg engine reference
     MsgSettingEngine* mSettingEngine;
     
-    //Settings View Manager
-    MsgSettingsViewManager* mSettingsViewManager;
+    QStandardItemModel* mSmsServiceCenterModel;
+    HbDataFormModelItem *smsMessageCenter;
+
 };
 #endif // MSG_SETTINGSFORM_H
--- a/messagingapp/msgsettings/settingsview/inc/msgsettingsview.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgsettings/settingsview/inc/msgsettingsview.h	Mon May 03 12:29:07 2010 +0300
@@ -28,7 +28,8 @@
 
 class HbMainWindow;
 class HbAction;
-class MsgSettingsViewManager;
+class MsgSMSCenterView;
+class MsgSettingsForm;
 
 class MSG_SETTING_VIEW_EXPORT MsgSettingsView: public MsgBaseView
 {
@@ -38,14 +39,15 @@
     ~MsgSettingsView();
 
 public slots:
-    void closeSettings();
-    void connectCloseAction();
-    
+    void onNewSMSCCenterClicked(int index);
+    void onSmsCenterEditViewClosed();
+        
 private:
-    //Settings View Manager
-    MsgSettingsViewManager* mSettingsViewManager;
+    //Settings Form
+    MsgSettingsForm* mSettingsForm;
     
+    //Sms Center View
+    MsgSMSCenterView* mSMSCenterView;  
     HbMainWindow* mMainWindow;
-    HbAction* mBackAction;
 };
 #endif // MSGSETTINGSVIEW_H
--- a/messagingapp/msgsettings/settingsview/inc/msgsettingsviewmanager.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +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:This is the manager class for managing multiple views
- *
- */
-
-#ifndef MSGSETTINGSVIEWMANAGER_H
-#define MSGSETTINGSVIEWMANAGER_H
-
-#include <QObject>
-class MsgAdvancedSettingsView;
-class MsgSMSCenterView;
-class HbAction;
-class MsgBaseView;
-
-/**
- * View manager for the messaging application. This is a singleton
- * class. Creates and activates the specified view.
- */
-class MsgSettingsViewManager : public QObject
-{
-Q_OBJECT
-
-public:
-    /**
-     * Get an instance of the view manager
-     */
-    MsgSettingsViewManager(QObject* parent = 0);
-
-    /**
-     * Destructor
-     */
-    virtual ~MsgSettingsViewManager();
-
-    /**
-     * open the advanced settings view
-     */
-    void openAdvancedView();
-
-    /**
-     * open messageCenterView
-     * @param mode display either in addition or edit mode
-     * @example 0 - displays in add mode
-     * 			1 - displays in edit mode
-     */
-    void openMessageCenterView(int mode);
-
-signals:
-    void advancedSettingsViewClosed();
-    
-private slots:
-    void closeAdvancedSettingsView();
-    void openSmsCenterView(int mode);
-    void closeSMSCCenterView();
-
-private:
-
-    /**
-     * List View.
-     * Own.
-     */
-    MsgAdvancedSettingsView* mAdvancedSettingsView;
-
-    /**
-     * SMS Center view
-     */
-    MsgSMSCenterView* mSMSCenterView;
-
-    HbAction* mBackAction;    
-};
-
-#endif /* MSGSETTINGSVIEWMANAGER_H */
--- a/messagingapp/msgsettings/settingsview/inc/msgsmscentersettingsform.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgsettings/settingsview/inc/msgsmscentersettingsform.h	Mon May 03 12:29:07 2010 +0300
@@ -34,13 +34,19 @@
     ~MsgSMSCenterSettingsForm();
 
     void commitChanges();
-
+    
+signals:
+    void deleteMessageCentreAndClose();
+    
 public slots:
     void onItemShown(const QModelIndex& topLeft);
     
 private:
     void initSettingModel();
     
+private slots:
+    void onPressedCustomButton();
+    
 private:
     QString mCenterName;
     QString mCenterNumber;
--- a/messagingapp/msgsettings/settingsview/inc/msgsmscenterview.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgsettings/settingsview/inc/msgsmscenterview.h	Mon May 03 12:29:07 2010 +0300
@@ -29,10 +29,16 @@
 public:
     explicit MsgSMSCenterView(int view = -1, QGraphicsItem *parent = 0);
     ~MsgSMSCenterView();
+    
+signals:
+    void smsCenterEditViewClosed();
+    
+private slots:
+    void onBackAction();
+    void onCloseMessageCenterView();
+    
+private:
 
-    void commitChanges();
-
-private:
     MsgSMSCenterSettingsForm* mSMSCenterSettingsForm;
 };
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgsettings/settingsview/inc/smssettingsprivate.h	Mon May 03 12:29:07 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:  This provides the messaging mw interface for sms
+ *
+ */
+
+#ifndef SMSSETTINS_H
+#define SMSSETTINS_H
+
+#include <e32base.h>
+
+/**
+ * SMS setting class implements the SMSC settings
+ * The settings will be stored in the central repository.
+ */
+class SmsSettingsPrivate : public CBase
+{
+public:
+
+    //2phase constructor
+    static SmsSettingsPrivate* NewL();
+
+    /*
+     * Destructor
+     */
+    ~SmsSettingsPrivate();
+
+    /**
+     * sets the status of service messages
+     * @param serviceMessages status true or false
+     */
+    void setReceiveSerivceMessages(TBool serviceMessages);
+
+    /**
+     * set the character encoding
+     * @param status true or false
+     */
+    void setCharacterEncoding(TBool status);
+
+    /**
+     * get the status of deliver report and
+     * character encoding
+     * @param report status of delivery report
+     * @param statusEncoding charcter encoding
+     */
+    void settingsServiceMessagesAndCharEncoding(TBool& report,
+                                              TBool& statusEncoding);
+
+    /**
+     * get all the sms service names and 
+     * the default selected index
+     * @param accessPoints array of access names
+     * @param defaultIndex, default set index
+     */
+    void getAllSMSMessageCenter(RPointerArray<HBufC>& accessPoints,
+                                int &defaultIndex);
+
+    /**
+     * set the default index
+     * @param index default index
+     */
+    void setSMSMessageCenter(int index);
+
+    /**
+     * edit the sms service address
+     * @param address sms address number
+     * @param name sms service name
+     * @param index value to modify
+     */
+    void editSMSServiceCentre(HBufC* address, HBufC* name, TInt index);
+
+    /**
+     * add a new sms service address
+     * @param address service address number
+     * @param name service name
+     */
+    void addSmsMessageCenter(HBufC* address, HBufC* name);
+    
+    /**
+     * delete sms service address
+     * @param aDeleteIndex refers to the index to delete
+     */
+    void deleteSmsMessageCenter(TInt aDeleteIndex);
+    
+
+    /**
+     * get the service name and number by the index value
+     * @param index for the service need
+     * @param centerNumber address of the service
+     * @param centerName name of the service
+     */
+    void smsCenterNameAndNumber(int index, HBufC** centerNumber,
+                                HBufC** centerName);
+
+private:
+
+    /*
+     * 1st phase Constructor 
+     */
+    SmsSettingsPrivate();
+
+    /**
+     * 2nd phase constructor
+     */
+    void ConstructL();
+
+};
+
+#endif // SMSSETTINS_H
+
--- a/messagingapp/msgsettings/settingsview/settingsview.pro	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgsettings/settingsview/settingsview.pro	Mon May 03 12:29:07 2010 +0300
@@ -8,9 +8,9 @@
 
 DEPENDPATH += .
 INCLUDEPATH += .
-INCLUDEPATH += ../msgsettingsmw/inc
 INCLUDEPATH += ../../../inc
 INCLUDEPATH += ../../msgui/inc
+INCLUDEPATH += ../../msgutils/s60qconversions/inc
 INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
 
 CONFIG += hb
@@ -19,27 +19,25 @@
 SYMBIAN_PLATFORMS = WINSCW \
                     ARMV5
     
-LIBS += -lmsgsettingsmw
-
 # Input
-SOURCES += 	src/msgadvancedsettingsform.cpp \
-					 	src/msgadvancedsettingsview.cpp \
-						src/msgsettingsdataformcustomitem.cpp \
-						src/msgsettingsform.cpp \
-						src/msgsettingsviewmanager.cpp \
-						src/msgsettingsview.cpp \
-						src/msgsmscentersettingsform.cpp \
-						src/msgsmscenterview.cpp
+SOURCES +=  src/msgsettingengine.cpp \
+            src/smssettingsprivate.cpp \
+            src/mmssettingsprivate.cpp \
+            src/msgsettingsdataformcustomitem.cpp \
+            src/msgsettingsform.cpp \
+	    src/msgsettingsview.cpp \
+	    src/msgsmscentersettingsform.cpp \
+	    src/msgsmscenterview.cpp
 			
-HEADERS += 	inc/msgadvancedsettingsform.h \
-					  inc/msgadvancedsettingsview.h\
-					  inc/msgsettingsdataformcustomitem.h\
-					  inc/msgsettingsform.h \
-					  inc/msgsettingsviewmanager.h \
-					  inc/msgsettingsview.h \
-						inc/msgsmscentersettingsform.h \
-						inc/msgsmscenterview.h \
-						../../msgui/inc/msgbaseview.h
+HEADERS +=  inc/msgsettingengine.h \
+            inc/smssettingsprivate.h \
+            inc/mmssettingprivate.h \
+            inc/msgsettingsdataformcustomitem.h\
+            inc/msgsettingsform.h \
+	    inc/msgsettingsview.h \
+	    inc/msgsmscentersettingsform.h \
+	    inc/msgsmscenterview.h \
+	    ../../msgui/inc/msgbaseview.h
 		   
 symbian: { 
     TARGET.EPOCALLOWDLLDATA = 1
@@ -52,3 +50,11 @@
     "stub_sis/settingsview_stub.sis   /epoc32/data/z/system/install/settingsview_stub.sis"
      
 TARGET.CAPABILITY = All -TCB
+
+LIBS += -lSmcm \
+    -lmsgs \	
+    -ls60qconversions \
+    -lcommdb \
+    -lmmsserversettings \
+    -lmmsgenericsettings
+    
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgsettings/settingsview/src/mmssettingsprivate.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,452 @@
+/*
+ * 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:  This provides the messaging mw interface for MMS
+ *
+ */
+
+#include <commdb.h>
+#include <commdbconnpref.h>
+#include <msvapi.h>
+#include <msvstd.h>
+#include <msvuids.h>
+#include <mmsaccount.h>
+#include <mmssettings.h>
+#include <mtclreg.h> //For client reg
+#include <mmsclient.h> //For MMS client
+#include <mmsconst.h>
+
+#include "debugtraces.h"
+
+
+#include "mmssettingprivate.h"
+
+/**
+ * Message Server session event handler 
+ */
+class CEventHandler : public MMsvSessionObserver
+{
+public:
+    void HandleSessionEvent(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2,
+                            TAny* aArg3);
+    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2,
+                             TAny* aArg3);
+};
+void CEventHandler::HandleSessionEvent(TMsvSessionEvent /*aEvent*/,
+                                       TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
+{
+}
+void CEventHandler::HandleSessionEventL(TMsvSessionEvent /*aEvent*/,
+                                        TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
+{
+}
+
+//two phase constructor
+MmsSettingsPrivate* MmsSettingsPrivate::NewL()
+{
+    MmsSettingsPrivate* self = new (ELeave) MmsSettingsPrivate();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+}
+
+//---------------------------------------------------------------
+// MmsSettingsPrivate::MmsSettingsPrivate
+// @see header
+//---------------------------------------------------------------
+MmsSettingsPrivate::MmsSettingsPrivate()
+{
+    //do nothing
+}
+
+//2nd phase constructor
+void MmsSettingsPrivate::ConstructL()
+{
+    //for debug only
+    //createRepositoryL();    
+}
+
+//---------------------------------------------------------------
+// MmsSettingsPrivate::~MmsSettingsPrivate
+// @see header
+//---------------------------------------------------------------
+MmsSettingsPrivate::~MmsSettingsPrivate()
+{
+    // do nothing
+}
+
+//---------------------------------------------------------------
+// MmsSettingsPrivate::createRepository
+// @see header
+//---------------------------------------------------------------
+void MmsSettingsPrivate::createRepositoryL()
+{
+    CEventHandler* pObserver = new (ELeave) CEventHandler();
+    CleanupStack::PushL(pObserver);
+
+    CMsvSession* iMsvSession = CMsvSession::OpenSyncL(*pObserver);
+    CleanupStack::PushL(iMsvSession);
+
+    CMmsSettings* mmsSetting = CMmsSettings::NewL();
+    CleanupStack::PushL(mmsSetting);
+
+    mmsSetting->LoadSettingsL();
+
+    TMsvId entryToBeKilled = KMsvNullIndexEntryId;
+    // Get access to root index
+    CMsvEntry* cEntry = iMsvSession->GetEntryL(KMsvRootIndexEntryId);
+    CleanupStack::PushL(cEntry);
+
+    entryToBeKilled = mmsSetting->Service();
+    cEntry->SetSortTypeL(TMsvSelectionOrdering(KMsvNoGrouping,
+                                               EMsvSortByNone,
+                                               ETrue));
+    if (entryToBeKilled == KMsvNullIndexEntryId)
+    {
+        mmsSetting->CreateNewServiceL(*iMsvSession);
+    }
+
+    CleanupStack::PopAndDestroy(); // cEntry          
+
+    mmsSetting->SetReceivingModeHome(EMmsReceivingAutomatic);
+    mmsSetting->SetReceivingModeForeign(EMmsReceivingAutomatic);
+
+    mmsSetting->SaveSettingsL();
+
+    CleanupStack::PopAndDestroy(3); // settings    
+}
+
+void MmsSettingsPrivate::setMMSRetrieval(MsgSettingEngine::MmsRetrieval aRetrieval)
+{
+    CEventHandler* pObserver = new (ELeave) CEventHandler();
+    CleanupStack::PushL(pObserver);
+
+    CMsvSession* mMsvSession = CMsvSession::OpenSyncL(*pObserver);
+    CleanupStack::PushL(mMsvSession);
+
+    CClientMtmRegistry* mMtmReg = CClientMtmRegistry::NewL(*mMsvSession);
+    CleanupStack::PushL(mMtmReg);
+    
+    CMmsClientMtm* mMmsClient = static_cast<CMmsClientMtm*> 
+                                      (mMtmReg->NewMtmL(KUidMsgTypeMultimedia));
+    CleanupStack::PushL(mMmsClient);
+    
+    CMmsSettings* mMmsSetting = CMmsSettings::NewL();
+    CleanupStack::PushL(mMmsSetting);
+
+    //Load settings
+    mMmsClient->RestoreSettingsL();
+    mMmsSetting->CopyL( mMmsClient->MmsSettings() );
+
+    //do your operation
+    TMmsReceivingMode receveMode = EMmsReceivingAutomatic;
+
+    if (aRetrieval == MsgSettingEngine::Maual)
+        receveMode = EMmsReceivingManual;
+    else if (aRetrieval == MsgSettingEngine::Off)
+        receveMode = EMmsReceivingPostpone;
+    else if (aRetrieval == MsgSettingEngine::No)
+        receveMode = EMmsReceivingReject;
+
+    if (aRetrieval == MsgSettingEngine::AlwaysAutomatic)
+        {
+        mMmsSetting->SetReceivingModeForeign(receveMode);
+        }
+    else
+        {
+        mMmsSetting->SetReceivingModeForeign(EMmsReceivingManual);
+        }
+
+    mMmsSetting->SetReceivingModeHome(receveMode);
+    
+    //save the settings
+    mMmsClient->SetSettingsL( *mMmsSetting );
+    //TODO:User Input should be blocked when save is being done
+    //This should be called as this takes care of automatic 
+    //downloading of messages upon change of retrieval mode
+    mMmsClient->StoreSettingsL();
+
+    CleanupStack::PopAndDestroy(5);
+}
+
+void MmsSettingsPrivate::setAnonymousMessages(TBool aAnonymous)
+{
+    CMmsAccount* mMmsAccount = CMmsAccount::NewL();
+    CleanupStack::PushL(mMmsAccount);
+
+    CMmsSettings* mMmsSetting = CMmsSettings::NewL();
+    CleanupStack::PushL(mMmsSetting);
+
+    mMmsAccount->LoadSettingsL(*mMmsSetting);
+
+    //do your operation
+    mMmsSetting->SetAcceptAnonymousMessages(aAnonymous);
+
+    //save the settings
+    mMmsAccount->SaveSettingsL(*mMmsSetting);
+    CleanupStack::PopAndDestroy(2);
+}
+
+void MmsSettingsPrivate::setReceiveMMSAdverts(TBool aReceiveAdvert)
+{
+    CMmsAccount* mMmsAccount = CMmsAccount::NewL();
+    CleanupStack::PushL(mMmsAccount);
+
+    CMmsSettings* mMmsSetting = CMmsSettings::NewL();
+    CleanupStack::PushL(mMmsSetting);
+
+    mMmsAccount->LoadSettingsL(*mMmsSetting);
+
+    //do your operation
+    mMmsSetting->SetAcceptAdvertisementMessages(aReceiveAdvert);
+
+    //save the settings
+    mMmsAccount->SaveSettingsL(*mMmsSetting);
+    CleanupStack::PopAndDestroy(2);
+}
+
+void MmsSettingsPrivate::advanceMmsSettings(
+                                            MsgSettingEngine::MmsRetrieval& aRetrieval,
+                                            TBool& aAnonymousStatus,
+                                            TBool& aMmsAdvertsStatus)
+{
+    CMmsAccount* mMmsAccount = CMmsAccount::NewL();
+    CleanupStack::PushL(mMmsAccount);
+
+    CMmsSettings* mMmsSetting = CMmsSettings::NewL();
+    CleanupStack::PushL(mMmsSetting);
+
+    mMmsAccount->LoadSettingsL(*mMmsSetting);
+
+    TMmsReceivingMode receveMode = mMmsSetting->ReceivingModeHome();
+    
+    if (receveMode == EMmsReceivingManual)
+        aRetrieval = MsgSettingEngine::Maual;
+    else if (receveMode == EMmsReceivingPostpone)
+        aRetrieval = MsgSettingEngine::Off;
+    else if (receveMode == EMmsReceivingReject)
+        aRetrieval = MsgSettingEngine::No;
+
+    receveMode = mMmsSetting->ReceivingModeForeign();
+    if (receveMode == EMmsReceivingAutomatic)
+        {
+        aRetrieval = MsgSettingEngine::AlwaysAutomatic;
+        }
+
+    aAnonymousStatus = mMmsSetting->AcceptAnonymousMessages();
+
+    aMmsAdvertsStatus = mMmsSetting->AcceptAdvertisementMessages();
+
+    CleanupStack::PopAndDestroy(2);
+}
+
+//---------------------------------------------------------------
+// SmsSettings::iAPSelector
+// @see header
+//---------------------------------------------------------------
+void MmsSettingsPrivate::getAllAccessPoints(
+                                            RPointerArray<HBufC>& aAccessPoints,
+                                            TInt& aDefaultIndex)
+{
+#ifdef _DEBUG_TRACES_
+		qDebug() << "Enter MmsSettingsPrivate::getAllAccessPoints: Index= " << aDefaultIndex;
+#endif
+
+    CCommsDatabase *db;
+    CCommsDbTableView *view;
+    TInt result, err;
+
+    //select the access point and store it in cenrep
+    CMmsAccount* mmsAccount = CMmsAccount::NewL();
+    CleanupStack::PushL(mmsAccount);
+
+    CMmsSettings* mMmsSetting = CMmsSettings::NewL();
+    CleanupStack::PushL(mMmsSetting);
+
+    mmsAccount->LoadSettingsL(*mMmsSetting);
+
+    //select the default access point
+    TInt32 defaultId = mMmsSetting->AccessPoint(0);
+
+    TBuf<KCommsDbSvrMaxColumnNameLength> iapName;
+    TBuf<KCommsDbSvrMaxFieldLength> serviceType;
+    TUint32 iapId = 0;
+    db = CCommsDatabase::NewL(EDatabaseTypeIAP);
+    CleanupStack::PushL(db);
+    view = db->OpenTableLC(TPtrC(IAP));
+
+    // Walk through records
+    result = view->GotoFirstRecord();
+    TInt recordIndex = 0;
+    while (result == KErrNone)
+    {
+        TRAP(err, view->ReadTextL(TPtrC(COMMDB_NAME), iapName));
+        TRAP(err, view->ReadTextL(TPtrC(IAP_SERVICE_TYPE), serviceType));
+#ifdef __WINSCW__
+        if (serviceType.CompareF(TPtrC(LAN_SERVICE)) == 0)
+        {
+            HBufC* accessPointName = iapName.Alloc();
+            aAccessPoints.AppendL(accessPointName);
+            TRAP(err, view->ReadUintL(TPtrC(COMMDB_ID), iapId));
+            
+            // check to see if this is default set for MMsAccesspoint
+            if (defaultId == iapId)
+            {
+               aDefaultIndex = recordIndex;
+            }
+            recordIndex++;
+        }
+#else
+        if(serviceType.CompareF(TPtrC(OUTGOING_GPRS)) == 0)
+        {
+            HBufC* accessPointName = iapName.Alloc();
+            aAccessPoints.AppendL(accessPointName);
+            TRAP(err, view->ReadUintL(TPtrC(COMMDB_ID), iapId));
+            
+            // check to see if this is default set for MMsAccesspoint
+            if (defaultId == iapId)
+            {
+                aDefaultIndex = recordIndex;
+            }
+        recordIndex++;
+        }
+#endif           
+        TRAP(err, result = view->GotoNextRecord());
+    }
+    CleanupStack::PopAndDestroy(4); // nMmsSettings, db,view
+#ifdef _DEBUG_TRACES_
+		qDebug() << "Exit MmsSettingsPrivate::getAllAccessPoints: Index=" 
+	          << aDefaultIndex
+	          << "\n";
+#endif
+
+}
+
+//---------------------------------------------------------------
+// MmsSettingsPrivate::setMMSAccesspoint
+// @see header
+//---------------------------------------------------------------
+void MmsSettingsPrivate::setMMSAccesspoint(TInt& aDefaultIndex)
+{
+#ifdef _DEBUG_TRACES_
+		qDebug() << "Enter MmsSettingsPrivate::setMMSAccesspoint: Index=" 
+	          << aDefaultIndex
+	          << "\n";
+#endif
+
+	          
+    //select the access point and store it in cenrep
+    CMmsAccount* mmsAccount = CMmsAccount::NewL();
+    CleanupStack::PushL(mmsAccount);
+
+    CMmsSettings* mMmsSetting = CMmsSettings::NewL();
+    CleanupStack::PushL(mMmsSetting);
+
+    mmsAccount->LoadSettingsL(*mMmsSetting);
+
+    CCommsDatabase *db;
+    CCommsDbTableView *view;
+    TInt result, err;
+
+    TCommDbConnPref prefs;
+
+    TBuf<KCommsDbSvrMaxColumnNameLength> iapName;
+    TBuf<KCommsDbSvrMaxFieldLength> serviceType;
+    TUint32 iapId = 0;
+    db = CCommsDatabase::NewL(EDatabaseTypeIAP);
+    CleanupStack::PushL(db);
+    view = db->OpenTableLC(TPtrC(IAP));
+
+    // Walk through records
+    result = view->GotoFirstRecord();
+    TInt serviceCounter = 0;
+    while (result == KErrNone)
+    {
+        TRAP(err, view->ReadTextL(TPtrC(COMMDB_NAME), iapName));
+        TRAP(err, view->ReadTextL(TPtrC(IAP_SERVICE_TYPE), serviceType));
+
+#ifdef __WINSCW__
+        if (serviceType.CompareF(TPtrC(LAN_SERVICE)) == 0 && serviceCounter
+                == aDefaultIndex)
+        {
+            TRAP(err, view->ReadUintL(TPtrC(COMMDB_ID), iapId));
+            prefs.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
+            prefs.SetDirection(ECommDbConnectionDirectionOutgoing);
+            prefs.SetIapId(iapId);
+
+            while (mMmsSetting->AccessPointCount())
+            {
+                mMmsSetting->DeleteAccessPointL(0);
+            }
+            if (iapId != 0)
+            {
+#ifdef _DEBUG_TRACES_
+		        qDebug() << "Set MMs Accesspoint IAP ID:"
+            	         << iapId;
+#endif
+
+
+                mMmsSetting->AddAccessPointL(iapId, 0);
+            }
+            mmsAccount->SaveSettingsL(*mMmsSetting);
+            serviceCounter++;
+        }
+        else if (serviceType.CompareF(TPtrC(LAN_SERVICE)) == 0)
+        	{
+        		serviceCounter++;
+        	}
+#else
+        if(serviceType.CompareF(TPtrC(OUTGOING_GPRS)) == 0 &&
+                serviceCounter == aDefaultIndex)
+        {
+            TRAP(err, view->ReadUintL(TPtrC(COMMDB_ID), iapId));
+            prefs.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
+            prefs.SetDirection(ECommDbConnectionDirectionOutgoing);
+            prefs.SetIapId(iapId);
+
+            while ( mMmsSetting->AccessPointCount() )
+            {
+#ifdef _DEBUG_TRACES_
+                qDebug() << "Set MMs Accesspoint IAP ID:"
+            	         << iapId;
+#endif
+
+                mMmsSetting->DeleteAccessPointL( 0 );
+            }
+            if ( iapId != 0 )
+            {
+                mMmsSetting->AddAccessPointL(iapId, 0);
+            }
+            mmsAccount->SaveSettingsL(*mMmsSetting);
+            serviceCounter++;
+        }
+        else if(serviceType.CompareF(TPtrC(OUTGOING_GPRS)) == 0)
+        {
+        		serviceCounter++;
+        }        	
+#endif          
+        TRAP(err, result = view->GotoNextRecord());
+    }
+
+    CleanupStack::PopAndDestroy(4); // mMmsSetting, db,view
+#ifdef _DEBUG_TRACES_
+		qDebug() << "Exit MmsSettingsPrivate::setMMSAccesspoint: Index=" 
+	          << aDefaultIndex
+	          << "\n";
+#endif
+
+}
+
+//eof
+
--- a/messagingapp/msgsettings/settingsview/src/msgadvancedsettingsform.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,567 +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:This class is for drawing form for advanced view 
- * settings
- *
- */
-
-#include "msgadvancedsettingsform.h"
-#include "msgsettingengine.h"
-
-#include <hbdataformviewitem.h>
-#include <hbdataformmodelitem.h>
-#include <hbdataformmodel.h>
-#include <hbpushbutton.h>
-#include <hbcombobox.h>
-#include <hbinputeditorinterface.h>
-#include <HbLineEdit>
-#include <QStandardItemModel>
-#include "debugtraces.h"
-
-//Localized Strings
-#define LOC_ADVANCED_SETTINGS hbTrId("txt_messaging_title_advanced_settings_messaging")
-#define LOC_MMS_SETTINGS hbTrId("txt_messaging_subhead_mms_settings")
-#define LOC_SMS_CENTRE_SETTINGS hbTrId("txt_messaging_subhead_sms_message_centre_settings")
-#define LOC_MMS_CREATION_MODE hbTrId("txt_messaging_setlabel_mms_creation_mode")
-#define LOC_MMS_RETRIEVAL hbTrId("txt_messaging_setlabel_mms_retrieval")
-#define LOC_ALLOW_ANONYMOUS_MMS hbTrId("txt_messaging_setlabel_allow_anonymous_mms_message")
-#define LOC_RECEIVE_MMS_ADVERTS hbTrId("txt_messaging_setlabel_receive_mms_adverts")
-#define LOC_MMS_AP_IN_USE hbTrId("txt_messaging_setlabel_mms_access_point_in_use")
-#define LOC_SMS_CENTRE_IN_USE hbTrId("txt_messaging_setlabel_sms_message_centre_in_use")
-#define LOC_ADD_NEW hbTrId("txt_messaging_button_add_new")
-
-#define LOC_RESTRICTED hbTrId("txt_messaging_setlabel_val_restricted")
-#define LOC_GUIDED hbTrId("txt_messaging_setlabel_val_guided")
-#define LOC_FREE hbTrId("txt_messaging_setlabel_val_free")
-
-#define LOC_ALWAYS_AUTOMATIC hbTrId("txt_messaging_setlabel_val_always_automatic")
-#define LOC_AUTO_HOME_NETWORK hbTrId("txt_messaging_setlabel_val_auto_home_network")
-#define LOC_MANUAL hbTrId("txt_messaging_setlabel_val_mannual")
-#define LOC_ON hbTrId("txt_messaging_setlabel_val_on")
-#define LOC_OFF hbTrId("txt_messaging_setlabel_val_off")
-
-#define LOC_MMS_YES hbTrId("txt_messaging_setlabel_allow_anonymous_mms_val_yes")
-#define LOC_MMS_NO hbTrId("txt_messaging_setlabel_allow_anonymous_mms_val_no")
-
-MsgAdvancedSettingsForm::MsgAdvancedSettingsForm(QGraphicsItem *parent) :
-    HbDataForm(parent), mSmsServiceCenterModel(0), mEditEmailGateway(0),
-            mEditEmailServiceNumber(0), mDefaultServiceCenter(0)
-    {
-    this->setHeading(LOC_ADVANCED_SETTINGS);
-
-    mSettingEngine = new MsgSettingEngine();
-
-    initGroupPageName();
-    initSettingModel();
-    }
-
-MsgAdvancedSettingsForm::~MsgAdvancedSettingsForm()
-    {
-    delete mSettingEngine;
-    }
-
-void MsgAdvancedSettingsForm::initGroupPageName()
-{
-    mGroupPageName << LOC_MMS_SETTINGS 
-                   << LOC_SMS_CENTRE_SETTINGS 
-                   << tr("SMS E-mail settings");
-
-    mmsSettingsGroup << LOC_MMS_CREATION_MODE 
-                     << LOC_MMS_RETRIEVAL 
-                     << LOC_ALLOW_ANONYMOUS_MMS 
-                     << LOC_RECEIVE_MMS_ADVERTS 
-                     << LOC_MMS_AP_IN_USE;
-
-    mSmsMCSettingsGroup << LOC_SMS_CENTRE_IN_USE 
-                        << LOC_ADD_NEW;
-
-    mSmsEmailSettingsGroup << tr("E-mail gateway") << tr("E-mail service centre number");
-}
-
-void MsgAdvancedSettingsForm::initSettingModel()
-{
-    HbDataFormModel *advancedSettingsmodel = new HbDataFormModel();
-
-    mMMSGroup = new HbDataFormModelItem(HbDataFormModelItem::GroupItem, mGroupPageName.at(0), 0);
-
-    HbDataFormModelItem* rootItem = advancedSettingsmodel->invisibleRootItem();
-
-    advancedSettingsmodel->appendDataFormItem(mMMSGroup, rootItem);
-
-    addMMSGroupItem(mMMSGroup);
-
-    mSmsMCGroup = new HbDataFormModelItem(HbDataFormModelItem::GroupItem, mGroupPageName.at(1), 0);
-
-    advancedSettingsmodel->appendDataFormItem(mSmsMCGroup, rootItem);
-
-    addSmsMCGroupItem(mSmsMCGroup, advancedSettingsmodel);
-
-    mSmsEmailGroup = new HbDataFormModelItem(HbDataFormModelItem::GroupItem, mGroupPageName.at(2),
-        0);
-
-    advancedSettingsmodel->appendDataFormItem(mSmsEmailGroup, rootItem);
-
-    addSmsEmailGroupItem(mSmsEmailGroup);
-
-    this->setModel(advancedSettingsmodel);
-}
-
-void MsgAdvancedSettingsForm::addMMSGroupItem(HbDataFormModelItem* parent)
-{
-    //read settings
-    MsgSettingEngine::MmsCreationMode creationMode = MsgSettingEngine::Guided;
-    MsgSettingEngine::MmsRetrieval retrieval = MsgSettingEngine::AlwaysAutomatic;
-    bool allowAnonymous = true;
-    bool allowAdverts = true;
-
-    mSettingEngine->advanceMmsSettings(creationMode, retrieval, allowAnonymous, allowAdverts);
-    // add all the mmss group item
-    HbDataFormModelItem *mmsCreationMode = new HbDataFormModelItem(
-        HbDataFormModelItem::ComboBoxItem, mmsSettingsGroup.at(0), 0);
-
-    QStringList mmsCreationModeList;
-    mmsCreationModeList << LOC_RESTRICTED 
-                        << LOC_GUIDED 
-                        << LOC_FREE;
-
-    mmsCreationMode->setContentWidgetData("items", mmsCreationModeList);
-    mmsCreationMode->setContentWidgetData("currentIndex", int(creationMode));
-    this->addConnection(mmsCreationMode, SIGNAL(currentIndexChanged(int)),
-            this, SLOT(changeMMSCreationMode(int)));
-
-    HbDataFormModelItem *mmsRetrieval = new HbDataFormModelItem(
-            HbDataFormModelItem::ComboBoxItem, mmsSettingsGroup.at(1), 0);
-
-    QStringList mmsRetrievalList;
-    mmsRetrievalList << LOC_ALWAYS_AUTOMATIC 
-                     << LOC_AUTO_HOME_NETWORK 
-                     << LOC_MANUAL
-                     << LOC_OFF
-                     << LOC_ON;
-
-    mmsRetrieval->setContentWidgetData("items", mmsRetrievalList);
-    mmsRetrieval->setContentWidgetData("currentIndex", int(retrieval));
-    this->addConnection(mmsRetrieval, SIGNAL(currentIndexChanged(int)), this,
-            SLOT(changeMMSRetrievalMode(int)));
-
-    HbDataFormModelItem *anonymousMMS = new HbDataFormModelItem(
-        HbDataFormModelItem::ToggleValueItem, mmsSettingsGroup.at(2), 0);
-
-    QStringList anonymousMMSList;
-    anonymousMMSList << LOC_MMS_NO 
-                     << LOC_MMS_YES;
-
-    int defaultIndex = int(allowAnonymous);
-    int alternateIndex = (defaultIndex + 1) % anonymousMMSList.count();
-
-    anonymousMMS->setContentWidgetData("text", anonymousMMSList.at(
-            defaultIndex));
-    anonymousMMS->setContentWidgetData("additionalText", anonymousMMSList.at(
-            alternateIndex));
-    this->addConnection(anonymousMMS, SIGNAL(clicked()), this,
-            SLOT(allowAnonymousMMS()));
-
-    HbDataFormModelItem *mmsAdverts = new HbDataFormModelItem(HbDataFormModelItem::ToggleValueItem,
-        mmsSettingsGroup.at(3), 0);
-
-    QStringList mmsAdvertsList;
-    mmsAdvertsList << LOC_MMS_NO 
-                   << LOC_MMS_YES;
-
-    defaultIndex = int(allowAdverts);
-    alternateIndex = (defaultIndex + 1) % mmsAdvertsList.count();
-
-    mmsAdverts->setContentWidgetData("text", mmsAdvertsList.at(defaultIndex));
-    mmsAdverts->setContentWidgetData("additionalText", mmsAdvertsList.at(
-            alternateIndex));
-    this->addConnection(mmsAdverts, SIGNAL(clicked()), this,
-            SLOT(allowMMSAdverts()));
-
-    HbDataFormModelItem *accessPoint = new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem,
-        mmsSettingsGroup.at(4), 0);
-
-    QStandardItemModel* comboModel = new QStandardItemModel();
-
-    QStringList mmsList;
-    int defaultAccessPointIndex = -1;
-
-    mSettingEngine->allMMsAcessPoints(mmsList, defaultAccessPointIndex);
-    int accessPoints = mmsList.count();
-    for (int a = 0; a < accessPoints; ++a)
-        {
-        QStandardItem* item = new QStandardItem();
-        item->setData(mmsList[a], Qt::DisplayRole);
-        comboModel->appendRow(item);
-        }
-    accessPoint->setModel(comboModel);
-    accessPoint->setContentWidgetData("items", mmsList);
-    if (defaultAccessPointIndex >= 0)
-        {
-        accessPoint->setContentWidgetData("currentIndex",
-                defaultAccessPointIndex);
-        }
-    QDEBUG_WRITE_FORMAT("Settings: adding accesspoints..", defaultAccessPointIndex);
-    this->addConnection(accessPoint, SIGNAL(currentIndexChanged(int)), this,
-            SLOT(changeAccessPoint(int)));
-
-    parent->appendChild(mmsCreationMode);
-    parent->appendChild(mmsRetrieval);
-    parent->appendChild(anonymousMMS);
-    parent->appendChild(mmsAdverts);
-    parent->appendChild(accessPoint);
-}
-
-void MsgAdvancedSettingsForm::addSmsMCGroupItem(HbDataFormModelItem* parent,
-    HbDataFormModel* advancedSettingsmodel)
-{
-    // add all the sms message center group item
-    HbDataFormModelItem *smsMessageCenter = new HbDataFormModelItem(
-        HbDataFormModelItem::ComboBoxItem, mSmsMCSettingsGroup.at(0), 0);
-
-    mSettingEngine->allSMSMessageCenter(mSmsServiceList,
-            mDefaultServiceCenter);
-            
-    QDEBUG_WRITE_FORMAT("MsgAdvancedSettingsForm::addSmsMCGroupItem Default", mDefaultServiceCenter);
-    //create and fill service center model.
-    createServiceCenterModel();
-
-    smsMessageCenter->setModel(mSmsServiceCenterModel);
-    smsMessageCenter->setContentWidgetData("items", mSmsServiceList);
-    
-    if (mDefaultServiceCenter > 0)
-    {
-     smsMessageCenter->setContentWidgetData("currentIndex",
-             mDefaultServiceCenter);
-    }
-    
-    this->addConnection(smsMessageCenter, SIGNAL(currentIndexChanged(int)),
-            this, SLOT(onSMSCurrentIndexChanged(int)));
-
-    parent->appendChild(smsMessageCenter);
-
-    //CUSTOM SETTING ITEM HbButton
-    HbDataFormModelItem::DataItemType
-            customButtonGeneral =
-                    static_cast<HbDataFormModelItem::DataItemType> (HbDataFormModelItem::CustomItemBase
-                            + 1);
-
-    int totalServices = mSmsServiceList.count();
-    for (int index = 0; index < totalServices; index++)
-        {
-        HbDataFormModelItem *newMessageCenters =
-                advancedSettingsmodel->appendDataFormItem(
-                        customButtonGeneral, QString(""), parent);
-
-        newMessageCenters->setContentWidgetData("text", mSmsServiceList.at(
-                index));
-        this->addConnection(
-                newMessageCenters, 
-                SIGNAL(clicked()), 
-                this,
-                SLOT(onPressedCustomButton()));
-        this->addConnection(
-                newMessageCenters, 
-                SIGNAL(longPress(QPointF)),
-                this,
-                SLOT(onLongPress(QPointF)));
-        }
-
-    HbDataFormModelItem *newMessageCenters = advancedSettingsmodel->appendDataFormItem(
-            customButtonGeneral, QString(""), parent);
-
-    newMessageCenters->setContentWidgetData("text", mSmsMCSettingsGroup.at(1));
-    this->addConnection(newMessageCenters, SIGNAL(clicked()),
-            this,SLOT(onPressedCustomButton()));
-    this->addConnection(newMessageCenters, SIGNAL(longPress(QPointF)),
-    this,SLOT(onLongPress(QPointF)));
-    }
-
-void MsgAdvancedSettingsForm::addSmsEmailGroupItem(
-        HbDataFormModelItem* parent)
-    {
-    QString emailSmsNum = QString();
-    QString emailGatewayTxt = QString();
-
-    mSettingEngine->emailEmailGatewayAndServiceCenterNumber(emailGatewayTxt,
-            emailSmsNum);
-
-    // add all the sms email group item
-    emailGateway = new HbDataFormModelItem(HbDataFormModelItem::TextItem,
-            mSmsEmailSettingsGroup.at(0), 0);
-
-    emailGateway->setContentWidgetData("text", emailGatewayTxt);
-    connect(emailGateway->model(),
-            SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)),
-            this, SLOT(onDataChanged(const QModelIndex&, const QModelIndex&)));
-
-    emailService = new HbDataFormModelItem(HbDataFormModelItem::TextItem,
-            mSmsEmailSettingsGroup.at(1), 0);
-    emailService->setContentWidgetData("text", emailSmsNum);
-    connect(emailService->model(),
-                SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)),
-                this, SLOT(onDataChanged(const QModelIndex&, const QModelIndex&)));
-    
-    parent->appendChild(emailGateway);
-    parent->appendChild(emailService);
-
-    }
-
-void MsgAdvancedSettingsForm::onSMSCurrentIndexChanged(int index)
-    {
-#ifdef _DEBUG_TRACES_
-    qDebug()
-            << "Enter MsgAdvancedSettingsForm::onSMSCurrentIndexChanged index="
-            << index << "\n";
-#endif
-
-    //set into msg settings
-    mSettingEngine->setSMSMessageCenter(index);
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit MsgAdvancedSettingsForm::onSMSCurrentIndexChanged \n";
-#endif
-
-    }
-
-// mms settings slots defined here
-void MsgAdvancedSettingsForm::changeMMSCreationMode(int index)
-    {
-    mSettingEngine->setMMSCreationmode(MsgSettingEngine::MmsCreationMode(
-            index));
-    }
-
-void MsgAdvancedSettingsForm::changeMMSRetrievalMode(int index)
-    {
-    mSettingEngine->setMMSRetrieval(MsgSettingEngine::MmsRetrieval(index));
-    }
-
-void MsgAdvancedSettingsForm::allowAnonymousMMS()
-    {
-    HbPushButton *btn = qobject_cast<HbPushButton *> (sender());
-
-    if (btn)
-        {
-        QString btnText = btn->text();
-
-        //check if the button pressed was Yes or NO
-        if (LOC_MMS_YES == btnText)
-            {
-            mSettingEngine->setAnonymousMessages(true);
-            }
-        else
-            {
-            mSettingEngine->setAnonymousMessages(false);
-            }
-        }
-    }
-
-void MsgAdvancedSettingsForm::allowMMSAdverts()
-    {
-    HbPushButton *btn = qobject_cast<HbPushButton *> (sender());
-
-    if (btn)
-        {
-        QString btnText = btn->text();
-
-        //check if the button pressed was Yes or NO
-        if (LOC_MMS_NO == btnText)
-            {
-            mSettingEngine->setReceiveMMSAdverts(true);
-            }
-        else
-            {
-            mSettingEngine->setReceiveMMSAdverts(false);
-            }
-        }
-    }
-
-void MsgAdvancedSettingsForm::changeAccessPoint(int index)
-    {
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Enter MsgAdvancedSettingsForm::changeAccessPoint index="
-            << index << "\n";
-#endif
-
-    // save to the mms settings
-    mSettingEngine->setMMSAccesspoint(index);
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit MsgAdvancedSettingsForm::changeAccessPoint";
-#endif
-    }
-
-void MsgAdvancedSettingsForm::onPressedCustomButton()
-    {
-    HbPushButton *btn = qobject_cast<HbPushButton *> (sender());
-
-    if (btn)
-        {
-        QString btnText = btn->text();
-        if (btnText == mSmsMCSettingsGroup.at(1))
-            {
-            // emit the signal to open add view 
-            emit newSMSCCenterClicked(-1);
-            }
-        else
-            {
-            int index = mSmsServiceList.indexOf(btnText);
-            emit newSMSCCenterClicked(index);
-            }
-        }
-    }
-
-void MsgAdvancedSettingsForm::refresh()
-    {
-    int childCount = mSmsMCGroup->childCount();
-    //remove items after mSmsCenterComboBox till new center button.
-    if (childCount > 0){
-        mSmsMCGroup->removeChildren(1, childCount - 2);
-      }
-    updateSmsCenterModel();
-    }
-
-void MsgAdvancedSettingsForm::commitEmailChanges()
-    {
-    if (mEditEmailGateway == NULL || mEditEmailServiceNumber == NULL)
-        {
-        return;
-        }
-
-    QString emailGateway = mEditEmailGateway->text();
-    QString emailServiceCenter = mEditEmailServiceNumber->text();
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Enter MsgAdvancedSettingsForm::commitEmailChanges "
-            << emailGateway << " " << emailServiceCenter;
-#endif
-
-    mSettingEngine->setEmailGateway(emailGateway);
-
-    //set the smsc center number
-    mSettingEngine->setEmailSeriveCenterNumber(emailServiceCenter);
-
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Exit MsgAdvancedSettingsForm::commitEmailChanges\n";
-#endif
-
-    }
-
-void MsgAdvancedSettingsForm::updateSmsCenterModel()
-    {
-    mSmsServiceList.clear();
-    mSettingEngine->allSMSMessageCenter(mSmsServiceList,
-            mDefaultServiceCenter);
-
-    HbDataFormModelItem* smsCenterCombo = mSmsMCGroup->childAt(0);
-    QAbstractItemModel* mod = const_cast<QAbstractItemModel*> (this->model());
-    HbDataFormModel* advancedSettingsmodel =
-            static_cast<HbDataFormModel*> (mod);
-    int msgCenterComboIndex = advancedSettingsmodel->indexFromItem(
-            smsCenterCombo).row();
-
-    //clear model before refilling.
-    mSmsServiceCenterModel->clear();
-    fillServiceCenterModel();
-
-    //CUSTOM SETTING ITEM HbButton
-    HbDataFormModelItem::DataItemType
-            customButtonGeneral =
-                    static_cast<HbDataFormModelItem::DataItemType> (HbDataFormModelItem::CustomItemBase
-                            + 1);
-
-    int itemCount = mSmsServiceList.count();
-    for (int i = 0; i < itemCount; ++i)
-        {
-        //add custom buttons.
-        HbDataFormModelItem *messageCenters = new HbDataFormModelItem(
-                customButtonGeneral, QString(), mSmsMCGroup);
-
-        messageCenters->setData(HbDataFormModelItem::KeyRole,
-                mSmsServiceList.at(i));
-
-        advancedSettingsmodel->insertDataFormItem(
-                msgCenterComboIndex + 1 + i, messageCenters, mSmsMCGroup);
-        }
-    }
-
-void MsgAdvancedSettingsForm::createServiceCenterModel()
-    {
-    mSmsServiceCenterModel = new QStandardItemModel();
-
-    //to know when is model destroyed.
-    connect(mSmsServiceCenterModel, SIGNAL(destroyed()), this,
-            SLOT(createServiceCenterModel()));
-
-    fillServiceCenterModel();
-    }
-
-void MsgAdvancedSettingsForm::fillServiceCenterModel()
-    {
-    QStringList serviceCenters;
-    mSettingEngine->allSMSMessageCenter(serviceCenters, mDefaultServiceCenter);
-
-    int itemCount = serviceCenters.count();
-    
-    QDEBUG_WRITE_FORMAT("MsgAdvancedSettingsForm::fillServiceCenterModel..", itemCount);
-    for (int i = 0; i < itemCount; ++i)
-        {
-        QStandardItem *item = new QStandardItem;
-        item->setData(serviceCenters.at(i), Qt::DisplayRole);
-        QDEBUG_WRITE_FORMAT("MsgAdvancedSettingsForm::fillServiceCenterModel Setdata", serviceCenters.at(i));
-        mSmsServiceCenterModel->appendRow(item);
-        }
-    }
-
-void MsgAdvancedSettingsForm::activateEmailServiceCenterNo(HbWidget* widget,
-        HbLineEdit* &edit)
-    {
-    // editing finished SIGNAL is still not coming in week48MCL
-    HbLineEdit* editWidget = qobject_cast<HbLineEdit *> (widget);
-
-    if (editWidget)
-        {
-        edit = editWidget;
-        HbEditorInterface editorInterface(edit);
-        editorInterface.setUpAsPhoneNumberEditor();
-        //connect(edit, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
-        }
-    }
-
-void MsgAdvancedSettingsForm::onLongPress(QPointF point)
-    {
-    Q_UNUSED(point);
-    }
-
-void MsgAdvancedSettingsForm::onDataChanged(const QModelIndex& topLeft,
-        const QModelIndex& bottomRight)
-    {
-    HbDataFormModelItem *itemData =
-    static_cast<HbDataFormModel *> (model())->itemFromIndex(topLeft);
-
-    if (itemData && itemData == emailGateway && !mEditEmailGateway)
-        {
-             mEditEmailGateway = 
-                     static_cast<HbLineEdit *>(this->dataFormViewItem(topLeft)->dataItemContentWidget());
-         }
-    else if (itemData && itemData == emailService && !mEditEmailServiceNumber)
-                {
-                mEditEmailServiceNumber = 
-                        static_cast<HbLineEdit *>(this->dataFormViewItem(topLeft)->dataItemContentWidget());
-                HbEditorInterface editorInterface(mEditEmailServiceNumber);
-                    editorInterface.setUpAsPhoneNumberEditor();
-
-                        }
-
-                    }
-                //eof
--- a/messagingapp/msgsettings/settingsview/src/msgadvancedsettingsview.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +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:  This class is for advanced settings view
- *
- */
-
-#include "msgadvancedsettingsview.h"
-#include "msgadvancedsettingsform.h"
-#include "msgsettingsdataformcustomitem.h"
-
-MsgAdvancedSettingsView::MsgAdvancedSettingsView(QGraphicsItem *parent) :
-    MsgBaseView(parent), mAdvancedSettingsForm(0)
-{
-
-    mAdvancedSettingsForm = new MsgAdvancedSettingsForm(this);
-
-    //custom prototype
-    MsgSettingsDataFormCustomItem* customPrototype = 
-            new MsgSettingsDataFormCustomItem(mAdvancedSettingsForm);
-    
-    QList<HbAbstractViewItem*> protos =
-            mAdvancedSettingsForm->itemPrototypes();
-    protos.append(customPrototype);
-    mAdvancedSettingsForm->setItemPrototypes(protos);
-
-    setWidget(mAdvancedSettingsForm);
-
-    connect(mAdvancedSettingsForm, SIGNAL(newSMSCCenterClicked(int)), this,
-            SIGNAL(newSMSCCenterClicked(int)));
-    }
-
-MsgAdvancedSettingsView::~MsgAdvancedSettingsView()
-{
-}
-
-void MsgAdvancedSettingsView::refreshView()
-    {
-    mAdvancedSettingsForm->refresh();
-    }
-
-void MsgAdvancedSettingsView::commitEmailChanges()
-{
-    mAdvancedSettingsForm->commitEmailChanges();
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgsettings/settingsview/src/msgsettingengine.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,423 @@
+/*
+ * 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:This class provides API m/w for msg settings plugin
+ *
+ */
+
+#include "qstringlist.h"
+#include "debugtraces.h"
+
+
+#include "msgsettingengine.h"
+#include "smssettingsprivate.h"
+#include "mmssettingprivate.h"
+#include "s60qconversions.h"
+
+//Constructor
+MsgSettingEngine::MsgSettingEngine()
+{
+#ifdef _DEBUG_TRACES_
+    qDebug() << "Enter MsgSettingEngine::MsgSettingEngine";
+#endif
+
+
+    dptr_smsSettings = SmsSettingsPrivate::NewL();
+    dptr_mmsSettings = MmsSettingsPrivate::NewL();
+
+#ifdef _DEBUG_TRACES_
+    qDebug() << "Exit MsgSettingEngine::MsgSettingEngine";
+#endif
+
+}
+
+//Destructor
+MsgSettingEngine::~MsgSettingEngine()
+{
+#ifdef _DEBUG_TRACES_
+    qDebug() << "Enter MsgSettingEngine::~MsgSettingEngine";
+#endif
+
+
+    delete dptr_smsSettings;
+    delete dptr_mmsSettings;
+
+#ifdef _DEBUG_TRACES_
+    qDebug() << "Exit MsgSettingEngine::~MsgSettingEngine";
+#endif
+
+}
+
+/**
+ * for basic message settings
+ * set the service messages status
+ * @param serviceMessages bool true or false
+ */
+void MsgSettingEngine::setReceiveSerivceMessages(bool serviceMessages)
+{
+    dptr_smsSettings->setReceiveSerivceMessages(serviceMessages);
+    
+}
+
+/**
+ * set the character encoding
+ * @param encoding specifying encoding type
+ */
+void MsgSettingEngine::setCharacterEncoding(MsgSettingEngine::CharacterEncoding encoding)
+{
+#ifdef _DEBUG_TRACES_
+    qDebug() << "MsgSettingEngine::setCharacterEncoding: " << encoding;
+#endif
+
+
+    TBool flag = EFalse;
+
+    if (encoding == MsgSettingEngine::FullSupport)
+    {
+        flag = ETrue;
+    }
+    dptr_smsSettings->setCharacterEncoding(flag);
+    
+#ifdef _DEBUG_TRACES_
+    qDebug() << "MsgSettingEngine::setCharacterEncoding";
+#endif
+
+}
+
+/**
+ * returns settings delivery report status
+ * and character encoding
+ * @param receiveServiceMessages for getting receive service messages
+ * @param encoding for char encoding
+ */
+void MsgSettingEngine::settingsServiceMessagesAndCharEncoding( 
+        bool& receiveServiceMessages,
+        MsgSettingEngine::CharacterEncoding& encoding )
+{
+    QDEBUG_WRITE("settingsServiceMessagesAndCharEncoding");
+    
+    TBool encoding1;
+    TBool receiveServiceMessages1;
+    
+    dptr_smsSettings->settingsServiceMessagesAndCharEncoding(
+            receiveServiceMessages1,
+            encoding1);
+    
+    if (encoding1)
+    {
+        encoding = MsgSettingEngine::FullSupport;
+    }
+    else
+        encoding = MsgSettingEngine::ReducedSupport;
+    
+    //TODO remove hardcoding later
+    //receiveServiceMessages = (bool)receiveServiceMessages1;
+    receiveServiceMessages = true;
+    
+    return;
+}
+
+/**
+ * set the mms retrieval mode
+ * @param retrieval specifying mode
+ */
+void MsgSettingEngine::setMMSRetrieval(MsgSettingEngine::MmsRetrieval retrieval)
+{
+#ifdef _DEBUG_TRACES_
+    qDebug() << "MsgSettingEngine::setMMSRetrieval " << retrieval;
+#endif
+
+
+    dptr_mmsSettings->setMMSRetrieval(retrieval);
+
+#ifdef _DEBUG_TRACES_
+    qDebug() << "Exit setMMSRetrieval";
+#endif
+
+}
+
+/**
+ * set the anonymous message
+ * @param status true or false
+ */
+void MsgSettingEngine::setAnonymousMessages(bool status)
+{
+#ifdef _DEBUG_TRACES_
+    qDebug() << "MsgSettingEngine::setAnonymousMessages " << status;
+#endif
+
+
+    dptr_mmsSettings->setAnonymousMessages(status);
+
+#ifdef _DEBUG_TRACES_
+    qDebug() << "Exit setAnonymousMessages";
+#endif
+
+}
+
+/**
+ * set for receiving MMS Adverts
+ * @param status for true or false
+ */
+void MsgSettingEngine::setReceiveMMSAdverts(bool status)
+{
+#ifdef _DEBUG_TRACES_
+    qDebug() << "MsgSettingEngine::setReceiveMMSAdverts " << status;
+#endif
+
+
+    dptr_mmsSettings->setReceiveMMSAdverts(status);
+
+#ifdef _DEBUG_TRACES_
+    qDebug() << "Exit setReceiveMMSAdverts";
+#endif
+
+}
+
+/**
+ * for view 2 mms advance settings\
+* get all the fields of mms advance setting
+ * @param retrieval return for mms retrieval
+ * @param anonymous return status true or false
+ * @param mmsadverts return status true or false
+ */
+void MsgSettingEngine::advanceMmsSettings(MsgSettingEngine::MmsRetrieval& retrieval,
+                                          bool& anonymousStatus,
+                                          bool& mmsAdvertsStatus)
+{
+#ifdef _DEBUG_TRACES_
+    qDebug() << "MsgSettingEngine::setReceiveMMSAdverts";
+#endif
+
+
+    TBool anonymous_Status;
+    TBool mmsAdverts_Status;
+    dptr_mmsSettings->advanceMmsSettings(retrieval,
+                                         anonymous_Status,
+                                         mmsAdverts_Status);
+
+    anonymousStatus = (bool) anonymous_Status;
+    mmsAdvertsStatus = (bool) mmsAdverts_Status;
+
+#ifdef _DEBUG_TRACES_
+    qDebug() << "Exit setReceiveMMSAdverts " << retrieval << " "
+            << anonymousStatus << " " << mmsAdvertsStatus;
+#endif
+
+}
+
+/**
+ * get all the MMs access points
+ * @param returns all the access point names
+ * @attention to be displayed as per the index o to total count
+ */
+void MsgSettingEngine::allMMsAcessPoints(QStringList& nameList,
+                                         int& defaultIndex)
+{
+#ifdef _DEBUG_TRACES_
+    qDebug() << "MsgSettingEngine::allMMsAcessPoints";
+#endif
+
+
+    RPointerArray<HBufC> accessPoints;
+    //= new(ELeave)RPointerArray<HBufC>();
+
+    dptr_mmsSettings->getAllAccessPoints(accessPoints, defaultIndex);
+
+    for (int i = 0; i < accessPoints.Count(); i++)
+        {
+        HBufC* name = static_cast<HBufC *> (accessPoints[i]);
+        QString qName = S60QConversions::s60DescToQString(name->Des());
+        nameList.append(qName);
+#ifdef _DEBUG_TRACES_
+        qDebug() << "\n " << qName;
+#endif
+
+        }
+    accessPoints.ResetAndDestroy();
+
+#ifdef _DEBUG_TRACES_
+    qDebug() << "Exit allMMsAcessPoints count = " << nameList.count()
+            << " Default:" << defaultIndex;
+#endif
+
+}
+
+/**
+ * set the default access point
+ * @param index specifying the index
+ */
+void MsgSettingEngine::setMMSAccesspoint(int index)
+{
+#ifdef _DEBUG_TRACES_
+    qDebug() << "MsgSettingEngine::setMMSAccesspoint " << index;
+#endif
+
+
+    dptr_mmsSettings->setMMSAccesspoint(index);
+
+#ifdef _DEBUG_TRACES_
+    qDebug() << "Exit setMMSAccesspoint ";
+#endif
+
+}
+
+/**
+ * get the list of all SMS Message Centres
+ * @param list of all names QString
+ */
+void MsgSettingEngine::allSMSMessageCenter(QStringList& nameList,
+                                           int& defaultIndex)
+{
+
+#ifdef _DEBUG_TRACES_
+    qDebug() << "MsgSettingEngine::allSMSMessageCenter";
+#endif
+
+
+    RPointerArray<HBufC> accessPoints;
+
+    dptr_smsSettings->getAllSMSMessageCenter(accessPoints, defaultIndex);
+
+    for (int i = 0; i < accessPoints.Count(); i++)
+        {
+        HBufC* name = accessPoints[i];
+        QString qName = S60QConversions::s60DescToQString(name->Des());
+        nameList.append(qName);
+#ifdef _DEBUG_TRACES_
+        qDebug() << "\n qName";
+#endif
+
+        }
+    accessPoints.ResetAndDestroy();
+
+#ifdef _DEBUG_TRACES_
+    qDebug() << "Exit allSMSMessageCenter count = " << nameList.count()
+            << " Default:" << defaultIndex;
+#endif
+
+}
+
+/**
+ * set the default SMS message centre
+ * @param index specifying default index
+ */
+void MsgSettingEngine::setSMSMessageCenter(int index)
+{
+#ifdef _DEBUG_TRACES_
+    qDebug() << "MsgSettingEngine::setSMSMessageCenter " << index;
+#endif
+
+
+    dptr_smsSettings->setSMSMessageCenter(index);
+
+#ifdef _DEBUG_TRACES_
+    qDebug() << "Exit setSMSMessageCenter ";
+#endif
+
+}
+
+/**
+ * for editing the SMS messafe Centre
+ * @param name specifying center name
+ * @param number specifying center number
+ * @param index specying index of message list
+ */
+void MsgSettingEngine::editSmsMessageCenter(QString& centreName,
+                                            QString& centreNumber, int index)
+{
+#ifdef _DEBUG_TRACES_
+    qDebug() << "MsgSettingEngine::editSmsMessageCenter " << index << " "
+            << centreName << " " << centreNumber;
+#endif
+
+    HBufC* d_addr = S60QConversions::qStringToS60Desc(centreNumber);
+    HBufC* d_name = S60QConversions::qStringToS60Desc(centreName);
+
+    dptr_smsSettings->editSMSServiceCentre(d_addr, d_name, index);
+    delete d_addr;
+    delete d_name;
+
+#ifdef _DEBUG_TRACES_
+    qDebug() << "Exit editSmsMessageCenter ";
+#endif
+
+}
+
+/**
+ * for add new sms message centre
+ * @param name specifying center name
+ * @param number specifying center number
+ */
+void MsgSettingEngine::addSmsMessageCenter(QString& centreName,
+                                           QString& centreNumber)
+{
+#ifdef _DEBUG_TRACES_
+    qDebug() << "MsgSettingEngine::addSmsMessageCenter " << centreName << " "
+            << centreNumber;
+#endif
+
+
+    HBufC* d_addr = S60QConversions::qStringToS60Desc(centreNumber);
+    HBufC* d_name = S60QConversions::qStringToS60Desc(centreName);
+
+    dptr_smsSettings->addSmsMessageCenter(d_addr, d_name);
+    delete d_addr;
+    delete d_name;
+
+#ifdef _DEBUG_TRACES_
+    qDebug() << "Exit addSmsMessageCenter ";
+#endif
+
+}
+
+/**
+ * for delete sms message centre
+ * @refer to header file
+ */
+void MsgSettingEngine::deleteSmsMessageCenter(int deleteIndex)
+{
+    dptr_smsSettings->deleteSmsMessageCenter(deleteIndex);
+}
+
+/**
+ * get the sms message centre namd and number
+ * @index for which center needs
+ * @param return name specifying center name
+ * @param return number specifying center number
+ */
+void MsgSettingEngine::smsCenterNameAndNumber(int index, QString& centreName,
+                                              QString& centreNumber)
+{
+#ifdef _DEBUG_TRACES_
+    qDebug() << "MsgSettingEngine::smsCenterNameAndNumber " << index;
+#endif
+
+
+    HBufC* d_addr;
+    HBufC* d_name;
+
+    dptr_smsSettings->smsCenterNameAndNumber(index, &d_addr, &d_name);
+
+    centreNumber = S60QConversions::s60DescToQString(d_addr->Des());
+    centreName = S60QConversions::s60DescToQString(d_name->Des());
+
+#ifdef _DEBUG_TRACES_
+    qDebug() << "Exit smsCenterNameAndNumber " << centreNumber << " "
+            << centreName;
+#endif
+
+}
+
+//eof
+
--- a/messagingapp/msgsettings/settingsview/src/msgsettingsform.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgsettings/settingsview/src/msgsettingsform.cpp	Mon May 03 12:29:07 2010 +0300
@@ -22,27 +22,52 @@
 #include <hbdataformmodel.h>
 #include <hbcombobox.h>
 #include <hbpushbutton.h>
+#include <QStandardItemModel>
 
 #include "debugtraces.h"
 
 //Localized constants
-#define LOC_DELIVERY_REPORTS hbTrId("txt_messaging_setlabel_delivery_reports")
+#define LOC_MESSAGE_SETTINGS_HEADING hbTrId("txt_messaging_title_messaging_settings")
+#define LOC_RECEIVING_SERVICE_MESSAGES hbTrId("txt_messaging_setlabel_receiving_service_messages")
 #define LOC_ON hbTrId("txt_messaging_setlabel_val_on")
 #define LOC_OFF hbTrId("txt_messaging_setlabel_val_off")
 #define LOC_REDUCED_SUPPORT hbTrId("txt_messaging_setlabel_val_reduced_support")
 #define LOC_FULL_SUPPORT hbTrId("txt_messaging_setlabel_val_full_support")
 #define LOC_ADVANCED hbTrId("txt_messaging_button_advanced")
 #define LOC_CHAR_ENCODING hbTrId("txt_messaging_setlabel_character_encoding")
-
+#define LOC_MMS_SETTINGS hbTrId("txt_messaging_subhead_mms_settings")
+#define LOC_SMS_CENTRE_SETTINGS hbTrId("txt_messaging_subhead_sms_message_centre_settings")
 
-MsgSettingsForm::MsgSettingsForm(MsgSettingsViewManager* settingsViewManager,
-	                               QGraphicsItem *parent)
-:HbDataForm(parent), mSettingsViewManager(settingsViewManager)
+#define LOC_MMS_CREATION_MODE hbTrId("txt_messaging_setlabel_mms_creation_mode")
+#define LOC_MMS_RETRIEVAL hbTrId("txt_messaging_setlabel_mms_retrieval")
+#define LOC_ALLOW_ANONYMOUS_MMS hbTrId("txt_messaging_setlabel_allow_anonymous_mms_message")
+#define LOC_RECEIVE_MMS_ADVERTS hbTrId("txt_messaging_setlabel_receive_mms_adverts")
+#define LOC_MMS_AP_IN_USE hbTrId("txt_messaging_setlabel_mms_access_point_in_use")
+#define LOC_SMS_CENTRE_IN_USE hbTrId("txt_messaging_setlabel_sms_message_centre_in_use")
+#define LOC_ADD_NEW hbTrId("txt_messaging_button_add_new")
+#define LOC_ALWAYS_AUTOMATIC hbTrId("txt_messaging_setlabel_val_always_automatic")
+#define LOC_AUTO_HOME_NETWORK hbTrId("txt_messaging_setlabel_val_auto_home_network")
+#define LOC_MANUAL hbTrId("txt_messaging_setlabel_val_mannual")
+#define LOC_MMS_YES hbTrId("txt_messaging_setlabel_allow_anonymous_mms_val_yes")
+#define LOC_MMS_NO hbTrId("txt_messaging_setlabel_allow_anonymous_mms_val_no")
+
+MsgSettingsForm::MsgSettingsForm(QGraphicsItem *parent) :
+    HbDataForm(parent)
 {
-    this->setHeading(tr("Application settings: Messaging"));
+    this->setHeading(LOC_MESSAGE_SETTINGS_HEADING);
 
     mSettingEngine = new MsgSettingEngine();
 
+    //custom prototype
+    MsgSettingsDataFormCustomItem* customPrototype =
+            new MsgSettingsDataFormCustomItem(this);
+
+    QList<HbAbstractViewItem*> protos = this->itemPrototypes();
+    protos.append(customPrototype);
+    this->setItemPrototypes(protos);
+
+    mSmsMCSettingsGroup << LOC_SMS_CENTRE_IN_USE << LOC_ADD_NEW;
+
     //initialize the form model
     initSettingModel();
 }
@@ -54,79 +79,349 @@
 
 void MsgSettingsForm::initSettingModel()
 {
-    HbDataFormModel *model = new HbDataFormModel(0);
-
-    bool deliveryReoprt = false;
-    MsgSettingEngine::CharacterEncoding charEncoding = MsgSettingEngine::ReducedSupport;
+    settingsModel = new HbDataFormModel(0);
 
-    mSettingEngine->settingsDeliverReportAndCharEncoding(deliveryReoprt, charEncoding);
+    MsgSettingEngine::CharacterEncoding charEncoding =
+            MsgSettingEngine::ReducedSupport;
 
-    QStringList deliveryReoprtList;
-    deliveryReoprtList << LOC_OFF << LOC_ON;
-
-    int index = int(deliveryReoprt);
-    int otherIndex = (deliveryReoprt + 1) % deliveryReoprtList.count();
+    bool receiveServiceMessages = false;
 
-    // 1. create the first item delivery reports
-    HbDataFormModelItem *deliverReports = new HbDataFormModelItem(
-                HbDataFormModelItem::ToggleValueItem, 
-                LOC_DELIVERY_REPORTS, 0);
-    deliverReports->setContentWidgetData("text", deliveryReoprtList.at(index));
-    deliverReports->setContentWidgetData("additionalText", deliveryReoprtList.at(otherIndex));
+    mSettingEngine->settingsServiceMessagesAndCharEncoding(
+            receiveServiceMessages,
+            charEncoding);
 
-    model->appendDataFormItem(deliverReports, model->invisibleRootItem());
-    this->addConnection(deliverReports, SIGNAL(clicked()),
-                this,SLOT(onPressedDelReports()));
-    
-    // 2. Character encoding
-    HbDataFormModelItem *characterEncoding = new HbDataFormModelItem(
-            HbDataFormModelItem::ComboBoxItem, 
-            LOC_CHAR_ENCODING, 0);
+    // 1. Character encoding
+    HbDataFormModelItem *characterEncoding =
+            new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem,
+                                    LOC_CHAR_ENCODING,
+                                    0);
     QStringList charEncodingList;
     charEncodingList << LOC_REDUCED_SUPPORT << LOC_FULL_SUPPORT;
 
-    index = int(charEncoding);
+    int index = int (charEncoding);
 
     characterEncoding->setContentWidgetData("items", charEncodingList);
     characterEncoding->setContentWidgetData("currentIndex", index);
 
-    model->appendDataFormItem(characterEncoding, model->invisibleRootItem());
-    this->addConnection(characterEncoding, SIGNAL(currentIndexChanged(int)),
-                    this,SLOT(changeCharEncoding(int)));
-    
-    // 3. CUSTOM SETTING ITEM HbButton
-    HbDataFormModelItem::DataItemType customItem =
-        static_cast<HbDataFormModelItem::DataItemType> (HbDataFormModelItem::CustomItemBase + 1);
+    settingsModel->appendDataFormItem(characterEncoding,
+                                      settingsModel->invisibleRootItem());
+    this->addConnection(characterEncoding,
+                        SIGNAL(currentIndexChanged(int)),
+                        this,
+                        SLOT(changeCharEncoding(int)));
+
+    //2. receiving service messages
+    QStringList serviceMessagesList;
+    serviceMessagesList << LOC_OFF << LOC_ON;
+
+    index = int (receiveServiceMessages);
+    int otherIndex = (receiveServiceMessages + 1) % serviceMessagesList.count();
+
+    HbDataFormModelItem *serviceMessagesItem =
+            new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem,
+                                    LOC_RECEIVING_SERVICE_MESSAGES,
+                                    0);
+
+    serviceMessagesItem->setContentWidgetData("items", serviceMessagesList);
+    serviceMessagesItem->setContentWidgetData("currentIndex", index);
+
+    settingsModel->appendDataFormItem(serviceMessagesItem,
+                                      settingsModel->invisibleRootItem());
+    this->addConnection(serviceMessagesItem,
+                        SIGNAL(clicked()),
+                        this,
+                        SLOT(onPressedServiceMessages()));
+
+    // 3. MMS Settings
+    HbDataFormModelItem* mmsGroup =
+            new HbDataFormModelItem(HbDataFormModelItem::GroupItem,
+                                    LOC_MMS_SETTINGS,
+                                    0);
+
+    settingsModel->appendDataFormItem(mmsGroup,
+                                      settingsModel->invisibleRootItem());
+
+    addMMSGroupItem(mmsGroup);
+
+    // 4. SMS Settings
+    mSmsMCGroup = new HbDataFormModelItem(HbDataFormModelItem::GroupItem,
+                                          LOC_SMS_CENTRE_SETTINGS,
+                                          0);
+
+    settingsModel->appendDataFormItem(mSmsMCGroup,
+                                      settingsModel->invisibleRootItem());
+
+    addSmsMCGroupItem(mSmsMCGroup);
+
+    this->setModel(settingsModel);
+}
+
+void MsgSettingsForm::refreshViewForm()
+{
+    updateSmsMCGroupItem(mSmsMCGroup);
+}
 
-    HbDataFormModelItem *advancedSettings
-        = model->appendDataFormItem(customItem, QString(), model->invisibleRootItem());
+void MsgSettingsForm::updateSmsMCGroupItem(HbDataFormModelItem* parent)
+{
+    //1. update the combobox model item
+    int defaultServiceCenter = -1;
+    mSmsServiceList.clear();
+    mSettingEngine->allSMSMessageCenter(mSmsServiceList, defaultServiceCenter);
+
+    mSmsServiceCenterModel->clear();
+    
+    //recreate all the model items 
+    int itemCount = mSmsServiceList.count();
+    for (int i = 0; i < itemCount; ++i)
+    {
+        QStandardItem *item = new QStandardItem;
+        item->setData(mSmsServiceList.at(i), Qt::DisplayRole);
+        mSmsServiceCenterModel->appendRow(item);
+    }
+    //set the content widget data again
+    if(itemCount > 0)
+    {
+       smsMessageCenter->setContentWidgetData("items", mSmsServiceList);
+    }
+
+    smsMessageCenter->setContentWidgetData("currentIndex",
+                                               defaultServiceCenter);
     
-    advancedSettings->setContentWidgetData("text", LOC_ADVANCED);
-    this->addConnection(advancedSettings, SIGNAL(clicked()),
-            this,SLOT(onPressedAdvanced())); 
-            
-    this->setModel(model);
+    //2. refresh all the custom buttons again
+    int childCount = parent->childCount();
+    int totalServices = mSmsServiceList.count();
+
+    //custom buttons start from index 1 till childCount-2
+    int list_index = 0, child_index = 1;
+    for (; list_index < totalServices && child_index <= childCount - 2; list_index++, child_index++)
+    {
+        //get the existing custom item instance
+        HbDataFormModelItem* customItem = parent->childAt(child_index);
+        customItem->setContentWidgetData("text", mSmsServiceList.at(list_index));
+    }
+
+    //if extra child items are remaining then delete those from parent
+    for(;child_index <= childCount - 2;
+            child_index++)
+    {
+        parent->removeChild(child_index);
+    }
+    
+    //create all new custom items if new are added in list
+    //CUSTOM SETTING ITEM HbButton
+    HbDataFormModelItem::DataItemType
+            customButtonGeneral =
+                    static_cast<HbDataFormModelItem::DataItemType> (HbDataFormModelItem::CustomItemBase
+                            + 1);
+    for (; list_index < totalServices; list_index++, child_index++)
+    {
+        HbDataFormModelItem* newChild =
+                new HbDataFormModelItem(customButtonGeneral);
+
+        newChild->setContentWidgetData("text", mSmsServiceList.at(list_index));
+        parent->insertChild(child_index, newChild);
+
+        this->addConnection(newChild,
+                            SIGNAL(clicked()),
+                            this,
+                            SLOT(onPressedCustomButton()));
+    }    
 }
 
-void MsgSettingsForm::onPressedAdvanced()
+void MsgSettingsForm::addMMSGroupItem(HbDataFormModelItem* parent)
 {
-    //tell view manager to open advanced view
-    mSettingsViewManager->openAdvancedView();
+    //read settings
+    MsgSettingEngine::MmsRetrieval retrieval =
+            MsgSettingEngine::AlwaysAutomatic;
+    bool allowAnonymous = true;
+    bool allowAdverts = true;
+
+    mSettingEngine->advanceMmsSettings(retrieval, 
+                                       allowAnonymous, 
+                                       allowAdverts);
+
+    // add all the mms group item
+
+    HbDataFormModelItem *mmsRetrieval =
+            new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem,
+                                    LOC_MMS_RETRIEVAL,
+                                    0);
+
+    QStringList mmsRetrievalList;
+    mmsRetrievalList << LOC_ALWAYS_AUTOMATIC << LOC_AUTO_HOME_NETWORK
+            << LOC_MANUAL << LOC_OFF;
+
+    mmsRetrieval->setContentWidgetData("items", mmsRetrievalList);
+    mmsRetrieval->setContentWidgetData("currentIndex", int (retrieval));
+    this->addConnection(mmsRetrieval,
+                        SIGNAL(currentIndexChanged(int)),
+                        this,
+                        SLOT(changeMMSRetrievalMode(int)));
+
+    HbDataFormModelItem *anonymousMMS =
+            new HbDataFormModelItem(HbDataFormModelItem::ToggleValueItem,
+                                    LOC_ALLOW_ANONYMOUS_MMS,
+                                    0);
+
+    QStringList anonymousMMSList;
+    anonymousMMSList << LOC_MMS_NO << LOC_MMS_YES;
+
+    int defaultIndex = int (allowAnonymous);
+    int alternateIndex = (defaultIndex + 1) % anonymousMMSList.count();
+
+    anonymousMMS->setContentWidgetData("text",
+                                       anonymousMMSList.at(defaultIndex));
+    anonymousMMS->setContentWidgetData("additionalText",
+                                       anonymousMMSList.at(alternateIndex));
+    this->addConnection(anonymousMMS,
+                        SIGNAL(clicked()),
+                        this,
+                        SLOT(allowAnonymousMMS()));
+
+    HbDataFormModelItem *mmsAdverts =
+            new HbDataFormModelItem(HbDataFormModelItem::ToggleValueItem,
+                                    LOC_RECEIVE_MMS_ADVERTS,
+                                    0);
+
+    QStringList mmsAdvertsList;
+    mmsAdvertsList << LOC_MMS_NO << LOC_MMS_YES;
+
+    defaultIndex = int (allowAdverts);
+    alternateIndex = (defaultIndex + 1) % mmsAdvertsList.count();
+
+    mmsAdverts->setContentWidgetData("text", mmsAdvertsList.at(defaultIndex));
+    mmsAdverts->setContentWidgetData("additionalText",
+                                     mmsAdvertsList.at(alternateIndex));
+
+    this->addConnection(mmsAdverts,
+                        SIGNAL(clicked()),
+                        this,
+                        SLOT(allowMMSAdverts()));
+
+    HbDataFormModelItem *accessPoint =
+            new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem,
+                                    LOC_MMS_AP_IN_USE,
+                                    0);
+
+    QStandardItemModel* comboModel = new QStandardItemModel();
+
+    QStringList mmsList;
+    int defaultAccessPointIndex = -1;
+
+    mSettingEngine->allMMsAcessPoints(mmsList, defaultAccessPointIndex);
+    int accessPoints = mmsList.count();
+    for (int a = 0; a < accessPoints; ++a)
+    {
+        QStandardItem* item = new QStandardItem();
+        item->setData(mmsList[a], Qt::DisplayRole);
+        comboModel->appendRow(item);
+    }
+    accessPoint->setModel(comboModel);
+    accessPoint->setContentWidgetData("items", mmsList);
+    if (defaultAccessPointIndex >= 0)
+    {
+        accessPoint->setContentWidgetData("currentIndex",
+                                          defaultAccessPointIndex);
+    }
+    QDEBUG_WRITE_FORMAT("Settings: adding accesspoints..", defaultAccessPointIndex);
+    this->addConnection(accessPoint,
+                        SIGNAL(currentIndexChanged(int)),
+                        this,
+                        SLOT(changeAccessPoint(int)));
+
+    parent->appendChild(mmsRetrieval);
+    parent->appendChild(anonymousMMS);
+    parent->appendChild(mmsAdverts);
+    parent->appendChild(accessPoint);
 }
 
-void MsgSettingsForm::onPressedDelReports()
+void MsgSettingsForm::addSmsMCGroupItem(HbDataFormModelItem* parent)
+{
+    // add all the sms message center group item
+    smsMessageCenter
+            = new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem,
+                                      mSmsMCSettingsGroup.at(0),
+                                      0);
+
+    int defaultServiceCenter = -1;
+    mSmsServiceList.clear();
+    mSettingEngine->allSMSMessageCenter(mSmsServiceList, defaultServiceCenter);
+    mSmsServiceCenterModel = new QStandardItemModel(this);
+
+    int itemCount = mSmsServiceList.count();
+    for (int i = 0; i < itemCount; ++i)
+    {
+        QStandardItem *item = new QStandardItem;
+        item->setData(mSmsServiceList.at(i), Qt::DisplayRole);
+        mSmsServiceCenterModel->appendRow(item);
+    }
+
+    smsMessageCenter->setModel(mSmsServiceCenterModel);
+    smsMessageCenter->setContentWidgetData("items", mSmsServiceList);
+
+    if (defaultServiceCenter >= 0)
+    {
+        smsMessageCenter->setContentWidgetData("currentIndex",
+                                               defaultServiceCenter);
+    }
+
+    this->addConnection(smsMessageCenter,
+                        SIGNAL(currentIndexChanged(int)),
+                        this,
+                        SLOT(onSMSCurrentIndexChanged(int)));
+
+    parent->appendChild(smsMessageCenter);
+
+    //CUSTOM SETTING ITEM HbButton
+    HbDataFormModelItem::DataItemType
+            customButtonGeneral =
+                    static_cast<HbDataFormModelItem::DataItemType> (HbDataFormModelItem::CustomItemBase
+                            + 1);
+
+    int totalServices = mSmsServiceList.count();
+    for (int index = 0; index < totalServices; index++)
+    {
+        HbDataFormModelItem *newMessageCenters =
+                settingsModel->appendDataFormItem(customButtonGeneral,
+                                                  QString(""),
+                                                  parent);
+
+        newMessageCenters->setContentWidgetData("text",
+                                                mSmsServiceList.at(index));
+        this->addConnection(newMessageCenters,
+                            SIGNAL(clicked()),
+                            this,
+                            SLOT(onPressedCustomButton()));
+    }
+
+    HbDataFormModelItem *newMessageCenters =
+            settingsModel->appendDataFormItem(customButtonGeneral,
+                                              QString(""),
+                                              parent);
+
+    newMessageCenters->setContentWidgetData("text", mSmsMCSettingsGroup.at(1));
+    this->addConnection(newMessageCenters,
+                        SIGNAL(clicked()),
+                        this,
+                        SLOT(onPressedCustomButton()));
+}
+
+void MsgSettingsForm::onPressedServiceMessages()
 {
     HbPushButton *btn = qobject_cast<HbPushButton *> (sender());
 
-    if (btn) {
+    if (btn)
+    {
         QString btnText = btn->text();
 
         //check if the button pressed was On or Off
-        if (LOC_OFF == btnText) {
-            mSettingEngine->setDeliveryReport(false);
+        if (LOC_OFF == btnText)
+        {
+            mSettingEngine->setReceiveSerivceMessages(false);
         }
-        else {
-            mSettingEngine->setDeliveryReport(true);
+        else
+        {
+            mSettingEngine->setReceiveSerivceMessages(true);
         }
     }
 }
@@ -137,5 +432,87 @@
     mSettingEngine->setCharacterEncoding(MsgSettingEngine::CharacterEncoding(index));
 }
 
+void MsgSettingsForm::changeMMSRetrievalMode(int index)
+{
+    mSettingEngine->setMMSRetrieval(MsgSettingEngine::MmsRetrieval(index));
+}
 
+void MsgSettingsForm::allowAnonymousMMS()
+{
+    HbPushButton *btn = qobject_cast<HbPushButton *> (sender());
+
+    if (btn)
+    {
+        QString btnText = btn->text();
+
+        //check if the button pressed was Yes or NO
+        if (LOC_MMS_YES == btnText)
+        {
+            mSettingEngine->setAnonymousMessages(true);
+        }
+        else
+        {
+            mSettingEngine->setAnonymousMessages(false);
+        }
+    }
+}
+
+void MsgSettingsForm::allowMMSAdverts()
+{
+    HbPushButton *btn = qobject_cast<HbPushButton *> (sender());
+
+    if (btn)
+    {
+        QString btnText = btn->text();
+
+        //check if the button pressed was Yes or NO
+        if (LOC_MMS_NO == btnText)
+        {
+            mSettingEngine->setReceiveMMSAdverts(true);
+        }
+        else
+        {
+            mSettingEngine->setReceiveMMSAdverts(false);
+        }
+    }
+}
+
+void MsgSettingsForm::changeAccessPoint(int index)
+{
+    // save to the mms settings
+    mSettingEngine->setMMSAccesspoint(index);
+}
+
+void MsgSettingsForm::onPressedCustomButton()
+{
+    HbPushButton *btn = qobject_cast<HbPushButton *> (sender());
+
+    if (btn)
+    {
+        QString btnText = btn->text();
+        if (btnText == mSmsMCSettingsGroup.at(1))
+        {
+            // emit the signal to open add view 
+            emit newSMSCCenterClicked(-1);
+        }
+        else
+        {
+            int index = mSmsServiceList.indexOf(btnText);
+            emit newSMSCCenterClicked(index);
+        }
+    }
+}
+
+void MsgSettingsForm::onSMSCurrentIndexChanged(int index)
+{
+    //set into msg settings
+    mSettingEngine->setSMSMessageCenter(index);
+}
+
+void MsgSettingsForm::expandSMSSettings()
+{
+    QModelIndex index_sms = settingsModel->indexFromItem(mSmsMCGroup);
+
+    this->setExpanded(index_sms, true);
+}
 //EOF
--- a/messagingapp/msgsettings/settingsview/src/msgsettingsview.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgsettings/settingsview/src/msgsettingsview.cpp	Mon May 03 12:29:07 2010 +0300
@@ -14,64 +14,63 @@
  * Description:This is the first view for msgsettings plugin 
  *
  */
-
-#include <hbaction.h>
 #include <hbmainwindow.h>
-#include <hbinstance.h>
 
 #include "msgsettingsview.h"
 #include "msgsettingsform.h"
-#include "msgsettingsdataformcustomitem.h"
-#include "msgsettingsviewmanager.h"
+#include "msgsmscenterview.h"
 #include "debugtraces.h"
 
 MsgSettingsView::MsgSettingsView(QGraphicsItem *parent) :
-    MsgBaseView(parent)
+    MsgBaseView(parent), mSMSCenterView(0)
 {
-    mSettingsViewManager = new MsgSettingsViewManager(this);
-    
-    MsgSettingsForm* settingForm = new MsgSettingsForm(
-                                                       mSettingsViewManager,
-                                                       this);
+    mSettingsForm = new MsgSettingsForm();
 
-    //custom prototype
-    MsgSettingsDataFormCustomItem* customPrototype =
-            new MsgSettingsDataFormCustomItem(settingForm);
-    //settingForm->setItemPrototype(customPrototype);
-    
-    QList<HbAbstractViewItem*> protos = settingForm->itemPrototypes();
-    protos.append(customPrototype);
-    settingForm->setItemPrototypes(protos);
-
-    setWidget(settingForm);
+    setWidget(mSettingsForm);
+    mMainWindow = this->mainWindow();
 
-    mMainWindow = hbInstance->allMainWindows().at(0);
-
-    mBackAction = new HbAction(Hb::BackAction, this);
-    
-    connectCloseAction();    
-    
-    connect (mSettingsViewManager,
-             SIGNAL(advancedSettingsViewClosed()),
-             this,
-             SLOT(connectCloseAction()));
+    connect(mSettingsForm,
+            SIGNAL(newSMSCCenterClicked(int)),
+            this,
+            SLOT(onNewSMSCCenterClicked(int)));
 }
 
 MsgSettingsView::~MsgSettingsView()
 {
-   //do nothing 
+    delete mSMSCenterView;
 }
 
-void MsgSettingsView::connectCloseAction()
+void MsgSettingsView::onNewSMSCCenterClicked(int index)
 {
-    this->setNavigationAction(mBackAction);
-    connect(mBackAction, SIGNAL(triggered()), this, SLOT(closeSettings()), Qt::UniqueConnection);
+    //open the sms center views
+    if (mSMSCenterView)
+    {
+        delete mSMSCenterView;
+        mSMSCenterView = NULL;
+    }
+
+    mSMSCenterView = new MsgSMSCenterView(index);
+    
+    connect(mSMSCenterView,
+            SIGNAL(smsCenterEditViewClosed()),
+            this,
+            SLOT(onSmsCenterEditViewClosed()));
+    
+    mMainWindow->addView(mSMSCenterView);        
+    mMainWindow->setCurrentView(mSMSCenterView);
 }
 
-void MsgSettingsView::closeSettings()
+void MsgSettingsView::onSmsCenterEditViewClosed()
 {
-    QVariantList param;
-    param << MsgBaseView::DEFAULT;
-    param << MsgBaseView::MSGSETTINGS;
-    emit switchView(param);
+    //remove the view 
+    mMainWindow->removeView(mSMSCenterView);
+
+    //refresh the form
+    mSettingsForm->refreshViewForm();
+
+    //add the current view on top
+    mMainWindow->setCurrentView(this);
 }
+
+//eof
+
--- a/messagingapp/msgsettings/settingsview/src/msgsettingsviewmanager.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +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:This is the manager class for managing multiple views
- *
- */
-
-#include "msgsettingsviewmanager.h"
-#include "msgadvancedsettingsview.h"
-#include "msgsmscenterview.h"
-#include "msgbaseview.h"
-
-#include <hbinstance.h>
-#include <hbaction.h>
-
-MsgSettingsViewManager::MsgSettingsViewManager(QObject* parent) :
-    QObject(parent), mAdvancedSettingsView(NULL),
-    mSMSCenterView(NULL),
-    mBackAction(NULL)
-{
-    //do nothing
-}
-
-MsgSettingsViewManager::~MsgSettingsViewManager()
-{
-    if (mAdvancedSettingsView)
-    {
-        mAdvancedSettingsView->setParent(NULL);
-        delete mAdvancedSettingsView;
-    }
-
-    if (mSMSCenterView)
-    {
-        mSMSCenterView->setParent(NULL);
-        delete mSMSCenterView;
-    }
-}
-
-void MsgSettingsViewManager::openAdvancedView()
-{
-    mAdvancedSettingsView = new MsgAdvancedSettingsView();
-
-    HbMainWindow* mainWindow = hbInstance->allMainWindows().at(0);
-
-    mainWindow->addView(mAdvancedSettingsView);
-    mainWindow->setCurrentView(mAdvancedSettingsView);
-
-    mBackAction = new HbAction(Hb::BackAction, this);
-    mAdvancedSettingsView->setNavigationAction(mBackAction);
-    //mBackAction = mainWindow->softKeyAction(Hb::SecondarySoftKey);
-
-    connect(mBackAction, SIGNAL(triggered()), this, SLOT(closeAdvancedSettingsView()));
-
-    connect(mAdvancedSettingsView, SIGNAL(newSMSCCenterClicked(int)), this, SLOT(openSmsCenterView(int)));
-}
-
-void MsgSettingsViewManager::closeAdvancedSettingsView()
-{
-    disconnect(mBackAction, SIGNAL(triggered()), this, SLOT(closeAdvancedSettingsView()));
-            
-    mAdvancedSettingsView->commitEmailChanges();
-    
-    HbMainWindow* mainWindow = hbInstance->allMainWindows().at(0);
-    mainWindow->removeView(mAdvancedSettingsView);
-
-    mAdvancedSettingsView->setParent(NULL);
-    delete mAdvancedSettingsView;
-    mAdvancedSettingsView = NULL;
-    
-    emit advancedSettingsViewClosed();
-}
-
-void MsgSettingsViewManager::openSmsCenterView(int mode)
-{
-    HbMainWindow* mainWindow = hbInstance->allMainWindows().at(0);
-    mSMSCenterView = new MsgSMSCenterView(mode);
-    mainWindow->addView(mSMSCenterView);
-    mainWindow->setCurrentView(mSMSCenterView);
-    mSMSCenterView->setNavigationAction(mBackAction);
-    disconnect(mBackAction, SIGNAL(triggered()), this, SLOT(closeAdvancedSettingsView()));
-    connect(mBackAction, SIGNAL(triggered()), this, SLOT(closeSMSCCenterView()));    
-}
-
-void MsgSettingsViewManager::closeSMSCCenterView()
-{
-    disconnect(mBackAction, SIGNAL(triggered()), this, SLOT(closeSMSCCenterView()));
-    connect(mBackAction, SIGNAL(triggered()), this, SLOT(closeAdvancedSettingsView()));
-    
-    mSMSCenterView->commitChanges();
-    //mAdvancedSettingsView->refreshView();
-    
-    HbMainWindow* mainWindow = hbInstance->allMainWindows().at(0);
-    mainWindow->removeView(mSMSCenterView);
-
-    mSMSCenterView->setParent(NULL);
-    delete mSMSCenterView;
-    mSMSCenterView = NULL;
-}
--- a/messagingapp/msgsettings/settingsview/src/msgsmscentersettingsform.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgsettings/settingsview/src/msgsmscentersettingsform.cpp	Mon May 03 12:29:07 2010 +0300
@@ -17,12 +17,15 @@
 
 #include "msgsmscentersettingsform.h"
 #include "msgsettingengine.h"
+#include "msgsettingsdataformcustomitem.h"
 
 #include <hbdataformviewitem.h>
 #include <hbdataformmodelitem.h>
 #include <hbdataformmodel.h>
 #include <hblineedit.h>
+#include <HbNotificationDialog>
 #include <hbinputeditorinterface.h>
+#include <hbmessagebox.h>
 #include "debugtraces.h"
 
 //Localized constants
@@ -30,30 +33,44 @@
 #define LOC_EDIT_SMS_CENTRE hbTrId("txt_messaging_title_edit_sms_message_centre")
 #define LOC_SMS_CENTRE_NAME hbTrId("txt_messaging_setlabel_message_centre_name")
 #define LOC_SMS_CENTRE_NUMBER hbTrId("txt_messaging_setlabel_message_centre_number")
-
+#define LOC_SMS_CENTRE_DELETE hbTrId("txt_messaging_button_delete_message_centre")
+#define LOC_MESSAGE_CENTER_SAVED hbTrId("txt_messaging_setlabel_message_centre_saved")
+#define LOC_BUTTON_DELETE hbTrId("txt_common_button_delete")
+#define LOC_BUTTON_CANCEL hbTrId("txt_common_button_cancel")
 
-MsgSMSCenterSettingsForm::MsgSMSCenterSettingsForm(int view, QGraphicsItem *parent) :
+MsgSMSCenterSettingsForm::MsgSMSCenterSettingsForm(int view,
+                                                   QGraphicsItem *parent) :
     HbDataForm(parent), mEdit1(0), mEdit2(0), mView(view)
 {
     QString heading;
-    if (mView == -1) {
+    if (mView == -1)
+    {
         heading = LOC_NEW_SMS_CENTRE;
     }
-    else {
+    else
+    {
         heading = LOC_EDIT_SMS_CENTRE;
+        //custom prototype
+        MsgSettingsDataFormCustomItem* customPrototype =
+                new MsgSettingsDataFormCustomItem(this);
+
+        QList<HbAbstractViewItem*> protos = this->itemPrototypes();
+        protos.append(customPrototype);
+        this->setItemPrototypes(protos);
     }
 
     this->setHeading(heading);
 
     bool b = connect(this,
-                        SIGNAL(itemShown(const QModelIndex&)),
-                        this, SLOT(onItemShown(const QModelIndex&)));
-                        
+                     SIGNAL(itemShown(const QModelIndex&)),
+                     this,
+                     SLOT(onItemShown(const QModelIndex&)));
+
     QDEBUG_WRITE_FORMAT("MsgSMSCenterSettingsForm::MsgSMSCenterSettingsForm initialized.. ", b)
-                        
+
     mSettingEngine = new MsgSettingEngine();
 
-    initSettingModel();    
+    initSettingModel();
 }
 
 MsgSMSCenterSettingsForm::~MsgSMSCenterSettingsForm()
@@ -63,79 +80,140 @@
 
 void MsgSMSCenterSettingsForm::initSettingModel()
 {
-	  QDEBUG_WRITE("MsgSMSCenterSettingsForm::initSettingModel");
+    QDEBUG_WRITE("MsgSMSCenterSettingsForm::initSettingModel");
     HbDataFormModel *settingsmodel = new HbDataFormModel();
 
-    QString centerName = QString();
-    QString centerNumber = QString();
-
-    if (mView != -1) {
-        mSettingEngine->smsCenterNameAndNumber(mView, centerName, centerNumber);
+    if (mView != -1)
+    {
+        mSettingEngine->smsCenterNameAndNumber(mView,
+                                               mCenterName,
+                                               mCenterNumber);
     }
 
     messageCenterName = new HbDataFormModelItem(HbDataFormModelItem::TextItem,
-            LOC_SMS_CENTRE_NAME, 0);
+                                                LOC_SMS_CENTRE_NAME,
+                                                0);
+
+    messageCenterName->setContentWidgetData("text", mCenterName);
+
+    settingsmodel->appendDataFormItem(messageCenterName,
+                                      settingsmodel->invisibleRootItem());
 
-    messageCenterName->setContentWidgetData("text", centerName);
-        
-    settingsmodel->appendDataFormItem(messageCenterName, settingsmodel->invisibleRootItem());
+    messageCenterNumber
+            = new HbDataFormModelItem(HbDataFormModelItem::TextItem,
+                                      LOC_SMS_CENTRE_NUMBER,
+                                      0);
+
+    messageCenterNumber->setContentWidgetData("text", mCenterNumber);
+
+    settingsmodel->appendDataFormItem(messageCenterNumber,
+                                      settingsmodel->invisibleRootItem());
 
-    messageCenterNumber = new HbDataFormModelItem(
-        HbDataFormModelItem::TextItem, LOC_SMS_CENTRE_NUMBER, 0);
+    if (mView != -1) /// edit case delete button required
+    {
+        //CUSTOM SETTING ITEM HbButton
+        HbDataFormModelItem::DataItemType
+                customButtonGeneral =
+                        static_cast<HbDataFormModelItem::DataItemType> (
+                                HbDataFormModelItem::CustomItemBase + 1);
 
-    messageCenterNumber->setContentWidgetData("text", centerNumber);
-        
-    settingsmodel->appendDataFormItem(messageCenterNumber, settingsmodel->invisibleRootItem());
+        HbDataFormModelItem
+                *deleteMessageCentre =
+                        settingsmodel->appendDataFormItem(
+                                customButtonGeneral,
+                                QString(""),
+                                settingsmodel->invisibleRootItem());
+
+        deleteMessageCentre->setContentWidgetData("text", 
+                                                  LOC_SMS_CENTRE_DELETE);
+        this->addConnection(deleteMessageCentre,
+                            SIGNAL(clicked()),
+                            this,
+                            SLOT(onPressedCustomButton()));
+    }
 
     this->setModel(settingsmodel);
 }
 
-
 void MsgSMSCenterSettingsForm::commitChanges()
 {
-	   	   
-	   //commit changes
-    if(mEdit1)
-     mCenterName = mEdit1->text();
-    
+    //commit changes
+    QString centerName;
+    QString centerNumber;
+
+    if (mEdit1)
+        centerName = mEdit1->text();
+
     if (mEdit2)
-     mCenterNumber = mEdit2->text();
+        centerNumber = mEdit2->text();
 
-    if (mCenterName.isEmpty() || mCenterNumber.isEmpty()) {
+    // check if any of the field are empty
+    // OR the data unchanged, then return dont commit
+    if (centerName.isEmpty() || centerNumber.isEmpty() || (centerName
+            == mCenterName && centerNumber == mCenterNumber))
+    {
         //if mCenterName or mCenterNumber is empty do not commit.
         return;
     }
 
     QDEBUG_WRITE("MsgSMSCenterSettingsForm::commitChanges");
-    if (mView == -1) {
-        mSettingEngine->addSmsMessageCenter(mCenterName, mCenterNumber);
+    if (mView == -1)
+    {
+        mSettingEngine->addSmsMessageCenter(centerName, centerNumber);
     }
-    else {
-        mSettingEngine->editSmsMessageCenter(mCenterName, mCenterNumber, mView);
+    else
+    {
+        mSettingEngine->editSmsMessageCenter(centerName, 
+                                             centerNumber, 
+                                             mView);
+        
+        HbNotificationDialog::launchDialog(LOC_MESSAGE_CENTER_SAVED);
     }
     QDEBUG_WRITE("ex MsgSMSCenterSettingsForm::commitChanges");
-    
 }
 
 void MsgSMSCenterSettingsForm::onItemShown(const QModelIndex& topLeft)
-    {
-    	
-    	QDEBUG_WRITE("DataForm MsgSMSCenterSettingsForm::onItemShown");
+{
+
+    QDEBUG_WRITE("DataForm MsgSMSCenterSettingsForm::onItemShown");
     HbDataFormModelItem *itemData =
-    static_cast<HbDataFormModel *> (model())->itemFromIndex(topLeft);
+            static_cast<HbDataFormModel *> (model())->itemFromIndex(topLeft);
 
     if (itemData && itemData == messageCenterName && !mEdit1)
-        {
-        	QDEBUG_WRITE("messageCenterName updated..");
-    mEdit1 = static_cast<HbLineEdit *>(this->dataFormViewItem(topLeft)->dataItemContentWidget());
-         }
+    {
+        QDEBUG_WRITE("messageCenterName updated..");
+        mEdit1
+                = static_cast<HbLineEdit *> (
+                        this->dataFormViewItem(
+                                topLeft)->dataItemContentWidget());
+    }
     else if (itemData && itemData == messageCenterNumber && !mEdit2)
-                {
-                	QDEBUG_WRITE("messageCenterNumber updated..");
-    mEdit2 = static_cast<HbLineEdit *>(this->dataFormViewItem(topLeft)->dataItemContentWidget());
-                HbEditorInterface editorInterface(mEdit2);
-                    editorInterface.setUpAsPhoneNumberEditor();
+    {
+        QDEBUG_WRITE("messageCenterNumber updated..");
+        mEdit2
+                = static_cast<HbLineEdit *> (
+                        this->dataFormViewItem(
+                                topLeft)->dataItemContentWidget());
+        
+        HbEditorInterface editorInterface(mEdit2);
+        editorInterface.setUpAsPhoneNumberEditor();
+
+    }
+}
 
-                        }
+void MsgSMSCenterSettingsForm::onPressedCustomButton()
+{
+    bool result = HbMessageBox::question("Delete message centre ?",
+                                         LOC_BUTTON_DELETE,
+                                         LOC_BUTTON_CANCEL);                                         
 
-                    }
+    if (result)
+    {
+        //delete from m/w -- mView is the index to delete
+        mSettingEngine->deleteSmsMessageCenter(mView);
+        emit deleteMessageCentreAndClose();
+    }    
+}
+
+//eof
+
--- a/messagingapp/msgsettings/settingsview/src/msgsmscenterview.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgsettings/settingsview/src/msgsmscenterview.cpp	Mon May 03 12:29:07 2010 +0300
@@ -14,27 +14,51 @@
  * Description:This class is for sms message center view 
  *
  */
+#include <hbaction.h>
 
 #include "msgsmscenterview.h"
 #include "msgsmscentersettingsform.h"
-
-#include <cpbasesettingview.h>
 #include "debugtraces.h"
 
 MsgSMSCenterView::MsgSMSCenterView(int view, QGraphicsItem *parent) :
-MsgBaseView(parent)
+    MsgBaseView(parent)
 {
     mSMSCenterSettingsForm = new MsgSMSCenterSettingsForm(view);
 
     setWidget(mSMSCenterSettingsForm);
+
+    HbAction* backAction = new HbAction(Hb::BackAction, this);
+    setNavigationAction(backAction);
+
+    connect(mSMSCenterSettingsForm,
+            SIGNAL(deleteMessageCentreAndClose()),
+            this,
+            SLOT(onCloseMessageCenterView()));
+    
+    connect(backAction, SIGNAL(triggered()), this, SLOT(onBackAction()));
 }
 
 MsgSMSCenterView::~MsgSMSCenterView()
 {
+    setParent(NULL);
 }
 
-void MsgSMSCenterView::commitChanges()
+void MsgSMSCenterView::onBackAction()
 {
-	QDEBUG_WRITE("MsgSMSCenterView::commitChanges");
+    QDEBUG_WRITE("MsgSMSCenterView::onBackAction");
+
+    //commit the change
     mSMSCenterSettingsForm->commitChanges();
+    setNavigationAction(NULL);
+    emit smsCenterEditViewClosed();
 }
+
+void MsgSMSCenterView::onCloseMessageCenterView()
+{
+    QDEBUG_WRITE("MsgSMSCenterView::onCloseMessageCenterView");
+
+    setNavigationAction(NULL);
+    emit smsCenterEditViewClosed();
+}
+
+//eof
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgsettings/settingsview/src/smssettingsprivate.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,259 @@
+/*
+ * 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:  This provides the messaging mw interface for sms 
+ *
+ */
+
+#include <commdb.h>
+#include <commdbconnpref.h>
+#include <msvapi.h>
+#include <msvstd.h>
+#include <msvuids.h>
+#include <csmsaccount.h>
+#include <smutset.h>
+#include "debugtraces.h"
+
+
+#include "smssettingsprivate.h"
+
+
+//two phase constructor
+SmsSettingsPrivate* SmsSettingsPrivate::NewL()
+{
+    SmsSettingsPrivate* self = new (ELeave) SmsSettingsPrivate();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+}
+
+//2nd phase constructor
+void SmsSettingsPrivate::ConstructL()
+{
+    //does nothing
+}
+
+//---------------------------------------------------------------
+// SmsSettingsPrivate::SmsSettingsPrivate
+// @see header
+//---------------------------------------------------------------
+SmsSettingsPrivate::SmsSettingsPrivate()
+{
+    //do nothing
+}
+
+//---------------------------------------------------------------
+// SmsSettingsPrivate::~SmsSettingsPrivate
+// @see header
+//---------------------------------------------------------------
+SmsSettingsPrivate::~SmsSettingsPrivate()
+{
+    //do nothing
+}
+
+void SmsSettingsPrivate::setReceiveSerivceMessages(
+        TBool serviceMessages)
+{
+    CSmsAccount* smsAccount = CSmsAccount::NewLC();
+    CSmsSettings* smsSettings = CSmsSettings::NewLC();
+
+    smsAccount->LoadSettingsL(*smsSettings);
+
+    //TODO set the receive message part
+
+    smsAccount->SaveSettingsL(*smsSettings);
+
+    CleanupStack::PopAndDestroy(2);
+}
+
+void SmsSettingsPrivate::setCharacterEncoding(TBool status)
+{
+    CSmsAccount* smsAccount = CSmsAccount::NewLC();
+    CSmsSettings* smsSettings = CSmsSettings::NewLC();
+
+    smsAccount->LoadSettingsL(*smsSettings);
+
+    if (status == EFalse)
+    {
+        smsSettings->SetCharacterSet(TSmsDataCodingScheme::ESmsAlphabet7Bit);
+    }
+    else
+    {
+        smsSettings->SetCharacterSet(TSmsDataCodingScheme::ESmsAlphabetUCS2);
+    }
+
+    smsAccount->SaveSettingsL(*smsSettings);
+
+    CleanupStack::PopAndDestroy(2);
+}
+
+void SmsSettingsPrivate::settingsServiceMessagesAndCharEncoding(
+                                                              TBool& report,
+                                                              TBool& statusEncoding)
+{
+    CSmsAccount* smsAccount = CSmsAccount::NewLC();
+    CSmsSettings* smsSettings = CSmsSettings::NewLC();
+
+    smsAccount->LoadSettingsL(*smsSettings);
+
+    //TODO: service messages read
+
+    TSmsDataCodingScheme::TSmsAlphabet charSet = smsSettings->CharacterSet();
+
+    statusEncoding = ETrue;
+    if (charSet == TSmsDataCodingScheme::ESmsAlphabet7Bit)
+    {
+        statusEncoding = EFalse;
+    }
+    CleanupStack::PopAndDestroy(2);
+}
+
+void SmsSettingsPrivate::getAllSMSMessageCenter(
+                                                RPointerArray<HBufC>& accessPoints,
+                                                TInt &defaultIndex)
+{
+    CSmsAccount* smsAccount = CSmsAccount::NewLC();
+    CSmsSettings* settings = CSmsSettings::NewLC();
+
+    smsAccount->LoadSettingsL(*settings);
+
+    //save the default index
+    defaultIndex = settings->DefaultServiceCenter();
+
+    int totalSMSc = settings->ServiceCenterCount();
+    for (int index = 0; index < totalSMSc; index++)
+    {
+        TPtrC16 name = settings->GetServiceCenter(index).Name();
+        HBufC* accessName = name.AllocL();
+        accessPoints.AppendL(accessName);
+    }
+
+    CleanupStack::PopAndDestroy(2);
+
+    return;
+}
+
+void SmsSettingsPrivate::setSMSMessageCenter(int index)
+{
+    CSmsAccount* smsAccount = CSmsAccount::NewLC();
+    CSmsSettings* smsSettings = CSmsSettings::NewLC();
+
+    smsAccount->LoadSettingsL(*smsSettings);
+    smsSettings->SetDefaultServiceCenter(index);
+    smsAccount->SaveSettingsL(*smsSettings);
+
+    CleanupStack::PopAndDestroy(2);
+}
+
+void SmsSettingsPrivate::editSMSServiceCentre(HBufC* address, HBufC* name,
+                                              TInt index)
+{
+    CSmsAccount* smsAccount = CSmsAccount::NewLC();
+    CSmsSettings* smsSettings = CSmsSettings::NewLC();
+
+    smsAccount->LoadSettingsL(*smsSettings);
+
+    TInt indexDefault = smsSettings->DefaultServiceCenter();
+    bool flag = false;
+    if (index == indexDefault)
+    {
+        flag = true;
+    }
+
+    //remove the service center
+    //smsSettings->RemoveServiceCenter(index);
+    //add a new service center
+    smsSettings->AddServiceCenterL(name->Des(), address->Des());
+    
+    if (flag == true)
+    {
+       smsSettings->SetDefaultServiceCenter(
+               smsSettings->ServiceCenterCount()- 1);
+    }
+    
+    smsAccount->SaveSettingsL(*smsSettings);
+
+    smsAccount->LoadSettingsL(*smsSettings);
+    if (flag == true)
+    {
+        smsSettings->RemoveServiceCenter(index);
+    }
+    
+    smsAccount->SaveSettingsL(*smsSettings);
+    
+    CleanupStack::PopAndDestroy(2);
+}
+
+void SmsSettingsPrivate::addSmsMessageCenter(HBufC* address, HBufC* name)
+{
+    CSmsAccount* smsAccount = CSmsAccount::NewLC();
+    CSmsSettings* smsSettings = CSmsSettings::NewLC();
+
+    smsAccount->LoadSettingsL(*smsSettings);
+    
+    int total_count = smsSettings->ServiceCenterCount();
+    smsSettings->AddServiceCenterL(name->Des(), address->Des());
+    
+    if (total_count == 0) // no service center
+    {
+        smsSettings->SetDefaultServiceCenter(0);
+    }
+    smsSettings->SetCommDbAction(CSmsSettings::ENone);
+    smsAccount->SaveSettingsL(*smsSettings);
+
+    CleanupStack::PopAndDestroy(2);
+}
+
+void SmsSettingsPrivate::deleteSmsMessageCenter(TInt aDeleteIndex)
+{
+    CSmsAccount* smsAccount = CSmsAccount::NewLC();
+    CSmsSettings* smsSettings = CSmsSettings::NewLC();
+
+    smsAccount->LoadSettingsL(*smsSettings);
+    
+    TInt indexDefault = smsSettings->DefaultServiceCenter();
+    
+    //remove from settings
+    smsSettings->RemoveServiceCenter(aDeleteIndex);
+    
+    if (indexDefault == aDeleteIndex 
+            && smsSettings->ServiceCenterCount() > 0)
+    {
+        smsSettings->SetDefaultServiceCenter(0);
+    }
+    smsSettings->SetCommDbAction(CSmsSettings::ENone);
+    smsAccount->SaveSettingsL(*smsSettings);
+
+    CleanupStack::PopAndDestroy(2);
+}
+
+void SmsSettingsPrivate::smsCenterNameAndNumber(int index,
+                                                HBufC** centerNumber,
+                                                HBufC** centerName)
+{
+    CSmsAccount* smsAccount = CSmsAccount::NewLC();
+    CSmsSettings* smsSettings = CSmsSettings::NewLC();
+
+    smsAccount->LoadSettingsL(*smsSettings);
+
+    TPtrC16 addr = smsSettings->GetServiceCenter(index).Address();
+    TPtrC16 name = smsSettings->GetServiceCenter(index).Name();
+
+    (*centerNumber) = addr.AllocL();
+    (*centerName) = name.AllocL();
+
+    CleanupStack::PopAndDestroy(2);
+}
+
+//eof
--- a/messagingapp/msgui/appengine/appengine.pro	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/appengine/appengine.pro	Mon May 03 12:29:07 2010 +0300
@@ -20,7 +20,9 @@
 DEPENDPATH += . src
 
 INCLUDEPATH += ../../../inc
+INCLUDEPATH += ../../msgutils/unieditorutils/editorgenutils/inc
 INCLUDEPATH += ../../msgutils/s60qconversions/inc
+INCLUDEPATH += /ext/mw/qtextensions/qtmobileextensions/include
 INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
 
 DEFINES += BUILD_DLL
@@ -73,7 +75,16 @@
         -lsmildtd \
         -lxmldom \
         -lxmlparser \
-        -lunidatamodelloader 
+        -lunidatamodelloader \
+	-leditorgenutils \
+	-lsmcm \
+	-lQtVersit \
+        -lQtContacts \
+        -lxqutils \
+        -lmmscli \
+        -lcommonengine \
+        -lmmsserversettings \
+	-lFeatMgr
 
 
 
--- a/messagingapp/msgui/appengine/inc/conversationmsgstorehandler.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/appengine/inc/conversationmsgstorehandler.h	Mon May 03 12:29:07 2010 +0300
@@ -21,13 +21,16 @@
 // INCLUDE FILES
 #include <msvapi.h>
 #include <ccsdefs.h>
+#include <QString>
 
 // FORWARD DECLARATIONS
 class CMsvSession;
 class MMsvSessionObserver;
 class DraftsModel;
+class CClientMtmRegistry;
+class CMmsClientMtm;
+class CMmsNotificationClientMtm;
 
-// CONSTANTS
 
 class ConversationMsgStoreHandler: public MMsvSessionObserver
     {
@@ -84,6 +87,18 @@
      * @param aIdArray Array of message ids.
      */
     void DeleteMessages(RArray<TInt>& aIdArray);
+
+    /**
+     * Delete all draft messages.
+     */
+    void DeleteAllDraftMessagesL();
+
+    /**
+     * Resend a specified message that has failed.
+     * @param aId TMsvId of the failed message 
+	 * @return bool true if succeeded
+     */
+    bool ResendMessageL(TMsvId aId);
     
     /**
      * Returns the msv session object
@@ -96,6 +111,80 @@
      */
     void FetchDraftMessages(DraftsModel* draftsModel);
 
+    /**
+     * Mark message as read and get the message type.
+     * @param messageId  message Id 
+     * @param msgType message type is written to this.
+     * @param msgType message sub type is written to this.
+     */
+    void markAsReadAndGetType(int msgId,
+                              int& msgType,
+                              int& msgSubType);
+    
+    /**
+     * Extract the message type.
+     * @param entry  message entry.
+     * @param msgType message type is written to this.
+     * @param msgType message sub type is written to this.
+     */
+    void extractMsgType(const TMsvEntry& entry,
+                        int& msgType,
+                        int& msgSubType);
+    /**
+     * Query if the download operation be performed for
+     * a message notification entry
+     * @param aId, message notification id
+     * @return true if download operation is possible
+     */
+    bool DownloadOperationSupported(const TMsvId& aId);
+    
+	
+    /**
+     * Sets content to messageId
+     * @param messageId, Message Id content
+     */
+    void setNotificationMessageId(int messageId);
+
+    /**
+     * Seeker method for getting mms notification estimated msg size
+     * @return Formatted string of msg size
+     */
+    QString NotificationMsgSize();
+    
+    /**
+     * Seeker method for getting mms notification class type
+     * @return Notification Class type string
+     */
+    QString NotificationClass();
+    
+    /**
+     * Seeker method for message status and error string
+     * mms notification's download state
+     * @param [OUT] status, msg status
+     * @param [OUT] statusStr, localized string of msg status
+     */
+    void NotificationStatus(int& status,
+                     QString& statusStr);
+    
+    /**
+     * Seeker method getting expiry info of a notification msg
+     * @param [OUT] expiryTime, notification's expiry time
+     * @param [OUT] expiryTimeQString, formatted string of
+     * notification's expiry time
+     */
+    void NotificationExpiryDate(
+            TTime& expiryTime,
+            QString& expiryTimeStr);
+					 
+    /**
+     * Download a specified message
+     * @param aId TMsvId of the message 
+     * @return KErrNone if Download request is successful, 
+     *         KErrNotFound if settings are not available,
+     *         KErrGeneral for other cases
+     */
+    TInt DownloadMessageL(TMsvId aId);
+
 private:
 
     /**
@@ -169,7 +258,22 @@
      * State
      */
     TDraftHandlerState iState;
-    
+    /**
+     * Own. Mtm Registry
+     */
+    CClientMtmRegistry* iMtmReg;
+
+    /**
+     * MMS client mtm
+     */
+    CMmsClientMtm* iMmsClient;
+
+    /**
+     * Notification client mtm
+     */
+    CMmsNotificationClientMtm* iNotificationClient;
+	
+	TBool iOfflineSupported;	
     };
 
 #endif // CONVERSATION_MSG_STORE_HANDLER_H
--- a/messagingapp/msgui/appengine/inc/conversationsengine.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/appengine/inc/conversationsengine.h	Mon May 03 12:29:07 2010 +0300
@@ -103,6 +103,11 @@
     void deleteMessages(QList<int>& msgIdList);
 
     /**
+     * Delete all draft messages.
+     */
+    void deleteAllDraftMessages();
+
+    /**
      * Marks all the unread conversations to read
      * @param conversationId, conversationId
      * @return returns true if call is successful
@@ -117,14 +122,12 @@
     bool markMessagesRead(QList<int>& msgIdList);
     
     /**
-     * Get Contact details firstname/lastname.
+     * Get Contact details name.
      * @param conversationId, conversationId
-     * @param firstName, First Name
-     * @param lastName, Last Name
+     * @param displayName, Name
      */  
     void getContactDetails(qint64 conversationId,
-        QString& firstName,
-        QString& lastName,
+        QString& displayName,
         QString& address);
 
     /**
@@ -165,7 +168,40 @@
      *  Starts fetching remaing conversations
      */
     void fetchMoreConversations();
-    
+
+    /**
+     *  Resend a failed message
+	 *@param  messageId qint32 the Id of the message to be sent
+	 *@return bool true if succeeded
+     */
+    bool resendMessage(qint32 messageId);
+
+    /**
+     * Download a specified message
+     * @param messageId qint32 the Id of the message 
+     * @return KErrNone if Download request is successful, 
+     *         KErrNotFound if settings are not available,
+     *         KErrGeneral for other cases
+     */
+    int downloadMessage(qint32 messageId);  
+
+    /**
+     * Query if the download operation be performed for
+     * a message notification entry
+     * @param aId, message notification id
+     * @return true if download operation is possible
+     */
+    bool downloadOperationSupported(qint32 messageId);
+	
+    /**
+     * Mark message as read and get the message type
+     * @param messageId  message Id 
+     * @param msgType message type is written to this.
+     * @param msgType message sub type is written to this.
+     */
+    void markAsReadAndGetType( qint32 messageId,
+                               int& msgType,
+                               int& msgSubType);
 private:
 
     /**
--- a/messagingapp/msgui/appengine/inc/conversationsengine_p.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/appengine/inc/conversationsengine_p.h	Mon May 03 12:29:07 2010 +0300
@@ -22,7 +22,7 @@
 // SYSTEM INCLUDES
 #include <ccsrequesthandler.h>
 #include <mcsresultsobserver.h>
-
+#include <msvstd.h>
 // USER INCLUDES
 
 // FORWARD DECLARATIONS
@@ -84,7 +84,12 @@
      * Delete all messages.
      * @param msgIdList, message list.
      */ 
-    void deleteMessages(RArray<TInt>& aIdArray); 
+    void deleteMessages(RArray<TInt>& aIdArray);
+
+    /**
+     * Delete all draft messages.
+     */
+    void deleteAllDraftMessagesL();
 
     /**
      * Marks the unread conversations as read
@@ -131,6 +136,31 @@
      *  Starts fetching remaing conversations
      */
     void fetchMoreConversations();
+
+    
+    /**
+     *  Resend a failed message
+	 * @param messageId TMsvId The msv id of the entry to resend
+	 * @return bool true if success
+     */
+    bool resendMessage(TMsvId messageId);
+    
+    /**
+     * Download a specified message
+     * @param aId TMsvId of the message 
+     * @return KErrNone if Download request is successful, 
+     *         KErrNotFound if settings are not available,
+     *         KErrGeneral for other cases
+     */
+    TInt downloadMessage(TMsvId messageId);
+    
+    /**
+     * Query if the download operation be performed for
+     * a message notification entry
+     * @param aId, message notification id
+     * @return true if download operation is possible
+     */
+    bool downloadOperationSupported(TMsvId messageId);
     
 public: // From MCsResultsObserver
 
--- a/messagingapp/msgui/appengine/inc/conversationsenginedefines.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/appengine/inc/conversationsenginedefines.h	Mon May 03 12:29:07 2010 +0300
@@ -25,11 +25,10 @@
     ConvergedMsgId,
     ConversationAddress,
     ContactId,
-    FirstName,
-    LastName,
-    NickName,
+    DisplayName,
     Avatar,
     MessageType,
+    MessageSubType,
     MessagePriority,
     MessageProperty,
     Direction,
@@ -42,7 +41,8 @@
     UnreadCount,
     MessageLocation,
     MessageStore,
-    ConversationAlias
+    ConversationAlias,
+    NotificationStatus
 };
 
 #endif /* CONVERSATIONS_ENGINE_DEFINES_H */
--- a/messagingapp/msgui/appengine/inc/conversationsengineutility.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/appengine/inc/conversationsengineutility.h	Mon May 03 12:29:07 2010 +0300
@@ -45,6 +45,20 @@
      */
     static int messageType(TInt32 value);
 
+    /**
+     * Map message type to ConvergedMessage::MessageSubType.
+     * @param value, TCsType
+     * @return ConvergedMessage::MessageSubType.
+     */
+    static int messageSubType(TCsType value);
+
+    /**
+     * Get display-name of a contact from VCard.
+     * @param filePath, VCard file-path
+     * @return display-name
+     */
+    static QString getVcardDisplayName(QString filePath);
+
     };
 
 #endif //CONVERSATIONS_ENGINE_UTILITY_H
--- a/messagingapp/msgui/appengine/inc/conversationsmodel.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/appengine/inc/conversationsmodel.h	Mon May 03 12:29:07 2010 +0300
@@ -38,17 +38,16 @@
  *
  */
 
-class ConversationsModel : public QStandardItemModel
+class ConversationsModel: public QStandardItemModel
 {
-    Q_OBJECT
+Q_OBJECT
 
 public:
 
     /**
      * Constructor
      */
-    explicit ConversationsModel(ConversationMsgStoreHandler* msgStoreHandler,
-            QObject* parent = 0);
+    explicit ConversationsModel(ConversationMsgStoreHandler* msgStoreHandler, QObject* parent = 0);
 
     /**
      * Destructor
@@ -69,8 +68,7 @@
      * @param entry, CCsConversationEntry
      * @param dynamicUpdate , true if it is a dynamic update event
      */
-    void addRow(const CCsConversationEntry& entry,
-        bool dynamicUpdate=false);
+    void addRow(const CCsConversationEntry& entry, bool dynamicUpdate = false);
 
     /**
      * Delete a row from conversations model.
@@ -78,16 +76,45 @@
      */
     void deleteRow(int msgId);
 
-
 private:
 
     /**
-     * Populate an item in model from CovergedMessage.
+     * Populate an item in model from CCsConversationEntry.
+     * @param item, QStandardItem
+     * @param entry, CCsConversationEntry
+     */
+    void populateItem(QStandardItem& item, const CCsConversationEntry& entry);
+
+    /**
+     * Populate MMS related data into item.
+     * @param item, QStandardItem
+     * @param entry, CCsConversationEntry
+     */
+    void handleMMS(QStandardItem& item, const CCsConversationEntry& entry);
+    
+    /**
+     * Populate MMS Notification related data into item.
      * @param item, QStandardItem
      * @param entry, CCsConversationEntry
      */
-    void populateItem(QStandardItem& item,
-            const CCsConversationEntry& entry);
+    void handleMMSNotification(QStandardItem& item, 
+        const CCsConversationEntry& entry);
+
+    /**
+     * Populate BT message related data into item.
+     * @param item, QStandardItem
+     * @param entry, CCsConversationEntry
+     */
+    void handleBlueToothMessages(QStandardItem& item, 
+        const CCsConversationEntry& entry);
+
+    /**
+     * Populate Bio message related data into item.
+     * @param item, QStandardItem
+     * @param entry, CCsConversationEntry
+     */
+    void handleBioMessages(QStandardItem& item, 
+        const CCsConversationEntry& entry);
 
 private:
 
@@ -97,17 +124,23 @@
      */
     ConversationMsgStoreHandler* mMsgStoreHandler;
 
-  /**
+    /**
      * UniDataModelLoader object
      * Own
      */
     UniDataModelLoader* iDataModelPluginLoader;
 
-  /**
+    /**
      * Mms Data model plugin interface
      * Not Own
      */
-  UniDataModelPluginInterface* iMmsDataPlugin;
+    UniDataModelPluginInterface* iMmsDataPlugin;
+
+    /**
+     * BioMsg Data model plugin interface
+     * Not Own
+     */
+    UniDataModelPluginInterface* iBioMsgPlugin;
 };
 
 #endif // CONVERSATIONS_MODEL_H
--- a/messagingapp/msgui/appengine/inc/conversationssummarymodel.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/appengine/inc/conversationssummarymodel.h	Mon May 03 12:29:07 2010 +0300
@@ -25,6 +25,7 @@
 
 // FORWARD DECLARATIONS
 class CCsClientConversation;
+class CCsConversationEntry;
 
 /**
  * This class implements the model of the model/view framework.
@@ -85,6 +86,21 @@
      */    
     void populateItem(QStandardItem& item,
             const CCsClientConversation& conversation);   
+    
+    /**
+     * Populate BT message related data into item.
+     * @param item, QStandardItem
+     * @param entry, CCsConversationEntry
+     */
+    void handleBlueToothMessages(QStandardItem& item, const CCsConversationEntry& entry);
+    
+    /**
+     * Populate Bio message related data into item.
+     * @param item, QStandardItem
+     * @param entry, CCsConversationEntry
+     */
+    void handleBioMessages(QStandardItem& item, const CCsConversationEntry& entry);
+
          
 };
 
--- a/messagingapp/msgui/appengine/src/conversationmsgstorehandler.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/appengine/src/conversationmsgstorehandler.cpp	Mon May 03 12:29:07 2010 +0300
@@ -15,15 +15,40 @@
 *
 */
 
+#include <textresolver.h> // from CommonEngine
+#include <mtclreg.h>
+#include <mmsnotificationclient.h>
+#include <mmssettings.h>
+#include <xqconversions.h> // from xqutils
+#include <mmsconst.h>
+#include <QDateTime>
+
 #include "conversationmsgstorehandler.h"
 #include "draftsmodel.h"
+#include "MuiuOperationWait.h"
+#include "MsgBioUids.h"
+#include "UniEditorGenUtils.h"
+
 // SYSTEM INCLUDES
 #include <StringLoader.h>
 #include <ccsdefs.h> 
-#include <mmsconst.h>
+#include <msvids.h>
+#include <mmserrors.h>
+#include <msvuids.h>
+#include <smut.h>
 #include <SendUiConsts.h>
+#include <featmgr.h>
+#include <gsmerror.h> 
 
 // CONSTANTS
+const TUid KSmsMtmUid ={KSenduiMtmSmsUidValue};
+const TUid KMmsMtmUid ={KSenduiMtmMmsUidValue};
+_LIT(KUnixEpoch, "19700000:000000.000000");
+#define BYTES_TO_KBYTES_FACTOR 1024
+
+// TODO: read global setting of formats on the phone
+const QString DATE_FORMAT("dd/MM");
+const QString TIME_FORMAT("hh:mm");
 
 // ================= MEMBER FUNCTIONS =======================
 
@@ -32,7 +57,8 @@
 // ---------------------------------------------------------
 //
 ConversationMsgStoreHandler::ConversationMsgStoreHandler():
-    iMsvSession(NULL),iDraftEntry(NULL),iDraftMessages(NULL),mDraftsModel(NULL)
+    iMsvSession(NULL),iDraftEntry(NULL),iDraftMessages(NULL),mDraftsModel(NULL),
+    iMtmReg(NULL),iMmsClient(NULL),iNotificationClient(NULL)
     {
     TRAP_IGNORE(InitL());
     }
@@ -49,17 +75,32 @@
         iDraftEntry = NULL;
         }
 
-    if( iMsvSession )
-        {
-        delete iMsvSession;
-        iMsvSession = NULL;
-        }
-
     if ( iDraftMessages )
         {
         iDraftMessages->Reset();
         delete iDraftMessages;
         iDraftMessages = NULL;
+    }
+
+    if (iMmsClient)
+    {
+        delete iMmsClient;
+        iMmsClient = NULL;
+    }
+    if (iNotificationClient)
+    {
+        delete iNotificationClient;
+        iNotificationClient = NULL;
+    }
+    if (iMtmReg)
+    {
+        delete iMtmReg;
+        iMtmReg = NULL;
+    }
+    if (iMsvSession)
+    {
+        delete iMsvSession;
+        iMsvSession = NULL;
         }
     }
 
@@ -69,7 +110,33 @@
 //
 void ConversationMsgStoreHandler::InitL( )
     {
-    iMsvSession = CMsvSession::OpenSyncL(*this);
+    TInt err = KErrNone;
+    TRAP(err,iMsvSession = CMsvSession::OpenSyncL(*this));
+    if(err != KErrNone)
+        {
+        iMsvSession = NULL;
+        return;
+        }
+    
+    TRAP(err,iMtmReg = CClientMtmRegistry::NewL(*iMsvSession));
+    if(err != KErrNone)
+        {
+        iMtmReg = NULL;
+        return;
+        }
+	
+	 // Get if offline is supported
+    FeatureManager::InitializeLibL();
+    if (FeatureManager::FeatureSupported(KFeatureIdOfflineMode))
+    {
+        iOfflineSupported = ETrue;
+    }
+    else
+    {
+        iOfflineSupported = EFalse;
+    }
+    FeatureManager::UnInitializeLib();
+		
     }
 
 // ---------------------------------------------------------
@@ -172,6 +239,17 @@
     
     TCsMmsNotificationMsgState status = EMsgStatusNull;
 
+    TTime currentTime;
+    currentTime.HomeTime( );
+    TTime expiryTime = iNotificationClient->ExpiryDate( );
+    TLocale locale;
+    expiryTime += locale.UniversalTimeOffset();
+    if (locale.QueryHomeHasDaylightSavingOn())          
+    {
+        TTimeIntervalHours daylightSaving(1);          
+        expiryTime += daylightSaving;
+    }
+
     // operationMask includes operation type. It is not bitmap but ordinal number. 
     // It does not include operation status and result
     TInt operationMask = (entry.iMtmData2 & KMmsOperationIdentifier) ;
@@ -216,6 +294,10 @@
             // It's been deleted succesfully
             status = EMsgStatusDeleted;
             }
+        else if( currentTime > expiryTime )
+            {
+            status = EMsgStatusExpired;
+            }
         else 
             {   // Normal waiting state
             status = EMsgStatusReadyForFetching;
@@ -284,6 +366,30 @@
 }
 
 // ---------------------------------------------------------
+// ConversationMsgStoreHandler::DeleteAllDraftMessages
+// ---------------------------------------------------------
+//
+void ConversationMsgStoreHandler::DeleteAllDraftMessagesL()
+{
+    // Cancel the processing of draft messages.
+    iIdle->Cancel();
+
+    CMsvEntry *draftsEntry = iMsvSession->GetEntryL(KMsvDraftEntryIdValue);
+    CleanupStack::PushL(draftsEntry);
+    CMsvEntrySelection *draftsSelection = draftsEntry->ChildrenL();
+    CleanupStack::PushL(draftsSelection);
+    if ( draftsSelection->Count() > 0 )
+        {
+        CMuiuOperationWait* wait = CMuiuOperationWait::NewLC();
+        CMsvOperation *operation = draftsEntry->DeleteL(*draftsSelection, wait->iStatus);
+        wait->Start();
+        CleanupStack::PopAndDestroy(wait);
+        delete operation;
+        }
+    CleanupStack::PopAndDestroy(2, draftsEntry);
+}
+
+// ---------------------------------------------------------
 // ConversationMsgStoreHandler::DeleteMessagesL
 // ---------------------------------------------------------
 //
@@ -330,7 +436,7 @@
             {
             iDraftEntry = iMsvSession->GetEntryL(KMsvDraftEntryIdValue);
            
-            iDraftMessages = iDraftEntry->ChildrenL();    
+            iDraftMessages = iDraftEntry->ChildrenL();
             iDraftMessageCount = iDraftEntry->Count();
 
             if ( iDraftMessageCount ) 
@@ -413,4 +519,472 @@
         }	
     return EFalse;
     }
+	
+//-----------------------------------------------------------------------------
+// ConversationMsgStoreHandler::ResendMessage(TMsvId aId)
+// 
+// -----------------------------------------------------------------------------
+//	
+	
+bool ConversationMsgStoreHandler::ResendMessageL(TMsvId aId)
+{
+    bool retval = true;
+	TMsvId serviceId;
+	TMsvEntry msgEntry;
+	  
+	if(iMsvSession == NULL)
+	    {
+        return false;
+   		}
+  TInt err = iMsvSession->GetEntry(aId, serviceId, msgEntry);
+    
+  if (KErrNone == err)
+  {
+       TUid mtmUid = msgEntry.iMtm;
+
+       CMsvEntry* entry = iMsvSession->GetEntryL(KMsvGlobalOutBoxIndexEntryId);
+       CleanupStack::PushL(entry);
+
+       CMuiuOperationWait* wait = CMuiuOperationWait::NewLC();
+
+       if (mtmUid == KSmsMtmUid)
+       {
+           UniEditorGenUtils* genUtils = new UniEditorGenUtils();
+           CleanupStack::PushL(genUtils);
+
+           // if phone is in offline mode set sending state to suspended
+           // so that mtm does not try to send it.
+           if (iOfflineSupported && genUtils->IsPhoneOfflineL())
+           {
+               msgEntry.SetSendingState(KMsvSendStateSuspended);
+               msgEntry.iError = KErrGsmOfflineOpNotAllowed;
+           }
+           else
+           {
+               msgEntry.SetSendingState(KMsvSendStateWaiting);
+           }
+           CleanupStack::PopAndDestroy(genUtils);
+
+           // Update message entry with sending state.
+           entry->SetEntryL(msgEntry.Id());
+           entry->ChangeL(msgEntry);
+
+           TMsvId firstId;
+           TSmsUtilities::ServiceIdL(*iMsvSession, firstId);
+
+           entry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);
+           //send the message
+           entry->CopyL(aId, firstId, wait->iStatus);
+           wait->Start();
+       }
+       else if (mtmUid == KMmsMtmUid)
+       {
+           //send the message
+           entry->CopyL(aId, msgEntry.iServiceId, wait->iStatus);
+           wait->Start();
+       }
+       CleanupStack::PopAndDestroy(2, entry);
+   }
+   else
+   {
+       User::LeaveIfError(err);
+   }
+   return retval;
+}
+
+//-----------------------------------------------------------------------------
+// ConversationMsgStoreHandler::DownloadOperationSupported
+// -----------------------------------------------------------------------------
+bool ConversationMsgStoreHandler::DownloadOperationSupported(
+        const TMsvId& aId)
+{
+    TMsvId serviceId;
+    TMsvEntry msgEntry;
+    TInt err = iMsvSession->GetEntry(aId,serviceId,msgEntry);
+    
+    TCsMmsNotificationMsgState msgstatus = 
+            MmsNotificationStatus( aId );
+
+    if ( msgEntry.iType == KUidMsvMessageEntry  )
+        {
+
+        if( msgEntry.iMtmData2 & KMmsNewOperationForbidden ) // New Forbidden
+            {
+            return false;
+            }
+        // If notification is succesfully routed to app 
+        // aContext.iMtmData2 & KMmsMessageRoutedToApplication is ETrue and
+        // if notification is NOT succesfully routed to app 
+        // aContext.iError is KMmsErrorUnregisteredApplication.
+        if(    ( msgEntry.iError == KMmsErrorUnregisteredApplication ) // To unregistered application
+            || ( msgEntry.iMtmData2 & KMmsMessageRoutedToApplication ) )
+            {
+            return false;
+            }
+
+        if( msgstatus == EMsgStatusDeleted )
+            { // Msg already been deleted from server
+            return false;
+            }
+
+        if( msgstatus == EMsgStatusReadyForFetching 
+            || msgstatus == EMsgStatusFailed )
+            {   // Fetch is supported if the msg is waiting or something has been failed
+            return true;
+            }
+
+        if (    msgstatus == EMsgStatusForwarded 
+            &&  msgEntry.iMtmData2 & KMmsStoredInMMBox )
+            { // Fetch is supported if it's forwarded and multiple forward is supported
+            return true;
+            }
+        
+        if( msgstatus == EMsgStatusExpired )
+            {
+            return false;
+            }
+        }
+    return false;
+}
+
+//---------------------------------------------------------------
+// ConversationMsgStoreHandler::setNotificationMessageId
+// @see header
+//---------------------------------------------------------------
+void ConversationMsgStoreHandler::setNotificationMessageId(int messageId)
+{
+    // get MMS Notification client mtm & set the content to current entry
+    if(iNotificationClient)
+    {
+        delete iNotificationClient;
+        iNotificationClient = NULL;
+    }
+    CClientMtmRegistry* mtmRegistry = 
+            CClientMtmRegistry::NewL( *iMsvSession );
+    iNotificationClient = static_cast<CMmsNotificationClientMtm*>( 
+                    mtmRegistry->NewMtmL( KUidMsgMMSNotification ));
+    iNotificationClient->SwitchCurrentEntryL(messageId);
+    iNotificationClient->LoadMessageL();
+}
+
+//---------------------------------------------------------------
+// ConversationMsgStoreHandler::NotificationMsgSize
+// @see header
+//---------------------------------------------------------------
+QString ConversationMsgStoreHandler::NotificationMsgSize()
+{
+    // Size of message.
+    TInt size = iNotificationClient->MessageTransferSize( );
+    
+    // read max receive size limit from settings
+    CMmsSettings* settings = CMmsSettings::NewL();
+    CleanupStack::PushL( settings );
+    iNotificationClient->RestoreSettingsL();
+    settings->CopyL( iNotificationClient->MmsSettings() );
+    TInt maxSize = static_cast<TInt>(settings->MaximumReceiveSize() );
+    CleanupStack::PopAndDestroy( settings );
+
+    // apply max size limit rule
+    if( maxSize > 0 )
+    {
+        if( size > maxSize )
+        {
+            size = maxSize;
+        }
+    }
+
+    // Finally make the UI string
+    int fileSize = size / BYTES_TO_KBYTES_FACTOR;
+    if ( size % BYTES_TO_KBYTES_FACTOR )
+    {
+        fileSize++;
+    }
+    // TODO: use localized string constants here
+    QString sizeString = QString("%1").arg(fileSize);
+    sizeString.append(" Kb");
+    return sizeString;
+}
+
+//---------------------------------------------------------------
+// ConversationMsgStoreHandler::NotificationClass
+// @see header
+//---------------------------------------------------------------
+QString ConversationMsgStoreHandler::NotificationClass()
+{
+    //TODO: use localized string
+    QString notificationClass;
+    TInt msgClass = iNotificationClient->MessageClass( );
+    switch( msgClass )
+    {
+        case EMmsClassPersonal:
+        {
+            notificationClass = "Personal";
+            break;
+        }
+        case EMmsClassAdvertisement:
+        {
+            notificationClass = "Advertisement";
+            break;
+        }
+        case EMmsClassInformational:
+        {
+            notificationClass = "Informative";
+            break;
+        }
+        default:
+        {   // In case no class is returned (0), don't add the field
+            break;
+        }
+    }
+    return notificationClass;
+}
+
+//---------------------------------------------------------------
+// ConversationMsgStoreHandler::NotificationStatus
+// @see header
+//---------------------------------------------------------------
+void ConversationMsgStoreHandler::NotificationStatus(
+        int& status,
+        QString& statusStr)
+{
+    // TODO : use standard strings provided by Arul
+    // fetch mms notification status from store handler
+    // and map as per our UI requirements
+    TMsvEntry entry = iNotificationClient->Entry().Entry();
+    status = MmsNotificationStatus(entry.Id());
+    switch(status)
+    {
+        case ConvergedMessage::NotifFailed:
+        {
+            statusStr = "Message retrieval failed !";
+            break;
+        }
+        case ConvergedMessage::NotifExpired:
+        {
+            statusStr = "Message Expired !";
+            break;
+        }
+        case ConvergedMessage::NotifReadyForFetching:
+        {
+            statusStr = "Multimedia Message waiting...";
+            break;
+        }
+        case ConvergedMessage::NotifWaiting:
+        case ConvergedMessage::NotifRetrieving:
+        {
+            statusStr = "Retrieving message...";
+            break;
+        }
+        default:
+        {
+            // not handled, do nothing
+            break;
+        }
+    }
+}
+
+//---------------------------------------------------------------
+// ConversationMsgStoreHandler::NotificationExpiryDate
+// @see header
+//---------------------------------------------------------------
+void ConversationMsgStoreHandler::NotificationExpiryDate(
+        TTime& expiryTime,
+        QString& expiryTimeStr)
+{
+    // get expiry time from entry
+    expiryTime = iNotificationClient->ExpiryDate( );
+    TLocale locale;
+    expiryTime += locale.UniversalTimeOffset();
+    if (locale.QueryHomeHasDaylightSavingOn())          
+    {
+        TTimeIntervalHours daylightSaving(1);          
+        expiryTime += daylightSaving;
+    }
+    
+    // create formatted string for the expiry time
+    TTime unixEpoch(KUnixEpoch);
+    TTimeIntervalSeconds seconds;
+    expiryTime.SecondsFrom(unixEpoch, seconds);
+    QDateTime dateTime;
+    dateTime.setTime_t(seconds.Int());
+    if (dateTime.date() == QDateTime::currentDateTime().date()) {
+        expiryTimeStr = dateTime.toString(TIME_FORMAT);
+    }
+    else {
+        expiryTimeStr = dateTime.toString(DATE_FORMAT);
+    }
+}
+
+//-----------------------------------------------------------------------------
+// ConversationMsgStoreHandler::DownloadMessageL
+// 
+// -----------------------------------------------------------------------------
+//  
+    
+TInt ConversationMsgStoreHandler::DownloadMessageL(TMsvId aId)
+{
+    TMsvId serviceId;
+    TMsvEntry msgEntry;
+
+    TInt err = iMsvSession->GetEntry(aId,serviceId,msgEntry);
+
+    if(err!= KErrNone || msgEntry.iMtm!= KUidMsgMMSNotification)
+    {
+        return KErrGeneral;
+    }
+
+    /*if(!iNotificationClient)
+    {
+        iNotificationClient = static_cast<CMmsNotificationClientMtm*> 
+        (iMtmReg->NewMtmL(KUidMsgMMSNotification));
+    }
+    iNotificationClient->SwitchCurrentEntryL(aId);    */ 
+    
+    // set context to current entry
+    setNotificationMessageId(aId);
+
+    TTime currentTime;
+    currentTime.HomeTime( );
+    TTime expiryTime = iNotificationClient->ExpiryDate( );
+    TLocale locale;
+    expiryTime += locale.UniversalTimeOffset();
+    if (locale.QueryHomeHasDaylightSavingOn())          
+    {
+        TTimeIntervalHours daylightSaving(1);          
+        expiryTime += daylightSaving;
+    }
+
+    if( currentTime > expiryTime )
+    {   // Message is expired
+        return KErrGeneral;
+    }
+
+    //Check if the mms client mtm object is already created or not
+    if( iMmsClient )
+    {
+        // If mms client mtm object is already created restore the settings
+        iMmsClient->RestoreSettingsL();
+    }
+    else
+    {
+        iMmsClient = static_cast<CMmsClientMtm*> (iMtmReg->NewMtmL(KMmsMtmUid));
+    }        
+
+    //TODO chk if only AP check is sufficient
+    TMsvId service = iMmsClient->DefaultServiceL();
+    TBool valid( iMmsClient->ValidateService( service ) == KErrNone );
+    if(!valid)
+    {
+        return KErrNotFound;
+    }
+
+    CMuiuOperationWait* wait =CMuiuOperationWait::NewLC();;
+
+    CMsvEntrySelection* sel = new ( ELeave ) CMsvEntrySelection;
+    CleanupStack::PushL( sel );
+    sel->AppendL( aId );    
+
+    CMsvOperation* op = 
+            iNotificationClient->FetchMessagesL( *sel, wait->iStatus );
+
+    if( !op )
+    {  
+        CleanupStack::PopAndDestroy( sel ); // selection
+        CleanupStack::PopAndDestroy( wait ); // wait
+        return KErrGeneral; 
+    }
+
+    CleanupStack::PushL( op );
+    wait->Start();
+    // Lets ignore the return value of wait
+
+    CleanupStack::PopAndDestroy( op ); // op 
+    CleanupStack::PopAndDestroy( sel ); // selection
+    CleanupStack::PopAndDestroy( wait ); // wait
+
+    return KErrNone;
+}
+
+//----------------------------------------------------------------------------
+// ConversationMsgStoreHandler::markAsReadAndGetType
+// @see header
+//----------------------------------------------------------------------------
+void ConversationMsgStoreHandler::markAsReadAndGetType(int msgId,
+                                                      int& msgType,
+                                                      int& msgSubType)
+    {
+    msgType = ConvergedMessage::None;
+    msgSubType = ConvergedMessage::None;
+    
+    CMsvEntry* cEntry = NULL;
+    TRAPD(err, cEntry = iMsvSession->GetEntryL(msgId));
+    if ( err == KErrNone)
+        {
+        TMsvEntry entry = cEntry->Entry();
+        if ( entry.Unread() ) 
+            {
+            // Mark the entry as read
+            entry.SetUnread( EFalse );
+            cEntry->ChangeL( entry );
+            }
+        // extract message type
+        extractMsgType(entry,msgType,msgSubType);
+        }
+    
+    delete cEntry;
+    }
+
+//----------------------------------------------------------------------------
+// ConversationMsgStoreHandler::extractMsgType
+// @see header
+//----------------------------------------------------------------------------
+void ConversationMsgStoreHandler::extractMsgType(const TMsvEntry& entry,
+                                    int& msgType,
+                                    int& msgSubType)
+    {
+    msgType = ConvergedMessage::None;
+    msgSubType = ConvergedMessage::None;
+
+    switch(entry.iMtm.iUid)   
+        {
+        case KSenduiMtmSmsUidValue:            
+            msgType = ConvergedMessage::Sms;
+            break;
+        case KSenduiMtmBtUidValue:
+            msgType = ConvergedMessage::BT;
+            break;
+        case KSenduiMtmMmsUidValue:        
+            msgType = ConvergedMessage::Mms;
+            break;
+        case KSenduiMMSNotificationUidValue:            
+            msgType = ConvergedMessage::MmsNotification;
+            break;
+        case KSenduiMtmBioUidValue:
+            { 
+            msgType = ConvergedMessage::BioMsg; 
+
+            // based on the biotype uid set message type
+            if(entry.iBioType == KMsgBioUidRingingTone.iUid)
+                {
+                msgSubType = ConvergedMessage::RingingTone;
+                }
+            else if(entry.iBioType == KMsgBioProvisioningMessage.iUid)
+                {
+                msgSubType = ConvergedMessage::Provisioning;
+                }     
+            else if (entry.iBioType == KMsgBioUidVCard.iUid)
+                {
+                msgSubType = ConvergedMessage::VCard;
+                }
+            else if (entry.iBioType == KMsgBioUidVCalendar.iUid)
+                {
+                msgSubType = ConvergedMessage::VCal;
+                }        
+            }
+            break;
+        default:
+            msgType = ConvergedMessage::None;       
+            break;
+        }
+    }
 // End of file
--- a/messagingapp/msgui/appengine/src/conversationsengine.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/appengine/src/conversationsengine.cpp	Mon May 03 12:29:07 2010 +0300
@@ -154,6 +154,16 @@
 }
 
 //---------------------------------------------------------------
+// ConversationsEngine::deleteAllDraftMessages
+// @see header
+//---------------------------------------------------------------
+void ConversationsEngine::deleteAllDraftMessages()
+{
+    int error;
+    TRAP(error, d_ptr->deleteAllDraftMessagesL());
+}
+
+//---------------------------------------------------------------
 // ConversationsEngine::markConversationRead
 // @see header
 //---------------------------------------------------------------
@@ -188,8 +198,7 @@
 // @see header
 //---------------------------------------------------------------
 void ConversationsEngine::getContactDetails(qint64 conversationId,
-    QString& firstName,
-    QString& lastName,
+    QString& displayName,
     QString& address)
 {
     QModelIndexList indexList = mConversationsSummaryModel->match(
@@ -201,8 +210,7 @@
 
     if(indexList.count() > 0)
     {
-        firstName = indexList[0].data(FirstName).toString();
-        lastName = indexList[0].data(LastName).toString();
+        displayName = indexList[0].data(DisplayName).toString();
         address = indexList[0].data(ConversationAddress).toString();
     }         
 }
@@ -284,5 +292,50 @@
     d_ptr->fetchMoreConversations();
 }
 
+//---------------------------------------------------------------
+// ConversationsEngine::resendMessage()
+// @see header
+//---------------------------------------------------------------
+
+bool ConversationsEngine::resendMessage(qint32 messageId)
+{
+    return d_ptr->resendMessage(messageId);
+}
+
+//---------------------------------------------------------------
+// ConversationsEngine::downloadMessage()
+// @see header
+//---------------------------------------------------------------
+
+int ConversationsEngine::downloadMessage(qint32 messageId)
+{
+    return d_ptr->downloadMessage(messageId);
+}
+
+//---------------------------------------------------------------
+// ConversationsEngine::downloadOperationSupported()
+// @see header
+//---------------------------------------------------------------
+bool ConversationsEngine::downloadOperationSupported(qint32 messageId)
+{
+    return d_ptr->downloadOperationSupported(messageId);
+}
+
+//---------------------------------------------------------------
+// ConversationsEngine::markAsReadAndGetType()
+// @see header
+//---------------------------------------------------------------
+
+void ConversationsEngine::markAsReadAndGetType(qint32 messageId,
+                                               int& msgType,
+                                               int& msgSubType)
+{
+mConversationMsgStoreHandler->markAsReadAndGetType(messageId,
+                                                    msgType,
+                                                    msgSubType);
+}
+
+
+
 //EOF
 
--- a/messagingapp/msgui/appengine/src/conversationsengine_p.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/appengine/src/conversationsengine_p.cpp	Mon May 03 12:29:07 2010 +0300
@@ -147,6 +147,15 @@
 }
 
 //---------------------------------------------------------------
+// ConversationsEnginePrivate::deleteallDraftMessages
+// @see header
+//---------------------------------------------------------------
+void ConversationsEnginePrivate::deleteAllDraftMessagesL()
+{
+    mConversationMsgStoreHandler->DeleteAllDraftMessagesL();
+}
+
+//---------------------------------------------------------------
 // ConversationsEnginePrivate::markConversationReadL
 // @see header
 //---------------------------------------------------------------
@@ -277,5 +286,44 @@
         }
 }
 
+//---------------------------------------------------------------
+// ConversationsEnginePrivate::resendMessage()
+// @see header
+//---------------------------------------------------------------
+bool ConversationsEnginePrivate::resendMessage(TMsvId messageId)
+{
+    TInt err = KErrNone;
+    bool retval = true;
+    TRAP(err, retval = mConversationMsgStoreHandler->ResendMessageL(messageId));
+    return ((err == KErrNone) && (retval == true))?true:false;
+}
+
+//---------------------------------------------------------------
+// ConversationsEnginePrivate::downloadMessage
+// @see header
+//---------------------------------------------------------------
+TInt ConversationsEnginePrivate::downloadMessage(TMsvId messageId)
+{
+    TInt err = KErrNone;
+    TInt retval = KErrNone;
+    TRAP(err, retval = 
+            mConversationMsgStoreHandler->DownloadMessageL(messageId));
+            
+    if( err!=KErrNone)
+    {
+        retval = KErrGeneral;
+    }
+    
+    return retval;
+}
+
+//---------------------------------------------------------------
+// ConversationsEnginePrivate::downloadOperationSupported()
+// @see header
+//---------------------------------------------------------------
+bool ConversationsEnginePrivate::downloadOperationSupported(TMsvId messageId)
+{
+  return mConversationMsgStoreHandler->DownloadOperationSupported(messageId);   
+}
 //EOF
 
--- a/messagingapp/msgui/appengine/src/conversationsengineutility.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/appengine/src/conversationsengineutility.cpp	Mon May 03 12:29:07 2010 +0300
@@ -13,78 +13,146 @@
  *
  * Description: Utility class for conersationengine.
  */
+#include <QFile>
+#include <qversitcontactimporter.h>
+#include <qversitdocument.h>
+#include <qversitreader.h>
+#include <qtcontacts.h>
+#include <qmobilityglobal.h>
+#include <senduiconsts.h>
+
 #include "conversationsengineutility.h"
 #include "convergedmessage.h"
-#include <senduiconsts.h>
+
+QTM_USE_NAMESPACE
+
 
 //---------------------------------------------------------------
 // ConversationsEngineUtility::messageType
 // @see header
 //---------------------------------------------------------------
 int ConversationsEngineUtility::messageType(TCsType value)
-    {
+{
     int mMessageType;
-    switch(value)
-        {
-        case ECsSMS:
-            mMessageType = ConvergedMessage::Sms;
-            break;
-        case ECsMMS:
-            mMessageType = ConvergedMessage::Mms;
-            break;
-        case ECsBioMsg:
-            mMessageType = ConvergedMessage::BioMsg;
-            break;
-        case ECsBlueTooth:
-            mMessageType = ConvergedMessage::BT;
-            break;
-        case ECsRingingTone:
-            mMessageType = ConvergedMessage::RingingTone;
-            break;
-        case ECsProvisioning:
-            mMessageType = ConvergedMessage::Provisioning;
-            break;
-		case ECsBioMsg_VCard:
-            mMessageType = ConvergedMessage::VCard;
-            break;
-		case ECsBioMsg_VCal:
-		        mMessageType = ConvergedMessage::VCal;
-            break;
-        default:
-            mMessageType = ConvergedMessage::Sms;
-            break;
-        }
+    switch (value) {
+    case ECsSMS:
+        mMessageType = ConvergedMessage::Sms;
+        break;
+    case ECsMMS:
+    case ECsAudio:
+        mMessageType = ConvergedMessage::Mms;
+        break;
+    case ECsBioMsg:
+    case ECsRingingTone:
+    case ECsProvisioning:
+    case ECsBioMsg_VCard:
+    case ECsBioMsg_VCal:
+        mMessageType = ConvergedMessage::BioMsg;
+        break;
+    case ECsBlueTooth:
+        mMessageType = ConvergedMessage::BT;
+        break;
+    case ECsMmsNotification:
+        mMessageType = ConvergedMessage::MmsNotification;
+        break;
+    default:
+        mMessageType = ConvergedMessage::None;
+        break;
+    }
     return mMessageType;
-    }
+}
 
 //---------------------------------------------------------------
 // ConversationsEngineUtility::mapMsgType
 // @see header
 //---------------------------------------------------------------
 int ConversationsEngineUtility::messageType(TInt32 value)
-    {
-    int type = ConvergedMessage::Sms;
-    
-    switch(value)
-        {
-        case KSenduiMtmSmsUidValue:
-            type = ConvergedMessage::Sms;
-            break;
-        case KSenduiMtmBtUidValue:
-            type = ConvergedMessage::BT;
-            break;
-        case KSenduiMtmMmsUidValue:
-            type = ConvergedMessage::Mms;
-            break;
-        case KSenduiMtmBioUidValue:
-            type = ConvergedMessage::BioMsg;
-            break;
-        default:
-            type =ConvergedMessage::Sms;
-            break;
+{
+    int type;
+    switch (value) {
+    case KSenduiMtmSmsUidValue:
+        type = ConvergedMessage::Sms;
+        break;
+    case KSenduiMtmBtUidValue:
+        type = ConvergedMessage::BT;
+        break;
+    case KSenduiMtmMmsUidValue:
+        type = ConvergedMessage::Mms;
+        break;
+    case KSenduiMtmBioUidValue:
+        type = ConvergedMessage::BioMsg;
+        break;
+    default:
+        type = ConvergedMessage::None;
+        break;
+    }
+    return type;
+}
+
+//---------------------------------------------------------------
+// ConversationsEngineUtility::messageSubType
+// @see header
+//---------------------------------------------------------------
+int ConversationsEngineUtility::messageSubType(TCsType value)
+{
+    int messageSubType;
+    switch (value) {
+    case ECsRingingTone:
+        messageSubType = ConvergedMessage::RingingTone;
+        break;
+    case ECsProvisioning:
+        messageSubType = ConvergedMessage::Provisioning;
+        break;
+    case ECsBioMsg_VCard:
+        messageSubType = ConvergedMessage::VCard;
+        break;
+    case ECsBioMsg_VCal:
+        messageSubType = ConvergedMessage::VCal;
+        break;
+    case ECsAudio:
+        messageSubType = ConvergedMessage::Audio;
+        break;
+    default:
+        messageSubType = ConvergedMessage::None;
+        break;
+    }
+    return messageSubType;
+}
+
+//---------------------------------------------------------------
+// ConversationsEngineUtility::getVcardDisplayName
+// @see header
+//---------------------------------------------------------------
+QString ConversationsEngineUtility::getVcardDisplayName(QString filePath)
+{
+    QString displayName;
+    //open file for parsing
+    QFile file(filePath);
+    if (!file.open(QIODevice::ReadOnly)) {
+        return displayName;
+    }
+    // parse contents
+    QVersitReader reader;
+    reader.setDevice(&file);
+    if (reader.startReading()) {
+        if (reader.waitForFinished()) {
+            QList<QVersitDocument> versitDocuments = reader.results();
+            // Use the resulting document
+            if (versitDocuments.count() > 0) {
+                QVersitContactImporter importer;
+                QList<QContact> contacts = importer.importContacts(versitDocuments);
+                // get display-name
+                if (contacts.count() > 0) {
+                    QContactManager* contactManager = new QContactManager("symbian");
+                    displayName = contactManager->synthesizedDisplayLabel(contacts[0]);
+                    delete contactManager;
+                }
+            }
         }
-    return (type);
     }
+    file.close();
 
+    return displayName;
+}
 
 // End of file
--- a/messagingapp/msgui/appengine/src/conversationsmodel.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/appengine/src/conversationsmodel.cpp	Mon May 03 12:29:07 2010 +0300
@@ -25,217 +25,201 @@
 #include "unidatamodelplugininterface.h"
 #include <ccsconversationentry.h>
 #include <QFile>
+#include <QFileInfo>
 
 // LOCAL CONSTANTS
-const QString MMSStr("mms");
 
 //---------------------------------------------------------------
 // ConversationsModel::ConversationsModel
 // Constructor
 //---------------------------------------------------------------
-ConversationsModel::ConversationsModel(
-    ConversationMsgStoreHandler* msgStoreHandler,
-    QObject* parent): QStandardItemModel(parent),
-    mMsgStoreHandler(msgStoreHandler)
-            {
-            iDataModelPluginLoader = new UniDataModelLoader;
-            iDataModelPluginLoader->loadPlugins();
-            iMmsDataPlugin = iDataModelPluginLoader->getDataModelPlugin(MMSStr);
-            }
-
+ConversationsModel::ConversationsModel(ConversationMsgStoreHandler* msgStoreHandler,
+    QObject* parent) :
+    QStandardItemModel(parent), mMsgStoreHandler(msgStoreHandler)
+{
+    iDataModelPluginLoader = new UniDataModelLoader;
+    iMmsDataPlugin = iDataModelPluginLoader->getDataModelPlugin(ConvergedMessage::Mms);
+    iBioMsgPlugin = iDataModelPluginLoader->getDataModelPlugin(ConvergedMessage::BioMsg);
+}
 
 //---------------------------------------------------------------
 // ConversationsModel::~ConversationsModel
 // Destructor
 //---------------------------------------------------------------
 ConversationsModel::~ConversationsModel()
-    {
-    if(iDataModelPluginLoader)
-    {
+{
+    if (iDataModelPluginLoader) {
         delete iDataModelPluginLoader;
         iDataModelPluginLoader = NULL;
     }
-    }
+}
 
 //---------------------------------------------------------------
 // ConversationsModel::data
 // @see header
 //---------------------------------------------------------------
-QVariant ConversationsModel::data(const QModelIndex & index , int role ) const
+QVariant ConversationsModel::data(const QModelIndex & index, int role) const
 {
     QVariant value;
     QStandardItem* item = itemFromIndex(index);
-    switch(role)
+    switch (role) {
+    case ConversationId:
+    {
+        value = item->data(ConversationId);
+        break;
+    }
+    case UnReadStatus:
+    {
+        value = item->data(UnReadStatus);
+        break;
+    }
+    case ContactId:
+    {
+        value = item->data(ContactId);
+        break;
+    }
+    case TimeStamp:
+    {
+        value = item->data(TimeStamp);
+        break;
+    }
+    case ConvergedMsgId:
+    {
+        value = item->data(ConvergedMsgId);
+        break;
+    }
+    case MessageProperty:
+    {
+        value = item->data(MessageProperty);
+        break;
+    }
+    case MessageType:
+    {
+        value = item->data(MessageType);
+        break;
+    }
+    case MessageSubType:
+    {
+        value = item->data(MessageSubType);
+        break;
+    }
+    case Subject:
+    {
+        value = item->data(Subject);
+        break;
+    }
+    case BodyText:
+    {
+        value = item->data(BodyText);
+        break;
+    }
+    case ConversationAddress:
     {
-        case ConversationId:
-        {
-            value = item->data(ConversationId);
-            break;
-        }
-        case UnReadStatus:
-        {
-            value = item->data(UnReadStatus);
-            break;
-        }
-        case ContactId:
-        {
-            value = item->data(ContactId);
-            break;
-        }
-        case TimeStamp:
-        {
-            value = item->data(TimeStamp);
-            break;
-        }
-        case ConvergedMsgId:
-        {
-            value = item->data(ConvergedMsgId);
-            break;
-        }
-        case MessageProperty:
-        {
-            value = item->data(MessageProperty);
-            break;
-        }
-        case MessageType:
-        {
-            value = item->data(MessageType);
-            break;
-        }
-        case Subject:
-        {
-            value = item->data(Subject);
-            break;
-        }
-        case BodyText:
-        {
-            value = item->data(BodyText);
-            break;
-        }
-        case ConversationAddress:
-        {
-            value = item->data(ConversationAddress);
-            break;
-        }
-        case Direction:
-        {
-            value = item->data(Direction);
-            break;
-        }
-        case SendingState:
-        {
-            value = item->data(SendingState);
-            break;
-        }
-        case MessagePriority:
-        {
-            value = item->data(MessagePriority);
-            break;
-        }
-        case Attachments:
-        {
-            value = item->data(Attachments);
-            break;
-        }
-        case MessageLocation:
-        {
-            value = item->data(MessageLocation);
-            break;
-        }
-        case MessageStore:
-        {
-            value = item->data(MessageStore);
-            break;
-        }
-        case ConversationAlias:
-        {
-            value = item->data(ConversationAlias);
-            break;
-        }
-        case UnreadCount:
-        {
-
-            value = item->data(UnreadCount);
-            break;
-        }
-        case FirstName: // Fall through start
-            value = item->data(FirstName);
-            break;
-        case LastName:
-            value = item->data(LastName);
-            break;
-        case NickName:
-            value = item->data(NickName);
-            break;
-        case Avatar:    // Fall througn end
-            value = item->data(Avatar);
-            break;
-        default:
-        {
-                //No matching role found, set invalid variant
-                value = QVariant();
-                break;
-        }
-      }
-        return value;
+        value = item->data(ConversationAddress);
+        break;
+    }
+    case Direction:
+    {
+        value = item->data(Direction);
+        break;
+    }
+    case SendingState:
+    {
+        value = item->data(SendingState);
+        break;
+    }
+    case MessagePriority:
+    {
+        value = item->data(MessagePriority);
+        break;
+    }
+    case Attachments:
+    {
+        value = item->data(Attachments);
+        break;
+    }
+    case MessageLocation:
+    {
+        value = item->data(MessageLocation);
+        break;
+    }
+    case MessageStore:
+    {
+        value = item->data(MessageStore);
+        break;
+    }
+    case ConversationAlias:
+    {
+        value = item->data(ConversationAlias);
+        break;
+    }
+    case UnreadCount:
+    {
+        value = item->data(UnreadCount);
+        break;
+    }
+    case DisplayName: // Fall through start
+        value = item->data(DisplayName);
+        break;    
+    case Avatar: // Fall througn end
+        value = item->data(Avatar);
+        break;
+    case NotificationStatus:
+        value = item->data(NotificationStatus);
+        break;
+    default:
+    {
+        //No matching role found, set invalid variant
+        value = QVariant();
+        break;
+    }
+    }
+    return value;
 }
 
 //---------------------------------------------------------------
 // ConversationsModel::addRow
 // @see header
 //---------------------------------------------------------------
-void ConversationsModel::addRow(
-    const CCsConversationEntry& entry,
-    bool dynamicUpdate)
+void ConversationsModel::addRow(const CCsConversationEntry& entry, bool dynamicUpdate)
 {
-    int msgId = entry.EntryId();	
+    int msgId = entry.EntryId();
     //match, if found update else add item
-    QModelIndexList indexList = this->match(index(0, 0), 
-        ConvergedMsgId, 
-        msgId, -1, Qt::MatchExactly);
+    QModelIndexList indexList = this->match(index(0, 0), ConvergedMsgId, msgId, -1,
+        Qt::MatchExactly);
 
     // if not found, add new item
-    if ( indexList.count() == 0 )
-    {    
+    if (indexList.count() == 0) {
         QStandardItem* item = new QStandardItem();
-        populateItem(*item,entry);
-        if(!dynamicUpdate)
-        {
-            insertRow(0,item);    
+        populateItem(*item, entry);
+        if (!dynamicUpdate) {
+            insertRow(0, item);
         }
-        else
-        {    
+        else {
             int i;
-            for( i= rowCount()-1; i >=0  ; --i)
-            {
-                QStandardItem* modelItem = this->item(i,0);
-                if( modelItem->data(ConvergedMsgId).toInt() < 
-                        item->data(ConvergedMsgId).toInt())
-                {
-                    if( i == rowCount()-1)
-                    {
+            for (i = rowCount() - 1; i >= 0; --i) {
+                QStandardItem* modelItem = this->item(i, 0);
+                if (modelItem->data(ConvergedMsgId).toInt() < item->data(ConvergedMsgId).toInt()) {
+                    if (i == rowCount() - 1) {
                         appendRow(item);
                     }
-                    else
-                    {    
-                        insertRow(i+1,item);
+                    else {
+                        insertRow(i + 1, item);
                     }
                     return;
                 }
             }
-            if( i == 0 )
-            {
-                insertRow(0,item);
+            if (i == 0) {
+                insertRow(0, item);
             }
         }
     }
-    else
-    {
+    else {
         // Update an existing item
         QModelIndex index = indexList[0];
         QStandardItem* item = this->item(index.row(), 0);
-        populateItem(*item,entry);
-        }
+        populateItem(*item, entry);
+    }
 }
 
 //---------------------------------------------------------------
@@ -243,27 +227,23 @@
 // @see header
 //---------------------------------------------------------------
 void ConversationsModel::deleteRow(int msgId)
-    {
+{
     //match, if found remove item
-    QModelIndexList indexList = this->match(index(0, 0), 
-            ConvergedMsgId, 
-            msgId, 1, Qt::MatchExactly);
+    QModelIndexList indexList =
+        this->match(index(0, 0), ConvergedMsgId, msgId, 1, Qt::MatchExactly);
 
-    if( indexList.count() == 1 )
-        {
+    if (indexList.count() == 1) {
         QModelIndex index = indexList[0];
         this->removeRow(index.row());
-        }
     }
-
+}
 
 //---------------------------------------------------------------
 // ConversationsModel::populateItem
 // @see header
 //---------------------------------------------------------------
-void ConversationsModel::populateItem(QStandardItem& item, 
-        const CCsConversationEntry& entry)
-    {
+void ConversationsModel::populateItem(QStandardItem& item, const CCsConversationEntry& entry)
+{
     int msgId = entry.EntryId();
     // id
     item.setData(msgId, ConvergedMsgId);
@@ -271,117 +251,258 @@
     // description
     HBufC* description = entry.Description();
     QString subject("");
-    if( description && description->Length())
-        {
-        subject = (S60QConversions::s60DescToQString(*description));
-        item.setData(subject, Subject); 
-        }
+    if (description && description->Length()) {
+        subject = (S60QConversions::s60DescToQString(*description));     
+    }
 
     // time stamp 
     TTime unixEpoch(KUnixEpoch);
     TTimeIntervalSeconds seconds;
-    TTime timeStamp(entry.TimeStamp() );
+    TTime timeStamp(entry.TimeStamp());
     timeStamp.SecondsFrom(unixEpoch, seconds);
     item.setData(seconds.Int(), TimeStamp);
 
     //contact details
     HBufC* contact = entry.Contact();
-    if( contact && contact->Length())
-        {
+    if (contact && contact->Length()) {
         item.setData(S60QConversions::s60DescToQString(*contact), ConversationAddress);
-        }
+    }
 
     // message type.
-    item.setData(ConversationsEngineUtility::messageType(entry.GetType()), MessageType);
+    int msgType = ConversationsEngineUtility::messageType(entry.GetType());
+    item.setData(msgType, MessageType);
+
+    //message sub-type
+    item.setData(ConversationsEngineUtility::messageSubType(entry.GetType()), MessageSubType);
+
     // unread status
-    if(entry.IsAttributeSet(ECsAttributeUnread))
-    {    
-    item.setData(true,UnReadStatus);
+    if (entry.IsAttributeSet(ECsAttributeUnread)) {
+        item.setData(true, UnReadStatus);
     }
-    else
-    {
-    item.setData(false,UnReadStatus);
+    else {
+        item.setData(false, UnReadStatus);
     }
-    
+
     //sending state
     item.setData(entry.GetSendState(), SendingState);
     // direction
     item.setData(entry.ConversationDir(), Direction);
 
     //location
-    if(entry.ConversationDir() == ECsDirectionIncoming)
-    {
+    if (entry.ConversationDir() == ECsDirectionIncoming) {
         item.setData(ConvergedMessage::Inbox, MessageLocation);
     }
-    else if(entry.IsAttributeSet(ECsAttributeDraft))
-    {
+    else if (entry.IsAttributeSet(ECsAttributeDraft)) {
         item.setData(ConvergedMessage::Draft, MessageLocation);
     }
-    else if(entry.IsAttributeSet(ECsAttributeSent))
-    {
+    else if (entry.IsAttributeSet(ECsAttributeSent)) {
         item.setData(ConvergedMessage::Sent, MessageLocation);
     }
-    else
-    {
+    else {
         item.setData(ConvergedMessage::Outbox, MessageLocation);
     }
 
-    //message specific handling
-    TCsType msgType = entry.GetType();
-    if(msgType == ECsMMS)
-    {
-        iMmsDataPlugin->setMessageId(entry.EntryId());
-
-        if( iMmsDataPlugin->attachmentCount() > 0 )
-        {
-        item.setData(ConvergedMessage::Attachment,MessageProperty);
-        }
+    //message specific handling    
+    if (msgType == ConvergedMessage::Mms) {
+        handleMMS(item, entry);
+    }
+    else if(msgType == ConvergedMessage::MmsNotification) {
+        item.setData(subject, Subject);
+        handleMMSNotification(item, entry);
+    }
+    else if (msgType == ConvergedMessage::BT) {
+        handleBlueToothMessages(item, entry);
+    }
+    else if (msgType == ConvergedMessage::BioMsg) {
+        handleBioMessages(item, entry);
+    }
+    else {
+        // sms bodytext
+        item.setData(subject, BodyText);
+    }
+}
 
-        int slideCount = iMmsDataPlugin->slideCount();
-        bool isBodyTextSet = false;
-        QString textContent;
-        QStringList attachmentPaths;
+//---------------------------------------------------------------
+// ConversationsModel::handleMMS
+// @see header
+//---------------------------------------------------------------
+void ConversationsModel::handleMMS(QStandardItem& item, const CCsConversationEntry& entry)
+{
+    iMmsDataPlugin->setMessageId(entry.EntryId());
+    if (iMmsDataPlugin->attachmentCount() > 0) {
+        item.setData(ConvergedMessage::Attachment, MessageProperty);
+    }
 
-        for( int i=0; i < slideCount; ++i )
-        {
-            UniMessageInfoList objectList = iMmsDataPlugin->slideContent(i);
-            for( int index=0; index < objectList.count() ; ++index )
-            {
-                attachmentPaths.append(objectList[index]->path());
-                if( !isBodyTextSet && objectList[index]->mimetype().contains("text") )
+    int slideCount = iMmsDataPlugin->slideCount();
+    bool isBodyTextSet = false;
+    QString textContent;
+    QStringList attachmentPaths;
+
+    for (int i = 0; i < slideCount; ++i) {
+        UniMessageInfoList objectList = iMmsDataPlugin->slideContent(i);
+        for (int index = 0; index < objectList.count(); ++index) {
+            attachmentPaths.append(objectList[index]->path());
+            if (!isBodyTextSet && objectList[index]->mimetype().contains("text")) {
+                QFile file(objectList[index]->path());
+                if(file.open(QIODevice::ReadOnly))
                 {
-                    QFile file(objectList[index]->path());
-                    file.open(QIODevice::ReadOnly);
                     textContent = file.readAll();
                     item.setData(textContent, BodyText);
                     isBodyTextSet = true;
                     file.close();
                 }
             }
-            foreach(UniMessageInfo* slide,objectList)
-                {
-                delete slide;
-                }
         }
-        //populate item  with the attachment list
-        item.setData(attachmentPaths.join("|"),Attachments);
-        if(entry.IsAttributeSet(ECsAttributeHighPriority))
+        foreach(UniMessageInfo* slide,objectList)
+            {
+                delete slide;
+            }
+    }
+    //populate item  with the attachment list
+    item.setData(attachmentPaths.join("|"), Attachments);
+    if (entry.IsAttributeSet(ECsAttributeHighPriority)) {
+        item.setData(ConvergedMessage::High, MessagePriority);
+    }
+    else if (entry.IsAttributeSet(ECsAttributeLowPriority)) {
+        item.setData(ConvergedMessage::Low, MessagePriority);
+    }
+    //subject
+    item.setData(iMmsDataPlugin->subject(), Subject);
+}
+
+//---------------------------------------------------------------
+// ConversationsModel::handleMMSNotification
+// @see header
+//---------------------------------------------------------------
+void ConversationsModel::handleMMSNotification(QStandardItem& item,
+    const CCsConversationEntry& entry)
+{
+    // set context to current entry
+    mMsgStoreHandler->setNotificationMessageId(entry.EntryId());
+    
+    // fetch relevent info to show in CV
+    // msg size
+    QString estimatedMsgSizeStr = 
+            mMsgStoreHandler->NotificationMsgSize();
+    
+    // msg class type
+    QString classInfoStr = mMsgStoreHandler->NotificationClass();
+    
+    // notification expiry date
+    //TODO: Need to do localization of digits used to show expiry time
+    TTime expiryTime;
+    QString expiryTimeStr;
+    mMsgStoreHandler->NotificationExpiryDate(expiryTime, expiryTimeStr);
+    
+    // notification state e.g. waiting, retrieving etc
+    QString statusStr;
+    int status;
+    mMsgStoreHandler->NotificationStatus(status, statusStr);
+    
+    // create data for bodytext role
+    QString dataText;
+    dataText.append("Size: "); // TODO: use logical str name
+    dataText.append(estimatedMsgSizeStr);
+    dataText.append(QChar::LineSeparator);
+    dataText.append("Class: "); // TODO: use logical str name
+    dataText.append(classInfoStr);
+    dataText.append(QChar::LineSeparator);
+    dataText.append("Expiry date: "); //TODO: use logical str name
+    dataText.append(expiryTimeStr);
+    if(!statusStr.isEmpty())
+    {
+        dataText.append(QChar::LineSeparator);
+        dataText.append(statusStr);
+        dataText.append(QChar::LineSeparator); //Temp fix to be removed
+    }
+
+    // set fetched data to roles
+    item.setData(status, NotificationStatus);
+    item.setData(dataText, BodyText);
+
+    if (entry.IsAttributeSet(ECsAttributeHighPriority)) {
+        item.setData(ConvergedMessage::High, MessagePriority);
+    }
+    else if (entry.IsAttributeSet(ECsAttributeLowPriority)) {
+        item.setData(ConvergedMessage::Low, MessagePriority);
+    }
+}
+
+//---------------------------------------------------------------
+// ConversationsModel::handleBlueToothMessages
+// @see header
+//---------------------------------------------------------------
+void ConversationsModel::handleBlueToothMessages(QStandardItem& item,
+    const CCsConversationEntry& entry)
+{
+    //TODO, needs to be revisited again, once BT team provides the solution for
+    //BT received as Biomsg issue.
+    QString description = S60QConversions::s60DescToQString(*(entry.Description()));
+
+    if (description.contains(".vcf") || description.contains(".ics")) // "vCard"
+    {
+        //message sub-type
+        item.setData(ConvergedMessage::VCard, MessageSubType);
+
+        //parse vcf file to get the details
+        QString displayName = ConversationsEngineUtility::getVcardDisplayName(description);
+        item.setData(displayName, BodyText);
+    }    
+    else 
+    {
+        if (description.contains(".vcs")) // "vCalendar"
         {
-            item.setData(ConvergedMessage::High,MessagePriority);
+            //message sub-type
+            item.setData(ConvergedMessage::VCal, MessageSubType);
+        }
+        else
+        {
+            //message sub-type
+            item.setData(ConvergedMessage::None, MessageSubType);
         }
-        else if(entry.IsAttributeSet(ECsAttributeLowPriority))
-        {
-            item.setData(ConvergedMessage::Low,MessagePriority);
+        //for BT messages we show filenames for all other (except vcard) messages
+        //get filename and set as body
+        QFileInfo fileinfo(description);
+        QString filename = fileinfo.fileName();
+        item.setData(filename, BodyText);
+    }
+}
+
+//---------------------------------------------------------------
+// ConversationsModel::handleBioMessages
+// @see header
+//---------------------------------------------------------------
+void ConversationsModel::handleBioMessages(QStandardItem& item, const CCsConversationEntry& entry)
+{
+    iBioMsgPlugin->setMessageId(entry.EntryId());
+    int msgSubType = ConversationsEngineUtility::messageSubType(entry.GetType());
+    if (ConvergedMessage::VCard == msgSubType) {
+        if (iBioMsgPlugin->attachmentCount() > 0) {
+            UniMessageInfoList attList = iBioMsgPlugin->attachmentList();
+            QString attachmentPath = attList[0]->path();
+
+            //get display-name and set as bodytext
+            QString displayName = ConversationsEngineUtility::getVcardDisplayName(attachmentPath);
+            item.setData(displayName, BodyText);
+
+            // clear attachement list : its allocated at data model
+            while (!attList.isEmpty()) {
+                delete attList.takeFirst();
+            }
         }
     }
-    else
-    {
-        // sms bodytext
-        item.setData(subject, BodyText);
+    else if (ConvergedMessage::VCal == msgSubType) {
+        //not supported
     }
-
-    //presence
-    //TODO
+    else {
+        // description
+        HBufC* description = entry.Description();
+        QString subject("");
+        if (description && description->Length()) {
+            subject = (S60QConversions::s60DescToQString(*description));
+            item.setData(subject, BodyText);
+        }
     }
+}
 
 //EOF
--- a/messagingapp/msgui/appengine/src/conversationssummarymodel.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/appengine/src/conversationssummarymodel.cpp	Mon May 03 12:29:07 2010 +0300
@@ -20,9 +20,13 @@
 #include "conversationsengineutility.h"
 #include "s60qconversions.h"
 #include "convergedmessage.h"
+#include "unidatamodelloader.h"
+#include "unidatamodelplugininterface.h"
 
 #include <ccsclientconversation.h>
 #include <ccsconversationentry.h>
+#include <QFile>
+#include <QFileInfo>
 
 //---------------------------------------------------------------
 // ConversationsSummaryModel::ConversationsSummaryModel
@@ -80,9 +84,13 @@
         }
         case TimeStamp:
         {
-            value = item->data(TimeStamp);   
+            value = item->data(TimeStamp);
             break;
-            
+        }
+        case SendingState:
+        {
+            value = item->data(SendingState);
+            break;
         }
         case MessageProperty:
         {
@@ -91,12 +99,16 @@
         }
         case MessageType:
         {
-            value = item->data(MessageType);                    
+            value = item->data(MessageType);
+            break;
+        }
+        case MessageSubType:
+        {
+            value = item->data(MessageSubType);
             break;
         }
         case Subject:
         {
-            
             value = item->data(Subject);
             break;
         }
@@ -110,19 +122,9 @@
             value = item->data(ConversationAddress);
             break;
         }
-        case FirstName:
-        {
-            value = item->data(FirstName);
-            break;
-        }
-        case LastName:
+        case DisplayName:
         {
-            value = item->data(LastName);
-            break;
-        }
-        case NickName:
-        {
-            value = item->data(NickName);
+            value = item->data(DisplayName);
             break;
         }
         case Avatar:
@@ -130,6 +132,11 @@
             value = item->data(Avatar);
             break;
         }
+        case Direction:
+        {
+            value = item->data(Direction);
+            break;
+        }
         default:
         {
             //No matching role found, set invalid variant.
@@ -197,24 +204,48 @@
         const CCsClientConversation& conversation)
     {
     //get entry
-    CCsConversationEntry* conEntry = conversation.GetConversationEntry();   
-    
-    // id 
-    item.setData(conversation.GetConversationEntryId(), ConversationId);
-
-    // message details
-    item.setData(conEntry->EntryId(), ConvergedMsgId);
-    item.setData(ConversationsEngineUtility::messageType(conEntry->GetType()), MessageType);
+    CCsConversationEntry* conEntry = conversation.GetConversationEntry(); 
+    //error scenario
+    if(conEntry == NULL)
+        return;
     
-    // description
-    HBufC* body = conEntry->Description();
-    if( body && body->Length())
+    // message details
+    // conversation-id 
+    item.setData(conversation.GetConversationEntryId(), ConversationId);
+    // message-id
+    item.setData(conEntry->EntryId(), ConvergedMsgId);	
+    // send status
+    item.setData(conEntry->GetSendState(),SendingState);
+    // direction
+    item.setData(conEntry->ConversationDir(), Direction);
+    //msg-type
+    int msgType = ConversationsEngineUtility::messageType(conEntry->GetType());
+    item.setData(msgType, MessageType);
+    //message sub-type   
+    item.setData(ConversationsEngineUtility::messageSubType(conEntry->GetType()), MessageSubType);
+
+    //handle BT messages, needs to be revisited again, once vcal/vcard over BT issue is fixed
+    if(ConvergedMessage::BT == msgType)
+    {
+        handleBlueToothMessages(item, *conEntry);
+    }
+    else if(msgType == ConvergedMessage::BioMsg)
+    {
+        handleBioMessages(item, *conEntry);
+    }
+    else
+    {       
+        // description
+        HBufC* body = conEntry->Description();
+        if( body && body->Length())
         {     
-        QString bodytext(S60QConversions::s60DescToQString(*body));
-        item.setData(bodytext, BodyText); 
-        item.setData(bodytext, Subject );
+            QString bodytext(S60QConversions::s60DescToQString(*body));
+            item.setData(bodytext, BodyText); 
+            item.setData(bodytext, Subject );
         }
+    }
 
+    
     // time stamp
     TTime unixEpoch(KUnixEpoch);
     TTimeIntervalSeconds seconds;
@@ -226,27 +257,15 @@
     item.setData(conversation.GetUnreadMessageCount(), UnreadCount);
 
     // contact details
-    HBufC* firstname = conversation.GetFirstName(); 
+    HBufC* disName = conversation.GetDisplayName(); 
     QString displayName("");
-    //first name
-    if(firstname && firstname->Length())
+    //display name
+    if(disName && disName->Length())
         {
-    displayName = S60QConversions::s60DescToQString(*firstname);
-    item.setData(displayName,FirstName); 
+        displayName = S60QConversions::s60DescToQString(*disName);
+        item.setData(displayName,DisplayName); 
         }
-    //last name
-    HBufC* lastname = conversation.GetLastName();
-    if( lastname &&  lastname->Length())
-        {          
-    item.setData(S60QConversions::s60DescToQString(*lastname),LastName);
-        }
-    //nick name
-    HBufC* nickname = conversation.GetNickName();
-    if (nickname && nickname->Length())
-    {
-        item.setData(S60QConversions::s60DescToQString(*nickname), NickName);
-    }
-
+    
     // contact number
     HBufC* contactno = conEntry->Contact();
     QString contactNumber("");
@@ -264,4 +283,86 @@
     item.setData(conEntry->IsAttributeSet(ECsAttributeUnread),UnReadStatus);      
     }
 
+
+//---------------------------------------------------------------
+// ConversationsModel::handleBlueToothMessages
+// @see header
+//---------------------------------------------------------------
+void ConversationsSummaryModel::handleBlueToothMessages(QStandardItem& item,
+    const CCsConversationEntry& entry)
+{
+    //TODO, needs to be revisited again, once BT team provides the solution for
+    //BT received as Biomsg issue.
+    QString description = S60QConversions::s60DescToQString(*(entry.Description()));
+
+    if (description.contains(".vcf") || description.contains(".ics")) // "vCard"
+    {
+        //message sub-type
+        item.setData(ConvergedMessage::VCard, MessageSubType);
+
+        //parse vcf file to get the details
+        QString displayName = ConversationsEngineUtility::getVcardDisplayName(description);
+        item.setData(displayName, BodyText);
+    }
+    else 
+    {
+        if (description.contains(".vcs")) // "vCalendar"
+        {
+            //message sub-type
+            item.setData(ConvergedMessage::VCal, MessageSubType);
+        }
+        else
+        {
+            //message sub-type
+            item.setData(ConvergedMessage::None, MessageSubType);
+        }
+        //for BT messages we show filenames for all other (except vcard) messages
+        //get filename and set as body
+        QFileInfo fileinfo(description);
+        QString filename = fileinfo.fileName();
+        item.setData(filename, BodyText);
+    }
+}
+
+//---------------------------------------------------------------
+// ConversationsSummaryModel::handleBioMessages
+// @see header
+//---------------------------------------------------------------
+void ConversationsSummaryModel::handleBioMessages(QStandardItem& item, const CCsConversationEntry& entry)
+{
+    UniDataModelLoader* pluginLoader = new UniDataModelLoader;
+    UniDataModelPluginInterface* bioMsgPlugin = pluginLoader->getDataModelPlugin(ConvergedMessage::BioMsg);
+    bioMsgPlugin->setMessageId(entry.EntryId());
+    
+    int msgSubType = ConversationsEngineUtility::messageSubType(entry.GetType());
+    if (ConvergedMessage::VCard == msgSubType) {
+        if (bioMsgPlugin->attachmentCount() > 0) {
+            UniMessageInfoList attList = bioMsgPlugin->attachmentList();
+            QString attachmentPath = attList[0]->path();
+
+            //get display-name and set as bodytext
+            QString displayName = ConversationsEngineUtility::getVcardDisplayName(attachmentPath);
+            item.setData(displayName, BodyText);
+
+            // clear attachement list : its allocated at data model
+            while (!attList.isEmpty()) {
+                delete attList.takeFirst();
+            }
+        }
+    }
+    else if (ConvergedMessage::VCal == msgSubType) {
+        //not supported
+    }
+    else {
+        // description
+        HBufC* description = entry.Description();
+        QString subject("");
+        if (description && description->Length()) {
+            subject = (S60QConversions::s60DescToQString(*description));
+            item.setData(subject, BodyText);
+        }
+    }
+    
+    delete pluginLoader;
+}
 // EOF
--- a/messagingapp/msgui/appengine/src/draftsmodel.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/appengine/src/draftsmodel.cpp	Mon May 03 12:29:07 2010 +0300
@@ -76,7 +76,7 @@
             dateString = dateTime.toString(DATE_FORMAT);
         }
         //display name
-        QString contactName = item->data(NickName).toString();
+        QString contactName = item->data(DisplayName).toString();
         if (contactName.isEmpty()) {
             contactName = tr("(no recipient)");
         }
@@ -131,9 +131,9 @@
         value = item->data(Subject);
         break;
     }
-    case NickName:
+    case DisplayName:
     {
-        value = item->data(NickName);
+        value = item->data(DisplayName);
         break;
     }
     case MessageProperty:
@@ -235,7 +235,7 @@
 
     // contact details
     QString contact(S60QConversions::s60DescToQString(entry.iDetails));
-    item.setData(contact, NickName);
+    item.setData(contact, DisplayName);
     
     // Attachments
     if (entry.Attachment()) {
--- a/messagingapp/msgui/bwins/appengineu.def	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/bwins/appengineu.def	Mon May 03 12:29:07 2010 +0300
@@ -1,35 +1,40 @@
 EXPORTS
 	?fetchMoreConversations@ConversationsEngine@@QAEXXZ @ 1 NONAME ; void ConversationsEngine::fetchMoreConversations(void)
-	?getContactDetails@ConversationsEngine@@QAEX_JAAVQString@@11@Z @ 2 NONAME ; void ConversationsEngine::getContactDetails(long long, class QString &, class QString &, class QString &)
-	?getConversationIdFromAddress@ConversationsEngine@@QAE_JVQString@@@Z @ 3 NONAME ; long long ConversationsEngine::getConversationIdFromAddress(class QString)
+	?getConversationIdFromAddress@ConversationsEngine@@QAE_JVQString@@@Z @ 2 NONAME ; long long ConversationsEngine::getConversationIdFromAddress(class QString)
+	?deleteAllDraftMessages@ConversationsEngine@@QAEXXZ @ 3 NONAME ; void ConversationsEngine::deleteAllDraftMessages(void)
 	?metaObject@ConversationsEngine@@UBEPBUQMetaObject@@XZ @ 4 NONAME ; struct QMetaObject const * ConversationsEngine::metaObject(void) const
 	??1ConversationsEngine@@UAE@XZ @ 5 NONAME ; ConversationsEngine::~ConversationsEngine(void)
-	?markConversationRead@ConversationsEngine@@QAE_N_J@Z @ 6 NONAME ; bool ConversationsEngine::markConversationRead(long long)
-	?getCurrentConversationId@ConversationsEngine@@QAE_JXZ @ 7 NONAME ; long long ConversationsEngine::getCurrentConversationId(void)
-	??_EConversationsEngine@@UAE@I@Z @ 8 NONAME ; ConversationsEngine::~ConversationsEngine(unsigned int)
-	?deleteConversations@ConversationsEngine@@QAE_N_J@Z @ 9 NONAME ; bool ConversationsEngine::deleteConversations(long long)
-	?getConversationsSummaryModel@ConversationsEngine@@QAEPAVQStandardItemModel@@XZ @ 10 NONAME ; class QStandardItemModel * ConversationsEngine::getConversationsSummaryModel(void)
-	?trUtf8@ConversationsEngine@@SA?AVQString@@PBD0@Z @ 11 NONAME ; class QString ConversationsEngine::trUtf8(char const *, char const *)
-	?qt_metacast@ConversationsEngine@@UAEPAXPBD@Z @ 12 NONAME ; void * ConversationsEngine::qt_metacast(char const *)
-	?emitConversationListModelPopulated@ConversationsEngine@@QAEXXZ @ 13 NONAME ; void ConversationsEngine::emitConversationListModelPopulated(void)
-	?conversationListModelPopulated@ConversationsEngine@@IAEXXZ @ 14 NONAME ; void ConversationsEngine::conversationListModelPopulated(void)
-	?getDraftsModel@ConversationsEngine@@QAEPAVQStandardItemModel@@XZ @ 15 NONAME ; class QStandardItemModel * ConversationsEngine::getDraftsModel(void)
-	??0ConversationsEngine@@AAE@PAVQObject@@@Z @ 16 NONAME ; ConversationsEngine::ConversationsEngine(class QObject *)
-	?trUtf8@ConversationsEngine@@SA?AVQString@@PBD0H@Z @ 17 NONAME ; class QString ConversationsEngine::trUtf8(char const *, char const *, int)
-	?tr@ConversationsEngine@@SA?AVQString@@PBD0H@Z @ 18 NONAME ; class QString ConversationsEngine::tr(char const *, char const *, int)
-	?conversationModelUpdated@ConversationsEngine@@IAEXXZ @ 19 NONAME ; void ConversationsEngine::conversationModelUpdated(void)
-	?instance@ConversationsEngine@@SAPAV1@XZ @ 20 NONAME ; class ConversationsEngine * ConversationsEngine::instance(void)
-	?tr@ConversationsEngine@@SA?AVQString@@PBD0@Z @ 21 NONAME ; class QString ConversationsEngine::tr(char const *, char const *)
-	?getStaticMetaObject@ConversationsEngine@@SAABUQMetaObject@@XZ @ 22 NONAME ; struct QMetaObject const & ConversationsEngine::getStaticMetaObject(void)
-	?getConversations@ConversationsEngine@@QAE_N_J@Z @ 23 NONAME ; bool ConversationsEngine::getConversations(long long)
-	?emitConversationModelUpdated@ConversationsEngine@@QAEXXZ @ 24 NONAME ; void ConversationsEngine::emitConversationModelUpdated(void)
-	?clearConversations@ConversationsEngine@@QAE_NXZ @ 25 NONAME ; bool ConversationsEngine::clearConversations(void)
-	?markMessagesRead@ConversationsEngine@@QAE_NAAV?$QList@H@@@Z @ 26 NONAME ; bool ConversationsEngine::markMessagesRead(class QList<int> &)
-	?conversationModelPopulated@ConversationsEngine@@IAEXXZ @ 27 NONAME ; void ConversationsEngine::conversationModelPopulated(void)
-	?getConversationIdFromContactId@ConversationsEngine@@QAE_JH@Z @ 28 NONAME ; long long ConversationsEngine::getConversationIdFromContactId(int)
-	?staticMetaObject@ConversationsEngine@@2UQMetaObject@@B @ 29 NONAME ; struct QMetaObject const ConversationsEngine::staticMetaObject
-	?deleteMessages@ConversationsEngine@@QAEXAAV?$QList@H@@@Z @ 30 NONAME ; void ConversationsEngine::deleteMessages(class QList<int> &)
-	?getConversationsModel@ConversationsEngine@@QAEPAVQStandardItemModel@@XZ @ 31 NONAME ; class QStandardItemModel * ConversationsEngine::getConversationsModel(void)
-	?emitConversationModelPopulated@ConversationsEngine@@QAEXXZ @ 32 NONAME ; void ConversationsEngine::emitConversationModelPopulated(void)
-	?qt_metacall@ConversationsEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 33 NONAME ; int ConversationsEngine::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?markAsReadAndGetType@ConversationsEngine@@QAEXHAAH0@Z @ 6 NONAME ; void ConversationsEngine::markAsReadAndGetType(int, int &, int &)
+	?deleteConversations@ConversationsEngine@@QAE_N_J@Z @ 7 NONAME ; bool ConversationsEngine::deleteConversations(long long)
+	?trUtf8@ConversationsEngine@@SA?AVQString@@PBD0@Z @ 8 NONAME ; class QString ConversationsEngine::trUtf8(char const *, char const *)
+	?qt_metacast@ConversationsEngine@@UAEPAXPBD@Z @ 9 NONAME ; void * ConversationsEngine::qt_metacast(char const *)
+	?emitConversationListModelPopulated@ConversationsEngine@@QAEXXZ @ 10 NONAME ; void ConversationsEngine::emitConversationListModelPopulated(void)
+	?getDraftsModel@ConversationsEngine@@QAEPAVQStandardItemModel@@XZ @ 11 NONAME ; class QStandardItemModel * ConversationsEngine::getDraftsModel(void)
+	?trUtf8@ConversationsEngine@@SA?AVQString@@PBD0H@Z @ 12 NONAME ; class QString ConversationsEngine::trUtf8(char const *, char const *, int)
+	?tr@ConversationsEngine@@SA?AVQString@@PBD0H@Z @ 13 NONAME ; class QString ConversationsEngine::tr(char const *, char const *, int)
+	?conversationModelUpdated@ConversationsEngine@@IAEXXZ @ 14 NONAME ; void ConversationsEngine::conversationModelUpdated(void)
+	?getStaticMetaObject@ConversationsEngine@@SAABUQMetaObject@@XZ @ 15 NONAME ; struct QMetaObject const & ConversationsEngine::getStaticMetaObject(void)
+	?downloadOperationSupported@ConversationsEngine@@QAE_NH@Z @ 16 NONAME ; bool ConversationsEngine::downloadOperationSupported(int)
+	?markMessagesRead@ConversationsEngine@@QAE_NAAV?$QList@H@@@Z @ 17 NONAME ; bool ConversationsEngine::markMessagesRead(class QList<int> &)
+	?conversationModelPopulated@ConversationsEngine@@IAEXXZ @ 18 NONAME ; void ConversationsEngine::conversationModelPopulated(void)
+	?downloadMessage@ConversationsEngine@@QAEHH@Z @ 19 NONAME ; int ConversationsEngine::downloadMessage(int)
+	?getConversationsModel@ConversationsEngine@@QAEPAVQStandardItemModel@@XZ @ 20 NONAME ; class QStandardItemModel * ConversationsEngine::getConversationsModel(void)
+	?getCurrentConversationId@ConversationsEngine@@QAE_JXZ @ 21 NONAME ; long long ConversationsEngine::getCurrentConversationId(void)
+	?markConversationRead@ConversationsEngine@@QAE_N_J@Z @ 22 NONAME ; bool ConversationsEngine::markConversationRead(long long)
+	??_EConversationsEngine@@UAE@I@Z @ 23 NONAME ; ConversationsEngine::~ConversationsEngine(unsigned int)
+	?getConversationsSummaryModel@ConversationsEngine@@QAEPAVQStandardItemModel@@XZ @ 24 NONAME ; class QStandardItemModel * ConversationsEngine::getConversationsSummaryModel(void)
+	?conversationListModelPopulated@ConversationsEngine@@IAEXXZ @ 25 NONAME ; void ConversationsEngine::conversationListModelPopulated(void)
+	??0ConversationsEngine@@AAE@PAVQObject@@@Z @ 26 NONAME ; ConversationsEngine::ConversationsEngine(class QObject *)
+	?getContactDetails@ConversationsEngine@@QAEX_JAAVQString@@1@Z @ 27 NONAME ; void ConversationsEngine::getContactDetails(long long, class QString &, class QString &)
+	?instance@ConversationsEngine@@SAPAV1@XZ @ 28 NONAME ; class ConversationsEngine * ConversationsEngine::instance(void)
+	?tr@ConversationsEngine@@SA?AVQString@@PBD0@Z @ 29 NONAME ; class QString ConversationsEngine::tr(char const *, char const *)
+	?resendMessage@ConversationsEngine@@QAE_NH@Z @ 30 NONAME ; bool ConversationsEngine::resendMessage(int)
+	?emitConversationModelUpdated@ConversationsEngine@@QAEXXZ @ 31 NONAME ; void ConversationsEngine::emitConversationModelUpdated(void)
+	?getConversations@ConversationsEngine@@QAE_N_J@Z @ 32 NONAME ; bool ConversationsEngine::getConversations(long long)
+	?clearConversations@ConversationsEngine@@QAE_NXZ @ 33 NONAME ; bool ConversationsEngine::clearConversations(void)
+	?getConversationIdFromContactId@ConversationsEngine@@QAE_JH@Z @ 34 NONAME ; long long ConversationsEngine::getConversationIdFromContactId(int)
+	?deleteMessages@ConversationsEngine@@QAEXAAV?$QList@H@@@Z @ 35 NONAME ; void ConversationsEngine::deleteMessages(class QList<int> &)
+	?staticMetaObject@ConversationsEngine@@2UQMetaObject@@B @ 36 NONAME ; struct QMetaObject const ConversationsEngine::staticMetaObject
+	?emitConversationModelPopulated@ConversationsEngine@@QAEXXZ @ 37 NONAME ; void ConversationsEngine::emitConversationModelPopulated(void)
+	?qt_metacall@ConversationsEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 38 NONAME ; int ConversationsEngine::qt_metacall(enum QMetaObject::Call, int, void * *)
 
--- a/messagingapp/msgui/bwins/conversationviewu.def	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/bwins/conversationviewu.def	Mon May 03 12:29:07 2010 +0300
@@ -1,22 +1,25 @@
 EXPORTS
-	?saveContentToDrafts@MsgConversationBaseView@@QAE_NXZ @ 1 NONAME ; bool MsgConversationBaseView::saveContentToDrafts(void)
-	?qt_metacast@MsgConversationBaseView@@UAEPAXPBD@Z @ 2 NONAME ; void * MsgConversationBaseView::qt_metacast(char const *)
-	?metaObject@MsgConversationBaseView@@UBEPBUQMetaObject@@XZ @ 3 NONAME ; struct QMetaObject const * MsgConversationBaseView::metaObject(void) const
+	?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
+	?saveContentToDrafts@MsgConversationBaseView@@QAEXXZ @ 3 NONAME ; void MsgConversationBaseView::saveContentToDrafts(void)
 	?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)
-	?tr@MsgConversationBaseView@@SA?AVQString@@PBD0H@Z @ 6 NONAME ; class QString MsgConversationBaseView::tr(char const *, char const *, int)
-	??0MsgConversationBaseView@@QAE@PAVQGraphicsItem@@@Z @ 7 NONAME ; MsgConversationBaseView::MsgConversationBaseView(class QGraphicsItem *)
-	?trUtf8@MsgConversationBaseView@@SA?AVQString@@PBD0@Z @ 8 NONAME ; class QString MsgConversationBaseView::trUtf8(char const *, char const *)
-	?openConversation@MsgConversationBaseView@@QAEX_J@Z @ 9 NONAME ; void MsgConversationBaseView::openConversation(long long)
-	?openContactDetails@MsgConversationBaseView@@AAEXXZ @ 10 NONAME ; void MsgConversationBaseView::openContactDetails(void)
-	?conversationViewClosed@MsgConversationBaseView@@IAEXXZ @ 11 NONAME ; void MsgConversationBaseView::conversationViewClosed(void)
-	?staticMetaObject@MsgConversationBaseView@@2UQMetaObject@@B @ 12 NONAME ; struct QMetaObject const MsgConversationBaseView::staticMetaObject
-	?initView@MsgConversationBaseView@@AAEXXZ @ 13 NONAME ; void MsgConversationBaseView::initView(void)
-	?markMessagesAsRead@MsgConversationBaseView@@QAEXXZ @ 14 NONAME ; void MsgConversationBaseView::markMessagesAsRead(void)
-	?tr@MsgConversationBaseView@@SA?AVQString@@PBD0@Z @ 15 NONAME ; class QString MsgConversationBaseView::tr(char const *, char const *)
-	?getStaticMetaObject@MsgConversationBaseView@@SAABUQMetaObject@@XZ @ 16 NONAME ; struct QMetaObject const & MsgConversationBaseView::getStaticMetaObject(void)
-	?qt_metacall@MsgConversationBaseView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 17 NONAME ; int MsgConversationBaseView::qt_metacall(enum QMetaObject::Call, int, void * *)
-	??1MsgConversationBaseView@@UAE@XZ @ 18 NONAME ; MsgConversationBaseView::~MsgConversationBaseView(void)
-	??_EMsgConversationBaseView@@UAE@I@Z @ 19 NONAME ; MsgConversationBaseView::~MsgConversationBaseView(unsigned int)
-	?clearContent@MsgConversationBaseView@@QAEXXZ @ 20 NONAME ; void MsgConversationBaseView::clearContent(void)
+	?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 *)
+	?doDelayedConstruction@MsgConversationBaseView@@AAEXXZ @ 12 NONAME ; void MsgConversationBaseView::doDelayedConstruction(void)
+	?openConversation@MsgConversationBaseView@@QAEX_J@Z @ 13 NONAME ; void MsgConversationBaseView::openConversation(long long)
+	?conversationViewClosed@MsgConversationBaseView@@IAEXXZ @ 14 NONAME ; void MsgConversationBaseView::conversationViewClosed(void)
+	?staticMetaObject@MsgConversationBaseView@@2UQMetaObject@@B @ 15 NONAME ; struct QMetaObject const MsgConversationBaseView::staticMetaObject
+	?initView@MsgConversationBaseView@@AAEXXZ @ 16 NONAME ; void MsgConversationBaseView::initView(void)
+	?markMessagesAsRead@MsgConversationBaseView@@QAEXXZ @ 17 NONAME ; void MsgConversationBaseView::markMessagesAsRead(void)
+	?tr@MsgConversationBaseView@@SA?AVQString@@PBD0@Z @ 18 NONAME ; class QString MsgConversationBaseView::tr(char const *, char const *)
+	?getStaticMetaObject@MsgConversationBaseView@@SAABUQMetaObject@@XZ @ 19 NONAME ; struct QMetaObject const & MsgConversationBaseView::getStaticMetaObject(void)
+	?qt_metacall@MsgConversationBaseView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 20 NONAME ; int MsgConversationBaseView::qt_metacall(enum QMetaObject::Call, int, void * *)
+	??1MsgConversationBaseView@@UAE@XZ @ 21 NONAME ; MsgConversationBaseView::~MsgConversationBaseView(void)
+	??_EMsgConversationBaseView@@UAE@I@Z @ 22 NONAME ; MsgConversationBaseView::~MsgConversationBaseView(unsigned int)
+	?clearContent@MsgConversationBaseView@@QAEXXZ @ 23 NONAME ; void MsgConversationBaseView::clearContent(void)
 
--- a/messagingapp/msgui/bwins/msguiutilsu.def	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/bwins/msguiutilsu.def	Mon May 03 12:29:07 2010 +0300
@@ -1,29 +1,33 @@
 EXPORTS
-	?fetchContacts@MsgUiUtilsManager@@QAEXXZ @ 1 NONAME ; void MsgUiUtilsManager::fetchContacts(void)
-	?activateInputBlocker@MsgUiUtilsManager@@QAEXPAVQGraphicsWidget@@@Z @ 2 NONAME ; void MsgUiUtilsManager::activateInputBlocker(class QGraphicsWidget *)
-	?saveToDrafts@MsgUiUtilsManager@@QAEJAAVConvergedMessage@@@Z @ 3 NONAME ; long MsgUiUtilsManager::saveToDrafts(class ConvergedMessage &)
-	?fetchVideo@MsgUiUtilsManager@@QAEXXZ @ 4 NONAME ; void MsgUiUtilsManager::fetchVideo(void)
-	??0MsgUiUtilsManager@@QAE@PAVQObject@@@Z @ 5 NONAME ; MsgUiUtilsManager::MsgUiUtilsManager(class QObject *)
-	?metaObject@MsgUiUtilsManager@@UBEPBUQMetaObject@@XZ @ 6 NONAME ; struct QMetaObject const * MsgUiUtilsManager::metaObject(void) const
-	?send@MsgUiUtilsManager@@QAEHAAVConvergedMessage@@@Z @ 7 NONAME ; int MsgUiUtilsManager::send(class ConvergedMessage &)
-	??_EMsgUiUtilsManager@@UAE@I@Z @ 8 NONAME ; MsgUiUtilsManager::~MsgUiUtilsManager(unsigned int)
-	?matchDigits@MatchPhNumberUtil@@SAHXZ @ 9 NONAME ; int MatchPhNumberUtil::matchDigits(void)
-	?audiosFetched@MsgUiUtilsManager@@IAEXABVQVariant@@@Z @ 10 NONAME ; void MsgUiUtilsManager::audiosFetched(class QVariant const &)
-	?openContactDetails@MsgUiUtilsManager@@QAEXH@Z @ 11 NONAME ; void MsgUiUtilsManager::openContactDetails(int)
-	?staticMetaObject@MsgUiUtilsManager@@2UQMetaObject@@B @ 12 NONAME ; struct QMetaObject const MsgUiUtilsManager::staticMetaObject
-	?fetchImages@MsgUiUtilsManager@@QAEXXZ @ 13 NONAME ; void MsgUiUtilsManager::fetchImages(void)
-	?contactsFetched@MsgUiUtilsManager@@IAEXABVQVariant@@@Z @ 14 NONAME ; void MsgUiUtilsManager::contactsFetched(class QVariant const &)
-	?trUtf8@MsgUiUtilsManager@@SA?AVQString@@PBD0H@Z @ 15 NONAME ; class QString MsgUiUtilsManager::trUtf8(char const *, char const *, int)
-	?fetchAudio@MsgUiUtilsManager@@QAEXXZ @ 16 NONAME ; void MsgUiUtilsManager::fetchAudio(void)
-	?tr@MsgUiUtilsManager@@SA?AVQString@@PBD0@Z @ 17 NONAME ; class QString MsgUiUtilsManager::tr(char const *, char const *)
-	?getStaticMetaObject@MsgUiUtilsManager@@SAABUQMetaObject@@XZ @ 18 NONAME ; struct QMetaObject const & MsgUiUtilsManager::getStaticMetaObject(void)
-	?imagesFetched@MsgUiUtilsManager@@IAEXABVQVariant@@@Z @ 19 NONAME ; void MsgUiUtilsManager::imagesFetched(class QVariant const &)
-	?qt_metacast@MsgUiUtilsManager@@UAEPAXPBD@Z @ 20 NONAME ; void * MsgUiUtilsManager::qt_metacast(char const *)
-	?fetchOther@MsgUiUtilsManager@@QAEXXZ @ 21 NONAME ; void MsgUiUtilsManager::fetchOther(void)
-	?serviceError@MsgUiUtilsManager@@IAEXABVQString@@@Z @ 22 NONAME ; void MsgUiUtilsManager::serviceError(class QString const &)
-	?deactivateInputBlocker@MsgUiUtilsManager@@QAEXXZ @ 23 NONAME ; void MsgUiUtilsManager::deactivateInputBlocker(void)
-	?qt_metacall@MsgUiUtilsManager@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 24 NONAME ; int MsgUiUtilsManager::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?tr@MsgUiUtilsManager@@SA?AVQString@@PBD0H@Z @ 25 NONAME ; class QString MsgUiUtilsManager::tr(char const *, char const *, int)
-	??1MsgUiUtilsManager@@UAE@XZ @ 26 NONAME ; MsgUiUtilsManager::~MsgUiUtilsManager(void)
-	?trUtf8@MsgUiUtilsManager@@SA?AVQString@@PBD0@Z @ 27 NONAME ; class QString MsgUiUtilsManager::trUtf8(char const *, char const *)
+	?checkEmailOverSms@MsgSendUtil@@AAE_NAAVConvergedMessage@@AA_N@Z @ 1 NONAME ; bool MsgSendUtil::checkEmailOverSms(class ConvergedMessage &, bool &)
+	?getMmsMsgSize@MsgSendUtil@@AAEHAAVConvergedMessage@@@Z @ 2 NONAME ; int MsgSendUtil::getMmsMsgSize(class ConvergedMessage &)
+	?checkModeForInsert@MmsConformanceCheck@@QAEHABVQString@@_N@Z @ 3 NONAME ; int MmsConformanceCheck::checkModeForInsert(class QString const &, bool)
+	?mediaDurationL@MsgMediaUtil@@AAEHABVTDesC16@@@Z @ 4 NONAME ; int MsgMediaUtil::mediaDurationL(class TDesC16 const &)
+	??0MsgMediaUtil@@QAE@XZ @ 5 NONAME ; MsgMediaUtil::MsgMediaUtil(void)
+	?qt_metacast@MsgSendUtil@@UAEPAXPBD@Z @ 6 NONAME ; void * MsgSendUtil::qt_metacast(char const *)
+	?validateService@MsgSendUtil@@AAE_NPAVUniEditorPluginInterface@@_N@Z @ 7 NONAME ; bool MsgSendUtil::validateService(class UniEditorPluginInterface *, bool)
+	?showPopup@MmsConformanceCheck@@AAEXABVQString@@@Z @ 8 NONAME ; void MmsConformanceCheck::showPopup(class QString const &)
+	?launchEditorQuery@MmsConformanceCheck@@AAE_NXZ @ 9 NONAME ; bool MmsConformanceCheck::launchEditorQuery(void)
+	??1MmsConformanceCheck@@QAE@XZ @ 10 NONAME ; MmsConformanceCheck::~MmsConformanceCheck(void)
+	??0MsgSendUtil@@QAE@PAVQObject@@@Z @ 11 NONAME ; MsgSendUtil::MsgSendUtil(class QObject *)
+	?metaObject@MsgSendUtil@@UBEPBUQMetaObject@@XZ @ 12 NONAME ; struct QMetaObject const * MsgSendUtil::metaObject(void) const
+	?longestEmailAddressSize@MsgSendUtil@@AAEHV?$QList@PAVConvergedMessageAddress@@@@@Z @ 13 NONAME ; int MsgSendUtil::longestEmailAddressSize(class QList<class ConvergedMessageAddress *>)
+	??_EMsgSendUtil@@UAE@I@Z @ 14 NONAME ; MsgSendUtil::~MsgSendUtil(unsigned int)
+	?staticMetaObject@MsgSendUtil@@2UQMetaObject@@B @ 15 NONAME ; struct QMetaObject const MsgSendUtil::staticMetaObject
+	??0MmsConformanceCheck@@QAE@XZ @ 16 NONAME ; MmsConformanceCheck::MmsConformanceCheck(void)
+	?tr@MsgSendUtil@@SA?AVQString@@PBD0@Z @ 17 NONAME ; class QString MsgSendUtil::tr(char const *, char const *)
+	?saveToDrafts@MsgSendUtil@@QAEJAAVConvergedMessage@@@Z @ 18 NONAME ; long MsgSendUtil::saveToDrafts(class ConvergedMessage &)
+	?trUtf8@MsgSendUtil@@SA?AVQString@@PBD0@Z @ 19 NONAME ; class QString MsgSendUtil::trUtf8(char const *, char const *)
+	?getStaticMetaObject@MsgSendUtil@@SAABUQMetaObject@@XZ @ 20 NONAME ; struct QMetaObject const & MsgSendUtil::getStaticMetaObject(void)
+	?getSmsMsgSize@MsgSendUtil@@AAEHAAVConvergedMessage@@@Z @ 21 NONAME ; int MsgSendUtil::getSmsMsgSize(class ConvergedMessage &)
+	?tr@MsgSendUtil@@SA?AVQString@@PBD0H@Z @ 22 NONAME ; class QString MsgSendUtil::tr(char const *, char const *, int)
+	?mediaDuration@MsgMediaUtil@@QAE?AVQString@@ABV2@@Z @ 23 NONAME ; class QString MsgMediaUtil::mediaDuration(class QString const &)
+	?validateMsgForForward@MmsConformanceCheck@@QAE_NH@Z @ 24 NONAME ; bool MmsConformanceCheck::validateMsgForForward(int)
+	?checkMaxMsgSizeLimit@MsgSendUtil@@AAE_NAAVConvergedMessage@@@Z @ 25 NONAME ; bool MsgSendUtil::checkMaxMsgSizeLimit(class ConvergedMessage &)
+	??1MsgSendUtil@@UAE@XZ @ 26 NONAME ; MsgSendUtil::~MsgSendUtil(void)
+	?qt_metacall@MsgSendUtil@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 27 NONAME ; int MsgSendUtil::qt_metacall(enum QMetaObject::Call, int, void * *)
+	??1MsgMediaUtil@@QAE@XZ @ 28 NONAME ; MsgMediaUtil::~MsgMediaUtil(void)
+	?send@MsgSendUtil@@QAEHAAVConvergedMessage@@@Z @ 29 NONAME ; int MsgSendUtil::send(class ConvergedMessage &)
+	?trUtf8@MsgSendUtil@@SA?AVQString@@PBD0H@Z @ 30 NONAME ; class QString MsgSendUtil::trUtf8(char const *, char const *, int)
+	?checkMaxRecipientCount@MsgSendUtil@@AAE_NAAVConvergedMessage@@@Z @ 31 NONAME ; bool MsgSendUtil::checkMaxRecipientCount(class ConvergedMessage &)
 
--- a/messagingapp/msgui/bwins/unifiededitoru.def	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/bwins/unifiededitoru.def	Mon May 03 12:29:07 2010 +0300
@@ -1,42 +1,52 @@
 EXPORTS
-	??0CUniImageProcessor@@QAE@PAVMUniImageProcessorCallback@@@Z @ 1 NONAME ; CUniImageProcessor::CUniImageProcessor(class MUniImageProcessorCallback *)
-	?changePriority@MsgUnifiedEditorView@@AAEXXZ @ 2 NONAME ; void MsgUnifiedEditorView::changePriority(void)
-	?populateDraftsContent@MsgUnifiedEditorView@@AAEXABVConvergedMessage@@@Z @ 3 NONAME ; void MsgUnifiedEditorView::populateDraftsContent(class ConvergedMessage const &)
-	?openDraftsMessage@MsgUnifiedEditorView@@QAEXAAVConvergedMessageId@@W4MessageType@ConvergedMessage@@@Z @ 4 NONAME ; void MsgUnifiedEditorView::openDraftsMessage(class ConvergedMessageId &, enum ConvergedMessage::MessageType)
+	?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)
+	?forwardMessage@MsgUnifiedEditorView@@AAEXAAVConvergedMessageId@@W4MessageType@ConvergedMessage@@@Z @ 4 NONAME ; void MsgUnifiedEditorView::forwardMessage(class ConvergedMessageId &, enum ConvergedMessage::MessageType)
 	?updateOtherRecipientCount@MsgUnifiedEditorView@@AAEX_N@Z @ 5 NONAME ; void MsgUnifiedEditorView::updateOtherRecipientCount(bool)
 	?qt_metacall@MsgUnifiedEditorView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 6 NONAME ; int MsgUnifiedEditorView::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?sendingOptions@MsgUnifiedEditorView@@AAEXXZ @ 7 NONAME ; void MsgUnifiedEditorView::sendingOptions(void)
-	?launchHelp@MsgUnifiedEditorView@@AAEXXZ @ 8 NONAME ; void MsgUnifiedEditorView::launchHelp(void)
-	?staticMetaObject@MsgUnifiedEditorView@@2UQMetaObject@@B @ 9 NONAME ; struct QMetaObject const MsgUnifiedEditorView::staticMetaObject
-	?resizeEvent@MsgUnifiedEditorView@@MAEXPAVQGraphicsSceneResizeEvent@@@Z @ 10 NONAME ; void MsgUnifiedEditorView::resizeEvent(class QGraphicsSceneResizeEvent *)
-	?ScaleImageL@CUniImageProcessor@@QAEXPAVCFbsBitmap@@0H@Z @ 11 NONAME ; void CUniImageProcessor::ScaleImageL(class CFbsBitmap *, class CFbsBitmap *, int)
-	?addCcBcc@MsgUnifiedEditorView@@AAEXXZ @ 12 NONAME ; void MsgUnifiedEditorView::addCcBcc(void)
-	?ProcessImageL@CUniImageProcessor@@QAEXAAVRFile@@0AAVTSize@@ABVTDesC8@@HH@Z @ 13 NONAME ; void CUniImageProcessor::ProcessImageL(class RFile &, class RFile &, class TSize &, class TDesC8 const &, int, int)
-	?audiosFetched@MsgUnifiedEditorView@@AAEXABVQVariant@@@Z @ 14 NONAME ; void MsgUnifiedEditorView::audiosFetched(class QVariant const &)
-	?metaObject@MsgUnifiedEditorView@@UBEPBUQMetaObject@@XZ @ 15 NONAME ; struct QMetaObject const * MsgUnifiedEditorView::metaObject(void) const
-	?saveContentToDrafts@MsgUnifiedEditorView@@QAE_NXZ @ 16 NONAME ; bool MsgUnifiedEditorView::saveContentToDrafts(void)
-	?addSubject@MsgUnifiedEditorView@@AAEXXZ @ 17 NONAME ; void MsgUnifiedEditorView::addSubject(void)
-	?imagesFetched@MsgUnifiedEditorView@@AAEXABVQVariant@@@Z @ 18 NONAME ; void MsgUnifiedEditorView::imagesFetched(class QVariant const &)
-	?qt_metacast@MsgUnifiedEditorView@@UAEPAXPBD@Z @ 19 NONAME ; void * MsgUnifiedEditorView::qt_metacast(char const *)
-	?ScaleImageL@CUniImageProcessor@@QAEXAAVRFile@@AAPAVCFbsBitmap@@1AAVTSize@@H@Z @ 20 NONAME ; void CUniImageProcessor::ScaleImageL(class RFile &, class CFbsBitmap * &, class CFbsBitmap * &, class TSize &, int)
-	?addMenu@MsgUnifiedEditorView@@AAEXXZ @ 21 NONAME ; void MsgUnifiedEditorView::addMenu(void)
-	??_EMsgUnifiedEditorView@@UAE@I@Z @ 22 NONAME ; MsgUnifiedEditorView::~MsgUnifiedEditorView(unsigned int)
-	??1MsgUnifiedEditorView@@UAE@XZ @ 23 NONAME ; MsgUnifiedEditorView::~MsgUnifiedEditorView(void)
-	?packMessage@MsgUnifiedEditorView@@AAEXAAVConvergedMessage@@@Z @ 24 NONAME ; void MsgUnifiedEditorView::packMessage(class ConvergedMessage &)
-	?trUtf8@MsgUnifiedEditorView@@SA?AVQString@@PBD0@Z @ 25 NONAME ; class QString MsgUnifiedEditorView::trUtf8(char const *, char const *)
-	?tr@MsgUnifiedEditorView@@SA?AVQString@@PBD0@Z @ 26 NONAME ; class QString MsgUnifiedEditorView::tr(char const *, char const *)
-	?ScaleImageL@CUniImageProcessor@@QAEXPAVCFbsBitmap@@AAVRFile@@ABVTSize@@ABVTDesC8@@H@Z @ 27 NONAME ; void CUniImageProcessor::ScaleImageL(class CFbsBitmap *, class RFile &, class TSize const &, class TDesC8 const &, int)
-	?getStaticMetaObject@MsgUnifiedEditorView@@SAABUQMetaObject@@XZ @ 28 NONAME ; struct QMetaObject const & MsgUnifiedEditorView::getStaticMetaObject(void)
-	?tr@MsgUnifiedEditorView@@SA?AVQString@@PBD0H@Z @ 29 NONAME ; class QString MsgUnifiedEditorView::tr(char const *, char const *, int)
-	?send@MsgUnifiedEditorView@@AAEXXZ @ 30 NONAME ; void MsgUnifiedEditorView::send(void)
-	?Reset@CUniImageProcessor@@QAEXXZ @ 31 NONAME ; void CUniImageProcessor::Reset(void)
-	?addToolBar@MsgUnifiedEditorView@@AAEXXZ @ 32 NONAME ; void MsgUnifiedEditorView::addToolBar(void)
-	?removeAttachmentContainer@MsgUnifiedEditorView@@AAEXXZ @ 33 NONAME ; void MsgUnifiedEditorView::removeAttachmentContainer(void)
-	?pluginPath@MsgUnifiedEditorView@@AAE?AVQString@@XZ @ 34 NONAME ; class QString MsgUnifiedEditorView::pluginPath(void)
-	?trUtf8@MsgUnifiedEditorView@@SA?AVQString@@PBD0H@Z @ 35 NONAME ; class QString MsgUnifiedEditorView::trUtf8(char const *, char const *, int)
-	??0MsgUnifiedEditorView@@QAE@PAVQGraphicsItem@@@Z @ 36 NONAME ; MsgUnifiedEditorView::MsgUnifiedEditorView(class QGraphicsItem *)
-	?populateContent@MsgUnifiedEditorView@@QAEXABVConvergedMessage@@H@Z @ 37 NONAME ; void MsgUnifiedEditorView::populateContent(class ConvergedMessage const &, int)
-	?showAttachmentPopup@MsgUnifiedEditorView@@AAEXXZ @ 38 NONAME ; void MsgUnifiedEditorView::showAttachmentPopup(void)
-	?deleteMessage@MsgUnifiedEditorView@@AAEXXZ @ 39 NONAME ; void MsgUnifiedEditorView::deleteMessage(void)
-	?addAttachment@MsgUnifiedEditorView@@AAEXABVQString@@@Z @ 40 NONAME ; void MsgUnifiedEditorView::addAttachment(class QString const &)
+	?fetchImages@MsgUnifiedEditorView@@AAEXXZ @ 7 NONAME ; void MsgUnifiedEditorView::fetchImages(void)
+	?handleViewExtnActivated@MsgUnifiedEditorView@@AAEXPAVHbListWidgetItem@@@Z @ 8 NONAME ; void MsgUnifiedEditorView::handleViewExtnActivated(class HbListWidgetItem *)
+	?sendingOptions@MsgUnifiedEditorView@@AAEXXZ @ 9 NONAME ; void MsgUnifiedEditorView::sendingOptions(void)
+	?saveContentToDrafts@MsgUnifiedEditorView@@QAEXXZ @ 10 NONAME ; void MsgUnifiedEditorView::saveContentToDrafts(void)
+	?addAttachment@MsgUnifiedEditorView@@AAEHABVQString@@@Z @ 11 NONAME ; int MsgUnifiedEditorView::addAttachment(class QString const &)
+	?staticMetaObject@MsgUnifiedEditorView@@2UQMetaObject@@B @ 12 NONAME ; struct QMetaObject const MsgUnifiedEditorView::staticMetaObject
+	?activateInputBlocker@MsgUnifiedEditorView@@AAEXXZ @ 13 NONAME ; void MsgUnifiedEditorView::activateInputBlocker(void)
+	?resizeEvent@MsgUnifiedEditorView@@MAEXPAVQGraphicsSceneResizeEvent@@@Z @ 14 NONAME ; void MsgUnifiedEditorView::resizeEvent(class QGraphicsSceneResizeEvent *)
+	?ScaleImageL@CUniImageProcessor@@QAEXPAVCFbsBitmap@@0H@Z @ 15 NONAME ; void CUniImageProcessor::ScaleImageL(class CFbsBitmap *, class CFbsBitmap *, int)
+	?populateContent@MsgUnifiedEditorView@@QAEXABV?$QList@VQVariant@@@@@Z @ 16 NONAME ; void MsgUnifiedEditorView::populateContent(class QList<class QVariant> const &)
+	?addCcBcc@MsgUnifiedEditorView@@AAEXXZ @ 17 NONAME ; void MsgUnifiedEditorView::addCcBcc(void)
+	?ProcessImageL@CUniImageProcessor@@QAEXAAVRFile@@0AAVTSize@@ABVTDesC8@@HH@Z @ 18 NONAME ; void CUniImageProcessor::ProcessImageL(class RFile &, class RFile &, class TSize &, class TDesC8 const &, int, int)
+	?generateFileName@MsgUnifiedEditorView@@AAE?AVQString@@AAV2@@Z @ 19 NONAME ; class QString MsgUnifiedEditorView::generateFileName(class QString &)
+	?metaObject@MsgUnifiedEditorView@@UBEPBUQMetaObject@@XZ @ 20 NONAME ; struct QMetaObject const * MsgUnifiedEditorView::metaObject(void) const
+	?createVCards@MsgUnifiedEditorView@@AAEHABVQVariant@@AAVQStringList@@@Z @ 21 NONAME ; int MsgUnifiedEditorView::createVCards(class QVariant const &, class QStringList &)
+	?audiosFetched@MsgUnifiedEditorView@@AAEXABVQVariant@@@Z @ 22 NONAME ; void MsgUnifiedEditorView::audiosFetched(class QVariant const &)
+	?addSubject@MsgUnifiedEditorView@@AAEXXZ @ 23 NONAME ; void MsgUnifiedEditorView::addSubject(void)
+	?imagesFetched@MsgUnifiedEditorView@@AAEXABVQVariant@@@Z @ 24 NONAME ; void MsgUnifiedEditorView::imagesFetched(class QVariant const &)
+	?serviceRequestError@MsgUnifiedEditorView@@AAEXHABVQString@@@Z @ 25 NONAME ; void MsgUnifiedEditorView::serviceRequestError(int, class QString const &)
+	?qt_metacast@MsgUnifiedEditorView@@UAEPAXPBD@Z @ 26 NONAME ; void * MsgUnifiedEditorView::qt_metacast(char const *)
+	?ScaleImageL@CUniImageProcessor@@QAEXAAVRFile@@AAPAVCFbsBitmap@@1AAVTSize@@H@Z @ 27 NONAME ; void CUniImageProcessor::ScaleImageL(class RFile &, class CFbsBitmap * &, class CFbsBitmap * &, class TSize &, int)
+	?addMenu@MsgUnifiedEditorView@@AAEXXZ @ 28 NONAME ; void MsgUnifiedEditorView::addMenu(void)
+	??_EMsgUnifiedEditorView@@UAE@I@Z @ 29 NONAME ; MsgUnifiedEditorView::~MsgUnifiedEditorView(unsigned int)
+	??1MsgUnifiedEditorView@@UAE@XZ @ 30 NONAME ; MsgUnifiedEditorView::~MsgUnifiedEditorView(void)
+	?packMessage@MsgUnifiedEditorView@@AAEXAAVConvergedMessage@@@Z @ 31 NONAME ; void MsgUnifiedEditorView::packMessage(class ConvergedMessage &)
+	?trUtf8@MsgUnifiedEditorView@@SA?AVQString@@PBD0@Z @ 32 NONAME ; class QString MsgUnifiedEditorView::trUtf8(char const *, char const *)
+	?tr@MsgUnifiedEditorView@@SA?AVQString@@PBD0@Z @ 33 NONAME ; class QString MsgUnifiedEditorView::tr(char const *, char const *)
+	?ScaleImageL@CUniImageProcessor@@QAEXPAVCFbsBitmap@@AAVRFile@@ABVTSize@@ABVTDesC8@@H@Z @ 34 NONAME ; void CUniImageProcessor::ScaleImageL(class CFbsBitmap *, class RFile &, class TSize const &, class TDesC8 const &, int)
+	?getStaticMetaObject@MsgUnifiedEditorView@@SAABUQMetaObject@@XZ @ 35 NONAME ; struct QMetaObject const & MsgUnifiedEditorView::getStaticMetaObject(void)
+	?tr@MsgUnifiedEditorView@@SA?AVQString@@PBD0H@Z @ 36 NONAME ; class QString MsgUnifiedEditorView::tr(char const *, char const *, int)
+	?populateContentIntoEditor@MsgUnifiedEditorView@@AAEXABVConvergedMessage@@@Z @ 37 NONAME ; void MsgUnifiedEditorView::populateContentIntoEditor(class ConvergedMessage const &)
+	?send@MsgUnifiedEditorView@@AAEXXZ @ 38 NONAME ; void MsgUnifiedEditorView::send(void)
+	?Reset@CUniImageProcessor@@QAEXXZ @ 39 NONAME ; void CUniImageProcessor::Reset(void)
+	?openDraftsMessage@MsgUnifiedEditorView@@QAEXABV?$QList@VQVariant@@@@@Z @ 40 NONAME ; void MsgUnifiedEditorView::openDraftsMessage(class QList<class QVariant> const &)
+	?addToolBar@MsgUnifiedEditorView@@AAEXXZ @ 41 NONAME ; void MsgUnifiedEditorView::addToolBar(void)
+	?contactsFetched@MsgUnifiedEditorView@@AAEXABVQVariant@@@Z @ 42 NONAME ; void MsgUnifiedEditorView::contactsFetched(class QVariant const &)
+	?removeAttachmentContainer@MsgUnifiedEditorView@@AAEXXZ @ 43 NONAME ; void MsgUnifiedEditorView::removeAttachmentContainer(void)
+	?pluginPath@MsgUnifiedEditorView@@AAE?AVQString@@XZ @ 44 NONAME ; class QString MsgUnifiedEditorView::pluginPath(void)
+	?trUtf8@MsgUnifiedEditorView@@SA?AVQString@@PBD0H@Z @ 45 NONAME ; class QString MsgUnifiedEditorView::trUtf8(char const *, char const *, int)
+	??0MsgUnifiedEditorView@@QAE@PAVQGraphicsItem@@@Z @ 46 NONAME ; MsgUnifiedEditorView::MsgUnifiedEditorView(class QGraphicsItem *)
+	?fetchContacts@MsgUnifiedEditorView@@AAEXXZ @ 47 NONAME ; void MsgUnifiedEditorView::fetchContacts(void)
+	?deleteMessage@MsgUnifiedEditorView@@AAEXXZ @ 48 NONAME ; void MsgUnifiedEditorView::deleteMessage(void)
+	?addAttachments@MsgUnifiedEditorView@@AAEXVQStringList@@@Z @ 49 NONAME ; void MsgUnifiedEditorView::addAttachments(class QStringList)
+	?deactivateInputBlocker@MsgUnifiedEditorView@@AAEXXZ @ 50 NONAME ; void MsgUnifiedEditorView::deactivateInputBlocker(void)
 
--- a/messagingapp/msgui/bwins/unifiedvieweru.def	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/bwins/unifiedvieweru.def	Mon May 03 12:29:07 2010 +0300
@@ -11,11 +11,12 @@
 	??1UnifiedViewer@@UAE@XZ @ 10 NONAME ; UnifiedViewer::~UnifiedViewer(void)
 	??_EUnifiedViewer@@UAE@I@Z @ 11 NONAME ; UnifiedViewer::~UnifiedViewer(unsigned int)
 	?qt_metacall@UnifiedViewer@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 12 NONAME ; int UnifiedViewer::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?tr@UnifiedViewer@@SA?AVQString@@PBD0@Z @ 13 NONAME ; class QString UnifiedViewer::tr(char const *, char const *)
-	?getStaticMetaObject@UnifiedViewer@@SAABUQMetaObject@@XZ @ 14 NONAME ; struct QMetaObject const & UnifiedViewer::getStaticMetaObject(void)
-	?staticMetaObject@UnifiedViewer@@2UQMetaObject@@B @ 15 NONAME ; struct QMetaObject const UnifiedViewer::staticMetaObject
-	?trUtf8@UnifiedViewer@@SA?AVQString@@PBD0H@Z @ 16 NONAME ; class QString UnifiedViewer::trUtf8(char const *, char const *, int)
-	?clearContent@UnifiedViewer@@QAEXXZ @ 17 NONAME ; void UnifiedViewer::clearContent(void)
-	?tr@UnifiedViewer@@SA?AVQString@@PBD0H@Z @ 18 NONAME ; class QString UnifiedViewer::tr(char const *, char const *, int)
-	?sendMessage@UnifiedViewer@@AAEXABVQString@@@Z @ 19 NONAME ; void UnifiedViewer::sendMessage(class QString const &)
+	?sendMessage@UnifiedViewer@@AAEXABVQString@@@Z @ 13 NONAME ; void UnifiedViewer::sendMessage(class QString const &)
+	?tr@UnifiedViewer@@SA?AVQString@@PBD0@Z @ 14 NONAME ; class QString UnifiedViewer::tr(char const *, char const *)
+	?validateMsgForForward@UnifiedViewer@@AAE_NXZ @ 15 NONAME ; bool UnifiedViewer::validateMsgForForward(void)
+	?getStaticMetaObject@UnifiedViewer@@SAABUQMetaObject@@XZ @ 16 NONAME ; struct QMetaObject const & UnifiedViewer::getStaticMetaObject(void)
+	?staticMetaObject@UnifiedViewer@@2UQMetaObject@@B @ 17 NONAME ; struct QMetaObject const UnifiedViewer::staticMetaObject
+	?trUtf8@UnifiedViewer@@SA?AVQString@@PBD0H@Z @ 18 NONAME ; class QString UnifiedViewer::trUtf8(char const *, char const *, int)
+	?clearContent@UnifiedViewer@@QAEXXZ @ 19 NONAME ; void UnifiedViewer::clearContent(void)
+	?tr@UnifiedViewer@@SA?AVQString@@PBD0H@Z @ 20 NONAME ; class QString UnifiedViewer::tr(char const *, char const *, int)
 
--- a/messagingapp/msgui/conversationview/conversationview.pro	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/conversationview/conversationview.pro	Mon May 03 12:29:07 2010 +0300
@@ -26,6 +26,7 @@
 INCLUDEPATH += ../../../inc
 INCLUDEPATH += ../msguiutils/inc
 INCLUDEPATH += ../../msgutils/s60qconversions/inc
+INCLUDEPATH += ../../msgutils/unieditorutils/editorgenutils/inc
 INCLUDEPATH += ../appengine/inc
 INCLUDEPATH += ../../smartmessaging/ringbc/inc
 
@@ -90,4 +91,11 @@
     -lxqserviceutil \
     -lmsguiutils \
     -lunidatamodelloader \
-    -lringbc
+    -lringbc \
+    -lQtContacts \
+    -lcentralrepository \
+    -lunieditorpluginloader \
+    -lgsmu \
+    -lsmcm \
+    -leditorgenutils
+
--- a/messagingapp/msgui/conversationview/conversationview.qrc	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/conversationview/conversationview.qrc	Mon May 03 12:29:07 2010 +0300
@@ -1,79 +1,5 @@
 <RCC>
-    <qresource prefix="/bubble" >
-        <file alias="qtg_fr_convlist_received_highlight_b.svg" >resources/bubble_frames/qtg_fr_convlist_received_highlight_b.svg</file>
-        <file alias="qtg_fr_convlist_received_highlight_bl.svg" >resources/bubble_frames/qtg_fr_convlist_received_highlight_bl.svg</file>
-        <file alias="qtg_fr_convlist_received_highlight_br.svg" >resources/bubble_frames/qtg_fr_convlist_received_highlight_br.svg</file>
-        <file alias="qtg_fr_convlist_received_highlight_c.svg" >resources/bubble_frames/qtg_fr_convlist_received_highlight_c.svg</file>
-        <file alias="qtg_fr_convlist_received_highlight_t.svg" >resources/bubble_frames/qtg_fr_convlist_received_highlight_t.svg</file>
-        <file alias="qtg_fr_convlist_received_highlight_l.svg" >resources/bubble_frames/qtg_fr_convlist_received_highlight_l.svg</file>
-        <file alias="qtg_fr_convlist_received_highlight_r.svg" >resources/bubble_frames/qtg_fr_convlist_received_highlight_r.svg</file>
-        <file alias="qtg_fr_convlist_received_highlight_tr.svg" >resources/bubble_frames/qtg_fr_convlist_received_highlight_tr.svg</file>
-        <file alias="qtg_fr_convlist_received_highlight_tl.svg" >resources/bubble_frames/qtg_fr_convlist_received_highlight_tl.svg</file>
-        <file alias="qtg_fr_convlist_received_normal_br.svg" >resources/bubble_frames/qtg_fr_convlist_received_normal_br.svg</file>
-        <file alias="qtg_fr_convlist_received_normal_b.svg" >resources/bubble_frames/qtg_fr_convlist_received_normal_b.svg</file>
-        <file alias="qtg_fr_convlist_received_normal_bl.svg" >resources/bubble_frames/qtg_fr_convlist_received_normal_bl.svg</file>
-        <file alias="qtg_fr_convlist_received_normal_r.svg" >resources/bubble_frames/qtg_fr_convlist_received_normal_r.svg</file>
-        <file alias="qtg_fr_convlist_received_normal_c.svg" >resources/bubble_frames/qtg_fr_convlist_received_normal_c.svg</file>
-        <file alias="qtg_fr_convlist_received_normal_l.svg" >resources/bubble_frames/qtg_fr_convlist_received_normal_l.svg</file>
-        <file alias="qtg_fr_convlist_received_normal_tr.svg" >resources/bubble_frames/qtg_fr_convlist_received_normal_tr.svg</file>
-        <file alias="qtg_fr_convlist_received_normal_t.svg" >resources/bubble_frames/qtg_fr_convlist_received_normal_t.svg</file>
-        <file alias="qtg_fr_convlist_received_normal_tl.svg" >resources/bubble_frames/qtg_fr_convlist_received_normal_tl.svg</file>
-        <file alias="qtg_fr_convlist_received_pressed_br.svg" >resources/bubble_frames/qtg_fr_convlist_received_pressed_br.svg</file>
-        <file alias="qtg_fr_convlist_received_pressed_b.svg" >resources/bubble_frames/qtg_fr_convlist_received_pressed_b.svg</file>
-        <file alias="qtg_fr_convlist_received_pressed_bl.svg" >resources/bubble_frames/qtg_fr_convlist_received_pressed_bl.svg</file>
-        <file alias="qtg_fr_convlist_received_pressed_tr.svg" >resources/bubble_frames/qtg_fr_convlist_received_pressed_tr.svg</file>
-        <file alias="qtg_fr_convlist_received_pressed_c.svg" >resources/bubble_frames/qtg_fr_convlist_received_pressed_c.svg</file>
-        <file alias="qtg_fr_convlist_received_pressed_l.svg" >resources/bubble_frames/qtg_fr_convlist_received_pressed_l.svg</file>
-        <file alias="qtg_fr_convlist_received_pressed_r.svg" >resources/bubble_frames/qtg_fr_convlist_received_pressed_r.svg</file>
-        <file alias="qtg_fr_convlist_received_pressed_t.svg" >resources/bubble_frames/qtg_fr_convlist_received_pressed_t.svg</file>
-        <file alias="qtg_fr_convlist_received_pressed_tl.svg" >resources/bubble_frames/qtg_fr_convlist_received_pressed_tl.svg</file>
-        <file alias="qtg_fr_convlist_sent_highlight_br.svg" >resources/bubble_frames/qtg_fr_convlist_sent_highlight_br.svg</file>
-        <file alias="qtg_fr_convlist_sent_highlight_b.svg" >resources/bubble_frames/qtg_fr_convlist_sent_highlight_b.svg</file>
-        <file alias="qtg_fr_convlist_sent_highlight_bl.svg" >resources/bubble_frames/qtg_fr_convlist_sent_highlight_bl.svg</file>
-        <file alias="qtg_fr_convlist_sent_highlight_tr.svg" >resources/bubble_frames/qtg_fr_convlist_sent_highlight_tr.svg</file>
-        <file alias="qtg_fr_convlist_sent_highlight_c.svg" >resources/bubble_frames/qtg_fr_convlist_sent_highlight_c.svg</file>
-        <file alias="qtg_fr_convlist_sent_highlight_l.svg" >resources/bubble_frames/qtg_fr_convlist_sent_highlight_l.svg</file>
-        <file alias="qtg_fr_convlist_sent_highlight_r.svg" >resources/bubble_frames/qtg_fr_convlist_sent_highlight_r.svg</file>
-        <file alias="qtg_fr_convlist_sent_highlight_t.svg" >resources/bubble_frames/qtg_fr_convlist_sent_highlight_t.svg</file>
-        <file alias="qtg_fr_convlist_sent_highlight_tl.svg" >resources/bubble_frames/qtg_fr_convlist_sent_highlight_tl.svg</file>
-        <file alias="qtg_fr_convlist_sent_normal_br.svg" >resources/bubble_frames/qtg_fr_convlist_sent_normal_br.svg</file>
-        <file alias="qtg_fr_convlist_sent_normal_b.svg" >resources/bubble_frames/qtg_fr_convlist_sent_normal_b.svg</file>
-        <file alias="qtg_fr_convlist_sent_normal_bl.svg" >resources/bubble_frames/qtg_fr_convlist_sent_normal_bl.svg</file>
-        <file alias="qtg_fr_convlist_sent_normal_r.svg" >resources/bubble_frames/qtg_fr_convlist_sent_normal_r.svg</file>
-        <file alias="qtg_fr_convlist_sent_normal_c.svg" >resources/bubble_frames/qtg_fr_convlist_sent_normal_c.svg</file>
-        <file alias="qtg_fr_convlist_sent_normal_l.svg" >resources/bubble_frames/qtg_fr_convlist_sent_normal_l.svg</file>
-        <file alias="qtg_fr_convlist_sent_normal_tr.svg" >resources/bubble_frames/qtg_fr_convlist_sent_normal_tr.svg</file>
-        <file alias="qtg_fr_convlist_sent_normal_t.svg" >resources/bubble_frames/qtg_fr_convlist_sent_normal_t.svg</file>
-        <file alias="qtg_fr_convlist_sent_normal_tl.svg" >resources/bubble_frames/qtg_fr_convlist_sent_normal_tl.svg</file>
-        <file alias="qtg_fr_convlist_sent_pressed_br.svg" >resources/bubble_frames/qtg_fr_convlist_sent_pressed_br.svg</file>
-        <file alias="qtg_fr_convlist_sent_pressed_b.svg" >resources/bubble_frames/qtg_fr_convlist_sent_pressed_b.svg</file>
-        <file alias="qtg_fr_convlist_sent_pressed_bl.svg" >resources/bubble_frames/qtg_fr_convlist_sent_pressed_bl.svg</file>
-        <file alias="qtg_fr_convlist_sent_pressed_r.svg" >resources/bubble_frames/qtg_fr_convlist_sent_pressed_r.svg</file>
-        <file alias="qtg_fr_convlist_sent_pressed_c.svg" >resources/bubble_frames/qtg_fr_convlist_sent_pressed_c.svg</file>
-        <file alias="qtg_fr_convlist_sent_pressed_l.svg" >resources/bubble_frames/qtg_fr_convlist_sent_pressed_l.svg</file>
-        <file alias="qtg_fr_convlist_sent_pressed_tr.svg" >resources/bubble_frames/qtg_fr_convlist_sent_pressed_tr.svg</file>
-        <file alias="qtg_fr_convlist_sent_pressed_t.svg" >resources/bubble_frames/qtg_fr_convlist_sent_pressed_t.svg</file>
-        <file alias="qtg_fr_convlist_sent_pressed_tl.svg" >resources/bubble_frames/qtg_fr_convlist_sent_pressed_tl.svg</file>
-    </qresource>
-    <qresource prefix="/xml" >
-        <file alias="MsgConversationView.docml" >resources/xml/MsgConversationView.docml</file>
-        <file alias="conversationview_effect.fxml" >resources/xml/conversationview_effect.fxml</file>
-    </qresource>
-    <qresource prefix="/icons" >
-        <file alias="qtg_small_priority_high.svg" >resources/icons/qtg_small_priority_high.svg</file>
-        <file alias="qtg_small_priority_low.svg" >resources/icons/qtg_small_priority_low.svg</file>
-        <file alias="qtg_small_attachment.svg" >resources/icons/qtg_small_attachment.svg</file>
-        <file alias="audio_icon.png" >resources/icons/audio_icon.png</file>
-        <file alias="qtg_large_avatar.svg" >resources/icons/qtg_large_avatar.svg</file>
-        <file alias="qtg_small_offline.svg" >resources/icons/qtg_small_offline.svg</file>
-        <file alias="qtg_small_online.svg" >resources/icons/qtg_small_online.svg</file>
-        <file alias="qtg_mono_send.png" >resources/icons/qtg_mono_send.png</file>
-        <file alias="qtg_small_fail.png" >resources/icons/qtg_small_fail.png</file>
-        <file alias="qtg_large_music_player.png" >resources/icons/qtg_large_music_player.png</file>
-    </qresource>
-    <qresource prefix="/new_item" >
-        <file alias="qtg_fr_list_new_item_t.svg" >resources/new_item_frames/qtg_fr_list_new_item_t.svg</file>
-        <file alias="qtg_fr_list_new_item_c.svg" >resources/new_item_frames/qtg_fr_list_new_item_c.svg</file>
-        <file alias="qtg_fr_list_new_item_b.svg" >resources/new_item_frames/qtg_fr_list_new_item_b.svg</file>
+    <qresource prefix="/">
+        <file alias="qtg_anim_loading.axml">resources/qtg_anim_loading.axml</file>
     </qresource>
 </RCC>
--- a/messagingapp/msgui/conversationview/inc/msgcontactcardwidget.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/conversationview/inc/msgcontactcardwidget.h	Mon May 03 12:29:07 2010 +0300
@@ -19,21 +19,21 @@
 #define MSGCONTACTCARDWIDGET_H
 
 // SYSTEM INCLUDES
-#include <HbAbstractButton>
+#include <HbWidget>
 
 // FORWORD DECLARATIONS
 class HbIconItem;
 class HbTextItem;
 class HbIcon;
-class HbPushButton;
 class QGraphicsSceneMouseEvent;
+class HbGestureSceneFilter;
 
 #include "convergedmessageaddress.h"
 
 /**
  * This class is a custom layout widget for Contact Card layout.
  */
-class MsgContactCardWidget : public HbAbstractButton
+class MsgContactCardWidget : public HbWidget
 {
 Q_OBJECT
 
@@ -84,13 +84,27 @@
      * Clears  all the Contact card fields.
      */
     void clearContent();
-
-signals:
-
+    
+    /**
+     * for tactile feed back.
+     */
+    HbFeedback::InstantEffect overrideFeedback(Hb::InstantInteraction interaction) const;
+    
     /**
-     * Signal emitted when widget is clicked.
+     * To connect/disconnect clicked signal
      */
-    void clicked();
+    void connectSignals(bool yes);
+    
+protected:
+    /**
+     * reimplemented from base class.
+     */
+    virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
+    
+    /**
+     * reimplemented from base class.
+     */
+    virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
 
 private:
 
@@ -98,10 +112,85 @@
      * Initialization function.
      */
     void init();
+    
+    /** Helper method to get contact id against phone number.
+     * @param value phone number.
+     */
+    int resolveContactId(const QString& value);
+    
+    /**
+     * Helper method to set back ground.
+     */
+    void setBackGround(const QString& bg);
+    
+private slots:
+    /**
+     * show longpress menu for attachment object
+     */
+    void handleLongPress(QPointF position);
+    
+    /**
+     * Helper method to initialize gesture.
+     */
+    void initGesture();
+	
+    /**
+     * Slot for handling valid returns from the framework.
+     * Updates the display name in the contact card widget.
+     * @param result const QVariant&
+     */
+    void handleOk(const QVariant& result);
+    
+    /**
+     * Slot for handling errors. Error ids are provided as 
+     * 32-bit integers.
+     * @param errorCode qint32
+     */
+    void handleError(int errorCode, const QString& errorMessage);
+	    
+    /**
+     * Called when clicked() signal is emitted
+     * Launches phonebook to view an existing contact 
+     * or to add a new contact
+     */
+    void openContactInfo();
+    
+    /**
+     * Launches Dialer Service 
+     */
+    void call();
+    
+    /**
+     * Adds unknown number to phonebook
+     */
+    void addToContacts();
+    
+    /**
+     * Called after service request is completed.
+     */
+    void onServiceRequestCompleted();
+    
+signals:
+   /**
+	* Emitted when contact card is short tapped.
+	*/
+    void clicked();
+    
 
 private:
     // Data
 
+
+    /**
+     * To supress short tap if long tap triggered.
+     */
+    bool mMenuShown;  
+	
+	/**
+     * Contact Number for the conversation
+     */
+    QString mContactNumber;
+	
     /**
      * Address string.
      */
@@ -124,12 +213,15 @@
      * Own.
      */
     HbTextItem *mAddressTextItem;
-
+	   
     /**
-     * Background frame item.
-     * Own.
-     */
-    HbPushButton *mBackgroundItem;
+     * gesture filter for long press.
+     */    
+    HbGestureSceneFilter* mGestureFilter;
+	
+
+    
+  
 };
 
 #endif // MSGCONTACTCARDWIDGET_H
--- a/messagingapp/msgui/conversationview/inc/msgconversationbaseview.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/conversationview/inc/msgconversationbaseview.h	Mon May 03 12:29:07 2010 +0300
@@ -30,6 +30,8 @@
 // FORWARD DECLARATIONS
 class MsgConversationView;
 class HbListWidgetItem;
+class MsgContactCardWidget;
+class QGraphicsLinearLayout;
 
 class CONVERSATION_VIEW_EXPORT MsgConversationBaseView : public MsgBaseView
     {
@@ -66,7 +68,7 @@
      * saveContentToDrafts
      * Saves the editors content in cv to drafts
      */
-    bool saveContentToDrafts();
+    void saveContentToDrafts();
 
 public slots:   
     /**
@@ -80,14 +82,31 @@
      * Slot is triiggered when replying started
      */
     void markMessagesAsRead();
+	   
+private slots:
+   /**
+   * Slot for delayed construction
+   */
+    void doDelayedConstruction();
     
-private slots:
+	/**
+	* Hides chrome when itu-t is up
+	*/
+    void hideChrome(bool hide);
+	
+	/**
+     * Slot for handling valid returns from the framework.
+     * 
+     * @param result const QVariant&
+     */
+    void handleOk(const QVariant& result);
     
     /**
-     * Open contact card
-     * Slot is triiggered when clicking on CV header
+     * Slot for handling errors. Error ids are provided as 
+     * 32-bit integers.
+     * @param errorCode qint32
      */
-    void openContactDetails();
+    void handleError(int errorCode, const QString& errorMessage);
     
  
  signals:
@@ -104,16 +123,26 @@
     
 private:
    
+   /**
+     * Conversation ID
+     */
+    qint64 mConversationId;
+   
     /**
      * MsgConversationView, main view class
      * Owned
      */
-    MsgConversationView *mConversationView;
-   
+    MsgConversationView *mConversationView;  
+    
     /**
-     * Conversation ID
+     * Contact card widget.
      */
-    qint64 mConversationId;
+    MsgContactCardWidget* mContactCard;
+    
+    /**
+     * Main layout.
+     */
+    QGraphicsLinearLayout* mMainLayout;
 
     };
 
--- a/messagingapp/msgui/conversationview/inc/msgconversationview.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/conversationview/inc/msgconversationview.h	Mon May 03 12:29:07 2010 +0300
@@ -20,15 +20,21 @@
 
 // INCLUDES
 #include "msgbaseview.h"
+#include "convergedmessage.h"
 
 //Forward declarations
 class HbListView;
 class HbAbstractViewItem;
-class MsgUiUtilsManager;
-class ConvergedMessage;
+class MsgSendUtil;
 class QStandardItemModel;
 class MsgEditorWidget;
 class MsgContactCardWidget;
+class MsgConversationViewItem;
+class HbStaticVkbHost;
+class QGraphicsLinearLayout;
+
+//Defines
+#define INVALID_MSG_ID -1
 
 /**
  * This class provides the message chat view for the messaging application.
@@ -51,11 +57,6 @@
      */
     ~MsgConversationView();
 
-    /**
-     * Set message data
-     * @param message converged message
-     */
-    void setMessageData(const ConvergedMessage &message);
 
     /**
      * Clear editors
@@ -69,7 +70,15 @@
      */
     bool saveContentToDrafts();
 
-public:
+private slots:
+
+    /**
+     * Slot is called when menu is about to be shown.
+     * Populates the menu with relevant actions.
+     */
+    void menuAboutToShow();
+
+private:
 
     /**
      * View initialization function.
@@ -77,40 +86,9 @@
     void setupView();
 
     /**
-     * Creates view menu items.
-     */
-    void addMenu();
-
-public slots:
-
-    /**
-     * Slot to receive error sign.
-     * @param error The error as a string to be displayed on the screen.
+     * Setup view menu items.
      */
-
-    void serviceError(const QString& error);
-   
-private:
-    /**
-     * Load command plugin
-     * @return true if plugin is loaded successfully else false
-     */
-    bool loadCommandPlugin();
-
-    /**
-     * This function shall parse the service Id and check for
-     * type of client
-     * @param serviceId string reference to service id
-     * @return String type the server name
-     */
-    QString parseServiceId(const QString &serviceId);
-
-    /**
-     * Returns the current message type selected in editor.
-     * @return returns message type
-     * @see ConvergedMessage::MessageType
-     */
-    int currentMessageType();
+    void setupMenu();
 
     /**
      * Populates ConvergedMessage for sending.
@@ -118,6 +96,73 @@
      * @see ConvergedMessage::MessageType
      */
     void populateForSending(ConvergedMessage &message);
+    
+    /**
+     * Adds context menu entries to context menu
+     * @param HbMenu context menu
+     * @param int sendingstate.
+     * @see ConvergedMessage::MessageType
+     */
+    void setContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState);
+	
+    /**
+     * Adds context menu entry to context menu for Opening items
+	 * @param MsgConversationViewItem* item whose information is needed.
+     * @param HbMenu context menu
+     * @param int sendingstate.
+     * @see ConvergedMessage::MessageType
+     */
+    void addOpenItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState);
+
+    /**
+     * Adds context menu entry to context menu for Resending items
+     * @param MsgConversationViewItem* item whose information is needed.
+     * @param HbMenu context menu
+     * @param int sendingstate.
+     * @see ConvergedMessage::MessageType
+     */  
+    void addResendItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState);
+
+    /**
+     * Adds context menu entry to context menu for Forwarding items
+	 * @param MsgConversationViewItem* item whose information is needed.
+     * @param HbMenu context menu
+     * @param int sendingstate.
+     * @see ConvergedMessage::MessageType
+     */
+    void addForwardItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState);
+
+    /**
+     * Adds context menu entry to context menu for Deleting items
+	 * @param MsgConversationViewItem* item whose information is needed.
+     * @param HbMenu context menu
+     * @param int sendingstate.
+     * @see ConvergedMessage::MessageType
+     */
+    void addDeleteItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState);
+
+    /**
+     * Adds context menu entry to context menu for Downloading items
+     * @param MsgConversationViewItem* item whose information is needed.
+     * @param HbMenu context menu    
+     * @see ConvergedMessage::MessageType
+     */
+    void addDownloadItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu);
+    
+    /**
+     * Validates if message can be forwarded
+     * @param messageType
+     * @param messageId
+     * @return true if message can be forwarded
+     *         false if message cant be forwarded
+     */
+    bool validateMsgForForward(int &messageType,qint32 &messageId);
+
+    /**
+     * Launches the BT message display service.
+     * @param index Index of the item activated/touched
+     */
+    void launchBtDisplayService(const QModelIndex & index);
 
 public slots:
     /**
@@ -125,12 +170,6 @@
      * data
      */
     void refreshView();
-
-    /**
-     * Effect finish handler
-     * data
-     */
-    void effectFinished(const HbEffect::EffectStatus &status);
     
 private slots:
 
@@ -159,40 +198,47 @@
 
     // ----------------------------- View Specific Menu Slots--------------------//
 
+   
     /**
-     * Deletes all the conversations
+     * Fetch images 
+     */
+    void fetchImages();
+
+    /**
+     * Fectch conatcts
      */
-    void deleteAll();
+    void fetchContacts();
+
+    /**
+     * Fectch audio
+     */
+    void fetchAudio();
 
     /*
      * Get the photos and launch editor
      */
     void imagesFetched(const QVariant& result );
+    
+    /**
+     * slot to receive fetched contacts for addition
+     */
+    void contactsFetched(const QVariant& value);
 
     /*
      * Get audio files from audio-fetcher and launch editor
      */
     void audiosFetched(const QVariant& result );
-
-    /*
-     * Adds other recipients to editor
+    
+    /**
+     * slot to receive fetched contacts for vcard addition
      */
-    void addRecipients();
-
+    void contactsFetchedForVCards(const QVariant& value);
+    
     /*
      * Adds subject file to editor.
      */
     void addSubject();
 
-    /**
-     * Launches help
-     */
-    void launchHelp();
-
-    /**
-     * Exits the application
-     */
-    void exitApp();
 
     //----------------------Item Specific menu slots ---------------------//
 
@@ -205,6 +251,16 @@
      * Deletes the item
      */
     void deleteItem();
+    
+    /**
+     * Resends the item. This is only valid in the failed message case.
+     */
+    void resendMessage();
+
+    /**
+     * Download the specified message
+     */
+    void downloadMessage();
 
     /**
      * Open the item
@@ -219,7 +275,12 @@
     /**
      * Save ringing tone
      */
-    void saveRingingTone();
+    void saveRingingTone();   
+    
+    /**
+     * Launch Editor since sms character limit reached
+     */
+    void handleSmsCharLimitReached();   
     
 signals:
     /**
@@ -233,14 +294,48 @@
      * Emitted when editor is tapped to reply.
      */
     void replyStarted();
+    
+	/**
+	* This signal is emitted when vkb is open.
+	*/
+    void hideChrome(bool);
 
+private slots:
+    /**
+     * Resizes the view when VKB is opened.
+     * This slot is triggered when user taps on the CV editor
+     */
+    void vkbOpened();
+
+    /**
+     * Resizes the view when VKB is closed.
+     * This slot is triggered when VKB focus is lost.
+     */
+    void vkbClosed();
+    
 private:
     /**
      * launch editor when attachment is inserted
-     * @params eflag Editor content to be shown
-     * @params attachment file attachment for editor
+     * @params data used for launching editor with pre-populated content
+     */
+    void launchUniEditor(const QVariantList& data);
+    
+    /**
+     * Signal emitted when an error is generated.
+     * @param errorCode Error code.
+     * @param errorMessage Error description.
      */
-    void launchUniEditor(const int editorFields, QString& attachment);
+    void serviceRequestError(int errorCode, const QString& errorMessage);
+    
+    /**
+     * Activate Input Blocker
+     */
+    void activateInputBlocker();
+
+    /**
+     * Deactivate Input Blocker
+     */
+    void deactivateInputBlocker();
 
 private:
 
@@ -265,11 +360,31 @@
      * Instance of Contact Card widget.
      */
     MsgContactCardWidget* mContactCardWidget;
-
+    
+    /**
+     * Send utils instance
+     */
+    MsgSendUtil *mSendUtil;
+ 
     /**
-     * Utils Manager instance
+     * Instance of the main layout.
      */
-    MsgUiUtilsManager* mUiUtilsManager;
+    QGraphicsLinearLayout *mMainLayout;
+
+	/**
+	 * Flag to track if item has been long pressed.
+	 */
+    bool mItemLongPressed;
+    /*
+     * Instance of VKB 
+     */
+    HbStaticVkbHost* mVkbHost;
+    
+    /**
+     * Flag to check it vkb is open.
+     */
+    bool mVkbopened;
+
 };
 
 #endif // MSG_CONVERSATION_VIEW_H
--- a/messagingapp/msgui/conversationview/inc/msgconversationviewitem.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/conversationview/inc/msgconversationviewitem.h	Mon May 03 12:29:07 2010 +0300
@@ -80,8 +80,25 @@
 
 private:
 
+    /**
+     * Set the Icon that displays the message state.
+     */
     void setMessageStateIcon(int messageState);
 
+    /**
+     * Set the Icon that displays the message notification state.
+     */
+    void setNotificationStateIcon(int notificationState);
+
+protected:
+
+    /**
+     * Reimplemented from HbAbstractViewItem.
+     * This function is called whenever item press state changes.
+     * @see HbAbstractViewItem::pressStateChanged
+     */
+    virtual void pressStateChanged (bool pressed, bool animate);
+
 private:
 
     /**
--- a/messagingapp/msgui/conversationview/inc/msgconversationwidget.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/conversationview/inc/msgconversationwidget.h	Mon May 03 12:29:07 2010 +0300
@@ -42,8 +42,10 @@
     Q_PROPERTY(bool isPlayable READ isPlayable WRITE setPlayable)
     Q_PROPERTY(bool isIncoming READ isIncoming WRITE setIncoming)
     Q_PROPERTY(bool isMMS READ isMMS WRITE setMMS)
+    Q_PROPERTY(bool isMMSNotification READ isMMSNotification WRITE setMMSNotification)
     Q_PROPERTY(bool isUnread READ isUnread WRITE setUnread)
     Q_PROPERTY(int sendingState READ sendingState WRITE setSendingState)
+    Q_PROPERTY(int notificationState READ notificationState WRITE setNotificationState)
 
     Q_ENUMS(MessageState)
 
@@ -135,7 +137,7 @@
     /**
      * Displays audio icon if audio media is present.
      */
-    void displayAudioIcon();
+    void displayAudioIcon(const QString &iconPath = QString());
 
     /**
      * Specify if this widget's message has video
@@ -198,6 +200,18 @@
     bool isMMS();
 
     /**
+     * Set to know if this widget if of type MMS Notification
+     * @return bool
+     */
+    void setMMSNotification(bool isMMSNotification = true);
+
+    /**
+     * Get to find if this widget is of type MMS Notification
+     * @return bool
+     */
+    bool isMMSNotification();
+    
+    /**
      * Set the sending state.
      * Maps ConvergedMessage::SendingState to MessageState.
      * @see ConvergedMessage::SendingState
@@ -211,6 +225,19 @@
     int sendingState();
 
     /**
+     * Set the notification state.
+     * Maps ConvergedMessage::NotificationState to MessageState.
+     * @see ConvergedMessage::NotificationState
+     */
+    void setNotificationState(int state);
+
+    /**
+     * Returns the notification state.
+     * @return Returns one of the states from enum NotificationState.
+     */
+    int notificationState();
+    
+    /**
      * Sets the Timestamp.
      * @param timeStamp Timestamp to be set.
      */
@@ -222,10 +249,21 @@
     void drawNewItemFrame();
 
     /**
-     * Draws the bubble frame.
+     * Draws the normal/highlighted state bubble frame.
      */
     void drawBubbleFrame();
 
+    /**
+     * Draws the pressed state bubble frame.
+     */
+    void drawPressedBubbleFrame();
+
+    /**
+     * Function to receive item pressed events.
+     * @see MsgConversationViewItem::pressStateChanged
+     */
+    void pressStateChanged(bool pressed, bool animate);
+
 private:
 
     /**
@@ -247,6 +285,22 @@
         Pending = 0x03,
         Failed = 0x04
     };
+    
+    /**
+     * Enum defining MMS Notification's Msg State
+     * These are added here so that notification state 
+     * can be used inside css in future
+     * @attention This enum can have values from 0 to 255 only
+     * Add any new states only at the bottom of this enum
+     */
+    enum NotificationState
+        {
+        NotifUnknown = 0x00,
+        NotifReadyForFetching = 0x01,
+        NotifRetrieving = 0x02,
+        NotifExpired = 0x03,
+        NotifFailed = 0x04, 
+        };
 
 private:
 
@@ -298,6 +352,11 @@
     bool mIsMMS;
 
     /**
+     * Holds info if this widget is MMS Notification
+     */
+    bool mIsMMSNotification;
+    
+    /**
      * Info about message priority.
      * @attention Stores high/low/normal priority.
      * @see ConvergedMessage::Priority
@@ -310,6 +369,11 @@
     int mSendingState;
 
     /**
+     * Holds Notification state information.
+     */
+    int mNotificationState;
+    
+    /**
      * Graphics Item to hold new message icon.
      * Owned
      */
--- a/messagingapp/msgui/conversationview/inc/msgeditorwidget.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/conversationview/inc/msgeditorwidget.h	Mon May 03 12:29:07 2010 +0300
@@ -24,6 +24,11 @@
 
 // FORWARD DECLARATIONS
 class HbPushButton;
+class HbFrameItem;
+class HbTextItem;
+class UniEditorPluginLoader;
+class UniEditorPluginInterface;
+class UniEditorGenUtils;
 
 /**
  * Custom editor class
@@ -93,11 +98,10 @@
     void setContent(const QString &contentText);
 
     /**
-     * Getter method which returns the current service-id.
-     * @return service-id
+     * This function does initialisations needed for character counter
      */
-    const QString& serviceId();
-
+    void setEncodingSettings();
+   
 signals:
 
     /**
@@ -110,6 +114,11 @@
      * i.e. when editor is tapped for reply
      */ 
     void replyStarted();
+
+    /**
+     * Signal emitted when the sms char limit is reached
+     */ 
+    void smsCharLimitReached();
     
 public slots:
 
@@ -130,21 +139,33 @@
      */
     void onClicked();
 
+    /**
+     * called the timer expires and handles the case when sms char limit is
+     * reached
+     */
+	 void handleSmsCharLimitReached();
+	 
+	 /**
+     * called when send button is pressed/released.
+     */  
+    void onPressed();
+    void onReleased();
+
 private:
 
     /**
      * Initialization function.
      */
     void init();
+    
+	/**
+	* To update back ground.
+	*/
+    void updateButtonBackground(const QString& bg);
 
 private:
 
     /**
-     * Current service-id
-     */
-    QString mServiceId;
-
-    /**
      * Instance of message edit.
      * Will be deleted automatically by parent.
      * Own.
@@ -157,6 +178,55 @@
      * Own.
      */
     HbPushButton *mSendButton;
+
+    /**
+     * Instance of HbTextItem
+     * Will be deleted automatically by parent.
+     * Own.
+     */
+    HbTextItem *mCharCounter;
+
+    /**
+     * Instance of HbFrameItem
+     * Will be deleted automatically by parent.
+     * Own.
+     */
+    HbFrameItem* mBackgroundItem;
+    
+    /**
+     * Holds the previous buffer inside msgeditor
+     */
+    QString mPrevBuffer;
+
+    /**
+     * Holds char type supported
+     */
+    int mCharSupportType;
+
+    /**
+     * Instance of UniEditorPluginInterface
+     * Will be deleted automatically by parent.
+     * Own.
+     */
+    UniEditorPluginInterface* mPluginInterface;
+
+    /**
+     * Instance of UniEditorPluginLoader
+     * Will be deleted when UniEditorPluginInterface object is deleted
+     * Not Own.
+     */
+    UniEditorPluginLoader* mPluginLoader;
+
+    /**
+     * Instance of UniEditorGenUtils
+     * Own.
+     */
+    UniEditorGenUtils* mEditorUtils;
+
+    /**
+     * Indication for sms char limt reached
+     */
+    bool mSmsCharLimitReached;
 };
 
 #endif // MSGEDITORWIDGET_H
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_highlight_b.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="315px" height="15px" viewBox="0 0 315 15" enable-background="new 0 0 315 15" xml:space="preserve">
-<defs>
-</defs>
-<rect fill="#595959" width="315" height="8.998"/>
-<rect y="8.998" fill="#FFFFFF" enable-background="new    " width="315" height="1.002"/>
-<rect fill="none" width="315" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_highlight_bl.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
-<defs>
-</defs>
-<path fill="#595959" d="M1,0v0.99c0,4.416,3.592,8.008,8.01,8.008H15V0H1z"/>
-<path fill="#FFFFFF" d="M9.01,8.998C4.592,8.998,1,5.406,1,0.99V0H0v0.992C0,5.969,4.033,10,9.008,10H15V8.998H9.01z"/>
-<rect fill="none" width="15" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_highlight_br.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
-<defs>
-</defs>
-<path fill="#595959" d="M5.99,8.998c4.418,0,8.01-3.592,8.01-8.008V0H0v8.998H5.99z"/>
-<path fill="#FFFFFF" d="M14,0.99c0,4.416-3.592,8.008-8.01,8.008H0V10h5.99C10.967,10,15,5.969,15,0.992V0h-1V0.99z"/>
-<rect fill="none" width="15" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_highlight_c.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="315px" height="30px" viewBox="0 0 315 30" enable-background="new 0 0 315 30" xml:space="preserve">
-<defs>
-</defs>
-<rect fill="#595959" width="315" height="30"/>
-<rect opacity="0.7" fill="none" enable-background="new    " width="315" height="30"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_highlight_l.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="30px" viewBox="0 0 15 30" enable-background="new 0 0 15 30" xml:space="preserve">
-<defs>
-</defs>
-<rect x="1" y="0.001" fill="#595959" width="14" height="30"/>
-<rect y="0.001" fill="#FFFFFF" width="1" height="30"/>
-<rect fill="none" width="15" height="30"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_highlight_r.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="30px" viewBox="0 0 15 30" enable-background="new 0 0 15 30" xml:space="preserve">
-<defs>
-</defs>
-<rect fill="#595959" width="14" height="30"/>
-<rect x="14" fill="#FFFFFF" width="1" height="30"/>
-<rect fill="none" width="15" height="30"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_highlight_t.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="315px" height="15px" viewBox="0 0 315 15" enable-background="new 0 0 315 15" xml:space="preserve">
-<defs>
-</defs>
-<polygon fill="#595959" points="0,15 315,15 315,15 315,5.996 0,5.996 0,15 "/>
-<rect y="4.995" fill="#FFFFFF" enable-background="new    " width="315" height="1.001"/>
-<rect fill="none" width="315" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_highlight_tl.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
-<defs>
-</defs>
-<path fill="#595959" d="M15,5.996H9.01c-4.957,0-6.605-2.279-7.809-3.943C1.135,1.959,1.066,1.867,1,1.775v12.227V15h14V5.996z"/>
-<path fill="#FFFFFF" d="M1,14.002V1.775c0.067,0.092,0.135,0.184,0.202,0.277c1.203,1.664,2.853,3.943,7.81,3.943H15V4.994H9.008
-	c-5.266,0-6.271-2.736-7.619-4.35C0.63-0.363,0-0.215,0,1.27c0,3.068,0,10.296,0,12.732V15h1V14.002z"/>
-<rect fill="none" width="15" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_highlight_tr.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
-<defs>
-</defs>
-<path fill="#595959" d="M5.99,5.996H0V15h14v-0.998C14,9.586,10.408,5.996,5.99,5.996z"/>
-<path fill="#FFFFFF" d="M5.99,4.995H0v1.001h5.99c4.418,0,8.01,3.59,8.01,8.006V15h1v-0.998C15,9.025,10.967,4.995,5.99,4.995z"/>
-<rect fill="none" width="15" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_normal_b.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="315px" height="15px" viewBox="0 0 315 15" enable-background="new 0 0 315 15" xml:space="preserve">
-<defs>
-</defs>
-<rect opacity="0.7" fill="#56C3EF" enable-background="new    " width="315" height="8.998"/>
-<rect y="8.998" fill="#FFFFFF" enable-background="new    " width="315" height="1.002"/>
-<rect fill="none" width="315" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_normal_bl.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
-<defs>
-</defs>
-<path opacity="0.7" fill="#56C3EF" enable-background="new    " d="M1,0v0.99c0,4.416,3.592,8.008,8.01,8.008H15V0H1z"/>
-<path fill="#FFFFFF" d="M9.01,8.998C4.592,8.998,1,5.406,1,0.99V0H0v0.992C0,5.969,4.033,10,9.008,10H15V8.998H9.01z"/>
-<rect fill="none" width="15" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_normal_br.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
-<defs>
-</defs>
-<path opacity="0.7" fill="#56C3EF" enable-background="new    " d="M5.99,8.998c4.418,0,8.01-3.592,8.01-8.008V0H0v8.998H5.99z"/>
-<path fill="#FFFFFF" d="M14,0.99c0,4.416-3.592,8.008-8.01,8.008H0V10h5.99C10.967,10,15,5.969,15,0.992V0h-1V0.99z"/>
-<rect fill="none" width="15" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_normal_c.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="315px" height="30px" viewBox="0 0 315 30" enable-background="new 0 0 315 30" xml:space="preserve">
-<defs>
-</defs>
-<rect opacity="0.7" fill="#56C3EF" enable-background="new    " width="315" height="30"/>
-<rect opacity="0.7" fill="none" enable-background="new    " width="315" height="30"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_normal_l.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="30px" viewBox="0 0 15 30" enable-background="new 0 0 15 30" xml:space="preserve">
-<defs>
-</defs>
-<rect x="1" opacity="0.7" fill="#56C3EF" enable-background="new    " width="14" height="30"/>
-<rect fill="#FFFFFF" width="1" height="30"/>
-<rect fill="none" width="15" height="30"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_normal_r.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="30px" viewBox="0 0 15 30" enable-background="new 0 0 15 30" xml:space="preserve">
-<defs>
-</defs>
-<rect opacity="0.7" fill="#56C3EF" enable-background="new    " width="14" height="30"/>
-<rect x="14" fill="#FFFFFF" width="1" height="30"/>
-<rect fill="none" width="15" height="30"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_normal_t.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="315px" height="15px" viewBox="0 0 315 15" enable-background="new 0 0 315 15" xml:space="preserve">
-<defs>
-</defs>
-<polygon opacity="0.7" fill="#56C3EF" enable-background="new    " points="0,15 315,15 315,15 315,5.996 0,5.996 0,15 "/>
-<rect y="4.994" fill="#FFFFFF" enable-background="new    " width="315" height="1.002"/>
-<rect fill="none" width="315" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_normal_tl.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
-<defs>
-</defs>
-<path opacity="0.7" fill="#56C3EF" enable-background="new    " d="M15,5.996H9.01c-4.957,0-6.605-2.279-7.808-3.943
-	C1.135,1.959,1.066,1.867,1,1.775v12.227V15h14V5.996z"/>
-<path fill="#FFFFFF" d="M1,14.002V1.775c0.066,0.092,0.135,0.184,0.202,0.277C2.405,3.716,4.053,5.995,9.01,5.995H15V4.994H9.008
-	c-5.266,0-6.271-2.736-7.619-4.35C0.63-0.363,0-0.215,0,1.27c0,3.068,0,10.296,0,12.732V15h1V14.002z"/>
-<rect fill="none" width="15" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_normal_tr.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
-<defs>
-</defs>
-<path opacity="0.7" fill="#56C3EF" enable-background="new    " d="M5.99,5.996H0V15h14v-0.998C14,9.586,10.408,5.996,5.99,5.996z"
-	/>
-<path fill="#FFFFFF" d="M5.99,4.994H0v1.002h5.99c4.418,0,8.01,3.59,8.01,8.006V15h1v-0.998C15,9.025,10.967,4.994,5.99,4.994z"/>
-<rect fill="none" width="15" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_pressed_b.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="315px" height="15px" viewBox="0 0 315 15" enable-background="new 0 0 315 15" xml:space="preserve">
-<defs>
-</defs>
-<rect fill="#56C3EF" width="315" height="8.998"/>
-<rect y="8.998" fill="#FFFFFF" enable-background="new    " width="315" height="1.002"/>
-<rect fill="none" width="315" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_pressed_bl.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
-<defs>
-</defs>
-<path fill="#56C3EF" d="M1,0v0.99c0,4.416,3.592,8.008,8.01,8.008H15V0H1z"/>
-<path fill="#FFFFFF" d="M9.009,8.998C4.591,8.998,1,5.406,1,0.99V0H0v0.992C0,5.969,4.033,10,9.008,10H15V8.998H9.009z"/>
-<rect fill="none" width="15" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_pressed_br.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
-<defs>
-</defs>
-<path fill="#56C3EF" d="M5.99,8.998c4.418,0,8.01-3.592,8.01-8.008V0H0v8.998H5.99z"/>
-<path fill="#FFFFFF" d="M14,0.99c0,4.416-3.592,8.008-8.01,8.008H0V10h5.99C10.967,10,15,5.969,15,0.992V0h-1V0.99z"/>
-<rect fill="none" width="15" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_pressed_c.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="315px" height="30px" viewBox="0 0 315 30" enable-background="new 0 0 315 30" xml:space="preserve">
-<defs>
-</defs>
-<rect fill="#56C3EF" width="315" height="30"/>
-<rect opacity="0.7" fill="none" enable-background="new    " width="315" height="30"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_pressed_l.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="30px" viewBox="0 0 15 30" enable-background="new 0 0 15 30" xml:space="preserve">
-<defs>
-</defs>
-<rect x="1" fill="#56C3EF" width="14" height="30"/>
-<rect fill="#FFFFFF" width="1" height="30"/>
-<rect fill="none" width="15" height="30"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_pressed_r.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="30px" viewBox="0 0 15 30" enable-background="new 0 0 15 30" xml:space="preserve">
-<defs>
-</defs>
-<rect fill="#56C3EF" width="14" height="30"/>
-<rect x="14" fill="#FFFFFF" width="1" height="30"/>
-<rect fill="none" width="15" height="30"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_pressed_t.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="315px" height="15px" viewBox="0 0 315 15" enable-background="new 0 0 315 15" xml:space="preserve">
-<defs>
-</defs>
-<polygon fill="#56C3EF" points="0,15 315,15 315,15 315,5.996 0,5.996 0,15 "/>
-<rect y="4.994" fill="#FFFFFF" enable-background="new    " width="315" height="1.002"/>
-<rect fill="none" width="315" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_pressed_tl.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
-<defs>
-</defs>
-<path fill="#56C3EF" d="M15,5.996H9.01c-4.955,0-6.605-2.279-7.808-3.943C1.135,1.959,1.066,1.867,1,1.775v12.227V15h14V5.996z"/>
-<path fill="#FFFFFF" d="M1,14.002V1.775c0.066,0.092,0.135,0.184,0.202,0.277C2.405,3.716,4.055,5.995,9.01,5.995H15V4.994H9.009
-	c-5.267,0-6.271-2.736-7.619-4.35C0.63-0.363,0-0.215,0,1.27c0,3.068,0,10.296,0,12.732V15h1V14.002z"/>
-<rect fill="none" width="15" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_received_pressed_tr.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
-<defs>
-</defs>
-<path fill="#56C3EF" d="M5.99,5.996H0V15h14v-0.998C14,9.586,10.408,5.996,5.99,5.996z"/>
-<path fill="#FFFFFF" d="M5.99,4.994H0v1.002h5.99c4.418,0,8.01,3.59,8.01,8.006V15h1v-0.998C15,9.025,10.967,4.994,5.99,4.994z"/>
-<rect fill="none" width="15" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_highlight_b.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="315px" height="15px" viewBox="0 0 315 15" enable-background="new 0 0 315 15" xml:space="preserve">
-<defs>
-</defs>
-<polygon fill="#595959" points="315,0 0,0 0,0 0,9.004 315,9.004 315,0 "/>
-<rect y="9.004" fill="#FFFFFF" enable-background="new    " width="315" height="1.002"/>
-<rect fill="none" width="315" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_highlight_bl.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
-<defs>
-</defs>
-<path fill="#595959" d="M9.01,9.004H15V0H1v0.998C1,5.414,4.592,9.004,9.01,9.004z"/>
-<path fill="#FFFFFF" d="M9.01,10.006H15V9.004H9.01C4.592,9.004,1,5.414,1,0.998V0H0v0.998C0,5.975,4.034,10.006,9.01,10.006z"/>
-<rect fill="none" width="15" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_highlight_br.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
-<defs>
-</defs>
-<path fill="#595959" d="M0,9.004h5.99c4.955,0,6.605,2.279,7.808,3.943c0.067,0.094,0.136,0.186,0.202,0.277V0.998V0H0V9.004z"/>
-<path fill="#FFFFFF" d="M14,0.998v12.227c-0.066-0.092-0.135-0.184-0.202-0.277c-1.202-1.664-2.853-3.943-7.808-3.943H0v1.002h5.991
-	c5.267,0,6.271,2.736,7.618,4.35C14.369,15.363,15,15.215,15,13.73c0-3.068,0-10.297,0-12.732V0h-1V0.998z"/>
-<rect fill="none" width="15" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_highlight_c.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="315px" height="30px" viewBox="0 0 315 30" enable-background="new 0 0 315 30" xml:space="preserve">
-<defs>
-</defs>
-<rect fill="#595959" width="315" height="30"/>
-<rect opacity="0.7" fill="none" enable-background="new    " width="315" height="30"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_highlight_l.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="30px" viewBox="0 0 15 30" enable-background="new 0 0 15 30" xml:space="preserve">
-<defs>
-</defs>
-<rect x="1" fill="#595959" width="14" height="30"/>
-<rect fill="#FFFFFF" width="1" height="30"/>
-<rect fill="none" width="15" height="30"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_highlight_r.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="35px" viewBox="0 0 15 35" enable-background="new 0 0 15 35" xml:space="preserve">
-<defs>
-</defs>
-<rect fill="#595959" width="15" height="35"/>
-<rect x="13.999" fill="#FFFFFF" width="1.001" height="35"/>
-<rect fill="none" width="15" height="35"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_highlight_t.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="315px" height="15px" viewBox="0 0 315 15" enable-background="new 0 0 315 15" xml:space="preserve">
-<defs>
-</defs>
-<rect y="6.002" fill="#595959" width="315" height="8.998"/>
-<rect y="5" fill="#FFFFFF" enable-background="new    " width="315" height="1.002"/>
-<rect fill="none" width="315" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_highlight_tl.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
-<defs>
-</defs>
-<path fill="#595959" d="M9.01,6.002C4.592,6.002,1,9.594,1,14.01V15h14V6.002H9.01z"/>
-<path fill="#FFFFFF" d="M1,14.01c0-4.416,3.592-8.008,8.01-8.008H15V5H9.01C4.034,5,0,9.031,0,14.008V15h1V14.01z"/>
-<rect fill="none" width="15" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_highlight_tr.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
-<defs>
-</defs>
-<path fill="#595959" d="M14,15v-0.99c0-4.416-3.592-8.008-8.01-8.008H0V15H14z"/>
-<path fill="#FFFFFF" d="M5.99,6.002c4.418,0,8.01,3.592,8.01,8.008V15h1v-0.992C15,9.031,10.967,5,5.991,5H0v1.002H5.99z"/>
-<rect fill="none" width="15" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_normal_b.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="315px" height="15px" viewBox="0 0 315 15" enable-background="new 0 0 315 15" xml:space="preserve">
-<defs>
-</defs>
-<polygon opacity="0.7" fill="#69FF00" enable-background="new    " points="315,0 0,0 0,0 0,9.004 315,9.004 315,0 "/>
-<rect y="9.004" fill="#FFFFFF" enable-background="new    " width="315" height="1.002"/>
-<rect fill="none" width="315" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_normal_bl.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
-<defs>
-</defs>
-<path opacity="0.7" fill="#69FF00" enable-background="new    " d="M9.01,9.004H15V0H1v0.998C1,5.414,4.592,9.004,9.01,9.004z"/>
-<path fill="#FFFFFF" d="M9.01,10.006H15V9.004H9.01C4.592,9.004,1,5.414,1,0.998V0H0v0.998C0,5.975,4.033,10.006,9.01,10.006z"/>
-<rect fill="none" width="15" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_normal_br.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
-<defs>
-</defs>
-<path opacity="0.7" fill="#69FF00" enable-background="new    " d="M0,9.004h5.99c4.957,0,6.605,2.279,7.809,3.943
-	c0.066,0.094,0.135,0.186,0.201,0.277V0.998V0H0V9.004z"/>
-<path fill="#FFFFFF" d="M14,0.998v12.227c-0.066-0.092-0.135-0.184-0.201-0.277c-1.203-1.664-2.852-3.943-7.809-3.943H0v1.002h5.992
-	c5.266,0,6.271,2.736,7.619,4.35C14.369,15.363,15,15.215,15,13.73c0-3.068,0-10.297,0-12.732V0h-1V0.998z"/>
-<rect fill="none" width="15" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_normal_c.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="315px" height="30px" viewBox="0 0 315 30" enable-background="new 0 0 315 30" xml:space="preserve">
-<defs>
-</defs>
-<rect opacity="0.7" fill="#69FF00" enable-background="new    " width="315" height="30"/>
-<rect opacity="0.7" fill="none" enable-background="new    " width="315" height="30"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_normal_l.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="30px" viewBox="0 0 15 30" enable-background="new 0 0 15 30" xml:space="preserve">
-<defs>
-</defs>
-<rect x="1" opacity="0.7" fill="#69FF00" enable-background="new    " width="14" height="30"/>
-<rect fill="#FFFFFF" width="1" height="30"/>
-<rect fill="none" width="15" height="30"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_normal_r.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="30px" viewBox="0 0 15 30" enable-background="new 0 0 15 30" xml:space="preserve">
-<defs>
-</defs>
-<rect opacity="0.7" fill="#69FF00" enable-background="new    " width="14" height="30"/>
-<rect x="14" fill="#FFFFFF" width="1" height="30"/>
-<rect fill="none" width="15" height="30"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_normal_t.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="315px" height="15px" viewBox="0 0 315 15" enable-background="new 0 0 315 15" xml:space="preserve">
-<defs>
-</defs>
-<rect y="6.002" opacity="0.7" fill="#69FF00" enable-background="new    " width="315" height="8.998"/>
-<rect y="5" fill="#FFFFFF" enable-background="new    " width="315" height="1.002"/>
-<rect fill="none" width="315" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_normal_tl.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
-<defs>
-</defs>
-<path opacity="0.7" fill="#69FF00" enable-background="new    " d="M9.01,6.002C4.592,6.002,1,9.594,1,14.01V15h14V6.002H9.01z"/>
-<path fill="#FFFFFF" d="M1,14.01c0-4.416,3.592-8.008,8.01-8.008H15V5H9.01C4.033,5,0,9.031,0,14.008V15h1V14.01z"/>
-<rect fill="none" width="15" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_normal_tr.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
-<defs>
-</defs>
-<path opacity="0.7" fill="#69FF00" enable-background="new    " d="M14,15v-0.99c0-4.416-3.592-8.008-8.01-8.008H0V15H14z"/>
-<path fill="#FFFFFF" d="M5.99,6.002c4.418,0,8.01,3.592,8.01,8.008V15h1v-0.992C15,9.031,10.967,5,5.992,5H0v1.002H5.99z"/>
-<rect fill="none" width="15" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_pressed_b.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="315px" height="15px" viewBox="0 0 315 15" enable-background="new 0 0 315 15" xml:space="preserve">
-<defs>
-</defs>
-<polygon fill="#69FF00" points="315,0 0,0 0,0 0,9.004 315,9.004 315,0 "/>
-<rect y="9.004" fill="#FFFFFF" enable-background="new    " width="315" height="1.002"/>
-<rect fill="none" width="315" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_pressed_bl.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
-<defs>
-</defs>
-<path fill="#69FF00" d="M9.01,9.004H15V0H1v0.998C1,5.414,4.592,9.004,9.01,9.004z"/>
-<path fill="#FFFFFF" d="M9.01,10.006H15V9.004H9.01C4.592,9.004,1,5.414,1,0.998V0H0v0.998C0,5.975,4.033,10.006,9.01,10.006z"/>
-<rect fill="none" width="15" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_pressed_br.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
-<defs>
-</defs>
-<path fill="#69FF00" d="M0,9.004h5.99c4.957,0,6.605,2.279,7.809,3.943c0.066,0.094,0.135,0.186,0.201,0.277V0.998V0H0V9.004z"/>
-<path fill="#FFFFFF" d="M14,0.998v12.227c-0.066-0.092-0.135-0.184-0.201-0.277c-1.203-1.664-2.852-3.943-7.809-3.943H0v1.002h5.992
-	c5.266,0,6.271,2.736,7.619,4.35C14.369,15.363,15,15.215,15,13.73c0-3.068,0-10.297,0-12.732V0h-1V0.998z"/>
-<rect fill="none" width="15" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_pressed_c.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="315px" height="30px" viewBox="0 0 315 30" enable-background="new 0 0 315 30" xml:space="preserve">
-<defs>
-</defs>
-<rect fill="#69FF00" width="315" height="30"/>
-<rect opacity="0.7" fill="none" enable-background="new    " width="315" height="30"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_pressed_l.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="30px" viewBox="0 0 15 30" enable-background="new 0 0 15 30" xml:space="preserve">
-<defs>
-</defs>
-<rect x="1" fill="#69FF00" width="14" height="30"/>
-<rect fill="#FFFFFF" width="1" height="30"/>
-<rect fill="none" width="15" height="30"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_pressed_r.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="30px" viewBox="0 0 15 30" enable-background="new 0 0 15 30" xml:space="preserve">
-<defs>
-</defs>
-<rect fill="#69FF00" width="14" height="30"/>
-<rect x="14" fill="#FFFFFF" width="1" height="30"/>
-<rect fill="none" width="15" height="30"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_pressed_t.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="315px" height="15px" viewBox="0 0 315 15" enable-background="new 0 0 315 15" xml:space="preserve">
-<defs>
-</defs>
-<rect y="6.002" fill="#69FF00" width="315" height="8.998"/>
-<rect y="5" fill="#FFFFFF" enable-background="new    " width="315" height="1.002"/>
-<rect fill="none" width="315" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_pressed_tl.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
-<defs>
-</defs>
-<path fill="#69FF00" d="M9.01,6.002C4.592,6.002,1,9.594,1,14.01V15h14V6.002H9.01z"/>
-<path fill="#FFFFFF" d="M1,14.01c0-4.416,3.592-8.008,8.01-8.008H15V5H9.01C4.033,5,0,9.031,0,14.008V15h1V14.01z"/>
-<rect fill="none" width="15" height="15"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/bubble_frames/qtg_fr_convlist_sent_pressed_tr.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.1, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
-<defs>
-</defs>
-<path fill="#69FF00" d="M14,15v-0.99c0-4.416-3.592-8.008-8.01-8.008H0V15H14z"/>
-<path fill="#FFFFFF" d="M5.99,6.002c4.418,0,8.01,3.592,8.01,8.008V15h1v-0.992C15,9.031,10.967,5,5.992,5H0v1.002H5.99z"/>
-<rect fill="none" width="15" height="15"/>
-</svg>
Binary file messagingapp/msgui/conversationview/resources/icons/audio_icon.png has changed
Binary file messagingapp/msgui/conversationview/resources/icons/play_icon.png has changed
--- a/messagingapp/msgui/conversationview/resources/icons/qtg_large_avatar.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg baseProfile="tiny" height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g>
-<path d="M46.691,42.35c-1.665-0.866-9.918-3.756-10.072-3.936l-0.002,0.002  c-0.934-1.068-0.896-3.433-0.43-4.46c0.001-0.001,0.002-0.001,0.002-0.002c0.032-0.071,0.065-0.139,0.104-0.197  c0.113-0.177,0.219-0.354,0.326-0.533l0,0c0.813-1.329,1.494-2.651,2.054-3.892c1.009,0.349,2.307-0.59,2.95-2.18  c0.667-1.645,0.379-3.354-0.645-3.815c-0.058-0.026-0.119-0.03-0.178-0.048c0-0.001,0-0.002,0-0.002  c0.133-0.521,0.191-0.826,0.191-0.826c1.77-7.934-2.078-14.223-11.402-14.533c-3.832,0-5.617,0.578-7.039,2.398  c-2.313,0.357-6.039,3.642-3.453,12.927c-0.098,0.016-0.195,0.031-0.289,0.071c-1.032,0.436-1.355,2.128-0.724,3.782  c0.633,1.653,1.983,2.643,3.017,2.208c0.063-0.027,0.117-0.072,0.176-0.11c0.568,1.279,1.266,2.646,2.104,4.02H23.38  c0.022,0.037,0.046,0.073,0.067,0.11c0.023,0.038,0.045,0.076,0.068,0.114c0.002,0.003,0.005,0.005,0.007,0.008  c0.061,0.101,0.12,0.201,0.185,0.301c0.532,0.833,0.663,3.229-0.166,4.457c-0.208,0.283-8.346,3.135-10.23,4.136  c-2.161,1.147-5.688,3.782-5.688,9.723h44.756C52.378,46.132,48.354,43.216,46.691,42.35z" fill="url(#SVGID_1_)"/>
-<path d="M7.659,51.072c-0.022,0.323-0.037,0.655-0.037,1h44.756c0-0.345-0.017-0.676-0.042-1H7.659z" fill="#FFFFFF" fill-opacity="0.15" stroke-opacity="0.15"/>
-<path d="M22.551,11.326c1.422-1.82,3.207-2.398,7.039-2.398c7.565,0.252,11.524,4.44,11.804,10.248  C41.535,12.856,37.58,8.194,29.59,7.928c-3.832,0-5.617,0.578-7.039,2.398c-1.81,0.279-4.472,2.367-4.311,7.704  C18.419,13.429,20.858,11.588,22.551,11.326z" fill="#FFFFFF" fill-opacity="0.5" stroke-opacity="0.5"/>
-<path d="M36.617,38.416c-0.441-0.505-0.66-1.3-0.725-2.106c-0.086,1.09,0.098,2.389,0.725,3.106  l0.002-0.002c0.154,0.18,8.407,3.069,10.072,3.936c1.566,0.816,5.225,3.453,5.645,8.723h0.042c0-5.94-4.024-8.856-5.687-9.723  c-1.665-0.866-9.918-3.756-10.072-3.936L36.617,38.416z" fill="#FFFFFF" fill-opacity="0.5" stroke-opacity="0.5"/>
-<path d="M13.311,43.35c1.885-1.001,10.022-3.853,10.23-4.136c0.508-0.752,0.652-1.938,0.568-2.938  c-0.053,0.717-0.225,1.429-0.568,1.938c-0.208,0.283-8.346,3.135-10.23,4.136c-2.161,1.147-5.688,3.782-5.688,9.723h0.037  C8.029,46.833,11.275,44.431,13.311,43.35z" fill="#FFFFFF" fill-opacity="0.5" stroke-opacity="0.5"/>
-<rect fill="none" height="60" width="60"/>
-<defs>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="29.9995" x2="29.9995" y1="8.5967" y2="52.3536">
-<stop offset="0" style="stop-color:#8E8E8E"/>
-<stop offset="1" style="stop-color:#444444"/>
-</linearGradient>
-</defs>
-</g>
-</svg>
Binary file messagingapp/msgui/conversationview/resources/icons/qtg_large_music_player.png has changed
--- a/messagingapp/msgui/conversationview/resources/icons/qtg_mono_forward.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448)  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_svg "http://www.w3.org/2000/svg">
-	<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
-]>
-<svg  version="1.1" id="Layer_1" xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="30" height="30" viewBox="0 0 30 30"
-	 overflow="visible" enable-background="new 0 0 30 30" xml:space="preserve">
-<rect fill="none" width="30" height="30"/>
-<path fill="#FF0000" d="M0,0v30h30V0H0z M29,29H1V1h28V29z"/>
-<polygon fill="#FF0000" points="24.344,2.415 27.584,5.655 18.242,15.001 27.585,24.346 24.346,27.585 14.999,18.238 5.655,27.585 
-	2.415,24.346 11.76,15 2.415,5.655 5.655,2.415 15.002,11.763 "/>
-</svg>
Binary file messagingapp/msgui/conversationview/resources/icons/qtg_mono_send.png has changed
--- a/messagingapp/msgui/conversationview/resources/icons/qtg_small_attachment.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="32px" height="32px" viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">
-<defs>
-</defs>
-<g>
-	<rect fill="none" width="32" height="32"/>
-</g>
-<path opacity="0.6" d="M10.465,30L6,23.303V10h4v12.092L12.605,26h5.789L21,22.092V6h-6v13.5c0,0.275,0.224,0.5,0.5,0.5
-	s0.5-0.225,0.5-0.5V7h4v12.5c0,2.481-2.019,4.5-4.5,4.5S11,21.981,11,19.5V5c0-1.654,1.346-3,3-3h8c1.654,0,3,1.346,3,3v18.303
-	L20.535,30H10.465z"/>
-<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="15.5005" y1="29" x2="15.5005" y2="3.0005">
-	<stop  offset="0" style="stop-color:#8C8E8F"/>
-	<stop  offset="0.6545" style="stop-color:#D9D9D9"/>
-	<stop  offset="1" style="stop-color:#AEB2B3"/>
-</linearGradient>
-<path fill="url(#SVGID_1_)" d="M22,3h-8c-1.101,0-2,0.9-2,2v14.5c0,1.934,1.567,3.5,3.5,3.5s3.5-1.566,3.5-3.5V8h-2v11.5
-	c0,0.827-0.673,1.5-1.5,1.5S14,20.327,14,19.5V5h8v17.395L18.93,27H12.07L9,22.395V11H7v12l4,6h9l4-6V5C24,3.9,23.101,3,22,3z"/>
-</svg>
Binary file messagingapp/msgui/conversationview/resources/icons/qtg_small_fail.png has changed
--- a/messagingapp/msgui/conversationview/resources/icons/qtg_small_offline.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="32px" height="32px" viewBox="-2 -2 32 32" enable-background="new -2 -2 32 32" xml:space="preserve">
-<defs>
-</defs>
-<path opacity="0.6" d="M14,28C6.28,28,0,21.72,0,14S6.28,0,14,0c7.719,0,14,6.28,14,14S21.719,28,14,28L14,28z"/>
-<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="13.9995" y1="1" x2="13.9995" y2="27.0005">
-	<stop  offset="0" style="stop-color:#FFFFFF"/>
-	<stop  offset="1" style="stop-color:#B4B4B4"/>
-</linearGradient>
-<circle fill="url(#SVGID_1_)" cx="14" cy="14" r="13"/>
-<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="14.0005" y1="26" x2="14.0005" y2="2.0005">
-	<stop  offset="0" style="stop-color:#FFFFFF"/>
-	<stop  offset="1" style="stop-color:#B4B4B4"/>
-</linearGradient>
-<path fill="url(#SVGID_2_)" d="M14,26C7.383,26,2,20.617,2,14S7.383,2,14,2s12,5.383,12,12S20.617,26,14,26L14,26z"/>
-<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="14.0005" y1="24" x2="14.0005" y2="4.0005">
-	<stop  offset="0" style="stop-color:#DCDCDC"/>
-	<stop  offset="1" style="stop-color:#A0A0A0"/>
-</linearGradient>
-<path fill="url(#SVGID_3_)" d="M14,24C8.486,24,4,19.514,4,14S8.486,4,14,4s10,4.486,10,10S19.514,24,14,24L14,24z"/>
-<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="13.9995" y1="5" x2="13.9995" y2="23.0005">
-	<stop  offset="0" style="stop-color:#F0F0F0"/>
-	<stop  offset="1" style="stop-color:#787878"/>
-</linearGradient>
-<path fill="url(#SVGID_4_)" d="M14,23c-4.962,0-9-4.037-9-9s4.038-9,9-9c4.963,0,9,4.037,9,9S18.963,23,14,23L14,23z"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/icons/qtg_small_online.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="32px" height="32px" viewBox="-2 -2 32 32" enable-background="new -2 -2 32 32" xml:space="preserve">
-<defs>
-</defs>
-<path opacity="0.6" d="M14,28C6.28,28,0,21.72,0,14S6.28,0,14,0c7.718,0,14,6.28,14,14S21.719,28,14,28L14,28z"/>
-<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="13.9995" y1="1" x2="13.9995" y2="27.0005">
-	<stop  offset="0" style="stop-color:#FFFFFF"/>
-	<stop  offset="1" style="stop-color:#B4B4B4"/>
-</linearGradient>
-<circle fill="url(#SVGID_1_)" cx="14" cy="14" r="13"/>
-<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="14.0005" y1="26" x2="14.0005" y2="2.0005">
-	<stop  offset="0" style="stop-color:#FFFFFF"/>
-	<stop  offset="1" style="stop-color:#B4B4B4"/>
-</linearGradient>
-<path fill="url(#SVGID_2_)" d="M14,26C7.383,26,2,20.617,2,14S7.383,2,14,2c6.617,0,12,5.383,12,12S20.617,26,14,26L14,26z"/>
-<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="14.0005" y1="24" x2="14.0005" y2="4.0005">
-	<stop  offset="0" style="stop-color:#7CDB00"/>
-	<stop  offset="1" style="stop-color:#319E00"/>
-</linearGradient>
-<path fill="url(#SVGID_3_)" d="M14,24C8.486,24,4,19.514,4,14S8.486,4,14,4c5.513,0,10,4.486,10,10S19.514,24,14,24L14,24z"/>
-<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="13.9995" y1="5" x2="13.9995" y2="23.0005">
-	<stop  offset="0" style="stop-color:#A0F800"/>
-	<stop  offset="1" style="stop-color:#319E00"/>
-</linearGradient>
-<path fill="url(#SVGID_4_)" d="M14,23c-4.963,0-9-4.037-9-9s4.038-9,9-9c4.962,0,9,4.037,9,9S18.963,23,14,23L14,23z"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/icons/qtg_small_priority_high.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="32px" height="32px" viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">
-<defs>
-</defs>
-<g>
-	<rect fill="none" width="32" height="32"/>
-</g>
-<polygon opacity="0.6" points="12.117,19 9.867,2 22.133,2 19.883,19 "/>
-<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="15.9995" y1="3" x2="15.9995" y2="28.0027">
-	<stop  offset="0" style="stop-color:#FF4D00"/>
-	<stop  offset="1" style="stop-color:#800000"/>
-</linearGradient>
-<path fill="url(#SVGID_1_)" d="M21,3l-2,15h-6L11,3H21z"/>
-<path opacity="0.6" d="M16,30c-2.757,0-5-2.243-5-5s2.243-5,5-5s5,2.243,5,5S18.757,30,16,30L16,30z"/>
-<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="15.9995" y1="21.333" x2="15.9995" y2="28.8994">
-	<stop  offset="0" style="stop-color:#FF4D00"/>
-	<stop  offset="1" style="stop-color:#800000"/>
-</linearGradient>
-<circle fill="url(#SVGID_2_)" cx="16" cy="25" r="4"/>
-<polygon opacity="0.4" fill="#FFFFFF" points="20.866,4 21,3 11,3 11.134,4 "/>
-<path opacity="0.4" fill="#FFFFFF" d="M16,22c2.036,0,3.7,1.53,3.95,3.5C19.971,25.334,20,25.172,20,25c0-2.208-1.792-4-4-4
-	c-2.21,0-4,1.792-4,4c0,0.172,0.029,0.334,0.05,0.5C12.299,23.53,13.962,22,16,22z"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/icons/qtg_small_priority_low.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="32px" height="32px" viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">
-<defs>
-</defs>
-<g>
-	<rect fill="none" width="32" height="32"/>
-</g>
-<polygon opacity="0.6" points="3.864,16 11,16 11,2 21,2 21,16 28.136,16 16,30.563 "/>
-<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="15.9995" y1="2.8545" x2="15.9995" y2="29.0011">
-	<stop  offset="0" style="stop-color:#4EDEFF"/>
-	<stop  offset="1" style="stop-color:#048CC6"/>
-</linearGradient>
-<polygon fill="url(#SVGID_1_)" points="20,17 20,3 12,3 12,17 6,17 16,29 26,17 "/>
-<polygon opacity="0.4" fill="#FFFFFF" points="20,17 20,18 25.167,18 26,17 "/>
-<polygon opacity="0.4" fill="#FFFFFF" points="12,18 12,17 6,17 6.833,18 "/>
-<rect x="12" y="3" opacity="0.4" fill="#FFFFFF" width="8" height="1"/>
-</svg>
Binary file messagingapp/msgui/conversationview/resources/icons/video_icon.png has changed
--- a/messagingapp/msgui/conversationview/resources/new_item_frames/qtg_fr_list_new_item_b.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="8px" height="8px" viewBox="0 0 8 8" enable-background="new 0 0 8 8" xml:space="preserve">
-<defs>
-</defs>
-<g>
-	<rect fill="none" width="8" height="8"/>
-</g>
-<path fill="#4F9EB0" d="M0,4c0,2.2,1.8,4,4,4s4-1.8,4-4V0H0V4z"/>
-<path opacity="0.2" fill="#63BDCF" d="M4,5C2.346,5,1,3.654,1,2v2c0,1.654,1.346,3,3,3s3-1.346,3-3V2C7,3.654,5.654,5,4,5z"/>
-<path opacity="0.2" d="M7,4c0,1.654-1.346,3-3,3S1,5.654,1,4V0H0v4c0,2.2,1.8,4,4,4s4-1.8,4-4V0H7V4z"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/new_item_frames/qtg_fr_list_new_item_c.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="8px" height="8px" viewBox="0 0 8 8" enable-background="new 0 0 8 8" xml:space="preserve">
-<defs>
-</defs>
-<g>
-	<rect fill="none" width="8" height="8"/>
-</g>
-<rect fill="#4F9EB0" width="8" height="8"/>
-<rect x="7" opacity="0.2" width="1" height="8"/>
-<rect opacity="0.2" width="1" height="8"/>
-</svg>
--- a/messagingapp/msgui/conversationview/resources/new_item_frames/qtg_fr_list_new_item_t.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="8px" height="8px" viewBox="0 0 8 8" enable-background="new 0 0 8 8" xml:space="preserve">
-<defs>
-</defs>
-<g>
-	<rect fill="none" width="8" height="8"/>
-</g>
-<path fill="#4F9EB0" d="M8,4c0-2.2-1.8-4-4-4S0,1.8,0,4v4h8V4z"/>
-<path fill="#63BDCF" d="M4,1C2.346,1,1,2.346,1,4v1c0-1.654,1.346-3,3-3s3,1.346,3,3V4C7,2.346,5.654,1,4,1z"/>
-<path opacity="0.2" d="M1,4c0-1.654,1.346-3,3-3s3,1.346,3,3v4h1V4c0-2.2-1.8-4-4-4S0,1.8,0,4v4h1V4z"/>
-</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/conversationview/resources/qtg_anim_loading.axml	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,14 @@
+<animations>
+<icon name="qtg_anim_loading" frame_duration="50" playmode="loop">
+<frame>qtg_anim_loading_1</frame>
+<frame>qtg_anim_loading_2</frame>
+<frame>qtg_anim_loading_3</frame>
+<frame>qtg_anim_loading_4</frame>
+<frame>qtg_anim_loading_5</frame>
+<frame>qtg_anim_loading_6</frame>
+<frame>qtg_anim_loading_7</frame>
+<frame>qtg_anim_loading_8</frame>
+<frame>qtg_anim_loading_9</frame>
+<frame>qtg_anim_loading_10</frame>
+</icon>
+</animations>
--- a/messagingapp/msgui/conversationview/resources/xml/conversationview_effect.fxml	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-<layers>
-    <visual src="input1">
-        <param name="translation_x" type="anim" ref="visual.width">
-            <duration>1</duration>
-            <style>linear</style>
-
-            <keyframe at="0.0">-1.5</keyframe>
-            <keyframe at="0.5">-0.05</keyframe>
-            <keyframe at="1.0">0</keyframe>
-
-        </param>
-        <param name="translation_y">0</param>
-        <param name="translation_z">0</param>
-      </visual>
-</layers>
\ No newline at end of file
--- a/messagingapp/msgui/conversationview/src/msgcontactcardwidget.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/conversationview/src/msgcontactcardwidget.cpp	Mon May 03 12:29:07 2010 +0300
@@ -21,35 +21,70 @@
 #include <HbStyle>
 #include <HbIconItem>
 #include <HbTextItem>
-#include <HbPushButton>
 #include <HbFrameDrawer>
+#include <HbGesture>
+#include <HbGestureSceneFilter>
+#include <HbWidgetFeedback>
+#include <HbFrameItem>
+#include <qmobilityglobal.h>
+#include <qcontactphonenumber.h>
+#include <qcontactfilter.h>
+#include <qcontactmanager.h>
+#include <qcontactdetailfilter.h>
+#include <xqaiwrequest.h>
+#include <xqappmgr.h>
+#include <XQServiceRequest.h>
+#include <cntservicescontact.h>
+#include <QGraphicsSceneMouseEvent>
+#include <HbMenu>
+#include <HbMainWindow>
+
+#include <ccsdefs.h>
 
 // USER INCLUDES
 #include "conversationsenginedefines.h"
 #include "debugtraces.h"
 #include "conversationsengine.h"
+#include "convergedmessage.h"
+
+QTM_USE_NAMESPACE
 
 // LOCAL CONSTANTS
-const QString DEFAULT_AVATAR_ICON(":/icons/qtg_large_avatar.svg");
-const QString ONLINE_ICON(":/icons/qtg_small_online.svg");
-const QString OFFLINE_ICON(":/icons/qtg_small_offline.svg");
-const QString BACKGROUND_FRAME("qtg_fr_list_normal");
+const QString DEFAULT_AVATAR_ICON("qtg_large_avatar");
+const QString BT_ICON("qtg_large_bluetooth");
+const QString BACKGROUND_FRAME_NORMAL("qtg_fr_groupbox");
+const QString GROUPBOX_BG_FRAME_PRESSED("qtg_fr_groupbox_pressed");
+
 const QString PLUGINPATH("conversationviewplugin.dll");
 
+// LOCALIZATION CONSTANTS
+#define LOC_RECEIVED_FILES hbTrId("txt_messaging_title_received_files")
+#define LOC_MENU_CONTACT_INFO hbTrId("txt_messaging_menu_open_contact_info")
+#define LOC_COMMON_MENU_CALL hbTrId("txt_common_menu_call_verb")
+#define LOC_SAVETO_CONTACTS hbTrId("txt_messaging_menu_save_to_contacts")
+
 //---------------------------------------------------------------
 // MsgContactCardWidget::MsgContactCardWidget
 // @see header
 //---------------------------------------------------------------
 MsgContactCardWidget::MsgContactCardWidget(QGraphicsItem *parent) :
-    HbAbstractButton(parent), mAvatarIconItem(NULL),
-    mPresenceIconItem(NULL),
-    mAddressTextItem(NULL)
+HbWidget(parent), 
+mMenuShown(false),
+mAvatarIconItem(NULL),
+mPresenceIconItem(NULL),
+mAddressTextItem(NULL),
+mGestureFilter(NULL)
+
 {
     int baseId = style()->registerPlugin(PLUGINPATH);
     QDEBUG_WRITE_FORMAT("MsgContactCardWidget BASE ID --->", baseId);
     setPluginBaseId(baseId);
 
-    init();
+    init();  
+    setBackGround(BACKGROUND_FRAME_NORMAL);
+    connectSignals(true);
+    
+    connect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(initGesture()));   
 }
 
 //---------------------------------------------------------------
@@ -59,6 +94,11 @@
 MsgContactCardWidget::~MsgContactCardWidget()
 {
     style()->unregisterPlugin(PLUGINPATH);
+    
+    if(mGestureFilter)
+        {
+        removeSceneEventFilter(mGestureFilter);
+        }
 }
 
 //---------------------------------------------------------------
@@ -76,16 +116,6 @@
     mAddressTextItem = new HbTextItem(this);
     HbStyle::setItemName(mAddressTextItem, "addressText");
 
-    mBackgroundItem = new HbPushButton(this);
-    HbStyle::setItemName(mBackgroundItem, "backgroundFrame");
-
-    HbFrameDrawer *frameDrawer = new HbFrameDrawer(BACKGROUND_FRAME,
-        HbFrameDrawer::NinePieces);
-
-    mBackgroundItem->setFrameBackground(frameDrawer);
-
-    connect(mBackgroundItem, SIGNAL(clicked(bool)),
-        this, SIGNAL(clicked()));
 }
 
 //---------------------------------------------------------------
@@ -123,10 +153,9 @@
 ConvergedMessageAddressList MsgContactCardWidget::address()
 {
     ConvergedMessageAddressList addresses;
-    QModelIndex index = 
-            ConversationsEngine::instance()->getConversationsModel()->index(0, 0);
-    ConvergedMessageAddress* address = new ConvergedMessageAddress(index.data(
-        ConversationAddress).toString());
+    QModelIndex index = ConversationsEngine::instance()->getConversationsModel()->index(0, 0);
+    ConvergedMessageAddress* address = new ConvergedMessageAddress(
+        index.data(ConversationAddress).toString());
     address->setAlias(mAddress);
     addresses.append(address);
     return addresses;
@@ -139,60 +168,52 @@
 void MsgContactCardWidget::updateContents()
 {
     // Get the Model Index
-    QModelIndex index = 
-                ConversationsEngine::instance()->getConversationsModel()->index(0, 0);
-        
-    //Set the Contact Name/Number
-    qint64 convId ;
-    QString firstName;
-    QString lastName;
-    QString contactAddress;
-    convId = ConversationsEngine::instance()->getCurrentConversationId();
-    ConversationsEngine::instance()->getContactDetails(convId,firstName,
-        lastName,contactAddress);    
-    //QString contactAddress = index.data(ConversationAddress).toString();
-    QString nickName;// = index.data(NickName).toString(); TODO
-    QString contactName;
-    if (!nickName.isEmpty())
-    {
-        contactName.append(nickName);
+    QModelIndex index = ConversationsEngine::instance()->getConversationsModel()->index(0, 0);
+
+    // Index is not valid, return.
+    if (!index.isValid()) {
+        return;
     }
-    else if (firstName.isEmpty() && lastName.isEmpty())
-    {
-        contactName.append(contactAddress);
-    }
-    else if (lastName.isEmpty() && !firstName.isEmpty())
-    {
-        contactName.append(firstName);
+
+    qint64 convId = ConversationsEngine::instance()->getCurrentConversationId();
+
+    if (KBluetoothMsgsConversationId == convId) {
+        setAddress(LOC_RECEIVED_FILES);
+        setAvatar(HbIcon(BT_ICON));
     }
-    else if (firstName.isEmpty() && !lastName.isEmpty())
-    {
-        contactName.append(lastName);
-    }
-    else
-    {
-        // If both first Name and last name are present
-        contactName.append(firstName);
-        contactName.append(" ");
-        contactName.append(lastName);
-    }
-    setAddress(contactName);
+    else {
+        //Set the Contact Name/Number
+        qint64 convId;
+        QString displayName;
+        QString contactAddress;
+        convId = ConversationsEngine::instance()->getCurrentConversationId();
+        ConversationsEngine::instance()->getContactDetails(convId, displayName,
+            contactAddress);
+        
+        mContactNumber = contactAddress;
+        QString contactName;
+        if (displayName.isEmpty()) {
+            contactName.append(contactAddress);
+        }
+        else {
+            contactName.append(displayName);
+        }
+        
+        setAddress(contactName);
 
-    QByteArray avatarByteArray = index.data(Avatar).toByteArray();
-
-    HbIcon avatar;
-    if (avatarByteArray.isEmpty())
-    {
-        avatar = HbIcon(DEFAULT_AVATAR_ICON);
+        // Set Avatar
+        HbIcon avatar;
+        QByteArray avatarByteArray = index.data(Avatar).toByteArray();
+        if (avatarByteArray.isEmpty()) {
+            avatar = HbIcon(DEFAULT_AVATAR_ICON);
+        }
+        else {
+            QPixmap pixmap;
+            pixmap.loadFromData(avatarByteArray);
+            avatar = HbIcon(QIcon(pixmap));
+        }
+        setAvatar(avatar);
     }
-    else
-    {
-        QPixmap pixmap;
-        pixmap.loadFromData(avatarByteArray);
-        avatar = HbIcon(QIcon(pixmap));
-    }
-    setAvatar(avatar);
-    
 }
 
 //---------------------------------------------------------------
@@ -201,7 +222,297 @@
 //---------------------------------------------------------------
 void MsgContactCardWidget::clearContent()
 {
-	  setAddress("");
-	  setAvatar(HbIcon());
+    setAddress("");
+    setAvatar(HbIcon());
+}
+
+//---------------------------------------------------------------
+// MsgContactCardWidget::initGesture
+// @see header file
+//---------------------------------------------------------------
+void MsgContactCardWidget::initGesture()
+{
+    // Create gesture filter
+    QGraphicsScene* sc = this->scene();
+    mGestureFilter = new HbGestureSceneFilter( Qt::LeftButton, this );
+    
+    // Add gestures for longpress
+    HbGesture* gestureLongpressed = new HbGesture( HbGesture::longpress,5 );
+    
+    mGestureFilter->addGesture( gestureLongpressed );
+    
+    connect( gestureLongpressed, SIGNAL(longPress(QPointF)),
+             this, SLOT(handleLongPress(QPointF)));
+
+    //install gesture filter.
+    this->installSceneEventFilter(mGestureFilter);
+    
+    disconnect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(initGesture()));   
+}
+
+//---------------------------------------------------------------
+// MsgContactCardWidget::mousePressEvent
+// @see header file
+//---------------------------------------------------------------
+void MsgContactCardWidget::mousePressEvent(QGraphicsSceneMouseEvent *event)
+{    
+    mMenuShown = false;
+    
+    HbWidgetFeedback::triggered(this, Hb::InstantPressed);
+    
+    setBackGround(GROUPBOX_BG_FRAME_PRESSED);
+    
+    event->accept();
+}
+
+
+//---------------------------------------------------------------
+// MsgContactCardWidget::mouseReleaseEvent
+// @see header file
+//---------------------------------------------------------------
+void MsgContactCardWidget::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
+{
+    setBackGround(BACKGROUND_FRAME_NORMAL);
+    
+    if(this->rect().contains(event->pos())&& !mMenuShown)
+        {
+        HbWidgetFeedback::triggered(this, Hb::InstantClicked);
+		emit clicked();
+        }
+    
+    event->accept();    
+}
+
+//---------------------------------------------------------------
+// MsgContactCardWidget::setBackGround
+// @see header file
+//---------------------------------------------------------------
+void MsgContactCardWidget::setBackGround(const QString& bg)
+    {
+    HbFrameItem* backGround = new HbFrameItem(this);
+    backGround->frameDrawer().setFrameGraphicsName(bg);
+    backGround->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
+    this->setBackgroundItem(backGround); 
+    this->repolish();
+    }
+
+//---------------------------------------------------------------
+// MsgContactCardWidget::handleLongPress
+// @see header file
+//---------------------------------------------------------------
+void MsgContactCardWidget::handleLongPress(QPointF position)
+{
+    if(KBluetoothMsgsConversationId 
+        != ConversationsEngine::instance()->getCurrentConversationId())    
+        {
+        HbMenu* contextMenu = new HbMenu();
+        contextMenu->setDismissPolicy(HbPopup::TapAnywhere);
+        contextMenu->setAttribute(Qt::WA_DeleteOnClose, true);
+        contextMenu->setPreferredPos(position);
+        
+        contextMenu->addAction(LOC_MENU_CONTACT_INFO,this, SLOT(openContactInfo()));    
+        contextMenu->addAction(LOC_COMMON_MENU_CALL, this, SLOT(call()));
+        
+        //If contact doesn't exist in phonebook then add another menu item "Save to Contacts"
+        int contactId = resolveContactId(mContactNumber);
+        if(contactId < 0)
+        {
+            contextMenu->addAction(LOC_SAVETO_CONTACTS, this, SLOT(addToContacts()));
+        }
+        
+        contextMenu->show();
+        
+        mMenuShown = true;
+        }
+}
+
+//---------------------------------------------------------------
+// MsgContactCardWidget::overrideFeedback
+// @see header file
+//---------------------------------------------------------------
+HbFeedback::InstantEffect MsgContactCardWidget::overrideFeedback(Hb::InstantInteraction interaction) const
+        {
+        switch(interaction)
+            {
+            case Hb::InstantPressed:
+            case Hb::InstantClicked:
+                return HbFeedback::Basic;
+            default:
+                return HbFeedback::NoOverride;
+            }
+        }
+		
+//---------------------------------------------------------------
+// MsgContactCardWidget::openContactInfo
+// @see header
+//---------------------------------------------------------------
+void MsgContactCardWidget::openContactInfo()
+{
+    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)");
+            args << contactId;
+        }
+        else
+        {
+            //populate data and open unknown contact template
+            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
+        if ( request == NULL )
+        {
+        	return;       
+        }
+        
+        // Result handlers
+        connect (request, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleOk(const QVariant&)));
+        connect (request, SIGNAL(requestError(const QVariant&)), this, SLOT(handleError(const QVariant&)));
+        
+        request->setArguments(args);
+        request->send();
+        delete request;
+    }
+}
+
+//---------------------------------------------------------------
+// MsgContactCardWidget::resolveContactId
+// @see header
+//---------------------------------------------------------------
+int MsgContactCardWidget::resolveContactId(const QString& value)
+{
+    int contactId = -1;
+    
+    QContactManager phonebookManager("symbian");
+    
+    QContactDetailFilter phoneFilter;
+    phoneFilter.setDetailDefinitionName(QContactPhoneNumber::DefinitionName,
+                                        QContactPhoneNumber::FieldNumber);
+    phoneFilter.setValue(value);
+    phoneFilter.setMatchFlags(QContactFilter::MatchEndsWith);
+
+    QList<QContactSortOrder> sortOrder;
+    QList<QContact> matchingContacts = phonebookManager.contacts(
+            phoneFilter,
+            sortOrder,
+            QStringList());
+
+    if ( matchingContacts.count() > 0 ) 
+        {       
+        contactId = matchingContacts.at(0).localId();   
+        }
+    
+    return contactId;
+}
+
+//---------------------------------------------------------------
+// MsgContactCardWidget::call
+// @see header
+//---------------------------------------------------------------
+void MsgContactCardWidget::call()
+{
+    //Launch dialer service     
+    QString serviceName("com.nokia.services.telephony");
+    QString operation("dial(QString)");
+    
+    XQServiceRequest* serviceRequest = new XQServiceRequest(serviceName,operation,false);
+    
+    connect(serviceRequest, SIGNAL(requestCompleted(QVariant)),
+            this, SLOT(onServiceRequestCompleted()));
+    
+    connect(serviceRequest, SIGNAL(requestError(int)),
+            this, SLOT(onServiceRequestCompleted()));
+    
+    *serviceRequest << mContactNumber;
+    serviceRequest->send();
+}
+
+//---------------------------------------------------------------
+// MsgContactCardWidget::addToContacts
+// @see header
+//---------------------------------------------------------------
+void MsgContactCardWidget::addToContacts()
+{
+}
+
+//---------------------------------------------------------------
+// MsgContactCardWidget::handleOk
+// @see header
+//---------------------------------------------------------------
+void MsgContactCardWidget::handleOk(const QVariant& result)
+{
+    Q_UNUSED(result)
+    
+    QContactManager phonebookManager("symbian");
+        
+    QContactDetailFilter phoneFilter;
+    phoneFilter.setDetailDefinitionName(QContactPhoneNumber::DefinitionName, 
+                                            QContactPhoneNumber::FieldNumber);
+    phoneFilter.setValue(mContactNumber);
+    phoneFilter.setMatchFlags(QContactFilter::MatchEndsWith);
+
+    QList<QContactSortOrder> sortOrder;
+    QList<QContact> matchingContacts = phonebookManager.contacts(phoneFilter,
+                                       sortOrder, QStringList());
+    
+    if(matchingContacts.count())
+    {
+        setAddress(matchingContacts.at(0).displayLabel());
+    }
+}
+
+//---------------------------------------------------------------
+// MsgContactCardWidget::handleError
+// @see header
+//---------------------------------------------------------------
+void MsgContactCardWidget::handleError(int errorCode, const QString& errorMessage)
+    {
+    Q_UNUSED(errorMessage)
+    Q_UNUSED(errorCode)
+    }
+	
+//---------------------------------------------------------------
+// MsgContactCardWidget::onServiceRequestCompleted
+// @see header
+//---------------------------------------------------------------
+void MsgContactCardWidget::onServiceRequestCompleted()
+{
+    //service request is now complete. delete it.
+    XQServiceRequest* request = qobject_cast<XQServiceRequest*>(sender());
+    if(request)
+    {
+        delete request;
+    }
+}
+
+//---------------------------------------------------------------
+// MsgContactCardWidget::connectSignals
+// @see header
+//---------------------------------------------------------------
+void MsgContactCardWidget::connectSignals(bool yes)
+{
+    if(yes)
+    {
+        connect(this,SIGNAL(clicked()),this,SLOT(openContactInfo()));
+    }
+    else
+    {
+        disconnect(this,SIGNAL(clicked()),this,SLOT(openContactInfo()));
+    }
 }
 // EOF
--- a/messagingapp/msgui/conversationview/src/msgconversationbaseview.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/conversationview/src/msgconversationbaseview.cpp	Mon May 03 12:29:07 2010 +0300
@@ -16,23 +16,32 @@
  */
 
 #include "msgconversationbaseview.h"
-#include "msguiutilsmanager.h"
 
 // SYSTEM INCLUDES
-#include <QSqlDatabase>
-#include <QSqlQuery>
-#include <QSqlError>
-#include <QtDebug>
 #include <QGraphicsLinearLayout>
+#include <HbMainWindow>
+#include <HbNotificationDialog>
+
+#include <xqaiwrequest.h>
+#include <xqappmgr.h>
+
+#include <cntservicescontact.h>
+#include <qtcontactsglobal.h>
+#include <qtcontacts.h>
+#include <ccsdefs.h>
 
 // USER INCLUDES
 #include "msgconversationview.h"
-//#include "convergedmessage.h"
 #include "conversationsengine.h"
 #include "msgviewdefines.h"
 #include "conversationsenginedefines.h"
 #include "msgcontactcardwidget.h"
 
+QTM_USE_NAMESPACE
+
+// LOCALIZATION
+#define LOC_SAVED_TO_DRAFTS    hbTrId("txt_messaging_dpopinfo_saved_to_drafts")
+
 //---------------------------------------------------------------
 // MsgConversationBaseView::MsgConversationBaseView
 // Constructor
@@ -41,7 +50,8 @@
 MsgBaseView(parent),
 mConversationView(NULL),
 mConversationId(-1)
-{   
+{ 
+    connect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(doDelayedConstruction()));   
     initView();
 }
 
@@ -59,9 +69,14 @@
 //---------------------------------------------------------------
 void MsgConversationBaseView::openConversation(qint64 convId)
 {
-    ConversationsEngine::instance()->getConversations(convId);    
+    ConversationsEngine::instance()->getConversations(convId);
     mConversationId = convId;
-    mConversationView->refreshView();
+    connect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(doDelayedConstruction()));
+    
+    if(mConversationView)
+        {
+        mConversationView->refreshView();
+        }
 }
 
 //---------------------------------------------------------------
@@ -70,26 +85,27 @@
 //---------------------------------------------------------------
 void MsgConversationBaseView::initView()
     {
+    
     // Create header widget
-    MsgContactCardWidget *contactCardWidget = new MsgContactCardWidget();
+    mContactCard = new MsgContactCardWidget(this);
 
-    connect(contactCardWidget, SIGNAL(clicked()), this, SLOT(openContactDetails()));
+    mMainLayout = new QGraphicsLinearLayout(Qt::Vertical);
 
-    QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(Qt::Vertical);
-
-    mainLayout->setContentsMargins(CONTENT_MARGIN, CONTENT_MARGIN,
+    qreal spacing = HbDeviceProfile::profile(this).unitValue();
+    mMainLayout->setSpacing(spacing);
+    mMainLayout->setContentsMargins(CONTENT_MARGIN, CONTENT_MARGIN,
                                    CONTENT_MARGIN, CONTENT_MARGIN);
 
-    mainLayout->setSpacing(CONTENT_SPACING);
-
-    mainLayout->addItem(contactCardWidget);
+    mMainLayout->addItem(mContactCard);
 
     /**
      * Create conversation view and connect to proper signals.
      * NOTE: contactCardWidget is NOT parent of MsgConversationView.
      * Just passing reference to MsgConversationView.
      */
-    mConversationView = new MsgConversationView(contactCardWidget);
+    mConversationView = new MsgConversationView(mContactCard);
+
+    mConversationView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
 
     connect(mConversationView, SIGNAL(closeConversationView()),
             this, SLOT(closeConversationView()));
@@ -99,12 +115,14 @@
 
     connect(mConversationView, SIGNAL(switchView(const QVariantList&)),
             this, SIGNAL(switchView(const QVariantList&)));
+    
+    connect(mConversationView,SIGNAL(hideChrome(bool)),this,SLOT(hideChrome(bool)));
 
     this->setMenu(mConversationView->menu());
 
-    mainLayout->addItem(mConversationView);
+    mMainLayout->addItem(mConversationView);
 
-    this->setLayout(mainLayout);
+    this->setLayout(mMainLayout);
 
 }
 
@@ -133,29 +151,21 @@
 // MsgConversationBaseView::saveContentToDrafts
 // saves the editors content to drafts
 //---------------------------------------------------------------
-bool MsgConversationBaseView::saveContentToDrafts()
+void MsgConversationBaseView::saveContentToDrafts()
     {
     bool result = false;
     if( mConversationId >= 0)
         {
         result = mConversationView->saveContentToDrafts();
         }
-    return result;
+    
+    if(result)
+        {
+        HbNotificationDialog::launchDialog(LOC_SAVED_TO_DRAFTS);
+        }
     }
 
 //---------------------------------------------------------------
-// MsgConversationBaseView::openContactDetails
-// close conversation view
-//---------------------------------------------------------------
-void MsgConversationBaseView::openContactDetails()
-{
-    MsgUiUtilsManager uiUtilsManager(this);
-    QModelIndex aIndex = ConversationsEngine::instance()->getConversationsModel()->index(0, 0);
-    qint32 contactId = aIndex.data(ContactId).toLongLong();
-    uiUtilsManager.openContactDetails(contactId);
-}
-
-//---------------------------------------------------------------
 // MsgConversationBaseView::clearContent
 // clears conversation view content
 //---------------------------------------------------------------
@@ -164,4 +174,64 @@
     ConversationsEngine::instance()->clearConversations();
     mConversationView->clearEditors();
 }
+
+//---------------------------------------------------------------
+// MsgConversationBaseView::handleOk
+//
+//---------------------------------------------------------------
+void MsgConversationBaseView::handleOk(const QVariant& result)
+    {
+    Q_UNUSED(result)
+    }
+
+//---------------------------------------------------------------
+// MsgConversationBaseView::handleError
+//
+//---------------------------------------------------------------
+void MsgConversationBaseView::handleError(int errorCode, const QString& errorMessage)
+    {
+    Q_UNUSED(errorMessage)
+    Q_UNUSED(errorCode)
+    }
+
+//---------------------------------------------------------------
+// MsgConversationBaseView::doDelayedConstruction
+//
+//---------------------------------------------------------------	
+void MsgConversationBaseView::doDelayedConstruction()
+{
+    disconnect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(doDelayedConstruction()));
+    ConversationsEngine::instance()->fetchMoreConversations();
+}
+
+//---------------------------------------------------------------
+// MsgConversationBaseView::hideChrome
+//
+//---------------------------------------------------------------
+void MsgConversationBaseView::hideChrome(bool hide)
+    {
+    if(hide)
+        {        
+        this->hideItems(Hb::StatusBarItem | Hb::TitleBarItem);
+        this->setContentFullScreen(true);
+        
+        if(this->mainWindow()->orientation() == Qt::Horizontal)
+            {
+            mMainLayout->removeItem(mContactCard);
+            mContactCard->hide();
+            }
+        }
+    else
+        {
+        this->showItems(Hb::StatusBarItem | Hb::TitleBarItem);
+        this->setContentFullScreen(false);
+        
+        if(!mContactCard->isVisible())
+            {
+            mMainLayout->insertItem(0,mContactCard);
+            mContactCard->show();
+            }
+        }
+    }
+
 // EOF
--- a/messagingapp/msgui/conversationview/src/msgconversationview.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/conversationview/src/msgconversationview.cpp	Mon May 03 12:29:07 2010 +0300
@@ -20,29 +20,29 @@
 // SYSTEM INCLUDES
 #include <HbMenu>
 #include <HbAction>
-#include <HbInstance>
-#include <HbApplication>
-#include <HbDialog>
-#include <HbLabel>
-#include <HbWidget>
 #include <HbListView>
-#include <hbmessagebox.h>
-#include <hbnotificationdialog.h>
-#include <HbEffect>
+#include <HbMessageBox>
+#include <HbNotificationDialog>
+#include <XQServiceRequest.h>
+#include <HbStaticVkbHost>
+#include <xqaiwrequest.h>
+#include <xqappmgr.h>
 
 #include <QDir>
-#include <QLibraryInfo>
-#include <QPluginLoader>
 #include <QDateTime>
 #include <QGraphicsLinearLayout>
 #include <QStandardItemModel>
 
+#include <cntservicescontact.h>
+#include <ccsdefs.h>
+#include <centralrepository.h>
+#include <MmsEngineDomainCRKeys.h>
+
 // USER INCLUDES
-#include "msguiutilsmanager.h"
+#include "msgsendutil.h"
 #include "msgconversationviewitem.h"
 #include "conversationsengine.h"
 #include "convergedmessageid.h"
-#include "convergedmessage.h"
 #include "conversationsenginedefines.h"
 #include "msgcontactcardwidget.h"
 #include "msgeditorwidget.h"
@@ -51,38 +51,40 @@
 #include "unidatamodelloader.h"
 #include "unidatamodelplugininterface.h"
 #include "ringbc.h"
+#include "mmsconformancecheck.h"
 
-// LOCAL CONSTANTS
-const QString M_SERVER("mserver");
-const QString SMS("sms");
+//Item specific menu.
 
 #define LOC_COMMON_OPEN hbTrId("txt_common_menu_open")
 #define LOC_COMMON_DELETE hbTrId("txt_common_menu_delete")
 #define LOC_COMMON_FORWARD hbTrId("txt_common_menu_forward")
-#define LOC_COMMON_SAVE hbTrId("txt_common_menu_save")
+#define LOC_COMMON_DOWNLOAD hbTrId("txt_messaging_menu_download")
+#define LOC_COMMON_SEND  hbTrId("txt_common_menu_send") 
 
-#define LOC_DELETE_CONVERSATION hbTrId("txt_messaging_dialog_delete_conversation")
 #define LOC_BUTTON_DELETE hbTrId("txt_common_button_delete")
 #define LOC_BUTTON_CANCEL hbTrId("txt_common_button_cancel")
+#define LOC_BUTTON_OK hbTrId("txt_common_button_ok")
 
 #define LOC_DELETE_MESSAGE hbTrId("txt_messaging_dialog_delete_message")
-#define LOC_DELETE_POPINFO hbTrId("txt_messaging_dpopinfo_message_deleted")
-
-const QString HELP(QObject::tr("Help"));
 
-#define LOC_ADD hbTrId("txt_messaging_opt_add")
-#define LOC_RECIPIENTS hbTrId("txt_messaging_opt_sub_recipients")
-#define LOC_SUBJECT hbTrId("txt_messaging_opt_sub_subject")
+//main menu
+#define LOC_ATTACH          hbTrId("txt_messaging_opt_attach")
+#define LOC_PHOTO           hbTrId("txt_messaging_opt_attach_sub_photo")
+#define LOC_SOUND           hbTrId("txt_messaging_opt_attach_sub_sound")
+#define LOC_VCARD           hbTrId("txt_messaging_list_business_card")
+#define LOC_ADD_RECIPIENTS  hbTrId("txt_messaging_opt_add_recipients")
+#define LOC_ADD_SUBJECT     hbTrId("txt_messaging_opt_add_subject")
 
-#define LOC_ATTACH hbTrId("txt_messaging_opt_attach")
-#define LOC_PHOTO hbTrId("txt_messaging_opt_attach_sub_photo")
-#define LOC_VIDEO hbTrId("txt_messaging_opt_attach_sub_video")
-#define LOC_SOUND hbTrId("txt_messaging_opt_attach_sub_sound")
-#define LOC_MORE hbTrId("txt_messaging_opt_attach_sub_more")
+#define LOC_MSG_SEND_FAILED hbTrId("txt_messaging_dpopinfo_sending_failed")
+
 
 const QString PLUGINPATH("conversationviewplugin.dll");
 
 const int INVALID_MSGID = -1;
+const int INVALID_CONVID = -1;
+const int CONTACT_INSERTION_MODE = 1;
+const int VCARD_INSERTION_MODE = 0;
+
 //---------------------------------------------------------------
 // MsgConversationView::MsgConversationView
 // @see header file
@@ -94,25 +96,16 @@
     mMessageModel(NULL),
     mEditorWidget(NULL),
     mContactCardWidget(contactCardWidget),
-    mUiUtilsManager(NULL)
+    mSendUtil(NULL),
+    mItemLongPressed(false),
+    mVkbHost(NULL),
+    mVkbopened(false)
 {
-    // Initialize the Utils manager
-    mUiUtilsManager = new MsgUiUtilsManager(this);
-    // connect the error signal from UtilsManager to the slot
-    // in the conversation view.
-    connect(mUiUtilsManager,
-            SIGNAL(serviceError(const QString&)),
-            this,
-            SLOT(serviceError(const QString&)));
-
-    connect(mUiUtilsManager, SIGNAL(imagesFetched(const QVariant&)),
-                     this, SLOT(imagesFetched(const QVariant&)));
-    connect(mUiUtilsManager, SIGNAL(audiosFetched(const QVariant&)),
-                     this, SLOT(audiosFetched(const QVariant&)));
-
+    //create send utils
+    mSendUtil = new MsgSendUtil(this);
     //initialize view
     setupView();
-    addMenu();
+    setupMenu();
 }
 
 //---------------------------------------------------------------
@@ -121,7 +114,7 @@
 //---------------------------------------------------------------
 MsgConversationView::~MsgConversationView()
 {
-mConversationList->setModel(NULL);    
+    
 }
 //---------------------------------------------------------------
 // MsgConversationView::setupView
@@ -140,83 +133,61 @@
     mConversationList->setClampingStyle(HbScrollArea::BounceBackClamping);
     mConversationList->setScrollingStyle(HbScrollArea::PanOrFlick);
 
-
     mMessageModel = ConversationsEngine::instance()->getConversationsModel();
     
     connect(ConversationsEngine::instance(), 
-        SIGNAL(conversationModelPopulated()), 
-        this, 
-        SLOT(populateConversationsView()));
+            SIGNAL(conversationModelPopulated()), 
+            this, 
+            SLOT(populateConversationsView()));
     
     connect(mConversationList, SIGNAL(activated(QModelIndex)),
-        this, SLOT(openItem(QModelIndex)));
+            this, SLOT(openItem(QModelIndex)));
 
     // Long tap list item
     connect(mConversationList, SIGNAL(longPressed(HbAbstractViewItem*, QPointF)),
-        this, SLOT(longPressed(HbAbstractViewItem*, QPointF)));
+            this, SLOT(longPressed(HbAbstractViewItem*, QPointF)));
 
-    // Create message editor widget.
-    mEditorWidget = new MsgEditorWidget();
+    // Create message editor widget, will be displayed based on msg type.
+    mEditorWidget = new MsgEditorWidget(this);
+    mEditorWidget->hide();
 
     connect(mEditorWidget, SIGNAL(sendMessage()), this, SLOT(send()));
+    connect(mEditorWidget, SIGNAL(smsCharLimitReached()), 
+        this, SLOT(handleSmsCharLimitReached()));
     connect(mEditorWidget, SIGNAL(replyStarted()), this, SIGNAL(replyStarted()));
 
-    QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(Qt::Vertical);
-    mainLayout->setContentsMargins(CONTENT_MARGIN, CONTENT_MARGIN,
-        CONTENT_MARGIN, CONTENT_MARGIN);
-    mainLayout->setSpacing(CONTENT_SPACING);
-    mainLayout->addItem(mConversationList);
-    mainLayout->addItem(mEditorWidget);
-    setLayout(mainLayout);
+    qreal spacing = HbDeviceProfile::profile(mConversationList).unitValue();
+    
+    mMainLayout = new QGraphicsLinearLayout(Qt::Vertical,this); 
+    
+    mMainLayout->setContentsMargins(CONTENT_MARGIN, CONTENT_MARGIN,
+                                    CONTENT_MARGIN, CONTENT_MARGIN);   
+    mMainLayout->setSpacing(spacing);
+
+    mMainLayout->addItem(mConversationList);
+
+    setLayout(mMainLayout);
+
+    //Create VKB instance and listen to VKB open and close signals for resizing the view.
+    mVkbHost = new HbStaticVkbHost(this);
+	connect(mVkbHost, SIGNAL(keypadOpened()), this, SLOT(vkbOpened()));
+	connect(mVkbHost, SIGNAL(keypadClosed()), this, SLOT(vkbClosed()));
 
     // Refresh view to show the header details
     refreshView();
-    
-    HbEffect::add(QString("ConversationView"), 
-                      QString(":/xml/conversationview_effect.fxml"), 
-                      QString("show") );
 }
 
 //---------------------------------------------------------------
 // MsgConversationView::addMenu
 // @see header file
 //---------------------------------------------------------------
-void MsgConversationView::addMenu()
+void MsgConversationView::setupMenu()
 {
-    HbMenu *mainMenu = new HbMenu();
-
-    // Clear conversation 
-    HbAction* clearConversation = mainMenu->addAction(LOC_COMMON_DELETE);
-    connect(clearConversation, SIGNAL(triggered()), this, SLOT(deleteAll()));
-
-    // Attach sub-menu
-    HbMenu *attachSubMenu = mainMenu->addMenu(LOC_ATTACH);
-
-    HbAction *addPhoto = attachSubMenu->addAction(LOC_PHOTO);
-    connect(addPhoto, SIGNAL(triggered()),mUiUtilsManager, SLOT(fetchImages()));
-
-    HbAction *addVideo = attachSubMenu->addAction(LOC_VIDEO);
-    connect(addVideo, SIGNAL(triggered()),mUiUtilsManager, SLOT(fetchVideo()));
-
-    HbAction *addSound = attachSubMenu->addAction(LOC_SOUND);
-    connect(addSound, SIGNAL(triggered()),mUiUtilsManager, SLOT(fetchAudio()));
-
-    HbAction *addOther = attachSubMenu->addAction(LOC_MORE);
-    connect(addOther, SIGNAL(triggered()),mUiUtilsManager, SLOT(fetchOther()));
-
-    HbMenu *addSubMenu = mainMenu->addMenu(LOC_ADD);
-    
-    HbAction *addRecipients = addSubMenu->addAction(LOC_RECIPIENTS);
-    connect(addRecipients, SIGNAL(triggered()), this, SLOT(addRecipients()));
-
-    HbAction *addSubject = addSubMenu->addAction(LOC_SUBJECT);
-    connect(addSubject, SIGNAL(triggered()),this, SLOT(addSubject()));
-
-    // Help
-    HbAction* help = mainMenu->addAction(HELP);
-    connect(help, SIGNAL(triggered()),this, SLOT(launchHelp()));
-
-    setMenu(mainMenu);
+    // Just create dummy menu.
+    // Actual menu will be created in menuAboutToShow()
+    HbMenu *mainMenu = this->menu();
+    HbAction* clearConversation = mainMenu->addAction(QString());
+    connect(mainMenu, SIGNAL(aboutToShow()), this, SLOT(menuAboutToShow()));
 }
 
 //---------------------------------------------------------------
@@ -225,9 +196,21 @@
 //---------------------------------------------------------------
 void MsgConversationView::refreshView()
 {
-    mContactCardWidget->updateContents();
-    mContactCardWidget->resize(mContactCardWidget->boundingRect().size());
-    scrollToBottom();
+    // Hide editor in case of BT conversations.
+    qint64 convId = ConversationsEngine::instance()->getCurrentConversationId();
+    if (INVALID_CONVID != convId) {
+        if (KBluetoothMsgsConversationId == convId) {
+            mMainLayout->removeItem(mEditorWidget);
+            mEditorWidget->hide();
+            mEditorWidget->setParent(this);
+        }
+        else {
+            mMainLayout->addItem(mEditorWidget);
+            mEditorWidget->setEncodingSettings();
+            mEditorWidget->show();
+        }
+        mContactCardWidget->updateContents();
+    }
 }
 
 //---------------------------------------------------------------
@@ -247,70 +230,185 @@
 //---------------------------------------------------------------
 void MsgConversationView::longPressed(HbAbstractViewItem* viewItem,
     const QPointF& point)
-{
+{    
+    mItemLongPressed = true;
+    
     MsgConversationViewItem* item = qgraphicsitem_cast<
             MsgConversationViewItem *> (viewItem);
 
-    bool inSide = false;
-
-    if (item)
-    {
-        inSide = item->containsPoint(point);
-    }
-
-    //If point is within the item then show the item-specific menu
-    if (this->isVisible() && inSide)
+    // Show the item-specific menu
+    if (this->isVisible())
     {
         //If message is in Sending state or is Scheduled to be sent later,
         //do not allow any operations on the message
         int sendingState = item->modelIndex().data(SendingState).toInt();
-        if(sendingState == ConvergedMessage::Suspended || 
-                sendingState == ConvergedMessage::Resend || 
-                sendingState == ConvergedMessage::Scheduled ||
-                sendingState == ConvergedMessage::Sending ||
-                sendingState == ConvergedMessage::Waiting)
-        {
-            return;
-        }
-        
         // Create new menu
-        HbMenu *contextMenu = new HbMenu();
+        HbMenu* contextMenu = new HbMenu();
+        setContextMenu(item, contextMenu, sendingState);
         
-        int messageType = item->modelIndex().data(MessageType).toInt();  
-             
-        // Add the menu items
-        HbAction *contextItem4 = contextMenu->addAction(LOC_COMMON_OPEN);
-        connect(contextItem4, SIGNAL(triggered()),
-            this, SLOT(openItem()));
-
-        HbAction *contextItem3 = contextMenu->addAction(LOC_COMMON_DELETE);
-        connect(contextItem3, SIGNAL(triggered()),
-                this, SLOT(deleteItem()));
-        
-        // for provisioning messages don't add forward option
-        if(messageType != ConvergedMessage::Provisioning &&
-                messageType != ConvergedMessage::RingingTone)
-            {
-            HbAction *contextItem2 = contextMenu->addAction(LOC_COMMON_FORWARD);
-            connect(contextItem2, SIGNAL(triggered()),
-                    this, SLOT(forwardMessage()));
-            }
-
-           
+        //Before showing menu reset the flag
+        mItemLongPressed = false;
         contextMenu->exec(point);
-
         // Cleanup
         delete contextMenu;
+
+    }
+    else
+    {
+        // For cases where the long tap check failed
+        mItemLongPressed = false;
     }
 }
 
 //---------------------------------------------------------------
+// MsgConversationView::setContextMenu
+// @see header
+//---------------------------------------------------------------
+
+void MsgConversationView::setContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState)
+{
+    addOpenItemToContextMenu(item , contextMenu,sendingState);
+    addResendItemToContextMenu(item, contextMenu, sendingState);
+    addForwardItemToContextMenu(item, contextMenu, sendingState);
+    addDownloadItemToContextMenu(item, contextMenu);
+    addDeleteItemToContextMenu(item, contextMenu, sendingState);  
+}
+
+//---------------------------------------------------------------
+// MsgEditorPrivate::addOpenItemToContextMenu
+// @see header
+//---------------------------------------------------------------
+
+void MsgConversationView::addOpenItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState)
+{
+    int direction = item->modelIndex().data(Direction).toInt();
+    int messageType = item->modelIndex().data(MessageType).toInt();
+    int messageSubType = item->modelIndex().data(MessageSubType).toInt();
+    
+    if((messageSubType == ConvergedMessage::VCal) ||
+        (messageSubType == ConvergedMessage::RingingTone) ||
+        (messageType == ConvergedMessage::MmsNotification))
+        {
+        return;
+        }
+    
+    if( (sendingState == ConvergedMessage::SentState ) ||
+        (sendingState == ConvergedMessage::Resend ) ||
+        (sendingState == ConvergedMessage::Failed ) ||
+        (direction == ConvergedMessage::Incoming))
+    {
+        HbAction *contextItem = contextMenu->addAction(LOC_COMMON_OPEN);
+        connect(contextItem, SIGNAL(triggered()),this, SLOT(openItem()));
+    }
+    
+}
+
+//---------------------------------------------------------------
+// MsgEditorPrivate::addResendItemToContextMenu
+// @see header
+//---------------------------------------------------------------
+
+void MsgConversationView::addResendItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState)
+{
+    Q_UNUSED(item)
+    int direction = item->modelIndex().data(Direction).toInt();
+    
+    if( (direction == ConvergedMessage::Outgoing)&&
+        ((sendingState == ConvergedMessage::Resend ) ||
+        (sendingState == ConvergedMessage::Suspended )||
+        (sendingState == ConvergedMessage::Failed )))
+    {
+        HbAction *contextItem = contextMenu->addAction(LOC_COMMON_SEND);
+        connect(contextItem, SIGNAL(triggered()),this, SLOT(resendMessage()));
+    }
+}
+
+//---------------------------------------------------------------
+// MsgEditorPrivate::addForwardItemToContextMenu
+// @see header
+//---------------------------------------------------------------
+void MsgConversationView::addForwardItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState)
+{
+    int messageType = item->modelIndex().data(MessageType).toInt();
+    int direction = item->modelIndex().data(Direction).toInt();
+    int messageSubType = item->modelIndex().data(MessageSubType).toInt();
+    
+    if( (messageType == ConvergedMessage::BT) ||
+        (messageType == ConvergedMessage::MmsNotification) ||
+        (messageSubType == ConvergedMessage::Provisioning ) ||
+        (messageSubType == ConvergedMessage::RingingTone) ||
+        (messageSubType == ConvergedMessage::VCal))
+    {
+        return;
+    }
+    
+    qint32 messageId = item->modelIndex().data(ConvergedMsgId).toInt();
+
+    if( ((sendingState == ConvergedMessage::SentState) ||
+        (sendingState == ConvergedMessage::Resend) ||
+        (sendingState == ConvergedMessage::Failed) ||
+        (direction == ConvergedMessage::Incoming) ) &&
+        (validateMsgForForward(messageType,messageId))	)
+    {
+        HbAction *contextItem = contextMenu->addAction(LOC_COMMON_FORWARD);
+        connect(contextItem, SIGNAL(triggered()),this, SLOT(forwardMessage()));
+    }
+
+}
+
+//---------------------------------------------------------------
+// MsgEditorPrivate::addDeleteItemToContextMenu
+// @see header
+//---------------------------------------------------------------
+void MsgConversationView::addDeleteItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu, int sendingState)
+{
+    int direction = item->modelIndex().data(Direction).toInt();
+    int messageType = item->modelIndex().data(MessageType).toInt();
+    int notificationState = item->modelIndex().data(NotificationStatus).toInt();
+    
+    if( (messageType == ConvergedMessage::MmsNotification) && 
+        ((notificationState == ConvergedMessage::NotifNull) || 
+         (notificationState ==  ConvergedMessage::NotifRetrieving) ||
+         (notificationState == ConvergedMessage::NotifWaiting)))
+    {
+        return;
+    }
+    
+    if( (sendingState == ConvergedMessage::SentState) ||
+        (sendingState == ConvergedMessage::Resend) ||
+        (sendingState == ConvergedMessage::Suspended) ||
+        (sendingState == ConvergedMessage::Failed) ||
+        (direction == ConvergedMessage::Incoming))
+    {
+        HbAction *contextItem = contextMenu->addAction(LOC_COMMON_DELETE);
+        connect(contextItem, SIGNAL(triggered()),this, SLOT(deleteItem()));
+    }  
+}
+
+//---------------------------------------------------------------
+// MsgEditorPrivate::addDownloadItemToContextMenu
+// @see header
+//---------------------------------------------------------------
+void MsgConversationView::addDownloadItemToContextMenu(MsgConversationViewItem* item, HbMenu* contextMenu)
+{
+    int notificationState = item->modelIndex().data(NotificationStatus).toInt();
+    int messageType = item->modelIndex().data(MessageType).toInt();
+    qint32 messageId = item->modelIndex().data(ConvergedMsgId).toLongLong();
+        
+    if( messageType == ConvergedMessage::MmsNotification &&
+        ConversationsEngine::instance()->downloadOperationSupported(messageId))
+    {            
+        HbAction *contextItem = contextMenu->addAction(LOC_COMMON_DOWNLOAD);
+        connect(contextItem, SIGNAL(triggered()),this, SLOT(downloadMessage()));
+    }
+}
+//---------------------------------------------------------------
 // MsgEditorPrivate::send
 // @see header
 //---------------------------------------------------------------
 void MsgConversationView::send()
 {
-    mUiUtilsManager->activateInputBlocker(this);
+    activateInputBlocker();
     ConvergedMessageAddressList addresses;
     addresses = mContactCardWidget->address();
     int sendResult = KErrNone;
@@ -323,48 +421,197 @@
         msg.addToRecipients(addresses);
 
         // Send
-        sendResult = mUiUtilsManager->send(msg);
+        sendResult = mSendUtil->send(msg);
+                   
         if( sendResult == KErrNone)
         {
             mEditorWidget->clear();
         }
     }
-    mUiUtilsManager->deactivateInputBlocker();
+    deactivateInputBlocker();
     if( sendResult == KErrNotFound)
     {
-        //switch to settings view
-        QVariantList param;
-        param << MsgBaseView::MSGSETTINGS;
-        param << MsgBaseView::CV;
-        emit switchView(param);
+    bool result = HbMessageBox::question("SMS Settings not defined\nDefine now ?",
+            LOC_BUTTON_OK,
+            LOC_BUTTON_CANCEL);
+        if (result)
+        {
+            //switch to settings view
+            QVariantList param;
+            param << MsgBaseView::MSGSETTINGS;
+            param << MsgBaseView::CV;
+            emit switchView(param);
+        }
+    }
+}
+
+//---------------------------------------------------------------
+// MsgConversationView::contactsFetchedForVCards
+// @see header file
+//---------------------------------------------------------------
+void MsgConversationView::contactsFetchedForVCards(const QVariant& value)
+{
+    // get received contact-list and launch unieditor
+    CntServicesContactList contactList = 
+            qVariantValue<CntServicesContactList>(value);
+    int cntCount = contactList.count();
+    if(cntCount > 0)
+    {
+        QVariantList params;
+        params << MsgBaseView::ADD_VCARD;
+        params << value;
+        launchUniEditor(params);        
     }
 }
 
 //---------------------------------------------------------------
-// MsgConversationView::deleteAll
-// Deletes all the conversations
+// MsgConversationView::fetchContacts
+// @see header file
 //---------------------------------------------------------------
-void MsgConversationView::deleteAll()
+void MsgConversationView::fetchContacts()
+{
+    HbAction* action = qobject_cast<HbAction*>(sender());
+
+    if(!action)
+        return;
+
+    QList<QVariant> args;
+    QString serviceName("com.nokia.services.phonebookservices");
+    QString operation("fetch(QString,QString,QString)");
+    XQAiwRequest* request;
+    XQApplicationManager appManager;
+    request = appManager.create(serviceName, "Fetch", operation, true); //embedded
+    if ( request == NULL )
+    {
+        return;       
+    }
+
+    int mode = action->data().toInt();
+    
+    if( VCARD_INSERTION_MODE == mode) //vcard-insert mode
+    {
+        connect(request, SIGNAL(requestOk(const QVariant&)),
+            this, SLOT(contactsFetchedForVCards(const QVariant&)));      
+    }
+    else  //contact-insert mode
     {
-    bool result = HbMessageBox::question(LOC_DELETE_CONVERSATION,
-                             LOC_BUTTON_DELETE,
-                             LOC_BUTTON_CANCEL);
-    if(result)
-        {      
-        ConversationsEngine* engine = ConversationsEngine::instance();    
-        engine->deleteConversations(engine->getCurrentConversationId());
-        //show dialog
-        HbNotificationDialog::launchDialog("Conversation Deleted");
-        //switch to CLV
-        QVariantList param;
-        param << MsgBaseView::CLV; // target view
-        param << MsgBaseView::CV;  // source view
-        emit switchView(param);
-        }
+        connect(request, SIGNAL(requestOk(const QVariant&)),
+            this, SLOT(contactsFetched(const QVariant&)));
+    }
+    connect (request, SIGNAL(requestError(int,const QString&)), 
+        this, SLOT(serviceRequestError(int,const QString&)));
+
+    args << QString(tr("Phonebook")); 
+    args << KCntActionAll;
+    args << KCntFilterDisplayAll;
+
+    request->setArguments(args);
+    request->send();
+    delete request;
+}
+//---------------------------------------------------------------
+// MsgConversationView::fetchImages
+// @see header file
+//---------------------------------------------------------------
+void MsgConversationView::fetchImages()
+{
+    QString interface("Image");
+    QString operation("fetch(QVariantMap,QVariant)");
+    XQAiwRequest* request = NULL;
+    XQApplicationManager appManager;
+    request = appManager.create(interface, operation, true);//embedded
+    if(!request)
+    {
+        QDEBUG_WRITE("AIW-ERROR: NULL request");
+        return;
     }
 
+    connect(request, SIGNAL(requestOk(const QVariant&)),
+        this, SLOT(imagesFetched(const QVariant&)));
+    connect(request, SIGNAL(requestError(int,const QString&)),
+        this, SLOT(serviceRequestError(int,const QString&)));
+   
+    // Make the request
+    if (!request->send())
+    {
+        QDEBUG_WRITE_FORMAT("AIW-ERROR: Request Send failed:" , request->lastError());
+    }  
+    delete request;
+}
+
 //---------------------------------------------------------------
-// MsgConversationView::addPhoto()
+// MsgConversationView::fetchAudio
+// @see header file
+//---------------------------------------------------------------
+void MsgConversationView::fetchAudio()
+{
+    QString service("Music Fetcher");
+    QString interface("com.nokia.services.media.Music");
+    QString operation("fetch(QString)");
+    XQAiwRequest* request = NULL;
+    XQApplicationManager appManager;
+    request = appManager.create(service, interface, operation, true); //embedded
+    if(!request)
+    {
+        QDEBUG_WRITE("AIW-ERROR: NULL request");
+        return;
+    }
+
+    connect(request, SIGNAL(requestOk(const QVariant&)),
+        this, SLOT(audiosFetched(const QVariant&)));
+    connect(request, SIGNAL(requestError(int,const QString&)),
+        this, SLOT(serviceRequestError(int,const QString&)));
+
+    // Make the request
+    if (!request->send())
+    {
+        QDEBUG_WRITE_FORMAT("AIW-ERROR: Request Send failed  ",request->lastError());
+    }
+    delete request;
+}
+
+//---------------------------------------------------------------
+// MsgConversationView::contactsFetched
+// @see header file
+//---------------------------------------------------------------
+void MsgConversationView::contactsFetched(const QVariant& value)
+{
+    CntServicesContactList contactList;
+    contactList = qVariantValue<CntServicesContactList>(value);
+    ConvergedMessageAddressList addresses;
+	int count = contactList.count();
+	if(count > 0)
+      {
+	  ConvergedMessageAddress* address = new ConvergedMessageAddress;
+      address->setAlias(mContactCardWidget->address().at(0)->alias());
+      address->setAddress(mContactCardWidget->address().at(0)->address());
+      addresses.append(address);
+    	for(int i = 0; i < contactList.count(); i++ )
+	    {
+	    ConvergedMessageAddress* address = new ConvergedMessageAddress;
+	    address->setAlias(contactList[i].mDisplayName);
+	    address->setAddress(contactList[i].mPhoneNumber);
+	    addresses.append(address);
+	    }
+
+      ConvergedMessage message;
+      message.setBodyText(mEditorWidget->content());
+      message.addToRecipients(addresses);//takes the ownership of list elements
+      QByteArray dataArray;
+      QDataStream messageStream
+      (&dataArray, QIODevice::WriteOnly | QIODevice::Append);
+      message.serialize(messageStream);
+      QVariantList params;
+      params << MsgBaseView::UNIEDITOR; // target view
+      params << MsgBaseView::CV; // source view
+      params << dataArray;
+      clearEditors();
+      emit switchView(params);
+     }    
+}
+
+//---------------------------------------------------------------
+// MsgConversationView::imagesFetched()
 // @see header file
 //---------------------------------------------------------------
 void MsgConversationView::imagesFetched(const QVariant& result )
@@ -374,8 +621,11 @@
         QStringList fileList = result.value<QStringList>();
         if ( fileList.size()>0 )
         {
-            QString filepath(fileList.at(0));
-            launchUniEditor(MsgBaseView::ADD_PHOTO, filepath);
+            QString filepath(QDir::toNativeSeparators(fileList.at(0)));
+            QVariantList params;
+            params << MsgBaseView::ADD_PHOTO;
+            params << filepath;
+            launchUniEditor(params);
         }
     }
 }
@@ -392,22 +642,15 @@
         if ( fileList.size()>0 && !fileList.at(0).isEmpty())
         {
             QString filepath(QDir::toNativeSeparators(fileList.at(0)));
-            launchUniEditor(MsgBaseView::ADD_AUDIO, filepath);
+            QVariantList params;
+            params << MsgBaseView::ADD_AUDIO;
+            params << filepath;
+            launchUniEditor(params);
         }
     }
 }
 
 //---------------------------------------------------------------
-// MsgConversationView::addRecipients()
-// @see header file
-//---------------------------------------------------------------
-void MsgConversationView::addRecipients()
-{
-    QString filepath;
-    launchUniEditor(MsgBaseView::ADD_RECIPIENTS, filepath);
-}
-
-//---------------------------------------------------------------
 // MsgConversationView::addSubject()
 // @see header file
 //---------------------------------------------------------------
@@ -415,24 +658,9 @@
 {
 
     QString filepath;
-    launchUniEditor(MsgBaseView::ADD_SUBJECT, filepath);
-}
-
-//---------------------------------------------------------------
-// MsgConversationView::launchHelp()
-// Launches the help content
-//---------------------------------------------------------------
-void MsgConversationView::launchHelp()
-{
-}
-
-//---------------------------------------------------------------
-// MsgConversationView::exitApp()
-// Exits the application
-//---------------------------------------------------------------
-void MsgConversationView::exitApp()
-{
-    HbApplication::quit();
+    QVariantList params;
+    params << MsgBaseView::ADD_SUBJECT;
+    launchUniEditor(params);
 }
 
 //---------------------------------------------------------------
@@ -441,6 +669,60 @@
 //---------------------------------------------------------------
 void MsgConversationView::forwardMessage()
 {
+    QModelIndex index = mConversationList->currentIndex();
+    //messageId & messageType to be forwarded
+    qint32 messageId = index.data(ConvergedMsgId).toLongLong();
+    int messageType = index.data(MessageType).toInt();
+ 
+    //Mark the message to read before forwarding.
+    if(index.data(UnReadStatus).toBool())
+    {
+        QList<int> msgIdList;
+        msgIdList.append(messageId);
+        ConversationsEngine::instance()->markMessagesRead(msgIdList);
+    }
+    // populate params and launch editor 
+    QVariantList params;
+    params << MsgBaseView::FORWARD_MSG;
+    params << messageId;
+    params << messageType;
+    launchUniEditor(params);
+}
+
+//---------------------------------------------------------------
+// MsgConversationView::resendMessage()
+// Resends the message in the failed messages case
+//---------------------------------------------------------------
+void MsgConversationView::resendMessage()
+{
+    QModelIndex index = mConversationList->currentIndex();
+    if(index.isValid())
+    {
+        qint32 messageId = index.data(ConvergedMsgId).toLongLong();    
+        if(!(ConversationsEngine::instance()->resendMessage(messageId)))
+        {
+            HbMessageBox::warning(LOC_MSG_SEND_FAILED);
+        }
+    }
+    
+}
+
+//---------------------------------------------------------------
+// MsgConversationView::downloadMessage()
+// @see header
+//---------------------------------------------------------------
+void MsgConversationView::downloadMessage()
+{
+    QModelIndex index = mConversationList->currentIndex();
+    if(index.isValid())
+    {
+        qint32 messageId = index.data(ConvergedMsgId).toLongLong();    
+        if(ConversationsEngine::instance()->downloadMessage(messageId)!=KErrNone)
+        {
+            HbMessageBox::warning("Message Retrieval Failed!"); //TODO: use logical str name
+        }
+    }
+    
 }
 
 //---------------------------------------------------------------
@@ -464,7 +746,6 @@
             QList<int> msgIdList;
             msgIdList.append(messageId);          
             ConversationsEngine::instance()->deleteMessages(msgIdList);
-            HbNotificationDialog::launchDialog(LOC_DELETE_POPINFO);
             //switch view               
             if (count == 1)
                 {
@@ -488,15 +769,6 @@
 }
 
 //---------------------------------------------------------------
-// MsgConversationView::setMessageData()
-// Set message data
-//---------------------------------------------------------------
-void MsgConversationView::setMessageData(const ConvergedMessage &message)
-{
-    mEditorWidget->setContent(message.bodyText());
-}
-
-//---------------------------------------------------------------
 // MsgConversationView::clearEditors()
 // @See header
 //---------------------------------------------------------------
@@ -516,7 +788,7 @@
     int msgId = INVALID_MSGID;
     if(!mEditorWidget->content().isEmpty())
     {
-        mUiUtilsManager->activateInputBlocker(this);
+        activateInputBlocker();
         ConvergedMessageAddressList addresses;
         addresses = mContactCardWidget->address();
 
@@ -526,119 +798,78 @@
             ConvergedMessage msg;
             populateForSending(msg);
             msg.addToRecipients(addresses);
-
-            // Send
-            msgId = mUiUtilsManager->saveToDrafts(msg);
-
+            
+            // save to drafts
+            msgId = mSendUtil->saveToDrafts(msg);
+                     
             mEditorWidget->clear();
         }
-        mUiUtilsManager->deactivateInputBlocker();
+        deactivateInputBlocker();
     }
     return ((msgId > INVALID_MSGID)? true : false);
 }
 
 //---------------------------------------------------------------
-// MsgConversationView::loadCommandPlugin()
-// @See header
-//---------------------------------------------------------------
-bool MsgConversationView::loadCommandPlugin()
-{
-    /*
-#ifdef _DEBUG
-    QDir dir(QLibraryInfo::location(QLibraryInfo::PluginsPath));
-    dir.cd("messaging");
-#else
-    QDir dir("Z:/resource/qt/plugins/messaging");
-#endif
-#ifdef _DEBUG_TRACES_
-    qDebug() << "MsgConversationView::plugins path" << dir.path();
-#endif
-
-    // load the plugins
-    QFileInfoList entries = dir.entryInfoList(QDir::Files | QDir::Readable);
-    foreach (QFileInfo entry, entries)
-        {
-            QPluginLoader loader(entry.absoluteFilePath());
-#ifdef _DEBUG_TRACES_
-            qDebug() << "MsgConversationView::absolute path"
-                    << entry.absoluteFilePath();
-#endif
-            mMsgCmdPlugin = qobject_cast<MsgCommandPluginInterface*> (
-                loader.instance());
-            if (mMsgCmdPlugin)
-            {
-                return true;
-            }
-        }*/
-    return false;
-}
-
-//---------------------------------------------------------------
-//MsgConversationView::parseServiceId()
-//@see header
-//---------------------------------------------------------------
-QString MsgConversationView::parseServiceId(const QString &serviceId)
-{
-    QStringList services = serviceId.split('.');
-    // the service id is in the form "messaging.mserver.mms"
-    // split the string by '.' and compare the middle part
-    // by the server names.
-    return services[1];
-}
-
-//---------------------------------------------------------------
-//MsgConversationView::currentMessageType()
-//@see header
-//---------------------------------------------------------------
-int MsgConversationView::currentMessageType()
-{
-    QString serviceId = mEditorWidget->serviceId();
-    QString sendClientType = parseServiceId(serviceId);
-
-    ConvergedMessage::MessageType messageType = ConvergedMessage::None;
-    if ( (M_SERVER == sendClientType) && serviceId.contains(SMS))
-    {
-        messageType = ConvergedMessage::Sms;
-    }
-    return messageType;
-}
-//---------------------------------------------------------------
 //MsgConversationView::populateForSending()
 //@see header
 //---------------------------------------------------------------
 void MsgConversationView::populateForSending(ConvergedMessage &message)
 {
-    ConvergedMessage::MessageType messageType =
-            static_cast<ConvergedMessage::MessageType> (currentMessageType());
+    message.setMessageType(ConvergedMessage::Sms);
+    message.setBodyText(mEditorWidget->content());
+    message.setDirection(ConvergedMessage::Outgoing);
+    QDateTime time = QDateTime::currentDateTime();
+    message.setTimeStamp(time.toTime_t());
+}
 
-    if (ConvergedMessage::Sms == messageType)
-    {
-        message.setMessageType(messageType);
-        message.setBodyText(mEditorWidget->content());
-        message.setDirection(ConvergedMessage::Outgoing);
-        QDateTime time = QDateTime::currentDateTime();
-        message.setTimeStamp(time.toTime_t());
-    }
+//---------------------------------------------------------------
+//MsgConversationView::launchBtDisplayService()
+//@see header
+//---------------------------------------------------------------
+void MsgConversationView::launchBtDisplayService(const QModelIndex & index)
+{
+    qint32 messageId = index.data(ConvergedMsgId).toLongLong();
+
+    QString interface("com.nokia.services.btmsgdispservices.displaymsg");
+    QString operation("displaymsg(int)");
+
+    XQServiceRequest request(interface, operation, false);
+
+    request << messageId;
+
+    bool result = request.send();
 }
 
 //---------------------------------------------------------------
-// MsgConversationView::serviceError()
+// MsgConversationView::menuAboutToShow()
 // @See header
 //---------------------------------------------------------------
-void MsgConversationView::serviceError(const QString& error)
+void MsgConversationView::menuAboutToShow()
 {
-    Q_UNUSED(error)
-//    HbDialog popup;
-//
-//    popup.setDismissPolicy(HbDialog::TapAnywhere);
-//    popup.setHeadingWidget(new HbLabel(tr("Error Notification")));
-//
-//    /// set a label as the content widget in the popup.
-//    HbLabel contentLabel(error);
-//    popup.setContentWidget(&contentLabel);
-//
-//    popup.setPrimaryAction(new HbAction(tr("Ok"), &popup));
-//    popup.exec();
+    // Clear all the previously added actions.
+    HbMenu *mainMenu = this->menu();
+    mainMenu->clearActions();
+
+    // Message type specific menu items
+    QModelIndex index = ConversationsEngine::instance()->getConversationsModel()->index(0, 0);
+    if (ConvergedMessage::BT != index.data(MessageType).toInt())
+    {
+        // Attach sub-menu
+        HbMenu *attachSubMenu = mainMenu->addMenu(LOC_ATTACH);
+        
+        attachSubMenu->addAction(LOC_PHOTO,this, SLOT(fetchImages()));
+        attachSubMenu->addAction(LOC_SOUND,this, SLOT(fetchAudio()));
+		
+        HbAction* addVCard = attachSubMenu->addAction(LOC_VCARD);
+        addVCard->setData(VCARD_INSERTION_MODE);        
+        connect(addVCard, SIGNAL(triggered()),this,SLOT(fetchContacts()));
+
+        HbAction *addRecipients = mainMenu->addAction(LOC_ADD_RECIPIENTS);
+        addRecipients->setData(CONTACT_INSERTION_MODE);        
+        connect(addRecipients, SIGNAL(triggered()), this, SLOT(fetchContacts()));
+
+        mainMenu->addAction(LOC_ADD_SUBJECT,this, SLOT(addSubject()));
+    }
 }
 
 //---------------------------------------------------------------
@@ -647,23 +878,61 @@
 //---------------------------------------------------------------
 void MsgConversationView::openItem(const QModelIndex & index)
     {
-    int messageType = index.data(MessageType).toInt();    
-    if(messageType == ConvergedMessage::RingingTone )
+    // Return if invalid index.
+    if (!index.isValid() || mVkbopened)
         {
-        if(RingBc::askSaveQuery())
-            {
-            saveRingingTone();
-            }
         return;
         }
-	
-	/// smart messages hardcoded due to common handling
-	if (messageType == ConvergedMessage::BioMsg
-	    || messageType >= ConvergedMessage::VCard)  
-	{
-	    return;
-	}
-			
+
+    if(mItemLongPressed)
+        return;
+    
+    int messageType = index.data(MessageType).toInt();
+    int messageSubType = index.data(MessageSubType).toInt();
+    
+    if (ConvergedMessage::BioMsg == messageType) {
+        if (ConvergedMessage::RingingTone == messageSubType) {
+            if (RingBc::askSaveQuery()) {
+                saveRingingTone();
+            }
+            return;
+        }
+        // Unsupported messages
+        else if (ConvergedMessage::VCard == messageSubType
+            || ConvergedMessage::VCal == messageSubType
+            || ConvergedMessage::Provisioning == messageSubType) {
+            return;
+        }
+    }
+    else if (ConvergedMessage::BT == messageType) {
+        launchBtDisplayService(index);
+        return;
+    }
+    else if(ConvergedMessage::MmsNotification == messageType)
+    {
+        qint32 messageId = index.data(ConvergedMsgId).toLongLong();    
+        if(!ConversationsEngine::instance()->downloadOperationSupported(messageId))           
+        {
+           int notificationState = index.data(NotificationStatus).toInt();
+           if( notificationState == ConvergedMessage::NotifExpired)
+           {
+               deleteItem();
+           }
+           return;
+        }
+        else
+        {
+            //TODO: use logical str name
+            if(HbMessageBox::question("Download Message?",
+                LOC_COMMON_DOWNLOAD,
+                LOC_BUTTON_CANCEL))
+            {
+                downloadMessage();
+            }
+            return;
+        }
+    }
+
     ConvergedMessage message;
     // check whether message is in sending progress, then donot launch viewer.
     int location = index.data(MessageLocation).toInt();
@@ -672,7 +941,6 @@
     //If message is in Sending state or is Scheduled to be sent later,
     //do not open the message
     if(sendingState == ConvergedMessage::Suspended ||
-            sendingState == ConvergedMessage::Resend ||
             sendingState == ConvergedMessage::Scheduled ||
             sendingState == ConvergedMessage::Sending ||
             sendingState == ConvergedMessage::Waiting)
@@ -684,7 +952,9 @@
     // movement lock issue is resolved from mw
     if( !((location == ConvergedMessage::Inbox) ||
         (location == ConvergedMessage::Sent) ||
-        (sendingState == ConvergedMessage::SentState)) )
+        (sendingState == ConvergedMessage::SentState)||
+        (sendingState == ConvergedMessage::Failed) ||
+        (sendingState == ConvergedMessage::Resend)))
         {// do not launch viewer, show a note
         HbNotificationDialog* dlg = new HbNotificationDialog();
         dlg->setFocusPolicy(Qt::NoFocus);
@@ -707,6 +977,7 @@
         // message type
 
         message.setMessageType((ConvergedMessage::MessageType) messageType);
+        message.setMessageSubType((ConvergedMessage::MessageSubType) messageSubType);
 
         if (messageType == ConvergedMessage::Mms)
         {
@@ -762,35 +1033,67 @@
 // MsgConversationView::launchUniEditor
 // @see header file
 //---------------------------------------------------------------
-void MsgConversationView::launchUniEditor(const int editorFields, QString& filepath)
+void MsgConversationView::launchUniEditor(const QVariantList& data)
 {
-    ConvergedMessage message;
-    message.setBodyText(mEditorWidget->content());
-
-    ConvergedMessageAddress address;
-    address.setAlias(mContactCardWidget->address().at(0)->alias());
-    address.setAddress(mContactCardWidget->address().at(0)->address());
-    message.addToRecipient(address);
-
-    if(!filepath.isEmpty())
-    {
-        ConvergedMessageAttachment* attachment = new ConvergedMessageAttachment(filepath);
-        ConvergedMessageAttachmentList attachmentList;
-        attachmentList.append(attachment);
-        message.addAttachments(attachmentList);
-    }
-
+    // param list for switching to editor view
+    QVariantList params;
     QByteArray dataArray;
     QDataStream messageStream
     (&dataArray, QIODevice::WriteOnly | QIODevice::Append);
-    message.serialize(messageStream);
+
+    // first arg is always the editor operation
+    int editorOperation = data.at(0).toInt();
+    
+    ConvergedMessage message;
+    QVariant data2;
+    if( editorOperation != MsgBaseView::FORWARD_MSG )
+    {
+        message.setBodyText(mEditorWidget->content());
+
+        ConvergedMessageAddress address;
+        address.setAlias(mContactCardWidget->address().at(0)->alias());
+        address.setAddress(mContactCardWidget->address().at(0)->address());
+        message.addToRecipient(address);
 
-    QVariantList params;
-    params << MsgBaseView::UNIEDITOR; // target view
-    params << MsgBaseView::CV; // source view
+        if(editorOperation == MsgBaseView::ADD_PHOTO ||
+           editorOperation == MsgBaseView::ADD_AUDIO ||
+           editorOperation == MsgBaseView::ADD_VIDEO )
+        {
+            // filepath is sent in cases like ADD_PHOTO, ADD_AUDIO etc.
+            QString filepath;
+            filepath = data.at(1).toString();
+            if(!filepath.isEmpty())
+            {
+                ConvergedMessageAttachment* attachment = 
+                        new ConvergedMessageAttachment(filepath);
+                ConvergedMessageAttachmentList attachmentList;
+                attachmentList.append(attachment);
+                message.addAttachments(attachmentList);
+            }            
+        }
+        else if(editorOperation == MsgBaseView::ADD_VCARD)
+        {
+            // filepath is not sent in cases like VCards & recipients
+            // instead, we will get a list of contacts. Pass it as it is.
+            data2 = data.at(1);
+        }
+    }
+    else
+    {
+        qint32 msgId = (qint32)data.at(1).toInt();
+        int msgType = data.at(2).toInt();
+        ConvergedMessageId id(msgId);
+        message.setMessageId(id);
+        message.setMessageType((ConvergedMessage::MessageType)msgType);
+    }
 
+    message.serialize(messageStream);
+    params << MsgBaseView::UNIEDITOR;
+    params << MsgBaseView::CV;
     params << dataArray;
-    params << editorFields;
+    params << editorOperation;
+    if(!data2.isNull())
+        params << data2;
 
     clearEditors();
     emit switchView(params);
@@ -802,58 +1105,154 @@
 //---------------------------------------------------------------
 void MsgConversationView::populateConversationsView()
 {
-    connect(mMessageModel, SIGNAL(conversationModelUpdated()),
-        this, SLOT(refreshView()));
+    bool b = connect(ConversationsEngine::instance(), 
+                     SIGNAL(conversationModelUpdated()),
+                     this, 
+                     SLOT(scrollToBottom()));
 
     mConversationList->setModel(mMessageModel);
     
     refreshView();
-    
-    HbEffect::start(this,QString("ConversationView"),
-        QString("show"),this,"effectFinished");
+    scrollToBottom();
 }
 
 //---------------------------------------------------------------
-// MsgConversationView::effectFinished
-// @see header file
-//---------------------------------------------------------------
-void MsgConversationView::effectFinished(
-    const HbEffect::EffectStatus& /*status*/)
-  {
-  // Effect is finished. Start fetching remaing conversations
-    ConversationsEngine::instance()->fetchMoreConversations();
-  }
-
-//---------------------------------------------------------------
 // MsgConversationView::saveRingingTone
 // @see header file
 //---------------------------------------------------------------
 void MsgConversationView::saveRingingTone()
-    {
+{
     QModelIndex index = mConversationList->currentIndex();
     int messageId = index.data(ConvergedMsgId).toInt();
-    
+
     UniDataModelLoader* pluginLoader = new UniDataModelLoader();
-    pluginLoader->loadPlugins();
     UniDataModelPluginInterface* pluginInterface = 
-                        pluginLoader->getDataModelPlugin("bio:vcal");
+    pluginLoader->getDataModelPlugin(ConvergedMessage::BioMsg);
     pluginInterface->setMessageId(messageId);
     UniMessageInfoList attachments = pluginInterface->attachmentList();
-    
-    QString attachmentPath = attachments[0]->path();
-    
-    RingBc* ringBc = new RingBc();
-    
-    ringBc->saveTone(attachmentPath);
-      
-    // clear attachement list : its allocated at data model
-    while(!attachments.isEmpty())
+    if(attachments.count() > 0)
+    {
+        QString attachmentPath = attachments[0]->path();
+
+        RingBc* ringBc = new RingBc();
+
+        ringBc->saveTone(attachmentPath);
+
+        // clear attachement list : its allocated at data model
+        while(!attachments.isEmpty())
         {
-        delete attachments.takeFirst();
+            delete attachments.takeFirst();
         }
 
-    delete ringBc;
+        delete ringBc;
+    }
     delete pluginLoader;
+}
+
+//---------------------------------------------------------------
+// MsgConversationView::handleSmsCharLimitReached
+// @see header file
+//---------------------------------------------------------------
+void MsgConversationView::handleSmsCharLimitReached()   
+{
+    QString filepath;
+    QVariantList params;
+    params << MsgBaseView::ADD_OTHERS;
+    launchUniEditor(params);   
+}
+
+//---------------------------------------------------------------
+// MsgConversationView::validateMsgForForward
+// @see header file
+//---------------------------------------------------------------
+bool MsgConversationView::validateMsgForForward(int &messageType,
+    qint32 &messageId)
+{
+    bool retValue = true;
+    if (messageType == ConvergedMessage::Mms)
+    {
+        //Validate if the mms msg can be forwarded or not
+        MmsConformanceCheck* mmsConformanceCheck = new MmsConformanceCheck;
+        retValue = mmsConformanceCheck->validateMsgForForward(messageId);
+        
+        delete mmsConformanceCheck;
     }
 
+    return retValue;
+}
+
+//---------------------------------------------------------------
+// MsgConversationView::vkbOpened
+// @see header file
+//---------------------------------------------------------------
+void MsgConversationView::vkbOpened()
+{
+    mVkbopened = true;
+    
+    mContactCardWidget->connectSignals(false);
+    
+    emit hideChrome(true);
+    
+    QRectF appRect = mVkbHost->applicationArea();    
+    qreal spacing = 0.0;
+    qreal cardHeight = 0.0;
+    if(mContactCardWidget->isVisible())
+        {
+        cardHeight = mContactCardWidget->rect().height();
+        spacing = HbDeviceProfile::profile(this).unitValue();
+        }
+    
+    this->setMaximumHeight(appRect.height()- cardHeight - spacing);
+    
+    disconnect(mVkbHost,SIGNAL(keypadOpened()),this,SLOT(vkbOpened()));
+    
+    scrollToBottom();
+}
+	  
+//---------------------------------------------------------------
+// MsgConversationView::vkbClosed
+// @see header file
+//---------------------------------------------------------------
+void MsgConversationView::vkbClosed()
+{
+    mVkbopened = false;
+    
+    mContactCardWidget->connectSignals(true);
+    
+    emit hideChrome(false);
+    
+    this->setMaximumHeight(-1);
+    connect(mVkbHost,SIGNAL(keypadOpened()),this,SLOT(vkbOpened()));
+}
+
+//---------------------------------------------------------------
+// MsgConversationView::serviceRequestError
+// @see header file
+//---------------------------------------------------------------
+void MsgConversationView::serviceRequestError(int errorCode, const QString& errorMessage)
+{
+    QDEBUG_WRITE_FORMAT(errorMessage,errorCode);
+}
+
+//---------------------------------------------------------------
+// MsgConversationView::activateInputBlocker
+// @see header file
+//--------------------------------------------------------------
+void MsgConversationView::activateInputBlocker()
+    {
+        this->grabMouse();
+        this->grabKeyboard();
+    }
+
+//---------------------------------------------------------------
+// MsgConversationView::deactivateInputBlocker
+// @see header file
+//--------------------------------------------------------------
+void MsgConversationView::deactivateInputBlocker()
+    {    
+        this->ungrabKeyboard();
+        this->ungrabMouse();
+    }
+
+
 // EOF
--- a/messagingapp/msgui/conversationview/src/msgconversationviewitem.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/conversationview/src/msgconversationviewitem.cpp	Mon May 03 12:29:07 2010 +0300
@@ -21,8 +21,11 @@
 #include <QDateTime>
 #include "debugtraces.h"
 #include <QDir>
+#include <QChar>
 #include <HbTextItem>
 #include <HbIconItem>
+#include <HbIconAnimationManager>
+#include <HbIconAnimator>
 
 // USER INCLUDES
 #include "msgconversationwidget.h"
@@ -32,13 +35,18 @@
 #include "conversationsenginedefines.h"
 
 // LOCAL CONSTANTS
+const QString MSG_OUTBOX_ICON("qtg_small_outbox");
+const QString MSG_FAIL_ICON("qtg_small_fail");
+const QString ANIMATION_FILE(":/qtg_anim_loading.axml");
+const QString ANIMATION_ICON_NAME("qtg_anim_loading");
+const QString VCARD_ICON("qtg_large_mycard");
 
-const QString MSG_FAIL_ICON(":/icons/qtg_small_fail.png");
-
+// LOCALIZATION
 #define LOC_RINGING_TONE hbTrId("txt_messaging_dpopinfo_ringing_tone")
 #define LOC_BUSINESS_CARD hbTrId("txt_messaging_list_business_card")
-#define LOC_CALENDER_EVENT hbTrId("txt_messaging_list_calendar_event")
-#define LOC_UNSUPPORTED_MESSAGE hbTrId("txt_messaging_list_listview_unsupported_message_type")
+#define LOC_CALENDAR_EVENT hbTrId("txt_messaging_list_calendar_event")
+#define LOC_UNSUPPORTED_MSG_TYPE hbTrId("txt_messaging_list_listview_unsupported_message_type")
+#define LOC_RESEND_AT hbTrId("Resend at ")
 
 //---------------------------------------------------------------
 // MsgConversationViewItem::MsgConversationViewItem
@@ -86,15 +94,32 @@
             << index.data(ConvergedMsgId).toInt();
 #endif
 
+    // Create items common to each type of message
+
+    QString bodyText = index.data(BodyText).toString();
+    int messageType = index.data(MessageType).toInt();
+    int messageSubType = index.data(MessageSubType).toInt();
+
     // Set message properties common to SMS/MMS/IM etc..
 
     int direction = index.data(Direction).toInt();
 
-    if ( (direction == ConvergedMessage::Incoming) ||
-            (direction == ConvergedMessage::Missed))
+    if ( direction == ConvergedMessage::Incoming)
     {
         setIncoming(true);
         mConversation->setIncoming(true);
+        
+        if(messageType == ConvergedMessage::MmsNotification)
+        {
+            mConversation->setMMSNotification(true);
+            int notificationState = index.data(NotificationStatus).toInt();
+            mConversation->setNotificationState(notificationState);
+            setNotificationStateIcon(notificationState);
+        }
+        else
+        {
+            mMessageStateIconItem->setVisible(false);
+        }
     }
     else if (direction == ConvergedMessage::Outgoing)
     {
@@ -114,39 +139,35 @@
 
     QDateTime dateTime;
     dateTime.setTime_t(index.data(TimeStamp).toUInt());
+    QString resendStateNote((index.data(SendingState).toInt() == ConvergedMessage::Resend)? LOC_RESEND_AT : "");
     if (dateTime.date() == QDateTime::currentDateTime().date())
     {
-        mConversation->setTimeStamp(dateTime.toString(TIME_FORMAT));
+
+        mConversation->setTimeStamp(resendStateNote + dateTime.toString(TIME_FORMAT));
     }
     else
     {
-        mConversation->setTimeStamp(dateTime.toString(DATE_FORMAT));
+        mConversation->setTimeStamp(resendStateNote + dateTime.toString(DATE_FORMAT));
     }
 
-    // Create items common to each type of message
-
-    QString bodyText = index.data(BodyText).toString();
-    int messageType = index.data(MessageType).toInt();
-
     QDEBUG_WRITE_FORMAT("MsgConversationViewItem::updateChildItems msg type value",messageType)
     
     if (messageType == ConvergedMessage::Sms ||
             messageType == ConvergedMessage::IM)
     {
-    QDEBUG_WRITE("MsgConversationViewItem::updateChildItems SMS block")
         mConversation->setMMS(false);
+        bodyText.replace(QChar::ParagraphSeparator, QChar::LineSeparator);
+        bodyText.replace('\r', QChar::LineSeparator);
         mConversation->setBodyText(bodyText);
     }
     else if (messageType == ConvergedMessage::Mms)
     {
-    QDEBUG_WRITE("MsgConversationViewItem::updateChildItems MMS block")
-    
         mConversation->setMMS(true);
         QString attachments = index.data(Attachments).toString();
         QString subject = index.data(Subject).toString();
 
         bool hasAttachments = (index.data(MessageProperty).toInt()
-                & ConvergedMessage::Attachment) ? true : false;
+            & ConvergedMessage::Attachment) ? true : false;
 
         if (hasAttachments)
         {
@@ -192,37 +213,64 @@
         int priority = index.data(MessagePriority).toInt();
         mConversation->setPriority(priority);
         mConversation->setSubject(subject);
-        mConversation->setBodyText(bodyText);
-
+        mConversation->setBodyText(bodyText);        
     } // END of ConvergedMessage::Mms
-    else if (messageType == ConvergedMessage::RingingTone)
+    else if (messageType == ConvergedMessage::BioMsg)
     {
-        QDEBUG_WRITE("MsgConversationViewItem::updateChildItems Ringing Tone block")
-        mConversation->setMMS(true);
-        mConversation->setImage(false);
-        mConversation->setAudio(true);
-        mConversation->displayAudioIcon();
-        mConversation->setSubject(LOC_RINGING_TONE); 
+        if (messageSubType == ConvergedMessage::RingingTone)
+        {
+            mConversation->setMMS(true);
+            mConversation->setImage(false);
+            mConversation->setAudio(true);
+            mConversation->displayAudioIcon();
+            mConversation->setSubject(LOC_RINGING_TONE);
+        }
+        else if (messageSubType == ConvergedMessage::VCard)
+        {
+            mConversation->setMMS(true);
+            mConversation->setImage(false);
+            mConversation->setAudio(true);
+            mConversation->displayAudioIcon(VCARD_ICON);
+            mConversation->setSubject(LOC_BUSINESS_CARD);
+            mConversation->setBodyText(bodyText);
+        }
+        else
+        {
+            mConversation->setMMS(false);
+            mConversation->setBodyText(LOC_UNSUPPORTED_MSG_TYPE);
+        }
     }
-	/// for all the biotype messages
-    else if (messageType == ConvergedMessage::VCard)  
+    else if (messageType == ConvergedMessage::BT)
     {
-        mConversation->setMMS(false);
-        mConversation->setBodyText(LOC_BUSINESS_CARD);
+        mConversation->setMMS(true);
+        QString deviceName = index.data(ConversationAddress).toString();
+        mConversation->setSubject(deviceName);
+        QString blueToothBody;
+        if (messageSubType == ConvergedMessage::VCard)
+        {
+            mConversation->setImage(false);
+            mConversation->setAudio(true);
+            mConversation->displayAudioIcon(VCARD_ICON);
+            blueToothBody.append(LOC_BUSINESS_CARD);
+            blueToothBody.append(QChar::LineSeparator);
+            blueToothBody.append(bodyText);
+        }        
+        else
+        {
+            blueToothBody.append(bodyText);
+        }
+        mConversation->setBodyText(blueToothBody);
     }
-	/// for all the biotype messages
-    else if (messageType == ConvergedMessage::VCal)  
+    else if(messageType == ConvergedMessage::MmsNotification)
     {
-        mConversation->setMMS(false);
-        mConversation->setBodyText(LOC_CALENDER_EVENT);
+        mConversation->setMMS(true);
+        
+        QString subject = index.data(Subject).toString();
+        int priority = index.data(MessagePriority).toInt();
+        mConversation->setPriority(priority);
+        mConversation->setSubject(subject);
+        mConversation->setBodyText(bodyText);
     }
-	/// for all the biotype messages
-    else if (messageType == ConvergedMessage::BioMsg)  
-    {
-        mConversation->setMMS(false);
-        mConversation->setBodyText(LOC_UNSUPPORTED_MESSAGE);
-    }
-   
 
 #ifdef _DEBUG_TRACES_
     qCritical() << "END MsgConversationViewItem::updateChildItems: "
@@ -261,34 +309,104 @@
 }
 
 //---------------------------------------------------------------
-// MsgConversationViewItem::setIncoming
+// MsgConversationViewItem::setMessageStateIcon
 // @see header file
 //---------------------------------------------------------------
 void MsgConversationViewItem::setMessageStateIcon(int messageState)
 {
+    HbIconAnimator& iconAnimator = mMessageStateIconItem->animator();
+    HbIconAnimationManager* iconAnimationManager = HbIconAnimationManager::global();
     switch (messageState)
     {
+
+        case ConvergedMessage::Waiting:
+        case ConvergedMessage::Scheduled:
+        case ConvergedMessage::Sending:
+        { 
+ 	        bool defined = iconAnimationManager->addDefinitionFile(ANIMATION_FILE);
+     	    HbIcon animIcon;
+            animIcon.setIconName(ANIMATION_ICON_NAME);
+            QSizeF size = mMessageStateIconItem->size();
+            mMessageStateIconItem->setIcon(animIcon);
+            mMessageStateIconItem->setVisible(true);
+            iconAnimator.startAnimation();
+            repolish();
+            break;
+        }     
         case ConvergedMessage::Suspended:
+        {
+           iconAnimator.stopAnimation();
+           mMessageStateIconItem->setIcon(MSG_OUTBOX_ICON);
+           mMessageStateIconItem->setVisible(true);
+           break;
+        
+        }
         case ConvergedMessage::Resend:
         {
-            //TODO: Temp icon until official icons are received
-            mMessageStateIconItem->setIcon(MSG_FAIL_ICON);
+            iconAnimator.stopAnimation();
+            mMessageStateIconItem->setIcon(MSG_OUTBOX_ICON);
             mMessageStateIconItem->setVisible(true);
             break;
         }
         case ConvergedMessage::Failed:
         {
-            //TODO: Temp icon until official icons are received
+            iconAnimator.stopAnimation();
             mMessageStateIconItem->setIcon(MSG_FAIL_ICON);
             mMessageStateIconItem->setVisible(true);
             break;
-        }        
+        }   
+        case ConvergedMessage::Unknown:
         default:
         {
+            iconAnimator.stopAnimation();
             mMessageStateIconItem->setVisible(false);
             break;
         }
     }
 }
 
+//---------------------------------------------------------------
+// MsgConversationViewItem::setNotificationStateIcon
+// @see header file
+//---------------------------------------------------------------
+
+void MsgConversationViewItem::setNotificationStateIcon(int notificationState)
+{
+    HbIconAnimator& iconAnimator = mMessageStateIconItem->animator();
+    HbIconAnimationManager* iconAnimationManager = HbIconAnimationManager::global();
+    switch (notificationState)
+    {
+
+        case ConvergedMessage::NotifRetrieving:
+        case ConvergedMessage::NotifWaiting:
+        { 
+            //TODO: Temp icon until official icons are received
+            bool defined = iconAnimationManager->addDefinitionFile(ANIMATION_FILE);
+            HbIcon animIcon;
+            animIcon.setIconName(ANIMATION_ICON_NAME);
+            QSizeF size = mMessageStateIconItem->size();
+            mMessageStateIconItem->setIcon(animIcon);
+            mMessageStateIconItem->setVisible(true);
+            iconAnimator.startAnimation();
+            repolish();
+            break;
+        }     
+        default:
+        {
+            iconAnimator.stopAnimation();
+            mMessageStateIconItem->setVisible(false);
+            break;
+        }
+    }
+}
+
+//---------------------------------------------------------------
+// MsgConversationViewItem::pressStateChanged
+// @see header file
+//---------------------------------------------------------------
+void MsgConversationViewItem::pressStateChanged (bool pressed, bool animate)
+{
+    mConversation->pressStateChanged(pressed, animate);
+}
+
 // EOF
--- a/messagingapp/msgui/conversationview/src/msgconversationwidget.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/conversationview/src/msgconversationwidget.cpp	Mon May 03 12:29:07 2010 +0300
@@ -24,37 +24,30 @@
 #include <QPixmap>
 #include <QImageReader>
 #include <QDir>
+#include <HbEffect>
 #include "debugtraces.h"
 
 #include "convergedmessage.h"
 
-#define DEBUG_PAINT 0
-
 const int MAX_SIZE(200);
 
 // Icons
-const QString MSG_FORWARD_ICON(":/icons/qtg_mono_forward.svg");
-
-const QString MSG_HIGH_PRIORITY_ICON(":/icons/qtg_small_priority_high.svg");
-const QString MSG_LOW_PRIORITY_ICON(":/icons/qtg_small_priority_low.svg");
-
-const QString MSG_ATTACH_ICON(":/icons/qtg_small_attachment.svg");
-
-const QString MSG_AUDIO_ICON(":/icons/qtg_large_music_player.png");
-const QString MSG_VIDEO_ICON(":/icons/video_icon.png");
-const QString MSG_AUDIO_PLAY_ICON(":/icons/qtg_large_music_player.png");
+const QString MSG_HIGH_PRIORITY_ICON("qtg_small_priority_high");
+const QString MSG_LOW_PRIORITY_ICON("qtg_small_priority_low");
+const QString MSG_ATTACH_ICON("qtg_small_attachment");
+const QString MSG_AUDIO_ICON("qtg_large_music_player");
+const QString MSG_VIDEO_ICON("qtg_large_video_player");
+const QString MSG_AUDIO_PLAY_ICON("qtg_large_music_player");
 
 
 // Frames
-const QString IN_CHAT_FRAME(":/bubble/qtg_fr_convlist_received_normal");
-const QString IN_CHAT_FRAME_PRESSED(":/bubble/qtg_fr_convlist_received_pressed");
-const QString OUT_CHAT_FRAME(":/bubble/qtg_fr_convlist_sent_normal");
-const QString OUT_CHAT_FRAME_PRESSED(":/bubble/qtg_fr_convlist_sent_pressed");
-const QString IN_CHAT_FRAME_UNREAD(":/bubble/qtg_fr_convlist_received_highlight");
-const QString NEW_ITEM_FRAME(":/new_item/qtg_fr_list_new_item");
-const QString SENDING_CHAT_FRAME(":/bubble/qtg_fr_convlist_sent_highlight");
-
-#define PLUGINPATH "conversationviewplugin.dll"
+const QString CV_RECEIVED_NORMAL_FR("qtg_fr_convlist_received_normal");
+const QString CV_RECEIVED_PRESSED_FR("qtg_fr_convlist_received_pressed");
+const QString CV_RECEIVED_HIGHLIGHT_FR("qtg_fr_convlist_received_highlight");
+const QString CV_SENT_NORMAL_FR("qtg_fr_convlist_sent_normal");
+const QString CV_SENT_PRESSED_FR("qtg_fr_convlist_sent_pressed");
+const QString CV_SENT_HIGHLIGHT_FR("qtg_fr_convlist_sent_highlight");
+const QString NEW_ITEM_FRAME("qtg_fr_list_new_item");
 
 //---------------------------------------------------------------
 // MsgConversationWidget::MsgConversationWidget
@@ -70,8 +63,10 @@
         mIncoming(false),
         mUnread(false),
         mIsMMS(false),
+        mIsMMSNotification(false),
         mPriority(0),
         mSendingState(0),
+        mNotificationState(0),
         mNewFrameItem(NULL),
         mBubbleFrameItem(NULL),
         mSubjectTextItem(NULL),
@@ -109,6 +104,7 @@
     mBubbleFrameItem = new HbFrameItem(this);
     // ZValue is set to make the bubble to be rendered in behind text items.
     mBubbleFrameItem->setZValue(-1.0);
+    mBubbleFrameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
     HbStyle::setItemName(mBubbleFrameItem, "bubble");
 
     mBodyTextItem = new HbTextItem(this);
@@ -289,7 +285,7 @@
 // MsgConversationWidget::displayAudioIcon
 // @see header file
 //---------------------------------------------------------------
-void MsgConversationWidget::displayAudioIcon()
+void MsgConversationWidget::displayAudioIcon(const QString &iconPath)
 {
     if (hasAudio())
     {
@@ -300,7 +296,7 @@
                 mPlayIconItem = new HbIconItem(this);
                 HbStyle::setItemName(mPlayIconItem, "playIcon");
             }
-            mPlayIconItem->setIconName(MSG_AUDIO_PLAY_ICON);
+            mPlayIconItem->setIconName(iconPath.isEmpty() ? MSG_AUDIO_PLAY_ICON : iconPath);
         }
         else
         {
@@ -309,7 +305,7 @@
                 mAudioIconItem = new HbIconItem(this);
                 HbStyle::setItemName(mAudioIconItem, "audioIcon");
             }
-            mAudioIconItem->setIconName(MSG_AUDIO_ICON);
+            mAudioIconItem->setIconName(iconPath.isEmpty() ? MSG_AUDIO_PLAY_ICON : iconPath);
         }
     }
 }
@@ -415,6 +411,24 @@
 }
 
 //---------------------------------------------------------------
+// MsgConversationWidget::setMMSNotification
+// @see header file
+//---------------------------------------------------------------
+void MsgConversationWidget::setMMSNotification(bool isMMSNotification)
+{
+    mIsMMSNotification = isMMSNotification;
+}
+
+//---------------------------------------------------------------
+// MsgConversationWidget::isMMS
+// @see header file
+//---------------------------------------------------------------
+bool MsgConversationWidget::isMMSNotification()
+{
+    return mIsMMSNotification;
+}
+
+//---------------------------------------------------------------
 // MsgConversationWidget::setSendingState
 // @see header file
 //---------------------------------------------------------------
@@ -462,6 +476,52 @@
 }
 
 //---------------------------------------------------------------
+// MsgConversationWidget::setNotificationState
+// @see header file
+//---------------------------------------------------------------
+void MsgConversationWidget::setNotificationState(int state)
+{
+    switch (state)
+    {
+        case ConvergedMessage::NotifFailed:
+        {
+            mNotificationState = NotifFailed;
+            break;
+        }
+        case ConvergedMessage::NotifReadyForFetching:
+        {
+            mNotificationState = NotifReadyForFetching;
+            break;
+        }
+        case ConvergedMessage::NotifRetrieving:
+        case ConvergedMessage::NotifWaiting:
+        {
+            mNotificationState = NotifRetrieving;
+            break;
+        }
+        case ConvergedMessage::NotifExpired:
+        {
+            mNotificationState = NotifExpired;
+            break;
+        }
+        default:
+        {
+            mNotificationState = NotifUnknown;
+            break;
+        }
+    }
+}
+
+//---------------------------------------------------------------
+// MsgConversationWidget::notificationState
+// @see header file
+//---------------------------------------------------------------
+int MsgConversationWidget::notificationState()
+{
+    return mNotificationState;
+}
+
+//---------------------------------------------------------------
 // MsgConversationWidget::setTimeStamp
 // @see header file
 //---------------------------------------------------------------
@@ -493,24 +553,61 @@
 //---------------------------------------------------------------
 void MsgConversationWidget::drawBubbleFrame()
 {
-    mBubbleFrameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
-    mBubbleFrameItem->frameDrawer().setFillWholeRect(true);
-
     if(isIncoming())
     {
-        mBubbleFrameItem->frameDrawer().setFrameGraphicsName(IN_CHAT_FRAME);
+        if (mIsMMSNotification && (mNotificationState == NotifUnknown
+                || mNotificationState == NotifRetrieving ))
+        {
+            mBubbleFrameItem->frameDrawer().setFrameGraphicsName(
+                CV_RECEIVED_HIGHLIGHT_FR);
+            //Inactive state bubble  
+        }
+        else
+        {
+            mBubbleFrameItem->frameDrawer().setFrameGraphicsName(CV_RECEIVED_NORMAL_FR);
+        }
     }
     else
     {
-        if(mSendingState == Sending || mSendingState == Pending || mSendingState == Unknown)
+        if(mSendingState == Sending || mSendingState == Pending || 
+           mSendingState == Unknown || mSendingState == Failed)
         {
-            mBubbleFrameItem->frameDrawer().setFrameGraphicsName(SENDING_CHAT_FRAME);
+            mBubbleFrameItem->frameDrawer().setFrameGraphicsName(CV_SENT_HIGHLIGHT_FR);
         }
         else
         {
-            mBubbleFrameItem->frameDrawer().setFrameGraphicsName(OUT_CHAT_FRAME);
+            mBubbleFrameItem->frameDrawer().setFrameGraphicsName(CV_SENT_NORMAL_FR);
         }
     }
 }
 
+//---------------------------------------------------------------
+// MsgConversationWidget::drawPressedBubbleFrame
+// @see header file
+//---------------------------------------------------------------
+void MsgConversationWidget::drawPressedBubbleFrame()
+{
+    if(isIncoming())
+    {
+        mBubbleFrameItem->frameDrawer().setFrameGraphicsName(CV_RECEIVED_PRESSED_FR);
+    }
+    else
+    {
+        mBubbleFrameItem->frameDrawer().setFrameGraphicsName(CV_SENT_PRESSED_FR);
+    }
+}
+
+//---------------------------------------------------------------
+// MsgConversationWidget::pressStateChanged
+// @see header file
+//---------------------------------------------------------------
+void MsgConversationWidget::pressStateChanged(bool pressed, bool animate)
+{
+    Q_UNUSED(animate)
+
+    if (mBubbleFrameItem) {
+        (pressed) ? drawPressedBubbleFrame() : drawBubbleFrame();
+    }
+}
+
 // EOF
--- a/messagingapp/msgui/conversationview/src/msgeditorwidget.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/conversationview/src/msgeditorwidget.cpp	Mon May 03 12:29:07 2010 +0300
@@ -20,16 +20,36 @@
 // SYSTEM INCLUDES
 #include <HbStyle>
 #include <HbPushButton>
+#include <HbTextItem>
 #include <qgraphicsscene.h>
+#include <HbFrameDrawer>
+#include <HbFrameItem>
+#include <csmsaccount.h>
+#include <smutset.h>
+#include <hbmessagebox.h>
+#include <QTimer>
+#include "unieditorpluginloader.h"
+#include "unieditorplugininterface.h"
+#include "unisendingsettings.h"
+#include "unieditorgenutils.h"
 #include "debugtraces.h"
 
 // LOCAL CONSTANTS
 const QString PLUGINPATH("conversationviewplugin.dll");
 
-const QString SMS_SERVICE("messaging.mserver.sms");
-const QString SEND_BUTTON(QObject::tr("Send"));
+const QString SEND_ICON("qtg_mono_send");
+const QString BACKGROUND("qtg_fr_input_bg");
+const QString BACKGROUND_FRAME("qtg_fr_btn_normal");
 
-const QString SEND_ICON(":/icons/qtg_mono_send.png");
+const QString SEND_BUTTON_NORMAL("qtg_fr_input_btn_function_normal");
+const QString SEND_BUTTON_PRESSED("qtg_fr_input_btn_function_pressed");
+const QString SEND_BUTTON_DISABLED("qtg_fr_input_btn_function_disabled");
+
+#define LOC_SMS_CHAR_LIMIT_REACHED hbTrId("txt_messaging_dialog_sms_character_count_exceeded")
+#define LOC_DIALOG_OK hbTrId("txt_common_button_ok")
+#define LOC_BUTTON_CANCEL hbTrId("txt_common_button_cancel")
+  
+const TInt KShowCounterLimit = 10;
 
 QGraphicsItem* FOCUSITEM = 0;
 
@@ -38,8 +58,8 @@
 // @see header
 //---------------------------------------------------------------
 MsgEditorWidget::MsgEditorWidget(QGraphicsItem *parent) :
-    HbWidget(parent), mServiceId(SMS_SERVICE), mMsgEditor(NULL),
-    mSendButton(NULL)
+    HbWidget(parent), mMsgEditor(NULL),
+    mSendButton(NULL),mPluginLoader(NULL)
 {
     int baseId = style()->registerPlugin(PLUGINPATH);
     
@@ -48,6 +68,13 @@
     #endif
     
     setPluginBaseId(baseId);
+    
+    //setting background.
+    HbFrameItem* backGround = new HbFrameItem(this);
+    backGround->frameDrawer().setFrameGraphicsName(BACKGROUND);
+    backGround->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesVertical);
+    backGround->frameDrawer().setFillWholeRect(true);
+    this->setBackgroundItem(backGround); 
 
     // Initialize the widget.
     init();
@@ -61,16 +88,40 @@
 {
     // Create mandatory element of mesh layout.
     mMsgEditor = new MsgEditor(this);
-    mMsgEditor->setMaxRows(5); // NOTE: Don't remove this line.
+    mMsgEditor->setMaxRows(3); // NOTE: Don't remove this line.
     HbStyle::setItemName(mMsgEditor, "msgEditor");
 
     mSendButton = new HbPushButton(this);
     HbStyle::setItemName(mSendButton, "sendButton");
     mSendButton->setIcon(HbIcon(SEND_ICON));
     mSendButton->setEnabled(false);
+    HbFrameDrawer* drawer = new HbFrameDrawer(this);
+    drawer->setFrameType(HbFrameDrawer::NinePieces);
+    mSendButton->setFrameBackground(drawer);
+    updateButtonBackground(SEND_BUTTON_DISABLED);
+    
+    mCharCounter = new HbTextItem(this);
+    HbStyle::setItemName(mCharCounter, "charCounter");
+    mCharCounter->setZValue(1.5);
+    
+    mBackgroundItem = new HbFrameItem(this);
+    HbStyle::setItemName(mBackgroundItem, "charCounterFrame");
+
+    mBackgroundItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
+    mBackgroundItem->frameDrawer().setFillWholeRect(true);
+    
+    mBackgroundItem->frameDrawer().setFrameGraphicsName(
+        BACKGROUND_FRAME);    
+    
+    //Create editor utils object
+    mEditorUtils = new UniEditorGenUtils();
+           
     FOCUSITEM = mSendButton;
 
+
     connect(mSendButton, SIGNAL(clicked()),this, SLOT(onClicked()));
+    connect(mSendButton, SIGNAL(pressed()),this, SLOT(onPressed()));
+    connect(mSendButton, SIGNAL(released()),this, SLOT(onReleased()));
     connect(mMsgEditor, SIGNAL(replyStarted()),this, SIGNAL(replyStarted()));
     connect(mMsgEditor, SIGNAL(textChanged(QString)),this,SLOT(onTextChanged(QString)));
     
@@ -83,15 +134,7 @@
 MsgEditorWidget::~MsgEditorWidget()
 {
     style()->unregisterPlugin(PLUGINPATH);
-}
-
-//---------------------------------------------------------------
-// MsgEditorWidget::serviceId
-// @see header
-//---------------------------------------------------------------
-const QString& MsgEditorWidget::serviceId()
-{
-    return mServiceId;
+    delete mEditorUtils;
 }
 
 //---------------------------------------------------------------
@@ -123,17 +166,24 @@
 }
 
 //---------------------------------------------------------------
-// MsgEditorWidget::clear
+// MsgEditorWidget::onTextChanged
 // @see header
 //---------------------------------------------------------------
 void MsgEditorWidget::onTextChanged(const QString& str)
 {
+    //If char limit is already reached we are about to show the sms limit dialog
+    //So we need not process the additional character entered
+    if(mSmsCharLimitReached)
+    {
+        return;
+    }
     if(str.length() > 0 )
         {
         if(!mSendButton->isEnabled())
             {
             mSendButton->setFocusProxy(mMsgEditor);
             mSendButton->setEnabled(true);
+            updateButtonBackground(SEND_BUTTON_NORMAL);
             }
         }
     else
@@ -142,8 +192,88 @@
             {
             mSendButton->setFocusProxy(0);
             mSendButton->setEnabled(false);
+            updateButtonBackground(SEND_BUTTON_DISABLED);
             }
         }
+    
+    //Check done for optimization
+    //Only if content is deleted we need to call encodingsettings again
+    if(mPrevBuffer.isEmpty() || str.size() <= mPrevBuffer.size())
+    {
+    mPluginInterface->setEncodingSettings(EFalse,ESmsEncodingNone,mCharSupportType);
+    }
+    
+    TInt numOfRemainingChars;
+    TInt numOfPDUs;
+    TBool unicodeMode;
+    TSmsEncoding alternativeEncodingType;
+    QString string = str;
+    mPluginInterface->getNumPDUs(string, numOfRemainingChars, numOfPDUs,
+        unicodeMode, alternativeEncodingType);
+
+    //Set char counter value
+    QString display = QString("%1(%2)").arg(numOfRemainingChars).arg(numOfPDUs);
+    mCharCounter->setText(display);
+    
+    if(numOfPDUs > 1 || numOfRemainingChars <= KShowCounterLimit  )
+    {
+        mCharCounter->setVisible(true);
+        mBackgroundItem->setVisible(true);
+    }
+    else
+    {
+        mCharCounter->setVisible(false);
+        mBackgroundItem->setVisible(false);
+    }
+    
+    //Check if sms segment limit has been reached
+    bool unicode = (unicodeMode) ? true : false;
+    int contentSize = mEditorUtils->UTF8Size(string);
+    int maxSmsSize =  mEditorUtils->MaxSmsMsgSizeL(unicode);
+    
+    if(contentSize > maxSmsSize)
+    {        
+        //Give breathing time for ITUT to complete its processing
+        //without this there is a crash as ITUT cant complete its processing
+        mSmsCharLimitReached = true;
+        QTimer::singleShot(50, this, SLOT(handleSmsCharLimitReached()));   
+        if(mPrevBuffer.isEmpty())
+        {
+            //Chop the last char and set it to the editor
+            string.chop(1);
+            mPrevBuffer = string;
+        }
+    }
+    else
+    {                
+        //Save the previous buffer
+        mPrevBuffer = string;        
+    }
+}
+
+//---------------------------------------------------------------
+// MsgEditorWidget::handleSmsCharLimitReached
+// @see header
+//---------------------------------------------------------------
+void MsgEditorWidget::handleSmsCharLimitReached()
+{
+    mSmsCharLimitReached = false;
+    
+    if(HbMessageBox::question(LOC_SMS_CHAR_LIMIT_REACHED,
+        LOC_DIALOG_OK,
+        LOC_BUTTON_CANCEL))
+    {
+        //Launch UniEditor 
+        emit smsCharLimitReached();
+        return;
+    }
+    else
+    {
+        //Set the previous content
+        setContent(QString(mPrevBuffer));
+        return;
+    }
+
 }
 
 //---------------------------------------------------------------
@@ -165,6 +295,76 @@
     emit sendMessage();
     }
 
+//---------------------------------------------------------------
+// MsgEditor::updateButtonBackground
+// @see header
+//---------------------------------------------------------------
+void MsgEditorWidget::updateButtonBackground(const QString& bg)
+    {
+    HbFrameDrawer* drawer = mSendButton->frameBackground();
+    if(drawer)
+        {
+        drawer->setFrameGraphicsName(bg);        
+        }
+    }
+
+//---------------------------------------------------------------
+// MsgEditor::onPressed
+// @see header
+//---------------------------------------------------------------
+void MsgEditorWidget::onPressed()
+    {
+    updateButtonBackground(SEND_BUTTON_PRESSED);
+    }
+
+//---------------------------------------------------------------
+// MsgEditor::onReleased
+// @see header
+//---------------------------------------------------------------
+void MsgEditorWidget::onReleased()
+    {
+    updateButtonBackground(SEND_BUTTON_NORMAL);
+    }
+	
+//---------------------------------------------------------------
+// MsgEditor::setEncodingSettings
+// @see header
+//---------------------------------------------------------------
+void MsgEditorWidget::setEncodingSettings()
+{ 
+    if( mPluginLoader )
+    {
+        delete mPluginLoader;
+    }
+    mPluginLoader = new UniEditorPluginLoader(this);
+
+    mPluginInterface =
+                        mPluginLoader->getUniEditorPlugin(ConvergedMessage::Sms);    
+
+    CSmsSettings* settings = CSmsSettings::NewLC();
+    CSmsAccount* account = CSmsAccount::NewLC();
+    account->LoadSettingsL( *settings );
+
+    if( settings->CharacterSet() == TSmsDataCodingScheme::ESmsAlphabetUCS2)
+    {
+    mCharSupportType = TUniSendingSettings::EUniCharSupportFull;
+    }
+    else
+    {
+    mCharSupportType = TUniSendingSettings::EUniCharSupportReduced;
+    }
+
+    CleanupStack::PopAndDestroy( account );
+    CleanupStack::PopAndDestroy( settings );                
+
+    //Set the mPrevBuffer to NULL initially
+    mPrevBuffer = QString();
+    
+    mSmsCharLimitReached = false;
+    
+    mCharCounter->setVisible(false);
+    mBackgroundItem->setVisible(false);
+}
 
 //---------------------------------------------------------------
 // MsgEditor::MsgEditor
@@ -206,4 +406,5 @@
     HbLineEdit::focusOutEvent(event);  
     }
 
+
 // EOF
--- a/messagingapp/msgui/eabi/appengineu.def	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/eabi/appengineu.def	Mon May 03 12:29:07 2010 +0300
@@ -1,35 +1,40 @@
 EXPORTS
 	_ZN19ConversationsEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME
 	_ZN19ConversationsEngine11qt_metacastEPKc @ 2 NONAME
-	_ZN19ConversationsEngine14deleteMessagesER5QListIiE @ 3 NONAME
-	_ZN19ConversationsEngine14getDraftsModelEv @ 4 NONAME
-	_ZN19ConversationsEngine16getConversationsEx @ 5 NONAME
-	_ZN19ConversationsEngine16markMessagesReadER5QListIiE @ 6 NONAME
-	_ZN19ConversationsEngine16staticMetaObjectE @ 7 NONAME DATA 16
-	_ZN19ConversationsEngine17getContactDetailsExR7QStringS1_S1_ @ 8 NONAME
-	_ZN19ConversationsEngine18clearConversationsEv @ 9 NONAME
-	_ZN19ConversationsEngine19deleteConversationsEx @ 10 NONAME
-	_ZN19ConversationsEngine19getStaticMetaObjectEv @ 11 NONAME
-	_ZN19ConversationsEngine20markConversationReadEx @ 12 NONAME
-	_ZN19ConversationsEngine21getConversationsModelEv @ 13 NONAME
-	_ZN19ConversationsEngine22fetchMoreConversationsEv @ 14 NONAME
-	_ZN19ConversationsEngine24conversationModelUpdatedEv @ 15 NONAME
-	_ZN19ConversationsEngine24getCurrentConversationIdEv @ 16 NONAME
-	_ZN19ConversationsEngine26conversationModelPopulatedEv @ 17 NONAME
-	_ZN19ConversationsEngine28emitConversationModelUpdatedEv @ 18 NONAME
-	_ZN19ConversationsEngine28getConversationIdFromAddressE7QString @ 19 NONAME
-	_ZN19ConversationsEngine28getConversationsSummaryModelEv @ 20 NONAME
-	_ZN19ConversationsEngine30conversationListModelPopulatedEv @ 21 NONAME
-	_ZN19ConversationsEngine30emitConversationModelPopulatedEv @ 22 NONAME
-	_ZN19ConversationsEngine30getConversationIdFromContactIdEi @ 23 NONAME
-	_ZN19ConversationsEngine34emitConversationListModelPopulatedEv @ 24 NONAME
-	_ZN19ConversationsEngine8instanceEv @ 25 NONAME
-	_ZN19ConversationsEngineC1EP7QObject @ 26 NONAME
-	_ZN19ConversationsEngineC2EP7QObject @ 27 NONAME
-	_ZN19ConversationsEngineD0Ev @ 28 NONAME
-	_ZN19ConversationsEngineD1Ev @ 29 NONAME
-	_ZN19ConversationsEngineD2Ev @ 30 NONAME
-	_ZNK19ConversationsEngine10metaObjectEv @ 31 NONAME
-	_ZTI19ConversationsEngine @ 32 NONAME
-	_ZTV19ConversationsEngine @ 33 NONAME
+	_ZN19ConversationsEngine13resendMessageEi @ 3 NONAME
+	_ZN19ConversationsEngine14deleteMessagesER5QListIiE @ 4 NONAME
+	_ZN19ConversationsEngine14getDraftsModelEv @ 5 NONAME
+	_ZN19ConversationsEngine15downloadMessageEi @ 6 NONAME
+	_ZN19ConversationsEngine16getConversationsEx @ 7 NONAME
+	_ZN19ConversationsEngine16markMessagesReadER5QListIiE @ 8 NONAME
+	_ZN19ConversationsEngine16staticMetaObjectE @ 9 NONAME DATA 16
+	_ZN19ConversationsEngine17getContactDetailsExR7QStringS1_ @ 10 NONAME
+	_ZN19ConversationsEngine18clearConversationsEv @ 11 NONAME
+	_ZN19ConversationsEngine19deleteConversationsEx @ 12 NONAME
+	_ZN19ConversationsEngine19getStaticMetaObjectEv @ 13 NONAME
+	_ZN19ConversationsEngine20markAsReadAndGetTypeEiRiS0_ @ 14 NONAME
+	_ZN19ConversationsEngine20markConversationReadEx @ 15 NONAME
+	_ZN19ConversationsEngine21getConversationsModelEv @ 16 NONAME
+	_ZN19ConversationsEngine22deleteAllDraftMessagesEv @ 17 NONAME
+	_ZN19ConversationsEngine22fetchMoreConversationsEv @ 18 NONAME
+	_ZN19ConversationsEngine24conversationModelUpdatedEv @ 19 NONAME
+	_ZN19ConversationsEngine24getCurrentConversationIdEv @ 20 NONAME
+	_ZN19ConversationsEngine26conversationModelPopulatedEv @ 21 NONAME
+	_ZN19ConversationsEngine26downloadOperationSupportedEi @ 22 NONAME
+	_ZN19ConversationsEngine28emitConversationModelUpdatedEv @ 23 NONAME
+	_ZN19ConversationsEngine28getConversationIdFromAddressE7QString @ 24 NONAME
+	_ZN19ConversationsEngine28getConversationsSummaryModelEv @ 25 NONAME
+	_ZN19ConversationsEngine30conversationListModelPopulatedEv @ 26 NONAME
+	_ZN19ConversationsEngine30emitConversationModelPopulatedEv @ 27 NONAME
+	_ZN19ConversationsEngine30getConversationIdFromContactIdEi @ 28 NONAME
+	_ZN19ConversationsEngine34emitConversationListModelPopulatedEv @ 29 NONAME
+	_ZN19ConversationsEngine8instanceEv @ 30 NONAME
+	_ZN19ConversationsEngineC1EP7QObject @ 31 NONAME
+	_ZN19ConversationsEngineC2EP7QObject @ 32 NONAME
+	_ZN19ConversationsEngineD0Ev @ 33 NONAME
+	_ZN19ConversationsEngineD1Ev @ 34 NONAME
+	_ZN19ConversationsEngineD2Ev @ 35 NONAME
+	_ZNK19ConversationsEngine10metaObjectEv @ 36 NONAME
+	_ZTI19ConversationsEngine @ 37 NONAME
+	_ZTV19ConversationsEngine @ 38 NONAME
 
--- a/messagingapp/msgui/eabi/conversationviewu.def	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/eabi/conversationviewu.def	Mon May 03 12:29:07 2010 +0300
@@ -1,26 +1,29 @@
 EXPORTS
-	_ZN23MsgConversationBaseView11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME
-	_ZN23MsgConversationBaseView11qt_metacastEPKc @ 2 NONAME
-	_ZN23MsgConversationBaseView12clearContentEv @ 3 NONAME
-	_ZN23MsgConversationBaseView16openConversationEx @ 4 NONAME
-	_ZN23MsgConversationBaseView16staticMetaObjectE @ 5 NONAME DATA 16
-	_ZN23MsgConversationBaseView18markMessagesAsReadEv @ 6 NONAME
-	_ZN23MsgConversationBaseView18openContactDetailsEv @ 7 NONAME
-	_ZN23MsgConversationBaseView19getStaticMetaObjectEv @ 8 NONAME
-	_ZN23MsgConversationBaseView19saveContentToDraftsEv @ 9 NONAME
-	_ZN23MsgConversationBaseView21closeConversationViewEv @ 10 NONAME
-	_ZN23MsgConversationBaseView22conversationViewClosedEv @ 11 NONAME
-	_ZN23MsgConversationBaseView8initViewEv @ 12 NONAME
-	_ZN23MsgConversationBaseViewC1EP13QGraphicsItem @ 13 NONAME
-	_ZN23MsgConversationBaseViewC2EP13QGraphicsItem @ 14 NONAME
-	_ZN23MsgConversationBaseViewD0Ev @ 15 NONAME
-	_ZN23MsgConversationBaseViewD1Ev @ 16 NONAME
-	_ZN23MsgConversationBaseViewD2Ev @ 17 NONAME
-	_ZNK23MsgConversationBaseView10metaObjectEv @ 18 NONAME
-	_ZTI23MsgConversationBaseView @ 19 NONAME
-	_ZTV23MsgConversationBaseView @ 20 NONAME
-	_ZThn16_N23MsgConversationBaseViewD0Ev @ 21 NONAME
-	_ZThn16_N23MsgConversationBaseViewD1Ev @ 22 NONAME
-	_ZThn8_N23MsgConversationBaseViewD0Ev @ 23 NONAME
-	_ZThn8_N23MsgConversationBaseViewD1Ev @ 24 NONAME
+	_ZN23MsgConversationBaseView10hideChromeEb @ 1 NONAME
+	_ZN23MsgConversationBaseView11handleErrorEiRK7QString @ 2 NONAME
+	_ZN23MsgConversationBaseView11qt_metacallEN11QMetaObject4CallEiPPv @ 3 NONAME
+	_ZN23MsgConversationBaseView11qt_metacastEPKc @ 4 NONAME
+	_ZN23MsgConversationBaseView12clearContentEv @ 5 NONAME
+	_ZN23MsgConversationBaseView16openConversationEx @ 6 NONAME
+	_ZN23MsgConversationBaseView16staticMetaObjectE @ 7 NONAME DATA 16
+	_ZN23MsgConversationBaseView18markMessagesAsReadEv @ 8 NONAME
+	_ZN23MsgConversationBaseView19getStaticMetaObjectEv @ 9 NONAME
+	_ZN23MsgConversationBaseView19saveContentToDraftsEv @ 10 NONAME
+	_ZN23MsgConversationBaseView21closeConversationViewEv @ 11 NONAME
+	_ZN23MsgConversationBaseView21doDelayedConstructionEv @ 12 NONAME
+	_ZN23MsgConversationBaseView22conversationViewClosedEv @ 13 NONAME
+	_ZN23MsgConversationBaseView8handleOkERK8QVariant @ 14 NONAME
+	_ZN23MsgConversationBaseView8initViewEv @ 15 NONAME
+	_ZN23MsgConversationBaseViewC1EP13QGraphicsItem @ 16 NONAME
+	_ZN23MsgConversationBaseViewC2EP13QGraphicsItem @ 17 NONAME
+	_ZN23MsgConversationBaseViewD0Ev @ 18 NONAME
+	_ZN23MsgConversationBaseViewD1Ev @ 19 NONAME
+	_ZN23MsgConversationBaseViewD2Ev @ 20 NONAME
+	_ZNK23MsgConversationBaseView10metaObjectEv @ 21 NONAME
+	_ZTI23MsgConversationBaseView @ 22 NONAME
+	_ZTV23MsgConversationBaseView @ 23 NONAME
+	_ZThn16_N23MsgConversationBaseViewD0Ev @ 24 NONAME
+	_ZThn16_N23MsgConversationBaseViewD1Ev @ 25 NONAME
+	_ZThn8_N23MsgConversationBaseViewD0Ev @ 26 NONAME
+	_ZThn8_N23MsgConversationBaseViewD1Ev @ 27 NONAME
 
--- a/messagingapp/msgui/eabi/msguiutilsu.def	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/eabi/msguiutilsu.def	Mon May 03 12:29:07 2010 +0300
@@ -1,29 +1,37 @@
 EXPORTS
-	_ZN17MatchPhNumberUtil11matchDigitsEv @ 1 NONAME
-	_ZN17MsgUiUtilsManager10fetchAudioEv @ 2 NONAME
-	_ZN17MsgUiUtilsManager10fetchOtherEv @ 3 NONAME
-	_ZN17MsgUiUtilsManager10fetchVideoEv @ 4 NONAME
-	_ZN17MsgUiUtilsManager11fetchImagesEv @ 5 NONAME
-	_ZN17MsgUiUtilsManager11qt_metacallEN11QMetaObject4CallEiPPv @ 6 NONAME
-	_ZN17MsgUiUtilsManager11qt_metacastEPKc @ 7 NONAME
-	_ZN17MsgUiUtilsManager12saveToDraftsER16ConvergedMessage @ 8 NONAME
-	_ZN17MsgUiUtilsManager12serviceErrorERK7QString @ 9 NONAME
-	_ZN17MsgUiUtilsManager13audiosFetchedERK8QVariant @ 10 NONAME
-	_ZN17MsgUiUtilsManager13fetchContactsEv @ 11 NONAME
-	_ZN17MsgUiUtilsManager13imagesFetchedERK8QVariant @ 12 NONAME
-	_ZN17MsgUiUtilsManager15contactsFetchedERK8QVariant @ 13 NONAME
-	_ZN17MsgUiUtilsManager16staticMetaObjectE @ 14 NONAME DATA 16
-	_ZN17MsgUiUtilsManager18openContactDetailsEi @ 15 NONAME
-	_ZN17MsgUiUtilsManager19getStaticMetaObjectEv @ 16 NONAME
-	_ZN17MsgUiUtilsManager20activateInputBlockerEP15QGraphicsWidget @ 17 NONAME
-	_ZN17MsgUiUtilsManager22deactivateInputBlockerEv @ 18 NONAME
-	_ZN17MsgUiUtilsManager4sendER16ConvergedMessage @ 19 NONAME
-	_ZN17MsgUiUtilsManagerC1EP7QObject @ 20 NONAME
-	_ZN17MsgUiUtilsManagerC2EP7QObject @ 21 NONAME
-	_ZN17MsgUiUtilsManagerD0Ev @ 22 NONAME
-	_ZN17MsgUiUtilsManagerD1Ev @ 23 NONAME
-	_ZN17MsgUiUtilsManagerD2Ev @ 24 NONAME
-	_ZNK17MsgUiUtilsManager10metaObjectEv @ 25 NONAME
-	_ZTI17MsgUiUtilsManager @ 26 NONAME
-	_ZTV17MsgUiUtilsManager @ 27 NONAME
+	_ZN11MsgSendUtil11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME
+	_ZN11MsgSendUtil11qt_metacastEPKc @ 2 NONAME
+	_ZN11MsgSendUtil12saveToDraftsER16ConvergedMessage @ 3 NONAME
+	_ZN11MsgSendUtil13getMmsMsgSizeER16ConvergedMessage @ 4 NONAME
+	_ZN11MsgSendUtil13getSmsMsgSizeER16ConvergedMessage @ 5 NONAME
+	_ZN11MsgSendUtil15validateServiceEP24UniEditorPluginInterfaceb @ 6 NONAME
+	_ZN11MsgSendUtil16staticMetaObjectE @ 7 NONAME DATA 16
+	_ZN11MsgSendUtil17checkEmailOverSmsER16ConvergedMessageRb @ 8 NONAME
+	_ZN11MsgSendUtil19getStaticMetaObjectEv @ 9 NONAME
+	_ZN11MsgSendUtil20checkMaxMsgSizeLimitER16ConvergedMessage @ 10 NONAME
+	_ZN11MsgSendUtil22checkMaxRecipientCountER16ConvergedMessage @ 11 NONAME
+	_ZN11MsgSendUtil23longestEmailAddressSizeE5QListIP23ConvergedMessageAddressE @ 12 NONAME
+	_ZN11MsgSendUtil4sendER16ConvergedMessage @ 13 NONAME
+	_ZN11MsgSendUtilC1EP7QObject @ 14 NONAME
+	_ZN11MsgSendUtilC2EP7QObject @ 15 NONAME
+	_ZN11MsgSendUtilD0Ev @ 16 NONAME
+	_ZN11MsgSendUtilD1Ev @ 17 NONAME
+	_ZN11MsgSendUtilD2Ev @ 18 NONAME
+	_ZN12MsgMediaUtil13mediaDurationERK7QString @ 19 NONAME
+	_ZN12MsgMediaUtil14mediaDurationLERK7TDesC16 @ 20 NONAME
+	_ZN12MsgMediaUtilC1Ev @ 21 NONAME
+	_ZN12MsgMediaUtilC2Ev @ 22 NONAME
+	_ZN12MsgMediaUtilD1Ev @ 23 NONAME
+	_ZN12MsgMediaUtilD2Ev @ 24 NONAME
+	_ZN19MmsConformanceCheck17launchEditorQueryEv @ 25 NONAME
+	_ZN19MmsConformanceCheck18checkModeForInsertERK7QStringb @ 26 NONAME
+	_ZN19MmsConformanceCheck21validateMsgForForwardEi @ 27 NONAME
+	_ZN19MmsConformanceCheck9showPopupERK7QString @ 28 NONAME
+	_ZN19MmsConformanceCheckC1Ev @ 29 NONAME
+	_ZN19MmsConformanceCheckC2Ev @ 30 NONAME
+	_ZN19MmsConformanceCheckD1Ev @ 31 NONAME
+	_ZN19MmsConformanceCheckD2Ev @ 32 NONAME
+	_ZNK11MsgSendUtil10metaObjectEv @ 33 NONAME
+	_ZTI11MsgSendUtil @ 34 NONAME
+	_ZTV11MsgSendUtil @ 35 NONAME
 
--- a/messagingapp/msgui/eabi/unifiededitoru.def	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/eabi/unifiededitoru.def	Mon May 03 12:29:07 2010 +0300
@@ -8,40 +8,50 @@
 	_ZN18CUniImageProcessorC2EP26MUniImageProcessorCallback @ 7 NONAME
 	_ZN20MsgUnifiedEditorView10addSubjectEv @ 8 NONAME
 	_ZN20MsgUnifiedEditorView10addToolBarEv @ 9 NONAME
-	_ZN20MsgUnifiedEditorView10launchHelpEv @ 10 NONAME
+	_ZN20MsgUnifiedEditorView10fetchAudioEv @ 10 NONAME
 	_ZN20MsgUnifiedEditorView10pluginPathEv @ 11 NONAME
-	_ZN20MsgUnifiedEditorView11packMessageER16ConvergedMessage @ 12 NONAME
-	_ZN20MsgUnifiedEditorView11qt_metacallEN11QMetaObject4CallEiPPv @ 13 NONAME
-	_ZN20MsgUnifiedEditorView11qt_metacastEPKc @ 14 NONAME
-	_ZN20MsgUnifiedEditorView11resizeEventEP25QGraphicsSceneResizeEvent @ 15 NONAME
-	_ZN20MsgUnifiedEditorView13addAttachmentERK7QString @ 16 NONAME
-	_ZN20MsgUnifiedEditorView13audiosFetchedERK8QVariant @ 17 NONAME
-	_ZN20MsgUnifiedEditorView13deleteMessageEv @ 18 NONAME
-	_ZN20MsgUnifiedEditorView13imagesFetchedERK8QVariant @ 19 NONAME
-	_ZN20MsgUnifiedEditorView14changePriorityEv @ 20 NONAME
-	_ZN20MsgUnifiedEditorView14sendingOptionsEv @ 21 NONAME
-	_ZN20MsgUnifiedEditorView15populateContentERK16ConvergedMessagei @ 22 NONAME
-	_ZN20MsgUnifiedEditorView16staticMetaObjectE @ 23 NONAME DATA 16
-	_ZN20MsgUnifiedEditorView17openDraftsMessageER18ConvergedMessageIdN16ConvergedMessage11MessageTypeE @ 24 NONAME
-	_ZN20MsgUnifiedEditorView19getStaticMetaObjectEv @ 25 NONAME
-	_ZN20MsgUnifiedEditorView19saveContentToDraftsEv @ 26 NONAME
-	_ZN20MsgUnifiedEditorView19showAttachmentPopupEv @ 27 NONAME
-	_ZN20MsgUnifiedEditorView21populateDraftsContentERK16ConvergedMessage @ 28 NONAME
-	_ZN20MsgUnifiedEditorView25removeAttachmentContainerEv @ 29 NONAME
-	_ZN20MsgUnifiedEditorView25updateOtherRecipientCountEb @ 30 NONAME
-	_ZN20MsgUnifiedEditorView4sendEv @ 31 NONAME
-	_ZN20MsgUnifiedEditorView7addMenuEv @ 32 NONAME
-	_ZN20MsgUnifiedEditorView8addCcBccEv @ 33 NONAME
-	_ZN20MsgUnifiedEditorViewC1EP13QGraphicsItem @ 34 NONAME
-	_ZN20MsgUnifiedEditorViewC2EP13QGraphicsItem @ 35 NONAME
-	_ZN20MsgUnifiedEditorViewD0Ev @ 36 NONAME
-	_ZN20MsgUnifiedEditorViewD1Ev @ 37 NONAME
-	_ZN20MsgUnifiedEditorViewD2Ev @ 38 NONAME
-	_ZNK20MsgUnifiedEditorView10metaObjectEv @ 39 NONAME
-	_ZTI20MsgUnifiedEditorView @ 40 NONAME
-	_ZTV20MsgUnifiedEditorView @ 41 NONAME
-	_ZThn16_N20MsgUnifiedEditorViewD0Ev @ 42 NONAME
-	_ZThn16_N20MsgUnifiedEditorViewD1Ev @ 43 NONAME
-	_ZThn8_N20MsgUnifiedEditorViewD0Ev @ 44 NONAME
-	_ZThn8_N20MsgUnifiedEditorViewD1Ev @ 45 NONAME
+	_ZN20MsgUnifiedEditorView11fetchImagesEv @ 12 NONAME
+	_ZN20MsgUnifiedEditorView11packMessageER16ConvergedMessage @ 13 NONAME
+	_ZN20MsgUnifiedEditorView11qt_metacallEN11QMetaObject4CallEiPPv @ 14 NONAME
+	_ZN20MsgUnifiedEditorView11qt_metacastEPKc @ 15 NONAME
+	_ZN20MsgUnifiedEditorView11resizeEventEP25QGraphicsSceneResizeEvent @ 16 NONAME
+	_ZN20MsgUnifiedEditorView12createVCardsERK8QVariantR11QStringList @ 17 NONAME
+	_ZN20MsgUnifiedEditorView13addAttachmentERK7QString @ 18 NONAME
+	_ZN20MsgUnifiedEditorView13audiosFetchedERK8QVariant @ 19 NONAME
+	_ZN20MsgUnifiedEditorView13deleteMessageEv @ 20 NONAME
+	_ZN20MsgUnifiedEditorView13fetchContactsEv @ 21 NONAME
+	_ZN20MsgUnifiedEditorView13imagesFetchedERK8QVariant @ 22 NONAME
+	_ZN20MsgUnifiedEditorView14addAttachmentsE11QStringList @ 23 NONAME
+	_ZN20MsgUnifiedEditorView14changePriorityEv @ 24 NONAME
+	_ZN20MsgUnifiedEditorView14forwardMessageER18ConvergedMessageIdN16ConvergedMessage11MessageTypeE @ 25 NONAME
+	_ZN20MsgUnifiedEditorView14sendingOptionsEv @ 26 NONAME
+	_ZN20MsgUnifiedEditorView15contactsFetchedERK8QVariant @ 27 NONAME
+	_ZN20MsgUnifiedEditorView15populateContentERK5QListI8QVariantE @ 28 NONAME
+	_ZN20MsgUnifiedEditorView16generateFileNameER7QString @ 29 NONAME
+	_ZN20MsgUnifiedEditorView16staticMetaObjectE @ 30 NONAME DATA 16
+	_ZN20MsgUnifiedEditorView17openDraftsMessageERK5QListI8QVariantE @ 31 NONAME
+	_ZN20MsgUnifiedEditorView19getStaticMetaObjectEv @ 32 NONAME
+	_ZN20MsgUnifiedEditorView19saveContentToDraftsEv @ 33 NONAME
+	_ZN20MsgUnifiedEditorView19serviceRequestErrorEiRK7QString @ 34 NONAME
+	_ZN20MsgUnifiedEditorView20activateInputBlockerEv @ 35 NONAME
+	_ZN20MsgUnifiedEditorView22deactivateInputBlockerEv @ 36 NONAME
+	_ZN20MsgUnifiedEditorView23handleViewExtnActivatedEP16HbListWidgetItem @ 37 NONAME
+	_ZN20MsgUnifiedEditorView25populateContentIntoEditorERK16ConvergedMessage @ 38 NONAME
+	_ZN20MsgUnifiedEditorView25removeAttachmentContainerEv @ 39 NONAME
+	_ZN20MsgUnifiedEditorView25updateOtherRecipientCountEb @ 40 NONAME
+	_ZN20MsgUnifiedEditorView4sendEv @ 41 NONAME
+	_ZN20MsgUnifiedEditorView7addMenuEv @ 42 NONAME
+	_ZN20MsgUnifiedEditorView8addCcBccEv @ 43 NONAME
+	_ZN20MsgUnifiedEditorViewC1EP13QGraphicsItem @ 44 NONAME
+	_ZN20MsgUnifiedEditorViewC2EP13QGraphicsItem @ 45 NONAME
+	_ZN20MsgUnifiedEditorViewD0Ev @ 46 NONAME
+	_ZN20MsgUnifiedEditorViewD1Ev @ 47 NONAME
+	_ZN20MsgUnifiedEditorViewD2Ev @ 48 NONAME
+	_ZNK20MsgUnifiedEditorView10metaObjectEv @ 49 NONAME
+	_ZTI20MsgUnifiedEditorView @ 50 NONAME
+	_ZTV20MsgUnifiedEditorView @ 51 NONAME
+	_ZThn16_N20MsgUnifiedEditorViewD0Ev @ 52 NONAME
+	_ZThn16_N20MsgUnifiedEditorViewD1Ev @ 53 NONAME
+	_ZThn8_N20MsgUnifiedEditorViewD0Ev @ 54 NONAME
+	_ZThn8_N20MsgUnifiedEditorViewD1Ev @ 55 NONAME
 
--- a/messagingapp/msgui/eabi/unifiedvieweru.def	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/eabi/unifiedvieweru.def	Mon May 03 12:29:07 2010 +0300
@@ -2,24 +2,25 @@
 	_ZN13UnifiedViewer11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME
 	_ZN13UnifiedViewer11qt_metacastEPKc @ 2 NONAME
 	_ZN13UnifiedViewer11resizeEventEP25QGraphicsSceneResizeEvent @ 3 NONAME
-	_ZN13UnifiedViewer12clearContentEv @ 4 NONAME
-	_ZN13UnifiedViewer13createToolBarEv @ 5 NONAME
-	_ZN13UnifiedViewer15handleFwdActionEv @ 6 NONAME
-	_ZN13UnifiedViewer15populateContentEibi @ 7 NONAME
-	_ZN13UnifiedViewer16staticMetaObjectE @ 8 NONAME DATA 16
-	_ZN13UnifiedViewer18handleDeleteActionEv @ 9 NONAME
-	_ZN13UnifiedViewer19getStaticMetaObjectEv @ 10 NONAME
-	_ZN13UnifiedViewerC1EiP13QGraphicsItem @ 11 NONAME
-	_ZN13UnifiedViewerC2EiP13QGraphicsItem @ 12 NONAME
-	_ZN13UnifiedViewerD0Ev @ 13 NONAME
-	_ZN13UnifiedViewerD1Ev @ 14 NONAME
-	_ZN13UnifiedViewerD2Ev @ 15 NONAME
-	_ZNK13UnifiedViewer10metaObjectEv @ 16 NONAME
-	_ZTI13UnifiedViewer @ 17 NONAME
-	_ZTV13UnifiedViewer @ 18 NONAME
-	_ZThn16_N13UnifiedViewerD0Ev @ 19 NONAME
-	_ZThn16_N13UnifiedViewerD1Ev @ 20 NONAME
-	_ZThn8_N13UnifiedViewerD0Ev @ 21 NONAME
-	_ZThn8_N13UnifiedViewerD1Ev @ 22 NONAME
-	_ZN13UnifiedViewer11sendMessageERK7QString @ 23 NONAME
+	_ZN13UnifiedViewer11sendMessageERK7QString @ 4 NONAME
+	_ZN13UnifiedViewer12clearContentEv @ 5 NONAME
+	_ZN13UnifiedViewer13createToolBarEv @ 6 NONAME
+	_ZN13UnifiedViewer15handleFwdActionEv @ 7 NONAME
+	_ZN13UnifiedViewer15populateContentEibi @ 8 NONAME
+	_ZN13UnifiedViewer16staticMetaObjectE @ 9 NONAME DATA 16
+	_ZN13UnifiedViewer18handleDeleteActionEv @ 10 NONAME
+	_ZN13UnifiedViewer19getStaticMetaObjectEv @ 11 NONAME
+	_ZN13UnifiedViewer21validateMsgForForwardEv @ 12 NONAME
+	_ZN13UnifiedViewerC1EiP13QGraphicsItem @ 13 NONAME
+	_ZN13UnifiedViewerC2EiP13QGraphicsItem @ 14 NONAME
+	_ZN13UnifiedViewerD0Ev @ 15 NONAME
+	_ZN13UnifiedViewerD1Ev @ 16 NONAME
+	_ZN13UnifiedViewerD2Ev @ 17 NONAME
+	_ZNK13UnifiedViewer10metaObjectEv @ 18 NONAME
+	_ZTI13UnifiedViewer @ 19 NONAME
+	_ZTV13UnifiedViewer @ 20 NONAME
+	_ZThn16_N13UnifiedViewerD0Ev @ 21 NONAME
+	_ZThn16_N13UnifiedViewerD1Ev @ 22 NONAME
+	_ZThn8_N13UnifiedViewerD0Ev @ 23 NONAME
+	_ZThn8_N13UnifiedViewerD1Ev @ 24 NONAME
 
--- a/messagingapp/msgui/inc/msgbaseview.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/inc/msgbaseview.h	Mon May 03 12:29:07 2010 +0300
@@ -51,7 +51,7 @@
     /**
      * enum definition for differentiating switchview to unieditor command further
      */
-    enum UniEditorFields
+    enum UniEditorOperation
         {
         ADD_PHOTO = 0x01,
         ADD_AUDIO = 0x02,
@@ -59,7 +59,8 @@
         ADD_VCARD = 0x08,
         ADD_OTHERS = 0x10,
         ADD_RECIPIENTS = 0x20,
-        ADD_SUBJECT = 0x40
+        ADD_SUBJECT = 0x40,
+        FORWARD_MSG = 0x80
         };
     
     signals:
--- a/messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgcontactcardwidget.css	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgcontactcardwidget.css	Mon May 03 12:29:07 2010 +0300
@@ -32,7 +32,6 @@
   center-vertical:0un;
   text-height:var(hb-param-text-height-primary);
   font-variant:primary;
-  text-height:var(hb-param-text-height-primary);
   text-line-count-min:1;
   text-line-count-max:1;
 }
--- a/messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgcontactcardwidget.widgetml	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgcontactcardwidget.widgetml	Mon May 03 12:29:07 2010 +0300
@@ -11,9 +11,5 @@
     <meshitem src="addressText" srcEdge="RIGHT" dst="presence" dstEdge="LEFT"/>
     <meshitem src="addressText" srcEdge="CENTERV" dst="" dstEdge="CENTERV"/>
 
-    <meshitem src="backgroundFrame" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
-    <meshitem src="backgroundFrame" srcEdge="TOP" dst="" dstEdge="TOP"/>
-    <meshitem src="backgroundFrame" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
-    <meshitem src="backgroundFrame" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"/>
   </layout>
 </hbwidget>
\ No newline at end of file
--- a/messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgconversationviewitem.css	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgconversationviewitem.css	Mon May 03 12:29:07 2010 +0300
@@ -3,7 +3,7 @@
     layout:layout-incoming;
     pref-height:-1;
     pref-width:-1;
-
+    size-policy-vertical:minimum-expanding;
 }
 
 MsgConversationViewItem[isIncoming="false"]
@@ -11,17 +11,26 @@
     layout:layout-outgoing;
     pref-height:-1;
     pref-width:-1;
-
+    size-policy-vertical:minimum-expanding;
 }
 
 MsgConversationViewItem[isIncoming="true"]::msgconvwidget
 {
   left:-var(hb-param-margin-gene-left);
   top:0.0un;
-  right:6.75un;
+  right:var(hb-param-margin-gene-middle-horizontal);
   bottom:0.0un;
 }
 
+MsgConversationViewItem[isIncoming="true"]::msgStateIcon
+{
+  right:var(hb-param-margin-gene-right);
+  size-policy:fixed fixed;
+  aspect-ratio:ignore;
+  pref-height:var(hb-param-graphic-size-primary-small);
+  pref-width:var(hb-param-graphic-size-primary-small);
+}
+
 MsgConversationViewItem[isIncoming="false"]::msgconvwidget
 {
   top:0.0un;
--- a/messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgconversationviewitem.widgetml	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgconversationviewitem.widgetml	Mon May 03 12:29:07 2010 +0300
@@ -1,8 +1,11 @@
 <hbwidget version="0.1">
   <layout name="layout-incoming" type="mesh">
+    <meshitem src="msgStateIcon" srcEdge="RIGHT" dst="" dstEdge="RIGHT"/>
+    <meshitem src="msgStateIcon" srcEdge="CENTERV" dst="" dstEdge="CENTERV"/>
+    
+    <meshitem src="msgconvwidget" srcEdge="RIGHT" dst="msgStateIcon" dstEdge="LEFT" />
     <meshitem src="msgconvwidget" srcEdge="TOP" dst="" dstEdge="TOP" />
     <meshitem src="msgconvwidget" srcEdge="LEFT" dst="" dstEdge="LEFT" />
-    <meshitem src="msgconvwidget" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
     <meshitem src="msgconvwidget" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
   </layout>
 
--- a/messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgconversationwidget.css	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgconversationwidget.css	Mon May 03 12:29:07 2010 +0300
@@ -56,7 +56,6 @@
   top:0.0un;
   right:0.0un;
   bottom:0.0un;
-  size-policy:expanding minimum-expanding;
 }
 
 /********************************** BODYTEXT **********************************/
@@ -71,7 +70,7 @@
   font-variant:primary;
   text-align:left;
   text-line-count-min:1;
-  text-line-count-max:2;
+  text-line-count-max:100;
 }
 
 MsgConversationWidget[isMMS="true"][hasImage="true"]::bodyText:landscape
--- a/messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgconversationwidget.widgetml	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgconversationwidget.widgetml	Mon May 03 12:29:07 2010 +0300
@@ -64,7 +64,6 @@
   <layout name="layout-mms-image-landscape" type="mesh">
 
     <meshitem src="preview" srcEdge="TOP" dst="" dstEdge="TOP" />
-    <meshitem src="preview" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
     <meshitem src="preview" srcEdge="LEFT" dst="" dstEdge="LEFT" />
 
     <meshitem src="subject" srcEdge="TOP" dst="" dstEdge="TOP" />
@@ -84,6 +83,7 @@
 
     <meshitem src="timeStamp" srcEdge="LEFT" dst="preview" dstEdge="RIGHT" />
     <meshitem src="timeStamp" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+    <meshitem src="timeStamp" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"/>
 
     <meshitem src="newItemIcon" srcEdge="LEFT" dst="" dstEdge="LEFT"/>
     <meshitem src="newItemIcon" srcEdge="TOP" dst="" dstEdge="TOP"/>
--- a/messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgeditorwidget.css	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgeditorwidget.css	Mon May 03 12:29:07 2010 +0300
@@ -8,14 +8,23 @@
   left:-var(hb-param-margin-gene-middle-horizontal);
   right:var(hb-param-margin-gene-middle-horizontal);
   bottom:var(hb-param-margin-gene-middle-vertical);
+  top:-var(hb-param-margin-gene-middle-vertical); 
   min-height:7.46un;
 }
 
 MsgEditorWidget::sendButton
 {
-  top:0.0un;
+  top:-var(hb-param-margin-gene-middle-vertical);
   right:var(hb-param-margin-gene-middle-horizontal);
-  size-policy:fixed fixed;
-  pref-height:7.46un;
-  pref-width:9.34un;
-}
\ No newline at end of file
+  bottom:var(hb-param-margin-gene-middle-vertical);
+  fixed-width: 9.34un;
+  fixed-height: 7.46un;
+}
+
+MsgEditorWidget::charCounter
+{
+	  size-policy:fixed fixed;
+	  pref-height:-1;
+	  pref-width:-1;
+	  text-height:var(hb-param-text-height-tiny);
+}
--- a/messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgeditorwidget.widgetml	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/layoutplugins/conversationviewplugin/resources/msgeditorwidget.widgetml	Mon May 03 12:29:07 2010 +0300
@@ -1,11 +1,21 @@
 <hbwidget version="0.1">
   <layout name="layout-msg-editor" type="mesh">
-    <meshitem src="sendButton" srcEdge="TOP" dst="msgEditor" dstEdge="TOP" />
-    <meshitem src="sendButton" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
 
     <meshitem src="msgEditor" srcEdge="LEFT" dst="" dstEdge="LEFT" />
-    <meshitem src="" srcEdge="TOP" dst="msgEditor" dstEdge="TOP" />
+    <meshitem src="msgEditor" srcEdge="TOP" dst="" dstEdge="TOP" />
     <meshitem src="msgEditor" srcEdge="RIGHT" dst="sendButton" dstEdge="LEFT" />
     <meshitem src="msgEditor" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+    
+    <meshitem src="sendButton" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+    <meshitem src="sendButton" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+    
+    <meshitem src="charCounter" srcEdge="TOP" dst="msgEditor" dstEdge="TOP" />
+    <meshitem src="charCounter" srcEdge="RIGHT" dst="msgEditor" dstEdge="RIGHT" />
+
+    <meshitem src="charCounterFrame" srcEdge="LEFT" dst="charCounter" dstEdge="LEFT" />
+    <meshitem src="charCounterFrame" srcEdge="TOP" dst="charCounter" dstEdge="TOP" />
+    <meshitem src="charCounterFrame" srcEdge="RIGHT" dst="charCounter" dstEdge="RIGHT" />
+    <meshitem src="charCounterFrame" srcEdge="BOTTOM" dst="charCounter" dstEdge="BOTTOM" /> 
+    
   </layout>
 </hbwidget>
\ No newline at end of file
--- a/messagingapp/msgui/layoutplugins/layoutplugins.pro	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/layoutplugins/layoutplugins.pro	Mon May 03 12:29:07 2010 +0300
@@ -19,6 +19,5 @@
 
 SYMBIAN_PLATFORMS = WINSCW ARMV5
 
-SUBDIRS += msglistviewitemplugin/msglistviewitemplugin.pro
 SUBDIRS += conversationviewplugin/conversationviewplugin.pro
 SUBDIRS += unifiededitorplugin/unifiededitorplugin.pro
--- a/messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitoraddress.css	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitoraddress.css	Mon May 03 12:29:07 2010 +0300
@@ -8,17 +8,14 @@
 
 MsgUnifiedEditorAddress::launchBtn {
 	right: var(hb-param-margin-gene-right);
-	left: -var(hb-param-margin-gene-middle-horizontal);
-	size-policy-vertical: fixed;
-	size-policy-horizontal: fixed;
 	fixed-width: 9.5un;
 	fixed-height: 7.46un;
 }
 
 MsgUnifiedEditorAddress::addressField {
-	top: -var(hb-param-margin-gene-top);
 	left: -var(hb-param-margin-gene-left);
-	min-height:7.46un;
-}
+	right: var(hb-param-margin-gene-middle-horizontal);
+	min-height: 7.46un;
+	}
 
 
--- a/messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitoraddress.widgetml	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitoraddress.widgetml	Mon May 03 12:29:07 2010 +0300
@@ -3,11 +3,13 @@
 
      <meshitem src="addressField" srcEdge="TOP" dst="" dstEdge="TOP" />
      <meshitem src="addressField" srcEdge="LEFT" dst="" dstEdge="LEFT" />
-     <meshitem src="" srcEdge="BOTTOM" dst="addressField" dstEdge="BOTTOM" />     
+     <meshitem src="addressField" srcEdge="RIGHT" dst="launchBtn" dstEdge="LEFT" />
+     <meshitem src="" srcEdge="BOTTOM" dst="addressField" dstEdge="BOTTOM" />  
+     
+     
+     <meshitem src="launchBtn" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+     <meshitem src="launchBtn" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />    
           
-     <meshitem src="launchBtn" srcEdge="LEFT" dst="addressField" dstEdge="RIGHT" />
-     <meshitem src="launchBtn" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
-     <meshitem src="launchBtn" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" /> 
           
   </layout>
 </hbwidget>
\ No newline at end of file
--- a/messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitorbody.css	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitorbody.css	Mon May 03 12:29:07 2010 +0300
@@ -85,3 +85,12 @@
     left: -var(hb-param-margin-gene-left);
     right: var(hb-param-margin-gene-right);
 }
+
+/*************************** Character Counter ******************************/
+MsgUnifiedEditorBody::charCounter
+{
+	  size-policy:fixed fixed;
+	  pref-height:-1;
+	  pref-width:-1;
+	  text-height:var(hb-param-text-height-tiny);
+}
--- a/messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitorbody.widgetml	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitorbody.widgetml	Mon May 03 12:29:07 2010 +0300
@@ -20,6 +20,14 @@
      <meshitem src="textEditFrame" srcEdge="LEFT" dst="textEdit" dstEdge="LEFT" />
      <meshitem src="textEditFrame" srcEdge="RIGHT" dst="textEdit" dstEdge="RIGHT" />
      
+    <meshitem src="charCounter" srcEdge="TOP" dst="textEdit" dstEdge="TOP" />
+    <meshitem src="charCounter" srcEdge="RIGHT" dst="textEdit" dstEdge="RIGHT" />
+
+    <meshitem src="charCounterFrame" srcEdge="LEFT" dst="charCounter" dstEdge="LEFT" />
+    <meshitem src="charCounterFrame" srcEdge="TOP" dst="charCounter" dstEdge="TOP" />
+    <meshitem src="charCounterFrame" srcEdge="RIGHT" dst="charCounter" dstEdge="RIGHT" />
+    <meshitem src="charCounterFrame" srcEdge="BOTTOM" dst="charCounter" dstEdge="BOTTOM" />    
+     
   </layout>
   
   <layout name="layout-landscape-no-image" type="mesh">     
@@ -37,6 +45,14 @@
      <meshitem src="textEditFrame" srcEdge="LEFT" dst="textEdit" dstEdge="LEFT" />
      <meshitem src="textEditFrame" srcEdge="RIGHT" dst="textEdit" dstEdge="RIGHT" />
      <meshitem src="textEditFrame" srcEdge="BOTTOM" dst="textEdit" dstEdge="BOTTOM" />     
+
+     <meshitem src="charCounter" srcEdge="TOP" dst="textEdit" dstEdge="TOP" />
+     <meshitem src="charCounter" srcEdge="RIGHT" dst="textEdit" dstEdge="RIGHT" />
+
+     <meshitem src="charCounterFrame" srcEdge="LEFT" dst="charCounter" dstEdge="LEFT" />
+     <meshitem src="charCounterFrame" srcEdge="TOP" dst="charCounter" dstEdge="TOP" />
+     <meshitem src="charCounterFrame" srcEdge="RIGHT" dst="charCounter" dstEdge="RIGHT" />
+     <meshitem src="charCounterFrame" srcEdge="BOTTOM" dst="charCounter" dstEdge="BOTTOM" />    
   
   </layout>
   
@@ -59,7 +75,15 @@
      <meshitem src="pixmap" srcEdge="TOP" dst="audioItem" dstEdge="BOTTOM"  />    
      <meshitem src="pixmap" srcEdge="LEFT" dst="" dstEdge="LEFT" />
      <meshitem src="pixmap" srcEdge="RIGHT" dst="textEdit" dstEdge="LEFT" />
-  
+
+     <meshitem src="charCounter" srcEdge="TOP" dst="textEdit" dstEdge="TOP" />
+     <meshitem src="charCounter" srcEdge="RIGHT" dst="textEdit" dstEdge="RIGHT" />
+
+     <meshitem src="charCounterFrame" srcEdge="LEFT" dst="charCounter" dstEdge="LEFT" />
+     <meshitem src="charCounterFrame" srcEdge="TOP" dst="charCounter" dstEdge="TOP" />
+     <meshitem src="charCounterFrame" srcEdge="RIGHT" dst="charCounter" dstEdge="RIGHT" />
+     <meshitem src="charCounterFrame" srcEdge="BOTTOM" dst="charCounter" dstEdge="BOTTOM" />    
+
   </layout>
   
 </hbwidget>
\ No newline at end of file
--- a/messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitorsubject.css	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitorsubject.css	Mon May 03 12:29:07 2010 +0300
@@ -7,15 +7,6 @@
     layout:layout-default;
 }
 
-MsgUnifiedEditorSubject::subjectLabel {
-    left: -var(hb-param-margin-gene-left);
-    size-policy-vertical: fixed;
-    size-policy-horizontal: fixed;
-    fixed-width: 9.5un;
-    fixed-height: 7.46un;
-    text-align: center;
-}
-
 MsgUnifiedEditorSubject::priorityIcon {
     fixed-height: var(hb-param-graphic-size-secondary);
     fixed-width: var(hb-param-graphic-size-secondary);
@@ -24,6 +15,7 @@
 }
 
 MsgUnifiedEditorSubject::subjectEdit {
+    left: -var(hb-param-margin-gene-left);
     min-height:7.46un;
-}
+    }
 
--- a/messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitorsubject.widgetml	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/layoutplugins/unifiededitorplugin/resources/msgunifiededitorsubject.widgetml	Mon May 03 12:29:07 2010 +0300
@@ -1,11 +1,8 @@
 <hbwidget version="0.1">
   <layout name="layout-default" type="mesh">
-     
-     <meshitem src="subjectLabel" srcEdge="LEFT" dst="" dstEdge="LEFT" />
-     <meshitem src="subjectLabel" srcEdge="TOP" dst="" dstEdge="TOP" />
 
      <meshitem src="subjectEdit" srcEdge="TOP" dst="" dstEdge="TOP" />
-     <meshitem src="subjectEdit" srcEdge="LEFT" dst="subjectLabel" dstEdge="RIGHT" />
+     <meshitem src="subjectEdit" srcEdge="LEFT" dst="" dstEdge="LEFT" />
      <meshitem src="subjectEdit" srcEdge="RIGHT" dst="priorityIcon" dstEdge="LEFT" />
      <meshitem src="" srcEdge="BOTTOM" dst="subjectEdit" dstEdge="BOTTOM" />
      
--- a/messagingapp/msgui/msgapp/inc/draftslistview.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/msgapp/inc/draftslistview.h	Mon May 03 12:29:07 2010 +0300
@@ -21,6 +21,7 @@
 #include <msgbaseview.h>
 
 // FORWARD DECLARATIONS
+class HbToolBar;
 class HbListView;
 class HbListWidget;
 class HbListWidgetItem;
@@ -45,10 +46,6 @@
     virtual ~DraftsListView();
 
 private:
-    /**
-     * Creates the view items like menu, toolbar & list etc.
-     */
-    void createView();
 
     /**
      * Creates the menu items.
@@ -66,6 +63,12 @@
     void setupListView();
 
 private slots:
+
+    /**
+     * Do delayed loading.
+     */
+    void doDelayedLoading();
+
     /**
      * Opens a Draft message.
      */
@@ -77,6 +80,11 @@
     void deleteDraftMessage();
 
     /**
+     * Deletes all Draft messages.
+     */
+    void deleteAllDraftMessage();
+
+    /**
      * Invokes editor for creating new message.
      */
     void createNewMessage();
@@ -100,6 +108,11 @@
      */
     void handleViewExtnActivated(HbListWidgetItem *item);
 
+    /**
+     * This slot is hit when rows are inserted/removed in model.
+     */
+    void handleModelChanged();
+
 private:
 
     /**
@@ -115,6 +128,12 @@
     HbListWidget *mViewExtnList;
 
     /**
+     * Pointer to views toolbar.
+     * Not Own.
+     */
+    HbToolBar *mToolBar;
+
+    /**
      * Views in toolbar extension.
      */
     enum viewExtnIds
--- a/messagingapp/msgui/msgapp/inc/msglistview.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/msgapp/inc/msglistview.h	Mon May 03 12:29:07 2010 +0300
@@ -26,7 +26,6 @@
 class HbAbstractViewItem;
 class HbListWidget;
 class HbListWidgetItem;
-class QSortFilterProxyModel;
 
 /**
  * This class provides the message list view for the messaging application.
@@ -47,11 +46,6 @@
      */
     virtual ~MsgListView();
 
-    /**
-     * This function starts effect on ListView
-     */
-    void activateView();
-
 private slots:
     /*
      * Handler for long tap of a list item.
@@ -67,44 +61,12 @@
      */
     void openConversation(const QModelIndex& index);
 
-    //----------------- View specific Menu Slots---------------------------//
-
-    /**
-     * Sorts conversation data model based on subject
-     */
-    void sortBySubject();
-
-    /**
-     * Sorts conversation data model based on timestamp
-     */
-    void sortByDate();
-
-    /**
-     * Sorts conversation data model based on sender
-     */
-    void sortBySender();
-
     /**
      * Handler for new message button trigger
      */
     void sendNewMessage();
 
     /**
-     * Handler for closing all the active chats
-     */
-    void closeActiveChats();
-
-    /**
-     * Deletes all the conversations
-     */
-    void deleteAll();
-
-    /**
-     * Lists all the Im Messages separately
-     */
-    void viewImMessagesSeparately();
-
-    /**
      *Popup the message settings dialog
      */
     void settings();
@@ -126,27 +88,30 @@
      */
     void deleteItem();
 
-    // ------------------------------- End ----------------------------- //
-
-    /**
-     * Connect Model to view
-     */
-    void populateListView();
-
     /**
      * Handles toolbar extension item clicks.
      * @param item Activated toolbar extension item.
      */
     void handleViewExtnActivated(HbListWidgetItem *item);
+    
+    /**
+     * Constructs view when viewReady is emitted.
+     */
+    void doDelayedConstruction();
+    
+    /**
+     * Handles saving to contacts
+     */
+    void saveToContacts();
+    
+    /**
+     * Opens contact card for resolved contact.
+     */
+    void contactInfo();
 
 private:
 
     /**
-     * createView
-     */
-    void createView();
-
-    /**
      * Initialize the list view inside the main view
      */
     void setupListView();
@@ -169,12 +134,6 @@
     HbListView* mMsgList;
 
     /**
-     * Proxy model for sorting and filtering.
-     * Own.
-     */
-    QSortFilterProxyModel *mProxyModel;
-
-    /**
      * Container widget of toolbar extension.
      * ToolBar takes ownership.
      */
--- a/messagingapp/msgui/msgapp/inc/msglistviewitem.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/msgapp/inc/msglistviewitem.h	Mon May 03 12:29:07 2010 +0300
@@ -72,7 +72,21 @@
      * @return bool
      */
     bool hasUnReadMsg();
- 		    
+    
+private:
+
+    /**
+     * Returns the preview text based on message type, sub type and state.
+     * @return QString
+     */
+    QString previewText(int msgType, int msgSubType, int msgState,int msgDirection);
+ 
+    /**
+     * return the preview text based on state.
+     * @return bool
+     */
+    QString textBySendState(int sendState,int msgDirection);
+    
 private:
     /**
  	   * Property to change the color of text
--- a/messagingapp/msgui/msgapp/inc/msgserviceinterface.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/msgapp/inc/msgserviceinterface.h	Mon May 03 12:29:07 2010 +0300
@@ -40,12 +40,11 @@
     /**
      * Constructor
      */
-    ContactDetail():contactId(-1),firstName(QString()),
-                    lastName(QString()){};
+    ContactDetail():contactId(-1),displayName(QString()){};
+    
 public:
     int contactId;
-    QString firstName;
-    QString lastName;
+    QString displayName;
     QStringList addressList;
 };
 
@@ -82,11 +81,22 @@
      */
     void send(QVariant data);
     
+     /**
+     * Opens the viewer to view the message.
+     * @param msgId message id of the message.
+     */
+    void view(int msgId);
+    
     /**
      * depricated api. will be removed in future.
      */
     void openConversationView(QString number, QString name);
-    
+
+    /**
+     * send called with prepopulated message body.
+     */
+    void send(const QString phoneNumber, const QString alias, const QString bodyText);
+
 signals:
 
 private:
--- a/messagingapp/msgui/msgapp/inc/msgviewmanager.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/msgapp/inc/msgviewmanager.h	Mon May 03 12:29:07 2010 +0300
@@ -33,57 +33,68 @@
 class HbAction;
 
 class MsgViewManager: public QObject
-    {
-    Q_OBJECT   
-   
+{
+Q_OBJECT
+
 public:
     /**
      * constructor
      */
     MsgViewManager(bool serviceRequest, HbMainWindow* mainWindow, QObject* parent = 0);
-    
+
     /**
      * Destructor.
      */
     ~MsgViewManager();
-    
+
     /**
      * call back function will be called from MsgServiceInterface.
      */
     void send(const qint32 contactId, const QString phoneNumber, const QString displayName);
-    
+
     /**
      * call back function called from MsgServiceInterface to set service request flag.
      */
     void setServiceRequest(bool request);
-    
+
     /**
      * call back function called MsgServiceInterface.
      */
     void open(qint64 conversationId);
-    
+
     /**
      * call back function called MsgServiceInterface.
      */
     void send(QVariant data);
-    
+
     /**
      * depricated api. will be removed in future.
      */
     void openEditor(QString number, QString name);
-    
+
+    /**
+     * call back function will be called from MsgServiceInterface.
+     */
+    void send(const QString phoneNumber, const QString alias, const QString bodyText);
+
+    /**
+     * Opens the viewer to view the message.
+     * @param msgId message id of the message.
+     */
+    void view(int msgId);
+
 private:
     /**
      * swiches back to last view after service request is complete.
      */
     void switchToLastSavedView();
-    
+
     /**
      * find conversation id corresponding to given phone no.
      * @param phoneNum
      */
     qint64 findConversationId(const QString phoneNum);
-    
+
     /**
      * helper method to complete back action.
      */
@@ -124,23 +135,41 @@
      */
     void handleDefault(const QVariantList& data);
 
+    /**
+     * handle sms and mms messge
+     * @param msgId message id
+     */
+    void handleSmsMmsMsg(int msgId);
+
+    /**
+     * handle ringtone message
+     * @param msgId message id
+     */
+    void handleRingtoneMsg(int msgId);
+
+    /**
+     * handle provisioning message
+     * @param msgId message id
+     */
+    void handleProvisoningMsg(int msgId);
+
 private slots:
     /**
      * this slot is called on mainwindows back action.
      */
     void onBackAction();
-    
+
     /**
      * This slot is called when switchView signal is emitted from a view.
      */
     void switchView(const QVariantList& data);
-    
+
 private:
     /**
      * main window reference not owned.
      */
     HbMainWindow* mMainWindow;
-    
+
     /**
      * different views.
      */
@@ -157,6 +186,7 @@
     int mViewAtServiceRequest;
     bool mServiceRequest;
     qint64 mConversationId;
-    };
+    bool mViewServiceRequest;
+};
 
 #endif /* MSGVIEWMANAGER_H_ */
--- a/messagingapp/msgui/msgapp/messaging_service.xml	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/msgapp/messaging_service.xml	Mon May 03 12:29:07 2010 +0300
@@ -7,10 +7,12 @@
      <name>imessage.send</name>
      <version>1.0</version>
      <description>Send interface</description>
-     <customproperty key="txt_aiw_action_text">Attach to new message</customproperty>
-   </interface>
-   <interface>
-  <name>conversationview</name>
+     <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_icon">qtg_large_message</customproperty>
+  </interface>
+  <interface>
+      <name>conversationview</name>
      <version>1.0</version>
      <description>ConversationView</description>
   </interface> 
--- a/messagingapp/msgui/msgapp/msgapp.pro	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/msgapp/msgapp.pro	Mon May 03 12:29:07 2010 +0300
@@ -17,7 +17,7 @@
 TEMPLATE = app
 TARGET = messaging101
 
-ICON = resources/qtg_large_message.svg
+ICON = resources/icons/qtg_large_message.svg
 
 DEPENDPATH += . inc src ../inc
 INCLUDEPATH += .
@@ -30,6 +30,7 @@
 INCLUDEPATH += ../../msgsettings/settingsview/inc
 INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
 INCLUDEPATH += /ext/mw/qtextensions/qtmobileextensions/include
+INCLUDEPATH += ../../smartmessaging/ringbc/inc
 
 CONFIG += hb service
 
@@ -90,8 +91,10 @@
         -lxqservice \
         -lxqserviceutil \
         -lQtContacts \
-        -lsettingsview
-
+        -lsettingsview \
+        -lringbc \
+		-lunidatamodelloader
+		
 styleplugin.sources += conversationviewplugin.dll \
                        unifiededitorplugin.dll \
                        unifiedviewerplugin.dll
--- a/messagingapp/msgui/msgapp/msgapp.qrc	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/msgapp/msgapp.qrc	Mon May 03 12:29:07 2010 +0300
@@ -1,23 +1,10 @@
 <RCC>
-    <qresource prefix="/">
-        <file alias="msglistviewitem.css">resources/msglistviewitem.css</file>
-        <file alias="msglistviewitem.widgetml">resources/msglistviewitem.widgetml</file>
-        <file alias="slide_in_from_screen_bottom.fxml">resources/slide_in_from_screen_bottom.fxml</file>
-        <file alias="qtg_large_message.svg">resources/qtg_large_message.svg</file>
-        <file alias="hblistviewitem.css">resources/hblistviewitem.css</file>
-    </qresource>
-    <qresource prefix="/newitem">
-        <file alias="qtg_fr_list_new_item_t.svg">resources/newitem_frames/qtg_fr_list_new_item_t.svg</file>
-        <file alias="qtg_fr_list_new_item_c.svg">resources/newitem_frames/qtg_fr_list_new_item_c.svg</file>
-        <file alias="qtg_fr_list_new_item_b.svg">resources/newitem_frames/qtg_fr_list_new_item_b.svg</file>
-    </qresource>
-    <qresource prefix="/icons">
-        <file alias="qtg_mono_chat_buddies.png">resources/icons/qtg_mono_chat_buddies.png</file>
-        <file alias="qtg_mono_create_message.png">resources/icons/qtg_mono_create_message.png</file>
-        <file alias="qtg_mono_search.png">resources/icons/qtg_mono_search.png</file>
-        <file alias="qtg_mono_sort.png">resources/icons/qtg_mono_sort.png</file>
+    <qresource prefix="/xml">
+        <file alias="hblistviewitem.css">resources/xml/hblistviewitem.css</file>
+        <file alias="msglistviewitem.css">resources/xml/msglistviewitem.css</file>
+        <file alias="msglistviewitem.widgetml">resources/xml/msglistviewitem.widgetml</file>
     </qresource>
     <qresource prefix="/translations">
-        <file alias="messaging_en_GB">resources/messaging_en_GB</file>
+        <file alias="messaging_en_GB">resources/translations/messaging_en_GB</file>
     </qresource>
 </RCC>
--- a/messagingapp/msgui/msgapp/resources/chat.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="29px" version="1.1" viewBox="0 0 42 29" width="42px" x="0px" y="0px">
-<path d="M33.7,11.268V6.565c-0.002-1.693-1.371-3.063-3.064-3.065H11.362C9.669,3.502,8.299,4.872,8.297,6.565v14.077  c0,1.639,1.25,3.064,3.223,3.064c0,0.668,0.002,3.105,0.002,3.105c0,1.656,1.957,2.229,2.994,1.07  c0.561-0.682,3.434-4.176,3.434-4.176h0.927c0.384,0.797,1.192,1.352,2.134,1.352h7.54l2.015,2.447  c0.779,1.01,2.526,0.494,2.526-0.906v-1.57c1.131-0.184,1.998-1.168,1.998-2.349v-9.259C35.089,12.465,34.517,11.644,33.7,11.268z" fill-opacity="0.2" stroke-opacity="0.2"/>
-<path d="M9.298,19.281v1.361c0,1.14,0.926,2.066,2.065,2.066h1.159v4.103c0,0.626,0.738,0.948,1.221,0.437  l3.736-4.539h2.158c0.015,0.744,0.626,1.35,1.374,1.35h8.011l2.314,2.812c0.327,0.326,0.756,0.082,0.756-0.271v-2.541h0.621  c0.756,0,1.376-0.619,1.376-1.377v-3.408L9.298,19.281z" fill-opacity="0.5" stroke-opacity="0.5"/>
-<rect fill="none" height="29" width="42"/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="21" x2="21" y1="1.9023" y2="54.8015">
-<stop offset="0" style="stop-color:#FFFFFF"/>
-<stop offset="1" style="stop-color:#B2B2C9"/>
-</linearGradient>
-<path d="M12.521,25.812v-4.103h-1.159c-1.139,0-2.065-0.927-2.065-2.066V6.565  c0-1.138,0.926-2.065,2.065-2.065h19.272c1.14,0,2.066,0.927,2.066,2.065v15.154l-15.223-0.01l-3.736,4.539  C13.284,26.706,12.521,26.5,12.521,25.812z" fill="url(#SVGID_1_)"/>
-<path d="M13.522,24.943v-4.235l-1.001,1.001v4.103c0,0.291,0.183,0.549,0.457,0.647L13.522,24.943z" fill="#FFFFFF" fill-opacity="0.4" stroke-opacity="0.4"/>
-<path d="M32.092,5.103L31.385,5.81C31.579,6.002,31.7,6.27,31.7,6.565v14.138l-14.695,0.005l-3.483,4.235  l-0.544,1.516c0.077,0.027,0.154,0.041,0.232,0.041c0.203,0,0.399-0.09,0.532-0.252l3.736-4.539l15.223-0.006V6.565  C32.701,5.994,32.468,5.477,32.092,5.103z" fill-opacity="0.2" stroke-opacity="0.2"/>
-<path d="M12.521,21.709l1.001-1.001h-2.16c-0.315,0-0.59-0.144-0.785-0.362l-0.711,0.712  c0.376,0.399,0.907,0.651,1.497,0.651H12.521z" fill-opacity="0.2" stroke-opacity="0.2"/>
-<path d="M30.635,4.5H11.363c-1.139,0-2.065,0.927-2.065,2.065v13.078c0,0.549,0.218,1.045,0.568,1.415  l0.711-0.712c-0.168-0.188-0.278-0.43-0.278-0.703V6.565c0-0.588,0.477-1.065,1.063-1.065h19.273c0.293,0,0.557,0.119,0.749,0.309  l0.707-0.707C31.718,4.73,31.202,4.5,30.635,4.5z" fill="#FFFFFF" fill-opacity="0.4" stroke-opacity="0.4"/>
-<rect fill="#8A8A8A" height="0.878" width="12.389" x="14.875" y="9.292"/>
-<rect fill="#8A8A8A" height="0.878" width="5.562" x="14.875" y="12.295"/>
-<rect fill="#8A8A8A" height="0.878" width="5.312" x="14.875" y="15.298"/>
-<path d="M20.314,21.709c1.14,0,0.696-9.164,0.696-9.164c-1.035,0-1.877,0.842-1.877,1.876v7.287H20.314z" fill-opacity="0.3" stroke-opacity="0.3"/>
-<linearGradient gradientTransform="matrix(-1 0 0 1 1170.873 0)" gradientUnits="userSpaceOnUse" id="SVGID_2_" x1="1144.0127" x2="1144.0127" y1="10.2983" y2="27.7666">
-<stop offset="0" style="stop-color:#FFE23D"/>
-<stop offset="0.2239" style="stop-color:#FAD337"/>
-<stop offset="0.6537" style="stop-color:#EFAB26"/>
-<stop offset="1" style="stop-color:#E48717"/>
-</linearGradient>
-<path d="M21.01,12.045h11.702c0.756,0,1.376,0.62,1.376,1.376v8.26c0,0.758-0.62,1.377-1.376,1.377h-0.621  V25.6c0,0.369-0.444,0.582-0.756,0.271l-2.314-2.812H21.01c-0.757,0-1.376-0.619-1.376-1.377v-8.26  C19.633,12.665,20.253,12.045,21.01,12.045z" fill="url(#SVGID_2_)"/>
-<path d="M19.738,22.203c-0.067-0.16-0.104-0.337-0.104-0.521C19.633,21.866,19.671,22.043,19.738,22.203z M20,22.601  c-0.106-0.117-0.199-0.247-0.261-0.395C19.8,22.354,19.893,22.483,20,22.601z M20.024,22.637l0.007-0.007  c-0.01-0.011-0.022-0.019-0.032-0.029C20.01,22.611,20.014,22.627,20.024,22.637z M33.218,12.146c0.146,0.06,0.276,0.147,0.393,0.25  C33.493,12.293,33.364,12.204,33.218,12.146z M33.632,12.418l-0.706,0.706c0.095,0.068,0.162,0.174,0.162,0.297v8.261  c0,0.205-0.173,0.377-0.376,0.377h-1.621v1.939l-1.598-1.939H21.01c-0.113,0-0.212-0.057-0.282-0.138  c0.002,0.003,0.003,0.005,0.005,0.008l-0.701,0.701c0.25,0.259,0.592,0.429,0.979,0.429h8.011l2.314,2.812  c0.288,0.287,0.756,0.145,0.756-0.271v-2.541h0.621c0.756,0,1.376-0.619,1.376-1.377v-8.26  C34.088,13.022,33.907,12.669,33.632,12.418z M33.61,12.395c0.008,0.007,0.014,0.016,0.021,0.023l0.006-0.006  C33.63,12.405,33.619,12.402,33.61,12.395z" fill-opacity="0.2" stroke-opacity="0.2"/>
-<path d="M20.732,21.929c-0.06-0.067-0.099-0.152-0.099-0.247v-8.261c0-0.204,0.172-0.374,0.376-0.374  h11.702c0.08,0,0.152,0.032,0.214,0.077l0.712-0.711c-0.246-0.226-0.569-0.367-0.926-0.367H21.01c-0.757,0-1.376,0.62-1.376,1.376  v8.26c0,0.371,0.15,0.707,0.391,0.955L20.732,21.929z" fill="#FFFFFF" fill-opacity="0.4" stroke-opacity="0.4"/>
-<rect fill-opacity="0.5" fill-rule="evenodd" height="0.688" stroke-opacity="0.5" width="6.883" x="23.419" y="15.143"/>
-<rect fill-opacity="0.5" fill-rule="evenodd" height="0.689" stroke-opacity="0.5" width="6.883" x="23.419" y="17.207"/>
-<rect fill-opacity="0.5" fill-rule="evenodd" height="0.688" stroke-opacity="0.5" width="4.303" x="23.419" y="19.273"/>
-</svg>
--- a/messagingapp/msgui/msgapp/resources/conversations.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="40px" version="1.1" viewBox="0 0 30 40" width="30px" x="0px" y="0px">
-<g>
-<path d="M27.458,17.31l-0.81-0.416l0.81-0.418c0.624-0.317,0.62-1.024,0.405-1.392l-0.881-1.512   c-0.251-0.43-0.877-0.683-1.406-0.336l-0.748,0.484l0.051-0.892c0.025-0.453-0.309-1.056-0.998-1.056h-1.764   c-0.57,0-1.031,0.48-0.998,1.056l0.051,0.892l-0.748-0.484c-0.402-0.263-1.08-0.22-1.406,0.336l-0.879,1.512   c-0.219,0.376-0.126,0.735-0.049,0.916H6C4.346,16,3,17.345,3,19v12c0,1.621,1.293,2.944,2.901,2.997v2.695   c0,1.407,1.723,2.251,2.869,1.029l3.063-3.723h11.165C24.654,33.999,26,32.653,26,31V20.706c0.185,0.031,0.699-0.003,0.982-0.487   l0.881-1.516C28.278,17.989,27.701,17.435,27.458,17.31z" fill-opacity="0.2" stroke-opacity="0.2"/>
-<path d="M27,15.588l-0.882-1.512c0,1.023-6.239,1.58-6.239,0L19,15.588l7.118,4.126L27,18.199l-2.536-1.305   L27,15.588z" fill-opacity="0.5" stroke-opacity="0.5"/>
-<path d="M4,26.718V31c0,1.101,0.9,2,2,2h0.901v3.692c0,0.517,0.646,0.86,1.098,0.394L11.362,33H23c1.1,0,2-0.899,2-2   v-4.282c0-0.004-0.001-0.007-0.001-0.011L4,26.718z" fill-opacity="0.5" stroke-opacity="0.5"/>
-<linearGradient gradientTransform="matrix(1 0 0 1 -1530 0)" gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="1544.5" x2="1544.5" y1="13.4609" y2="38.8497">
-<stop offset="0" style="stop-color:#FFE23D"/>
-<stop offset="0.2239" style="stop-color:#FAD337"/>
-<stop offset="0.6537" style="stop-color:#EFAB26"/>
-<stop offset="1" style="stop-color:#E48717"/>
-</linearGradient>
-<path d="M23,16H6c-1.1,0-2,0.9-2,2v12c0,1.101,0.9,2,2,2h0.901v3.692c0,0.438,0.599,0.907,1.098,0.394   L11.362,32H23c1.1,0,2-0.899,2-2V18C25,16.9,24.1,16,23,16z" fill="url(#SVGID_1_)"/>
-<rect fill="#A55B11" height="1" width="10" x="9.5" y="20.5"/>
-<rect fill="#A55B11" height="1" width="10" x="9.5" y="23.5"/>
-<rect fill="#A55B11" height="1" width="6.25" x="9.5" y="26.5"/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_2_" x1="14.7773" x2="14.7773" y1="17" y2="32.9845">
-<stop offset="0" style="stop-color:#FFE23D"/>
-<stop offset="0.2239" style="stop-color:#FAD337"/>
-<stop offset="0.6537" style="stop-color:#EFAB26"/>
-<stop offset="1" style="stop-color:#E48717"/>
-</linearGradient>
-<path d="M25,18c0-0.572-0.243-1.089-0.631-1.454l-0.706,0.705C23.869,17.435,24,17.702,24,18   v11.999c0,0.554-0.5,1.002-1,1.002H10.891l-2.989,3.627v-3.627H6c-0.263,0-0.499-0.107-0.678-0.274   c0.009,0.009,0.013,0.021,0.022,0.03l-0.79,0.616C4.92,31.757,5.432,32,6,32h0.901v3.692c0.005,0.61,0.755,0.782,1.098,0.394   L11.362,32H23c1.172,0,2-0.947,2-2V18z" fill="url(#SVGID_2_)" fill-opacity="0.2" stroke-opacity="0.2"/>
-<path d="M7.901,34.628v-3.627l-1,0.999v3.692c0,0.262,0.164,0.494,0.411,0.583L7.901,34.628z" fill="#FFFFFF" fill-opacity="0.2" stroke-opacity="0.2"/>
-<path d="M5.345,30.757c-0.212-0.184-0.347-0.455-0.347-0.758V18c0-0.552,0.449-1.001,1.002-1.001h17   c0.254,0,0.457,0.069,0.663,0.252l0.706-0.705C24.011,16.208,23.528,16,23,16H6c-1.1,0-2,0.9-2,2v12   c0,0.532,0.211,1.017,0.552,1.376L5.345,30.757z" fill="#FFFFFF" fill-opacity="0.4" stroke-opacity="0.4"/>
-<path d="M7.901,31.001H6c-0.263,0-0.499-0.107-0.678-0.274c0.009,0.009,0.013,0.021,0.022,0.03l-0.79,0.616   C4.92,31.757,5.432,32,6,32h0.901L7.901,31.001z" fill-opacity="0.2" stroke-opacity="0.2"/>
-<path d="M25,18c0-0.572-0.243-1.089-0.631-1.454l-0.706,0.705C23.869,17.435,24,17.702,24,18v11.999   c0,0.585-0.562,1.002-1,1.002H10.891l-2.989,3.627l-0.589,1.647c0.067,0.024,0.422,0.105,0.687-0.189L11.362,32H23   c0.984,0,2-0.775,2-2V18z" fill-opacity="0.2" stroke-opacity="0.2"/>
-<path d="M25,16.619L24.25,16h-5.518c0.014,0.009,1.713,0.894,1.713,0.894l-1.675,0.86   c-0.317,0.205-0.271,0.577-0.204,0.694l0.879,1.515c0.352,0.402,0.623,0.224,0.705,0.171l1.574-1.017l-0.105,1.856   c0.021,0.438,0.361,0.527,0.498,0.527h1.764c0.4,0,0.508-0.391,0.498-0.527l-0.104-1.856L25,19.587V16.619z" fill-opacity="0.3" stroke-opacity="0.3"/>
-<polygon fill="#EA2227" points="27,17.199 26.118,18.714 23.722,17.162 23.881,20 22.117,20 22.277,17.162 19.879,18.714    19,17.199 21.537,15.895 19,14.588 19.879,13.076 22.277,14.625 22.117,11.771 23.881,11.771 23.722,14.625 26.118,13.076    27,14.588 24.464,15.895  "/>
-<rect fill="none" height="40" width="30"/>
-</g>
-</svg>
--- a/messagingapp/msgui/msgapp/resources/find.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg baseProfile="tiny" height="26px" version="1.1" viewBox="0 0 24 26" width="24px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
-<path d="M1.753,20.26c0,0,3.276-3.278,4.935-4.938c-0.584-1.175-0.901-2.475-0.901-3.826  c0-4.745,3.86-8.606,8.605-8.607C19.139,2.889,23,6.75,23,11.496s-3.861,8.607-8.607,8.607c-1.204,0-2.367-0.252-3.439-0.719  l-5.039,5.037c-0.97,0.969-2.468,0.87-3.34-0.002c-0.01-0.011-0.913-0.912-0.913-0.912C1.152,23.018,0.426,21.586,1.753,20.26z" fill-opacity="0.2" stroke-opacity="0.2"/>
-<path d="M2.46,20.967c0.017-0.018,3.522-3.523,5.47-5.473c-0.721-1.162-1.144-2.529-1.144-3.998  c0-4.202,15.213-4.202,15.213,0s-3.404,7.607-7.607,7.607c-1.32,0-2.561-0.338-3.643-0.929c-1.917,1.917-5.525,5.522-5.542,5.54  c-0.531,0.53-1.395,0.529-1.926-0.002c-0.002-0.004-0.914-0.914-0.914-0.914S1.481,21.945,2.46,20.967z" fill-opacity="0.5" stroke-opacity="0.5"/>
-<linearGradient gradientTransform="matrix(-1 0 0 1 -2540 0)" gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="-2544.6929" x2="-2549.2595" y1="17.2695" y2="21.8361">
-<stop offset="0" style="stop-color:#E3E3E3"/>
-<stop offset="1" style="stop-color:#404040"/>
-</linearGradient>
-<path d="M8.335,14.09c-1.815,1.816-5.856,5.857-5.875,5.877c-0.979,0.979-0.093,1.832-0.093,1.832  s0.912,0.91,0.914,0.914c0.532,0.531,1.396,0.532,1.926,0.002c0.018-0.018,4.112-4.111,5.895-5.894L8.335,14.09z" fill="url(#SVGID_1_)"/>
-<path d="M8.335,14.09l2.768,2.731c-0.298,0.298-0.676,0.675-1.091,1.089c-1.13-0.668-2.097-1.583-2.818-2.678  C7.626,14.798,8.021,14.402,8.335,14.09z" fill-opacity="0.3" stroke-opacity="0.3"/>
-<linearGradient gradientTransform="matrix(-1 0 0 1 -2540 0)" gradientUnits="userSpaceOnUse" id="SVGID_2_" x1="-2554.3936" x2="-2554.3936" y1="3.8335" y2="23.4628">
-<stop offset="0" style="stop-color:#E3E3E3"/>
-<stop offset="1" style="stop-color:#404040"/>
-</linearGradient>
-<circle cx="14.394" cy="10.496" fill="url(#SVGID_2_)" r="7.606"/>
-<linearGradient gradientTransform="matrix(-1 0 0 1 -2540 0)" gradientUnits="userSpaceOnUse" id="SVGID_3_" x1="-2554.394" x2="-2554.394" y1="16.5928" y2="6.7791">
-<stop offset="0" style="stop-color:#DEEEF9"/>
-<stop offset="0.1953" style="stop-color:#C2E7F8"/>
-<stop offset="0.6144" style="stop-color:#7AD6F5"/>
-<stop offset="1" style="stop-color:#33C5F3"/>
-</linearGradient>
-<circle cx="14.394" cy="10.367" fill="url(#SVGID_3_)" r="5.756"/>
-<path d="M5.592,22.33l-2.749-2.748c0.109-0.108,0.241-0.24,0.404-0.404l2.748,2.75  C5.832,22.09,5.702,22.221,5.592,22.33z" fill="#FFFFFF" fill-opacity="0.4" stroke-opacity="0.4"/>
-<linearGradient gradientTransform="matrix(-1 0 0 1 -2540 0)" gradientUnits="userSpaceOnUse" id="SVGID_4_" x1="-2554.3936" x2="-2554.3936" y1="17.4238" y2="-1.071">
-<stop offset="0" style="stop-color:#E3E3E3"/>
-<stop offset="1" style="stop-color:#404040"/>
-</linearGradient>
-<path d="M8.12,10.366L8.12,10.366c0,3.466,2.807,6.272,6.274,6.274c3.465-0.002,6.272-2.809,6.272-6.273  c0-3.466-2.808-6.274-6.272-6.274C10.927,4.093,8.12,6.9,8.12,10.366z M8.638,10.366c0-3.179,2.575-5.755,5.754-5.755  c3.181,0,5.757,2.576,5.757,5.757c-0.001,3.178-2.576,5.754-5.757,5.754C11.213,16.122,8.638,13.546,8.638,10.366z" fill="url(#SVGID_4_)"/>
-<rect fill="none" height="26" width="24"/>
-<path d="M19.077,8.077c-0.849-1.743-2.63-2.944-4.702-2.948c-2.894,0.005-5.232,2.345-5.238,5.238  c0.001,0.775,0.173,1.508,0.477,2.171L19.077,8.077z" fill="#FFFFFF" fill-opacity="0.4" stroke-opacity="0.4"/>
-</svg>
--- a/messagingapp/msgui/msgapp/resources/hblistviewitem.css	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-
-HbListViewItem::text-3
-{
-  text-height:var(hb-param-text-height-tiny);
-  fixed-width:13.0un;
-  font-variant:secondary;
-  text-align:right;
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/msgapp/resources/icons/qtg_large_message.svg	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="98" viewBox="0 0 98 98" width="98" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<g>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="48.9995" x2="48.9995" y1="23.8706" y2="73.753">
+<stop offset="0" style="stop-color:#FEEFA7"/>
+<stop offset="0.5091" style="stop-color:#FFC501"/>
+<stop offset="1" style="stop-color:#F6A800"/>
+</linearGradient>
+<polygon fill="url(#SVGID_1_)" points="84,74.5 14,74.5 14,23.5 49.579,24.5 84,23.5 "/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_2_" x1="48.9995" x2="48.9995" y1="23.627" y2="74.8003">
+<stop offset="0" style="stop-color:#F7AC00"/>
+<stop offset="0.3394" style="stop-color:#FFF8DB"/>
+<stop offset="1" style="stop-color:#FFE066"/>
+</linearGradient>
+<path d="M83.23,24.275v49.449H14.77V24.275H83.23 M84,23.5l-35.249,0.42L14,23.5v51h70V23.5L84,23.5z" fill="url(#SVGID_2_)"/>
+<polygon fill="#FBAB13" fill-opacity="0.3" points="14,73.637 84,73.637 84,72.645 48.999,41.91 14,72.645 " stroke-opacity="0.3"/>
+<polygon fill="#F18800" fill-opacity="0.3" points="14,74.5 84,74.5 84,73.504 48.999,42.773 14,73.504 " stroke-opacity="0.3"/>
+<linearGradient gradientTransform="matrix(-1 0 0 -1 -1118.3896 -657.6523)" gradientUnits="userSpaceOnUse" id="SVGID_3_" x1="-1167.3896" x2="-1167.3896" y1="-701.0981" y2="-731.9614">
+<stop offset="0" style="stop-color:#F98A00"/>
+<stop offset="0.7273" style="stop-color:#FCBC3C"/>
+<stop offset="1" style="stop-color:#FFE36A"/>
+</linearGradient>
+<polygon fill="url(#SVGID_3_)" points="84,74.475 48.999,43.611 14,74.475 "/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_4_" x1="48.9995" x2="48.9995" y1="43.374" y2="75.3424">
+<stop offset="0" style="stop-color:#FFF1B5"/>
+<stop offset="1" style="stop-color:#FFE066"/>
+</linearGradient>
+<polygon fill="url(#SVGID_4_)" points="84,74.475 48.999,43.611 14,74.475 48.999,44.705 "/>
+<polygon fill="#F18800" fill-opacity="0.3" points="49.07,24.5 14,23.5 48.999,59.771 84,23.5 " stroke-opacity="0.3"/>
+<polygon fill="#C26D00" fill-opacity="0.4" points="49.007,24.5 14,23.5 48.999,57.863 84,23.5 " stroke-opacity="0.4"/>
+<polygon fill="#AB6100" fill-opacity="0.4" points="48.879,24.371 14,23.5 48.999,56.252 84,23.5 " stroke-opacity="0.4"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_5_" x1="49.0005" x2="49.0005" y1="52.7031" y2="21.5113">
+<stop offset="0" style="stop-color:#FFDA33"/>
+<stop offset="0.25" style="stop-color:#FFE692"/>
+<stop offset="1" style="stop-color:#FFFBF8"/>
+</linearGradient>
+<polygon fill="url(#SVGID_5_)" points="14,23.5 48.999,54.363 84,23.5 "/>
+<rect fill="none" height="98" width="98"/>
+</g>
+</svg>
Binary file messagingapp/msgui/msgapp/resources/icons/qtg_mono_chat_buddies.png has changed
Binary file messagingapp/msgui/msgapp/resources/icons/qtg_mono_create_message.png has changed
Binary file messagingapp/msgui/msgapp/resources/icons/qtg_mono_search.png has changed
Binary file messagingapp/msgui/msgapp/resources/icons/qtg_mono_sort.png has changed
Binary file messagingapp/msgui/msgapp/resources/messaging_en_GB has changed
--- a/messagingapp/msgui/msgapp/resources/msglistviewitem.css	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,224 +0,0 @@
-MsgListViewItem:portrait {
-  layout: layout-portrait;
-}
-
-MsgListViewItem:landscape {
-  layout: layout-landscape;
-}
-
-MsgListViewItem[layoutName="custom"]:portrait{
-  layout:layout-portrait;
-}
-
-MsgListViewItem[layoutName="custom"]:landscape{
-  layout:layout-landscape;
-}
-
-MsgListViewItem::newMsgIndicator[layoutName="custom"]:portrait {
-  left:-var(hb-param-margin-view-left);
-  size-policy-horizontal: fixed;
-  size-policy-vertical: fixed;
-  pref-width: 1.25un;
-  pref-height: 15.1un;
-  aspect-ratio: ignore;
-}
-
-MsgListViewItem[unReadMsg="true"]::addressLabel[layoutName="custom"]:portrait {
-  top:-var(hb-param-margin-gene-top);
-  left:-var(hb-param-margin-gene-middle-horizontal);
-  right:var(hb-param-margin-gene-middle-horizontal);
-  bottom:var(hb-param-margin-gene-middle-vertical);
-  text-align: left;
-  color: var(list_item_title_normal);
-  font-variant: primary;
-  text-height:var(hb-param-text-height-primary);
-  text-line-count-min:1;
-  text-line-count-max:1;
-}
-
-MsgListViewItem[unReadMsg="false"]::addressLabel[layoutName="custom"]:portrait {
-  top:-var(hb-param-margin-gene-top);
-  left:-var(hb-param-margin-gene-middle-horizontal);
-  right:var(hb-param-margin-gene-middle-horizontal);
-  bottom:var(hb-param-margin-gene-middle-vertical);
-  text-align: left;
-  color: var(list_item_title_normal);
-  font-variant: secondary;
-  text-height:var(hb-param-text-height-primary);
-  text-line-count-min:1;
-  text-line-count-max:1;
-}
-
-MsgListViewItem[unReadMsg="true"]::previewLabel[layoutName="custom"]:portrait {
-  left:-var(hb-param-margin-gene-middle-horizontal);
-  bottom:-var(hb-param-margin-gene-bottom);
-  right:var(hb-param-margin-gene-middle-horizontal);
-  text-align: left top;
-  color: var(list_item_content_normal);
-  font-variant: primary;
-  text-height: var(hb-param-text-height-secondary);
-  text-line-count-min:2;
-  text-line-count-max:2;
-}
-
-MsgListViewItem[unReadMsg="false"]::previewLabel[layoutName="custom"]:portrait {
-  left:-var(hb-param-margin-gene-middle-horizontal);
-  bottom:-var(hb-param-margin-gene-bottom);
-  right:var(hb-param-margin-gene-middle-horizontal);
-  text-align: left top;
-  color: var(list_item_content_normal);
-  font-variant: secondary;
-  text-height: var(hb-param-text-height-secondary);
-  text-line-count-min:2;
-  text-line-count-max:2;
-}
-
-MsgListViewItem::unreadCount[layoutName="custom"]:portrait {
-  right:var(hb-param-margin-gene-middle-horizontal);
-  size-policy-horizontal: fixed;
-  pref-width:6un;
-  text-align: left;
-  color: var(list_item_content_normal);
-  font-variant: primary;
-  text-height: var(hb-param-text-height-primary);
-  text-line-count-min:1;
-  text-line-count-max:1;
-}
-
-MsgListViewItem[unReadMsg="true"]::timeLabel[layoutName="custom"]:portrait {
-  right:var(hb-param-margin-gene-right);
-  bottom:var(hb-param-margin-gene-bottom);
-  size-policy-horizontal: fixed;
-  pref-width:12un;
-  text-align: right;
-  color: var(list_item_content_normal);
-  font-variant: primary;
-  text-height: var(hb-param-text-height-tiny);
-  text-line-count-min:1;
-  text-line-count-max:1;
-}
-
-MsgListViewItem[unReadMsg="false"]::timeLabel[layoutName="custom"]:portrait {
-  right:var(hb-param-margin-gene-right);
-  bottom:var(hb-param-margin-gene-bottom);
-  size-policy-horizontal: fixed;
-  pref-width:12un;
-  text-align: right;
-  color: var(list_item_content_normal);
-  font-variant: secondary;
-  text-height: var(hb-param-text-height-tiny);
-  text-line-count-min:1;
-  text-line-count-max:1;
-}
-
-MsgListViewItem::presenceIndicator[layoutName="custom"]:portrait {
-  right: var(hb-param-margin-gene-right);
-  size-policy-horizontal: fixed;
-  size-policy-vertical: fixed;
-  pref-width: var(hb-param-graphic-size-secondary);
-  pref-height: var(hb-param-graphic-size-secondary);
-  aspect-ratio: ignore;
-}
-
-/*Landscape mode*/
-MsgListViewItem::newMsgIndicator[layoutName="custom"]:landscape {
-  left:-var(hb-param-margin-view-left);
-  size-policy-horizontal: fixed;
-  size-policy-vertical: ignore;
-  pref-width: 1.25un;
-  pref-height: -1;
-  aspect-ratio: ignore;
-}
-
-MsgListViewItem[unReadMsg="true"]::addressLabel[layoutName="custom"]:landscape {
-  top:-var(hb-param-margin-gene-top);
-  left:-var(hb-param-margin-gene-left);
-  right:var(hb-param-margin-gene-middle-horizontal);
-  bottom:var(hb-param-margin-gene-bottom);
-  text-align: left;
-  color: var(list_item_title_normal);
-  font-variant: primary;
-  text-height:var(hb-param-text-height-primary);
-  text-line-count-min:1;
-  text-line-count-max:1;
-}
-
-MsgListViewItem[unReadMsg="false"]::addressLabel[layoutName="custom"]:landscape {
-  top:-var(hb-param-margin-gene-top);
-  left:-var(hb-param-margin-gene-left);
-  right:var(hb-param-margin-gene-middle-horizontal);
-  bottom:var(hb-param-margin-gene-bottom);
-  text-align: left;
-  color: var(list_item_title_normal);
-  font-variant: secondary;
-  text-height:var(hb-param-text-height-primary);
-  text-line-count-min:1;
-  text-line-count-max:1;
-}
-
-MsgListViewItem[unReadMsg="true"]::previewLabel[layoutName="custom"]:landscape {
-  right:var(hb-param-margin-gene-middle-horizontal);
-  text-align: left;
-  color: var(list_item_content_normal);
-  font-variant: primary;
-  text-height: var(hb-param-text-height-secondary);
-  text-line-count-min:1;
-  text-line-count-max:1;
-}
-
-MsgListViewItem[unReadMsg="false"]::previewLabel[layoutName="custom"]:landscape {
-  right:var(hb-param-margin-gene-middle-horizontal);
-  text-align: left;
-  color: var(list_item_content_normal);
-  font-variant: secondary;
-  text-height: var(hb-param-text-height-secondary);
-  text-line-count-min:1;
-  text-line-count-max:1;
-}
-
-MsgListViewItem::unreadCount[layoutName="custom"]:landscape {
-  right:var(hb-param-margin-gene-middle-horizontal);
-  size-policy-horizontal: fixed;
-  pref-width:6un;
-  text-align: left;
-  color: var(list_item_content_normal);
-  font-variant: primary;
-  text-height: var(hb-param-text-height-primary);
-  text-line-count-min:1;
-  text-line-count-max:1;
-}
-
-MsgListViewItem::presenceIndicator[layoutName="custom"]:landscape {
-  right: var(hb-param-margin-gene-middle-horizontal);
-  size-policy-horizontal: fixed;
-  size-policy-vertical: fixed;
-  pref-width: var(hb-param-graphic-size-secondary);
-  pref-height: var(hb-param-graphic-size-secondary);
-  aspect-ratio: ignore;
-}
-
-MsgListViewItem[unReadMsg="true"]::timeLabel[layoutName="custom"]:landscape {
-  right:var(hb-param-margin-gene-right);
-  size-policy-horizontal: fixed;
-  pref-width:12un;
-  text-align: right;
-  color: var(list_item_content_normal);
-  font-variant: primary;
-  text-height: var(hb-param-text-height-tiny);
-  text-line-count-min:1;
-  text-line-count-max:1;
-}
-
-MsgListViewItem[unReadMsg="false"]::timeLabel[layoutName="custom"]:landscape {
-  right:var(hb-param-margin-gene-right);
-  size-policy-horizontal: fixed;
-  pref-width:12un;
-  text-align: right;
-  color: var(list_item_content_normal);
-  font-variant: secondary;
-  text-height: var(hb-param-text-height-tiny);
-  text-line-count-min:1;
-  text-line-count-max:1;
-}
-
-
--- a/messagingapp/msgui/msgapp/resources/msglistviewitem.widgetml	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-<hbwidget version="0.1" type="MsgListViewItem">
-
-  <layout name="layout-portrait" type="mesh">
-    <meshitem src="newMsgIndicator" srcEdge="TOP" dst="" dstEdge="TOP" />
-    <meshitem src="newMsgIndicator" srcEdge="LEFT" dst="" dstEdge="LEFT" />
-    <meshitem src="newMsgIndicator" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
-
-    <meshitem src="addressLabel" srcEdge="TOP" dst="newMsgIndicator" dstEdge="TOP" />
-    <meshitem src="addressLabel" srcEdge="BOTTOM" dst="previewLabel" dstEdge="TOP" />
-    <meshitem src="addressLabel" srcEdge="RIGHT" dst="unreadCount" dstEdge="LEFT" />
-    <meshitem src="addressLabel" srcEdge="LEFT" dst="newMsgIndicator" dstEdge="RIGHT" />
-
-    <meshitem src="previewLabel" srcEdge="LEFT" dst="newMsgIndicator" dstEdge="RIGHT" />
-    <meshitem src="previewLabel" srcEdge="RIGHT" dst="timeLabel" dstEdge="LEFT" />
-
-    <meshitem src="unreadCount" srcEdge="TOP" dst="addressLabel" dstEdge="TOP" />
-    <meshitem src="unreadCount" srcEdge="RIGHT" dst="presenceIndicator" dstEdge="LEFT" />
-    <meshitem src="unreadCount" srcEdge="BOTTOM" dst="addressLabel" dstEdge="BOTTOM" />
-
-    <meshitem src="presenceIndicator" srcEdge="CENTERV" dst="addressLabel" dstEdge="CENTERV" />
-    <meshitem src="presenceIndicator" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
-
-    <meshitem src="timeLabel" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
-    <meshitem src="timeLabel" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
-
-    <meshitem src="bgFrame" srcEdge="LEFT" dst="" dstEdge="LEFT" />
-    <meshitem src="bgFrame" srcEdge="TOP" dst="" dstEdge="TOP" />
-    <meshitem src="bgFrame" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
-    <meshitem src="bgFrame" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
-
-  </layout>
-
-  <layout name="layout-landscape" type="mesh">
-
-    <meshitem src="addressLabel" srcEdge="LEFT" dst="" dstEdge="LEFT" />
-    <meshitem src="addressLabel" srcEdge="TOP" dst="" dstEdge="TOP" />
-    <meshitem src="addressLabel" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
-    <meshitem src="addressLabel" srcEdge="RIGHT" dst="unreadCount" dstEdge="LEFT" />
-
-    <meshitem src="unreadCount" srcEdge="RIGHT" dst="presenceIndicator" dstEdge="LEFT" />
-    <meshitem src="unreadCount" srcEdge="CENTERV" dst="addressLabel" dstEdge="CENTERV" />
-
-    <meshitem src="presenceIndicator" srcEdge="RIGHT" dst="" dstEdge="CENTERH" />
-    <meshitem src="presenceIndicator" srcEdge="CENTERV" dst="addressLabel" dstEdge="CENTERV" />
-
-    <meshitem src="previewLabel" srcEdge="LEFT" dst="" dstEdge="CENTERH" />
-    <meshitem src="previewLabel" srcEdge="RIGHT" dst="timeLabel" dstEdge="LEFT"  />
-    <meshitem src="previewLabel" srcEdge="CENTERV" dst="addressLabel" dstEdge="CENTERV"  />
-
-    <meshitem src="timeLabel" srcEdge="RIGHT" dst="" dstEdge="RIGHT"  />
-    <meshitem src="timeLabel" srcEdge="CENTERV" dst="addressLabel" dstEdge="CENTERV" />
-
-    <meshitem src="newMsgIndicator" srcEdge="TOP" dst="" dstEdge="TOP" />
-    <meshitem src="newMsgIndicator" srcEdge="LEFT" dst="" dstEdge="LEFT" />
-    <meshitem src="newMsgIndicator" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
-
-    <meshitem src="bgFrame" srcEdge="LEFT" dst="" dstEdge="LEFT" />
-    <meshitem src="bgFrame" srcEdge="TOP" dst="" dstEdge="TOP" />
-    <meshitem src="bgFrame" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
-    <meshitem src="bgFrame" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
-
-  </layout>
-
-</hbwidget>
--- a/messagingapp/msgui/msgapp/resources/new_msg.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="32px" version="1.1" viewBox="0 0 22 22" width="32px" x="0px" y="0px">
-<rect fill="none" height="32" width="32"/>
-<path d="M20.096,3.039c0,0-18.383,0-18.723,0S0.572,3.204,0.572,3.837v13.107c0,0.457,0.377,0.799,0.801,0.799h8.299  l-1.033,2.541c-0.213,0.312,0.068,1.25,0.945,0.99l4.15-1.47c0.107-0.039,0.578-0.272,0.689-0.385l1.656-1.676h4.016  c0.438,0,0.801-0.356,0.801-0.799V3.837C20.896,3.301,20.426,3.039,20.096,3.039z" fill-opacity="0.4" stroke-opacity="0.4"/>
-<path d="M1.373,3.838v0.821c1.023,0.646,8.836,5.584,9.291,5.872c0.438-0.278,7.973-5.033,9.432-5.954V3.838H1.373z" fill="#FFFFFF"/>
-<path d="M10.408,11.466L1.373,5.758v11.187h8.625c0,0,0.35-0.973,0.641-1.302l5.912-5.938  c0.367-0.375,1.156-0.796,2.053,0.012l1.492,1.49V5.676l-9.178,5.791C10.762,11.564,10.563,11.564,10.408,11.466z" fill="#FFFFFF"/>
-<polygon fill="#FFFFFF" points="20.096,16.945 20.096,13.677 16.869,16.945 "/>
-<polygon fill="#FFFFFF" points="9.334,20.568 13.484,19.097 10.961,16.573 "/>
-<path d="M19.787,11.958l-1.715-1.714c-0.295-0.297-0.658-0.35-0.988-0.008l-5.707,5.731  c0.037,0.025,2.686,2.685,2.713,2.726l5.727-5.798C20.053,12.625,20.08,12.255,19.787,11.958z" fill="#FFFFFF"/>
-</svg>
--- a/messagingapp/msgui/msgapp/resources/newitem_frames/qtg_fr_list_new_item_b.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="8px" height="8px" viewBox="0 0 8 8" enable-background="new 0 0 8 8" xml:space="preserve">
-<defs>
-</defs>
-<g>
-	<rect fill="none" width="8" height="8"/>
-</g>
-<path fill="#4F9EB0" d="M0,4c0,2.2,1.8,4,4,4s4-1.8,4-4V0H0V4z"/>
-<path opacity="0.2" fill="#63BDCF" d="M4,5C2.346,5,1,3.654,1,2v2c0,1.654,1.346,3,3,3s3-1.346,3-3V2C7,3.654,5.654,5,4,5z"/>
-<path opacity="0.2" d="M7,4c0,1.654-1.346,3-3,3S1,5.654,1,4V0H0v4c0,2.2,1.8,4,4,4s4-1.8,4-4V0H7V4z"/>
-</svg>
--- a/messagingapp/msgui/msgapp/resources/newitem_frames/qtg_fr_list_new_item_c.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="8px" height="8px" viewBox="0 0 8 8" enable-background="new 0 0 8 8" xml:space="preserve">
-<defs>
-</defs>
-<g>
-	<rect fill="none" width="8" height="8"/>
-</g>
-<rect fill="#4F9EB0" width="8" height="8"/>
-<rect x="7" opacity="0.2" width="1" height="8"/>
-<rect opacity="0.2" width="1" height="8"/>
-</svg>
--- a/messagingapp/msgui/msgapp/resources/newitem_frames/qtg_fr_list_new_item_t.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="8px" height="8px" viewBox="0 0 8 8" enable-background="new 0 0 8 8" xml:space="preserve">
-<defs>
-</defs>
-<g>
-	<rect fill="none" width="8" height="8"/>
-</g>
-<path fill="#4F9EB0" d="M8,4c0-2.2-1.8-4-4-4S0,1.8,0,4v4h8V4z"/>
-<path fill="#63BDCF" d="M4,1C2.346,1,1,2.346,1,4v1c0-1.654,1.346-3,3-3s3,1.346,3,3V4C7,2.346,5.654,1,4,1z"/>
-<path opacity="0.2" d="M1,4c0-1.654,1.346-3,3-3s3,1.346,3,3v4h1V4c0-2.2-1.8-4-4-4S0,1.8,0,4v4h1V4z"/>
-</svg>
--- a/messagingapp/msgui/msgapp/resources/qtg_large_message.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg baseProfile="tiny" height="98" viewBox="0 0 98 98" width="98" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="48.9995" x2="48.9995" y1="23.8706" y2="73.753">
-<stop offset="0" style="stop-color:#FEEFA7"/>
-<stop offset="0.5091" style="stop-color:#FFC501"/>
-<stop offset="1" style="stop-color:#F6A800"/>
-</linearGradient>
-<polygon fill="url(#SVGID_1_)" points="84,74.5 14,74.5 14,23.5 49.579,24.5 84,23.5 "/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_2_" x1="48.9995" x2="48.9995" y1="23.627" y2="74.8003">
-<stop offset="0" style="stop-color:#F7AC00"/>
-<stop offset="0.3394" style="stop-color:#FFF8DB"/>
-<stop offset="1" style="stop-color:#FFE066"/>
-</linearGradient>
-<path d="M83.23,24.275v49.449H14.77V24.275H83.23 M84,23.5l-35.249,0.42L14,23.5v51h70V23.5L84,23.5z" fill="url(#SVGID_2_)"/>
-<polygon fill="#FBAB13" fill-opacity="0.3" points="14,73.637 84,73.637 84,72.645 48.999,41.91 14,72.645 " stroke-opacity="0.3"/>
-<polygon fill="#F18800" fill-opacity="0.3" points="14,74.5 84,74.5 84,73.504 48.999,42.773 14,73.504 " stroke-opacity="0.3"/>
-<linearGradient gradientTransform="matrix(-1 0 0 -1 -1118.3896 -657.6523)" gradientUnits="userSpaceOnUse" id="SVGID_3_" x1="-1167.3896" x2="-1167.3896" y1="-701.0981" y2="-731.9614">
-<stop offset="0" style="stop-color:#F98A00"/>
-<stop offset="0.7273" style="stop-color:#FCBC3C"/>
-<stop offset="1" style="stop-color:#FFE36A"/>
-</linearGradient>
-<polygon fill="url(#SVGID_3_)" points="84,74.475 48.999,43.611 14,74.475 "/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_4_" x1="48.9995" x2="48.9995" y1="43.374" y2="75.3424">
-<stop offset="0" style="stop-color:#FFF1B5"/>
-<stop offset="1" style="stop-color:#FFE066"/>
-</linearGradient>
-<polygon fill="url(#SVGID_4_)" points="84,74.475 48.999,43.611 14,74.475 48.999,44.705 "/>
-<polygon fill="#F18800" fill-opacity="0.3" points="49.07,24.5 14,23.5 48.999,59.771 84,23.5 " stroke-opacity="0.3"/>
-<polygon fill="#C26D00" fill-opacity="0.4" points="49.007,24.5 14,23.5 48.999,57.863 84,23.5 " stroke-opacity="0.4"/>
-<polygon fill="#AB6100" fill-opacity="0.4" points="48.879,24.371 14,23.5 48.999,56.252 84,23.5 " stroke-opacity="0.4"/>
-<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_5_" x1="49.0005" x2="49.0005" y1="52.7031" y2="21.5113">
-<stop offset="0" style="stop-color:#FFDA33"/>
-<stop offset="0.25" style="stop-color:#FFE692"/>
-<stop offset="1" style="stop-color:#FFFBF8"/>
-</linearGradient>
-<polygon fill="url(#SVGID_5_)" points="14,23.5 48.999,54.363 84,23.5 "/>
-<rect fill="none" height="98" width="98"/>
-</g>
-</svg>
--- a/messagingapp/msgui/msgapp/resources/qtg_small_offline.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="32px" height="32px" viewBox="-2 -2 32 32" enable-background="new -2 -2 32 32" xml:space="preserve">
-<defs>
-</defs>
-<path opacity="0.6" d="M14,28C6.28,28,0,21.72,0,14S6.28,0,14,0c7.719,0,14,6.28,14,14S21.719,28,14,28L14,28z"/>
-<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="13.9995" y1="1" x2="13.9995" y2="27.0005">
-	<stop  offset="0" style="stop-color:#FFFFFF"/>
-	<stop  offset="1" style="stop-color:#B4B4B4"/>
-</linearGradient>
-<circle fill="url(#SVGID_1_)" cx="14" cy="14" r="13"/>
-<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="14.0005" y1="26" x2="14.0005" y2="2.0005">
-	<stop  offset="0" style="stop-color:#FFFFFF"/>
-	<stop  offset="1" style="stop-color:#B4B4B4"/>
-</linearGradient>
-<path fill="url(#SVGID_2_)" d="M14,26C7.383,26,2,20.617,2,14S7.383,2,14,2s12,5.383,12,12S20.617,26,14,26L14,26z"/>
-<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="14.0005" y1="24" x2="14.0005" y2="4.0005">
-	<stop  offset="0" style="stop-color:#DCDCDC"/>
-	<stop  offset="1" style="stop-color:#A0A0A0"/>
-</linearGradient>
-<path fill="url(#SVGID_3_)" d="M14,24C8.486,24,4,19.514,4,14S8.486,4,14,4s10,4.486,10,10S19.514,24,14,24L14,24z"/>
-<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="13.9995" y1="5" x2="13.9995" y2="23.0005">
-	<stop  offset="0" style="stop-color:#F0F0F0"/>
-	<stop  offset="1" style="stop-color:#787878"/>
-</linearGradient>
-<path fill="url(#SVGID_4_)" d="M14,23c-4.962,0-9-4.037-9-9s4.038-9,9-9c4.963,0,9,4.037,9,9S18.963,23,14,23L14,23z"/>
-</svg>
--- a/messagingapp/msgui/msgapp/resources/qtg_small_online.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="32px" height="32px" viewBox="-2 -2 32 32" enable-background="new -2 -2 32 32" xml:space="preserve">
-<defs>
-</defs>
-<path opacity="0.6" d="M14,28C6.28,28,0,21.72,0,14S6.28,0,14,0c7.718,0,14,6.28,14,14S21.719,28,14,28L14,28z"/>
-<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="13.9995" y1="1" x2="13.9995" y2="27.0005">
-	<stop  offset="0" style="stop-color:#FFFFFF"/>
-	<stop  offset="1" style="stop-color:#B4B4B4"/>
-</linearGradient>
-<circle fill="url(#SVGID_1_)" cx="14" cy="14" r="13"/>
-<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="14.0005" y1="26" x2="14.0005" y2="2.0005">
-	<stop  offset="0" style="stop-color:#FFFFFF"/>
-	<stop  offset="1" style="stop-color:#B4B4B4"/>
-</linearGradient>
-<path fill="url(#SVGID_2_)" d="M14,26C7.383,26,2,20.617,2,14S7.383,2,14,2c6.617,0,12,5.383,12,12S20.617,26,14,26L14,26z"/>
-<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="14.0005" y1="24" x2="14.0005" y2="4.0005">
-	<stop  offset="0" style="stop-color:#7CDB00"/>
-	<stop  offset="1" style="stop-color:#319E00"/>
-</linearGradient>
-<path fill="url(#SVGID_3_)" d="M14,24C8.486,24,4,19.514,4,14S8.486,4,14,4c5.513,0,10,4.486,10,10S19.514,24,14,24L14,24z"/>
-<linearGradient id="SVGID_4_" gradientUnits="userSpaceOnUse" x1="13.9995" y1="5" x2="13.9995" y2="23.0005">
-	<stop  offset="0" style="stop-color:#A0F800"/>
-	<stop  offset="1" style="stop-color:#319E00"/>
-</linearGradient>
-<path fill="url(#SVGID_4_)" d="M14,23c-4.963,0-9-4.037-9-9s4.038-9,9-9c4.962,0,9,4.037,9,9S18.963,23,14,23L14,23z"/>
-</svg>
--- a/messagingapp/msgui/msgapp/resources/slide_in_from_screen_bottom.fxml	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-<layers>
-<visual>
-
-<param name="translation_y" type="anim">
-<duration>.6</duration>
-<!--style>inoutcubic</style-->
-<keyframe at="0.0">0.0</keyframe>
-<keyframe at="1.0">1.0</keyframe>
-<start ref="screen.bottom">1</start>
-<end ref="visual.top">1</end>
-</param>
-</visual>
-</layers>
\ No newline at end of file
Binary file messagingapp/msgui/msgapp/resources/translations/messaging_en_GB has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/msgapp/resources/xml/hblistviewitem.css	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,8 @@
+
+HbListViewItem::text-3
+{
+  text-height:var(hb-param-text-height-tiny);
+  fixed-width:13.0un;
+  font-variant:secondary;
+  text-align:right;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/msgapp/resources/xml/msglistviewitem.css	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,222 @@
+MsgListViewItem:portrait {
+  layout: layout-portrait;
+}
+
+MsgListViewItem:landscape {
+  layout: layout-landscape;
+}
+
+MsgListViewItem[layoutName="custom"]:portrait{
+  layout:layout-portrait;
+}
+
+MsgListViewItem[layoutName="custom"]:landscape{
+  layout:layout-landscape;
+}
+
+MsgListViewItem::newMsgIndicator[layoutName="custom"]:portrait {
+  left:-var(hb-param-margin-view-left);
+  size-policy-horizontal: fixed;
+  size-policy-vertical: fixed;
+  pref-width: 1.25un;
+  pref-height: 15.1un;
+  aspect-ratio: ignore;
+}
+
+MsgListViewItem[unReadMsg="true"]::addressLabel[layoutName="custom"]:portrait {
+  top:-var(hb-param-margin-gene-top);
+  left:-var(hb-param-margin-gene-middle-horizontal);
+  right:var(hb-param-margin-gene-middle-horizontal);
+  bottom:var(hb-param-margin-gene-middle-vertical);
+  text-align: left;
+  color: var(list_item_title_normal);
+  font-variant: primary;
+  text-height:var(hb-param-text-height-primary);
+  text-line-count-min:1;
+  text-line-count-max:1;
+}
+
+MsgListViewItem[unReadMsg="false"]::addressLabel[layoutName="custom"]:portrait {
+  top:-var(hb-param-margin-gene-top);
+  left:-var(hb-param-margin-gene-middle-horizontal);
+  right:var(hb-param-margin-gene-middle-horizontal);
+  bottom:var(hb-param-margin-gene-middle-vertical);
+  text-align: left;
+  color: var(list_item_title_normal);
+  font-variant: secondary;
+  text-height:var(hb-param-text-height-primary);
+  text-line-count-min:1;
+  text-line-count-max:1;
+}
+
+MsgListViewItem[unReadMsg="true"]::previewLabel[layoutName="custom"]:portrait {
+  left:-var(hb-param-margin-gene-middle-horizontal);
+  bottom:-var(hb-param-margin-gene-bottom);
+  right:var(hb-param-margin-gene-middle-horizontal);
+  text-align: left top;
+  color: var(list_item_content_normal);
+  font-variant: primary;
+  text-height: var(hb-param-text-height-secondary);
+  text-line-count-min:2;
+  text-line-count-max:2;
+}
+
+MsgListViewItem[unReadMsg="false"]::previewLabel[layoutName="custom"]:portrait {
+  left:-var(hb-param-margin-gene-middle-horizontal);
+  bottom:-var(hb-param-margin-gene-bottom);
+  right:var(hb-param-margin-gene-middle-horizontal);
+  text-align: left top;
+  color: var(list_item_content_normal);
+  font-variant: secondary;
+  text-height: var(hb-param-text-height-secondary);
+  text-line-count-min:2;
+  text-line-count-max:2;
+}
+
+MsgListViewItem::unreadCount[layoutName="custom"]:portrait {
+  right:var(hb-param-margin-gene-middle-horizontal);
+  size-policy-horizontal: fixed;
+  text-align: right;
+  color: var(list_item_content_normal);
+  font-variant: primary;
+  text-height: var(hb-param-text-height-primary);
+  text-line-count-min:1;
+  text-line-count-max:1;
+}
+
+MsgListViewItem[unReadMsg="true"]::timeLabel[layoutName="custom"]:portrait {
+  right:var(hb-param-margin-gene-right);
+  bottom:var(hb-param-margin-gene-bottom);
+  size-policy-horizontal: fixed;
+  pref-width:12un;
+  text-align: right;
+  color: var(list_item_content_normal);
+  font-variant: primary;
+  text-height: var(hb-param-text-height-tiny);
+  text-line-count-min:1;
+  text-line-count-max:1;
+}
+
+MsgListViewItem[unReadMsg="false"]::timeLabel[layoutName="custom"]:portrait {
+  right:var(hb-param-margin-gene-right);
+  bottom:var(hb-param-margin-gene-bottom);
+  size-policy-horizontal: fixed;
+  pref-width:12un;
+  text-align: right;
+  color: var(list_item_content_normal);
+  font-variant: secondary;
+  text-height: var(hb-param-text-height-tiny);
+  text-line-count-min:1;
+  text-line-count-max:1;
+}
+
+MsgListViewItem::presenceIndicator[layoutName="custom"]:portrait {
+  right: var(hb-param-margin-gene-right);
+  size-policy-horizontal: fixed;
+  size-policy-vertical: fixed;
+  pref-width: var(hb-param-graphic-size-secondary);
+  pref-height: var(hb-param-graphic-size-secondary);
+  aspect-ratio: ignore;
+}
+
+/*Landscape mode*/
+MsgListViewItem::newMsgIndicator[layoutName="custom"]:landscape {
+  left:-var(hb-param-margin-view-left);
+  size-policy-horizontal: fixed;
+  size-policy-vertical: ignore;
+  pref-width: 1.25un;
+  pref-height: -1;
+  aspect-ratio: ignore;
+}
+
+MsgListViewItem[unReadMsg="true"]::addressLabel[layoutName="custom"]:landscape {
+  top:-var(hb-param-margin-gene-top);
+  left:-var(hb-param-margin-gene-left);
+  right:var(hb-param-margin-gene-middle-horizontal);
+  bottom:var(hb-param-margin-gene-bottom);
+  text-align: left;
+  color: var(list_item_title_normal);
+  font-variant: primary;
+  text-height:var(hb-param-text-height-primary);
+  text-line-count-min:1;
+  text-line-count-max:1;
+}
+
+MsgListViewItem[unReadMsg="false"]::addressLabel[layoutName="custom"]:landscape {
+  top:-var(hb-param-margin-gene-top);
+  left:-var(hb-param-margin-gene-left);
+  right:var(hb-param-margin-gene-middle-horizontal);
+  bottom:var(hb-param-margin-gene-bottom);
+  text-align: left;
+  color: var(list_item_title_normal);
+  font-variant: secondary;
+  text-height:var(hb-param-text-height-primary);
+  text-line-count-min:1;
+  text-line-count-max:1;
+}
+
+MsgListViewItem[unReadMsg="true"]::previewLabel[layoutName="custom"]:landscape {
+  right:var(hb-param-margin-gene-middle-horizontal);
+  text-align: left;
+  color: var(list_item_content_normal);
+  font-variant: primary;
+  text-height: var(hb-param-text-height-secondary);
+  text-line-count-min:1;
+  text-line-count-max:1;
+}
+
+MsgListViewItem[unReadMsg="false"]::previewLabel[layoutName="custom"]:landscape {
+  right:var(hb-param-margin-gene-middle-horizontal);
+  text-align: left;
+  color: var(list_item_content_normal);
+  font-variant: secondary;
+  text-height: var(hb-param-text-height-secondary);
+  text-line-count-min:1;
+  text-line-count-max:1;
+}
+
+MsgListViewItem::unreadCount[layoutName="custom"]:landscape {
+  right:var(hb-param-margin-gene-middle-horizontal);
+  size-policy-horizontal: fixed;
+  text-align: right;
+  color: var(list_item_content_normal);
+  font-variant: primary;
+  text-height: var(hb-param-text-height-primary);
+  text-line-count-min:1;
+  text-line-count-max:1;
+}
+
+MsgListViewItem::presenceIndicator[layoutName="custom"]:landscape {
+  right: var(hb-param-margin-gene-middle-horizontal);
+  size-policy-horizontal: fixed;
+  size-policy-vertical: fixed;
+  pref-width: var(hb-param-graphic-size-secondary);
+  pref-height: var(hb-param-graphic-size-secondary);
+  aspect-ratio: ignore;
+}
+
+MsgListViewItem[unReadMsg="true"]::timeLabel[layoutName="custom"]:landscape {
+  right:var(hb-param-margin-gene-right);
+  size-policy-horizontal: fixed;
+  pref-width:12un;
+  text-align: right;
+  color: var(list_item_content_normal);
+  font-variant: primary;
+  text-height: var(hb-param-text-height-tiny);
+  text-line-count-min:1;
+  text-line-count-max:1;
+}
+
+MsgListViewItem[unReadMsg="false"]::timeLabel[layoutName="custom"]:landscape {
+  right:var(hb-param-margin-gene-right);
+  size-policy-horizontal: fixed;
+  pref-width:12un;
+  text-align: right;
+  color: var(list_item_content_normal);
+  font-variant: secondary;
+  text-height: var(hb-param-text-height-tiny);
+  text-line-count-min:1;
+  text-line-count-max:1;
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/msgapp/resources/xml/msglistviewitem.widgetml	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,64 @@
+<hbwidget version="0.1" type="MsgListViewItem">
+
+  <layout name="layout-portrait" type="mesh">
+    <meshitem src="newMsgIndicator" srcEdge="TOP" dst="" dstEdge="TOP" />
+    <meshitem src="newMsgIndicator" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+    <meshitem src="newMsgIndicator" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+
+    <meshitem src="addressLabel" srcEdge="TOP" dst="newMsgIndicator" dstEdge="TOP" />
+    <meshitem src="addressLabel" srcEdge="BOTTOM" dst="previewLabel" dstEdge="TOP" />
+    <meshitem src="addressLabel" srcEdge="RIGHT" dst="unreadCount" dstEdge="LEFT" />
+    <meshitem src="addressLabel" srcEdge="LEFT" dst="newMsgIndicator" dstEdge="RIGHT" />
+
+    <meshitem src="previewLabel" srcEdge="LEFT" dst="newMsgIndicator" dstEdge="RIGHT" />
+    <meshitem src="previewLabel" srcEdge="RIGHT" dst="timeLabel" dstEdge="LEFT" />
+
+    <meshitem src="unreadCount" srcEdge="TOP" dst="addressLabel" dstEdge="TOP" />
+    <meshitem src="unreadCount" srcEdge="RIGHT" dst="presenceIndicator" dstEdge="LEFT" />
+    <meshitem src="unreadCount" srcEdge="BOTTOM" dst="addressLabel" dstEdge="BOTTOM" />
+
+    <meshitem src="presenceIndicator" srcEdge="CENTERV" dst="addressLabel" dstEdge="CENTERV" />
+    <meshitem src="presenceIndicator" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+
+    <meshitem src="timeLabel" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+    <meshitem src="timeLabel" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+
+    <meshitem src="bgFrame" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+    <meshitem src="bgFrame" srcEdge="TOP" dst="" dstEdge="TOP" />
+    <meshitem src="bgFrame" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+    <meshitem src="bgFrame" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+
+  </layout>
+
+  <layout name="layout-landscape" type="mesh">
+
+    <meshitem src="addressLabel" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+    <meshitem src="addressLabel" srcEdge="TOP" dst="" dstEdge="TOP" />
+    <meshitem src="addressLabel" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+    <meshitem src="addressLabel" srcEdge="RIGHT" dst="unreadCount" dstEdge="LEFT" />
+
+    <meshitem src="unreadCount" srcEdge="RIGHT" dst="presenceIndicator" dstEdge="LEFT" />
+    <meshitem src="unreadCount" srcEdge="CENTERV" dst="addressLabel" dstEdge="CENTERV" />
+
+    <meshitem src="presenceIndicator" srcEdge="RIGHT" dst="" dstEdge="CENTERH" />
+    <meshitem src="presenceIndicator" srcEdge="CENTERV" dst="addressLabel" dstEdge="CENTERV" />
+
+    <meshitem src="previewLabel" srcEdge="LEFT" dst="" dstEdge="CENTERH" />
+    <meshitem src="previewLabel" srcEdge="RIGHT" dst="timeLabel" dstEdge="LEFT"  />
+    <meshitem src="previewLabel" srcEdge="CENTERV" dst="addressLabel" dstEdge="CENTERV"  />
+
+    <meshitem src="timeLabel" srcEdge="RIGHT" dst="" dstEdge="RIGHT"  />
+    <meshitem src="timeLabel" srcEdge="CENTERV" dst="addressLabel" dstEdge="CENTERV" />
+
+    <meshitem src="newMsgIndicator" srcEdge="TOP" dst="" dstEdge="TOP" />
+    <meshitem src="newMsgIndicator" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+    <meshitem src="newMsgIndicator" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+
+    <meshitem src="bgFrame" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+    <meshitem src="bgFrame" srcEdge="TOP" dst="" dstEdge="TOP" />
+    <meshitem src="bgFrame" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+    <meshitem src="bgFrame" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+
+  </layout>
+
+</hbwidget>
--- a/messagingapp/msgui/msgapp/src/draftslistview.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/msgapp/src/draftslistview.cpp	Mon May 03 12:29:07 2010 +0300
@@ -29,7 +29,10 @@
 #include <HbStyleLoader>
 #include <HbGroupBox>
 #include <HbFrameBackground>
+#include <HbMessageBox>
+#include <HbMainWindow>
 
+#include <QAbstractItemModel>
 #include <QSortFilterProxyModel>
 #include <QGraphicsLinearLayout>
 
@@ -46,23 +49,36 @@
 const QString SORT_ICON("qtg_mono_sort");
 
 // LOCALIZATION CONSTANTS
-#define LOC_COMMON_OPEN hbTrId("txt_common_menu_open")
-#define LOC_COMMON_DELETE hbTrId("txt_common_menu_delete")
-#define VIEW_HEADING "Drafts"
-#define MENU_DELETE_ALL "Delete all drafts"
-#define TB_VIEW_EXTN "View"
-#define TB_NEW_MESSAGE "New message"
-#define TB_EXTN_DRAFTS "Drafts"
-#define TB_EXTN_CONVERSATIONS "Conversations"
+
+// Long Tap
+#define LOC_COMMON_OPEN           hbTrId("txt_common_menu_open")
+#define LOC_COMMON_DELETE         hbTrId("txt_common_menu_delete")
+
+// View heading
+#define LOC_DLV_HEADING           hbTrId("txt_messaging_title_drafts")
+
+// Menu items
+#define LOC_MENU_DELETE_ALL       hbTrId("txt_messaging_opt_delete_all")
+
+// Toolbar & toolbar exension
+#define LOC_TB_EXTN_DRAFTS        hbTrId("txt_messaging_button_drafts")
+#define LOC_TB_EXTN_CONVERSATIONS hbTrId("txt_messaging_button_conversations")
+
+// Confirmation note
+#define LOC_DELETE_MESSAGE        hbTrId("txt_messaging_dialog_delete_message")
+#define LOC_DELETE_ALL_DRAFTS     hbTrId("txt_messaging_dialog_delate_all_drafts")
+#define LOC_BUTTON_DELETE         hbTrId("txt_common_button_delete")
+#define LOC_BUTTON_CANCEL         hbTrId("txt_common_button_cancel")
 
 //---------------------------------------------------------------
 // DraftsListView::DraftsListView
 // @see header
 //---------------------------------------------------------------
 DraftsListView::DraftsListView(QGraphicsItem *parent) :
-    MsgBaseView(parent), mListView(0), mViewExtnList(0)
+    MsgBaseView(parent), mListView(0), mViewExtnList(0), mToolBar(0)
 {
-    createView();
+    // Delayed loading.
+    connect(this->mainWindow(), SIGNAL(viewReady()), this, SLOT(doDelayedLoading()));
 }
 
 //---------------------------------------------------------------
@@ -74,22 +90,18 @@
 }
 
 //---------------------------------------------------------------
-// DraftsListView::createView
-// @see header
-//---------------------------------------------------------------
-void DraftsListView::createView()
-{
-    setupToolbar();
-    setupMenu();
-    setupListView();
-}
-
-//---------------------------------------------------------------
 // DraftsListView::setupMenu
 // @see header
 //---------------------------------------------------------------
 void DraftsListView::setupMenu()
 {
+    QAbstractItemModel *model = mListView->model();
+
+    // Menu items are added/removed based on the item count.
+    connect(mListView->model(), SIGNAL(rowsInserted(QModelIndex, int, int)), this,
+        SLOT(handleModelChanged()), Qt::UniqueConnection);
+    connect(mListView->model(), SIGNAL(rowsRemoved(QModelIndex, int, int)), this,
+        SLOT(handleModelChanged()), Qt::UniqueConnection);
 }
 
 //---------------------------------------------------------------
@@ -98,33 +110,32 @@
 //---------------------------------------------------------------
 void DraftsListView::setupToolbar()
 {
-    HbToolBar *toolBar = this->toolBar();
-    toolBar->setOrientation(Qt::Horizontal);
+    if (!mToolBar) {
+        mToolBar = this->toolBar();
+        mToolBar->setOrientation(Qt::Horizontal);
 
-    // Create & setup ToolBar Extension
-    HbToolBarExtension *viewExtn = new HbToolBarExtension();
-    HbAction *viewAction = toolBar->addExtension(viewExtn);
-    viewAction->setText(TB_VIEW_EXTN);
-    viewAction->setIcon(HbIcon(SORT_ICON));
+        // Create & setup ToolBar Extension
+        HbToolBarExtension *viewExtn = new HbToolBarExtension();
+        HbAction *viewAction = mToolBar->addExtension(viewExtn);
+        viewAction->setIcon(HbIcon(SORT_ICON));
 
-    mViewExtnList = new HbListWidget();
-    mViewExtnList->addItem(TB_EXTN_DRAFTS);
-    mViewExtnList->addItem(TB_EXTN_CONVERSATIONS);
+        mViewExtnList = new HbListWidget();
+        mViewExtnList->addItem(LOC_TB_EXTN_DRAFTS);
+        mViewExtnList->addItem(LOC_TB_EXTN_CONVERSATIONS);
 
-    HbListViewItem *prototype = mViewExtnList->listItemPrototype();
-    HbFrameBackground frame(POPUP_LIST_FRAME, HbFrameDrawer::NinePieces);
-    prototype->setDefaultFrame(frame);
+        HbListViewItem *prototype = mViewExtnList->listItemPrototype();
+        HbFrameBackground frame(POPUP_LIST_FRAME, HbFrameDrawer::NinePieces);
+        prototype->setDefaultFrame(frame);
 
-    connect(mViewExtnList, SIGNAL(activated(HbListWidgetItem*)), this,
-        SLOT(handleViewExtnActivated(HbListWidgetItem*)));
-    connect(mViewExtnList, SIGNAL(activated(HbListWidgetItem*)), viewExtn, SLOT(close()));
+        connect(mViewExtnList, SIGNAL(activated(HbListWidgetItem*)), this,
+            SLOT(handleViewExtnActivated(HbListWidgetItem*)));
+        connect(mViewExtnList, SIGNAL(released(HbListWidgetItem*)), viewExtn, SLOT(close()));
 
-    viewExtn->setContentWidget(mViewExtnList);
+        viewExtn->setContentWidget(mViewExtnList);
 
-    // Create & setup 2nd ToolBar button.
-    HbAction* newMessageAction = new HbAction(HbIcon(NEW_MESSAGE_ICON), TB_NEW_MESSAGE, this);
-    connect(newMessageAction, SIGNAL(triggered()), this, SLOT(createNewMessage()));
-    toolBar->addAction(newMessageAction);
+        // Create & setup 2nd ToolBar button.
+        mToolBar->addAction(HbIcon(NEW_MESSAGE_ICON), "", this, SLOT(createNewMessage()));
+    }
 }
 
 //---------------------------------------------------------------
@@ -133,52 +144,68 @@
 //---------------------------------------------------------------
 void DraftsListView::setupListView()
 {
-    // Create parent layout.
-    QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(Qt::Vertical);
-    mainLayout->setContentsMargins(0, 0, 0, 0);
-    mainLayout->setSpacing(0);
+    if (!mListView) {
+        // Create parent layout.
+        QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(Qt::Vertical);
+        mainLayout->setContentsMargins(0, 0, 0, 0);
+        mainLayout->setSpacing(0);
 
-    // Create view heading.
-    HbGroupBox *viewHeading = new HbGroupBox();
-    viewHeading->setTitleText(VIEW_HEADING);
+        // Create view heading.
+        HbGroupBox *viewHeading = new HbGroupBox();
+        viewHeading->setHeading(LOC_DLV_HEADING);
+
+        // Create List View.
+        mListView = new HbListView(this);
 
-    // Create List View.
-    mListView = new HbListView(this);
-    mListView->setScrollingStyle(HbScrollArea::PanOrFlick);
-    mListView->setItemRecycling(true);
-    mListView->setUniformItemSizes(true);
-    mListView->setClampingStyle(HbScrollArea::BounceBackClamping);
+        mListView->setScrollingStyle(HbScrollArea::PanOrFlick);
+        mListView->setItemRecycling(true);
+        mListView->setUniformItemSizes(true);
+        mListView->setClampingStyle(HbScrollArea::BounceBackClamping);
 
-    // Register the custorm css path.
-    HbStyleLoader::registerFilePath(":/hblistviewitem.css");
-    //    mListView->setLayoutName("custom");
+        // Register the custorm css path.
+        HbStyleLoader::registerFilePath(":/xml/hblistviewitem.css");
+        //    mListView->setLayoutName("custom");
+
+        // Set list item properties.
+        HbListViewItem *prototype = mListView->listItemPrototype();
+        prototype->setGraphicsSize(HbListViewItem::SmallIcon);
+        prototype->setStretchingStyle(HbListViewItem::StretchLandscape);
+        prototype->setSecondaryTextRowCount(1, 1);
+        HbFrameBackground frame(LIST_ITEM_FRAME, HbFrameDrawer::NinePieces);
+        prototype->setDefaultFrame(frame);
 
-    // Set list item properties.
-    HbListViewItem *prototype = mListView->listItemPrototype();
-    prototype->setGraphicsSize(HbListViewItem::SmallIcon);
-    prototype->setStretchingStyle(HbListViewItem::StretchLandscape);
-    prototype->setSecondaryTextRowCount(1, 1);
-    HbFrameBackground frame(LIST_ITEM_FRAME, HbFrameDrawer::NinePieces);
-    prototype->setDefaultFrame(frame);
+        // Create and set model
+        QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(this);
+        proxyModel->setDynamicSortFilter(true);
+        proxyModel->setSourceModel(ConversationsEngine::instance()->getDraftsModel());
+        proxyModel->setSortRole(TimeStamp);
+        proxyModel->sort(0, Qt::DescendingOrder);
+        mListView->setModel(proxyModel);
+
+        // Short & Long Taps
+        connect(mListView, SIGNAL(activated(QModelIndex)), this,
+            SLOT(openDraftMessage(QModelIndex)));
+        connect(mListView, SIGNAL(longPressed(HbAbstractViewItem*,QPointF)), this,
+            SLOT(handleLongPressed(HbAbstractViewItem*,QPointF)));
 
-    // Create and set model
-    QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(this);
-    proxyModel->setDynamicSortFilter(true);
-    proxyModel->setSourceModel(ConversationsEngine::instance()->getDraftsModel());
-    proxyModel->setSortRole(TimeStamp);
-    proxyModel->sort(0, Qt::DescendingOrder);
-    mListView->setModel(proxyModel);
+        // Add all widgets to main layout.
+        mainLayout->addItem(viewHeading);
+        mainLayout->addItem(mListView);
+
+        this->setLayout(mainLayout);
+    }
+}
 
-    // Short & Long Taps
-    connect(mListView, SIGNAL(activated(QModelIndex)), this, SLOT(openDraftMessage(QModelIndex)));
-    connect(mListView, SIGNAL(longPressed(HbAbstractViewItem*,QPointF)), this,
-        SLOT(handleLongPressed(HbAbstractViewItem*,QPointF)));
-
-    // Add all widgets to main layout.
-    mainLayout->addItem(viewHeading);
-    mainLayout->addItem(mListView);
-
-    this->setLayout(mainLayout);
+//------------------------------------------------------------------------------
+// DraftsListView::doDelayedLoading
+// @see header
+//------------------------------------------------------------------------------
+void DraftsListView::doDelayedLoading()
+{
+    setupToolbar();
+    setupListView();
+    setupMenu();
+    disconnect(this->mainWindow(), SIGNAL(viewReady()), this, SLOT(doDelayedLoading()));
 }
 
 //------------------------------------------------------------------------------
@@ -196,10 +223,35 @@
 //------------------------------------------------------------------------------
 void DraftsListView::deleteDraftMessage()
 {
-    int msgId = mListView->currentIndex().data(ConvergedMsgId).toInt();
-    QList<int> msgIdList;
-    msgIdList.append(msgId);
-    ConversationsEngine::instance()->deleteMessages(msgIdList);
+    QModelIndex index = mListView->currentIndex();
+
+    if (!index.isValid()) {
+        return;
+    }
+
+    bool result = HbMessageBox::question(LOC_DELETE_MESSAGE, LOC_BUTTON_DELETE, LOC_BUTTON_CANCEL);
+
+    if (result) {
+        int msgId = index.data(ConvergedMsgId).toInt();
+        QList<int> msgIdList;
+        msgIdList.append(msgId);
+        ConversationsEngine::instance()->deleteMessages(msgIdList);
+    }
+
+}
+
+//------------------------------------------------------------------------------
+// DraftsListView::deleteAllDraftMessage
+// @see header
+//------------------------------------------------------------------------------
+void DraftsListView::deleteAllDraftMessage()
+{
+    bool result = HbMessageBox::question(LOC_DELETE_ALL_DRAFTS, LOC_BUTTON_DELETE,
+        LOC_BUTTON_CANCEL);
+
+    if (result) {
+        ConversationsEngine::instance()->deleteAllDraftMessages();
+    }
 }
 
 //------------------------------------------------------------------------------
@@ -283,4 +335,22 @@
     }
 }
 
+//------------------------------------------------------------------------------
+// DraftsListView::handleModelChanged
+// @see header
+//------------------------------------------------------------------------------
+void DraftsListView::handleModelChanged()
+{
+    // If there are no items in list view, delete the menu item.
+    HbMenu *mainMenu = this->menu();
+    if (!mListView->model()->rowCount()) {
+        mainMenu->clearActions();
+    }
+    else {
+        if (this->menu()->isEmpty()) {
+            mainMenu->addAction(LOC_MENU_DELETE_ALL, this, SLOT(deleteAllDraftMessage()));
+        }
+    }
+}
+
 // EOF
--- a/messagingapp/msgui/msgapp/src/msglistview.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/msgapp/src/msglistview.cpp	Mon May 03 12:29:07 2010 +0300
@@ -19,34 +19,33 @@
 
 // SYSTEM INCLUDES
 #include <hbmenu.h>
-#include <hbinstance.h>
-#include <hbapplication.h>
 #include <hbaction.h>
 #include <hbtoolbar.h>
 #include <hbtoolbarextension.h>
 #include <hblistview.h>
 #include <hblistwidget.h>
 #include <hblistwidgetitem.h>
-#include <hbnotificationdialog.h>
 #include <hbgroupbox.h>
 #include <hbmessagebox.h>
 #include <hbframebackground.h>
-#include <QProcess>
 #include <QSortFilterProxyModel>
 #include <QGraphicsLinearLayout>
-//cp settings launcher.
-#include <cppluginlauncher.h>
 #include <hblistviewitem.h>
 #include <HbStyleLoader>
-#include <hbeffect.h>
+#include <HbMainWindow>
+#include <xqaiwrequest.h>
+#include <xqappmgr.h>
+#include <qtcontacts.h>
 
 // USER INCLUDES
 #include "msgconversationviewinterface.h"
 #include "debugtraces.h"
 #include "conversationsengine.h"
 #include "conversationsenginedefines.h"
+#include "convergedmessage.h"
+#include "msglistviewitem.h"
 
-#include "msglistviewitem.h"
+QTM_USE_NAMESPACE
 
 //Icons
 const QString POPUP_LIST_FRAME("qtg_fr_popup_list_normal");
@@ -54,15 +53,20 @@
 const QString SORT_ICON("qtg_mono_sort");
 
 //Localized constants
-#define LOC_MENU_DELETE_CONVERSATION hbTrId("txt_messaging_menu_delete_conversation")
+
 #define LOC_DIALOG_DELETE_CONVERSATION hbTrId("txt_messaging_dialog_delete_conversation")
-#define LOC_POPINFO_CONVERSATION_DELETED hbTrId("txt_messaging_dpopinfo_conversation_deleted")
 
-#define LOC_COMMON_OPEN hbTrId("txt_common_menu_open")
+//itemspecific menu
+#define LOC_OPEN hbTrId("txt_common_menu_open")
+#define LOC_SAVETO_CONTACTS hbTrId("txt_messaging_menu_save_to_contacts")
+#define LOC_DELETE_CONVERSATION hbTrId("txt_messaging_menu_delete_conversation")
+#define LOC_OPEN_CONTACT_INFO hbTrId("txt_messaging_menu_open_contact_info")
+
 #define LOC_BUTTON_DELETE hbTrId("txt_common_button_delete")
 #define LOC_BUTTON_CANCEL hbTrId("txt_common_button_cancel")
 
-#define LOC_SETTINGS hbTrId("txt_messaging_opt_settings")
+//main menu
+#define LOC_SETTINGS    hbTrId("txt_messaging_opt_settings")
 
 #define LOC_TB_VIEW_EXTN hbTrId("txt_messaging_button_view")
 #define LOC_TB_NEW_MESSAGE hbTrId("txt_messaging_button_new_message")
@@ -71,7 +75,6 @@
 
 #define LOC_VIEW_HEADING hbTrId("txt_messaging_title_conversations")
 
-//const int MSGSETTINGSPLUGIN_UID = 0x2001FE74;
 //---------------------------------------------------------------
 // MsgListView::MsgListView
 // @see header
@@ -79,8 +82,7 @@
 MsgListView::MsgListView(QGraphicsItem *parent) :
     MsgBaseView(parent)
 {
-    // Create the MsgListView.
-    createView();
+    connect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(doDelayedConstruction()));
 }
 
 //---------------------------------------------------------------
@@ -89,7 +91,7 @@
 //---------------------------------------------------------------
 MsgListView::~MsgListView()
 {
-    mMsgList->setModel(NULL);
+    
 }
 
 //---------------------------------------------------------------
@@ -106,28 +108,30 @@
         // Create new menu
         HbMenu *contextMenu = new HbMenu();
 
-        // Add the menu items
-        HbAction *contextItem1 = contextMenu->addAction(LOC_COMMON_OPEN);
-        connect(contextItem1, SIGNAL(triggered()), this, SLOT(
-            openConversation()));
-
-        //This Item specific option is not mentioned in the UI spec
-        HbAction *contextItem2 = contextMenu->addAction(tr("Show contact info"));
-        connect(contextItem2, SIGNAL(triggered()), this, SLOT(showContact()));
-
-        qint64 conversationId = mMsgList->currentIndex().data(ConversationId).toLongLong();
-
-        bool isNotSent = false; //TODO implement new api 
-        //MessageModel::instance()->isMessageSendingOrScheduled(conversationId);
-        // Display Delete option only if conversation does not contain 
-        // any message which is yet to be sent
-        if (isNotSent == false) {
-            HbAction *contextItem3 = contextMenu->addAction(LOC_MENU_DELETE_CONVERSATION);
-            connect(contextItem3, SIGNAL(triggered()), this, SLOT(deleteItem()));
-        }
+        //open menu option
+        contextMenu->addAction(LOC_OPEN,this,SLOT(openConversation()));
+        
+        //save to contacts for unresolved.
+        int msgType = viewItem->modelIndex().data(MessageType).toInt();
+        if(msgType == ConvergedMessage::Sms || 
+           msgType == ConvergedMessage::Mms || 
+           msgType == ConvergedMessage::BioMsg)
+            {
+            qint64 contactId = mMsgList->currentIndex().data(ContactId).toLongLong();
+            if(contactId < 0)
+                {
+                contextMenu->addAction(LOC_SAVETO_CONTACTS,this,SLOT(saveToContacts()));
+                }
+            else
+                {
+                contextMenu->addAction(LOC_OPEN_CONTACT_INFO,this,SLOT(contactInfo()));
+                }
+            }
+        
+        //delete conversation
+        contextMenu->addAction(LOC_DELETE_CONVERSATION,this,SLOT(deleteItem()));
 
         contextMenu->exec(point);
-
         // Cleanup
         delete contextMenu;
     }
@@ -155,36 +159,6 @@
 }
 
 //---------------------------------------------------------------
-// MsgListView::sortBySubject
-// @see header
-//---------------------------------------------------------------
-void MsgListView::sortBySubject()
-{
-    //	mProxyModel->setSortRole(LatestMsg);
-    //	mProxyModel->sort(0, Qt::AscendingOrder);
-}
-
-//---------------------------------------------------------------
-// MsgListView::sortByDate
-// @see header
-//---------------------------------------------------------------
-void MsgListView::sortByDate()
-{
-    //	mProxyModel->setSortRole(LatestMsgTimeStamp);
-    //	mProxyModel->sort(0, Qt::DescendingOrder);
-}
-
-//---------------------------------------------------------------
-// MsgListView::sortBySender
-// @see header
-//---------------------------------------------------------------
-void MsgListView::sortBySender()
-{
-    //	mProxyModel->setSortRole(ContactName);
-    //	mProxyModel->sort(0, Qt::AscendingOrder);
-}
-
-//---------------------------------------------------------------
 // MsgListView::sendNewMessage
 // @see header
 //---------------------------------------------------------------
@@ -198,32 +172,6 @@
 }
 
 //---------------------------------------------------------------
-// MsgListView::closeActiveClats
-// @see header
-//---------------------------------------------------------------
-void MsgListView::closeActiveChats()
-{
-    // Implementation for closing all active chats
-}
-
-//---------------------------------------------------------------
-// MsgListView::deleteAll
-// @see header
-//---------------------------------------------------------------
-void MsgListView::deleteAll()
-{
-}
-
-//---------------------------------------------------------------
-// MsgListView::viewImMessagesSeperately
-// @see header
-//---------------------------------------------------------------
-void MsgListView::viewImMessagesSeparately()
-{
-    //Lists all the Im messages separately
-}
-
-//---------------------------------------------------------------
 // MsgListView::settings
 // @see header
 //---------------------------------------------------------------
@@ -265,32 +213,22 @@
 #endif
 
     QModelIndex index = mMsgList->currentIndex();
-    qint64 conversationId = 0;
-    conversationId = index.data(ConversationId).toLongLong();
+    qint64 conversationId = index.data(ConversationId).toLongLong();
 
+    //confirmation dialog.
     bool result = HbMessageBox::question(LOC_DIALOG_DELETE_CONVERSATION,
-        LOC_BUTTON_DELETE, LOC_BUTTON_CANCEL);
-    if (result) {
+                                         LOC_BUTTON_DELETE, LOC_BUTTON_CANCEL);
+    if (result) 
+        {
         ConversationsEngine::instance()->deleteConversations(conversationId);
-        HbNotificationDialog::launchDialog(LOC_POPINFO_CONVERSATION_DELETED);
-    }
+        }
+    
 #ifdef _DEBUG_TRACES_	
     qDebug() << " Leaving MsgConversationView::deleteItem";
 #endif
 }
 
 //---------------------------------------------------------------
-// MsgListView::createView
-// @see header
-//---------------------------------------------------------------
-void MsgListView::createView()
-{
-    setupMenu();
-    setupToolBar();
-    setupListView();
-}
-
-//---------------------------------------------------------------
 // MsgListView::setupView
 // @see header
 //---------------------------------------------------------------
@@ -303,44 +241,42 @@
 
     // Create view heading.
     HbGroupBox *viewHeading = new HbGroupBox();
-    viewHeading->setTitleText(LOC_VIEW_HEADING);
+    viewHeading->setHeading(LOC_VIEW_HEADING);
 
     // Register the custorm css path.
-    HbStyleLoader::registerFilePath(":/msglistviewitem.css");
-    HbStyleLoader::registerFilePath(":/msglistviewitem.widgetml");
+    HbStyleLoader::registerFilePath(":/xml/msglistviewitem.css");
+    HbStyleLoader::registerFilePath(":/xml/msglistviewitem.widgetml");
 
     mMsgList = new HbListView(this);
-
-    HbEffect::add(QString("ListView"), QString(":/slide_in_from_screen_bottom.fxml"), QString(
-        "show"));
+    mMsgList->setScrollingStyle(HbScrollArea::PanOrFlick);
+    mMsgList->setClampingStyle(HbScrollArea::BounceBackClamping);
 
     mMsgList->setLayoutName("custom");
-    mMsgList->setItemRecycling(false);
-    mMsgList->setUniformItemSizes(true);
-   
-    mMsgList->setScrollingStyle(HbScrollArea::PanOrFlick);
+    mMsgList->setItemRecycling(true);
+    mMsgList->setUniformItemSizes(true);   
+
     MsgListViewItem *prototype = new MsgListViewItem(this);
     mMsgList->setItemPrototype(prototype);
 
     // Set proxy model
-    mProxyModel = new QSortFilterProxyModel(this);
-    mProxyModel->setDynamicSortFilter(true);
-    mProxyModel->setSourceModel(ConversationsEngine::instance()->getConversationsSummaryModel());
-    mProxyModel->setSortRole(TimeStamp);
-    mProxyModel->sort(0, Qt::DescendingOrder);
+    QSortFilterProxyModel* proxyModel = new QSortFilterProxyModel(this);
+    proxyModel->setDynamicSortFilter(true);
+    proxyModel->setSourceModel(ConversationsEngine::instance()->getConversationsSummaryModel());
+    proxyModel->setSortRole(TimeStamp);
+    proxyModel->sort(0, Qt::DescendingOrder);
 
-    mMsgList->setModel(mProxyModel);
+    mMsgList->setModel(proxyModel);
 
-    connect(ConversationsEngine::instance(), SIGNAL(conversationListModelPopulated()), this,
-        SLOT(populateListView()));
+    connect(ConversationsEngine::instance(), SIGNAL(conversationListModelPopulated()),
+            this, SLOT(populateListView()));
 
     // Single tap list item
-    connect(mMsgList, SIGNAL(activated(const QModelIndex&)), this,
-        SLOT(openConversation(const QModelIndex&)));
+    connect(mMsgList, SIGNAL(activated(const QModelIndex&)),
+            this, SLOT(openConversation(const QModelIndex&)));
 
     // Long tap list item
-    connect(mMsgList, SIGNAL(longPressed(HbAbstractViewItem*, const QPointF&)), this,
-        SLOT(longPressed(HbAbstractViewItem*, const QPointF&)));
+    connect(mMsgList, SIGNAL(longPressed(HbAbstractViewItem*, const QPointF&)),
+            this, SLOT(longPressed(HbAbstractViewItem*, const QPointF&)));
 
     // Add all widgets to main layout.
     mainLayout->addItem(viewHeading);
@@ -356,17 +292,8 @@
 void MsgListView::setupMenu()
 {
     // Main menu
-    // Get the menu pointer for the view
-
     HbMenu* mainMenu = this->menu();
-
-    // Delete (This option is not mentioned in the UI spec 1.04)
-    HbAction* deleteItem = mainMenu->addAction(tr("Delete"));
-    connect(deleteItem, SIGNAL(triggered()), this, SLOT(deleteAll()));
-
-    // Settings
-    HbAction* settings = mainMenu->addAction(LOC_SETTINGS);
-    connect(settings, SIGNAL(triggered()), this, SLOT(settings()));
+    mainMenu->addAction(LOC_SETTINGS,this,SLOT(settings()));
 }
 
 //---------------------------------------------------------------
@@ -382,7 +309,6 @@
     // Create & setup ToolBar Extension
     HbToolBarExtension *viewExtn = new HbToolBarExtension();
     HbAction *viewAction = toolBar->addExtension(viewExtn);
-    viewAction->setText(LOC_TB_VIEW_EXTN);
     viewAction->setIcon(HbIcon(SORT_ICON));
 
     mViewExtnList = new HbListWidget();
@@ -393,34 +319,14 @@
     HbFrameBackground frame(POPUP_LIST_FRAME, HbFrameDrawer::NinePieces);
     prototype->setDefaultFrame(frame);
 
-    connect(mViewExtnList, SIGNAL(activated(HbListWidgetItem*)), this,
-        SLOT(handleViewExtnActivated(HbListWidgetItem*)));
-    connect(mViewExtnList, SIGNAL(activated(HbListWidgetItem*)), viewExtn, SLOT(close()));
+    connect(mViewExtnList, SIGNAL(activated(HbListWidgetItem*)),
+            this,SLOT(handleViewExtnActivated(HbListWidgetItem*)));
+    connect(mViewExtnList, SIGNAL(released(HbListWidgetItem*)), viewExtn, SLOT(close()));
 
     viewExtn->setContentWidget(mViewExtnList);
-
+    
     // Create & setup 2nd ToolBar button.
-    HbAction* newMessageAction = new HbAction(HbIcon(NEW_MESSAGE_ICON), LOC_TB_NEW_MESSAGE, this);
-    connect(newMessageAction, SIGNAL(triggered()), this, SLOT(sendNewMessage()));
-    toolBar->addAction(newMessageAction);
-}
-
-//---------------------------------------------------------------
-// MsgListView::activateView
-// @see header
-//---------------------------------------------------------------
-void MsgListView::activateView()
-{
-    HbEffect::start(mMsgList, QString("ListView"), QString("show"), this, NULL);
-}
-
-//---------------------------------------------------------------
-// MsgListView::populateListView
-// @see header
-//---------------------------------------------------------------
-void MsgListView::populateListView()
-{
-
+    toolBar->addAction(HbIcon(NEW_MESSAGE_ICON),"",this,SLOT(sendNewMessage()));
 }
 
 //---------------------------------------------------------------
@@ -439,4 +345,82 @@
     }
 }
 
+//---------------------------------------------------------------
+// MsgListView::doDelayedConstruction
+// @see header
+//---------------------------------------------------------------
+void MsgListView::doDelayedConstruction()
+    {
+    setupToolBar();    
+    setupListView();
+    setupMenu();
+    
+    disconnect(this->mainWindow(),SIGNAL(viewReady()),this,SLOT(doDelayedConstruction()));
+    }
+
+//---------------------------------------------------------------
+// MsgListView::saveToContacts
+// @see header
+//---------------------------------------------------------------
+void MsgListView::saveToContacts()
+    {
+    //save to contacts with phone number field prefilled.
+    QList<QVariant> args;  
+
+    QString data = mMsgList->currentIndex().data(DisplayName).toString();
+
+    QString type = QContactPhoneNumber::DefinitionName;
+
+    args << type;
+    args << data;
+
+    //service stuff.
+    QString serviceName("com.nokia.services.phonebookservices");
+    QString operation("editCreateNew(QString,QString)");
+
+    XQAiwRequest* request;
+    XQApplicationManager appManager;
+    request = appManager.create(serviceName, "Fetch", operation, true); // embedded
+    if ( request == NULL )
+        {
+        return;       
+        }
+
+    request->setArguments(args);
+    request->send();
+    
+    delete request;
+    }
+
+//---------------------------------------------------------------
+// MsgListView::contactInfo
+// @see header
+//---------------------------------------------------------------
+void MsgListView::contactInfo()
+    {
+    //open contact info.
+    QList<QVariant> args;  
+
+    int contactId = mMsgList->currentIndex().data(ContactId).toInt();
+
+    args << contactId;
+
+    //service stuff.
+    QString serviceName("com.nokia.services.phonebookservices");
+    QString operation("open(int)");
+
+    XQAiwRequest* request;
+    XQApplicationManager appManager;
+    request = appManager.create(serviceName, "Fetch", operation, true); // embedded
+    if ( request == NULL )
+        {
+        return;       
+        }
+
+    request->setArguments(args);
+    request->send();
+    
+    delete request;
+    }
+
 //EOF
--- a/messagingapp/msgui/msgapp/src/msglistviewitem.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/msgapp/src/msglistviewitem.cpp	Mon May 03 12:29:07 2010 +0300
@@ -19,10 +19,12 @@
 #include "msglistviewitem.h"
 
 #include <QDateTime>
+#include <QFileInfo>
 #include <hbframeitem.h>
 #include <hbframedrawer.h>
 #include <HbTextItem>
 #include <HbFrameItem>
+#include <HbIconItem>
 
 #include "msgcommondefines.h"
 #include "conversationsengine.h"
@@ -31,10 +33,20 @@
 #include "convergedmessage.h"
 #include "debugtraces.h"
 
-#define NEW_ITEM_FRAME ":/newitem/qtg_fr_list_new_item"
 #define LOC_RINGING_TONE hbTrId("txt_messaging_dpopinfo_ringing_tone")
+#define LOC_MSG_SEND_FAILED hbTrId("txt_messaging_list_message_sending_failed")
+#define LOC_MSG_OUTGOING hbTrId("txt_messaging_list_outgoing_message")
+#define LOC_MSG_RESEND_AT hbTrId("Resend at ")
+#define LOC_BUSINESS_CARD hbTrId("txt_messaging_list_business_card")
+#define LOC_CALENDAR_EVENT hbTrId("txt_messaging_list_calendar_event")
+#define LOC_UNSUPPORTED_MSG_TYPE hbTrId("txt_messaging_list_unsupported_message_type")
+#define LOC_RECEIVED_FILES hbTrId("txt_messaging_list_received_files")
 
+const QString NEW_ITEM_FRAME("qtg_fr_list_new_item");
 const QString LIST_ITEM_BG_FRAME("qtg_fr_list_normal");
+const QString BT_ICON("qtg_large_bluetooth");
+const QString MSG_OUTGOING_ICON("qtg_mono_outbox");
+const QString MSG_FAILED_ICON("qtg_mono_failed");
 
 //---------------------------------------------------------------
 // MsgListViewItem::MsgListViewItem
@@ -107,99 +119,52 @@
         mBgFrameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
     }
 
-    // Time Stamp.
-    QDateTime dateTime;
-    dateTime.setTime_t(modelIndex().data(TimeStamp).toUInt());
-    QString dateString;
-    if (dateTime.date() == QDateTime::currentDateTime().date())
-    {
-        dateString = MsgUtils::dateTimeToString(dateTime, TIME_FORMAT);
-    }
-    else
-    {
-        dateString = MsgUtils::dateTimeToString(dateTime, DATE_FORMAT);
-    }
-
-    mTimestampItem->setText(dateString);
+    // Set the message text depending upon the message type
+    int messageType = modelIndex().data(MessageType).toInt();
+    int messageSubType = modelIndex().data(MessageSubType).toInt();
+    int messageState = modelIndex().data(SendingState).toInt();
+    int messageDirection = modelIndex().data(Direction).toInt();
+    QString prevText;
+    prevText = previewText(messageType, messageSubType, messageState,messageDirection);
+    prevText.replace(QChar::ParagraphSeparator, QChar::LineSeparator);
+    prevText.replace('\r', QChar::LineSeparator);
+    mPreviewLabelItem->setText(prevText);
 
-    //Sender
-    QString firstName = modelIndex().data(FirstName).toString();
-    QString lastName = modelIndex().data(LastName).toString();
-    QString nickName = modelIndex().data(NickName).toString();
-    QString contactAddress = modelIndex().data(ConversationAddress).toString();
+    // Address label
     QString contactName;
-
-    if (!nickName.isEmpty())
+    if(messageType == ConvergedMessage::BT)
     {
-        contactName.append(nickName);
-    }
-    else if (firstName.isEmpty() && lastName.isEmpty())
-    {
-        contactName.append(contactAddress);
-    }
-    else if (lastName.isEmpty())
-    {
-        contactName.append(firstName);
-    }
-    else if (firstName.isEmpty())
-    {
-        contactName.append(lastName);
+        contactName = LOC_RECEIVED_FILES;
     }
     else
     {
-        // If both first Name and last name are present
-        contactName.append(firstName);
-        contactName.append(" ");
-        contactName.append(lastName);
+        QString displayName = modelIndex().data(DisplayName).toString();
+        QString contactAddress = modelIndex().data(ConversationAddress).toString();
+
+        if (displayName.isEmpty())
+        {
+            contactName.append(contactAddress);
+        }
+        else
+        {
+            contactName.append(displayName);
+        }        
     }
     mAddressLabelItem->setText(contactName);
 
-    // Latest Message
-    int messageType = modelIndex().data(MessageType).toInt();
-    QString previewText;
-    // Set the message text depending upon the message type
-    if (messageType == ConvergedMessage::Mms)
-    {
-        QDEBUG_WRITE("MsgListViewItem::updateChildItems Mms block")
-        previewText = modelIndex().data(Subject).toString();
-    }
-    else if(messageType == ConvergedMessage::RingingTone)
-    {
-        QDEBUG_WRITE("MsgListViewItem::updateChildItems RingingTone block")
-        previewText = LOC_RINGING_TONE;
-    }
-	else if (messageType == ConvergedMessage::VCard)
-    {
-        previewText = QString("Business Card");
-    }
-    else if (messageType == ConvergedMessage::VCal)
-    {
-        previewText = QString("Calender Event");
-    }
-    else if(messageType == ConvergedMessage::BioMsg)
-    {
-        previewText = QString("Unsupported Type");
-    }
-    else
-    {
-        QDEBUG_WRITE("MsgListViewItem::updateChildItems default block")
-        previewText = modelIndex().data(BodyText).toString();
-    }
-    mPreviewLabelItem->setText(previewText);
-
     // Unread message count
     int unreadCount = modelIndex().data(UnreadCount).toInt();
-    QString unRead;
+
     if (unreadCount > 0)
     {
-        unRead.append(tr("(%n)", "", unreadCount));
+        QString unRead(tr("(%n)", "", unreadCount));
         mUnreadCountItem->setText(unRead);
         mUnReadMsg = true;
         mNewMsgIndicatorItem->frameDrawer().setFrameGraphicsName(NEW_ITEM_FRAME);
     }
     else
     {
-        mUnreadCountItem->setText("");
+        mUnreadCountItem->setText(QString());
         mNewMsgIndicatorItem->frameDrawer().setFrameGraphicsName(QString());
         mUnReadMsg = false;
         repolish();
@@ -209,6 +174,147 @@
 }
 
 //---------------------------------------------------------------
+// MsgListViewItem::previewText
+// @see header
+//---------------------------------------------------------------
+QString MsgListViewItem::previewText(int msgType, 
+    int msgSubType, 
+    int msgState,
+    int msgDirection)
+{
+    QString bodyText(modelIndex().data(BodyText).toString());
+    QString previewText;
+    // Set the message text & icons, depending upon the message type
+    if (msgType == ConvergedMessage::BioMsg) {
+        if (msgSubType == ConvergedMessage::RingingTone) {
+            previewText = LOC_RINGING_TONE;
+        }
+        else if (msgSubType == ConvergedMessage::VCard) {
+            previewText = LOC_BUSINESS_CARD;
+            previewText.append(QChar::LineSeparator);
+            previewText.append(bodyText);
+        }
+        else {
+            previewText = LOC_UNSUPPORTED_MSG_TYPE;
+        }
+    }
+    else if (msgType == ConvergedMessage::BT) {
+        
+        if (msgSubType == ConvergedMessage::VCard) {
+            previewText = LOC_BUSINESS_CARD;
+            previewText.append(QChar::LineSeparator);
+            previewText.append(bodyText);
+        }
+        else {
+            previewText = bodyText;
+        }
+        if (!mPresenceIndicatorItem) {
+            mPresenceIndicatorItem = new HbIconItem(this);
+            HbStyle::setItemName(mPresenceIndicatorItem, "presenceIndicator");
+            mPresenceIndicatorItem->setIconName(BT_ICON);
+        }
+    }
+    else {
+        previewText = textBySendState(msgState,msgDirection);
+    }
+    return previewText;
+}
+
+
+//---------------------------------------------------------------
+// MsgListViewItem::textBySendState
+// @see header
+//---------------------------------------------------------------
+QString MsgListViewItem::textBySendState(int sendState,int msgDirection)
+{
+    QString previewText;
+    QDateTime dateTime;
+    dateTime.setTime_t(modelIndex().data(TimeStamp).toUInt());
+    QString dateString;
+    if (dateTime.date() == QDateTime::currentDateTime().date()) {
+        dateString = MsgUtils::dateTimeToString(dateTime, TIME_FORMAT);
+    }
+    else {
+        dateString = MsgUtils::dateTimeToString(dateTime, DATE_FORMAT);
+    }
+
+    if (msgDirection == ConvergedMessage::Outgoing)
+    {
+        switch (sendState)
+        {
+            case ConvergedMessage::Resend:
+            {
+
+                QString resendString = LOC_MSG_RESEND_AT + dateString;
+                previewText = resendString;
+                dateString = QString("");
+                if (!mPresenceIndicatorItem)
+                {
+                    mPresenceIndicatorItem = new HbIconItem(this);
+                }
+                HbStyle::setItemName(mPresenceIndicatorItem,
+                    "presenceIndicator");
+                mPresenceIndicatorItem->setIconName(MSG_OUTGOING_ICON);
+                mPresenceIndicatorItem->setVisible(true);
+                break;
+            }
+
+            case ConvergedMessage::Sending:
+            case ConvergedMessage::Suspended:
+            case ConvergedMessage::Scheduled:
+            case ConvergedMessage::Waiting:
+            {
+                previewText = QString(LOC_MSG_OUTGOING);
+                if (!mPresenceIndicatorItem)
+                {
+                    mPresenceIndicatorItem = new HbIconItem(this);
+                }
+                HbStyle::setItemName(mPresenceIndicatorItem,
+                    "presenceIndicator");
+                mPresenceIndicatorItem->setIconName(MSG_OUTGOING_ICON);
+                mPresenceIndicatorItem->setVisible(true);
+                break;
+            }
+            case ConvergedMessage::Failed:
+            {
+                previewText = QString(LOC_MSG_SEND_FAILED);
+                if (!mPresenceIndicatorItem)
+                {
+                    mPresenceIndicatorItem = new HbIconItem(this);
+                }
+                HbStyle::setItemName(mPresenceIndicatorItem,
+                    "presenceIndicator");
+                mPresenceIndicatorItem->setIconName(MSG_FAILED_ICON);
+                mPresenceIndicatorItem->setVisible(true);
+                break;
+            }
+            default:
+                QString postFix = QString("");
+                previewText = modelIndex().data(BodyText).toString();
+                previewText += (QChar(QChar::LineSeparator) + postFix);
+
+                if (!mPresenceIndicatorItem)
+                {
+                    mPresenceIndicatorItem = new HbIconItem(this);
+                }
+
+                HbStyle::setItemName(mPresenceIndicatorItem,
+                    "presenceIndicator");
+                mPresenceIndicatorItem->setIconName(MSG_FAILED_ICON);
+                mPresenceIndicatorItem->setVisible(false);
+
+                break;
+        }
+    }
+    else
+    {
+        previewText = modelIndex().data(BodyText).toString();
+    }
+    mTimestampItem->setText(dateString);
+    return previewText;
+}
+
+//---------------------------------------------------------------
 // MsgListViewItem::paint.
 // @see header
 //---------------------------------------------------------------
--- a/messagingapp/msgui/msgapp/src/msgserviceinterface.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/msgapp/src/msgserviceinterface.cpp	Mon May 03 12:29:07 2010 +0300
@@ -44,6 +44,14 @@
     mViewManager->send(contactId, phoneNumber, displayName);    
     }
 
+
+void MsgServiceInterface::send(const QString phoneNumber, const QString alias, const QString bodyText)
+    {   
+    mViewManager->setServiceRequest(true);
+    mViewManager->send(phoneNumber, alias, bodyText);    
+    }
+
+
 void MsgServiceInterface::open(qint64 conversationId)
     {
     mViewManager->setServiceRequest(false);
@@ -56,6 +64,11 @@
     mViewManager->send(data);    
     }
 
+void MsgServiceInterface::view(int msgId)
+    {   
+    mViewManager->view(msgId); 
+    }
+    
 void MsgServiceInterface::openConversationView(QString number, QString name)
     {
     mViewManager->setServiceRequest(true);
@@ -71,15 +84,7 @@
         bool ret = resolveContact(address, contactDetail);
         if(ret)
             {
-            if(!contactDetail.lastName.isEmpty())
-                {
-                resolvedName += contactDetail.lastName;
-                if(!contactDetail.firstName.isEmpty())
-                    {
-                    resolvedName += ", ";
-                    }
-                }
-            resolvedName += contactDetail.firstName;
+            resolvedName = contactDetail.displayName;
             }
         }
     mViewManager->openEditor(number,resolvedName);
@@ -90,23 +95,24 @@
     {
     QContactManager* mPhonebookManager = new QContactManager("symbian");
     QContactDetailFilter phoneFilter;
-    phoneFilter.setDetailDefinitionName(QContactPhoneNumber::DefinitionName, QContactPhoneNumber::FieldNumber);
+    phoneFilter.setDetailDefinitionName(
+            QContactPhoneNumber::DefinitionName, 
+            QContactPhoneNumber::FieldNumber);
     phoneFilter.setValue(address.address());
     phoneFilter.setMatchFlags(QContactFilter::MatchEndsWith);
 
-    QList<QContactLocalId> matchingContacts = mPhonebookManager->contacts(phoneFilter);
+    QList<QContactSortOrder> sortOrder;
+    QList<QContact> matchingContacts = mPhonebookManager->contacts(
+            phoneFilter,
+            sortOrder,
+            QStringList());
 
     if ( matchingContacts.count() > 0 ) {       
-    // Fill the contact details
-    contactDetail.contactId = matchingContacts.at(0);
-    QContact match = mPhonebookManager->contact(matchingContacts.at(0));
-
-    QContactName nameDetails = match.detail(QContactName::DefinitionName);
-
-    QContactName name = match.detail(QContactName::DefinitionName);
-    contactDetail.firstName = name.first();
-    contactDetail.lastName = name.last();
-    return true;
+        // Fill the contact details
+        QContact match = matchingContacts.at(0);                   
+        contactDetail.contactId = match.localId();
+        contactDetail.displayName = match.displayLabel();   
+        return true;
     }
     
     return false;
--- a/messagingapp/msgui/msgapp/src/msgviewmanager.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/msgapp/src/msgviewmanager.cpp	Mon May 03 12:29:07 2010 +0300
@@ -24,7 +24,8 @@
 #include <QSqlQuery>
 #include <QSqlError>
 #include <HbApplication>
-#include <HbNotificationDialog>
+#include <xqappmgr.h>
+#include <HbMessageBox.h>
 
 #include "conversationsengine.h"
 #include "msglistview.h"
@@ -34,16 +35,21 @@
 #include "draftslistview.h"
 #include "msgsettingsview.h"
 #include "convergedmessageid.h"
+#include "ringbc.h"
+#include "unidatamodelloader.h"
+#include "unidatamodelplugininterface.h"
 
 // LOCALIZATION
-#define LOC_SAVED_TO_DRAFTS ("Saved to Drafts")
+#define LOC_BUTTON_DELETE hbTrId("txt_common_button_delete")
+#define LOC_BUTTON_CANCEL hbTrId("txt_common_button_cancel")
+#define LOC_DELETE_MESSAGE hbTrId("txt_messaging_dialog_delete_message")
 
 const qint64 NULL_CONVERSATIONID = -1;
 
 MsgViewManager::MsgViewManager(bool serviceRequest, HbMainWindow* mainWindow, QObject* parent) :
     QObject(parent), mMainWindow(mainWindow), mUniEditor(0), mListView(0), mConversationView(0),
         mUniViewer(0), mDraftsListView(0), mSettingsView(0), mBackAction(0), mServiceRequest(
-            serviceRequest), mConversationId(-1)
+            serviceRequest), mConversationId(-1), mViewServiceRequest(false)
 {
     //creating back action.
     mBackAction = new HbAction(Hb::BackAction, this);
@@ -68,6 +74,12 @@
     switch (mCurrentView) {
     case MsgBaseView::CLV:
     {
+        // if its viewer service then quit the application
+        if (mViewServiceRequest) {
+            HbApplication::quit();
+            break;
+        }
+
         if (!mServiceRequest) {
             HbApplication::quit();
         }
@@ -81,7 +93,7 @@
     case MsgBaseView::CV:
     {
         //Save content to drafts before switching to clv
-        bool result = mConversationView->saveContentToDrafts();
+        mConversationView->saveContentToDrafts();
 
         //marking messages as red in CV.
         mConversationView->markMessagesAsRead();
@@ -89,6 +101,13 @@
         //clearing content of cv.
         mConversationView->clearContent();
 
+        // if service request for veiwer the just switch to univiewer.
+        if (mViewServiceRequest) {
+            mCurrentView = MsgBaseView::UNIVIEWER;
+            mMainWindow->setCurrentView(mUniViewer);
+            break;
+        }
+
         if (mServiceRequest) {
             completeServiceRequest();
         }
@@ -98,9 +117,6 @@
             param << MsgBaseView::CLV;
             param << MsgBaseView::CV;
             switchView(param);
-            if (result) {
-                HbNotificationDialog::launchDialog(LOC_SAVED_TO_DRAFTS);
-            }
         }
 
         break;
@@ -125,7 +141,22 @@
     case MsgBaseView::UNIEDITOR:
     {
         //Save content to drafts before switching to clv
-        bool result = mUniEditor->saveContentToDrafts();
+        mUniEditor->saveContentToDrafts();
+
+        // if service request for veiwer the just switch to univiewer.
+        if (mViewServiceRequest) {
+            mCurrentView = MsgBaseView::UNIVIEWER;
+            mMainWindow->setCurrentView(mUniViewer);
+            break;
+        }
+
+        //Now UE can be launched from viewer and on its back
+        //we need to clear viewer
+        if (mUniViewer) {
+            mMainWindow->removeView(mUniViewer);
+            delete mUniViewer;
+            mUniViewer = NULL;
+        }
 
         //switch to clv.
         if (mServiceRequest) {
@@ -137,9 +168,6 @@
             param << MsgBaseView::CLV;
             param << MsgBaseView::UNIEDITOR;
             switchView(param);
-            if (result) {
-                HbNotificationDialog::launchDialog(LOC_SAVED_TO_DRAFTS);
-            }
         }
 
         break;
@@ -147,18 +175,30 @@
 
     case MsgBaseView::UNIVIEWER:
     {
-        //swich to cv.  
-        QVariantList param;
-        param << MsgBaseView::CV;
-        param << MsgBaseView::UNIVIEWER;
-        param << mConversationId;
-        switchView(param);
+        // if its launched via service request quit the app
+        if (mViewServiceRequest) {
+            HbApplication::quit();
+        }
+        else {
+            QVariantList param;
+            param << MsgBaseView::CV;
+            param << MsgBaseView::UNIVIEWER;
+            param << mConversationId;
+            switchView(param);
 
-        mUniViewer->clearContent();
-
+            delete mUniViewer;
+            mUniViewer = NULL;
+        }
         break;
     }
-
+    case MsgBaseView::MSGSETTINGS:
+    {
+        QVariantList param;
+        param << MsgBaseView::DEFAULT;
+        param << MsgBaseView::MSGSETTINGS;
+        switchView(param);
+        break;
+    }
     default:
     {
         break;
@@ -245,6 +285,28 @@
     XQServiceUtil::toBackground(false);
 }
 
+void MsgViewManager::send(const QString phoneNumber, const QString alias, const QString bodyText)
+{
+    ConvergedMessage message;
+    ConvergedMessageAddress address;
+    address.setAddress(phoneNumber);
+    address.setAlias(alias);
+    message.addToRecipient(address);
+    message.setBodyText(bodyText);
+
+    QVariantList param;
+    QByteArray dataArray;
+    QDataStream messageStream(&dataArray, QIODevice::WriteOnly | QIODevice::Append);
+    message.serialize(messageStream);
+
+    param << MsgBaseView::UNIEDITOR;
+    param << MsgBaseView::SERVICE;
+    param << dataArray;
+
+    switchView(param);
+    XQServiceUtil::toBackground(false);
+}
+
 void MsgViewManager::setServiceRequest(bool request)
 {
     mServiceRequest = request;
@@ -301,10 +363,15 @@
 {
     ConvergedMessage message;
     ConvergedMessageAttachmentList attachmentList;
-    QString path = data.toString();
-    ConvergedMessageAttachment *attachment = new ConvergedMessageAttachment(path);
-
-    attachmentList.append(attachment);
+    // handle multiple files from sendUI
+    // e.g. contacts can send multiple vcards
+    QStringList receivedFiles = data.toStringList();
+    int recFileCount = receivedFiles.count();
+    for (int i = 0; i < recFileCount; i++) {
+        ConvergedMessageAttachment *attachment =
+            new ConvergedMessageAttachment(receivedFiles.at(i));
+        attachmentList.append(attachment);
+    }
     message.addAttachments(attachmentList);
 
     QByteArray dataArray;
@@ -360,12 +427,12 @@
     mCurrentView = MsgBaseView::CLV;
     mPreviousView = data.at(1).toInt();
 
-    //delete uni editor.
-    if (mUniEditor) {
-        mMainWindow->removeView(mUniEditor);
-        delete mUniEditor;
-        mUniEditor = NULL;
+    // delete case from viewer service  
+    if (mViewServiceRequest && (mPreviousView == MsgBaseView::UNIVIEWER)) {
+        // quit the application 
+        HbApplication::quit();
     }
+
     //remove the settings view from main window
     if (mSettingsView) {
         mMainWindow->removeView(mSettingsView);
@@ -383,8 +450,21 @@
         connect(mListView, SIGNAL(switchView(const QVariantList&)), this,
             SLOT(switchView(const QVariantList&)));
         mMainWindow->addView(mListView);
-        mListView->activateView();
+    }
+
+    //delete uni editor.
+    if (mUniEditor) {
+        mMainWindow->removeView(mUniEditor);
+        delete mUniEditor;
+        mUniEditor = NULL;
     }
+
+    if (mUniViewer) {
+        mMainWindow->removeView(mUniViewer);
+        delete mUniViewer;
+        mUniViewer = NULL;
+    }
+
     mMainWindow->setCurrentView(mListView);
 }
 
@@ -394,6 +474,12 @@
     mCurrentView = MsgBaseView::CV;
     mPreviousView = data.at(1).toInt();
 
+    // delete case from viewer service
+    if (mViewServiceRequest && (mPreviousView == MsgBaseView::UNIVIEWER)) {
+        // quit the application 
+        HbApplication::quit();
+    }
+
     //delete uni editor.
     if (mUniEditor) {
         mMainWindow->removeView(mUniEditor);
@@ -401,6 +487,12 @@
         mUniEditor = NULL;
     }
 
+    if (mUniViewer) {
+        mMainWindow->removeView(mUniViewer);
+        delete mUniViewer;
+        mUniViewer = NULL;
+    }
+
     QVariant var = data.at(2);
     qint64 conversationId;
     if (var.type() == QVariant::String) {
@@ -419,8 +511,11 @@
         // this case comes when a message is deleted from 
         // Unified viewer  set curent view as conversation view 
         // and return
-        mMainWindow->setCurrentView(mConversationView, false);
-        mUniViewer->clearContent();
+        mMainWindow->setCurrentView(mConversationView);
+
+        delete mUniViewer;
+        mUniViewer = NULL;
+
         return;
     }
     else {
@@ -441,10 +536,10 @@
     mConversationView->openConversation(conversationId);
 
     if (mServiceRequest) {
-        mMainWindow->setCurrentView(mConversationView, false);
+        mMainWindow->setCurrentView(mConversationView);
     }
     else {
-        mMainWindow->setCurrentView(mConversationView, false);
+        mMainWindow->setCurrentView(mConversationView);
     }
 }
 
@@ -474,6 +569,14 @@
 
 void MsgViewManager::switchToUniEditor(const QVariantList& data)
 {
+    /**
+     * Editor is tried to open again before exiting the previously
+     * opened editor. Multi taping in DLV or Forward.
+     */
+    if (mUniEditor) {
+        return;
+    }
+
     mCurrentView = MsgBaseView::UNIEDITOR;
     mPreviousView = data.at(1).toInt();
 
@@ -491,28 +594,24 @@
             SLOT(switchView(const QVariantList&)));
     }
 
+    // check if additional data for unieditor's consumption is available
     if (data.length() > 2) {
-        QByteArray dataArray = data.at(2).toByteArray();
-        ConvergedMessage *message = new ConvergedMessage;
-        QDataStream stream(&dataArray, QIODevice::ReadOnly);
-        message->deserialize(stream);
+        QVariantList editorData;
+        // i=2 because view manager consumed first two args
+        for (int i = 2; i < data.length(); i++) {
+            editorData << data.at(i);
+        }
 
-        if (data.length() > 3) {
-            mUniEditor->populateContent(*message, data.at(3).toInt());
+        if (MsgBaseView::DLV == mPreviousView) {
+            mUniEditor->openDraftsMessage(editorData);
         }
         else {
-            if (MsgBaseView::DLV == mPreviousView) {
-                mUniEditor->openDraftsMessage(*(message->id()), message->messageType());
-            }
-            else {
-                mUniEditor->populateContent(*message);
-            }
+            mUniEditor->populateContent(editorData);
         }
-        delete message;
     }
 
     if (mServiceRequest) {
-        mMainWindow->setCurrentView(mUniEditor, false);
+        mMainWindow->setCurrentView(mUniEditor);
     }
     else {
         mMainWindow->setCurrentView(mUniEditor);
@@ -521,6 +620,14 @@
 
 void MsgViewManager::switchToUniViewer(const QVariantList& data)
 {
+    /**
+     * Viewer is tried to open again before exiting the previously
+     * opened viewer. Multi taping bubbles in CV.
+     */
+    if (mUniViewer) {
+        return;
+    }
+
     mCurrentView = MsgBaseView::UNIVIEWER;
     mPreviousView = data.at(1).toInt();
 
@@ -533,7 +640,7 @@
         ConvergedMessage *message = new ConvergedMessage;
         QDataStream stream(&dataArray, QIODevice::ReadOnly);
         message->deserialize(stream);
-		qint32 messageId = message->id()->getId();
+        qint32 messageId = message->id()->getId();
         if (!mUniViewer) {
             mUniViewer = new UnifiedViewer(messageId);
             mUniViewer->setNavigationAction(mBackAction);
@@ -553,17 +660,10 @@
 
     if (!mSettingsView) {
         mSettingsView = new MsgSettingsView();
-        connect(mSettingsView, SIGNAL(switchView(const QVariantList&)), this,
-            SLOT(switchView(const QVariantList&)));
+        mSettingsView->setNavigationAction(mBackAction);
+        mMainWindow->addView(mSettingsView);
+        mMainWindow->setCurrentView(mSettingsView);
     }
-    else {
-        //re-connect the back action
-        mSettingsView->connectCloseAction();
-    }
-
-    mMainWindow->addView(mSettingsView);
-    disconnect(mBackAction, SIGNAL(triggered()), this, SLOT(onBackAction()));
-    mMainWindow->setCurrentView(mSettingsView);
 }
 
 void MsgViewManager::handleDefault(const QVariantList& data)
@@ -577,8 +677,8 @@
         //remove the settings view from main window
         if (mSettingsView) {
             mMainWindow->removeView(mSettingsView);
-            mSettingsView->setNavigationAction(mBackAction);
-            connect(mBackAction, SIGNAL(triggered()), this, SLOT(onBackAction()));
+            delete mSettingsView;
+            mSettingsView = NULL;
         }
         switch (mCurrentView) {
         case MsgBaseView::CLV:
@@ -590,7 +690,7 @@
         case MsgBaseView::CV:
         {
             if (mConversationView)
-                mMainWindow->setCurrentView(mConversationView, false);
+                mMainWindow->setCurrentView(mConversationView);
             break;
         }
         case MsgBaseView::DLV:
@@ -602,7 +702,7 @@
         case MsgBaseView::UNIEDITOR:
         {
             if (mServiceRequest) {
-                mMainWindow->setCurrentView(mUniEditor, false);
+                mMainWindow->setCurrentView(mUniEditor);
             }
             else {
                 mMainWindow->setCurrentView(mUniEditor);
@@ -612,3 +712,135 @@
         }
     }
 }
+
+void MsgViewManager::view(int msgId)
+{
+    int msgType;
+    int msgSubType;
+
+    qint32 messageId(msgId);
+    ConversationsEngine::instance()->markAsReadAndGetType(messageId, msgType, msgSubType);
+
+    switch (msgType) {
+    case ConvergedMessage::Sms:
+    case ConvergedMessage::Mms:
+    case ConvergedMessage::MmsNotification:
+    {
+        handleSmsMmsMsg(msgId);
+        break;
+    }
+    case ConvergedMessage::BioMsg:
+    {
+        if (msgSubType == ConvergedMessage::RingingTone) {
+            handleRingtoneMsg(msgId);
+
+        }
+        else if (msgSubType == ConvergedMessage::Provisioning) {
+            handleProvisoningMsg(msgId);
+        }
+        break;
+    }
+    case ConvergedMessage::BT:
+    {
+        break;
+    }
+    default:
+    {
+        // for un supported message show delete option
+        bool result = HbMessageBox::question(LOC_DELETE_MESSAGE, LOC_BUTTON_DELETE,
+            LOC_BUTTON_CANCEL);
+        if (result) {
+            QList<int> msgIdList;
+            msgIdList << msgId;
+            ConversationsEngine::instance()->deleteMessages(msgIdList);
+        }
+        HbApplication::quit(); // exit after handling
+        break;
+    }
+    }
+}
+
+// ----------------------------------------------------------------------------
+// MsgViewManager::handleSmsMmsMsg
+// @see header
+// ----------------------------------------------------------------------------
+void MsgViewManager::handleSmsMmsMsg(int msgId)
+{
+    mViewServiceRequest = true;
+
+    mCurrentView = MsgBaseView::UNIVIEWER;
+
+    if (!mUniViewer) {
+        mUniViewer = new UnifiedViewer(msgId);
+        mUniViewer->setNavigationAction(mBackAction);
+        mMainWindow->addView(mUniViewer);
+        connect(mUniViewer, SIGNAL(switchView(const QVariantList&)), this,
+            SLOT(switchView(const QVariantList&)));
+    }
+    mUniViewer->populateContent(msgId, true, -1);
+
+    mMainWindow->setCurrentView(mUniViewer);
+}
+
+// ----------------------------------------------------------------------------
+// MsgViewManager::handleRingtoneMsg
+// @see header
+// ----------------------------------------------------------------------------
+void MsgViewManager::handleRingtoneMsg(int msgId)
+{
+    if (RingBc::askSaveQuery()) {
+        UniDataModelLoader* pluginLoader = new UniDataModelLoader();
+        UniDataModelPluginInterface* pluginInterface = pluginLoader->getDataModelPlugin(
+            ConvergedMessage::BioMsg);
+        pluginInterface->setMessageId(msgId);
+        UniMessageInfoList attachments = pluginInterface->attachmentList();
+
+        QString attachmentPath = attachments.at(0)->path();
+
+        RingBc* ringBc = new RingBc();
+        ringBc->saveTone(attachmentPath);
+
+        // clear attachement list : its allocated at data model
+        while (!attachments.isEmpty()) {
+            delete attachments.takeFirst();
+        }
+
+        delete ringBc;
+        delete pluginLoader;
+    }
+
+    // close the application once its handled
+    HbApplication::quit();
+}
+
+// ----------------------------------------------------------------------------
+// MsgViewManager::handleProvisoningMsg
+// @see header
+// ----------------------------------------------------------------------------
+void MsgViewManager::handleProvisoningMsg(int msgId)
+{
+    QString messageId;
+    messageId.setNum(msgId);
+
+    XQApplicationManager* aiwMgr = new XQApplicationManager();
+
+    XQAiwRequest* request = aiwMgr->create("com.nokia.services.MDM", "Provisioning",
+        "ProcessMessage(QString)", true); // embedded
+
+    if (request) {
+        QList<QVariant> args;
+        args << QVariant(messageId);
+        request->setArguments(args);
+
+        // Send the request
+        bool res = request->send();
+
+        // Cleanup
+        delete request;
+    }
+
+    delete aiwMgr;
+
+    // close the application once its handled
+    HbApplication::quit();
+}
--- a/messagingapp/msgui/msguiutils/inc/matchphnumberutil.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- * 
- * Description:
- *
- */
-
-#ifndef MATCH_PHNUMBER_UTIL_H
-#define MATCH_PHNUMBER_UTIL_H
-
-#include "msguiutilsmanager.h"
-/**
- * This class provides number of ph number digits to be matched for contact matching
- * 
- */
-class MSGUI_UTILS_DLL_EXPORT MatchPhNumberUtil
-    {
-    
-public:
-    
-    /**
-     * Get amount of digits to be used in contact matching
-     */
-    static int matchDigits();
-    
-    };
-    
-
-    
-
-#endif // MATCH_PHNUMBER_UTIL_H
-
-// EOF
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/msguiutils/inc/mmsconformancecheck.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,104 @@
+/*
+ * 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: mms creation mode checks
+ *
+ */
+
+#ifndef MMS_CONFORMANCE_CHECK_OPERATION_H
+#define MMS_CONFORMANCE_CHECK_OPERATION_H
+
+#include <msgmediainfo.h>
+#include <qstring.h>
+
+#ifdef BUILD_MSGUI_UTILS_DLL
+#define MSGUI_UTILS_DLL_EXPORT Q_DECL_EXPORT
+#else
+#define MSGUI_UTILS_DLL_EXPORT Q_DECL_IMPORT
+#endif
+
+class CMmsConformance;
+class CMsgMediaResolver;
+class CDRMHelper;
+
+
+enum MmsConformanceCheckErrors
+{
+    EInsertSuccess = 0, EInsertQueryAbort, EInsertNotSupported
+};
+
+/**
+ * This class provides interfaces which validate the media for 
+ * insertion into editor and also validates if the mms message
+ * can be forwarded.
+ * 
+ */
+
+class MSGUI_UTILS_DLL_EXPORT MmsConformanceCheck
+{
+public:
+
+    /**
+     * Constructor
+     */
+    MmsConformanceCheck();
+
+    /**
+     * Destructor
+     */
+    ~MmsConformanceCheck();
+
+    /**
+     * Checks if the file passes conformance checks 
+     * @param file, filepath
+     * @param showNote, note is shown if enabled
+     * @return EInsertSuccess for successfull cases
+     */
+    int checkModeForInsert(const QString& file,bool showNote = true);
+
+    /**
+     * Validates if message can be forwarded
+     * The validation checks include slide count check,MMS size check and
+     * media conformance checks and this fucntion should be called only for mms
+     * @param  messageId message Id of the message to be validate
+     * @return true if message can be forwarded
+     *         false if message cant be forwarded
+     */
+    bool validateMsgForForward(int messageId);
+
+private:
+
+    /*
+     * Launch query dialog
+     */
+    bool launchEditorQuery();
+    
+    /*
+     * Launch notification dialog
+     */
+    void showPopup(const QString& text);
+    
+private:
+
+    /*
+     * Mms creation mode
+     */
+    TInt iCreationMode;
+    
+    /**
+     * Max MMS composition size
+     */
+    int iMaxMmsSize;    
+
+};
+#endif //MMS_CONFORMANCE_CHECK_OPERATION_H
--- a/messagingapp/msgui/msguiutils/inc/msgaudiofetcherutil.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +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: Audio fetcher helper class
- *
- */
-
-#ifndef MSG_AUDIOFETCHER_UTIL_H
-#define MSG_AUDIOFETCHER_UTIL_H
-
-#include <QObject>
-#include <QVariant>
-
-class XQApplicationManager;
-class XQAiwRequest;
-
-class MsgAudioFetcherUtil : public QObject
-    {
-    Q_OBJECT
-
-public:
-    /**
-     * Constructor
-     */
-    MsgAudioFetcherUtil(QObject* parent=0);
-
-    /**
-     * Destructor
-     */
-    ~MsgAudioFetcherUtil();
-
-    /**
-     * Fetch audio files
-     */
-    void fetchAudio();
-
-    signals:
-
-    /**
-     * emit when result is available
-     */
-    void resultReady(const QVariant& result);
-
-    /**
-     * emit when an error is generated.
-     * @param error The error as a string to be displayed on the screen.
-     */
-    void serviceError(const QString& error);
-
-private slots:
-    /**
-     * connects to XQApplication manager failure signal
-     */
-    void onRequestError(int errorCode, const QString& errorMessage);
-
-private:
-    /**
-     * ApplicationManager
-     * Owned
-     */
-    XQApplicationManager* mAppMgr;
-
-    /**
-     * AiwRequest
-     * Not Owned
-     */
-    XQAiwRequest* mRequest;
-    };
-
-#endif //MSG_AUDIOFETCHER_UTIL_H
--- a/messagingapp/msgui/msguiutils/inc/msgcontactsutil.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +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 MSG_CONTACTS_UTIL_H
-#define MSG_CONTACTS_UTIL_H
-
-#include <QObject>
-#include "convergedmessageaddress.h"
-
-class ConvergedMessage;
-class XQServiceRequest;
-
-/**
- * This class provides functionality for fetching contacts from phonebook.
- * 
- */
-class MsgContactsUtil : public QObject
-    {
-    Q_OBJECT
-
-public:
-    /**
-     * Constructor
-     */
-    MsgContactsUtil(QObject* parent =0);
-
-    /**
-     * Destructor
-     */
-    ~MsgContactsUtil();
-
-    /**
-     * Fectch conatcts
-     */
-    void fetchContacts();
-    
-    /*
-     * Open Contact Details
-     * @param contactId Conatct Id
-     */
-    void openContactDetails(qint32 contactId);
-
-private:
-        
-    /**
-     * Service Request
-     * Owned
-     */
-    XQServiceRequest* mRequest;
-    };
-
-#endif // MSG_CONTACTS_UTIL_H
-
-// EOF
-
--- a/messagingapp/msgui/msguiutils/inc/msgimagefetcherutil.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +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: Image fetcher helper class
- *
- */
-
-#ifndef MSG_IMAGEFETCHER_UTIL_H
-#define MSG_IMAGEFETCHER_UTIL_H
-
-#include <QObject>
-#include <QVariant>
-
-class XQApplicationManager;
-class XQAiwRequest;
-
-class MsgImageFetcherUtil : public QObject
-    {
-    Q_OBJECT
-
-public:
-    /**
-     * Constructor
-     */
-    MsgImageFetcherUtil(QObject* parent=0);
-
-    /**
-     * Destructor
-     */
-    ~MsgImageFetcherUtil();
-   
-    /**
-     * Fetch images 
-     */
-    void fetchImages();
-
-    signals:
-    
-    /**
-     * emit when result is available
-     */
-    void resultReady(const QVariant& result);
-    
-    /**
-     * Signal emitted when an error is generated.
-     * @param error The error as a string to be displayed on the screen.
-     */
-
-    void serviceError(const QString& error);
-
-    private slots:
-    /**
-     * connects to XQApplication manager failure signal
-     */
-    void onRequestError(int errorCode, const QString& errorMessage);
-
-private:
-   
-    /**
-     * ApplicationManager
-     * Owned
-     */
-    XQApplicationManager* mAppMgr;
-    
-    /**
-     * AiwRequest
-     * Not Owned
-     */
-    XQAiwRequest* mRequest;
-
-    };
-
-#endif //MSG_IMAGEFETCHER_UTIL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/msguiutils/inc/msgmediautil.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,65 @@
+/*
+ * 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 provides duration of media file by parsing it
+ *
+ */
+
+#ifndef MSG_MEDIA_UTIL_H
+#define MSG_MEDIA_UTIL_H
+
+#ifdef BUILD_MSGUI_UTILS_DLL
+#define MSGUI_UTILS_DLL_EXPORT Q_DECL_EXPORT
+#else
+#define MSGUI_UTILS_DLL_EXPORT Q_DECL_IMPORT
+#endif
+
+/**
+ * This class provides duration of media file by parsing it
+ * 
+ */
+class MSGUI_UTILS_DLL_EXPORT MsgMediaUtil
+    {
+    
+public:
+    /**
+     * Constructor
+     */
+    MsgMediaUtil();
+    
+    /**
+     * Destructor
+     */
+    ~MsgMediaUtil();
+    
+    /**
+     * Get the media file duration
+     * @param mediaFile file needs to be parsed to get duration
+     * @return QString returns duration in string format(ex: "05:14")
+     */
+    QString mediaDuration(const QString& mediaFile);
+    
+private: //internal methods
+    
+    /*
+     * internal method traps all leaving functions
+     * @param mediaFile file needs to be parsed to get duration 
+     * @return media duration in miliseconds
+     */
+    TInt mediaDurationL(const TDesC& mediaFile);
+    };
+    
+#endif // MSG_MEDIA_UTIL_H
+
+// EOF
+
--- a/messagingapp/msgui/msguiutils/inc/msgsendutil.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/msguiutils/inc/msgsendutil.h	Mon May 03 12:29:07 2010 +0300
@@ -22,6 +22,13 @@
 #include <QObject>
 #include "convergedmessage.h"
 
+#ifdef BUILD_MSGUI_UTILS_DLL
+#define MSGUI_UTILS_DLL_EXPORT Q_DECL_EXPORT
+#else
+#define MSGUI_UTILS_DLL_EXPORT Q_DECL_IMPORT
+#endif
+
+
 class UniEditorPluginLoader;
 class UniEditorGenUtils;
 class UniEditorPluginInterface;
@@ -30,7 +37,7 @@
  * This class manages the message send functionality.
  * 
  */
-class MsgSendUtil : public QObject
+class MSGUI_UTILS_DLL_EXPORT MsgSendUtil : public QObject
 {
 Q_OBJECT
 
--- a/messagingapp/msgui/msguiutils/inc/msguiutilsmanager.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,184 +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:Message send functionality handler.
- *
- */
-
-#ifndef MSGUI_UTILS_MANAGER_H
-#define MSGUI_UTILS_MANAGER_H
-
-#include <QObject>
-
-#ifdef BUILD_MSGUI_UTILS_DLL
-#define MSGUI_UTILS_DLL_EXPORT Q_DECL_EXPORT
-#else
-#define MSGUI_UTILS_DLL_EXPORT Q_DECL_IMPORT
-#endif
-
-#include <msvstd.h>
-#include <QGraphicsWidget>
-#include "convergedmessageaddress.h"
-
-class ConvergedMessage;
-class MsgSendUtil;
-class MsgImageFetcherUtil;
-class MsgAudioFetcherUtil;
-class MsgContactsUtil;
-
-/**
- * This class manages the msgui services like send, image picker 
- * and contacts functionality.
- * 
- */
-class MSGUI_UTILS_DLL_EXPORT MsgUiUtilsManager : public QObject
-    {
-    Q_OBJECT
-
-public:
-    /**
-     * Constructor
-     */
-    MsgUiUtilsManager(QObject* parent =0);
-
-    /**
-     * Destructor
-     */
-    ~MsgUiUtilsManager();
-    
-    
-public slots:
-    /**
-     * Send message
-     * @param msg Message to be sent 
-     * @return KErrNone if send is successful, 
-     *         KErrNotFound if settings are not available,
-     *         KErrGeneral for other cases
-     */
-    int send(ConvergedMessage& msg);
-
-    /**
-     * Save message to drafts
-     * @param msg Message to be sent 
-     * @return true if message is saved to drafts
-     */
-    TMsvId saveToDrafts(ConvergedMessage& msg);
-
-    /**
-     * Fetch images 
-     */
-    void fetchImages();
-
-    /**
-     * Fectch conatcts
-     */
-    void fetchContacts();
-    
-    /**
-     * Fectch videos
-     */
-    void fetchVideo();
-    
-    /**
-     * Fectch audio
-     */
-    void fetchAudio();
-    
-    /**
-     * Fectch others
-     */
-    void fetchOther();
-    
-    /*
-     * Open Contact Details
-     * @param contactId Conatct Id
-     */
-    void openContactDetails(qint32 contactId);
-
-    /**
-     * Activate Input Blocker
-     * @param parent User should ensure that parent is of non-input
-     * type e.g. view
-     */
-    void activateInputBlocker(QGraphicsWidget* parent);
-
-    /**
-     * Deactivate Input Blocker
-     */
-    void deactivateInputBlocker();
-
-signals:
-
-    /**
-     * Signal emitted when images are fetched from gallary
-     * @param images
-     */
-
-    void imagesFetched(const QVariant& images);
-
-    /**
-     * Signal emitted when audios are fetched from gallary
-     * @param audio files
-     */
-    void audiosFetched(const QVariant& audios);
-
-    /**
-     * Signal emitted when contacts are fetched from phonebook.
-     * @param contacts The list of contacts.
-     */
-
-    void contactsFetched(const QVariant& contacts);
-    /**
-     * Signal emitted when an error is generated.
-     * @param error The error as a string to be displayed on the screen.
-     */
-
-    void serviceError(const QString& error);
-
-private:
-
-    /**
-     * Send Utility
-     * Own
-     */
-    MsgSendUtil* mSendUtil;
-    
-    /**
-     * Image Fetcher
-     * Own
-     */
-    MsgImageFetcherUtil* mImageUtil;
-
-    /**
-     * Image Fetcher
-     * Own
-     */
-    MsgAudioFetcherUtil* mAudioUtil;
-
-    /**
-     * Conatcts Fetcher
-     * Own
-     */
-    MsgContactsUtil* mContactsUtil;
-
-    /**
-     * Input Blocker
-	 * Not owned
-     */
-    QGraphicsWidget* mInputBlocker;
-
-    };
-
-#endif // MSGUI_UTILS_MANAGER_H
-
-// EOF
--- a/messagingapp/msgui/msguiutils/msguiutils.pro	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/msguiutils/msguiutils.pro	Mon May 03 12:29:07 2010 +0300
@@ -23,10 +23,11 @@
     src
 
 INCLUDEPATH += ../../../inc
-INCLUDEPATH += ../../msgutils/unieditorutils/inc
+INCLUDEPATH += ../../msgutils/unieditorutils/editorgenutils/inc
+INCLUDEPATH += ../../msgutils/s60qconversions/inc
 INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-INCLUDEPATH += /ext/mw/qthighway/inc
 
+CONFIG += hb
 
 TARGET.UID3 = 0x2001FE69
 
@@ -44,23 +45,24 @@
 
 # Input
 HEADERS += msgsendutil.h \
-           msgimagefetcherutil.h \
-           msgaudiofetcherutil.h \
-           msgcontactsutil.h \
-           msguiutilsmanager.h \
-           matchphnumberutil.h
+           mmsconformancecheck.h \
+           msgmediautil.h
            
 SOURCES += msgsendutil.cpp \
-           msgimagefetcherutil.cpp \
-           msgaudiofetcherutil.cpp \
-           msgcontactsutil.cpp \
-           msguiutilsmanager.cpp \
-           matchphnumberutil.cpp
+           mmsconformancecheck.cpp \
+           msgmediautil.cpp
     
 # Libs
 LIBS += -lxqservice \
-    -lQtContacts \
     -lunieditorpluginloader \
-    -lunieditorutils \
+    -leditorgenutils \
     -lconvergedmessageutils \
-    -lcentralrepository
+    -lcentralrepository \
+    -ls60qconversions \
+    -lDRMHelper \
+    -lmsgmedia \
+    -lapmime \
+    -lunidatamodelloader \
+    -lxqutils
+
+
--- a/messagingapp/msgui/msguiutils/src/matchphnumberutil.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- * 
- * Description:
- *
- */
-#include <telconfigcrkeys.h>        // KCRUidTelephonyConfiguration
-#include <centralrepository.h>
-
-#include "matchphnumberutil.h"
-
-// Constants
-const int KDefaultGsmNumberMatchLength = 7;  //matching unique ph numbers
-
-int MatchPhNumberUtil::matchDigits()
-    {
-    // Read the amount of digits to be used in contact matching
-    // The key is owned by PhoneApp    
-    CRepository* repository = CRepository::NewLC(KCRUidTelConfiguration);
-    int matchDigitCount = 0;
-    if ( repository->Get(KTelMatchDigits, matchDigitCount) == KErrNone )
-        {
-    // Min is 7
-    matchDigitCount = Max(matchDigitCount, KDefaultGsmNumberMatchLength);
-        }
-    CleanupStack::PopAndDestroy(); // repository
-
-    return matchDigitCount;
-
-    }
-   
-
-
-// EOF
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/msguiutils/src/mmsconformancecheck.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,261 @@
+/*
+ * 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: mms creation mode checks
+ *
+ */
+
+
+#include "mmsconformancecheck.h"
+
+#include <MmsConformance.h>
+#include <centralrepository.h>
+#include <mmsconst.h>
+#include <msgmediainfo.h>
+#include <fileprotectionresolver.h>
+
+#include <MsgMediaResolver.h>
+#include <DRMHelper.h>
+#include <MmsEngineInternalCRKeys.h>
+#include <hbmessagebox.h>
+#include <hbnotificationdialog>
+
+#include "unidatamodelloader.h"
+#include "unidatamodelplugininterface.h"
+#include "unieditorgenutils.h" // This is needed for KDefaultMaxSize
+#include "s60qconversions.h"
+#include "debugtraces.h"
+
+//DEFINES
+#define RMODE_INSERT_ERROR hbTrId("Unable to insert. Object format not supported in restricted creation mode.")
+#define INSERT_ERROR hbTrId("txt_messaging_dpopinfo_unable_to_attach_item_file")
+#define INSERT_QUERY_CONFRM hbTrId("The receiving phone may not support this object. Continue?")
+// -----------------------------------------------------------------------------
+// MmsConformanceCheck::MmsConformanceCheck
+// -----------------------------------------------------------------------------
+//
+MmsConformanceCheck::MmsConformanceCheck()
+{
+    QDEBUG_WRITE("MmsConformanceCheck::MmsConformanceCheck start");
+
+    TRAP_IGNORE(        
+        CRepository* repository = CRepository::NewL(KCRUidMmsEngine);
+    CleanupStack::PushL(repository);
+
+    //Fetch and set creation mode
+    TInt creationMode = EMmsCreationModeRestricted;
+    repository->Get(KMmsEngineCreationMode, creationMode);
+    iCreationMode = creationMode;
+
+    //Fetch and set max mms composition size
+    TInt maxSize = KDefaultMaxSize;
+    repository->Get( KMmsEngineMaximumSendSize, maxSize );
+    iMaxMmsSize = maxSize;
+
+    CleanupStack::PopAndDestroy(repository);        
+    );
+
+    QDEBUG_WRITE("MmsConformanceCheck::MmsConformanceCheck end");
+}
+
+// -----------------------------------------------------------------------------
+// MmsConformanceCheck::~MmsConformanceCheck
+// -----------------------------------------------------------------------------
+//
+MmsConformanceCheck::~MmsConformanceCheck()
+{
+
+}
+
+// ---------------------------------------------------------
+// MmsConformanceCheck::CheckModeForInsert
+// ---------------------------------------------------------
+//
+int MmsConformanceCheck::checkModeForInsert(const QString& file,
+    bool showNote)
+{
+    QDEBUG_WRITE("MmsConformanceCheck::CheckModeForInsert start");
+    HBufC* filePath = S60QConversions::qStringToS60Desc(file);
+    if (filePath)
+    {
+        CleanupStack::PushL(filePath);
+
+        CMmsConformance* mmsConformance = CMmsConformance::NewL();
+        mmsConformance->CheckCharacterSet(EFalse);
+        
+        CleanupStack::PushL(mmsConformance);
+        
+        CMsgMediaResolver* mediaResolver = CMsgMediaResolver::NewL();     
+        mediaResolver->SetCharacterSetRecognition(EFalse);
+        
+        CleanupStack::PushL(mediaResolver);
+        
+        RFile fileHandle = mediaResolver->FileHandleL(*filePath);
+        CleanupClosePushL(fileHandle);
+
+        CMsgMediaInfo* info = mediaResolver->CreateMediaInfoL(fileHandle);
+        mediaResolver->ParseInfoDetailsL(info,fileHandle);
+        
+        TMmsConformance conformance = mmsConformance->MediaConformance(*info);
+        TUint32 confStatus = conformance.iConfStatus;
+
+        CleanupStack::PopAndDestroy(4);
+
+        
+        // In "free" mode user can insert images that are larger by dimensions than allowed by conformance
+        if (iCreationMode != EMmsCreationModeRestricted)
+        {
+            TInt i = EMmsConfNokFreeModeOnly | EMmsConfNokScalingNeeded
+                    | EMmsConfNokTooBig;
+            TInt j = ~ (EMmsConfNokFreeModeOnly | EMmsConfNokScalingNeeded
+                    | EMmsConfNokTooBig);
+
+            // If user answers yes to Guided mode confirmation query he/she moves to free mode
+            if ( (confStatus & i) && ! (confStatus & j))
+            {
+                if (iCreationMode == EMmsCreationModeFree || info->Protection()
+                        & EFileProtSuperDistributable)
+                {
+                    // SuperDistribution not checked here
+                    // Mask "FreeModeOnly" and "ScalingNeeded" away in free mode
+                    confStatus &= ~EMmsConfNokFreeModeOnly;
+                    confStatus &= ~EMmsConfNokScalingNeeded;
+                }
+                else if (showNote && launchEditorQuery())
+                {
+                    // Query accepted.
+                    // Mask "FreeModeOnly" and "ScalingNeeded" away in free mode
+                    confStatus &= ~EMmsConfNokFreeModeOnly;
+                    confStatus &= ~EMmsConfNokScalingNeeded;
+                }
+                else
+                {
+                    //query not accepted. Stop insertion.
+                    return EInsertQueryAbort;
+                }
+            }
+        }
+        else if (confStatus & EMmsConfNokDRM || confStatus
+                & EMmsConfNokNotEnoughInfo || confStatus
+                & EMmsConfNokNotSupported || confStatus
+                & EMmsConfNokFreeModeOnly || confStatus & EMmsConfNokCorrupt)
+        {
+            // Sanity check
+            // "Not conformant" assumed if check fails.
+            if(showNote)
+            {
+                showPopup(INSERT_ERROR);
+            }
+
+            return EInsertNotSupported;
+        }
+        delete info;
+    }
+    QDEBUG_WRITE("MmsConformanceCheck::CheckModeForInsert end");
+    return EInsertSuccess;
+}
+
+// ---------------------------------------------------------
+// MmsConformanceCheck::validateMsgForForward
+// ---------------------------------------------------------
+//
+bool MmsConformanceCheck::validateMsgForForward(int messageId)
+{
+    UniDataModelLoader* pluginLoader = new UniDataModelLoader();
+    UniDataModelPluginInterface* pluginInterface =
+            pluginLoader->getDataModelPlugin(ConvergedMessage::Mms);
+    pluginInterface->setMessageId(messageId);
+
+    //Check if slide count is greater than 1
+    if (pluginInterface->slideCount() > 1)
+    {
+        delete pluginLoader;
+        return false;
+    }
+
+    //Check if message size is inside max mms composition limits 
+    if (pluginInterface->messageSize() > iMaxMmsSize)
+    {
+        return false;
+    }
+
+    //If there is restricted content then return false
+    UniMessageInfoList slideContentList = pluginInterface->slideContent(0);
+    bool retValue = true;
+
+    for (int i = 0; i < slideContentList.size(); ++i)
+    {
+        if (checkModeForInsert(slideContentList.at(i)->path(), false)
+                != EInsertSuccess)
+        {
+            retValue = false;
+            break;
+        }
+    }
+
+    foreach(UniMessageInfo *slide,slideContentList)
+        {
+            delete slide;
+        }
+
+    if (!retValue)
+    {
+        delete pluginLoader;
+
+        return false;
+    }
+
+    UniMessageInfoList modelAttachmentList = pluginInterface->attachmentList();
+
+    for (int i = 0; i < modelAttachmentList.count(); ++i)
+    {
+        if (checkModeForInsert(modelAttachmentList.at(i)->path(), false)
+                != EInsertSuccess)
+        {
+            retValue = false;
+            break;
+        }
+    }
+
+    foreach(UniMessageInfo *attachment,modelAttachmentList)
+        {
+            delete attachment;
+        }
+
+    delete pluginLoader;
+
+    return retValue;
+}
+
+// ---------------------------------------------------------
+// MmsConformanceCheck::launchEditorQuery
+// ---------------------------------------------------------
+//
+bool MmsConformanceCheck::launchEditorQuery()
+{
+    return HbMessageBox::question(INSERT_QUERY_CONFRM);
+}
+
+// -----------------------------------------------------------------------------
+// MmsConformanceCheck::showPopup
+// -----------------------------------------------------------------------------
+//
+void MmsConformanceCheck::showPopup(const QString& text)
+{
+    HbNotificationDialog* dlg = new HbNotificationDialog();
+    dlg->setFocusPolicy(Qt::NoFocus);
+    dlg->setAttribute(Qt::WA_DeleteOnClose, true);
+    dlg->setText(text);
+    dlg->show();
+}
+
--- a/messagingapp/msgui/msguiutils/src/msgaudiofetcherutil.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +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:
- *
- */
-
- // USER INCLUDES
-#include "msgaudiofetcherutil.h"
-#include "debugtraces.h"
-
-// INCLUDES
-#include <QStringList>
-#include <xqappmgr.h>
-#include <xqaiwrequest.h>
-
-// Constants
-
-//---------------------------------------------------------------
-// MsgAudioFetcherUtil::MsgAudioFetcherUtil
-// @see header file
-//---------------------------------------------------------------
-MsgAudioFetcherUtil::MsgAudioFetcherUtil(QObject* parent):
-QObject(parent),
-mRequest(NULL)
-{
-    mAppMgr = new XQApplicationManager;
-}
-
-//---------------------------------------------------------------
-// MsgAudioFetcherUtil::~MsgAudioFetcherUtil
-// @see header file
-//---------------------------------------------------------------
-MsgAudioFetcherUtil::~MsgAudioFetcherUtil()
-{
-    delete mAppMgr;
-}
-
-//---------------------------------------------------------------
-// MsgAudioFetcherUtil::fetchAudio
-// @see header file
-//---------------------------------------------------------------
-void MsgAudioFetcherUtil::fetchAudio()
-{
-	QString service("Music Fetcher");
-    QString interface("com.nokia.services.media.Music");
-    QString operation("fetch(QString)");
-
-    mRequest = mAppMgr->create(service, interface, operation, false);
-    if(!mRequest)
-    {
-        QDEBUG_WRITE("AIW-ERROR: NULL request");
-        return;
-    }
-
-    connect(mRequest, SIGNAL(requestOk(const QVariant&)),
-            parent(), SIGNAL(audiosFetched(const QVariant&)));
-    connect(mRequest, SIGNAL(requestError(int,const QString&)),
-            this, SLOT(onRequestError(int,const QString&)));
-    connect(this, SIGNAL(serviceError(const QString&)),
-            parent(), SIGNAL(serviceError(const QString&)));
-
-    // Make the request
-    if (!mRequest->send())
-    {
-        QDEBUG_WRITE_FORMAT("AIW-ERROR: Send failed  ",mRequest->lastError());
-    }
-}
-
-//---------------------------------------------------------------
-// MsgAudioFetcherUtil::onRequestError
-// @see header file
-//---------------------------------------------------------------
-void MsgAudioFetcherUtil::onRequestError(int errorCode,
-                                     const QString& errorMessage)
-{
-    Q_UNUSED(errorCode);
-    // emit utils mgr signal
-    emit serviceError(errorMessage);
-}
-
-//EOF
--- a/messagingapp/msgui/msguiutils/src/msgcontactsutil.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +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 "msgcontactsutil.h"
-#include "convergedmessageaddress.h"
-
-//System Includes
-#include <xqservicerequest.h>
-#include <cntservicescontact.h>
-#include <qtcontactsglobal.h>
-#include <qtcontacts.h> 
-
-QTM_USE_NAMESPACE
-
-//---------------------------------------------------------------
-// MsgContactsUtil::MsgContactsUtil
-// @see header file
-//---------------------------------------------------------------
-MsgContactsUtil::MsgContactsUtil(QObject* parent):
-QObject(parent),
-mRequest(NULL)
-{    
-}
-
-//---------------------------------------------------------------
-// MsgContactsUtil::~MsgContactsUtil
-// @see header file
-//---------------------------------------------------------------
-MsgContactsUtil::~MsgContactsUtil()
-{
-    if(mRequest)
-    {
-        delete mRequest;
-        mRequest = NULL;
-    }
-}
-
-//---------------------------------------------------------------
-// MsgContactsUtil::~onRequestCompleted
-// @see header file
-//---------------------------------------------------------------
-void MsgContactsUtil::fetchContacts()
-    {
-    if (mRequest)
-        {
-        delete mRequest;
-        }
-    QString interface("com.nokia.services.phonebookservices.Fetch");
-    QString operation("fetch(QString,QString,QString)");
-       
-    mRequest = new XQServiceRequest(interface,operation,false);
-    connect(mRequest, SIGNAL(requestCompleted(const QVariant&)),
-            parent(), SIGNAL(contactsFetched(const QVariant&)));
-
-
-    *mRequest << QString(tr("Phonebook")); // TODO: Localization
-    *mRequest << KCntActionAll;
-    *mRequest << KCntFilterDisplayAll;
-
-    QVariant retValue;
-    bool res=mRequest->send(retValue);
-    }
-
-void MsgContactsUtil::openContactDetails(qint32 contactId)
-    {
-    XQServiceRequest* mCntOpen;
-    
-    mCntOpen= new XQServiceRequest("com.nokia.services.phonebookservices.Fetch", "open(int)", false);
-    
-    // Fetch back the persisted contact
-    QContactManager cm("symbian");
-    QContact contact = cm.contact(contactId);
-    
-    QContactLocalId lId;
-    lId = contact.localId();
-    
-    *mCntOpen<<lId;
-    bool res=mCntOpen->send();
-    delete mCntOpen;
-    }
-// EOF
--- a/messagingapp/msgui/msguiutils/src/msgimagefetcherutil.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +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:
- *
- */
- 
- // USER INCLUDES
-#include "msgimagefetcherutil.h"
-
-// INCLUDES
-#include <QDebug>
-#include <QStringList>
-#include <xqappmgr.h>
-#include <xqaiwrequest.h>
-
-// Constants
-
-//---------------------------------------------------------------
-// MsgImageFetcherUtil::MsgImageFetcherUtil
-// @see header file
-//---------------------------------------------------------------
-MsgImageFetcherUtil::MsgImageFetcherUtil(QObject* parent):
-QObject(parent),
-mRequest(NULL)
-{
-    mAppMgr = new XQApplicationManager;
-}
-
-//---------------------------------------------------------------
-// MsgImageFetcherUtil::~MsgImageFetcherUtil
-// @see header file
-//---------------------------------------------------------------
-MsgImageFetcherUtil::~MsgImageFetcherUtil()
-{
-    if(mAppMgr)
-    {
-        delete mAppMgr;
-        mAppMgr = NULL;
-    }
-}
-
-//---------------------------------------------------------------
-// MsgImageFetcherUtil::fetchImages
-// @see header file
-//---------------------------------------------------------------
-void MsgImageFetcherUtil::fetchImages()
-{
-
-    QString interface("Image");
-    QString operation("fetch(QVariantMap,QVariant)");
-    
-    mRequest = mAppMgr->create(interface, operation, false);
-    if(!mRequest)
-    {
-        qDebug() << "AIW-ERROR: NULL request";
-        return;
-    }
-
-    connect(mRequest, SIGNAL(requestOk(const QVariant&)),
-            parent(), SIGNAL(imagesFetched(const QVariant&)));
-    connect(mRequest, SIGNAL(requestError(int,const QString&)),
-            this, SLOT(onRequestError(int,const QString&)));
-    connect(this, SIGNAL(serviceError(const QString&)),
-            parent(), SIGNAL(serviceError(const QString&)));
-    
-    // Make the request
-    if (!mRequest->send())
-    {
-        qDebug() << "AIW-ERROR: Send failed" << mRequest->lastError();
-    }    
-}
-
-//---------------------------------------------------------------
-// MsgImageFetcherUtil::onRequestError
-// @see header file
-//---------------------------------------------------------------
-void MsgImageFetcherUtil::onRequestError(int errorCode,
-                                     const QString& errorMessage)
-{
-    //TODO: handle error here
-    Q_UNUSED(errorCode);
-    Q_UNUSED(errorMessage);  
-    // emit utils mgr signal
-    emit serviceError(errorMessage);
-}
-
-//EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/msguiutils/src/msgmediautil.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,100 @@
+/*
+ * 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 provides duration of media file by parsing it
+ *
+ */
+#include <MsgMediaResolver.h>
+#include <XQConversions.h>
+
+#include "msgmediautil.h"
+
+//---------------------------------------------------------------
+// MsgMediaUtil::MsgMediaUtil
+// Constructor
+//---------------------------------------------------------------
+MsgMediaUtil::MsgMediaUtil()
+    {
+    
+    }
+
+//---------------------------------------------------------------
+// MsgMediaUtil::MsgMediaUtil
+// Desctructor
+//---------------------------------------------------------------
+MsgMediaUtil::~MsgMediaUtil()
+    {
+    
+    }
+
+//---------------------------------------------------------------
+// MsgMediaUtil::mediaDuration
+// @see header file
+//---------------------------------------------------------------
+QString MsgMediaUtil::mediaDuration(const QString& mediaFile)
+    {
+    QString formattedDuration(" ");
+    
+    HBufC *name = XQConversions::qStringToS60Desc(mediaFile);
+    TInt duration = 0;
+    TRAPD(error, duration = mediaDurationL(*name));
+    delete name;
+    
+    if ( error )
+        return formattedDuration;
+        
+    int sec_duration = duration / 1000;
+    int hour_component = sec_duration / (60*60);
+    int min_component = (sec_duration - (hour_component*60*60))/60;
+    int sec_component = (sec_duration - (hour_component*60*60) - (min_component*60));
+    
+    if( hour_component > 0)
+        {
+        formattedDuration = QString("%1:%2:%3").arg(hour_component, 2, 10, QChar('0')).
+            arg(min_component, 2, 10, QChar('0')).arg(sec_component, 2, 10, QChar('0'));
+        }
+    else
+        {
+        formattedDuration = QString("%1:%2").arg(min_component, 2, 10, QChar('0')).
+            arg(sec_component, 2, 10, QChar('0'));
+        }
+
+    return formattedDuration;
+    }
+
+//---------------------------------------------------------------
+// MsgMediaUtil::mediaDurationL
+// @see header file
+//---------------------------------------------------------------
+TInt MsgMediaUtil::mediaDurationL(const TDesC& mediaFile)
+    {
+    CMsgMediaResolver* resolver = CMsgMediaResolver::NewLC();
+    resolver->SetCharacterSetRecognition(EFalse);
+    
+    RFile rFile = resolver->FileHandleL(mediaFile);
+    CleanupClosePushL( rFile );
+
+    CMsgMediaInfo* info = resolver->CreateMediaInfoL( rFile );
+    resolver->ParseInfoDetailsL(info, rFile);
+    CleanupStack::PushL( info );
+
+    TInt duration = info->Duration();
+    
+    CleanupStack::PopAndDestroy(3, resolver); // info, rFile, resolver
+    
+    return duration;
+    }
+
+
+// EOF
+
--- a/messagingapp/msgui/msguiutils/src/msgsendutil.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/msguiutils/src/msgsendutil.cpp	Mon May 03 12:29:07 2010 +0300
@@ -24,7 +24,6 @@
 #include "UniEditorGenUtils.h"
 
 
-#define MSG_SETTINGS_PLUGIN "resource\\qt\\plugins\\controlpanel\\msgsettingsplugin.qtplugin"
 //---------------------------------------------------------------
 // MsgSendUtil::MsgSendUtil
 // Constructor
@@ -34,8 +33,6 @@
     {
     // Load Plugins for send
     mPluginLoader = new UniEditorPluginLoader(this);
-    mPluginLoader->loadPlugins();
-
     mUniEditorGenUtils = new UniEditorGenUtils();
     }
 
--- a/messagingapp/msgui/msguiutils/src/msguiutilsmanager.cpp	Fri Apr 16 14:56:15 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: Services like send, image picker 
- * and contacts fetching functionality handler.
- *
- */
-
-#include "msguiutilsmanager.h"
-#include "msgsendutil.h"
-#include "msgimagefetcherutil.h"
-#include "msgaudiofetcherutil.h"
-#include "msgcontactsutil.h"
-
-// System includes
-#include "debugtraces.h"
-
-
-//---------------------------------------------------------------
-// MsgUiUtilsManagerManager::MsgUiUtilsManager
-// Constructor
-//--------------------------------------------------------------
-MsgUiUtilsManager::MsgUiUtilsManager(QObject* parent):
-QObject(parent),
-mSendUtil(NULL),
-mImageUtil(NULL),
-mAudioUtil(NULL),
-mContactsUtil(NULL),
-mInputBlocker(NULL)
-    {
-    }
-
-//---------------------------------------------------------------
-// MsgUiUtilsManager::~MsgUiUtilsManager
-// Desctructor
-//--------------------------------------------------------------
-MsgUiUtilsManager::~MsgUiUtilsManager()
-    {
-    deactivateInputBlocker();
-    }
-
-//---------------------------------------------------------------
-// MsgUiUtilsManager::send
-// @see header file
-//--------------------------------------------------------------
-int MsgUiUtilsManager::send(ConvergedMessage& msg)
-    {
-    if(!mSendUtil)
-        {
-        mSendUtil = new MsgSendUtil(this);
-        }
-    return mSendUtil->send(msg);
-    }
-
-//---------------------------------------------------------------
-// MsgUiUtilsManager::saveToDrafts
-// @see header file
-//--------------------------------------------------------------
-TMsvId MsgUiUtilsManager::saveToDrafts(ConvergedMessage& msg)
-    {
-    if(!mSendUtil)
-        {
-        mSendUtil = new MsgSendUtil(this);
-        }
-    return mSendUtil->saveToDrafts(msg);
-    }
-
-//---------------------------------------------------------------
-// MsgUiUtilsManager::send
-// @see header file
-//--------------------------------------------------------------
-void MsgUiUtilsManager::fetchImages()
-    {
-    if(!mImageUtil)
-        {
-        mImageUtil = new MsgImageFetcherUtil(this);
-        }
-    mImageUtil->fetchImages();
-    }
-
-
-//---------------------------------------------------------------
-// MsgUiUtilsManager::fetchContacts
-// @see header file
-//--------------------------------------------------------------
-void MsgUiUtilsManager::fetchContacts()
-    {
-    if(!mContactsUtil)
-        {
-        mContactsUtil = new MsgContactsUtil(this);
-        }
-    mContactsUtil->fetchContacts();
-    }
-
-//---------------------------------------------------------------
-// MsgUiUtilsManager::fetchVideo
-// @see header file
-//--------------------------------------------------------------
-void MsgUiUtilsManager::fetchVideo()
-    {
-    
-    }
-
-//---------------------------------------------------------------
-// MsgUiUtilsManager::fetchAudio
-// @see header file
-//--------------------------------------------------------------
-void MsgUiUtilsManager::fetchAudio()
-    {
-    if(!mAudioUtil)
-        {
-        mAudioUtil = new MsgAudioFetcherUtil(this);
-    }
-    mAudioUtil->fetchAudio();
-    }
-
-//---------------------------------------------------------------
-// MsgUiUtilsManager::fetchOther
-// @see header file
-//--------------------------------------------------------------
-void MsgUiUtilsManager::fetchOther()
-    {
-    
-    }
-
-//---------------------------------------------------------------
-// MsgUiUtilsManager::openContactDetail
-// @see header file
-//--------------------------------------------------------------
-void MsgUiUtilsManager::openContactDetails(qint32 contactId)
-    {
-    if(!mContactsUtil)
-        {
-        mContactsUtil = new MsgContactsUtil(this);
-        }
-    mContactsUtil->openContactDetails(contactId);
-    }
-
-//---------------------------------------------------------------
-// MsgUiUtilsManager::activateInputBlocker
-// @see header file
-//--------------------------------------------------------------
-void MsgUiUtilsManager::activateInputBlocker(QGraphicsWidget* parent)
-    {
-    if(!mInputBlocker)
-        {
-        mInputBlocker = parent;
-        mInputBlocker->grabMouse();
-        mInputBlocker->grabKeyboard();
-        }
-    }
-
-//---------------------------------------------------------------
-// MsgUiUtilsManager::deactivateInputBlocker
-// @see header file
-//--------------------------------------------------------------
-void MsgUiUtilsManager::deactivateInputBlocker()
-    {
-    if(mInputBlocker)
-        {
-        mInputBlocker->ungrabKeyboard();
-		mInputBlocker->ungrabMouse();
-		mInputBlocker = NULL;
-        }
-    }
-
-// EOF
--- a/messagingapp/msgui/unifiededitor/inc/mmsinsertcheckoperation.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +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: mms creation mode checks
- *
- */
-
-#ifndef MMS_INSERT_CHECK_OPERATION_H
-#define MMS_INSERT_CHECK_OPERATION_H
-
-#include <msgmediainfo.h>
-#include <qstring.h>
-
-class CMmsConformance;
-class CMsgMediaResolver;
-class CDRMHelper;
-
-enum InsertCheckOperationErrors
-{
-    EInsertSuccess = 0, EInsertQueryAbort, EInsertNotSupported
-};
-
-class MmsInsertCheckOperation: public MMediaInfoObserver
-{
-public:
-
-    /**
-     * Constructor
-     */
-    MmsInsertCheckOperation();
-
-    /**
-     * Destructor
-     */
-    ~MmsInsertCheckOperation();
-
-    /**
-     * media insert checks. 
-     * @param file, filepath
-     */
-    int checkModeForInsert(const QString& file);
-
-    /**
-     * From MMediaInfoObserver
-     */
-    void MediaInfoParsed();
-
-private:
-
-    /*
-     * Launch query dialog
-     */
-    bool launchEditorQuery();
-
-private:
-
-    /*
-     * Mms conformance.
-     * Own
-     */
-    CMmsConformance* iMmsConformance;
-    
-    /*
-     * Media resolver.
-     * Own
-     */
-    CMsgMediaResolver* iMediaResolver;
-    
-    /*
-     * DRM helper.
-     * Own
-     */
-    CDRMHelper* iDRMHelper;
-
-    /*
-     * Mms creation mode
-     */
-    TInt iCreationMode;
-
-};
-#endif //MMS_INSERT_CHECK_OPERATION_H
--- a/messagingapp/msgui/unifiededitor/inc/msgattachmentcontainer.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/inc/msgattachmentcontainer.h	Mon May 03 12:29:07 2010 +0300
@@ -21,13 +21,20 @@
 #include "msgunieditorattachment.h"
 
 class QGraphicsLinearLayout;
-class MmsInsertCheckOperation;
+class MmsConformanceCheck;
 
 class MsgAttachmentContainer : public HbWidget
     {
     Q_OBJECT
 
 public:
+    /**
+     * Add Attachment success/failure states
+     */
+    enum AddAttachmentStatus
+    {
+        EAddSuccess = 0, EAddNotSupported, EAddSizeExceed
+    };
 
     /**
      * Constructor
@@ -42,8 +49,10 @@
     /**
      * add attachment to the container
 	 * @param filepath of the attachment
+	 * @return add operation status
      */
-    void addAttachment(const QString& filepath);
+    MsgAttachmentContainer::AddAttachmentStatus addAttachment(
+            const QString& filepath);
 
     /**
      * count of attachments in the container
@@ -56,12 +65,25 @@
      * @return attachments list
      */
     MsgUnifiedEditorAttachmentList attachmentList();
+    
+    /**
+     * Check if the container hold multimedia content
+     * @return true, if multimedia content is present
+     *         false, otherwise.
+     */
+    bool hasMMContent();
+    
+    /**
+     * Size of the attachment container
+     * @return size
+     */
+    int containerSize();
 
 signals:
     /**
-     * emit when container holds MM content
+     * emit when container content changes
      */
-    void mmContentAdded(bool isAdded);
+    void contentChanged();
 
     /**
      * emit to indicate view that container is now empty
@@ -69,11 +91,6 @@
      */
     void emptyAttachmentContainer();
     
-    /**
-     * Emitted when msg's attachment container size changes
-     */
-    void sizeChanged(int aSize);
-
 private slots:
     /**
      * delete attachment from the container
@@ -82,12 +99,6 @@
     
 private:
     /**
-     * Size of the attachment container
-     * @return size
-     */
-    int containerSize();
-
-    /**
      * size of the msg
      */
     int messageSize();
@@ -104,9 +115,9 @@
     QGraphicsLinearLayout* mLayout;
     
     /**
-     * MMs insert check utility class
+     * MMS conformance check utility class
      */
-    MmsInsertCheckOperation* mMmsInsertCheckOp;
+    MmsConformanceCheck* mMmsConformanceCheck;
 
     /**
      * attachment list
--- a/messagingapp/msgui/unifiededitor/inc/msgmonitor.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/inc/msgmonitor.h	Mon May 03 12:29:07 2010 +0300
@@ -19,7 +19,16 @@
 #define MSG_MONITOR_H
 
 #include <QObject>
+#include "convergedmessage.h"
+class MsgUnifiedEditorView;
+class HbWidget;
+class UniEditorGenUtils;
 
+/**
+ * Helper class to monitor message's contruction in unified editor.
+ * This class is for only reading editor's content to run its logic.
+ * This class is NOT a place for content editing inside editor.
+ */
 class MsgMonitor : public QObject
     {
     Q_OBJECT
@@ -36,47 +45,95 @@
     ~MsgMonitor();
 
     /**
-     * setter method to initialize content
+     * Set to skip showing note for first time
+     * @param skip true/false
      */
-    void init();
+    inline void setSkipNote(bool skip = true);
+    
+    /**
+     * Seeker method to access current message type
+     */
+    static inline ConvergedMessage::MessageType messageType();
 
     /**
      * seeker function to get current msg size in bytes
      */
-    static int messageSize();
+    static inline int messageSize();
 
     /**
      * seeker function to get current msg's body size 
      * in bytes
      */
-    static int bodySize();
+    static inline int bodySize();
 
     /**
      * seeker function to get current msg's attachment
      * container size in bytes
      */
-    static int containerSize();
+    static inline int containerSize();
 
     /**
      * seeker function to get current msg's subject
      * size in bytes
      */
-    static int subjectSize();
+    static inline int subjectSize();
 
     /**
      * seeker function to get max possible mms size
      * in bytes
      */
-    static int maxMmsSize();
+    static inline int maxMmsSize();
+    
+    /**
+     * seeker funtion to get max recipient count for sms
+     */
+    static inline int maxSmsRecipients();
+
+    /**
+     * seeker funtion to get max recipient count for mms
+     */
+    static inline int maxMmsRecipients();
 
 public slots:
     /**
-     * handle size change signal emitted by msg components
+     * slot to find any msg type change during editor operations
+     */
+    void checkMsgTypeChange();
+
+private:
+    /**
+     * setter method to initialize content
      */
-    void onSizeChanged(int aSize);
+    void init();
+
+    /**
+     * handle size change of editor components
+     */
+    void updateSizeInfo(HbWidget* aWidget);
+    
+    /**
+     * show type change discreet note
+     */
+    void showPopup(const QString& text);
+    
+    /**
+     * accessor for view
+     */
+    MsgUnifiedEditorView* view();
         
 private:
     /**
+     * Flag to skip showing the type change popup.
+     * Note need to be skipped when an mms is opened from draft.
+     */
+    bool mSkipNote;
+
+    /**
+     * Type of msg under composition in the editor 
+     */
+    static ConvergedMessage::MessageType mMessageType;
+    
+    /**
      * msg body size in bytes
      */
     static int mBodySize;
@@ -95,6 +152,24 @@
      * max mms size in bytes
      */
     static int mMaxMmsSize;
+    
+    /**
+     * max recipient count in an sms
+     */
+    static int mMaxSmsRecipients;
+
+    /**
+     * max recipient count in an sms
+     */
+    static int mMaxMmsRecipients;
+
+    /**
+     * UniEditorGenUtils object
+     * Owned
+     */
+    UniEditorGenUtils* mUniEditorGenUtils;
     };
 
+#include "msgmonitor.inl"
+
 #endif //MSG_MONITOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/unifiededitor/inc/msgmonitor.inl	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: msgmonitor.inl
+*/
+
+
+
+// ========== INLINE METHODS ===============================
+
+//---------------------------------------------------------------
+// MsgMonitor::setSkipNote
+// @see header file
+//---------------------------------------------------------------
+inline void MsgMonitor::setSkipNote(bool skip)
+{
+    mSkipNote = skip;
+}
+
+//---------------------------------------------------------------
+// MsgMonitor::messageType
+// @see header file
+//---------------------------------------------------------------
+inline ConvergedMessage::MessageType MsgMonitor::messageType()
+{
+    return mMessageType;
+}
+
+//---------------------------------------------------------------
+// MsgMonitor::messageSize
+// @see header file
+//---------------------------------------------------------------
+inline int MsgMonitor::messageSize()
+{
+    return mBodySize + mContainerSize + mSubjectSize;
+}
+
+//---------------------------------------------------------------
+// MsgMonitor::bodySize
+// @see header file
+//---------------------------------------------------------------
+inline int MsgMonitor::bodySize()
+{
+    return mBodySize;
+}
+
+//---------------------------------------------------------------
+// MsgMonitor::containerSize
+// @see header file
+//---------------------------------------------------------------
+inline int MsgMonitor::containerSize()
+{
+    return mContainerSize;
+}
+
+//---------------------------------------------------------------
+// MsgMonitor::subjectSize
+// @see header file
+//---------------------------------------------------------------
+inline int MsgMonitor::subjectSize()
+{
+    return mSubjectSize;
+}
+
+//---------------------------------------------------------------
+// MsgMonitor::maxMmsSize
+// @see header file
+//---------------------------------------------------------------
+inline int MsgMonitor::maxMmsSize()
+{
+    return mMaxMmsSize;
+}
+
+//---------------------------------------------------------------
+// MsgMonitor::maxSmsRecipients
+// @see header file
+//---------------------------------------------------------------
+inline int MsgMonitor::maxSmsRecipients()
+{
+    return mMaxSmsRecipients;
+}
+
+//---------------------------------------------------------------
+// MsgMonitor::maxMmsRecipients
+// @see header file
+//---------------------------------------------------------------
+inline int MsgMonitor::maxMmsRecipients()
+{
+    return mMaxMmsRecipients;
+}
+
+//  End of File
--- a/messagingapp/msgui/unifiededitor/inc/msgtypenotifier.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +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: Helper class to keep record of msg type changes
- *
- */
-
-#ifndef MSG_TYPE_NOTIFIER_H
-#define MSG_TYPE_NOTIFIER_H
-
-#include <QObject>
-#include "convergedmessage.h"
-
-class MsgTypeNotifier : public QObject
-    {
-    Q_OBJECT
-
-public:
-
-    /**
-     * Constructor
-     */
-    MsgTypeNotifier(QObject* parent=0);
-
-    /**
-     * Destructor
-     */
-    ~MsgTypeNotifier();
-
-    /**
-     * Seeker method to access current message type
-     */
-    ConvergedMessage::MessageType messageType() const;
-
-    /**
-     * Set to skip showing note for first time
-     */
-    void setSkipNote();
-
-public slots:
-    /**
-     * Public slot to keep MMS content count for the under construction
-     * message. To be called from content widgets.
-     * @param isAdded true/false
-     */
-    void onMMContentAdded(bool isAdded);
-    
-private:
-    void showPopup(const QString& text);
-
-private:
-    int mmContentCount;
-    bool mSkipNote;
-    };
-
-#endif //MSG_TYPE_NOTIFIER_H
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditoraddress.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditoraddress.h	Mon May 03 12:29:07 2010 +0300
@@ -27,7 +27,6 @@
 class HbPushButton;
 class HbLineEdit;
 class MsgUnifiedEditorLineEdit;
-class MsgUiUtilsManager;
 
 class MsgUnifiedEditorAddress : public HbWidget
     {
@@ -62,6 +61,11 @@
      * setter method to set address
      */
     void setAddresses(ConvergedMessageAddressList addrlist);
+    
+    /**
+     * Get amount of digits to be used in contact matching
+     */
+    static int contactMatchDigits();
         
 signals:
     /**
@@ -70,27 +74,36 @@
     void sendMessage();
 
     /**
-     * Emitted when MMS content is added or removed
+     * Emitted when content is added or removed
      */
-    void mmContentAdded(bool isAdded);
+    void contentChanged();
 
 private slots:
    
     /**
      * called after selection from pbk.
      */
-    void contactsFetched(const QVariant& contacts);
+    void fetchContacts();
+    /**
+     * Slot for handling valid returns from the phonebook contacts fetched.
+     */
+    void handleOk(const QVariant& result);
+    
+    /**
+     * Slot for handling errors. Error ids are provided as 
+     */
+    void handleError(int errorCode, const QString& errorMessage);
 
     /**
-     * Called when textChanged signal is emitted by the line edit
+     * Called when contentsChanged signal is emitted by the line edit
      */
-    void onTextChanged(const QString&);
+    void onContentsAdded(const QString&);
 
     /**
-     * Called when textChanged signal is emitted by the line edit
+     * Called when contentsChanged signal is emitted by the line edit
      * Checks for empty text content
      */
-    void onTextRemoved(const QString& text);
+    void onContentsRemoved(const QString& text);
 
 private:
     /**
@@ -128,12 +141,7 @@
      * address map.
      */
     QMap<QString, QString> mAddressMap;
-
-    /**
-     * MsgUiUtils Manager for phonebook operations
-     * Not Owned
-     */
-    MsgUiUtilsManager *mUtilsManager;
+   
     };
 
 #endif //UNIFIED_EDITOR_ADDRESS_H
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditorattachment.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorattachment.h	Mon May 03 12:29:07 2010 +0300
@@ -18,12 +18,12 @@
 #ifndef UNIFIED_EDITOR_ATTACHMENT_H
 #define UNIFIED_EDITOR_ATTACHMENT_H
 
-#include <hbwidget.h>
+#include <HbWidget>
 #include <QList>
 
 class HbTextItem;
 class HbIconItem;
-class HbPushButton;
+class HbGestureSceneFilter;
 
 class MsgUnifiedEditorAttachment : public HbWidget
     {
@@ -67,6 +67,23 @@
      * @return true/false
      */
     bool isMultimediaContent();
+    
+    HbFeedback::InstantEffect overrideFeedback(Hb::InstantInteraction interaction) const;
+
+protected:
+    /**
+     * reimplemented from base class.
+     */
+    virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
+    virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+    
+    
+private:
+    /**
+     * Helper method to initialize gesture.
+     */
+    void initGesture();
+
 
 signals:
     /**
@@ -137,9 +154,14 @@
     HbTextItem* mAttachmentDetails;
 
     /**
-	 * layout item for background
-	 */
-    HbPushButton *mFrameItem;
+	 * gesture filter for long press.
+	 */    
+    HbGestureSceneFilter* mGestureFilter;
+	
+	/**
+     * Max limit on sms size. Store at class level for optimization
+     */
+    int mMaxSmsSize;
 
     };
 
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditorbody.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorbody.h	Mon May 03 12:29:07 2010 +0300
@@ -23,13 +23,16 @@
 #include "msgunieditorprocessimageoperation.h"
 
 class HbTextEdit;
+class HbTextItem;
 class HbFrameItem;
 class HbIconItem;
 class HbPushButton;
 class HbGestureSceneFilter;
 class CMsgMediaResolver;
 class CMsgImageInfo;
-class MmsInsertCheckOperation;
+class MmsConformanceCheck;
+class UniEditorPluginInterface;
+class UniEditorPluginLoader;
 
 
 class MsgUnifiedEditorBody : public HbWidget,public MUniEditorProcessImageOperationObserver
@@ -59,7 +62,24 @@
      * Seeker method to return back data to editor's view
      */
     const QStringList mediaContent();
+    
+    /**
+     * get size of body content for MMS size calculations
+     * @return size of body content
+     */
+    int bodySize();
+    
+    /*
+     * Returns value of mUnicode 
+     * @return mUnicode   
+     */
+     bool isUnicode();
 
+     /*
+      * Disables char counter
+      */
+     void disableCharCounter();
+     
 public slots:
     /**
      * Called to insert image content in editor.
@@ -92,14 +112,9 @@
     void sendMessage();
 
     /**
-     * Emitted when MMS content is added or removed
+     * Emitted when msg-body content changes
      */
-    void mmContentAdded(bool isAdded);
-
-    /**
-     * Emitted when msg body size changes
-     */
-    void sizeChanged(int aSize);
+    void contentChanged();
 
 public: // from MUniEditorProcessImageOperationObserver
     
@@ -143,6 +158,16 @@
      */
     void onTextChanged();
 
+    /**
+     * Service launch complete.
+     */
+    void handleOk(const QVariant& result);
+
+    /**
+     * Service launch errors.
+     */
+    void handleError(int errorCode, const QString& errorMessage);
+
 private:
     /**
      * Get to find body already contains an image
@@ -174,12 +199,6 @@
     QString getHitRegion(QPointF position);
 
     /**
-     * get size of body content for MMS size calculations
-     * @return size of body content
-     */
-    int bodySize();
-
-    /**
      * size of the msg
      */
     int messageSize();    
@@ -263,9 +282,9 @@
     HbGestureSceneFilter* mGestureFilter;
 	
     /**
-     * MMs insert check utility class
+     * MMs conformance check utility class
      */
-    MmsInsertCheckOperation* mMmsInsertCheckOp;
+    MmsConformanceCheck* mMmsConformanceCheck;
 	
     /**
      * Size of image in body 
@@ -301,6 +320,49 @@
      * CMsgImageInfo object
      */
     CMsgImageInfo *mImageInfo;    
+    
+    /**
+     * Instance of HbTextItem
+     * Will be deleted automatically by parent.
+     * Own.
+     */
+    HbTextItem *mCharCounter;
+
+    /**
+     * Instance of HbFrameItem
+     * Will be deleted automatically by parent.
+     * Own.
+     */
+    HbFrameItem* mBackgroundItem;
+    
+    /**
+     * Holds the previous buffer inside msgeditor
+     */
+    QString mPrevBuffer;
+
+    /**
+     * Holds char type supported
+     */
+    int mCharSupportType;
+
+    /**
+     * Instance of UniEditorPluginInterface
+     * Will be deleted automatically by parent.
+     * Own.
+     */
+    UniEditorPluginInterface* mPluginInterface;
+
+    /**
+     * Instance of UniEditorPluginLoader
+     * Will be deleted when UniEditorPluginInterface object is deleted
+     * Not Own.
+     */
+    UniEditorPluginLoader* mPluginLoader;
+
+    /*
+     * Maintains information if any unicode character has been entered or not
+     */
+    bool mUnicode;
 };
 
 #endif //UNIFIED_EDITOR_BODY_H
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditorsubject.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorsubject.h	Mon May 03 12:29:07 2010 +0300
@@ -21,10 +21,9 @@
 
 #include "convergedmessage.h"
 
-class HbTextItem;
-class HbLineEdit;
 class HbIconItem;
 class UniEditorGenUtils;
+class MsgUnifiedEditorLineEdit;
 
 class MsgUnifiedEditorSubject : public HbWidget
     {
@@ -71,26 +70,21 @@
 
 signals:
     /**
-     * Emitted when MMS content is added or removed
+     * Emitted when subject/priority content is added or removed
      */
-    void mmContentAdded(bool isAdded);
-    
-    /**
-     * Emitted when subject size changes
-     */
-    void sizeChanged(int aSize);
+    void contentChanged();
     
 private slots:
     /**
-     * called when textChanged signal is emitted by the line edit
+     * called when contentsChanged signal is emitted by the line edit
      */
-    void onTextChanged(const QString&);
+    void onContentsAdded(const QString&);
     
     /**
-     * Called when textChanged signal is emitted by the line edit
+     * Called when contentsChanged signal is emitted by the line edit
      * Checks for empty text content 
      */
-    void onTextRemoved(const QString& text);
+    void onContentsRemoved(const QString& text);
     
 private:
     /**
@@ -107,14 +101,9 @@
     QString mPluginPath;
     
     /**
-     * label to show sub: string.
-     */
-    HbTextItem *mSubjectLabel;
-    
-    /**
      * line edit to input subject.
      */
-    HbLineEdit* mSubjectEdit;
+    MsgUnifiedEditorLineEdit* mSubjectEdit;
     
     /**
      * icon item to display priority.
--- a/messagingapp/msgui/unifiededitor/inc/msgunieditorview.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/inc/msgunieditorview.h	Mon May 03 12:29:07 2010 +0300
@@ -24,10 +24,15 @@
 #define UNIFIEDEDITOR_EXPORT Q_DECL_IMPORT
 #endif
 
+#include <qmobilityglobal.h>
 #include "msgbaseview.h"
 #include "convergedmessage.h"
 #include "convergedmessageid.h"
 
+QTM_BEGIN_NAMESPACE
+QTM_END_NAMESPACE
+QTM_USE_NAMESPACE
+
 class HbWidget;
 class HbAction;
 class HbGroupBox;
@@ -35,11 +40,10 @@
 class MsgUnifiedEditorSubject;
 class MsgUnifiedEditorAddress;
 class MsgUnifiedEditorBody;
-class MsgTypeNotifier;
 class MsgMonitor;
-class MsgUiUtilsManager;
 class MsgAttachmentContainer;
 class UniEditorPluginLoader;
+class HbListWidgetItem;
 
 class UNIFIEDEDITOR_EXPORT MsgUnifiedEditorView : public MsgBaseView
     {
@@ -59,22 +63,22 @@
 
     /**
      * Populate editor with passed information
+     * @param editorData data for editor's usage
      */
-    void populateContent(const ConvergedMessage& messageDetails, 
-        int editorFields = 0);
+    void populateContent(const QVariantList& editorData);
     
     /**
      * Opens the drafts message into editor
+     * @param editorData data for editor's usage
      */
-    void openDraftsMessage(ConvergedMessageId& messageId,
-        ConvergedMessage::MessageType messageType );
+    void openDraftsMessage(const QVariantList& editorData);
 
 
     /**
      * Saves the content inside editor to save
      */
-    bool saveContentToDrafts();
-
+    void saveContentToDrafts();
+    
 protected:
     /**
      * reimplemented from base class to provide proper geometry for scrolling.
@@ -104,10 +108,46 @@
     void packMessage(ConvergedMessage &msg);
 
     /**
-     * Populate editor with Drafts msg content
+     * Populate editor with prepopulated msg content
+     */
+    void populateContentIntoEditor(
+        const ConvergedMessage& messageDetails);
+    
+    /**
+     * Populate the editor with the forwarded message's content
+     */
+    void forwardMessage(ConvergedMessageId& messageId,
+        ConvergedMessage::MessageType messageType );
+    
+    /**
+     * Create VCards for all the contacts available in the list
+     * @param value list of fetched contacts
+     * @param [OUT]filelist list of newly added vcard files
+     * @return errId KErrNone if no error
      */
-    void populateDraftsContent(
-        const ConvergedMessage& messageDetails);
+    int createVCards(const QVariant& value, QStringList& filelist);
+    
+    /**
+     * Resolve name conflict when adding attachments to editor
+     * @param suggestedName suggested file name to use
+     * @return fully qualified path of the file in unieditor's temp folder
+     */
+    QString generateFileName(QString& suggestedName);
+    
+    /**
+     * Fetch images 
+     */
+    void fetchImages();
+
+    /**
+     * Fectch conatcts
+     */
+    void fetchContacts();
+
+    /**
+     * Fectch audio
+     */
+    void fetchAudio();
 
 private slots:
 
@@ -142,16 +182,6 @@
     void deleteMessage();
 
     /**
-     * slot to launch help.
-     */
-    void launchHelp();
-
-    /**
-     * slot to show attachment popup.
-     */
-    void showAttachmentPopup();
-
-    /**
      * slot to images fetched.
      */
     void imagesFetched(const QVariant& result );
@@ -160,6 +190,11 @@
      * slot to fetch audio files
      */
     void audiosFetched(const QVariant& result );
+    
+    /**
+     * slot to receive fetched contacts
+     */
+    void contactsFetched(const QVariant& value);
 
     /**
      * slot to send message.
@@ -170,11 +205,40 @@
      * slot to tell view to remove the attachment's container
      */
     void removeAttachmentContainer();
+
+    /**
+     * add attachments to the editor
+     * @param files list of file paths
+     */
+    void addAttachments(QStringList files);
+
+    /**
+     * add an attachment to the editor
+     * @return addition operation status
+     */
+    int addAttachment(const QString& filepath);
+
+	/**
+     * called when extention item is clicked.
+     */
+    void handleViewExtnActivated(HbListWidgetItem* item);
     
     /**
-     * add an attachment to editor
+     * Signal emitted when an error is generated.
+     * @param errorCode Error code.
+     * @param errorMessage Error description.
      */
-    void addAttachment(const QString& filepath);
+    void serviceRequestError(int errorCode, const QString& errorMessage);
+   
+    /**
+     * Activate Input Blocker
+     */
+    void activateInputBlocker();
+
+    /**
+     * Deactivate Input Blocker
+     */
+    void deactivateInputBlocker();
 
 private:
     HbAction* mSubjectAction;
@@ -186,17 +250,16 @@
     MsgUnifiedEditorAddress* mBccField;
     MsgUnifiedEditorBody*   mBody;
 
-    HbMenu *mPrioritySubMenu;
     HbWidget* mContentWidget;
     QString mPluginPath;
 
-    MsgTypeNotifier* mNotifier;
     MsgMonitor* mMsgMonitor;
-    MsgUiUtilsManager* mUtilsManager;
     MsgAttachmentContainer* mAttachmentContainer;
     UniEditorPluginLoader* mPluginLoader;
     ConvergedMessageId mOpenedMessageId;
     ConvergedMessage::MessageType mmOpenedMessageType;
+	bool mCanSaveToDrafts;
+	friend class MsgMonitor;
     };
 
 #endif //UNIFIED_EDITOR_VIEW_H
--- a/messagingapp/msgui/unifiededitor/inc/msgunifiededitorlineedit.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/inc/msgunifiededitorlineedit.h	Mon May 03 12:29:07 2010 +0300
@@ -42,8 +42,11 @@
      */
     QStringList addresses();
 
+    void setDefaultBehaviour(bool defaultBehaviour = false);
+    QString content() const;
+	
 signals:
-    void addressTextChanged(const QString& text);
+    void contentsChanged(const QString& text);
 
 public slots:
     void setText(const QString &text);
@@ -52,7 +55,7 @@
 
 private slots:
     void selectionChanged(const QTextCursor &oldCursor, const QTextCursor& newCursor);
-    void onTextChanged(const QString& text);
+    void onContentsChanged();
     
 protected: // from HbLineEdit
     void inputMethodEvent(QInputMethodEvent *event);
@@ -64,7 +67,7 @@
 
 private:
     void setHighlight(int currentPos);
-    void textChanged(const QString& text);
+    QString text() const;
 
 private:
     QRegExp mLabelExpr;
@@ -73,6 +76,7 @@
 
     int mSelectionStart;
     int mSelectionEnd;
+    bool mDefaultBehaviour;
 };
 
 #endif // MSGUNIFIEDEDITORLINEEDIT_H
--- a/messagingapp/msgui/unifiededitor/resources/qgn_indi_mce_tb_audio.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg baseProfile="tiny" height="44" version="1.1" viewBox="0.28 -0.148 44 44" width="44" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g>
-<path d="M34.431,27.391c0-0.096,0.012-0.195,0-0.293V8.584l-18.164,2.791v15.619   c-1.398-0.263-3.182,0.121-4.689,1.104c-2.41,1.578-3.184,4.109-2.08,5.793s4.203,1.59,6.613,0.01   c1.58-1.035,2.455-2.447,2.57-3.777h0.012c0,0,0-0.11,0-0.309c0-0.1,0.008-0.199,0-0.297V16.705l13.318-2.047v9.914   c-1.398-0.264-3.188,0.117-4.691,1.104c-2.412,1.579-3.184,4.114-2.082,5.795c1.102,1.685,4.203,1.588,6.613,0.012   c1.584-1.034,2.457-2.45,2.572-3.778h0.008V27.391z" fill="url(#XMLID_2_)"/>
-<rect fill="none" height="44" width="44" x="0.28" y="-0.148"/>
-<defs>
-<linearGradient gradientUnits="userSpaceOnUse" id="XMLID_2_" x1="21.7197" x2="21.7197" y1="11.624" y2="33.291">
-<stop offset="0" style="stop-color:#B2B2B2"/>
-<stop offset="1" style="stop-color:#000000"/>
-</linearGradient>
-</defs>
-</g>
-</svg>
--- a/messagingapp/msgui/unifiededitor/resources/qtg_mono_attach.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="32px" height="32px" viewBox="-9 -3 32 32" enable-background="new -9 -3 32 32" xml:space="preserve">
-<defs>
-</defs>
-<path d="M13,0H6C4.898,0,4,0.9,4,2v14.5C4,18.434,5.566,20,7.5,20c1.932,0,3.5-1.566,3.5-3.5V5H9v11.5C9,17.327,8.326,18,7.5,18
-	C6.672,18,6,17.327,6,16.5V2h7v17.395L9.93,24H5.07L2,19.395V8H0v12l4,6h7l4-6V2C15,0.9,14.1,0,13,0z"/>
-</svg>
--- a/messagingapp/msgui/unifiededitor/resources/qtg_mono_contacts.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="32px" height="32px" viewBox="-3 -3 32 32" enable-background="new -3 -3 32 32" xml:space="preserve">
-<defs>
-</defs>
-<path d="M16.813,13.657c0.711-0.849,1.363-2.117,1.363-3.617c0-1.499-0.703-4.04-3.174-4.04c-2.469,0-3.172,2.704-3.172,4.04
-	c0,1.337,0.457,2.672,1.363,3.617c1.785,1.865-2.877,2.49-3.49,3.647C9.4,17.878,8.491,20,9.379,20c1.203,0,10.039,0,11.246,0
-	c0.875,0-0.02-2.122-0.322-2.695C19.691,16.147,15.209,15.575,16.813,13.657z"/>
-<path d="M25,0H4C3.45,0,3,0.45,3,1v3H2C0.897,4,0,4.897,0,6s0.897,2,2,2h1v3H2c-1.103,0-2,0.897-2,2s0.897,2,2,2h1v3H2
-	c-1.103,0-2,0.897-2,2s0.897,2,2,2h1v3c0,0.55,0.45,1,1,1h21c0.549,0,1-0.45,1-1V1C26,0.45,25.549,0,25,0z M2,7C1.45,7,1,6.55,1,6
-	s0.45-1,1-1h3c0.55,0,1,0.45,1,1S5.55,7,5,7H2z M2,14c-0.55,0-1-0.45-1-1s0.45-1,1-1h3c0.55,0,1,0.45,1,1s-0.45,1-1,1H2z M2,21
-	c-0.55,0-1-0.45-1-1s0.45-1,1-1h3c0.55,0,1,0.45,1,1s-0.45,1-1,1H2z M24,24H5v-2c1.103,0,2-0.897,2-2s-0.897-2-2-2v-3
-	c1.103,0,2-0.897,2-2s-0.897-2-2-2V8c1.103,0,2-0.897,2-2S6.103,4,5,4V2h19V24z"/>
-</svg>
--- a/messagingapp/msgui/unifiededitor/resources/qtg_mono_send.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="32px" height="32px" viewBox="0 -7 32 32" enable-background="new 0 -7 32 32" xml:space="preserve">
-<defs>
-</defs>
-<polygon points="1,6 1.5,8 5,8 5,6 "/>
-<polygon points="2,10 2.5,12 5,12 5,10 "/>
-<polygon points="0,2 0.5,4 5,4 5,2 "/>
-<path d="M31,0H7C6.449,0,6,0.45,6,1v17c0,0.55,0.449,1,1,1h24c0.549,0,1-0.45,1-1V1C32,0.45,31.549,0,31,0z M19,12.146l3.447-1.991
-	L29.293,17H8.707l6.846-6.846L19,12.146z M23.344,9.637L30,5.794v10.499L23.344,9.637z M8,2h22v1.484L19,9.836L8,3.484V2z
-	 M14.656,9.637L8,16.293V5.794L14.656,9.637z"/>
-</svg>
--- a/messagingapp/msgui/unifiededitor/resources/qtg_small_attachment.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="32px" height="32px" viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">
-<defs>
-</defs>
-<g>
-	<rect fill="none" width="32" height="32"/>
-</g>
-<path opacity="0.6" d="M10.465,30L6,23.303V10h4v12.092L12.605,26h5.789L21,22.092V6h-6v13.5c0,0.275,0.224,0.5,0.5,0.5
-	s0.5-0.225,0.5-0.5V7h4v12.5c0,2.481-2.019,4.5-4.5,4.5S11,21.981,11,19.5V5c0-1.654,1.346-3,3-3h8c1.654,0,3,1.346,3,3v18.303
-	L20.535,30H10.465z"/>
-<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="15.5005" y1="29" x2="15.5005" y2="3.0005">
-	<stop  offset="0" style="stop-color:#8C8E8F"/>
-	<stop  offset="0.6545" style="stop-color:#D9D9D9"/>
-	<stop  offset="1" style="stop-color:#AEB2B3"/>
-</linearGradient>
-<path fill="url(#SVGID_1_)" d="M22,3h-8c-1.101,0-2,0.9-2,2v14.5c0,1.934,1.567,3.5,3.5,3.5s3.5-1.566,3.5-3.5V8h-2v11.5
-	c0,0.827-0.673,1.5-1.5,1.5S14,20.327,14,19.5V5h8v17.395L18.93,27H12.07L9,22.395V11H7v12l4,6h9l4-6V5C24,3.9,23.101,3,22,3z"/>
-</svg>
--- a/messagingapp/msgui/unifiededitor/resources/qtg_small_priority_high.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="32px" height="32px" viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">
-<defs>
-</defs>
-<g>
-	<rect fill="none" width="32" height="32"/>
-</g>
-<polygon opacity="0.6" points="12.117,19 9.867,2 22.133,2 19.883,19 "/>
-<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="15.9995" y1="3" x2="15.9995" y2="28.0027">
-	<stop  offset="0" style="stop-color:#FF4D00"/>
-	<stop  offset="1" style="stop-color:#800000"/>
-</linearGradient>
-<path fill="url(#SVGID_1_)" d="M21,3l-2,15h-6L11,3H21z"/>
-<path opacity="0.6" d="M16,30c-2.757,0-5-2.243-5-5s2.243-5,5-5s5,2.243,5,5S18.757,30,16,30L16,30z"/>
-<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="15.9995" y1="21.333" x2="15.9995" y2="28.8994">
-	<stop  offset="0" style="stop-color:#FF4D00"/>
-	<stop  offset="1" style="stop-color:#800000"/>
-</linearGradient>
-<circle fill="url(#SVGID_2_)" cx="16" cy="25" r="4"/>
-<polygon opacity="0.4" fill="#FFFFFF" points="20.866,4 21,3 11,3 11.134,4 "/>
-<path opacity="0.4" fill="#FFFFFF" d="M16,22c2.036,0,3.7,1.53,3.95,3.5C19.971,25.334,20,25.172,20,25c0-2.208-1.792-4-4-4
-	c-2.21,0-4,1.792-4,4c0,0.172,0.029,0.334,0.05,0.5C12.299,23.53,13.962,22,16,22z"/>
-</svg>
--- a/messagingapp/msgui/unifiededitor/resources/qtg_small_priority_low.svg	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
-	<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
-]>
-<svg version="1.1"
-	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-	 x="0px" y="0px" width="32px" height="32px" viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">
-<defs>
-</defs>
-<g>
-	<rect fill="none" width="32" height="32"/>
-</g>
-<polygon opacity="0.6" points="3.864,16 11,16 11,2 21,2 21,16 28.136,16 16,30.563 "/>
-<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="15.9995" y1="2.8545" x2="15.9995" y2="29.0011">
-	<stop  offset="0" style="stop-color:#4EDEFF"/>
-	<stop  offset="1" style="stop-color:#048CC6"/>
-</linearGradient>
-<polygon fill="url(#SVGID_1_)" points="20,17 20,3 12,3 12,17 6,17 16,29 26,17 "/>
-<polygon opacity="0.4" fill="#FFFFFF" points="20,17 20,18 25.167,18 26,17 "/>
-<polygon opacity="0.4" fill="#FFFFFF" points="12,18 12,17 6,17 6.833,18 "/>
-<rect x="12" y="3" opacity="0.4" fill="#FFFFFF" width="8" height="1"/>
-</svg>
--- a/messagingapp/msgui/unifiededitor/src/mmsinsertcheckoperation.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,155 +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: mms creation mode checks
- *
- */
-
-
-#include "mmsinsertcheckoperation.h"
-
-#include <MmsConformance.h>
-#include <centralrepository.h>
-#include <mmsconst.h>
-#include <msgmediainfo.h>
-#include <fileprotectionresolver.h>
-
-#include <MsgMediaResolver.h>
-#include <DRMHelper.h>
-#include <MmsEngineInternalCRKeys.h>
-#include <hbmessagebox.h>
-
-#include "s60qconversions.h"
-#include "debugtraces.h"
-
-//DEFINES
-#define RMODE_INSERT_ERROR hbTrId("Unable to insert. Object format not supported in restricted creation mode.")
-#define INSERT_ERROR hbTrId("Unable to insert. Object format not supported.")
-#define INSERT_QUERY_CONFRM hbTrId("The receiving phone may not support this object. Continue?")
-// -----------------------------------------------------------------------------
-// MmsInsertCheckOperation::MmsInsertCheckOperation
-// -----------------------------------------------------------------------------
-//
-MmsInsertCheckOperation::MmsInsertCheckOperation()
-{
-    QDEBUG_WRITE("MmsInsertCheckOperation::MmsInsertCheckOperation start");
-
-    CRepository* repository = CRepository::NewL(KCRUidMmsEngine);
-    CleanupStack::PushL(repository);
-    TInt creationMode = EMmsCreationModeRestricted;
-    if (repository->Get(KMmsEngineCreationMode, creationMode) == KErrNone) {
-        iCreationMode = creationMode;
-    }
-    CleanupStack::PopAndDestroy(repository);
-
-    iMmsConformance = CMmsConformance::NewL();
-    iMmsConformance->CheckCharacterSet(EFalse);
-    iMediaResolver = CMsgMediaResolver::NewL();
-    iMediaResolver->SetCharacterSetRecognition(EFalse);
-    iDRMHelper = CDRMHelper::NewL();
-
-    QDEBUG_WRITE("MmsInsertCheckOperation::MmsInsertCheckOperation end");
-}
-
-// -----------------------------------------------------------------------------
-// MmsInsertCheckOperation::~MmsInsertCheckOperation
-// -----------------------------------------------------------------------------
-//
-MmsInsertCheckOperation::~MmsInsertCheckOperation()
-{
-    delete iMmsConformance;
-    delete iMediaResolver;
-    delete iDRMHelper;
-}
-
-// ---------------------------------------------------------
-// MmsInsertCheckOperation::CheckModeForInsertL
-// ---------------------------------------------------------
-//
-int MmsInsertCheckOperation::checkModeForInsert(const QString& file)
-{
-    QDEBUG_WRITE("CheckModeForInsert::CheckModeForInsert start");
-    HBufC* filePath = S60QConversions::qStringToS60Desc(file);
-    if (filePath) {
-        CleanupStack::PushL(filePath);
-
-        RFile fileHandle = iMediaResolver->FileHandleL(*filePath);
-        CleanupClosePushL(fileHandle);
-
-        CMsgMediaInfo* info = iMediaResolver->CreateMediaInfoL(fileHandle);
-        info->ParseInfoDetails(fileHandle, *iDRMHelper, *this);
-        CleanupStack::PopAndDestroy(2);
-
-        TMmsConformance conformance = iMmsConformance->MediaConformance(*info);
-        TUint32 confStatus = conformance.iConfStatus;
-
-        // In "free" mode user can insert images that are larger by dimensions than allowed by conformance
-        if (iCreationMode != EMmsCreationModeRestricted) {
-            TInt i = EMmsConfNokFreeModeOnly | EMmsConfNokScalingNeeded | EMmsConfNokTooBig;
-            TInt j = ~(EMmsConfNokFreeModeOnly | EMmsConfNokScalingNeeded | EMmsConfNokTooBig);
-
-            // If user answers yes to Guided mode confirmation query he/she moves to free mode
-            if ((confStatus & i) && !(confStatus & j)) {
-                if (iCreationMode == EMmsCreationModeFree || info->Protection()
-                    & EFileProtSuperDistributable) {
-                    // SuperDistribution not checked here
-                    // Mask "FreeModeOnly" and "ScalingNeeded" away in free mode
-                    confStatus &= ~EMmsConfNokFreeModeOnly;
-                    confStatus &= ~EMmsConfNokScalingNeeded;
-                }
-                else if (launchEditorQuery()) {
-                    // Query accepted.
-                    // Mask "FreeModeOnly" and "ScalingNeeded" away in free mode
-                    confStatus &= ~EMmsConfNokFreeModeOnly;
-                    confStatus &= ~EMmsConfNokScalingNeeded;
-                }
-                else {
-                    //query not accepted. Stop insertion.
-                    return EInsertQueryAbort;
-                }
-            }
-        }
-        else if (confStatus & EMmsConfNokDRM || confStatus & EMmsConfNokNotEnoughInfo || confStatus
-            & EMmsConfNokNotSupported || confStatus & EMmsConfNokFreeModeOnly || confStatus
-            & EMmsConfNokCorrupt) {
-            // Sanity check
-            // "Not conformant" assumed if check fails.     
-            if (iCreationMode == EMmsCreationModeRestricted)
-            HbMessageBox::launchInformationMessageBox(RMODE_INSERT_ERROR);
-            else
-            HbMessageBox::launchInformationMessageBox(INSERT_ERROR);
-            
-            return EInsertNotSupported;
-        }
-        delete info;
-    }
-    QDEBUG_WRITE("CheckModeForInsert::CheckModeForInsert end");
-    return EInsertSuccess;
-}
-
-// ---------------------------------------------------------
-// MmsInsertCheckOperation::launchEditorQuery
-// ---------------------------------------------------------
-//
-bool MmsInsertCheckOperation::launchEditorQuery()
-{
-    return HbMessageBox::launchQuestionMessageBox(INSERT_QUERY_CONFRM);
-}
-
-// -----------------------------------------------------------------------------
-// MmsInsertCheckOperation::MediaInfoParsed
-// -----------------------------------------------------------------------------
-//
-void MmsInsertCheckOperation::MediaInfoParsed()
-{
-}
--- a/messagingapp/msgui/unifiededitor/src/msgattachmentcontainer.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/src/msgattachmentcontainer.cpp	Mon May 03 12:29:07 2010 +0300
@@ -26,7 +26,7 @@
 #include "msgattachmentcontainer.h"
 #include "unieditorgenutils.h"
 #include "msgmonitor.h"
-#include "mmsinsertcheckoperation.h"
+#include "mmsconformancecheck.h"
 
 // Constants
 
@@ -42,7 +42,7 @@
     mLayout = new QGraphicsLinearLayout(Qt::Vertical, this);
     mLayout->setContentsMargins(0,0,0,0);
     mLayout->setSpacing(0);
-    mMmsInsertCheckOp = new MmsInsertCheckOperation;
+    mMmsConformanceCheck = new MmsConformanceCheck;
 }
 
 //---------------------------------------------------------------
@@ -51,18 +51,19 @@
 //---------------------------------------------------------------
 MsgAttachmentContainer::~MsgAttachmentContainer()
 {
-    delete mMmsInsertCheckOp;
+    delete mMmsConformanceCheck;
 }
 
 //---------------------------------------------------------------
 // MsgAttachmentContainer::addAttachment
 // @see header file
 //---------------------------------------------------------------
-void MsgAttachmentContainer::addAttachment(const QString& filepath)
+MsgAttachmentContainer::AddAttachmentStatus 
+    MsgAttachmentContainer::addAttachment(const QString& filepath)
 {
     //check for insert conformance
-    if(EInsertSuccess != mMmsInsertCheckOp->checkModeForInsert(filepath))
-        return;
+    if(EInsertSuccess != mMmsConformanceCheck->checkModeForInsert(filepath))
+        return EAddNotSupported;
 
     int msgSize = messageSize();
     QFileInfo fileinfo(filepath);
@@ -76,21 +77,21 @@
                 ((mAttachmentList.count() == 1) && !mIsMMContent) )
         {
             mIsMMContent = true;
-            emit mmContentAdded(true);
         }
         mAttachmentList << att;
-        int index = mLayout->count() - 1;
+        int index = mLayout->count();
         mLayout->insertItem(index,att);
         connect(att, SIGNAL(deleteMe(MsgUnifiedEditorAttachment*)),
             this, SLOT(deleteAttachment(MsgUnifiedEditorAttachment*)));
 
-        // emit to signal that container size changed
-        emit sizeChanged(containerSize());
+        // emit to signal that container content & size changed
+        emit contentChanged();
     }
-    else if(mAttachmentList.count() == 0)
+    else
     {
-        emit emptyAttachmentContainer();
+        return EAddSizeExceed;
     }
+    return EAddSuccess;
 }
 
 //---------------------------------------------------------------
@@ -108,12 +109,10 @@
         ((mAttachmentList.count() == 0) && mIsMMContent) )
     {
         mIsMMContent = false;
-        emit mmContentAdded(false);
     }
 
-    // emit to indicate change in container size
-    emit sizeChanged(containerSize());
-
+    // emit to indicate change in container content & size
+    emit contentChanged();
     if(mAttachmentList.count() == 0)
     {
         emit emptyAttachmentContainer();
@@ -163,5 +162,14 @@
     return containerSize() + MsgMonitor::bodySize() + MsgMonitor::subjectSize();
 }
 
+//---------------------------------------------------------------
+// MsgAttachmentContainer::hasMMContent
+// @see header file
+//---------------------------------------------------------------
+bool MsgAttachmentContainer::hasMMContent()
+{
+    return mIsMMContent;
+}
+
 //EOF
 
--- a/messagingapp/msgui/unifiededitor/src/msgmonitor.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/src/msgmonitor.cpp	Mon May 03 12:29:07 2010 +0300
@@ -11,52 +11,49 @@
  *
  * Contributors:
  *
- * Description:
+ * Description: Helper class to monitor msg construction in unified editor
  *
  */
 
 // INCLUDES
 #include "debugtraces.h"
+#include <HbNotificationDialog>
+#include <HbWidget>
 
 // USER INCLUDES
 #include "msgmonitor.h"
+#include "msgunieditorview.h"
+#include "msgunieditoraddress.h"
+#include "msgunieditorsubject.h"
 #include "msgunieditorbody.h"
-#include "msgunieditorsubject.h"
 #include "msgattachmentcontainer.h"
 #include "UniEditorGenUtils.h"
 
 // Constants
 
 // Define static
+ConvergedMessage::MessageType MsgMonitor::mMessageType;
 int MsgMonitor::mBodySize;
 int MsgMonitor::mContainerSize;
 int MsgMonitor::mSubjectSize;
 int MsgMonitor::mMaxMmsSize;
+int MsgMonitor::mMaxSmsRecipients;
+int MsgMonitor::mMaxMmsRecipients;
+
+//Localized strings
+#define LOC_POP_MESSAGE_CHANGE_MUL hbTrId("txt_messaging_dpopinfo_message_type_changed_to_mul")
+#define LOC_POP_MESSAGE_CHANGE_TEXT hbTrId("txt_messaging_dpopinfo_message_type_changed_to_tex")
 
 //---------------------------------------------------------------
 // MsgMonitor::MsgMonitor
 // @see header file
 //---------------------------------------------------------------
 MsgMonitor::MsgMonitor(QObject* parent) :
-QObject(parent)
+QObject(parent),
+mSkipNote(false)
 {
     init();
-}
-
-//---------------------------------------------------------------
-// MsgMonitor::init
-// @see header file
-//---------------------------------------------------------------
-void MsgMonitor::init()
-{
-    mBodySize = 0;
-    mContainerSize = 0;
-    mSubjectSize = 0;
-
-    mMaxMmsSize = 0;
-    UniEditorGenUtils* uniEditorGenUtils = new UniEditorGenUtils;
-    mMaxMmsSize = KDefaultMaxSize;
-    TRAP_IGNORE(mMaxMmsSize = uniEditorGenUtils->MaxMmsMsgSizeL());
+    mUniEditorGenUtils = new UniEditorGenUtils;
 }
 
 //---------------------------------------------------------------
@@ -65,87 +62,196 @@
 //---------------------------------------------------------------
 MsgMonitor::~MsgMonitor()
 {
-}
-
-//---------------------------------------------------------------
-// MsgMonitor::messageSize
-// @see header file
-//---------------------------------------------------------------
-int MsgMonitor::messageSize()
-{
-    return mBodySize + mContainerSize + mSubjectSize;
+    delete mUniEditorGenUtils;
 }
 
 //---------------------------------------------------------------
-// MsgMonitor::bodySize
+// MsgMonitor::init
 // @see header file
 //---------------------------------------------------------------
-int MsgMonitor::bodySize()
+void MsgMonitor::init()
 {
-    return mBodySize;
-}
+    mMessageType = ConvergedMessage::Sms;
+    mBodySize = 0;
+    mContainerSize = 0;
+    mSubjectSize = 0;
+
+    UniEditorGenUtils* uniEditorGenUtils = new UniEditorGenUtils;
 
-//---------------------------------------------------------------
-// MsgMonitor::containerSize
-// @see header file
-//---------------------------------------------------------------
-int MsgMonitor::containerSize()
-{
-    return mContainerSize;
+    mMaxMmsSize = KDefaultMaxSize;
+    TRAP_IGNORE(mMaxMmsSize = uniEditorGenUtils->MaxMmsMsgSizeL());
+
+    mMaxSmsRecipients = KDefaultSmsRecipients;
+    TRAP_IGNORE(mMaxSmsRecipients = uniEditorGenUtils->MaxSmsRecipientsL());
+
+    mMaxMmsRecipients = KDefaultMmsRecipients;
+    TRAP_IGNORE(mMaxMmsRecipients = uniEditorGenUtils->MaxMmsRecipientsL());
+
+    delete uniEditorGenUtils;
 }
 
 //---------------------------------------------------------------
-// MsgMonitor::subjectSize
+// MsgMonitor::checkMsgTypeChange
 // @see header file
 //---------------------------------------------------------------
-int MsgMonitor::subjectSize()
+void MsgMonitor::checkMsgTypeChange()
 {
-    return mSubjectSize;
+    // fetch editor's content 
+    MsgUnifiedEditorBody* edBody = view()->mBody;
+    QStringList objList = edBody->mediaContent();
+    QString bodyText = edBody->text();
+    
+    MsgUnifiedEditorSubject* edSubject = view()->mSubjectField;
+    ConvergedMessage::Priority priority = ConvergedMessage::Normal;
+    QString subjectText;
+    if(edSubject)
+    {
+        priority = edSubject->priority();
+        subjectText = edSubject->text();
+    }
+
+    MsgUnifiedEditorAddress* edCc = view()->mCcField;
+    MsgUnifiedEditorAddress* edBcc = view()->mBccField;
+    int ccCount = 0;
+    int bccCount = 0;
+    if(edCc && edBcc)
+    {
+        ccCount = edCc->addressCount();
+        bccCount = edBcc->addressCount();
+    }
+    
+    MsgAttachmentContainer* edContainer = view()->mAttachmentContainer;
+    bool hasMMAttachmentContent = false;
+    int attachmentCount = 0;
+    if(edContainer)
+    {
+        hasMMAttachmentContent = edContainer->hasMMContent();
+        attachmentCount = edContainer->count();
+    }
+
+    // find out the msgtype based on content
+    ConvergedMessage::MessageType projectedMsgType = ConvergedMessage::Sms;
+
+    // check for presence of MMS content
+    // 1. If any media-object is present inside body
+    // 2. If priority is set to other than Normal
+    // 3. If subject has some content
+    // 4. If CC/BCC has some content
+    // 5. If MM attachments are present
+    // 6. If only one non-MM attachment is present e.g. vcf 
+    //    and body text is also present
+    // 7. If body text size exceeds sms text-size limit
+    if( !objList.isEmpty() || 
+        (priority != ConvergedMessage::Normal) || 
+        !subjectText.isEmpty() ||
+        (ccCount || bccCount) ||
+        hasMMAttachmentContent ||
+        ((attachmentCount == 1) && !bodyText.isEmpty())
+      )
+    {
+        projectedMsgType = ConvergedMessage::Mms;
+    }
+    else
+    {
+        projectedMsgType = ConvergedMessage::Sms;
+    }
+
+    // optimization 1: if projected type is still sms means
+    // the message under composition has only plain text
+    if(projectedMsgType == ConvergedMessage::Sms)
+    {
+        bool hasUnicodeText = edBody->isUnicode();
+        int bodyTextSize = mUniEditorGenUtils->UTF8Size(bodyText);
+        int maxSmsSize = mUniEditorGenUtils->MaxSmsMsgSizeL(hasUnicodeText);
+        if(bodyTextSize > maxSmsSize)
+        {
+            projectedMsgType = ConvergedMessage::Mms;
+        }
+    }
+        
+    // show type change note, if needed
+    if(mMessageType != projectedMsgType)
+    {
+        mMessageType = projectedMsgType;
+        QString noteStr;
+        if(projectedMsgType == ConvergedMessage::Sms)
+        {
+            noteStr = LOC_POP_MESSAGE_CHANGE_TEXT;
+        }
+        else
+        {
+            noteStr = LOC_POP_MESSAGE_CHANGE_MUL;
+            
+            //Disable char counter
+            edBody->disableCharCounter();
+        }
+        showPopup(noteStr);
+    }
+    
+    // update size of editor component
+    HbWidget* senderWidget = qobject_cast<HbWidget*>(sender());
+    updateSizeInfo(senderWidget);
 }
 
 //---------------------------------------------------------------
-// MsgMonitor::maxMmsSize
-// @see header file
-//---------------------------------------------------------------
-int MsgMonitor::maxMmsSize()
-{
-    return mMaxMmsSize;
-}
-
-//---------------------------------------------------------------
-// MsgMonitor::onSizeChanged
+// MsgMonitor::updateSizeInfo
 // @see header file
 //---------------------------------------------------------------
-void MsgMonitor::onSizeChanged(int aSize)
+void MsgMonitor::updateSizeInfo(HbWidget* aWidget)
 {
-    // TODO: implement this correctly
-    HbWidget* senderWidget = qobject_cast<HbWidget*>(sender());
-    
     // if sent by body widget
     MsgUnifiedEditorBody* body = NULL;    
-    body = qobject_cast<MsgUnifiedEditorBody*>(senderWidget);
+    body = qobject_cast<MsgUnifiedEditorBody*>(aWidget);
     if(body)
     {
-        mBodySize = aSize;
+        mBodySize = view()->mBody->bodySize();
         return;
     }
     
     // if sent by attachment container widget
     MsgAttachmentContainer* container = NULL;
-    container = qobject_cast<MsgAttachmentContainer*>(senderWidget);
+    container = qobject_cast<MsgAttachmentContainer*>(aWidget);
     if(container)
     {
-        mContainerSize = aSize;
+        mContainerSize = view()->mAttachmentContainer->containerSize();
         return;
     }
 
     // if sent by subject widget
     MsgUnifiedEditorSubject* subject = NULL;
-    subject = qobject_cast<MsgUnifiedEditorSubject*>(senderWidget);
+    subject = qobject_cast<MsgUnifiedEditorSubject*>(aWidget);
     if(subject)
     {
-        mSubjectSize = aSize;
+        mSubjectSize = view()->mSubjectField->subjectSize();
     }
 }
 
+//---------------------------------------------------------------
+// MsgMonitor::showPopup
+// @see header file
+//---------------------------------------------------------------
+void MsgMonitor::showPopup(const QString& text)
+{
+    if(!mSkipNote)
+    {
+        HbNotificationDialog* dlg = new HbNotificationDialog();
+        dlg->setFocusPolicy(Qt::NoFocus);
+        dlg->setDismissPolicy(HbPopup::TapAnywhere);
+        dlg->setAttribute(Qt::WA_DeleteOnClose, true);
+        dlg->setText(text);
+        dlg->show();
+    }
+    // reset skip note flag
+    mSkipNote = false;
+}
+
+//---------------------------------------------------------------
+// MsgMonitor::view
+// @see header file
+//---------------------------------------------------------------
+MsgUnifiedEditorView* MsgMonitor::view()
+{
+    return static_cast<MsgUnifiedEditorView*>(this->parent());
+}
+
 //EOF
--- a/messagingapp/msgui/unifiededitor/src/msgtypenotifier.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +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:
- *
- */
-
-// INCLUDES
-#include "debugtraces.h"
-//#include <HbDeviceNotificationDialog>
-#include <HbNotificationDialog>
-
-// USER INCLUDES
-#include "msgtypenotifier.h"
-
-// Constants
-
-//Localized strings
-#define LOC_POP_MESSAGE_CHANGE_MUL hbTrId("txt_messaging_dpopinfo_message_type_changed_to_mul")
-#define LOC_POP_MESSAGE_CHANGE_TEXT hbTrId("txt_messaging_dpopinfo_message_type_changed_to_tex")
-
-//---------------------------------------------------------------
-// MsgTypeNotifier::MsgTypeNotifier
-// @see header file
-//---------------------------------------------------------------
-MsgTypeNotifier::MsgTypeNotifier(QObject* parent) :
-QObject(parent),
-mmContentCount(0),
-mSkipNote(false)
-{
-    // do nothing
-}
-
-//---------------------------------------------------------------
-// MsgTypeNotifier::~MsgTypeNotifier
-// @see header file
-//---------------------------------------------------------------
-MsgTypeNotifier::~MsgTypeNotifier()
-{
-    // do nothing
-}
-
-//---------------------------------------------------------------
-// MsgTypeNotifier::messageType
-// @see header file
-//---------------------------------------------------------------
-ConvergedMessage::MessageType MsgTypeNotifier::messageType() const
-{
-    ConvergedMessage::MessageType msgtype = ConvergedMessage::None;
-    if(mmContentCount)
-    {
-        msgtype = ConvergedMessage::Mms;
-	}
-	else
-	{
-        msgtype = ConvergedMessage::Sms;
-	}
-
-    return msgtype;
-}
-
-//---------------------------------------------------------------
-// MsgTypeNotifier::onMMContentAdded
-// @see header file
-//---------------------------------------------------------------
-void MsgTypeNotifier::onMMContentAdded(bool isAdded)
-{    if(isAdded)
-        {
-        mmContentCount++;
-        if(mmContentCount == 1)
-            {
-            showPopup(LOC_POP_MESSAGE_CHANGE_MUL);
-            }
-        }
-    else
-        {
-        mmContentCount--;
-        if(mmContentCount == 0)
-            {
-            showPopup(LOC_POP_MESSAGE_CHANGE_TEXT);
-            }
-        
-        Q_ASSERT(mmContentCount >= 0);
-        }
-}
-
-void MsgTypeNotifier::showPopup(const QString& text)
-{
-    if(!mSkipNote)
-    {
-        HbNotificationDialog* dlg = new HbNotificationDialog();
-        dlg->setFocusPolicy(Qt::NoFocus);
-        dlg->setAttribute(Qt::WA_DeleteOnClose, true);
-        dlg->setText(text);
-        dlg->show();
-    }
-    // reset skip note flag
-    mSkipNote = false;
-}
-
-void MsgTypeNotifier::setSkipNote()
-{
-    mSkipNote = true;
-}
-
-//EOF
--- a/messagingapp/msgui/unifiededitor/src/msgunieditoraddress.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/src/msgunieditoraddress.cpp	Mon May 03 12:29:07 2010 +0300
@@ -22,35 +22,37 @@
 #include <HbAction>
 #include <hbinputeditorinterface.h>
 #include <cntservicescontact.h>
+#include <xqaiwrequest.h>
+#include <xqappmgr.h>
+#include <telconfigcrkeys.h>        // KCRUidTelephonyConfiguration
+#include <centralrepository.h>
 
 // USER INCLUDES
 #include "msgunieditoraddress.h"
 #include "msgunifiededitorlineedit.h"
-#include "msguiutilsmanager.h"
-#include "matchphnumberutil.h"
 
-const QString PBK_ICON(":/qtg_mono_contacts.svg");
-const QString SEND_ICON(":/qtg_mono_send.svg");
+const QString PBK_ICON("qtg_mono_contacts");
+const QString SEND_ICON("qtg_mono_send");
 
 // Constants
+const int KDefaultGsmNumberMatchLength = 7;  //matching unique ph numbers
 
 MsgUnifiedEditorAddress::MsgUnifiedEditorAddress( const QString& label,
                                                   const QString& pluginPath,
                                                   QGraphicsItem *parent ) :
 HbWidget(parent),
-mPluginPath(pluginPath),
-mUtilsManager(0)
+mPluginPath(pluginPath)
 {
     #ifdef _DEBUG_TRACES_
     qDebug() << "MsgUnifiedEditorAddress calling HbStyle::registerPlugin";
     #endif
 
+    this->setContentsMargins(0,0,0,0);
     setPluginBaseId(style()->registerPlugin(mPluginPath));
-    mUtilsManager = new MsgUiUtilsManager(this);
-
+    
     mLaunchBtn = new HbPushButton(this);
     HbStyle::setItemName(mLaunchBtn,"launchBtn");
-    connect(mLaunchBtn,SIGNAL(clicked()),mUtilsManager,SLOT(fetchContacts()));
+    connect(mLaunchBtn,SIGNAL(clicked()),this,SLOT(fetchContacts()));
 
     mLaunchBtn->setIcon(HbIcon(PBK_ICON));
 
@@ -58,17 +60,16 @@
     HbStyle::setItemName(mAddressEdit,"addressField");
 
     mAddressEdit->setMaxRows(40);
-    connect(mAddressEdit, SIGNAL(addressTextChanged(const QString&)),
-            this, SLOT(onTextChanged(const QString&)));
+    connect(mAddressEdit, SIGNAL(contentsChanged(const QString&)),
+            this, SLOT(onContentsAdded(const QString&)));
 
     // add "Send" action in VKB
     HbEditorInterface editorInterface(mAddressEdit);
+    mAddressEdit->setInputMethodHints(Qt::ImhPreferNumbers);
     HbAction *sendAction = new HbAction(HbIcon(SEND_ICON), QString(),this);
     connect(sendAction, SIGNAL(triggered()),this, SIGNAL(sendMessage()));
     editorInterface.addAction(sendAction);
     
-    connect(mUtilsManager, SIGNAL(contactsFetched(const QVariant&)),
-            this, SLOT(contactsFetched(const QVariant&)));
     }
 
 MsgUnifiedEditorAddress::~MsgUnifiedEditorAddress()
@@ -76,7 +77,33 @@
     style()->unregisterPlugin(mPluginPath);
 }
 
-void MsgUnifiedEditorAddress::contactsFetched(const QVariant& value)
+void MsgUnifiedEditorAddress::fetchContacts()
+{
+    QList<QVariant> args;
+    QString serviceName("com.nokia.services.phonebookservices");
+    QString operation("fetch(QString,QString,QString)");
+    XQAiwRequest* request;
+    XQApplicationManager appManager;
+    request = appManager.create(serviceName, "Fetch", operation, true); // embedded
+    if ( request == NULL )
+        {
+        return;       
+        }
+
+    // Result handlers
+    connect (request, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleOk(const QVariant&)));
+    connect (request, SIGNAL(requestError(int,const QString&)), this, SLOT(handleError(int,const QString&)));
+    
+    args << QString(tr("Phonebook")); 
+    args << KCntActionAll;
+    args << KCntFilterDisplayAll;
+    
+    request->setArguments(args);
+    request->send();
+    delete request;
+}
+
+void MsgUnifiedEditorAddress::handleOk(const QVariant& value)
 {
    CntServicesContactList contactList;
     contactList = qVariantValue<CntServicesContactList>(value);
@@ -95,6 +122,12 @@
     }
 }
 
+void MsgUnifiedEditorAddress::handleError(int errorCode, const QString& errorMessage)
+{
+    Q_UNUSED(errorMessage)
+    Q_UNUSED(errorCode)
+}
+
 ConvergedMessageAddressList MsgUnifiedEditorAddress::addresses()
 {
     #ifdef _DEBUG_TRACES_
@@ -146,27 +179,44 @@
     }
 }
 
-void MsgUnifiedEditorAddress::onTextChanged(const QString& text)
+int MsgUnifiedEditorAddress::contactMatchDigits()
+    {
+    // Read the amount of digits to be used in contact matching
+    // The key is owned by PhoneApp    
+    CRepository* repository = CRepository::NewLC(KCRUidTelConfiguration);
+    int matchDigitCount = 0;
+    if ( repository->Get(KTelMatchDigits, matchDigitCount) == KErrNone )
+        {
+    // Min is 7
+    matchDigitCount = Max(matchDigitCount, KDefaultGsmNumberMatchLength);
+        }
+    CleanupStack::PopAndDestroy(); // repository
+
+    return matchDigitCount;
+
+    }
+   
+void MsgUnifiedEditorAddress::onContentsAdded(const QString& text)
 {
     if(!text.isEmpty())
     {
-        disconnect(mAddressEdit, SIGNAL(addressTextChanged(const QString&)),
-                this, SLOT(onTextChanged(const QString&)));
-        emit mmContentAdded(true);
-        connect(mAddressEdit, SIGNAL(addressTextChanged(const QString&)),
-                this, SLOT(onTextRemoved(const QString&)));
+        disconnect(mAddressEdit, SIGNAL(contentsChanged(const QString&)),
+                this, SLOT(onContentsAdded(const QString&)));
+        emit contentChanged();
+        connect(mAddressEdit, SIGNAL(contentsChanged(const QString&)),
+                this, SLOT(onContentsRemoved(const QString&)));
     }
 }
 
-void MsgUnifiedEditorAddress::onTextRemoved(const QString& text)
+void MsgUnifiedEditorAddress::onContentsRemoved(const QString& text)
 {
     if(text.isEmpty())
     {
-        disconnect(mAddressEdit, SIGNAL(addressTextChanged(const QString&)),
-                this, SLOT(onTextRemoved(const QString&)));
-        emit mmContentAdded(false);
-        connect(mAddressEdit, SIGNAL(addressTextChanged(const QString&)),
-                this, SLOT(onTextChanged(const QString&)));
+        disconnect(mAddressEdit, SIGNAL(contentsChanged(const QString&)),
+                this, SLOT(onContentsRemoved(const QString&)));
+        emit contentChanged();
+        connect(mAddressEdit, SIGNAL(contentsChanged(const QString&)),
+                this, SLOT(onContentsAdded(const QString&)));
     }
 }
 
@@ -211,7 +261,7 @@
 
 QStringList MsgUnifiedEditorAddress::uniqueAddressList()
 {
-    int matchDigitCount = MatchPhNumberUtil::matchDigits();
+    int matchDigitCount = MsgUnifiedEditorAddress::contactMatchDigits();
     QStringList mapAddrList = mAddressMap.keys();
     for(int j = 0;j<mapAddrList.count()-1;j++)
     {
--- a/messagingapp/msgui/unifiededitor/src/msgunieditorattachment.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/src/msgunieditorattachment.cpp	Mon May 03 12:29:07 2010 +0300
@@ -21,10 +21,14 @@
 #include <HbIconItem>
 #include <QFileInfo>
 #include <QFont>
-#include <HbPushButton>
 #include <HbFrameDrawer>
 #include <HbMenu>
 #include <MsgMimeTypes.h>
+#include <HbFrameItem>
+#include <HbGestureSceneFilter>
+#include <HbGesture>
+#include <QGraphicsSceneMouseEvent>
+#include <HbWidgetFeedback>
 
 // USER INCLUDES
 #include "msgunieditorattachment.h"
@@ -35,6 +39,16 @@
 #define BYTES_TO_KBYTES_FACTOR 1024
 #define BG_FRAME "qtg_fr_groupbox"
 
+//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");
+
+const QString ATTACHMENT_ICON("qtg_small_attachment");
+
 MsgUnifiedEditorAttachment::MsgUnifiedEditorAttachment( const QString& pluginPath,
                                                         const QString& attachmentpath,
                                                         const int filesize,
@@ -46,62 +60,71 @@
 mMimeType(QString()),
 mAttachmentIcon(0),
 mAttachmentName(0),
-mFrameItem(0)
+mGestureFilter(0),
+mMaxSmsSize(KFirstNormalSmsLength)
 {
 #ifdef _DEBUG_TRACES_
     qDebug() << "MsgUnifiedEditorAttachment calling HbStyle::registerPlugin";
 #endif
-
+    
         setPluginBaseId(style()->registerPlugin(mPluginPath));
+		     
+        //back ground
+        HbFrameItem* backGround = new HbFrameItem(this);
+        backGround->frameDrawer().setFrameGraphicsName(LIST_ITEM_BG_FRAME_NORMAL);
+        backGround->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
+        this->setBackgroundItem(backGround);        
 
-        mAttachmentIcon = new HbIconItem(":/qtg_small_attachment.svg", this);
+        mAttachmentIcon = new HbIconItem(ATTACHMENT_ICON, this);
         HbStyle::setItemName(mAttachmentIcon,"attachmentIcon");
 
-        // TODO: use utility to get mimetype and size
         int at_size = 0;
         TMsgMediaType mediaType = EMsgMediaUnknown;
         UniEditorGenUtils* genUtils = new UniEditorGenUtils;
         TRAP_IGNORE(genUtils->getFileInfoL(mPath,at_size,
                                            mMimeType,mediaType));
+        TRAP_IGNORE(mMaxSmsSize = genUtils->MaxSmsMsgSizeL()); 
         delete genUtils;
         QFileInfo fileinfo(attachmentpath);
         QString filename = fileinfo.fileName();
         mAttachmentName = new HbTextItem(filename,this);
         HbStyle::setItemName(mAttachmentName,"attachmentName");
         mAttachmentName->setElideMode(Qt::ElideRight);
-
-        int sizeInKb = mSize/BYTES_TO_KBYTES_FACTOR;
+        
+        // for sms, pure size should be shown
+        // for mms, additional mimeheader size must be included
+        qreal displaySize = mSize;
+        if(!isMultimediaContent())
+        {
+            displaySize = fileinfo.size();
+        }
+        int sizeInKb = displaySize/BYTES_TO_KBYTES_FACTOR;
         QString fileDetails;
-        if(sizeInKb > 1)
+        // if size exceeds 1kb, then show kb or else only bytes
+        if(sizeInKb >= 1)
         {
             fileDetails = QString().append(QString("(%1 Kb)").arg(sizeInKb));
         }
         else
         {
-            fileDetails = QString().append(QString("(%1 B)").arg(mSize));
+            fileDetails = QString().append(QString("(%1 B)").arg(displaySize));
         }
 
         mAttachmentDetails = new HbTextItem(fileDetails, this);
         HbStyle::setItemName(mAttachmentDetails,"attachmentDetails");
         mAttachmentDetails->setElideMode(Qt::ElideNone);
-
-        // set underlined font
-        QFont underlinedFont(this->font());
-        underlinedFont.setUnderline(true);
-        mAttachmentName->setFont(underlinedFont);
-        mAttachmentDetails->setFont(underlinedFont);
-
-        mFrameItem = new HbPushButton(this);
-        HbStyle::setItemName(mFrameItem, "bgFrame");
-        HbFrameDrawer *fd = new HbFrameDrawer(BG_FRAME, HbFrameDrawer::NinePieces);
-        mFrameItem->setFrameBackground(fd);
-        connect(mFrameItem, SIGNAL(clicked(bool)), this, SIGNAL(clicked()));
-        connect(mFrameItem, SIGNAL(longPress(QPointF)), this, SLOT(longPressed(QPointF)));
+        
+        initGesture();
 }
 
 MsgUnifiedEditorAttachment::~MsgUnifiedEditorAttachment()
 {
     style()->unregisterPlugin(mPluginPath);
+    
+    if(mGestureFilter)
+        {
+        removeSceneEventFilter(mGestureFilter);
+        }
 }
 
 const QString& MsgUnifiedEditorAttachment::path()
@@ -122,9 +145,9 @@
 void MsgUnifiedEditorAttachment::longPressed(QPointF position)
 {
     HbMenu* menu = new HbMenu;
-    menu->addAction(tr("Open"), this, SLOT(openAttachment()));
-    menu->addAction(tr("Remove"), this, SLOT(removeAttachment()));
-    menu->addAction(tr("View details"), this, SLOT(viewDetails()));
+    menu->addAction(LOC_OPEN, this, SLOT(openAttachment()));
+    menu->addAction(LOC_REMOVE, this, SLOT(removeAttachment()));
+    menu->addAction(LOC_DETAILS, this, SLOT(viewDetails()));
     menu->setDismissPolicy(HbPopup::TapAnywhere);
     menu->setAttribute(Qt::WA_DeleteOnClose, true);
     menu->setPreferredPos(position);
@@ -156,10 +179,74 @@
         !QString::compare(mMimeType, vcal, Qt::CaseInsensitive) ||
         !QString::compare(mMimeType, ical, Qt::CaseInsensitive) )
     {
-        // vcard, vcal are not mm content
-        ret = false;
+        QFileInfo fileinfo(mPath);
+        int fSize = fileinfo.size();
+        
+        // if filesize is within sms size-limit, then
+        // it is not mm content, else it is mm attachment
+        if(fSize <= mMaxSmsSize)
+        {
+            ret = false;
+        }
     }
     return ret;
 }
 
+void MsgUnifiedEditorAttachment::mousePressEvent(QGraphicsSceneMouseEvent *event)
+{    
+    HbWidgetFeedback::triggered(this, Hb::InstantPressed);
+    
+    HbFrameItem* backGround = new HbFrameItem(this);
+    backGround->frameDrawer().setFrameGraphicsName(LIST_ITEM_BG_FRAME_PRESSED);
+    backGround->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
+    this->setBackgroundItem(backGround); 
+    
+    event->accept();
+}
+
+void MsgUnifiedEditorAttachment::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
+{
+    HbFrameItem* backGround = new HbFrameItem(this);
+    backGround->frameDrawer().setFrameGraphicsName(LIST_ITEM_BG_FRAME_NORMAL);
+    backGround->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
+    this->setBackgroundItem(backGround);
+    
+    if(this->rect().contains(event->pos()))
+        {
+        HbWidgetFeedback::triggered(this, Hb::InstantClicked);
+        emit clicked();
+        }
+    
+    event->accept();    
+}
+
+void MsgUnifiedEditorAttachment::initGesture()
+{
+    // Create gesture filter
+    mGestureFilter = new HbGestureSceneFilter( Qt::LeftButton, this );
+    
+    // Add gestures for longpress
+    HbGesture* gestureLongpressed = new HbGesture( HbGesture::longpress,5 );
+    
+    mGestureFilter->addGesture( gestureLongpressed );
+    
+    connect( gestureLongpressed, SIGNAL(longPress(QPointF)),
+             this, SLOT(longPressed(QPointF)) );
+
+    //install gesture filter.
+    this->installSceneEventFilter(mGestureFilter);
+}
+
+HbFeedback::InstantEffect MsgUnifiedEditorAttachment::overrideFeedback(Hb::InstantInteraction interaction) const
+        {
+        switch(interaction)
+            {
+            case Hb::InstantPressed:
+            case Hb::InstantClicked:
+                return HbFeedback::Basic;
+            default:
+                return HbFeedback::NoOverride;
+            }
+        }
+
 // EOF
--- a/messagingapp/msgui/unifiededitor/src/msgunieditorbody.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/src/msgunieditorbody.cpp	Mon May 03 12:29:07 2010 +0300
@@ -17,6 +17,7 @@
 
 // INCLUDES
 #include <HbTextEdit>
+#include <HbTextItem>
 #include <HbFrameItem>
 #include <HbFrameDrawer>
 #include <HbIconItem>
@@ -40,28 +41,47 @@
 #include <HbIconAnimator>
 #include <HbIcon>
 
+#include <csmsaccount.h>
+#include <smutset.h>
+#include <xqaiwrequest.h>
+#include <xqrequestinfo.h>
+#include <xqsharablefile.h>
+#include <xqappmgr.h>
+
 // USER INCLUDES
 #include "msgunieditorbody.h"
 #include "UniEditorGenUtils.h"
+#include "unisendingsettings.h"
 #include "msgmonitor.h"
 #include "s60qconversions.h"
-#include "mmsinsertcheckoperation.h"
+#include "mmsconformancecheck.h"
+#include "unieditorpluginloader.h"
+#include "unieditorplugininterface.h"
+#include "convergedmessage.h"
+#include "msgmediautil.h"
 
 // Constants
-const QString EDITOR_FRAME("qtg_fr_editor");
+const QString EDITOR_FRAME("qtg_fr_lineedit_normal");
+const QString BACKGROUND_FRAME("qtg_fr_btn_normal");
 const QString AUDIO_REGION("AudioRegion");
 const QString VIDEO_REGION("VideoRegion");
 const QString IMAGE_REGION("ImageRegion");
 const QString INVALID_REGION("InvalidRegion");
-const QString SEND_ICON("qtg_mono_send.svg");
+const QString SEND_ICON("qtg_mono_send");
+
+//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")
+#define LOC_TITLE   hbTrId("txt_messaging_title_messaging")
 
-//Localized Constants
-#define LOC_COMMON_OPEN hbTrId("txt_common_menu_open")
-#define LOC_REMOVE_ATTACHMENT hbTrId("txt_messaging_menu_remove_attachment")
-#define LOC_COMMON_DETAILS hbTrId("txt_common_menu_details")
+const QString AUDIO_ICON("qtg_mono_audio");
+const QString ANIMATION_ICON(":/qtg_anim_longtap_2");
 
+const TInt KShowCounterLimit = 10;
 
-MsgUnifiedEditorBody::MsgUnifiedEditorBody( const QString& pluginPath, QGraphicsItem *parent ) :
+MsgUnifiedEditorBody::MsgUnifiedEditorBody( const QString& pluginPath, 
+    QGraphicsItem *parent ) :
 HbWidget(parent),
 mHasImage(false),
 mHasAudio(false),
@@ -83,12 +103,12 @@
     HbStyle::setItemName(mTextEdit,"textEdit");
 
     HbFrameDrawer* frameDrawer = new HbFrameDrawer(EDITOR_FRAME, 
-    		HbFrameDrawer::NinePieces);
+                                                   HbFrameDrawer::NinePieces);
     
     mEditorFrame = new HbFrameItem(frameDrawer,this);
     HbStyle::setItemName(mEditorFrame,"textEditFrame");
     mEditorFrame->setZValue(-1);
-
+    
     // add "Send" action in VKB
     HbEditorInterface editorInterface(mTextEdit);
     HbAction *sendAction = new HbAction(HbIcon(SEND_ICON), QString(),this);
@@ -97,7 +117,7 @@
 
     mGestureFilter = new HbGestureSceneFilter(Qt::LeftButton, this);
     mGestureFilter->setLongpressAnimation(true);
-    HbGesture *gesture = new HbGesture(HbGesture::longpress, 0);
+    HbGesture *gesture = new HbGesture(HbGesture::longpress, 5);
     mGestureFilter->addGesture(gesture);
     connect(gesture, SIGNAL(longPress(QPointF)), this, SLOT(longPressed(QPointF)));
     connect(mTextEdit, SIGNAL(contentsChanged()), this, SLOT(onTextChanged()));
@@ -105,13 +125,54 @@
     mfs.Connect();
     mfs.ShareProtected();
 
-    mMmsInsertCheckOp = new MmsInsertCheckOperation;
+    mMmsConformanceCheck = new MmsConformanceCheck;
+    
+    mCharCounter = new HbTextItem(this);
+    HbStyle::setItemName(mCharCounter, "charCounter");
+    mCharCounter->setZValue(1.5);
+    mCharCounter->setText("160(1)");
+    
+    mBackgroundItem = new HbFrameItem(this);
+    HbStyle::setItemName(mBackgroundItem, "charCounterFrame");
+
+    mBackgroundItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
+    mBackgroundItem->frameDrawer().setFillWholeRect(true);
+    
+    mBackgroundItem->frameDrawer().setFrameGraphicsName(
+        BACKGROUND_FRAME);    
+    
+    mPluginLoader = new UniEditorPluginLoader(this);
+
+    mPluginInterface =
+                        mPluginLoader->getUniEditorPlugin(ConvergedMessage::Sms);    
+    
+    CSmsSettings* settings = CSmsSettings::NewLC();
+    CSmsAccount* account = CSmsAccount::NewLC();
+    account->LoadSettingsL( *settings );
+
+    if( settings->CharacterSet() == TSmsDataCodingScheme::ESmsAlphabetUCS2)
+    {
+    mCharSupportType = TUniSendingSettings::EUniCharSupportFull;
+    }
+    else
+    {
+    mCharSupportType = TUniSendingSettings::EUniCharSupportReduced;
+    }
+    
+    CleanupStack::PopAndDestroy( account );
+    CleanupStack::PopAndDestroy( settings );                
+
+    //Set the mPrevBuffer to NULL initially
+    mPrevBuffer = QString();
+    
+    mCharCounter->setVisible(false);
+    mBackgroundItem->setVisible(false);
 }
 
 MsgUnifiedEditorBody::~MsgUnifiedEditorBody()
 {
     style()->unregisterPlugin(mPluginPath);
-    delete mMmsInsertCheckOp;
+    delete mMmsConformanceCheck;
     delete mProcessImageOperation;
     delete mMediaResolver;
     delete mImageInfo;
@@ -154,11 +215,9 @@
         {
             mMediaResolver->SetCharacterSetRecognition(EFalse);
 
-            RFile file;
-
             HBufC *name = S60QConversions::qStringToS60Desc(imagefile);
-            file.Open(mfs, *name, EFileWrite);
-
+            RFile file = mMediaResolver->FileHandleL(*name);
+     
             TRAP(error,mImageInfo = static_cast<CMsgImageInfo*>
             (mMediaResolver->CreateMediaInfoL(file)));
             if (error == KErrNone)
@@ -189,7 +248,7 @@
 void MsgUnifiedEditorBody::handleSetImage()
 {   
     //check for insert conformance
-    if(EInsertSuccess != mMmsInsertCheckOp->checkModeForInsert(mImageFile))
+    if(EInsertSuccess != mMmsConformanceCheck->checkModeForInsert(mImageFile))
         return;
     
     int msgSize = messageSize();
@@ -220,17 +279,14 @@
     // repolish the body widget
     this->repolish();
 
-    // emit signal to indicate addition of mms content
-    emit mmContentAdded(true);
-
-    // emit signal to indicate new body size
-    emit sizeChanged(bodySize());
+    // emit signal to indicate addition of image
+    emit contentChanged();
 }
 
 void MsgUnifiedEditorBody::setAudio(QString& audiofile)
 {
     //check for insert conformance
-    if(EInsertSuccess != mMmsInsertCheckOp->checkModeForInsert(audiofile))
+    if(EInsertSuccess != mMmsConformanceCheck->checkModeForInsert(audiofile))
         return;
 
     setAudio(true);
@@ -258,31 +314,28 @@
     	return;
     }    
 
-    HbIconItem* audioIcon = new HbIconItem(":/qtg_mono_audio.svg");
+    HbIconItem* audioIcon = new HbIconItem(AUDIO_ICON);
     mAudioItem = new HbPushButton(this);
     mAudioItem->hide();
     HbStyle::setItemName(mAudioItem,"audioItem");
     mAudioItem->setIcon(audioIcon->icon());
     mAudioItem->setText(fileinfo.baseName());
-    //TODO: get actual play-time from utility
-    mAudioItem->setAdditionalText("00:00");
+    MsgMediaUtil mediaUtil;
+    mAudioItem->setAdditionalText(mediaUtil.mediaDuration(mAudioFile));
     mAudioItem->setTextAlignment(Qt::AlignVCenter | Qt::AlignLeft);
     connect(mAudioItem, SIGNAL(longPress(QPointF)), this, SLOT(longPressed(QPointF)));
 
     // repolish the body widget
     this->repolish();
 
-    // emit signal to indicate addition of mms content
-    emit mmContentAdded(true);
-
-    // emit signal to indicate new body size
-    emit sizeChanged(bodySize());
+    // emit signal to indicate addition of audio
+    emit contentChanged();
 }
 
 void MsgUnifiedEditorBody::setVideo(QString& videofile)
 {
     //check for insert conformance
-    if(EInsertSuccess != mMmsInsertCheckOp->checkModeForInsert(videofile))
+    if(EInsertSuccess != mMmsConformanceCheck->checkModeForInsert(videofile))
         return;
 
     // update the media file-list
@@ -307,11 +360,8 @@
     // repolish the body widget
     this->repolish();
 
-    // emit signal to indicate addition of mms content
-    emit mmContentAdded(true);
-
-    // emit signal to indicate new body size
-    emit sizeChanged(bodySize());
+    // emit signal to indicate addition of video
+    emit contentChanged();
 }
 
 void MsgUnifiedEditorBody::setText(QString& text)
@@ -445,9 +495,9 @@
 void MsgUnifiedEditorBody::longPressed(QPointF position)
 {
     HbMenu* menu = new HbMenu;
-    menu->addAction(LOC_COMMON_OPEN, this, SLOT(openMedia()));
-    menu->addAction(LOC_REMOVE_ATTACHMENT, this, SLOT(removeMedia()));
-    menu->addAction(LOC_COMMON_DETAILS, this, SLOT(viewDetails()));
+    menu->addAction(LOC_OPEN, this, SLOT(openMedia()));
+    menu->addAction(LOC_REMOVE, this, SLOT(removeMedia()));
+    menu->addAction(LOC_DETAILS, this, SLOT(viewDetails()));
 
     menu->setDismissPolicy(HbPopup::TapAnywhere);
     menu->setAttribute(Qt::WA_DeleteOnClose, true);
@@ -495,16 +545,89 @@
     }
 
     this->repolish();
-	emit mmContentAdded(false);
 
-    // emit signal to indicate new body size
-    emit sizeChanged(bodySize());
+	emit contentChanged();
 }
 
+//---------------------------------------------------------------
+// MsgUnifiedEditorBody :: openMedia
+// @see header file
+//---------------------------------------------------------------
 void MsgUnifiedEditorBody::openMedia()
 {
-    //open corresponding viewer app.
+    HbAction* action = qobject_cast<HbAction*>(sender());
+    QString objName = action->parent()->objectName();
+    
+    QString fileName;
+    if ( objName == IMAGE_REGION )
+    {
+        fileName = mImageFile;
+    }
+    else if ( objName == AUDIO_REGION )
+    {
+        fileName = mAudioFile;
+    }
+    else
+    {
+        return;
+    }
+    
+    XQSharableFile sf;
+    XQAiwRequest* request = 0;
+
+    if ( !sf.open(fileName) ) 
+        {
+        return;
+        }
+
+    // Get handlers
+    XQApplicationManager appManager;
+    QList<XQAiwInterfaceDescriptor> fileHandlers = appManager.list(sf);
+    if (fileHandlers.count() > 0)
+        {
+        XQAiwInterfaceDescriptor d = fileHandlers.first();
+        request = appManager.create(sf, d);
+    
+        if ( !request )
+            {
+            sf.close();
+            return ;
+            }
+        }
+    else
+        {
+        sf.close();
+        return;
+        }
+
+    // Result handlers
+    connect (request, SIGNAL(requestOk(const QVariant&)), 
+            this, SLOT(handleOk(const QVariant&)));
+    connect (request, SIGNAL(requestError(const QVariant&)), 
+            this, SLOT(handleError(const QVariant&)));
+
+    request->setEmbedded(true);
+    request->setSynchronous(true);
+
+    // Fill args
+    QList<QVariant> args;
+    args << qVariantFromValue(sf);
+    request->setArguments(args);
+
+    // Fill headers
+    QString key("WindowTitle");
+    QVariant value(QString(LOC_TITLE));
+    XQRequestInfo info;
+    info.setInfo(key, value);
+    request->setInfo(info);
+    
+    request->send();
+    
+    // Cleanup
+    sf.close();
+    delete request;
 }
+
 void MsgUnifiedEditorBody::viewDetails()
 {
     //open details view.
@@ -584,9 +707,62 @@
 }
 
 void MsgUnifiedEditorBody::onTextChanged()
-{
-    // emit signal to indicate new body size
-    emit sizeChanged(bodySize());
+{   
+    QString string = text();
+    
+    if(  !mPrevBuffer.isEmpty() &&
+         string.size() > mPrevBuffer.size() &&
+         MsgMonitor::messageType() == ConvergedMessage::Mms )
+    {
+        //Save the previous buffer
+        mPrevBuffer = string;
+        // emit signal to indicate change in content
+        emit contentChanged();
+                
+        return;
+    }
+
+    //Check done for optimization
+    //Only if content is deleted we need to call encodingsettings again
+    if (mPrevBuffer.isEmpty() || string.size() <= mPrevBuffer.size())
+    {
+        mPluginInterface->setEncodingSettings(EFalse, ESmsEncodingNone,
+            mCharSupportType);
+    }
+
+    TInt numOfRemainingChars;
+    TInt numOfPDUs;
+    TBool unicodeMode;
+    TSmsEncoding alternativeEncodingType;
+    mPluginInterface->getNumPDUs(string, numOfRemainingChars, numOfPDUs,
+        unicodeMode, alternativeEncodingType);
+
+    //Save the unicode value returned
+    mUnicode = unicodeMode;
+    //Save the old buffer
+    mPrevBuffer = string;
+    
+    // emit signal to indicate change in content
+    emit contentChanged();
+    
+    if(MsgMonitor::messageType() == ConvergedMessage::Sms)
+    {
+        //Set char counter value
+        QString display = QString("%1(%2)").arg(numOfRemainingChars).arg(
+            numOfPDUs);
+        mCharCounter->setText(display);
+        
+        if (numOfPDUs > 1 || numOfRemainingChars <= KShowCounterLimit)
+        {
+            mCharCounter->setVisible(true);
+            mBackgroundItem->setVisible(true);
+        }
+        else
+        {
+            mCharCounter->setVisible(false);
+            mBackgroundItem->setVisible(false);
+        }
+    }
 }
 
 void MsgUnifiedEditorBody::EditorOperationEvent(
@@ -625,7 +801,7 @@
     mIconItem->setAlignment(Qt::AlignHCenter | Qt::AlignTop);
     mIconItem->setIcon(animIcon);
 
-    mImageFile = ":/qtg_anim_longtap_2.svg";
+    mImageFile = ANIMATION_ICON;
     HbIconAnimator animator;
     animator.setIcon(animIcon);
 
@@ -642,4 +818,43 @@
     }   
 }
 
+// ---------------------------------------------------------
+// MsgUnifiedEditorBody::isUnicode
+// ---------------------------------------------------------
+//
+bool MsgUnifiedEditorBody::isUnicode()
+{
+    return mUnicode;
+}
+
+// ---------------------------------------------------------
+// MsgUnifiedEditorBody::disableCharCounter
+// ---------------------------------------------------------
+//
+void MsgUnifiedEditorBody::disableCharCounter()
+{
+    mCharCounter->setVisible(false);
+    mBackgroundItem->setVisible(false);
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorBody :: handleOk
+// @see header file
+//---------------------------------------------------------------
+void MsgUnifiedEditorBody::handleOk(const QVariant& result)
+{
+    Q_UNUSED(result)
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorBody :: handleError
+// @see header file
+//---------------------------------------------------------------
+void MsgUnifiedEditorBody::handleError(int errorCode, 
+    const QString& errorMessage)
+{
+    Q_UNUSED(errorMessage)
+    Q_UNUSED(errorCode)
+}
+
 // EOF
--- a/messagingapp/msgui/unifiededitor/src/msgunieditorprocessimageoperation.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/src/msgunieditorprocessimageoperation.cpp	Mon May 03 12:29:07 2010 +0300
@@ -416,7 +416,7 @@
     
     if ( conformance.iCanAdapt == EFalse )
         {
-        return ETrue;
+        return EFalse;
         }
         
     TSize origSize = iImageInfo->Dimensions();
@@ -505,8 +505,7 @@
     //Large image query     
     if( largeImageQuery && iMmsCreationMode == EMmsCreationModeWarning)
     {
-        if(!HbMessageBox::
-                    launchQuestionMessageBox(LOC_LARGE_IMAGE_NOTE))
+        if(!HbMessageBox::question(LOC_LARGE_IMAGE_NOTE))
         {
             return EFalse; // Abort
         }
--- a/messagingapp/msgui/unifiededitor/src/msgunieditorsubject.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/src/msgunieditorsubject.cpp	Mon May 03 12:29:07 2010 +0300
@@ -17,17 +17,20 @@
 
 // INCLUDES
 #include "debugtraces.h"
-#include <HbTextItem>
-#include <HbLineEdit>
 #include <HbIconItem>
 
 // USER INCLUDES
 #include "msgunieditorsubject.h"
 #include "UniEditorGenUtils.h"
+#include "msgunifiededitorlineedit.h"
 
 // Localized Constants
 #define LOC_SUBJECT hbTrId("txt_messaging_formlabel_subject")
 
+//priority icon
+const QString HIGH_PRIORITY("qtg_small_priority_high");
+const QString LOW_PRIORITY("qtg_small_priority_low");
+
 //---------------------------------------------------------------
 // MsgUnifiedEditorSubject::MsgUnifiedEditorSubject
 // @see header file
@@ -36,6 +39,7 @@
 HbWidget(parent),
 mPluginPath(pluginPath),
 mPriorityIcon(NULL),
+mPriority(ConvergedMessage::Normal),
 mGenUtils(0)
 {
 #ifdef _DEBUG_TRACES_
@@ -44,18 +48,16 @@
 
         setPluginBaseId(style()->registerPlugin(mPluginPath));
 
-        mSubjectLabel = new HbTextItem(LOC_SUBJECT,this);
-        HbStyle::setItemName(mSubjectLabel,"subjectLabel");
-
-        mSubjectEdit = new HbLineEdit(this);
+        mSubjectEdit = new MsgUnifiedEditorLineEdit(LOC_SUBJECT,this);
+        mSubjectEdit->setDefaultBehaviour(true);        
         HbStyle::setItemName(mSubjectEdit,"subjectEdit");
         mSubjectEdit->setMinRows(1);
         mSubjectEdit->setMaxRows(10);
         
         mGenUtils = new UniEditorGenUtils();
         
-        connect(mSubjectEdit, SIGNAL(textChanged(const QString&)),
-                this, SLOT(onTextChanged(const QString&)));
+        connect(mSubjectEdit, SIGNAL(contentsChanged(const QString&)),
+                this, SLOT(onContentsAdded(const QString&)));
 }
 
 //---------------------------------------------------------------
@@ -82,47 +84,32 @@
         delete mPriorityIcon;
         mPriorityIcon = NULL;
     }
-    else
-    {// Transition from normal
-        if(mPriority == ConvergedMessage::Normal)
-        {// to normal
-            return;
-        }
-        else
-        {// to high/low
-            emit mmContentAdded(true);
-        }
-    }
 
     switch(priority)
     {
         case ConvergedMessage::High :
         {
-        mPriorityIcon = new HbIconItem(":/qtg_small_priority_high.svg", this);
+        mPriorityIcon = new HbIconItem(HIGH_PRIORITY, this);
         HbStyle::setItemName(mPriorityIcon,"priorityIcon");
         }
         break;
         case ConvergedMessage::Low :
         {
-        mPriorityIcon = new HbIconItem(":/qtg_small_priority_low.svg", this);
+        mPriorityIcon = new HbIconItem(LOW_PRIORITY, this);
         HbStyle::setItemName(mPriorityIcon,"priorityIcon");
         }
         break;
-        case ConvergedMessage::Normal :
-        {
-            emit mmContentAdded(false);
-        }
-        break;
         default:
         break;
     }
 
+    emit contentChanged();
     this->repolish();
 }
 
 QString MsgUnifiedEditorSubject::text()
 {
-    return mSubjectEdit->text();
+    return mSubjectEdit->content();
 }
 
 ConvergedMessage::Priority MsgUnifiedEditorSubject::priority()
@@ -130,33 +117,33 @@
 	return mPriority;
 }
 
-void MsgUnifiedEditorSubject::onTextChanged(const QString& text)
+void MsgUnifiedEditorSubject::onContentsAdded(const QString& text)
 {
     if(!text.isEmpty())
     {
-        disconnect(mSubjectEdit, SIGNAL(textChanged(const QString&)),
-                this, SLOT(onTextChanged(const QString&)));
+        disconnect(mSubjectEdit, SIGNAL(contentsChanged(const QString&)),
+                this, SLOT(onContentsAdded(const QString&)));
         if(!subjectOkInSms())
         {
-            emit mmContentAdded(true);
+            emit contentChanged();
         }
-        connect(mSubjectEdit, SIGNAL(textChanged(const QString&)),
-                this, SLOT(onTextRemoved(const QString&)));
+        connect(mSubjectEdit, SIGNAL(contentsChanged(const QString&)),
+                this, SLOT(onContentsRemoved(const QString&)));
     }
 }
 
-void MsgUnifiedEditorSubject::onTextRemoved(const QString& text)
+void MsgUnifiedEditorSubject::onContentsRemoved(const QString& text)
 {
     if(text.isEmpty())
     {
-        disconnect(mSubjectEdit, SIGNAL(textChanged(const QString&)),
-            this, SLOT(onTextRemoved(const QString&)));
+        disconnect(mSubjectEdit, SIGNAL(contentsChanged(const QString&)),
+            this, SLOT(onContentsRemoved(const QString&)));
         if(!subjectOkInSms())
         {
-            emit mmContentAdded(false);
+            emit contentChanged();
         }
-        connect(mSubjectEdit, SIGNAL(textChanged(const QString&)),
-                this, SLOT(onTextChanged(const QString&)));
+        connect(mSubjectEdit, SIGNAL(contentsChanged(const QString&)),
+                this, SLOT(onContentsAdded(const QString&)));
     }
 }
 
@@ -170,7 +157,7 @@
 
 int MsgUnifiedEditorSubject::subjectSize()
 {
-    return mGenUtils->UTF8Size(mSubjectEdit->text());
+    return mGenUtils->UTF8Size(mSubjectEdit->content());
 }
 
 void MsgUnifiedEditorSubject::setText(const QString& text)
--- a/messagingapp/msgui/unifiededitor/src/msgunieditorview.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/src/msgunieditorview.cpp	Mon May 03 12:29:07 2010 +0300
@@ -16,7 +16,7 @@
  */
 
 // SYSTEM INCLUDES
-#include <HbWidget>
+#include <e32base.h>
 #include <HbMenu>
 #include <HbAction>
 #include <HbToolBar>
@@ -25,6 +25,27 @@
 #include <HbScrollArea>
 #include <QDateTime>
 #include <QDir>
+#include <QBuffer>
+#include <QFile>
+#include <QFileInfo>
+#include <xqconversions.h>
+#include <HbToolBarExtension>
+#include <HbListWidget>
+#include <HbFrameBackground>
+#include <HbListViewItem>
+#include <HbListWidgetItem>
+#include <HbNotificationDialog>
+#include <HbMessageBox>
+#include <xqaiwrequest.h>
+#include <xqappmgr.h>
+
+// QT Mobility for fetching business card
+#include <qversitwriter.h>
+#include <qversitdocument.h>
+#include <qcontact.h>
+#include <qcontactmanager.h>
+#include <qversitcontactexporter.h>
+#include <cntservicescontact.h>
 
 // USER INCLUDES
 #include "debugtraces.h"
@@ -32,61 +53,88 @@
 #include "msgunieditoraddress.h"
 #include "msgunieditorsubject.h"
 #include "msgunieditorbody.h"
-#include "msgtypenotifier.h"
 #include "msgmonitor.h"
 #include "msgattachmentcontainer.h"
-#include "msguiutilsmanager.h"
+#include "msgsendutil.h"
 #include "convergedmessageaddress.h"
-#include "matchphnumberutil.h"
 #include "unieditorgenutils.h"
 #include "unieditorpluginloader.h"
 #include "unieditorplugininterface.h"
 
 // Constants
-const QString SEND_ICON(":/qtg_mono_send.svg");
-const QString ATTACH_ICON(":/qtg_mono_attach.svg");
+const QString SEND_ICON("qtg_mono_send");
+const QString ATTACH_ICON("qtg_mono_attach");
+// temporary folder for unieditor
+const QString UNIFIED_EDITOR_TEMP_FOLDER("unifiededitor");
 
 const int INVALID_MSGID = -1;
+// vcard file extn.
+const QString FILE_EXTN(".vcf");
+// Max vcards inside a msg. Using a very large number.
+// TODO: how we can avoid this?
+const int MAX_VCARDS(1000);
 
 // LOCALIZED CONSTANTS
-#define LOC_TO hbTrId("txt_messaging_formlabel_to")
+//To,Cc.Bcc
+#define LOC_TO  hbTrId("txt_messaging_formlabel_to")
+#define LOC_CC hbTrId("txt_messaging_formlabel_cc")
+#define LOC_BCC hbTrId("txt_messaging_formlabel_bcc")
+
+//attach options
+#define LOC_PHOTO           hbTrId("txt_messaging_button_photo")
+#define LOC_SOUND           hbTrId("txt_messaging_button_sound")
+#define LOC_BUSINESS_CARD   hbTrId("txt_messaging_button_business_card")
+
+//options menu.
+#define LOC_ADD_SUBJECT     hbTrId("txt_messaging_opt_add_subject")
+#define LOC_ADD_CC_BCC      hbTrId("txt_messaging_opt_add_cc_bcc")
+#define LOC_PRIORITY        hbTrId("txt_messaging_setlabel_priority")
+#define LOC_SENDING_OPTIONS hbTrId("txt_messaging_opt_sending_options")
+#define LOC_DELETE_MESSAGE  hbTrId("txt_messaging_opt_delete_message")
+
+//priority sub menu
 #define LOC_HIGH hbTrId("txt_messaging_setlabel_priority_val_high")
 #define LOC_NORMAL hbTrId("txt_messaging_setlabel_priority_val_normal")
 #define LOC_LOW hbTrId("txt_messaging_setlabel_priority_val_low")
-#define LOC_SENDING_OPTIONS hbTrId("txt_messaging_opt_sending_options")
+
+//group box
+#define LOC_OTHER_RECIPIENTS(n) hbTrId("txt_messaging_group_title_ln_other_recipients",n)
+
+//saved to draft note
+#define LOC_SAVED_TO_DRAFTS    hbTrId("txt_messaging_dpopinfo_saved_to_drafts")
 
-#define LOC_DELETE_MESSAGE hbTrId("txt_messaging_opt_delete_message")
-#define LOC_CC hbTrId("txt_messaging_formlabel_cc")
-#define LOC_BCC hbTrId("txt_messaging_formlabel_bcc")
-#define LOC_OTHER_RECIPIENTS hbTrId("txt_messaging_group_title_ln_other_recipients")
+//delete confermation
+#define LOC_NOTE_DELETE_MESSAGE hbTrId("txt_messaging_dialog_delete_message")
+#define LOC_BUTTON_DELETE       hbTrId("txt_common_button_delete")
+#define LOC_BUTTON_CANCEL       hbTrId("txt_common_button_cancel")
+#define LOC_DIALOG_OK           hbTrId("txt_common_button_ok")
 
-#define LOC_PHOTO hbTrId("txt_messaging_button_photo")
-#define LOC_VIDEO hbTrId("txt_messaging_button_video")
-#define LOC_SOUND hbTrId("txt_messaging_button_sound")
-#define LOC_MORE hbTrId("txt_messaging_button_more")
+//extension list item frame.
+const QString POPUP_LIST_FRAME("qtg_fr_popup_list_normal");
+
+// LOCAL FUNCTIONS
+QString editorTempPath();
 
 //---------------------------------------------------------------
 // MsgUnifiedEditorView::MsgUnifiedEditorView
 // @see header file
 //---------------------------------------------------------------
 MsgUnifiedEditorView::MsgUnifiedEditorView( QGraphicsItem *parent ) :
-MsgBaseView(parent),
-mSubjectAction(0),
-mCcBccAction(0),
-mMainLayout(0),
-mSubjectField(0),
-mToField(0),
-mCcField(0),
-mBccField(0),
-mBody(0),
-mPrioritySubMenu(0),
-mContentWidget(0),
-mNotifier(0),
-mMsgMonitor(0),
-mUtilsManager(0),
-mAttachmentContainer(0),
-mPluginLoader(0)
-{
+    MsgBaseView(parent),
+    mSubjectAction(0),
+    mCcBccAction(0),
+    mMainLayout(0),
+    mSubjectField(0),
+    mToField(0),
+    mCcField(0),
+    mBccField(0),
+    mBody(0),
+    mContentWidget(0),
+    mMsgMonitor(0),    
+    mAttachmentContainer(0),
+    mPluginLoader(0),
+    mCanSaveToDrafts(true)
+    {
     addMenu();
     addToolBar();
 
@@ -96,20 +144,18 @@
     mContentWidget = new HbWidget(this);
     scrollArea->setContentWidget(mContentWidget);
 
-    mPluginPath = pluginPath();
+    mPluginPath = pluginPath(); 
 
     mMainLayout = new QGraphicsLinearLayout(Qt::Vertical, mContentWidget);
-    mMainLayout->setContentsMargins(0,0,0,0);
-
-    //Adding suitable spacing between the Custom Widgets
+    qreal vTopSpacing = 0.0;
     qreal vItemSpacing = 0.0;
+    style()->parameter("hb-param-margin-gene-top",vTopSpacing);    
     style()->parameter("hb-param-margin-gene-middle-vertical",vItemSpacing);
+    
+    mMainLayout->setContentsMargins(0,vTopSpacing,0,0);
     mMainLayout->setSpacing(vItemSpacing);
 
-    // notifier for recording msg type transitions between sms & mms
-    mNotifier = new MsgTypeNotifier(this);
-    mMsgMonitor = new MsgMonitor(this);
-    mUtilsManager = new MsgUiUtilsManager(this);
+    mMsgMonitor = new MsgMonitor(this);    
 
     mToField = new MsgUnifiedEditorAddress( LOC_TO, mPluginPath, mContentWidget );
     mBody = new MsgUnifiedEditorBody(mPluginPath, mContentWidget);
@@ -119,18 +165,27 @@
  
     //Set the invalid msg id
     mOpenedMessageId.setId(-1);
-    
+
+    // create editor's temp folder
+    QDir tempDir = QDir(QString());
+    QString tempPath(editorTempPath());
+    if(tempDir.mkpath(tempPath))
+    {
+        tempDir.cd(tempPath);
+        // remove stale folder content when freshly launched
+        QStringList contentList(tempDir.entryList());
+        int contentCount = contentList.count();
+        for(int i=0; i<contentCount; i++)
+        {
+            tempDir.remove(contentList.at(i));
+        }
+    }
+
     connect(mToField, SIGNAL(sendMessage()), this, SLOT(send()));
     connect(mBody, SIGNAL(sendMessage()), this, SLOT(send()));
-    connect(mBody, SIGNAL(mmContentAdded(bool)),
-                     mNotifier, SLOT(onMMContentAdded(bool)));
-    connect(mBody, SIGNAL(sizeChanged(int)),
-                     mMsgMonitor, SLOT(onSizeChanged(int)));
-    connect(mUtilsManager, SIGNAL(imagesFetched(const QVariant&)),
-                     this, SLOT(imagesFetched(const QVariant&)));
-    connect(mUtilsManager, SIGNAL(audiosFetched(const QVariant&)),
-                     this, SLOT(audiosFetched(const QVariant&)));
-}
+    connect(mBody, SIGNAL(contentChanged()),
+            mMsgMonitor, SLOT(checkMsgTypeChange()));
+    }
 
 //---------------------------------------------------------------
 // MsgUnifiedEditorView::~MsgUnifiedEditorView
@@ -138,6 +193,18 @@
 //---------------------------------------------------------------
 MsgUnifiedEditorView::~MsgUnifiedEditorView()
 {
+    // clean editor's temporary contents before exiting
+    QDir tempDir = QDir(QString());
+    QString tempPath(editorTempPath());
+    tempDir.cd(tempPath);
+    QStringList contentList(tempDir.entryList());
+    int contentCount = contentList.count();
+    for(int i=0; i<contentCount; i++)
+    {
+        tempDir.remove(contentList.at(i));
+    }
+    tempDir.cdUp();
+    tempDir.rmdir(UNIFIED_EDITOR_TEMP_FOLDER);
 }
 
 void MsgUnifiedEditorView::addMenu()
@@ -146,23 +213,22 @@
     HbMenu* mainMenu = new HbMenu();
 
     //TODO:These 2 should be submenu option to Add
-    mSubjectAction = mainMenu->addAction(tr("Add Subject"));
-    mCcBccAction = mainMenu->addAction(tr("Add Cc/Bcc"));
+    mSubjectAction = mainMenu->addAction(LOC_ADD_SUBJECT);
+    mCcBccAction = mainMenu->addAction(LOC_ADD_CC_BCC);
     
-    mPrioritySubMenu = mainMenu->addMenu(tr("Add Priority"));
+    HbMenu* prioritySubMenu = mainMenu->addMenu(LOC_PRIORITY);
 
-    HbAction* highPriorityAction = mPrioritySubMenu->addAction(LOC_HIGH);
+    HbAction* highPriorityAction = prioritySubMenu->addAction(LOC_HIGH);
     highPriorityAction->setData(ConvergedMessage::High);
 
-    HbAction* normalPriorityAction = mPrioritySubMenu->addAction(LOC_NORMAL);
+    HbAction* normalPriorityAction = prioritySubMenu->addAction(LOC_NORMAL);
     normalPriorityAction->setData(ConvergedMessage::Normal);
 
-    HbAction* lowPriorityAction = mPrioritySubMenu->addAction(LOC_LOW);
+    HbAction* lowPriorityAction = prioritySubMenu->addAction(LOC_LOW);
     lowPriorityAction->setData(ConvergedMessage::Low);
 
     HbAction* sendOptionsAction = mainMenu->addAction(LOC_SENDING_OPTIONS);
     HbAction* deleteMsgAction = mainMenu->addAction(LOC_DELETE_MESSAGE);
-    HbAction* helpAction = mainMenu->addAction(tr("Help"));
 
     connect(mSubjectAction,SIGNAL(triggered()),this, SLOT(addSubject()));
     connect(mCcBccAction,SIGNAL(triggered()),this, SLOT(addCcBcc()));
@@ -171,127 +237,195 @@
     connect(lowPriorityAction, SIGNAL(triggered()), this, SLOT(changePriority()));
     connect(sendOptionsAction,SIGNAL(triggered()),this, SLOT(sendingOptions()));
     connect(deleteMsgAction,SIGNAL(triggered()),this, SLOT(deleteMessage()));
-    connect(helpAction,SIGNAL(triggered()),this, SLOT(launchHelp()));
 
     setMenu(mainMenu);
 }
 
-void MsgUnifiedEditorView::openDraftsMessage(ConvergedMessageId& messageId,
-    ConvergedMessage::MessageType messageType )
+void MsgUnifiedEditorView::openDraftsMessage(const QVariantList& editorData)
 {
+    // unpack editor's data
+    // first arg is convergedmessage
+    QByteArray dataArray = editorData.at(0).toByteArray();
+    ConvergedMessage* messageDetails = new ConvergedMessage;
+    QDataStream stream(&dataArray, QIODevice::ReadOnly);
+    messageDetails->deserialize(stream);
+    ConvergedMessage::MessageType messageType = messageDetails->messageType();
+    ConvergedMessageId messageId = *(messageDetails->id());
+    delete messageDetails;
+
     if(!mPluginLoader)
     {
         mPluginLoader = new UniEditorPluginLoader(this);
-        mPluginLoader->loadPlugins();
     }
-    
+
     UniEditorPluginInterface* pluginInterface =
         mPluginLoader->getUniEditorPlugin(messageType);
-    
+
     mOpenedMessageId.setId(messageId.getId());
     mmOpenedMessageType = messageType;
 
     //Fetch the converged message from the msgId
     ConvergedMessage* msg;
     msg = pluginInterface->convertFrom(messageId.getId());
-    
+
     if( msg != NULL )
-    {    
+    {
         //Populate the content inside editor
-        populateDraftsContent(*msg);
+        populateContentIntoEditor(*msg);
+        delete msg;
+    }
+}
+
+void MsgUnifiedEditorView::forwardMessage(ConvergedMessageId& messageId,
+    ConvergedMessage::MessageType messageType )
+{
+    if(!mPluginLoader)
+    {
+        mPluginLoader = new UniEditorPluginLoader(this);
+  
+    }
+    UniEditorPluginInterface* pluginInterface = NULL;
+    if( messageType == ConvergedMessage::Mms )
+    {
+        pluginInterface =
+                mPluginLoader->getUniEditorPlugin(ConvergedMessage::Mms);
+    }
+    else // For sms,vcard,vcal cases
+    {
+        pluginInterface =
+                mPluginLoader->getUniEditorPlugin(ConvergedMessage::Sms);
+    }
+
+    //Fetch the converged message from the msgId
+    ConvergedMessage* msg;
+    msg = pluginInterface->convertFrom(messageId.getId(),
+        UniEditorPluginInterface::Forward);
+
+    if( msg != NULL )
+    {
+        //Populate the content inside editor
+        populateContentIntoEditor(*msg);
         delete msg;
     }
 }
 
-void MsgUnifiedEditorView::populateContent(const ConvergedMessage& messageDetails, int editorFields)
+void MsgUnifiedEditorView::populateContent(const QVariantList& editorData)
 {
-    mToField->setAddresses(messageDetails.toAddressList());
-    QString bodyTxt = messageDetails.bodyText();
-    mBody->setText(bodyTxt);
+    // unpack editor's data
+    // first arg is convergedmessage
+    QByteArray dataArray = editorData.at(0).toByteArray();
+    ConvergedMessage* messageDetails = new ConvergedMessage;
+    QDataStream stream(&dataArray, QIODevice::ReadOnly);
+    messageDetails->deserialize(stream);
 
-    int attachmentCount = messageDetails.attachments().count();
-    if(attachmentCount == 1)
+    // get next arg i.e. editor operation command
+    int editorOp = 0;
+    if(editorData.length() > 1)
     {
-        int imageSize=0;
-        QString mimeType;
-        TMsgMediaType mediaType = EMsgMediaUnknown;
-        QString filePath = messageDetails.attachments().at(0)->filePath();
-        UniEditorGenUtils* genUtils = new UniEditorGenUtils;
-        TRAP_IGNORE(genUtils->getFileInfoL(filePath,imageSize,
-                                           mimeType,mediaType));
-        delete genUtils;
-        switch(mediaType)
+        editorOp = editorData.at(1).toInt();
+    }
+
+    // population logic based on editor Operation command
+    switch(editorOp)
+    {
+        case MsgBaseView::ADD_RECIPIENTS:
+        {
+            addCcBcc();
+        }
+        break;
+        case MsgBaseView::ADD_SUBJECT:
+        {
+            addSubject();
+        }
+        break;
+        case MsgBaseView::ADD_VCARD:
+        {
+            contactsFetched(editorData.at(2));
+        }
+        break;
+        case MsgBaseView::FORWARD_MSG:
         {
-            case EMsgMediaImage:
+            forwardMessage(*messageDetails->id(), messageDetails->messageType());
+        }
+        break;
+        default:
+        break;
+    }
+
+    // additional common operations for non-forwarded messages
+    if(editorOp != MsgBaseView::FORWARD_MSG)
+    {
+        mToField->setAddresses(messageDetails->toAddressList());
+        QString bodyTxt = messageDetails->bodyText();
+        mBody->setText(bodyTxt);
+
+        int attachmentCount = messageDetails->attachments().count();
+        QStringList pendingAttList;
+        for(int i=0; i<attachmentCount; i++)
+        {
+            int imageSize=0;
+            QString mimeType;
+            TMsgMediaType mediaType = EMsgMediaUnknown;
+            QString filePath = messageDetails->attachments().at(i)->filePath();
+            UniEditorGenUtils* genUtils = new UniEditorGenUtils;
+            TRAP_IGNORE(genUtils->getFileInfoL(filePath,imageSize,
+                                           mimeType,mediaType));
+            delete genUtils;
+            switch(mediaType)
             {
-                mBody->setImage(filePath);
-                break;
-            }
-            case EMsgMediaVideo:
-            {
-                mBody->setVideo(filePath);
+                case EMsgMediaImage:
+                {
+                    mBody->setImage(filePath);
+                    addSubject();
+                }
                 break;
-            }
-            case EMsgMediaAudio:
-            {
-                mBody->setAudio(filePath);
+                case EMsgMediaVideo:
+                {
+                    mBody->setVideo(filePath);
+                    addSubject();
+                }
                 break;
-            }
-            case EMsgMediaUnknown:
-            case EMsgMediaText:
-            default:
-            {
-                addAttachment(filePath);
+                case EMsgMediaAudio:
+                {
+                    mBody->setAudio(filePath);
+                    addSubject();
+                }
+                break;
+                default:
+                {
+                    pendingAttList << filePath;
+                }
                 break;
             }
         }
-        
-        addSubject();
-	}
-	else if(attachmentCount > 1)
-	{
-		for(int i=0; i<attachmentCount; i++)
-		{
-		    QString filePath = messageDetails.attachments().at(i)->filePath();
-		    //TODO: put size checks and show size exceeded msg when appropriate
-		    addAttachment(filePath);
-		}
-		
-		addSubject();
-	}
-
-	if(editorFields & MsgBaseView::ADD_RECIPIENTS)
-	{
-		addCcBcc();
-	}
-	else if(editorFields & MsgBaseView::ADD_SUBJECT)
-  {
-		addSubject();
-	}    
+        // add pending attachments in bulk
+        addAttachments(pendingAttList);
+    }
+    delete messageDetails;
 }
 
-void MsgUnifiedEditorView::populateDraftsContent(
+void MsgUnifiedEditorView::populateContentIntoEditor(
     const ConvergedMessage& messageDetails)
 {
     // skip first-time MMS type switch note for draft
-    mNotifier->setSkipNote();
+    mMsgMonitor->setSkipNote(true);
     mToField->setAddresses(messageDetails.toAddressList());
     if(messageDetails.ccAddressList().count() > 0 )
-    {   
+    {
         if(!mCcField)
-        {    
+        {
         addCcBcc();
         }
         mCcField->setAddresses(messageDetails.ccAddressList());
-    }   
+    }
     if(messageDetails.bccAddressList().count() > 0 )
-    {   
+    {
         if(!mBccField)
-        {    
+        {
         addCcBcc();
         }
         mBccField->setAddresses(messageDetails.bccAddressList());
-    }    
+    }
     if(messageDetails.subject().size() > 0)
     {
        if(!mSubjectField)
@@ -300,8 +434,8 @@
        }
        mSubjectField->setText(messageDetails.subject());
     }
-    
-    if(messageDetails.priority()==ConvergedMessage::High || 
+
+    if(messageDetails.priority()==ConvergedMessage::High ||
             messageDetails.priority() == ConvergedMessage::Low)
     {
         if(!mSubjectField)
@@ -310,26 +444,27 @@
         }
         mSubjectField->setPriority(messageDetails.priority());
     }
-    
+
     QString bodyTxt = messageDetails.bodyText();
     mBody->setText(bodyTxt);
 
-    ConvergedMessageAttachmentList attachmentList = 
+    ConvergedMessageAttachmentList attachmentList =
         messageDetails.attachments();
     int attachmentCount = attachmentList.count();
-    
+
     UniEditorGenUtils* genUtils = new UniEditorGenUtils;
-                       
+
+    QStringList pendingAttList;
     for( int i=0; i < attachmentCount; i++ )
     {
         QString filePath = messageDetails.attachments().at(i)->filePath();
 
-        if(attachmentList.at(i)->attachmentType() == 
+        if(attachmentList.at(i)->attachmentType() ==
             ConvergedMessageAttachment::EInline)
         {
             int imageSize=0;
             QString mimeType;
-            TMsgMediaType mediaType = EMsgMediaUnknown;    
+            TMsgMediaType mediaType = EMsgMediaUnknown;
             TRAP_IGNORE(genUtils->getFileInfoL(filePath,imageSize,
                 mimeType,mediaType));
 
@@ -338,33 +473,39 @@
                 case EMsgMediaImage:
                 {
                     mBody->setImage(filePath);
+                    addSubject();
                     break;
                 }
                 case EMsgMediaVideo:
                 {
                     mBody->setVideo(filePath);
+                    addSubject();
                     break;
                 }
                 case EMsgMediaAudio:
                 {
                     mBody->setAudio(filePath);
+                    addSubject();
                     break;
                 }
-                case EMsgMediaUnknown:
-                case EMsgMediaText:
                 default:
                 {
-                    addAttachment(filePath);
+                    pendingAttList << filePath;
                     break;
                 }
             }
         }
         else
         {
-            addAttachment(filePath);
+            pendingAttList << filePath;
         }
-    }    
+    }
+    // add pending attachments to editor
+    addAttachments(pendingAttList);
+
     delete genUtils;
+    // ensure that any msg-type change after this are shown
+    mMsgMonitor->setSkipNote(false);
 }
 
 void MsgUnifiedEditorView::addToolBar()
@@ -372,13 +513,30 @@
     //Create Tool Bar
     HbToolBar *toolBar = new HbToolBar();
     toolBar->setOrientation(Qt::Horizontal);
+    
+    //tool bar extension for attach action.
+    HbToolBarExtension* attachExtension = new HbToolBarExtension();
+    HbAction *attachAction = toolBar->addExtension(attachExtension);    
+    attachAction->setIcon(HbIcon(ATTACH_ICON));
+    
+    HbListWidget* extnList = new HbListWidget();
+    extnList->addItem(LOC_PHOTO);
+    extnList->addItem(LOC_SOUND);
+    extnList->addItem(LOC_BUSINESS_CARD);
+
+    HbListViewItem *prototype = extnList->listItemPrototype();
+    HbFrameBackground frame(POPUP_LIST_FRAME, HbFrameDrawer::NinePieces);
+    prototype->setDefaultFrame(frame);
+
+    connect(extnList, SIGNAL(activated(HbListWidgetItem*)), this,
+            SLOT(handleViewExtnActivated(HbListWidgetItem*)));
+    connect(extnList, SIGNAL(activated(HbListWidgetItem*)), attachExtension, SLOT(close()));
+
+    attachExtension->setContentWidget(extnList);
 
     //Add Action to the toolbar and show toolbar
-    HbAction* attachToolButton = toolBar->addAction(HbIcon(ATTACH_ICON), QString());
-    HbAction* sendToolButton = toolBar->addAction(HbIcon(SEND_ICON), QString());
+    toolBar->addAction(HbIcon(SEND_ICON),QString(),this,SLOT(send()));
 
-    connect(attachToolButton, SIGNAL(triggered()), this, SLOT(showAttachmentPopup()));
-    connect(sendToolButton, SIGNAL(triggered()), this, SLOT(send()));
 
     setToolBar(toolBar);
 }
@@ -405,10 +563,8 @@
 
     mSubjectField = new MsgUnifiedEditorSubject(mPluginPath, mContentWidget);
     mMainLayout->insertItem(index,mSubjectField);
-    connect(mSubjectField, SIGNAL(mmContentAdded(bool)),
-                     mNotifier, SLOT(onMMContentAdded(bool)));
-    connect(mSubjectField, SIGNAL(sizeChanged(int)),
-                     mMsgMonitor, SLOT(onSizeChanged(int)));
+    connect(mSubjectField, SIGNAL(contentChanged()),
+            mMsgMonitor, SLOT(checkMsgTypeChange()));    
 }
 
 void MsgUnifiedEditorView::addCcBcc()
@@ -428,25 +584,34 @@
     mBccField   = new MsgUnifiedEditorAddress( LOC_BCC, mPluginPath, mContentWidget );
 
     connect(mCcField, SIGNAL(sendMessage()), this, SLOT(send()));
-    connect(mCcField, SIGNAL(mmContentAdded(bool)), mNotifier, SLOT(onMMContentAdded(bool)));
+    connect(mCcField, SIGNAL(contentChanged()), mMsgMonitor, SLOT(checkMsgTypeChange()));
     connect(mBccField, SIGNAL(sendMessage()), this, SLOT(send()));
-    connect(mBccField, SIGNAL(mmContentAdded(bool)), mNotifier, SLOT(onMMContentAdded(bool)));
+    connect(mBccField, SIGNAL(contentChanged()), mMsgMonitor, SLOT(checkMsgTypeChange()));
 
     HbWidget* groupWidget = new HbWidget(mContentWidget);
     groupWidget->setContentsMargins(0,0,0,0);
+    
     QGraphicsLinearLayout* ccBccLayout = new QGraphicsLinearLayout(Qt::Vertical, groupWidget);
+    ccBccLayout->setContentsMargins(0,0,0,0);
+
+    qreal vItemSpacing = 0.0;    
+    style()->parameter("hb-param-margin-gene-middle-vertical",vItemSpacing);
+    ccBccLayout->setSpacing(vItemSpacing);
     ccBccLayout->addItem(mCcField);
     ccBccLayout->addItem(mBccField);
 
-    HbGroupBox* groupBox = new HbGroupBox(mContentWidget);
-    groupBox->setCollapsable(true);
+    HbGroupBox* groupBox = new HbGroupBox(0);    
+    groupBox->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Preferred);
+    
     groupBox->setContentWidget(groupWidget);
-    groupBox->setHeading(tr("Other recipients"));    
+    groupBox->setHeading(LOC_OTHER_RECIPIENTS(-1));
+    mMainLayout->insertItem(1,groupBox);
     connect(groupBox, SIGNAL(toggled(bool)), this, SLOT(updateOtherRecipientCount(bool)));
-
-    mMainLayout->insertItem(1,groupBox);
+    
     // add subject field too
     addSubject();
+    
+    this->updateGeometry();
 }
 
 void MsgUnifiedEditorView::updateOtherRecipientCount(bool state)
@@ -456,15 +621,13 @@
     {
         if(!state)
         {
-            groupBox->setHeading(tr("Other recipients"));
+           groupBox->setHeading(LOC_OTHER_RECIPIENTS(-1));
         }
         else
         {
             int addrCount = mCcField->addressCount();
             addrCount += mBccField->addressCount();
-            QString str;
-            str = QString(tr("%1 Other recipients")).arg(addrCount);
-            groupBox->setHeading(str);
+            groupBox->setHeading(LOC_OTHER_RECIPIENTS(addrCount));
         }
     }
 }
@@ -482,14 +645,6 @@
 
     addSubject();
     mSubjectField->setPriority(priority);
-    if(priority != ConvergedMessage::Normal)
-    {
-		mPrioritySubMenu->setTitle("Change Priority");
-	}
-   else
-   {
-       mPrioritySubMenu->setTitle("Add Priority");
-   }
 }
 
 void MsgUnifiedEditorView::sendingOptions()
@@ -498,24 +653,34 @@
 
 void MsgUnifiedEditorView::deleteMessage()
 {
-}
-
-void MsgUnifiedEditorView::launchHelp()
-{
-}
-
-void MsgUnifiedEditorView::showAttachmentPopup()
-{
-    HbMenu* attachMenu = new HbMenu();
-    attachMenu->deleteLater();
-    attachMenu->setFrameType(HbPopup::Strong);
-
-    HbAction* attachPhoto = attachMenu->addAction(LOC_PHOTO,mUtilsManager,SLOT(fetchImages()));
-    HbAction* attachVideo = attachMenu->addAction(LOC_VIDEO,mUtilsManager,SLOT(fetchVideo()));
-    HbAction* attachAudio = attachMenu->addAction(LOC_SOUND,mUtilsManager,SLOT(fetchAudio()));
-    HbAction* attachOther = attachMenu->addAction(LOC_MORE,mUtilsManager,SLOT(fetchOther()));
-    attachMenu->exec(QPoint());
-    delete attachMenu;
+    bool ok = HbMessageBox::question(LOC_NOTE_DELETE_MESSAGE,
+                                            LOC_BUTTON_DELETE, LOC_BUTTON_CANCEL);
+    
+    if(ok)
+        {
+        mCanSaveToDrafts = false;
+    
+        //delete if draft entry opened
+        if( mOpenedMessageId.getId() != -1)
+            {    
+            if(!mPluginLoader)
+                {
+                mPluginLoader = new UniEditorPluginLoader(this);
+                }
+        
+            UniEditorPluginInterface* pluginInterface =
+                mPluginLoader->getUniEditorPlugin(MsgMonitor::messageType());
+        
+            pluginInterface->deleteDraftsEntry(mOpenedMessageId.getId());
+            }
+    
+        //trigger back action.
+        HbAction* backAction = this->navigationAction();
+        if(backAction)
+            {
+            backAction->trigger();
+            }
+        }
 }
 
 void MsgUnifiedEditorView::removeAttachmentContainer()
@@ -529,51 +694,56 @@
     }
 }
 
-void MsgUnifiedEditorView::addAttachment(const QString& filepath)
+void MsgUnifiedEditorView::addAttachments(QStringList files)
+{    
+    int fcount = files.count();
+    int i=0;
+    for(i=0; i<fcount; i++)
+    {
+        if(MsgAttachmentContainer::EAddSizeExceed 
+                == addAttachment(files.at(i)))
+        {
+            // size already exceeds max mms size-limit
+            break;
+        }
+    }
+    // check if some files failed to add
+    // happens only when size exceeded during addition
+    if(i<fcount)
+    {
+        // TODO: show a note for size exceed
+    }
+}
+
+int MsgUnifiedEditorView::addAttachment(const QString& filepath)
 {
     if(!mAttachmentContainer)
     {
         mAttachmentContainer = new MsgAttachmentContainer(mPluginPath, mContentWidget);
         connect(mAttachmentContainer, SIGNAL(emptyAttachmentContainer()),
                 this, SLOT(removeAttachmentContainer()));
-        connect(mAttachmentContainer, SIGNAL(mmContentAdded(bool)),
-                mNotifier, SLOT(onMMContentAdded(bool)));
-        connect(mAttachmentContainer, SIGNAL(sizeChanged(int)),
-                         mMsgMonitor, SLOT(onSizeChanged(int)));
+        connect(mAttachmentContainer, SIGNAL(contentChanged()),
+                mMsgMonitor, SLOT(checkMsgTypeChange()));
         int index = mMainLayout->count() - 1;
         mMainLayout->insertItem(index,mAttachmentContainer);
     }
-    mAttachmentContainer->addAttachment(filepath);
-}
 
-void MsgUnifiedEditorView::imagesFetched(const QVariant& result )
+    int ret = mAttachmentContainer->addAttachment(filepath);
+    if(ret != MsgAttachmentContainer::EAddSuccess)
     {
-    if(result.canConvert<QStringList>())
+        // delete container, if it is empty
+        if(mAttachmentContainer->count() == 0)
         {
-        QStringList fileList = result.value<QStringList>();
-        if ( fileList.size()>0 )
-            {
-            QString filepath(fileList.at(0));
-            mBody->setImage(filepath);
-            addSubject();
-            }
+            removeAttachmentContainer();
         }
     }
-
-void MsgUnifiedEditorView::audiosFetched(const QVariant& result )
+    else if(mAttachmentContainer->hasMMContent())
     {
-    if(result.canConvert<QStringList>())
-        {
-        QStringList fileList = result.value<QStringList>();
-        if ( fileList.size()>0 && !fileList.at(0).isEmpty())
-            {
-            QString filepath(QDir::toNativeSeparators(fileList.at(0)));
-            QDEBUG_WRITE_FORMAT("Received audio file path = ", fileList.at(0));
-            mBody->setAudio(filepath);
-            addSubject();
-            }
-        }
+        // when msg is converted to MMS, subject needs to be auto-inserted
+        addSubject();
     }
+    return ret;
+}
 
 QString MsgUnifiedEditorView::pluginPath()
 {
@@ -590,11 +760,11 @@
 
 void MsgUnifiedEditorView::send()
 {
-    mUtilsManager->activateInputBlocker(this);
+    activateInputBlocker();
 
     // converged msg for sending
     ConvergedMessage msg;
-    ConvergedMessage::MessageType messageType = mNotifier->messageType();
+    ConvergedMessage::MessageType messageType = MsgMonitor::messageType();
     msg.setMessageType(messageType);
 
     ConvergedMessageAddressList addresses = mToField->addresses();
@@ -602,7 +772,7 @@
        addresses.isEmpty())
     {
         // no recipient specified for sms, do not send msg
-        mUtilsManager->deactivateInputBlocker();
+        deactivateInputBlocker();
         return;
     }
 
@@ -622,18 +792,21 @@
             bccAddresses.isEmpty())
     {
         // no recipient specified for mms, do not send msg
-        mUtilsManager->deactivateInputBlocker();
+        deactivateInputBlocker();
         return;
     }
 
     packMessage(msg);
-
-    int sendResult = mUtilsManager->send(msg);
+    
+    // send message
+    MsgSendUtil *sendUtil = new MsgSendUtil(this);
+    int sendResult = sendUtil->send(msg);
+    delete sendUtil;
     
     // all checks and validations happen before send
     if( sendResult == KErrNone)
     {
-        //After sending the new content to drafts chk if the msg 
+        //After sending the new content to drafts chk if the msg
         //was originally opened from drafts and delete the opened entry
         if( mOpenedMessageId.getId() != -1)
         {
@@ -641,7 +814,6 @@
             if(!mPluginLoader)
             {
                 mPluginLoader = new UniEditorPluginLoader(this);
-                mPluginLoader->loadPlugins();
             }
 
             UniEditorPluginInterface* pluginInterface =
@@ -671,7 +843,7 @@
 
             addrList = bccAddresses;
             int bccCount = addrList.count();
-            recepientCount += bccCount;        
+            recepientCount += bccCount;
             if(bccCount)
             {
                 receipient = addrList.at(0)->address();
@@ -685,33 +857,39 @@
         {
         params << MsgBaseView::CV;  // target view
         params << MsgBaseView::UNIEDITOR; // source view
-        
+
         params << receipient;
         }
-    else 
+    else
         {
         params << MsgBaseView::CLV;// target view
         params << MsgBaseView::UNIEDITOR; // source view
         }
-        mUtilsManager->deactivateInputBlocker();
-    emit switchView(params);
+        deactivateInputBlocker();
+        emit switchView(params);
     }
     else
     {
-        mUtilsManager->deactivateInputBlocker();
+        deactivateInputBlocker();
         if(sendResult == KErrNotFound)
         {
-            QVariantList params;
-            params << MsgBaseView::MSGSETTINGS;// target view
-            params << MsgBaseView::UNIEDITOR; // source view
-            emit switchView(params);
+        	  bool result = HbMessageBox::question("Settings not defined\nDefine now ?",
+                                         LOC_DIALOG_OK,
+                                         LOC_BUTTON_CANCEL);
+            if (result)
+            {
+              QVariantList params;
+              params << MsgBaseView::MSGSETTINGS;// target view
+              params << MsgBaseView::UNIEDITOR; // source view
+              emit switchView(params);
+            }
         }
     }
 }
 
 void MsgUnifiedEditorView::packMessage(ConvergedMessage &msg)
 {
-    ConvergedMessage::MessageType messageType = mNotifier->messageType();
+    ConvergedMessage::MessageType messageType = MsgMonitor::messageType();
     msg.setMessageType(messageType);
 
     ConvergedMessageAddressList addresses = mToField->addresses();
@@ -736,7 +914,7 @@
             bccAddresses = mBccField->addresses();
         }
 
-        int matchDigitsCount = MatchPhNumberUtil::matchDigits();
+        int matchDigitsCount = MsgUnifiedEditorAddress::contactMatchDigits();
         //comapre cc and to field,remove duplicate from cc
         foreach(ConvergedMessageAddress *ccAddress,ccAddresses)
         {
@@ -750,7 +928,7 @@
         }
         //comapre bcc and cc field,remove duplicate from bcc
         foreach(ConvergedMessageAddress *bccAddress,bccAddresses)
-        { 
+        {
           foreach(ConvergedMessageAddress *ccAddress,ccAddresses)
           {
              if(0 == bccAddress->address().right(matchDigitsCount).compare(ccAddress->address().right(matchDigitsCount)))
@@ -761,7 +939,7 @@
         }
         //comapre bcc and to field,remove duplicate from bcc
         foreach(ConvergedMessageAddress *bccAddress,bccAddresses)
-        { 
+        {
           foreach(ConvergedMessageAddress *toAddress,addresses)
           {
              if(0 == bccAddress->address().right(matchDigitsCount).compare(toAddress->address().right(matchDigitsCount)))
@@ -805,13 +983,13 @@
             msg.addAttachments(mediaList);
         }
     }
-    
+
     // sms/mms attachment list
     ConvergedMessageAttachmentList attachmentList;
         if(mAttachmentContainer)
         {
-            MsgUnifiedEditorAttachmentList editorAttachmentList = 
-                mAttachmentContainer->attachmentList(); 
+            MsgUnifiedEditorAttachmentList editorAttachmentList =
+                mAttachmentContainer->attachmentList();
                 for (int i = 0; i < editorAttachmentList.count(); ++i)
                 {
                     ConvergedMessageAttachment* attachment =
@@ -827,21 +1005,24 @@
         }
 }
 
-bool MsgUnifiedEditorView::saveContentToDrafts()
+void MsgUnifiedEditorView::saveContentToDrafts()
 {
-    mUtilsManager->activateInputBlocker(this);
-    ConvergedMessage::MessageType messageType = mNotifier->messageType();
+    if(!mCanSaveToDrafts)
+        {
+        return;
+        }
+    activateInputBlocker();
+    ConvergedMessage::MessageType messageType = MsgMonitor::messageType();
 
     ConvergedMessageAddressList addresses = mToField->addresses();
 
     UniEditorPluginInterface* pluginInterface = NULL;
-    
+
     if( mOpenedMessageId.getId() != -1)
-    {    
+    {
         if(!mPluginLoader)
         {
             mPluginLoader = new UniEditorPluginLoader(this);
-            mPluginLoader->loadPlugins();
         }
 
         pluginInterface =
@@ -849,16 +1030,18 @@
     }
 
     if(messageType == ConvergedMessage::Sms &&
-            addresses.isEmpty() && MsgMonitor::bodySize() <= 0)
+            addresses.isEmpty() &&
+            MsgMonitor::bodySize() <= 0 &&
+            MsgMonitor::containerSize() <= 0)
     {
         if(mOpenedMessageId.getId() != -1)
         {
         pluginInterface->deleteDraftsEntry(mOpenedMessageId.getId());
         }
 
-        // no recipient specified for sms, do not send msg
-        mUtilsManager->deactivateInputBlocker();
-        return false;
+        // if empty msg, do not save
+        deactivateInputBlocker();
+        return;
     }
 
     ConvergedMessageAddressList ccAddresses;
@@ -889,26 +1072,34 @@
         {
             pluginInterface->deleteDraftsEntry(mOpenedMessageId.getId());
         }
-        // no recipient specified for mms, do not send msg
-        mUtilsManager->deactivateInputBlocker();
-        return false;
+        // if empty msg, do not send
+        deactivateInputBlocker();
+        return;
     }
     ConvergedMessage msg;
     packMessage(msg);
-    
-    int msgId = mUtilsManager->saveToDrafts(msg);
 
-    //After saving the new content to drafts chk if the msg 
-    //was originally opened from drafts and delete the opened entry
-    if(mOpenedMessageId.getId() != -1)
+    // save to drafts
+    MsgSendUtil *sendUtil = new MsgSendUtil(this);
+    int msgId = sendUtil->saveToDrafts(msg);
+    delete sendUtil;
+
+    // If saving new msg to draft succeeded and also if the originally
+    // opened msg was from drafts, then delete the original msg entry
+    if(msgId != -1 && mOpenedMessageId.getId() != -1)
     {
         pluginInterface->deleteDraftsEntry(mOpenedMessageId.getId());
         mOpenedMessageId.setId(INVALID_MSGID);
     }
+
+    deactivateInputBlocker();
+
+    bool res = ((msgId > INVALID_MSGID)? true : false);
     
-    mUtilsManager->deactivateInputBlocker();
-
-    return ((msgId > INVALID_MSGID)? true : false);
+    if(res)
+        {
+        HbNotificationDialog::launchDialog(LOC_SAVED_TO_DRAFTS);
+        }
 }
 
 void MsgUnifiedEditorView::resizeEvent( QGraphicsSceneResizeEvent * event )
@@ -921,4 +1112,352 @@
  mContentWidget->resize(this->rect().width(),this->rect().height()+1);
 }
 
+//---------------------------------------------------------------
+// editorTempPath
+// @return fullPath of unified editor's temporary dir
+//---------------------------------------------------------------
+QString editorTempPath()
+{
+    QDir tempDir = QDir(QString());
+    QString tempPath(QDir::toNativeSeparators(tempDir.tempPath()));
+    tempPath.append(QDir::separator());
+    tempPath.append(UNIFIED_EDITOR_TEMP_FOLDER);
+    tempPath.append(QDir::separator());
+    return tempPath;
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::createVCards
+// @see header file
+//---------------------------------------------------------------
+int MsgUnifiedEditorView::createVCards(
+        const QVariant& value, QStringList& filelist)
+{
+    // make sure that temp-folder is created for storing vcards
+    QDir tempDir = QDir(QString());
+    if(!tempDir.mkpath(editorTempPath()))
+    {
+        return KErrGeneral;
+    }
+    tempDir.cd(editorTempPath());
+
+
+    // extract contact-list
+    QContactManager* contactManager = new QContactManager("symbian");
+    CntServicesContactList cntServicesContacts = qVariantValue<CntServicesContactList>(value);
+    int cntCount = cntServicesContacts.count();
+    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();
+    
+    bool ret_val = exporter->exportContacts(contactList, versitType);
+    QList<QtMobility::QVersitDocument> documentList = exporter->documents();    
+
+    delete exporter;
+
+    // loop though and create a vcard for each contact
+    QVersitWriter* writer = new QVersitWriter();
+    for(int i = 0; i < cntCount; i++ )
+    {
+        // buffer to hold vcard data fetched from contacts
+        QBuffer contactsbuf;
+        contactsbuf.open(QBuffer::ReadWrite);
+        writer->setDevice( &contactsbuf );
+
+        //write document data to buffer
+        QList<QtMobility::QVersitDocument> currDoc;
+        currDoc << documentList.at(i);
+        writer->startWriting(currDoc);
+        if(writer->waitForFinished())
+        {
+            // generate file name
+            QString displayLabel = contactList.at(i).displayLabel();
+            QString filepath = generateFileName(displayLabel);
+            QFile file(filepath);
+            if(file.open(QIODevice::WriteOnly))
+            {
+                // 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;
+            }
+        }
+    }
+
+    // cleanup & return
+    delete writer;
+    return KErrNone;
+}
+
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::generateFileName
+// @param suggestedName suggested name of the file
+// @return fullPath of the generated filename
+// @algo For multiselected 'Unnamed' contacts, the filename should
+// be synthesized as unnamed.vcf, unnamed1.vcf, unnamed2.vcf etc.
+//---------------------------------------------------------------
+QString MsgUnifiedEditorView::generateFileName(QString& suggestedName)
+{
+    QDir editorTempDir = QDir(QString());
+    editorTempDir.cd(editorTempPath());
+
+    for(int i=0; i<MAX_VCARDS; i++)
+    {
+        QString searchFileName = suggestedName;
+        if(i>0)
+        {
+            searchFileName.append(QString::number(i));
+        }
+        searchFileName.append(FILE_EXTN);
+
+        // check if filename is already used by an attachment in container
+        bool alreadyExists = false;
+        if(mAttachmentContainer)
+        {
+            MsgUnifiedEditorAttachmentList attList =
+                    mAttachmentContainer->attachmentList();
+            int attCount = attList.count();
+            for(int j=0; j<attCount; j++)
+            {
+                QFileInfo fileinfo(attList.at(j)->path());
+                if(searchFileName == fileinfo.fileName())
+                {
+                    alreadyExists = true;
+                    break;
+                }
+            }
+        }
+
+        if(!alreadyExists)
+        {
+            if(i>0)
+            {
+                suggestedName.append(QString::number(i));
+            }
+            break;
+        }
+    }
+    QString filepath(editorTempPath());
+    filepath.append(suggestedName);
+    filepath.append(FILE_EXTN);
+    return filepath;
+}
+
+void MsgUnifiedEditorView::handleViewExtnActivated(HbListWidgetItem* item)
+    {
+    QString itemText = item->text();
+    
+    if(itemText == LOC_PHOTO)
+        {
+        //launch photo picker.
+        fetchImages();  
+    }
+    else if(itemText == LOC_SOUND)
+        {
+        //launch audio picker
+        fetchAudio();
+    }
+    else if(itemText == LOC_BUSINESS_CARD)
+        {
+        //launch contact card picker.
+        fetchContacts();
+    }
+   
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::fetchContacts
+// @see header file
+//---------------------------------------------------------------
+void MsgUnifiedEditorView::fetchContacts()
+{
+    QList<QVariant> args;
+    QString serviceName("com.nokia.services.phonebookservices");
+    QString operation("fetch(QString,QString,QString)");
+    XQAiwRequest* request;
+    XQApplicationManager appManager;
+    request = appManager.create(serviceName, "Fetch", operation, true); //embedded
+    if ( request == NULL )
+    {
+        QCRITICAL_WRITE("AIW-ERROR: NULL request");
+        return;       
+    }
+
+    // Result handlers
+    connect (request, SIGNAL(requestOk(const QVariant&)), 
+        this, SLOT(contactsFetched(const QVariant&)));
+    connect (request, SIGNAL(requestError(int,const QString&)), 
+        this, SLOT(serviceRequestError(int,const QString&)));
+
+    args << QString(tr("Phonebook")); 
+    args << KCntActionAll;
+    args << KCntFilterDisplayAll;
+
+    request->setArguments(args);
+    if(!request->send())
+    {
+        QDEBUG_WRITE_FORMAT("AIW-ERROR: Request Send failed:",request->lastError());
+    }
+    delete request;
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::fetchImages
+// @see header file
+//---------------------------------------------------------------
+void MsgUnifiedEditorView::fetchImages()
+{
+    QString interface("Image");
+    QString operation("fetch(QVariantMap,QVariant)");
+    XQAiwRequest* request = NULL;
+    XQApplicationManager appManager;
+    request = appManager.create(interface, operation, true);//embedded
+    if(!request)
+    {     
+        QCRITICAL_WRITE("AIW-ERROR: NULL request");
+        return;
+    }
+
+    connect(request, SIGNAL(requestOk(const QVariant&)),
+        this, SLOT(imagesFetched(const QVariant&)));
+    connect(request, SIGNAL(requestError(int,const QString&)),
+        this, SLOT(serviceRequestError(int,const QString&)));
+   
+    // Make the request
+    if (!request->send())
+    {
+        QDEBUG_WRITE_FORMAT("AIW-ERROR: Request Send failed:" , request->lastError());
+    }  
+    delete request;
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::fetchAudio
+// @see header file
+//---------------------------------------------------------------
+void MsgUnifiedEditorView::fetchAudio()
+{
+    QString service("Music Fetcher");
+    QString interface("com.nokia.services.media.Music");
+    QString operation("fetch(QString)");
+    XQAiwRequest* request = NULL;
+    XQApplicationManager appManager;
+    request = appManager.create(service, interface, operation, true); //embedded
+    if(!request)
+    {
+        QCRITICAL_WRITE("AIW-ERROR: NULL request");
+        return;
+    }
+
+    connect(request, SIGNAL(requestOk(const QVariant&)),
+        this, SLOT(audiosFetched(const QVariant&)));
+    connect(request, SIGNAL(requestError(int,const QString&)),
+        this, SLOT(serviceRequestError(int,const QString&)));
+
+    // Make the request
+    if (!request->send())
+    {
+        QDEBUG_WRITE_FORMAT("AIW-ERROR: Request Send failed :",request->lastError());
+    }
+    delete request;
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::contactsFetched
+// @see header file
+//---------------------------------------------------------------
+void MsgUnifiedEditorView::contactsFetched(const QVariant& value)
+{
+    // create a vcard for each contact fetched and add as attachment
+    QStringList attachmentList;
+    if(createVCards(value, attachmentList) == KErrNone)
+    {
+        addAttachments(attachmentList);
+    }
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::imagesFetched
+// @see header file
+//---------------------------------------------------------------
+void MsgUnifiedEditorView::imagesFetched(const QVariant& result )
+{
+    if(result.canConvert<QStringList>())
+    {
+        QStringList fileList = result.value<QStringList>();
+        if ( fileList.size()>0 )
+        {
+            QString filepath(QDir::toNativeSeparators(fileList.at(0)));
+            mBody->setImage(filepath);
+            addSubject();
+        }
+    }
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::audiosFetched
+// @see header file
+//---------------------------------------------------------------
+void MsgUnifiedEditorView::audiosFetched(const QVariant& result )
+{
+    if(result.canConvert<QStringList>())
+    {
+        QStringList fileList = result.value<QStringList>();
+        if ( fileList.size()>0 && !fileList.at(0).isEmpty())
+        {
+            QString filepath(QDir::toNativeSeparators(fileList.at(0)));
+            QDEBUG_WRITE_FORMAT("Received audio file path = ", fileList.at(0));
+            mBody->setAudio(filepath);
+            addSubject();
+        }
+    }
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::serviceRequestError
+// @see header file
+//---------------------------------------------------------------
+void MsgUnifiedEditorView::serviceRequestError(int errorCode, const QString& errorMessage)
+{
+    QDEBUG_WRITE_FORMAT(errorMessage,errorCode);
+}
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::activateInputBlocker
+// @see header file
+//--------------------------------------------------------------
+void MsgUnifiedEditorView::activateInputBlocker()
+    {
+        this->grabMouse();
+        this->grabKeyboard();
+    }
+
+//---------------------------------------------------------------
+// MsgUnifiedEditorView::deactivateInputBlocker
+// @see header file
+//--------------------------------------------------------------
+void MsgUnifiedEditorView::deactivateInputBlocker()
+    {    
+        this->ungrabKeyboard();
+        this->ungrabMouse();
+    }
+
 //EOF
--- a/messagingapp/msgui/unifiededitor/src/msgunifiededitorlineedit.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/src/msgunifiededitorlineedit.cpp	Mon May 03 12:29:07 2010 +0300
@@ -33,27 +33,30 @@
 MsgUnifiedEditorLineEdit::MsgUnifiedEditorLineEdit(const QString& label,QGraphicsItem *parent):
 HbLineEdit(parent),
 mSelectionStart(-1),
-mSelectionEnd(-1)
+mSelectionEnd(-1),
+mDefaultBehaviour(false)
 {
+    QString labelStr = label.trimmed();
+    
     QTextCursor cursor(this->textCursor());
     QTextCharFormat colorFormat(cursor.charFormat());
    
-    QColor fgColor = colorFormat.foreground().color();     
+    QColor fgColor = this->palette().color(QPalette::Text);     
     fgColor.setAlpha(fadedAlpha);
     colorFormat.setForeground(fgColor);
-    cursor.insertText(label , colorFormat);
+    cursor.insertText(labelStr , colorFormat);
 
     fgColor.setAlpha(solidAlpha);
     colorFormat.setForeground(fgColor);
 
     cursor.insertText(" ",colorFormat);    
 
-    mLabelExpr.setPattern(QString("^"+label+" $"));
-    mLabel = label+" ";
+    mLabelExpr.setPattern(QString("^"+labelStr+" $"));
+    mLabel = labelStr+" ";
 
     connect(this,SIGNAL(selectionChanged(QTextCursor,QTextCursor)),
             this,SLOT(selectionChanged(QTextCursor,QTextCursor)));
-    connect(this, SIGNAL(textChanged(QString)), this, SLOT(onTextChanged(QString)));
+    connect(this, SIGNAL(contentsChanged()), this, SLOT(onContentsChanged()));
 }
 
 MsgUnifiedEditorLineEdit::~MsgUnifiedEditorLineEdit()
@@ -62,6 +65,14 @@
 
 void MsgUnifiedEditorLineEdit::inputMethodEvent(QInputMethodEvent *event)
 {
+    //let it go in default way.
+    if(mDefaultBehaviour)
+    {
+        HbAbstractEdit::inputMethodEvent(event);
+        event->accept();
+        return;
+    }
+
     if (!event->commitString().isEmpty() || event->replacementLength())
     {
         if (event->commitString().contains(expr))
@@ -95,6 +106,12 @@
 
     if(event->key()== Qt::Key_Enter || event->key()== Qt::Key_Return)
     {
+        if(mDefaultBehaviour)
+        {
+            HbAbstractEdit::keyReleaseEvent(event);
+            event->accept();
+            return;
+        }
         if(this->text().isEmpty() || this->text().contains(sepAtEnd) || this->text().contains(mLabelExpr))
         {
             event->accept();
@@ -269,6 +286,12 @@
 
     if(!str.isEmpty())
     {
+        if(mDefaultBehaviour)
+        {
+            HbAbstractEdit::keyPressEvent(event);
+            event->accept();
+            return;
+        }
         if (str.contains(expr))
         {
             if(this->text().isEmpty() || this->text().contains(sepAtEnd) || this->text().contains(mLabelExpr))
@@ -337,39 +360,47 @@
 
 void MsgUnifiedEditorLineEdit::setText(const QString& text)
 {
-    QInputMethodEvent e;
-    //make sure previous text is complete.
-    e.setCommitString(";");
-    this->inputMethodEvent(&e);
-    this->setCursorPosition(this->text().length());
+
+    if(!mDefaultBehaviour)
+    {
+        QInputMethodEvent e;
+        //make sure previous text is complete.
+        e.setCommitString(";");
+        this->inputMethodEvent(&e);
+        this->setCursorPosition(this->text().length());
 
-    QTextCursor cursor(this->textCursor());
-    QTextCharFormat colorFormat(cursor.charFormat());
-    QColor fgColor = colorFormat.foreground().color();     
-    fgColor.setAlpha(fadedAlpha);
-    colorFormat.setUnderlineColor(fgColor);
+        QTextCursor cursor(this->textCursor());
+        QTextCharFormat colorFormat(cursor.charFormat());
+        QColor fgColor = colorFormat.foreground().color();
+        fgColor.setAlpha(fadedAlpha);
+        colorFormat.setUnderlineColor(fgColor);
 
-    colorFormat.setFontUnderline(true);  
-    cursor.insertText(text , colorFormat);
-    colorFormat.setFontUnderline(false);
-    
-    cursor.insertText(replacementStr,colorFormat);
+        colorFormat.setFontUnderline(true);
+        cursor.insertText(text , colorFormat);
+        colorFormat.setFontUnderline(false);
+
+        cursor.insertText(replacementStr,colorFormat);       
+    }
+    else
+    {
+       this->setCursorPosition(this->text().length());
+       QTextCursor cursor(this->textCursor());
+       cursor.insertText(text);
+    }
     
     this->setCursorVisibility(Hb::TextCursorHidden);
 }
 
 QStringList MsgUnifiedEditorLineEdit::addresses()
-{    
-    QString text = this->text();
-    text = text.remove(mLabel);
+{
+    QString text = this->content();
     QStringList list = text.split(replacementStr,QString::SkipEmptyParts);
-    //list.removeDuplicates();
     return list;
 }
 
 void MsgUnifiedEditorLineEdit::focusInEvent(QFocusEvent* event)
 {    
-    HbAbstractEdit::focusInEvent(event);
+    HbLineEdit::focusInEvent(event);
     this->setCursorVisibility(Hb::TextCursorVisible);
 }
 
@@ -432,16 +463,18 @@
         return;
     }
 
-    mSelectionStart  = newCursor.selectionStart();
-    mSelectionEnd    = newCursor.selectionEnd();
+    if(!mDefaultBehaviour)
+        {
+        mSelectionStart  = newCursor.selectionStart();
+        mSelectionEnd    = newCursor.selectionEnd();
 
-    if(mSelectionStart == mSelectionEnd )
-    {
-        return;
-    }
-
-    mSelectionSnapTimer.start(SNAP_DELAY,this);
-
+        if(mSelectionStart == mSelectionEnd )
+            {
+            return;
+            }
+    
+        mSelectionSnapTimer.start(SNAP_DELAY,this);
+        }
 }
 
 void MsgUnifiedEditorLineEdit::timerEvent(QTimerEvent *event)
@@ -478,10 +511,25 @@
     }
 }
 
-void MsgUnifiedEditorLineEdit::onTextChanged(const QString& text)
+void MsgUnifiedEditorLineEdit::setDefaultBehaviour(bool defaultBehaviour)
 {
-    const QString changedText = const_cast<QString&>(text).remove(mLabel);
-    emit addressTextChanged(changedText);
+    mDefaultBehaviour = defaultBehaviour;
+}
+
+QString MsgUnifiedEditorLineEdit::text() const
+{
+    return HbLineEdit::text();
 }
 
+QString MsgUnifiedEditorLineEdit::content() const
+{
+    QString text = this->text();
+    text.remove(mLabel);
+    return text;
+}
+
+void MsgUnifiedEditorLineEdit::onContentsChanged()
+{
+    emit contentsChanged(content());
+}
 // eof
--- a/messagingapp/msgui/unifiededitor/unifiededitor.pro	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/unifiededitor.pro	Mon May 03 12:29:07 2010 +0300
@@ -24,8 +24,8 @@
 INCLUDEPATH += . inc
 INCLUDEPATH += ../../../inc
 INCLUDEPATH += ../msguiutils/inc
-INCLUDEPATH += ../../msgutils/unieditorutils/inc
-INCLUDEPATH += ../../msgutils/unidatamodelloader/inc
+INCLUDEPATH += ../../msgutils/unieditorutils/editorgenutils/inc
+INCLUDEPATH += ../../msgutils/unidatautils/unidatamodelloader/inc
 INCLUDEPATH += ../../msgutils/s60qconversions/inc
 INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
 
@@ -44,7 +44,6 @@
 
 # Input
 HEADERS += msgmonitor.h \
-    msgtypenotifier.h \
     msgunieditoraddress.h \
     msgunieditorattachment.h \
     msgunieditorbody.h \
@@ -52,13 +51,12 @@
     msgunieditorview.h \
     msgunifiededitorlineedit.h \
     msgattachmentcontainer.h \
-    mmsinsertcheckoperation.h \
     msgbaseview.h \
     msgunieditorimageprocessor.h \
-    msgunieditorprocessimageoperation.h 
+    msgunieditorprocessimageoperation.h
 
-SOURCES += msgmonitor.cpp \
-    msgtypenotifier.cpp \
+SOURCES += msgmonitor.inl \
+    msgmonitor.cpp \
     msgunieditoraddress.cpp \
     msgunieditorattachment.cpp \
     msgunieditorbody.cpp \
@@ -68,8 +66,7 @@
     msgattachmentcontainer.cpp \
     msgunieditorimageprocessor.inl \
     msgunieditorimageprocessor.cpp \
-    msgunieditorprocessimageoperation.cpp \
-    mmsinsertcheckoperation.cpp 
+    msgunieditorprocessimageoperation.cpp
 
 RESOURCES += unifiededitor.qrc
 
@@ -78,14 +75,22 @@
         -lconvergedmessageutils \
         -lmsguiutils \
         -lunieditorpluginloader \
-        -lunieditorutils \
+        -leditorgenutils \
         -lfbscli \
         -limageconversion \
         -lDRMHelper \
         -lbitmaptransforms \
+        -lQtVersit \
+        -lQtContacts \
+        -lxqutils \
+        -leuser \
         -lmsgmedia \
         -lapmime \
-        -lcentralrepository
+        -lcentralrepository \
+        -lxqservice \
+        -lgsmu \
+        -lsmcm \
+        -lxqserviceutil
 
 
         
\ No newline at end of file
--- a/messagingapp/msgui/unifiededitor/unifiededitor.qrc	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiededitor/unifiededitor.qrc	Mon May 03 12:29:07 2010 +0300
@@ -1,13 +1,6 @@
 <RCC>
-    <qresource prefix="/" >
-       <file alias="qtg_small_priority_low.svg">resources/qtg_small_priority_low.svg</file>
-       <file alias="qtg_small_priority_high.svg">resources/qtg_small_priority_high.svg</file>
-       <file alias="qtg_mono_contacts.svg">resources/qtg_mono_contacts.svg</file>
-       <file alias="qtg_mono_attach.svg">resources/qtg_mono_attach.svg</file>
-       <file alias="qtg_mono_send.svg">resources/qtg_mono_send.svg</file>
-       <file alias="qtg_mono_audio.svg">resources/qgn_indi_mce_tb_audio.svg</file>
-       <file alias="qtg_small_attachment.svg">resources/qtg_small_attachment.svg</file>
-       <file alias="animation.axml">resources/animation.axml</file>
+    <qresource prefix="/">
+        <file alias="animation.axml">resources/animation.axml</file>
        <file alias="qtg_anim_longtap_1.svg">resources/qtg_anim_longtap_1.svg</file>
        <file alias="qtg_anim_longtap_2.svg">resources/qtg_anim_longtap_2.svg</file>
        <file alias="qtg_anim_longtap_3.svg">resources/qtg_anim_longtap_3.svg</file>
--- a/messagingapp/msgui/unifiedviewer/inc/unifiedviewer.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/inc/unifiedviewer.h	Mon May 03 12:29:07 2010 +0300
@@ -75,6 +75,13 @@
      */
     void createToolBar();
 
+    /**
+     * Validates if message can be forwarded
+     * @return true if message can be forwarded
+     *         false if message cant be forwarded
+     */
+    bool validateMsgForForward();
+
 public slots:
 
     /**
--- a/messagingapp/msgui/unifiedviewer/inc/univieweraddresscontainer.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/inc/univieweraddresscontainer.h	Mon May 03 12:29:07 2010 +0300
@@ -26,6 +26,7 @@
 
 // FORWARD DECLARATIONS
 class QGraphicsLinearLayout;
+class HbIconItem;
 class UniViewerAddressWidget;
 
 /**
@@ -71,6 +72,11 @@
      */
     void clearContent();
 
+    /**
+     * Inserts divider into layout.
+     */
+    void insertDivider();
+
 private:
 
     /**
@@ -96,6 +102,12 @@
      * Own
      */
     UniViewerAddressWidget *mCcWidget;
+
+    /**
+     * Divider icon item.
+     * Own
+     */
+    HbIconItem *mDivider;
 };
 
 #endif // UNI_VIEWER_ADDRESS_CONTAINER_H
--- a/messagingapp/msgui/unifiedviewer/inc/univiewerbodywidget.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/inc/univiewerbodywidget.h	Mon May 03 12:29:07 2010 +0300
@@ -20,21 +20,24 @@
 
 #include <hbwidget.h>
 
+#include "unidatamodelplugininterface.h"
+
 class UniViewerTextItem;
 class HbIconItem;
+class HbTextItem;
 class HbPushButton;
 class HbGestureSceneFilter;
-
-#include "unidatamodelplugininterface.h"
+class QSignalMapper;
 
 /**
  * This widget displays the body of the viewer
  */
-class UniViewerBodyWidget : public HbWidget
+class UniViewerBodyWidget: public HbWidget
 {
 Q_OBJECT
 
-    Q_PROPERTY(bool hasText READ hasText WRITE setHasText)
+Q_PROPERTY(bool hasText READ hasText WRITE setHasText)
+Q_PROPERTY(bool hasPixmap READ hasPixmap WRITE setHasPixmap)
 
 public:
 
@@ -70,11 +73,17 @@
 
     /**
      * Called to insert text content in viewer.
-     * @param
+     * @param text Body text to be set.
      */
     void setTextContent(QString text);
 
     /**
+     * Sets the slide counter.
+     * @param slideCounter Slide counter string to be set.
+     */
+    void setSlideCounter(QString &slideCounter);
+
+    /**
      * Specify if this slide has text
      * @param bool
      */
@@ -87,6 +96,18 @@
     bool hasText();
 
     /**
+     * Specify if this slide has pixmap
+     * @param bool
+     */
+    void setHasPixmap(bool text = true);
+
+    /**
+     * Returns true if body has pixmap
+     * @return bool
+     */
+    bool hasPixmap();
+
+    /**
      * Sets the side content
      * @param objList object list
      * @param slideString slide string
@@ -120,15 +141,30 @@
     void openMedia();
 
     /**
+     * Open a specified media file
+     */
+    void openMedia(const QString& fileName);
+
+    /**
      * called from the media object's item specific menu
      */
     void viewDetails();
-    
+
+    /**
+     * Service launch complete.
+     */
+    void handleOk(const QVariant& result);
+
+    /**
+     * Service launch errors.
+     */
+    void handleError(int errorCode, const QString& errorMessage);
+
 signals:
-        /**
-         * this signal is emitted when sendMessage is emitted from UniViewerTextItem.
-         */
-        void sendMessage(const QString& phoneNumber);
+    /**
+     * this signal is emitted when sendMessage is emitted from UniViewerTextItem.
+     */
+    void sendMessage(const QString& phoneNumber);
 
 private:
     /**
@@ -138,12 +174,23 @@
     bool mHasText;
 
     /**
-     * editor to in put text.
+     * Info if slide has pixmap.
+     * true if slide has pixmap else false.
+     */
+    bool mHasPixmap;
+
+    /**
+     * Editor to in put text.
      */
     UniViewerTextItem* mTextItem;
 
     /**
-     * icon item to preview images.
+     * Slide counter.
+     */
+    HbTextItem *mSlideCounter;
+
+    /**
+     * Icon item to preview images.
      */
     HbIconItem* mIconItem;
 
@@ -157,6 +204,10 @@
      */
     HbGestureSceneFilter* gestureFilter;
 
+    /**
+     * File mapper for opening media
+     */
+    QSignalMapper* mSignalMapper;
 };
 
 #endif //UNIVIEWER_BODY_WIDGET_H
--- a/messagingapp/msgui/unifiedviewer/inc/univiewerdetailswidget.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/inc/univiewerdetailswidget.h	Mon May 03 12:29:07 2010 +0300
@@ -26,7 +26,7 @@
 /*
  *This widget displays subject,timestamp & priority info
  */
-class UniViewerDetailsWidget : public HbWidget
+class UniViewerDetailsWidget: public HbWidget
 {
 Q_OBJECT
 
@@ -52,7 +52,7 @@
      * Sets the time stamp inside widget
      * @param aTimeStamp
      */
-    void setTimeStamp(const QDateTime &aTimeStamp);
+    void setTimeStamp(const QDateTime &aTimeStamp, const int &aSendingState);
 
     /**
      * Sets the priority inside widget
@@ -67,13 +67,13 @@
 
 private:
 
-    /*
+    /**
      * HbTextItem object
      * Owned
      */
     HbTextItem *mSubjectLabel;
 
-    /*
+    /**
      * HbIconItem object
      * Owned
      */
--- a/messagingapp/msgui/unifiedviewer/inc/univiewerfeeder.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/inc/univiewerfeeder.h	Mon May 03 12:29:07 2010 +0300
@@ -173,6 +173,12 @@
      * @return QString
      */
     QString subject();
+
+    /**
+     * if the send state of message is failed, then return true.
+     * @return int The sending state 
+     */
+    int sendingState();
     
 signals:
     /**
--- a/messagingapp/msgui/unifiedviewer/inc/univiewerfeeder_p.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/inc/univiewerfeeder_p.h	Mon May 03 12:29:07 2010 +0300
@@ -30,8 +30,6 @@
 class QDateTime;
 class UniViewerFeeder;
 class CMsvSession;
-class UnifiedDataModel;
-class CClientMtmRegistry;
 class UniDataModelPluginInterface;
 class UniDataModelLoader;
 
@@ -179,6 +177,11 @@
     QString subject();
     
     /**
+     * Returns the sending state of the message.
+     */
+    int sendingState();
+    
+    /**
      * Gets the name(alias) for a address from the Contact database
      * @int returns number of phone addresses for the specified address.
      */
@@ -226,12 +229,12 @@
     /**
      * interface to fetch data
      */
-    UniDataModelPluginInterface* pluginInterface;
+    UniDataModelPluginInterface* mPluginInterface;
 
     /**
      * plugin loader
      */
-    UniDataModelLoader* pluginLoader;
+    UniDataModelLoader* mPluginLoader;
     /**
      * To address list
      * owned.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/unifiedviewer/inc/univiewerheadercontainer.h	Mon May 03 12:29:07 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: This widget holds the message header.
+ *
+ */
+
+#ifndef UNIVIEWER_HEADER_CONTAINER_H
+#define UNIVIEWER_HEADER_CONTAINER_H
+
+#include <HbWidget>
+
+#include <convergedmessageaddress.h>
+
+class UniViewerDetailsWidget;
+class HbGroupBox;
+class UniViewerAddressContainer;
+class UniViewerAttachmentContainer;
+class UniViewerFeeder;
+
+class UniViewerHeaderContainer: public HbWidget
+{
+Q_OBJECT
+
+public:
+
+    /**
+     * Constructor
+     */
+    explicit UniViewerHeaderContainer(UniViewerFeeder* feeder, QGraphicsItem *parent = 0);
+
+    /**
+     * Destructor
+     */
+    ~UniViewerHeaderContainer();
+
+    /**
+     * Populates the content on the widget
+     */
+    void populateContent();
+
+    /**
+     * Clears the content on the widget
+     */
+    void clearContent();
+
+private:
+
+    /**
+     * Populates the subject field in Details widget.
+     */
+    void populateSubject();
+
+    /**
+     * Populates the attachment list in Attachment container.
+     */
+    void populateAttachments();
+
+    /**
+     * Populates the from, to & cc fields.
+     */
+    void populateAddressContainer();
+
+    /**
+     * Sets the heading text of the address group box.
+     */
+    void setAddrGroupBoxHeading();
+
+    /**
+     * Creates a comma seperated address list using converged message address list.
+     * @param addressList Converged message address list.
+     * @return Comma separated address list.
+     */
+    QString createAddressList(const ConvergedMessageAddressList &addressList);
+
+private:
+
+    /**
+     * UniViewerFeeder object
+     * Not Owned
+     */
+    UniViewerFeeder* mViewFeeder;
+
+    /**
+     * UniViewerDetailsWidget object
+     * Owned
+     */
+    UniViewerDetailsWidget *mViewerDetails;
+
+    /**
+     * HbGroupBox object
+     * owned.
+     */
+    HbGroupBox *mHeaderGroupBox;
+
+    /**
+     * UniViewerAddressContainer object
+     * owned.
+     */
+    UniViewerAddressContainer *mAddressContainer;
+
+    /**
+     * UniViewerAttachmentContainer object
+     * owned.
+     */
+    UniViewerAttachmentContainer *mAttachmentContainer;
+};
+
+#endif /* UNIVIEWER_HEADER_CONTAINER_H */
+
+// EOF
--- a/messagingapp/msgui/unifiedviewer/inc/univiewertextitem.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/inc/univiewertextitem.h	Mon May 03 12:29:07 2010 +0300
@@ -21,7 +21,7 @@
 #define UNIVIEWERTEXTITEM_H
 
 #include <HbTextEdit>
-
+#include <xqappmgr.h>
 
 //forward declarations
 class QRegExp;
@@ -105,6 +105,20 @@
     void saveToContacts();
     void copyToClipboard();
     
+    /**
+     * Slot for handling valid returns from the framework.
+     * 
+     * @param result const QVariant&
+     */
+    void handleOk(const QVariant& result);
+    
+    /**
+     * Slot for handling errors. Error ids are provided as 
+     * 32-bit integers.
+     * @param errorCode qint32
+     */
+    void handleError(int errorCode, const QString& errorMessage);
+
     //called after service request is completed.
     void onServiceRequestCompleted();
     
@@ -128,6 +142,8 @@
 
     //Current cursor position.
     int mCursorPos;
+
+    XQApplicationManager mAppManager;
 };
 
 #endif // UNIVIEWERTEXTITEM_H
--- a/messagingapp/msgui/unifiedviewer/inc/univiewslidewidget.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/inc/univiewslidewidget.h	Mon May 03 12:29:07 2010 +0300
@@ -22,13 +22,9 @@
 #include <qobject.h>
 
 class QGraphicsLinearLayout;
-class UniViewerDetailsWidget;
 class UniViewerBodyWidget;
 class UniViewerFeeder;
-class ConvergedMessage;
-class HbGroupBox;
-class UniViewerAddressContainer;
-class UniViewerAttachmentContainer;
+class UniViewerHeaderContainer;
 
 /**
  * This widget is place holder for message headers and body
@@ -69,7 +65,6 @@
 
     /**
      * Populates the content on the widget
-     * @param messageDetails message details
      */
     void populateContent();
 
@@ -80,10 +75,11 @@
     void populateFirstSlide();
 
 signals:
-        /**
-         * this signal is emitted when sendMessage is emitted. from UniViewerTextItem.
-         */
-        void sendMessage(const QString& phoneNumber);
+
+    /**
+     * this signal is emitted when sendMessage is emitted. from UniViewerTextItem.
+     */
+    void sendMessage(const QString& phoneNumber);
 
 private:
 
@@ -106,12 +102,6 @@
     QGraphicsLinearLayout* mMainLayout;
 
     /**
-     * UniViewerDetailsWidget object
-     * Owned
-     */
-    UniViewerDetailsWidget *mViewerDetails;
-
-    /**
      * UniViewerFeeder object
      * Owned
      */
@@ -119,27 +109,15 @@
 
     /**
      * UniViewerBodyWidget object
-     * owned.
+     * Owned
      */
     UniViewerBodyWidget* mBody;
 
     /**
-     * HbGroupBox object
-     * owned.
+     * UniViewerHeaderContainer object
+     * Owned
      */
-    HbGroupBox *mHeaderGroupBox;
-
-    /**
-     * UniViewerAddressContainer object
-     * owned.
-     */
-    UniViewerAddressContainer *mAddressContainer;
-
-    /**
-     * UniViewerAttachmentContainer object
-     * owned.
-     */
-    UniViewerAttachmentContainer *mAttachmentContainer;
+    UniViewerHeaderContainer* mHeaderContainer;
 
 };
 
--- a/messagingapp/msgui/unifiedviewer/resources/layouts/univieweraddresswidget.css	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/resources/layouts/univieweraddresswidget.css	Mon May 03 12:29:07 2010 +0300
@@ -1,7 +1,7 @@
 
 UniViewerAddressWidget
 {
-  layout: layout-default;
+  layout:layout-default;
 }
 
 UniViewerAddressWidget::addressField
--- a/messagingapp/msgui/unifiedviewer/resources/layouts/univiewerbodywidget.css	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/resources/layouts/univiewerbodywidget.css	Mon May 03 12:29:07 2010 +0300
@@ -1,37 +1,84 @@
-HbWidget
+
+UniViewerBodyWidget[hasText="true"]:portrait
 {
-  margin-left:0un;
-  margin-top:0un;
+  layout: layout-portrait;
+  size-policy-vertical:minimum-expanding;
+  min-height:expr(var(hb-param-screen-height)-var(hb-param-widget-chrome-height)-var(hb-param-widget-toolbar-height)+1un);
 }
 
-UniViewerBodyWidget:portrait
+UniViewerBodyWidget[hasText="false"]:portrait
 {
-  layout: layout-portrait;
+  layout: layout-portrait-no-text;
+  size-policy-vertical:minimum-expanding;
+  min-height:expr(var(hb-param-screen-height)-var(hb-param-widget-chrome-height)-var(hb-param-widget-toolbar-height)+1un);
 }
 
-UniViewerBodyWidget:landscape[hasText="true"]
+UniViewerBodyWidget:landscape
 {
+  size-policy-vertical:minimum-expanding;
+  min-height:expr(var(hb-param-screen-height)-var(hb-param-widget-toolbar-height)+1un);
   layout: layout-landscape;
 }
 
-UniViewerBodyWidget:landscape[hasText="false"]
+UniViewerBodyWidget[hasText="true"][hasPixmap="false"]:landscape
 {
+  size-policy-vertical:minimum-expanding;
+  min-height:expr(var(hb-param-screen-height)-var(hb-param-widget-toolbar-height)+1un);
+  layout: layout-landscape-no-pixmap;
+}
+
+UniViewerBodyWidget[hasText="false"][hasPixmap="true"]:landscape
+{
+  size-policy-vertical:minimum-expanding;
+  min-height:expr(var(hb-param-screen-height)-var(hb-param-widget-toolbar-height)+1un);
   layout: layout-landscape-no-text;
 }
 
+UniViewerBodyWidget::slideCounter
+{
+  left:-var(hb-param-margin-gene-left);
+  top:-var(hb-param-margin-gene-middle-vertical);
+  right:var(hb-param-margin-gene-right);
+  text-height:var(hb-param-text-height-tiny);
+  text-line-count-min:1;
+  text-line-count-max:1;
+  text-align:left;
+  font-variant:secondary;
+}
+
+UniViewerBodyWidget::pixmap
+{
+  aspect-ratio:keep;
+  size-policy-vertical:fixed;
+  size-policy-horizontal:fixed;
+}
+
+
 UniViewerBodyWidget::pixmap:portrait
 {
   top:-var(hb-param-margin-gene-middle-vertical);
-  size-policy-vertical:fixed;
-  size-policy-horizontal:fixed;
+  left:-var(hb-param-margin-gene-left);
+  right:var(hb-param-margin-gene-right);
 }
 
-UniViewerBodyWidget::pixmap:landscape
+UniViewerBodyWidget[hasText="false"]::pixmap:portrait
+{
+  bottom:var(hb-param-margin-gene-bottom);
+}
+
+UniViewerBodyWidget[hasText="true"]::pixmap:landscape
 {
   top:-var(hb-param-margin-gene-middle-vertical);
   left:-var(hb-param-margin-gene-left);
-  size-policy-horizontal:fixed;
-  size-policy-vertical:fixed;
+  right:1un;
+}
+
+UniViewerBodyWidget[hasText="false"]::pixmap:landscape
+{
+  top:-var(hb-param-margin-gene-middle-vertical);
+  left:-var(hb-param-margin-gene-left);
+  right:var(hb-param-margin-gene-right);
+  bottom:var(hb-param-margin-gene-bottom);
 }
 
 UniViewerBodyWidget::audioItem
@@ -39,20 +86,38 @@
   left:-var(hb-param-margin-gene-left);
   top:-var(hb-param-margin-gene-middle-vertical);
   right:var(hb-param-margin-gene-right);
-  size-policy-vertical:fixed;
 }
 
 UniViewerBodyWidget::textItem
 {
-  left:-var(hb-param-margin-gene-left);
-  top:-var(hb-param-margin-gene-middle-vertical);
-  right:var(hb-param-margin-gene-right);
   text-height:var(hb-param-text-height-secondary);
   text-line-count-min:1;
   text-line-count-max:100;
   text-align: left top;
-  font-variant:primary;
+  font-variant:secondary;
   size-policy-vertical:minimum-expanding;
-  pref-height:-1;
+}
+
+UniViewerBodyWidget::textItem:portrait
+{
+  top:-var(hb-param-margin-gene-middle-vertical);
+  left:-var(hb-param-margin-gene-left);
+  right:var(hb-param-margin-gene-right);
 }
 
+UniViewerBodyWidget[hasPixmap="true"]::textItem:landscape
+{
+  left:-1un;
+  top:-var(hb-param-margin-gene-middle-vertical);
+  right:var(hb-param-margin-gene-right);
+  bottom:var(hb-param-margin-gene-bottom);
+}
+
+UniViewerBodyWidget[hasPixmap="false"]::textItem:landscape
+{
+  top:-var(hb-param-margin-gene-middle-vertical);
+  left:-var(hb-param-margin-gene-left);
+  right:var(hb-param-margin-gene-right);
+  bottom:var(hb-param-margin-gene-bottom);
+}
+
--- a/messagingapp/msgui/unifiedviewer/resources/layouts/univiewerbodywidget.widgetml	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/resources/layouts/univiewerbodywidget.widgetml	Mon May 03 12:29:07 2010 +0300
@@ -1,40 +1,85 @@
 <hbwidget version="0.1">
   <layout name="layout-portrait" type="mesh">
+     <meshitem src="slideCounter" srcEdge="LEFT" dst="" dstEdge="LEFT"  />
+     <meshitem src="slideCounter" srcEdge="TOP" dst="" dstEdge="TOP"  />
+     <meshitem src="slideCounter" srcEdge="RIGHT" dst="" dstEdge="RIGHT"  />
+
      <meshitem src="audioItem" srcEdge="LEFT" dst="" dstEdge="LEFT"  />
-     <meshitem src="audioItem" srcEdge="TOP" dst="" dstEdge="TOP"  />
+     <meshitem src="audioItem" srcEdge="TOP" dst="slideCounter" dstEdge="BOTTOM"  />
      <meshitem src="audioItem" srcEdge="RIGHT" dst="" dstEdge="RIGHT"  />
 
      <meshitem src="pixmap" srcEdge="TOP" dst="audioItem" dstEdge="BOTTOM"  />
-     <meshitem src="pixmap" srcEdge="CENTERH" dst="" dstEdge="CENTERH"  />
+     <meshitem src="pixmap" srcEdge="LEFT" dst="" dstEdge="LEFT" spacer="leftSpacer"  />
+     <meshitem src="pixmap" srcEdge="RIGHT" dst="" dstEdge="RIGHT"  spacer="rightSpacer"  />
 
      <meshitem src="textItem" srcEdge="TOP" dst="pixmap" dstEdge="BOTTOM" />
      <meshitem src="textItem" srcEdge="LEFT" dst="" dstEdge="LEFT" />
      <meshitem src="textItem" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
-     <meshitem src="textItem" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+     <meshitem src="textItem" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacer="bottomSpacer" />
+  </layout>
+
+  <layout name="layout-portrait-no-text" type="mesh">
+     <meshitem src="slideCounter" srcEdge="LEFT" dst="" dstEdge="LEFT"  />
+     <meshitem src="slideCounter" srcEdge="TOP" dst="" dstEdge="TOP"  />
+     <meshitem src="slideCounter" srcEdge="RIGHT" dst="" dstEdge="RIGHT"  />
+
+     <meshitem src="audioItem" srcEdge="LEFT" dst="" dstEdge="LEFT"  />
+     <meshitem src="audioItem" srcEdge="TOP" dst="slideCounter" dstEdge="BOTTOM"  />
+     <meshitem src="audioItem" srcEdge="RIGHT" dst="" dstEdge="RIGHT"  />
+
+     <meshitem src="pixmap" srcEdge="TOP" dst="audioItem" dstEdge="BOTTOM"  />
+     <meshitem src="pixmap" srcEdge="LEFT" dst="" dstEdge="LEFT" spacer="leftSpacer"  />
+     <meshitem src="pixmap" srcEdge="RIGHT" dst="" dstEdge="RIGHT"  spacer="rightSpacer"  />
+     <meshitem src="pixmap" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacer="bottomSpacer" />
   </layout>
 
   <layout name="layout-landscape" type="mesh">
+     <meshitem src="slideCounter" srcEdge="LEFT" dst="" dstEdge="LEFT"  />
+     <meshitem src="slideCounter" srcEdge="TOP" dst="" dstEdge="TOP"  />
+     <meshitem src="slideCounter" srcEdge="RIGHT" dst="" dstEdge="RIGHT"  />
+
      <meshitem src="audioItem" srcEdge="LEFT" dst="" dstEdge="LEFT"  />
-     <meshitem src="audioItem" srcEdge="TOP" dst="" dstEdge="TOP"  />
+     <meshitem src="audioItem" srcEdge="TOP" dst="slideCounter" dstEdge="BOTTOM"  />
      <meshitem src="audioItem" srcEdge="RIGHT" dst="" dstEdge="RIGHT"  />
 
-     <meshitem src="pixmap" srcEdge="TOP" dst="audioItem" dstEdge="BOTTOM" />
-     <meshitem src="pixmap" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+     <meshitem src="pixmap" srcEdge="TOP" dst="audioItem" dstEdge="BOTTOM"  />
+     <meshitem src="pixmap" srcEdge="LEFT" dst="" dstEdge="LEFT"  spacer="leftSpacer"   />
+     <meshitem src="pixmap" srcEdge="RIGHT" dst="" dstEdge="CENTERH"  spacer="rightSpacer"  />
+
+
+     <meshitem src="textItem" srcEdge="LEFT" dst="" dstEdge="CENTERH"  />
+     <meshitem src="textItem" srcEdge="TOP" dst="audioItem" dstEdge="BOTTOM"  />
+     <meshitem src="textItem" srcEdge="RIGHT" dst="" dstEdge="RIGHT"  />
+     <meshitem src="textItem" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacer="bottomSpacer"  />
+  </layout>
 
-     <meshitem src="textItem" srcEdge="LEFT" dst="pixmap" dstEdge="RIGHT" />
+  <layout name="layout-landscape-no-pixmap" type="mesh">
+     <meshitem src="slideCounter" srcEdge="LEFT" dst="" dstEdge="LEFT"  />
+     <meshitem src="slideCounter" srcEdge="TOP" dst="" dstEdge="TOP"  />
+     <meshitem src="slideCounter" srcEdge="RIGHT" dst="" dstEdge="RIGHT"  />
+
+     <meshitem src="audioItem" srcEdge="LEFT" dst="" dstEdge="LEFT"  />
+     <meshitem src="audioItem" srcEdge="TOP" dst="slideCounter" dstEdge="BOTTOM"  />
+     <meshitem src="audioItem" srcEdge="RIGHT" dst="" dstEdge="RIGHT"  />
+
+     <meshitem src="textItem" srcEdge="LEFT" dst="" dstEdge="LEFT" />
      <meshitem src="textItem" srcEdge="TOP" dst="audioItem" dstEdge="BOTTOM" />
      <meshitem src="textItem" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
-     <meshitem src="textItem" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
-
+     <meshitem src="textItem" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacer="bottomSpacer"  />
   </layout>
 
   <layout name="layout-landscape-no-text" type="mesh">
+     <meshitem src="slideCounter" srcEdge="LEFT" dst="" dstEdge="LEFT"  />
+     <meshitem src="slideCounter" srcEdge="TOP" dst="" dstEdge="TOP"  />
+     <meshitem src="slideCounter" srcEdge="RIGHT" dst="" dstEdge="RIGHT"  />
+
      <meshitem src="audioItem" srcEdge="LEFT" dst="" dstEdge="LEFT"  />
-     <meshitem src="audioItem" srcEdge="TOP" dst="" dstEdge="TOP"  />
+     <meshitem src="audioItem" srcEdge="TOP" dst="slideCounter" dstEdge="BOTTOM"  />
      <meshitem src="audioItem" srcEdge="RIGHT" dst="" dstEdge="RIGHT"  />
 
      <meshitem src="pixmap" srcEdge="TOP" dst="audioItem" dstEdge="BOTTOM"  />
-     <meshitem src="pixmap" srcEdge="CENTERH" dst="" dstEdge="CENTERH"  />
+     <meshitem src="pixmap" srcEdge="LEFT" dst="" dstEdge="LEFT" spacer="leftSpacer"  />
+     <meshitem src="pixmap" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacer="rightSpacer"  />
+     <meshitem src="pixmap" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacer="bottomSpacer"  />
   </layout>
-
 </hbwidget>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/unifiedviewer/resources/layouts/univiewerbodywidget_color.css	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,10 @@
+
+UniViewerBodyWidget::slideCounter
+{
+  color:var(qtc_view_normal);
+}
+
+UniViewerBodyWidget::textItem
+{
+  color:var(qtc_view_normal);
+}
\ No newline at end of file
--- a/messagingapp/msgui/unifiedviewer/resources/layouts/univiewerdetailswidget.css	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/resources/layouts/univiewerdetailswidget.css	Mon May 03 12:29:07 2010 +0300
@@ -15,11 +15,11 @@
   top:-var(hb-param-margin-gene-top);
   right:0.5un;
   bottom:var(hb-param-margin-gene-middle-vertical);
+  font-variant:secondary;
   text-height:var(hb-param-text-height-secondary);
   text-line-count-min:1;
   text-line-count-max:1;
   text-align: left;
-  font-variant: primary;
  }
 
 UniViewerDetailsWidget::subjectLabel
@@ -27,11 +27,11 @@
   left:-var(hb-param-margin-gene-left);
   right:var(hb-param-margin-gene-right);
   bottom:var(hb-param-margin-gene-bottom);
+  font-variant:primary;
   text-height:var(hb-param-text-height-primary);
   text-line-count-min:1;
   text-line-count-max:10;
-  text-align: left;
-  font-variant: primary;
+  text-align:left;
 }
 
 UniViewerDetailsWidget::priorityIcon
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/unifiedviewer/resources/layouts/univiewerdetailswidget_color.css	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,10 @@
+
+UniViewerDetailsWidget::timeLabel
+{
+  color:var(qtc_dataform_value);
+}
+
+UniViewerDetailsWidget::subjectLabel
+{
+  color:var(qtc_dataform_value);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/unifiedviewer/resources/layouts/univiewermediawidget_color.css	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,10 @@
+
+UniViewerMediaWidget::text-1
+{
+  color:var(qtc_list_item_title_normal);
+}
+
+UniViewerMediaWidget::text-2
+{
+  color:var(qtc_list_item_title_normal);
+}
\ No newline at end of file
--- a/messagingapp/msgui/unifiedviewer/src/unifiedviewer.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/src/unifiedviewer.cpp	Mon May 03 12:29:07 2010 +0300
@@ -24,6 +24,8 @@
 #include <hbmessagebox.h>
 #include <hbnotificationdialog.h>
 #include <HbStyleLoader>
+#include <centralrepository.h>       
+#include <MmsEngineDomainCRKeys.h>
 
 // USER INCLUDES
 #include "uniscrollarea.h"
@@ -36,18 +38,20 @@
 #include "conversationsengine.h"
 #include "debugtraces.h"
 #include "nativemessageconsts.h"
+#include "mmsconformancecheck.h"
+#include "UniEditorGenUtils.h" // This is needed for KDefaultMaxSize
 
 // LOCAL CONSTANTS
-const QString REPLY_ICON("qtg_mono_reply.svg");
-const QString REPLY_ALL_ICON("qtg_mono_reply_all.svg");
-const QString FORWARD_ICON("qtg_mono_forward.svg");
-const QString DELETE_ICON("qtg_mono_delete.svg");
+const QString REPLY_ICON("qtg_mono_reply");
+const QString REPLY_ALL_ICON("qtg_mono_reply_all");
+const QString FORWARD_ICON("qtg_mono_forward");
+const QString SEND_ICON("qtg_mono_send");
+const QString DELETE_ICON("qtg_mono_delete");
 
 //LOCALIZED CONSTANTS
 #define LOC_DELETE_MESSAGE hbTrId("txt_messaging_dialog_delete_message")
 #define LOC_BUTTON_DELETE hbTrId("txt_common_button_delete")
 #define LOC_BUTTON_CANCEL hbTrId("txt_common_button_cancel")
-#define LOC_DELETE_POPINFO hbTrId("txt_messaging_dpopinfo_message_deleted")
 
 //----------------------------------------------------------------------------
 // UnifiedViewer::UnifiedViewer
@@ -87,8 +91,6 @@
 
     setLayout(mMainLayout);
 
-    createToolBar();
-
     QDEBUG_WRITE("UnifiedViewer contruction End");
 }
 
@@ -99,7 +101,6 @@
 UnifiedViewer::~UnifiedViewer()
 {
     HbStyleLoader::unregisterFilePath(":/layouts");
-
 }
 
 //----------------------------------------------------------------------------
@@ -108,23 +109,27 @@
 //----------------------------------------------------------------------------
 void UnifiedViewer::createToolBar()
 {
-    HbToolBar *toolBar = this->toolBar();
-    toolBar->setOrientation(Qt::Horizontal);
+    HbToolBar* toolbar = this->toolBar();
+    toolbar->setOrientation(Qt::Horizontal);
 
-    HbAction* replyAction = new HbAction(HbIcon(REPLY_ICON), "", this);
-    toolBar->addAction(replyAction);
-
-    HbAction* replyAllAction = new HbAction(HbIcon(REPLY_ALL_ICON), "", this);
-    toolBar->addAction(replyAllAction);
+    int sendingState = mViewFeeder->sendingState();
 
-    HbAction* forwardAction = new HbAction(HbIcon(FORWARD_ICON), "", this);
-    toolBar->addAction(forwardAction);
+    if (mViewFeeder->sendingState() == ConvergedMessage::Failed)
+    {
+        toolbar->addAction(HbIcon(SEND_ICON), "");
+    }
+    else
+    {
+        toolbar->addAction(HbIcon(REPLY_ICON), "");
+        toolbar->addAction(HbIcon(REPLY_ALL_ICON), "");
+    }
 
-    HbAction* deleteAction = new HbAction(HbIcon(DELETE_ICON), "", this);
-    toolBar->addAction(deleteAction);
+    if (validateMsgForForward())
+    {
+        toolbar->addAction(HbIcon(FORWARD_ICON), "", this, SLOT(handleFwdAction()));
+    }
 
-    connect(deleteAction, SIGNAL(triggered()),
-    this, SLOT(handleDeleteAction()));
+    toolbar->addAction(HbIcon(DELETE_ICON), "", this, SLOT(handleDeleteAction()));
 }
 
 //---------------------------------------------------------------
@@ -175,6 +180,9 @@
 
     mContentsWidget->populateContent();
 
+    //Creation of toolbar now depends on content
+    createToolBar();
+    
     QDEBUG_WRITE("UnifiedViewer populateContent END");
 }
 
@@ -184,6 +192,31 @@
 //---------------------------------------------------------------
 void UnifiedViewer::handleFwdAction()
 {
+    ConvergedMessage message;
+    ConvergedMessageId id(mMessageId);
+    message.setMessageId(id);
+    if(mViewFeeder->msgType() == KSenduiMtmMmsUidValue)
+    {
+        message.setMessageType(ConvergedMessage::Mms);
+    }
+    else
+    {
+        message.setMessageType(ConvergedMessage::Sms);    
+    }
+
+    QByteArray dataArray;
+    QDataStream messageStream
+    (&dataArray, QIODevice::WriteOnly | QIODevice::Append);
+    message.serialize(messageStream);
+
+    QVariantList params;
+    params << MsgBaseView::UNIEDITOR; // target view
+    params << MsgBaseView::UNIVIEWER; // source view
+
+    params << dataArray;
+    params << MsgBaseView::FORWARD_MSG;
+        
+    emit switchView(params);
 }
 
 //---------------------------------------------------------------
@@ -211,7 +244,6 @@
         msgIdList << mMessageId;
 
         ConversationsEngine::instance()->deleteMessages(msgIdList);
-        HbNotificationDialog::launchDialog(LOC_DELETE_POPINFO);
 
         QVariantList param;
         if (mMsgCount > 1)
@@ -258,4 +290,26 @@
 
     emit switchView(params);
     }
+
+//---------------------------------------------------------------
+// UnifiedViewer::validateMsgForForward
+// @see header file
+//---------------------------------------------------------------
+bool UnifiedViewer::validateMsgForForward()
+{
+    if (mViewFeeder->msgType() == KSenduiMtmMmsUidValue)
+    {
+        bool retValue = false;
+
+        //Validate if the mms msg can be forwarded or not
+        MmsConformanceCheck* mmsConformanceCheck = new MmsConformanceCheck;        
+        retValue = mmsConformanceCheck->validateMsgForForward(mMessageId);
+
+        delete mmsConformanceCheck;        
+        return retValue;
+    }
+
+    return true;
+}
+
 // EOF
--- a/messagingapp/msgui/unifiedviewer/src/univieweraddresscontainer.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/src/univieweraddresscontainer.cpp	Mon May 03 12:29:07 2010 +0300
@@ -20,24 +20,25 @@
 // SYSTEM INCLUDES
 #include <QString>
 #include <QGraphicsLinearLayout>
+#include <HbIconItem>
 
 // USER INCLUDES
 #include "univieweraddresswidget.h"
 
 // LOCAL CONSTANTS
-#define LOC_FROM hbTrId("txt_messaging_formlabel_from    ")
-#define LOC_TO hbTrId("txt_messaging_viewer_formlabel_to        ")
-#define LOC_CC hbTrId("txt_messaging_viewer_formlabel_cc        ")
+#define LOC_FROM hbTrId("txt_messaging_formlabel_from")
+#define LOC_TO hbTrId("txt_messaging_viewer_formlabel_to")
+#define LOC_CC hbTrId("txt_messaging_viewer_formlabel_cc")
+
+// LOCAL CONSTANTS
+const QString DIVIDER_ICON("qtg_graf_divider_h_thin");
 
 //---------------------------------------------------------------
 // UniViewerAddressContainer :: UniViewerAddressContainer
 // @see header file
 //---------------------------------------------------------------
 UniViewerAddressContainer::UniViewerAddressContainer(QGraphicsItem *parent) :
-    HbWidget(parent), mMainLayout(NULL),
-    mFromWidget(NULL),
-    mToWidget(NULL),
-    mCcWidget(NULL)
+    HbWidget(parent), mMainLayout(0), mFromWidget(0), mToWidget(0), mCcWidget(0), mDivider(0)
 {
     mMainLayout = new QGraphicsLinearLayout(Qt::Vertical);
     mMainLayout->setContentsMargins(0, 0, 0, 0);
@@ -58,11 +59,9 @@
 // UniViewerAddressContainer :: setFromField
 // @see header file
 //---------------------------------------------------------------
-void UniViewerAddressContainer::setFromField(const QString& fromRecipient,
-                                             const QString& alias)
+void UniViewerAddressContainer::setFromField(const QString& fromRecipient, const QString& alias)
 {
-    if (!mFromWidget)
-    {
+    if (!mFromWidget) {
         mFromWidget = new UniViewerAddressWidget();
     }
 
@@ -74,11 +73,9 @@
 // UniViewerAddressContainer :: setToField
 // @see header file
 //---------------------------------------------------------------
-void UniViewerAddressContainer::setToField(
-    ConvergedMessageAddressList toRecipients)
+void UniViewerAddressContainer::setToField(ConvergedMessageAddressList toRecipients)
 {
-    if (!mToWidget)
-    {
+    if (!mToWidget) {
         mToWidget = new UniViewerAddressWidget();
     }
 
@@ -90,11 +87,9 @@
 //UniViewerAddressContainer :: setCcField
 // @see header file
 //---------------------------------------------------------------
-void UniViewerAddressContainer::setCcField(
-    ConvergedMessageAddressList ccRecipients)
+void UniViewerAddressContainer::setCcField(ConvergedMessageAddressList ccRecipients)
 {
-    if (!mCcWidget)
-    {
+    if (!mCcWidget) {
         mCcWidget = new UniViewerAddressWidget();
     }
 
@@ -108,29 +103,48 @@
 //---------------------------------------------------------------
 void UniViewerAddressContainer::clearContent()
 {
-    if (mFromWidget)
-    {
+    if (mFromWidget) {
         mMainLayout->removeItem(mFromWidget);
         mFromWidget->setParent(NULL);
         delete mFromWidget;
         mFromWidget = NULL;
     }
-    if (mToWidget)
-    {
+    if (mToWidget) {
         mMainLayout->removeItem(mToWidget);
         mToWidget->setParent(NULL);
         delete mToWidget;
         mToWidget = NULL;
     }
-    if (mCcWidget)
-    {
+    if (mCcWidget) {
         mMainLayout->removeItem(mCcWidget);
         mCcWidget->setParent(NULL);
         delete mCcWidget;
         mCcWidget = NULL;
     }
+    if (mDivider) {
+        mMainLayout->removeItem(mDivider);
+        mDivider->setParent(NULL);
+        delete mDivider;
+        mDivider = NULL;
+    }
 
     resize(rect().width(), -1);
 }
 
+//---------------------------------------------------------------
+// UniViewerAddressContainer :: insertDivider
+// @see header file
+//---------------------------------------------------------------
+void UniViewerAddressContainer::insertDivider()
+{
+    if (!mDivider) {
+        mDivider = new HbIconItem(this);
+    }
+
+    mDivider->sizePolicy().setHorizontalPolicy(QSizePolicy::Expanding);
+    mDivider->sizePolicy().setVerticalPolicy(QSizePolicy::Fixed);
+    mDivider->setIconName(DIVIDER_ICON);
+    mMainLayout->addItem(mDivider);
+}
+
 // EOF
--- a/messagingapp/msgui/unifiedviewer/src/univieweraddresswidget.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/src/univieweraddresswidget.cpp	Mon May 03 12:29:07 2010 +0300
@@ -25,10 +25,11 @@
 
 // USER INCLUDES
 #include "unitexteditor.h"
-#include "debugtraces.h"
 
 // LOCAL CONSTANTS
 const QString ADDRESS_SEPARATOR("; ");
+const QString ADDRESS_OPEN(" (");
+const QString ADDRESS_CLOSE(")");
 
 //----------------------------------------------------------------------------
 // UniViewerAddressWidget::UniViewerAddressWidget
@@ -43,6 +44,8 @@
     connect(mAddress, SIGNAL(aboutToShowContextMenu(HbMenu *,QPointF)), this,
         SLOT(handleAboutToShowContextMenu(HbMenu *,QPointF)));
 
+    // TODO: Wrapping fix breaking normal scenarios.
+    // this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
 }
 
 //----------------------------------------------------------------------------
@@ -78,9 +81,9 @@
         QString alias1 = QString();
         if (UniViewerFeederPrivate::GetNameFromContacts(address, alias1) > 1)
         {
-            address1.append(" (");
+            address1.append(ADDRESS_OPEN);
             address1.append(address);
-            address1.append(")");
+            address1.append(ADDRESS_CLOSE);
         }
     }
     else
@@ -126,9 +129,9 @@
             if (UniViewerFeederPrivate::GetNameFromContacts(addressList[i]->address(),
                                                             alias) > 1)
             {
-                address.append(" (");
+                address.append(ADDRESS_OPEN);
                 address.append(addressList[i]->address());
-                address.append(")");
+                address.append(ADDRESS_CLOSE);
             }
         }
         else
--- a/messagingapp/msgui/unifiedviewer/src/univiewerbodywidget.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/src/univiewerbodywidget.cpp	Mon May 03 12:29:07 2010 +0300
@@ -21,6 +21,7 @@
 #include <QFileInfo>
 #include <QPixmap>
 #include <QGraphicsLayout>
+#include <QSignalMapper>
 
 #include <HbTextItem>
 #include <HbIconItem>
@@ -32,32 +33,35 @@
 #include <HbGesture>
 #include <HbGestureSceneFilter>
 
-#include "debugtraces.h"
-#include "univiewertextitem.h"
+#include <xqaiwrequest.h>
+#include <xqrequestinfo.h>
+#include <xqappmgr.h>
 
+#include "univiewertextitem.h"
+#include "msgmediautil.h"
 // LOCAL CONSTANTS
-const QString AUDIO_ICON("qtg_mono_audio.svg");
+const QString AUDIO_ICON("qtg_mono_audio");
+
+// Localization
+#define LOC_TITLE   hbTrId("txt_messaging_title_messaging")
 
 //---------------------------------------------------------------
 //UniViewerBodyWidget::UniViewerBodyWidget
 // @see header file
 //---------------------------------------------------------------
 UniViewerBodyWidget::UniViewerBodyWidget(QGraphicsItem *parent) :
-    HbWidget(parent), mHasText(false), mTextItem(0), mIconItem(0), mAudioItem(0)
+    HbWidget(parent), mHasText(false), mHasPixmap(false), mTextItem(0), mSlideCounter(0),
+        mIconItem(0), mAudioItem(0)
 {
-    //This is permanent item in the widget
-    mTextItem = new UniViewerTextItem(this);
-    HbStyle::setItemName(mTextItem, "textItem");
-
     //Gesture filter for the image
     gestureFilter = new HbGestureSceneFilter(Qt::LeftButton, this);
     gestureFilter->setLongpressAnimation(true);
     HbGesture *gesture = new HbGesture(HbGesture::longpress, 20);
     gestureFilter->addGesture(gesture);
     connect(gesture, SIGNAL(longPress(QPointF)), this, SLOT(longPressed(QPointF)));
-    
-    connect(mTextItem,SIGNAL(sendMessage(const QString&)),
-            this, SIGNAL(sendMessage(const QString&)));
+    // Signal mapper for opening media files
+    mSignalMapper = new QSignalMapper(this);
+    connect(mSignalMapper, SIGNAL(mapped(const QString &)), this, SLOT(openMedia(const QString &)));
 }
 
 //---------------------------------------------------------------
@@ -74,6 +78,7 @@
 //---------------------------------------------------------------
 void UniViewerBodyWidget::setImage(QString imagefile)
 {
+    setHasPixmap(true);
     //create image item instance
     if (!mIconItem) {
         mIconItem = new HbIconItem(this);
@@ -82,6 +87,11 @@
 
     QPixmap pixmap(imagefile);
     mIconItem->setIcon(HbIcon(pixmap));
+
+    // TODO
+    // Implementation for short tap action is unclear
+    // Connect to signal mapper
+
     this->repolish();
 }
 
@@ -98,8 +108,14 @@
     QFileInfo fileInfo(audiofile);
     mAudioItem->setIcon(HbIcon(AUDIO_ICON));
     mAudioItem->setText(fileInfo.baseName());
-    mAudioItem->setAdditionalText("00:00");
+    MsgMediaUtil mediaUtil;
+    mAudioItem->setAdditionalText(mediaUtil.mediaDuration(audiofile));
     mAudioItem->setTextAlignment(Qt::AlignLeft);
+
+    // Connect to signal mapper with file name
+    mSignalMapper->setMapping(mAudioItem, audiofile);
+    connect(mAudioItem, SIGNAL(clicked()), mSignalMapper, SLOT(map()));
+
     this->repolish();
 }
 
@@ -113,6 +129,145 @@
 }
 
 //---------------------------------------------------------------
+//UniViewerBodyWidget::setTextContent
+// @see header file
+//---------------------------------------------------------------
+void UniViewerBodyWidget::setTextContent(QString text)
+{
+    setHasText(true);
+
+    if (!mTextItem) {
+        mTextItem = new UniViewerTextItem(this);
+        HbStyle::setItemName(mTextItem, "textItem");
+        connect(mTextItem, SIGNAL(sendMessage(const QString&)), this,
+            SIGNAL(sendMessage(const QString&)));
+    }
+    text.replace(QChar::ParagraphSeparator, QChar::LineSeparator);
+    text.replace('\r', QChar::LineSeparator);
+    mTextItem->setText(text);
+    this->repolish();
+}
+
+//---------------------------------------------------------------
+//UniViewerBodyWidget::setTextContent
+// @see header file
+//---------------------------------------------------------------
+void UniViewerBodyWidget::setSlideCounter(QString &slideCounter)
+{
+    if (!mSlideCounter) {
+        mSlideCounter = new HbTextItem(this);
+        HbStyle::setItemName(mSlideCounter, "slideCounter");
+    }
+
+    mSlideCounter->setText(slideCounter);
+    this->repolish();
+}
+
+//---------------------------------------------------------------
+// UniViewerBodyWidget::setHasText
+// @see header file
+//---------------------------------------------------------------
+void UniViewerBodyWidget::setHasText(bool text)
+{
+    mHasText = text;
+}
+
+//---------------------------------------------------------------
+// UniViewerBodyWidget::hasText
+// @see header file
+//---------------------------------------------------------------
+bool UniViewerBodyWidget::hasText()
+{
+    return mHasText;
+}
+
+//---------------------------------------------------------------
+// UniViewerBodyWidget::setHasPixmap
+// @see header file
+//---------------------------------------------------------------
+void UniViewerBodyWidget::setHasPixmap(bool pixmap)
+{
+    mHasPixmap = pixmap;
+}
+
+//---------------------------------------------------------------
+// UniViewerBodyWidget::hasPixmap
+// @see header file
+//---------------------------------------------------------------
+bool UniViewerBodyWidget::hasPixmap()
+{
+    return mHasPixmap;
+}
+
+//---------------------------------------------------------------
+// UniViewerBodyWidget::setSlideContents
+// @see header file
+//---------------------------------------------------------------
+void UniViewerBodyWidget::setSlideContents(UniMessageInfoList objList, QString slideString)
+{
+    if (!slideString.isEmpty()) {
+        setSlideCounter(slideString);
+    }
+
+    int count = objList.count();
+    for (int a = 0; a < count; ++a) {
+        UniMessageInfo* info = objList.at(a);
+        QString type = info->mimetype();
+
+        if (type.contains("text")) {
+            QFile file(info->path());
+            if (file.open(QIODevice::ReadOnly))
+			{
+			QString textContent(file.readAll());
+            setTextContent(textContent);
+			}
+            
+        }
+        else if (type.contains("video")) {
+            setVideo(info->path());
+        }
+        else if (type.contains("audio")) {
+            setAudio(info->path());
+        }
+        else if (type.contains("image")) {
+            setImage(info->path());
+        }
+
+        delete info;
+    }
+}
+
+//---------------------------------------------------------------
+//UniViewerBodyWidget :: clearContent
+// @see header file
+//---------------------------------------------------------------
+void UniViewerBodyWidget::clearContent()
+{
+    // delete the temp items(pixmap) & clear permanent items(text)
+    if (mIconItem) {
+        mIconItem->setParent(NULL);
+        delete mIconItem;
+        mIconItem = NULL;
+    }
+
+    if (mAudioItem) {
+        mAudioItem->setParent(NULL);
+        delete mAudioItem;
+        mAudioItem = NULL;
+    }
+
+    if (mTextItem) {
+        mTextItem->setParent(NULL);
+        delete mTextItem;
+        mTextItem = NULL;
+    }
+
+    setHasText(false);
+    setHasPixmap(false);
+    repolish();
+}
+
+//---------------------------------------------------------------
 //UniViewerBodyWidget::resizeEvent
 // @see header file
 //---------------------------------------------------------------
@@ -129,6 +284,7 @@
         qreal chromeHeight = 0.0;
         qreal toolbarHeight = 0.0;
         qreal iconSize = 0.0;
+        qreal unitSize = HbDeviceProfile::profile(mIconItem).unitValue();
         style()->parameter("hb-param-screen-width", screenWidth);
         style()->parameter("hb-param-screen-height", screenHeight);
         style()->parameter("hb-param-margin-gene-left", leftMargin);
@@ -141,10 +297,13 @@
         qreal maxHeight = 0.0;
 
         if (mainWindow->orientation() == Qt::Horizontal) {
+            qreal temp;
+            temp = screenWidth;
+            screenWidth = screenHeight;
+            screenHeight = temp;
             if (mIconItem) {
                 if (mHasText) {
-                    maxWidth = (screenWidth / 2) - leftMargin
-                        - HbDeviceProfile::profile(mIconItem).unitValue();
+                    maxWidth = (screenWidth / 2) - leftMargin - unitSize;
                 }
                 else {
                     maxWidth = screenWidth - leftMargin - rightMargin;
@@ -192,10 +351,8 @@
                 widthToSet = heightToSet * (imageWidth / imageHeight);
             }
 
-            mIconItem->setMinimumWidth(widthToSet);
-            mIconItem->setMinimumHeight(heightToSet);
-            mIconItem->setMaximumWidth(widthToSet);
-            mIconItem->setMaximumHeight(heightToSet);
+            mIconItem->setPreferredWidth(widthToSet);
+            mIconItem->setPreferredHeight(heightToSet);
         }
     }
 }
@@ -206,6 +363,7 @@
 //---------------------------------------------------------------
 void UniViewerBodyWidget::longPressed(QPointF position)
 {
+
     HbMenu* menu = new HbMenu;
     menu->addAction(tr("Open"), this, SLOT(openMedia()));
     menu->addAction(tr("View details"), this, SLOT(viewDetails()));
@@ -219,7 +377,63 @@
 //---------------------------------------------------------------
 void UniViewerBodyWidget::openMedia()
 {
-    //open corresponding viewer app.
+}
+
+//---------------------------------------------------------------
+//UniViewerBodyWidget::openMedia
+// @see header file
+//---------------------------------------------------------------
+void UniViewerBodyWidget::openMedia(const QString& fileName)
+{
+    XQSharableFile sf;
+    XQAiwRequest* request = 0;
+
+    if (!sf.open(fileName)) {
+        return;
+    }
+
+    // Get handlers
+    XQApplicationManager appManager;
+    QList<XQAiwInterfaceDescriptor> fileHandlers = appManager.list(sf);
+    if (fileHandlers.count() > 0) {
+        XQAiwInterfaceDescriptor d = fileHandlers.first();
+        request = appManager.create(sf, d);
+
+        if (!request) {
+            sf.close();
+            return;
+        }
+    }
+    else {
+        sf.close();
+        return;
+    }
+
+    // Result handlers
+    connect(request, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleOk(const QVariant&)));
+    connect(request, SIGNAL(requestError(const QVariant&)), this,
+        SLOT(handleError(const QVariant&)));
+
+    request->setEmbedded(true);
+    request->setSynchronous(true);
+
+    // Fill args
+    QList<QVariant> args;
+    args << qVariantFromValue(sf);
+    request->setArguments(args);
+
+    // Fill headers
+    QString key("WindowTitle");
+    QVariant value(QString(LOC_TITLE));
+    XQRequestInfo info;
+    info.setInfo(key, value);
+    request->setInfo(info);
+
+    request->send();
+
+    // Cleanup
+    sf.close();
+    delete request;
 }
 
 //---------------------------------------------------------------
@@ -232,88 +446,21 @@
 }
 
 //---------------------------------------------------------------
-//UniViewerBodyWidget::setTextContent
+// UniViewerBodyWidget :: handleOk
 // @see header file
 //---------------------------------------------------------------
-void UniViewerBodyWidget::setTextContent(QString text)
+void UniViewerBodyWidget::handleOk(const QVariant& result)
 {
-    text.replace('\n', QChar::LineSeparator);
-    mTextItem->setText(text);
-    setHasText(true);
-}
-
-//---------------------------------------------------------------
-// UniViewerBodyWidget::hasText
-// @see header file
-//---------------------------------------------------------------
-bool UniViewerBodyWidget::hasText()
-{
-    return mHasText;
-}
-
-//---------------------------------------------------------------
-// UniViewerBodyWidget::setHasText
-// @see header file
-//---------------------------------------------------------------
-void UniViewerBodyWidget::setHasText(bool text)
-{
-    mHasText = text;
+    Q_UNUSED(result)
 }
 
 //---------------------------------------------------------------
-// UniViewerBodyWidget::setSlideContents
+// UniViewerBodyWidget :: handleError
 // @see header file
 //---------------------------------------------------------------
-void UniViewerBodyWidget::setSlideContents(UniMessageInfoList objList, QString slideString)
+void UniViewerBodyWidget::handleError(int errorCode, const QString& errorMessage)
 {
-    Q_UNUSED(slideString)
-
-    int count = objList.count();
-
-    for (int a = 0; a < count; ++a) {
-        UniMessageInfo* info = objList.at(a);
-        QString type = info->mimetype();
-
-        if (type.contains("video")) {
-            setVideo(info->path());
-        }
-        else if (type.contains("audio")) {
-            setAudio(info->path());
-        }
-        if (type.contains("image")) {
-            setImage(info->path());
-        }
-        else if (type.contains("text")) {
-            QFile file(info->path());
-            file.open(QIODevice::ReadOnly);
-            QString textContent(file.readAll());
-            setTextContent(textContent);
-        }
-        delete info;
-    }
+    Q_UNUSED(errorMessage)
+    Q_UNUSED(errorCode)
 }
-
-//---------------------------------------------------------------
-//UniViewerBodyWidget :: clearContent
-// @see header file
-//---------------------------------------------------------------
-void UniViewerBodyWidget::clearContent()
-{
-    // delete the temp items(pixmap) & clear permanent items(text)
-    if (mIconItem) {
-        mIconItem->setParent(NULL);
-        delete mIconItem;
-        mIconItem = NULL;
-    }
-
-    if (mAudioItem) {
-        mAudioItem->setParent(NULL);
-        delete mAudioItem;
-        mAudioItem = NULL;
-    }
-
-    mTextItem->setText(QString());
-    setHasText(false);
-}
-
 // EOF
--- a/messagingapp/msgui/unifiedviewer/src/univiewerdetailswidget.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/src/univiewerdetailswidget.cpp	Mon May 03 12:29:07 2010 +0300
@@ -26,21 +26,25 @@
 #include "convergedmessage.h"
 #include "debugtraces.h"
 
+// LOCALIZATION
+#define LOC_MESSAGE_RESEND hbTrId("txt_common_menu_resend_message")
+
 // LOCAL CONSTANTS
 const QString DATE_TIME_FORMAT("dd/MM/yy hh:mm ap"); //Date format.
+const QString TIME_FORMAT("hh:mm ap");
 
-const QString MSG_HIGH_PRIORITY_ICON("qtg_small_priority_high.svg");
-const QString MSG_LOW_PRIORITY_ICON("qtg_small_priority_low.svg");
+const QString MSG_HIGH_PRIORITY_ICON("qtg_small_priority_high");
+const QString MSG_LOW_PRIORITY_ICON("qtg_small_priority_low");
 
 //---------------------------------------------------------------
 // UniViewerDetailsWidget::UniViewerDetailsWidget
 // @see header file
 //---------------------------------------------------------------
 UniViewerDetailsWidget::UniViewerDetailsWidget(QGraphicsItem *parent) :
-    HbWidget(parent), mSubjectLabel(NULL),
-    mPriorityIcon(NULL)
+    HbWidget(parent), mSubjectLabel(0), mPriorityIcon(0)
 {
-    // This is the only permanent item & will not be removed
+    // Permanent items & will not be removed
+
     mTime = new HbTextItem(this);
     HbStyle::setItemName(mTime, "timeLabel");
 }
@@ -73,9 +77,15 @@
 //UniViewerDetailsWidget :: setTimeStamp
 // @see header file
 //---------------------------------------------------------------
-void UniViewerDetailsWidget::setTimeStamp(const QDateTime &aTimeStamp)
+void UniViewerDetailsWidget::setTimeStamp(const QDateTime &aTimeStamp, const int &aSendingState)
 {
-    mTime->setText(aTimeStamp.toString(DATE_TIME_FORMAT));
+
+    if (aSendingState == ConvergedMessage::Resend) {
+        mTime->setText(LOC_MESSAGE_RESEND + aTimeStamp.toString(TIME_FORMAT));
+    }
+    else {
+        mTime->setText(aTimeStamp.toString(DATE_TIME_FORMAT));        
+    }
 }
 
 //---------------------------------------------------------------
--- a/messagingapp/msgui/unifiedviewer/src/univiewerfeeder.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/src/univiewerfeeder.cpp	Mon May 03 12:29:07 2010 +0300
@@ -216,4 +216,9 @@
     return d_ptr->subject();
 }
 
+int UniViewerFeeder::sendingState()
+{
+    
+    return d_ptr->sendingState();    
+}
 // EOF
--- a/messagingapp/msgui/unifiedviewer/src/univiewerfeeder_p.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/src/univiewerfeeder_p.cpp	Mon May 03 12:29:07 2010 +0300
@@ -17,11 +17,7 @@
  */
 #include "univiewerfeeder_p.h"
 // SYSTEM INCLUDES
-#include <mtclreg.h>
-#include <mtclbase.h>
 #include <msvstd.h>
-#include <txtetext.h>
-#include <txtrich.h>
 #include <s60qconversions.h>
 #include <msvids.h>
 #include <qtcontactsglobal.h>
@@ -53,10 +49,10 @@
 {
     q_ptr = NULL;
     clearContent();
-    if(pluginLoader)
+    if(mPluginLoader)
     {
-        delete pluginLoader;
-        pluginLoader = NULL;
+        delete mPluginLoader;
+        mPluginLoader = NULL;
     }
 }
 
@@ -69,13 +65,12 @@
 {
     QDEBUG_WRITE("UniViewerFeederPrivate::initL start");
     TMsvId serviceId = KMsvNullIndexEntryId;
-    pluginInterface = NULL;
+    mPluginInterface = NULL;
     mMsgId = msgId;
-    pluginLoader = new UniDataModelLoader();
-    pluginLoader->loadPlugins();
-    pluginInterface = pluginLoader->getDataModelPlugin("sms");
+    mPluginLoader = new UniDataModelLoader();
+    mPluginInterface = mPluginLoader->getDataModelPlugin(ConvergedMessage::Sms);
 
-    mSession = pluginInterface->session();
+    mSession = mPluginInterface->session();
     mSession->GetEntry(msgId, serviceId, mEntry);
     QDEBUG_WRITE("UniViewerFeederPrivate::initL end");
 }
@@ -134,17 +129,26 @@
 // ---------------------------------------------------------------------------
 QString UniViewerFeederPrivate::subject()
 {
-    return pluginInterface->subject();
+    return mPluginInterface->subject();
 }
 
 // ---------------------------------------------------------------------------
+// UniViewerFeederPrivate::subject
+// Returns the message subject.
+// ---------------------------------------------------------------------------
+
+int UniViewerFeederPrivate::sendingState()
+{
+    return mEntry.SendingState();
+}
+// ---------------------------------------------------------------------------
 // UniViewerFeederPrivate::timeStamp
 // Returns the time stamp
 // ---------------------------------------------------------------------------
 QDateTime UniViewerFeederPrivate::timeStamp()
 {
 
-    return pluginInterface->timeStamp();
+    return mPluginInterface->timeStamp();
 }
 
 // ---------------------------------------------------------------------------
@@ -154,14 +158,12 @@
 void UniViewerFeederPrivate::fetchDetailsL()
 {
     QDEBUG_WRITE("UniViewerFeederPrivate fetchDetailsL : SMS start");
-
     if (msgType() == KSenduiMtmSmsUidValue)
     {
         QString body;
-        pluginInterface->body(body);
+        mPluginInterface->body(body);
         q_ptr->emitMsgBody(body);
     }
-
     QDEBUG_WRITE("UniViewerFeederPrivate fetchDetailsL : SMS END");
 }
 
@@ -171,7 +173,7 @@
 // ---------------------------------------------------------------------------
 bool UniViewerFeederPrivate::hasAttachments()
 {
-    return pluginInterface->hasAttachment();
+    return mPluginInterface->hasAttachment();
 }
 // ---------------------------------------------------------------------------
 // UniViewerFeederPrivate::attachmentsList
@@ -179,7 +181,7 @@
 // ---------------------------------------------------------------------------
 UniMessageInfoList UniViewerFeederPrivate::attachmentsList()
 {
-    return pluginInterface->attachmentList();
+    return mPluginInterface->attachmentList();
 }
 
 // ---------------------------------------------------------------------------
@@ -188,7 +190,7 @@
 // ---------------------------------------------------------------------------
 int UniViewerFeederPrivate::attachmentCount()
 {
-    return pluginInterface->attachmentCount();
+    return mPluginInterface->attachmentCount();
 }
 
 // ---------------------------------------------------------------------------
@@ -197,7 +199,7 @@
 // ---------------------------------------------------------------------------
 UniMessageInfoList UniViewerFeederPrivate::objectsList()
 {
-    return pluginInterface->objectList();
+    return mPluginInterface->objectList();
 }
 
 // ---------------------------------------------------------------------------
@@ -206,7 +208,7 @@
 // ---------------------------------------------------------------------------
 int UniViewerFeederPrivate::objectCount()
 {
-    return pluginInterface->objectCount();
+    return mPluginInterface->objectCount();
 }
 
 // ---------------------------------------------------------------------------
@@ -224,7 +226,7 @@
 // ---------------------------------------------------------------------------
 UniMessageInfoList UniViewerFeederPrivate::slideContent(int slidenum)
 {
-    return pluginInterface->slideContent(slidenum);
+    return mPluginInterface->slideContent(slidenum);
 }
 
 // ---------------------------------------------------------------------------
@@ -244,18 +246,18 @@
 
     if (msgType() == KSenduiMtmSmsUidValue)
     {
-        pluginInterface = pluginLoader->getDataModelPlugin("sms");
-        pluginInterface->setMessageId(msgId);
+        mPluginInterface = mPluginLoader->getDataModelPlugin(ConvergedMessage::Sms);
+        mPluginInterface->setMessageId(msgId);
     }
 
     if (msgType() == KSenduiMtmMmsUidValue)
     {
-        pluginInterface = pluginLoader->getDataModelPlugin("mms");
-        pluginInterface->setMessageId(msgId);
-        mSlideCount = pluginInterface->slideCount();
+        mPluginInterface = mPluginLoader->getDataModelPlugin(ConvergedMessage::Mms);
+        mPluginInterface->setMessageId(msgId);
+        mSlideCount = mPluginInterface->slideCount();
     }
-    pluginInterface->toRecipientList(mToAddressList);
-    pluginInterface->ccRecipientList(mCcAddressList);
+    mPluginInterface->toRecipientList(mToAddressList);
+    mPluginInterface->ccRecipientList(mCcAddressList);
 }
 
 // ---------------------------------------------------------------------------
@@ -264,15 +266,12 @@
 // ---------------------------------------------------------------------------
 ConvergedMessageAddressList UniViewerFeederPrivate::toAddressList()
 {
+    QString alias = QString();
     for (int i = 0; i < mToAddressList.count(); ++i)
     {
-        if (mToAddressList.at(i)->alias().isEmpty())
-        {
-            QString alias = QString();
-            GetNameFromContacts(mToAddressList.at(i)->address(), alias);
-            mToAddressList.at(i)->setAlias(alias);
-            alias.clear();
-        }
+        GetNameFromContacts(mToAddressList.at(i)->address(), alias);
+        mToAddressList.at(i)->setAlias(alias);
+        alias.clear();
     }
     return mToAddressList;
 }
@@ -283,15 +282,13 @@
 // ---------------------------------------------------------------------------
 ConvergedMessageAddressList UniViewerFeederPrivate::ccAddressList()
 {
+    QString alias = QString();
     for (int i = 0; i < mCcAddressList.count(); ++i)
     {
-        if (mCcAddressList.at(i)->alias().isEmpty())
-        {
-            QString alias = QString();
-            GetNameFromContacts(mCcAddressList.at(i)->address(), alias);
-            mCcAddressList.at(i)->setAlias(alias);
-            alias.clear();
-        }
+        GetNameFromContacts(mCcAddressList.at(i)->address(), alias);
+        mCcAddressList.at(i)->setAlias(alias);
+        alias.clear();
+
     }
     return mCcAddressList;
 }
@@ -302,7 +299,7 @@
 // ---------------------------------------------------------------------------
 int UniViewerFeederPrivate::messageSize()
 {
-    return pluginInterface->messageSize();
+    return mPluginInterface->messageSize();
 }
 
 // ---------------------------------------------------------------------------
@@ -311,7 +308,7 @@
 // ---------------------------------------------------------------------------
 void UniViewerFeederPrivate::fromAddressAndAlias(QString& from, QString& alias)
 {
-    pluginInterface->fromAddress(from);
+    mPluginInterface->fromAddress(from);
     GetNameFromContacts(from, alias);
 }
 
@@ -351,31 +348,30 @@
 
     phoneFilter.setValue(address); // this is the phone number to be resolved
 
-    QList<QContactLocalId> matchingContacts =
-            contactManager.contacts(phoneFilter);
+    QList<QContactSortOrder> sortOrder;
+    QList<QContact> matchingContacts =
+            contactManager.contacts(phoneFilter,
+                                    sortOrder,
+                                    QStringList());
+                                    
     int count = 0;
     if (matchingContacts.count() > 0)
     {
-        QContact match = contactManager.contact(matchingContacts.at(0));
-        
-        QContactName name = match.detail(QContactName::DefinitionName);
-        QString nickName(match.detail<QContactNickname> ().nickname());
+        QContact match = matchingContacts.at(0);       
         
         QString displayLabel = match.displayLabel();
-          
+
+        if (displayLabel != "Unnamed")
+        {
+            alias.append(displayLabel);
+        }
+        
         QList<QContactPhoneNumber> numbers =
                 match.details<QContactPhoneNumber> ();
         count = numbers.count();
-        if(displayLabel != "Unnamed")
-        {
-            alias.append(displayLabel);
-        }
-        else if(!nickName.isEmpty())
-        {
-            alias.append(nickName);
-        }
-            
+     
     }
+    
     return count;
 }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgui/unifiedviewer/src/univiewerheadercontainer.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,239 @@
+/*
+ * 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: This widget holds the message header.
+ *
+ */
+
+#include "univiewerheadercontainer.h"
+
+// SYSTEM INCLUDES
+#include <QGraphicsLinearLayout>
+#include <HbGroupBox>
+#include <HbFrameItem>
+
+// USER INCLUDES
+#include "univieweraddresscontainer.h"
+#include "univiewerattachmentcontainer.h"
+#include "univiewerdetailswidget.h"
+#include "univiewerfeeder.h"
+
+#include "nativemessageconsts.h"
+
+// LOCALIZATION
+#define LOC_SEND_FAILED hbTrId("txt_messaging_formlabel_sending_failed")
+
+// LOCAL CONSTANTS
+const QString ADDR_LIST_SEPARATOR(", ");
+const QString BG_FRAME_GRAPHICS("qtg_fr_form_heading");
+
+//---------------------------------------------------------------
+// UniViewerHeaderContainer :: UniViewerHeaderContainer
+// @see header file
+//---------------------------------------------------------------
+UniViewerHeaderContainer::UniViewerHeaderContainer(UniViewerFeeder* feeder, QGraphicsItem *parent) :
+    HbWidget(parent), mViewFeeder(feeder), mViewerDetails(0), mHeaderGroupBox(0),
+        mAddressContainer(0), mAttachmentContainer(0)
+{
+    HbFrameItem *bgItem = new HbFrameItem(BG_FRAME_GRAPHICS, HbFrameDrawer::NinePieces, this);
+    this->setBackgroundItem(bgItem);
+
+    QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(Qt::Vertical);
+    mainLayout->setSpacing(0);
+    mainLayout->setContentsMargins(0, 0, 0, 0);
+
+    // Address Group box
+    mHeaderGroupBox = new HbGroupBox(this);
+
+    // Address container
+    mAddressContainer = new UniViewerAddressContainer(mHeaderGroupBox);
+
+    mHeaderGroupBox->setContentWidget(mAddressContainer);
+
+    // Viewer Details widget
+    mViewerDetails = new UniViewerDetailsWidget(this);
+
+    // Attachment Container
+    mAttachmentContainer = new UniViewerAttachmentContainer(this);
+
+    //Add address group box and insert into layout
+    mainLayout->addItem(mHeaderGroupBox);
+    mainLayout->addItem(mViewerDetails);
+    mainLayout->addItem(mAttachmentContainer);
+
+    this->setLayout(mainLayout);
+}
+
+//---------------------------------------------------------------
+// UniViewerHeaderContainer :: ~UniViewerHeaderContainer
+// @see header file
+//---------------------------------------------------------------
+UniViewerHeaderContainer::~UniViewerHeaderContainer()
+{
+
+}
+
+//---------------------------------------------------------------
+// UniViewerHeaderContainer :: populateContent
+// @see header file
+//---------------------------------------------------------------
+void UniViewerHeaderContainer::populateContent()
+{
+    setAddrGroupBoxHeading();
+
+    // Address container
+    populateAddressContainer();
+
+    // Time stamp
+    mViewerDetails->setTimeStamp(mViewFeeder->timeStamp(), mViewFeeder->sendingState());
+
+    // Priority
+    mViewerDetails->setPriorityIcon(mViewFeeder->priority());
+
+    // Subject
+    populateSubject();
+
+    // Attachment list
+    populateAttachments();
+
+    // Expand address group box for outgoing messages.
+    if (mViewFeeder->isIncoming()) {
+        mHeaderGroupBox->setCollapsed(true);
+    }
+    else {
+        mHeaderGroupBox->setCollapsed(false);
+    }
+}
+
+//---------------------------------------------------------------
+// UniViewerHeaderContainer :: clearContent
+// @see header file
+//---------------------------------------------------------------
+void UniViewerHeaderContainer::clearContent()
+{
+    if (mViewerDetails) {
+        mViewerDetails->clearContent();
+    }
+    if (mAddressContainer) {
+        mAddressContainer->clearContent();
+    }
+    if (mAttachmentContainer) {
+        mAttachmentContainer->clearContent();
+    }
+}
+
+//---------------------------------------------------------------
+// UniViewerHeaderContainer :: populateSubject
+// @see header file
+//---------------------------------------------------------------
+void UniViewerHeaderContainer::populateSubject()
+{
+    if (KSenduiMtmSmsUidValue == mViewFeeder->msgType()) {
+        if ((ConvergedMessage::Failed == mViewFeeder->sendingState()) && !mViewFeeder->isIncoming()) {
+            mViewerDetails->setSubject(LOC_SEND_FAILED);
+        }
+    }
+    else if (KSenduiMtmMmsUidValue == mViewFeeder->msgType()) {
+        QString subject;
+        if (ConvergedMessage::Failed == mViewFeeder->sendingState()) {
+            subject.append(LOC_SEND_FAILED);
+            subject.append(QChar::LineSeparator);
+        }
+        subject.append(mViewFeeder->subject());
+        if (!subject.isEmpty()) {
+            mViewerDetails->setSubject(subject);
+        }
+    }
+}
+
+//---------------------------------------------------------------
+// UniViewerHeaderContainer :: populateAttachments
+// @see header file
+//---------------------------------------------------------------
+void UniViewerHeaderContainer::populateAttachments()
+{
+    UniMessageInfoList attachList = mViewFeeder->attachmentsList();
+    for (int a = 0; a < attachList.count(); ++a) {
+        UniMessageInfo* info = attachList.at(a);
+        mAttachmentContainer->addAttachmentWidget(info->mimetype(), info->path());
+        delete info;
+    }
+}
+
+//---------------------------------------------------------------
+// UniViewerHeaderContainer :: populateAttachments
+// @see header file
+//---------------------------------------------------------------
+void UniViewerHeaderContainer::populateAddressContainer()
+{
+    QString from, alias;
+    mViewFeeder->fromAddressAndAlias(from, alias);
+    ConvergedMessageAddressList toList = mViewFeeder->toAddressList();
+
+    // From field is added ONLY for incoming messages.
+    if (mViewFeeder->isIncoming()) {
+        mAddressContainer->setFromField(from, alias);
+    }
+    // TO field is added ONLY for outgoing messages.
+    else if (!toList.isEmpty()) {
+        mAddressContainer->setToField(toList);
+    }
+
+    // CC field is added ONLY for MMS messages.
+    if (mViewFeeder->msgType() == KSenduiMtmMmsUidValue) {
+        ConvergedMessageAddressList ccList = mViewFeeder->ccAddressList();
+        if (!ccList.isEmpty()) {
+            mAddressContainer->setCcField(ccList);
+        }
+    }
+
+    mAddressContainer->insertDivider();
+}
+//---------------------------------------------------------------
+// UniViewerHeaderContainer :: setAddrGroupBoxHeading
+// @see header file
+//---------------------------------------------------------------
+void UniViewerHeaderContainer::setAddrGroupBoxHeading()
+{
+    if (mViewFeeder->isIncoming()) {
+        QString from, alias;
+        mViewFeeder->fromAddressAndAlias(from, alias);
+        (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);
+        }
+        mHeaderGroupBox->setHeading(toAddrList);
+    }
+}
+
+//---------------------------------------------------------------
+// UniViewerHeaderContainer :: createAddressList
+// @see header file
+//---------------------------------------------------------------
+QString UniViewerHeaderContainer::createAddressList(const ConvergedMessageAddressList &addressList)
+{
+    QString address;
+    for (int i = 0; i < addressList.count(); ++i) {
+        address.append((addressList[i]->alias().isEmpty()) ? addressList[i]->address()
+            : addressList[i]->alias());
+        address.append(ADDR_LIST_SEPARATOR);
+    }
+    address.chop(ADDR_LIST_SEPARATOR.size());
+    return address;
+}
--- a/messagingapp/msgui/unifiedviewer/src/univiewertextitem.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/src/univiewertextitem.cpp	Mon May 03 12:29:07 2010 +0300
@@ -30,7 +30,7 @@
 #include <cntservicescontact.h>
 #include <qtcontacts.h>
 #include <XQServiceRequest.h>
-
+#include <xqaiwrequest.h>
 
 QTM_USE_NAMESPACE
 
@@ -39,7 +39,7 @@
 //regexp
 const QString NUMBER_PATTERN("(\\(|\\+|\\d)((?:\\d{2,})((?:[\\s-/.\\)\\()])*(?:(\\d+|\\))))*)|((\\*#)(?:\\d+(\\*|#)(?:\\d+#)?))");
 
-const QString EMAIL_PATTERN("[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?");
+const QString EMAIL_PATTERN("[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?");
 
 const QString URL_PATTERN("(((ht|f|rt)(tp|sp)(s?)\\:\\/\\/)|(www|wap)(?:\\.))(([-\\w]*[0-9a-zA-Z])+(:(0-9)*)*(\\/?)([a-zA-Z0-9\\-\\?\\,\'\\/\\\\+&amp;%\\$#_=~]*)(\\.)([-\\w]*[0-9a-zA-Z])+(:(0-9)*)*(\\/?)([a-zA-Z0-9\\-\\?\\,\'\\/\\\\+&amp;%\\$#_=~]*))+");
 
@@ -314,8 +314,8 @@
         connect(serviceRequest, SIGNAL(requestError(int)),
                 this, SLOT(onServiceRequestCompleted()));
         
-       *serviceRequest << phoneNumber;
-       serviceRequest->send();
+        *serviceRequest << phoneNumber;
+        serviceRequest->send();
     }
 }
 
@@ -337,11 +337,41 @@
 {
     HbAction* action = qobject_cast<HbAction*>(sender());
 
-    if(action)
+    if ( action )
     {
         QString emailId = action->data().toString();
         emailId.remove(EMAIL_RULE);
-        //invoke email editor service & pass emailId.
+
+        // Launch email editor
+        QString serviceName("com.nokia.services.commonemail");
+        QString interfaceName("imessage.send");
+        QString operation("send(QVariant)");
+        XQAiwRequest* request = mAppManager.create(serviceName, interfaceName, 
+			operation, true); 
+        if ( request == NULL )
+            {
+            return;       
+            }
+    
+        // Fill args
+        QStringList recipients;
+        recipients.append(emailId);
+    
+        QMap<QString,QVariant> map;
+        map.insert(QString("to"),recipients);
+    
+        QList<QVariant> args;
+        args.append(map);
+        
+        // Result handlers
+        connect (request, SIGNAL(requestOk(const QVariant&)), 
+         this, SLOT(handleOk(const QVariant&)));
+        connect (request, SIGNAL(requestError(const QVariant&)), 
+             this, SLOT(handleError(const QVariant&)));
+        
+        request->setArguments(args);
+        request->send();
+        delete request;       
     }
 }
 
@@ -433,18 +463,24 @@
         }
         
         //service stuff.
-        QString serviceName("com.nokia.services.phonebookservices.Fetch");
+        QString serviceName("com.nokia.services.phonebookservices");
      
-        XQServiceRequest* serviceRequest = new XQServiceRequest(serviceName,operation,false);
+        XQAiwRequest* request;
+        request = mAppManager.create(serviceName, "Fetch", operation, true); // embedded
+        if ( request == NULL )
+            {
+            return;       
+            }
+
+        // Result handlers
+        connect (request, SIGNAL(requestOk(const QVariant&)), 
+			this, SLOT(handleOk(const QVariant&)));
+        connect (request, SIGNAL(requestError(const QVariant&)), 
+			this, SLOT(handleError(const QVariant&)));
         
-        connect(serviceRequest, SIGNAL(requestCompleted(QVariant)),
-                this, SLOT(onServiceRequestCompleted()));
-        
-        connect(serviceRequest, SIGNAL(requestError(int)),
-                this, SLOT(onServiceRequestCompleted()));
-        
-        serviceRequest->setArguments(args);
-        serviceRequest->send();
+        request->setArguments(args);
+        request->send();
+        delete request;
     }
 }
 
@@ -479,11 +515,15 @@
     phoneFilter.setValue(value);
     phoneFilter.setMatchFlags(QContactFilter::MatchEndsWith);
 
-    QList<QContactLocalId> matchingContacts = phonebookManager.contacts(phoneFilter);
+    QList<QContactSortOrder> sortOrder;
+    QList<QContact> matchingContacts = phonebookManager.contacts(
+            phoneFilter,
+            sortOrder,
+            QStringList());
 
     if ( matchingContacts.count() > 0 ) 
         {       
-        contactId = matchingContacts.at(0);   
+        contactId = matchingContacts.at(0).localId();;   
         }
     
     return contactId;
@@ -528,3 +568,22 @@
         }
     }
 }
+
+//---------------------------------------------------------------
+// UniViewerTextItem::handleOk
+//
+//---------------------------------------------------------------
+void UniViewerTextItem::handleOk(const QVariant& result)
+    {
+    Q_UNUSED(result)
+    }
+
+//---------------------------------------------------------------
+// UniViewerTextItem::handleError
+// 
+//---------------------------------------------------------------
+void UniViewerTextItem::handleError(int errorCode, const QString& errorMessage)
+    {
+    Q_UNUSED(errorMessage)
+    Q_UNUSED(errorCode)
+    }
--- a/messagingapp/msgui/unifiedviewer/src/univiewslidewidget.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/src/univiewslidewidget.cpp	Mon May 03 12:29:07 2010 +0300
@@ -19,71 +19,52 @@
 
 // SYSTEM INCLUDES
 #include <QGraphicsLinearLayout>
-#include <HbGroupBox>
 
 // USER INCLUDES
-#include "univieweraddresscontainer.h"
-#include "univiewerattachmentcontainer.h"
-#include "univiewerdetailswidget.h"
 #include "univiewerbodywidget.h"
-#include "convergedmessage.h"
 #include "univiewerfeeder.h"
+#include "univiewerheadercontainer.h"
+#include "nativemessageconsts.h"
 
-#include "nativemessageconsts.h"
+#define LOC_SLIDE_COUNTER hbTrId("txt_messaging_formlabel_slide_l1l2")
+
 //---------------------------------------------------------------
-//UniViewSlideWidget :: UniViewSlideWidget
+// UniViewSlideWidget :: UniViewSlideWidget
 // @see header file
 //---------------------------------------------------------------
 UniViewSlideWidget::UniViewSlideWidget(UniViewerFeeder* feeder, int slideNumber,
     QGraphicsItem * parent) :
-    HbWidget(parent), mInsideLayout(false), mSlideNumber(slideNumber), mViewerDetails(NULL),
-        mViewFeeder(feeder), mHeaderGroupBox(NULL), mAddressContainer(NULL), mAttachmentContainer(
-            NULL)
+    HbWidget(parent), mInsideLayout(false), mSlideNumber(slideNumber), mViewFeeder(feeder),
+        mHeaderContainer(0)
 
 {
+    mMainLayout = new QGraphicsLinearLayout(Qt::Vertical);
+    mMainLayout->setSpacing(0);
+    mMainLayout->setContentsMargins(0, 0, 0, 0);
 
-    mMainLayout = new QGraphicsLinearLayout(Qt::Vertical);
     mBody = new UniViewerBodyWidget(this);
-    
-    connect(mBody,SIGNAL(sendMessage(const QString&)),
-            this, SIGNAL(sendMessage(const QString&)));
+
+    connect(mBody, SIGNAL(sendMessage(const QString&)), this, SIGNAL(sendMessage(const QString&)));
 
-    // If its a first slide create the headers and attach
-    // to the main layout
+    /**
+     * If its a first slide create the headers and attach to the main layout
+     */
     if (mSlideNumber == 0) {
-        // Creation of address group box and adding address container
-        mHeaderGroupBox = new HbGroupBox(this);
-        mHeaderGroupBox->setCollapsed(true);
-        mHeaderGroupBox->setCollapsable(true);
-
-        mAddressContainer = new UniViewerAddressContainer(mHeaderGroupBox);
+        mHeaderContainer = new UniViewerHeaderContainer(mViewFeeder, this);
 
-        mHeaderGroupBox->setContentWidget(mAddressContainer);
-
-        mViewerDetails = new UniViewerDetailsWidget(this);
-
-        mAttachmentContainer = new UniViewerAttachmentContainer(this);
-
-        //Always connect to populate sms content
+        // Always connect to populate sms content
         connect(mViewFeeder, SIGNAL(msgBody(QString)), mBody, SLOT(setTextContent(QString)));
 
-        //Add address group box and insert into layout
-        mViewerDetails->sizePolicy().setVerticalPolicy(QSizePolicy::Fixed);
-        mMainLayout->addItem(mHeaderGroupBox);
-        mMainLayout->addItem(mViewerDetails);
-        mMainLayout->addItem(mAttachmentContainer);
+        mMainLayout->addItem(mHeaderContainer);
     }
 
     mMainLayout->addItem(mBody);
 
-    mMainLayout->setSpacing(0);
-    mMainLayout->setContentsMargins(0, 0, 0, 0);
-
     setLayout(mMainLayout);
 }
 
 //---------------------------------------------------------------
-//UniViewSlideWidget::~UniViewSlideWidget
+// UniViewSlideWidget::~UniViewSlideWidget
 // @see header file
 //---------------------------------------------------------------
 UniViewSlideWidget::~UniViewSlideWidget()
@@ -97,14 +78,8 @@
 //---------------------------------------------------------------
 void UniViewSlideWidget::clearContent()
 {
-    if (mViewerDetails) {
-        mViewerDetails->clearContent();
-    }
-    if (mAddressContainer) {
-        mAddressContainer->clearContent();
-    }
-    if (mAttachmentContainer) {
-        mAttachmentContainer->clearContent();
+    if (mHeaderContainer) {
+        mHeaderContainer->clearContent();
     }
     if (mBody) {
         mBody->clearContent();
@@ -112,7 +87,7 @@
 }
 
 //---------------------------------------------------------------
-//UniViewSlideWidget::populateContent
+// UniViewSlideWidget::populateContent
 // @see header file
 //---------------------------------------------------------------
 void UniViewSlideWidget::populateContent()
@@ -122,156 +97,27 @@
         populateFirstSlide();
     }
 
-    if (mViewFeeder->msgType() == KSenduiMtmMmsUidValue
-            && mViewFeeder->slideCount() > 0)
-    {
+    if (mViewFeeder->msgType() == KSenduiMtmMmsUidValue) {
         QString slideString;
-        slideString = QString("%1 %2/%3").arg(tr("Slide")). arg(mSlideNumber + 1).arg(
-            mViewFeeder->slideCount());
+        if (mViewFeeder->slideCount() > 1) {
+            slideString = QString(LOC_SLIDE_COUNTER).arg(mSlideNumber + 1).arg(
+                mViewFeeder->slideCount());
+        }
         mBody->setSlideContents(mViewFeeder->slideContent(mSlideNumber), slideString);
-
     }
 }
 
 //---------------------------------------------------------------
-//UniViewSlideWidget::populateFirstSlide
+// UniViewSlideWidget::populateFirstSlide
 // @see header file
 //---------------------------------------------------------------
 void UniViewSlideWidget::populateFirstSlide()
 {
-    //Populate the name for the groupbox
-    ConvergedMessageAddressList toList = mViewFeeder->toAddressList();
-    ConvergedMessageAddressList ccList = mViewFeeder->ccAddressList();
-
-    if (!mViewFeeder->isIncoming())
-    {
-        QString address = QString();
-        if (toList.count() > 0)
-        {
-            if (! (toList[0]->alias().isEmpty()))
-            {
-                address.append(toList[0]->alias());
-            }
-            else
-            {
-                address.append(toList[0]->address());
-            }
-        }
-        for (int i = 1; i < toList.count(); ++i)
-        {
-            if (! (toList[i]->alias().isEmpty()))
-            {
-                address.append(", ");
-                address.append(toList[i]->alias());
-            }
-            else
-            {
-                address.append(", ");
-                address.append(toList[i]->address());
-            }
-        }
-
-        if (ccList.count() > 0)
-        {
-            if (toList.count() > 0)
-            {
-                address.append(", ");
-            }
-            if (! (ccList[0]->alias().isEmpty()))
-            {
-                address.append(ccList[0]->alias());
-            }
-            else
-            {
-                address.append(ccList[0]->address());
-            }
-        }
-
-        for (int j = 1; j < ccList.count(); ++j)
-        {
-            if (! (ccList[j]->alias().isEmpty()))
-            {
-                address.append(", ");
-                address.append(ccList[j]->alias());
-
-            }
-            else
-            {
-                address.append(", ");
-                address.append(ccList[j]->address());
-
-            }
-        }
-        mHeaderGroupBox->setHeading(address);
-        mHeaderGroupBox->setCollapsed(false);
-    }
-    else
-    {
-        QString from = QString();
-        QString alias = QString();
-        mViewFeeder->fromAddressAndAlias(from, alias);
-        if (alias.isEmpty())
-        {
-            mHeaderGroupBox->setHeading(from);
-        }
-        else
-        {
-            mHeaderGroupBox->setHeading(alias);
-        }
-
-        mHeaderGroupBox->setCollapsed(true);
-    }
-
-    // Set the From fields details 
-    if (mViewFeeder->isIncoming())
-    {
-        QString from = QString();
-        QString alias = QString();
-        mViewFeeder->fromAddressAndAlias(from, alias);
-        mAddressContainer->setFromField(from, alias);
-    }
-
-    // Set the To/Cc fields details 
-    if (mViewFeeder->msgType() == KSenduiMtmSmsUidValue)
-    {
-        if (!mViewFeeder->isIncoming())
-        {
-            mAddressContainer->setToField(toList);
-        }
-    }
-    else if (mViewFeeder->msgType() == KSenduiMtmMmsUidValue)
-    {
-        mViewerDetails->setSubject(mViewFeeder->subject());
-        mViewerDetails->setPriorityIcon(mViewFeeder->priority());
-
-        if (!toList.isEmpty())
-        {
-            mAddressContainer->setToField(toList);
-        }
-        if (!ccList.isEmpty())
-        {
-            mAddressContainer->setCcField(ccList);
-        }
-
-        UniMessageInfoList attachList = mViewFeeder->attachmentsList();
-        int count = attachList.count();
-
-        for (int a = 0; a < count; ++a)
-        {
-            UniMessageInfo* info = attachList.at(a);
-            QString type = info->mimetype();
-
-            mAttachmentContainer->addAttachmentWidget(type, info->path());
-            delete info;
-        }
-    }
-    // Time stamp
- 
-    mViewerDetails->setTimeStamp(mViewFeeder->timeStamp());
+    mHeaderContainer->populateContent();
 }
 
 //---------------------------------------------------------------
-//UniViewSlideWidget::insideLayout
+// UniViewSlideWidget::insideLayout
 // @see header file
 //---------------------------------------------------------------
 bool UniViewSlideWidget::insideLayout()
@@ -280,7 +126,7 @@
 }
 
 //---------------------------------------------------------------
-//UniViewSlideWidget::setInsideLayout
+// UniViewSlideWidget::setInsideLayout
 // @see header file
 //---------------------------------------------------------------
 void UniViewSlideWidget::setInsideLayout(bool inside)
--- a/messagingapp/msgui/unifiedviewer/unifiedviewer.pro	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/unifiedviewer.pro	Mon May 03 12:29:07 2010 +0300
@@ -23,6 +23,8 @@
 INCLUDEPATH += .
 INCLUDEPATH += ../../../inc
 INCLUDEPATH += ../appengine/inc
+INCLUDEPATH += ../msguiutils/inc
+INCLUDEPATH += . ../../msgutils/unieditorutils/editorgenutils/inc
 INCLUDEPATH += . ../../msgutils/s60qconversions/inc
 INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
 
@@ -63,7 +65,8 @@
            inc/univieweraddresscontainer.h \
            inc/univiewermediawidget.h \
            inc/univiewerattachmentcontainer.h \
-           inc/univiewertextitem.h
+           inc/univiewertextitem.h \
+           inc/univiewerheadercontainer.h
 
 SOURCES += src/unifiedviewer.cpp \
            src/unicontentswidget.cpp \
@@ -79,7 +82,8 @@
            src/univieweraddresscontainer.cpp \
            src/univiewermediawidget.cpp \
            src/univiewerattachmentcontainer.cpp \
-           src/univiewertextitem.cpp
+           src/univiewertextitem.cpp \
+           src/univiewerheadercontainer.cpp
 
 
 RESOURCES += unifiedviewer.qrc
@@ -92,4 +96,7 @@
        -lappengine \
        -lunidatamodelloader \
        -lxqservice \
-       -lQtContacts 
+       -lQtContacts \
+       -lmsguiutils \
+       -lcentralrepository \
+       -lxqserviceutil
--- a/messagingapp/msgui/unifiedviewer/unifiedviewer.qrc	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgui/unifiedviewer/unifiedviewer.qrc	Mon May 03 12:29:07 2010 +0300
@@ -3,10 +3,13 @@
         <file alias="univieweraddresswidget.css">resources/layouts/univieweraddresswidget.css</file>
         <file alias="univieweraddresswidget.widgetml">resources/layouts/univieweraddresswidget.widgetml</file>
         <file alias="univiewerbodywidget.css">resources/layouts/univiewerbodywidget.css</file>
+        <file alias="univiewerbodywidget_color.css">resources/layouts/univiewerbodywidget_color.css</file>
         <file alias="univiewerbodywidget.widgetml">resources/layouts/univiewerbodywidget.widgetml</file>
         <file alias="univiewerdetailswidget.css">resources/layouts/univiewerdetailswidget.css</file>
+        <file alias="univiewerdetailswidget_color.css">resources/layouts/univiewerdetailswidget_color.css</file>
         <file alias="univiewerdetailswidget.widgetml">resources/layouts/univiewerdetailswidget.widgetml</file>
         <file alias="univiewermediawidget.css">resources/layouts/univiewermediawidget.css</file>
+        <file alias="univiewermediawidget_color.css">resources/layouts/univiewermediawidget_color.css</file>
         <file alias="univiewermediawidget.widgetml">resources/layouts/univiewermediawidget.widgetml</file>
     </qresource>
 </RCC>
--- a/messagingapp/msgutils/bwins/convergedmessageutilsu.def	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgutils/bwins/convergedmessageutilsu.def	Mon May 03 12:29:07 2010 +0300
@@ -67,4 +67,6 @@
 	?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
 
--- a/messagingapp/msgutils/bwins/unidatamodelloaderu.def	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-EXPORTS
-	??1UniDataModelLoader@@QAE@XZ @ 1 NONAME ; UniDataModelLoader::~UniDataModelLoader(void)
-	?getDataModelPlugin@UniDataModelLoader@@QAEPAVUniDataModelPluginInterface@@ABVQString@@@Z @ 2 NONAME ; class UniDataModelPluginInterface * UniDataModelLoader::getDataModelPlugin(class QString const &)
-	?loadPlugins@UniDataModelLoader@@QAEXXZ @ 3 NONAME ; void UniDataModelLoader::loadPlugins(void)
-	??0UniDataModelLoader@@QAE@XZ @ 4 NONAME ; UniDataModelLoader::UniDataModelLoader(void)
-
--- a/messagingapp/msgutils/bwins/unieditorutilsu.def	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-EXPORTS
-	?absoluteMaxSmsCharactersL@UniEditorGenUtils@@AAEHXZ @ 1 NONAME ; int UniEditorGenUtils::absoluteMaxSmsCharactersL(void)
-	??0UniEditorGenUtils@@QAE@XZ @ 2 NONAME ; UniEditorGenUtils::UniEditorGenUtils(void)
-	??0CMuiuOperationWait@@IAE@H@Z @ 3 NONAME ; CMuiuOperationWait::CMuiuOperationWait(int)
-	?MaxSmsRecipientsL@UniEditorGenUtils@@QAEHXZ @ 4 NONAME ; int UniEditorGenUtils::MaxSmsRecipientsL(void)
-	?unicodeCharacterMode@UniEditorGenUtils@@AAE_NXZ @ 5 NONAME ; bool UniEditorGenUtils::unicodeCharacterMode(void)
-	?Start@CMuiuOperationWait@@QAEXXZ @ 6 NONAME ; void CMuiuOperationWait::Start(void)
-	?MaxSmsMsgSizeL@UniEditorGenUtils@@QAEHXZ @ 7 NONAME ; int UniEditorGenUtils::MaxSmsMsgSizeL(void)
-	?DoCancel@CMuiuOperationWait@@MAEXXZ @ 8 NONAME ; void CMuiuOperationWait::DoCancel(void)
-	?MaxMmsMsgSizeL@UniEditorGenUtils@@QAEHXZ @ 9 NONAME ; int UniEditorGenUtils::MaxMmsMsgSizeL(void)
-	??_ECMuiuOperationWait@@UAE@I@Z @ 10 NONAME ; CMuiuOperationWait::~CMuiuOperationWait(unsigned int)
-	?ReplaceCharacters@UniEditorGenUtils@@QAEXAAVTDes16@@ABVTDesC16@@VTChar@@@Z @ 11 NONAME ; void UniEditorGenUtils::ReplaceCharacters(class TDes16 &, class TDesC16 const &, class TChar)
-	?getSmsCharacterLimits@UniEditorGenUtils@@AAEXAAH0@Z @ 12 NONAME ; void UniEditorGenUtils::getSmsCharacterLimits(int &, int &)
-	?NumberToBase@UniEditorGenUtils@@QAE?AVTChar@@V2@@Z @ 13 NONAME ; class TChar UniEditorGenUtils::NumberToBase(class TChar)
-	?ConvertDigitsTo@UniEditorGenUtils@@QAEXAAVTDes16@@W4TDigitType@@@Z @ 14 NONAME ; void UniEditorGenUtils::ConvertDigitsTo(class TDes16 &, enum TDigitType)
-	?NewLC@CMuiuOperationWait@@SAPAV1@H@Z @ 15 NONAME ; class CMuiuOperationWait * CMuiuOperationWait::NewLC(int)
-	?RunL@CMuiuOperationWait@@MAEXXZ @ 16 NONAME ; void CMuiuOperationWait::RunL(void)
-	?getFileInfoL@UniEditorGenUtils@@QAEXVQString@@AAHAAV2@AAW4TMsgMediaType@@@Z @ 17 NONAME ; void UniEditorGenUtils::getFileInfoL(class QString, int &, class QString &, enum TMsgMediaType &)
-	?MaxMmsRecipientsL@UniEditorGenUtils@@QAEHXZ @ 18 NONAME ; int UniEditorGenUtils::MaxMmsRecipientsL(void)
-	??1CMuiuOperationWait@@UAE@XZ @ 19 NONAME ; CMuiuOperationWait::~CMuiuOperationWait(void)
-	?VerifyEmailAddressesL@UniEditorGenUtils@@QAEHV?$QList@PAVConvergedMessageAddress@@@@@Z @ 20 NONAME ; int UniEditorGenUtils::VerifyEmailAddressesL(class QList<class ConvergedMessageAddress *>)
-	?WriteEmailOverSmsSettingsL@UniEditorGenUtils@@QAEHABVTDes16@@0ABH@Z @ 21 NONAME ; int UniEditorGenUtils::WriteEmailOverSmsSettingsL(class TDes16 const &, class TDes16 const &, int const &)
-	?ReadEmailOverSmsSettingsL@UniEditorGenUtils@@QAEHAAVTDes16@@0AAH@Z @ 22 NONAME ; int UniEditorGenUtils::ReadEmailOverSmsSettingsL(class TDes16 &, class TDes16 &, int &)
-	?absoluteMaxSmsPartsL@UniEditorGenUtils@@AAEHXZ @ 23 NONAME ; int UniEditorGenUtils::absoluteMaxSmsPartsL(void)
-	?UTF8Size@UniEditorGenUtils@@QAEHVQString@@@Z @ 24 NONAME ; int UniEditorGenUtils::UTF8Size(class QString)
-	?IsValidEmailAddress@UniEditorGenUtils@@QAEHVQString@@@Z @ 25 NONAME ; int UniEditorGenUtils::IsValidEmailAddress(class QString)
-	?IsPhoneOfflineL@UniEditorGenUtils@@QAEHXZ @ 26 NONAME ; int UniEditorGenUtils::IsPhoneOfflineL(void)
-	??1UniEditorGenUtils@@QAE@XZ @ 27 NONAME ; UniEditorGenUtils::~UniEditorGenUtils(void)
-	?AcceptEmailAddressesL@UniEditorGenUtils@@QAEHXZ @ 28 NONAME ; int UniEditorGenUtils::AcceptEmailAddressesL(void)
-
--- a/messagingapp/msgutils/bwins/unifieddatamodelu.def	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-EXPORTS
-	?setPath@MsgObjectsInfo@@QAEXABVQString@@@Z @ 1 NONAME ; void MsgObjectsInfo::setPath(class QString const &)
-	?serialize@MsgObjectsInfo@@QBEXAAVQDataStream@@@Z @ 2 NONAME ; void MsgObjectsInfo::serialize(class QDataStream &) const
-	?slideContent@UnifiedDataModel@@QAE?AV?$QList@PAVMsgObjectsInfo@@@@H@Z @ 3 NONAME ; class QList<class MsgObjectsInfo *> UnifiedDataModel::slideContent(int)
-	?slideCount@UnifiedDataModel@@QAEHXZ @ 4 NONAME ; int UnifiedDataModel::slideCount(void)
-	?objectsList@UnifiedDataModel@@QAE?AV?$QList@PAVMsgObjectsInfo@@@@XZ @ 5 NONAME ; class QList<class MsgObjectsInfo *> UnifiedDataModel::objectsList(void)
-	?setSize@MsgObjectsInfo@@QAEXH@Z @ 6 NONAME ; void MsgObjectsInfo::setSize(int)
-	??0MsgObjectsInfo@@QAE@ABVQString@@H0@Z @ 7 NONAME ; MsgObjectsInfo::MsgObjectsInfo(class QString const &, int, class QString const &)
-	?setMimeType@MsgObjectsInfo@@QAEXABVQString@@@Z @ 8 NONAME ; void MsgObjectsInfo::setMimeType(class QString const &)
-	?deserialize@MsgObjectsInfo@@QAEXAAVQDataStream@@@Z @ 9 NONAME ; void MsgObjectsInfo::deserialize(class QDataStream &)
-	?updateContents@UnifiedDataModel@@QAEXXZ @ 10 NONAME ; void UnifiedDataModel::updateContents(void)
-	?NewL@CConformanceChecker@@SAPAV1@XZ @ 11 NONAME ; class CConformanceChecker * CConformanceChecker::NewL(void)
-	?hasAttachments@UnifiedDataModel@@QAE_NXZ @ 12 NONAME ; bool UnifiedDataModel::hasAttachments(void)
-	??1UnifiedDataModel@@QAE@XZ @ 13 NONAME ; UnifiedDataModel::~UnifiedDataModel(void)
-	?mimetype@MsgObjectsInfo@@QAEABVQString@@XZ @ 14 NONAME ; class QString const & MsgObjectsInfo::mimetype(void)
-	?path@MsgObjectsInfo@@QAEABVQString@@XZ @ 15 NONAME ; class QString const & MsgObjectsInfo::path(void)
-	??0UnifiedDataModel@@QAE@AAVCBaseMtm@@@Z @ 16 NONAME ; UnifiedDataModel::UnifiedDataModel(class CBaseMtm &)
-	?attachmentsList@UnifiedDataModel@@QAE?AV?$QList@PAVMsgObjectsInfo@@@@XZ @ 17 NONAME ; class QList<class MsgObjectsInfo *> UnifiedDataModel::attachmentsList(void)
-	?objectCount@UnifiedDataModel@@QAEHXZ @ 18 NONAME ; int UnifiedDataModel::objectCount(void)
-	?attachmentCount@UnifiedDataModel@@QAEHXZ @ 19 NONAME ; int UnifiedDataModel::attachmentCount(void)
-	?size@MsgObjectsInfo@@QAEHXZ @ 20 NONAME ; int MsgObjectsInfo::size(void)
-	??1MsgObjectsInfo@@QAE@XZ @ 21 NONAME ; MsgObjectsInfo::~MsgObjectsInfo(void)
-
--- a/messagingapp/msgutils/convergedmessageutils/inc/convergedmessageimpl.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgutils/convergedmessageutils/inc/convergedmessageimpl.h	Mon May 03 12:29:07 2010 +0300
@@ -77,6 +77,18 @@
     void setMessageType(ConvergedMessage::MessageType type);
 
     /**
+     * Get the message sub-type
+     * @return message sub-type
+     */
+    ConvergedMessage::MessageSubType messageSubType() const;
+
+    /**
+     * Set the message sub-type
+     * @param type message sub-type
+     */
+    void setMessageSubType(ConvergedMessage::MessageSubType type);
+
+    /**
      * Get the message priority
      * @return message priority
      */
@@ -343,6 +355,11 @@
     quint8 mMessageType;
 
     /**
+     * Message type
+     */
+    quint8 mMessageSubType;
+
+    /**
      * Message priority
      */
     quint8 mPriority;
--- a/messagingapp/msgutils/convergedmessageutils/src/convergedmessage.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgutils/convergedmessageutils/src/convergedmessage.cpp	Mon May 03 12:29:07 2010 +0300
@@ -100,8 +100,24 @@
     }
 
 //----------------------------------------------------------------
+// ConvergedMessage::messageSubType
+// @see header
+//----------------------------------------------------------------
+ConvergedMessage::MessageSubType ConvergedMessage::messageSubType() const
+    {
+    return mConvergedMessageImpl->messageSubType();
+    }
 
+//----------------------------------------------------------------
+// ConvergedMessage::setMessageSubType
+// @see header
+//----------------------------------------------------------------
+void ConvergedMessage::setMessageSubType(ConvergedMessage::MessageSubType type)
+    {
+    mConvergedMessageImpl->setMessageSubType(type);
+    }
 
+//----------------------------------------------------------------
 // ConvergedMessage::priority
 // @see header
 //----------------------------------------------------------------
--- a/messagingapp/msgutils/convergedmessageutils/src/convergedmessageimpl.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgutils/convergedmessageutils/src/convergedmessageimpl.cpp	Mon May 03 12:29:07 2010 +0300
@@ -34,6 +34,7 @@
 ConvergedMessageImpl::ConvergedMessageImpl(
         ConvergedMessage::MessageType messageType) :
     mSubject(QString()), mBodyText(QString()), mTimeStamp(0), mProperty(0x0),
+        mMessageSubType(ConvergedMessage::None),
             mPriority(ConvergedMessage::Normal), mLocation(
                     ConvergedMessage::Delete), mDirection(
                     ConvergedMessage::Incoming), mSendingState(
@@ -50,8 +51,9 @@
 //----------------------------------------------------------------
 ConvergedMessageImpl::ConvergedMessageImpl(const ConvergedMessageId &id) :
     mSubject(QString()), mBodyText(QString()), mTimeStamp(0), mProperty(0x0),
-            mMessageType(ConvergedMessage::None), mPriority(
-                    ConvergedMessage::Normal), mLocation(
+            mMessageType(ConvergedMessage::None), 
+            mMessageSubType(ConvergedMessage::None),
+            mPriority(ConvergedMessage::Normal), mLocation(
                     ConvergedMessage::Delete), mDirection(
                     ConvergedMessage::Incoming), mSendingState(
                     ConvergedMessage::Unknown)
@@ -114,6 +116,7 @@
     mTimeStamp = msg.timeStamp();
     mProperty = msg.properties();
     mMessageType = msg.messageType();
+    mMessageSubType = msg.messageSubType();
     mPriority = msg.priority();
     mLocation = msg.location();
     mDirection = msg.direction();
@@ -187,7 +190,24 @@
 void ConvergedMessageImpl::setMessageType(ConvergedMessage::MessageType type)
     {
     mMessageType = type;
+    }
 
+//----------------------------------------------------------------
+// ConvergedMessageImpl::messageType
+// @see header
+//----------------------------------------------------------------
+ConvergedMessage::MessageSubType ConvergedMessageImpl::messageSubType() const
+    {
+    return ConvergedMessage::MessageSubType(mMessageSubType);
+    }
+
+//----------------------------------------------------------------
+// ConvergedMessageImpl::setMessageSubType
+// @see header
+//----------------------------------------------------------------
+void ConvergedMessageImpl::setMessageSubType(ConvergedMessage::MessageSubType type)
+    {
+    mMessageSubType = type;
     }
 
 //----------------------------------------------------------------
@@ -535,6 +555,7 @@
     stream << timeStamp;
     stream << mProperty;
     stream << mMessageType;
+    stream << mMessageSubType;
     stream << mPriority;
     stream << mLocation;
     stream << mDirection;
@@ -607,6 +628,7 @@
     //others
     stream >> mProperty;
     stream >> mMessageType;
+    stream >> mMessageSubType;
     stream >> mPriority;
     stream >> mLocation;
     stream >> mDirection;
--- a/messagingapp/msgutils/eabi/convergedmessageutilsu.def	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgutils/eabi/convergedmessageutilsu.def	Mon May 03 12:29:07 2010 +0300
@@ -75,4 +75,6 @@
 	_ZNK26ConvergedMessageAttachment8filePathEv @ 74 NONAME
 	_ZNK26ConvergedMessageAttachment9serializeER11QDataStream @ 75 NONAME
 	_ZNK26ConvergedMessageAttachmenteqERKS_ @ 76 NONAME
+	_ZN16ConvergedMessage17setMessageSubTypeENS_14MessageSubTypeE @ 77 NONAME
+	_ZNK16ConvergedMessage14messageSubTypeEv @ 78 NONAME
 
--- a/messagingapp/msgutils/eabi/unidatamodelloaderu.def	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-EXPORTS
-	_ZN18UniDataModelLoader11loadPluginsEv @ 1 NONAME
-	_ZN18UniDataModelLoader18getDataModelPluginERK7QString @ 2 NONAME
-	_ZN18UniDataModelLoaderC1Ev @ 3 NONAME
-	_ZN18UniDataModelLoaderC2Ev @ 4 NONAME
-	_ZN18UniDataModelLoaderD1Ev @ 5 NONAME
-	_ZN18UniDataModelLoaderD2Ev @ 6 NONAME
-
--- a/messagingapp/msgutils/eabi/unieditorutilsu.def	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-EXPORTS
-	_ZN17UniEditorGenUtils12NumberToBaseE5TChar @ 1 NONAME
-	_ZN17UniEditorGenUtils12getFileInfoLE7QStringRiRS0_R13TMsgMediaType @ 2 NONAME
-	_ZN17UniEditorGenUtils14MaxMmsMsgSizeLEv @ 3 NONAME
-	_ZN17UniEditorGenUtils14MaxSmsMsgSizeLEv @ 4 NONAME
-	_ZN17UniEditorGenUtils15ConvertDigitsToER6TDes1610TDigitType @ 5 NONAME
-	_ZN17UniEditorGenUtils15IsPhoneOfflineLEv @ 6 NONAME
-	_ZN17UniEditorGenUtils17MaxMmsRecipientsLEv @ 7 NONAME
-	_ZN17UniEditorGenUtils17MaxSmsRecipientsLEv @ 8 NONAME
-	_ZN17UniEditorGenUtils17ReplaceCharactersER6TDes16RK7TDesC165TChar @ 9 NONAME
-	_ZN17UniEditorGenUtils19IsValidEmailAddressE7QString @ 10 NONAME
-	_ZN17UniEditorGenUtils20absoluteMaxSmsPartsLEv @ 11 NONAME
-	_ZN17UniEditorGenUtils20unicodeCharacterModeEv @ 12 NONAME
-	_ZN17UniEditorGenUtils21AcceptEmailAddressesLEv @ 13 NONAME
-	_ZN17UniEditorGenUtils21VerifyEmailAddressesLE5QListIP23ConvergedMessageAddressE @ 14 NONAME
-	_ZN17UniEditorGenUtils21getSmsCharacterLimitsERiS0_ @ 15 NONAME
-	_ZN17UniEditorGenUtils25ReadEmailOverSmsSettingsLER6TDes16S1_Ri @ 16 NONAME
-	_ZN17UniEditorGenUtils25absoluteMaxSmsCharactersLEv @ 17 NONAME
-	_ZN17UniEditorGenUtils26WriteEmailOverSmsSettingsLERK6TDes16S2_RKi @ 18 NONAME
-	_ZN17UniEditorGenUtils8UTF8SizeE7QString @ 19 NONAME
-	_ZN17UniEditorGenUtilsC1Ev @ 20 NONAME
-	_ZN17UniEditorGenUtilsC2Ev @ 21 NONAME
-	_ZN17UniEditorGenUtilsD1Ev @ 22 NONAME
-	_ZN17UniEditorGenUtilsD2Ev @ 23 NONAME
-	_ZN18CMuiuOperationWait4RunLEv @ 24 NONAME
-	_ZN18CMuiuOperationWait5NewLCEi @ 25 NONAME
-	_ZN18CMuiuOperationWait5StartEv @ 26 NONAME
-	_ZN18CMuiuOperationWait8DoCancelEv @ 27 NONAME
-	_ZN18CMuiuOperationWaitC1Ei @ 28 NONAME
-	_ZN18CMuiuOperationWaitC2Ei @ 29 NONAME
-	_ZN18CMuiuOperationWaitD0Ev @ 30 NONAME
-	_ZN18CMuiuOperationWaitD1Ev @ 31 NONAME
-	_ZN18CMuiuOperationWaitD2Ev @ 32 NONAME
-	_ZTI18CMuiuOperationWait @ 33 NONAME
-	_ZTV18CMuiuOperationWait @ 34 NONAME
-
--- a/messagingapp/msgutils/eabi/unifieddatamodelu.def	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-EXPORTS
-	_ZN14MsgObjectsInfo11deserializeER11QDataStream @ 1 NONAME
-	_ZN14MsgObjectsInfo11setMimeTypeERK7QString @ 2 NONAME
-	_ZN14MsgObjectsInfo4pathEv @ 3 NONAME
-	_ZN14MsgObjectsInfo4sizeEv @ 4 NONAME
-	_ZN14MsgObjectsInfo7setPathERK7QString @ 5 NONAME
-	_ZN14MsgObjectsInfo7setSizeEi @ 6 NONAME
-	_ZN14MsgObjectsInfo8mimetypeEv @ 7 NONAME
-	_ZN14MsgObjectsInfoC1ERK7QStringiS2_ @ 8 NONAME
-	_ZN14MsgObjectsInfoC2ERK7QStringiS2_ @ 9 NONAME
-	_ZN14MsgObjectsInfoD1Ev @ 10 NONAME
-	_ZN14MsgObjectsInfoD2Ev @ 11 NONAME
-	_ZN16UnifiedDataModel10slideCountEv @ 12 NONAME
-	_ZN16UnifiedDataModel11objectCountEv @ 13 NONAME
-	_ZN16UnifiedDataModel11objectsListEv @ 14 NONAME
-	_ZN16UnifiedDataModel12slideContentEi @ 15 NONAME
-	_ZN16UnifiedDataModel14hasAttachmentsEv @ 16 NONAME
-	_ZN16UnifiedDataModel14updateContentsEv @ 17 NONAME
-	_ZN16UnifiedDataModel15attachmentCountEv @ 18 NONAME
-	_ZN16UnifiedDataModel15attachmentsListEv @ 19 NONAME
-	_ZN16UnifiedDataModelC1ER8CBaseMtm @ 20 NONAME
-	_ZN16UnifiedDataModelC2ER8CBaseMtm @ 21 NONAME
-	_ZN16UnifiedDataModelD1Ev @ 22 NONAME
-	_ZN16UnifiedDataModelD2Ev @ 23 NONAME
-	_ZN19CConformanceChecker4NewLEv @ 24 NONAME
-	_ZNK14MsgObjectsInfo9serializeER11QDataStream @ 25 NONAME
-
--- a/messagingapp/msgutils/msgutils.pro	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgutils/msgutils.pro	Mon May 03 12:29:07 2010 +0300
@@ -23,6 +23,4 @@
 SUBDIRS += s60qconversions/s60qconversions.pro
 SUBDIRS += convergedmessageutils/convergedmessageutils.pro
 SUBDIRS += unieditorutils/unieditorutils.pro
-SUBDIRS += unidatamodel/unidatamodel.pro
-SUBDIRS += unidatamodelloader/unidatamodelloader.pro
-SUBDIRS += unieditorplugins/unieditorplugins.pro
\ No newline at end of file
+SUBDIRS += unidatautils/unidatautils.pro
\ No newline at end of file
--- a/messagingapp/msgutils/unidatamodel/unidatamodel.pro	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +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:
-#
-
-TEMPLATE = subdirs
-
-SYMBIAN_PLATFORMS = WINSCW ARMV5
-
-SUBDIRS += unismsdataplugin/unismsdataplugin.pro
-SUBDIRS += univcaldataplugin/univcaldataplugin.pro
-SUBDIRS += unimmsdataplugin/unimmsdataplugin.pro
-
-CONFIG += ordered
\ No newline at end of file
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/UniDataModel.rss	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,152 +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: 
-*       UniEditor/Model resource file.
-*
-*
-*/
-
-
-// ========== RESOURCE IDENTIFIER ==========================
-
-NAME    UEDM
-
-// ========== INCLUDE FILES ================================
-
-#include <eikon.rh>
-#include <eikon.rsg>
-
-#include "UniSmil.hrh"
-#include "UniSmil.rh"
-
-// ========== CONSTANTS ====================================
-
-// ========== MACROS =======================================
-
-// ========== RESOURCE DEFINITIONS =========================
-
-RESOURCE RSS_SIGNATURE { }
-
-// ---------------------------------------------------------
-//  Additional resources
-// ---------------------------------------------------------
-//
-
-// Arrays of MIME types for MsgData to recognize supported types
-//
-// NOTE: Mimetypes must contain only US-ASCII characters.
-
-//
-// Default file name for attachment
-//
-RESOURCE TBUF r_mmdu_default_file_name      { buf = qtn_mms_no_name_for_file; }
-
-//
-// String for empty page in Objects view
-//
-RESOURCE TBUF r_mmdu_empty_slide            { buf = qtn_mms_item_title_empty_slide; }
-
-//----------------------------------------------------  
-//    COMPOSE_PARAMS
-//    Parameters to define how to do composing
-//
-//    r_root_layout_compose
-//      There is only one option left.
-//
-//    r_display_width   and 
-//    r_display_height
-//      Values are defined here because it's bit unclear
-//      whether to use actual display dimensions
-//      w=176 h=208
-//      or dimensions minus status pane height (44)
-//      which is the size used for displaying the message                        
-//      w=176, h=164.
-//      The third alternative would be to use some 
-//      very large height value because virtual viewing 
-//      area can be expanded in that direction.
-//
-//    r_compose_xmlns
-//      To generate xmlns or not.
-//
-//----------------------------------------------------
-//
-RESOURCE COMPOSE_PARAMS r_compose_params
-    {
-    r_root_layout_compose   = ESmilDisplayRootLayout;  // THIS IS ONLY OPTION
-    r_display_width         = 176;
-    r_display_height        = 208;
-    r_compose_xmlns         = ESmilYesXmlns;
-    r_top_padding           = 5;
-    r_region_padding        = 5;
-    r_bottom_padding        = 20;
-    }
-
-//----------------------------------------------------
-//   
-//    IMAGE_REGION
-//    Values for composing.
-//    NOTE: heigth, width are not checked in code 
-//          not to ecxeed rootlayout dimensions. 
-//
-//----------------------------------------------------
-//
-RESOURCE REGION r_image_region_attributes
-    {
-    r_id            = "Image";
-    r_fit           = "meet"; 
-    r_max_height    = 120;        
-    r_min_height    = 120;        
-    r_max_width     = 160;    
-    r_min_width     = 160;        
-    r_top           = 0;      
-    r_left          = 0;
-    }
-
-//----------------------------------------------------
-//   
-//    TEXT_REGION
-//    Values for composing.
-//    NOTE: heigth, width should have sensible values 
-//          based on the r_root_layout_compose param.
-//          There is no code to check some weird cases. 
-//
-//----------------------------------------------------
-//
-RESOURCE REGION r_text_region_attributes
-    {
-    r_id            = "Text";
-    r_fit           = "scroll"; 
-    r_max_height    = 200;        
-    r_min_height    = 40;     
-    r_max_width     = 160;    // MUST ALWAYS BE SAME AS MAX IMAGE WIDTH
-    r_min_width     = 160;      
-    r_top           = 0;      
-    r_left          = 0;
-    }
-
-//----------------------------------------------------
-//   
-//    SLIDE_PARAMETERs
-//    Values for composing.
-//    NOTE: 
-//
-//----------------------------------------------------
-//
-RESOURCE SLIDE r_slide_params
-    {
-    r_default_duration_milliseconds    = 5000;
-    r_default_when_audio_milliseconds  = 5000;
-    }
-
-// End of File
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/ConformanceChecker.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,188 +0,0 @@
-/*
-* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 CONFORMANCECHECKER_H
-#define CONFORMANCECHECKER_H
-
-
-//  INCLUDES
-#include <e32base.h>
-#include <e32std.h>
-
-#include <gmxmldocument.h>
-#include <gmxmlelement.h>
-
-
-// CONSTANTS
-_LIT(KMetaTag,"meta");
-_LIT(KPercent,"%");
-_LIT(KPx,"px");
-_LIT(KMs,"ms");
-_LIT(KImage,"Image");
-_LIT(KText,"Text");
-
-const TInt KUSAsciiMinCode = 0;
-const TInt KUSAsciiMaxCode = 127;
-
-//Type for the version of the Conformance Document
-enum TMmsSmilVersion
-	{
-	EMmsSmil_v2_0=2,
-	EMmsSmil_v3_0
-	};
-
-
-enum TFlags
-	{
-	EAllowVideoTag=1,				//Allowing  video tag as media
-	EAllowAllAttributes=2,			//Not checking the attribute name of the elements
-	EAllowNonMilliseconds=4,		//Allows other  timing specifications then 'ms' (e.g. 's')
-	EAllowNonUsAscii=8,				//Allows other  than us-ascii values for src attribute
-									//for media elements
-	EAllowMixedRegionDimensions=16,	//Allows mixed region dimensions (pixel and percent)
-	EAllowSeqTag=32,				//Allows one <seq> tag right after the <body> tag
-	EAllowAnyRegionNames=64			//Allows any name for the regions
-	};
-
-
-
-// CLASS DECLARATION
-
-/**
-*  Class for checking the the content of a DOM tree against the Conformance Document.
-*  (Checking legacy content.)
-*
-*  @lib smileng.lib
-*  @since 2.0
-*/
-class CConformanceChecker : public CBase
-	{
-
-    public:  // Constructors and destructor
-
-        /**
-        * Two-phased constructor.
-		* @param aStrict - value of the checking mode flag
-        */
-        static CConformanceChecker* NewL();
-
-        /**
-        * Destructor.
-        */
-        ~CConformanceChecker();
-
-    public: // New functions
-
-        /**
-	    * Checks if the DOM tree's content is legacy content or not.
-        * @param aXmldoc - the root of the DOM tree
-		* @aVersion - the version of the Conformance Document
-		* @aFlags - the flags to gide the checking (combination of TFlags values)
-        * @return - true if the content is legacy
-				  - false  if the content is not legacy
-        */
-        TBool Check(CMDXMLDocument* aXmldoc, TMmsSmilVersion aVersion, TInt aFlags);
-
-    private:
-
-		/** Checks the structure of the head element: allowed to contain only layout and meta element
-		* @param aHead - the root of head subtree
-		* @param aStrict - flag for checking mode (true strict checking, false loose checking)
-		* @return  - true - if head has legacy structure
-		*		   - false - otherwise
-		*/
-		TBool CheckHeadStructure(CMDXMLNode* aHead);
-
-
-		/** Checks the structure of the body element:
-								- allowed to contain only par elements
-		*						(one including seq element right after the body is allowed)
-		* @param aBody - the root of body subtree
-		* @return  - true - if body has legacy structure
-		*		   - false - otherwise
-		*/
-		TBool CheckBodyStructure(CMDXMLNode* aBody);
-
-
-		/** Checks the content of the layout element
-		*						- root-layout and max. 2 region elements are allowed
-		* @param aLayout - the root of layout subtree
-		* @return  - true - if layout has legacy content
-		*		   - false - otherwise
-		*/
-		TBool CheckLayoutContent(CMDXMLNode* aLayout);
-
-
-		/** Checks the content of the body element
-		* @param aBody - the root of body subtree
-		* @return - true - if body has legacy content
-		*		  - false - otherwise
-		*/
-		TBool CheckBodyContent(CMDXMLNode* aBody);
-
-
-		/** Checks the content of the par element
-		* @param aPar - the root of par subtree
-		* @return  - true - if par has legacy content
-		*		   - false - otherwise
-		*/
-		TBool CheckParContent(CMDXMLNode* aPar);
-
-
-		/** Checks if  a descriptor is ending with 'ms'
-		* @param aValue - value to check
-		* @return  - true if the ending is ms
-		*		   - false otherwise
-		*/
-
-		TBool IsInMilliseconds(TDesC& aValue) const;
-
-
-		/** Checks if the given value is ending with percent or pixel
-		* and if this is conforming to the already set pixel and percent values.
-		* @param aValue - value to check,
-		*				- should be the value of 'width', 'height', 'top', 'left'
-		*				   attributes for a region
-		* @param aPercent - true if the value should end with percent
-		* @param aPixel - true if the value should be in pixel
-		* @return  true - if the value is not mixed (regarding aPercent,aPixel)
-		*		   false - if mixed
-		*/
-		TBool CheckMixedRegionAttribute(TDesC& aValue,TBool& aPercent,TBool& aPixel) const;
-
-		/** Checks if the given value is exactly "Image" or "Text" and if it
-		* is duplicated (checking the transmitted boolean parameters).
-		* @param aValue - value to check,
-		* @param aFoundImage - true if the "Image" value will be duplicate
-		* @param aFoundText - true if the "Text" value will be duplicate
-		* @return  true - if the value is "Image" or "Text" and it's not duplicated
-		*		   false - otherwise
-		*/
-		TBool CheckRegionNames(TDesC& aValue,TBool& aFoundImage,TBool& aFoundText) const;
-
-
-    private:    // Data
-
-
-		TInt iFlags; //contains the flags to guide the checking
-    };
-
-#endif      // CONFORMANCECHECKER_H
-
-// End of File
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/MsgAttachmentUtils.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
-* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 MSGATTACHMENTUTILS_H
-#define MSGATTACHMENTUTILS_H
-
-// ========== INCLUDE FILES ================================
-
-#include <e32std.h>
-
-// ========== CONSTANTS ====================================
-
-// ========== MACROS =======================================
-
-// ========== DATA TYPES ===================================
-
-// ========== FUNCTION PROTOTYPES ==========================
-
-// ========== FORWARD DECLARATIONS =========================
-
-// ========== CLASS DECLARATION ============================
-
-/**
- * Attachment utilities.
- *
- */
-class MsgAttachmentUtils
-    {
-    public:
-        /**
-         * Generates a legal filename from given text buffer.
-         * @param aFileName  OUT: generated filename.
-         * @param aBuffer    text buffer.
-         * @param aMaxLength maximum length for filename.
-         * @param aExt       optional file extension.
-         */
-        static void GetFileNameFromBuffer(
-            TFileName&      aFileName,
-            const TDesC&    aBuffer,
-            TInt            aMaxLength,
-            const TDesC*    aExt = NULL );
-
-    };
-
-#endif // MSGATTACHMENTUTILS_H
-
-// End of File
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniDataModel.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,401 +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: 
-*       CUniDataModel
-*
-*
-*/
-
-
-#ifndef __UNIDATAMODEL_H
-#define __UNIDATAMODEL_H
-
-//  INCLUDES
-#include <gmxmlparser.h>
-#include <gmxmldocument.h>
-#include <msvapi.h>                     // CMsvEntry
-#include <UniDataUtils.h>
-#include <UniSmilModel.h>
-#include <UniSmilList.h>
-#include <UniObject.h>
-
-#include <mmsvattachmentmanager.h>
-#include <mmsvattachmentmanagersync.h>
-#include <MsgMediaInfo.h>
-
-// CONSTANTS
-
-// MACROS
-
-// DATA TYPES
-
-// FUNCTION PROTOTYPES
-
-// FORWARD DECLARATIONS
-
-class CBaseMtm;
-class CUniDataUtils;
-class CUniObjectsModel;
-class CUniObjectList;
-class CUniObjectsInfo;
-class CMsgMediaResolver;
-class CMmsConformance;
-class CMsvMimeHeaders;
-class CMsvAttachment;
-
-// CLASS DECLARATION
-
-/**
-* MUniDataModelObserver - Callback API for model operations.
-*
-* @since 3.1
-*/
-class MUniDataModelObserver
-    {
-    public:
-        virtual void RestoreReady( TInt aParseResult, TInt aError ) = 0;
-    };
-
-/**
-* CUniDataModel - A container class that owns instances of CMsgMediaResolver,
-* CMmsConformance, CUniDataUtils, CUniObjectList, CUniSmilList and CUniSmilModel.
-* It also handles the initialization of the lists & the SMIL model.
-*
-* @lib UniDataModel.lib
-* @since 3.1
-*/
-class  CUniDataModel : public CBase,
-                      public MMDXMLParserObserver,
-                      public MMediaInfoObserver
-    {
-    public:  // Constructors and destructor
-
-        static  CUniDataModel* NewL( RFs& aFs, CBaseMtm& aMtm );
-
-        /**
-        * Destructor.
-        */
-         ~CUniDataModel();
-
-    public: // New functions
-
-        /**
-        * RestoreL
-        * Loads attachments from message store and initializes
-        * the model.
-        * @param aObserver          IN Callback observer
-        * @param aRemoveCorrupted   IN If ETrue removes corrupted attachments
-        *                              If EFalse leaves if corrupted attachments detected
-        * @param aAllowSmil         IN If ETrue puts SMIL files to "SmilList"
-        *                              If EFalse puts SMIL files to "AttachmentList"
-        */
-         void RestoreL(
-            MUniDataModelObserver& aObserver,
-            TBool aRemoveCorrupted = ETrue,
-            TBool aAllowSmil = ETrue );
-
-        /**
-        * AddObjectL
-        * Adds an object into msg store and smil slide
-        *
-        * @since    3.1
-        * @param    aObserver   IN Object save observer
-        * @param    aMedia      IN media info - ownership transferred to MsgObject
-        * @param    aSaveType   IN either "file" or "linked file"
-        * @return   Pointer to the added object
-        *           Ownership NOT transferred.
-        */
-         CUniObject* AddAttachmentL(
-            MUniObjectSaveObserver& aObserver,
-            CMsgMediaInfo* aMedia,
-            CMsvAttachment::TMsvAttachmentType aSaveType = CMsvAttachment::EMsvLinkedFile );
-
-       /**
-        * AddStoredAttachmentL
-        * Adds an object that is already in msg store to smil slide
-        *
-        * @since    3.1
-        * @param    aAttachmentId   IN file to be added
-        * @param    aMedia      IN media info - ownership transferred to MsgObject
-        * @return   Pointer to the added object
-        *           Ownership NOT transferred.
-        */
-         CUniObject* AddStoredAttachmentL(
-            TMsvAttachmentId aAttachmentId,
-            CMsgMediaInfo* aMedia );
-
-       /**
-        * FinalizeMediaParse
-        * This function synchronizes asynchronous media info parsing if it is still ongoing
-        * To be called from editor/viewer when the message is to be send/saved/forwarded
-        * @since    3.2
-        */
-         void FinalizeMediaParse();
-
-    public:
-
-       /**
-        * MediaInfoParsed
-        * Callback for MediaInfo active object
-        * @since    3.2
-        */
-        void MediaInfoParsed();
-
-       /**
-        * ParseNextObject
-        * Parses the next object in a to-be-parsed list
-        * Actual parsing is dedicated to MediaInfo's asynchronous method
-        * @since    3.2
-        */
-        void ParseNextObject();
-
-        /**
-        * ParseFileCompleteL
-        * Call back function used to inform client of Parser when RunL function completes
-        */
-        void ParseFileCompleteL();
-
-    public: // inlines
-
-        /**
-        * Returns number of corrupted attachments encountered at load time
-        * i.e. entry is stil there but binary file is missing
-        * Includes corrupted link, presentations etc.
-        *
-        * @return attachment count
-        */
-        inline TInt CorruptedCount() const;
-
-        /**
-        * Returns attachment count before any filtering for "presentation objects"
-        * or corrupted attachments. SMIL attachments are not included in the count.
-        *
-        * @return attachment count
-        */
-        inline TInt OriginalAttachmentCount() const;
-
-        /**
-        * Get reference to file session
-        *
-        * @return reference to RFs
-        */
-        inline RFs& FsSession() const;
-
-        /**
-        * Get reference to base mtm
-        *
-        * @return reference to CBaseMtm
-        */
-        inline CBaseMtm& Mtm() const;
-
-        /**
-        * Returns object list owned by the model. Object list includes all
-        * attachments that are referenced from the SMIL part (or if there is no
-        * SMIL part attachments that are of supported media type).
-        *
-        * @return reference to the object list.
-        */
-        inline CUniObjectList& ObjectList() const;
-
-        /**
-        * Returns attachment list owned by the model. Attachment list includes all
-        * attachments that are NOT referenced from the SMIL part.
-        *
-        * @return reference to the attachment list.
-        */
-        inline CUniObjectList& AttachmentList() const;
-
-        /**
-        * Returns SMIL list owned by the model. SMIL list includes all
-        * attachments that are of type "application/smil".
-        *
-        * @return reference to the SMIL attachment list.
-        */
-        inline CUniSmilList& SmilList() const;
-
-        /**
-        * Returns data utils object used by the model.
-        *
-        * @return reference to the data utils object.
-        */
-        inline CUniDataUtils& DataUtils() const;
-
-        /**
-        * Returns SMIL type of the message.
-        * @return Possible return values are:
-        *         -ENoSmil
-        *         -EMmsSmil
-        *         -EOtherSmil
-        *         -EMultipleSmil
-        *         -ETemplateSmil
-        */
-        inline TUniSmilType SmilType();
-
-        /**
-        * Returns SMIL type of the message.
-        * @param aSmilType:
-        *         -ENoSmil
-        *         -EMmsSmil
-        *         -EOtherSmil
-        *         -EMultipleSmil
-        *         -ETemplateSmil
-        */
-        inline void SetSmilType( TUniSmilType aSmilType );
-
-        /**
-        * Get reference to SmilModel
-        *
-        * @return reference to SmilModel
-        */
-        inline CUniSmilModel& SmilModel() const;
-
-        /**
-        * Get reference to MediaResolver
-        *
-        * @return reference to MediaResolver
-        */
-        inline CMsgMediaResolver& MediaResolver() const;
-
-        /**
-        * Get reference to MmsConformance
-        *
-        * @return reference to MmsConformance
-        */
-        inline CMmsConformance& MmsConformance() const;
-
-        /**
-        * Return SMIL DOM
-        *
-        * @return Pointer to SMIL DOM
-        */
-        inline CMDXMLDocument* Dom();
-
-        /**
-        * Set SMIL DOM
-        *
-        * @param Pointer to SMIL DOM, takes ownership
-        */
-        inline void SetDom( CMDXMLDocument* aDom );
-
-        /*
-        * Accessor
-        *
-        * @return parse result from CUniSmilModel::ParseL()
-        */
-        inline TInt ParseResult() const;
-
-    private:  // New functions
-
-        /**
-        * CUniDataModel
-        * Constructor.
-        */
-        CUniDataModel( RFs& aFs, CBaseMtm& aMtm );
-
-        /**
-        * ConstructL
-        * 2nd phase constructor.
-        */
-        void ConstructL();
-
-    private: // New Functions
-
-
-        /**
-        * DoParseFileCompleteL
-        */
-        void DoParseFileCompleteL();
-
-        /**
-        * FinalizeRestoreL
-        */
-        void FinalizeRestoreL( TInt aError );
-
-        /**
-        * Handles corrupted attachments.
-        *
-        * @param aRemoveCorrupted   IN
-        *   - If ETrue tries to recover by removing corrupted attachments.
-        *
-        *     Note: This means that SMIL parsing will fail with ESmil_Missing_Objects.
-        *           and object order is not maintained. But better to do it this
-        *           way so that message can be opened.
-        *
-        *   - If EFalse leaves with KErrCorrupt if corrupted attachments detected.
-        *     Model not made caller should exit!
-        */
-        void FindAndHandleCorruptL( TBool aRemoveCorrupted );
-
-        /**
-        * Finds corrupted attachments from context message.
-        */
-        CMsvEntrySelection* FindCorruptLC();
-
-        /**
-        * FindAttachmentsL
-        * Browses through SMIL and separates objects that are
-        * referenced from attachments.
-        */
-        void FindAttachmentsL();
-
-        /**
-        * Creates an object from msg store attachment
-        * @param aMimeType - mime type of new object.
-        * @param aAttachmentId - ID to be used for searching
-        *                        attachment from store
-        */
-        CUniObject* CreateObjectFromAttachmentLC(
-            const TPtrC8& aMimeType,
-            RFile& aFile,
-            MMsvAttachmentManager& aManager,
-            CMsvAttachment& aAttachment );
-
-        /**
-        * Browses through (non-MMS) SMIL and searches reference counts for objects and separates
-        * objects and attachments in different lists.
-        */
-        void FindDomObjectRefCountsL();
-
-    protected:  // data
-
-        RFs&                iFs;
-        CBaseMtm&           iMtm;
-
-        CMsgMediaResolver*  iMediaResolver;
-
-        CUniDataUtils*      iDataUtils;
-        CUniObjectList*     iObjectList;
-        CUniObjectList*     iAttachmentList;
-        CUniSmilList*       iSmilList;
-
-        CUniSmilModel*      iSmilModel;
-        TUniSmilType        iSmilType;
-        TInt                iOrigAttachmentCount;
-        TInt                iCorruptedCount; // Number of attas detected to be corrupted when loading
-
-        CMDXMLParser*       iParser;
-        CMDXMLDocument*     iDom;
-
-        MUniDataModelObserver* iObserver;
-        TInt                iParseResult;
-        CActiveSchedulerWait     iObjWait;
-        CUniObject*         iObjectToParse;
-        CMmsConformance* iMmsConformance;
-};
-
-#include <UniDataModel.inl>
-
-#endif   // __UNIDATAMODEL_H
-
-// End of file
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniDataModel.inl	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +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: 
-*       Inlines for CUniDataModel
-*
-*
-*/
-
-#include "debugtraces.h"
-
-
-// ---------------------------------------------------------
-// CUniDataModel::ObjectList
-// ---------------------------------------------------------
-//
-inline CUniObjectList& CUniDataModel::ObjectList() const
-    {
-    
-    return *iObjectList;
-    }
-
-// ---------------------------------------------------------
-// CUniDataModel::AttachmentList
-// ---------------------------------------------------------
-//
-inline CUniObjectList& CUniDataModel::AttachmentList() const
-    {
-    return *iAttachmentList;
-    }
-
-// ---------------------------------------------------------
-// CUniDataModel::SmilList
-// ---------------------------------------------------------
-//
-inline CUniSmilList& CUniDataModel::SmilList() const
-    {
-    return *iSmilList;
-    }
-
-// ---------------------------------------------------------
-// CUniDataModel::DataUtils
-// ---------------------------------------------------------
-//
-inline CUniDataUtils& CUniDataModel::DataUtils() const
-    {
-    return *iDataUtils;
-    }
-
-// ----------------------------------------------------
-// CUniDataModel::SetSmilType
-// ----------------------------------------------------
-//
-inline TUniSmilType CUniDataModel::SmilType()
-    {
-    return iSmilType;
-    }
-
-// ----------------------------------------------------
-// CUniDataModel::SetSmilType
-// ----------------------------------------------------
-//
-inline void CUniDataModel::SetSmilType( TUniSmilType aSmilType )
-    {
-    iSmilType = aSmilType;
-    }
-
-// ---------------------------------------------------------
-// CUniDataModel::SmilModel
-// ---------------------------------------------------------
-//
-inline CUniSmilModel& CUniDataModel::SmilModel() const
-    {
-#ifdef _DEBUG_TRACES_
-    qCritical() << " CUniDataModel SmilModel start";
-#endif
-
-    return *iSmilModel;
-    }
-
-// ---------------------------------------------------------
-// CUniDataModel::MediaResolver
-//
-// ACCESSOR
-// ---------------------------------------------------------
-//
-inline CMsgMediaResolver& CUniDataModel::MediaResolver() const
-    {
-    return *iMediaResolver;
-    }
-
-// ---------------------------------------------------------
-// CUniDataModel::MmsConformance
-//
-// ACCESSOR
-// ---------------------------------------------------------
-//
-inline CMmsConformance& CUniDataModel::MmsConformance() const
-    {
-    return *iMmsConformance;
-    }
-
-// ---------------------------------------------------------
-// CUniDataModel::Dom
-//
-// Accessor.
-// ---------------------------------------------------------
-//
-inline CMDXMLDocument* CUniDataModel::Dom()
-    {
-    return iDom;
-    }
-
-// ---------------------------------------------------------
-// CUniDataModel::SetDom
-//
-// Mutator.
-// ---------------------------------------------------------
-//
-inline void CUniDataModel::SetDom( CMDXMLDocument* aDom )
-    {
-    delete iDom;
-    iDom = aDom;
-    }
-
-// ---------------------------------------------------------
-// CUniDataModel::ParseResult
-//
-// ---------------------------------------------------------
-//
-inline TInt CUniDataModel::ParseResult() const
-    {
-    return iParseResult;
-    }
-
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniDataUtils.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,203 +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: 
-*           Data utility class for UniEditor & MMS related editors and viewers
-*
-*
-*/
-
-
-
-#ifndef __UNIDATAUTILS_H
-#define __UNIDATAUTILS_H
-
-//  INCLUDES
-#include <apmstd.h>         //TDataType
-#include <apgcli.h>         //RApaLsSession
-#include <barsc.h>
-#include <UniModelConst.h>
-#include <cmsvattachment.h> // TMsvAttachmentId
-
-
-// CONSTANTS
-_LIT8( KUniEmptySlide,      "application/X-MmsEmptySlide" );
-
-// MACROS
-
-// DATA TYPES
-
-// FUNCTION PROTOTYPES
-
-// FORWARD DECLARATIONS
-class CMsgTextUtils;
-class CBaseMtm;
-class MMsvAttachmentManager;
-
-// CLASS DECLARATION
-
-/**
-* CUniDataUtils - Miscellaneous UI indenependent utilities.
-*
-* @lib UniDataUtils.lib
-* @since 3.1
-*/
-class CUniDataUtils : public CBase
-    {
-    public:  // Constructors and destructor
-
-        /**
-        * Constructor.
-        *
-        * @since    3.1
-        * @param    aFs     IN Fileserver session.
-        * @return   Pointer to instance
-        */
-        static CUniDataUtils* NewL( RFs& aFs );
-
-        /**
-        * Destructor.
-        *
-        * @since 3.1
-        */
-        virtual ~CUniDataUtils();
-
-        /**
-        * DefaultFileName
-        * (e.g. "noname" - no prefix)
-        *
-        * @since    3.1
-        * @return   Pointer to default file name buffer
-        */
-        inline TPtrC DefaultFileName() const;
-
-        /**
-        * EmptyPageString
-        * (e.g. "Empty page")
-        *
-        * @since    3.1
-        * @return   Pointer to "empty page" buffer
-        */
-        inline TPtrC EmptyPageString() const;
-
-        /**
-        * CharconvIdToMibIdL
-        * Converts between id's.
-        *
-        * @since    3.1
-        * @param    aCharconvCharsetId  IN charconv id
-        * @return   MIB enumeration
-        */
-        TUint CharconvIdToMibIdL( TUint aCharconvCharsetId );
-
-        /**
-        * MibIdToCharconvIdL
-        * Converts between id's.
-        *
-        * @since    3.1
-        * @param    aMibId  IN MIB enumeration
-        * @return   Charconv id
-        */
-        TUint MibIdToCharconvIdL( TUint aMibId );
-
-        /**
-        * Gets bytes size of UTF8 formatted text
-        *
-        * @since    3.1
-        * @param aText
-        * @return Size of text in bytes
-        */
-        static TInt UTF8Size( TPtrC aText );
-
-        /**
-        * Gets bytes size of file.
-        *
-        * @since    3.1
-        * @param aFileName
-        * @return Size of the file.
-        */
-        TInt FileSizeL( const TFileName& aFileName );
-
-        /**
-        * Get open file handle for an attachment
-        *
-        * @since    3.1
-        * @param    aMtm    Client MTM
-        * @param    aId     Attachment ID
-        * @return   Open read-only file handle.
-        *           It is callers responsibilty to close the handle.
-        */
-        static RFile GetAttachmentFileL( CBaseMtm& aMtm, TMsvAttachmentId aId );
-
-        /**
-        * Get the "attachment manager index position" for an attachment.
-        *
-        * @since    3.1
-        * @return "attachment manager index position"
-        * @leave  KErrNotFound if attachment is not found from the store
-        */
-        static TInt IndexPositionOfAttachmentL(
-            MMsvAttachmentManager& aManager,
-            TMsvAttachmentId aId );
-
-    protected:
-
-        /**
-        * C++ constructor
-        *
-        * @since    3.1
-        * @param    aFs     IN Fileserver session.
-        */
-        CUniDataUtils( RFs& aFs );
-
-        /**
-        * ConstructL
-        * Symbian OS constructor
-        *
-        * @since    3.1
-        */
-        void ConstructL();
-
-        /**
-        * RegisterDataL
-        * Reads data from resources.
-        *
-        * @since    3.1
-        */
-        void RegisterDataL();
-
-        /**
-        * ReadResStringsL
-        * Reads strings from resources to internal mimetype arrays.
-        *
-        * @since    3.1
-        * @param    aResourceFile   IN opened resourcefile
-        * @param    aSrcResId   IN resource id to read from
-        * @return   Pointer to read string
-        **/
-        HBufC* ReadResStringL( const RResourceFile& aResourceFile, TInt aSrcResId );
-
-    protected:  // data
-
-        RFs& iFs;
-        CMsgTextUtils* iTextUtils;
-        HBufC* iDefaultFileName;
-        HBufC* iEmptyPageString;
-
-    };
-
-#include <UniDataUtils.inl>
-
-#endif   // __UNIDATAUTILS_H
-
-// End of file
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniDataUtils.inl	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +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: 
-*           Data utility class for UniEditor & MMS related editors and viewers
-*     
-*
-*/
-
-
-// ---------------------------------------------------------
-// CUniDataUtils::DefaultFileName
-// ---------------------------------------------------------
-//
-inline TPtrC CUniDataUtils::DefaultFileName() const
-    {
-    return *iDefaultFileName;
-    }
-
-// ---------------------------------------------------------
-// CUniDataUtils::DefaultFileName
-// ---------------------------------------------------------
-//
-inline TPtrC CUniDataUtils::EmptyPageString() const
-    {
-    return *iEmptyPageString;
-    }
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniDrmInfo.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,246 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*       CUniDrmInfo, Storage for single attachment in presentation.
-*
-*
-*/
-
-
-
-#ifndef __UNIDRMINFO_H
-#define __UNIDRMINFO_H
-
-// INCLUDES
-
-#include <e32std.h>
-#include <cmsvattachment.h>
-
-#include <caf/caf.h>
-#include <DRMHelper.h>
-#include <DRMRights.h>
-
-#include <UniObject.h>
-
-// CONSTANTS
-
-// MACROS
-
-// FORWARD DECLARATIONS
-class CBaseMtm;
-class CMsgMediaInfo;
-class CDRMHelper;
-#ifndef DRMCOMMONIN_POISTO
-class DRMCommon;
-#endif
-
-// DATA TYPES
-
-// FUNCTION PROTOTYPES
-
-// CLASS DECLARATION
-
-/**
-* CUniDrmInfo - DRM information of an attachment.
-*
-* @lib UniDataModel.lib
-* @since 3.1
-*/
-class CUniDrmInfo : public CBase
-    {
-
-    public:  // New methods
-
-        /**
-        * Factory method that creates this object
-        * from an attachment.
-        *
-        * @since    3.1
-        * @return   Pointer to instance in cleanup stack
-        */
-        static CUniDrmInfo* NewLC(
-            RFs& aFs,
-            CBaseMtm& aMtm,
-            TMsvAttachmentId& aId,
-            CMsgMediaInfo& aMediaInfo );
-
-        /**
-        * Factory method that creates this object
-        * from an attachment.
-        *
-        * @since    3.1
-        * @return   Pointer to instance
-        */
-        static CUniDrmInfo* NewL(
-            RFs& aFs,
-            CBaseMtm& aMtm,
-            TMsvAttachmentId& aId,
-            CMsgMediaInfo& aMediaInfo );
-
-        /**
-        * Destructor
-        *
-        * @since    3.1
-        */
-        virtual ~CUniDrmInfo();
-
-        /**
-        * Freezes and locks the DRM rights of the object if available.
-        * -> No counts will be reduced
-        * @return   Error code from CDRMHelper::Consume2(). Some controls
-        * may ignore the value but some don't
-        * @since    3.1
-        */
-        TInt FreezeRights();
-
-        /**
-        * Consumes and locks the DRM rights of the object if available.
-        * -> One count will be reduced
-        * @return   Error code from CDRMHelper::Consume2(). Some controls
-        * may ignore the value but some don't
-        * @since    3.1
-        */
-        TInt ConsumeRights();
-
-        /**
-        * Evaluates DRM rights of the object if available.
-        * Use count is not changed.
-        * @param aConsumed
-        *        return information whether DRM rights have already been consumed
-        * @since    3.1
-        */
-        TInt EvaluateRights( TBool& aConsumed );
-
-        /**
-        * Releases the DRM rights of the object.
-        * @return   Error code from CDRMHelper::Consume2().Some controls
-        * may ignore the value but some don't
-        * @since    3.1
-        */
-        TInt ReleaseRights();
-
-        /**
-        * Convenience function to check whether DRM rights for
-        * the object are valid.
-        * @since    3.1
-        * @param    aUpdate         IN  if ETrue, updates rights info,
-        *                               otherwise returns rights as they were
-        *                               when the object was constructed.
-        */
-        TBool RightsValidL( TBool aUpdate );
-
-        /**
-        * Check whether this is combined delivery cobject with one
-        * play count left. This information is needed to show note
-        * "Message contains an object that can only be viewed once"
-        *  §qtn.drm.preview.msg§
-        * @return ETrue
-        *         EFalse
-        */
-        TBool IsDrmWithOnePreview();
-
-        /**
-        * Handles DRM error ( taken place in an UI control).
-        */
-        void HandleDrmErrorL( TInt aError );
-
-    protected:
-
-        enum TUniDRMConsumeStatus
-            {
-            EUniDRMNone,
-            EUniDRMFrozen,
-            EUniDRMConsumed
-            };
-
-        /**
-        * Constructor.
-        *
-        * @since    3.1
-        */
-        CUniDrmInfo(
-            RFs& aFs,
-            CBaseMtm& aMtm,
-            TMsvAttachmentId& aId,
-            CMsgMediaInfo& aMediaInfo );
-
-        /**
-        * 2nd phase constructor.
-        *
-        * @since    3.1
-        */
-        void ConstructL();
-
-        /**
-        * Gets rights info from a media object.
-        * @param aRightsObj optionally returns CDRMRights of the object, if
-        *        Ownership is transferred to caller.
-        * @since    3.1
-        */
-        void DoGetRightsInfoL(CDRMRights** aRightsObj = NULL);
-
-        inline ContentAccess::TIntent ConsumeIntent();
-
-        /**
-        * Check whether this is combined delivery cobject with one
-        * play count left. This information is needed to show note
-        * "Message contains an object that can only be viewed once"
-        *  §qtn.drm.preview.msg§. Value is saved iDrmOnePreview.
-        */
-        void SetIsDrmWithOnePreviewL();
-
-        /**
-        * Creates internal CData object. It cannot be created during construction.
-        * @return If this object is not DRM protected returns NULL.
-        */
-        CData* CreateCDataL();
-
-    protected: // data
-
-        RFs&                    iFs;
-		TInt                    iSupportedFeatures;
-
-        CBaseMtm&               iMtm;
-        TMsvAttachmentId&       iAttachmentId;
-        CMsgMediaInfo&          iMediaInfo;
-
-#ifdef DRMCOMMONIN_POISTO
-        ContentAccess::CRightsManager*  iRightsManager;
-#else
-        DRMCommon*              iDRMCommon;
-#endif
-
-        CDRMHelper*             iDRMHelper;
-        TUniDRMConsumeStatus    iDRMConsumeStatus;
-        TInt                    iDRMConsumeCount;
-        TBool                   iDRMRightsExist;
-        CDRMRights::TExpiration iDRMExpiration;
-        CDRMRights::TRestriction    iDRMRestriction;
-        TUint32                 iDRMConstraintType;
-
-        // DRm2 follows:
-        TBool                   iOma2;
-        // Indicates preview type
-        CDRMHelper::TDRMHelperPreviewType   iPreviewType;
-        // content URI (unique id) of the embedded preview content
-        TBool                   iHasInfoUri;
-        HBufC*                  iSendContentUrl;
-        TBool                   iCDataResolved;
-        TPtrC8                  iUsedContentUri;
-        TBool                   iDrmOnePreview;
-    };
-
-#include <UniDrmInfo.inl>
-
-#endif // __UNIDRMINFO_H
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniDrmInfo.inl	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*       CUniDrmInfo, Storage for single attachment in presentation. 
-*
-*
-*/
-
-                    
-// ---------------------------------------------------------
-// CUniDrmInfo::ConsumeIntent
-//
-// ---------------------------------------------------------
-//
-inline ContentAccess::TIntent CUniDrmInfo::ConsumeIntent()
-    {
-    switch ( iMediaInfo.MediaType() )
-        {
-        case EMsgMediaAudio:
-        case EMsgMediaVideo:
-            {
-            return ContentAccess::EPlay;
-            break;
-            }
-        case EMsgMediaImage:
-        case EMsgMediaText:
-        case EMsgMediaSvg:
-            {
-            return ContentAccess::EView;
-            break;
-            }
-        default:
-            {
-            return ContentAccess::EUnknown;
-            break;
-            }
-        }
-    }
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniMimeInfo.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,269 +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: 
-*       CUniMimeInfo, Storage for objects mime headers.
-*
-*
-*/
-
-
-#ifndef __UNIMIMEINFO_H
-#define __UNIMIMEINFO_H
-
-// INCLUDES
-
-#include <cmsvattachment.h>
-
-// CONSTANTS
-
-// MACROS
-
-// FORWARD DECLARATIONS
-
-// DATA TYPES
-
-// FUNCTION PROTOTYPES
-
-// CLASS DECLARATION
-class MMsvAttachmentManager;
-class CBaseMtm;
-class CUniDataUtils;
-
-/**
-* CUniMimeInfo - Container for the MIME headers of an attachment.
-* NOTE no support for X-Type-Params
-*      only support for filename ContentDisposition parameter
-*      only support for charset ContentTypeL parameter
-*
-* If some header is not set zero lenght descriptor is returned.
-*
-* @lib UniDataModel.lib
-* @since 3.1
-*/
-class CUniMimeInfo : public CBase
-    {
-    public:
-
-    /**
-    * Constructor
-    *
-    * @since    3.1
-    */
-    CUniMimeInfo();
-
-    /**
-    * Destructor
-    *
-    * @since    3.1
-    */
-    ~CUniMimeInfo();
-
-    //
-    // Accessors/Mutators
-    //
-
-    /**
-    * SetContentTypeL
-    * NOTE: 8-bit
-    *
-    * @since    3.1
-    * @param    aMimeType   IN content type
-    */
-    void SetContentTypeL( const TDesC8& aMimeType );
-
-    /**
-    * ContentType
-    * NOTE: 8-bit
-    *
-    * @since    3.1
-    * @return   pointer to content type buffer
-    */
-    inline const TPtrC8 ContentType() const;
-
-    /**
-    * SetCharset
-    * As content type charset parameter
-    * No other content type specific parameters supported
-    * charset = 0 means no charset is set
-    * (0 is IANA reserved number, not allocated currently to any charset.)
-    *
-    * @since    3.1
-    * @param    aCharset    IN character set as MIB enumeration
-    */
-    inline void SetCharset( TUint aCharset );
-
-    /**
-    * Charset
-    * As content type charset parameter
-    * No other content type specific parameters supported
-    * charset = 0 means no charset is set
-    * (0 is IANA reserved number, not allocated currently to any charset.)
-    *
-    * @since    3.1
-    * @return   character set MIB enumeration
-    */
-    inline TUint Charset() const;
-
-    /**
-    * SetContentTypeL
-    * NOTE: 16-bit
-    *
-    * @since    3.1
-    * @param    aContLoc    IN content location
-    */
-    void SetContentLocationL( const TDesC& aContLoc );
-
-    /**
-    * ContentLocation
-    * NOTE: 16-bit
-    *
-    * @since    3.1
-    * @return   pointer to content location buffer
-    */
-    inline const TPtrC ContentLocation() const;
-
-    /**
-    * SetContentIdL
-    * NOTE: 8-bit
-    *
-    * @since    3.1
-    * @param    aCid    IN content id
-    */
-    void SetContentIdL( const TDesC8& aCid );
-
-    /**
-    * ContentId
-    * NOTE: 8-bit
-    *
-    * @since    3.1
-    * @return   pointer to content id buffer
-    */
-    inline const TPtrC8 ContentId() const;
-
-    /**
-    * SetContentBaseL
-    * NOTE: 8-bit
-    *
-    * @since    3.1
-    * @param    aContBase   IN content base
-    */
-    void SetContentBaseL( const TDesC8& aContBase );
-
-    /**
-    * ContentBase
-    * NOTE: 8-bit
-    *
-    * @since    3.1
-    * @return   pointer to content base buffer
-    */
-    inline const TPtrC8 ContentBase() const;
-
-    /**
-    * SetContentDescriptionL
-    * NOTE: 8-bit
-    *
-    * @since    3.1
-    * @param    aContDesc   IN content description
-    */
-    void SetContentDescriptionL( const TDesC8& aContDesc );
-
-    /**
-    * ContentDescription
-    * NOTE: 8-bit
-    *
-    * @since    3.1
-    * @return   pointer to content description buffer
-    */
-    inline const TPtrC8 ContentDescription() const;
-
-    /**
-    * SetContentDispositionL
-    * NOTE: 8-bit
-    *
-    * @since    3.1
-    * @param    aContDesc   IN content disposition
-    */
-    void SetContentDispositionL( const TDesC8& aContDisp );
-
-    /**
-    * ContentDisposition
-    * NOTE: 8-bit
-    *
-    * @since    3.1
-    * @return   pointer to content disposition buffer
-    */
-    inline const TPtrC8 ContentDisposition() const;
-
-    /**
-    * Size
-    *
-    * @since    3.1
-    * @return   size of the mime headers in bytes
-    */
-    TInt Size() const;
-
-    /**
-    * SaveMimeInfoL
-    * Save objects mime info into message store
-    *
-    * @since    3.1
-    * @param    aManager    IN reference to attachment manager
-    * @param    aAttachment IN reference to attachment
-    */
-    void SaveMimeInfoL( MMsvAttachmentManager& aManager, CMsvAttachment& aAttachment );
-
-    /**
-    * ReadMimeInfoL
-    * Reads attachments mime info from message store
-    *
-    * @since    3.1
-    * @param    aAttachment IN reference to attachment
-    */
-    void ReadMimeInfoL( CMsvAttachment& aAttachment );
-
-	/**
-    * EnsureContentLocationL
-	* Make sure that ContentLocation exists. In case it
-    * doesn't one is created from the file name.
-    *
-    * @since    3.1
-    * @param    aManager    IN reference to attachment manager
-    * @param    aAttachment IN reference to attachment
-    * @param    aPlainFileName   IN attachment file name
-	*/
-    void EnsureContentLocationL(
-        MMsvAttachmentManager& aManager,
-        CMsvAttachment& aAttachment,
-        TDesC& aPlainFileName );
-
-    private: // data
-
-    HBufC8* iContentDescription;
-
-    HBufC8* iContentBase;
-    HBufC16* iContentLocation;
-    HBufC8* iContentId;
-
-    HBufC8* iContentType;
-    TUint iContentTypeCharset; // As MIB enum.
-
-    HBufC8* iContentDisposition;
-    };
-
-#include <UniMimeInfo.inl>
-
-#endif //__UNIMIMEINFO_H
-
-
-
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniMimeInfo.inl	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +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: 
-*       CUniMimeInfo, Storage for objects mime headers.
-*
-*
-*/
-
-
-// ---------------------------------------------------------
-// ContentType
-// NOTE: 8 bit.
-// ---------------------------------------------------------
-inline const TPtrC8 CUniMimeInfo::ContentType() const
-    {
-    return iContentType ? TPtrC8( *iContentType ) : TPtrC8();
-    }
-
-// ---------------------------------------------------------
-// Charset
-// ---------------------------------------------------------
-inline TUint CUniMimeInfo::Charset() const
-    {
-    return iContentTypeCharset;
-    }
-
-// ---------------------------------------------------------
-// SetCharset
-// ---------------------------------------------------------
-inline void CUniMimeInfo::SetCharset( TUint aCharset )
-    {
-    iContentTypeCharset = aCharset;
-    }
-
-// ---------------------------------------------------------
-// ContentLocation
-// NOTE: 16 bit.
-// ---------------------------------------------------------
-inline const TPtrC CUniMimeInfo::ContentLocation() const
-    {
-    return iContentLocation ? TPtrC( *iContentLocation ) : TPtrC();
-    }
-        
-// ---------------------------------------------------------
-// ContentId
-// NOTE: 8 bit.
-// ---------------------------------------------------------
-inline const TPtrC8 CUniMimeInfo::ContentId() const
-    {
-    return iContentId ? TPtrC8( *iContentId ) : TPtrC8();
-    }
-
-// ---------------------------------------------------------
-// ContentBaseL
-// NOTE: 8 bit.
-// ---------------------------------------------------------
-inline const TPtrC8 CUniMimeInfo::ContentBase() const
-    {
-    return iContentBase ? TPtrC8( *iContentBase ) : TPtrC8();
-    }   
-
-// ---------------------------------------------------------
-// ContentDescription
-// NOTE: 8 bit.
-// ---------------------------------------------------------
-inline const TPtrC8 CUniMimeInfo::ContentDescription() const
-    {
-    return iContentDescription ? TPtrC8( *iContentDescription ) : TPtrC8();
-    }
-
-// ---------------------------------------------------------
-// ContentDisposition
-// NOTE: 8 bit.
-// ---------------------------------------------------------
-inline const TPtrC8 CUniMimeInfo::ContentDisposition() const
-    {
-    return iContentDisposition ? TPtrC8( *iContentDisposition ) : TPtrC8();
-    }
-
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniModelConst.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +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: 
-*       UniEditor constant definitions
-*
-*
-*/
-
-
-#ifndef __UNIMODELCONST_H
-#define __UNIMODELCONST_H
-
-// INCLUDES
-#include <msvids.h>                     // TMsvId
-/*rushi
-#include <unieditorfeatures.h>
-*/
-
-// CONSTANTS
-const TInt KDefResFileSignature = 4;  // Dummy resource file signature
-_LIT( KUniDataModelResourceFilename, "z:UniDataModel.rsc" );
-
-// MACROS
-
-// FORWARD DECLARATIONS
-
-// DATA TYPES
-
-// Value returned by SMIL model's ParseL method.
-enum TUniParseResult
-    {
-    EParsedFromList            = 0x0001, // (1) <-+ These are exclusive for each other
-    EParsedFromSmil            = 0x0002, // (1) <-/
-    EUnsupportedObjects        = 0x0100,
-    EMissingObjects            = 0x0200,
-    EBadlyReferencedObjects    = 0x0400,
-    ERegionMediaTypeMismatch   = 0x0800,
-    EOneNonConformantObject    = 0x1000,
-    EMultiNonConformantObject  = 0x2000,
-    ETextAndImageRegionsSame   = 0x4000,
-    EObjectRemoved             = 0x8000
-    };
-
-enum TUniSmilType
-    {
-    ENoSmil,
-    EMultipleSmil,
-    EMmsSmil,
-    ETemplateSmil,
-    E3GPPSmil
-    };
-
-//  TUniLayout
-//  Defines order of objects in display.
-enum TUniLayout
-    {
-    EUniUndefinedLayout = 0,
-    EUniImageFirst,
-    EUniTextFirst
-    };
-
-enum TUniRegion
-    {
-    EUniRegionUnresolved,
-    EUniRegionImage,
-    EUniRegionText,
-    EUniRegionAudio
-    };
-
-// FUNCTION PROTOTYPES
-
-// CLASS DECLARATION
-
-#endif // __UNIMODELCONST_H
-
-// End of file
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniObject.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,629 +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: 
-*       CUniObject, Storage for single attachment in presentation.
-*
-*
-*/
-
-
-#ifndef __UNIOBJECT_H
-#define __UNIOBJECT_H
-
-// INCLUDES
-
-#include <e32std.h>
-#include <msvstd.h>     // for TMsvId
-#include <cmsvattachment.h>
-
-#include <DRMEvent.h>
-#include <DRMEventObserver.h>
-
-#include <MsgMedia.hrh>
-
-#include <UniModelConst.h>
-
-
-// CONSTANTS
-const TUid KUidAttachmentIndication = {0x10282CB0};
-
-// MACROS
-
-// FORWARD DECLARATIONS
-class CUniMimeInfo;
-class CMsgMediaInfo;
-class CUniDrmInfo;
-class CBaseMtm;
-class CUniDataUtils;
-class CMsvStore;
-class MMsvAttachmentManager;
-class CUniObject;
-class CDRMNotifier;
-// DATA TYPES
-
-// FUNCTION PROTOTYPES
-
-// CLASS DECLARATION
-
-/**
-* MUniObjectSaveObserver - Callback API for object saving.
-*
-* @since 3.1
-*/
-class MUniObjectSaveObserver
-    {
-    public:
-        virtual void ObjectSaveReady( TInt aError ) = 0;
-    };
-
-enum TUniObjectEvent
-    {
-	EUniObjectEventDrmRightsChanged = 0
-    };
-
-class MUniObjectObserver
-    {
-    public:
-        virtual void HandleUniObjectEvent(  CUniObject&  aUniObject,
-                                            TUniObjectEvent aUniEvent ) = 0;
-    };
-
-/**
-* CUniObject - Representation of a single attachment of a message.
-*
-* @lib UniDataModel.lib
-* @since 3.1
-*/
-class CUniObject : public CActive,
-                   public MDRMEventObserver
-
-    {
-
-    public:  // New methods
-
-        /**
-        * Factory method that creates this object
-        * from an attachment.
-        *
-        * @since    3.1
-        * @param    aMtm    IN reference to client mtm
-        * @param    aMedia  IN initialized media info object - takes ownership!
-        * @param    aManager        IN reference to attachment manager
-        * @param    aAttachmentId   IN id of the attachment from
-        *                           which to create the object
-        * @return   Pointer to instance in cleanup stack
-        */
-        static CUniObject* NewLC(
-            RFs& aFs,
-            CBaseMtm& aMtm,
-            CUniDataUtils& aData,
-            CMsgMediaInfo* aMedia,
-            MMsvAttachmentManager& aManager,
-            CMsvAttachment& aAttachment );
-
-        /**
-        * Factory method that creates this object
-        * from an attachment.
-        *
-        * @since    3.1
-        * @param    aMtm    IN reference to client mtm
-        * @param    aMedia  IN initialized media info object - takes ownership!
-        * @param    aAttachmentId   IN id of the attachment from
-        *                           which to create the object
-        * @return   Pointer to instance
-        */
-        static CUniObject* NewL(
-            RFs& aFs,
-            CBaseMtm& aMtm,
-            CUniDataUtils& aData,
-            CMsgMediaInfo* aMedia,
-            MMsvAttachmentManager& aManager,
-            CMsvAttachment& aAttachment );
-
-        /**
-        * Factory method that creates this object
-        * from a file.
-        *
-        * @since    3.1
-        * @param    aData   IN reference to MsgData object
-        * @param    aMedia  IN initialized media info object - takes ownership!
-        * @return   Pointer to instance in cleanup stack
-        */
-        static CUniObject* NewLC(
-            RFs& aFs,
-            CBaseMtm& aMtm,
-            CUniDataUtils& aData,
-            CMsgMediaInfo* aMedia );
-
-        /**
-        * Factory method that creates this object
-        * from a file.
-        *
-        * @since    3.1
-        * @param    aData   IN reference to MsgData object
-        * @param    aMedia  IN initialized media info object - takes ownership!
-        * @return   Pointer to instance
-        */
-        static CUniObject* NewL(
-            RFs& aFs,
-            CBaseMtm& aMtm,
-            CUniDataUtils& aData,
-            CMsgMediaInfo* aMedia );
-
-        /**
-        * Destructor
-        *
-        * @since    3.1
-        */
-        virtual ~CUniObject();
-
-        /**
-        * Save
-        * Save the object to message store.
-        * If leave occurs, attachment is cleaned up from the
-        * message store.
-        *
-        * @since    3.1
-        * @param    aObserver   IN operation observer
-        * @param    aSaveType   IN save type
-        */
-        virtual void Save(
-            MUniObjectSaveObserver& aObserver,
-            CMsvAttachment::TMsvAttachmentType aSaveType );
-
-        /**
-        * Remove from store
-        * Removes attachment from message store.
-        *
-        * @since    3.1
-        * @param    aMtm    IN reference to MMS client mtm
-        */
-        virtual void RemoveFromStoreL();
-
-        /**
-        * AttachmentId
-        * Accessor.
-        *
-        * @since    3.1
-        * @return   Attachment id of the object
-        */
-        inline TMsvAttachmentId AttachmentId() const;
-
-        /**
-        * MimeInfo
-        * Accessor.
-        *
-        * @since    3.1
-        * @return   Pointer to the object's mime header class
-        */
-        inline CUniMimeInfo* MimeInfo() const;
-
-        /**
-        * DrmInfo
-        * Accessor.
-        *
-        * @since    3.1
-        * @return   Pointer to the object's mime header class
-        */
-        inline CUniDrmInfo* DrmInfo() const;
-
-        /**
-        * MimeType
-        * Returns the mime type of the object. Use this instead
-        * of MimeInfo's or MediaInfo's mime type unless you are
-        * absolutely sure what you are doing.
-        *
-        * @since    3.1
-        * @return   Mime type of the object.
-        */
-        TPtrC8 MimeType() const;
-
-        /**
-        * MediaInfo
-        * Accessor.
-        *
-        * @since    3.1
-        * @return   Pointer to the object's media info class
-        */
-        inline CMsgMediaInfo* MediaInfo() const;
-
-        /**
-        * MediaType
-        * Returns the media type of the object. Use this instead
-        * of MediaInfo's media type unless you are absolutely
-        * sure what you are doing.
-        *
-        * @since    3.1
-        * @return   Media type of the object.
-        */
-        TMsgMediaType MediaType() const;
-
-        /*
-        * Size
-        *
-        * @since    3.1
-        * @param    aWithoutHeaders IN if ETrue include MIME headers' sizes
-        *                           if EFalse count only file sizes
-        * @return   Size of the object in bytes
-        */
-        virtual TInt Size( TBool aWithoutHeaders = ETrue );
-
-        /**
-        * Corrupted
-        * Accessor.
-        *
-        * @since    3.1
-        * @return   ETrue, if object corrupted,
-        *           EFalse otherwise
-        */
-        inline TBool Corrupted() const;
-
-        /**
-        * SetCorrupted
-        * Mutator.
-        *
-        * @since    3.1
-        * @param    aCorrupted  IN ETrue to mark object corrupted
-        */
-        inline void SetCorrupted( TBool aCorrupted );
-
-        /**
-        * StoreState
-        * Accessor.
-        *
-        * @since    3.1
-        * @return   Store state of the object:
-        *           EStoreStateAttachment if object is stored into message store and "visible"
-        *           EStoreStateTemporary if is not yet in message store
-        *           EStoreStateHidden if object is stored into message store and "hidden"
-        */
-        //inline TMsgObjectStoreState StoreState() const;
-
-        /**
-        * SetReferenceCount
-        * Mutator.
-        *
-        * @since    3.1
-        * @param    aCount  IN number of times the object is referenced in
-        *                   the message (normally in the SMIL).
-        */
-        inline void SetReferenceCount( TInt aCount );
-
-        /**
-        * ReferenceCount
-        * Accessor.
-        *
-        * @since    3.1
-        * @return   Number of times the object is referenced in
-        *           the message (normally in the SMIL).
-        */
-        inline TInt ReferenceCount() const;
-
-        /**
-        * SetRegion
-        * Mutator.
-        *
-        * @since    3.1
-        * @param    region object is in SMIL
-        */
-        inline void SetRegion( TUniRegion aRegion );
-
-        /**
-        * Region
-        * Accessor.
-        *
-        * @since    3.1
-        * @return   region object is in SMIL
-        */
-        inline TUniRegion Region() const;
-
-        /**
-        * SetMediaTypeBySmilTag
-        * Mutator.
-        *
-        * @since    3.1
-        * @param    media type by SMIL media tag
-        */
-        inline void SetMediaTypeBySmilTag( TMsgMediaType aMediaType );
-
-        /**
-        * ReferenceCount
-        * Accessor.
-        *
-        * @since    3.1
-        * @return   media type by SMIL media tag
-        */
-        inline TMsgMediaType MediaTypeBySmilTag() const;
-
-        /**
-        * SetUniqueControlHandle
-        * Mutator.
-        *
-        * @since    3.2
-        * @param    UniqueControlHandle, -1 for "resetting".
-        */
-        inline void SetUniqueControlHandle( TInt aUniqueControlHandle );
-
-        /**
-        * UniqueControlHandle
-        * Accessor.
-        *
-        * @since    3.2
-        * @return   UniqueControlHandle, -1 if not set.
-        */
-        inline TInt UniqueControlHandle() const;
-
-        /**
-        * SetAttachment
-        * Mutator.
-        *
-        * @since    3.2
-        * @param    aObjectAttachment ETrue if object is attachment, otherwise EFalse
-        */
-        inline void SetAttachment( TBool aObjectAttachment );
-
-        /**
-        * Attachment
-        * Accessor.
-        *
-        * @since    3.2
-        * @return   ETrue if object is attachment, otherwise EFalse
-        */
-        inline TBool Attachment() const;
-
-        /**
-        * IsSaved
-        * Accessor.
-        *
-        * @since    3.2
-        * @return   Information whether this object has been saved into file system
-        *           in Viewer.
-        */
-        inline TBool IsSaved( );
-
-        /**
-        * IsSaved
-        * Mutator.
-        *
-        * @since    3.2
-        * @param    aSaved ETrue attachment has been saved
-        *                  EFalse attachment has not been saved
-        */
-        inline void SetSaved( TBool aSaved );
-
-        /**
-        * IsDrmRightsWhenLoaded. Function is applicable only, if DrmInfo exists.
-        * Accessor.
-        *
-        * @since    5.0
-        * @return   Checks whether object had DRM rights when this object was loaded
-        *           into screen. If last DRM rights were consumed during loading,
-        *           it returns ETrue.
-        *
-        */
-        inline TBool IsDrmRightsWhenLoaded( ) const;
-
-        /**
-        * ResolveDrmRightsWhenLoadedL. Saves information whether this object had DRM
-        *           rights when slide having the object was loaded. Uses
-        *           CDrmInfo::EvaluateRights() to resolve status
-        * Mutator.
-        *
-        * @since    5.0
-        *
-        */
-        void ResolveDrmRightsWhenLoadedL( );
-
-        /**
-        * SetDrmRightsWhenLoadedL. Saves information whether this object had DRM
-        *            rights when slide having the object was loaded.
-        * Mutator.
-        *
-        * @since    5.0
-        * @param    aRights ETrue: objects had rights, which were already consumed or if not consumed,
-        *                   have still rights left
-        *                   EFalse: rights have not been consumed and they are not left
-        *
-        */
-        void SetDrmRightsWhenLoaded( TBool aRights );
-
-        /**
-        * IsDrmRightsWhenLoadedObjects. Function is applicable only, if DrmInfo exists.
-        * Accessor.
-        *
-        * @since    5.0
-        * @return   Checks whether object had DRM rights when this object was loaded
-        *           into screen in the Objects view. If last DRM rights were consumed during loading,
-        *           it returns ETrue.
-        *
-        */
-        inline TBool IsDrmRightsWhenLoadedObjects( ) const;
-
-        /**
-        * SetDrmRightsWhenLoadedObjects. Saves information whether this object had DRM
-        *            rights when slide having the object was loaded into screen in the
-        *            Objects view.
-        * Mutator.
-        *
-        * @since    5.0
-        * @param    aRights ETrue: objects had rights, which were already consumed or if not consumed,
-        *                   have still rights left
-        *                   EFalse: rights have not been consumed and they are not left
-        *
-        */
-        void SetDrmRightsWhenLoadedObjects( TBool aRights );
-
-        /**
-        * Sets observer of UniObject events. Several observers are supported at the same time.
-        * Mutator.
-        *
-        * @since    5.0
-        * @param    aObserver observer
-        *
-        */
-        void SetObserverL(  MUniObjectObserver* aObserver );
-
-        /**
-        * Removes observer of UniObject events.
-        * Accessor.
-        *
-        * @since    5.0
-        *
-        */
-        void RemoveObserver(   MUniObjectObserver*     aObserver );
-
-    protected:
-
-        /**
-        * From CActive
-        */
-        void DoCancel();
-
-        /**
-        * From CActive
-        */
-        void RunL();
-
-        /**
-        * From CActive
-        */
-        TInt RunError( TInt aError );
-
-    protected:
-
-        /**
-        * Constructor.
-        *
-        * @since    3.1
-        */
-        CUniObject(
-            RFs& aFs,
-            CBaseMtm& aMtm,
-            CUniDataUtils& aData,
-            CMsgMediaInfo* aMedia );
-
-        /**
-        * 2nd phase constructor.
-        *
-        * @since    3.1
-        */
-        void ConstructL();
-
-        /**
-        * 2nd phase constructor.
-        *
-        * @since    3.1
-        * @param    aManager        IN reference to attachment manager
-        * @param    aAttachmentId   IN id of the attachment from
-        *                           which to create the object
-        */
-        void ConstructFromAttachmentL(
-            MMsvAttachmentManager& aManager,
-            CMsvAttachment& aAttachment );
-
-        /**
-        * CreateMimeInfoL
-        * Create mime info for the object from the file information
-        * and in-parameters.
-        *
-        * @since    3.1
-        */
-        void CreateMimeInfoL();
-
-        /**
-        * CreateAttachmentL
-        * Creates an attachment to message store.
-        * If leave occurs, attachment is cleaned up from the
-        * message store.
-        *
-        * @since    3.1
-        */
-        void CreateAttachmentL( );
-
-        /**
-        * SetHiddenL
-        * Sets attachment "hidden" or "visible"
-        * "Hidden" means InPreparation flag is set on and
-        * "visible" means InPreparation flag is set off
-        * Not to be called for "temporary" object
-        *
-        * @since    3.1
-        * @param    aHidden IN ETrue for "hidden", EFalse for "visible"
-        */
-        //void SetHiddenL( TBool aHidden );
-
-        virtual void DoSaveL();
-
-        void StartObjectSaveL();
-        void FinalizeObjectSaveL();
-
-        void CompleteSelf();
-
-        /// From MDRMEventObserver
-        virtual void HandleEventL( MDRMEvent* aEvent );
-
-
-    protected: // data
-
-        enum TMsgObjectSaveState
-            {
-            EObjectSavingIdle,
-            EObjectCreatingAttachment
-            };
-
-        enum TMsgObjectFlags
-            {
-            EObjectCorrupted = 0x1,
-            EObjectAttachment = 0x2,
-            EObjectDrmRightsWhenLoaded = 0x4,
-            EObjectDrmRightsWhenLoadedObjects = 0x8
-            };
-
-        RFs&                    iFs;
-        CBaseMtm&               iMtm;
-        CUniDataUtils&          iData;
-
-		TInt                    iSupportedFeatures;
-
-        TMsvAttachmentId        iAttachmentId;  // Attachment id of object. Can be id to Link file in store or to real atta.
-
-        CUniMimeInfo*           iMimeInfo;      // Contains objects mime headers.
-        CMsgMediaInfo*          iMediaInfo;     // Contains objects media information.
-        CUniDrmInfo*            iDrmInfo;
-        TInt                    iObjectFlags;
-        TInt                    iReferenceCount;
-        //TMsgObjectStoreState    iStoreState;
-        TUniRegion              iRegion;
-        TMsgMediaType           iMediaTypeBySmilTag;
-        TInt                    iUniqueControlHandle;
-
-        MUniObjectSaveObserver* iObserver;
-        CMsvAttachment::TMsvAttachmentType iSaveType;
-
-        MMsvAttachmentManager*  iManager;
-        CMsvAttachment*         iAttachment;
-        CMsvStore*              iEditStore;
-        TInt                    iSaveState;
-
-        TBool                   iSavedToFs;
-        RFile                   iFileHandle;
-
-        CDRMNotifier*           iDrmNotifier;
-        CArrayPtrFlat<MUniObjectObserver>* iObservers;
-
-    };
-
-#include <UniObject.inl>
-
-#endif // __UNIOBJECT_H
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniObject.inl	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,264 +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: 
-*       CUniObject, Storage for single attachment in presentation. 
-*
-*
-*/
-
-
-// ---------------------------------------------------------
-// CUniObject::AttachmentId
-//
-// Accessor.
-// ---------------------------------------------------------
-//
-inline TMsvAttachmentId CUniObject::AttachmentId() const
-    {
-    return iAttachmentId;
-    }
-
-// ---------------------------------------------------------
-// CUniObject::MimeInfo
-//
-// Accessor.
-// ---------------------------------------------------------
-//
-inline CUniMimeInfo* CUniObject::MimeInfo() const
-    {
-    return iMimeInfo;
-    }
-
-// ---------------------------------------------------------
-// CUniObject::MimeInfo
-//
-// Accessor.
-// ---------------------------------------------------------
-//
-inline CUniDrmInfo* CUniObject::DrmInfo() const
-    {
-    return iDrmInfo;
-    }
-
-// ---------------------------------------------------------
-// CUniObject::MediaInfo
-//
-// Accessor.
-// ---------------------------------------------------------
-//
-inline CMsgMediaInfo* CUniObject::MediaInfo() const
-    {
-    return iMediaInfo;
-    }
-
-// ---------------------------------------------------------
-// Corrupted
-//
-// Accessor
-// ---------------------------------------------------------
-inline TBool CUniObject::Corrupted() const
-    {
-    return iObjectFlags & EObjectCorrupted;
-    }
-
-// ---------------------------------------------------------
-// SetCorrupted
-//
-// Mutator
-// ---------------------------------------------------------
-inline void CUniObject::SetCorrupted( TBool aCorrupted )
-    {
-    if ( aCorrupted )
-        {
-        iObjectFlags |= EObjectCorrupted;
-        }
-    else
-        {
-        iObjectFlags &= ~EObjectCorrupted;
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniObject::StoreState
-//
-// Accessor.
-// ---------------------------------------------------------
-//
-//inline TMsgObjectStoreState CUniObject::StoreState() const
-//    {
-//    return iStoreState;
-//    }
-
-// ---------------------------------------------------------
-// CUniObject::SetReferenceCount
-//
-// Mutator.
-// ---------------------------------------------------------
-//
-inline void CUniObject::SetReferenceCount( TInt aCount )
-    {
-    iReferenceCount = aCount;
-    }
-
-// ---------------------------------------------------------
-// CUniObject::ReferenceCount
-//
-// Accessor.
-// ---------------------------------------------------------
-//
-inline TInt CUniObject::ReferenceCount() const
-    {
-    return iReferenceCount;
-    }
-
-// ---------------------------------------------------------
-// CUniObject::SetRegion
-//
-// Mutator.
-// ---------------------------------------------------------
-//
-inline void CUniObject::SetRegion( TUniRegion aRegion )
-    {
-    iRegion = aRegion;
-    }
-
-// ---------------------------------------------------------
-// CUniObject::Region
-//
-// Accessor.
-// ---------------------------------------------------------
-//
-inline TUniRegion CUniObject::Region() const
-    {
-    return iRegion;
-    }
-
-// ---------------------------------------------------------
-// CUniObject::SetMediaTypeBySmilTag
-//
-// Mutator.
-// ---------------------------------------------------------
-//
-inline void CUniObject::SetMediaTypeBySmilTag( TMsgMediaType aMediaType )
-    {
-    iMediaTypeBySmilTag = aMediaType;
-    }
-
-// ---------------------------------------------------------
-// CUniObject::MediaTypeBySmilTag
-//
-// Accessor.
-// ---------------------------------------------------------
-//
-inline TMsgMediaType CUniObject::MediaTypeBySmilTag() const
-    {
-    return iMediaTypeBySmilTag;
-    }
-
-// ---------------------------------------------------------
-// CUniObject::SetUniqueControlId
-//
-// Mutator.
-// ---------------------------------------------------------
-//
-inline void CUniObject::SetUniqueControlHandle( TInt aUniqueControlHandle )
-    {
-    iUniqueControlHandle = aUniqueControlHandle;
-    }
-
-// ---------------------------------------------------------
-// CUniObject::UniqueControlHandle
-//
-// Accessor.
-// ---------------------------------------------------------
-//
-inline TInt CUniObject::UniqueControlHandle() const
-    {
-    return iUniqueControlHandle;
-    }
-
-// ---------------------------------------------------------
-// CUniObject::SetAttachment
-//
-// Mutator.
-// ---------------------------------------------------------
-//
-inline void CUniObject::SetAttachment( TBool aObjectAttachment )
-    {
-    if ( aObjectAttachment )
-        {
-        iObjectFlags |= EObjectAttachment;
-        }
-    else
-        {
-        iObjectFlags &= ~EObjectAttachment;
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniObject::Attachment
-//
-// Accessor.
-// ---------------------------------------------------------
-//
-inline TBool CUniObject::Attachment() const
-    {
-    return iObjectFlags & EObjectAttachment;
-    }
-
-// ---------------------------------------------------------
-// CUniObject::Attachment
-//
-// Accessor.
-// ---------------------------------------------------------
-//
-inline TBool CUniObject::IsSaved( )
-    {
-    return iSavedToFs;
-    }
-
-// ---------------------------------------------------------
-// CUniObject::SetAttachment
-//
-// Mutator.
-// ---------------------------------------------------------
-//
-inline void CUniObject::SetSaved( TBool aSaved )
-    {
-    iSavedToFs = aSaved;
-    }
-
-
-// ---------------------------------------------------------
-// IsDrmRightsWhenLoaded
-//
-// Accessor.
-// ---------------------------------------------------------
-//
-inline TBool CUniObject::IsDrmRightsWhenLoaded( ) const
-    {
-    return iObjectFlags & EObjectDrmRightsWhenLoaded;    
-    }
-
-// ---------------------------------------------------------
-// IsDrmRightsWhenLoadedObjects
-//
-// Accessor.
-// ---------------------------------------------------------
-//
-inline TBool CUniObject::IsDrmRightsWhenLoadedObjects( ) const
-    {
-    return iObjectFlags & EObjectDrmRightsWhenLoadedObjects;    
-    }
-
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniObjectList.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,289 +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: 
-*       CUniObjectList, List of attachments.
-*
-*
-*/
-
-
-#ifndef __UNIOBJECTLIST_H
-#define __UNIOBJECTLIST_H
-
-// INCLUDES
-
-#include <e32std.h>
-#include <f32file.h>
-#include <apmstd.h>
-
-#include <cmsvattachment.h>
-#include <UniObject.h>
-
-
-// CONSTANTS
-
-// MACROS
-
-// FORWARD DECLARATIONS
-class CUniDataUtils;
-class CMDXMLDocument;
-class CMDXMLNode;
-class CUniObjectList;
-
-// DATA TYPES
-
-// FUNCTION PROTOTYPES
-
-// CLASS DECLARATION
-
-/**
-* MUniObjectListObserver - Callback API for object list operations.
-*
-* @since 3.1
-*/
-class MUniObjectListObserver
-    {
-    public:
-
-        /**
-        * Called when object is added to the list.
-        *
-        * @since 3.1
-        * @param aList IN List where object is added.
-        * @param aObject IN Added object.
-        * @param aIndex IN Index number of added object.
-        */
-        virtual void ObjectAddedL( CUniObjectList* aList,
-                                   CUniObject* aObject,
-                                   TInt aIndex ) = 0;
-
-        /**
-        * Called when object is removed from the list.
-        *
-        * @since 3.1
-        * @param aList IN List where object is added.
-        * @param aObject IN Removed object.
-        * @param aIndex IN Index number of removed object.
-        */
-        virtual void ObjectRemovedL( CUniObjectList* aList,
-                                     CUniObject* aObject,
-                                     TInt aIndex ) = 0;
-    };
-
-/**
-* CUniObjectList - List of attachments.
-*
-* @lib UniDataModel.lib
-* @since 3.1
-*/
-class CUniObjectList : public CBase,
-                       public MUniObjectSaveObserver
-    {
-
-    public:  // New methods
-
-        /**
-        * Factory method that creates this object.
-        *
-        * @since    3.1
-        * @param    aMtm    IN reference to client mtm
-        * @param    aData   IN reference to MsgData object
-        * @return   Pointer to instance
-        */
-        static CUniObjectList* NewL( CBaseMtm& aMtm, CUniDataUtils& aData );
-
-        /**
-        * Destructor
-        *
-        * @since    3.1
-        */
-        virtual ~CUniObjectList();
-
-        /**
-        * AddObjectL
-        * Appends object to object array.
-        *
-        * @since    3.1
-        * @param    aObject     IN object to be added
-        */
-        void AddObjectL( CUniObject* aObject );
-
-        /**
-        * SpaceNeededForSaveAll
-        * Calculates disk space needed to save all objects
-        * that are not yet saved into message store.
-        *
-        * @since    3.1
-        * @return   Disk space needed in bytes
-        */
-        TInt SpaceNeededForSaveAll();
-
-        /**
-        * SaveAll
-        * Calls SaveL for each object in the object array
-        *
-        * @since    3.1
-        * @param    aObserver   IN operation observer
-        * @param    aSaveType   IN save type
-        */
-        void SaveAll( MUniObjectSaveObserver& aObserver, CMsvAttachment::TMsvAttachmentType aSaveType );
-
-        /**
-        * RemoveAllObjectsL
-        * Removes all objects from message store and object
-        * array. Deletes all objects.
-        *
-        * @since    3.1
-        */
-        void RemoveAllObjectsL();
-
-        /**
-        * RemoveObjectL
-        * Removes an object from object array and also from
-        * message store if requested.
-        * The caller must delete the object!!!
-        *
-        * @since    3.1
-        * @param    aObject IN object to be removed
-        * @param    aRemoveFromStore    IN if EFalse remove only from object array,
-        *                               if ETrue remove also from message store
-        */
-        void RemoveObjectL( CUniObject* aObject, TBool aRemoveFromStore = ETrue );
-
-        /**
-        * GetByIndex
-        * Get object by index
-        *
-        * @since    3.1
-        * @param    aIndex  IN index
-        * @return   Pointer to object
-        */
-        CUniObject* GetByIndex( TInt aIndex );
-
-        /**
-        * GetByAttachmentId
-        * Get object by attachment id
-        *
-        * @since    3.1
-        * @param    aAttachmentId   IN attachment id
-        * @return   Pointer to object
-        */
-        CUniObject* GetByAttachmentId( TMsvAttachmentId aAttachmentId );
-
-        /**
-        * GetByNode
-        * Get object by DOM node
-        *
-        * @since    3.1
-        * @param    aNode   IN DOM node
-        * @return   Pointer to object
-        */
-        CUniObject* GetByNodeL( CMDXMLNode* aNode );
-
-        /**
-        * GetByUrl
-        * Get object by URL
-        *
-        * @since    3.1
-        * @param    aUrl    IN URL
-        * @return   Pointer to object
-        */
-        CUniObject* GetByUrlL( const TDesC& aUrl );
-
-        /**
-        * ObjectByteSize
-        * Calculate size of all the objects in bytes
-        *
-        * @since    3.1
-        * @return   Size in bytes
-        */
-        TInt ObjectByteSize() const;
-
-        /**
-        * EnsureAllObjectsHaveContentLocationL
-        * Makes sure that all objects have ContentLocation
-        * MIME header defined. All objects must have ContentLocation
-        * when SMIL is composed.
-        *
-        * @since    3.1
-        */
-        void EnsureAllObjectsHaveContentLocationL();
-
-        /**
-        * SetListObserver
-        * Sets observer to the list that changes to list are notified.
-        *
-        * @since    3.1
-        * @param aObserver IN New object list observer. Setting observer
-        *                     to NULL resets observer.
-        */
-        void SetListObserver( MUniObjectListObserver* aObserver );
-
-        /**
-        * Returns object based on unique handle.
-        *
-        * @param  aUniqueControlHandle Control handle that uniquely identified the control
-        * @return Pointer to matched uniobject or NULL if not found.
-        */
-        CUniObject* GetObjectByUniqueHandle( TInt aUniqueControlHandle );
-
-        /**
-        * Count
-        *
-        * @since    3.1
-        * @return   Number of objects
-        */
-        inline TInt Count() const;
-
-    public:
-
-        /**
-        * From MUniObjectSaveObserver
-        */
-        void ObjectSaveReady( TInt aError );
-
-    protected:
-
-        /**
-        * Constructor.
-        *
-        * @since    3.1
-        * @param    aMtm    IN reference to client mtm
-        * @param    aData   IN reference to MsgData object
-        */
-        CUniObjectList( CBaseMtm& aMtm, CUniDataUtils& aData );
-
-        /**
-        * 2nd phase constructor.
-        *
-        * @since    3.1
-        */
-        void ConstructL();
-
-    protected: // data
-
-        CArrayPtrFlat<CUniObject>* iObjectArray;
-        CUniDataUtils& iData;
-        CBaseMtm& iMtm;
-
-        MUniObjectSaveObserver* iSaveObserver;
-        CMsvAttachment::TMsvAttachmentType iSaveType;
-        TInt iSaveCount;
-
-        MUniObjectListObserver* iListObserver;
-    };
-
-#include <UniObjectList.inl>
-
-#endif // __UNIOBJECTLIST_H
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniObjectList.inl	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +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: 
-*       CUniObjectList, List of attachments. 
-*
-*
-*/
-
-
-// ---------------------------------------------------------
-// CUniObjectList::Count
-//
-// Accessor.
-// ---------------------------------------------------------
-//
-inline TInt CUniObjectList::Count() const
-    {
-    return iObjectArray->Count();
-    }
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniSmil.hrh	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +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: 
-*     Constants for smilApi that may need to be used in resource files
-*
-*
-*/
-
-
-#ifndef __UNISMIL_HRH
-#define __UNISMIL_HRH
-
-// For COMPOSE_PARAMS r_root_layout_compose
-enum 
-    {
-    ESmilNoRootLayout = 0,
-    ESmilDisplayRootLayout
-    };
-
-// For COMPOSE_PARAMS r_compose_xmlns
-enum 
-    {
-    ESmilNoXmlns = 0,
-    ESmilYesXmlns
-    };
-
-#endif // __UNISMIL_HRH
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniSmil.rh	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +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: 
-*     This file contains declarations for resources of smilapi.
-*     The file can be included in C++ or resource file.
-*     
-*
-*/
-
-
-#ifndef __UNISMIL_RH
-#define __UNISMIL_RH
-
-#include "UniSmil.hrh"
-
-//----------------------------------------------------  
-//    COMPOSE_PARAMS
-//    Parameters to define how to do composing
-//
-//----------------------------------------------------
-//
-STRUCT COMPOSE_PARAMS
-{
-    WORD    r_root_layout_compose   = ESmilNoRootLayout;
-    WORD    r_display_width         = 0;
-    WORD    r_display_height        = 0;
-    WORD    r_compose_xmlns         = 0;
-    WORD    r_top_padding           = 0;
-    WORD    r_region_padding        = 0;
-    WORD    r_bottom_padding        = 0;
-}
-
-//----------------------------------------------------  
-//    REGION
-//    Values for composing
-//
-//----------------------------------------------------
-//
-STRUCT REGION
-   {
-   LTEXT        r_id            =   "";
-   LTEXT        r_fit           =   "";
-   WORD         r_max_height    =   0;
-   WORD         r_min_height    =   0;
-   WORD         r_max_width     =   0;
-   WORD         r_min_width     =   0;
-   WORD         r_top           =   0;
-   WORD         r_left          =   0;
-   }
-
-//----------------------------------------------------
-//    SLIDE
-//    Values for composing
-//
-//----------------------------------------------------
-//
-STRUCT SLIDE    
-   {
-   WORD r_default_duration_milliseconds =   0; 
-   WORD r_default_when_audio_milliseconds   =   0; 
-   }
-
-#endif // __UNISMIL_RH
-
-// End of File
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniSmilList.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,202 +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: 
-*       CUniSmilList, List of Smil attachments.
-*
-*
-*/
-
-
-#ifndef __UNISMILLIST_H
-#define __UNISMILLIST_H
-
-// INCLUDES
-
-#include <e32std.h>
-#include <f32file.h>
-#include <apmstd.h>
-#include <cmsvattachment.h>
-
-#include <gmxmlcomposer.h>
-
-#include <UniModelConst.h>
-
-// CONSTANTS
-
-// MACROS
-
-// FORWARD DECLARATIONS
-class CUniDataUtils;
-class CBaseMtm;
-class CMDXMLDocument;
-class CMDXMLNode;
-class CMsvStore;
-class MMsvAttachmentManager;
-
-// DATA TYPES
-
-// FUNCTION PROTOTYPES
-
-// CLASS DECLARATION
-
-/**
-* MUniSmilComposeObserver - Callback API for SMIL composing.
-*
-* @since 3.1
-*/
-class MUniSmilComposeObserver
-    {
-    public:
-        virtual void SmilComposeEvent( TInt aError ) = 0;
-    };
-
-/**
-* CUniSmilList - List of SMIL attachments of a message.
-*
-* @lib UniDataModel.lib
-* @since 3.1
-*/
-class CUniSmilList : public CActive,
-                     public MMDXMLComposerObserver
-    {
-
-    public:  // New methods
-
-        /**
-        * Factory method that creates this object.
-        *
-        * @param    aMtm    IN reference to client mtm
-        * @return   Pointer to instance
-        */
-        static CUniSmilList* NewL( CBaseMtm& aMtm );
-
-        /**
-        * Destructor
-        *
-        */
-        virtual ~CUniSmilList();
-
-        /**
-        * AddSmilAttachmentL
-        * Adds SMIL attachment to smil array
-        *
-        * @since    3.1
-        * @param    aAttachmentId   IN id of the SMIL attachment
-        *                           to be added
-        */
-        void AddSmilAttachmentL(
-            MMsvAttachmentManager& aManager,
-            TMsvAttachmentId aAttachmentId );
-
-        /**
-        * CreateSmilAttachmentL
-        * Creates SMIL attachment from DOM
-        *
-        * @param    aAttachmentId   OUT id of the created SMIL attachment
-        * @param    aDom    IN the DOM from which to create the SMIL
-        * @param    aFs     IN reference to file session
-        */
-        void CreateSmilAttachmentL(
-            MUniSmilComposeObserver& aObserver,
-            CMsvStore& aEditStore,
-            CMDXMLDocument* aDom );
-
-        /**
-        * GetSmilAttachmentByIndex
-        * Get SMIL attachment by index
-        *
-        * @param    aIndex  IN index
-        * @return   Message id of the SMIL attachment
-        */
-        TMsvAttachmentId GetSmilAttachmentByIndex( TInt aIndex );
-
-        /**
-        * GetSmilFullPathByIndexL
-        * Get file handle of SMIL attachment by index
-        *
-        * @param    aIndex  IN index
-        */
-        RFile GetSmilFileByIndexL( TInt aIndex );
-
-        /**
-        * SmilByteSize
-        * Calculate size of all the SMIL attachments in bytes
-        *
-        * @param    aFs     IN reference to file session
-        * @return   Size in bytes
-        */
-        inline TInt SmilByteSize() const;
-
-        /**
-        * Count
-        *
-        * @return   Number of objects
-        */
-        inline TInt Count() const;
-
-        void ComposeFileCompleteL();
-
-    protected:
-
-        /**
-        * From CActive
-        */
-        void DoCancel();
-
-        /**
-        * From CActive
-        */
-        void RunL();
-
-        /**
-        * From CActive
-        */
-        TInt RunError( TInt aError );
-
-
-    protected:
-
-        /**
-        * Constructor.
-        *
-        * @param    aMtm    IN reference to client mtm
-        */
-        CUniSmilList( CBaseMtm& aMtm );
-
-        /**
-        * 2nd phase constructor.
-        */
-        void ConstructL();
-
-    protected: // data
-
-        CBaseMtm& iMtm;
-
-        CArrayFixFlat<TMsvAttachmentId>* iSmilAttachmentArray;
-        TInt iSmilSize;
-
-        MMsvAttachmentManager* iManager;
-        CMsvAttachment* iAttachment;
-        CMsvStore* iEditStore;
-        RFile* iEditFile;
-
-        CMDXMLDocument* iDom;
-        CMDXMLComposer* iComposer;
-        MUniSmilComposeObserver* iObserver;
-        CActiveSchedulerWait     iObjWait;
-    };
-
-#include <UniSmilList.inl>
-
-#endif // __UNISMILLIST_H
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniSmilList.inl	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +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: 
-*       CUniSmilList, List of attachments. 
-*
-*
-*/
-
-
-// ---------------------------------------------------------
-// CUniSmilList::SmilByteSize
-//
-// Accessor.
-// ---------------------------------------------------------
-//
-inline TInt CUniSmilList::SmilByteSize() const
-    {
-    return iSmilSize;
-    }
-
-// ---------------------------------------------------------
-// CUniSmilList::Count
-//
-// Accessor.
-// ---------------------------------------------------------
-//
-inline TInt CUniSmilList::Count() const
-    {
-    return iSmilAttachmentArray->Count();
-    }
-
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniSmilModel.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,728 +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: 
-*       CUniSmilModel, Storage for Smil presentation data.
-*
-*
-*/
-
-
-#ifndef __UNISMILMODEL_H
-#define __UNISMILMODEL_H
-
-// INCLUDES
-#include <cmsvattachment.h>
-
-#include <UniModelConst.h>
-#include <UniObjectList.h>
-#include <UniSmilUtils.h>
-
-// CONSTANTS
-
-// MACROS
-
-// FORWARD DECLARATIONS
-
-class RResourceFile;
-
-class CBaseMtm;
-class CUniSmilSlide;
-class CSmilPresentation;
-class TDataType;
-class CMsvEntrySelection;
-class CUniDataUtils;
-class CUniObject;
-class CUniTextObject;
-class CEikRichTextEditor;
-
-class CMDXMLNode;
-class CMDXMLElement;
-class CUniSmilParams;
-
-// DATA TYPES
-
-typedef CArrayPtrFlat<CUniSmilSlide> CSmilSlideArray;
-
-// FUNCTION PROTOTYPES
-
-// CLASS DECLARATION
-
-/**
-* CUniSmilModel - Representation of SMIL presentation data.
-* Hides SMIL syntax from client.
-*
-* @lib UniDataModel.lib
-* @since 3.1
-*/
-class CUniSmilModel : public CBase
-    {
-    public:  // New methods
-
-        /**
-        * NewLC
-        * Factory method that creates this object.
-        *
-        * @since    3.1
-        * @param    aFs     IN reference to file session
-        * @param    aMtm    IN reference to client mtm
-        * @param    aData   IN reference to MsgData object
-        * @param    aObjectList IN reference to object list
-        * @return   Pointer to instance in cleanup stack
-        */
-        static CUniSmilModel* NewLC(
-            RFs& aFs,
-            CBaseMtm& aMtm,
-            CUniDataUtils& aData,
-            CUniObjectList& aObjectList );
-
-        /**
-        * NewL
-        * Factory method that creates this object.
-        *
-        * @since    3.1
-        * @param    aFs     IN reference to file session
-        * @param    aMtm    IN reference to client mtm
-        * @param    aData   IN reference to MsgData object
-        * @param    aObjectList IN reference to object list
-        * @return   Pointer to instance
-        */
-        static CUniSmilModel* NewL(
-            RFs& aFs,
-            CBaseMtm& aMtm,
-            CUniDataUtils& aData,
-            CUniObjectList& aObjectList );
-
-        /**
-        * Destructor
-        *
-        * @since    3.1
-        */
-        virtual ~CUniSmilModel();
-
-        /**
-        * ParseL
-        * Creates presentation from either from DOM (if set) or
-        * from object list (no SMIL used).
-        * Set various flags according to parse results.
-        *
-        * This function should only leave if model cannot be made
-        * because some basic Symbian OS error for example OOM.
-        * This never leaves if there is some kind of mitchmatch between
-        * presentation and actual message ie smil refers to object
-        * that does not exist. This kind of leaves are TRAPPED here
-        * and if they are not the leave should be considered as an
-        * implementation bug in this function.
-        *
-        * @since    3.1
-        * @return   Parse result flags
-        */
-        TInt ParseL( CMDXMLDocument* aDom );
-
-        /**
-        * SetScreenSize
-        * Sets size of physical dislplay in pixels
-        *
-        * @since    3.1
-        * @param    aScreenSize     IN screen size in pixels
-        */
-        inline void SetScreenSize( const TSize& aScreenSize );
-
-        /*
-        * AddSlideL
-        * Adds slide to model. If aSlideNum is -1 or greater than
-        * current max -> appends. Otherwise adds to given pos.
-        * Zero means first.
-        *
-        * @since    3.1
-        * @param    aSlideNum   IN insert position
-        */
-        void AddSlideL( TInt aSlideNum = -1 );
-
-        /**
-        * RemoveSlide
-        * Removes slide. Slide must be empty!
-        *
-        * @since    3.1
-        * @param    aSlideNum   IN position of slide to be removed
-        */
-        void RemoveSlide( TInt aSlideNum );
-
-        /**
-        * MoveSlideL
-        * Moves slide.
-        *
-        * @since    3.1
-        * @param    aSlideToMove IN the original position of slide to be moved
-        * @param    aPlaceToMove IN place where slide is moved to
-        */
-        void MoveSlideL( TInt aSlideToMove, TInt aPlaceToMove );
-
-        /**
-        * SortSlidesL
-        * Sorts slides accoring to a separate comparison function
-        * called SortSlidesCompare().
-        * Insertion sort algorithm.
-        *
-        * Notice! Intended to be used with SendAs when there
-        * are multiple slides - each slide containing only
-        * one object. (Sorts slides accoring to first object in
-        * the slide.)
-        *
-        * @since    3.1
-        */
-        void SortSlidesL();
-
-        /*
-        * IsSlide
-        * Check if model contains given slide
-        *
-        * @since    3.1
-        * @param    aSlideNum   IN slide to check
-        * @return   ETrue, if slide exists,
-        *           EFalse, otherwise
-        */
-        TBool IsSlide( TInt aSlideNum ) const;
-
-        /**
-        * Adds text buffer to model.
-        *
-        * @since    3.1
-        * @param    aSlideNum   IN slide number where text is added
-        * @param    aText   IN text buffer to be added
-        * @return   Pointer to the added text object
-        *           Ownership NOT transferred.
-        */
-        CUniTextObject* AddTextObjectL(
-            TInt aSlideNum,
-            CEikRichTextEditor* aText );
-
-        /**
-        * AddObjectL
-        * Adds an object into msg store and smil slide
-        *
-        * @since    3.1
-        * @param    aSlideNum   IN slide number where text is added
-        * @param    aPathToObject   IN file to be added
-        * @return   Pointer to the added object
-        *           Ownership NOT transferred.
-        */
-        CUniObject* AddObjectL(
-            MUniObjectSaveObserver& aObserver,
-            TInt aSlideNum,
-            CMsgMediaInfo* aMedia );
-
-        /**
-        * AddStoredObjectL
-        * Adds an object that is already in msg store to smil slide
-        *
-        * @since    3.1
-        * @param    aSlideNum   IN slide number where text is added
-        * @param    aAttachmentId   IN file to be added
-        * @param    aMedia      IN media info - ownership transferred to MsgObject
-        * @return   Pointer to the added object
-        *           Ownership NOT transferred.
-        */
-        CUniObject* AddStoredObjectL(
-            TInt aSlideNum,
-            TMsvAttachmentId aAttachmentId,
-            CMsgMediaInfo* aMedia );
-
-        /**
-        * RemoveObjectL
-        * Deletes an object of certain type from a slide and msg store
-        * if needed (last reference to the object removed).
-        *
-        * @since    3.1
-        * @param    aSlideNum   IN slide number where text is added
-        * @param    aObject     IN the object to be removed
-        * @param    aLeaveToStore IN Do not remove attachment from store
-        *                            USE ONLY AS SECOND ATTEMPT IF REMOVING NORMALLY FAILS
-        */
-        void RemoveObjectL(
-            TInt aSlideNum,
-            CUniObject* aObject,
-            TBool aLeaveToStore = EFalse);
-
-        /**
-        * RemoveObjectByIndexL
-        * Deletes the N'th object of from a slide and msg store if
-        * needed (last reference to the object removed).
-        *
-        * @since    3.1
-        * @param    aSlideNum   IN slide number
-        * @param    aObjectNum  IN number of the object to be removed
-        */
-        void RemoveObjectByIndexL(
-            TInt aSlideNum,
-            TInt aObjectNum );
-
-        /**
-        * GetObjectByIndex
-        * Gets object by it's layout position in slide.
-        * E.g. object number "0" is the first in layout.
-        *
-        * @since    3.1
-        * @param    aSlideNum   IN slide number
-        * @param    aObjectNum  IN number of the object
-        * @return   Pointer to the object,
-        *           NULL if not found
-        */
-        CUniObject* GetObjectByIndex(
-            TInt aSlideNum,
-            TInt aObjectNum ) const;
-
-        /**
-        * GetObject
-        * Gets object of certain type from a slide
-        *
-        * @since    3.1
-        * @param    aSlideNum   IN slide number
-        * @param    aObjectType IN type of the object
-        * @return   Pointer to the object,
-        *           NULL if not found
-        */
-        CUniObject* GetObject(
-            TInt aSlideNum,
-            TUniRegion aRegion ) const;
-
-        /**
-        * IsObject
-        * Checks if given slide has object of certain type.
-        *
-        * @since    3.1
-        * @param    aSlideNum   IN slide number
-        * @param    aObjectType IN type of the object
-        * @param    aNum    IN the ordinal number of the object
-        * @return   ETrue, slide has object of asked type,
-        *           EFalse, otherwise.
-        */
-        //TBool IsObject(
-        //    TInt aSlideNum,
-        //    TMsgMediaType aObjType ) const;
-
-        /**
-        * SlideCount
-        * Count of slides in SMIL presentation.
-        *
-        * @since    3.1
-        * @return   Number of slides
-        */
-        inline TInt SlideCount() const;
-
-        /**
-        * ObjectCount
-        * Count of media objects in SMIL presentation.
-        * NOTE: Smil attachment is _not_ counted as object.
-        *
-        * @since    3.1
-        * @return   Number of objects
-        */
-        TInt ObjectCount() const;
-
-        /**
-        * SlideObjectCount
-        * Count of media objects in given slide
-        *
-        * @since    3.1
-        * @param    aSlideNum   IN slide number
-        * @return   Number of objects on the slide
-        */
-        TInt SlideObjectCount( TInt aSlideNum ) const;
-
-        /**
-        * Layout
-        * Accessor. Queries current layout. Layout is same for all slides.
-        *
-        * @since    3.1
-        * @return   Layout
-        */
-        inline TUniLayout Layout() const;
-
-        /**
-        * SetLayoutL
-        * Mutator. All slides have same layout.
-        * NOTE: This should only be called from editor objectsview
-        * ChangeOrder command. Layout is automatically determined
-        * at parse time.
-        *
-        * @since    3.1
-        * @param    aLayout IN new layout to be set
-        */
-        void SetLayoutL( TUniLayout aNewLayout );
-
-        /**
-        * Returns the (estimate) total size of SMIL.
-        *
-        * @since    3.1
-        * @return   Total size in bytes
-        */
-        TInt SmilComposeSize();
-
-        /**
-        * SmilComposeSize
-        * Returns the (estimate) size of SMIL from beginning to the
-        * object given as parameter.
-        *
-        * @since    3.1
-        * @param    aToSlideNum     IN calculate till this slide
-        *                              (From "1" to "SlideCount")
-        * @param    aToObjectNum    IN calculate till this object
-        *                              (From "1" to "SlideObjectCount")
-        * @return   Size in bytes
-        */
-        TInt SmilComposeSize(
-            TInt aToSlideNum,
-            TInt aToObjectNum );
-
-        /**
-        * RemoveEmptySlides
-        * Removes empty all slides from the presentation
-        *
-        * @since    3.1
-        */
-        void RemoveEmptySlides();
-
-        /**
-        * ComposeL
-        * Composes new SMIL from current model content. SMIL is created as
-        * an attachment to message.
-        * Old SMIL should be deleted before calling this.
-        *
-        * @since    3.1
-        * return    Pointer to new DOM
-        */
-        CMDXMLDocument* ComposeL();
-
-        /**
-        * ChangeLayoutL
-        * Changes layout of SMIL to match Series 60 created SMIL
-        *
-        * @since 3.1
-        * @param aDom   SMIL DOM to be changed
-        * @return ETrue if layout could be changed
-        *         EFalse if layout couldn't be changed (e.g. missing head or root-region)
-        */
-        TBool ChangeLayoutL( CMDXMLDocument* aDom );
-
-        /**
-        * CorrectTimingL
-        * Correct timing of media objects on SMIL if it is invalid.
-        *
-        * @since  3.1
-        * @param  aDom   SMIL DOM
-        * @return ETrue if timing is valid.
-        *         EFalse if timing couldn't be corrected (e.g. missing body)
-        */
-        TBool CorrectTimingL( CMDXMLDocument* aDom );
-
-        /**
-        * Determines if given media type can be added to the SMIL model.
-        *
-        * @since 3.1
-        * @param aMediaType Tested media type
-        * @return ETrue if media type can be added to the SMIL model.
-        *         EFalse if media type cannot be added
-        */
-        TBool IsSupportedMediaType( TMsgMediaType aMediaType ) const;
-
-        /**
-        * Maximum number of slide in MMS message.
-        *
-        * @return 0 or less if not specified. Otherwise maximum slide limit.
-        */
-        inline TInt MaxSlideCount() const;
-
-        /**
-        * Sets maximum slide limit.
-        *
-        * @param aSlideCount Maximum slide count.
-        */
-        inline void SetMaxSlideCount( TInt aSlideCount );
-
-        /**
-        * Returns whether maximum slide count has been reached.
-        *
-        * @return ETrue if maximum slide count is set and has been reached.
-        *         EFalse otherwise.
-        */
-        inline TBool MaxSlideCountReached() const;
-
-    private:
-
-        /**
-        * Constructor.
-        *
-        * @since    3.1
-        * @param    aFs     IN reference to file session
-        * @param    aMtm    IN reference to client mtm
-        * @param    aData   IN reference to MsgData object
-        * @param    aObjectList IN reference to object list
-        */
-        CUniSmilModel(
-            RFs& aFs,
-            CBaseMtm& aMtm,
-            CUniDataUtils& aData,
-            CUniObjectList& aObjectList );
-
-        /**
-        * 2nd phase constructor.
-        *
-        * @since    3.1
-        */
-        void ConstructL();
-
-        /**
-        * DoPresentationFromDomL
-        * Makes a presentation (model content) from DOM.
-        *
-        * @since    3.1
-        * @return   ETrue, if created successfully,
-        *           EFalse, otherwise
-        */
-        void DoPresentationFromDomL( CMDXMLDocument* aDom );
-
-        /**
-        * IsMessageSlide
-        * Check if messages attachments fit into slide (no smil case)
-        *
-        * @since    3.1
-        * @return   ETrue, if all objects fit into slide,
-        *           EFalse, otherwise
-        */
-        TBool IsMessageSlide();
-
-        /**
-        * DoNoSmilOneSlide
-        * Makes presentation (max one slide) from object list. Message
-        * may contain SMIL, but when calling this function it should be
-        * clear that model cannot be made as SMIL describes.
-        *
-        * @since    3.1
-        */
-        void DoNoSmilOneSlideL();
-
-        /**
-        * DoNoSmilManySlide
-        * Makes presentation from object list. Message may contain SMIL,
-        * but when calling this function it should be clear that model cannot
-        * be made as SMIL describes.
-        *
-        * @since    3.1
-        */
-        void DoNoSmilManySlideL();
-
-        /**
-        * AddSlideFromDomL
-        * Used when creating presentation from SMIL
-        *
-        * @since    3.1
-        * @param    aSlideNum   IN slide number
-        * @param    aObj    IN object to be added
-        * @return   ETrue, object added successfully,
-        *           EFalse, otherwise
-        */
-        void AddSlideFromDomL( CMDXMLNode* aPage );
-
-        /**
-        * AddObjectFromDomL
-        * Used when creating presentation from SMIL
-        *
-        * @since    3.1
-        * @param    aSlideNum   IN slide number
-        * @param    aObj    IN object to be added
-        */
-        void AddObjectFromDomL(
-            CUniSmilSlide* aSlide,
-            CUniObject* aObj,
-            TUniRegion aRegion );
-
-        /**
-        * Reset
-        * Clears flag & empties slide & object arrays.
-        * NOTE: Mtm pointer is not reseted.
-        *
-        * @since    3.1
-        */
-        void Reset();
-
-        /**
-        * CreateItemL
-        * Sub function for ComposeL
-        *
-        * @since    3.1
-        * @param    aRoot   IN parent element for the new element(s)
-        * @param    aObj    IN object to be added
-        */
-        TInt CreateItemL( CMDXMLDocument* aDom, CMDXMLElement* aRoot, CUniObject* aObj );
-
-        /**
-        * CreateParL
-        * Sub function for ComposeL
-        *
-        * @since    3.1
-        * @param    aRoot   IN parent element for the new element(s)
-        * @param    aSlide  IN slide number
-        */
-        void CreateParL( CMDXMLDocument* aDom, CMDXMLElement* aRoot, TInt aSlide );
-
-        /**
-        * CreateBodyL
-        * Sub function for ComposeL
-        *
-        * @since    3.1
-        * @param    aRoot   IN parent element for the new element(s)
-        */
-        void CreateBodyL( CMDXMLDocument* aDom, CMDXMLElement* aRoot );
-
-        /**
-        * CreateLayoutL
-        * Sub function for ComposeL
-        *
-        * @since    3.1
-        * @param    aRoot        IN parent element for the new element(s)
-        * @param    aRootLayout  IN root-layout element
-        * @param    aLayout      IN layout element
-        * @param    aTextRegion  IN text region element
-        * @param    aImageRegion IN image region element
-        */
-        void CreateLayoutL(
-            CMDXMLDocument* aDom,
-            CMDXMLElement* aRoot,
-            CMDXMLElement* aRootLayout = NULL,
-            CMDXMLElement* aLayout = NULL,
-            CMDXMLElement* aTextRegion = NULL,
-            CMDXMLElement* aImageRegion = NULL );
-
-        /**
-        * CreateHeadL
-        * Sub function for ComposeL
-        *
-        * @since    3.1
-        * @param    aRoot   IN parent element for the new element(s)
-        */
-        void CreateHeadL( CMDXMLDocument* aDom, CMDXMLElement* aRoot );
-
-        /**
-        * DoRemoveObjectL
-        * Deletes object from slide and msg store if needed.
-        *
-        * @since    3.1
-        * @param    aSlideNum   IN slide number where text is added
-        * @param    aObjectType IN type of the object to be removed
-        */
-        void DoRemoveObjectL( TInt aSlideNum,
-                              CUniObject* aObject,
-                              TBool aLeaveToStore = EFalse );
-
-        /**
-        * Adds slide. Appends if slidenum greater than current max,
-        * otherwise inserts.
-        *
-        * @since    3.1
-        * @param    aSlideNum   IN insert position
-        */
-        CUniSmilSlide* DoAddSlideL( TInt aSlideNum = -1 );
-
-        /**
-        * SortSlidesCompare
-        * Compares slides according to time. Most recent is greatest.
-        * Empty slides are greater than non-empty slides.
-        *
-        * @since    3.1
-        * @param    aSlide1     IN slide to compare
-        * @param    aSlide2     IN slide to compare
-        * @return If aSlide1 "is greater than" aSlide2 returns positive value.
-        *         If aSlide1 "is smaller than" aSlide2 returns negative value.
-        *         If aSlide1 and aSlide2 "are equal" returns zero.
-        */
-        TInt SortSlidesCompare( CUniSmilSlide* aSlide1, CUniSmilSlide* aSlide2 );
-
-        /**
-        * Gets the layout of MMS SMIL document.
-        * Assumes that the document is valid MMS SMIL.
-
-        * @since 3.1
-        * @param    aDom    Root node of the document tree.
-        * @return           Layout of the document.
-        */
-        TUniLayout GetMmsSmilLayout( CMDXMLDocument* aDom );
-
-        /**
-        * Gets the first element of given name from the SMIL document.
-        *
-        * @since 3.1
-        * @param    aDom    Root node of the document tree.
-        * @param    aName   The name of the node to be searched.
-        * @return           Pointer to the element node.
-        *                   If element not found returns NULL.
-        */
-        CMDXMLNode* GetNode( CMDXMLDocument* aDom, const TDesC& aName );
-
-        void GetMediaElemRegionIDs( CMDXMLNode* aPage );
-
-        void GetAllMediaElemRegionIDs( CMDXMLNode* aPage );
-
-        void GetLayoutElements(
-            CMDXMLNode* aLayout,
-            CMDXMLElement*& aRlEle,
-            CMDXMLElement*& aTxtEle,
-            CMDXMLElement*& aImgEle );
-
-        void GetRootLayoutSize( CMDXMLElement* aRl, TSize& aSize );
-
-        void GetRegionRect( CMDXMLElement* aRegion, TSize aRoot, TRect& aRect );
-
-        TUniRegion GetRegionType( CMDXMLNode* aNodePtr );
-
-        void RemoveMetaTagsAndComments( CMDXMLDocument* aDom );
-
-        /**
-        * CorrectSlideTimingL
-        *
-        * @since    3.1
-        */
-        void CorrectSlideTimingL( CMDXMLElement* aPage );
-
-        /**
-        * TimingSpecified
-        *
-        * @since    3.1
-        */
-        TBool TimingSpecified( CMDXMLElement* aNodePrt );
-
-    private: // data
-
-        RFs&                iFs;
-        CBaseMtm&      iMtm;
-        CUniDataUtils&           iData;
-        CUniObjectList&     iObjectList;
-
-        TUniLayout iSlideLayout; // Defines order of objects in display for slides.
-
-        CSmilSlideArray*    iSlideArray;    // Holds slides
-        TInt                iParseResult;
-        CUniSmilParams*     iSmilParams;
-        TSize               iScreenSize;
-        TBool               iSizeEstimateUpToDate;
-        TInt                iSizeEstimate;
-
-        TPtrC               iTextRegionId;
-        TPtrC               iImageRegionId;
-        TInt                iMaxSlideCount;
-    };
-
-
-#include <UniSmilModel.inl>
-
-#endif // __UNISMILMODEL_H
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniSmilModel.inl	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +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: 
-*       CUniSmilModel, Storage for Smil presentation data.
-*
-*
-*/
-
-#include "debugtraces.h"
-
-// ---------------------------------------------------------
-// CUniSmilModel::Layout
-//
-// Accessor
-// ---------------------------------------------------------
-//
-inline TUniLayout CUniSmilModel::Layout() const
-    {
-    return iSlideLayout;    
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::SlideCount
-// ---------------------------------------------------------
-//
-inline TInt CUniSmilModel::SlideCount() const
-    {
-#ifdef _DEBUG_TRACES_
-    qCritical() << " CUniSmilModel SlideCount start";
-#endif
-    return iSlideArray->Count();
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::SetScreenSize
-// ---------------------------------------------------------
-//
-inline void CUniSmilModel::SetScreenSize( const TSize& aScreenSize )
-    {
-    iScreenSize = aScreenSize;
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::MaxSlideCount
-// ---------------------------------------------------------
-//
-inline TInt CUniSmilModel::MaxSlideCount() const
-    {
-    return iMaxSlideCount;
-    }
-        
-// ---------------------------------------------------------
-// CUniSmilModel::SetMaxSlideCount
-// ---------------------------------------------------------
-//
-inline void CUniSmilModel::SetMaxSlideCount( TInt aSlideCount )
-    {
-    iMaxSlideCount = aSlideCount;
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::MaxSlideCountReached
-// ---------------------------------------------------------
-//
-inline TBool CUniSmilModel::MaxSlideCountReached() const
-    {
-    if ( iMaxSlideCount > 0 &&
-         iSlideArray->Count() >= iMaxSlideCount )
-        {
-        return ETrue;
-        }
-    else
-        {
-        return EFalse;
-        }
-    }
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniSmilParams.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,245 +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: 
-*  Reads default parameters from resource file for composing MMS SMIL
-*
-*
-*/
-
-
-#ifndef __UNISMILPARAMS_H
-#define __UNISMILPARAMS_H
-
-//  INCLUDES
-#include <e32base.h>
-#include <barsc.h>
-#include <f32file.h>
-
-// FORWARD DECLARATIONS
-
-// CLASS DECLARATION
-
-/**
-*  TUniSmilComposeParam
-*  Class to hold general SMIL composing parameters
-*
-*  @lib     UniDataModel.lib
-*  @since   3.1
-*/
-class TUniSmilComposeParam
-    {
-public:
-    /**
-     *  Default constructor
-     */
-    inline TUniSmilComposeParam();
-
-    /**
-     *  Copy constructor
-     *  @param   aValues     Source region parameter object.
-     */
-    inline TUniSmilComposeParam(const TUniSmilComposeParam& aValues);
-
-public: // data
-    TInt iRootLayoutCompose;    // See r_root_layout_compose
-                                // explanation in rss file.
-
-    TInt iDisplayWidth;         // From resources
-    TInt iDisplayHeight;        // From resources
-
-    TBool iComposeXmlns;        // From resources
-    TInt iSlideDuration;        // From resources
-    TInt iTopPadding;           // From resources
-    TInt iRegionPadding;        // From resources
-    TInt iBottomPadding;        // From resources
-    };
-
-
-/**
-*  TUniSmilRegionParam
-*  Class to hold SMIL region attribute values.
-*  Only supports attributes mentioned in SMIL confomance document.
-*
-*  @lib     UniDataModel.lib
-*  @since   3.1
-*/
-
-class TUniSmilRegionParam
-    {
-public:
-    /**
-     *  Default constructor
-     */
-    inline TUniSmilRegionParam();
-
-    /**
-     *  Copy constructor
-     *  @param   aValues     Source region parameter object.
-     */
-    inline TUniSmilRegionParam(const TUniSmilRegionParam& aValues);
-
-    /**
-    *  destructor.
-    */
-    inline ~TUniSmilRegionParam();
-
-    /**
-    *  Get region width.
-    *  @return  Width of the region.
-    */
-    inline TInt Width();
-
-    /**
-    *  Get region height.
-    *  @return  Height of the region.
-    */
-    inline TInt Height();
-
-    /**
-    *  Get region top.
-    *  @return  Top co-ordinate of the region.
-    */
-    inline TInt Top();
-
-    /**
-    *  Get region left.
-    *  @return  Left co-ordinate of the region.
-    */
-    inline TInt Left();
-
-    /**
-    *  Set region size.
-    *  @param   aSize
-    */
-    inline void SetSize(const TSize& aSize);
-
-    /**
-    *  Set top left corner co-ordinates of the region.
-    *  @param   aTl     Top-Left corner co-ordinates of region.
-    */
-    inline void SetTopLeft(const TPoint& aTl);
-
-public: // Percent values
-    TInt    iTopPercent;
-    TInt    iLeftPercent;
-    TInt    iWidthPercent;
-    TInt    iHeightPercent;
-    HBufC   *iId;
-    HBufC   *iFit;
-    // Pixel values
-    TSize   iMaxSize;
-    TSize   iMinSize;
-    TSize   iSize;
-    TPoint  iTopLeft;
-
-private:
-
-    };
-
-
-/**
-*  CUniSmilParams
-*  Reads MMS SMIL composing default parameters from resources.
-*
-*  @lib     UniDataModel.lib
-*  @since   3.1
-*/
-class CUniSmilParams : public CBase
-    {
-public:  // Constructors and destructor
-
-    /**
-    *  Two-phased constructor.
-    *  @param   aSession     File system session handle to be used.
-    */
-    static CUniSmilParams* NewL( const RFs& aSession );
-
-    /**
-    *  Two-phased constructor with cleanup stack.
-    *  @param   aSession     File system session handle to be used.
-    */
-    static CUniSmilParams* NewLC( const RFs& aSession );
-
-    /**
-    *  Destructor.
-    */
-    virtual ~CUniSmilParams();
-
-public: // New functions
-
-protected:  // Functions from base classes
-
-
-private:
-
-    /**
-    *  By default Symbian OS constructor is private.
-    */
-    void ConstructL();
-
-    /**
-    *  C++ default constructor is private.
-    *  @param   aSession     File system session handle to be used.
-    */
-    CUniSmilParams( const RFs& aSession );
-
-    /**
-    *  Reads the region string and integer constants
-    *  from the resource file.
-    */
-    void ReadResourcesL();
-
-    /**
-    *  Opens the resource file for reading
-    *  @param   aResFile     Resource file handle to be used.
-    */
-    void OpenResourceFileL( RResourceFile& aResFile );
-
-    /**
-    *  Reads general composing params from the reousrce file.
-    *  @param   aResFile     Resource file handle to be used.
-    */
-    void ReadComposeParamResourcesL(
-            const RResourceFile& aResFile );
-
-    /**
-    *  Reads image region defaults from the resource file.
-    */
-    void ReadImageRegionResourcesL(
-            const RResourceFile& resourceFile );
-
-    /**
-    *  Reads text region defaults from the resource file.
-    *  @param   aResFile     Resource file handle to be used.
-    */
-    void ReadTextRegionResourcesL(
-            const RResourceFile& resourceFile );
-
-
-private:    // Data
-    const RFs&              iSession;
-
-public:    // Data
-    // General compose parameters
-    TUniSmilComposeParam    *iComposeParams;
-    TUniSmilRegionParam     *iImageRegionParams;
-    TUniSmilRegionParam     *iTextRegionParams;
-
-    };
-
-#include <UniSmilParams.inl>
-
-#endif // __UNISMILPARAMS_H
-
-// End of File
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniSmilParams.inl	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +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: 
-*  Reads default parameters for composing SMIL from resource file   
-*
-*
-*/
-
-
-// -----------------------------------------------------------------------------
-// TUniSmilComposeParam
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// TUniSmilComposeParam::TUniSmilComposeParam
-// -----------------------------------------------------------------------------
-inline TUniSmilComposeParam::TUniSmilComposeParam() :
-    iRootLayoutCompose( 0 ),
-    iDisplayWidth( 0 ),
-    iDisplayHeight( 0 ),
-    iComposeXmlns( EFalse ),
-    iSlideDuration( 0 ),
-    iTopPadding( 0 ),
-    iRegionPadding( 0 ),
-    iBottomPadding( 0 )
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// TUniSmilComposeParam::TUniSmilComposeParam
-// -----------------------------------------------------------------------------
-inline TUniSmilComposeParam::TUniSmilComposeParam( const TUniSmilComposeParam& aCopy ) :
-    iRootLayoutCompose( aCopy.iRootLayoutCompose ),
-    iDisplayWidth( aCopy.iDisplayWidth ),
-    iDisplayHeight( aCopy.iDisplayHeight ),
-    iComposeXmlns( aCopy.iComposeXmlns ),
-    iSlideDuration( aCopy.iSlideDuration ),
-    iTopPadding( aCopy.iTopPadding ),
-    iRegionPadding( aCopy.iRegionPadding ),
-    iBottomPadding( aCopy.iBottomPadding )
-    {
-    }
-
-
-// -----------------------------------------------------------------------------
-// TUniSmilRegionParam
-// -----------------------------------------------------------------------------
-
-// -----------------------------------------------------------------------------
-// TUniSmilRegionParam::TUniSmilRegionParam
-// -----------------------------------------------------------------------------
-inline TUniSmilRegionParam::TUniSmilRegionParam() :
-    iTopPercent( 0 ),
-    iLeftPercent( 0 ),
-    iWidthPercent( 0 ),
-    iHeightPercent( 0 ),
-    iId( 0 ),
-    iFit( 0 ),
-    iMaxSize( 0, 0 ),
-    iMinSize( 0, 0 ),
-    iSize( 0, 0 ),
-    iTopLeft( 0, 0 )
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// TUniSmilRegionParam::TUniSmilRegionParam
-// -----------------------------------------------------------------------------
-inline TUniSmilRegionParam::TUniSmilRegionParam(const TUniSmilRegionParam& aCopy) :
-    iTopPercent( aCopy.iTopPercent ),
-    iLeftPercent( aCopy.iLeftPercent ),
-    iWidthPercent( aCopy.iWidthPercent ),
-    iHeightPercent( aCopy.iHeightPercent ),
-    iMaxSize( aCopy.iMaxSize ),
-    iMinSize( aCopy.iMinSize ),
-    iSize( aCopy.iSize ),
-    iTopLeft( aCopy.iTopLeft )
-    {
-    iId = aCopy.iId->Alloc();
-    iFit = aCopy.iFit->Alloc();
-    }
-
-// -----------------------------------------------------------------------------
-// TUniSmilRegionParam::~TUniSmilRegionParam
-// -----------------------------------------------------------------------------
-inline TUniSmilRegionParam::~TUniSmilRegionParam()
-    {
-    delete iId;
-    delete iFit;
-    }
-
-// -----------------------------------------------------------------------------
-// TUniSmilRegionParam::Width
-// -----------------------------------------------------------------------------
-inline TInt TUniSmilRegionParam::Width()
-    {
-    return iSize.iWidth;
-    }
-
-// -----------------------------------------------------------------------------
-// TUniSmilRegionParam::Height
-// -----------------------------------------------------------------------------
-inline TInt TUniSmilRegionParam::Height()
-    {
-    return iSize.iHeight;
-    }
-
-// -----------------------------------------------------------------------------
-// TUniSmilRegionParam::Top
-// -----------------------------------------------------------------------------
-inline TInt TUniSmilRegionParam::Top()
-    {
-    return iTopLeft.iY;
-    }
-
-// -----------------------------------------------------------------------------
-// TUniSmilRegionParam::Left
-// -----------------------------------------------------------------------------
-inline TInt TUniSmilRegionParam::Left()
-    {
-    return iTopLeft.iX;
-    }
-
-// -----------------------------------------------------------------------------
-// TUniSmilRegionParam::SetSize
-// -----------------------------------------------------------------------------
-inline void TUniSmilRegionParam::SetSize(const TSize& aSize)
-    {
-    iSize = aSize;
-    }
-
-// -----------------------------------------------------------------------------
-// TUniSmilRegionParam::SetTopLeft
-// -----------------------------------------------------------------------------
-inline void TUniSmilRegionParam::SetTopLeft(const TPoint& aTl)
-    {
-    iTopLeft = aTl;
-    }
-
-// End of File
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniSmilSlide.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +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: 
-*       CUniSmilSlide
-*
-*
-*/
-
-
-#ifndef __UNISMILSLIDE_H
-#define __UNISMILSLIDE_H
-
-
-//  INCLUDES
-
-#include <MsgMedia.hrh>
-
-#include <UniModelConst.h>
-
-// CONSTANTS
-
-// MACROS
-
-// FORWARD DECLARATIONS
-class CUniObject;
-
-// DATA TYPES
-typedef CArrayPtrFlat<CUniObject> CSmilObjectArray;
-
-// FUNCTION PROTOTYPES
-
-
-
-// CLASS DECLARATION
-
-// NOTE: Since slide cannot have same object type twice unique key to object within
-//       slide is it object type ( EImage, EText, EAudio )
-//       Object can also be referenced by it's position in slide ( 0,1,2 )
-
-/**
-* CUniSmilSlide - Representation of a single slide in a SMIL presentation.
-*
-* @lib UniDataModel.lib
-* @since 3.1
-*/
-class CUniSmilSlide :public CBase
-    {
-    public:  // Constructors and destructor
-
-    /**
-    * Factory method
-    *
-    * @since    3.1
-    * @return   Pointer to instance in cleanup stack
-    */
-    static CUniSmilSlide* NewLC( TUniLayout aLayout );
-
-    /**
-    * Factory method
-    *
-    * @since    3.1
-    * @return   Pointer to instance
-    */
-    static CUniSmilSlide* NewL( TUniLayout aLayout );
-
-    /**
-    * Destructor.
-    *
-    * @since    3.1
-    */
-    ~CUniSmilSlide();
-
-    public: // New functions
-
-    /*
-    * AddObjectL
-    * Add object to slide in position specified by Layout.
-    * NOTE: Takes ownership of the aObject.
-    * NOTE: Leaves with KErrArgument if object cannot be added to slide
-    *
-    * @since    3.1
-    * @param    aObject IN object to be added
-    */
-    void AddObjectL( CUniObject* aObject );
-
-    /*
-    * AddObjectL
-    * Add object to slide in position specified by Layout.
-    * NOTE: Takes ownership of the aObject.
-    * NOTE: Leaves with KErrArgument if object cannot be added to slide
-    *
-    * @since    3.1
-    * @param    aObject IN object to be added
-    * @param    aregion IN region where object is in SMIL.
-    */
-    void AddObjectL( CUniObject* aObject, TUniRegion aRegion );
-
-    /**
-    * RemoveObject
-    * Removes object from slide
-    * NOTE: Object is not deleted.
-    *
-    * @since    3.1
-    * @param    aObject IN object to be removed
-    */
-    void RemoveObject( CUniObject* aObject );
-
-    /**
-    * GetObject
-    * Get object of given type from slide.
-    *
-    * @since    3.1
-    * @param    aObjType    IN object type
-    * @return   Pointer to object,
-    *           NULL, if object not found
-    */
-    CUniObject* GetObject( TUniRegion aRegion ) const;
-
-    /**
-    * GetObjectByIndex
-    * Get object at given index from slide.
-    *
-    * @since    3.1
-    * @param    aObjNum IN index to slides object array,
-    *                   0 (zero) is first object.
-    * @return   Pointer to object,
-    *           NULL, if object not found
-    */
-    CUniObject* GetObjectByIndex( TInt aObjNum ) const;
-
-    /**
-    * IsObject
-    * Checks if slide contains given object.
-    *
-    * @since    3.1
-    * @param    aObject IN object to be checked
-    * @return   ETrue slide contains the object,
-    *           EFalse, otherwise
-    */
-    TBool IsObject( CUniObject* aObject ) const;
-
-    /**
-    * IsObject
-    * Checks if slide has an object of given type
-    *
-    * @since    3.1
-    * @param    aObjType    IN object type
-    * @return   ETrue slide contains the object,
-    *           EFalse, otherwise
-    */
-    TBool IsObject( TUniRegion aRegion ) const;
-
-    /**
-    * ObjectCount
-    * Accessor
-    *
-    * @since    3.1
-    * @return   Number of objects in this slide
-    */
-    TInt ObjectCount() const;
-
-    /**
-    * UpdateLayoutL
-    * Update the layout of the slide
-    *
-    * @since    3.1
-    * @param    aNewLayout  IN new layout
-    */
-    void UpdateLayoutL( TUniLayout aNewLayout );
-
-    private:
-
-    /*
-    * Constructor
-    *
-    * @since    3.1
-    */
-    CUniSmilSlide( TUniLayout aLayout );
-
-    /*
-    * 2nd phase constructor
-    *
-    * @since    3.1
-    */
-    void ConstructL();
-
-    /**
-    * UpdateLayoutL
-    * Update the layout of the slide
-    *
-    * @since    3.1
-    */
-    void UpdateLayoutL();
-
-    private:
-
-    CSmilObjectArray*   iObjectArray;
-    TUniLayout          iLayout;
-
-    };
-
-#endif // __UNISMILSLIDE_H
-
-
-
-
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniSmilUtils.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,243 +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: 
-*       Static utility class for manipulating SMIL DOM
-*
-*
-*/
-
-
-#ifndef __UNISMILUTILS_H
-#define __UNISMILUTILS_H
-
-// ========== INCLUDE FILES ================================
-#include <gdi.h>
-
-#include <MsgMedia.hrh>
-
-#include <UniModelConst.h>
-
-// ========== CONSTANTS ====================================
-
-// SMIL ELEMENTS
-_LIT(KSMILWREleBody,        "body");
-_LIT(KSMILWREleHead,        "head");
-_LIT(KSMILWREleLayout,      "layout");
-_LIT(KSMILWRElePar,         "par");
-_LIT(KSMILWREleRegion,      "region");
-_LIT(KSMILWREleRoot_layout, "root-layout");
-_LIT(KSMILWREleSeq,         "seq");
-_LIT(KSMILWREleSmil,        "smil");
-_LIT(KSMILWREleMeta,        "meta");
-_LIT(KSMILWREleTrans,       "transition");
-
-// Media types
-_LIT(KSMILWREleAnimation,   "animation");
-_LIT(KSMILWREleAudio,       "audio");
-_LIT(KSMILWREleImg,         "img");
-_LIT(KSMILWREleRef,         "ref");
-_LIT(KSMILWREleText,        "text");
-_LIT(KSMILWREleTextstream,  "textstream");
-_LIT(KSMILWREleVideo,       "video");
-
-// SMIL PARAMS
-_LIT(KSMILWRParaId,         "id" );
-_LIT(KSMILWRParaName,       "name");
-_LIT(KSMILWRParaContent,    "content");
-_LIT(KSMILWRParaRegion,     "region");
-_LIT(KSMILWRParaBgColor,    "backgroundColor");
-_LIT(KSMILWRParaSrc,        "src");
-_LIT(KSMILWRParaFit,        "fit");
-_LIT(KSMILWRParaDur,        "dur");
-_LIT(KSMILWRParaType,       "type");      // Transition
-_LIT(KSMILWRParaSubType,    "subtype");   // Transition
-_LIT(KSMILWRParaTransIn,    "transIn" );
-_LIT(KSMILWRParaTransOut,   "transOut" );
-_LIT(KSMILWRParaBegin,      "begin" );
-_LIT(KSMILWRParaEnd,        "end" );
-
-// Text color mediaparam format:
-// <param name="foreground-color" value="#000000"/>
-_LIT ( KSMILWREleParam,     "param" );
-// _LIT ( KSMILWRParaName,      "name" );  Already defined
-_LIT ( KSMILWRParaValue,    "value" );
-
-// Region dimensions
-_LIT(KSMILWRParaWidth,      "width");
-_LIT(KSMILWRParaHeight,     "height");
-_LIT(KSMILWRParaTop,        "top");
-_LIT(KSMILWRParaLeft,       "left");
-_LIT(KSMILWRParaBottom,     "bottom");
-_LIT(KSMILWRParaRight,      "right");
-
-// Region ID's
-_LIT(KSMILWRRegIDImage,     "Image");
-_LIT(KSMILWRRegIDVideo,     "Video");
-_LIT(KSMILWRRegIDText,      "Text");
-
-// TEMPORARY - To recognise template
-_LIT(KSMILMetaSmilProfile,       "SMILProfile");
-_LIT(KSMILMetaSmilProfileValue,  "3GPP-SMIL-Rel-5");
-
-
-// ========== MACROS =======================================
-
-// ========== DATA TYPES ===================================
-
-// ========== FUNCTION PROTOTYPES ==========================
-
-// ========== FORWARD DECLARATIONS =========================
-class CMDXMLNode;
-class CMDXMLDocument;
-
-// ========== CLASS DECLARATION ============================
-
-/**
-* Static utility class for manipulating SMIL DOM
-*
-* @lib UniDataModel.lib
-* @since 3.1
-*/
-class UniSmilUtils
-    {
-
-    public:
-
-    /**
-    * StringToIntValue
-    * Convert a descriptor to TInt
-    *
-    * @since 3.1
-    * @param aString  IN: to be converted
-    * @param aDefault IN: default value to return if conversion fails
-    * @return converted value
-    */
-    static TInt StringToIntValue( const TDesC& aString, TInt aDefault );
-
-    /**
-    * IsMediaElem
-    * Checks if node is mediaobject
-    *
-    * @since 3.1
-    * @param aNodePtr  IN: node to check
-    * @return ETrue node is media objects, EFalse otherwise
-    */
-    static TBool IsMediaElem( CMDXMLNode *aNodePtr );
-
-    /**
-    * NextNode
-    * Finds the next node in DOM in order
-    * 1. Child nodes of the ref node first
-    * 2. Then siblings of the ref node
-    * 3. If ref node has no childs or siblings moves up to
-    *     parent node and continues there
-    * 4. Returns NULL at the end of the document.
-    *
-    * @since 3.1
-    * @param aRefNode  IN: current node
-    * @return next node in presentation
-    */
-    static CMDXMLNode* NextNode( CMDXMLNode* aRefNode );
-
-    /**
-    * RemoveChilds
-    * Removes all childs and childs of childs etc. from given node
-    *
-    * @since 3.1
-    * @param IN aParent, node whos childs are to be removed
-    */
-    static void RemoveChilds( CMDXMLNode* aParent );
-
-    /**
-    * MediaElemType
-    * Gets the media type of the object (text, img, video etc)
-    *
-    * @since 3.1
-    * @param IN aNodePtr, media object node
-    * @return mediatype. EMsgMediaUnknown if node is not media object.
-    */
-    static TMsgMediaType MediaElemType( CMDXMLNode* aNodePtr );
-
-    /**
-    * Gets the id value of the node.
-    *
-    * @since 3.1
-    * @param IN  aNodePtr, element
-    * @param OUT aId, id of the element if found, empty otherwise.
-    * @return KErrNone if found. KErrNotFound if element but no id,
-    *         KErrNotSupported if not element.
-    */
-    static TInt GetId( CMDXMLNode* aNodePtr, TPtrC& aId );
-
-    /**
-    * Gets the name and content of the metatag i.e. <meta name="x1" content="x2" />
-    *
-    * @since 3.1
-    * @param IN  aNodePtr, must be element
-    * @param OUT aName,  name of the metatag. Value is garbage if function
-    *                    returns KErrNotFound
-    * @param OUT aContent, content of the metatag. Value is garbage if function
-    *                    returns KErrNotFound
-    * @return KErrNone if both ok. KErrNotFound otherwise.
-    */
-    static TInt GetMetaTag(
-        CMDXMLNode* aNodePtr,
-        TPtrC& aName,
-        TPtrC& aContent );
-
-    /**
-    * Gets the region id i.e. region="xx" value of the node.
-    * Node must be media element node.
-    *
-    * @since 3.1
-    * @param IN  aNodePtr, media element
-    * @param OUT aId, regoin id of the element if found, empty otherwise.
-    * @return KErrNone if found. KErrNotSupported if not media element,
-    *         KErrNotFound if no region specified.
-    */
-    static TInt GetRegionId( CMDXMLNode* aNodePtr, TPtrC& aId );
-
-    /**
-    * Gets the location string from nodes src parameter.
-    *
-    * @since 3.1
-    * @param    aNodePtr, media element
-    * @return   value of the location string.
-    */
-    static TPtrC GetSrcL( CMDXMLNode* aNodePtr );
-
-    /**
-    * Gets SMIL type of the document.
-    * Tries to validate document according to conformance document requirements
-    * and SmilEditor template requirements.
-    *
-    * @since 3.1
-    * @param    aDom    Root node of the document tree.
-    * @return           Smil type of the document.
-    */
-    static TUniSmilType GetSmilTypeL( CMDXMLDocument* aDom );
-
-    /**
-    * Gets SMIL type of the document.
-    * Tries to validate document according to SmilEditor template requirements.
-    *
-    * @since 3.1
-    * @param    aDom    Root node of the document tree.
-    * @return           ETrue if document is template SMIL.
-    */
-    static TBool IsTemplateSmil( CMDXMLDocument* aDom );
-
-    };
-
-#endif // __UNISMILUTILS_H
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniTextObject.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,285 +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: 
-*       CUniTextObject, Storage for single text attachment in presentation.
-*
-*
-*/
-
-
-#ifndef __UNITEXTOBJECT_H
-#define __UNITEXTOBJECT_H
-
-// INCLUDES
-
-#include <e32std.h>
-#include <cmsvattachment.h>
-#include <UniObject.h>
-
-// CONSTANTS
-
-// MACROS
-
-// FORWARD DECLARATIONS
-class CUniMimeInfo;
-class CMsgTextInfo;
-class CBaseMtm;
-class CUniDataUtils;
-class CEikRichTextEditor;
-
-// DATA TYPES
-
-// FUNCTION PROTOTYPES
-
-// CLASS DECLARATION
-
-/**
-* CUniTextObject, Storage for single text attachment in presentation.
-*
-* @lib UniDataModel.lib
-* @since 3.1
-*/
-class CUniTextObject : public CUniObject
-    {
-    public:  // New methods
-
-        /**
-        * Factory method that creates this object
-        * from an attachment.
-        *
-        * @since    3.1
-        * @param    aMtm    IN reference to client mtm
-        * @param    aMedia  IN initialized media info object - takes ownership!
-        * @param    aManager        IN reference to attachment manager
-        * @param    aAttachmentId   IN id of the attachment from
-        *                           which to create the object
-        * @return   Pointer to instance in cleanup stack
-        */
-        static CUniTextObject* NewLC(
-            RFs& aFs,
-            CBaseMtm& aMtm,
-            CUniDataUtils& aData,
-            CMsgTextInfo* aMedia,
-            MMsvAttachmentManager& aManager,
-            CMsvAttachment& aAttachment );
-
-        /**
-        * Factory method that creates this object
-        * from an attachment.
-        *
-        * @since    3.1
-        * @param    aMtm    IN reference to client mtm
-        * @param    aMedia  IN initialized media info object - takes ownership!
-        * @param    aManager        IN reference to attachment manager
-        * @param    aAttachmentId   IN id of the attachment from
-        *                           which to create the object
-        * @return   Pointer to instance
-        */
-        static CUniTextObject* NewL(
-            RFs& aFs,
-            CBaseMtm& aMtm,
-            CUniDataUtils& aData,
-            CMsgTextInfo* aMedia,
-            MMsvAttachmentManager& aManager,
-            CMsvAttachment& aAttachment );
-
-        /**
-        * Factory method that creates this object
-        * from a file.
-        *
-        * @since    3.1
-        * @param    aData   IN reference to MsgData object
-        * @param    aMedia  IN initialized media info object - takes ownership!
-        * @return   Pointer to instance in cleanup stack
-        */
-        static CUniTextObject* NewLC(
-            RFs& aFs,
-            CBaseMtm& aMtm,
-            CUniDataUtils& aData,
-            CMsgTextInfo* aMedia );
-
-        /**
-        * Factory method that creates this object
-        * from a file.
-        *
-        * @since    3.1
-        * @param    aData   IN reference to MsgData object
-        * @param    aMedia  IN initialized media info object - takes ownership!
-        * @return   Pointer to instance
-        */
-        static CUniTextObject* NewL(
-            RFs& aFs,
-            CBaseMtm& aMtm,
-            CUniDataUtils& aData,
-            CMsgTextInfo* aMedia );
-
-        /**
-        * Factory method that creates this object
-        * from a text buffer.
-        *
-        * @since    3.1
-        * @param    aData   IN reference to MsgData object
-        * @param    aTextEditor IN text buffer from
-        *                       which to create the object
-        * @return   Pointer to instance in cleanup stack
-        */
-        static CUniTextObject* NewLC(
-            RFs& aFs,
-            CBaseMtm& aMtm,
-            CUniDataUtils& aData,
-            CEikRichTextEditor* aTextEditor );
-
-        /**
-        * Factory method that creates this object
-        * from a text buffer.
-        *
-        * @since    3.1
-        * @param    aData   IN reference to MsgData object
-        * @param    aTextEditor IN text buffer from
-        *                       which to create the object
-        * @return   Pointer to instance
-        */
-        static CUniTextObject* NewL(
-            RFs& aFs,
-            CBaseMtm& aMtm,
-            CUniDataUtils& aData,
-            CEikRichTextEditor* aTextEditor );
-
-        /**
-        * Destructor
-        *
-        * @since    3.1
-        */
-        virtual ~CUniTextObject();
-
-        /*
-        * Size
-        * Inherited from CUniObject
-        *
-        * @since    3.1
-        * @param    aWithoutHeaders IN if ETrue include MIME headers' sizes
-        *                           if EFalse count only file sizes
-        * @return   Size of the object in bytes
-        */
-        virtual TInt Size( TBool aWithoutHeaders = ETrue );
-
-        /*
-        * SynchronizeSize
-        * Count the accurate size of the text object if it would
-        * be saved as a file.
-        * Useful for UTF-8 text
-        *
-        *
-        * @since    3.1
-        * @return   Size of the object in bytes
-        */
-        TInt SynchronizeSize();
-
-        /*
-        * Text
-        *
-        * @since    3.1
-        * @return   Pointer to text editor.
-        */
-        inline CEikRichTextEditor* Text() const;
-
-        /*
-        * SetText
-        * Set text to save
-        *
-        * @since    3.1
-        * @param    aTextEditor     IN pointer to text editor
-        */
-        inline void SetText( CEikRichTextEditor* aTextEditor );
-
-    protected:
-
-        /**
-        * Constructor.
-        *
-        * @since    3.1
-        */
-        CUniTextObject(
-            RFs& aFs,
-            CBaseMtm& aMtm,
-            CUniDataUtils& aData,
-            CMsgTextInfo* aMedia );
-
-        /**
-        * 2nd phase constructor.
-        *
-        * @since    3.1
-        */
-        void ConstructL();
-
-        /**
-        * 2nd phase constructor.
-        *
-        * @since    3.1
-        * @param    aData   IN reference to MsgData object
-        * @param    aTextEditor IN text buffer from
-        *                       which to create the object
-        */
-        void ConstructFromTextL( CEikRichTextEditor* aTextEditor );
-
-        /**
-        * Create file name for the object
-        *
-        * @since    3.1
-        * @param    aBuffer IN text buffer from which to create file name
-        * @param    aFileName   OUT created file name (without path)
-        * @param    aData   IN reference to MsgData object
-        */
-        void CreateFileName( TFileName& aFileName );
-
-        void InitializeTextSaveL();
-        void CreateTextAttachmentL();
-        void WriteToFileL();
-
-        /**
-        * Save
-        * Inherited from CUniObject
-        */
-        virtual void Save(
-            MUniObjectSaveObserver& aObserver,
-            CMsvAttachment::TMsvAttachmentType aSaveType );
-
-        /**
-        * DoSaveL
-        * Inherited from CUniObject
-        */
-        virtual void DoSaveL();
-
-    protected: // data
-
-        enum TMsgTextObjectSaveState
-            {
-            ETextSavingIdle,
-            ETextCreatingAttachment,
-            ETextWritingToFile
-            };
-
-        CEikRichTextEditor* iTextEditor;
-        TInt iSyncCounter;
-        TInt iSyncSize;
-        TInt iSyncLength;
-        TInt iPrevLength;
-
-        TInt iTextSaveState;
-        RFile* iEditFile;
-    };
-
-#include <UniTextObject.inl>
-
-#endif // __UNITEXTOBJECT_H
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/UniTextObject.inl	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +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: 
-*       CUniTextObject, Storage for single text attachment in presentation. 
-*     
-*
-*/
-
-
-// ---------------------------------------------------------
-// CUniTextObject::Text
-// ---------------------------------------------------------
-//
-inline CEikRichTextEditor* CUniTextObject::Text() const
-    {
-    return iTextEditor;
-    }
-
-// ---------------------------------------------------------
-// CUniTextObject::SetText
-// ---------------------------------------------------------
-//
-inline void CUniTextObject::SetText( CEikRichTextEditor* aTextEditor )
-    {
-    iTextEditor = aTextEditor;
-    }
-
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/sessioneventhandler.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +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: MMS data model plugin.
- *
- */
- 
-#ifndef UNIMMSDATAPLUGIN_SH_H_
-#define UNIMMSDATAPLUGIN_SH_H_
-
-#include <QObject>
-#include <QThread>
-
-#include <msvapi.h>
-
-
-class SessionEventHandler : public QThread,
-public MMsvSessionObserver
-{
-    Q_OBJECT
-public:
-    SessionEventHandler(QThread* parent=0);
-    ~SessionEventHandler();
-
-public:
-
-    /**
-     * @see MMsvSessionObserver
-     */
-    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2,
-        TAny* aArg3);
-
-private:
-    void run();
-
-};
-
-#endif /* UNIMMSDATAPLUGIN_SH_H_ */
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/smilliterals.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,247 +0,0 @@
-/*
-* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 _SMILLITERALS_H
-#define _SMILLITERALS_H
-
-#include <e32def.h>
-
-//tags
-_LIT(KSmilTag,"smil");
-_LIT(KHeadTag,"head");
-_LIT(KBodyTag,"body");
-_LIT(KLayoutTag,"layout");
-_LIT(KRegionTag,"region");
-_LIT(KRootLayoutTag,"root-layout");
-_LIT(KSeqTag,"seq");
-_LIT(KParTag,"par");
-_LIT(KExclTag,"excl");
-_LIT(KImageTag,"img");
-_LIT(KAudioTag,"audio");
-_LIT(KVideoTag,"video");
-_LIT(KAnimationTag,"animation");
-_LIT(KRefTag,"ref");
-_LIT(KTextTag,"text");
-_LIT(KTextStreamTag,"textstream");
-_LIT(KSwitchTag,"switch");
-_LIT(KATag,"a");
-_LIT(KAreaTag,"area");
-_LIT(KAnchorTag,"anchor");
-_LIT(KTransitionTag,"transition");
-_LIT(KPrefetchTag,"prefetch");
-_LIT(KParamTag,"param");
-
-//attributes
-_LIT(KXmlnsAttr,"xmlns");
-_LIT(KXmlnsAttr2,"xmlns:");
-_LIT(KIdAttr,"id");
-_LIT(KRegionNameAttr,"regionName");
-_LIT(KRegionAttr,"region");
-_LIT(KAltAttr,"alt");
-_LIT(KDurAttr,"dur");
-_LIT(KRepeatCountAttr,"repeatCount");
-_LIT(KRepeatDurAttr,"repeatDur");
-_LIT(KRepeatAttr,"repeat");
-_LIT(KBeginAttr,"begin");
-_LIT(KEndAttr,"end");
-_LIT(KMinAttr,"min");
-_LIT(KMaxAttr,"max");
-_LIT(KEndsyncAttr,"endsync");
-_LIT(KFillAttr,"fill");
-_LIT(KSrcAttr,"src");
-_LIT(KTopAttr,"top");
-_LIT(KBottomAttr,"bottom");
-_LIT(KLeftAttr,"left");
-_LIT(KRightAttr,"right");
-_LIT(KWidthAttr,"width");
-_LIT(KHeightAttr,"height");
-_LIT(KZIndexAttr,"z-index");
-_LIT(KFitAttr,"fit");
-_LIT(KBackgroundColorAttr,"backgroundColor");
-_LIT(KBackgroundColor2Attr,"background-color");
-_LIT(KShowBackgroundAttr,"showBackground");
-_LIT(KHrefAttr,"href");
-_LIT(KAccesskeyAttr,"accesskey");
-_LIT(KActuateAttr,"actuate");
-_LIT(KTargetAttr,"target");
-_LIT(KTypeAttr,"type");
-_LIT(KTabindexAttr,"tabindex");
-_LIT(KSubtypeAttr,"subtype");
-_LIT(KTransInAttr,"transIn");
-_LIT(KTransOutAttr,"transOut");
-_LIT(KFadeColorAttr,"fadeColor");
-_LIT(KStartProgressAttr,"startProgress");
-_LIT(KEndProgressAttr,"endProgress");
-_LIT(KDirectionAttr,"direction");
-_LIT(KRestartAttr,"restart");
-_LIT(KSkipContentAttr,"skip-content");
-_LIT(KShapeAttr,"shape");
-_LIT(KCoordsAttr,"coords");
-_LIT(KClipBeginAttr,"clipBegin");
-_LIT(KClipBegin2Attr,"clip-begin");
-_LIT(KClipEndAttr,"clipEnd");
-_LIT(KClipEnd2Attr,"clip-end");
-_LIT(KNameAttr,"name");
-_LIT(KValueAttr,"value");
-//_LIT(KShowAttr, "show");
-//_LIT(KSourcePlaystateAttr, "sourceplaystate");
-
-//system test attributes
-_LIT(KSystemAttr,"system");
-_LIT(KSystemRequiredAttr,"systemRequired");
-_LIT(KSystemScreenSizeAttr,"systemScreenSize");
-_LIT(KSystemScreenDepthAttr,"systemScreenDepth");
-_LIT(KSystemCPUAttr, "systemCPU");
-_LIT(KSystemOperatingSystemAttr, "systemOperatingSystem");
-_LIT(KSystemComponentAttr, "systemComponent");
-//_LIT(KSystemContentTypeAttr, "systemContentType");
-
-
-//supported systemRequired URLs
-static const TText* const KSystemReqValue [] = {
-	//modules
-	_S("http://www.w3.org/2001/SMIL20/AccessKeyTiming"),
-	_S("http://www.w3.org/2001/SMIL20/BasicContentControl"),
-	_S("http://www.w3.org/2001/SMIL20/BasicInlineTiming"),
-	_S("http://www.w3.org/2001/SMIL20/BasicLayout"),
-	_S("http://www.w3.org/2001/SMIL20/BasicLinking"),
-	_S("http://www.w3.org/2001/SMIL20/BasicMedia"),
-	_S("http://www.w3.org/2001/SMIL20/BasicTimeContainers"),
-	_S("http://www.w3.org/2001/SMIL20/BasicTransitions"),
-	_S("http://www.w3.org/2001/SMIL20/EventTiming"),
-	_S("http://www.w3.org/2001/SMIL20/ExclTimeContainers"),
-	_S("http://www.w3.org/2001/SMIL20/LinkingAttributes"),
-	_S("http://www.w3.org/2001/SMIL20/MediaAccessibility"),
-	_S("http://www.w3.org/2001/SMIL20/MediaClipping"),
-	_S("http://www.w3.org/2001/SMIL20/MediaDescription"),
-	_S("http://www.w3.org/2001/SMIL20/MediaParam"),
-	_S("http://www.w3.org/2001/SMIL20/Metainformation"),
-	_S("http://www.w3.org/2001/SMIL20/MinMaxTiming"),
-	_S("http://www.w3.org/2001/SMIL20/MultiArcTiming"),
-	_S("http://www.w3.org/2001/SMIL20/PrefetchControl"),
-	_S("http://www.w3.org/2001/SMIL20/RepeatTiming"),
-	_S("http://www.w3.org/2001/SMIL20/RestartTiming"),
-	_S("http://www.w3.org/2001/SMIL20/SkipContentControl"),
-	_S("http://www.w3.org/2001/SMIL20/Structure"),
-	//other
-	_S("http://www.w3.org/2001/SMIL20/NestedTimeContainers"),
-	_S("http://www.w3.org/2001/SMIL20/DeprecatedFeatures"),
-
-	_S("http://www.w3.org/2001/SMIL20/HostLanguage"),	
-	_S("http://www.w3.org/2001/SMIL20/IntegrationSet"),	
-
-	//3gpp
-	_S("http://www.3gpp.org/SMIL20/PSS4/"),
-	_S("http://www.3gpp.org/SMIL20/PSS5/"),
-    _S("http://www.3gpp.org/SMIL20/PSS6/"),
-	_S("http://www.3gpp.org/SMIL20/PSS4"),
-	_S("http://www.3gpp.org/SMIL20/PSS5"),
-    _S("http://www.3gpp.org/SMIL20/PSS6"),
-	0 
-	};
-
-
-//attribute values
-_LIT(KIndefiniteVal,"indefinite");
-_LIT(KMediaVal,"media");
-_LIT(KHiddenVal,"hidden");
-_LIT(KFillVal,"fill");
-_LIT(KSliceVal,"slice");
-_LIT(KMeetVal,"meet");
-_LIT(KScrollVal,"scroll");
-_LIT(KNoneVal,"none");
-_LIT(KTransparentVal,"transparent");
-_LIT(KWhenActiveVal,"whenActive");
-_LIT(KAlwaysVal,"always");
-_LIT(KTransitionVal,"transition");
-_LIT(KFreezeVal,"freeze");
-_LIT(KHoldVal,"hold");
-_LIT(KRemoveVal,"remove");
-_LIT(KForwardVal,"forward");
-_LIT(KReverseVal,"reverse");
-_LIT(KFirstVal,"first");
-_LIT(KLastVal,"last");
-_LIT(KAllVal,"all");
-_LIT(KWhenNotActiveVal,"whenNotActive");
-_LIT(KNeverVal,"never");
-_LIT(KTrueVal,"true");
-_LIT(KFalseVal,"false");
-_LIT(KCircleVal,"circle");
-_LIT(KRectVal,"rect");
-_LIT(KPolyVal,"poly");
-_LIT(KOnLoadVal,"onLoad");
-_LIT(KOnRequestVal,"onRequest");
-
-_LIT(KContentTypeVal,"ContentType:");
-
-_LIT(KSmil2NS,"http://www.w3.org/2001/SMIL20/Language");
-
-
-// colors
-static const TText* const KColorNames [] = {
-	_S("black"),	
-	_S("silver"),	
-	_S("gray"),	
-	_S("white"),	
-	_S("maroon"),	
-	_S("red"),		
-	_S("purple"),	
-	_S("fuchsia"),	
-	_S("green"),	
-	_S("lime"),	
-	_S("olive"),	
-	_S("yellow"),	
-	_S("navy"),	
-	_S("blue"),	
-	_S("teal"),	
-	_S("aqua"),	
-	0
-	};
-
-//NOTE: TRgb constructor uses order 0x00bbggrr
-static const TUint KColorValues [] = {
-	0x000000,
-	0xc0c0c0,
-	0x808080,
-	0xffffff,
-	0x000080,
-	0x0000ff,
-	0x800080,
-	0xff00ff,
-	0x008000,
-	0x00ff00,
-	0x008080,
-	0x00ffff,
-	0x800000,
-	0xff0000,
-	0x808000,
-	0xffff00,
-	0
-	};
-
-#if defined (__WINS__) 
-_LIT(KCPUVal, "x86");
-#else
-_LIT(KCPUVal, "arm");
-#endif
-
-_LIT(KOSVal, "symbian");
-
-
-#endif
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/unimmsdataplugin.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,218 +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: MMS data model plugin.
- *
- */
-
-#ifndef UNIMMSDATAPLUGIN_H_
-#define UNIMMSDATAPLUGIN_H_
-
-#include <QObject>
-#include "unidatamodelplugininterface.h"
-
-class UniMMSDataPluginPrivate;
-
-/**
- * MMS data model plugin.
- * Implements the processing of an MMS message in Message Store.
- */
-class UniMMSDataPlugin : public QObject, public UniDataModelPluginInterface
-{
-Q_OBJECT 
-Q_INTERFACES(UniDataModelPluginInterface)
-
-public:
-    /**
-     * Constructor
-     */
-    UniMMSDataPlugin(QObject* parent = 0);
-
-    /**
-     * Destructor
-     */
-    ~UniMMSDataPlugin();
-    
-    /**
-     * Creates the new instance of the plugin
-     * @return plugin instance
-     */    
-    QObject* createInstance();
-
-    /**
-     * Sets the id of the message whose details needs to be extacted.
-     * @param TMsvId of the message.
-     */
-    int setMessageId(int messageId);
-
-    /** Reset the datamodel
-     * Resets the data model to be used again
-     */
-    void reset();
-
-    /**
-     * Get the body of the message
-     * @param aBodyText , a QString to hold the message body
-     */
-    void body(QString& aBodyText);
-
-    /**
-     * Size of the message
-     * @return message size
-     */
-    int messageSize();
-
-    /**
-     * List of the message To recipients 
-     * @param  mAddressList, list of all addresses in the message
-     */
-    void toRecipientList(ConvergedMessageAddressList& mAddressList);
-
-    /**
-     * List of the message CC recipients 
-     * @param  mAddressList, list of all addresses in the message
-     */
-    void ccRecipientList(ConvergedMessageAddressList& mAddressList);
-
-    /**
-     * List of the message  bCC recipients 
-     * @param  mAddressList, list of all addresses in the message
-     */
-    void bccRecipientList(ConvergedMessageAddressList& mAddressList);
-
-    /**
-     * The from address of a message
-     * @param messageAddress
-     */
-    void fromAddress(QString& messageAddress);
-
-    /**
-     * List of attachments in the message.
-     * @return the attachment list for the message.
-     */
-    UniMessageInfoList attachmentList();
-
-    /**
-     * Type of the message (SMS/MMS etc..)
-     * @return message type
-     */
-    QString messageType();
-
-    /**
-     * Priority of the message (low/medium/high)
-     * @return MsgPriority.
-     */
-    MsgPriority messagePriority();
-
-    /**
-     * Number of attachments with the message
-     * @return count of attachment
-     */
-    int attachmentCount();
-
-    /**
-     * To check if the message has attachments
-     * @return true/false
-     */
-    bool hasAttachment();
-
-    /**
-     * Number of objects asociated with a MMS message
-     * @return object count
-     */
-    int objectCount();
-
-    /**
-     * The MMS object list asociated with a MMS message
-     * @return object list 
-     */
-    UniMessageInfoList objectList();
-
-    /**
-     * Number of slides asociated with a MMS message
-     * @return slide count
-     */
-    int slideCount();
-
-    /**
-     * The content of a Slide in case of a MMS message
-     * @param list of messageinfo objects.
-     */
-    UniMessageInfoList slideContent(int slidenum);
-
-    /**
-     * Time stamp of the message when it was created/recieved.
-     * @param mesage time
-     */
-    QDateTime timeStamp();
-    
-    /**
-     * @see UniDataModelPluginInterface
-     */
-    void addObject( int aslideNum,UniMessageInfo* aInfo );
-
-    /**
-     * @see UniDataModelPluginInterface
-     */    
-    void addTextObject(int aSlideNum,QString aText );
-    
-    /**
-     * @see UniDataModelPluginInterface
-     */
-    void addSlide( int aSlideNum );
-    
-    /**
-     * @see UniDataModelPluginInterface
-     */
-    void composeSmil(CMsvStore& aEditStore);
-    
-    /**
-     * @see UniDataModelPluginInterface
-     */
-    void saveObjects();
-    
-    /**
-     * @see UniDataModelPluginInterface
-     */
-    TMsvAttachmentId getSmilAttachmentByIndex();
-
-    /**
-     * @see UniDataModelPluginInterface
-     */
-    void restore(CBaseMtm& mtm);
-
-    /**
-     * @see UniDataModelPluginInterface 
-     */
-    void addAttachment( UniMessageInfo* aInfo );
-    
-    /**
-     * @see UniDataModelPluginInterface 
-     */
-    void removeSlide(int aSlideNumber);
-	
-	/**
-     * @see UniDataModelPluginInterface 
-     */
-	QString subject();
-	
-	/**
-     * @see UniDataModelPluginInterface 
-     */	
-    CMsvSession* session();
-        
-private:
-    UniMMSDataPluginPrivate* d_ptr;
-};
-
-#endif /* UNIMMSDATAPLUGIN_H_ */
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/unimmsdataplugin_p.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,284 +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: MMS data model plugin.
- *
- */
-
-#ifndef UNIMMSDATAPLUGIN_P_H_
-#define UNIMMSDATAPLUGIN_P_H_
-
-//SYSTEM INCLUDE
-#include <f32file.h>  //for FileSession RFs
-#include <msvapi.h>
-#include <e32base.h>
-
-#include "unidatamodelplugininterface.h"
-#include "UniDataModel.h"
-
-//Forward Declaration
-class CMmsClientMtm;
-class CUniDataModel;
-class CMsvSession;
-class CClientMtmRegistry;
-class CMsgMediaInfo;
-class CMDXMLDocument;
-class CDRMHelper;
-class MMediaInfoObserver;
-class SessionEventHandler;
-
-/**
- * Symbian specific implementation of the uni SMS plugin
- */
-class UniMMSDataPluginPrivate : public MUniDataModelObserver,
-                                public MUniObjectSaveObserver,
-                                public MUniSmilComposeObserver,
-                                public MMediaInfoObserver
-{
-public:
-    /**
-     * Constructor
-     */
-    UniMMSDataPluginPrivate();
-
-    /**
-     * Destructor
-     */
-    ~UniMMSDataPluginPrivate();
-
-    /**
-     * Sets the id of the message whose details needs to be extacted.
-     * @param TMsvId of the message.
-     */
-    int setMessageId(int messageId);
-
-    /** Reset the datamodel
-     * Resets the data model to be used again
-     */
-    void reset();
-
-    /**
-     * Get the body of the message
-     * @param aBodyText , a QString to hold the message body
-     */
-    void body(QString& aBodyText);
-
-    /**
-     * Size of the message
-     * @return message size
-     */
-    int messageSize();
-
-    /**
-     * List of the message To recipients 
-     * @param  mAddressList, list of all addresses in the message
-     */
-    void toRecipientList(ConvergedMessageAddressList& mAddressList);
-
-    /**
-     * List of the message CC recipients 
-     * @param  mAddressList, list of all addresses in the message
-     */
-    void ccRecipientList(ConvergedMessageAddressList& mAddressList);
-
-    /**
-     * List of the message  bCC recipients 
-     * @param  mAddressList, list of all addresses in the message
-     */
-    void bccRecipientList(ConvergedMessageAddressList& mAddressList);
-
-    /**
-     * The from address of a message
-     * @param messageAddress
-     */
-    void fromAddress(QString& messageAddress);
-
-    /**
-     * List of attachments in the message.
-     * @return the attachment list for the message.
-     */
-    UniMessageInfoList attachmentList();
-
-    /**
-     * Type of the message (SMS/MMS etc..)
-     * @return message type
-     */
-    QString messageType();
-
-    /**
-     * Priority of the message (low/medium/high)
-     * @return MsgPriority.
-     */
-    MsgPriority messagePriority();
-
-    /**
-     * Number of attachments with the message
-     * @return count of attachment
-     */
-    int attachmentCount();
-
-    /**
-     * To check if the message has attachments
-     * @return true/false
-     */
-    bool hasAttachment();
-
-    /**
-     * Number of objects asociated with a MMS message
-     * @return object count
-     */
-    int objectCount();
-
-    /**
-     * The MMS object list asociated with a MMS message
-     * @return object list 
-     */
-    UniMessageInfoList objectList();
-
-    /**
-     * Number of slides asociated with a MMS message
-     * @return slide count
-     */
-    int slideCount();
-
-    /**
-     * The content of a Slide in case of a MMS message
-     * @param list of messageinfo objects.
-     */
-    UniMessageInfoList slideContent(TInt slidenum);
-
-    /**
-     * Time stamp of the message when it was created/recieved.
-     * @param mesage time
-     */
-    int timeStamp();
-
-    /**
-     * Add object into smil 
-     * @param slide number
-     * @param UniMessageInfo
-     */    
-    void addObjectL( int aslideNum,UniMessageInfo* aInfo );    
-
-    /**
-     * Add text object into smil 
-     * @param slide number
-     * @param text
-     */    
-    void addTextObjectL(int aSlideNum,QString aText );
-
-    /**
-     * Add slide into smil model 
-     * @param slide number
-     */
-    void addSlideL( int aSlideNum );
-
-    /**
-     * Compose smil attachment 
-     * @param CMsvStore
-     */
-    void composeSmilL(CMsvStore& aEditStore);
-
-    /**
-     * Save objects inside model 
-     */
-    void saveObjects();
-
-    /**
-     * get the smil attachment index 
-     * @return TMsvAttachmentId
-     */
-    TMsvAttachmentId getSmilAttachmentByIndex();
-
-    /**
-     * Restore the model for editing only 
-     * @param CBaseMtm
-     */
-    void restoreL(CBaseMtm& mtm);
-
-    /**
-     * Add attachment 
-     * @param UniMessageInfo
-     */
-    void addAttachmentL( UniMessageInfo* aInfo );
-
-    /**
-     * Remove slide from smil model 
-     * @param slide number
-     */
-    void removeSlide(int aSlideNumber);
-	
-	/**
-     * Subject of the message
-     * @QString subject
-     */
-	QString subject();
-	 
-	/**
-	 * Session with the Messaging server
-	 * @return CMsvSession*
-	 */
-    CMsvSession* session();
-
-public:
-
-    /**
-     * @see MUniObjectSaveObserver
-     */
-    void ObjectSaveReady( TInt aError );
-
-    /**
-     * @see MUniSmilComposeObserver
-     */
-    void SmilComposeEvent( TInt aError );
-
-    /**
-     * @see MMediaInfoObserver
-     */    
-    void MediaInfoParsed();
-
-    /**
-     * @see MUniDataModelObserver
-     */    
-    void RestoreReady(TInt aParseResult, TInt aError);
-
-private:
-    /**
-     *  Extracts the name and adress from the CMsvRecipientList
-     */
-    void extractNameAndAddress(const TDesC& aMsvAddress, TPtrC& aName,
-        TPtrC& aAddress);
-    void initL();
-
-    void setMessageIdL(int messageId);
-private:
-
-    CMsvSession* mSession;
-    CClientMtmRegistry* mMtmRegistry;
-
-    CUniDataModel *mUniDataModel;
-
-    RFs mfsSession;
-
-    TRequestStatus iStatus;
-    CMmsClientMtm* mMmsClient;
-    CMsgMediaInfo*    mInsertingMedia;
-    CEikRichTextEditor *iEditor;
-    CMDXMLDocument* iDom;
-    CDRMHelper *iDRMHelper;
-    TMsvId iMessageId;
-    TBool done;    
-    SessionEventHandler *iSessionHandler;
-};
-
-#endif /* UNIMMSDATAPLUGIN_P_H_ */
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/rom/unimmsdataplugin.iby	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +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 __UNI_MMS_DATA_PLUGIN_IBY__
-#define __UNI_MMS_DATA_PLUGIN_IBY__
-
-
-# this is the plugin stub for QT plugin
-file=ABI_DIR\UREL\unimmsdataplugin.dll               SHARED_LIB_DIR\unimmsdataplugin.dll
-data=\epoc32\data\z\resource\qt\plugins\messaging\datamodel\unimmsdataplugin.qtplugin     \resource\qt\plugins\messaging\datamodel\unimmsdataplugin.qtplugin
-
-// UniModel
-data=DATAZ_\RESOURCE_FILES_DIR\UniDataModel.rsc     RESOURCE_FILES_DIR\UniDataModel.rsc
-
-#endif // __UNI_MMS_DATA_PLUGIN_IBY__
-
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/ConformanceChecker.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,658 +0,0 @@
-/*
-* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 "ConformanceChecker.h"
-
-#include <gmxmldocument.h>
-#include <gmxmlelement.h>
-
-#include "smilliterals.h"
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-
-// -----------------------------------------------------------------------------
-// CConformanceChecker::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-
-CConformanceChecker* CConformanceChecker::NewL()
-    {
-    CConformanceChecker* self = new( ELeave ) CConformanceChecker;
-    return self;
-    }
-
-
-// Destructor
-CConformanceChecker::~CConformanceChecker()
-    {
-    }
-
-
-//
-// ----------------------------------------------------------
-// CConformanceChecker::Check(CMDXMLDocument* aXmldoc)
-//
-// Checks if the DOM tree's content is legacy content or not.
-// ----------------------------------------------------------
-//
-
-TBool CConformanceChecker::Check(CMDXMLDocument* aXmldoc, TMmsSmilVersion aVersion, TInt aFlags)
-	{
-	//Initializing the flags according to the CF document version
-	switch ( aVersion )
-		{
-		case EMmsSmil_v2_0:
-			iFlags = 0;
-			break;
-		case EMmsSmil_v3_0: //Not implemented yet
-			return EFalse;
-		default:
-			iFlags = 0;
-		}
-	//Combine the implicit flags  with the explicitly specified flags
-	iFlags=iFlags | aFlags;
-
-	if (!aXmldoc) return EFalse;
-
-	CMDXMLElement* root = aXmldoc->DocumentElement();
-	if (!root) return EFalse;
-
-	CMDXMLNode* smil = NULL;
-	CMDXMLNode* head = NULL;
-	CMDXMLNode* body = NULL;
-
-	CMDXMLNode* node = root->FirstChild();
-	while (node && node->NodeName() != KSmilTag)
-		{
-		node=node->NextSibling();
-		}
-
-	if ( node ) smil = node;
-	else return EFalse;
-
-	node = smil->FirstChild();
-	while (node && node->NodeType() != CMDXMLNode::EElementNode)
-		{
-		node = node->NextSibling();
-		}
-
-	if (node && node->NodeName() == KHeadTag)
-		{
-		head = node;
-		if (!CheckHeadStructure(head))
-			return EFalse;
-		//Going forward in the DOM to find next element
-		node = head->NextSibling();
-		while (node && node->NodeType() != CMDXMLNode::EElementNode)
-			{
-			node = node->NextSibling();
-			}
-		}
-	if (node && node->NodeName() == KBodyTag)
-		{
-		body = node;
-		if (!CheckBodyStructure(body))
-			return EFalse;
-		}
-	else if ( node ) return EFalse; //there is some other element (not head or body in the smil element)
-	//Checking the head content
-	if ( head )
-		{
-		node = head->FirstChild();
-		}
-	else
-		{
-		node = NULL;
-		}
-
-	while (node && node->NodeName() != KLayoutTag)
-		{
-		node = node->NextSibling();
-		}
-	//Checking the content of the layout
-	if (!CheckLayoutContent(node))
-		return EFalse;
-	//Checking the body content
-	if (!CheckBodyContent(body))
-		return EFalse;
-
-	return ETrue;
-	} //End of Check()
-
-//
-// ----------------------------------------------------------
-// CConformanceChecker::CheckHeadStructure(CMDXMLNode* aHead)
-//
-// Checks the structure of the head element: allowed to contain only layout and meta element
-// ----------------------------------------------------------
-//
-
-TBool CConformanceChecker::CheckHeadStructure(CMDXMLNode* aHead)
-	{
-	//Checking that the head has only layout and meta element
-	if (!aHead)
-		{
-		return ETrue;
-		}
-	CMDXMLNode* node = aHead->FirstChild();
-	while (node)
-		{
-		if (node->NodeType() == CMDXMLNode::EElementNode
-			&& node->NodeName() != KLayoutTag
-			&& node->NodeName() != KMetaTag)
-			{
-			return EFalse;
-			}
-		else
-			{
-			node = node->NextSibling();
-			}
-		}
-	return ETrue;
-	}
-
-//
-// ----------------------------------------------------------
-// CConformanceChecker::CheckBodyStructure(CMDXMLNode* aBody)
-//
-// Checks the structure of the body element: allowed to contain only par elements
-//											(one including seq element right after the body is allowed)
-// ----------------------------------------------------------
-//
-TBool CConformanceChecker::CheckBodyStructure(CMDXMLNode* aBody)
-	{
-	//Checking that the body has only par elements
-	if (!aBody)
-		{
-		return ETrue;
-		}
-	CMDXMLNode* node = aBody->FirstChild();
-	while (node && node->NodeType() != CMDXMLNode::EElementNode)
-		{
-		node = node->NextSibling();
-		}
-
-	//One seq element right after the body is allowed if EAllowSeqTag is set
-	if ((iFlags & EAllowSeqTag)!=0 && node && node->NodeName() == KSeqTag)
-		{
-		if (node->NextSibling())
-			{
-			return EFalse;
-			}
-		else
-			{
-			node = node->FirstChild();
-			}
-		}
-	while (node)
-		{
-		if (node->NodeType() == CMDXMLNode::EElementNode && node->NodeName() != KParTag)
-			{
-			return EFalse;
-			}
-		else
-			{
-			node = node->NextSibling();
-			}
-		}
-	return ETrue;
-	}
-
-//
-// ----------------------------------------------------------
-// CConformanceChecker::CheckLayoutContent(CMDXMLNode* aLayout)
-//
-// Checks the content of the layout element
-//			- root-layout and max. 2 region elements are allowed
-//			- checks the width/height values for root-layout (pixel is allowed)
-//			- checks the width/height/top/left values for region
-//			  if EAllowMixedRegionDimensions is not set no mixed pixel/percent allowed
-// ----------------------------------------------------------
-//
-
-TBool CConformanceChecker::CheckLayoutContent(CMDXMLNode* aLayout)
-	{
-	TInt rl_nr = 0;
-	TInt r_nr = 0;
-	if (!aLayout)
-		{
-		return ETrue;
-		}
-	CMDXMLNode* node = aLayout->FirstChild();
-	TBool foundImage = EFalse;
-	TBool foundText = EFalse;
-	while (node)
-		{
-		if (node->NodeType() == CMDXMLNode::EElementNode)
-			{
-			if (node->NodeName() == KRootLayoutTag)
-				{
-				if (++rl_nr > 1)
-					return EFalse;
-				//Check the attributes
-				CMDXMLElement* elem = static_cast<CMDXMLElement*>(node);
-				TInt n = elem->NumAttributes();
-				for (TInt i = 0; i < n; ++i)
-					{
-					TPtrC name, value;
-					elem->AttributeDetails(i,name,value);
-					if	( (iFlags & EAllowAllAttributes) == 0 &&
-						name != KWidthAttr && name != KHeightAttr )
-						{
-						return EFalse;
-						}
-					if (name == KWidthAttr || name == KHeightAttr)
-						{
-						TBool pixel = EFalse;  // WB!
-						TBool percent = EFalse;
-						if (!CheckMixedRegionAttribute(value,percent,pixel))
-							{
-							return EFalse;
-							}
-						}
-					}
-				}
-			else if (node->NodeName() == KRegionTag)
-				{
-				if (++r_nr > 2)
-					{
-					return EFalse;
-					}
-				//Check the attributes
-				TBool foundPixel = EFalse;
-				TBool foundPercent = EFalse;
-
-				CMDXMLElement* elem = static_cast<CMDXMLElement*>(node);
-				TInt n = elem->NumAttributes();
-				for (TInt i = 0; i < n; ++i)
-					{
-					TPtrC name, value;
-					elem->AttributeDetails(i,name,value);
-
-					if ((iFlags & EAllowAllAttributes) == 0 && name != KIdAttr
-						&& name != KWidthAttr && name != KHeightAttr
-						&& name != KFitAttr && name != KLeftAttr && name != KTopAttr)
-						{
-						return EFalse;
-						}
-					if ((iFlags & EAllowMixedRegionDimensions)==0 &&
-						(name == KWidthAttr || name == KHeightAttr
-						|| name == KTopAttr || name == KLeftAttr)
-						&& !CheckMixedRegionAttribute(value,foundPercent,foundPixel))
-						{
-						return EFalse;
-						}
-					if ((iFlags & EAllowAnyRegionNames)==0 && name == KIdAttr
-						&& !CheckRegionNames(value,foundImage,foundText))
-						{
-						return EFalse;
-						}
-
-					}//for
-				}
-			else
-				{
-				return EFalse;
-				}
-
-			}
-		node = node->NextSibling();
-		}//while
-	return ETrue;
-	}
-
-//
-// ----------------------------------------------------------
-// CConformanceChecker::CheckMixedRegionAttribute
-// Checks if the given value is ending with percent or pixel
-// and if this is conforming to the values of aPixel, aPercent.
-// Returns true - if the value is not mixed
-//		   false - if mixed
-// ----------------------------------------------------------
-//
-TBool CConformanceChecker::CheckMixedRegionAttribute(TDesC& aValue,
-													 TBool& aPercent, TBool& aPixel) const
-	{
-	TInt valueLength = aValue.Length();
-	TInt j = 0;
-	TBool success = ETrue;
-	while (j < valueLength && static_cast<TChar>(aValue[j]).IsDigit())
-		{
-		j++;
-		}
-	HBufC* ending = aValue.Right(valueLength-j).Alloc();
-	if (!ending)
-		{
-		success = EFalse;
-		}
-	else
-		{
-		TPtr endingPtr = ending -> Des();
-		endingPtr.LowerCase();
-		endingPtr.TrimRight();
-		if (endingPtr==KPercent)
-			{
-			aPercent = ETrue;
-			if (aPixel)
-				{
-				success = EFalse;
-				}
-			}
-		else if (endingPtr==KNullDesC || endingPtr==KPx)
-			{
-			aPixel = ETrue;
-			if (aPercent)
-				{
-				success = EFalse;
-				}
-			}
-		else
-			success = EFalse; //Cannot be other then pixel or percent
-		}
-	delete ending;
-	return success;
-	}
-
-
-//
-// ----------------------------------------------------------
-// CConformanceChecker::CheckRegionNames
-// Checks if the given value is exactly "Image" or "Text" and if it
-// is duplicated (checking the transmitted boolean parameters).
-// Returns true - if the value is "Image" or "Text" and it's not duplicated
-//		   false - otherwise
-// ----------------------------------------------------------
-//
-TBool CConformanceChecker::CheckRegionNames(TDesC& aValue,
-											TBool& aFoundImage, TBool& aFoundText) const
-{
-	if (aValue == KImage)
-		{
-		if (aFoundImage)
-			{
-			return EFalse;
-			}
-		else
-			{
-			aFoundImage = ETrue;
-			}
-		}
-	else if (aValue == KText)
-		{
-		if (aFoundText)
-			{
-			return EFalse;
-			}
-		else
-			{
-			aFoundText = ETrue;
-			}
-		}
-	else
-		{
-		return EFalse;
-		}
-	return ETrue;
-}
-
-//
-// ----------------------------------------------------------
-// CConformanceChecker::CheckBodyContent(CMDXMLNode* aBody)
-//
-// Checks the content of the body element
-// ----------------------------------------------------------
-//
-TBool CConformanceChecker::CheckBodyContent(CMDXMLNode* aBody)
-	{
-	if (!aBody)
-		{
-		return ETrue;
-		}
-	CMDXMLNode* node = aBody->FirstChild();
-	//One seq element right after the body is allowed if EAllowSeqTag is set
-	if ((iFlags & EAllowSeqTag)!=0 && node && node->NodeName() == KSeqTag)
-		{
-		node = node->FirstChild();
-		}
-	while (node)
-		{
-		if (node->NodeName() == KParTag)
-			{
-			//Checking the attributes of par element
-			//only dur is allowed, dur='indefinite' illegal
-			//checking dur is in ms
-			CMDXMLElement* elem = static_cast<CMDXMLElement*>(node);
-			if (elem->NumAttributes() > 1 && (iFlags & EAllowAllAttributes) == 0)
-				{
-				return EFalse;
-				}
-			for (TInt i = 0; i < elem->NumAttributes(); ++i)
-				{
-				TPtrC name, value;
-				elem->AttributeDetails(i,name,value);
-
-				if (name == KDurAttr && value == KIndefiniteVal)
-					{
-					return EFalse;
-					}
-				if ((iFlags & EAllowAllAttributes) == 0 && (name != KDurAttr ))
-					{
-					return EFalse;
-					}
-				if (name == KDurAttr && (iFlags & EAllowNonMilliseconds) == 0
-					&& !IsInMilliseconds(value))
-					{
-					return EFalse;
-					}
-
-				}
-			if (!CheckParContent(node))
-				return EFalse;
-			}
-		node = node->NextSibling();
-		}
-	return ETrue;
-	}
-
-
-//
-// ----------------------------------------------------------
-// CConformanceChecker::CheckParContent(CMDXMLNode* aPar)
-//
-// Checks the content of the par element
-// ----------------------------------------------------------
-//
-
-TBool CConformanceChecker::CheckParContent(CMDXMLNode* aPar)
-	{
-	if (!aPar)
-		{
-		return ETrue;
-		}
-	TBool hasImage=EFalse;
-	TBool hasText=EFalse;
-	TBool hasAudio=EFalse;
-	TBool hasRef=EFalse;
-	TBool hasVideo=EFalse;
-
-	RArray<TPtrC> regionNames;
-	CMDXMLNode* innernode = aPar->FirstChild();
-	TBool legacy = ETrue;
-	while (legacy && innernode)
-		{
-		if (innernode->NodeType() == CMDXMLNode::EElementNode)
-			{
-			//Checking one type of media per par element
-			if (innernode->NodeName() == KImageTag)
-				if (hasImage)
-					{
-					legacy = EFalse;
-					}
-				else
-					{
-					hasImage = ETrue;
-					}
-			else if (innernode->NodeName() == KTextTag)
-				if (hasText)
-					{
-					legacy = EFalse;
-					}
-				else
-					{
-					hasText = ETrue;
-					}
-			else if (innernode->NodeName() == KAudioTag)
-				if (hasAudio)
-					{
-					legacy = EFalse;
-					}
-				else
-					{
-					hasAudio = ETrue;
-					}
-			else if (innernode->NodeName() == KRefTag)
-				if (hasRef)
-					{
-					legacy = EFalse;
-					}
-				else
-					{
-					hasRef = ETrue;
-					}
-			else if (innernode->NodeName() == KVideoTag)
-				if ((iFlags & EAllowVideoTag) == 0)
-					{
-					legacy = EFalse;
-					}
-				else
-					{
-					if (hasVideo)
-						{
-						legacy = EFalse;
-						}
-					else
-						{
-						hasVideo=ETrue;
-						}
-					}
-			else legacy = EFalse; //No other elements are allowed then img,text, audio, ref, video
-				//Check attributes
-			CMDXMLElement* elem = static_cast<CMDXMLElement*>(innernode);
-			TInt n = elem->NumAttributes();
-			for (TInt i = 0; legacy && (i < n); ++i)
-				{
-				TPtrC name, value;
-				elem->AttributeDetails(i,name,value);
-				//Check one region is used only once per par element
-				if (name == KRegionAttr)
-					{
-					if ((iFlags & EAllowAnyRegionNames) == 0
-						&& value != KImage && value != KText)
-						{
-						legacy = EFalse;
-						}
-					TInt nr = regionNames.Count();
-					TInt j = 0;
-					while (j < nr && legacy)
-						{
-						if (regionNames[j]==value)
-							{
-							legacy = EFalse;
-							}
-						else
-							{
-							++j;
-							}
-						}
-					if (legacy)
-						{
-						regionNames.Append(value);
-						if (regionNames.Count()>2)
-							{
-							legacy = EFalse;
-							}
-						}
-
-					}
-				else if ((iFlags & EAllowAllAttributes) == 0 && name != KSrcAttr
-					&& name != KAltAttr && name != KBeginAttr && name != KEndAttr)
-					{
-					legacy = EFalse;
-					}
-					//checking the src attribute
-				if (name == KSrcAttr && (iFlags & EAllowNonUsAscii) == 0)
-					{
-					TInt valueLength=value.Length();
-					for (TInt i = 0; legacy && (i < valueLength); i++)
-						{
-						TInt v = value[i];
-						if (v < KUSAsciiMinCode || v > KUSAsciiMaxCode)
-							{
-							legacy = EFalse;
-							}
-						}
-					}
-				//checking begin and end in ms
-				if ((name == KBeginAttr || name == KEndAttr)
-					&& (iFlags & EAllowNonMilliseconds) == 0
-					&& !IsInMilliseconds(value))
-					{
-						legacy = EFalse;
-					}
-				}//for
-			}
-		innernode = innernode->NextSibling();
-		} //while
-    regionNames.Close();
-	return legacy;
-	}
-
-//
-// ----------------------------------------------------------
-// CConformanceChecker::IsInMilliseconds(TDesC aValue);
-//
-// Checks if  aValue is ending with 'ms'
-// ----------------------------------------------------------
-//
-
-TBool CConformanceChecker::IsInMilliseconds(TDesC& aValue) const
-	{
-	TBuf<2> ending;
-	TInt j = 0;
-	TInt n = aValue.Length();
-	TInt trimmedEndingLength = 2;
-	//Processing till all the white spaces are eliminated from the end
-	do
-	{
-	j+=2-trimmedEndingLength;
-	if (n>=j+2)
-		ending = aValue.Mid(n-2-j,2);
-	ending.TrimRight();
-	trimmedEndingLength = ending.Length();
-	}
-	while (trimmedEndingLength!=2 && n>j+2);
-	ending.LowerCase();
-	if (ending != KMs) return EFalse;
-	return ETrue;
-	}
-
-//  End of File
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/MsgAttachmentUtils.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +0,0 @@
-/*
-* 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: 
-*
-*/
-
-
-// ========== INCLUDE FILES ================================
-
-#include <txtetext.h>               // for CPlainText
-
-#include "MsgAttachmentUtils.h"
-
-// ========== EXTERNAL DATA STRUCTURES =====================
-
-// ========== EXTERNAL FUNCTION PROTOTYPES =================
-
-// ========== CONSTANTS ====================================
-
-// ========== MACROS =======================================
-
-// ========== LOCAL CONSTANTS AND MACROS ===================
-
-// ========== MODULE DATA STRUCTURES =======================
-
-// ========== LOCAL FUNCTION PROTOTYPES ====================
-
-// ========== LOCAL FUNCTIONS ==============================
-
-// ========== MEMBER FUNCTIONS =============================
-
-//----------------------------------------------------------------------------
-// from: TBool CImRecvConvert::IsIllegalChar(const TUint aChar)
-//----------------------------------------------------------------------------
-LOCAL_C TBool IsIllegalChar(const TUint aChar)
-    {
-    return (
-        aChar == '*'  ||
-        aChar == '\\' ||
-        aChar == '<'  ||
-        aChar == '>'  ||
-        aChar == ':'  ||
-        aChar == '.'  ||
-        aChar == '"'  ||
-        aChar == '/'  ||
-        aChar == '|'  ||
-        aChar == '?'  ||
-        aChar == CEditableText::EParagraphDelimiter  ||
-        aChar == CEditableText::ELineBreak  ||
-        aChar <  ' ' );
-    }
-
-// ---------------------------------------------------------
-// MsgAttachmentUtils::GetFileNameFromBuffer
-//
-//
-// ---------------------------------------------------------
-//
-void MsgAttachmentUtils::GetFileNameFromBuffer(
-    TFileName& aFileName,
-    const TDesC& aBuffer,
-    TInt aMaxLength,
-    const TDesC* aExt /*= NULL*/ )
-    {
-    if ( aExt != NULL )
-        {
-        aMaxLength -= aExt->Length();
-        }
-
-    TInt len = aBuffer.Length();
-    TInt max = Min( len, aMaxLength );
-
-//    __ASSERT_DEBUG( max > 0, Panic( EMsgZeroLength ) );
-
-    aFileName.Zero();
-
-    TInt cc = 0;
-    TUint ch;
-    TUint ch1 = 0;
-    TBool spaces = EFalse;
-    for ( TInt i = 0; i < len && cc < max; i++ )
-        {
-        ch = aBuffer[i];
-
-        // ignore spaces from beginning of the buffer until first
-        // non-space is encountered.
-        if ( !spaces && ch != ' ' )
-            {
-            spaces = ETrue;
-            }
-
-        if ( i > 0 )
-            {
-            ch1 = aBuffer[i - 1];
-            }
-
-        // strip illegal chars away.
-        // checks also if previous and current chars are '.'
-        if ( spaces && ! IsIllegalChar( ch ) )
-            {
-            if ( !( i > 0 && ch == '.' && ch1 == '.' ) )
-                {
-                aFileName.Append( ch );
-                cc++;
-                }
-            }
-        }
-
-    aFileName.Trim();
-
-    // If filename is empty at this point, do not append extension either.
-    // Instead, empty filename is returned so that caller can use whatever
-    // default s/he has for it.
-    if ( aFileName.Length() > 0 && aExt != NULL )
-        {
-        aFileName.Append( *aExt );
-        }
-    }
-
-// End of File
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/UniDataModel.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,621 +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: 
-*       Provides CUniDataModel class methods.
-*
-*
-*/
-
-
-
-// ========== INCLUDE FILES ================================
-
-#include "debugtraces.h"
-
-#include <eikenv.h>
-#include <eikdoc.h>
-
-#include <msvstd.h>                     // TMsvEntry
-#include <msvapi.h>
-#include <msvuids.h>                    // Msgs Uids
-#include <mtclbase.h>                   // CBaseMtm
-#include <mmsvattachmentmanager.h>
-#include <cmsvattachment.h>
-#include <cmsvmimeheaders.h>
-
-#include <bautils.h>
-
-/*
-#include <muiumsvuiserviceutilities.h>  //Disk space check
-#include <msgattachmentinfo.h>
-*/
-
-#include <gmxmldocument.h>
-#include <gmxmlnode.h>
-#include <gmxmlelement.h>
-
-// Features
-#include <featmgr.h>
-#include <bldvariant.hrh>
-
-// MsgMedia
-#include <MsgMediaResolver.h>
-#include <MsgMediaInfo.h>
-#include <MsgTextInfo.h>
-
-#include <MmsConformance.h>
-
-#include "UniDataModel.h"
-#include "UniSmilModel.h"
-
-#include "UniDataUtils.h"
-#include "UniModelConst.h"
-#include "UniObjectList.h"
-#include "UniSmilList.h"
-#include "UniObject.h"
-#include "UniTextObject.h"
-#include "UniMimeInfo.h"
-
-#include "UniSmilUtils.h"
-//#include "UniEditorLogging.h"
-//#include "messagingvariant.hrh"
-#include "MsgMimeTypes.h"
-#include <e32base.h>
-
-// ========== CONSTANTS ====================================
-
-// ---------------------------------------------------------
-// CUniDataModel::Constructor
-// ---------------------------------------------------------
-//
-CUniDataModel::CUniDataModel( RFs& aFs, CBaseMtm& aMtm ) :
-    iFs( aFs ),
-    iMtm( aMtm ),
-    iSmilModel( NULL ),
-    iDom( NULL )
-    {
-    }
-
-// ---------------------------------------------------------
-// CUniDataModel::NewL
-// ---------------------------------------------------------
-//
- CUniDataModel* CUniDataModel::NewL( RFs& aFs, CBaseMtm& aMtm )
-    {
-    CUniDataModel* self =  new ( ELeave ) CUniDataModel( aFs, aMtm );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------
-// CUniDataModel::ConstructL
-// ---------------------------------------------------------
-//
- void CUniDataModel::ConstructL()
-    {
-#ifdef _DEBUG_TRACES_
-    qCritical() << " CUniDataModel ConstructL start";
-#endif
-    iDataUtils = CUniDataUtils::NewL( iFs );
-    iObjectList = CUniObjectList::NewL( iMtm, *iDataUtils );
-    iAttachmentList = CUniObjectList::NewL( iMtm, *iDataUtils );
-    iSmilList = CUniSmilList::NewL( iMtm );
-    iSmilModel = CUniSmilModel::NewL( iFs, iMtm, *iDataUtils, *iObjectList );
-
-    iMediaResolver = CMsgMediaResolver::NewL();
-    iMediaResolver->SetCharacterSetRecognition( EFalse );
-
-    iMmsConformance = CMmsConformance::NewL();
-    iMmsConformance->CheckCharacterSet( EFalse );
-    
-#ifdef _DEBUG_TRACES_
-    qCritical() << " CUniDataModel ConstructL End";
-#endif
-    }
-
-// ---------------------------------------------------------
-// CUniDataModel::~CUniDataModel
-//
-// Destructor.
-// ---------------------------------------------------------
-//
- CUniDataModel::~CUniDataModel()
-    {
-    delete iMediaResolver;
-    delete iMmsConformance;
-    delete iSmilModel;
-    delete iObjectList;
-    delete iAttachmentList;
-    delete iSmilList;
-    delete iDataUtils;
-    delete iParser;
-    delete iDom;
-    }
-
-// ---------------------------------------------------------
-// CUniDataModel::RestoreL
-//
-// Initialise the model.
-// ---------------------------------------------------------
-//
- void CUniDataModel::RestoreL(
-        MUniDataModelObserver& aObserver,
-        TBool aRemoveCorrupted /*= ETrue*/,
-        TBool aAllowSmil /*= ETrue*/ )
-    {
-    iObserver = &aObserver;
-    iSmilType = ENoSmil;
-
-    if ( iMtm.Entry().HasStoreL() )
-    	{
-        FindAndHandleCorruptL( aRemoveCorrupted );
-
-        TBool readOnly = iMtm.Entry().Entry().ReadOnly();
-        CMsvStore* store = readOnly
-        	? iMtm.Entry().ReadStoreL()
-        	: iMtm.Entry().EditStoreL();
-        CleanupStack::PushL( store );
-        MMsvAttachmentManager& manager = store->AttachmentManagerL();
-        CMsvMimeHeaders* msvMime = CMsvMimeHeaders::NewLC();
-
-        iParseResult = 0;
-
-        iOrigAttachmentCount = manager.AttachmentCount();
-
-        for ( TInt i = 0; i < iOrigAttachmentCount ; i++ )
-            {
-            CMsvAttachment* attachment = manager.GetAttachmentInfoL( i );
-            CleanupStack::PushL( attachment );
-            msvMime->RestoreL( *attachment );
-
-            TBuf8<KMaxDataTypeLength> contentType;
-            contentType.Copy( msvMime->ContentType() );
-            contentType.Append( _L8("/") );
-            contentType.Append( msvMime->ContentSubType() );
-
-            // Put smil attas to own array, except if SendUi
-            if ( aAllowSmil &&
-                contentType.CompareF( KMsgMimeSmil ) == 0 )
-                {
-                iSmilList->AddSmilAttachmentL( manager, attachment->Id() );
-                CleanupStack::PopAndDestroy( attachment );
-                continue;
-                }
-
-            RFile readFile = manager.GetAttachmentFileL( i );
-            CleanupClosePushL( readFile );
-            CUniObject* newObj = CreateObjectFromAttachmentLC(
-                contentType,
-                readFile,
-                manager,
-                *attachment );
-
-            if ( newObj->Attachment() )
-                {
-                iAttachmentList->AddObjectL( newObj );
-                }
-            else
-                {
-                iObjectList->AddObjectL( newObj );
-                }
-
-            CleanupStack::Pop( newObj );
-            CleanupStack::PopAndDestroy( &readFile );
-            CleanupStack::PopAndDestroy( attachment );
-            } // for
-
-        CleanupStack::PopAndDestroy( msvMime );
-
-
-
-        //UNILOGGER_WRITE_TIMESTAMP("CUniDataModel::RestoreL commit start");
-
-
-        //UNILOGGER_WRITE_TIMESTAMP("CUniDataModel::RestoreL commit end");
-        CleanupStack::PopAndDestroy( store );
-
-        if ( iSmilList->Count() == 1 )
-            {
-            RFile smilFile = iDataUtils->GetAttachmentFileL( iMtm, iSmilList->GetSmilAttachmentByIndex( 0 ) );
-            iParser = CMDXMLParser::NewL( this );
-            iParser->ParseFile( smilFile );
-            if( !iObjWait.IsStarted() )
-                {
-                iObjWait.Start();
-                }
-            }
-        else
-            {
-            if ( iSmilList->Count() > 1 )
-                {
-                iSmilType = EMultipleSmil;
-                }
-            iParseResult = iSmilModel->ParseL( NULL ); // Try to create something anyway
-            
-            FinalizeRestoreL( KErrNone );
-            }
-    	}
-    else
-    	{
-        FinalizeRestoreL( KErrNone );
-    	}
-    }
-
-// ---------------------------------------------------------
-// CUniDataModel::AddAttachmentL
-// ---------------------------------------------------------
-//
- CUniObject* CUniDataModel::AddAttachmentL(
-        MUniObjectSaveObserver& aObserver,
-        CMsgMediaInfo* aMedia,
-        CMsvAttachment::TMsvAttachmentType aSaveType /*= CMsvAttachment::EMsvLinkedFile*/ )
-    {
-    CUniObject* obj = CUniObject::NewLC( iFs, iMtm, *iDataUtils, aMedia );
-
-    // Update attachment list
-    iAttachmentList->AddObjectL( obj );
-    obj->SetAttachment( ETrue );
-
-    CleanupStack::Pop( obj );
-    obj->Save( aObserver, aSaveType );
-
-    return obj;
-    }
-
-// ---------------------------------------------------------
-// CUniDataModel::AddStoredAttachmentL
-// ---------------------------------------------------------
-//
- CUniObject* CUniDataModel::AddStoredAttachmentL( TMsvAttachmentId aAttachmentId,
-                                                          CMsgMediaInfo* aMedia )
-    {
-    CMsvStore* store = iMtm.Entry().EditStoreL();
-    CleanupStack::PushL( store );
-
-    MMsvAttachmentManager& manager = store->AttachmentManagerL();
-    MMsvAttachmentManagerSync& managerSync = store->AttachmentManagerExtensionsL();
-    CMsvAttachment* attachment = manager.GetAttachmentInfoL( aAttachmentId );
-    CleanupStack::PushL( attachment );
-
-    CUniObject* obj = CUniObject::NewLC( iFs, iMtm, *iDataUtils, aMedia, manager, *attachment );
-
-    managerSync.ModifyAttachmentInfoL( attachment );
-    CleanupStack::Pop( 2, attachment ); //obj, attachment
-    CleanupStack::PushL( obj );
-    store->CommitL();
-
-    // Update attachment list
-    iAttachmentList->AddObjectL( obj );
-    obj->SetAttachment( ETrue );
-
-    CleanupStack::Pop( obj );
-    CleanupStack::PopAndDestroy( store );
-    return obj;
-    }
-
-// ---------------------------------------------------------
-// CUniDataModel::FinalizeMediaParse
-// ---------------------------------------------------------
-//
- void CUniDataModel::FinalizeMediaParse()
-    {
-    while ( iObjectToParse )
-        {
-        if ( !iObjWait.IsStarted() )
-            {
-            iObjWait.Start();
-            }
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniDataModel::MediaInfoParsed
-// ---------------------------------------------------------
-//
-void CUniDataModel::MediaInfoParsed()
-    {
-    if ( iObjectToParse->MediaInfo()->Corrupt() )
-        {
-        iObjectToParse->SetCorrupted( ETrue );
-        }
-    ParseNextObject();
-    if ( iObjWait.IsStarted() )
-        {
-        iObjWait.AsyncStop();
-        }
-  //  CActiveScheduler::Stop();
-    }
-
-// ---------------------------------------------------------
-// CUniDataModel::ParseNextObject
-// ---------------------------------------------------------
-//
-void CUniDataModel::ParseNextObject()
-    {
-    CUniObjectList* list = iObjectList;
-
-    while ( list )
-        {
-        for ( TInt i = 0; i < list->Count(); i++ )
-            {
-            iObjectToParse = list->GetByIndex( i );
-            if ( !iObjectToParse->MediaInfo()->Parsed() &&
-                 !iObjectToParse->MediaInfo()->ParseError() )
-                {
-                RFile file;
-                TRAPD( error, file = iDataUtils->GetAttachmentFileL( iMtm, iObjectToParse->AttachmentId() ) );
-
-                if ( error == KErrNone )
-                    {
-                    iObjectToParse->MediaInfo()->ParseInfoDetails( file, *( iMediaResolver->DRMHelper() ), *this );
-                   // CActiveScheduler::Start();
-                    file.Close();
-                    return;
-                    }
-                else
-                    {
-                    iObjectToParse->SetCorrupted( ETrue );
-                    file.Close();
-                    }
-                }
-            }
-        if ( list == iObjectList )
-            {
-            list = iAttachmentList;
-            }
-        else
-            {
-            list = NULL;
-            }
-        }
-   iObjectToParse = NULL;
-   }
-
-// ---------------------------------------------------------
-// CUniDataModel::ParseFileCompleteL
-// ---------------------------------------------------------
-//
-void CUniDataModel::ParseFileCompleteL()
-    {
-    TRAPD( err, DoParseFileCompleteL() );
-    FinalizeRestoreL( err );
-    }
-
-// ---------------------------------------------------------
-// CUniDataModel::DoParseFileCompleteL
-// ---------------------------------------------------------
-//
-void CUniDataModel::DoParseFileCompleteL()
-    {
-    iDom = iParser->DetachXMLDoc();
-    iSmilType = UniSmilUtils::GetSmilTypeL( iDom );
-    if ( iSmilType == ENoSmil )
-        {
-        iParseResult = iSmilModel->ParseL( NULL );
-        }
-    else if ( iSmilType == EMmsSmil )
-        {
-        TRAPD( err, ( iParseResult = iSmilModel->ParseL( iDom ) ) );
-        if ( err )
-            {
-            iSmilType = E3GPPSmil;
-            iParseResult = 0;
-            FindDomObjectRefCountsL();
-            }
-        }
-    else
-        {
-        FindDomObjectRefCountsL();
-        }
-    }
-
-
-// ---------------------------------------------------------
-// CUniDataModel::FinalizeRestoreL
-// ---------------------------------------------------------
-//
-void CUniDataModel::FinalizeRestoreL( TInt aError )
-    {
-    if ( !aError )
-        {
-        // Won't leave.
-        FindAttachmentsL();
-        }
-    iObserver->RestoreReady( iParseResult, aError );
-
-    ParseNextObject();
-    
-    if ( iObjWait.IsStarted() )
-        {
-        iObjWait.AsyncStop();
-        }
-    
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::FindAttachmentsL
-//
-//
-// ---------------------------------------------------------
-//
-void CUniDataModel::FindAttachmentsL()
-    {
-    for ( TInt i = iObjectList->Count(); --i >= 0; )
-        {
-        CUniObject* obj = iObjectList->GetByIndex( i );
-        if ( !obj->ReferenceCount() )
-            {
-            //don't remove from store -> cannot leave
-            iObjectList->RemoveObjectL( obj, EFalse );
-            iAttachmentList->AddObjectL( obj );
-            obj->SetAttachment( ETrue );
-            }
-        }
-    }
-
-// ---------------------------------------------------------
-// FindAndHandleCorruptL
-//
-// ---------------------------------------------------------
-void CUniDataModel::FindAndHandleCorruptL( TBool aRemoveCorrupted )
-    {
-    CMsvEntrySelection* corSel = FindCorruptLC();
-    iCorruptedCount = corSel->Count();
-
-    if ( iCorruptedCount > 0 )
-        {
-        if ( aRemoveCorrupted )
-            {
-            CMsvStore* store = iMtm.Entry().EditStoreL();
-            CleanupStack::PushL( store );
-            MMsvAttachmentManager& manager = store->AttachmentManagerL();
-            MMsvAttachmentManagerSync& managerSync = store->AttachmentManagerExtensionsL();
-
-            for (TInt i = iCorruptedCount; --i >= 0 ;)
-                {
-                // Editor tries to recover by deleting corrupted ones
-                // Note: This means that SMIL parsing will fail with ESmil_Missing_Objects.
-                //       and object order is not maintained. But better to do it this
-                //       way so that message can be opened.
-                TRAP_IGNORE ( managerSync.RemoveAttachmentL(
-                    CUniDataUtils::IndexPositionOfAttachmentL( manager, corSel->At( i ) ) ) );
-                }
-            store->CommitL();
-            CleanupStack::PopAndDestroy( store );
-            }
-        else
-            {
-            // In viewer case consider message corrupted and leave.
-            // Model not made viewer should exit.
-            User::Leave( KErrCorrupt );
-            }
-        }
-
-    CleanupStack::PopAndDestroy( corSel );
-    }
-
-// ---------------------------------------------------------
-// FindCorruptLC
-//
-// ---------------------------------------------------------
-CMsvEntrySelection* CUniDataModel::FindCorruptLC()
-    {
-    CMsvEntrySelection* corrupts = new(ELeave) CMsvEntrySelection();
-    CleanupStack::PushL( corrupts );
-
-    if ( iMtm.Entry().HasStoreL() )
-    	{
-        CMsvStore* store = iMtm.Entry().ReadStoreL();
-        CleanupStack::PushL( store );
-        MMsvAttachmentManager& manager = store->AttachmentManagerL();
-
-        TInt count = manager.AttachmentCount();
-        for( TInt i = count; --i >= 0; )
-            {
-            CMsvAttachment* atta = manager.GetAttachmentInfoL( i );
-            TMsvAttachmentId attaId = atta->Id();
-            delete atta;
-
-            RFile attaFile;
-            TRAPD( err, attaFile = manager.GetAttachmentFileL( attaId ) );
-            // if error, hardly no need to close
-            attaFile.Close();
-            if ( err )
-                {
-                corrupts->AppendL( attaId );
-                }
-            }
-
-        CleanupStack::PopAndDestroy( store );
-    	}
-    return corrupts;
-    }
-
-// ---------------------------------------------------------
-// CreateObjectFromAttachmentLC
-//
-// ---------------------------------------------------------
-CUniObject* CUniDataModel::CreateObjectFromAttachmentLC(
-                            const TPtrC8&               aMimeType,
-                            RFile&                      aFile,
-                            MMsvAttachmentManager&      aManager,
-                            CMsvAttachment&             aAttachment )
-    {
-    // Linked attachments are handles similarly as ordinary ones.
-    CUniObject* object = NULL;
-    CMsgMediaInfo* info = NULL;
-    if ( aMimeType.CompareF( KMsgMimeTextPlain ) == 0 )
-        {
-        TDataType mimeType( aMimeType );
-        info = iMediaResolver->CreateMediaInfoL( aFile, mimeType );
-        }
-    else
-        {
-        info = iMediaResolver->CreateMediaInfoL( aFile );
-        }
-
-    if ( info->MediaType() == EMsgMediaText ||
-         info->MediaType() == EMsgMediaXhtml )
-        {
-        object = CUniTextObject::NewLC(
-            iFs,
-            iMtm,
-            *iDataUtils,
-            static_cast< CMsgTextInfo* >( info ),
-            aManager,
-            aAttachment );
-        }
-    else
-        {
-        object = CUniObject::NewLC(
-            iFs,
-            iMtm,
-            *iDataUtils,
-            info,
-            aManager,
-            aAttachment );
-        }
-    // Media info is to be parsed asynchronously!
-
-    return object;
-    }
-
-// ---------------------------------------------------------
-// GetDomObjectRefCounts
-//
-// ---------------------------------------------------------
-void CUniDataModel::FindDomObjectRefCountsL()
-    {
-    CMDXMLNode* node = iDom->DocumentElement()->FirstChild();
-    CUniObject* obj = NULL;
-
-    while ( node )
-        {
-        if ( UniSmilUtils::IsMediaElem( node ) ) // Filtering of structural nodes.
-            {
-            obj = iObjectList->GetByNodeL( node );
-            if ( obj )
-                {
-                obj->SetReferenceCount( obj->ReferenceCount() + 1 );
-                }
-
-            }
-        node = UniSmilUtils::NextNode( node );
-        }
-
-    }
-
-//  End of File
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/UniDataUtils.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,250 +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: 
-*           Data utility class for UniEditor & MMS related editors and viewers
-*
-*
-*/
-
-
-// ========== INCLUDE FILES ================================
-
-#include <e32std.h>
-#include <e32base.h>
-#include <f32file.h>
-#include <data_caging_path_literals.hrh>
-
-#include <bautils.h>
-
-#include <mtclbase.h>
-#include <msvstore.h>
-#include <mmsvattachmentmanager.h>
-#include <cmsvattachment.h>
-#include <cmsvmimeheaders.h>
-
-#include <StringLoader.h>           // for StringLoader (load and foramt strings from resources)
-#include <CommonContentPolicy.h>
-
-#include <UniDataModel.rsg>           // Viewer/Editor Mimetype strings
-
-#include "UniModelConst.h"
-#include "UniDataUtils.h"
-#include "msgtextutils.h"
-#include "MsgMimeTypes.h"
-
-// ========== LOCAL CONSTANTS AND MACROS ===================
-
-const TInt KTextBufferMaxSize( 256 );   // Max size for string read from resources.
-                                        // NOTE: This is 256 unicode chars, too.
-
-// ========== MEMBER FUNCTIONS =============================
-
-
-// ---------------------------------------------------------
-// CUniDataUtils::NewL
-// ---------------------------------------------------------
-//
-CUniDataUtils* CUniDataUtils::NewL( RFs& aFs )
-    {
-    CUniDataUtils* data = new ( ELeave ) CUniDataUtils( aFs );
-    CleanupStack::PushL( data );
-    data->ConstructL();
-    CleanupStack::Pop( data );
-    return data;
-    }
-
-
-// ---------------------------------------------------------
-// CUniDataUtils::CUniDataUtils
-//
-// Constructor
-// ---------------------------------------------------------
-//
-CUniDataUtils::CUniDataUtils( RFs& aFs )
-    : iFs( aFs )
-    {
-    }
-
-
-// ---------------------------------------------------------
-// CUniDataUtils::ConstructL
-// ---------------------------------------------------------
-//
-void CUniDataUtils::ConstructL()
-    {
-    RegisterDataL();
-    iTextUtils = CMsgTextUtils::NewL( iFs );
-    }
-
-// ---------------------------------------------------------
-// CUniDataUtils::~CUniDataUtils
-//
-// Destructor.
-// ---------------------------------------------------------
-//
-CUniDataUtils::~CUniDataUtils()
-    {
-    delete iDefaultFileName;
-    delete iEmptyPageString;
-    delete iTextUtils;
-    }
-
-// ---------------------------------------------------------
-// CUniDataUtils::CharconvIdToMibIdL
-// ---------------------------------------------------------
-//
-TUint CUniDataUtils::CharconvIdToMibIdL( TUint aCharconvCharsetId )
-    {
-    return iTextUtils->CharconvIdToMibIdL( aCharconvCharsetId );
-    }
-
-// ---------------------------------------------------------
-// CUniDataUtils::MibIdToCharconvIdL
-// ---------------------------------------------------------
-//
-TUint CUniDataUtils::MibIdToCharconvIdL( TUint aMibId )
-    {
-    return iTextUtils->MibIdToCharconvIdL( aMibId );
-    }
-
-// ---------------------------------------------------------
-// CUniDataUtils::UTF8Size
-// ---------------------------------------------------------
-TInt CUniDataUtils::UTF8Size( TPtrC aText )
-    {
-    return CMsgTextUtils::UTF8Size( aText );
-    }
-
-// ---------------------------------------------------------
-// CUniDataUtils::RegisterDataL
-//
-// Registers data
-// ---------------------------------------------------------
-//
-void CUniDataUtils::RegisterDataL()
-    {
-    TFileName fileName;
-    TParse parse;
-    parse.Set( KUniDataModelResourceFilename, &KDC_RESOURCE_FILES_DIR, NULL );
-    fileName = parse.FullName();
-
-    BaflUtils::NearestLanguageFile( iFs, fileName );
-
-    RResourceFile resourceFile;
-    resourceFile.OpenL( const_cast<RFs&>( iFs ), fileName );
-    resourceFile.ConfirmSignatureL( KDefResFileSignature );
-    CleanupClosePushL( resourceFile );
-
-    iDefaultFileName = ReadResStringL( resourceFile, R_MMDU_DEFAULT_FILE_NAME );
-    iEmptyPageString = ReadResStringL( resourceFile, R_MMDU_EMPTY_SLIDE );
-
-    CleanupStack::PopAndDestroy( &resourceFile );
-    }
-
-
-// ---------------------------------------------------------
-// CUniDataUtils::ReadResStringL
-//
-// Read single string.
-// ---------------------------------------------------------
-//
-HBufC* CUniDataUtils::ReadResStringL( const RResourceFile& aResourceFile, TInt aSrcResId )
-    {
-    HBufC* readBuf = HBufC::NewLC( KTextBufferMaxSize );
-    TPtr8 readBuffer( (TText8*) readBuf->Ptr(), KTextBufferMaxSize * 2 );
-    aResourceFile.ReadL(readBuffer, (0x00000fff & aSrcResId) ); // Remove offset from id
-
-    if ( readBuffer.Length() != 0 )
-        {
-        readBuf->Des().SetLength((readBuffer.Length()+1)>>1);
-        }
-
-    CleanupStack::Pop( readBuf );
-    return readBuf;
-    }
-
-// ---------------------------------------------------------
-// FileSizeL
-// ---------------------------------------------------------
-TInt CUniDataUtils::FileSizeL( const TFileName& aFileName )
-    {
-    TInt size(0);
-    RFile file;
-
-    TInt err = file.Open( iFs, aFileName, EFileShareAny );
-    if ( err == KErrAccessDenied || err == KErrInUse )
-        {
-        err = file.Open( iFs, aFileName, EFileShareReadersOnly );
-        }
-    if ( err == KErrNone )
-        {
-        file.Size( size );
-        }
-    else
-        {
-        file.Close();
-        User::Leave( err );
-        }
-
-    file.Close();
-    return size;
-    }
-
-// ---------------------------------------------------------
-// CUniObject::GetAttachmentFileL
-// ---------------------------------------------------------
-//
-RFile CUniDataUtils::GetAttachmentFileL( CBaseMtm& aMtm, TMsvAttachmentId aId )
-    {
-    RFile file;
-    CMsvStore* store = aMtm.Entry().ReadStoreL();
-    CleanupStack::PushL( store );
-    MMsvAttachmentManager& manager = store->AttachmentManagerL();
-    file = manager.GetAttachmentFileL( aId );
-    CleanupStack::PopAndDestroy( store );
-
-    return file;
-    }
-
-// ---------------------------------------------------------
-// CUniObject::IndexPositionOfAttachmentL
-// ---------------------------------------------------------
-//
-TInt CUniDataUtils::IndexPositionOfAttachmentL(
-        MMsvAttachmentManager& aManager,
-        TMsvAttachmentId aId )
-	{
-    TInt count = aManager.AttachmentCount();
-	TInt foundPosition = KErrNotFound;
-
-    for ( TInt i = 0; i < count; i++ )
-        {
-        CMsvAttachment* attachment = aManager.GetAttachmentInfoL( i );
-        TMsvAttachmentId id = attachment->Id();
-        delete attachment;
-        if ( id == aId )
-            {
-            foundPosition = i;
-            break;
-            }
-        }
-
-	// Leave with KErrNotFound if the attachment id is not found
-	User::LeaveIfError( foundPosition );
-
-	// return the index position of attachment
-	return foundPosition;
-	}
-
-//  End of File
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/UniDrmInfo.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,599 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*       CUniDrmInfo, Storage for single attachment in presentation.
-*
-*
-*/
-
-
-// ========== INCLUDE FILES ================================
-
-#include <e32def.h>     // for basic types
-#include <eikenv.h>     // for CBase
-#include <coemain.h>    // for CEikonEnv
-#include <mtclbase.h>   // for CBaseMtm
-#include <msvids.h>     // for KMsvTempIndexEntryId
-#include <msvstore.h>
-#include <mmsvattachmentmanager.h>
-#include <mmsvattachmentmanagersync.h>
-#include <cmsvattachment.h>
-
-// Features
-#include <featmgr.h>
-#include <bldvariant.hrh>
-
-// DRM
-#ifndef DRMCOMMONIN_POISTO
-#include <DRMCommon.h>
-#endif
-
-#include <DRMHelper.h>
-
-#include <MsgMediaInfo.h>
-#include <MsgTextInfo.h>
-
-#include "UniModelConst.h"
-#include "UniMimeInfo.h"
-#include "UniDrmInfo.h"
-#include "UniObject.h"
-#include "UniDataUtils.h"
-
-//#include "UniEditorLogging.h"
-#include "fileprotectionresolver.h"
-#include "MsgMimeTypes.h"
-
-// ========== EXTERNAL DATA STRUCTURES =====================
-
-// ========== EXTERNAL FUNCTION PROTOTYPES =================
-
-// ========== CONSTANTS ====================================
-
-// ========== MACROS =======================================
-
-// ========== LOCAL CONSTANTS AND MACROS ===================
-
-// ========== MODULE DATA STRUCTURES =======================
-
-
-// ========== LOCAL FUNCTION PROTOTYPES ====================
-
-// ========== LOCAL FUNCTIONS ==============================
-
-// ========== MEMBER FUNCTIONS =============================
-
-// ---------------------------------------------------------
-// CUniDrmInfo::NewLC
-//
-// Factory method.
-// ---------------------------------------------------------
-//
-CUniDrmInfo* CUniDrmInfo::NewLC( RFs& aFs,
-                                          CBaseMtm& aMtm,
-                                          TMsvAttachmentId& aId,
-                                          CMsgMediaInfo& aMediaInfo )
-    {
-    CUniDrmInfo* self =  new ( ELeave ) CUniDrmInfo( aFs, aMtm, aId, aMediaInfo );
-
-    CleanupStack::PushL( self );
-    self->ConstructL();
-
-    return self;
-    }
-
-// ---------------------------------------------------------
-// CUniDrmInfo::NewL
-//
-// Factory method.
-// ---------------------------------------------------------
-//
-CUniDrmInfo* CUniDrmInfo::NewL( RFs& aFs,
-                                         CBaseMtm& aMtm,
-                                         TMsvAttachmentId& aId,
-                                         CMsgMediaInfo& aMediaInfo )
-    {
-    CUniDrmInfo* self = NewLC( aFs, aMtm, aId, aMediaInfo );
-    CleanupStack::Pop( self );
-
-    return self;
-    }
-
-// ---------------------------------------------------------
-// CUniDrmInfo::CUniDrmInfo
-//
-// Constructor.
-// ---------------------------------------------------------
-//
-CUniDrmInfo::CUniDrmInfo( RFs& aFs,
-                          CBaseMtm& aMtm,
-                          TMsvAttachmentId& aId,
-                          CMsgMediaInfo& aMediaInfo ) :
-    iFs( aFs ),
-    iMtm( aMtm ),
-    iAttachmentId( aId ),
-    iMediaInfo( aMediaInfo ),
-    iDRMConsumeStatus( EUniDRMNone ),
-    iDRMConsumeCount( 0 ),
-    iDRMRightsExist( ETrue ), //Rights ok by default
-    iDRMExpiration( CDRMRights::EValidRights ),
-    iDRMRestriction( CDRMRights::EFullRights ),
-    iDRMConstraintType( CDRMRights::ENoConstraints )
-    {
-    }
-
-// ---------------------------------------------------------
-// CUniDrmInfo::CUniDrmInfo
-//
-// Destructor.
-// ---------------------------------------------------------
-//
-CUniDrmInfo::~CUniDrmInfo()
-    {
-    ReleaseRights();
-    delete iDRMHelper;
-
-#ifdef DRMCOMMONIN_POISTO
-    delete iRightsManager;
-#else
-    delete iDRMCommon;
-#endif
-
-    delete iSendContentUrl;
-    }
-
-// ---------------------------------------------------------
-// CUniDrmInfo::ConstructL
-//
-// 2nd phase constructor.
-// ---------------------------------------------------------
-//
-void CUniDrmInfo::ConstructL()
-    {
-    if ( !iMediaInfo.DRMContentURI()->Length() )
-        {
-        User::Leave( KErrNotSupported );
-        }
-
-    // Get supported features from feature manager.
-/*
-    FeatureManager::InitializeLibL();
-    if ( FeatureManager::FeatureSupported( KFeatureIdDrmFull ) )
-        {
-        iSupportedFeatures |= EUniFeatureDrmFull;
-        }
-    FeatureManager::UnInitializeLib();
-*/
-
-#ifdef DRMCOMMONIN_POISTO
-
-    // Seems pretty heavy. Should be done only once by e.g. Document
-    // and a reference should be passed as an input parameter?
-    CManager* manager = CManager::NewLC();
-
-    RArray<TAgent> agents;
-    manager->ListAgentsL( agents );
-    CleanupClosePushL( agents );
-
-    for ( TInt i = 0; !iRightsManager && i < agents.Count(); i++ )
-        {
-        if ( agents[ i ].Name().Compare( KOmaDrm2AgentName ) == 0 )
-            {
-            iRightsManager = manager->CreateRightsManagerL( agents[ i ] );
-            }
-        }
-
-    CleanupStack::PopAndDestroy( 2, manager ); // agents, manager
-
-    if ( !iRightsManager )
-        {
-        User::Leave( KErrNotFound );
-        }
-
-#else // DRMCOMMONIN_POISTO
-
-    iDRMCommon = DRMCommon::NewL();
-
-#endif // DRMCOMMONIN_POISTO
-
-    iDRMHelper = CDRMHelper::NewL( *CEikonEnv::Static( ), iFs );
-    DoGetRightsInfoL();
-
-    // Check it here that image count is rights.
-    // When image is displayed, use count is already decremented.
-    SetIsDrmWithOnePreviewL();
-
-    TInt drmMethods;
-    CDRMHelper::TDRMHelperOMALevel omaLevel;
-    iDRMHelper->SupportedDRMMethods2( drmMethods, omaLevel );
-    iOma2 = ( omaLevel == CDRMHelper::EOMA_2_0 ? ETrue : EFalse );
-    }
-
-// ---------------------------------------------------------
-// CUniDrmInfo::DoGetRightsInfoL
-// ---------------------------------------------------------
-//
-void CUniDrmInfo::DoGetRightsInfoL( CDRMRights** aRightsObj )
-    {
-/*
-    if ( iSupportedFeatures & EUniFeatureDrmFull )
-        {
-        CDRMRights* rightsObj = NULL;
-        TInt rightSpec = ConsumeIntent();
-
-#ifdef DRMCOMMONIN_POISTO
-
-        MAgentRightsBase* cafRights = NULL;
-        RStreamablePtrArray<CRightsInfo> rights;
-
-        // Copy to 16-bit buffer
-        // TODO: Is this really the correct parameter to give to ListRightsL?!
-        HBufC* temp = HBufC::NewLC( iMediaInfo.DRMContentURI()->Length() );
-        TPtr ptr = temp->Des();
-        ptr.Copy( *iMediaInfo.DRMContentURI() );
-
-        iRightsManager->ListRightsL( rights, *temp );
-
-        CleanupStack::PopAndDestroy( temp );
-        if ( rights.Count() )
-            {
-            // The active RO is the first one in the list
-            //CRightsInfo* rightsInfo = rights[0]->AllocL();
-            CRightsInfo* rightsInfo = rights[ 0 ];
-            cafRights = iRightsManager->GetRightsDataL( *rightsInfo );
-            rightsObj = reinterpret_cast<CDRMRights*>( cafRights );
-            rightsObj->GetRightsInfo(
-                rightSpec,
-                iDRMRestriction,
-                iDRMExpiration,
-                iDRMConstraintType );
-            iDRMRightsExist = ETrue;
-            }
-        else
-            {
-            iDRMRightsExist = EFalse;
-            }
-        rights.ResetAndDestroy();
-
-#else // DRMCOMMONIN_POISTO
-
-        TInt restriction = iDRMCommon->GetActiveRights(
-            *iMediaInfo.DRMContentURI(),
-            rightSpec,
-            rightsObj );
-
-        if ( restriction == CDRMRights::ENoRights ||
-            !rightsObj )
-            {
-            iDRMRightsExist = EFalse;
-            }
-        else
-            {
-            rightsObj->GetRightsInfo(
-                rightSpec,
-                iDRMRestriction,
-                iDRMExpiration,
-                iDRMConstraintType );
-            iDRMRightsExist = ETrue;
-            }
-
-#endif // DRMCOMMONIN_POISTO
-
-        if ( aRightsObj )
-            {
-            (*aRightsObj) = rightsObj;
-            }
-        else
-            {
-            delete rightsObj;
-            }
-        }
-*/
-    }
-
-// ---------------------------------------------------------
-// CUniDrmInfo::ConsumeRights
-// ---------------------------------------------------------
-//
-TInt CUniDrmInfo::ConsumeRights()
-    {
-//    UNILOGGER_ENTERFN( "CUniDrmInfo::ConsumeRights" );
-
-    TInt err( KErrNone );
-    if ( ( iMediaInfo.MediaType() == EMsgMediaAudio ||
-           ( iMediaInfo.MediaType() != EMsgMediaAudio &&
-             iDRMExpiration == CDRMRights::EValidRights ) ) &&
-         iDRMConsumeStatus != EUniDRMConsumed )
-        {
-        if ( iDRMConsumeCount )
-            {
-            //UNILOGGER_WRITE( "Rights freezed" );
-
-            // Already once consumed. Freeze is enough!
-            FreezeRights();
-            }
-        else
-            {
-            if ( iDRMConsumeStatus == EUniDRMFrozen )
-                {
-                //UNILOGGER_WRITE( "Rights released" );
-
-                ReleaseRights();
-                }
-
-            err = iDRMHelper->Consume2( iMediaInfo.DRMContentURI()->Des(),
-                                        ConsumeIntent(),
-                                        CDRMHelper::EStart );
-
-            if ( !err )
-                {
-                //UNILOGGER_WRITE( "Rights consumed" );
-
-                iDRMConsumeStatus = EUniDRMConsumed;
-                iDRMConsumeCount++;
-                }
-            }
-        }
-    // else - never consume for preview
-
-    //UNILOGGER_WRITEF( _L("Result: %d"), err );
-    //UNILOGGER_LEAVEFN( "CUniDrmInfo::ConsumeRights" );
-
-    return err;
-    }
-
-// ---------------------------------------------------------
-// CUniDrmInfo::EvaluateRights
-// ---------------------------------------------------------
-//
-TInt CUniDrmInfo::EvaluateRights( TBool& aConsumed )
-    {
-    //UNILOGGER_ENTERFN( "CUniDrmInfo::EvaluateRights" );
-
-    aConsumed = ( iDRMConsumeStatus == EUniDRMConsumed ||  iDRMConsumeCount );
-
-    TInt err( KErrNone );
-
-    CData* cData = NULL;
-    TRAP_IGNORE( cData = CreateCDataL() );
-
-    if ( cData )
-        {
-        err = cData->EvaluateIntent( ConsumeIntent() );
-        delete cData;
-        }
-
-    //UNILOGGER_WRITEF( _L("Result: %d, aConsumed %d"), err, aConsumed );
-    //UNILOGGER_LEAVEFN( "CUniDrmInfo::EvaluateRights" );
-
-    return err;
-    }
-
-// ---------------------------------------------------------
-// CUniDrmInfo::FreezeRights
-// ---------------------------------------------------------
-//
-TInt CUniDrmInfo::FreezeRights()
-    {
-    //UNILOGGER_ENTERFN( "CUniDrmInfo::FreezeRights" );
-
-    TInt err( KErrNone );
-    if ( ( iMediaInfo.MediaType() == EMsgMediaAudio ||
-           ( iMediaInfo.MediaType() != EMsgMediaAudio &&
-             iDRMExpiration == CDRMRights::EValidRights ) ) &&
-         iDRMConsumeStatus == EUniDRMNone )
-        {
-        err = iDRMHelper->Consume2( iMediaInfo.DRMContentURI()->Des(),
-                                    ContentAccess::EInstall,
-                                    CDRMHelper::EStart );
-
-        if ( !err )
-            {
-            //UNILOGGER_WRITE( "Rights frozen" );
-
-            iDRMConsumeStatus = EUniDRMFrozen;
-            }
-        }
-
-    //UNILOGGER_WRITEF( _L("Result: %d"), err );
-    //UNILOGGER_LEAVEFN( "CUniDrmInfo::FreezeRights" );
-
-    return err;
-    }
-
-// ---------------------------------------------------------
-// CUniDrmInfo::ReleaseRights
-// ---------------------------------------------------------
-//
-TInt CUniDrmInfo::ReleaseRights()
-    {
-    //UNILOGGER_ENTERFN( "CUniDrmInfo::ReleaseRights" );
-
-    TInt err( KErrNone );
-    if ( iDRMConsumeStatus != EUniDRMNone )
-        {
-        TUint32 rightsSpec = ( iDRMConsumeStatus == EUniDRMFrozen )
-            ? ContentAccess::EInstall
-            : ConsumeIntent();
-
-        err = iDRMHelper->Consume2( iMediaInfo.DRMContentURI()->Des(),
-                                    rightsSpec,
-                                    CDRMHelper::EFinish );
-
-        //UNILOGGER_WRITE( "Rights released" );
-
-        // else - never consumed for preview
-        iDRMConsumeStatus = EUniDRMNone;
-        }
-
-    //UNILOGGER_WRITEF( _L("Result: %d"), err );
-    //UNILOGGER_LEAVEFN( "CUniDrmInfo::ReleaseRights" );
-
-    return err;
-    }
-
-// ---------------------------------------------------------
-//  CUniDrmInfo::RightsValidL
-// ---------------------------------------------------------
-//
-TBool CUniDrmInfo::RightsValidL( TBool aUpdate )
-    {
-    //UNILOGGER_ENTERFN( "CUniDrmInfo::RightsValidL" );
-    //UNILOGGER_WRITEF( _L("aUpdate: %d"), aUpdate );
-
-    // By default rights are valid
-    TBool retVal = ETrue;
-    if ( aUpdate )
-        {
-        DoGetRightsInfoL();
-
-        //UNILOGGER_WRITE( "Update done" );
-        }
-
-    if ( iMediaInfo.Protection() &
-        ( EFileProtForwardLocked | EFileProtSuperDistributable ) )
-        {
-        if ( iDRMRightsExist )
-            {
-            if ( iDRMExpiration == CDRMRights::EExpiredRights ||
-                 iDRMExpiration == CDRMRights::EFutureRights )
-                {
-                // Expired or future rights
-                retVal = EFalse;
-                }
-            }
-        else
-            {
-            // No rights
-            retVal = EFalse;
-            }
-        }
-
-    //UNILOGGER_WRITEF( _L("Result: %d"), retVal );
-    //UNILOGGER_LEAVEFN( "CUniDrmInfo::RightsValidL" );
-
-    return retVal;
-    }
-
-// ---------------------------------------------------------
-// CUniDrmInfo::IsDrmWithOnePreview
-// ---------------------------------------------------------
-//
-TBool CUniDrmInfo::IsDrmWithOnePreview()
-    {
-    return iDrmOnePreview;
-    }
-
-// ---------------------------------------------------------
-// CUniDrmInfo::SetIsDrmWithOnePreviewL
-// ---------------------------------------------------------
-//
-void CUniDrmInfo::SetIsDrmWithOnePreviewL()
-    {
-/*
-    iDrmOnePreview = EFalse;
-    if ( !( iSupportedFeatures & EUniFeatureDrmFull ) )
-        {
-        return;
-        }
-
-    // Check only object list. Attachments are left for
-    // dedicated attachment handler's responsibility.
-    CDRMRights* rights = NULL;
-    DoGetRightsInfoL(&rights);
-
-    if ( rights &&
-         iDRMRightsExist &&
-         !( iDRMConstraintType ^ CDRMRights::ECountBased ) &&   // only ECountBased bit set
-         iMediaInfo.Protection() & EFileProtForwardLocked )
-        {
-        // must get count still
-        // no leaving functions in this function
-        CDRMRightsConstraints* constraint = NULL;
-        TMsgMediaType mediaType = iMediaInfo.MediaType();
-
-        if ( mediaType == EMsgMediaImage ||
-             mediaType == EMsgMediaSvg )
-            {
-            rights->GetDisplayRight( constraint );
-            }
-        else if ( mediaType == EMsgMediaAudio ||
-                  mediaType == EMsgMediaVideo )
-            {
-            rights->GetPlayRight( constraint );
-            }
-
-        if ( constraint &&
-             constraint->IsPreview() )
-            {
-            TUint32 origCount = 0;
-            TUint32 nowCount = 0;
-            constraint->GetCounters( nowCount,  origCount);
-
-            if ( nowCount == 1 )
-                {
-                iDrmOnePreview = ETrue;
-                }
-            }
-
-        delete constraint;
-        }
-
-    delete rights;
-*/
-    }
-
-
-// ---------------------------------------------------------
-// CUniDrmInfo::CreateCDataL
-// ---------------------------------------------------------
-//
-CData* CUniDrmInfo::CreateCDataL()
-    {
-    CData* result = NULL;
-
-    if ( iMediaInfo.DRMContentURI() )
-        {
-        // depends on iAttachmentId
-        RFile attachmentFile = CUniDataUtils::GetAttachmentFileL( iMtm, iAttachmentId );
-        CleanupClosePushL( attachmentFile );
-
-        result = CData::NewL( attachmentFile,
-                              KDefaultContentObject,
-                              EPeek );
-
-        CleanupStack::PopAndDestroy( &attachmentFile );
-        }
-
-    return result;
-    }
-
-// ---------------------------------------------------------
-// CUniDrmInfo::HandleDrmErrorL
-// ---------------------------------------------------------
-//
-void CUniDrmInfo::HandleDrmErrorL( TInt aError )
-    {
-    if ( iDRMHelper )
-        {
-        RFile attachmentFile = CUniDataUtils::GetAttachmentFileL( iMtm, iAttachmentId );
-        CleanupClosePushL( attachmentFile );
-
-        iDRMHelper->HandleErrorL(   aError,
-                                    attachmentFile );
-        CleanupStack::PopAndDestroy( &attachmentFile );
-        }
-    }
-
-
-// EOF
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/UniMimeInfo.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,338 +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: 
-*       CUniMimeInfo, Storage for objects mime headers.
-*
-*
-*/
-
-
-// ========== INCLUDE FILES ================================
-
-#include <e32def.h>     // for basic types
-#include <eikenv.h>     // for CBase
-#include <msvstd.h>     // for TMsvId
-#include <msvids.h>     // for KMsvTempIndexEntryId
-
-#include <mmsvattachmentmanager.h>
-#include <cmsvattachment.h>
-#include <cmsvmimeheaders.h>
-
-#include "msgtextutils.h"
-#include "UniModelConst.h"
-#include "UniDataUtils.h"
-#include "UniMimeInfo.h"
-
-// ========== EXTERNAL DATA STRUCTURES =====================
-
-// ========== EXTERNAL FUNCTION PROTOTYPES =================
-
-// ========== CONSTANTS ====================================
-
-// Maximum num of characters for descriptors stored in HBufC members
-const TInt KMaxMimeFieldLength  = 260;
-const TInt KMaxContentLocation  = 100; // Max byte size for content location
-
-// From RFC2183. Content-Disposition filename max length.
-// Does not need special handling.
-//const TInt KMaxMimeFieldParamLength = 78;
-
-// ========== MACROS =======================================
-
-// ========== LOCAL CONSTANTS AND MACROS ===================
-
-// ========== MODULE DATA STRUCTURES =======================
-
-
-// ========== LOCAL FUNCTION PROTOTYPES ====================
-
-// ========== LOCAL FUNCTIONS ==============================
-
-// ========== MEMBER FUNCTIONS =============================
-
-
-// ---------------------------------------------------------
-// CUniMimeInfo
-//
-// Constructor
-// ---------------------------------------------------------
-//
-CUniMimeInfo::CUniMimeInfo() : iContentTypeCharset(0)
-    {
-    }
-
-// ---------------------------------------------------------
-// CUniMimeInfo
-//
-// Destructor.
-// ---------------------------------------------------------
-//
-CUniMimeInfo::~CUniMimeInfo()
-    {
-    delete iContentDescription;
-    delete iContentBase;
-    delete iContentLocation;
-    delete iContentId;
-    delete iContentType;
-    delete iContentDisposition;
-    }
-
-
-// ---------------------------------------------------------
-// Accessors/Mutators
-// ---------------------------------------------------------
-
-// ---------------------------------------------------------
-// SetContentTypeL
-// NOTE: 8 bit.
-// ---------------------------------------------------------
-void CUniMimeInfo::SetContentTypeL( const TDesC8& aSourceDesc )
-    {
-    if ( aSourceDesc.Length() > KMaxMimeFieldLength )
-        User::Leave( KErrArgument );
-
-    HBufC8* buf = aSourceDesc.AllocL();
-    delete iContentType;
-    iContentType = buf;
-    }
-
-// ---------------------------------------------------------
-// SetContentLocationL
-// NOTE: 16 bit.
-// ---------------------------------------------------------
-void CUniMimeInfo::SetContentLocationL( const TDesC& aSourceDesc )
-    {
-    TInt copyLen = aSourceDesc.Length();
-    if ( copyLen > KMaxContentLocation )
-        {
-        copyLen = KMaxContentLocation;
-        }
-
-    HBufC* buf = HBufC::NewL( copyLen );
-    *buf = aSourceDesc.Left( copyLen );
-    delete iContentLocation;
-    iContentLocation = buf;
-    }
-
-// ---------------------------------------------------------
-// SetContentIdL
-// NOTE: 8 bit.
-// ---------------------------------------------------------
-void CUniMimeInfo::SetContentIdL( const TDesC8& aSourceDesc )
-    {
-    if ( aSourceDesc.Length() > KMaxMimeFieldLength )
-        User::Leave( KErrArgument );
-
-    HBufC8* buf = aSourceDesc.AllocL();
-    delete iContentId;
-    iContentId = buf;
-    }
-
-// ---------------------------------------------------------
-// SetContentBaseL
-// NOTE: 8 bit.
-// ---------------------------------------------------------
-void CUniMimeInfo::SetContentBaseL( const TDesC8& aSourceDesc )
-    {
-    if ( aSourceDesc.Length() > KMaxMimeFieldLength )
-        User::Leave( KErrArgument );
-
-    HBufC8* buf = aSourceDesc.AllocL();
-    delete iContentBase;
-    iContentBase = buf;
-    }
-
-// ---------------------------------------------------------
-// SetContentDescriptionL
-// NOTE: 8 bit.
-// ---------------------------------------------------------
-void CUniMimeInfo::SetContentDescriptionL( const TDesC8& aSourceDesc )
-    {
-    if ( aSourceDesc.Length() > KMaxMimeFieldLength )
-        User::Leave( KErrArgument );
-
-    HBufC8* buf = aSourceDesc.AllocL();
-    delete iContentDescription;
-    iContentDescription = buf;
-    }
-
-// ---------------------------------------------------------
-// SetContentDispositionL
-// NOTE: 8 bit.
-// ---------------------------------------------------------
-void CUniMimeInfo::SetContentDispositionL( const TDesC8& aSourceDesc )
-    {
-    if ( aSourceDesc.Length() > KMaxMimeFieldLength )
-        User::Leave( KErrArgument );
-
-    HBufC8* buf = aSourceDesc.AllocL();
-    delete iContentDisposition;
-    iContentDisposition = buf;
-    }
-
-// ---------------------------------------------------------
-// Size
-// ---------------------------------------------------------
-TInt CUniMimeInfo::Size() const
-    {
-    // TODO: Check that MIME info size matches to the actual
-    //       MIME header size
-    //TInt size = sizeof( iContentTypeCharset );
-    TInt size = sizeof( TUint32 ); // mmsengine uses this
-
-    if ( iContentDescription ) size += iContentDescription->Size();
-
-    if ( iContentBase ) size += iContentBase->Size();
-
-    if ( iContentLocation ) size += iContentLocation->Size();
-
-    if ( iContentId ) size += iContentId->Size();
-
-    if ( iContentType ) size += iContentType->Size();
-
-    if ( iContentDisposition ) size += iContentDisposition->Size();
-
-    return size;
-    }
-
-// ---------------------------------------------------------
-// CUniMimeInfo::SaveMimeInfoL
-//
-// Save MIME info
-// ---------------------------------------------------------
-//
-void CUniMimeInfo::SaveMimeInfoL( MMsvAttachmentManager& aManager, CMsvAttachment& aAttachment )
-    {
-    // Content-Location.
-    HBufC* safeContentLocation = CMsgTextUtils::GetSafeAttachmentNameLC(
-        aManager,
-        ContentLocation(),
-        aAttachment.Id(),
-        ETrue );
-    SetContentLocationL( *safeContentLocation );
-    CleanupStack::PopAndDestroy( safeContentLocation );
-
-    CMsvMimeHeaders* msvMime = CMsvMimeHeaders::NewLC();
-    msvMime->RestoreL( aAttachment );
-
-    msvMime->SetContentLocationL( *iContentLocation );
-
-    // Content-type
-    if ( iContentType )
-        {
-        TInt slash = iContentType->Locate( '/' );
-        if ( slash != KErrNotFound )
-            {
-            msvMime->SetContentTypeL( iContentType->Left( slash ) );
-            msvMime->SetContentSubTypeL( iContentType->Mid( slash + 1 ) );
-            }
-        }
-
-    // Character set
-    if ( iContentTypeCharset )
-        {
-        msvMime->SetMimeCharset( iContentTypeCharset );
-        }
-    // Content-Id
-    if ( iContentId && iContentId->Length() )
-        {
-        msvMime->SetContentIdL( *iContentId );
-        }
-    // Content-Description
-    if ( iContentDescription && iContentDescription->Length() )
-        {
-        msvMime->SetContentDescriptionL( *iContentDescription );
-        }
-    // Content-Base
-    if ( iContentBase && iContentBase->Length() )
-        {
-        msvMime->SetContentBaseL( *iContentBase );
-        }
-    // Content-Disposition
-    if ( iContentDisposition && iContentDisposition->Length() )
-        {
-        msvMime->SetContentDispositionL( *iContentDisposition );
-        }
-    msvMime->StoreL( aAttachment );
-    CleanupStack::PopAndDestroy( msvMime );
-    }
-
-// ---------------------------------------------------------
-// CUniMimeInfo::DoReadMimeInfoL
-//
-// Reads mime info from clientMtm to aMimeInfo.
-// If function leaves whole MimeInfo object should be considered
-// invalid.
-// ---------------------------------------------------------
-//
-
-void CUniMimeInfo::ReadMimeInfoL( CMsvAttachment& aAttachment )
-    {
-    CMsvMimeHeaders* msvMime = CMsvMimeHeaders::NewLC();
-    msvMime->RestoreL( aAttachment );
-
-    // Content-Location
-    SetContentLocationL( msvMime->ContentLocation() );
-
-    // Content-ID
-    SetContentIdL( msvMime->ContentId() );
-
-    TBuf8<KMaxDataTypeLength> contentType;
-    contentType.Copy( msvMime->ContentType() );
-    contentType.Append( _L8("/") );
-    contentType.Append( msvMime->ContentSubType() );
-    // Content-type
-    SetContentTypeL( contentType );
-
-    // Character set
-    SetCharset( msvMime->MimeCharset() );
-
-    // Content-Description
-    SetContentDescriptionL( msvMime->ContentDescription() );
-
-    // Content-Base
-    SetContentBaseL( msvMime->ContentBase() );
-
-    // Content-Disposition
-    SetContentDispositionL( msvMime->ContentDisposition() );
-
-    CleanupStack::PopAndDestroy( msvMime );
-    }
-
-// ---------------------------------------------------------
-// EnsureContentLocationL
-// ---------------------------------------------------------
-void CUniMimeInfo::EnsureContentLocationL(
-    MMsvAttachmentManager& aManager,
-    CMsvAttachment& aAttachment,
-    TDesC& aPlainFileName )
-    {
-    if ( !ContentLocation().Length() && aPlainFileName.Length() )
-        {
-        // Generate safe content location from file name
-        HBufC* contLoc = CMsgTextUtils::GetSafeAttachmentNameLC(
-            aManager,
-            aPlainFileName,
-            aAttachment.Id(),
-            ETrue );
-        SetContentLocationL( *contLoc );
-
-        CleanupStack::PopAndDestroy( contLoc );
-
-        // Save ContentLocation.
-        SaveMimeInfoL( aManager, aAttachment );
-        }
-    }
-
-// EOF
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/UniObject.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,774 +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: 
-*       CUniObject, Storage for single attachment in presentation.
-*
-*
-*/
-
-
-// ========== INCLUDE FILES ================================
-
-#include <e32def.h>     // for basic types
-#include <eikenv.h>     // for CBase
-#include <mtclbase.h>   // for CBaseMtm
-#include <msvids.h>     // for KMsvTempIndexEntryId
-#include <msvstore.h>
-#include <mmsvattachmentmanager.h>
-#include <mmsvattachmentmanagersync.h>
-#include <cmsvattachment.h>
-#include <miutmsg.h>
-
-// Features
-#include <featmgr.h>
-#include <bldvariant.hrh>
-#include <DRMNotifier.h>
-
-#include <MsgMediaInfo.h>
-#include <MsgTextInfo.h>
-
-#include "UniModelConst.h"
-#include "UniMimeInfo.h"
-#include "UniDrmInfo.h"
-#include "UniObject.h"
-#include "UniDataUtils.h"
-#include "msgtextutils.h"
-#include "MsgMimeTypes.h"
-#include "fileprotectionresolver.h"  //DRM
-#include "MuiuOperationWait.h"
-
-// ========== EXTERNAL DATA STRUCTURES =====================
-
-// ========== EXTERNAL FUNCTION PROTOTYPES =================
-
-// ========== CONSTANTS ====================================
-
-// ========== MACROS =======================================
-
-// ========== LOCAL CONSTANTS AND MACROS ===================
-
-// ========== MODULE DATA STRUCTURES =======================
-
-// ========== LOCAL FUNCTION PROTOTYPES ====================
-
-// ========== LOCAL FUNCTIONS ==============================
-
-// ========== MEMBER FUNCTIONS =============================
-
-// ---------------------------------------------------------
-// CUniObject::NewLC
-//
-// Factory method.
-// ---------------------------------------------------------
-//
-CUniObject* CUniObject::NewLC( RFs& aFs,
-                                       CBaseMtm& aMtm,
-                                       CUniDataUtils& aData,
-                                       CMsgMediaInfo* aMedia,
-                                       MMsvAttachmentManager& aManager,
-                                       CMsvAttachment& aAttachment )
-    {
-    CUniObject* self =
-        new ( ELeave ) CUniObject( aFs, aMtm, aData, aMedia );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    self->ConstructFromAttachmentL( aManager, aAttachment );
-    return self;
-    }
-
-// ---------------------------------------------------------
-// CUniObject::NewL
-//
-// Factory method.
-// ---------------------------------------------------------
-//
-CUniObject* CUniObject::NewL( RFs& aFs,
-                                      CBaseMtm& aMtm,
-                                      CUniDataUtils& aData,
-                                      CMsgMediaInfo* aMedia,
-                                      MMsvAttachmentManager& aManager,
-                                      CMsvAttachment& aAttachment )
-    {
-    CUniObject* self = NewLC( aFs, aMtm, aData, aMedia, aManager, aAttachment );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------
-// CUniObject::NewLC
-//
-// Factory method.
-// ---------------------------------------------------------
-//
-CUniObject* CUniObject::NewLC( RFs& aFs,
-                                       CBaseMtm& aMtm,
-                                       CUniDataUtils& aData,
-                                       CMsgMediaInfo* aMedia )
-    {
-    CUniObject* self =
-        new ( ELeave ) CUniObject( aFs, aMtm, aData, aMedia );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    self->CreateMimeInfoL();
-    return self;
-    }
-
-// ---------------------------------------------------------
-// CUniObject::NewL
-//
-// Factory method.
-// ---------------------------------------------------------
-//
-CUniObject* CUniObject::NewL( RFs& aFs,
-                                      CBaseMtm& aMtm,
-                                      CUniDataUtils& aData,
-                                      CMsgMediaInfo* aMedia )
-    {
-    CUniObject* self = NewLC( aFs, aMtm, aData, aMedia );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------
-// CUniObject::CUniObject
-//
-// Constructor.
-// ---------------------------------------------------------
-//
-CUniObject::CUniObject( RFs& aFs,
-                       CBaseMtm& aMtm,
-                       CUniDataUtils& aData,
-                       CMsgMediaInfo* aMedia ) :
-    CActive( EPriorityStandard ),
-    iFs( aFs ),
-    iMtm( aMtm ),
-    iData( aData ),
-    iAttachmentId( KMsvNullIndexEntryId ),
-    iMimeInfo( NULL ),
-    iMediaInfo( aMedia ),
-    iReferenceCount( 0 ),
-    iRegion( EUniRegionUnresolved ),
-    iMediaTypeBySmilTag( EMsgMediaUnknown ),
-    iUniqueControlHandle( KErrNotFound )
-    {
-    CActiveScheduler::Add( this );
-    }
-
-
-// ---------------------------------------------------------
-// CUniObject::CUniObject
-//
-// Destructor.
-// ---------------------------------------------------------
-//
-CUniObject::~CUniObject()
-    {
-    Cancel();
-    if ( iDrmNotifier )
-        {
-        // When one observer left, remove
-        TRAP_IGNORE( iDrmNotifier->UnRegisterEventObserverL( *this,
-                                                            KEventAddRemove,
-                                                            *iMediaInfo->DRMContentURI() ) );
-        TRAP_IGNORE( iDrmNotifier->UnRegisterEventObserverL( *this,
-                                                KEventModify,
-                                                *iMediaInfo->DRMContentURI() ) );
-        }
-    delete iEditStore;
-    delete iDrmInfo;
-    delete iMediaInfo;
-    delete iMimeInfo;
-
-    iFileHandle.Close();
-    delete iDrmNotifier;
-    delete iObservers;
-    }
-
-// ---------------------------------------------------------
-// CUniObject::Save
-// ---------------------------------------------------------
-//
-void CUniObject::Save( MUniObjectSaveObserver& aObserver,
-                       CMsvAttachment::TMsvAttachmentType aSaveType )
-    {
-    iObserver = &aObserver;
-    iSaveType = aSaveType;
-    iSaveState = EObjectSavingIdle;
-
-    //CompleteSelf()
-    RunL();
-    }
-
-// ---------------------------------------------------------
-// CUniObject::DoSaveL
-// ---------------------------------------------------------
-//
-void CUniObject::DoSaveL()
-    {
-    switch ( iSaveState )
-        {
-        case EObjectSavingIdle:
-            {
-            StartObjectSaveL();
-            break;
-            }
-        case EObjectCreatingAttachment:
-            {
-            FinalizeObjectSaveL();
-            break;
-            }
-        default:
-            break;
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniObject::InitializeObjectSaveL
-// ---------------------------------------------------------
-//
-void CUniObject::StartObjectSaveL()
-    {
-    if ( iAttachmentId != KMsvNullIndexEntryId )
-        {        	
-        if ( iSaveType == CMsvAttachment::EMsvLinkedFile )
-            {
-
-            iObserver->ObjectSaveReady( KErrNone );
-            return;
-            }
-        else
-            {
-         
-            CMsvStore* readStore = iMtm.Entry().ReadStoreL();
-            MMsvAttachmentManager& manager = readStore->AttachmentManagerL();
-            CleanupStack::PushL( readStore );
-            CMsvAttachment* attachment = manager.GetAttachmentInfoL( iAttachmentId );
-            CMsvAttachment::TMsvAttachmentType type = attachment->Type();
-            delete attachment;
-            CleanupStack::PopAndDestroy( readStore );
-            if ( type == CMsvAttachment::EMsvLinkedFile )
-                {
-                // Remove the "linked attachment" from store & create new "file attachment"
-                RemoveFromStoreL();
-                CreateAttachmentL();
-                }
-            else
-                {
-                // Already a "file attachment"
-                iObserver->ObjectSaveReady( KErrNone );
-                return;
-                }
-            }
-        }
-    else
-        {
-        // Create new attachment
-        CreateAttachmentL();
-        }
-    }
-
-
-// ---------------------------------------------------------
-// CUniObject::InitializeObjectSaveL
-// ---------------------------------------------------------
-//
-void CUniObject::FinalizeObjectSaveL()
-    {
-    // TODO: Cleanup attachment in some cases?
-    //       -> Just use Revert() instead of CommitL()?
-    iAttachmentId = iAttachment->Id();
-    iMimeInfo->SaveMimeInfoL( *iManager, *iAttachment );
-
-    CMsvAttachment::TMsvAttachmentType type = iAttachment->Type();
-    if ( type == CMsvAttachment::EMsvLinkedFile )
-        {
-        iFileHandle.Close();
-        iFileHandle = iManager->GetAttachmentFileL( iAttachmentId  );
-        }
-
-    iAttachment = NULL;
-    iEditStore->CommitL();
-
-    if ( iSaveType == CMsvAttachment::EMsvFile )
-        {
-        // Update media info
-        RFile attachmentFile = iManager->GetAttachmentFileL( iAttachmentId );
-        CleanupClosePushL( attachmentFile );
-        iMediaInfo->SetFileL( attachmentFile );
-        CleanupStack::PopAndDestroy( &attachmentFile );
-        }
-
-    delete iEditStore;
-    iEditStore = NULL;
-    iManager = NULL;
-
-    //DoSaveL();
-    iObserver->ObjectSaveReady( KErrNone );    
-    }
-
-
-// ---------------------------------------------------------
-// CUniObject::CreateAttachmentL
-//
-// Create attachment to message store
-// ---------------------------------------------------------
-//
-void CUniObject::CreateAttachmentL()
-    {
-    if ( !( iMediaInfo->FullFilePath().Length() ) )
-        {
-        User::Leave( KErrNotSupported );
-        }
-    TParsePtrC fileParse( iMediaInfo->FullFilePath() );
-
-    iEditStore = iMtm.Entry().EditStoreL();
-    iManager = &( iEditStore->AttachmentManagerL() );
-    CMsvAttachment* attachment = CMsvAttachment::NewL( iSaveType );
-    CleanupStack::PushL( attachment );
-
-    attachment->SetSize( iMediaInfo->FileSize() );
-    attachment->SetMimeTypeL( iMimeInfo->ContentType() );
-    //TODO: Set complete flag?
-    //attachment->SetComplete( iSaveType != EHiddenSave );
-
-    attachment->SetIntAttributeL( KUidAttachmentIndication, Attachment() );
-
-    //Make this synchronous process
-    CMuiuOperationWait* wait = CMuiuOperationWait::NewLC();
-    if ( iSaveType == CMsvAttachment::EMsvLinkedFile )
-        {
-        iManager->AddLinkedAttachmentL( fileParse.FullName(), attachment, wait->iStatus );
-        wait->Start();
-        }
-    else
-        {
-        iManager->AddAttachmentL( fileParse.FullName(), attachment, wait->iStatus );
-        wait->Start();
-        }
-    CleanupStack::PopAndDestroy( wait );
-    
-    CleanupStack::Pop( attachment );
-    iAttachment = attachment;
-    iSaveState = EObjectCreatingAttachment;
-        
-    RunL();
-    //SetActive();
-    }
-
-// ---------------------------------------------------------
-// CUniObject::SetVisibleL
-//
-// Set "Visible" and "InPreparation" flags
-// ---------------------------------------------------------
-//
-/*
-void CUniObject::SetHiddenL( TBool aHidden )
-    {
-    // TODO: Use Complete flag?!
-
-    if ( iAttachmentId == KMsvNullIndexEntryId )
-        {
-        return;
-        }
-    CMsvEntry* cAttEntry = iMtm.Entry().ChildEntryL( iAttachmentId );
-    CleanupStack::PushL( cAttEntry );
-    TMsvEntry tAttEntry = cAttEntry->Entry();
-    tAttEntry.SetInPreparation( aHidden );
-    cAttEntry->ChangeL( tAttEntry );
-    CleanupStack::PopAndDestroy( cAttEntry );
-    }
-*/
-
-
-// ---------------------------------------------------------
-// CUniObject::RemoveFromStoreL
-//
-// Remove from store.
-// ---------------------------------------------------------
-//
-void CUniObject::RemoveFromStoreL()
-    {
-    if ( iAttachmentId == KMsvNullIndexEntryId )
-        {
-        return;
-        }
-
-    iFileHandle.Close();
-
-    CMsvStore* store = iMtm.Entry().EditStoreL();
-    CleanupStack::PushL( store );
-    MMsvAttachmentManager& manager = store->AttachmentManagerL();
-    MMsvAttachmentManagerSync& managerSync = store->AttachmentManagerExtensionsL();
-    managerSync.RemoveAttachmentL( CUniDataUtils::IndexPositionOfAttachmentL( manager, iAttachmentId ) );
-    store->CommitL();
-    CleanupStack::PopAndDestroy( store );
-    iAttachmentId = KMsvNullIndexEntryId;
-}
-
-
-// ---------------------------------------------------------
-// CUniObject::CreateMimeInfoL
-//
-// ---------------------------------------------------------
-//
-void CUniObject::CreateMimeInfoL()
-    {
-    // Content-type
-    iMimeInfo->SetContentTypeL( iMediaInfo->MimeType() );
-
-    HBufC* fileName = NULL;
-    if ( iMediaInfo->FullFilePath().Length() )
-        {
-        TParsePtrC parse( iMediaInfo->FullFilePath() );
-        fileName = parse.NameAndExt().AllocLC();
-        }
-
-    if ( fileName )
-        {
-        // Content-location
-        TPtr ptr = fileName->Des();
-        CMsgTextUtils::TrimAndRemoveNonAlphaDigit( ptr );
-        iMimeInfo->SetContentLocationL( *fileName );
-        CleanupStack::PopAndDestroy( fileName );
-
-        // Character set. Recognize charset if atta is text.
-        if ( iMediaInfo->MediaType() == EMsgMediaText ||
-             iMediaInfo->MediaType() == EMsgMediaXhtml )
-            {
-            CMsgTextInfo* info = static_cast<CMsgTextInfo*>( iMediaInfo );
-            TUint charConvCharset = info->CharacterSet();
-            TUint mibCharset( 0 );
-            if ( charConvCharset == 0 )
-                {
-                // UCS2
-                mibCharset = KCharacterSetMIBEnumIso10646Ucs2;
-                }
-            else
-                {
-                mibCharset = iData.CharconvIdToMibIdL( charConvCharset );
-                }
-            iMimeInfo->SetCharset( mibCharset );
-            }
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniObject::Size
-//
-// Accessor.
-// ---------------------------------------------------------
-//
-TInt CUniObject::Size( TBool aWithoutHeaders )
-    {
-    return ( aWithoutHeaders
-        ? iMediaInfo->FileSize()
-        : iMediaInfo->FileSize() + iMimeInfo->Size() );
-    }
-
-// ---------------------------------------------------------
-// CUniObject::MimeType
-// ---------------------------------------------------------
-//
-TPtrC8 CUniObject::MimeType() const
-    {
-    if ( iMediaInfo->MediaType() == EMsgMediaAudio ||
-         iMediaInfo->MediaType() == EMsgMediaImage ||
-         iMediaInfo->MediaType() == EMsgMediaVideo ||
-#ifdef RD_SVGT_IN_MESSAGING
-         iMediaInfo->MediaType() == EMsgMediaSvg ||
-#endif
-#ifdef RD_MSG_XHTML_SUPPORT
-         iMediaInfo->MediaType() == EMsgMediaXhtml ||
-#endif
-         ( iMediaInfo->Protection() &
-           ( EFileProtForwardLocked | EFileProtSuperDistributable ) ) )
-        {
-        return iMediaInfo->MimeType();
-        }
-    else
-        {
-        return iMimeInfo->ContentType();
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniObject::MediaType
-// ---------------------------------------------------------
-//
-TMsgMediaType CUniObject::MediaType() const
-    {
-    if ( iMediaInfo->MediaType() == EMsgMediaText &&
-        iMimeInfo->ContentType().CompareF( KMsgMimeTextPlain ) != 0 )
-        {
-        return EMsgMediaUnknown;
-        }
-    else
-        {
-        return iMediaInfo->MediaType();
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniObject::ConstructL
-//
-// 2nd phase constructor.
-// ---------------------------------------------------------
-//
-void CUniObject::ConstructL()
-    {
-    iMimeInfo = new ( ELeave ) CUniMimeInfo;
-
-    if ( iMediaInfo )
-        {
-        if ( iMediaInfo->Corrupt() )
-            {
-            SetCorrupted( ETrue );
-            }
-
-        if ( iMediaInfo->DRMContentURI() )
-            {
-            iDrmInfo = CUniDrmInfo::NewL( iFs, iMtm, iAttachmentId, *iMediaInfo );
-            iDrmNotifier = CDRMNotifier::NewL( );
-            iDrmNotifier->RegisterEventObserverL( *this,
-                                                    KEventAddRemove,
-                                                    *iMediaInfo->DRMContentURI() );
-            iDrmNotifier->RegisterEventObserverL( *this,
-                                                    KEventModify,
-                                                    *iMediaInfo->DRMContentURI() );
-            }
-        }
-
-    iObservers = new( ELeave ) CArrayPtrFlat<MUniObjectObserver>( 1 );
-
-    }
-
-// ---------------------------------------------------------
-// CUniObject::ConstructFromAttachmentL
-//
-// 2nd phase constructor.
-// ---------------------------------------------------------
-//
-void CUniObject::ConstructFromAttachmentL(
-        MMsvAttachmentManager& aManager,
-        CMsvAttachment& aAttachment )
-    {
-    iAttachmentId = aAttachment.Id();
-    TPtrC8 dummy;
-    TInt err = aAttachment.GetDesC8Attribute( KUidMimeHeaders, dummy );
-    if( err == KErrNone )
-        {
-        iMimeInfo->ReadMimeInfoL( aAttachment );
-
-        if ( iMediaInfo->MediaType() == EMsgMediaText )
-            {
-            TUint mibCharset = iMimeInfo->Charset();
-            if ( !mibCharset )
-                {
-                //assume US-ASCII - mandated by RFC 2046
-                mibCharset = KCharacterSetMIBEnumUsAscii;
-                }
-            TUint charConvCharset = iData.MibIdToCharconvIdL( mibCharset );
-
-            CMsgTextInfo* info = static_cast<CMsgTextInfo*>( iMediaInfo );
-            info->SetCharacterSet( charConvCharset );
-            }
-
-        //iStoreState = EMmsStoreStateAttachment;
-        }
-    else
-        {
-        CreateMimeInfoL();
-        aAttachment.SetMimeTypeL( iMimeInfo->ContentType() );
-        iMimeInfo->SaveMimeInfoL( aManager, aAttachment );
-        // TODO: Set hidden
-        //SetHiddenL( ETrue );
-        //iStoreState = EMmsStoreStateHidden;
-        //iStoreState = EMmsStoreStateAttachment;
-        }
-
-    TInt isAttachment( 0 );
-    err = aAttachment.GetIntAttribute( KUidAttachmentIndication, isAttachment );
-
-    if ( err == KErrNone )
-        {
-        SetAttachment( isAttachment );
-        }
-
-    CMsvAttachment::TMsvAttachmentType type = aAttachment.Type();
-    if ( type == CMsvAttachment::EMsvLinkedFile )
-        {
-        iFileHandle = aManager.GetAttachmentFileL( iAttachmentId  );
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniObject::DoCancel
-//
-// ---------------------------------------------------------
-//
-void CUniObject::DoCancel()
-    {
-    if ( iManager )
-        {
-        iManager->CancelRequest();
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniObject::RunL
-//
-// ---------------------------------------------------------
-//
-void CUniObject::RunL()
-    {
-    DoSaveL();
-    }
-
-// ---------------------------------------------------------
-// CUniObject::RunError
-//
-// ---------------------------------------------------------
-//
-TInt CUniObject::RunError( TInt aError )
-    {
-    delete iEditStore;
-    iEditStore = NULL;
-    iManager = NULL;
-    iAttachmentId = NULL;
-
-    iObserver->ObjectSaveReady( aError );
-    return KErrNone;
-    }
-
-// ---------------------------------------------------------
-// CUniObject::CompleteSelf
-//
-// ---------------------------------------------------------
-//
-void CUniObject::CompleteSelf()
-    {
-    iStatus = KRequestPending;
-    TRequestStatus* pStatus = &iStatus;
-    SetActive();
-    User::RequestComplete( pStatus, KErrNone );
-    }
-
-
-// ---------------------------------------------------------
-// CUniObject::ResolveDrmRightsWhenLoadedL
-//
-// ---------------------------------------------------------
-//
-void CUniObject::ResolveDrmRightsWhenLoadedL()
-    {
-    iObjectFlags &= ~EObjectDrmRightsWhenLoaded;
-
-    if ( iDrmInfo )
-        {
-        TBool alreadyConsumed( EFalse );
-        TBool result = ( iDrmInfo->EvaluateRights( alreadyConsumed ) == KErrNone ? ETrue :
-                                                                                   EFalse );
-        if (    alreadyConsumed
-            ||  result )
-            {
-            iObjectFlags |= EObjectDrmRightsWhenLoaded;
-            }
-        }
-
-    }
-
-// ---------------------------------------------------------
-// CUniObject::SetDrmRightsWhenLoaded
-//
-// ---------------------------------------------------------
-//
-void CUniObject::SetDrmRightsWhenLoaded( TBool aRights )
-    {
-    aRights ? ( iObjectFlags |= EObjectDrmRightsWhenLoaded ) : ( iObjectFlags &= ~EObjectDrmRightsWhenLoaded );
-    }
-
-// ---------------------------------------------------------
-// CUniObject::SetDrmRightsWhenLoadedObjects
-//
-// ---------------------------------------------------------
-//
-void CUniObject::SetDrmRightsWhenLoadedObjects( TBool aRights )
-    {
-    aRights ? ( iObjectFlags |= EObjectDrmRightsWhenLoadedObjects ) : ( iObjectFlags &= ~EObjectDrmRightsWhenLoadedObjects );
-    }
-
-
-// ---------------------------------------------------------
-// CUniObject::HandleEventL from MDRMEventObserver
-//
-// ---------------------------------------------------------
-//
-void CUniObject::HandleEventL( MDRMEvent* aEvent )
-    {
-    TDRMEventType event = KEventNone;
-    if ( aEvent )
-        {
-        aEvent->GetEventType( event );
-
-        switch ( event )
-            {
-            case KEventNone:
-                break;
-            case KEventAddRemove:
-            case KEventModify:
-            case KEventTimeChange:
-            default:
-                {
-                for ( TInt current = 0; current < iObservers->Count(); current++ )
-                    {
-                    if ( iObservers->At( current ) )
-                        {
-                        iObservers->At( current )->HandleUniObjectEvent(
-                            *this,
-                            EUniObjectEventDrmRightsChanged );
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniObject::SetObserverL
-//
-// ---------------------------------------------------------
-//
-void CUniObject::SetObserverL( MUniObjectObserver* aObserver )
-    {
-    iObservers->AppendL( aObserver );
-    }
-
-// ---------------------------------------------------------
-// CUniObject::RemoveObserver
-//
-// ---------------------------------------------------------
-//
-void CUniObject::RemoveObserver( MUniObjectObserver* aObserver )
-    {
-    for ( TInt current = 0; current < iObservers->Count(); current++ )
-        {
-        if ( iObservers->At( current ) == aObserver )
-            {
-            iObservers->Delete( current );
-            break;
-            }
-        }
-    }
-
-// EOF
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/UniObjectList.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,479 +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: 
-*       CUniObjectList, List of attachments.
-*
-*
-*/
-
-
-// ========== INCLUDE FILES ================================
-
-#include <e32std.h>
-#include <e32def.h>     // for basic types
-#include <eikenv.h>     // for CBase
-#include <mtclbase.h>   // for CBaseMtm
-#include <msvstd.h>     // for TMsvId
-#include <msvids.h>     // for KMsvTempIndexEntryId
-#include <msvstore.h>
-#include <mmsvattachmentmanager.h>
-#include <mmsvattachmentmanagersync.h>
-#include <cmsvattachment.h>
-
-#include <uriutils.h>   // Uri decoding and encoding
-
-#include <MsgMediaInfo.h>
-
-#include "UniDataUtils.h"
-#include "UniModelConst.h"
-#include "UniMimeInfo.h"
-#include "UniObject.h"
-#include "UniObjectList.h"
-#include "UniSmilUtils.h"
-
-// ========== EXTERNAL DATA STRUCTURES =====================
-
-// ========== EXTERNAL FUNCTION PROTOTYPES =================
-
-// ========== CONSTANTS ====================================
-
-const TInt KObjectArrayGranularity = 10;
-_LIT( KContentIdString, "cid:*" );
-_LIT8 ( KCidLeftAngle, "<"); // 8 bit angle bracket
-_LIT8 ( KCidRightAngle, ">"); // 8 bit angle bracket
-
-// ========== MACROS =======================================
-
-// ========== LOCAL CONSTANTS AND MACROS ===================
-
-// ========== MODULE DATA STRUCTURES =======================
-
-
-// ========== LOCAL FUNCTION PROTOTYPES ====================
-
-// ========== LOCAL FUNCTIONS ==============================
-
-// ========== MEMBER FUNCTIONS =============================
-
-// ---------------------------------------------------------
-// CUniObjectList::NewLC
-//
-// Factory method.
-// ---------------------------------------------------------
-//
-CUniObjectList* CUniObjectList::NewL( CBaseMtm& aMtm, CUniDataUtils& aData )
-    {
-    CUniObjectList* self = new(ELeave) CUniObjectList( aMtm, aData );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-
-// ---------------------------------------------------------
-// CUniObjectList::CUniObjectList
-//
-// Constructor.
-// ---------------------------------------------------------
-//
-CUniObjectList::CUniObjectList( CBaseMtm& aMtm, CUniDataUtils& aData ) :
-    iObjectArray( NULL ),
-    iData( aData ),
-    iMtm( aMtm )
-    {
-    }
-
-
-// ---------------------------------------------------------
-// CUniObjectList::CUniObjectList
-//
-// Destructor.
-// ---------------------------------------------------------
-//
-CUniObjectList::~CUniObjectList()
-    {
-    if ( iObjectArray )
-        {
-        iObjectArray->ResetAndDestroy();
-        }
-    delete iObjectArray;
-    }
-
-// ---------------------------------------------------------
-// CUniObjectList::AddObjectL
-//
-// AddObjectL.
-// ---------------------------------------------------------
-//
-void CUniObjectList::AddObjectL( CUniObject* aObject )
-    {
-    iObjectArray->AppendL( aObject );
-
-    if ( iListObserver )
-        {
-        iListObserver->ObjectAddedL( this, aObject, iObjectArray->Count() - 1 );
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniObjectList::SpaceNeededForSaveAll
-//
-// SpaceNeededForSaveAll.
-// ---------------------------------------------------------
-//
-TInt CUniObjectList::SpaceNeededForSaveAll()
-    {
-    TInt spaceNeeded( 0 );
-    /*
-    for (TInt i = iObjectArray->Count(); --i >= 0 ;)
-        {
-        if ( iObjectArray->At( i )->StoreState() == EMmsStoreStateTemporary )
-            {
-            spaceNeeded += iObjectArray->At( i )->Size( EFalse ); // Count headers too.
-            }
-        }
-    */
-    return spaceNeeded;
-    }
-
-// ---------------------------------------------------------
-// CUniObjectList::SaveAllL
-//
-// SaveAllL.
-// ---------------------------------------------------------
-//
-void CUniObjectList::SaveAll( MUniObjectSaveObserver& aObserver, CMsvAttachment::TMsvAttachmentType aSaveType )
-    {
-    if ( iObjectArray->Count() )
-        {
-        iSaveObserver = &aObserver;
-        iSaveCount = 0;
-        iSaveType = aSaveType;
-        iObjectArray->At( iSaveCount )->Save( *this, aSaveType );
-        }
-    else
-        {
-        aObserver.ObjectSaveReady( KErrNone );
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniObjectList::RemoveAllObjectsL
-//
-// RemoveAllObjectsL
-// ---------------------------------------------------------
-//
-void CUniObjectList::RemoveAllObjectsL()
-    {
-    TInt a = iObjectArray->Count();
-    while ( a-- )
-        {
-        CUniObject* obj = iObjectArray->At( a );
-        obj->RemoveFromStoreL();
-        iObjectArray->Delete( a );
-
-        if ( iListObserver )
-            {
-            iListObserver->ObjectRemovedL( this, obj, a );
-            }
-
-        delete obj;
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniObjectList::EnsureAllObjectsHaveContentLocationL
-//
-// EnsureAllObjectsHaveContentLocationL
-// ---------------------------------------------------------
-//
-void CUniObjectList::EnsureAllObjectsHaveContentLocationL()
-    {
-    CMsvStore* store = iMtm.Entry().EditStoreL();
-    CleanupStack::PushL( store );
-    MMsvAttachmentManager& manager = store->AttachmentManagerL();
-    MMsvAttachmentManagerSync& managerSync = store->AttachmentManagerExtensionsL();
-    TBool commit( EFalse );
-	TInt a = iObjectArray->Count();
-    while ( a-- )
-        {
-        CUniObject* obj = iObjectArray->At( a );
-        if ( !obj->MimeInfo()->ContentLocation().Length()
-        	&& obj->AttachmentId( ) )
-            {
-            CMsvAttachment* attachment = manager.GetAttachmentInfoL( obj->AttachmentId() );
-            CleanupStack::PushL( attachment );
-            TParsePtrC parse( obj->MediaInfo()->FullFilePath() );
-            TPtrC nameAndExt( parse.NameAndExt() );
-            obj->MimeInfo()->EnsureContentLocationL(
-                manager,
-                *attachment,
-                nameAndExt );
-            managerSync.ModifyAttachmentInfoL( attachment );
-            CleanupStack::Pop( attachment );
-            commit = ETrue;
-            }
-		}
-    if ( commit )
-        {
-        store->CommitL();
-        }
-    CleanupStack::PopAndDestroy( store );
-	}
-
-// ---------------------------------------------------------
-// CUniObjectList::RemoveObjectL
-//
-// RemoveObjectL.
-// ---------------------------------------------------------
-//
-void CUniObjectList::RemoveObjectL( CUniObject* aObject, TBool aRemoveFromStore /*= ETrue*/ )
-    {
-    if ( aRemoveFromStore )
-        {
-        aObject->RemoveFromStoreL();
-        }
-    TInt a = iObjectArray->Count();
-    while ( a-- )
-        {
-        if ( iObjectArray->At( a ) == aObject )
-            {
-            iObjectArray->Delete( a );
-
-            if ( iListObserver )
-                {
-                iListObserver->ObjectRemovedL( this, aObject, a );
-                }
-            break;
-            }
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniObjectList::GetByIndex
-//
-// GetByIndex.
-// ---------------------------------------------------------
-//
-CUniObject* CUniObjectList::GetByIndex( TInt aIndex )
-    {
-    if ( aIndex < 0 || aIndex >= iObjectArray->Count() )
-        {
-        return NULL;
-        }
-    return iObjectArray->At( aIndex );
-    }
-
-// ---------------------------------------------------------
-// CUniObjectList::GetByAttachmentId
-//
-// GetByAttachmentId.
-// ---------------------------------------------------------
-//
-CUniObject* CUniObjectList::GetByAttachmentId( TMsvAttachmentId aAttachmentId )
-    {
-    TInt a = iObjectArray->Count();
-    while ( a-- )
-        {
-        if ( iObjectArray->At( a )->AttachmentId() == aAttachmentId )
-            {
-            return iObjectArray->At( a );
-            }
-        }
-    return NULL;
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::GetByNode
-//
-// ---------------------------------------------------------
-//
-CUniObject* CUniObjectList::GetByNodeL( CMDXMLNode * aNode )
-    {
-    TPtrC domsrc = UniSmilUtils::GetSrcL( aNode ); // Get path from DOM.
-    return GetByUrlL( domsrc );
-    }
-
-// ---------------------------------------------------------
-// CUniObjectList::GetByUrlL
-//
-// GetByUrlL.
-// ---------------------------------------------------------
-//
-CUniObject* CUniObjectList::GetByUrlL( const TDesC& aUrl )
-    {
-    CUniObject* att = NULL;
-    TBool found = EFalse;
-
-    HBufC8* url8bit = HBufC8::NewLC( aUrl.Length() );
-
-    CUri16* decodedUri = NULL;
-    TUriParser8 parser;
-
-    if( aUrl.MatchF( KContentIdString ) == 0 )
-        {
-        //Remove "cid:" from the beginning
-        url8bit->Des().Copy( aUrl.Right( aUrl.Length() - KContentIdString().Length() + 1 ) );
-        parser.Parse( *url8bit );
-        }
-    else
-        {
-        url8bit->Des().Copy( aUrl );
-        parser.Parse( *url8bit );
-        }
-    decodedUri = UriUtils::ConvertToDisplayFormL( parser );
-    CleanupStack::PushL( decodedUri );
-
-    TInt count = iObjectArray->Count();
-    for ( TInt i = 0; i < count && !found ; i++ )
-        {
-        TPtrC contentLocation = iObjectArray->At( i )->MimeInfo()->ContentLocation();
-        TPtrC8 contentIdPtr = iObjectArray->At( i )->MimeInfo()->ContentId();
-        CUri16* contLocUri = NULL;
-        CUri16* contIdUri = NULL;
-        HBufC8* contentLoc = NULL;
-        HBufC8* contentId = NULL;
-
-        // Convert content location as well.
-        if ( contentIdPtr.Length() )
-            {
-            //Copy string to 8-bit descriptor
-            contentId = HBufC8::NewLC( contentIdPtr.Length() );
-
-            if ( contentId->Find( KCidLeftAngle ) == 0 &&
-                 contentId->Find( KCidRightAngle ) == contentId->Length() - 1 )
-                {
-                // When comparing against cid, remove "<" and ">"
-                contentId->Des().Copy( contentIdPtr.Mid( 1, contentIdPtr.Length() - 2 ) );
-                }
-            else
-                {
-                contentId->Des().Copy( contentIdPtr );
-                }
-
-            parser.Parse( *contentId );
-            contIdUri = UriUtils::ConvertToDisplayFormL( parser );
-            CleanupStack::PushL( contIdUri );
-            }
-         if ( contentLocation.Length() )
-            {
-            //Copy string to 8-bit descriptor
-            contentLoc = HBufC8::NewLC( contentLocation.Length() );
-            contentLoc->Des().Copy( contentLocation );
-            parser.Parse( *contentLoc );
-            contLocUri = UriUtils::ConvertToDisplayFormL( parser );
-            CleanupStack::PushL( contLocUri );
-            }
-
-        if (
-            ( ( contentLocation.Length() ) && (decodedUri->Uri().UriDes().CompareF( contLocUri->Uri().UriDes() ) == 0 ) ) ||
-            ( ( contentIdPtr.Length() ) && (decodedUri->Uri().UriDes().CompareF( contIdUri->Uri().UriDes() ) == 0 ) ) )
-            {
-            att = iObjectArray->At( i );
-            }
-
-        if ( contentLoc )
-            {
-            CleanupStack::PopAndDestroy( 2, contentLoc ); // contentLoc, contLocUri
-            }
-        if ( contentId )
-            {
-            CleanupStack::PopAndDestroy( 2, contentId ); // contentId, contIdUri
-            }
-
-        }
-    CleanupStack::PopAndDestroy( 2, url8bit ); // decodedUri, url8bit
-    return att;
-    }
-
-// ---------------------------------------------------------
-// CUniObjectList::ObjectByteSize
-// ---------------------------------------------------------
-//
-TInt CUniObjectList::ObjectByteSize() const
-    {
-    TInt byteSize(0);
-    TInt i = iObjectArray->Count();
-    while ( i-- )
-        {
-        byteSize += iObjectArray->At( i )->Size();
-        }
-
-    return byteSize;
-    }
-
-// ---------------------------------------------------------
-// CUniObjectList::SetListObserver
-// ---------------------------------------------------------
-//
-void CUniObjectList::SetListObserver( MUniObjectListObserver* aObserver )
-    {
-    iListObserver = aObserver;
-    }
-
-// ---------------------------------------------------------
-// CUniObjectList::GetObjectByUniqueHandle
-// ---------------------------------------------------------
-//
-CUniObject* CUniObjectList::GetObjectByUniqueHandle( TInt aUniqueControlHandle )
-    {
-    for ( TInt index = 0; index < iObjectArray->Count(); index++ )
-        {
-        CUniObject* current = iObjectArray->At( index );
-        if( current->UniqueControlHandle() == aUniqueControlHandle )
-            {
-            return current;
-            }
-        }
-    return NULL;
-    }
-
-// ---------------------------------------------------------
-// CUniObjectList::ConstructL
-//
-// 2nd phase constructor.
-// ---------------------------------------------------------
-//
-void CUniObjectList::ConstructL()
-    {
-    iObjectArray = new(ELeave)CArrayPtrFlat<CUniObject>( KObjectArrayGranularity );
-    }
-
-// ---------------------------------------------------------
-// CUniObjectList::ObjectSaveReady
-//
-// ---------------------------------------------------------
-//
-void CUniObjectList::ObjectSaveReady( TInt aError )
-    {
-    if ( aError )
-        {
-        iSaveObserver->ObjectSaveReady( aError );
-        }
-    else
-        {
-        iSaveCount++;
-        if ( iSaveCount < iObjectArray->Count() )
-            {
-            iObjectArray->At( iSaveCount )->Save( *this, iSaveType );
-            }
-        else
-            {
-            iSaveObserver->ObjectSaveReady( KErrNone );
-            }
-        }
-    }
-
-// EOF
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/UniSmilList.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,295 +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: 
-*       CUniSmilList, List of attachments.
-*
-*
-*/
-
-
-// ========== INCLUDE FILES ================================
-
-#include <e32std.h>
-#include <e32def.h>     // for basic types
-#include <eikenv.h>     // for CBase
-#include <mtclbase.h>   // for CBaseMtm
-#include <msvstd.h>     // for TMsvId
-#include <msvids.h>     // for KMsvTempIndexEntryId
-#include <msvstore.h>
-#include <mmsvattachmentmanager.h>
-#include <mmsvattachmentmanagersync.h>
-#include <cmsvattachment.h>
-#include <cmsvmimeheaders.h>
-
-#include "msgtextutils.h"
-#include "UniSmilList.h"
-#include "MsgMimeTypes.h"
-#include "MuiuOperationWait.h"
-
-// ========== EXTERNAL DATA STRUCTURES =====================
-
-// ========== EXTERNAL FUNCTION PROTOTYPES =================
-
-// ========== CONSTANTS ====================================
-
-// ========== MACROS =======================================
-
-// ========== LOCAL CONSTANTS AND MACROS ===================
-
-_LIT16( KPresentationFileName, "pres.smil" );
-
-// ========== MODULE DATA STRUCTURES =======================
-
-// ========== LOCAL FUNCTION PROTOTYPES ====================
-
-// ========== LOCAL FUNCTIONS ==============================
-
-// ========== MEMBER FUNCTIONS =============================
-
-// ---------------------------------------------------------
-// CUniSmilList::NewLC
-//
-// Factory method.
-// ---------------------------------------------------------
-//
-CUniSmilList* CUniSmilList::NewL( CBaseMtm& aMtm )
-    {
-    CUniSmilList* self = new(ELeave) CUniSmilList( aMtm );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-
-// ---------------------------------------------------------
-// CUniSmilList::CUniSmilList
-//
-// Constructor.
-// ---------------------------------------------------------
-//
-CUniSmilList::CUniSmilList( CBaseMtm& aMtm ) :
-    CActive( EPriorityStandard ),
-    iMtm( aMtm ),
-    iSmilAttachmentArray( NULL )
-    {
-    CActiveScheduler::Add( this );
-    }
-
-
-// ---------------------------------------------------------
-// CUniSmilList::CUniSmilList
-//
-// Destructor.
-// ---------------------------------------------------------
-//
-CUniSmilList::~CUniSmilList()
-    {
-    Cancel();
-
-    delete iSmilAttachmentArray;
-    delete iComposer;
-
-    if ( iEditFile )
-        {
-        iEditFile->Close();
-        delete iEditFile;
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniSmilList::AddSmilAttachmentL
-//
-// Add SMIL attachment
-// ---------------------------------------------------------
-//
-void CUniSmilList::AddSmilAttachmentL(
-    MMsvAttachmentManager& aManager,
-    TMsvAttachmentId aAttachmentId )
-    {
-    RFile file = aManager.GetAttachmentFileL( aAttachmentId );
-    CleanupClosePushL( file );
-    TInt size( 0 );
-    User::LeaveIfError( file.Size( size ) );
-    CleanupStack::PopAndDestroy( &file );
-    iSmilAttachmentArray->AppendL( aAttachmentId );
-    iSmilSize += size;
-    }
-
-// ---------------------------------------------------------
-// CUniSmilList::CreateSmilAttachmentL
-//
-// Create SMIL from DOM
-// ---------------------------------------------------------
-//
-void CUniSmilList::CreateSmilAttachmentL(
-        MUniSmilComposeObserver& aObserver,
-        CMsvStore& aEditStore,
-        CMDXMLDocument* aDom )
-    {
-    iDom = aDom;
-    iObserver = &aObserver;
-    //iSmilAttaId = KMsvNullIndexEntryId;
-    //iSmilAttaFullpath.Zero();
-
-    iManager = &( aEditStore.AttachmentManagerL() );
-    CMsvAttachment* attachment = CMsvAttachment::NewL( CMsvAttachment::EMsvFile );
-    CleanupStack::PushL( attachment );
-
-    //TODO: Set size(?) & complete flag(?)
-    //attachment->SetSize()
-    //attachment->SetComplete( EFalse );
-
-    iEditFile = new ( ELeave ) RFile;
-    CMuiuOperationWait* wait = CMuiuOperationWait::NewLC();
-    iManager->CreateAttachmentL( KPresentationFileName, *iEditFile, attachment, wait->iStatus );
-    wait->Start();
-    //manager.AddAttachmentL( aPath, attachment, iStatus );
-    CleanupStack::PopAndDestroy( wait );	
-
-    CleanupStack::Pop( attachment );
-    iAttachment = attachment;
-
-    //Do self complete to trigger runL 
-    RunL();
-    }
-
-// ---------------------------------------------------------
-// CUniSmilList::GetSmilAttachmentByIndex
-//
-// GetSmilAttachmentByIndex.
-// ---------------------------------------------------------
-//
-TMsvAttachmentId CUniSmilList::GetSmilAttachmentByIndex( TInt aIndex )
-    {
-    if ( aIndex < 0 || aIndex >= iSmilAttachmentArray->Count() )
-        {
-        return KMsvNullIndexEntryId;
-        }
-    return iSmilAttachmentArray->At( aIndex );
-    }
-
-// ---------------------------------------------------------
-// CUniSmilList::GetSmilFullPathByIndex
-//
-// GetSmilFullPathByIndex.
-// ---------------------------------------------------------
-//
-RFile CUniSmilList::GetSmilFileByIndexL(
-    TInt aIndex )
-    {
-    if ( aIndex < 0 || aIndex >= iSmilAttachmentArray->Count() )
-        {
-        User::Leave( KErrArgument );
-        }
-    CMsvStore* store = iMtm.Entry().ReadStoreL();
-    CleanupStack::PushL( store );
-    MMsvAttachmentManager& manager = store->AttachmentManagerL();
-    RFile file = manager.GetAttachmentFileL( iSmilAttachmentArray->At( aIndex ) );
-    CleanupStack::PopAndDestroy( store );
-    return file;
-    }
-
-// ---------------------------------------------------------
-// CUniSmilList::ConstructL
-//
-// 2nd phase constructor.
-// ---------------------------------------------------------
-//
-void CUniSmilList::ConstructL()
-    {
-    iSmilAttachmentArray = new ( ELeave ) CArrayFixFlat<TMsvAttachmentId>( 2 );
-    }
-
-// ---------------------------------------------------------
-// CUniSmilList::ComposeFileCompleteL
-// ---------------------------------------------------------
-//
-void CUniSmilList::ComposeFileCompleteL()
-    {
-    CMsvMimeHeaders* msvMime = CMsvMimeHeaders::NewLC();
-
-    TInt slash = KMsgMimeSmil().Locate( '/' );
-    msvMime->SetSuggestedFilenameL( KPresentationFileName );
-    msvMime->SetContentTypeL( KMsgMimeSmil().Left( slash ) );
-    msvMime->SetContentSubTypeL( KMsgMimeSmil().Mid( slash + 1 ) );
-    msvMime->SetMimeCharset( KCharacterSetMIBEnumUtf8 );
-    msvMime->StoreL( *iAttachment );
-    CleanupStack::PopAndDestroy( msvMime );
-
-    iAttachment->SetMimeTypeL( KMsgMimeSmil );
-    // TODO: iEditFile is already closed? How to get the file size?
-    //iAttachment->SetSize( 0 );
-    TMsvAttachmentId smilId = iAttachment->Id();
-    AddSmilAttachmentL( *iManager, smilId );
-
-    // TODO: Cleanup attachment in some cases?
-    //       -> Just do use Revert() instead of CommitL()?
-    iManager = NULL;
-    iAttachment = NULL;
-
-    iObserver->SmilComposeEvent( KErrNone );
-    
-    if ( iObjWait.IsStarted() )
-    {
-    iObjWait.AsyncStop();
-    }    
-
-    }
-
-// ---------------------------------------------------------
-// CUniSmilList::DoCancel
-//
-// ---------------------------------------------------------
-//
-void CUniSmilList::DoCancel()
-    {
-    if ( iManager )
-        {
-        iManager->CancelRequest();
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniSmilList::RunL
-//
-// ---------------------------------------------------------
-//
-void CUniSmilList::RunL()
-    {
-    if ( !iComposer )
-        {
-        iComposer = CMDXMLComposer::NewL( this, EFalse );
-        }
-    iComposer->ComposeFile( *iEditFile, iDom, EAscii );
-    if( !iObjWait.IsStarted() )
-    {
-    iObjWait.Start();
-    }
-    delete iEditFile;
-    iEditFile = NULL; // Ownership transferred.
-    }
-
-// ---------------------------------------------------------
-// CUniSmilList::RunError
-//
-// ---------------------------------------------------------
-//
-TInt CUniSmilList::RunError( TInt /*aError*/ )
-    {
-    return KErrNone;
-    }
-
-
-
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/UniSmilModel.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2575 +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: 
-*       CUniSmilModel, Storage for Smil presentation data.
-*
-*
-*/
-
-
-// ========== INCLUDE FILES ================================
-
-
-#include <e32def.h>
-#include <eikenv.h>
-#include <eikfutil.h>               // CopyFile
-
-#include <mtclbase.h>   // for CBaseMtm
-#include <msvstd.h>     // for TMsvId
-#include <msvids.h>     // for KMsvTempIndexEntryId
-#include <msvstore.h>
-#include <mmsvattachmentmanager.h>
-#include <mmsvattachmentmanagersync.h>
-#include <cmsvattachment.h>
-
-#include <bautils.h>                // NearestLanguageFile
-
-#include <coemain.h>
-
-// LAF
-/*
-#include <AknUtils.h>
-#include <AknLayoutScalable_Avkon.cdl.h>
-#include <AknLayoutScalable_Apps.cdl.h>
-#include <LayoutMetadata.cdl.h>
-*/
-
-// DOM
-#include <gmxmldocument.h>
-#include <gmxmlnode.h>
-#include <gmxmlelement.h>
-
-// MsgMedia
-#include <MsgMedia.hrh>
-#include <MsgMediaInfo.h>
-#include <MmsConformance.h>
-#include <mmsversion.h>
-#include <MsgTextInfo.h>
-
-
-// MsgDataUTILS
-#include <UniDataModel.rsg>         // Viewer/Editor Mimetype strings
-#include "UniModelConst.h"              // Definitions and enums
-#include "UniDataUtils.h"
-#include "UniSmilSlide.h"
-#include "UniSmilModel.h"
-#include "UniObjectList.h"
-#include "UniObject.h"
-#include "UniTextObject.h"
-#include "UniMimeInfo.h"
-#include "UniSmilUtils.h"
-#include "UniSmilParams.h"
-
-#include "fileprotectionresolver.h"     //     EFileProtDrm2
-#include "MsgMimeTypes.h"
-
-// Logging
-//#include "//MsgDataUTILSLOGGing.h"
-
-
-// ========== EXTERNAL DATA STRUCTURES =====================
-
-// ========== EXTERNAL FUNCTION PROTOTYPES =================
-
-// ========== CONSTANTS ====================================
-
-// ========== MACROS =======================================
-
-// ========== LOCAL CONSTANTS AND MACROS ===================
-
-_LIT( KSmilIntFormat, "%d" );
-_LIT( KSmilMsecFormat, "%dms" );
-const TUint KSlideArrayGranularity( 16 );
-
-// SMIL size estimates
-const TInt KSizeMandatorySmilTags = 148;
-const TInt KSizeHeadOneRegion = 85;
-const TInt KSizeHeadTwoRegions = 170;
-const TInt KSizeEmptyPar = 27;
-const TInt KSizeNonEmptyPar = 41;
-const TInt KSizeAudioTag = 38;
-const TInt KSizeImageTag = 52;
-const TInt KSizeTextTag = 51;
-const TInt KSizeVideoTag = 53;
-
-const TInt KSizeLowResHeight = 208;
-const TInt KSizeLowResWidth = 176;
-
-// ========== MODULE DATA STRUCTURES =======================
-
-// ========== LOCAL FUNCTION PROTOTYPES ====================
-
-// ========== LOCAL FUNCTIONS ==============================
-
-// ========== MEMBER FUNCTIONS =============================
-
-
-// ---------------------------------------------------------
-// CUniSmilModel::NewL
-//
-// Factory method.
-// ---------------------------------------------------------
-//
-CUniSmilModel* CUniSmilModel::NewLC( RFs& aFs,
-                                             CBaseMtm& aMtm,
-                                             CUniDataUtils& aData,
-                                             CUniObjectList& aObjectList )
-    {
-    CUniSmilModel* self = new ( ELeave )
-        CUniSmilModel( aFs, aMtm, aData, aObjectList );
-
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    return self;
-    }
-
-
-// ---------------------------------------------------------
-// CUniSmilModel::NewL
-//
-// Factory method.
-// ---------------------------------------------------------
-//
-CUniSmilModel* CUniSmilModel::NewL( RFs& aFs,
-                                            CBaseMtm& aMtm,
-                                            CUniDataUtils& aData,
-                                            CUniObjectList& aObjectList )
-    {
-    CUniSmilModel* self = NewLC( aFs, aMtm, aData, aObjectList );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-
-// ---------------------------------------------------------
-// CUniSmilModel::CUniSmilModel
-//
-// Constructor.
-// ---------------------------------------------------------
-//
-CUniSmilModel::CUniSmilModel( RFs& aFs,
-                             CBaseMtm& aMtm,
-                             CUniDataUtils& aData,
-                             CUniObjectList& aObjectList ) :
-    iFs( aFs ),
-    iMtm( aMtm ),
-    iData( aData ),
-    iObjectList( aObjectList ),
-    iSlideLayout( EUniUndefinedLayout ),
-    iSmilParams( 0 ),
-    iScreenSize( 0, 0 ),
-    iSizeEstimateUpToDate( EFalse ),
-    iSizeEstimate( 0 )
-    {
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::~CUniSmilModel
-//
-// Destructor.
-// ---------------------------------------------------------
-//
-CUniSmilModel::~CUniSmilModel()
-    {
-    if (iSlideArray)
-        {
-        iSlideArray->ResetAndDestroy();
-        }
-    delete iSlideArray;
-    delete iSmilParams;
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::ParseL
-//
-// ---------------------------------------------------------
-//
-TInt CUniSmilModel::ParseL( CMDXMLDocument* aDom )
-    {
-    //MsgDataUTILSLOGGER_ENTERFN( "CUniSmilModel::ParseL()" );
-
-    Reset();
-
-    if ( aDom )
-        {
-        TRAPD( error, DoPresentationFromDomL( aDom ) );
-        if ( error )
-            {
-            Reset();
-            User::Leave( error );
-            }
-        else
-            {
-            iParseResult |= EParsedFromSmil;
-            }
-        }
-    else
-        {
-        //  No SMIL -> Do presentation from object list
-        if ( IsMessageSlide() )
-            {
-            // Determine layout. Make slide.
-            DoNoSmilOneSlideL();
-            }
-        else
-            {
-            // Do slide for each media object
-            DoNoSmilManySlideL();
-            }
-        iParseResult |= EParsedFromList;
-        }
-
-    return iParseResult;
-    }
-
-
-//**********************************************************
-//*
-//* SMIL COMPOSING FUNCTIONS
-//*
-//**********************************************************
-
-
-// ---------------------------------------------------------
-// CUniSmilModel::¨ComposeL
-//
-// ---------------------------------------------------------
-//
-CMDXMLDocument* CUniSmilModel::ComposeL()
-    {
-    //MsgDataUTILSLOGGER_ENTERFN( "CUniSmilModel::ComposeL()" );
-
-    // Reset region id's
-    iTextRegionId.Set( KNullDesC );
-    iImageRegionId.Set( KNullDesC );
-
-    // Read default smil parameters
-    if( !iSmilParams )
-        {
-        //MsgDataUTILSLOGGER_WRITE( "CUniSmilModel: Creating smil parameter structures." );
-        iSmilParams = CUniSmilParams::NewL( iFs );
-        }
-
-    //MsgDataUTILSLOGGER_WRITE( "CUniSmilModel: Creating new DOM." );
-    //delete iDom;
-    //iDom = 0;
-    CMDXMLDocument* dom = CMDXMLDocument::NewLC();
-
-    // Create smil node
-    TPtrC name( KSMILWREleSmil );
-    CMDXMLElement* root = CMDXMLElement::NewLC( ETrue, dom, name );
-    // Append
-    dom->DocumentElement()->AppendChild( root ); // Ownership to dom
-    CleanupStack::Pop( root );
-
-    // Create Head
-    CreateHeadL( dom, root );
-
-    // Create Body
-    CreateBodyL( dom, root );
-
-    // TODO: Move to Document and to use smil list
-    //iObjectList.CreateSmilAttachmentL( smilAttaId, iDom, iFs );
-    CleanupStack::Pop( dom );
-    return dom;
-    }
-
-
-
-// ---------------------------------------------------------
-// CUniSmilModel::RemoveEmptySlides
-//
-//
-// ---------------------------------------------------------
-//
-void CUniSmilModel::RemoveEmptySlides()
-    {
-    TInt count = iSlideArray->Count();
-    // Must be done from end to beginning because
-    // slides might be removed.
-    while ( count-- )
-        {
-        if ( !iSlideArray->At( count )->ObjectCount() )
-            {
-            RemoveSlide( count );
-            }
-        }
-    }
-
-
-// ---------------------------------------------------------
-// CUniSmilModel::AddSlideL
-//
-//
-// ---------------------------------------------------------
-//
-void CUniSmilModel::AddSlideL( TInt aSlideNum )
-    {
-    DoAddSlideL( aSlideNum );
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::RemoveSlide
-//
-//
-// ---------------------------------------------------------
-//
-void CUniSmilModel::RemoveSlide( TInt aSlideNum )
-    {
-    if ( !IsSlide( aSlideNum ) )
-        {
-        //__ASSERT_DEBUG( EFalse, DataUtilsPanic( EMmsNotASlide ) );
-        return;
-        }
-    CUniSmilSlide* slide = iSlideArray->At( aSlideNum );
-    if ( slide->ObjectCount() )
-        {
-        //__ASSERT_DEBUG( EFalse, DataUtilsPanic( EMmsSlideNotEmpty ) );
-        return;
-        }
-
-    iSlideArray->Delete( aSlideNum );
-    delete slide;
-    //MsgDataUTILSLOGGER_WRITE( "CUniSmilModel: Empty slide removed." );
-    iSizeEstimateUpToDate = EFalse;
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::MoveSlideL
-//
-//
-// ---------------------------------------------------------
-//
-void CUniSmilModel::MoveSlideL( TInt aSlideToMove, TInt aPlaceToMove )
-    {
-    TInt slideCount = iSlideArray->Count();
-    if ( !slideCount
-        || aSlideToMove < 0
-        || aSlideToMove >= slideCount
-        || aSlideToMove == aPlaceToMove )
-        {
-        return;
-        }
-    TInt place = Min( Max( 0, aPlaceToMove ), slideCount - 1 );
-    CUniSmilSlide* slide = iSlideArray->At( aSlideToMove );
-
-    iSlideArray->Delete( aSlideToMove );
-    iSlideArray->InsertL( place, slide );
-    iSizeEstimateUpToDate = EFalse;
-    }
-
-// ---------------------------------------------------------
-// SortSlidesL
-//
-// Sorts slides accoring to a separate comparison function
-// called SortSlidesCompare().
-//
-// Insertion sort algorithm.
-//
-// Notice! Intended to be used with SendAs when there
-// are multiple slides - each slide containing only
-// one object
-// ---------------------------------------------------------
-void CUniSmilModel::SortSlidesL()
-    {
-    TInt i = 1; // index 1, i.e. second slide
-    TInt count = SlideCount();
-    while ( i < count )
-        {
-        CUniSmilSlide* slide1 = iSlideArray->At( i );
-        TInt j = i - 1;
-        while ( j >= 0 )
-            {
-            CUniSmilSlide* slide2 = iSlideArray->At( j );
-            if ( SortSlidesCompare( slide1, slide2 ) > 0 )
-                {
-                break;
-                }
-            j--;
-            }
-        j++;
-        if ( j < i )
-            {
-            // slide1 was not in the right place
-            iSlideArray->Delete( i );
-            iSlideArray->InsertL( j, slide1 );
-            }
-        i++;
-        }
-    iSizeEstimateUpToDate = EFalse;
-    }
-
-
-// ---------------------------------------------------------
-// SortSlidesCompare
-//
-// Compares slides according to time. Most recent is greatest.
-//
-// Empty slides are greater than non-empty slides.
-// If aSlide1 "is greater than" aSlide2 returns positive value.
-// If aSlide1 "is smaller than" aSlide2 returns negative value.
-// If aSlide1 and aSlide2 "are equal" returns zero.
-// ---------------------------------------------------------
-//
-TInt CUniSmilModel::SortSlidesCompare( CUniSmilSlide* aSlide1,
-                                      CUniSmilSlide* aSlide2 )
-    {
-    if ( !aSlide1->ObjectCount() )
-        {
-        //if both are empty returns 0
-        //if slide2 is non-empty -> slide1 "is greater"
-        return aSlide2->ObjectCount();
-        }
-    else if ( !aSlide2->ObjectCount() )
-        {
-        //empty slide is always "greatest"
-        return -1;
-        }
-    else
-        {
-        TTime time1;
-        TTime time2;
-        aSlide1->GetObjectByIndex( 0 )->MediaInfo()->ModificationTime( time1 );
-        aSlide2->GetObjectByIndex( 0 )->MediaInfo()->ModificationTime( time2 );
-        if ( time1 < time2 )
-            {
-            return -1;
-            }
-        else if ( time1 == time2 )
-            {
-            return 0;
-            }
-        else
-            {
-            return 1;
-            }
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::IsSlide
-//
-//
-// ---------------------------------------------------------
-//
-TBool CUniSmilModel::IsSlide( TInt aSlideNum ) const
-    {
-    if( aSlideNum >= 0 &&
-        aSlideNum < iSlideArray->Count() )
-        {
-        return ETrue;
-        }
-    return EFalse;
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::AddTextObjectL
-//
-// ---------------------------------------------------------
-//
-CUniTextObject* CUniSmilModel::AddTextObjectL(
-    TInt aSlideNum,
-    CEikRichTextEditor* aText )
-    {
-    CUniTextObject* obj = CUniTextObject::NewLC( iFs, iMtm, iData, aText );
-    iObjectList.AddObjectL( obj );
-    CleanupStack::Pop( obj );
-    iSlideArray->At(aSlideNum)->AddObjectL( obj );
-    iSizeEstimateUpToDate = EFalse;
-    return obj;
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::AddTempObjectL
-//
-// ---------------------------------------------------------
-//
-/*
-CUniObject* CUniSmilModel::AddTempObjectL( TInt aSlideNum,
-                                            CMsgMediaInfo* aMedia )
-    {
-    if ( !IsSlide( aSlideNum ) )
-        {
-        User::Leave( KErrArgument );
-        }
-
-    CUniObject* obj = CUniObject::NewLC( iFs, iMtm, iData, aMedia );
-
-    // Update model
-    iObjectList.AddObjectL( obj );
-    CleanupStack::Pop( obj );
-    iSlideArray->At( aSlideNum )->AddObjectL( obj );
-    SetLayoutFromObjectTypeL( obj->MediaType() );
-    iSizeEstimateUpToDate = EFalse;
-    return obj;
-    }
-*/
-
-// ---------------------------------------------------------
-// CUniSmilModel::AddObjectL
-//
-// ---------------------------------------------------------
-//
-CUniObject* CUniSmilModel::AddObjectL( MUniObjectSaveObserver& aObserver,
-                                               TInt aSlideNum,
-                                               CMsgMediaInfo* aMedia )
-    {
-    if ( !IsSlide( aSlideNum ) )
-        {
-        User::Leave( KErrArgument );
-        }
-
-    CUniObject* obj = CUniObject::NewLC( iFs, iMtm, iData, aMedia );
-
-    // Update model
-    iObjectList.AddObjectL( obj );
-    CleanupStack::Pop( obj );
-    obj->Save( aObserver, CMsvAttachment::EMsvLinkedFile );
-    iSlideArray->At(aSlideNum)->AddObjectL( obj );
-    iSizeEstimateUpToDate = EFalse;
-    return obj;
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::AddStoredObjectL
-//
-// ---------------------------------------------------------
-//
-CUniObject* CUniSmilModel::AddStoredObjectL( TInt aSlideNum,
-                                                     TMsvAttachmentId aAttachmentId,
-                                                     CMsgMediaInfo* aMedia )
-    {
-    if ( !IsSlide( aSlideNum ) )
-        {
-        User::Leave( KErrArgument );
-        }
-
-    CMsvStore* store = iMtm.Entry().EditStoreL();
-    CleanupStack::PushL( store );
-    MMsvAttachmentManager& manager = store->AttachmentManagerL();
-    MMsvAttachmentManagerSync& managerSync = store->AttachmentManagerExtensionsL();
-    CMsvAttachment* attachment = manager.GetAttachmentInfoL( aAttachmentId );
-    CleanupStack::PushL( attachment );
-
-    CUniObject* obj = NULL;
-
-    if ( aMedia &&
-         aMedia->MediaType() == EMsgMediaText )
-        {
-        CMsgTextInfo* textInfo = static_cast<CMsgTextInfo*>( aMedia );
-        obj = CUniTextObject::NewLC( iFs, iMtm, iData, textInfo, manager, *attachment );
-        }
-    else
-        {
-        obj = CUniObject::NewLC( iFs, iMtm, iData, aMedia, manager, *attachment );
-        }
-    managerSync.ModifyAttachmentInfoL( attachment );
-    CleanupStack::Pop( 2, attachment ); //obj, attachment
-    CleanupStack::PushL( obj );
-    store->CommitL();
-
-    // Update model
-    iObjectList.AddObjectL( obj );
-    CleanupStack::Pop( obj );
-    CleanupStack::PopAndDestroy( store );
-    iSlideArray->At(aSlideNum)->AddObjectL( obj );
-    iSizeEstimateUpToDate = EFalse;
-    return obj;
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::RemoveObjectL
-//
-//
-// ---------------------------------------------------------
-//
-void CUniSmilModel::RemoveObjectL( TInt aSlideNum,
-                                            CUniObject* aObject,
-                                            TBool aLeaveToStore/* = EFalse*/ )
-    {
-    if ( !IsSlide( aSlideNum ) ||
-        !iSlideArray->At( aSlideNum )->IsObject( aObject ) )
-        {
-        return;
-        }
-    // TODO: Check that object exists on the slide.
-
-    //if ( !IsObject( aSlideNum, aObjectType ) )
-    //    {
-    //    return;
-    //    }
-    DoRemoveObjectL( aSlideNum, aObject, aLeaveToStore );
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::RemoveObjectByIndexL
-//
-//
-// ---------------------------------------------------------
-//
-void CUniSmilModel::RemoveObjectByIndexL( TInt aSlideNum, TInt aObjectNum )
-    {
-    if ( !IsSlide( aSlideNum ) )
-        {
-        return;
-        }
-    CUniObject* obj = iSlideArray->At( aSlideNum )->GetObjectByIndex( aObjectNum );
-    DoRemoveObjectL( aSlideNum, obj );
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::DoRemoveObjectL
-//
-//
-// ---------------------------------------------------------
-//
-void CUniSmilModel::DoRemoveObjectL( TInt aSlideNum, CUniObject* aObject, TBool aLeaveToStore/* = EFalse*/ )
-    {
-    //MsgDataUTILSLOGGER_ENTERFN( "CUniSmilModel : DoRemoveObjectL()" );
-
-    TBool removeObj = ( aObject->ReferenceCount() - 1 <= 0 );
-    //if last reference was (will be) removed, remove from
-    //attachment list (and msg store)
-    if ( removeObj )
-        {
-        //MsgDataUTILSLOGGER_WRITE( "CUniSmilModel: Removing from atta list and store." );
-        iObjectList.RemoveObjectL( aObject, !aLeaveToStore );
-        }
-
-    CUniSmilSlide* slide = iSlideArray->At( aSlideNum );
-    slide->RemoveObject( aObject );
-    iSizeEstimateUpToDate = EFalse;
-
-    if ( removeObj )
-        {
-        delete aObject;
-        }
-
-    //MsgDataUTILSLOGGER_LEAVEFN( "CUniSmilModel : DoRemoveObjectL()" );
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::GetObject
-//
-//
-// ---------------------------------------------------------
-//
-CUniObject* CUniSmilModel::GetObjectByIndex( TInt aSlideNum,
-                                                     TInt aObjectNum ) const
-    {
-    if( !IsSlide( aSlideNum ) )
-        {
-        return NULL;
-        }
-    return iSlideArray->At( aSlideNum )->GetObjectByIndex( aObjectNum );
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::GetObject
-//
-//
-// ---------------------------------------------------------
-//
-CUniObject* CUniSmilModel::GetObject( TInt aSlideNum,
-                                              TUniRegion aRegion ) const
-    {
-    if( !IsSlide( aSlideNum ) )
-        {
-        return NULL;
-        }
-    return iSlideArray->At( aSlideNum )->GetObject( aRegion );
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::SetLayoutL
-//
-// Mutator.
-// ---------------------------------------------------------
-//
-void CUniSmilModel::SetLayoutL( TUniLayout aNewLayout )
-    {
-    iSlideLayout = aNewLayout;
-    TUint slideCnt = iSlideArray->Count();
-    for (TUint i = 0; i < slideCnt; i++ )
-        {
-        iSlideArray->At(i)->UpdateLayoutL( iSlideLayout );
-        }
-    iSizeEstimateUpToDate = EFalse;
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::SmilComposeSize()
-//
-// Total size
-// ---------------------------------------------------------
-//
-TInt CUniSmilModel::SmilComposeSize()
-    {
-    TInt slideCount = iSlideArray->Count();
-    if ( !slideCount )
-        {
-        return 0;
-        }
-    if ( !iSizeEstimateUpToDate )
-        {
-        iSizeEstimate = SmilComposeSize(
-            slideCount,
-            iSlideArray->At( slideCount - 1 )->ObjectCount() );
-        iSizeEstimateUpToDate = ETrue;
-        }
-    return iSizeEstimate;
-    }
-
-
-// ---------------------------------------------------------
-// CUniSmilModel::SmilComposeSize()
-//
-// Size from beginning
-// ---------------------------------------------------------
-//
-TInt CUniSmilModel::SmilComposeSize( TInt aToSlideNum, TInt aToObjectNum )
-    {
-    //__ASSERT_DEBUG(
-    //    ( aToSlideNum > 0 && aToSlideNum <= iSlideArray->Count() ),
-    //    DataUtilsPanic( EMmsIllegalSlide ) );
-    //__ASSERT_DEBUG(
-    //    ( aToObjectNum <= iSlideArray->At( aToSlideNum - 1 )->ObjectCount() ),
-    //    DataUtilsPanic( EMmsIllegalObject ) );
-
-    TInt size( KSizeMandatorySmilTags );
-    TBool imageRegion = EFalse;
-    TBool textRegion = EFalse;
-
-    for ( TInt i = 0; i < aToSlideNum; i++ )
-        {
-        CUniSmilSlide* slide = iSlideArray->At( i );
-        TInt toObj = slide->ObjectCount();
-        if ( i == aToSlideNum - 1 )
-            {
-            toObj = aToObjectNum;
-            }
-        if ( !toObj )
-            {
-            //No objects on the slide
-            size += KSizeEmptyPar;
-            }
-        else
-            {
-            //One or more objects
-            size += KSizeNonEmptyPar;
-            }
-        for ( TInt ii = 0; ii < toObj; ii++ )
-            {
-            CUniObject* obj = slide->GetObjectByIndex( ii );
-            switch ( obj->MediaType() )
-                {
-                case EMsgMediaAudio:
-                    size += KSizeAudioTag;
-                    break;
-                case EMsgMediaImage:
-                case EMsgMediaSvg:
-                    size += KSizeImageTag;
-                    imageRegion = ETrue;
-                    break;
-                case EMsgMediaText:
-                case EMsgMediaXhtml:
-                    size += KSizeTextTag;
-                    textRegion = ETrue;
-                    break;
-                case EMsgMediaVideo:
-                    size += KSizeVideoTag;
-                    imageRegion = ETrue;
-                    break;
-                default:
-                    //Should never come here
-                    //Don't increase size
-                    break;
-                }
-            }
-        }
-
-    TInt regions = 0;
-    if ( imageRegion )
-        {
-        regions++;
-        }
-    if ( textRegion )
-        {
-        regions++;
-        }
-    switch ( regions )
-        {
-        case 1:
-            size += KSizeHeadOneRegion;
-            break;
-        case 2:
-            size += KSizeHeadTwoRegions;
-            break;
-        default:
-            //Should be zero
-            //Don't increase size
-            break;
-        }
-    return size;
-    }
-
-
-// ---------------------------------------------------------
-// CUniSmilModel::ObjectCount
-//
-// Accessor
-// ---------------------------------------------------------
-//
-TInt CUniSmilModel::ObjectCount() const
-    {
-    TInt objCnt(0);
-
-    for ( TInt i = iSlideArray->Count(); --i >= 0 ;)
-        {
-        objCnt += iSlideArray->At(i)->ObjectCount();
-        }
-
-    return objCnt;
-    }
-
-
-// ---------------------------------------------------------
-// CUniSmilModel::SlideObjectCount
-//
-// Accessor
-// ---------------------------------------------------------
-//
-TInt CUniSmilModel::SlideObjectCount(TInt aSlideNum) const
-    {
-    if ( !IsSlide(aSlideNum) )
-        {
-        return 0;
-        }
-
-    return iSlideArray->At( aSlideNum )->ObjectCount();
-    }
-
-//**********************************************************
-//*
-//* CONTRUCTION FUNCTIONS
-//*
-//**********************************************************
-
-
-// ---------------------------------------------------------
-// CUniSmilModel::ConstructL
-//
-// 2nd phase constructor.
-// ---------------------------------------------------------
-//
-void CUniSmilModel::ConstructL()
-    {
-    iSlideArray = new ( ELeave ) CSmilSlideArray( KSlideArrayGranularity );
-    iTextRegionId.Set( KNullDesC );
-    iImageRegionId.Set( KNullDesC );
-
-    // Set default layout to "Text first"
-    iSlideLayout = EUniTextFirst;
-
-    // Fix for NSIA-6CKFJA. Sets same screen size that SMIL Player is using. MH
-/*
-    TRect appWindowRect;
-    AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EApplicationWindow, appWindowRect );
-
-    TAknLayoutRect mainPane;
-    mainPane.LayoutRect( appWindowRect, AknLayoutScalable_Avkon::main_pane( 0 ) );
-
-    TAknLayoutRect mainSmilPane;
-    mainSmilPane.LayoutRect( mainPane.Rect(), AknLayoutScalable_Apps::main_smil_pane() );
-
-    iScreenSize = mainSmilPane.Rect().Size();
-*/
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::Reset
-//
-//
-// ---------------------------------------------------------
-//
-void CUniSmilModel::Reset()
-    {
-    iParseResult = 0;
-    iSlideLayout = EUniTextFirst;
-    iTextRegionId.Set( KNullDesC );
-    iImageRegionId.Set( KNullDesC );
-    if ( iSlideArray )
-        {
-        // Reset slide array
-        iSlideArray->ResetAndDestroy();
-        }
-    TInt objCount = iObjectList.Count();
-    while ( objCount-- )
-        {
-        iObjectList.GetByIndex( objCount )->SetReferenceCount( 0 );
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::DoPresentationFromDomL
-//
-// When this functios is called DOM should be validated as MMS SMIL.
-// ---------------------------------------------------------
-//
-void CUniSmilModel::DoPresentationFromDomL( CMDXMLDocument* aDom )
-    {
-    RemoveMetaTagsAndComments( aDom );
-    // Resolve layout of the slide
-    iSlideLayout = GetMmsSmilLayout( aDom );
-
-    CMDXMLNode* node = GetNode( aDom, KSMILWREleBody );
-
-    if ( node && node->FirstChild() )
-        {
-        // Only one slide in the message since no <par> tag found
-        if ( node->FirstChild()->NodeName().Compare( KSMILWRElePar ) != 0 )
-            {
-            // Add slide - the one and only
-            AddSlideFromDomL( node );
-            }
-
-        // Other node types than <par> not possible as this is MMS SMIL.
-        else
-            {
-            // Traverse through every page
-            CMDXMLNode* page = node->FirstChild();
-            while ( page )
-                {
-                AddSlideFromDomL( page );
-                // Go to next page.
-                page = page->NextSibling();
-                }
-            }
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::AddSlideFromDomL
-//
-// ---------------------------------------------------------
-//
-void CUniSmilModel::AddSlideFromDomL( CMDXMLNode* aPage )
-    {
-    CUniObject* obj = NULL;
-    CUniSmilSlide* slide = DoAddSlideL();
-    CMDXMLNode* node = aPage->FirstChild();
-
-    // Traverse through every object in page.
-    while ( node )
-        {
-        if ( UniSmilUtils::IsMediaElem( node ) )
-            {
-            obj = iObjectList.GetByNodeL( node );
-            if ( obj )
-                {
-                if ( slide )
-                    {
-                    obj->SetMediaTypeBySmilTag( UniSmilUtils::MediaElemType( node ) );
-                    AddObjectFromDomL(
-                        slide,
-                        obj,
-                        GetRegionType( node ) );
-                    }
-                else
-                    {
-                    iObjectList.RemoveObjectL( obj, ETrue );
-                    delete obj;
-                    iParseResult |= EObjectRemoved;
-                    }
-                }
-            }
-        node = node->NextSibling();
-        }
-    }
-
-
-// ---------------------------------------------------------
-// CUniSmilModel::AddObjectFromDomL
-//
-// ---------------------------------------------------------
-//
-void CUniSmilModel::AddObjectFromDomL( CUniSmilSlide* aSlide,
-                                       CUniObject* aObj,
-                                       TUniRegion aRegion )
-    {
-    if ( !aObj )
-        {
-        // Smil presentation refers to attachment that's not in the message
-        iParseResult |= EMissingObjects;
-        // Not actually error that should prevent message viewing.
-        return;
-        }
-
-    TMsgMediaType mediaBySmilTag = aObj->MediaTypeBySmilTag();
-    TMsgMediaType media = aObj->MediaType();
-
-    if ( media == EMsgMediaSvg )
-        {
-        // SVG considered an image.
-        // (...because "image" tag is used for SVG while composing SMIL.)
-        media = EMsgMediaImage;
-        }
-
-    if ( media == EMsgMediaXhtml )
-        {
-        // XHTML is considered as a text.
-        // (...because "text" tag is used for xhtml while composing SMIL.)
-        media = EMsgMediaText;
-        }
-
-    if ( !( media == EMsgMediaText ||
-        media == EMsgMediaImage ||
-        media == EMsgMediaAudio ||
-        media == EMsgMediaVideo ) )
-        {
-        // Unsupported format
-        //MsgDataUTILSLOGGER_WRITE( "CUniSmilModel: Parsing: Message has unsupported objects." );
-        iParseResult |= EUnsupportedObjects;
-        // Not actually error that should prevent message viewing.
-        }
-
-    //  NOTE: Smil standard allows <img src="aa.txt"> references, but conformance
-    //        Data forbids these.
-    if ( media != EMsgMediaUnknown &&   //Unknown matches anything
-         mediaBySmilTag != EMsgMediaRef &&    //<ref> matches anything
-         media != mediaBySmilTag )
-        {
-        // SMIL does not describe content as it should
-        //MsgDataUTILSLOGGER_WRITE( "CUniSmilModel: Parsing: Smil object type differs from message object type." );
-        iParseResult |= EBadlyReferencedObjects;
-        }
-
-    TUniRegion regionBySmilTag = EUniRegionUnresolved;
-    switch ( mediaBySmilTag )
-        {
-        case EMsgMediaAudio:
-            {
-            regionBySmilTag = EUniRegionAudio;
-            break;
-            }
-        case EMsgMediaImage:
-        case EMsgMediaVideo:
-            {
-            regionBySmilTag = EUniRegionImage;
-            break;
-            }
-        case EMsgMediaText:
-            {
-            regionBySmilTag = EUniRegionText;
-            break;
-            }
-        default:
-            break;
-        }
-
-    TUniRegion regionByMediaType = EUniRegionUnresolved;
-    switch ( media )
-        {
-        case EMsgMediaAudio:
-            {
-            regionByMediaType = EUniRegionAudio;
-            break;
-            }
-        case EMsgMediaImage:
-        case EMsgMediaVideo:
-            {
-            regionByMediaType = EUniRegionImage;
-            break;
-            }
-        case EMsgMediaText:
-            {
-            regionByMediaType = EUniRegionText;
-            break;
-            }
-        default:
-            break;
-        }
-
-    // Check that region type matches object media type
-    if ( aRegion != EUniRegionUnresolved &&
-        regionByMediaType != EUniRegionUnresolved &&
-        aRegion != regionByMediaType )
-        {
-        iParseResult |= ERegionMediaTypeMismatch;
-        aRegion = regionByMediaType;
-        }
-    else if ( regionByMediaType == EUniRegionUnresolved &&
-              aRegion == EUniRegionText )
-        {
-        // do not put every possible content into text reqion
-        iParseResult |= ERegionMediaTypeMismatch;
-        aRegion = EUniRegionUnresolved;
-        }
-    else if ( aRegion == EUniRegionUnresolved )
-        {
-        // If region couldn't be resolved from the region tag
-        // follow the media type. If that's not possible follow
-        // the smil media tag name. If everything fails
-        // "aRegion" will remain "unresolved".
-        aRegion = ( regionByMediaType != EUniRegionUnresolved )
-            ? regionByMediaType
-            : regionBySmilTag;
-        }
-
-    CMsgMediaInfo* mediaInfo = aObj->MediaInfo();
-    // DRM2 must be put into object view in the viewer
-    if ( mediaInfo  &&
-         ( /*mediaInfo->HandlerApplicationUid().iUid == 0 ||*/
-           aObj->MediaInfo()->Protection() & EFileProtDrm2 ) )
-        {
-        aRegion = EUniRegionUnresolved;
-        }
-    // else - should not occur
-
-    if ( aRegion != EUniRegionUnresolved )
-        {
-        aSlide->AddObjectL( aObj, aRegion );
-        iSizeEstimateUpToDate = EFalse;
-        }
-    else
-        {
-        iParseResult |= EBadlyReferencedObjects;
-        // -> Something unknown in the SMIL.
-        // -> Don't add. Will be handled as an attachment.
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::IsMessageSlide
-//
-// ---------------------------------------------------------
-//
-TBool CUniSmilModel::IsMessageSlide()
-    {
-    TInt imageCnt( 0 );
-    TInt audioCnt( 0 );
-    TInt textCnt( 0 );
-
-    for ( TInt i = iObjectList.Count(); --i >= 0 ; )
-        {
-        switch( iObjectList.GetByIndex(i)->MediaType() )
-            {
-            case EMsgMediaSvg:
-            case EMsgMediaImage:
-                imageCnt++;
-                break;
-
-            case EMsgMediaAudio:
-                audioCnt++;
-                break;
-
-            case EMsgMediaText:
-            case EMsgMediaXhtml:
-                textCnt++;
-                break;
-
-            case EMsgMediaVideo:
-                //always consider video as image + audio
-                imageCnt++;
-                audioCnt++;
-                break;
-
-            case EMsgMediaUnknown:
-            default:
-                //  Unsupported objects will be put into attachment list
-                //  in FindAttachmentsL()
-                break;
-            } // switch
-        } // for
-
-    if ( imageCnt > 1 || audioCnt > 1 || textCnt  > 1 )
-        {
-        return EFalse;
-        }
-
-    return ETrue;
-    }
-
-// ---------------------------------------------------------
-// DoNoSmilOneSlideL
-//
-// NOTE: Message should be a valid slide at this point.
-// ---------------------------------------------------------
-//
-void CUniSmilModel::DoNoSmilOneSlideL()
-    {
-    CUniSmilSlide* slide = NULL;
-
-    for ( TInt i = 0; i < iObjectList.Count(); i++ )
-        {
-        CUniObject* obj = iObjectList.GetByIndex(i);
-        TMsgMediaType media = obj->MediaType();
-        CMsgMediaInfo* mediaInfo = obj->MediaInfo();
-
-        // DRM2 must be put into objects view in the viewer
-        if ( ( media == EMsgMediaText ||
-               media == EMsgMediaXhtml ||
-               media == EMsgMediaImage ||
-               media == EMsgMediaSvg ||
-               media == EMsgMediaAudio ||
-               media == EMsgMediaVideo ) &&
-             mediaInfo &&
-             /*mediaInfo->HandlerApplicationUid().iUid &&*/
-             !( obj->MediaInfo()->Protection() & EFileProtDrm2 ) )
-            {
-            if ( !slide )
-                {
-                // Add slide
-                slide = DoAddSlideL();
-                }
-            slide->AddObjectL( obj );
-            }
-        }
-    }
-
-// ---------------------------------------------------------
-// DoNoSmilManySlideL
-//
-//
-// ---------------------------------------------------------
-//
-void CUniSmilModel::DoNoSmilManySlideL()
-    {
-    for ( TInt i = 0; i < iObjectList.Count(); i++ )
-        {
-        CUniObject* obj = iObjectList.GetByIndex(i);
-        TMsgMediaType media = obj->MediaType();
-        CMsgMediaInfo* mediaInfo = obj->MediaInfo();
-
-        // DRM2 must be put into objects view in the viewer
-        if ( ( media == EMsgMediaText ||
-               media == EMsgMediaXhtml ||
-               media == EMsgMediaImage ||
-               media == EMsgMediaSvg ||
-               media == EMsgMediaAudio ||
-               media == EMsgMediaVideo ) &&
-            mediaInfo &&
-            /*mediaInfo->HandlerApplicationUid().iUid &&*/
-             !( obj->MediaInfo()->Protection() & EFileProtDrm2 ) )
-            {
-            CUniSmilSlide* slide = DoAddSlideL();
-            if ( slide )
-                {
-                slide->AddObjectL( obj );
-                }
-            else if ( obj )
-                {
-                iObjectList.RemoveObjectL( obj, ETrue );
-                delete obj;
-                iParseResult |= EObjectRemoved;
-                i--;
-                }
-            }
-        }
-    }
-
-// ---------------------------------------------------------
-// DoAddSlideL
-//
-// ---------------------------------------------------------
-//
-CUniSmilSlide* CUniSmilModel::DoAddSlideL( TInt aSlideNum /*= -1*/ )
-    {
-    CUniSmilSlide* newSlide = NULL;
-    if ( iMaxSlideCount == 0 ||
-         iSlideArray->Count() < iMaxSlideCount )
-        {
-        newSlide = CUniSmilSlide::NewLC( iSlideLayout );
-        if ( aSlideNum == -1 || aSlideNum >= iSlideArray->Count() )
-            {
-            // Add to end of array
-            iSlideArray->AppendL( newSlide );
-            }
-        else
-            {
-            iSlideArray->InsertL( aSlideNum, newSlide );
-            }
-        CleanupStack::Pop( newSlide );  // newSlide
-        iSizeEstimateUpToDate = EFalse;
-        }
-    return newSlide;
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::CreateHeadL
-//
-// ---------------------------------------------------------
-void CUniSmilModel::CreateHeadL( CMDXMLDocument* aDom, CMDXMLElement* aRoot )
-    {
-
-    TPtrC name( KSMILWREleHead );
-    // Create Head node
-    CMDXMLElement* ele = CMDXMLElement::NewLC( ETrue, aDom, name );
-    // Append Head in Root node
-    aRoot->AppendChild( ele );
-
-    // Create Layout
-    CreateLayoutL( aDom, ele );
-    CleanupStack::Pop( ele );
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::ChangeLayoutL
-//
-// ---------------------------------------------------------
-TBool CUniSmilModel::ChangeLayoutL( CMDXMLDocument* aDom )
-    {
-    TBool retVal = EFalse;
-    if ( aDom )
-        {
-        CMDXMLElement* layout = (CMDXMLElement*) GetNode( aDom, KSMILWREleLayout );
-        if ( !layout )
-            {
-            // No layout. Nothing to do without composing
-            // SMIL from scratch.
-            return EFalse;
-            }
-        CMDXMLElement* head = (CMDXMLElement*) layout->ParentNode();
-
-        // Read default smil parameters
-        if( !iSmilParams )
-            {
-            iSmilParams = CUniSmilParams::NewL( iFs );
-            }
-        CMDXMLElement* rootLayout = NULL;
-        CMDXMLElement* textRegion = NULL;
-        CMDXMLElement* imageRegion = NULL;
-
-        GetLayoutElements(
-            layout,
-            rootLayout,
-            textRegion,
-            imageRegion );
-
-        if ( rootLayout )
-            {
-            rootLayout->RemoveAttribute( KSMILWRParaWidth );
-            rootLayout->RemoveAttribute( KSMILWRParaHeight );
-            }
-
-        if ( textRegion )
-            {
-            textRegion->RemoveAttribute( KSMILWRParaFit );
-            textRegion->RemoveAttribute( KSMILWRParaTop );
-            textRegion->RemoveAttribute( KSMILWRParaLeft );
-            textRegion->RemoveAttribute( KSMILWRParaBottom );
-            textRegion->RemoveAttribute( KSMILWRParaRight );
-            textRegion->RemoveAttribute( KSMILWRParaHeight );
-            textRegion->RemoveAttribute( KSMILWRParaWidth );
-            }
-        if ( imageRegion )
-            {
-            imageRegion->RemoveAttribute( KSMILWRParaFit );
-            imageRegion->RemoveAttribute( KSMILWRParaTop );
-            imageRegion->RemoveAttribute( KSMILWRParaLeft );
-            imageRegion->RemoveAttribute( KSMILWRParaBottom );
-            imageRegion->RemoveAttribute( KSMILWRParaRight );
-            imageRegion->RemoveAttribute( KSMILWRParaHeight );
-            imageRegion->RemoveAttribute( KSMILWRParaWidth );
-            }
-
-        CreateLayoutL( aDom, head, rootLayout, layout, textRegion, imageRegion );
-        retVal = ETrue;
-        }
-    return retVal;
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::CorrectTimingL
-//
-// ---------------------------------------------------------
-TBool CUniSmilModel::CorrectTimingL( CMDXMLDocument* aDom )
-    {
-    if ( aDom )
-        {
-        CMDXMLElement* body = static_cast<CMDXMLElement*>( GetNode( aDom, KSMILWREleBody ) );
-        if ( !body )
-            {
-            // No body. Nothing to do without composing
-            // SMIL from scratch.
-            return EFalse;
-            }
-
-        if ( body && body->FirstChild() )
-            {
-            // Only one slide in the message since no <par> tag found
-            if ( body->FirstChild()->NodeName().Compare( KSMILWRElePar ) != 0 &&
-                 !body->FirstChild()->NextSibling() )
-                {
-                // Correct slide timing to the one and only slide
-                CorrectSlideTimingL( body );
-                }
-            // Other node types than <par> not possible as this is MMS SMIL.
-            else
-                {
-                // Traverse through every page
-                CMDXMLNode* page = body->FirstChild();
-
-                while ( page != NULL )
-                    {
-                    if ( page->NodeName().Compare( KSMILWRElePar ) == 0 &&
-                         page->NodeType() == CMDXMLNode::EElementNode )
-                        {
-                        CMDXMLElement* pageElement = static_cast<CMDXMLElement*>( page );
-                        if ( !TimingSpecified( pageElement ) )
-                            {
-                            CorrectSlideTimingL( pageElement );
-                            }
-                        }
-                    // Go to next page.
-                    page = page->NextSibling();
-                    }
-                }
-            }
-        }
-
-    return ETrue;
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::IsSupportedMediaType
-//
-// ---------------------------------------------------------
-TBool CUniSmilModel::IsSupportedMediaType( TMsgMediaType aMediaType ) const
-    {
-    if ( aMediaType == EMsgMediaAudio ||
-         aMediaType == EMsgMediaImage ||
-         aMediaType == EMsgMediaSvg ||
-         aMediaType == EMsgMediaXhtml ||
-         aMediaType == EMsgMediaVideo ||
-         aMediaType == EMsgMediaText )
-        {
-        return ETrue;
-        }
-    else
-        {
-        return EFalse;
-        }
-    }
-
-
-// ---------------------------------------------------------
-// CUniSmilModel::CreateLayoutL
-//
-// ---------------------------------------------------------
-void CUniSmilModel::CreateLayoutL( CMDXMLDocument* aDom,
-                                  CMDXMLElement* aRoot,
-                                  CMDXMLElement* aRootLayout,
-                                  CMDXMLElement* aLayout,
-                                  CMDXMLElement* aTextRegion,
-                                  CMDXMLElement* aImageRegion )
-    {
-
-    TPtrC name( KSMILWREleLayout );
-    // Create Layout node
-    if ( !aLayout )
-        {
-        aLayout = CMDXMLElement::NewLC( ETrue, aDom, name );
-        // Append Layout in Head
-        aRoot->InsertBefore( NULL, aLayout );
-        CleanupStack::Pop(); // layout
-        }
-
-    // Do we have images and text-objects on a slide with other media objects and
-    // do we have any video
-    TInt hasVideo( 0 );
-    TInt hasImage( 0 );
-    TInt hasText( 0 );
-
-    // Do we have media, which is alone on a slide? Also calculate how medias are alone on a slide.
-    // Video overrides any image region, it is not needed
-    TInt hasImageOneAndOnly( 0 );
-    TInt hasTextOneAndOnly( 0 );
-
-    for( TInt i = 0; i < iSlideArray->Count(); i++ )
-        {
-        CUniSmilSlide* s = iSlideArray->At( i );
-        TBool hasVideoOnThisSlide = EFalse;
-        TBool hasImageOnThisSlide = EFalse;
-        TBool hasTextOnThisSlide = EFalse;
-
-        CUniObject* imageRegionObj = s->GetObject( EUniRegionImage );
-        if ( imageRegionObj )
-            {
-            if ( imageRegionObj->MediaType() == EMsgMediaVideo )
-                {
-                hasVideoOnThisSlide = ETrue;
-                hasVideo++;
-                }
-            else
-                {
-                hasImageOnThisSlide = ETrue;
-                hasImage++;
-                }
-            }
-        if ( s->GetObject( EUniRegionText ) )
-            {
-            hasTextOnThisSlide = ETrue;
-            hasText++;
-            }
-
-        if (    !hasVideoOnThisSlide
-            &&  hasImageOnThisSlide
-            &&  !hasTextOnThisSlide )
-            {
-            hasImageOneAndOnly++;
-            }
-        if (    !hasVideoOnThisSlide
-            &&  !hasImageOnThisSlide
-            &&  hasTextOnThisSlide )
-            {
-            hasTextOneAndOnly++;
-            }
-        }
-
-    // we know:
-    // how many media objects of each type there are totally in the message and
-    // whether some regions have alone on a slide
-    // we conclude:
-    // if a media object has been alone on the slide and there is
-    // only one media object in the whole message
-    // or if there are several images without other content or several texts on several slides
-    // without other content then the media object is alone on a slide
-    // and is only one of its type in the message
-    // but: video is exception. It handling is ignored here. Following big if() statement handles it
-    // by handling video before exception case resolved
-    if ( hasImageOneAndOnly == hasImage )
-        {
-        // image does not occur with some other region
-        hasImage = 0;
-        }
-    else
-        {
-        // image occurs with some other region on some slide
-        hasImageOneAndOnly = 0;
-        }
-
-    if ( hasTextOneAndOnly ==  hasText )
-        {
-        // text does not occur with some other region
-        hasText = 0;
-        }
-    else
-        {
-        // text occurs with some other region on some slide
-        hasTextOneAndOnly = 0;
-        }
-
-/*
-    TBool isLandscape( Layout_Meta_Data::IsLandscapeOrientation() );
-    TBool useSubQCIF( EFalse);
-
-    TRect appWin;
-    AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EApplicationWindow, appWin );
-    TAknLayoutRect mainPane;
-
-    if ( isLandscape )
-        {
-        mainPane.LayoutRect(
-            appWin,
-            AknLayoutScalable_Apps::main_pane( 4 ).LayoutLine() );
-        }
-    else
-        {
-        mainPane.LayoutRect(
-            appWin,
-            AknLayoutScalable_Apps::main_pane( 6 ).LayoutLine() );
-        }
-
-    if ( isLandscape &&
-         appWin.Height() == KSizeLowResWidth &&
-         appWin.Width() == KSizeLowResHeight )
-        {
-        useSubQCIF = ETrue;
-        }
-
-    TAknLayoutRect smilLayout;
-    smilLayout.LayoutRect(
-        mainPane.Rect(),
-        AknLayoutScalable_Apps::main_smil2_pane().LayoutLine() );
-
-    TAknLayoutRect rootLayout;
-    TAknLayoutRect textLayout;
-    TAknLayoutRect imageLayout;
-    TAknLayoutRect videoLayout;
-
-    // For reader about notation:
-    //             x + y == x and y are on the different slide
-    //             x,y == x and y are on the same slide
-    //             { <item> } item can occur 0 or more times
-    if ( hasText && hasImage && !hasVideo ) // text, image - no video
-        {
-        if ( isLandscape ) // landscape text & image
-            {
-            if ( iSlideLayout == EUniTextFirst )
-                {
-                rootLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_root_pane( 4 ).LayoutLine() );
-                textLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_text_pane( 4 ).LayoutLine() );
-                imageLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_image_pane( 3 ).LayoutLine() );
-                }
-            else
-                {
-                rootLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_root_pane( 2 ).LayoutLine() );
-                textLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_text_pane( 2 ).LayoutLine() );
-                imageLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_image_pane( 1 ).LayoutLine() );
-                }
-            }
-        else // portrait text & image
-            {
-            if ( iSlideLayout == EUniTextFirst )
-                {
-		        // Option 3 in the layout spec
-                rootLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_root_pane( 3 ).LayoutLine() );
-                textLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_text_pane( 3 ).LayoutLine() );
-                imageLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_image_pane( 2 ).LayoutLine() );
-                }
-            else
-                {
-		        // Option 1
-                rootLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_root_pane( 1 ).LayoutLine() );
-                textLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_text_pane( 1 ).LayoutLine() );
-                imageLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_image_pane( 0 ).LayoutLine() );
-                }
-            }
-        }
-    else if ( hasText && hasVideo ) // text, video or text, image + video
-        {
-        if ( isLandscape && useSubQCIF ) // landscape subQCIF text & video
-            {
-            if ( iSlideLayout == EUniTextFirst )
-                {
-                rootLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_root_pane( 13 ).LayoutLine() );
-                textLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_text_pane( 10 ).LayoutLine() );
-                videoLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_video_pane( 7 ).LayoutLine() );
-                }
-            else
-                {
-                rootLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_root_pane( 12 ).LayoutLine() );
-                textLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_text_pane( 9 ).LayoutLine() );
-                videoLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_video_pane( 6 ).LayoutLine() );
-                }
-            }
-        else if ( isLandscape && !useSubQCIF ) // landscape QCIF text & video
-            {
-            if ( iSlideLayout == EUniTextFirst )
-                {
-                rootLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_root_pane( 10 ).LayoutLine() );
-                textLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_text_pane( 8 ).LayoutLine() );
-                videoLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_video_pane( 4 ).LayoutLine() );
-                }
-            else
-                {
-                rootLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_root_pane( 9 ).LayoutLine() );
-                textLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_text_pane( 7 ).LayoutLine() );
-                videoLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_video_pane( 3 ).LayoutLine() );
-                }
-            }
-        else // portrait QCIF text & video
-            {
-            if ( iSlideLayout == EUniTextFirst )
-                {
-		        // Option 8
-                rootLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_root_pane( 8 ).LayoutLine() );
-                textLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_text_pane( 6 ).LayoutLine() );
-                videoLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_video_pane( 2 ).LayoutLine() );
-                }
-            else
-                {
-		        // Option 6
-                rootLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_root_pane( 6 ).LayoutLine() );
-                textLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_text_pane( 5 ).LayoutLine() );
-                videoLayout.LayoutRect(
-                    smilLayout.Rect(),
-                    AknLayoutScalable_Apps::smil2_video_pane( 0 ).LayoutLine() );
-                }
-            }
-        }
-    // cases left:
-    // - 1) text {+ text}
-    // - 2) text {+ text} + video
-    // - 3) text {+ text} + image { + image }
-    // - 4) image {+ image} + video, no text
-    // - 5) image {+ image}
-    // - 6) video
-    // - no visual media content
-    else if ( hasVideo )
-        {
-        // 2) 'text {+ text} + video',  4) 'image {+ image} + video, no text' or 6) 'video'
-        if ( isLandscape )
-            {
-            rootLayout.LayoutRect(
-                smilLayout.Rect(),
-                AknLayoutScalable_Apps::smil2_root_pane( 11 ).LayoutLine() );
-            videoLayout.LayoutRect(
-                smilLayout.Rect(),
-                AknLayoutScalable_Apps::smil2_video_pane( 5 ).LayoutLine() );
-            }
-        else
-            {
-            // Option 7
-            rootLayout.LayoutRect(
-                smilLayout.Rect(),
-                AknLayoutScalable_Apps::smil2_root_pane( 7 ).LayoutLine() );
-            videoLayout.LayoutRect(
-                smilLayout.Rect(),
-                AknLayoutScalable_Apps::smil2_video_pane( 1 ).LayoutLine() );
-            }
-
-        if ( hasTextOneAndOnly ) // + text
-            {
-            // Option 0
-            rootLayout.LayoutRect(
-                smilLayout.Rect(),
-                AknLayoutScalable_Apps::smil2_root_pane( 0 ).LayoutLine() );
-            textLayout.LayoutRect(
-                smilLayout.Rect(),
-                AknLayoutScalable_Apps::smil2_text_pane( 0 ).LayoutLine() );
-            }
-
-        }
-    else if (   hasTextOneAndOnly
-            ||  hasImageOneAndOnly )
-        {
-        // 1) text {+ text}, 3) text {+ text} + image { + image ), 5) image {+ image}
-        if ( hasTextOneAndOnly ) // text
-            {
-            // Option 0
-            rootLayout.LayoutRect(
-                smilLayout.Rect(),
-                AknLayoutScalable_Apps::smil2_root_pane( 0 ).LayoutLine() );
-            textLayout.LayoutRect(
-                smilLayout.Rect(),
-                AknLayoutScalable_Apps::smil2_text_pane( 0 ).LayoutLine() );
-            }
-
-        // no else - rootLayouts are same
-        if ( hasImageOneAndOnly ) // image
-            {
-            // Option 5
-            rootLayout.LayoutRect(
-                smilLayout.Rect(),
-                AknLayoutScalable_Apps::smil2_root_pane( 5 ).LayoutLine() );
-            imageLayout.LayoutRect(
-                smilLayout.Rect(),
-                AknLayoutScalable_Apps::smil2_image_pane( 4 ).LayoutLine() );
-            }
-        }
-    else    // empty
-        {
-        rootLayout.LayoutRect(
-            smilLayout.Rect(),
-            AknLayoutScalable_Apps::smil2_root_pane( 0 ).LayoutLine() );
-        textLayout.LayoutRect(
-            smilLayout.Rect(),
-            AknLayoutScalable_Apps::smil2_text_pane( 0 ).LayoutLine() );
-        }
-
-    iSmilParams->iComposeParams->iDisplayHeight = rootLayout.Rect().Height();
-    iSmilParams->iComposeParams->iDisplayWidth = rootLayout.Rect().Width();
-
-    // it does not matter anymore whether object is alone on the slide.
-    // Use one variable only in the if() statements
-    if ( hasImage || hasImageOneAndOnly )
-        {
-        hasImage = 1;
-        }
-    if ( hasText || hasTextOneAndOnly )
-        {
-        hasText = 1;
-        }
-
-    if ( hasText )
-        {
-        iSmilParams->iTextRegionParams->iSize = textLayout.Rect().Size();
-        iSmilParams->iTextRegionParams->iTopLeft =
-            textLayout.Rect().iTl - rootLayout.Rect().iTl;
-        }
-    if ( hasImage || hasVideo )
-        {
-        if ( hasVideo )
-            {
-            iSmilParams->iImageRegionParams->iSize = videoLayout.Rect().Size();
-            iSmilParams->iImageRegionParams->iTopLeft =
-                videoLayout.Rect().iTl - rootLayout.Rect().iTl;
-            }
-        else
-            {
-            iSmilParams->iImageRegionParams->iSize = imageLayout.Rect().Size();
-            iSmilParams->iImageRegionParams->iTopLeft =
-                imageLayout.Rect().iTl - rootLayout.Rect().iTl;
-            }
-        }
-
-*/
-
-    // Set Region IDs to defaults
-    if ( !iImageRegionId.Length() )
-        {
-        iImageRegionId.Set( KSMILWRRegIDImage );
-        }
-    if ( !iTextRegionId.Length() )
-        {
-        iTextRegionId.Set( KSMILWRRegIDText );
-        }
-
-    // Create root layout
-    name.Set( KSMILWREleRoot_layout );
-    TBool rlPop = EFalse;
-    if ( !aRootLayout )
-        {
-        aRootLayout = CMDXMLElement::NewLC( EFalse, aDom, name );
-        rlPop = ETrue;
-        }
-    // Set root layout parameters (attributes)
-    TBuf16<20> val;
-    val.Zero();
-    val.Format( KSmilIntFormat, iSmilParams->iComposeParams->iDisplayWidth );
-    aRootLayout->SetAttributeL( KSMILWRParaWidth,val );
-    val.Zero();
-    val.Format( KSmilIntFormat, iSmilParams->iComposeParams->iDisplayHeight );
-    aRootLayout->SetAttributeL( KSMILWRParaHeight, val );
-    if ( rlPop )
-        {
-        // Append root layout in Layout
-        aLayout->AppendChild( aRootLayout );
-        CleanupStack::Pop( aRootLayout );
-        }
-
-    // Create Image region (if needed)
-    name.Set( KSMILWREleRegion );
-    if ( hasImage || hasVideo )
-        {
-        TBool imgPop = EFalse;
-        if ( !aImageRegion )
-            {
-            aImageRegion = CMDXMLElement::NewLC( EFalse, aDom, name );
-            imgPop = ETrue;
-            }
-        // Set Image region attributes
-        aImageRegion->SetAttributeL( KSMILWRParaId, iImageRegionId );
-        val.Zero();
-        val.Format( KSmilIntFormat, iSmilParams->iImageRegionParams->Width() );
-        aImageRegion->SetAttributeL( KSMILWRParaWidth, val );
-        val.Zero();
-        val.Format( KSmilIntFormat, iSmilParams->iImageRegionParams->Height() );
-        aImageRegion->SetAttributeL( KSMILWRParaHeight, val );
-        val.Zero();
-        val.Format( KSmilIntFormat, iSmilParams->iImageRegionParams->Top() );
-        aImageRegion->SetAttributeL( KSMILWRParaTop, val );
-        val.Zero();
-        val.Format( KSmilIntFormat, iSmilParams->iImageRegionParams->Left() );
-        aImageRegion->SetAttributeL( KSMILWRParaLeft, val );
-        aImageRegion->SetAttributeL( KSMILWRParaFit, iSmilParams->iImageRegionParams->iFit->Des() );
-        if ( imgPop )
-            {
-            // Append region in Layout
-            aLayout->AppendChild( aImageRegion ); // Ownership to dom
-            CleanupStack::Pop( aImageRegion );
-            }
-        }
-
-    // Create Text region (if needed)
-    if ( hasText )
-        {
-        TBool txtPop = EFalse;
-        if ( !aTextRegion )
-            {
-            aTextRegion = CMDXMLElement::NewLC( EFalse, aDom, name );
-            txtPop = ETrue;
-            }
-        // Set Text region attributes
-        aTextRegion->SetAttributeL( KSMILWRParaId, iTextRegionId );
-        val.Zero();
-        val.Format( KSmilIntFormat, iSmilParams->iTextRegionParams->Width() );
-        aTextRegion->SetAttributeL( KSMILWRParaWidth, val );
-        val.Zero();
-        val.Format( KSmilIntFormat, iSmilParams->iTextRegionParams->Height() );
-        aTextRegion->SetAttributeL( KSMILWRParaHeight, val );
-        val.Zero();
-        val.Format( KSmilIntFormat, iSmilParams->iTextRegionParams->Top() );
-        aTextRegion->SetAttributeL( KSMILWRParaTop, val );
-        val.Zero();
-        val.Format( KSmilIntFormat, iSmilParams->iTextRegionParams->Left() );
-        aTextRegion->SetAttributeL( KSMILWRParaLeft, val );
-        aTextRegion->SetAttributeL( KSMILWRParaFit, iSmilParams->iTextRegionParams->iFit->Des() );
-        if ( txtPop )
-            {
-            // Append region in Layout
-            aLayout->AppendChild( aTextRegion ); // Ownership to dom
-            CleanupStack::Pop( aTextRegion );
-            }
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::CreateBodyL
-//
-// ---------------------------------------------------------
-void CUniSmilModel::CreateBodyL( CMDXMLDocument* aDom, CMDXMLElement* aRoot )
-    {
-    TPtrC name( KSMILWREleBody );
-    // Create Body node
-    CMDXMLElement* body = CMDXMLElement::NewLC( ETrue, aDom, name );
-    // Append
-    aRoot->AppendChild( body );
-    CleanupStack::Pop( body );
-
-    // For each slide
-    for( TInt slide = 0; slide < iSlideArray->Count(); slide++ )
-        {
-        // Create par
-        CreateParL( aDom, body, slide );
-        }
-
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::CreateParL
-//
-// ---------------------------------------------------------
-void CUniSmilModel::CreateParL( CMDXMLDocument* aDom, CMDXMLElement* aRoot, TInt aSlide )
-    {
-    TPtrC name( KSMILWRElePar );
-    // Create par node
-    CMDXMLElement* ele = CMDXMLElement::NewLC( ETrue, aDom, name );
-    // Append
-
-    // Get default page duration.
-    TInt slideDur = iSmilParams->iComposeParams->iSlideDuration;
-    TInt objDur = 0;
-    TBool unresolvedDur = EFalse;
-
-    CUniSmilSlide* s = iSlideArray->At( aSlide );
-
-    // For each object in slide
-    for ( TInt i = s->ObjectCount(); --i >= 0; )
-        {
-        // Create Item
-        CUniObject* obj = s->GetObjectByIndex( i );
-        objDur = CreateItemL( aDom, ele, obj );
-        if ( !obj->MediaInfo()->Parsed() &&
-            ( obj->MediaType() == EMsgMediaAudio ||
-            obj->MediaType() == EMsgMediaVideo ) )
-            {
-            unresolvedDur = ETrue;
-            }
-        else
-            {
-            slideDur = Max( slideDur, objDur );
-            }
-        }
-
-    if ( !unresolvedDur )
-        {
-        TBuf16<20> val;
-        val.Zero();
-        val.Format( KSmilMsecFormat, slideDur );
-
-        // Set par attributes
-        ele->SetAttributeL( KSMILWRParaDur, val );
-        }
-    aRoot->AppendChild( ele ); // Ownership to dom
-    CleanupStack::Pop( ele );
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::CreateItemL
-//
-// ---------------------------------------------------------
-TInt CUniSmilModel::CreateItemL( CMDXMLDocument* aDom, CMDXMLElement* aRoot, CUniObject* aObj )
-    {
-    CMDXMLElement* ele = NULL;
-    TPtrC name( KNullDesC );
-
-    // Create mediaobject node
-    switch ( aObj->Region() )
-        {
-        case EUniRegionImage:
-            {
-            if ( aObj->MediaType() == EMsgMediaVideo )
-                {
-                name.Set( KSMILWREleVideo );
-                ele = CMDXMLElement::NewLC( EFalse, aDom, name );
-                ele->SetAttributeL( KSMILWRParaRegion, KSMILWRRegIDImage );
-                }
-            else
-                {
-                // Considered an image - includes also SVG
-                name.Set( KSMILWREleImg );
-                ele = CMDXMLElement::NewLC( EFalse, aDom, name );
-                ele->SetAttributeL( KSMILWRParaRegion, KSMILWRRegIDImage );
-                }
-            }
-            break;
-        case EUniRegionText:
-            {
-            name.Set( KSMILWREleText );
-            ele = CMDXMLElement::NewLC( EFalse, aDom, name );
-            ele->SetAttributeL( KSMILWRParaRegion, KSMILWRRegIDText );
-            }
-            break;
-        case EUniRegionAudio:
-            {
-            name.Set( KSMILWREleAudio );
-            ele = CMDXMLElement::NewLC( EFalse, aDom, name );
-            }
-            break;
-        default:
-            {
-            User::Leave( KErrNotSupported );
-            }
-        }
-
-    // Set MediaObject node attributes
-    ele->SetAttributeL( KSMILWRParaSrc, aObj->MimeInfo()->ContentLocation() );
-
-    // Append
-    aRoot->AppendChild( ele ); // Ownership to dom
-    CleanupStack::Pop( ele );
-
-    return aObj->MediaInfo()->Duration();
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::GetMediaElemRegionIDs
-//
-// ---------------------------------------------------------
-void CUniSmilModel::GetMediaElemRegionIDs( CMDXMLNode* aPage )
-    {
-    CMDXMLNode* txtEle = NULL;
-    CMDXMLNode* imgEle = NULL;
-    CMDXMLNode* obj = aPage->FirstChild();
-
-    // Traverse through every object in page.
-    while ( obj )
-        {
-        if( UniSmilUtils::IsMediaElem( obj ) )
-            {
-            TMsgMediaType type = UniSmilUtils::MediaElemType( obj );
-            switch ( type )
-                {
-                case EMsgMediaImage:
-                case EMsgMediaVideo:
-                    imgEle = obj;
-                    break;
-
-                case EMsgMediaText:
-                case EMsgMediaXhtml:
-                    txtEle = obj;
-                    break;
-
-                // TODO: REF
-                default:
-                    break;
-                }
-            }
-        obj = obj->NextSibling();
-        }
-
-    // Resolve ID:s
-    if ( !iTextRegionId.Length() && txtEle )
-        {
-        UniSmilUtils::GetRegionId( txtEle, iTextRegionId );
-        }
-    if ( !iImageRegionId.Length() && imgEle )
-        {
-        UniSmilUtils::GetRegionId( imgEle, iImageRegionId );
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::GetLayoutElements
-//
-// ---------------------------------------------------------
-void CUniSmilModel::GetLayoutElements( CMDXMLNode* aLayout,
-                                       CMDXMLElement*& aRlEle,
-                                       CMDXMLElement*& aTxtEle,
-                                       CMDXMLElement*& aImgEle )
-    {
-    if ( !aLayout )
-        {
-        return;
-        }
-
-    TPtrC value( KNullDesC );
-    CMDXMLNode* node = aLayout->FirstChild();
-
-    // Search REGIONS & RootLayout
-    while ( node )
-        {
-        // REGION PARAMETERS
-        if ( node->NodeName().CompareF( KSMILWREleRegion ) == 0 )
-            {
-
-            //UniSmilUtils::GetRegionId( node, value );
-            if( ((CMDXMLElement*) node)->IsAttributeSpecified( KSMILWRParaId ) )
-                {
-                ((CMDXMLElement*) node)->GetAttribute( KSMILWRParaId, value );
-                }
-            else
-                {
-                value.Set( KNullDesC );
-                }
-
-            // IMAGE REGION
-            if ( value.CompareF( iImageRegionId ) == 0 )
-                {
-                aImgEle = (CMDXMLElement*) node;
-                }
-
-            // TEXT REGION
-            else if ( value.CompareF( iTextRegionId ) == 0 )
-                {
-                aTxtEle = (CMDXMLElement*) node;
-                }
-
-            }
-        else if ( node->NodeName().CompareF( KSMILWREleRoot_layout ) == 0 )
-            {
-            aRlEle = (CMDXMLElement*) node;
-            }
-
-        node = node->NextSibling();
-
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::GetMmsSmilLayout
-//
-// ---------------------------------------------------------
-TUniLayout CUniSmilModel::GetMmsSmilLayout( CMDXMLDocument* aDom )
-    {
-    TUniLayout rval = EUniUndefinedLayout;
-
-    iTextRegionId.Set( KNullDesC );
-    iImageRegionId.Set( KNullDesC );
-
-    // --------------------------------------------
-    // Resolve region IDs used in media elements
-    // --------------------------------------------
-    CMDXMLNode* node = GetNode( aDom, KSMILWREleBody );
-    if ( !node )
-        {
-        return rval;
-        }
-
-    // Only one slide in the message since no <par> tag found
-    // Other node types than <par> not possible as this is MMS SMIL.
-    if ( node->FirstChild() )
-        {
-        if ( node->FirstChild()->NodeName().CompareF( KSMILWRElePar ) != 0 )
-            {
-            GetMediaElemRegionIDs( node );
-            }
-        else
-            {
-            CMDXMLNode* page = node->FirstChild();
-            while ( page )
-                {
-                GetMediaElemRegionIDs( page );
-
-                // Go to next page.
-                page = page->NextSibling();
-                }
-            }
-        }
-
-    // -------------------------------------
-    // Search layout elements
-    // -------------------------------------
-    node = GetNode( aDom, KSMILWREleLayout );
-    CMDXMLElement* rootLayout = NULL;
-    CMDXMLElement* textRegion = NULL;
-    CMDXMLElement* imageRegion = NULL;
-    GetLayoutElements( node, rootLayout, textRegion, imageRegion );
-
-    // ------------------------------
-    // Resolve Root Layout
-    // ------------------------------
-    TSize rootSize( 0, 0 );
-    GetRootLayoutSize( rootLayout, rootSize );
-
-    // ------------------------------------
-    // Resolve region parameters
-    // ------------------------------------
-    TRect imgRect( 0, 0, 0, 0 );
-    TRect txtRect( 0, 0, 0, 0 );
-    GetRegionRect( imageRegion, rootSize, imgRect );
-    GetRegionRect( textRegion, rootSize, txtRect );
-
-    // ------------------------------------
-    // Layout decision
-    // ------------------------------------
-    if ( textRegion && imageRegion )
-        {
-        if( imgRect.iTl.iY < txtRect.iTl.iY )
-            {
-            rval =  EUniImageFirst;
-            }
-        else if ( imgRect.iTl.iY > txtRect.iTl.iY )
-            {
-            rval = EUniTextFirst;
-            }
-        else
-            {
-            if ( imgRect.iTl.iX <= txtRect.iTl.iX )
-                {
-                rval = EUniImageFirst;
-                }
-            else
-                {
-                rval = EUniTextFirst;
-                }
-            }
-        }
-    else if ( textRegion )
-        {
-        rval = EUniTextFirst;
-        }
-    else // if ( iImgEle ) or none
-        {
-        rval = EUniImageFirst;
-        }
-
-    return rval;
-
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::GetRootLayoutSize
-//
-// ---------------------------------------------------------
-
-void CUniSmilModel::GetRootLayoutSize( CMDXMLElement* aRl, TSize& aSize )
-    {
-    TPtrC value( KNullDesC );
-
-    if ( aRl )
-        {
-        if( aRl->IsAttributeSpecified( KSMILWRParaWidth ) )
-            {
-            aRl->GetAttribute( KSMILWRParaWidth, value );
-            aSize.iWidth = UniSmilUtils::StringToIntValue( value, 0 );
-            }
-        else
-            {
-            aSize.iWidth = iScreenSize.iWidth;
-            }
-
-        if( aRl->IsAttributeSpecified( KSMILWRParaHeight ) )
-            {
-            aRl->GetAttribute( KSMILWRParaHeight, value );
-            aSize.iHeight = UniSmilUtils::StringToIntValue( value, 0 );
-            }
-        else
-            {
-            aSize.iHeight = iScreenSize.iHeight;
-            }
-        }
-    else
-        {
-        aSize = iScreenSize;
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::GetRegionRect
-//
-// ---------------------------------------------------------
-
-void CUniSmilModel::GetRegionRect( CMDXMLElement* aRegion, TSize aRoot, TRect& aRect )
-    {
-    TPtrC value;
-
-    TInt width = 0;
-    TInt height = 0;
-
-    if ( aRegion )
-        {
-        if( aRegion->IsAttributeSpecified( KSMILWRParaWidth ) )
-            {
-            aRegion->GetAttribute( KSMILWRParaWidth, value );
-            width = UniSmilUtils::StringToIntValue( value, 0 ) ;
-            if ( value.Locate( '%' ) != KErrNotFound )
-                {
-                width = width * aRoot.iWidth / 100;
-                }
-            }
-
-        if( aRegion->IsAttributeSpecified( KSMILWRParaHeight ) )
-            {
-            aRegion->GetAttribute( KSMILWRParaHeight, value );
-            height = UniSmilUtils::StringToIntValue( value, 0 ) ;
-            if ( value.Locate( '%' ) != KErrNotFound )
-                {
-                height = height * aRoot.iHeight / 100;
-                }
-            }
-
-        if( aRegion->IsAttributeSpecified( KSMILWRParaTop ) )
-            {
-            aRegion->GetAttribute( KSMILWRParaTop, value );
-            aRect.iTl.iY = UniSmilUtils::StringToIntValue( value, 0 );
-            if ( value.Locate( '%' ) != KErrNotFound )
-                {
-                aRect.iTl.iY = aRect.iTl.iY * aRoot.iHeight / 100;
-                }
-            }
-        else
-            {
-            aRect.iTl.iY = 0;
-            }
-
-        if( aRegion->IsAttributeSpecified( KSMILWRParaLeft ) )
-            {
-            aRegion->GetAttribute( KSMILWRParaLeft, value );
-            aRect.iTl.iX = UniSmilUtils::StringToIntValue( value, 0 );
-            if ( value.Locate( '%' ) != KErrNotFound )
-                {
-                aRect.iTl.iX = aRect.iTl.iX * aRoot.iWidth / 100;
-                }
-            }
-        else
-            {
-            aRect.iTl.iX = 0;
-            }
-
-        aRect.iBr.iY = aRect.iTl.iY + height;
-        aRect.iBr.iX = aRect.iTl.iX + width;
-
-        }
-    else
-        {
-        aRect = TRect( 0, 0, 0, 0 );
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::GetRegionType
-// ---------------------------------------------------------
-//
-TUniRegion CUniSmilModel::GetRegionType( CMDXMLNode* aNodePtr )
-    {
-    if ( iImageRegionId.CompareF( iTextRegionId ) == 0 )
-        {
-        // Image and text regions are the same!
-        // Literally taken this is agains MMS SMIL, but
-        // we should still tolerate it.
-        iParseResult |= ETextAndImageRegionsSame;
-        return EUniRegionUnresolved;
-        }
-    TPtrC regId;
-    TInt err = UniSmilUtils::GetRegionId( aNodePtr, regId );
-    if ( !err )
-        {
-        if ( regId.CompareF( iImageRegionId ) == 0 )
-            {
-            return EUniRegionImage;
-            }
-        else if ( regId.CompareF( iTextRegionId ) == 0 )
-            {
-            return EUniRegionText;
-            }
-        else
-            {
-            return EUniRegionUnresolved;
-            }
-        }
-    else
-        {
-        return EUniRegionUnresolved;
-        }
-    }
-
-
-// ---------------------------------------------------------
-// CUniSmilModel::GetNode
-//
-// ---------------------------------------------------------
-CMDXMLNode* CUniSmilModel::GetNode( CMDXMLDocument* aDom, const TDesC& aName )
-    {
-    CMDXMLNode* node = aDom->DocumentElement()->FirstChild();
-    while ( node )
-        {
-        if ( node->NodeName().CompareF( aName ) == 0 )
-            {
-            break;
-            }
-        else
-            {
-            node = UniSmilUtils::NextNode( node );
-            }
-        }
-    return node;
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::RemoveMetaTagsAndComments
-//
-// ---------------------------------------------------------
-void CUniSmilModel::RemoveMetaTagsAndComments( CMDXMLDocument* aDom )
-    {
-    CMDXMLNode* node = aDom->DocumentElement()->FirstChild();
-    while ( node )
-        {
-        if ( node->NodeType() == CMDXMLNode::ECommentNode ||
-            node->NodeName().CompareF( KSMILWREleMeta ) == 0 )
-            {
-            CMDXMLNode* removeNode = node;
-            node = removeNode->ParentNode();
-            /*TInt ignore =*/ node->RemoveChild( removeNode );
-            delete removeNode;
-            }
-        node = UniSmilUtils::NextNode( node );
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::CorrectSlideTimingL
-//
-// ---------------------------------------------------------
-void CUniSmilModel::CorrectSlideTimingL( CMDXMLElement* aPage )
-    {
-    CMDXMLNode* node = aPage->FirstChild();
-
-    // Traverse through every object in page.
-    while ( node != NULL )
-        {
-        if ( UniSmilUtils::IsMediaElem( node ) )
-            {
-            CMDXMLElement* nodeElement = static_cast<CMDXMLElement*>( node );
-
-            CUniObject* obj = iObjectList.GetByNodeL( node );
-
-            if( !obj ||
-                !obj->MediaInfo() ||
-                obj->MediaInfo()->Duration() != 0 ||
-                TimingSpecified( nodeElement ) )
-                {
-                // Return as non-static media was found from the page.
-                return;
-                }
-            else if ( nodeElement->IsAttributeSpecified( KSMILWRParaBegin ) )
-                {
-                // Remove invalid Begin element since no End or Dur attributes is specified.
-                nodeElement->RemoveAttribute( KSMILWRParaBegin );
-                }
-            else if ( nodeElement->IsAttributeSpecified( KSMILWRParaEnd ) )
-                {
-                // Remove invalid End element since no Begin or Dur attributes is specified.
-                nodeElement->RemoveAttribute( KSMILWRParaEnd );
-                }
-            }
-
-        node = node->NextSibling();
-        }
-
-    // Read default smil parameters
-    if ( !iSmilParams )
-        {
-        iSmilParams = CUniSmilParams::NewL( iFs );
-        }
-
-    TBuf16<20> defaultVal;
-    defaultVal.Zero();
-    defaultVal.Format( KSmilMsecFormat, iSmilParams->iComposeParams->iSlideDuration );
-
-    aPage->SetAttributeL( KSMILWRParaDur, defaultVal );
-    }
-
-// ---------------------------------------------------------
-// CUniSmilModel::TimingSpecified
-//
-// ---------------------------------------------------------
-TBool CUniSmilModel::TimingSpecified( CMDXMLElement* aNodePrt )
-    {
-    TBool result( EFalse );
-
-    // Timing is set if dur or begin & end parameters are found
-    if ( aNodePrt &&
-         ( aNodePrt->IsAttributeSpecified( KSMILWRParaDur ) ||
-           ( aNodePrt->IsAttributeSpecified( KSMILWRParaBegin ) &&
-             aNodePrt->IsAttributeSpecified( KSMILWRParaEnd ) ) ) )
-            {
-            result = ETrue;
-            }
-
-    return result;
-    }
-
-// End of file
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/UniSmilParams.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,246 +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: 
-*       Reads default parameters for composing SMIL from resource file
-*
-*
-*/
-
-
-// INCLUDE FILES
-#include <e32math.h>
-
-#include <barsread.h>
-#include <bautils.h>
-#include <data_caging_path_literals.hrh>
-
-#include <UniDataModel.rsg>
-
-#include "UniSmil.hrh"
-#include "UniSmilParams.h"
-#include "UniModelConst.h"
-
-
-// ================= MEMBER FUNCTIONS =======================
-
-// C++ default constructor can NOT contain any code, that
-// might leave.
-//
-CUniSmilParams::CUniSmilParams( const RFs& aSession ) : iSession( aSession )
-    {
-    }
-
-// Symbian OS default constructor can leave.
-void CUniSmilParams::ConstructL()
-    {
-    iComposeParams = new( ELeave ) TUniSmilComposeParam();
-    iImageRegionParams = new( ELeave ) TUniSmilRegionParam();
-    iTextRegionParams = new( ELeave ) TUniSmilRegionParam();
-    ReadResourcesL();
-    }
-
-// Two-phased constructor.
-CUniSmilParams* CUniSmilParams::NewL( const RFs& aSession )
-    {
-    CUniSmilParams* self = new ( ELeave ) CUniSmilParams( aSession );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// Two-phased constructor.
-CUniSmilParams* CUniSmilParams::NewLC( const RFs& aSession )
-    {
-    CUniSmilParams* self = new (ELeave) CUniSmilParams( aSession );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    return self;
-    }
-
-// Destructor
-CUniSmilParams::~CUniSmilParams()
-    {
-    delete iImageRegionParams;
-    delete iTextRegionParams;
-    delete iComposeParams;
-    }
-
-
-// ---------------------------------------------------------
-// CUniSmilParams::ReadResourcesL()
-//
-// ---------------------------------------------------------
-//
-void CUniSmilParams::ReadResourcesL()
-    {
-    RResourceFile resFile;
-    OpenResourceFileL( resFile );
-
-    ReadComposeParamResourcesL( resFile );
-    ReadImageRegionResourcesL( resFile );
-    ReadTextRegionResourcesL( resFile );
-
-    resFile.Close();
-    }
-
-// ---------------------------------------------------------
-// ReadComposeParamResourcesL()
-//
-// ---------------------------------------------------------
-//
-void CUniSmilParams::ReadComposeParamResourcesL(
-    const RResourceFile& aResFile )
-    {
-    TResourceReader reader;
-    HBufC8* buf = aResFile.AllocReadLC( R_COMPOSE_PARAMS );
-    reader.SetBuffer( buf );
-
-    iComposeParams->iRootLayoutCompose = reader.ReadInt16();
-    iComposeParams->iDisplayWidth      = reader.ReadInt16();
-    iComposeParams->iDisplayHeight     = reader.ReadInt16();
-    iComposeParams->iComposeXmlns      = reader.ReadInt16();
-    iComposeParams->iTopPadding        = reader.ReadInt16();
-    iComposeParams->iRegionPadding     = reader.ReadInt16();
-    iComposeParams->iBottomPadding     = reader.ReadInt16();
-
-    CleanupStack::PopAndDestroy( buf );
-
-    buf = aResFile.AllocReadLC( R_SLIDE_PARAMS );
-    reader.SetBuffer( buf );
-
-    iComposeParams->iSlideDuration = reader.ReadInt16();
-
-    CleanupStack::PopAndDestroy( buf );
-    }
-
-// ---------------------------------------------------------
-// CUniSmilParams::ReadImageRegionResourcesL
-//
-// ---------------------------------------------------------
-//
-void CUniSmilParams::ReadImageRegionResourcesL(
-    const RResourceFile& aResFile )
-    {
-    TResourceReader reader;
-    HBufC8* buf = aResFile.AllocReadLC( R_IMAGE_REGION_ATTRIBUTES );
-    reader.SetBuffer( buf );
-
-    TPtrC ptr;
-
-    // Id
-    ptr.Set( reader.ReadTPtrC() );
-    iImageRegionParams->iId = HBufC::NewL( ptr.Length() );
-    iImageRegionParams->iId->Des().Copy( ptr );
-
-    // Fit
-    ptr.Set( reader.ReadTPtrC() );
-    iImageRegionParams->iFit = HBufC::NewL( ptr.Length() );
-    iImageRegionParams->iFit->Des().Copy( ptr );
-
-    // Max/Min width/height
-    iImageRegionParams->iMaxSize.iHeight = reader.ReadInt16();   //r_max_height
-    iImageRegionParams->iMinSize.iHeight = reader.ReadInt16();   //r_min_height
-    iImageRegionParams->iMaxSize.iWidth = reader.ReadInt16();   //r_max_width
-    iImageRegionParams->iMinSize.iWidth = reader.ReadInt16();   //r_min_width
-
-    iImageRegionParams->iTopLeft.iY = reader.ReadInt16();         //r_top = 0;
-    iImageRegionParams->iTopLeft.iX = reader.ReadInt16();         //r_left = 0;
-
-    // Default Default ;)
-    iImageRegionParams->iSize = iImageRegionParams->iMaxSize;
-
-    CleanupStack::PopAndDestroy( buf );
-
-    // Make some sanity checks
-    if ( iImageRegionParams->iMaxSize.iHeight < iImageRegionParams->iMinSize.iHeight ||
-         iImageRegionParams->iMaxSize.iWidth  < iImageRegionParams->iMinSize.iWidth )
-        {
-        User::Leave( KErrArgument );
-        }
-
-    }
-
-
-// ---------------------------------------------------------
-// CUniSmilParams::ReadTextRegionResourcesL()
-//
-// ---------------------------------------------------------
-//
-void CUniSmilParams::ReadTextRegionResourcesL(
-    const RResourceFile& aResFile )
-    {
-    TResourceReader reader;
-    HBufC8* buf = aResFile.AllocReadLC( R_TEXT_REGION_ATTRIBUTES );
-    reader.SetBuffer( buf );
-
-    TPtrC ptr;
-
-    // Id
-    ptr.Set( reader.ReadTPtrC() );
-    iTextRegionParams->iId = HBufC::NewL( ptr.Length() );
-    iTextRegionParams->iId->Des().Copy( ptr );
-
-    // Fit
-    ptr.Set( reader.ReadTPtrC() );
-    iTextRegionParams->iFit = HBufC::NewL( ptr.Length() );
-    iTextRegionParams->iFit->Des().Copy( ptr );
-
-    // Max/Min width/height
-    //r_max_height
-    iTextRegionParams->iMaxSize.iHeight = reader.ReadInt16();
-    //r_min_height
-    iTextRegionParams->iMinSize.iHeight = reader.ReadInt16();
-    //r_max_width
-    iTextRegionParams->iMaxSize.iWidth = reader.ReadInt16();
-    //r_min_width
-    iTextRegionParams->iMinSize.iWidth = reader.ReadInt16();
-
-    //r_top = 0;
-    iTextRegionParams->iTopLeft.iY = reader.ReadInt16();
-    //r_left = 0;
-    iTextRegionParams->iTopLeft.iX = reader.ReadInt16();
-
-    // Default Default ;)
-    iTextRegionParams->iSize = iTextRegionParams->iMaxSize;
-
-    CleanupStack::PopAndDestroy( buf );
-
-    // Make some sanity checks
-    if ( iTextRegionParams->iMaxSize.iHeight < iTextRegionParams->iMinSize.iHeight ||
-         iTextRegionParams->iMaxSize.iWidth  < iTextRegionParams->iMinSize.iWidth )
-        {
-        User::Leave( KErrArgument );
-        }
-
-    }
-
-// ---------------------------------------------------------
-// CUniSmilParams::OpenResourceFileL()
-//
-// ---------------------------------------------------------
-//
-void CUniSmilParams::OpenResourceFileL( RResourceFile& aResFile )
-    {
-    TFileName fileName;
-    TParse parse;
-    parse.Set( KUniDataModelResourceFilename, &KDC_RESOURCE_FILES_DIR, NULL );
-    fileName = parse.FullName();
-    BaflUtils::NearestLanguageFile( iSession, fileName );
-    aResFile.OpenL( const_cast<RFs&>( iSession ), fileName );
-    aResFile.ConfirmSignatureL( KDefResFileSignature );
-    }
-
-//  End of File
-
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/UniSmilSlide.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,319 +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: 
-*       Provides MMS SMIL Slide methods.
-*
-*
-*/
-
-
-// ========== INCLUDE FILES ================================
-
-#include <e32def.h>
-#include <eikenv.h>
-#include <msvids.h>
-#include <msvstd.h>
-
-#include <MsgMedia.hrh>
-#include <MsgMediaInfo.h>
-
-#include "UniModelConst.h"
-#include "UniObject.h"    
-#include "UniSmilSlide.h"
-
-// ========== LOCAL CONSTANTS AND MACROS ===================
-
-const TUint KMaxObjectPerSlide( 3 );
-
-// ========== MEMBER FUNCTIONS =============================
-
-CUniSmilSlide* CUniSmilSlide::NewLC( TUniLayout aLayout )
-    {
-    CUniSmilSlide* self = new ( ELeave ) CUniSmilSlide( aLayout );
-
-    CleanupStack::PushL( self );
-    self->ConstructL();
-
-    return self;
-    }
-
-// ---------------------------------------------------------
-// CUniSmilSlide::NewL
-//
-// Factory method.
-// ---------------------------------------------------------
-//
-CUniSmilSlide* CUniSmilSlide::NewL( TUniLayout aLayout )
-    {
-    CUniSmilSlide* self = NewLC( aLayout );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-
-// ---------------------------------------------------------
-// CUniSmilSlide::CUniSmilSlide
-//
-// Constructor.
-// ---------------------------------------------------------
-//
-CUniSmilSlide::CUniSmilSlide( TUniLayout aLayout ) :
-    iLayout( aLayout )
-    {
-    }
-
-// ---------------------------------------------------------
-// CUniSmilSlide::CUniSmilSlide
-//
-// Destructor.
-// ---------------------------------------------------------
-//
- CUniSmilSlide::~CUniSmilSlide()
-    {
-    //Objects not owned by slide!!
-    //->ResetAndDestroy() not called.
-    delete iObjectArray;
-    }
-
-
-// ---------------------------------------------------------
-// CUniSmilSlide::AddObjectL
-//
-// Object should be valid for addition at this point ie 
-// should be checked that it can be added to slide.
-// Takes ownership of the aObject.
-// ---------------------------------------------------------
-//  
-void CUniSmilSlide::AddObjectL( CUniObject* aObject )
-    {
-    TUniRegion region = EUniRegionUnresolved;
-    switch ( aObject->MediaType() )
-        {
-        case EMsgMediaText:
-        case EMsgMediaXhtml:
-            {
-            region = EUniRegionText;
-            }
-            break;
-        case EMsgMediaAudio:
-            {
-            region = EUniRegionAudio;
-            }
-            break;
-#ifdef RD_SVGT_IN_MESSAGING
-        case EMsgMediaSvg:
-#endif
-        case EMsgMediaImage:
-        case EMsgMediaVideo:
-            {
-            region = EUniRegionImage;
-            }
-            break;
-        default:
-            {
-            User::Leave( KErrNotSupported );
-            }
-        }
-    AddObjectL( aObject, region );
-    }
-
-
-// ---------------------------------------------------------
-// CUniSmilSlide::AddObjectL
-//
-// Object should be valid for addition at this point ie 
-// should be checked that it can be added to slide.
-// Takes ownership of the aObject.
-// ---------------------------------------------------------
-//  
-void CUniSmilSlide::AddObjectL( CUniObject* aObject, TUniRegion aRegion )
-    {
-    for ( TInt i = 0; i < iObjectArray->Count(); i++)
-        {
-        if ( iObjectArray->At( i )->Region() == aRegion )
-            {
-            User::Leave( KErrAlreadyExists );
-            }
-        }
-    aObject->SetReferenceCount( aObject->ReferenceCount() + 1 );
-    aObject->SetRegion( aRegion );
-    if ( aRegion == EUniRegionAudio )
-        {
-        //always put audio region last...
-        iObjectArray->AppendL( aObject );
-        }
-    else
-        {
-        //...and other regions first...
-        iObjectArray->InsertL( 0, aObject );
-        //...and update layout when needed
-        UpdateLayoutL(); // does not leave, really.
-        }
-    }
-
-
-// ---------------------------------------------------------
-// CUniSmilSlide::RemoveObject
-//
-// 
-// ---------------------------------------------------------
-//
-void CUniSmilSlide::RemoveObject( CUniObject* aObject )
-    {
-    TInt index( -1 );  // Initialize to impossible index.
-
-    for ( TInt i = 0; i < iObjectArray->Count(); i++ )
-        {
-        if ( iObjectArray->At( i ) == aObject )
-            {
-            index = i;
-            }
-        }
-    if ( index != -1 )
-        {
-        // Found
-        iObjectArray->Delete( index );
-        aObject->SetReferenceCount( aObject->ReferenceCount() - 1 );
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniSmilSlide::GetObject
-//
-// Accessor. 
-// ---------------------------------------------------------
-//
-CUniObject* CUniSmilSlide::GetObject( TUniRegion aRegion ) const 
-    {
-    TInt cnt = iObjectArray->Count();
-
-    for ( TInt i = 0; i < cnt; i++ )
-        {
-        if ( iObjectArray->At( i )->Region() == aRegion )
-            {
-            return iObjectArray->At( i );
-            }
-        }
-    return NULL;
-    }
-
-// ---------------------------------------------------------
-// CUniSmilSlide::GetObject
-//
-// Accessor. 
-// ---------------------------------------------------------
-//
-CUniObject* CUniSmilSlide::GetObjectByIndex( TInt aObjNum ) const 
-    {
-    if ( aObjNum >= 0 &&
-        aObjNum < iObjectArray->Count() )
-        {
-        return iObjectArray->At( aObjNum );
-        }
-    return NULL;
-    }
-
-// ---------------------------------------------------------
-// CUniSmilSlide::IsObject
-//
-//  
-// ---------------------------------------------------------
-//
-TBool CUniSmilSlide::IsObject( CUniObject* aObject ) const
-    {
-    TInt cnt = iObjectArray->Count();
-
-    for ( TInt i = 0; i < cnt; i++ )
-        {
-        if ( iObjectArray->At( i ) == aObject )
-            {
-            return ETrue;
-            }
-        }
-    return EFalse;
-    }
-
-// ---------------------------------------------------------
-// CUniSmilSlide::ObjectCount
-//
-// Accessor
-// ---------------------------------------------------------
-//
-TInt CUniSmilSlide::ObjectCount() const
-    {
-    return iObjectArray->Count();
-    }
-
-
-// ---------------------------------------------------------
-// CUniSmilSlide::UpdateLayoutL
-//
-// 
-// ---------------------------------------------------------
-// 
-void CUniSmilSlide::UpdateLayoutL( TUniLayout aNewLayout )
-    {
-    // Only need to do something if slide has text & image.
-    // If only other or neither -> do nothing.
-    iLayout = aNewLayout;
-    UpdateLayoutL();
-    }
-
-// ---------------------------------------------------------
-// CUniSmilSlide::UpdateLayoutL
-//
-// 
-// ---------------------------------------------------------
-// 
-void CUniSmilSlide::UpdateLayoutL()
-    {
-    if ( iLayout == EUniImageFirst ||
-        iLayout == EUniTextFirst )
-        {
-        CUniObject* image = GetObject( EUniRegionImage );
-        CUniObject* text = GetObject( EUniRegionText );
-        if ( image && text )
-            {
-            TInt imageRef = image->ReferenceCount();
-            TInt textRef = text->ReferenceCount();
-            RemoveObject( image );
-            RemoveObject( text );
-            if ( iLayout == EUniImageFirst )
-                {
-                iObjectArray->InsertL( 0, text );
-                iObjectArray->InsertL( 0, image );
-                }
-            else
-                {
-                iObjectArray->InsertL( 0, image );
-                iObjectArray->InsertL( 0, text );
-                }
-            image->SetReferenceCount( imageRef );
-            text->SetReferenceCount( textRef );
-            }
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniSmilSlide::ConstructL
-//
-// 2nd phase Constructor.
-// ---------------------------------------------------------
-//
-void CUniSmilSlide::ConstructL()
-    {
-    iObjectArray = new ( ELeave ) CSmilObjectArray( KMaxObjectPerSlide );
-    }
-
-// End of file
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/UniSmilUtils.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,366 +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: 
-*       Static utility class for manipulating SMIL DOM
-*
-*
-*/
-
-
-#include <e32std.h>
-#include <gdi.h>
-
-#include <gmxmldocument.h>
-#include <gmxmlnode.h>
-#include <gmxmlelement.h>
-
-#include <ConformanceChecker.h>
-#include "UniSmilUtils.h"
-
-
-// ---------------------------------------------------------
-// UniSmilUtils::StringToIntValue
-// Convert a descriptor to TInt
-// ---------------------------------------------------------
-//
-TInt UniSmilUtils::StringToIntValue( const TDesC& aString,
-                                                    TInt aDefault )
-    {
-    TInt value = aDefault;
-    if( aString.Length() != 0 )
-        {
-        TChar c = aString[0];
-        if( c.IsDigit() )
-            {
-            TLex luthor( aString );
-            luthor.Val( value );
-            }
-        else
-            {
-            value = aDefault;
-            }
-        }
-    return value;
-    }
-
-
-// ---------------------------------------------------------
-// UniSmilUtils::IsMediaElem
-// ---------------------------------------------------------
-
-TBool UniSmilUtils::IsMediaElem( CMDXMLNode* aNodePtr )
-{
-    TBool ret = EFalse;
-
-    if ( aNodePtr->NodeType() == CMDXMLNode::EElementNode &&
-         UniSmilUtils::MediaElemType( aNodePtr) != EMsgMediaUnknown )
-        {
-        ret = ETrue;
-        }
-
-    return ret;
-}
-
-// ---------------------------------------------------------
-// UniSmilUtils::NextNode
-// ---------------------------------------------------------
-
-CMDXMLNode* UniSmilUtils::NextNode(CMDXMLNode* aRefNode)
-{
-    if( aRefNode->FirstChild() )
-        {
-        aRefNode = aRefNode->FirstChild();
-        }
-    else
-        {
-        if( aRefNode->NextSibling() )
-            {
-            // move to the next sibling if exists
-            aRefNode = aRefNode->NextSibling();
-            }
-        else
-            {
-            // No siblings at this level. Go up to parent.
-            // might need to go up several layers so WHILE rather than IF
-            while ( aRefNode && !aRefNode->NextSibling() )
-                {
-                // no siblings, move back to parent.
-                aRefNode = aRefNode->ParentNode();
-                }
-
-            // Check if we stopped because node has siblings.
-            if ( aRefNode && aRefNode->NextSibling() )
-                {
-                aRefNode = aRefNode->NextSibling();
-                }
-            }
-        }
-
-    return aRefNode;
-}
-
-// ---------------------------------------------------------
-// UniSmilUtils::RemoveChilds
-// ---------------------------------------------------------
-
-void UniSmilUtils::RemoveChilds(
-    CMDXMLNode* aParent )
-    {
-    CMDXMLNode* child = NULL;
-
-    if ( aParent )
-        {
-        child = aParent->FirstChild();
-        }
-
-    while ( child )
-        {
-        if ( child->HasChildNodes() )
-            {
-            UniSmilUtils::RemoveChilds( child );
-            }
-        else
-            {
-            CMDXMLNode* n = child;
-            child = child->NextSibling();
-            aParent->RemoveChild( n );
-            delete n;
-            }
-        }
-    }
-
-
-// ---------------------------------------------------------
-// UniSmilUtils::ElemType
-// ---------------------------------------------------------
-
-TMsgMediaType UniSmilUtils::MediaElemType(CMDXMLNode* aNodePtr)
-{
-    TMsgMediaType type(EMsgMediaUnknown);
-
-    if ( aNodePtr )
-        {
-        TPtrC nName;
-        nName.Set(aNodePtr->NodeName());
-
-        if ( nName.Compare(KSMILWREleAnimation) == 0 )
-            {
-            type = EMsgMediaAnimation;
-            }
-        else if (nName.Compare(KSMILWREleAudio) == 0 )
-            {
-            type = EMsgMediaAudio;
-            }
-        // SVG included. No special SVG element tag exist.
-        else if (nName.Compare(KSMILWREleImg) == 0 )
-            {
-            type = EMsgMediaImage;
-            }
-        else if (nName.Compare(KSMILWREleRef) == 0 )
-            {
-            type = EMsgMediaRef;
-            }
-        else if ( nName.Compare(KSMILWREleText) == 0 )
-            {
-            type = EMsgMediaText;
-            }
-        else if ( nName.Compare(KSMILWREleTextstream) == 0 )
-            {
-            type = EMsgMediaTextStream;
-            }
-        else if ( nName.Compare(KSMILWREleVideo) == 0 )
-            {
-            type = EMsgMediaVideo;
-            }
-        }
-
-    return type;
-}
-
-// ---------------------------------------------------------
-// UniSmilUtils::GetId
-// ---------------------------------------------------------
-
-TInt UniSmilUtils::GetId( CMDXMLNode* aNodePtr, TPtrC& aId )
-    {
-    TInt ret = KErrNotSupported;
-
-    if( aNodePtr && aNodePtr->NodeType() == CMDXMLNode::EElementNode )
-        {
-        CMDXMLElement* e =(CMDXMLElement*) aNodePtr;
-        if ( e->IsAttributeSpecified( KSMILWRParaId ))
-            {
-            e->GetAttribute(KSMILWRParaId, aId);
-            ret = KErrNone;
-            }
-        else
-            {
-            ret = KErrNotFound;
-            }
-        }
-    return ret;
-    }
-
-// ---------------------------------------------------------
-// UniSmilUtils::GetMetaTag
-// ---------------------------------------------------------
-
-TInt UniSmilUtils::GetMetaTag( CMDXMLNode* aNodePtr,
-                                   TPtrC& aName,
-                                   TPtrC& aContent )
-    {
-    TInt ret = KErrNotFound;
-
-    if( aNodePtr &&
-        aNodePtr->NodeType() == CMDXMLNode::EElementNode &&
-        aNodePtr->NodeName().Compare(KSMILWREleMeta) == 0)
-        {
-        CMDXMLElement* e = (CMDXMLElement*) aNodePtr;
-
-        if ( e->IsAttributeSpecified( KSMILWRParaName ) &&
-             e->IsAttributeSpecified( KSMILWRParaContent ))
-            {
-            if (!e->GetAttribute(KSMILWRParaName, aName) &&
-                !e->GetAttribute(KSMILWRParaContent, aContent))
-                {
-                ret = KErrNone;
-                }
-            }
-        }
-    return ret;
-    }
-
-// ---------------------------------------------------------
-// UniSmilUtils::RegionId
-// ---------------------------------------------------------
-
-TInt UniSmilUtils::GetRegionId( CMDXMLNode* aNodePtr, TPtrC& aId )
-    {
-    TInt ret = KErrNotSupported;
-
-    if ( aNodePtr )
-        {
-        if ( UniSmilUtils::IsMediaElem( aNodePtr ) )
-            {
-            ret = ((CMDXMLElement*)aNodePtr)->GetAttribute(KSMILWRParaRegion, aId);
-            }
-        }
-    return ret;
-    }
-
-// ---------------------------------------------------------
-// UniSmilUtils::GetSrc
-// ---------------------------------------------------------
-
-TPtrC UniSmilUtils::GetSrcL( CMDXMLNode* aNodePtr )
-{
-    TPtrC src = TPtrC();
-    if ( aNodePtr )
-            {
-        CMDXMLElement* e = (CMDXMLElement*) aNodePtr;
-
-        if ( e && e->IsAttributeSpecified(KSMILWRParaSrc) )
-            {
-            User::LeaveIfError( e->GetAttribute(KSMILWRParaSrc, src) );
-            }
-        else
-            {
-            // Ok not to have src i.e. no default content.
-            }
-        }
-
-    return src;
-}
-
-
-// ---------------------------------------------------------
-// UniSmilUtils::GetSmilTypeL
-//
-// ---------------------------------------------------------
-TUniSmilType UniSmilUtils::GetSmilTypeL( CMDXMLDocument* aDom )
-    {
-
-    if ( UniSmilUtils::IsTemplateSmil( aDom ) )
-        {
-        return ETemplateSmil;
-        }
-    else if ( !aDom ||
-              !aDom->DocumentElement() ||
-              !aDom->DocumentElement()->FirstChild() )
-        {
-        return ENoSmil;
-        }
-    else
-        {
-        CConformanceChecker* checker = CConformanceChecker::NewL();
-        CleanupStack::PushL( checker );
-        TBool isConf( EFalse );
-
-        isConf = checker->Check( aDom, EMmsSmil_v2_0,
-            EAllowVideoTag |
-            EAllowNonMilliseconds |
-            EAllowAllAttributes |
-            EAllowMixedRegionDimensions |
-            EAllowAnyRegionNames );
-
-        CleanupStack::PopAndDestroy( checker );
-
-        if( isConf )
-            {
-            return EMmsSmil;
-            }
-
-        }
-    return E3GPPSmil;
-    }
-
-
-// ---------------------------------------------------------
-// UniSmilUtils::IsTemplateSmil
-//
-// ---------------------------------------------------------
-
-TBool UniSmilUtils::IsTemplateSmil( CMDXMLDocument* aDom )
-    {
-    TBool ret( EFalse );
-
-    CMDXMLNode* n = aDom->DocumentElement()->FirstChild();
-
-    while ( n )
-        {
-        if ( n->NodeName().Compare( KSMILWREleMeta ) == 0)
-            {
-            TPtrC v1, v2;
-            if ( !UniSmilUtils::GetMetaTag( n, v1, v2 ) )
-                {
-                if ( v1.Compare( KSMILMetaSmilProfile ) == 0 &&
-                     v2.Compare( KSMILMetaSmilProfileValue ) == 0)
-                    {
-                    ret = ETrue;
-                    break;
-                    }
-                }
-            }
-        else if ( n->NodeName().Compare( KSMILWREleBody ) == 0 )
-            {
-            // Cannot anymore have metatags
-            break;
-            }
-        n = UniSmilUtils::NextNode( n );
-        }
-    return ret;
-    }
-
-
-// EOF
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/UniTextObject.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,539 +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: 
-*       CUniTextObject, Storage for single text attachment in presentation.
-*
-*
-*/
-
-
-// ========== INCLUDE FILES ================================
-
-#include <e32def.h>     // for basic types
-#include <eikenv.h>     // for CBase
-#include <mtclbase.h>   // for CBaseMtm
-#include <msvstd.h>     // for TMsvId
-#include <msvids.h>     // for KMsvTempIndexEntryId
-#include <msvstore.h>
-#include <mmsvattachmentmanager.h>
-#include <cmsvattachment.h>
-
-#include <eikrted.h>    // CEikRichTextEditor
-#include <charconv.h>
-
-
-#include <MsgMediaInfo.h>
-#include <MsgTextInfo.h>
-#include <MsgAttachmentUtils.h>
-
-#include "msgtextutils.h"
-#include "UniModelConst.h"
-#include "UniMimeInfo.h"
-#include "UniObject.h"
-#include "UniTextObject.h"
-#include "UniDataUtils.h"
-//rushi
-#include "MsgMimeTypes.h"
-#include "MuiuOperationWait.h"
-
-
-// ========== EXTERNAL DATA STRUCTURES =====================
-
-// ========== EXTERNAL FUNCTION PROTOTYPES =================
-
-// ========== CONSTANTS ====================================
-
-// ========== MACROS =======================================
-
-// ========== LOCAL CONSTANTS AND MACROS ===================
-const TInt KMaxFilenameLenghtForAttachment = 20;   // Characters
-
-const TInt KMaxCharSize = 3;
-const TInt KMinCharSize = 1;
-// Always count exact size
-// -> performance penalty with very long text files.
-const TInt KSyncInterval = 0;
-const TInt KForceSyncLength = KMaxTInt;
-
-_LIT16( KExtTextPlain_16, ".txt" );
-
-
-// ========== MODULE DATA STRUCTURES =======================
-
-
-// ========== LOCAL FUNCTION PROTOTYPES ====================
-
-// ========== LOCAL FUNCTIONS ==============================
-
-// ========== MEMBER FUNCTIONS =============================
-
-// ---------------------------------------------------------
-// CUniTextObject::NewLC
-//
-// Factory method.
-// ---------------------------------------------------------
-//
-CUniTextObject* CUniTextObject::NewLC( RFs& aFs,
-                                               CBaseMtm& aMtm,
-                                               CUniDataUtils& aData,
-                                               CMsgTextInfo* aMedia,
-                                               MMsvAttachmentManager& aManager,
-                                               CMsvAttachment& aAttachment )
-    {
-    CUniTextObject* self =
-        new ( ELeave ) CUniTextObject( aFs, aMtm, aData, aMedia );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    self->ConstructFromAttachmentL( aManager, aAttachment );
-    return self;
-    }
-
-// ---------------------------------------------------------
-// CUniTextObject::NewL
-//
-// Factory method.
-// ---------------------------------------------------------
-//
-CUniTextObject* CUniTextObject::NewL( RFs& aFs,
-                                              CBaseMtm& aMtm,
-                                              CUniDataUtils& aData,
-                                              CMsgTextInfo* aMedia,
-                                              MMsvAttachmentManager& aManager,
-                                              CMsvAttachment& aAttachment )
-    {
-    CUniTextObject* self = NewLC( aFs, aMtm, aData, aMedia, aManager, aAttachment );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------
-// CUniTextObject::NewLC
-//
-// Factory method.
-// ---------------------------------------------------------
-//
-CUniTextObject* CUniTextObject::NewLC( RFs& aFs,
-                                               CBaseMtm& aMtm,
-                                               CUniDataUtils& aData,
-                                               CMsgTextInfo* aMedia )
-    {
-    CUniTextObject* self =
-        new ( ELeave ) CUniTextObject( aFs, aMtm, aData, aMedia );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    self->CreateMimeInfoL();
-    return self;
-    }
-
-// ---------------------------------------------------------
-// CUniTextObject::NewL
-//
-// Factory method.
-// ---------------------------------------------------------
-//
-CUniTextObject* CUniTextObject::NewL( RFs& aFs,
-                                              CBaseMtm& aMtm,
-                                              CUniDataUtils& aData,
-                                              CMsgTextInfo* aMedia )
-    {
-    CUniTextObject* self = NewLC( aFs, aMtm, aData, aMedia );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------
-// CUniTextObject::NewLC
-//
-// Factory method.
-// ---------------------------------------------------------
-//
-CUniTextObject* CUniTextObject::NewLC( RFs& aFs,
-                                               CBaseMtm& aMtm,
-                                               CUniDataUtils& aData,
-                                               CEikRichTextEditor* aTextEditor )
-    {
-    RFile nullHandle;
-    TDataType mime( KMsgMimeTextPlain );
-    CMsgTextInfo* info = CMsgTextInfo::NewL(
-        nullHandle,
-        mime,
-        aFs );
-    info->SetCharacterSet( KCharacterSetMIBEnumUtf8 );
-    CleanupStack::PushL( info );
-    CUniTextObject* self =
-        new ( ELeave ) CUniTextObject( aFs, aMtm, aData, info );
-    CleanupStack::Pop( info ); // ownership transferred
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    self->ConstructFromTextL( aTextEditor );
-    self->SynchronizeSize();
-    return self;
-    }
-
-// ---------------------------------------------------------
-// CUniTextObject::NewL
-//
-// Factory method.
-// ---------------------------------------------------------
-//
-CUniTextObject* CUniTextObject::NewL( RFs& aFs,
-                                              CBaseMtm& aMtm,
-                                              CUniDataUtils& aData,
-                                              CEikRichTextEditor* aTextEditor )
-    {
-    CUniTextObject* self = NewLC( aFs, aMtm, aData, aTextEditor );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-
-// ---------------------------------------------------------
-// CUniTextObject::CUniTextObject
-//
-// Constructor.
-// ---------------------------------------------------------
-//
-CUniTextObject::CUniTextObject( RFs& aFs,
-                               CBaseMtm& aMtm,
-                               CUniDataUtils& aData,
-                               CMsgTextInfo* aMedia )
-        :
-        CUniObject( aFs, aMtm, aData, aMedia ),
-        iTextEditor( NULL )
-    {
-    }
-
-
-// ---------------------------------------------------------
-// CUniTextObject::CUniTextObject
-//
-// Destructor.
-// ---------------------------------------------------------
-//
-CUniTextObject::~CUniTextObject()
-    {
-    if ( iEditFile )
-        {
-        iEditFile->Close();
-        delete iEditFile;
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniTextObject::Save
-// ---------------------------------------------------------
-//
-void CUniTextObject::Save( MUniObjectSaveObserver& aObserver,
-                           CMsvAttachment::TMsvAttachmentType aSaveType )
-    {
-    iTextSaveState = ETextSavingIdle;
-    CUniObject::Save( aObserver, aSaveType );
-    }
-
-// ---------------------------------------------------------
-// CUniTextObject::DoSaveL
-// ---------------------------------------------------------
-//
-void CUniTextObject::DoSaveL()
-    {
-    switch ( iTextSaveState )
-        {
-        case ETextSavingIdle:
-            {
-            InitializeTextSaveL();
-            break;
-            }
-        case ETextCreatingAttachment:
-            {
-            CreateTextAttachmentL();
-            break;
-            }
-        case ETextWritingToFile:
-            {
-            WriteToFileL();
-            break;
-            }
-        default:
-            {
-            break;
-            }
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniTextObject::Size
-//
-// Accessor.
-// ---------------------------------------------------------
-//
-TInt CUniTextObject::Size( TBool aWithoutHeaders )
-    {
-    if ( iTextEditor && iTextEditor->TextLength() )
-        {
-        TInt size = 0;
-        TInt length = iTextEditor->TextLength();
-        TInt change = length - iPrevLength;
-        if ( change )
-            {
-            //add absolute value
-            iSyncCounter += Max( change, -change );
-            iPrevLength = length;
-            }
-        if ( iSyncCounter > KSyncInterval ||
-            length <= KForceSyncLength )
-            {
-            size = SynchronizeSize();
-            }
-        else
-            {
-            TInt diff = length - iSyncLength;
-            TInt charSize = diff < 0
-                ? KMinCharSize
-                : KMaxCharSize;
-            size = iSyncSize + charSize * diff;
-            size = Max( size, 0 );
-            }
-        return ( aWithoutHeaders ? size : size + iMimeInfo->Size() );
-        }
-    else
-        {
-        return CUniObject::Size( aWithoutHeaders );
-        }
-    }
-
-// ---------------------------------------------------------
-// CUniTextObject::SyncronizeSize
-//
-// Counts real buffer size and syncronizes internal
-// size variables.
-// ---------------------------------------------------------
-//
-TInt CUniTextObject::SynchronizeSize()
-    {
-    iSyncCounter = 0;
-    if ( iTextEditor )
-        {
-        iSyncLength = iTextEditor->TextLength();
-        iPrevLength = iSyncLength;
-        TPtrC ptr = iTextEditor->Text()->Read( 0, iTextEditor->Text()->DocumentLength() );
-        iSyncSize = CUniDataUtils::UTF8Size( ptr );
-        }
-    else
-        {
-        iSyncSize = 0;
-        iSyncLength = 0;
-        iPrevLength = 0;
-        }
-    return iSyncSize;
-    }
-
-// ---------------------------------------------------------
-// CUniTextObject::ConstructL
-//
-// 2nd phase constructor.
-// ---------------------------------------------------------
-//
-void CUniTextObject::ConstructL()
-    {
-    CUniObject::ConstructL();
-    }
-
-// ---------------------------------------------------------
-// CUniTextObject::ConstructFromTextL
-//
-// 2nd phase constructor.
-// ---------------------------------------------------------
-//
-void CUniTextObject::ConstructFromTextL( CEikRichTextEditor* aTextEditor )
-    {
-    iAttachmentId = KMsvNullIndexEntryId;
-    iTextEditor = aTextEditor;
-    //iStoreState = EMmsStoreStateTemporary;
-    //Create MIME headers
-    CreateMimeInfoL();
-    }
-
-// ---------------------------------------------------------
-// CreateFileName
-// ---------------------------------------------------------
-//
-void CUniTextObject::CreateFileName( TFileName& aFileName )
-    {
-    if ( iTextEditor && iTextEditor->Text()->DocumentLength() )
-        {
-    	TPtrC ptr = iTextEditor->Text()->Read( 0, KMaxFilenameLenghtForAttachment );
-        MsgAttachmentUtils::GetFileNameFromBuffer(
-            aFileName,
-            ptr,
-            KMaxFilenameLenghtForAttachment,
-            &KExtTextPlain_16 );
-        }
-    if ( aFileName.Length() == 0 ||
-        !iFs.IsValidName( aFileName ) )
-        {
-        // No filename -> Use default
-        aFileName.Zero();
-        aFileName.Copy( iData.DefaultFileName() );
-        aFileName.Append( KExtTextPlain_16 );
-        }
-    }
-
-// ---------------------------------------------------------
-// InitializeTextSaveL
-// ---------------------------------------------------------
-//
-void CUniTextObject::InitializeTextSaveL()
-    {
-    if ( !iTextEditor )
-        {
-        CUniObject::DoSaveL();
-        return;
-        }
-
-    // Remove possibly already existing attachment from store
-    RemoveFromStoreL();
-
-    if ( !iTextEditor->TextLength() )
-        {
-        //Nothing to save. (Shouldn't really get here
-        //since there shouldn't be "empty" text objects
-        //in the smil model.)
-        iObserver->ObjectSaveReady( KErrNone );
-        return;
-        }
-    iTextSaveState = ETextCreatingAttachment;
-    //CompleteSelf();
-    RunL();
-    }
-
-// ---------------------------------------------------------
-// CreateTextAttachmentL
-// ---------------------------------------------------------
-//
-void CUniTextObject::CreateTextAttachmentL()
-    {
-    TFileName fileName;
-    CreateFileName( fileName );
-
-    TFileName contentLocation( fileName );
-    CMsgTextUtils::TrimAndRemoveNonAlphaDigit( contentLocation );
-    iMimeInfo->SetContentLocationL( contentLocation );
-    iMimeInfo->SetContentTypeL( KMsgMimeTextPlain );
-    iMimeInfo->SetCharset( KCharacterSetMIBEnumUtf8 );
-
-    iEditStore = iMtm.Entry().EditStoreL();
-    iManager = &( iEditStore->AttachmentManagerL() );
-    CMsvAttachment* attachment = CMsvAttachment::NewL( CMsvAttachment::EMsvFile );
-    CleanupStack::PushL( attachment );
-
-    attachment->SetMimeTypeL( KMsgMimeTextPlain );
-    attachment->SetSize( SynchronizeSize() );
-    //TODO: Set complete flag?
-    //attachment->SetComplete( EFalse );
-
-    attachment->SetIntAttributeL( KUidAttachmentIndication, Attachment() );
-
-    iEditFile = new ( ELeave ) RFile;
-
-    //Make this synchronous process
-    CMuiuOperationWait* wait = CMuiuOperationWait::NewLC();
-    
-    iManager->CreateAttachmentL( fileName, *iEditFile, attachment, wait->iStatus );
-    wait->Start();
-    
-    CleanupStack::PopAndDestroy( wait );
-    	
-    CleanupStack::Pop( attachment );
-    iAttachment = attachment;
-    iTextSaveState = ETextWritingToFile;
-    
-    //SetActive();
-    RunL();
-    }
-
-// ---------------------------------------------------------
-// WriteToFileL
-// ---------------------------------------------------------
-//
-void CUniTextObject::WriteToFileL()
-    {
-    RFileWriteStream writer( *iEditFile );
-    delete iEditFile;
-    iEditFile = NULL;
-
-    // Write the text to a file
-
-    // UTF-8 signature
-    // Taken out because not all terminals can deal with it.
-    // Maybe taken back into use in the future
-    //writer.WriteInt8L( 0xEF );
-    //writer.WriteInt8L( 0xBB );
-    //writer.WriteInt8L( 0xBF );
-
-    HBufC* buffer = iTextEditor->GetTextInHBufL();
-    CleanupStack::PushL( buffer );
-
-    // Convert the text to utf8
-    CCnvCharacterSetConverter* converter = CCnvCharacterSetConverter::NewLC();
-
-    if ( converter->PrepareToConvertToOrFromL( KCharacterSetIdentifierUtf8, iFs )
-        != CCnvCharacterSetConverter::EAvailable )
-        {
-        User::Leave( KErrNotSupported );
-        }
-
-    TBuf8<128> outputBuffer;
-    TPtrC16 remainderOfUnicodeText( *buffer );
-    FOREVER
-        {
-        TInt returnValue = converter->ConvertFromUnicode(
-            outputBuffer, remainderOfUnicodeText );
-        if ( returnValue == CCnvCharacterSetConverter::EErrorIllFormedInput )
-            {
-            User::Leave( KErrCorrupt );
-            }
-        else if ( returnValue<0 ) // future-proof against "TError" expanding
-            {
-            User::Leave( KErrGeneral );
-            }
-
-        // ? - do something here with outputBuffer
-        writer.WriteL( outputBuffer );
-
-        if ( returnValue == 0 )
-            {
-            break; // all of aUnicodeText has been converted and handled
-            }
-        remainderOfUnicodeText.Set( remainderOfUnicodeText.Right(
-            returnValue ) );
-        }
-
-    CleanupStack::PopAndDestroy( 2, buffer ); //converter, buffer
-
-    // Close handles
-    writer.Close();
-    //TInt fileSize( 0 );
-    //iEditFile->Size( fileSize );
-    //iAttachment->SetSize( fileSize );
-    //iEditFile->Close();
-    //delete iEditFile;
-    //iEditFile = NULL;
-
-    // Closes & destroys other "attachment handling" members
-    // Sends callback to observer
-    FinalizeObjectSaveL();
-    }
-
-
-// End of file
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/sessioneventhandler.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +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 "sessioneventhandler.h"
-
-SessionEventHandler::SessionEventHandler(QThread* parent):
-QThread(parent)
-{
-}
-
-SessionEventHandler::~SessionEventHandler()
-{
-}
-
-//---------------------------------------------------------------
-// SessionEventHandler::HandleSessionEventL
-// @see header
-//---------------------------------------------------------------
-void SessionEventHandler::HandleSessionEventL(TMsvSessionEvent /*aEvent*/,
-                                                  TAny* /*aArg1*/,
-                                                  TAny* /*aArg2*/, TAny* /*aArg3*/)
-{
-// do nothing
-}
-
-//---------------------------------------------------------------
-// SessionEventHandler::run
-// @see header
-//---------------------------------------------------------------
-void SessionEventHandler::run()
-{
-    exec();
-}
-
-// EOF
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/unimmsdataplugin.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,216 +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 "debugtraces.h"
-
-#include "unimmsdataplugin.h"
-#include "unimmsdataplugin_p.h"
-
-UniMMSDataPlugin::UniMMSDataPlugin(QObject* parent) :
-    QObject(parent)
-{
-    d_ptr = new UniMMSDataPluginPrivate();
-}
-
-UniMMSDataPlugin::~UniMMSDataPlugin()
-{
-    delete d_ptr;
-}
-
-QObject* UniMMSDataPlugin::createInstance()
-{
-return new UniMMSDataPlugin();
-}
-
-int UniMMSDataPlugin::setMessageId(int messageId)
-{
-    return d_ptr->setMessageId(messageId);
-}
-
-void UniMMSDataPlugin::reset()
-{
-    d_ptr->reset();
-}
-
-void UniMMSDataPlugin::body(QString& aBodyText)
-{
-    d_ptr->body(aBodyText);
-}
-
-int UniMMSDataPlugin::messageSize()
-{
-    return d_ptr->messageSize();
-}
-
-void UniMMSDataPlugin::toRecipientList(
-                                       ConvergedMessageAddressList& mAddressList)
-{
-    d_ptr->toRecipientList(mAddressList);
-}
-
-void UniMMSDataPlugin::ccRecipientList(
-                                       ConvergedMessageAddressList& mAddressList)
-{
-    d_ptr->ccRecipientList(mAddressList);
-}
-
-void UniMMSDataPlugin::bccRecipientList(
-                                        ConvergedMessageAddressList& mAddressList)
-{
-    d_ptr->bccRecipientList(mAddressList);
-}
-
-void UniMMSDataPlugin::fromAddress(QString& messageAddress)
-{
-    d_ptr->fromAddress(messageAddress);
-}
-
-UniMessageInfoList UniMMSDataPlugin::attachmentList()
-{
-    return d_ptr->attachmentList();
-}
-
-QString UniMMSDataPlugin::messageType()
-{
-    return d_ptr->messageType();
-}
-
-MsgPriority UniMMSDataPlugin::messagePriority()
-{
-    return d_ptr->messagePriority();
-}
-
-int UniMMSDataPlugin::attachmentCount()
-{
-    return d_ptr->attachmentCount();
-}
-
-bool UniMMSDataPlugin::hasAttachment()
-{
-    return d_ptr->hasAttachment();
-}
-
-int UniMMSDataPlugin::objectCount()
-{
-    return d_ptr->objectCount();
-}
-
-UniMessageInfoList UniMMSDataPlugin::objectList()
-{
-    return d_ptr->objectList();
-}
-
-int UniMMSDataPlugin::slideCount()
-{
-    return d_ptr->slideCount();
-}
-
-UniMessageInfoList UniMMSDataPlugin::slideContent(int slidenum)
-{
-    return d_ptr->slideContent(slidenum);
-}
-
-QDateTime UniMMSDataPlugin::timeStamp()
-{
-    QDateTime retTimeStamp;
-    int tStamp = d_ptr->timeStamp();
-    retTimeStamp.setTime_t(tStamp);
-    return retTimeStamp;
-}
-
-void UniMMSDataPlugin::addObject( int aslideNum,UniMessageInfo* aInfo )
-{
-    int error;    
-    TRAP(error,d_ptr->addObjectL(aslideNum,aInfo));
-    QDEBUG_WRITE_FORMAT("Exiting addObject with error= ",error);
-}
-
-void UniMMSDataPlugin::addTextObject(int aSlideNum,QString aText )
-{
-    int error;    
-    TRAP(error,d_ptr->addTextObjectL(aSlideNum,aText));
-    QDEBUG_WRITE_FORMAT("Exiting addTextObject with error= ",error);
-}		
-
-void UniMMSDataPlugin::addSlide( int aSlideNum )
-{
-    int error;    
-    TRAP(error,d_ptr->addSlideL(aSlideNum));
-    QDEBUG_WRITE_FORMAT("Exiting addSlide with error= ",error);
-}		
-
-void UniMMSDataPlugin::composeSmil(CMsvStore& aEditStore)
-{
-    int error;    
-    TRAP(error,d_ptr->composeSmilL(aEditStore));	
-    QDEBUG_WRITE_FORMAT("Exiting composeSmil with error= ",error);
-}
-
-void UniMMSDataPlugin::saveObjects()
-{
-    QDEBUG_WRITE("Enter saveObjects");    
-    d_ptr->saveObjects();
-    QDEBUG_WRITE("Exit saveObjects");
-}	
-
-TMsvAttachmentId UniMMSDataPlugin::getSmilAttachmentByIndex() 
-{
-    QDEBUG_WRITE("Enter getSmilAttachmentByIndex");  
-    TMsvAttachmentId attachmentId = d_ptr->getSmilAttachmentByIndex();
-    QDEBUG_WRITE_FORMAT("Exit getSmilAttachmentByIndex attachmentId = ",
-        attachmentId);  
-    return attachmentId;
-}		
-
-void UniMMSDataPlugin::restore(CBaseMtm& mtm)
-{
-    QDEBUG_WRITE("Inside restore");
-    int error;    
-    TRAP(error,d_ptr->restoreL(mtm));    
-    QDEBUG_WRITE_FORMAT("Exiting restore with error= ",error);
-}
-
-void UniMMSDataPlugin::addAttachment( UniMessageInfo* aInfo )
-{
-    QDEBUG_WRITE("Inside addAttachment");
-    int error;
-    TRAP(error,d_ptr->addAttachmentL(aInfo));
-    QDEBUG_WRITE_FORMAT("Exiting addAttachment with error= ",error);
-}
-
-void UniMMSDataPlugin::removeSlide(int aSlideNumber)
-{
-    QDEBUG_WRITE("Enter removeSlide");
-    d_ptr->removeSlide(aSlideNumber);
-    QDEBUG_WRITE("Exit removeSlide");
-}
-
-
-QString UniMMSDataPlugin::subject()
-{
-    return d_ptr->subject(); 
-}
-
-CMsvSession* UniMMSDataPlugin::session()
-{
-    return d_ptr->session();
-    
-}
-
-
-Q_EXPORT_PLUGIN2(unimmsdataplugin, UniMMSDataPlugin)
-
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/src/unimmsdataplugin_p.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,598 +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: 
- *
- */
-
-//SYSTEM INCLUDES
-#include <e32cmn.h>
-#include <mtclreg.h>
-#include <mtclbase.h>
-#include <msvids.h>
-#include <txtetext.h>
-#include <txtrich.h>
-#include <txtfmlyr.h>
-#include <badesca.h>
-#include <eikrted.h>
-
-#include <mmsclient.h>
-#include <mmssettings.h>
-#include <mmsheaders.h>
-#include <MsgMediaInfo.h>
-#include <MsgMediaResolver.h>
-#include <DRMHelper.h>
-
-
-#include <QDateTime>
-
-#include "convergedmessage.h"
-#include "s60qconversions.h"
-#include "convergedmessageaddress.h"
-#include "unimmsdataplugin_p.h"
-#include "UniDataModel.h"
-#include "debugtraces.h"
-#include "sessioneventhandler.h"
-
-
-#define KSenduiMtmMmsUidValue 0x100058E1
-const TUid KSenduiMtmMmsUid =
-{KSenduiMtmMmsUidValue};
-_LIT(KUnixEpoch, "19700000:000000.000000");
-
-const TInt KMmsArrayAllocationNumber = 6;
-
-UniMMSDataPluginPrivate::UniMMSDataPluginPrivate():
-    mSession(NULL),
-    mMtmRegistry(NULL),
-    mUniDataModel(NULL),
-    mMmsClient(NULL),
-    mInsertingMedia(NULL),
-    iEditor(NULL),
-    iDom(NULL),
-    iDRMHelper(NULL),
-    iSessionHandler(NULL)
-    {
-
-    done = EFalse;
-    iSessionHandler = new SessionEventHandler();
-    mSession = CMsvSession::OpenSyncL(*iSessionHandler);
-    iSessionHandler->start();
-    }
-
-void UniMMSDataPluginPrivate::initL()
-{
-    mMtmRegistry = CClientMtmRegistry::NewL(*mSession);
-    mMmsClient
-    = static_cast<CMmsClientMtm*> (mMtmRegistry->NewMtmL(KSenduiMtmMmsUid));
-
-    User::LeaveIfError(mfsSession.Connect());
-    iMessageId = 0;
-}
-
-UniMMSDataPluginPrivate::~UniMMSDataPluginPrivate()
-{
-    delete iEditor;
-    delete iDom;
-    if(mUniDataModel)
-    {
-        delete mUniDataModel;
-    }
-    mfsSession.Close();
-    delete mMmsClient;
-    delete mMtmRegistry;
-    delete iSessionHandler;
-    delete mSession;
-}
-
-int UniMMSDataPluginPrivate::setMessageId(int messageId)
-{
-    TInt error = KErrNone;
-    TRAP(error, setMessageIdL(messageId));
-    return error;
-}
-
-void UniMMSDataPluginPrivate::setMessageIdL(int messageId)
-{
-    if (done == EFalse)
-    {
-        initL();
-    }
-
-    if (iMessageId != messageId)
-    {
-        if (done)
-        {
-            reset();
-        }
-        done = ETrue;
-        iMessageId = messageId;
-        mMmsClient->SwitchCurrentEntryL(iMessageId);
-        mMmsClient->LoadMessageL();
-        mUniDataModel = CUniDataModel::NewL(mfsSession, *mMmsClient);
-        mUniDataModel->RestoreL(*this, EFalse);
-    }
-}
-
-void UniMMSDataPluginPrivate::reset()
-{
-    delete mUniDataModel;
-    mUniDataModel = NULL;
-}
-
-void UniMMSDataPluginPrivate::body(QString& aBodyText)
-{
-
-    CRichText& textBody = mMmsClient->Body();
-    TInt len = textBody.DocumentLength();
-    HBufC* buf = HBufC::NewL(len);
-    TPtr bufPtr = buf->Des();
-    aBodyText = S60QConversions::s60DescToQString(bufPtr);
-}
-
-int UniMMSDataPluginPrivate::messageSize()
-{
-    return mMmsClient->MessageSize();
-}
-
-
-QString UniMMSDataPluginPrivate::subject()
-{
-   TPtrC sub =  mMmsClient->SubjectL();
-   return S60QConversions::s60DescToQString(sub);
-}
-
-
-
-
-void UniMMSDataPluginPrivate::toRecipientList(
-    ConvergedMessageAddressList& mAddressList)
-{
-    CMsvEntry* cEntry = mSession->GetEntryL(KMsvGlobalInBoxIndexEntryIdValue);
-    CleanupStack::PushL(cEntry);
-    TRAPD (error, cEntry->SetEntryL( iMessageId ));
-    if (error != KErrNone)
-    {
-        CleanupStack::PopAndDestroy(); // cEntry
-        return;
-    }
-    CMsvStore* store = cEntry->ReadStoreL();
-    CleanupStack::PushL(store);
-    CMmsSettings* settings = CMmsSettings::NewL();
-    CleanupStack::PushL(settings);
-    CMmsHeaders* mmsHeaders = CMmsHeaders::NewL(settings->MmsVersion());
-    CleanupStack::PushL(mmsHeaders);
-    mmsHeaders->RestoreL(*store);
-    TPtrC name;
-    TPtrC address;
-    TPtrC to;
-    for (TInt id = 0; id < mmsHeaders->ToRecipients().MdcaCount(); id++)
-    {
-        to.Set( (mmsHeaders->ToRecipients())[id]);
-        extractNameAndAddress(to, name, address);
-        // populate address
-        ConvergedMessageAddress
-        * messageAddress =
-            new ConvergedMessageAddress(S60QConversions::s60DescToQString(address),
-                S60QConversions::s60DescToQString(name));
-        mAddressList.append(messageAddress);
-    }
-
-    CleanupStack::PopAndDestroy(3); //  mmsHeaders, settings, store
-
-    CleanupStack::PopAndDestroy(); // cEntry
-}
-
-void UniMMSDataPluginPrivate::ccRecipientList(
-    ConvergedMessageAddressList& mAddressList)
-{
-    CMsvEntry* cEntry = mSession->GetEntryL(KMsvGlobalInBoxIndexEntryIdValue);
-    CleanupStack::PushL(cEntry);
-    TRAPD (error, cEntry->SetEntryL( iMessageId ));
-    if (error != KErrNone)
-    {
-        CleanupStack::PopAndDestroy(); // cEntry
-        return;
-    }
-    CMsvStore* store = cEntry->ReadStoreL();
-    CleanupStack::PushL(store);
-    CMmsSettings* settings = CMmsSettings::NewL();
-    CleanupStack::PushL(settings);
-    CMmsHeaders* mmsHeaders = CMmsHeaders::NewL(settings->MmsVersion());
-    CleanupStack::PushL(mmsHeaders);
-    mmsHeaders->RestoreL(*store);
-    //CDesCArray& ccList = mmsHeaders->CcRecipients();
-
-    TPtrC cc;
-    TPtrC name;
-    TPtrC address;
-    for (TInt id = 0; id < mmsHeaders->CcRecipients().MdcaCount(); id++)
-    {
-        cc.Set( (mmsHeaders->CcRecipients())[id]);
-        extractNameAndAddress(cc, name, address);
-        // populate address
-        ConvergedMessageAddress
-        * messageAddress =
-            new ConvergedMessageAddress(S60QConversions::s60DescToQString(address),
-                S60QConversions::s60DescToQString(name));
-        mAddressList.append(messageAddress);
-    }
-
-    CleanupStack::PopAndDestroy(3); //  mmsHeaders, settings, store
-
-    CleanupStack::PopAndDestroy(); // cEntry
-}
-
-void UniMMSDataPluginPrivate::bccRecipientList(
-    ConvergedMessageAddressList& mAddressList)
-{
-    CMsvEntry* cEntry = mSession->GetEntryL(KMsvGlobalInBoxIndexEntryIdValue);
-    CleanupStack::PushL(cEntry);
-    TRAPD (error, cEntry->SetEntryL( iMessageId ));
-    if (error != KErrNone)
-    {
-        CleanupStack::PopAndDestroy(); // cEntry
-        return;
-    }
-    CMsvStore* store = cEntry->ReadStoreL();
-    CleanupStack::PushL(store);
-    CMmsSettings* settings = CMmsSettings::NewL();
-    CleanupStack::PushL(settings);
-    CMmsHeaders* mmsHeaders = CMmsHeaders::NewL(settings->MmsVersion());
-    CleanupStack::PushL(mmsHeaders);
-    mmsHeaders->RestoreL(*store);
-    //CDesCArray& bccList = mmsHeaders->BccRecipients();
-
-    TPtrC bcc;
-    TPtrC name;
-    TPtrC address;
-    for (TInt id = 0; id < mmsHeaders->BccRecipients().MdcaCount(); id++)
-    {
-        bcc.Set( (mmsHeaders->BccRecipients())[id]);
-        extractNameAndAddress(bcc, name, address);
-        // populate address
-        ConvergedMessageAddress
-        * messageAddress =
-            new ConvergedMessageAddress(S60QConversions::s60DescToQString(address),
-                S60QConversions::s60DescToQString(name));
-        mAddressList.append(messageAddress);
-    }
-
-    CleanupStack::PopAndDestroy(3); //  mmsHeaders, settings, store
-
-    CleanupStack::PopAndDestroy(); // cEntry
-}
-
-void UniMMSDataPluginPrivate::fromAddress(QString& messageAddress)
-{
-
-    TPtrC sender = mMmsClient->Sender();
-    messageAddress = S60QConversions::s60DescToQString(sender);
-}
-
-UniMessageInfoList UniMMSDataPluginPrivate::attachmentList()
-{
-    UniMessageInfoList attlist;
-    int attcount = mUniDataModel->AttachmentList().Count();
-
-    QString path;
-    QString mimetype;
-    int size;
-    for (int i = 0; i < attcount; i++)
-    {
-        CUniObject *obj = mUniDataModel->AttachmentList().GetByIndex(i);
-
-        mimetype = S60QConversions::s60Desc8ToQString(obj->MimeType());
-        path
-        = S60QConversions::s60DescToQString(obj->MediaInfo()->FullFilePath());
-        size = obj->Size(EFalse);
-
-        UniMessageInfo *msgobj = new UniMessageInfo(path, size, mimetype);
-        attlist << msgobj;
-    }
-
-    return attlist;
-}
-
-QString UniMMSDataPluginPrivate::messageType()
-{
-    QString str("mms");
-    return str;
-}
-
-MsgPriority UniMMSDataPluginPrivate::messagePriority()
-{
-    return Normal;
-}
-
-int UniMMSDataPluginPrivate::attachmentCount()
-{
-    return mUniDataModel->AttachmentList().Count();
-}
-
-bool UniMMSDataPluginPrivate::hasAttachment()
-{
-    int count = mUniDataModel->AttachmentList().Count();
-    if (count > 0)
-    {
-        return true;
-    }
-    else
-    {
-        return false;
-    }
-}
-
-int UniMMSDataPluginPrivate::objectCount()
-{
-    return mUniDataModel->ObjectList().Count();
-}
-
-UniMessageInfoList UniMMSDataPluginPrivate::objectList()
-{
-    UniMessageInfoList objlist;
-    int objcount = mUniDataModel->ObjectList().Count();
-
-    QString path;
-    QString mimetype;
-    int size;
-    for (int i = 0; i < objcount; i++)
-    {
-        CUniObject *obj = mUniDataModel->ObjectList().GetByIndex(i);
-
-        mimetype = S60QConversions::s60Desc8ToQString(obj->MimeType());
-        path
-        = S60QConversions::s60DescToQString(obj->MediaInfo()->FullFilePath());
-        size = obj->Size(EFalse);
-
-        UniMessageInfo *msgobj = new UniMessageInfo(path, size, mimetype);
-        objlist << msgobj;
-    }
-
-    return objlist;
-}
-
-/*
- * For now not reqd
- */
-int UniMMSDataPluginPrivate::slideCount()
-{
-    return mUniDataModel->SmilModel().SlideCount();
-}
-
-UniMessageInfoList UniMMSDataPluginPrivate::slideContent(TInt slidenum)
-{
-    UniMessageInfoList slidecontent;
-
-    int slideobjcount = mUniDataModel->SmilModel().SlideObjectCount(slidenum);
-
-    QString path;
-    QString mimetype;
-    int size;
-    for (int i = 0; i < slideobjcount; i++)
-    {
-        CUniObject *obj = mUniDataModel->SmilModel().GetObjectByIndex(slidenum,
-            i);
-
-        mimetype = S60QConversions::s60Desc8ToQString(obj->MimeType());
-        path
-        = S60QConversions::s60DescToQString(obj->MediaInfo()->FullFilePath());
-        size = obj->Size(EFalse);
-
-        UniMessageInfo *msgobj = new UniMessageInfo(path, size, mimetype);
-        slidecontent << msgobj;
-    }
-
-    return slidecontent;
-}
-
-int UniMMSDataPluginPrivate::timeStamp()
-{
-    QDateTime retTimeStamp;
-    TTime timeStamp = mMmsClient->Entry().Entry().iDate;
-    TTime unixEpoch(KUnixEpoch);
-    TTimeIntervalSeconds seconds;
-    timeStamp.SecondsFrom(unixEpoch, seconds);
-    return seconds.Int();
-}
-
-void UniMMSDataPluginPrivate::extractNameAndAddress(const TDesC& aMsvAddress,
-    TPtrC& aName,
-    TPtrC& aAddress)
-{
-    // For address information separation (start)
-    const TUint KMsgMmsAddressStartChar('<');
-
-    // For address information separation (end)
-    const TUint KMsgMmsAddressEndChar('>');
-
-    TInt addressStart = aMsvAddress.LocateReverse(KMsgMmsAddressStartChar);
-    TInt addressEnd = aMsvAddress.LocateReverse(KMsgMmsAddressEndChar);
-
-    if (addressStart != KErrNotFound && addressEnd != KErrNotFound
-            && addressEnd > addressStart)
-    {
-        // verified address, will be used as selected from contacts manager
-        aName.Set(aMsvAddress.Ptr(), addressStart);
-        aAddress.Set(aMsvAddress.Mid(addressStart + 1).Ptr(), (addressEnd
-                - addressStart) - 1);
-        if (!aAddress.Length())
-        {
-            aAddress.Set(aName);
-            aName.Set(KNullDesC); // empty string
-        }
-    }
-    else
-    {
-        // unverified string, will be used as entered in the header field
-        aName.Set(KNullDesC); // empty string
-        aAddress.Set(aMsvAddress.Ptr(), aMsvAddress.Length()); // a whole string to address
-    }
-
-    if (aName.CompareF(aAddress) == 0)
-    {
-        aName.Set(KNullDesC); // empty string
-    }
-}
-
-void UniMMSDataPluginPrivate::RestoreReady(TInt /*aParseResult*/, 
-    TInt /*aError*/)
-{
-}
-
-void UniMMSDataPluginPrivate::addObjectL( int aSlideNum,UniMessageInfo* aInfo )
-{
-    TInt error = KErrNone;
-
-    HBufC* filePath = S60QConversions::qStringToS60Desc(aInfo->path());
-    if(filePath)	
-    {	
-        CleanupStack::PushL(filePath);	
-
-        RFile file = mUniDataModel->MediaResolver().FileHandleL( *filePath);
-        CleanupClosePushL( file );
-
-        mInsertingMedia = mUniDataModel->MediaResolver().CreateMediaInfoL( file );
-
-        //TODO try using the commented code after testing on diff env or on hardware
-        //mUniDataModel->MediaResolver().ParseInfoDetailsL( mInsertingMedia, file ); 
-        iDRMHelper = CDRMHelper::NewL();   
-        mInsertingMedia->ParseInfoDetailsL( file, *iDRMHelper, *this );
-
-        mUniDataModel->SmilModel().AddObjectL( *this, aSlideNum, mInsertingMedia );
-
-        //Since the ownership is transferred dont delete these
-        mInsertingMedia = NULL;
-        iDRMHelper = NULL;
-
-
-        CleanupStack::PopAndDestroy( &file );
-        CleanupStack::PopAndDestroy( filePath );	
-    }	
-}
-
-void UniMMSDataPluginPrivate::ObjectSaveReady( TInt /*aError*/ )
-{
-
-}
-
-void UniMMSDataPluginPrivate::MediaInfoParsed()
-{
-
-}			
-void UniMMSDataPluginPrivate::addTextObjectL(int aSlideNum,QString aText )
-{
-    TInt error = KErrNone;	
-
-    //Delete this always
-    delete iEditor;
-    iEditor = NULL;
-
-    HBufC* textContent = S60QConversions::qStringToS60Desc(aText);
-    if(textContent)
-    {	
-        CleanupStack::PushL(textContent);		 
-
-        iEditor = new CEikRichTextEditor;   
-        iEditor->ConstructL(NULL,0,0,CEikEdwin::ENoAutoSelection|
-            CEikEdwin::EOwnsWindow,0,0);
-        iEditor->RichText()->InsertL(0,*textContent);
-
-        mUniDataModel->SmilModel().AddTextObjectL( aSlideNum,iEditor);
-        CleanupStack::PopAndDestroy( textContent );	
-    }	
-}		
-
-void UniMMSDataPluginPrivate::addSlideL( int aSlideNum )
-{
-    TInt error = KErrNone;	
-    mUniDataModel->SmilModel().AddSlideL(aSlideNum);
-}		
-
-void UniMMSDataPluginPrivate::composeSmilL(CMsvStore& aEditStore)
-{	
-    TInt error = KErrNone;	
-
-    delete iDom;
-    iDom = NULL;
-
-    iDom = mUniDataModel->SmilModel().ComposeL();
-
-    mUniDataModel->SmilList().CreateSmilAttachmentL( *this,aEditStore, iDom );
-}
-
-void UniMMSDataPluginPrivate::saveObjects()
-{
-    mUniDataModel->ObjectList().SaveAll( *this, CMsvAttachment::EMsvFile );	
-}
-
-void UniMMSDataPluginPrivate::SmilComposeEvent( TInt /*aError*/ )
-{
-
-}
-
-TMsvAttachmentId UniMMSDataPluginPrivate::getSmilAttachmentByIndex() 
-{
-    return mUniDataModel->SmilList().GetSmilAttachmentByIndex( 0 );
-}
-
-void UniMMSDataPluginPrivate::restoreL(CBaseMtm& mtm)
-{
-    initL();	
-    mUniDataModel = CUniDataModel::NewL(mfsSession, mtm);
-    mUniDataModel->RestoreL(*this, ETrue);
-}
-
-void UniMMSDataPluginPrivate::addAttachmentL( UniMessageInfo* aInfo )
-{
-    TInt error = KErrNone;
-
-    HBufC* filePath = S60QConversions::qStringToS60Desc(aInfo->path());
-    if(filePath)    
-    {   
-        CleanupStack::PushL(filePath);  
-
-        RFile file = mUniDataModel->MediaResolver().FileHandleL( *filePath);
-        CleanupClosePushL( file );
-
-        mInsertingMedia = mUniDataModel->MediaResolver().CreateMediaInfoL( file );
-
-        //TODO try using the commented code after testing on diff env or on hardware
-        //mUniDataModel->MediaResolver().ParseInfoDetailsL( mInsertingMedia, file ); 
-        iDRMHelper = CDRMHelper::NewL();   
-        mInsertingMedia->ParseInfoDetailsL( file, *iDRMHelper, *this );
-
-        mUniDataModel->AddAttachmentL( *this, mInsertingMedia,
-            CMsvAttachment::EMsvFile );
-
-        //Since the ownership is transferred dont delete these
-        mInsertingMedia = NULL;
-        iDRMHelper = NULL;
-
-
-        CleanupStack::PopAndDestroy( &file );
-        CleanupStack::PopAndDestroy( filePath );    
-    }   
-}
-
-void UniMMSDataPluginPrivate::removeSlide(int aSlideNumber)
-{
-    mUniDataModel->SmilModel().RemoveSlide(aSlideNumber);
-}
-
-
-CMsvSession* UniMMSDataPluginPrivate::session()
-{
-    return mSession;
-}
-
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/tsrc/bwins/test_unidatamodel_mms_pluginu.def	Fri Apr 16 14:56:15 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/unidatamodel/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/photo.jpg has changed
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/testunidatamodelmmsplugin.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,513 +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 "s60qconversions.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 = S60QConversions::qStringToS60Desc(subject);
-        iMmsClientMtm->SetSubjectL(*subj);
-        }
-
-    //Sender
-    QString sender(TEST_MSG_FROM1);
-    HBufC* addr = S60QConversions::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 = S60QConversions::qStringToS60Desc(recipient);
-    if (addr2)
-        {
-        CleanupStack::PushL(addr2);
-        iMmsClientMtm->AddAddresseeL(EMsvRecipientTo,*addr2);
-        CleanupStack::PopAndDestroy(addr2);
-        }
-    
-    QString recipient2(TEST_MSG_RECIEPIENT2);
-    HBufC* addr3 = S60QConversions::qStringToS60Desc(recipient2);
-    if (addr3)
-        {
-        CleanupStack::PushL(addr3);
-        iMmsClientMtm->AddAddresseeL(EMsvRecipientCc,*addr3);
-        CleanupStack::PopAndDestroy(addr3);
-        }
-        
-    QString recipient3(TEST_MSG_RECIEPIENT3);
-        HBufC* addr4 = S60QConversions::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);
-    
-    pluginLoader->loadPlugins();
-    // Get the MMS data modelplugin
-    pluginInterface = pluginLoader->getDataModelPlugin("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);
-    
-    pluginLoader->loadPlugins();
-    // Get the MMS data modelplugin
-    pluginInterface = pluginLoader->getDataModelPlugin("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 = S60QConversions::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 = S60QConversions::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();
-    
-    pluginLoader->loadPlugins();
-    // Get the MMS data modelplugin
-    pluginInterface = pluginLoader->getDataModelPlugin("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::testPluginLoading()
-{
-    pluginLoader->loadPlugins();
-
-}
-
-
-void TestUniDataModelMMSPlugin::testGetPluginWithoutLoading()
-{
-    pluginInterface = pluginLoader->getDataModelPlugin("mms");
-    QVERIFY(pluginInterface == NULL);
-
-    // Try to geta plugin for a differnt message type
-    pluginInterface = pluginLoader->getDataModelPlugin("vcal");
-    QVERIFY(pluginInterface == NULL);
-}
-
-void TestUniDataModelMMSPlugin::testPluginLoadingMultipleTimes()
-{
-    pluginLoader->loadPlugins();
-    pluginLoader->loadPlugins();
-    pluginLoader->loadPlugins();
-    pluginLoader->loadPlugins();
-}
-
-
-void TestObserverMMS::HandleSessionEventL(TMsvSessionEvent /*aEvent*/,
-                                       TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
-{
-}
-
-
-
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/testunidatamodelmmsplugin.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +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 testPluginLoading(); 
-    void testGetPluginWithoutLoading();
-    void testPluginLoadingMultipleTimes();
-	void testOutboxMessage();
-    void testInboxImageMMSMessage();
-//    void testUnusedAPIs();
-    
-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/unidatamodel/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/testunidatamodelmmsplugin.ini	Fri Apr 16 14:56:15 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/unidatamodel/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/testunidatamodelmmsplugin.pro	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-######################################################################
-# Automatically generated by qmake (2.01a) Fri Aug 7 12:54:45 2009
-######################################################################
-QT += testlib
-QT -= gui
-
-TEMPLATE = lib
-TARGET = test-unidatamodel-mms-plugin
-
-
-INCLUDEPATH += .
-INCLUDEPATH += ../../../../../msgutils/s60qconversions/inc
-INCLUDEPATH += ../../../../../internal/sf/app/messaging/mmsengine/mmsmessage/inc 
-INCLUDEPATH += ../../../../../internal/sf/app/messaging/mmsengine/inc
-INCLUDEPATH += ../../../../../../inc
-
-INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-
-DEFINES += BUILD_TEST_DLL
-
-SOURCES += \
-	TestUniDataModelMmsPlugin.cpp
-
-				 
-
-# Input
-HEADERS += \
-	TestUniDataModelMmsPlugin.h
-	
-	   	   			 
-   
-SYMBIAN_PLATFORMS = WINSCW ARMV5
-    symbian {
-    TARGET.CAPABILITY = CAP_GENERAL_DLL
-    TARGET.EPOCSTACKSIZE = 0x8000
-    TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000
-    TARGET.EPOCALLOWDLLDATA = 1
-    BLD_INF_RULES.prj_exports += "photo.jpg C:/pictures/photo.jpg"
-		}
-		
- LIBS += -leuser \
-	-lconvergedmessageutils\
-	-ls60qconversions \
-	-lmsgs \
-	-lsmcm \
-	-lgsmu \
-	-letext \
-	-lmsgs \
-	-lunidatamodelloader\
-	-lQtCore \
-	-lmmscli \
-	-lefsrv \
-	-lmmsmessage \
-	-lmmsserversettings
-
--- a/messagingapp/msgutils/unidatamodel/unimmsdataplugin/unimmsdataplugin.pro	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,137 +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:
-#
-
-TEMPLATE = lib
-TARGET = $$qtLibraryTarget(unimmsdataplugin)
-
-TARGET.CAPABILITY = All -TCB
-TARGET.EPOCALLOWDLLDATA = 1
-
-#UID 3
-TARGET.UID3 = 0xE01F5465 #need to get a uid 
-
-DEPENDPATH += . inc src
-
-INCLUDEPATH += ./inc
-INCLUDEPATH += ../../../msgutils/s60qconversions/inc
-INCLUDEPATH += ../../unieditorutils/inc
-INCLUDEPATH += ../../../../inc
-INCLUDEPATH += ../../../../mmsengine/mmsmessage/inc 
-INCLUDEPATH += ../../../../mmsengine/inc
-INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-
-SYMBIAN_PLATFORMS = WINSCW ARMV5
-
-CONFIG += plugin
-
-MMP_RULES += "SOURCEPATH ."
-MMP_RULES += "TARGETPATH resource"
-MMP_RULES += "RESOURCE UniDataModel.rss"
-
-# Input
-HEADERS += inc/sessioneventhandler.h \
-	inc/unimmsdataplugin.h \
-	inc/unimmsdataplugin_p.h \
-	inc/UniDataUtils.h \
-        inc/UniDataModel.h \
-        inc/UniDrmInfo.h \
-	inc/UniMimeInfo.h \
-	inc/UniObject.h \
-	inc/UniObjectList.h \
-	inc/UniTextObject.h \
-	inc/UniSmilUtils.h \
-	inc/UniSmilList.h \
-	inc/UniSmilModel.h \
-	inc/UniSmilParams.h \
-	inc/UniSmilSlide.h \
-	inc/ConformanceChecker.h \
-	inc/MsgAttachmentUtils.h \
-	inc/UniModelConst.h \
-	inc/smilliterals.h \
-	inc/UniSmil.rh \
-	inc/UniSmil.hrh
-	
-	   	   
-		   
-SOURCES += src/sessioneventhandler.cpp \
-	src/unimmsdataplugin.cpp \
-	src/unimmsdataplugin_p.cpp \
-	inc/UniDataUtils.inl \
-	src/UniDataUtils.cpp \
-	inc/UniDataModel.inl \
-	src/UniDataModel.cpp \
-	inc/UniDrmInfo.inl \
-	src/UniDrmInfo.cpp \
-	inc/UniMimeInfo.inl \
-	src/UniMimeInfo.cpp \
-	inc/UniObject.inl \
-	src/UniObject.cpp \
-	inc/UniObjectList.inl \
-	src/UniObjectList.cpp \
-	inc/UniTextObject.inl \
-	src/UniTextObject.cpp \
-	src/UniSmilUtils.cpp \
-	inc/UniSmilList.inl \
-	src/UniSmilList.cpp \
-	inc/UniSmilModel.inl \
-	src/UniSmilModel.cpp \
-	inc/UniSmilParams.inl \
-	src/UniSmilParams.cpp \
-	src/UniSmilSlide.cpp \
-	src/MsgAttachmentUtils.cpp \
-	src/ConformanceChecker.cpp
- 
-# Build.inf rules 
-BLD_INF_RULES.prj_exports += \
-  "$${LITERAL_HASH}include <platform_paths.hrh>" \
-  "rom/unimmsdataplugin.iby             CORE_APP_LAYER_IBY_EXPORT_PATH(unimmsdataplugin.iby)" \
-	
-    
- LIBS += -leuser \
-	-lbafl \
-	-lestor \
-	-lconvergedmessageutils\
-	-ls60qconversions \
-	-lmsgs \
-	-letext \
-	-leikctl \
-	-lQtCore \
-	-lmmscli \
-	-lefsrv \
-	-lmmsmessage \
-	-lmmsserversettings \
-	-lcone \
-	-lapmime \
-	-leikcoctl \
-	-lInetProtUtil \
-	-lxmlparser \
-	-lxmldom \
-	-lmsgmedia \
-	-ldrmcommon \
-	-ldrmrights \
-	-ldrmhelper \
-	-lcaf \
-        -lDrmServerInterfaces \
-	-lmsgcommonutils \
-	-lcharconv \
-	-lunieditorutils
-	
-# plugin stub deployment
-plugin.sources = unimmsdataplugin.dll
-plugin.path = \resource\qt\plugins\messaging\datamodel
-DEPLOYMENT += plugin
-
-
--- a/messagingapp/msgutils/unidatamodel/unismsdataplugin/inc/sessioneventhandler.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +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 UNISMSDATAPLUGIN_SH_H_
-#define UNISMSDATAPLUGIN_SH_H_
-
-#include <QObject>
-#include <QThread>
-
-#include <msvapi.h>
-
-
-class SessionEventHandler : public QThread,
-public MMsvSessionObserver
-{
-    Q_OBJECT
-public:
-    SessionEventHandler(QThread* parent=0);
-    ~SessionEventHandler();
-
-public:
-
-    /**
-     * @see MMsvSessionObserver
-     */
-    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2,
-        TAny* aArg3);
-
-private:
-    void run();
-
-};
-
-#endif /* UNISMSDATAPLUGIN_SH_H_ */
--- a/messagingapp/msgutils/unidatamodel/unismsdataplugin/inc/unismsdataplugin.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,220 +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: SMS data model plugin.
- *
- */
-
-#ifndef UNISMSDATAPLUGIN_H_
-#define UNISMSDATAPLUGIN_H_
-
-
-#include <QObject>
-#include "unidatamodelplugininterface.h"
-
-/**
- * SMS data model plugin.
- * Implements the processing of a SMS message in Message Store.
- */
-
-class UniSMSDataPluginPrivate;
-
-class UniSMSDataPlugin : public QObject, public UniDataModelPluginInterface
-{
-    Q_OBJECT
-    Q_INTERFACES(UniDataModelPluginInterface)
-
-public:
-    /**
-     * constructor
-     */
-    UniSMSDataPlugin(QObject* parent = 0);
-
-    /**
-     * Destructor
-     */
-    ~UniSMSDataPlugin();
-    
-    /**
-     * Creates the new instance of the plugin
-     * @return plugin instance
-     */    
-    QObject* createInstance();
-
-
-    /**
-     *  Reset the datamodel
-     */
-    void reset();
-
-    /**
-     * sets the message id for which details needs to be fetched
-     * @param message id
-     */
-    int setMessageId(int mId);
-
-    /**
-     * Get the body of the message
-     * @param aBodyText, for message body
-     */
-    void body(QString& aBodyText);
-
-    /**
-     * size of the message
-     * @return size
-     */
-    int messageSize();
-
-    /**
-     * List of the message TO recipients
-     * @param list of the recipients
-     */
-    void toRecipientList(ConvergedMessageAddressList& mAddressList);
-    /**
-     * List of the message cc recipients
-     * @param list of the recipients
-     */
-    void ccRecipientList(ConvergedMessageAddressList& mAddressList);
-
-    /**
-     * List of the message bCC recipients
-     * @param list of the recipients
-     */
-    void bccRecipientList(ConvergedMessageAddressList& mAddressList);
-
-    /**
-     * Address from which the message was received
-     * @param messageAddress
-     */
-    void fromAddress(QString& messageAddress);
-
-    /**
-     * No. of attachments with the message
-     * @return attachment count 
-     */
-    int attachmentCount();
-
-    /**
-     *  To check if the message has attachments
-     *  @return true if attachment is present
-     */
-    bool hasAttachment();
-
-    /**
-     * list of attachments for a message 
-     * @return attachemnt list
-     */
-    UniMessageInfoList attachmentList();
-
-    /**
-     *  Message type (SMS/MMS etc..)
-     *  @return type of message 
-     */
-    QString messageType();
-
-    /**
-     * Priority of the message (high/low/medium)
-     */
-    MsgPriority messagePriority();
-
-    /**
-     * Number of objects asociated with a MMS message
-     * @return count of objects
-     */
-    int objectCount();
-
-    /**
-     * The MMS object list
-     * @return object list 
-     */
-    UniMessageInfoList objectList();
-
-    /**
-     * Number of slides associated with a MMS message
-     * @return count of slides
-     */
-    int slideCount();
-
-    /**
-     * The MMS slide content 
-     * @return slide list
-     */
-    UniMessageInfoList slideContent(int slidenum);
-
-    /**
-     * Time stamp of the message
-     * @return time stamp of the created/received message
-     */
-    QDateTime timeStamp();
-
-    /**
-     * @see UniDataModelPluginInterface
-     */
-    void addObject( int aslideNum,UniMessageInfo* aInfo );
-
-    /**
-     * @see UniDataModelPluginInterface
-     */    
-    void addTextObject(int aSlideNum,QString aText );
-
-    /**
-     * @see UniDataModelPluginInterface
-     */
-    void addSlide( int aSlideNum );
-
-    /**
-     * @see UniDataModelPluginInterface
-     */
-    void composeSmil(CMsvStore& aEditStore);
-
-    /**
-     * @see UniDataModelPluginInterface
-     */
-    void saveObjects();
-
-    /**
-     * @see UniDataModelPluginInterface
-     */
-    TMsvAttachmentId getSmilAttachmentByIndex();
-
-    /**
-     * @see UniDataModelPluginInterface
-     */
-    void restore(CBaseMtm& mtm);
-
-    /**
-     * @see UniDataModelPluginInterface 
-     */
-    void addAttachment( UniMessageInfo* aInfo );
-
-    /**
-     * @see UniDataModelPluginInterface 
-     */
-    void removeSlide(int aSlideNumber);
-	
-  	/**
-     * @see UniDataModelPluginInterface
-     */
-    QString subject();
-    
-	  /**
-     * @see UniDataModelPluginInterface
-     */
-    CMsvSession* session();
-	
-
-private:
-    UniSMSDataPluginPrivate* d_ptr;
-};
-
-#endif
--- a/messagingapp/msgutils/unidatamodel/unismsdataplugin/inc/unismsdataplugin_p.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +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: Private implementaion of sms data model plugin.
- *
- */
-
-#ifndef UNISMSDATAPLUGINPRIVATE_H_
-#define UNISMSDATAPLUGINPRIVATE_H_
-
-
-
-
-
-//Forward Declarations
-class CClientMtmRegistry;
-class ConvergedMessage;
-class UniSMSDataPlugin;
-class CSmsClientMtm;
-class CMsvSession;
-class SessionEventHandler;
-
-/**
- * Symbian specific implementation of the uni SMS plugin
- */
-class UniSMSDataPluginPrivate
-{
-
-public:
-    /**
-     * Constructor
-     */
-    UniSMSDataPluginPrivate(UniSMSDataPlugin* plugin);
-
-    /**
-     * Destructor
-     */
-    ~UniSMSDataPluginPrivate();
-
-    /**
-     *  Resets the datamodel
-     */
-    void reset();
-
-    /**
-     * sets the message id for which details needs to be fetched
-     * @param message id
-     */
-    int setMessageId(int mId);
-
-    /**
-     * Get the body of the message
-     * @param aBodyText, for message body
-     */
-    void body(QString& aBodyText);
-
-    int messageSize();
-
-    /**
-     * List of the message TO recipients
-     * @param list of the recipients
-     */
-    void toRecipientList(ConvergedMessageAddressList& mAddressList);
-
-    /**
-     * Address from which the message was received
-     * @param messageAddress
-     */
-    void fromAddress(QString& messageAddress);
-
-    /**
-     * Time stamp of the message
-     * @return time stamp of the created/received message
-     */
-    int timeStamp();
-
-	/**
-	 * Session with the Messaging server
-	 * @return CMsvSession*
-	 */
-    CMsvSession* session();
-    
-private:
-    /**
-     *  Extracts the name and address from the CMsvRecipientList
-     */
-    void extractNameAndAddress(const TDesC& aMsvAddress, TPtrC& aName,
-                               TPtrC& aAddress);
-    void initL();
-    
-    void setMessageIdL(int mId);
-
-private:
-    CMsvSession* iMSession;
-    CClientMtmRegistry* iMtmReg;
-    CSmsClientMtm* iSmsClient;
-    TMsvId iMessageId;
-    UniSMSDataPlugin* q_ptr;
-    TBool done;
-    SessionEventHandler *iSessionHandler;
-};
-#endif
--- a/messagingapp/msgutils/unidatamodel/unismsdataplugin/rom/unismsdataplugin.iby	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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 __UNI_SMS_DATA_PLUGIN_IBY__
-#define __UNI_SMS_DATA_PLUGIN_IBY__
-
-
-# this is the plugin stub for QT plugin
-file=ABI_DIR\UREL\unismsdataplugin.dll               SHARED_LIB_DIR\unismsdataplugin.dll
-data=\epoc32\data\z\resource\qt\plugins\messaging\datamodel\unismsdataplugin.qtplugin     \resource\qt\plugins\messaging\datamodel\unismsdataplugin.qtplugin
-
-
-#endif // __UNI_SMS_DATA_PLUGIN_IBY__
-
--- a/messagingapp/msgutils/unidatamodel/unismsdataplugin/src/sessioneventhandler.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +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 "sessioneventhandler.h"
-
-SessionEventHandler::SessionEventHandler(QThread* parent):
-QThread(parent)
-{
-}
-
-SessionEventHandler::~SessionEventHandler()
-{
-}
-
-//---------------------------------------------------------------
-// SessionEventHandler::HandleSessionEventL
-// @see header
-//---------------------------------------------------------------
-void SessionEventHandler::HandleSessionEventL(TMsvSessionEvent /*aEvent*/,
-                                                  TAny* /*aArg1*/,
-                                                  TAny* /*aArg2*/, TAny* /*aArg3*/)
-{
-// do nothing
-}
-
-//---------------------------------------------------------------
-// SessionEventHandler::run
-// @see header
-//---------------------------------------------------------------
-void SessionEventHandler::run()
-{
-    exec();
-}
-
-// EOF
--- a/messagingapp/msgutils/unidatamodel/unismsdataplugin/src/unismsdataplugin.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,328 +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: 
- *
- */
- 
-//SYSTEM INCLUDES
-#include <mtclreg.h>
-#include <mtclbase.h>
-
-//USER INCLUDES
-#include "unismsdataplugin.h"
-#include "unismsdataplugin_p.h"
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::UniSMSDataPlugin()
-// @see header
-//---------------------------------------------------------------
-UniSMSDataPlugin::UniSMSDataPlugin(QObject* parent) :
-    QObject(parent)
-    {
-    d_ptr = new UniSMSDataPluginPrivate(this);
-    }
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::~UniSMSDataPlugin()
-// @see header
-//---------------------------------------------------------------
-UniSMSDataPlugin::~UniSMSDataPlugin()
-{
-    delete d_ptr;
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::createInstance()
-// @see header
-//---------------------------------------------------------------
-QObject* UniSMSDataPlugin::createInstance()
-{
-return new UniSMSDataPlugin();
-}	
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::reset()
-// @see header
-//---------------------------------------------------------------
-void UniSMSDataPlugin::reset()
-{
-    d_ptr->reset();
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::setMessageId()
-// @see header
-//---------------------------------------------------------------
-int UniSMSDataPlugin::setMessageId(int mId)
-{
-    return d_ptr->setMessageId(mId);
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::body()
-// @see header
-//---------------------------------------------------------------
-void UniSMSDataPlugin::body(QString& aBodyText)
-{
-    d_ptr->body(aBodyText);
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::messageSize()
-// @see header
-//---------------------------------------------------------------
-qint32 UniSMSDataPlugin::messageSize()
-{
-    return d_ptr->messageSize();
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::toRecipientList()
-// @see header
-//---------------------------------------------------------------
-void UniSMSDataPlugin::toRecipientList(
-    ConvergedMessageAddressList& mAddressList)
-{
-    d_ptr->toRecipientList(mAddressList);
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::ccRecipientList()
-// @see header
-//---------------------------------------------------------------
-void UniSMSDataPlugin::ccRecipientList(
-    ConvergedMessageAddressList& /*mAddressList*/)
-{
-
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::bccRecipientList()
-// @see header
-//---------------------------------------------------------------
-
-void UniSMSDataPlugin::bccRecipientList(
-    ConvergedMessageAddressList& /*mAddressList*/)
-{
-
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::fromAddress()
-// @see header
-//---------------------------------------------------------------
-void UniSMSDataPlugin::fromAddress(QString& messageAddress)
-{
-    d_ptr->fromAddress(messageAddress);
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::attachmentList()
-// @see header
-//---------------------------------------------------------------
-UniMessageInfoList UniSMSDataPlugin::attachmentList()
-{
-    return QList<UniMessageInfo*> ();
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::messageType()
-// @see header
-//---------------------------------------------------------------
-QString UniSMSDataPlugin::messageType()
-{
-    QString str("sms");
-    return str;
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::messagePriority()
-// @see header
-//---------------------------------------------------------------
-MsgPriority UniSMSDataPlugin::messagePriority()
-{
-    return Normal;
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::attachmentCount()
-// @see header
-//---------------------------------------------------------------
-int UniSMSDataPlugin::attachmentCount()
-{
-    return KErrNone;
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::hasAttachment()
-// @see header
-//---------------------------------------------------------------
-bool UniSMSDataPlugin::hasAttachment()
-{
-    return false;
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::objectCount()
-// @see header
-//---------------------------------------------------------------
-int UniSMSDataPlugin::objectCount()
-{
-    return 0;
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::objectList()
-// @see header
-//---------------------------------------------------------------
-UniMessageInfoList UniSMSDataPlugin::objectList()
-{
-    return QList<UniMessageInfo*> ();
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::slideCount()
-// @see header
-//---------------------------------------------------------------
-int UniSMSDataPlugin::slideCount()
-{
-    return 0;
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::slideContent()
-// @see header
-//---------------------------------------------------------------
-UniMessageInfoList UniSMSDataPlugin::slideContent(int /*slidenum */)
-{
-    return QList<UniMessageInfo*> ();
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::timeStamp()
-// @see header
-//---------------------------------------------------------------
-QDateTime UniSMSDataPlugin::timeStamp()
-{
-    QDateTime retTimeStamp;
-    int tStamp = d_ptr->timeStamp();
-    retTimeStamp.setTime_t(tStamp);
-    return retTimeStamp;
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::addObject()
-// @see header
-//---------------------------------------------------------------
-void UniSMSDataPlugin::addObject( int /*aslideNum*/,
-    UniMessageInfo* /*aInfo*/ )
-{
-
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::addTextObject()
-// @see header
-//---------------------------------------------------------------
-void UniSMSDataPlugin::addTextObject(int /*aSlideNum*/,
-    QString /*aText*/ )
-{
-
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::addSlide()
-// @see header
-//---------------------------------------------------------------
-void UniSMSDataPlugin::addSlide( int /*aSlideNum*/ )
-{
-
-}	
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::composeSmil()
-// @see header
-//---------------------------------------------------------------
-void UniSMSDataPlugin::composeSmil(CMsvStore& /*aEditStore*/)
-{
-
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::saveObjects()
-// @see header
-//---------------------------------------------------------------
-void UniSMSDataPlugin::saveObjects()
-{
-
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::getSmilAttachmentByIndex()
-// @see header
-//---------------------------------------------------------------
-TMsvAttachmentId UniSMSDataPlugin::getSmilAttachmentByIndex() 
-{
-    return NULL;
-}		
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::restore()
-// @see header
-//---------------------------------------------------------------
-void UniSMSDataPlugin::restore(CBaseMtm& /*mtm*/)
-{
-
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::addAttachment()
-// @see header
-//---------------------------------------------------------------
-void UniSMSDataPlugin::addAttachment( UniMessageInfo* /*aInfo*/ )
-{
-
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::removeSlide()
-// @see header
-//---------------------------------------------------------------
-void UniSMSDataPlugin::removeSlide(int /*aSlideNumber*/)
-{
-
-}
-
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::subject()
-// @see header
-//---------------------------------------------------------------
-QString UniSMSDataPlugin::subject()
-{
-  return QString();   
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPlugin::session()
-// @see header
-//---------------------------------------------------------------
-CMsvSession* UniSMSDataPlugin::session()
-{
-    return d_ptr->session();
-}
-
-
-Q_EXPORT_PLUGIN2(unismsdataplugin, UniSMSDataPlugin)
-
--- a/messagingapp/msgutils/unidatamodel/unismsdataplugin/src/unismsdataplugin_p.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,302 +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: 
- *
- */
-
-//SYSTEM INCLUDES
-#include <e32cmn.h>
-#include <mtclreg.h>
-#include <mtclbase.h>
-#include <msvids.h>
-#include <txtetext.h>
-#include <txtrich.h>
-#include <txtfmlyr.h>
-
-#include <smsclnt.h>
-#include "debugtraces.h"
-
-#include <QDateTime>
-
-#include <csmsemailfields.h>
-//USER INCLUDES
-#include "s60qconversions.h"
-#include "convergedmessageaddress.h"
-#include "convergedmessage.h"
-
-#include "unismsdataplugin_p.h"
-#include "sessioneventhandler.h"
-
-#define KSmsMtmUidValue  0x1000102C
-const TUid KSmsMtmUid =
-{KSmsMtmUidValue};
-_LIT(KUnixEpoch, "19700000:000000.000000");
-
-//---------------------------------------------------------------
-// UniSMSDataPluginPrivate::~UniSMSDataPluginPrivate
-// @see header
-//---------------------------------------------------------------
-UniSMSDataPluginPrivate::~UniSMSDataPluginPrivate()
-{
-    q_ptr = NULL;
-    delete iSmsClient;
-    delete iMtmReg;
-    delete iSessionHandler;
-    delete iMSession;
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPluginPrivate::UniSMSDataPluginPrivate
-// @see header
-//---------------------------------------------------------------
-UniSMSDataPluginPrivate::UniSMSDataPluginPrivate(UniSMSDataPlugin* plugin) :
-    iMSession(NULL),
-    iMtmReg(NULL),
-    iSmsClient(NULL),
-    q_ptr(plugin),
-    iSessionHandler(NULL)
-{   
-    iSessionHandler = new SessionEventHandler();
-    iMSession = CMsvSession::OpenSyncL(*iSessionHandler);
-    iSessionHandler->start();
-    done = EFalse;
-}
-
-void UniSMSDataPluginPrivate::initL()
-{
-
-    iMtmReg = CClientMtmRegistry::NewL(*iMSession);
-    TMsvSelectionOrdering ordering;
-
-    CMsvEntry* root = CMsvEntry::NewL(*iMSession,
-                                      KMsvRootIndexEntryId,
-                                      ordering);
-    CleanupStack::PushL(root);
- 
-    TMsvId firstId;
-    TRAPD(err, TSmsUtilities::ServiceIdL(*root,firstId));
-
-    if (err == KErrNotFound)
-    {
-        TMsvEntry entry;
-        entry.iMtm = KUidMsgTypeSMS;
-        entry.iType = KUidMsvServiceEntry;
-        entry.SetReadOnly(EFalse);
-        entry.SetVisible(EFalse);
-        entry.iDate.UniversalTime();
-        entry.iDetails.Set(_L("SMS Service"));
-
-        root->SetEntryL(KMsvRootIndexEntryId);
-        root->CreateL(entry);
-    }
-    
-    CleanupStack::PopAndDestroy(root);
-    iSmsClient = static_cast<CSmsClientMtm*> (iMtmReg->NewMtmL(KSmsMtmUid));
-    done = ETrue;
-    iMessageId = 0;
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPluginPrivate::reset
-// @see header
-//---------------------------------------------------------------
-void UniSMSDataPluginPrivate::reset()
-{
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPluginPrivate::setMessageId
-// @see header
-//---------------------------------------------------------------
-int UniSMSDataPluginPrivate::setMessageId(int mId)
-{
-    TInt error = KErrNone;
-    TRAP(error, setMessageIdL(mId));
-    return error;
-
-}
-
-void UniSMSDataPluginPrivate::setMessageIdL(int mId)
-{
-    if (done == EFalse)
-    {
-        initL();
-    }
-    if (iMessageId != mId)
-    {
-        iMessageId = (TMsvId) mId;
-        iSmsClient->SwitchCurrentEntryL(iMessageId);
-        iSmsClient->LoadMessageL();
-    }
-
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPluginPrivate::body
-// @see header
-//---------------------------------------------------------------
-void UniSMSDataPluginPrivate::body(QString& aBodyText)
-{
-    CRichText& textBody = iSmsClient->Body();
-    TInt len = textBody.DocumentLength();
-    HBufC* buf = HBufC::NewL(len);
-    TPtr bufPtr = buf->Des();
-    textBody.ExtractSelectively(bufPtr, 0, len, CPlainText::EExtractAll);
-    aBodyText = S60QConversions::s60DescToQString(*buf);
-    delete buf;
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPluginPrivate::messageSize
-// @see header
-//---------------------------------------------------------------
-qint32 UniSMSDataPluginPrivate::messageSize()
-{
-    return iSmsClient->Entry().Entry().iSize;
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPluginPrivate::toRecipientList
-// @see header
-//---------------------------------------------------------------
-void UniSMSDataPluginPrivate::toRecipientList(
-                                              ConvergedMessageAddressList& mAddressList)
-{
-    TPtrC name;
-    TPtrC address;
-    // Get the recipient list from the client mtm
-    const CMsvRecipientList& smsRecipients = iSmsClient->AddresseeList();
-
-    for (TInt id = 0; id < smsRecipients.Count(); ++id)
-    {
-        extractNameAndAddress(smsRecipients[id], name, address);
-        // populate address
-        ConvergedMessageAddress
-                * messageAddress =
-                        new ConvergedMessageAddress(S60QConversions::s60DescToQString(address),
-                                                    S60QConversions::s60DescToQString(name));
-        mAddressList.append(messageAddress);
-    }
-
-    const CSmsEmailFields& emailFields = iSmsClient->SmsHeader().EmailFields();
-    // check if it is a EOS
-    if (emailFields.HasAddress())
-    {
-        const MDesCArray& emailRecipients = emailFields.Addresses();
-        for (TInt id = 0; id < emailRecipients.MdcaCount(); ++id)
-        {
-            extractNameAndAddress(emailRecipients.MdcaPoint(id), name, address);
-            ConvergedMessageAddress
-                    * messageAddress =
-                            new ConvergedMessageAddress(S60QConversions::s60DescToQString(address),
-                                                        S60QConversions::s60DescToQString(name));
-            mAddressList.append(messageAddress);
-        }
-    }
-
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPluginPrivate::fromAddress
-// @see header
-//---------------------------------------------------------------
-void UniSMSDataPluginPrivate::fromAddress(QString& messageAddress)
-{
-    CPlainText* pText = CPlainText::NewL();
-    CleanupStack::PushL(pText);
-
-    CSmsHeader* smsHeader = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *pText);
-    CleanupStack::PushL(smsHeader);
-
-    CMsvEntry *cEntry = CMsvEntry::NewL(iSmsClient->Session(),
-                                        iMessageId,
-                                        TMsvSelectionOrdering());
-    CleanupStack::PushL(cEntry);
-
-    CMsvStore* store = cEntry->ReadStoreL();
-    CleanupStack::PushL(store);
-
-    smsHeader->RestoreL(*store);
-
-    messageAddress
-            = S60QConversions::s60DescToQString(smsHeader->FromAddress());
-    CleanupStack::PopAndDestroy(4, pText);
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPluginPrivate::timeStamp
-// @see header
-//---------------------------------------------------------------
-int UniSMSDataPluginPrivate::timeStamp()
-{
-    QDateTime retTimeStamp;
-    TTime timeStamp = iSmsClient->Entry().Entry().iDate;
-    TTime unixEpoch(KUnixEpoch);
-    TTimeIntervalSeconds seconds;
-    timeStamp.SecondsFrom(unixEpoch, seconds);
-    return seconds.Int();
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPluginPrivate::session
-// @see header
-//---------------------------------------------------------------
-CMsvSession* UniSMSDataPluginPrivate::session()
-{
-    return iMSession;
-}
-
-//---------------------------------------------------------------
-// UniSMSDataPluginPrivate::extractNameAndAddress
-// @see header
-//---------------------------------------------------------------
-void UniSMSDataPluginPrivate::extractNameAndAddress(const TDesC& aMsvAddress,
-                                                    TPtrC& aName,
-                                                    TPtrC& aAddress)
-{
-    // For address information separation (start)
-    const TUint KMsgSmsAddressStartChar('<');
-
-    // For address information separation (end)
-    const TUint KMsgSmsAddressEndChar('>');
-
-    TInt addressStart = aMsvAddress.LocateReverse(KMsgSmsAddressStartChar);
-    TInt addressEnd = aMsvAddress.LocateReverse(KMsgSmsAddressEndChar);
-
-    if (addressStart != KErrNotFound && addressEnd != KErrNotFound
-            && addressEnd > addressStart)
-    {
-        // verified address, will be used as selected from contacts manager
-        aName.Set(aMsvAddress.Ptr(), addressStart);
-        aAddress.Set(aMsvAddress.Mid(addressStart + 1).Ptr(), (addressEnd
-                - addressStart) - 1);
-        if (!aAddress.Length())
-        {
-            aAddress.Set(aName);
-            aName.Set(KNullDesC); // empty string
-        }
-    }
-    else
-    {
-        // unverified string, will be used as entered in the header field
-        aName.Set(KNullDesC); // empty string
-        aAddress.Set(aMsvAddress.Ptr(), aMsvAddress.Length()); // a whole string to address
-    }
-
-    if (aName.CompareF(aAddress) == 0)
-    {
-        aName.Set(KNullDesC); // empty string
-    }
-}
-
--- a/messagingapp/msgutils/unidatamodel/unismsdataplugin/tsrc/bwins/test_unidatamodel_sms_pluginu.def	Fri Apr 16 14:56:15 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)
-
--- a/messagingapp/msgutils/unidatamodel/unismsdataplugin/tsrc/testunidatamodelsmsplugin/testunidatamodelsmsplugin.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,665 +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 "s60qconversions.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 = S60QConversions::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 = S60QConversions::qStringToS60Desc(recepient);
-    HBufC* addr2 = S60QConversions::qStringToS60Desc(recepient2);
-    HBufC* alias1 = S60QConversions::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 = S60QConversions::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 = S60QConversions::qStringToS60Desc(recepient);
-    HBufC* addr2 = S60QConversions::qStringToS60Desc(recepient2);
-    HBufC* alias1 = S60QConversions::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 = S60QConversions::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 = S60QConversions::qStringToS60Desc(recepient);
-    HBufC* addr2 = S60QConversions::qStringToS60Desc(recepient2);
-    HBufC* alias1 = S60QConversions::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 = S60QConversions::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 = S60QConversions::qStringToS60Desc(recipient);
-    HBufC* addr2 = S60QConversions::qStringToS60Desc(recipient2);
-    HBufC* alias1 = S60QConversions::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 = S60QConversions::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::testPluginLoading()
-{
-    pluginLoader->loadPlugins();
-
-}
-void TestUniDataModelSMSPlugin::testPluginLoadingMultipleTimes()
-{
-    pluginLoader->loadPlugins();
-    pluginLoader->loadPlugins();
-    pluginLoader->loadPlugins();
-    pluginLoader->loadPlugins();
-}
-
-void TestUniDataModelSMSPlugin::testInboxMessage()
-{
-    createInboxSMS();
-    pluginLoader->loadPlugins();
-    // Get the SMS data modelplugin
-    pluginInterface = pluginLoader->getDataModelPlugin("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();
-    pluginLoader->loadPlugins();
-    // Get the SMS data modelplugin
-    pluginInterface = pluginLoader->getDataModelPlugin("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();
-    pluginLoader->loadPlugins();
-    // Get the SMS data modelplugin
-    pluginInterface = pluginLoader->getDataModelPlugin("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();
-    pluginLoader->loadPlugins();
-    // Get the SMS data modelplugin
-    pluginInterface = pluginLoader->getDataModelPlugin("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();
-    pluginLoader->loadPlugins();
-    // Get the SMS data modelplugin
-    pluginInterface = pluginLoader->getDataModelPlugin("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("sms");
-    QVERIFY(pluginInterface == NULL);
-
-    // Try to geta plugin for a differnt message type
-    pluginInterface = pluginLoader->getDataModelPlugin("mms");
-    QVERIFY(pluginInterface == NULL);
-}
-
-void TestUniDataModelSMSPlugin::testUnusedAPIs()
-{
-    pluginLoader->loadPlugins();
-
-    pluginInterface = pluginLoader->getDataModelPlugin("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/unidatamodel/unismsdataplugin/tsrc/testunidatamodelsmsplugin/testunidatamodelsmsplugin.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +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 testPluginLoading(); 
-    void testGetPluginWithoutLoading();
-    void testInboxMessage();
-    void testOutboxMessage();
-    void testSentMessage();
-    void testDraftsMessage();
-    void testDraftsMessageNoRecipient();
-    void testPluginLoadingMultipleTimes();
-    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/unidatamodel/unismsdataplugin/tsrc/testunidatamodelsmsplugin/testunidatamodelsmsplugin.ini	Fri Apr 16 14:56:15 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/unidatamodel/unismsdataplugin/tsrc/testunidatamodelsmsplugin/testunidatamodelsmsplugin.pro	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +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-unidatamodel-sms-plugin
-
-
-INCLUDEPATH += .
-INCLUDEPATH += ../../../../../../inc
-INCLUDEPATH += ../../../../../msgutils/s60qconversions/inc
-INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-
-DEFINES += BUILD_TEST_DLL
-
-SOURCES += \
-	testunidatamodelsmsplugin.cpp
-
-				 
-
-# Input
-HEADERS += \
-	testunidatamodelsmsplugin.h
-	
-	   	   			 
-   
-SYMBIAN_PLATFORMS = WINSCW ARMV5
-    symbian {
-    TARGET.CAPABILITY = CAP_GENERAL_DLL
-    TARGET.EPOCSTACKSIZE = 0x8000
-    TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000
-    TARGET.EPOCALLOWDLLDATA = 1
-		}
-		
- LIBS += -leuser \
-	-lconvergedmessageutils\
-	-ls60qconversions \
-	-lmsgs \
-	-lsmcm \
-	-lgsmu \
-	-letext \
-	-lmsgs \
-	-lunidatamodelloader\
-	-lQtCore
-	
-
--- a/messagingapp/msgutils/unidatamodel/unismsdataplugin/unismsdataplugin.pro	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +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:
-#
-
-TEMPLATE = lib
-TARGET = $$qtLibraryTarget(unismsdataplugin)
-
-TARGET.CAPABILITY = All -TCB
-TARGET.EPOCALLOWDLLDATA = 1
-
-#UID 3
-TARGET.UID3 = 0x2001FE60
-
-DEPENDPATH += . inc src
-
-INCLUDEPATH += ./inc
-INCLUDEPATH += ../../../msgutils/s60qconversions/inc
-INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-INCLUDEPATH += ../../../../inc
-
-
-SYMBIAN_PLATFORMS = WINSCW ARMV5
-
-CONFIG += plugin
-
-# Input
-HEADERS += inc/sessioneventhandler.h \
-	inc/unismsdataplugin.h \
-	inc/unismsdataplugin_p.h
-		   
-SOURCES += src/sessioneventhandler.cpp \
-	src/unismsdataplugin.cpp \
-	src/unismsdataplugin_p.cpp 
- 
-# Build.inf rules 
-BLD_INF_RULES.prj_exports += \
-  "$${LITERAL_HASH}include <platform_paths.hrh>" \
-   "rom/unismsdataplugin.iby             CORE_APP_LAYER_IBY_EXPORT_PATH(unismsdataplugin.iby)" 
-    
- LIBS += -leuser \
-	-lconvergedmessageutils\
-	-ls60qconversions \
-	-lmsgs \
-	-lSmcm \
-	-lgsmu \
-	-letext \
-	-lQtCore
-	
-# plugin stub deployment
-plugin.sources = unismsdataplugin.dll
-plugin.path = \resource\qt\plugins\messaging\datamodel
-DEPLOYMENT += plugin
-
-
Binary file messagingapp/msgutils/unidatamodel/univcaldataplugin/BioMtm.rsc has changed
--- a/messagingapp/msgutils/unidatamodel/univcaldataplugin/inc/sessioneventhandler.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +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 UNIVCALDATAPLUGIN_SH_H_
-#define UNIVCALDATAPLUGIN_SH_H_
-
-#include <QObject>
-#include <QThread>
-
-#include <msvapi.h>
-
-
-class SessionEventHandler : public QThread,
-public MMsvSessionObserver
-{
-    Q_OBJECT
-public:
-    SessionEventHandler(QThread* parent=0);
-    ~SessionEventHandler();
-
-public:
-
-    /**
-     * @see MMsvSessionObserver
-     */
-    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2,
-        TAny* aArg3);
-
-private:
-    void run();
-
-};
-
-#endif /* UNIVCALDATAPLUGIN_SH_H_ */
--- a/messagingapp/msgutils/unidatamodel/univcaldataplugin/inc/univcaldataplugin.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +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: SMS data model plugin.
- *
- */
-
-#ifndef UNIVCALDATAPLUGIN_H_
-#define UNIVCALDATAPLUGIN_H_
-
-#include <QObject>
-#include "unidatamodelplugininterface.h"
-
-/**
- * SMS data model plugin.
- * Implements the processing of a SMS message in Message Store.
- */
-
-class UniVCalDataPluginPrivate;
-
-class UniVCalDataPlugin : public QObject, public UniDataModelPluginInterface
-{
-Q_OBJECT
-    Q_INTERFACES(UniDataModelPluginInterface)
-
-public:
-    /**
-     * constructor
-     */
-    UniVCalDataPlugin(QObject* parent = 0);
-
-    /**
-     * Destructor
-     */
-    ~UniVCalDataPlugin();
-    
-    /**
-     * Creates the new instance of the plugin
-     * @return plugin instance
-     */    
-    QObject* createInstance();
-
-    /**
-     *  Reset the datamodel
-     */
-    void reset();
-
-    /**
-     * sets the message id for which details needs to be fetched
-     * @param message id
-     */
-    int setMessageId(int mId);
-
-    /**
-     * Get the body of the message
-     * @param aBodyText, for message body
-     */
-    void body(QString& aBodyText);
-
-    /**
-     * size of the message
-     * @return size
-     */
-    int messageSize();
-
-    /**
-     * List of the message TO recipients
-     * @param list of the recipients
-     */
-    void toRecipientList(ConvergedMessageAddressList& mAddressList);
-    /**
-     * List of the message cc recipients
-     * @param list of the recipients
-     */
-    void ccRecipientList(ConvergedMessageAddressList& mAddressList);
-
-    /**
-     * List of the message bCC recipients
-     * @param list of the recipients
-     */
-    void bccRecipientList(ConvergedMessageAddressList& mAddressList);
-
-    /**
-     * Address from which the message was received
-     * @param messageAddress
-     */
-    void fromAddress(QString& messageAddress);
-
-    /**
-     * No. of attachments with the message
-     * @return attachment count 
-     */
-    int attachmentCount();
-
-    /**
-     *  To check if the message has attachments
-     *  @return true if attachment is present
-     */
-    bool hasAttachment();
-
-    /**
-     * list of attachments for a message 
-     * @return attachemnt list
-     */
-    UniMessageInfoList attachmentList();
-
-    /**
-     *  Message type (SMS/MMS etc..)
-     *  @return type of message 
-     */
-    QString messageType();
-
-    /**
-     * Priority of the message (high/low/medium)
-     */
-    MsgPriority messagePriority();
-
-    /**
-     * Number of objects asociated with a MMS message
-     * @return count of objects
-     */
-    int objectCount();
-
-    /**
-     * The MMS object list
-     * @return object list 
-     */
-    UniMessageInfoList objectList();
-
-    /**
-     * Number of slides associated with a MMS message
-     * @return count of slides
-     */
-    int slideCount();
-
-    /**
-     * The MMS slide content 
-     * @return slide list
-     */
-    UniMessageInfoList slideContent(int slidenum);
-
-    /**
-     * Time stamp of the message
-     * @return time stamp of the created/received message
-     */
-    QDateTime timeStamp();
-
-    /**
-     * @see UniDataModelPluginInterface
-     */
-    void addObject( int aslideNum,UniMessageInfo* aInfo );
-
-    /**
-     * @see UniDataModelPluginInterface
-     */    
-    void addTextObject(int aSlideNum,QString aText );
-
-    /**
-     * @see UniDataModelPluginInterface
-     */
-    void addSlide( int aSlideNum );
-
-    /**
-     * @see UniDataModelPluginInterface
-     */
-    void composeSmil(CMsvStore& aEditStore);
-
-    /**
-     * @see UniDataModelPluginInterface
-     */
-    void saveObjects();
-
-    /**
-     * @see UniDataModelPluginInterface
-     */
-    TMsvAttachmentId getSmilAttachmentByIndex();
-
-    /**
-     * @see UniDataModelPluginInterface
-     */
-    void restore(CBaseMtm& mtm);
-
-    /**
-     * @see UniDataModelPluginInterface 
-     */
-    void addAttachment( UniMessageInfo* aInfo );
-
-    /**
-     * @see UniDataModelPluginInterface 
-     */
-    void removeSlide(int aSlideNumber);
-	
-	/**
-     * @see UniDataModelPluginInterface 
-     */
-		QString subject();
-    
-	/**
-     * @see UniDataModelPluginInterface 
-     */
-		CMsvSession* session();
-
-private:
-    UniVCalDataPluginPrivate* d_ptr;
-};
-
-#endif
--- a/messagingapp/msgutils/unidatamodel/univcaldataplugin/inc/univcaldataplugin_p.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +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: Private implementaion of sms data model plugin.
- *
- */
-
-#ifndef UNIVCALDATAPLUGINPRIVATE_H_
-#define UNIVCALDATAPLUGINPRIVATE_H_
-
-#include "unidatamodelplugininterface.h"
-
-//Forward Declarations
-class CClientMtmRegistry;
-class ConvergedMessage;
-class UniVCalDataPlugin;
-class CBIOClientMtm;
-class CMsvSession;
-class SessionEventHandler;
-
-/**
- * Symbian specific implementation of the uni SMS plugin
- */
-class UniVCalDataPluginPrivate
-{
-
-public:
-    /**
-     * Constructor
-     */
-    UniVCalDataPluginPrivate(UniVCalDataPlugin* plugin);
-
-    /**
-     * Destructor
-     */
-    ~UniVCalDataPluginPrivate();
-
-    /**
-     *  Resets the datamodel
-     */
-    void reset();
-
-    /**
-     * sets the message id for which details needs to be fetched
-     * @param message id
-     */
-    int setMessageId(int mId);
-
-    /**
-     * Get the body of the message
-     * @param aBodyText, for message body
-     */
-    void body(QString& aBodyText);
-
-    /**
-     * Size of the message
-     * @param message size
-     */
-    int messageSize();
-
-    /**
-     * List of the message TO recipients
-     * @param list of the recipients
-     */
-    void toRecipientList(ConvergedMessageAddressList& mAddressList);
-
-    /**
-     * Address from which the message was received
-     * @param messageAddress
-     */
-    void fromAddress(QString& messageAddress);
-
-    /**
-     * Time stamp of the message
-     * @return time stamp of the created/received message
-     */
-    int timeStamp();
-
-    /**
-     * The File handle of the VCAL attachment
-     * @return file handle
-     */
-    RFile attachmentL();
-
-    /**
-     * Priority of the message
-     * @return message priority
-     */
-    MsgPriority messagePriority();
-
-    /**
-     * Number of attachments associated with the message..
-     * @return  attachment count
-     */
-    int attachmentCount();
-
-	/**
-	 * Session with the Messaging server
-	 * @return CMsvSession*
-	 */
-    CMsvSession* session();
-
-private:
-    /**
-     *  Extracts the name and address from the CMsvRecipientList
-     */
-    void extractNameAndAddress(const TDesC& aMsvAddress, TPtrC& aName,
-                               TPtrC& aAddress);
-    
-    /**
-     * intitlaises the CMsvSession and mtm
-     */
-    void initL();
-    
-    /**
-     * setMessageIdL
-     * @param int msgId
-     * @return void
-     */
-    void setMessageIdL(int msgId);
-private:
-    UniVCalDataPlugin* q_ptr;
-    CMsvSession* iMSession;
-    CClientMtmRegistry* iMtmReg;
-    CBIOClientMtm* iBioClientMtm;
-    TMsvId iMessageId;
-    TBool attachmentProcessed;
-    CMsvEntry* iMsvEntry;
-    SessionEventHandler *iSessionHandler;
-    TBool done;
-};
-#endif
Binary file messagingapp/msgutils/unidatamodel/univcaldataplugin/prov.rsc has changed
--- a/messagingapp/msgutils/unidatamodel/univcaldataplugin/rom/univcaldataplugin.iby	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +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 __UNI_VCAL_DATA_PLUGIN_IBY__
-#define __UNI_VCAL_DATA_PLUGIN_IBY__
-
-
-# this is the plugin stub for QT plugin
-file=ABI_DIR\UREL\univcaldataplugin.dll               SHARED_LIB_DIR\univcaldataplugin.dll
-data=\epoc32\data\z\resource\qt\plugins\messaging\datamodel\univcaldataplugin.qtplugin     \resource\qt\plugins\messaging\datamodel\univcaldataplugin.qtplugin
-
-data=DATAZ_\RESOURCE_FILES_DIR\messaging\mtm\BioMtm.rsc   RESOURCE_FILES_DIR\messaging\mtm\BioMtm.rsc
-
-data=DATAZ_\BIOFILE_DIR\vcdp.rsc                                   BIOFILE_DIR\vcdp.rsc
-data=DATAZ_\BIOFILE_DIR\vcdp.mbm                                   BIOFILE_DIR\vcdp.mbm
-
-data=DATAZ_\BIOFILE_DIR\vclp.rsc                                  BIOFILE_DIR\vclp.rsc
-data=DATAZ_\BIOFILE_DIR\vclp.mbm                                  BIOFILE_DIR\vclp.mbm
-
-data=DATAZ_\BIOFILE_DIR\wapp.rsc                                   BIOFILE_DIR\wapp.rsc
-data=DATAZ_\BIOFILE_DIR\wapp.mbm                                   BIOFILE_DIR\wapp.mbm
-
-data=DATAZ_\BIOFILE_DIR\rtp.rsc                                  BIOFILE_DIR\rtp.rsc
-data=DATAZ_\BIOFILE_DIR\rtp.mbm                                  BIOFILE_DIR\rtp.mbm
-
-data=DATAZ_\BIOFILE_DIR\iacp.rsc                                   BIOFILE_DIR\iacp.rsc
-data=DATAZ_\BIOFILE_DIR\iacp.mbm                                   BIOFILE_DIR\iacp.mbm
-
-data=DATAZ_\BIOFILE_DIR\enp.rsc                                  BIOFILE_DIR\enp.rsc
-data=DATAZ_\BIOFILE_DIR\enp.mbm                                  BIOFILE_DIR\enp.mbm
-
-data=DATAZ_\BIOFILE_DIR\cbcp.rsc                                  BIOFILE_DIR\cbcp.rsc
-data=DATAZ_\BIOFILE_DIR\cbcp.mbm                                  BIOFILE_DIR\cbcp.mbm
-
-data=DATAZ_\BIOFILE_DIR\olp.rsc                                  BIOFILE_DIR\olp.rsc
-data=DATAZ_\BIOFILE_DIR\olp.mbm                                  BIOFILE_DIR\olp.mbm
-
-data=DATAZ_\BIOFILE_DIR\prov.rsc                                  BIOFILE_DIR\prov.rsc
-
-#endif // __UNI_VCAL_DATA_PLUGIN_IBY__
-
--- a/messagingapp/msgutils/unidatamodel/univcaldataplugin/src/sessioneventhandler.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +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 "sessioneventhandler.h"
-
-SessionEventHandler::SessionEventHandler(QThread* parent):
-QThread(parent)
-{
-}
-
-SessionEventHandler::~SessionEventHandler()
-{
-}
-
-//---------------------------------------------------------------
-// SessionEventHandler::HandleSessionEventL
-// @see header
-//---------------------------------------------------------------
-void SessionEventHandler::HandleSessionEventL(TMsvSessionEvent /*aEvent*/,
-                                                  TAny* /*aArg1*/,
-                                                  TAny* /*aArg2*/, TAny* /*aArg3*/)
-{
-// do nothing
-}
-
-//---------------------------------------------------------------
-// SessionEventHandler::run
-// @see header
-//---------------------------------------------------------------
-void SessionEventHandler::run()
-{
-    exec();
-}
-
-// EOF
--- a/messagingapp/msgutils/unidatamodel/univcaldataplugin/src/univcaldataplugin.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,324 +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:
- *
- */
-
-//SYSTEM INCLUDES
-#include <mtclreg.h>
-#include <mtclbase.h>
-#include <s60qconversions.h>
-
-//USER INCLUDES
-#include "univcaldataplugin.h"
-#include "univcaldataplugin_p.h"
-
-// UniVCalDataPlugin::UniVCalDataPlugin()
-// @see header
-//---------------------------------------------------------------
-UniVCalDataPlugin::UniVCalDataPlugin(QObject* parent) :
-    QObject(parent)
-    {
-    d_ptr = new UniVCalDataPluginPrivate(this);
-    }
-
-// UniVCalDataPlugin::~UniVCalDataPlugin()
-// @see header
-//---------------------------------------------------------------
-UniVCalDataPlugin::~UniVCalDataPlugin()
-{
-    delete d_ptr;
-}
-
-// UniVCalDataPlugin::createInstance()
-// @see header
-//---------------------------------------------------------------
-QObject* UniVCalDataPlugin::createInstance()
-{
-return new UniVCalDataPlugin();
-}	
-
-// UniVCalDataPlugin::reset()
-// @see header
-//---------------------------------------------------------------
-void UniVCalDataPlugin::reset()
-{
-    d_ptr->reset();
-}
-
-// UniVCalDataPlugin::setMessageId()
-// @see header
-//---------------------------------------------------------------
-int UniVCalDataPlugin::setMessageId(int mId)
-{
-    return d_ptr->setMessageId(mId);
-}
-
-// UniVCalDataPlugin::body()
-// @see header
-//---------------------------------------------------------------
-void UniVCalDataPlugin::body(QString& aBodyText)
-{
-    d_ptr->body(aBodyText);
-}
-
-// UniVCalDataPlugin::messageSize()
-// @see header
-//---------------------------------------------------------------
-qint32 UniVCalDataPlugin::messageSize()
-{
-    return d_ptr->messageSize();
-}
-
-// UniVCalDataPlugin::toRecipientList()
-// @see header
-//---------------------------------------------------------------
-void UniVCalDataPlugin::toRecipientList(
-    ConvergedMessageAddressList& mAddressList)
-{
-    d_ptr->toRecipientList(mAddressList);
-}
-
-// UniVCalDataPlugin::ccRecipientList()
-// @see header
-//---------------------------------------------------------------
-void UniVCalDataPlugin::ccRecipientList(ConvergedMessageAddressList& /*mAddressList*/)
-{
-
-}
-
-// UniVCalDataPlugin::bccRecipientList()
-// @see header
-//---------------------------------------------------------------
-
-void UniVCalDataPlugin::bccRecipientList(ConvergedMessageAddressList& /*mAddressList*/)
-{
-
-}
-
-// UniVCalDataPlugin::fromAddress()
-// @see header
-//---------------------------------------------------------------
-void UniVCalDataPlugin::fromAddress(QString& messageAddress)
-{
-    d_ptr->fromAddress(messageAddress);
-}
-
-// UniVCalDataPlugin::attachmentList()
-// @see header
-//---------------------------------------------------------------
-UniMessageInfoList UniVCalDataPlugin::attachmentList()
-{
-    RFile file = d_ptr->attachmentL();
-
-    UniMessageInfoList attlist;
-
-    QString path;
-    QString mimetype;
-    int size;
-
-    TFileName fullName;
-    User::LeaveIfError(file.FullName(fullName));
-    User::LeaveIfError(file.Size(size));
-
-    path = S60QConversions::s60DescToQString(*fullName.AllocL());
-
-    UniMessageInfo *msgobj = new UniMessageInfo(path, size, mimetype);
-    attlist << msgobj;
-    file.Close();
-    return attlist;
-}
-
-// UniVCalDataPlugin::messageType()
-// @see header
-//---------------------------------------------------------------
-QString UniVCalDataPlugin::messageType()
-{
-    QString str("bio:vcal");
-    return str;
-}
-
-// UniVCalDataPlugin::messagePriority()
-// @see header
-//---------------------------------------------------------------
-MsgPriority UniVCalDataPlugin::messagePriority()
-{
-    return d_ptr->messagePriority();
-}
-
-// UniVCalDataPlugin::attachmentCount()
-// @see header
-//---------------------------------------------------------------
-int UniVCalDataPlugin::attachmentCount()
-{
-    return d_ptr->attachmentCount();
-}
-
-// UniVCalDataPlugin::hasAttachment()
-// @see header
-//---------------------------------------------------------------
-bool UniVCalDataPlugin::hasAttachment()
-{
-    return true;
-}
-
-// UniVCalDataPlugin::objectCount()
-// @see header
-//---------------------------------------------------------------
-int UniVCalDataPlugin::objectCount()
-{
-    return 0;
-}
-
-// UniVCalDataPlugin::objectList()
-// @see header
-//---------------------------------------------------------------
-UniMessageInfoList UniVCalDataPlugin::objectList()
-{
-    return QList<UniMessageInfo*> ();
-}
-
-// UniVCalDataPlugin::slideCount()
-// @see header
-//---------------------------------------------------------------
-int UniVCalDataPlugin::slideCount()
-{
-    return 0;
-}
-
-// UniVCalDataPlugin::slideContent()
-// @see header
-//---------------------------------------------------------------
-UniMessageInfoList UniVCalDataPlugin::slideContent(int /*slidenum*/)
-{
-    return QList<UniMessageInfo*> ();
-}
-
-// UniVCalDataPlugin::timeStamp()
-// @see header
-//---------------------------------------------------------------
-QDateTime UniVCalDataPlugin::timeStamp()
-{
-    QDateTime retTimeStamp;
-    int tStamp = d_ptr->timeStamp();
-    retTimeStamp.setTime_t(tStamp);
-    return retTimeStamp;
-}
-
-//---------------------------------------------------------------
-// UniVCalDataPlugin::addObject()
-// @see header
-//---------------------------------------------------------------
-void UniVCalDataPlugin::addObject( int /*aslideNum*/,
-    UniMessageInfo* /*aInfo*/ )
-{
-
-}
-
-//---------------------------------------------------------------
-// UniVCalDataPlugin::addTextObject()
-// @see header
-//---------------------------------------------------------------
-void UniVCalDataPlugin::addTextObject(int /*aSlideNum*/,
-    QString /*aText*/ )
-{
-
-}
-
-//---------------------------------------------------------------
-// UniVCalDataPlugin::addSlide()
-// @see header
-//---------------------------------------------------------------
-void UniVCalDataPlugin::addSlide( int /*aSlideNum*/ )
-{
-
-}   
-
-//---------------------------------------------------------------
-// UniVCalDataPlugin::composeSmil()
-// @see header
-//---------------------------------------------------------------
-void UniVCalDataPlugin::composeSmil(CMsvStore& /*aEditStore*/)
-{
-
-}
-
-//---------------------------------------------------------------
-// UniVCalDataPlugin::saveObjects()
-// @see header
-//---------------------------------------------------------------
-void UniVCalDataPlugin::saveObjects()
-{
-
-}
-
-//---------------------------------------------------------------
-// UniVCalDataPlugin::getSmilAttachmentByIndex()
-// @see header
-//---------------------------------------------------------------
-TMsvAttachmentId UniVCalDataPlugin::getSmilAttachmentByIndex() 
-{
-    return NULL;
-}       
-
-//---------------------------------------------------------------
-// UniVCalDataPlugin::restore()
-// @see header
-//---------------------------------------------------------------
-void UniVCalDataPlugin::restore(CBaseMtm& /*mtm*/)
-{
-
-}
-
-//---------------------------------------------------------------
-// UniVCalDataPlugin::addAttachment()
-// @see header
-//---------------------------------------------------------------
-void UniVCalDataPlugin::addAttachment( UniMessageInfo* /*aInfo*/ )
-{
-
-}
-
-//---------------------------------------------------------------
-// UniVCalDataPlugin::removeSlide()
-// @see header
-//---------------------------------------------------------------
-void UniVCalDataPlugin::removeSlide(int /*aSlideNumber*/)
-{
-
-}
-
-//---------------------------------------------------------------
-// UniVCalDataPlugin::subject()
-// @see header
-//---------------------------------------------------------------
-QString UniVCalDataPlugin::subject()
-{
-  return QString();   
-}
-
-
-//---------------------------------------------------------------
-// UniVCalDataPlugin::session()
-// @see header
-//---------------------------------------------------------------
-CMsvSession* UniVCalDataPlugin::session()
-{
-    return d_ptr->session();
-}
-
-
-
-Q_EXPORT_PLUGIN2(UniVCalDataPlugin, UniVCalDataPlugin)
-
--- a/messagingapp/msgutils/unidatamodel/univcaldataplugin/src/univcaldataplugin_p.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,319 +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: 
- *
- */
-
-//SYSTEM INCLUDES
-#include <e32cmn.h>
-#include <mtclreg.h>
-#include <mtclbase.h>
-#include <msvids.h>
-#include <txtetext.h>
-#include <txtrich.h>
-#include <txtfmlyr.h>
-#include <smsclnt.h>
-
-#include <bioscmds.h>
-#include <biocmtm.h>
-#include "debugtraces.h"
-
-#include <QDateTime>
-#include <s60qconversions.h>
-#include <mmsvattachmentmanager.h>
-
-#include "convergedmessage.h"
-#include "convergedmessageaddress.h"
-#include "univcaldataplugin_p.h"
-#include "sessioneventhandler.h"
-
-#define KBioUidValue  0x10001262
-const TUid KBioUidValueUid =
-{KBioUidValue};
-
-
-_LIT(KUnixEpoch, "19700000:000000.000000");
-
-//---------------------------------------------------------------
-// UniVCalDataPluginPrivate::~UniVCalDataPluginPrivate
-// @see header
-//---------------------------------------------------------------
-UniVCalDataPluginPrivate::~UniVCalDataPluginPrivate()
-{
-    q_ptr = NULL;
-    if (iMsvEntry)
-    {
-        delete iMsvEntry;
-    }
-
-    delete iBioClientMtm;
-    delete iMtmReg;
-    delete iSessionHandler;
-    delete iMSession;
-
-}
-
-//---------------------------------------------------------------
-// UniVCalDataPluginPrivate::UniVCalDataPluginPrivate
-// @see header
-//---------------------------------------------------------------
-UniVCalDataPluginPrivate::UniVCalDataPluginPrivate(UniVCalDataPlugin* plugin) :
-    q_ptr(plugin), iMSession(NULL), iMtmReg(NULL), iBioClientMtm(NULL),
-            iMsvEntry(NULL), iSessionHandler(NULL)
-{
-    iSessionHandler = new SessionEventHandler();
-    // Create a new messaging server session..
-    iMSession = CMsvSession::OpenSyncL(*iSessionHandler);
-    iSessionHandler->start();
-    done = EFalse;
-}
-
-void UniVCalDataPluginPrivate::initL()
-{
-    iMtmReg = CClientMtmRegistry::NewL(*iMSession);
-    iBioClientMtm = (CBIOClientMtm*) iMtmReg->NewMtmL(KBioUidValueUid);
-
-    attachmentProcessed = EFalse;
-    done = ETrue;
-
-}
-
-//---------------------------------------------------------------
-// UniVCalDataPluginPrivate::reset
-// @see header
-//---------------------------------------------------------------
-void UniVCalDataPluginPrivate::reset()
-{
-}
-
-//---------------------------------------------------------------
-// UniVCalDataPluginPrivate::setMessageId
-// @see header
-//---------------------------------------------------------------
-int UniVCalDataPluginPrivate::setMessageId(int mId)
-{
-    TInt error = KErrNone;
-    TRAP(error, setMessageIdL(mId));
-    return error;
-}
-
-//---------------------------------------------------------------
-// UniVCalDataPluginPrivate::setMessageIdL
-// @see header
-//---------------------------------------------------------------
-void UniVCalDataPluginPrivate::setMessageIdL(int mId)
-{
-    if (done == EFalse)
-    {
-        initL();
-    }
-    iMessageId = (TMsvId) mId;
-    iBioClientMtm->SwitchCurrentEntryL(iMessageId);
-
-    iMsvEntry = CMsvEntry::NewL(iBioClientMtm->Session(),
-                                iMessageId,
-                                TMsvSelectionOrdering());
-
-    iBioClientMtm->LoadMessageL();
-}
-
-//---------------------------------------------------------------
-// UniVCalDataPluginPrivate::body
-// @see header
-//---------------------------------------------------------------
-void UniVCalDataPluginPrivate::body(QString& aBodyText)
-{
-
-    CRichText& textBody = iBioClientMtm->Body();
-    TInt len = textBody.DocumentLength();
-    HBufC* buf = HBufC::NewL(len);
-    TPtr bufPtr = buf->Des();
-    textBody.ExtractSelectively(bufPtr, 0, len, CPlainText::EExtractAll);
-    aBodyText = S60QConversions::s60DescToQString(*buf);
-    delete buf;
-}
-
-//---------------------------------------------------------------
-// UniVCalDataPluginPrivate::messageSize
-// @see header
-//---------------------------------------------------------------
-qint32 UniVCalDataPluginPrivate::messageSize()
-{
-    return iBioClientMtm->Entry().Entry().iSize;
-}
-
-//---------------------------------------------------------------
-// UniVCalDataPluginPrivate::toRecipientList
-// @see header
-//---------------------------------------------------------------
-void UniVCalDataPluginPrivate::toRecipientList(
-                                               ConvergedMessageAddressList& mAddressList)
-{
-    TPtrC name;
-    TPtrC address;
-
-    CPlainText* pText = CPlainText::NewL();
-    CleanupStack::PushL(pText);
-
-    CSmsHeader* smsHeader = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *pText);
-    CleanupStack::PushL(smsHeader);
-
-    CMsvStore* store = iMsvEntry->ReadStoreL();
-    CleanupStack::PushL(store);
-
-    smsHeader->RestoreL(*store);
-
-    for (TInt id = 0; id < smsHeader->Recipients().Count(); ++id)
-    {
-        CSmsNumber* rcpt = smsHeader->Recipients()[id];
-        name.Set(rcpt->Name());
-        address.Set(rcpt->Address());
-
-        ConvergedMessageAddress
-                * messageAddress =
-                        new ConvergedMessageAddress(S60QConversions::s60DescToQString(address),
-                                                    S60QConversions::s60DescToQString(name));
-        mAddressList.append(messageAddress);
-    }
-    CleanupStack::PopAndDestroy(3, pText);
-
-}
-
-//---------------------------------------------------------------
-// UniVCalDataPluginPrivate::fromAddress
-// @see header
-//---------------------------------------------------------------
-void UniVCalDataPluginPrivate::fromAddress(QString& messageAddress)
-{
-    CPlainText* pText = CPlainText::NewL();
-    CleanupStack::PushL(pText);
-
-    CSmsHeader* smsHeader = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *pText);
-    CleanupStack::PushL(smsHeader);
-
-    CMsvStore* store = iMsvEntry->ReadStoreL();
-    CleanupStack::PushL(store);
-
-    smsHeader->RestoreL(*store);
-
-    messageAddress
-            = S60QConversions::s60DescToQString(smsHeader->FromAddress());
-    CleanupStack::PopAndDestroy(3, pText);
-}
-
-//---------------------------------------------------------------
-// UniVCalDataPluginPrivate::timeStamp
-// @see header
-//---------------------------------------------------------------
-int UniVCalDataPluginPrivate::timeStamp()
-{
-    QDateTime retTimeStamp;
-    TTime timeStamp = iBioClientMtm->Entry().Entry().iDate;
-    TTime unixEpoch(KUnixEpoch);
-    TTimeIntervalSeconds seconds;
-    timeStamp.SecondsFrom(unixEpoch, seconds);
-    return seconds.Int();
-}
-
-//---------------------------------------------------------------
-// UniVCalDataPluginPrivate::attachmentList
-// @see header
-//---------------------------------------------------------------
-RFile UniVCalDataPluginPrivate::attachmentL()
-{
-    if (attachmentProcessed)
-    {
-
-        CMsvStore* store1 = iMsvEntry->ReadStoreL();
-        CleanupStack::PushL(store1);
-        MMsvAttachmentManager& attachMan = store1->AttachmentManagerL();
-        RFile file = attachMan.GetAttachmentFileL(0);
-        CleanupStack::PopAndDestroy(store1);
-        return file;
-    }
-
-    CMsvEntrySelection* selection = new (ELeave) CMsvEntrySelection;
-    CleanupStack::PushL(selection);
-
-    selection->AppendL(iMessageId);
-
-    TBuf8<1> aParameter;
-    CMsvOperationWait* wait = CMsvOperationWait::NewLC();
-    wait->iStatus = KRequestPending;
-    wait->Start();
-
-    CMsvOperation* operation =
-            iBioClientMtm->InvokeAsyncFunctionL(KBiosMtmParse,
-                                                *selection,
-                                                aParameter,
-                                                wait->iStatus);
-
-    CActiveScheduler::Start();
-
-    CMsvStore* store = iMsvEntry->ReadStoreL();
-    CleanupStack::PushL(store);
-    MMsvAttachmentManager& attachMan = store->AttachmentManagerL();
-    RFile file = attachMan.GetAttachmentFileL(0);
-
-    delete operation;
-    CleanupStack::PopAndDestroy(3,selection);
-    attachmentProcessed = ETrue;
-    return file;
-
-}
-
-//---------------------------------------------------------------
-// UniVCalDataPluginPrivate::attachmentCount
-// @see header
-//---------------------------------------------------------------
-
-int UniVCalDataPluginPrivate::attachmentCount()
-{
-    if (!attachmentProcessed)
-    {
-        RFile file = attachmentL();
-        file.Close();
-    }
-
-    CMsvStore* store = iMsvEntry->ReadStoreL();
-    CleanupStack::PushL(store);
-
-    MMsvAttachmentManager& attachMan = store->AttachmentManagerL();
-    int count = attachMan.AttachmentCount();
-    CleanupStack::PopAndDestroy(store);
-
-    return count;
-}
-
-//---------------------------------------------------------------
-// UniVCalDataPluginPrivate::messagePriority
-// @see header
-//---------------------------------------------------------------
-
-MsgPriority UniVCalDataPluginPrivate::messagePriority()
-{
-
-    MsgPriority priority = (MsgPriority) iMsvEntry->Entry().Priority();
-    return priority;
-}
-
-//---------------------------------------------------------------
-// UniVCalDataPluginPrivate::session
-// @see header
-//---------------------------------------------------------------
-CMsvSession* UniVCalDataPluginPrivate::session()
-{
-    return iMSession;
-}
-
--- a/messagingapp/msgutils/unidatamodel/univcaldataplugin/tsrc/bwins/test_unidatamodel_vcal_pluginu.def	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-EXPORTS
-	?SetForMtmTypeL@TestUniDataModelVCalPlugin@@AAEXAAVTMsvEntry@@W4TBIOMessageType@@@Z @ 1 NONAME ; void TestUniDataModelVCalPlugin::SetForMtmTypeL(class TMsvEntry &, enum TBIOMessageType)
-	?SetSessionPath@TestUniDataModelVCalPlugin@@AAEXABVTDesC16@@@Z @ 2 NONAME ; void TestUniDataModelVCalPlugin::SetSessionPath(class TDesC16 const &)
-	?CreateBioEntryClientSideL@TestUniDataModelVCalPlugin@@AAEXAAVTMsvEntry@@AAVCRichText@@@Z @ 3 NONAME ; void TestUniDataModelVCalPlugin::CreateBioEntryClientSideL(class TMsvEntry &, class CRichText &)
-	?trUtf8@TestUniDataModelVCalPlugin@@SA?AVQString@@PBD0H@Z @ 4 NONAME ; class QString TestUniDataModelVCalPlugin::trUtf8(char const *, char const *, int)
-	?qt_metacall@TestUniDataModelVCalPlugin@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 5 NONAME ; int TestUniDataModelVCalPlugin::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?CreateBIOEntryL@TestUniDataModelVCalPlugin@@AAEJAAVTDesC16@@W4TBIOMessageType@@@Z @ 6 NONAME ; long TestUniDataModelVCalPlugin::CreateBIOEntryL(class TDesC16 &, enum TBIOMessageType)
-	?initTestCase@TestUniDataModelVCalPlugin@@AAEXXZ @ 7 NONAME ; void TestUniDataModelVCalPlugin::initTestCase(void)
-	?CreateBIOEntryFromFileL@TestUniDataModelVCalPlugin@@AAEJABVTDesC16@@W4TBIOMessageType@@@Z @ 8 NONAME ; long TestUniDataModelVCalPlugin::CreateBIOEntryFromFileL(class TDesC16 const &, enum TBIOMessageType)
-	?testPluginLoading@TestUniDataModelVCalPlugin@@AAEXXZ @ 9 NONAME ; void TestUniDataModelVCalPlugin::testPluginLoading(void)
-	?testGetPluginWithoutLoading@TestUniDataModelVCalPlugin@@AAEXXZ @ 10 NONAME ; void TestUniDataModelVCalPlugin::testGetPluginWithoutLoading(void)
-	?testDraftsVCalMessage@TestUniDataModelVCalPlugin@@AAEXXZ @ 11 NONAME ; void TestUniDataModelVCalPlugin::testDraftsVCalMessage(void)
-	?tr@TestUniDataModelVCalPlugin@@SA?AVQString@@PBD0@Z @ 12 NONAME ; class QString TestUniDataModelVCalPlugin::tr(char const *, char const *)
-	?getStaticMetaObject@TestUniDataModelVCalPlugin@@SAABUQMetaObject@@XZ @ 13 NONAME ; struct QMetaObject const & TestUniDataModelVCalPlugin::getStaticMetaObject(void)
-	?testInBoxVCalMessage@TestUniDataModelVCalPlugin@@AAEXXZ @ 14 NONAME ; void TestUniDataModelVCalPlugin::testInBoxVCalMessage(void)
-	?qt_metacast@TestUniDataModelVCalPlugin@@UAEPAXPBD@Z @ 15 NONAME ; void * TestUniDataModelVCalPlugin::qt_metacast(char const *)
-	?init@TestUniDataModelVCalPlugin@@AAEXXZ @ 16 NONAME ; void TestUniDataModelVCalPlugin::init(void)
-	?metaObject@TestUniDataModelVCalPlugin@@UBEPBUQMetaObject@@XZ @ 17 NONAME ; struct QMetaObject const * TestUniDataModelVCalPlugin::metaObject(void) const
-	?tr@TestUniDataModelVCalPlugin@@SA?AVQString@@PBD0H@Z @ 18 NONAME ; class QString TestUniDataModelVCalPlugin::tr(char const *, char const *, int)
-	?ReadFromFileL@TestUniDataModelVCalPlugin@@AAEPAVHBufC16@@ABVTDesC16@@@Z @ 19 NONAME ; class HBufC16 * TestUniDataModelVCalPlugin::ReadFromFileL(class TDesC16 const &)
-	?SetBIOServiceIdL@TestUniDataModelVCalPlugin@@AAEJXZ @ 20 NONAME ; long TestUniDataModelVCalPlugin::SetBIOServiceIdL(void)
-	?cleanupTestCase@TestUniDataModelVCalPlugin@@AAEXXZ @ 21 NONAME ; void TestUniDataModelVCalPlugin::cleanupTestCase(void)
-	?SetMessageType@TestUniDataModelVCalPlugin@@AAE?AW4TBIOMessageType@@ABVTDesC16@@@Z @ 22 NONAME ; enum TBIOMessageType TestUniDataModelVCalPlugin::SetMessageType(class TDesC16 const &)
-	?trUtf8@TestUniDataModelVCalPlugin@@SA?AVQString@@PBD0@Z @ 23 NONAME ; class QString TestUniDataModelVCalPlugin::trUtf8(char const *, char const *)
-	?testUnusedAPIs@TestUniDataModelVCalPlugin@@AAEXXZ @ 24 NONAME ; void TestUniDataModelVCalPlugin::testUnusedAPIs(void)
-	?staticMetaObject@TestUniDataModelVCalPlugin@@2UQMetaObject@@B @ 25 NONAME ; struct QMetaObject const TestUniDataModelVCalPlugin::staticMetaObject
-	?GenerateMessagesL@TestUniDataModelVCalPlugin@@AAEPAVCMsvEntrySelection@@XZ @ 26 NONAME ; class CMsvEntrySelection * TestUniDataModelVCalPlugin::GenerateMessagesL(void)
-	?testPluginLoadingMultipleTimes@TestUniDataModelVCalPlugin@@AAEXXZ @ 27 NONAME ; void TestUniDataModelVCalPlugin::testPluginLoadingMultipleTimes(void)
-	?cleanup@TestUniDataModelVCalPlugin@@AAEXXZ @ 28 NONAME ; void TestUniDataModelVCalPlugin::cleanup(void)
-
Binary file messagingapp/msgutils/unidatamodel/univcaldataplugin/tsrc/testunidatamodelvcalplugin/BioMtm.rsc has changed
--- a/messagingapp/msgutils/unidatamodel/univcaldataplugin/tsrc/testunidatamodelvcalplugin/testunidatamodelvcalplugin.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,645 +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 <s60qconversions.h>
-#include <bsp.h>
-#include <biodb.h> 
-#include <biouids.h>
-#include <biocmtm.h>
-
-#include "serviceinfo.h"
-#include "testunidatamodelvcalplugin.h"
-#include "unidatamodelloader.h"
-#include "testunidatamodelvcalplugin.ini"
-#include "unidatamodelplugininterface.h"
-#include "convergedmessage.h"
-
-const TInt KTelephoneNumberMaxLength = 32;
-_LIT(KBIOTxtFilePath, "C:\\test\\");
-_LIT(KBIOvCalenderPrefix, "vcal*");
-// vCalender
-_LIT(KUnixEpoch, "19700000:000000.000000");
-#define KBioUidValue  0x10001262
-
-const TUid KBioUidValueUid =
-{KBioUidValue};
-
-//---------------------------------------------------------------
-// TestUniDataModelVCalPlugin::init
-//---------------------------------------------------------------
-
-
-void TestUniDataModelVCalPlugin::initTestCase()
-{
-
-}
-void TestUniDataModelVCalPlugin::cleanupTestCase()
-{
-
-}
-
-void TestUniDataModelVCalPlugin::init()
-{
-    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;
-    drafts = EFalse;
-}
-
-//---------------------------------------------------------------
-// TestUniDataModelVCalPlugin::cleanup
-//---------------------------------------------------------------
-void TestUniDataModelVCalPlugin::cleanup()
-{
-    if (newEntryId > 0)
-        iMsvEntry->DeleteL(newEntryId);
-    delete iMsvEntry;
-    iMsvEntry = NULL;
-    delete iObserver;
-    iObserver = NULL;
-    delete iMSession;
-    iMSession = NULL;
-    delete pluginLoader;
-
-}
-
-void TestUniDataModelVCalPlugin::testInBoxVCalMessage()
-{
-    inbox = ETrue;
-    GenerateMessagesL();
-
-    pluginLoader->loadPlugins();
-
-    pluginInterface = pluginLoader->getDataModelPlugin("bio:vcal");
-    pluginInterface->setMessageId(newEntryId);
-
-    int count = pluginInterface->attachmentCount();
-    QVERIFY(count == 1);
-
-    UniMessageInfoList attachmentlist = pluginInterface->attachmentList();
-    QVERIFY(!attachmentlist.isEmpty());
-
-    UniMessageInfo* att = attachmentlist.at(0);
-    QString path = att->path();
-
-    QString recepient(TEST_MSG_FROM1);
-    QString fromaddress;
-    pluginInterface->fromAddress(fromaddress);
-    QVERIFY(recepient == fromaddress);
-
-    QString body;
-    pluginInterface->body(body);
-    QVERIFY(!body.isEmpty());
-
-    // Compare input message , with the read message
-    RFile origFile;
-    int op = origFile.Open(iFs, currentFile, EFileRead);
-    QVERIFY(op == 0);
-    
-    TBuf8<1000> readBuf;
-    HBufC* readBuf16 = HBufC::NewL(2000);
-    
-    origFile.Read(readBuf);
-    readBuf16->Des().Copy(readBuf);
-
-    QString orig = S60QConversions::s60DescToQString(*readBuf16);
-    origFile.Close();
-
-    HBufC* filepath = S60QConversions::qStringToS60Desc(path);
-
-    RFile file;
-    op = file.Open(iFs, *filepath, EFileRead);
-    QVERIFY(op == 0);
-   
-    file.Read(readBuf);
-    readBuf16->Des().Copy(readBuf);
-    QString bod = S60QConversions::s60DescToQString(*readBuf16);
-
-    delete readBuf16;
-    file.Close();
-    // compare Input body and output body 
-    QVERIFY(bod == orig );
-
-    int size = pluginInterface->messageSize();
-
-    MsgPriority priority = pluginInterface->messagePriority();
-    // Normal priority
-    qDebug() << "prority" << priority;
-    QVERIFY(priority == 1);
-
-    QVERIFY(pluginInterface->timeStamp() == retTimeStamp);
-
-    ConvergedMessageAddressList recipientList;
-    pluginInterface->toRecipientList(recipientList);
-    QVERIFY(recipientList.count() == 0);
-    iMsvEntry->SetEntryL(KMsvGlobalInBoxIndexEntryId);
-}
-
-void TestUniDataModelVCalPlugin::testDraftsVCalMessage()
-{
-    drafts = ETrue;
-    GenerateMessagesL();
-
-    pluginLoader->loadPlugins();
-
-    pluginInterface = pluginLoader->getDataModelPlugin("bio:vcal");
-    pluginInterface->setMessageId(newEntryId);
-
-    int count = pluginInterface->attachmentCount();
-    QVERIFY(count == 1);
-
-    UniMessageInfoList attachmentlist = pluginInterface->attachmentList();
-    QVERIFY(!attachmentlist.isEmpty());
-
-    UniMessageInfo* att = attachmentlist.at(0);
-    QString path = att->path();
-
-    QString fromaddress;
-    pluginInterface->fromAddress(fromaddress);
-    QVERIFY(fromaddress.isEmpty());
-
-    QString body;
-    pluginInterface->body(body);
-    QVERIFY(!body.isEmpty());
-
-    // Compare input message , with the read message
-    RFile origFile;
-    int op = origFile.Open(iFs, currentFile, EFileRead);
-    QVERIFY(op == 0);
-    
-    TBuf8<1000> readBuf;
-    HBufC* readBuf16 = HBufC::NewL(2000);
-
-    origFile.Read(readBuf);
-    readBuf16->Des().Copy(readBuf);
-
-    QString orig = S60QConversions::s60DescToQString(*readBuf16);
-    origFile.Close();
-
-    HBufC* filepath = S60QConversions::qStringToS60Desc(path);
-
-    RFile file;
-    op = file.Open(iFs, *filepath, EFileRead);
-    QVERIFY(op == 0);
-    
-    file.Read(readBuf);
-
-    readBuf16->Des().Copy(readBuf);
-
-    QString bod = S60QConversions::s60DescToQString(*readBuf16);
-
-    delete readBuf16;
-    file.Close();
-    // compare Input body and output body 
-    QVERIFY(bod == orig );
-
-    int size = pluginInterface->messageSize();
-
-    MsgPriority priority = pluginInterface->messagePriority();
-    // Normal priority
-    qDebug() << "prority" << priority;
-    QVERIFY(priority == 1);
-
-    QVERIFY(pluginInterface->timeStamp() == retTimeStamp);
-
-    ConvergedMessageAddressList recipientList;
-    pluginInterface->toRecipientList(recipientList);
-    QString recepient(TEST_MSG_FROM1);
-    QString recepient2(TEST_MSG_FROM2);
-    QString origalias(TEST_MSG_ALIAS1);
-
-    QVERIFY(recipientList.count() == 2);
-
-    QVERIFY(recepient == recipientList[0]->address());
-
-    QVERIFY( recipientList[0]->alias().isEmpty());
-
-    const QString& as = recipientList[1]->address();
-    const QString& as1 = recipientList[1]->alias();
-    QVERIFY(recepient2 == as);
-
-    QVERIFY(origalias == as1);
-    iMsvEntry->SetEntryL(KMsvDraftEntryId);
-}
-
-void TestUniDataModelVCalPlugin::testGetPluginWithoutLoading()
-{
-    pluginInterface = pluginLoader->getDataModelPlugin("bio:vcal");
-    QVERIFY(pluginInterface == NULL);
-
-    // Try to geta plugin for a differnt message type
-    pluginInterface = pluginLoader->getDataModelPlugin("bio:vcard");
-    QVERIFY(pluginInterface == NULL);
-}
-
-void TestUniDataModelVCalPlugin::testPluginLoading()
-{
-    pluginLoader->loadPlugins();
-
-}
-void TestUniDataModelVCalPlugin::testPluginLoadingMultipleTimes()
-{
-    pluginLoader->loadPlugins();
-    pluginLoader->loadPlugins();
-    pluginLoader->loadPlugins();
-    pluginLoader->loadPlugins();
-}
-
-void TestUniDataModelVCalPlugin::testUnusedAPIs()
-{
-    pluginLoader->loadPlugins();
-
-    pluginInterface = pluginLoader->getDataModelPlugin("bio:vcal");
-
-    QVERIFY(pluginInterface->objectCount() == 0);
-
-    UniMessageInfoList objectlist = pluginInterface->objectList();
-    QVERIFY(objectlist.isEmpty());
-
-    QVERIFY(pluginInterface->slideCount() == 0);
-
-    UniMessageInfoList slidelist = pluginInterface->slideContent(0);
-    QVERIFY(slidelist.isEmpty());
-    
-    QVERIFY(pluginInterface->hasAttachment() == true );
-    
-    ConvergedMessageAddressList recipientList;
-    
-	pluginInterface->ccRecipientList(recipientList);
-	QVERIFY(recipientList.count() == 0);
-		
-	pluginInterface->bccRecipientList(recipientList);
-	QVERIFY(recipientList.count() == 0);
-}
-
-CMsvEntrySelection* TestUniDataModelVCalPlugin::GenerateMessagesL()
-{
-    HBufC* aFileDirectory = KBIOTxtFilePath().AllocL();
-    TMsvId messageId;
-    TBIOMessageType currentMsgType;
-
-    CMsvEntrySelection* selection = new (ELeave) CMsvEntrySelection();
-    CleanupStack::PushL(selection);
-
-    TInt err = iFs.GetDir(aFileDirectory->Des(),
-                          KEntryAttMatchMask,
-                          ESortByName,
-                          iDir);
-    if (err == KErrPathNotFound)
-    {
-        TInt makeDirErr = iFs.MkDirAll(aFileDirectory->Des());
-        makeDirErr == KErrNone ? User::Leave(KErrNotFound)
-                : User::Leave(makeDirErr);
-    }
-    else if (err != KErrNone)
-    {
-        User::Leave(err);
-    }
-
-    // Set the session path for the RFs
-    SetSessionPath(aFileDirectory->Des());
-    if (iDir)
-    {
-        delete iDir;
-        iDir = NULL;
-    }
-        
-    User::LeaveIfError(iFs.GetDir(_L("*.txt"), KEntryAttNormal, ESortByName, iDir));
-    TInt count = iDir->Count();
-    if (count == 0)
-    {
-        User::Leave(KErrNotFound); // No files to process
-    }
-
-    TBuf<60> outputBuf;
-
-    for (TInt loop = 0; loop < count; loop++)
-    {
-        TEntry as = (*iDir)[0];
-        currentFile = (as.iName);
-        // Not processed all the messages - so keep the current state
-        iFilesProcessed++; // Here because need to update the counter promptly
-        currentMsgType = SetMessageType(currentFile);
-        if (currentMsgType != ENoMessage) // skip any dodgy filenames
-        {
-            messageId = CreateBIOEntryFromFileL(currentFile, currentMsgType);
-            selection->AppendL(messageId);
-            TPtrC tempPtr = (currentFile.Des());
-
-        }
-    }
-    CleanupStack::Pop(); // selection
-    return selection;
-}
-
-TBIOMessageType TestUniDataModelVCalPlugin::SetMessageType(
-                                                           const TDesC& aFileName)
-{
-
-    if (aFileName.MatchF(KBIOvCalenderPrefix) == 0)
-    {
-        return EBiovCalenderMessage;
-    }
-
-    return ENoMessage;
-}
-
-TMsvId TestUniDataModelVCalPlugin::CreateBIOEntryFromFileL(
-                                                           const TDesC& aFilename,
-                                                           TBIOMessageType aMessageType)
-{
-    //First use the filename to get the message body, 
-    // then convert '\n' to the paragraph delimiters used in proper SMS 
-    HBufC* tempBuffer;
-
-    tempBuffer = ReadFromFileL(aFilename);
-    CleanupStack::PushL(tempBuffer);
-
-    newEntryId = CreateBIOEntryL(*tempBuffer, aMessageType);
-
-    // Finished with our local descriptors - free up some memory
-    CleanupStack::PopAndDestroy();
-    return newEntryId;
-}
-
-void TestUniDataModelVCalPlugin::SetSessionPath(const TDesC& aSessionPath)
-{
-    iFs.SetSessionPath(aSessionPath);
-}
-
-HBufC* TestUniDataModelVCalPlugin::ReadFromFileL(const TDesC& aFile)
-{
-    RFile file;
-    TBuf8<1024> lineBuffer;
-    TInt err = KErrNone;
-
-    err = file.Open(iFs, aFile, EFileStreamText | EFileRead | EFileShareAny);
-
-    if (err != KErrNone) // Didn't find the file, so leave - should only get valid filenames!
-    {
-        User::Leave(KErrNotFound);
-    }
-
-    HBufC* bioBuf = HBufC::NewLC(65535); // Create a new descriptor on the heap.
-    HBufC* copyBuffer = HBufC::NewLC(1024);
-
-    do // Read in the text from file, and also check if there is a name field:
-    {
-        err = file.Read(lineBuffer);// Read upto 256 chars, '\n' and all...
-        //err = ReadLineL(file,lineBuffer);
-        if (err == KErrNone) // Made a valid read,
-            if (lineBuffer.Length() == 0) // but read 0 chars
-                err = KErrEof; // so set err value to end processing
-
-        if (err == KErrNone)
-        {
-            copyBuffer->Des().Copy(lineBuffer);// Copy, and overwrite existing text
-            if ( (bioBuf->Length() + copyBuffer->Length())
-                    > bioBuf->Des().MaxLength())
-            {
-                bioBuf = bioBuf->ReAllocL(bioBuf->Length()
-                        + copyBuffer->Length());
-            }
-            bioBuf->Des().Append(*copyBuffer);
-            //bioBuf->Des().Append(_L("\n"));
-        }
-    }while (err != KErrEof);
-
-    CleanupStack::PopAndDestroy(); // Destroy the copyBuffer.
-    CleanupStack::Pop();// Remove the bioBuf.
-
-    file.Close();
-    return bioBuf;
-}
-
-TMsvId TestUniDataModelVCalPlugin::CreateBIOEntryL(TDesC& aText,
-                                                   TBIOMessageType aMessageType)
-{
-    // Ensure that we have a valid service ID to work with:
-    TMsvId iBioServiceId;
-
-    iBioServiceId = SetBIOServiceIdL();
-
-    HBufC* localBuffer = aText.AllocL();
-    CleanupStack::PushL(localBuffer);
-
-    TPtr messDes = localBuffer->Des();
-
-    if (aMessageType != EBiovCardMessage && aMessageType
-            != EBiovCalenderMessage)
-    {
-        // convert \r\n to \n since this is what is expected from SMS when not vCard data
-        for (TInt i = 0; i < messDes.Length(); i++)
-        {
-            if (messDes[i] == (TText) '\r' && i < messDes.Length() - 1
-                    && messDes[i + 1] == (TText) '\n')
-                messDes.Delete(i, 1);
-        }
-    }
-
-    //  Create and fill a CRichText object for the jobbie:
-    CParaFormatLayer* paraFormatLayer = CParaFormatLayer::NewL();
-    CleanupStack::PushL(paraFormatLayer);
-    CCharFormatLayer* charFormatLayer = CCharFormatLayer::NewL();
-    CleanupStack::PushL(charFormatLayer);
-    CRichText* richText = CRichText::NewL(paraFormatLayer, charFormatLayer);
-    CleanupStack::PushL(richText);
-
-    TInt pos = richText->DocumentLength();
-    richText->InsertL(pos, messDes);
-
-    TMsvEntry newBioEntry;
-    newBioEntry.SetNew(ETrue);
-    newBioEntry.SetComplete(EFalse);
-    newBioEntry.SetUnread(ETrue);
-    newBioEntry.SetVisible(ETrue);
-    newBioEntry.SetReadOnly(EFalse);
-    newBioEntry.SetFailed(EFalse);
-    newBioEntry.SetOperation(EFalse);
-    newBioEntry.SetMultipleRecipients(EFalse);
-    newBioEntry.SetAttachment(EFalse);
-    newBioEntry.iMtm = KUidBIOMessageTypeMtm;
-    newBioEntry.iType = KUidMsvMessageEntry;
-    newBioEntry.iServiceId = iBioServiceId;
-    TTime now;
-    now.UniversalTime();
-    newBioEntry.iDate = now;
-
-    TTime unixEpoch(KUnixEpoch);
-    TTimeIntervalSeconds seconds;
-    TTime timeStamp = newBioEntry.iDate;
-    timeStamp.SecondsFrom(unixEpoch, seconds);
-    retTimeStamp.setTime_t(seconds.Int());
-
-    newBioEntry.iDescription.Set(richText->Read(0, richText->DocumentLength()));
-    TBufC<KTelephoneNumberMaxLength> telNumber;
-
-    QString recepient(TEST_MSG_FROM1);
-    tempNumber = S60QConversions::qStringToS60Desc(recepient);
-
-    telNumber = tempNumber->Des();
-    newBioEntry.iDetails.Set(telNumber);
-
-    SetForMtmTypeL(newBioEntry, aMessageType);
-
-    newBioEntry.iSize = richText->DocumentLength();// msgSize;
-    CreateBioEntryClientSideL(newBioEntry, *richText);
-
-    CleanupStack::PopAndDestroy(4); // richText, charFormatLayer, paraFormatLayer, localBuffer
-    return newBioEntry.Id();
-}
-
-void TestUniDataModelVCalPlugin::CreateBioEntryClientSideL(TMsvEntry& aEntry,
-                                                           CRichText& aBody)
-{
-    if (inbox)
-    {
-        iMsvEntry->SetEntryL(KMsvGlobalInBoxIndexEntryId);
-    }
-    else if (drafts)
-    {
-        iMsvEntry->SetEntryL(KMsvDraftEntryId);
-    }
-    //  Get the global inbox.   
-
-    iMsvEntry->CreateL(aEntry);
-    iMsvEntry->SetEntryL(aEntry.Id());
-
-    // Save all the changes
-    CMsvStore* store = iMsvEntry->EditStoreL();
-    CleanupStack::PushL(store);
-
-    if (store->HasBodyTextL())
-    {
-        store->DeleteBodyTextL();
-    }
-
-    CPlainText* pText = CPlainText::NewL();
-    CleanupStack::PushL(pText);
-
-    if (inbox)
-    {
-        CSmsHeader* smsHeader = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *pText);
-        CleanupStack::PushL(smsHeader);
-        smsHeader->SetFromAddressL(*tempNumber);
-        smsHeader->StoreL(*store);
-
-    }
-    else if (drafts)
-    {
-
-        QString recepient(TEST_MSG_FROM1);
-        QString recepient2(TEST_MSG_FROM2);
-        QString alias(TEST_MSG_ALIAS1);
-
-        HBufC* addr = S60QConversions::qStringToS60Desc(recepient);
-        HBufC* addr2 = S60QConversions::qStringToS60Desc(recepient2);
-        HBufC* alias1 = S60QConversions::qStringToS60Desc(alias);
-
-        CSmsHeader* smsHeader = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *pText);
-        CleanupStack::PushL(smsHeader);
-
-        CSmsNumber* number1 = CSmsNumber::NewL(); // create the instance
-        CleanupStack::PushL(number1);
-
-        number1->SetNameL(TPtrC());
-        number1->SetAddressL(*addr);
-        smsHeader->Recipients().AppendL(number1);
-        CleanupStack::Pop(number1);
-
-        CSmsNumber* number2 = CSmsNumber::NewL();
-        CleanupStack::PushL(number2);
-
-        number2->SetNameL(*alias1);
-        number2->SetAddressL(*addr2);
-
-        smsHeader->Recipients().AppendL(number2);
-        CleanupStack::Pop(number2);
-        smsHeader->StoreL(*store);
-
-    }
-
-    store->StoreBodyTextL(aBody);
-    store->CommitL();
-
-    CleanupStack::PopAndDestroy(3); //store - close the store
-
-    aEntry.SetComplete(ETrue);
-    // Update the entry
-    iMsvEntry->ChangeL(aEntry);
-    iMsvEntry->SetEntryL(KMsvRootIndexEntryId);
-}
-
-TMsvId TestUniDataModelVCalPlugin::SetBIOServiceIdL()
-{
-    //  Haven't found an entry so create a BIO Message service:
-    TMsvEntry bioServiceEntry;
-    bioServiceEntry.iMtm = KUidBIOMessageTypeMtm;
-    bioServiceEntry.iType = KUidMsvServiceEntry;
-    bioServiceEntry.SetVisible(EFalse);
-    bioServiceEntry.iDate.UniversalTime();
-    bioServiceEntry.iDescription.Set(_L("BIO Message Service ")); // Is there such a thing?
-    bioServiceEntry.iDetails.Set(_L("BIO Message Service"));
-
-    TMsvId newBIOServiceId;
-
-    iMsvEntry->SetEntryL(KMsvRootIndexEntryId);
-    iMsvEntry->CreateL(bioServiceEntry); // Needs to be a child of the root!
-    newBIOServiceId = bioServiceEntry.Id();
-
-    return newBIOServiceId;
-}
-
-void TestUniDataModelVCalPlugin::SetForMtmTypeL(TMsvEntry& aEntry,
-                                                TBIOMessageType aType)
-{
-    TInt index;
-
-    aEntry.iBioType = KUidBIOVCalenderMsg;
-
-    // Set other TMsvEntry fields if we have a BIO message type
-    if (aType != ENoMessage)
-    {
-        aEntry.SetMtmData2(0);
-        aEntry.SetMtmData3(0);
-    }
-
-    // set description from BIF file
-    iBioDb->GetBioIndexWithMsgIDL(TUid::Uid(aEntry.iBioType), index);
-    if (index == KErrNotFound)
-        User::Leave(KErrNotFound);
-    aEntry.iDescription.Set(iBioDb->BifReader(index).Description());
-}
-
-void MsgObserver::HandleSessionEventL(TMsvSessionEvent /*aEvent*/,
-                                      TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
-{
-}
--- a/messagingapp/msgutils/unidatamodel/univcaldataplugin/tsrc/testunidatamodelvcalplugin/testunidatamodelvcalplugin.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,123 +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_VCAL_PLUGIN_H
-#define TEST_UNI_DATA_MODEL_VCAL_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>
-#include <e32math.h> 
-
-
-#include <bsp.h>
-
-const TInt32	KUidBIOVCalenderMsg			=  {0x10005533};    // VCalender diary
-
-class UniDataModelPluginInterface;
-class UniDataModelLoader;
-class MsgObserver;
-
-class ConvergedMessage;
-class CBIODatabase;
-
-
-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 TestUniDataModelVCalPlugin : 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 testInBoxVCalMessage();
-    void testDraftsVCalMessage();
-    void testPluginLoading();
-    void testGetPluginWithoutLoading();
-    void testPluginLoadingMultipleTimes();
-    void testUnusedAPIs();
-
-private:
-    TMsvId CreateBIOEntryL(TDesC& aText, TBIOMessageType aMessageType);
-    void CreateBioEntryClientSideL(TMsvEntry& aEntry, CRichText& aBody);
-    HBufC* ReadFromFileL(const TDesC& aFile);
-    void SetSessionPath(const TDesC& aSessionPath);
-    TMsvId CreateBIOEntryFromFileL(const TDesC& aFilename,
-                                   TBIOMessageType aMessageType);
-    TBIOMessageType SetMessageType(const TDesC& aFileName);
-    CMsvEntrySelection* GenerateMessagesL();
-    TMsvId SetBIOServiceIdL();
-    void SetForMtmTypeL(TMsvEntry& aEntry, TBIOMessageType aType);
-
-private:
-    UniDataModelPluginInterface* pluginInterface;
-    MsgObserver* iObserver;
-    CMsvSession* iMSession;
-    CClientMtmRegistry* iMtmReg;
-    TMsvId messageId;
-    UniDataModelLoader* pluginLoader;
-    QDateTime retTimeStamp;
-    RFs iFs;
-    CDir* iDir;
-    TInt iFilesProcessed;
-    CMsvEntry* iMsvEntry;
-    CBIODatabase* iBioDb;
-    TMsvId newEntryId;
-    HBufC* tempNumber;
-    TBufC<KMaxFileName> currentFile;
-    TBool inbox;
-    TBool drafts;
-};
-
-class MsgObserver : public MMsvSessionObserver
-{
-public:
-    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2,
-                             TAny* aArg3);
-};
-
-#endif //TEST_UNI_DATA_MODEL_VCAL_PLUGIN_H
--- a/messagingapp/msgutils/unidatamodel/univcaldataplugin/tsrc/testunidatamodelvcalplugin/testunidatamodelvcalplugin.ini	Fri Apr 16 14:56:15 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/unidatamodel/univcaldataplugin/tsrc/testunidatamodelvcalplugin/testunidatamodelvcalplugin.pro	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +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-unidatamodel-vcal-plugin
-
-
-INCLUDEPATH += .
-INCLUDEPATH += ../../../../../../inc
-INCLUDEPATH += ../../../../../msgutils/s60qconversions/inc
-INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-
-DEFINES += BUILD_TEST_DLL
-
-SOURCES += \
-	testunidatamodelvcalplugin.cpp
-
-				
-# Input
-HEADERS += \
-	testunidatamodelvcalplugin.h
-	
-	   	   			 
-   
-SYMBIAN_PLATFORMS = WINSCW ARMV5
-    symbian {
-    TARGET.CAPABILITY = CAP_GENERAL_DLL
-    TARGET.EPOCSTACKSIZE = 0x8000
-    TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000
-    TARGET.EPOCALLOWDLLDATA = 1
-    BLD_INF_RULES.prj_exports += "vcal1.txt /epoc32/winscw/c/test/vcal1.txt"
-    BLD_INF_RULES.prj_exports += "BioMtm.rsc /epoc32/winscw/c/resource/messaging/mtm/BioMtm.rsc"
-		}
-
- LIBS += -leuser \
-	-lconvergedmessageutils\
-	-ls60qconversions \
-	-lmsgs \
-	-lsmcm \
-	-lgsmu \
-	-letext \
-	-lmsgs \
-	-lunidatamodelloader\
-	-lQtCore \
-	-lbioc \
-	-lefsrv \
-	-lbiodb \
-	-lbifu
-	
-
--- a/messagingapp/msgutils/unidatamodel/univcaldataplugin/tsrc/testunidatamodelvcalplugin/vcal1.txt	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-BEGIN:VCALENDAR
-PRODID:-//Microsoft Corporation//Outlook 9.0 MIMEDIR//EN
-VERSION:1.0
-BEGIN:VEVENT
-DTSTART:20000322T080000Z
-DTEND:20000322T083000Z
-LOCATION;ENCODING=QUOTED-PRINTABLE:Somewhere
-UID:040000008200E00074C5B7101A82E0080000000090BB8A23ED93BF010000000000000000100
- 00000AB7E96B01EFFD31192E70060084F0B48
-DESCRIPTION;ENCODING=QUOTED-PRINTABLE:=09You will be busy doing something, =
-somewhere at some point.=0D=0A
-SUMMARY;ENCODING=QUOTED-PRINTABLE:My big appointment
-PRIORITY:3
-END:VEVENT
-END:VCALENDAR
--- a/messagingapp/msgutils/unidatamodel/univcaldataplugin/univcaldataplugin.pro	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +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:
-#
-
-TEMPLATE = lib
-TARGET = $$qtLibraryTarget(univcaldataplugin)
-
-TARGET.CAPABILITY = All -TCB
-TARGET.EPOCALLOWDLLDATA = 1
-
-#UID 3
-TARGET.UID3 = 0x2001FE61
-
-DEPENDPATH += . inc src
-INCLUDEPATH += ./inc
-INCLUDEPATH += ../../../msgutils/s60qconversions/inc
-INCLUDEPATH += ../../../../inc
-INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-
-SYMBIAN_PLATFORMS = WINSCW ARMV5
-
-CONFIG += plugin
-
-# Input
-HEADERS += inc/sessioneventhandler.h \
-	inc/univcaldataplugin.h \
-	inc/univcaldataplugin_p.h 
-	   	   		   
-SOURCES += src/sessioneventhandler.cpp \
-	src/univcaldataplugin.cpp \
-	src/univcaldataplugin_p.cpp
- 
-# Build.inf rules 
-BLD_INF_RULES.prj_exports += \
-  "$${LITERAL_HASH}include <platform_paths.hrh>" \
-    "rom/univcaldataplugin.iby             CORE_APP_LAYER_IBY_EXPORT_PATH(univcaldataplugin.iby)" 
-     
-    symbian {
-    BLD_INF_RULES.prj_exports += "BioMtm.rsc /epoc32/data/z/resource/messaging/mtm/BioMtm.rsc"
-    BLD_INF_RULES.prj_exports += "prov.rsc /epoc32/data/z/resource/messaging/bif/prov.rsc"
-		}
-    
- LIBS += -leuser \
-	-lconvergedmessageutils\
-	-ls60qconversions \
-	-lmsgs \
-	-lSmcm \
-	-lgsmu \
-	-letext \
-	-lQtCore \
-	-lefsrv \
-	-lbioc \
-	-lbifu
-	
-# plugin stub deployment
-plugin.sources = univcaldataplugin.dll
-plugin.path = \resource\qt\plugins\messaging\datamodel
-DEPLOYMENT += plugin
-
-
--- a/messagingapp/msgutils/unidatamodelloader/rom/unidatamodelloader.iby	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +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 __UNIDATAMODEL_LOADER_IBY__
-#define __UNIDATAMODEL_LOADER_IBY__
-
-REM DLL
-file=ABI_DIR\UREL\unidatamodelloader.dll                   SHARED_LIB_DIR\unidatamodelloader.dll
-
-#endif // __UNIFIEDDATAMODEL_IBY__
--- a/messagingapp/msgutils/unidatamodelloader/src/unidatamodelloader.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,111 +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: Plugin Loader class
- *
- */
-
-// System Includes
-
-#include <QDir>
-#include "debugtraces.h"
-
-#include <QLibraryInfo>
-#include <QPluginLoader>
-#include "unidatamodelloader.h"
-#include "unidatamodelplugininterface.h"
-
-//---------------------------------------------------------------
-//UniDataModelLoader::UniDataModelLoader()
-//@see header
-//---------------------------------------------------------------
-UniDataModelLoader::UniDataModelLoader()
-{
-}
-
-//---------------------------------------------------------------
-//UniDataModelLoader::~UniDataModelLoader()
-//@see header
-//---------------------------------------------------------------
-UniDataModelLoader::~UniDataModelLoader()
-{
-    QMap<QString, UniDataModelPluginInterface*>::iterator mapItor;
-    for (mapItor = mDataModelPluginMap.begin(); mapItor
-            != mDataModelPluginMap.end(); ++mapItor)
-    {
-#ifdef _DEBUG_TRACES_
-        qDebug() << "Deleting Handler id:" << mapItor.key();
-#endif
-        UniDataModelPluginInterface* handler = mapItor.value();
-        if (handler)
-            delete handler;
-    }
-    mDataModelPluginMap.clear();
-}
-
-//---------------------------------------------------------------
-//UniDataModelLoader::loadPlugins()
-//@see header
-//---------------------------------------------------------------
-void UniDataModelLoader::loadPlugins()
-{
-    // plugins directory setting for EMULATOR
-#ifdef __WINS__
-    QDir dir(QLibraryInfo::location(QLibraryInfo::PluginsPath));
-    dir.cd("messaging\\datamodel");
-#else
-    // plugins directory setting for HARDWARE IMAGE
-    QDir dir("Z:\\resource\\qt\\plugins\\messaging\\datamodel");
-#endif
-    QString pluginPath = dir.absolutePath();
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Enter LoadPlugin path = " << pluginPath;
-#endif
-
-    // load the plugins
-    QFileInfoList entries = dir.entryInfoList(QDir::Files | QDir::Readable);
-    foreach (QFileInfo entry, entries) 
-        {
-            QPluginLoader loader(entry.absoluteFilePath());
-            // Check if plugin is already loaded...
-            if (!loader.isLoaded())
-            {
-                UniDataModelPluginInterface* datamodelPlugin = qobject_cast<
-                        UniDataModelPluginInterface*> (loader.instance());
-                if (datamodelPlugin)
-                {
-                	  UniDataModelPluginInterface* pluginInstance = qobject_cast<
-                        UniDataModelPluginInterface*> (datamodelPlugin->createInstance());                        
-                    QString mType = pluginInstance->messageType();
-                    QDEBUG_WRITE_FORMAT("plugin added to map", mType);
-                    mDataModelPluginMap.insert(mType, pluginInstance);
-                }
-            }
-
-        }
-}
-
-//---------------------------------------------------------------
-//UniDataModelLoader::getDataModelPlugin()
-//@see header
-//---------------------------------------------------------------
-UniDataModelPluginInterface* UniDataModelLoader::getDataModelPlugin(
-                                                                    const QString& messageType)
-{
-    if (mDataModelPluginMap.contains(messageType))
-    {
-		QDEBUG_WRITE_FORMAT("getDataModelPlugin messageType is present ", messageType);
-        return mDataModelPluginMap[messageType];
-    }
-    return NULL;
-}
--- a/messagingapp/msgutils/unidatamodelloader/unidatamodelloader.pro	Fri Apr 16 14:56:15 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:
-#
-
-TARGET = unidatamodelloader
-
-TEMPLATE = lib
-
-CONFIG += dll
-DEFINES += UNIDATAMODELLOADER_DLL
-DEFINES += BUILD_DLL_DATA_MODEL
-
-
-
-DEPENDPATH += . \
-    inc \
-    src
-
-QT -= gui
-
-INCLUDEPATH += .
-INCLUDEPATH += inc
-INCLUDEPATH += /s60/app/messaging/inc
-INCLUDEPATH += ../s60qconversions/inc
-INCLUDEPATH += ../../../inc
-INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-
-# Capability
-TARGET.UID3 = 0x2001FE62
-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/unidatamodelloader.iby  CORE_APP_LAYER_IBY_EXPORT_PATH(unidatamodelloader.iby)"
-
-MMP_RULES += "SOURCEPATH ."
-
-SOURCES += src/unidatamodelloader.cpp
-    
-LIBS += -lQtCore
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/bwins/unidatamodelloaderu.def	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,5 @@
+EXPORTS
+	??1UniDataModelLoader@@QAE@XZ @ 1 NONAME ; UniDataModelLoader::~UniDataModelLoader(void)
+	?getDataModelPlugin@UniDataModelLoader@@QAEPAVUniDataModelPluginInterface@@W4MessageType@ConvergedMessage@@@Z @ 2 NONAME ; class UniDataModelPluginInterface * UniDataModelLoader::getDataModelPlugin(enum ConvergedMessage::MessageType)
+	??0UniDataModelLoader@@QAE@XZ @ 3 NONAME ; UniDataModelLoader::UniDataModelLoader(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/bwins/unidatamodelu.def	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,101 @@
+EXPORTS
+	?IsTemplateSmil@UniSmilUtils@@SAHPAVCMDXMLDocument@@@Z @ 1 NONAME ; int UniSmilUtils::IsTemplateSmil(class CMDXMLDocument *)
+	?AddTextObjectL@CUniSmilModel@@QAEPAVCUniTextObject@@HPAVCEikRichTextEditor@@@Z @ 2 NONAME ; class CUniTextObject * CUniSmilModel::AddTextObjectL(int, class CEikRichTextEditor *)
+	?SetObserverL@CUniObject@@QAEXPAVMUniObjectObserver@@@Z @ 3 NONAME ; void CUniObject::SetObserverL(class MUniObjectObserver *)
+	?NewLC@CUniTextObject@@SAPAV1@AAVRFs@@AAVCBaseMtm@@AAVCUniDataUtils@@PAVCMsgTextInfo@@AAVMMsvAttachmentManager@@AAVCMsvAttachment@@@Z @ 4 NONAME ; class CUniTextObject * CUniTextObject::NewLC(class RFs &, class CBaseMtm &, class CUniDataUtils &, class CMsgTextInfo *, class MMsvAttachmentManager &, class CMsvAttachment &)
+	?MediaType@CUniObject@@QBE?AW4TMsgMediaType@@XZ @ 5 NONAME ; enum TMsgMediaType CUniObject::MediaType(void) const
+	?NewL@CUniObjectList@@SAPAV1@AAVCBaseMtm@@AAVCUniDataUtils@@@Z @ 6 NONAME ; class CUniObjectList * CUniObjectList::NewL(class CBaseMtm &, class CUniDataUtils &)
+	?ChangeLayoutL@CUniSmilModel@@QAEHPAVCMDXMLDocument@@@Z @ 7 NONAME ; int CUniSmilModel::ChangeLayoutL(class CMDXMLDocument *)
+	?MimeType@CUniObject@@QBE?AVTPtrC8@@XZ @ 8 NONAME ; class TPtrC8 CUniObject::MimeType(void) const
+	?ReleaseRights@CUniDrmInfo@@QAEHXZ @ 9 NONAME ; int CUniDrmInfo::ReleaseRights(void)
+	?AddSmilAttachmentL@CUniSmilList@@QAEXAAVMMsvAttachmentManager@@I@Z @ 10 NONAME ; void CUniSmilList::AddSmilAttachmentL(class MMsvAttachmentManager &, unsigned int)
+	?IsMediaElem@UniSmilUtils@@SAHPAVCMDXMLNode@@@Z @ 11 NONAME ; int UniSmilUtils::IsMediaElem(class CMDXMLNode *)
+	?RestoreL@CUniDataModel@@QAEXAAVMUniDataModelObserver@@HH@Z @ 12 NONAME ; void CUniDataModel::RestoreL(class MUniDataModelObserver &, int, int)
+	?RemoveEmptySlides@CUniSmilModel@@QAEXXZ @ 13 NONAME ; void CUniSmilModel::RemoveEmptySlides(void)
+	?AddAttachmentL@CUniDataModel@@QAEPAVCUniObject@@AAVMUniObjectSaveObserver@@PAVCMsgMediaInfo@@W4TMsvAttachmentType@CMsvAttachment@@@Z @ 14 NONAME ; class CUniObject * CUniDataModel::AddAttachmentL(class MUniObjectSaveObserver &, class CMsgMediaInfo *, enum CMsvAttachment::TMsvAttachmentType)
+	?ParseL@CUniSmilModel@@QAEHPAVCMDXMLDocument@@@Z @ 15 NONAME ; int CUniSmilModel::ParseL(class CMDXMLDocument *)
+	?NewLC@CUniSmilModel@@SAPAV1@AAVRFs@@AAVCBaseMtm@@AAVCUniDataUtils@@AAVCUniObjectList@@@Z @ 16 NONAME ; class CUniSmilModel * CUniSmilModel::NewLC(class RFs &, class CBaseMtm &, class CUniDataUtils &, class CUniObjectList &)
+	?SmilComposeSize@CUniSmilModel@@QAEHHH@Z @ 17 NONAME ; int CUniSmilModel::SmilComposeSize(int, int)
+	?AddObjectL@CUniSmilModel@@QAEPAVCUniObject@@AAVMUniObjectSaveObserver@@HPAVCMsgMediaInfo@@@Z @ 18 NONAME ; class CUniObject * CUniSmilModel::AddObjectL(class MUniObjectSaveObserver &, int, class CMsgMediaInfo *)
+	?NewL@CUniSmilList@@SAPAV1@AAVCBaseMtm@@@Z @ 19 NONAME ; class CUniSmilList * CUniSmilList::NewL(class CBaseMtm &)
+	?GetSmilAttachmentByIndex@CUniSmilList@@QAEIH@Z @ 20 NONAME ; unsigned int CUniSmilList::GetSmilAttachmentByIndex(int)
+	?GetByAttachmentId@CUniObjectList@@QAEPAVCUniObject@@I@Z @ 21 NONAME ; class CUniObject * CUniObjectList::GetByAttachmentId(unsigned int)
+	?NewLC@CUniDrmInfo@@SAPAV1@AAVRFs@@AAVCBaseMtm@@AAIAAVCMsgMediaInfo@@@Z @ 22 NONAME ; class CUniDrmInfo * CUniDrmInfo::NewLC(class RFs &, class CBaseMtm &, unsigned int &, class CMsgMediaInfo &)
+	?CreateSmilAttachmentL@CUniSmilList@@QAEXAAVMUniSmilComposeObserver@@AAVCMsvStore@@PAVCMDXMLDocument@@@Z @ 23 NONAME ; void CUniSmilList::CreateSmilAttachmentL(class MUniSmilComposeObserver &, class CMsvStore &, class CMDXMLDocument *)
+	?IsSupportedMediaType@CUniSmilModel@@QBEHW4TMsgMediaType@@@Z @ 24 NONAME ; int CUniSmilModel::IsSupportedMediaType(enum TMsgMediaType) const
+	?NewL@CUniDrmInfo@@SAPAV1@AAVRFs@@AAVCBaseMtm@@AAIAAVCMsgMediaInfo@@@Z @ 25 NONAME ; class CUniDrmInfo * CUniDrmInfo::NewL(class RFs &, class CBaseMtm &, unsigned int &, class CMsgMediaInfo &)
+	?IsSlide@CUniSmilModel@@QBEHH@Z @ 26 NONAME ; int CUniSmilModel::IsSlide(int) const
+	?GetAttachmentFileL@CUniDataUtils@@SA?AVRFile@@AAVCBaseMtm@@I@Z @ 27 NONAME ; class RFile CUniDataUtils::GetAttachmentFileL(class CBaseMtm &, unsigned int)
+	?MoveSlideL@CUniSmilModel@@QAEXHH@Z @ 28 NONAME ; void CUniSmilModel::MoveSlideL(int, int)
+	?SetListObserver@CUniObjectList@@QAEXPAVMUniObjectListObserver@@@Z @ 29 NONAME ; void CUniObjectList::SetListObserver(class MUniObjectListObserver *)
+	?NewLC@CUniObject@@SAPAV1@AAVRFs@@AAVCBaseMtm@@AAVCUniDataUtils@@PAVCMsgMediaInfo@@AAVMMsvAttachmentManager@@AAVCMsvAttachment@@@Z @ 30 NONAME ; class CUniObject * CUniObject::NewLC(class RFs &, class CBaseMtm &, class CUniDataUtils &, class CMsgMediaInfo *, class MMsvAttachmentManager &, class CMsvAttachment &)
+	?GetId@UniSmilUtils@@SAHPAVCMDXMLNode@@AAVTPtrC16@@@Z @ 31 NONAME ; int UniSmilUtils::GetId(class CMDXMLNode *, class TPtrC16 &)
+	?RemoveObjectByIndexL@CUniSmilModel@@QAEXHH@Z @ 32 NONAME ; void CUniSmilModel::RemoveObjectByIndexL(int, int)
+	?GetSmilFileByIndexL@CUniSmilList@@QAE?AVRFile@@H@Z @ 33 NONAME ; class RFile CUniSmilList::GetSmilFileByIndexL(int)
+	?SortSlidesL@CUniSmilModel@@QAEXXZ @ 34 NONAME ; void CUniSmilModel::SortSlidesL(void)
+	?AddStoredObjectL@CUniSmilModel@@QAEPAVCUniObject@@HIPAVCMsgMediaInfo@@@Z @ 35 NONAME ; class CUniObject * CUniSmilModel::AddStoredObjectL(int, unsigned int, class CMsgMediaInfo *)
+	?ComposeL@CUniSmilModel@@QAEPAVCMDXMLDocument@@XZ @ 36 NONAME ; class CMDXMLDocument * CUniSmilModel::ComposeL(void)
+	?NewL@CConformanceChecker@@SAPAV1@XZ @ 37 NONAME ; class CConformanceChecker * CConformanceChecker::NewL(void)
+	?AddSlideL@CUniSmilModel@@QAEXH@Z @ 38 NONAME ; void CUniSmilModel::AddSlideL(int)
+	?StringToIntValue@UniSmilUtils@@SAHABVTDesC16@@H@Z @ 39 NONAME ; int UniSmilUtils::StringToIntValue(class TDesC16 const &, int)
+	?AddStoredAttachmentL@CUniDataModel@@QAEPAVCUniObject@@IPAVCMsgMediaInfo@@@Z @ 40 NONAME ; class CUniObject * CUniDataModel::AddStoredAttachmentL(unsigned int, class CMsgMediaInfo *)
+	?RemoveObserver@CUniObject@@QAEXPAVMUniObjectObserver@@@Z @ 41 NONAME ; void CUniObject::RemoveObserver(class MUniObjectObserver *)
+	?NewLC@CUniSmilParams@@SAPAV1@ABVRFs@@@Z @ 42 NONAME ; class CUniSmilParams * CUniSmilParams::NewLC(class RFs const &)
+	?HandleDrmErrorL@CUniDrmInfo@@QAEXH@Z @ 43 NONAME ; void CUniDrmInfo::HandleDrmErrorL(int)
+	?EvaluateRights@CUniDrmInfo@@QAEHAAH@Z @ 44 NONAME ; int CUniDrmInfo::EvaluateRights(int &)
+	?SmilComposeSize@CUniSmilModel@@QAEHXZ @ 45 NONAME ; int CUniSmilModel::SmilComposeSize(void)
+	?SynchronizeSize@CUniTextObject@@QAEHXZ @ 46 NONAME ; int CUniTextObject::SynchronizeSize(void)
+	?NewLC@CUniTextObject@@SAPAV1@AAVRFs@@AAVCBaseMtm@@AAVCUniDataUtils@@PAVCMsgTextInfo@@@Z @ 47 NONAME ; class CUniTextObject * CUniTextObject::NewLC(class RFs &, class CBaseMtm &, class CUniDataUtils &, class CMsgTextInfo *)
+	?IsDrmWithOnePreview@CUniDrmInfo@@QAEHXZ @ 48 NONAME ; int CUniDrmInfo::IsDrmWithOnePreview(void)
+	?ObjectByteSize@CUniObjectList@@QBEHXZ @ 49 NONAME ; int CUniObjectList::ObjectByteSize(void) const
+	?IndexPositionOfAttachmentL@CUniDataUtils@@SAHAAVMMsvAttachmentManager@@I@Z @ 50 NONAME ; int CUniDataUtils::IndexPositionOfAttachmentL(class MMsvAttachmentManager &, unsigned int)
+	?GetRegionId@UniSmilUtils@@SAHPAVCMDXMLNode@@AAVTPtrC16@@@Z @ 51 NONAME ; int UniSmilUtils::GetRegionId(class CMDXMLNode *, class TPtrC16 &)
+	?RemoveChildren@UniSmilUtils@@SAXPAVCMDXMLNode@@@Z @ 52 NONAME ; void UniSmilUtils::RemoveChildren(class CMDXMLNode *)
+	?SaveAll@CUniObjectList@@QAEXAAVMUniObjectSaveObserver@@W4TMsvAttachmentType@CMsvAttachment@@@Z @ 53 NONAME ; void CUniObjectList::SaveAll(class MUniObjectSaveObserver &, enum CMsvAttachment::TMsvAttachmentType)
+	?RightsValidL@CUniDrmInfo@@QAEHH@Z @ 54 NONAME ; int CUniDrmInfo::RightsValidL(int)
+	?NewL@CUniSmilModel@@SAPAV1@AAVRFs@@AAVCBaseMtm@@AAVCUniDataUtils@@AAVCUniObjectList@@@Z @ 55 NONAME ; class CUniSmilModel * CUniSmilModel::NewL(class RFs &, class CBaseMtm &, class CUniDataUtils &, class CUniObjectList &)
+	?GetObjectByUniqueHandle@CUniObjectList@@QAEPAVCUniObject@@H@Z @ 56 NONAME ; class CUniObject * CUniObjectList::GetObjectByUniqueHandle(int)
+	?GetSrcL@UniSmilUtils@@SA?AVTPtrC16@@PAVCMDXMLNode@@@Z @ 57 NONAME ; class TPtrC16 UniSmilUtils::GetSrcL(class CMDXMLNode *)
+	?ResolveDrmRightsWhenLoadedL@CUniObject@@QAEXXZ @ 58 NONAME ; void CUniObject::ResolveDrmRightsWhenLoadedL(void)
+	?RemoveObjectL@CUniObjectList@@QAEXPAVCUniObject@@H@Z @ 59 NONAME ; void CUniObjectList::RemoveObjectL(class CUniObject *, int)
+	?SetDrmRightsWhenLoaded@CUniObject@@QAEXH@Z @ 60 NONAME ; void CUniObject::SetDrmRightsWhenLoaded(int)
+	?NewL@CUniDataUtils@@SAPAV1@AAVRFs@@@Z @ 61 NONAME ; class CUniDataUtils * CUniDataUtils::NewL(class RFs &)
+	?AddObjectL@CUniObjectList@@QAEXPAVCUniObject@@@Z @ 62 NONAME ; void CUniObjectList::AddObjectL(class CUniObject *)
+	?SetLayoutL@CUniSmilModel@@QAEXW4TUniLayout@@@Z @ 63 NONAME ; void CUniSmilModel::SetLayoutL(enum TUniLayout)
+	?GetByNodeL@CUniObjectList@@QAEPAVCUniObject@@PAVCMDXMLNode@@@Z @ 64 NONAME ; class CUniObject * CUniObjectList::GetByNodeL(class CMDXMLNode *)
+	?CharconvIdToMibIdL@CUniDataUtils@@QAEII@Z @ 65 NONAME ; unsigned int CUniDataUtils::CharconvIdToMibIdL(unsigned int)
+	?GetObjectByIndex@CUniSmilModel@@QBEPAVCUniObject@@HH@Z @ 66 NONAME ; class CUniObject * CUniSmilModel::GetObjectByIndex(int, int) const
+	?RemoveAllObjectsL@CUniObjectList@@QAEXXZ @ 67 NONAME ; void CUniObjectList::RemoveAllObjectsL(void)
+	?ConsumeRights@CUniDrmInfo@@QAEHXZ @ 68 NONAME ; int CUniDrmInfo::ConsumeRights(void)
+	?UTF8Size@CUniDataUtils@@SAHVTPtrC16@@@Z @ 69 NONAME ; int CUniDataUtils::UTF8Size(class TPtrC16)
+	?NewL@CUniDataModel@@SAPAV1@AAVRFs@@AAVCBaseMtm@@@Z @ 70 NONAME ; class CUniDataModel * CUniDataModel::NewL(class RFs &, class CBaseMtm &)
+	?NewL@CUniObject@@SAPAV1@AAVRFs@@AAVCBaseMtm@@AAVCUniDataUtils@@PAVCMsgMediaInfo@@@Z @ 71 NONAME ; class CUniObject * CUniObject::NewL(class RFs &, class CBaseMtm &, class CUniDataUtils &, class CMsgMediaInfo *)
+	?ObjectCount@CUniSmilModel@@QBEHXZ @ 72 NONAME ; int CUniSmilModel::ObjectCount(void) const
+	?SlideObjectCount@CUniSmilModel@@QBEHH@Z @ 73 NONAME ; int CUniSmilModel::SlideObjectCount(int) const
+	?SpaceNeededForSaveAll@CUniObjectList@@QAEHXZ @ 74 NONAME ; int CUniObjectList::SpaceNeededForSaveAll(void)
+	?RemoveObjectL@CUniSmilModel@@QAEXHPAVCUniObject@@H@Z @ 75 NONAME ; void CUniSmilModel::RemoveObjectL(int, class CUniObject *, int)
+	?NewLC@CUniObject@@SAPAV1@AAVRFs@@AAVCBaseMtm@@AAVCUniDataUtils@@PAVCMsgMediaInfo@@@Z @ 76 NONAME ; class CUniObject * CUniObject::NewLC(class RFs &, class CBaseMtm &, class CUniDataUtils &, class CMsgMediaInfo *)
+	?ConstructL@CUniDataModel@@AAEXXZ @ 77 NONAME ; void CUniDataModel::ConstructL(void)
+	?CorrectTimingL@CUniSmilModel@@QAEHPAVCMDXMLDocument@@@Z @ 78 NONAME ; int CUniSmilModel::CorrectTimingL(class CMDXMLDocument *)
+	?FreezeRights@CUniDrmInfo@@QAEHXZ @ 79 NONAME ; int CUniDrmInfo::FreezeRights(void)
+	?FinalizeMediaParse@CUniDataModel@@QAEXXZ @ 80 NONAME ; void CUniDataModel::FinalizeMediaParse(void)
+	??1CUniDataModel@@UAE@XZ @ 81 NONAME ; CUniDataModel::~CUniDataModel(void)
+	?GetObject@CUniSmilModel@@QBEPAVCUniObject@@HW4TUniRegion@@@Z @ 82 NONAME ; class CUniObject * CUniSmilModel::GetObject(int, enum TUniRegion) const
+	?NewL@CUniTextObject@@SAPAV1@AAVRFs@@AAVCBaseMtm@@AAVCUniDataUtils@@PAVCMsgTextInfo@@AAVMMsvAttachmentManager@@AAVCMsvAttachment@@@Z @ 83 NONAME ; class CUniTextObject * CUniTextObject::NewL(class RFs &, class CBaseMtm &, class CUniDataUtils &, class CMsgTextInfo *, class MMsvAttachmentManager &, class CMsvAttachment &)
+	?GetSmilTypeL@UniSmilUtils@@SA?AW4TUniSmilType@@PAVCMDXMLDocument@@@Z @ 84 NONAME ; enum TUniSmilType UniSmilUtils::GetSmilTypeL(class CMDXMLDocument *)
+	?NewL@CUniTextObject@@SAPAV1@AAVRFs@@AAVCBaseMtm@@AAVCUniDataUtils@@PAVCMsgTextInfo@@@Z @ 85 NONAME ; class CUniTextObject * CUniTextObject::NewL(class RFs &, class CBaseMtm &, class CUniDataUtils &, class CMsgTextInfo *)
+	?GetMetaTag@UniSmilUtils@@SAHPAVCMDXMLNode@@AAVTPtrC16@@1@Z @ 86 NONAME ; int UniSmilUtils::GetMetaTag(class CMDXMLNode *, class TPtrC16 &, class TPtrC16 &)
+	?RemoveSlide@CUniSmilModel@@QAEXH@Z @ 87 NONAME ; void CUniSmilModel::RemoveSlide(int)
+	?NewL@CUniTextObject@@SAPAV1@AAVRFs@@AAVCBaseMtm@@AAVCUniDataUtils@@PAVCEikRichTextEditor@@@Z @ 88 NONAME ; class CUniTextObject * CUniTextObject::NewL(class RFs &, class CBaseMtm &, class CUniDataUtils &, class CEikRichTextEditor *)
+	?GetByUrlL@CUniObjectList@@QAEPAVCUniObject@@ABVTDesC16@@@Z @ 89 NONAME ; class CUniObject * CUniObjectList::GetByUrlL(class TDesC16 const &)
+	?GetByIndex@CUniObjectList@@QAEPAVCUniObject@@H@Z @ 90 NONAME ; class CUniObject * CUniObjectList::GetByIndex(int)
+	?NextNode@UniSmilUtils@@SAPAVCMDXMLNode@@PAV2@@Z @ 91 NONAME ; class CMDXMLNode * UniSmilUtils::NextNode(class CMDXMLNode *)
+	?NewLC@CUniTextObject@@SAPAV1@AAVRFs@@AAVCBaseMtm@@AAVCUniDataUtils@@PAVCEikRichTextEditor@@@Z @ 92 NONAME ; class CUniTextObject * CUniTextObject::NewLC(class RFs &, class CBaseMtm &, class CUniDataUtils &, class CEikRichTextEditor *)
+	?MediaElemType@UniSmilUtils@@SA?AW4TMsgMediaType@@PAVCMDXMLNode@@@Z @ 93 NONAME ; enum TMsgMediaType UniSmilUtils::MediaElemType(class CMDXMLNode *)
+	?NewL@CUniSmilParams@@SAPAV1@ABVRFs@@@Z @ 94 NONAME ; class CUniSmilParams * CUniSmilParams::NewL(class RFs const &)
+	?NewL@CUniObject@@SAPAV1@AAVRFs@@AAVCBaseMtm@@AAVCUniDataUtils@@PAVCMsgMediaInfo@@AAVMMsvAttachmentManager@@AAVCMsvAttachment@@@Z @ 95 NONAME ; class CUniObject * CUniObject::NewL(class RFs &, class CBaseMtm &, class CUniDataUtils &, class CMsgMediaInfo *, class MMsvAttachmentManager &, class CMsvAttachment &)
+	?MibIdToCharconvIdL@CUniDataUtils@@QAEII@Z @ 96 NONAME ; unsigned int CUniDataUtils::MibIdToCharconvIdL(unsigned int)
+	?FileSizeL@CUniDataUtils@@QAEHABV?$TBuf@$0BAA@@@@Z @ 97 NONAME ; int CUniDataUtils::FileSizeL(class TBuf<256> const &)
+	?SetDrmRightsWhenLoadedObjects@CUniObject@@QAEXH@Z @ 98 NONAME ; void CUniObject::SetDrmRightsWhenLoadedObjects(int)
+	?EnsureAllObjectsHaveContentLocationL@CUniObjectList@@QAEXXZ @ 99 NONAME ; void CUniObjectList::EnsureAllObjectsHaveContentLocationL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/eabi/unidatamodelloaderu.def	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,7 @@
+EXPORTS
+	_ZN18UniDataModelLoader18getDataModelPluginEN16ConvergedMessage11MessageTypeE @ 1 NONAME
+	_ZN18UniDataModelLoaderC1Ev @ 2 NONAME
+	_ZN18UniDataModelLoaderC2Ev @ 3 NONAME
+	_ZN18UniDataModelLoaderD1Ev @ 4 NONAME
+	_ZN18UniDataModelLoaderD2Ev @ 5 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/eabi/unidatamodelu.def	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,103 @@
+EXPORTS
+	_ZN10CUniObject12SetObserverLEP18MUniObjectObserver @ 1 NONAME
+	_ZN10CUniObject14RemoveObserverEP18MUniObjectObserver @ 2 NONAME
+	_ZN10CUniObject22SetDrmRightsWhenLoadedEi @ 3 NONAME
+	_ZN10CUniObject27ResolveDrmRightsWhenLoadedLEv @ 4 NONAME
+	_ZN10CUniObject29SetDrmRightsWhenLoadedObjectsEi @ 5 NONAME
+	_ZN10CUniObject4NewLER3RFsR8CBaseMtmR13CUniDataUtilsP13CMsgMediaInfo @ 6 NONAME
+	_ZN10CUniObject4NewLER3RFsR8CBaseMtmR13CUniDataUtilsP13CMsgMediaInfoR21MMsvAttachmentManagerR14CMsvAttachment @ 7 NONAME
+	_ZN10CUniObject5NewLCER3RFsR8CBaseMtmR13CUniDataUtilsP13CMsgMediaInfo @ 8 NONAME
+	_ZN10CUniObject5NewLCER3RFsR8CBaseMtmR13CUniDataUtilsP13CMsgMediaInfoR21MMsvAttachmentManagerR14CMsvAttachment @ 9 NONAME
+	_ZN11CUniDrmInfo12FreezeRightsEv @ 10 NONAME
+	_ZN11CUniDrmInfo12RightsValidLEi @ 11 NONAME
+	_ZN11CUniDrmInfo13ConsumeRightsEv @ 12 NONAME
+	_ZN11CUniDrmInfo13ReleaseRightsEv @ 13 NONAME
+	_ZN11CUniDrmInfo14EvaluateRightsERi @ 14 NONAME
+	_ZN11CUniDrmInfo15HandleDrmErrorLEi @ 15 NONAME
+	_ZN11CUniDrmInfo19IsDrmWithOnePreviewEv @ 16 NONAME
+	_ZN11CUniDrmInfo4NewLER3RFsR8CBaseMtmRjR13CMsgMediaInfo @ 17 NONAME
+	_ZN11CUniDrmInfo5NewLCER3RFsR8CBaseMtmRjR13CMsgMediaInfo @ 18 NONAME
+	_ZN12CUniSmilList18AddSmilAttachmentLER21MMsvAttachmentManagerj @ 19 NONAME
+	_ZN12CUniSmilList19GetSmilFileByIndexLEi @ 20 NONAME
+	_ZN12CUniSmilList21CreateSmilAttachmentLER23MUniSmilComposeObserverR9CMsvStoreP14CMDXMLDocument @ 21 NONAME
+	_ZN12CUniSmilList24GetSmilAttachmentByIndexEi @ 22 NONAME
+	_ZN12CUniSmilList4NewLER8CBaseMtm @ 23 NONAME
+	_ZN12UniSmilUtils10GetMetaTagEP10CMDXMLNodeR7TPtrC16S3_ @ 24 NONAME
+	_ZN12UniSmilUtils11GetRegionIdEP10CMDXMLNodeR7TPtrC16 @ 25 NONAME
+	_ZN12UniSmilUtils11IsMediaElemEP10CMDXMLNode @ 26 NONAME
+	_ZN12UniSmilUtils12GetSmilTypeLEP14CMDXMLDocument @ 27 NONAME
+	_ZN12UniSmilUtils13MediaElemTypeEP10CMDXMLNode @ 28 NONAME
+	_ZN12UniSmilUtils14IsTemplateSmilEP14CMDXMLDocument @ 29 NONAME
+	_ZN12UniSmilUtils14RemoveChildrenEP10CMDXMLNode @ 30 NONAME
+	_ZN12UniSmilUtils16StringToIntValueERK7TDesC16i @ 31 NONAME
+	_ZN12UniSmilUtils5GetIdEP10CMDXMLNodeR7TPtrC16 @ 32 NONAME
+	_ZN12UniSmilUtils7GetSrcLEP10CMDXMLNode @ 33 NONAME
+	_ZN12UniSmilUtils8NextNodeEP10CMDXMLNode @ 34 NONAME
+	_ZN13CUniDataModel10ConstructLEv @ 35 NONAME
+	_ZN13CUniDataModel14AddAttachmentLER22MUniObjectSaveObserverP13CMsgMediaInfoN14CMsvAttachment18TMsvAttachmentTypeE @ 36 NONAME
+	_ZN13CUniDataModel18FinalizeMediaParseEv @ 37 NONAME
+	_ZN13CUniDataModel20AddStoredAttachmentLEjP13CMsgMediaInfo @ 38 NONAME
+	_ZN13CUniDataModel4NewLER3RFsR8CBaseMtm @ 39 NONAME
+	_ZN13CUniDataModel8RestoreLER21MUniDataModelObserverii @ 40 NONAME
+	_ZN13CUniDataModelD0Ev @ 41 NONAME
+	_ZN13CUniDataModelD1Ev @ 42 NONAME
+	_ZN13CUniDataModelD2Ev @ 43 NONAME
+	_ZN13CUniDataUtils18CharconvIdToMibIdLEj @ 44 NONAME
+	_ZN13CUniDataUtils18GetAttachmentFileLER8CBaseMtmj @ 45 NONAME
+	_ZN13CUniDataUtils18MibIdToCharconvIdLEj @ 46 NONAME
+	_ZN13CUniDataUtils26IndexPositionOfAttachmentLER21MMsvAttachmentManagerj @ 47 NONAME
+	_ZN13CUniDataUtils4NewLER3RFs @ 48 NONAME
+	_ZN13CUniDataUtils8UTF8SizeE7TPtrC16 @ 49 NONAME
+	_ZN13CUniDataUtils9FileSizeLERK4TBufILi256EE @ 50 NONAME
+	_ZN13CUniSmilModel10AddObjectLER22MUniObjectSaveObserveriP13CMsgMediaInfo @ 51 NONAME
+	_ZN13CUniSmilModel10MoveSlideLEii @ 52 NONAME
+	_ZN13CUniSmilModel10SetLayoutLE10TUniLayout @ 53 NONAME
+	_ZN13CUniSmilModel11RemoveSlideEi @ 54 NONAME
+	_ZN13CUniSmilModel11SortSlidesLEv @ 55 NONAME
+	_ZN13CUniSmilModel13ChangeLayoutLEP14CMDXMLDocument @ 56 NONAME
+	_ZN13CUniSmilModel13RemoveObjectLEiP10CUniObjecti @ 57 NONAME
+	_ZN13CUniSmilModel14AddTextObjectLEiP18CEikRichTextEditor @ 58 NONAME
+	_ZN13CUniSmilModel14CorrectTimingLEP14CMDXMLDocument @ 59 NONAME
+	_ZN13CUniSmilModel15SmilComposeSizeEii @ 60 NONAME
+	_ZN13CUniSmilModel15SmilComposeSizeEv @ 61 NONAME
+	_ZN13CUniSmilModel16AddStoredObjectLEijP13CMsgMediaInfo @ 62 NONAME
+	_ZN13CUniSmilModel17RemoveEmptySlidesEv @ 63 NONAME
+	_ZN13CUniSmilModel20RemoveObjectByIndexLEii @ 64 NONAME
+	_ZN13CUniSmilModel4NewLER3RFsR8CBaseMtmR13CUniDataUtilsR14CUniObjectList @ 65 NONAME
+	_ZN13CUniSmilModel5NewLCER3RFsR8CBaseMtmR13CUniDataUtilsR14CUniObjectList @ 66 NONAME
+	_ZN13CUniSmilModel6ParseLEP14CMDXMLDocument @ 67 NONAME
+	_ZN13CUniSmilModel8ComposeLEv @ 68 NONAME
+	_ZN13CUniSmilModel9AddSlideLEi @ 69 NONAME
+	_ZN14CUniObjectList10AddObjectLEP10CUniObject @ 70 NONAME
+	_ZN14CUniObjectList10GetByIndexEi @ 71 NONAME
+	_ZN14CUniObjectList10GetByNodeLEP10CMDXMLNode @ 72 NONAME
+	_ZN14CUniObjectList13RemoveObjectLEP10CUniObjecti @ 73 NONAME
+	_ZN14CUniObjectList15SetListObserverEP22MUniObjectListObserver @ 74 NONAME
+	_ZN14CUniObjectList17GetByAttachmentIdEj @ 75 NONAME
+	_ZN14CUniObjectList17RemoveAllObjectsLEv @ 76 NONAME
+	_ZN14CUniObjectList21SpaceNeededForSaveAllEv @ 77 NONAME
+	_ZN14CUniObjectList23GetObjectByUniqueHandleEi @ 78 NONAME
+	_ZN14CUniObjectList36EnsureAllObjectsHaveContentLocationLEv @ 79 NONAME
+	_ZN14CUniObjectList4NewLER8CBaseMtmR13CUniDataUtils @ 80 NONAME
+	_ZN14CUniObjectList7SaveAllER22MUniObjectSaveObserverN14CMsvAttachment18TMsvAttachmentTypeE @ 81 NONAME
+	_ZN14CUniObjectList9GetByUrlLERK7TDesC16 @ 82 NONAME
+	_ZN14CUniSmilParams4NewLERK3RFs @ 83 NONAME
+	_ZN14CUniSmilParams5NewLCERK3RFs @ 84 NONAME
+	_ZN14CUniTextObject15SynchronizeSizeEv @ 85 NONAME
+	_ZN14CUniTextObject4NewLER3RFsR8CBaseMtmR13CUniDataUtilsP12CMsgTextInfo @ 86 NONAME
+	_ZN14CUniTextObject4NewLER3RFsR8CBaseMtmR13CUniDataUtilsP12CMsgTextInfoR21MMsvAttachmentManagerR14CMsvAttachment @ 87 NONAME
+	_ZN14CUniTextObject4NewLER3RFsR8CBaseMtmR13CUniDataUtilsP18CEikRichTextEditor @ 88 NONAME
+	_ZN14CUniTextObject5NewLCER3RFsR8CBaseMtmR13CUniDataUtilsP12CMsgTextInfo @ 89 NONAME
+	_ZN14CUniTextObject5NewLCER3RFsR8CBaseMtmR13CUniDataUtilsP12CMsgTextInfoR21MMsvAttachmentManagerR14CMsvAttachment @ 90 NONAME
+	_ZN14CUniTextObject5NewLCER3RFsR8CBaseMtmR13CUniDataUtilsP18CEikRichTextEditor @ 91 NONAME
+	_ZN19CConformanceChecker4NewLEv @ 92 NONAME
+	_ZNK10CUniObject8MimeTypeEv @ 93 NONAME
+	_ZNK10CUniObject9MediaTypeEv @ 94 NONAME
+	_ZNK13CUniSmilModel11ObjectCountEv @ 95 NONAME
+	_ZNK13CUniSmilModel16GetObjectByIndexEii @ 96 NONAME
+	_ZNK13CUniSmilModel16SlideObjectCountEi @ 97 NONAME
+	_ZNK13CUniSmilModel20IsSupportedMediaTypeE13TMsgMediaType @ 98 NONAME
+	_ZNK13CUniSmilModel7IsSlideEi @ 99 NONAME
+	_ZNK13CUniSmilModel9GetObjectEi10TUniRegion @ 100 NONAME
+	_ZNK14CUniObjectList14ObjectByteSizeEv @ 101 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/UniDataModel.rss	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,152 @@
+/*
+* 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: 
+*       UniEditor/Model resource file.
+*
+*
+*/
+
+
+// ========== RESOURCE IDENTIFIER ==========================
+
+NAME    UEDM
+
+// ========== INCLUDE FILES ================================
+
+#include <eikon.rh>
+#include <eikon.rsg>
+
+#include "UniSmil.hrh"
+#include "UniSmil.rh"
+
+// ========== CONSTANTS ====================================
+
+// ========== MACROS =======================================
+
+// ========== RESOURCE DEFINITIONS =========================
+
+RESOURCE RSS_SIGNATURE { }
+
+// ---------------------------------------------------------
+//  Additional resources
+// ---------------------------------------------------------
+//
+
+// Arrays of MIME types for MsgData to recognize supported types
+//
+// NOTE: Mimetypes must contain only US-ASCII characters.
+
+//
+// Default file name for attachment
+//
+RESOURCE TBUF r_mmdu_default_file_name      { buf = qtn_mms_no_name_for_file; }
+
+//
+// String for empty page in Objects view
+//
+RESOURCE TBUF r_mmdu_empty_slide            { buf = qtn_mms_item_title_empty_slide; }
+
+//----------------------------------------------------  
+//    COMPOSE_PARAMS
+//    Parameters to define how to do composing
+//
+//    r_root_layout_compose
+//      There is only one option left.
+//
+//    r_display_width   and 
+//    r_display_height
+//      Values are defined here because it's bit unclear
+//      whether to use actual display dimensions
+//      w=176 h=208
+//      or dimensions minus status pane height (44)
+//      which is the size used for displaying the message                        
+//      w=176, h=164.
+//      The third alternative would be to use some 
+//      very large height value because virtual viewing 
+//      area can be expanded in that direction.
+//
+//    r_compose_xmlns
+//      To generate xmlns or not.
+//
+//----------------------------------------------------
+//
+RESOURCE COMPOSE_PARAMS r_compose_params
+    {
+    r_root_layout_compose   = ESmilDisplayRootLayout;  // THIS IS ONLY OPTION
+    r_display_width         = 176;
+    r_display_height        = 208;
+    r_compose_xmlns         = ESmilYesXmlns;
+    r_top_padding           = 5;
+    r_region_padding        = 5;
+    r_bottom_padding        = 20;
+    }
+
+//----------------------------------------------------
+//   
+//    IMAGE_REGION
+//    Values for composing.
+//    NOTE: heigth, width are not checked in code 
+//          not to ecxeed rootlayout dimensions. 
+//
+//----------------------------------------------------
+//
+RESOURCE REGION r_image_region_attributes
+    {
+    r_id            = "Image";
+    r_fit           = "meet"; 
+    r_max_height    = 120;        
+    r_min_height    = 120;        
+    r_max_width     = 160;    
+    r_min_width     = 160;        
+    r_top           = 0;      
+    r_left          = 0;
+    }
+
+//----------------------------------------------------
+//   
+//    TEXT_REGION
+//    Values for composing.
+//    NOTE: heigth, width should have sensible values 
+//          based on the r_root_layout_compose param.
+//          There is no code to check some weird cases. 
+//
+//----------------------------------------------------
+//
+RESOURCE REGION r_text_region_attributes
+    {
+    r_id            = "Text";
+    r_fit           = "scroll"; 
+    r_max_height    = 200;        
+    r_min_height    = 40;     
+    r_max_width     = 160;    // MUST ALWAYS BE SAME AS MAX IMAGE WIDTH
+    r_min_width     = 160;      
+    r_top           = 0;      
+    r_left          = 0;
+    }
+
+//----------------------------------------------------
+//   
+//    SLIDE_PARAMETERs
+//    Values for composing.
+//    NOTE: 
+//
+//----------------------------------------------------
+//
+RESOURCE SLIDE r_slide_params
+    {
+    r_default_duration_milliseconds    = 5000;
+    r_default_when_audio_milliseconds  = 5000;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/ConformanceChecker.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,188 @@
+/*
+* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 CONFORMANCECHECKER_H
+#define CONFORMANCECHECKER_H
+
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32std.h>
+
+#include <gmxmldocument.h>
+#include <gmxmlelement.h>
+
+
+// CONSTANTS
+_LIT(KMetaTag,"meta");
+_LIT(KPercent,"%");
+_LIT(KPx,"px");
+_LIT(KMs,"ms");
+_LIT(KImage,"Image");
+_LIT(KText,"Text");
+
+const TInt KUSAsciiMinCode = 0;
+const TInt KUSAsciiMaxCode = 127;
+
+//Type for the version of the Conformance Document
+enum TMmsSmilVersion
+	{
+	EMmsSmil_v2_0=2,
+	EMmsSmil_v3_0
+	};
+
+
+enum TFlags
+	{
+	EAllowVideoTag=1,				//Allowing  video tag as media
+	EAllowAllAttributes=2,			//Not checking the attribute name of the elements
+	EAllowNonMilliseconds=4,		//Allows other  timing specifications then 'ms' (e.g. 's')
+	EAllowNonUsAscii=8,				//Allows other  than us-ascii values for src attribute
+									//for media elements
+	EAllowMixedRegionDimensions=16,	//Allows mixed region dimensions (pixel and percent)
+	EAllowSeqTag=32,				//Allows one <seq> tag right after the <body> tag
+	EAllowAnyRegionNames=64			//Allows any name for the regions
+	};
+
+
+
+// CLASS DECLARATION
+
+/**
+*  Class for checking the the content of a DOM tree against the Conformance Document.
+*  (Checking legacy content.)
+*
+*  @lib smileng.lib
+*  @since 2.0
+*/
+class CConformanceChecker : public CBase
+	{
+
+    public:  // Constructors and destructor
+
+        /**
+        * Two-phased constructor.
+		* @param aStrict - value of the checking mode flag
+        */
+        IMPORT_C static CConformanceChecker* NewL();
+
+        /**
+        * Destructor.
+        */
+        ~CConformanceChecker();
+
+    public: // New functions
+
+        /**
+	    * Checks if the DOM tree's content is legacy content or not.
+        * @param aXmldoc - the root of the DOM tree
+		* @aVersion - the version of the Conformance Document
+		* @aFlags - the flags to gide the checking (combination of TFlags values)
+        * @return - true if the content is legacy
+				  - false  if the content is not legacy
+        */
+        TBool Check(CMDXMLDocument* aXmldoc, TMmsSmilVersion aVersion, TInt aFlags);
+
+    private:
+
+		/** Checks the structure of the head element: allowed to contain only layout and meta element
+		* @param aHead - the root of head subtree
+		* @param aStrict - flag for checking mode (true strict checking, false loose checking)
+		* @return  - true - if head has legacy structure
+		*		   - false - otherwise
+		*/
+		TBool CheckHeadStructure(CMDXMLNode* aHead);
+
+
+		/** Checks the structure of the body element:
+								- allowed to contain only par elements
+		*						(one including seq element right after the body is allowed)
+		* @param aBody - the root of body subtree
+		* @return  - true - if body has legacy structure
+		*		   - false - otherwise
+		*/
+		TBool CheckBodyStructure(CMDXMLNode* aBody);
+
+
+		/** Checks the content of the layout element
+		*						- root-layout and max. 2 region elements are allowed
+		* @param aLayout - the root of layout subtree
+		* @return  - true - if layout has legacy content
+		*		   - false - otherwise
+		*/
+		TBool CheckLayoutContent(CMDXMLNode* aLayout);
+
+
+		/** Checks the content of the body element
+		* @param aBody - the root of body subtree
+		* @return - true - if body has legacy content
+		*		  - false - otherwise
+		*/
+		TBool CheckBodyContent(CMDXMLNode* aBody);
+
+
+		/** Checks the content of the par element
+		* @param aPar - the root of par subtree
+		* @return  - true - if par has legacy content
+		*		   - false - otherwise
+		*/
+		TBool CheckParContent(CMDXMLNode* aPar);
+
+
+		/** Checks if  a descriptor is ending with 'ms'
+		* @param aValue - value to check
+		* @return  - true if the ending is ms
+		*		   - false otherwise
+		*/
+
+		TBool IsInMilliseconds(TDesC& aValue) const;
+
+
+		/** Checks if the given value is ending with percent or pixel
+		* and if this is conforming to the already set pixel and percent values.
+		* @param aValue - value to check,
+		*				- should be the value of 'width', 'height', 'top', 'left'
+		*				   attributes for a region
+		* @param aPercent - true if the value should end with percent
+		* @param aPixel - true if the value should be in pixel
+		* @return  true - if the value is not mixed (regarding aPercent,aPixel)
+		*		   false - if mixed
+		*/
+		TBool CheckMixedRegionAttribute(TDesC& aValue,TBool& aPercent,TBool& aPixel) const;
+
+		/** Checks if the given value is exactly "Image" or "Text" and if it
+		* is duplicated (checking the transmitted boolean parameters).
+		* @param aValue - value to check,
+		* @param aFoundImage - true if the "Image" value will be duplicate
+		* @param aFoundText - true if the "Text" value will be duplicate
+		* @return  true - if the value is "Image" or "Text" and it's not duplicated
+		*		   false - otherwise
+		*/
+		TBool CheckRegionNames(TDesC& aValue,TBool& aFoundImage,TBool& aFoundText) const;
+
+
+    private:    // Data
+
+
+		TInt iFlags; //contains the flags to guide the checking
+    };
+
+#endif      // CONFORMANCECHECKER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/MsgAttachmentUtils.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 MSGATTACHMENTUTILS_H
+#define MSGATTACHMENTUTILS_H
+
+// ========== INCLUDE FILES ================================
+
+#include <e32std.h>
+
+// ========== CONSTANTS ====================================
+
+// ========== MACROS =======================================
+
+// ========== DATA TYPES ===================================
+
+// ========== FUNCTION PROTOTYPES ==========================
+
+// ========== FORWARD DECLARATIONS =========================
+
+// ========== CLASS DECLARATION ============================
+
+/**
+ * Attachment utilities.
+ *
+ */
+class MsgAttachmentUtils
+    {
+    public:
+        /**
+         * Generates a legal filename from given text buffer.
+         * @param aFileName  OUT: generated filename.
+         * @param aBuffer    text buffer.
+         * @param aMaxLength maximum length for filename.
+         * @param aExt       optional file extension.
+         */
+        static void GetFileNameFromBuffer(
+            TFileName&      aFileName,
+            const TDesC&    aBuffer,
+            TInt            aMaxLength,
+            const TDesC*    aExt = NULL );
+
+    };
+
+#endif // MSGATTACHMENTUTILS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniDataModel.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,401 @@
+/*
+* 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: 
+*       CUniDataModel
+*
+*
+*/
+
+
+#ifndef __UNIDATAMODEL_H
+#define __UNIDATAMODEL_H
+
+//  INCLUDES
+#include <gmxmlparser.h>
+#include <gmxmldocument.h>
+#include <msvapi.h>                     // CMsvEntry
+#include <UniDataUtils.h>
+#include <UniSmilModel.h>
+#include <UniSmilList.h>
+#include <UniObject.h>
+
+#include <mmsvattachmentmanager.h>
+#include <mmsvattachmentmanagersync.h>
+#include <MsgMediaInfo.h>
+
+// CONSTANTS
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+
+class CBaseMtm;
+class CUniDataUtils;
+class CUniObjectsModel;
+class CUniObjectList;
+class CUniObjectsInfo;
+class CMsgMediaResolver;
+class CMmsConformance;
+class CMsvMimeHeaders;
+class CMsvAttachment;
+
+// CLASS DECLARATION
+
+/**
+* MUniDataModelObserver - Callback API for model operations.
+*
+* @since 3.1
+*/
+class MUniDataModelObserver
+    {
+    public:
+        virtual void RestoreReady( TInt aParseResult, TInt aError ) = 0;
+    };
+
+/**
+* CUniDataModel - A container class that owns instances of CMsgMediaResolver,
+* CMmsConformance, CUniDataUtils, CUniObjectList, CUniSmilList and CUniSmilModel.
+* It also handles the initialization of the lists & the SMIL model.
+*
+* @lib UniDataModel.lib
+* @since 3.1
+*/
+class CUniDataModel : public CBase,
+                      public MMDXMLParserObserver,
+                      public MMediaInfoObserver
+    {
+    public:  // Constructors and destructor
+
+        static IMPORT_C CUniDataModel* NewL( RFs& aFs, CBaseMtm& aMtm );
+        
+        /**
+        * Destructor.
+        */
+        IMPORT_C ~CUniDataModel();
+
+    public: // New functions
+
+        /**
+        * RestoreL
+        * Loads attachments from message store and initializes
+        * the model.
+        * @param aObserver          IN Callback observer
+        * @param aRemoveCorrupted   IN If ETrue removes corrupted attachments
+        *                              If EFalse leaves if corrupted attachments detected
+        * @param aAllowSmil         IN If ETrue puts SMIL files to "SmilList"
+        *                              If EFalse puts SMIL files to "AttachmentList"
+        */ 
+        IMPORT_C void RestoreL(
+            MUniDataModelObserver& aObserver,
+            TBool aRemoveCorrupted = ETrue,
+            TBool aAllowSmil = ETrue );
+
+        /**
+        * AddObjectL
+        * Adds an object into msg store and smil slide
+        *
+        * @since    3.1
+        * @param    aObserver   IN Object save observer
+        * @param    aMedia      IN media info - ownership transferred to MsgObject
+        * @param    aSaveType   IN either "file" or "linked file"
+        * @return   Pointer to the added object
+        *           Ownership NOT transferred.
+        */
+        IMPORT_C CUniObject* AddAttachmentL(
+            MUniObjectSaveObserver& aObserver,
+            CMsgMediaInfo* aMedia,
+            CMsvAttachment::TMsvAttachmentType aSaveType = CMsvAttachment::EMsvLinkedFile );
+
+       /**
+        * AddStoredAttachmentL
+        * Adds an object that is already in msg store to smil slide
+        *
+        * @since    3.1
+        * @param    aAttachmentId   IN file to be added
+        * @param    aMedia      IN media info - ownership transferred to MsgObject
+        * @return   Pointer to the added object
+        *           Ownership NOT transferred.
+        */
+        IMPORT_C CUniObject* AddStoredAttachmentL(
+            TMsvAttachmentId aAttachmentId,
+            CMsgMediaInfo* aMedia );
+
+       /**
+        * FinalizeMediaParse
+        * This function synchronizes asynchronous media info parsing if it is still ongoing
+        * To be called from editor/viewer when the message is to be send/saved/forwarded
+        * @since    3.2
+        */
+        IMPORT_C void FinalizeMediaParse();
+
+    public:
+
+       /**
+        * MediaInfoParsed
+        * Callback for MediaInfo active object
+        * @since    3.2
+        */
+        void MediaInfoParsed();
+
+       /**
+        * ParseNextObject
+        * Parses the next object in a to-be-parsed list
+        * Actual parsing is dedicated to MediaInfo's asynchronous method
+        * @since    3.2
+        */
+        void ParseNextObject();
+
+        /**
+        * ParseFileCompleteL
+        * Call back function used to inform client of Parser when RunL function completes
+        */
+        void ParseFileCompleteL();
+
+    public: // inlines
+
+        /**
+        * Returns number of corrupted attachments encountered at load time
+        * i.e. entry is stil there but binary file is missing
+        * Includes corrupted link, presentations etc.
+        *
+        * @return attachment count
+        */
+        inline TInt CorruptedCount() const;
+
+        /**
+        * Returns attachment count before any filtering for "presentation objects"
+        * or corrupted attachments. SMIL attachments are not included in the count.
+        *
+        * @return attachment count
+        */
+        inline TInt OriginalAttachmentCount() const;
+
+        /**
+        * Get reference to file session
+        *
+        * @return reference to RFs
+        */
+        inline RFs& FsSession() const;
+
+        /**
+        * Get reference to base mtm
+        *
+        * @return reference to CBaseMtm
+        */
+        inline CBaseMtm& Mtm() const;
+
+        /**
+        * Returns object list owned by the model. Object list includes all
+        * attachments that are referenced from the SMIL part (or if there is no
+        * SMIL part attachments that are of supported media type).
+        *
+        * @return reference to the object list.
+        */
+        inline CUniObjectList& ObjectList() const;
+
+        /**
+        * Returns attachment list owned by the model. Attachment list includes all
+        * attachments that are NOT referenced from the SMIL part.
+        *
+        * @return reference to the attachment list.
+        */
+        inline CUniObjectList& AttachmentList() const;
+
+        /**
+        * Returns SMIL list owned by the model. SMIL list includes all
+        * attachments that are of type "application/smil".
+        *
+        * @return reference to the SMIL attachment list.
+        */
+        inline CUniSmilList& SmilList() const;
+
+        /**
+        * Returns data utils object used by the model.
+        *
+        * @return reference to the data utils object.
+        */
+        inline CUniDataUtils& DataUtils() const;
+
+        /**
+        * Returns SMIL type of the message.
+        * @return Possible return values are:
+        *         -ENoSmil
+        *         -EMmsSmil
+        *         -EOtherSmil
+        *         -EMultipleSmil
+        *         -ETemplateSmil
+        */
+        inline TUniSmilType SmilType();
+
+        /**
+        * Returns SMIL type of the message.
+        * @param aSmilType:
+        *         -ENoSmil
+        *         -EMmsSmil
+        *         -EOtherSmil
+        *         -EMultipleSmil
+        *         -ETemplateSmil
+        */
+        inline void SetSmilType( TUniSmilType aSmilType );
+
+        /**
+        * Get reference to SmilModel
+        *
+        * @return reference to SmilModel
+        */
+        inline CUniSmilModel& SmilModel() const;
+
+        /**
+        * Get reference to MediaResolver
+        *
+        * @return reference to MediaResolver
+        */
+        inline CMsgMediaResolver& MediaResolver() const;
+
+        /**
+        * Get reference to MmsConformance
+        *
+        * @return reference to MmsConformance
+        */
+        inline CMmsConformance& MmsConformance() const;
+
+        /**
+        * Return SMIL DOM
+        *
+        * @return Pointer to SMIL DOM
+        */
+        inline CMDXMLDocument* Dom();
+
+        /**
+        * Set SMIL DOM
+        *
+        * @param Pointer to SMIL DOM, takes ownership
+        */
+        inline void SetDom( CMDXMLDocument* aDom );
+
+        /*
+        * Accessor
+        *
+        * @return parse result from CUniSmilModel::ParseL()
+        */
+        inline TInt ParseResult() const;
+
+    private:  // New functions
+
+        /**
+        * CUniDataModel
+        * Constructor.
+        */
+        CUniDataModel( RFs& aFs, CBaseMtm& aMtm );
+
+        /**
+        * ConstructL
+        * 2nd phase constructor.
+        */
+        void ConstructL();
+
+    private: // New Functions
+
+
+        /**
+        * DoParseFileCompleteL
+        */
+        void DoParseFileCompleteL();
+
+        /**
+        * FinalizeRestoreL
+        */
+        void FinalizeRestoreL( TInt aError );
+
+        /**
+        * Handles corrupted attachments.
+        *
+        * @param aRemoveCorrupted   IN
+        *   - If ETrue tries to recover by removing corrupted attachments.
+        *
+        *     Note: This means that SMIL parsing will fail with ESmil_Missing_Objects.
+        *           and object order is not maintained. But better to do it this
+        *           way so that message can be opened.
+        *
+        *   - If EFalse leaves with KErrCorrupt if corrupted attachments detected.
+        *     Model not made caller should exit!
+        */
+        void FindAndHandleCorruptL( TBool aRemoveCorrupted );
+
+        /**
+        * Finds corrupted attachments from context message.
+        */
+        CMsvEntrySelection* FindCorruptLC();
+
+        /**
+        * FindAttachmentsL
+        * Browses through SMIL and separates objects that are
+        * referenced from attachments.
+        */
+        void FindAttachmentsL();
+
+        /**
+        * Creates an object from msg store attachment
+        * @param aMimeType - mime type of new object.
+        * @param aAttachmentId - ID to be used for searching
+        *                        attachment from store
+        */
+        CUniObject* CreateObjectFromAttachmentLC(
+            const TPtrC8& aMimeType,
+            RFile& aFile,
+            MMsvAttachmentManager& aManager,
+            CMsvAttachment& aAttachment );
+
+        /**
+        * Browses through (non-MMS) SMIL and searches reference counts for objects and separates
+        * objects and attachments in different lists.
+        */
+        void FindDomObjectRefCountsL();
+
+    protected:  // data
+
+        RFs&                iFs;
+        CBaseMtm&           iMtm;
+
+        CMsgMediaResolver*  iMediaResolver;
+
+        CUniDataUtils*      iDataUtils;
+        CUniObjectList*     iObjectList;
+        CUniObjectList*     iAttachmentList;
+        CUniSmilList*       iSmilList;
+
+        CUniSmilModel*      iSmilModel;
+        TUniSmilType        iSmilType;
+        TInt                iOrigAttachmentCount;
+        TInt                iCorruptedCount; // Number of attas detected to be corrupted when loading
+
+        CMDXMLParser*       iParser;
+        CMDXMLDocument*     iDom;
+
+        MUniDataModelObserver* iObserver;
+        TInt                iParseResult;
+        CActiveSchedulerWait     iObjWait;
+        CUniObject*         iObjectToParse;
+        CMmsConformance* iMmsConformance;
+};
+
+#include <UniDataModel.inl>
+
+#endif   // __UNIDATAMODEL_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniDataModel.inl	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,145 @@
+/*
+* 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: 
+*       Inlines for CUniDataModel
+*
+*
+*/
+
+#include "debugtraces.h"
+
+
+// ---------------------------------------------------------
+// CUniDataModel::ObjectList
+// ---------------------------------------------------------
+//
+inline CUniObjectList& CUniDataModel::ObjectList() const
+    {
+    
+    return *iObjectList;
+    }
+
+// ---------------------------------------------------------
+// CUniDataModel::AttachmentList
+// ---------------------------------------------------------
+//
+inline CUniObjectList& CUniDataModel::AttachmentList() const
+    {
+    return *iAttachmentList;
+    }
+
+// ---------------------------------------------------------
+// CUniDataModel::SmilList
+// ---------------------------------------------------------
+//
+inline CUniSmilList& CUniDataModel::SmilList() const
+    {
+    return *iSmilList;
+    }
+
+// ---------------------------------------------------------
+// CUniDataModel::DataUtils
+// ---------------------------------------------------------
+//
+inline CUniDataUtils& CUniDataModel::DataUtils() const
+    {
+    return *iDataUtils;
+    }
+
+// ----------------------------------------------------
+// CUniDataModel::SetSmilType
+// ----------------------------------------------------
+//
+inline TUniSmilType CUniDataModel::SmilType()
+    {
+    return iSmilType;
+    }
+
+// ----------------------------------------------------
+// CUniDataModel::SetSmilType
+// ----------------------------------------------------
+//
+inline void CUniDataModel::SetSmilType( TUniSmilType aSmilType )
+    {
+    iSmilType = aSmilType;
+    }
+
+// ---------------------------------------------------------
+// CUniDataModel::SmilModel
+// ---------------------------------------------------------
+//
+inline CUniSmilModel& CUniDataModel::SmilModel() const
+    {
+#ifdef _DEBUG_TRACES_
+    qCritical() << " CUniDataModel SmilModel start";
+#endif
+
+    return *iSmilModel;
+    }
+
+// ---------------------------------------------------------
+// CUniDataModel::MediaResolver
+//
+// ACCESSOR
+// ---------------------------------------------------------
+//
+inline CMsgMediaResolver& CUniDataModel::MediaResolver() const
+    {
+    return *iMediaResolver;
+    }
+
+// ---------------------------------------------------------
+// CUniDataModel::MmsConformance
+//
+// ACCESSOR
+// ---------------------------------------------------------
+//
+inline CMmsConformance& CUniDataModel::MmsConformance() const
+    {
+    return *iMmsConformance;
+    }
+
+// ---------------------------------------------------------
+// CUniDataModel::Dom
+//
+// Accessor.
+// ---------------------------------------------------------
+//
+inline CMDXMLDocument* CUniDataModel::Dom()
+    {
+    return iDom;
+    }
+
+// ---------------------------------------------------------
+// CUniDataModel::SetDom
+//
+// Mutator.
+// ---------------------------------------------------------
+//
+inline void CUniDataModel::SetDom( CMDXMLDocument* aDom )
+    {
+    delete iDom;
+    iDom = aDom;
+    }
+
+// ---------------------------------------------------------
+// CUniDataModel::ParseResult
+//
+// ---------------------------------------------------------
+//
+inline TInt CUniDataModel::ParseResult() const
+    {
+    return iParseResult;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniDataUtils.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,203 @@
+/*
+* 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: 
+*           Data utility class for UniEditor & MMS related editors and viewers
+*
+*
+*/
+
+
+
+#ifndef __UNIDATAUTILS_H
+#define __UNIDATAUTILS_H
+
+//  INCLUDES
+#include <apmstd.h>         //TDataType
+#include <apgcli.h>         //RApaLsSession
+#include <barsc.h>
+#include <UniModelConst.h>
+#include <cmsvattachment.h> // TMsvAttachmentId
+
+
+// CONSTANTS
+_LIT8( KUniEmptySlide,      "application/X-MmsEmptySlide" );
+
+// MACROS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// FORWARD DECLARATIONS
+class CMsgTextUtils;
+class CBaseMtm;
+class MMsvAttachmentManager;
+
+// CLASS DECLARATION
+
+/**
+* CUniDataUtils - Miscellaneous UI indenependent utilities.
+*
+* @lib UniDataUtils.lib
+* @since 3.1
+*/
+class CUniDataUtils : public CBase
+    {
+    public:  // Constructors and destructor
+
+        /**
+        * Constructor.
+        *
+        * @since    3.1
+        * @param    aFs     IN Fileserver session.
+        * @return   Pointer to instance
+        */
+        IMPORT_C static CUniDataUtils* NewL( RFs& aFs );
+
+        /**
+        * Destructor.
+        *
+        * @since 3.1
+        */
+        virtual ~CUniDataUtils();
+
+        /**
+        * DefaultFileName
+        * (e.g. "noname" - no prefix)
+        *
+        * @since    3.1
+        * @return   Pointer to default file name buffer
+        */
+        inline TPtrC DefaultFileName() const;
+
+        /**
+        * EmptyPageString
+        * (e.g. "Empty page")
+        *
+        * @since    3.1
+        * @return   Pointer to "empty page" buffer
+        */
+        inline TPtrC EmptyPageString() const;
+
+        /**
+        * CharconvIdToMibIdL
+        * Converts between id's.
+        *
+        * @since    3.1
+        * @param    aCharconvCharsetId  IN charconv id
+        * @return   MIB enumeration
+        */
+        IMPORT_C TUint CharconvIdToMibIdL( TUint aCharconvCharsetId );
+
+        /**
+        * MibIdToCharconvIdL
+        * Converts between id's.
+        *
+        * @since    3.1
+        * @param    aMibId  IN MIB enumeration
+        * @return   Charconv id
+        */
+        IMPORT_C TUint MibIdToCharconvIdL( TUint aMibId );
+
+        /**
+        * Gets bytes size of UTF8 formatted text
+        *
+        * @since    3.1
+        * @param aText
+        * @return Size of text in bytes
+        */
+        IMPORT_C static TInt UTF8Size( TPtrC aText );
+
+        /**
+        * Gets bytes size of file.
+        *
+        * @since    3.1
+        * @param aFileName
+        * @return Size of the file.
+        */
+        IMPORT_C TInt FileSizeL( const TFileName& aFileName );
+
+        /**
+        * Get open file handle for an attachment
+        *
+        * @since    3.1
+        * @param    aMtm    Client MTM
+        * @param    aId     Attachment ID
+        * @return   Open read-only file handle.
+        *           It is callers responsibilty to close the handle.
+        */
+        IMPORT_C static RFile GetAttachmentFileL( CBaseMtm& aMtm, TMsvAttachmentId aId );
+
+        /**
+        * Get the "attachment manager index position" for an attachment.
+        *
+        * @since    3.1
+        * @return "attachment manager index position"
+        * @leave  KErrNotFound if attachment is not found from the store
+        */
+        IMPORT_C static TInt IndexPositionOfAttachmentL(
+            MMsvAttachmentManager& aManager,
+            TMsvAttachmentId aId );
+
+    protected:
+
+        /**
+        * C++ constructor
+        *
+        * @since    3.1
+        * @param    aFs     IN Fileserver session.
+        */
+        CUniDataUtils( RFs& aFs );
+
+        /**
+        * ConstructL
+        * Symbian OS constructor
+        *
+        * @since    3.1
+        */
+        void ConstructL();
+
+        /**
+        * RegisterDataL
+        * Reads data from resources.
+        *
+        * @since    3.1
+        */
+        void RegisterDataL();
+
+        /**
+        * ReadResStringsL
+        * Reads strings from resources to internal mimetype arrays.
+        *
+        * @since    3.1
+        * @param    aResourceFile   IN opened resourcefile
+        * @param    aSrcResId   IN resource id to read from
+        * @return   Pointer to read string
+        **/
+        HBufC* ReadResStringL( const RResourceFile& aResourceFile, TInt aSrcResId );
+
+    protected:  // data
+
+        RFs& iFs;
+        CMsgTextUtils* iTextUtils;
+        HBufC* iDefaultFileName;
+        HBufC* iEmptyPageString;
+
+    };
+
+#include <UniDataUtils.inl>
+
+#endif   // __UNIDATAUTILS_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniDataUtils.inl	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,37 @@
+/*
+* 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: 
+*           Data utility class for UniEditor & MMS related editors and viewers
+*     
+*
+*/
+
+
+// ---------------------------------------------------------
+// CUniDataUtils::DefaultFileName
+// ---------------------------------------------------------
+//
+inline TPtrC CUniDataUtils::DefaultFileName() const
+    {
+    return *iDefaultFileName;
+    }
+
+// ---------------------------------------------------------
+// CUniDataUtils::DefaultFileName
+// ---------------------------------------------------------
+//
+inline TPtrC CUniDataUtils::EmptyPageString() const
+    {
+    return *iEmptyPageString;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniDrmInfo.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,246 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*       CUniDrmInfo, Storage for single attachment in presentation.
+*
+*
+*/
+
+
+
+#ifndef __UNIDRMINFO_H
+#define __UNIDRMINFO_H
+
+// INCLUDES
+
+#include <e32std.h>
+#include <cmsvattachment.h>
+
+#include <caf/caf.h>
+#include <DRMHelper.h>
+#include <DRMRights.h>
+
+#include <UniObject.h>
+
+// CONSTANTS
+
+// MACROS
+
+// FORWARD DECLARATIONS
+class CBaseMtm;
+class CMsgMediaInfo;
+class CDRMHelper;
+#ifndef DRMCOMMONIN_POISTO
+class DRMCommon;
+#endif
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// CLASS DECLARATION
+
+/**
+* CUniDrmInfo - DRM information of an attachment.
+*
+* @lib UniDataModel.lib
+* @since 3.1
+*/
+class CUniDrmInfo : public CBase
+    {
+
+    public:  // New methods
+
+        /**
+        * Factory method that creates this object
+        * from an attachment.
+        *
+        * @since    3.1
+        * @return   Pointer to instance in cleanup stack
+        */
+        IMPORT_C static CUniDrmInfo* NewLC(
+            RFs& aFs,
+            CBaseMtm& aMtm,
+            TMsvAttachmentId& aId,
+            CMsgMediaInfo& aMediaInfo );
+
+        /**
+        * Factory method that creates this object
+        * from an attachment.
+        *
+        * @since    3.1
+        * @return   Pointer to instance
+        */
+        IMPORT_C static CUniDrmInfo* NewL(
+            RFs& aFs,
+            CBaseMtm& aMtm,
+            TMsvAttachmentId& aId,
+            CMsgMediaInfo& aMediaInfo );
+
+        /**
+        * Destructor
+        *
+        * @since    3.1
+        */
+        virtual ~CUniDrmInfo();
+
+        /**
+        * Freezes and locks the DRM rights of the object if available.
+        * -> No counts will be reduced
+        * @return   Error code from CDRMHelper::Consume2(). Some controls
+        * may ignore the value but some don't
+        * @since    3.1
+        */
+        IMPORT_C TInt FreezeRights();
+
+        /**
+        * Consumes and locks the DRM rights of the object if available.
+        * -> One count will be reduced
+        * @return   Error code from CDRMHelper::Consume2(). Some controls
+        * may ignore the value but some don't
+        * @since    3.1
+        */
+        IMPORT_C TInt ConsumeRights();
+
+        /**
+        * Evaluates DRM rights of the object if available.
+        * Use count is not changed.
+        * @param aConsumed
+        *        return information whether DRM rights have already been consumed
+        * @since    3.1
+        */
+        IMPORT_C TInt EvaluateRights( TBool& aConsumed );
+
+        /**
+        * Releases the DRM rights of the object.
+        * @return   Error code from CDRMHelper::Consume2().Some controls
+        * may ignore the value but some don't
+        * @since    3.1
+        */
+        IMPORT_C TInt ReleaseRights();
+
+        /**
+        * Convenience function to check whether DRM rights for
+        * the object are valid.
+        * @since    3.1
+        * @param    aUpdate         IN  if ETrue, updates rights info,
+        *                               otherwise returns rights as they were
+        *                               when the object was constructed.
+        */
+        IMPORT_C TBool RightsValidL( TBool aUpdate );
+
+        /**
+        * Check whether this is combined delivery cobject with one
+        * play count left. This information is needed to show note
+        * "Message contains an object that can only be viewed once"
+        *  §qtn.drm.preview.msg§
+        * @return ETrue
+        *         EFalse
+        */
+        IMPORT_C TBool IsDrmWithOnePreview();
+
+        /**
+        * Handles DRM error ( taken place in an UI control).
+        */
+        IMPORT_C void HandleDrmErrorL( TInt aError );
+        
+    protected: 
+
+        enum TUniDRMConsumeStatus
+            {
+            EUniDRMNone,
+            EUniDRMFrozen,
+            EUniDRMConsumed
+            };
+
+        /**
+        * Constructor.
+        *
+        * @since    3.1
+        */
+        CUniDrmInfo(
+            RFs& aFs,
+            CBaseMtm& aMtm,
+            TMsvAttachmentId& aId,
+            CMsgMediaInfo& aMediaInfo );
+
+        /**
+        * 2nd phase constructor.
+        *
+        * @since    3.1
+        */
+        void ConstructL();
+
+        /**
+        * Gets rights info from a media object.
+        * @param aRightsObj optionally returns CDRMRights of the object, if
+        *        Ownership is transferred to caller.
+        * @since    3.1
+        */
+        void DoGetRightsInfoL(CDRMRights** aRightsObj = NULL);
+
+        inline ContentAccess::TIntent ConsumeIntent();
+
+        /**
+        * Check whether this is combined delivery cobject with one
+        * play count left. This information is needed to show note
+        * "Message contains an object that can only be viewed once"
+        *  §qtn.drm.preview.msg§. Value is saved iDrmOnePreview.
+        */
+        void SetIsDrmWithOnePreviewL();
+
+        /**
+        * Creates internal CData object. It cannot be created during construction.
+        * @return If this object is not DRM protected returns NULL.
+        */
+        CData* CreateCDataL();
+
+    protected: // data
+
+        RFs&                    iFs;
+		TInt                    iSupportedFeatures;
+
+        CBaseMtm&               iMtm;
+        TMsvAttachmentId&       iAttachmentId;
+        CMsgMediaInfo&          iMediaInfo;
+
+#ifdef DRMCOMMONIN_POISTO
+        ContentAccess::CRightsManager*  iRightsManager;
+#else
+        DRMCommon*              iDRMCommon;
+#endif
+
+        CDRMHelper*             iDRMHelper;
+        TUniDRMConsumeStatus    iDRMConsumeStatus;
+        TInt                    iDRMConsumeCount;
+        TBool                   iDRMRightsExist;
+        CDRMRights::TExpiration iDRMExpiration;
+        CDRMRights::TRestriction    iDRMRestriction;
+        TUint32                 iDRMConstraintType;
+
+        // DRm2 follows:
+        TBool                   iOma2;
+        // Indicates preview type
+        CDRMHelper::TDRMHelperPreviewType   iPreviewType;
+        // content URI (unique id) of the embedded preview content
+        TBool                   iHasInfoUri;
+        HBufC*                  iSendContentUrl;
+        TBool                   iCDataResolved;
+        TPtrC8                  iUsedContentUri;
+        TBool                   iDrmOnePreview;
+    };
+
+#include <UniDrmInfo.inl>
+
+#endif // __UNIDRMINFO_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniDrmInfo.inl	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*       CUniDrmInfo, Storage for single attachment in presentation. 
+*
+*
+*/
+
+                    
+// ---------------------------------------------------------
+// CUniDrmInfo::ConsumeIntent
+//
+// ---------------------------------------------------------
+//
+inline ContentAccess::TIntent CUniDrmInfo::ConsumeIntent()
+    {
+    switch ( iMediaInfo.MediaType() )
+        {
+        case EMsgMediaAudio:
+        case EMsgMediaVideo:
+            {
+            return ContentAccess::EPlay;
+            break;
+            }
+        case EMsgMediaImage:
+        case EMsgMediaText:
+        case EMsgMediaSvg:
+            {
+            return ContentAccess::EView;
+            break;
+            }
+        default:
+            {
+            return ContentAccess::EUnknown;
+            break;
+            }
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniMimeInfo.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,269 @@
+/*
+* 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: 
+*       CUniMimeInfo, Storage for objects mime headers.
+*
+*
+*/
+
+
+#ifndef __UNIMIMEINFO_H
+#define __UNIMIMEINFO_H
+
+// INCLUDES
+
+#include <cmsvattachment.h>
+
+// CONSTANTS
+
+// MACROS
+
+// FORWARD DECLARATIONS
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// CLASS DECLARATION
+class MMsvAttachmentManager;
+class CBaseMtm;
+class CUniDataUtils;
+
+/**
+* CUniMimeInfo - Container for the MIME headers of an attachment.
+* NOTE no support for X-Type-Params
+*      only support for filename ContentDisposition parameter
+*      only support for charset ContentTypeL parameter
+*
+* If some header is not set zero length descriptor is returned.
+*
+* @lib UniDataModel.lib
+* @since 3.1
+*/
+class CUniMimeInfo : public CBase
+    {
+    public:
+
+    /**
+    * Constructor
+    *
+    * @since    3.1
+    */
+    CUniMimeInfo();
+
+    /**
+    * Destructor
+    *
+    * @since    3.1
+    */
+    ~CUniMimeInfo();
+
+    //
+    // Accessors/Mutators
+    //
+
+    /**
+    * SetContentTypeL
+    * NOTE: 8-bit
+    *
+    * @since    3.1
+    * @param    aMimeType   IN content type
+    */
+    void SetContentTypeL( const TDesC8& aMimeType );
+
+    /**
+    * ContentType
+    * NOTE: 8-bit
+    *
+    * @since    3.1
+    * @return   pointer to content type buffer
+    */
+    inline const TPtrC8 ContentType() const;
+
+    /**
+    * SetCharset
+    * As content type charset parameter
+    * No other content type specific parameters supported
+    * charset = 0 means no charset is set
+    * (0 is IANA reserved number, not allocated currently to any charset.)
+    *
+    * @since    3.1
+    * @param    aCharset    IN character set as MIB enumeration
+    */
+    inline void SetCharset( TUint aCharset );
+
+    /**
+    * Charset
+    * As content type charset parameter
+    * No other content type specific parameters supported
+    * charset = 0 means no charset is set
+    * (0 is IANA reserved number, not allocated currently to any charset.)
+    *
+    * @since    3.1
+    * @return   character set MIB enumeration
+    */
+    inline TUint Charset() const;
+
+    /**
+    * SetContentTypeL
+    * NOTE: 16-bit
+    *
+    * @since    3.1
+    * @param    aContLoc    IN content location
+    */
+    void SetContentLocationL( const TDesC& aContLoc );
+
+    /**
+    * ContentLocation
+    * NOTE: 16-bit
+    *
+    * @since    3.1
+    * @return   pointer to content location buffer
+    */
+    inline const TPtrC ContentLocation() const;
+
+    /**
+    * SetContentIdL
+    * NOTE: 8-bit
+    *
+    * @since    3.1
+    * @param    aCid    IN content id
+    */
+    void SetContentIdL( const TDesC8& aCid );
+
+    /**
+    * ContentId
+    * NOTE: 8-bit
+    *
+    * @since    3.1
+    * @return   pointer to content id buffer
+    */
+    inline const TPtrC8 ContentId() const;
+
+    /**
+    * SetContentBaseL
+    * NOTE: 8-bit
+    *
+    * @since    3.1
+    * @param    aContBase   IN content base
+    */
+    void SetContentBaseL( const TDesC8& aContBase );
+
+    /**
+    * ContentBase
+    * NOTE: 8-bit
+    *
+    * @since    3.1
+    * @return   pointer to content base buffer
+    */
+    inline const TPtrC8 ContentBase() const;
+
+    /**
+    * SetContentDescriptionL
+    * NOTE: 8-bit
+    *
+    * @since    3.1
+    * @param    aContDesc   IN content description
+    */
+    void SetContentDescriptionL( const TDesC8& aContDesc );
+
+    /**
+    * ContentDescription
+    * NOTE: 8-bit
+    *
+    * @since    3.1
+    * @return   pointer to content description buffer
+    */
+    inline const TPtrC8 ContentDescription() const;
+
+    /**
+    * SetContentDispositionL
+    * NOTE: 8-bit
+    *
+    * @since    3.1
+    * @param    aContDesc   IN content disposition
+    */
+    void SetContentDispositionL( const TDesC8& aContDisp );
+
+    /**
+    * ContentDisposition
+    * NOTE: 8-bit
+    *
+    * @since    3.1
+    * @return   pointer to content disposition buffer
+    */
+    inline const TPtrC8 ContentDisposition() const;
+
+    /**
+    * Size
+    *
+    * @since    3.1
+    * @return   size of the mime headers in bytes
+    */
+    TInt Size() const;
+
+    /**
+    * SaveMimeInfoL
+    * Save objects mime info into message store
+    *
+    * @since    3.1
+    * @param    aManager    IN reference to attachment manager
+    * @param    aAttachment IN reference to attachment
+    */
+    void SaveMimeInfoL( MMsvAttachmentManager& aManager, CMsvAttachment& aAttachment );
+
+    /**
+    * ReadMimeInfoL
+    * Reads attachments mime info from message store
+    *
+    * @since    3.1
+    * @param    aAttachment IN reference to attachment
+    */
+    void ReadMimeInfoL( CMsvAttachment& aAttachment );
+
+	/**
+    * EnsureContentLocationL
+	* Make sure that ContentLocation exists. In case it
+    * doesn't one is created from the file name.
+    *
+    * @since    3.1
+    * @param    aManager    IN reference to attachment manager
+    * @param    aAttachment IN reference to attachment
+    * @param    aPlainFileName   IN attachment file name
+	*/
+    void EnsureContentLocationL(
+        MMsvAttachmentManager& aManager,
+        CMsvAttachment& aAttachment,
+        TDesC& aPlainFileName );
+
+    private: // data
+
+    HBufC8* iContentDescription;
+
+    HBufC8* iContentBase;
+    HBufC16* iContentLocation;
+    HBufC8* iContentId;
+
+    HBufC8* iContentType;
+    TUint iContentTypeCharset; // As MIB enum.
+
+    HBufC8* iContentDisposition;
+    };
+
+#include <UniMimeInfo.inl>
+
+#endif //__UNIMIMEINFO_H
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniMimeInfo.inl	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,90 @@
+/*
+* 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: 
+*       CUniMimeInfo, Storage for objects mime headers.
+*
+*
+*/
+
+
+// ---------------------------------------------------------
+// ContentType
+// NOTE: 8 bit.
+// ---------------------------------------------------------
+inline const TPtrC8 CUniMimeInfo::ContentType() const
+    {
+    return iContentType ? TPtrC8( *iContentType ) : TPtrC8();
+    }
+
+// ---------------------------------------------------------
+// Charset
+// ---------------------------------------------------------
+inline TUint CUniMimeInfo::Charset() const
+    {
+    return iContentTypeCharset;
+    }
+
+// ---------------------------------------------------------
+// SetCharset
+// ---------------------------------------------------------
+inline void CUniMimeInfo::SetCharset( TUint aCharset )
+    {
+    iContentTypeCharset = aCharset;
+    }
+
+// ---------------------------------------------------------
+// ContentLocation
+// NOTE: 16 bit.
+// ---------------------------------------------------------
+inline const TPtrC CUniMimeInfo::ContentLocation() const
+    {
+    return iContentLocation ? TPtrC( *iContentLocation ) : TPtrC();
+    }
+        
+// ---------------------------------------------------------
+// ContentId
+// NOTE: 8 bit.
+// ---------------------------------------------------------
+inline const TPtrC8 CUniMimeInfo::ContentId() const
+    {
+    return iContentId ? TPtrC8( *iContentId ) : TPtrC8();
+    }
+
+// ---------------------------------------------------------
+// ContentBaseL
+// NOTE: 8 bit.
+// ---------------------------------------------------------
+inline const TPtrC8 CUniMimeInfo::ContentBase() const
+    {
+    return iContentBase ? TPtrC8( *iContentBase ) : TPtrC8();
+    }   
+
+// ---------------------------------------------------------
+// ContentDescription
+// NOTE: 8 bit.
+// ---------------------------------------------------------
+inline const TPtrC8 CUniMimeInfo::ContentDescription() const
+    {
+    return iContentDescription ? TPtrC8( *iContentDescription ) : TPtrC8();
+    }
+
+// ---------------------------------------------------------
+// ContentDisposition
+// NOTE: 8 bit.
+// ---------------------------------------------------------
+inline const TPtrC8 CUniMimeInfo::ContentDisposition() const
+    {
+    return iContentDisposition ? TPtrC8( *iContentDisposition ) : TPtrC8();
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniModelConst.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,87 @@
+/*
+* 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: 
+*       UniEditor constant definitions
+*
+*
+*/
+
+
+#ifndef __UNIMODELCONST_H
+#define __UNIMODELCONST_H
+
+// INCLUDES
+#include <msvids.h>                     // TMsvId
+/*rushi
+#include <unieditorfeatures.h>
+*/
+
+// CONSTANTS
+const TInt KDefResFileSignature = 4;  // Dummy resource file signature
+_LIT( KUniDataModelResourceFilename, "z:UniDataModel.rsc" );
+
+// MACROS
+
+// FORWARD DECLARATIONS
+
+// DATA TYPES
+
+// Value returned by SMIL model's ParseL method.
+enum TUniParseResult
+    {
+    EParsedFromList            = 0x0001, // (1) <-+ These are exclusive for each other
+    EParsedFromSmil            = 0x0002, // (1) <-/
+    EUnsupportedObjects        = 0x0100,
+    EMissingObjects            = 0x0200,
+    EBadlyReferencedObjects    = 0x0400,
+    ERegionMediaTypeMismatch   = 0x0800,
+    EOneNonConformantObject    = 0x1000,
+    EMultiNonConformantObject  = 0x2000,
+    ETextAndImageRegionsSame   = 0x4000,
+    EObjectRemoved             = 0x8000
+    };
+
+enum TUniSmilType
+    {
+    ENoSmil,
+    EMultipleSmil,
+    EMmsSmil,
+    ETemplateSmil,
+    E3GPPSmil
+    };
+
+//  TUniLayout
+//  Defines order of objects in display.
+enum TUniLayout
+    {
+    EUniUndefinedLayout = 0,
+    EUniImageFirst,
+    EUniTextFirst
+    };
+
+enum TUniRegion
+    {
+    EUniRegionUnresolved,
+    EUniRegionImage,
+    EUniRegionText,
+    EUniRegionAudio
+    };
+
+// FUNCTION PROTOTYPES
+
+// CLASS DECLARATION
+
+#endif // __UNIMODELCONST_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniObject.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,628 @@
+/*
+* 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: 
+*       CUniObject, Storage for single attachment in presentation.
+*
+*
+*/
+
+
+#ifndef __UNIOBJECT_H
+#define __UNIOBJECT_H
+
+// INCLUDES
+
+#include <e32std.h>
+#include <msvstd.h>     // for TMsvId
+#include <cmsvattachment.h>
+
+#include <DRMEvent.h>
+#include <DRMEventObserver.h>
+
+#include <MsgMedia.hrh>
+
+#include <UniModelConst.h>
+
+// CONSTANTS
+const TUid KUidAttachmentIndication = {0x10282CB0};
+
+// MACROS
+
+// FORWARD DECLARATIONS
+class CUniMimeInfo;
+class CMsgMediaInfo;
+class CUniDrmInfo;
+class CBaseMtm;
+class CUniDataUtils;
+class CMsvStore;
+class MMsvAttachmentManager;
+class CUniObject;
+class CDRMNotifier;
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// CLASS DECLARATION
+
+/**
+* MUniObjectSaveObserver - Callback API for object saving.
+*
+* @since 3.1
+*/
+class MUniObjectSaveObserver
+    {
+    public:
+        virtual void ObjectSaveReady( TInt aError ) = 0;
+    };
+
+enum TUniObjectEvent
+    {
+	EUniObjectEventDrmRightsChanged = 0
+    };
+
+class MUniObjectObserver
+    {
+    public:
+        virtual void HandleUniObjectEvent(  CUniObject&  aUniObject,
+                                            TUniObjectEvent aUniEvent ) = 0;
+    };
+
+/**
+* CUniObject - Representation of a single attachment of a message.
+*
+* @lib UniDataModel.lib
+* @since 3.1
+*/
+class CUniObject : public CActive,
+                   public MDRMEventObserver
+
+    {
+
+    public:  // New methods
+
+        /**
+        * Factory method that creates this object
+        * from an attachment.
+        *
+        * @since    3.1
+        * @param    aMtm    IN reference to client mtm
+        * @param    aMedia  IN initialized media info object - takes ownership!
+        * @param    aManager        IN reference to attachment manager
+        * @param    aAttachmentId   IN id of the attachment from
+        *                           which to create the object
+        * @return   Pointer to instance in cleanup stack
+        */
+        IMPORT_C static CUniObject* NewLC(
+            RFs& aFs,
+            CBaseMtm& aMtm,
+            CUniDataUtils& aData,
+            CMsgMediaInfo* aMedia,
+            MMsvAttachmentManager& aManager,
+            CMsvAttachment& aAttachment );
+
+        /**
+        * Factory method that creates this object
+        * from an attachment.
+        *
+        * @since    3.1
+        * @param    aMtm    IN reference to client mtm
+        * @param    aMedia  IN initialized media info object - takes ownership!
+        * @param    aAttachmentId   IN id of the attachment from
+        *                           which to create the object
+        * @return   Pointer to instance
+        */
+        IMPORT_C static CUniObject* NewL(
+            RFs& aFs,
+            CBaseMtm& aMtm,
+            CUniDataUtils& aData,
+            CMsgMediaInfo* aMedia,
+            MMsvAttachmentManager& aManager,
+            CMsvAttachment& aAttachment );
+
+        /**
+        * Factory method that creates this object
+        * from a file.
+        *
+        * @since    3.1
+        * @param    aData   IN reference to MsgData object
+        * @param    aMedia  IN initialized media info object - takes ownership!
+        * @return   Pointer to instance in cleanup stack
+        */
+        IMPORT_C static CUniObject* NewLC(
+            RFs& aFs,
+            CBaseMtm& aMtm,
+            CUniDataUtils& aData,
+            CMsgMediaInfo* aMedia );
+
+        /**
+        * Factory method that creates this object
+        * from a file.
+        *
+        * @since    3.1
+        * @param    aData   IN reference to MsgData object
+        * @param    aMedia  IN initialized media info object - takes ownership!
+        * @return   Pointer to instance
+        */
+        IMPORT_C static CUniObject* NewL(
+            RFs& aFs,
+            CBaseMtm& aMtm,
+            CUniDataUtils& aData,
+            CMsgMediaInfo* aMedia );
+
+        /**
+        * Destructor
+        *
+        * @since    3.1
+        */
+        virtual ~CUniObject();
+
+        /**
+        * Save
+        * Save the object to message store.
+        * If leave occurs, attachment is cleaned up from the
+        * message store.
+        *
+        * @since    3.1
+        * @param    aObserver   IN operation observer
+        * @param    aSaveType   IN save type
+        */
+        virtual void Save(
+            MUniObjectSaveObserver& aObserver,
+            CMsvAttachment::TMsvAttachmentType aSaveType );
+
+        /**
+        * Remove from store
+        * Removes attachment from message store.
+        *
+        * @since    3.1
+        * @param    aMtm    IN reference to MMS client mtm
+        */
+        virtual void RemoveFromStoreL();
+
+        /**
+        * AttachmentId
+        * Accessor.
+        *
+        * @since    3.1
+        * @return   Attachment id of the object
+        */
+        inline TMsvAttachmentId AttachmentId() const;
+
+        /**
+        * MimeInfo
+        * Accessor.
+        *
+        * @since    3.1
+        * @return   Pointer to the object's mime header class
+        */
+        inline CUniMimeInfo* MimeInfo() const;
+
+        /**
+        * DrmInfo
+        * Accessor.
+        *
+        * @since    3.1
+        * @return   Pointer to the object's mime header class
+        */
+        inline CUniDrmInfo* DrmInfo() const;
+
+        /**
+        * MimeType
+        * Returns the mime type of the object. Use this instead
+        * of MimeInfo's or MediaInfo's mime type unless you are
+        * absolutely sure what you are doing.
+        *
+        * @since    3.1
+        * @return   Mime type of the object.
+        */
+        IMPORT_C TPtrC8 MimeType() const;
+
+        /**
+        * MediaInfo
+        * Accessor.
+        *
+        * @since    3.1
+        * @return   Pointer to the object's media info class
+        */
+        inline CMsgMediaInfo* MediaInfo() const;
+
+        /**
+        * MediaType
+        * Returns the media type of the object. Use this instead
+        * of MediaInfo's media type unless you are absolutely
+        * sure what you are doing.
+        *
+        * @since    3.1
+        * @return   Media type of the object.
+        */
+        IMPORT_C TMsgMediaType MediaType() const;
+
+        /*
+        * Size
+        *
+        * @since    3.1
+        * @param    aWithoutHeaders IN if ETrue include MIME headers' sizes
+        *                           if EFalse count only file sizes
+        * @return   Size of the object in bytes
+        */
+        virtual TInt Size( TBool aWithoutHeaders = ETrue );
+
+        /**
+        * Corrupted
+        * Accessor.
+        *
+        * @since    3.1
+        * @return   ETrue, if object corrupted,
+        *           EFalse otherwise
+        */
+        inline TBool Corrupted() const;
+
+        /**
+        * SetCorrupted
+        * Mutator.
+        *
+        * @since    3.1
+        * @param    aCorrupted  IN ETrue to mark object corrupted
+        */
+        inline void SetCorrupted( TBool aCorrupted );
+
+        /**
+        * StoreState
+        * Accessor.
+        *
+        * @since    3.1
+        * @return   Store state of the object:
+        *           EStoreStateAttachment if object is stored into message store and "visible"
+        *           EStoreStateTemporary if is not yet in message store
+        *           EStoreStateHidden if object is stored into message store and "hidden"
+        */
+        //inline TMsgObjectStoreState StoreState() const;
+
+        /**
+        * SetReferenceCount
+        * Mutator.
+        *
+        * @since    3.1
+        * @param    aCount  IN number of times the object is referenced in
+        *                   the message (normally in the SMIL).
+        */
+        inline void SetReferenceCount( TInt aCount );
+
+        /**
+        * ReferenceCount
+        * Accessor.
+        *
+        * @since    3.1
+        * @return   Number of times the object is referenced in
+        *           the message (normally in the SMIL).
+        */
+        inline TInt ReferenceCount() const;
+
+        /**
+        * SetRegion
+        * Mutator.
+        *
+        * @since    3.1
+        * @param    region object is in SMIL
+        */
+        inline void SetRegion( TUniRegion aRegion );
+
+        /**
+        * Region
+        * Accessor.
+        *
+        * @since    3.1
+        * @return   region object is in SMIL
+        */
+        inline TUniRegion Region() const;
+
+        /**
+        * SetMediaTypeBySmilTag
+        * Mutator.
+        *
+        * @since    3.1
+        * @param    media type by SMIL media tag
+        */
+        inline void SetMediaTypeBySmilTag( TMsgMediaType aMediaType );
+
+        /**
+        * ReferenceCount
+        * Accessor.
+        *
+        * @since    3.1
+        * @return   media type by SMIL media tag
+        */
+        inline TMsgMediaType MediaTypeBySmilTag() const;
+
+        /**
+        * SetUniqueControlHandle
+        * Mutator.
+        *
+        * @since    3.2
+        * @param    UniqueControlHandle, -1 for "resetting".
+        */
+        inline void SetUniqueControlHandle( TInt aUniqueControlHandle );
+
+        /**
+        * UniqueControlHandle
+        * Accessor.
+        *
+        * @since    3.2
+        * @return   UniqueControlHandle, -1 if not set.
+        */
+        inline TInt UniqueControlHandle() const;
+
+        /**
+        * SetAttachment
+        * Mutator.
+        *
+        * @since    3.2
+        * @param    aObjectAttachment ETrue if object is attachment, otherwise EFalse
+        */
+        inline void SetAttachment( TBool aObjectAttachment );
+
+        /**
+        * Attachment
+        * Accessor.
+        *
+        * @since    3.2
+        * @return   ETrue if object is attachment, otherwise EFalse
+        */
+        inline TBool Attachment() const;
+
+        /**
+        * IsSaved
+        * Accessor.
+        *
+        * @since    3.2
+        * @return   Information whether this object has been saved into file system
+        *           in Viewer.
+        */
+        inline TBool IsSaved( );
+
+        /**
+        * IsSaved
+        * Mutator.
+        *
+        * @since    3.2
+        * @param    aSaved ETrue attachment has been saved
+        *                  EFalse attachment has not been saved
+        */
+        inline void SetSaved( TBool aSaved );
+
+        /**
+        * IsDrmRightsWhenLoaded. Function is applicable only, if DrmInfo exists.
+        * Accessor.
+        *
+        * @since    5.0
+        * @return   Checks whether object had DRM rights when this object was loaded
+        *           into screen. If last DRM rights were consumed during loading,
+        *           it returns ETrue.
+        *
+        */
+        inline TBool IsDrmRightsWhenLoaded( ) const;
+
+        /**
+        * ResolveDrmRightsWhenLoadedL. Saves information whether this object had DRM
+        *           rights when slide having the object was loaded. Uses
+        *           CDrmInfo::EvaluateRights() to resolve status
+        * Mutator.
+        *
+        * @since    5.0
+        *
+        */
+        IMPORT_C void ResolveDrmRightsWhenLoadedL( );
+
+        /**
+        * SetDrmRightsWhenLoadedL. Saves information whether this object had DRM
+        *            rights when slide having the object was loaded.
+        * Mutator.
+        *
+        * @since    5.0
+        * @param    aRights ETrue: objects had rights, which were already consumed or if not consumed,
+        *                   have still rights left
+        *                   EFalse: rights have not been consumed and they are not left
+        *
+        */
+        IMPORT_C void SetDrmRightsWhenLoaded( TBool aRights );
+
+        /**
+        * IsDrmRightsWhenLoadedObjects. Function is applicable only, if DrmInfo exists.
+        * Accessor.
+        *
+        * @since    5.0
+        * @return   Checks whether object had DRM rights when this object was loaded
+        *           into screen in the Objects view. If last DRM rights were consumed during loading,
+        *           it returns ETrue.
+        *
+        */
+        inline TBool IsDrmRightsWhenLoadedObjects( ) const;
+
+        /**
+        * SetDrmRightsWhenLoadedObjects. Saves information whether this object had DRM
+        *            rights when slide having the object was loaded into screen in the
+        *            Objects view.
+        * Mutator.
+        *
+        * @since    5.0
+        * @param    aRights ETrue: objects had rights, which were already consumed or if not consumed,
+        *                   have still rights left
+        *                   EFalse: rights have not been consumed and they are not left
+        *
+        */
+        IMPORT_C void SetDrmRightsWhenLoadedObjects( TBool aRights );
+
+        /**
+        * Sets observer of UniObject events. Several observers are supported at the same time.
+        * Mutator.
+        *
+        * @since    5.0
+        * @param    aObserver observer
+        *
+        */
+        IMPORT_C void SetObserverL(  MUniObjectObserver* aObserver );                       
+
+        /**
+        * Removes observer of UniObject events.
+        * Accessor.
+        *
+        * @since    5.0
+        *
+        */
+        IMPORT_C void RemoveObserver(   MUniObjectObserver*     aObserver );
+
+    protected:
+
+        /**
+        * From CActive
+        */
+        void DoCancel();
+
+        /**
+        * From CActive
+        */
+        void RunL();
+
+        /**
+        * From CActive
+        */
+        TInt RunError( TInt aError );
+
+    protected:
+
+        /**
+        * Constructor.
+        *
+        * @since    3.1
+        */
+        CUniObject(
+            RFs& aFs,
+            CBaseMtm& aMtm,
+            CUniDataUtils& aData,
+            CMsgMediaInfo* aMedia );
+
+        /**
+        * 2nd phase constructor.
+        *
+        * @since    3.1
+        */
+        void ConstructL();
+
+        /**
+        * 2nd phase constructor.
+        *
+        * @since    3.1
+        * @param    aManager        IN reference to attachment manager
+        * @param    aAttachmentId   IN id of the attachment from
+        *                           which to create the object
+        */
+        void ConstructFromAttachmentL(
+            MMsvAttachmentManager& aManager,
+            CMsvAttachment& aAttachment );
+
+        /**
+        * CreateMimeInfoL
+        * Create mime info for the object from the file information
+        * and in-parameters.
+        *
+        * @since    3.1
+        */
+        void CreateMimeInfoL();
+
+        /**
+        * CreateAttachmentL
+        * Creates an attachment to message store.
+        * If leave occurs, attachment is cleaned up from the
+        * message store.
+        *
+        * @since    3.1
+        */
+        void CreateAttachmentL( );
+
+        /**
+        * SetHiddenL
+        * Sets attachment "hidden" or "visible"
+        * "Hidden" means InPreparation flag is set on and
+        * "visible" means InPreparation flag is set off
+        * Not to be called for "temporary" object
+        *
+        * @since    3.1
+        * @param    aHidden IN ETrue for "hidden", EFalse for "visible"
+        */
+        //void SetHiddenL( TBool aHidden );
+
+        virtual void DoSaveL();
+
+        void StartObjectSaveL();
+        void FinalizeObjectSaveL();
+
+        void CompleteSelf();
+
+        /// From MDRMEventObserver
+        virtual void HandleEventL( MDRMEvent* aEvent );
+
+
+    protected: // data
+
+        enum TMsgObjectSaveState
+            {
+            EObjectSavingIdle,
+            EObjectCreatingAttachment
+            };
+
+        enum TMsgObjectFlags
+            {
+            EObjectCorrupted = 0x1,
+            EObjectAttachment = 0x2,
+            EObjectDrmRightsWhenLoaded = 0x4,
+            EObjectDrmRightsWhenLoadedObjects = 0x8
+            };
+
+        RFs&                    iFs;
+        CBaseMtm&               iMtm;
+        CUniDataUtils&          iData;
+
+		TInt                    iSupportedFeatures;
+
+        TMsvAttachmentId        iAttachmentId;  // Attachment id of object. Can be id to Link file in store or to real atta.
+
+        CUniMimeInfo*           iMimeInfo;      // Contains objects mime headers.
+        CMsgMediaInfo*          iMediaInfo;     // Contains objects media information.
+        CUniDrmInfo*            iDrmInfo;
+        TInt                    iObjectFlags;
+        TInt                    iReferenceCount;
+        //TMsgObjectStoreState    iStoreState;
+        TUniRegion              iRegion;
+        TMsgMediaType           iMediaTypeBySmilTag;
+        TInt                    iUniqueControlHandle;
+
+        MUniObjectSaveObserver* iObserver;
+        CMsvAttachment::TMsvAttachmentType iSaveType;
+
+        MMsvAttachmentManager*  iManager;
+        CMsvAttachment*         iAttachment;
+        CMsvStore*              iEditStore;
+        TInt                    iSaveState;
+
+        TBool                   iSavedToFs;
+        RFile                   iFileHandle;
+
+        CDRMNotifier*           iDrmNotifier;
+        CArrayPtrFlat<MUniObjectObserver>* iObservers;
+
+    };
+
+#include <UniObject.inl>
+
+#endif // __UNIOBJECT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniObject.inl	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,264 @@
+/*
+* 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: 
+*       CUniObject, Storage for single attachment in presentation. 
+*
+*
+*/
+
+
+// ---------------------------------------------------------
+// CUniObject::AttachmentId
+//
+// Accessor.
+// ---------------------------------------------------------
+//
+inline TMsvAttachmentId CUniObject::AttachmentId() const
+    {
+    return iAttachmentId;
+    }
+
+// ---------------------------------------------------------
+// CUniObject::MimeInfo
+//
+// Accessor.
+// ---------------------------------------------------------
+//
+inline CUniMimeInfo* CUniObject::MimeInfo() const
+    {
+    return iMimeInfo;
+    }
+
+// ---------------------------------------------------------
+// CUniObject::MimeInfo
+//
+// Accessor.
+// ---------------------------------------------------------
+//
+inline CUniDrmInfo* CUniObject::DrmInfo() const
+    {
+    return iDrmInfo;
+    }
+
+// ---------------------------------------------------------
+// CUniObject::MediaInfo
+//
+// Accessor.
+// ---------------------------------------------------------
+//
+inline CMsgMediaInfo* CUniObject::MediaInfo() const
+    {
+    return iMediaInfo;
+    }
+
+// ---------------------------------------------------------
+// Corrupted
+//
+// Accessor
+// ---------------------------------------------------------
+inline TBool CUniObject::Corrupted() const
+    {
+    return iObjectFlags & EObjectCorrupted;
+    }
+
+// ---------------------------------------------------------
+// SetCorrupted
+//
+// Mutator
+// ---------------------------------------------------------
+inline void CUniObject::SetCorrupted( TBool aCorrupted )
+    {
+    if ( aCorrupted )
+        {
+        iObjectFlags |= EObjectCorrupted;
+        }
+    else
+        {
+        iObjectFlags &= ~EObjectCorrupted;
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniObject::StoreState
+//
+// Accessor.
+// ---------------------------------------------------------
+//
+//inline TMsgObjectStoreState CUniObject::StoreState() const
+//    {
+//    return iStoreState;
+//    }
+
+// ---------------------------------------------------------
+// CUniObject::SetReferenceCount
+//
+// Mutator.
+// ---------------------------------------------------------
+//
+inline void CUniObject::SetReferenceCount( TInt aCount )
+    {
+    iReferenceCount = aCount;
+    }
+
+// ---------------------------------------------------------
+// CUniObject::ReferenceCount
+//
+// Accessor.
+// ---------------------------------------------------------
+//
+inline TInt CUniObject::ReferenceCount() const
+    {
+    return iReferenceCount;
+    }
+
+// ---------------------------------------------------------
+// CUniObject::SetRegion
+//
+// Mutator.
+// ---------------------------------------------------------
+//
+inline void CUniObject::SetRegion( TUniRegion aRegion )
+    {
+    iRegion = aRegion;
+    }
+
+// ---------------------------------------------------------
+// CUniObject::Region
+//
+// Accessor.
+// ---------------------------------------------------------
+//
+inline TUniRegion CUniObject::Region() const
+    {
+    return iRegion;
+    }
+
+// ---------------------------------------------------------
+// CUniObject::SetMediaTypeBySmilTag
+//
+// Mutator.
+// ---------------------------------------------------------
+//
+inline void CUniObject::SetMediaTypeBySmilTag( TMsgMediaType aMediaType )
+    {
+    iMediaTypeBySmilTag = aMediaType;
+    }
+
+// ---------------------------------------------------------
+// CUniObject::MediaTypeBySmilTag
+//
+// Accessor.
+// ---------------------------------------------------------
+//
+inline TMsgMediaType CUniObject::MediaTypeBySmilTag() const
+    {
+    return iMediaTypeBySmilTag;
+    }
+
+// ---------------------------------------------------------
+// CUniObject::SetUniqueControlId
+//
+// Mutator.
+// ---------------------------------------------------------
+//
+inline void CUniObject::SetUniqueControlHandle( TInt aUniqueControlHandle )
+    {
+    iUniqueControlHandle = aUniqueControlHandle;
+    }
+
+// ---------------------------------------------------------
+// CUniObject::UniqueControlHandle
+//
+// Accessor.
+// ---------------------------------------------------------
+//
+inline TInt CUniObject::UniqueControlHandle() const
+    {
+    return iUniqueControlHandle;
+    }
+
+// ---------------------------------------------------------
+// CUniObject::SetAttachment
+//
+// Mutator.
+// ---------------------------------------------------------
+//
+inline void CUniObject::SetAttachment( TBool aObjectAttachment )
+    {
+    if ( aObjectAttachment )
+        {
+        iObjectFlags |= EObjectAttachment;
+        }
+    else
+        {
+        iObjectFlags &= ~EObjectAttachment;
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniObject::Attachment
+//
+// Accessor.
+// ---------------------------------------------------------
+//
+inline TBool CUniObject::Attachment() const
+    {
+    return iObjectFlags & EObjectAttachment;
+    }
+
+// ---------------------------------------------------------
+// CUniObject::Attachment
+//
+// Accessor.
+// ---------------------------------------------------------
+//
+inline TBool CUniObject::IsSaved( )
+    {
+    return iSavedToFs;
+    }
+
+// ---------------------------------------------------------
+// CUniObject::SetAttachment
+//
+// Mutator.
+// ---------------------------------------------------------
+//
+inline void CUniObject::SetSaved( TBool aSaved )
+    {
+    iSavedToFs = aSaved;
+    }
+
+
+// ---------------------------------------------------------
+// IsDrmRightsWhenLoaded
+//
+// Accessor.
+// ---------------------------------------------------------
+//
+inline TBool CUniObject::IsDrmRightsWhenLoaded( ) const
+    {
+    return iObjectFlags & EObjectDrmRightsWhenLoaded;    
+    }
+
+// ---------------------------------------------------------
+// IsDrmRightsWhenLoadedObjects
+//
+// Accessor.
+// ---------------------------------------------------------
+//
+inline TBool CUniObject::IsDrmRightsWhenLoadedObjects( ) const
+    {
+    return iObjectFlags & EObjectDrmRightsWhenLoadedObjects;    
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniObjectList.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,289 @@
+/*
+* 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: 
+*       CUniObjectList, List of attachments.
+*
+*
+*/
+
+
+#ifndef __UNIOBJECTLIST_H
+#define __UNIOBJECTLIST_H
+
+// INCLUDES
+
+#include <e32std.h>
+#include <f32file.h>
+#include <apmstd.h>
+
+#include <cmsvattachment.h>
+#include <UniObject.h>
+
+
+// CONSTANTS
+
+// MACROS
+
+// FORWARD DECLARATIONS
+class CUniDataUtils;
+class CMDXMLDocument;
+class CMDXMLNode;
+class CUniObjectList;
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// CLASS DECLARATION
+
+/**
+* MUniObjectListObserver - Callback API for object list operations.
+*
+* @since 3.1
+*/
+class MUniObjectListObserver
+    {
+    public:
+
+        /**
+        * Called when object is added to the list.
+        *
+        * @since 3.1
+        * @param aList IN List where object is added.
+        * @param aObject IN Added object.
+        * @param aIndex IN Index number of added object.
+        */
+        virtual void ObjectAddedL( CUniObjectList* aList,
+                                   CUniObject* aObject,
+                                   TInt aIndex ) = 0;
+
+        /**
+        * Called when object is removed from the list.
+        *
+        * @since 3.1
+        * @param aList IN List where object is added.
+        * @param aObject IN Removed object.
+        * @param aIndex IN Index number of removed object.
+        */
+        virtual void ObjectRemovedL( CUniObjectList* aList,
+                                     CUniObject* aObject,
+                                     TInt aIndex ) = 0;
+    };
+
+/**
+* CUniObjectList - List of attachments.
+*
+* @lib UniDataModel.lib
+* @since 3.1
+*/
+class CUniObjectList : public CBase,
+                       public MUniObjectSaveObserver
+    {
+
+    public:  // New methods
+
+        /**
+        * Factory method that creates this object.
+        *
+        * @since    3.1
+        * @param    aMtm    IN reference to client mtm
+        * @param    aData   IN reference to MsgData object
+        * @return   Pointer to instance
+        */
+        IMPORT_C static CUniObjectList* NewL( CBaseMtm& aMtm, CUniDataUtils& aData );
+
+        /**
+        * Destructor
+        *
+        * @since    3.1
+        */
+        virtual ~CUniObjectList();
+
+        /**
+        * AddObjectL
+        * Appends object to object array.
+        *
+        * @since    3.1
+        * @param    aObject     IN object to be added
+        */
+        IMPORT_C void AddObjectL( CUniObject* aObject );
+
+        /**
+        * SpaceNeededForSaveAll
+        * Calculates disk space needed to save all objects
+        * that are not yet saved into message store.
+        *
+        * @since    3.1
+        * @return   Disk space needed in bytes
+        */
+        IMPORT_C TInt SpaceNeededForSaveAll();
+
+        /**
+        * SaveAll
+        * Calls SaveL for each object in the object array
+        *
+        * @since    3.1
+        * @param    aObserver   IN operation observer
+        * @param    aSaveType   IN save type
+        */
+        IMPORT_C void SaveAll( MUniObjectSaveObserver& aObserver, CMsvAttachment::TMsvAttachmentType aSaveType );
+
+        /**
+        * RemoveAllObjectsL
+        * Removes all objects from message store and object
+        * array. Deletes all objects.
+        *
+        * @since    3.1
+        */
+        IMPORT_C void RemoveAllObjectsL();
+
+        /**
+        * RemoveObjectL
+        * Removes an object from object array and also from
+        * message store if requested.
+        * The caller must delete the object!!!
+        *
+        * @since    3.1
+        * @param    aObject IN object to be removed
+        * @param    aRemoveFromStore    IN if EFalse remove only from object array,
+        *                               if ETrue remove also from message store
+        */
+        IMPORT_C void RemoveObjectL( CUniObject* aObject, TBool aRemoveFromStore = ETrue );
+
+        /**
+        * GetByIndex
+        * Get object by index
+        *
+        * @since    3.1
+        * @param    aIndex  IN index
+        * @return   Pointer to object
+        */
+        IMPORT_C CUniObject* GetByIndex( TInt aIndex );
+
+        /**
+        * GetByAttachmentId
+        * Get object by attachment id
+        *
+        * @since    3.1
+        * @param    aAttachmentId   IN attachment id
+        * @return   Pointer to object
+        */
+        IMPORT_C CUniObject* GetByAttachmentId( TMsvAttachmentId aAttachmentId );
+
+        /**
+        * GetByNode
+        * Get object by DOM node
+        *
+        * @since    3.1
+        * @param    aNode   IN DOM node
+        * @return   Pointer to object
+        */
+        IMPORT_C CUniObject* GetByNodeL( CMDXMLNode* aNode );
+
+        /**
+        * GetByUrl
+        * Get object by URL
+        *
+        * @since    3.1
+        * @param    aUrl    IN URL
+        * @return   Pointer to object
+        */
+        IMPORT_C CUniObject* GetByUrlL( const TDesC& aUrl );
+
+        /**
+        * ObjectByteSize
+        * Calculate size of all the objects in bytes
+        *
+        * @since    3.1
+        * @return   Size in bytes
+        */
+        IMPORT_C TInt ObjectByteSize() const;
+
+        /**
+        * EnsureAllObjectsHaveContentLocationL
+        * Makes sure that all objects have ContentLocation
+        * MIME header defined. All objects must have ContentLocation
+        * when SMIL is composed.
+        *
+        * @since    3.1
+        */
+        IMPORT_C void EnsureAllObjectsHaveContentLocationL();
+        
+        /**
+        * SetListObserver
+        * Sets observer to the list that changes to list are notified.
+        *
+        * @since    3.1
+        * @param aObserver IN New object list observer. Setting observer
+        *                     to NULL resets observer.
+        */
+        IMPORT_C void SetListObserver( MUniObjectListObserver* aObserver );
+        
+        /**
+        * Returns object based on unique handle.
+        *
+        * @param  aUniqueControlHandle Control handle that uniquely identified the control
+        * @return Pointer to matched uniobject or NULL if not found.
+        */
+        IMPORT_C CUniObject* GetObjectByUniqueHandle( TInt aUniqueControlHandle );
+        
+        /**
+        * Count
+        *
+        * @since    3.1
+        * @return   Number of objects
+        */
+        inline TInt Count() const;
+
+    public:
+
+        /**
+        * From MUniObjectSaveObserver
+        */
+        void ObjectSaveReady( TInt aError );
+
+    protected:
+
+        /**
+        * Constructor.
+        *
+        * @since    3.1
+        * @param    aMtm    IN reference to client mtm
+        * @param    aData   IN reference to MsgData object
+        */
+        CUniObjectList( CBaseMtm& aMtm, CUniDataUtils& aData );
+
+        /**
+        * 2nd phase constructor.
+        *
+        * @since    3.1
+        */
+        void ConstructL();
+
+    protected: // data
+
+        CArrayPtrFlat<CUniObject>* iObjectArray;
+        CUniDataUtils& iData;
+        CBaseMtm& iMtm;
+
+        MUniObjectSaveObserver* iSaveObserver;
+        CMsvAttachment::TMsvAttachmentType iSaveType;
+        TInt iSaveCount;
+
+        MUniObjectListObserver* iListObserver;
+    };
+
+#include <UniObjectList.inl>
+
+#endif // __UNIOBJECTLIST_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniObjectList.inl	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,30 @@
+/*
+* 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: 
+*       CUniObjectList, List of attachments. 
+*
+*
+*/
+
+
+// ---------------------------------------------------------
+// CUniObjectList::Count
+//
+// Accessor.
+// ---------------------------------------------------------
+//
+inline TInt CUniObjectList::Count() const
+    {
+    return iObjectArray->Count();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniSmil.hrh	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,38 @@
+/*
+* 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: 
+*     Constants for smilApi that may need to be used in resource files
+*
+*
+*/
+
+
+#ifndef __UNISMIL_HRH
+#define __UNISMIL_HRH
+
+// For COMPOSE_PARAMS r_root_layout_compose
+enum 
+    {
+    ESmilNoRootLayout = 0,
+    ESmilDisplayRootLayout
+    };
+
+// For COMPOSE_PARAMS r_compose_xmlns
+enum 
+    {
+    ESmilNoXmlns = 0,
+    ESmilYesXmlns
+    };
+
+#endif // __UNISMIL_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniSmil.rh	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,76 @@
+/*
+* 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: 
+*     This file contains declarations for resources of smilapi.
+*     The file can be included in C++ or resource file.
+*     
+*
+*/
+
+
+#ifndef __UNISMIL_RH
+#define __UNISMIL_RH
+
+#include "UniSmil.hrh"
+
+//----------------------------------------------------  
+//    COMPOSE_PARAMS
+//    Parameters to define how to do composing
+//
+//----------------------------------------------------
+//
+STRUCT COMPOSE_PARAMS
+{
+    WORD    r_root_layout_compose   = ESmilNoRootLayout;
+    WORD    r_display_width         = 0;
+    WORD    r_display_height        = 0;
+    WORD    r_compose_xmlns         = 0;
+    WORD    r_top_padding           = 0;
+    WORD    r_region_padding        = 0;
+    WORD    r_bottom_padding        = 0;
+}
+
+//----------------------------------------------------  
+//    REGION
+//    Values for composing
+//
+//----------------------------------------------------
+//
+STRUCT REGION
+   {
+   LTEXT        r_id            =   "";
+   LTEXT        r_fit           =   "";
+   WORD         r_max_height    =   0;
+   WORD         r_min_height    =   0;
+   WORD         r_max_width     =   0;
+   WORD         r_min_width     =   0;
+   WORD         r_top           =   0;
+   WORD         r_left          =   0;
+   }
+
+//----------------------------------------------------
+//    SLIDE
+//    Values for composing
+//
+//----------------------------------------------------
+//
+STRUCT SLIDE    
+   {
+   WORD r_default_duration_milliseconds =   0; 
+   WORD r_default_when_audio_milliseconds   =   0; 
+   }
+
+#endif // __UNISMIL_RH
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniSmilList.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,202 @@
+/*
+* 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: 
+*       CUniSmilList, List of Smil attachments.
+*
+*
+*/
+
+
+#ifndef __UNISMILLIST_H
+#define __UNISMILLIST_H
+
+// INCLUDES
+
+#include <e32std.h>
+#include <f32file.h>
+#include <apmstd.h>
+#include <cmsvattachment.h>
+
+#include <gmxmlcomposer.h>
+
+#include <UniModelConst.h>
+
+// CONSTANTS
+
+// MACROS
+
+// FORWARD DECLARATIONS
+class CUniDataUtils;
+class CBaseMtm;
+class CMDXMLDocument;
+class CMDXMLNode;
+class CMsvStore;
+class MMsvAttachmentManager;
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// CLASS DECLARATION
+
+/**
+* MUniSmilComposeObserver - Callback API for SMIL composing.
+*
+* @since 3.1
+*/
+class MUniSmilComposeObserver
+    {
+    public:
+        virtual void SmilComposeEvent( TInt aError ) = 0;
+    };
+
+/**
+* CUniSmilList - List of SMIL attachments of a message.
+*
+* @lib UniDataModel.lib
+* @since 3.1
+*/
+class CUniSmilList : public CActive,
+                     public MMDXMLComposerObserver
+    {
+
+    public:  // New methods
+
+        /**
+        * Factory method that creates this object.
+        *
+        * @param    aMtm    IN reference to client mtm
+        * @return   Pointer to instance
+        */
+        IMPORT_C static CUniSmilList* NewL( CBaseMtm& aMtm );
+
+        /**
+        * Destructor
+        *
+        */
+        virtual ~CUniSmilList();
+
+        /**
+        * AddSmilAttachmentL
+        * Adds SMIL attachment to smil array
+        *
+        * @since    3.1
+        * @param    aAttachmentId   IN id of the SMIL attachment
+        *                           to be added
+        */
+        IMPORT_C void AddSmilAttachmentL(
+            MMsvAttachmentManager& aManager,
+            TMsvAttachmentId aAttachmentId );
+
+        /**
+        * CreateSmilAttachmentL
+        * Creates SMIL attachment from DOM
+        *
+        * @param    aAttachmentId   OUT id of the created SMIL attachment
+        * @param    aDom    IN the DOM from which to create the SMIL
+        * @param    aFs     IN reference to file session
+        */
+        IMPORT_C void CreateSmilAttachmentL(
+            MUniSmilComposeObserver& aObserver,
+            CMsvStore& aEditStore,
+            CMDXMLDocument* aDom );
+
+        /**
+        * GetSmilAttachmentByIndex
+        * Get SMIL attachment by index
+        *
+        * @param    aIndex  IN index
+        * @return   Message id of the SMIL attachment
+        */
+        IMPORT_C TMsvAttachmentId GetSmilAttachmentByIndex( TInt aIndex );
+
+        /**
+        * GetSmilFullPathByIndexL
+        * Get file handle of SMIL attachment by index
+        *
+        * @param    aIndex  IN index
+        */
+        IMPORT_C RFile GetSmilFileByIndexL( TInt aIndex );
+
+        /**
+        * SmilByteSize
+        * Calculate size of all the SMIL attachments in bytes
+        *
+        * @param    aFs     IN reference to file session
+        * @return   Size in bytes
+        */
+        inline TInt SmilByteSize() const;
+
+        /**
+        * Count
+        *
+        * @return   Number of objects
+        */
+        inline TInt Count() const;
+
+        void ComposeFileCompleteL();
+
+    protected:
+
+        /**
+        * From CActive
+        */
+        void DoCancel();
+
+        /**
+        * From CActive
+        */
+        void RunL();
+
+        /**
+        * From CActive
+        */
+        TInt RunError( TInt aError );
+
+
+    protected:
+
+        /**
+        * Constructor.
+        *
+        * @param    aMtm    IN reference to client mtm
+        */
+        CUniSmilList( CBaseMtm& aMtm );
+
+        /**
+        * 2nd phase constructor.
+        */
+        void ConstructL();
+
+    protected: // data
+
+        CBaseMtm& iMtm;
+
+        CArrayFixFlat<TMsvAttachmentId>* iSmilAttachmentArray;
+        TInt iSmilSize;
+
+        MMsvAttachmentManager* iManager;
+        CMsvAttachment* iAttachment;
+        CMsvStore* iEditStore;
+        RFile* iEditFile;
+
+        CMDXMLDocument* iDom;
+        CMDXMLComposer* iComposer;
+        MUniSmilComposeObserver* iObserver;
+        CActiveSchedulerWait     iObjWait;
+    };
+
+#include <UniSmilList.inl>
+
+#endif // __UNISMILLIST_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniSmilList.inl	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,42 @@
+/*
+* 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: 
+*       CUniSmilList, List of attachments. 
+*
+*
+*/
+
+
+// ---------------------------------------------------------
+// CUniSmilList::SmilByteSize
+//
+// Accessor.
+// ---------------------------------------------------------
+//
+inline TInt CUniSmilList::SmilByteSize() const
+    {
+    return iSmilSize;
+    }
+
+// ---------------------------------------------------------
+// CUniSmilList::Count
+//
+// Accessor.
+// ---------------------------------------------------------
+//
+inline TInt CUniSmilList::Count() const
+    {
+    return iSmilAttachmentArray->Count();
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniSmilModel.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,728 @@
+/*
+* 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: 
+*       CUniSmilModel, Storage for Smil presentation data.
+*
+*
+*/
+
+
+#ifndef __UNISMILMODEL_H
+#define __UNISMILMODEL_H
+
+// INCLUDES
+#include <cmsvattachment.h>
+
+#include <UniModelConst.h>
+#include <UniObjectList.h>
+#include <UniSmilUtils.h>
+
+// CONSTANTS
+
+// MACROS
+
+// FORWARD DECLARATIONS
+
+class RResourceFile;
+
+class CBaseMtm;
+class CUniSmilSlide;
+class CSmilPresentation;
+class TDataType;
+class CMsvEntrySelection;
+class CUniDataUtils;
+class CUniObject;
+class CUniTextObject;
+class CEikRichTextEditor;
+
+class CMDXMLNode;
+class CMDXMLElement;
+class CUniSmilParams;
+
+// DATA TYPES
+
+typedef CArrayPtrFlat<CUniSmilSlide> CSmilSlideArray;
+
+// FUNCTION PROTOTYPES
+
+// CLASS DECLARATION
+
+/**
+* CUniSmilModel - Representation of SMIL presentation data.
+* Hides SMIL syntax from client.
+*
+* @lib UniDataModel.lib
+* @since 3.1
+*/
+class CUniSmilModel : public CBase
+    {
+    public:  // New methods
+
+        /**
+        * NewLC
+        * Factory method that creates this object.
+        *
+        * @since    3.1
+        * @param    aFs     IN reference to file session
+        * @param    aMtm    IN reference to client mtm
+        * @param    aData   IN reference to MsgData object
+        * @param    aObjectList IN reference to object list
+        * @return   Pointer to instance in cleanup stack
+        */
+        IMPORT_C static CUniSmilModel* NewLC(
+            RFs& aFs,
+            CBaseMtm& aMtm,
+            CUniDataUtils& aData,
+            CUniObjectList& aObjectList );
+
+        /**
+        * NewL
+        * Factory method that creates this object.
+        *
+        * @since    3.1
+        * @param    aFs     IN reference to file session
+        * @param    aMtm    IN reference to client mtm
+        * @param    aData   IN reference to MsgData object
+        * @param    aObjectList IN reference to object list
+        * @return   Pointer to instance
+        */
+        IMPORT_C static CUniSmilModel* NewL(
+            RFs& aFs,
+            CBaseMtm& aMtm,
+            CUniDataUtils& aData,
+            CUniObjectList& aObjectList );
+
+        /**
+        * Destructor
+        *
+        * @since    3.1
+        */
+        virtual ~CUniSmilModel();
+
+        /**
+        * ParseL
+        * Creates presentation from either from DOM (if set) or
+        * from object list (no SMIL used).
+        * Set various flags according to parse results.
+        *
+        * This function should only leave if model cannot be made
+        * because some basic Symbian OS error for example OOM.
+        * This never leaves if there is some kind of mitchmatch between
+        * presentation and actual message ie smil refers to object
+        * that does not exist. This kind of leaves are TRAPPED here
+        * and if they are not the leave should be considered as an
+        * implementation bug in this function.
+        *
+        * @since    3.1
+        * @return   Parse result flags
+        */
+        IMPORT_C TInt ParseL( CMDXMLDocument* aDom );
+
+        /**
+        * SetScreenSize
+        * Sets size of physical dislplay in pixels
+        *
+        * @since    3.1
+        * @param    aScreenSize     IN screen size in pixels
+        */
+        inline void SetScreenSize( const TSize& aScreenSize );
+
+        /*
+        * AddSlideL
+        * Adds slide to model. If aSlideNum is -1 or greater than
+        * current max -> appends. Otherwise adds to given pos.
+        * Zero means first.
+        *
+        * @since    3.1
+        * @param    aSlideNum   IN insert position
+        */
+        IMPORT_C void AddSlideL( TInt aSlideNum = -1 );
+
+        /**
+        * RemoveSlide
+        * Removes slide. Slide must be empty!
+        *
+        * @since    3.1
+        * @param    aSlideNum   IN position of slide to be removed
+        */
+        IMPORT_C void RemoveSlide( TInt aSlideNum );
+
+        /**
+        * MoveSlideL
+        * Moves slide.
+        *
+        * @since    3.1
+        * @param    aSlideToMove IN the original position of slide to be moved
+        * @param    aPlaceToMove IN place where slide is moved to
+        */
+        IMPORT_C void MoveSlideL( TInt aSlideToMove, TInt aPlaceToMove );
+
+        /**
+        * SortSlidesL
+        * Sorts slides accoring to a separate comparison function
+        * called SortSlidesCompare().
+        * Insertion sort algorithm.
+        *
+        * Notice! Intended to be used with SendAs when there
+        * are multiple slides - each slide containing only
+        * one object. (Sorts slides accoring to first object in
+        * the slide.)
+        *
+        * @since    3.1
+        */
+        IMPORT_C void SortSlidesL();
+
+        /*
+        * IsSlide
+        * Check if model contains given slide
+        *
+        * @since    3.1
+        * @param    aSlideNum   IN slide to check
+        * @return   ETrue, if slide exists,
+        *           EFalse, otherwise
+        */
+        IMPORT_C TBool IsSlide( TInt aSlideNum ) const;
+
+        /**
+        * Adds text buffer to model.
+        *
+        * @since    3.1
+        * @param    aSlideNum   IN slide number where text is added
+        * @param    aText   IN text buffer to be added
+        * @return   Pointer to the added text object
+        *           Ownership NOT transferred.
+        */
+        IMPORT_C CUniTextObject* AddTextObjectL(
+            TInt aSlideNum, 
+            CEikRichTextEditor* aText );
+
+        /**
+        * AddObjectL
+        * Adds an object into msg store and smil slide
+        *
+        * @since    3.1
+        * @param    aSlideNum   IN slide number where text is added
+        * @param    aPathToObject   IN file to be added
+        * @return   Pointer to the added object
+        *           Ownership NOT transferred.
+        */
+        IMPORT_C CUniObject* AddObjectL(
+            MUniObjectSaveObserver& aObserver,
+            TInt aSlideNum,
+            CMsgMediaInfo* aMedia );
+
+        /**
+        * AddStoredObjectL
+        * Adds an object that is already in msg store to smil slide
+        *
+        * @since    3.1
+        * @param    aSlideNum   IN slide number where text is added
+        * @param    aAttachmentId   IN file to be added
+        * @param    aMedia      IN media info - ownership transferred to MsgObject
+        * @return   Pointer to the added object
+        *           Ownership NOT transferred.
+        */
+        IMPORT_C CUniObject* AddStoredObjectL(
+            TInt aSlideNum,
+            TMsvAttachmentId aAttachmentId,
+            CMsgMediaInfo* aMedia );
+
+        /**
+        * RemoveObjectL
+        * Deletes an object of certain type from a slide and msg store
+        * if needed (last reference to the object removed).
+        *
+        * @since    3.1
+        * @param    aSlideNum   IN slide number where text is added
+        * @param    aObject     IN the object to be removed
+        * @param    aLeaveToStore IN Do not remove attachment from store
+        *                            USE ONLY AS SECOND ATTEMPT IF REMOVING NORMALLY FAILS
+        */
+        IMPORT_C void RemoveObjectL(
+            TInt aSlideNum,
+            CUniObject* aObject,
+            TBool aLeaveToStore = EFalse);
+
+        /**
+        * RemoveObjectByIndexL
+        * Deletes the N'th object of from a slide and msg store if
+        * needed (last reference to the object removed).
+        *
+        * @since    3.1
+        * @param    aSlideNum   IN slide number
+        * @param    aObjectNum  IN number of the object to be removed
+        */
+        IMPORT_C void RemoveObjectByIndexL(
+            TInt aSlideNum,
+            TInt aObjectNum );
+
+        /**
+        * GetObjectByIndex
+        * Gets object by it's layout position in slide.
+        * E.g. object number "0" is the first in layout.
+        *
+        * @since    3.1
+        * @param    aSlideNum   IN slide number
+        * @param    aObjectNum  IN number of the object
+        * @return   Pointer to the object,
+        *           NULL if not found
+        */
+        IMPORT_C CUniObject* GetObjectByIndex(
+            TInt aSlideNum,
+            TInt aObjectNum ) const;
+
+        /**
+        * GetObject
+        * Gets object of certain type from a slide
+        *
+        * @since    3.1
+        * @param    aSlideNum   IN slide number
+        * @param    aObjectType IN type of the object
+        * @return   Pointer to the object,
+        *           NULL if not found
+        */
+        IMPORT_C CUniObject* GetObject(
+            TInt aSlideNum,
+            TUniRegion aRegion ) const;
+
+        /**
+        * IsObject
+        * Checks if given slide has object of certain type.
+        *
+        * @since    3.1
+        * @param    aSlideNum   IN slide number
+        * @param    aObjectType IN type of the object
+        * @param    aNum    IN the ordinal number of the object
+        * @return   ETrue, slide has object of asked type,
+        *           EFalse, otherwise.
+        */
+        //TBool IsObject(
+        //    TInt aSlideNum,
+        //    TMsgMediaType aObjType ) const;
+
+        /**
+        * SlideCount
+        * Count of slides in SMIL presentation.
+        *
+        * @since    3.1
+        * @return   Number of slides
+        */
+        inline TInt SlideCount() const;
+
+        /**
+        * ObjectCount
+        * Count of media objects in SMIL presentation.
+        * NOTE: Smil attachment is _not_ counted as object.
+        *
+        * @since    3.1
+        * @return   Number of objects
+        */
+        IMPORT_C TInt ObjectCount() const;
+
+        /**
+        * SlideObjectCount
+        * Count of media objects in given slide
+        *
+        * @since    3.1
+        * @param    aSlideNum   IN slide number
+        * @return   Number of objects on the slide
+        */
+        IMPORT_C TInt SlideObjectCount( TInt aSlideNum ) const;
+
+        /**
+        * Layout
+        * Accessor. Queries current layout. Layout is same for all slides.
+        *
+        * @since    3.1
+        * @return   Layout
+        */
+        inline TUniLayout Layout() const;
+
+        /**
+        * SetLayoutL
+        * Mutator. All slides have same layout.
+        * NOTE: This should only be called from editor objectsview
+        * ChangeOrder command. Layout is automatically determined
+        * at parse time.
+        *
+        * @since    3.1
+        * @param    aLayout IN new layout to be set
+        */
+        IMPORT_C void SetLayoutL( TUniLayout aNewLayout ); 
+
+        /**
+        * Returns the (estimate) total size of SMIL.
+        *
+        * @since    3.1
+        * @return   Total size in bytes
+        */
+        IMPORT_C TInt SmilComposeSize();
+
+        /**
+        * SmilComposeSize
+        * Returns the (estimate) size of SMIL from beginning to the
+        * object given as parameter.
+        *
+        * @since    3.1
+        * @param    aToSlideNum     IN calculate till this slide
+        *                              (From "1" to "SlideCount")
+        * @param    aToObjectNum    IN calculate till this object
+        *                              (From "1" to "SlideObjectCount")
+        * @return   Size in bytes
+        */
+        IMPORT_C TInt SmilComposeSize(
+            TInt aToSlideNum,
+            TInt aToObjectNum );
+
+        /**
+        * RemoveEmptySlides
+        * Removes empty all slides from the presentation
+        *
+        * @since    3.1
+        */
+        IMPORT_C void RemoveEmptySlides();
+
+        /**
+        * ComposeL
+        * Composes new SMIL from current model content. SMIL is created as
+        * an attachment to message.
+        * Old SMIL should be deleted before calling this.
+        *
+        * @since    3.1
+        * return    Pointer to new DOM
+        */
+        IMPORT_C CMDXMLDocument* ComposeL();
+
+        /**
+        * ChangeLayoutL
+        * Changes layout of SMIL to match Series 60 created SMIL
+        *
+        * @since 3.1
+        * @param aDom   SMIL DOM to be changed
+        * @return ETrue if layout could be changed
+        *         EFalse if layout couldn't be changed (e.g. missing head or root-region)
+        */
+        IMPORT_C TBool ChangeLayoutL( CMDXMLDocument* aDom );
+        
+        /**
+        * CorrectTimingL
+        * Correct timing of media objects on SMIL if it is invalid.
+        *
+        * @since  3.1
+        * @param  aDom   SMIL DOM
+        * @return ETrue if timing is valid.
+        *         EFalse if timing couldn't be corrected (e.g. missing body)
+        */
+        IMPORT_C TBool CorrectTimingL( CMDXMLDocument* aDom );
+        
+        /**
+        * Determines if given media type can be added to the SMIL model.
+        *
+        * @since 3.1
+        * @param aMediaType Tested media type
+        * @return ETrue if media type can be added to the SMIL model.
+        *         EFalse if media type cannot be added
+        */
+        IMPORT_C TBool IsSupportedMediaType( TMsgMediaType aMediaType ) const;
+        
+        /**
+        * Maximum number of slide in MMS message.
+        *
+        * @return 0 or less if not specified. Otherwise maximum slide limit.
+        */
+        inline TInt MaxSlideCount() const;
+
+        /**
+        * Sets maximum slide limit.
+        *
+        * @param aSlideCount Maximum slide count.
+        */
+        inline void SetMaxSlideCount( TInt aSlideCount );
+
+        /**
+        * Returns whether maximum slide count has been reached.
+        *
+        * @return ETrue if maximum slide count is set and has been reached.
+        *         EFalse otherwise.
+        */
+        inline TBool MaxSlideCountReached() const;
+
+    private:
+
+        /**
+        * Constructor.
+        *
+        * @since    3.1
+        * @param    aFs     IN reference to file session
+        * @param    aMtm    IN reference to client mtm
+        * @param    aData   IN reference to MsgData object
+        * @param    aObjectList IN reference to object list
+        */
+        CUniSmilModel(
+            RFs& aFs,
+            CBaseMtm& aMtm,
+            CUniDataUtils& aData,
+            CUniObjectList& aObjectList );
+
+        /**
+        * 2nd phase constructor.
+        *
+        * @since    3.1
+        */
+        void ConstructL();
+
+        /**
+        * DoPresentationFromDomL
+        * Makes a presentation (model content) from DOM.
+        *
+        * @since    3.1
+        * @return   ETrue, if created successfully,
+        *           EFalse, otherwise
+        */
+        void DoPresentationFromDomL( CMDXMLDocument* aDom );
+
+        /**
+        * IsMessageSlide
+        * Check if messages attachments fit into slide (no smil case)
+        *
+        * @since    3.1
+        * @return   ETrue, if all objects fit into slide,
+        *           EFalse, otherwise
+        */
+        TBool IsMessageSlide();
+
+        /**
+        * DoNoSmilOneSlide
+        * Makes presentation (max one slide) from object list. Message
+        * may contain SMIL, but when calling this function it should be
+        * clear that model cannot be made as SMIL describes.
+        *
+        * @since    3.1
+        */
+        void DoNoSmilOneSlideL();
+
+        /**
+        * DoNoSmilManySlide
+        * Makes presentation from object list. Message may contain SMIL,
+        * but when calling this function it should be clear that model cannot
+        * be made as SMIL describes.
+        *
+        * @since    3.1
+        */
+        void DoNoSmilManySlideL();
+
+        /**
+        * AddSlideFromDomL
+        * Used when creating presentation from SMIL
+        *
+        * @since    3.1
+        * @param    aSlideNum   IN slide number
+        * @param    aObj    IN object to be added
+        * @return   ETrue, object added successfully,
+        *           EFalse, otherwise
+        */
+        void AddSlideFromDomL( CMDXMLNode* aPage );
+
+        /**
+        * AddObjectFromDomL
+        * Used when creating presentation from SMIL
+        *
+        * @since    3.1
+        * @param    aSlideNum   IN slide number
+        * @param    aObj    IN object to be added
+        */
+        void AddObjectFromDomL(
+            CUniSmilSlide* aSlide,
+            CUniObject* aObj,
+            TUniRegion aRegion );
+
+        /**
+        * Reset
+        * Clears flag & empties slide & object arrays.
+        * NOTE: Mtm pointer is not reseted.
+        *
+        * @since    3.1
+        */
+        void Reset();
+
+        /**
+        * CreateItemL
+        * Sub function for ComposeL
+        *
+        * @since    3.1
+        * @param    aRoot   IN parent element for the new element(s)
+        * @param    aObj    IN object to be added
+        */
+        TInt CreateItemL( CMDXMLDocument* aDom, CMDXMLElement* aRoot, CUniObject* aObj );
+
+        /**
+        * CreateParL
+        * Sub function for ComposeL
+        *
+        * @since    3.1
+        * @param    aRoot   IN parent element for the new element(s)
+        * @param    aSlide  IN slide number
+        */
+        void CreateParL( CMDXMLDocument* aDom, CMDXMLElement* aRoot, TInt aSlide );
+
+        /**
+        * CreateBodyL
+        * Sub function for ComposeL
+        *
+        * @since    3.1
+        * @param    aRoot   IN parent element for the new element(s)
+        */
+        void CreateBodyL( CMDXMLDocument* aDom, CMDXMLElement* aRoot );
+
+        /**
+        * CreateLayoutL
+        * Sub function for ComposeL
+        *
+        * @since    3.1
+        * @param    aRoot        IN parent element for the new element(s)
+        * @param    aRootLayout  IN root-layout element
+        * @param    aLayout      IN layout element
+        * @param    aTextRegion  IN text region element
+        * @param    aImageRegion IN image region element
+        */
+        void CreateLayoutL(
+            CMDXMLDocument* aDom,
+            CMDXMLElement* aRoot,
+            CMDXMLElement* aRootLayout = NULL,
+            CMDXMLElement* aLayout = NULL,
+            CMDXMLElement* aTextRegion = NULL,
+            CMDXMLElement* aImageRegion = NULL );
+
+        /**
+        * CreateHeadL
+        * Sub function for ComposeL
+        *
+        * @since    3.1
+        * @param    aRoot   IN parent element for the new element(s)
+        */
+        void CreateHeadL( CMDXMLDocument* aDom, CMDXMLElement* aRoot );
+
+        /**
+        * DoRemoveObjectL
+        * Deletes object from slide and msg store if needed.
+        *
+        * @since    3.1
+        * @param    aSlideNum   IN slide number where text is added
+        * @param    aObjectType IN type of the object to be removed
+        */
+        void DoRemoveObjectL( TInt aSlideNum,
+                              CUniObject* aObject,
+                              TBool aLeaveToStore = EFalse );
+
+        /**
+        * Adds slide. Appends if slidenum greater than current max,
+        * otherwise inserts.
+        *
+        * @since    3.1
+        * @param    aSlideNum   IN insert position
+        */
+        CUniSmilSlide* DoAddSlideL( TInt aSlideNum = -1 );
+
+        /**
+        * SortSlidesCompare
+        * Compares slides according to time. Most recent is greatest.
+        * Empty slides are greater than non-empty slides.
+        *
+        * @since    3.1
+        * @param    aSlide1     IN slide to compare
+        * @param    aSlide2     IN slide to compare
+        * @return If aSlide1 "is greater than" aSlide2 returns positive value.
+        *         If aSlide1 "is smaller than" aSlide2 returns negative value.
+        *         If aSlide1 and aSlide2 "are equal" returns zero.
+        */
+        TInt SortSlidesCompare( CUniSmilSlide* aSlide1, CUniSmilSlide* aSlide2 );
+
+        /**
+        * Gets the layout of MMS SMIL document.
+        * Assumes that the document is valid MMS SMIL.
+
+        * @since 3.1
+        * @param    aDom    Root node of the document tree.
+        * @return           Layout of the document.
+        */
+        TUniLayout GetMmsSmilLayout( CMDXMLDocument* aDom );
+
+        /**
+        * Gets the first element of given name from the SMIL document.
+        *
+        * @since 3.1
+        * @param    aDom    Root node of the document tree.
+        * @param    aName   The name of the node to be searched.
+        * @return           Pointer to the element node.
+        *                   If element not found returns NULL.
+        */
+        CMDXMLNode* GetNode( CMDXMLDocument* aDom, const TDesC& aName );
+
+        void GetMediaElemRegionIDs( CMDXMLNode* aPage );
+
+        void GetAllMediaElemRegionIDs( CMDXMLNode* aPage );
+
+        void GetLayoutElements(
+            CMDXMLNode* aLayout,
+            CMDXMLElement*& aRlEle,
+            CMDXMLElement*& aTxtEle,
+            CMDXMLElement*& aImgEle );
+
+        void GetRootLayoutSize( CMDXMLElement* aRl, TSize& aSize );
+
+        void GetRegionRect( CMDXMLElement* aRegion, TSize aRoot, TRect& aRect );
+
+        TUniRegion GetRegionType( CMDXMLNode* aNodePtr );
+
+        void RemoveMetaTagsAndComments( CMDXMLDocument* aDom );
+
+        /**
+        * CorrectSlideTimingL
+        *
+        * @since    3.1
+        */
+        void CorrectSlideTimingL( CMDXMLElement* aPage );
+
+        /**
+        * TimingSpecified
+        *
+        * @since    3.1
+        */
+        TBool TimingSpecified( CMDXMLElement* aNodePrt );
+
+    private: // data
+
+        RFs&                iFs;
+        CBaseMtm&      iMtm;
+        CUniDataUtils&           iData;
+        CUniObjectList&     iObjectList;
+
+        TUniLayout iSlideLayout; // Defines order of objects in display for slides.
+
+        CSmilSlideArray*    iSlideArray;    // Holds slides
+        TInt                iParseResult;
+        CUniSmilParams*     iSmilParams;
+        TSize               iScreenSize;
+        TBool               iSizeEstimateUpToDate;
+        TInt                iSizeEstimate;
+
+        TPtrC               iTextRegionId;
+        TPtrC               iImageRegionId;
+        TInt                iMaxSlideCount;
+    };
+
+
+#include <UniSmilModel.inl>
+
+#endif // __UNISMILMODEL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniSmilModel.inl	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,87 @@
+/*
+* 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: 
+*       CUniSmilModel, Storage for Smil presentation data.
+*
+*
+*/
+
+#include "debugtraces.h"
+
+// ---------------------------------------------------------
+// CUniSmilModel::Layout
+//
+// Accessor
+// ---------------------------------------------------------
+//
+inline TUniLayout CUniSmilModel::Layout() const
+    {
+    return iSlideLayout;    
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::SlideCount
+// ---------------------------------------------------------
+//
+inline TInt CUniSmilModel::SlideCount() const
+    {
+#ifdef _DEBUG_TRACES_
+    qCritical() << " CUniSmilModel SlideCount start";
+#endif
+    return iSlideArray->Count();
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::SetScreenSize
+// ---------------------------------------------------------
+//
+inline void CUniSmilModel::SetScreenSize( const TSize& aScreenSize )
+    {
+    iScreenSize = aScreenSize;
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::MaxSlideCount
+// ---------------------------------------------------------
+//
+inline TInt CUniSmilModel::MaxSlideCount() const
+    {
+    return iMaxSlideCount;
+    }
+        
+// ---------------------------------------------------------
+// CUniSmilModel::SetMaxSlideCount
+// ---------------------------------------------------------
+//
+inline void CUniSmilModel::SetMaxSlideCount( TInt aSlideCount )
+    {
+    iMaxSlideCount = aSlideCount;
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::MaxSlideCountReached
+// ---------------------------------------------------------
+//
+inline TBool CUniSmilModel::MaxSlideCountReached() const
+    {
+    if ( iMaxSlideCount > 0 &&
+         iSlideArray->Count() >= iMaxSlideCount )
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniSmilParams.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,245 @@
+/*
+* 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: 
+*  Reads default parameters from resource file for composing MMS SMIL
+*
+*
+*/
+
+
+#ifndef __UNISMILPARAMS_H
+#define __UNISMILPARAMS_H
+
+//  INCLUDES
+#include <e32base.h>
+#include <barsc.h>
+#include <f32file.h>
+
+// FORWARD DECLARATIONS
+
+// CLASS DECLARATION
+
+/**
+*  TUniSmilComposeParam
+*  Class to hold general SMIL composing parameters
+*
+*  @lib     UniDataModel.lib
+*  @since   3.1
+*/
+class TUniSmilComposeParam
+    {
+public:
+    /**
+     *  Default constructor
+     */
+    inline TUniSmilComposeParam();
+
+    /**
+     *  Copy constructor
+     *  @param   aValues     Source region parameter object.
+     */
+    inline TUniSmilComposeParam(const TUniSmilComposeParam& aValues);
+
+public: // data
+    TInt iRootLayoutCompose;    // See r_root_layout_compose
+                                // explanation in rss file.
+
+    TInt iDisplayWidth;         // From resources
+    TInt iDisplayHeight;        // From resources
+
+    TBool iComposeXmlns;        // From resources
+    TInt iSlideDuration;        // From resources
+    TInt iTopPadding;           // From resources
+    TInt iRegionPadding;        // From resources
+    TInt iBottomPadding;        // From resources
+    };
+
+
+/**
+*  TUniSmilRegionParam
+*  Class to hold SMIL region attribute values.
+*  Only supports attributes mentioned in SMIL confomance document.
+*
+*  @lib     UniDataModel.lib
+*  @since   3.1
+*/
+
+class TUniSmilRegionParam
+    {
+public:
+    /**
+     *  Default constructor
+     */
+    inline TUniSmilRegionParam();
+
+    /**
+     *  Copy constructor
+     *  @param   aValues     Source region parameter object.
+     */
+    inline TUniSmilRegionParam(const TUniSmilRegionParam& aValues);
+
+    /**
+    *  destructor.
+    */
+    inline ~TUniSmilRegionParam();
+
+    /**
+    *  Get region width.
+    *  @return  Width of the region.
+    */
+    inline TInt Width();
+
+    /**
+    *  Get region height.
+    *  @return  Height of the region.
+    */
+    inline TInt Height();
+
+    /**
+    *  Get region top.
+    *  @return  Top co-ordinate of the region.
+    */
+    inline TInt Top();
+
+    /**
+    *  Get region left.
+    *  @return  Left co-ordinate of the region.
+    */
+    inline TInt Left();
+
+    /**
+    *  Set region size.
+    *  @param   aSize
+    */
+    inline void SetSize(const TSize& aSize);
+
+    /**
+    *  Set top left corner co-ordinates of the region.
+    *  @param   aTl     Top-Left corner co-ordinates of region.
+    */
+    inline void SetTopLeft(const TPoint& aTl);
+
+public: // Percent values
+    TInt    iTopPercent;
+    TInt    iLeftPercent;
+    TInt    iWidthPercent;
+    TInt    iHeightPercent;
+    HBufC   *iId;
+    HBufC   *iFit;
+    // Pixel values
+    TSize   iMaxSize;
+    TSize   iMinSize;
+    TSize   iSize;
+    TPoint  iTopLeft;
+
+private:
+
+    };
+
+
+/**
+*  CUniSmilParams
+*  Reads MMS SMIL composing default parameters from resources.
+*
+*  @lib     UniDataModel.lib
+*  @since   3.1
+*/
+class CUniSmilParams : public CBase
+    {
+public:  // Constructors and destructor
+
+    /**
+    *  Two-phased constructor.
+    *  @param   aSession     File system session handle to be used.
+    */
+    IMPORT_C static CUniSmilParams* NewL( const RFs& aSession );
+        
+    /**
+    *  Two-phased constructor with cleanup stack.
+    *  @param   aSession     File system session handle to be used.
+    */
+    IMPORT_C static CUniSmilParams* NewLC( const RFs& aSession );
+        
+    /**
+    *  Destructor.
+    */
+    virtual ~CUniSmilParams();
+
+public: // New functions
+
+protected:  // Functions from base classes
+
+
+private:
+
+    /**
+    *  By default Symbian OS constructor is private.
+    */
+    void ConstructL();
+
+    /**
+    *  C++ default constructor is private.
+    *  @param   aSession     File system session handle to be used.
+    */
+    CUniSmilParams( const RFs& aSession );
+
+    /**
+    *  Reads the region string and integer constants
+    *  from the resource file.
+    */
+    void ReadResourcesL();
+
+    /**
+    *  Opens the resource file for reading
+    *  @param   aResFile     Resource file handle to be used.
+    */
+    void OpenResourceFileL( RResourceFile& aResFile );
+
+    /**
+    *  Reads general composing params from the reousrce file.
+    *  @param   aResFile     Resource file handle to be used.
+    */
+    void ReadComposeParamResourcesL(
+            const RResourceFile& aResFile );
+
+    /**
+    *  Reads image region defaults from the resource file.
+    */
+    void ReadImageRegionResourcesL(
+            const RResourceFile& resourceFile );
+
+    /**
+    *  Reads text region defaults from the resource file.
+    *  @param   aResFile     Resource file handle to be used.
+    */
+    void ReadTextRegionResourcesL(
+            const RResourceFile& resourceFile );
+
+
+private:    // Data
+    const RFs&              iSession;
+
+public:    // Data
+    // General compose parameters
+    TUniSmilComposeParam    *iComposeParams;
+    TUniSmilRegionParam     *iImageRegionParams;
+    TUniSmilRegionParam     *iTextRegionParams;
+
+    };
+
+#include <UniSmilParams.inl>
+
+#endif // __UNISMILPARAMS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniSmilParams.inl	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,151 @@
+/*
+* 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: 
+*  Reads default parameters for composing SMIL from resource file   
+*
+*
+*/
+
+
+// -----------------------------------------------------------------------------
+// TUniSmilComposeParam
+// -----------------------------------------------------------------------------
+
+// -----------------------------------------------------------------------------
+// TUniSmilComposeParam::TUniSmilComposeParam
+// -----------------------------------------------------------------------------
+inline TUniSmilComposeParam::TUniSmilComposeParam() :
+    iRootLayoutCompose( 0 ),
+    iDisplayWidth( 0 ),
+    iDisplayHeight( 0 ),
+    iComposeXmlns( EFalse ),
+    iSlideDuration( 0 ),
+    iTopPadding( 0 ),
+    iRegionPadding( 0 ),
+    iBottomPadding( 0 )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// TUniSmilComposeParam::TUniSmilComposeParam
+// -----------------------------------------------------------------------------
+inline TUniSmilComposeParam::TUniSmilComposeParam( const TUniSmilComposeParam& aCopy ) :
+    iRootLayoutCompose( aCopy.iRootLayoutCompose ),
+    iDisplayWidth( aCopy.iDisplayWidth ),
+    iDisplayHeight( aCopy.iDisplayHeight ),
+    iComposeXmlns( aCopy.iComposeXmlns ),
+    iSlideDuration( aCopy.iSlideDuration ),
+    iTopPadding( aCopy.iTopPadding ),
+    iRegionPadding( aCopy.iRegionPadding ),
+    iBottomPadding( aCopy.iBottomPadding )
+    {
+    }
+
+
+// -----------------------------------------------------------------------------
+// TUniSmilRegionParam
+// -----------------------------------------------------------------------------
+
+// -----------------------------------------------------------------------------
+// TUniSmilRegionParam::TUniSmilRegionParam
+// -----------------------------------------------------------------------------
+inline TUniSmilRegionParam::TUniSmilRegionParam() :
+    iTopPercent( 0 ),
+    iLeftPercent( 0 ),
+    iWidthPercent( 0 ),
+    iHeightPercent( 0 ),
+    iId( 0 ),
+    iFit( 0 ),
+    iMaxSize( 0, 0 ),
+    iMinSize( 0, 0 ),
+    iSize( 0, 0 ),
+    iTopLeft( 0, 0 )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// TUniSmilRegionParam::TUniSmilRegionParam
+// -----------------------------------------------------------------------------
+inline TUniSmilRegionParam::TUniSmilRegionParam(const TUniSmilRegionParam& aCopy) :
+    iTopPercent( aCopy.iTopPercent ),
+    iLeftPercent( aCopy.iLeftPercent ),
+    iWidthPercent( aCopy.iWidthPercent ),
+    iHeightPercent( aCopy.iHeightPercent ),
+    iMaxSize( aCopy.iMaxSize ),
+    iMinSize( aCopy.iMinSize ),
+    iSize( aCopy.iSize ),
+    iTopLeft( aCopy.iTopLeft )
+    {
+    iId = aCopy.iId->Alloc();
+    iFit = aCopy.iFit->Alloc();
+    }
+
+// -----------------------------------------------------------------------------
+// TUniSmilRegionParam::~TUniSmilRegionParam
+// -----------------------------------------------------------------------------
+inline TUniSmilRegionParam::~TUniSmilRegionParam()
+    {
+    delete iId;
+    delete iFit;
+    }
+
+// -----------------------------------------------------------------------------
+// TUniSmilRegionParam::Width
+// -----------------------------------------------------------------------------
+inline TInt TUniSmilRegionParam::Width()
+    {
+    return iSize.iWidth;
+    }
+
+// -----------------------------------------------------------------------------
+// TUniSmilRegionParam::Height
+// -----------------------------------------------------------------------------
+inline TInt TUniSmilRegionParam::Height()
+    {
+    return iSize.iHeight;
+    }
+
+// -----------------------------------------------------------------------------
+// TUniSmilRegionParam::Top
+// -----------------------------------------------------------------------------
+inline TInt TUniSmilRegionParam::Top()
+    {
+    return iTopLeft.iY;
+    }
+
+// -----------------------------------------------------------------------------
+// TUniSmilRegionParam::Left
+// -----------------------------------------------------------------------------
+inline TInt TUniSmilRegionParam::Left()
+    {
+    return iTopLeft.iX;
+    }
+
+// -----------------------------------------------------------------------------
+// TUniSmilRegionParam::SetSize
+// -----------------------------------------------------------------------------
+inline void TUniSmilRegionParam::SetSize(const TSize& aSize)
+    {
+    iSize = aSize;
+    }
+
+// -----------------------------------------------------------------------------
+// TUniSmilRegionParam::SetTopLeft
+// -----------------------------------------------------------------------------
+inline void TUniSmilRegionParam::SetTopLeft(const TPoint& aTl)
+    {
+    iTopLeft = aTl;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniSmilSlide.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,217 @@
+/*
+* 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: 
+*       CUniSmilSlide
+*
+*
+*/
+
+
+#ifndef __UNISMILSLIDE_H
+#define __UNISMILSLIDE_H
+
+
+//  INCLUDES
+
+#include <MsgMedia.hrh>
+
+#include <UniModelConst.h>
+
+// CONSTANTS
+
+// MACROS
+
+// FORWARD DECLARATIONS
+class CUniObject;
+
+// DATA TYPES
+typedef CArrayPtrFlat<CUniObject> CSmilObjectArray;
+
+// FUNCTION PROTOTYPES
+
+
+
+// CLASS DECLARATION
+
+// NOTE: Since slide cannot have same object type twice unique key to object within
+//       slide is it object type ( EImage, EText, EAudio )
+//       Object can also be referenced by it's position in slide ( 0,1,2 )
+
+/**
+* CUniSmilSlide - Representation of a single slide in a SMIL presentation.
+*
+* @lib UniDataModel.lib
+* @since 3.1
+*/
+class CUniSmilSlide :public CBase
+    {
+    public:  // Constructors and destructor
+
+    /**
+    * Factory method
+    *
+    * @since    3.1
+    * @return   Pointer to instance in cleanup stack
+    */
+    static CUniSmilSlide* NewLC( TUniLayout aLayout );
+
+    /**
+    * Factory method
+    *
+    * @since    3.1
+    * @return   Pointer to instance
+    */
+    static CUniSmilSlide* NewL( TUniLayout aLayout );
+
+    /**
+    * Destructor.
+    *
+    * @since    3.1
+    */
+    ~CUniSmilSlide();
+
+    public: // New functions
+
+    /*
+    * AddObjectL
+    * Add object to slide in position specified by Layout.
+    * NOTE: Takes ownership of the aObject.
+    * NOTE: Leaves with KErrArgument if object cannot be added to slide
+    *
+    * @since    3.1
+    * @param    aObject IN object to be added
+    */
+    void AddObjectL( CUniObject* aObject );
+
+    /*
+    * AddObjectL
+    * Add object to slide in position specified by Layout.
+    * NOTE: Takes ownership of the aObject.
+    * NOTE: Leaves with KErrArgument if object cannot be added to slide
+    *
+    * @since    3.1
+    * @param    aObject IN object to be added
+    * @param    aregion IN region where object is in SMIL.
+    */
+    void AddObjectL( CUniObject* aObject, TUniRegion aRegion );
+
+    /**
+    * RemoveObject
+    * Removes object from slide
+    * NOTE: Object is not deleted.
+    *
+    * @since    3.1
+    * @param    aObject IN object to be removed
+    */
+    void RemoveObject( CUniObject* aObject );
+
+    /**
+    * GetObject
+    * Get object of given type from slide.
+    *
+    * @since    3.1
+    * @param    aObjType    IN object type
+    * @return   Pointer to object,
+    *           NULL, if object not found
+    */
+    CUniObject* GetObject( TUniRegion aRegion ) const;
+
+    /**
+    * GetObjectByIndex
+    * Get object at given index from slide.
+    *
+    * @since    3.1
+    * @param    aObjNum IN index to slides object array,
+    *                   0 (zero) is first object.
+    * @return   Pointer to object,
+    *           NULL, if object not found
+    */
+    CUniObject* GetObjectByIndex( TInt aObjNum ) const;
+
+    /**
+    * IsObject
+    * Checks if slide contains given object.
+    *
+    * @since    3.1
+    * @param    aObject IN object to be checked
+    * @return   ETrue slide contains the object,
+    *           EFalse, otherwise
+    */
+    TBool IsObject( CUniObject* aObject ) const;
+
+    /**
+    * IsObject
+    * Checks if slide has an object of given type
+    *
+    * @since    3.1
+    * @param    aObjType    IN object type
+    * @return   ETrue slide contains the object,
+    *           EFalse, otherwise
+    */
+    TBool IsObject( TUniRegion aRegion ) const;
+
+    /**
+    * ObjectCount
+    * Accessor
+    *
+    * @since    3.1
+    * @return   Number of objects in this slide
+    */
+    TInt ObjectCount() const;
+
+    /**
+    * UpdateLayoutL
+    * Update the layout of the slide
+    *
+    * @since    3.1
+    * @param    aNewLayout  IN new layout
+    */
+    void UpdateLayoutL( TUniLayout aNewLayout );
+
+    private:
+
+    /*
+    * Constructor
+    *
+    * @since    3.1
+    */
+    CUniSmilSlide( TUniLayout aLayout );
+
+    /*
+    * 2nd phase constructor
+    *
+    * @since    3.1
+    */
+    void ConstructL();
+
+    /**
+    * UpdateLayoutL
+    * Update the layout of the slide
+    *
+    * @since    3.1
+    */
+    void UpdateLayoutL();
+
+    private:
+
+    CSmilObjectArray*   iObjectArray;
+    TUniLayout          iLayout;
+
+    };
+
+#endif // __UNISMILSLIDE_H
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniSmilUtils.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,243 @@
+/*
+* 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: 
+*       Static utility class for manipulating SMIL DOM
+*
+*
+*/
+
+
+#ifndef __UNISMILUTILS_H
+#define __UNISMILUTILS_H
+
+// ========== INCLUDE FILES ================================
+#include <gdi.h>
+
+#include <MsgMedia.hrh>
+
+#include <UniModelConst.h>
+
+// ========== CONSTANTS ====================================
+
+// SMIL ELEMENTS
+_LIT(KSMILWREleBody,        "body");
+_LIT(KSMILWREleHead,        "head");
+_LIT(KSMILWREleLayout,      "layout");
+_LIT(KSMILWRElePar,         "par");
+_LIT(KSMILWREleRegion,      "region");
+_LIT(KSMILWREleRoot_layout, "root-layout");
+_LIT(KSMILWREleSeq,         "seq");
+_LIT(KSMILWREleSmil,        "smil");
+_LIT(KSMILWREleMeta,        "meta");
+_LIT(KSMILWREleTrans,       "transition");
+
+// Media types
+_LIT(KSMILWREleAnimation,   "animation");
+_LIT(KSMILWREleAudio,       "audio");
+_LIT(KSMILWREleImg,         "img");
+_LIT(KSMILWREleRef,         "ref");
+_LIT(KSMILWREleText,        "text");
+_LIT(KSMILWREleTextstream,  "textstream");
+_LIT(KSMILWREleVideo,       "video");
+
+// SMIL PARAMS
+_LIT(KSMILWRParaId,         "id" );
+_LIT(KSMILWRParaName,       "name");
+_LIT(KSMILWRParaContent,    "content");
+_LIT(KSMILWRParaRegion,     "region");
+_LIT(KSMILWRParaBgColor,    "backgroundColor");
+_LIT(KSMILWRParaSrc,        "src");
+_LIT(KSMILWRParaFit,        "fit");
+_LIT(KSMILWRParaDur,        "dur");
+_LIT(KSMILWRParaType,       "type");      // Transition
+_LIT(KSMILWRParaSubType,    "subtype");   // Transition
+_LIT(KSMILWRParaTransIn,    "transIn" );
+_LIT(KSMILWRParaTransOut,   "transOut" );
+_LIT(KSMILWRParaBegin,      "begin" );
+_LIT(KSMILWRParaEnd,        "end" );
+
+// Text color mediaparam format:
+// <param name="foreground-color" value="#000000"/>
+_LIT ( KSMILWREleParam,     "param" );
+// _LIT ( KSMILWRParaName,      "name" );  Already defined
+_LIT ( KSMILWRParaValue,    "value" );
+
+// Region dimensions
+_LIT(KSMILWRParaWidth,      "width");
+_LIT(KSMILWRParaHeight,     "height");
+_LIT(KSMILWRParaTop,        "top");
+_LIT(KSMILWRParaLeft,       "left");
+_LIT(KSMILWRParaBottom,     "bottom");
+_LIT(KSMILWRParaRight,      "right");
+
+// Region ID's
+_LIT(KSMILWRRegIDImage,     "Image");
+_LIT(KSMILWRRegIDVideo,     "Video");
+_LIT(KSMILWRRegIDText,      "Text");
+
+// TEMPORARY - To recognise template
+_LIT(KSMILMetaSmilProfile,       "SMILProfile");
+_LIT(KSMILMetaSmilProfileValue,  "3GPP-SMIL-Rel-5");
+
+
+// ========== MACROS =======================================
+
+// ========== DATA TYPES ===================================
+
+// ========== FUNCTION PROTOTYPES ==========================
+
+// ========== FORWARD DECLARATIONS =========================
+class CMDXMLNode;
+class CMDXMLDocument;
+
+// ========== CLASS DECLARATION ============================
+
+/**
+* Static utility class for manipulating SMIL DOM
+*
+* @lib UniDataModel.lib
+* @since 3.1
+*/
+class UniSmilUtils
+    {
+
+    public:
+
+    /**
+    * StringToIntValue
+    * Convert a descriptor to TInt
+    *
+    * @since 3.1
+    * @param aString  IN: to be converted
+    * @param aDefault IN: default value to return if conversion fails
+    * @return converted value
+    */
+    IMPORT_C static TInt StringToIntValue( const TDesC& aString, TInt aDefault );
+
+    /**
+    * IsMediaElem
+    * Checks if node is mediaobject
+    *
+    * @since 3.1
+    * @param aNodePtr  IN: node to check
+    * @return ETrue node is media objects, EFalse otherwise
+    */
+    IMPORT_C static TBool IsMediaElem( CMDXMLNode *aNodePtr );
+
+    /**
+    * NextNode
+    * Finds the next node in DOM in order
+    * 1. Child nodes of the ref node first
+    * 2. Then siblings of the ref node
+    * 3. If ref node has no children or siblings moves up to
+    *     parent node and continues there
+    * 4. Returns NULL at the end of the document.
+    *
+    * @since 3.1
+    * @param aRefNode  IN: current node
+    * @return next node in presentation
+    */
+    IMPORT_C static CMDXMLNode* NextNode( CMDXMLNode* aRefNode );
+
+    /**
+    * Removechildren
+    * Removes all children and children of children etc. from given node
+    *
+    * @since 3.1
+    * @param IN aParent, node whos children are to be removed
+    */
+    IMPORT_C static void RemoveChildren( CMDXMLNode* aParent ); 
+
+    /**
+    * MediaElemType
+    * Gets the media type of the object (text, img, video etc)
+    *
+    * @since 3.1
+    * @param IN aNodePtr, media object node
+    * @return mediatype. EMsgMediaUnknown if node is not media object.
+    */
+    IMPORT_C static TMsgMediaType MediaElemType( CMDXMLNode* aNodePtr ); 
+
+    /**
+    * Gets the id value of the node.
+    *
+    * @since 3.1
+    * @param IN  aNodePtr, element
+    * @param OUT aId, id of the element if found, empty otherwise.
+    * @return KErrNone if found. KErrNotFound if element but no id,
+    *         KErrNotSupported if not element.
+    */
+    IMPORT_C static TInt GetId( CMDXMLNode* aNodePtr, TPtrC& aId );
+
+    /**
+    * Gets the name and content of the metatag i.e. <meta name="x1" content="x2" />
+    *
+    * @since 3.1
+    * @param IN  aNodePtr, must be element
+    * @param OUT aName,  name of the metatag. Value is garbage if function
+    *                    returns KErrNotFound
+    * @param OUT aContent, content of the metatag. Value is garbage if function
+    *                    returns KErrNotFound
+    * @return KErrNone if both ok. KErrNotFound otherwise.
+    */
+    IMPORT_C static TInt GetMetaTag(
+        CMDXMLNode* aNodePtr,
+        TPtrC& aName,
+        TPtrC& aContent );
+
+    /**
+    * Gets the region id i.e. region="xx" value of the node.
+    * Node must be media element node.
+    *
+    * @since 3.1
+    * @param IN  aNodePtr, media element
+    * @param OUT aId, regoin id of the element if found, empty otherwise.
+    * @return KErrNone if found. KErrNotSupported if not media element,
+    *         KErrNotFound if no region specified.
+    */
+    IMPORT_C static TInt GetRegionId( CMDXMLNode* aNodePtr, TPtrC& aId );
+
+    /**
+    * Gets the location string from nodes src parameter.
+    *
+    * @since 3.1
+    * @param    aNodePtr, media element
+    * @return   value of the location string.
+    */
+    IMPORT_C static TPtrC GetSrcL( CMDXMLNode* aNodePtr );
+
+    /**
+    * Gets SMIL type of the document.
+    * Tries to validate document according to conformance document requirements
+    * and SmilEditor template requirements.
+    *
+    * @since 3.1
+    * @param    aDom    Root node of the document tree.
+    * @return           Smil type of the document.
+    */
+    IMPORT_C static TUniSmilType GetSmilTypeL( CMDXMLDocument* aDom );
+
+    /**
+    * Gets SMIL type of the document.
+    * Tries to validate document according to SmilEditor template requirements.
+    *
+    * @since 3.1
+    * @param    aDom    Root node of the document tree.
+    * @return           ETrue if document is template SMIL.
+    */
+    IMPORT_C static TBool IsTemplateSmil( CMDXMLDocument* aDom );
+    
+    };
+
+#endif // __UNISMILUTILS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniTextObject.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,285 @@
+/*
+* 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: 
+*       CUniTextObject, Storage for single text attachment in presentation.
+*
+*
+*/
+
+
+#ifndef __UNITEXTOBJECT_H
+#define __UNITEXTOBJECT_H
+
+// INCLUDES
+
+#include <e32std.h>
+#include <cmsvattachment.h>
+#include <UniObject.h>
+
+// CONSTANTS
+
+// MACROS
+
+// FORWARD DECLARATIONS
+class CUniMimeInfo;
+class CMsgTextInfo;
+class CBaseMtm;
+class CUniDataUtils;
+class CEikRichTextEditor;
+
+// DATA TYPES
+
+// FUNCTION PROTOTYPES
+
+// CLASS DECLARATION
+
+/**
+* CUniTextObject, Storage for single text attachment in presentation.
+*
+* @lib UniDataModel.lib
+* @since 3.1
+*/
+class CUniTextObject : public CUniObject
+    {
+    public:  // New methods
+
+        /**
+        * Factory method that creates this object
+        * from an attachment.
+        *
+        * @since    3.1
+        * @param    aMtm    IN reference to client mtm
+        * @param    aMedia  IN initialized media info object - takes ownership!
+        * @param    aManager        IN reference to attachment manager
+        * @param    aAttachmentId   IN id of the attachment from
+        *                           which to create the object
+        * @return   Pointer to instance in cleanup stack
+        */
+        IMPORT_C static CUniTextObject* NewLC(
+            RFs& aFs,
+            CBaseMtm& aMtm,
+            CUniDataUtils& aData,
+            CMsgTextInfo* aMedia,
+            MMsvAttachmentManager& aManager,
+            CMsvAttachment& aAttachment );
+
+        /**
+        * Factory method that creates this object
+        * from an attachment.
+        *
+        * @since    3.1
+        * @param    aMtm    IN reference to client mtm
+        * @param    aMedia  IN initialized media info object - takes ownership!
+        * @param    aManager        IN reference to attachment manager
+        * @param    aAttachmentId   IN id of the attachment from
+        *                           which to create the object
+        * @return   Pointer to instance
+        */
+        IMPORT_C static CUniTextObject* NewL(
+            RFs& aFs,
+            CBaseMtm& aMtm,
+            CUniDataUtils& aData,
+            CMsgTextInfo* aMedia,
+            MMsvAttachmentManager& aManager,
+            CMsvAttachment& aAttachment );
+
+        /**
+        * Factory method that creates this object
+        * from a file.
+        *
+        * @since    3.1
+        * @param    aData   IN reference to MsgData object
+        * @param    aMedia  IN initialized media info object - takes ownership!
+        * @return   Pointer to instance in cleanup stack
+        */
+        IMPORT_C static CUniTextObject* NewLC(
+            RFs& aFs,
+            CBaseMtm& aMtm,
+            CUniDataUtils& aData,
+            CMsgTextInfo* aMedia );
+
+        /**
+        * Factory method that creates this object
+        * from a file.
+        *
+        * @since    3.1
+        * @param    aData   IN reference to MsgData object
+        * @param    aMedia  IN initialized media info object - takes ownership!
+        * @return   Pointer to instance
+        */
+        IMPORT_C static CUniTextObject* NewL(
+            RFs& aFs,
+            CBaseMtm& aMtm,
+            CUniDataUtils& aData,
+            CMsgTextInfo* aMedia );
+
+        /**
+        * Factory method that creates this object
+        * from a text buffer.
+        *
+        * @since    3.1
+        * @param    aData   IN reference to MsgData object
+        * @param    aTextEditor IN text buffer from
+        *                       which to create the object
+        * @return   Pointer to instance in cleanup stack
+        */
+        IMPORT_C static CUniTextObject* NewLC(
+            RFs& aFs,
+            CBaseMtm& aMtm,
+            CUniDataUtils& aData,
+            CEikRichTextEditor* aTextEditor );
+
+        /**
+        * Factory method that creates this object
+        * from a text buffer.
+        *
+        * @since    3.1
+        * @param    aData   IN reference to MsgData object
+        * @param    aTextEditor IN text buffer from
+        *                       which to create the object
+        * @return   Pointer to instance
+        */
+        IMPORT_C static CUniTextObject* NewL(
+            RFs& aFs,
+            CBaseMtm& aMtm,
+            CUniDataUtils& aData,
+            CEikRichTextEditor* aTextEditor );
+
+        /**
+        * Destructor
+        *
+        * @since    3.1
+        */
+        virtual ~CUniTextObject();
+
+        /*
+        * Size
+        * Inherited from CUniObject
+        *
+        * @since    3.1
+        * @param    aWithoutHeaders IN if ETrue include MIME headers' sizes
+        *                           if EFalse count only file sizes
+        * @return   Size of the object in bytes
+        */
+        virtual TInt Size( TBool aWithoutHeaders = ETrue );
+
+        /*
+        * SynchronizeSize
+        * Count the accurate size of the text object if it would
+        * be saved as a file.
+        * Useful for UTF-8 text
+        *
+        *
+        * @since    3.1
+        * @return   Size of the object in bytes
+        */
+        IMPORT_C TInt SynchronizeSize();
+
+        /*
+        * Text
+        *
+        * @since    3.1
+        * @return   Pointer to text editor.
+        */
+        inline CEikRichTextEditor* Text() const;
+
+        /*
+        * SetText
+        * Set text to save
+        *
+        * @since    3.1
+        * @param    aTextEditor     IN pointer to text editor
+        */
+        inline void SetText( CEikRichTextEditor* aTextEditor );
+
+    protected:
+
+        /**
+        * Constructor.
+        *
+        * @since    3.1
+        */
+        CUniTextObject(
+            RFs& aFs,
+            CBaseMtm& aMtm,
+            CUniDataUtils& aData,
+            CMsgTextInfo* aMedia );
+
+        /**
+        * 2nd phase constructor.
+        *
+        * @since    3.1
+        */
+        void ConstructL();
+
+        /**
+        * 2nd phase constructor.
+        *
+        * @since    3.1
+        * @param    aData   IN reference to MsgData object
+        * @param    aTextEditor IN text buffer from
+        *                       which to create the object
+        */
+        void ConstructFromTextL( CEikRichTextEditor* aTextEditor );
+
+        /**
+        * Create file name for the object
+        *
+        * @since    3.1
+        * @param    aBuffer IN text buffer from which to create file name
+        * @param    aFileName   OUT created file name (without path)
+        * @param    aData   IN reference to MsgData object
+        */
+        void CreateFileName( TFileName& aFileName );
+
+        void InitializeTextSaveL();
+        void CreateTextAttachmentL();
+        void WriteToFileL();
+
+        /**
+        * Save
+        * Inherited from CUniObject
+        */
+        virtual void Save(
+            MUniObjectSaveObserver& aObserver,
+            CMsvAttachment::TMsvAttachmentType aSaveType );
+
+        /**
+        * DoSaveL
+        * Inherited from CUniObject
+        */
+        virtual void DoSaveL();
+
+    protected: // data
+
+        enum TMsgTextObjectSaveState
+            {
+            ETextSavingIdle,
+            ETextCreatingAttachment,
+            ETextWritingToFile
+            };
+
+        CEikRichTextEditor* iTextEditor;
+        TInt iSyncCounter;
+        TInt iSyncSize;
+        TInt iSyncLength;
+        TInt iPrevLength;
+
+        TInt iTextSaveState;
+        RFile* iEditFile;
+    };
+
+#include <UniTextObject.inl>
+
+#endif // __UNITEXTOBJECT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/UniTextObject.inl	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,38 @@
+/*
+* 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: 
+*       CUniTextObject, Storage for single text attachment in presentation. 
+*     
+*
+*/
+
+
+// ---------------------------------------------------------
+// CUniTextObject::Text
+// ---------------------------------------------------------
+//
+inline CEikRichTextEditor* CUniTextObject::Text() const
+    {
+    return iTextEditor;
+    }
+
+// ---------------------------------------------------------
+// CUniTextObject::SetText
+// ---------------------------------------------------------
+//
+inline void CUniTextObject::SetText( CEikRichTextEditor* aTextEditor )
+    {
+    iTextEditor = aTextEditor;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/inc/smilliterals.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,247 @@
+/*
+* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 _SMILLITERALS_H
+#define _SMILLITERALS_H
+
+#include <e32def.h>
+
+//tags
+_LIT(KSmilTag,"smil");
+_LIT(KHeadTag,"head");
+_LIT(KBodyTag,"body");
+_LIT(KLayoutTag,"layout");
+_LIT(KRegionTag,"region");
+_LIT(KRootLayoutTag,"root-layout");
+_LIT(KSeqTag,"seq");
+_LIT(KParTag,"par");
+_LIT(KExclTag,"excl");
+_LIT(KImageTag,"img");
+_LIT(KAudioTag,"audio");
+_LIT(KVideoTag,"video");
+_LIT(KAnimationTag,"animation");
+_LIT(KRefTag,"ref");
+_LIT(KTextTag,"text");
+_LIT(KTextStreamTag,"textstream");
+_LIT(KSwitchTag,"switch");
+_LIT(KATag,"a");
+_LIT(KAreaTag,"area");
+_LIT(KAnchorTag,"anchor");
+_LIT(KTransitionTag,"transition");
+_LIT(KPrefetchTag,"prefetch");
+_LIT(KParamTag,"param");
+
+//attributes
+_LIT(KXmlnsAttr,"xmlns");
+_LIT(KXmlnsAttr2,"xmlns:");
+_LIT(KIdAttr,"id");
+_LIT(KRegionNameAttr,"regionName");
+_LIT(KRegionAttr,"region");
+_LIT(KAltAttr,"alt");
+_LIT(KDurAttr,"dur");
+_LIT(KRepeatCountAttr,"repeatCount");
+_LIT(KRepeatDurAttr,"repeatDur");
+_LIT(KRepeatAttr,"repeat");
+_LIT(KBeginAttr,"begin");
+_LIT(KEndAttr,"end");
+_LIT(KMinAttr,"min");
+_LIT(KMaxAttr,"max");
+_LIT(KEndsyncAttr,"endsync");
+_LIT(KFillAttr,"fill");
+_LIT(KSrcAttr,"src");
+_LIT(KTopAttr,"top");
+_LIT(KBottomAttr,"bottom");
+_LIT(KLeftAttr,"left");
+_LIT(KRightAttr,"right");
+_LIT(KWidthAttr,"width");
+_LIT(KHeightAttr,"height");
+_LIT(KZIndexAttr,"z-index");
+_LIT(KFitAttr,"fit");
+_LIT(KBackgroundColorAttr,"backgroundColor");
+_LIT(KBackgroundColor2Attr,"background-color");
+_LIT(KShowBackgroundAttr,"showBackground");
+_LIT(KHrefAttr,"href");
+_LIT(KAccesskeyAttr,"accesskey");
+_LIT(KActuateAttr,"actuate");
+_LIT(KTargetAttr,"target");
+_LIT(KTypeAttr,"type");
+_LIT(KTabindexAttr,"tabindex");
+_LIT(KSubtypeAttr,"subtype");
+_LIT(KTransInAttr,"transIn");
+_LIT(KTransOutAttr,"transOut");
+_LIT(KFadeColorAttr,"fadeColor");
+_LIT(KStartProgressAttr,"startProgress");
+_LIT(KEndProgressAttr,"endProgress");
+_LIT(KDirectionAttr,"direction");
+_LIT(KRestartAttr,"restart");
+_LIT(KSkipContentAttr,"skip-content");
+_LIT(KShapeAttr,"shape");
+_LIT(KCoordsAttr,"coords");
+_LIT(KClipBeginAttr,"clipBegin");
+_LIT(KClipBegin2Attr,"clip-begin");
+_LIT(KClipEndAttr,"clipEnd");
+_LIT(KClipEnd2Attr,"clip-end");
+_LIT(KNameAttr,"name");
+_LIT(KValueAttr,"value");
+//_LIT(KShowAttr, "show");
+//_LIT(KSourcePlaystateAttr, "sourceplaystate");
+
+//system test attributes
+_LIT(KSystemAttr,"system");
+_LIT(KSystemRequiredAttr,"systemRequired");
+_LIT(KSystemScreenSizeAttr,"systemScreenSize");
+_LIT(KSystemScreenDepthAttr,"systemScreenDepth");
+_LIT(KSystemCPUAttr, "systemCPU");
+_LIT(KSystemOperatingSystemAttr, "systemOperatingSystem");
+_LIT(KSystemComponentAttr, "systemComponent");
+//_LIT(KSystemContentTypeAttr, "systemContentType");
+
+
+//supported systemRequired URLs
+static const TText* const KSystemReqValue [] = {
+	//modules
+	_S("http://www.w3.org/2001/SMIL20/AccessKeyTiming"),
+	_S("http://www.w3.org/2001/SMIL20/BasicContentControl"),
+	_S("http://www.w3.org/2001/SMIL20/BasicInlineTiming"),
+	_S("http://www.w3.org/2001/SMIL20/BasicLayout"),
+	_S("http://www.w3.org/2001/SMIL20/BasicLinking"),
+	_S("http://www.w3.org/2001/SMIL20/BasicMedia"),
+	_S("http://www.w3.org/2001/SMIL20/BasicTimeContainers"),
+	_S("http://www.w3.org/2001/SMIL20/BasicTransitions"),
+	_S("http://www.w3.org/2001/SMIL20/EventTiming"),
+	_S("http://www.w3.org/2001/SMIL20/ExclTimeContainers"),
+	_S("http://www.w3.org/2001/SMIL20/LinkingAttributes"),
+	_S("http://www.w3.org/2001/SMIL20/MediaAccessibility"),
+	_S("http://www.w3.org/2001/SMIL20/MediaClipping"),
+	_S("http://www.w3.org/2001/SMIL20/MediaDescription"),
+	_S("http://www.w3.org/2001/SMIL20/MediaParam"),
+	_S("http://www.w3.org/2001/SMIL20/Metainformation"),
+	_S("http://www.w3.org/2001/SMIL20/MinMaxTiming"),
+	_S("http://www.w3.org/2001/SMIL20/MultiArcTiming"),
+	_S("http://www.w3.org/2001/SMIL20/PrefetchControl"),
+	_S("http://www.w3.org/2001/SMIL20/RepeatTiming"),
+	_S("http://www.w3.org/2001/SMIL20/RestartTiming"),
+	_S("http://www.w3.org/2001/SMIL20/SkipContentControl"),
+	_S("http://www.w3.org/2001/SMIL20/Structure"),
+	//other
+	_S("http://www.w3.org/2001/SMIL20/NestedTimeContainers"),
+	_S("http://www.w3.org/2001/SMIL20/DeprecatedFeatures"),
+
+	_S("http://www.w3.org/2001/SMIL20/HostLanguage"),	
+	_S("http://www.w3.org/2001/SMIL20/IntegrationSet"),	
+
+	//3gpp
+	_S("http://www.3gpp.org/SMIL20/PSS4/"),
+	_S("http://www.3gpp.org/SMIL20/PSS5/"),
+    _S("http://www.3gpp.org/SMIL20/PSS6/"),
+	_S("http://www.3gpp.org/SMIL20/PSS4"),
+	_S("http://www.3gpp.org/SMIL20/PSS5"),
+    _S("http://www.3gpp.org/SMIL20/PSS6"),
+	0 
+	};
+
+
+//attribute values
+_LIT(KIndefiniteVal,"indefinite");
+_LIT(KMediaVal,"media");
+_LIT(KHiddenVal,"hidden");
+_LIT(KFillVal,"fill");
+_LIT(KSliceVal,"slice");
+_LIT(KMeetVal,"meet");
+_LIT(KScrollVal,"scroll");
+_LIT(KNoneVal,"none");
+_LIT(KTransparentVal,"transparent");
+_LIT(KWhenActiveVal,"whenActive");
+_LIT(KAlwaysVal,"always");
+_LIT(KTransitionVal,"transition");
+_LIT(KFreezeVal,"freeze");
+_LIT(KHoldVal,"hold");
+_LIT(KRemoveVal,"remove");
+_LIT(KForwardVal,"forward");
+_LIT(KReverseVal,"reverse");
+_LIT(KFirstVal,"first");
+_LIT(KLastVal,"last");
+_LIT(KAllVal,"all");
+_LIT(KWhenNotActiveVal,"whenNotActive");
+_LIT(KNeverVal,"never");
+_LIT(KTrueVal,"true");
+_LIT(KFalseVal,"false");
+_LIT(KCircleVal,"circle");
+_LIT(KRectVal,"rect");
+_LIT(KPolyVal,"poly");
+_LIT(KOnLoadVal,"onLoad");
+_LIT(KOnRequestVal,"onRequest");
+
+_LIT(KContentTypeVal,"ContentType:");
+
+_LIT(KSmil2NS,"http://www.w3.org/2001/SMIL20/Language");
+
+
+// colors
+static const TText* const KColorNames [] = {
+	_S("black"),	
+	_S("silver"),	
+	_S("gray"),	
+	_S("white"),	
+	_S("maroon"),	
+	_S("red"),		
+	_S("purple"),	
+	_S("fuchsia"),	
+	_S("green"),	
+	_S("lime"),	
+	_S("olive"),	
+	_S("yellow"),	
+	_S("navy"),	
+	_S("blue"),	
+	_S("teal"),	
+	_S("aqua"),	
+	0
+	};
+
+//NOTE: TRgb constructor uses order 0x00bbggrr
+static const TUint KColorValues [] = {
+	0x000000,
+	0xc0c0c0,
+	0x808080,
+	0xffffff,
+	0x000080,
+	0x0000ff,
+	0x800080,
+	0xff00ff,
+	0x008000,
+	0x00ff00,
+	0x008080,
+	0x00ffff,
+	0x800000,
+	0xff0000,
+	0x808000,
+	0xffff00,
+	0
+	};
+
+#if defined (__WINS__) 
+_LIT(KCPUVal, "x86");
+#else
+_LIT(KCPUVal, "arm");
+#endif
+
+_LIT(KOSVal, "symbian");
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/rom/unidatamodel.iby	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef __UNIDATAMODEL_IBY__
+#define __UNIFIEDDATAMODEL_IBY__
+
+REM DLL
+file=ABI_DIR\UREL\unidatamodel.dll                   SHARED_LIB_DIR\unidatamodel.dll
+
+// UniModel
+data=DATAZ_\RESOURCE_FILES_DIR\UniDataModel.rsc     RESOURCE_FILES_DIR\UniDataModel.rsc
+
+#endif // __UNIDATAMODEL_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/src/ConformanceChecker.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,658 @@
+/*
+* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "ConformanceChecker.h"
+
+#include <gmxmldocument.h>
+#include <gmxmlelement.h>
+
+#include "smilliterals.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+// -----------------------------------------------------------------------------
+// CConformanceChecker::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C
+CConformanceChecker* CConformanceChecker::NewL()
+    {
+    CConformanceChecker* self = new( ELeave ) CConformanceChecker;
+    return self;
+    }
+
+
+// Destructor
+CConformanceChecker::~CConformanceChecker()
+    {
+    }
+
+
+//
+// ----------------------------------------------------------
+// CConformanceChecker::Check(CMDXMLDocument* aXmldoc)
+//
+// Checks if the DOM tree's content is legacy content or not.
+// ----------------------------------------------------------
+//
+
+TBool CConformanceChecker::Check(CMDXMLDocument* aXmldoc, TMmsSmilVersion aVersion, TInt aFlags)
+	{
+	//Initializing the flags according to the CF document version
+	switch ( aVersion )
+		{
+		case EMmsSmil_v2_0:
+			iFlags = 0;
+			break;
+		case EMmsSmil_v3_0: //Not implemented yet
+			return EFalse;
+		default:
+			iFlags = 0;
+		}
+	//Combine the implicit flags  with the explicitly specified flags
+	iFlags=iFlags | aFlags;
+
+	if (!aXmldoc) return EFalse;
+
+	CMDXMLElement* root = aXmldoc->DocumentElement();
+	if (!root) return EFalse;
+
+	CMDXMLNode* smil = NULL;
+	CMDXMLNode* head = NULL;
+	CMDXMLNode* body = NULL;
+
+	CMDXMLNode* node = root->FirstChild();
+	while (node && node->NodeName() != KSmilTag)
+		{
+		node=node->NextSibling();
+		}
+
+	if ( node ) smil = node;
+	else return EFalse;
+
+	node = smil->FirstChild();
+	while (node && node->NodeType() != CMDXMLNode::EElementNode)
+		{
+		node = node->NextSibling();
+		}
+
+	if (node && node->NodeName() == KHeadTag)
+		{
+		head = node;
+		if (!CheckHeadStructure(head))
+			return EFalse;
+		//Going forward in the DOM to find next element
+		node = head->NextSibling();
+		while (node && node->NodeType() != CMDXMLNode::EElementNode)
+			{
+			node = node->NextSibling();
+			}
+		}
+	if (node && node->NodeName() == KBodyTag)
+		{
+		body = node;
+		if (!CheckBodyStructure(body))
+			return EFalse;
+		}
+	else if ( node ) return EFalse; //there is some other element (not head or body in the smil element)
+	//Checking the head content
+	if ( head )
+		{
+		node = head->FirstChild();
+		}
+	else
+		{
+		node = NULL;
+		}
+
+	while (node && node->NodeName() != KLayoutTag)
+		{
+		node = node->NextSibling();
+		}
+	//Checking the content of the layout
+	if (!CheckLayoutContent(node))
+		return EFalse;
+	//Checking the body content
+	if (!CheckBodyContent(body))
+		return EFalse;
+
+	return ETrue;
+	} //End of Check()
+
+//
+// ----------------------------------------------------------
+// CConformanceChecker::CheckHeadStructure(CMDXMLNode* aHead)
+//
+// Checks the structure of the head element: allowed to contain only layout and meta element
+// ----------------------------------------------------------
+//
+
+TBool CConformanceChecker::CheckHeadStructure(CMDXMLNode* aHead)
+	{
+	//Checking that the head has only layout and meta element
+	if (!aHead)
+		{
+		return ETrue;
+		}
+	CMDXMLNode* node = aHead->FirstChild();
+	while (node)
+		{
+		if (node->NodeType() == CMDXMLNode::EElementNode
+			&& node->NodeName() != KLayoutTag
+			&& node->NodeName() != KMetaTag)
+			{
+			return EFalse;
+			}
+		else
+			{
+			node = node->NextSibling();
+			}
+		}
+	return ETrue;
+	}
+
+//
+// ----------------------------------------------------------
+// CConformanceChecker::CheckBodyStructure(CMDXMLNode* aBody)
+//
+// Checks the structure of the body element: allowed to contain only par elements
+//											(one including seq element right after the body is allowed)
+// ----------------------------------------------------------
+//
+TBool CConformanceChecker::CheckBodyStructure(CMDXMLNode* aBody)
+	{
+	//Checking that the body has only par elements
+	if (!aBody)
+		{
+		return ETrue;
+		}
+	CMDXMLNode* node = aBody->FirstChild();
+	while (node && node->NodeType() != CMDXMLNode::EElementNode)
+		{
+		node = node->NextSibling();
+		}
+
+	//One seq element right after the body is allowed if EAllowSeqTag is set
+	if ((iFlags & EAllowSeqTag)!=0 && node && node->NodeName() == KSeqTag)
+		{
+		if (node->NextSibling())
+			{
+			return EFalse;
+			}
+		else
+			{
+			node = node->FirstChild();
+			}
+		}
+	while (node)
+		{
+		if (node->NodeType() == CMDXMLNode::EElementNode && node->NodeName() != KParTag)
+			{
+			return EFalse;
+			}
+		else
+			{
+			node = node->NextSibling();
+			}
+		}
+	return ETrue;
+	}
+
+//
+// ----------------------------------------------------------
+// CConformanceChecker::CheckLayoutContent(CMDXMLNode* aLayout)
+//
+// Checks the content of the layout element
+//			- root-layout and max. 2 region elements are allowed
+//			- checks the width/height values for root-layout (pixel is allowed)
+//			- checks the width/height/top/left values for region
+//			  if EAllowMixedRegionDimensions is not set no mixed pixel/percent allowed
+// ----------------------------------------------------------
+//
+
+TBool CConformanceChecker::CheckLayoutContent(CMDXMLNode* aLayout)
+	{
+	TInt rl_nr = 0;
+	TInt r_nr = 0;
+	if (!aLayout)
+		{
+		return ETrue;
+		}
+	CMDXMLNode* node = aLayout->FirstChild();
+	TBool foundImage = EFalse;
+	TBool foundText = EFalse;
+	while (node)
+		{
+		if (node->NodeType() == CMDXMLNode::EElementNode)
+			{
+			if (node->NodeName() == KRootLayoutTag)
+				{
+				if (++rl_nr > 1)
+					return EFalse;
+				//Check the attributes
+				CMDXMLElement* elem = static_cast<CMDXMLElement*>(node);
+				TInt n = elem->NumAttributes();
+				for (TInt i = 0; i < n; ++i)
+					{
+					TPtrC name, value;
+					elem->AttributeDetails(i,name,value);
+					if	( (iFlags & EAllowAllAttributes) == 0 &&
+						name != KWidthAttr && name != KHeightAttr )
+						{
+						return EFalse;
+						}
+					if (name == KWidthAttr || name == KHeightAttr)
+						{
+						TBool pixel = EFalse;  // WB!
+						TBool percent = EFalse;
+						if (!CheckMixedRegionAttribute(value,percent,pixel))
+							{
+							return EFalse;
+							}
+						}
+					}
+				}
+			else if (node->NodeName() == KRegionTag)
+				{
+				if (++r_nr > 2)
+					{
+					return EFalse;
+					}
+				//Check the attributes
+				TBool foundPixel = EFalse;
+				TBool foundPercent = EFalse;
+
+				CMDXMLElement* elem = static_cast<CMDXMLElement*>(node);
+				TInt n = elem->NumAttributes();
+				for (TInt i = 0; i < n; ++i)
+					{
+					TPtrC name, value;
+					elem->AttributeDetails(i,name,value);
+
+					if ((iFlags & EAllowAllAttributes) == 0 && name != KIdAttr
+						&& name != KWidthAttr && name != KHeightAttr
+						&& name != KFitAttr && name != KLeftAttr && name != KTopAttr)
+						{
+						return EFalse;
+						}
+					if ((iFlags & EAllowMixedRegionDimensions)==0 &&
+						(name == KWidthAttr || name == KHeightAttr
+						|| name == KTopAttr || name == KLeftAttr)
+						&& !CheckMixedRegionAttribute(value,foundPercent,foundPixel))
+						{
+						return EFalse;
+						}
+					if ((iFlags & EAllowAnyRegionNames)==0 && name == KIdAttr
+						&& !CheckRegionNames(value,foundImage,foundText))
+						{
+						return EFalse;
+						}
+
+					}//for
+				}
+			else
+				{
+				return EFalse;
+				}
+
+			}
+		node = node->NextSibling();
+		}//while
+	return ETrue;
+	}
+
+//
+// ----------------------------------------------------------
+// CConformanceChecker::CheckMixedRegionAttribute
+// Checks if the given value is ending with percent or pixel
+// and if this is conforming to the values of aPixel, aPercent.
+// Returns true - if the value is not mixed
+//		   false - if mixed
+// ----------------------------------------------------------
+//
+TBool CConformanceChecker::CheckMixedRegionAttribute(TDesC& aValue,
+													 TBool& aPercent, TBool& aPixel) const
+	{
+	TInt valueLength = aValue.Length();
+	TInt j = 0;
+	TBool success = ETrue;
+	while (j < valueLength && static_cast<TChar>(aValue[j]).IsDigit())
+		{
+		j++;
+		}
+	HBufC* ending = aValue.Right(valueLength-j).Alloc();
+	if (!ending)
+		{
+		success = EFalse;
+		}
+	else
+		{
+		TPtr endingPtr = ending -> Des();
+		endingPtr.LowerCase();
+		endingPtr.TrimRight();
+		if (endingPtr==KPercent)
+			{
+			aPercent = ETrue;
+			if (aPixel)
+				{
+				success = EFalse;
+				}
+			}
+		else if (endingPtr==KNullDesC || endingPtr==KPx)
+			{
+			aPixel = ETrue;
+			if (aPercent)
+				{
+				success = EFalse;
+				}
+			}
+		else
+			success = EFalse; //Cannot be other then pixel or percent
+		}
+	delete ending;
+	return success;
+	}
+
+
+//
+// ----------------------------------------------------------
+// CConformanceChecker::CheckRegionNames
+// Checks if the given value is exactly "Image" or "Text" and if it
+// is duplicated (checking the transmitted boolean parameters).
+// Returns true - if the value is "Image" or "Text" and it's not duplicated
+//		   false - otherwise
+// ----------------------------------------------------------
+//
+TBool CConformanceChecker::CheckRegionNames(TDesC& aValue,
+											TBool& aFoundImage, TBool& aFoundText) const
+{
+	if (aValue == KImage)
+		{
+		if (aFoundImage)
+			{
+			return EFalse;
+			}
+		else
+			{
+			aFoundImage = ETrue;
+			}
+		}
+	else if (aValue == KText)
+		{
+		if (aFoundText)
+			{
+			return EFalse;
+			}
+		else
+			{
+			aFoundText = ETrue;
+			}
+		}
+	else
+		{
+		return EFalse;
+		}
+	return ETrue;
+}
+
+//
+// ----------------------------------------------------------
+// CConformanceChecker::CheckBodyContent(CMDXMLNode* aBody)
+//
+// Checks the content of the body element
+// ----------------------------------------------------------
+//
+TBool CConformanceChecker::CheckBodyContent(CMDXMLNode* aBody)
+	{
+	if (!aBody)
+		{
+		return ETrue;
+		}
+	CMDXMLNode* node = aBody->FirstChild();
+	//One seq element right after the body is allowed if EAllowSeqTag is set
+	if ((iFlags & EAllowSeqTag)!=0 && node && node->NodeName() == KSeqTag)
+		{
+		node = node->FirstChild();
+		}
+	while (node)
+		{
+		if (node->NodeName() == KParTag)
+			{
+			//Checking the attributes of par element
+			//only dur is allowed, dur='indefinite' illegal
+			//checking dur is in ms
+			CMDXMLElement* elem = static_cast<CMDXMLElement*>(node);
+			if (elem->NumAttributes() > 1 && (iFlags & EAllowAllAttributes) == 0)
+				{
+				return EFalse;
+				}
+			for (TInt i = 0; i < elem->NumAttributes(); ++i)
+				{
+				TPtrC name, value;
+				elem->AttributeDetails(i,name,value);
+
+				if (name == KDurAttr && value == KIndefiniteVal)
+					{
+					return EFalse;
+					}
+				if ((iFlags & EAllowAllAttributes) == 0 && (name != KDurAttr ))
+					{
+					return EFalse;
+					}
+				if (name == KDurAttr && (iFlags & EAllowNonMilliseconds) == 0
+					&& !IsInMilliseconds(value))
+					{
+					return EFalse;
+					}
+
+				}
+			if (!CheckParContent(node))
+				return EFalse;
+			}
+		node = node->NextSibling();
+		}
+	return ETrue;
+	}
+
+
+//
+// ----------------------------------------------------------
+// CConformanceChecker::CheckParContent(CMDXMLNode* aPar)
+//
+// Checks the content of the par element
+// ----------------------------------------------------------
+//
+
+TBool CConformanceChecker::CheckParContent(CMDXMLNode* aPar)
+	{
+	if (!aPar)
+		{
+		return ETrue;
+		}
+	TBool hasImage=EFalse;
+	TBool hasText=EFalse;
+	TBool hasAudio=EFalse;
+	TBool hasRef=EFalse;
+	TBool hasVideo=EFalse;
+
+	RArray<TPtrC> regionNames;
+	CMDXMLNode* innernode = aPar->FirstChild();
+	TBool legacy = ETrue;
+	while (legacy && innernode)
+		{
+		if (innernode->NodeType() == CMDXMLNode::EElementNode)
+			{
+			//Checking one type of media per par element
+			if (innernode->NodeName() == KImageTag)
+				if (hasImage)
+					{
+					legacy = EFalse;
+					}
+				else
+					{
+					hasImage = ETrue;
+					}
+			else if (innernode->NodeName() == KTextTag)
+				if (hasText)
+					{
+					legacy = EFalse;
+					}
+				else
+					{
+					hasText = ETrue;
+					}
+			else if (innernode->NodeName() == KAudioTag)
+				if (hasAudio)
+					{
+					legacy = EFalse;
+					}
+				else
+					{
+					hasAudio = ETrue;
+					}
+			else if (innernode->NodeName() == KRefTag)
+				if (hasRef)
+					{
+					legacy = EFalse;
+					}
+				else
+					{
+					hasRef = ETrue;
+					}
+			else if (innernode->NodeName() == KVideoTag)
+				if ((iFlags & EAllowVideoTag) == 0)
+					{
+					legacy = EFalse;
+					}
+				else
+					{
+					if (hasVideo)
+						{
+						legacy = EFalse;
+						}
+					else
+						{
+						hasVideo=ETrue;
+						}
+					}
+			else legacy = EFalse; //No other elements are allowed then img,text, audio, ref, video
+				//Check attributes
+			CMDXMLElement* elem = static_cast<CMDXMLElement*>(innernode);
+			TInt n = elem->NumAttributes();
+			for (TInt i = 0; legacy && (i < n); ++i)
+				{
+				TPtrC name, value;
+				elem->AttributeDetails(i,name,value);
+				//Check one region is used only once per par element
+				if (name == KRegionAttr)
+					{
+					if ((iFlags & EAllowAnyRegionNames) == 0
+						&& value != KImage && value != KText)
+						{
+						legacy = EFalse;
+						}
+					TInt nr = regionNames.Count();
+					TInt j = 0;
+					while (j < nr && legacy)
+						{
+						if (regionNames[j]==value)
+							{
+							legacy = EFalse;
+							}
+						else
+							{
+							++j;
+							}
+						}
+					if (legacy)
+						{
+						regionNames.Append(value);
+						if (regionNames.Count()>2)
+							{
+							legacy = EFalse;
+							}
+						}
+
+					}
+				else if ((iFlags & EAllowAllAttributes) == 0 && name != KSrcAttr
+					&& name != KAltAttr && name != KBeginAttr && name != KEndAttr)
+					{
+					legacy = EFalse;
+					}
+					//checking the src attribute
+				if (name == KSrcAttr && (iFlags & EAllowNonUsAscii) == 0)
+					{
+					TInt valueLength=value.Length();
+					for (TInt i = 0; legacy && (i < valueLength); ++i)
+						{
+						TInt v = value[i];
+						if (v < KUSAsciiMinCode || v > KUSAsciiMaxCode)
+							{
+							legacy = EFalse;
+							}
+						}
+					}
+				//checking begin and end in ms
+				if ((name == KBeginAttr || name == KEndAttr)
+					&& (iFlags & EAllowNonMilliseconds) == 0
+					&& !IsInMilliseconds(value))
+					{
+						legacy = EFalse;
+					}
+				}//for
+			}
+		innernode = innernode->NextSibling();
+		} //while
+    regionNames.Close();
+	return legacy;
+	}
+
+//
+// ----------------------------------------------------------
+// CConformanceChecker::IsInMilliseconds(TDesC aValue);
+//
+// Checks if  aValue is ending with 'ms'
+// ----------------------------------------------------------
+//
+
+TBool CConformanceChecker::IsInMilliseconds(TDesC& aValue) const
+	{
+	TBuf<2> ending;
+	TInt j = 0;
+	TInt n = aValue.Length();
+	TInt trimmedEndingLength = 2;
+	//Processing till all the white spaces are eliminated from the end
+	do
+	{
+	j+=2-trimmedEndingLength;
+	if (n>=j+2)
+		ending = aValue.Mid(n-2-j,2);
+	ending.TrimRight();
+	trimmedEndingLength = ending.Length();
+	}
+	while (trimmedEndingLength!=2 && n>j+2);
+	ending.LowerCase();
+	if (ending != KMs) return EFalse;
+	return ETrue;
+	}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/src/MsgAttachmentUtils.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,131 @@
+/*
+* 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: 
+*
+*/
+
+
+// ========== INCLUDE FILES ================================
+
+#include <txtetext.h>               // for CPlainText
+
+#include "MsgAttachmentUtils.h"
+
+// ========== EXTERNAL DATA STRUCTURES =====================
+
+// ========== EXTERNAL FUNCTION PROTOTYPES =================
+
+// ========== CONSTANTS ====================================
+
+// ========== MACROS =======================================
+
+// ========== LOCAL CONSTANTS AND MACROS ===================
+
+// ========== MODULE DATA STRUCTURES =======================
+
+// ========== LOCAL FUNCTION PROTOTYPES ====================
+
+// ========== LOCAL FUNCTIONS ==============================
+
+// ========== MEMBER FUNCTIONS =============================
+
+//----------------------------------------------------------------------------
+// from: TBool CImRecvConvert::IsIllegalChar(const TUint aChar)
+//----------------------------------------------------------------------------
+LOCAL_C TBool IsIllegalChar(const TUint aChar)
+    {
+    return (
+        aChar == '*'  ||
+        aChar == '\\' ||
+        aChar == '<'  ||
+        aChar == '>'  ||
+        aChar == ':'  ||
+        aChar == '.'  ||
+        aChar == '"'  ||
+        aChar == '/'  ||
+        aChar == '|'  ||
+        aChar == '?'  ||
+        aChar == CEditableText::EParagraphDelimiter  ||
+        aChar == CEditableText::ELineBreak  ||
+        aChar <  ' ' );
+    }
+
+// ---------------------------------------------------------
+// MsgAttachmentUtils::GetFileNameFromBuffer
+//
+//
+// ---------------------------------------------------------
+//
+void MsgAttachmentUtils::GetFileNameFromBuffer(
+    TFileName& aFileName,
+    const TDesC& aBuffer,
+    TInt aMaxLength,
+    const TDesC* aExt /*= NULL*/ )
+    {
+    if ( aExt != NULL )
+        {
+        aMaxLength -= aExt->Length();
+        }
+
+    TInt len = aBuffer.Length();
+    TInt max = Min( len, aMaxLength );
+
+//    __ASSERT_DEBUG( max > 0, Panic( EMsgZeroLength ) );
+
+    aFileName.Zero();
+
+    TInt cc = 0;
+    TUint ch;
+    TUint ch1 = 0;
+    TBool spaces = EFalse;
+    for ( TInt i = 0; i < len && cc < max; ++i )
+        {
+        ch = aBuffer[i];
+
+        // ignore spaces from beginning of the buffer until first
+        // non-space is encountered.
+        if ( !spaces && ch != ' ' )
+            {
+            spaces = ETrue;
+            }
+
+        if ( i > 0 )
+            {
+            ch1 = aBuffer[i - 1];
+            }
+
+        // strip illegal chars away.
+        // checks also if previous and current chars are '.'
+        if ( spaces && ! IsIllegalChar( ch ) )
+            {
+            if ( !( i > 0 && ch == '.' && ch1 == '.' ) )
+                {
+                aFileName.Append( ch );
+                cc++;
+                }
+            }
+        }
+
+    aFileName.Trim();
+
+    // If filename is empty at this point, do not append extension either.
+    // Instead, empty filename is returned so that caller can use whatever
+    // default s/he has for it.
+    if ( aFileName.Length() > 0 && aExt != NULL )
+        {
+        aFileName.Append( *aExt );
+        }
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/src/UniDataModel.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,621 @@
+/*
+* 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: 
+*       Provides CUniDataModel class methods.
+*
+*
+*/
+
+
+
+// ========== INCLUDE FILES ================================
+
+#include "debugtraces.h"
+
+#include <eikenv.h>
+#include <eikdoc.h>
+
+#include <msvstd.h>                     // TMsvEntry
+#include <msvapi.h>
+#include <msvuids.h>                    // Msgs Uids
+#include <mtclbase.h>                   // CBaseMtm
+#include <mmsvattachmentmanager.h>
+#include <cmsvattachment.h>
+#include <cmsvmimeheaders.h>
+
+#include <bautils.h>
+
+/*
+#include <muiumsvuiserviceutilities.h>  //Disk space check
+#include <msgattachmentinfo.h>
+*/
+
+#include <gmxmldocument.h>
+#include <gmxmlnode.h>
+#include <gmxmlelement.h>
+
+// Features
+#include <featmgr.h>
+#include <bldvariant.hrh>
+
+// MsgMedia
+#include <MsgMediaResolver.h>
+#include <MsgMediaInfo.h>
+#include <MsgTextInfo.h>
+
+#include <MmsConformance.h>
+
+#include "UniDataModel.h"
+#include "UniSmilModel.h"
+
+#include "UniDataUtils.h"
+#include "UniModelConst.h"
+#include "UniObjectList.h"
+#include "UniSmilList.h"
+#include "UniObject.h"
+#include "UniTextObject.h"
+#include "UniMimeInfo.h"
+
+#include "UniSmilUtils.h"
+//#include "UniEditorLogging.h"
+//#include "messagingvariant.hrh"
+#include "MsgMimeTypes.h"
+#include <e32base.h>
+
+// ========== CONSTANTS ====================================
+
+// ---------------------------------------------------------
+// CUniDataModel::Constructor
+// ---------------------------------------------------------
+//
+CUniDataModel::CUniDataModel( RFs& aFs, CBaseMtm& aMtm ) :
+    iFs( aFs ),
+    iMtm( aMtm ),
+    iSmilModel( NULL ),
+    iDom( NULL )
+    {
+    }
+
+// ---------------------------------------------------------
+// CUniDataModel::NewL
+// ---------------------------------------------------------
+//
+EXPORT_C CUniDataModel* CUniDataModel::NewL( RFs& aFs, CBaseMtm& aMtm )
+    {
+    CUniDataModel* self =  new ( ELeave ) CUniDataModel( aFs, aMtm );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CUniDataModel::ConstructL
+// ---------------------------------------------------------
+//
+EXPORT_C void CUniDataModel::ConstructL()
+    {
+#ifdef _DEBUG_TRACES_
+    qCritical() << " CUniDataModel ConstructL start";
+#endif
+    iDataUtils = CUniDataUtils::NewL( iFs );
+    iObjectList = CUniObjectList::NewL( iMtm, *iDataUtils );
+    iAttachmentList = CUniObjectList::NewL( iMtm, *iDataUtils );
+    iSmilList = CUniSmilList::NewL( iMtm );
+    iSmilModel = CUniSmilModel::NewL( iFs, iMtm, *iDataUtils, *iObjectList );
+
+    iMediaResolver = CMsgMediaResolver::NewL();
+    iMediaResolver->SetCharacterSetRecognition( EFalse );
+
+    iMmsConformance = CMmsConformance::NewL();
+    iMmsConformance->CheckCharacterSet( EFalse );
+    
+#ifdef _DEBUG_TRACES_
+    qCritical() << " CUniDataModel ConstructL End";
+#endif
+    }
+
+// ---------------------------------------------------------
+// CUniDataModel::~CUniDataModel
+//
+// Destructor.
+// ---------------------------------------------------------
+//
+EXPORT_C CUniDataModel::~CUniDataModel()
+    {
+    delete iMediaResolver;
+    delete iMmsConformance;
+    delete iSmilModel;
+    delete iObjectList;
+    delete iAttachmentList;
+    delete iSmilList;
+    delete iDataUtils;
+    delete iParser;
+    delete iDom;
+    }
+
+// ---------------------------------------------------------
+// CUniDataModel::RestoreL
+//
+// Initialise the model.
+// ---------------------------------------------------------
+//
+EXPORT_C void CUniDataModel::RestoreL(
+        MUniDataModelObserver& aObserver,
+        TBool aRemoveCorrupted /*= ETrue*/,
+        TBool aAllowSmil /*= ETrue*/ )
+    {
+    iObserver = &aObserver;
+    iSmilType = ENoSmil;
+
+    if ( iMtm.Entry().HasStoreL() )
+    	{
+        FindAndHandleCorruptL( aRemoveCorrupted );
+
+        TBool readOnly = iMtm.Entry().Entry().ReadOnly();
+        CMsvStore* store = readOnly
+        	? iMtm.Entry().ReadStoreL()
+        	: iMtm.Entry().EditStoreL();
+        CleanupStack::PushL( store );
+        MMsvAttachmentManager& manager = store->AttachmentManagerL();
+        CMsvMimeHeaders* msvMime = CMsvMimeHeaders::NewLC();
+
+        iParseResult = 0;
+
+        iOrigAttachmentCount = manager.AttachmentCount();
+
+        for ( TInt i = 0; i < iOrigAttachmentCount ; ++i )
+            {
+            CMsvAttachment* attachment = manager.GetAttachmentInfoL( i );
+            CleanupStack::PushL( attachment );
+            msvMime->RestoreL( *attachment );
+
+            TBuf8<KMaxDataTypeLength> contentType;
+            contentType.Copy( msvMime->ContentType() );
+            contentType.Append( _L8("/") );
+            contentType.Append( msvMime->ContentSubType() );
+
+            // Put smil attas to own array, except if SendUi
+            if ( aAllowSmil &&
+                contentType.CompareF( KMsgMimeSmil ) == 0 )
+                {
+                iSmilList->AddSmilAttachmentL( manager, attachment->Id() );
+                CleanupStack::PopAndDestroy( attachment );
+                continue;
+                }
+
+            RFile readFile = manager.GetAttachmentFileL( i );
+            CleanupClosePushL( readFile );
+            CUniObject* newObj = CreateObjectFromAttachmentLC(
+                contentType,
+                readFile,
+                manager,
+                *attachment );
+
+            if ( newObj->Attachment() )
+                {
+                iAttachmentList->AddObjectL( newObj );
+                }
+            else
+                {
+                iObjectList->AddObjectL( newObj );
+                }
+
+            CleanupStack::Pop( newObj );
+            CleanupStack::PopAndDestroy( &readFile );
+            CleanupStack::PopAndDestroy( attachment );
+            } // for
+
+        CleanupStack::PopAndDestroy( msvMime );
+
+
+
+        //UNILOGGER_WRITE_TIMESTAMP("CUniDataModel::RestoreL commit start");
+
+
+        //UNILOGGER_WRITE_TIMESTAMP("CUniDataModel::RestoreL commit end");
+        CleanupStack::PopAndDestroy( store );
+
+        if ( iSmilList->Count() == 1 )
+            {
+            RFile smilFile = iDataUtils->GetAttachmentFileL( iMtm, iSmilList->GetSmilAttachmentByIndex( 0 ) );
+            iParser = CMDXMLParser::NewL( this );
+            iParser->ParseFile( smilFile );
+            if( !iObjWait.IsStarted() )
+                {
+                iObjWait.Start();
+                }
+            }
+        else
+            {
+            if ( iSmilList->Count() > 1 )
+                {
+                iSmilType = EMultipleSmil;
+                }
+            iParseResult = iSmilModel->ParseL( NULL ); // Try to create something anyway
+            
+            FinalizeRestoreL( KErrNone );
+            }
+    	}
+    else
+    	{
+        FinalizeRestoreL( KErrNone );
+    	}
+    }
+
+// ---------------------------------------------------------
+// CUniDataModel::AddAttachmentL
+// ---------------------------------------------------------
+//
+EXPORT_C CUniObject* CUniDataModel::AddAttachmentL(
+        MUniObjectSaveObserver& aObserver,
+        CMsgMediaInfo* aMedia,
+        CMsvAttachment::TMsvAttachmentType aSaveType /*= CMsvAttachment::EMsvLinkedFile*/ )
+    {
+    CUniObject* obj = CUniObject::NewLC( iFs, iMtm, *iDataUtils, aMedia );
+
+    // Update attachment list
+    iAttachmentList->AddObjectL( obj );
+    obj->SetAttachment( ETrue );
+
+    CleanupStack::Pop( obj );
+    obj->Save( aObserver, aSaveType );
+
+    return obj;
+    }
+
+// ---------------------------------------------------------
+// CUniDataModel::AddStoredAttachmentL
+// ---------------------------------------------------------
+//
+EXPORT_C CUniObject* CUniDataModel::AddStoredAttachmentL( TMsvAttachmentId aAttachmentId,
+                                                          CMsgMediaInfo* aMedia )
+    {
+    CMsvStore* store = iMtm.Entry().EditStoreL();
+    CleanupStack::PushL( store );
+
+    MMsvAttachmentManager& manager = store->AttachmentManagerL();
+    MMsvAttachmentManagerSync& managerSync = store->AttachmentManagerExtensionsL();
+    CMsvAttachment* attachment = manager.GetAttachmentInfoL( aAttachmentId );
+    CleanupStack::PushL( attachment );
+
+    CUniObject* obj = CUniObject::NewLC( iFs, iMtm, *iDataUtils, aMedia, manager, *attachment );
+
+    managerSync.ModifyAttachmentInfoL( attachment );
+    CleanupStack::Pop( 2, attachment ); //obj, attachment
+    CleanupStack::PushL( obj );
+    store->CommitL();
+
+    // Update attachment list
+    iAttachmentList->AddObjectL( obj );
+    obj->SetAttachment( ETrue );
+
+    CleanupStack::Pop( obj );
+    CleanupStack::PopAndDestroy( store );
+    return obj;
+    }
+
+// ---------------------------------------------------------
+// CUniDataModel::FinalizeMediaParse
+// ---------------------------------------------------------
+//
+EXPORT_C void CUniDataModel::FinalizeMediaParse()
+    {
+    while ( iObjectToParse )
+        {
+        if ( !iObjWait.IsStarted() )
+            {
+            iObjWait.Start();
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniDataModel::MediaInfoParsed
+// ---------------------------------------------------------
+//
+void CUniDataModel::MediaInfoParsed()
+    {
+    if ( iObjectToParse->MediaInfo()->Corrupt() )
+        {
+        iObjectToParse->SetCorrupted( ETrue );
+        }
+    ParseNextObject();
+    if ( iObjWait.IsStarted() )
+        {
+        iObjWait.AsyncStop();
+        }
+  //  CActiveScheduler::Stop();
+    }
+
+// ---------------------------------------------------------
+// CUniDataModel::ParseNextObject
+// ---------------------------------------------------------
+//
+void CUniDataModel::ParseNextObject()
+    {
+    CUniObjectList* list = iObjectList;
+
+    while ( list )
+        {
+        for ( TInt i = 0; i < list->Count(); ++i )
+            {
+            iObjectToParse = list->GetByIndex( i );
+            if ( !iObjectToParse->MediaInfo()->Parsed() &&
+                 !iObjectToParse->MediaInfo()->ParseError() )
+                {
+                RFile file;
+                TRAPD( error, file = iDataUtils->GetAttachmentFileL( iMtm, iObjectToParse->AttachmentId() ) );
+
+                if ( error == KErrNone )
+                    {
+                    iObjectToParse->MediaInfo()->ParseInfoDetails( file, *( iMediaResolver->DRMHelper() ), *this );
+                   // CActiveScheduler::Start();
+                    file.Close();
+                    return;
+                    }
+                else
+                    {
+                    iObjectToParse->SetCorrupted( ETrue );
+                    file.Close();
+                    }
+                }
+            }
+        if ( list == iObjectList )
+            {
+            list = iAttachmentList;
+            }
+        else
+            {
+            list = NULL;
+            }
+        }
+   iObjectToParse = NULL;
+   }
+
+// ---------------------------------------------------------
+// CUniDataModel::ParseFileCompleteL
+// ---------------------------------------------------------
+//
+void CUniDataModel::ParseFileCompleteL()
+    {
+    TRAPD( err, DoParseFileCompleteL() );
+    FinalizeRestoreL( err );
+    }
+
+// ---------------------------------------------------------
+// CUniDataModel::DoParseFileCompleteL
+// ---------------------------------------------------------
+//
+void CUniDataModel::DoParseFileCompleteL()
+    {
+    iDom = iParser->DetachXMLDoc();
+    iSmilType = UniSmilUtils::GetSmilTypeL( iDom );
+    if ( iSmilType == ENoSmil )
+        {
+        iParseResult = iSmilModel->ParseL( NULL );
+        }
+    else if ( iSmilType == EMmsSmil )
+        {
+        TRAPD( err, ( iParseResult = iSmilModel->ParseL( iDom ) ) );
+        if ( err )
+            {
+            iSmilType = E3GPPSmil;
+            iParseResult = 0;
+            FindDomObjectRefCountsL();
+            }
+        }
+    else
+        {
+        FindDomObjectRefCountsL();
+        }
+    }
+
+
+// ---------------------------------------------------------
+// CUniDataModel::FinalizeRestoreL
+// ---------------------------------------------------------
+//
+void CUniDataModel::FinalizeRestoreL( TInt aError )
+    {
+    if ( !aError )
+        {
+        // Won't leave.
+        FindAttachmentsL();
+        }
+    iObserver->RestoreReady( iParseResult, aError );
+
+    ParseNextObject();
+    
+    if ( iObjWait.IsStarted() )
+        {
+        iObjWait.AsyncStop();
+        }
+    
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::FindAttachmentsL
+//
+//
+// ---------------------------------------------------------
+//
+void CUniDataModel::FindAttachmentsL()
+    {
+    for ( TInt i = iObjectList->Count(); --i >= 0; )
+        {
+        CUniObject* obj = iObjectList->GetByIndex( i );
+        if ( !obj->ReferenceCount() )
+            {
+            //don't remove from store -> cannot leave
+            iObjectList->RemoveObjectL( obj, EFalse );
+            iAttachmentList->AddObjectL( obj );
+            obj->SetAttachment( ETrue );
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// FindAndHandleCorruptL
+//
+// ---------------------------------------------------------
+void CUniDataModel::FindAndHandleCorruptL( TBool aRemoveCorrupted )
+    {
+    CMsvEntrySelection* corSel = FindCorruptLC();
+    iCorruptedCount = corSel->Count();
+
+    if ( iCorruptedCount > 0 )
+        {
+        if ( aRemoveCorrupted )
+            {
+            CMsvStore* store = iMtm.Entry().EditStoreL();
+            CleanupStack::PushL( store );
+            MMsvAttachmentManager& manager = store->AttachmentManagerL();
+            MMsvAttachmentManagerSync& managerSync = store->AttachmentManagerExtensionsL();
+
+            for (TInt i = iCorruptedCount; --i >= 0 ;)
+                {
+                // Editor tries to recover by deleting corrupted ones
+                // Note: This means that SMIL parsing will fail with ESmil_Missing_Objects.
+                //       and object order is not maintained. But better to do it this
+                //       way so that message can be opened.
+                TRAP_IGNORE ( managerSync.RemoveAttachmentL(
+                    CUniDataUtils::IndexPositionOfAttachmentL( manager, corSel->At( i ) ) ) );
+                }
+            store->CommitL();
+            CleanupStack::PopAndDestroy( store );
+            }
+        else
+            {
+            // In viewer case consider message corrupted and leave.
+            // Model not made viewer should exit.
+            User::Leave( KErrCorrupt );
+            }
+        }
+
+    CleanupStack::PopAndDestroy( corSel );
+    }
+
+// ---------------------------------------------------------
+// FindCorruptLC
+//
+// ---------------------------------------------------------
+CMsvEntrySelection* CUniDataModel::FindCorruptLC()
+    {
+    CMsvEntrySelection* corrupts = new(ELeave) CMsvEntrySelection();
+    CleanupStack::PushL( corrupts );
+
+    if ( iMtm.Entry().HasStoreL() )
+    	{
+        CMsvStore* store = iMtm.Entry().ReadStoreL();
+        CleanupStack::PushL( store );
+        MMsvAttachmentManager& manager = store->AttachmentManagerL();
+
+        TInt count = manager.AttachmentCount();
+        for( TInt i = count; --i >= 0; )
+            {
+            CMsvAttachment* atta = manager.GetAttachmentInfoL( i );
+            TMsvAttachmentId attaId = atta->Id();
+            delete atta;
+
+            RFile attaFile;
+            TRAPD( err, attaFile = manager.GetAttachmentFileL( attaId ) );
+            // if error, hardly no need to close
+            attaFile.Close();
+            if ( err )
+                {
+                corrupts->AppendL( attaId );
+                }
+            }
+
+        CleanupStack::PopAndDestroy( store );
+    	}
+    return corrupts;
+    }
+
+// ---------------------------------------------------------
+// CreateObjectFromAttachmentLC
+//
+// ---------------------------------------------------------
+CUniObject* CUniDataModel::CreateObjectFromAttachmentLC(
+                            const TPtrC8&               aMimeType,
+                            RFile&                      aFile,
+                            MMsvAttachmentManager&      aManager,
+                            CMsvAttachment&             aAttachment )
+    {
+    // Linked attachments are handles similarly as ordinary ones.
+    CUniObject* object = NULL;
+    CMsgMediaInfo* info = NULL;
+    if ( aMimeType.CompareF( KMsgMimeTextPlain ) == 0 )
+        {
+        TDataType mimeType( aMimeType );
+        info = iMediaResolver->CreateMediaInfoL( aFile, mimeType );
+        }
+    else
+        {
+        info = iMediaResolver->CreateMediaInfoL( aFile );
+        }
+
+    if ( info->MediaType() == EMsgMediaText ||
+         info->MediaType() == EMsgMediaXhtml )
+        {
+        object = CUniTextObject::NewLC(
+            iFs,
+            iMtm,
+            *iDataUtils,
+            static_cast< CMsgTextInfo* >( info ),
+            aManager,
+            aAttachment );
+        }
+    else
+        {
+        object = CUniObject::NewLC(
+            iFs,
+            iMtm,
+            *iDataUtils,
+            info,
+            aManager,
+            aAttachment );
+        }
+    // Media info is to be parsed asynchronously!
+
+    return object;
+    }
+
+// ---------------------------------------------------------
+// GetDomObjectRefCounts
+//
+// ---------------------------------------------------------
+void CUniDataModel::FindDomObjectRefCountsL()
+    {
+    CMDXMLNode* node = iDom->DocumentElement()->FirstChild();
+    CUniObject* obj = NULL;
+
+    while ( node )
+        {
+        if ( UniSmilUtils::IsMediaElem( node ) ) // Filtering of structural nodes.
+            {
+            obj = iObjectList->GetByNodeL( node );
+            if ( obj )
+                {
+                obj->SetReferenceCount( obj->ReferenceCount() + 1 );
+                }
+
+            }
+        node = UniSmilUtils::NextNode( node );
+        }
+
+    }
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/src/UniDataUtils.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,250 @@
+/*
+* 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: 
+*           Data utility class for UniEditor & MMS related editors and viewers
+*
+*
+*/
+
+
+// ========== INCLUDE FILES ================================
+
+#include <e32std.h>
+#include <e32base.h>
+#include <f32file.h>
+#include <data_caging_path_literals.hrh>
+
+#include <bautils.h>
+
+#include <mtclbase.h>
+#include <msvstore.h>
+#include <mmsvattachmentmanager.h>
+#include <cmsvattachment.h>
+#include <cmsvmimeheaders.h>
+
+#include <StringLoader.h>           // for StringLoader (load and foramt strings from resources)
+#include <CommonContentPolicy.h>
+
+#include <UniDataModel.rsg>           // Viewer/Editor Mimetype strings
+
+#include "UniModelConst.h"
+#include "UniDataUtils.h"
+#include "msgtextutils.h"
+#include "MsgMimeTypes.h"
+
+// ========== LOCAL CONSTANTS AND MACROS ===================
+
+const TInt KTextBufferMaxSize( 256 );   // Max size for string read from resources.
+                                        // NOTE: This is 256 unicode chars, too.
+
+// ========== MEMBER FUNCTIONS =============================
+
+
+// ---------------------------------------------------------
+// CUniDataUtils::NewL
+// ---------------------------------------------------------
+//
+EXPORT_C CUniDataUtils* CUniDataUtils::NewL( RFs& aFs )
+    {
+    CUniDataUtils* data = new ( ELeave ) CUniDataUtils( aFs );
+    CleanupStack::PushL( data );
+    data->ConstructL();
+    CleanupStack::Pop( data );
+    return data;
+    }
+
+
+// ---------------------------------------------------------
+// CUniDataUtils::CUniDataUtils
+//
+// Constructor
+// ---------------------------------------------------------
+//
+CUniDataUtils::CUniDataUtils( RFs& aFs )
+    : iFs( aFs )
+    {
+    }
+
+
+// ---------------------------------------------------------
+// CUniDataUtils::ConstructL
+// ---------------------------------------------------------
+//
+void CUniDataUtils::ConstructL()
+    {
+    RegisterDataL();
+    iTextUtils = CMsgTextUtils::NewL( iFs );
+    }
+
+// ---------------------------------------------------------
+// CUniDataUtils::~CUniDataUtils
+//
+// Destructor.
+// ---------------------------------------------------------
+//
+CUniDataUtils::~CUniDataUtils()
+    {
+    delete iDefaultFileName;
+    delete iEmptyPageString;
+    delete iTextUtils;
+    }
+
+// ---------------------------------------------------------
+// CUniDataUtils::CharconvIdToMibIdL
+// ---------------------------------------------------------
+//
+EXPORT_C TUint CUniDataUtils::CharconvIdToMibIdL( TUint aCharconvCharsetId )
+    {
+    return iTextUtils->CharconvIdToMibIdL( aCharconvCharsetId );
+    }
+
+// ---------------------------------------------------------
+// CUniDataUtils::MibIdToCharconvIdL
+// ---------------------------------------------------------
+//
+EXPORT_C TUint CUniDataUtils::MibIdToCharconvIdL( TUint aMibId )
+    {
+    return iTextUtils->MibIdToCharconvIdL( aMibId );
+    }
+
+// ---------------------------------------------------------
+// CUniDataUtils::UTF8Size
+// ---------------------------------------------------------
+EXPORT_C TInt CUniDataUtils::UTF8Size( TPtrC aText )
+    {
+    return CMsgTextUtils::UTF8Size( aText );
+    }
+
+// ---------------------------------------------------------
+// CUniDataUtils::RegisterDataL
+//
+// Registers data
+// ---------------------------------------------------------
+//
+void CUniDataUtils::RegisterDataL()
+    {
+    TFileName fileName;
+    TParse parse;
+    parse.Set( KUniDataModelResourceFilename, &KDC_RESOURCE_FILES_DIR, NULL );
+    fileName = parse.FullName();
+
+    BaflUtils::NearestLanguageFile( iFs, fileName );
+
+    RResourceFile resourceFile;
+    resourceFile.OpenL( const_cast<RFs&>( iFs ), fileName );
+    resourceFile.ConfirmSignatureL( KDefResFileSignature );
+    CleanupClosePushL( resourceFile );
+
+    iDefaultFileName = ReadResStringL( resourceFile, R_MMDU_DEFAULT_FILE_NAME );
+    iEmptyPageString = ReadResStringL( resourceFile, R_MMDU_EMPTY_SLIDE );
+
+    CleanupStack::PopAndDestroy( &resourceFile );
+    }
+
+
+// ---------------------------------------------------------
+// CUniDataUtils::ReadResStringL
+//
+// Read single string.
+// ---------------------------------------------------------
+//
+HBufC* CUniDataUtils::ReadResStringL( const RResourceFile& aResourceFile, TInt aSrcResId )
+    {
+    HBufC* readBuf = HBufC::NewLC( KTextBufferMaxSize );
+    TPtr8 readBuffer( (TText8*) readBuf->Ptr(), KTextBufferMaxSize * 2 );
+    aResourceFile.ReadL(readBuffer, (0x00000fff & aSrcResId) ); // Remove offset from id
+
+    if ( readBuffer.Length() != 0 )
+        {
+        readBuf->Des().SetLength((readBuffer.Length()+1)>>1);
+        }
+
+    CleanupStack::Pop( readBuf );
+    return readBuf;
+    }
+
+// ---------------------------------------------------------
+// FileSizeL
+// ---------------------------------------------------------
+EXPORT_C TInt CUniDataUtils::FileSizeL( const TFileName& aFileName )
+    {
+    TInt size(0);
+    RFile file;
+
+    TInt err = file.Open( iFs, aFileName, EFileShareAny );
+    if ( err == KErrAccessDenied || err == KErrInUse )
+        {
+        err = file.Open( iFs, aFileName, EFileShareReadersOnly );
+        }
+    if ( err == KErrNone )
+        {
+        file.Size( size );
+        }
+    else
+        {
+        file.Close();
+        User::Leave( err );
+        }
+
+    file.Close();
+    return size;
+    }
+
+// ---------------------------------------------------------
+// CUniObject::GetAttachmentFileL
+// ---------------------------------------------------------
+//
+EXPORT_C RFile CUniDataUtils::GetAttachmentFileL( CBaseMtm& aMtm, TMsvAttachmentId aId )
+    {
+    RFile file;
+    CMsvStore* store = aMtm.Entry().ReadStoreL();
+    CleanupStack::PushL( store );
+    MMsvAttachmentManager& manager = store->AttachmentManagerL();
+    file = manager.GetAttachmentFileL( aId );
+    CleanupStack::PopAndDestroy( store );
+
+    return file;
+    }
+
+// ---------------------------------------------------------
+// CUniObject::IndexPositionOfAttachmentL
+// ---------------------------------------------------------
+//
+EXPORT_C TInt CUniDataUtils::IndexPositionOfAttachmentL(
+        MMsvAttachmentManager& aManager,
+        TMsvAttachmentId aId )
+	{
+    TInt count = aManager.AttachmentCount();
+	TInt foundPosition = KErrNotFound;
+
+    for ( TInt i = 0; i < count; ++i )
+        {
+        CMsvAttachment* attachment = aManager.GetAttachmentInfoL( i );
+        TMsvAttachmentId id = attachment->Id();
+        delete attachment;
+        if ( id == aId )
+            {
+            foundPosition = i;
+            break;
+            }
+        }
+
+	// Leave with KErrNotFound if the attachment id is not found
+	User::LeaveIfError( foundPosition );
+
+	// return the index position of attachment
+	return foundPosition;
+	}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/src/UniDrmInfo.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,599 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*       CUniDrmInfo, Storage for single attachment in presentation.
+*
+*
+*/
+
+
+// ========== INCLUDE FILES ================================
+
+#include <e32def.h>     // for basic types
+#include <eikenv.h>     // for CBase
+#include <coemain.h>    // for CEikonEnv
+#include <mtclbase.h>   // for CBaseMtm
+#include <msvids.h>     // for KMsvTempIndexEntryId
+#include <msvstore.h>
+#include <mmsvattachmentmanager.h>
+#include <mmsvattachmentmanagersync.h>
+#include <cmsvattachment.h>
+
+// Features
+#include <featmgr.h>
+#include <bldvariant.hrh>
+
+// DRM
+#ifndef DRMCOMMONIN_POISTO
+#include <DRMCommon.h>
+#endif
+
+#include <DRMHelper.h>
+
+#include <MsgMediaInfo.h>
+#include <MsgTextInfo.h>
+
+#include "UniModelConst.h"
+#include "UniMimeInfo.h"
+#include "UniDrmInfo.h"
+#include "UniObject.h"
+#include "UniDataUtils.h"
+
+//#include "UniEditorLogging.h"
+#include "fileprotectionresolver.h"
+#include "MsgMimeTypes.h"
+
+// ========== EXTERNAL DATA STRUCTURES =====================
+
+// ========== EXTERNAL FUNCTION PROTOTYPES =================
+
+// ========== CONSTANTS ====================================
+
+// ========== MACROS =======================================
+
+// ========== LOCAL CONSTANTS AND MACROS ===================
+
+// ========== MODULE DATA STRUCTURES =======================
+
+
+// ========== LOCAL FUNCTION PROTOTYPES ====================
+
+// ========== LOCAL FUNCTIONS ==============================
+
+// ========== MEMBER FUNCTIONS =============================
+
+// ---------------------------------------------------------
+// CUniDrmInfo::NewLC
+//
+// Factory method.
+// ---------------------------------------------------------
+//
+EXPORT_C CUniDrmInfo* CUniDrmInfo::NewLC( RFs& aFs,
+                                          CBaseMtm& aMtm,
+                                          TMsvAttachmentId& aId,
+                                          CMsgMediaInfo& aMediaInfo )
+    {
+    CUniDrmInfo* self =  new ( ELeave ) CUniDrmInfo( aFs, aMtm, aId, aMediaInfo );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CUniDrmInfo::NewL
+//
+// Factory method.
+// ---------------------------------------------------------
+//
+EXPORT_C CUniDrmInfo* CUniDrmInfo::NewL( RFs& aFs,
+                                         CBaseMtm& aMtm,
+                                         TMsvAttachmentId& aId,
+                                         CMsgMediaInfo& aMediaInfo )
+    {
+    CUniDrmInfo* self = NewLC( aFs, aMtm, aId, aMediaInfo );
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CUniDrmInfo::CUniDrmInfo
+//
+// Constructor.
+// ---------------------------------------------------------
+//
+CUniDrmInfo::CUniDrmInfo( RFs& aFs,
+                          CBaseMtm& aMtm,
+                          TMsvAttachmentId& aId,
+                          CMsgMediaInfo& aMediaInfo ) :
+    iFs( aFs ),
+    iMtm( aMtm ),
+    iAttachmentId( aId ),
+    iMediaInfo( aMediaInfo ),
+    iDRMConsumeStatus( EUniDRMNone ),
+    iDRMConsumeCount( 0 ),
+    iDRMRightsExist( ETrue ), //Rights ok by default
+    iDRMExpiration( CDRMRights::EValidRights ),
+    iDRMRestriction( CDRMRights::EFullRights ),
+    iDRMConstraintType( CDRMRights::ENoConstraints )
+    {
+    }
+
+// ---------------------------------------------------------
+// CUniDrmInfo::CUniDrmInfo
+//
+// Destructor.
+// ---------------------------------------------------------
+//
+CUniDrmInfo::~CUniDrmInfo()
+    {
+    ReleaseRights();
+    delete iDRMHelper;
+
+#ifdef DRMCOMMONIN_POISTO
+    delete iRightsManager;
+#else
+    delete iDRMCommon;
+#endif
+
+    delete iSendContentUrl;
+    }
+
+// ---------------------------------------------------------
+// CUniDrmInfo::ConstructL
+//
+// 2nd phase constructor.
+// ---------------------------------------------------------
+//
+void CUniDrmInfo::ConstructL()
+    {
+    if ( !iMediaInfo.DRMContentURI()->Length() )
+        {
+        User::Leave( KErrNotSupported );
+        }
+
+    // Get supported features from feature manager.
+/*
+    FeatureManager::InitializeLibL();
+    if ( FeatureManager::FeatureSupported( KFeatureIdDrmFull ) )
+        {
+        iSupportedFeatures |= EUniFeatureDrmFull;
+        }
+    FeatureManager::UnInitializeLib();
+*/
+
+#ifdef DRMCOMMONIN_POISTO
+
+    // Seems pretty heavy. Should be done only once by e.g. Document
+    // and a reference should be passed as an input parameter?
+    CManager* manager = CManager::NewLC();
+
+    RArray<TAgent> agents;
+    manager->ListAgentsL( agents );
+    CleanupClosePushL( agents );
+
+    for ( TInt i = 0; !iRightsManager && i < agents.Count(); ++i )
+        {
+        if ( agents[ i ].Name().Compare( KOmaDrm2AgentName ) == 0 )
+            {
+            iRightsManager = manager->CreateRightsManagerL( agents[ i ] );
+            }
+        }
+
+    CleanupStack::PopAndDestroy( 2, manager ); // agents, manager
+
+    if ( !iRightsManager )
+        {
+        User::Leave( KErrNotFound );
+        }
+
+#else // DRMCOMMONIN_POISTO
+
+    iDRMCommon = DRMCommon::NewL();
+
+#endif // DRMCOMMONIN_POISTO
+
+    iDRMHelper = CDRMHelper::NewL( *CEikonEnv::Static( ), iFs );
+    DoGetRightsInfoL();
+
+    // Check it here that image count is rights.
+    // When image is displayed, use count is already decremented.
+    SetIsDrmWithOnePreviewL();
+
+    TInt drmMethods;
+    CDRMHelper::TDRMHelperOMALevel omaLevel;
+    iDRMHelper->SupportedDRMMethods2( drmMethods, omaLevel );
+    iOma2 = ( omaLevel == CDRMHelper::EOMA_2_0 ? ETrue : EFalse );
+    }
+
+// ---------------------------------------------------------
+// CUniDrmInfo::DoGetRightsInfoL
+// ---------------------------------------------------------
+//
+void CUniDrmInfo::DoGetRightsInfoL( CDRMRights** /*aRightsObj*/ )
+    {
+/*
+    if ( iSupportedFeatures & EUniFeatureDrmFull )
+        {
+        CDRMRights* rightsObj = NULL;
+        TInt rightSpec = ConsumeIntent();
+
+#ifdef DRMCOMMONIN_POISTO
+
+        MAgentRightsBase* cafRights = NULL;
+        RStreamablePtrArray<CRightsInfo> rights;
+
+        // Copy to 16-bit buffer
+        // TODO: Is this really the correct parameter to give to ListRightsL?!
+        HBufC* temp = HBufC::NewLC( iMediaInfo.DRMContentURI()->Length() );
+        TPtr ptr = temp->Des();
+        ptr.Copy( *iMediaInfo.DRMContentURI() );
+
+        iRightsManager->ListRightsL( rights, *temp );
+
+        CleanupStack::PopAndDestroy( temp );
+        if ( rights.Count() )
+            {
+            // The active RO is the first one in the list
+            //CRightsInfo* rightsInfo = rights[0]->AllocL();
+            CRightsInfo* rightsInfo = rights[ 0 ];
+            cafRights = iRightsManager->GetRightsDataL( *rightsInfo );
+            rightsObj = reinterpret_cast<CDRMRights*>( cafRights );
+            rightsObj->GetRightsInfo(
+                rightSpec,
+                iDRMRestriction,
+                iDRMExpiration,
+                iDRMConstraintType );
+            iDRMRightsExist = ETrue;
+            }
+        else
+            {
+            iDRMRightsExist = EFalse;
+            }
+        rights.ResetAndDestroy();
+
+#else // DRMCOMMONIN_POISTO
+
+        TInt restriction = iDRMCommon->GetActiveRights(
+            *iMediaInfo.DRMContentURI(),
+            rightSpec,
+            rightsObj );
+
+        if ( restriction == CDRMRights::ENoRights ||
+            !rightsObj )
+            {
+            iDRMRightsExist = EFalse;
+            }
+        else
+            {
+            rightsObj->GetRightsInfo(
+                rightSpec,
+                iDRMRestriction,
+                iDRMExpiration,
+                iDRMConstraintType );
+            iDRMRightsExist = ETrue;
+            }
+
+#endif // DRMCOMMONIN_POISTO
+
+        if ( aRightsObj )
+            {
+            (*aRightsObj) = rightsObj;
+            }
+        else
+            {
+            delete rightsObj;
+            }
+        }
+*/
+    }
+
+// ---------------------------------------------------------
+// CUniDrmInfo::ConsumeRights
+// ---------------------------------------------------------
+//
+EXPORT_C TInt CUniDrmInfo::ConsumeRights()
+    {
+//    UNILOGGER_ENTERFN( "CUniDrmInfo::ConsumeRights" );
+
+    TInt err( KErrNone );
+    if ( ( iMediaInfo.MediaType() == EMsgMediaAudio ||
+           ( iMediaInfo.MediaType() != EMsgMediaAudio &&
+             iDRMExpiration == CDRMRights::EValidRights ) ) &&
+         iDRMConsumeStatus != EUniDRMConsumed )
+        {
+        if ( iDRMConsumeCount )
+            {
+            //UNILOGGER_WRITE( "Rights freezed" );
+
+            // Already once consumed. Freeze is enough!
+            FreezeRights();
+            }
+        else
+            {
+            if ( iDRMConsumeStatus == EUniDRMFrozen )
+                {
+                //UNILOGGER_WRITE( "Rights released" );
+
+                ReleaseRights();
+                }
+
+            err = iDRMHelper->Consume2( iMediaInfo.DRMContentURI()->Des(),
+                                        ConsumeIntent(),
+                                        CDRMHelper::EStart );
+
+            if ( !err )
+                {
+                //UNILOGGER_WRITE( "Rights consumed" );
+
+                iDRMConsumeStatus = EUniDRMConsumed;
+                iDRMConsumeCount++;
+                }
+            }
+        }
+    // else - never consume for preview
+
+    //UNILOGGER_WRITEF( _L("Result: %d"), err );
+    //UNILOGGER_LEAVEFN( "CUniDrmInfo::ConsumeRights" );
+
+    return err;
+    }
+
+// ---------------------------------------------------------
+// CUniDrmInfo::EvaluateRights
+// ---------------------------------------------------------
+//
+EXPORT_C TInt CUniDrmInfo::EvaluateRights( TBool& aConsumed )
+    {
+    //UNILOGGER_ENTERFN( "CUniDrmInfo::EvaluateRights" );
+
+    aConsumed = ( iDRMConsumeStatus == EUniDRMConsumed ||  iDRMConsumeCount );
+
+    TInt err( KErrNone );
+
+    CData* cData = NULL;
+    TRAP_IGNORE( cData = CreateCDataL() );
+
+    if ( cData )
+        {
+        err = cData->EvaluateIntent( ConsumeIntent() );
+        delete cData;
+        }
+
+    //UNILOGGER_WRITEF( _L("Result: %d, aConsumed %d"), err, aConsumed );
+    //UNILOGGER_LEAVEFN( "CUniDrmInfo::EvaluateRights" );
+
+    return err;
+    }
+
+// ---------------------------------------------------------
+// CUniDrmInfo::FreezeRights
+// ---------------------------------------------------------
+//
+EXPORT_C TInt CUniDrmInfo::FreezeRights()
+    {
+    //UNILOGGER_ENTERFN( "CUniDrmInfo::FreezeRights" );
+
+    TInt err( KErrNone );
+    if ( ( iMediaInfo.MediaType() == EMsgMediaAudio ||
+           ( iMediaInfo.MediaType() != EMsgMediaAudio &&
+             iDRMExpiration == CDRMRights::EValidRights ) ) &&
+         iDRMConsumeStatus == EUniDRMNone )
+        {
+        err = iDRMHelper->Consume2( iMediaInfo.DRMContentURI()->Des(),
+                                    ContentAccess::EInstall,
+                                    CDRMHelper::EStart );
+
+        if ( !err )
+            {
+            //UNILOGGER_WRITE( "Rights frozen" );
+
+            iDRMConsumeStatus = EUniDRMFrozen;
+            }
+        }
+
+    //UNILOGGER_WRITEF( _L("Result: %d"), err );
+    //UNILOGGER_LEAVEFN( "CUniDrmInfo::FreezeRights" );
+
+    return err;
+    }
+
+// ---------------------------------------------------------
+// CUniDrmInfo::ReleaseRights
+// ---------------------------------------------------------
+//
+EXPORT_C TInt CUniDrmInfo::ReleaseRights()
+    {
+    //UNILOGGER_ENTERFN( "CUniDrmInfo::ReleaseRights" );
+
+    TInt err( KErrNone );
+    if ( iDRMConsumeStatus != EUniDRMNone )
+        {
+        TUint32 rightsSpec = ( iDRMConsumeStatus == EUniDRMFrozen )
+            ? ContentAccess::EInstall
+            : ConsumeIntent();
+
+        err = iDRMHelper->Consume2( iMediaInfo.DRMContentURI()->Des(),
+                                    rightsSpec,
+                                    CDRMHelper::EFinish );
+
+        //UNILOGGER_WRITE( "Rights released" );
+
+        // else - never consumed for preview
+        iDRMConsumeStatus = EUniDRMNone;
+        }
+
+    //UNILOGGER_WRITEF( _L("Result: %d"), err );
+    //UNILOGGER_LEAVEFN( "CUniDrmInfo::ReleaseRights" );
+
+    return err;
+    }
+
+// ---------------------------------------------------------
+//  CUniDrmInfo::RightsValidL
+// ---------------------------------------------------------
+//
+EXPORT_C TBool CUniDrmInfo::RightsValidL( TBool aUpdate )
+    {
+    //UNILOGGER_ENTERFN( "CUniDrmInfo::RightsValidL" );
+    //UNILOGGER_WRITEF( _L("aUpdate: %d"), aUpdate );
+
+    // By default rights are valid
+    TBool retVal = ETrue;
+    if ( aUpdate )
+        {
+        DoGetRightsInfoL();
+
+        //UNILOGGER_WRITE( "Update done" );
+        }
+
+    if ( iMediaInfo.Protection() &
+        ( EFileProtForwardLocked | EFileProtSuperDistributable ) )
+        {
+        if ( iDRMRightsExist )
+            {
+            if ( iDRMExpiration == CDRMRights::EExpiredRights ||
+                 iDRMExpiration == CDRMRights::EFutureRights )
+                {
+                // Expired or future rights
+                retVal = EFalse;
+                }
+            }
+        else
+            {
+            // No rights
+            retVal = EFalse;
+            }
+        }
+
+    //UNILOGGER_WRITEF( _L("Result: %d"), retVal );
+    //UNILOGGER_LEAVEFN( "CUniDrmInfo::RightsValidL" );
+
+    return retVal;
+    }
+
+// ---------------------------------------------------------
+// CUniDrmInfo::IsDrmWithOnePreview
+// ---------------------------------------------------------
+//
+EXPORT_C TBool CUniDrmInfo::IsDrmWithOnePreview()
+    {
+    return iDrmOnePreview;
+    }
+
+// ---------------------------------------------------------
+// CUniDrmInfo::SetIsDrmWithOnePreviewL
+// ---------------------------------------------------------
+//
+void CUniDrmInfo::SetIsDrmWithOnePreviewL()
+    {
+/*
+    iDrmOnePreview = EFalse;
+    if ( !( iSupportedFeatures & EUniFeatureDrmFull ) )
+        {
+        return;
+        }
+
+    // Check only object list. Attachments are left for
+    // dedicated attachment handler's responsibility.
+    CDRMRights* rights = NULL;
+    DoGetRightsInfoL(&rights);
+
+    if ( rights &&
+         iDRMRightsExist &&
+         !( iDRMConstraintType ^ CDRMRights::ECountBased ) &&   // only ECountBased bit set
+         iMediaInfo.Protection() & EFileProtForwardLocked )
+        {
+        // must get count still
+        // no leaving functions in this function
+        CDRMRightsConstraints* constraint = NULL;
+        TMsgMediaType mediaType = iMediaInfo.MediaType();
+
+        if ( mediaType == EMsgMediaImage ||
+             mediaType == EMsgMediaSvg )
+            {
+            rights->GetDisplayRight( constraint );
+            }
+        else if ( mediaType == EMsgMediaAudio ||
+                  mediaType == EMsgMediaVideo )
+            {
+            rights->GetPlayRight( constraint );
+            }
+
+        if ( constraint &&
+             constraint->IsPreview() )
+            {
+            TUint32 origCount = 0;
+            TUint32 nowCount = 0;
+            constraint->GetCounters( nowCount,  origCount);
+
+            if ( nowCount == 1 )
+                {
+                iDrmOnePreview = ETrue;
+                }
+            }
+
+        delete constraint;
+        }
+
+    delete rights;
+*/
+    }
+
+
+// ---------------------------------------------------------
+// CUniDrmInfo::CreateCDataL
+// ---------------------------------------------------------
+//
+CData* CUniDrmInfo::CreateCDataL()
+    {
+    CData* result = NULL;
+
+    if ( iMediaInfo.DRMContentURI() )
+        {
+        // depends on iAttachmentId
+        RFile attachmentFile = CUniDataUtils::GetAttachmentFileL( iMtm, iAttachmentId );
+        CleanupClosePushL( attachmentFile );
+
+        result = CData::NewL( attachmentFile,
+                              KDefaultContentObject,
+                              EPeek );
+
+        CleanupStack::PopAndDestroy( &attachmentFile );
+        }
+
+    return result;
+    }
+
+// ---------------------------------------------------------
+// CUniDrmInfo::HandleDrmErrorL
+// ---------------------------------------------------------
+//
+EXPORT_C void CUniDrmInfo::HandleDrmErrorL( TInt aError )
+    {
+    if ( iDRMHelper )
+        {
+        RFile attachmentFile = CUniDataUtils::GetAttachmentFileL( iMtm, iAttachmentId );
+        CleanupClosePushL( attachmentFile );
+
+        iDRMHelper->HandleErrorL(   aError,
+                                    attachmentFile );
+        CleanupStack::PopAndDestroy( &attachmentFile );
+        }
+    }
+
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/src/UniMimeInfo.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,338 @@
+/*
+* 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: 
+*       CUniMimeInfo, Storage for objects mime headers.
+*
+*
+*/
+
+
+// ========== INCLUDE FILES ================================
+
+#include <e32def.h>     // for basic types
+#include <eikenv.h>     // for CBase
+#include <msvstd.h>     // for TMsvId
+#include <msvids.h>     // for KMsvTempIndexEntryId
+
+#include <mmsvattachmentmanager.h>
+#include <cmsvattachment.h>
+#include <cmsvmimeheaders.h>
+
+#include "msgtextutils.h"
+#include "UniModelConst.h"
+#include "UniDataUtils.h"
+#include "UniMimeInfo.h"
+
+// ========== EXTERNAL DATA STRUCTURES =====================
+
+// ========== EXTERNAL FUNCTION PROTOTYPES =================
+
+// ========== CONSTANTS ====================================
+
+// Maximum num of characters for descriptors stored in HBufC members
+const TInt KMaxMimeFieldLength  = 260;
+const TInt KMaxContentLocation  = 100; // Max byte size for content location
+
+// From RFC2183. Content-Disposition filename max length.
+// Does not need special handling.
+//const TInt KMaxMimeFieldParamLength = 78;
+
+// ========== MACROS =======================================
+
+// ========== LOCAL CONSTANTS AND MACROS ===================
+
+// ========== MODULE DATA STRUCTURES =======================
+
+
+// ========== LOCAL FUNCTION PROTOTYPES ====================
+
+// ========== LOCAL FUNCTIONS ==============================
+
+// ========== MEMBER FUNCTIONS =============================
+
+
+// ---------------------------------------------------------
+// CUniMimeInfo
+//
+// Constructor
+// ---------------------------------------------------------
+//
+CUniMimeInfo::CUniMimeInfo() : iContentTypeCharset(0)
+    {
+    }
+
+// ---------------------------------------------------------
+// CUniMimeInfo
+//
+// Destructor.
+// ---------------------------------------------------------
+//
+CUniMimeInfo::~CUniMimeInfo()
+    {
+    delete iContentDescription;
+    delete iContentBase;
+    delete iContentLocation;
+    delete iContentId;
+    delete iContentType;
+    delete iContentDisposition;
+    }
+
+
+// ---------------------------------------------------------
+// Accessors/Mutators
+// ---------------------------------------------------------
+
+// ---------------------------------------------------------
+// SetContentTypeL
+// NOTE: 8 bit.
+// ---------------------------------------------------------
+void CUniMimeInfo::SetContentTypeL( const TDesC8& aSourceDesc )
+    {
+    if ( aSourceDesc.Length() > KMaxMimeFieldLength )
+        User::Leave( KErrArgument );
+
+    HBufC8* buf = aSourceDesc.AllocL();
+    delete iContentType;
+    iContentType = buf;
+    }
+
+// ---------------------------------------------------------
+// SetContentLocationL
+// NOTE: 16 bit.
+// ---------------------------------------------------------
+void CUniMimeInfo::SetContentLocationL( const TDesC& aSourceDesc )
+    {
+    TInt copyLen = aSourceDesc.Length();
+    if ( copyLen > KMaxContentLocation )
+        {
+        copyLen = KMaxContentLocation;
+        }
+
+    HBufC* buf = HBufC::NewL( copyLen );
+    *buf = aSourceDesc.Left( copyLen );
+    delete iContentLocation;
+    iContentLocation = buf;
+    }
+
+// ---------------------------------------------------------
+// SetContentIdL
+// NOTE: 8 bit.
+// ---------------------------------------------------------
+void CUniMimeInfo::SetContentIdL( const TDesC8& aSourceDesc )
+    {
+    if ( aSourceDesc.Length() > KMaxMimeFieldLength )
+        User::Leave( KErrArgument );
+
+    HBufC8* buf = aSourceDesc.AllocL();
+    delete iContentId;
+    iContentId = buf;
+    }
+
+// ---------------------------------------------------------
+// SetContentBaseL
+// NOTE: 8 bit.
+// ---------------------------------------------------------
+void CUniMimeInfo::SetContentBaseL( const TDesC8& aSourceDesc )
+    {
+    if ( aSourceDesc.Length() > KMaxMimeFieldLength )
+        User::Leave( KErrArgument );
+
+    HBufC8* buf = aSourceDesc.AllocL();
+    delete iContentBase;
+    iContentBase = buf;
+    }
+
+// ---------------------------------------------------------
+// SetContentDescriptionL
+// NOTE: 8 bit.
+// ---------------------------------------------------------
+void CUniMimeInfo::SetContentDescriptionL( const TDesC8& aSourceDesc )
+    {
+    if ( aSourceDesc.Length() > KMaxMimeFieldLength )
+        User::Leave( KErrArgument );
+
+    HBufC8* buf = aSourceDesc.AllocL();
+    delete iContentDescription;
+    iContentDescription = buf;
+    }
+
+// ---------------------------------------------------------
+// SetContentDispositionL
+// NOTE: 8 bit.
+// ---------------------------------------------------------
+void CUniMimeInfo::SetContentDispositionL( const TDesC8& aSourceDesc )
+    {
+    if ( aSourceDesc.Length() > KMaxMimeFieldLength )
+        User::Leave( KErrArgument );
+
+    HBufC8* buf = aSourceDesc.AllocL();
+    delete iContentDisposition;
+    iContentDisposition = buf;
+    }
+
+// ---------------------------------------------------------
+// Size
+// ---------------------------------------------------------
+TInt CUniMimeInfo::Size() const
+    {
+    // TODO: Check that MIME info size matches to the actual
+    //       MIME header size
+    //TInt size = sizeof( iContentTypeCharset );
+    TInt size = sizeof( TUint32 ); // mmsengine uses this
+
+    if ( iContentDescription ) size += iContentDescription->Size();
+
+    if ( iContentBase ) size += iContentBase->Size();
+
+    if ( iContentLocation ) size += iContentLocation->Size();
+
+    if ( iContentId ) size += iContentId->Size();
+
+    if ( iContentType ) size += iContentType->Size();
+
+    if ( iContentDisposition ) size += iContentDisposition->Size();
+
+    return size;
+    }
+
+// ---------------------------------------------------------
+// CUniMimeInfo::SaveMimeInfoL
+//
+// Save MIME info
+// ---------------------------------------------------------
+//
+void CUniMimeInfo::SaveMimeInfoL( MMsvAttachmentManager& aManager, CMsvAttachment& aAttachment )
+    {
+    // Content-Location.
+    HBufC* safeContentLocation = CMsgTextUtils::GetSafeAttachmentNameLC(
+        aManager,
+        ContentLocation(),
+        aAttachment.Id(),
+        ETrue );
+    SetContentLocationL( *safeContentLocation );
+    CleanupStack::PopAndDestroy( safeContentLocation );
+
+    CMsvMimeHeaders* msvMime = CMsvMimeHeaders::NewLC();
+    msvMime->RestoreL( aAttachment );
+
+    msvMime->SetContentLocationL( *iContentLocation );
+
+    // Content-type
+    if ( iContentType )
+        {
+        TInt slash = iContentType->Locate( '/' );
+        if ( slash != KErrNotFound )
+            {
+            msvMime->SetContentTypeL( iContentType->Left( slash ) );
+            msvMime->SetContentSubTypeL( iContentType->Mid( slash + 1 ) );
+            }
+        }
+
+    // Character set
+    if ( iContentTypeCharset )
+        {
+        msvMime->SetMimeCharset( iContentTypeCharset );
+        }
+    // Content-Id
+    if ( iContentId && iContentId->Length() )
+        {
+        msvMime->SetContentIdL( *iContentId );
+        }
+    // Content-Description
+    if ( iContentDescription && iContentDescription->Length() )
+        {
+        msvMime->SetContentDescriptionL( *iContentDescription );
+        }
+    // Content-Base
+    if ( iContentBase && iContentBase->Length() )
+        {
+        msvMime->SetContentBaseL( *iContentBase );
+        }
+    // Content-Disposition
+    if ( iContentDisposition && iContentDisposition->Length() )
+        {
+        msvMime->SetContentDispositionL( *iContentDisposition );
+        }
+    msvMime->StoreL( aAttachment );
+    CleanupStack::PopAndDestroy( msvMime );
+    }
+
+// ---------------------------------------------------------
+// CUniMimeInfo::DoReadMimeInfoL
+//
+// Reads mime info from clientMtm to aMimeInfo.
+// If function leaves whole MimeInfo object should be considered
+// invalid.
+// ---------------------------------------------------------
+//
+
+void CUniMimeInfo::ReadMimeInfoL( CMsvAttachment& aAttachment )
+    {
+    CMsvMimeHeaders* msvMime = CMsvMimeHeaders::NewLC();
+    msvMime->RestoreL( aAttachment );
+
+    // Content-Location
+    SetContentLocationL( msvMime->ContentLocation() );
+
+    // Content-ID
+    SetContentIdL( msvMime->ContentId() );
+
+    TBuf8<KMaxDataTypeLength> contentType;
+    contentType.Copy( msvMime->ContentType() );
+    contentType.Append( _L8("/") );
+    contentType.Append( msvMime->ContentSubType() );
+    // Content-type
+    SetContentTypeL( contentType );
+
+    // Character set
+    SetCharset( msvMime->MimeCharset() );
+
+    // Content-Description
+    SetContentDescriptionL( msvMime->ContentDescription() );
+
+    // Content-Base
+    SetContentBaseL( msvMime->ContentBase() );
+
+    // Content-Disposition
+    SetContentDispositionL( msvMime->ContentDisposition() );
+
+    CleanupStack::PopAndDestroy( msvMime );
+    }
+
+// ---------------------------------------------------------
+// EnsureContentLocationL
+// ---------------------------------------------------------
+void CUniMimeInfo::EnsureContentLocationL(
+    MMsvAttachmentManager& aManager,
+    CMsvAttachment& aAttachment,
+    TDesC& aPlainFileName )
+    {
+    if ( !ContentLocation().Length() && aPlainFileName.Length() )
+        {
+        // Generate safe content location from file name
+        HBufC* contLoc = CMsgTextUtils::GetSafeAttachmentNameLC(
+            aManager,
+            aPlainFileName,
+            aAttachment.Id(),
+            ETrue );
+        SetContentLocationL( *contLoc );
+
+        CleanupStack::PopAndDestroy( contLoc );
+
+        // Save ContentLocation.
+        SaveMimeInfoL( aManager, aAttachment );
+        }
+    }
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/src/UniObject.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,774 @@
+/*
+* 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: 
+*       CUniObject, Storage for single attachment in presentation.
+*
+*
+*/
+
+
+// ========== INCLUDE FILES ================================
+
+#include <e32def.h>     // for basic types
+#include <eikenv.h>     // for CBase
+#include <mtclbase.h>   // for CBaseMtm
+#include <msvids.h>     // for KMsvTempIndexEntryId
+#include <msvstore.h>
+#include <mmsvattachmentmanager.h>
+#include <mmsvattachmentmanagersync.h>
+#include <cmsvattachment.h>
+#include <miutmsg.h>
+
+// Features
+#include <featmgr.h>
+#include <bldvariant.hrh>
+#include <DRMNotifier.h>
+
+#include <MsgMediaInfo.h>
+#include <MsgTextInfo.h>
+
+#include "UniModelConst.h"
+#include "UniMimeInfo.h"
+#include "UniDrmInfo.h"
+#include "UniObject.h"
+#include "UniDataUtils.h"
+#include "msgtextutils.h"
+#include "MsgMimeTypes.h"
+#include "fileprotectionresolver.h"  //DRM
+#include "MuiuOperationWait.h"
+
+// ========== EXTERNAL DATA STRUCTURES =====================
+
+// ========== EXTERNAL FUNCTION PROTOTYPES =================
+
+// ========== CONSTANTS ====================================
+
+// ========== MACROS =======================================
+
+// ========== LOCAL CONSTANTS AND MACROS ===================
+
+// ========== MODULE DATA STRUCTURES =======================
+
+// ========== LOCAL FUNCTION PROTOTYPES ====================
+
+// ========== LOCAL FUNCTIONS ==============================
+
+// ========== MEMBER FUNCTIONS =============================
+
+// ---------------------------------------------------------
+// CUniObject::NewLC
+//
+// Factory method.
+// ---------------------------------------------------------
+//
+EXPORT_C CUniObject* CUniObject::NewLC( RFs& aFs,
+                                       CBaseMtm& aMtm,
+                                       CUniDataUtils& aData,
+                                       CMsgMediaInfo* aMedia,
+                                       MMsvAttachmentManager& aManager,
+                                       CMsvAttachment& aAttachment )
+    {
+    CUniObject* self =
+        new ( ELeave ) CUniObject( aFs, aMtm, aData, aMedia );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    self->ConstructFromAttachmentL( aManager, aAttachment );
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CUniObject::NewL
+//
+// Factory method.
+// ---------------------------------------------------------
+//
+EXPORT_C CUniObject* CUniObject::NewL( RFs& aFs,
+                                      CBaseMtm& aMtm,
+                                      CUniDataUtils& aData,
+                                      CMsgMediaInfo* aMedia,
+                                      MMsvAttachmentManager& aManager,
+                                      CMsvAttachment& aAttachment )
+    {
+    CUniObject* self = NewLC( aFs, aMtm, aData, aMedia, aManager, aAttachment );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CUniObject::NewLC
+//
+// Factory method.
+// ---------------------------------------------------------
+//
+EXPORT_C CUniObject* CUniObject::NewLC( RFs& aFs,
+                                       CBaseMtm& aMtm,
+                                       CUniDataUtils& aData,
+                                       CMsgMediaInfo* aMedia )
+    {
+    CUniObject* self =
+        new ( ELeave ) CUniObject( aFs, aMtm, aData, aMedia );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    self->CreateMimeInfoL();
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CUniObject::NewL
+//
+// Factory method.
+// ---------------------------------------------------------
+//
+EXPORT_C CUniObject* CUniObject::NewL( RFs& aFs,
+                                      CBaseMtm& aMtm,
+                                      CUniDataUtils& aData,
+                                      CMsgMediaInfo* aMedia )
+    {
+    CUniObject* self = NewLC( aFs, aMtm, aData, aMedia );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CUniObject::CUniObject
+//
+// Constructor.
+// ---------------------------------------------------------
+//
+CUniObject::CUniObject( RFs& aFs,
+                       CBaseMtm& aMtm,
+                       CUniDataUtils& aData,
+                       CMsgMediaInfo* aMedia ) :
+    CActive( EPriorityStandard ),
+    iFs( aFs ),
+    iMtm( aMtm ),
+    iData( aData ),
+    iAttachmentId( KMsvNullIndexEntryId ),
+    iMimeInfo( NULL ),
+    iMediaInfo( aMedia ),
+    iReferenceCount( 0 ),
+    iRegion( EUniRegionUnresolved ),
+    iMediaTypeBySmilTag( EMsgMediaUnknown ),
+    iUniqueControlHandle( KErrNotFound )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+
+// ---------------------------------------------------------
+// CUniObject::CUniObject
+//
+// Destructor.
+// ---------------------------------------------------------
+//
+CUniObject::~CUniObject()
+    {
+    Cancel();
+    if ( iDrmNotifier )
+        {
+        // When one observer left, remove
+        TRAP_IGNORE( iDrmNotifier->UnRegisterEventObserverL( *this,
+                                                            KEventAddRemove,
+                                                            *iMediaInfo->DRMContentURI() ) );
+        TRAP_IGNORE( iDrmNotifier->UnRegisterEventObserverL( *this,
+                                                KEventModify,
+                                                *iMediaInfo->DRMContentURI() ) );
+        }
+    delete iEditStore;
+    delete iDrmInfo;
+    delete iMediaInfo;
+    delete iMimeInfo;
+
+    iFileHandle.Close();
+    delete iDrmNotifier;
+    delete iObservers;
+    }
+
+// ---------------------------------------------------------
+// CUniObject::Save
+// ---------------------------------------------------------
+//
+void CUniObject::Save( MUniObjectSaveObserver& aObserver,
+                       CMsvAttachment::TMsvAttachmentType aSaveType )
+    {
+    iObserver = &aObserver;
+    iSaveType = aSaveType;
+    iSaveState = EObjectSavingIdle;
+
+    //CompleteSelf()
+    RunL();
+    }
+
+// ---------------------------------------------------------
+// CUniObject::DoSaveL
+// ---------------------------------------------------------
+//
+void CUniObject::DoSaveL()
+    {
+    switch ( iSaveState )
+        {
+        case EObjectSavingIdle:
+            {
+            StartObjectSaveL();
+            break;
+            }
+        case EObjectCreatingAttachment:
+            {
+            FinalizeObjectSaveL();
+            break;
+            }
+        default:
+            break;
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniObject::InitializeObjectSaveL
+// ---------------------------------------------------------
+//
+void CUniObject::StartObjectSaveL()
+    {
+    if ( iAttachmentId != KMsvNullIndexEntryId )
+        {        	
+        if ( iSaveType == CMsvAttachment::EMsvLinkedFile )
+            {
+
+            iObserver->ObjectSaveReady( KErrNone );
+            return;
+            }
+        else
+            {
+         
+            CMsvStore* readStore = iMtm.Entry().ReadStoreL();
+            MMsvAttachmentManager& manager = readStore->AttachmentManagerL();
+            CleanupStack::PushL( readStore );
+            CMsvAttachment* attachment = manager.GetAttachmentInfoL( iAttachmentId );
+            CMsvAttachment::TMsvAttachmentType type = attachment->Type();
+            delete attachment;
+            CleanupStack::PopAndDestroy( readStore );
+            if ( type == CMsvAttachment::EMsvLinkedFile )
+                {
+                // Remove the "linked attachment" from store & create new "file attachment"
+                RemoveFromStoreL();
+                CreateAttachmentL();
+                }
+            else
+                {
+                // Already a "file attachment"
+                iObserver->ObjectSaveReady( KErrNone );
+                return;
+                }
+            }
+        }
+    else
+        {
+        // Create new attachment
+        CreateAttachmentL();
+        }
+    }
+
+
+// ---------------------------------------------------------
+// CUniObject::InitializeObjectSaveL
+// ---------------------------------------------------------
+//
+void CUniObject::FinalizeObjectSaveL()
+    {
+    // TODO: Cleanup attachment in some cases?
+    //       -> Just use Revert() instead of CommitL()?
+    iAttachmentId = iAttachment->Id();
+    iMimeInfo->SaveMimeInfoL( *iManager, *iAttachment );
+
+    CMsvAttachment::TMsvAttachmentType type = iAttachment->Type();
+    if ( type == CMsvAttachment::EMsvLinkedFile )
+        {
+        iFileHandle.Close();
+        iFileHandle = iManager->GetAttachmentFileL( iAttachmentId  );
+        }
+
+    iAttachment = NULL;
+    iEditStore->CommitL();
+
+    if ( iSaveType == CMsvAttachment::EMsvFile )
+        {
+        // Update media info
+        RFile attachmentFile = iManager->GetAttachmentFileL( iAttachmentId );
+        CleanupClosePushL( attachmentFile );
+        iMediaInfo->SetFileL( attachmentFile );
+        CleanupStack::PopAndDestroy( &attachmentFile );
+        }
+
+    delete iEditStore;
+    iEditStore = NULL;
+    iManager = NULL;
+
+    //DoSaveL();
+    iObserver->ObjectSaveReady( KErrNone );    
+    }
+
+
+// ---------------------------------------------------------
+// CUniObject::CreateAttachmentL
+//
+// Create attachment to message store
+// ---------------------------------------------------------
+//
+void CUniObject::CreateAttachmentL()
+    {
+    if ( !( iMediaInfo->FullFilePath().Length() ) )
+        {
+        User::Leave( KErrNotSupported );
+        }
+    TParsePtrC fileParse( iMediaInfo->FullFilePath() );
+
+    iEditStore = iMtm.Entry().EditStoreL();
+    iManager = &( iEditStore->AttachmentManagerL() );
+    CMsvAttachment* attachment = CMsvAttachment::NewL( iSaveType );
+    CleanupStack::PushL( attachment );
+
+    attachment->SetSize( iMediaInfo->FileSize() );
+    attachment->SetMimeTypeL( iMimeInfo->ContentType() );
+    //TODO: Set complete flag?
+    //attachment->SetComplete( iSaveType != EHiddenSave );
+
+    attachment->SetIntAttributeL( KUidAttachmentIndication, Attachment() );
+
+    //Make this synchronous process
+    CMuiuOperationWait* wait = CMuiuOperationWait::NewLC();
+    if ( iSaveType == CMsvAttachment::EMsvLinkedFile )
+        {
+        iManager->AddLinkedAttachmentL( fileParse.FullName(), attachment, wait->iStatus );
+        wait->Start();
+        }
+    else
+        {
+        iManager->AddAttachmentL( fileParse.FullName(), attachment, wait->iStatus );
+        wait->Start();
+        }
+    CleanupStack::PopAndDestroy( wait );
+    
+    CleanupStack::Pop( attachment );
+    iAttachment = attachment;
+    iSaveState = EObjectCreatingAttachment;
+        
+    RunL();
+    //SetActive();
+    }
+
+// ---------------------------------------------------------
+// CUniObject::SetVisibleL
+//
+// Set "Visible" and "InPreparation" flags
+// ---------------------------------------------------------
+//
+/*
+void CUniObject::SetHiddenL( TBool aHidden )
+    {
+    // TODO: Use Complete flag?!
+
+    if ( iAttachmentId == KMsvNullIndexEntryId )
+        {
+        return;
+        }
+    CMsvEntry* cAttEntry = iMtm.Entry().ChildEntryL( iAttachmentId );
+    CleanupStack::PushL( cAttEntry );
+    TMsvEntry tAttEntry = cAttEntry->Entry();
+    tAttEntry.SetInPreparation( aHidden );
+    cAttEntry->ChangeL( tAttEntry );
+    CleanupStack::PopAndDestroy( cAttEntry );
+    }
+*/
+
+
+// ---------------------------------------------------------
+// CUniObject::RemoveFromStoreL
+//
+// Remove from store.
+// ---------------------------------------------------------
+//
+void CUniObject::RemoveFromStoreL()
+    {
+    if ( iAttachmentId == KMsvNullIndexEntryId )
+        {
+        return;
+        }
+
+    iFileHandle.Close();
+
+    CMsvStore* store = iMtm.Entry().EditStoreL();
+    CleanupStack::PushL( store );
+    MMsvAttachmentManager& manager = store->AttachmentManagerL();
+    MMsvAttachmentManagerSync& managerSync = store->AttachmentManagerExtensionsL();
+    managerSync.RemoveAttachmentL( CUniDataUtils::IndexPositionOfAttachmentL( manager, iAttachmentId ) );
+    store->CommitL();
+    CleanupStack::PopAndDestroy( store );
+    iAttachmentId = KMsvNullIndexEntryId;
+}
+
+
+// ---------------------------------------------------------
+// CUniObject::CreateMimeInfoL
+//
+// ---------------------------------------------------------
+//
+void CUniObject::CreateMimeInfoL()
+    {
+    // Content-type
+    iMimeInfo->SetContentTypeL( iMediaInfo->MimeType() );
+
+    HBufC* fileName = NULL;
+    if ( iMediaInfo->FullFilePath().Length() )
+        {
+        TParsePtrC parse( iMediaInfo->FullFilePath() );
+        fileName = parse.NameAndExt().AllocLC();
+        }
+
+    if ( fileName )
+        {
+        // Content-location
+        TPtr ptr = fileName->Des();
+        CMsgTextUtils::TrimAndRemoveNonAlphaDigit( ptr );
+        iMimeInfo->SetContentLocationL( *fileName );
+        CleanupStack::PopAndDestroy( fileName );
+
+        // Character set. Recognize charset if atta is text.
+        if ( iMediaInfo->MediaType() == EMsgMediaText ||
+             iMediaInfo->MediaType() == EMsgMediaXhtml )
+            {
+            CMsgTextInfo* info = static_cast<CMsgTextInfo*>( iMediaInfo );
+            TUint charConvCharset = info->CharacterSet();
+            TUint mibCharset( 0 );
+            if ( charConvCharset == 0 )
+                {
+                // UCS2
+                mibCharset = KCharacterSetMIBEnumIso10646Ucs2;
+                }
+            else
+                {
+                mibCharset = iData.CharconvIdToMibIdL( charConvCharset );
+                }
+            iMimeInfo->SetCharset( mibCharset );
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniObject::Size
+//
+// Accessor.
+// ---------------------------------------------------------
+//
+TInt CUniObject::Size( TBool aWithoutHeaders )
+    {
+    return ( aWithoutHeaders
+        ? iMediaInfo->FileSize()
+        : iMediaInfo->FileSize() + iMimeInfo->Size() );
+    }
+
+// ---------------------------------------------------------
+// CUniObject::MimeType
+// ---------------------------------------------------------
+//
+EXPORT_C TPtrC8 CUniObject::MimeType() const
+    {
+    if ( iMediaInfo->MediaType() == EMsgMediaAudio ||
+         iMediaInfo->MediaType() == EMsgMediaImage ||
+         iMediaInfo->MediaType() == EMsgMediaVideo ||
+#ifdef RD_SVGT_IN_MESSAGING
+         iMediaInfo->MediaType() == EMsgMediaSvg ||
+#endif
+#ifdef RD_MSG_XHTML_SUPPORT
+         iMediaInfo->MediaType() == EMsgMediaXhtml ||
+#endif
+         ( iMediaInfo->Protection() &
+           ( EFileProtForwardLocked | EFileProtSuperDistributable ) ) )
+        {
+        return iMediaInfo->MimeType();
+        }
+    else
+        {
+        return iMimeInfo->ContentType();
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniObject::MediaType
+// ---------------------------------------------------------
+//
+EXPORT_C TMsgMediaType CUniObject::MediaType() const
+    {
+    if ( iMediaInfo->MediaType() == EMsgMediaText &&
+        iMimeInfo->ContentType().CompareF( KMsgMimeTextPlain ) != 0 )
+        {
+        return EMsgMediaUnknown;
+        }
+    else
+        {
+        return iMediaInfo->MediaType();
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniObject::ConstructL
+//
+// 2nd phase constructor.
+// ---------------------------------------------------------
+//
+void CUniObject::ConstructL()
+    {
+    iMimeInfo = new ( ELeave ) CUniMimeInfo;
+
+    if ( iMediaInfo )
+        {
+        if ( iMediaInfo->Corrupt() )
+            {
+            SetCorrupted( ETrue );
+            }
+
+        if ( iMediaInfo->DRMContentURI() )
+            {
+            iDrmInfo = CUniDrmInfo::NewL( iFs, iMtm, iAttachmentId, *iMediaInfo );
+            iDrmNotifier = CDRMNotifier::NewL( );
+            iDrmNotifier->RegisterEventObserverL( *this,
+                                                    KEventAddRemove,
+                                                    *iMediaInfo->DRMContentURI() );
+            iDrmNotifier->RegisterEventObserverL( *this,
+                                                    KEventModify,
+                                                    *iMediaInfo->DRMContentURI() );
+            }
+        }
+
+    iObservers = new( ELeave ) CArrayPtrFlat<MUniObjectObserver>( 1 );
+
+    }
+
+// ---------------------------------------------------------
+// CUniObject::ConstructFromAttachmentL
+//
+// 2nd phase constructor.
+// ---------------------------------------------------------
+//
+void CUniObject::ConstructFromAttachmentL(
+        MMsvAttachmentManager& aManager,
+        CMsvAttachment& aAttachment )
+    {
+    iAttachmentId = aAttachment.Id();
+    TPtrC8 dummy;
+    TInt err = aAttachment.GetDesC8Attribute( KUidMimeHeaders, dummy );
+    if( err == KErrNone )
+        {
+        iMimeInfo->ReadMimeInfoL( aAttachment );
+
+        if ( iMediaInfo->MediaType() == EMsgMediaText )
+            {
+            TUint mibCharset = iMimeInfo->Charset();
+            if ( !mibCharset )
+                {
+                //assume US-ASCII - mandated by RFC 2046
+                mibCharset = KCharacterSetMIBEnumUsAscii;
+                }
+            TUint charConvCharset = iData.MibIdToCharconvIdL( mibCharset );
+
+            CMsgTextInfo* info = static_cast<CMsgTextInfo*>( iMediaInfo );
+            info->SetCharacterSet( charConvCharset );
+            }
+
+        //iStoreState = EMmsStoreStateAttachment;
+        }
+    else
+        {
+        CreateMimeInfoL();
+        aAttachment.SetMimeTypeL( iMimeInfo->ContentType() );
+        iMimeInfo->SaveMimeInfoL( aManager, aAttachment );
+        // TODO: Set hidden
+        //SetHiddenL( ETrue );
+        //iStoreState = EMmsStoreStateHidden;
+        //iStoreState = EMmsStoreStateAttachment;
+        }
+
+    TInt isAttachment( 0 );
+    err = aAttachment.GetIntAttribute( KUidAttachmentIndication, isAttachment );
+
+    if ( err == KErrNone )
+        {
+        SetAttachment( isAttachment );
+        }
+
+    CMsvAttachment::TMsvAttachmentType type = aAttachment.Type();
+    if ( type == CMsvAttachment::EMsvLinkedFile )
+        {
+        iFileHandle = aManager.GetAttachmentFileL( iAttachmentId  );
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniObject::DoCancel
+//
+// ---------------------------------------------------------
+//
+void CUniObject::DoCancel()
+    {
+    if ( iManager )
+        {
+        iManager->CancelRequest();
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniObject::RunL
+//
+// ---------------------------------------------------------
+//
+void CUniObject::RunL()
+    {
+    DoSaveL();
+    }
+
+// ---------------------------------------------------------
+// CUniObject::RunError
+//
+// ---------------------------------------------------------
+//
+TInt CUniObject::RunError( TInt aError )
+    {
+    delete iEditStore;
+    iEditStore = NULL;
+    iManager = NULL;
+    iAttachmentId = NULL;
+
+    iObserver->ObjectSaveReady( aError );
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------
+// CUniObject::CompleteSelf
+//
+// ---------------------------------------------------------
+//
+void CUniObject::CompleteSelf()
+    {
+    iStatus = KRequestPending;
+    TRequestStatus* pStatus = &iStatus;
+    SetActive();
+    User::RequestComplete( pStatus, KErrNone );
+    }
+
+
+// ---------------------------------------------------------
+// CUniObject::ResolveDrmRightsWhenLoadedL
+//
+// ---------------------------------------------------------
+//
+EXPORT_C void CUniObject::ResolveDrmRightsWhenLoadedL()
+    {
+    iObjectFlags &= ~EObjectDrmRightsWhenLoaded;
+
+    if ( iDrmInfo )
+        {
+        TBool alreadyConsumed( EFalse );
+        TBool result = ( iDrmInfo->EvaluateRights( alreadyConsumed ) == KErrNone ? ETrue :
+                                                                                   EFalse );
+        if (    alreadyConsumed
+            ||  result )
+            {
+            iObjectFlags |= EObjectDrmRightsWhenLoaded;
+            }
+        }
+
+    }
+
+// ---------------------------------------------------------
+// CUniObject::SetDrmRightsWhenLoaded
+//
+// ---------------------------------------------------------
+//
+EXPORT_C void CUniObject::SetDrmRightsWhenLoaded( TBool aRights )
+    {
+    aRights ? ( iObjectFlags |= EObjectDrmRightsWhenLoaded ) : ( iObjectFlags &= ~EObjectDrmRightsWhenLoaded );
+    }
+
+// ---------------------------------------------------------
+// CUniObject::SetDrmRightsWhenLoadedObjects
+//
+// ---------------------------------------------------------
+//
+EXPORT_C void CUniObject::SetDrmRightsWhenLoadedObjects( TBool aRights )
+    {
+    aRights ? ( iObjectFlags |= EObjectDrmRightsWhenLoadedObjects ) : ( iObjectFlags &= ~EObjectDrmRightsWhenLoadedObjects );
+    }
+
+
+// ---------------------------------------------------------
+// CUniObject::HandleEventL from MDRMEventObserver
+//
+// ---------------------------------------------------------
+//
+void CUniObject::HandleEventL( MDRMEvent* aEvent )
+    {
+    TDRMEventType event = KEventNone;
+    if ( aEvent )
+        {
+        aEvent->GetEventType( event );
+
+        switch ( event )
+            {
+            case KEventNone:
+                break;
+            case KEventAddRemove:
+            case KEventModify:
+            case KEventTimeChange:
+            default:
+                {
+                for ( TInt current = 0; current < iObservers->Count(); ++current )
+                    {
+                    if ( iObservers->At( current ) )
+                        {
+                        iObservers->At( current )->HandleUniObjectEvent(
+                            *this,
+                            EUniObjectEventDrmRightsChanged );
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniObject::SetObserverL
+//
+// ---------------------------------------------------------
+//
+EXPORT_C void CUniObject::SetObserverL( MUniObjectObserver* aObserver )
+    {
+    iObservers->AppendL( aObserver );
+    }
+
+// ---------------------------------------------------------
+// CUniObject::RemoveObserver
+//
+// ---------------------------------------------------------
+//
+EXPORT_C void CUniObject::RemoveObserver( MUniObjectObserver* aObserver )
+    {
+    for ( TInt current = 0; current < iObservers->Count(); ++current )
+        {
+        if ( iObservers->At( current ) == aObserver )
+            {
+            iObservers->Delete( current );
+            break;
+            }
+        }
+    }
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/src/UniObjectList.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,483 @@
+/*
+* 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: 
+*       CUniObjectList, List of attachments.
+*
+*
+*/
+
+
+// ========== INCLUDE FILES ================================
+
+#include <e32std.h>
+#include <e32def.h>     // for basic types
+#include <eikenv.h>     // for CBase
+#include <mtclbase.h>   // for CBaseMtm
+#include <msvstd.h>     // for TMsvId
+#include <msvids.h>     // for KMsvTempIndexEntryId
+#include <msvstore.h>
+#include <mmsvattachmentmanager.h>
+#include <mmsvattachmentmanagersync.h>
+#include <cmsvattachment.h>
+
+#include <uriutils.h>   // Uri decoding and encoding
+
+#include <MsgMediaInfo.h>
+
+#include "UniDataUtils.h"
+#include "UniModelConst.h"
+#include "UniMimeInfo.h"
+#include "UniObject.h"
+#include "UniObjectList.h"
+#include "UniSmilUtils.h"
+
+// ========== EXTERNAL DATA STRUCTURES =====================
+
+// ========== EXTERNAL FUNCTION PROTOTYPES =================
+
+// ========== CONSTANTS ====================================
+
+const TInt KObjectArrayGranularity = 10;
+_LIT( KContentIdString, "cid:*" );
+_LIT8 ( KCidLeftAngle, "<"); // 8 bit angle bracket
+_LIT8 ( KCidRightAngle, ">"); // 8 bit angle bracket
+
+// ========== MACROS =======================================
+
+// ========== LOCAL CONSTANTS AND MACROS ===================
+
+// ========== MODULE DATA STRUCTURES =======================
+
+
+// ========== LOCAL FUNCTION PROTOTYPES ====================
+
+// ========== LOCAL FUNCTIONS ==============================
+
+// ========== MEMBER FUNCTIONS =============================
+
+// ---------------------------------------------------------
+// CUniObjectList::NewLC
+//
+// Factory method.
+// ---------------------------------------------------------
+//
+EXPORT_C CUniObjectList* CUniObjectList::NewL( CBaseMtm& aMtm, CUniDataUtils& aData )
+    {
+    CUniObjectList* self = new(ELeave) CUniObjectList( aMtm, aData );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------
+// CUniObjectList::CUniObjectList
+//
+// Constructor.
+// ---------------------------------------------------------
+//
+CUniObjectList::CUniObjectList( CBaseMtm& aMtm, CUniDataUtils& aData ) :
+    iObjectArray( NULL ),
+    iData( aData ),
+    iMtm( aMtm )
+    {
+    }
+
+
+// ---------------------------------------------------------
+// CUniObjectList::CUniObjectList
+//
+// Destructor.
+// ---------------------------------------------------------
+//
+CUniObjectList::~CUniObjectList()
+    {
+    if ( iObjectArray )
+        {
+        iObjectArray->ResetAndDestroy();
+        }
+    delete iObjectArray;
+    }
+
+// ---------------------------------------------------------
+// CUniObjectList::AddObjectL
+//
+// AddObjectL.
+// ---------------------------------------------------------
+//
+EXPORT_C void CUniObjectList::AddObjectL( CUniObject* aObject )
+    {
+    iObjectArray->AppendL( aObject );
+
+    if ( iListObserver )
+        {
+        iListObserver->ObjectAddedL( this, aObject, iObjectArray->Count() - 1 );
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniObjectList::SpaceNeededForSaveAll
+//
+// SpaceNeededForSaveAll.
+// ---------------------------------------------------------
+//
+EXPORT_C TInt CUniObjectList::SpaceNeededForSaveAll()
+    {
+    TInt spaceNeeded( 0 );
+    /*
+    for (TInt i = iObjectArray->Count(); --i >= 0 ;)
+        {
+        if ( iObjectArray->At( i )->StoreState() == EMmsStoreStateTemporary )
+            {
+            spaceNeeded += iObjectArray->At( i )->Size( EFalse ); // Count headers too.
+            }
+        }
+    */
+    return spaceNeeded;
+    }
+
+// ---------------------------------------------------------
+// CUniObjectList::SaveAllL
+//
+// SaveAllL.
+// ---------------------------------------------------------
+//
+EXPORT_C void CUniObjectList::SaveAll( MUniObjectSaveObserver& aObserver, CMsvAttachment::TMsvAttachmentType aSaveType )
+    {
+    if ( iObjectArray->Count() )
+        {
+        iSaveObserver = &aObserver;
+        iSaveCount = 0;
+        iSaveType = aSaveType;
+        iObjectArray->At( iSaveCount )->Save( *this, aSaveType );
+        }
+    else
+        {
+        aObserver.ObjectSaveReady( KErrNone );
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniObjectList::RemoveAllObjectsL
+//
+// RemoveAllObjectsL
+// ---------------------------------------------------------
+//
+EXPORT_C void CUniObjectList::RemoveAllObjectsL()
+    {
+    TInt a = iObjectArray->Count();
+    while ( a-- )
+        {
+        CUniObject* obj = iObjectArray->At( a );
+        obj->RemoveFromStoreL();
+        iObjectArray->Delete( a );
+
+        if ( iListObserver )
+            {
+            iListObserver->ObjectRemovedL( this, obj, a );
+            }
+
+        delete obj;
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniObjectList::EnsureAllObjectsHaveContentLocationL
+//
+// EnsureAllObjectsHaveContentLocationL
+// ---------------------------------------------------------
+//
+EXPORT_C void CUniObjectList::EnsureAllObjectsHaveContentLocationL()
+    {
+    CMsvStore* store = iMtm.Entry().EditStoreL();
+    CleanupStack::PushL( store );
+    MMsvAttachmentManager& manager = store->AttachmentManagerL();
+    MMsvAttachmentManagerSync& managerSync = store->AttachmentManagerExtensionsL();
+    TBool commit( EFalse );
+	TInt a = iObjectArray->Count();
+    while ( a-- )
+        {
+        CUniObject* obj = iObjectArray->At( a );
+        if ( !obj->MimeInfo()->ContentLocation().Length()
+        	&& obj->AttachmentId( ) )
+            {
+            CMsvAttachment* attachment = manager.GetAttachmentInfoL( obj->AttachmentId() );
+            CleanupStack::PushL( attachment );
+            TParsePtrC parse( obj->MediaInfo()->FullFilePath() );
+            TPtrC nameAndExt( parse.NameAndExt() );
+            obj->MimeInfo()->EnsureContentLocationL(
+                manager,
+                *attachment,
+                nameAndExt );
+            managerSync.ModifyAttachmentInfoL( attachment );
+            CleanupStack::Pop( attachment );
+            commit = ETrue;
+            }
+		}
+    if ( commit )
+        {
+        store->CommitL();
+        }
+    CleanupStack::PopAndDestroy( store );
+	}
+
+// ---------------------------------------------------------
+// CUniObjectList::RemoveObjectL
+//
+// RemoveObjectL.
+// ---------------------------------------------------------
+//
+EXPORT_C void CUniObjectList::RemoveObjectL( CUniObject* aObject, TBool aRemoveFromStore /*= ETrue*/ )
+    {
+    if ( aRemoveFromStore )
+        {
+        aObject->RemoveFromStoreL();
+        }
+    TInt a = iObjectArray->Count();
+    while ( a-- )
+        {
+        if ( iObjectArray->At( a ) == aObject )
+            {
+            iObjectArray->Delete( a );
+
+            if ( iListObserver )
+                {
+                iListObserver->ObjectRemovedL( this, aObject, a );
+                }
+            break;
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniObjectList::GetByIndex
+//
+// GetByIndex.
+// ---------------------------------------------------------
+//
+EXPORT_C CUniObject* CUniObjectList::GetByIndex( TInt aIndex )
+    {
+    if ( aIndex < 0 || aIndex >= iObjectArray->Count() )
+        {
+        return NULL;
+        }
+    return iObjectArray->At( aIndex );
+    }
+
+// ---------------------------------------------------------
+// CUniObjectList::GetByAttachmentId
+//
+// GetByAttachmentId.
+// ---------------------------------------------------------
+//
+EXPORT_C CUniObject* CUniObjectList::GetByAttachmentId( TMsvAttachmentId aAttachmentId )
+    {
+    TInt a = iObjectArray->Count();
+    while ( a-- )
+        {
+        if ( iObjectArray->At( a )->AttachmentId() == aAttachmentId )
+            {
+            return iObjectArray->At( a );
+            }
+        }
+    return NULL;
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::GetByNode
+//
+// ---------------------------------------------------------
+//
+EXPORT_C CUniObject* CUniObjectList::GetByNodeL( CMDXMLNode * aNode )
+    {
+    TPtrC domsrc = UniSmilUtils::GetSrcL( aNode ); // Get path from DOM.
+    return GetByUrlL( domsrc );
+    }
+
+// ---------------------------------------------------------
+// CUniObjectList::GetByUrlL
+//
+// GetByUrlL.
+// ---------------------------------------------------------
+//
+EXPORT_C CUniObject* CUniObjectList::GetByUrlL( const TDesC& aUrl )
+    {
+    CUniObject* att = NULL;
+    TBool found = EFalse;
+
+    HBufC8* url8bit = HBufC8::NewLC( aUrl.Length() );
+
+    CUri16* decodedUri = NULL;
+    TUriParser8 parser;
+	if( !url8bit )
+        {
+		return;
+		}
+
+    if( aUrl.MatchF( KContentIdString ) == 0 )
+        {
+        //Remove "cid:" from the beginning
+        url8bit->Des().Copy( aUrl.Right( aUrl.Length() - KContentIdString().Length() + 1 ) );
+        parser.Parse( *url8bit );
+        }
+    else
+        {
+        url8bit->Des().Copy( aUrl );
+        parser.Parse( *url8bit );
+        }
+    decodedUri = UriUtils::ConvertToDisplayFormL( parser );
+    CleanupStack::PushL( decodedUri );
+
+    TInt count = iObjectArray->Count();
+    for ( TInt i = 0; i < count && !found ; ++i )
+        {
+        TPtrC contentLocation = iObjectArray->At( i )->MimeInfo()->ContentLocation();
+        TPtrC8 contentIdPtr = iObjectArray->At( i )->MimeInfo()->ContentId();
+        CUri16* contLocUri = NULL;
+        CUri16* contIdUri = NULL;
+        HBufC8* contentLoc = NULL;
+        HBufC8* contentId = NULL;
+
+        // Convert content location as well.
+        if ( contentIdPtr.Length() )
+            {
+            //Copy string to 8-bit descriptor
+            contentId = HBufC8::NewLC( contentIdPtr.Length() );
+
+            if ( contentId->Find( KCidLeftAngle ) == 0 &&
+                 contentId->Find( KCidRightAngle ) == contentId->Length() - 1 )
+                {
+                // When comparing against cid, remove "<" and ">"
+                contentId->Des().Copy( contentIdPtr.Mid( 1, contentIdPtr.Length() - 2 ) );
+                }
+            else
+                {
+                contentId->Des().Copy( contentIdPtr );
+                }
+
+            parser.Parse( *contentId );
+            contIdUri = UriUtils::ConvertToDisplayFormL( parser );
+            CleanupStack::PushL( contIdUri );
+            }
+         if ( contentLocation.Length() )
+            {
+            //Copy string to 8-bit descriptor
+            contentLoc = HBufC8::NewLC( contentLocation.Length() );
+            contentLoc->Des().Copy( contentLocation );
+            parser.Parse( *contentLoc );
+            contLocUri = UriUtils::ConvertToDisplayFormL( parser );
+            CleanupStack::PushL( contLocUri );
+            }
+
+        if (
+            ( ( contentLocation.Length() ) && (decodedUri->Uri().UriDes().CompareF( contLocUri->Uri().UriDes() ) == 0 ) ) ||
+            ( ( contentIdPtr.Length() ) && (decodedUri->Uri().UriDes().CompareF( contIdUri->Uri().UriDes() ) == 0 ) ) )
+            {
+            att = iObjectArray->At( i );
+            }
+
+        if ( contentLoc )
+            {
+            CleanupStack::PopAndDestroy( 2, contentLoc ); // contentLoc, contLocUri
+            }
+        if ( contentId )
+            {
+            CleanupStack::PopAndDestroy( 2, contentId ); // contentId, contIdUri
+            }
+
+        }
+    CleanupStack::PopAndDestroy( 2, url8bit ); // decodedUri, url8bit
+    return att;
+    }
+
+// ---------------------------------------------------------
+// CUniObjectList::ObjectByteSize
+// ---------------------------------------------------------
+//
+EXPORT_C TInt CUniObjectList::ObjectByteSize() const
+    {
+    TInt byteSize(0);
+    TInt i = iObjectArray->Count();
+    while ( i-- )
+        {
+        byteSize += iObjectArray->At( i )->Size();
+        }
+
+    return byteSize;
+    }
+
+// ---------------------------------------------------------
+// CUniObjectList::SetListObserver
+// ---------------------------------------------------------
+//
+EXPORT_C void CUniObjectList::SetListObserver( MUniObjectListObserver* aObserver )
+    {
+    iListObserver = aObserver;
+    }
+
+// ---------------------------------------------------------
+// CUniObjectList::GetObjectByUniqueHandle
+// ---------------------------------------------------------
+//
+EXPORT_C CUniObject* CUniObjectList::GetObjectByUniqueHandle( TInt aUniqueControlHandle )
+    {
+    for ( TInt index = 0; index < iObjectArray->Count(); ++index )
+        {
+        CUniObject* current = iObjectArray->At( index );
+        if( current->UniqueControlHandle() == aUniqueControlHandle )
+            {
+            return current;
+            }
+        }
+    return NULL;
+    }
+
+// ---------------------------------------------------------
+// CUniObjectList::ConstructL
+//
+// 2nd phase constructor.
+// ---------------------------------------------------------
+//
+void CUniObjectList::ConstructL()
+    {
+    iObjectArray = new(ELeave)CArrayPtrFlat<CUniObject>( KObjectArrayGranularity );
+    }
+
+// ---------------------------------------------------------
+// CUniObjectList::ObjectSaveReady
+//
+// ---------------------------------------------------------
+//
+void CUniObjectList::ObjectSaveReady( TInt aError )
+    {
+    if ( aError )
+        {
+        iSaveObserver->ObjectSaveReady( aError );
+        }
+    else
+        {
+        iSaveCount++;
+        if ( iSaveCount < iObjectArray->Count() )
+            {
+            iObjectArray->At( iSaveCount )->Save( *this, iSaveType );
+            }
+        else
+            {
+            iSaveObserver->ObjectSaveReady( KErrNone );
+            }
+        }
+    }
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/src/UniSmilList.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,295 @@
+/*
+* 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: 
+*       CUniSmilList, List of attachments.
+*
+*
+*/
+
+
+// ========== INCLUDE FILES ================================
+
+#include <e32std.h>
+#include <e32def.h>     // for basic types
+#include <eikenv.h>     // for CBase
+#include <mtclbase.h>   // for CBaseMtm
+#include <msvstd.h>     // for TMsvId
+#include <msvids.h>     // for KMsvTempIndexEntryId
+#include <msvstore.h>
+#include <mmsvattachmentmanager.h>
+#include <mmsvattachmentmanagersync.h>
+#include <cmsvattachment.h>
+#include <cmsvmimeheaders.h>
+
+#include "msgtextutils.h"
+#include "UniSmilList.h"
+#include "MsgMimeTypes.h"
+#include "MuiuOperationWait.h"
+
+// ========== EXTERNAL DATA STRUCTURES =====================
+
+// ========== EXTERNAL FUNCTION PROTOTYPES =================
+
+// ========== CONSTANTS ====================================
+
+// ========== MACROS =======================================
+
+// ========== LOCAL CONSTANTS AND MACROS ===================
+
+_LIT16( KPresentationFileName, "pres.smil" );
+
+// ========== MODULE DATA STRUCTURES =======================
+
+// ========== LOCAL FUNCTION PROTOTYPES ====================
+
+// ========== LOCAL FUNCTIONS ==============================
+
+// ========== MEMBER FUNCTIONS =============================
+
+// ---------------------------------------------------------
+// CUniSmilList::NewLC
+//
+// Factory method.
+// ---------------------------------------------------------
+//
+EXPORT_C CUniSmilList* CUniSmilList::NewL( CBaseMtm& aMtm )
+    {
+    CUniSmilList* self = new(ELeave) CUniSmilList( aMtm );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------
+// CUniSmilList::CUniSmilList
+//
+// Constructor.
+// ---------------------------------------------------------
+//
+CUniSmilList::CUniSmilList( CBaseMtm& aMtm ) :
+    CActive( EPriorityStandard ),
+    iMtm( aMtm ),
+    iSmilAttachmentArray( NULL )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+
+// ---------------------------------------------------------
+// CUniSmilList::CUniSmilList
+//
+// Destructor.
+// ---------------------------------------------------------
+//
+CUniSmilList::~CUniSmilList()
+    {
+    Cancel();
+
+    delete iSmilAttachmentArray;
+    delete iComposer;
+
+    if ( iEditFile )
+        {
+        iEditFile->Close();
+        delete iEditFile;
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniSmilList::AddSmilAttachmentL
+//
+// Add SMIL attachment
+// ---------------------------------------------------------
+//
+EXPORT_C void CUniSmilList::AddSmilAttachmentL(
+    MMsvAttachmentManager& aManager,
+    TMsvAttachmentId aAttachmentId )
+    {
+    RFile file = aManager.GetAttachmentFileL( aAttachmentId );
+    CleanupClosePushL( file );
+    TInt size( 0 );
+    User::LeaveIfError( file.Size( size ) );
+    CleanupStack::PopAndDestroy( &file );
+    iSmilAttachmentArray->AppendL( aAttachmentId );
+    iSmilSize += size;
+    }
+
+// ---------------------------------------------------------
+// CUniSmilList::CreateSmilAttachmentL
+//
+// Create SMIL from DOM
+// ---------------------------------------------------------
+//
+EXPORT_C void CUniSmilList::CreateSmilAttachmentL(
+        MUniSmilComposeObserver& aObserver,
+        CMsvStore& aEditStore,
+        CMDXMLDocument* aDom )
+    {
+    iDom = aDom;
+    iObserver = &aObserver;
+    //iSmilAttaId = KMsvNullIndexEntryId;
+    //iSmilAttaFullpath.Zero();
+
+    iManager = &( aEditStore.AttachmentManagerL() );
+    CMsvAttachment* attachment = CMsvAttachment::NewL( CMsvAttachment::EMsvFile );
+    CleanupStack::PushL( attachment );
+
+    //TODO: Set size(?) & complete flag(?)
+    //attachment->SetSize()
+    //attachment->SetComplete( EFalse );
+
+    iEditFile = new ( ELeave ) RFile;
+    CMuiuOperationWait* wait = CMuiuOperationWait::NewLC();
+    iManager->CreateAttachmentL( KPresentationFileName, *iEditFile, attachment, wait->iStatus );
+    wait->Start();
+    //manager.AddAttachmentL( aPath, attachment, iStatus );
+    CleanupStack::PopAndDestroy( wait );	
+
+    CleanupStack::Pop( attachment );
+    iAttachment = attachment;
+
+    //Do self complete to trigger runL 
+    RunL();
+    }
+
+// ---------------------------------------------------------
+// CUniSmilList::GetSmilAttachmentByIndex
+//
+// GetSmilAttachmentByIndex.
+// ---------------------------------------------------------
+//
+EXPORT_C TMsvAttachmentId CUniSmilList::GetSmilAttachmentByIndex( TInt aIndex )
+    {
+    if ( aIndex < 0 || aIndex >= iSmilAttachmentArray->Count() )
+        {
+        return KMsvNullIndexEntryId;
+        }
+    return iSmilAttachmentArray->At( aIndex );
+    }
+
+// ---------------------------------------------------------
+// CUniSmilList::GetSmilFullPathByIndex
+//
+// GetSmilFullPathByIndex.
+// ---------------------------------------------------------
+//
+EXPORT_C RFile CUniSmilList::GetSmilFileByIndexL(
+    TInt aIndex )
+    {
+    if ( aIndex < 0 || aIndex >= iSmilAttachmentArray->Count() )
+        {
+        User::Leave( KErrArgument );
+        }
+    CMsvStore* store = iMtm.Entry().ReadStoreL();
+    CleanupStack::PushL( store );
+    MMsvAttachmentManager& manager = store->AttachmentManagerL();
+    RFile file = manager.GetAttachmentFileL( iSmilAttachmentArray->At( aIndex ) );
+    CleanupStack::PopAndDestroy( store );
+    return file;
+    }
+
+// ---------------------------------------------------------
+// CUniSmilList::ConstructL
+//
+// 2nd phase constructor.
+// ---------------------------------------------------------
+//
+void CUniSmilList::ConstructL()
+    {
+    iSmilAttachmentArray = new ( ELeave ) CArrayFixFlat<TMsvAttachmentId>( 2 );
+    }
+
+// ---------------------------------------------------------
+// CUniSmilList::ComposeFileCompleteL
+// ---------------------------------------------------------
+//
+void CUniSmilList::ComposeFileCompleteL()
+    {
+    CMsvMimeHeaders* msvMime = CMsvMimeHeaders::NewLC();
+
+    TInt slash = KMsgMimeSmil().Locate( '/' );
+    msvMime->SetSuggestedFilenameL( KPresentationFileName );
+    msvMime->SetContentTypeL( KMsgMimeSmil().Left( slash ) );
+    msvMime->SetContentSubTypeL( KMsgMimeSmil().Mid( slash + 1 ) );
+    msvMime->SetMimeCharset( KCharacterSetMIBEnumUtf8 );
+    msvMime->StoreL( *iAttachment );
+    CleanupStack::PopAndDestroy( msvMime );
+
+    iAttachment->SetMimeTypeL( KMsgMimeSmil );
+    // TODO: iEditFile is already closed? How to get the file size?
+    //iAttachment->SetSize( 0 );
+    TMsvAttachmentId smilId = iAttachment->Id();
+    AddSmilAttachmentL( *iManager, smilId );
+
+    // TODO: Cleanup attachment in some cases?
+    //       -> Just do use Revert() instead of CommitL()?
+    iManager = NULL;
+    iAttachment = NULL;
+
+    iObserver->SmilComposeEvent( KErrNone );
+    
+    if ( iObjWait.IsStarted() )
+    {
+    iObjWait.AsyncStop();
+    }    
+
+    }
+
+// ---------------------------------------------------------
+// CUniSmilList::DoCancel
+//
+// ---------------------------------------------------------
+//
+void CUniSmilList::DoCancel()
+    {
+    if ( iManager )
+        {
+        iManager->CancelRequest();
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniSmilList::RunL
+//
+// ---------------------------------------------------------
+//
+void CUniSmilList::RunL()
+    {
+    if ( !iComposer )
+        {
+        iComposer = CMDXMLComposer::NewL( this, EFalse );
+        }
+    iComposer->ComposeFile( *iEditFile, iDom, EAscii );
+    if( !iObjWait.IsStarted() )
+    {
+    iObjWait.Start();
+    }
+    delete iEditFile;
+    iEditFile = NULL; // Ownership transferred.
+    }
+
+// ---------------------------------------------------------
+// CUniSmilList::RunError
+//
+// ---------------------------------------------------------
+//
+TInt CUniSmilList::RunError( TInt /*aError*/ )
+    {
+    return KErrNone;
+    }
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/src/UniSmilModel.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,2578 @@
+/*
+* 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: 
+*       CUniSmilModel, Storage for Smil presentation data.
+*
+*
+*/
+
+
+// ========== INCLUDE FILES ================================
+
+
+#include <e32def.h>
+#include <eikenv.h>
+#include <eikfutil.h>               // CopyFile
+
+#include <mtclbase.h>   // for CBaseMtm
+#include <msvstd.h>     // for TMsvId
+#include <msvids.h>     // for KMsvTempIndexEntryId
+#include <msvstore.h>
+#include <mmsvattachmentmanager.h>
+#include <mmsvattachmentmanagersync.h>
+#include <cmsvattachment.h>
+
+#include <bautils.h>                // NearestLanguageFile
+
+#include <coemain.h>
+
+// LAF
+/*
+#include <AknUtils.h>
+#include <AknLayoutScalable_Avkon.cdl.h>
+#include <AknLayoutScalable_Apps.cdl.h>
+#include <LayoutMetadata.cdl.h>
+*/
+
+// DOM
+#include <gmxmldocument.h>
+#include <gmxmlnode.h>
+#include <gmxmlelement.h>
+
+// MsgMedia
+#include <MsgMedia.hrh>
+#include <MsgMediaInfo.h>
+#include <MmsConformance.h>
+#include <mmsversion.h>
+#include <MsgTextInfo.h>
+
+
+// MsgDataUTILS
+#include <UniDataModel.rsg>         // Viewer/Editor Mimetype strings
+#include "UniModelConst.h"              // Definitions and enums
+#include "UniDataUtils.h"
+#include "UniSmilSlide.h"
+#include "UniSmilModel.h"
+#include "UniObjectList.h"
+#include "UniObject.h"
+#include "UniTextObject.h"
+#include "UniMimeInfo.h"
+#include "UniSmilUtils.h"
+#include "UniSmilParams.h"
+
+#include "fileprotectionresolver.h"     //     EFileProtDrm2
+#include "MsgMimeTypes.h"
+
+// Logging
+//#include "//MsgDataUTILSLOGGing.h"
+
+
+// ========== EXTERNAL DATA STRUCTURES =====================
+
+// ========== EXTERNAL FUNCTION PROTOTYPES =================
+
+// ========== CONSTANTS ====================================
+
+// ========== MACROS =======================================
+
+// ========== LOCAL CONSTANTS AND MACROS ===================
+
+_LIT( KSmilIntFormat, "%d" );
+_LIT( KSmilMsecFormat, "%dms" );
+const TUint KSlideArrayGranularity( 16 );
+
+// SMIL size estimates
+const TInt KSizeMandatorySmilTags = 148;
+const TInt KSizeHeadOneRegion = 85;
+const TInt KSizeHeadTwoRegions = 170;
+const TInt KSizeEmptyPar = 27;
+const TInt KSizeNonEmptyPar = 41;
+const TInt KSizeAudioTag = 38;
+const TInt KSizeImageTag = 52;
+const TInt KSizeTextTag = 51;
+const TInt KSizeVideoTag = 53;
+
+const TInt KSizeLowResHeight = 208;
+const TInt KSizeLowResWidth = 176;
+
+// ========== MODULE DATA STRUCTURES =======================
+
+// ========== LOCAL FUNCTION PROTOTYPES ====================
+
+// ========== LOCAL FUNCTIONS ==============================
+
+// ========== MEMBER FUNCTIONS =============================
+
+
+// ---------------------------------------------------------
+// CUniSmilModel::NewL
+//
+// Factory method.
+// ---------------------------------------------------------
+//
+EXPORT_C CUniSmilModel* CUniSmilModel::NewLC( RFs& aFs,
+                                             CBaseMtm& aMtm,
+                                             CUniDataUtils& aData,
+                                             CUniObjectList& aObjectList )
+    {
+    CUniSmilModel* self = new ( ELeave )
+        CUniSmilModel( aFs, aMtm, aData, aObjectList );
+
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------
+// CUniSmilModel::NewL
+//
+// Factory method.
+// ---------------------------------------------------------
+//
+EXPORT_C CUniSmilModel* CUniSmilModel::NewL( RFs& aFs,
+                                            CBaseMtm& aMtm,
+                                            CUniDataUtils& aData,
+                                            CUniObjectList& aObjectList )
+    {
+    CUniSmilModel* self = NewLC( aFs, aMtm, aData, aObjectList );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------
+// CUniSmilModel::CUniSmilModel
+//
+// Constructor.
+// ---------------------------------------------------------
+//
+CUniSmilModel::CUniSmilModel( RFs& aFs,
+                             CBaseMtm& aMtm,
+                             CUniDataUtils& aData,
+                             CUniObjectList& aObjectList ) :
+    iFs( aFs ),
+    iMtm( aMtm ),
+    iData( aData ),
+    iObjectList( aObjectList ),
+    iSlideLayout( EUniUndefinedLayout ),
+    iSmilParams( 0 ),
+    iScreenSize( 0, 0 ),
+    iSizeEstimateUpToDate( EFalse ),
+    iSizeEstimate( 0 )
+    {
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::~CUniSmilModel
+//
+// Destructor.
+// ---------------------------------------------------------
+//
+CUniSmilModel::~CUniSmilModel()
+    {
+    if (iSlideArray)
+        {
+        iSlideArray->ResetAndDestroy();
+        }
+    delete iSlideArray;
+    delete iSmilParams;
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::ParseL
+//
+// ---------------------------------------------------------
+//
+EXPORT_C TInt CUniSmilModel::ParseL( CMDXMLDocument* aDom )
+    {
+    //MsgDataUTILSLOGGER_ENTERFN( "CUniSmilModel::ParseL()" );
+
+    Reset();
+
+    if ( aDom )
+        {
+        TRAPD( error, DoPresentationFromDomL( aDom ) );
+        if ( error )
+            {
+            Reset();
+            User::Leave( error );
+            }
+        else
+            {
+            iParseResult |= EParsedFromSmil;
+            }
+        }
+    else
+        {
+        //  No SMIL -> Do presentation from object list
+        if ( IsMessageSlide() )
+            {
+            // Determine layout. Make slide.
+            DoNoSmilOneSlideL();
+            }
+        else
+            {
+            // Do slide for each media object
+            DoNoSmilManySlideL();
+            }
+        iParseResult |= EParsedFromList;
+        }
+
+    return iParseResult;
+    }
+
+
+//**********************************************************
+//*
+//* SMIL COMPOSING FUNCTIONS
+//*
+//**********************************************************
+
+
+// ---------------------------------------------------------
+// CUniSmilModel::¨ComposeL
+//
+// ---------------------------------------------------------
+//
+EXPORT_C CMDXMLDocument* CUniSmilModel::ComposeL()
+    {
+    //MsgDataUTILSLOGGER_ENTERFN( "CUniSmilModel::ComposeL()" );
+
+    // Reset region id's
+    iTextRegionId.Set( KNullDesC );
+    iImageRegionId.Set( KNullDesC );
+
+    // Read default smil parameters
+    if( !iSmilParams )
+        {
+        //MsgDataUTILSLOGGER_WRITE( "CUniSmilModel: Creating smil parameter structures." );
+        iSmilParams = CUniSmilParams::NewL( iFs );
+        }
+
+    //MsgDataUTILSLOGGER_WRITE( "CUniSmilModel: Creating new DOM." );
+    //delete iDom;
+    //iDom = 0;
+    CMDXMLDocument* dom = CMDXMLDocument::NewLC();
+
+    // Create smil node
+    TPtrC name( KSMILWREleSmil );
+    CMDXMLElement* root = CMDXMLElement::NewLC( ETrue, dom, name );
+    // Append
+    dom->DocumentElement()->AppendChild( root ); // Ownership to dom
+    CleanupStack::Pop( root );
+
+    // Create Head
+    CreateHeadL( dom, root );
+
+    // Create Body
+    CreateBodyL( dom, root );
+
+    // TODO: Move to Document and to use smil list
+    //iObjectList.CreateSmilAttachmentL( smilAttaId, iDom, iFs );
+    CleanupStack::Pop( dom );
+    return dom;
+    }
+
+
+
+// ---------------------------------------------------------
+// CUniSmilModel::RemoveEmptySlides
+//
+//
+// ---------------------------------------------------------
+//
+EXPORT_C void CUniSmilModel::RemoveEmptySlides()
+    {
+    TInt count = iSlideArray->Count();
+    // Must be done from end to beginning because
+    // slides might be removed.
+    while ( count-- )
+        {
+        if ( !iSlideArray->At( count )->ObjectCount() )
+            {
+            RemoveSlide( count );
+            }
+        }
+    }
+
+
+// ---------------------------------------------------------
+// CUniSmilModel::AddSlideL
+//
+//
+// ---------------------------------------------------------
+//
+EXPORT_C void CUniSmilModel::AddSlideL( TInt aSlideNum )
+    {
+    DoAddSlideL( aSlideNum );
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::RemoveSlide
+//
+//
+// ---------------------------------------------------------
+//
+EXPORT_C void CUniSmilModel::RemoveSlide( TInt aSlideNum )
+    {
+    if ( !IsSlide( aSlideNum ) )
+        {
+        //__ASSERT_DEBUG( EFalse, DataUtilsPanic( EMmsNotASlide ) );
+        return;
+        }
+    CUniSmilSlide* slide = iSlideArray->At( aSlideNum );
+    if ( slide->ObjectCount() )
+        {
+        //__ASSERT_DEBUG( EFalse, DataUtilsPanic( EMmsSlideNotEmpty ) );
+        return;
+        }
+
+    iSlideArray->Delete( aSlideNum );
+    delete slide;
+    //MsgDataUTILSLOGGER_WRITE( "CUniSmilModel: Empty slide removed." );
+    iSizeEstimateUpToDate = EFalse;
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::MoveSlideL
+//
+//
+// ---------------------------------------------------------
+//
+EXPORT_C void CUniSmilModel::MoveSlideL( TInt aSlideToMove, TInt aPlaceToMove ) 
+    {
+    TInt slideCount = iSlideArray->Count();
+    if ( !slideCount
+        || aSlideToMove < 0
+        || aSlideToMove >= slideCount
+        || aSlideToMove == aPlaceToMove )
+        {
+        return;
+        }
+    TInt place = Min( Max( 0, aPlaceToMove ), slideCount - 1 );
+    CUniSmilSlide* slide = iSlideArray->At( aSlideToMove );
+
+    iSlideArray->Delete( aSlideToMove );
+    iSlideArray->InsertL( place, slide );
+    iSizeEstimateUpToDate = EFalse;
+    }
+
+// ---------------------------------------------------------
+// SortSlidesL
+//
+// Sorts slides accoring to a separate comparison function
+// called SortSlidesCompare().
+//
+// Insertion sort algorithm.
+//
+// Notice! Intended to be used with SendAs when there
+// are multiple slides - each slide containing only
+// one object
+// ---------------------------------------------------------
+EXPORT_C void CUniSmilModel::SortSlidesL() 
+    {
+    TInt i = 1; // index 1, i.e. second slide
+    TInt count = SlideCount();
+    while ( i < count )
+        {
+        CUniSmilSlide* slide1 = iSlideArray->At( i );
+        TInt j = i - 1;
+        while ( j >= 0 )
+            {
+            CUniSmilSlide* slide2 = iSlideArray->At( j );
+            if ( SortSlidesCompare( slide1, slide2 ) > 0 )
+                {
+                break;
+                }
+            j--;
+            }
+        j++;
+        if ( j < i )
+            {
+            // slide1 was not in the right place
+            iSlideArray->Delete( i );
+            iSlideArray->InsertL( j, slide1 );
+            }
+        i++;
+        }
+    iSizeEstimateUpToDate = EFalse;
+    }
+
+
+// ---------------------------------------------------------
+// SortSlidesCompare
+//
+// Compares slides according to time. Most recent is greatest.
+//
+// Empty slides are greater than non-empty slides.
+// If aSlide1 "is greater than" aSlide2 returns positive value.
+// If aSlide1 "is smaller than" aSlide2 returns negative value.
+// If aSlide1 and aSlide2 "are equal" returns zero.
+// ---------------------------------------------------------
+//
+TInt CUniSmilModel::SortSlidesCompare( CUniSmilSlide* aSlide1,
+                                      CUniSmilSlide* aSlide2 )
+    {
+    if ( !aSlide1->ObjectCount() )
+        {
+        //if both are empty returns 0
+        //if slide2 is non-empty -> slide1 "is greater"
+        return aSlide2->ObjectCount();
+        }
+    else if ( !aSlide2->ObjectCount() )
+        {
+        //empty slide is always "greatest"
+        return -1;
+        }
+    else
+        {
+        TTime time1;
+        TTime time2;
+        aSlide1->GetObjectByIndex( 0 )->MediaInfo()->ModificationTime( time1 );
+        aSlide2->GetObjectByIndex( 0 )->MediaInfo()->ModificationTime( time2 );
+        if ( time1 < time2 )
+            {
+            return -1;
+            }
+        else if ( time1 == time2 )
+            {
+            return 0;
+            }
+        else
+            {
+            return 1;
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::IsSlide
+//
+//
+// ---------------------------------------------------------
+//
+EXPORT_C TBool CUniSmilModel::IsSlide( TInt aSlideNum ) const
+    {
+    if( aSlideNum >= 0 &&
+        aSlideNum < iSlideArray->Count() )
+        {
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::AddTextObjectL
+//
+// ---------------------------------------------------------
+//
+EXPORT_C CUniTextObject* CUniSmilModel::AddTextObjectL(
+    TInt aSlideNum, 
+    CEikRichTextEditor* aText )
+    {
+    CUniTextObject* obj = CUniTextObject::NewLC( iFs, iMtm, iData, aText );
+    iObjectList.AddObjectL( obj );
+    CleanupStack::Pop( obj );
+    iSlideArray->At(aSlideNum)->AddObjectL( obj );
+    iSizeEstimateUpToDate = EFalse;
+    return obj;
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::AddTempObjectL
+//
+// ---------------------------------------------------------
+//
+/*
+EXPORT_C CUniObject* CUniSmilModel::AddTempObjectL( TInt aSlideNum,
+                                            CMsgMediaInfo* aMedia )
+    {
+    if ( !IsSlide( aSlideNum ) )
+        {
+        User::Leave( KErrArgument );
+        }
+
+    CUniObject* obj = CUniObject::NewLC( iFs, iMtm, iData, aMedia );
+
+    // Update model
+    iObjectList.AddObjectL( obj );
+    CleanupStack::Pop( obj );
+    iSlideArray->At( aSlideNum )->AddObjectL( obj );
+    SetLayoutFromObjectTypeL( obj->MediaType() );
+    iSizeEstimateUpToDate = EFalse;
+    return obj;
+    }
+*/
+
+// ---------------------------------------------------------
+// CUniSmilModel::AddObjectL
+//
+// ---------------------------------------------------------
+//
+EXPORT_C CUniObject* CUniSmilModel::AddObjectL( MUniObjectSaveObserver& aObserver,
+                                               TInt aSlideNum,
+                                               CMsgMediaInfo* aMedia )
+    {
+    if ( !IsSlide( aSlideNum ) )
+        {
+        User::Leave( KErrArgument );
+        }
+
+    CUniObject* obj = CUniObject::NewLC( iFs, iMtm, iData, aMedia );
+
+    // Update model
+    iObjectList.AddObjectL( obj );
+    CleanupStack::Pop( obj );
+    obj->Save( aObserver, CMsvAttachment::EMsvLinkedFile );
+    iSlideArray->At(aSlideNum)->AddObjectL( obj );
+    iSizeEstimateUpToDate = EFalse;
+    return obj;
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::AddStoredObjectL
+//
+// ---------------------------------------------------------
+//
+EXPORT_C CUniObject* CUniSmilModel::AddStoredObjectL( TInt aSlideNum,
+                                                     TMsvAttachmentId aAttachmentId,
+                                                     CMsgMediaInfo* aMedia )
+    {
+    if ( !IsSlide( aSlideNum ) )
+        {
+        User::Leave( KErrArgument );
+        }
+
+    CMsvStore* store = iMtm.Entry().EditStoreL();
+    CleanupStack::PushL( store );
+    MMsvAttachmentManager& manager = store->AttachmentManagerL();
+    MMsvAttachmentManagerSync& managerSync = store->AttachmentManagerExtensionsL();
+    CMsvAttachment* attachment = manager.GetAttachmentInfoL( aAttachmentId );
+    CleanupStack::PushL( attachment );
+
+    CUniObject* obj = NULL;
+
+    if ( aMedia &&
+         aMedia->MediaType() == EMsgMediaText )
+        {
+        CMsgTextInfo* textInfo = static_cast<CMsgTextInfo*>( aMedia );
+        obj = CUniTextObject::NewLC( iFs, iMtm, iData, textInfo, manager, *attachment );
+        }
+    else
+        {
+        obj = CUniObject::NewLC( iFs, iMtm, iData, aMedia, manager, *attachment );
+        }
+    managerSync.ModifyAttachmentInfoL( attachment );
+    CleanupStack::Pop( 2, attachment ); //obj, attachment
+    CleanupStack::PushL( obj );
+    store->CommitL();
+
+    // Update model
+    iObjectList.AddObjectL( obj );
+    CleanupStack::Pop( obj );
+    CleanupStack::PopAndDestroy( store );
+    iSlideArray->At(aSlideNum)->AddObjectL( obj );
+    iSizeEstimateUpToDate = EFalse;
+    return obj;
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::RemoveObjectL
+//
+//
+// ---------------------------------------------------------
+//
+EXPORT_C void CUniSmilModel::RemoveObjectL( TInt aSlideNum, 
+                                            CUniObject* aObject, 
+                                            TBool aLeaveToStore/* = EFalse*/ )
+    {
+    if ( !IsSlide( aSlideNum ) ||
+        !iSlideArray->At( aSlideNum )->IsObject( aObject ) )
+        {
+        return;
+        }
+    // TODO: Check that object exists on the slide.
+
+    //if ( !IsObject( aSlideNum, aObjectType ) )
+    //    {
+    //    return;
+    //    }
+    DoRemoveObjectL( aSlideNum, aObject, aLeaveToStore );
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::RemoveObjectByIndexL
+//
+//
+// ---------------------------------------------------------
+//
+EXPORT_C void CUniSmilModel::RemoveObjectByIndexL( TInt aSlideNum, TInt aObjectNum )
+    {
+    if ( !IsSlide( aSlideNum ) )
+        {
+        return;
+        }
+    CUniObject* obj = iSlideArray->At( aSlideNum )->GetObjectByIndex( aObjectNum );
+    DoRemoveObjectL( aSlideNum, obj );
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::DoRemoveObjectL
+//
+//
+// ---------------------------------------------------------
+//
+void CUniSmilModel::DoRemoveObjectL( TInt aSlideNum, CUniObject* aObject, TBool aLeaveToStore/* = EFalse*/ )
+    {
+    //MsgDataUTILSLOGGER_ENTERFN( "CUniSmilModel : DoRemoveObjectL()" );
+
+    TBool removeObj = ( aObject->ReferenceCount() - 1 <= 0 );
+    //if last reference was (will be) removed, remove from
+    //attachment list (and msg store)
+    if ( removeObj )
+        {
+        //MsgDataUTILSLOGGER_WRITE( "CUniSmilModel: Removing from atta list and store." );
+        iObjectList.RemoveObjectL( aObject, !aLeaveToStore );
+        }
+
+    CUniSmilSlide* slide = iSlideArray->At( aSlideNum );
+    slide->RemoveObject( aObject );
+    iSizeEstimateUpToDate = EFalse;
+
+    if ( removeObj )
+        {
+        delete aObject;
+        }
+
+    //MsgDataUTILSLOGGER_LEAVEFN( "CUniSmilModel : DoRemoveObjectL()" );
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::GetObject
+//
+//
+// ---------------------------------------------------------
+//
+EXPORT_C CUniObject* CUniSmilModel::GetObjectByIndex( TInt aSlideNum, 
+                                                     TInt aObjectNum ) const
+    {
+    if( !IsSlide( aSlideNum ) )
+        {
+        return NULL;
+        }
+    return iSlideArray->At( aSlideNum )->GetObjectByIndex( aObjectNum );
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::GetObject
+//
+//
+// ---------------------------------------------------------
+//
+EXPORT_C CUniObject* CUniSmilModel::GetObject( TInt aSlideNum, 
+                                              TUniRegion aRegion ) const
+    {
+    if( !IsSlide( aSlideNum ) )
+        {
+        return NULL;
+        }
+    return iSlideArray->At( aSlideNum )->GetObject( aRegion );
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::SetLayoutL
+//
+// Mutator.
+// ---------------------------------------------------------
+//
+EXPORT_C void CUniSmilModel::SetLayoutL( TUniLayout aNewLayout ) 
+    {
+    iSlideLayout = aNewLayout;
+    TUint slideCnt = iSlideArray->Count();
+    for (TUint i = 0; i < slideCnt; i++ )
+        {
+        iSlideArray->At(i)->UpdateLayoutL( iSlideLayout );
+        }
+    iSizeEstimateUpToDate = EFalse;
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::SmilComposeSize()
+//
+// Total size
+// ---------------------------------------------------------
+//
+EXPORT_C TInt CUniSmilModel::SmilComposeSize()
+    {
+    TInt slideCount = iSlideArray->Count();
+    if ( !slideCount )
+        {
+        return 0;
+        }
+    if ( !iSizeEstimateUpToDate )
+        {
+        iSizeEstimate = SmilComposeSize(
+            slideCount,
+            iSlideArray->At( slideCount - 1 )->ObjectCount() );
+        iSizeEstimateUpToDate = ETrue;
+        }
+    return iSizeEstimate;
+    }
+
+
+// ---------------------------------------------------------
+// CUniSmilModel::SmilComposeSize()
+//
+// Size from beginning
+// ---------------------------------------------------------
+//
+EXPORT_C TInt CUniSmilModel::SmilComposeSize( TInt aToSlideNum, TInt aToObjectNum )
+    {
+    //__ASSERT_DEBUG(
+    //    ( aToSlideNum > 0 && aToSlideNum <= iSlideArray->Count() ),
+    //    DataUtilsPanic( EMmsIllegalSlide ) );
+    //__ASSERT_DEBUG(
+    //    ( aToObjectNum <= iSlideArray->At( aToSlideNum - 1 )->ObjectCount() ),
+    //    DataUtilsPanic( EMmsIllegalObject ) );
+
+    TInt size( KSizeMandatorySmilTags );
+    TBool imageRegion = EFalse;
+    TBool textRegion = EFalse;
+
+    for ( TInt i = 0; i < aToSlideNum; ++i )
+        {
+        CUniSmilSlide* slide = iSlideArray->At( i );
+        TInt toObj = slide->ObjectCount();
+        if ( i == aToSlideNum - 1 )
+            {
+            toObj = aToObjectNum;
+            }
+        if ( !toObj )
+            {
+            //No objects on the slide
+            size += KSizeEmptyPar;
+            }
+        else
+            {
+            //One or more objects
+            size += KSizeNonEmptyPar;
+            }
+        for ( TInt ii = 0; ii < toObj; ++ii )
+            {
+            CUniObject* obj = slide->GetObjectByIndex( ii );
+            switch ( obj->MediaType() )
+                {
+                case EMsgMediaAudio:
+                    size += KSizeAudioTag;
+                    break;
+                case EMsgMediaImage:
+                case EMsgMediaSvg:
+                    size += KSizeImageTag;
+                    imageRegion = ETrue;
+                    break;
+                case EMsgMediaText:
+                case EMsgMediaXhtml:
+                    size += KSizeTextTag;
+                    textRegion = ETrue;
+                    break;
+                case EMsgMediaVideo:
+                    size += KSizeVideoTag;
+                    imageRegion = ETrue;
+                    break;
+                default:
+                    //Should never come here
+                    //Don't increase size
+                    break;
+                }
+            }
+        }
+
+    TInt regions = 0;
+    if ( imageRegion )
+        {
+        regions++;
+        }
+    if ( textRegion )
+        {
+        regions++;
+        }
+    switch ( regions )
+        {
+        case 1:
+            size += KSizeHeadOneRegion;
+            break;
+        case 2:
+            size += KSizeHeadTwoRegions;
+            break;
+        default:
+            //Should be zero
+            //Don't increase size
+            break;
+        }
+    return size;
+    }
+
+
+// ---------------------------------------------------------
+// CUniSmilModel::ObjectCount
+//
+// Accessor
+// ---------------------------------------------------------
+//
+EXPORT_C TInt CUniSmilModel::ObjectCount() const
+    {
+    TInt objCnt(0);
+
+    for ( TInt i = iSlideArray->Count(); --i >= 0 ;)
+        {
+        objCnt += iSlideArray->At(i)->ObjectCount();
+        }
+
+    return objCnt;
+    }
+
+
+// ---------------------------------------------------------
+// CUniSmilModel::SlideObjectCount
+//
+// Accessor
+// ---------------------------------------------------------
+//
+EXPORT_C TInt CUniSmilModel::SlideObjectCount(TInt aSlideNum) const
+    {
+    if ( !IsSlide(aSlideNum) )
+        {
+        return 0;
+        }
+
+    return iSlideArray->At( aSlideNum )->ObjectCount();
+    }
+
+//**********************************************************
+//*
+//* CONTRUCTION FUNCTIONS
+//*
+//**********************************************************
+
+
+// ---------------------------------------------------------
+// CUniSmilModel::ConstructL
+//
+// 2nd phase constructor.
+// ---------------------------------------------------------
+//
+void CUniSmilModel::ConstructL()
+    {
+    iSlideArray = new ( ELeave ) CSmilSlideArray( KSlideArrayGranularity );
+    iTextRegionId.Set( KNullDesC );
+    iImageRegionId.Set( KNullDesC );
+
+    // Set default layout to "Text first"
+    iSlideLayout = EUniTextFirst;
+
+    // Fix for NSIA-6CKFJA. Sets same screen size that SMIL Player is using. MH
+/*
+    TRect appWindowRect;
+    AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EApplicationWindow, appWindowRect );
+
+    TAknLayoutRect mainPane;
+    mainPane.LayoutRect( appWindowRect, AknLayoutScalable_Avkon::main_pane( 0 ) );
+
+    TAknLayoutRect mainSmilPane;
+    mainSmilPane.LayoutRect( mainPane.Rect(), AknLayoutScalable_Apps::main_smil_pane() );
+
+    iScreenSize = mainSmilPane.Rect().Size();
+*/
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::Reset
+//
+//
+// ---------------------------------------------------------
+//
+void CUniSmilModel::Reset()
+    {
+    iParseResult = 0;
+    iSlideLayout = EUniTextFirst;
+    iTextRegionId.Set( KNullDesC );
+    iImageRegionId.Set( KNullDesC );
+    if ( iSlideArray )
+        {
+        // Reset slide array
+        iSlideArray->ResetAndDestroy();
+        }
+    TInt objCount = iObjectList.Count();
+    while ( objCount-- )
+        {
+        iObjectList.GetByIndex( objCount )->SetReferenceCount( 0 );
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::DoPresentationFromDomL
+//
+// When this functios is called DOM should be validated as MMS SMIL.
+// ---------------------------------------------------------
+//
+void CUniSmilModel::DoPresentationFromDomL( CMDXMLDocument* aDom )
+    {
+    RemoveMetaTagsAndComments( aDom );
+    // Resolve layout of the slide
+    iSlideLayout = GetMmsSmilLayout( aDom );
+
+    CMDXMLNode* node = GetNode( aDom, KSMILWREleBody );
+
+    if ( node && node->FirstChild() )
+        {
+        // Only one slide in the message since no <par> tag found
+        if ( node->FirstChild()->NodeName().Compare( KSMILWRElePar ) != 0 )
+            {
+            // Add slide - the one and only
+            AddSlideFromDomL( node );
+            }
+
+        // Other node types than <par> not possible as this is MMS SMIL.
+        else
+            {
+            // Traverse through every page
+            CMDXMLNode* page = node->FirstChild();
+            while ( page )
+                {
+                AddSlideFromDomL( page );
+                // Go to next page.
+                page = page->NextSibling();
+                }
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::AddSlideFromDomL
+//
+// ---------------------------------------------------------
+//
+void CUniSmilModel::AddSlideFromDomL( CMDXMLNode* aPage )
+    {
+    CUniObject* obj = NULL;
+    CUniSmilSlide* slide = DoAddSlideL();
+    CMDXMLNode* node = aPage->FirstChild();
+
+    // Traverse through every object in page.
+    while ( node )
+        {
+        if ( UniSmilUtils::IsMediaElem( node ) )
+            {
+            obj = iObjectList.GetByNodeL( node );
+            if ( obj )
+                {
+                if ( slide )
+                    {
+                    obj->SetMediaTypeBySmilTag( UniSmilUtils::MediaElemType( node ) );
+                    AddObjectFromDomL(
+                        slide,
+                        obj,
+                        GetRegionType( node ) );
+                    }
+                else
+                    {
+                    iObjectList.RemoveObjectL( obj, ETrue );
+                    delete obj;
+                    iParseResult |= EObjectRemoved;
+                    }
+                }
+            }
+        node = node->NextSibling();
+        }
+    }
+
+
+// ---------------------------------------------------------
+// CUniSmilModel::AddObjectFromDomL
+//
+// ---------------------------------------------------------
+//
+void CUniSmilModel::AddObjectFromDomL( CUniSmilSlide* aSlide,
+                                       CUniObject* aObj,
+                                       TUniRegion aRegion )
+    {
+    if ( !aObj )
+        {
+        // Smil presentation refers to attachment that's not in the message
+        iParseResult |= EMissingObjects;
+        // Not actually error that should prevent message viewing.
+        return;
+        }
+
+    TMsgMediaType mediaBySmilTag = aObj->MediaTypeBySmilTag();
+    TMsgMediaType media = aObj->MediaType();
+
+    if ( media == EMsgMediaSvg )
+        {
+        // SVG considered an image.
+        // (...because "image" tag is used for SVG while composing SMIL.)
+        media = EMsgMediaImage;
+        }
+
+    if ( media == EMsgMediaXhtml )
+        {
+        // XHTML is considered as a text.
+        // (...because "text" tag is used for xhtml while composing SMIL.)
+        media = EMsgMediaText;
+        }
+
+    if ( !( media == EMsgMediaText ||
+        media == EMsgMediaImage ||
+        media == EMsgMediaAudio ||
+        media == EMsgMediaVideo ) )
+        {
+        // Unsupported format
+        //MsgDataUTILSLOGGER_WRITE( "CUniSmilModel: Parsing: Message has unsupported objects." );
+        iParseResult |= EUnsupportedObjects;
+        // Not actually error that should prevent message viewing.
+        }
+
+    //  NOTE: Smil standard allows <img src="aa.txt"> references, but conformance
+    //        Data forbids these.
+    if ( media != EMsgMediaUnknown &&   //Unknown matches anything
+         mediaBySmilTag != EMsgMediaRef &&    //<ref> matches anything
+         media != mediaBySmilTag )
+        {
+        // SMIL does not describe content as it should
+        //MsgDataUTILSLOGGER_WRITE( "CUniSmilModel: Parsing: Smil object type differs from message object type." );
+        iParseResult |= EBadlyReferencedObjects;
+        }
+
+    TUniRegion regionBySmilTag = EUniRegionUnresolved;
+    switch ( mediaBySmilTag )
+        {
+        case EMsgMediaAudio:
+            {
+            regionBySmilTag = EUniRegionAudio;
+            break;
+            }
+        case EMsgMediaImage:
+        case EMsgMediaVideo:
+            {
+            regionBySmilTag = EUniRegionImage;
+            break;
+            }
+        case EMsgMediaText:
+            {
+            regionBySmilTag = EUniRegionText;
+            break;
+            }
+        default:
+            break;
+        }
+
+    TUniRegion regionByMediaType = EUniRegionUnresolved;
+    switch ( media )
+        {
+        case EMsgMediaAudio:
+            {
+            regionByMediaType = EUniRegionAudio;
+            break;
+            }
+        case EMsgMediaImage:
+        case EMsgMediaVideo:
+            {
+            regionByMediaType = EUniRegionImage;
+            break;
+            }
+        case EMsgMediaText:
+            {
+            regionByMediaType = EUniRegionText;
+            break;
+            }
+        default:
+            break;
+        }
+
+    // Check that region type matches object media type
+    if ( aRegion != EUniRegionUnresolved &&
+        regionByMediaType != EUniRegionUnresolved &&
+        aRegion != regionByMediaType )
+        {
+        iParseResult |= ERegionMediaTypeMismatch;
+        aRegion = regionByMediaType;
+        }
+    else if ( regionByMediaType == EUniRegionUnresolved &&
+              aRegion == EUniRegionText )
+        {
+        // do not put every possible content into text reqion
+        iParseResult |= ERegionMediaTypeMismatch;
+        aRegion = EUniRegionUnresolved;
+        }
+    else if ( aRegion == EUniRegionUnresolved )
+        {
+        // If region couldn't be resolved from the region tag
+        // follow the media type. If that's not possible follow
+        // the smil media tag name. If everything fails
+        // "aRegion" will remain "unresolved".
+        aRegion = ( regionByMediaType != EUniRegionUnresolved )
+            ? regionByMediaType
+            : regionBySmilTag;
+        }
+
+    CMsgMediaInfo* mediaInfo = aObj->MediaInfo();
+    // DRM2 must be put into object view in the viewer
+    if ( mediaInfo  &&
+         ( /*mediaInfo->HandlerApplicationUid().iUid == 0 ||*/
+           aObj->MediaInfo()->Protection() & EFileProtDrm2 ) )
+        {
+        aRegion = EUniRegionUnresolved;
+        }
+    // else - should not occur
+
+    if ( aRegion != EUniRegionUnresolved )
+        {
+        aSlide->AddObjectL( aObj, aRegion );
+        iSizeEstimateUpToDate = EFalse;
+        }
+    else
+        {
+        iParseResult |= EBadlyReferencedObjects;
+        // -> Something unknown in the SMIL.
+        // -> Don't add. Will be handled as an attachment.
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::IsMessageSlide
+//
+// ---------------------------------------------------------
+//
+TBool CUniSmilModel::IsMessageSlide()
+    {
+    TInt imageCnt( 0 );
+    TInt audioCnt( 0 );
+    TInt textCnt( 0 );
+
+    for ( TInt i = iObjectList.Count(); --i >= 0 ; )
+        {
+        switch( iObjectList.GetByIndex(i)->MediaType() )
+            {
+            case EMsgMediaSvg:
+            case EMsgMediaImage:
+                imageCnt++;
+                break;
+
+            case EMsgMediaAudio:
+                audioCnt++;
+                break;
+
+            case EMsgMediaText:
+            case EMsgMediaXhtml:
+                textCnt++;
+                break;
+
+            case EMsgMediaVideo:
+                //always consider video as image + audio
+                imageCnt++;
+                audioCnt++;
+                break;
+
+            case EMsgMediaUnknown:
+            default:
+                //  Unsupported objects will be put into attachment list
+                //  in FindAttachmentsL()
+                break;
+            } // switch
+        } // for
+
+    if ( imageCnt > 1 || audioCnt > 1 || textCnt  > 1 )
+        {
+        return EFalse;
+        }
+
+    return ETrue;
+    }
+
+// ---------------------------------------------------------
+// DoNoSmilOneSlideL
+//
+// NOTE: Message should be a valid slide at this point.
+// ---------------------------------------------------------
+//
+void CUniSmilModel::DoNoSmilOneSlideL()
+    {
+    CUniSmilSlide* slide = NULL;
+
+    for ( TInt i = 0; i < iObjectList.Count(); ++i )
+        {
+        CUniObject* obj = iObjectList.GetByIndex(i);
+        TMsgMediaType media = obj->MediaType();
+        CMsgMediaInfo* mediaInfo = obj->MediaInfo();
+
+        // DRM2 must be put into objects view in the viewer
+        if ( ( media == EMsgMediaText ||
+               media == EMsgMediaXhtml ||
+               media == EMsgMediaImage ||
+               media == EMsgMediaSvg ||
+               media == EMsgMediaAudio ||
+               media == EMsgMediaVideo ) &&
+             mediaInfo &&
+             /*mediaInfo->HandlerApplicationUid().iUid &&*/
+             !( obj->MediaInfo()->Protection() & EFileProtDrm2 ) )
+            {
+            if ( !slide )
+                {
+                // Add slide
+                slide = DoAddSlideL();
+                }
+            slide->AddObjectL( obj );
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// DoNoSmilManySlideL
+//
+//
+// ---------------------------------------------------------
+//
+void CUniSmilModel::DoNoSmilManySlideL()
+    {
+    for ( TInt i = 0; i < iObjectList.Count(); ++i )
+        {
+        CUniObject* obj = iObjectList.GetByIndex(i);
+        if (obj == NULL)
+        	return;
+        	
+        TMsgMediaType media = obj->MediaType();
+        CMsgMediaInfo* mediaInfo = obj->MediaInfo();
+
+        // DRM2 must be put into objects view in the viewer
+        if ( ( media == EMsgMediaText ||
+               media == EMsgMediaXhtml ||
+               media == EMsgMediaImage ||
+               media == EMsgMediaSvg ||
+               media == EMsgMediaAudio ||
+               media == EMsgMediaVideo ) &&
+            mediaInfo &&
+            /*mediaInfo->HandlerApplicationUid().iUid &&*/
+             !( obj->MediaInfo()->Protection() & EFileProtDrm2 ) )
+            {
+            CUniSmilSlide* slide = DoAddSlideL();
+            if ( slide )
+                {
+                slide->AddObjectL( obj );
+                }
+            else
+                {
+                iObjectList.RemoveObjectL( obj, ETrue );
+                delete obj;
+                iParseResult |= EObjectRemoved;
+                i--;
+                }
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// DoAddSlideL
+//
+// ---------------------------------------------------------
+//
+CUniSmilSlide* CUniSmilModel::DoAddSlideL( TInt aSlideNum /*= -1*/ )
+    {
+    CUniSmilSlide* newSlide = NULL;
+    if ( iMaxSlideCount == 0 ||
+         iSlideArray->Count() < iMaxSlideCount )
+        {
+        newSlide = CUniSmilSlide::NewLC( iSlideLayout );
+        if ( aSlideNum == -1 || aSlideNum >= iSlideArray->Count() )
+            {
+            // Add to end of array
+            iSlideArray->AppendL( newSlide );
+            }
+        else
+            {
+            iSlideArray->InsertL( aSlideNum, newSlide );
+            }
+        CleanupStack::Pop( newSlide );  // newSlide
+        iSizeEstimateUpToDate = EFalse;
+        }
+    return newSlide;
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::CreateHeadL
+//
+// ---------------------------------------------------------
+void CUniSmilModel::CreateHeadL( CMDXMLDocument* aDom, CMDXMLElement* aRoot )
+    {
+
+    TPtrC name( KSMILWREleHead );
+    // Create Head node
+    CMDXMLElement* ele = CMDXMLElement::NewLC( ETrue, aDom, name );
+    // Append Head in Root node
+    aRoot->AppendChild( ele );
+
+    // Create Layout
+    CreateLayoutL( aDom, ele );
+    CleanupStack::Pop( ele );
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::ChangeLayoutL
+//
+// ---------------------------------------------------------
+EXPORT_C TBool CUniSmilModel::ChangeLayoutL( CMDXMLDocument* aDom )
+    {
+    TBool retVal = EFalse;
+    if ( aDom )
+        {
+        CMDXMLElement* layout = (CMDXMLElement*) GetNode( aDom, KSMILWREleLayout );
+        if ( !layout )
+            {
+            // No layout. Nothing to do without composing
+            // SMIL from scratch.
+            return EFalse;
+            }
+        CMDXMLElement* head = (CMDXMLElement*) layout->ParentNode();
+
+        // Read default smil parameters
+        if( !iSmilParams )
+            {
+            iSmilParams = CUniSmilParams::NewL( iFs );
+            }
+        CMDXMLElement* rootLayout = NULL;
+        CMDXMLElement* textRegion = NULL;
+        CMDXMLElement* imageRegion = NULL;
+
+        GetLayoutElements(
+            layout,
+            rootLayout,
+            textRegion,
+            imageRegion );
+
+        if ( rootLayout )
+            {
+            rootLayout->RemoveAttribute( KSMILWRParaWidth );
+            rootLayout->RemoveAttribute( KSMILWRParaHeight );
+            }
+
+        if ( textRegion )
+            {
+            textRegion->RemoveAttribute( KSMILWRParaFit );
+            textRegion->RemoveAttribute( KSMILWRParaTop );
+            textRegion->RemoveAttribute( KSMILWRParaLeft );
+            textRegion->RemoveAttribute( KSMILWRParaBottom );
+            textRegion->RemoveAttribute( KSMILWRParaRight );
+            textRegion->RemoveAttribute( KSMILWRParaHeight );
+            textRegion->RemoveAttribute( KSMILWRParaWidth );
+            }
+        if ( imageRegion )
+            {
+            imageRegion->RemoveAttribute( KSMILWRParaFit );
+            imageRegion->RemoveAttribute( KSMILWRParaTop );
+            imageRegion->RemoveAttribute( KSMILWRParaLeft );
+            imageRegion->RemoveAttribute( KSMILWRParaBottom );
+            imageRegion->RemoveAttribute( KSMILWRParaRight );
+            imageRegion->RemoveAttribute( KSMILWRParaHeight );
+            imageRegion->RemoveAttribute( KSMILWRParaWidth );
+            }
+
+        CreateLayoutL( aDom, head, rootLayout, layout, textRegion, imageRegion );
+        retVal = ETrue;
+        }
+    return retVal;
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::CorrectTimingL
+//
+// ---------------------------------------------------------
+EXPORT_C TBool CUniSmilModel::CorrectTimingL( CMDXMLDocument* aDom )
+    {
+    if ( aDom )
+        {
+        CMDXMLElement* body = static_cast<CMDXMLElement*>( GetNode( aDom, KSMILWREleBody ) );
+        if ( !body )
+            {
+            // No body. Nothing to do without composing
+            // SMIL from scratch.
+            return EFalse;
+            }
+
+        if ( body && body->FirstChild() )
+            {
+            // Only one slide in the message since no <par> tag found
+            if ( body->FirstChild()->NodeName().Compare( KSMILWRElePar ) != 0 &&
+                 !body->FirstChild()->NextSibling() )
+                {
+                // Correct slide timing to the one and only slide
+                CorrectSlideTimingL( body );
+                }
+            // Other node types than <par> not possible as this is MMS SMIL.
+            else
+                {
+                // Traverse through every page
+                CMDXMLNode* page = body->FirstChild();
+
+                while ( page != NULL )
+                    {
+                    if ( page->NodeName().Compare( KSMILWRElePar ) == 0 &&
+                         page->NodeType() == CMDXMLNode::EElementNode )
+                        {
+                        CMDXMLElement* pageElement = static_cast<CMDXMLElement*>( page );
+                        if ( !TimingSpecified( pageElement ) )
+                            {
+                            CorrectSlideTimingL( pageElement );
+                            }
+                        }
+                    // Go to next page.
+                    page = page->NextSibling();
+                    }
+                }
+            }
+        }
+
+    return ETrue;
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::IsSupportedMediaType
+//
+// ---------------------------------------------------------
+EXPORT_C TBool CUniSmilModel::IsSupportedMediaType( TMsgMediaType aMediaType ) const
+    {
+    if ( aMediaType == EMsgMediaAudio ||
+         aMediaType == EMsgMediaImage ||
+         aMediaType == EMsgMediaSvg ||
+         aMediaType == EMsgMediaXhtml ||
+         aMediaType == EMsgMediaVideo ||
+         aMediaType == EMsgMediaText )
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+
+// ---------------------------------------------------------
+// CUniSmilModel::CreateLayoutL
+//
+// ---------------------------------------------------------
+void CUniSmilModel::CreateLayoutL( CMDXMLDocument* aDom,
+                                  CMDXMLElement* aRoot,
+                                  CMDXMLElement* aRootLayout,
+                                  CMDXMLElement* aLayout,
+                                  CMDXMLElement* aTextRegion,
+                                  CMDXMLElement* aImageRegion )
+    {
+
+    TPtrC name( KSMILWREleLayout );
+    // Create Layout node
+    if ( !aLayout )
+        {
+        aLayout = CMDXMLElement::NewLC( ETrue, aDom, name );
+        // Append Layout in Head
+        aRoot->InsertBefore( NULL, aLayout );
+        CleanupStack::Pop(); // layout
+        }
+
+    // Do we have images and text-objects on a slide with other media objects and
+    // do we have any video
+    TInt hasVideo( 0 );
+    TInt hasImage( 0 );
+    TInt hasText( 0 );
+
+    // Do we have media, which is alone on a slide? Also calculate how medias are alone on a slide.
+    // Video overrides any image region, it is not needed
+    TInt hasImageOneAndOnly( 0 );
+    TInt hasTextOneAndOnly( 0 );
+
+    for( TInt i = 0; i < iSlideArray->Count(); ++i )
+        {
+        CUniSmilSlide* s = iSlideArray->At( i );
+        TBool hasVideoOnThisSlide = EFalse;
+        TBool hasImageOnThisSlide = EFalse;
+        TBool hasTextOnThisSlide = EFalse;
+
+        CUniObject* imageRegionObj = s->GetObject( EUniRegionImage );
+        if ( imageRegionObj )
+            {
+            if ( imageRegionObj->MediaType() == EMsgMediaVideo )
+                {
+                hasVideoOnThisSlide = ETrue;
+                hasVideo++;
+                }
+            else
+                {
+                hasImageOnThisSlide = ETrue;
+                hasImage++;
+                }
+            }
+        if ( s->GetObject( EUniRegionText ) )
+            {
+            hasTextOnThisSlide = ETrue;
+            hasText++;
+            }
+
+        if (    !hasVideoOnThisSlide
+            &&  hasImageOnThisSlide
+            &&  !hasTextOnThisSlide )
+            {
+            hasImageOneAndOnly++;
+            }
+        if (    !hasVideoOnThisSlide
+            &&  !hasImageOnThisSlide
+            &&  hasTextOnThisSlide )
+            {
+            hasTextOneAndOnly++;
+            }
+        }
+
+    // we know:
+    // how many media objects of each type there are totally in the message and
+    // whether some regions have alone on a slide
+    // we conclude:
+    // if a media object has been alone on the slide and there is
+    // only one media object in the whole message
+    // or if there are several images without other content or several texts on several slides
+    // without other content then the media object is alone on a slide
+    // and is only one of its type in the message
+    // but: video is exception. It handling is ignored here. Following big if() statement handles it
+    // by handling video before exception case resolved
+    if ( hasImageOneAndOnly == hasImage )
+        {
+        // image does not occur with some other region
+        hasImage = 0;
+        }
+    else
+        {
+        // image occurs with some other region on some slide
+        hasImageOneAndOnly = 0;
+        }
+
+    if ( hasTextOneAndOnly ==  hasText )
+        {
+        // text does not occur with some other region
+        hasText = 0;
+        }
+    else
+        {
+        // text occurs with some other region on some slide
+        hasTextOneAndOnly = 0;
+        }
+
+/*
+    TBool isLandscape( Layout_Meta_Data::IsLandscapeOrientation() );
+    TBool useSubQCIF( EFalse);
+
+    TRect appWin;
+    AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EApplicationWindow, appWin );
+    TAknLayoutRect mainPane;
+
+    if ( isLandscape )
+        {
+        mainPane.LayoutRect(
+            appWin,
+            AknLayoutScalable_Apps::main_pane( 4 ).LayoutLine() );
+        }
+    else
+        {
+        mainPane.LayoutRect(
+            appWin,
+            AknLayoutScalable_Apps::main_pane( 6 ).LayoutLine() );
+        }
+
+    if ( isLandscape &&
+         appWin.Height() == KSizeLowResWidth &&
+         appWin.Width() == KSizeLowResHeight )
+        {
+        useSubQCIF = ETrue;
+        }
+
+    TAknLayoutRect smilLayout;
+    smilLayout.LayoutRect(
+        mainPane.Rect(),
+        AknLayoutScalable_Apps::main_smil2_pane().LayoutLine() );
+
+    TAknLayoutRect rootLayout;
+    TAknLayoutRect textLayout;
+    TAknLayoutRect imageLayout;
+    TAknLayoutRect videoLayout;
+
+    // For reader about notation:
+    //             x + y == x and y are on the different slide
+    //             x,y == x and y are on the same slide
+    //             { <item> } item can occur 0 or more times
+    if ( hasText && hasImage && !hasVideo ) // text, image - no video
+        {
+        if ( isLandscape ) // landscape text & image
+            {
+            if ( iSlideLayout == EUniTextFirst )
+                {
+                rootLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_root_pane( 4 ).LayoutLine() );
+                textLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_text_pane( 4 ).LayoutLine() );
+                imageLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_image_pane( 3 ).LayoutLine() );
+                }
+            else
+                {
+                rootLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_root_pane( 2 ).LayoutLine() );
+                textLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_text_pane( 2 ).LayoutLine() );
+                imageLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_image_pane( 1 ).LayoutLine() );
+                }
+            }
+        else // portrait text & image
+            {
+            if ( iSlideLayout == EUniTextFirst )
+                {
+		        // Option 3 in the layout spec
+                rootLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_root_pane( 3 ).LayoutLine() );
+                textLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_text_pane( 3 ).LayoutLine() );
+                imageLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_image_pane( 2 ).LayoutLine() );
+                }
+            else
+                {
+		        // Option 1
+                rootLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_root_pane( 1 ).LayoutLine() );
+                textLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_text_pane( 1 ).LayoutLine() );
+                imageLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_image_pane( 0 ).LayoutLine() );
+                }
+            }
+        }
+    else if ( hasText && hasVideo ) // text, video or text, image + video
+        {
+        if ( isLandscape && useSubQCIF ) // landscape subQCIF text & video
+            {
+            if ( iSlideLayout == EUniTextFirst )
+                {
+                rootLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_root_pane( 13 ).LayoutLine() );
+                textLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_text_pane( 10 ).LayoutLine() );
+                videoLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_video_pane( 7 ).LayoutLine() );
+                }
+            else
+                {
+                rootLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_root_pane( 12 ).LayoutLine() );
+                textLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_text_pane( 9 ).LayoutLine() );
+                videoLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_video_pane( 6 ).LayoutLine() );
+                }
+            }
+        else if ( isLandscape && !useSubQCIF ) // landscape QCIF text & video
+            {
+            if ( iSlideLayout == EUniTextFirst )
+                {
+                rootLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_root_pane( 10 ).LayoutLine() );
+                textLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_text_pane( 8 ).LayoutLine() );
+                videoLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_video_pane( 4 ).LayoutLine() );
+                }
+            else
+                {
+                rootLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_root_pane( 9 ).LayoutLine() );
+                textLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_text_pane( 7 ).LayoutLine() );
+                videoLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_video_pane( 3 ).LayoutLine() );
+                }
+            }
+        else // portrait QCIF text & video
+            {
+            if ( iSlideLayout == EUniTextFirst )
+                {
+		        // Option 8
+                rootLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_root_pane( 8 ).LayoutLine() );
+                textLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_text_pane( 6 ).LayoutLine() );
+                videoLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_video_pane( 2 ).LayoutLine() );
+                }
+            else
+                {
+		        // Option 6
+                rootLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_root_pane( 6 ).LayoutLine() );
+                textLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_text_pane( 5 ).LayoutLine() );
+                videoLayout.LayoutRect(
+                    smilLayout.Rect(),
+                    AknLayoutScalable_Apps::smil2_video_pane( 0 ).LayoutLine() );
+                }
+            }
+        }
+    // cases left:
+    // - 1) text {+ text}
+    // - 2) text {+ text} + video
+    // - 3) text {+ text} + image { + image }
+    // - 4) image {+ image} + video, no text
+    // - 5) image {+ image}
+    // - 6) video
+    // - no visual media content
+    else if ( hasVideo )
+        {
+        // 2) 'text {+ text} + video',  4) 'image {+ image} + video, no text' or 6) 'video'
+        if ( isLandscape )
+            {
+            rootLayout.LayoutRect(
+                smilLayout.Rect(),
+                AknLayoutScalable_Apps::smil2_root_pane( 11 ).LayoutLine() );
+            videoLayout.LayoutRect(
+                smilLayout.Rect(),
+                AknLayoutScalable_Apps::smil2_video_pane( 5 ).LayoutLine() );
+            }
+        else
+            {
+            // Option 7
+            rootLayout.LayoutRect(
+                smilLayout.Rect(),
+                AknLayoutScalable_Apps::smil2_root_pane( 7 ).LayoutLine() );
+            videoLayout.LayoutRect(
+                smilLayout.Rect(),
+                AknLayoutScalable_Apps::smil2_video_pane( 1 ).LayoutLine() );
+            }
+
+        if ( hasTextOneAndOnly ) // + text
+            {
+            // Option 0
+            rootLayout.LayoutRect(
+                smilLayout.Rect(),
+                AknLayoutScalable_Apps::smil2_root_pane( 0 ).LayoutLine() );
+            textLayout.LayoutRect(
+                smilLayout.Rect(),
+                AknLayoutScalable_Apps::smil2_text_pane( 0 ).LayoutLine() );
+            }
+
+        }
+    else if (   hasTextOneAndOnly
+            ||  hasImageOneAndOnly )
+        {
+        // 1) text {+ text}, 3) text {+ text} + image { + image ), 5) image {+ image}
+        if ( hasTextOneAndOnly ) // text
+            {
+            // Option 0
+            rootLayout.LayoutRect(
+                smilLayout.Rect(),
+                AknLayoutScalable_Apps::smil2_root_pane( 0 ).LayoutLine() );
+            textLayout.LayoutRect(
+                smilLayout.Rect(),
+                AknLayoutScalable_Apps::smil2_text_pane( 0 ).LayoutLine() );
+            }
+
+        // no else - rootLayouts are same
+        if ( hasImageOneAndOnly ) // image
+            {
+            // Option 5
+            rootLayout.LayoutRect(
+                smilLayout.Rect(),
+                AknLayoutScalable_Apps::smil2_root_pane( 5 ).LayoutLine() );
+            imageLayout.LayoutRect(
+                smilLayout.Rect(),
+                AknLayoutScalable_Apps::smil2_image_pane( 4 ).LayoutLine() );
+            }
+        }
+    else    // empty
+        {
+        rootLayout.LayoutRect(
+            smilLayout.Rect(),
+            AknLayoutScalable_Apps::smil2_root_pane( 0 ).LayoutLine() );
+        textLayout.LayoutRect(
+            smilLayout.Rect(),
+            AknLayoutScalable_Apps::smil2_text_pane( 0 ).LayoutLine() );
+        }
+
+    iSmilParams->iComposeParams->iDisplayHeight = rootLayout.Rect().Height();
+    iSmilParams->iComposeParams->iDisplayWidth = rootLayout.Rect().Width();
+
+    // it does not matter anymore whether object is alone on the slide.
+    // Use one variable only in the if() statements
+    if ( hasImage || hasImageOneAndOnly )
+        {
+        hasImage = 1;
+        }
+    if ( hasText || hasTextOneAndOnly )
+        {
+        hasText = 1;
+        }
+
+    if ( hasText )
+        {
+        iSmilParams->iTextRegionParams->iSize = textLayout.Rect().Size();
+        iSmilParams->iTextRegionParams->iTopLeft =
+            textLayout.Rect().iTl - rootLayout.Rect().iTl;
+        }
+    if ( hasImage || hasVideo )
+        {
+        if ( hasVideo )
+            {
+            iSmilParams->iImageRegionParams->iSize = videoLayout.Rect().Size();
+            iSmilParams->iImageRegionParams->iTopLeft =
+                videoLayout.Rect().iTl - rootLayout.Rect().iTl;
+            }
+        else
+            {
+            iSmilParams->iImageRegionParams->iSize = imageLayout.Rect().Size();
+            iSmilParams->iImageRegionParams->iTopLeft =
+                imageLayout.Rect().iTl - rootLayout.Rect().iTl;
+            }
+        }
+
+*/
+
+    // Set Region IDs to defaults
+    if ( !iImageRegionId.Length() )
+        {
+        iImageRegionId.Set( KSMILWRRegIDImage );
+        }
+    if ( !iTextRegionId.Length() )
+        {
+        iTextRegionId.Set( KSMILWRRegIDText );
+        }
+
+    // Create root layout
+    name.Set( KSMILWREleRoot_layout );
+    TBool rlPop = EFalse;
+    if ( !aRootLayout )
+        {
+        aRootLayout = CMDXMLElement::NewLC( EFalse, aDom, name );
+        rlPop = ETrue;
+        }
+    // Set root layout parameters (attributes)
+    TBuf16<20> val;
+    val.Zero();
+    val.Format( KSmilIntFormat, iSmilParams->iComposeParams->iDisplayWidth );
+    aRootLayout->SetAttributeL( KSMILWRParaWidth,val );
+    val.Zero();
+    val.Format( KSmilIntFormat, iSmilParams->iComposeParams->iDisplayHeight );
+    aRootLayout->SetAttributeL( KSMILWRParaHeight, val );
+    if ( rlPop )
+        {
+        // Append root layout in Layout
+        aLayout->AppendChild( aRootLayout );
+        CleanupStack::Pop( aRootLayout );
+        }
+
+    // Create Image region (if needed)
+    name.Set( KSMILWREleRegion );
+    if ( hasImage || hasVideo )
+        {
+        TBool imgPop = EFalse;
+        if ( !aImageRegion )
+            {
+            aImageRegion = CMDXMLElement::NewLC( EFalse, aDom, name );
+            imgPop = ETrue;
+            }
+        // Set Image region attributes
+        aImageRegion->SetAttributeL( KSMILWRParaId, iImageRegionId );
+        val.Zero();
+        val.Format( KSmilIntFormat, iSmilParams->iImageRegionParams->Width() );
+        aImageRegion->SetAttributeL( KSMILWRParaWidth, val );
+        val.Zero();
+        val.Format( KSmilIntFormat, iSmilParams->iImageRegionParams->Height() );
+        aImageRegion->SetAttributeL( KSMILWRParaHeight, val );
+        val.Zero();
+        val.Format( KSmilIntFormat, iSmilParams->iImageRegionParams->Top() );
+        aImageRegion->SetAttributeL( KSMILWRParaTop, val );
+        val.Zero();
+        val.Format( KSmilIntFormat, iSmilParams->iImageRegionParams->Left() );
+        aImageRegion->SetAttributeL( KSMILWRParaLeft, val );
+        aImageRegion->SetAttributeL( KSMILWRParaFit, iSmilParams->iImageRegionParams->iFit->Des() );
+        if ( imgPop )
+            {
+            // Append region in Layout
+            aLayout->AppendChild( aImageRegion ); // Ownership to dom
+            CleanupStack::Pop( aImageRegion );
+            }
+        }
+
+    // Create Text region (if needed)
+    if ( hasText )
+        {
+        TBool txtPop = EFalse;
+        if ( !aTextRegion )
+            {
+            aTextRegion = CMDXMLElement::NewLC( EFalse, aDom, name );
+            txtPop = ETrue;
+            }
+        // Set Text region attributes
+        aTextRegion->SetAttributeL( KSMILWRParaId, iTextRegionId );
+        val.Zero();
+        val.Format( KSmilIntFormat, iSmilParams->iTextRegionParams->Width() );
+        aTextRegion->SetAttributeL( KSMILWRParaWidth, val );
+        val.Zero();
+        val.Format( KSmilIntFormat, iSmilParams->iTextRegionParams->Height() );
+        aTextRegion->SetAttributeL( KSMILWRParaHeight, val );
+        val.Zero();
+        val.Format( KSmilIntFormat, iSmilParams->iTextRegionParams->Top() );
+        aTextRegion->SetAttributeL( KSMILWRParaTop, val );
+        val.Zero();
+        val.Format( KSmilIntFormat, iSmilParams->iTextRegionParams->Left() );
+        aTextRegion->SetAttributeL( KSMILWRParaLeft, val );
+        aTextRegion->SetAttributeL( KSMILWRParaFit, iSmilParams->iTextRegionParams->iFit->Des() );
+        if ( txtPop )
+            {
+            // Append region in Layout
+            aLayout->AppendChild( aTextRegion ); // Ownership to dom
+            CleanupStack::Pop( aTextRegion );
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::CreateBodyL
+//
+// ---------------------------------------------------------
+void CUniSmilModel::CreateBodyL( CMDXMLDocument* aDom, CMDXMLElement* aRoot )
+    {
+    TPtrC name( KSMILWREleBody );
+    // Create Body node
+    CMDXMLElement* body = CMDXMLElement::NewLC( ETrue, aDom, name );
+    // Append
+    aRoot->AppendChild( body );
+    CleanupStack::Pop( body );
+
+    // For each slide
+    for( TInt slide = 0; slide < iSlideArray->Count(); ++slide )
+        {
+        // Create par
+        CreateParL( aDom, body, slide );
+        }
+
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::CreateParL
+//
+// ---------------------------------------------------------
+void CUniSmilModel::CreateParL( CMDXMLDocument* aDom, CMDXMLElement* aRoot, TInt aSlide )
+    {
+    TPtrC name( KSMILWRElePar );
+    // Create par node
+    CMDXMLElement* ele = CMDXMLElement::NewLC( ETrue, aDom, name );
+    // Append
+
+    // Get default page duration.
+    TInt slideDur = iSmilParams->iComposeParams->iSlideDuration;
+    TInt objDur = 0;
+    TBool unresolvedDur = EFalse;
+
+    CUniSmilSlide* s = iSlideArray->At( aSlide );
+
+    // For each object in slide
+    for ( TInt i = s->ObjectCount(); --i >= 0; )
+        {
+        // Create Item
+        CUniObject* obj = s->GetObjectByIndex( i );
+        objDur = CreateItemL( aDom, ele, obj );
+        if ( !obj->MediaInfo()->Parsed() &&
+            ( obj->MediaType() == EMsgMediaAudio ||
+            obj->MediaType() == EMsgMediaVideo ) )
+            {
+            unresolvedDur = ETrue;
+            }
+        else
+            {
+            slideDur = Max( slideDur, objDur );
+            }
+        }
+
+    if ( !unresolvedDur )
+        {
+        TBuf16<20> val;
+        val.Zero();
+        val.Format( KSmilMsecFormat, slideDur );
+
+        // Set par attributes
+        ele->SetAttributeL( KSMILWRParaDur, val );
+        }
+    aRoot->AppendChild( ele ); // Ownership to dom
+    CleanupStack::Pop( ele );
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::CreateItemL
+//
+// ---------------------------------------------------------
+TInt CUniSmilModel::CreateItemL( CMDXMLDocument* aDom, CMDXMLElement* aRoot, CUniObject* aObj )
+    {
+    CMDXMLElement* ele = NULL;
+    TPtrC name( KNullDesC );
+
+    // Create mediaobject node
+    switch ( aObj->Region() )
+        {
+        case EUniRegionImage:
+            {
+            if ( aObj->MediaType() == EMsgMediaVideo )
+                {
+                name.Set( KSMILWREleVideo );
+                ele = CMDXMLElement::NewLC( EFalse, aDom, name );
+                ele->SetAttributeL( KSMILWRParaRegion, KSMILWRRegIDImage );
+                }
+            else
+                {
+                // Considered an image - includes also SVG
+                name.Set( KSMILWREleImg );
+                ele = CMDXMLElement::NewLC( EFalse, aDom, name );
+                ele->SetAttributeL( KSMILWRParaRegion, KSMILWRRegIDImage );
+                }
+            }
+            break;
+        case EUniRegionText:
+            {
+            name.Set( KSMILWREleText );
+            ele = CMDXMLElement::NewLC( EFalse, aDom, name );
+            ele->SetAttributeL( KSMILWRParaRegion, KSMILWRRegIDText );
+            }
+            break;
+        case EUniRegionAudio:
+            {
+            name.Set( KSMILWREleAudio );
+            ele = CMDXMLElement::NewLC( EFalse, aDom, name );
+            }
+            break;
+        default:
+            {
+            User::Leave( KErrNotSupported );
+            }
+        }
+
+    // Set MediaObject node attributes
+    ele->SetAttributeL( KSMILWRParaSrc, aObj->MimeInfo()->ContentLocation() );
+
+    // Append
+    aRoot->AppendChild( ele ); // Ownership to dom
+    CleanupStack::Pop( ele );
+
+    return aObj->MediaInfo()->Duration();
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::GetMediaElemRegionIDs
+//
+// ---------------------------------------------------------
+void CUniSmilModel::GetMediaElemRegionIDs( CMDXMLNode* aPage )
+    {
+    CMDXMLNode* txtEle = NULL;
+    CMDXMLNode* imgEle = NULL;
+    CMDXMLNode* obj = aPage->FirstChild();
+
+    // Traverse through every object in page.
+    while ( obj )
+        {
+        if( UniSmilUtils::IsMediaElem( obj ) )
+            {
+            TMsgMediaType type = UniSmilUtils::MediaElemType( obj );
+            switch ( type )
+                {
+                case EMsgMediaImage:
+                case EMsgMediaVideo:
+                    imgEle = obj;
+                    break;
+
+                case EMsgMediaText:
+                case EMsgMediaXhtml:
+                    txtEle = obj;
+                    break;
+
+                // TODO: REF
+                default:
+                    break;
+                }
+            }
+        obj = obj->NextSibling();
+        }
+
+    // Resolve ID:s
+    if ( !iTextRegionId.Length() && txtEle )
+        {
+        UniSmilUtils::GetRegionId( txtEle, iTextRegionId );
+        }
+    if ( !iImageRegionId.Length() && imgEle )
+        {
+        UniSmilUtils::GetRegionId( imgEle, iImageRegionId );
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::GetLayoutElements
+//
+// ---------------------------------------------------------
+void CUniSmilModel::GetLayoutElements( CMDXMLNode* aLayout,
+                                       CMDXMLElement*& aRlEle,
+                                       CMDXMLElement*& aTxtEle,
+                                       CMDXMLElement*& aImgEle )
+    {
+    if ( !aLayout )
+        {
+        return;
+        }
+
+    TPtrC value( KNullDesC );
+    CMDXMLNode* node = aLayout->FirstChild();
+
+    // Search REGIONS & RootLayout
+    while ( node )
+        {
+        // REGION PARAMETERS
+        if ( node->NodeName().CompareF( KSMILWREleRegion ) == 0 )
+            {
+
+            //UniSmilUtils::GetRegionId( node, value );
+            if( ((CMDXMLElement*) node)->IsAttributeSpecified( KSMILWRParaId ) )
+                {
+                ((CMDXMLElement*) node)->GetAttribute( KSMILWRParaId, value );
+                }
+            else
+                {
+                value.Set( KNullDesC );
+                }
+
+            // IMAGE REGION
+            if ( value.CompareF( iImageRegionId ) == 0 )
+                {
+                aImgEle = (CMDXMLElement*) node;
+                }
+
+            // TEXT REGION
+            else if ( value.CompareF( iTextRegionId ) == 0 )
+                {
+                aTxtEle = (CMDXMLElement*) node;
+                }
+
+            }
+        else if ( node->NodeName().CompareF( KSMILWREleRoot_layout ) == 0 )
+            {
+            aRlEle = (CMDXMLElement*) node;
+            }
+
+        node = node->NextSibling();
+
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::GetMmsSmilLayout
+//
+// ---------------------------------------------------------
+TUniLayout CUniSmilModel::GetMmsSmilLayout( CMDXMLDocument* aDom )
+    {
+    TUniLayout rval = EUniUndefinedLayout;
+
+    iTextRegionId.Set( KNullDesC );
+    iImageRegionId.Set( KNullDesC );
+
+    // --------------------------------------------
+    // Resolve region IDs used in media elements
+    // --------------------------------------------
+    CMDXMLNode* node = GetNode( aDom, KSMILWREleBody );
+    if ( !node )
+        {
+        return rval;
+        }
+
+    // Only one slide in the message since no <par> tag found
+    // Other node types than <par> not possible as this is MMS SMIL.
+    if ( node->FirstChild() )
+        {
+        if ( node->FirstChild()->NodeName().CompareF( KSMILWRElePar ) != 0 )
+            {
+            GetMediaElemRegionIDs( node );
+            }
+        else
+            {
+            CMDXMLNode* page = node->FirstChild();
+            while ( page )
+                {
+                GetMediaElemRegionIDs( page );
+
+                // Go to next page.
+                page = page->NextSibling();
+                }
+            }
+        }
+
+    // -------------------------------------
+    // Search layout elements
+    // -------------------------------------
+    node = GetNode( aDom, KSMILWREleLayout );
+    CMDXMLElement* rootLayout = NULL;
+    CMDXMLElement* textRegion = NULL;
+    CMDXMLElement* imageRegion = NULL;
+    GetLayoutElements( node, rootLayout, textRegion, imageRegion );
+
+    // ------------------------------
+    // Resolve Root Layout
+    // ------------------------------
+    TSize rootSize( 0, 0 );
+    GetRootLayoutSize( rootLayout, rootSize );
+
+    // ------------------------------------
+    // Resolve region parameters
+    // ------------------------------------
+    TRect imgRect( 0, 0, 0, 0 );
+    TRect txtRect( 0, 0, 0, 0 );
+    GetRegionRect( imageRegion, rootSize, imgRect );
+    GetRegionRect( textRegion, rootSize, txtRect );
+
+    // ------------------------------------
+    // Layout decision
+    // ------------------------------------
+    if ( textRegion && imageRegion )
+        {
+        if( imgRect.iTl.iY < txtRect.iTl.iY )
+            {
+            rval =  EUniImageFirst;
+            }
+        else if ( imgRect.iTl.iY > txtRect.iTl.iY )
+            {
+            rval = EUniTextFirst;
+            }
+        else
+            {
+            if ( imgRect.iTl.iX <= txtRect.iTl.iX )
+                {
+                rval = EUniImageFirst;
+                }
+            else
+                {
+                rval = EUniTextFirst;
+                }
+            }
+        }
+    else if ( textRegion )
+        {
+        rval = EUniTextFirst;
+        }
+    else // if ( iImgEle ) or none
+        {
+        rval = EUniImageFirst;
+        }
+
+    return rval;
+
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::GetRootLayoutSize
+//
+// ---------------------------------------------------------
+
+void CUniSmilModel::GetRootLayoutSize( CMDXMLElement* aRl, TSize& aSize )
+    {
+    TPtrC value( KNullDesC );
+
+    if ( aRl )
+        {
+        if( aRl->IsAttributeSpecified( KSMILWRParaWidth ) )
+            {
+            aRl->GetAttribute( KSMILWRParaWidth, value );
+            aSize.iWidth = UniSmilUtils::StringToIntValue( value, 0 );
+            }
+        else
+            {
+            aSize.iWidth = iScreenSize.iWidth;
+            }
+
+        if( aRl->IsAttributeSpecified( KSMILWRParaHeight ) )
+            {
+            aRl->GetAttribute( KSMILWRParaHeight, value );
+            aSize.iHeight = UniSmilUtils::StringToIntValue( value, 0 );
+            }
+        else
+            {
+            aSize.iHeight = iScreenSize.iHeight;
+            }
+        }
+    else
+        {
+        aSize = iScreenSize;
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::GetRegionRect
+//
+// ---------------------------------------------------------
+
+void CUniSmilModel::GetRegionRect( CMDXMLElement* aRegion, TSize aRoot, TRect& aRect )
+    {
+    TPtrC value;
+
+    TInt width = 0;
+    TInt height = 0;
+
+    if ( aRegion )
+        {
+        if( aRegion->IsAttributeSpecified( KSMILWRParaWidth ) )
+            {
+            aRegion->GetAttribute( KSMILWRParaWidth, value );
+            width = UniSmilUtils::StringToIntValue( value, 0 ) ;
+            if ( value.Locate( '%' ) != KErrNotFound )
+                {
+                width = width * aRoot.iWidth / 100;
+                }
+            }
+
+        if( aRegion->IsAttributeSpecified( KSMILWRParaHeight ) )
+            {
+            aRegion->GetAttribute( KSMILWRParaHeight, value );
+            height = UniSmilUtils::StringToIntValue( value, 0 ) ;
+            if ( value.Locate( '%' ) != KErrNotFound )
+                {
+                height = height * aRoot.iHeight / 100;
+                }
+            }
+
+        if( aRegion->IsAttributeSpecified( KSMILWRParaTop ) )
+            {
+            aRegion->GetAttribute( KSMILWRParaTop, value );
+            aRect.iTl.iY = UniSmilUtils::StringToIntValue( value, 0 );
+            if ( value.Locate( '%' ) != KErrNotFound )
+                {
+                aRect.iTl.iY = aRect.iTl.iY * aRoot.iHeight / 100;
+                }
+            }
+        else
+            {
+            aRect.iTl.iY = 0;
+            }
+
+        if( aRegion->IsAttributeSpecified( KSMILWRParaLeft ) )
+            {
+            aRegion->GetAttribute( KSMILWRParaLeft, value );
+            aRect.iTl.iX = UniSmilUtils::StringToIntValue( value, 0 );
+            if ( value.Locate( '%' ) != KErrNotFound )
+                {
+                aRect.iTl.iX = aRect.iTl.iX * aRoot.iWidth / 100;
+                }
+            }
+        else
+            {
+            aRect.iTl.iX = 0;
+            }
+
+        aRect.iBr.iY = aRect.iTl.iY + height;
+        aRect.iBr.iX = aRect.iTl.iX + width;
+
+        }
+    else
+        {
+        aRect = TRect( 0, 0, 0, 0 );
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::GetRegionType
+// ---------------------------------------------------------
+//
+TUniRegion CUniSmilModel::GetRegionType( CMDXMLNode* aNodePtr )
+    {
+    if ( iImageRegionId.CompareF( iTextRegionId ) == 0 )
+        {
+        // Image and text regions are the same!
+        // Literally taken this is agains MMS SMIL, but
+        // we should still tolerate it.
+        iParseResult |= ETextAndImageRegionsSame;
+        return EUniRegionUnresolved;
+        }
+    TPtrC regId;
+    TInt err = UniSmilUtils::GetRegionId( aNodePtr, regId );
+    if ( !err )
+        {
+        if ( regId.CompareF( iImageRegionId ) == 0 )
+            {
+            return EUniRegionImage;
+            }
+        else if ( regId.CompareF( iTextRegionId ) == 0 )
+            {
+            return EUniRegionText;
+            }
+        else
+            {
+            return EUniRegionUnresolved;
+            }
+        }
+    else
+        {
+        return EUniRegionUnresolved;
+        }
+    }
+
+
+// ---------------------------------------------------------
+// CUniSmilModel::GetNode
+//
+// ---------------------------------------------------------
+CMDXMLNode* CUniSmilModel::GetNode( CMDXMLDocument* aDom, const TDesC& aName )
+    {
+    CMDXMLNode* node = aDom->DocumentElement()->FirstChild();
+    while ( node )
+        {
+        if ( node->NodeName().CompareF( aName ) == 0 )
+            {
+            break;
+            }
+        else
+            {
+            node = UniSmilUtils::NextNode( node );
+            }
+        }
+    return node;
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::RemoveMetaTagsAndComments
+//
+// ---------------------------------------------------------
+void CUniSmilModel::RemoveMetaTagsAndComments( CMDXMLDocument* aDom )
+    {
+    CMDXMLNode* node = aDom->DocumentElement()->FirstChild();
+    while ( node )
+        {
+        if ( node->NodeType() == CMDXMLNode::ECommentNode ||
+            node->NodeName().CompareF( KSMILWREleMeta ) == 0 )
+            {
+            CMDXMLNode* removeNode = node;
+            node = removeNode->ParentNode();
+            /*TInt ignore =*/ node->RemoveChild( removeNode );
+            delete removeNode;
+            }
+        node = UniSmilUtils::NextNode( node );
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::CorrectSlideTimingL
+//
+// ---------------------------------------------------------
+void CUniSmilModel::CorrectSlideTimingL( CMDXMLElement* aPage )
+    {
+    CMDXMLNode* node = aPage->FirstChild();
+
+    // Traverse through every object in page.
+    while ( node != NULL )
+        {
+        if ( UniSmilUtils::IsMediaElem( node ) )
+            {
+            CMDXMLElement* nodeElement = static_cast<CMDXMLElement*>( node );
+
+            CUniObject* obj = iObjectList.GetByNodeL( node );
+
+            if( !obj ||
+                !obj->MediaInfo() ||
+                obj->MediaInfo()->Duration() != 0 ||
+                TimingSpecified( nodeElement ) )
+                {
+                // Return as non-static media was found from the page.
+                return;
+                }
+            else if ( nodeElement->IsAttributeSpecified( KSMILWRParaBegin ) )
+                {
+                // Remove invalid Begin element since no End or Dur attributes is specified.
+                nodeElement->RemoveAttribute( KSMILWRParaBegin );
+                }
+            else if ( nodeElement->IsAttributeSpecified( KSMILWRParaEnd ) )
+                {
+                // Remove invalid End element since no Begin or Dur attributes is specified.
+                nodeElement->RemoveAttribute( KSMILWRParaEnd );
+                }
+            }
+
+        node = node->NextSibling();
+        }
+
+    // Read default smil parameters
+    if ( !iSmilParams )
+        {
+        iSmilParams = CUniSmilParams::NewL( iFs );
+        }
+
+    TBuf16<20> defaultVal;
+    defaultVal.Zero();
+    defaultVal.Format( KSmilMsecFormat, iSmilParams->iComposeParams->iSlideDuration );
+
+    aPage->SetAttributeL( KSMILWRParaDur, defaultVal );
+    }
+
+// ---------------------------------------------------------
+// CUniSmilModel::TimingSpecified
+//
+// ---------------------------------------------------------
+TBool CUniSmilModel::TimingSpecified( CMDXMLElement* aNodePrt )
+    {
+    TBool result( EFalse );
+
+    // Timing is set if dur or begin & end parameters are found
+    if ( aNodePrt &&
+         ( aNodePrt->IsAttributeSpecified( KSMILWRParaDur ) ||
+           ( aNodePrt->IsAttributeSpecified( KSMILWRParaBegin ) &&
+             aNodePrt->IsAttributeSpecified( KSMILWRParaEnd ) ) ) )
+            {
+            result = ETrue;
+            }
+
+    return result;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/src/UniSmilParams.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,246 @@
+/*
+* 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: 
+*       Reads default parameters for composing SMIL from resource file
+*
+*
+*/
+
+
+// INCLUDE FILES
+#include <e32math.h>
+
+#include <barsread.h>
+#include <bautils.h>
+#include <data_caging_path_literals.hrh>
+
+#include <UniDataModel.rsg>
+
+#include "UniSmil.hrh"
+#include "UniSmilParams.h"
+#include "UniModelConst.h"
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// C++ default constructor can NOT contain any code, that
+// might leave.
+//
+CUniSmilParams::CUniSmilParams( const RFs& aSession ) : iSession( aSession )
+    {
+    }
+
+// Symbian OS default constructor can leave.
+void CUniSmilParams::ConstructL()
+    {
+    iComposeParams = new( ELeave ) TUniSmilComposeParam();
+    iImageRegionParams = new( ELeave ) TUniSmilRegionParam();
+    iTextRegionParams = new( ELeave ) TUniSmilRegionParam();
+    ReadResourcesL();
+    }
+
+// Two-phased constructor.
+EXPORT_C CUniSmilParams* CUniSmilParams::NewL( const RFs& aSession )
+    {
+    CUniSmilParams* self = new ( ELeave ) CUniSmilParams( aSession );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// Two-phased constructor.
+EXPORT_C CUniSmilParams* CUniSmilParams::NewLC( const RFs& aSession )
+    {
+    CUniSmilParams* self = new (ELeave) CUniSmilParams( aSession );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// Destructor
+CUniSmilParams::~CUniSmilParams()
+    {
+    delete iImageRegionParams;
+    delete iTextRegionParams;
+    delete iComposeParams;
+    }
+
+
+// ---------------------------------------------------------
+// CUniSmilParams::ReadResourcesL()
+//
+// ---------------------------------------------------------
+//
+void CUniSmilParams::ReadResourcesL()
+    {
+    RResourceFile resFile;
+    OpenResourceFileL( resFile );
+
+    ReadComposeParamResourcesL( resFile );
+    ReadImageRegionResourcesL( resFile );
+    ReadTextRegionResourcesL( resFile );
+
+    resFile.Close();
+    }
+
+// ---------------------------------------------------------
+// ReadComposeParamResourcesL()
+//
+// ---------------------------------------------------------
+//
+void CUniSmilParams::ReadComposeParamResourcesL(
+    const RResourceFile& aResFile )
+    {
+    TResourceReader reader;
+    HBufC8* buf = aResFile.AllocReadLC( R_COMPOSE_PARAMS );
+    reader.SetBuffer( buf );
+
+    iComposeParams->iRootLayoutCompose = reader.ReadInt16();
+    iComposeParams->iDisplayWidth      = reader.ReadInt16();
+    iComposeParams->iDisplayHeight     = reader.ReadInt16();
+    iComposeParams->iComposeXmlns      = reader.ReadInt16();
+    iComposeParams->iTopPadding        = reader.ReadInt16();
+    iComposeParams->iRegionPadding     = reader.ReadInt16();
+    iComposeParams->iBottomPadding     = reader.ReadInt16();
+
+    CleanupStack::PopAndDestroy( buf );
+
+    buf = aResFile.AllocReadLC( R_SLIDE_PARAMS );
+    reader.SetBuffer( buf );
+
+    iComposeParams->iSlideDuration = reader.ReadInt16();
+
+    CleanupStack::PopAndDestroy( buf );
+    }
+
+// ---------------------------------------------------------
+// CUniSmilParams::ReadImageRegionResourcesL
+//
+// ---------------------------------------------------------
+//
+void CUniSmilParams::ReadImageRegionResourcesL(
+    const RResourceFile& aResFile )
+    {
+    TResourceReader reader;
+    HBufC8* buf = aResFile.AllocReadLC( R_IMAGE_REGION_ATTRIBUTES );
+    reader.SetBuffer( buf );
+
+    TPtrC ptr;
+
+    // Id
+    ptr.Set( reader.ReadTPtrC() );
+    iImageRegionParams->iId = HBufC::NewL( ptr.Length() );
+    iImageRegionParams->iId->Des().Copy( ptr );
+
+    // Fit
+    ptr.Set( reader.ReadTPtrC() );
+    iImageRegionParams->iFit = HBufC::NewL( ptr.Length() );
+    iImageRegionParams->iFit->Des().Copy( ptr );
+
+    // Max/Min width/height
+    iImageRegionParams->iMaxSize.iHeight = reader.ReadInt16();   //r_max_height
+    iImageRegionParams->iMinSize.iHeight = reader.ReadInt16();   //r_min_height
+    iImageRegionParams->iMaxSize.iWidth = reader.ReadInt16();   //r_max_width
+    iImageRegionParams->iMinSize.iWidth = reader.ReadInt16();   //r_min_width
+
+    iImageRegionParams->iTopLeft.iY = reader.ReadInt16();         //r_top = 0;
+    iImageRegionParams->iTopLeft.iX = reader.ReadInt16();         //r_left = 0;
+
+    // Default Default ;)
+    iImageRegionParams->iSize = iImageRegionParams->iMaxSize;
+
+    CleanupStack::PopAndDestroy( buf );
+
+    // Make some sanity checks
+    if ( iImageRegionParams->iMaxSize.iHeight < iImageRegionParams->iMinSize.iHeight ||
+         iImageRegionParams->iMaxSize.iWidth  < iImageRegionParams->iMinSize.iWidth )
+        {
+        User::Leave( KErrArgument );
+        }
+
+    }
+
+
+// ---------------------------------------------------------
+// CUniSmilParams::ReadTextRegionResourcesL()
+//
+// ---------------------------------------------------------
+//
+void CUniSmilParams::ReadTextRegionResourcesL(
+    const RResourceFile& aResFile )
+    {
+    TResourceReader reader;
+    HBufC8* buf = aResFile.AllocReadLC( R_TEXT_REGION_ATTRIBUTES );
+    reader.SetBuffer( buf );
+
+    TPtrC ptr;
+
+    // Id
+    ptr.Set( reader.ReadTPtrC() );
+    iTextRegionParams->iId = HBufC::NewL( ptr.Length() );
+    iTextRegionParams->iId->Des().Copy( ptr );
+
+    // Fit
+    ptr.Set( reader.ReadTPtrC() );
+    iTextRegionParams->iFit = HBufC::NewL( ptr.Length() );
+    iTextRegionParams->iFit->Des().Copy( ptr );
+
+    // Max/Min width/height
+    //r_max_height
+    iTextRegionParams->iMaxSize.iHeight = reader.ReadInt16();
+    //r_min_height
+    iTextRegionParams->iMinSize.iHeight = reader.ReadInt16();
+    //r_max_width
+    iTextRegionParams->iMaxSize.iWidth = reader.ReadInt16();
+    //r_min_width
+    iTextRegionParams->iMinSize.iWidth = reader.ReadInt16();
+
+    //r_top = 0;
+    iTextRegionParams->iTopLeft.iY = reader.ReadInt16();
+    //r_left = 0;
+    iTextRegionParams->iTopLeft.iX = reader.ReadInt16();
+
+    // Default Default ;)
+    iTextRegionParams->iSize = iTextRegionParams->iMaxSize;
+
+    CleanupStack::PopAndDestroy( buf );
+
+    // Make some sanity checks
+    if ( iTextRegionParams->iMaxSize.iHeight < iTextRegionParams->iMinSize.iHeight ||
+         iTextRegionParams->iMaxSize.iWidth  < iTextRegionParams->iMinSize.iWidth )
+        {
+        User::Leave( KErrArgument );
+        }
+
+    }
+
+// ---------------------------------------------------------
+// CUniSmilParams::OpenResourceFileL()
+//
+// ---------------------------------------------------------
+//
+void CUniSmilParams::OpenResourceFileL( RResourceFile& aResFile )
+    {
+    TFileName fileName;
+    TParse parse;
+    parse.Set( KUniDataModelResourceFilename, &KDC_RESOURCE_FILES_DIR, NULL );
+    fileName = parse.FullName();
+    BaflUtils::NearestLanguageFile( iSession, fileName );
+    aResFile.OpenL( const_cast<RFs&>( iSession ), fileName );
+    aResFile.ConfirmSignatureL( KDefResFileSignature );
+    }
+
+//  End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/src/UniSmilSlide.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,319 @@
+/*
+* 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: 
+*       Provides MMS SMIL Slide methods.
+*
+*
+*/
+
+
+// ========== INCLUDE FILES ================================
+
+#include <e32def.h>
+#include <eikenv.h>
+#include <msvids.h>
+#include <msvstd.h>
+
+#include <MsgMedia.hrh>
+#include <MsgMediaInfo.h>
+
+#include "UniModelConst.h"
+#include "UniObject.h"    
+#include "UniSmilSlide.h"
+
+// ========== LOCAL CONSTANTS AND MACROS ===================
+
+const TUint KMaxObjectPerSlide( 3 );
+
+// ========== MEMBER FUNCTIONS =============================
+
+CUniSmilSlide* CUniSmilSlide::NewLC( TUniLayout aLayout )
+    {
+    CUniSmilSlide* self = new ( ELeave ) CUniSmilSlide( aLayout );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CUniSmilSlide::NewL
+//
+// Factory method.
+// ---------------------------------------------------------
+//
+CUniSmilSlide* CUniSmilSlide::NewL( TUniLayout aLayout )
+    {
+    CUniSmilSlide* self = NewLC( aLayout );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------
+// CUniSmilSlide::CUniSmilSlide
+//
+// Constructor.
+// ---------------------------------------------------------
+//
+CUniSmilSlide::CUniSmilSlide( TUniLayout aLayout ) :
+    iLayout( aLayout )
+    {
+    }
+
+// ---------------------------------------------------------
+// CUniSmilSlide::CUniSmilSlide
+//
+// Destructor.
+// ---------------------------------------------------------
+//
+ CUniSmilSlide::~CUniSmilSlide()
+    {
+    //Objects not owned by slide!!
+    //->ResetAndDestroy() not called.
+    delete iObjectArray;
+    }
+
+
+// ---------------------------------------------------------
+// CUniSmilSlide::AddObjectL
+//
+// Object should be valid for addition at this point ie 
+// should be checked that it can be added to slide.
+// Takes ownership of the aObject.
+// ---------------------------------------------------------
+//  
+void CUniSmilSlide::AddObjectL( CUniObject* aObject )
+    {
+    TUniRegion region = EUniRegionUnresolved;
+    switch ( aObject->MediaType() )
+        {
+        case EMsgMediaText:
+        case EMsgMediaXhtml:
+            {
+            region = EUniRegionText;
+            }
+            break;
+        case EMsgMediaAudio:
+            {
+            region = EUniRegionAudio;
+            }
+            break;
+#ifdef RD_SVGT_IN_MESSAGING
+        case EMsgMediaSvg:
+#endif
+        case EMsgMediaImage:
+        case EMsgMediaVideo:
+            {
+            region = EUniRegionImage;
+            }
+            break;
+        default:
+            {
+            User::Leave( KErrNotSupported );
+            }
+        }
+    AddObjectL( aObject, region );
+    }
+
+
+// ---------------------------------------------------------
+// CUniSmilSlide::AddObjectL
+//
+// Object should be valid for addition at this point ie 
+// should be checked that it can be added to slide.
+// Takes ownership of the aObject.
+// ---------------------------------------------------------
+//  
+void CUniSmilSlide::AddObjectL( CUniObject* aObject, TUniRegion aRegion )
+    {
+    for ( TInt i = 0; i < iObjectArray->Count(); ++i)
+        {
+        if ( iObjectArray->At( i )->Region() == aRegion )
+            {
+            User::Leave( KErrAlreadyExists );
+            }
+        }
+    aObject->SetReferenceCount( aObject->ReferenceCount() + 1 );
+    aObject->SetRegion( aRegion );
+    if ( aRegion == EUniRegionAudio )
+        {
+        //always put audio region last...
+        iObjectArray->AppendL( aObject );
+        }
+    else
+        {
+        //...and other regions first...
+        iObjectArray->InsertL( 0, aObject );
+        //...and update layout when needed
+        UpdateLayoutL(); // does not leave, really.
+        }
+    }
+
+
+// ---------------------------------------------------------
+// CUniSmilSlide::RemoveObject
+//
+// 
+// ---------------------------------------------------------
+//
+void CUniSmilSlide::RemoveObject( CUniObject* aObject )
+    {
+    TInt index( -1 );  // Initialize to impossible index.
+
+    for ( TInt i = 0; i < iObjectArray->Count(); ++i )
+        {
+        if ( iObjectArray->At( i ) == aObject )
+            {
+            index = i;
+            }
+        }
+    if ( index != -1 )
+        {
+        // Found
+        iObjectArray->Delete( index );
+        aObject->SetReferenceCount( aObject->ReferenceCount() - 1 );
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniSmilSlide::GetObject
+//
+// Accessor. 
+// ---------------------------------------------------------
+//
+CUniObject* CUniSmilSlide::GetObject( TUniRegion aRegion ) const 
+    {
+    TInt cnt = iObjectArray->Count();
+
+    for ( TInt i = 0; i < cnt; ++i )
+        {
+        if ( iObjectArray->At( i )->Region() == aRegion )
+            {
+            return iObjectArray->At( i );
+            }
+        }
+    return NULL;
+    }
+
+// ---------------------------------------------------------
+// CUniSmilSlide::GetObject
+//
+// Accessor. 
+// ---------------------------------------------------------
+//
+CUniObject* CUniSmilSlide::GetObjectByIndex( TInt aObjNum ) const 
+    {
+    if ( aObjNum >= 0 &&
+        aObjNum < iObjectArray->Count() )
+        {
+        return iObjectArray->At( aObjNum );
+        }
+    return NULL;
+    }
+
+// ---------------------------------------------------------
+// CUniSmilSlide::IsObject
+//
+//  
+// ---------------------------------------------------------
+//
+TBool CUniSmilSlide::IsObject( CUniObject* aObject ) const
+    {
+    TInt cnt = iObjectArray->Count();
+
+    for ( TInt i = 0; i < cnt; ++i )
+        {
+        if ( iObjectArray->At( i ) == aObject )
+            {
+            return ETrue;
+            }
+        }
+    return EFalse;
+    }
+
+// ---------------------------------------------------------
+// CUniSmilSlide::ObjectCount
+//
+// Accessor
+// ---------------------------------------------------------
+//
+TInt CUniSmilSlide::ObjectCount() const
+    {
+    return iObjectArray->Count();
+    }
+
+
+// ---------------------------------------------------------
+// CUniSmilSlide::UpdateLayoutL
+//
+// 
+// ---------------------------------------------------------
+// 
+void CUniSmilSlide::UpdateLayoutL( TUniLayout aNewLayout )
+    {
+    // Only need to do something if slide has text & image.
+    // If only other or neither -> do nothing.
+    iLayout = aNewLayout;
+    UpdateLayoutL();
+    }
+
+// ---------------------------------------------------------
+// CUniSmilSlide::UpdateLayoutL
+//
+// 
+// ---------------------------------------------------------
+// 
+void CUniSmilSlide::UpdateLayoutL()
+    {
+    if ( iLayout == EUniImageFirst ||
+        iLayout == EUniTextFirst )
+        {
+        CUniObject* image = GetObject( EUniRegionImage );
+        CUniObject* text = GetObject( EUniRegionText );
+        if ( image && text )
+            {
+            TInt imageRef = image->ReferenceCount();
+            TInt textRef = text->ReferenceCount();
+            RemoveObject( image );
+            RemoveObject( text );
+            if ( iLayout == EUniImageFirst )
+                {
+                iObjectArray->InsertL( 0, text );
+                iObjectArray->InsertL( 0, image );
+                }
+            else
+                {
+                iObjectArray->InsertL( 0, image );
+                iObjectArray->InsertL( 0, text );
+                }
+            image->SetReferenceCount( imageRef );
+            text->SetReferenceCount( textRef );
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniSmilSlide::ConstructL
+//
+// 2nd phase Constructor.
+// ---------------------------------------------------------
+//
+void CUniSmilSlide::ConstructL()
+    {
+    iObjectArray = new ( ELeave ) CSmilObjectArray( KMaxObjectPerSlide );
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/src/UniSmilUtils.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,369 @@
+/*
+* 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: 
+*       Static utility class for manipulating SMIL DOM
+*
+*
+*/
+
+
+#include <e32std.h>
+#include <gdi.h>
+
+#include <gmxmldocument.h>
+#include <gmxmlnode.h>
+#include <gmxmlelement.h>
+
+#include <ConformanceChecker.h>
+#include "UniSmilUtils.h"
+
+
+// ---------------------------------------------------------
+// UniSmilUtils::StringToIntValue
+// Convert a descriptor to TInt
+// ---------------------------------------------------------
+//
+EXPORT_C TInt UniSmilUtils::StringToIntValue( const TDesC& aString, 
+                                                    TInt aDefault )
+    {
+    TInt value = aDefault;
+    if( aString.Length() != 0 )
+        {
+        TChar c = aString[0];
+        if( c.IsDigit() )
+            {
+            TLex luthor( aString );
+            luthor.Val( value );
+            }
+        else
+            {
+            value = aDefault;
+            }
+        }
+    return value;
+    }
+
+
+// ---------------------------------------------------------
+// UniSmilUtils::IsMediaElem
+// ---------------------------------------------------------
+
+EXPORT_C TBool UniSmilUtils::IsMediaElem( CMDXMLNode* aNodePtr )
+{
+    TBool ret = EFalse;
+
+    if ( aNodePtr->NodeType() == CMDXMLNode::EElementNode &&
+         UniSmilUtils::MediaElemType( aNodePtr) != EMsgMediaUnknown )
+        {
+        ret = ETrue;
+        }
+
+    return ret;
+}
+
+// ---------------------------------------------------------
+// UniSmilUtils::NextNode
+// ---------------------------------------------------------
+
+EXPORT_C CMDXMLNode* UniSmilUtils::NextNode(CMDXMLNode* aRefNode)
+{
+    if( aRefNode->FirstChild() )
+        {
+        aRefNode = aRefNode->FirstChild();
+        }
+    else
+        {
+        if( aRefNode->NextSibling() )
+            {
+            // move to the next sibling if exists
+            aRefNode = aRefNode->NextSibling();
+            }
+        else
+            {
+            // No siblings at this level. Go up to parent.
+            // might need to go up several layers so WHILE rather than IF
+            while ( aRefNode && !aRefNode->NextSibling() )
+                {
+                // no siblings, move back to parent.
+                aRefNode = aRefNode->ParentNode();
+                }
+
+            // Check if we stopped because node has siblings.
+            if ( aRefNode && aRefNode->NextSibling() )
+                {
+                aRefNode = aRefNode->NextSibling();
+                }
+            }
+        }
+
+    return aRefNode;
+}
+
+// ---------------------------------------------------------
+// UniSmilUtils::RemoveChildren
+// ---------------------------------------------------------
+
+EXPORT_C void UniSmilUtils::RemoveChildren(
+    CMDXMLNode* aParent )
+    {
+    CMDXMLNode* child = NULL;
+
+    if ( aParent )
+        {
+        child = aParent->FirstChild();
+        }
+
+    while ( child )
+        {
+        if ( child->HasChildNodes() )
+            {
+            UniSmilUtils::RemoveChildren( child );
+            }
+        else
+            {
+            CMDXMLNode* n = child;
+            child = child->NextSibling();
+            aParent->RemoveChild( n );
+            delete n;
+            }
+        }
+    }
+
+
+// ---------------------------------------------------------
+// UniSmilUtils::ElemType
+// ---------------------------------------------------------
+
+EXPORT_C TMsgMediaType UniSmilUtils::MediaElemType(CMDXMLNode* aNodePtr) 
+{
+    TMsgMediaType type(EMsgMediaUnknown);
+
+    if ( aNodePtr )
+        {
+        TPtrC nName;
+        nName.Set(aNodePtr->NodeName());
+
+        if ( nName.Compare(KSMILWREleAnimation) == 0 )
+            {
+            type = EMsgMediaAnimation;
+            }
+        else if (nName.Compare(KSMILWREleAudio) == 0 )
+            {
+            type = EMsgMediaAudio;
+            }
+        // SVG included. No special SVG element tag exist.
+        else if (nName.Compare(KSMILWREleImg) == 0 )
+            {
+            type = EMsgMediaImage;
+            }
+        else if (nName.Compare(KSMILWREleRef) == 0 )
+            {
+            type = EMsgMediaRef;
+            }
+        else if ( nName.Compare(KSMILWREleText) == 0 )
+            {
+            type = EMsgMediaText;
+            }
+        else if ( nName.Compare(KSMILWREleTextstream) == 0 )
+            {
+            type = EMsgMediaTextStream;
+            }
+        else if ( nName.Compare(KSMILWREleVideo) == 0 )
+            {
+            type = EMsgMediaVideo;
+            }
+        }
+
+    return type;
+}
+
+// ---------------------------------------------------------
+// UniSmilUtils::GetId
+// ---------------------------------------------------------
+
+EXPORT_C TInt UniSmilUtils::GetId( CMDXMLNode* aNodePtr, TPtrC& aId )
+    {
+    TInt ret = KErrNotSupported;
+
+    if( aNodePtr && aNodePtr->NodeType() == CMDXMLNode::EElementNode )
+        {
+        CMDXMLElement* e =(CMDXMLElement*) aNodePtr;
+        if ( e->IsAttributeSpecified( KSMILWRParaId ))
+            {
+            e->GetAttribute(KSMILWRParaId, aId);
+            ret = KErrNone;
+            }
+        else
+            {
+            ret = KErrNotFound;
+            }
+        }
+    return ret;
+    }
+
+// ---------------------------------------------------------
+// UniSmilUtils::GetMetaTag
+// ---------------------------------------------------------
+
+EXPORT_C TInt UniSmilUtils::GetMetaTag( CMDXMLNode* aNodePtr, 
+                                   TPtrC& aName, 
+                                   TPtrC& aContent )
+    {
+    TInt ret = KErrNotFound;
+
+    if( aNodePtr &&
+        aNodePtr->NodeType() == CMDXMLNode::EElementNode &&
+        aNodePtr->NodeName().Compare(KSMILWREleMeta) == 0)
+        {
+        CMDXMLElement* e = (CMDXMLElement*) aNodePtr;
+
+        if ( e->IsAttributeSpecified( KSMILWRParaName ) &&
+             e->IsAttributeSpecified( KSMILWRParaContent ))
+            {
+            if (!e->GetAttribute(KSMILWRParaName, aName) &&
+                !e->GetAttribute(KSMILWRParaContent, aContent))
+                {
+                ret = KErrNone;
+                }
+            }
+        }
+    return ret;
+    }
+
+// ---------------------------------------------------------
+// UniSmilUtils::RegionId
+// ---------------------------------------------------------
+
+EXPORT_C TInt UniSmilUtils::GetRegionId( CMDXMLNode* aNodePtr, TPtrC& aId )
+    {
+    TInt ret = KErrNotSupported;
+
+    if ( aNodePtr )
+        {
+        if ( UniSmilUtils::IsMediaElem( aNodePtr ) )
+            {
+            ret = ((CMDXMLElement*)aNodePtr)->GetAttribute(KSMILWRParaRegion, aId);
+            }
+        }
+    return ret;
+    }
+
+// ---------------------------------------------------------
+// UniSmilUtils::GetSrc
+// ---------------------------------------------------------
+
+EXPORT_C TPtrC UniSmilUtils::GetSrcL( CMDXMLNode* aNodePtr )
+{
+    TPtrC src = TPtrC();
+    if ( aNodePtr )
+            {
+        CMDXMLElement* e = (CMDXMLElement*) aNodePtr;
+
+        if ( e && e->IsAttributeSpecified(KSMILWRParaSrc) )
+            {
+            User::LeaveIfError( e->GetAttribute(KSMILWRParaSrc, src) );
+            }
+        else
+            {
+            // Ok not to have src i.e. no default content.
+            }
+        }
+
+    return src;
+}
+
+
+// ---------------------------------------------------------
+// UniSmilUtils::GetSmilTypeL
+//
+// ---------------------------------------------------------
+EXPORT_C TUniSmilType UniSmilUtils::GetSmilTypeL( CMDXMLDocument* aDom )
+    {
+	if (!aDom)
+		{
+		return ENoSmil;
+		}
+
+    if ( UniSmilUtils::IsTemplateSmil( aDom ) )
+        {
+        return ETemplateSmil;
+        }
+    else if ( !aDom->DocumentElement() ||
+              !aDom->DocumentElement()->FirstChild() )
+        {
+        return ENoSmil;
+        }
+    else
+        {
+        CConformanceChecker* checker = CConformanceChecker::NewL();
+        CleanupStack::PushL( checker );
+        TBool isConf( EFalse );
+
+        isConf = checker->Check( aDom, EMmsSmil_v2_0,
+            EAllowVideoTag |
+            EAllowNonMilliseconds |
+            EAllowAllAttributes |
+            EAllowMixedRegionDimensions |
+            EAllowAnyRegionNames );
+
+        CleanupStack::PopAndDestroy( checker );
+
+        if( isConf )
+            {
+            return EMmsSmil;
+            }
+
+        }
+    return E3GPPSmil;
+    }
+
+
+// ---------------------------------------------------------
+// UniSmilUtils::IsTemplateSmil
+//
+// ---------------------------------------------------------
+
+EXPORT_C TBool UniSmilUtils::IsTemplateSmil( CMDXMLDocument* aDom )
+    {
+    TBool ret( EFalse );
+
+    CMDXMLNode* n = aDom->DocumentElement()->FirstChild();
+
+    while ( n )
+        {
+        if ( n->NodeName().Compare( KSMILWREleMeta ) == 0)
+            {
+            TPtrC v1, v2;
+            if ( !UniSmilUtils::GetMetaTag( n, v1, v2 ) )
+                {
+                if ( v1.Compare( KSMILMetaSmilProfile ) == 0 &&
+                     v2.Compare( KSMILMetaSmilProfileValue ) == 0)
+                    {
+                    ret = ETrue;
+                    break;
+                    }
+                }
+            }
+        else if ( n->NodeName().Compare( KSMILWREleBody ) == 0 )
+            {
+            // Cannot anymore have metatags
+            break;
+            }
+        n = UniSmilUtils::NextNode( n );
+        }
+    return ret;
+    }
+
+
+// EOF
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/src/UniTextObject.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,539 @@
+/*
+* 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: 
+*       CUniTextObject, Storage for single text attachment in presentation.
+*
+*
+*/
+
+
+// ========== INCLUDE FILES ================================
+
+#include <e32def.h>     // for basic types
+#include <eikenv.h>     // for CBase
+#include <mtclbase.h>   // for CBaseMtm
+#include <msvstd.h>     // for TMsvId
+#include <msvids.h>     // for KMsvTempIndexEntryId
+#include <msvstore.h>
+#include <mmsvattachmentmanager.h>
+#include <cmsvattachment.h>
+
+#include <eikrted.h>    // CEikRichTextEditor
+#include <charconv.h>
+
+
+#include <MsgMediaInfo.h>
+#include <MsgTextInfo.h>
+#include <MsgAttachmentUtils.h>
+
+#include "msgtextutils.h"
+#include "UniModelConst.h"
+#include "UniMimeInfo.h"
+#include "UniObject.h"
+#include "UniTextObject.h"
+#include "UniDataUtils.h"
+//rushi
+#include "MsgMimeTypes.h"
+#include "MuiuOperationWait.h"
+
+
+// ========== EXTERNAL DATA STRUCTURES =====================
+
+// ========== EXTERNAL FUNCTION PROTOTYPES =================
+
+// ========== CONSTANTS ====================================
+
+// ========== MACROS =======================================
+
+// ========== LOCAL CONSTANTS AND MACROS ===================
+const TInt KMaxFilenameLenghtForAttachment = 20;   // Characters
+
+const TInt KMaxCharSize = 3;
+const TInt KMinCharSize = 1;
+// Always count exact size
+// -> performance penalty with very long text files.
+const TInt KSyncInterval = 0;
+const TInt KForceSyncLength = KMaxTInt;
+
+_LIT16( KExtTextPlain_16, ".txt" );
+
+
+// ========== MODULE DATA STRUCTURES =======================
+
+
+// ========== LOCAL FUNCTION PROTOTYPES ====================
+
+// ========== LOCAL FUNCTIONS ==============================
+
+// ========== MEMBER FUNCTIONS =============================
+
+// ---------------------------------------------------------
+// CUniTextObject::NewLC
+//
+// Factory method.
+// ---------------------------------------------------------
+//
+EXPORT_C CUniTextObject* CUniTextObject::NewLC( RFs& aFs,
+                                               CBaseMtm& aMtm,
+                                               CUniDataUtils& aData,
+                                               CMsgTextInfo* aMedia,
+                                               MMsvAttachmentManager& aManager,
+                                               CMsvAttachment& aAttachment )
+    {
+    CUniTextObject* self =
+        new ( ELeave ) CUniTextObject( aFs, aMtm, aData, aMedia );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    self->ConstructFromAttachmentL( aManager, aAttachment );
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CUniTextObject::NewL
+//
+// Factory method.
+// ---------------------------------------------------------
+//
+EXPORT_C CUniTextObject* CUniTextObject::NewL( RFs& aFs,
+                                              CBaseMtm& aMtm,
+                                              CUniDataUtils& aData,
+                                              CMsgTextInfo* aMedia,
+                                              MMsvAttachmentManager& aManager,
+                                              CMsvAttachment& aAttachment )
+    {
+    CUniTextObject* self = NewLC( aFs, aMtm, aData, aMedia, aManager, aAttachment );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CUniTextObject::NewLC
+//
+// Factory method.
+// ---------------------------------------------------------
+//
+EXPORT_C CUniTextObject* CUniTextObject::NewLC( RFs& aFs,
+                                               CBaseMtm& aMtm,
+                                               CUniDataUtils& aData,
+                                               CMsgTextInfo* aMedia )
+    {
+    CUniTextObject* self =
+        new ( ELeave ) CUniTextObject( aFs, aMtm, aData, aMedia );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    self->CreateMimeInfoL();
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CUniTextObject::NewL
+//
+// Factory method.
+// ---------------------------------------------------------
+//
+EXPORT_C CUniTextObject* CUniTextObject::NewL( RFs& aFs,
+                                              CBaseMtm& aMtm,
+                                              CUniDataUtils& aData,
+                                              CMsgTextInfo* aMedia )
+    {
+    CUniTextObject* self = NewLC( aFs, aMtm, aData, aMedia );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CUniTextObject::NewLC
+//
+// Factory method.
+// ---------------------------------------------------------
+//
+EXPORT_C CUniTextObject* CUniTextObject::NewLC( RFs& aFs,
+                                               CBaseMtm& aMtm,
+                                               CUniDataUtils& aData,
+                                               CEikRichTextEditor* aTextEditor )
+    {
+    RFile nullHandle;
+    TDataType mime( KMsgMimeTextPlain );
+    CMsgTextInfo* info = CMsgTextInfo::NewL(
+        nullHandle,
+        mime,
+        aFs );
+    info->SetCharacterSet( KCharacterSetMIBEnumUtf8 );
+    CleanupStack::PushL( info );
+    CUniTextObject* self =
+        new ( ELeave ) CUniTextObject( aFs, aMtm, aData, info );
+    CleanupStack::Pop( info ); // ownership transferred
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    self->ConstructFromTextL( aTextEditor );
+    self->SynchronizeSize();
+    return self;
+    }
+
+// ---------------------------------------------------------
+// CUniTextObject::NewL
+//
+// Factory method.
+// ---------------------------------------------------------
+//
+EXPORT_C CUniTextObject* CUniTextObject::NewL( RFs& aFs,
+                                              CBaseMtm& aMtm,
+                                              CUniDataUtils& aData,
+                                              CEikRichTextEditor* aTextEditor )
+    {
+    CUniTextObject* self = NewLC( aFs, aMtm, aData, aTextEditor );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------
+// CUniTextObject::CUniTextObject
+//
+// Constructor.
+// ---------------------------------------------------------
+//
+CUniTextObject::CUniTextObject( RFs& aFs,
+                               CBaseMtm& aMtm,
+                               CUniDataUtils& aData,
+                               CMsgTextInfo* aMedia )
+        :
+        CUniObject( aFs, aMtm, aData, aMedia ),
+        iTextEditor( NULL )
+    {
+    }
+
+
+// ---------------------------------------------------------
+// CUniTextObject::CUniTextObject
+//
+// Destructor.
+// ---------------------------------------------------------
+//
+CUniTextObject::~CUniTextObject()
+    {
+    if ( iEditFile )
+        {
+        iEditFile->Close();
+        delete iEditFile;
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniTextObject::Save
+// ---------------------------------------------------------
+//
+void CUniTextObject::Save( MUniObjectSaveObserver& aObserver,
+                           CMsvAttachment::TMsvAttachmentType aSaveType )
+    {
+    iTextSaveState = ETextSavingIdle;
+    CUniObject::Save( aObserver, aSaveType );
+    }
+
+// ---------------------------------------------------------
+// CUniTextObject::DoSaveL
+// ---------------------------------------------------------
+//
+void CUniTextObject::DoSaveL()
+    {
+    switch ( iTextSaveState )
+        {
+        case ETextSavingIdle:
+            {
+            InitializeTextSaveL();
+            break;
+            }
+        case ETextCreatingAttachment:
+            {
+            CreateTextAttachmentL();
+            break;
+            }
+        case ETextWritingToFile:
+            {
+            WriteToFileL();
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniTextObject::Size
+//
+// Accessor.
+// ---------------------------------------------------------
+//
+TInt CUniTextObject::Size( TBool aWithoutHeaders )
+    {
+    if ( iTextEditor && iTextEditor->TextLength() )
+        {
+        TInt size = 0;
+        TInt length = iTextEditor->TextLength();
+        TInt change = length - iPrevLength;
+        if ( change )
+            {
+            //add absolute value
+            iSyncCounter += Max( change, -change );
+            iPrevLength = length;
+            }
+        if ( iSyncCounter > KSyncInterval ||
+            length <= KForceSyncLength )
+            {
+            size = SynchronizeSize();
+            }
+        else
+            {
+            TInt diff = length - iSyncLength;
+            TInt charSize = diff < 0
+                ? KMinCharSize
+                : KMaxCharSize;
+            size = iSyncSize + charSize * diff;
+            size = Max( size, 0 );
+            }
+        return ( aWithoutHeaders ? size : size + iMimeInfo->Size() );
+        }
+    else
+        {
+        return CUniObject::Size( aWithoutHeaders );
+        }
+    }
+
+// ---------------------------------------------------------
+// CUniTextObject::SyncronizeSize
+//
+// Counts real buffer size and synchronizes internal
+// size variables.
+// ---------------------------------------------------------
+//
+EXPORT_C TInt CUniTextObject::SynchronizeSize()
+    {
+    iSyncCounter = 0;
+    if ( iTextEditor )
+        {
+        iSyncLength = iTextEditor->TextLength();
+        iPrevLength = iSyncLength;
+        TPtrC ptr = iTextEditor->Text()->Read( 0, iTextEditor->Text()->DocumentLength() );
+        iSyncSize = CUniDataUtils::UTF8Size( ptr );
+        }
+    else
+        {
+        iSyncSize = 0;
+        iSyncLength = 0;
+        iPrevLength = 0;
+        }
+    return iSyncSize;
+    }
+
+// ---------------------------------------------------------
+// CUniTextObject::ConstructL
+//
+// 2nd phase constructor.
+// ---------------------------------------------------------
+//
+void CUniTextObject::ConstructL()
+    {
+    CUniObject::ConstructL();
+    }
+
+// ---------------------------------------------------------
+// CUniTextObject::ConstructFromTextL
+//
+// 2nd phase constructor.
+// ---------------------------------------------------------
+//
+void CUniTextObject::ConstructFromTextL( CEikRichTextEditor* aTextEditor )
+    {
+    iAttachmentId = KMsvNullIndexEntryId;
+    iTextEditor = aTextEditor;
+    //iStoreState = EMmsStoreStateTemporary;
+    //Create MIME headers
+    CreateMimeInfoL();
+    }
+
+// ---------------------------------------------------------
+// CreateFileName
+// ---------------------------------------------------------
+//
+void CUniTextObject::CreateFileName( TFileName& aFileName )
+    {
+    if ( iTextEditor && iTextEditor->Text()->DocumentLength() )
+        {
+    	TPtrC ptr = iTextEditor->Text()->Read( 0, KMaxFilenameLenghtForAttachment );
+        MsgAttachmentUtils::GetFileNameFromBuffer(
+            aFileName,
+            ptr,
+            KMaxFilenameLenghtForAttachment,
+            &KExtTextPlain_16 );
+        }
+    if ( aFileName.Length() == 0 ||
+        !iFs.IsValidName( aFileName ) )
+        {
+        // No filename -> Use default
+        aFileName.Zero();
+        aFileName.Copy( iData.DefaultFileName() );
+        aFileName.Append( KExtTextPlain_16 );
+        }
+    }
+
+// ---------------------------------------------------------
+// InitializeTextSaveL
+// ---------------------------------------------------------
+//
+void CUniTextObject::InitializeTextSaveL()
+    {
+    if ( !iTextEditor )
+        {
+        CUniObject::DoSaveL();
+        return;
+        }
+
+    // Remove possibly already existing attachment from store
+    RemoveFromStoreL();
+
+    if ( !iTextEditor->TextLength() )
+        {
+        //Nothing to save. (Shouldn't really get here
+        //since there shouldn't be "empty" text objects
+        //in the smil model.)
+        iObserver->ObjectSaveReady( KErrNone );
+        return;
+        }
+    iTextSaveState = ETextCreatingAttachment;
+    //CompleteSelf();
+    RunL();
+    }
+
+// ---------------------------------------------------------
+// CreateTextAttachmentL
+// ---------------------------------------------------------
+//
+void CUniTextObject::CreateTextAttachmentL()
+    {
+    TFileName fileName;
+    CreateFileName( fileName );
+
+    TFileName contentLocation( fileName );
+    CMsgTextUtils::TrimAndRemoveNonAlphaDigit( contentLocation );
+    iMimeInfo->SetContentLocationL( contentLocation );
+    iMimeInfo->SetContentTypeL( KMsgMimeTextPlain );
+    iMimeInfo->SetCharset( KCharacterSetMIBEnumUtf8 );
+
+    iEditStore = iMtm.Entry().EditStoreL();
+    iManager = &( iEditStore->AttachmentManagerL() );
+    CMsvAttachment* attachment = CMsvAttachment::NewL( CMsvAttachment::EMsvFile );
+    CleanupStack::PushL( attachment );
+
+    attachment->SetMimeTypeL( KMsgMimeTextPlain );
+    attachment->SetSize( SynchronizeSize() );
+    //TODO: Set complete flag?
+    //attachment->SetComplete( EFalse );
+
+    attachment->SetIntAttributeL( KUidAttachmentIndication, Attachment() );
+
+    iEditFile = new ( ELeave ) RFile;
+
+    //Make this synchronous process
+    CMuiuOperationWait* wait = CMuiuOperationWait::NewLC();
+    
+    iManager->CreateAttachmentL( fileName, *iEditFile, attachment, wait->iStatus );
+    wait->Start();
+    
+    CleanupStack::PopAndDestroy( wait );
+    	
+    CleanupStack::Pop( attachment );
+    iAttachment = attachment;
+    iTextSaveState = ETextWritingToFile;
+    
+    //SetActive();
+    RunL();
+    }
+
+// ---------------------------------------------------------
+// WriteToFileL
+// ---------------------------------------------------------
+//
+void CUniTextObject::WriteToFileL()
+    {
+    RFileWriteStream writer( *iEditFile );
+    delete iEditFile;
+    iEditFile = NULL;
+
+    // Write the text to a file
+
+    // UTF-8 signature
+    // Taken out because not all terminals can deal with it.
+    // Maybe taken back into use in the future
+    //writer.WriteInt8L( 0xEF );
+    //writer.WriteInt8L( 0xBB );
+    //writer.WriteInt8L( 0xBF );
+
+    HBufC* buffer = iTextEditor->GetTextInHBufL();
+    CleanupStack::PushL( buffer );
+
+    // Convert the text to utf8
+    CCnvCharacterSetConverter* converter = CCnvCharacterSetConverter::NewLC();
+
+    if ( converter->PrepareToConvertToOrFromL( KCharacterSetIdentifierUtf8, iFs )
+        != CCnvCharacterSetConverter::EAvailable )
+        {
+        User::Leave( KErrNotSupported );
+        }
+
+    TBuf8<128> outputBuffer;
+    TPtrC16 remainderOfUnicodeText( *buffer );
+    FOREVER
+        {
+        TInt returnValue = converter->ConvertFromUnicode(
+            outputBuffer, remainderOfUnicodeText );
+        if ( returnValue == CCnvCharacterSetConverter::EErrorIllFormedInput )
+            {
+            User::Leave( KErrCorrupt );
+            }
+        else if ( returnValue<0 ) // future-proof against "TError" expanding
+            {
+            User::Leave( KErrGeneral );
+            }
+
+        // ? - do something here with outputBuffer
+        writer.WriteL( outputBuffer );
+
+        if ( returnValue == 0 )
+            {
+            break; // all of aUnicodeText has been converted and handled
+            }
+        remainderOfUnicodeText.Set( remainderOfUnicodeText.Right(
+            returnValue ) );
+        }
+
+    CleanupStack::PopAndDestroy( 2, buffer ); //converter, buffer
+
+    // Close handles
+    writer.Close();
+    //TInt fileSize( 0 );
+    //iEditFile->Size( fileSize );
+    //iAttachment->SetSize( fileSize );
+    //iEditFile->Close();
+    //delete iEditFile;
+    //iEditFile = NULL;
+
+    // Closes & destroys other "attachment handling" members
+    // Sends callback to observer
+    FinalizeObjectSaveL();
+    }
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodel/unidatamodel.pro	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,122 @@
+#
+# 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:
+#
+
+TARGET = unidatamodel
+
+TEMPLATE = lib
+
+CONFIG += dll
+DEFINES += UNIDATAMODEL_DLL
+DEFINES += BUILD_DLL
+
+DEPENDPATH += . \
+    inc \
+    src
+
+QT -= gui
+
+INCLUDEPATH += .
+INCLUDEPATH += inc
+INCLUDEPATH += ../../../../inc
+INCLUDEPATH += /s60/app/messaging/inc
+INCLUDEPATH += ../s60qconversions/inc
+INCLUDEPATH += ../../unieditorutils/editorgenutils/inc
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+# Capability
+TARGET.UID3 = 0xE6e5dc7a
+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/unidatamodel.iby  CORE_APP_LAYER_IBY_EXPORT_PATH(unidatamodel.iby)"
+     
+MMP_RULES += "SOURCEPATH ."
+MMP_RULES += "TARGETPATH resource"
+MMP_RULES += "RESOURCE UniDataModel.rss"
+
+SOURCES += inc/UniDataUtils.inl \
+    src/UniDataUtils.cpp \
+    inc/UniDataModel.inl \
+    src/UniDataModel.cpp \
+    inc/UniDrmInfo.inl \
+    src/UniDrmInfo.cpp \
+    inc/UniMimeInfo.inl \
+    src/UniMimeInfo.cpp \
+    inc/UniObject.inl \
+    src/UniObject.cpp \
+    inc/UniObjectList.inl \
+    src/UniObjectList.cpp \
+    inc/UniTextObject.inl \
+    src/UniTextObject.cpp \
+    src/UniSmilUtils.cpp \
+    inc/UniSmilList.inl \
+    src/UniSmilList.cpp \
+    inc/UniSmilModel.inl \
+    src/UniSmilModel.cpp \
+    inc/UniSmilParams.inl \
+    src/UniSmilParams.cpp \
+    src/UniSmilSlide.cpp \
+    src/MsgAttachmentUtils.cpp \
+    src/ConformanceChecker.cpp
+    
+HEADERS += inc/UniDataUtils.h \
+    inc/UniDataModel.h \
+    inc/UniDrmInfo.h \
+    inc/UniMimeInfo.h \
+    inc/UniObject.h \
+    inc/UniObjectList.h \
+    inc/UniTextObject.h \
+    inc/UniSmilUtils.h \
+    inc/UniSmilList.h \
+    inc/UniSmilModel.h \
+    inc/UniSmilParams.h \
+    inc/UniSmilSlide.h \
+    inc/ConformanceChecker.h \
+    inc/MsgAttachmentUtils.h \
+    inc/UniModelConst.h \
+    inc/smilliterals.h \
+    inc/UniSmil.rh \
+    inc/UniSmil.hrh
+
+LIBS += -lcone \
+    -leuser \
+    -lefsrv \
+    -lestor \
+    -lapmime \
+    -lmsgs \
+    -lcharconv \
+    -leikcoctl \
+    -lbafl \
+    -lInetProtUtil \
+    -lxmlparser \
+    -lxmldom \
+    -lmsgmedia \
+    -ldrmcommon \
+    -ldrmrights \
+    -ldrmhelper \
+    -lcaf \
+    -lDrmServerInterfaces \
+    -lmsgcommonutils \
+    -ls60qconversions \
+    -lQtCore \
+    -leditorgenutils
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelloader/rom/unidatamodelloader.iby	Mon May 03 12:29:07 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:
+*
+*/
+#ifndef __UNIDATAMODEL_LOADER_IBY__
+#define __UNIDATAMODEL_LOADER_IBY__
+
+REM DLL
+file=ABI_DIR\UREL\unidatamodelloader.dll                   SHARED_LIB_DIR\unidatamodelloader.dll
+
+#endif // __UNIFIEDDATAMODEL_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelloader/src/unidatamodelloader.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,114 @@
+/*
+ * 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: Plugin Loader class
+ *
+ */
+
+// System Includes
+
+#include <QDir>
+#include "debugtraces.h"
+
+#include <QLibraryInfo>
+#include <QPluginLoader>
+#include "unidatamodelloader.h"
+#include "unidatamodelplugininterface.h"
+
+// LOCAL CONSTANTS
+const QString MMS_PLUGIN("unimmsdataplugin.qtplugin");
+const QString SMS_PLUGIN("unismsdataplugin.qtplugin");
+const QString BIO_PLUGIN("unibiomessagedataplugin.qtplugin");
+
+
+//---------------------------------------------------------------
+//UniDataModelLoader::UniDataModelLoader()
+//@see header
+//---------------------------------------------------------------
+UniDataModelLoader::UniDataModelLoader()	
+{
+}
+
+//---------------------------------------------------------------
+//UniDataModelLoader::~UniDataModelLoader()
+//@see header
+//---------------------------------------------------------------
+UniDataModelLoader::~UniDataModelLoader()
+{
+    // unload all qt-plugins
+    int count = mPluginLoaderList.count();
+    for (int i = 0; i < count; i++)
+    {
+        mPluginLoaderList.at(i)->unload();
+    }
+    mPluginLoaderList.clear();
+}
+
+//---------------------------------------------------------------
+//UniDataModelLoader::getDataModelPlugin()
+//@see header
+//---------------------------------------------------------------
+UniDataModelPluginInterface* UniDataModelLoader::getDataModelPlugin(
+                                                                    ConvergedMessage::MessageType messageType)
+{
+   #ifdef _DEBUG
+    QDir dir(QLibraryInfo::location(QLibraryInfo::PluginsPath));
+    dir.cd("messaging\\datamodel");
+#else
+    // plugins directory setting for HARDWARE IMAGE
+    QDir dir("Z:\\resource\\qt\\plugins\\messaging\\datamodel");
+#endif
+
+    QString pluginPath = dir.absolutePath();
+#ifdef _DEBUG_TRACES_
+    qDebug() << "Enter LoadPlugin path = " << pluginPath;
+#endif
+
+    // get the list of all plugins...
+    QFileInfoList entries = dir.entryInfoList(QDir::Files | QDir::Readable);
+    QString filePath = QString();
+    foreach (QFileInfo entry, entries)
+        {
+            if (messageType == ConvergedMessage::Sms && entry.fileName()
+                    == SMS_PLUGIN)
+            {
+                filePath = entry.absoluteFilePath();
+                break;
+            }
+            else if (messageType == ConvergedMessage::Mms && entry.fileName()
+                    == MMS_PLUGIN)
+            {
+                filePath = entry.absoluteFilePath();
+                break;
+            }
+            else if (messageType == ConvergedMessage::BioMsg && entry.fileName()
+                    == BIO_PLUGIN)
+            {
+                filePath = entry.absoluteFilePath();
+                break;
+            }
+        }
+
+    if (!filePath.isEmpty())
+    {
+        QPluginLoader* loader = new QPluginLoader(filePath);
+        UniDataModelPluginInterface* dataModelPluginInterface = qobject_cast<
+                UniDataModelPluginInterface*> (loader->instance());
+        if (dataModelPluginInterface)
+        {
+            mPluginLoaderList << loader;
+            return dataModelPluginInterface;
+        }
+    }
+    return NULL;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelloader/unidatamodelloader.pro	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,56 @@
+#
+# 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:
+#
+
+TARGET = unidatamodelloader
+
+TEMPLATE = lib
+
+CONFIG += dll
+DEFINES += UNIDATAMODELLOADER_DLL
+DEFINES += BUILD_DLL_DATA_MODEL
+
+
+
+DEPENDPATH += . \
+    inc \
+    src
+
+QT -= gui
+
+INCLUDEPATH += .
+INCLUDEPATH += inc
+INCLUDEPATH += ../../../../inc
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+# Capability
+TARGET.UID3 = 0x2001FE62
+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/unidatamodelloader.iby  CORE_APP_LAYER_IBY_EXPORT_PATH(unidatamodelloader.iby)"
+
+MMP_RULES += "SOURCEPATH ."
+
+SOURCES += src/unidatamodelloader.cpp
+    
+LIBS += -lQtCore
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/inc/unibiomessagedataplugin.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,178 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: SMS data model plugin.
+ *
+ */
+
+#ifndef UNIBIOMESSAGEDATAPLUGIN_H_
+#define UNIBIOMESSAGEDATAPLUGIN_H_
+
+#include <QObject>
+#include "unidatamodelplugininterface.h"
+
+/**
+ * SMS data model plugin.
+ * Implements the processing of a SMS message in Message Store.
+ */
+
+class UniBioMessageDataPluginPrivate;
+
+class UniBioMessageDataPlugin : public QObject, public UniDataModelPluginInterface
+{
+Q_OBJECT
+    Q_INTERFACES(UniDataModelPluginInterface)
+
+public:
+    /**
+     * constructor
+     */
+    UniBioMessageDataPlugin(QObject* parent = 0);
+
+    /**
+     * Destructor
+     */
+    ~UniBioMessageDataPlugin();
+    
+    /**
+     * Creates the new instance of the plugin
+     * @return plugin instance
+     */    
+    QObject* createInstance();
+
+    /**
+     *  Reset the datamodel
+     */
+    void reset();
+
+    /**
+     * sets the message id for which details needs to be fetched
+     * @param message id
+     */
+    int setMessageId(int mId);
+
+    /**
+     * Get the body of the message
+     * @param aBodyText, for message body
+     */
+    void body(QString& aBodyText);
+
+    /**
+     * size of the message
+     * @return size
+     */
+    int messageSize();
+
+    /**
+     * List of the message TO recipients
+     * @param list of the recipients
+     */
+    void toRecipientList(ConvergedMessageAddressList& mAddressList);
+    /**
+     * List of the message cc recipients
+     * @param list of the recipients
+     */
+    void ccRecipientList(ConvergedMessageAddressList& mAddressList);
+
+    /**
+     * List of the message bCC recipients
+     * @param list of the recipients
+     */
+    void bccRecipientList(ConvergedMessageAddressList& mAddressList);
+
+    /**
+     * Address from which the message was received
+     * @param messageAddress
+     */
+    void fromAddress(QString& messageAddress);
+
+    /**
+     * No. of attachments with the message
+     * @return attachment count 
+     */
+    int attachmentCount();
+
+    /**
+     *  To check if the message has attachments
+     *  @return true if attachment is present
+     */
+    bool hasAttachment();
+
+    /**
+     * list of attachments for a message 
+     * @return attachemnt list
+     */
+    UniMessageInfoList attachmentList();
+
+    /**
+     *  Message type (SMS/MMS etc..)
+     *  @return type of message 
+     */
+    QString messageType();
+
+    /**
+     * Priority of the message (high/low/medium)
+     */
+    MsgPriority messagePriority();
+
+    /**
+     * Number of objects asociated with a MMS message
+     * @return count of objects
+     */
+    int objectCount();
+
+    /**
+     * The MMS object list
+     * @return object list 
+     */
+    UniMessageInfoList objectList();
+
+    /**
+     * Number of slides associated with a MMS message
+     * @return count of slides
+     */
+    int slideCount();
+
+    /**
+     * The MMS slide content 
+     * @return slide list
+     */
+    UniMessageInfoList slideContent(int slidenum);
+
+    /**
+     * Time stamp of the message
+     * @return time stamp of the created/received message
+     */
+    QDateTime timeStamp();
+
+
+    /**
+     * @see UniDataModelPluginInterface
+     */
+    void restore(CBaseMtm& mtm);
+
+    /**
+     * @see UniDataModelPluginInterface 
+     */
+		QString subject();
+    
+	/**
+     * @see UniDataModelPluginInterface 
+     */
+		CMsvSession* session();
+
+private:
+    UniBioMessageDataPluginPrivate* d_ptr;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/inc/unibiomessagedataplugin_p.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,149 @@
+/*
+ * 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: Private implementaion of sms data model plugin.
+ *
+ */
+
+#ifndef UNIBIOMESSAGEDATAPLUGINPRIVATE_H_
+#define UNIBIOMESSAGEDATAPLUGINPRIVATE_H_
+
+#include "unidatamodelplugininterface.h"
+
+//Forward Declarations
+class CClientMtmRegistry;
+class ConvergedMessage;
+class UniBioMessageDataPlugin;
+class CBIOClientMtm;
+class CMsvSession;
+
+/**
+ * Symbian specific implementation of the uni SMS plugin
+ */
+class UniBioMessageDataPluginPrivate : public MMsvSessionObserver
+{
+
+public:
+    /**
+     * Constructor
+     */
+    UniBioMessageDataPluginPrivate(UniBioMessageDataPlugin* plugin);
+
+    /**
+     * Destructor
+     */
+    ~UniBioMessageDataPluginPrivate();
+
+    /**
+     *  Resets the datamodel
+     */
+    void reset();
+
+    /**
+     * sets the message id for which details needs to be fetched
+     * @param message id
+     */
+    int setMessageId(int mId);
+
+    /**
+     * Get the body of the message
+     * @param aBodyText, for message body
+     */
+    void body(QString& aBodyText);
+
+    /**
+     * Size of the message
+     * @param message size
+     */
+    int messageSize();
+
+    /**
+     * List of the message TO recipients
+     * @param list of the recipients
+     */
+    void toRecipientList(ConvergedMessageAddressList& mAddressList);
+
+    /**
+     * Address from which the message was received
+     * @param messageAddress
+     */
+    void fromAddress(QString& messageAddress);
+
+    /**
+     * Time stamp of the message
+     * @return time stamp of the created/received message
+     */
+    int timeStamp();
+
+    /**
+     * The File handle of the VCAL attachment
+     * @return file handle
+     */
+    RFile attachmentL();
+
+    /**
+     * Priority of the message
+     * @return message priority
+     */
+    MsgPriority messagePriority();
+
+    /**
+     * Number of attachments associated with the message..
+     * @return  attachment count
+     */
+    int attachmentCount();
+
+	/**
+	 * Session with the Messaging server
+	 * @return CMsvSession*
+	 */
+    CMsvSession* session();
+
+private:
+    /**
+     *  Extracts the name and address from the CMsvRecipientList
+     */
+    void extractNameAndAddress(const TDesC& aMsvAddress, TPtrC& aName,
+                               TPtrC& aAddress);
+    
+    /**
+     * intitlaises the CMsvSession and mtm
+     */
+    void initL();
+    
+    /**
+     * setMessageIdL
+     * @param int msgId
+     * @return void
+     */
+    void setMessageIdL(int msgId);
+    
+    /**
+      * @see MMsvSessionObserver
+      */
+    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2,
+              TAny* aArg3);
+    
+    
+private:
+    UniBioMessageDataPlugin* q_ptr;
+    CMsvSession* iMSession;
+    CClientMtmRegistry* iMtmReg;
+    CBIOClientMtm* iBioClientMtm;
+    TMsvId iMessageId;
+    TBool attachmentProcessed;
+    CMsvEntry* iMsvEntry;
+    TBool done;
+    TInt iAttachmentCount;
+};
+#endif //UNIBIOMESSAGEDATAPLUGINPRIVATE_H_
Binary file messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/prov.rsc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/rom/unibiomessagedataplugin.iby	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef __UNI_BIO_MESSAGE_DATA_PLUGIN_IBY__
+#define __UNI_BIO_MESSAGE_DATA_PLUGIN_IBY__
+
+
+# this is the plugin stub for QT plugin
+file=ABI_DIR\UREL\unibiomessagedataplugin.dll               SHARED_LIB_DIR\unibiomessagedataplugin.dll
+data=\epoc32\data\z\resource\qt\plugins\messaging\datamodel\unibiomessagedataplugin.qtplugin     \resource\qt\plugins\messaging\datamodel\unibiomessagedataplugin.qtplugin
+
+
+data=DATAZ_\BIOFILE_DIR\vcdp.rsc                                   BIOFILE_DIR\vcdp.rsc
+data=DATAZ_\BIOFILE_DIR\vcdp.mbm                                   BIOFILE_DIR\vcdp.mbm
+
+data=DATAZ_\BIOFILE_DIR\vclp.rsc                                  BIOFILE_DIR\vclp.rsc
+data=DATAZ_\BIOFILE_DIR\vclp.mbm                                  BIOFILE_DIR\vclp.mbm
+
+data=DATAZ_\BIOFILE_DIR\wapp.rsc                                   BIOFILE_DIR\wapp.rsc
+data=DATAZ_\BIOFILE_DIR\wapp.mbm                                   BIOFILE_DIR\wapp.mbm
+
+data=DATAZ_\BIOFILE_DIR\rtp.rsc                                  BIOFILE_DIR\rtp.rsc
+data=DATAZ_\BIOFILE_DIR\rtp.mbm                                  BIOFILE_DIR\rtp.mbm
+
+data=DATAZ_\BIOFILE_DIR\iacp.rsc                                   BIOFILE_DIR\iacp.rsc
+data=DATAZ_\BIOFILE_DIR\iacp.mbm                                   BIOFILE_DIR\iacp.mbm
+
+data=DATAZ_\BIOFILE_DIR\enp.rsc                                  BIOFILE_DIR\enp.rsc
+data=DATAZ_\BIOFILE_DIR\enp.mbm                                  BIOFILE_DIR\enp.mbm
+
+data=DATAZ_\BIOFILE_DIR\cbcp.rsc                                  BIOFILE_DIR\cbcp.rsc
+data=DATAZ_\BIOFILE_DIR\cbcp.mbm                                  BIOFILE_DIR\cbcp.mbm
+
+data=DATAZ_\BIOFILE_DIR\olp.rsc                                  BIOFILE_DIR\olp.rsc
+data=DATAZ_\BIOFILE_DIR\olp.mbm                                  BIOFILE_DIR\olp.mbm
+
+data=DATAZ_\BIOFILE_DIR\prov.rsc                                  BIOFILE_DIR\prov.rsc
+
+#endif // __UNI_VCAL_DATA_PLUGIN_IBY__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/src/unibiomessagedataplugin.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,250 @@
+/*
+ * 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:
+ *
+ */
+
+//SYSTEM INCLUDES
+#include <mtclreg.h>
+#include <mtclbase.h>
+#include <s60qconversions.h>
+
+//USER INCLUDES
+#include "unibiomessagedataplugin.h"
+#include "unibiomessagedataplugin_p.h"
+
+// UniBioMessageDataPlugin::UniBioMessageDataPlugin()
+// @see header
+//---------------------------------------------------------------
+UniBioMessageDataPlugin::UniBioMessageDataPlugin(QObject* parent) :
+    QObject(parent)
+    {
+    d_ptr = new UniBioMessageDataPluginPrivate(this);
+    }
+
+// UniBioMessageDataPlugin::~UniBioMessageDataPlugin()
+// @see header
+//---------------------------------------------------------------
+UniBioMessageDataPlugin::~UniBioMessageDataPlugin()
+{
+    delete d_ptr;
+}
+
+// UniBioMessageDataPlugin::createInstance()
+// @see header
+//---------------------------------------------------------------
+QObject* UniBioMessageDataPlugin::createInstance()
+{
+return new UniBioMessageDataPlugin();
+}	
+
+// UniBioMessageDataPlugin::reset()
+// @see header
+//---------------------------------------------------------------
+void UniBioMessageDataPlugin::reset()
+{
+    d_ptr->reset();
+}
+
+// UniBioMessageDataPlugin::setMessageId()
+// @see header
+//---------------------------------------------------------------
+int UniBioMessageDataPlugin::setMessageId(int mId)
+{
+    return d_ptr->setMessageId(mId);
+}
+
+// UniBioMessageDataPlugin::body()
+// @see header
+//---------------------------------------------------------------
+void UniBioMessageDataPlugin::body(QString& aBodyText)
+{
+    d_ptr->body(aBodyText);
+}
+
+// UniBioMessageDataPlugin::messageSize()
+// @see header
+//---------------------------------------------------------------
+qint32 UniBioMessageDataPlugin::messageSize()
+{
+    return d_ptr->messageSize();
+}
+
+// UniBioMessageDataPlugin::toRecipientList()
+// @see header
+//---------------------------------------------------------------
+void UniBioMessageDataPlugin::toRecipientList(
+    ConvergedMessageAddressList& mAddressList)
+{
+    d_ptr->toRecipientList(mAddressList);
+}
+
+// UniBioMessageDataPlugin::ccRecipientList()
+// @see header
+//---------------------------------------------------------------
+void UniBioMessageDataPlugin::ccRecipientList(ConvergedMessageAddressList& /*mAddressList*/)
+{
+
+}
+
+// UniBioMessageDataPlugin::bccRecipientList()
+// @see header
+//---------------------------------------------------------------
+
+void UniBioMessageDataPlugin::bccRecipientList(ConvergedMessageAddressList& /*mAddressList*/)
+{
+
+}
+
+// UniBioMessageDataPlugin::fromAddress()
+// @see header
+//---------------------------------------------------------------
+void UniBioMessageDataPlugin::fromAddress(QString& messageAddress)
+{
+    d_ptr->fromAddress(messageAddress);
+}
+
+// UniBioMessageDataPlugin::attachmentList()
+// @see header
+//---------------------------------------------------------------
+UniMessageInfoList UniBioMessageDataPlugin::attachmentList()
+{
+    RFile file = d_ptr->attachmentL();
+
+    UniMessageInfoList attlist;
+
+    QString path;
+    QString mimetype;
+    int size;
+
+    TFileName fullName;
+    User::LeaveIfError(file.FullName(fullName));
+    User::LeaveIfError(file.Size(size));
+
+    path = S60QConversions::s60DescToQString(*fullName.AllocL());
+
+    UniMessageInfo *msgobj = new UniMessageInfo(path, size, mimetype);
+    attlist << msgobj;
+    file.Close();
+    return attlist;
+}
+
+// UniBioMessageDataPlugin::messageType()
+// @see header
+//---------------------------------------------------------------
+QString UniBioMessageDataPlugin::messageType()
+{
+    QString str("biomessage");
+    return str;
+}
+
+// UniBioMessageDataPlugin::messagePriority()
+// @see header
+//---------------------------------------------------------------
+MsgPriority UniBioMessageDataPlugin::messagePriority()
+{
+    return d_ptr->messagePriority();
+}
+
+// UniBioMessageDataPlugin::attachmentCount()
+// @see header
+//---------------------------------------------------------------
+int UniBioMessageDataPlugin::attachmentCount()
+{
+    return d_ptr->attachmentCount();
+}
+
+// UniBioMessageDataPlugin::hasAttachment()
+// @see header
+//---------------------------------------------------------------
+bool UniBioMessageDataPlugin::hasAttachment()
+{
+    return true;
+}
+
+// UniBioMessageDataPlugin::objectCount()
+// @see header
+//---------------------------------------------------------------
+int UniBioMessageDataPlugin::objectCount()
+{
+    return 0;
+}
+
+// UniBioMessageDataPlugin::objectList()
+// @see header
+//---------------------------------------------------------------
+UniMessageInfoList UniBioMessageDataPlugin::objectList()
+{
+    return QList<UniMessageInfo*> ();
+}
+
+// UniBioMessageDataPlugin::slideCount()
+// @see header
+//---------------------------------------------------------------
+int UniBioMessageDataPlugin::slideCount()
+{
+    return 0;
+}
+
+// UniBioMessageDataPlugin::slideContent()
+// @see header
+//---------------------------------------------------------------
+UniMessageInfoList UniBioMessageDataPlugin::slideContent(int /*slidenum*/)
+{
+    return QList<UniMessageInfo*> ();
+}
+
+// UniBioMessageDataPlugin::timeStamp()
+// @see header
+//---------------------------------------------------------------
+QDateTime UniBioMessageDataPlugin::timeStamp()
+{
+    QDateTime retTimeStamp;
+    int tStamp = d_ptr->timeStamp();
+    retTimeStamp.setTime_t(tStamp);
+    return retTimeStamp;
+}
+
+//---------------------------------------------------------------
+// UniBioMessageDataPlugin::restore()
+// @see header
+//---------------------------------------------------------------
+void UniBioMessageDataPlugin::restore(CBaseMtm& /*mtm*/)
+{
+
+}
+
+//---------------------------------------------------------------
+// UniBioMessageDataPlugin::subject()
+// @see header
+//---------------------------------------------------------------
+QString UniBioMessageDataPlugin::subject()
+{
+  return QString();   
+}
+
+
+//---------------------------------------------------------------
+// UniBioMessageDataPlugin::session()
+// @see header
+//---------------------------------------------------------------
+CMsvSession* UniBioMessageDataPlugin::session()
+{
+    return d_ptr->session();
+}
+
+
+
+Q_EXPORT_PLUGIN2(UniBioMessageDataPlugin, UniBioMessageDataPlugin)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/src/unibiomessagedataplugin_p.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,326 @@
+/*
+ * 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: 
+ *
+ */
+
+//SYSTEM INCLUDES
+#include <e32cmn.h>
+#include <mtclreg.h>
+#include <mtclbase.h>
+#include <msvids.h>
+#include <txtetext.h>
+#include <txtrich.h>
+#include <txtfmlyr.h>
+#include <smsclnt.h>
+
+#include <bioscmds.h>
+#include <biocmtm.h>
+#include "debugtraces.h"
+
+#include <QDateTime>
+#include <s60qconversions.h>
+#include <mmsvattachmentmanager.h>
+
+#include "convergedmessage.h"
+#include "convergedmessageaddress.h"
+#include "unibiomessagedataplugin_p.h"
+
+#define KBioUidValue  0x10001262
+const TUid KBioUidValueUid =
+{KBioUidValue};
+_LIT(KUnixEpoch, "19700000:000000.000000");
+
+//---------------------------------------------------------------
+// UniBioMessageDataPluginPrivate::~UniBioMessageDataPluginPrivate
+// @see header
+//---------------------------------------------------------------
+UniBioMessageDataPluginPrivate::~UniBioMessageDataPluginPrivate()
+{
+    q_ptr = NULL;
+    if (iMsvEntry)
+    {
+        delete iMsvEntry;
+    }
+
+    delete iBioClientMtm;
+    delete iMtmReg;
+    delete iMSession;
+
+}
+
+//---------------------------------------------------------------
+// UniBioMessageDataPluginPrivate::UniBioMessageDataPluginPrivate
+// @see header
+//---------------------------------------------------------------
+UniBioMessageDataPluginPrivate::UniBioMessageDataPluginPrivate(UniBioMessageDataPlugin* plugin) :
+    q_ptr(plugin), iMSession(NULL), iMtmReg(NULL), iBioClientMtm(NULL),
+            iMsvEntry(NULL)
+{
+    iMSession = CMsvSession::OpenSyncL(*this);
+    done = EFalse;
+}
+
+
+
+
+void UniBioMessageDataPluginPrivate::initL()
+{
+    iMtmReg = CClientMtmRegistry::NewL(*iMSession);
+    iBioClientMtm = (CBIOClientMtm*) iMtmReg->NewMtmL(KBioUidValueUid);
+
+    attachmentProcessed = EFalse;
+    done = ETrue;
+
+}
+
+//---------------------------------------------------------------
+// UniBioMessageDataPluginPrivate::reset
+// @see header
+//---------------------------------------------------------------
+void UniBioMessageDataPluginPrivate::reset()
+{
+}
+
+//---------------------------------------------------------------
+// UniBioMessageDataPluginPrivate::setMessageId
+// @see header
+//---------------------------------------------------------------
+int UniBioMessageDataPluginPrivate::setMessageId(int mId)
+{
+    TInt error = KErrNone;
+    TRAP(error, setMessageIdL(mId));
+    return error;
+}
+
+//---------------------------------------------------------------
+// UniBioMessageDataPluginPrivate::setMessageIdL
+// @see header
+//---------------------------------------------------------------
+void UniBioMessageDataPluginPrivate::setMessageIdL(int mId)
+{
+    if (done == EFalse)
+    {
+        initL();
+    }
+    if (iMessageId != mId)
+    {
+        attachmentProcessed = EFalse;
+    }
+
+    iMessageId = (TMsvId) mId;
+    iBioClientMtm->SwitchCurrentEntryL(iMessageId);
+
+    iMsvEntry = CMsvEntry::NewL(iBioClientMtm->Session(),
+                                iMessageId,
+                                TMsvSelectionOrdering());
+
+    iBioClientMtm->LoadMessageL();
+}
+
+//---------------------------------------------------------------
+// UniBioMessageDataPluginPrivate::body
+// @see header
+//---------------------------------------------------------------
+void UniBioMessageDataPluginPrivate::body(QString& aBodyText)
+{
+
+    CRichText& textBody = iBioClientMtm->Body();
+    TInt len = textBody.DocumentLength();
+    HBufC* buf = HBufC::NewL(len);
+    TPtr bufPtr = buf->Des();
+    textBody.ExtractSelectively(bufPtr, 0, len, CPlainText::EExtractAll);
+    aBodyText = S60QConversions::s60DescToQString(*buf);
+    delete buf;
+}
+
+//---------------------------------------------------------------
+// UniBioMessageDataPluginPrivate::messageSize
+// @see header
+//---------------------------------------------------------------
+qint32 UniBioMessageDataPluginPrivate::messageSize()
+{
+    return iBioClientMtm->Entry().Entry().iSize;
+}
+
+//---------------------------------------------------------------
+// UniBioMessageDataPluginPrivate::toRecipientList
+// @see header
+//---------------------------------------------------------------
+void UniBioMessageDataPluginPrivate::toRecipientList(
+                                               ConvergedMessageAddressList& mAddressList)
+{
+    TPtrC name;
+    TPtrC address;
+
+    CPlainText* pText = CPlainText::NewL();
+    CleanupStack::PushL(pText);
+
+    CSmsHeader* smsHeader = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *pText);
+    CleanupStack::PushL(smsHeader);
+
+    CMsvStore* store = iMsvEntry->ReadStoreL();
+    CleanupStack::PushL(store);
+
+    smsHeader->RestoreL(*store);
+
+    for (TInt id = 0; id < smsHeader->Recipients().Count(); ++id)
+    {
+        CSmsNumber* rcpt = smsHeader->Recipients()[id];
+        name.Set(rcpt->Name());
+        address.Set(rcpt->Address());
+
+        ConvergedMessageAddress
+                * messageAddress =
+                        new ConvergedMessageAddress(S60QConversions::s60DescToQString(address),
+                                                    S60QConversions::s60DescToQString(name));
+        mAddressList.append(messageAddress);
+    }
+    CleanupStack::PopAndDestroy(3, pText);
+
+}
+
+//---------------------------------------------------------------
+// UniBioMessageDataPluginPrivate::fromAddress
+// @see header
+//---------------------------------------------------------------
+void UniBioMessageDataPluginPrivate::fromAddress(QString& messageAddress)
+{
+    CPlainText* pText = CPlainText::NewL();
+    CleanupStack::PushL(pText);
+
+    CSmsHeader* smsHeader = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *pText);
+    CleanupStack::PushL(smsHeader);
+
+    CMsvStore* store = iMsvEntry->ReadStoreL();
+    CleanupStack::PushL(store);
+
+    smsHeader->RestoreL(*store);
+
+    messageAddress
+            = S60QConversions::s60DescToQString(smsHeader->FromAddress());
+    CleanupStack::PopAndDestroy(3, pText);
+}
+
+//---------------------------------------------------------------
+// UniBioMessageDataPluginPrivate::timeStamp
+// @see header
+//---------------------------------------------------------------
+int UniBioMessageDataPluginPrivate::timeStamp()
+{
+    QDateTime retTimeStamp;
+    TTime timeStamp = iBioClientMtm->Entry().Entry().iDate;
+    TTime unixEpoch(KUnixEpoch);
+    TTimeIntervalSeconds seconds;
+    timeStamp.SecondsFrom(unixEpoch, seconds);
+    return seconds.Int();
+}
+
+//---------------------------------------------------------------
+// UniBioMessageDataPluginPrivate::attachmentList
+// @see header
+//---------------------------------------------------------------
+RFile UniBioMessageDataPluginPrivate::attachmentL()
+{
+    if (attachmentProcessed)
+    {
+
+        CMsvStore* store1 = iMsvEntry->ReadStoreL();
+        CleanupStack::PushL(store1);
+        MMsvAttachmentManager& attachMan = store1->AttachmentManagerL();
+        RFile file = attachMan.GetAttachmentFileL(0);
+        CleanupStack::PopAndDestroy(store1);
+        return file;
+    }
+
+    CMsvEntrySelection* selection = new (ELeave) CMsvEntrySelection;
+    CleanupStack::PushL(selection);
+
+    selection->AppendL(iMessageId);
+
+    TBuf8<1> aParameter;
+    CMsvOperationActiveSchedulerWait* wait = CMsvOperationActiveSchedulerWait::NewLC();
+    
+    CMsvOperation* operation =
+            iBioClientMtm->InvokeAsyncFunctionL(KBiosMtmParse,
+                                                *selection,
+                                                aParameter,
+                                                wait->iStatus);
+
+    wait->Start();
+
+    CMsvStore* store = iMsvEntry->ReadStoreL();
+    CleanupStack::PushL(store);
+    MMsvAttachmentManager& attachMan = store->AttachmentManagerL();
+
+    iAttachmentCount = attachMan.AttachmentCount();
+
+    RFile file = attachMan.GetAttachmentFileL(0);
+
+    delete operation;
+    CleanupStack::PopAndDestroy(3,selection);
+    attachmentProcessed = ETrue;
+    return file;
+
+}
+
+//---------------------------------------------------------------
+// UniBioMessageDataPluginPrivate::attachmentCount
+// @see header
+//---------------------------------------------------------------
+
+int UniBioMessageDataPluginPrivate::attachmentCount()
+{
+    if (!attachmentProcessed)
+    {
+        RFile file = attachmentL();
+        file.Close();
+    }
+
+    return (int) iAttachmentCount;
+}
+
+//---------------------------------------------------------------
+// UniBioMessageDataPluginPrivate::messagePriority
+// @see header
+//---------------------------------------------------------------
+
+MsgPriority UniBioMessageDataPluginPrivate::messagePriority()
+{
+
+    MsgPriority priority = (MsgPriority) iMsvEntry->Entry().Priority();
+    return priority;
+}
+
+//---------------------------------------------------------------
+// UniBioMessageDataPluginPrivate::session
+// @see header
+//---------------------------------------------------------------
+CMsvSession* UniBioMessageDataPluginPrivate::session()
+{
+    return iMSession;
+}
+
+//---------------------------------------------------------------
+// UniBioMessageDataPluginPrivate::HandleSessionEventL
+// @see header
+//---------------------------------------------------------------
+void UniBioMessageDataPluginPrivate::HandleSessionEventL(TMsvSessionEvent /*aEvent*/,
+                                                  TAny* /*aArg1*/,
+                                                  TAny* /*aArg2*/, TAny* /*aArg3*/)
+{
+// do nothing
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/bwins/test_unidatamodel_vcal_pluginu.def	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,30 @@
+EXPORTS
+	?SetForMtmTypeL@TestUniDataModelVCalPlugin@@AAEXAAVTMsvEntry@@W4TBIOMessageType@@@Z @ 1 NONAME ; void TestUniDataModelVCalPlugin::SetForMtmTypeL(class TMsvEntry &, enum TBIOMessageType)
+	?SetSessionPath@TestUniDataModelVCalPlugin@@AAEXABVTDesC16@@@Z @ 2 NONAME ; void TestUniDataModelVCalPlugin::SetSessionPath(class TDesC16 const &)
+	?CreateBioEntryClientSideL@TestUniDataModelVCalPlugin@@AAEXAAVTMsvEntry@@AAVCRichText@@@Z @ 3 NONAME ; void TestUniDataModelVCalPlugin::CreateBioEntryClientSideL(class TMsvEntry &, class CRichText &)
+	?trUtf8@TestUniDataModelVCalPlugin@@SA?AVQString@@PBD0H@Z @ 4 NONAME ; class QString TestUniDataModelVCalPlugin::trUtf8(char const *, char const *, int)
+	?qt_metacall@TestUniDataModelVCalPlugin@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 5 NONAME ; int TestUniDataModelVCalPlugin::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?CreateBIOEntryL@TestUniDataModelVCalPlugin@@AAEJAAVTDesC16@@W4TBIOMessageType@@@Z @ 6 NONAME ; long TestUniDataModelVCalPlugin::CreateBIOEntryL(class TDesC16 &, enum TBIOMessageType)
+	?initTestCase@TestUniDataModelVCalPlugin@@AAEXXZ @ 7 NONAME ; void TestUniDataModelVCalPlugin::initTestCase(void)
+	?CreateBIOEntryFromFileL@TestUniDataModelVCalPlugin@@AAEJABVTDesC16@@W4TBIOMessageType@@@Z @ 8 NONAME ; long TestUniDataModelVCalPlugin::CreateBIOEntryFromFileL(class TDesC16 const &, enum TBIOMessageType)
+	?testPluginLoading@TestUniDataModelVCalPlugin@@AAEXXZ @ 9 NONAME ; void TestUniDataModelVCalPlugin::testPluginLoading(void)
+	?testGetPluginWithoutLoading@TestUniDataModelVCalPlugin@@AAEXXZ @ 10 NONAME ; void TestUniDataModelVCalPlugin::testGetPluginWithoutLoading(void)
+	?testDraftsVCalMessage@TestUniDataModelVCalPlugin@@AAEXXZ @ 11 NONAME ; void TestUniDataModelVCalPlugin::testDraftsVCalMessage(void)
+	?tr@TestUniDataModelVCalPlugin@@SA?AVQString@@PBD0@Z @ 12 NONAME ; class QString TestUniDataModelVCalPlugin::tr(char const *, char const *)
+	?getStaticMetaObject@TestUniDataModelVCalPlugin@@SAABUQMetaObject@@XZ @ 13 NONAME ; struct QMetaObject const & TestUniDataModelVCalPlugin::getStaticMetaObject(void)
+	?testInBoxVCalMessage@TestUniDataModelVCalPlugin@@AAEXXZ @ 14 NONAME ; void TestUniDataModelVCalPlugin::testInBoxVCalMessage(void)
+	?qt_metacast@TestUniDataModelVCalPlugin@@UAEPAXPBD@Z @ 15 NONAME ; void * TestUniDataModelVCalPlugin::qt_metacast(char const *)
+	?init@TestUniDataModelVCalPlugin@@AAEXXZ @ 16 NONAME ; void TestUniDataModelVCalPlugin::init(void)
+	?metaObject@TestUniDataModelVCalPlugin@@UBEPBUQMetaObject@@XZ @ 17 NONAME ; struct QMetaObject const * TestUniDataModelVCalPlugin::metaObject(void) const
+	?tr@TestUniDataModelVCalPlugin@@SA?AVQString@@PBD0H@Z @ 18 NONAME ; class QString TestUniDataModelVCalPlugin::tr(char const *, char const *, int)
+	?ReadFromFileL@TestUniDataModelVCalPlugin@@AAEPAVHBufC16@@ABVTDesC16@@@Z @ 19 NONAME ; class HBufC16 * TestUniDataModelVCalPlugin::ReadFromFileL(class TDesC16 const &)
+	?SetBIOServiceIdL@TestUniDataModelVCalPlugin@@AAEJXZ @ 20 NONAME ; long TestUniDataModelVCalPlugin::SetBIOServiceIdL(void)
+	?cleanupTestCase@TestUniDataModelVCalPlugin@@AAEXXZ @ 21 NONAME ; void TestUniDataModelVCalPlugin::cleanupTestCase(void)
+	?SetMessageType@TestUniDataModelVCalPlugin@@AAE?AW4TBIOMessageType@@ABVTDesC16@@@Z @ 22 NONAME ; enum TBIOMessageType TestUniDataModelVCalPlugin::SetMessageType(class TDesC16 const &)
+	?trUtf8@TestUniDataModelVCalPlugin@@SA?AVQString@@PBD0@Z @ 23 NONAME ; class QString TestUniDataModelVCalPlugin::trUtf8(char const *, char const *)
+	?testUnusedAPIs@TestUniDataModelVCalPlugin@@AAEXXZ @ 24 NONAME ; void TestUniDataModelVCalPlugin::testUnusedAPIs(void)
+	?staticMetaObject@TestUniDataModelVCalPlugin@@2UQMetaObject@@B @ 25 NONAME ; struct QMetaObject const TestUniDataModelVCalPlugin::staticMetaObject
+	?GenerateMessagesL@TestUniDataModelVCalPlugin@@AAEPAVCMsvEntrySelection@@XZ @ 26 NONAME ; class CMsvEntrySelection * TestUniDataModelVCalPlugin::GenerateMessagesL(void)
+	?testPluginLoadingMultipleTimes@TestUniDataModelVCalPlugin@@AAEXXZ @ 27 NONAME ; void TestUniDataModelVCalPlugin::testPluginLoadingMultipleTimes(void)
+	?cleanup@TestUniDataModelVCalPlugin@@AAEXXZ @ 28 NONAME ; void TestUniDataModelVCalPlugin::cleanup(void)
+
Binary file messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/testunidatamodelvcalplugin/BioMtm.rsc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/testunidatamodelvcalplugin/testunidatamodelvcalplugin.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,618 @@
+/*
+ * 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 <s60qconversions.h>
+#include <bsp.h>
+#include <biodb.h> 
+#include <biouids.h>
+#include <biocmtm.h>
+
+#include "serviceinfo.h"
+#include "testunidatamodelvcalplugin.h"
+#include "unidatamodelloader.h"
+#include "testunidatamodelvcalplugin.ini"
+#include "unidatamodelplugininterface.h"
+#include "convergedmessage.h"
+
+const TInt KTelephoneNumberMaxLength = 32;
+_LIT(KBIOTxtFilePath, "C:\\test\\");
+_LIT(KBIOvCalenderPrefix, "vcal*");
+// vCalender
+_LIT(KUnixEpoch, "19700000:000000.000000");
+#define KBioUidValue  0x10001262
+
+const TUid KBioUidValueUid =
+{KBioUidValue};
+
+//---------------------------------------------------------------
+// TestUniDataModelVCalPlugin::init
+//---------------------------------------------------------------
+
+
+void TestUniDataModelVCalPlugin::initTestCase()
+{
+
+}
+void TestUniDataModelVCalPlugin::cleanupTestCase()
+{
+
+}
+
+void TestUniDataModelVCalPlugin::init()
+{
+    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;
+    drafts = EFalse;
+}
+
+//---------------------------------------------------------------
+// TestUniDataModelVCalPlugin::cleanup
+//---------------------------------------------------------------
+void TestUniDataModelVCalPlugin::cleanup()
+{
+    if (newEntryId > 0)
+        iMsvEntry->DeleteL(newEntryId);
+    delete iMsvEntry;
+    iMsvEntry = NULL;
+    delete iObserver;
+    iObserver = NULL;
+    delete iMSession;
+    iMSession = NULL;
+    delete pluginLoader;
+
+}
+
+void TestUniDataModelVCalPlugin::testInBoxVCalMessage()
+{
+    inbox = ETrue;
+    GenerateMessagesL();
+
+    pluginInterface = pluginLoader->getDataModelPlugin("bio:vcal");
+    pluginInterface->setMessageId(newEntryId);
+
+    int count = pluginInterface->attachmentCount();
+    QVERIFY(count == 1);
+
+    UniMessageInfoList attachmentlist = pluginInterface->attachmentList();
+    QVERIFY(!attachmentlist.isEmpty());
+
+    UniMessageInfo* att = attachmentlist.at(0);
+    QString path = att->path();
+
+    QString recepient(TEST_MSG_FROM1);
+    QString fromaddress;
+    pluginInterface->fromAddress(fromaddress);
+    QVERIFY(recepient == fromaddress);
+
+    QString body;
+    pluginInterface->body(body);
+    QVERIFY(!body.isEmpty());
+
+    // Compare input message , with the read message
+    RFile origFile;
+    int op = origFile.Open(iFs, currentFile, EFileRead);
+    QVERIFY(op == 0);
+    
+    TBuf8<1000> readBuf;
+    HBufC* readBuf16 = HBufC::NewL(2000);
+    
+    origFile.Read(readBuf);
+    readBuf16->Des().Copy(readBuf);
+
+    QString orig = S60QConversions::s60DescToQString(*readBuf16);
+    origFile.Close();
+
+    HBufC* filepath = S60QConversions::qStringToS60Desc(path);
+
+    RFile file;
+    op = file.Open(iFs, *filepath, EFileRead);
+    QVERIFY(op == 0);
+   
+    file.Read(readBuf);
+    readBuf16->Des().Copy(readBuf);
+    QString bod = S60QConversions::s60DescToQString(*readBuf16);
+
+    delete readBuf16;
+    file.Close();
+    // compare Input body and output body 
+    QVERIFY(bod == orig );
+
+    int size = pluginInterface->messageSize();
+
+    MsgPriority priority = pluginInterface->messagePriority();
+    // Normal priority
+    qDebug() << "prority" << priority;
+    QVERIFY(priority == 1);
+
+    QVERIFY(pluginInterface->timeStamp() == retTimeStamp);
+
+    ConvergedMessageAddressList recipientList;
+    pluginInterface->toRecipientList(recipientList);
+    QVERIFY(recipientList.count() == 0);
+    iMsvEntry->SetEntryL(KMsvGlobalInBoxIndexEntryId);
+}
+
+void TestUniDataModelVCalPlugin::testDraftsVCalMessage()
+{
+    drafts = ETrue;
+    GenerateMessagesL();
+
+    pluginInterface = pluginLoader->getDataModelPlugin("bio:vcal");
+    pluginInterface->setMessageId(newEntryId);
+
+    int count = pluginInterface->attachmentCount();
+    QVERIFY(count == 1);
+
+    UniMessageInfoList attachmentlist = pluginInterface->attachmentList();
+    QVERIFY(!attachmentlist.isEmpty());
+
+    UniMessageInfo* att = attachmentlist.at(0);
+    QString path = att->path();
+
+    QString fromaddress;
+    pluginInterface->fromAddress(fromaddress);
+    QVERIFY(fromaddress.isEmpty());
+
+    QString body;
+    pluginInterface->body(body);
+    QVERIFY(!body.isEmpty());
+
+    // Compare input message , with the read message
+    RFile origFile;
+    int op = origFile.Open(iFs, currentFile, EFileRead);
+    QVERIFY(op == 0);
+    
+    TBuf8<1000> readBuf;
+    HBufC* readBuf16 = HBufC::NewL(2000);
+
+    origFile.Read(readBuf);
+    readBuf16->Des().Copy(readBuf);
+
+    QString orig = S60QConversions::s60DescToQString(*readBuf16);
+    origFile.Close();
+
+    HBufC* filepath = S60QConversions::qStringToS60Desc(path);
+
+    RFile file;
+    op = file.Open(iFs, *filepath, EFileRead);
+    QVERIFY(op == 0);
+    
+    file.Read(readBuf);
+
+    readBuf16->Des().Copy(readBuf);
+
+    QString bod = S60QConversions::s60DescToQString(*readBuf16);
+
+    delete readBuf16;
+    file.Close();
+    // compare Input body and output body 
+    QVERIFY(bod == orig );
+
+    int size = pluginInterface->messageSize();
+
+    MsgPriority priority = pluginInterface->messagePriority();
+    // Normal priority
+    qDebug() << "prority" << priority;
+    QVERIFY(priority == 1);
+
+    QVERIFY(pluginInterface->timeStamp() == retTimeStamp);
+
+    ConvergedMessageAddressList recipientList;
+    pluginInterface->toRecipientList(recipientList);
+    QString recepient(TEST_MSG_FROM1);
+    QString recepient2(TEST_MSG_FROM2);
+    QString origalias(TEST_MSG_ALIAS1);
+
+    QVERIFY(recipientList.count() == 2);
+
+    QVERIFY(recepient == recipientList[0]->address());
+
+    QVERIFY( recipientList[0]->alias().isEmpty());
+
+    const QString& as = recipientList[1]->address();
+    const QString& as1 = recipientList[1]->alias();
+    QVERIFY(recepient2 == as);
+
+    QVERIFY(origalias == as1);
+    iMsvEntry->SetEntryL(KMsvDraftEntryId);
+}
+
+
+
+void TestUniDataModelVCalPlugin::testUnusedAPIs()
+{
+    pluginInterface = pluginLoader->getDataModelPlugin(ConvergedMessage::BioMsg);
+
+    QVERIFY(pluginInterface->objectCount() == 0);
+
+    UniMessageInfoList objectlist = pluginInterface->objectList();
+    QVERIFY(objectlist.isEmpty());
+
+    QVERIFY(pluginInterface->slideCount() == 0);
+
+    UniMessageInfoList slidelist = pluginInterface->slideContent(0);
+    QVERIFY(slidelist.isEmpty());
+    
+    QVERIFY(pluginInterface->hasAttachment() == true );
+    
+    ConvergedMessageAddressList recipientList;
+    
+	pluginInterface->ccRecipientList(recipientList);
+	QVERIFY(recipientList.count() == 0);
+		
+	pluginInterface->bccRecipientList(recipientList);
+	QVERIFY(recipientList.count() == 0);
+}
+
+CMsvEntrySelection* TestUniDataModelVCalPlugin::GenerateMessagesL()
+{
+    HBufC* aFileDirectory = KBIOTxtFilePath().AllocL();
+    TMsvId messageId;
+    TBIOMessageType currentMsgType;
+
+    CMsvEntrySelection* selection = new (ELeave) CMsvEntrySelection();
+    CleanupStack::PushL(selection);
+
+    TInt err = iFs.GetDir(aFileDirectory->Des(),
+                          KEntryAttMatchMask,
+                          ESortByName,
+                          iDir);
+    if (err == KErrPathNotFound)
+    {
+        TInt makeDirErr = iFs.MkDirAll(aFileDirectory->Des());
+        makeDirErr == KErrNone ? User::Leave(KErrNotFound)
+                : User::Leave(makeDirErr);
+    }
+    else if (err != KErrNone)
+    {
+        User::Leave(err);
+    }
+
+    // Set the session path for the RFs
+    SetSessionPath(aFileDirectory->Des());
+    if (iDir)
+    {
+        delete iDir;
+        iDir = NULL;
+    }
+        
+    User::LeaveIfError(iFs.GetDir(_L("*.txt"), KEntryAttNormal, ESortByName, iDir));
+    TInt count = iDir->Count();
+    if (count == 0)
+    {
+        User::Leave(KErrNotFound); // No files to process
+    }
+
+    TBuf<60> outputBuf;
+
+    for (TInt loop = 0; loop < count; loop++)
+    {
+        TEntry as = (*iDir)[0];
+        currentFile = (as.iName);
+        // Not processed all the messages - so keep the current state
+        iFilesProcessed++; // Here because need to update the counter promptly
+        currentMsgType = SetMessageType(currentFile);
+        if (currentMsgType != ENoMessage) // skip any dodgy filenames
+        {
+            messageId = CreateBIOEntryFromFileL(currentFile, currentMsgType);
+            selection->AppendL(messageId);
+            TPtrC tempPtr = (currentFile.Des());
+
+        }
+    }
+    CleanupStack::Pop(); // selection
+    return selection;
+}
+
+TBIOMessageType TestUniDataModelVCalPlugin::SetMessageType(
+                                                           const TDesC& aFileName)
+{
+
+    if (aFileName.MatchF(KBIOvCalenderPrefix) == 0)
+    {
+        return EBiovCalenderMessage;
+    }
+
+    return ENoMessage;
+}
+
+TMsvId TestUniDataModelVCalPlugin::CreateBIOEntryFromFileL(
+                                                           const TDesC& aFilename,
+                                                           TBIOMessageType aMessageType)
+{
+    //First use the filename to get the message body, 
+    // then convert '\n' to the paragraph delimiters used in proper SMS 
+    HBufC* tempBuffer;
+
+    tempBuffer = ReadFromFileL(aFilename);
+    CleanupStack::PushL(tempBuffer);
+
+    newEntryId = CreateBIOEntryL(*tempBuffer, aMessageType);
+
+    // Finished with our local descriptors - free up some memory
+    CleanupStack::PopAndDestroy();
+    return newEntryId;
+}
+
+void TestUniDataModelVCalPlugin::SetSessionPath(const TDesC& aSessionPath)
+{
+    iFs.SetSessionPath(aSessionPath);
+}
+
+HBufC* TestUniDataModelVCalPlugin::ReadFromFileL(const TDesC& aFile)
+{
+    RFile file;
+    TBuf8<1024> lineBuffer;
+    TInt err = KErrNone;
+
+    err = file.Open(iFs, aFile, EFileStreamText | EFileRead | EFileShareAny);
+
+    if (err != KErrNone) // Didn't find the file, so leave - should only get valid filenames!
+    {
+        User::Leave(KErrNotFound);
+    }
+
+    HBufC* bioBuf = HBufC::NewLC(65535); // Create a new descriptor on the heap.
+    HBufC* copyBuffer = HBufC::NewLC(1024);
+
+    do // Read in the text from file, and also check if there is a name field:
+    {
+        err = file.Read(lineBuffer);// Read upto 256 chars, '\n' and all...
+        //err = ReadLineL(file,lineBuffer);
+        if (err == KErrNone) // Made a valid read,
+            if (lineBuffer.Length() == 0) // but read 0 chars
+                err = KErrEof; // so set err value to end processing
+
+        if (err == KErrNone)
+        {
+            copyBuffer->Des().Copy(lineBuffer);// Copy, and overwrite existing text
+            if ( (bioBuf->Length() + copyBuffer->Length())
+                    > bioBuf->Des().MaxLength())
+            {
+                bioBuf = bioBuf->ReAllocL(bioBuf->Length()
+                        + copyBuffer->Length());
+            }
+            bioBuf->Des().Append(*copyBuffer);
+            //bioBuf->Des().Append(_L("\n"));
+        }
+    }while (err != KErrEof);
+
+    CleanupStack::PopAndDestroy(); // Destroy the copyBuffer.
+    CleanupStack::Pop();// Remove the bioBuf.
+
+    file.Close();
+    return bioBuf;
+}
+
+TMsvId TestUniDataModelVCalPlugin::CreateBIOEntryL(TDesC& aText,
+                                                   TBIOMessageType aMessageType)
+{
+    // Ensure that we have a valid service ID to work with:
+    TMsvId iBioServiceId;
+
+    iBioServiceId = SetBIOServiceIdL();
+
+    HBufC* localBuffer = aText.AllocL();
+    CleanupStack::PushL(localBuffer);
+
+    TPtr messDes = localBuffer->Des();
+
+    if (aMessageType != EBiovCardMessage && aMessageType
+            != EBiovCalenderMessage)
+    {
+        // convert \r\n to \n since this is what is expected from SMS when not vCard data
+        for (TInt i = 0; i < messDes.Length(); i++)
+        {
+            if (messDes[i] == (TText) '\r' && i < messDes.Length() - 1
+                    && messDes[i + 1] == (TText) '\n')
+                messDes.Delete(i, 1);
+        }
+    }
+
+    //  Create and fill a CRichText object for the jobbie:
+    CParaFormatLayer* paraFormatLayer = CParaFormatLayer::NewL();
+    CleanupStack::PushL(paraFormatLayer);
+    CCharFormatLayer* charFormatLayer = CCharFormatLayer::NewL();
+    CleanupStack::PushL(charFormatLayer);
+    CRichText* richText = CRichText::NewL(paraFormatLayer, charFormatLayer);
+    CleanupStack::PushL(richText);
+
+    TInt pos = richText->DocumentLength();
+    richText->InsertL(pos, messDes);
+
+    TMsvEntry newBioEntry;
+    newBioEntry.SetNew(ETrue);
+    newBioEntry.SetComplete(EFalse);
+    newBioEntry.SetUnread(ETrue);
+    newBioEntry.SetVisible(ETrue);
+    newBioEntry.SetReadOnly(EFalse);
+    newBioEntry.SetFailed(EFalse);
+    newBioEntry.SetOperation(EFalse);
+    newBioEntry.SetMultipleRecipients(EFalse);
+    newBioEntry.SetAttachment(EFalse);
+    newBioEntry.iMtm = KUidBIOMessageTypeMtm;
+    newBioEntry.iType = KUidMsvMessageEntry;
+    newBioEntry.iServiceId = iBioServiceId;
+    TTime now;
+    now.UniversalTime();
+    newBioEntry.iDate = now;
+
+    TTime unixEpoch(KUnixEpoch);
+    TTimeIntervalSeconds seconds;
+    TTime timeStamp = newBioEntry.iDate;
+    timeStamp.SecondsFrom(unixEpoch, seconds);
+    retTimeStamp.setTime_t(seconds.Int());
+
+    newBioEntry.iDescription.Set(richText->Read(0, richText->DocumentLength()));
+    TBufC<KTelephoneNumberMaxLength> telNumber;
+
+    QString recepient(TEST_MSG_FROM1);
+    tempNumber = S60QConversions::qStringToS60Desc(recepient);
+
+    telNumber = tempNumber->Des();
+    newBioEntry.iDetails.Set(telNumber);
+
+    SetForMtmTypeL(newBioEntry, aMessageType);
+
+    newBioEntry.iSize = richText->DocumentLength();// msgSize;
+    CreateBioEntryClientSideL(newBioEntry, *richText);
+
+    CleanupStack::PopAndDestroy(4); // richText, charFormatLayer, paraFormatLayer, localBuffer
+    return newBioEntry.Id();
+}
+
+void TestUniDataModelVCalPlugin::CreateBioEntryClientSideL(TMsvEntry& aEntry,
+                                                           CRichText& aBody)
+{
+    if (inbox)
+    {
+        iMsvEntry->SetEntryL(KMsvGlobalInBoxIndexEntryId);
+    }
+    else if (drafts)
+    {
+        iMsvEntry->SetEntryL(KMsvDraftEntryId);
+    }
+    //  Get the global inbox.   
+
+    iMsvEntry->CreateL(aEntry);
+    iMsvEntry->SetEntryL(aEntry.Id());
+
+    // Save all the changes
+    CMsvStore* store = iMsvEntry->EditStoreL();
+    CleanupStack::PushL(store);
+
+    if (store->HasBodyTextL())
+    {
+        store->DeleteBodyTextL();
+    }
+
+    CPlainText* pText = CPlainText::NewL();
+    CleanupStack::PushL(pText);
+
+    if (inbox)
+    {
+        CSmsHeader* smsHeader = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *pText);
+        CleanupStack::PushL(smsHeader);
+        smsHeader->SetFromAddressL(*tempNumber);
+        smsHeader->StoreL(*store);
+
+    }
+    else if (drafts)
+    {
+
+        QString recepient(TEST_MSG_FROM1);
+        QString recepient2(TEST_MSG_FROM2);
+        QString alias(TEST_MSG_ALIAS1);
+
+        HBufC* addr = S60QConversions::qStringToS60Desc(recepient);
+        HBufC* addr2 = S60QConversions::qStringToS60Desc(recepient2);
+        HBufC* alias1 = S60QConversions::qStringToS60Desc(alias);
+
+        CSmsHeader* smsHeader = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *pText);
+        CleanupStack::PushL(smsHeader);
+
+        CSmsNumber* number1 = CSmsNumber::NewL(); // create the instance
+        CleanupStack::PushL(number1);
+
+        number1->SetNameL(TPtrC());
+        number1->SetAddressL(*addr);
+        smsHeader->Recipients().AppendL(number1);
+        CleanupStack::Pop(number1);
+
+        CSmsNumber* number2 = CSmsNumber::NewL();
+        CleanupStack::PushL(number2);
+
+        number2->SetNameL(*alias1);
+        number2->SetAddressL(*addr2);
+
+        smsHeader->Recipients().AppendL(number2);
+        CleanupStack::Pop(number2);
+        smsHeader->StoreL(*store);
+
+    }
+
+    store->StoreBodyTextL(aBody);
+    store->CommitL();
+
+    CleanupStack::PopAndDestroy(3); //store - close the store
+
+    aEntry.SetComplete(ETrue);
+    // Update the entry
+    iMsvEntry->ChangeL(aEntry);
+    iMsvEntry->SetEntryL(KMsvRootIndexEntryId);
+}
+
+TMsvId TestUniDataModelVCalPlugin::SetBIOServiceIdL()
+{
+    //  Haven't found an entry so create a BIO Message service:
+    TMsvEntry bioServiceEntry;
+    bioServiceEntry.iMtm = KUidBIOMessageTypeMtm;
+    bioServiceEntry.iType = KUidMsvServiceEntry;
+    bioServiceEntry.SetVisible(EFalse);
+    bioServiceEntry.iDate.UniversalTime();
+    bioServiceEntry.iDescription.Set(_L("BIO Message Service ")); // Is there such a thing?
+    bioServiceEntry.iDetails.Set(_L("BIO Message Service"));
+
+    TMsvId newBIOServiceId;
+
+    iMsvEntry->SetEntryL(KMsvRootIndexEntryId);
+    iMsvEntry->CreateL(bioServiceEntry); // Needs to be a child of the root!
+    newBIOServiceId = bioServiceEntry.Id();
+
+    return newBIOServiceId;
+}
+
+void TestUniDataModelVCalPlugin::SetForMtmTypeL(TMsvEntry& aEntry,
+                                                TBIOMessageType aType)
+{
+    TInt index;
+
+    aEntry.iBioType = KUidBIOVCalenderMsg;
+
+    // Set other TMsvEntry fields if we have a BIO message type
+    if (aType != ENoMessage)
+    {
+        aEntry.SetMtmData2(0);
+        aEntry.SetMtmData3(0);
+    }
+
+    // set description from BIF file
+    iBioDb->GetBioIndexWithMsgIDL(TUid::Uid(aEntry.iBioType), index);
+    if (index == KErrNotFound)
+        User::Leave(KErrNotFound);
+    aEntry.iDescription.Set(iBioDb->BifReader(index).Description());
+}
+
+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/unidatamodelplugins/unibiomessagedataplugin/tsrc/testunidatamodelvcalplugin/testunidatamodelvcalplugin.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,120 @@
+/*
+ * 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_VCAL_PLUGIN_H
+#define TEST_UNI_DATA_MODEL_VCAL_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>
+#include <e32math.h> 
+
+
+#include <bsp.h>
+
+const TInt32	KUidBIOVCalenderMsg			=  {0x10005533};    // VCalender diary
+
+class UniDataModelPluginInterface;
+class UniDataModelLoader;
+class MsgObserver;
+
+class ConvergedMessage;
+class CBIODatabase;
+
+
+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 TestUniDataModelVCalPlugin : 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 testInBoxVCalMessage();
+    void testDraftsVCalMessage();
+    void testUnusedAPIs();
+
+private:
+    TMsvId CreateBIOEntryL(TDesC& aText, TBIOMessageType aMessageType);
+    void CreateBioEntryClientSideL(TMsvEntry& aEntry, CRichText& aBody);
+    HBufC* ReadFromFileL(const TDesC& aFile);
+    void SetSessionPath(const TDesC& aSessionPath);
+    TMsvId CreateBIOEntryFromFileL(const TDesC& aFilename,
+                                   TBIOMessageType aMessageType);
+    TBIOMessageType SetMessageType(const TDesC& aFileName);
+    CMsvEntrySelection* GenerateMessagesL();
+    TMsvId SetBIOServiceIdL();
+    void SetForMtmTypeL(TMsvEntry& aEntry, TBIOMessageType aType);
+
+private:
+    UniDataModelPluginInterface* pluginInterface;
+    MsgObserver* iObserver;
+    CMsvSession* iMSession;
+    CClientMtmRegistry* iMtmReg;
+    TMsvId messageId;
+    UniDataModelLoader* pluginLoader;
+    QDateTime retTimeStamp;
+    RFs iFs;
+    CDir* iDir;
+    TInt iFilesProcessed;
+    CMsvEntry* iMsvEntry;
+    CBIODatabase* iBioDb;
+    TMsvId newEntryId;
+    HBufC* tempNumber;
+    TBufC<KMaxFileName> currentFile;
+    TBool inbox;
+    TBool drafts;
+};
+
+class MsgObserver : public MMsvSessionObserver
+{
+public:
+    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2,
+                             TAny* aArg3);
+};
+
+#endif //TEST_UNI_DATA_MODEL_VCAL_PLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/testunidatamodelvcalplugin/testunidatamodelvcalplugin.ini	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,10 @@
+//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";
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/testunidatamodelvcalplugin/testunidatamodelvcalplugin.pro	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,66 @@
+#
+# 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-unidatamodel-vcal-plugin
+
+
+INCLUDEPATH += .
+INCLUDEPATH += ../../../../../../inc
+INCLUDEPATH += ../../../../../msgutils/s60qconversions/inc
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+DEFINES += BUILD_TEST_DLL
+
+SOURCES += \
+	testunidatamodelvcalplugin.cpp
+
+				
+# Input
+HEADERS += \
+	testunidatamodelvcalplugin.h
+	
+	   	   			 
+   
+SYMBIAN_PLATFORMS = WINSCW ARMV5
+    symbian {
+    TARGET.CAPABILITY = CAP_GENERAL_DLL
+    TARGET.EPOCSTACKSIZE = 0x8000
+    TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000
+    TARGET.EPOCALLOWDLLDATA = 1
+    BLD_INF_RULES.prj_exports += "vcal1.txt /epoc32/winscw/c/test/vcal1.txt"
+    BLD_INF_RULES.prj_exports += "BioMtm.rsc /epoc32/winscw/c/resource/messaging/mtm/BioMtm.rsc"
+		}
+
+ LIBS += -leuser \
+	-lconvergedmessageutils\
+	-ls60qconversions \
+	-lmsgs \
+	-lsmcm \
+	-lgsmu \
+	-letext \
+	-lmsgs \
+	-lunidatamodelloader\
+	-lQtCore \
+	-lbioc \
+	-lefsrv \
+	-lbiodb \
+	-lbifu
+	
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/tsrc/testunidatamodelvcalplugin/vcal1.txt	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,15 @@
+BEGIN:VCALENDAR
+PRODID:-//Microsoft Corporation//Outlook 9.0 MIMEDIR//EN
+VERSION:1.0
+BEGIN:VEVENT
+DTSTART:20000322T080000Z
+DTEND:20000322T083000Z
+LOCATION;ENCODING=QUOTED-PRINTABLE:Somewhere
+UID:040000008200E00074C5B7101A82E0080000000090BB8A23ED93BF010000000000000000100
+ 00000AB7E96B01EFFD31192E70060084F0B48
+DESCRIPTION;ENCODING=QUOTED-PRINTABLE:=09You will be busy doing something, =
+somewhere at some point.=0D=0A
+SUMMARY;ENCODING=QUOTED-PRINTABLE:My big appointment
+PRIORITY:3
+END:VEVENT
+END:VCALENDAR
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/unibiomessagedataplugin.pro	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,70 @@
+#
+# 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 = lib
+TARGET = $$qtLibraryTarget(unibiomessagedataplugin)
+
+TARGET.CAPABILITY = All -TCB
+TARGET.EPOCALLOWDLLDATA = 1
+
+#UID 3
+TARGET.UID3 = 0x2001FE61
+
+DEPENDPATH += . inc src
+INCLUDEPATH += ./inc
+INCLUDEPATH += ../../../../msgutils/s60qconversions/inc
+INCLUDEPATH += ../../../../../inc
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+SYMBIAN_PLATFORMS = WINSCW ARMV5
+
+CONFIG += plugin
+
+# Input
+HEADERS += inc/unibiomessagedataplugin.h \
+	inc/unibiomessagedataplugin_p.h 
+	   	   		   
+SOURCES += src/unibiomessagedataplugin.cpp \
+	src/unibiomessagedataplugin_p.cpp
+ 
+# Build.inf rules 
+BLD_INF_RULES.prj_exports += \
+  "$${LITERAL_HASH}include <platform_paths.hrh>" \
+    "rom/unibiomessagedataplugin.iby             CORE_APP_LAYER_IBY_EXPORT_PATH(unibiomessagedataplugin.iby)" 
+ 
+    symbian {
+    BLD_INF_RULES.prj_exports += "prov.rsc /epoc32/data/z/resource/messaging/bif/prov.rsc"
+		}
+     
+ LIBS += -leuser \
+	-lconvergedmessageutils\
+	-ls60qconversions \
+	-lmsgs \
+	-lSmcm \
+	-lgsmu \
+	-letext \
+	-lQtCore \
+	-lefsrv \
+	-lbioc \
+	-lbifu
+
+
+# plugin stub deployment
+plugin.sources = unibiomessagedataplugin.dll
+plugin.path = \resource\qt\plugins\messaging\datamodel
+DEPLOYMENT += plugin
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unidatamodelplugins.pro	Mon May 03 12:29:07 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
+
+SYMBIAN_PLATFORMS = WINSCW ARMV5
+
+SUBDIRS += unismsdataplugin/unismsdataplugin.pro
+SUBDIRS += unibiomessagedataplugin/unibiomessagedataplugin.pro
+SUBDIRS += unimmsdataplugin/unimmsdataplugin.pro
+
+CONFIG += ordered
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/inc/unimmsdataplugin.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,178 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: MMS data model plugin.
+ *
+ */
+
+#ifndef UNIMMSDATAPLUGIN_H_
+#define UNIMMSDATAPLUGIN_H_
+
+#include <QObject>
+#include "unidatamodelplugininterface.h"
+
+class UniMMSDataPluginPrivate;
+
+/**
+ * MMS data model plugin.
+ * Implements the processing of an MMS message in Message Store.
+ */
+class UniMMSDataPlugin : public QObject, public UniDataModelPluginInterface
+{
+Q_OBJECT 
+Q_INTERFACES(UniDataModelPluginInterface)
+
+public:
+    /**
+     * Constructor
+     */
+    UniMMSDataPlugin(QObject* parent = 0);
+
+    /**
+     * Destructor
+     */
+    ~UniMMSDataPlugin();
+    
+    /**
+     * Creates the new instance of the plugin
+     * @return plugin instance
+     */    
+    QObject* createInstance();
+
+    /**
+     * Sets the id of the message whose details needs to be extacted.
+     * @param TMsvId of the message.
+     */
+    int setMessageId(int messageId);
+
+    /** Reset the datamodel
+     * Resets the data model to be used again
+     */
+    void reset();
+
+    /**
+     * Get the body of the message
+     * @param aBodyText , a QString to hold the message body
+     */
+    void body(QString& aBodyText);
+
+    /**
+     * Size of the message
+     * @return message size
+     */
+    int messageSize();
+
+    /**
+     * List of the message To recipients 
+     * @param  mAddressList, list of all addresses in the message
+     */
+    void toRecipientList(ConvergedMessageAddressList& mAddressList);
+
+    /**
+     * List of the message CC recipients 
+     * @param  mAddressList, list of all addresses in the message
+     */
+    void ccRecipientList(ConvergedMessageAddressList& mAddressList);
+
+    /**
+     * List of the message  bCC recipients 
+     * @param  mAddressList, list of all addresses in the message
+     */
+    void bccRecipientList(ConvergedMessageAddressList& mAddressList);
+
+    /**
+     * The from address of a message
+     * @param messageAddress
+     */
+    void fromAddress(QString& messageAddress);
+
+    /**
+     * List of attachments in the message.
+     * @return the attachment list for the message.
+     */
+    UniMessageInfoList attachmentList();
+
+    /**
+     * Type of the message (SMS/MMS etc..)
+     * @return message type
+     */
+    QString messageType();
+
+    /**
+     * Priority of the message (low/medium/high)
+     * @return MsgPriority.
+     */
+    MsgPriority messagePriority();
+
+    /**
+     * Number of attachments with the message
+     * @return count of attachment
+     */
+    int attachmentCount();
+
+    /**
+     * To check if the message has attachments
+     * @return true/false
+     */
+    bool hasAttachment();
+
+    /**
+     * Number of objects asociated with a MMS message
+     * @return object count
+     */
+    int objectCount();
+
+    /**
+     * The MMS object list asociated with a MMS message
+     * @return object list 
+     */
+    UniMessageInfoList objectList();
+
+    /**
+     * Number of slides asociated with a MMS message
+     * @return slide count
+     */
+    int slideCount();
+
+    /**
+     * The content of a Slide in case of a MMS message
+     * @param list of messageinfo objects.
+     */
+    UniMessageInfoList slideContent(int slidenum);
+
+    /**
+     * Time stamp of the message when it was created/recieved.
+     * @param mesage time
+     */
+    QDateTime timeStamp();
+    
+    /**
+     * @see UniDataModelPluginInterface
+     */
+    void restore(CBaseMtm& mtm);
+
+   	/**
+     * @see UniDataModelPluginInterface 
+     */
+		QString subject();
+	
+		/**
+     * @see UniDataModelPluginInterface 
+     */	
+    CMsvSession* session();
+        
+private:
+    UniMMSDataPluginPrivate* d_ptr;
+};
+
+#endif /* UNIMMSDATAPLUGIN_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/inc/unimmsdataplugin_p.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,211 @@
+/*
+ * 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: MMS data model plugin.
+ *
+ */
+
+#ifndef UNIMMSDATAPLUGIN_P_H_
+#define UNIMMSDATAPLUGIN_P_H_
+
+//SYSTEM INCLUDE
+#include <f32file.h>  //for FileSession RFs
+#include <msvapi.h>
+#include <e32base.h>
+
+#include "unidatamodelplugininterface.h"
+#include "UniDataModel.h"
+
+//Forward Declaration
+class CMmsClientMtm;
+class CUniDataModel;
+class CMsvSession;
+class CClientMtmRegistry;
+class CMsgMediaInfo;
+
+/**
+ * Symbian specific implementation of the uni MMS plugin
+ */
+class UniMMSDataPluginPrivate : public MUniDataModelObserver, public MMsvSessionObserver
+{
+public:
+    /**
+     * Constructor
+     */
+    UniMMSDataPluginPrivate();
+
+    /**
+     * Destructor
+     */
+    ~UniMMSDataPluginPrivate();
+
+    /**
+     * Sets the id of the message whose details needs to be extacted.
+     * @param TMsvId of the message.
+     */
+    int setMessageId(int messageId);
+
+    /** Reset the datamodel
+     * Resets the data model to be used again
+     */
+    void reset();
+
+    /**
+     * Get the body of the message
+     * @param aBodyText , a QString to hold the message body
+     */
+    void body(QString& aBodyText);
+
+    /**
+     * Size of the message
+     * @return message size
+     */
+    int messageSize();
+
+    /**
+     * List of the message To recipients 
+     * @param  mAddressList, list of all addresses in the message
+     */
+    void toRecipientList(ConvergedMessageAddressList& mAddressList);
+
+    /**
+     * List of the message CC recipients 
+     * @param  mAddressList, list of all addresses in the message
+     */
+    void ccRecipientList(ConvergedMessageAddressList& mAddressList);
+
+    /**
+     * List of the message  bCC recipients 
+     * @param  mAddressList, list of all addresses in the message
+     */
+    void bccRecipientList(ConvergedMessageAddressList& mAddressList);
+
+    /**
+     * The from address of a message
+     * @param messageAddress
+     */
+    void fromAddress(QString& messageAddress);
+
+    /**
+     * List of attachments in the message.
+     * @return the attachment list for the message.
+     */
+    UniMessageInfoList attachmentList();
+
+    /**
+     * Type of the message (SMS/MMS etc..)
+     * @return message type
+     */
+    QString messageType();
+
+    /**
+     * Priority of the message (low/medium/high)
+     * @return MsgPriority.
+     */
+    MsgPriority messagePriority();
+
+    /**
+     * Number of attachments with the message
+     * @return count of attachment
+     */
+    int attachmentCount();
+
+    /**
+     * To check if the message has attachments
+     * @return true/false
+     */
+    bool hasAttachment();
+
+    /**
+     * Number of objects asociated with a MMS message
+     * @return object count
+     */
+    int objectCount();
+
+    /**
+     * The MMS object list asociated with a MMS message
+     * @return object list 
+     */
+    UniMessageInfoList objectList();
+
+    /**
+     * Number of slides asociated with a MMS message
+     * @return slide count
+     */
+    int slideCount();
+
+    /**
+     * The content of a Slide in case of a MMS message
+     * @param list of messageinfo objects.
+     */
+    UniMessageInfoList slideContent(TInt slidenum);
+
+    /**
+     * Time stamp of the message when it was created/recieved.
+     * @param mesage time
+     */
+    int timeStamp();
+
+    
+    /**
+     * Restore the model for editing only 
+     * @param CBaseMtm
+     */
+    void restoreL(CBaseMtm& mtm);
+
+    
+	
+	/**
+     * Subject of the message
+     * @QString subject
+     */
+	QString subject();
+	 
+	/**
+	 * Session with the Messaging server
+	 * @return CMsvSession*
+	 */
+    CMsvSession* session();
+
+public:
+  
+	void RestoreReady(TInt aParseResult, TInt aError);
+private:
+    /**
+     *  Extracts the name and adress from the CMsvRecipientList
+     */
+    void extractNameAndAddress(const TDesC& aMsvAddress, TPtrC& aName,
+        TPtrC& aAddress);
+    
+    void initL();
+
+    void setMessageIdL(int messageId);
+    
+    /**
+      * @see MMsvSessionObserver
+      */
+    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2,
+             TAny* aArg3);
+private:
+
+    CMsvSession* mSession;
+    CClientMtmRegistry* mMtmRegistry;
+    CUniDataModel *mUniDataModel;
+    RFs mfsSession;
+    TRequestStatus iStatus;
+    CMmsClientMtm* mMmsClient;
+    TMsvId iMessageId;
+    TBool done;    
+};
+
+#endif /* UNIMMSDATAPLUGIN_P_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/rom/unimmsdataplugin.iby	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,27 @@
+/*
+* 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 __UNI_MMS_DATA_PLUGIN_IBY__
+#define __UNI_MMS_DATA_PLUGIN_IBY__
+
+
+# this is the plugin stub for QT plugin
+file=ABI_DIR\UREL\unimmsdataplugin.dll               SHARED_LIB_DIR\unimmsdataplugin.dll
+data=\epoc32\data\z\resource\qt\plugins\messaging\datamodel\unimmsdataplugin.qtplugin     \resource\qt\plugins\messaging\datamodel\unimmsdataplugin.qtplugin
+
+#endif // __UNI_MMS_DATA_PLUGIN_IBY__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/src/unimmsdataplugin.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,156 @@
+/*
+ * 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 "debugtraces.h"
+
+#include "unimmsdataplugin.h"
+#include "unimmsdataplugin_p.h"
+
+UniMMSDataPlugin::UniMMSDataPlugin(QObject* parent) :
+    QObject(parent)
+{
+    d_ptr = new UniMMSDataPluginPrivate();
+}
+
+UniMMSDataPlugin::~UniMMSDataPlugin()
+{
+    delete d_ptr;
+}
+
+QObject* UniMMSDataPlugin::createInstance()
+{
+return new UniMMSDataPlugin();
+}
+
+int UniMMSDataPlugin::setMessageId(int messageId)
+{
+    return d_ptr->setMessageId(messageId);
+}
+
+void UniMMSDataPlugin::reset()
+{
+    d_ptr->reset();
+}
+
+void UniMMSDataPlugin::body(QString& aBodyText)
+{
+    d_ptr->body(aBodyText);
+}
+
+int UniMMSDataPlugin::messageSize()
+{
+    return d_ptr->messageSize();
+}
+
+void UniMMSDataPlugin::toRecipientList(
+                                       ConvergedMessageAddressList& mAddressList)
+{
+    d_ptr->toRecipientList(mAddressList);
+}
+
+void UniMMSDataPlugin::ccRecipientList(
+                                       ConvergedMessageAddressList& mAddressList)
+{
+    d_ptr->ccRecipientList(mAddressList);
+}
+
+void UniMMSDataPlugin::bccRecipientList(
+                                        ConvergedMessageAddressList& mAddressList)
+{
+    d_ptr->bccRecipientList(mAddressList);
+}
+
+void UniMMSDataPlugin::fromAddress(QString& messageAddress)
+{
+    d_ptr->fromAddress(messageAddress);
+}
+
+UniMessageInfoList UniMMSDataPlugin::attachmentList()
+{
+    return d_ptr->attachmentList();
+}
+
+QString UniMMSDataPlugin::messageType()
+{
+    return d_ptr->messageType();
+}
+
+MsgPriority UniMMSDataPlugin::messagePriority()
+{
+    return d_ptr->messagePriority();
+}
+
+int UniMMSDataPlugin::attachmentCount()
+{
+    return d_ptr->attachmentCount();
+}
+
+bool UniMMSDataPlugin::hasAttachment()
+{
+    return d_ptr->hasAttachment();
+}
+
+int UniMMSDataPlugin::objectCount()
+{
+    return d_ptr->objectCount();
+}
+
+UniMessageInfoList UniMMSDataPlugin::objectList()
+{
+    return d_ptr->objectList();
+}
+
+int UniMMSDataPlugin::slideCount()
+{
+    return d_ptr->slideCount();
+}
+
+UniMessageInfoList UniMMSDataPlugin::slideContent(int slidenum)
+{
+    return d_ptr->slideContent(slidenum);
+}
+
+QDateTime UniMMSDataPlugin::timeStamp()
+{
+    QDateTime retTimeStamp;
+    int tStamp = d_ptr->timeStamp();
+    retTimeStamp.setTime_t(tStamp);
+    return retTimeStamp;
+}
+
+void UniMMSDataPlugin::restore(CBaseMtm& mtm)
+{
+    QDEBUG_WRITE("Inside restore");
+    int error;    
+    TRAP(error,d_ptr->restoreL(mtm));    
+    QDEBUG_WRITE_FORMAT("Exiting restore with error= ",error);
+}
+
+QString UniMMSDataPlugin::subject()
+{
+    return d_ptr->subject(); 
+}
+
+CMsvSession* UniMMSDataPlugin::session()
+{
+    return d_ptr->session();
+    
+}
+
+
+Q_EXPORT_PLUGIN2(unimmsdataplugin, UniMMSDataPlugin)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/src/unimmsdataplugin_p.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,453 @@
+/*
+ * 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: 
+ *
+ */
+
+//SYSTEM INCLUDES
+#include <e32cmn.h>
+#include <mtclreg.h>
+#include <mtclbase.h>
+#include <msvids.h>
+#include <txtetext.h>
+#include <txtrich.h>
+#include <txtfmlyr.h>
+#include <badesca.h>
+#include <eikrted.h>
+#include <mmsclient.h>
+#include <mmssettings.h>
+#include <mmsheaders.h>
+#include <MsgMediaInfo.h>
+#include <MsgMediaResolver.h>
+#include <QDateTime>
+
+#include "convergedmessage.h"
+#include "s60qconversions.h"
+#include "convergedmessageaddress.h"
+#include "unimmsdataplugin_p.h"
+#include "debugtraces.h"
+
+
+#define KSenduiMtmMmsUidValue 0x100058E1
+const TUid KSenduiMtmMmsUid = {KSenduiMtmMmsUidValue};
+
+_LIT(KUnixEpoch, "19700000:000000.000000");
+
+
+UniMMSDataPluginPrivate::UniMMSDataPluginPrivate():
+    mSession(NULL),
+    mMtmRegistry(NULL),
+    mUniDataModel(NULL),
+    mMmsClient(NULL)
+    {
+    done = EFalse;
+    mSession = CMsvSession::OpenSyncL(*this);
+    }
+
+void UniMMSDataPluginPrivate::initL()
+{
+    mMtmRegistry = CClientMtmRegistry::NewL(*mSession);
+    mMmsClient = static_cast<CMmsClientMtm*> (mMtmRegistry->NewMtmL(KSenduiMtmMmsUid));
+    User::LeaveIfError(mfsSession.Connect());
+    iMessageId = 0;
+}
+
+UniMMSDataPluginPrivate::~UniMMSDataPluginPrivate()
+{
+   if(mUniDataModel)
+    {
+        delete mUniDataModel;
+    }
+    mfsSession.Close();
+    delete mMmsClient;
+    delete mMtmRegistry;
+    delete mSession;
+}
+
+int UniMMSDataPluginPrivate::setMessageId(int messageId)
+{
+    TInt error = KErrNone;
+    TRAP(error, setMessageIdL(messageId));
+    return error;
+}
+
+void UniMMSDataPluginPrivate::setMessageIdL(int messageId)
+{
+    if (done == EFalse)
+    {
+        initL();
+    }
+
+    if (iMessageId != messageId)
+    {
+        if (done)
+        {
+            reset();
+        }
+        done = ETrue;
+        iMessageId = messageId;
+        mMmsClient->SwitchCurrentEntryL(iMessageId);
+        mMmsClient->LoadMessageL();
+        mUniDataModel = CUniDataModel::NewL(mfsSession, *mMmsClient);
+        mUniDataModel->RestoreL(*this, EFalse);
+    }
+}
+
+void UniMMSDataPluginPrivate::reset()
+{
+    delete mUniDataModel;
+    mUniDataModel = NULL;
+}
+
+void UniMMSDataPluginPrivate::body(QString& aBodyText)
+{
+
+    CRichText& textBody = mMmsClient->Body();
+    TInt len = textBody.DocumentLength();
+    HBufC* buf = HBufC::NewL(len);
+    TPtr bufPtr = buf->Des();
+    aBodyText = S60QConversions::s60DescToQString(bufPtr);
+}
+
+int UniMMSDataPluginPrivate::messageSize()
+{
+    return mMmsClient->MessageSize();
+}
+
+
+QString UniMMSDataPluginPrivate::subject()
+{
+   TPtrC sub =  mMmsClient->SubjectL();
+   return S60QConversions::s60DescToQString(sub);
+}
+
+
+
+
+void UniMMSDataPluginPrivate::toRecipientList(
+    ConvergedMessageAddressList& mAddressList)
+{
+    CMsvEntry* cEntry = mSession->GetEntryL(KMsvGlobalInBoxIndexEntryIdValue);
+    CleanupStack::PushL(cEntry);
+    TRAPD (error, cEntry->SetEntryL( iMessageId ));
+    if (error != KErrNone)
+    {
+        CleanupStack::PopAndDestroy(); // cEntry
+        return;
+    }
+    CMsvStore* store = cEntry->ReadStoreL();
+    CleanupStack::PushL(store);
+    CMmsSettings* settings = CMmsSettings::NewL();
+    CleanupStack::PushL(settings);
+    CMmsHeaders* mmsHeaders = CMmsHeaders::NewL(settings->MmsVersion());
+    CleanupStack::PushL(mmsHeaders);
+    mmsHeaders->RestoreL(*store);
+    TPtrC name;
+    TPtrC address;
+    TPtrC to;
+    for (TInt id = 0; id < mmsHeaders->ToRecipients().MdcaCount(); id++)
+    {
+        to.Set( (mmsHeaders->ToRecipients())[id]);
+        extractNameAndAddress(to, name, address);
+        // populate address
+        ConvergedMessageAddress
+        * messageAddress =
+            new ConvergedMessageAddress(S60QConversions::s60DescToQString(address),
+                S60QConversions::s60DescToQString(name));
+        mAddressList.append(messageAddress);
+    }
+
+    CleanupStack::PopAndDestroy(3); //  mmsHeaders, settings, store
+
+    CleanupStack::PopAndDestroy(); // cEntry
+}
+
+void UniMMSDataPluginPrivate::ccRecipientList(
+    ConvergedMessageAddressList& mAddressList)
+{
+    CMsvEntry* cEntry = mSession->GetEntryL(KMsvGlobalInBoxIndexEntryIdValue);
+    CleanupStack::PushL(cEntry);
+    TRAPD (error, cEntry->SetEntryL( iMessageId ));
+    if (error != KErrNone)
+    {
+        CleanupStack::PopAndDestroy(); // cEntry
+        return;
+    }
+    CMsvStore* store = cEntry->ReadStoreL();
+    CleanupStack::PushL(store);
+    CMmsSettings* settings = CMmsSettings::NewL();
+    CleanupStack::PushL(settings);
+    CMmsHeaders* mmsHeaders = CMmsHeaders::NewL(settings->MmsVersion());
+    CleanupStack::PushL(mmsHeaders);
+    mmsHeaders->RestoreL(*store);
+    //CDesCArray& ccList = mmsHeaders->CcRecipients();
+
+    TPtrC cc;
+    TPtrC name;
+    TPtrC address;
+    for (TInt id = 0; id < mmsHeaders->CcRecipients().MdcaCount(); id++)
+    {
+        cc.Set( (mmsHeaders->CcRecipients())[id]);
+        extractNameAndAddress(cc, name, address);
+        // populate address
+        ConvergedMessageAddress
+        * messageAddress =
+            new ConvergedMessageAddress(S60QConversions::s60DescToQString(address),
+                S60QConversions::s60DescToQString(name));
+        mAddressList.append(messageAddress);
+    }
+
+    CleanupStack::PopAndDestroy(3); //  mmsHeaders, settings, store
+
+    CleanupStack::PopAndDestroy(); // cEntry
+}
+
+void UniMMSDataPluginPrivate::bccRecipientList(
+    ConvergedMessageAddressList& mAddressList)
+{
+    CMsvEntry* cEntry = mSession->GetEntryL(KMsvGlobalInBoxIndexEntryIdValue);
+    CleanupStack::PushL(cEntry);
+    TRAPD (error, cEntry->SetEntryL( iMessageId ));
+    if (error != KErrNone)
+    {
+        CleanupStack::PopAndDestroy(); // cEntry
+        return;
+    }
+    CMsvStore* store = cEntry->ReadStoreL();
+    CleanupStack::PushL(store);
+    CMmsSettings* settings = CMmsSettings::NewL();
+    CleanupStack::PushL(settings);
+    CMmsHeaders* mmsHeaders = CMmsHeaders::NewL(settings->MmsVersion());
+    CleanupStack::PushL(mmsHeaders);
+    mmsHeaders->RestoreL(*store);
+    //CDesCArray& bccList = mmsHeaders->BccRecipients();
+
+    TPtrC bcc;
+    TPtrC name;
+    TPtrC address;
+    for (TInt id = 0; id < mmsHeaders->BccRecipients().MdcaCount(); id++)
+    {
+        bcc.Set( (mmsHeaders->BccRecipients())[id]);
+        extractNameAndAddress(bcc, name, address);
+        // populate address
+        ConvergedMessageAddress
+        * messageAddress =
+            new ConvergedMessageAddress(S60QConversions::s60DescToQString(address),
+                S60QConversions::s60DescToQString(name));
+        mAddressList.append(messageAddress);
+    }
+
+    CleanupStack::PopAndDestroy(3); //  mmsHeaders, settings, store
+
+    CleanupStack::PopAndDestroy(); // cEntry
+}
+
+void UniMMSDataPluginPrivate::fromAddress(QString& messageAddress)
+{
+
+    TPtrC sender = mMmsClient->Sender();
+    messageAddress = S60QConversions::s60DescToQString(sender);
+}
+
+UniMessageInfoList UniMMSDataPluginPrivate::attachmentList()
+{
+    UniMessageInfoList attlist;
+    int attcount = mUniDataModel->AttachmentList().Count();
+
+    QString path;
+    QString mimetype;
+    int size;
+    for (int i = 0; i < attcount; i++)
+    {
+        CUniObject *obj = mUniDataModel->AttachmentList().GetByIndex(i);
+
+        mimetype = S60QConversions::s60Desc8ToQString(obj->MimeType());
+        path
+        = S60QConversions::s60DescToQString(obj->MediaInfo()->FullFilePath());
+        size = obj->Size(EFalse);
+
+        UniMessageInfo *msgobj = new UniMessageInfo(path, size, mimetype);
+        attlist << msgobj;
+    }
+
+    return attlist;
+}
+
+QString UniMMSDataPluginPrivate::messageType()
+{
+    QString str("mms");
+    return str;
+}
+
+MsgPriority UniMMSDataPluginPrivate::messagePriority()
+{
+    return Normal;
+}
+
+int UniMMSDataPluginPrivate::attachmentCount()
+{
+    return mUniDataModel->AttachmentList().Count();
+}
+
+bool UniMMSDataPluginPrivate::hasAttachment()
+{
+    int count = mUniDataModel->AttachmentList().Count();
+    if (count > 0)
+    {
+        return true;
+    }
+    else
+    {
+        return false;
+    }
+}
+
+int UniMMSDataPluginPrivate::objectCount()
+{
+    return mUniDataModel->ObjectList().Count();
+}
+
+UniMessageInfoList UniMMSDataPluginPrivate::objectList()
+{
+    UniMessageInfoList objlist;
+    int objcount = mUniDataModel->ObjectList().Count();
+
+    QString path;
+    QString mimetype;
+    int size;
+    for (int i = 0; i < objcount; i++)
+    {
+        CUniObject *obj = mUniDataModel->ObjectList().GetByIndex(i);
+
+        mimetype = S60QConversions::s60Desc8ToQString(obj->MimeType());
+        path
+        = S60QConversions::s60DescToQString(obj->MediaInfo()->FullFilePath());
+        size = obj->Size(EFalse);
+
+        UniMessageInfo *msgobj = new UniMessageInfo(path, size, mimetype);
+        objlist << msgobj;
+    }
+
+    return objlist;
+}
+
+/*
+ * For now not reqd
+ */
+int UniMMSDataPluginPrivate::slideCount()
+{
+    return mUniDataModel->SmilModel().SlideCount();
+}
+
+UniMessageInfoList UniMMSDataPluginPrivate::slideContent(TInt slidenum)
+{
+    UniMessageInfoList slidecontent;
+
+    int slideobjcount = mUniDataModel->SmilModel().SlideObjectCount(slidenum);
+
+    QString path;
+    QString mimetype;
+    int size;
+    for (int i = 0; i < slideobjcount; i++)
+    {
+        CUniObject *obj = mUniDataModel->SmilModel().GetObjectByIndex(slidenum,
+            i);
+
+        mimetype = S60QConversions::s60Desc8ToQString(obj->MimeType());
+        path
+        = S60QConversions::s60DescToQString(obj->MediaInfo()->FullFilePath());
+        size = obj->Size(EFalse);
+
+        UniMessageInfo *msgobj = new UniMessageInfo(path, size, mimetype);
+        slidecontent << msgobj;
+    }
+
+    return slidecontent;
+}
+
+int UniMMSDataPluginPrivate::timeStamp()
+{
+    QDateTime retTimeStamp;
+    TTime timeStamp = mMmsClient->Entry().Entry().iDate;
+    TTime unixEpoch(KUnixEpoch);
+    TTimeIntervalSeconds seconds;
+    timeStamp.SecondsFrom(unixEpoch, seconds);
+    return seconds.Int();
+}
+
+void UniMMSDataPluginPrivate::extractNameAndAddress(const TDesC& aMsvAddress,
+    TPtrC& aName,
+    TPtrC& aAddress)
+{
+    // For address information separation (start)
+    const TUint KMsgMmsAddressStartChar('<');
+
+    // For address information separation (end)
+    const TUint KMsgMmsAddressEndChar('>');
+
+    TInt addressStart = aMsvAddress.LocateReverse(KMsgMmsAddressStartChar);
+    TInt addressEnd = aMsvAddress.LocateReverse(KMsgMmsAddressEndChar);
+
+    if (addressStart != KErrNotFound && addressEnd != KErrNotFound
+            && addressEnd > addressStart)
+    {
+        // verified address, will be used as selected from contacts manager
+        aName.Set(aMsvAddress.Ptr(), addressStart);
+        aAddress.Set(aMsvAddress.Mid(addressStart + 1).Ptr(), (addressEnd
+                - addressStart) - 1);
+        if (!aAddress.Length())
+        {
+            aAddress.Set(aName);
+            aName.Set(KNullDesC); // empty string
+        }
+    }
+    else
+    {
+        // unverified string, will be used as entered in the header field
+        aName.Set(KNullDesC); // empty string
+        aAddress.Set(aMsvAddress.Ptr(), aMsvAddress.Length()); // a whole string to address
+    }
+
+    if (aName.CompareF(aAddress) == 0)
+    {
+        aName.Set(KNullDesC); // empty string
+    }
+}
+
+void UniMMSDataPluginPrivate::RestoreReady(TInt /*aParseResult*/, 
+    TInt /*aError*/)
+{
+}
+
+
+
+void UniMMSDataPluginPrivate::restoreL(CBaseMtm& mtm)
+{
+    initL();	
+    mUniDataModel = CUniDataModel::NewL(mfsSession, mtm);
+    mUniDataModel->RestoreL(*this, ETrue);
+}
+
+CMsvSession* UniMMSDataPluginPrivate::session()
+{
+    return mSession;
+}
+
+void UniMMSDataPluginPrivate::HandleSessionEventL(TMsvSessionEvent /*aEvent*/,
+                                                  TAny* /*aArg1*/,
+                                                  TAny* /*aArg2*/, TAny* /*aArg3*/)
+{
+// do nothing
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/bwins/test_unidatamodel_mms_pluginu.def	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,23 @@
+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/photo.jpg has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/testunidatamodelmmsplugin.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,496 @@
+/*
+ * 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 "s60qconversions.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 = S60QConversions::qStringToS60Desc(subject);
+        iMmsClientMtm->SetSubjectL(*subj);
+        }
+
+    //Sender
+    QString sender(TEST_MSG_FROM1);
+    HBufC* addr = S60QConversions::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 = S60QConversions::qStringToS60Desc(recipient);
+    if (addr2)
+        {
+        CleanupStack::PushL(addr2);
+        iMmsClientMtm->AddAddresseeL(EMsvRecipientTo,*addr2);
+        CleanupStack::PopAndDestroy(addr2);
+        }
+    
+    QString recipient2(TEST_MSG_RECIEPIENT2);
+    HBufC* addr3 = S60QConversions::qStringToS60Desc(recipient2);
+    if (addr3)
+        {
+        CleanupStack::PushL(addr3);
+        iMmsClientMtm->AddAddresseeL(EMsvRecipientCc,*addr3);
+        CleanupStack::PopAndDestroy(addr3);
+        }
+        
+    QString recipient3(TEST_MSG_RECIEPIENT3);
+        HBufC* addr4 = S60QConversions::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 = S60QConversions::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 = S60QConversions::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*/)
+{
+}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/testunidatamodelmmsplugin.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,86 @@
+/*
+ * 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_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/testunidatamodelmmsplugin.ini	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,5 @@
+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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/tsrc/testunidatamodelmmsplugin/testunidatamodelmmsplugin.pro	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,55 @@
+######################################################################
+# Automatically generated by qmake (2.01a) Fri Aug 7 12:54:45 2009
+######################################################################
+QT += testlib
+QT -= gui
+
+TEMPLATE = lib
+TARGET = test-unidatamodel-mms-plugin
+
+
+INCLUDEPATH += .
+INCLUDEPATH += ../../../../../msgutils/s60qconversions/inc
+INCLUDEPATH += ../../../../../internal/sf/app/messaging/mmsengine/mmsmessage/inc 
+INCLUDEPATH += ../../../../../internal/sf/app/messaging/mmsengine/inc
+INCLUDEPATH += ../../../../../../inc
+
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+DEFINES += BUILD_TEST_DLL
+
+SOURCES += \
+	TestUniDataModelMmsPlugin.cpp
+
+				 
+
+# Input
+HEADERS += \
+	TestUniDataModelMmsPlugin.h
+	
+	   	   			 
+   
+SYMBIAN_PLATFORMS = WINSCW ARMV5
+    symbian {
+    TARGET.CAPABILITY = CAP_GENERAL_DLL
+    TARGET.EPOCSTACKSIZE = 0x8000
+    TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000
+    TARGET.EPOCALLOWDLLDATA = 1
+    BLD_INF_RULES.prj_exports += "photo.jpg C:/pictures/photo.jpg"
+		}
+		
+ LIBS += -leuser \
+	-lconvergedmessageutils\
+	-ls60qconversions \
+	-lmsgs \
+	-lsmcm \
+	-lgsmu \
+	-letext \
+	-lmsgs \
+	-lunidatamodelloader\
+	-lQtCore \
+	-lmmscli \
+	-lefsrv \
+	-lmmsmessage \
+	-lmmsserversettings
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unimmsdataplugin/unimmsdataplugin.pro	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,77 @@
+#
+# 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 = lib
+TARGET = $$qtLibraryTarget(unimmsdataplugin)
+
+TARGET.CAPABILITY = All -TCB
+TARGET.EPOCALLOWDLLDATA = 1
+
+#UID 3
+TARGET.UID3 = 0xE01F5465 #need to get a uid 
+
+DEPENDPATH += . inc src
+
+INCLUDEPATH += ./inc
+INCLUDEPATH += ../../../../msgutils/s60qconversions/inc
+INCLUDEPATH += ../../../unieditorutils/unieditorutils/inc
+INCLUDEPATH += ../../../../../inc
+INCLUDEPATH += ../../../../mmsengine/mmsmessage/inc 
+INCLUDEPATH += ../../unidatamodel/inc
+INCLUDEPATH += ../../../../mmsengine/inc
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+SYMBIAN_PLATFORMS = WINSCW ARMV5
+
+CONFIG += plugin
+
+# Input
+HEADERS += inc/unimmsdataplugin.h \
+	inc/unimmsdataplugin_p.h
+
+	   	   
+		   
+SOURCES += src/unimmsdataplugin.cpp \
+	src/unimmsdataplugin_p.cpp
+ 
+# Build.inf rules 
+BLD_INF_RULES.prj_exports += \
+  "$${LITERAL_HASH}include <platform_paths.hrh>" \
+  "rom/unimmsdataplugin.iby             CORE_APP_LAYER_IBY_EXPORT_PATH(unimmsdataplugin.iby)" \
+	
+    
+ LIBS += -leuser \
+	-lbafl \
+	-lestor \
+	-lconvergedmessageutils\
+	-ls60qconversions \
+	-lmsgs \
+	-letext \
+	-lmmscli \
+	-lefsrv \
+	-lmmsmessage \
+	-leditorgenutils \
+	-lunidatamodel \
+	-lmmsserversettings \
+	-lmsgmedia \
+	-leikctl 
+	
+# plugin stub deployment
+plugin.sources = unimmsdataplugin.dll
+plugin.path = \resource\qt\plugins\messaging\datamodel
+DEPLOYMENT += plugin
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/inc/unismsdataplugin.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,180 @@
+/*
+ * 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: SMS data model plugin.
+ *
+ */
+
+#ifndef UNISMSDATAPLUGIN_H_
+#define UNISMSDATAPLUGIN_H_
+
+
+#include <QObject>
+#include "unidatamodelplugininterface.h"
+
+/**
+ * SMS data model plugin.
+ * Implements the processing of a SMS message in Message Store.
+ */
+
+class UniSMSDataPluginPrivate;
+
+class UniSMSDataPlugin : public QObject, public UniDataModelPluginInterface
+{
+    Q_OBJECT
+    Q_INTERFACES(UniDataModelPluginInterface)
+
+public:
+    /**
+     * constructor
+     */
+    UniSMSDataPlugin(QObject* parent = 0);
+
+    /**
+     * Destructor
+     */
+    ~UniSMSDataPlugin();
+    
+    /**
+     * Creates the new instance of the plugin
+     * @return plugin instance
+     */    
+    QObject* createInstance();
+
+
+    /**
+     *  Reset the datamodel
+     */
+    void reset();
+
+    /**
+     * sets the message id for which details needs to be fetched
+     * @param message id
+     */
+    int setMessageId(int mId);
+
+    /**
+     * Get the body of the message
+     * @param aBodyText, for message body
+     */
+    void body(QString& aBodyText);
+
+    /**
+     * size of the message
+     * @return size
+     */
+    int messageSize();
+
+    /**
+     * List of the message TO recipients
+     * @param list of the recipients
+     */
+    void toRecipientList(ConvergedMessageAddressList& mAddressList);
+    /**
+     * List of the message cc recipients
+     * @param list of the recipients
+     */
+    void ccRecipientList(ConvergedMessageAddressList& mAddressList);
+
+    /**
+     * List of the message bCC recipients
+     * @param list of the recipients
+     */
+    void bccRecipientList(ConvergedMessageAddressList& mAddressList);
+
+    /**
+     * Address from which the message was received
+     * @param messageAddress
+     */
+    void fromAddress(QString& messageAddress);
+
+    /**
+     * No. of attachments with the message
+     * @return attachment count 
+     */
+    int attachmentCount();
+
+    /**
+     *  To check if the message has attachments
+     *  @return true if attachment is present
+     */
+    bool hasAttachment();
+
+    /**
+     * list of attachments for a message 
+     * @return attachemnt list
+     */
+    UniMessageInfoList attachmentList();
+
+    /**
+     *  Message type (SMS/MMS etc..)
+     *  @return type of message 
+     */
+    QString messageType();
+
+    /**
+     * Priority of the message (high/low/medium)
+     */
+    MsgPriority messagePriority();
+
+    /**
+     * Number of objects asociated with a MMS message
+     * @return count of objects
+     */
+    int objectCount();
+
+    /**
+     * The MMS object list
+     * @return object list 
+     */
+    UniMessageInfoList objectList();
+
+    /**
+     * Number of slides associated with a MMS message
+     * @return count of slides
+     */
+    int slideCount();
+
+    /**
+     * The MMS slide content 
+     * @return slide list
+     */
+    UniMessageInfoList slideContent(int slidenum);
+
+    /**
+     * Time stamp of the message
+     * @return time stamp of the created/received message
+     */
+    QDateTime timeStamp();
+
+    /**
+     * @see UniDataModelPluginInterface
+     */
+    void restore(CBaseMtm& mtm);
+
+    /**
+     * @see UniDataModelPluginInterface
+     */
+    QString subject();
+    
+	  /**
+     * @see UniDataModelPluginInterface
+     */
+    CMsvSession* session();
+	
+
+private:
+    UniSMSDataPluginPrivate* d_ptr;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/inc/unismsdataplugin_p.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,116 @@
+/*
+ * 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: Private implementaion of sms data model plugin.
+ *
+ */
+
+#ifndef UNISMSDATAPLUGINPRIVATE_H_
+#define UNISMSDATAPLUGINPRIVATE_H_
+
+
+
+
+
+//Forward Declarations
+class CClientMtmRegistry;
+class ConvergedMessage;
+class UniSMSDataPlugin;
+class CSmsClientMtm;
+class CMsvSession;
+
+/**
+ * Symbian specific implementation of the uni SMS plugin
+ */
+class UniSMSDataPluginPrivate :public MMsvSessionObserver
+{
+
+public:
+    /**
+     * Constructor
+     */
+    UniSMSDataPluginPrivate(UniSMSDataPlugin* plugin);
+
+    /**
+     * Destructor
+     */
+    ~UniSMSDataPluginPrivate();
+
+    /**
+     *  Resets the datamodel
+     */
+    void reset();
+
+    /**
+     * sets the message id for which details needs to be fetched
+     * @param message id
+     */
+    int setMessageId(int mId);
+
+    /**
+     * Get the body of the message
+     * @param aBodyText, for message body
+     */
+    void body(QString& aBodyText);
+
+    int messageSize();
+
+    /**
+     * List of the message TO recipients
+     * @param list of the recipients
+     */
+    void toRecipientList(ConvergedMessageAddressList& mAddressList);
+
+    /**
+     * Address from which the message was received
+     * @param messageAddress
+     */
+    void fromAddress(QString& messageAddress);
+
+    /**
+     * Time stamp of the message
+     * @return time stamp of the created/received message
+     */
+    int timeStamp();
+
+	/**
+	 * Session with the Messaging server
+	 * @return CMsvSession*
+	 */
+    CMsvSession* session();
+    
+private:
+    /**
+     *  Extracts the name and address from the CMsvRecipientList
+     */
+    void extractNameAndAddress(const TDesC& aMsvAddress, TPtrC& aName,
+                               TPtrC& aAddress);
+    void initL();
+    
+    void setMessageIdL(int mId);
+    
+    /**
+     * @see MMsvSessionObserver
+     */
+    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2,
+           TAny* aArg3);
+
+private:
+    CMsvSession* iMSession;
+    CClientMtmRegistry* iMtmReg;
+    CSmsClientMtm* iSmsClient;
+    TMsvId iMessageId;
+    UniSMSDataPlugin* q_ptr;
+    TBool done;   
+};
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/rom/unismsdataplugin.iby	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,27 @@
+/*
+* 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 __UNI_SMS_DATA_PLUGIN_IBY__
+#define __UNI_SMS_DATA_PLUGIN_IBY__
+
+
+# this is the plugin stub for QT plugin
+file=ABI_DIR\UREL\unismsdataplugin.dll               SHARED_LIB_DIR\unismsdataplugin.dll
+data=\epoc32\data\z\resource\qt\plugins\messaging\datamodel\unismsdataplugin.qtplugin     \resource\qt\plugins\messaging\datamodel\unismsdataplugin.qtplugin
+
+
+#endif // __UNI_SMS_DATA_PLUGIN_IBY__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/src/unismsdataplugin.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,253 @@
+/*
+ * 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: 
+ *
+ */
+ 
+//SYSTEM INCLUDES
+#include <mtclreg.h>
+#include <mtclbase.h>
+
+//USER INCLUDES
+#include "unismsdataplugin.h"
+#include "unismsdataplugin_p.h"
+
+//---------------------------------------------------------------
+// UniSMSDataPlugin::UniSMSDataPlugin()
+// @see header
+//---------------------------------------------------------------
+UniSMSDataPlugin::UniSMSDataPlugin(QObject* parent) :
+    QObject(parent)
+    {
+    d_ptr = new UniSMSDataPluginPrivate(this);
+    }
+
+//---------------------------------------------------------------
+// UniSMSDataPlugin::~UniSMSDataPlugin()
+// @see header
+//---------------------------------------------------------------
+UniSMSDataPlugin::~UniSMSDataPlugin()
+{
+    delete d_ptr;
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPlugin::createInstance()
+// @see header
+//---------------------------------------------------------------
+QObject* UniSMSDataPlugin::createInstance()
+{
+return new UniSMSDataPlugin();
+}	
+
+//---------------------------------------------------------------
+// UniSMSDataPlugin::reset()
+// @see header
+//---------------------------------------------------------------
+void UniSMSDataPlugin::reset()
+{
+    d_ptr->reset();
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPlugin::setMessageId()
+// @see header
+//---------------------------------------------------------------
+int UniSMSDataPlugin::setMessageId(int mId)
+{
+    return d_ptr->setMessageId(mId);
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPlugin::body()
+// @see header
+//---------------------------------------------------------------
+void UniSMSDataPlugin::body(QString& aBodyText)
+{
+    d_ptr->body(aBodyText);
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPlugin::messageSize()
+// @see header
+//---------------------------------------------------------------
+qint32 UniSMSDataPlugin::messageSize()
+{
+    return d_ptr->messageSize();
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPlugin::toRecipientList()
+// @see header
+//---------------------------------------------------------------
+void UniSMSDataPlugin::toRecipientList(
+    ConvergedMessageAddressList& mAddressList)
+{
+    d_ptr->toRecipientList(mAddressList);
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPlugin::ccRecipientList()
+// @see header
+//---------------------------------------------------------------
+void UniSMSDataPlugin::ccRecipientList(
+    ConvergedMessageAddressList& /*mAddressList*/)
+{
+
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPlugin::bccRecipientList()
+// @see header
+//---------------------------------------------------------------
+
+void UniSMSDataPlugin::bccRecipientList(
+    ConvergedMessageAddressList& /*mAddressList*/)
+{
+
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPlugin::fromAddress()
+// @see header
+//---------------------------------------------------------------
+void UniSMSDataPlugin::fromAddress(QString& messageAddress)
+{
+    d_ptr->fromAddress(messageAddress);
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPlugin::attachmentList()
+// @see header
+//---------------------------------------------------------------
+UniMessageInfoList UniSMSDataPlugin::attachmentList()
+{
+    return QList<UniMessageInfo*> ();
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPlugin::messageType()
+// @see header
+//---------------------------------------------------------------
+QString UniSMSDataPlugin::messageType()
+{
+    QString str("sms");
+    return str;
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPlugin::messagePriority()
+// @see header
+//---------------------------------------------------------------
+MsgPriority UniSMSDataPlugin::messagePriority()
+{
+    return Normal;
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPlugin::attachmentCount()
+// @see header
+//---------------------------------------------------------------
+int UniSMSDataPlugin::attachmentCount()
+{
+    return KErrNone;
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPlugin::hasAttachment()
+// @see header
+//---------------------------------------------------------------
+bool UniSMSDataPlugin::hasAttachment()
+{
+    return false;
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPlugin::objectCount()
+// @see header
+//---------------------------------------------------------------
+int UniSMSDataPlugin::objectCount()
+{
+    return 0;
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPlugin::objectList()
+// @see header
+//---------------------------------------------------------------
+UniMessageInfoList UniSMSDataPlugin::objectList()
+{
+    return QList<UniMessageInfo*> ();
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPlugin::slideCount()
+// @see header
+//---------------------------------------------------------------
+int UniSMSDataPlugin::slideCount()
+{
+    return 0;
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPlugin::slideContent()
+// @see header
+//---------------------------------------------------------------
+UniMessageInfoList UniSMSDataPlugin::slideContent(int /*slidenum */)
+{
+    return QList<UniMessageInfo*> ();
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPlugin::timeStamp()
+// @see header
+//---------------------------------------------------------------
+QDateTime UniSMSDataPlugin::timeStamp()
+{
+    QDateTime retTimeStamp;
+    int tStamp = d_ptr->timeStamp();
+    retTimeStamp.setTime_t(tStamp);
+    return retTimeStamp;
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPlugin::restore()
+// @see header
+//---------------------------------------------------------------
+void UniSMSDataPlugin::restore(CBaseMtm& /*mtm*/)
+{
+
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPlugin::subject()
+// @see header
+//---------------------------------------------------------------
+QString UniSMSDataPlugin::subject()
+{
+  return QString();   
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPlugin::session()
+// @see header
+//---------------------------------------------------------------
+CMsvSession* UniSMSDataPlugin::session()
+{
+    return d_ptr->session();
+}
+
+
+Q_EXPORT_PLUGIN2(unismsdataplugin, UniSMSDataPlugin)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/src/unismsdataplugin_p.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,311 @@
+/*
+ * 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: 
+ *
+ */
+
+//SYSTEM INCLUDES
+#include <e32cmn.h>
+#include <mtclreg.h>
+#include <mtclbase.h>
+#include <msvids.h>
+#include <txtetext.h>
+#include <txtrich.h>
+#include <txtfmlyr.h>
+
+#include <smsclnt.h>
+#include "debugtraces.h"
+
+#include <QDateTime>
+
+#include <csmsemailfields.h>
+//USER INCLUDES
+#include "s60qconversions.h"
+#include "convergedmessageaddress.h"
+#include "convergedmessage.h"
+
+#include "unismsdataplugin_p.h"
+
+#define KSmsMtmUidValue  0x1000102C
+const TUid KSmsMtmUid =
+{KSmsMtmUidValue};
+_LIT(KUnixEpoch, "19700000:000000.000000");
+
+//---------------------------------------------------------------
+// UniSMSDataPluginPrivate::~UniSMSDataPluginPrivate
+// @see header
+//---------------------------------------------------------------
+UniSMSDataPluginPrivate::~UniSMSDataPluginPrivate()
+{
+    q_ptr = NULL;
+    delete iSmsClient;
+    delete iMtmReg;
+    delete iMSession;
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPluginPrivate::UniSMSDataPluginPrivate
+// @see header
+//---------------------------------------------------------------
+UniSMSDataPluginPrivate::UniSMSDataPluginPrivate(UniSMSDataPlugin* plugin) :
+    iMSession(NULL),
+    iMtmReg(NULL),
+    iSmsClient(NULL),
+    q_ptr(plugin)
+{   
+   
+    iMSession = CMsvSession::OpenSyncL(*this);
+    done = EFalse;
+}
+
+void UniSMSDataPluginPrivate::initL()
+{
+
+    iMtmReg = CClientMtmRegistry::NewL(*iMSession);
+    TMsvSelectionOrdering ordering;
+
+    CMsvEntry* root = CMsvEntry::NewL(*iMSession,
+                                      KMsvRootIndexEntryId,
+                                      ordering);
+    CleanupStack::PushL(root);
+ 
+    TMsvId firstId;
+    TRAPD(err, TSmsUtilities::ServiceIdL(*root,firstId));
+
+    if (err == KErrNotFound)
+    {
+        TMsvEntry entry;
+        entry.iMtm = KUidMsgTypeSMS;
+        entry.iType = KUidMsvServiceEntry;
+        entry.SetReadOnly(EFalse);
+        entry.SetVisible(EFalse);
+        entry.iDate.UniversalTime();
+        entry.iDetails.Set(_L("SMS Service"));
+
+        root->SetEntryL(KMsvRootIndexEntryId);
+        root->CreateL(entry);
+    }
+    
+    CleanupStack::PopAndDestroy(root);
+    iSmsClient = static_cast<CSmsClientMtm*> (iMtmReg->NewMtmL(KSmsMtmUid));
+    done = ETrue;
+    iMessageId = 0;
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPluginPrivate::reset
+// @see header
+//---------------------------------------------------------------
+void UniSMSDataPluginPrivate::reset()
+{
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPluginPrivate::setMessageId
+// @see header
+//---------------------------------------------------------------
+int UniSMSDataPluginPrivate::setMessageId(int mId)
+{
+    TInt error = KErrNone;
+    TRAP(error, setMessageIdL(mId));
+    return error;
+
+}
+
+void UniSMSDataPluginPrivate::setMessageIdL(int mId)
+{
+    if (done == EFalse)
+    {
+        initL();
+    }
+    if (iMessageId != mId)
+    {
+        iMessageId = (TMsvId) mId;
+        iSmsClient->SwitchCurrentEntryL(iMessageId);
+        iSmsClient->LoadMessageL();
+    }
+
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPluginPrivate::body
+// @see header
+//---------------------------------------------------------------
+void UniSMSDataPluginPrivate::body(QString& aBodyText)
+{
+    CRichText& textBody = iSmsClient->Body();
+    TInt len = textBody.DocumentLength();
+    HBufC* buf = HBufC::NewL(len);
+    TPtr bufPtr = buf->Des();
+    textBody.ExtractSelectively(bufPtr, 0, len, CPlainText::EExtractAll);
+    aBodyText = S60QConversions::s60DescToQString(*buf);
+    delete buf;
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPluginPrivate::messageSize
+// @see header
+//---------------------------------------------------------------
+qint32 UniSMSDataPluginPrivate::messageSize()
+{
+    return iSmsClient->Entry().Entry().iSize;
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPluginPrivate::toRecipientList
+// @see header
+//---------------------------------------------------------------
+void UniSMSDataPluginPrivate::toRecipientList(
+                                              ConvergedMessageAddressList& mAddressList)
+{
+    TPtrC name;
+    TPtrC address;
+    // Get the recipient list from the client mtm
+    const CMsvRecipientList& smsRecipients = iSmsClient->AddresseeList();
+
+    for (TInt id = 0; id < smsRecipients.Count(); ++id)
+    {
+        extractNameAndAddress(smsRecipients[id], name, address);
+        // populate address
+        ConvergedMessageAddress
+                * messageAddress =
+                        new ConvergedMessageAddress(S60QConversions::s60DescToQString(address),
+                                                    S60QConversions::s60DescToQString(name));
+        mAddressList.append(messageAddress);
+    }
+
+    const CSmsEmailFields& emailFields = iSmsClient->SmsHeader().EmailFields();
+    // check if it is a EOS
+    if (emailFields.HasAddress())
+    {
+        const MDesCArray& emailRecipients = emailFields.Addresses();
+        for (TInt id = 0; id < emailRecipients.MdcaCount(); ++id)
+        {
+            extractNameAndAddress(emailRecipients.MdcaPoint(id), name, address);
+            ConvergedMessageAddress
+                    * messageAddress =
+                            new ConvergedMessageAddress(S60QConversions::s60DescToQString(address),
+                                                        S60QConversions::s60DescToQString(name));
+            mAddressList.append(messageAddress);
+        }
+    }
+
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPluginPrivate::fromAddress
+// @see header
+//---------------------------------------------------------------
+void UniSMSDataPluginPrivate::fromAddress(QString& messageAddress)
+{
+    CPlainText* pText = CPlainText::NewL();
+    CleanupStack::PushL(pText);
+
+    CSmsHeader* smsHeader = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *pText);
+    CleanupStack::PushL(smsHeader);
+
+    CMsvEntry *cEntry = CMsvEntry::NewL(iSmsClient->Session(),
+                                        iMessageId,
+                                        TMsvSelectionOrdering());
+    CleanupStack::PushL(cEntry);
+
+    CMsvStore* store = cEntry->ReadStoreL();
+    CleanupStack::PushL(store);
+
+    smsHeader->RestoreL(*store);
+
+    messageAddress
+            = S60QConversions::s60DescToQString(smsHeader->FromAddress());
+    CleanupStack::PopAndDestroy(4, pText);
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPluginPrivate::timeStamp
+// @see header
+//---------------------------------------------------------------
+int UniSMSDataPluginPrivate::timeStamp()
+{
+    QDateTime retTimeStamp;
+    TTime timeStamp = iSmsClient->Entry().Entry().iDate;
+    TTime unixEpoch(KUnixEpoch);
+    TTimeIntervalSeconds seconds;
+    timeStamp.SecondsFrom(unixEpoch, seconds);
+    return seconds.Int();
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPluginPrivate::session
+// @see header
+//---------------------------------------------------------------
+CMsvSession* UniSMSDataPluginPrivate::session()
+{
+    return iMSession;
+}
+
+//---------------------------------------------------------------
+// UniSMSDataPluginPrivate::extractNameAndAddress
+// @see header
+//---------------------------------------------------------------
+void UniSMSDataPluginPrivate::extractNameAndAddress(const TDesC& aMsvAddress,
+                                                    TPtrC& aName,
+                                                    TPtrC& aAddress)
+{
+    // For address information separation (start)
+    const TUint KMsgSmsAddressStartChar('<');
+
+    // For address information separation (end)
+    const TUint KMsgSmsAddressEndChar('>');
+
+    TInt addressStart = aMsvAddress.LocateReverse(KMsgSmsAddressStartChar);
+    TInt addressEnd = aMsvAddress.LocateReverse(KMsgSmsAddressEndChar);
+
+    if (addressStart != KErrNotFound && addressEnd != KErrNotFound
+            && addressEnd > addressStart)
+    {
+        // verified address, will be used as selected from contacts manager
+        aName.Set(aMsvAddress.Ptr(), addressStart);
+        aAddress.Set(aMsvAddress.Mid(addressStart + 1).Ptr(), (addressEnd
+                - addressStart) - 1);
+        if (!aAddress.Length())
+        {
+            aAddress.Set(aName);
+            aName.Set(KNullDesC); // empty string
+        }
+    }
+    else
+    {
+        // unverified string, will be used as entered in the header field
+        aName.Set(KNullDesC); // empty string
+        aAddress.Set(aMsvAddress.Ptr(), aMsvAddress.Length()); // a whole string to address
+    }
+
+    if (aName.CompareF(aAddress) == 0)
+    {
+        aName.Set(KNullDesC); // empty string
+    }
+}
+
+
+//---------------------------------------------------------------
+// UniSMSDataPluginPrivate::HandleSessionEventL
+// @see header
+//---------------------------------------------------------------
+void UniSMSDataPluginPrivate::HandleSessionEventL(TMsvSessionEvent /*aEvent*/,
+                                                  TAny* /*aArg1*/,
+                                                  TAny* /*aArg2*/, TAny* /*aArg3*/)
+{
+// do nothing
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/tsrc/bwins/test_unidatamodel_sms_pluginu.def	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,27 @@
+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/testunidatamodelsmsplugin.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,646 @@
+/*
+ * 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 "s60qconversions.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 = S60QConversions::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 = S60QConversions::qStringToS60Desc(recepient);
+    HBufC* addr2 = S60QConversions::qStringToS60Desc(recepient2);
+    HBufC* alias1 = S60QConversions::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 = S60QConversions::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 = S60QConversions::qStringToS60Desc(recepient);
+    HBufC* addr2 = S60QConversions::qStringToS60Desc(recepient2);
+    HBufC* alias1 = S60QConversions::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 = S60QConversions::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 = S60QConversions::qStringToS60Desc(recepient);
+    HBufC* addr2 = S60QConversions::qStringToS60Desc(recepient2);
+    HBufC* alias1 = S60QConversions::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 = S60QConversions::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 = S60QConversions::qStringToS60Desc(recipient);
+    HBufC* addr2 = S60QConversions::qStringToS60Desc(recipient2);
+    HBufC* alias1 = S60QConversions::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 = S60QConversions::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*/)
+{
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/tsrc/testunidatamodelsmsplugin/testunidatamodelsmsplugin.h	Mon May 03 12:29:07 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:
+ */
+
+#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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/tsrc/testunidatamodelsmsplugin/testunidatamodelsmsplugin.ini	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,10 @@
+//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";
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/tsrc/testunidatamodelsmsplugin/testunidatamodelsmsplugin.pro	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,61 @@
+#
+# 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-unidatamodel-sms-plugin
+
+
+INCLUDEPATH += .
+INCLUDEPATH += ../../../../../../inc
+INCLUDEPATH += ../../../../../msgutils/s60qconversions/inc
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+DEFINES += BUILD_TEST_DLL
+
+SOURCES += \
+	testunidatamodelsmsplugin.cpp
+
+				 
+
+# Input
+HEADERS += \
+	testunidatamodelsmsplugin.h
+	
+	   	   			 
+   
+SYMBIAN_PLATFORMS = WINSCW ARMV5
+    symbian {
+    TARGET.CAPABILITY = CAP_GENERAL_DLL
+    TARGET.EPOCSTACKSIZE = 0x8000
+    TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000
+    TARGET.EPOCALLOWDLLDATA = 1
+		}
+		
+ LIBS += -leuser \
+	-lconvergedmessageutils\
+	-ls60qconversions \
+	-lmsgs \
+	-lsmcm \
+	-lgsmu \
+	-letext \
+	-lmsgs \
+	-lunidatamodelloader\
+	-lQtCore
+	
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/unismsdataplugin.pro	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,64 @@
+#
+# 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 = lib
+TARGET = $$qtLibraryTarget(unismsdataplugin)
+
+TARGET.CAPABILITY = All -TCB
+TARGET.EPOCALLOWDLLDATA = 1
+
+#UID 3
+TARGET.UID3 = 0x2001FE60
+
+DEPENDPATH += . inc src
+
+INCLUDEPATH += ./inc
+INCLUDEPATH += ../../../../msgutils/s60qconversions/inc
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+INCLUDEPATH += ../../../../../inc
+
+
+SYMBIAN_PLATFORMS = WINSCW ARMV5
+
+CONFIG += plugin
+
+# Input
+HEADERS += inc/unismsdataplugin.h \
+	inc/unismsdataplugin_p.h
+		   
+SOURCES += src/unismsdataplugin.cpp \
+	src/unismsdataplugin_p.cpp 
+ 
+# Build.inf rules 
+BLD_INF_RULES.prj_exports += \
+  "$${LITERAL_HASH}include <platform_paths.hrh>" \
+   "rom/unismsdataplugin.iby             CORE_APP_LAYER_IBY_EXPORT_PATH(unismsdataplugin.iby)" 
+    
+ LIBS += -leuser \
+	-lconvergedmessageutils\
+	-ls60qconversions \
+	-lmsgs \
+	-lSmcm \
+	-lgsmu \
+	-letext \
+	-lQtCore
+	
+# plugin stub deployment
+plugin.sources = unismsdataplugin.dll
+plugin.path = \resource\qt\plugins\messaging\datamodel
+DEPLOYMENT += plugin
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unidatautils/unidatautils.pro	Mon May 03 12:29:07 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 += ordered
+
+SYMBIAN_PLATFORMS = WINSCW ARMV5
+
+SUBDIRS += unidatamodel/unidatamodel.pro
+SUBDIRS += unidatamodelloader/unidatamodelloader.pro
+SUBDIRS += unidatamodelplugins/unidatamodelplugins.pro
\ No newline at end of file
--- a/messagingapp/msgutils/unieditorplugins/bwins/unieditorpluginloaderu.def	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-EXPORTS
-	?loadPlugins@UniEditorPluginLoader@@QAEXXZ @ 1 NONAME ; void UniEditorPluginLoader::loadPlugins(void)
-	??1UniEditorPluginLoader@@UAE@XZ @ 2 NONAME ; UniEditorPluginLoader::~UniEditorPluginLoader(void)
-	??0UniEditorPluginLoader@@QAE@PAVQObject@@@Z @ 3 NONAME ; UniEditorPluginLoader::UniEditorPluginLoader(class QObject *)
-	?getUniEditorPlugin@UniEditorPluginLoader@@QAEPAVUniEditorPluginInterface@@W4MessageType@ConvergedMessage@@@Z @ 4 NONAME ; class UniEditorPluginInterface * UniEditorPluginLoader::getUniEditorPlugin(enum ConvergedMessage::MessageType)
-	??_EUniEditorPluginLoader@@UAE@I@Z @ 5 NONAME ; UniEditorPluginLoader::~UniEditorPluginLoader(unsigned int)
-
--- a/messagingapp/msgutils/unieditorplugins/eabi/unieditorpluginloaderu.def	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-EXPORTS
-	_ZN21UniEditorPluginLoader11loadPluginsEv @ 1 NONAME
-	_ZN21UniEditorPluginLoader18getUniEditorPluginEN16ConvergedMessage11MessageTypeE @ 2 NONAME
-	_ZN21UniEditorPluginLoaderC1EP7QObject @ 3 NONAME
-	_ZN21UniEditorPluginLoaderC2EP7QObject @ 4 NONAME
-	_ZN21UniEditorPluginLoaderD0Ev @ 5 NONAME
-	_ZN21UniEditorPluginLoaderD1Ev @ 6 NONAME
-	_ZN21UniEditorPluginLoaderD2Ev @ 7 NONAME
-	_ZTI21UniEditorPluginLoader @ 8 NONAME
-	_ZTV21UniEditorPluginLoader @ 9 NONAME
-
--- a/messagingapp/msgutils/unieditorplugins/unieditormmsplugin/inc/sessioneventhandler.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +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 UNIEDITORMMSPLUGIN_SH_H_
-#define UNIEDITORMMSPLUGIN_SH_H_
-
-#include <QObject>
-#include <QThread>
-
-#include <msvapi.h>
-
-
-class SessionEventHandler : public QThread,
-public MMsvSessionObserver
-{
-    Q_OBJECT
-public:
-    SessionEventHandler(QThread* parent=0);
-    ~SessionEventHandler();
-
-public:
-
-    /**
-     * @see MMsvSessionObserver
-     */
-    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2,
-        TAny* aArg3);
-
-private:
-    void run();
-
-};
-
-#endif /* UNIEDITORMMSPLUGIN_SH_H_ */
--- a/messagingapp/msgutils/unieditorplugins/unieditormmsplugin/inc/unieditormmsplugin.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +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 UNIEDITORMMSPLUGIN_H_
-#define UNIEDITORMMSPLUGIN_H_
-
-
-#include <QObject>
-#include "unieditorplugininterface.h"
-
-/**
- * MMS data model plugin.
- * Implements the processing of a MMS message in Message Store.
- */
-
-class CUniEditorMmsPluginPrivate;
-
-class UniEditorMmsPlugin : public QObject, public UniEditorPluginInterface
-{
-    Q_OBJECT
-    Q_INTERFACES(UniEditorPluginInterface)
-
-public:
-    /**
-     * constructor
-     */
-    UniEditorMmsPlugin(QObject* parent = 0);
-
-    /**
-     * Destructor
-     */
-    ~UniEditorMmsPlugin();
-
-    /**
-     * @see UniEditorPluginInterface
-     */
-    ConvergedMessage::MessageType messageType();
-    
-    /**
-     * @see UniEditorPluginInterface
-     */
-    ConvergedMessage* convertFrom( TMsvId aId );
-
-    /**
-     * @see UniEditorPluginInterface
-     */
-    void deleteDraftsEntry( TMsvId aId );
-
-    /**
-     * @see UniEditorPluginInterface
-     */
-    TMsvId convertTo( ConvergedMessage *aMessage );
-    
-    /**
-     * @see UniEditorPluginInterface
-     */    
-    bool send(TMsvId aId);    
-    
-    /**
-     * @see UniEditorPluginInterface
-     */
-    TBool isServiceValid();
-
-    /**
-     * @see UniEditorPluginInterface
-     */
-    TBool validateService( TBool aEmailOverSms = EFalse );
-    
-private:
-	
-    CUniEditorMmsPluginPrivate* d_ptr;
-};
-
-#endif
-    
-
--- a/messagingapp/msgutils/unieditorplugins/unieditormmsplugin/inc/unieditormmsplugin_p.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,162 +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 __UNIEDITORMMSPLUGINPRIVATE_H
-#define __UNIEDITORMMSPLUGINPRIVATE_H
-
-#include <msvapi.h>
-#include <cmsvrecipientlist.h>
-#include "convergedmessage.h"
-#include "convergedmessageid.h"
-
-// DATA TYPES
-
-// FORWARD DECLARATIONS
-
-class CClientMtmRegistry;
-class CMmsClientMtm;
-class CMmsHeaders;
-class CMmsSettings;
-class CCommsDatabase;
-class TUniSendingSettings;
-class UniDataModelLoader;
-class UniDataModelPluginInterface;
-class SessionEventHandler;
-
-// CLASS DECLARATION
-
-class CUniEditorMmsPluginPrivate : public CBase
-{
-public:  // Constructors and destructor
-
-    /**
-     * Two-phased constructor.
-     */
-    static CUniEditorMmsPluginPrivate* NewL();
-
-    /**
-     * Destructor.
-     */
-    virtual ~CUniEditorMmsPluginPrivate();
-
-public: 
-
-    /**
-     * Converts message from message store into ConvergedMessage
-     * @param TMsvId id
-     * @return ConvergedMessage object is returned in successfull cases and 
-     *         NULL is returned in failure cases. The ownership of the object
-     *         is transferred to the caller 
-     */
-    ConvergedMessage* convertFromL( TMsvId aId );
-
-    /**
-     * delete entry from drafts folder
-     * @param aId TMsvId of the message entry to be deleted
-     */
-    void deleteDraftsEntryL( TMsvId aId );
-
-    /**
-     * Converts ConvergedMessage message into a message in store
-     * @param ConvergedMessage obj
-     * @return TMsvId id
-     */             
-    TMsvId convertToL( ConvergedMessage *aMessage );
-    
-    /**
-     * Implementation for convertToL which converts ConvergedMessage message 
-     * into a message in store
-     * @param ConvergedMessage obj
-     * @param TMsvEntry
-     */             
-    void DoConvertToL(ConvergedMessage *aMessage,TMsvEntry& entry);
-
-    /**
-     * Sends the message
-     * @param TMsvId id
-     */                 
-    void sendL( TMsvId aId );
-
-    /**
-     * Validates the service for send
-     * @param aEmailOverSms
-     * @return true if the service is valid for send
-     */                    
-    TBool validateServiceL( TBool aEmailOverSms = EFalse );
-
-    /**
-     * isServiceValidL
-     * @return TBool
-     */              
-    TBool isServiceValidL();
-
-private: // Constructors
-
-    /**
-     * C++ default constructor.
-     */
-    CUniEditorMmsPluginPrivate();
-
-    /**
-     * Returns pointer to iMmsMtm member variable  
-     */
-    CMmsClientMtm* MmsMtmL();
-
-    /**
-     * Generates details for TMsvEntry object
-     */
-    void MakeDetailsL( TDes& aDetails );
-
-    /**
-     * Populates address feilds in message from ConvergedMessage
-     */
-    void addRecipientsL(ConvergedMessage *message);
-
-    /**
-     * Populates address feilds in message from ConvergedMessage
-     */
-    void addRecipientsL(const ConvergedMessageAddressList &array, 
-        TMsvRecipientType recpType);
-
-    /**
-     * Populates converged message from the drafts entry
-     */
-    void convertFromDraftsL(ConvergedMessage& aMessage );
-
-    /**
-     * Populates address feilds in drafts entry to converged message
-     */
-    void populateRecipientsL(
-        ConvergedMessage &aMessage);
-
-private:  // Data
-
-    CMsvSession* iSession;        
-    CClientMtmRegistry* iMtmRegistry;
-    CMmsClientMtm* iMmsMtm;
-    CMmsHeaders* iMmsHeader;
-
-    // owned
-    UniDataModelLoader* iDataModelPluginLoader;        
-    //Not owned
-    UniDataModelPluginInterface* iMmsDataPlugin;
-    SessionEventHandler *iSessionHandler;
-};
-
-#endif   // __UNIEDITORMMSPLUGINPRIVATE_H
-
-// End of File
--- a/messagingapp/msgutils/unieditorplugins/unieditormmsplugin/rom/unieditormmsplugin.iby	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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 __UNI_EDITOR_MMS_PLUGIN_IBY__
-#define __UNI_EDITOR_MMS_PLUGIN_IBY__
-
-
-# this is the plugin stub for QT plugin
-file=ABI_DIR\UREL\unieditormmsplugin.dll               SHARED_LIB_DIR\unieditormmsplugin.dll
-data=\epoc32\data\z\resource\qt\plugins\messaging\editorplugins\unieditormmsplugin.qtplugin              \resource\qt\plugins\messaging\editorplugins\unieditormmsplugin.qtplugin
-
-#endif // __UNI_EDITOR_MMS_PLUGIN_IBY__
-
--- a/messagingapp/msgutils/unieditorplugins/unieditormmsplugin/src/sessioneventhandler.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +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 "sessioneventhandler.h"
-
-SessionEventHandler::SessionEventHandler(QThread* parent):
-QThread(parent)
-{
-}
-
-SessionEventHandler::~SessionEventHandler()
-{
-}
-
-//---------------------------------------------------------------
-// SessionEventHandler::HandleSessionEventL
-// @see header
-//---------------------------------------------------------------
-void SessionEventHandler::HandleSessionEventL(TMsvSessionEvent /*aEvent*/,
-                                                  TAny* /*aArg1*/,
-                                                  TAny* /*aArg2*/, TAny* /*aArg3*/)
-{
-// do nothing
-}
-
-//---------------------------------------------------------------
-// SessionEventHandler::run
-// @see header
-//---------------------------------------------------------------
-void SessionEventHandler::run()
-{
-    exec();
-}
-
-// EOF
--- a/messagingapp/msgutils/unieditorplugins/unieditormmsplugin/src/unieditormmsplugin.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +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:
- *
- */
-
-//USER INCLUDES
-#include "unieditormmsplugin.h"
-#include "unieditormmsplugin_p.h"
-#include "debugtraces.h"
-
-//---------------------------------------------------------------
-// UniEditorMmsPlugin::UniEditorMmsPlugin()
-// @see header
-//---------------------------------------------------------------
-UniEditorMmsPlugin::UniEditorMmsPlugin(QObject* parent) :
-    QObject(parent)
-{	
-    int error;
-    TRAP( error, d_ptr = CUniEditorMmsPluginPrivate::NewL());
-    QDEBUG_WRITE_FORMAT("UniEditorMmsPlugin returning with ",error);
-}
-
-//---------------------------------------------------------------
-// UniEditorMmsPlugin::~UniEditorMmsPlugin()
-// @see header
-//---------------------------------------------------------------
-UniEditorMmsPlugin::~UniEditorMmsPlugin()
-{
-    delete d_ptr;
-}
-
-//---------------------------------------------------------------
-// UniEditorMmsPlugin::messageType()
-// @see header
-//---------------------------------------------------------------
-ConvergedMessage::MessageType UniEditorMmsPlugin::messageType()
-{
-return ConvergedMessage::Mms;
-}		
-
-//---------------------------------------------------------------
-// UniEditorMmsPlugin::convertFrom()
-// @see header
-//---------------------------------------------------------------
-ConvergedMessage* UniEditorMmsPlugin::convertFrom( TMsvId aId )
-{
-    int error;
-    ConvergedMessage* msg = NULL;
-    TRAP( error, msg = d_ptr->convertFromL(aId));
-    QDEBUG_WRITE_FORMAT("Exiting convertFrom with error = ",error);
-    return msg;
-}
-
-//---------------------------------------------------------------
-// UniEditorMmsPlugin::deleteDraftsEntry()
-// @see header
-//---------------------------------------------------------------
-void UniEditorMmsPlugin::deleteDraftsEntry( TMsvId aId )
-{
-    int error;
-    TRAP( error, d_ptr->deleteDraftsEntryL(aId));
-    QDEBUG_WRITE_FORMAT("Exiting deleteDraftsEntry with error = ",error);
-}
-
-//---------------------------------------------------------------
-// UniEditorMmsPlugin::convertTo()
-// @see header
-//---------------------------------------------------------------
-TMsvId UniEditorMmsPlugin::convertTo( ConvergedMessage *aMessage )
-{
-    int error;
-    TMsvId id = -1;
-    TRAP( error, id = d_ptr->convertToL(aMessage));
-    QDEBUG_WRITE_FORMAT("Exiting convertTo and msgId = ",id);
-	return id;	
-}    
-
-//---------------------------------------------------------------
-// UniEditorMmsPlugin::send()
-// @see header
-//---------------------------------------------------------------
-bool UniEditorMmsPlugin::send(TMsvId aId)
-{
-    int error = KErrNone;
-    TRAP( error, d_ptr->sendL(aId));
-    QDEBUG_WRITE_FORMAT("send returning with error= ",error);
-    
-    return (error != KErrNone) ? false : true; 
-}    
-
-//---------------------------------------------------------------
-// UniEditorMmsPlugin::isServiceValid()
-// @see header
-//---------------------------------------------------------------
-TBool UniEditorMmsPlugin::isServiceValid()
-{
-    int error;
-    TBool valid = false;
-    TRAP( error, valid = d_ptr->isServiceValidL());
-    QDEBUG_WRITE_FORMAT("Exiting isServiceValid with validity= ",valid);
-    return valid;
-}    
-
-//---------------------------------------------------------------
-// UniEditorMmsPlugin::validateService()
-// @see header
-//---------------------------------------------------------------
-TBool UniEditorMmsPlugin::validateService( TBool aEmailOverSms)
-{
-    int error;
-    TBool valid = false;
-    TRAP( error, valid = d_ptr->validateServiceL(aEmailOverSms));
-    QDEBUG_WRITE_FORMAT("Exiting validateService with validity= ",valid);
-    return valid;
-}		
-
-Q_EXPORT_PLUGIN2(unieditormmsplugin, UniEditorMmsPlugin)
-
--- a/messagingapp/msgutils/unieditorplugins/unieditormmsplugin/src/unieditormmsplugin_p.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,734 +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 "unieditormmsplugin_p.h"
-
-// INCLUDE FILES
-#include <e32base.h>
-#include <f32file.h>
-#include <msvids.h> 
-#include <mtclreg.h>
-#include <commdb.h> 
-#include <mmsconst.h>
-#include <mmsclient.h>
-#include <mmsheaders.h>
-#include <mmssettings.h>
-#include <mmsmsventry.h>
-#include <bautils.h>
-#include <data_caging_path_literals.hrh> 
-
-#include <MuiuOperationWait.h>
-#include <QDir>
-
-#include "UniSendingSettings.h"
-#include "unidatamodelloader.h"
-#include "unidatamodelplugininterface.h"
-#include "s60qconversions.h"
-#include "debugtraces.h"
-#include "UniEditorGenUtils.h"
-#include "sessioneventhandler.h"
-
-// Possible values for mms validity period in seconds
-const TInt32 KUniMmsValidityPeriod1h = 3600;
-const TInt32 KUniMmsValidityPeriod6h = 21600;
-const TInt32 KUniMmsValidityPeriod24h = 86400;
-const TInt32 KUniMmsValidityPeriod3Days = 259200;
-const TInt32 KUniMmsValidityPeriodWeek = 604800;
-const TInt32 KUniMmsValidityPeriodMax = 0;
-
-const TInt  KMaxDetailsLength = 64; // Copy max this many chars to TMsvEntry::iDetails
-_LIT( KAddressSeparator, ";" );
-
-#define KSenduiMtmMmsUidValue 0x100058E1
-const TUid KSenduiMtmMmsUid = {KSenduiMtmMmsUidValue};
-
-const QString MMSStr("mms");
-
-// -----------------------------------------------------------------------------
-// Two-phased constructor.
-// @see Header
-// -----------------------------------------------------------------------------
-//
-CUniEditorMmsPluginPrivate* CUniEditorMmsPluginPrivate::NewL()
-{
-    CUniEditorMmsPluginPrivate* self = new ( ELeave ) CUniEditorMmsPluginPrivate(); 
-    return self;
-}
-
-// -----------------------------------------------------------------------------
-// Destructor
-// @see Header
-// -----------------------------------------------------------------------------
-//
-CUniEditorMmsPluginPrivate::~CUniEditorMmsPluginPrivate()
-{
-    //In case there is no settings at all leave occurs and resource not freed
-    delete iMmsHeader;
-    delete iMmsMtm;
-    delete iMtmRegistry;
-    delete iDataModelPluginLoader;
-    delete iSessionHandler;
-    delete iSession;
-}
-
-// -----------------------------------------------------------------------------
-// C++ default constructor
-// @see Header
-// -----------------------------------------------------------------------------
-//
-CUniEditorMmsPluginPrivate::CUniEditorMmsPluginPrivate( )
-: iSessionHandler(0)
-{
-    iSessionHandler = new SessionEventHandler();
-    iSessionHandler->start();
-    iSession = CMsvSession::OpenSyncL(*iSessionHandler);
-}
-
-// -----------------------------------------------------------------------------
-// convertFromL
-// @see Header
-// -----------------------------------------------------------------------------
-//
-ConvergedMessage* CUniEditorMmsPluginPrivate::convertFromL( TMsvId aId )
-{
-    QDEBUG_WRITE("Enter convertFromL");
-
-    MmsMtmL()->SwitchCurrentEntryL( aId );
-    MmsMtmL()->LoadMessageL();
-
-    TMsvEntry entry =MmsMtmL()->Entry().Entry();
-
-    ConvergedMessage* msg = new ConvergedMessage;
-    
-    CleanupStack::PushL(msg);
-    if( entry.Parent() == KMsvDraftEntryIdValue )
-    {
-       convertFromDraftsL(*msg);
-    }
-    CleanupStack::Pop(msg);
-    QDEBUG_WRITE("Exit convertFromL");
-    return msg;
-}
-
-// -----------------------------------------------------------------------------
-// convertFromDraftsL
-// @see Header
-// -----------------------------------------------------------------------------
-//
-void CUniEditorMmsPluginPrivate::convertFromDraftsL(
-    ConvergedMessage& aMessage )
-{
-    QDEBUG_WRITE("Enter convertFromDraftsL");
-    
-    TMsvEntry entry =MmsMtmL()->Entry().Entry();
-
-    //Message id 
-    ConvergedMessageId id(entry.Id());
-    aMessage.setMessageId(id);
-
-    // Set Message type
-    aMessage.setMessageType(ConvergedMessage::Mms);
-
-    //Populate recipients
-    populateRecipientsL(aMessage);
-
-    //populate convergedmessage with the subject
-    aMessage.setSubject(S60QConversions::s60DescToQString(
-        MmsMtmL()->SubjectL()));
-
-    // Priority
-    TMsvPriority priority = entry.Priority();
-    if( EMsvHighPriority == priority )
-    {
-        aMessage.setPriority(ConvergedMessage::High);
-    }
-    else if( EMsvLowPriority == priority )
-    {
-        aMessage.setPriority(ConvergedMessage::Low);
-    }
-    else if( EMsvMediumPriority == priority )
-    {
-        aMessage.setPriority(ConvergedMessage::Normal);
-    }
-
-    // Set direction and location
-    aMessage.setDirection(ConvergedMessage::Outgoing);
-    aMessage.setLocation (ConvergedMessage::Draft);
-
-
-    if(!iDataModelPluginLoader)
-    {
-        iDataModelPluginLoader = new UniDataModelLoader;  
-        iDataModelPluginLoader->loadPlugins();  
-        iMmsDataPlugin = iDataModelPluginLoader->getDataModelPlugin(MMSStr);
-    }
-
-    iMmsDataPlugin->restore(*MmsMtmL());
-
-    int slideCount = iMmsDataPlugin->slideCount();
-
-    int attachmentCount = iMmsDataPlugin->attachmentCount();
-
-    ConvergedMessageAttachmentList attachmentList;
-
-    if (slideCount > 0)
-    {
-        UniMessageInfoList slideContentList = 
-            iMmsDataPlugin->slideContent(0);
-        for (int i = 0; i < slideContentList.size(); ++i)
-        {
-            if( slideContentList.at(i)->mimetype().contains("text") )
-            {
-                QString textContent;
-                QFile file(slideContentList.at(i)->path());
-                file.open(QIODevice::ReadOnly);
-                textContent = file.readAll();
-                aMessage.setBodyText(textContent);
-                file.close();
-            }
-            else
-            {
-            ConvergedMessageAttachment* attachment =
-                new ConvergedMessageAttachment(
-                    slideContentList.at(i)->path(),
-                    ConvergedMessageAttachment::EInline);
-            attachmentList << attachment;
-            }
-        }
-        
-        foreach(UniMessageInfo* slide,slideContentList)
-        {
-            delete slide;
-        }
-    }
-
-    
-    if(attachmentCount > 0)
-    {
-        UniMessageInfoList modelAttachmentList = 
-            iMmsDataPlugin->attachmentList();
-
-        for (int i = 0; i < modelAttachmentList.count(); ++i)
-        {
-            ConvergedMessageAttachment* attachment =
-                new ConvergedMessageAttachment(
-                    modelAttachmentList.at(i)->path(),
-                    ConvergedMessageAttachment::EAttachment);
-            attachmentList << attachment;
-        }
-        
-        foreach(UniMessageInfo* attachment,modelAttachmentList)
-        {
-            delete attachment;
-        }
-    }
-
-    if(attachmentList.count() > 0)
-    {
-        aMessage.addAttachments(attachmentList);
-    }       
-
-    //Delete the pluginloader instance
-    delete iDataModelPluginLoader;
-    iDataModelPluginLoader = NULL;
-    iMmsDataPlugin = NULL;
-
-    QDEBUG_WRITE("Exit convertFromDraftsL");
-}
-
-// -----------------------------------------------------------------------------
-// convertToL
-// @see Header
-// -----------------------------------------------------------------------------
-//
-TMsvId CUniEditorMmsPluginPrivate::convertToL(ConvergedMessage *aMessage)
-{
-    QDEBUG_WRITE("Enter ConvertToL");
-
-    if (!iDataModelPluginLoader)
-    {
-        iDataModelPluginLoader = new UniDataModelLoader;
-        iDataModelPluginLoader->loadPlugins();
-        iMmsDataPlugin = iDataModelPluginLoader->getDataModelPlugin(MMSStr);
-    }
-
-    // create message in drafts.
-    CMsvEntry* cEntry = MmsMtmL()->Session().GetEntryL(KMsvDraftEntryId);
-
-    CleanupStack::PushL(cEntry);
-    MmsMtmL()->SwitchCurrentEntryL(cEntry->EntryId());
-
-    TMsvEntry entry;
-    entry.iMtm = MmsMtmL()->Type();
-    entry.iType = KUidMsvMessageEntry;
-    entry.iServiceId = MmsMtmL()->DefaultServiceL();
-    entry.iDate.UniversalTime();
-
-    cEntry->CreateL(entry);
-
-    TMsvId entryId = entry.Id();
-
-    //Since entry is created if any of the below functions leave 
-    //the created entry has to be deleted
-    TInt error = KErrNone;
-    TRAP(error,DoConvertToL(aMessage,entry));
-    
-    CleanupStack::PopAndDestroy(cEntry);
-    
-    //Delete the pluginloader instance
-    delete iDataModelPluginLoader;
-    iDataModelPluginLoader = NULL;
-    iMmsDataPlugin = NULL;
-
-    if (error != KErrNone)
-    {
-        this->deleteDraftsEntryL(entryId);
-        entryId = -1; //Set Invalid entry id
-    }
-    QDEBUG_WRITE_FORMAT("Exit ConvertToL the entryId= ",entryId);
-    return entryId;
-}
-
-// -----------------------------------------------------------------------------
-// DoConvertToL
-// @see Header
-// -----------------------------------------------------------------------------
-//
-void CUniEditorMmsPluginPrivate::DoConvertToL(ConvergedMessage *aMessage,
-    TMsvEntry& entry)
-{
-    TMsvId entryId = entry.Id();
- 
-     // switch to created entry
-     MmsMtmL()->SwitchCurrentEntryL(entryId);
-
-     //Add recipients
-     addRecipientsL(aMessage);
-
-     //There is no size check inside plugin as it assumes 
-     //we get proper data from editor
-     HBufC* sub = S60QConversions::qStringToS60Desc(aMessage->subject());
-     if( sub )
-     {
-         CleanupStack::PushL(sub);
-         MmsMtmL()->SetSubjectL( *sub );
-         CleanupStack::PopAndDestroy(sub);
-     }
-
-     //Add attachments
-     // fetch attachment list and populate the smil model
-     ConvergedMessageAttachmentList attachmentlist = aMessage->attachments();
-     int attachmentcount = attachmentlist.count();
-     if ((attachmentcount> 0) || !(aMessage->bodyText().isEmpty()))
-     {
-         QDEBUG_WRITE("Before calling iMmsDataPlugin->restore");
-         iMmsDataPlugin->restore(*MmsMtmL());
-
-         QDEBUG_WRITE("Before calling iMmsDataPlugin->addSlide");
-
-         bool slideContentAdded = false;
-
-         //Adding first slide
-         iMmsDataPlugin->addSlide(0);
-
-         for(int i=0; i < attachmentcount; i++)
-         {
-             //only file path is needed to be passed 
-             UniMessageInfo *info = new UniMessageInfo(
-                 QDir::toNativeSeparators(attachmentlist[i]->filePath()),
-                                          0,
-                                          QString());
-
-             if(attachmentlist[i]->attachmentType() ==
-                 ConvergedMessageAttachment::EInline )
-             {
-                 slideContentAdded = true;
-                 iMmsDataPlugin->addObject(0,info);
-             }
-             else if(attachmentlist[i]->attachmentType() ==
-                 ConvergedMessageAttachment::EAttachment)
-             {
-                 //Add attachment
-                 iMmsDataPlugin->addAttachment(info);
-             }
-             delete info;
-         }
-
-         if(!(aMessage->bodyText().isEmpty()))
-         {
-             slideContentAdded = true;
-             iMmsDataPlugin->addTextObject(0,aMessage->bodyText());
-         }
-
-         if( slideContentAdded )
-         {
-             iMmsDataPlugin->saveObjects();
-
-             // Open store even if we didn't need it here.
-             // -> We don't need to check later whether the store 
-             //is open or not.    
-             CMsvStore* editStore = MmsMtmL()->Entry().EditStoreL();
-             
-             //Ensure that the store is deleted if anything 
-             //leaves before deletion otherwise the entry store will be locked
-             //and entry cant be deleted
-             CleanupStack::PushL(editStore);
-              
-             //Compose the smil if slide is added
-             iMmsDataPlugin->composeSmil(*editStore);
-
-             //Commit the store before setting the root
-             editStore->CommitL();
-
-             //delete the store before setMessageRoot is called
-             CleanupStack::PopAndDestroy(editStore);
-
-             //Set message root after composing SMIL but before 
-             //calling SaveMessageL and after the store has been deleted
-             MmsMtmL()->SetMessageRootL( 
-                 iMmsDataPlugin->getSmilAttachmentByIndex( ));
-         }
-         else
-         {
-             //Remove the slide   
-             iMmsDataPlugin->removeSlide(0);
-
-             // Open store even if we didn't need it here.
-             // -> We don't need to check later whether the store is open or not.    
-             CMsvStore* editStore = MmsMtmL()->Entry().EditStoreL();
-             
-             //Ensure that the store is deleted if anything 
-             //leaves before deletion otherwise the entry store will be locked
-             //and entry cant be deleted
-             CleanupStack::PushL(editStore);
-             
-             //Commit the store before setting the root
-             editStore->CommitL();
-
-             //delete the store before setMessageRoot is called
-             CleanupStack::PopAndDestroy(editStore);
-         }
-     }
-
-     //Set the priority before calling save
-     ConvergedMessage::Priority priority = aMessage->priority();
-     if (ConvergedMessage::High == priority)
-     {
-         MmsMtmL()->SetMessagePriority(EMmsPriorityHigh);
-     }
-     else if (ConvergedMessage::Low == priority)
-     {
-         MmsMtmL()->SetMessagePriority(EMmsPriorityLow);
-     }
-     else if (ConvergedMessage::Normal == priority)
-     {
-         MmsMtmL()->SetMessagePriority(EMmsPriorityNormal);
-     }
-
-     //Saving the changes
-     MmsMtmL()->SaveMessageL();
-
-     entry = MmsMtmL()->Entry().Entry();
-
-     TBuf<KMaxDetailsLength> detailsBuf;
-     MakeDetailsL( detailsBuf );
-     entry.iDetails.Set( detailsBuf );
-
-     MmsMtmL()->Entry().ChangeL(entry); // commit changes      
-
-}
-
-// -----------------------------------------------------------------------------
-// sendL
-// @see Header
-// -----------------------------------------------------------------------------
-//
-void CUniEditorMmsPluginPrivate::sendL( TMsvId aId )
-{
-    QDEBUG_WRITE("Enter sendL");
-
-    MmsMtmL()->SwitchCurrentEntryL( aId );
-    MmsMtmL()->LoadMessageL();
-    CMuiuOperationWait* wait = CMuiuOperationWait::NewLC();
-    CMsvOperation* oper = MmsMtmL()->SendL( wait->iStatus );
-    CleanupStack::PushL( oper );
-    wait->Start();
-    CleanupStack::PopAndDestroy( oper );
-    CleanupStack::PopAndDestroy( wait );
-
-    QDEBUG_WRITE("Exit sendL");
-}
-
-// -----------------------------------------------------------------------------
-// validateServiceL
-// @see Header
-// -----------------------------------------------------------------------------
-//
-TBool CUniEditorMmsPluginPrivate::validateServiceL( TBool /*aEmailOverSms*/ )
-{
-    QDEBUG_WRITE("Enter ValidateServiceL");
-
-    //Check if the mms client mtm object is already created or not
-    if( iMmsMtm )
-    {
-        // If mms client mtm object is already created restore the settings
-        iMmsMtm->RestoreSettingsL();
-    }
-
-    TMsvId service = MmsMtmL()->DefaultServiceL();
-    TBool valid( MmsMtmL()->ValidateService( service ) == KErrNone );
-
-    QDEBUG_WRITE_FORMAT("Exit ValidateServiceL the return val= ",valid);
-    return valid;
-}
-
-// -----------------------------------------------------------------------------
-// isServiceValidL
-// @see Header
-// -----------------------------------------------------------------------------
-//
-TBool CUniEditorMmsPluginPrivate::isServiceValidL()
-{
-    return MmsMtmL()->ValidateService( MmsMtmL()->DefaultServiceL() ) == KErrNone;
-}
-
-// -----------------------------------------------------------------------------
-// MmsMtmL
-// @see Header
-// -----------------------------------------------------------------------------
-//
-CMmsClientMtm* CUniEditorMmsPluginPrivate::MmsMtmL()
-{
-    if ( !iMmsMtm )
-    {
-        if ( !iMtmRegistry )
-        {            
-            iMtmRegistry = CClientMtmRegistry::NewL( *iSession );
-        }
-        iMmsMtm = static_cast<CMmsClientMtm*>( iMtmRegistry->NewMtmL( 
-            KSenduiMtmMmsUid ) );
-    }
-    return iMmsMtm;
-}
-
-// ---------------------------------------------------------
-// MakeDetailsL
-// @see Header
-// ---------------------------------------------------------
-//
-void CUniEditorMmsPluginPrivate::MakeDetailsL( TDes& aDetails )
-{
-    // This very same code can be found in CUniAddressHandler. 
-    // They should be put in common location some day...
-    const CMsvRecipientList& addresses = MmsMtmL()->AddresseeList();
-    TInt addrCnt = addresses.Count();
-
-    TPtrC stringToAdd;
-    for ( TInt i = 0; i < addrCnt; i++)
-    {
-        // Only address is converted to western. 
-        // There may numbers in contact name - they must not be converted 
-        TPtrC alias = TMmsGenUtils::Alias( addresses[i] );
-        HBufC* addressBuf = NULL;
-
-        if ( alias.Length() != 0 )
-        {
-            stringToAdd.Set( alias );
-        }
-        else
-        {
-            TPtrC address = TMmsGenUtils::PureAddress( addresses[i] );
-            addressBuf = HBufC::NewLC( address.Length() );
-            TPtr addressPtr = addressBuf->Des();
-            addressPtr.Copy( address );
-            stringToAdd.Set( addressPtr );
-
-            // 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;
-        }
-
-        if ( ( aDetails.Length() != 0 ) &&   // Not a first address
-                ( aDetails.Length() + KAddressSeparator().Length() < KMaxDetailsLength ) )
-        {
-            // Add separator
-            aDetails.Append( KAddressSeparator() );
-        }
-
-        if ( aDetails.Length() + stringToAdd.Length() < KMaxDetailsLength ) 
-        {
-            // whole string fits. Add it.
-            aDetails.Append( stringToAdd );
-            if ( addressBuf )
-            {
-                CleanupStack::PopAndDestroy( addressBuf );
-            }
-        }
-        else
-        {
-            // Only part of the string fits
-            TInt charsToAdd = KMaxDetailsLength - aDetails.Length();
-
-            if ( charsToAdd <= 0 )
-            {
-                // Cannot add any more chars 
-                break;
-            }
-
-            if ( charsToAdd >= stringToAdd.Length() )
-            {
-                // Guarantee that charsToAdd is not larger that stringToAdd lenght 
-                charsToAdd = stringToAdd.Length();
-            }
-
-            aDetails.Append( stringToAdd.Left( charsToAdd ) );
-            if ( addressBuf )
-            {
-                CleanupStack::PopAndDestroy( addressBuf );
-            }
-            break;
-        }
-    }
-}
-
-//---------------------------------------------------------------
-// CUniEditorMmsPluginPrivate::addRecipientsL
-// @see header
-//---------------------------------------------------------------
-void CUniEditorMmsPluginPrivate::addRecipientsL(ConvergedMessage *message)
-{
-    //add To feilds
-    ConvergedMessageAddressList toAddressArray = message->toAddressList();
-    addRecipientsL(toAddressArray, EMsvRecipientTo);
-
-    //add cc feilds
-    ConvergedMessageAddressList ccAddressArray = message->ccAddressList();
-    addRecipientsL(ccAddressArray, EMsvRecipientCc);
-
-    //add bcc feilds
-    ConvergedMessageAddressList bccAddressArray = message->bccAddressList();
-    addRecipientsL(bccAddressArray, EMsvRecipientBcc);
-}
-
-//---------------------------------------------------------------
-// CUniEditorMmsPluginPrivate::addRecipientsL
-// @see header
-//---------------------------------------------------------------
-void CUniEditorMmsPluginPrivate::addRecipientsL(
-    const ConvergedMessageAddressList &array,
-    TMsvRecipientType recpType)
-{    
-
-    for (int i = 0; i < array.count(); ++i)
-    {
-        if(array[i]->address().isEmpty())
-        {
-            continue;
-        }
-        // convert from QString to HBufC
-        HBufC* addr = S60QConversions::qStringToS60Desc(array[i]->address());
-
-        CleanupStack::PushL(addr);
-
-        if(TMmsGenUtils::Alias(*addr).Length() > 0)
-        {    
-            MmsMtmL()->AddAddresseeL(recpType, TMmsGenUtils::PureAddress(*addr),
-                TMmsGenUtils::Alias(*addr));
-        }
-        else
-        {
-            HBufC* displayName = S60QConversions::qStringToS60Desc(array[i]->alias());
-            if(displayName)
-            {
-                CleanupStack::PushL(displayName);
-
-                MmsMtmL()->AddAddresseeL(recpType, TMmsGenUtils::PureAddress(*addr),
-                    *displayName);
-
-                CleanupStack::PopAndDestroy(displayName);
-            }
-            else
-            {
-                MmsMtmL()->AddAddresseeL(recpType, TMmsGenUtils::PureAddress(*addr));    
-            }
-        }
-        CleanupStack::PopAndDestroy(addr);
-    }
-}
-
-// ----------------------------------------------------------------------------
-// CUniEditorMmsPluginPrivate::populateRecipientsL
-// @see header
-// ----------------------------------------------------------------------------
-//
-void CUniEditorMmsPluginPrivate::populateRecipientsL(
-    ConvergedMessage &aMessage)
-    {
-    QDEBUG_WRITE("Enter populateRecipientsL");
-
-
-    // get recipient list
-    const CMsvRecipientList& addresses = MmsMtmL()->AddresseeList();
-    TInt count = addresses.Count();
-
-    // extract each address and populate into ConvergedMessageAddress
-    for (TInt i = 0; i < count; ++i)
-        {
-        //Address
-        QString address = S60QConversions::s60DescToQString(
-            TMmsGenUtils::PureAddress(addresses[i]));
-        //Alias
-        QString alias = S60QConversions::s60DescToQString(
-            TMmsGenUtils::Alias(addresses[i]));
-
-        //add recipient to convergedMessage
-        ConvergedMessageAddress messageAddress(address, alias);
-        if (addresses.Type(i) == EMsvRecipientTo)
-            {
-            aMessage.addToRecipient(messageAddress);
-            }
-        else if (addresses.Type(i) == EMsvRecipientCc)
-            {
-            aMessage.addCcRecipient(messageAddress);
-            }
-        else if (addresses.Type(i) == EMsvRecipientBcc)
-            {
-            aMessage.addBccRecipient(messageAddress);
-            }
-        }
-
-    QDEBUG_WRITE("Exit populateRecipientsL");
-
-    }
-
-// ----------------------------------------------------------------------------
-// CUniEditorMmsPluginPrivate::deleteDraftsEntryL
-// @see header
-// ----------------------------------------------------------------------------
-//
-void CUniEditorMmsPluginPrivate::deleteDraftsEntryL( TMsvId aId )
-{
-    CMsvEntry* pEntry = iSession->GetEntryL(KMsvDraftEntryIdValue);
-    CleanupStack::PushL(pEntry);
-    pEntry->DeleteL( aId );
-    CleanupStack::PopAndDestroy(pEntry);
-}
-
-//  End of File
--- a/messagingapp/msgutils/unieditorplugins/unieditormmsplugin/tsrc/bwins/test_mms_pluginu.def	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-EXPORTS
-	qt_plugin_instance @ 1 NONAME
-	qt_plugin_query_verification_data @ 2 NONAME
-	?createMMSMessageWithAttachmentAndSend@TestMmsPlugin@@AAEXH@Z @ 3 NONAME ; void TestMmsPlugin::createMMSMessageWithAttachmentAndSend(int)
-	?validateMsg@TestMmsPlugin@@AAEXABVConvergedMessage@@ABVQString@@@Z @ 4 NONAME ; void TestMmsPlugin::validateMsg(class ConvergedMessage const &, class QString const &)
-	?tr@TestMmsPlugin@@SA?AVQString@@PBD0@Z @ 5 NONAME ; class QString TestMmsPlugin::tr(char const *, char const *)
-	?getStaticMetaObject@TestMmsPlugin@@SAABUQMetaObject@@XZ @ 6 NONAME ; struct QMetaObject const & TestMmsPlugin::getStaticMetaObject(void)
-	?cleanupTestCase@TestMmsPlugin@@AAEXXZ @ 7 NONAME ; void TestMmsPlugin::cleanupTestCase(void)
-	?testReceived@TestMmsPlugin@@AAEXH@Z @ 8 NONAME ; void TestMmsPlugin::testReceived(int)
-	?qt_metacast@TestMmsPlugin@@UAEPAXPBD@Z @ 9 NONAME ; void * TestMmsPlugin::qt_metacast(char const *)
-	?qt_metacall@TestMmsPlugin@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 10 NONAME ; int TestMmsPlugin::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?trUtf8@TestMmsPlugin@@SA?AVQString@@PBD0H@Z @ 11 NONAME ; class QString TestMmsPlugin::trUtf8(char const *, char const *, int)
-	?staticMetaObject@TestMmsPlugin@@2UQMetaObject@@B @ 12 NONAME ; struct QMetaObject const TestMmsPlugin::staticMetaObject
-	?init@TestMmsPlugin@@AAEXXZ @ 13 NONAME ; void TestMmsPlugin::init(void)
-	?testSendMMS@TestMmsPlugin@@AAEXXZ @ 14 NONAME ; void TestMmsPlugin::testSendMMS(void)
-	?trUtf8@TestMmsPlugin@@SA?AVQString@@PBD0@Z @ 15 NONAME ; class QString TestMmsPlugin::trUtf8(char const *, char const *)
-	?tr@TestMmsPlugin@@SA?AVQString@@PBD0H@Z @ 16 NONAME ; class QString TestMmsPlugin::tr(char const *, char const *, int)
-	?createMMSMessageWithSmilTextAndImageAttachmentAndSend@TestMmsPlugin@@AAEXXZ @ 17 NONAME ; void TestMmsPlugin::createMMSMessageWithSmilTextAndImageAttachmentAndSend(void)
-	?cleanup@TestMmsPlugin@@AAEXXZ @ 18 NONAME ; void TestMmsPlugin::cleanup(void)
-	?initTestCase@TestMmsPlugin@@AAEXXZ @ 19 NONAME ; void TestMmsPlugin::initTestCase(void)
-	?testMmsReceived@TestMmsPlugin@@AAEXXZ @ 20 NONAME ; void TestMmsPlugin::testMmsReceived(void)
-	?metaObject@TestMmsPlugin@@UBEPBUQMetaObject@@XZ @ 21 NONAME ; struct QMetaObject const * TestMmsPlugin::metaObject(void) const
-
Binary file messagingapp/msgutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/mms.rsc has changed
Binary file messagingapp/msgutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/not.rsc has changed
--- a/messagingapp/msgutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/testmmsplugin.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,322 +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 "testmmsplugin.h"
-#include <QtTest/QtTest>
-#include "debugtraces.h"
-
-#include <QTimer>
-#include <QSignalSpy>
-
-#include "convergedmessage.h"
-#include "TestMsg.h"
-#include "convergedmessageid.h"
-#include "unieditormmsplugin.h"
-#include "messageserviceaction.h"
-//---------------------------------------------------------------
-// TestMmsPlugin::initTestCase
-//---------------------------------------------------------------
-void TestMmsPlugin::initTestCase()
-{
-    msgPlugin = new UniEditorMmsPlugin();
-    QVERIFY(msgPlugin != 0);
-    smsId = -1;
-    mmsId = -1;
-}
-
-//---------------------------------------------------------------
-// TestMmsPlugin::cleanupTestCase
-//---------------------------------------------------------------
-void TestMmsPlugin::cleanupTestCase()
-{
-    delete msgPlugin;
-}
-
-//---------------------------------------------------------------
-// TestMmsPlugin::init
-//---------------------------------------------------------------
-
-void TestMmsPlugin::init()
-{
-}
-
-//---------------------------------------------------------------
-// TestMmsPlugin::cleanup
-//---------------------------------------------------------------
-void TestMmsPlugin::cleanup()
-{
-}
-
-//---------------------------------------------------------------
-// TestMmsPlugin::testSendMMS
-//---------------------------------------------------------------
-
-void TestMmsPlugin::testSendMMS()
-{
-
-    //register user defined object to meta system.
-    qRegisterMetaType<ConvergedMessage*> ("ConvergedMessage*");
-    
-
-    createMMSMessageWithAttachmentAndSend();
-     //wait for the response to complete 
-     //as sending a message goes through different stages
-     
-    //Create a smil attachment with image and text
-    createMMSMessageWithSmilTextAndImageAttachmentAndSend();
-   
-    //Create MMS with Normal priority
-    createMMSMessageWithAttachmentAndSend(ETrue);
-}
-
-
-void TestMmsPlugin::createMMSMessageWithSmilTextAndImageAttachmentAndSend()
-    {
-    QString service = TEST_SERVICE_NAME_MMS;
-    QString bodyText = TEST_MSG_BODY;
-    QString subject  = TEST_MSG_SUBJECT;
-    qint64 timeStamp = QDateTime::currentDateTime().toTime_t();
-    
-    QString sender(TEST_SENDER);
-    ConvergedMessageAddress address(sender);
-    ConvergedMessageAttachmentList attachmentList;
-  
-    ConvergedMessageAttachment* attachmentImage = 
-        new ConvergedMessageAttachment(TEST_ATTACHMENT4, ConvergedMessageAttachment::EAttachment);
-    attachmentList.append(attachmentImage);
-    
-    ConvergedMessageAttachment* attachmenttext = 
-            new ConvergedMessageAttachment(TEST_ATTACHMENT5, ConvergedMessageAttachment::EAttachment);
-    attachmentList.append(attachmenttext);
-    
-    ConvergedMessageAttachment* attachmentSmil = 
-                new ConvergedMessageAttachment(TEST_ATTACHMENT3, ConvergedMessageAttachment::ESmil);
-    attachmentList.append(attachmentSmil);
-     
-    
-    
-    ConvergedMessage msg;
-    msg.setMessageType(ConvergedMessage::Mms);
-    msg.setSubject(subject);
-    msg.setTimeStamp(timeStamp);
-    msg.addToRecipient(address);
-    msg.addAttachments(attachmentList);
-    msg.setPriority(ConvergedMessage::Low);
-    
-    long int id = msgPlugin->convertTo(&msg);
-    msgPlugin->send(id);
-
-    }
-
-
-//---------------------------------------------------------------
-// TestMmsPlugin::testMmsReceived
-//---------------------------------------------------------------
-void TestMmsPlugin::testMmsReceived()
-{
-    testReceived(msgPlugin->messageType());  
-    QTest::qWait(5000);
-}
-
-/*
- * Creates a Smil file with only a text document as attachment
- */
- 
-void TestMmsPlugin::createMMSMessageWithAttachmentAndSend(TBool priority)
-    {
-    QString service = TEST_SERVICE_NAME_MMS;
-    QString bodyText = TEST_MSG_BODY;
-    QString subject  = TEST_MSG_SUBJECT;
-    qint64 timeStamp = QDateTime::currentDateTime().toTime_t();
-    
-    QString sender(TEST_SENDER);
-    ConvergedMessageAddress address(sender);
-    ConvergedMessageAttachmentList attachmentList;    
-
-   
-    ConvergedMessageAttachment* attachment2 = 
-            new ConvergedMessageAttachment(TEST_ATTACHMENT2, ConvergedMessageAttachment::ESmil);
-    
-    ConvergedMessageAttachment* attachment = 
-        new ConvergedMessageAttachment(TEST_ATTACHMENT, 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);
-    if(priority == EFalse)
-        {
-        msg.setPriority(ConvergedMessage::Normal);
-        }
-    else
-        {
-        msg.setPriority(ConvergedMessage::High);
-        }
-    
-    //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);
-    
-    long int id = msgPlugin->convertTo(&msg);
-    msgPlugin->send(id);
-    }
-    	
-//---------------------------------------------------------------
-// TestMmsPlugin::testReceived
-//---------------------------------------------------------------
-void TestMmsPlugin::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;
-}
-
-//---------------------------------------------------------------
-// TestMmsPlugin::validateMsg
-//---------------------------------------------------------------
-void TestMmsPlugin::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_SENDER));
-        }
-
-   //     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/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/testmmsplugin.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +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_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 TEST_EXPORT TestMmsPlugin: 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 testSendMMS(); //test sending mms
-    void testMmsReceived(); // test receiving mms    
-
-private:
-    void testReceived(int type);
-    void validateMsg(const ConvergedMessage& message, const QString& serviceId);
-    void createMMSMessageWithAttachmentAndSend(TBool priority = EFalse);
-    void createMMSMessageWithSmilTextAndImageAttachmentAndSend();
-private:
-    UniEditorMmsPlugin* msgPlugin;
-    int smsId;
-    int mmsId;
-    };
-#endif //TEST_MMS_PLUGIN_H
--- a/messagingapp/msgutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/testmmsplugin.ini	Fri Apr 16 14:56:15 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/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/testmmsplugin.pro	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:
-#
-
-QT += testlib
-QT -= gui
-
-TEMPLATE = lib
-TARGET = test-mms-plugin
-
-
-INCLUDEPATH += .
-INCLUDEPATH += ../../../../../../inc
-INCLUDEPATH += ../../../../unieditorutils/inc
-INCLUDEPATH += ../../../../s60qconversions/inc
-INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-
-DEFINES += BUILD_TEST_DLL
-
-SOURCES += \
-  testmmsplugin.cpp \
-  ../../src/unieditormmsplugin.cpp \
-  ../../src/unieditormmsplugin_p.cpp  
-         
-
-# Input
-HEADERS += \
-  testmmsplugin.h \
-  testmsg.h \
-  ../../inc/unieditormmsplugin.h \
-  ../../inc/unieditormmsplugin_p.h 
-               
-   
-SYMBIAN_PLATFORMS = WINSCW ARMV5
-    symbian {
-    TARGET.CAPABILITY = CAP_GENERAL_DLL
-    TARGET.EPOCSTACKSIZE = 0x8000
-    TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000
-    TARGET.EPOCALLOWDLLDATA = 1
-	}
-    
- LIBS += -leuser \
-    -lconvergedmessageutils \
-    -ls60qconversions \
-    -lMsgMedia \
-    -lunieditorutils \
-    -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 \
-  	-lunidatamodelloader
-  	
--- a/messagingapp/msgutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/testmsg.h	Fri Apr 16 14:56:15 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 <s60qconversions.h>
-#include "testmmsplugin.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 = S60QConversions::qStringToS60Desc(serviceCenter01);
-    HBufC* sC02 = S60QConversions::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 = S60QConversions::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 = S60QConversions::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 = S60QConversions::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 = S60QConversions::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 = S60QConversions::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/unieditorplugins/unieditormmsplugin/unieditormmsplugin.pro	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +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:
-#
-
-TEMPLATE = lib
-TARGET = $$qtLibraryTarget(unieditormmsplugin)
-
-TARGET.CAPABILITY = All -TCB
-TARGET.EPOCALLOWDLLDATA = 1
-
-#UID 3
-TARGET.UID3 = 0x102072DB #old editor mms plugin uid
-
-
-
-INCLUDEPATH += ../../s60qconversions/inc
-INCLUDEPATH += ../../unieditorutils/inc
-INCLUDEPATH += ../../../../inc
-INCLUDEPATH += ../../../../mmsengine/mmsmessage/inc 
-INCLUDEPATH += ../../../../mmsengine/inc
-INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-
-SYMBIAN_PLATFORMS = WINSCW ARMV5
-
-CONFIG += plugin
-
-# Input
-HEADERS += \
-        inc/sessioneventhandler.h \
-	inc/unieditormmsplugin.h \
-	inc/unieditormmsplugin_p.h 
-		   	  		   
-SOURCES += \
-        src/sessioneventhandler.cpp \
-	src/unieditormmsplugin.cpp \
-	src/unieditormmsplugin_p.cpp 
-    
- LIBS += -leuser \
--lcone \
--lmsgs \ 
--lmmsmessage \ 
--lmmsserversettings \
--lmmsgenutils \
--lcommdb \
--lefsrv \
--lbafl \
--lunieditorutils \
--lunidatamodelloader \
--lconvergedmessageutils \
--ls60qconversions
-	
-# Build.inf rules
-BLD_INF_RULES.prj_exports += \
-     "$${LITERAL_HASH}include <platform_paths.hrh>" \
-    "rom/unieditormmsplugin.iby  CORE_APP_LAYER_IBY_EXPORT_PATH(unieditormmsplugin.iby)"
-	
-# plugin stub deployment
-plugin.sources = unieditormmsplugin.dll
-plugin.path = \resource\qt\plugins\messaging\editorplugins
-DEPLOYMENT += plugin
-
-
--- a/messagingapp/msgutils/unieditorplugins/unieditorpluginloader/rom/unieditorpluginloader.iby	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +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 __UNIEDITOR_PLUGIN_LOADER_IBY__
-#define __UNIEDITOR_PLUGIN_LOADER_IBY__
-
-REM DLL
-file=ABI_DIR\UREL\unieditorpluginloader.dll                   SHARED_LIB_DIR\unieditorpluginloader.dll
-
-#endif // __UNIEDITOR_PLUGIN_LOADER_IBY__
--- a/messagingapp/msgutils/unieditorplugins/unieditorpluginloader/src/unieditorpluginloader.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +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:
- *
- */
-
-// System Includes
-
-#include <QDir>
-#include "debugtraces.h"
-
-#include <QLibraryInfo>
-#include <QPluginLoader>
-#include "unieditorpluginloader.h"
-#include "unieditorplugininterface.h"
-
-//---------------------------------------------------------------
-//UniEditorPluginLoader::UniEditorPluginLoader()
-//@see header
-//---------------------------------------------------------------
-UniEditorPluginLoader::UniEditorPluginLoader(QObject* parent) :
-QObject(parent)
-{
-}
-
-//---------------------------------------------------------------
-//UniEditorPluginLoader::~UniEditorPluginLoader()
-//@see header
-//---------------------------------------------------------------
-UniEditorPluginLoader::~UniEditorPluginLoader()
-{
-    // unload all qt-plugins
-    int count = mPluginLoaderList.count();
-    for(int i=0; i<count; i++)
-    {
-        mPluginLoaderList.at(i)->unload();
-    }
-    mEditorPluginMap.clear();
-}
-
-//---------------------------------------------------------------
-//UniEditorPluginLoader::loadPlugins()
-//@see header
-//---------------------------------------------------------------
-void UniEditorPluginLoader::loadPlugins()
-{
-    // plugins directory setting for EMULATOR
-#ifdef _DEBUG
-    QDir dir(QLibraryInfo::location(QLibraryInfo::PluginsPath));
-    dir.cd("messaging\\editorplugins");
-#else
-    // plugins directory setting for HARDWARE IMAGE
-    QDir dir("Z:\\resource\\qt\\plugins\\messaging\\editorplugins");
-#endif
-
-    QString pluginPath = dir.absolutePath();
-#ifdef _DEBUG_TRACES_
-    qDebug() << "Enter LoadPlugin path = " << pluginPath;
-#endif
-
-    // load the plugins
-    QFileInfoList entries = dir.entryInfoList(QDir::Files | QDir::Readable);
-    foreach (QFileInfo entry, entries)
-        {
-            QPluginLoader* loader = new QPluginLoader(entry.absoluteFilePath(), this);
-            UniEditorPluginInterface* editorPlugin =
-                 qobject_cast<UniEditorPluginInterface*> (loader->instance());
-            if (editorPlugin)
-            {
-                int msgtype = editorPlugin->messageType();
-                mEditorPluginMap.insert(msgtype, editorPlugin);
-                mPluginLoaderList << loader;
-            }
-        }
-}
-
-//---------------------------------------------------------------
-//UniEditorPluginLoader::getUniEditorPlugin()
-//@see header
-//---------------------------------------------------------------
-UniEditorPluginInterface* UniEditorPluginLoader::getUniEditorPlugin(
-	                          ConvergedMessage::MessageType messageType)
-{
-    if (mEditorPluginMap.contains(messageType))
-    {
-        return mEditorPluginMap[messageType];
-    }
-    return NULL;
-}
--- a/messagingapp/msgutils/unieditorplugins/unieditorpluginloader/unieditorpluginloader.pro	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +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:
-#
-#
-
-TARGET = unieditorpluginloader
-
-TEMPLATE = lib
-
-CONFIG += dll
-DEFINES += UNIEDITORPLUGINLOADER_DLL
-DEFINES += BUILD_DLL_EDITOR_PLUGIN
-
-
-DEPENDPATH += . \
-    inc \
-    src
-
-QT -= gui
-
-INCLUDEPATH += .
-INCLUDEPATH += inc
-INCLUDEPATH += ../../../../inc
-INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-
-# Capability
-TARGET.UID3 = 0x2001FE71
-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/unieditorpluginloader.iby  CORE_APP_LAYER_IBY_EXPORT_PATH(unieditorpluginloader.iby)"
-
-SOURCES += src/unieditorpluginloader.cpp
-
--- a/messagingapp/msgutils/unieditorplugins/unieditorplugins.pro	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:
-#
-#
-
-TEMPLATE = subdirs
-
-SYMBIAN_PLATFORMS = WINSCW ARMV5
-
-SUBDIRS += unieditorsmsplugin/unieditorsmsplugin.pro
-SUBDIRS += unieditormmsplugin/unieditormmsplugin.pro
-SUBDIRS += unieditorpluginloader/unieditorpluginloader.pro
-
-CONFIG += ordered
\ No newline at end of file
--- a/messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/inc/sessioneventhandler.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +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 UNIEDITORSMSPLUGIN_SH_H_
-#define UNIEDITORSMSPLUGIN_SH_H_
-
-#include <QObject>
-#include <QThread>
-
-#include <msvapi.h>
-
-
-class SessionEventHandler : public QThread,
-public MMsvSessionObserver
-{
-    Q_OBJECT
-public:
-    SessionEventHandler(QThread* parent=0);
-    ~SessionEventHandler();
-
-public:
-
-    /**
-     * @see MMsvSessionObserver
-     */
-    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2,
-        TAny* aArg3);
-
-private:
-    void run();
-
-};
-
-#endif /* UNIEDITORSMSPLUGIN_SH_H_ */
--- a/messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/inc/unieditorsmsplugin.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-#ifndef UNIEDITORSMSPLUGIN_H_
-#define UNIEDITORSMSPLUGIN_H_
-
-
-#include <QObject>
-#include "unieditorplugininterface.h"
-
-class UniEditorSmsPluginPrivate;
-
-/**
- * Unified editor send SMS plugin.
- */
-class UniEditorSmsPlugin : public QObject, public UniEditorPluginInterface
-{
-Q_OBJECT
-    Q_INTERFACES(UniEditorPluginInterface)
-
-public:
-    /**
-     * Constructor
-     */
-    UniEditorSmsPlugin(QObject* parent = 0);
-
-    /**
-     * Destructor
-     */
-    ~UniEditorSmsPlugin();
-
-    /**
-     *  Message type (SMS/MMS etc..)
-     *  @return type of message
-     */
-    ConvergedMessage::MessageType messageType();
-
-    /**
-     * convert from message store entry to convergedmessage type
-     * @param aId message entry id
-     * @return convergedmessage
-     */
-    ConvergedMessage* convertFrom( TMsvId aId );
-    
-    /**
-     * delete entry from drafts folder
-     * @param aId message entry id to be deleted
-     */
-    void deleteDraftsEntry( TMsvId aId );
-
-    /**
-     * convert from convergedmessage to entry in message store
-     * @param aMessage convergedmessage
-     * @return message entry id
-     */
-    TMsvId convertTo( ConvergedMessage *aMessage );
-
-    /**
-     * send message
-     * @param message entry id
-     * @return true, if send is successfull
-     */
-    bool send(TMsvId aId);
-
-    /**
-     * check if service is valid
-     * @return true/false
-     */
-    TBool isServiceValid();
-
-    /**
-     * validate settings
-     * @param aEmailOverSms true if email over sms is supported, else false
-     * @return true/false
-     */
-    TBool validateService( TBool aEmailOverSms = EFalse );
-
-private:
-    UniEditorSmsPluginPrivate* d_ptr;
-};
-
-#endif //UNIEDITORSMSPLUGIN_H_
--- a/messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/inc/unieditorsmsplugin_p.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,385 +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 __UNIEDITORSMSPLUGINPRIVATE_H
-#define __UNIEDITORSMSPLUGINPRIVATE_H
-
-// INCLUDES
-#include <msvapi.h>
-#include <gsmuelem.h>
-#include <mtclbase.h>
-#include "UniSendingSettings.h"
-
-// DATA TYPES
-
-// FORWARD DECLARATIONS
-class CClientMtmRegistry;
-class CSmsClientMtm;
-class CSmsHeader;
-class CParaFormatLayer;
-class CCharFormatLayer;
-class CRichText;
-class CMsgSmsEmailOverSmsFunc;
-class CSmsNumber;
-class CSmsMessage;
-class ConvergedMessage;
-class UniEditorGenUtils;
-class SessionEventHandler;
-
-// CLASS DECLARATION
-
-/**
-* UniEditorSmsPluginPrivate
-*/ 
-class UniEditorSmsPluginPrivate
-	{
-	public:  // Constructors and destructor
-        
-        /**
-        * Two-phased constructor.
-        */
-        static UniEditorSmsPluginPrivate* NewL();
- 		
-        /**
-        * Destructor.
-        */
-        virtual ~UniEditorSmsPluginPrivate();
-
-    public: // From CUniEditorPlugin
-
-        /**
-         * load sms headers either from store, if provided,
-         * or from global settings
-         * @param aStore message store
-         */
-        void LoadHeadersL( CMsvStore* aStore );
-
-        /**
-         * convert message entry to convergedmessage type
-         * @param aId message entry id
-         * @return convergedmessage
-         */
-        ConvergedMessage* ConvertFromL( TMsvId aId );
-
-        /**
-         * convert convergedmessage type to a message entry in store
-         * @param message convergedmessage
-         * @return message entry id
-         */
-        TMsvId ConvertToL( ConvergedMessage* message );
-
-        /**
-         * send a message
-         * @aId message entry id
-         */
-        void SendL( TMsvId aId );
-
-        /**
-         * validate settings
-         * @param aEmailOverSms if email over sms is supported or not 
-         */
-        TBool ValidateServiceL( TBool aEmailOverSms = EFalse );
-
-        /**
-         * validate the service
-         */
-        TBool IsServiceValidL();
-        
-        /**
-         * set unicode mode to true/false
-         */
-        inline void SetUnicodeMode( TBool aUnicodeMode );
-        
-        //Turkish SMS(PREQ2265) specific...
-        void SetEncodingSettings(TBool aUnicodeMode, TSmsEncoding aAlternativeEncodingType, TInt charSupportType);
-       
-        /**
-         * for deciding on reduced or full charset support
-         */
-        void GetNumPDUsL (
-               TDesC& aBuf,
-               TInt& aNumOfRemainingChars,
-               TInt& aNumOfPDUs,
-               TBool& aUnicodeMode, 
-               TSmsEncoding& aAlternativeEncodingType);
-
-        /**
-         * delete entry aId from drafts folder
-         * @param aId entry to be deleted
-         */
-        void DeleteDraftsEntryL( TMsvId aId );
-
-	private: // Constructors
-	
-	    /**
-        * C++ default constructor.
-        */
-        UniEditorSmsPluginPrivate();
-
-        /**
-        * By default Symbian 2nd phase constructor is private.
-        */
-		void ConstructL();
-		
-		/**
-		* Returns pointer to iSmsMtm member variable
-		*/
-		CSmsClientMtm* SmsMtmL();
-
-        /**
-        * Moves message into outbox for sending and creates copies of SMS messages
-        * into outbox in case of multiple recipients
-        */
-        void MoveMessagesToOutboxL();
-
-        /**
-        * Called in MoveMessagesToOutboxL, calls the actual moving
-        * function
-        */
-        TMsvId MoveMessageEntryL( TMsvId aTarget );
-
-        
-        /**
-        * Creates messages into the Outbox if there are several recipients
-        * @param TMsvEntry& a reference to entry to be copied
-        * @param CSmsNumber& a reference to CSmsNumber to be copied
-        * @param CRichText& a reference to msg body contents
-        * @return TMsvId of the created msg entry
-        */
-        TMsvId CreateMessageInOutboxL(
-            const TMsvEntry& aEntry, 
-            const CSmsNumber& aRecipient, 
-            const CRichText& aBody );
-            
-        /**
-        * Creates messages into the Outbox if there are several recipients
-        * and the message is E-Mail over SMS message
-        * @param aEntry a reference to entry to be copied
-        * @param aAddress a reference to address to be copied
-        * @return TMsvId of the created msg entry
-        */
-        virtual TMsvId CreateMessageInOutboxL(
-            const TMsvEntry& aEntry, 
-            const TDesC& aAddress );    
-        
-
-        /**
-        * Calls the actual sending method of SMS Client MTM
-        */
-        void SetScheduledSendingStateL( CMsvEntrySelection* aSelection );
-        
-        /**
-        * Extracts name and address
-        */
-        void NameAndAddress( const TDesC& aMsvAddress, TPtrC& aName, TPtrC& aAddress );
-
-        /**
-        * Creates text for TMsvEntry::iDescription. It could be subject or
-        * if subject does not exist a beginning of the message body 
-        */
-        void ExtractDescriptionFromMessageL(
-            const CSmsMessage& aMessage, 
-            TDes& aDescription, 
-            TInt aMaxLength);
-            
-        /**
-        * Copies text from attachment into the body of the SMS
-        */
-        void CreatePlainTextSMSL( RFile& aFile );
-        
-        /** 
-        * Insert subject into the body of the SMS
-        */
-        void InsertSubjectL( CSmsHeader& aHeader, CRichText& aText );
-        
-        /**
-        * Copies data from VCard attachment into body of the SMS
-        */
-        void CreateVCardSMSL( RFile& aFile );
-        
-        /**
-        * Copies data from VCCalendar attachment into body of the SMS
-        */
-        void CreateVCalSMSL( RFile& aFile );
-                
-        /**
-        * Checks service center address 
-        */
-        TBool ValidateSCNumberL();
-        
-        /**
-        * Checks service center address for E-Mail over SMS messages
-        */
-        TBool ValidateSCNumberForEmailOverSmsL();
-        
-        /**
-        * Saves E-Mail specific information in header
-        */
-        void FillEmailInformationDataL( CSmsHeader& aHeader,  const TPtrC& aAddress );
-    
-        /**
-        * Checks if the address is E-Mail address
-        */
-        TBool IsEmailAddress( const TPtrC& aAddress ) const;
-            
-        /**
-         * Converts sms message to uni message format.
-         * @param aId message id
-         * @param [OUT]aMessage convergedmessage
-         * @param aIsForward true if message is forwared
-         */
-        void DoConvertFromL( TMsvId aId, ConvergedMessage* aMessage, TBool aIsForward );
-
-        /**
-         * create Sms entry into draft folder
-         */
-        TMsvId CreateNativeSmsL();
-     
-        /**
-         * set/update sms settings 
-         */
-        void SetSmsSettingsL();
-     
-        /**
-         * set data to the sms
-         */
-        void SetSmsDataL(ConvergedMessage* message);
-     
-        /**
-         * set recipient / subject to the message entry 
-         */
-        void SetSmsHeaderL(ConvergedMessage* message);
-        
-        /**
-         * set body text from converged message into
-         * message entry in store
-         */
-        void SetSmsBodyL(ConvergedMessage* message);
-        
-        /**
-         * set attachment info from converged message into
-         * message entry in store
-         */
-        void SetSmsAttachmentsL(ConvergedMessage* message);
-
-        /**
-         * create attachment in message store for the 
-         * message under composition
-         * @param aFilePath file for which attachment is created
-         * @param aStore message store
-         */
-        void CreateAttachmentL(CMsvStore* aStore, const TDesC& aFilePath);
-
-    private:  // Data    
-
-        /**
-         * message service session
-         * Owned
-         */
-        CMsvSession* iSession;
-        
-        /**
-         * Mtm registry
-         * Owned
-         */
-        CClientMtmRegistry* iMtmRegistry;
-        
-        /**
-         * sms mtm
-         * Owned
-         */
-        CSmsClientMtm* iSmsMtm;
-        
-        /**
-         * sms service id
-         */
-        TMsvId iSmsServiceId;
-        
-        /**
-         * sms header
-         * Owned
-         */
-        CSmsHeader* iSmsHeader;
-        
-        /**
-         * Owned
-         */
-        CParaFormatLayer* iParaFormatLayer;
-        
-        /**
-         * Owned
-         */
-        CCharFormatLayer* iCharFormatLayer;
-        
-        /**
-         * Owned
-         */
-        CRichText* iRichText;
-        
-        /**
-         * recipient array
-         * Owned
-         */
-        CDesCArray* iRecipients;
-        
-        /**
-         * flag for biomsg distinction
-         */
-       	TBool iBioMsg;
-        
-        enum TUniPluginPanic
-            {
-            EIllegalArguments  
-            }; 
-    
-        /**
-         * email gateway address/alias
-         * Owned
-         */
-        CSmsNumber* iEmailOverSmsC;
-        
-        /**
-         * flag for setting unicodemode true/false
-         */
-        TBool iUnicodeMode;
-        
-        /**
-         * feature flag to check if offline is supported or not
-         */
-        TBool iOfflineSupported;
-        
-        //Turkish SMS(PREQ2265) specific...
-        TInt iCharSupportType;
-        TSmsEncoding  iAlternativeEncodingType;
-        TBool iNLTFeatureSupport;
-        
-        /**
-         * general utility class
-         * Owned
-         */
-        UniEditorGenUtils* iGenUtils;
-        SessionEventHandler *iSessionHandler;
-    };
-
-inline void UniEditorSmsPluginPrivate::SetUnicodeMode( TBool aUnicodeMode )
-    {
-    iUnicodeMode = aUnicodeMode;
-    }
-
-#endif      // __UNIEDITORSMSPLUGINPRIVATE_H
-
-// End of File
--- a/messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/rom/unieditorsmsplugin.iby	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +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 __UNI_EDITOR_SMS_PLUGIN_IBY__
-#define __UNI_EDITOR_SMS_PLUGIN_IBY__
-
-# this is the plugin stub for QT plugin
-file=ABI_DIR\UREL\unieditorsmsplugin.dll               SHARED_LIB_DIR\unieditorsmsplugin.dll
-data=\epoc32\data\z\resource\qt\plugins\messaging\editorplugins\unieditorsmsplugin.qtplugin              \resource\qt\plugins\messaging\editorplugins\unieditorsmsplugin.qtplugin
-
-#endif // __UNI_EDITOR_SMS_PLUGIN_IBY__
-
--- a/messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/src/sessioneventhandler.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +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 "sessioneventhandler.h"
-
-SessionEventHandler::SessionEventHandler(QThread* parent):
-QThread(parent)
-{
-}
-
-SessionEventHandler::~SessionEventHandler()
-{
-}
-
-//---------------------------------------------------------------
-// SessionEventHandler::HandleSessionEventL
-// @see header
-//---------------------------------------------------------------
-void SessionEventHandler::HandleSessionEventL(TMsvSessionEvent /*aEvent*/,
-                                                  TAny* /*aArg1*/,
-                                                  TAny* /*aArg2*/, TAny* /*aArg3*/)
-{
-// do nothing
-}
-
-//---------------------------------------------------------------
-// SessionEventHandler::run
-// @see header
-//---------------------------------------------------------------
-void SessionEventHandler::run()
-{
-    exec();
-}
-
-// EOF
--- a/messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/src/unieditorsmsplugin.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +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 FILES
-
-// USER INCLUDES
-#include "unieditorsmsplugin.h"
-#include "unieditorsmsplugin_p.h"
-
-// DEBUG
-#include "debugtraces.h"
-
-// CONSTANTS
-
-//---------------------------------------------------------------
-// UniEditorSmsPlugin::UniEditorSmsPlugin()
-// @see header
-//---------------------------------------------------------------
-UniEditorSmsPlugin::UniEditorSmsPlugin(QObject* parent) :
-    QObject(parent),
-    d_ptr(NULL)
-{
-    TRAPD(error, d_ptr = UniEditorSmsPluginPrivate::NewL());
-    QDEBUG_WRITE_FORMAT("UniEditorSmsPlugin::UniEditorSmsPlugin error = ",error);
-}
-
-//---------------------------------------------------------------
-// UniEditorSmsPlugin::~UniEditorSmsPlugin()
-// @see header
-//---------------------------------------------------------------
-UniEditorSmsPlugin::~UniEditorSmsPlugin()
-{
-    delete d_ptr;
-}
-
-//---------------------------------------------------------------
-// UniEditorSmsPlugin::messageType()
-// @see header
-//---------------------------------------------------------------
-ConvergedMessage::MessageType UniEditorSmsPlugin::messageType()
-{
-    return ConvergedMessage::Sms;
-}
-
-//---------------------------------------------------------------
-// UniEditorSmsPlugin::convertFrom
-// @see header
-//---------------------------------------------------------------
-ConvergedMessage* UniEditorSmsPlugin::convertFrom( TMsvId aId )
-{
-    ConvergedMessage* msg = NULL;
-    TRAPD(error, msg = d_ptr->ConvertFromL( aId ));
-    QDEBUG_WRITE_FORMAT("UniEditorSmsPlugin::convertFrom error = ",error);
-    return msg;
-}
-
-//---------------------------------------------------------------
-// UniEditorSmsPlugin::deleteDraftsEntry
-// @see header
-//---------------------------------------------------------------
-void UniEditorSmsPlugin::deleteDraftsEntry( TMsvId aId )
-{
-    TRAPD(error, d_ptr->DeleteDraftsEntryL( aId ));
-    QDEBUG_WRITE_FORMAT("UniEditorSmsPlugin::DeleteDraftsEntry error = ",error);
-    return;
-}
-
-//---------------------------------------------------------------
-// UniEditorSmsPlugin::convertTo
-// @see header
-//---------------------------------------------------------------
-TMsvId UniEditorSmsPlugin::convertTo( ConvergedMessage *aMessage )
-{
-    TMsvId id = -1;
-    TRAPD(error, id = d_ptr->ConvertToL( aMessage ));
-    QDEBUG_WRITE_FORMAT("UniEditorSmsPlugin::ConvertTo error = ",error);
-    return id;
-}
-
-//---------------------------------------------------------------
-// UniEditorSmsPlugin::send
-// @see header
-//---------------------------------------------------------------
-bool UniEditorSmsPlugin::send(TMsvId aId)
-{
-    bool ret = true;
-    TRAPD(error, d_ptr->SendL( aId ));
-    if(error != KErrNone)
-    {
-        ret = false;
-    }
-    QDEBUG_WRITE_FORMAT("UniEditorSmsPlugin::Send error = ",error);
-    return ret;
-}
-
-//---------------------------------------------------------------
-// UniEditorSmsPlugin::isServiceValidL
-// @see header
-//---------------------------------------------------------------
-TBool UniEditorSmsPlugin::isServiceValid()
-{
-    TBool ret = EFalse;
-    TRAPD(error, ret = d_ptr->IsServiceValidL());
-    QDEBUG_WRITE_FORMAT("UniEditorSmsPlugin::isServiceValid error = ", error);
-    return ret;
-}
-
-//---------------------------------------------------------------
-// UniEditorSmsPlugin::validateServiceL
-// @see header
-//---------------------------------------------------------------
-TBool UniEditorSmsPlugin::validateService( TBool aEmailOverSms/* = EFalse */)
-{
-    TBool ret = EFalse;
-    TRAPD(error, ret = d_ptr->ValidateServiceL( aEmailOverSms ));
-    QDEBUG_WRITE_FORMAT("UniEditorSmsPlugin::ValidateService error = ",error);
-    return ret;
-}
-
-Q_EXPORT_PLUGIN2(unieditorsmsplugin, UniEditorSmsPlugin)
--- a/messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/src/unieditorsmsplugin_p.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1694 +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 FILES
-
-// Symbian:
-#include <e32base.h>
-#include <txtetext.h>
-#include <txtrich.h>
-#include <S32MEM.H>
-
-#include <mmsvattachmentmanager.h>
-#include <mmsvattachmentmanagersync.h>
-#include <gsmerror.h>                       // KErrGsmOfflineOpNotAllowed
-#include <featmgr.h>
-
-#include <mtclreg.h>
-#include <smsclnt.h>
-#include <smscmds.h>
-#include <smuthdr.h>
-#include <csmsemailfields.h>
-#include <csmsaccount.h>
-#include <charconv.h>
-#include <smut.h>
-#include <cmsvmimeheaders.h>
-#include <badesca.h>
-#include <e32cmn.h>
-#include <gsmuset.h>
-
-// S60
-#include <MsgMediaResolver.h>
-#include <MsgMediaInfo.h>
-#include <MsgTextInfo.h>
-
-#include <mmsgenutils.h>
-#include <vcard.h>
-#include <SenduiMtmUids.h>
-#include <MsgMimeTypes.h>
-#include "UniSendingSettings.h"
-#include "MessagingVariant.hrh"
-#include "msgbiouids.h"
-#include "unieditorsmsplugin_p.h"
-#include "convergedmessage.h"
-#include "convergedmessageid.h"
-#include "convergedmessageattachment.h"
-#include "s60qconversions.h"
-#include "MuiuOperationWait.h"
-#include "UniEditorGenUtils.h"
-#include "sessioneventhandler.h"
-
-// resources
-
-// CONSTANTS
-
-// Used to set msg in unparsed state
-const TInt KSmsPluginBioMsgUnparsed = 0;
-
-// Description length for sms messages
-const TInt KSmsMessageEntryDescriptionAmountOfChars = 60;
-
-//used for descriptor array containing recipients
-const TInt KRecipientsArrayGranularity = 8;
-
-// For address information separation (start)
-const TUint KMsgSmsAddressStartChar         ('<');
-
-// For address information separation (end)
-const TUint KMsgSmsAddressEndChar           ('>');
-
-const TUint KUniSmsStartParenthesis ('(');
-const TUint KUniSmsEndParenthesis (')');
-
-// String length for Service centre name
-const TInt KUniSmsSCStringLength = 50;
-
-const TUid KUidMsvSMSHeaderStream_COPY_FROM_SMUTHDR_CPP  = {0x10001834};
-
-// Amount of to be converted chars during extracting description
-const TInt KSmsEdExtrDescReplaceCharacterCount = 3;
-
-// Unicode char for linefeed regocnised by basic phones
-const TUint KSmsEdUnicodeLFSupportedByBasicPhones = 0x000A;
-
-// Copy max this many chars to TMsvEntry iDetails
-const TInt  KMaxDetailsLength = 64;
-const QString KAddressSeparator(";");
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-UniEditorSmsPluginPrivate* UniEditorSmsPluginPrivate::NewL()
-    {
-    UniEditorSmsPluginPrivate* self = new ( ELeave ) UniEditorSmsPluginPrivate();
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// -----------------------------------------------------------------------------
-// Destructor
-// -----------------------------------------------------------------------------
-//
-UniEditorSmsPluginPrivate::~UniEditorSmsPluginPrivate()
-{
-    if(iGenUtils)
-    {
-        delete iGenUtils;
-        iGenUtils = NULL;
-    }
-    
-    if(iEmailOverSmsC)
-    {
-        delete iEmailOverSmsC;
-        iEmailOverSmsC = NULL;
-    }
-
-    if(iRecipients)
-    {
-        delete iRecipients;
-        iRecipients = NULL;
-    }
-
-    if(iRichText)
-    {
-        delete iRichText;
-        iRichText = NULL;
-    }
-
-    if(iCharFormatLayer)
-    {
-        delete iCharFormatLayer;
-        iCharFormatLayer = NULL;
-    }
-
-    if(iParaFormatLayer)
-    {
-        delete iParaFormatLayer;
-        iParaFormatLayer = NULL;
-    }
-
-    if(iSmsHeader)
-    {
-        delete iSmsHeader;
-        iSmsHeader = NULL;
-    }
-
-    if(iSmsMtm)
-    {
-        delete iSmsMtm;
-        iSmsMtm = NULL;
-    }
-
-    if(iMtmRegistry)
-    {
-        delete iMtmRegistry;
-        iMtmRegistry = NULL;
-    }
-
-    delete iSessionHandler;
-    iSessionHandler = NULL;
-
-    if(iSession)
-    {
-        delete iSession;
-        iSession = NULL;
-    }
-}
-
-// -----------------------------------------------------------------------------
-// C++ default constructor
-// -----------------------------------------------------------------------------
-//
-UniEditorSmsPluginPrivate::UniEditorSmsPluginPrivate() :
-    iSession(0),
-    iMtmRegistry(0),
-    iSmsMtm(0),
-    iSmsHeader(0),
-    iParaFormatLayer(0),
-    iCharFormatLayer(0),
-    iRichText(0),
-    iRecipients(0),
-    iBioMsg( EFalse ),
-    iEmailOverSmsC(0),
-    iUnicodeMode( ETrue ),
-    iOfflineSupported( EFalse ),
-    iGenUtils(0),
-    iSessionHandler(0)
-    {
-    }
-
-// -----------------------------------------------------------------------------
-// Symbian 2nd phase constructor
-// -----------------------------------------------------------------------------
-//
-void UniEditorSmsPluginPrivate::ConstructL()
-    {
-	iSessionHandler = new SessionEventHandler();
-	iSessionHandler->start();
-	iSession = CMsvSession::OpenSyncL(*iSessionHandler);
-    iParaFormatLayer = CParaFormatLayer::NewL();
-    iCharFormatLayer = CCharFormatLayer::NewL();
-    iRichText = CRichText::NewL( iParaFormatLayer, iCharFormatLayer );
-    iEmailOverSmsC = CSmsNumber::NewL();
-
-    CMsvEntry& entry = SmsMtmL()->Entry();
-    entry.SetEntryL( KMsvRootIndexEntryId );
-
-    TSmsUtilities::ServiceIdL( entry, iSmsServiceId );
-
-    FeatureManager::InitializeLibL();
-    if ( FeatureManager::FeatureSupported( KFeatureIdOfflineMode ) )
-        {
-        iOfflineSupported = ETrue;
-        }
-    else
-        {
-        iOfflineSupported = EFalse;
-        }
-
-    //Turkish SMS-PREQ2265 Specific
-    if ( FeatureManager::FeatureSupported( KFeatureIdNltSupport ) )
-        {
-        iNLTFeatureSupport = ETrue;
-        }
-    else
-        {
-        iNLTFeatureSupport = EFalse;
-        }
-
-    FeatureManager::UnInitializeLib();
-    
-    iGenUtils = new UniEditorGenUtils();
-    }
-
-// -----------------------------------------------------------------------------
-// LoadHeadersL
-// @see header
-// -----------------------------------------------------------------------------
-void UniEditorSmsPluginPrivate::LoadHeadersL( CMsvStore* aStore )
-    {
-    delete iSmsHeader;
-    iSmsHeader = NULL;
-
-    if ( aStore && aStore->HasBodyTextL() )
-        {
-    	aStore->RestoreBodyTextL( *iRichText );
-        }
-
-	iSmsHeader = CSmsHeader::NewL( CSmsPDU::ESmsSubmit, *iRichText );
-
-	if ( aStore && aStore->IsPresentL( KUidMsvSMSHeaderStream_COPY_FROM_SMUTHDR_CPP ) )
-	    {
-	    iSmsHeader->RestoreL( *aStore );
-	    }
-	else
-	    {
-        CSmsSettings* settings = CSmsSettings::NewLC();
-    	CSmsAccount* account = CSmsAccount::NewLC();
-    	account->LoadSettingsL( *settings );
-    	CleanupStack::PopAndDestroy( account );
-        iSmsHeader->SetSmsSettingsL( *settings );
-        CleanupStack::PopAndDestroy( settings );
-	    }
-    }
-
-// -----------------------------------------------------------------------------
-// ConvertFromL
-// @see header
-// -----------------------------------------------------------------------------
-ConvergedMessage* UniEditorSmsPluginPrivate::ConvertFromL(TMsvId aId)
-{
-    ConvergedMessageId id(aId);
-    ConvergedMessage* msg = new ConvergedMessage(id);
-    CleanupStack::PushL(msg);
-    DoConvertFromL(aId, msg, EFalse);
-    CleanupStack::Pop(msg);
-    return msg;
-}
-
-// -----------------------------------------------------------------------------
-// DoConvertFromL
-// @see header
-// -----------------------------------------------------------------------------
-void UniEditorSmsPluginPrivate::DoConvertFromL( TMsvId aId,
-        ConvergedMessage* aMessage, TBool aIsForward)
-{
-    // load message for processing
-    SmsMtmL()->SwitchCurrentEntryL( aId );
-    SmsMtmL()->LoadMessageL();
-
-    aMessage->setMessageType(ConvergedMessage::Sms);
-
-    // get parent entry
-    TMsvEntry msvEntry( SmsMtmL()->Entry().Entry() );
-    TMsvId parent = msvEntry.Parent();
-
-    if( parent == KMsvDraftEntryIdValue )
-        {
-        aMessage->setLocation(ConvergedMessage::Draft);
-        //TODO: need to give FORWARD etc info in convergedMessage
-        aMessage->setDirection(ConvergedMessage::Outgoing);
-        TPtrC name;
-        TPtrC address;
-
-        const CSmsEmailFields& emailFields = SmsMtmL( )->SmsHeader( ).EmailFields();
-        if( emailFields.HasAddress( ) && !aIsForward )
-            { // If email address set -> copy them here
-            const MDesCArray& emailRecipients = emailFields.Addresses();
-            for( TInt id = 0; id < emailRecipients.MdcaCount( ); id++ )
-                {
-                HBufC* pureAddr = TMmsGenUtils::PureAddress( emailRecipients.MdcaPoint( id ) ).AllocLC();
-                HBufC* aliasAddr = TMmsGenUtils::Alias( emailRecipients.MdcaPoint( id ) ).AllocLC();
-                ConvergedMessageAddress messageAddress(
-                        S60QConversions::s60DescToQString(*pureAddr), 
-                        S60QConversions::s60DescToQString(*aliasAddr));
-                CleanupStack::PopAndDestroy(2, pureAddr );
-                aMessage->addToRecipient(messageAddress);
-                }
-            }
-
-        // Copy non-email over sms addresses if needed
-        const CMsvRecipientList& smsRecipients = SmsMtmL()->AddresseeList();
-        int smsRecCount = smsRecipients.Count();
-        for (int i = 0; i < smsRecCount; i++)
-            { // Go thru all the recipients
-            if( !emailFields.HasAddress( ) && !aIsForward )
-                { // and copy them only if email addresses did not exist
-                HBufC* pureAddr =
-                        TMmsGenUtils::PureAddress(smsRecipients[i]).AllocLC();
-                HBufC* aliasAddr =
-                        TMmsGenUtils::Alias(smsRecipients[i]).AllocLC();
-                ConvergedMessageAddress messageAddress(
-                        S60QConversions::s60DescToQString(*pureAddr), 
-                        S60QConversions::s60DescToQString(*aliasAddr));
-                CleanupStack::PopAndDestroy(2, pureAddr );
-                aMessage->addToRecipient(messageAddress);
-                }
-            }
-
-        if( emailFields.Subject( ).Length( ) )
-            { // If email subject exists -> copy it
-            aMessage->setSubject(S60QConversions::s60DescToQString(
-                    emailFields.Subject()));
-            }
-
-        //Get sms entry 
-        TMsvEntry smsTEntry = SmsMtmL()->Entry().Entry();
-
-        if (  smsTEntry.iBioType == KMsgBioUidVCard.iUid
-            || smsTEntry.iBioType == KMsgBioUidVCalendar.iUid )
-            {
-            CMsvStore* store = SmsMtmL()->Entry().EditStoreL();
-            CleanupStack::PushL( store );
-            MMsvAttachmentManager& manager = store->AttachmentManagerL();
-            CMsvAttachment *attachment = manager.GetAttachmentInfoL(0);
-            QString filepath = S60QConversions::s60DescToQString(attachment->FilePath());
-            ConvergedMessageAttachment* conv_attachment = 
-                    new ConvergedMessageAttachment(filepath, ConvergedMessageAttachment::EAttachment);
-            ConvergedMessageAttachmentList conv_attList;
-            conv_attList << conv_attachment;
-            aMessage->addAttachments(conv_attList);
-            CleanupStack::PopAndDestroy( store );
-            }
-        else   //plain text
-            {
-            TInt totalLength( SmsMtmL()->Body().DocumentLength() );
-            if ( totalLength > 0 )
-                {
-                HBufC* bodyText = HBufC::NewLC ( totalLength ); 
-                TPtr bodyTextPtr ( bodyText->Des() ); 
-                SmsMtmL()->Body().Extract( bodyTextPtr, 0, totalLength );
-                aMessage->setBodyText(S60QConversions::s60DescToQString(
-                        bodyTextPtr));
-                CleanupStack::PopAndDestroy( bodyText );            
-                }
-            }
-        }
-
-    return;
-}
-
-// -----------------------------------------------------------------------------
-// ConvertToL
-// @see header
-// -----------------------------------------------------------------------------
-TMsvId UniEditorSmsPluginPrivate::ConvertToL( ConvergedMessage* message )
-{
-    // create message in draft folder
-    TMsvId id = CreateNativeSmsL();
-
-    int err = KErrNone;
-        TRAP(err,
-                // set sms data
-                SetSmsDataL( message );
-                // set sms settings
-                SetSmsSettingsL();
-                // save all changes for the entry
-                SmsMtmL()->SaveMessageL();
-        );
-
-    // delete the created drafts entry because error 
-    // happened during save
-    if (err != KErrNone)
-        {
-        DeleteDraftsEntryL(id);
-        id = -1;
-        }
-
-    return id;
-}
-
-// -----------------------------------------------------------------------------
-// CreateNativeSmsL
-// @see header
-// -----------------------------------------------------------------------------
-TMsvId UniEditorSmsPluginPrivate::CreateNativeSmsL()
-{
-    CMsvEntry* cEntry = SmsMtmL()->Session().GetEntryL(KMsvDraftEntryId);
-    CleanupStack::PushL( cEntry );
-    SmsMtmL()->SwitchCurrentEntryL( cEntry->EntryId() );
-
-    TMsvEntry tEntry;
-    tEntry.SetAttachment( EFalse );
-    tEntry.iMtm = KSenduiMtmSmsUid;
-    tEntry.iType = KUidMsvMessageEntry;
-    tEntry.iRelatedId = iSmsServiceId;
-    tEntry.iServiceId = KMsvLocalServiceIndexEntryId;
-    tEntry.iDate.UniversalTime();
-    tEntry.SetInPreparation( ETrue );
-    tEntry.SetVisible( EFalse );
-
-    cEntry->CreateL(tEntry);
-    SmsMtmL()->SwitchCurrentEntryL(tEntry.Id());
-    CleanupStack::PopAndDestroy( cEntry );
-    return SmsMtmL()->Entry().Entry().Id();
-}
-
-// -----------------------------------------------------------------------------
-// SetSmsDataL
-// @see header
-// -----------------------------------------------------------------------------
-void UniEditorSmsPluginPrivate::SetSmsDataL(ConvergedMessage* message)
-{
-    // populate recipients, subject and emailfields
-    SetSmsHeaderL(message);
-    
-    // populate the attachments in msg entry
-    SetSmsAttachmentsL(message);
-}
-
-// -----------------------------------------------------------------------------
-// SetSmsHeaderL
-// @see header
-// -----------------------------------------------------------------------------
-void UniEditorSmsPluginPrivate::SetSmsHeaderL(ConvergedMessage* message)
-{
-    QString detailsBuf;
-    //Save for email over sms
-    if ( iRecipients )
-    {
-        delete iRecipients;
-        iRecipients = NULL;
-    }
-    iRecipients = new ( ELeave ) CDesCArrayFlat( KRecipientsArrayGranularity );
-
-    CSmsEmailFields *emailFields = CSmsEmailFields::NewL();
-    CleanupStack::PushL( emailFields );
-
-    ConvergedMessageAddressList addrList = message->toAddressList();
-    int addrCount = addrList.count();
-    for(int i=0; i<addrCount; i++)
-    {
-        HBufC* addr = S60QConversions::qStringToS60Desc( addrList.at(i)->address() );
-        if(addr)
-        {
-            CleanupStack::PushL(addr);
-            HBufC* pureAddr = TMmsGenUtils::PureAddress( *addr ).AllocLC();
-            QString paddr = S60QConversions::s60DescToQString( *pureAddr );
-            HBufC* aliasAddr = TMmsGenUtils::Alias( *addr ).AllocLC();
-            QString alias = S60QConversions::s60DescToQString( *aliasAddr );
-            if ( IsEmailAddress( *pureAddr ) )
-            {
-                emailFields->AddAddressL( *pureAddr );
-                detailsBuf.append( paddr );
-            }
-            else
-            {
-                if(aliasAddr->Length() > 0)
-                {
-                    SmsMtmL()->AddAddresseeL( *pureAddr, *aliasAddr );
-                    detailsBuf.append( alias );
-                }
-                else
-                {
-                    HBufC* alt_alias = S60QConversions::qStringToS60Desc( addrList.at(i)->alias() );
-                    if(alt_alias)
-                    {
-                        CleanupStack::PushL( alt_alias );
-                        SmsMtmL()->AddAddresseeL( *pureAddr, *alt_alias );
-                        CleanupStack::PopAndDestroy( alt_alias );
-                        detailsBuf.append(addrList.at(i)->alias());
-                    }
-                    else
-                    {
-                        SmsMtmL()->AddAddresseeL( *pureAddr );
-                        detailsBuf.append(paddr);
-                    }
-                }
-            }
-            CleanupStack::PopAndDestroy(2, pureAddr );
-            iRecipients->AppendL( *addr );
-            CleanupStack::PopAndDestroy( addr );
-            if(i != addrCount-1)
-                {
-                detailsBuf = detailsBuf.trimmed();
-                detailsBuf.append(KAddressSeparator);
-                }
-        }
-    }
-    
-    // set iDetails
-    CMsvEntry& entry = SmsMtmL()->Entry();
-    TMsvEntry msvEntry( entry.Entry() );
-    QString trm_details = detailsBuf.left( KMaxDetailsLength );
-    HBufC* idet = S60QConversions::qStringToS60Desc(trm_details);
-    if( idet )
-        {
-        msvEntry.iDetails.Set( *idet );
-        entry.ChangeL( msvEntry );
-    }
-
-    // set subject
-    if ( !message->subject().isEmpty() )
-    {
-        HBufC* subj = S60QConversions::qStringToS60Desc( message->subject() );
-        if( subj )
-        {
-            CleanupStack::PushL( subj );
-            emailFields->SetSubjectL( *subj );
-            CleanupStack::PopAndDestroy( subj );
-        }
-    }
-
-    SmsMtmL()->SmsHeader().SetEmailFieldsL( *emailFields );
-    CleanupStack::PopAndDestroy( emailFields );
-}
-
-// -----------------------------------------------------------------------------
-// SetSmsBodyL
-// @see header
-// -----------------------------------------------------------------------------
-void UniEditorSmsPluginPrivate::SetSmsBodyL(ConvergedMessage* message)
-{
-    HBufC8* bodytext = S60QConversions::qStringToS60Desc8( message->bodyText() );
-    RDesReadStream stream(*bodytext);
-    CleanupClosePushL( stream );
-
-    CPlainText::TImportExportParam param;
-    param.iForeignEncoding = KCharacterSetIdentifierUtf8;
-    param.iOrganisation = CPlainText::EOrganiseByParagraph;
-    CPlainText::TImportExportResult result;
-
-    SmsMtmL()->Body().Reset();
-    SmsMtmL()->Body().ImportTextL( 0, stream, param, result );
-
-    CleanupStack::PopAndDestroy(&stream);
-}
-
-// -----------------------------------------------------------------------------
-// SetSmsAttachmentsL
-// @see header
-// -----------------------------------------------------------------------------
-void UniEditorSmsPluginPrivate::SetSmsAttachmentsL(ConvergedMessage* message)
-    {
-    ConvergedMessageAttachmentList attachmentList = message->attachments();
-    int attachmentCount = attachmentList.count();
-
-    ConvergedMessageAttachment* attachment = NULL;
-    switch ( attachmentCount )
-        {
-        case 0:
-            {
-            // no attachment, only body text
-            SetSmsBodyL( message );
-            break;
-            }
-        case 1:
-            {
-              attachment = attachmentList.at(0);
-              break;
-            }
-        default:
-            {
-            //Programming error in caller code
-            User::Leave( KErrArgument );
-            break;
-            }
-        }
-
-    TMsvEntry tEntry = SmsMtmL()->Entry().Entry();
-    if ( attachment )
-        {
-        CMsgMediaResolver* mediaResolver = CMsgMediaResolver::NewL();
-        CleanupStack::PushL(mediaResolver);
-        mediaResolver->SetCharacterSetRecognition( EFalse );
-        RFile filehandle = mediaResolver->FileHandleL(
-                *S60QConversions::qStringToS60Desc(attachment->filePath()));
-        CleanupClosePushL( filehandle );
-        TPtrC8 mimetype;
-        TDataType datatype;
-        mediaResolver->RecognizeL( filehandle, datatype );
-        mimetype.Set(datatype.Des8());
-
-        if ( mimetype.CompareF( KMsgMimeTextPlain ) == 0 )
-            {
-            iBioMsg=EFalse;
-            CreatePlainTextSMSL( filehandle );
-            }
-        else if ( mimetype.CompareF(KMsgMimeVCard) == 0 )
-            {
-            iBioMsg=ETrue;
-            CreateVCardSMSL( filehandle );
-            tEntry.iBioType = KMsgBioUidVCard.iUid;
-            SmsMtmL()->BioTypeChangedL( KMsgBioUidVCard );
-            CMsvStore* store = SmsMtmL()->Entry().EditStoreL();
-            CleanupStack::PushL( store );
-            CreateAttachmentL(store,
-                    *S60QConversions::qStringToS60Desc(attachment->filePath()));
-            CleanupStack::PopAndDestroy( store );
-            SmsMtmL()->SaveMessageL();
-            }
-        else if ( mimetype.CompareF(KMsgMimeVCal ) == 0 ||
-                  mimetype.CompareF(KMsgMimeICal ) == 0 )
-            {
-            iBioMsg=ETrue;
-            CreateVCalSMSL( filehandle );
-            tEntry.iBioType = KMsgBioUidVCalendar.iUid;
-            SmsMtmL()->BioTypeChangedL( KMsgBioUidVCalendar );
-            CMsvStore* store = SmsMtmL()->Entry().EditStoreL();
-            CleanupStack::PushL( store );
-            CreateAttachmentL(store,
-                    *S60QConversions::qStringToS60Desc(attachment->filePath()));
-            CleanupStack::PopAndDestroy( store );
-            SmsMtmL()->SaveMessageL();
-            }
-        else
-            {
-            User::Leave( KErrArgument );
-            }
-        CleanupStack::PopAndDestroy( &filehandle );
-        CleanupStack::PopAndDestroy( mediaResolver );
-        }
-    
-    CSmsHeader& header = SmsMtmL()->SmsHeader();
-    TBuf<KSmsMessageEntryDescriptionAmountOfChars> buf;
-    if (!iBioMsg  )
-        {
-        ExtractDescriptionFromMessageL(
-            header.Message(),
-            buf,
-            KSmsMessageEntryDescriptionAmountOfChars );
-        tEntry.iDescription.Set( buf );
-        }
-    SmsMtmL()->Entry().ChangeL( tEntry );
-    }
-
-// -----------------------------------------------------------------------------
-// CreateAttachmentL
-// @see header
-// -----------------------------------------------------------------------------
-void UniEditorSmsPluginPrivate::CreateAttachmentL(CMsvStore* aStore, const TDesC& aFilePath)
-    {
-    MMsvAttachmentManager* attachmentManager = &( aStore->AttachmentManagerL() );
-    CMsvAttachment* attachment = CMsvAttachment::NewL( CMsvAttachment::EMsvFile );
-    CleanupStack::PushL( attachment );
-
-    int attSize;
-    QString mimeType;
-    TMsgMediaType mediaType = EMsgMediaUnknown;
-    QString filepath = S60QConversions::s60DescToQString( aFilePath );
-    iGenUtils->getFileInfoL(filepath, attSize, mimeType, mediaType);
-    
-    attachment->SetSize( attSize );
-    attachment->SetMimeTypeL( *S60QConversions::qStringToS60Desc8(mimeType) );
-    
-    CMuiuOperationWait* wait = CMuiuOperationWait::NewLC();
-    attachmentManager->AddAttachmentL( aFilePath, attachment, wait->iStatus );
-    wait->Start();
-    CleanupStack::PopAndDestroy( wait );
-    CleanupStack::Pop( attachment );
-    
-    aStore->CommitL();
-    }
-
-// -----------------------------------------------------------------------------
-// SetSmsSettingsL
-// @see header
-// -----------------------------------------------------------------------------
-void UniEditorSmsPluginPrivate::SetSmsSettingsL()
-    {
-    CSmsSettings* sendOptions = CSmsSettings::NewL();
-    CleanupStack::PushL( sendOptions );
-
-    // "ConvertToL" might be called right after constructor.
-    // In this case iSmsHeader is still NULL. Need to initialise.
-    if ( !iSmsHeader )
-        {
-        CMsvStore* store = SmsMtmL()->Entry().EditStoreL();
-        CleanupStack::PushL( store );
-        LoadHeadersL( store );
-        CleanupStack::PopAndDestroy( store );
-        }
-    iSmsHeader->GetSmsSettingsL( *sendOptions );
-
-    sendOptions->CopyL( *sendOptions );
-    
-    if( sendOptions->CharacterSet() == TSmsDataCodingScheme::ESmsAlphabetUCS2)
-    {
-    	iUnicodeMode = true;	
-    }
-    
-    if ( iBioMsg )
-        {
-        // make sure bio messages have no conversion
-        sendOptions->SetMessageConversion( ESmsConvPIDNone );
-        }
-
-    // Update some global SMS settings affecting all messages.
-    // These might have changed from the ones retrieved when
-    // the message was created and so needs to be updated.
-    CSmsSettings* defaultSettings = CSmsSettings::NewLC();
-
-    CSmsAccount* account = CSmsAccount::NewLC();
-    account->LoadSettingsL( *defaultSettings );
-    CleanupStack::PopAndDestroy( account );
-
-    sendOptions->SetDeliveryReport( defaultSettings->DeliveryReport() );
-    sendOptions->SetSmsBearer( defaultSettings->SmsBearer() );
-    sendOptions->SetValidityPeriod( defaultSettings->ValidityPeriod() );
-    sendOptions->SetReplyPath( defaultSettings->ReplyPath() );
-
-    iSmsHeader->SetSmsSettingsL( *sendOptions );
-
-    // 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())
-    {
-    SmsMtmL()->SmsHeader( ).Message( ).
-        SetServiceCenterAddressL( defaultSettings->GetServiceCenter(defaultSettings->DefaultServiceCenter()).Address() );
-    }
-    CleanupStack::PopAndDestroy(defaultSettings);
-/*
-    if(iNLTFeatureSupport)
-        {
-        //Turkish SMS-PREQ2265 Specific
-        TSmsEncoding currAlternateEncoding = iSmsHeader->Message().Alternative7bitEncoding();
-        SmsMtmL()->SmsHeader().Message().SetAlternative7bitEncoding(currAlternateEncoding);
-        }
-*/
-
-    CleanupStack::PopAndDestroy( sendOptions );
-    
-    //Override the charset settings
-    //Initialize the settings
-    SetEncodingSettings( iUnicodeMode, ESmsEncodingNone, 
-            TUniSendingSettings::EUniCharSupportReduced);
-    
-    //Set the needed settings    
-    
-    //get bodytext
-    TInt smslength = SmsMtmL()->Body().LdDocumentLength();
-    HBufC* body = HBufC::NewLC(smslength);
-    TPtrC ptr;        
-    ptr.Set(SmsMtmL()->Body().Read(0,smslength));    
-    
-    TInt numOfRemainingChars;
-    TInt numOfPDUs;
-    TBool unicodeMode;
-    TSmsEncoding alternativeEncodingType;
-    
-    //This is to reset the charset type
-    GetNumPDUsL(ptr,numOfRemainingChars,numOfPDUs,
-            unicodeMode,alternativeEncodingType);
-    
-    CleanupStack::PopAndDestroy(body);
-}
-
-// -----------------------------------------------------------------------------
-// SendL
-// @see header
-// -----------------------------------------------------------------------------
-void UniEditorSmsPluginPrivate::SendL( TMsvId aId )
-{
-    SmsMtmL()->SwitchCurrentEntryL( aId );
-    SmsMtmL()->LoadMessageL();
-    MoveMessagesToOutboxL();
-}
-
-// -----------------------------------------------------------------------------
-// ValidateServiceL
-// @see header
-// -----------------------------------------------------------------------------
-TBool UniEditorSmsPluginPrivate::ValidateServiceL( TBool aEmailOverSms )
-{
-    TBool valid = ValidateSCNumberL();
-
-    if ( aEmailOverSms )
-    {
-        valid = ValidateSCNumberForEmailOverSmsL();
-    }
-
-    return valid;
-}
-
-// -----------------------------------------------------------------------------
-// IsServiceValidL
-// @see header
-// -----------------------------------------------------------------------------
-TBool UniEditorSmsPluginPrivate::IsServiceValidL()
-    {
-    // Not implemented.
-    return ETrue;
-    }
-
-// -----------------------------------------------------------------------------
-// SmsMtmL
-// @see header
-// -----------------------------------------------------------------------------
-CSmsClientMtm* UniEditorSmsPluginPrivate::SmsMtmL()
-    {
-    if ( !iSmsMtm )
-        {
-        if ( !iMtmRegistry )
-            {
-            iMtmRegistry = CClientMtmRegistry::NewL( *iSession );
-            }
-        iSmsMtm = static_cast<CSmsClientMtm*>( iMtmRegistry->NewMtmL( KSenduiMtmSmsUid ) );
-        }
-    return iSmsMtm;
-    }
-
-// ----------------------------------------------------------------------------
-// MoveMessagesToOutboxL
-// @see header
-// ----------------------------------------------------------------------------
-void UniEditorSmsPluginPrivate::MoveMessagesToOutboxL()
-    {
-    if ( !iRecipients || !iRecipients->Count() )
-        {
-        User::Leave( KErrGeneral );
-        }
-
-    //we must create an entry selection for message copies
-    CMsvEntrySelection* selection = new ( ELeave ) CMsvEntrySelection;
-    CleanupStack::PushL( selection );
-
-    CMsvEntry& entry = SmsMtmL()->Entry();
-    TMsvEntry msvEntry( entry.Entry() );
-
-    if ( iOfflineSupported && EFalse && iGenUtils->IsPhoneOfflineL() )
-    	{
-    	msvEntry.SetSendingState( KMsvSendStateSuspended );
-        msvEntry.iError = KErrGsmOfflineOpNotAllowed;
-    	}
-    else
-    	{
-    	msvEntry.SetSendingState( KMsvSendStateWaiting );
-    	}
-
-    CSmsHeader& header = SmsMtmL()->SmsHeader();
-    TBuf<KSmsMessageEntryDescriptionAmountOfChars> buf;
-
-    if (!iBioMsg  )
-        {
-        ExtractDescriptionFromMessageL(
-            header.Message(),
-            buf,
-            KSmsMessageEntryDescriptionAmountOfChars );
-        msvEntry.iDescription.Set( buf );
-        }
-
-    CSmsNumber* rcpt = CSmsNumber::NewL();
-    CleanupStack::PushL( rcpt );
-
-    TPtrC name;
-    TPtrC address;
-    TBool cantExit = ETrue;
-    while ( cantExit )
-        {
-        HBufC* addressBuf = NULL;
-        TPtr addressPtr( 0, 0);
-
-        NameAndAddress( iRecipients->MdcaPoint(0) , name, address );
-
-        // set To-field stuff into the Details of the entry
-        if ( name.Length() )
-            {
-            msvEntry.iDetails.Set( name );
-            }
-        else
-            {
-            // Internal data structures always holds the address data in western format.
-            // UI is responsible of doing language specific conversions.
-            addressBuf = HBufC::NewLC( address.Length() );
-            addressPtr.Set( addressBuf->Des() );
-            addressPtr.Copy( address );
-
-            iGenUtils->ConvertDigitsTo( addressPtr, EDigitTypeWestern );
-            msvEntry.iDetails.Set( addressPtr );
-            }
-        TMsvId copyId;
-
-        if ( iRecipients->Count() == 1 )
-            {
-            //Note that we came here also in case of many recipients. ...eventually.
-
-            if ( IsEmailAddress( address ) )
-                {
-                FillEmailInformationDataL( header, address );
-                //Let's remove the recipient and replace it with Email over SMS gateway address
-                //But let's first cehck if it exists
-                if( SmsMtmL( )->AddresseeList().Count() )
-                	{
-                    SmsMtmL( )->RemoveAddressee( 0 );
-                	}
-                SmsMtmL()->AddAddresseeL(
-	            iEmailOverSmsC->Address( ) ,
-		        KNullDesC( ) );
-                }
-            else
-                {
-                InsertSubjectL( header, SmsMtmL()->Body() );
-                }
-
-            entry.ChangeL( msvEntry );
-            SmsMtmL()->SaveMessageL();
-            // Move it
-            copyId = MoveMessageEntryL( KMsvGlobalOutBoxIndexEntryId );
-            cantExit = EFalse;
-            }
-        else
-            {// Many recipients in array
-
-            // Own copy function for Emails
-            // This is because EmailOverSms messages can
-            // contain adresses longer than 21 digits
-            if ( IsEmailAddress( address ) )
-                {
-                copyId = CreateMessageInOutboxL(
-                msvEntry, address );
-
-                }
-            else // For MSISDN's
-                {
-                rcpt->SetAddressL( address );
-                if ( name.Length() )
-                    { // add name only if we have alias
-                    rcpt->SetNameL( name );
-                    }
-
-                copyId = CreateMessageInOutboxL(
-                    msvEntry, *rcpt, SmsMtmL()->Body());
-
-                SmsMtmL()->RemoveAddressee( 0 );
-                }
-            //If hundreds of recipient, make sure viewserver
-            //timers are reseted
-            if ( iRecipients->Count() > 100 && ( iRecipients->Count() ) % 30 == 0 )
-                {
-                User::ResetInactivityTime();
-                }
-
-            iRecipients->Delete(0);
-            }
-        if ( addressBuf )
-            {
-            CleanupStack::PopAndDestroy( addressBuf );
-            }
-
-        // let's add the entry id into the cmsventryselection
-        selection->AppendL( copyId );
-        }
-    CleanupStack::PopAndDestroy( rcpt );
-
-    //Let's free some memory
-    if ( iRecipients )
-        {
-        delete iRecipients;
-        iRecipients = NULL;
-        }
-
-    SetScheduledSendingStateL( selection );
-    CleanupStack::PopAndDestroy( selection );
-    }
-
-
-// ----------------------------------------------------------------------------
-// MoveMessageEntryL
-// @see header
-// ----------------------------------------------------------------------------
-TMsvId UniEditorSmsPluginPrivate::MoveMessageEntryL( TMsvId aTarget )
-    {
-    TMsvEntry msvEntry( SmsMtmL()->Entry().Entry() );
-    TMsvId id = msvEntry.Id();
-
-    if ( msvEntry.Parent() != aTarget )
-        {
-        TMsvSelectionOrdering sort;
-        sort.SetShowInvisibleEntries( ETrue );
-        CMsvEntry* parentEntry= CMsvEntry::NewL( *iSession, msvEntry.Parent(), sort );
-        CleanupStack::PushL( parentEntry );
-
-        // Copy original from the parent to the new location
-        CMuiuOperationWait* wait = CMuiuOperationWait::NewLC();
-
-        CMsvOperation* op = parentEntry->MoveL(
-            msvEntry.Id(),
-            aTarget,
-            wait->iStatus );
-
-        CleanupStack::PushL( op );
-        wait->Start();
-        TMsvLocalOperationProgress prog = McliUtils::GetLocalProgressL( *op );
-        User::LeaveIfError( prog.iError );
-
-        id = prog.iId;
-
-        CleanupStack::PopAndDestroy( op );
-        CleanupStack::PopAndDestroy( wait );
-        CleanupStack::PopAndDestroy( parentEntry );
-        }
-
-    return id;
-    }
-
-// ----------------------------------------------------------------------------
-// CreateMessageInOutboxL
-// Use this function for non-email messages
-// @see header
-// ----------------------------------------------------------------------------
-TMsvId UniEditorSmsPluginPrivate::CreateMessageInOutboxL(
-    const TMsvEntry& aEntry,
-    const CSmsNumber& aRecipient,
-    const CRichText& aBody )
-    {
-    // Initialize the richtext object
-    CRichText* richText = CRichText::NewL( iParaFormatLayer, iCharFormatLayer );
-    CleanupStack::PushL( richText );
-
-    // Initialise header and store
-    CSmsHeader* header = CSmsHeader::NewL( CSmsPDU::ESmsSubmit, *richText );
-    CleanupStack::PushL( header );
-    CMsvStore* sourceStore = SmsMtmL()->Entry().ReadStoreL();
-    CleanupStack::PushL( sourceStore );
-
-    // Read store
-    header->RestoreL( *sourceStore );
-
-    // Initialise number with parameters
-    CSmsNumber* rcpt = CSmsNumber::NewL( aRecipient );
-    CleanupStack::PushL( rcpt );
-    header->Recipients().ResetAndDestroy();
-    header->Recipients().AppendL( rcpt );
-    CleanupStack::Pop( rcpt );
-
-    // Create entry to Outbox
-    TMsvEntry entry( aEntry );
-    entry.iMtmData3 = KSmsPluginBioMsgUnparsed;
-    CMsvEntry* outbox = iSession->GetEntryL( KMsvGlobalOutBoxIndexEntryId );
-    CleanupStack::PushL( outbox );
-    outbox->CreateL( entry );
-    iSession->CleanupEntryPushL( entry.Id() );
-    outbox->SetEntryL( entry.Id());
-
-    //Initialize target store
-    CMsvStore* targetStore;
-    targetStore = outbox->EditStoreL();
-    CleanupStack::PushL( targetStore );
-
-    //Add attachment
-    MMsvAttachmentManager& attaManager = sourceStore->AttachmentManagerL();
-    RFile tmpFile;
-
-    //Check if attachment exists and add it
-    if( sourceStore->AttachmentManagerL().AttachmentCount() )
-    	{
-        tmpFile = attaManager.GetAttachmentFileL( 0 );
-    	CleanupClosePushL( tmpFile );
-
-    	MMsvAttachmentManager& targetAttaMan = targetStore->AttachmentManagerL();
-		CMsvAttachment* targetAtta = CMsvAttachment::NewL( CMsvAttachment::EMsvFile );
-		CleanupStack::PushL( targetAtta );
-
-        CMuiuOperationWait* waiter = CMuiuOperationWait::NewLC();
-		targetAttaMan.AddAttachmentL( tmpFile, targetAtta, waiter->iStatus );
-		waiter->Start();
-
-     	CleanupStack::PopAndDestroy( waiter ); //waiter
-		CleanupStack::Pop(targetAtta );// targetAtta
-		CleanupStack::Pop( &tmpFile );//tmpFile
-    	}
-
-    TInt totalLength( aBody.DocumentLength() );
-    HBufC* bodyText = HBufC::NewLC ( totalLength );
-    TPtr bodyTextPtr ( bodyText->Des() );
-
-    aBody.Extract( bodyTextPtr, 0, totalLength );
-    richText->InsertL( 0, bodyTextPtr );
-    CleanupStack::PopAndDestroy( bodyText );
-
-    InsertSubjectL( *header, *richText );
-
-    targetStore->StoreBodyTextL( *richText );
-
-    header->StoreL( *targetStore );
-    targetStore->CommitL();
-
-    // Usually SMCM takes care of updating iSize, but now when msg is
-    // created to Outbox for several recipients this has to be done manually.
-    entry.iSize = targetStore->SizeL();
-    entry.iRelatedId = iSmsServiceId;
-    entry.iServiceId = KMsvLocalServiceIndexEntryId;
-    outbox->ChangeL( entry );
-    CleanupStack::PopAndDestroy( targetStore );
-
-    iSession->CleanupEntryPop();
-    CleanupStack::PopAndDestroy( outbox );
-    CleanupStack::PopAndDestroy( sourceStore );
-    CleanupStack::PopAndDestroy( header );
-    CleanupStack::PopAndDestroy( richText );
-    return entry.Id();
-    }
-
-// ---------------------------------------------------------
-// CMsgSmsEditorAppUi::CreateMessageInOutboxL
-// Creates message in outbox in case of multiple recipients
-// with some e-mail over SMS addresses
-// ---------------------------------------------------------
-TMsvId UniEditorSmsPluginPrivate::CreateMessageInOutboxL(
-    const TMsvEntry& aEntry,
-    const TDesC& aAddress )
-    {
-    CRichText* richText = CRichText::NewL( iParaFormatLayer, iCharFormatLayer );
-    CleanupStack::PushL( richText );
-    // Initialise header and store
-    CSmsHeader* header = CSmsHeader::NewL( CSmsPDU::ESmsSubmit, *richText );
-    CleanupStack::PushL( header );
-    CMsvStore* store = SmsMtmL()->Entry().ReadStoreL();
-
-    CleanupStack::PushL( store );
-    // Read store
-    header->RestoreL( *store );
-    CleanupStack::PopAndDestroy( store );
-    // Initialise number
-    CSmsNumber* rcpt = CSmsNumber::NewL();
-    CleanupStack::PushL( rcpt );
-    header->Recipients().ResetAndDestroy();
-    // Save Email specific information in header
-    FillEmailInformationDataL( *header, aAddress );
-    // Fill the recipient data for Email
-    // Address = Email gateway
-    // Alias = The real address
-    rcpt->SetAddressL( iEmailOverSmsC->Address()  );
-    rcpt->SetNameL( aAddress ); // This takes only 21 chars
-
-    header->Recipients().AppendL( rcpt );
-    CleanupStack::Pop( rcpt );
-    // Create entry to Outbox
-    TMsvEntry entry( aEntry );
-    entry.iMtmData3 = KSmsPluginBioMsgUnparsed;
-
-    CMsvEntry* outbox = iSession->GetEntryL( KMsvGlobalOutBoxIndexEntryId );
-    CleanupStack::PushL( outbox );
-    outbox->CreateL( entry );
-    iSession->CleanupEntryPushL( entry.Id());
-    outbox->SetEntryL( entry.Id());
-    // Save
-    store = outbox->EditStoreL();
-    CleanupStack::PushL( store );
-    header->StoreL( *store );
-
-    richText->Reset();
-    richText->InsertL( 0 , SmsMtmL()->Body().Read( 0 ) );
-
-    store->StoreBodyTextL( *richText );
-    store->CommitL();
-    // Usually SMCM takes care of updating iSize, but now when msg is
-    // created to Outbox for several recipients this has to be done manually.
-    entry.iSize = store->SizeL();
-    entry.iRelatedId = iSmsServiceId;
-    entry.iServiceId = KMsvLocalServiceIndexEntryId;
-    outbox->ChangeL( entry );
-
-    CleanupStack::PopAndDestroy( store );
-    iSession->CleanupEntryPop();
-    CleanupStack::PopAndDestroy( outbox );
-    CleanupStack::PopAndDestroy( header );
-    CleanupStack::PopAndDestroy( richText );
-    return entry.Id();
-    }
-
-// ----------------------------------------------------------------------------
-// SetScheduledSendingStateL
-// @see header
-// ----------------------------------------------------------------------------
-void UniEditorSmsPluginPrivate::SetScheduledSendingStateL( CMsvEntrySelection* aSelection )
-    {
-    const TMsvEntry msvEntry = SmsMtmL()->Entry().Entry();
-    if ( msvEntry.SendingState() == KMsvSendStateWaiting )
-        {
-        // Add entry to task scheduler
-        TBuf8<1> dummyParams;
-
-        CMuiuOperationWait* waiter = CMuiuOperationWait::NewLC();
-        waiter->iStatus = KRequestPending;
-
-        CMsvOperation* op= SmsMtmL()->InvokeAsyncFunctionL(
-            ESmsMtmCommandScheduleCopy,
-            *aSelection,
-            dummyParams,
-            waiter->iStatus );
-        CleanupStack::PushL( op );
-        waiter->Start();
-
-        CleanupStack::PopAndDestroy( op );
-        CleanupStack::PopAndDestroy( waiter );
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// NameAndAddress
-// @see header
-// ----------------------------------------------------------------------------
-void UniEditorSmsPluginPrivate::NameAndAddress( const TDesC& aMsvAddress, TPtrC& aName, TPtrC& aAddress )
-    {
-    TInt addressStart = aMsvAddress.LocateReverse( KMsgSmsAddressStartChar );
-    TInt addressEnd = aMsvAddress.LocateReverse( KMsgSmsAddressEndChar );
-
-    if ( addressStart != KErrNotFound && addressEnd != KErrNotFound
-        && addressEnd > addressStart )
-        {
-        // verified address, will be used as selected from contacts manager
-        aName.Set( aMsvAddress.Ptr(), addressStart );
-        aAddress.Set(
-            aMsvAddress.Mid( addressStart + 1 ).Ptr(),
-            ( addressEnd - addressStart ) -1 );
-        if ( !aAddress.Length())
-            {
-            aAddress.Set( aName );
-            aName.Set( KNullDesC ); // empty string
-            }
-        }
-    else
-        {
-        // unverified string, will be used as entered in the header field
-        aName.Set( KNullDesC ); // empty string
-        aAddress.Set( aMsvAddress.Ptr(), aMsvAddress.Length() ); // a whole string to address
-        }
-
-    if ( aName.CompareF( aAddress ) == 0 )
-        {
-        aName.Set( KNullDesC ); // empty string
-        }
-    }
-
-// ----------------------------------------------------------------------------
-// UniEditorSmsPluginPrivate::ExtractDescriptionFromMessageL
-// @see header
-// ----------------------------------------------------------------------------
-void UniEditorSmsPluginPrivate::ExtractDescriptionFromMessageL(
-    const CSmsMessage& aMessage,
-    TDes& aDescription,
-    TInt aMaxLength)
-    {
-    // subject was already put in emailfields
-    HBufC* subject = SmsMtmL()->SmsHeader().EmailFields().Subject().AllocL();
-    if ( subject->Length() > 0 )
-        {
-        aDescription.Copy( *subject );
-        }
-    else
-        {// Extract from message body
-        aMessage.Buffer().Extract(
-            aDescription,
-            0,
-            Min(
-                aMaxLength,
-                aMessage.Buffer().Length()));
-        }
-
-    //replace paragraphs with spaces.
-    TBuf<KSmsEdExtrDescReplaceCharacterCount> replaceChars;
-    replaceChars.Zero();
-    replaceChars.Append( CEditableText::EParagraphDelimiter );
-    replaceChars.Append( KSmsEdUnicodeLFSupportedByBasicPhones );
-    replaceChars.Append( CEditableText::ELineBreak );
-    iGenUtils->ReplaceCharacters( aDescription, replaceChars, CEditableText::ESpace );
-    aDescription.Trim();
-    }
-
-// ----------------------------------------------------------------------------
-// CreatePlainTextSMSL
-// @see header
-// ----------------------------------------------------------------------------
-void UniEditorSmsPluginPrivate::CreatePlainTextSMSL( RFile& aFile)
-    {
-    RFileReadStream stream( aFile );
-    CleanupClosePushL( stream );
-
-    CPlainText::TImportExportParam param;
-    param.iForeignEncoding = KCharacterSetIdentifierUtf8;
-    param.iOrganisation = CPlainText::EOrganiseByParagraph;
-
-    CPlainText::TImportExportResult result;
-
-    SmsMtmL()->Body().ImportTextL( 0, stream, param, result );
-
-    CleanupStack::PopAndDestroy( &stream );
-    }
-
-// ----------------------------------------------------------------------------
-// InsertSubjectL
-// Insert subject for non email addresses into the body
-// ----------------------------------------------------------------------------
-void UniEditorSmsPluginPrivate::InsertSubjectL( CSmsHeader& aHeader, CRichText& aText  )
-    {
-    // subject was already put in emailfields
-    HBufC* subject = SmsMtmL()->SmsHeader().EmailFields().Subject().AllocL();
-    if ( ( subject->Length() > 0 ) && !iBioMsg )
-       {
-        CleanupStack::PushL(subject);
-        TInt writePosition = subject->Length()+2;//+2 for the parentesis
-
-        if ( subject->Locate( KUniSmsStartParenthesis )!= KErrNotFound ||
-            subject->Locate( KUniSmsEndParenthesis ) != KErrNotFound)
-            {
-            HBufC* modifiableSubject = subject->Alloc();
-            CleanupStack::PushL(modifiableSubject);
-            TPtr ptr = modifiableSubject->Des();
-
-            TBuf<1> replaceChars;
-            replaceChars.Zero();
-            replaceChars.Append( KUniSmsStartParenthesis );
-            // Replace '(' chars with '<'
-            iGenUtils->ReplaceCharacters( ptr, replaceChars, TChar('<') );
-
-            replaceChars.Zero();
-            replaceChars.Append( KUniSmsEndParenthesis );
-            // Replace ')' chars with '>'
-            iGenUtils->ReplaceCharacters( ptr, replaceChars, TChar('>') );
-
-            aText.InsertL( 0, KUniSmsStartParenthesis );
-            aText.InsertL( 1, ptr );
-            aText.InsertL( writePosition-1, KUniSmsEndParenthesis );
-            CleanupStack::PopAndDestroy( modifiableSubject );
-            }
-        else
-            {
-            aText.InsertL( 0, KUniSmsStartParenthesis );
-            aText.InsertL( 1, *subject );
-            aText.InsertL( writePosition-1, KUniSmsEndParenthesis );
-            }
-        }
-
-    // Clears the CSmsHeaders EmailFields for non Email addresses
-    CSmsEmailFields* emailFields = CSmsEmailFields::NewL();
-    CleanupStack::PushL( emailFields );
-    aHeader.SetEmailFieldsL( *emailFields );
-    CleanupStack::PopAndDestroy( emailFields );
-    }
-
-// ----------------------------------------------------------------------------
-// CreateVCardSMS
-// @see header
-// ----------------------------------------------------------------------------
-void UniEditorSmsPluginPrivate::CreateVCardSMSL( RFile& aFile )
-    {
-    TInt fileSize;
-    TInt err ( aFile.Size( fileSize ) );
-    User::LeaveIfError(err);
-
-    // Create two buffers: 8-bit for reading from file and 16-bit for
-    // converting to 16-bit format
-    HBufC8* buf8 = HBufC8::NewLC( fileSize );
-    TPtr8 ptr8 = buf8->Des();
-    HBufC16* buf16 = HBufC16::NewLC( fileSize );
-    TPtr16 ptr16 = buf16->Des();
-
-    for (TInt err = aFile.Read(ptr8);
-        ptr8.Length() > 0;
-        err = aFile.Read(ptr8))
-        {
-        User::LeaveIfError(err);
-        ptr16.Copy(ptr8);
-        SmsMtmL()->Body().InsertL(SmsMtmL()->Body().DocumentLength(), ptr16);
-        }
-
-    // Cleanup and return
-    CleanupStack::PopAndDestroy( buf16 );
-    CleanupStack::PopAndDestroy( buf8 );
-    }
-
-// ----------------------------------------------------------------------------
-// CreateVCalSMS
-// @see header
-// ----------------------------------------------------------------------------
-void UniEditorSmsPluginPrivate::CreateVCalSMSL( RFile& aFile )
-    {
-    TInt err (KErrNone);
-    TInt fileSize;
-    err = aFile.Size( fileSize );
-    User::LeaveIfError(err);
-
-    HBufC8* buf8 = HBufC8::NewLC( fileSize );
-    TPtr8 ptr8 = buf8->Des();
-
-    err = aFile.Read( ptr8 );
-    User::LeaveIfError(err);
-
-    HBufC16* buf16 = HBufC16::NewLC( fileSize );
-    TPtr16 ptr16 = buf16->Des();
-
-    ptr16.Copy(ptr8);
-    SmsMtmL()->Body().InsertL(0, ptr16);
-
-    CleanupStack::PopAndDestroy( buf16 );
-    CleanupStack::PopAndDestroy( buf8 );
-    }
-
-// ----------------------------------------------------------------------------
-// UniEditorSmsPluginPrivate::ValidateSCNumberL
-// @see header
-// ----------------------------------------------------------------------------
-TBool UniEditorSmsPluginPrivate::ValidateSCNumberL()
-    {
-    TBool valid( EFalse );
-    CSmsAccount* smsAccount = CSmsAccount::NewLC();
-    CSmsSettings* settings = CSmsSettings::NewLC();
-    
-    smsAccount->LoadSettingsL(*settings);
-
-    int serviceCenterCount = settings->ServiceCenterCount();
-    
-    if( serviceCenterCount > 0 )
-    {
-      TInt defaultIndex = settings->DefaultServiceCenter();
-      if( settings->GetServiceCenter(defaultIndex).Address().Length() > 0 )
-      {
-          valid = ETrue;    
-      }
-    }
-    else if(settings->ReplyPath())    
-    {
-        valid = ETrue;
-    }
-    
-    CleanupStack::PopAndDestroy(2);
-    return valid;
-    }
-
-// ---------------------------------------------------------
-// UniEditorSmsPluginPrivate::ValidateSCNumberForEmailOverSmsL
-// @see header
-// ---------------------------------------------------------
-TBool UniEditorSmsPluginPrivate::ValidateSCNumberForEmailOverSmsL()
-    {
-    TBool confNeeded( EFalse );
-    // Read the email settings
-    TBuf<KUniSmsSCStringLength> emailSmscNumber;
-    TBuf<KUniSmsSCStringLength> emailGateWayNumber;
-    TBool notUsed( EFalse );
-    // The file may not exist
-    TInt readResult = iGenUtils->ReadEmailOverSmsSettingsL(
-                        emailSmscNumber,
-                        emailGateWayNumber,
-                        notUsed );
-    if ( KErrNone == readResult )
-        {
-        // Check that both have valid values
-        // In any otther case we need to show the conf pop-up window
-        if ( emailSmscNumber != KNullDesC && emailGateWayNumber != KNullDesC)
-            {
-            confNeeded = ETrue;
-            }
-        }
-
-	return confNeeded;
-    }
-
-// ---------------------------------------------------------
-// UniEditorSmsPluginPrivate::FillEmailInformationDataL
-// @see header
-// ---------------------------------------------------------
-void UniEditorSmsPluginPrivate::FillEmailInformationDataL(
-    CSmsHeader& aHeader,
-    const TPtrC& aAddress )
-    {
-    CSmsEmailFields* emailFields = CSmsEmailFields::NewL();
-    CleanupStack::PushL( emailFields );
-
-    // The Email SMSC may differ from sms SMSC
-    aHeader.Message().SetServiceCenterAddressL( iEmailOverSmsC->Name() );
-
-    // Check if there is need to save as EmailFieds with header
-    if ( aAddress.Length() )
-        {
-        // Set the address
-        emailFields->AddAddressL( aAddress );
-        }
-
-    // subject was already put in emailfields
-    HBufC* subject = SmsMtmL()->SmsHeader().EmailFields().Subject().AllocL();
-    if ( subject->Length() > 0 )
-        { // Handle the subject
-        CleanupStack::PushL( subject );
-        TPtr text = subject->Des();
-
-        TBuf<1> replaceChars;
-        replaceChars.Zero();
-        replaceChars.Append( KUniSmsStartParenthesis );
-        // Replace '(' chars with '<'
-        iGenUtils->ReplaceCharacters( text, replaceChars, TChar('<') );
-
-        replaceChars.Zero();
-        replaceChars.Append( KUniSmsEndParenthesis );
-        // Replace ')' chars with '>'
-        iGenUtils->ReplaceCharacters( text, replaceChars, TChar('>') );
-
-        // For Emails save it to CSmsEmailFields
-        emailFields->SetSubjectL( text );
-        CleanupStack::PopAndDestroy( subject );
-        }
-
-    aHeader.SetEmailFieldsL( *emailFields );
-    CleanupStack::PopAndDestroy( emailFields );
-    }
-
-
-
-// ----------------------------------------------------
-//  UniEditorSmsPluginPrivate::IsEmailAddress()
-// @see header
-// ----------------------------------------------------
-TBool UniEditorSmsPluginPrivate::IsEmailAddress( const TPtrC& aAddress ) const
-    {
-    TBool isEmailAddress( EFalse );
-    if (  aAddress.Locate('@')  != KErrNotFound)
-        {
-        isEmailAddress = ETrue;
-        }
-    return isEmailAddress;
-    }
-
-//------------------------------------------------------------------------------
-// UniEditorSmsPluginPrivate::SetEncodingSetings
-// Turkish SMS-PREQ2265 Specific
-// To Set encoding settings like encoding type, character support
-// and alternative encoding if any
-//
-// IMPORTANT NOTE:
-// This function is usually called from UniEditorAppUI to reset/set alternative
-// encoding or char support
-// when corresponding feilds change. Hence aUnicodeMode is always set to false
-//------------------------------------------------------------------------------
-void UniEditorSmsPluginPrivate::SetEncodingSettings( TBool aUnicodeMode, TSmsEncoding aAlternativeEncodingType, TInt aCharSupportType)
-    {
-    TSmsUserDataSettings smsSettings;
-    CSmsMessage& smsMsg = iSmsHeader->Message();
-
-    iUnicodeMode = aUnicodeMode;
-    iCharSupportType = aCharSupportType;
-    iAlternativeEncodingType = aAlternativeEncodingType;
-
-    if(iUnicodeMode)
-        {
-        smsSettings.SetAlphabet( TSmsDataCodingScheme::ESmsAlphabetUCS2 );
-        }
-    else
-        {
-        smsSettings.SetAlphabet( TSmsDataCodingScheme::ESmsAlphabet7Bit );
-        }
-    smsSettings.SetTextCompressed( EFalse );
-    smsMsg.SetUserDataSettingsL( smsSettings );
-    //First try without any alternate encoding
-    smsMsg.SetAlternative7bitEncoding( aAlternativeEncodingType );
-    }
-
-//------------------------------------------------------------------------------
-// UniEditorSmsPluginPrivate::GetNumPDUs
-// Turkish SMS-PREQ2265 Specific
-// To get PDU Info: extracts details of number of PDUs, number of remaining
-// chars in last PDU
-// and encoding types used.
-//------------------------------------------------------------------------------
-void UniEditorSmsPluginPrivate::GetNumPDUsL(
-        TDesC& aBuf,
-        TInt& aNumOfRemainingChars,
-        TInt& aNumOfPDUs,
-        TBool& aUnicodeMode,
-        TSmsEncoding & aAlternativeEncodingType )
-    {
-    TInt numOfUnconvChars, numOfDowngradedChars, isAltEncSupported;
-    TSmsEncoding currentAlternativeEncodingType;
-
-    CSmsMessage& smsMsg = iSmsHeader->Message();
-
-    // need to set the input buffer to SMS buffer through iRichText(which is reference to SMS Buffer object)
-    iRichText->Reset();
-    iRichText->InsertL(0, aBuf);
-
-    //call SMS stack API to get PDU info
-    smsMsg.GetEncodingInfoL( aNumOfPDUs, numOfUnconvChars, numOfDowngradedChars, aNumOfRemainingChars );
-
-    //Algo to switch to Unicode if required
-    while( (numOfUnconvChars || numOfDowngradedChars) && !iUnicodeMode )
-        {
-        currentAlternativeEncodingType = smsMsg.Alternative7bitEncoding();
-        if( currentAlternativeEncodingType != iAlternativeEncodingType )
-            {
-            //try with this new alternative encoding type
-            isAltEncSupported = smsMsg.SetAlternative7bitEncoding( iAlternativeEncodingType );
-            if( isAltEncSupported == KErrNotSupported )
-                {
-                // if required alternative encoding plugin is not supported, retain the existing encoding mechanism.
-                iAlternativeEncodingType = currentAlternativeEncodingType;
-                continue;
-                }
-            }
-        else if( numOfUnconvChars )
-            {
-            //switch to Unicode
-            //iUnicodeMode = ETrue;
-            SetEncodingSettings( ETrue, iAlternativeEncodingType, TUniSendingSettings::EUniCharSupportFull);
-            }
-        else
-            {
-            //Get out of while loop and return the results
-            break;
-            }
-        //get the PDU info with new settings
-        iRichText->Reset();
-        iRichText->InsertL(0, aBuf);
-        smsMsg.GetEncodingInfoL( aNumOfPDUs, numOfUnconvChars, numOfDowngradedChars, aNumOfRemainingChars );
-        }
-
-    /*
-     * Enable the below code to debug if something wrong with characters sent even in unicode mode
-     */
-    /*
-    If((numOfUnconvChars || numOfDowngradedChars) && iUnicodeMode)
-        UNILOGGER_WRITEF("GOTCHA... some chars are not convertable in unicode mode as well...????");
-    */
-    aUnicodeMode = iUnicodeMode;
-    aAlternativeEncodingType = iAlternativeEncodingType;
-    if(iUnicodeMode)
-        {
-        //In case of Unicode mode, SMS Stack returns number of available free User Data units.
-        //Need to convert them w.r.t characters(each char takse 2 UD units).
-        aNumOfRemainingChars = aNumOfRemainingChars/2;
-        }
-    }
-
-// ----------------------------------------------------
-//  UniEditorSmsPluginPrivate::DeleteDraftsEntryL()
-// @see header
-// ----------------------------------------------------
-void UniEditorSmsPluginPrivate::DeleteDraftsEntryL( TMsvId aId )
-    {
-    CMsvEntry* pEntry = iSession->GetEntryL(KMsvDraftEntryIdValue);
-    CleanupStack::PushL(pEntry);
-    pEntry->DeleteL( aId );
-    CleanupStack::PopAndDestroy(pEntry);
-    }
-
-//  End of File
--- a/messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/tsrc/bwins/test_sms_pluginu.def	Fri Apr 16 14:56:15 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/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/1000102C.txt has changed
Binary file messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/100058DB.txt has changed
Binary file messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/101FB0D5.txt has changed
Binary file messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/101FB0D9.txt has changed
Binary file messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/cccccc00.cre has changed
--- a/messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/ced_simtsy.cfg	Fri Apr 16 14:56:15 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/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/sms.rsc has changed
--- a/messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/testmsg.h	Fri Apr 16 14:56:15 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 <s60qconversions.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 = S60QConversions::qStringToS60Desc(serviceCenter01);
-    HBufC* sC02 = S60QConversions::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 = S60QConversions::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 = S60QConversions::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 = S60QConversions::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 = S60QConversions::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 = S60QConversions::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/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/testsmsplugin.cpp	Fri Apr 16 14:56:15 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/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/testsmsplugin.h	Fri Apr 16 14:56:15 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/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/testsmsplugin.ini	Fri Apr 16 14:56:15 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/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/testsmsplugin.pro	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +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 += ../../../../s60qconversions/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
-	}
-    
- LIBS += -leuser \
-    -lconvergedmessageutils \
-    -ls60qconversions \
-    -lMsgMedia \
-    -lunieditorutils \
-    -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 
--- a/messagingapp/msgutils/unieditorplugins/unieditorsmsplugin/unieditorsmsplugin.pro	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +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:
-#
-#
-
-TEMPLATE = lib
-
-TARGET = $$qtLibraryTarget(unieditorsmsplugin)
-TARGET.CAPABILITY = All -TCB
-TARGET.EPOCALLOWDLLDATA = 1
-
-# UID 3
-TARGET.UID3 = 0x102072DA
-
-INCLUDEPATH += ../../s60qconversions/inc
-INCLUDEPATH += ../../unieditorutils/inc
-INCLUDEPATH += ../../../../inc
-INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-
-SYMBIAN_PLATFORMS = WINSCW \
-    ARMV5
-
-CONFIG += plugin
-
-# Input
-HEADERS += inc/sessioneventhandler.h \
-    inc/unieditorsmsplugin.h \
-    inc/unieditorsmsplugin_p.h
-    
-SOURCES += src/sessioneventhandler.cpp \
-    src/unieditorsmsplugin.cpp \
-    src/unieditorsmsplugin_p.cpp
-
-# Build.inf rules
-BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
-    "rom/unieditorsmsplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(unieditorsmsplugin.iby)"
-
-LIBS += -leuser \
-    -lconvergedmessageutils \
-    -ls60qconversions \
-    -lMsgMedia \
-    -lunieditorutils \
-    -lcone \
-    -leikcoctl \
-    -leikcore \
-    -leikdlg \
-    -lmsgs \
-    -letext \
-    -lgsmu \
-    -lmmsgenutils \
-    -lefsrv \
-    -lestor \
-    -lsmcm \
-    -lCommonEngine \
-    -lbafl \
-    -lCdlEngine \
-    -lFeatMgr \
-    -lapmime
-
-# plugin stub deployment
-plugin.sources = unieditorsmsplugin.dll
-plugin.path = \resource\qt\plugins\messaging\editorplugins
-DEPLOYMENT += plugin
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/bwins/editorgenutilsu.def	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,29 @@
+EXPORTS
+	?absoluteMaxSmsCharactersL@UniEditorGenUtils@@AAEHXZ @ 1 NONAME ; int UniEditorGenUtils::absoluteMaxSmsCharactersL(void)
+	??0UniEditorGenUtils@@QAE@XZ @ 2 NONAME ; UniEditorGenUtils::UniEditorGenUtils(void)
+	??0CMuiuOperationWait@@IAE@H@Z @ 3 NONAME ; CMuiuOperationWait::CMuiuOperationWait(int)
+	?MaxSmsRecipientsL@UniEditorGenUtils@@QAEHXZ @ 4 NONAME ; int UniEditorGenUtils::MaxSmsRecipientsL(void)
+	?Start@CMuiuOperationWait@@QAEXXZ @ 5 NONAME ; void CMuiuOperationWait::Start(void)
+	?getSmsCharacterLimits@UniEditorGenUtils@@AAEXAAH0_N@Z @ 6 NONAME ; void UniEditorGenUtils::getSmsCharacterLimits(int &, int &, bool)
+	?MaxSmsMsgSizeL@UniEditorGenUtils@@QAEH_N@Z @ 7 NONAME ; int UniEditorGenUtils::MaxSmsMsgSizeL(bool)
+	?DoCancel@CMuiuOperationWait@@MAEXXZ @ 8 NONAME ; void CMuiuOperationWait::DoCancel(void)
+	?MaxMmsMsgSizeL@UniEditorGenUtils@@QAEHXZ @ 9 NONAME ; int UniEditorGenUtils::MaxMmsMsgSizeL(void)
+	??_ECMuiuOperationWait@@UAE@I@Z @ 10 NONAME ; CMuiuOperationWait::~CMuiuOperationWait(unsigned int)
+	?ReplaceCharacters@UniEditorGenUtils@@QAEXAAVTDes16@@ABVTDesC16@@VTChar@@@Z @ 11 NONAME ; void UniEditorGenUtils::ReplaceCharacters(class TDes16 &, class TDesC16 const &, class TChar)
+	?NumberToBase@UniEditorGenUtils@@QAE?AVTChar@@V2@@Z @ 12 NONAME ; class TChar UniEditorGenUtils::NumberToBase(class TChar)
+	?ConvertDigitsTo@UniEditorGenUtils@@QAEXAAVTDes16@@W4TDigitType@@@Z @ 13 NONAME ; void UniEditorGenUtils::ConvertDigitsTo(class TDes16 &, enum TDigitType)
+	?NewLC@CMuiuOperationWait@@SAPAV1@H@Z @ 14 NONAME ; class CMuiuOperationWait * CMuiuOperationWait::NewLC(int)
+	?RunL@CMuiuOperationWait@@MAEXXZ @ 15 NONAME ; void CMuiuOperationWait::RunL(void)
+	?getFileInfoL@UniEditorGenUtils@@QAEXVQString@@AAHAAV2@AAW4TMsgMediaType@@@Z @ 16 NONAME ; void UniEditorGenUtils::getFileInfoL(class QString, int &, class QString &, enum TMsgMediaType &)
+	?MaxMmsRecipientsL@UniEditorGenUtils@@QAEHXZ @ 17 NONAME ; int UniEditorGenUtils::MaxMmsRecipientsL(void)
+	??1CMuiuOperationWait@@UAE@XZ @ 18 NONAME ; CMuiuOperationWait::~CMuiuOperationWait(void)
+	?VerifyEmailAddressesL@UniEditorGenUtils@@QAEHV?$QList@PAVConvergedMessageAddress@@@@@Z @ 19 NONAME ; int UniEditorGenUtils::VerifyEmailAddressesL(class QList<class ConvergedMessageAddress *>)
+	?WriteEmailOverSmsSettingsL@UniEditorGenUtils@@QAEHABVTDes16@@0ABH@Z @ 20 NONAME ; int UniEditorGenUtils::WriteEmailOverSmsSettingsL(class TDes16 const &, class TDes16 const &, int const &)
+	?ReadEmailOverSmsSettingsL@UniEditorGenUtils@@QAEHAAVTDes16@@0AAH@Z @ 21 NONAME ; int UniEditorGenUtils::ReadEmailOverSmsSettingsL(class TDes16 &, class TDes16 &, int &)
+	?absoluteMaxSmsPartsL@UniEditorGenUtils@@AAEHXZ @ 22 NONAME ; int UniEditorGenUtils::absoluteMaxSmsPartsL(void)
+	?UTF8Size@UniEditorGenUtils@@QAEHVQString@@@Z @ 23 NONAME ; int UniEditorGenUtils::UTF8Size(class QString)
+	?IsValidEmailAddress@UniEditorGenUtils@@QAEHVQString@@@Z @ 24 NONAME ; int UniEditorGenUtils::IsValidEmailAddress(class QString)
+	?IsPhoneOfflineL@UniEditorGenUtils@@QAEHXZ @ 25 NONAME ; int UniEditorGenUtils::IsPhoneOfflineL(void)
+	??1UniEditorGenUtils@@QAE@XZ @ 26 NONAME ; UniEditorGenUtils::~UniEditorGenUtils(void)
+	?AcceptEmailAddressesL@UniEditorGenUtils@@QAEHXZ @ 27 NONAME ; int UniEditorGenUtils::AcceptEmailAddressesL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/bwins/unieditorpluginloaderu.def	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,6 @@
+EXPORTS
+	??1UniEditorPluginLoader@@UAE@XZ @ 1 NONAME ; UniEditorPluginLoader::~UniEditorPluginLoader(void)
+	??0UniEditorPluginLoader@@QAE@PAVQObject@@@Z @ 2 NONAME ; UniEditorPluginLoader::UniEditorPluginLoader(class QObject *)
+	?getUniEditorPlugin@UniEditorPluginLoader@@QAEPAVUniEditorPluginInterface@@W4MessageType@ConvergedMessage@@@Z @ 3 NONAME ; class UniEditorPluginInterface * UniEditorPluginLoader::getUniEditorPlugin(enum ConvergedMessage::MessageType)
+	??_EUniEditorPluginLoader@@UAE@I@Z @ 4 NONAME ; UniEditorPluginLoader::~UniEditorPluginLoader(unsigned int)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/eabi/editorgenutilsu.def	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,35 @@
+EXPORTS
+	_ZN17UniEditorGenUtils12NumberToBaseE5TChar @ 1 NONAME
+	_ZN17UniEditorGenUtils12getFileInfoLE7QStringRiRS0_R13TMsgMediaType @ 2 NONAME
+	_ZN17UniEditorGenUtils14MaxMmsMsgSizeLEv @ 3 NONAME
+	_ZN17UniEditorGenUtils14MaxSmsMsgSizeLEb @ 4 NONAME
+	_ZN17UniEditorGenUtils15ConvertDigitsToER6TDes1610TDigitType @ 5 NONAME
+	_ZN17UniEditorGenUtils15IsPhoneOfflineLEv @ 6 NONAME
+	_ZN17UniEditorGenUtils17MaxMmsRecipientsLEv @ 7 NONAME
+	_ZN17UniEditorGenUtils17MaxSmsRecipientsLEv @ 8 NONAME
+	_ZN17UniEditorGenUtils17ReplaceCharactersER6TDes16RK7TDesC165TChar @ 9 NONAME
+	_ZN17UniEditorGenUtils19IsValidEmailAddressE7QString @ 10 NONAME
+	_ZN17UniEditorGenUtils20absoluteMaxSmsPartsLEv @ 11 NONAME
+	_ZN17UniEditorGenUtils21AcceptEmailAddressesLEv @ 12 NONAME
+	_ZN17UniEditorGenUtils21VerifyEmailAddressesLE5QListIP23ConvergedMessageAddressE @ 13 NONAME
+	_ZN17UniEditorGenUtils21getSmsCharacterLimitsERiS0_b @ 14 NONAME
+	_ZN17UniEditorGenUtils25ReadEmailOverSmsSettingsLER6TDes16S1_Ri @ 15 NONAME
+	_ZN17UniEditorGenUtils25absoluteMaxSmsCharactersLEv @ 16 NONAME
+	_ZN17UniEditorGenUtils26WriteEmailOverSmsSettingsLERK6TDes16S2_RKi @ 17 NONAME
+	_ZN17UniEditorGenUtils8UTF8SizeE7QString @ 18 NONAME
+	_ZN17UniEditorGenUtilsC1Ev @ 19 NONAME
+	_ZN17UniEditorGenUtilsC2Ev @ 20 NONAME
+	_ZN17UniEditorGenUtilsD1Ev @ 21 NONAME
+	_ZN17UniEditorGenUtilsD2Ev @ 22 NONAME
+	_ZN18CMuiuOperationWait4RunLEv @ 23 NONAME
+	_ZN18CMuiuOperationWait5NewLCEi @ 24 NONAME
+	_ZN18CMuiuOperationWait5StartEv @ 25 NONAME
+	_ZN18CMuiuOperationWait8DoCancelEv @ 26 NONAME
+	_ZN18CMuiuOperationWaitC1Ei @ 27 NONAME
+	_ZN18CMuiuOperationWaitC2Ei @ 28 NONAME
+	_ZN18CMuiuOperationWaitD0Ev @ 29 NONAME
+	_ZN18CMuiuOperationWaitD1Ev @ 30 NONAME
+	_ZN18CMuiuOperationWaitD2Ev @ 31 NONAME
+	_ZTI18CMuiuOperationWait @ 32 NONAME
+	_ZTV18CMuiuOperationWait @ 33 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/eabi/unieditorpluginloaderu.def	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,10 @@
+EXPORTS
+	_ZN21UniEditorPluginLoader18getUniEditorPluginEN16ConvergedMessage11MessageTypeE @ 1 NONAME
+	_ZN21UniEditorPluginLoaderC1EP7QObject @ 2 NONAME
+	_ZN21UniEditorPluginLoaderC2EP7QObject @ 3 NONAME
+	_ZN21UniEditorPluginLoaderD0Ev @ 4 NONAME
+	_ZN21UniEditorPluginLoaderD1Ev @ 5 NONAME
+	_ZN21UniEditorPluginLoaderD2Ev @ 6 NONAME
+	_ZTI21UniEditorPluginLoader @ 7 NONAME
+	_ZTV21UniEditorPluginLoader @ 8 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/editorgenutils/editorgenutils.pro	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,60 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+#
+
+TEMPLATE = lib
+TARGET = editorgenutils
+DEPENDPATH += . inc src
+
+INCLUDEPATH += .
+INCLUDEPATH += ../../../../inc
+INCLUDEPATH += ../../s60qconversions/inc
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+DEFINES += BUILD_MUIU_UITLS_DLL
+#QMAKE_CXXFLAGS.ARMCC -= --no_hide_all
+
+# UID3
+TARGET.UID3 = 0x2001FE70
+
+# Capability
+TARGET.CAPABILITY = CAP_GENERAL_DLL
+
+TARGET.EPOCALLOWDLLDATA = 1
+
+# Platforms
+SYMBIAN_PLATFORMS = WINSCW ARMV5
+
+# Build.inf rules
+BLD_INF_RULES.prj_exports += \
+     "$${LITERAL_HASH}include <platform_paths.hrh>" \
+     "rom/editorgenutils.iby  CORE_APP_LAYER_IBY_EXPORT_PATH(editorgenutils.iby)"
+
+# Input
+HEADERS += inc/MuiuOperationWait.h \
+    inc/UniEditorGenUtils.h
+    
+SOURCES += src/MuiuOperationWait.cpp \
+    src/UniEditorGenUtils.cpp
+
+LIBS += -leuser \
+    -lCentralRepository \
+    -lconvergedmessageutils \
+    -lsssettings \
+    -ls60qconversions \
+    -lMsgMedia \
+    -lapmime
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/editorgenutils/inc/MuiuOperationWait.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,57 @@
+/*
+ * 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: Allows a synchronous wait on a operation
+ *
+ */
+
+#ifndef __MUIUOPERATIONWAIT_H__
+#define __MUIUOPERATIONWAIT_H__
+
+//  INCLUDES
+#include "muiuutilsdefines.h"
+#include <e32base.h>
+#include <e32const.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+// CLASS DECLARATION
+/**
+*
+* Deprecated! Use internal CMsgOperationWait instead!
+*
+* Allows a synchronous wait on a operation.
+*/
+class MUIU_UTILS_EXPORT CMuiuOperationWait: public CActive
+    {
+    public:
+        static CMuiuOperationWait* NewLC( TInt aPriority = EPriorityStandard );
+        ~CMuiuOperationWait();
+        void Start();
+    protected:
+        CMuiuOperationWait( TInt aPriority );
+        void RunL();
+        void DoCancel();
+    protected:
+        CActiveSchedulerWait iWait;
+    };
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif //__MUIUOPERATIONWAIT_H__
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/editorgenutils/inc/UniEditorGenUtils.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,239 @@
+/*
+ * 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: General utilities for unified editor and plugin
+ *
+ */
+
+#ifndef __UNIEDITOR_GEN_UTILS_H__
+#define __UNIEDITOR_GEN_UTILS_H__
+
+//  INCLUDES
+#include <e32base.h>
+#include <e32const.h>
+#include "muiuutilsdefines.h"
+#include "convergedmessage.h"
+#include "MsgMedia.hrh"
+
+const TInt KDefaultMaxSmsSize = 10;
+// Length of one 7bit normal sms
+const TInt KFirstNormalSmsLength = 160;
+// Length of one unicode sms
+const TInt KFirstUnicodeSmsLength = 70;
+// Submsg length for normal 7bit sms
+const TInt KNormalConcatenationInterval = 153;
+// Submsg length for unicode sms
+const TInt KUnicodeConcatenationInterval = 67;
+
+const TInt KMaxSmsSizeByStandard = 30;
+const TInt KDefaultSmsRecipients = 20;
+const TInt KDefaultMmsRecipients = 100;
+const TInt KDefaultMaxSize = 300 * 1024;
+const TInt KEstimatedMmsSmilHeaderSize = 2.4 * 1024; // 1Kb buffer for mime headers + 1.4Kb for smil  
+const TInt KEstimatedMimeHeaderSize = 1400; 
+
+class CMsgMediaResolver;
+
+// CLASS DECLARATION
+class MUIU_UTILS_EXPORT UniEditorGenUtils
+    {
+
+      public:
+
+      explicit UniEditorGenUtils();
+
+      ~UniEditorGenUtils();
+
+      public:
+        /**
+        * Returns the current Email-over-Sms settings
+        * @param aSmsc
+        * @param aDestinationAddress
+        * @param aModifiable
+        * @return                   Symbian OS standard error code
+        */
+        TInt ReadEmailOverSmsSettingsL(
+            TDes& aSmsc,
+            TDes& aDestinationAddress,
+            TBool& aModifiable );
+
+        /**
+        * Writes the current Email-over-Sms settings to file
+        * @param aSmsc service centre, used for Email over Sms
+        * @param aDestinationAddress service number, used for Email over Sms
+        * @param aModifiable to check if user is allowed to modify setting
+        * @return                   Symbian OS standard error code
+        */
+        TInt WriteEmailOverSmsSettingsL(
+            const TDes& aSmsc,
+            const TDes& aDestinationAddress,
+            const TBool& aModifiable );
+
+        /**
+        * Checks if phone is in offline mode or not
+        * Make sure that offline feature has been checked
+        * using feature manager
+        * @return ETrue if phone is in offline mode, otherwise EFalse.
+        */
+        TBool IsPhoneOfflineL();
+
+        /**
+         * Checks if email addresses are supported over sms message type
+         * using feature manager
+         * @return ETrue if emailoversms is suppoted
+         */
+        TBool AcceptEmailAddressesL();
+
+        /**
+         * Checks if the given addresslist contains a valid email address
+         * @param addr converged message address list
+         * @return ETrue if list contains a valid email address
+         */
+        TBool VerifyEmailAddressesL( ConvergedMessageAddressList addr);
+        
+       /** 
+        * Gets byte-size of UTF8 formatted text
+        * @param aText
+        * @return Size of text in bytes
+        */
+        TInt UTF8Size( QString aText );
+        
+        /**
+         * Get maximum recipient count for sms from feature manager
+         * @return max recipient count
+         */
+        TInt MaxSmsRecipientsL();
+        
+        /**
+         * Get maximum recipient count for mms from feature manager
+         * @return max recipient count
+         */
+        TInt MaxMmsRecipientsL();
+        
+        /**
+         * Checks if a given address string is a valid email address
+         * @param addr address string
+         * @return ETrue if addr is valid email address
+         */
+        TBool IsValidEmailAddress( QString addr );
+        
+        /**
+         * Calculates the size of the given message
+         * @param msg ConvergedMessage
+         * @return size of the converged message
+         */
+        TInt CalculateMsgSize(ConvergedMessage& msg);
+
+        /**
+         * Get the maximum size allowed for mms
+         * using feature manager
+         * @return max mms size
+         */
+        TInt MaxMmsMsgSizeL();
+        
+        /**
+         * get file's size and mimetype info
+         * @param filePath IN path of file
+         * @param size OUT size of the given file
+         * Size includes filesize + max mime headers size
+         * @param mimetype OUT mimetype of the given file
+         * @param mediaType OUT media-type grouping of mimetype
+         */
+        void getFileInfoL(QString filePath,
+                        int& size,
+                        QString& mimetype,
+                        TMsgMediaType& mediaType);
+        
+        /**
+         * get max sms size limit from feature manager
+         * @param unicode if set to true limits 
+         *                 will be based on Unicode charset
+         * @return max sms size limit
+         */
+        int MaxSmsMsgSizeL(bool unicode=false);
+        
+        /**
+         * Convert digits from any digit format to another format eg. from
+         * european digits to arabic-indic digits.
+         * @param aDes        Parameter to change. It can contain digits
+         *                    from several digit types.
+         * @param aDigitType  Destination digit type.
+         */
+        void ConvertDigitsTo( TDes& aDes, TDigitType aDigitType );
+        
+        /**
+         * Identifies the digit format
+         * @param ch    digit, whose format is to be recognized
+         * @return      digit format
+         */
+        TChar NumberToBase(TChar ch);
+
+        /**
+         * Replace all control chars with a single character,
+         * usually a whitespace.
+         * @param   aDes         Parameter to change
+         * @param   aCharacters  A set of characters to remove
+         * @param   aReplacement A character used as replacement
+         */
+        void ReplaceCharacters(TDes &aDes, const TDesC &aChars, TChar aReplacement);
+
+      private:
+          /**
+           * get sms character limits from feature manager
+           * @param singlePartLength length of one part
+           * @param concatenatedPartLength total length over all parts
+           * @param unicode if set to true limits 
+           *                 will be based on Unicode charset
+           */
+          void getSmsCharacterLimits(int& singlePartLength, 
+              int& concatenatedPartLength,
+              bool unicode);
+          
+          /**
+           * get the maximum number of parts for sms
+           * using feature manager
+           * @return max number of parts for the sms
+           */
+          int absoluteMaxSmsPartsL();
+          
+          /**
+           * get the character limit for sms
+           * using feature manager
+           * @return sms character limit 
+           */
+          int absoluteMaxSmsCharactersL();
+          
+      private: //data
+          /**
+           * Read only once for optimization purpose
+           * Max number of parts allowed for sms msgs
+           */
+          int mAbsMaxConcatenatedSms;
+          
+          /**
+           * Read only once for optimization purpose
+           * Character limit for sms msgs
+           */
+          int mAbsMaxSmsCharacters;
+          
+          /**
+           * Read only once for optimization purpose
+           * MMS size limit
+           */
+          int mMaxMmsSize;
+    };
+
+
+#endif //__UNIEDITOR_GEN_UTILS_H__
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/editorgenutils/inc/muiuutilsdefines.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,29 @@
+/*
+ * 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 MUIUUTILS_DEFINES_H
+#define MUIUUTILS_DEFINES_H
+
+#include <QObject>
+
+#ifdef BUILD_MUIU_UITLS_DLL
+#define MUIU_UTILS_EXPORT Q_DECL_EXPORT
+#else
+#define MUIU_UTILS_EXPORT Q_DECL_IMPORT
+#endif
+
+#endif // MUIUUTILS_DEFINES_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/editorgenutils/rom/editorgenutils.iby	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,24 @@
+/*
+ * 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 __EDITORGENUTILS_IBY__
+#define __EDITORGENUTILS_IBY__
+
+REM DLL
+file=ABI_DIR\UREL\editorgenutils.dll                   SHARED_LIB_DIR\editorgenutils.dll
+
+#endif // __EDITORGENUTILS_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/editorgenutils/src/MuiuOperationWait.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,98 @@
+/*
+ * 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: Allows a synchronous wait on a operation
+ *
+ */
+
+// INCLUDE FILES
+#include <aknenv.h>
+#include "MuiuOperationWait.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// ---------------------------------------------------------
+// CMuiuOperationWait::NewLC
+//
+// ---------------------------------------------------------
+//
+EXPORT_C CMuiuOperationWait* CMuiuOperationWait::NewLC( TInt aPriority )
+    {
+    CMuiuOperationWait* self = new ( ELeave ) CMuiuOperationWait( aPriority );
+    CleanupStack::PushL( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------
+// CMuiuOperationWait::CMuiuOperationWait
+//
+// ---------------------------------------------------------
+//
+CMuiuOperationWait::CMuiuOperationWait( TInt aPriority )
+: CActive( aPriority )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+
+// ---------------------------------------------------------
+// CMuiuOperationWait::~CMuiuOperationWait
+//
+// ---------------------------------------------------------
+//
+EXPORT_C CMuiuOperationWait::~CMuiuOperationWait()
+    {
+    Cancel();
+    }
+
+
+// ---------------------------------------------------------
+// CMuiuOperationWait::Start
+//
+// ---------------------------------------------------------
+//
+EXPORT_C void CMuiuOperationWait::Start()
+    {
+    SetActive();
+    iWait.Start();
+    }
+
+
+// ---------------------------------------------------------
+// CMuiuOperationWait::RunL
+//
+// ---------------------------------------------------------
+//
+void CMuiuOperationWait::RunL()
+    {
+    CAknEnv::StopSchedulerWaitWithBusyMessage( iWait );
+    }
+
+
+// ---------------------------------------------------------
+// CMuiuOperationWait::DoCancel
+//
+// ---------------------------------------------------------
+//
+void CMuiuOperationWait::DoCancel()
+    {
+    if( iStatus == KRequestPending )
+        {
+        TRequestStatus* s=&iStatus;
+        User::RequestComplete( s, KErrCancel );
+        }
+    CAknEnv::StopSchedulerWaitWithBusyMessage( iWait );
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/editorgenutils/src/UniEditorGenUtils.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,485 @@
+/*
+ * 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: General utilities for unified editor and plugin
+ *
+ */
+
+// INCLUDE FILES
+#include <centralrepository.h>          // CRepository
+#include <CoreApplicationUIsSDKCRKeys.h>  // offline CR keys
+#include <rcustomerserviceprofilecache.h>
+#include <MmsEngineDomainCRKeys.h>
+#include <MsgMediaResolver.h>
+#include <DRMHelper.h>
+
+#include "MessagingVariant.hrh"
+#include "MessagingInternalCRKeys.h"  // Keys
+#include "UniEditorGenUtils.h"
+#include "s60qconversions.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// ----------------------------------------------------
+// UniEditorGenUtils::UniEditorGenUtils
+// @see header
+// ----------------------------------------------------
+UniEditorGenUtils::UniEditorGenUtils() :
+mAbsMaxConcatenatedSms(-1),
+mAbsMaxSmsCharacters(-1),
+mMaxMmsSize(-1)
+{
+
+}
+
+// ----------------------------------------------------
+// UniEditorGenUtils::~UniEditorGenUtils
+// @see header
+// ----------------------------------------------------
+UniEditorGenUtils::~UniEditorGenUtils()
+{
+
+}
+// ----------------------------------------------------
+// UniEditorGenUtils::ReadEmailOverSmsSettingsL
+// @see header
+// ----------------------------------------------------
+TInt UniEditorGenUtils::ReadEmailOverSmsSettingsL(
+    TDes& aSmsc,
+    TDes& aDestinationAddress,
+    TBool& aModifiable )
+    {
+    // Create storage
+    CRepository* storage = CRepository::NewLC( KCRUidSmum );
+    storage->Get( KSumEmailSC, aSmsc );
+    storage->Get( KSumEmailGateway, aDestinationAddress );
+    storage->Get( KSumEmailModifiable, aModifiable );
+    CleanupStack::PopAndDestroy(); // storage
+    return KErrNone;
+    }
+
+// ----------------------------------------------------
+// UniEditorGenUtils::WriteEmailOverSmsSettingsL
+// @see header
+// ----------------------------------------------------
+TInt UniEditorGenUtils::WriteEmailOverSmsSettingsL(
+    const TDes& aSmsc,
+    const TDes& aDestinationAddress,
+    const TBool& aModifiable )
+    {
+    // Create storage
+    CRepository* storage = CRepository::NewLC( KCRUidSmum );
+    storage->Set( KSumEmailSC, aSmsc );
+    storage->Set( KSumEmailGateway, aDestinationAddress );
+    storage->Set( KSumEmailModifiable, aModifiable );
+    CleanupStack::PopAndDestroy(); // storage
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------
+// UniEditorGenUtils::IsPhoneOfflineL
+// @see header
+// ---------------------------------------------------------
+TBool UniEditorGenUtils::IsPhoneOfflineL()
+    {
+    TInt connAllowed ( 1 );
+    CRepository* repository ( CRepository::NewL( KCRUidCoreApplicationUIs ) );
+    TInt err = repository->Get( KCoreAppUIsNetworkConnectionAllowed, connAllowed );
+    delete repository;
+    repository = NULL;
+    if ( !err && !connAllowed )
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+// ----------------------------------------------------
+// UniEditorGenUtils::AcceptEmailAddressesL
+// @see header
+// ----------------------------------------------------
+TBool UniEditorGenUtils::AcceptEmailAddressesL()
+{
+	CRepository* repository ( CRepository::NewL( KCRUidMuiuVariation ) );
+	TInt features = 0;
+    TBool emailOverSmsVariationOn = false;
+    TBool acceptEmailAddresses = false;
+
+	 if ( repository->Get( KMuiuSmsFeatures, features ) == KErrNone )
+	         {
+	         if ( features & KSmsFeatureIdEmailOverSms )
+	             {
+	             emailOverSmsVariationOn = ETrue;
+	             }
+	         }
+
+	 delete repository;
+
+	 //TODO chk with Jerry if below is needed
+	 RCustomerServiceProfileCache* cspProfile = new (ELeave) RCustomerServiceProfileCache;
+     TInt error = cspProfile->Open();
+
+     if ( error == KErrNone )
+         {
+         if ( emailOverSmsVariationOn )
+             {
+
+             // EmailOverSms bit was variated ON so let's check the bit from SIM
+             // Get tele services flags from CSP
+             RMobilePhone::TCspValueAdded params;
+             // Read the CPHS bit so we know if EmailOverSms is supported
+             error = cspProfile->CspCPHSValueAddedServices( params );
+
+
+             if ( error == KErrNone &&
+                  params >= 0 &&
+                  params & RMobilePhone::KCspSMMOEmail )
+                 {
+                 // It's supported
+            	 acceptEmailAddresses= true;
+                 }
+             }
+         }
+     cspProfile->Close();
+     delete cspProfile;
+
+     return acceptEmailAddresses;
+}
+
+// ----------------------------------------------------
+// UniEditorGenUtils::VerifyEmailAddressesL
+// @see header
+// ----------------------------------------------------
+TBool UniEditorGenUtils::VerifyEmailAddressesL( ConvergedMessageAddressList addr)
+{
+  TBool emailAddrPresent =  EFalse;
+
+  for ( int i=0; i< addr.count(); i++)
+  {
+	  if( IsValidEmailAddress(addr[i]->address()) )
+	  {
+		  emailAddrPresent = ETrue;
+		  break;
+	  }
+  }
+
+  return emailAddrPresent;
+}
+
+// ----------------------------------------------------
+// UniEditorGenUtils::UTF8Size
+// @see header
+// ----------------------------------------------------
+TInt UniEditorGenUtils::UTF8Size( QString aText )
+    {
+    HBufC* text = S60QConversions::qStringToS60Desc(aText);
+    TPtrC ptr = text->Des();
+    
+    TInt count = 0;
+    TInt sizeInBytes = 0;
+    TUint16 charValue;
+    while ( count < ptr.Length() )
+        {
+        charValue = ptr[count];
+        if ( charValue < 0x80 )
+            {
+            sizeInBytes += 1;
+            }
+        else if ( charValue < 0x800 )
+            {
+            sizeInBytes += 2;
+            }
+        else //if ( charValue < 0x10000 )
+            {
+            sizeInBytes += 3;
+            }
+        count++;
+        }
+    return sizeInBytes;
+    }
+
+// ----------------------------------------------------
+// UniEditorGenUtils::MaxSmsRecipientsL
+// @see header
+// ----------------------------------------------------
+TInt UniEditorGenUtils::MaxSmsRecipientsL()
+{
+	CRepository* repository ( CRepository::NewL( KCRUidUniEditor ) );
+	TInt maxSmsRecipients = KDefaultSmsRecipients;
+	
+    if ( (repository->Get( KUniEditorSoftLimitRecipientCount, maxSmsRecipients ) 
+    		!= KErrNone) ||	(maxSmsRecipients <= 0) )
+        {
+        // Unreasonable count, change it back to default value
+    	maxSmsRecipients = KDefaultSmsRecipients;
+        }
+    delete repository;
+    
+    return maxSmsRecipients;
+}
+
+// ----------------------------------------------------
+// UniEditorGenUtils::MaxMmsRecipientsL
+// @see header
+// ----------------------------------------------------
+TInt UniEditorGenUtils::MaxMmsRecipientsL()
+{
+	CRepository* repository ( CRepository::NewL( KCRUidUniEditor ) );
+	TInt maxMmsRecipients = KDefaultMmsRecipients;
+	
+    if ( (repository->Get( KUniEditorMaxRecipientCount, maxMmsRecipients )
+    		!= KErrNone) || (maxMmsRecipients <= 0))
+        {
+        // Unreasonable count, change it back to default value
+    	maxMmsRecipients = KDefaultMmsRecipients;
+        }
+    delete repository;
+
+    return maxMmsRecipients;
+}
+
+// ----------------------------------------------------
+// UniEditorGenUtils::IsValidEmailAddress
+// @see header
+// ----------------------------------------------------
+TBool UniEditorGenUtils::IsValidEmailAddress( QString addr )
+    { 
+    // valid email address contains at least 3 characters
+    if( addr.size() >= 3 )
+        {
+        // search for @ from the address. however, it can't be the first or the last item
+        for ( int i = 1; i < addr.size() - 1; i++ )
+            {
+            if ( addr.at(i) == '@' )
+                {
+                return ETrue;
+                }
+            }
+        }
+    return EFalse;
+    }
+
+// ----------------------------------------------------
+// UniEditorGenUtils::MaxMmsMsgSizeL
+// @see header
+// ----------------------------------------------------
+TInt UniEditorGenUtils::MaxMmsMsgSizeL()
+{
+    // optimized, to read only once from CR
+    if(mMaxMmsSize == -1)
+    {// not read yet, so read it now
+        mMaxMmsSize = KDefaultMaxSize;
+    
+        CRepository* repository = CRepository::NewL( KCRUidMmsEngine );
+        CleanupStack::PushL( repository );
+    
+        repository->Get( KMmsEngineMaximumSendSize, mMaxMmsSize );
+    
+        CleanupStack::PopAndDestroy( repository );
+    }
+    
+    return mMaxMmsSize;
+}
+
+// ----------------------------------------------------
+// UniEditorGenUtils::getFileInfoL
+// @see header
+// ----------------------------------------------------
+void UniEditorGenUtils::getFileInfoL(QString filePath,
+                                    int& size,
+                                    QString& mimetype,
+                                    TMsgMediaType& mediaType)
+{
+    HBufC* filepath = S60QConversions::qStringToS60Desc(filePath);
+    int fileSize = 0;
+    
+	CMsgMediaResolver* mediaResolver;
+	
+    if(filepath)  
+    { 
+    CleanupStack::PushL(filepath);     
+    
+    mediaResolver = CMsgMediaResolver::NewLC();
+    
+    RFile file = mediaResolver->FileHandleL(*filepath);    
+    file.Size(fileSize);        
+    fileSize+= KEstimatedMimeHeaderSize;
+    size = fileSize;
+    TDataType datatype;
+    mediaResolver->RecognizeL( file, datatype );
+    mimetype = S60QConversions::s60Desc8ToQString(datatype.Des8());
+    mediaType = mediaResolver->MediaType(datatype.Des8());
+    
+    CleanupStack::PopAndDestroy(mediaResolver);
+    CleanupStack::PopAndDestroy(filepath);
+    }
+    
+    return;
+}
+
+// ----------------------------------------------------
+// UniEditorGenUtils::MaxSmsMsgSizeL
+// @see header
+// ----------------------------------------------------
+int UniEditorGenUtils::MaxSmsMsgSizeL(bool unicode)
+{
+    int maxLength = 0;
+    int lengthOne = 0;
+    int lengthMany = 0;
+    
+    getSmsCharacterLimits(lengthOne, lengthMany, unicode);
+    maxLength = lengthOne;
+
+    int maxSmsParts = absoluteMaxSmsPartsL();    
+    if(maxSmsParts > 1)
+        {
+        maxLength = maxSmsParts * lengthMany;
+        }
+/* UniEditor soft limit, may not be needed    
+    int maxSmsCharacters = absoluteMaxSmsCharactersL();
+    if(maxSmsCharacters > 0)
+        {
+        maxLength = maxSmsCharacters;
+        }
+*/
+    return maxLength;
+}
+
+// ----------------------------------------------------
+// UniEditorGenUtils::getSmsCharacterLimits
+// @see header
+// ----------------------------------------------------
+void UniEditorGenUtils::getSmsCharacterLimits(int& singlePartLength,
+                                        int& concatenatedPartLength,
+                                        bool unicode)
+    {
+    if(unicode)
+        {
+        singlePartLength = KFirstUnicodeSmsLength;
+        concatenatedPartLength = KUnicodeConcatenationInterval;
+        }
+    else
+        {
+        singlePartLength = KFirstNormalSmsLength;
+        concatenatedPartLength = KNormalConcatenationInterval;
+        }
+    }
+
+// ----------------------------------------------------
+// UniEditorGenUtils::absoluteMaxSmsPartsL
+// @see header
+// ----------------------------------------------------
+int UniEditorGenUtils::absoluteMaxSmsPartsL()
+{
+    // optimized, to read only once from CR
+    if(mAbsMaxConcatenatedSms == -1)
+    { // not read yet, so read it now
+        mAbsMaxConcatenatedSms = KDefaultMaxSmsSize;
+        CRepository* repository = CRepository::NewL( KCRUidSmum );
+        CleanupStack::PushL( repository );
+
+        if ( repository->Get( KSmumMaxSubMsgCount, mAbsMaxConcatenatedSms ) ||
+                mAbsMaxConcatenatedSms < 1 || 
+                mAbsMaxConcatenatedSms > KMaxSmsSizeByStandard )
+        {
+            // Unreasonable count, change it back to 30 ( S60 default )
+            mAbsMaxConcatenatedSms = KMaxSmsSizeByStandard;
+        }
+        CleanupStack::PopAndDestroy( repository );
+    }
+    return mAbsMaxConcatenatedSms;
+}
+
+// ----------------------------------------------------
+// UniEditorGenUtils::absoluteMaxSmsCharactersL
+// @see header
+// ----------------------------------------------------
+int UniEditorGenUtils::absoluteMaxSmsCharactersL()
+{
+    // optimized, to read only once from CR
+    if(mAbsMaxSmsCharacters == -1)
+    {// not read yet, so read it now
+        CRepository* repository = CRepository::NewL( KCRUidUniEditor );
+        CleanupStack::PushL( repository );
+        repository->Get( KUniEditorMaxSmsCharacterCount, mAbsMaxSmsCharacters );
+        CleanupStack::PopAndDestroy( repository );    
+    }
+    return mAbsMaxSmsCharacters;
+}
+
+// ---------------------------------------------------------
+// UniEditorGenUtils::ConvertDigitsTo
+// @see header
+// ---------------------------------------------------------
+void UniEditorGenUtils::ConvertDigitsTo( TDes& aDes, TDigitType aDigitType )
+    {
+    TChar toArea = aDigitType;
+    TInt length = aDes.Length();
+    for(int i=0; i<length; i++)
+        {
+        TChar ch = aDes[i];
+        TChar base = NumberToBase(ch);
+        switch (base)
+            {
+            case EDigitTypeWestern:
+            case EDigitTypeArabicIndic:
+            case EDigitTypeEasternArabicIndic:
+            case EDigitTypeDevanagari:
+            case EDigitTypeThai:
+                ch += toArea - base;
+                aDes[i] = TUint16(ch);
+                break;
+            default:
+                break;
+            };
+        }
+    }
+
+// ---------------------------------------------------------
+// UniEditorGenUtils::NumberToBase
+// @see header
+// ---------------------------------------------------------
+TChar UniEditorGenUtils::NumberToBase(TChar ch)
+    {
+    TDigitType d[] = { EDigitTypeWestern, EDigitTypeArabicIndic, EDigitTypeEasternArabicIndic, EDigitTypeDevanagari, EDigitTypeThai };
+    TInt i = 0;
+    TInt num = sizeof(d)/sizeof(d[0]);
+    while(i<num)
+        {
+        if (ch>TChar(d[i]) && ch<TChar(d[i]+10)) { return d[i]; }
+        i++;
+        }
+    return ch;
+    }
+
+// ---------------------------------------------------------
+// UniEditorGenUtils::ReplaceCharacters
+// @see header
+// ---------------------------------------------------------
+void UniEditorGenUtils::ReplaceCharacters(TDes &aDes, const TDesC &aChars, TChar aReplacement)
+    {
+    TInt src = 0;
+    TInt srclength = aDes.Length();
+    while(src < srclength)
+        {
+    TChar c = aDes[src];
+    if (aChars.LocateF(c) != KErrNotFound)
+        aDes[src] = TUint16(aReplacement);
+    ++src;
+        }
+    }
+
+// End of file
--- a/messagingapp/msgutils/unieditorutils/inc/MuiuOperationWait.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +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: Allows a synchronous wait on a operation
- *
- */
-
-#ifndef __MUIUOPERATIONWAIT_H__
-#define __MUIUOPERATIONWAIT_H__
-
-//  INCLUDES
-#include "muiuutilsdefines.h"
-#include <e32base.h>
-#include <e32const.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-// CLASS DECLARATION
-/**
-*
-* Deprecated! Use internal CMsgOperationWait instead!
-*
-* Allows a synchronous wait on a operation.
-*/
-class MUIU_UTILS_EXPORT CMuiuOperationWait: public CActive
-    {
-    public:
-        static CMuiuOperationWait* NewLC( TInt aPriority = EPriorityStandard );
-        ~CMuiuOperationWait();
-        void Start();
-    protected:
-        CMuiuOperationWait( TInt aPriority );
-        void RunL();
-        void DoCancel();
-    protected:
-        CActiveSchedulerWait iWait;
-    };
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif //__MUIUOPERATIONWAIT_H__
-
-// End of file
--- a/messagingapp/msgutils/unieditorutils/inc/UniEditorGenUtils.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,220 +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: General utilities for unified editor and plugin
- *
- */
-
-#ifndef __UNIEDITOR_GEN_UTILS_H__
-#define __UNIEDITOR_GEN_UTILS_H__
-
-//  INCLUDES
-#include <e32base.h>
-#include <e32const.h>
-#include "muiuutilsdefines.h"
-#include "convergedmessage.h"
-#include "MsgMedia.hrh"
-
-const TInt KDefaultMaxSmsSize = 10;
-// Length of one 7bit normal sms
-const TInt KFirstNormalSmsLength = 160;
-// Length of one unicode sms
-const TInt KFirstUnicodeSmsLength = 70;
-// Submsg length for normal 7bit sms
-const TInt KNormalConcatenationInterval = 153;
-// Submsg length for unicode sms
-const TInt KUnicodeConcatenationInterval = 67;
-
-const TInt KMaxSmsSizeByStandard = 30;
-const TInt KDefaultSmsRecipients = 20;
-const TInt KDefaultMmsRecipients = 100;
-const TInt KDefaultMaxSize = 300 * 1024;
-const TInt KEstimatedMmsSmilHeaderSize = 2.4 * 1024; // 1Kb buffer for mime headers + 1.4Kb for smil  
-const TInt KEstimatedMimeHeaderSize = 1400; 
-
-class CMsgMediaResolver;
-
-// CLASS DECLARATION
-class MUIU_UTILS_EXPORT UniEditorGenUtils
-    {
-
-      public:
-
-      explicit UniEditorGenUtils();
-
-      ~UniEditorGenUtils();
-
-      public:
-        /**
-        * Returns the current Email-over-Sms settings
-        * @param aSmsc
-        * @param aDestinationAddress
-        * @param aModifiable
-        * @return                   Symbian OS standard error code
-        */
-        TInt ReadEmailOverSmsSettingsL(
-            TDes& aSmsc,
-            TDes& aDestinationAddress,
-            TBool& aModifiable );
-
-        /**
-        * Writes the current Email-over-Sms settings to file
-        * @param aSmsc service centre, used for Email over Sms
-        * @param aDestinationAddress service number, used for Email over Sms
-        * @param aModifiable to check if user is allowed to modify setting
-        * @return                   Symbian OS standard error code
-        */
-        TInt WriteEmailOverSmsSettingsL(
-            const TDes& aSmsc,
-            const TDes& aDestinationAddress,
-            const TBool& aModifiable );
-
-        /**
-        * Checks if phone is in offline mode or not
-        * Make sure that offline feature has been checked
-        * using feature manager
-        * @return ETrue if phone is in offline mode, otherwise EFalse.
-        */
-        TBool IsPhoneOfflineL();
-
-        /**
-         * Checks if email addresses are supported over sms message type
-         * using feature manager
-         * @return ETrue if emailoversms is suppoted
-         */
-        TBool AcceptEmailAddressesL();
-
-        /**
-         * Checks if the given addresslist contains a valid email address
-         * @param addr converged message address list
-         * @return ETrue if list contains a valid email address
-         */
-        TBool VerifyEmailAddressesL( ConvergedMessageAddressList addr);
-        
-        /** 
-        * Gets byte-size of UTF8 formatted text
-        * @param aText
-        * @return Size of text in bytes
-        */
-        TInt UTF8Size( QString aText );
-        
-        /**
-         * Get maximum recipient count for sms from feature manager
-         * @return max recipient count
-         */
-        TInt MaxSmsRecipientsL();
-        
-        /**
-         * Get maximum recipient count for mms from feature manager
-         * @return max recipient count
-         */
-        TInt MaxMmsRecipientsL();
-        
-        /**
-         * Checks if a given address string is a valid email address
-         * @param addr address string
-         * @return ETrue if addr is valid email address
-         */
-        TBool IsValidEmailAddress( QString addr );
-        
-        /**
-         * Calculates the size of the given message
-         * @param msg ConvergedMessage
-         * @return size of the converged message
-         */
-        TInt CalculateMsgSize(ConvergedMessage& msg);
-
-        /**
-         * Get the maximum size allowed for mms
-         * using feature manager
-         * @return max mms size
-         */
-        TInt MaxMmsMsgSizeL();
-        
-        /**
-         * get file's size and mimetype info
-         * @param filePath IN path of file
-         * @param size OUT size of the given file
-         * Size includes filesize + max mime headers size
-         * @param mimetype OUT mimetype of the given file
-         * @param mediaType OUT media-type grouping of mimetype
-         */
-        void getFileInfoL(QString filePath,
-                        int& size,
-                        QString& mimetype,
-                        TMsgMediaType& mediaType);
-        
-        /**
-         * get max sms size limit from feature manager
-         * @return max sms size limit
-         */
-        int MaxSmsMsgSizeL();
-        
-        /**
-         * Convert digits from any digit format to another format eg. from
-         * european digits to arabic-indic digits.
-         * @param aDes        Parameter to change. It can contain digits
-         *                    from several digit types.
-         * @param aDigitType  Destination digit type.
-         */
-        void ConvertDigitsTo( TDes& aDes, TDigitType aDigitType );
-        
-        /**
-         * Identifies the digit format
-         * @param ch    digit, whose format is to be recognized
-         * @return      digit format
-         */
-        TChar NumberToBase(TChar ch);
-
-        /**
-         * Replace all control chars with a single character,
-         * usually a whitespace.
-         * @param   aDes         Parameter to change
-         * @param   aCharacters  A set of characters to remove
-         * @param   aReplacement A character used as replacement
-         */
-        void ReplaceCharacters(TDes &aDes, const TDesC &aChars, TChar aReplacement);
-
-      private:
-          /**
-           * get sms character limits from feature manager
-           * @param singlePartLength length of one part
-           * @param concatenatedPartLength total length over all parts
-           */
-          void getSmsCharacterLimits(int& singlePartLength, int& concatenatedPartLength);
-          
-          /**
-           * checks if the character mode is unicode
-           * @return ETrue if character mode is unicode
-           */
-          bool unicodeCharacterMode();
-          
-          /**
-           * get the maximum number of parts for sms
-           * using feature manager
-           * @return max number of parts for the sms
-           */
-          int absoluteMaxSmsPartsL();
-          
-          /**
-           * get the character limit for sms
-           * using feature manager
-           * @return sms character limit 
-           */
-          int absoluteMaxSmsCharactersL();
-    };
-
-
-#endif //__UNIEDITOR_GEN_UTILS_H__
-
-// End of file
--- a/messagingapp/msgutils/unieditorutils/inc/muiuutilsdefines.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-#ifndef MUIUUTILS_DEFINES_H
-#define MUIUUTILS_DEFINES_H
-
-#include <QObject>
-
-#ifdef BUILD_MUIU_UITLS_DLL
-#define MUIU_UTILS_EXPORT Q_DECL_EXPORT
-#else
-#define MUIU_UTILS_EXPORT Q_DECL_IMPORT
-#endif
-
-#endif // MUIUUTILS_DEFINES_H
--- a/messagingapp/msgutils/unieditorutils/rom/unieditorutils.iby	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +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 __UNIEDITORUTILS_IBY__
-#define __UNIEDITORUTILS_IBY__
-
-REM DLL
-file=ABI_DIR\UREL\unieditorutils.dll                   SHARED_LIB_DIR\unieditorutils.dll
-
-#endif // __UNIEDITORUTILS_IBY__
--- a/messagingapp/msgutils/unieditorutils/src/MuiuOperationWait.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +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: Allows a synchronous wait on a operation
- *
- */
-
-// INCLUDE FILES
-#include <aknenv.h>
-#include "MuiuOperationWait.h"
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// ---------------------------------------------------------
-// CMuiuOperationWait::NewLC
-//
-// ---------------------------------------------------------
-//
-EXPORT_C CMuiuOperationWait* CMuiuOperationWait::NewLC( TInt aPriority )
-    {
-    CMuiuOperationWait* self = new ( ELeave ) CMuiuOperationWait( aPriority );
-    CleanupStack::PushL( self );
-    return self;
-    }
-
-
-// ---------------------------------------------------------
-// CMuiuOperationWait::CMuiuOperationWait
-//
-// ---------------------------------------------------------
-//
-CMuiuOperationWait::CMuiuOperationWait( TInt aPriority )
-: CActive( aPriority )
-    {
-    CActiveScheduler::Add( this );
-    }
-
-
-// ---------------------------------------------------------
-// CMuiuOperationWait::~CMuiuOperationWait
-//
-// ---------------------------------------------------------
-//
-EXPORT_C CMuiuOperationWait::~CMuiuOperationWait()
-    {
-    Cancel();
-    }
-
-
-// ---------------------------------------------------------
-// CMuiuOperationWait::Start
-//
-// ---------------------------------------------------------
-//
-EXPORT_C void CMuiuOperationWait::Start()
-    {
-    SetActive();
-    iWait.Start();
-    }
-
-
-// ---------------------------------------------------------
-// CMuiuOperationWait::RunL
-//
-// ---------------------------------------------------------
-//
-void CMuiuOperationWait::RunL()
-    {
-    CAknEnv::StopSchedulerWaitWithBusyMessage( iWait );
-    }
-
-
-// ---------------------------------------------------------
-// CMuiuOperationWait::DoCancel
-//
-// ---------------------------------------------------------
-//
-void CMuiuOperationWait::DoCancel()
-    {
-    if( iStatus == KRequestPending )
-        {
-        TRequestStatus* s=&iStatus;
-        User::RequestComplete( s, KErrCancel );
-        }
-    CAknEnv::StopSchedulerWaitWithBusyMessage( iWait );
-    }
-
-// End of file
--- a/messagingapp/msgutils/unieditorutils/src/UniEditorGenUtils.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,481 +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: General utilities for unified editor and plugin
- *
- */
-
-// INCLUDE FILES
-#include <centralrepository.h>          // CRepository
-#include <CoreApplicationUIsSDKCRKeys.h>  // offline CR keys
-#include <rcustomerserviceprofilecache.h>
-#include <MmsEngineDomainCRKeys.h>
-#include <MsgMediaResolver.h>
-#include <DRMHelper.h>
-
-#include "MessagingVariant.hrh"
-#include "MessagingInternalCRKeys.h"  // Keys
-#include "UniEditorGenUtils.h"
-#include "s60qconversions.h"
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// ----------------------------------------------------
-// UniEditorGenUtils::UniEditorGenUtils
-// @see header
-// ----------------------------------------------------
-UniEditorGenUtils::UniEditorGenUtils()
-{
-
-}
-
-// ----------------------------------------------------
-// UniEditorGenUtils::~UniEditorGenUtils
-// @see header
-// ----------------------------------------------------
-UniEditorGenUtils::~UniEditorGenUtils()
-{
-
-}
-// ----------------------------------------------------
-// UniEditorGenUtils::ReadEmailOverSmsSettingsL
-// @see header
-// ----------------------------------------------------
-TInt UniEditorGenUtils::ReadEmailOverSmsSettingsL(
-    TDes& aSmsc,
-    TDes& aDestinationAddress,
-    TBool& aModifiable )
-    {
-    // Create storage
-    CRepository* storage = CRepository::NewLC( KCRUidSmum );
-    storage->Get( KSumEmailSC, aSmsc );
-    storage->Get( KSumEmailGateway, aDestinationAddress );
-    storage->Get( KSumEmailModifiable, aModifiable );
-    CleanupStack::PopAndDestroy(); // storage
-    return KErrNone;
-    }
-
-// ----------------------------------------------------
-// UniEditorGenUtils::WriteEmailOverSmsSettingsL
-// @see header
-// ----------------------------------------------------
-TInt UniEditorGenUtils::WriteEmailOverSmsSettingsL(
-    const TDes& aSmsc,
-    const TDes& aDestinationAddress,
-    const TBool& aModifiable )
-    {
-    // Create storage
-    CRepository* storage = CRepository::NewLC( KCRUidSmum );
-    storage->Set( KSumEmailSC, aSmsc );
-    storage->Set( KSumEmailGateway, aDestinationAddress );
-    storage->Set( KSumEmailModifiable, aModifiable );
-    CleanupStack::PopAndDestroy(); // storage
-    return KErrNone;
-    }
-
-// ---------------------------------------------------------
-// UniEditorGenUtils::IsPhoneOfflineL
-// @see header
-// ---------------------------------------------------------
-TBool UniEditorGenUtils::IsPhoneOfflineL()
-    {
-    TInt connAllowed ( 1 );
-    CRepository* repository ( CRepository::NewL( KCRUidCoreApplicationUIs ) );
-    TInt err = repository->Get( KCoreAppUIsNetworkConnectionAllowed, connAllowed );
-    delete repository;
-    repository = NULL;
-    if ( !err && !connAllowed )
-        {
-        return ETrue;
-        }
-    else
-        {
-        return EFalse;
-        }
-    }
-
-// ----------------------------------------------------
-// UniEditorGenUtils::AcceptEmailAddressesL
-// @see header
-// ----------------------------------------------------
-TBool UniEditorGenUtils::AcceptEmailAddressesL()
-{
-	CRepository* repository ( CRepository::NewL( KCRUidMuiuVariation ) );
-	TInt features = 0;
-    TBool emailOverSmsVariationOn = false;
-    TBool acceptEmailAddresses = false;
-
-	 if ( repository->Get( KMuiuSmsFeatures, features ) == KErrNone )
-	         {
-	         if ( features & KSmsFeatureIdEmailOverSms )
-	             {
-	             emailOverSmsVariationOn = ETrue;
-	             }
-	         }
-
-	 delete repository;
-
-	 //TODO chk with Jerry if below is needed
-	 RCustomerServiceProfileCache* cspProfile = new (ELeave) RCustomerServiceProfileCache;
-     TInt error = cspProfile->Open();
-
-     if ( error == KErrNone )
-         {
-         if ( emailOverSmsVariationOn )
-             {
-
-             // EmailOverSms bit was variated ON so let's check the bit from SIM
-             // Get tele services flags from CSP
-             RMobilePhone::TCspValueAdded params;
-             // Read the CPHS bit so we know if EmailOverSms is supported
-             error = cspProfile->CspCPHSValueAddedServices( params );
-
-
-             if ( error == KErrNone &&
-                  params >= 0 &&
-                  params & RMobilePhone::KCspSMMOEmail )
-                 {
-                 // It's supported
-            	 acceptEmailAddresses= true;
-                 }
-             }
-         }
-     cspProfile->Close();
-     delete cspProfile;
-
-     return acceptEmailAddresses;
-}
-
-// ----------------------------------------------------
-// UniEditorGenUtils::VerifyEmailAddressesL
-// @see header
-// ----------------------------------------------------
-TBool UniEditorGenUtils::VerifyEmailAddressesL( ConvergedMessageAddressList addr)
-{
-  TBool emailAddrPresent =  EFalse;
-
-  for ( int i=0; i< addr.count(); i++)
-  {
-	  if( IsValidEmailAddress(addr[i]->address()) )
-	  {
-		  emailAddrPresent = ETrue;
-		  break;
-	  }
-  }
-
-  return emailAddrPresent;
-}
-
-// ----------------------------------------------------
-// UniEditorGenUtils::UTF8Size
-// @see header
-// ----------------------------------------------------
-TInt UniEditorGenUtils::UTF8Size( QString aText )
-    {
-    HBufC* text = S60QConversions::qStringToS60Desc(aText);
-    TPtrC ptr = text->Des();
-    
-    TInt count = 0;
-    TInt sizeInBytes = 0;
-    TUint16 charValue;
-    while ( count < ptr.Length() )
-        {
-        charValue = ptr[count];
-        if ( charValue < 0x80 )
-            {
-            sizeInBytes += 1;
-            }
-        else if ( charValue < 0x800 )
-            {
-            sizeInBytes += 2;
-            }
-        else //if ( charValue < 0x10000 )
-            {
-            sizeInBytes += 3;
-            }
-        count++;
-        }
-    return sizeInBytes;
-    }
-
-// ----------------------------------------------------
-// UniEditorGenUtils::MaxSmsRecipientsL
-// @see header
-// ----------------------------------------------------
-TInt UniEditorGenUtils::MaxSmsRecipientsL()
-{
-	CRepository* repository ( CRepository::NewL( KCRUidUniEditor ) );
-	TInt maxSmsRecipients = KDefaultSmsRecipients;
-	
-    if ( (repository->Get( KUniEditorSoftLimitRecipientCount, maxSmsRecipients ) 
-    		!= KErrNone) ||	(maxSmsRecipients <= 0) )
-        {
-        // Unreasonable count, change it back to default value
-    	maxSmsRecipients = KDefaultSmsRecipients;
-        }
-    delete repository;
-    
-    return maxSmsRecipients;
-}
-
-// ----------------------------------------------------
-// UniEditorGenUtils::MaxMmsRecipientsL
-// @see header
-// ----------------------------------------------------
-TInt UniEditorGenUtils::MaxMmsRecipientsL()
-{
-	CRepository* repository ( CRepository::NewL( KCRUidUniEditor ) );
-	TInt maxMmsRecipients = KDefaultMmsRecipients;
-	
-    if ( (repository->Get( KUniEditorMaxRecipientCount, maxMmsRecipients )
-    		!= KErrNone) || (maxMmsRecipients <= 0))
-        {
-        // Unreasonable count, change it back to default value
-    	maxMmsRecipients = KDefaultMmsRecipients;
-        }
-    delete repository;
-
-    return maxMmsRecipients;
-}
-
-// ----------------------------------------------------
-// UniEditorGenUtils::IsValidEmailAddress
-// @see header
-// ----------------------------------------------------
-TBool UniEditorGenUtils::IsValidEmailAddress( QString addr )
-    { 
-    // valid email address contains at least 3 characters
-    if( addr.size() >= 3 )
-        {
-        // search for @ from the address. however, it can't be the first or the last item
-        for ( int i = 1; i < addr.size() - 1; i++ )
-            {
-            if ( addr.at(i) == '@' )
-                {
-                return ETrue;
-                }
-            }
-        }
-    return EFalse;
-    }
-
-// ----------------------------------------------------
-// UniEditorGenUtils::MaxMmsMsgSizeL
-// @see header
-// ----------------------------------------------------
-TInt UniEditorGenUtils::MaxMmsMsgSizeL()
-{
-	TInt maxSize = KDefaultMaxSize;
-	
-    CRepository* repository = CRepository::NewL( KCRUidMmsEngine );
-    CleanupStack::PushL( repository );
-    
-    repository->Get( KMmsEngineMaximumSendSize, maxSize );
-    
-    CleanupStack::PopAndDestroy( repository );
-    
-    return maxSize;
-}
-
-// ----------------------------------------------------
-// UniEditorGenUtils::getFileInfoL
-// @see header
-// ----------------------------------------------------
-void UniEditorGenUtils::getFileInfoL(QString filePath,
-                                    int& size,
-                                    QString& mimetype,
-                                    TMsgMediaType& mediaType)
-{
-    HBufC* filepath = S60QConversions::qStringToS60Desc(filePath);
-    int fileSize = 0;
-    
-	CMsgMediaResolver* mediaResolver;
-	
-    if(filepath)  
-    { 
-    CleanupStack::PushL(filepath);     
-    
-    mediaResolver = CMsgMediaResolver::NewLC();
-    
-    RFile file = mediaResolver->FileHandleL(*filepath);    
-    file.Size(fileSize);        
-    fileSize+= KEstimatedMimeHeaderSize;
-    size = fileSize;
-    TDataType datatype;
-    mediaResolver->RecognizeL( file, datatype );
-    mimetype = S60QConversions::s60Desc8ToQString(datatype.Des8());
-    mediaType = mediaResolver->MediaType(datatype.Des8());
-    
-    CleanupStack::PopAndDestroy(mediaResolver);
-    CleanupStack::PopAndDestroy(filepath);
-    }
-    
-    return;
-}
-
-// ----------------------------------------------------
-// UniEditorGenUtils::MaxSmsMsgSizeL
-// @see header
-// ----------------------------------------------------
-int UniEditorGenUtils::MaxSmsMsgSizeL()
-{
-    int maxLength = 0;
-    int lengthOne = 0;
-    int lengthMany = 0;
-    
-    getSmsCharacterLimits(lengthOne, lengthMany);
-    maxLength = lengthOne;
-
-    int maxSmsParts = absoluteMaxSmsPartsL();
-    if(maxSmsParts > 1)
-        {
-        maxLength = maxSmsParts * lengthMany;
-        }
-    
-    int maxSmsCharacters = absoluteMaxSmsCharactersL();
-    if(maxSmsCharacters > 0)
-        {
-        maxLength = maxSmsCharacters;
-        }
-    return maxLength;
-}
-
-// ----------------------------------------------------
-// UniEditorGenUtils::getSmsCharacterLimits
-// @see header
-// ----------------------------------------------------
-void UniEditorGenUtils::getSmsCharacterLimits(int& singlePartLength,
-                                        int& concatenatedPartLength)
-    {
-    if(unicodeCharacterMode())
-        {
-        singlePartLength = KFirstUnicodeSmsLength;
-        concatenatedPartLength = KUnicodeConcatenationInterval;
-        }
-    else
-        {
-        singlePartLength = KFirstNormalSmsLength;
-        concatenatedPartLength = KNormalConcatenationInterval;
-        }
-    }
-
-// ----------------------------------------------------
-// UniEditorGenUtils::unicodeCharacterMode
-// @see header
-// ----------------------------------------------------
-bool UniEditorGenUtils::unicodeCharacterMode()
-    {
-    //TODO: this needs proper implementation
-    return false;
-    }
-
-// ----------------------------------------------------
-// UniEditorGenUtils::absoluteMaxSmsPartsL
-// @see header
-// ----------------------------------------------------
-int UniEditorGenUtils::absoluteMaxSmsPartsL()
-    {
-    int absMaxConcatenatedSms = KDefaultMaxSmsSize;
-    CRepository* repository = CRepository::NewL( KCRUidSmum );
-    CleanupStack::PushL( repository );
-
-    if ( repository->Get( KSmumMaxSubMsgCount, absMaxConcatenatedSms ) ||
-         absMaxConcatenatedSms < 1 || 
-         absMaxConcatenatedSms > KMaxSmsSizeByStandard )
-        {
-        // Unreasonable count, change it back to 30 ( S60 default )
-        absMaxConcatenatedSms = KMaxSmsSizeByStandard;
-        }
-    CleanupStack::PopAndDestroy( repository );
-    return absMaxConcatenatedSms;
-    }
-
-// ----------------------------------------------------
-// UniEditorGenUtils::absoluteMaxSmsCharactersL
-// @see header
-// ----------------------------------------------------
-int UniEditorGenUtils::absoluteMaxSmsCharactersL()
-    {
-    int absMaxSmsCharacters = 0;
-    
-    CRepository* repository = CRepository::NewL( KCRUidUniEditor );
-    CleanupStack::PushL( repository );
-    repository->Get( KUniEditorMaxSmsCharacterCount, absMaxSmsCharacters );
-    CleanupStack::PopAndDestroy( repository );
-    
-    return absMaxSmsCharacters;
-    }
-
-// ---------------------------------------------------------
-// UniEditorGenUtils::ConvertDigitsTo
-// @see header
-// ---------------------------------------------------------
-void UniEditorGenUtils::ConvertDigitsTo( TDes& aDes, TDigitType aDigitType )
-    {
-    TChar toArea = aDigitType;
-    TInt length = aDes.Length();
-    for(int i=0; i<length; i++)
-        {
-        TChar ch = aDes[i];
-        TChar base = NumberToBase(ch);
-        switch (base)
-            {
-            case EDigitTypeWestern:
-            case EDigitTypeArabicIndic:
-            case EDigitTypeEasternArabicIndic:
-            case EDigitTypeDevanagari:
-            case EDigitTypeThai:
-                ch += toArea - base;
-                aDes[i] = TUint16(ch);
-                break;
-            default:
-                break;
-            };
-        }
-    }
-
-// ---------------------------------------------------------
-// UniEditorGenUtils::NumberToBase
-// @see header
-// ---------------------------------------------------------
-TChar UniEditorGenUtils::NumberToBase(TChar ch)
-    {
-    TDigitType d[] = { EDigitTypeWestern, EDigitTypeArabicIndic, EDigitTypeEasternArabicIndic, EDigitTypeDevanagari, EDigitTypeThai };
-    TInt i = 0;
-    TInt num = sizeof(d)/sizeof(d[0]);
-    while(i<num)
-        {
-        if (ch>TChar(d[i]) && ch<TChar(d[i]+10)) { return d[i]; }
-        i++;
-        }
-    return ch;
-    }
-
-// ---------------------------------------------------------
-// UniEditorGenUtils::ReplaceCharacters
-// @see header
-// ---------------------------------------------------------
-void UniEditorGenUtils::ReplaceCharacters(TDes &aDes, const TDesC &aChars, TChar aReplacement)
-    {
-    TInt src = 0;
-    TInt srclength = aDes.Length();
-    while(src < srclength)
-        {
-    TChar c = aDes[src];
-    if (aChars.LocateF(c) != KErrNotFound)
-        aDes[src] = TUint16(aReplacement);
-    ++src;
-        }
-    }
-
-// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorpluginloader/rom/unieditorpluginloader.iby	Mon May 03 12:29:07 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:
+*
+*/
+#ifndef __UNIEDITOR_PLUGIN_LOADER_IBY__
+#define __UNIEDITOR_PLUGIN_LOADER_IBY__
+
+REM DLL
+file=ABI_DIR\UREL\unieditorpluginloader.dll                   SHARED_LIB_DIR\unieditorpluginloader.dll
+
+#endif // __UNIEDITOR_PLUGIN_LOADER_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorpluginloader/src/unieditorpluginloader.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,108 @@
+/*
+ * 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:
+ *
+ */
+
+// System Includes
+
+#include <QDir>
+#include "debugtraces.h"
+
+#include <QLibraryInfo>
+#include <QPluginLoader>
+#include "unieditorpluginloader.h"
+#include "unieditorplugininterface.h"
+
+// LOCAL CONSTANTS
+const QString MMS_PLUGIN("unieditormmsplugin.qtplugin");
+const QString SMS_PLUGIN("unieditorsmsplugin.qtplugin");
+
+//---------------------------------------------------------------
+//UniEditorPluginLoader::UniEditorPluginLoader()
+//@see header
+//---------------------------------------------------------------
+UniEditorPluginLoader::UniEditorPluginLoader(QObject* parent) :
+    QObject(parent)
+{
+}
+
+//---------------------------------------------------------------
+//UniEditorPluginLoader::~UniEditorPluginLoader()
+//@see header
+//---------------------------------------------------------------
+UniEditorPluginLoader::~UniEditorPluginLoader()
+{
+    // unload all qt-plugins
+    int count = mPluginLoaderList.count();
+    for (int i = 0; i < count; i++)
+    {
+        mPluginLoaderList.at(i)->unload();
+    }
+    mPluginLoaderList.clear();
+}
+
+
+//---------------------------------------------------------------
+//UniEditorPluginLoader::getUniEditorPlugin()
+//@see header
+//---------------------------------------------------------------
+UniEditorPluginInterface* UniEditorPluginLoader::getUniEditorPlugin(
+                                                                    ConvergedMessage::MessageType messageType)
+{
+#ifdef _DEBUG
+    QDir dir(QLibraryInfo::location(QLibraryInfo::PluginsPath));
+    dir.cd("messaging\\editorplugins");
+#else
+    // plugins directory setting for HARDWARE IMAGE
+    QDir dir("Z:\\resource\\qt\\plugins\\messaging\\editorplugins");
+#endif
+
+    QString pluginPath = dir.absolutePath();
+#ifdef _DEBUG_TRACES_
+    qDebug() << "Enter LoadPlugin path = " << pluginPath;
+#endif
+
+    // get the list of all plugins...
+    QFileInfoList entries = dir.entryInfoList(QDir::Files | QDir::Readable);
+    QString filePath = QString();
+    foreach (QFileInfo entry, entries)
+        {
+            if (messageType == ConvergedMessage::Sms && entry.fileName()
+                    == SMS_PLUGIN)
+            {
+                filePath = entry.absoluteFilePath();
+                break;
+            }
+            else if (messageType == ConvergedMessage::Mms && entry.fileName()
+                    == MMS_PLUGIN)
+            {
+                filePath = entry.absoluteFilePath();
+                break;
+            }
+        }
+
+    if (!filePath.isEmpty())
+    {
+        QPluginLoader* loader = new QPluginLoader(filePath, this);
+        UniEditorPluginInterface* editorPlugin = qobject_cast<
+                UniEditorPluginInterface*> (loader->instance());
+        if (editorPlugin)
+        {
+            mPluginLoaderList << loader;
+            return editorPlugin;
+        }
+    }
+    return NULL;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorpluginloader/unieditorpluginloader.pro	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,52 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+#
+
+TARGET = unieditorpluginloader
+
+TEMPLATE = lib
+
+CONFIG += dll
+DEFINES += UNIEDITORPLUGINLOADER_DLL
+DEFINES += BUILD_DLL_EDITOR_PLUGIN
+
+
+DEPENDPATH += . \
+    inc \
+    src
+
+QT -= gui
+
+INCLUDEPATH += .
+INCLUDEPATH += inc
+INCLUDEPATH += ../../../../inc
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+# Capability
+TARGET.UID3 = 0x2001FE71
+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/unieditorpluginloader.iby  CORE_APP_LAYER_IBY_EXPORT_PATH(unieditorpluginloader.iby)"
+
+SOURCES += src/unieditorpluginloader.cpp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/inc/unieditormmsplugin.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef UNIEDITORMMSPLUGIN_H_
+#define UNIEDITORMMSPLUGIN_H_
+
+
+#include <QObject>
+#include "unieditorplugininterface.h"
+
+/**
+ * MMS data model plugin.
+ * Implements the processing of a MMS message in Message Store.
+ */
+
+class CUniEditorMmsPluginPrivate;
+
+class UniEditorMmsPlugin : public QObject, public UniEditorPluginInterface
+{
+    Q_OBJECT
+    Q_INTERFACES(UniEditorPluginInterface)
+
+public:
+    /**
+     * constructor
+     */
+    UniEditorMmsPlugin(QObject* parent = 0);
+
+    /**
+     * Destructor
+     */
+    ~UniEditorMmsPlugin();
+
+    /**
+     * @see UniEditorPluginInterface
+     */
+    ConvergedMessage::MessageType messageType();
+    
+    /**
+     * @see UniEditorPluginInterface
+     */
+    ConvergedMessage* convertFrom( TMsvId aId,
+        UniEditorPluginInterface::EditorOperation aOperation
+        =UniEditorPluginInterface::Default );
+
+    /**
+     * @see UniEditorPluginInterface
+     */
+    void deleteDraftsEntry( TMsvId aId );
+
+    /**
+     * @see UniEditorPluginInterface
+     */
+    TMsvId convertTo( ConvergedMessage *aMessage );
+    
+    /**
+     * @see UniEditorPluginInterface
+     */    
+    bool send(TMsvId aId);    
+    
+    /**
+     * @see UniEditorPluginInterface
+     */
+    TBool isServiceValid();
+
+    /**
+     * @see UniEditorPluginInterface
+     */
+    TBool validateService( TBool aEmailOverSms = EFalse );
+    
+    /**
+     * @see UniEditorPluginInterface
+     */
+    void setEncodingSettings(TBool aUnicodeMode,
+        TSmsEncoding aAlternativeEncodingType, TInt charSupportType);
+
+    /**
+     * @see UniEditorPluginInterface
+     */
+    bool getNumPDUs(QString& aBuf, TInt& aNumOfRemainingChars,
+        TInt& aNumOfPDUs, TBool& aUnicodeMode,
+        TSmsEncoding& aAlternativeEncodingType);
+    
+private:
+	
+    CUniEditorMmsPluginPrivate* d_ptr;
+};
+
+#endif
+    
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/inc/unieditormmsplugin_p.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,239 @@
+/*
+ * 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 __UNIEDITORMMSPLUGINPRIVATE_H
+#define __UNIEDITORMMSPLUGINPRIVATE_H
+
+#include <msvapi.h>
+#include <cmsvrecipientlist.h>
+#include "unieditorplugininterface.h"
+#include "convergedmessage.h"
+#include "convergedmessageid.h"
+#include "UniDataModel.h"
+// DATA TYPES
+
+// FORWARD DECLARATIONS
+
+class CClientMtmRegistry;
+class CMmsClientMtm;
+class CMmsHeaders;
+class CMmsSettings;
+class CCommsDatabase;
+class TUniSendingSettings;
+class UniDataModelPluginInterface;
+class UniDataModelLoader;
+class CUniDataModel;
+class CMsgMediaInfo;
+class CMDXMLDocument;
+class MMediaInfoObserver;
+
+// CLASS DECLARATION
+
+class CUniEditorMmsPluginPrivate : public CBase,
+        public MUniDataModelObserver,
+        public MUniObjectSaveObserver,
+        public MUniSmilComposeObserver,
+        public MMediaInfoObserver,
+		public MMsvSessionObserver
+{
+public:  // Constructors and destructor
+
+    /**
+     * Two-phased constructor.
+     */
+    static CUniEditorMmsPluginPrivate* NewL();
+
+    /**
+     * Destructor.
+     */
+    virtual ~CUniEditorMmsPluginPrivate();
+
+public: 
+
+    /**
+     * Converts message from message store into ConvergedMessage 
+     * based on the operation
+     * @param TMsvId id
+     * @param aOperation operation type
+     * @return ConvergedMessage object is returned in successfull cases and 
+     *         NULL is returned in failure cases. The ownership of the object
+     *         is transferred to the caller. 
+     */
+    ConvergedMessage* convertFromL( TMsvId aId,
+        UniEditorPluginInterface::EditorOperation aOperation );
+
+    /**
+     * delete entry from drafts folder
+     * @param aId TMsvId of the message entry to be deleted
+     */
+    void deleteDraftsEntryL( TMsvId aId );
+
+    /**
+     * Converts ConvergedMessage message into a message in store
+     * @param ConvergedMessage obj
+     * @return TMsvId id
+     */             
+    TMsvId convertToL( ConvergedMessage *aMessage );
+    
+    /**
+     * Implementation for convertToL which converts ConvergedMessage message 
+     * into a message in store
+     * @param ConvergedMessage obj
+     * @param TMsvEntry
+     */             
+    void DoConvertToL(ConvergedMessage *aMessage,TMsvEntry& entry);
+
+    /**
+     * Sends the message
+     * @param TMsvId id
+     */                 
+    void sendL( TMsvId aId );
+
+    /**
+     * Validates the service for send
+     * @param aEmailOverSms
+     * @return true if the service is valid for send
+     */                    
+    TBool validateServiceL( TBool aEmailOverSms = EFalse );
+
+    /**
+     * isServiceValidL
+     * @return TBool
+     */              
+    TBool isServiceValidL();
+
+private: // Constructors
+
+    /**
+     * C++ default constructor.
+     */
+    CUniEditorMmsPluginPrivate();
+
+    /**
+     * Returns pointer to iMmsMtm member variable  
+     */
+    CMmsClientMtm* MmsMtmL();
+
+    /**
+     * Generates details for TMsvEntry object
+     */
+    void MakeDetailsL( TDes& aDetails );
+
+    /**
+     * Populates address feilds in message from ConvergedMessage
+     */
+    void addRecipientsL(ConvergedMessage *message);
+
+    /**
+     * Populates address feilds in message from ConvergedMessage
+     */
+    void addRecipientsL(const ConvergedMessageAddressList &array, 
+        TMsvRecipientType recpType);
+
+    /**
+     * Populates converged message from the drafts entry
+     */
+    void convertFromDraftsL(ConvergedMessage& aMessage );
+
+    /**
+     * Populates address feilds into converged message
+     */
+    void populateRecipientsL(
+        ConvergedMessage &aMessage);
+
+    /**
+     * Populates body and attachment list into converged message
+     */
+    void populateMessageBodyL(ConvergedMessage &aMessage);
+    
+    /**
+     * Populates converged message for forward case
+     */
+    void convertFromForwardHandlerL(ConvergedMessage& aMessage);
+
+    /**
+     * Add object into smil 
+     * @param slide number
+     * @param filepath
+     */
+    void addObjectL(int aSlideNum, const QString& aFilePath);
+
+    /**
+     * Add attachment 
+     * @param file path
+     */
+    void addAttachmentL(const QString& aFilePath);
+
+    /**
+     * Add text object into smil 
+     * @param slide number
+     * @param text
+     */
+    void addTextObjectL(int aSlideNum, const QString& aBodyText);
+
+    /**
+     * @see MUniObjectSaveObserver
+     */
+    void ObjectSaveReady(TInt aError);
+
+    /**
+     * @see MUniSmilComposeObserver
+     */
+    void SmilComposeEvent(TInt aError);
+
+    /**
+     * @see MMediaInfoObserver
+     */
+    void MediaInfoParsed();
+
+    /**
+     * @see MUniDataModelObserver
+     */
+    void RestoreReady(TInt aParseResult, TInt aError);
+    
+    /**
+     * @see MMsvSessionObserver
+     */
+    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2,
+                             TAny* aArg3);
+
+private:
+    // Data
+    CMsvSession* iSession;
+    CClientMtmRegistry* iMtmRegistry;
+    CMmsClientMtm* iMmsMtm;
+    CMmsHeaders* iMmsHeader;
+
+    // owned
+    UniDataModelLoader* iDataModelPluginLoader;        
+    //Not owned
+    UniDataModelPluginInterface* iMmsDataPlugin;
+    // owned
+    CUniDataModel* iUniDataModel;
+    RFs ifsSession;
+    
+    // not owned
+    CMsgMediaInfo* iInsertingMedia;
+    // owned
+    CEikRichTextEditor* iEditor;
+    // owned
+    CMDXMLDocument* iDom;
+};
+
+#endif   // __UNIEDITORMMSPLUGINPRIVATE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/rom/unieditormmsplugin.iby	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,27 @@
+/*
+* 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 __UNI_EDITOR_MMS_PLUGIN_IBY__
+#define __UNI_EDITOR_MMS_PLUGIN_IBY__
+
+
+# this is the plugin stub for QT plugin
+file=ABI_DIR\UREL\unieditormmsplugin.dll               SHARED_LIB_DIR\unieditormmsplugin.dll
+data=\epoc32\data\z\resource\qt\plugins\messaging\editorplugins\unieditormmsplugin.qtplugin              \resource\qt\plugins\messaging\editorplugins\unieditormmsplugin.qtplugin
+
+#endif // __UNI_EDITOR_MMS_PLUGIN_IBY__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/src/unieditormmsplugin.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,156 @@
+/*
+ * 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:
+ *
+ */
+
+//USER INCLUDES
+#include "unieditormmsplugin.h"
+#include "unieditormmsplugin_p.h"
+#include "debugtraces.h"
+
+//---------------------------------------------------------------
+// UniEditorMmsPlugin::UniEditorMmsPlugin()
+// @see header
+//---------------------------------------------------------------
+UniEditorMmsPlugin::UniEditorMmsPlugin(QObject* parent) :
+    QObject(parent)
+{	
+    int error;
+    TRAP( error, d_ptr = CUniEditorMmsPluginPrivate::NewL());
+    QDEBUG_WRITE_FORMAT("UniEditorMmsPlugin returning with ",error);
+}
+
+//---------------------------------------------------------------
+// UniEditorMmsPlugin::~UniEditorMmsPlugin()
+// @see header
+//---------------------------------------------------------------
+UniEditorMmsPlugin::~UniEditorMmsPlugin()
+{
+    delete d_ptr;
+}
+
+//---------------------------------------------------------------
+// UniEditorMmsPlugin::messageType()
+// @see header
+//---------------------------------------------------------------
+ConvergedMessage::MessageType UniEditorMmsPlugin::messageType()
+{
+return ConvergedMessage::Mms;
+}		
+
+//---------------------------------------------------------------
+// UniEditorMmsPlugin::convertFrom()
+// @see header
+//---------------------------------------------------------------
+ConvergedMessage* UniEditorMmsPlugin::convertFrom( TMsvId aId,
+    UniEditorPluginInterface::EditorOperation aOperation )
+{
+    int error;
+    ConvergedMessage* msg = NULL;
+    TRAP( error, msg = d_ptr->convertFromL(aId,aOperation));
+    QDEBUG_WRITE_FORMAT("Exiting convertFrom with error = ",error);
+    return msg;
+}
+
+//---------------------------------------------------------------
+// UniEditorMmsPlugin::deleteDraftsEntry()
+// @see header
+//---------------------------------------------------------------
+void UniEditorMmsPlugin::deleteDraftsEntry( TMsvId aId )
+{
+    int error;
+    TRAP( error, d_ptr->deleteDraftsEntryL(aId));
+    QDEBUG_WRITE_FORMAT("Exiting deleteDraftsEntry with error = ",error);
+}
+
+//---------------------------------------------------------------
+// UniEditorMmsPlugin::convertTo()
+// @see header
+//---------------------------------------------------------------
+TMsvId UniEditorMmsPlugin::convertTo( ConvergedMessage *aMessage )
+{
+    int error;
+    TMsvId id = -1;
+    TRAP( error, id = d_ptr->convertToL(aMessage));
+    QDEBUG_WRITE_FORMAT("Exiting convertTo and msgId = ",id);
+	return id;	
+}    
+
+//---------------------------------------------------------------
+// UniEditorMmsPlugin::send()
+// @see header
+//---------------------------------------------------------------
+bool UniEditorMmsPlugin::send(TMsvId aId)
+{
+    int error = KErrNone;
+    TRAP( error, d_ptr->sendL(aId));
+    QDEBUG_WRITE_FORMAT("send returning with error= ",error);
+    
+    return (error != KErrNone) ? false : true; 
+}    
+
+//---------------------------------------------------------------
+// UniEditorMmsPlugin::isServiceValid()
+// @see header
+//---------------------------------------------------------------
+TBool UniEditorMmsPlugin::isServiceValid()
+{
+    int error;
+    TBool valid = false;
+    TRAP( error, valid = d_ptr->isServiceValidL());
+    QDEBUG_WRITE_FORMAT("Exiting isServiceValid with validity= ",valid);
+    return valid;
+}    
+
+//---------------------------------------------------------------
+// UniEditorMmsPlugin::validateService()
+// @see header
+//---------------------------------------------------------------
+TBool UniEditorMmsPlugin::validateService( TBool aEmailOverSms)
+{
+    int error;
+    TBool valid = false;
+    TRAP( error, valid = d_ptr->validateServiceL(aEmailOverSms));
+    QDEBUG_WRITE_FORMAT("Exiting validateService with validity= ",valid);
+    return valid;
+}		
+
+
+
+
+
+//---------------------------------------------------------------
+// UniEditorMmsPlugin::setEncodingSettings()
+// @see header
+//---------------------------------------------------------------
+void UniEditorMmsPlugin::setEncodingSettings(TBool /*aUnicodeMode*/,
+    TSmsEncoding /*aAlternativeEncodingType*/, TInt /*charSupportType*/)
+{
+
+}
+
+//---------------------------------------------------------------
+// UniEditorMmsPlugin::getNumPDUs()
+// @see header
+//---------------------------------------------------------------
+bool UniEditorMmsPlugin::getNumPDUs(QString& /*aBuf*/,
+    TInt& /*aNumOfRemainingChars*/, TInt& /*aNumOfPDUs*/,
+    TBool& /*aUnicodeMode*/, TSmsEncoding& /*aAlternativeEncodingType*/)
+{
+    return true;
+}
+
+Q_EXPORT_PLUGIN2(unieditormmsplugin, UniEditorMmsPlugin)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/src/unieditormmsplugin_p.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,931 @@
+/*
+ * 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 "unieditormmsplugin_p.h"
+
+// INCLUDE FILES
+#include <e32base.h>
+#include <f32file.h>
+#include <msvids.h> 
+#include <mtclreg.h>
+#include <commdb.h> 
+#include <mmsconst.h>
+#include <mmsclient.h>
+#include <mmsheaders.h>
+#include <mmssettings.h>
+#include <mmsmsventry.h>
+#include <bautils.h>
+#include <data_caging_path_literals.hrh> 
+#include <txtetext.h>
+#include <txtrich.h>
+#include <txtfmlyr.h>
+#include <MuiuOperationWait.h>
+#include <QDir>
+#include <hbglobal.h>
+#include <eikrted.h>
+#include <MsgMediaInfo.h>
+#include <MsgMediaResolver.h>
+
+#include "UniSendingSettings.h"
+#include "unidatamodelloader.h"
+#include "unidatamodelplugininterface.h"
+#include "s60qconversions.h"
+#include "debugtraces.h"
+#include "UniEditorGenUtils.h"
+
+// Possible values for mms validity period in seconds
+const TInt32 KUniMmsValidityPeriod1h = 3600;
+const TInt32 KUniMmsValidityPeriod6h = 21600;
+const TInt32 KUniMmsValidityPeriod24h = 86400;
+const TInt32 KUniMmsValidityPeriod3Days = 259200;
+const TInt32 KUniMmsValidityPeriodWeek = 604800;
+const TInt32 KUniMmsValidityPeriodMax = 0;
+
+const TInt  KMaxDetailsLength = 64; // Copy max this many chars to TMsvEntry::iDetails
+_LIT( KAddressSeparator, ";" );
+
+#define KSenduiMtmMmsUidValue 0x100058E1
+const TUid KSenduiMtmMmsUid = {KSenduiMtmMmsUidValue};
+
+#define LOC_FWD hbTrId("txt_messaging_formlabel_fwd")
+
+// -----------------------------------------------------------------------------
+// Two-phased constructor.
+// @see Header
+// -----------------------------------------------------------------------------
+//
+CUniEditorMmsPluginPrivate* CUniEditorMmsPluginPrivate::NewL()
+{
+    CUniEditorMmsPluginPrivate* self = new ( ELeave ) CUniEditorMmsPluginPrivate(); 
+    return self;
+}
+
+// -----------------------------------------------------------------------------
+// Destructor
+// @see Header
+// -----------------------------------------------------------------------------
+//
+CUniEditorMmsPluginPrivate::~CUniEditorMmsPluginPrivate()
+{
+    //In case there is no settings at all leave occurs and resource not freed
+    delete iMmsHeader;
+
+    delete iEditor;
+    delete iDom;
+    delete iUniDataModel;
+    ifsSession.Close();
+
+    delete iMmsMtm;
+    delete iMtmRegistry;
+    delete iDataModelPluginLoader;
+    delete iSession;
+}
+
+// -----------------------------------------------------------------------------
+// C++ default constructor
+// @see Header
+// -----------------------------------------------------------------------------
+//
+CUniEditorMmsPluginPrivate::CUniEditorMmsPluginPrivate( )
+{
+    iSession = CMsvSession::OpenSyncL(*this);
+}
+
+// -----------------------------------------------------------------------------
+// convertFromL
+// @see Header
+// -----------------------------------------------------------------------------
+//
+ConvergedMessage* CUniEditorMmsPluginPrivate::convertFromL( TMsvId aId,
+    UniEditorPluginInterface::EditorOperation aOperation )
+{
+    QDEBUG_WRITE("Enter convertFromL");
+
+    MmsMtmL()->SwitchCurrentEntryL( aId );
+    MmsMtmL()->LoadMessageL();
+
+    TMsvEntry entry =MmsMtmL()->Entry().Entry();
+
+    ConvergedMessage* msg = new ConvergedMessage;
+    
+    CleanupStack::PushL(msg);
+    if( entry.Parent() == KMsvDraftEntryIdValue )
+    {
+       convertFromDraftsL(*msg);
+    }
+    else if( aOperation == UniEditorPluginInterface::Forward)
+    {
+        convertFromForwardHandlerL(*msg);          
+    }
+    CleanupStack::Pop(msg);
+    QDEBUG_WRITE("Exit convertFromL");
+    return msg;
+}
+
+// -----------------------------------------------------------------------------
+// convertFromDraftsL
+// @see Header
+// -----------------------------------------------------------------------------
+//
+void CUniEditorMmsPluginPrivate::convertFromDraftsL(
+    ConvergedMessage& aMessage )
+{
+    QDEBUG_WRITE("Enter convertFromDraftsL");
+    
+    TMsvEntry entry =MmsMtmL()->Entry().Entry();
+
+    //Message id 
+    ConvergedMessageId id(entry.Id());
+    aMessage.setMessageId(id);
+
+    // Set Message type
+    aMessage.setMessageType(ConvergedMessage::Mms);
+
+    //Populate recipients
+    populateRecipientsL(aMessage);
+
+    //populate convergedmessage with the subject
+    aMessage.setSubject(S60QConversions::s60DescToQString(
+        MmsMtmL()->SubjectL()));
+
+    // Priority
+    TMsvPriority priority = entry.Priority();
+    if( EMsvHighPriority == priority )
+    {
+        aMessage.setPriority(ConvergedMessage::High);
+    }
+    else if( EMsvLowPriority == priority )
+    {
+        aMessage.setPriority(ConvergedMessage::Low);
+    }
+    else if( EMsvMediumPriority == priority )
+    {
+        aMessage.setPriority(ConvergedMessage::Normal);
+    }
+
+    // Set direction and location
+    aMessage.setDirection(ConvergedMessage::Outgoing);
+    aMessage.setLocation (ConvergedMessage::Draft);
+
+    //Populate body and attachments
+    populateMessageBodyL(aMessage);
+
+    QDEBUG_WRITE("Exit convertFromDraftsL");
+}
+
+// -----------------------------------------------------------------------------
+// convertFromForwardHandlerL
+// @see Header
+// -----------------------------------------------------------------------------
+//
+void CUniEditorMmsPluginPrivate::convertFromForwardHandlerL(
+    ConvergedMessage &aMessage)
+{
+    QDEBUG_WRITE("Enter convertFromForwardHandlerL");
+
+    TMsvEntry entry =MmsMtmL()->Entry().Entry();
+
+    //populate convergedmessage with the subject prepended with FW:
+    QString subject = LOC_FWD + S60QConversions::s60DescToQString(
+        MmsMtmL()->SubjectL());     
+    aMessage.setSubject(subject);
+
+    // Priority
+    TMsvPriority priority = entry.Priority();
+    if( EMsvHighPriority == priority )
+    {
+        aMessage.setPriority(ConvergedMessage::High);
+    }
+    else if( EMsvLowPriority == priority )
+    {
+        aMessage.setPriority(ConvergedMessage::Low);
+    }
+    else if( EMsvMediumPriority == priority )
+    {
+        aMessage.setPriority(ConvergedMessage::Normal);
+    }
+
+    //Populate body and attachments
+    //The region info inside slides is not maintained
+    populateMessageBodyL(aMessage);
+    
+    QDEBUG_WRITE("Exit convertFromForwardHandlerL");
+}
+
+// -----------------------------------------------------------------------------
+// populateMessageBodyL
+// @see Header
+// -----------------------------------------------------------------------------
+//
+void CUniEditorMmsPluginPrivate::populateMessageBodyL(
+    ConvergedMessage &aMessage)
+{
+    QDEBUG_WRITE("Enter populateMessageBodyL");
+    
+    if(!iDataModelPluginLoader)
+    {
+        iDataModelPluginLoader = new UniDataModelLoader;  
+        iMmsDataPlugin = iDataModelPluginLoader->getDataModelPlugin(ConvergedMessage::Mms);
+    }
+
+    iMmsDataPlugin->restore(*MmsMtmL());
+
+    int slideCount = iMmsDataPlugin->slideCount();
+
+    int attachmentCount = iMmsDataPlugin->attachmentCount();
+
+    ConvergedMessageAttachmentList attachmentList;
+
+    if (slideCount > 0)
+    {
+        UniMessageInfoList slideContentList = 
+            iMmsDataPlugin->slideContent(0);
+        for (int i = 0; i < slideContentList.size(); ++i)
+        {
+            if( slideContentList.at(i)->mimetype().contains("text") )
+            {
+                QString textContent;
+                QFile file(slideContentList.at(i)->path());
+                file.open(QIODevice::ReadOnly);
+                textContent = file.readAll();
+                aMessage.setBodyText(textContent);
+                file.close();
+            }
+            else
+            {
+            ConvergedMessageAttachment* attachment =
+                new ConvergedMessageAttachment(
+                    slideContentList.at(i)->path(),
+                    ConvergedMessageAttachment::EInline);
+            attachmentList << attachment;
+            }
+        }
+        
+        foreach(UniMessageInfo* slide,slideContentList)
+        {
+            delete slide;
+        }
+    }
+
+    
+    if(attachmentCount > 0)
+    {
+        UniMessageInfoList modelAttachmentList = 
+            iMmsDataPlugin->attachmentList();
+
+        for (int i = 0; i < modelAttachmentList.count(); ++i)
+        {
+            ConvergedMessageAttachment* attachment =
+                new ConvergedMessageAttachment(
+                    modelAttachmentList.at(i)->path(),
+                    ConvergedMessageAttachment::EAttachment);
+            attachmentList << attachment;
+        }
+        
+        foreach(UniMessageInfo* attachment,modelAttachmentList)
+        {
+            delete attachment;
+        }
+    }
+
+    if(attachmentList.count() > 0)
+    {
+        aMessage.addAttachments(attachmentList);
+    }       
+
+    //Delete the pluginloader instance
+    delete iDataModelPluginLoader;
+    iDataModelPluginLoader = NULL;
+    iMmsDataPlugin = NULL;
+    
+    QDEBUG_WRITE("Exit populateMessageBodyL");
+}
+
+// -----------------------------------------------------------------------------
+// convertToL
+// @see Header
+// -----------------------------------------------------------------------------
+//
+TMsvId CUniEditorMmsPluginPrivate::convertToL(ConvergedMessage *aMessage)
+{
+    QDEBUG_WRITE("Enter ConvertToL");
+
+    // create message in drafts.
+    CMsvEntry* cEntry = MmsMtmL()->Session().GetEntryL(KMsvDraftEntryId);
+
+    CleanupStack::PushL(cEntry);
+    MmsMtmL()->SwitchCurrentEntryL(cEntry->EntryId());
+
+    TMsvEntry entry;
+    entry.iMtm = MmsMtmL()->Type();
+    entry.iType = KUidMsvMessageEntry;
+    entry.iServiceId = MmsMtmL()->DefaultServiceL();
+    entry.iDate.UniversalTime();
+
+    cEntry->CreateL(entry);
+
+    TMsvId entryId = entry.Id();
+
+    //Since entry is created if any of the below functions leave 
+    //the created entry has to be deleted
+    TInt error = KErrNone;
+    TRAP(error,DoConvertToL(aMessage,entry));
+    
+    CleanupStack::PopAndDestroy(cEntry);
+
+    if (error != KErrNone)
+    {
+        this->deleteDraftsEntryL(entryId);
+        entryId = -1; //Set Invalid entry id
+    }
+    QDEBUG_WRITE_FORMAT("Exit ConvertToL the entryId= ",entryId);
+    return entryId;
+}
+
+// -----------------------------------------------------------------------------
+// DoConvertToL
+// @see Header
+// -----------------------------------------------------------------------------
+//
+void CUniEditorMmsPluginPrivate::DoConvertToL(ConvergedMessage *aMessage,
+    TMsvEntry& entry)
+{
+    TMsvId entryId = entry.Id();
+ 
+     // switch to created entry
+     MmsMtmL()->SwitchCurrentEntryL(entryId);
+
+     //Add recipients
+     addRecipientsL(aMessage);
+
+     //There is no size check inside plugin as it assumes 
+     //we get proper data from editor
+     HBufC* sub = S60QConversions::qStringToS60Desc(aMessage->subject());
+     if( sub )
+     {
+         CleanupStack::PushL(sub);
+         MmsMtmL()->SetSubjectL( *sub );
+         CleanupStack::PopAndDestroy(sub);
+     }
+
+     //Add attachments
+     // fetch attachment list and populate the smil model
+     ConvergedMessageAttachmentList attachmentlist = aMessage->attachments();
+     int attachmentcount = attachmentlist.count();
+     if ((attachmentcount> 0) || !(aMessage->bodyText().isEmpty()))
+     {
+        QDEBUG_WRITE("Before calling iUniDataModel->restore");
+
+        User::LeaveIfError(ifsSession.Connect());
+
+        delete iUniDataModel;
+        iUniDataModel = NULL;
+
+        iUniDataModel = CUniDataModel::NewL(ifsSession, *MmsMtmL());
+        iUniDataModel->RestoreL(*this, ETrue);
+
+        QDEBUG_WRITE("Before calling iUniDataModel->addSlide");
+
+        bool slideContentAdded = false;
+
+        //Adding first slide
+        iUniDataModel->SmilModel().AddSlideL(0);
+
+        for (int i = 0; i < attachmentcount; i++)
+        {
+            if (attachmentlist[i]->attachmentType()
+                    == ConvergedMessageAttachment::EInline)
+            {
+                slideContentAdded = true;
+                addObjectL(0, attachmentlist[i]->filePath());
+
+            }
+            else if (attachmentlist[i]->attachmentType()
+                    == ConvergedMessageAttachment::EAttachment)
+            {
+                addAttachmentL(attachmentlist[i]->filePath());
+            }
+        }
+
+        if (! (aMessage->bodyText().isEmpty()))
+        {
+            slideContentAdded = true;
+            addTextObjectL(0, aMessage->bodyText());
+        }
+
+        if (slideContentAdded)
+        {
+            iUniDataModel->ObjectList().SaveAll(*this, CMsvAttachment::EMsvFile);
+
+            // Open store even if we didn't need it here.
+            // -> We don't need to check later whether the store 
+            //is open or not.    
+            CMsvStore* editStore = MmsMtmL()->Entry().EditStoreL();
+
+            //Ensure that the store is deleted if anything 
+            //leaves before deletion otherwise the entry store will be locked
+            //and entry cant be deleted
+            CleanupStack::PushL(editStore);
+
+            delete iDom;
+            iDom = NULL;
+
+            iDom = iUniDataModel->SmilModel().ComposeL();
+            iUniDataModel->SmilList().CreateSmilAttachmentL(*this,
+                                                            *editStore,
+                                                            iDom);
+
+             //Commit the store before setting the root
+             editStore->CommitL();
+
+             //delete the store before setMessageRoot is called
+             CleanupStack::PopAndDestroy(editStore);
+
+            //Set message root after composing SMIL but before 
+            //calling SaveMessageL and after the store has been deleted
+            MmsMtmL()->SetMessageRootL(iUniDataModel->SmilList().GetSmilAttachmentByIndex(0));
+        }
+        else
+        {
+            //Remove the slide   
+            iUniDataModel->SmilModel().RemoveSlide(0);
+
+             // Open store even if we didn't need it here.
+             // -> We don't need to check later whether the store is open or not.    
+             CMsvStore* editStore = MmsMtmL()->Entry().EditStoreL();
+             
+             //Ensure that the store is deleted if anything 
+             //leaves before deletion otherwise the entry store will be locked
+             //and entry cant be deleted
+             CleanupStack::PushL(editStore);
+             
+             //Commit the store before setting the root
+             editStore->CommitL();
+
+             //delete the store before setMessageRoot is called
+             CleanupStack::PopAndDestroy(editStore);
+         }
+     }
+
+     //Set the priority before calling save
+     ConvergedMessage::Priority priority = aMessage->priority();
+     if (ConvergedMessage::High == priority)
+     {
+         MmsMtmL()->SetMessagePriority(EMmsPriorityHigh);
+     }
+     else if (ConvergedMessage::Low == priority)
+     {
+         MmsMtmL()->SetMessagePriority(EMmsPriorityLow);
+     }
+     else if (ConvergedMessage::Normal == priority)
+     {
+         MmsMtmL()->SetMessagePriority(EMmsPriorityNormal);
+     }
+
+     //Saving the changes
+     MmsMtmL()->SaveMessageL();
+
+     entry = MmsMtmL()->Entry().Entry();
+
+     TBuf<KMaxDetailsLength> detailsBuf;
+     MakeDetailsL( detailsBuf );
+     entry.iDetails.Set( detailsBuf );
+
+     MmsMtmL()->Entry().ChangeL(entry); // commit changes      
+
+}
+
+// -----------------------------------------------------------------------------
+// sendL
+// @see Header
+// -----------------------------------------------------------------------------
+//
+void CUniEditorMmsPluginPrivate::sendL( TMsvId aId )
+{
+    QDEBUG_WRITE("Enter sendL");
+
+    MmsMtmL()->SwitchCurrentEntryL( aId );
+    MmsMtmL()->LoadMessageL();
+    CMuiuOperationWait* wait = CMuiuOperationWait::NewLC();
+    CMsvOperation* oper = MmsMtmL()->SendL( wait->iStatus );
+    CleanupStack::PushL( oper );
+    wait->Start();
+    CleanupStack::PopAndDestroy( oper );
+    CleanupStack::PopAndDestroy( wait );
+
+    QDEBUG_WRITE("Exit sendL");
+}
+
+// -----------------------------------------------------------------------------
+// validateServiceL
+// @see Header
+// -----------------------------------------------------------------------------
+//
+TBool CUniEditorMmsPluginPrivate::validateServiceL( TBool /*aEmailOverSms*/ )
+{
+    QDEBUG_WRITE("Enter ValidateServiceL");
+
+    //Check if the mms client mtm object is already created or not
+    if( iMmsMtm )
+    {
+        // If mms client mtm object is already created restore the settings
+        iMmsMtm->RestoreSettingsL();
+    }
+
+    TMsvId service = MmsMtmL()->DefaultServiceL();
+    TBool valid( MmsMtmL()->ValidateService( service ) == KErrNone );
+
+    QDEBUG_WRITE_FORMAT("Exit ValidateServiceL the return val= ",valid);
+    return valid;
+}
+
+// -----------------------------------------------------------------------------
+// isServiceValidL
+// @see Header
+// -----------------------------------------------------------------------------
+//
+TBool CUniEditorMmsPluginPrivate::isServiceValidL()
+{
+    return MmsMtmL()->ValidateService( MmsMtmL()->DefaultServiceL() ) == KErrNone;
+}
+
+// -----------------------------------------------------------------------------
+// MmsMtmL
+// @see Header
+// -----------------------------------------------------------------------------
+//
+CMmsClientMtm* CUniEditorMmsPluginPrivate::MmsMtmL()
+{
+    if ( !iMmsMtm )
+    {
+        if ( !iMtmRegistry )
+        {            
+            iMtmRegistry = CClientMtmRegistry::NewL( *iSession );
+        }
+        iMmsMtm = static_cast<CMmsClientMtm*>( iMtmRegistry->NewMtmL( 
+            KSenduiMtmMmsUid ) );
+    }
+    return iMmsMtm;
+}
+
+// ---------------------------------------------------------
+// MakeDetailsL
+// @see Header
+// ---------------------------------------------------------
+//
+void CUniEditorMmsPluginPrivate::MakeDetailsL( TDes& aDetails )
+{
+    // This very same code can be found in CUniAddressHandler. 
+    // They should be put in common location some day...
+    const CMsvRecipientList& addresses = MmsMtmL()->AddresseeList();
+    TInt addrCnt = addresses.Count();
+
+    TPtrC stringToAdd;
+    for ( TInt i = 0; i < addrCnt; i++)
+    {
+        // Only address is converted to western. 
+        // There may numbers in contact name - they must not be converted 
+        TPtrC alias = TMmsGenUtils::Alias( addresses[i] );
+        HBufC* addressBuf = NULL;
+
+        if ( alias.Length() != 0 )
+        {
+            stringToAdd.Set( alias );
+        }
+        else
+        {
+            TPtrC address = TMmsGenUtils::PureAddress( addresses[i] );
+            addressBuf = HBufC::NewLC( address.Length() );
+            TPtr addressPtr = addressBuf->Des();
+            addressPtr.Copy( address );
+            stringToAdd.Set( addressPtr );
+
+            // 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;
+        }
+
+        if ( ( aDetails.Length() != 0 ) &&   // Not a first address
+                ( aDetails.Length() + KAddressSeparator().Length() < KMaxDetailsLength ) )
+        {
+            // Add separator
+            aDetails.Append( KAddressSeparator() );
+        }
+
+        if ( aDetails.Length() + stringToAdd.Length() < KMaxDetailsLength ) 
+        {
+            // whole string fits. Add it.
+            aDetails.Append( stringToAdd );
+            if ( addressBuf )
+            {
+                CleanupStack::PopAndDestroy( addressBuf );
+            }
+        }
+        else
+        {
+            // Only part of the string fits
+            TInt charsToAdd = KMaxDetailsLength - aDetails.Length();
+
+            if ( charsToAdd <= 0 )
+            {
+                // Cannot add any more chars 
+                break;
+            }
+
+            if ( charsToAdd >= stringToAdd.Length() )
+            {
+                // Guarantee that charsToAdd is not larger that stringToAdd lenght 
+                charsToAdd = stringToAdd.Length();
+            }
+
+            aDetails.Append( stringToAdd.Left( charsToAdd ) );
+            if ( addressBuf )
+            {
+                CleanupStack::PopAndDestroy( addressBuf );
+            }
+            break;
+        }
+    }
+}
+
+//---------------------------------------------------------------
+// CUniEditorMmsPluginPrivate::addRecipientsL
+// @see header
+//---------------------------------------------------------------
+void CUniEditorMmsPluginPrivate::addRecipientsL(ConvergedMessage *message)
+{
+    //add To feilds
+    ConvergedMessageAddressList toAddressArray = message->toAddressList();
+    addRecipientsL(toAddressArray, EMsvRecipientTo);
+
+    //add cc feilds
+    ConvergedMessageAddressList ccAddressArray = message->ccAddressList();
+    addRecipientsL(ccAddressArray, EMsvRecipientCc);
+
+    //add bcc feilds
+    ConvergedMessageAddressList bccAddressArray = message->bccAddressList();
+    addRecipientsL(bccAddressArray, EMsvRecipientBcc);
+}
+
+//---------------------------------------------------------------
+// CUniEditorMmsPluginPrivate::addRecipientsL
+// @see header
+//---------------------------------------------------------------
+void CUniEditorMmsPluginPrivate::addRecipientsL(
+    const ConvergedMessageAddressList &array,
+    TMsvRecipientType recpType)
+{    
+
+    for (int i = 0; i < array.count(); ++i)
+    {
+        if(array[i]->address().isEmpty())
+        {
+            continue;
+        }
+        // convert from QString to HBufC
+        HBufC* addr = S60QConversions::qStringToS60Desc(array[i]->address());
+
+        CleanupStack::PushL(addr);
+
+        if(TMmsGenUtils::Alias(*addr).Length() > 0)
+        {    
+            MmsMtmL()->AddAddresseeL(recpType, TMmsGenUtils::PureAddress(*addr),
+                TMmsGenUtils::Alias(*addr));
+        }
+        else
+        {
+            HBufC* displayName = S60QConversions::qStringToS60Desc(array[i]->alias());
+            if(displayName)
+            {
+                CleanupStack::PushL(displayName);
+
+                MmsMtmL()->AddAddresseeL(recpType, TMmsGenUtils::PureAddress(*addr),
+                    *displayName);
+
+                CleanupStack::PopAndDestroy(displayName);
+            }
+            else
+            {
+                MmsMtmL()->AddAddresseeL(recpType, TMmsGenUtils::PureAddress(*addr));    
+            }
+        }
+        CleanupStack::PopAndDestroy(addr);
+    }
+}
+
+// ----------------------------------------------------------------------------
+// CUniEditorMmsPluginPrivate::populateRecipientsL
+// @see header
+// ----------------------------------------------------------------------------
+//
+void CUniEditorMmsPluginPrivate::populateRecipientsL(
+    ConvergedMessage &aMessage)
+    {
+    QDEBUG_WRITE("Enter populateRecipientsL");
+
+
+    // get recipient list
+    const CMsvRecipientList& addresses = MmsMtmL()->AddresseeList();
+    TInt count = addresses.Count();
+
+    // extract each address and populate into ConvergedMessageAddress
+    for (TInt i = 0; i < count; ++i)
+        {
+        //Address
+        QString address = S60QConversions::s60DescToQString(
+            TMmsGenUtils::PureAddress(addresses[i]));
+        //Alias
+        QString alias = S60QConversions::s60DescToQString(
+            TMmsGenUtils::Alias(addresses[i]));
+
+        //add recipient to convergedMessage
+        ConvergedMessageAddress messageAddress(address, alias);
+        if (addresses.Type(i) == EMsvRecipientTo)
+            {
+            aMessage.addToRecipient(messageAddress);
+            }
+        else if (addresses.Type(i) == EMsvRecipientCc)
+            {
+            aMessage.addCcRecipient(messageAddress);
+            }
+        else if (addresses.Type(i) == EMsvRecipientBcc)
+            {
+            aMessage.addBccRecipient(messageAddress);
+            }
+        }
+
+    QDEBUG_WRITE("Exit populateRecipientsL");
+
+    }
+
+// ----------------------------------------------------------------------------
+// CUniEditorMmsPluginPrivate::deleteDraftsEntryL
+// @see header
+// ----------------------------------------------------------------------------
+//
+void CUniEditorMmsPluginPrivate::deleteDraftsEntryL( TMsvId aId )
+{
+    CMsvEntry* pEntry = iSession->GetEntryL(KMsvDraftEntryIdValue);
+    CleanupStack::PushL(pEntry);
+    pEntry->DeleteL( aId );
+    CleanupStack::PopAndDestroy(pEntry);
+}
+
+
+// -----------------------------------------------------------------------------
+// addObjectL
+// @see Header
+// -----------------------------------------------------------------------------
+//
+void CUniEditorMmsPluginPrivate::addObjectL(int aSlideNum, const QString& aFilePath)
+{
+
+    HBufC* filePath = S60QConversions::qStringToS60Desc(aFilePath);
+
+    if (filePath)
+    {
+        CleanupStack::PushL(filePath);
+        RFile file = iUniDataModel->MediaResolver().FileHandleL(*filePath);
+        CleanupClosePushL(file);
+
+        iInsertingMedia = iUniDataModel->MediaResolver().CreateMediaInfoL(file);
+
+        iUniDataModel->MediaResolver().ParseInfoDetailsL(iInsertingMedia, file);
+        iUniDataModel->SmilModel().AddObjectL(*this, aSlideNum, iInsertingMedia);
+
+        //Since the ownership is transferred dont delete these
+        iInsertingMedia = NULL;
+        CleanupStack::PopAndDestroy(&file);
+        CleanupStack::PopAndDestroy(filePath);
+    }
+
+}
+
+
+// -----------------------------------------------------------------------------
+// addAttachmentL
+// @see Header
+// -----------------------------------------------------------------------------
+//
+void CUniEditorMmsPluginPrivate::addAttachmentL(const QString& aFilePath)
+{
+    HBufC * filePath = S60QConversions::qStringToS60Desc(aFilePath);
+    if (filePath)
+    {
+        CleanupStack::PushL(filePath);
+
+        RFile file = iUniDataModel->MediaResolver().FileHandleL(*filePath);
+        CleanupClosePushL(file);
+
+        iInsertingMedia = iUniDataModel->MediaResolver().CreateMediaInfoL(file);
+
+        iUniDataModel->MediaResolver().ParseInfoDetailsL(iInsertingMedia, file);
+        iUniDataModel->AddAttachmentL(*this,
+                                      iInsertingMedia,
+                                      CMsvAttachment::EMsvFile);
+
+        //Since the ownership is transferred dont delete these
+        iInsertingMedia = NULL;
+
+        CleanupStack::PopAndDestroy(&file);
+        CleanupStack::PopAndDestroy(filePath);
+    }
+
+}
+
+
+// -----------------------------------------------------------------------------
+// addTextObjectL
+// @see Header
+// -----------------------------------------------------------------------------
+//
+void CUniEditorMmsPluginPrivate::addTextObjectL(int aSlideNum, const QString& aBodyText)
+{
+    delete iEditor;
+    iEditor = NULL;
+
+    HBufC* textContent = S60QConversions::qStringToS60Desc(aBodyText);
+    if (textContent)
+    {
+        CleanupStack::PushL(textContent);
+
+        iEditor = new CEikRichTextEditor;
+        iEditor->ConstructL(NULL, 0, 0, CEikEdwin::ENoAutoSelection
+                | CEikEdwin::EOwnsWindow, 0, 0);
+        iEditor->RichText()->InsertL(0, *textContent);
+
+        iUniDataModel->SmilModel().AddTextObjectL(aSlideNum, iEditor);
+        CleanupStack::PopAndDestroy(textContent);
+    }
+}
+
+
+// -----------------------------------------------------------------------------
+// ObjectSaveReady
+// @see Header
+// -----------------------------------------------------------------------------
+//
+void CUniEditorMmsPluginPrivate::ObjectSaveReady(TInt /*aError*/)
+{
+
+}
+
+// -----------------------------------------------------------------------------
+// MediaInfoParsed
+// @see Header
+// -----------------------------------------------------------------------------
+//
+void CUniEditorMmsPluginPrivate::MediaInfoParsed()
+{
+
+}
+
+// -----------------------------------------------------------------------------
+// SmilComposeEvent
+// @see Header
+// -----------------------------------------------------------------------------
+//
+void CUniEditorMmsPluginPrivate::SmilComposeEvent(TInt /*aError*/)
+{
+
+}
+
+// -----------------------------------------------------------------------------
+// RestoreReady
+// @see Header
+// -----------------------------------------------------------------------------
+//
+void CUniEditorMmsPluginPrivate::RestoreReady(TInt /*aParseResult*/, TInt /*aError*/)
+{
+}
+
+
+// HandleSessionEventL
+// @see Header
+// -----------------------------------------------------------------------------
+//
+void CUniEditorMmsPluginPrivate::HandleSessionEventL(TMsvSessionEvent /*aEvent*/,
+                                                  TAny* /*aArg1*/,
+                                                  TAny* /*aArg2*/, TAny* /*aArg3*/)
+{
+// do nothing
+}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/bwins/test_mms_pluginu.def	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,23 @@
+EXPORTS
+	qt_plugin_instance @ 1 NONAME
+	qt_plugin_query_verification_data @ 2 NONAME
+	?createMMSMessageWithAttachmentAndSend@TestMmsPlugin@@AAEXH@Z @ 3 NONAME ; void TestMmsPlugin::createMMSMessageWithAttachmentAndSend(int)
+	?validateMsg@TestMmsPlugin@@AAEXABVConvergedMessage@@ABVQString@@@Z @ 4 NONAME ; void TestMmsPlugin::validateMsg(class ConvergedMessage const &, class QString const &)
+	?tr@TestMmsPlugin@@SA?AVQString@@PBD0@Z @ 5 NONAME ; class QString TestMmsPlugin::tr(char const *, char const *)
+	?getStaticMetaObject@TestMmsPlugin@@SAABUQMetaObject@@XZ @ 6 NONAME ; struct QMetaObject const & TestMmsPlugin::getStaticMetaObject(void)
+	?cleanupTestCase@TestMmsPlugin@@AAEXXZ @ 7 NONAME ; void TestMmsPlugin::cleanupTestCase(void)
+	?testReceived@TestMmsPlugin@@AAEXH@Z @ 8 NONAME ; void TestMmsPlugin::testReceived(int)
+	?qt_metacast@TestMmsPlugin@@UAEPAXPBD@Z @ 9 NONAME ; void * TestMmsPlugin::qt_metacast(char const *)
+	?qt_metacall@TestMmsPlugin@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 10 NONAME ; int TestMmsPlugin::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?trUtf8@TestMmsPlugin@@SA?AVQString@@PBD0H@Z @ 11 NONAME ; class QString TestMmsPlugin::trUtf8(char const *, char const *, int)
+	?staticMetaObject@TestMmsPlugin@@2UQMetaObject@@B @ 12 NONAME ; struct QMetaObject const TestMmsPlugin::staticMetaObject
+	?init@TestMmsPlugin@@AAEXXZ @ 13 NONAME ; void TestMmsPlugin::init(void)
+	?testSendMMS@TestMmsPlugin@@AAEXXZ @ 14 NONAME ; void TestMmsPlugin::testSendMMS(void)
+	?trUtf8@TestMmsPlugin@@SA?AVQString@@PBD0@Z @ 15 NONAME ; class QString TestMmsPlugin::trUtf8(char const *, char const *)
+	?tr@TestMmsPlugin@@SA?AVQString@@PBD0H@Z @ 16 NONAME ; class QString TestMmsPlugin::tr(char const *, char const *, int)
+	?createMMSMessageWithSmilTextAndImageAttachmentAndSend@TestMmsPlugin@@AAEXXZ @ 17 NONAME ; void TestMmsPlugin::createMMSMessageWithSmilTextAndImageAttachmentAndSend(void)
+	?cleanup@TestMmsPlugin@@AAEXXZ @ 18 NONAME ; void TestMmsPlugin::cleanup(void)
+	?initTestCase@TestMmsPlugin@@AAEXXZ @ 19 NONAME ; void TestMmsPlugin::initTestCase(void)
+	?testMmsReceived@TestMmsPlugin@@AAEXXZ @ 20 NONAME ; void TestMmsPlugin::testMmsReceived(void)
+	?metaObject@TestMmsPlugin@@UBEPBUQMetaObject@@XZ @ 21 NONAME ; struct QMetaObject const * TestMmsPlugin::metaObject(void) const
+
Binary file messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/mms.rsc has changed
Binary file messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/not.rsc has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/testmmsplugin.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,322 @@
+/*
+ * 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 "testmmsplugin.h"
+#include <QtTest/QtTest>
+#include "debugtraces.h"
+
+#include <QTimer>
+#include <QSignalSpy>
+
+#include "convergedmessage.h"
+#include "TestMsg.h"
+#include "convergedmessageid.h"
+#include "unieditormmsplugin.h"
+#include "messageserviceaction.h"
+//---------------------------------------------------------------
+// TestMmsPlugin::initTestCase
+//---------------------------------------------------------------
+void TestMmsPlugin::initTestCase()
+{
+    msgPlugin = new UniEditorMmsPlugin();
+    QVERIFY(msgPlugin != 0);
+    smsId = -1;
+    mmsId = -1;
+}
+
+//---------------------------------------------------------------
+// TestMmsPlugin::cleanupTestCase
+//---------------------------------------------------------------
+void TestMmsPlugin::cleanupTestCase()
+{
+    delete msgPlugin;
+}
+
+//---------------------------------------------------------------
+// TestMmsPlugin::init
+//---------------------------------------------------------------
+
+void TestMmsPlugin::init()
+{
+}
+
+//---------------------------------------------------------------
+// TestMmsPlugin::cleanup
+//---------------------------------------------------------------
+void TestMmsPlugin::cleanup()
+{
+}
+
+//---------------------------------------------------------------
+// TestMmsPlugin::testSendMMS
+//---------------------------------------------------------------
+
+void TestMmsPlugin::testSendMMS()
+{
+
+    //register user defined object to meta system.
+    qRegisterMetaType<ConvergedMessage*> ("ConvergedMessage*");
+    
+
+    createMMSMessageWithAttachmentAndSend();
+     //wait for the response to complete 
+     //as sending a message goes through different stages
+     
+    //Create a smil attachment with image and text
+    createMMSMessageWithSmilTextAndImageAttachmentAndSend();
+   
+    //Create MMS with Normal priority
+    createMMSMessageWithAttachmentAndSend(ETrue);
+}
+
+
+void TestMmsPlugin::createMMSMessageWithSmilTextAndImageAttachmentAndSend()
+    {
+    QString service = TEST_SERVICE_NAME_MMS;
+    QString bodyText = TEST_MSG_BODY;
+    QString subject  = TEST_MSG_SUBJECT;
+    qint64 timeStamp = QDateTime::currentDateTime().toTime_t();
+    
+    QString sender(TEST_SENDER);
+    ConvergedMessageAddress address(sender);
+    ConvergedMessageAttachmentList attachmentList;
+  
+    ConvergedMessageAttachment* attachmentImage = 
+        new ConvergedMessageAttachment(TEST_ATTACHMENT4, ConvergedMessageAttachment::EAttachment);
+    attachmentList.append(attachmentImage);
+    
+    ConvergedMessageAttachment* attachmenttext = 
+            new ConvergedMessageAttachment(TEST_ATTACHMENT5, ConvergedMessageAttachment::EAttachment);
+    attachmentList.append(attachmenttext);
+    
+    ConvergedMessageAttachment* attachmentSmil = 
+                new ConvergedMessageAttachment(TEST_ATTACHMENT3, ConvergedMessageAttachment::ESmil);
+    attachmentList.append(attachmentSmil);
+     
+    
+    
+    ConvergedMessage msg;
+    msg.setMessageType(ConvergedMessage::Mms);
+    msg.setSubject(subject);
+    msg.setTimeStamp(timeStamp);
+    msg.addToRecipient(address);
+    msg.addAttachments(attachmentList);
+    msg.setPriority(ConvergedMessage::Low);
+    
+    long int id = msgPlugin->convertTo(&msg);
+    msgPlugin->send(id);
+
+    }
+
+
+//---------------------------------------------------------------
+// TestMmsPlugin::testMmsReceived
+//---------------------------------------------------------------
+void TestMmsPlugin::testMmsReceived()
+{
+    testReceived(msgPlugin->messageType());  
+    QTest::qWait(5000);
+}
+
+/*
+ * Creates a Smil file with only a text document as attachment
+ */
+ 
+void TestMmsPlugin::createMMSMessageWithAttachmentAndSend(TBool priority)
+    {
+    QString service = TEST_SERVICE_NAME_MMS;
+    QString bodyText = TEST_MSG_BODY;
+    QString subject  = TEST_MSG_SUBJECT;
+    qint64 timeStamp = QDateTime::currentDateTime().toTime_t();
+    
+    QString sender(TEST_SENDER);
+    ConvergedMessageAddress address(sender);
+    ConvergedMessageAttachmentList attachmentList;    
+
+   
+    ConvergedMessageAttachment* attachment2 = 
+            new ConvergedMessageAttachment(TEST_ATTACHMENT2, ConvergedMessageAttachment::ESmil);
+    
+    ConvergedMessageAttachment* attachment = 
+        new ConvergedMessageAttachment(TEST_ATTACHMENT, 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);
+    if(priority == EFalse)
+        {
+        msg.setPriority(ConvergedMessage::Normal);
+        }
+    else
+        {
+        msg.setPriority(ConvergedMessage::High);
+        }
+    
+    //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);
+    
+    long int id = msgPlugin->convertTo(&msg);
+    msgPlugin->send(id);
+    }
+    	
+//---------------------------------------------------------------
+// TestMmsPlugin::testReceived
+//---------------------------------------------------------------
+void TestMmsPlugin::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;
+}
+
+//---------------------------------------------------------------
+// TestMmsPlugin::validateMsg
+//---------------------------------------------------------------
+void TestMmsPlugin::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_SENDER));
+        }
+
+   //     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));
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/testmmsplugin.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,57 @@
+/*
+ * 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_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 TEST_EXPORT TestMmsPlugin: 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 testSendMMS(); //test sending mms
+    void testMmsReceived(); // test receiving mms    
+
+private:
+    void testReceived(int type);
+    void validateMsg(const ConvergedMessage& message, const QString& serviceId);
+    void createMMSMessageWithAttachmentAndSend(TBool priority = EFalse);
+    void createMMSMessageWithSmilTextAndImageAttachmentAndSend();
+private:
+    UniEditorMmsPlugin* msgPlugin;
+    int smsId;
+    int mmsId;
+    };
+#endif //TEST_MMS_PLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/testmmsplugin.ini	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,27 @@
+//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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/testmmsplugin.pro	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,89 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+QT += testlib
+QT -= gui
+
+TEMPLATE = lib
+TARGET = test-mms-plugin
+
+
+INCLUDEPATH += .
+INCLUDEPATH += ../../../../../../inc
+INCLUDEPATH += ../../../../unieditorutils/inc
+INCLUDEPATH += ../../../../s60qconversions/inc
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+DEFINES += BUILD_TEST_DLL
+
+SOURCES += \
+  testmmsplugin.cpp \
+  ../../src/unieditormmsplugin.cpp \
+  ../../src/unieditormmsplugin_p.cpp  
+         
+
+# Input
+HEADERS += \
+  testmmsplugin.h \
+  testmsg.h \
+  ../../inc/unieditormmsplugin.h \
+  ../../inc/unieditormmsplugin_p.h 
+               
+   
+SYMBIAN_PLATFORMS = WINSCW ARMV5
+    symbian {
+    TARGET.CAPABILITY = CAP_GENERAL_DLL
+    TARGET.EPOCSTACKSIZE = 0x8000
+    TARGET.EPOCHEAPSIZE = 0x1000 0x1F00000
+    TARGET.EPOCALLOWDLLDATA = 1
+	}
+    
+ LIBS += -leuser \
+    -lconvergedmessageutils \
+    -ls60qconversions \
+    -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 \
+  	-lunidatamodelloader
+  	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/tsrc/testmmsgplugin/testmsg.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,600 @@
+/*
+ * 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 <s60qconversions.h>
+#include "testmmsplugin.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 = S60QConversions::qStringToS60Desc(serviceCenter01);
+    HBufC* sC02 = S60QConversions::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 = S60QConversions::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 = S60QConversions::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 = S60QConversions::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 = S60QConversions::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 = S60QConversions::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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditormmsplugin/unieditormmsplugin.pro	Mon May 03 12:29:07 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:
+#
+
+TEMPLATE = lib
+TARGET = $$qtLibraryTarget(unieditormmsplugin)
+
+TARGET.CAPABILITY = All -TCB
+TARGET.EPOCALLOWDLLDATA = 1
+
+#UID 3
+TARGET.UID3 = 0x102072DB #old editor mms plugin uid
+
+
+
+INCLUDEPATH += ../../../s60qconversions/inc
+INCLUDEPATH += ../../editorgenutils/inc
+INCLUDEPATH += ../../../../../inc
+INCLUDEPATH += ../../../../../mmsengine/mmsmessage/inc 
+INCLUDEPATH += ../../../../../mmsengine/inc
+INCLUDEPATH += ../../../unidatautils/unidatamodel/inc
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+SYMBIAN_PLATFORMS = WINSCW ARMV5
+
+CONFIG += hb plugin
+
+# Input
+HEADERS += inc/unieditormmsplugin.h \
+	inc/unieditormmsplugin_p.h 
+		   	  		   
+SOURCES += src/unieditormmsplugin.cpp \
+	src/unieditormmsplugin_p.cpp 
+    
+ LIBS += -leuser \
+				 -lcone \
+			   -lmsgs \ 
+				 -lmmsmessage \ 
+				 -lmmsserversettings \
+			   -lmmsgenutils \
+				 -lcommdb \
+				 -lefsrv \
+				 -lbafl \
+				 -leditorgenutils \
+				 -lunidatamodelloader \
+				 -lconvergedmessageutils \
+				 -ls60qconversions \
+				 -lunidatamodel \
+				 -lmsgmedia \
+				 -leikctl 
+
+	
+# Build.inf rules
+BLD_INF_RULES.prj_exports += \
+     "$${LITERAL_HASH}include <platform_paths.hrh>" \
+    "rom/unieditormmsplugin.iby  CORE_APP_LAYER_IBY_EXPORT_PATH(unieditormmsplugin.iby)"
+	
+# plugin stub deployment
+plugin.sources = unieditormmsplugin.dll
+plugin.path = \resource\qt\plugins\messaging\editorplugins
+DEPLOYMENT += plugin
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorplugins.pro	Mon May 03 12:29:07 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
+
+SYMBIAN_PLATFORMS = WINSCW ARMV5
+
+SUBDIRS += unieditorsmsplugin/unieditorsmsplugin.pro
+SUBDIRS += unieditormmsplugin/unieditormmsplugin.pro
+
+CONFIG += ordered
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/inc/unieditorsmsplugin.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,116 @@
+/*
+ * 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 UNIEDITORSMSPLUGIN_H_
+#define UNIEDITORSMSPLUGIN_H_
+
+
+#include <QObject>
+#include "unieditorplugininterface.h"
+
+class UniEditorSmsPluginPrivate;
+
+/**
+ * Unified editor send SMS plugin.
+ */
+class UniEditorSmsPlugin : public QObject, public UniEditorPluginInterface
+{
+Q_OBJECT
+    Q_INTERFACES(UniEditorPluginInterface)
+
+public:
+    /**
+     * Constructor
+     */
+    UniEditorSmsPlugin(QObject* parent = 0);
+
+    /**
+     * Destructor
+     */
+    ~UniEditorSmsPlugin();
+
+    /**
+     *  Message type (SMS/MMS etc..)
+     *  @return type of message
+     */
+    ConvergedMessage::MessageType messageType();
+
+    /**
+     * Converts message from message store into ConvergedMessage 
+     * based on the operation
+     * @param TMsvId id
+     * @param aOperation operation type
+     * @return ConvergedMessage object is returned in successfull cases and 
+     *         NULL is returned in failure cases. The ownership of the object
+     *         is transferred to the caller. 
+     */
+    ConvergedMessage* convertFrom( TMsvId aId,
+        UniEditorPluginInterface::EditorOperation aOperation
+        =UniEditorPluginInterface::Default );
+    
+    /**
+     * delete entry from drafts folder
+     * @param aId message entry id to be deleted
+     */
+    void deleteDraftsEntry( TMsvId aId );
+
+    /**
+     * convert from convergedmessage to entry in message store
+     * @param aMessage convergedmessage
+     * @return message entry id
+     */
+    TMsvId convertTo( ConvergedMessage *aMessage );
+
+    /**
+     * send message
+     * @param message entry id
+     * @return true, if send is successfull
+     */
+    bool send(TMsvId aId);
+
+    /**
+     * check if service is valid
+     * @return true/false
+     */
+    TBool isServiceValid();
+
+    /**
+     * validate settings
+     * @param aEmailOverSms true if email over sms is supported, else false
+     * @return true/false
+     */
+    TBool validateService( TBool aEmailOverSms = EFalse );
+    
+    /*
+     * Turkish SMS(PREQ2265) specific...
+     */
+    void setEncodingSettings(TBool aUnicodeMode,
+        TSmsEncoding aAlternativeEncodingType, TInt charSupportType);
+
+    /**
+     * for deciding on reduced or full charset support
+     */
+    bool getNumPDUs(QString& aBuf, TInt& aNumOfRemainingChars,
+        TInt& aNumOfPDUs, TBool& aUnicodeMode,
+        TSmsEncoding& aAlternativeEncodingType);
+
+
+private:
+    UniEditorSmsPluginPrivate* d_ptr;
+};
+
+#endif //UNIEDITORSMSPLUGIN_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/inc/unieditorsmsplugin_p.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,408 @@
+/*
+ * 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 __UNIEDITORSMSPLUGINPRIVATE_H
+#define __UNIEDITORSMSPLUGINPRIVATE_H
+
+// INCLUDES
+#include <msvapi.h>
+#include <gsmuelem.h>
+#include <mtclbase.h>
+#include "unieditorplugininterface.h"
+#include "UniSendingSettings.h"
+
+// DATA TYPES
+
+// FORWARD DECLARATIONS
+class CClientMtmRegistry;
+class CSmsClientMtm;
+class CSmsHeader;
+class CParaFormatLayer;
+class CCharFormatLayer;
+class CRichText;
+class CMsgSmsEmailOverSmsFunc;
+class CSmsNumber;
+class CSmsMessage;
+class ConvergedMessage;
+class UniEditorGenUtils;
+
+// CLASS DECLARATION
+
+/**
+* UniEditorSmsPluginPrivate
+*/ 
+class UniEditorSmsPluginPrivate :public MMsvSessionObserver
+	{
+	public:  // Constructors and destructor
+        
+        /**
+        * Two-phased constructor.
+        */
+        static UniEditorSmsPluginPrivate* NewL();
+ 		
+        /**
+        * Destructor.
+        */
+        virtual ~UniEditorSmsPluginPrivate();
+
+    public: // From CUniEditorPlugin
+
+        /**
+         * load sms headers either from store, if provided,
+         * or from global settings
+         * @param aStore message store
+         */
+        void LoadHeadersL( CMsvStore* aStore );
+
+        /**
+         * Converts message from message store into ConvergedMessage 
+         * based on the operation
+         * @param TMsvId id
+         * @param aOperation operation type
+         * @return ConvergedMessage object is returned in successfull cases and 
+         *         NULL is returned in failure cases. The ownership of the object
+         *         is transferred to the caller. 
+         */
+        ConvergedMessage* ConvertFromL( TMsvId aId,
+            UniEditorPluginInterface::EditorOperation aOperation );
+
+        /**
+         * convert convergedmessage type to a message entry in store
+         * @param message convergedmessage
+         * @return message entry id
+         */
+        TMsvId ConvertToL( ConvergedMessage* message );
+
+        /**
+         * send a message
+         * @aId message entry id
+         */
+        void SendL( TMsvId aId );
+
+        /**
+         * validate settings
+         * @param aEmailOverSms if email over sms is supported or not 
+         */
+        TBool ValidateServiceL( TBool aEmailOverSms = EFalse );
+
+        /**
+         * validate the service
+         */
+        TBool IsServiceValidL();
+        
+        /**
+         * set unicode mode to true/false
+         */
+        inline void SetUnicodeMode( TBool aUnicodeMode );
+        
+        //Turkish SMS(PREQ2265) specific...
+        void SetEncodingSettings(TBool aUnicodeMode, TSmsEncoding aAlternativeEncodingType, TInt charSupportType);
+       
+        /**
+         * for deciding on reduced or full charset support
+         */
+        void GetNumPDUsL (
+               TDesC& aBuf,
+               TInt& aNumOfRemainingChars,
+               TInt& aNumOfPDUs,
+               TBool& aUnicodeMode, 
+               TSmsEncoding& aAlternativeEncodingType);
+
+        /**
+         * delete entry aId from drafts folder
+         * @param aId entry to be deleted
+         */
+        void DeleteDraftsEntryL( TMsvId aId );
+
+	private: // Constructors
+	
+	    /**
+        * C++ default constructor.
+        */
+        UniEditorSmsPluginPrivate();
+
+        /**
+        * By default Symbian 2nd phase constructor is private.
+        */
+		void ConstructL();
+		
+		/**
+		* Returns pointer to iSmsMtm member variable
+		*/
+		CSmsClientMtm* SmsMtmL();
+
+        /**
+        * Moves message into outbox for sending and creates copies of SMS messages
+        * into outbox in case of multiple recipients
+        */
+        void MoveMessagesToOutboxL();
+
+        /**
+        * Called in MoveMessagesToOutboxL, calls the actual moving
+        * function
+        */
+        TMsvId MoveMessageEntryL( TMsvId aTarget );
+
+        
+        /**
+        * Creates messages into the Outbox if there are several recipients
+        * @param TMsvEntry& a reference to entry to be copied
+        * @param CSmsNumber& a reference to CSmsNumber to be copied
+        * @param CRichText& a reference to msg body contents
+        * @return TMsvId of the created msg entry
+        */
+        TMsvId CreateMessageInOutboxL(
+            const TMsvEntry& aEntry, 
+            const CSmsNumber& aRecipient, 
+            const CRichText& aBody );
+            
+        /**
+        * Creates messages into the Outbox if there are several recipients
+        * and the message is E-Mail over SMS message
+        * @param aEntry a reference to entry to be copied
+        * @param aAddress a reference to address to be copied
+        * @return TMsvId of the created msg entry
+        */
+        virtual TMsvId CreateMessageInOutboxL(
+            const TMsvEntry& aEntry, 
+            const TDesC& aAddress );    
+        
+
+        /**
+        * Calls the actual sending method of SMS Client MTM
+        */
+        void SetScheduledSendingStateL( CMsvEntrySelection* aSelection );
+        
+        /**
+        * Extracts name and address
+        */
+        void NameAndAddress( const TDesC& aMsvAddress, TPtrC& aName, TPtrC& aAddress );
+
+        /**
+        * Creates text for TMsvEntry::iDescription. It could be subject or
+        * if subject does not exist a beginning of the message body 
+        */
+        void ExtractDescriptionFromMessageL(
+            const CSmsMessage& aMessage, 
+            TDes& aDescription, 
+            TInt aMaxLength);
+            
+        /**
+        * Copies text from attachment into the body of the SMS
+        */
+        void CreatePlainTextSMSL( RFile& aFile );
+        
+        /** 
+        * Insert subject into the body of the SMS
+        */
+        void InsertSubjectL( CSmsHeader& aHeader, CRichText& aText );
+        
+        /**
+        * Copies data from VCard attachment into body of the SMS
+        */
+        void CreateVCardSMSL( RFile& aFile );
+        
+        /**
+        * Copies data from VCCalendar attachment into body of the SMS
+        */
+        void CreateVCalSMSL( RFile& aFile );
+                
+        /**
+        * Checks service center address 
+        */
+        TBool ValidateSCNumberL();
+        
+        /**
+        * Checks service center address for E-Mail over SMS messages
+        */
+        TBool ValidateSCNumberForEmailOverSmsL();
+        
+        /**
+        * Saves E-Mail specific information in header
+        */
+        void FillEmailInformationDataL( CSmsHeader& aHeader,  const TPtrC& aAddress );
+    
+        /**
+        * Checks if the address is E-Mail address
+        */
+        TBool IsEmailAddress( const TPtrC& aAddress ) const;
+            
+        /**
+         * Converts sms message to uni message format.
+         * @param aId message id
+         * @param [OUT]aMessage convergedmessage
+         * @param aOperation operation type
+         */
+        void DoConvertFromL( TMsvId aId, 
+            ConvergedMessage* aMessage,
+            UniEditorPluginInterface::EditorOperation aOperation );
+
+        /**
+         * create Sms entry into draft folder
+         */
+        TMsvId CreateNativeSmsL();
+     
+        /**
+         * set/update sms settings 
+         */
+        void SetSmsSettingsL();
+     
+        /**
+         * set data to the sms
+         */
+        void SetSmsDataL(ConvergedMessage* message);
+     
+        /**
+         * set recipient / subject to the message entry 
+         */
+        void SetSmsHeaderL(ConvergedMessage* message);
+        
+        /**
+         * set body text from converged message into
+         * message entry in store
+         */
+        void SetSmsBodyL(ConvergedMessage* message);
+        
+        /**
+         * set attachment info from converged message into
+         * message entry in store
+         */
+        void SetSmsAttachmentsL(ConvergedMessage* message);
+
+        /**
+         * create attachment in message store for the 
+         * message under composition
+         * @param aFilePath file for which attachment is created
+         * @param aStore message store
+         */
+        void CreateAttachmentL(CMsvStore* aStore, const TDesC& aFilePath);
+        
+        /**
+         * Populates address feilds into converged message
+         */
+        void populateRecipientsL(ConvergedMessage* aMessage);
+        
+        /**
+         * Populates body into converged message
+         */
+        void populateMessageBodyL(ConvergedMessage* aMessage,
+            TMsvEntry &aEntry);
+			
+		/**
+	     * @see MMsvSessionObserver
+    	 */
+	    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2,
+                             TAny* aArg3);	
+
+    private:  // Data    
+
+        /**
+         * message service session
+         * Owned
+         */
+        CMsvSession* iSession;
+        
+        /**
+         * Mtm registry
+         * Owned
+         */
+        CClientMtmRegistry* iMtmRegistry;
+        
+        /**
+         * sms mtm
+         * Owned
+         */
+        CSmsClientMtm* iSmsMtm;
+        
+        /**
+         * sms service id
+         */
+        TMsvId iSmsServiceId;
+        
+        /**
+         * sms header
+         * Owned
+         */
+        CSmsHeader* iSmsHeader;
+        
+        /**
+         * Owned
+         */
+        CParaFormatLayer* iParaFormatLayer;
+        
+        /**
+         * Owned
+         */
+        CCharFormatLayer* iCharFormatLayer;
+        
+        /**
+         * Owned
+         */
+        CRichText* iRichText;
+        
+        /**
+         * recipient array
+         * Owned
+         */
+        CDesCArray* iRecipients;
+        
+        /**
+         * flag for biomsg distinction
+         */
+       	TBool iBioMsg;
+        
+        enum TUniPluginPanic
+            {
+            EIllegalArguments  
+            }; 
+    
+        /**
+         * email gateway address/alias
+         * Owned
+         */
+        CSmsNumber* iEmailOverSmsC;
+        
+        /**
+         * flag for setting unicodemode true/false
+         */
+        TBool iUnicodeMode;
+        
+        /**
+         * feature flag to check if offline is supported or not
+         */
+        TBool iOfflineSupported;
+        
+        //Turkish SMS(PREQ2265) specific...
+        TInt iCharSupportType;
+        TSmsEncoding  iAlternativeEncodingType;
+        TBool iNLTFeatureSupport;
+        
+        /**
+         * general utility class
+         * Owned
+         */
+        UniEditorGenUtils* iGenUtils;
+    };
+
+inline void UniEditorSmsPluginPrivate::SetUnicodeMode( TBool aUnicodeMode )
+    {
+    iUnicodeMode = aUnicodeMode;
+    }
+
+#endif      // __UNIEDITORSMSPLUGINPRIVATE_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/rom/unieditorsmsplugin.iby	Mon May 03 12:29:07 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:
+*
+*/
+#ifndef __UNI_EDITOR_SMS_PLUGIN_IBY__
+#define __UNI_EDITOR_SMS_PLUGIN_IBY__
+
+# this is the plugin stub for QT plugin
+file=ABI_DIR\UREL\unieditorsmsplugin.dll               SHARED_LIB_DIR\unieditorsmsplugin.dll
+data=\epoc32\data\z\resource\qt\plugins\messaging\editorplugins\unieditorsmsplugin.qtplugin              \resource\qt\plugins\messaging\editorplugins\unieditorsmsplugin.qtplugin
+
+#endif // __UNI_EDITOR_SMS_PLUGIN_IBY__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/src/unieditorsmsplugin.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,167 @@
+/*
+ * 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
+
+// USER INCLUDES
+#include "unieditorsmsplugin.h"
+#include "unieditorsmsplugin_p.h"
+#include "s60qconversions.h"
+
+// DEBUG
+#include "debugtraces.h"
+
+// CONSTANTS
+
+//---------------------------------------------------------------
+// UniEditorSmsPlugin::UniEditorSmsPlugin()
+// @see header
+//---------------------------------------------------------------
+UniEditorSmsPlugin::UniEditorSmsPlugin(QObject* parent) :
+    QObject(parent),
+    d_ptr(NULL)
+{
+    TRAPD(error, d_ptr = UniEditorSmsPluginPrivate::NewL());
+    QDEBUG_WRITE_FORMAT("UniEditorSmsPlugin::UniEditorSmsPlugin error = ",error);
+}
+
+//---------------------------------------------------------------
+// UniEditorSmsPlugin::~UniEditorSmsPlugin()
+// @see header
+//---------------------------------------------------------------
+UniEditorSmsPlugin::~UniEditorSmsPlugin()
+{
+    delete d_ptr;
+}
+
+//---------------------------------------------------------------
+// UniEditorSmsPlugin::messageType()
+// @see header
+//---------------------------------------------------------------
+ConvergedMessage::MessageType UniEditorSmsPlugin::messageType()
+{
+    return ConvergedMessage::Sms;
+}
+
+//---------------------------------------------------------------
+// UniEditorSmsPlugin::convertFrom
+// @see header
+//---------------------------------------------------------------
+ConvergedMessage* UniEditorSmsPlugin::convertFrom( TMsvId aId,
+    UniEditorPluginInterface::EditorOperation aOperation )
+{
+    ConvergedMessage* msg = NULL;
+    TRAPD(error, msg = d_ptr->ConvertFromL( aId,aOperation ));
+    QDEBUG_WRITE_FORMAT("UniEditorSmsPlugin::convertFrom error = ",error);
+    return msg;
+}
+
+//---------------------------------------------------------------
+// UniEditorSmsPlugin::deleteDraftsEntry
+// @see header
+//---------------------------------------------------------------
+void UniEditorSmsPlugin::deleteDraftsEntry( TMsvId aId )
+{
+    TRAPD(error, d_ptr->DeleteDraftsEntryL( aId ));
+    QDEBUG_WRITE_FORMAT("UniEditorSmsPlugin::DeleteDraftsEntry error = ",error);
+    return;
+}
+
+//---------------------------------------------------------------
+// UniEditorSmsPlugin::convertTo
+// @see header
+//---------------------------------------------------------------
+TMsvId UniEditorSmsPlugin::convertTo( ConvergedMessage *aMessage )
+{
+    TMsvId id = -1;
+    TRAPD(error, id = d_ptr->ConvertToL( aMessage ));
+    QDEBUG_WRITE_FORMAT("UniEditorSmsPlugin::ConvertTo error = ",error);
+    return id;
+}
+
+//---------------------------------------------------------------
+// UniEditorSmsPlugin::send
+// @see header
+//---------------------------------------------------------------
+bool UniEditorSmsPlugin::send(TMsvId aId)
+{
+    bool ret = true;
+    TRAPD(error, d_ptr->SendL( aId ));
+    if(error != KErrNone)
+    {
+        ret = false;
+    }
+    QDEBUG_WRITE_FORMAT("UniEditorSmsPlugin::Send error = ",error);
+    return ret;
+}
+
+//---------------------------------------------------------------
+// UniEditorSmsPlugin::isServiceValidL
+// @see header
+//---------------------------------------------------------------
+TBool UniEditorSmsPlugin::isServiceValid()
+{
+    TBool ret = EFalse;
+    TRAPD(error, ret = d_ptr->IsServiceValidL());
+    QDEBUG_WRITE_FORMAT("UniEditorSmsPlugin::isServiceValid error = ", error);
+    return ret;
+}
+
+//---------------------------------------------------------------
+// UniEditorSmsPlugin::validateServiceL
+// @see header
+//---------------------------------------------------------------
+TBool UniEditorSmsPlugin::validateService( TBool aEmailOverSms/* = EFalse */)
+{
+    TBool ret = EFalse;
+    TRAPD(error, ret = d_ptr->ValidateServiceL( aEmailOverSms ));
+    QDEBUG_WRITE_FORMAT("UniEditorSmsPlugin::ValidateService error = ",error);
+    return ret;
+}
+
+//---------------------------------------------------------------
+// UniEditorSmsPlugin::setEncodingSettings
+// @see header
+//---------------------------------------------------------------
+void UniEditorSmsPlugin::setEncodingSettings(TBool aUnicodeMode,
+    TSmsEncoding aAlternativeEncodingType, TInt charSupportType)
+{
+    d_ptr->SetEncodingSettings(aUnicodeMode, aAlternativeEncodingType,
+        charSupportType);
+}
+
+//---------------------------------------------------------------
+// UniEditorSmsPlugin::getNumPDUs
+// @see header
+//---------------------------------------------------------------
+bool UniEditorSmsPlugin::getNumPDUs(QString& aBuf, TInt& aNumOfRemainingChars,
+    TInt& aNumOfPDUs, TBool& aUnicodeMode,
+    TSmsEncoding& aAlternativeEncodingType)
+{
+    TBool ret = ETrue;
+    HBufC* buffer = S60QConversions::qStringToS60Desc(aBuf);
+    TRAPD(error,d_ptr->GetNumPDUsL(*buffer,aNumOfRemainingChars,
+                    aNumOfPDUs,aUnicodeMode,aAlternativeEncodingType));
+    delete buffer;
+    if (error != KErrNone)
+    {
+        ret = false;
+    }
+    return ret;
+}
+
+Q_EXPORT_PLUGIN2(unieditorsmsplugin, UniEditorSmsPlugin)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/src/unieditorsmsplugin_p.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,1883 @@
+/*
+ * 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
+
+// Symbian:
+#include <e32base.h>
+#include <txtetext.h>
+#include <txtrich.h>
+#include <s32mem.h>
+
+#include <mmsvattachmentmanager.h>
+#include <mmsvattachmentmanagersync.h>
+#include <gsmerror.h>                       // KErrGsmOfflineOpNotAllowed
+#include <featmgr.h>
+
+#include <mtclreg.h>
+#include <smsclnt.h>
+#include <smscmds.h>
+#include <smuthdr.h>
+#include <csmsemailfields.h>
+#include <csmsaccount.h>
+#include <charconv.h>
+#include <smut.h>
+#include <cmsvmimeheaders.h>
+#include <badesca.h>
+#include <e32cmn.h>
+#include <gsmuset.h>
+
+// S60
+#include <MsgMediaResolver.h>
+#include <MsgMediaInfo.h>
+#include <MsgTextInfo.h>
+
+#include <mmsgenutils.h>
+#include <vcard.h>
+#include <SenduiMtmUids.h>
+#include <MsgMimeTypes.h>
+#include "UniSendingSettings.h"
+#include "MessagingVariant.hrh"
+#include "msgbiouids.h"
+#include "unieditorsmsplugin_p.h"
+#include "convergedmessage.h"
+#include "convergedmessageid.h"
+#include "convergedmessageattachment.h"
+#include "s60qconversions.h"
+#include "MuiuOperationWait.h"
+#include "UniEditorGenUtils.h"
+#include "unidatamodelloader.h"
+#include "unidatamodelplugininterface.h"
+#include <hbglobal.h> // for translation support
+
+// resources
+
+// CONSTANTS
+
+// Used to set msg in unparsed state
+const TInt KSmsPluginBioMsgUnparsed = 0;
+
+// Description length for sms messages
+const TInt KSmsMessageEntryDescriptionAmountOfChars = 60;
+
+//used for descriptor array containing recipients
+const TInt KRecipientsArrayGranularity = 8;
+
+// For address information separation (start)
+const TUint KMsgSmsAddressStartChar         ('<');
+
+// For address information separation (end)
+const TUint KMsgSmsAddressEndChar           ('>');
+
+const TUint KUniSmsStartParenthesis ('(');
+const TUint KUniSmsEndParenthesis (')');
+
+// String length for Service centre name
+const TInt KUniSmsSCStringLength = 50;
+
+const TUid KUidMsvSMSHeaderStream_COPY_FROM_SMUTHDR_CPP  = {0x10001834};
+
+// Amount of to be converted chars during extracting description
+const TInt KSmsEdExtrDescReplaceCharacterCount = 3;
+
+// Unicode char for linefeed regocnised by basic phones
+const TUint KSmsEdUnicodeLFSupportedByBasicPhones = 0x000A;
+
+// Copy max this many chars to TMsvEntry iDetails
+const TInt  KMaxDetailsLength = 64;
+
+// separators for iDetails field
+_LIT( KAddressSeparator, ";" );
+
+// LOCALIZED CONSTANTS
+// String to be shown in Drafts view for VCard sms
+#define BUSINESS_CARD hbTrId("txt_messaging_list_business_card")
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+UniEditorSmsPluginPrivate* UniEditorSmsPluginPrivate::NewL()
+    {
+    UniEditorSmsPluginPrivate* self = new ( ELeave ) UniEditorSmsPluginPrivate();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// Destructor
+// -----------------------------------------------------------------------------
+//
+UniEditorSmsPluginPrivate::~UniEditorSmsPluginPrivate()
+{
+    if(iGenUtils)
+    {
+        delete iGenUtils;
+        iGenUtils = NULL;
+    }
+    
+    if(iEmailOverSmsC)
+    {
+        delete iEmailOverSmsC;
+        iEmailOverSmsC = NULL;
+    }
+
+    if(iRecipients)
+    {
+        delete iRecipients;
+        iRecipients = NULL;
+    }
+
+    if(iRichText)
+    {
+        delete iRichText;
+        iRichText = NULL;
+    }
+
+    if(iCharFormatLayer)
+    {
+        delete iCharFormatLayer;
+        iCharFormatLayer = NULL;
+    }
+
+    if(iParaFormatLayer)
+    {
+        delete iParaFormatLayer;
+        iParaFormatLayer = NULL;
+    }
+
+    if(iSmsHeader)
+    {
+        delete iSmsHeader;
+        iSmsHeader = NULL;
+    }
+
+    if(iSmsMtm)
+    {
+        delete iSmsMtm;
+        iSmsMtm = NULL;
+    }
+
+    if(iMtmRegistry)
+    {
+        delete iMtmRegistry;
+        iMtmRegistry = NULL;
+    }
+
+   if(iSession)
+    {
+        delete iSession;
+        iSession = NULL;
+    }
+}
+
+// -----------------------------------------------------------------------------
+// C++ default constructor
+// -----------------------------------------------------------------------------
+//
+UniEditorSmsPluginPrivate::UniEditorSmsPluginPrivate() :
+    iSession(0),
+    iMtmRegistry(0),
+    iSmsMtm(0),
+    iSmsHeader(0),
+    iParaFormatLayer(0),
+    iCharFormatLayer(0),
+    iRichText(0),
+    iRecipients(0),
+    iBioMsg( EFalse ),
+    iEmailOverSmsC(0),
+    iUnicodeMode( EFalse ),
+    iOfflineSupported( EFalse ),
+    iCharSupportType(TUniSendingSettings::EUniCharSupportReduced),
+    iGenUtils(0)    
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// Symbian 2nd phase constructor
+// -----------------------------------------------------------------------------
+//
+void UniEditorSmsPluginPrivate::ConstructL()
+    {
+	iSession = CMsvSession::OpenSyncL(*this);
+    iParaFormatLayer = CParaFormatLayer::NewL();
+    iCharFormatLayer = CCharFormatLayer::NewL();
+    iRichText = CRichText::NewL( iParaFormatLayer, iCharFormatLayer );
+    iEmailOverSmsC = CSmsNumber::NewL();
+
+    CMsvEntry& entry = SmsMtmL()->Entry();
+    entry.SetEntryL( KMsvRootIndexEntryId );
+
+    TSmsUtilities::ServiceIdL( entry, iSmsServiceId );
+
+    FeatureManager::InitializeLibL();
+    if ( FeatureManager::FeatureSupported( KFeatureIdOfflineMode ) )
+        {
+        iOfflineSupported = ETrue;
+        }
+    else
+        {
+        iOfflineSupported = EFalse;
+        }
+
+    //Turkish SMS-PREQ2265 Specific
+    if ( FeatureManager::FeatureSupported( KFeatureIdNltSupport ) )
+        {
+        iNLTFeatureSupport = ETrue;
+        }
+    else
+        {
+        iNLTFeatureSupport = EFalse;
+        }
+
+    FeatureManager::UnInitializeLib();
+    
+    iGenUtils = new UniEditorGenUtils();
+    }
+
+// -----------------------------------------------------------------------------
+// LoadHeadersL
+// @see header
+// -----------------------------------------------------------------------------
+void UniEditorSmsPluginPrivate::LoadHeadersL( CMsvStore* aStore )
+    {
+    delete iSmsHeader;
+    iSmsHeader = NULL;
+
+    if ( aStore && aStore->HasBodyTextL() )
+        {
+    	aStore->RestoreBodyTextL( *iRichText );
+        }
+
+	iSmsHeader = CSmsHeader::NewL( CSmsPDU::ESmsSubmit, *iRichText );
+
+	if ( aStore && aStore->IsPresentL( KUidMsvSMSHeaderStream_COPY_FROM_SMUTHDR_CPP ) )
+	    {
+	    iSmsHeader->RestoreL( *aStore );
+	    }
+	else
+	    {
+        CSmsSettings* settings = CSmsSettings::NewLC();
+    	CSmsAccount* account = CSmsAccount::NewLC();
+    	account->LoadSettingsL( *settings );
+    	CleanupStack::PopAndDestroy( account );
+        iSmsHeader->SetSmsSettingsL( *settings );
+        CleanupStack::PopAndDestroy( settings );
+	    }
+    }
+
+// -----------------------------------------------------------------------------
+// ConvertFromL
+// @see header
+// -----------------------------------------------------------------------------
+ConvergedMessage* UniEditorSmsPluginPrivate::ConvertFromL(TMsvId aId,
+    UniEditorPluginInterface::EditorOperation aOperation)
+{
+    ConvergedMessageId id(aId);
+    ConvergedMessage* msg = new ConvergedMessage(id);
+    CleanupStack::PushL(msg);
+    DoConvertFromL(aId, msg, aOperation);
+    CleanupStack::Pop(msg);
+    return msg;
+}
+
+// -----------------------------------------------------------------------------
+// DoConvertFromL
+// @see header
+// -----------------------------------------------------------------------------
+void UniEditorSmsPluginPrivate::DoConvertFromL( TMsvId aId,
+        ConvergedMessage* aMessage, 
+        UniEditorPluginInterface::EditorOperation aOperation)
+{
+    // load message for processing
+    SmsMtmL()->SwitchCurrentEntryL( aId );
+    SmsMtmL()->LoadMessageL();
+
+    aMessage->setMessageType(ConvergedMessage::Sms);
+
+    // get parent entry
+    TMsvEntry msvEntry( SmsMtmL()->Entry().Entry() );
+    TMsvId parent = msvEntry.Parent();
+
+    if( parent == KMsvDraftEntryIdValue )
+    {
+        aMessage->setLocation(ConvergedMessage::Draft);
+        //TODO: need to give FORWARD etc info in convergedMessage
+        aMessage->setDirection(ConvergedMessage::Outgoing);
+
+        //Populate recipients
+        populateRecipientsL(aMessage);
+
+        //Populate message body
+        populateMessageBodyL(aMessage,msvEntry);
+    }
+    else if(aOperation == UniEditorPluginInterface::Forward)
+    {
+        //Populate message body
+        populateMessageBodyL(aMessage,msvEntry);            
+    }
+    
+    //This is required as the switch entry doesnot reset sms headers
+    //so if we fwd an inbox msg and then try to save that content to drafts
+    //we see some issue
+    delete iSmsMtm;
+    iSmsMtm = NULL;
+    
+    return;
+}
+
+// -----------------------------------------------------------------------------
+// ConvertToL
+// @see header
+// -----------------------------------------------------------------------------
+TMsvId UniEditorSmsPluginPrivate::ConvertToL( ConvergedMessage* message )
+{
+    // create message in draft folder
+    TMsvId id = CreateNativeSmsL();    
+    
+    int err = KErrNone;
+        TRAP(err,            
+                // set sms data
+                SetSmsDataL( message );
+                // set sms settings
+                SetSmsSettingsL();
+                // save all changes for the entry
+                SmsMtmL()->SaveMessageL();
+        );
+
+    // delete the created drafts entry because error 
+    // happened during save
+    if (err != KErrNone)
+        {
+        DeleteDraftsEntryL(id);
+        id = -1;
+        }
+
+    return id;
+}
+
+// -----------------------------------------------------------------------------
+// CreateNativeSmsL
+// @see header
+// -----------------------------------------------------------------------------
+TMsvId UniEditorSmsPluginPrivate::CreateNativeSmsL()
+{
+    CMsvEntry* cEntry = SmsMtmL()->Session().GetEntryL(KMsvDraftEntryId);
+    CleanupStack::PushL( cEntry );
+    SmsMtmL()->SwitchCurrentEntryL( cEntry->EntryId() );
+
+    TMsvEntry tEntry;
+    tEntry.SetAttachment( EFalse );
+    tEntry.iMtm = KSenduiMtmSmsUid;
+    tEntry.iType = KUidMsvMessageEntry;
+    tEntry.iRelatedId = iSmsServiceId;
+    tEntry.iServiceId = KMsvLocalServiceIndexEntryId;
+    tEntry.iDate.UniversalTime();
+    tEntry.SetInPreparation( ETrue );
+    tEntry.SetVisible( EFalse );
+
+    cEntry->CreateL(tEntry);
+    SmsMtmL()->SwitchCurrentEntryL(tEntry.Id());
+    CleanupStack::PopAndDestroy( cEntry );
+    return SmsMtmL()->Entry().Entry().Id();
+}
+
+// -----------------------------------------------------------------------------
+// SetSmsDataL
+// @see header
+// -----------------------------------------------------------------------------
+void UniEditorSmsPluginPrivate::SetSmsDataL(ConvergedMessage* message)
+{
+    // populate recipients, subject and emailfields
+    SetSmsHeaderL(message);
+    
+    // populate the attachments in msg entry
+    SetSmsAttachmentsL(message);
+}
+
+// -----------------------------------------------------------------------------
+// SetSmsHeaderL
+// @see header
+// -----------------------------------------------------------------------------
+void UniEditorSmsPluginPrivate::SetSmsHeaderL(ConvergedMessage* message)
+{
+    TBuf<KMaxDetailsLength> idetailsBuf;
+    idetailsBuf.Zero();
+    //Save for email over sms
+    if ( iRecipients )
+    {
+        delete iRecipients;
+        iRecipients = NULL;
+    }
+    iRecipients = new ( ELeave ) CDesCArrayFlat( KRecipientsArrayGranularity );
+
+    CSmsEmailFields *emailFields = CSmsEmailFields::NewL();
+    CleanupStack::PushL( emailFields );
+
+    ConvergedMessageAddressList addrList = message->toAddressList();
+    int addrCount = addrList.count();
+    for(int i=0; i<addrCount; i++)
+    {
+        HBufC* addr = S60QConversions::qStringToS60Desc( addrList.at(i)->address() );
+        HBufC* alt_alias = S60QConversions::qStringToS60Desc( addrList.at(i)->alias() );
+        if(addr)
+        {
+            CleanupStack::PushL(addr);
+            if(alt_alias)
+                CleanupStack::PushL(alt_alias);
+            HBufC* pureAddr = TMmsGenUtils::PureAddress( *addr ).AllocLC();
+            HBufC* aliasAddr = TMmsGenUtils::Alias( *addr ).AllocLC();
+            TInt appendLen = KMaxDetailsLength-idetailsBuf.Length();
+            TPtrC appendbuf;
+            if ( IsEmailAddress( *pureAddr ) )
+            {
+                emailFields->AddAddressL( *pureAddr );
+                appendbuf.Set(pureAddr->Des().Left(appendLen));
+            }
+            else
+            {
+                if(aliasAddr->Length() > 0)
+                {
+                    SmsMtmL()->AddAddresseeL( *pureAddr, *aliasAddr );
+                    appendbuf.Set(aliasAddr->Des().Left(appendLen));
+                }
+                else
+                {
+                    if(alt_alias)
+                    {
+                        SmsMtmL()->AddAddresseeL( *pureAddr, *alt_alias );
+                        appendbuf.Set(alt_alias->Des().Left(appendLen));
+                    }
+                    else
+                    {
+                        SmsMtmL()->AddAddresseeL( *pureAddr );
+                        appendbuf.Set(pureAddr->Des().Left(appendLen));
+                    }
+                }
+            }
+            // copy the append-buffer to form idetails
+            if(appendLen > 0)
+            {
+                idetailsBuf.Append( appendbuf );
+            }
+            iRecipients->AppendL( *addr );
+
+            // cleanup
+            CleanupStack::PopAndDestroy(2, pureAddr );            
+            if(alt_alias)
+            {
+                CleanupStack::PopAndDestroy( alt_alias );
+            }
+            CleanupStack::PopAndDestroy( addr );
+            
+            // append separator
+            if(i != addrCount-1)
+            {
+                if(KMaxDetailsLength-idetailsBuf.Length() > 0)
+                {
+                    idetailsBuf.Append( KAddressSeparator() );                
+                }
+            }
+        }
+    }
+    
+    if(idetailsBuf.Length() > 0)
+    {
+        // set iDetails
+        CMsvEntry& entry = SmsMtmL()->Entry();
+        TMsvEntry msvEntry( entry.Entry() );
+        msvEntry.iDetails.Set( idetailsBuf );
+        SmsMtmL()->SaveMessageL();
+        entry.ChangeL( msvEntry );
+    }
+
+    // set subject
+    if ( !message->subject().isEmpty() )
+    {
+        HBufC* subj = S60QConversions::qStringToS60Desc( message->subject() );
+        if( subj )
+        {
+            CleanupStack::PushL( subj );
+            emailFields->SetSubjectL( *subj );
+            CleanupStack::PopAndDestroy( subj );
+        }
+    }
+
+    SmsMtmL()->SmsHeader().SetEmailFieldsL( *emailFields );
+    CleanupStack::PopAndDestroy( emailFields );
+}
+
+// -----------------------------------------------------------------------------
+// SetSmsBodyL
+// @see header
+// -----------------------------------------------------------------------------
+void UniEditorSmsPluginPrivate::SetSmsBodyL(ConvergedMessage* message)
+{
+    HBufC8* bodytext = S60QConversions::qStringToS60Desc8( message->bodyText() );
+    if( bodytext->Length() > 0)
+    {
+        CleanupStack::PushL( bodytext );
+        RDesReadStream stream(*bodytext);
+        CleanupClosePushL( stream );
+
+        CPlainText::TImportExportParam param;
+        param.iForeignEncoding = KCharacterSetIdentifierUtf8;
+        param.iOrganisation = CPlainText::EOrganiseByParagraph;
+        CPlainText::TImportExportResult result;
+
+        SmsMtmL()->Body().Reset();
+        SmsMtmL()->Body().ImportTextL( 0, stream, param, result );
+
+        CleanupStack::PopAndDestroy(&stream);
+        CleanupStack::PopAndDestroy( bodytext );
+    }
+}
+
+// -----------------------------------------------------------------------------
+// SetSmsAttachmentsL
+// @see header
+// -----------------------------------------------------------------------------
+void UniEditorSmsPluginPrivate::SetSmsAttachmentsL(ConvergedMessage* message)
+    {
+    // set body text
+    SetSmsBodyL( message );
+
+    // look for attachments
+    ConvergedMessageAttachmentList attachmentList = message->attachments();
+    int attachmentCount = attachmentList.count();
+
+    ConvergedMessageAttachment* attachment = NULL;
+    if( attachmentCount > 1)
+        {
+        //Programming error in caller code
+		// sms can have at-max 1 attachment e.g. vcard, vcal etc
+        User::Leave( KErrArgument );
+        }
+    else if( attachmentCount == 1)
+        {
+        attachment = attachmentList.at(0);
+        }
+    // set entry info for drafts viewing
+    TMsvEntry tEntry = SmsMtmL()->Entry().Entry();
+    CMsvStore* store = SmsMtmL()->Entry().EditStoreL();
+    CleanupStack::PushL( store );
+    // fill localized strings for smart-msgs e.g. 'Business Card' for vcards
+    QString descr;
+    if ( attachment )
+        {
+         // create msv attachment in store
+        CreateAttachmentL(store,
+                *S60QConversions::qStringToS60Desc(attachment->filePath()));
+        
+        // check for mimetype of the attachment
+        TPtrC8 mimetype;
+        int attSize;
+        QString attMimeType;
+        TMsgMediaType attMediaType = EMsgMediaUnknown;
+        iGenUtils->getFileInfoL(attachment->filePath(),
+                attSize, attMimeType, attMediaType);
+        mimetype.Set( *S60QConversions::qStringToS60Desc8(attMimeType) );
+        
+        if ( mimetype.CompareF( KMsgMimeTextPlain ) == 0 )
+            {
+            iBioMsg=EFalse;
+            }
+        else if ( mimetype.CompareF(KMsgMimeVCard) == 0 )
+            {
+            iBioMsg=ETrue;
+            tEntry.iBioType = KMsgBioUidVCard.iUid;
+            SmsMtmL()->BioTypeChangedL( KMsgBioUidVCard );
+            descr = BUSINESS_CARD;
+            }
+        else if ( mimetype.CompareF(KMsgMimeVCal ) == 0 ||
+                  mimetype.CompareF(KMsgMimeICal ) == 0 )
+            {
+            iBioMsg=ETrue;
+            tEntry.iBioType = KMsgBioUidVCalendar.iUid;
+            SmsMtmL()->BioTypeChangedL( KMsgBioUidVCalendar );            
+            }
+        else
+            {
+            // do not expect any other mimetype
+            User::Leave( KErrArgument );
+            }
+        }
+    
+    // populate description for this msg (from subject/body content)
+    CSmsHeader& header = SmsMtmL()->SmsHeader();
+    TBuf<KSmsMessageEntryDescriptionAmountOfChars> buf;
+    buf.Zero();
+    if(!iBioMsg)
+    {
+        ExtractDescriptionFromMessageL(
+                header.Message(),
+                buf,
+                KSmsMessageEntryDescriptionAmountOfChars );    
+    }
+    else if(!descr.isNull())
+    {
+        buf.Copy( *S60QConversions::qStringToS60Desc(descr) );
+    }
+    tEntry.iDescription.Set( buf );
+
+    // save/commit all changes
+    SmsMtmL()->SaveMessageL( *store, tEntry );
+    SmsMtmL()->Entry().ChangeL( tEntry );
+    store->Commit();
+    CleanupStack::PopAndDestroy( store );
+    }
+
+// -----------------------------------------------------------------------------
+// CreateAttachmentL
+// @see header
+// -----------------------------------------------------------------------------
+void UniEditorSmsPluginPrivate::CreateAttachmentL(CMsvStore* aStore, const TDesC& aFilePath)
+    {
+    MMsvAttachmentManager* attachmentManager = &( aStore->AttachmentManagerL() );
+    CMsvAttachment* attachment = CMsvAttachment::NewL( CMsvAttachment::EMsvFile );
+    CleanupStack::PushL( attachment );
+
+    int attSize;
+    QString mimeType;
+    TMsgMediaType mediaType = EMsgMediaUnknown;
+    QString filepath = S60QConversions::s60DescToQString( aFilePath );
+    iGenUtils->getFileInfoL(filepath, attSize, mimeType, mediaType);
+    
+    attachment->SetSize( attSize );
+    attachment->SetMimeTypeL( *S60QConversions::qStringToS60Desc8(mimeType) );
+    
+    CMuiuOperationWait* wait = CMuiuOperationWait::NewLC();
+    attachmentManager->AddAttachmentL( aFilePath, attachment, wait->iStatus );
+    wait->Start();
+    CleanupStack::PopAndDestroy( wait );
+    CleanupStack::Pop( attachment );
+    
+    aStore->CommitL();
+    }
+
+// -----------------------------------------------------------------------------
+// SetSmsSettingsL
+// @see header
+// -----------------------------------------------------------------------------
+void UniEditorSmsPluginPrivate::SetSmsSettingsL()
+    {
+    CSmsSettings* sendOptions = CSmsSettings::NewL();
+    CleanupStack::PushL( sendOptions );
+
+    // "ConvertToL" might be called right after constructor.
+    // In this case iSmsHeader is still NULL. Need to initialise.
+    if ( !iSmsHeader )
+    {
+        CMsvStore* store = SmsMtmL()->Entry().EditStoreL();
+        CleanupStack::PushL( store );
+        LoadHeadersL( store );
+        CleanupStack::PopAndDestroy( store );
+    }
+    iSmsHeader->GetSmsSettingsL( *sendOptions );
+
+    sendOptions->CopyL( *sendOptions );
+        
+    if ( iBioMsg )
+    {
+        // make sure bio messages have no conversion
+        sendOptions->SetMessageConversion( ESmsConvPIDNone );
+    }
+
+    // Update some global SMS settings affecting all messages.
+    // These might have changed from the ones retrieved when
+    // the message was created and so needs to be updated.
+    CSmsSettings* defaultSettings = CSmsSettings::NewLC();
+
+    CSmsAccount* account = CSmsAccount::NewLC();
+    account->LoadSettingsL( *defaultSettings );
+    CleanupStack::PopAndDestroy( account );
+
+    sendOptions->SetDeliveryReport( defaultSettings->DeliveryReport() );
+    sendOptions->SetSmsBearer( defaultSettings->SmsBearer() );
+    sendOptions->SetValidityPeriod( defaultSettings->ValidityPeriod() );
+    sendOptions->SetReplyPath( defaultSettings->ReplyPath() );
+
+    if (defaultSettings->CharacterSet()
+            == TSmsDataCodingScheme::ESmsAlphabetUCS2)
+    {
+        iCharSupportType = TUniSendingSettings::EUniCharSupportFull;
+    }
+    else
+    {
+        iCharSupportType = TUniSendingSettings::EUniCharSupportReduced;
+    }
+
+    iSmsHeader->SetSmsSettingsL( *sendOptions );
+
+    // 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())
+    {
+    SmsMtmL()->SmsHeader( ).Message( ).
+        SetServiceCenterAddressL( defaultSettings->GetServiceCenter(defaultSettings->DefaultServiceCenter()).Address() );
+    }
+    CleanupStack::PopAndDestroy(defaultSettings);
+    CleanupStack::PopAndDestroy( sendOptions );
+    
+
+    //Initialize the settings
+    SetEncodingSettings( iUnicodeMode, ESmsEncodingNone, 
+            iCharSupportType);
+    
+    //get bodytext
+    TInt smslength = SmsMtmL()->Body().LdDocumentLength();
+    HBufC* body = HBufC::NewLC(smslength);
+    TPtrC ptr;        
+    ptr.Set(SmsMtmL()->Body().Read(0,smslength));    
+    
+    TInt numOfRemainingChars;
+    TInt numOfPDUs;
+    TBool unicodeMode;
+    TSmsEncoding alternativeEncodingType;
+    
+    //This is to reset the charset type
+    GetNumPDUsL(ptr,numOfRemainingChars,numOfPDUs,
+            unicodeMode,alternativeEncodingType);
+    
+    if (iNLTFeatureSupport)
+    {
+        //Turkish SMS-PREQ2265 Specific
+        TSmsEncoding currAlternateEncoding =
+                iSmsHeader->Message().Alternative7bitEncoding();
+        SmsMtmL()->SmsHeader().Message().SetAlternative7bitEncoding(
+            currAlternateEncoding);
+    }
+    
+    //Write the settings into message header
+    TSmsUserDataSettings smsSettings;
+    CSmsMessage& smsMsg = SmsMtmL()->SmsHeader().Message();
+
+    if (iUnicodeMode)
+    {
+        smsSettings.SetAlphabet(TSmsDataCodingScheme::ESmsAlphabetUCS2);
+    }
+    else
+    {
+        smsSettings.SetAlphabet(TSmsDataCodingScheme::ESmsAlphabet7Bit);
+    }
+
+    smsSettings.SetTextCompressed(EFalse);
+
+    smsMsg.SetUserDataSettingsL( smsSettings );
+
+    CleanupStack::PopAndDestroy(body);
+}
+
+// -----------------------------------------------------------------------------
+// SendL
+// @see header
+// -----------------------------------------------------------------------------
+void UniEditorSmsPluginPrivate::SendL( TMsvId aId )
+{
+    SmsMtmL()->SwitchCurrentEntryL( aId );
+    SmsMtmL()->LoadMessageL();
+    MoveMessagesToOutboxL();
+}
+
+// -----------------------------------------------------------------------------
+// ValidateServiceL
+// @see header
+// -----------------------------------------------------------------------------
+TBool UniEditorSmsPluginPrivate::ValidateServiceL( TBool aEmailOverSms )
+{
+    TBool valid = ValidateSCNumberL();
+
+    if ( aEmailOverSms )
+    {
+        valid = ValidateSCNumberForEmailOverSmsL();
+    }
+
+    return valid;
+}
+
+// -----------------------------------------------------------------------------
+// IsServiceValidL
+// @see header
+// -----------------------------------------------------------------------------
+TBool UniEditorSmsPluginPrivate::IsServiceValidL()
+    {
+    // Not implemented.
+    return ETrue;
+    }
+
+// -----------------------------------------------------------------------------
+// SmsMtmL
+// @see header
+// -----------------------------------------------------------------------------
+CSmsClientMtm* UniEditorSmsPluginPrivate::SmsMtmL()
+    {
+    if ( !iSmsMtm )
+        {
+        if ( !iMtmRegistry )
+            {
+            iMtmRegistry = CClientMtmRegistry::NewL( *iSession );
+            }
+        iSmsMtm = static_cast<CSmsClientMtm*>( iMtmRegistry->NewMtmL( KSenduiMtmSmsUid ) );
+        }
+    return iSmsMtm;
+    }
+
+// ----------------------------------------------------------------------------
+// MoveMessagesToOutboxL
+// @see header
+// ----------------------------------------------------------------------------
+void UniEditorSmsPluginPrivate::MoveMessagesToOutboxL()
+    {
+    if ( !iRecipients || !iRecipients->Count() )
+        {
+        User::Leave( KErrGeneral );
+        }
+    
+    // manage attachment and body content for sms
+    // e.g. in case of smartmsgs, we will need to populate attachment's
+    // content into msg body and discard the attachment
+    CMsvStore* store = SmsMtmL()->Entry().EditStoreL();
+    CleanupStack::PushL(store);
+    MMsvAttachmentManager* attachmentManager = &(store->AttachmentManagerL());
+    MMsvAttachmentManagerSync& managerSync =
+            store->AttachmentManagerExtensionsL();
+    TInt attCount = attachmentManager->AttachmentCount();
+    if (attCount > 1)
+        {
+        //Programming error in caller code
+        User::Leave(KErrArgument);
+        }
+    else if (attCount == 1)
+        {
+        // get mimetype
+        CMsgMediaResolver* mediaResolver = CMsgMediaResolver::NewL();
+        CleanupStack::PushL(mediaResolver);
+        mediaResolver->SetCharacterSetRecognition(EFalse);
+        RFile filehandle = mediaResolver->FileHandleL(
+                attachmentManager->GetAttachmentInfoL(0)->FilePath());
+        CleanupClosePushL(filehandle);
+        TPtrC8 mimetype;
+        TDataType datatype;
+        mediaResolver->RecognizeL(filehandle, datatype);
+        mimetype.Set(datatype.Des8());
+        if (mimetype.CompareF(KMsgMimeTextPlain) == 0)
+            {
+            CreatePlainTextSMSL(filehandle);
+            CleanupStack::Pop(&filehandle);
+            filehandle.Close();
+            managerSync.RemoveAttachmentL(0);
+            }
+        else if (mimetype.CompareF(KMsgMimeVCard) == 0)
+            {
+            CreateVCardSMSL(filehandle);
+            CleanupStack::Pop(&filehandle);
+            filehandle.Close();
+            managerSync.RemoveAttachmentL(0);
+            }
+        else if (mimetype.CompareF(KMsgMimeVCal) == 0 || 
+                 mimetype.CompareF(KMsgMimeICal) == 0)
+            {
+            CreateVCalSMSL(filehandle);
+            CleanupStack::Pop(&filehandle);
+            filehandle.Close();
+            managerSync.RemoveAttachmentL(0);
+            }
+        else
+            {
+            User::Leave(KErrArgument);
+            }
+        CleanupStack::PopAndDestroy(mediaResolver);
+        }
+    // commit changes
+    store->CommitL();
+    CleanupStack::PopAndDestroy(store);
+
+    //we must create an entry selection for message copies
+    CMsvEntrySelection* selection = new ( ELeave ) CMsvEntrySelection;
+    CleanupStack::PushL( selection );
+
+    CMsvEntry& entry = SmsMtmL()->Entry();
+    TMsvEntry msvEntry( entry.Entry() );
+
+    if ( iOfflineSupported && iGenUtils->IsPhoneOfflineL() )
+    	{
+    	msvEntry.SetSendingState( KMsvSendStateSuspended );
+        msvEntry.iError = KErrGsmOfflineOpNotAllowed;
+    	}
+    else
+    	{
+    	msvEntry.SetSendingState( KMsvSendStateWaiting );
+    	}
+
+    CSmsHeader& header = SmsMtmL()->SmsHeader();
+    TBuf<KSmsMessageEntryDescriptionAmountOfChars> buf;
+
+    if (!iBioMsg  )
+        {
+        ExtractDescriptionFromMessageL(
+            header.Message(),
+            buf,
+            KSmsMessageEntryDescriptionAmountOfChars );
+        msvEntry.iDescription.Set( buf );
+        }
+
+    CSmsNumber* rcpt = CSmsNumber::NewL();
+    CleanupStack::PushL( rcpt );
+
+    TPtrC name;
+    TPtrC address;
+    TBool cantExit = ETrue;
+    while ( cantExit )
+        {
+        HBufC* addressBuf = NULL;
+        TPtr addressPtr( 0, 0);
+
+        NameAndAddress( iRecipients->MdcaPoint(0) , name, address );
+
+        // set To-field stuff into the Details of the entry
+        if ( name.Length() )
+            {
+            msvEntry.iDetails.Set( name );
+            }
+        else
+            {
+            // Internal data structures always holds the address data in western format.
+            // UI is responsible of doing language specific conversions.
+            addressBuf = HBufC::NewLC( address.Length() );
+            addressPtr.Set( addressBuf->Des() );
+            addressPtr.Copy( address );
+
+            iGenUtils->ConvertDigitsTo( addressPtr, EDigitTypeWestern );
+            msvEntry.iDetails.Set( addressPtr );
+            }
+        TMsvId copyId;
+
+        if ( iRecipients->Count() == 1 )
+            {
+            //Note that we came here also in case of many recipients. ...eventually.
+
+            if ( IsEmailAddress( address ) )
+                {
+                FillEmailInformationDataL( header, address );
+                //Let's remove the recipient and replace it with Email over SMS gateway address
+                //But let's first cehck if it exists
+                if( SmsMtmL( )->AddresseeList().Count() )
+                	{
+                    SmsMtmL( )->RemoveAddressee( 0 );
+                	}
+                SmsMtmL()->AddAddresseeL(
+	            iEmailOverSmsC->Address( ) ,
+		        KNullDesC( ) );
+                }
+            else
+                {
+                InsertSubjectL( header, SmsMtmL()->Body() );
+                }
+
+            entry.ChangeL( msvEntry );
+            SmsMtmL()->SaveMessageL();
+            // Move it
+            copyId = MoveMessageEntryL( KMsvGlobalOutBoxIndexEntryId );
+            cantExit = EFalse;
+            }
+        else
+            {// Many recipients in array
+
+            // Own copy function for Emails
+            // This is because EmailOverSms messages can
+            // contain adresses longer than 21 digits
+            if ( IsEmailAddress( address ) )
+                {
+                copyId = CreateMessageInOutboxL(
+                msvEntry, address );
+
+                }
+            else // For MSISDN's
+                {
+                rcpt->SetAddressL( address );
+                if ( name.Length() )
+                    { // add name only if we have alias
+                    rcpt->SetNameL( name );
+                    }
+
+                copyId = CreateMessageInOutboxL(
+                    msvEntry, *rcpt, SmsMtmL()->Body());
+
+                SmsMtmL()->RemoveAddressee( 0 );
+                }
+            //If hundreds of recipient, make sure viewserver
+            //timers are reseted
+            if ( iRecipients->Count() > 100 && ( iRecipients->Count() ) % 30 == 0 )
+                {
+                User::ResetInactivityTime();
+                }
+
+            iRecipients->Delete(0);
+            }
+        if ( addressBuf )
+            {
+            CleanupStack::PopAndDestroy( addressBuf );
+            }
+
+        // let's add the entry id into the cmsventryselection
+        selection->AppendL( copyId );
+        }
+    CleanupStack::PopAndDestroy( rcpt );
+
+    //Let's free some memory
+    if ( iRecipients )
+        {
+        delete iRecipients;
+        iRecipients = NULL;
+        }
+
+    SetScheduledSendingStateL( selection );
+    CleanupStack::PopAndDestroy( selection );
+    }
+
+
+// ----------------------------------------------------------------------------
+// MoveMessageEntryL
+// @see header
+// ----------------------------------------------------------------------------
+TMsvId UniEditorSmsPluginPrivate::MoveMessageEntryL( TMsvId aTarget )
+    {
+    TMsvEntry msvEntry( SmsMtmL()->Entry().Entry() );
+    TMsvId id = msvEntry.Id();
+
+    if ( msvEntry.Parent() != aTarget )
+        {
+        TMsvSelectionOrdering sort;
+        sort.SetShowInvisibleEntries( ETrue );
+        CMsvEntry* parentEntry= CMsvEntry::NewL( *iSession, msvEntry.Parent(), sort );
+        CleanupStack::PushL( parentEntry );
+
+        // Copy original from the parent to the new location
+        CMuiuOperationWait* wait = CMuiuOperationWait::NewLC();
+
+        CMsvOperation* op = parentEntry->MoveL(
+            msvEntry.Id(),
+            aTarget,
+            wait->iStatus );
+
+        CleanupStack::PushL( op );
+        wait->Start();
+        TMsvLocalOperationProgress prog = McliUtils::GetLocalProgressL( *op );
+        User::LeaveIfError( prog.iError );
+
+        id = prog.iId;
+
+        CleanupStack::PopAndDestroy( op );
+        CleanupStack::PopAndDestroy( wait );
+        CleanupStack::PopAndDestroy( parentEntry );
+        }
+
+    return id;
+    }
+
+// ----------------------------------------------------------------------------
+// CreateMessageInOutboxL
+// Use this function for non-email messages
+// @see header
+// ----------------------------------------------------------------------------
+TMsvId UniEditorSmsPluginPrivate::CreateMessageInOutboxL(
+    const TMsvEntry& aEntry,
+    const CSmsNumber& aRecipient,
+    const CRichText& aBody )
+    {
+    // Initialize the richtext object
+    CRichText* richText = CRichText::NewL( iParaFormatLayer, iCharFormatLayer );
+    CleanupStack::PushL( richText );
+
+    // Initialise header and store
+    CSmsHeader* header = CSmsHeader::NewL( CSmsPDU::ESmsSubmit, *richText );
+    CleanupStack::PushL( header );
+    CMsvStore* sourceStore = SmsMtmL()->Entry().ReadStoreL();
+    CleanupStack::PushL( sourceStore );
+
+    // Read store
+    header->RestoreL( *sourceStore );
+
+    // Initialise number with parameters
+    CSmsNumber* rcpt = CSmsNumber::NewL( aRecipient );
+    CleanupStack::PushL( rcpt );
+    header->Recipients().ResetAndDestroy();
+    header->Recipients().AppendL( rcpt );
+    CleanupStack::Pop( rcpt );
+
+    // Create entry to Outbox
+    TMsvEntry entry( aEntry );
+    entry.iMtmData3 = KSmsPluginBioMsgUnparsed;
+    CMsvEntry* outbox = iSession->GetEntryL( KMsvGlobalOutBoxIndexEntryId );
+    CleanupStack::PushL( outbox );
+    outbox->CreateL( entry );
+    iSession->CleanupEntryPushL( entry.Id() );
+    outbox->SetEntryL( entry.Id());
+
+    //Initialize target store
+    CMsvStore* targetStore;
+    targetStore = outbox->EditStoreL();
+    CleanupStack::PushL( targetStore );
+
+    //Add attachment
+    MMsvAttachmentManager& attaManager = sourceStore->AttachmentManagerL();
+    RFile tmpFile;
+
+    //Check if attachment exists and add it
+    if( sourceStore->AttachmentManagerL().AttachmentCount() )
+    	{
+        tmpFile = attaManager.GetAttachmentFileL( 0 );
+    	CleanupClosePushL( tmpFile );
+
+    	MMsvAttachmentManager& targetAttaMan = targetStore->AttachmentManagerL();
+		CMsvAttachment* targetAtta = CMsvAttachment::NewL( CMsvAttachment::EMsvFile );
+		CleanupStack::PushL( targetAtta );
+
+        CMuiuOperationWait* waiter = CMuiuOperationWait::NewLC();
+		targetAttaMan.AddAttachmentL( tmpFile, targetAtta, waiter->iStatus );
+		waiter->Start();
+
+     	CleanupStack::PopAndDestroy( waiter ); //waiter
+		CleanupStack::Pop(targetAtta );// targetAtta
+		CleanupStack::Pop( &tmpFile );//tmpFile
+    	}
+
+    TInt totalLength( aBody.DocumentLength() );
+    HBufC* bodyText = HBufC::NewLC ( totalLength );
+    TPtr bodyTextPtr ( bodyText->Des() );
+
+    aBody.Extract( bodyTextPtr, 0, totalLength );
+    richText->InsertL( 0, bodyTextPtr );
+    CleanupStack::PopAndDestroy( bodyText );
+
+    InsertSubjectL( *header, *richText );
+
+    targetStore->StoreBodyTextL( *richText );
+
+    header->StoreL( *targetStore );
+    targetStore->CommitL();
+
+    // Usually SMCM takes care of updating iSize, but now when msg is
+    // created to Outbox for several recipients this has to be done manually.
+    entry.iSize = targetStore->SizeL();
+    entry.iRelatedId = iSmsServiceId;
+    entry.iServiceId = KMsvLocalServiceIndexEntryId;
+    outbox->ChangeL( entry );
+    CleanupStack::PopAndDestroy( targetStore );
+
+    iSession->CleanupEntryPop();
+    CleanupStack::PopAndDestroy( outbox );
+    CleanupStack::PopAndDestroy( sourceStore );
+    CleanupStack::PopAndDestroy( header );
+    CleanupStack::PopAndDestroy( richText );
+    return entry.Id();
+    }
+
+// ---------------------------------------------------------
+// CMsgSmsEditorAppUi::CreateMessageInOutboxL
+// Creates message in outbox in case of multiple recipients
+// with some e-mail over SMS addresses
+// ---------------------------------------------------------
+TMsvId UniEditorSmsPluginPrivate::CreateMessageInOutboxL(
+    const TMsvEntry& aEntry,
+    const TDesC& aAddress )
+    {
+    CRichText* richText = CRichText::NewL( iParaFormatLayer, iCharFormatLayer );
+    CleanupStack::PushL( richText );
+    // Initialise header and store
+    CSmsHeader* header = CSmsHeader::NewL( CSmsPDU::ESmsSubmit, *richText );
+    CleanupStack::PushL( header );
+    CMsvStore* store = SmsMtmL()->Entry().ReadStoreL();
+
+    CleanupStack::PushL( store );
+    // Read store
+    header->RestoreL( *store );
+    CleanupStack::PopAndDestroy( store );
+    // Initialise number
+    CSmsNumber* rcpt = CSmsNumber::NewL();
+    CleanupStack::PushL( rcpt );
+    header->Recipients().ResetAndDestroy();
+    // Save Email specific information in header
+    FillEmailInformationDataL( *header, aAddress );
+    // Fill the recipient data for Email
+    // Address = Email gateway
+    // Alias = The real address
+    rcpt->SetAddressL( iEmailOverSmsC->Address()  );
+    rcpt->SetNameL( aAddress ); // This takes only 21 chars
+
+    header->Recipients().AppendL( rcpt );
+    CleanupStack::Pop( rcpt );
+    // Create entry to Outbox
+    TMsvEntry entry( aEntry );
+    entry.iMtmData3 = KSmsPluginBioMsgUnparsed;
+
+    CMsvEntry* outbox = iSession->GetEntryL( KMsvGlobalOutBoxIndexEntryId );
+    CleanupStack::PushL( outbox );
+    outbox->CreateL( entry );
+    iSession->CleanupEntryPushL( entry.Id());
+    outbox->SetEntryL( entry.Id());
+    // Save
+    store = outbox->EditStoreL();
+    CleanupStack::PushL( store );
+    header->StoreL( *store );
+
+    richText->Reset();
+    richText->InsertL( 0 , SmsMtmL()->Body().Read( 0 ) );
+
+    store->StoreBodyTextL( *richText );
+    store->CommitL();
+    // Usually SMCM takes care of updating iSize, but now when msg is
+    // created to Outbox for several recipients this has to be done manually.
+    entry.iSize = store->SizeL();
+    entry.iRelatedId = iSmsServiceId;
+    entry.iServiceId = KMsvLocalServiceIndexEntryId;
+    outbox->ChangeL( entry );
+
+    CleanupStack::PopAndDestroy( store );
+    iSession->CleanupEntryPop();
+    CleanupStack::PopAndDestroy( outbox );
+    CleanupStack::PopAndDestroy( header );
+    CleanupStack::PopAndDestroy( richText );
+    return entry.Id();
+    }
+
+// ----------------------------------------------------------------------------
+// SetScheduledSendingStateL
+// @see header
+// ----------------------------------------------------------------------------
+void UniEditorSmsPluginPrivate::SetScheduledSendingStateL( CMsvEntrySelection* aSelection )
+    {
+    const TMsvEntry msvEntry = SmsMtmL()->Entry().Entry();
+    if ( msvEntry.SendingState() == KMsvSendStateWaiting )
+        {
+        // Add entry to task scheduler
+        TBuf8<1> dummyParams;
+
+        CMuiuOperationWait* waiter = CMuiuOperationWait::NewLC();
+        waiter->iStatus = KRequestPending;
+
+        CMsvOperation* op= SmsMtmL()->InvokeAsyncFunctionL(
+            ESmsMtmCommandScheduleCopy,
+            *aSelection,
+            dummyParams,
+            waiter->iStatus );
+        CleanupStack::PushL( op );
+        waiter->Start();
+
+        CleanupStack::PopAndDestroy( op );
+        CleanupStack::PopAndDestroy( waiter );
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// NameAndAddress
+// @see header
+// ----------------------------------------------------------------------------
+void UniEditorSmsPluginPrivate::NameAndAddress( const TDesC& aMsvAddress, TPtrC& aName, TPtrC& aAddress )
+    {
+    TInt addressStart = aMsvAddress.LocateReverse( KMsgSmsAddressStartChar );
+    TInt addressEnd = aMsvAddress.LocateReverse( KMsgSmsAddressEndChar );
+
+    if ( addressStart != KErrNotFound && addressEnd != KErrNotFound
+        && addressEnd > addressStart )
+        {
+        // verified address, will be used as selected from contacts manager
+        aName.Set( aMsvAddress.Ptr(), addressStart );
+        aAddress.Set(
+            aMsvAddress.Mid( addressStart + 1 ).Ptr(),
+            ( addressEnd - addressStart ) -1 );
+        if ( !aAddress.Length())
+            {
+            aAddress.Set( aName );
+            aName.Set( KNullDesC ); // empty string
+            }
+        }
+    else
+        {
+        // unverified string, will be used as entered in the header field
+        aName.Set( KNullDesC ); // empty string
+        aAddress.Set( aMsvAddress.Ptr(), aMsvAddress.Length() ); // a whole string to address
+        }
+
+    if ( aName.CompareF( aAddress ) == 0 )
+        {
+        aName.Set( KNullDesC ); // empty string
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// UniEditorSmsPluginPrivate::ExtractDescriptionFromMessageL
+// @see header
+// ----------------------------------------------------------------------------
+void UniEditorSmsPluginPrivate::ExtractDescriptionFromMessageL(
+    const CSmsMessage& aMessage,
+    TDes& aDescription,
+    TInt aMaxLength)
+    {
+    // subject was already put in emailfields
+    HBufC* subject = SmsMtmL()->SmsHeader().EmailFields().Subject().AllocL();
+    if ( subject->Length() > 0 )
+        {
+        aDescription = subject->Des().Left(aMaxLength);
+        }
+    else
+        {// Extract from message body
+        aMessage.Buffer().Extract(
+            aDescription,
+            0,
+            Min(
+                aMaxLength,
+                aMessage.Buffer().Length()));
+        }
+
+    //replace paragraphs with spaces.
+    TBuf<KSmsEdExtrDescReplaceCharacterCount> replaceChars;
+    replaceChars.Zero();
+    replaceChars.Append( CEditableText::EParagraphDelimiter );
+    replaceChars.Append( KSmsEdUnicodeLFSupportedByBasicPhones );
+    replaceChars.Append( CEditableText::ELineBreak );
+    iGenUtils->ReplaceCharacters( aDescription, replaceChars, CEditableText::ESpace );
+    aDescription.Trim();
+    }
+
+// ----------------------------------------------------------------------------
+// CreatePlainTextSMSL
+// @see header
+// ----------------------------------------------------------------------------
+void UniEditorSmsPluginPrivate::CreatePlainTextSMSL( RFile& aFile)
+    {
+    RFileReadStream stream( aFile );
+    CleanupClosePushL( stream );
+
+    CPlainText::TImportExportParam param;
+    param.iForeignEncoding = KCharacterSetIdentifierUtf8;
+    param.iOrganisation = CPlainText::EOrganiseByParagraph;
+
+    CPlainText::TImportExportResult result;
+
+    SmsMtmL()->Body().ImportTextL( 0, stream, param, result );
+
+    CleanupStack::PopAndDestroy( &stream );
+    }
+
+// ----------------------------------------------------------------------------
+// InsertSubjectL
+// Insert subject for non email addresses into the body
+// ----------------------------------------------------------------------------
+void UniEditorSmsPluginPrivate::InsertSubjectL( CSmsHeader& aHeader, CRichText& aText  )
+    {
+    // subject was already put in emailfields
+    HBufC* subject = SmsMtmL()->SmsHeader().EmailFields().Subject().AllocL();
+    if ( ( subject->Length() > 0 ) && !iBioMsg )
+       {
+        CleanupStack::PushL(subject);
+        TInt writePosition = subject->Length()+2;//+2 for the parentesis
+
+        if ( subject->Locate( KUniSmsStartParenthesis )!= KErrNotFound ||
+            subject->Locate( KUniSmsEndParenthesis ) != KErrNotFound)
+            {
+            HBufC* modifiableSubject = subject->Alloc();
+            CleanupStack::PushL(modifiableSubject);
+            TPtr ptr = modifiableSubject->Des();
+
+            TBuf<1> replaceChars;
+            replaceChars.Zero();
+            replaceChars.Append( KUniSmsStartParenthesis );
+            // Replace '(' chars with '<'
+            iGenUtils->ReplaceCharacters( ptr, replaceChars, TChar('<') );
+
+            replaceChars.Zero();
+            replaceChars.Append( KUniSmsEndParenthesis );
+            // Replace ')' chars with '>'
+            iGenUtils->ReplaceCharacters( ptr, replaceChars, TChar('>') );
+
+            aText.InsertL( 0, KUniSmsStartParenthesis );
+            aText.InsertL( 1, ptr );
+            aText.InsertL( writePosition-1, KUniSmsEndParenthesis );
+            CleanupStack::PopAndDestroy( modifiableSubject );
+            }
+        else
+            {
+            aText.InsertL( 0, KUniSmsStartParenthesis );
+            aText.InsertL( 1, *subject );
+            aText.InsertL( writePosition-1, KUniSmsEndParenthesis );
+            }
+        }
+
+    // Clears the CSmsHeaders EmailFields for non Email addresses
+    CSmsEmailFields* emailFields = CSmsEmailFields::NewL();
+    CleanupStack::PushL( emailFields );
+    aHeader.SetEmailFieldsL( *emailFields );
+    CleanupStack::PopAndDestroy( emailFields );
+    }
+
+// ----------------------------------------------------------------------------
+// CreateVCardSMS
+// @see header
+// ----------------------------------------------------------------------------
+void UniEditorSmsPluginPrivate::CreateVCardSMSL( RFile& aFile )
+    {
+    TInt fileSize;
+    TInt err ( aFile.Size( fileSize ) );
+    User::LeaveIfError(err);
+
+    // Create two buffers: 8-bit for reading from file and 16-bit for
+    // converting to 16-bit format
+    HBufC8* buf8 = HBufC8::NewLC( fileSize );
+    TPtr8 ptr8 = buf8->Des();
+    HBufC16* buf16 = HBufC16::NewLC( fileSize );
+    TPtr16 ptr16 = buf16->Des();
+
+    for (TInt err = aFile.Read(ptr8);
+        ptr8.Length() > 0;
+        err = aFile.Read(ptr8))
+        {
+        User::LeaveIfError(err);
+        ptr16.Copy(ptr8);
+        SmsMtmL()->Body().InsertL(SmsMtmL()->Body().DocumentLength(), ptr16);
+        }
+
+    // Cleanup and return
+    CleanupStack::PopAndDestroy( buf16 );
+    CleanupStack::PopAndDestroy( buf8 );
+    }
+
+// ----------------------------------------------------------------------------
+// CreateVCalSMS
+// @see header
+// ----------------------------------------------------------------------------
+void UniEditorSmsPluginPrivate::CreateVCalSMSL( RFile& aFile )
+    {
+    TInt err (KErrNone);
+    TInt fileSize;
+    err = aFile.Size( fileSize );
+    User::LeaveIfError(err);
+
+    HBufC8* buf8 = HBufC8::NewLC( fileSize );
+    TPtr8 ptr8 = buf8->Des();
+
+    err = aFile.Read( ptr8 );
+    User::LeaveIfError(err);
+
+    HBufC16* buf16 = HBufC16::NewLC( fileSize );
+    TPtr16 ptr16 = buf16->Des();
+
+    ptr16.Copy(ptr8);
+    SmsMtmL()->Body().InsertL(0, ptr16);
+
+    CleanupStack::PopAndDestroy( buf16 );
+    CleanupStack::PopAndDestroy( buf8 );
+    }
+
+// ----------------------------------------------------------------------------
+// UniEditorSmsPluginPrivate::ValidateSCNumberL
+// @see header
+// ----------------------------------------------------------------------------
+TBool UniEditorSmsPluginPrivate::ValidateSCNumberL()
+    {
+    TBool valid( EFalse );
+    CSmsAccount* smsAccount = CSmsAccount::NewLC();
+    CSmsSettings* settings = CSmsSettings::NewLC();
+    
+    smsAccount->LoadSettingsL(*settings);
+
+    int serviceCenterCount = settings->ServiceCenterCount();
+    
+    if( serviceCenterCount > 0 )
+    {
+      TInt defaultIndex = settings->DefaultServiceCenter();
+      if( settings->GetServiceCenter(defaultIndex).Address().Length() > 0 )
+      {
+          valid = ETrue;    
+      }
+    }
+    else if(settings->ReplyPath())    
+    {
+        valid = ETrue;
+    }
+    
+    CleanupStack::PopAndDestroy(2);
+    return valid;
+    }
+
+// ---------------------------------------------------------
+// UniEditorSmsPluginPrivate::ValidateSCNumberForEmailOverSmsL
+// @see header
+// ---------------------------------------------------------
+TBool UniEditorSmsPluginPrivate::ValidateSCNumberForEmailOverSmsL()
+    {
+    TBool confNeeded( EFalse );
+    // Read the email settings
+    TBuf<KUniSmsSCStringLength> emailSmscNumber;
+    TBuf<KUniSmsSCStringLength> emailGateWayNumber;
+    TBool notUsed( EFalse );
+    // The file may not exist
+    TInt readResult = iGenUtils->ReadEmailOverSmsSettingsL(
+                        emailSmscNumber,
+                        emailGateWayNumber,
+                        notUsed );
+    if ( KErrNone == readResult )
+        {
+        // Check that both have valid values
+        // In any otther case we need to show the conf pop-up window
+        if ( emailSmscNumber != KNullDesC && emailGateWayNumber != KNullDesC)
+            {
+            confNeeded = ETrue;
+            }
+        }
+
+	return confNeeded;
+    }
+
+// ---------------------------------------------------------
+// UniEditorSmsPluginPrivate::FillEmailInformationDataL
+// @see header
+// ---------------------------------------------------------
+void UniEditorSmsPluginPrivate::FillEmailInformationDataL(
+    CSmsHeader& aHeader,
+    const TPtrC& aAddress )
+    {
+    CSmsEmailFields* emailFields = CSmsEmailFields::NewL();
+    CleanupStack::PushL( emailFields );
+
+    // The Email SMSC may differ from sms SMSC
+    aHeader.Message().SetServiceCenterAddressL( iEmailOverSmsC->Name() );
+
+    // Check if there is need to save as EmailFieds with header
+    if ( aAddress.Length() )
+        {
+        // Set the address
+        emailFields->AddAddressL( aAddress );
+        }
+
+    // subject was already put in emailfields
+    HBufC* subject = SmsMtmL()->SmsHeader().EmailFields().Subject().AllocL();
+    if ( subject->Length() > 0 )
+        { // Handle the subject
+        CleanupStack::PushL( subject );
+        TPtr text = subject->Des();
+
+        TBuf<1> replaceChars;
+        replaceChars.Zero();
+        replaceChars.Append( KUniSmsStartParenthesis );
+        // Replace '(' chars with '<'
+        iGenUtils->ReplaceCharacters( text, replaceChars, TChar('<') );
+
+        replaceChars.Zero();
+        replaceChars.Append( KUniSmsEndParenthesis );
+        // Replace ')' chars with '>'
+        iGenUtils->ReplaceCharacters( text, replaceChars, TChar('>') );
+
+        // For Emails save it to CSmsEmailFields
+        emailFields->SetSubjectL( text );
+        CleanupStack::PopAndDestroy( subject );
+        }
+
+    aHeader.SetEmailFieldsL( *emailFields );
+    CleanupStack::PopAndDestroy( emailFields );
+    }
+
+
+
+// ----------------------------------------------------
+//  UniEditorSmsPluginPrivate::IsEmailAddress()
+// @see header
+// ----------------------------------------------------
+TBool UniEditorSmsPluginPrivate::IsEmailAddress( const TPtrC& aAddress ) const
+    {
+    TBool isEmailAddress( EFalse );
+    if (  aAddress.Locate('@')  != KErrNotFound)
+        {
+        isEmailAddress = ETrue;
+        }
+    return isEmailAddress;
+    }
+
+//------------------------------------------------------------------------------
+// UniEditorSmsPluginPrivate::SetEncodingSetings
+// Turkish SMS-PREQ2265 Specific
+// To Set encoding settings like encoding type, character support
+// and alternative encoding if any
+//
+// IMPORTANT NOTE:
+// This function is usually called from CV and UE to reset/set alternative
+// encoding or char support
+// when corresponding feilds change. Hence aUnicodeMode is always set to false
+//------------------------------------------------------------------------------
+void UniEditorSmsPluginPrivate::SetEncodingSettings( TBool aUnicodeMode,
+    TSmsEncoding aAlternativeEncodingType, 
+    TInt aCharSupportType)
+    {
+    
+    if ( !iSmsHeader )
+    {
+        iSmsHeader = CSmsHeader::NewL( CSmsPDU::ESmsSubmit, *iRichText );
+
+        CSmsSettings* settings = CSmsSettings::NewLC();
+        CSmsAccount* account = CSmsAccount::NewLC();
+        account->LoadSettingsL( *settings );
+        CleanupStack::PopAndDestroy( account );
+        iSmsHeader->SetSmsSettingsL( *settings );
+        CleanupStack::PopAndDestroy( settings );    
+    }
+
+    TSmsUserDataSettings smsSettings;
+    CSmsMessage& smsMsg = iSmsHeader->Message();
+
+    iUnicodeMode = aUnicodeMode;
+    iCharSupportType = aCharSupportType; 
+    iAlternativeEncodingType = aAlternativeEncodingType;
+
+    if (iUnicodeMode)
+    {
+        smsSettings.SetAlphabet(TSmsDataCodingScheme::ESmsAlphabetUCS2);
+    }
+    else
+    {
+        smsSettings.SetAlphabet(TSmsDataCodingScheme::ESmsAlphabet7Bit);
+    }
+
+    smsSettings.SetTextCompressed(EFalse);
+
+    smsMsg.SetUserDataSettingsL( smsSettings );
+    //First try without any alternate encoding
+    smsMsg.SetAlternative7bitEncoding( aAlternativeEncodingType );
+    }
+
+//------------------------------------------------------------------------------
+// UniEditorSmsPluginPrivate::GetNumPDUs
+// Turkish SMS-PREQ2265 Specific
+// To get PDU Info: extracts details of number of PDUs, number of remaining
+// chars in last PDU
+// and encoding types used.
+//------------------------------------------------------------------------------
+void UniEditorSmsPluginPrivate::GetNumPDUsL(
+        TDesC& aBuf,
+        TInt& aNumOfRemainingChars,
+        TInt& aNumOfPDUs,
+        TBool& aUnicodeMode,
+        TSmsEncoding & aAlternativeEncodingType )
+    {
+    TInt numOfUnconvChars, numOfDowngradedChars, isAltEncSupported;
+    TSmsEncoding currentAlternativeEncodingType;
+    
+    CSmsMessage& smsMsg = iSmsHeader->Message();
+
+    // need to set the input buffer to SMS buffer through iRichText(which is reference to SMS Buffer object)
+    iRichText->Reset();
+    iRichText->InsertL(0, aBuf);
+
+    //call SMS stack API to get PDU info
+    smsMsg.GetEncodingInfoL( aNumOfPDUs, numOfUnconvChars, numOfDowngradedChars, aNumOfRemainingChars );
+
+    //Algo to switch to Unicode if required
+    while( (numOfUnconvChars || numOfDowngradedChars) && !iUnicodeMode )
+        {
+        currentAlternativeEncodingType = smsMsg.Alternative7bitEncoding();
+        if( currentAlternativeEncodingType != iAlternativeEncodingType )
+            {
+            //try with this new alternative encoding type
+            isAltEncSupported = smsMsg.SetAlternative7bitEncoding( iAlternativeEncodingType );
+            if( isAltEncSupported == KErrNotSupported )
+                {
+                // if required alternative encoding plugin is not supported, retain the existing encoding mechanism.
+                iAlternativeEncodingType = currentAlternativeEncodingType;
+                continue;
+                }
+            }
+        else if( numOfUnconvChars || iCharSupportType == TUniSendingSettings::EUniCharSupportFull)
+            {
+            //switch to Unicode
+            //iUnicodeMode = ETrue;
+            SetEncodingSettings( ETrue, iAlternativeEncodingType, TUniSendingSettings::EUniCharSupportFull);
+            }
+        else
+            {
+            //Get out of while loop and return the results
+            break;
+            }
+        //get the PDU info with new settings
+        iRichText->Reset();
+        iRichText->InsertL(0, aBuf);
+        smsMsg.GetEncodingInfoL( aNumOfPDUs, numOfUnconvChars, numOfDowngradedChars, aNumOfRemainingChars );
+        }
+
+    /*
+     * Enable the below code to debug if something wrong with characters sent even in unicode mode
+     */
+
+    aUnicodeMode = iUnicodeMode;
+    aAlternativeEncodingType = iAlternativeEncodingType;
+    if(iUnicodeMode)
+        {
+        //In case of Unicode mode, SMS Stack returns number of available free User Data units.
+        //Need to convert them w.r.t characters(each char takse 2 UD units).
+        aNumOfRemainingChars = aNumOfRemainingChars/2;
+        }
+    }
+
+// ----------------------------------------------------
+//  UniEditorSmsPluginPrivate::DeleteDraftsEntryL()
+// @see header
+// ----------------------------------------------------
+void UniEditorSmsPluginPrivate::DeleteDraftsEntryL( TMsvId aId )
+    {
+    CMsvEntry* pEntry = iSession->GetEntryL(KMsvDraftEntryIdValue);
+    CleanupStack::PushL(pEntry);
+    pEntry->DeleteL( aId );
+    CleanupStack::PopAndDestroy(pEntry);
+    }
+
+// ----------------------------------------------------
+//  UniEditorSmsPluginPrivate::populateRecipientsL()
+// @see header
+// ----------------------------------------------------
+void UniEditorSmsPluginPrivate::populateRecipientsL(
+    ConvergedMessage *aMessage)
+{
+    TPtrC name;
+    TPtrC address;
+
+    const CSmsEmailFields& emailFields = SmsMtmL( )->SmsHeader( ).EmailFields();
+    if( emailFields.HasAddress( ))
+        { // If email address set -> copy them here
+        const MDesCArray& emailRecipients = emailFields.Addresses();
+        for( TInt id = 0; id < emailRecipients.MdcaCount( ); id++ )
+            {
+            HBufC* pureAddr = TMmsGenUtils::PureAddress( emailRecipients.MdcaPoint( id ) ).AllocLC();
+            HBufC* aliasAddr = TMmsGenUtils::Alias( emailRecipients.MdcaPoint( id ) ).AllocLC();
+            ConvergedMessageAddress messageAddress(
+                    S60QConversions::s60DescToQString(*pureAddr), 
+                    S60QConversions::s60DescToQString(*aliasAddr));
+            CleanupStack::PopAndDestroy(2, pureAddr );
+            aMessage->addToRecipient(messageAddress);
+            }
+        }
+
+    // Copy non-email over sms addresses if needed
+    const CMsvRecipientList& smsRecipients = SmsMtmL()->AddresseeList();
+    int smsRecCount = smsRecipients.Count();
+    for (int i = 0; i < smsRecCount; i++)
+        { // Go thru all the recipients
+        if( !emailFields.HasAddress( ) )
+            { // and copy them only if email addresses did not exist
+            HBufC* pureAddr =
+                    TMmsGenUtils::PureAddress(smsRecipients[i]).AllocLC();
+            HBufC* aliasAddr =
+                    TMmsGenUtils::Alias(smsRecipients[i]).AllocLC();
+            ConvergedMessageAddress messageAddress(
+                    S60QConversions::s60DescToQString(*pureAddr), 
+                    S60QConversions::s60DescToQString(*aliasAddr));
+            CleanupStack::PopAndDestroy(2, pureAddr );
+            aMessage->addToRecipient(messageAddress);
+            }
+        }
+
+    if( emailFields.Subject( ).Length( ) )
+        { // If email subject exists -> copy it
+        aMessage->setSubject(S60QConversions::s60DescToQString(
+                emailFields.Subject()));
+        }
+
+}
+
+// ----------------------------------------------------
+// UniEditorSmsPluginPrivate::populateMessageBodyL()
+// @see header
+// ----------------------------------------------------
+void UniEditorSmsPluginPrivate::populateMessageBodyL(
+    ConvergedMessage* aMessage,
+    TMsvEntry &aEntry)
+{
+    if (  aEntry.iBioType == KMsgBioUidVCard.iUid
+            || aEntry.iBioType == KMsgBioUidVCalendar.iUid )
+    {
+        //In case of drafts the vcal is present inside msg store and
+        //can be read directly
+        if(aEntry.Parent() == KMsvDraftEntryIdValue)
+        { 
+            //In case of drafts the vcf/vcs file is stored inside store
+            //so we can directly extract it
+            CMsvStore* store = SmsMtmL()->Entry().EditStoreL();
+            CleanupStack::PushL( store );
+            MMsvAttachmentManager& manager = store->AttachmentManagerL();
+            CMsvAttachment *attachment = manager.GetAttachmentInfoL(0);
+            QString filepath = S60QConversions::s60DescToQString(attachment->FilePath());
+            ConvergedMessageAttachment* conv_attachment = 
+                new ConvergedMessageAttachment(filepath, ConvergedMessageAttachment::EAttachment);
+            ConvergedMessageAttachmentList conv_attList;
+            conv_attList << conv_attachment;
+            aMessage->addAttachments(conv_attList);
+            CleanupStack::PopAndDestroy( store );
+        }
+        else
+        {
+            //For non drafts cases extract the vcf/vcs using datamodel interface
+            UniDataModelLoader* pluginLoader = new UniDataModelLoader();
+            UniDataModelPluginInterface* pluginInterface = 
+                                pluginLoader->getDataModelPlugin(ConvergedMessage::BioMsg);
+            pluginInterface->setMessageId(aEntry.Id());
+            UniMessageInfoList attachments = pluginInterface->attachmentList();
+            
+            QString attachmentPath = attachments[0]->path();
+
+            ConvergedMessageAttachment* conv_attachment = 
+                new ConvergedMessageAttachment(attachmentPath, ConvergedMessageAttachment::EAttachment);
+            ConvergedMessageAttachmentList conv_attList;
+            conv_attList << conv_attachment;
+            aMessage->addAttachments(conv_attList);
+
+            foreach(UniMessageInfo* attachment,attachments)
+            {
+                delete attachment;
+            }
+            
+            delete pluginLoader;
+        }
+    }
+    else   //plain text
+    {
+        TInt totalLength( SmsMtmL()->Body().DocumentLength() );
+        if ( totalLength > 0 )
+        {
+            HBufC* bodyText = HBufC::NewLC ( totalLength ); 
+            TPtr bodyTextPtr ( bodyText->Des() ); 
+            SmsMtmL()->Body().Extract( bodyTextPtr, 0, totalLength );
+            aMessage->setBodyText(S60QConversions::s60DescToQString(
+                bodyTextPtr));
+            CleanupStack::PopAndDestroy( bodyText );            
+        }
+    }
+}
+
+// ----------------------------------------------------
+// UniEditorSmsPluginPrivate::HandleSessionEventL()
+// @see header
+// ----------------------------------------------------
+void UniEditorSmsPluginPrivate::HandleSessionEventL(TMsvSessionEvent /*aEvent*/,
+                                                  TAny* /*aArg1*/,
+                                                  TAny* /*aArg2*/, TAny* /*aArg3*/)
+{
+// do nothing
+}
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/bwins/test_sms_pluginu.def	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,21 @@
+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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/ced_simtsy.cfg	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,2244 @@
+############################################################
+## 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/testmsg.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,600 @@
+/*
+ * 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 <s60qconversions.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 = S60QConversions::qStringToS60Desc(serviceCenter01);
+    HBufC* sC02 = S60QConversions::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 = S60QConversions::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 = S60QConversions::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 = S60QConversions::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 = S60QConversions::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 = S60QConversions::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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/testsmsplugin.cpp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,249 @@
+/*
+ * 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));
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/testsmsplugin.h	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ * 
+ * Description:
+ */
+
+#ifndef 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/testsmsplugin.ini	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,27 @@
+//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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingapp/msgutils/unieditorutils/unieditorplugins/unieditorsmsplugin/tsrc/testsmsgplugin/testsmsplugin.pro	Mon May 03 12:29:07 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:
+#
+
+QT += testlib
+QT -= gui
+
+TEMPLATE = lib
+TARGET = test-sms-plugin
+
+
+INCLUDEPATH += .
+INCLUDEPATH += ../../../../../../inc
+INCLUDEPATH += ../../../../unieditorutils/inc
+INCLUDEPATH += ../../../../s60qconversions/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
+	}
+    
+ LIBS += -leuser \
+    -lconvergedmessageutils \
+    -ls60qconversions \
+    -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/unieditorsmsplugin.pro	Mon May 03 12:29:07 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:
+#
+#
+
+TEMPLATE = lib
+
+TARGET = $$qtLibraryTarget(unieditorsmsplugin)
+TARGET.CAPABILITY = All -TCB
+TARGET.EPOCALLOWDLLDATA = 1
+
+# UID 3
+TARGET.UID3 = 0x102072DA
+
+INCLUDEPATH += ../../../s60qconversions/inc
+INCLUDEPATH += ../../editorgenutils/inc
+INCLUDEPATH += ../../../../../inc
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+SYMBIAN_PLATFORMS = WINSCW \
+    ARMV5
+
+CONFIG += plugin
+CONFIG += hb
+
+# Input
+HEADERS += inc/unieditorsmsplugin.h \
+    inc/unieditorsmsplugin_p.h
+    
+SOURCES += src/unieditorsmsplugin.cpp \
+    src/unieditorsmsplugin_p.cpp
+
+# Build.inf rules
+BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
+    "rom/unieditorsmsplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(unieditorsmsplugin.iby)"
+
+LIBS += -leuser \
+    -lconvergedmessageutils \
+    -ls60qconversions \
+    -lMsgMedia \
+    -leditorgenutils \
+    -lcone \
+    -leikcoctl \
+    -leikcore \
+    -leikdlg \
+    -lmsgs \
+    -letext \
+    -lgsmu \
+    -lmmsgenutils \
+    -lefsrv \
+    -lestor \
+    -lsmcm \
+    -lCommonEngine \
+    -lbafl \
+    -lCdlEngine \
+    -lFeatMgr \
+    -lapmime \
+    -lunidatamodelloader
+
+# plugin stub deployment
+plugin.sources = unieditorsmsplugin.dll
+plugin.path = \resource\qt\plugins\messaging\editorplugins
+DEPLOYMENT += plugin
--- a/messagingapp/msgutils/unieditorutils/unieditorutils.pro	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/msgutils/unieditorutils/unieditorutils.pro	Mon May 03 12:29:07 2010 +0300
@@ -13,48 +13,13 @@
 #
 # Description:
 #
-#
 
-TEMPLATE = lib
-TARGET = unieditorutils
-DEPENDPATH += . inc src
-
-INCLUDEPATH += .
-INCLUDEPATH += ../../../inc
-INCLUDEPATH += ../s60qconversions/inc
-INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+TEMPLATE = subdirs
 
-DEFINES += BUILD_MUIU_UITLS_DLL
-#QMAKE_CXXFLAGS.ARMCC -= --no_hide_all
-
-# UID3
-TARGET.UID3 = 0x2001FE70
+CONFIG += ordered
 
-# Capability
-TARGET.CAPABILITY = CAP_GENERAL_DLL
-
-TARGET.EPOCALLOWDLLDATA = 1
-
-# Platforms
 SYMBIAN_PLATFORMS = WINSCW ARMV5
 
-# Build.inf rules
-BLD_INF_RULES.prj_exports += \
-     "$${LITERAL_HASH}include <platform_paths.hrh>" \
-     "rom/unieditorutils.iby  CORE_APP_LAYER_IBY_EXPORT_PATH(unieditorutils.iby)"
-
-# Input
-HEADERS += inc/MuiuOperationWait.h \
-    inc/UniEditorGenUtils.h
-    
-SOURCES += src/MuiuOperationWait.cpp \
-    src/UniEditorGenUtils.cpp
-
-LIBS += -leuser \
-    -lCentralRepository \
-    -lconvergedmessageutils \
-    -lsssettings \
-    -ls60qconversions \
-    -lMsgMedia \
-    -lapmime
-
+SUBDIRS += editorgenutils/editorgenutils.pro
+SUBDIRS += unieditorplugins/unieditorplugins.pro
+SUBDIRS += unieditorpluginloader/unieditorpluginloader.pro
\ No newline at end of file
--- a/messagingapp/shareui/inc/shareuiprivate.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/shareui/inc/shareuiprivate.h	Mon May 03 12:29:07 2010 +0300
@@ -11,37 +11,59 @@
 *
 * Contributors:
 *
-* Description:  Offers message creation and sending services.
- *
+* Description:  Offers file share services.
+*
 */
 
-
-
-#ifndef SHAREUIPRIVATE_H_
-#define SHAREUIPRIVATE_H_
-
-#include <qobject.h>
-#include <qfile.h>
-#include <qstandarditemmodel.h>
-#include <QModelIndex>
-#include <QStringList>
+#ifndef __SHARE_UI_PRIVATE_H__
+#define __SHARE_UI_PRIVATE_H__
 
-#include <hbaction.h>
-#include <hbmenu.h>
-#include <hbdialog.h>
-#include <hblabel.h>
-#include <hblistview.h>
-#include <hblistviewitem.h>
+#include <QObject>
+#include <QMap>
+#include <QAction>
+#include <QModelIndex>
+#include <QStandardItemModel>
+#include <HbListViewItem>
+#include <xqappmgr.h>
 
-#include <xqaiwrequest.h>
-#include <xqappmgr.h>
-#include <xqaiwinterfacedescriptor.h>
-
+// FORWARD DECLARATIONS
+class XQAiwRequest;
+class XQAiwInterfaceDescriptor;
+class HbAction;
+class HbDialog;
+class HbListView;
+class HbListViewItem;
+class HbTextItem;
+class HbIconItem;
 
 #define SERVICE_INTERFACE "imessage.send"
 #define SHARE_OP "send(QVariant)"
 
 /**
+ * Data roles for list
+ */
+enum ShareItemDataRole {
+    ProviderNameRole = 10000,
+    ProviderIconRole = 10001
+};
+
+/**
+ * Share List item prototype
+ */
+class ShareListItem : public HbListViewItem
+    {
+    Q_OBJECT
+    
+public:
+    ShareListItem(QGraphicsItem* parent=0);
+    HbAbstractViewItem* createItem();
+    void updateChildItems();
+private:
+    HbIconItem* mProviderIcon;
+    HbTextItem *mProviderName;
+    };
+
+/**
  * Private implementaion of shareui.
  * implements showing sending services dialog and sending files
  */
@@ -62,26 +84,24 @@
     virtual ~ShareUiPrivate();
     
     /**
-     * method for passing file list to the sending services
+     * Initiate share for the specified files.
      * @param fileList list of paths to files.eg: c:\images\sunset.jpg
-     * @param embedded true if sendui dialog is embedded in the launched application
+     * @param embedded true if service launched is embedded in the 
+     * launched application.
      * 
-     * @return bool true if dialog initialization successfull otherwise false
+     * @return bool true if dialog initialization successfull. Otherwise false.
      */
     bool init(QStringList& fileList, bool embedded);
     
-
-    
 public slots:
 
     /**
-     * Handles setting th orguments for triggered service
+     * Handles setting the arguments for triggered service.
      */
     void onTriggered(void); 
     
     /**
      * Slot for handling valid returns from the framework.
-     * 
      * @param result const QVariant&
      */
     void handleOk(const QVariant& result);
@@ -106,58 +126,74 @@
     void itemActivated(QModelIndex index);
     
 private:
-
     /**
-     * fetchServiceDescriptors
-     * 
-     * Fetches the service descriptors using the Application Manager api. 
-     * 
-     * @return error boolean true if successfully fetched.
-     */
-    bool fetchServiceDescriptors(QList<XQAiwInterfaceDescriptor>& descriptorList);
-    
-    /**
-     * fetchServiceAction fetches the action associated with a specified interface descriptor.
-     * This is used after the fetchServiceDescriptors is called, and 
-     * 
-     * @param serviceDescriptor ServiceDescriptor fetched using fetchServiceDescriptors
-     * @return error boolean true if successfully fetched.
+     * Fetch the action associated with a specified interface descriptor.
+     * @param interfaceDescriptor Descriptor got from application manager.
+     * @return The action.
      */
     HbAction* fetchServiceAction(XQAiwInterfaceDescriptor interfaceDescriptor);    
     
     /**
-      * Creates the view for the sendui dialog.
-      *  
-      * @return bool true if initialization was successful, false otherwise.
-      */
-    void initializeUi(void);
+     * Creates the view for the share ui dialog.
+     */
+    void initializeUi();
     
     /**
-     * Update the SendUi Dialog (and associated list items) once the required
+     * Update the shareui dialog (and associated list items) once the required
      * information has been fetched.
-     * 
-     * @params action HbAction* The action that must be associated with the entry at that point in the list.
+     * @param action HbAction* The action associated with list entry.
+     * @param iconName The icon to be displayed 
      */
-    bool updateShareUiDialogList(HbAction* action);
+    void updateShareUiDialogList(HbAction* action, QString iconName);
     
     /**
-     * Enable the UI and show it on the screen.
-     */
-    void enableUi(void);
-    
-    /**
-     * Convert a qaction to hbaction.
-     * 
+     * Convert a QAction to HbAction.
      * @param action QAction*
      * @return HbAction* 
      */
     HbAction* convertAction(QAction *action);
+
+#ifdef __SHAREUI_MIME_HANDLING__  
+    /**
+     * Checks if the specified content type is allowed as per the 
+     * specified MIME pattern strings.
+     * @param mimeType List of file MIME types
+     * @param mimePattern List of file MIME patterns
+     * @return true if the content is allowed.
+     */
+    bool isContentAllowed ( QStringList mimeType, QString mimePattern );
+    
+    /** Checks if the specified content type is blocked as per the 
+     * specified MIME pattern strings.
+     * @param mimeType List of file MIME types
+     * @param mimePattern List of file MIME patterns
+     * @return true if the content is blocked.
+     */
+    bool isContentBlocked ( QStringList mimeType, QString mimePattern );
+    
+    /**
+     * Get file attributes
+     * @param fileList List of files.
+     * @param mimeTypeList (out) List of MIME types corresponding to the files.
+     * @param forwardStatusList (out) List of forward status corresponding to the files.
+     */
+    void getFileAttributes ( QStringList& fileList, QStringList& mimeTypeList,
+            QStringList& forwardStatusList );
+#endif
+    
+    /**
+     * Show notes
+     */
+    void showNote(QString text);
+    
+    /**
+     * Reset internal data structures
+     */
+    void reset();
     
 private:
     /**
-     * 
      * List of files to be sent.
-     * 
      */
     QList<QVariant> mFileList;
     
@@ -165,40 +201,36 @@
      * Service List
      */
     QList<XQAiwRequest*> mAiwRequestList;
+    
     /**
      * ShareUi dialog
      */
     HbDialog* mSharePopup;
     
     /**
-     * 
      * item model for content list view.
-     */
+     */    
+    QStandardItemModel* mContentItemModel;
     
-    QStandardItemModel* mContentItemModel;
     /**
      * content view
-     */
-    
+     */    
     HbListView* mContentListView;
     
     /**
      * mapping qmodelindex to the action
-     * 
-     */
-    
+     */    
     QMap<QModelIndex, HbAction*> mIndexActionMap;
     
     /**
-     * Application Manager
+     * Application Manager.
      */
     XQApplicationManager mAppManager;
     
     /**
      * Whether to launch the sending application as embedded or not.
      */
-    bool mIsEmbedded;
-    
+    bool mIsEmbedded;  
     };
 
-#endif /* SENDUIDIALOG_P_H_ */
+#endif /* __SHARE_UI_PRIVATE_H__ */
--- a/messagingapp/shareui/shareui.pro	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/shareui/shareui.pro	Mon May 03 12:29:07 2010 +0300
@@ -11,24 +11,23 @@
 #
 # Contributors:
 #
-# Description: 
+# Description: Project file for file share services.
 #
 
 TEMPLATE = lib
 TARGET = shareui
 DEFINES += BUILD_SHAREUI_DLL
+#DEFINES += __SHAREUI_MIME_HANDLING__
 
 DEPENDPATH += inc src
 INCLUDEPATH += inc
 INCLUDEPATH += ../../../inc
 INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
 INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
-
-    
+   
 QT += core
 CONFIG += hb
 
-
 TARGET.EPOCALLOWDLLDATA = 1
 TARGET.CAPABILITY = CAP_GENERAL_DLL
 TARGET.UID3 = 0x2002DD00
--- a/messagingapp/shareui/src/shareui.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/shareui/src/shareui.cpp	Mon May 03 12:29:07 2010 +0300
@@ -32,10 +32,7 @@
 
 /**
  * Destructor.
- * 
- * 
  */
-
 ShareUi::~ShareUi()
     {
     // free allocated memory
--- a/messagingapp/shareui/src/shareuiprivate.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingapp/shareui/src/shareuiprivate.cpp	Mon May 03 12:29:07 2010 +0300
@@ -11,27 +11,57 @@
 *
 * Contributors:
 *
-* Description:  Offers message creation and sending services.
- *
+* Description:  Offers file share services.
+*
 */
 
-
-#include "shareuiprivate.h"
+// SYSTEM INCLUDES
 #include <QVariant>
 #include <QDir>
-#include <HbPushButton>
-#include <HbListWidget>
-#include <HbMainWindow>
+#include <QRegExp>
+#include <QFile>
+#include <QStringList>
+#include <QGraphicsLinearLayout>
+
+#include <HbAction>
+#include <HbDialog>
+#include <HbLabel>
+#include <HbListView>
+#include <HbListViewItem>
 #include <HbNotificationDialog>
+#include <HbIconItem>
+#include <HbTextItem>
+
 #include <xqserviceglobal.h>
+#include <xqaiwrequest.h>
+#include <xqaiwinterfacedescriptor.h>
 
-//Localized Constants
-#define LOC_SEND_SELECTED_ITEM hbTrId("txt_messaging_title_send_selected_item")
-#define LOC_BUTTON_CANCEL hbTrId("txt_common_button_cancel")
+// 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.")
+
+/**
+ * Constructor.
+ */
 ShareUiPrivate::ShareUiPrivate()
     {
-    
+    mContentItemModel = 0;
+    mContentListView = 0;
+    mSharePopup = 0;
     }
 
 /**
@@ -39,139 +69,195 @@
  */
 ShareUiPrivate::~ShareUiPrivate()
     {
-    if(mContentItemModel)
-        {
-        delete mContentItemModel;
-        }
-    if(mContentListView)
-        {
-        delete mContentListView;
-        }
-    if(mSharePopup)
-        {
-        delete mSharePopup;
-        }
-    mIndexActionMap.clear();
-    mAiwRequestList.clear();
-    mFileList.clear();
+    reset();
     }
 
 /**
- * initialize and start the dialog
+ * Clear the internal data structures
+ */
+void ShareUiPrivate::reset()
+    {
+    mFileList.clear();
+    
+    mIndexActionMap.clear(); // TODO Is there MEM leak.
+    mAiwRequestList.clear(); // TODO Is there MEM leak.
+    
+    if ( mContentItemModel )
+        {
+        delete mContentItemModel;
+        mContentItemModel = 0;
+        }
+    
+    if ( mContentListView )
+        {
+        delete mContentListView;
+        mContentListView = 0;
+        }
+    
+    if ( mSharePopup )
+        {
+        delete mSharePopup;
+        mSharePopup = 0;
+        }
+    }
+
+/**
+ * Initialize and start the dialog
  * 
- * @param fileList list of tokens that would allow file manipulation
+ * @param fileList list of tokens that would allow file manipulation.
  * @return bool error false if dialog initialization failed, true otherwise.
  * 
  */
 bool ShareUiPrivate::init(QStringList& fileList, bool embedded)
     {    
-    bool retval = false;
-    mFileList.clear();
+    reset();
+    
+    // No input files
+    if ( fileList.count() == 0 )
+        {
+        showNote(LOC_NO_FILES);
+        return true;       
+        }
+
+#ifdef __SHAREUI_MIME_HANDLING__   
+    // Get the file attributes (MIME and forward lock)
+    QStringList mimeTypeList;
+    QStringList forwardStatusList;
+    getFileAttributes(fileList, mimeTypeList, forwardStatusList);
+    
+    // Ignore protected files
+    QStringList filteredFileList;
+    QStringList filteredMimeList;
+    for ( int i = 0; i < forwardStatusList.count(); i++ )
+        {
+        if ( forwardStatusList[i].toInt() )
+            {
+            filteredFileList << fileList[i];
+            filteredMimeList << mimeTypeList[i];
+            }
+        }
+    filteredMimeList.removeDuplicates();    
+    
+    // Some protected content
+    if ( fileList.count() != filteredFileList.count() )
+        {
+        showNote(LOC_PROTECTED_CONTENT);      
+        }
     
-    if(fileList.count())
+    // Only protected content
+    if ( filteredFileList.count() == 0 )
         {
-        for(int i = 0; i < fileList.count(); i++)
-            {
-            mFileList.append(QDir::toNativeSeparators(fileList[i]));
+        showNote(LOC_NO_FILES);
+        return true;       
+        }
+#endif
+
+#ifdef __SHAREUI_MIME_HANDLING__ 
+    for ( int i = 0; i < filteredFileList.count(); i++ )
+        {     
+        mFileList.append(QDir::toNativeSeparators(filteredFileList[i]));
+        }
+#else
+    for ( int i = 0; i < fileList.count(); i++ )
+        {     
+        mFileList.append(QDir::toNativeSeparators(fileList[i]));
+        }
+#endif
+    
+    QList<XQAiwInterfaceDescriptor> serviceDescriptorList = 
+            mAppManager.list(SERVICE_INTERFACE, SHARE_OP);
+    if ( serviceDescriptorList.size() > 0 )
+        {          
+        initializeUi();
+
+        for ( int i = 0; i < serviceDescriptorList.count() ; i++ )
+            { 
+#ifdef __SHAREUI_MIME_HANDLING__          
+            // Filter services based on content type
+            QString allowedTypes = serviceDescriptorList[i].customProperty
+                    (QString("allowed_mime_types"));              
+            QString blockedTypes = serviceDescriptorList[i].customProperty
+                    (QString("blocked_mime_types"));
+            
+            // Check against MIME filters
+            if ( ! isContentAllowed( filteredMimeList, allowedTypes ) )
+                continue;
+            
+            if ( isContentBlocked( filteredMimeList, blockedTypes ) )
+                continue;                     
+#endif            
+            HbAction* action = fetchServiceAction(serviceDescriptorList[i]);
+            QString iconName = serviceDescriptorList[i].customProperty
+                    (QString("aiw_action_icon"));
+            if ( action )
+                {
+                updateShareUiDialogList(action, iconName);
+                }
             }
         
-        mIsEmbedded = embedded;
-    
-        initializeUi();
-    
-        QList<XQAiwInterfaceDescriptor> serviceDescriptorList;
-        mIndexActionMap.clear();
-        mAiwRequestList.clear();
-        if(fetchServiceDescriptors(serviceDescriptorList))
+        if ( mContentItemModel->rowCount() == 0 )
             {
-            
-            HbAction* action;
-            
-            for(int i = 0; i < serviceDescriptorList.count() ; i++)
-                {
+            showNote(LOC_NO_SERVICES);
+            return true;
+            }
 
-                if((action = fetchServiceAction(serviceDescriptorList[i])) != NULL)
-                    {
-                    updateShareUiDialogList(action);
-                    }
-                }
-            retval = true;
-            }
-        else
-            {
-            updateShareUiDialogList(NULL);
-            }
+        mSharePopup->exec();
+        }
+    else
+        {
+        showNote(LOC_NO_SERVICES);
+        }
     
-        enableUi();
-        }
-    return retval;
+    return true;
     }
 
 /**
-  * Creates the view for the sendui dialog.
-  *  
-  * @return bool true if initialization was successful, false otherwise.
+  * Creates the view for the share ui.
   */
-
 void ShareUiPrivate::initializeUi()
     {
+    // Dialog
     mSharePopup = new HbDialog();
-    mSharePopup->setHeadingWidget(new HbLabel(LOC_SEND_SELECTED_ITEM));
+    
+    HbTextItem* heading = new HbTextItem(LOC_SEND_SELECTED_ITEM, mSharePopup);
+    heading->setAlignment(Qt::AlignCenter);
+    mSharePopup->setHeadingWidget(heading);
     mSharePopup->setTimeout(HbDialog::NoTimeout);  
+    mSharePopup->setFrameType(HbDialog::Strong);
+    mSharePopup->setPrimaryAction(new HbAction(LOC_BUTTON_CANCEL, mSharePopup));
+        
+    // Content widget
     mContentListView = new HbListView(mSharePopup);
-
-    mContentItemModel = new QStandardItemModel(mSharePopup); 
-    mContentListView->setModel(mContentItemModel);
-    mSharePopup->setContentWidget(mContentListView);
-    mSharePopup->setFrameType(HbDialog::Strong);
-    mSharePopup->setPrimaryAction(new HbAction(LOC_BUTTON_CANCEL));
-    
-    connect(mContentListView, SIGNAL(activated(QModelIndex)),this,SLOT(itemActivated(QModelIndex)));
-    
-    }
+    ShareListItem *prototype = new ShareListItem(mSharePopup);
+    mContentListView->setItemPrototype(prototype);
 
-/**
- * fetchServiceDescriptors
- * 
- * Fetches the service descriptors using the Application Manager api. 
- * This function is in progress and will change.
- * 
- * @return error boolean true if successfully fetched.
- */
-
-bool ShareUiPrivate::fetchServiceDescriptors(QList<XQAiwInterfaceDescriptor>& serviceDescriptorList)
-    {
-    bool retval = false;
-    
-    serviceDescriptorList = mAppManager.list(SERVICE_INTERFACE, SHARE_OP);
-    
-    if(serviceDescriptorList.size() > 0)
-        {
-        retval = true;
-        }
-    return retval;
+    mContentItemModel = new QStandardItemModel(mSharePopup);
+    mContentListView->setModel(mContentItemModel); 
+    mContentListView->setUniformItemSizes(true);
+    mSharePopup->setContentWidget(mContentListView);
+    connect(mContentListView, SIGNAL(activated(QModelIndex)),
+            this, SLOT(itemActivated(QModelIndex)));  
     }
 
-
 /**
  * fetchServiceAction fetches the action associated with a specified interface descriptor.
  * This is used after the fetchServiceDescriptors is called, and 
- * 
- * @param serviceDescriptor ServiceDescriptor fetched using fetchServiceDescriptors
- * @return error boolean true if successfully fetched.
  */
-
-HbAction* ShareUiPrivate::fetchServiceAction(XQAiwInterfaceDescriptor interfaceDescriptor)
-    {
+HbAction* ShareUiPrivate::fetchServiceAction
+(XQAiwInterfaceDescriptor interfaceDescriptor)
+    {   
+    XQAiwRequest* request = mAppManager.create(interfaceDescriptor, 
+            SHARE_OP, mIsEmbedded);
+    mAiwRequestList.append(request);
     
-    XQAiwRequest* request = mAppManager.create(interfaceDescriptor,SHARE_OP,mIsEmbedded);
-    mAiwRequestList.append(request);
     HbAction* action = convertAction(request->createAction());
-    if(action)
+    if ( action )
         {
         connect(request, SIGNAL(triggered()), this, SLOT(onTriggered()));
-        connect(request, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleOk(const QVariant&)));
-        connect(request, SIGNAL(requestError(int,const QString&)), this, SLOT(handleError(int,const QString&)));
+        connect(request, SIGNAL(requestOk(const QVariant&)), this, 
+                SLOT(handleOk(const QVariant&)));
+        connect(request, SIGNAL(requestError(int,const QString&)), this, 
+                SLOT(handleError(int,const QString&)));
         }
     return action;
     }
@@ -180,140 +266,70 @@
 /**
  * Update the SendUi Dialog (and associated list items) once the required
  * information has been fetched.
- * 
- * @params action HbAction* The action that must be associated with the entry at that point in the list.
  */
-
-
-bool ShareUiPrivate::updateShareUiDialogList(HbAction* action)
+void ShareUiPrivate::updateShareUiDialogList(HbAction* action, QString iconName)
     {
-    
-    bool retval = false;
-    QStandardItem* item = NULL;
-    if(action != NULL)
-        {
-        item = new QStandardItem(action->icon().qicon(),action->text());
-        mContentItemModel->appendRow(item);
-        QModelIndex index = item->index();
-        mIndexActionMap[index] = action;
-        retval = true;
-        }
-    else
-        {
-        item = new QStandardItem(QString("No Services Found"));
-        mContentItemModel->appendRow(item);
-        }
-    return retval;
-    
-    }
-
-
-/**
- * 
- * Enable the UI and show it on the screen.
- * 
- * 
- */
-
-void ShareUiPrivate::enableUi()
-    {
-    mSharePopup->exec();
+    QStandardItem*  item = new QStandardItem();
+    item->setData(action->text(), ProviderNameRole);
+    item->setData(iconName, ProviderIconRole);
+    mContentItemModel->appendRow(item);
+    QModelIndex index = item->index();
+    mIndexActionMap[index] = action;
     }
 
 /**
- * Slot for handling send service selection on the UI
- * 
+ * Slot for handling send service selection on the UI.
  */
-
-
 void ShareUiPrivate::onTriggered(void)
     {
-    
     XQAiwRequest* request = 0;
     request = qobject_cast<XQAiwRequest*>(sender());
     if(request)
         {
-        request->setArguments(mFileList);
+        QList<QVariant> args;
+        QVariant fileList(mFileList);
+        args << fileList;
+        request->setArguments(args);
         }
     }
 
 /**
  * Slot for handling valid returns from the framework.
- * 
- * @param result const QVariant&
  */
-
 void ShareUiPrivate::handleOk(const QVariant& result)
     {
     Q_UNUSED(result)
     }
 
 /**
- * Slot for handling errors. Error ids are provided as 
- * 32-bit integers. These are 
- * 
- * @param errorCode qint32
- * 
- * 
+ * Slot for handling errors from the framework.
  */
 void ShareUiPrivate::handleError(int errorCode, const QString& errorMessage)
     {
+    Q_UNUSED(errorCode)
     Q_UNUSED(errorMessage)
-    QString errText("IPC Error: ");
-    HbNotificationDialog* dlg = new HbNotificationDialog();
-    dlg->setFocusPolicy(Qt::NoFocus);
-    dlg->setAttribute(Qt::WA_DeleteOnClose, true);
-
     
-    switch(errorCode)
-        {
-        case XQService::EConnectionError:
-            errText.append(QString("EConnectionError: "));
-            break;
-        case XQService::EConnectionClosed:
-            errText.append(QString("EConnectionClosed: "));
-            break;
-        case XQService::EServerNotFound:
-            errText.append(QString("EServerNotFound: "));
-            break;
-        case XQService::EIPCError:
-            errText.append(QString("EIPCError: "));
-            break;
-        case XQService::EUnknownError:
-            errText.append(QString("EUnknownError: "));
-            break;
-        case XQService::ERequestPending:
-            errText.append(QString("ERequestPending: "));
-            break;
-        }
-    errText.append(errorMessage);
-    dlg->setText(errText);
-    dlg->show();
+    showNote(LOC_SERVICE_ERROR);
     }
 
-
-
 /** 
  * When a list box item is pressed, this slot should be invoked. The action
  * corresponding to the clicked list item should be invoked with the stored lis
  * of files.
  * 
  * @param index QModelIndex
- * 
  */
 
 void ShareUiPrivate::itemActivated(QModelIndex index)
     {
-
     HbAction* action = mIndexActionMap[index];
     
-    if(action)
+    if ( action )
         {
         action->setEnabled(true);
         action->activate(HbAction::Trigger);
         }    
     mSharePopup->close();
-
     }
 
 
@@ -323,7 +339,6 @@
  * @param action QAction*
  * @return HbAction* 
  */
-
 HbAction* ShareUiPrivate::convertAction(QAction *action)
     {
     HbAction *actionHb = 0;
@@ -344,3 +359,176 @@
     
     return actionHb;
     }
+
+#ifdef __SHAREUI_MIME_HANDLING__  
+/**
+ * Checks if the specified content type is allowed as per the 
+ * specified MIME pattern strings
+ */
+bool ShareUiPrivate::isContentAllowed( QStringList mimeType, 
+        QString mimePattern )
+    {
+    if ( mimePattern.trimmed().length() ==  0 )
+        return true;
+    
+    QStringList patterns = mimePattern.split(",");
+    
+    for ( QStringList::Iterator it = mimeType.begin(); 
+            it != mimeType.end(); ++it ) 
+        {    
+        bool match = false;
+        for ( QStringList::Iterator it1 = patterns.begin(); 
+                it1 != patterns.end(); ++it1 ) 
+            {               
+            QString pattern = (*it1).trimmed();
+            QRegExp rx(pattern, Qt::CaseInsensitive, QRegExp::Wildcard); 
+            // Not case sensitive, wild cards allowed
+            if ( rx.exactMatch( *it ) )
+                {
+                match = true;
+                break;
+                }
+            }
+        
+        if ( ! match )
+            {
+            return false;           
+            }
+        }
+    
+    return true;
+    }
+
+/**
+ * Checks if the specified content type is allowed as per the 
+ * specified MIME pattern strings
+ */
+bool ShareUiPrivate::isContentBlocked( QStringList mimeType, 
+        QString mimePattern )
+    {
+    if ( mimePattern.trimmed().length() ==  0 )
+        return false;
+    
+    QStringList patterns = mimePattern.split(",");
+    
+    for ( QStringList::Iterator it = mimeType.begin(); 
+            it != mimeType.end(); ++it ) 
+        {   
+        bool match = false;
+        for ( QStringList::Iterator it1 = patterns.begin(); 
+                it1 != patterns.end(); ++it1 ) 
+            {                
+            QString pattern = (*it1).trimmed();
+            QRegExp rx(pattern, Qt::CaseInsensitive, QRegExp::Wildcard); 
+            // Not case sensitive, wild cards allowed
+            if ( rx.exactMatch( *it ) )
+                {
+                match = true;
+                break;
+                }
+            }
+        
+        if ( match )
+            {
+            return true;           
+            }
+        }
+    
+    return false;
+    }
+ 
+/**
+ * Get the file MIME types and forward status
+ */
+void ShareUiPrivate::getFileAttributes
+(QStringList& fileList, QStringList& mimeTypeList, QStringList& forwardStatusList)
+    {
+    // Attributes to read
+    QList<int> attrNames;
+    attrNames.append(XQApplicationManager::MimeType);
+    attrNames.append(XQApplicationManager::IsForwardable);
+    
+    for ( QStringList::Iterator it = fileList.begin(); 
+                  it != fileList.end(); ++it ) 
+        {      
+        QFile file(*it);
+        QVariantList attrValues;
+        bool ok = mAppManager.getDrmAttributes(file, attrNames, attrValues);
+        if ( !ok )
+            {
+            mimeTypeList << QString();
+            forwardStatusList << QString("1"); // Forward ok.
+            continue;
+            }
+        
+        int i = 0;
+        foreach (QVariant v, attrValues)
+            {
+            if ( attrNames[i] == XQApplicationManager::MimeType )
+                mimeTypeList << v.toString();
+            if ( attrNames[i] == XQApplicationManager::IsForwardable )
+                forwardStatusList << v.toString();
+            i++;
+            }
+        }
+    }
+#endif
+
+/**
+ * Show notes
+ */
+void ShareUiPrivate::showNote(QString text)
+    {
+    HbNotificationDialog* dlg = new HbNotificationDialog();
+    dlg->setFocusPolicy(Qt::NoFocus);
+    dlg->setAttribute(Qt::WA_DeleteOnClose, true);
+    dlg->setText(text);
+    dlg->show();
+    }
+
+/**
+ * List item prototype constructor.
+ */
+ShareListItem::ShareListItem(QGraphicsItem* parent) :
+        HbListViewItem(parent),
+        mProviderName(NULL),
+        mProviderIcon(NULL)
+    {
+    }
+    
+/**
+ * @see HbListViewItem
+ */
+HbAbstractViewItem* ShareListItem::createItem()
+    {
+    return new ShareListItem(*this);
+    }
+
+/**
+ * @see HbListViewItem
+ */
+void ShareListItem::updateChildItems()
+    {
+    QGraphicsLinearLayout *layout = 
+            new QGraphicsLinearLayout(Qt::Horizontal, this);
+
+    if (!mProviderIcon)
+        {
+        QVariant iconName = modelIndex().data(ProviderIconRole);     
+        mProviderIcon = new HbIconItem(HbIcon(iconName.toString()), this);
+        }
+    
+    if (!mProviderName)
+        {
+        QVariant name = modelIndex().data(ProviderNameRole);     
+        mProviderName = new HbTextItem(name.toString(), this);
+        }
+    
+    layout->addItem(mProviderIcon);
+    layout->addItem(mProviderName);
+    
+    HbListViewItem::updateChildItems();
+    }
+
+// End of file
+
--- a/messagingappbase/messagingappbase.pro	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingappbase/messagingappbase.pro	Mon May 03 12:29:07 2010 +0300
@@ -21,807 +21,21 @@
 # Platforms
 SYMBIAN_PLATFORMS = WINSCW ARMV5
 
+SUBDIRS += mtmregistry/mtmregistry.pro
+
 # Build.inf rules
 
 symbian {
-     BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
-#### RSC EXPORTS ####
-     "./rom/sms.rsc                /epoc32/data/z/resource/messaging/mtm/sms.rsc" \
-     "./rom/mms.rsc                /epoc32/data/z/resource/messaging/mtm/mms.rsc" \
-#### TEMP CHANGES ####
-     "./rom/Provisioning.iby       CORE_MW_LAYER_IBY_EXPORT_PATH(Provisioning.iby)" \
-     "./rom/RFSPlugins.iby         CORE_MW_LAYER_IBY_EXPORT_PATH(RFSPlugins.iby)" \
+     BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \  
 #### MSGMEDIA ####
      "./msgmedia/rom/MsgMedia.iby                     CORE_APP_LAYER_IBY_EXPORT_PATH(MsgMedia.iby)" \
      ":zip ./msgmedia/help/data/xhtml.zip             /epoc32/data/z/resource/ overwrite" \
      ":zip ./msgmedia/help/data/xhtml.zip             /epoc32/winscw/c/resource/ overwrite" \
      "./msgmedia/help/inc/msg.hlp.hrh                 MW_LAYER_PLATFORM_EXPORT_PATH(csxhelp/msg.hlp.hrh)" \
-     "./msgmedia/help/rom/msgmediahelps_variant.iby   CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(msgmediahelps_variant.iby)" \
-#### SMSMTM ####
-     "./smsmtm/servermtm/inc/smss.hrh                 APP_LAYER_PUBLIC_EXPORT_PATH(smss.hrh)" \
-#ifdef SYMBIAN_OLD_EXPORT_LOCATION
-     "./smsmtm/clientmtm/inc/SMCMMAIN.H               /epoc32/include/smcmmain.h" \
-#endif
-		 "./smsmtm/clientmtm/inc/SMSCLNT.H 										 /epoc32/include/smsclnt.h" \
-     "./smsmtm/clientmtm/inc/SMSCLNT.H                     APP_LAYER_PUBLIC_EXPORT_PATH(smsclnt.h)" \
-     "./smsmtm/clientmtm/inc/SMSCLNT.INL                   APP_LAYER_PLATFORM_EXPORT_PATH(smsclnt.inl)" \
-     "./smsmtm/clientmtm/inc/SMUTHDR.H                     APP_LAYER_PUBLIC_EXPORT_PATH(smuthdr.h)" \
-     "./smsmtm/clientmtm/inc/SMUTHDR.INL                   APP_LAYER_PLATFORM_EXPORT_PATH(smuthdr.inl)" \
-     "./smsmtm/clientmtm/inc/SMUTSET.H                     APP_LAYER_PUBLIC_EXPORT_PATH(smutset.h)" \
-     "./smsmtm/clientmtm/inc/SMUTSET.INL                   APP_LAYER_PLATFORM_EXPORT_PATH(smutset.inl)" \
-     "./smsmtm/clientmtm/inc/smutsimparam.h                APP_LAYER_PUBLIC_EXPORT_PATH(smutsimparam.h)" \
-     "./smsmtm/clientmtm/inc/smscmds.h                     APP_LAYER_PUBLIC_EXPORT_PATH(smscmds.h)" \ 
-     "./smsmtm/clientmtm/inc/smut.h                        APP_LAYER_PUBLIC_EXPORT_PATH(smut.h)" \ 
-     "./smsmtm/clientmtm/inc/csmsemailfields.h             APP_LAYER_PUBLIC_EXPORT_PATH(csmsemailfields.h)" \ 
-     "./smsmtm/clientmtm/inc/csmsaccount.h                 APP_LAYER_PUBLIC_EXPORT_PATH(csmsaccount.h)" \ 
-     "./smsmtm/clientmtm/inc/csmsgetdetdescinterface.h     APP_LAYER_PLATFORM_EXPORT_PATH(csmsgetdetdescinterface.h)" \ 
-     "./smsmtm/clientmtm/inc/csmsgetdetdescinterface.inl   APP_LAYER_PLATFORM_EXPORT_PATH(csmsgetdetdescinterface.inl)" \ 
-     "./smsmtm/clientmtm/inc/tmsvsmsentry.h                APP_LAYER_PLATFORM_EXPORT_PATH(tmsvsmsentry.h)" \ 
-#ifdef SYMBIAN_OLD_EXPORT_LOCATION
-     "./smsmtm/clientmtm/inc/tmsvsmsentry.inl              /epoc32/include/tmsvsmsentry.inl" \
-#endif
-# Note: this cenrep file is exported for testing and techview only. Not used in a device - generated by confml below
-     "./smsmtm/clientmtm/group/1000102C.txt z:/private/10202be9/1000102c.txt" \
-# ConfML files
-     "./smsmtm/conf/smsmtm.confml           APP_LAYER_EXPORTS_CONFML(smsmtm.confml)" \
-     "./smsmtm/conf/smsmtm_1000102c.crml    APP_LAYER_EXPORTS_CRML(smsmtm_1000102c.crml)" \
-     "./smsmtm/group/GtSmsMtm.hby           /epoc32/rom/include/gtsmsmtm.hby" \
-     "./smsmtm/group/GtSmsMtm.iby           /epoc32/rom/include/gtsmsmtm.iby" \
-#### OBEXMTMS ####
-#ifdef SYMBIAN_OLD_EXPORT_LOCATION
-     "./obexmtms/obexmtm/obexutil/include/obexHeader.h         /epoc32/include/obexheader.h" \
-#endif
-     "./obexmtms/obexmtm/obexutil/include/obexHeaderList.h     APP_LAYER_PUBLIC_EXPORT_PATH(obexheaderlist.h)" \
-#ifdef SYMBIAN_OLD_EXPORT_LOCATION
-     "./obexmtms/obexmtm/obexutil/include/obexinternalutils.h" \
-#endif
-#ifdef SYMBIAN_OLD_EXPORT_LOCATION
-     "./obexmtms/obexmtm/obexutil/include/ObexUtils.h         /epoc32/include/obexutils.h" \
-#endif
-#ifdef SYMBIAN_OLD_EXPORT_LOCATION
-     "./obexmtms/obexmtm/obexutil/include/ListenerContainer.h /epoc32/include/listenercontainer.h" \
-#endif
-     "./obexmtms/obexmtm/obexutil/include/btmsgtypeuid.h      APP_LAYER_PUBLIC_EXPORT_PATH(btmsgtypeuid.h)" \
-#ifdef SYMBIAN_OLD_EXPORT_LOCATION
-     "./obexmtms/obexmtm/obexutil/include/cobexsendoperation.h" \
-#endif
-     "./obexmtms/obexmtm/obexclient/include/obexClientMtm.h   APP_LAYER_PLATFORM_EXPORT_PATH(obexclientmtm.h)" \
-#ifdef SYMBIAN_OLD_EXPORT_LOCATION
-     "./obexmtms/obexmtm/obexserver/include/obexSendOp.h      /epoc32/include/obexsendop.h" \
-#endif
-#ifdef SYMBIAN_OLD_EXPORT_LOCATION
-     "./obexmtms/obexmtm/obexserver/include/obexServerMtm.h   /epoc32/include/obexservermtm.h" \
-#endif
-     "./obexmtms/btmtm/btclient/Include/btcmtm.h              APP_LAYER_PLATFORM_EXPORT_PATH(btcmtm.h)" \
-# ..\include\btmsgtypeuid.h <- exported by the generic mtm build process.
-#ifdef SYMBIAN_OLD_EXPORT_LOCATION
-     "./obexmtms/btmtm/btclient/Include/btHeader.h            /epoc32/include/btheader.h" \
-#endif
-#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
-#ifdef SYMBIAN_OLD_EXPORT_LOCATION
-     "./obexmtms/btmtm/btclient/Include/btmtmcmds.h           /epoc32/include/btmtmcmds.h" \
-#endif
-#endif
-     "./obexmtms/irmtm/irclient/include/IRCMTM.H              APP_LAYER_PLATFORM_EXPORT_PATH(ircmtm.h)" \
-#ifdef SYMBIAN_OLD_EXPORT_LOCATION
-     "./obexmtms/irmtm/irclient/include/irHeader.h            /epoc32/include/irheader.h" \
-#endif
-     "./obexmtms/irmtm/irclient/include/irmsgtypeuid.h        APP_LAYER_PUBLIC_EXPORT_PATH(irmsgtypeuid.h)" \
-     "./obexmtms/irmtm/irclient/include/irmtmcmds.h           APP_LAYER_PUBLIC_EXPORT_PATH(irmtmcmds.h)" \
-#ifdef SYMBIAN_OLD_EXPORT_LOCATION
-     "./obexmtms/irmtm/irserver/include/IRS.H                 /epoc32/include/irs.h" \
-#endif
-     "./obexmtms/Rom/obex.iby      /epoc32/rom/include/obex.iby" \
-########### SMIL Parser changes
-     "./smilparser/Rom/Gmxml.iby   /epoc32/rom/include/Gmxml.iby" #\
-### XMLParser and XMLDom changes ( Commented code to be removed if in wk48 xmlparser and xmldom are available in xmlsrv)
-    #"./smilparser/internal/XMLDom/INC/GMXMLCDataSection.h SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(gmxmlcdatasection.h)" \
-    #"./smilparser/internal/XMLDom/INC/GMXMLCharacterData.h SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(gmxmlcharacterdata.h)" \
-    #"./smilparser/internal/XMLDom/INC/GMXMLComment.h SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(gmxmlcomment.h)" \
-    #"./smilparser/internal/XMLDom/INC/GMXMLDocument.h SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(gmxmldocument.h)" \
-    #"./smilparser/internal/XMLDom/INC/GMxmldomconstants.h SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(gmxmldomconstants.h)" \
-    #"./smilparser/internal/XMLDom/INC/GMXMLDocumentElement.h SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(gmxmldocumentelement.h)" \
-    #"./smilparser/internal/XMLDom/INC/GMXMLElement.h SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(gmxmlelement.h)" \
-    #"./smilparser/internal/XMLDom/INC/GMXMLNode.h SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(gmxmlnode.h)" \
-    #"./smilparser/internal/XMLDom/INC/GMXMLProcessingInstruction.h SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(gmxmlprocessinginstruction.h)" \
-    #"./smilparser/internal/XMLDom/INC/GMXMLText.h SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(gmxmltext.h)" \
-	#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS 
-#ifdef SYMBIAN_OLD_EXPORT_LOCATION
-	  #"./smilparser/internal/XMLDom/INC/gmxmldummydtd.h /epoc32/include/gmxmldummydtd.h" \
-#endif
-	#endif
-    #"./smilparser/internal/XMLParser/INC/GMXMLComposer.h SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(gmxmlcomposer.h)" \
-    #"./smilparser/internal/XMLParser/INC/GMXMLParser.h SYMBIAN_APP_LAYER_PUBLIC_EXPORT_PATH(gmxmlparser.h)" \
-    #"./smilparser/internal/XMLParser/INC/GMXMLConstants.h SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(gmxmlconstants.h)" \
-    #"./smilparser/internal/XMLParser/INC/GMXMLEntityConverter.h SYMBIAN_APP_LAYER_PLATFORM_EXPORT_PATH(gmxmlentityconverter.h)"
+     "./msgmedia/help/rom/msgmediahelps_variant.iby   CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(msgmediahelps_variant.iby)" 
 }
 
-symbian {     
-     BLD_INF_RULES.prj_testexports += "./smilparser/smildtd/ROM/SMIL_test_files.iby					/epoc32/rom/include/smil_test_files.iby" \
-########### BEGIN Section: SMIL_Test_Files
-### . Please keep this file organised by only inserting appropriate files between here and
-##     "END Section: SMIL_Test_Files"
-## . All SMIL_Test_Files are exported to 2 locations: wins & winscw
-## WINS: SMIL Input Valid
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/anchor_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/anchor_att_1.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/anchor_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/anchor_att_2.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/anchor_att_3.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/anchor_att_3.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/anchor_att_4.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/anchor_att_4.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/anchor_att_5.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/anchor_att_5.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/animation_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/animation_att_1.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/animation_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/animation_att_2.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/animation_att_3.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/animation_att_3.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/animation_att_4.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/animation_att_4.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/animation_att_5.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/animation_att_5.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/area_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/area_att_1.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/area_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/area_att_2.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/area_att_3.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/area_att_3.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/area_att_4.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/area_att_4.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/area_att_5.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/area_att_5.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/ascii_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/ascii_1.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/att_order_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/att_order_1.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/att_order_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/att_order_2.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/att_var_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/att_var_1.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/audio_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/audio_att_1.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/audio_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/audio_att_2.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/audio_att_3.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/audio_att_3.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/audio_att_4.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/audio_att_4.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/audio_att_5.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/audio_att_5.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/a_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/a_att_1.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/a_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/a_att_2.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/a_att_3.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/a_att_3.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/a_att_4.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/a_att_4.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/a_att_5.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/a_att_5.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/a_struc_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/a_struc_1.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/a_struc_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/a_struc_2.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/a_struc_3.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/a_struc_3.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/a_struc_4.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/a_struc_4.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/body_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/body_att_1.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/body_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/body_att_2.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/body_struc_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/body_struc_1.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/body_struc_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/body_struc_2.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_1.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_10.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_10.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_11.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_11.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_12.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_12.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_13.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_13.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_14.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_14.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_15.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_15.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_16.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_16.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_17.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_17.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_18.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_18.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_19.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_19.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_20.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_20.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_21.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_21.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_22.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_22.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_23.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_23.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_24.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_24.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_25.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_25.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_26.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_26.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_27.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_27.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_28.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_28.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_29.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_29.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_3.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_30.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_30.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_4.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_5.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_6.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_6.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_7.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_7.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_8.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/cdata_8.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/comments_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/comments_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/doctype_variation.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/doctype_variation.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/Entitiy_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entitiy_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entity_ref_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_10.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entity_ref_10.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_11.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entity_ref_11.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_12.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entity_ref_12.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_13.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entity_ref_13.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_14.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entity_ref_14.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_15.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entity_ref_15.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_17.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entity_ref_17.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_18.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entity_ref_18.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_19.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entity_ref_19.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entity_ref_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_20.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entity_ref_20.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_21.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entity_ref_21.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_22.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entity_ref_22.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_24.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entity_ref_24.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_26.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entity_ref_26.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_27.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entity_ref_27.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_3.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entity_ref_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_30.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entity_ref_30.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_31.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entity_ref_31.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_4.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entity_ref_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_5.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entity_ref_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_6.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entity_ref_6.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_7.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entity_ref_7.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_8.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/entity_ref_8.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/head_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/head_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/head_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/head_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/img_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/img_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/img_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/img_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/img_att_3.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/img_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/img_att_4.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/img_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/img_att_5.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/img_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/INC021337.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/inc021337.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/INC022160.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/inc022160.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/INC025788.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/inc025788.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/layout_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/layout_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/layout_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/layout_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/newline_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/newline_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/par_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/par_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/par_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/par_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/par_att_3.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/par_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/par_att_4.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/par_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/par_att_5.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/par_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/ref_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/ref_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/ref_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/ref_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/ref_att_3.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/ref_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/ref_att_4.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/ref_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/ref_att_5.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/ref_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/region_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/region_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/region_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/region_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/region_att_3.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/region_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/region_att_4.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/region_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/region_att_5.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/region_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/region_att_6.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/region_att_6.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/root-layout_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/root-layout_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/root-layout_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/root-layout_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/root-layout_att_3.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/root-layout_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/seq_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/seq_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/seq_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/seq_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/seq_att_3.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/seq_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/seq_att_4.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/seq_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/seq_att_5.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/seq_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/seq_struc_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/seq_struc_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/seq_struc_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/seq_struc_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/seq_struc_3.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/seq_struc_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/seq_struc_4.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/seq_struc_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/seq_struc_5.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/seq_struc_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/seq_struc_6.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/seq_struc_6.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/smil_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/smil_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/smil_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/smil_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/switch_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/switch_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/switch_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/switch_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/switch_struc_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/switch_struc_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/switch_struc_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/switch_struc_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/switch_struc_3.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/switch_struc_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/textstream_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/textstream_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/textstream_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/textstream_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/textstream_att_3.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/textstream_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/textstream_att_4.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/textstream_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/textstream_att_5.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/textstream_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/text_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/text_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/text_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/text_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/text_att_3.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/text_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/text_att_4.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/text_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/text_att_5.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/text_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/utf8.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/utf8.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/video_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/video_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/video_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/video_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/video_att_3.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/video_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/video_att_4.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/video_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/video_att_5.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/video_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/whitespace_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/whitespace_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/whitespace_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/whitespace_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/xml_version_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/valid/xml_version_1.txt" \
-## WINS: SMIL Input Invalid
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/a_att_10.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/a_att_10.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/a_att_11.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/a_att_11.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/a_att_6.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/a_att_6.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/a_att_7.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/a_att_7.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/a_att_8.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/a_att_8.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/a_att_9.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/a_att_9.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/cdata_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/cdata_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/empty.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/empty.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/Entitiy_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/entitiy_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/entity_ref_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/entity_ref_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/entity_ref_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/entity_ref_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/entity_ref_3.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/entity_ref_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/entity_ref_4.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/entity_ref_4.txt" \
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_10.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_10.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_11.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_11.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_12.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_12.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_13.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_13.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_14.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_14.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_15.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_15.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_16.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_16.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_17.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_17.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_18.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_18.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_19.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_19.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_20.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_20.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_21.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_21.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_22.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_22.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_23.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_23.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_24.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_24.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_25.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_25.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_3.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_4.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_5.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_6.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_6.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_7.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_7.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_8.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_8.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_9.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_9.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/INC021591.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/inc021591.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/INC021675.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/inc021675.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_1.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_10.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_10.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_11.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_11.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_12.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_12.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_13.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_13.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_14.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_14.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_15.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_15.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_16.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_16.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_17.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_17.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_18.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_18.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_19.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_19.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_2.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_20.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_20.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_21.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_21.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_22.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_22.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_23.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_23.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_24.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_24.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_25.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_25.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_26.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_26.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_27.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_27.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_28.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_28.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_29.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_29.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_3.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_31.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_31.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_32.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_32.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_33.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_33.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_34.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_34.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_35.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_35.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_36.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_36.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_37.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_37.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_38.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_38.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_39.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_39.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_4.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_40.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_40.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_5.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_6.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_6.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_7.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_7.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_8.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_8.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_9.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/invalid_9.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/region_att_10.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/region_att_10.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/region_att_11.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/region_att_11.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/region_att_7.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/region_att_7.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/region_att_8.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/region_att_8.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/region_att_9.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/region_att_9.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/root-layout_att_4.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/root-layout_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/root-layout_att_5.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/root-layout_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/root-layout_att_6.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/root-layout_att_6.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/switch_struc_4.txt            /epoc32/wins/c/msgtest/smil_test_files/smil_input/invalid/switch_struc_4.txt" \          
-## WINS: MMS Input Valid
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/audio_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/audio_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/audio_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/audio_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/audio_att_3.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/audio_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/body_struc_1.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/body_struc_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/body_struc_2.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/body_struc_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/body_struc_3.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/body_struc_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/head_struct_4.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/head_struct_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/head_struct_5.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/head_struct_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/head_struc_1.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/head_struc_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/head_struc_3.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/head_struc_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/img_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/img_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/img_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/img_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/img_att_3.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/img_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/img_struc_1.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/img_struc_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/layout_struc_1.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/layout_struc_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/layout_struc_3.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/layout_struc_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/layout_struc_4.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/layout_struc_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/layout_struc_5.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/layout_struc_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/metadata_att1.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/metadata_att1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/meta_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/meta_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/meta_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/meta_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/par_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/par_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/par_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/par_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/par_prefetch.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/par_prefetch.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/par_struc_1.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/par_struc_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/par_struc_2.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/par_struc_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/par_struc_4.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/par_struc_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/prefetch_att1.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/prefetch_att1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/prefetch_att2.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/prefetch_att2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/prefetch_att3.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/prefetch_att3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/prefetch_att4.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/prefetch_att4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/ref_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/ref_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/ref_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/ref_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/ref_att_3.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/ref_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/ref_att_4.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/ref_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/ref_att_5.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/ref_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/ref_att_6.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/ref_att_6.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/region_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/region_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/region_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/region_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/region_att_3.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/region_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/region_att_4.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/region_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/region_att_5.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/region_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/region_att_6.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/region_att_6.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/region_struc_1.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/region_struc_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/root-layout_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/root-layout_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/root-layout_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/root-layout_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/smil_struc_1.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/smil_struc_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/smil_struc_3.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/smil_struc_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/smil_struc_4.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/smil_struc_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/smil_struc_5.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/smil_struc_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/text_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/text_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/text_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/text_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/transition_att_1.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/transition_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/transition_att_2.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/transition_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/transition_att_3.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/valid/transition_att_3.txt" \          
-## WINSCW: MMS Input Invalid
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/body_struc_4.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/invalid/body_struc_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/head_struc_2.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/invalid/head_struc_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/invalid_metadata_att1.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/invalid/invalid_metadata_att1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/invalid_meta_att1.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/invalid/invalid_meta_att1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/invalid_transition_att2.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/invalid/invalid_transition_att2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/invalid_transition_att3.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/invalid/invalid_transition_att3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/invalid_transition_att4.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/invalid/invalid_transition_att4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/invalid_transition_att5.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/invalid/invalid_transition_att5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/invalid__prefetch_att1.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/invalid/invalid__prefetch_att1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/invalid__prefetch_att2.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/invalid/invalid__prefetch_att2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/invalid__prefetch_att3.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/invalid/invalid__prefetch_att3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/layout_struc_2.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/invalid/layout_struc_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/layout_struc_6.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/invalid/layout_struc_6.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/layout_struc_7.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/invalid/layout_struc_7.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/par_struc_3.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/invalid/par_struc_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/region_att_7.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/invalid/region_att_7.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/smil_struc_2.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/invalid/smil_struc_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/text_struc_1.txt            /epoc32/wins/c/msgtest/smil_test_files/mms_input/invalid/text_struc_1.txt" \          
-##WINSCW: SMIL Input Valid
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/anchor_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/anchor_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/anchor_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/anchor_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/anchor_att_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/anchor_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/anchor_att_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/anchor_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/anchor_att_5.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/anchor_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/animation_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/animation_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/animation_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/animation_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/animation_att_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/animation_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/animation_att_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/animation_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/animation_att_5.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/animation_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/area_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/area_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/area_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/area_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/area_att_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/area_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/area_att_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/area_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/area_att_5.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/area_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/ascii_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/ascii_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/att_order_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/att_order_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/att_order_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/att_order_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/att_var_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/att_var_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/audio_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/audio_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/audio_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/audio_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/audio_att_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/audio_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/audio_att_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/audio_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/audio_att_5.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/audio_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/a_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/a_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/a_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/a_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/a_att_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/a_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/a_att_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/a_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/a_att_5.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/a_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/a_struc_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/a_struc_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/a_struc_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/a_struc_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/a_struc_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/a_struc_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/a_struc_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/a_struc_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/body_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/body_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/body_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/body_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/body_struc_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/body_struc_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/body_struc_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/body_struc_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_10.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_10.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_11.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_11.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_12.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_12.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_13.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_13.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_14.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_14.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_15.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_15.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_16.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_16.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_17.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_17.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_18.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_18.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_19.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_19.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_20.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_20.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_21.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_21.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_22.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_22.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_23.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_23.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_24.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_24.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_25.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_25.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_26.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_26.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_27.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_27.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_28.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_28.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_29.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_29.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_30.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_30.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_5.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_6.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_6.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_7.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_7.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/cdata_8.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/cdata_8.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/comments_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/comments_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/doctype_variation.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/doctype_variation.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/Entitiy_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entitiy_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entity_ref_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_10.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entity_ref_10.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_11.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entity_ref_11.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_12.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entity_ref_12.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_13.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entity_ref_13.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_14.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entity_ref_14.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_15.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entity_ref_15.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_17.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entity_ref_17.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_18.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entity_ref_18.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_19.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entity_ref_19.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entity_ref_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_20.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entity_ref_20.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_21.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entity_ref_21.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_22.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entity_ref_22.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_24.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entity_ref_24.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_26.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entity_ref_26.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_27.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entity_ref_27.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entity_ref_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_30.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entity_ref_30.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_31.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entity_ref_31.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entity_ref_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_5.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entity_ref_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_6.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entity_ref_6.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_7.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entity_ref_7.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/entity_ref_8.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/entity_ref_8.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/head_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/head_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/head_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/head_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/img_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/img_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/img_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/img_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/img_att_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/img_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/img_att_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/img_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/img_att_5.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/img_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/INC021337.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/inc021337.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/INC022160.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/inc022160.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/INC025788.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/inc025788.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/layout_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/layout_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/layout_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/layout_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/newline_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/newline_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/par_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/par_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/par_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/par_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/par_att_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/par_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/par_att_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/par_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/par_att_5.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/par_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/ref_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/ref_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/ref_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/ref_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/ref_att_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/ref_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/ref_att_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/ref_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/ref_att_5.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/ref_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/region_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/region_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/region_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/region_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/region_att_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/region_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/region_att_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/region_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/region_att_5.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/region_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/region_att_6.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/region_att_6.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/root-layout_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/root-layout_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/root-layout_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/root-layout_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/root-layout_att_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/root-layout_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/seq_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/seq_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/seq_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/seq_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/seq_att_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/seq_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/seq_att_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/seq_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/seq_att_5.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/seq_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/seq_struc_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/seq_struc_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/seq_struc_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/seq_struc_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/seq_struc_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/seq_struc_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/seq_struc_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/seq_struc_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/seq_struc_5.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/seq_struc_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/seq_struc_6.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/seq_struc_6.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/smil_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/smil_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/smil_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/smil_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/switch_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/switch_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/switch_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/switch_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/switch_struc_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/switch_struc_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/switch_struc_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/switch_struc_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/switch_struc_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/switch_struc_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/textstream_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/textstream_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/textstream_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/textstream_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/textstream_att_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/textstream_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/textstream_att_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/textstream_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/textstream_att_5.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/textstream_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/text_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/text_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/text_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/text_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/text_att_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/text_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/text_att_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/text_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/text_att_5.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/text_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/utf8.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/utf8.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/video_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/video_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/video_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/video_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/video_att_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/video_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/video_att_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/video_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/video_att_5.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/video_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/whitespace_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/whitespace_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/whitespace_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/whitespace_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Valid/xml_version_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/valid/xml_version_1.txt" \          
-##WINSCW: SMIL Input Invalid
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/a_att_10.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/a_att_10.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/a_att_11.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/a_att_11.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/a_att_6.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/a_att_6.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/a_att_7.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/a_att_7.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/a_att_8.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/a_att_8.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/a_att_9.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/a_att_9.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/cdata_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/cdata_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/empty.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/empty.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/Entitiy_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/entitiy_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/entity_ref_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/entity_ref_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/entity_ref_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/entity_ref_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/entity_ref_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/entity_ref_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/entity_ref_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/entity_ref_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_10.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_10.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_11.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_11.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_12.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_12.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_13.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_13.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_14.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_14.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_15.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_15.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_16.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_16.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_17.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_17.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_18.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_18.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_19.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_19.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_20.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_20.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_21.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_21.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_22.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_22.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_23.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_23.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_24.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_24.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_25.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_25.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_5.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_6.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_6.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_7.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_7.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_8.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_8.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/further_invalid_9.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/further_invalid_9.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/INC021591.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/inc021591.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/INC021675.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/inc021675.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_10.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_10.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_11.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_11.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_12.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_12.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_13.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_13.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_14.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_14.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_15.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_15.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_16.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_16.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_17.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_17.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_18.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_18.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_19.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_19.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_20.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_20.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_21.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_21.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_22.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_22.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_23.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_23.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_24.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_24.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_25.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_25.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_26.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_26.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_27.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_27.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_28.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_28.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_29.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_29.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_31.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_31.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_32.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_32.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_33.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_33.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_34.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_34.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_35.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_35.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_36.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_36.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_37.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_37.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_38.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_38.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_39.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_39.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_40.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_40.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_5.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_6.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_6.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_7.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_7.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_8.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_8.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/invalid_9.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/invalid_9.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/region_att_10.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/region_att_10.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/region_att_11.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/region_att_11.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/region_att_7.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/region_att_7.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/region_att_8.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/region_att_8.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/region_att_9.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/region_att_9.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/root-layout_att_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/root-layout_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/root-layout_att_5.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/root-layout_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/root-layout_att_6.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/root-layout_att_6.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/SMIL_Input/Invalid/switch_struc_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/smil_input/invalid/switch_struc_4.txt" \          
-##WINSCW: MMS Input Valid
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/audio_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/audio_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/audio_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/audio_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/audio_att_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/audio_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/body_struc_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/body_struc_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/body_struc_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/body_struc_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/body_struc_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/body_struc_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/head_struct_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/head_struct_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/head_struct_5.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/head_struct_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/head_struc_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/head_struc_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/head_struc_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/head_struc_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/img_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/img_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/img_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/img_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/img_att_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/img_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/img_struc_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/img_struc_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/layout_struc_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/layout_struc_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/layout_struc_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/layout_struc_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/layout_struc_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/layout_struc_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/layout_struc_5.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/layout_struc_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/metadata_att1.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/metadata_att1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/meta_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/meta_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/meta_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/meta_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/par_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/par_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/par_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/par_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/par_prefetch.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/par_prefetch.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/par_struc_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/par_struc_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/par_struc_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/par_struc_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/par_struc_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/par_struc_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/prefetch_att1.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/prefetch_att1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/prefetch_att2.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/prefetch_att2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/prefetch_att3.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/prefetch_att3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/prefetch_att4.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/prefetch_att4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/ref_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/ref_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/ref_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/ref_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/ref_att_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/ref_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/ref_att_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/ref_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/ref_att_5.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/ref_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/ref_att_6.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/ref_att_6.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/region_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/region_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/region_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/region_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/region_att_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/region_att_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/region_att_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/region_att_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/region_att_5.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/region_att_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/region_att_6.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/region_att_6.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/region_struc_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/region_struc_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/root-layout_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/root-layout_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/root-layout_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/root-layout_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/smil_struc_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/smil_struc_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/smil_struc_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/smil_struc_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/smil_struc_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/smil_struc_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/smil_struc_5.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/smil_struc_5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/text_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/text_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/text_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/text_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/transition_att_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/transition_att_1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/transition_att_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/transition_att_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Valid/transition_att_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/valid/transition_att_3.txt" \          
-##WINSCW: MMS Input Invalid
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/body_struc_4.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/invalid/body_struc_4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/head_struc_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/invalid/head_struc_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/invalid_metadata_att1.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/invalid/invalid_metadata_att1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/invalid_meta_att1.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/invalid/invalid_meta_att1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/invalid_transition_att2.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/invalid/invalid_transition_att2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/invalid_transition_att3.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/invalid/invalid_transition_att3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/invalid_transition_att4.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/invalid/invalid_transition_att4.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/invalid_transition_att5.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/invalid/invalid_transition_att5.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/invalid__prefetch_att1.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/invalid/invalid__prefetch_att1.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/invalid__prefetch_att2.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/invalid/invalid__prefetch_att2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/invalid__prefetch_att3.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/invalid/invalid__prefetch_att3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/layout_struc_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/invalid/layout_struc_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/layout_struc_6.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/invalid/layout_struc_6.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/layout_struc_7.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/invalid/layout_struc_7.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/par_struc_3.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/invalid/par_struc_3.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/region_att_7.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/invalid/region_att_7.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/smil_struc_2.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/invalid/smil_struc_2.txt" \          
-"./smilparser/SMILdtd/SMIL_Test_Files/MMS_Input/Invalid/text_struc_1.txt            /epoc32/winscw/c/msgtest/smil_test_files/mms_input/invalid/text_struc_1.txt" #\
-################ END Section: SMIL_Test_Files
-#Exports for XMLParser test - ( Commented code to be removed if in wk48 xmlparser and xmldom are available in xmlsrv)
-#"./smilparser/internal/xmlparser/test/GmxmlTest.txt /epoc32/wins/c/gmxmltest.txt" \
-#for winscw
-#"./smilparser/internal/xmlparser/test/GmxmlTest.txt /epoc32/winscw/c/gmxmltest.txt"
+                 
+symbian {
+BLD_INF_RULES.prj_mmpfiles = "./msgmedia/group/MsgMedia.mmp"
 }
-                       
-symbian {
-BLD_INF_RULES.prj_mmpfiles = "./msgmedia/group/MsgMedia.mmp" \
-                             "./smsmtm/servermtm/group/smss.mmp" \
-                             "./smsmtm/clientmtm/group/smcm.mmp" \
-                             "./smsmtm/smsgetdetdescdefault/group/smsgetdetdescdefault.mmp" \
-                             "./obexmtms/obexmtm/obexutil/group/obexMtmUtil.mmp" \
-                             "./obexmtms/obexmtm/obexclient/group/obexClientMtm.mmp" \
-                             "./obexmtms/obexmtm/obexserver/group/obexServerMtm.mmp" \
-                             "./obexmtms/btmtm/btclient/group/btcmtm.mmp" \
-                             "./obexmtms/btmtm/btserver/group/btsmtm.mmp" \
-                             "./obexmtms/irmtm/irclient/group/ircmtm.MMP" \
-                             "./obexmtms/irmtm/irserver/group/IRSMTM.MMP" \
-                             #"./smilparser/internal/xmldom/group/xmldom.mmp" \
-                             #"./smilparser/internal/xmlparser/group/xmlparser.mmp" \
-                             "./smilparser/smildtd/group/smildtd.mmp"
-
-BLD_INF_RULES.prj_testmmpfiles += "./smilparser/smildtd/group/smiltranslatortest.mmp" #\
-                                  #"./smilparser/internal/xmlparser/test/t_GmxmlFailure.mmp" \
-                                  #"./smilparser/internal/xmlparser/test/t_GmxmlParser.mmp" 
-}
\ No newline at end of file
--- a/messagingappbase/msgmedia/src/MmsConformance.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingappbase/msgmedia/src/MmsConformance.cpp	Mon May 03 12:29:07 2010 +0300
@@ -195,7 +195,7 @@
 EXPORT_C TBool CMmsConformance::IsConformantMime( const TPtrC8& aMimeType )
     {
     LocalFuncPtr funcPtr = ResolveFunction( aMimeType );
-    return ( funcPtr != ResolveNonconformantAttachment );
+    return ( funcPtr != &CMmsConformance::ResolveNonconformantAttachment );
     }
 
 // -----------------------------------------------------------------------------
@@ -285,55 +285,55 @@
     //Resolve conf. status according to recognized MIME type
     if ( aMimeType.CompareF( KMsgMimeTextPlain ) == 0 )
         {
-        funcPtr = CMmsConformance::ResolveTextPlain;
+        funcPtr = &CMmsConformance::ResolveTextPlain;
         }
     else if ( iMmsVersion > KMmsVersion12 &&
               aMimeType.CompareF( KMsgMimeTextXhtml ) == 0 )
         {
-        funcPtr = ResolveTextXhtml;
+        funcPtr = &CMmsConformance::ResolveTextXhtml;
         }
     else if ( aMimeType.CompareF( KMsgMimeAudioAmr ) == 0 )
         {
-        funcPtr = ResolveAudioAmr;
+        funcPtr = &CMmsConformance::ResolveAudioAmr;
         }
     else if ( aMimeType.CompareF( KMsgMimeAudioSpMidi ) == 0 )
         {
-        funcPtr = ResolveAudioSpMidi;
+        funcPtr = &CMmsConformance::ResolveAudioSpMidi;
         }
     else if ( aMimeType.CompareF( KMsgMimeImageJpeg ) == 0 )
         {
-        funcPtr = ResolveImageJpeg;
+        funcPtr = &CMmsConformance::ResolveImageJpeg;
         }
     else if ( aMimeType.CompareF( KMsgMimeImageGif ) == 0 )
         {
-        funcPtr = ResolveImageGif;
+        funcPtr = &CMmsConformance::ResolveImageGif;
         }
     else if ( aMimeType.CompareF( KMsgMimeImageWbmp ) == 0 )
         {
-        funcPtr = ResolveImageWbmp;
+        funcPtr = &CMmsConformance::ResolveImageWbmp;
         }
     else if ( aMimeType.CompareF( KMsgMimeImagePng ) == 0 )
         {
-        funcPtr = ResolveImagePng;
+        funcPtr = &CMmsConformance::ResolveImagePng;
         }
     else if (!( iResolverFlags & EMms3gpp2Mode ) &&
     		  ( aMimeType.CompareF( KMsgMimeVideo3gpp ) == 0  ) )
         {
-        funcPtr = ResolveVideo3gpp;
+        funcPtr = &CMmsConformance::ResolveVideo3gpp;
         }
     else if ( ( iResolverFlags & EMms3gpp2Mode ) &&
     		  ( aMimeType.CompareF( KMsgMimeVideo3gpp2 ) == 0  ) )
         {
-        funcPtr = ResolveVideo3gpp2;
+        funcPtr = &CMmsConformance::ResolveVideo3gpp2;
         }
     else if ( aMimeType.CompareF( KMsgMimeVCard ) == 0 ||
               aMimeType.CompareF( KMsgMimeVCal ) == 0 )
         {
-        funcPtr = ResolveAttachment;
+        funcPtr = &CMmsConformance::ResolveAttachment;
         }
     else
         {
-        funcPtr = ResolveNonconformantAttachment;
+        funcPtr = &CMmsConformance::ResolveNonconformantAttachment;
         }
    return funcPtr;
    }
--- a/messagingappbase/msgmedia/src/MsgMediaInfo.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingappbase/msgmedia/src/MsgMediaInfo.cpp	Mon May 03 12:29:07 2010 +0300
@@ -125,8 +125,7 @@
     iDRMHelper = &aDRMHelper;
     iFile.Duplicate( aFile );
     // Actual parsing is done in RunL (of each media info class).
-    //CompleteSelf( KErrNone );
-    RunL();
+    CompleteSelf( KErrNone );
     }
 
 // -----------------------------------------------------------------------------
--- a/messagingappbase/msgmedia/src/MsgMediaResolver.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingappbase/msgmedia/src/MsgMediaResolver.cpp	Mon May 03 12:29:07 2010 +0300
@@ -104,6 +104,12 @@
 //
 CMsgMediaResolver::~CMsgMediaResolver()
     {
+    if ( iWait.IsStarted() )
+        {
+        // Stop active wait.
+        iWait.AsyncStop();
+        }
+    
     iFs.Close();
     iApaLsSession.Close();
     iMimeGroupArray.ResetAndDestroy();
@@ -262,13 +268,13 @@
 EXPORT_C void CMsgMediaResolver::ParseInfoDetailsL( CMsgMediaInfo* aInfo, RFile& aFile )
     {
     aInfo->ParseInfoDetailsL( aFile, *iDRMHelper, *this );
-    /* if ( iWait.IsStarted() )
+     if ( iWait.IsStarted() )
         {
         // Stop active wait.
         iWait.AsyncStop();
         }
     // Start active wait
-    iWait.Start();*/
+    iWait.Start();
     }
 
 // -----------------------------------------------------------------------------
@@ -338,11 +344,11 @@
 //
 void CMsgMediaResolver::MediaInfoParsed()
     {
-    /*if ( iWait.IsStarted() )
+    if ( iWait.IsStarted() )
         {
         // Stop active wait.
         iWait.AsyncStop();
-        }*/
+        }
     }
 
 //  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingappbase/mtmregistry/mtmregistry.mmp	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 is project specification file for the mtm registry.
+*
+*/
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+TARGETTYPE none
+APP_LAYER_SYSTEMINCLUDE
+MW_LAYER_SYSTEMINCLUDE
+
+START RESOURCE  ./resource/notregistry.rss
+TARGET          not.rsc
+TARGETPATH      MTM_INFO_FILE_DIR
+LANGUAGE_IDS
+END
+
+START RESOURCE  ./resource/mmsregistry.rss
+TARGET          mms.rsc
+TARGETPATH      MTM_INFO_FILE_DIR
+LANGUAGE_IDS
+END
+
+START RESOURCE  ./resource/smsregistry.rss
+TARGET          sms.rsc
+TARGETPATH      MTM_INFO_FILE_DIR
+LANGUAGE_IDS
+END
+
+START RESOURCE  ./resource/bioregistry.rss
+TARGET          biomtm.rsc
+TARGETPATH      MTM_INFO_FILE_DIR
+LANGUAGE_IDS
+END
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingappbase/mtmregistry/mtmregistry.pro	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,32 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+TEMPLATE = subdirs
+
+# Platforms
+SYMBIAN_PLATFORMS = WINSCW ARMV5
+
+# Build.inf rules
+symbian{
+		BLD_INF_RULES.prj_exports += \
+    "$${LITERAL_HASH}include <platform_paths.hrh>" \
+    "rom/mtmregistry.iby             CORE_APP_LAYER_IBY_EXPORT_PATH(mtmregistry.iby)"    
+		}
+
+# bld.inf rules
+symbian {
+BLD_INF_RULES.prj_mmpfiles = "./mtmregistry.mmp"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingappbase/mtmregistry/resource/bioregistry.rss	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,67 @@
+/*
+* 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 Bio MTM info resource.
+*
+*/
+
+
+
+//  INCLUDES
+#include <mtmconfig.rh>
+
+//  CONSTANTS  
+//  MACROS  
+
+//  RESOURCE DEFINITIONS 
+
+#include <e32capability.h>
+
+RESOURCE MTM_INFO_FILE
+    {
+    mtm_type_uid = 0x10001262;
+    technology_type_uid = 0x10008A30;
+    components = 
+        {
+        MTM_COMPONENT_V2
+            {
+            human_readable_name = "Bio Message client";
+            component_uid = KUidMtmServerComponentVal;
+            entry_point = 1;
+            version = VERSION_V2 {};
+            filename = "BIOS.dll";
+            },
+        MTM_COMPONENT_V2
+            {
+            human_readable_name = "dummy smart msg.";
+            component_uid = KUidMtmClientComponentVal;
+            entry_point = 1;
+            version = VERSION_V2 {};
+            filename = "bioc.dll";
+            }
+        };
+    }
+
+RESOURCE MTM_CAPABILITIES
+    {
+    send_capability = 1;
+    body_capability = 1;
+    }
+
+RESOURCE MTM_SECURITY_CAPABILITY_SET
+    {
+    capabilities = { ECapabilityLocalServices };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingappbase/mtmregistry/resource/mmsregistry.rss	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 MMS MTM info resource.
+*
+*/
+
+
+
+//  INCLUDES
+#include <mtmconfig.rh>
+
+
+//  CONSTANTS  
+// none
+
+//  MACROS  
+// none
+
+
+//  RESOURCE DEFINITIONS 
+// ---------------------------------------------------------
+//   
+//    
+//    MTM info resource for MMS
+//
+// ---------------------------------------------------------
+//
+#include <e32capability.h>
+
+RESOURCE MTM_INFO_FILE
+    {
+    mtm_type_uid = 0x100058E1;
+    technology_type_uid = 0x100058E2;
+    components = 
+        {
+        MTM_COMPONENT_V2
+            {
+            human_readable_name = "Multimedia message";
+            component_uid = KUidMtmServerComponentVal;
+            entry_point = 1;
+            version = VERSION_V2 {};
+            filename = "mmssrv.dll";
+            },
+        MTM_COMPONENT_V2
+            {
+            human_readable_name = "Multimedia message";
+            component_uid = KUidMtmClientComponentVal;
+            entry_point = 1;
+            version = VERSION_V2 {};
+            filename = "mmscli.dll";
+            }
+        };
+    }
+
+RESOURCE MTM_CAPABILITIES
+    {
+    send_capability = 1;
+    body_capability = 0;
+    }
+
+RESOURCE MTM_SECURITY_CAPABILITY_SET
+    {
+    capabilities = { ECapabilityNetworkServices };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingappbase/mtmregistry/resource/notregistry.rss	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 Notification MTM info resource.
+*
+*/
+
+
+
+//  INCLUDES
+#include <mtmconfig.rh>
+
+
+//  CONSTANTS  
+// none
+
+//  MACROS  
+// none
+
+
+//  RESOURCE DEFINITIONS 
+// ---------------------------------------------------------
+//   
+//    
+//    MTM info resource for MMS
+//
+// ---------------------------------------------------------
+//
+#include <e32capability.h>
+
+RESOURCE MTM_INFO_FILE
+    {
+    mtm_type_uid = 0x100059C8;
+    technology_type_uid = 0x100058E2;
+    components = 
+        {
+        MTM_COMPONENT_V2
+            {
+            human_readable_name = "Multimedia message";
+            component_uid = KUidMtmServerComponentVal;
+            entry_point = 1;
+            version = VERSION_V2 {};
+            filename = "mmssrv.dll";
+            },
+        MTM_COMPONENT_V2
+            {
+            human_readable_name = "Multimedia message";
+            component_uid = KUidMtmClientComponentVal;
+            entry_point = 2;
+            version = VERSION_V2 {};
+            filename = "mmscli.dll";
+            }
+        };
+    }
+
+RESOURCE MTM_CAPABILITIES
+    {
+    send_capability = 1;
+    body_capability = 0;
+    }
+
+RESOURCE MTM_SECURITY_CAPABILITY_SET
+    {
+    capabilities = { ECapabilityNetworkServices };
+    }
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingappbase/mtmregistry/resource/smsregistry.rss	Mon May 03 12:29:07 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:  
+*     This file contains Sms MTM info resource.
+*
+*/
+
+
+
+//  INCLUDES
+#include <mtmconfig.rh>
+
+
+//  RESOURCE DEFINITIONS 
+// ---------------------------------------------------------
+//   
+//    
+//    MTM info resource for SMS
+//
+// ---------------------------------------------------------
+//
+#include <e32capability.h>
+
+RESOURCE MTM_INFO_FILE
+    {
+    mtm_type_uid = 0x1000102c;
+    technology_type_uid = 0x10008A30;
+    components = 
+        {
+        MTM_COMPONENT_V2
+            {
+            human_readable_name = "Short message";
+            component_uid = KUidMtmServerComponentVal;
+            entry_point = 1;
+            version = VERSION_V2 {};
+            filename = "smss.dll";
+            },
+        MTM_COMPONENT_V2
+            {
+            human_readable_name = "Short message";
+            component_uid = KUidMtmClientComponentVal;
+            entry_point = 1;
+            version = VERSION_V2 {};
+            filename = "smcm.dll";
+            }
+        };
+    }
+
+RESOURCE MTM_CAPABILITIES
+    {
+    send_capability = 1;
+    body_capability = 1;
+    }
+
+RESOURCE MTM_SECURITY_CAPABILITY_SET
+    {
+    capabilities = { ECapabilityNetworkServices };
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/messagingappbase/mtmregistry/rom/mtmregistry.iby	Mon May 03 12:29:07 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef __MTMREGISTRY_IBY__
+#define __MTMREGISTRY_IBY__
+
+data=DATAZ_\resource\messaging\mtm\mms.rsc    	resource\messaging\mtm\mms.rsc
+data=DATAZ_\resource\messaging\mtm\not.rsc    	resource\messaging\mtm\not.rsc
+data=DATAZ_\resource\messaging\mtm\sms.rsc    	resource\messaging\mtm\sms.rsc
+data=DATAZ_\resource\messaging\mtm\biomtm.rsc   resource\messaging\mtm\biomtm.rsc
+
+#endif // __MTMREGISTRY_IBY__
\ No newline at end of file
--- a/messagingappbase/obexmtms/Group/messaging_obex.history.xml	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingappbase/obexmtms/Group/messaging_obex.history.xml	Mon May 03 12:29:07 2010 +0300
@@ -3,7 +3,11 @@
   <purpose>
     Message Type Module (MTM) plugins to Messaging Framework supporting OBEX over Bluetooth and Infrafred, client / server MTM implementation for each carrier with supporting utilities.
   </purpose>
-
+	
+ <defect number="DEF144349" title="convert SFL to EPL " revision="011">
+    Converting SFL licence to EPL license.
+  </defect>
+  
   <deliverystep number="1462" name="Splitting mixed header files for Messaging" osproject="SymTB92" revision="010">
    <preq number="2510" title=" Splitting mixed header files for Messaging">
     Mixed header files will now contain only published All or published Partner or internal
--- a/messagingappbase/obexmtms/Rom/obex.hby	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingappbase/obexmtms/Rom/obex.hby	Mon May 03 12:29:07 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
 // All rights reserved.
 // This component and the accompanying materials are made available
 // under the terms of "Eclipse Public License v1.0"
@@ -13,7 +13,6 @@
 // Description:
 //
 
-
 #ifndef __OBEXMTM_HBY__
 #define __OBEXMTM_HBY__
 
--- a/messagingappbase/obexmtms/btmtm/btclient/group/btcmtm.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingappbase/obexmtms/btmtm/btclient/group/btcmtm.mmp	Mon May 03 12:29:07 2010 +0300
@@ -32,14 +32,12 @@
 UID		0x10003C5F 0x10009ED3	// 0x10003C5F = KUidMtmClientComponent
 VENDORID 0x70000001
 								// 0x10009ED3 = KBtClientMtmV1DllUid
-VERSION 	10.0
-PAGED
 
 SOURCEPATH	../source
 SOURCE		btcmtm.cpp btcmain.cpp btHeader.cpp
 
 USERINCLUDE	../Include ../../../../../../../mw/messagingmw/messagingfw/msgsrvnstore/server/inc
-APP_LAYER_SYSTEMINCLUDE
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 LIBRARY		euser.lib msgs.lib
 LIBRARY		obexclientmtm.lib
--- a/messagingappbase/obexmtms/btmtm/btserver/group/btsmtm.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingappbase/obexmtms/btmtm/btserver/group/btsmtm.mmp	Mon May 03 12:29:07 2010 +0300
@@ -33,15 +33,13 @@
 UID		0x10003C5E 0x10009ED4	// 0x10003C5E = KUidMtmServerComponent
 VENDORID 0x70000001
 								// 0x10009ED4 = KBtServerMtmV1DllUid 
-VERSION 	10.0
-PAGED
 
 SOURCEPATH	../source
 SOURCE		btsmtm.cpp btsmtmdll.cpp  btsendop.cpp  
 
 USERINCLUDE	../include ../../../../../../../mw/messagingmw/messagingfw/msgsrvnstore/server/inc
 USERINCLUDE ../../btclient/Include
-APP_LAYER_SYSTEMINCLUDE
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 SOURCEPATH	.
 START RESOURCE	btmtm.rss
--- a/messagingappbase/obexmtms/irmtm/irclient/group/ircmtm.MMP	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingappbase/obexmtms/irmtm/irclient/group/ircmtm.MMP	Mon May 03 12:29:07 2010 +0300
@@ -31,15 +31,13 @@
 TARGETPATH      /system/libs
 UID		0x10003C5F 0x100053A1 // 0x10003C5F = KUidMtmClientComponent
 VENDORID 0x70000001
-VERSION 	10.0
-PAGED
 
 SOURCEPATH	../source
 SOURCE			Ircmtm.cpp IRCMAIN.CPP irHeader.cpp
 SOURCE		CIRCancelObserver.cpp
 
 USERINCLUDE		../include ../../../../../../../mw/messagingmw/messagingfw/msgsrvnstore/server/inc
-APP_LAYER_SYSTEMINCLUDE
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 LIBRARY			euser.lib msgs.lib  // imcm.lib etext.lib  
 LIBRARY         irda.lib//-- Obex object send
--- a/messagingappbase/obexmtms/irmtm/irserver/group/IRSMTM.MMP	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingappbase/obexmtms/irmtm/irserver/group/IRSMTM.MMP	Mon May 03 12:29:07 2010 +0300
@@ -31,14 +31,12 @@
 CAPABILITY ReadDeviceData WriteDeviceData ProtServ NetworkControl NetworkServices LocalServices ReaduserData WriteUserData
 UID		0x10003C5E 0x100053A0 // 0x10003C5E = KUidMtmServerComponent
 VENDORID 0x70000001
-VERSION 	10.0
-PAGED
 
 SOURCEPATH	../source
 SOURCE			Irs.cpp IRSDLL.CPP  sendopn.cpp
 
 USERINCLUDE		../include  ../../../../../../../mw/messagingmw/messagingfw/msgsrvnstore/server/inc
-APP_LAYER_SYSTEMINCLUDE
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 SOURCEPATH	.
 
--- a/messagingappbase/obexmtms/obexmtm/obexclient/group/obexClientMtm.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingappbase/obexmtms/obexmtm/obexclient/group/obexClientMtm.mmp	Mon May 03 12:29:07 2010 +0300
@@ -27,14 +27,12 @@
 CAPABILITY All -TCB
 UID				0x1000008d 0x10009ED0 //KObexClientMtmV1DllUid
 VENDORID 0x70000001
-VERSION 	10.0
-PAGED
 
 SOURCEPATH		../source
 SOURCE			obexClientMtm.cpp obexClientMtmMain.cpp
 
 USERINCLUDE		../include 
-APP_LAYER_SYSTEMINCLUDE
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 LIBRARY			euser.lib bafl.lib msgs.lib
 LIBRARY			efsrv.lib
--- a/messagingappbase/obexmtms/obexmtm/obexclient/source/obexClientMtm.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingappbase/obexmtms/obexmtm/obexclient/source/obexClientMtm.cpp	Mon May 03 12:29:07 2010 +0300
@@ -38,6 +38,8 @@
 #include "obexClientMtmPanic.h"
 
 
+const TInt KMaxObexPasswordLength = 30;
+
 //
 //  CObexClientMtm
 //
--- a/messagingappbase/obexmtms/obexmtm/obexserver/group/obexServerMtm.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingappbase/obexmtms/obexmtm/obexserver/group/obexServerMtm.mmp	Mon May 03 12:29:07 2010 +0300
@@ -27,8 +27,6 @@
 CAPABILITY ReadDeviceData WriteDeviceData ProtServ NetworkControl NetworkServices LocalServices ReaduserData WriteUserData
 UID				0x1000008d 0x10009ED1 //KObexServerMtmV1DllUid 
 VENDORID 0x70000001
-VERSION 	10.0
-PAGED
 
 SOURCEPATH		../source
 SOURCE			obexServerMtm.cpp obexServerMtmDll.cpp 
@@ -37,7 +35,7 @@
 source			obexSendOp_normal.cpp
 
 USERINCLUDE		../include 
-APP_LAYER_SYSTEMINCLUDE
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
 
 LIBRARY			euser.lib  msgs.lib
 LIBRARY			efsrv.lib
--- a/messagingappbase/obexmtms/obexmtm/obexutil/group/obexMtmUtil.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingappbase/obexmtms/obexmtm/obexutil/group/obexMtmUtil.mmp	Mon May 03 12:29:07 2010 +0300
@@ -20,13 +20,11 @@
 CAPABILITY All -TCB
 UID             0x1000008d 0x10009ED2 //KObexMtmUtilsDllUid 
 VENDORID 0x70000001
-VERSION 	10.0
-PAGED
 
 SOURCEPATH	../source
 lang            01
 
-APP_LAYER_SYSTEMINCLUDE
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
 userinclude	../include 
 
 source      obexHeader.cpp 
--- a/messagingappbase/rom/Provisioning.iby	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
-* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Image description file for the Provisioning
-*
-*/
-
-
-#ifndef __PROVISIONING_IBY__
-#define __PROVISIONING_IBY__
-
-
-// Engine
-file=ABI_DIR\BUILD_DIR\ProvisioningEngine.dll   SHARED_LIB_DIR\ProvisioningEngine.dll
-// Parser
-file=ABI_DIR\BUILD_DIR\ProvisioningParser.dll   SHARED_LIB_DIR\ProvisioningParser.dll
-// BIO control
-//file=ABI_DIR\BUILD_DIR\ProvisioningBC.dll       SHARED_LIB_DIR\ProvisioningBC.dll
-// Handler
-ECOM_PLUGIN(ProvisioningHandler.dll,101F84D2.rsc)
-// Access point adapter
-//ECOM_PLUGIN(WPAPAdapter.dll,101F84D8.rsc)
-#ifdef __MMS
-// WAP adapter
-ECOM_PLUGIN(WPWAPAdapter.dll,101F84DC.rsc)
-#endif
-// Streaming Adapter
-ECOM_PLUGIN(WPStreamingAdapter.dll,101F85CB.rsc)
-
-// Mailbox Number adapter
-ECOM_PLUGIN(WPMbxNbrAdapter.dll,10207281.rsc)	// this publishes the DLL and the
-													  						// resource file to the correct location
-
-
-#if ( defined (__ALWAYS_ONLINE_PDPCONTEXT) || defined (__ALWAYS_ONLINE_PDPCONTEXT2) )
-// ALWAYS ONLINE adapter
-ECOM_PLUGIN(WPAlwaysOnAdapter.dll,200159E4.rsc)
-#endif
-
-
-// SIP adapter
-//ECOM_PLUGIN(WPSIPAdapter.dll,101FB37E.rsc)
-
-
-#ifdef __IM
-// WV adapter
-ECOM_PLUGIN(WPWVAdapter.dll,101F84E2.rsc)
-#endif
-
-/*#ifdef __MULTIPLE_PROV_CTX
-// Context list
-file=ABI_DIR\BUILD_DIR\ProvisioningCx.exe       PROGRAMS_DIR\ProvisioningCx.exe
-//normal icons
-//probably not needed, as no UI bitmaps used...
-data=DATAZ_\APP_BITMAP_DIR\ProvisioningCx.MIF	APP_BITMAP_DIR\ProvisioningCx.mif
-#endif //__MULTIPLE_PROV_CTX*/
-
-#ifdef __SMART_CARD_PROV
-    file=ABI_DIR\BUILD_DIR\ProvisioningSC.exe       PROGRAMS_DIR\ProvisioningSC.exe
-#endif
-
-#ifdef SYMBIAN_SECURE_DBMS
-    data=ZPRIVATE\100012a5\policy\101F84D6.spd      PRIVATE\100012a5\policy\101F84D6.spd
-#endif // SYMBIAN_SECURE_DBMS
-
-#ifdef __SECURE_BACKUP__
-// Using ProvisioningCX private data area for backup file.
-data=ZPRIVATE\\101F8597\backup_registration.xml	    PRIVATE\101F8597\backup_registration.xml
-#endif //__SECURE_BACKUP__
-
-//Authentication type Plugin
-#ifdef FF_PROV_AUTHTYPE_PLUGIN
-ECOM_PLUGIN( Authtypeplugin.dll, 2001247C.rsc )
-SCALABLE_IMAGE( APP_BITMAP_DIR, APP_BITMAP_DIR, Authtypeplugin )
-#endif 
-
-//pnputilities
-file=ABI_DIR\BUILD_DIR\PnP.dll		                      		SHARED_LIB_DIR\PnP.dll
-#endif
--- a/messagingappbase/rom/RFSPlugins.iby	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +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 __RFSPLUGINS_IBY__
-#define __RFSPLUGINS_IBY__
-
-ECOM_PLUGIN(AIRFSPlugin.dll,2000F8BD.rsc)
-ECOM_PLUGIN(CertRFSPlugin.dll,2000F8B9.rsc)
-ECOM_PLUGIN(ClockRFSPlugin.dll,2000F8BE.rsc)
-ECOM_PLUGIN(DatastoreRFSPlugin.dll,2000F8C2.rsc)
-ECOM_PLUGIN(DefaultFolderRFSPlugin.dll,2000F8BA.rsc)
-ECOM_PLUGIN(RfsDisplayContrastPlugin.dll,102071F7.rsc)
-ECOM_PLUGIN(FavouritesRFSPlugin.dll,102071F6.rsc)
-ECOM_PLUGIN(NitzRFSPlugin.dll,2000F8BF.rsc)
-ECOM_PLUGIN(StarterRFSPlugin.dll,2000F8BB.rsc)
-ECOM_PLUGIN(SyncMLRFSPlugin.dll,2000F8BC.rsc)
-ECOM_PLUGIN(TelephonyRFSPlugin.dll,2000F8C1.rsc)
-file=ABI_DIR\BUILD_DIR\SecureFormatter.exe              sys\bin\SecureFormatter.exe
-ECOM_PLUGIN(FormatterRFSPlugin.dll,2001CB73.rsc)
-ECOM_PLUGIN(UnitconverterRFSPlugin.dll,2000F8C0.rsc)
-ECOM_PLUGIN(SIPRFSPlugin.dll,2001959D.rsc)
-//ECOM_PLUGIN(msgcentrerfsplugin.dll,20022D81.rsc)
-
-#endif //__RFSPLUGINS_IBY__
Binary file messagingappbase/rom/Sms.rsc has changed
Binary file messagingappbase/rom/mms.rsc has changed
--- a/messagingappbase/smilparser/GROUP/messaging_gmxml.history.xml	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingappbase/smilparser/GROUP/messaging_gmxml.history.xml	Mon May 03 12:29:07 2010 +0300
@@ -4,6 +4,16 @@
     SMIL parsing implemented via generic XML Parser / Composer with a "mini-DOM" API able to perform syntax checking against simple DTDs. Replaces SMIL Translater implementation of 7.0s.
   </purpose>
 
+  <deliverystep number="1842" name="CR1934: Messaging: Moving XML Parser" osproject="SymTB9.2" revision="012">
+  <cr number="1934" title="Restructuring of the MCL">Adding SMIL parser into webservices-xml package.</cr> 
+  <milestone project="GT0539" number="3.4" /> 
+  </deliverystep>
+  
+   
+  <defect number="DEF142365" title="GCC-E: Simple syntax error" revision="011">
+      syntax error in function declaration
+    </defect>
+
   <defect number="DEF138034" title="GMXML parser could cause stray event panics" revision="010">
       stray scanner defect.
     </defect>
@@ -14,7 +24,7 @@
    </preq>
     <milestone project="GT0465" number="3.5"/>
   </deliverystep>
-
+  
   <defect number="DEF128078" title="@prototype tags in messaging" revision="008">
       Added IM tag message server.
     </defect>
--- a/messagingappbase/smilparser/GROUP/messaging_gmxml.mrp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingappbase/smilparser/GROUP/messaging_gmxml.mrp	Mon May 03 12:29:07 2010 +0300
@@ -26,5 +26,5 @@
 ipr T \sf\app\messaging\messagingappbase\smilparser\SMILdtd\SMIL_Test_Files
 ipr T \sf\app\messaging\messagingappbase\smilparser\SMILdtd\tinc
 ipr T \sf\app\messaging\messagingappbase\smilparser\SMILdtd\tsrc
-ipr T \sf\app\messaging\messagingappbase\smilparser\XMLParser\test
 
+
--- a/messagingappbase/smilparser/Rom/Gmxml.iby	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingappbase/smilparser/Rom/Gmxml.iby	Mon May 03 12:29:07 2010 +0300
@@ -18,8 +18,8 @@
 #ifndef __GMXML_IBY__
 #define __GMXML_IBY__
 
+#include <legacyminidomparser.iby>
 file=ABI_DIR\BUILD_DIR\SMILDTD.dll	System\libs\SMILDTD.dll
-file=ABI_DIR\BUILD_DIR\XMLDOM.dll	System\libs\XMLDOM.dll
-file=ABI_DIR\BUILD_DIR\xmlparser.dll	System\libs\xmlparser.dll
+
 
 #endif
--- a/messagingappbase/smilparser/SMILdtd/GROUP/smildtd.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingappbase/smilparser/SMILdtd/GROUP/smildtd.mmp	Mon May 03 12:29:07 2010 +0300
@@ -30,7 +30,7 @@
 SOURCEPATH		../SRC
 SOURCE			Smildtd.cpp
 
-USERINCLUDE		../INC
+USERINCLUDE		../INC 
 APP_LAYER_SYSTEMINCLUDE_SYMBIAN
 LIBRARY			euser.lib    
 LIBRARY         	bafl.lib 
--- a/messagingappbase/smilparser/SMILdtd/GROUP/smiltranslatortest.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingappbase/smilparser/SMILdtd/GROUP/smiltranslatortest.mmp	Mon May 03 12:29:07 2010 +0300
@@ -23,8 +23,8 @@
 SOURCEPATH	../tsrc
 SOURCE         	smiltranslatortest.cpp 
 
-USERINCLUDE	    ../tinc ../inc ../../XMLDOM/INC
-SYSTEMINCLUDE   /epoc32/include
+USERINCLUDE	    ../tinc ../inc 
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
 LIBRARY		efsrv.lib
 LIBRARY		euser.lib
 LIBRARY		bafl.lib
--- a/messagingappbase/smilparser/SMILdtd/GROUP/t_smil_dom.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingappbase/smilparser/SMILdtd/GROUP/t_smil_dom.mmp	Mon May 03 12:29:07 2010 +0300
@@ -20,9 +20,10 @@
 CAPABILITY All -TCB
 UID				0
 VENDORID 0x70000001
-SOURCEPATH 		..\tsrc
-USERINCLUDE		..\tinc
-SYSTEMINCLUDE	\epoc32\include
+SOURCEPATH 		../tsrc
+USERINCLUDE		../tinc
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
+OS_LAYER_ESTLIB_SYSTEMINCLUDE  
 SOURCE			t_SmilDom.cpp t_TestScript.cpp t_ScriptRunner.cpp t_LogFileWriter.cpp
 LIBRARY	      		euser.lib
 LIBRARY			bafl.lib
--- a/messagingappbase/smilparser/SMILdtd/tsrc/smiltranslatortest.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/messagingappbase/smilparser/SMILdtd/tsrc/smiltranslatortest.cpp	Mon May 03 12:29:07 2010 +0300
@@ -59,7 +59,10 @@
 #include <txtetext.h>
 #include <gmxmlparser.h>
 #include <gmxmlcomposer.h>
-#include "smildtd.h"
+#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS  
+#include "smildtdenum.h"
+#endif
+#include <smildtd.h>
 #include <bacline.h>
 
 // Constants
--- a/messagingappbase/smsmtm/clientmtm/bmarm/SMCMU.DEF	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-EXPORTS
-	NewL__13CSmsClientMtmR17CRegisteredMtmDllR11CMsvSession @ 1 NONAME R3UNUSED ; CSmsClientMtm::NewL(CRegisteredMtmDll &, CMsvSession &)
-	Dummy_Export_1__13TSmsUtilities @ 2 NONAME R3UNUSED ; TSmsUtilities::Dummy_Export_1(void)
-	BioTypeChangedL__13CSmsClientMtmG4TUid @ 3 NONAME R3UNUSED ; CSmsClientMtm::BioTypeChangedL(TUid)
-	CopyL__10CSmsNumberRC10CSmsNumber @ 4 NONAME R3UNUSED ; CSmsNumber::CopyL(CSmsNumber const &)
-	CopyL__12CSmsSettingsRC12CSmsSettings @ 5 NONAME R3UNUSED ; CSmsSettings::CopyL(CSmsSettings const &)
-	CopyL__19CSmsMessageSettingsRC19CSmsMessageSettings @ 6 NONAME R3UNUSED ; CSmsMessageSettings::CopyL(CSmsMessageSettings const &)
-	ExternalizeL__C10CSmsHeaderR15RMsvWriteStream @ 7 NONAME R3UNUSED ; CSmsHeader::ExternalizeL(RMsvWriteStream &) const
-	ExternalizeL__C10CSmsNumberR12RWriteStream @ 8 NONAME R3UNUSED ; CSmsNumber::ExternalizeL(RWriteStream &) const
-	ExternalizeL__C12CSmsSettingsR12RWriteStream @ 9 NONAME R3UNUSED ; CSmsSettings::ExternalizeL(RWriteStream &) const
-	ExternalizeL__C19CSmsMessageSettingsR12RWriteStream @ 10 NONAME R3UNUSED ; CSmsMessageSettings::ExternalizeL(RWriteStream &) const
-	GetDescription__13TSmsUtilitiesRC11CSmsMessageR6TDes16i @ 11 NONAME R3UNUSED ; TSmsUtilities::GetDescription(CSmsMessage const &, TDes16 &, int)
-	GetDetails__13TSmsUtilitiesR3RFsRC11CSmsMessageR6TDes16i @ 12 NONAME ; TSmsUtilities::GetDetails(RFs &, CSmsMessage const &, TDes16 &, int)
-	GetDetails__13TSmsUtilitiesR3RFsRC7TDesC16R6TDes16i @ 13 NONAME ; TSmsUtilities::GetDetails(RFs &, TDesC16 const &, TDes16 &, int)
-	GetSmsSettingsL__C10CSmsHeaderR19CSmsMessageSettings @ 14 NONAME R3UNUSED ; CSmsHeader::GetSmsSettingsL(CSmsMessageSettings &) const
-	InternalizeL__10CSmsHeaderR14RMsvReadStream @ 15 NONAME R3UNUSED ; CSmsHeader::InternalizeL(RMsvReadStream &)
-	InternalizeL__10CSmsNumberR11RReadStream @ 16 NONAME R3UNUSED ; CSmsNumber::InternalizeL(RReadStream &)
-	InternalizeL__12CSmsSettingsR11RReadStream @ 17 NONAME R3UNUSED ; CSmsSettings::InternalizeL(RMsvReadStream &)
-	InternalizeL__19CSmsMessageSettingsR11RReadStream @ 18 NONAME R3UNUSED ; CSmsMessageSettings::InternalizeL(RMsvReadStream &)
-	NewL__10CSmsHeaderP11CSmsMessage @ 19 NONAME R3UNUSED ; CSmsHeader::NewL(CSmsMessage *)
-	NewL__10CSmsHeaderQ27CSmsPDU11TSmsPDUTypeR13CEditableText @ 20 NONAME R3UNUSED ; CSmsHeader::NewL(CSmsPDU::TSmsPDUType, CEditableText &)
-	NewL__10CSmsNumber @ 21 NONAME R3UNUSED ; CSmsNumber::NewL(void)
-	NewL__10CSmsNumberRC10CSmsNumber @ 22 NONAME R3UNUSED ; CSmsNumber::NewL(CSmsNumber const &)
-	NewL__12CSmsSettings @ 23 NONAME R3UNUSED ; CSmsSettings::NewL(void)
-	PopulateMsgEntry__13TSmsUtilitiesR9TMsvEntryRC11CSmsMessagelG4TUid @ 24 NONAME ; TSmsUtilities::PopulateMsgEntry(TMsvEntry &, CSmsMessage const &, long, TUid)
-	RemoveSCAddress__12CSmsSettingsi @ 25 NONAME R3UNUSED ; CSmsSettings::RemoveSCAddress(int)
-	RestoreL__10CSmsHeaderR9CMsvStore @ 26 NONAME R3UNUSED ; CSmsHeader::RestoreL(CMsvStore &)
-	RestoreL__12CSmsSettingsR9CMsvStore @ 27 NONAME R3UNUSED ; CSmsSettings::RestoreL(CMsvStore &)
-	RestoreServiceAndSettingsL__13CSmsClientMtm @ 28 NONAME R3UNUSED ; CSmsClientMtm::RestoreServiceAndSettingsL(void)
-	ServiceIdL__13TSmsUtilitiesR15CMsvServerEntryRlG4TUidP18CMsvEntrySelection @ 29 NONAME ; TSmsUtilities::ServiceIdL(CMsvServerEntry &, long &, TUid, CMsvEntrySelection *)
-	ServiceIdL__13TSmsUtilitiesR9CMsvEntryRlG4TUidP18CMsvEntrySelection @ 30 NONAME ; TSmsUtilities::ServiceIdL(CMsvEntry &, long &, TUid, CMsvEntrySelection *)
-	SetSmsSettingsL__10CSmsHeaderRC19CSmsMessageSettings @ 31 NONAME R3UNUSED ; CSmsHeader::SetSmsSettingsL(CSmsMessageSettings const &)
-	StoreL__C10CSmsHeaderR9CMsvStore @ 32 NONAME R3UNUSED ; CSmsHeader::StoreL(CMsvStore &) const
-	StoreL__C12CSmsSettingsR9CMsvStore @ 33 NONAME R3UNUSED ; CSmsSettings::StoreL(CMsvStore &) const
-	"_._10CSmsHeader" @ 34 NONAME R3UNUSED ; CSmsHeader::~CSmsHeader(void)
-	"_._10CSmsNumber" @ 35 NONAME R3UNUSED ; CSmsNumber::~CSmsNumber(void)
-	"_._12CSmsSettings" @ 36 NONAME R3UNUSED ; CSmsSettings::~CSmsSettings(void)
-	Dummy_Export_2__13TSmsUtilities @ 37 NONAME R3UNUSED ; TSmsUtilities::Dummy_Export_2(void)
-	AddSCAddressL__12CSmsSettingsRC7TDesC16T1 @ 38 NONAME R3UNUSED ; CSmsSettings::AddSCAddressL(TDesC16 const &, TDesC16 const &)
-	ProgressL__21CSmsSimParamOperation @ 39 NONAME R3UNUSED ; CSmsSimParamOperation::ProgressL(void)
-	ReadSimParamsL__13CSmsClientMtmR14TRequestStatus @ 40 NONAME R3UNUSED ; CSmsClientMtm::ReadSimParamsL(TRequestStatus &)
-	ServiceCentersLC__C21CSmsSimParamOperation @ 41 NONAME R3UNUSED ; CSmsSimParamOperation::ServiceCentersLC(void) const
-	Address__C10CSmsNumber @ 42 NONAME R3UNUSED ; CSmsNumber::Address(void) const
-	Name__C10CSmsNumber @ 43 NONAME R3UNUSED ; CSmsNumber::Name(void) const
-	SetAddressL__10CSmsNumberRC7TDesC16 @ 44 NONAME R3UNUSED ; CSmsNumber::SetAddressL(TDesC16 const &)
-	SetNameL__10CSmsNumberRC7TDesC16 @ 45 NONAME R3UNUSED ; CSmsNumber::SetNameL(TDesC16 const &)
-	CreateMessageL__13CSmsClientMtml @ 46 NONAME R3UNUSED ; CSmsClientMtm::CreateMessageL(long)
-	ServiceIdL__13TSmsUtilitiesR11CMsvSessionRlG4TUidP18CMsvEntrySelection @ 47 NONAME ; TSmsUtilities::ServiceIdL(CMsvSession &, long &, TUid, CMsvEntrySelection *)
-	RestoreSimParamsL__21CSmsSimParamOperationR9CMsvStoreR20CMobilePhoneSmspList @ 48 NONAME R3UNUSED ; CSmsSimParamOperation::RestoreSimParamsL(CMsvStore &, CMobilePhoneSmspList &)
-	StoreSimParamsL__21CSmsSimParamOperationR9CMsvStoreRC20CMobilePhoneSmspList @ 49 NONAME R3UNUSED ; CSmsSimParamOperation::StoreSimParamsL(CMsvStore &, CMobilePhoneSmspList const &)
-	WriteSimParamsL__13CSmsClientMtmRC20CMobilePhoneSmspListR14TRequestStatus @ 50 NONAME R3UNUSED ; CSmsClientMtm::WriteSimParamsL(CMobilePhoneSmspList const &, TRequestStatus &)
-	SaveExternalL__12CSmsSettingsR9CMsvStore @ 51 NONAME R3UNUSED ; CSmsSettings::SaveExternalL(CMsvStore &)
-	OpenResourceFileL__13TSmsUtilitiesR3RFs @ 52 NONAME R3UNUSED ; TSmsUtilities::OpenResourceFileL(RFs &)
-	ReadResourceStringL__13TSmsUtilitiesG13RResourceFileiR6TDes16 @ 53 NONAME ; TSmsUtilities::ReadResourceStringL(RResourceFile, int, TDes16 &)
-	AckSummary__C12TMsvSmsEntry11TSmsAckType @ 54 NONAME R3UNUSED ; TMsvSmsEntry::AckSummary(TSmsAckType) const
-	MessageId__C12TMsvSmsEntryRl @ 55 NONAME R3UNUSED ; TMsvSmsEntry::MessageId(long &) const
-	SetAckStatus__10CSmsNumber11TSmsAckTypeQ210CSmsNumber13TSmsAckStatus @ 56 NONAME R3UNUSED ; CSmsNumber::SetAckStatus(TSmsAckType, CSmsNumber::TSmsAckStatus)
-	SetAckSummary__12TMsvSmsEntry11TSmsAckTypeQ212TMsvSmsEntry22TMsvSmsEntryAckSummary @ 57 NONAME R3UNUSED ; TMsvSmsEntry::SetAckSummary(TSmsAckType, TMsvSmsEntry::TMsvSmsEntryAckSummary)
-	SetMessageId__12TMsvSmsEntryli @ 58 NONAME R3UNUSED ; TMsvSmsEntry::SetMessageId(long, int)
-	AckStatus__C10CSmsNumber11TSmsAckType @ 59 NONAME R3UNUSED ; CSmsNumber::AckStatus(TSmsAckType) const
-	"_._15CSmsEmailFields" @ 60 NONAME R3UNUSED ; CSmsEmailFields::~CSmsEmailFields(void)
-	AddAddressL__15CSmsEmailFieldsRC7TDesC16 @ 61 NONAME R3UNUSED ; CSmsEmailFields::AddAddressL(TDesC16 const &)
-	Addresses__C15CSmsEmailFields @ 62 NONAME R3UNUSED ; CSmsEmailFields::Addresses(void) const
-	ComposeLC__C15CSmsEmailFields @ 63 NONAME R3UNUSED ; CSmsEmailFields::ComposeLC(void) const
-	EmailFields__C10CSmsHeader @ 64 NONAME R3UNUSED ; CSmsHeader::EmailFields(void) const
-	HasAddress__C15CSmsEmailFields @ 65 NONAME R3UNUSED ; CSmsEmailFields::HasAddress(void) const
-	Length__C15CSmsEmailFields @ 66 NONAME R3UNUSED ; CSmsEmailFields::Length(void) const
-	NewL__15CSmsEmailFields @ 67 NONAME R3UNUSED ; CSmsEmailFields::NewL(void)
-	NewL__15CSmsEmailFieldsRC15CSmsEmailFields @ 68 NONAME R3UNUSED ; CSmsEmailFields::NewL(CSmsEmailFields const &)
-	RemoveAddress__15CSmsEmailFieldsi @ 69 NONAME R3UNUSED ; CSmsEmailFields::RemoveAddress(int)
-	Reset__15CSmsEmailFields @ 70 NONAME R3UNUSED ; CSmsEmailFields::Reset(void)
-	SetEmailFieldsL__10CSmsHeaderRC15CSmsEmailFields @ 71 NONAME R3UNUSED ; CSmsHeader::SetEmailFieldsL(CSmsEmailFields const &)
-	SetSubjectL__15CSmsEmailFieldsRC7TDesC16 @ 72 NONAME R3UNUSED ; CSmsEmailFields::SetSubjectL(TDesC16 const &)
-	Subject__C15CSmsEmailFields @ 73 NONAME R3UNUSED ; CSmsEmailFields::Subject(void) const
-
--- a/messagingappbase/smsmtm/clientmtm/bwins/SMCMU.DEF	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-EXPORTS
-	?NewL@CSmsClientMtm@@SAPAV1@AAVCRegisteredMtmDll@@AAVCMsvSession@@@Z @ 1 NONAME ; public: static class CSmsClientMtm * __cdecl CSmsClientMtm::NewL(class CRegisteredMtmDll &,class CMsvSession &)
-	?Dummy_Export_1@TSmsUtilities@@QAEXXZ @ 2 NONAME ; public: void __thiscall TSmsUtilities::Dummy_Export_1(void)
-	??1CSmsHeader@@UAE@XZ @ 3 NONAME ; public: virtual __thiscall CSmsHeader::~CSmsHeader(void)
-	??1CSmsNumber@@UAE@XZ @ 4 NONAME ; public: virtual __thiscall CSmsNumber::~CSmsNumber(void)
-	??1CSmsSettings@@UAE@XZ @ 5 NONAME ; public: virtual __thiscall CSmsSettings::~CSmsSettings(void)
-	?Dummy_Export_2@TSmsUtilities@@QAEXXZ @ 6 NONAME ; public: void __thiscall TSmsUtilities::Dummy_Export_2(void)
-	?AddSCAddressL@CSmsSettings@@QAEXABVTDesC16@@0@Z @ 7 NONAME ; public: void __thiscall CSmsSettings::AddSCAddressL(class TDesC16 const &,class TDesC16 const &)
-	?BioTypeChangedL@CSmsClientMtm@@UAEXVTUid@@@Z @ 8 NONAME ; public: virtual void __thiscall CSmsClientMtm::BioTypeChangedL(class TUid)
-	?CopyL@CSmsMessageSettings@@UAEXABV1@@Z @ 9 NONAME ; public: virtual void __thiscall CSmsMessageSettings::CopyL(class CSmsMessageSettings const &)
-	?CopyL@CSmsNumber@@QAEAAV1@ABV1@@Z @ 10 NONAME ; public: class CSmsNumber & __thiscall CSmsNumber::CopyL(class CSmsNumber const &)
-	?CopyL@CSmsSettings@@QAEXABV1@@Z @ 11 NONAME ; public: void __thiscall CSmsSettings::CopyL(class CSmsSettings const &)
-	?ExternalizeL@CSmsHeader@@QBEXAAVRMsvWriteStream@@@Z @ 12 NONAME ; public: void __thiscall CSmsHeader::ExternalizeL(class RMsvWriteStream &)const 
-	?ExternalizeL@CSmsMessageSettings@@UBEXAAVRWriteStream@@@Z @ 13 NONAME ; public: virtual void __thiscall CSmsMessageSettings::ExternalizeL(class RMsvWriteStream &)const 
-	?ExternalizeL@CSmsNumber@@UBEXAAVRWriteStream@@@Z @ 14 NONAME ; public: virtual void __thiscall CSmsNumber::ExternalizeL(class RWriteStream &)const 
-	?ExternalizeL@CSmsSettings@@UBEXAAVRWriteStream@@@Z @ 15 NONAME ; public: virtual void __thiscall CSmsSettings::ExternalizeL(class RMsvWriteStream &)const 
-	?GetDescription@TSmsUtilities@@SAHABVCSmsMessage@@AAVTDes16@@H@Z @ 16 NONAME ; public: static int __cdecl TSmsUtilities::GetDescription(class CSmsMessage const &,class TDes16 &,int)
-	?GetDetails@TSmsUtilities@@SAHAAVRFs@@ABVCSmsMessage@@AAVTDes16@@H@Z @ 17 NONAME ; public: static int __cdecl TSmsUtilities::GetDetails(class RFs &,class CSmsMessage const &,class TDes16 &,int)
-	?GetDetails@TSmsUtilities@@SAHAAVRFs@@ABVTDesC16@@AAVTDes16@@H@Z @ 18 NONAME ; public: static int __cdecl TSmsUtilities::GetDetails(class RFs &,class TDesC16 const &,class TDes16 &,int)
-	?GetSmsSettingsL@CSmsHeader@@QBEXAAVCSmsMessageSettings@@@Z @ 19 NONAME ; public: void __thiscall CSmsHeader::GetSmsSettingsL(class CSmsMessageSettings &)const 
-	?InternalizeL@CSmsHeader@@QAEXAAVRMsvReadStream@@@Z @ 20 NONAME ; public: void __thiscall CSmsHeader::InternalizeL(class RMsvReadStream &)
-	?InternalizeL@CSmsMessageSettings@@UAEXAAVRReadStream@@@Z @ 21 NONAME ; public: virtual void __thiscall CSmsMessageSettings::InternalizeL(class RMsvReadStream &)
-	?InternalizeL@CSmsNumber@@UAEXAAVRReadStream@@@Z @ 22 NONAME ; public: virtual void __thiscall CSmsNumber::InternalizeL(class RReadStream &)
-	?InternalizeL@CSmsSettings@@UAEXAAVRReadStream@@@Z @ 23 NONAME ; public: virtual void __thiscall CSmsSettings::InternalizeL(class RMsvReadStream &)
-	?NewL@CSmsHeader@@SAPAV1@PAVCSmsMessage@@@Z @ 24 NONAME ; public: static class CSmsHeader * __cdecl CSmsHeader::NewL(class CSmsMessage *)
-	?NewL@CSmsHeader@@SAPAV1@W4TSmsPDUType@CSmsPDU@@AAVCEditableText@@@Z @ 25 NONAME ; public: static class CSmsHeader * __cdecl CSmsHeader::NewL(enum CSmsPDU::TSmsPDUType,class CEditableText &)
-	?NewL@CSmsNumber@@SAPAV1@ABV1@@Z @ 26 NONAME ; public: static class CSmsNumber * __cdecl CSmsNumber::NewL(class CSmsNumber const &)
-	?NewL@CSmsNumber@@SAPAV1@XZ @ 27 NONAME ; public: static class CSmsNumber * __cdecl CSmsNumber::NewL(void)
-	?NewL@CSmsSettings@@SAPAV1@XZ @ 28 NONAME ; public: static class CSmsSettings * __cdecl CSmsSettings::NewL(void)
-	?PopulateMsgEntry@TSmsUtilities@@SAXAAVTMsvEntry@@ABVCSmsMessage@@JVTUid@@@Z @ 29 NONAME ; public: static void __cdecl TSmsUtilities::PopulateMsgEntry(class TMsvEntry &,class CSmsMessage const &,long,class TUid)
-	?RemoveSCAddress@CSmsSettings@@QAEXH@Z @ 30 NONAME ; public: void __thiscall CSmsSettings::RemoveSCAddress(int)
-	?RestoreL@CSmsHeader@@QAEXAAVCMsvStore@@@Z @ 31 NONAME ; public: void __thiscall CSmsHeader::RestoreL(class CMsvStore &)
-	?RestoreL@CSmsSettings@@QAEXAAVCMsvStore@@@Z @ 32 NONAME ; public: void __thiscall CSmsSettings::RestoreL(class CMsvStore &)
-	?RestoreServiceAndSettingsL@CSmsClientMtm@@QAEXXZ @ 33 NONAME ; public: void __thiscall CSmsClientMtm::RestoreServiceAndSettingsL(void)
-	?ServiceIdL@TSmsUtilities@@SAXAAVCMsvEntry@@AAJVTUid@@PAVCMsvEntrySelection@@@Z @ 34 NONAME ; public: static void __cdecl TSmsUtilities::ServiceIdL(class CMsvEntry &,long &,class TUid,class CMsvEntrySelection *)
-	?ServiceIdL@TSmsUtilities@@SAXAAVCMsvServerEntry@@AAJVTUid@@PAVCMsvEntrySelection@@@Z @ 35 NONAME ; public: static void __cdecl TSmsUtilities::ServiceIdL(class CMsvServerEntry &,long &,class TUid,class CMsvEntrySelection *)
-	?SetSmsSettingsL@CSmsHeader@@QAEXABVCSmsMessageSettings@@@Z @ 36 NONAME ; public: void __thiscall CSmsHeader::SetSmsSettingsL(class CSmsMessageSettings const &)
-	?StoreL@CSmsHeader@@QBEXAAVCMsvStore@@@Z @ 37 NONAME ; public: void __thiscall CSmsHeader::StoreL(class CMsvStore &)const 
-	?StoreL@CSmsSettings@@QBEXAAVCMsvStore@@@Z @ 38 NONAME ; public: void __thiscall CSmsSettings::StoreL(class CMsvStore &)const 
-	?ProgressL@CSmsSimParamOperation@@UAEABVTDesC8@@XZ @ 39 NONAME ; public: virtual class TDesC8 const & __thiscall CSmsSimParamOperation::ProgressL(void)
-	?ReadSimParamsL@CSmsClientMtm@@QAEPAVCSmsSimParamOperation@@AAVTRequestStatus@@@Z @ 40 NONAME ; public: class CSmsSimParamOperation * __thiscall CSmsClientMtm::ReadSimParamsL(class TRequestStatus &)
-	?ServiceCentersLC@CSmsSimParamOperation@@QBEPAVCMobilePhoneSmspList@@XZ @ 41 NONAME ; public: class CMobilePhoneSmspList * __thiscall CSmsSimParamOperation::ServiceCentersLC(void)const 
-	?Address@CSmsNumber@@QBE?AVTPtrC16@@XZ @ 42 NONAME ; public: class TPtrC16  __thiscall CSmsNumber::Address(void)const 
-	?Name@CSmsNumber@@QBE?AVTPtrC16@@XZ @ 43 NONAME ; public: class TPtrC16  __thiscall CSmsNumber::Name(void)const 
-	?SetAddressL@CSmsNumber@@QAEXABVTDesC16@@@Z @ 44 NONAME ; public: void __thiscall CSmsNumber::SetAddressL(class TDesC16 const &)
-	?SetNameL@CSmsNumber@@QAEXABVTDesC16@@@Z @ 45 NONAME ; public: void __thiscall CSmsNumber::SetNameL(class TDesC16 const &)
-	?CreateMessageL@CSmsClientMtm@@UAEXJ@Z @ 46 NONAME ; public: virtual void __thiscall CSmsClientMtm::CreateMessageL(long)
-	?ServiceIdL@TSmsUtilities@@SAXAAVCMsvSession@@AAJVTUid@@PAVCMsvEntrySelection@@@Z @ 47 NONAME ; public: static void __cdecl TSmsUtilities::ServiceIdL(class CMsvSession &,long &,class TUid,class CMsvEntrySelection *)
-	?RestoreSimParamsL@CSmsSimParamOperation@@SAXAAVCMsvStore@@AAVCMobilePhoneSmspList@@@Z @ 48 NONAME ; public: static void __cdecl CSmsSimParamOperation::RestoreSimParamsL(class CMsvStore &,class CMobilePhoneSmspList &)
-	?StoreSimParamsL@CSmsSimParamOperation@@SAXAAVCMsvStore@@ABVCMobilePhoneSmspList@@@Z @ 49 NONAME ; public: static void __cdecl CSmsSimParamOperation::StoreSimParamsL(class CMsvStore &,class CMobilePhoneSmspList const &)
-	?WriteSimParamsL@CSmsClientMtm@@QAEPAVCSmsSimParamOperation@@ABVCMobilePhoneSmspList@@AAVTRequestStatus@@@Z @ 50 NONAME ; public: class CSmsSimParamOperation * __thiscall CSmsClientMtm::WriteSimParamsL(class CMobilePhoneSmspList const &,class TRequestStatus &)
-	?SaveExternalL@CSmsSettings@@QAEXAAVCMsvStore@@@Z @ 51 NONAME ; void CSmsSettings::SaveExternalL(class CMsvStore &)
-	?OpenResourceFileL@TSmsUtilities@@SA?AVRResourceFile@@AAVRFs@@@Z @ 52 NONAME ; public: static class RResourceFile  __cdecl TSmsUtilities::OpenResourceFileL(class RFs &)
-	?ReadResourceStringL@TSmsUtilities@@SAXVRResourceFile@@HAAVTDes16@@@Z @ 53 NONAME ; public: static void __cdecl TSmsUtilities::ReadResourceStringL(class RResourceFile,int,class TDes16 &)
-	?AckStatus@CSmsNumber@@QBE?AW4TSmsAckStatus@1@W4TSmsAckType@@@Z @ 54 NONAME ; enum CSmsNumber::TSmsAckStatus CSmsNumber::AckStatus(enum TSmsAckType) const
-	?AckSummary@TMsvSmsEntry@@QBE?AW4TMsvSmsEntryAckSummary@1@W4TSmsAckType@@@Z @ 55 NONAME ; enum TMsvSmsEntry::TMsvSmsEntryAckSummary TMsvSmsEntry::AckSummary(enum TSmsAckType) const
-	?MessageId@TMsvSmsEntry@@QBEHAAJ@Z @ 56 NONAME ; int TMsvSmsEntry::MessageId(long &) const
-	?SetAckStatus@CSmsNumber@@QAEXW4TSmsAckType@@W4TSmsAckStatus@1@@Z @ 57 NONAME ; void CSmsNumber::SetAckStatus(enum TSmsAckType, enum CSmsNumber::TSmsAckStatus)
-	?SetAckSummary@TMsvSmsEntry@@QAEXW4TSmsAckType@@W4TMsvSmsEntryAckSummary@1@@Z @ 58 NONAME ; void TMsvSmsEntry::SetAckSummary(enum TSmsAckType, enum TMsvSmsEntry::TMsvSmsEntryAckSummary)
-	?SetMessageId@TMsvSmsEntry@@QAEXJH@Z @ 59 NONAME ; void TMsvSmsEntry::SetMessageId(long, int)
-	??1CSmsEmailFields@@UAE@XZ @ 60 NONAME ; CSmsEmailFields::~CSmsEmailFields(void)
-	?AddAddressL@CSmsEmailFields@@QAEXABVTDesC16@@@Z @ 61 NONAME ; void CSmsEmailFields::AddAddressL(class TDesC16 const &)
-	?Addresses@CSmsEmailFields@@QBEABVMDesC16Array@@XZ @ 62 NONAME ; class MDesC16Array const & CSmsEmailFields::Addresses(void) const
-	?ComposeLC@CSmsEmailFields@@QBEPAVHBufC16@@XZ @ 63 NONAME ; class HBufC16 * CSmsEmailFields::ComposeLC(void) const
-	?EmailFields@CSmsHeader@@QBEABVCSmsEmailFields@@XZ @ 64 NONAME ; class CSmsEmailFields const & CSmsHeader::EmailFields(void) const
-	?HasAddress@CSmsEmailFields@@QBEHXZ @ 65 NONAME ; int CSmsEmailFields::HasAddress(void) const
-	?Length@CSmsEmailFields@@QBEHXZ @ 66 NONAME ; int CSmsEmailFields::Length(void) const
-	?NewL@CSmsEmailFields@@SAPAV1@ABV1@@Z @ 67 NONAME ; class CSmsEmailFields * CSmsEmailFields::NewL(class CSmsEmailFields const &)
-	?NewL@CSmsEmailFields@@SAPAV1@XZ @ 68 NONAME ; class CSmsEmailFields * CSmsEmailFields::NewL(void)
-	?RemoveAddress@CSmsEmailFields@@QAEXH@Z @ 69 NONAME ; void CSmsEmailFields::RemoveAddress(int)
-	?Reset@CSmsEmailFields@@QAEXXZ @ 70 NONAME ; void CSmsEmailFields::Reset(void)
-	?SetEmailFieldsL@CSmsHeader@@QAEXABVCSmsEmailFields@@@Z @ 71 NONAME ; void CSmsHeader::SetEmailFieldsL(class CSmsEmailFields const &)
-	?SetSubjectL@CSmsEmailFields@@QAEXABVTDesC16@@@Z @ 72 NONAME ; void CSmsEmailFields::SetSubjectL(class TDesC16 const &)
-	?Subject@CSmsEmailFields@@QBEABVTDesC16@@XZ @ 73 NONAME ; class TDesC16 const & CSmsEmailFields::Subject(void) const
-
--- a/messagingappbase/smsmtm/clientmtm/bwins/V1.5_SMCMU.DEF	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,263 +0,0 @@
-EXPORTS
-	?NewL@CSmsClientMtm@@SAPAV1@AAVCRegisteredMtmDll@@AAVCMsvSession@@@Z @ 1 NONAME ; public: static class CSmsClientMtm * __cdecl CSmsClientMtm::NewL(class CRegisteredMtmDll &,class CMsvSession &)
-	?Dummy_Export_1@TSmsUtilities@@QAEXXZ @ 2 NONAME ; public: void __thiscall TSmsUtilities::Dummy_Export_1(void)
-	??1CSmsHeader@@UAE@XZ @ 3 NONAME ; public: virtual __thiscall CSmsHeader::~CSmsHeader(void)
-	??1CSmsNumber@@UAE@XZ @ 4 NONAME ; public: virtual __thiscall CSmsNumber::~CSmsNumber(void)
-	??1CSmsSettings@@UAE@XZ @ 5 NONAME ; public: virtual __thiscall CSmsSettings::~CSmsSettings(void)
-	?Dummy_Export_2@TSmsUtilities@@QAEXXZ @ 6 NONAME ; public: void __thiscall TSmsUtilities::Dummy_Export_2(void)
-	?AddSCAddressL@CSmsSettings@@QAEXABVTDesC16@@0@Z @ 7 NONAME ; public: void __thiscall CSmsSettings::AddSCAddressL(class TDesC16 const &,class TDesC16 const &)
-	?BioTypeChangedL@CSmsClientMtm@@UAEXVTUid@@@Z @ 8 NONAME ; public: virtual void __thiscall CSmsClientMtm::BioTypeChangedL(class TUid)
-	?CopyL@CSmsMessageSettings@@UAEXABV1@@Z @ 9 NONAME ; public: virtual void __thiscall CSmsMessageSettings::CopyL(class CSmsMessageSettings const &)
-	?CopyL@CSmsNumber@@QAEAAV1@ABV1@@Z @ 10 NONAME ; public: class CSmsNumber & __thiscall CSmsNumber::CopyL(class CSmsNumber const &)
-	?CopyL@CSmsSettings@@QAEXABV1@@Z @ 11 NONAME ; public: void __thiscall CSmsSettings::CopyL(class CSmsSettings const &)
-	?ExternalizeL@CSmsHeader@@QBEXAAVRMsvWriteStream@@@Z @ 12 NONAME ; public: void __thiscall CSmsHeader::ExternalizeL(class RMsvWriteStream &)const 
-	?ExternalizeL@CSmsMessageSettings@@UBEXAAVRWriteStream@@@Z @ 13 NONAME ; public: virtual void __thiscall CSmsMessageSettings::ExternalizeL(class RMsvWriteStream &)const 
-	?ExternalizeL@CSmsNumber@@UBEXAAVRWriteStream@@@Z @ 14 NONAME ; public: virtual void __thiscall CSmsNumber::ExternalizeL(class RWriteStream &)const 
-	?ExternalizeL@CSmsSettings@@UBEXAAVRWriteStream@@@Z @ 15 NONAME ; public: virtual void __thiscall CSmsSettings::ExternalizeL(class RMsvWriteStream &)const 
-	?GetDescription@TSmsUtilities@@SAHABVCSmsMessage@@AAVTDes16@@H@Z @ 16 NONAME ; public: static int __cdecl TSmsUtilities::GetDescription(class CSmsMessage const &,class TDes16 &,int)
-	?GetDetails@TSmsUtilities@@SAHAAVRFs@@ABVCSmsMessage@@AAVTDes16@@H@Z @ 17 NONAME ; public: static int __cdecl TSmsUtilities::GetDetails(class RFs &,class CSmsMessage const &,class TDes16 &,int)
-	?GetDetails@TSmsUtilities@@SAHAAVRFs@@ABVTDesC16@@AAVTDes16@@H@Z @ 18 NONAME ; public: static int __cdecl TSmsUtilities::GetDetails(class RFs &,class TDesC16 const &,class TDes16 &,int)
-	?GetSmsSettingsL@CSmsHeader@@QBEXAAVCSmsMessageSettings@@@Z @ 19 NONAME ; public: void __thiscall CSmsHeader::GetSmsSettingsL(class CSmsMessageSettings &)const 
-	?InternalizeL@CSmsHeader@@QAEXAAVRMsvReadStream@@@Z @ 20 NONAME ; public: void __thiscall CSmsHeader::InternalizeL(class RMsvReadStream &)
-	?InternalizeL@CSmsMessageSettings@@UAEXAAVRReadStream@@@Z @ 21 NONAME ; public: virtual void __thiscall CSmsMessageSettings::InternalizeL(class RMsvReadStream &)
-	?InternalizeL@CSmsNumber@@UAEXAAVRReadStream@@@Z @ 22 NONAME ; public: virtual void __thiscall CSmsNumber::InternalizeL(class RReadStream &)
-	?InternalizeL@CSmsSettings@@UAEXAAVRReadStream@@@Z @ 23 NONAME ; public: virtual void __thiscall CSmsSettings::InternalizeL(class RMsvReadStream &)
-	?NewL@CSmsHeader@@SAPAV1@PAVCSmsMessage@@@Z @ 24 NONAME ; public: static class CSmsHeader * __cdecl CSmsHeader::NewL(class CSmsMessage *)
-	?NewL@CSmsHeader@@SAPAV1@W4TSmsPDUType@CSmsPDU@@AAVCEditableText@@@Z @ 25 NONAME ; public: static class CSmsHeader * __cdecl CSmsHeader::NewL(enum CSmsPDU::TSmsPDUType,class CEditableText &)
-	?NewL@CSmsNumber@@SAPAV1@ABV1@@Z @ 26 NONAME ; public: static class CSmsNumber * __cdecl CSmsNumber::NewL(class CSmsNumber const &)
-	?NewL@CSmsNumber@@SAPAV1@XZ @ 27 NONAME ; public: static class CSmsNumber * __cdecl CSmsNumber::NewL(void)
-	?NewL@CSmsSettings@@SAPAV1@XZ @ 28 NONAME ; public: static class CSmsSettings * __cdecl CSmsSettings::NewL(void)
-	?PopulateMsgEntry@TSmsUtilities@@SAXAAVTMsvEntry@@ABVCSmsMessage@@JVTUid@@@Z @ 29 NONAME ; public: static void __cdecl TSmsUtilities::PopulateMsgEntry(class TMsvEntry &,class CSmsMessage const &,long,class TUid)
-	?RemoveSCAddress@CSmsSettings@@QAEXH@Z @ 30 NONAME ; public: void __thiscall CSmsSettings::RemoveSCAddress(int)
-	?RestoreL@CSmsHeader@@QAEXAAVCMsvStore@@@Z @ 31 NONAME ; public: void __thiscall CSmsHeader::RestoreL(class CMsvStore &)
-	?RestoreL@CSmsSettings@@QAEXAAVCMsvStore@@@Z @ 32 NONAME ; public: void __thiscall CSmsSettings::RestoreL(class CMsvStore &)
-	?RestoreServiceAndSettingsL@CSmsClientMtm@@QAEXXZ @ 33 NONAME ; public: void __thiscall CSmsClientMtm::RestoreServiceAndSettingsL(void)
-	?ServiceIdL@TSmsUtilities@@SAXAAVCMsvEntry@@AAJVTUid@@PAVCMsvEntrySelection@@@Z @ 34 NONAME ; public: static void __cdecl TSmsUtilities::ServiceIdL(class CMsvEntry &,long &,class TUid,class CMsvEntrySelection *)
-	?ServiceIdL@TSmsUtilities@@SAXAAVCMsvServerEntry@@AAJVTUid@@PAVCMsvEntrySelection@@@Z @ 35 NONAME ; public: static void __cdecl TSmsUtilities::ServiceIdL(class CMsvServerEntry &,long &,class TUid,class CMsvEntrySelection *)
-	?SetSmsSettingsL@CSmsHeader@@QAEXABVCSmsMessageSettings@@@Z @ 36 NONAME ; public: void __thiscall CSmsHeader::SetSmsSettingsL(class CSmsMessageSettings const &)
-	?StoreL@CSmsHeader@@QBEXAAVCMsvStore@@@Z @ 37 NONAME ; public: void __thiscall CSmsHeader::StoreL(class CMsvStore &)const 
-	?StoreL@CSmsSettings@@QBEXAAVCMsvStore@@@Z @ 38 NONAME ; public: void __thiscall CSmsSettings::StoreL(class CMsvStore &)const 
-	?ProgressL@CSmsSimParamOperation@@UAEABVTDesC8@@XZ @ 39 NONAME ; public: virtual class TDesC8 const & __thiscall CSmsSimParamOperation::ProgressL(void)
-	?ReadSimParamsL@CSmsClientMtm@@QAEPAVCSmsSimParamOperation@@AAVTRequestStatus@@@Z @ 40 NONAME ; public: class CSmsSimParamOperation * __thiscall CSmsClientMtm::ReadSimParamsL(class TRequestStatus &)
-	?ServiceCentersLC@CSmsSimParamOperation@@QBEPAVCMobilePhoneSmspList@@XZ @ 41 NONAME ; public: class CMobilePhoneSmspList * __thiscall CSmsSimParamOperation::ServiceCentersLC(void)const 
-	?Address@CSmsNumber@@QBE?AVTPtrC16@@XZ @ 42 NONAME ; public: class TPtrC16  __thiscall CSmsNumber::Address(void)const 
-	?Name@CSmsNumber@@QBE?AVTPtrC16@@XZ @ 43 NONAME ; public: class TPtrC16  __thiscall CSmsNumber::Name(void)const 
-	?SetAddressL@CSmsNumber@@QAEXABVTDesC16@@@Z @ 44 NONAME ; public: void __thiscall CSmsNumber::SetAddressL(class TDesC16 const &)
-	?SetNameL@CSmsNumber@@QAEXABVTDesC16@@@Z @ 45 NONAME ; public: void __thiscall CSmsNumber::SetNameL(class TDesC16 const &)
-	?CreateMessageL@CSmsClientMtm@@UAEXJ@Z @ 46 NONAME ; public: virtual void __thiscall CSmsClientMtm::CreateMessageL(long)
-	?ServiceIdL@TSmsUtilities@@SAXAAVCMsvSession@@AAJVTUid@@PAVCMsvEntrySelection@@@Z @ 47 NONAME ; public: static void __cdecl TSmsUtilities::ServiceIdL(class CMsvSession &,long &,class TUid,class CMsvEntrySelection *)
-	?RestoreSimParamsL@CSmsSimParamOperation@@SAXAAVCMsvStore@@AAVCMobilePhoneSmspList@@@Z @ 48 NONAME ; public: static void __cdecl CSmsSimParamOperation::RestoreSimParamsL(class CMsvStore &,class CMobilePhoneSmspList &)
-	?StoreSimParamsL@CSmsSimParamOperation@@SAXAAVCMsvStore@@ABVCMobilePhoneSmspList@@@Z @ 49 NONAME ; public: static void __cdecl CSmsSimParamOperation::StoreSimParamsL(class CMsvStore &,class CMobilePhoneSmspList const &)
-	?WriteSimParamsL@CSmsClientMtm@@QAEPAVCSmsSimParamOperation@@ABVCMobilePhoneSmspList@@AAVTRequestStatus@@@Z @ 50 NONAME ; public: class CSmsSimParamOperation * __thiscall CSmsClientMtm::WriteSimParamsL(class CMobilePhoneSmspList const &,class TRequestStatus &)
-	?SaveExternalL@CSmsSettings@@QAEXAAVCMsvStore@@@Z @ 51 NONAME ; void CSmsSettings::SaveExternalL(class CMsvStore &)
-	?OpenResourceFileL@TSmsUtilities@@SA?AVRResourceFile@@AAVRFs@@@Z @ 52 NONAME ; public: static class RResourceFile  __cdecl TSmsUtilities::OpenResourceFileL(class RFs &)
-	?ReadResourceStringL@TSmsUtilities@@SAXVRResourceFile@@HAAVTDes16@@@Z @ 53 NONAME ; public: static void __cdecl TSmsUtilities::ReadResourceStringL(class RResourceFile,int,class TDes16 &)
-	?AckStatus@CSmsNumber@@QBE?AW4TSmsAckStatus@1@W4TSmsAckType@@@Z @ 54 NONAME ; enum CSmsNumber::TSmsAckStatus CSmsNumber::AckStatus(enum TSmsAckType) const
-	?AckSummary@TMsvSmsEntry@@QBE?AW4TMsvSmsEntryAckSummary@1@W4TSmsAckType@@@Z @ 55 NONAME ; enum TMsvSmsEntry::TMsvSmsEntryAckSummary TMsvSmsEntry::AckSummary(enum TSmsAckType) const
-	?MessageId@TMsvSmsEntry@@QBEHAAJ@Z @ 56 NONAME ; int TMsvSmsEntry::MessageId(long &) const
-	?SetAckStatus@CSmsNumber@@QAEXW4TSmsAckType@@W4TSmsAckStatus@1@@Z @ 57 NONAME ; void CSmsNumber::SetAckStatus(enum TSmsAckType, enum CSmsNumber::TSmsAckStatus)
-	?SetAckSummary@TMsvSmsEntry@@QAEXW4TSmsAckType@@W4TMsvSmsEntryAckSummary@1@@Z @ 58 NONAME ; void TMsvSmsEntry::SetAckSummary(enum TSmsAckType, enum TMsvSmsEntry::TMsvSmsEntryAckSummary)
-	?SetMessageId@TMsvSmsEntry@@QAEXJH@Z @ 59 NONAME ; void TMsvSmsEntry::SetMessageId(long, int)
-	??1CSmsEmailFields@@UAE@XZ @ 60 NONAME ; CSmsEmailFields::~CSmsEmailFields(void)
-	?AddAddressL@CSmsEmailFields@@QAEXABVTDesC16@@@Z @ 61 NONAME ; void CSmsEmailFields::AddAddressL(class TDesC16 const &)
-	?Addresses@CSmsEmailFields@@QBEABVMDesC16Array@@XZ @ 62 NONAME ; class MDesC16Array const & CSmsEmailFields::Addresses(void) const
-	?ComposeLC@CSmsEmailFields@@QBEPAVHBufC16@@XZ @ 63 NONAME ; class HBufC16 * CSmsEmailFields::ComposeLC(void) const
-	?EmailFields@CSmsHeader@@QBEABVCSmsEmailFields@@XZ @ 64 NONAME ; class CSmsEmailFields const & CSmsHeader::EmailFields(void) const
-	?HasAddress@CSmsEmailFields@@QBEHXZ @ 65 NONAME ; int CSmsEmailFields::HasAddress(void) const
-	?Length@CSmsEmailFields@@QBEHXZ @ 66 NONAME ; int CSmsEmailFields::Length(void) const
-	?NewL@CSmsEmailFields@@SAPAV1@ABV1@@Z @ 67 NONAME ; class CSmsEmailFields * CSmsEmailFields::NewL(class CSmsEmailFields const &)
-	?NewL@CSmsEmailFields@@SAPAV1@XZ @ 68 NONAME ; class CSmsEmailFields * CSmsEmailFields::NewL(void)
-	?RemoveAddress@CSmsEmailFields@@QAEXH@Z @ 69 NONAME ; void CSmsEmailFields::RemoveAddress(int)
-	?Reset@CSmsEmailFields@@QAEXXZ @ 70 NONAME ; void CSmsEmailFields::Reset(void)
-	?SetEmailFieldsL@CSmsHeader@@QAEXABVCSmsEmailFields@@@Z @ 71 NONAME ; void CSmsHeader::SetEmailFieldsL(class CSmsEmailFields const &)
-	?SetSubjectL@CSmsEmailFields@@QAEXABVTDesC16@@@Z @ 72 NONAME ; void CSmsEmailFields::SetSubjectL(class TDesC16 const &)
-	?Subject@CSmsEmailFields@@QBEABVTDesC16@@XZ @ 73 NONAME ; class TDesC16 const & CSmsEmailFields::Subject(void) const
-	??0TMsvSmsSimOperationParams@@QAE@JW4TMsvSmsStorage@@@Z @ 74 NONAME ABSENT ; TMsvSmsSimOperationParams::TMsvSmsSimOperationParams(long, enum TMsvSmsStorage)
-	??0TMsvSmsSimOperationParams@@QAE@XZ @ 75 NONAME ABSENT ; TMsvSmsSimOperationParams::TMsvSmsSimOperationParams(void)
-	??0TSmsCdmaEndPointInfo@@QAE@XZ @ 76 NONAME ABSENT ; TSmsCdmaEndPointInfo::TSmsCdmaEndPointInfo(void)
-	??0TSmsReplyOptions@@QAE@HHHH@Z @ 77 NONAME ABSENT ; TSmsReplyOptions::TSmsReplyOptions(int, int, int, int)
-	??0TSmsReplyOptions@@QAE@XZ @ 78 NONAME ABSENT ; TSmsReplyOptions::TSmsReplyOptions(void)
-	?AbsoluteValidityPeriod@CSmsMessageSettingsProxy@@QBE?AVTDateTime@@XZ @ 79 NONAME ABSENT ; class TDateTime CSmsMessageSettingsProxy::AbsoluteValidityPeriod(void) const
-	?AcknowledgementRequested@CSmsHeader@@QBEHW4TSmsAckType@@@Z @ 80 NONAME ABSENT ; int CSmsHeader::AcknowledgementRequested(enum TSmsAckType) const
-	?ActivateMessageSetting@TSmsMessageSettingsCdma@@QAEXEH@Z @ 81 NONAME ABSENT ; void TSmsMessageSettingsCdma::ActivateMessageSetting(unsigned char, int)
-	?AddEMSInformationElementL@TMsvMessageSms@@QAEXABVCEmsInformationElement@@@Z @ 82 NONAME ABSENT ; void TMsvMessageSms::AddEMSInformationElementL(class CEmsInformationElement const &)
-	?AddressType@CSmsNumber@@QBE?AW4TMsvAddressType@@XZ @ 83 NONAME ABSENT ; enum TMsvAddressType CSmsNumber::AddressType(void) const
-	?AddressType@TMsvMessageBio@@QBE?AW4TMsvAddressType@@XZ @ 84 NONAME ABSENT ; enum TMsvAddressType TMsvMessageBio::AddressType(void) const
-	?AlertOnDelivery@CSmsSettings@@QBEEXZ @ 85 NONAME ABSENT ; unsigned char CSmsSettings::AlertOnDelivery(void) const
-	?AlertOnDelivery@TSmsMessageSettingsCdma@@QBEEXZ @ 86 NONAME ABSENT ; unsigned char TSmsMessageSettingsCdma::AlertOnDelivery(void) const
-	?BioMessage@CSmsHeader@@QAEAAVTMsvMessageBio@@XZ @ 87 NONAME ABSENT ; class TMsvMessageBio & CSmsHeader::BioMessage(void)
-	?BioMessage@CSmsHeader@@QBEABVTMsvMessageBio@@XZ @ 88 NONAME ABSENT ; class TMsvMessageBio const & CSmsHeader::BioMessage(void) const
-	?BioMsgIdType@TMsvMessageBio@@QBE?AW4TBioMsgIdType@@XZ @ 89 NONAME ABSENT ; enum TBioMsgIdType TMsvMessageBio::BioMsgIdType(void) const
-	?CallBackNumber@TSmsMessageSettingsCdma@@QBE?AVTPtrC16@@XZ @ 90 NONAME ABSENT ; class TPtrC16 TSmsMessageSettingsCdma::CallBackNumber(void) const
-	?CanConcatenate@TSmsMessageSettingsGsm@@QBEHXZ @ 91 NONAME ABSENT ; int TSmsMessageSettingsGsm::CanConcatenate(void) const
-	?Cdma@CSmsMessageSettingsProxy@@QAEAAVTSmsMessageSettingsCdma@@XZ @ 92 NONAME ABSENT ; class TSmsMessageSettingsCdma & CSmsMessageSettingsProxy::Cdma(void)
-	?Cdma@CSmsMessageSettingsProxy@@QBEABVTSmsMessageSettingsCdma@@XZ @ 93 NONAME ABSENT ; class TSmsMessageSettingsCdma const & CSmsMessageSettingsProxy::Cdma(void) const
-	?CdmaMessage@CSmsHeader@@QAEAAVTMsvMessageCdma@@XZ @ 94 NONAME ABSENT ; class TMsvMessageCdma & CSmsHeader::CdmaMessage(void)
-	?CdmaMessage@CSmsHeader@@QBEABVTMsvMessageCdma@@XZ @ 95 NONAME ABSENT ; class TMsvMessageCdma const & CSmsHeader::CdmaMessage(void) const
-	?Class@TSmsErrorExtractionCdma@@SAEH@Z @ 96 NONAME ABSENT ; unsigned char TSmsErrorExtractionCdma::Class(int)
-	?Code@TSmsErrorExtractionCdma@@SAEH@Z @ 97 NONAME ABSENT ; unsigned char TSmsErrorExtractionCdma::Code(int)
-	?ConvertAddressTypeFromCdma@TSmsUtilities@@SA?AW4TMsvAddressType@@EE@Z @ 98 NONAME ABSENT ; enum TMsvAddressType TSmsUtilities::ConvertAddressTypeFromCdma(unsigned char, unsigned char)
-	?ConvertAddressTypeToCdma@TSmsUtilities@@SAXW4TMsvAddressType@@AAVTSmsCdmaEndPointInfo@@@Z @ 99 NONAME ABSENT ; void TSmsUtilities::ConvertAddressTypeToCdma(enum TMsvAddressType, class TSmsCdmaEndPointInfo &)
-	?ConvertCdmaToRelativeTime@TSmsUtilities@@SAHEAAW4TSmsRelativeTimeUnit@@AAK@Z @ 100 NONAME ABSENT ; int TSmsUtilities::ConvertCdmaToRelativeTime(unsigned char, enum TSmsRelativeTimeUnit &, unsigned long &)
-	?ConvertCharacterEncodingToCdmaL@TSmsUtilities@@SAEG@Z @ 101 NONAME ABSENT ; unsigned char TSmsUtilities::ConvertCharacterEncodingToCdmaL(unsigned short)
-	?ConvertCharacterEncodingToGsmL@TSmsUtilities@@SA?AW4TSmsAlphabet@TSmsDataCodingScheme@@G@Z @ 102 NONAME ABSENT ; enum TSmsDataCodingScheme::TSmsAlphabet TSmsUtilities::ConvertCharacterEncodingToGsmL(unsigned short)
-	?ConvertFromMinutes@TSmsUtilities@@SAHAAW4TSmsRelativeTimeUnit@@AAKH@Z @ 103 NONAME ABSENT ; int TSmsUtilities::ConvertFromMinutes(enum TSmsRelativeTimeUnit &, unsigned long &, int)
-	?ConvertMinutesToCdma@TSmsUtilities@@SAHHAAE@Z @ 104 NONAME ABSENT ; int TSmsUtilities::ConvertMinutesToCdma(int, unsigned char &)
-	?ConvertRelativeTimeToCdma@TSmsUtilities@@SAHAAEW4TSmsRelativeTimeUnit@@K@Z @ 105 NONAME ABSENT ; int TSmsUtilities::ConvertRelativeTimeToCdma(unsigned char &, enum TSmsRelativeTimeUnit, unsigned long)
-	?ConvertToMinutes@TSmsUtilities@@SAHW4TSmsRelativeTimeUnit@@KAAH@Z @ 106 NONAME ABSENT ; int TSmsUtilities::ConvertToMinutes(enum TSmsRelativeTimeUnit, unsigned long, int &)
-	?DefaultTeleservice@CSmsSettings@@QBEGXZ @ 107 NONAME ABSENT ; unsigned short CSmsSettings::DefaultTeleservice(void) const
-	?DeliveryAck@TSmsReplyOptions@@QBEHXZ @ 108 NONAME ABSENT ; int TSmsReplyOptions::DeliveryAck(void) const
-	?DeliveryTimeFormat@TMsvMessageCdma@@QBE?AW4TSmsTimePeriodFormat@@XZ @ 109 NONAME ABSENT ; enum TSmsTimePeriodFormat TMsvMessageCdma::DeliveryTimeFormat(void) const
-	?DigitMode@CSmsSettings@@QBE?AW4TSmsCdmaDigitMode@@XZ @ 110 NONAME ABSENT ; enum TSmsCdmaDigitMode CSmsSettings::DigitMode(void) const
-	?EMailGatewayNumber@CSmsSettings@@QBE?AVTPtrC16@@XZ @ 111 NONAME ABSENT ; class TPtrC16 CSmsSettings::EMailGatewayNumber(void) const
-	?Encoding@CSmsMessageSettingsProxy@@QBEGXZ @ 112 NONAME ABSENT ; unsigned short CSmsMessageSettingsProxy::Encoding(void) const
-	?Encoding@TMsvMessageBio@@QBEGXZ @ 113 NONAME ABSENT ; unsigned short TMsvMessageBio::Encoding(void) const
-	?FindRecipient@CSmsHeader@@QBEHABVTDesC16@@AAPAVCSmsNumber@@@Z @ 114 NONAME ABSENT ; int CSmsHeader::FindRecipient(class TDesC16 const &, class CSmsNumber * &) const
-	?FindRecipient@CSmsHeader@@QBEHHAAPAVCSmsNumber@@@Z @ 115 NONAME ABSENT ; int CSmsHeader::FindRecipient(int, class CSmsNumber * &) const
-	?Folder@TMsvSmsSimOperationParams@@QBEJXZ @ 116 NONAME ABSENT ; long TMsvSmsSimOperationParams::Folder(void) const
-	?GenerateCdmaMessageL@TSmsGenerator@@CAPAVCCdmaSmsMessage@@AAVCSmsHeader@@ABVCRichText@@@Z @ 117 NONAME ABSENT ; class CCdmaSmsMessage * TSmsGenerator::GenerateCdmaMessageL(class CSmsHeader &, class CRichText const &)
-	?GenerateGsmMessageL@TSmsGenerator@@CAPAVCSmsMessage@@AAVCSmsHeader@@ABVCRichText@@@Z @ 118 NONAME ABSENT ; class CSmsMessage * TSmsGenerator::GenerateGsmMessageL(class CSmsHeader &, class CRichText const &)
-	?GetAlertOnDeliveryL@TMsvMessageCdma@@QBEHAAE@Z @ 119 NONAME ABSENT ; int TMsvMessageCdma::GetAlertOnDeliveryL(unsigned char &) const
-	?GetCallbackNumberL@TMsvMessageCdma@@QBEPAVHBufC16@@XZ @ 120 NONAME ABSENT ; class HBufC16 * TMsvMessageCdma::GetCallbackNumberL(void) const
-	?GetCdmaMessageTypeL@TSmsUtilities@@SAEGW4TSmsMessageBearing@@@Z @ 121 NONAME ABSENT ; unsigned char TSmsUtilities::GetCdmaMessageTypeL(unsigned short, enum TSmsMessageBearing)
-	?GetClass@TMsvMessageGsm@@QBEHAAHAAW4TMsvSmsGsmClass@@@Z @ 122 NONAME ABSENT ; int TMsvMessageGsm::GetClass(int &, enum TMsvSmsGsmClass &) const
-	?GetCommandType@TMsvMessageGsm@@QBEHAAW4TMsvSmsGsmCommand@@@Z @ 123 NONAME ABSENT ; int TMsvMessageGsm::GetCommandType(enum TMsvSmsGsmCommand &) const
-	?GetDefaultMessageSettingsL@CSmsHeader@@QBEXAAVCSmsSettings@@@Z @ 124 NONAME ABSENT ; void CSmsHeader::GetDefaultMessageSettingsL(class CSmsSettings &) const
-	?GetDeferredDeliveryTimeAbsoluteL@TMsvMessageCdma@@QAEHAAVTDateTime@@@Z @ 125 NONAME ABSENT ; int TMsvMessageCdma::GetDeferredDeliveryTimeAbsoluteL(class TDateTime &)
-	?GetDeferredDeliveryTimeRelativeL@TMsvMessageCdma@@QBEHAAW4TSmsRelativeTimeUnit@@AAK@Z @ 126 NONAME ABSENT ; int TMsvMessageCdma::GetDeferredDeliveryTimeRelativeL(enum TSmsRelativeTimeUnit &, unsigned long &) const
-	?GetDescriptionCdma@TSmsUtilities@@SAHAAVRFs@@ABVCCdmaSmsMessage@@AAVTDes16@@H@Z @ 127 NONAME ABSENT ; int TSmsUtilities::GetDescriptionCdma(class RFs &, class CCdmaSmsMessage const &, class TDes16 &, int)
-	?GetDetailsCdma@TSmsUtilities@@SAHAAVRFs@@ABVCCdmaSmsMessage@@AAVTDes16@@H@Z @ 128 NONAME ABSENT ; int TSmsUtilities::GetDetailsCdma(class RFs &, class CCdmaSmsMessage const &, class TDes16 &, int)
-	?GetEMSInformationElementsL@TMsvMessageSms@@QBEABV?$RPointerArray@$$CBVCEmsInformationElement@@@@XZ @ 129 NONAME ABSENT ; class RPointerArray<class CEmsInformationElement const > const & TMsvMessageSms::GetEMSInformationElementsL(void) const
-	?GetGsmMessageTypeL@TSmsUtilities@@SA?AW4TSmsPDUType@CSmsPDU@@GW4TSmsMessageBearing@@@Z @ 130 NONAME ABSENT ; enum CSmsPDU::TSmsPDUType TSmsUtilities::GetGsmMessageTypeL(unsigned short, enum TSmsMessageBearing)
-	?GetLanguageIndicatorL@TMsvMessageCdma@@QBEHAAE@Z @ 131 NONAME ABSENT ; int TMsvMessageCdma::GetLanguageIndicatorL(unsigned char &) const
-	?GetMessageDepositIndexL@TMsvMessageCdma@@QBEHAAG@Z @ 132 NONAME ABSENT ; int TMsvMessageCdma::GetMessageDepositIndexL(unsigned short &) const
-	?GetMessageDisplayModeL@TMsvMessageCdma@@QBEHAAE@Z @ 133 NONAME ABSENT ; int TMsvMessageCdma::GetMessageDisplayModeL(unsigned char &) const
-	?GetMessageServiceCenterTimeStamp@TMsvMessageSms@@QBEHAAVTDateTime@@AAH@Z @ 134 NONAME ABSENT ; int TMsvMessageSms::GetMessageServiceCenterTimeStamp(class TDateTime &, int &) const
-	?GetNumberOfMessagesL@TMsvMessageCdma@@QBEHAAE@Z @ 135 NONAME ABSENT ; int TMsvMessageCdma::GetNumberOfMessagesL(unsigned char &) const
-	?GetOriginatingSubAddressL@TMsvMessageCdma@@QBEPAVHBufC16@@XZ @ 136 NONAME ABSENT ; class HBufC16 * TMsvMessageCdma::GetOriginatingSubAddressL(void) const
-	?GetPriorityIndicatorL@TMsvMessageCdma@@QBEHAAE@Z @ 137 NONAME ABSENT ; int TMsvMessageCdma::GetPriorityIndicatorL(unsigned char &) const
-	?GetPrivacyIndicatorL@TMsvMessageCdma@@QBEHAAE@Z @ 138 NONAME ABSENT ; int TMsvMessageCdma::GetPrivacyIndicatorL(unsigned char &) const
-	?GetRejectDuplicates@TMsvMessageGsm@@QBEHAAH@Z @ 139 NONAME ABSENT ; int TMsvMessageGsm::GetRejectDuplicates(int &) const
-	?GetReplyPath@TMsvMessageGsm@@QBEHAAH@Z @ 140 NONAME ABSENT ; int TMsvMessageGsm::GetReplyPath(int &) const
-	?GetServiceCenterAddress@TMsvMessageGsm@@QBEHAAVTPtrC16@@@Z @ 141 NONAME ABSENT ; int TMsvMessageGsm::GetServiceCenterAddress(class TPtrC16 &) const
-	?GetUserResponseCodeL@TMsvMessageCdma@@QBEHAAE@Z @ 142 NONAME ABSENT ; int TMsvMessageCdma::GetUserResponseCodeL(unsigned char &) const
-	?GetValidityPeriodAbsolute@TMsvMessageSms@@QBEHAAVTDateTime@@@Z @ 143 NONAME ABSENT ; int TMsvMessageSms::GetValidityPeriodAbsolute(class TDateTime &) const
-	?GetValidityPeriodRelative@TMsvMessageSms@@QBEHAAW4TSmsRelativeTimeUnit@@AAK@Z @ 144 NONAME ABSENT ; int TMsvMessageSms::GetValidityPeriodRelative(enum TSmsRelativeTimeUnit &, unsigned long &) const
-	?Gsm@CSmsMessageSettingsProxy@@QAEAAVTSmsMessageSettingsGsm@@XZ @ 145 NONAME ABSENT ; class TSmsMessageSettingsGsm & CSmsMessageSettingsProxy::Gsm(void)
-	?Gsm@CSmsMessageSettingsProxy@@QBEABVTSmsMessageSettingsGsm@@XZ @ 146 NONAME ABSENT ; class TSmsMessageSettingsGsm const & CSmsMessageSettingsProxy::Gsm(void) const
-	?GsmMessage@CSmsHeader@@QAEAAVTMsvMessageGsm@@XZ @ 147 NONAME ABSENT ; class TMsvMessageGsm & CSmsHeader::GsmMessage(void)
-	?GsmMessage@CSmsHeader@@QBEABVTMsvMessageGsm@@XZ @ 148 NONAME ABSENT ; class TMsvMessageGsm const & CSmsHeader::GsmMessage(void) const
-	?IsMessageSettingActive@TSmsMessageSettingsCdma@@QBEHE@Z @ 149 NONAME ABSENT ; int TSmsMessageSettingsCdma::IsMessageSettingActive(unsigned char) const
-	?Language@TSmsMessageSettingsCdma@@QBEEXZ @ 150 NONAME ABSENT ; unsigned char TSmsMessageSettingsCdma::Language(void) const
-	?MessageBearing@CSmsHeader@@QBE?AW4TSmsMessageBearing@@XZ @ 151 NONAME ABSENT ; enum TSmsMessageBearing CSmsHeader::MessageBearing(void) const
-	?MessageConversion@TSmsMessageSettingsGsm@@QBE?AW4TSmsPIDConversion@@XZ @ 152 NONAME ABSENT ; enum TSmsPIDConversion TSmsMessageSettingsGsm::MessageConversion(void) const
-	?MessageDisplayMode@CSmsSettings@@QBEEXZ @ 153 NONAME ABSENT ; unsigned char CSmsSettings::MessageDisplayMode(void) const
-	?MessageId@CSmsNumber@@QBEHXZ @ 154 NONAME ABSENT ; int CSmsNumber::MessageId(void) const
-	?MessageSettings@CSmsSettings@@QAEAAVCSmsMessageSettingsProxy@@XZ @ 155 NONAME ABSENT ; class CSmsMessageSettingsProxy & CSmsSettings::MessageSettings(void)
-	?MessageSettings@CSmsSettings@@QBEABVCSmsMessageSettingsProxy@@XZ @ 156 NONAME ABSENT ; class CSmsMessageSettingsProxy const & CSmsSettings::MessageSettings(void) const
-	?MessageType@CSmsHeader@@QAEGXZ @ 157 NONAME ABSENT ; unsigned short CSmsHeader::MessageType(void)
-	?NewL@CSmsHeader@@SAPAV1@GAAVCEditableText@@@Z @ 158 NONAME ABSENT ; class CSmsHeader * CSmsHeader::NewL(unsigned short, class CEditableText &)
-	?NewL@CSmsHeader@@SAPAV1@GAAVCEditableText@@G@Z @ 159 NONAME ABSENT ; class CSmsHeader * CSmsHeader::NewL(unsigned short, class CEditableText &, unsigned short)
-	?NewL@CSmsHeader@@SAPAV1@PAVCCdmaSmsMessage@@@Z @ 160 NONAME ABSENT ; class CSmsHeader * CSmsHeader::NewL(class CCdmaSmsMessage *)
-	?OriginatingAddress@TMsvMessageBio@@QBE?AVTPtrC16@@XZ @ 161 NONAME ABSENT ; class TPtrC16 TMsvMessageBio::OriginatingAddress(void) const
-	?PopulateMsgEntryCdma@TSmsUtilities@@SAXAAVTMsvEntry@@ABVCCdmaSmsMessage@@JVTUid@@@Z @ 162 NONAME ABSENT ; void TSmsUtilities::PopulateMsgEntryCdma(class TMsvEntry &, class CCdmaSmsMessage const &, long, class TUid)
-	?PreferedLanguageList@CSmsSettings@@QAEAAV?$CArrayFixFlat@E@@XZ @ 163 NONAME ABSENT ; class CArrayFixFlat<unsigned char> & CSmsSettings::PreferedLanguageList(void)
-	?PreferedLanguageList@CSmsSettings@@QBEABV?$CArrayFixFlat@E@@XZ @ 164 NONAME ABSENT ; class CArrayFixFlat<unsigned char> const & CSmsSettings::PreferedLanguageList(void) const
-	?Priority@TSmsMessageSettingsCdma@@QBEEXZ @ 165 NONAME ABSENT ; unsigned char TSmsMessageSettingsCdma::Priority(void) const
-	?Privacy@TSmsMessageSettingsCdma@@QBEEXZ @ 166 NONAME ABSENT ; unsigned char TSmsMessageSettingsCdma::Privacy(void) const
-	?ReadAck@TSmsReplyOptions@@QBEHXZ @ 167 NONAME ABSENT ; int TSmsReplyOptions::ReadAck(void) const
-	?RejectDuplicate@TSmsMessageSettingsGsm@@QBEHXZ @ 168 NONAME ABSENT ; int TSmsMessageSettingsGsm::RejectDuplicate(void) const
-	?RelativeValidityPeriod@CSmsMessageSettingsProxy@@QBEABVTTimeIntervalMinutes@@XZ @ 169 NONAME ABSENT ; class TTimeIntervalMinutes const & CSmsMessageSettingsProxy::RelativeValidityPeriod(void) const
-	?RemoveEMSInformationElementL@TMsvMessageSms@@QAEPAVCEmsInformationElement@@IW4TSmsInformationElementIdentifier@CSmsInformationElement@@@Z @ 170 NONAME ABSENT ; class CEmsInformationElement * TMsvMessageSms::RemoveEMSInformationElementL(unsigned int, enum CSmsInformationElement::TSmsInformationElementIdentifier)
-	?RemoveEMSInformationElementsL@TMsvMessageSms@@QAEPAV?$RPointerArray@VCEmsInformationElement@@@@IW4TSmsInformationElementIdentifier@CSmsInformationElement@@@Z @ 171 NONAME ABSENT ; class RPointerArray<class CEmsInformationElement> * TMsvMessageSms::RemoveEMSInformationElementsL(unsigned int, enum CSmsInformationElement::TSmsInformationElementIdentifier)
-	?ReplyOptions@CSmsMessageSettingsProxy@@QBEABVTSmsReplyOptions@@XZ @ 172 NONAME ABSENT ; class TSmsReplyOptions const & CSmsMessageSettingsProxy::ReplyOptions(void) const
-	?ReplyPath@TSmsMessageSettingsGsm@@QBEHXZ @ 173 NONAME ABSENT ; int TSmsMessageSettingsGsm::ReplyPath(void) const
-	?ReplyWithOriginalMessage@CSmsSettings@@QBE?AW4TSmsReplyWithOriginal@@XZ @ 174 NONAME ABSENT ; enum TSmsReplyWithOriginal CSmsSettings::ReplyWithOriginalMessage(void) const
-	?ResetEMSL@TMsvMessageSms@@QAEXXZ @ 175 NONAME ABSENT ; void TMsvMessageSms::ResetEMSL(void)
-	?ResetMessageParameters@TMsvMessageCdma@@QAEXXZ @ 176 NONAME ABSENT ; void TMsvMessageCdma::ResetMessageParameters(void)
-	?ResetSIMSlots@CSmsHeader@@QAEXXZ @ 177 NONAME ABSENT ; void CSmsHeader::ResetSIMSlots(void)
-	?RestoreL@CSmsHeader@@SAPAV1@AAVCMsvStore@@AAVCEditableText@@@Z @ 178 NONAME ABSENT ; class CSmsHeader * CSmsHeader::RestoreL(class CMsvStore &, class CEditableText &)
-	?SetAbsoluteValidityPeriod@CSmsMessageSettingsProxy@@QAEXABVTDateTime@@@Z @ 179 NONAME ABSENT ; void CSmsMessageSettingsProxy::SetAbsoluteValidityPeriod(class TDateTime const &)
-	?SetAcknowledgementRequest@CSmsHeader@@QAEXW4TSmsAckType@@H@Z @ 180 NONAME ABSENT ; void CSmsHeader::SetAcknowledgementRequest(enum TSmsAckType, int)
-	?SetAddressL@CSmsNumber@@QAEXABVTDesC16@@W4TMsvAddressType@@@Z @ 181 NONAME ABSENT ; void CSmsNumber::SetAddressL(class TDesC16 const &, enum TMsvAddressType)
-	?SetAlertOnDelivery@CSmsSettings@@QAEXE@Z @ 182 NONAME ABSENT ; void CSmsSettings::SetAlertOnDelivery(unsigned char)
-	?SetAlertOnDelivery@TSmsMessageSettingsCdma@@QAEXE@Z @ 183 NONAME ABSENT ; void TSmsMessageSettingsCdma::SetAlertOnDelivery(unsigned char)
-	?SetAlertOnDeliveryL@TMsvMessageCdma@@QAEHE@Z @ 184 NONAME ABSENT ; int TMsvMessageCdma::SetAlertOnDeliveryL(unsigned char)
-	?SetBioMsgIdType@TMsvMessageBio@@QAEXW4TBioMsgIdType@@@Z @ 185 NONAME ABSENT ; void TMsvMessageBio::SetBioMsgIdType(enum TBioMsgIdType)
-	?SetCallBackNumberL@TSmsMessageSettingsCdma@@QAEXABVTDesC16@@@Z @ 186 NONAME ABSENT ; void TSmsMessageSettingsCdma::SetCallBackNumberL(class TDesC16 const &)
-	?SetCallbackNumberL@TMsvMessageCdma@@QAEHABVTDesC16@@@Z @ 187 NONAME ABSENT ; int TMsvMessageCdma::SetCallbackNumberL(class TDesC16 const &)
-	?SetCanConcatenate@TSmsMessageSettingsGsm@@QAEXH@Z @ 188 NONAME ABSENT ; void TSmsMessageSettingsGsm::SetCanConcatenate(int)
-	?SetClass@TMsvMessageGsm@@QAEHHW4TMsvSmsGsmClass@@@Z @ 189 NONAME ABSENT ; int TMsvMessageGsm::SetClass(int, enum TMsvSmsGsmClass)
-	?SetCommandType@TMsvMessageGsm@@QAEHW4TMsvSmsGsmCommand@@@Z @ 190 NONAME ABSENT ; int TMsvMessageGsm::SetCommandType(enum TMsvSmsGsmCommand)
-	?SetDefaultMessageSettingsL@CSmsHeader@@QAEXABVCSmsSettings@@@Z @ 191 NONAME ABSENT ; void CSmsHeader::SetDefaultMessageSettingsL(class CSmsSettings const &)
-	?SetDefaultTeleservice@CSmsSettings@@QAEXG@Z @ 192 NONAME ABSENT ; void CSmsSettings::SetDefaultTeleservice(unsigned short)
-	?SetDeferredDeliveryTimeAbsoluteL@TMsvMessageCdma@@QAEHABVTDateTime@@@Z @ 193 NONAME ABSENT ; int TMsvMessageCdma::SetDeferredDeliveryTimeAbsoluteL(class TDateTime const &)
-	?SetDeferredDeliveryTimeRelativeL@TMsvMessageCdma@@QAEHW4TSmsRelativeTimeUnit@@K@Z @ 194 NONAME ABSENT ; int TMsvMessageCdma::SetDeferredDeliveryTimeRelativeL(enum TSmsRelativeTimeUnit, unsigned long)
-	?SetDeliveryAck@TSmsReplyOptions@@QAEXH@Z @ 195 NONAME ABSENT ; void TSmsReplyOptions::SetDeliveryAck(int)
-	?SetDigitMode@CSmsSettings@@QAEXW4TSmsCdmaDigitMode@@@Z @ 196 NONAME ABSENT ; void CSmsSettings::SetDigitMode(enum TSmsCdmaDigitMode)
-	?SetEMailGatewayNumberL@CSmsSettings@@QAEXABVTDesC16@@@Z @ 197 NONAME ABSENT ; void CSmsSettings::SetEMailGatewayNumberL(class TDesC16 const &)
-	?SetEncoding@CSmsMessageSettingsProxy@@QAEXG@Z @ 198 NONAME ABSENT ; void CSmsMessageSettingsProxy::SetEncoding(unsigned short)
-	?SetEncoding@TMsvMessageBio@@QAEXG@Z @ 199 NONAME ABSENT ; void TMsvMessageBio::SetEncoding(unsigned short)
-	?SetFolder@TMsvSmsSimOperationParams@@QAEXJ@Z @ 200 NONAME ABSENT ; void TMsvSmsSimOperationParams::SetFolder(long)
-	?SetLanguage@TSmsMessageSettingsCdma@@QAEXE@Z @ 201 NONAME ABSENT ; void TSmsMessageSettingsCdma::SetLanguage(unsigned char)
-	?SetLanguageIndicatorL@TMsvMessageCdma@@QAEHE@Z @ 202 NONAME ABSENT ; int TMsvMessageCdma::SetLanguageIndicatorL(unsigned char)
-	?SetMessageConversion@TSmsMessageSettingsGsm@@QAEXW4TSmsPIDConversion@@@Z @ 203 NONAME ABSENT ; void TSmsMessageSettingsGsm::SetMessageConversion(enum TSmsPIDConversion)
-	?SetMessageDepositIndexL@TMsvMessageCdma@@QAEHG@Z @ 204 NONAME ABSENT ; int TMsvMessageCdma::SetMessageDepositIndexL(unsigned short)
-	?SetMessageDisplayMode@CSmsSettings@@QAEXE@Z @ 205 NONAME ABSENT ; void CSmsSettings::SetMessageDisplayMode(unsigned char)
-	?SetMessageId@CSmsNumber@@QAEXH@Z @ 206 NONAME ABSENT ; void CSmsNumber::SetMessageId(int)
-	?SetPriority@TSmsMessageSettingsCdma@@QAEXE@Z @ 207 NONAME ABSENT ; void TSmsMessageSettingsCdma::SetPriority(unsigned char)
-	?SetPriorityIndicatorL@TMsvMessageCdma@@QAEHE@Z @ 208 NONAME ABSENT ; int TMsvMessageCdma::SetPriorityIndicatorL(unsigned char)
-	?SetPrivacy@TSmsMessageSettingsCdma@@QAEXE@Z @ 209 NONAME ABSENT ; void TSmsMessageSettingsCdma::SetPrivacy(unsigned char)
-	?SetPrivacyIndicatorL@TMsvMessageCdma@@QAEHE@Z @ 210 NONAME ABSENT ; int TMsvMessageCdma::SetPrivacyIndicatorL(unsigned char)
-	?SetReadAck@TSmsReplyOptions@@QAEXH@Z @ 211 NONAME ABSENT ; void TSmsReplyOptions::SetReadAck(int)
-	?SetRejectDuplicate@TSmsMessageSettingsGsm@@QAEXH@Z @ 212 NONAME ABSENT ; void TSmsMessageSettingsGsm::SetRejectDuplicate(int)
-	?SetRejectDuplicates@TMsvMessageGsm@@QAEHH@Z @ 213 NONAME ABSENT ; int TMsvMessageGsm::SetRejectDuplicates(int)
-	?SetRelativeValidityPeriod@CSmsMessageSettingsProxy@@QAEXABVTTimeIntervalMinutes@@@Z @ 214 NONAME ABSENT ; void CSmsMessageSettingsProxy::SetRelativeValidityPeriod(class TTimeIntervalMinutes const &)
-	?SetReplyOptions@CSmsMessageSettingsProxy@@QAEXABVTSmsReplyOptions@@@Z @ 215 NONAME ABSENT ; void CSmsMessageSettingsProxy::SetReplyOptions(class TSmsReplyOptions const &)
-	?SetReplyPath@TSmsMessageSettingsGsm@@QAEXH@Z @ 216 NONAME ABSENT ; void TSmsMessageSettingsGsm::SetReplyPath(int)
-	?SetReplyPathProvided@TMsvMessageGsm@@QAEHH@Z @ 217 NONAME ABSENT ; int TMsvMessageGsm::SetReplyPathProvided(int)
-	?SetReplyWithOriginalMessage@CSmsSettings@@QAEXW4TSmsReplyWithOriginal@@@Z @ 218 NONAME ABSENT ; void CSmsSettings::SetReplyWithOriginalMessage(enum TSmsReplyWithOriginal)
-	?SetServiceCenterAddressL@TMsvMessageGsm@@QAEHABVTDesC16@@@Z @ 219 NONAME ABSENT ; int TMsvMessageGsm::SetServiceCenterAddressL(class TDesC16 const &)
-	?SetSmsStore@TMsvSmsSimOperationParams@@QAEXW4TMsvSmsStorage@@@Z @ 220 NONAME ABSENT ; void TMsvSmsSimOperationParams::SetSmsStore(enum TMsvSmsStorage)
-	?SetTransportAck@TSmsReplyOptions@@QAEXH@Z @ 221 NONAME ABSENT ; void TSmsReplyOptions::SetTransportAck(int)
-	?SetUserAck@CSmsNumber@@QAEXE@Z @ 222 NONAME ABSENT ; void CSmsNumber::SetUserAck(unsigned char)
-	?SetUserAck@TSmsReplyOptions@@QAEXH@Z @ 223 NONAME ABSENT ; void TSmsReplyOptions::SetUserAck(int)
-	?SetUserResponseCodeL@TMsvMessageCdma@@QAEHE@Z @ 224 NONAME ABSENT ; int TMsvMessageCdma::SetUserResponseCodeL(unsigned char)
-	?SetValidityPeriodAbsoluteL@TMsvMessageSms@@QAEHABVTDateTime@@@Z @ 225 NONAME ABSENT ; int TMsvMessageSms::SetValidityPeriodAbsoluteL(class TDateTime const &)
-	?SetValidityPeriodFormat@CSmsMessageSettingsProxy@@QAEXW4TSmsTimePeriodFormat@@@Z @ 226 NONAME ABSENT ; void CSmsMessageSettingsProxy::SetValidityPeriodFormat(enum TSmsTimePeriodFormat)
-	?SetValidityPeriodRelativeL@TMsvMessageSms@@QAEHW4TSmsRelativeTimeUnit@@K@Z @ 227 NONAME ABSENT ; int TMsvMessageSms::SetValidityPeriodRelativeL(enum TSmsRelativeTimeUnit, unsigned long)
-	?SmsBearer@CSmsHeader@@QBE?AW4TSmsBearers@@XZ @ 228 NONAME ABSENT ; enum TSmsBearers CSmsHeader::SmsBearer(void) const
-	?SmsMessage@CSmsHeader@@QAEAAVTMsvMessageSms@@XZ @ 229 NONAME ABSENT ; class TMsvMessageSms & CSmsHeader::SmsMessage(void)
-	?SmsMessage@CSmsHeader@@QBEABVTMsvMessageSms@@XZ @ 230 NONAME ABSENT ; class TMsvMessageSms const & CSmsHeader::SmsMessage(void) const
-	?SmsStore@TMsvSmsSimOperationParams@@QBE?AW4TMsvSmsStorage@@XZ @ 231 NONAME ABSENT ; enum TMsvSmsStorage TMsvSmsSimOperationParams::SmsStore(void) const
-	?TeleserviceId@TMsvMessageCdma@@QBEGXZ @ 232 NONAME ABSENT ; unsigned short TMsvMessageCdma::TeleserviceId(void) const
-	?TransportAck@TSmsReplyOptions@@QBEHXZ @ 233 NONAME ABSENT ; int TSmsReplyOptions::TransportAck(void) const
-	?UserAck@CSmsNumber@@QBEEXZ @ 234 NONAME ABSENT ; unsigned char CSmsNumber::UserAck(void) const
-	?UserAck@TSmsReplyOptions@@QBEHXZ @ 235 NONAME ABSENT ; int TSmsReplyOptions::UserAck(void) const
-	?ValidateAddress@CSmsNumber@@QBEHXZ @ 236 NONAME ABSENT ; int CSmsNumber::ValidateAddress(void) const
-	?ValidityPeriodFormat@CSmsMessageSettingsProxy@@QBE?AW4TSmsTimePeriodFormat@@XZ @ 237 NONAME ABSENT ; enum TSmsTimePeriodFormat CSmsMessageSettingsProxy::ValidityPeriodFormat(void) const
-	?ValidityPeriodFormat@TMsvMessageSms@@QBE?AW4TSmsTimePeriodFormat@@XZ @ 238 NONAME ABSENT ; enum TSmsTimePeriodFormat TMsvMessageSms::ValidityPeriodFormat(void) const
-	??1CSmsAccount@@UAE@XZ @ 239 NONAME ; CSmsAccount::~CSmsAccount(void)
-	??1CSmsServiceCenter@@UAE@XZ @ 240 NONAME ; CSmsServiceCenter::~CSmsServiceCenter(void)
-	?AddServiceCenterL@CSmsSettings@@QAEXABVTDesC16@@0@Z @ 241 NONAME ; void CSmsSettings::AddServiceCenterL(class TDesC16 const &, class TDesC16 const &)
-	?Address@CSmsServiceCenter@@QBE?AVTPtrC16@@XZ @ 242 NONAME ; class TPtrC16 CSmsServiceCenter::Address(void) const
-	?CopyL@CSmsServiceCenter@@QAEAAV1@ABV1@@Z @ 243 NONAME ; class CSmsServiceCenter & CSmsServiceCenter::CopyL(class CSmsServiceCenter const &)
-	?DefaultServiceCenter@CSmsSettings@@QBEHXZ @ 244 NONAME ; int CSmsSettings::DefaultServiceCenter(void) const
-	?GetServiceCenter@CSmsSettings@@QBEAAVCSmsServiceCenter@@H@Z @ 245 NONAME ; class CSmsServiceCenter & CSmsSettings::GetServiceCenter(int) const
-	?InitialiseDefaultSettingsL@CSmsAccount@@QAEXAAVCMsvScheduleSettings@@AAVCMsvOffPeakTimes@@AAVCMsvSendErrorActions@@AAVCMsvSysAgentActions@@@Z @ 246 NONAME ; void CSmsAccount::InitialiseDefaultSettingsL(class CMsvScheduleSettings &, class CMsvOffPeakTimes &, class CMsvSendErrorActions &, class CMsvSysAgentActions &)
-	?InitialiseDefaultSettingsL@CSmsAccount@@QAEXAAVCSmsSettings@@@Z @ 247 NONAME ; void CSmsAccount::InitialiseDefaultSettingsL(class CSmsSettings &)
-	?LoadSettingsL@CSmsAccount@@QAEXAAVCMsvScheduleSettings@@AAVCMsvOffPeakTimes@@AAVCMsvSendErrorActions@@AAVCMsvSysAgentActions@@@Z @ 248 NONAME ; void CSmsAccount::LoadSettingsL(class CMsvScheduleSettings &, class CMsvOffPeakTimes &, class CMsvSendErrorActions &, class CMsvSysAgentActions &)
-	?LoadSettingsL@CSmsAccount@@QAEXAAVCSmsSettings@@@Z @ 249 NONAME ; void CSmsAccount::LoadSettingsL(class CSmsSettings &)
-	?Name@CSmsServiceCenter@@QBE?AVTPtrC16@@XZ @ 250 NONAME ; class TPtrC16 CSmsServiceCenter::Name(void) const
-	?NewL@CSmsAccount@@SAPAV1@XZ @ 251 NONAME ; class CSmsAccount * CSmsAccount::NewL(void)
-	?NewL@CSmsServiceCenter@@SAPAV1@ABV1@@Z @ 252 NONAME ; class CSmsServiceCenter * CSmsServiceCenter::NewL(class CSmsServiceCenter const &)
-	?NewL@CSmsServiceCenter@@SAPAV1@XZ @ 253 NONAME ; class CSmsServiceCenter * CSmsServiceCenter::NewL(void)
-	?NewLC@CSmsAccount@@SAPAV1@XZ @ 254 NONAME ; class CSmsAccount * CSmsAccount::NewLC(void)
-	?NewLC@CSmsSettings@@SAPAV1@XZ @ 255 NONAME ; class CSmsSettings * CSmsSettings::NewLC(void)
-	?RemoveServiceCenter@CSmsSettings@@QAEXH@Z @ 256 NONAME ; void CSmsSettings::RemoveServiceCenter(int)
-	?SaveSettingsL@CSmsAccount@@QBEXABVCMsvScheduleSettings@@ABVCMsvOffPeakTimes@@ABVCMsvSendErrorActions@@ABVCMsvSysAgentActions@@@Z @ 257 NONAME ; void CSmsAccount::SaveSettingsL(class CMsvScheduleSettings const &, class CMsvOffPeakTimes const &, class CMsvSendErrorActions const &, class CMsvSysAgentActions const &) const
-	?SaveSettingsL@CSmsAccount@@QBEXABVCSmsSettings@@@Z @ 258 NONAME ; void CSmsAccount::SaveSettingsL(class CSmsSettings const &) const
-	?ServiceCenterCount@CSmsSettings@@QBEHXZ @ 259 NONAME ; int CSmsSettings::ServiceCenterCount(void) const
-	?SetAddressL@CSmsServiceCenter@@QAEXABVTDesC16@@@Z @ 260 NONAME ; void CSmsServiceCenter::SetAddressL(class TDesC16 const &)
-	?SetDefaultServiceCenter@CSmsSettings@@QAEXH@Z @ 261 NONAME ; void CSmsSettings::SetDefaultServiceCenter(int)
-	?SetNameL@CSmsServiceCenter@@QAEXABVTDesC16@@@Z @ 262 NONAME ; void CSmsServiceCenter::SetNameL(class TDesC16 const &)
--- a/messagingappbase/smsmtm/clientmtm/bwins/V2_SMCMU.DEF	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,270 +0,0 @@
-EXPORTS
-	?NewL@CSmsClientMtm@@SAPAV1@AAVCRegisteredMtmDll@@AAVCMsvSession@@@Z @ 1 NONAME ; public: static class CSmsClientMtm * __cdecl CSmsClientMtm::NewL(class CRegisteredMtmDll &,class CMsvSession &)
-	?Dummy_Export_1@TSmsUtilities@@QAEXXZ @ 2 NONAME ABSENT ; public: void __thiscall TSmsUtilities::Dummy_Export_1(void)
-	??1CSmsHeader@@UAE@XZ @ 3 NONAME ; public: virtual __thiscall CSmsHeader::~CSmsHeader(void)
-	??1CSmsNumber@@UAE@XZ @ 4 NONAME ; public: virtual __thiscall CSmsNumber::~CSmsNumber(void)
-	??1CSmsSettings@@UAE@XZ @ 5 NONAME ; public: virtual __thiscall CSmsSettings::~CSmsSettings(void)
-	?Dummy_Export_2@TSmsUtilities@@QAEXXZ @ 6 NONAME ABSENT ; public: void __thiscall TSmsUtilities::Dummy_Export_2(void)
-	?AddSCAddressL@CSmsSettings@@QAEXABVTDesC16@@0@Z @ 7 NONAME ABSENT ; public: void __thiscall CSmsSettings::AddSCAddressL(class TDesC16 const &,class TDesC16 const &)
-	?BioTypeChangedL@CSmsClientMtm@@UAEXVTUid@@@Z @ 8 NONAME ; public: virtual void __thiscall CSmsClientMtm::BioTypeChangedL(class TUid)
-	?CopyL@CSmsMessageSettings@@UAEXABV1@@Z @ 9 NONAME ; public: virtual void __thiscall CSmsMessageSettings::CopyL(class CSmsMessageSettings const &)
-	?CopyL@CSmsNumber@@QAEAAV1@ABV1@@Z @ 10 NONAME ; public: class CSmsNumber & __thiscall CSmsNumber::CopyL(class CSmsNumber const &)
-	?CopyL@CSmsSettings@@QAEXABV1@@Z @ 11 NONAME ; public: void __thiscall CSmsSettings::CopyL(class CSmsSettings const &)
-	?ExternalizeL@CSmsHeader@@QBEXAAVRMsvWriteStream@@@Z @ 12 NONAME ; public: void __thiscall CSmsHeader::ExternalizeL(class RMsvWriteStream &)const 
-	?ExternalizeL@CSmsMessageSettings@@UBEXAAVRWriteStream@@@Z @ 13 NONAME ; public: virtual void __thiscall CSmsMessageSettings::ExternalizeL(class RMsvWriteStream &)const 
-	?ExternalizeL@CSmsNumber@@UBEXAAVRWriteStream@@@Z @ 14 NONAME ; public: virtual void __thiscall CSmsNumber::ExternalizeL(class RWriteStream &)const 
-	?ExternalizeL@CSmsSettings@@UBEXAAVRWriteStream@@@Z @ 15 NONAME ABSENT ; public: virtual void __thiscall CSmsSettings::ExternalizeL(class RMsvWriteStream &)const 
-	?GetDescription@TSmsUtilities@@SAHABVCSmsMessage@@AAVTDes16@@H@Z @ 16 NONAME ; public: static int __cdecl TSmsUtilities::GetDescription(class CSmsMessage const &,class TDes16 &,int)
-	?GetDetails@TSmsUtilities@@SAHAAVRFs@@ABVCSmsMessage@@AAVTDes16@@H@Z @ 17 NONAME ; public: static int __cdecl TSmsUtilities::GetDetails(class RFs &,class CSmsMessage const &,class TDes16 &,int)
-	?GetDetails@TSmsUtilities@@SAHAAVRFs@@ABVTDesC16@@AAVTDes16@@H@Z @ 18 NONAME ; public: static int __cdecl TSmsUtilities::GetDetails(class RFs &,class TDesC16 const &,class TDes16 &,int)
-	?GetSmsSettingsL@CSmsHeader@@QBEXAAVCSmsMessageSettings@@@Z @ 19 NONAME ; public: void __thiscall CSmsHeader::GetSmsSettingsL(class CSmsMessageSettings &)const 
-	?InternalizeL@CSmsHeader@@QAEXAAVRMsvReadStream@@@Z @ 20 NONAME ; public: void __thiscall CSmsHeader::InternalizeL(class RMsvReadStream &)
-	?InternalizeL@CSmsMessageSettings@@UAEXAAVRReadStream@@@Z @ 21 NONAME ; public: virtual void __thiscall CSmsMessageSettings::InternalizeL(class RMsvReadStream &)
-	?InternalizeL@CSmsNumber@@UAEXAAVRReadStream@@@Z @ 22 NONAME ; public: virtual void __thiscall CSmsNumber::InternalizeL(class RReadStream &)
-	?InternalizeL@CSmsSettings@@UAEXAAVRReadStream@@@Z @ 23 NONAME ABSENT ; public: virtual void __thiscall CSmsSettings::InternalizeL(class RMsvReadStream &)
-	?NewL@CSmsHeader@@SAPAV1@PAVCSmsMessage@@@Z @ 24 NONAME ; public: static class CSmsHeader * __cdecl CSmsHeader::NewL(class CSmsMessage *)
-	?NewL@CSmsHeader@@SAPAV1@W4TSmsPDUType@CSmsPDU@@AAVCEditableText@@@Z @ 25 NONAME ; public: static class CSmsHeader * __cdecl CSmsHeader::NewL(enum CSmsPDU::TSmsPDUType,class CEditableText &)
-	?NewL@CSmsNumber@@SAPAV1@ABV1@@Z @ 26 NONAME ; public: static class CSmsNumber * __cdecl CSmsNumber::NewL(class CSmsNumber const &)
-	?NewL@CSmsNumber@@SAPAV1@XZ @ 27 NONAME ; public: static class CSmsNumber * __cdecl CSmsNumber::NewL(void)
-	?NewL@CSmsSettings@@SAPAV1@XZ @ 28 NONAME ; public: static class CSmsSettings * __cdecl CSmsSettings::NewL(void)
-	?PopulateMsgEntry@TSmsUtilities@@SAXAAVTMsvEntry@@ABVCSmsMessage@@JVTUid@@@Z @ 29 NONAME ; public: static void __cdecl TSmsUtilities::PopulateMsgEntry(class TMsvEntry &,class CSmsMessage const &,long,class TUid)
-	?RemoveSCAddress@CSmsSettings@@QAEXH@Z @ 30 NONAME ABSENT ; public: void __thiscall CSmsSettings::RemoveSCAddress(int)
-	?RestoreL@CSmsHeader@@QAEXAAVCMsvStore@@@Z @ 31 NONAME ; public: void __thiscall CSmsHeader::RestoreL(class CMsvStore &)
-	?RestoreL@CSmsSettings@@QAEXAAVCMsvStore@@@Z @ 32 NONAME ABSENT ; public: void __thiscall CSmsSettings::RestoreL(class CMsvStore &)
-	?RestoreServiceAndSettingsL@CSmsClientMtm@@QAEXXZ @ 33 NONAME ; public: void __thiscall CSmsClientMtm::RestoreServiceAndSettingsL(void)
-	?ServiceIdL@TSmsUtilities@@SAXAAVCMsvEntry@@AAJVTUid@@PAVCMsvEntrySelection@@@Z @ 34 NONAME ; public: static void __cdecl TSmsUtilities::ServiceIdL(class CMsvEntry &,long &,class TUid,class CMsvEntrySelection *)
-	?ServiceIdL@TSmsUtilities@@SAXAAVCMsvServerEntry@@AAJVTUid@@PAVCMsvEntrySelection@@@Z @ 35 NONAME ; public: static void __cdecl TSmsUtilities::ServiceIdL(class CMsvServerEntry &,long &,class TUid,class CMsvEntrySelection *)
-	?SetSmsSettingsL@CSmsHeader@@QAEXABVCSmsMessageSettings@@@Z @ 36 NONAME ; public: void __thiscall CSmsHeader::SetSmsSettingsL(class CSmsMessageSettings const &)
-	?StoreL@CSmsHeader@@QBEXAAVCMsvStore@@@Z @ 37 NONAME ; public: void __thiscall CSmsHeader::StoreL(class CMsvStore &)const 
-	?StoreL@CSmsSettings@@QBEXAAVCMsvStore@@@Z @ 38 NONAME ABSENT ; public: void __thiscall CSmsSettings::StoreL(class CMsvStore &)const 
-	?ProgressL@CSmsSimParamOperation@@UAEABVTDesC8@@XZ @ 39 NONAME ; public: virtual class TDesC8 const & __thiscall CSmsSimParamOperation::ProgressL(void)
-	?ReadSimParamsL@CSmsClientMtm@@QAEPAVCSmsSimParamOperation@@AAVTRequestStatus@@@Z @ 40 NONAME ; public: class CSmsSimParamOperation * __thiscall CSmsClientMtm::ReadSimParamsL(class TRequestStatus &)
-	?ServiceCentersLC@CSmsSimParamOperation@@QBEPAVCMobilePhoneSmspList@@XZ @ 41 NONAME ; public: class CMobilePhoneSmspList * __thiscall CSmsSimParamOperation::ServiceCentersLC(void)const 
-	?Address@CSmsNumber@@QBE?AVTPtrC16@@XZ @ 42 NONAME ; public: class TPtrC16  __thiscall CSmsNumber::Address(void)const 
-	?Name@CSmsNumber@@QBE?AVTPtrC16@@XZ @ 43 NONAME ; public: class TPtrC16  __thiscall CSmsNumber::Name(void)const 
-	?SetAddressL@CSmsNumber@@QAEXABVTDesC16@@@Z @ 44 NONAME ; public: void __thiscall CSmsNumber::SetAddressL(class TDesC16 const &)
-	?SetNameL@CSmsNumber@@QAEXABVTDesC16@@@Z @ 45 NONAME ; public: void __thiscall CSmsNumber::SetNameL(class TDesC16 const &)
-	?CreateMessageL@CSmsClientMtm@@UAEXJ@Z @ 46 NONAME ; public: virtual void __thiscall CSmsClientMtm::CreateMessageL(long)
-	?ServiceIdL@TSmsUtilities@@SAXAAVCMsvSession@@AAJVTUid@@PAVCMsvEntrySelection@@@Z @ 47 NONAME ; public: static void __cdecl TSmsUtilities::ServiceIdL(class CMsvSession &,long &,class TUid,class CMsvEntrySelection *)
-	?RestoreSimParamsL@CSmsSimParamOperation@@SAXAAVCMsvStore@@AAVCMobilePhoneSmspList@@@Z @ 48 NONAME ; public: static void __cdecl CSmsSimParamOperation::RestoreSimParamsL(class CMsvStore &,class CMobilePhoneSmspList &)
-	?StoreSimParamsL@CSmsSimParamOperation@@SAXAAVCMsvStore@@ABVCMobilePhoneSmspList@@@Z @ 49 NONAME ; public: static void __cdecl CSmsSimParamOperation::StoreSimParamsL(class CMsvStore &,class CMobilePhoneSmspList const &)
-	?WriteSimParamsL@CSmsClientMtm@@QAEPAVCSmsSimParamOperation@@ABVCMobilePhoneSmspList@@AAVTRequestStatus@@@Z @ 50 NONAME ; public: class CSmsSimParamOperation * __thiscall CSmsClientMtm::WriteSimParamsL(class CMobilePhoneSmspList const &,class TRequestStatus &)
-	?SaveExternalL@CSmsSettings@@QAEXAAVCMsvStore@@@Z @ 51 NONAME ABSENT ; void CSmsSettings::SaveExternalL(class CMsvStore &)
-	?OpenResourceFileL@TSmsUtilities@@SA?AVRResourceFile@@AAVRFs@@@Z @ 52 NONAME ; public: static class RResourceFile  __cdecl TSmsUtilities::OpenResourceFileL(class RFs &)
-	?ReadResourceStringL@TSmsUtilities@@SAXVRResourceFile@@HAAVTDes16@@@Z @ 53 NONAME ; public: static void __cdecl TSmsUtilities::ReadResourceStringL(class RResourceFile,int,class TDes16 &)
-	?AckStatus@CSmsNumber@@QBE?AW4TSmsAckStatus@1@W4TSmsAckType@@@Z @ 54 NONAME ; enum CSmsNumber::TSmsAckStatus CSmsNumber::AckStatus(enum TSmsAckType) const
-	?AckSummary@TMsvSmsEntry@@QBE?AW4TMsvSmsEntryAckSummary@1@W4TSmsAckType@@@Z @ 55 NONAME ; enum TMsvSmsEntry::TMsvSmsEntryAckSummary TMsvSmsEntry::AckSummary(enum TSmsAckType) const
-	?MessageId@TMsvSmsEntry@@QBEHAAJ@Z @ 56 NONAME ; int TMsvSmsEntry::MessageId(long &) const
-	?SetAckStatus@CSmsNumber@@QAEXW4TSmsAckType@@W4TSmsAckStatus@1@@Z @ 57 NONAME ; void CSmsNumber::SetAckStatus(enum TSmsAckType, enum CSmsNumber::TSmsAckStatus)
-	?SetAckSummary@TMsvSmsEntry@@QAEXW4TSmsAckType@@W4TMsvSmsEntryAckSummary@1@@Z @ 58 NONAME ; void TMsvSmsEntry::SetAckSummary(enum TSmsAckType, enum TMsvSmsEntry::TMsvSmsEntryAckSummary)
-	?SetMessageId@TMsvSmsEntry@@QAEXJH@Z @ 59 NONAME ; void TMsvSmsEntry::SetMessageId(long, int)
-	??1CSmsEmailFields@@UAE@XZ @ 60 NONAME ; CSmsEmailFields::~CSmsEmailFields(void)
-	?AddAddressL@CSmsEmailFields@@QAEXABVTDesC16@@@Z @ 61 NONAME ; void CSmsEmailFields::AddAddressL(class TDesC16 const &)
-	?Addresses@CSmsEmailFields@@QBEABVMDesC16Array@@XZ @ 62 NONAME ; class MDesC16Array const & CSmsEmailFields::Addresses(void) const
-	?ComposeLC@CSmsEmailFields@@QBEPAVHBufC16@@XZ @ 63 NONAME ; class HBufC16 * CSmsEmailFields::ComposeLC(void) const
-	?EmailFields@CSmsHeader@@QBEABVCSmsEmailFields@@XZ @ 64 NONAME ; class CSmsEmailFields const & CSmsHeader::EmailFields(void) const
-	?HasAddress@CSmsEmailFields@@QBEHXZ @ 65 NONAME ; int CSmsEmailFields::HasAddress(void) const
-	?Length@CSmsEmailFields@@QBEHXZ @ 66 NONAME ; int CSmsEmailFields::Length(void) const
-	?NewL@CSmsEmailFields@@SAPAV1@ABV1@@Z @ 67 NONAME ; class CSmsEmailFields * CSmsEmailFields::NewL(class CSmsEmailFields const &)
-	?NewL@CSmsEmailFields@@SAPAV1@XZ @ 68 NONAME ; class CSmsEmailFields * CSmsEmailFields::NewL(void)
-	?RemoveAddress@CSmsEmailFields@@QAEXH@Z @ 69 NONAME ; void CSmsEmailFields::RemoveAddress(int)
-	?Reset@CSmsEmailFields@@QAEXXZ @ 70 NONAME ; void CSmsEmailFields::Reset(void)
-	?SetEmailFieldsL@CSmsHeader@@QAEXABVCSmsEmailFields@@@Z @ 71 NONAME ; void CSmsHeader::SetEmailFieldsL(class CSmsEmailFields const &)
-	?SetSubjectL@CSmsEmailFields@@QAEXABVTDesC16@@@Z @ 72 NONAME ; void CSmsEmailFields::SetSubjectL(class TDesC16 const &)
-	?Subject@CSmsEmailFields@@QBEABVTDesC16@@XZ @ 73 NONAME ; class TDesC16 const & CSmsEmailFields::Subject(void) const
-	??0TMsvSmsSimOperationParams@@QAE@JW4TMsvSmsStorage@@@Z @ 74 NONAME ABSENT ; TMsvSmsSimOperationParams::TMsvSmsSimOperationParams(long, enum TMsvSmsStorage)
-	??0TMsvSmsSimOperationParams@@QAE@XZ @ 75 NONAME ABSENT ; TMsvSmsSimOperationParams::TMsvSmsSimOperationParams(void)
-	??0TSmsCdmaEndPointInfo@@QAE@XZ @ 76 NONAME ABSENT ; TSmsCdmaEndPointInfo::TSmsCdmaEndPointInfo(void)
-	??0TSmsReplyOptions@@QAE@HHHH@Z @ 77 NONAME ABSENT ; TSmsReplyOptions::TSmsReplyOptions(int, int, int, int)
-	??0TSmsReplyOptions@@QAE@XZ @ 78 NONAME ABSENT ; TSmsReplyOptions::TSmsReplyOptions(void)
-	?AbsoluteValidityPeriod@CSmsMessageSettingsProxy@@QBE?AVTDateTime@@XZ @ 79 NONAME ABSENT ; class TDateTime CSmsMessageSettingsProxy::AbsoluteValidityPeriod(void) const
-	?AcknowledgementRequested@CSmsHeader@@QBEHW4TSmsAckType@@@Z @ 80 NONAME ABSENT ; int CSmsHeader::AcknowledgementRequested(enum TSmsAckType) const
-	?ActivateMessageSetting@TSmsMessageSettingsCdma@@QAEXEH@Z @ 81 NONAME ABSENT ; void TSmsMessageSettingsCdma::ActivateMessageSetting(unsigned char, int)
-	?AddEMSInformationElementL@TMsvMessageSms@@QAEXABVCEmsInformationElement@@@Z @ 82 NONAME ABSENT ; void TMsvMessageSms::AddEMSInformationElementL(class CEmsInformationElement const &)
-	?AddressType@CSmsNumber@@QBE?AW4TMsvAddressType@@XZ @ 83 NONAME ABSENT ; enum TMsvAddressType CSmsNumber::AddressType(void) const
-	?AddressType@TMsvMessageBio@@QBE?AW4TMsvAddressType@@XZ @ 84 NONAME ABSENT ; enum TMsvAddressType TMsvMessageBio::AddressType(void) const
-	?AlertOnDelivery@CSmsSettings@@QBEEXZ @ 85 NONAME ABSENT ; unsigned char CSmsSettings::AlertOnDelivery(void) const
-	?AlertOnDelivery@TSmsMessageSettingsCdma@@QBEEXZ @ 86 NONAME ABSENT ; unsigned char TSmsMessageSettingsCdma::AlertOnDelivery(void) const
-	?BioMessage@CSmsHeader@@QAEAAVTMsvMessageBio@@XZ @ 87 NONAME ABSENT ; class TMsvMessageBio & CSmsHeader::BioMessage(void)
-	?BioMessage@CSmsHeader@@QBEABVTMsvMessageBio@@XZ @ 88 NONAME ABSENT ; class TMsvMessageBio const & CSmsHeader::BioMessage(void) const
-	?BioMsgIdType@TMsvMessageBio@@QBE?AW4TBioMsgIdType@@XZ @ 89 NONAME ABSENT ; enum TBioMsgIdType TMsvMessageBio::BioMsgIdType(void) const
-	?CallBackNumber@TSmsMessageSettingsCdma@@QBE?AVTPtrC16@@XZ @ 90 NONAME ABSENT ; class TPtrC16 TSmsMessageSettingsCdma::CallBackNumber(void) const
-	?CanConcatenate@TSmsMessageSettingsGsm@@QBEHXZ @ 91 NONAME ABSENT ; int TSmsMessageSettingsGsm::CanConcatenate(void) const
-	?Cdma@CSmsMessageSettingsProxy@@QAEAAVTSmsMessageSettingsCdma@@XZ @ 92 NONAME ABSENT ; class TSmsMessageSettingsCdma & CSmsMessageSettingsProxy::Cdma(void)
-	?Cdma@CSmsMessageSettingsProxy@@QBEABVTSmsMessageSettingsCdma@@XZ @ 93 NONAME ABSENT ; class TSmsMessageSettingsCdma const & CSmsMessageSettingsProxy::Cdma(void) const
-	?CdmaMessage@CSmsHeader@@QAEAAVTMsvMessageCdma@@XZ @ 94 NONAME ABSENT ; class TMsvMessageCdma & CSmsHeader::CdmaMessage(void)
-	?CdmaMessage@CSmsHeader@@QBEABVTMsvMessageCdma@@XZ @ 95 NONAME ABSENT ; class TMsvMessageCdma const & CSmsHeader::CdmaMessage(void) const
-	?Class@TSmsErrorExtractionCdma@@SAEH@Z @ 96 NONAME ABSENT ; unsigned char TSmsErrorExtractionCdma::Class(int)
-	?Code@TSmsErrorExtractionCdma@@SAEH@Z @ 97 NONAME ABSENT ; unsigned char TSmsErrorExtractionCdma::Code(int)
-	?ConvertAddressTypeFromCdma@TSmsUtilities@@SA?AW4TMsvAddressType@@EE@Z @ 98 NONAME ABSENT ; enum TMsvAddressType TSmsUtilities::ConvertAddressTypeFromCdma(unsigned char, unsigned char)
-	?ConvertAddressTypeToCdma@TSmsUtilities@@SAXW4TMsvAddressType@@AAVTSmsCdmaEndPointInfo@@@Z @ 99 NONAME ABSENT ; void TSmsUtilities::ConvertAddressTypeToCdma(enum TMsvAddressType, class TSmsCdmaEndPointInfo &)
-	?ConvertCdmaToRelativeTime@TSmsUtilities@@SAHEAAW4TSmsRelativeTimeUnit@@AAK@Z @ 100 NONAME ABSENT ; int TSmsUtilities::ConvertCdmaToRelativeTime(unsigned char, enum TSmsRelativeTimeUnit &, unsigned long &)
-	?ConvertCharacterEncodingToCdmaL@TSmsUtilities@@SAEG@Z @ 101 NONAME ABSENT ; unsigned char TSmsUtilities::ConvertCharacterEncodingToCdmaL(unsigned short)
-	?ConvertCharacterEncodingToGsmL@TSmsUtilities@@SA?AW4TSmsAlphabet@TSmsDataCodingScheme@@G@Z @ 102 NONAME ABSENT ; enum TSmsDataCodingScheme::TSmsAlphabet TSmsUtilities::ConvertCharacterEncodingToGsmL(unsigned short)
-	?ConvertFromMinutes@TSmsUtilities@@SAHAAW4TSmsRelativeTimeUnit@@AAKH@Z @ 103 NONAME ABSENT ; int TSmsUtilities::ConvertFromMinutes(enum TSmsRelativeTimeUnit &, unsigned long &, int)
-	?ConvertMinutesToCdma@TSmsUtilities@@SAHHAAE@Z @ 104 NONAME ABSENT ; int TSmsUtilities::ConvertMinutesToCdma(int, unsigned char &)
-	?ConvertRelativeTimeToCdma@TSmsUtilities@@SAHAAEW4TSmsRelativeTimeUnit@@K@Z @ 105 NONAME ABSENT ; int TSmsUtilities::ConvertRelativeTimeToCdma(unsigned char &, enum TSmsRelativeTimeUnit, unsigned long)
-	?ConvertToMinutes@TSmsUtilities@@SAHW4TSmsRelativeTimeUnit@@KAAH@Z @ 106 NONAME ABSENT ; int TSmsUtilities::ConvertToMinutes(enum TSmsRelativeTimeUnit, unsigned long, int &)
-	?DefaultTeleservice@CSmsSettings@@QBEGXZ @ 107 NONAME ABSENT ; unsigned short CSmsSettings::DefaultTeleservice(void) const
-	?DeliveryAck@TSmsReplyOptions@@QBEHXZ @ 108 NONAME ABSENT ; int TSmsReplyOptions::DeliveryAck(void) const
-	?DeliveryTimeFormat@TMsvMessageCdma@@QBE?AW4TSmsTimePeriodFormat@@XZ @ 109 NONAME ABSENT ; enum TSmsTimePeriodFormat TMsvMessageCdma::DeliveryTimeFormat(void) const
-	?DigitMode@CSmsSettings@@QBE?AW4TSmsCdmaDigitMode@@XZ @ 110 NONAME ABSENT ; enum TSmsCdmaDigitMode CSmsSettings::DigitMode(void) const
-	?EMailGatewayNumber@CSmsSettings@@QBE?AVTPtrC16@@XZ @ 111 NONAME ABSENT ; class TPtrC16 CSmsSettings::EMailGatewayNumber(void) const
-	?Encoding@CSmsMessageSettingsProxy@@QBEGXZ @ 112 NONAME ABSENT ; unsigned short CSmsMessageSettingsProxy::Encoding(void) const
-	?Encoding@TMsvMessageBio@@QBEGXZ @ 113 NONAME ABSENT ; unsigned short TMsvMessageBio::Encoding(void) const
-	?FindRecipient@CSmsHeader@@QBEHABVTDesC16@@AAPAVCSmsNumber@@@Z @ 114 NONAME ABSENT ; int CSmsHeader::FindRecipient(class TDesC16 const &, class CSmsNumber * &) const
-	?FindRecipient@CSmsHeader@@QBEHHAAPAVCSmsNumber@@@Z @ 115 NONAME ABSENT ; int CSmsHeader::FindRecipient(int, class CSmsNumber * &) const
-	?Folder@TMsvSmsSimOperationParams@@QBEJXZ @ 116 NONAME ABSENT ; long TMsvSmsSimOperationParams::Folder(void) const
-	?GenerateCdmaMessageL@TSmsGenerator@@CAPAVCCdmaSmsMessage@@AAVCSmsHeader@@ABVCRichText@@@Z @ 117 NONAME ABSENT ; class CCdmaSmsMessage * TSmsGenerator::GenerateCdmaMessageL(class CSmsHeader &, class CRichText const &)
-	?GenerateGsmMessageL@TSmsGenerator@@CAPAVCSmsMessage@@AAVCSmsHeader@@ABVCRichText@@@Z @ 118 NONAME ABSENT ; class CSmsMessage * TSmsGenerator::GenerateGsmMessageL(class CSmsHeader &, class CRichText const &)
-	?GetAlertOnDeliveryL@TMsvMessageCdma@@QBEHAAE@Z @ 119 NONAME ABSENT ; int TMsvMessageCdma::GetAlertOnDeliveryL(unsigned char &) const
-	?GetCallbackNumberL@TMsvMessageCdma@@QBEPAVHBufC16@@XZ @ 120 NONAME ABSENT ; class HBufC16 * TMsvMessageCdma::GetCallbackNumberL(void) const
-	?GetCdmaMessageTypeL@TSmsUtilities@@SAEGW4TSmsMessageBearing@@@Z @ 121 NONAME ABSENT ; unsigned char TSmsUtilities::GetCdmaMessageTypeL(unsigned short, enum TSmsMessageBearing)
-	?GetClass@TMsvMessageGsm@@QBEHAAHAAW4TMsvSmsGsmClass@@@Z @ 122 NONAME ABSENT ; int TMsvMessageGsm::GetClass(int &, enum TMsvSmsGsmClass &) const
-	?GetCommandType@TMsvMessageGsm@@QBEHAAW4TMsvSmsGsmCommand@@@Z @ 123 NONAME ABSENT ; int TMsvMessageGsm::GetCommandType(enum TMsvSmsGsmCommand &) const
-	?GetDefaultMessageSettingsL@CSmsHeader@@QBEXAAVCSmsSettings@@@Z @ 124 NONAME ABSENT ; void CSmsHeader::GetDefaultMessageSettingsL(class CSmsSettings &) const
-	?GetDeferredDeliveryTimeAbsoluteL@TMsvMessageCdma@@QAEHAAVTDateTime@@@Z @ 125 NONAME ABSENT ; int TMsvMessageCdma::GetDeferredDeliveryTimeAbsoluteL(class TDateTime &)
-	?GetDeferredDeliveryTimeRelativeL@TMsvMessageCdma@@QBEHAAW4TSmsRelativeTimeUnit@@AAK@Z @ 126 NONAME ABSENT ; int TMsvMessageCdma::GetDeferredDeliveryTimeRelativeL(enum TSmsRelativeTimeUnit &, unsigned long &) const
-	?GetDescriptionCdma@TSmsUtilities@@SAHAAVRFs@@ABVCCdmaSmsMessage@@AAVTDes16@@H@Z @ 127 NONAME ABSENT ; int TSmsUtilities::GetDescriptionCdma(class RFs &, class CCdmaSmsMessage const &, class TDes16 &, int)
-	?GetDetailsCdma@TSmsUtilities@@SAHAAVRFs@@ABVCCdmaSmsMessage@@AAVTDes16@@H@Z @ 128 NONAME ABSENT ; int TSmsUtilities::GetDetailsCdma(class RFs &, class CCdmaSmsMessage const &, class TDes16 &, int)
-	?GetEMSInformationElementsL@TMsvMessageSms@@QBEABV?$RPointerArray@$$CBVCEmsInformationElement@@@@XZ @ 129 NONAME ABSENT ; class RPointerArray<class CEmsInformationElement const > const & TMsvMessageSms::GetEMSInformationElementsL(void) const
-	?GetGsmMessageTypeL@TSmsUtilities@@SA?AW4TSmsPDUType@CSmsPDU@@GW4TSmsMessageBearing@@@Z @ 130 NONAME ABSENT ; enum CSmsPDU::TSmsPDUType TSmsUtilities::GetGsmMessageTypeL(unsigned short, enum TSmsMessageBearing)
-	?GetLanguageIndicatorL@TMsvMessageCdma@@QBEHAAE@Z @ 131 NONAME ABSENT ; int TMsvMessageCdma::GetLanguageIndicatorL(unsigned char &) const
-	?GetMessageDepositIndexL@TMsvMessageCdma@@QBEHAAG@Z @ 132 NONAME ABSENT ; int TMsvMessageCdma::GetMessageDepositIndexL(unsigned short &) const
-	?GetMessageDisplayModeL@TMsvMessageCdma@@QBEHAAE@Z @ 133 NONAME ABSENT ; int TMsvMessageCdma::GetMessageDisplayModeL(unsigned char &) const
-	?GetMessageServiceCenterTimeStamp@TMsvMessageSms@@QBEHAAVTDateTime@@AAH@Z @ 134 NONAME ABSENT ; int TMsvMessageSms::GetMessageServiceCenterTimeStamp(class TDateTime &, int &) const
-	?GetNumberOfMessagesL@TMsvMessageCdma@@QBEHAAE@Z @ 135 NONAME ABSENT ; int TMsvMessageCdma::GetNumberOfMessagesL(unsigned char &) const
-	?GetOriginatingSubAddressL@TMsvMessageCdma@@QBEPAVHBufC16@@XZ @ 136 NONAME ABSENT ; class HBufC16 * TMsvMessageCdma::GetOriginatingSubAddressL(void) const
-	?GetPriorityIndicatorL@TMsvMessageCdma@@QBEHAAE@Z @ 137 NONAME ABSENT ; int TMsvMessageCdma::GetPriorityIndicatorL(unsigned char &) const
-	?GetPrivacyIndicatorL@TMsvMessageCdma@@QBEHAAE@Z @ 138 NONAME ABSENT ; int TMsvMessageCdma::GetPrivacyIndicatorL(unsigned char &) const
-	?GetRejectDuplicates@TMsvMessageGsm@@QBEHAAH@Z @ 139 NONAME ABSENT ; int TMsvMessageGsm::GetRejectDuplicates(int &) const
-	?GetReplyPath@TMsvMessageGsm@@QBEHAAH@Z @ 140 NONAME ABSENT ; int TMsvMessageGsm::GetReplyPath(int &) const
-	?GetServiceCenterAddress@TMsvMessageGsm@@QBEHAAVTPtrC16@@@Z @ 141 NONAME ABSENT ; int TMsvMessageGsm::GetServiceCenterAddress(class TPtrC16 &) const
-	?GetUserResponseCodeL@TMsvMessageCdma@@QBEHAAE@Z @ 142 NONAME ABSENT ; int TMsvMessageCdma::GetUserResponseCodeL(unsigned char &) const
-	?GetValidityPeriodAbsolute@TMsvMessageSms@@QBEHAAVTDateTime@@@Z @ 143 NONAME ABSENT ; int TMsvMessageSms::GetValidityPeriodAbsolute(class TDateTime &) const
-	?GetValidityPeriodRelative@TMsvMessageSms@@QBEHAAW4TSmsRelativeTimeUnit@@AAK@Z @ 144 NONAME ABSENT ; int TMsvMessageSms::GetValidityPeriodRelative(enum TSmsRelativeTimeUnit &, unsigned long &) const
-	?Gsm@CSmsMessageSettingsProxy@@QAEAAVTSmsMessageSettingsGsm@@XZ @ 145 NONAME ABSENT ; class TSmsMessageSettingsGsm & CSmsMessageSettingsProxy::Gsm(void)
-	?Gsm@CSmsMessageSettingsProxy@@QBEABVTSmsMessageSettingsGsm@@XZ @ 146 NONAME ABSENT ; class TSmsMessageSettingsGsm const & CSmsMessageSettingsProxy::Gsm(void) const
-	?GsmMessage@CSmsHeader@@QAEAAVTMsvMessageGsm@@XZ @ 147 NONAME ABSENT ; class TMsvMessageGsm & CSmsHeader::GsmMessage(void)
-	?GsmMessage@CSmsHeader@@QBEABVTMsvMessageGsm@@XZ @ 148 NONAME ABSENT ; class TMsvMessageGsm const & CSmsHeader::GsmMessage(void) const
-	?IsMessageSettingActive@TSmsMessageSettingsCdma@@QBEHE@Z @ 149 NONAME ABSENT ; int TSmsMessageSettingsCdma::IsMessageSettingActive(unsigned char) const
-	?Language@TSmsMessageSettingsCdma@@QBEEXZ @ 150 NONAME ABSENT ; unsigned char TSmsMessageSettingsCdma::Language(void) const
-	?MessageBearing@CSmsHeader@@QBE?AW4TSmsMessageBearing@@XZ @ 151 NONAME ABSENT ; enum TSmsMessageBearing CSmsHeader::MessageBearing(void) const
-	?MessageConversion@TSmsMessageSettingsGsm@@QBE?AW4TSmsPIDConversion@@XZ @ 152 NONAME ABSENT ; enum TSmsPIDConversion TSmsMessageSettingsGsm::MessageConversion(void) const
-	?MessageDisplayMode@CSmsSettings@@QBEEXZ @ 153 NONAME ABSENT ; unsigned char CSmsSettings::MessageDisplayMode(void) const
-	?MessageId@CSmsNumber@@QBEHXZ @ 154 NONAME ABSENT ; int CSmsNumber::MessageId(void) const
-	?MessageSettings@CSmsSettings@@QAEAAVCSmsMessageSettingsProxy@@XZ @ 155 NONAME ABSENT ; class CSmsMessageSettingsProxy & CSmsSettings::MessageSettings(void)
-	?MessageSettings@CSmsSettings@@QBEABVCSmsMessageSettingsProxy@@XZ @ 156 NONAME ABSENT ; class CSmsMessageSettingsProxy const & CSmsSettings::MessageSettings(void) const
-	?MessageType@CSmsHeader@@QAEGXZ @ 157 NONAME ABSENT ; unsigned short CSmsHeader::MessageType(void)
-	?NewL@CSmsHeader@@SAPAV1@GAAVCEditableText@@@Z @ 158 NONAME ABSENT ; class CSmsHeader * CSmsHeader::NewL(unsigned short, class CEditableText &)
-	?NewL@CSmsHeader@@SAPAV1@GAAVCEditableText@@G@Z @ 159 NONAME ABSENT ; class CSmsHeader * CSmsHeader::NewL(unsigned short, class CEditableText &, unsigned short)
-	?NewL@CSmsHeader@@SAPAV1@PAVCCdmaSmsMessage@@@Z @ 160 NONAME ABSENT ; class CSmsHeader * CSmsHeader::NewL(class CCdmaSmsMessage *)
-	?OriginatingAddress@TMsvMessageBio@@QBE?AVTPtrC16@@XZ @ 161 NONAME ABSENT ; class TPtrC16 TMsvMessageBio::OriginatingAddress(void) const
-	?PopulateMsgEntryCdma@TSmsUtilities@@SAXAAVTMsvEntry@@ABVCCdmaSmsMessage@@JVTUid@@@Z @ 162 NONAME ABSENT ; void TSmsUtilities::PopulateMsgEntryCdma(class TMsvEntry &, class CCdmaSmsMessage const &, long, class TUid)
-	?PreferedLanguageList@CSmsSettings@@QAEAAV?$CArrayFixFlat@E@@XZ @ 163 NONAME ABSENT ; class CArrayFixFlat<unsigned char> & CSmsSettings::PreferedLanguageList(void)
-	?PreferedLanguageList@CSmsSettings@@QBEABV?$CArrayFixFlat@E@@XZ @ 164 NONAME ABSENT ; class CArrayFixFlat<unsigned char> const & CSmsSettings::PreferedLanguageList(void) const
-	?Priority@TSmsMessageSettingsCdma@@QBEEXZ @ 165 NONAME ABSENT ; unsigned char TSmsMessageSettingsCdma::Priority(void) const
-	?Privacy@TSmsMessageSettingsCdma@@QBEEXZ @ 166 NONAME ABSENT ; unsigned char TSmsMessageSettingsCdma::Privacy(void) const
-	?ReadAck@TSmsReplyOptions@@QBEHXZ @ 167 NONAME ABSENT ; int TSmsReplyOptions::ReadAck(void) const
-	?RejectDuplicate@TSmsMessageSettingsGsm@@QBEHXZ @ 168 NONAME ABSENT ; int TSmsMessageSettingsGsm::RejectDuplicate(void) const
-	?RelativeValidityPeriod@CSmsMessageSettingsProxy@@QBEABVTTimeIntervalMinutes@@XZ @ 169 NONAME ABSENT ; class TTimeIntervalMinutes const & CSmsMessageSettingsProxy::RelativeValidityPeriod(void) const
-	?RemoveEMSInformationElementL@TMsvMessageSms@@QAEPAVCEmsInformationElement@@IW4TSmsInformationElementIdentifier@CSmsInformationElement@@@Z @ 170 NONAME ABSENT ; class CEmsInformationElement * TMsvMessageSms::RemoveEMSInformationElementL(unsigned int, enum CSmsInformationElement::TSmsInformationElementIdentifier)
-	?RemoveEMSInformationElementsL@TMsvMessageSms@@QAEPAV?$RPointerArray@VCEmsInformationElement@@@@IW4TSmsInformationElementIdentifier@CSmsInformationElement@@@Z @ 171 NONAME ABSENT ; class RPointerArray<class CEmsInformationElement> * TMsvMessageSms::RemoveEMSInformationElementsL(unsigned int, enum CSmsInformationElement::TSmsInformationElementIdentifier)
-	?ReplyOptions@CSmsMessageSettingsProxy@@QBEABVTSmsReplyOptions@@XZ @ 172 NONAME ABSENT ; class TSmsReplyOptions const & CSmsMessageSettingsProxy::ReplyOptions(void) const
-	?ReplyPath@TSmsMessageSettingsGsm@@QBEHXZ @ 173 NONAME ABSENT ; int TSmsMessageSettingsGsm::ReplyPath(void) const
-	?ReplyWithOriginalMessage@CSmsSettings@@QBE?AW4TSmsReplyWithOriginal@@XZ @ 174 NONAME ABSENT ; enum TSmsReplyWithOriginal CSmsSettings::ReplyWithOriginalMessage(void) const
-	?ResetEMSL@TMsvMessageSms@@QAEXXZ @ 175 NONAME ABSENT ; void TMsvMessageSms::ResetEMSL(void)
-	?ResetMessageParameters@TMsvMessageCdma@@QAEXXZ @ 176 NONAME ABSENT ; void TMsvMessageCdma::ResetMessageParameters(void)
-	?ResetSIMSlots@CSmsHeader@@QAEXXZ @ 177 NONAME ABSENT ; void CSmsHeader::ResetSIMSlots(void)
-	?RestoreL@CSmsHeader@@SAPAV1@AAVCMsvStore@@AAVCEditableText@@@Z @ 178 NONAME ABSENT ; class CSmsHeader * CSmsHeader::RestoreL(class CMsvStore &, class CEditableText &)
-	?SetAbsoluteValidityPeriod@CSmsMessageSettingsProxy@@QAEXABVTDateTime@@@Z @ 179 NONAME ABSENT ; void CSmsMessageSettingsProxy::SetAbsoluteValidityPeriod(class TDateTime const &)
-	?SetAcknowledgementRequest@CSmsHeader@@QAEXW4TSmsAckType@@H@Z @ 180 NONAME ABSENT ; void CSmsHeader::SetAcknowledgementRequest(enum TSmsAckType, int)
-	?SetAddressL@CSmsNumber@@QAEXABVTDesC16@@W4TMsvAddressType@@@Z @ 181 NONAME ABSENT ; void CSmsNumber::SetAddressL(class TDesC16 const &, enum TMsvAddressType)
-	?SetAlertOnDelivery@CSmsSettings@@QAEXE@Z @ 182 NONAME ABSENT ; void CSmsSettings::SetAlertOnDelivery(unsigned char)
-	?SetAlertOnDelivery@TSmsMessageSettingsCdma@@QAEXE@Z @ 183 NONAME ABSENT ; void TSmsMessageSettingsCdma::SetAlertOnDelivery(unsigned char)
-	?SetAlertOnDeliveryL@TMsvMessageCdma@@QAEHE@Z @ 184 NONAME ABSENT ; int TMsvMessageCdma::SetAlertOnDeliveryL(unsigned char)
-	?SetBioMsgIdType@TMsvMessageBio@@QAEXW4TBioMsgIdType@@@Z @ 185 NONAME ABSENT ; void TMsvMessageBio::SetBioMsgIdType(enum TBioMsgIdType)
-	?SetCallBackNumberL@TSmsMessageSettingsCdma@@QAEXABVTDesC16@@@Z @ 186 NONAME ABSENT ; void TSmsMessageSettingsCdma::SetCallBackNumberL(class TDesC16 const &)
-	?SetCallbackNumberL@TMsvMessageCdma@@QAEHABVTDesC16@@@Z @ 187 NONAME ABSENT ; int TMsvMessageCdma::SetCallbackNumberL(class TDesC16 const &)
-	?SetCanConcatenate@TSmsMessageSettingsGsm@@QAEXH@Z @ 188 NONAME ABSENT ; void TSmsMessageSettingsGsm::SetCanConcatenate(int)
-	?SetClass@TMsvMessageGsm@@QAEHHW4TMsvSmsGsmClass@@@Z @ 189 NONAME ABSENT ; int TMsvMessageGsm::SetClass(int, enum TMsvSmsGsmClass)
-	?SetCommandType@TMsvMessageGsm@@QAEHW4TMsvSmsGsmCommand@@@Z @ 190 NONAME ABSENT ; int TMsvMessageGsm::SetCommandType(enum TMsvSmsGsmCommand)
-	?SetDefaultMessageSettingsL@CSmsHeader@@QAEXABVCSmsSettings@@@Z @ 191 NONAME ABSENT ; void CSmsHeader::SetDefaultMessageSettingsL(class CSmsSettings const &)
-	?SetDefaultTeleservice@CSmsSettings@@QAEXG@Z @ 192 NONAME ABSENT ; void CSmsSettings::SetDefaultTeleservice(unsigned short)
-	?SetDeferredDeliveryTimeAbsoluteL@TMsvMessageCdma@@QAEHABVTDateTime@@@Z @ 193 NONAME ABSENT ; int TMsvMessageCdma::SetDeferredDeliveryTimeAbsoluteL(class TDateTime const &)
-	?SetDeferredDeliveryTimeRelativeL@TMsvMessageCdma@@QAEHW4TSmsRelativeTimeUnit@@K@Z @ 194 NONAME ABSENT ; int TMsvMessageCdma::SetDeferredDeliveryTimeRelativeL(enum TSmsRelativeTimeUnit, unsigned long)
-	?SetDeliveryAck@TSmsReplyOptions@@QAEXH@Z @ 195 NONAME ABSENT ; void TSmsReplyOptions::SetDeliveryAck(int)
-	?SetDigitMode@CSmsSettings@@QAEXW4TSmsCdmaDigitMode@@@Z @ 196 NONAME ABSENT ; void CSmsSettings::SetDigitMode(enum TSmsCdmaDigitMode)
-	?SetEMailGatewayNumberL@CSmsSettings@@QAEXABVTDesC16@@@Z @ 197 NONAME ABSENT ; void CSmsSettings::SetEMailGatewayNumberL(class TDesC16 const &)
-	?SetEncoding@CSmsMessageSettingsProxy@@QAEXG@Z @ 198 NONAME ABSENT ; void CSmsMessageSettingsProxy::SetEncoding(unsigned short)
-	?SetEncoding@TMsvMessageBio@@QAEXG@Z @ 199 NONAME ABSENT ; void TMsvMessageBio::SetEncoding(unsigned short)
-	?SetFolder@TMsvSmsSimOperationParams@@QAEXJ@Z @ 200 NONAME ABSENT ; void TMsvSmsSimOperationParams::SetFolder(long)
-	?SetLanguage@TSmsMessageSettingsCdma@@QAEXE@Z @ 201 NONAME ABSENT ; void TSmsMessageSettingsCdma::SetLanguage(unsigned char)
-	?SetLanguageIndicatorL@TMsvMessageCdma@@QAEHE@Z @ 202 NONAME ABSENT ; int TMsvMessageCdma::SetLanguageIndicatorL(unsigned char)
-	?SetMessageConversion@TSmsMessageSettingsGsm@@QAEXW4TSmsPIDConversion@@@Z @ 203 NONAME ABSENT ; void TSmsMessageSettingsGsm::SetMessageConversion(enum TSmsPIDConversion)
-	?SetMessageDepositIndexL@TMsvMessageCdma@@QAEHG@Z @ 204 NONAME ABSENT ; int TMsvMessageCdma::SetMessageDepositIndexL(unsigned short)
-	?SetMessageDisplayMode@CSmsSettings@@QAEXE@Z @ 205 NONAME ABSENT ; void CSmsSettings::SetMessageDisplayMode(unsigned char)
-	?SetMessageId@CSmsNumber@@QAEXH@Z @ 206 NONAME ABSENT ; void CSmsNumber::SetMessageId(int)
-	?SetPriority@TSmsMessageSettingsCdma@@QAEXE@Z @ 207 NONAME ABSENT ; void TSmsMessageSettingsCdma::SetPriority(unsigned char)
-	?SetPriorityIndicatorL@TMsvMessageCdma@@QAEHE@Z @ 208 NONAME ABSENT ; int TMsvMessageCdma::SetPriorityIndicatorL(unsigned char)
-	?SetPrivacy@TSmsMessageSettingsCdma@@QAEXE@Z @ 209 NONAME ABSENT ; void TSmsMessageSettingsCdma::SetPrivacy(unsigned char)
-	?SetPrivacyIndicatorL@TMsvMessageCdma@@QAEHE@Z @ 210 NONAME ABSENT ; int TMsvMessageCdma::SetPrivacyIndicatorL(unsigned char)
-	?SetReadAck@TSmsReplyOptions@@QAEXH@Z @ 211 NONAME ABSENT ; void TSmsReplyOptions::SetReadAck(int)
-	?SetRejectDuplicate@TSmsMessageSettingsGsm@@QAEXH@Z @ 212 NONAME ABSENT ; void TSmsMessageSettingsGsm::SetRejectDuplicate(int)
-	?SetRejectDuplicates@TMsvMessageGsm@@QAEHH@Z @ 213 NONAME ABSENT ; int TMsvMessageGsm::SetRejectDuplicates(int)
-	?SetRelativeValidityPeriod@CSmsMessageSettingsProxy@@QAEXABVTTimeIntervalMinutes@@@Z @ 214 NONAME ABSENT ; void CSmsMessageSettingsProxy::SetRelativeValidityPeriod(class TTimeIntervalMinutes const &)
-	?SetReplyOptions@CSmsMessageSettingsProxy@@QAEXABVTSmsReplyOptions@@@Z @ 215 NONAME ABSENT ; void CSmsMessageSettingsProxy::SetReplyOptions(class TSmsReplyOptions const &)
-	?SetReplyPath@TSmsMessageSettingsGsm@@QAEXH@Z @ 216 NONAME ABSENT ; void TSmsMessageSettingsGsm::SetReplyPath(int)
-	?SetReplyPathProvided@TMsvMessageGsm@@QAEHH@Z @ 217 NONAME ABSENT ; int TMsvMessageGsm::SetReplyPathProvided(int)
-	?SetReplyWithOriginalMessage@CSmsSettings@@QAEXW4TSmsReplyWithOriginal@@@Z @ 218 NONAME ABSENT ; void CSmsSettings::SetReplyWithOriginalMessage(enum TSmsReplyWithOriginal)
-	?SetServiceCenterAddressL@TMsvMessageGsm@@QAEHABVTDesC16@@@Z @ 219 NONAME ABSENT ; int TMsvMessageGsm::SetServiceCenterAddressL(class TDesC16 const &)
-	?SetSmsStore@TMsvSmsSimOperationParams@@QAEXW4TMsvSmsStorage@@@Z @ 220 NONAME ABSENT ; void TMsvSmsSimOperationParams::SetSmsStore(enum TMsvSmsStorage)
-	?SetTransportAck@TSmsReplyOptions@@QAEXH@Z @ 221 NONAME ABSENT ; void TSmsReplyOptions::SetTransportAck(int)
-	?SetUserAck@CSmsNumber@@QAEXE@Z @ 222 NONAME ABSENT ; void CSmsNumber::SetUserAck(unsigned char)
-	?SetUserAck@TSmsReplyOptions@@QAEXH@Z @ 223 NONAME ABSENT ; void TSmsReplyOptions::SetUserAck(int)
-	?SetUserResponseCodeL@TMsvMessageCdma@@QAEHE@Z @ 224 NONAME ABSENT ; int TMsvMessageCdma::SetUserResponseCodeL(unsigned char)
-	?SetValidityPeriodAbsoluteL@TMsvMessageSms@@QAEHABVTDateTime@@@Z @ 225 NONAME ABSENT ; int TMsvMessageSms::SetValidityPeriodAbsoluteL(class TDateTime const &)
-	?SetValidityPeriodFormat@CSmsMessageSettingsProxy@@QAEXW4TSmsTimePeriodFormat@@@Z @ 226 NONAME ABSENT ; void CSmsMessageSettingsProxy::SetValidityPeriodFormat(enum TSmsTimePeriodFormat)
-	?SetValidityPeriodRelativeL@TMsvMessageSms@@QAEHW4TSmsRelativeTimeUnit@@K@Z @ 227 NONAME ABSENT ; int TMsvMessageSms::SetValidityPeriodRelativeL(enum TSmsRelativeTimeUnit, unsigned long)
-	?SmsBearer@CSmsHeader@@QBE?AW4TSmsBearers@@XZ @ 228 NONAME ABSENT ; enum TSmsBearers CSmsHeader::SmsBearer(void) const
-	?SmsMessage@CSmsHeader@@QAEAAVTMsvMessageSms@@XZ @ 229 NONAME ABSENT ; class TMsvMessageSms & CSmsHeader::SmsMessage(void)
-	?SmsMessage@CSmsHeader@@QBEABVTMsvMessageSms@@XZ @ 230 NONAME ABSENT ; class TMsvMessageSms const & CSmsHeader::SmsMessage(void) const
-	?SmsStore@TMsvSmsSimOperationParams@@QBE?AW4TMsvSmsStorage@@XZ @ 231 NONAME ABSENT ; enum TMsvSmsStorage TMsvSmsSimOperationParams::SmsStore(void) const
-	?TeleserviceId@TMsvMessageCdma@@QBEGXZ @ 232 NONAME ABSENT ; unsigned short TMsvMessageCdma::TeleserviceId(void) const
-	?TransportAck@TSmsReplyOptions@@QBEHXZ @ 233 NONAME ABSENT ; int TSmsReplyOptions::TransportAck(void) const
-	?UserAck@CSmsNumber@@QBEEXZ @ 234 NONAME ABSENT ; unsigned char CSmsNumber::UserAck(void) const
-	?UserAck@TSmsReplyOptions@@QBEHXZ @ 235 NONAME ABSENT ; int TSmsReplyOptions::UserAck(void) const
-	?ValidateAddress@CSmsNumber@@QBEHXZ @ 236 NONAME ABSENT ; int CSmsNumber::ValidateAddress(void) const
-	?ValidityPeriodFormat@CSmsMessageSettingsProxy@@QBE?AW4TSmsTimePeriodFormat@@XZ @ 237 NONAME ABSENT ; enum TSmsTimePeriodFormat CSmsMessageSettingsProxy::ValidityPeriodFormat(void) const
-	?ValidityPeriodFormat@TMsvMessageSms@@QBE?AW4TSmsTimePeriodFormat@@XZ @ 238 NONAME ABSENT ; enum TSmsTimePeriodFormat TMsvMessageSms::ValidityPeriodFormat(void) const
-	??1CSmsAccount@@UAE@XZ @ 239 NONAME ; CSmsAccount::~CSmsAccount(void)
-	??1CSmsServiceCenter@@UAE@XZ @ 240 NONAME ; CSmsServiceCenter::~CSmsServiceCenter(void)
-	?AddServiceCenterL@CSmsSettings@@QAEXABVTDesC16@@0@Z @ 241 NONAME ; void CSmsSettings::AddServiceCenterL(class TDesC16 const &, class TDesC16 const &)
-	?Address@CSmsServiceCenter@@QBE?AVTPtrC16@@XZ @ 242 NONAME ; class TPtrC16 CSmsServiceCenter::Address(void) const
-	?CopyL@CSmsServiceCenter@@QAEAAV1@ABV1@@Z @ 243 NONAME ; class CSmsServiceCenter & CSmsServiceCenter::CopyL(class CSmsServiceCenter const &)
-	?DefaultServiceCenter@CSmsSettings@@QBEHXZ @ 244 NONAME ; int CSmsSettings::DefaultServiceCenter(void) const
-	?GetServiceCenter@CSmsSettings@@QBEAAVCSmsServiceCenter@@H@Z @ 245 NONAME ; class CSmsServiceCenter & CSmsSettings::GetServiceCenter(int) const
-	?InitialiseDefaultSettingsL@CSmsAccount@@QAEXAAVCMsvScheduleSettings@@AAVCMsvOffPeakTimes@@AAVCMsvSendErrorActions@@AAVCMsvSysAgentActions@@@Z @ 246 NONAME ; void CSmsAccount::InitialiseDefaultSettingsL(class CMsvScheduleSettings &, class CMsvOffPeakTimes &, class CMsvSendErrorActions &, class CMsvSysAgentActions &)
-	?InitialiseDefaultSettingsL@CSmsAccount@@QAEXAAVCSmsSettings@@@Z @ 247 NONAME ; void CSmsAccount::InitialiseDefaultSettingsL(class CSmsSettings &)
-	?LoadSettingsL@CSmsAccount@@QAEXAAVCMsvScheduleSettings@@AAVCMsvOffPeakTimes@@AAVCMsvSendErrorActions@@AAVCMsvSysAgentActions@@@Z @ 248 NONAME ; void CSmsAccount::LoadSettingsL(class CMsvScheduleSettings &, class CMsvOffPeakTimes &, class CMsvSendErrorActions &, class CMsvSysAgentActions &)
-	?LoadSettingsL@CSmsAccount@@QAEXAAVCSmsSettings@@@Z @ 249 NONAME ; void CSmsAccount::LoadSettingsL(class CSmsSettings &)
-	?Name@CSmsServiceCenter@@QBE?AVTPtrC16@@XZ @ 250 NONAME ; class TPtrC16 CSmsServiceCenter::Name(void) const
-	?NewL@CSmsAccount@@SAPAV1@XZ @ 251 NONAME ; class CSmsAccount * CSmsAccount::NewL(void)
-	?NewL@CSmsServiceCenter@@SAPAV1@ABV1@@Z @ 252 NONAME ; class CSmsServiceCenter * CSmsServiceCenter::NewL(class CSmsServiceCenter const &)
-	?NewL@CSmsServiceCenter@@SAPAV1@XZ @ 253 NONAME ; class CSmsServiceCenter * CSmsServiceCenter::NewL(void)
-	?NewLC@CSmsAccount@@SAPAV1@XZ @ 254 NONAME ; class CSmsAccount * CSmsAccount::NewLC(void)
-	?NewLC@CSmsSettings@@SAPAV1@XZ @ 255 NONAME ; class CSmsSettings * CSmsSettings::NewLC(void)
-	?RemoveServiceCenter@CSmsSettings@@QAEXH@Z @ 256 NONAME ; void CSmsSettings::RemoveServiceCenter(int)
-	?SaveSettingsL@CSmsAccount@@QBEXABVCMsvScheduleSettings@@ABVCMsvOffPeakTimes@@ABVCMsvSendErrorActions@@ABVCMsvSysAgentActions@@@Z @ 257 NONAME ; void CSmsAccount::SaveSettingsL(class CMsvScheduleSettings const &, class CMsvOffPeakTimes const &, class CMsvSendErrorActions const &, class CMsvSysAgentActions const &) const
-	?SaveSettingsL@CSmsAccount@@QBEXABVCSmsSettings@@@Z @ 258 NONAME ; void CSmsAccount::SaveSettingsL(class CSmsSettings const &) const
-	?ServiceCenterCount@CSmsSettings@@QBEHXZ @ 259 NONAME ; int CSmsSettings::ServiceCenterCount(void) const
-	?SetAddressL@CSmsServiceCenter@@QAEXABVTDesC16@@@Z @ 260 NONAME ; void CSmsServiceCenter::SetAddressL(class TDesC16 const &)
-	?SetDefaultServiceCenter@CSmsSettings@@QAEXH@Z @ 261 NONAME ; void CSmsSettings::SetDefaultServiceCenter(int)
-	?SetNameL@CSmsServiceCenter@@QAEXABVTDesC16@@@Z @ 262 NONAME ; void CSmsServiceCenter::SetNameL(class TDesC16 const &)
-	?NewL@CSmsHeader@@SAPAV1@W4TSmsPDUType@CSmsPDU@@AAVCEditableText@@AAVRFs@@@Z @ 263 NONAME ; class CSmsHeader * CSmsHeader::NewL(enum CSmsPDU::TSmsPDUType, class CEditableText &, class RFs &)
-	?ContainsSmsHeaderL@CSmsHeader@@QAEHABVCMsvStore@@@Z @ 264 NONAME ; int CSmsHeader::ContainsSmsHeaderL(class CMsvStore const &)
-	?PopulateMsgEntry@TSmsUtilities@@SAXAAVTMsvEntry@@ABVCSmsMessage@@JABVCSmsSettings@@VTUid@@@Z @ 265 NONAME ; void TSmsUtilities::PopulateMsgEntry(class TMsvEntry &, class CSmsMessage const &, long, class CSmsSettings const &, class TUid)
-	?Extension_@CSmsClientMtm@@MAEHIAAPAXPAX@Z @ 266 NONAME ; int CSmsClientMtm::Extension_(unsigned int, void * &, void *)
-	?SaveMessageL@CSmsClientMtm@@QAEXAAVCMsvStore@@AAVTMsvEntry@@@Z @ 267 NONAME ; void CSmsClientMtm::SaveMessageL(class CMsvStore &, class TMsvEntry &)
-	?CreateMessageL@CSmsClientMtm@@QAEXAAVTMsvEntry@@@Z @ 268 NONAME ; void CSmsClientMtm::CreateMessageL(class TMsvEntry &)
-
--- a/messagingappbase/smsmtm/clientmtm/eabi/smcmU.DEF	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-EXPORTS
-	_ZN13CSmsClientMtm4NewLER17CRegisteredMtmDllR11CMsvSession @ 1 NONAME ; CSmsClientMtm :: NewL ( CRegisteredMtmDll & , CMsvSession & )
-	_ZN13TSmsUtilities14Dummy_Export_1Ev @ 2 NONAME ; TSmsUtilities :: Dummy_Export_1 ( void )
-	_ZN13CSmsClientMtm15BioTypeChangedLE4TUid @ 3 NONAME ; CSmsClientMtm :: BioTypeChangedL ( TUid )
-	_ZN10CSmsNumber5CopyLERKS_ @ 4 NONAME ; CSmsNumber :: CopyL ( CSmsNumber const & )
-	_ZN12CSmsSettings5CopyLERKS_ @ 5 NONAME ; CSmsSettings :: CopyL ( CSmsSettings const & )
-	_ZN19CSmsMessageSettings5CopyLERKS_ @ 6 NONAME ; CSmsMessageSettings :: CopyL ( CSmsMessageSettings const & )
-	_ZNK10CSmsHeader12ExternalizeLER15RMsvWriteStream @ 7 NONAME ; CSmsHeader :: ExternalizeL ( RMsvWriteStream & ) const
-	_ZNK10CSmsNumber12ExternalizeLER12RWriteStream @ 8 NONAME ; CSmsNumber :: ExternalizeL ( RWriteStream & ) const
-	_ZNK12CSmsSettings12ExternalizeLER12RWriteStream @ 9 NONAME ; CSmsSettings :: ExternalizeL ( RWriteStream & ) const
-	_ZNK19CSmsMessageSettings12ExternalizeLER12RWriteStream @ 10 NONAME ; CSmsMessageSettings :: ExternalizeL ( RWriteStream & ) const
-	_ZN13TSmsUtilities14GetDescriptionERK11CSmsMessageR6TDes16i @ 11 NONAME ; TSmsUtilities :: GetDescription ( CSmsMessage const & , TDes16 & , int )
-	_ZN13TSmsUtilities10GetDetailsER3RFsRK11CSmsMessageR6TDes16i @ 12 NONAME ; TSmsUtilities :: GetDetails ( RFs & , CSmsMessage const & , TDes16 & , int )
-	_ZN13TSmsUtilities10GetDetailsER3RFsRK7TDesC16R6TDes16i @ 13 NONAME ; TSmsUtilities :: GetDetails ( RFs & , TDesC16 const & , TDes16 & , int )
-	_ZNK10CSmsHeader15GetSmsSettingsLER19CSmsMessageSettings @ 14 NONAME ; CSmsHeader :: GetSmsSettingsL ( CSmsMessageSettings & ) const
-	_ZN10CSmsHeader12InternalizeLER14RMsvReadStream @ 15 NONAME ; CSmsHeader :: InternalizeL ( RMsvReadStream & )
-	_ZN10CSmsNumber12InternalizeLER11RReadStream @ 16 NONAME ; CSmsNumber :: InternalizeL ( RReadStream & )
-	_ZN10CSmsNumberD1Ev @ 17 NONAME ; CSmsNumber ::!Extra_ctor_dtor ( void )
-	_ZN10CSmsNumberD2Ev @ 18 NONAME ; CSmsNumber ::!Extra_ctor_dtor ( void )
-	_ZN10CSmsHeader4NewLEP11CSmsMessage @ 19 NONAME ; CSmsHeader :: NewL ( CSmsMessage * )
-	_ZN10CSmsHeader4NewLEN7CSmsPDU11TSmsPDUTypeER13CEditableText @ 20 NONAME ; CSmsHeader :: NewL ( CSmsPDU :: TSmsPDUType , CEditableText & )
-	_ZN10CSmsNumber4NewLEv @ 21 NONAME ; CSmsNumber :: NewL ( void )
-	_ZN10CSmsNumber4NewLERKS_ @ 22 NONAME ; CSmsNumber :: NewL ( CSmsNumber const & )
-	_ZN12CSmsSettings4NewLEv @ 23 NONAME ; CSmsSettings :: NewL ( void )
-	_ZN13TSmsUtilities16PopulateMsgEntryER9TMsvEntryRK11CSmsMessagel4TUid @ 24 NONAME ; TSmsUtilities :: PopulateMsgEntry ( TMsvEntry & , CSmsMessage const & , long , TUid )
-	_ZN12CSmsSettings15RemoveSCAddressEi @ 25 NONAME ; CSmsSettings :: RemoveSCAddress ( int )
-	_ZN10CSmsHeader8RestoreLER9CMsvStore @ 26 NONAME ; CSmsHeader :: RestoreL ( CMsvStore & )
-	_ZN12CSmsSettings8RestoreLER9CMsvStore @ 27 NONAME ; CSmsSettings :: RestoreL ( CMsvStore & )
-	_ZN13CSmsClientMtm26RestoreServiceAndSettingsLEv @ 28 NONAME ; CSmsClientMtm :: RestoreServiceAndSettingsL ( void )
-	_ZN13TSmsUtilities10ServiceIdLER15CMsvServerEntryRl4TUidP18CMsvEntrySelection @ 29 NONAME ; TSmsUtilities :: ServiceIdL ( CMsvServerEntry & , long & , TUid , CMsvEntrySelection * )
-	_ZN13TSmsUtilities10ServiceIdLER9CMsvEntryRl4TUidP18CMsvEntrySelection @ 30 NONAME ; TSmsUtilities :: ServiceIdL ( CMsvEntry & , long & , TUid , CMsvEntrySelection * )
-	_ZN10CSmsHeader15SetSmsSettingsLERK19CSmsMessageSettings @ 31 NONAME ; CSmsHeader :: SetSmsSettingsL ( CSmsMessageSettings const & )
-	_ZNK10CSmsHeader6StoreLER9CMsvStore @ 32 NONAME ; CSmsHeader :: StoreL ( CMsvStore & ) const
-	_ZNK12CSmsSettings6StoreLER9CMsvStore @ 33 NONAME ; CSmsSettings :: StoreL ( CMsvStore & ) const
-	_ZN10CSmsHeaderD0Ev @ 34 NONAME ; CSmsHeader :: ~CSmsHeader ( void )
-	_ZN10CSmsNumberD0Ev @ 35 NONAME ; CSmsNumber :: ~CSmsNumber ( void )
-	_ZN12CSmsSettingsD0Ev @ 36 NONAME ; CSmsSettings :: ~CSmsSettings ( void )
-	_ZN13TSmsUtilities14Dummy_Export_2Ev @ 37 NONAME ; TSmsUtilities :: Dummy_Export_2 ( void )
-	_ZN12CSmsSettings13AddSCAddressLERK7TDesC16S2_ @ 38 NONAME ; CSmsSettings :: AddSCAddressL ( TDesC16 const & , TDesC16const& )
-	_ZN21CSmsSimParamOperation9ProgressLEv @ 39 NONAME ; CSmsSimParamOperation :: ProgressL ( void )
-	_ZN13CSmsClientMtm14ReadSimParamsLER14TRequestStatus @ 40 NONAME ; CSmsClientMtm :: ReadSimParamsL ( TRequestStatus & )
-	_ZNK21CSmsSimParamOperation16ServiceCentersLCEv @ 41 NONAME ; CSmsSimParamOperation :: ServiceCentersLC ( void ) const
-	_ZNK10CSmsNumber7AddressEv @ 42 NONAME ; CSmsNumber :: Address ( void ) const
-	_ZNK10CSmsNumber4NameEv @ 43 NONAME ; CSmsNumber :: Name ( void ) const
-	_ZN10CSmsNumber11SetAddressLERK7TDesC16 @ 44 NONAME ; CSmsNumber :: SetAddressL ( TDesC16 const & )
-	_ZN10CSmsNumber8SetNameLERK7TDesC16 @ 45 NONAME ; CSmsNumber :: SetNameL ( TDesC16 const & )
-	_ZN13CSmsClientMtm14CreateMessageLEl @ 46 NONAME ; CSmsClientMtm :: CreateMessageL ( long )
-	_ZN13TSmsUtilities10ServiceIdLER11CMsvSessionRl4TUidP18CMsvEntrySelection @ 47 NONAME ; TSmsUtilities :: ServiceIdL ( CMsvSession & , long & , TUid , CMsvEntrySelection * )
-	_ZN21CSmsSimParamOperation17RestoreSimParamsLER9CMsvStoreR20CMobilePhoneSmspList @ 48 NONAME ; CSmsSimParamOperation :: RestoreSimParamsL ( CMsvStore & , CMobilePhoneSmspList & )
-	_ZN21CSmsSimParamOperation15StoreSimParamsLER9CMsvStoreRK20CMobilePhoneSmspList @ 49 NONAME ; CSmsSimParamOperation :: StoreSimParamsL ( CMsvStore & , CMobilePhoneSmspList const & )
-	_ZN13CSmsClientMtm15WriteSimParamsLERK20CMobilePhoneSmspListR14TRequestStatus @ 50 NONAME ; CSmsClientMtm :: WriteSimParamsL ( CMobilePhoneSmspList const & , TRequestStatus & )
-	_ZN12CSmsSettings13SaveExternalLER9CMsvStore @ 51 NONAME ; CSmsSettings :: SaveExternalL ( CMsvStore & )
-	_ZN13TSmsUtilities17OpenResourceFileLER3RFs @ 52 NONAME ; TSmsUtilities :: OpenResourceFileL ( RFs & )
-	_ZN13TSmsUtilities19ReadResourceStringLE13RResourceFileiR6TDes16 @ 53 NONAME ; TSmsUtilities :: ReadResourceStringL ( RResourceFile , int , TDes16 & )
-	_ZNK12TMsvSmsEntry10AckSummaryE11TSmsAckType @ 54 NONAME ; TMsvSmsEntry :: AckSummary ( TSmsAckType ) const
-	_ZNK12TMsvSmsEntry9MessageIdERl @ 55 NONAME ; TMsvSmsEntry :: MessageId ( long & ) const
-	_ZN10CSmsNumber12SetAckStatusE11TSmsAckTypeNS_13TSmsAckStatusE @ 56 NONAME ; CSmsNumber :: SetAckStatus ( TSmsAckType , CSmsNumber :: TSmsAckStatus )
-	_ZN12TMsvSmsEntry13SetAckSummaryE11TSmsAckTypeNS_22TMsvSmsEntryAckSummaryE @ 57 NONAME ; TMsvSmsEntry :: SetAckSummary ( TSmsAckType , TMsvSmsEntry :: TMsvSmsEntryAckSummary )
-	_ZN12TMsvSmsEntry12SetMessageIdEli @ 58 NONAME ; TMsvSmsEntry :: SetMessageId ( long , int )
-	_ZNK10CSmsNumber9AckStatusE11TSmsAckType @ 59 NONAME ; CSmsNumber :: AckStatus ( TSmsAckType ) const
-	_ZN10CSmsHeaderD2Ev @ 60 NONAME ; CSmsHeader ::!Extra_ctor_dtor ( void )
-	_ZN19CSmsMessageSettings12InternalizeLER11RReadStream @ 61 NONAME ; CSmsMessageSettings :: InternalizeL ( RReadStream & )
-	_ZN12CSmsSettings12InternalizeLER11RReadStream @ 62 NONAME ; CSmsSettings :: InternalizeL ( RReadStream & )
-	_ZN10CSmsHeaderD1Ev @ 63 NONAME ; CSmsHeader ::!Extra_ctor_dtor ( void )
-	_ZN12CSmsSettingsD2Ev @ 64 NONAME ; CSmsSettings ::!Extra_ctor_dtor ( void )
-	_ZN12CSmsSettingsD1Ev @ 65 NONAME ; CSmsSettings ::!Extra_ctor_dtor ( void )
-	_ZTI10CSmsNumber @ 66 NONAME ABSENT ; !Table ( )
-	_ZTI12CSmsSettings @ 67 NONAME ABSENT ; !Table ( )
-	_ZTI19CSmsMessageSettings @ 68 NONAME ABSENT ; !Table ( )
-	_ZTV10CSmsNumber @ 69 NONAME ABSENT ; !Table ( )
-	_ZTV12CSmsSettings @ 70 NONAME ABSENT ; !Table ( )
-	_ZTV19CSmsMessageSettings @ 71 NONAME ABSENT ; !Table ( )
-	_ZN10CSmsHeader15SetEmailFieldsLERK15CSmsEmailFields @ 72 NONAME
-	_ZN15CSmsEmailFields11AddAddressLERK7TDesC16 @ 73 NONAME
-	_ZN15CSmsEmailFields11SetSubjectLERK7TDesC16 @ 74 NONAME
-	_ZN15CSmsEmailFields13RemoveAddressEi @ 75 NONAME
-	_ZN15CSmsEmailFields4NewLERKS_ @ 76 NONAME
-	_ZN15CSmsEmailFields4NewLEv @ 77 NONAME
-	_ZN15CSmsEmailFields5ResetEv @ 78 NONAME
-	_ZN15CSmsEmailFieldsD0Ev @ 79 NONAME
-	_ZN15CSmsEmailFieldsD1Ev @ 80 NONAME
-	_ZN15CSmsEmailFieldsD2Ev @ 81 NONAME
-	_ZNK10CSmsHeader11EmailFieldsEv @ 82 NONAME
-	_ZNK15CSmsEmailFields10HasAddressEv @ 83 NONAME
-	_ZNK15CSmsEmailFields6LengthEv @ 84 NONAME
-	_ZNK15CSmsEmailFields7SubjectEv @ 85 NONAME
-	_ZNK15CSmsEmailFields9AddressesEv @ 86 NONAME
-	_ZNK15CSmsEmailFields9ComposeLCEv @ 87 NONAME
-
--- a/messagingappbase/smsmtm/clientmtm/eabi/v1.5_smcmu.def	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-EXPORTS
-	_ZN13CSmsClientMtm4NewLER17CRegisteredMtmDllR11CMsvSession @ 1 NONAME ; CSmsClientMtm :: NewL ( CRegisteredMtmDll & , CMsvSession & )
-	_ZN13TSmsUtilities14Dummy_Export_1Ev @ 2 NONAME ; TSmsUtilities :: Dummy_Export_1 ( void )
-	_ZN13CSmsClientMtm15BioTypeChangedLE4TUid @ 3 NONAME ; CSmsClientMtm :: BioTypeChangedL ( TUid )
-	_ZN10CSmsNumber5CopyLERKS_ @ 4 NONAME ; CSmsNumber :: CopyL ( CSmsNumber const & )
-	_ZN12CSmsSettings5CopyLERKS_ @ 5 NONAME ; CSmsSettings :: CopyL ( CSmsSettings const & )
-	_ZN19CSmsMessageSettings5CopyLERKS_ @ 6 NONAME ; CSmsMessageSettings :: CopyL ( CSmsMessageSettings const & )
-	_ZNK10CSmsHeader12ExternalizeLER15RMsvWriteStream @ 7 NONAME ; CSmsHeader :: ExternalizeL ( RMsvWriteStream & ) const
-	_ZNK10CSmsNumber12ExternalizeLER12RWriteStream @ 8 NONAME ; CSmsNumber :: ExternalizeL ( RWriteStream & ) const
-	_ZNK12CSmsSettings12ExternalizeLER12RWriteStream @ 9 NONAME ; CSmsSettings :: ExternalizeL ( RWriteStream & ) const
-	_ZNK19CSmsMessageSettings12ExternalizeLER12RWriteStream @ 10 NONAME ; CSmsMessageSettings :: ExternalizeL ( RWriteStream & ) const
-	_ZN13TSmsUtilities14GetDescriptionERK11CSmsMessageR6TDes16i @ 11 NONAME ; TSmsUtilities :: GetDescription ( CSmsMessage const & , TDes16 & , int )
-	_ZN13TSmsUtilities10GetDetailsER3RFsRK11CSmsMessageR6TDes16i @ 12 NONAME ; TSmsUtilities :: GetDetails ( RFs & , CSmsMessage const & , TDes16 & , int )
-	_ZN13TSmsUtilities10GetDetailsER3RFsRK7TDesC16R6TDes16i @ 13 NONAME ; TSmsUtilities :: GetDetails ( RFs & , TDesC16 const & , TDes16 & , int )
-	_ZNK10CSmsHeader15GetSmsSettingsLER19CSmsMessageSettings @ 14 NONAME ; CSmsHeader :: GetSmsSettingsL ( CSmsMessageSettings & ) const
-	_ZN10CSmsHeader12InternalizeLER14RMsvReadStream @ 15 NONAME ; CSmsHeader :: InternalizeL ( RMsvReadStream & )
-	_ZN10CSmsNumber12InternalizeLER11RReadStream @ 16 NONAME ; CSmsNumber :: InternalizeL ( RReadStream & )
-	_ZN10CSmsNumberD1Ev @ 17 NONAME ;  CSmsNumber ::!Extra_ctor_dtor ( void )
-	_ZN10CSmsNumberD2Ev @ 18 NONAME ;  CSmsNumber ::!Extra_ctor_dtor ( void )
-	_ZN10CSmsHeader4NewLEP11CSmsMessage @ 19 NONAME ; CSmsHeader :: NewL ( CSmsMessage * )
-	_ZN10CSmsHeader4NewLEN7CSmsPDU11TSmsPDUTypeER13CEditableText @ 20 NONAME ; CSmsHeader :: NewL ( CSmsPDU :: TSmsPDUType , CEditableText & )
-	_ZN10CSmsNumber4NewLEv @ 21 NONAME ; CSmsNumber :: NewL ( void )
-	_ZN10CSmsNumber4NewLERKS_ @ 22 NONAME ; CSmsNumber :: NewL ( CSmsNumber const & )
-	_ZN12CSmsSettings4NewLEv @ 23 NONAME ; CSmsSettings :: NewL ( void )
-	_ZN13TSmsUtilities16PopulateMsgEntryER9TMsvEntryRK11CSmsMessagel4TUid @ 24 NONAME ; TSmsUtilities :: PopulateMsgEntry ( TMsvEntry & , CSmsMessage const & , long , TUid )
-	_ZN12CSmsSettings15RemoveSCAddressEi @ 25 NONAME ; CSmsSettings :: RemoveSCAddress ( int )
-	_ZN10CSmsHeader8RestoreLER9CMsvStore @ 26 NONAME ; CSmsHeader :: RestoreL ( CMsvStore & )
-	_ZN12CSmsSettings8RestoreLER9CMsvStore @ 27 NONAME ; CSmsSettings :: RestoreL ( CMsvStore & )
-	_ZN13CSmsClientMtm26RestoreServiceAndSettingsLEv @ 28 NONAME ; CSmsClientMtm :: RestoreServiceAndSettingsL ( void )
-	_ZN13TSmsUtilities10ServiceIdLER15CMsvServerEntryRl4TUidP18CMsvEntrySelection @ 29 NONAME ; TSmsUtilities :: ServiceIdL ( CMsvServerEntry & , long & , TUid , CMsvEntrySelection * )
-	_ZN13TSmsUtilities10ServiceIdLER9CMsvEntryRl4TUidP18CMsvEntrySelection @ 30 NONAME ; TSmsUtilities :: ServiceIdL ( CMsvEntry & , long & , TUid , CMsvEntrySelection * )
-	_ZN10CSmsHeader15SetSmsSettingsLERK19CSmsMessageSettings @ 31 NONAME ; CSmsHeader :: SetSmsSettingsL ( CSmsMessageSettings const & )
-	_ZNK10CSmsHeader6StoreLER9CMsvStore @ 32 NONAME ; CSmsHeader :: StoreL ( CMsvStore & ) const
-	_ZNK12CSmsSettings6StoreLER9CMsvStore @ 33 NONAME ; CSmsSettings :: StoreL ( CMsvStore & ) const
-	_ZN10CSmsHeaderD0Ev @ 34 NONAME ; CSmsHeader :: ~CSmsHeader ( void )
-	_ZN10CSmsNumberD0Ev @ 35 NONAME ; CSmsNumber :: ~CSmsNumber ( void )
-	_ZN12CSmsSettingsD0Ev @ 36 NONAME ; CSmsSettings :: ~CSmsSettings ( void )
-	_ZN13TSmsUtilities14Dummy_Export_2Ev @ 37 NONAME ; TSmsUtilities :: Dummy_Export_2 ( void )
-	_ZN12CSmsSettings13AddSCAddressLERK7TDesC16S2_ @ 38 NONAME ; CSmsSettings :: AddSCAddressL ( TDesC16 const & , TDesC16const& )
-	_ZN21CSmsSimParamOperation9ProgressLEv @ 39 NONAME ; CSmsSimParamOperation :: ProgressL ( void )
-	_ZN13CSmsClientMtm14ReadSimParamsLER14TRequestStatus @ 40 NONAME ; CSmsClientMtm :: ReadSimParamsL ( TRequestStatus & )
-	_ZNK21CSmsSimParamOperation16ServiceCentersLCEv @ 41 NONAME ; CSmsSimParamOperation :: ServiceCentersLC ( void ) const
-	_ZNK10CSmsNumber7AddressEv @ 42 NONAME ; CSmsNumber :: Address ( void ) const
-	_ZNK10CSmsNumber4NameEv @ 43 NONAME ; CSmsNumber :: Name ( void ) const
-	_ZN10CSmsNumber11SetAddressLERK7TDesC16 @ 44 NONAME ; CSmsNumber :: SetAddressL ( TDesC16 const & )
-	_ZN10CSmsNumber8SetNameLERK7TDesC16 @ 45 NONAME ; CSmsNumber :: SetNameL ( TDesC16 const & )
-	_ZN13CSmsClientMtm14CreateMessageLEl @ 46 NONAME ; CSmsClientMtm :: CreateMessageL ( long )
-	_ZN13TSmsUtilities10ServiceIdLER11CMsvSessionRl4TUidP18CMsvEntrySelection @ 47 NONAME ; TSmsUtilities :: ServiceIdL ( CMsvSession & , long & , TUid , CMsvEntrySelection * )
-	_ZN21CSmsSimParamOperation17RestoreSimParamsLER9CMsvStoreR20CMobilePhoneSmspList @ 48 NONAME ; CSmsSimParamOperation :: RestoreSimParamsL ( CMsvStore & , CMobilePhoneSmspList & )
-	_ZN21CSmsSimParamOperation15StoreSimParamsLER9CMsvStoreRK20CMobilePhoneSmspList @ 49 NONAME ; CSmsSimParamOperation :: StoreSimParamsL ( CMsvStore & , CMobilePhoneSmspList const & )
-	_ZN13CSmsClientMtm15WriteSimParamsLERK20CMobilePhoneSmspListR14TRequestStatus @ 50 NONAME ; CSmsClientMtm :: WriteSimParamsL ( CMobilePhoneSmspList const & , TRequestStatus & )
-	_ZN12CSmsSettings13SaveExternalLER9CMsvStore @ 51 NONAME ; CSmsSettings :: SaveExternalL ( CMsvStore & )
-	_ZN13TSmsUtilities17OpenResourceFileLER3RFs @ 52 NONAME ; TSmsUtilities :: OpenResourceFileL ( RFs & )
-	_ZN13TSmsUtilities19ReadResourceStringLE13RResourceFileiR6TDes16 @ 53 NONAME ; TSmsUtilities :: ReadResourceStringL ( RResourceFile , int , TDes16 & )
-	_ZNK12TMsvSmsEntry10AckSummaryE11TSmsAckType @ 54 NONAME ; TMsvSmsEntry :: AckSummary ( TSmsAckType ) const
-	_ZNK12TMsvSmsEntry9MessageIdERl @ 55 NONAME ; TMsvSmsEntry :: MessageId ( long & ) const
-	_ZN10CSmsNumber12SetAckStatusE11TSmsAckTypeNS_13TSmsAckStatusE @ 56 NONAME ; CSmsNumber :: SetAckStatus ( TSmsAckType , CSmsNumber :: TSmsAckStatus )
-	_ZN12TMsvSmsEntry13SetAckSummaryE11TSmsAckTypeNS_22TMsvSmsEntryAckSummaryE @ 57 NONAME ; TMsvSmsEntry :: SetAckSummary ( TSmsAckType , TMsvSmsEntry :: TMsvSmsEntryAckSummary )
-	_ZN12TMsvSmsEntry12SetMessageIdEli @ 58 NONAME ; TMsvSmsEntry :: SetMessageId ( long , int )
-	_ZNK10CSmsNumber9AckStatusE11TSmsAckType @ 59 NONAME ; CSmsNumber :: AckStatus ( TSmsAckType ) const
-	_ZN10CSmsHeaderD2Ev @ 60 NONAME ;  CSmsHeader ::!Extra_ctor_dtor ( void )
-	_ZN19CSmsMessageSettings12InternalizeLER11RReadStream @ 61 NONAME ;  CSmsMessageSettings :: InternalizeL ( RReadStream & )
-	_ZN12CSmsSettings12InternalizeLER11RReadStream @ 62 NONAME ;  CSmsSettings :: InternalizeL ( RReadStream & )
-	_ZN10CSmsHeaderD1Ev @ 63 NONAME ;  CSmsHeader ::!Extra_ctor_dtor ( void )
-	_ZN12CSmsSettingsD2Ev @ 64 NONAME ;  CSmsSettings ::!Extra_ctor_dtor ( void )
-	_ZN12CSmsSettingsD1Ev @ 65 NONAME ;  CSmsSettings ::!Extra_ctor_dtor ( void )
-	_ZTI10CSmsNumber @ 66 NONAME ABSENT ;  !Table ( )
-	_ZTI12CSmsSettings @ 67 NONAME ABSENT ;  !Table ( )
-	_ZTI19CSmsMessageSettings @ 68 NONAME ABSENT ;  !Table ( )
-	_ZTV10CSmsNumber @ 69 NONAME ABSENT ;  !Table ( )
-	_ZTV12CSmsSettings @ 70 NONAME ABSENT ;  !Table ( )
-	_ZTV19CSmsMessageSettings @ 71 NONAME ABSENT ;  !Table ( )
-	_ZN15CSmsEmailFields11AddAddressLERK7TDesC16 @ 72 NONAME
-	_ZN15CSmsEmailFields11SetSubjectLERK7TDesC16 @ 73 NONAME
-	_ZN15CSmsEmailFields13RemoveAddressEi @ 74 NONAME
-	_ZN15CSmsEmailFields4NewLERKS_ @ 75 NONAME
-	_ZN15CSmsEmailFields4NewLEv @ 76 NONAME
-	_ZN15CSmsEmailFields5ResetEv @ 77 NONAME
-	_ZN15CSmsEmailFieldsD0Ev @ 78 NONAME
-	_ZN15CSmsEmailFieldsD1Ev @ 79 NONAME
-	_ZN15CSmsEmailFieldsD2Ev @ 80 NONAME
-	_ZNK15CSmsEmailFields10HasAddressEv @ 81 NONAME
-	_ZNK15CSmsEmailFields6LengthEv @ 82 NONAME
-	_ZNK15CSmsEmailFields7SubjectEv @ 83 NONAME
-	_ZNK15CSmsEmailFields9AddressesEv @ 84 NONAME
-	_ZNK15CSmsEmailFields9ComposeLCEv @ 85 NONAME
-	_ZN11CSmsAccount13LoadSettingsLER12CSmsSettings @ 86 NONAME
-	_ZN11CSmsAccount13LoadSettingsLER20CMsvScheduleSettingsR16CMsvOffPeakTimesR20CMsvSendErrorActionsR19CMsvSysAgentActions @ 87 NONAME
-	_ZN11CSmsAccount26InitialiseDefaultSettingsLER12CSmsSettings @ 88 NONAME
-	_ZN11CSmsAccount26InitialiseDefaultSettingsLER20CMsvScheduleSettingsR16CMsvOffPeakTimesR20CMsvSendErrorActionsR19CMsvSysAgentActions @ 89 NONAME
-	_ZN11CSmsAccount4NewLEv @ 90 NONAME
-	_ZN11CSmsAccount5NewLCEv @ 91 NONAME
-	_ZN11CSmsAccountD0Ev @ 92 NONAME
-	_ZN11CSmsAccountD1Ev @ 93 NONAME
-	_ZN11CSmsAccountD2Ev @ 94 NONAME
-	_ZN12CSmsSettings17AddServiceCenterLERK7TDesC16S2_ @ 95 NONAME
-	_ZN12CSmsSettings19RemoveServiceCenterEi @ 96 NONAME
-	_ZN12CSmsSettings23SetDefaultServiceCenterEi @ 97 NONAME
-	_ZN12CSmsSettings5NewLCEv @ 98 NONAME
-	_ZN17CSmsServiceCenter11SetAddressLERK7TDesC16 @ 99 NONAME
-	_ZN17CSmsServiceCenter4NewLERKS_ @ 100 NONAME
-	_ZN17CSmsServiceCenter4NewLEv @ 101 NONAME
-	_ZN17CSmsServiceCenter5CopyLERKS_ @ 102 NONAME
-	_ZN17CSmsServiceCenter8SetNameLERK7TDesC16 @ 103 NONAME
-	_ZN17CSmsServiceCenterD0Ev @ 104 NONAME
-	_ZN17CSmsServiceCenterD1Ev @ 105 NONAME
-	_ZN17CSmsServiceCenterD2Ev @ 106 NONAME
-	_ZNK11CSmsAccount13SaveSettingsLERK12CSmsSettings @ 107 NONAME
-	_ZNK11CSmsAccount13SaveSettingsLERK20CMsvScheduleSettingsRK16CMsvOffPeakTimesRK20CMsvSendErrorActionsRK19CMsvSysAgentActions @ 108 NONAME
-	_ZNK12CSmsSettings16GetServiceCenterEi @ 109 NONAME
-	_ZNK12CSmsSettings18ServiceCenterCountEv @ 110 NONAME
-	_ZNK12CSmsSettings20DefaultServiceCenterEv @ 111 NONAME
-	_ZNK17CSmsServiceCenter4NameEv @ 112 NONAME
-	_ZNK17CSmsServiceCenter7AddressEv @ 113 NONAME
--- a/messagingappbase/smsmtm/clientmtm/eabi/v2_smcmu.def	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,293 +0,0 @@
-EXPORTS
-	_ZN13CSmsClientMtm4NewLER17CRegisteredMtmDllR11CMsvSession @ 1 NONAME ; CSmsClientMtm :: NewL ( CRegisteredMtmDll & , CMsvSession & )
-	_ZN13TSmsUtilities14Dummy_Export_1Ev @ 2 NONAME ABSENT ; TSmsUtilities :: Dummy_Export_1 ( void )
-	_ZN13CSmsClientMtm15BioTypeChangedLE4TUid @ 3 NONAME ; CSmsClientMtm :: BioTypeChangedL ( TUid )
-	_ZN10CSmsNumber5CopyLERKS_ @ 4 NONAME ; CSmsNumber :: CopyL ( CSmsNumber const & )
-	_ZN12CSmsSettings5CopyLERKS_ @ 5 NONAME ; CSmsSettings :: CopyL ( CSmsSettings const & )
-	_ZN19CSmsMessageSettings5CopyLERKS_ @ 6 NONAME ; CSmsMessageSettings :: CopyL ( CSmsMessageSettings const & )
-	_ZNK10CSmsHeader12ExternalizeLER15RMsvWriteStream @ 7 NONAME ; CSmsHeader :: ExternalizeL ( RMsvWriteStream & ) const
-	_ZNK10CSmsNumber12ExternalizeLER12RWriteStream @ 8 NONAME ; CSmsNumber :: ExternalizeL ( RWriteStream & ) const
-	_ZNK12CSmsSettings12ExternalizeLER12RWriteStream @ 9 NONAME ABSENT ; CSmsSettings :: ExternalizeL ( RWriteStream & ) const
-	_ZNK19CSmsMessageSettings12ExternalizeLER12RWriteStream @ 10 NONAME ; CSmsMessageSettings :: ExternalizeL ( RWriteStream & ) const
-	_ZN13TSmsUtilities14GetDescriptionERK11CSmsMessageR6TDes16i @ 11 NONAME ; TSmsUtilities :: GetDescription ( CSmsMessage const & , TDes16 & , int )
-	_ZN13TSmsUtilities10GetDetailsER3RFsRK11CSmsMessageR6TDes16i @ 12 NONAME ; TSmsUtilities :: GetDetails ( RFs & , CSmsMessage const & , TDes16 & , int )
-	_ZN13TSmsUtilities10GetDetailsER3RFsRK7TDesC16R6TDes16i @ 13 NONAME ; TSmsUtilities :: GetDetails ( RFs & , TDesC16 const & , TDes16 & , int )
-	_ZNK10CSmsHeader15GetSmsSettingsLER19CSmsMessageSettings @ 14 NONAME ; CSmsHeader :: GetSmsSettingsL ( CSmsMessageSettings & ) const
-	_ZN10CSmsHeader12InternalizeLER14RMsvReadStream @ 15 NONAME ; CSmsHeader :: InternalizeL ( RMsvReadStream & )
-	_ZN10CSmsNumber12InternalizeLER11RReadStream @ 16 NONAME ; CSmsNumber :: InternalizeL ( RReadStream & )
-	_ZN10CSmsNumberD1Ev @ 17 NONAME ; CSmsNumber ::!Extra_ctor_dtor ( void )
-	_ZN10CSmsNumberD2Ev @ 18 NONAME ; CSmsNumber ::!Extra_ctor_dtor ( void )
-	_ZN10CSmsHeader4NewLEP11CSmsMessage @ 19 NONAME ; CSmsHeader :: NewL ( CSmsMessage * )
-	_ZN10CSmsHeader4NewLEN7CSmsPDU11TSmsPDUTypeER13CEditableText @ 20 NONAME ; CSmsHeader :: NewL ( CSmsPDU :: TSmsPDUType , CEditableText & )
-	_ZN10CSmsNumber4NewLEv @ 21 NONAME ; CSmsNumber :: NewL ( void )
-	_ZN10CSmsNumber4NewLERKS_ @ 22 NONAME ; CSmsNumber :: NewL ( CSmsNumber const & )
-	_ZN12CSmsSettings4NewLEv @ 23 NONAME ; CSmsSettings :: NewL ( void )
-	_ZN13TSmsUtilities16PopulateMsgEntryER9TMsvEntryRK11CSmsMessagel4TUid @ 24 NONAME ; TSmsUtilities :: PopulateMsgEntry ( TMsvEntry & , CSmsMessage const & , long , TUid )
-	_ZN12CSmsSettings15RemoveSCAddressEi @ 25 NONAME ABSENT ; CSmsSettings :: RemoveSCAddress ( int )
-	_ZN10CSmsHeader8RestoreLER9CMsvStore @ 26 NONAME ; CSmsHeader :: RestoreL ( CMsvStore & )
-	_ZN12CSmsSettings8RestoreLER9CMsvStore @ 27 NONAME ABSENT ; CSmsSettings :: RestoreL ( CMsvStore & )
-	_ZN13CSmsClientMtm26RestoreServiceAndSettingsLEv @ 28 NONAME ; CSmsClientMtm :: RestoreServiceAndSettingsL ( void )
-	_ZN13TSmsUtilities10ServiceIdLER15CMsvServerEntryRl4TUidP18CMsvEntrySelection @ 29 NONAME ; TSmsUtilities :: ServiceIdL ( CMsvServerEntry & , long & , TUid , CMsvEntrySelection * )
-	_ZN13TSmsUtilities10ServiceIdLER9CMsvEntryRl4TUidP18CMsvEntrySelection @ 30 NONAME ; TSmsUtilities :: ServiceIdL ( CMsvEntry & , long & , TUid , CMsvEntrySelection * )
-	_ZN10CSmsHeader15SetSmsSettingsLERK19CSmsMessageSettings @ 31 NONAME ; CSmsHeader :: SetSmsSettingsL ( CSmsMessageSettings const & )
-	_ZNK10CSmsHeader6StoreLER9CMsvStore @ 32 NONAME ; CSmsHeader :: StoreL ( CMsvStore & ) const
-	_ZNK12CSmsSettings6StoreLER9CMsvStore @ 33 NONAME ABSENT ; CSmsSettings :: StoreL ( CMsvStore & ) const
-	_ZN10CSmsHeaderD0Ev @ 34 NONAME ; CSmsHeader :: ~CSmsHeader ( void )
-	_ZN10CSmsNumberD0Ev @ 35 NONAME ; CSmsNumber :: ~CSmsNumber ( void )
-	_ZN12CSmsSettingsD0Ev @ 36 NONAME ; CSmsSettings :: ~CSmsSettings ( void )
-	_ZN13TSmsUtilities14Dummy_Export_2Ev @ 37 NONAME ABSENT ; TSmsUtilities :: Dummy_Export_2 ( void )
-	_ZN12CSmsSettings13AddSCAddressLERK7TDesC16S2_ @ 38 NONAME ABSENT ; CSmsSettings :: AddSCAddressL ( TDesC16 const & , TDesC16const& )
-	_ZN21CSmsSimParamOperation9ProgressLEv @ 39 NONAME ; CSmsSimParamOperation :: ProgressL ( void )
-	_ZN13CSmsClientMtm14ReadSimParamsLER14TRequestStatus @ 40 NONAME ; CSmsClientMtm :: ReadSimParamsL ( TRequestStatus & )
-	_ZNK21CSmsSimParamOperation16ServiceCentersLCEv @ 41 NONAME ; CSmsSimParamOperation :: ServiceCentersLC ( void ) const
-	_ZNK10CSmsNumber7AddressEv @ 42 NONAME ; CSmsNumber :: Address ( void ) const
-	_ZNK10CSmsNumber4NameEv @ 43 NONAME ; CSmsNumber :: Name ( void ) const
-	_ZN10CSmsNumber11SetAddressLERK7TDesC16 @ 44 NONAME ; CSmsNumber :: SetAddressL ( TDesC16 const & )
-	_ZN10CSmsNumber8SetNameLERK7TDesC16 @ 45 NONAME ; CSmsNumber :: SetNameL ( TDesC16 const & )
-	_ZN13CSmsClientMtm14CreateMessageLEl @ 46 NONAME ; CSmsClientMtm :: CreateMessageL ( long )
-	_ZN13TSmsUtilities10ServiceIdLER11CMsvSessionRl4TUidP18CMsvEntrySelection @ 47 NONAME ; TSmsUtilities :: ServiceIdL ( CMsvSession & , long & , TUid , CMsvEntrySelection * )
-	_ZN21CSmsSimParamOperation17RestoreSimParamsLER9CMsvStoreR20CMobilePhoneSmspList @ 48 NONAME ; CSmsSimParamOperation :: RestoreSimParamsL ( CMsvStore & , CMobilePhoneSmspList & )
-	_ZN21CSmsSimParamOperation15StoreSimParamsLER9CMsvStoreRK20CMobilePhoneSmspList @ 49 NONAME ; CSmsSimParamOperation :: StoreSimParamsL ( CMsvStore & , CMobilePhoneSmspList const & )
-	_ZN13CSmsClientMtm15WriteSimParamsLERK20CMobilePhoneSmspListR14TRequestStatus @ 50 NONAME ; CSmsClientMtm :: WriteSimParamsL ( CMobilePhoneSmspList const & , TRequestStatus & )
-	_ZN12CSmsSettings13SaveExternalLER9CMsvStore @ 51 NONAME ABSENT ; CSmsSettings :: SaveExternalL ( CMsvStore & )
-	_ZN13TSmsUtilities17OpenResourceFileLER3RFs @ 52 NONAME ; TSmsUtilities :: OpenResourceFileL ( RFs & )
-	_ZN13TSmsUtilities19ReadResourceStringLE13RResourceFileiR6TDes16 @ 53 NONAME ; TSmsUtilities :: ReadResourceStringL ( RResourceFile , int , TDes16 & )
-	_ZNK12TMsvSmsEntry10AckSummaryE11TSmsAckType @ 54 NONAME ; TMsvSmsEntry :: AckSummary ( TSmsAckType ) const
-	_ZNK12TMsvSmsEntry9MessageIdERl @ 55 NONAME ; TMsvSmsEntry :: MessageId ( long & ) const
-	_ZN10CSmsNumber12SetAckStatusE11TSmsAckTypeNS_13TSmsAckStatusE @ 56 NONAME ; CSmsNumber :: SetAckStatus ( TSmsAckType , CSmsNumber :: TSmsAckStatus )
-	_ZN12TMsvSmsEntry13SetAckSummaryE11TSmsAckTypeNS_22TMsvSmsEntryAckSummaryE @ 57 NONAME ; TMsvSmsEntry :: SetAckSummary ( TSmsAckType , TMsvSmsEntry :: TMsvSmsEntryAckSummary )
-	_ZN12TMsvSmsEntry12SetMessageIdEli @ 58 NONAME ; TMsvSmsEntry :: SetMessageId ( long , int )
-	_ZNK10CSmsNumber9AckStatusE11TSmsAckType @ 59 NONAME ; CSmsNumber :: AckStatus ( TSmsAckType ) const
-	_ZN10CSmsHeaderD2Ev @ 60 NONAME ; CSmsHeader ::!Extra_ctor_dtor ( void )
-	_ZN19CSmsMessageSettings12InternalizeLER11RReadStream @ 61 NONAME ; CSmsMessageSettings :: InternalizeL ( RReadStream & )
-	_ZN12CSmsSettings12InternalizeLER11RReadStream @ 62 NONAME ABSENT ; CSmsSettings :: InternalizeL ( RReadStream & )
-	_ZN10CSmsHeaderD1Ev @ 63 NONAME ; CSmsHeader ::!Extra_ctor_dtor ( void )
-	_ZN12CSmsSettingsD2Ev @ 64 NONAME ; CSmsSettings ::!Extra_ctor_dtor ( void )
-	_ZN12CSmsSettingsD1Ev @ 65 NONAME ; CSmsSettings ::!Extra_ctor_dtor ( void )
-	_ZTI10CSmsNumber @ 66 NONAME ABSENT ; !Table ( )
-	_ZTI12CSmsSettings @ 67 NONAME ABSENT ; !Table ( )
-	_ZTI19CSmsMessageSettings @ 68 NONAME ABSENT ; !Table ( )
-	_ZTV10CSmsNumber @ 69 NONAME ABSENT ; !Table ( )
-	_ZTV12CSmsSettings @ 70 NONAME ABSENT ; !Table ( )
-	_ZTV19CSmsMessageSettings @ 71 NONAME ABSENT ; !Table ( )
-	_ZN10CSmsHeader15SetEmailFieldsLERK15CSmsEmailFields @ 72 NONAME
-	_ZN15CSmsEmailFields11AddAddressLERK7TDesC16 @ 73 NONAME
-	_ZN15CSmsEmailFields11SetSubjectLERK7TDesC16 @ 74 NONAME
-	_ZN15CSmsEmailFields13RemoveAddressEi @ 75 NONAME
-	_ZN15CSmsEmailFields4NewLERKS_ @ 76 NONAME
-	_ZN15CSmsEmailFields4NewLEv @ 77 NONAME
-	_ZN15CSmsEmailFields5ResetEv @ 78 NONAME
-	_ZN15CSmsEmailFieldsD0Ev @ 79 NONAME
-	_ZN15CSmsEmailFieldsD1Ev @ 80 NONAME
-	_ZN15CSmsEmailFieldsD2Ev @ 81 NONAME
-	_ZNK10CSmsHeader11EmailFieldsEv @ 82 NONAME
-	_ZNK15CSmsEmailFields10HasAddressEv @ 83 NONAME
-	_ZNK15CSmsEmailFields6LengthEv @ 84 NONAME
-	_ZNK15CSmsEmailFields7SubjectEv @ 85 NONAME
-	_ZNK15CSmsEmailFields9AddressesEv @ 86 NONAME
-	_ZNK15CSmsEmailFields9ComposeLCEv @ 87 NONAME
-	_ZN10CSmsHeader10BioMessageEv @ 88 NONAME ABSENT
-	_ZN10CSmsHeader10GsmMessageEv @ 89 NONAME ABSENT
-	_ZN10CSmsHeader10SmsMessageEv @ 90 NONAME ABSENT
-	_ZN10CSmsHeader11CdmaMessageEv @ 91 NONAME ABSENT
-	_ZN10CSmsHeader11MessageTypeEv @ 92 NONAME ABSENT
-	_ZN10CSmsHeader13ResetSIMSlotsEv @ 93 NONAME ABSENT
-	_ZN10CSmsHeader25SetAcknowledgementRequestE11TSmsAckTypei @ 94 NONAME ABSENT
-	_ZN10CSmsHeader26SetDefaultMessageSettingsLERK12CSmsSettings @ 95 NONAME ABSENT
-	_ZN10CSmsHeader4NewLEP15CCdmaSmsMessage @ 96 NONAME ABSENT
-	_ZN10CSmsHeader4NewLEtR13CEditableText @ 97 NONAME ABSENT
-	_ZN10CSmsHeader4NewLEtR13CEditableTextt @ 98 NONAME ABSENT
-	_ZN10CSmsHeader8RestoreLER9CMsvStoreR13CEditableText @ 99 NONAME ABSENT
-	_ZN10CSmsNumber10SetUserAckEh @ 100 NONAME ABSENT
-	_ZN10CSmsNumber11SetAddressLERK7TDesC1615TMsvAddressType @ 101 NONAME ABSENT
-	_ZN10CSmsNumber12SetMessageIdEi @ 102 NONAME ABSENT
-	_ZN12CSmsSettings12SetDigitModeE17TSmsCdmaDigitMode @ 103 NONAME ABSENT
-	_ZN12CSmsSettings15MessageSettingsEv @ 104 NONAME ABSENT
-	_ZN12CSmsSettings18SetAlertOnDeliveryEh @ 105 NONAME ABSENT
-	_ZN12CSmsSettings20PreferedLanguageListEv @ 106 NONAME ABSENT
-	_ZN12CSmsSettings21SetDefaultTeleserviceEt @ 107 NONAME ABSENT
-	_ZN12CSmsSettings21SetMessageDisplayModeEh @ 108 NONAME ABSENT
-	_ZN12CSmsSettings22SetEMailGatewayNumberLERK7TDesC16 @ 109 NONAME ABSENT
-	_ZN12CSmsSettings27SetReplyWithOriginalMessageE21TSmsReplyWithOriginal @ 110 NONAME ABSENT
-	_ZN13TSmsGenerator19GenerateGsmMessageLER10CSmsHeaderRK9CRichText @ 111 NONAME ABSENT
-	_ZN13TSmsGenerator20GenerateCdmaMessageLER10CSmsHeaderRK9CRichText @ 112 NONAME ABSENT
-	_ZN13TSmsUtilities14GetDetailsCdmaER3RFsRK15CCdmaSmsMessageR6TDes16i @ 113 NONAME ABSENT
-	_ZN13TSmsUtilities16ConvertToMinutesE20TSmsRelativeTimeUnitmRi @ 114 NONAME ABSENT
-	_ZN13TSmsUtilities18ConvertFromMinutesER20TSmsRelativeTimeUnitRmi @ 115 NONAME ABSENT
-	_ZN13TSmsUtilities18GetDescriptionCdmaER3RFsRK15CCdmaSmsMessageR6TDes16i @ 116 NONAME ABSENT
-	_ZN13TSmsUtilities18GetGsmMessageTypeLEt18TSmsMessageBearing @ 117 NONAME ABSENT
-	_ZN13TSmsUtilities19GetCdmaMessageTypeLEt18TSmsMessageBearing @ 118 NONAME ABSENT
-	_ZN13TSmsUtilities20ConvertMinutesToCdmaEiRh @ 119 NONAME ABSENT
-	_ZN13TSmsUtilities20PopulateMsgEntryCdmaER9TMsvEntryRK15CCdmaSmsMessagel4TUid @ 120 NONAME ABSENT
-	_ZN13TSmsUtilities24ConvertAddressTypeToCdmaE15TMsvAddressTypeR20TSmsCdmaEndPointInfo @ 121 NONAME ABSENT
-	_ZN13TSmsUtilities25ConvertCdmaToRelativeTimeEhR20TSmsRelativeTimeUnitRm @ 122 NONAME ABSENT
-	_ZN13TSmsUtilities25ConvertRelativeTimeToCdmaERh20TSmsRelativeTimeUnitm @ 123 NONAME ABSENT
-	_ZN13TSmsUtilities26ConvertAddressTypeFromCdmaEhh @ 124 NONAME ABSENT
-	_ZN13TSmsUtilities30ConvertCharacterEncodingToGsmLEt @ 125 NONAME ABSENT
-	_ZN13TSmsUtilities31ConvertCharacterEncodingToCdmaLEt @ 126 NONAME ABSENT
-	_ZN14TMsvMessageBio11SetEncodingEt @ 127 NONAME ABSENT
-	_ZN14TMsvMessageBio15SetBioMsgIdTypeE13TBioMsgIdType @ 128 NONAME ABSENT
-	_ZN14TMsvMessageGsm14SetCommandTypeE17TMsvSmsGsmCommand @ 129 NONAME ABSENT
-	_ZN14TMsvMessageGsm19SetRejectDuplicatesEi @ 130 NONAME ABSENT
-	_ZN14TMsvMessageGsm20SetReplyPathProvidedEi @ 131 NONAME ABSENT
-	_ZN14TMsvMessageGsm24SetServiceCenterAddressLERK7TDesC16 @ 132 NONAME ABSENT
-	_ZN14TMsvMessageGsm8SetClassEi15TMsvSmsGsmClass @ 133 NONAME ABSENT
-	_ZN14TMsvMessageSms25AddEMSInformationElementLERK22CEmsInformationElement @ 134 NONAME ABSENT
-	_ZN14TMsvMessageSms26SetValidityPeriodAbsoluteLERK9TDateTime @ 135 NONAME ABSENT
-	_ZN14TMsvMessageSms26SetValidityPeriodRelativeLE20TSmsRelativeTimeUnitm @ 136 NONAME ABSENT
-	_ZN14TMsvMessageSms28RemoveEMSInformationElementLEjN22CSmsInformationElement32TSmsInformationElementIdentifierE @ 137 NONAME ABSENT
-	_ZN14TMsvMessageSms29RemoveEMSInformationElementsLEjN22CSmsInformationElement32TSmsInformationElementIdentifierE @ 138 NONAME ABSENT
-	_ZN14TMsvMessageSms9ResetEMSLEv @ 139 NONAME ABSENT
-	_ZN15TMsvMessageCdma18SetCallbackNumberLERK7TDesC16 @ 140 NONAME ABSENT
-	_ZN15TMsvMessageCdma19SetAlertOnDeliveryLEh @ 141 NONAME ABSENT
-	_ZN15TMsvMessageCdma20SetPrivacyIndicatorLEh @ 142 NONAME ABSENT
-	_ZN15TMsvMessageCdma20SetUserResponseCodeLEh @ 143 NONAME ABSENT
-	_ZN15TMsvMessageCdma21SetLanguageIndicatorLEh @ 144 NONAME ABSENT
-	_ZN15TMsvMessageCdma21SetPriorityIndicatorLEh @ 145 NONAME ABSENT
-	_ZN15TMsvMessageCdma22ResetMessageParametersEv @ 146 NONAME ABSENT
-	_ZN15TMsvMessageCdma23SetMessageDepositIndexLEt @ 147 NONAME ABSENT
-	_ZN15TMsvMessageCdma32GetDeferredDeliveryTimeAbsoluteLER9TDateTime @ 148 NONAME ABSENT
-	_ZN15TMsvMessageCdma32SetDeferredDeliveryTimeAbsoluteLERK9TDateTime @ 149 NONAME ABSENT
-	_ZN15TMsvMessageCdma32SetDeferredDeliveryTimeRelativeLE20TSmsRelativeTimeUnitm @ 150 NONAME ABSENT
-	_ZN16TSmsReplyOptions10SetReadAckEi @ 151 NONAME ABSENT
-	_ZN16TSmsReplyOptions10SetUserAckEi @ 152 NONAME ABSENT
-	_ZN16TSmsReplyOptions14SetDeliveryAckEi @ 153 NONAME ABSENT
-	_ZN16TSmsReplyOptions15SetTransportAckEi @ 154 NONAME ABSENT
-	_ZN16TSmsReplyOptionsC1Eiiii @ 155 NONAME ABSENT
-	_ZN16TSmsReplyOptionsC1Ev @ 156 NONAME ABSENT
-	_ZN16TSmsReplyOptionsC2Eiiii @ 157 NONAME ABSENT
-	_ZN16TSmsReplyOptionsC2Ev @ 158 NONAME ABSENT
-	_ZN20TSmsCdmaEndPointInfoC1Ev @ 159 NONAME ABSENT
-	_ZN20TSmsCdmaEndPointInfoC2Ev @ 160 NONAME ABSENT
-	_ZN22TSmsMessageSettingsGsm12SetReplyPathEi @ 161 NONAME ABSENT
-	_ZN22TSmsMessageSettingsGsm17SetCanConcatenateEi @ 162 NONAME ABSENT
-	_ZN22TSmsMessageSettingsGsm18SetRejectDuplicateEi @ 163 NONAME ABSENT
-	_ZN22TSmsMessageSettingsGsm20SetMessageConversionE17TSmsPIDConversion @ 164 NONAME ABSENT
-	_ZN23TSmsErrorExtractionCdma4CodeEi @ 165 NONAME ABSENT
-	_ZN23TSmsErrorExtractionCdma5ClassEi @ 166 NONAME ABSENT
-	_ZN23TSmsMessageSettingsCdma10SetPrivacyEh @ 167 NONAME ABSENT
-	_ZN23TSmsMessageSettingsCdma11SetLanguageEh @ 168 NONAME ABSENT
-	_ZN23TSmsMessageSettingsCdma11SetPriorityEh @ 169 NONAME ABSENT
-	_ZN23TSmsMessageSettingsCdma18SetAlertOnDeliveryEh @ 170 NONAME ABSENT
-	_ZN23TSmsMessageSettingsCdma18SetCallBackNumberLERK7TDesC16 @ 171 NONAME ABSENT
-	_ZN23TSmsMessageSettingsCdma22ActivateMessageSettingEhi @ 172 NONAME ABSENT
-	_ZN24CSmsMessageSettingsProxy11SetEncodingEt @ 173 NONAME ABSENT
-	_ZN24CSmsMessageSettingsProxy15SetReplyOptionsERK16TSmsReplyOptions @ 174 NONAME ABSENT
-	_ZN24CSmsMessageSettingsProxy23SetValidityPeriodFormatE20TSmsTimePeriodFormat @ 175 NONAME ABSENT
-	_ZN24CSmsMessageSettingsProxy25SetAbsoluteValidityPeriodERK9TDateTime @ 176 NONAME ABSENT
-	_ZN24CSmsMessageSettingsProxy25SetRelativeValidityPeriodERK20TTimeIntervalMinutes @ 177 NONAME ABSENT
-	_ZN24CSmsMessageSettingsProxy3GsmEv @ 178 NONAME ABSENT
-	_ZN24CSmsMessageSettingsProxy4CdmaEv @ 179 NONAME ABSENT
-	_ZN25TMsvSmsSimOperationParams11SetSmsStoreE14TMsvSmsStorage @ 180 NONAME ABSENT
-	_ZN25TMsvSmsSimOperationParams9SetFolderEl @ 181 NONAME ABSENT
-	_ZN25TMsvSmsSimOperationParamsC1El14TMsvSmsStorage @ 182 NONAME ABSENT
-	_ZN25TMsvSmsSimOperationParamsC1Ev @ 183 NONAME ABSENT
-	_ZN25TMsvSmsSimOperationParamsC2El14TMsvSmsStorage @ 184 NONAME ABSENT
-	_ZN25TMsvSmsSimOperationParamsC2Ev @ 185 NONAME ABSENT
-	_ZNK10CSmsHeader10BioMessageEv @ 186 NONAME ABSENT
-	_ZNK10CSmsHeader10GsmMessageEv @ 187 NONAME ABSENT
-	_ZNK10CSmsHeader10SmsMessageEv @ 188 NONAME ABSENT
-	_ZNK10CSmsHeader11CdmaMessageEv @ 189 NONAME ABSENT
-	_ZNK10CSmsHeader13FindRecipientERK7TDesC16RP10CSmsNumber @ 190 NONAME ABSENT
-	_ZNK10CSmsHeader13FindRecipientEiRP10CSmsNumber @ 191 NONAME ABSENT
-	_ZNK10CSmsHeader14MessageBearingEv @ 192 NONAME ABSENT
-	_ZNK10CSmsHeader24AcknowledgementRequestedE11TSmsAckType @ 193 NONAME ABSENT
-	_ZNK10CSmsHeader26GetDefaultMessageSettingsLER12CSmsSettings @ 194 NONAME ABSENT
-	_ZNK10CSmsHeader9SmsBearerEv @ 195 NONAME ABSENT
-	_ZNK10CSmsNumber11AddressTypeEv @ 196 NONAME ABSENT
-	_ZNK10CSmsNumber15ValidateAddressEv @ 197 NONAME ABSENT
-	_ZNK10CSmsNumber7UserAckEv @ 198 NONAME ABSENT
-	_ZNK10CSmsNumber9MessageIdEv @ 199 NONAME ABSENT
-	_ZNK12CSmsSettings15AlertOnDeliveryEv @ 200 NONAME ABSENT
-	_ZNK12CSmsSettings15MessageSettingsEv @ 201 NONAME ABSENT
-	_ZNK12CSmsSettings18DefaultTeleserviceEv @ 202 NONAME ABSENT
-	_ZNK12CSmsSettings18EMailGatewayNumberEv @ 203 NONAME ABSENT
-	_ZNK12CSmsSettings18MessageDisplayModeEv @ 204 NONAME ABSENT
-	_ZNK12CSmsSettings20PreferedLanguageListEv @ 205 NONAME ABSENT
-	_ZNK12CSmsSettings24ReplyWithOriginalMessageEv @ 206 NONAME ABSENT
-	_ZNK12CSmsSettings9DigitModeEv @ 207 NONAME ABSENT
-	_ZNK14TMsvMessageBio11AddressTypeEv @ 208 NONAME ABSENT
-	_ZNK14TMsvMessageBio12BioMsgIdTypeEv @ 209 NONAME ABSENT
-	_ZNK14TMsvMessageBio18OriginatingAddressEv @ 210 NONAME ABSENT
-	_ZNK14TMsvMessageBio8EncodingEv @ 211 NONAME ABSENT
-	_ZNK14TMsvMessageGsm12GetReplyPathERi @ 212 NONAME ABSENT
-	_ZNK14TMsvMessageGsm14GetCommandTypeER17TMsvSmsGsmCommand @ 213 NONAME ABSENT
-	_ZNK14TMsvMessageGsm19GetRejectDuplicatesERi @ 214 NONAME ABSENT
-	_ZNK14TMsvMessageGsm23GetServiceCenterAddressER7TPtrC16 @ 215 NONAME ABSENT
-	_ZNK14TMsvMessageGsm8GetClassERiR15TMsvSmsGsmClass @ 216 NONAME ABSENT
-	_ZNK14TMsvMessageSms20ValidityPeriodFormatEv @ 217 NONAME ABSENT
-	_ZNK14TMsvMessageSms25GetValidityPeriodAbsoluteER9TDateTime @ 218 NONAME ABSENT
-	_ZNK14TMsvMessageSms25GetValidityPeriodRelativeER20TSmsRelativeTimeUnitRm @ 219 NONAME ABSENT
-	_ZNK14TMsvMessageSms26GetEMSInformationElementsLEv @ 220 NONAME ABSENT
-	_ZNK14TMsvMessageSms32GetMessageServiceCenterTimeStampER9TDateTimeRi @ 221 NONAME ABSENT
-	_ZNK15TMsvMessageCdma13TeleserviceIdEv @ 222 NONAME ABSENT
-	_ZNK15TMsvMessageCdma18DeliveryTimeFormatEv @ 223 NONAME ABSENT
-	_ZNK15TMsvMessageCdma18GetCallbackNumberLEv @ 224 NONAME ABSENT
-	_ZNK15TMsvMessageCdma19GetAlertOnDeliveryLERh @ 225 NONAME ABSENT
-	_ZNK15TMsvMessageCdma20GetNumberOfMessagesLERh @ 226 NONAME ABSENT
-	_ZNK15TMsvMessageCdma20GetPrivacyIndicatorLERh @ 227 NONAME ABSENT
-	_ZNK15TMsvMessageCdma20GetUserResponseCodeLERh @ 228 NONAME ABSENT
-	_ZNK15TMsvMessageCdma21GetLanguageIndicatorLERh @ 229 NONAME ABSENT
-	_ZNK15TMsvMessageCdma21GetPriorityIndicatorLERh @ 230 NONAME ABSENT
-	_ZNK15TMsvMessageCdma22GetMessageDisplayModeLERh @ 231 NONAME ABSENT
-	_ZNK15TMsvMessageCdma23GetMessageDepositIndexLERt @ 232 NONAME ABSENT
-	_ZNK15TMsvMessageCdma25GetOriginatingSubAddressLEv @ 233 NONAME ABSENT
-	_ZNK15TMsvMessageCdma32GetDeferredDeliveryTimeRelativeLER20TSmsRelativeTimeUnitRm @ 234 NONAME ABSENT
-	_ZNK16TSmsReplyOptions11DeliveryAckEv @ 235 NONAME ABSENT
-	_ZNK16TSmsReplyOptions12TransportAckEv @ 236 NONAME ABSENT
-	_ZNK16TSmsReplyOptions7ReadAckEv @ 237 NONAME ABSENT
-	_ZNK16TSmsReplyOptions7UserAckEv @ 238 NONAME ABSENT
-	_ZNK22TSmsMessageSettingsGsm14CanConcatenateEv @ 239 NONAME ABSENT
-	_ZNK22TSmsMessageSettingsGsm15RejectDuplicateEv @ 240 NONAME ABSENT
-	_ZNK22TSmsMessageSettingsGsm17MessageConversionEv @ 241 NONAME ABSENT
-	_ZNK22TSmsMessageSettingsGsm9ReplyPathEv @ 242 NONAME ABSENT
-	_ZNK23TSmsMessageSettingsCdma14CallBackNumberEv @ 243 NONAME ABSENT
-	_ZNK23TSmsMessageSettingsCdma15AlertOnDeliveryEv @ 244 NONAME ABSENT
-	_ZNK23TSmsMessageSettingsCdma22IsMessageSettingActiveEh @ 245 NONAME ABSENT
-	_ZNK23TSmsMessageSettingsCdma7PrivacyEv @ 246 NONAME ABSENT
-	_ZNK23TSmsMessageSettingsCdma8LanguageEv @ 247 NONAME ABSENT
-	_ZNK23TSmsMessageSettingsCdma8PriorityEv @ 248 NONAME ABSENT
-	_ZNK24CSmsMessageSettingsProxy12ReplyOptionsEv @ 249 NONAME ABSENT
-	_ZNK24CSmsMessageSettingsProxy20ValidityPeriodFormatEv @ 250 NONAME ABSENT
-	_ZNK24CSmsMessageSettingsProxy22AbsoluteValidityPeriodEv @ 251 NONAME ABSENT
-	_ZNK24CSmsMessageSettingsProxy22RelativeValidityPeriodEv @ 252 NONAME ABSENT
-	_ZNK24CSmsMessageSettingsProxy3GsmEv @ 253 NONAME ABSENT
-	_ZNK24CSmsMessageSettingsProxy4CdmaEv @ 254 NONAME ABSENT
-	_ZNK24CSmsMessageSettingsProxy8EncodingEv @ 255 NONAME ABSENT
-	_ZNK25TMsvSmsSimOperationParams6FolderEv @ 256 NONAME ABSENT
-	_ZNK25TMsvSmsSimOperationParams8SmsStoreEv @ 257 NONAME ABSENT
-	_ZN11CSmsAccount13LoadSettingsLER12CSmsSettings @ 258 NONAME
-	_ZN11CSmsAccount13LoadSettingsLER20CMsvScheduleSettingsR16CMsvOffPeakTimesR20CMsvSendErrorActionsR19CMsvSysAgentActions @ 259 NONAME
-	_ZN11CSmsAccount26InitialiseDefaultSettingsLER12CSmsSettings @ 260 NONAME
-	_ZN11CSmsAccount26InitialiseDefaultSettingsLER20CMsvScheduleSettingsR16CMsvOffPeakTimesR20CMsvSendErrorActionsR19CMsvSysAgentActions @ 261 NONAME
-	_ZN11CSmsAccount4NewLEv @ 262 NONAME
-	_ZN11CSmsAccount5NewLCEv @ 263 NONAME
-	_ZN11CSmsAccountD0Ev @ 264 NONAME
-	_ZN11CSmsAccountD1Ev @ 265 NONAME
-	_ZN11CSmsAccountD2Ev @ 266 NONAME
-	_ZN12CSmsSettings17AddServiceCenterLERK7TDesC16S2_ @ 267 NONAME
-	_ZN12CSmsSettings19RemoveServiceCenterEi @ 268 NONAME
-	_ZN12CSmsSettings23SetDefaultServiceCenterEi @ 269 NONAME
-	_ZN12CSmsSettings5NewLCEv @ 270 NONAME
-	_ZN17CSmsServiceCenter11SetAddressLERK7TDesC16 @ 271 NONAME
-	_ZN17CSmsServiceCenter4NewLERKS_ @ 272 NONAME
-	_ZN17CSmsServiceCenter4NewLEv @ 273 NONAME
-	_ZN17CSmsServiceCenter5CopyLERKS_ @ 274 NONAME
-	_ZN17CSmsServiceCenter8SetNameLERK7TDesC16 @ 275 NONAME
-	_ZN17CSmsServiceCenterD0Ev @ 276 NONAME
-	_ZN17CSmsServiceCenterD1Ev @ 277 NONAME
-	_ZN17CSmsServiceCenterD2Ev @ 278 NONAME
-	_ZNK11CSmsAccount13SaveSettingsLERK12CSmsSettings @ 279 NONAME
-	_ZNK11CSmsAccount13SaveSettingsLERK20CMsvScheduleSettingsRK16CMsvOffPeakTimesRK20CMsvSendErrorActionsRK19CMsvSysAgentActions @ 280 NONAME
-	_ZNK12CSmsSettings16GetServiceCenterEi @ 281 NONAME
-	_ZNK12CSmsSettings18ServiceCenterCountEv @ 282 NONAME
-	_ZNK12CSmsSettings20DefaultServiceCenterEv @ 283 NONAME
-	_ZNK17CSmsServiceCenter4NameEv @ 284 NONAME
-	_ZNK17CSmsServiceCenter7AddressEv @ 285 NONAME
-	_ZN10CSmsHeader4NewLEN7CSmsPDU11TSmsPDUTypeER13CEditableTextR3RFs @ 286 NONAME
-	_ZN10CSmsHeader18ContainsSmsHeaderLERK9CMsvStore @ 287 NONAME
-	_ZN13TSmsUtilities16PopulateMsgEntryER9TMsvEntryRK11CSmsMessagelRK12CSmsSettings4TUid @ 288 NONAME
-	_ZN13CSmsClientMtm10Extension_EjRPvS0_ @ 289 NONAME
-	_ZN13CSmsClientMtm12SaveMessageLER9CMsvStoreR9TMsvEntry @ 290 NONAME
-	_ZN13CSmsClientMtm14CreateMessageLER9TMsvEntry @ 291 NONAME
-
Binary file messagingappbase/smsmtm/clientmtm/group/1000102C.txt has changed
--- a/messagingappbase/smsmtm/clientmtm/group/smcm.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-// Copyright (c) 1999-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:
-//
-// Description:
-// smcm.dll SMS Client MTM
-//
-
-
-
-/**
- @file
-*/
-
-TARGET        smcm.dll
-CAPABILITY All -TCB
-TARGETPATH    /system/libs
-TARGETTYPE    dll
-
-#if defined(WINS)
-UID    0x10006666 0x1000483B
-VENDORID 0x70000001
-#else
-UID    0x10003C5F 0x1000483B
-VENDORID 0x70000001
-#endif
-
-VERSION 	10.0
-PAGED
-
-SOURCEPATH	../src
-SOURCE       	SMCMMAIN.CPP  SMSCLNT.CPP SMUTSET.CPP SMUTHDR.CPP smut.cpp smutsimparam.cpp
-SOURCE			csmsemailfields.cpp
-SOURCE		csmssendmessageoperation.cpp
-SOURCE		csmsaccount.cpp
-USERINCLUDE 	../inc
-USERINCLUDE		../../../../../../mw/messagingmw/messagingfw/msgsrvnstore/server/inc
-APP_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE /epoc32/include/ecom
-
-LIBRARY       euser.lib estor.lib bafl.lib etext.lib 
-LIBRARY	      gsmu.lib msgs.lib  biodb.lib efsrv.lib
-LIBRARY       cntmodel.lib
-LIBRARY		commsdat.lib
-LIBRARY		etelmm.lib
-
-LIBRARY		schsend.lib centralrepository.lib
-
-START WINS
-	BASEADDRESS 0x4AB40000
-	COPY_FOR_STATIC_LINKAGE
-END
-
-
-
-// This is the final version of the def-file - removed methods have been
-// replaced by panicking stub-functions.
-
-#ifdef WINSCW
-DEFFILE		V2_SMCM.DEF
-#else
-DEFFILE		v2_smcm.def
-#endif
-
-SMPSAFE
-
- 
--- a/messagingappbase/smsmtm/clientmtm/group/test.bat	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-@rem
-@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-@rem All rights reserved.
-@rem This component and the accompanying materials are made available
-@rem under the terms of "Eclipse Public License v1.0"
-@rem which accompanies this distribution, and is available
-@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
-@rem
-@rem Initial Contributors:
-@rem Nokia Corporation - initial contribution.
-@rem
-@rem Contributors:
-@rem
-@rem Description:
-@rem
-@echo off
-if "%1"=="" goto usage
-if "%2"=="" goto usage
-
-@echo on
-
-md \epoc32\wins\c\test\sms
-md \epoc32\wins\c\logs\sms
-md \epoc32\wins\c\logs\etel
-md \epoc32\wins\c\logs\msgtest
-md \epoc32\wins\c\logs\schsend
-md \epoc32\wins\c\logs\watcher
-
-rd \smstest_%1 /s/q
-md \smstest_%1 
-md \smstest_%1\system\data
-md \smstest_%1\system\libs
-md \smstest_%1\test\sms
-md \smstest_%1\logs\sms
-md \smstest_%1\logs\msgtest
-md \smstest_%1\logs\etel
-md \smstest_%1\logs\schsend
-md \smstest_%1\logs\watcher
-copy \epoc32\release\%1\%2\t*.exe \smstest_%1
-copy \epoc32\release\%1\%2\msvtestutils.dll \smstest_%1\system\libs
-copy \epoc32\release\%1\%2\smstestutils.dll \smstest_%1\system\libs
-copy \epoc32\wins\c\test\sms\*.* \smstest_%1\test\sms
-REM copy \epoc32\wins\c\system\data\cdbv2.dat \smstest_%1\system\data\cdbv2.dat
-REM copy \epoc32\wins\c\system\data\s*.esk \smstest_%1\system\data
-REM copy \epoc32\wins\c\system\data\w*.esk \smstest_%1\system\data
-
-@echo off
-
-echo.
-echo.
-echo.
-echo.
-echo The SMCM test files are now stored in folder \smstest_%1
-echo.
-echo These files may now be copied onto a device for testing:
-echo.
-echo - Copy \smstest_%1\logs\ to c:\logs\ on the device
-echo - Copy \smstest_%1\test\ to c:\test\ on the device
-echo - Copy \smstest_%1\system\ to c:\system\ on the device
-echo - The other files (including the test harnesses)
-echo   may be left on the CF card.
-echo.
-
-goto end
-
-:usage
-
-@echo off
-echo.
-echo USAGE: test [platform] [variant]
-echo.
-echo e.g.:  test thumb urel
-echo        test armi udeb
-echo.
-
-:end
\ No newline at end of file
--- a/messagingappbase/smsmtm/clientmtm/inc/SMCMMAIN.H	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-// Copyright (c) 1999-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 __SMUTMAIN_H__
-#define __SMUTMAIN_H__
-
-#include <e32base.h>
-
-/**
-@deprecated
-@internalComponent
-*/
-const TInt KSmscSessionPriority = CActive::EPriorityStandard;
-
-/**
-@deprecated
-@internalComponent
-*/
-_LIT(KSmcmDllName,"SMCM");
-
-/**
-The panic codes used by the SMS client MTM.
-
-@internalComponent
-@released
-*/
-enum TSmcmPanic
-	{
-	ESmutPanicUnsupportedMsgType		= 0,
-	ESmscEntryNotSet					= 1,
-	ESmscWrongContextType				= 2,
-	ESmscPanicUnexpectedCommand			= 3,
-	ESmscUnrecognizedEntryType			= 4,
-	ESmscAddresseeIndexOutOfRange		= 5,
-	ESmscRecpAddresseeMiscount			= 6,
-	ESmscDefaultSCOutOfRange			= 7,
-	ESmscVPOutOfRange					= 8,
-/**
-@deprecated	Currently not used.
-*/
-	ESmscRetryLimitOutOfRange			= 9,
-	ESmscBioMsgIdTypeError				= 10,
-	ESmscSettingsNotSet					= 11,
-	ESmscServiceIdNotSet				= 12,
-/**
-@deprecated	Currently not used.
-*/
-	ESmscSimParamWrongType				= 13,
-/**
-@deprecated	Currently not used.
-*/
-	ESmscSimParamExistingOperation		= 14,
-/**
-@deprecated	Currently not used.
-*/
-	ESmscSimParamInvalidProgressCount	= 15,
-/**
-@deprecated	Currently not used.
-*/
-	ESmscWrongCommDbAction				= 16,
-
-	ESmscFunctionNotSupported			= 17
-	};
-
-/**
-Panic function.
-
-@param	aPanic	The panic code.
-
-@internalComponent
-@released
-*/
-inline void Panic(TSmcmPanic aPanic)
-	{
-	_LIT(KSmcmPanic, "SMCM");
-	User::Panic(KSmcmPanic, aPanic);
-	}
-
-#endif	// __SMUTMAIN_H__
-
--- a/messagingappbase/smsmtm/clientmtm/inc/SMSCLNT.H	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +0,0 @@
-// Copyright (c) 1999-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:
-// SMSCLNT.H
-//
-/**
- * @file 
- * @publishedAll
- * @released
- */
-#ifndef __SMSCLNT_H__
-#define __SMSCLNT_H__
-
-#include <mtclbase.h>
-#include <smuthdr.h>
-
-class CSmsHeader;
-class CSmsMessage;
-class CSmsSettings;
-class TSmsUtilities;
-class CSmsSimParamOperation;
-class CMobilePhoneSmspList;
-class RResourceFile;
-
-/** 
-The SMS client MTM interface.
-
-Most of the functions in this class are implementations of the virtual functions 
-defined by the base class CBaseMtm.
-
-An object of this class can be obtained from the Client MTM registry. The message
-server provides the necessary information required by the registry to provide
-the SMS client MTM.
-
-All client MTM objects have a current context. This is an entry in the message 
-store that will be manipulated by certain APIs supplied by the MTM. If the 
-current context is not set then certain APIs will panic. 
-
-The CBaseMtm::HasContext API can be used to check that the current context has 
-been set. It can be set using either the CBaseMtm::SwitchCurrenEntryL API or the
-CBaseMtm::SetCurrentEntryL API.
-
-@see	CClientMtmRegistry
-@see	CBaseMtm::HasContext
-@see	CBaseMtm::SetCurrentEntryL
-@see	CBaseMtm::SwitchCurrenEntryL
-
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS (CSmsClientMtm) : public CBaseMtm
-	{
-public:
-
-	IMPORT_C static CSmsClientMtm* NewL(CRegisteredMtmDll& aRegisteredMtmDll,CMsvSession& aSession);
-	virtual ~CSmsClientMtm();
-
-	void HandleEntryEvent(enum MMsvEntryObserver::TMsvEntryEvent,TAny*,TAny*,TAny*);
-
-	inline CSmsHeader& SmsHeader();
-	inline const CSmsHeader& SmsHeader() const;
-	inline CSmsSettings& ServiceSettings();
-	inline const CSmsSettings& ServiceSettings() const;
-	inline TInt ServiceId() const;
-
-	IMPORT_C void RestoreServiceAndSettingsL();
-	IMPORT_C CSmsSimParamOperation* ReadSimParamsL(TRequestStatus& aObserverRequestStatus);
-	IMPORT_C CSmsSimParamOperation* WriteSimParamsL(const CMobilePhoneSmspList& aList, TRequestStatus& aObserverRequestStatus); 
-	IMPORT_C void SaveMessageL(CMsvStore& aEditStore, TMsvEntry& aEntry);
-	IMPORT_C void CreateMessageL(TMsvEntry& aEntry);
-	/** 
-	Sets the character encoding value. The character encoding value options are 7-bit,
-	8-bit and 16-Bit Unicode. By default the character set encoding is 7 bit encoding.
-	*/
-	void SetMessageCharacterSetL(TSmsDataCodingScheme::TSmsAlphabet aTsmsAlphabet);
-
-public:	// methods from CBaseMtm
-
-	virtual void SaveMessageL(); 
-	virtual void LoadMessageL();
-	virtual TMsvPartList ValidateMessage(TMsvPartList aPartList);
-	virtual TMsvPartList Find(const TDesC& aTextToFind, TMsvPartList aPartList);
-	virtual CMsvOperation* ReplyL(TMsvId aDestination, TMsvPartList aPartList, TRequestStatus& aCompletionStatus);
-	virtual CMsvOperation* ForwardL(TMsvId aDestination, TMsvPartList aPartList, TRequestStatus& aCompletionStatus);
-	virtual void AddAddresseeL(const TDesC& aRealAddress);
-	virtual void AddAddresseeL(const TDesC& aRealAddress, const TDesC& aAlias);
-	virtual void RemoveAddressee(TInt aIndex);
-	virtual TInt QueryCapability(TUid aCapability, TInt& aResponse);
-	virtual void InvokeSyncFunctionL(TInt aFunctionId,const CMsvEntrySelection& aSelection, TDes8& aParameter);
-	virtual CMsvOperation* InvokeAsyncFunctionL(TInt aFunctionId,const CMsvEntrySelection& aSelection, TDes8& aParameter, TRequestStatus& aCompletionStatus);
-
-	IMPORT_C void CreateMessageL(TMsvId aServiceId);
-	IMPORT_C void BioTypeChangedL(TUid aBioTypeUid);
-	
-protected: 
-	/**
-	Methods from CBaseMtm, The implementation of this function assumes that
-    the new service for setting the charset encoding value for a SMS message is supported.
-    */
-	IMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
- 
-private:
-
-	CSmsClientMtm(CRegisteredMtmDll& aRegisteredMtmDll,CMsvSession& aSession);
-	void ConstructL();
-
-	void BasicReplyForwardEntry(TMsvEntry& aNewEntry) const;
-	CMsvOperation* CreateNewEntryL(TMsvEntry& aNewEntry, TMsvId aDestination,CSmsHeader& aSmsHeader,const CRichText& aBody, TRequestStatus& aCompletionStatus);
-	TBool ValidRecipients() const;
-	TBool ValidNumber(const TDesC& aNumber) const;
-
-private:	// methods from CBaseMtm
-
-	virtual void ContextEntrySwitched(); 
-
-private:
-
-	void DoAddAddresseeL(const TDesC& aRealAddress, const TDesC& aAlias);
-	void AddRecipientL(const TDesC& aRealAddress, const TDesC& aAlias);
-	void DoAddRecipientL(CSmsHeader* aSmsHeader, const TDesC& aRealAddress, const TDesC& aAlias);
-	void ResetHeader();
-	TMsvPartList DoFindL(const TDesC& aTextToFind,TMsvPartList aPartList);
-	void FindL(const TDesC& aTextToFind, const TMsvPartList aPartList,TMsvPartList& aFoundList);
-	void FindInBodyL(const TDesC& aTextToFind, const TMsvPartList& aFoundList, TMsvPartList& aResult);
-	HBufC* ReadEmailSubjectFormatL(RResourceFile& aResourceFile, TInt aResourceId, const TDesC& aDefaultFormat);
-
-private:
-
-	CSmsSettings*	iServiceSettings;
-	TMsvId			iServiceId;
-	CSmsHeader*		iSmsHeader;
-	TChar			iRealAddressOpen;
-	TChar			iRealAddressClose;
-	HBufC*			iEmailForwardSubjectFormat;
-	HBufC*			iEmailReplySubjectFormat;
-	};
-
-#include <smsclnt.inl>
-
-#endif	// __SMSCLNT_H__
--- a/messagingappbase/smsmtm/clientmtm/inc/SMSCLNT.INL	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-// Copyright (c) 1999-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 <msvuids.h>
-#include <smcmmain.h>
-
-/** 
-Gets the message header for a message context.
-
-The current context must be set to a message entry with type KUidMsvMessageEntryValue.
-If the current context is not set, or is set to an entry not of type
-KUidMsvMessageEntryValuethen a panic will occur.
-
-The message header object is the SMS MTM encapsulation of an SMS message. The
-contents of the message header has been extracted from the current context.
-
-@return
-The (non-const) message header object.
-
-@panic	SMCM	1
-The current context has not been set (debug only).
-
-@panic	SMCM	2
-The current context was not of type KUidMsvMessageEntry (debug only).
-
-@see	CSmsHeader
-*/
-inline CSmsHeader& CSmsClientMtm::SmsHeader()
-	{
-	__ASSERT_DEBUG(iMsvEntry, Panic(ESmscEntryNotSet));
-	__ASSERT_DEBUG(iMsvEntry->Entry().iType==KUidMsvMessageEntry, Panic(ESmscWrongContextType));
-	return *iSmsHeader;
-	}
-
-/** 
-Gets the (const) message header for a message context.
-
-The current context must be set to a message entry with type KUidMsvMessageEntryValue.
-If the current context is not set, or is set to an entry not of type
-KUidMsvMessageEntryValuethen a panic will occur.
-
-The message header object is the SMS MTM encapsulation of an SMS message. The
-contents of the message header has been extracted from the current context.
-
-@return
-The (const) message header object.
-
-@panic	SMCM	1
-The current context has not been set (debug only).
-
-@panic	SMCM	2
-The current context was not of type KUidMsvMessageEntry (debug only).
-
-@see	CSmsHeader
-*/
-inline const CSmsHeader& CSmsClientMtm::SmsHeader() const
-	{
-	__ASSERT_DEBUG(iMsvEntry, Panic(ESmscEntryNotSet));
-	__ASSERT_DEBUG(iMsvEntry->Entry().iType==KUidMsvMessageEntry, Panic(ESmscWrongContextType));
-	return *iSmsHeader;
-	}
-
-/** 
-Gets the current SMS service settings.
-
-The current context must be set. If the current context is not set then a panic
-will occur.
-
-The SMS service settings must have been set or a panic will occur. The 
-CSmsClientMtm::RestoreServiceAndSettingsL API can restore the SMS service 
-settings. This also sets the SMS service ID.
-
-@return
-The current (non-const) SMS service settings.
-
-@panic	SMCM	1
-The current context has not been set (debug only).
-
-@panic	SMCM	11
-The SMS Service settings have not been set (debug only).
-
-@see	CSmsClientMtm::RestoreServiceAndSettingsL
-*/
-inline CSmsSettings& CSmsClientMtm::ServiceSettings()
-	{
-	__ASSERT_DEBUG(iMsvEntry, Panic(ESmscEntryNotSet));
-	__ASSERT_DEBUG(iServiceSettings, Panic(ESmscSettingsNotSet));
-	return *iServiceSettings;
-	}
-
-/**
-Gets the current (const) SMS service settings.
-
-The current context must be set. If the current context is not set then a panic
-will occur.
-
-The SMS service settings must have been set or a panic will occur. The 
-CSmsClientMtm::RestoreServiceAndSettingsL API can restore the SMS service 
-settings. This also sets the SMS service ID.
-
-@return
-The current (const) SMS service settings.
-
-@panic	SMCM	1
-The current context has not been set (debug only).
-
-@panic	SMCM	11
-The SMS Service settings have not been set (debug only).
-
-@see	CSmsClientMtm::RestoreServiceAndSettingsL
-*/
-inline const CSmsSettings& CSmsClientMtm::ServiceSettings() const
-	{	
-	__ASSERT_DEBUG(iMsvEntry, Panic(ESmscEntryNotSet));
-	__ASSERT_DEBUG(iServiceSettings, Panic(ESmscSettingsNotSet));
-	return *iServiceSettings;
-	}
-
-/**
-Gets the ID of the current SMS service.
-
-If there is no current SMS service, the ID will be a value of 0. The 
-CSmsClientMtm::RestoreServiceAndSettingsL API can set the SMS service IS. This 
-also restores the SMS service settings.
-
-@return
-The ID for the current SMS service
-
-@see	CSmsClientMtm::RestoreServiceAndSettingsL
-*/
-inline TInt CSmsClientMtm::ServiceId() const
-	{
-	return iServiceId;
-	}
--- a/messagingappbase/smsmtm/clientmtm/inc/SMUTHDR.H	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,166 +0,0 @@
-// Copyright (c) 1999-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:
-// SMUTHDR.H
-//
-/**
- * @file 
- * @publishedAll
- * @released
- */
-#ifndef __SMUTHDR_H__
-#define __SMUTHDR_H__
-
-#include <e32base.h>
-#include <gsmubuf.h>
-#include <bif.h>
-#include <gsmupdu.h>
-#include <msvstd.h>
-#include <smutset.h>
-
-#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS  
-#include <tmsvsmsentry.h>
-#endif
-
-class RMsvReadStream;
-class RMsvWriteStream;
-class CMsvStore;
-class CSmsEmailFields;
-
-/** 
-The SMS MTM encapsulation of an SMS message.
-
-This class allows a messaging client to access the lower-level message encapsulation 
-used by the SMS stack.
-
-It also provides functionality to restore and store an SMS message from/to the
-message store.
-
-An SMS message is encapsulated in a Protocol Data Unit (PDU). In GSM there are 
-six types of SMS message PDU. In the descriptions below, SC means Service Center 
-and MS means Mobile Station (the phone).
-
-1. SMS-DELIVER - sent from SC to MS
-
-2. SMS-DELIVER-REPORT - sent from MS to SC
-
-3. SMS-SUBMIT - sent from MS to SC
-
-4. SMS-SUBMIT-REPORT - sent from SC to MS
-
-5. SMS-STATUS-REPORT - sent from SC to MS
-
-6. SMS-COMMAND - sent from MS to SC
-
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS (CSmsHeader) : public CBase
-	{
-public:
-
-	IMPORT_C static CSmsHeader* NewL(CSmsPDU::TSmsPDUType aType,CEditableText& aText);
-	IMPORT_C static CSmsHeader* NewL(CSmsPDU::TSmsPDUType aType,CEditableText& aText,RFs& aFs);
-	IMPORT_C static CSmsHeader* NewL(CSmsMessage* aMessage);
-	IMPORT_C ~CSmsHeader();
-
-	inline CSmsPDU::TSmsPDUType Type() const;
-
-	inline CSmsSubmit& Submit();
-	inline const CSmsSubmit& Submit() const;
-	inline CSmsDeliver& Deliver();
-	inline const CSmsDeliver& Deliver() const;
-	inline CSmsCommand& Command();
-	inline const CSmsCommand& Command() const;
-	inline CSmsStatusReport& StatusReport();
-	inline const CSmsStatusReport& StatusReport() const;
-	
-	inline CSmsMessage& Message();
-	inline const CSmsMessage& Message() const;
-
-	inline TBool ReplyPathProvided() const;
-	inline void SetReplyPathProvided(TBool aReplyPathProvided);
-
-	inline TBioMsgIdType BioMsgIdType() const;
-	inline void SetBioMsgIdType(TBioMsgIdType aBioMsgIdType = EBioMsgIdNbs);
-	
-	inline TPtrC ServiceCenterAddress() const;
-	inline void SetServiceCenterAddressL(const TDesC& aAddress);
-
-	IMPORT_C void SetSmsSettingsL(const CSmsMessageSettings& aSmsSettings);
-	IMPORT_C void GetSmsSettingsL(CSmsMessageSettings& aSmsSettings) const;
-
-	inline const CArrayPtrFlat<CSmsNumber>& Recipients() const;
-	inline CArrayPtrFlat<CSmsNumber>& Recipients();
-
-	inline void SetFromAddressL(const TDesC& aAddress);
-	inline TPtrC FromAddress() const;
-	
-	TPtrC ReplyAddressL() const;
-	
-	IMPORT_C void SetEmailFieldsL(const CSmsEmailFields& aEmailFields);
-	void SetReplyEmailFieldsL(const CSmsEmailFields& aEmailFields, const TDesC& aReplySubjectFormat);
-	void SetForwardEmailFieldsL(const CSmsEmailFields& aEmailFields, const TDesC& aForwardSubjectFormat);
-	IMPORT_C const CSmsEmailFields& EmailFields() const;
-
-	IMPORT_C void InternalizeL( RMsvReadStream& aStream);
-	IMPORT_C void ExternalizeL( RMsvWriteStream& aStream) const;
-
-	IMPORT_C void RestoreL(CMsvStore& aStore);
-	IMPORT_C void StoreL(CMsvStore& aStore) const;
-
-	IMPORT_C  TBool ContainsSmsHeaderL(const CMsvStore& aStore); 
-
-	
-private:
-	CSmsHeader(CSmsMessage* aSmsMessage = NULL);
-	void ConstructL(CSmsPDU::TSmsPDUType aType, CEditableText& aText);
-	void ConstructL(CSmsPDU::TSmsPDUType aType, CEditableText& aText, RFs& aFs);
-	void ConstructL();
-
-	enum TSmsHeaderFlags
-		{
-		ESmsHeaderNoFlags			= 0x00,
-		ESmsHeaderReplyPathProvided = 0x01,
-		ESmsHeaderCanConcatenate	= 0x02
-		};
-
-	TBool CanConcatenate() const;
-	void SetCanConcatenate(TBool aCanConcatenate);
-	
-	void SetEmailReplyForwardSubjectL(CSmsEmailFields* aEmailFields, const TDesC& aSubject, const TDesC& aSubjectFormat);
-
-#if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
-	void StoreDbL(CMsvStore& aStore) const;
-	void ReStoreDBL(CMsvStore& aStore);
-	void GetRecipientL(TDesC16& aRecipientStrList);
-	TInt ConvertToTInt(TDesC16& aStr);
-#endif
-
-private:
-	CArrayPtrFlat<CSmsNumber> iRecipients;
-	CSmsMessage* iMessage;
-	TUint32 iFlags;
-	RFs iFs;
-
-	// iBioMsgIdType is only used during sending and will be ignored if the 
-	// TMsvEntry.iBioType == 0. The default is EBioMsgIdNbs.
-	TBioMsgIdType iBioMsgIdType;
-	CSmsEmailFields*	iEmailFields;
-	TBool			iCloseFs;
-	};
-	
-#include <smuthdr.inl>
-
-#endif	// __SMUTHDR_H__
-
--- a/messagingappbase/smsmtm/clientmtm/inc/SMUTHDR.INL	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,354 +0,0 @@
-// Copyright (c) 1999-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:
-// SMUTHDR.INL
-//
-
-#include <smcmmain.h>
-#include <gsmumsg.h>
-
-/** 
-Gets the message PDU for a SMS-SUBMIT type message.
-
-The message PDU type can be checked by using the CSmsHeader::Type API.
-
-@return
-The SMS-SUBMIT PDU object.
-
-@panic	SMCM	0
-The message was not a PDU of type SMS-SUBMIT (debug only).
-
-@see	CSmsHeader::Type
-*/
-inline CSmsSubmit& CSmsHeader::Submit()
-	{
-	__ASSERT_DEBUG( Type() == CSmsPDU::ESmsSubmit, Panic(ESmutPanicUnsupportedMsgType));
-	return (CSmsSubmit&)(iMessage->SmsPDU());
-	}
-
-/** 
-Gets the (const) message PDU for a SMS-SUBMIT type message.
-
-The message PDU type can be checked by using the CSmsHeader::Type API.
-
-@return
-The SMS-SUBMIT PDU const object.
-
-@panic	SMCM	0
-The message was not a PDU of type SMS-SUBMIT (debug only).
-
-@see	CSmsHeader::Type
-*/
-inline const CSmsSubmit& CSmsHeader::Submit() const
-	{
-	__ASSERT_DEBUG( Type() == CSmsPDU::ESmsSubmit, Panic(ESmutPanicUnsupportedMsgType));
-	return (CSmsSubmit&)(iMessage->SmsPDU());
-	}
-
-/** 
-Gets the message PDU for a SMS-DELIVER type message.
-
-The message PDU type can be checked by using the CSmsHeader::Type API.
-
-@return
-The SMS-DELIVER PDU object.
-
-@panic	SMCM	0
-The message was not a PDU of type SMS-DELIVER (debug only).
-
-@see	CSmsHeader::Type
-*/
-inline CSmsDeliver& CSmsHeader::Deliver()
-	{
-	__ASSERT_DEBUG( Type() == CSmsPDU::ESmsDeliver, Panic(ESmutPanicUnsupportedMsgType));
-	return (CSmsDeliver&)(iMessage->SmsPDU());
-	}
-
-/** 
-Gets the (const) message PDU for a SMS-DELIVER type message.
-
-The message PDU type can be checked by using the CSmsHeader::Type API.
-
-@return
-The SMS-DELIVER PDU const object.
-
-@panic	SMCM	0
-The message was not a PDU of type SMS-DELIVER (debug only).
-
-@see	CSmsHeader::Type
-*/
-inline const CSmsDeliver& CSmsHeader::Deliver() const
-	{
-	__ASSERT_DEBUG( Type() == CSmsPDU::ESmsDeliver, Panic(ESmutPanicUnsupportedMsgType));
-	return (CSmsDeliver&)(iMessage->SmsPDU());
-	}
-
-/** 
-Gets the message PDU for a SMS-COMMMAND type message.
-
-The message PDU type can be checked by using the CSmsHeader::Type API.
-
-@return	The SMS-COMMMAND PDU object.
-
-@panic	SMCM	0
-The message was not a PDU of type SMS-COMMMAND (debug only).
-
-@see	CSmsHeader::Type
-*/
-inline CSmsCommand& CSmsHeader::Command()
-	{
-	__ASSERT_DEBUG( Type() == CSmsPDU::ESmsCommand, Panic(ESmutPanicUnsupportedMsgType));
-	return (CSmsCommand&)(iMessage->SmsPDU());
-	}
-
-/** 
-Gets the (const) message PDU for a SMS-COMMMAND type message.
-
-The message PDU type can be checked by using the CSmsHeader::Type API.
-
-@return
-The SMS-COMMMAND PDU const object.
-
-@panic	SMCM	0
-The message was not a PDU of type SMS-COMMMAND (debug only).
-
-@see	CSmsHeader::Type
-*/
-inline const CSmsCommand& CSmsHeader::Command() const
-	{
-	__ASSERT_DEBUG( Type() == CSmsPDU::ESmsCommand, Panic(ESmutPanicUnsupportedMsgType));
-	return (CSmsCommand&)(iMessage->SmsPDU());
-	}
-
-/** 
-Gets the message PDU for a SMS-STATUS-REPORT type message.
-
-The message PDU type can be checked by using the CSmsHeader::Type API.
-
-@return
-The SMS-STATUS-REPORT PDU object.
-
-@panic	SMCM	0
-The message was not a PDU of type SMS-STATUS-REPORT (debug only).
-
-@see	CSmsHeader::Type
-*/
-inline CSmsStatusReport& CSmsHeader::StatusReport()
-	{
-	__ASSERT_DEBUG( Type() == CSmsPDU::ESmsStatusReport, Panic(ESmutPanicUnsupportedMsgType));
-	return (CSmsStatusReport&)(iMessage->SmsPDU());
-	}
-
-/** 
-Gets the (const) message PDU for a SMS-STATUS-REPORT type message.
-
-The message PDU type can be checked by using the CSmsHeader::Type API.
-
-@return
-The SMS-STATUS-REPORT PDU const object.
-
-@panic	SMCM	0
-The message was not a PDU of type SMS-STATUS-REPORT (debug only).
-
-@see	CSmsHeader::Type
-*/
-inline const CSmsStatusReport& CSmsHeader::StatusReport() const
-	{
-	__ASSERT_DEBUG( Type() == CSmsPDU::ESmsStatusReport, Panic(ESmutPanicUnsupportedMsgType));
-	return (CSmsStatusReport&)(iMessage->SmsPDU());
-	}
-
-/**
-Gets the message PDU type.
-
-There are six types of PDU -  SMS-DELIVER, SMS-DELIVER-REPORT, SMS-SUBMIT, 
-SMS-SUBMIT-REPORT, SMS-STATUS-REPORT and SMS-COMMAND. 
-
-There is access to only to SMS-DELIVER, SMS-SUBMIT, SMS-STATUS-REPORT and
-SMS-COMMAND PDUs via the CSmsHeader encapsulation.
-
-@return
-The message PDU type.
-
-@see	CSmsPDU::TSmsPDUType
-*/
-inline CSmsPDU::TSmsPDUType CSmsHeader::Type() const
-	{
-	return iMessage->SmsPDU().Type();
-	}
-
-/**
-Gets the (const) message recipients.
-
-@return
-The const array of message recipients 
-*/
-inline const CArrayPtrFlat<CSmsNumber>& CSmsHeader::Recipients() const
-	{
-	return iRecipients;
-	}
-
-/** 
-Gets the (const) message recipients.
-
-@return
-The array of message recipients 
-*/
-inline CArrayPtrFlat<CSmsNumber>& CSmsHeader::Recipients()
-	{
-	return iRecipients;
-	}
-
-/** 
-Gets the SMS stack representation of the message.
-
-@return
-The SMS stack representation of the message
-
-@see	CSmsMessage
-*/
-inline CSmsMessage& CSmsHeader::Message()
-	{
-	return *iMessage;
-	}
-	
-/** 
-Gets the (const) SMS stack representation of the message.
-
-@return
-The const SMS stack representation of the message 
-*/
-inline const CSmsMessage& CSmsHeader::Message() const
-	{
-	return *iMessage;
-	}
-
-/**
-Tests if the message contains a reply path.
-
-@return
-A value of True if the message contains a reply path.
-*/
-inline TBool CSmsHeader::ReplyPathProvided() const
-	{
-	return iFlags & ESmsHeaderReplyPathProvided;
-	}
-
-/** 
-Set the message flag that indicates whether it contains a reply path.
-
-@param	aReplyPathProvided
-A value of True to set the flag.
-*/
-inline void CSmsHeader::SetReplyPathProvided(TBool aReplyPathProvided)
-	{
-	iFlags = (iFlags & ~ESmsHeaderReplyPathProvided) | (aReplyPathProvided ? ESmsHeaderReplyPathProvided : ESmsHeaderNoFlags);
-	}
-
-/**
-Sets the originator address.
-
-@param	aAddress
-The originator address
-*/
-inline void CSmsHeader::SetFromAddressL(const TDesC& aAddress)
-	{
-	Message().SmsPDU().SetToFromAddressL(aAddress);
-	}
-
-/** 
-Gets the originator address.
-
-Only valid for SMS-DELIVER and SMS-SUBMIT type messages. With any other message
-types the returned originator address is empty.
-
-@return
-The originator address.
-*/
-inline TPtrC CSmsHeader::FromAddress() const
-	{
-	switch(Type())
-		{
-		case(CSmsPDU::ESmsSubmit):
-			return Submit().ToFromAddress();
-		case(CSmsPDU::ESmsDeliver):
-			return Deliver().ToFromAddress();
-		default: 
-			return TPtrC(0,0);
-		}
-	}
-
-/** 
-Gets the message's service center address.
-
-This can only be used on SMS-SUBMIT type messages. The message PDU type can be
-checked by using the CSmsHeader::Type API.
-
-@return
-The Service Center address.
-
-@panic	SMCM	0
-The message was not a PDU of type SMS-SUBMIT (debug only).
-
-@see	CSmsHeader::Type
-*/
-inline TPtrC CSmsHeader::ServiceCenterAddress() const
-	{
-	return Submit().ServiceCenterAddress();
-	}
-
-/**
-Sets the message's service center address.
-
-This can only be used on SMS-SUBMIT type messages. The message PDU type can be
-checked by using the CSmsHeader::Type API.
-
-
-@param	aAddress
-The Service Center address
-
-@panic	SMCM	0
-The message was not a PDU of type SMS-SUBMIT (debug only).
-
-@see	CSmsHeader::Type
-*/
-inline void CSmsHeader::SetServiceCenterAddressL(const TDesC& aAddress)
-	{
-	Submit().SetServiceCenterAddressL(aAddress);
-	}
-
-/** 
-Gets the message's BIO message type identifier.
-
-For non-BIO messages, this is EBioMsgIdNbs.
-
-@return
-The BIO message type identifier 
-*/
-inline TBioMsgIdType CSmsHeader::BioMsgIdType() const
-	{
-	return iBioMsgIdType;
-	}
-
-/** 
-Sets the message's BIO message type identifier.
-
-@param	aBioMsgIdType
-The BIO message type identifier
-*/
-inline void CSmsHeader::SetBioMsgIdType(TBioMsgIdType aBioMsgIdType)
-	{
-	iBioMsgIdType = aBioMsgIdType;
-	}
-
-
--- a/messagingappbase/smsmtm/clientmtm/inc/SMUTSET.H	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,761 +0,0 @@
-// Copyright (c) 1999-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:
-// SMUTSET.H
-//
-/**
- * @file 
- * @publishedAll
- * @released
- */
-#ifndef __SMUTSET_H__
-#define __SMUTSET_H__
-
-#include <gsmumsg.h>
-#include <msvrcpt.h>
-#include <msvstore.h>
-#include <logwrap.h>
-
-class CSmsServiceCenter;
-class CSmsEmailFields;
-
-// Both the recipient's number  and SC number (TP-Destination-Address and RP-Destination-Address) 
-// can be 12 octets which means that there can be 21 characters (including + sign) in the number string. 
-
-/**
-The maximum length of recipient's number.
-
-The number returned by CSmsNumber::Address() and CSmsServiceCenter::Address() is limited this maximum length.
-
-@see	CSmsNumber::Address
-@see	CSmsServiceCenter::Address
-
-@publishedAll
-@released
-*/
-const TInt KSmcmSmsNumberMaxNumberLength = 21;
-
-/**
-The maximum length of recipient's name.
-
-The number returned by CSmsNumber::Name() and CSmsServiceCenter::Name() is limited this maximum length.
-
-@see	CSmsNumber::Name
-@see	CSmsServiceCenter::Name
-
-@publishedAll
-@released
-*/
-const TInt KSmcmSmsNumberMaxNameLength = 256;
-
-/** 
-Defines the possible forms in which an SMS message should be delivered to the 
-recipient by the service centre.
-
-The specified format may or may not actually be supported by the service centre. 
-Note that the format of the recipient address(es) may need to be different 
-to a normal telephone number if the conversion is set to any other value than 
-ESmsConvPIDNone, ESmsConvFax, ESmsConvPaging or ESmsConvErmes. 
-
-@publishedAll
-@released
-*/
-enum TSmsPIDConversion
-		{
-/**
-No conversion (i.e. use SMS itself). 
-*/
-		ESmsConvPIDNone	= TSmsProtocolIdentifier::ESmsNoTelematicDevice,
-/** 
-Convert to fax. 
-*/
-		ESmsConvFax		= TSmsProtocolIdentifier::ESmsGroup3TeleFax,
-/** 
-Convert to X.400. 
-*/
-		ESmsConvX400	= TSmsProtocolIdentifier::ESmsX400MessageHandlingSystem,
-/** 
-Convert to pager message. 
-*/
-		ESmsConvPaging	= TSmsProtocolIdentifier::ESmsNationalPagingSystem,
-/** 
-Convert to Internet email. 
-*/
-		ESmsConvMail	= TSmsProtocolIdentifier::ESmsInternetElectronicMail,
-/** 
-Convert to ERMES paging. 
-*/
-		ESmsConvErmes	= TSmsProtocolIdentifier::ESmsERMES,
-/**
-Convert to sppech. 
-*/
-		ESmsConvSpeech	= TSmsProtocolIdentifier::ESmsVoiceTelephone
-		};
-
-/**
-Defines the set of possible validity periods for mobile originated messages.
-
-Mobile originated messages have a PDU type of SMS-SUBMIT.
-
-@publishedAll
-@released
-*/
-enum TSmcmValidityPeriod
-	{
-/**
-Validity period of an hour.
-*/
-	ESmsVPHour			= TSmsValidityPeriod::EHalfHourUnitInMinutes*2,
-/**
-Validity period of six hours.
-*/
-	ESmsVPSixHours		= TSmsValidityPeriod::EHalfHourUnitInMinutes*12,
-/**
-Validity period of 24 hours.
-*/
-	ESmsVP24Hours		= TSmsValidityPeriod::EOneDayUnitInMinutes,
-/**
-Validity period of a week.
-*/
-	ESmsVPWeek			= TSmsValidityPeriod::EOneWeekUnitInMinutes,
-/**
-The maximum validity period - currently set as 63 weeks.
-*/
-	ESmsVPMaximum		= TSmsValidityPeriod::EOneWeekUnitInMinutes*63,
-/**
-An enum that specifies that a validity period is not supported.
-*/
-	ESmsVPNotSupported	= KErrNotSupported,
-/**
-The default validy period - currently set to a week.
-*/
-	ESmsVPDefault		= ESmsVPWeek
-	}; 
-
-/** 
-Defines options for the preferred default sending schedule type of a new message
-created using the SMS client MTM.
-
-The option has no direct effect on the SMS MTM. When it is sending an SMS
-message it automatically appends other SMS messages in the outbox whose send
-states are marked as KMsvSendStatewaiting or KMsvSendSateUnknown.
-
-Therefore it is the responsibility of the messaging client to set the correct
-send state of new SMS messages correctly given the preferred sending schedule.
-
-@publishedAll
-@released
-*/
-enum TSmsDelivery
-	{
-/** 
-Send message immediately. The message send state should be set to KMsvSendStateWaiting. 
-*/
-	ESmsDeliveryImmediately,
-/** 
-Send message when client requests. The message send state should be set to KMsvSendStateUponRequest.
-*/
-	ESmsDeliveryUponRequest,
-/**
-Send message at scheduled time. The message send state should be set to KMsvSendStateScheduled.
-*/
-	ESmsDeliveryScheduled
-	};
-
-/**
-Defines the flags and masks for some of the message settings.
-
-The settings classes CSmsMessageSettings and CSmsSettings use these flags to 
-store the specified information.
-
-@publishedAll
-@released
-*/
-enum TSmsSettingsFlags
-	{
-/**
-Mask that resets the flags.
-*/
-	ESmsSettingsNoFlags					=0x00000000,
-/**
-Flag that indicates if messages can be concatenated.
-
-If true, the UI should pass a long message in one piece to the MTM. If false, 
-it should split the message manually into 140 byte parts. The value of this 
-flag does not affect the behaviour of the SMS MTM.
-*/
-	ESmsSettingsCanConcatenate			=0x00000001,
-/**
-Flag that indicates whether the original message should be included in relpy
-messages.
-
-If true, the received message should be quoted at the beginning of the reply 
-message. If false, reply messages should be initially empty.
-*/
-	ESmsSettingsReplyQuoted				=0x00000002,
-/**
-Flag that indicates whether duplicate messages should be rejected.
-*/
-	ESmsSettingsRejectDuplicate			=0x00000004,
-/**
-Flag that indicates if a status report (TP-SRR in GSM spec 03.40) should be 
-requested from the Service Centre.
-*/
-	ESmsSettingsDeliveryReport			=0x00000008,
-/**
-Flag that indicates if the reply path (Service Centre address) should be included
-in the delivered message (TP-RP in GSM spec 03.40).
-*/
-	ESmsSettingsReplyPathRequested		=0x00000010,
-/**  
-Flag that indicates if a status report (TP-SRR in GSM spec 03.40) for the last segment
-should be requested from the Service Centre.
-*/
-	ESmsSettingsLastSegmentDeliveryReport	=0x00000020	,
-	
-/**
-Flag that indicates if a status report (TP-SRR in GSM spec 03.40) for the last segment 
-is not requested from the Service Centre.
-*/
-	ENoSmsSettingsLastSegmentDeliveryReport	=0x00000040,
-/**
-Flag that indicates that the service center time stamp should be used for the date
-field in any TMsvEntry that corresponds to a SMS message.
-*/
-	ESmsSettingsUseServiceCenterTimeStamp =0x00000080,
-/**
-Flag that indicates if message received from unknown port, 
-discard the message without indicating the user. 
-*/	
-	ESmsSettingsDiscardUnknownPortMsgs =0x00000100,
-/**
-Mask for the set of flags defined.
-*/
-	ESmsSettingsMask                    =0x000000FF,
-	};
-
-
-/**
-Defines the types of acknowledgements that can be received from recipients.
-*/
-enum TSmsAckType
-	{
-/**
-Acknowlwdgement of delivery to a recipient.
-*/
-	ESmsAckTypeDelivery		=0	
-	};
-
-/** 
-Progress information for SMS MTM operations.
-
-This information is returned by CMsvOperation::ProgressL() in a TSmsProgressBuf 
-package.
-
-@see	CMsvOperation::ProgressL
-
-@publishedAll
-@released
-*/
-class TSmsProgress 
-	{
-public:
-/** 
-Defines type of operation for which progress information is being given.
-
-These types correspond to the commands defined in TSmsMtmCommand.
-
-@see	TSmsMtmCommand
-*/
-	enum TSmsProgressType
-		{
-/** 
-The default operation type - no operation.
-*/
-		ESmsProgressTypeDefault,
-/** 
-Reading SIM parameters.
-		
-Pre v7.0, this was named ESmsProgressTypeReadingServiceCenterAddress.
-*/
-		ESmsProgressTypeReadSimParams,
-/**
-Writing SIM parameters.
-		
-Pre v7.0 this was named ESmsProgressTypeWritingServiceCenterAddress. 
-*/
-		ESmsProgressTypeWriteSimParams,
-/**
-Sending messages.
-*/
-		ESmsProgressTypeSending,
-/**
-Scheduling sending messages.
-*/
-		ESmsProgressTypeScheduling,
-/**
-Enumerating phone stores.
-		
-Pre v7.0, this was named ESmsProgressTypeEnumeratingSim.
-*/
-		ESmsProgressTypeEnumeratingPhoneStores, 
-/**
-Copying messages from phone stores.
-		
-Pre v7.0, this was named ESmsProgressTypeCopyFromSim.
-*/
-		ESmsProgressTypeCopyFromPhoneStore, 
-/**
-Moving messages from phone stores.
-		
-Pre v7.0, this was named ESmsProgressTypeMoveFromSim.
-*/
-		ESmsProgressTypeMoveFromPhoneStore, 
-/**
-Deleting messages from phone stores.
-		
-Pre v7.0, this was named ESmsProgressTypeDeleteFromSim.
-*/
-		ESmsProgressTypeDeleteFromPhoneStore, 
-/**
-Removing all messages from the task scheduler list.
-*/
-		ESmsProgressTypeDeleteSchedule,
-/**
-Checking the current scheduled status of the messages.
-*/
-		ESmsProgressTypeCheckSchedule,
-/**
-Recursively deleting messages.
-*/
-		ESmsProgressTypeDeleteAll,
-/**
-Copying messages to a phone store.
-		
-Pre v7.0, this was named ESmsProgressTypeCopyToSim.
-*/
-		ESmsProgressTypeCopyToPhoneStore,  
-/**
-Moving messages to a phone store.
-		
-Pre v7.0, this was named ESmsProgressTypeMoveToSim.
-*/
-		ESmsProgressTypeMoveToPhoneStore,
-/**
-Moving message entries.
-
-This is the second part of ESmsProgressTypeMoveFromPhoneStore. The first part
-deletes the messages from the phone storageSIM. This second part moves the 
-messages from the folder that represents the phone storage to the specified
-destination.
-*/
-		ESmsProgressTypeMovingEntries
-		};
-	
-	inline TSmsProgress(TSmsProgressType aType = ESmsProgressTypeDefault);
-
-public:
-	
-/** 
-The error code.
-*/
-	TInt iError; 
-/** 
-The type of operation. 
-
-@see	TSmsProgress::TSmsProgressType
-*/
-	TSmsProgressType iType;
-/** 
-The state of the operation.
-*/
-	TInt iState;
-/** 
-The number of recipients processed so far for the current message.
-*/
-	TInt iRcpDone;
-/**
-The total number of recipients in the current message.
-*/
-	TInt iRcpCount;
-/** 
-The nmber of messages processed so far for the current operation.
-*/
-	TInt iMsgDone;
-/**
-The total number of messages for the current operation.
-*/
-	TInt iMsgCount; 
-/** 
-The Service Centre address.
-	
-This is set by the command ESmsMtmCommandReadServiceCenter.
-
-@removed
-This is no longer used since v7.0.
-*/
-	TBuf<14> iServiceCenterAddress;
-/** 
-The invisible folder that contains the messages read from the SIM by the command
-ESmsMtmCommandEnumeratePhoneStores.
-*/
-	TMsvId iEnumerateFolder;
-	};
-
-/** 
-Package buffer for TSmsProgress. 
-
-@see	TSmsProgress
-
-@publishedAll
-@released
-*/
-typedef TPckgBuf<TSmsProgress> TSmsProgressBuf;
-
-
-/**
-The SMS settings that are relevant on a per message basis.
-
-Each SMS message has its own settings. Initially they have a default set of 
-values derived from the SMS service settings. They can be changed on an
-individual message basis. For instance, a messaging application may allow a
-user to specify/not specify status reports individually for each message.
-
-These settings are only relevant to mobile originated messages - those of 
-SMS-SUBMIT type.
-
-@publishedAll
-@released
-*/
-class CSmsMessageSettings : public CBase
-	{
-public:
-	IMPORT_C virtual void InternalizeL(RReadStream& aReadStream);
-	IMPORT_C virtual void ExternalizeL(RWriteStream& aWriteStream) const;
-
-	inline const TTimeIntervalMinutes& ValidityPeriod() const;
-	inline void SetValidityPeriod(TTimeIntervalMinutes);
-
-	inline void SetValidityPeriodFormat(TSmsFirstOctet::TSmsValidityPeriodFormat aValidityPeriodFormat);
-	inline const TSmsFirstOctet::TSmsValidityPeriodFormat ValidityPeriodFormat() const;
-
-	inline TBool RejectDuplicate() const;
-	inline void SetRejectDuplicate(TBool);
-
-	inline TBool DeliveryReport() const;
-	inline void SetDeliveryReport(TBool);
-
-	inline TBool ReplyPath() const;
-	inline void SetReplyPath(TBool);
-
-	inline TSmsPIDConversion MessageConversion() const;
-	inline void SetMessageConversion(TSmsPIDConversion);
-
-	inline TBool CanConcatenate() const;
-	inline void SetCanConcatenate(TBool);
-
-	inline enum TSmsDataCodingScheme::TSmsAlphabet CharacterSet() const;
-	inline void SetCharacterSet(TSmsDataCodingScheme::TSmsAlphabet);
-
-    IMPORT_C virtual void CopyL(const CSmsMessageSettings& aSettings);
-
-	TUint32 MessageFlags() const;
-	void SetMessageFlags(TUint32 aMsgFlags);
-	inline TBool LastSegmentDeliveryReport() const;
-	inline void SetLastSegmentDeliveryReport(TBool);
-
-	inline void SetUseServiceCenterTimeStampForDate(TBool aUseServiceCenterTimestamp);
-	inline TBool UseServiceCenterTimeStampForDate() const;
-
-protected:
-
-	CSmsMessageSettings();
-
-private:
-
-	TUint32 iMsgFlags;
-	TSmsPIDConversion iMessageConversion;
-	TSmsDataCodingScheme::TSmsAlphabet iAlphabet;
-	TTimeIntervalMinutes iValidityPeriod;
-	TSmsFirstOctet::TSmsValidityPeriodFormat iValidityPeriodFormat;
-	};
-
-/** 
-The SMS Service settings.
-
-An SMS service entry stores an object of this type in its message store. These
-settings define the default settings for mobile originated messages (SMS-SUBMIT
-type messages). They also provide some global settings that are applied to all
-messages, both outward going and received messages.
-
-The SMS service also uses this class to store the set of avilable Servive Centre
-numbers. The default Service Centre is defined from this set.
-
-@publishedAll
-@released
-*/
-class CSmsSettings : public CSmsMessageSettings
-	{
-public:
-
-/**
-Defines the ways in which status reports that are received by the watcher may
-be handled.
-
-This can be applied to both SMS-STATUS-REPORT type messages and Special Messages
-(e.g. Voice Mail Indication messages).
-*/
-	enum TSmsReportHandling
-		{
-/** 
-The reports are put in the inbox and made invisible. 
-*/
-		EMoveReportToInboxInvisible,
-/** 
-The reports are put in the inbox and made visible.
-*/
-		EMoveReportToInboxVisible,
-/**
-The reports are deleted.
-*/
-		EDiscardReport,
-/** 
-Not supported.
-*/
-		EDoNotWatchForReport,
-/**
-Reports are put in the inbox and made invisible. The status report 
-is matched against the sent mesasge and its summary info updated.
-*/
-		EMoveReportToInboxInvisibleAndMatch,
-/**
-Reports are put in the inbox and made visible. The status report 
-is matched against the sent mesasge and its summary info updated.
-*/
-		EMoveReportToInboxVisibleAndMatch,
-/**
-Reports are deleted. The status report is matched against the sent
-mesasge and its summary info updated.
-*/
-		EDiscardReportAndMatch
-		};
-
-/** 
-Sets whether the service settings should be used to update the communications 
-database. 
-
-If the update is specified, it is done when the Service settings are stored into
-the message store.
-*/
-	enum TSmsSettingsCommDbAction
-		{
-/** 
-The comms database should not be updated.
-*/
-		ENone,
-/** 
-Use the Service settings to update the comms datebase.
-*/
-		EStoreToCommDb
-		};
-
-/** Defines the SMS bearer.
-Modes: GSM */
-enum TMobileSmsBearer
-	{
-	/** SMS messages will only be sent over a packet-switched (GPRS) network. */
-		ESmsBearerPacketOnly,
-	/** SMS messages will only be sent over a circuit-switched (GSM) network. */
-		ESmsBearerCircuitOnly,
-	/** SMS messages will be sent over the packet-switched (GPRS) network if possible, 
-	otherwise over circuit-switched (GSM) network. */
-		ESmsBearerPacketPreferred,
-	/** SMS messages will be sent over the circuit-switched (GSM) network if possible, 
-	otherwise over packet-switched (GPRS) network. */
-		ESmsBearerCircuitPreferred
-	};
-
-public:
-
-	IMPORT_C static CSmsSettings* NewL();
-	IMPORT_C static CSmsSettings* NewLC();
-	IMPORT_C virtual ~CSmsSettings();
-
-	IMPORT_C TInt ServiceCenterCount() const;
-	IMPORT_C CSmsServiceCenter& GetServiceCenter(TInt aIndex) const;
-	IMPORT_C void AddServiceCenterL(const TDesC& aName,const TDesC& aNumber);
-	IMPORT_C void RemoveServiceCenter(TInt aIndex);
-	IMPORT_C TInt DefaultServiceCenter() const;
-	IMPORT_C void SetDefaultServiceCenter(TInt aDefaultSC);
-	inline TSmsDelivery Delivery() const;
-	inline void SetDelivery(TSmsDelivery);
-
-	inline TBool ReplyQuoted() const;
-	inline void SetReplyQuoted(TBool);
-
-    IMPORT_C void CopyL(const CSmsSettings& aSmsSettings);
-
-	inline TSmsReportHandling StatusReportHandling() const;
-	inline void SetStatusReportHandling(TSmsReportHandling aStatusReportHandling);
-	inline TSmsReportHandling SpecialMessageHandling() const;
-	inline void SetSpecialMessageHandling(TSmsReportHandling aSpecialMessageHandling);
-
-	inline void SetCommDbAction(TSmsSettingsCommDbAction aCommDbAction);
-	inline TSmsSettingsCommDbAction CommDbAction() const;
-
-	inline void SetSmsBearerAction(TSmsSettingsCommDbAction aSmsBearerAction);
-	inline TSmsSettingsCommDbAction SmsBearerAction() const;
-
-	inline void SetSmsBearer(TMobileSmsBearer aSmsBearer);
-	inline TMobileSmsBearer SmsBearer() const;
-
-	inline void SetClass2Folder(TMsvId aId);
-	inline TMsvId Class2Folder() const;
-
-	inline void SetDescriptionLength(TInt aLength);
-	inline TInt DescriptionLength() const;
-
-	inline TBool DiscardUnknownPortMessage() const;
-	inline void SetDiscardUnknownPortMessage(TBool aDeleteMessage);
-	TUint32 SettingsFlags() const;
-	void SetSettingsFlags(TUint32 aSetFlags);
-
-	void RemoveSCAddresses();
-	void StoreToCommDbL() const;
-
-private:
-
-	CSmsSettings();
-	void ConstructL();
-
-private:
-
-	TUint32 iSetFlags;
-	CArrayPtrFlat<CSmsServiceCenter> *iServiceCenters;
-	TSmsDelivery iDelivery;
-	TInt iDefaultSC;
-	TSmsReportHandling iStatusReportHandling;
-	TSmsReportHandling iSpecialMessageHandling;
-	TSmsSettingsCommDbAction iCommDbAction;
-	TSmsSettingsCommDbAction iSmsBearerAction;
-	TMobileSmsBearer iSmsBearer;
-	TMsvId iClass2Folder;
-	TInt iDescriptionLength;
-	};
-
-/** 
-Recipient information for an SMS message.
-
-A SMS-SUBMIT message may have several recipients
-
-@publishedAll
-@released
-*/
-class CSmsNumber : public CMsvRecipient 
-	{
-public:
-
-/**
-Defines the status of an acknowledgement for a recipient.
-*/
-	enum TSmsAckStatus
-		{
-/**
-An acknowledgement for this recipient has not been requested.
-*/
-		ENoAckRequested		= 0,
-/**
-The delivery status for this recipient has been requested, but the status report
-has not yet been received.
-*/
-		EPendingAck,
-/**
-A successful acknowledgement for this recipient has been received.
-*/
-		EAckSuccessful,
-/**
-A failed acknowledgement for this recipient has been received.
-*/
-		EAckError
-		};
-
-public:
-
-	IMPORT_C static CSmsNumber* NewL();
-	IMPORT_C static CSmsNumber* NewL(const CSmsNumber& aSmsNumber);
-	IMPORT_C virtual ~CSmsNumber();
-
-	IMPORT_C void InternalizeL(RReadStream& aStream);
-	IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
-
-	IMPORT_C TPtrC Address() const;
-	IMPORT_C void SetAddressL(const TDesC& aAddress);
-	void SetEmailAddressL(const TDesC& aAddress, CSmsEmailFields* aEmailFields, const TDesC& aAlias);
-
-	IMPORT_C TPtrC Name() const;
-	IMPORT_C void SetNameL(const TDesC& aName);
-
-	inline TLogId LogId() const;
-	inline void SetLogId(TLogId aLogId);
-
-	IMPORT_C CSmsNumber& CopyL(const CSmsNumber& aSmsNumber);
-
-	IMPORT_C TSmsAckStatus AckStatus(TSmsAckType aAckType) const;
-	IMPORT_C void SetAckStatus(TSmsAckType aAckType, TSmsAckStatus aAckStatus);
-	
-private:
-
-	CSmsNumber();
-	TPtrC LimitStringSize(const TPtrC& aString, TInt aMaxLength) const;
-
-private:
-
-	HBufC* iNumber;
-	HBufC* iName;
-	TLogId iLogId;
-	TSmsAckStatus iDeliveryStatus;
-	};
-
-/** 
-Used to store Service Centre numbers and their associated name.
-
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS (CSmsServiceCenter) : public CBase
-	{
-public:
-	IMPORT_C static CSmsServiceCenter* NewL();
-	IMPORT_C static CSmsServiceCenter* NewL(const CSmsServiceCenter& aSmsSC);
-	IMPORT_C ~CSmsServiceCenter();
-
-	IMPORT_C TPtrC Address() const;
-	IMPORT_C void SetAddressL(const TDesC& aAddress);
-
-	IMPORT_C TPtrC Name() const;
-	IMPORT_C void SetNameL(const TDesC& aName);
-	
-	IMPORT_C CSmsServiceCenter& CopyL(const CSmsServiceCenter& aSmsSc);
-
-private:
-	CSmsServiceCenter();
-	TPtrC LimitStringSize(const TPtrC& aString, TInt aMaxLength) const;
-	
-private:
-	HBufC* iNumber;
-	HBufC* iName;
-	};
-
-#include <smutset.inl>
-
-#endif // __SMUTSET_H__
--- a/messagingappbase/smsmtm/clientmtm/inc/SMUTSET.INL	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,634 +0,0 @@
-// Copyright (c) 1999-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 <smcmmain.h>
-#include <smut.h>
-
-/** 
-Constructor.
-
-@param	aType	
-The type of operation for which progress information is being given.
-*/
-inline TSmsProgress::TSmsProgress(TSmsProgressType aType)
-:	iError(KErrNone),
-	iType(aType),
-	iState(0),
-	iRcpDone(0),
-	iRcpCount(0),
-	iMsgDone(0),
-	iMsgCount(0),
-	iEnumerateFolder(0)
-	{
-	iServiceCenterAddress.Zero();
-	}
-
-/** 
-Gets the validity period for messages sent by the SMS MTM.
-
-If the service centre is unable to deliver the SMS message before this time 
-expires, a failure report may be generated by the service centre, and no further 
-attempts will be made to deliver the message to ther recipient.
-
-Validity period is only used for SMS-SUBMIT, mobile originated messages.
-
-@return
-The validity period of the message.
-*/
-inline const TTimeIntervalMinutes& CSmsMessageSettings::ValidityPeriod() const
-	{
-	return iValidityPeriod;
-	}
-
-/** 
-Sets the validity period for messages sent by the SMS MTM.
-
-@param	aValidityPeriod	
-The validity period.
-
-@panic	SMCM	8	
-The validity period is negative or greater than the maximum validity period
-(debug only).
-*/
-inline void CSmsMessageSettings::SetValidityPeriod(TTimeIntervalMinutes aValidityPeriod)
-	{
-	__ASSERT_DEBUG(aValidityPeriod.Int()>=0 && aValidityPeriod.Int()<=ESmsVPMaximum,Panic(ESmscVPOutOfRange));
-	iValidityPeriod=aValidityPeriod;
-	}
-
-/**
-Gets the values of the UI concatenated-SMS-allowed flag.
-
-If true, the UI should pass a long message in one piece to the MTM. If false, 
-it should split the message manually into 140 byte parts. The value of this 
-flag does not affect the behaviour of the SMS MTM.
-
-@return	
-The concatenated-SMS-allowed flag.
-*/
-inline TBool CSmsMessageSettings::CanConcatenate() const
-	{
-	return iMsgFlags&ESmsSettingsCanConcatenate;
-	}
-
-/** 
-Sets the values of the UI concatenated-SMS-allowed flag.
-
-If true, the UI should pass a long message in one piece to the MTM. If false, 
-it should split the message manually into 140 byte parts. The value of this 
-flag does not affect the behaviour of the SMS MTM.
-
-@param	aCanConcatenate	
-The value to set the concatenated-SMS-allowed flag to.
-*/
-inline void CSmsMessageSettings::SetCanConcatenate(TBool aCanConcatenate)
-	{
-	iMsgFlags = (iMsgFlags & ~ESmsSettingsCanConcatenate) | (aCanConcatenate?ESmsSettingsCanConcatenate : ESmsSettingsNoFlags);
-	}
-
-/**
-Gets the value of the reject-duplicate setting.
-
-If this is true, the service instructs the SC to reject an Sms-Submit for an 
-SMS still held in the SC that has the same message reference number and same 
-destination address as an previously submitted SMS from the same originating 
-address.
-
-@return	
-The value of the reject-duplicate setting.
-*/
-inline TBool CSmsMessageSettings::RejectDuplicate() const
-	{	
-	return iMsgFlags&ESmsSettingsRejectDuplicate;
-	}
-
-/**
-Sets the value of the reject-duplicate setting.
-
-@param	aRejectDuplicate	
-The value to set the reject-duplicate setting to.
-*/
-inline void CSmsMessageSettings::SetRejectDuplicate(TBool aRejectDuplicate)
-	{
-	iMsgFlags = (iMsgFlags & ~ESmsSettingsRejectDuplicate) | (aRejectDuplicate?ESmsSettingsRejectDuplicate : ESmsSettingsNoFlags);
-	}
-
-/**
-Tests if a status report (TP-SRR in GSM spec 03.40) will be requested from 
-the Service Centre.
-
-A value of ETrue indicates that a status report will be requested.
-
-@return	
-The value of the Status report flag.
-*/
-inline TBool CSmsMessageSettings::DeliveryReport() const
-	{
-	return iMsgFlags&ESmsSettingsDeliveryReport;
-	}
-
-/** 
-Sets if a status report (TP-SRR in GSM spec 03.40) will be requested from the
-Service Centre.
-
-A value of ETrue indicates that a status report will be requested.
-
-@param	aDeliveryReport	
-The value of the status report flag.
-*/
-inline void CSmsMessageSettings::SetDeliveryReport(TBool aDeliveryReport)
-	{
-	iMsgFlags = (iMsgFlags & ~ESmsSettingsDeliveryReport) | (aDeliveryReport?ESmsSettingsDeliveryReport : ESmsSettingsNoFlags);
-	}
-
-/**
-Gets the boolean flag that indicates whether a the reply path (Service Centre
-address) should be included in the SMS-SUBMIT message (TP-RP in GSM spec 03.40).
-
-A value of ETrue indicates that the Service Centre address should be included.
-This flag is only relavent for SMS-SUBMIT messages.
-
-@return
-The value of the reply path flag.
-*/
-
-inline TBool CSmsMessageSettings::ReplyPath() const
-	{
-	return iMsgFlags&ESmsSettingsReplyPathRequested;
-	}
-
-/**
-Sets the boolean flag that indicates whether a the reply path (Service Centre
-address) should be included in the SMS-SUBMIT message (TP-RP in GSM spec 03.40).
-
-A value of ETrue indicates that the Service Centre address should be included.
-This flag is only relavent for SMS-SUBMIT messages.
-
-@param   aReplyPathRequest
-The value of the reply path flag.
-*/
-inline void CSmsMessageSettings::SetReplyPath(TBool aReplyPathRequest)
-	{
-	iMsgFlags = (iMsgFlags & ~ESmsSettingsReplyPathRequested) | (aReplyPathRequest?ESmsSettingsReplyPathRequested : ESmsSettingsNoFlags);
-	}
-
-/**
-Gets the form in which the message should be delivered to the recipient by 
-the service centre. 
-
-Note that the form may or may not actually be supported by the service centre, 
-and that the format of the recipient address(es) may need to be different 
-to a normal telephone number if MessageConversion() is set to any other value 
-than ESmsConvPIDNone, ESmsConvFax, ESmsConvPaging or ESmsConvErmes.
-
-@return
-The value of the message form specifier.
-*/
-inline TSmsPIDConversion CSmsMessageSettings::MessageConversion() const
-	{
-	return iMessageConversion;
-	}
-
-/**
-Sets the form in which the message should be delivered to the recipient by the
-Service Centre. 
-
-Note that the form may or may not actually be supported by the service centre, 
-and that the format of the recipient address(es) may need to be different 
-to a normal telephone number if MessageConversion() is set to any other value 
-than ESmsConvPIDNone, ESmsConvFax, ESmsConvPaging or ESmsConvErmes.
-
-
-@param	aMessageConversion
-The message form specifier.
-*/
-inline void CSmsMessageSettings::SetMessageConversion(TSmsPIDConversion aMessageConversion)
-	{
-	iMessageConversion=aMessageConversion;
-	}
-
-/** 
-Gets the default character set used in the SMS message. 
-
-Text is stored in Unicode on the Symbian OS phone and is converted into the 
-appropriate character set when the message is sent.
-
-@return
-The default character set for the message.
-*/
-inline TSmsDataCodingScheme::TSmsAlphabet CSmsMessageSettings::CharacterSet() const
-	{
-	return iAlphabet;
-	}
-
-/**
-Sets the default character set used in the SMS message.
-
-Text is stored in Unicode on the Symbian OS phone and is converted into the 
-appropriate character set when the message is sent.
-
-@param	aAlphabet
-The value of the default character set for the message.
-*/
-inline void CSmsMessageSettings::SetCharacterSet(TSmsDataCodingScheme::TSmsAlphabet aAlphabet)
-	{
-	iAlphabet=aAlphabet;
-	}
-
-/**
-Sets the format in which the validity period should be sent in a SMS-DELIVER 
-type message.
-
-This is field TP-VPF from GSM spec 03.40.
-
-@param	aValidityPeriodFormat
-The validity period format.
-*/
-inline void CSmsMessageSettings::SetValidityPeriodFormat(TSmsFirstOctet::TSmsValidityPeriodFormat aValidityPeriodFormat)
-	{
-	iValidityPeriodFormat = aValidityPeriodFormat;
-	}
-
-/** 
-Gets the format in which the validity period should be sent in a SMS-DELIVER
-type message.
-
-@return
-The validity period format.
-*/
-inline const TSmsFirstOctet::TSmsValidityPeriodFormat CSmsMessageSettings::ValidityPeriodFormat() const
-	{
-	return iValidityPeriodFormat;
-	}
-
-/**
-Sets the flag which indicates whether the service center timestamp should
-be used for the date field in the TMsvEntry in message store. If the flag
-is not set, then the timestamp from the associated CSmsMessage is used.
-
-@param	aUseServiceCenterTimestamp
-Flag to indicate whether to use the service center timestamp
-*/
-inline void CSmsMessageSettings::SetUseServiceCenterTimeStampForDate(TBool aUseServiceCenterTimestamp)
-	{
-	iMsgFlags = (iMsgFlags & ~ESmsSettingsUseServiceCenterTimeStamp) | (aUseServiceCenterTimestamp ? ESmsSettingsUseServiceCenterTimeStamp : ESmsSettingsNoFlags);
-	}
-
-/**
-Gets the flag which indicates whether the service center timestamp should
-be used for the date field in the TMsvEntry in message store. If the flag
-is not set, then the timestamp from the associated CSmsMessage is used.
-
-@return Flag which indcates if service center timestamp will be used.
-*/
-inline TBool CSmsMessageSettings::UseServiceCenterTimeStampForDate() const
-	{
-	return iMsgFlags & ESmsSettingsUseServiceCenterTimeStamp;
-	}
-
-/**
-Gets whether the editor should quote the received message at the beginning of 
-the reply message.
-
-@return	
-A value of ETrue if the editor should quote the received message at the beginning
-of the reply. EFalse if not.
-*/
-inline TBool CSmsSettings::ReplyQuoted() const
-	{
-	return iSetFlags&ESmsSettingsReplyQuoted;
-	}
-
-/**
-Sets whether the editor should quote the received message at the beginning of
-the reply message.
-
-@param	aReplyQuited
-The value to set the reply-quoted flag to.
-*/
-inline void CSmsSettings::SetReplyQuoted(TBool aReplyQuoted)
-	{
-	iSetFlags = (iSetFlags & ~ESmsSettingsReplyQuoted) | (aReplyQuoted?ESmsSettingsReplyQuoted : ESmsSettingsNoFlags);
-	}
-
-/** 
-Gets the default schedule delivery type of a new message created using the SMS
-client MTM.
-
-@return	
-The schedule delivery type.
-*/
-inline TSmsDelivery CSmsSettings::Delivery() const
-	{
-	return iDelivery;
-	}
-
-/** 
-Sets the default schedule delivery type of a new message created using the SMS
-client MTM.
-
-@param	aDelivery
-The schedule delivery type.
-*/
-inline void CSmsSettings::SetDelivery(TSmsDelivery aDelivery)
-	{
-	iDelivery=aDelivery;
-	}
-
-
-/**
-Gets the way in which status reports that are received by the watcher are handled.
-
-By default, this is EDoNotWatchForReport. This value is not supported and 
-therefore the value must be changed from the default.
-
-@return
-How SMS status reports are handled.
-
-@see	CSmsSettings::TSmsReportHandling
-*/
-inline CSmsSettings::TSmsReportHandling CSmsSettings::StatusReportHandling() const
-	{
-	return iStatusReportHandling;
-	}
-
-/**
-Sets the way in which status reports that are received by the watcher are handled.
-
-@param	aStatusReportHandling
-The SMS status report handling data.
-
-@see	CSmsSettings::TSmsReportHandling
-*/
-inline void CSmsSettings::SetStatusReportHandling(CSmsSettings::TSmsReportHandling aStatusReportHandling)
-	{
-	iStatusReportHandling = aStatusReportHandling;
-	}
-
-/**
-Gets the way in which special messages that are received by the watcher are 
-handled. 
-
-By default, this is EDoNotWatchForReport. This value is not supported and 
-therefore the value must be changed from the default.
-
-@return
-How special messages are handled.
-
-@see	CSmsSettings::TSmsReportHandling
-*/
-inline CSmsSettings::TSmsReportHandling CSmsSettings::SpecialMessageHandling() const
-	{
-	return iSpecialMessageHandling;
-	}
-
-/**
-Sets the way in which special messages that are received by the watcher are 
-handled.
-
-@param	aSpecialMessageHandling
-The special messages handling data.
-
-@see	CSmsSettings::TSmsReportHandling
-*/
-inline void CSmsSettings::SetSpecialMessageHandling(CSmsSettings::TSmsReportHandling aSpecialMessageHandling)
-	{
-	iSpecialMessageHandling = aSpecialMessageHandling;
-	}
-
-/**
-Sets whether the Service settings should be used to update the communications 
-database.
-
-If set, this uses the service settings to update the comms db MODEM table's 
-MODEM_MESSAGE_CENTRE_NUMBER, MODEM_MESSAGE_VALIDITY_PERIOD and 
-MODEM_MESSAGE_DELIVERY_REPORT fields. The update is done when the Service 
-settings are stored into the message store using CSmsSettings::StoreL().
-
-The default setting is for the comms db not to be updated - TSmsSettingsCommDbAction::ENone.
-
-@param	aCommDbAction
-The communications database action.
-
-@see	CSmsSettings::TSmsSettingsCommDbAction
-@see	CSmsSettings::StoreL
-*/
-inline void CSmsSettings::SetCommDbAction(CSmsSettings::TSmsSettingsCommDbAction aCommDbAction)
-	{
-	iCommDbAction = aCommDbAction;
-	}
-
-/**
-Gets the communications database action.
-
-For details, see CSmsSettings::SetCommDbAction().
-
-@return
-The communications database action.
-
-@see	CSmsSettings::TSmsSettingsCommDbAction
-@see	CSmsSettings::SetCommDbAction
-*/
-inline CSmsSettings::TSmsSettingsCommDbAction CSmsSettings::CommDbAction() const
-	{
-	return iCommDbAction;
-	}
-
-/**
-Sets whether the Service's SMS bearer setting should be used to update the 
-communications database.
-
-If set, this uses the service setting to update the comm db global table's 
-SMS_BEARER field. The update is done when the Service settings are stored into 
-the message store using CSmsSettings::StoreL().
-
-The default setting is for the comms db not to be updated - TSmsSettingsCommDbAction::ENone.
-
-@param	aSmsBearerAction
-The SMS bearer action.
-
-@see	CSmsSettings::TSmsSettingsCommDbAction
-@see	CSmsSettings::StoreL
-*/
-inline void CSmsSettings::SetSmsBearerAction(CSmsSettings::TSmsSettingsCommDbAction aSmsBearerAction)
-	{
-	iSmsBearerAction = aSmsBearerAction;
-	}
-
-/**
-Gets the SMS bearer action.
-
-For details, see CSmsSettings::SetCommDbAction().
-
-@return The SMS bearer action. 
-
-@see	CSmsSettings::TSmsSettingsCommDbAction
-@see	CSmsSettings::SetSmsBearerAction
-*/
-inline CSmsSettings::TSmsSettingsCommDbAction CSmsSettings::SmsBearerAction() const
-	{
-	return iSmsBearerAction;
-	}
-
-/**
-Sets the SMS bearer.
-
-@param	aSmsBearer
-The SMS bearer.
-*/
-inline void CSmsSettings::SetSmsBearer(CSmsSettings::TMobileSmsBearer aSmsBearer)
-	{
-	iSmsBearer = aSmsBearer;
-	}
-
-/**
-Gets the SMS bearer.
-
-@return
-The SMS bearer.
-*/
-inline CSmsSettings::TMobileSmsBearer CSmsSettings::SmsBearer() const
-	{
-	return iSmsBearer;
-	}
-
-/**
-Sets the folder ID into which received class 2 SMS-DELIVER messages are stored.
-
-@param	aId
-The folder ID for received class 2 messages.
-*/
-inline void CSmsSettings::SetClass2Folder(TMsvId aId)
-	{
-	iClass2Folder = aId;
-	}
-
-/**
-Gets the folder ID into which received class 2 SMS-DELIVER messages are stored.
-
-@return
-The class 2 folder ID.
-*/
-inline TMsvId CSmsSettings::Class2Folder() const
-	{
-	return iClass2Folder;
-	}
-
-/**
-Sets the maximum length of the message entry description.
-
-The default value is given by KSmsDescriptionLength.
-
-@param	aDescriptionLength
-The maximum length.
-
-@see	KSmsDescriptionLength
-*/
-inline void CSmsSettings::SetDescriptionLength(TInt aDescriptionLength)
-	{
-	iDescriptionLength = aDescriptionLength;
-	}
-
-/**
-Gets the maximum length of the message entry description.
-
-@return
-The maximum length of the message entry description.
-
-@see	KSmsDescriptionLength
-*/
-inline TInt CSmsSettings::DescriptionLength() const
-	{
-	return iDescriptionLength;
-	}
-
-/**
-Sets the boolean flag that indicates whether to discard unknown port message.
-
-A value of ETrue indicates that discard unknown port message, 
-it will be done without indicating the user.
-
-@param   aDeleteMsg
-The value of the discard message flag.
-*/
-inline void CSmsSettings::SetDiscardUnknownPortMessage(TBool aDeleteMessage) 
-    {
-    iSetFlags = (iSetFlags & ~ESmsSettingsDiscardUnknownPortMsgs) | (aDeleteMessage ? ESmsSettingsDiscardUnknownPortMsgs : ESmsSettingsNoFlags);
-    }
-
-/**
-Gets the boolean flag that indicates whether to discard unknown port message.
-
-A value of ETrue indicates to discard unknown port message.
-
-@return
-The value of the discard message flag.
-*/
-inline TBool CSmsSettings::DiscardUnknownPortMessage() const
-    {
-    return iSetFlags & ESmsSettingsDiscardUnknownPortMsgs;
-    }
-	
-/**
-Gets the ID by which to identify the SMS-DELIVER message PDU for this recipient.
-
-@return	
-The log ID for this recipient.
-*/
-inline TLogId CSmsNumber::LogId() const
-	{
-	return iLogId;
-	}
-
-/** 
-Sets the ID by which to identify the SMS-DELIVER message PDU for this recipient.
-
-@param	aLogId	
-The log ID for this recipient.
-*/
-inline void CSmsNumber::SetLogId(TLogId aLogId)
-	{
-	iLogId = aLogId;
-	}
-
-/**
-Tests if a status report (TP-SRR in GSM spec 03.40) for the last segment will be requested from 
-the Service Centre.
-
-A value of ETrue indicates that a status report will be requested for the last segment.
-
-@return	
-The value of the Status report flag only for the last segment.
-*/
-
-inline TBool CSmsMessageSettings::LastSegmentDeliveryReport() const
-	{
-	return iMsgFlags & ESmsSettingsLastSegmentDeliveryReport;
-	}
-
-/** 
-Sets if a status report (TP-SRR in GSM spec 03.40) for the last segment will be requested from the
-Service Centre.
-
-A value of ETrue indicates that a status report will be requested for the last segment.
-
-@param	aDeliveryReport	
-The value of the status report flagfor the last segment.
-*/
-
-inline void CSmsMessageSettings::SetLastSegmentDeliveryReport(TBool aDeliveryReport)
-	{
-	iMsgFlags = (iMsgFlags & ~ESmsSettingsLastSegmentDeliveryReport) | (aDeliveryReport?ESmsSettingsLastSegmentDeliveryReport : ENoSmsSettingsLastSegmentDeliveryReport);
-	}
--- a/messagingappbase/smsmtm/clientmtm/inc/csmsaccount.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-// Copyright (c) 2004-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 __CSMSACCOUNT_H__
-#define __CSMSACCOUNT_H__
-
-
-#include <e32base.h>
-#include <msvapi.h>
-
-
-class CSmsSettings;
-class CMsvOffPeakTimes;
-class CMsvScheduleSettings;
-class CMsvSendErrorActions;
-class CMsvSysAgentActions;
-class CRepository;
-
-
-/**
-Stores SMS service and Schedule Send settings to Central Repository. 
-
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS (CSmsAccount) : public CBase, public MMsvSessionObserver
-	{
-public:
-
-	IMPORT_C static CSmsAccount* NewL();
-	IMPORT_C static CSmsAccount* NewLC();
-	IMPORT_C virtual ~CSmsAccount();
-
-	IMPORT_C void InitialiseDefaultSettingsL(CSmsSettings& aSmsSettings);
-	IMPORT_C void InitialiseDefaultSettingsL(CMsvScheduleSettings& aScheduleSettings, CMsvOffPeakTimes& aOffPeakTimes, CMsvSendErrorActions& aErrorActions, CMsvSysAgentActions& aSysAgentActions);
-	IMPORT_C void LoadSettingsL(CSmsSettings& aSmsSettings);
-	IMPORT_C void LoadSettingsL(CMsvScheduleSettings& aScheduleSettings, CMsvOffPeakTimes& aOffPeakTimes, CMsvSendErrorActions& aErrorActions, CMsvSysAgentActions& aSysAgentActions);
-    IMPORT_C void SaveSettingsL(const CSmsSettings& aSmsSettings) const;
-	IMPORT_C void SaveSettingsL(const CMsvScheduleSettings& aScheduleSettings, const CMsvOffPeakTimes& aOffPeakTimes, const CMsvSendErrorActions& aErrorActions, const CMsvSysAgentActions& aSysAgentActions) const;
-
-private:
-	CSmsAccount();
-	void ConstructL();
-	void HandleSessionEventL(TMsvSessionEvent , TAny* , TAny* , TAny* );
-	CMsvSession& SessionL();	
-	
-	TMsvId CreateSmsServiceL();
-	void ResetSettings();
-#if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
-	void CreateHeaderStoreL();
-#endif
-private:
-	enum TSmsSettingsCenRepId
-		{
-		// Service Settings		
-		ESmsServiceId					= 0x00000000,
-		ESmsSettingsVersionId			= 0x00000001,
-		ESmsSettingsMesssageVersionId	= 0x00000002,
-		ESmsValidityPeriodId			= 0x00000003,
-		ESmsValidityPeriodFormatId	   	= 0x00000004,     	
-		ESmsAlphabetId					= 0x00000005,
-		ESmsMsgFlagsId					= 0x00000006,
-		ESmsMessageConversionId			= 0x00000007,
-		ESmsFlagsId						= 0x00000008,
-		ESmsStatusReportHandlingId		= 0x00000009,
-		ESmsSpecialMessageHandlingId	= 0x0000000A,
-		ESmsCommDbActionId				= 0x0000000B,
-		ESmsDeliveryId					= 0x0000000C,
-		ESmsDefaultSCId					= 0x0000000D,
-		ESmsSCAddressesCountId			= 0x0000000E,
-		ESmsBearerActionId				= 0x0000000F,
-		ESmsBearerId					= 0x00000010,
-		ESmsClass2FolderId				= 0x00000020,
-		ESmsDescriptionLengthId			= 0x00000030,
-		ESmsAccountNameId				= 0x00000040,
-		
-		ESmsSCAddressesPartialId		= 0x00001000,
-		EMsgSMSTimeStampSettings		= 0x000A0020
-		};
-
-private:
-	CMsvSession* iMsvSession;
-	CRepository* iRepository;
-	};
-
-#endif // __CSMSACCOUNT_H__
--- a/messagingappbase/smsmtm/clientmtm/inc/csmsemailfields.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-// Copyright (c) 2004-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 __CSMSEMAILFIELDS_H__
-#define __CSMSEMAILFIELDS_H__
-
-#include <e32base.h>
-#include <s32file.h>
-#include <badesca.h>
-
-#if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
-#include <smut.h>
-#include <msvstd.h>
-#endif
-
-class CMsvStore;
-
-#if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
-class CHeaderFields;
-#endif
-
-
-/**
-Encapsulates the address and subject fields for Email sent over SMS.
-
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS (CSmsEmailFields) : public CBase
-	{
-public:
-	IMPORT_C static CSmsEmailFields* NewL();
-	IMPORT_C static CSmsEmailFields* NewL(const CSmsEmailFields& aEmailFields);
-	IMPORT_C virtual ~CSmsEmailFields();
-
-	IMPORT_C void Reset();
-	IMPORT_C TInt Length() const;
-	IMPORT_C TBool HasAddress() const;
-	IMPORT_C HBufC* ComposeLC() const;
-	TInt ParseL(const TDesC& aBuffer);
-
-	IMPORT_C void AddAddressL(const TDesC& aAddress);
-	IMPORT_C void RemoveAddress(TInt aIndex);
-	IMPORT_C const MDesCArray& Addresses() const;
-	
-	IMPORT_C void SetSubjectL(const TDesC& aSubject);
-	IMPORT_C const TDesC& Subject() const;
-	
-	void RestoreL(CMsvStore& aStore);
-	void StoreL(CMsvStore& aStore) const;
-
-#if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
-	void StoreDBL(CMsvStore& aStore);
-	void ReStoreDBL(CMsvStore& aStore);
-	TInt ConvertToTInt(TDesC16& aStr);
-	void GetRecipientListL(TDesC16& aStr);
-	TInt GetBufSize();
-#endif
-
-private:
-	CSmsEmailFields();
-	void ConstructL();
-	void ConstructL(const CSmsEmailFields& aEmailFields);
-
-	void InternalizeL(RReadStream& aStream);
-	void ExternalizeL(RWriteStream& aStream) const;
-private:	
-	CDesCArray*		iAddresses;
-	HBufC*			iSubject;
-	};
-
-#endif	// __CSMSEMAILFIELDS_H__
--- a/messagingappbase/smsmtm/clientmtm/inc/csmsgetdetdescinterface.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-// Copyright (c) 2006-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 __CSMSGETDETDESCINTERFACE_H__
-#define __CSMSGETDETDESCINTERFACE_H__
-
-#include <e32base.h>
-#include <ecom/ecom.h>
-#include <badesca.h>
-#include <smut.h>
-
-// Forward class references
-class CSmsMessage;
-
-/**
-ECOM interface definition for the routines used to create the details and
-description values for an SMS.
-
-Note: Default parameters are included to provide an equivalent interface to that
-previously provided by TSmsUtilities.
-Implementers of substitute plugins should be aware that the value of the default 
-arguments specified in each of the functions, ie aMaxLength = KSmsDetailsLength, 
-cannot be overridden by specifying a new value in the plugin implementation, as
-the APIs are always called via a base-class pointer.
-
-@publishedPartner
-@released
-*/
-class CSmsGetDetDescInterface : public CBase
-	{
-public:
-	static CSmsGetDetDescInterface* NewL();
-	virtual ~CSmsGetDetDescInterface();
-
-	virtual TInt GetDetails(RFs& aFs, const CSmsMessage& aMessage, TDes& aDetails, TInt aMaxLength = KSmsDetailsLength) = 0;
-	virtual TInt GetDetails(RFs& aFs, const TDesC& aFromAddress, TDes& aDetails, TInt aMaxLength = KSmsDetailsLength) = 0;
-	virtual TInt GetDescription(const CSmsMessage& aMessage, TDes& aDescription, TInt aMaxLength = KSmsDescriptionLength) = 0;
-
-protected:
-	inline CSmsGetDetDescInterface();
-
-private:
-	TUid iDtor_ID_Key;
-	};
-
-#include <csmsgetdetdescinterface.inl>
-
-#endif // __CSMSGETDETDESCINTERFACE_H__
--- a/messagingappbase/smsmtm/clientmtm/inc/csmsgetdetdescinterface.inl	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-// Copyright (c) 2006-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 <ecom/ecom.h>
-
-const TUid KUidSmsGetDetDesc = {0x10282FA5};
-
-static void CleanUpEComSmsInfoArray(TAny* aInfoArray);
-
-/**
-Static factory constructor.
-
-@return The constructed CSmsGetDetDescInterface object
-*/
-inline CSmsGetDetDescInterface* CSmsGetDetDescInterface::NewL()
-	{
-	RImplInfoPtrArray implInfoArray;
-	TCleanupItem cleanup(CleanUpEComSmsInfoArray, &implInfoArray);
-    CleanupStack::PushL(cleanup);
-    // get all implementations of the SMS GetDetDesc interface
-	REComSession::ListImplementationsL(KUidSmsGetDetDesc, implInfoArray);
-	TInt count = implInfoArray.Count();
-
-	if (count == 0)
-		{
-		implInfoArray.ResetAndDestroy();
-		implInfoArray.Close();
-		CleanupStack::PopAndDestroy(&implInfoArray);
-		User::Leave(KErrNotFound);
-		}
-		
-	CSmsGetDetDescInterface* interface = NULL;
-
-	for (TInt impl = 0; impl < count; ++impl)
-		{
-		if (implInfoArray[impl]->VendorId() != 0x70000001)
-			{
-			interface = REINTERPRET_CAST(
-							CSmsGetDetDescInterface*,
-							REComSession::CreateImplementationL(
-								implInfoArray[impl]->ImplementationUid(),
-								_FOFF(CSmsGetDetDescInterface, iDtor_ID_Key)));
-			}
-		}
-	
-	if (!interface)
-		{
-		interface = REINTERPRET_CAST(
-						CSmsGetDetDescInterface*,
-						REComSession::CreateImplementationL(
-							implInfoArray[0]->ImplementationUid(),
-							_FOFF(CSmsGetDetDescInterface, iDtor_ID_Key)));
-		}
-				
-	implInfoArray.ResetAndDestroy();
-	implInfoArray.Close();
-    CleanupStack::PopAndDestroy(&implInfoArray);
-	return interface;
-	}
-
-/**
-Class constructor.
-*/
-inline CSmsGetDetDescInterface::CSmsGetDetDescInterface()
-	{
-	}
-
-/**
-Class destructor.
-Destroy the ECOM implementation
-*/
-inline CSmsGetDetDescInterface::~CSmsGetDetDescInterface()
-	{
-	REComSession::DestroyedImplementation(iDtor_ID_Key);
-	}
-
-
-/**
-CleanUpEComSmsInfoArray function for cleanup support of locally declared arrays.
-*/
-void CleanUpEComSmsInfoArray(TAny* aInfoArray)
-	{
-	RImplInfoPtrArray* infoArray = (static_cast<RImplInfoPtrArray*>(aInfoArray));
-	infoArray->ResetAndDestroy();
-	infoArray->Close();
-	}
-
-	
--- a/messagingappbase/smsmtm/clientmtm/inc/csmssendmessageoperation.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-// Copyright (c) 2004-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 __CSMSSENDMESSAGEOPERATION_H__
-#define __CSMSSENDMESSAGEOPERATION_H__
-
-
-#include <msvapi.h>
-
-/**
-Encapsulates the parameters to schedule the sms send operation.
-
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS (CSmsSendMessageOperation) : public CMsvSendOperation
-	{
-public:
-	static CSmsSendMessageOperation* NewL(CMsvSession& aMsvSession, 
-									   	  const CMsvEntrySelection& aSelection, 
-									   	  const TDesC8& aParameter, 
-									   	  TRequestStatus& aObserverRequestStatus);
-private:		
-	void ConstructL(const CMsvEntrySelection& aSelection, const TDesC8& aParameter);
-	CSmsSendMessageOperation(CMsvSession& aMsvSession, TRequestStatus& aObserverRequestStatus);
-	// from CMsvSendOperation		
-	virtual const TDesC8& TranslateProgress(const TDesC8& aProgress);
-	};
-
-
-#endif // __CSMSSENDMESSAGEOPERATION_H__
-
--- a/messagingappbase/smsmtm/clientmtm/inc/smscmds.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,334 +0,0 @@
-// Copyright (c) 1999-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:
-// smscmds.h
-//
-/**
- * @file 
- * @publishedAll
- * @released
- */
-#ifndef __SMSCMDS_H__
-#define __SMSCMDS_H__
-
-#include <e32def.h>
-
-/**
-Numeric value of the first SMS-specific command.
-
-This is only used by TSmsMtmCommand.
-
-@see	TSmsMtmCommand
-
-@publishedAll 
-@released
-*/
-const TInt KMinCommandExpected = 10000;
-
-/**
-The SMS-specific commands that can be issued through CSmsClientMtm::InvokeAsyncFunctionL.
-
-SMS messages can be stored in a medium other than the message store itself. For
-instance, SMS messages can be stored on the SIM card. This alternative storage
-is referred to as the phone store.
-
-Some of the commands defined allow the contents of the phone store to accessed
-and manipulated.
-
-@see	CSmsClientMtm::InvokeAsyncFunctionL
-@see	CSmsClientMtm::ReadSimParamsL
-@see	CSmsClientMtm::WriteSimParamsL
-@see	TSmsProgress 
-
-@publishedAll
-@released
-*/
-enum TSmsMtmCommand 
-	{
-/**
-Gets the service centre address (i.e. telephone number) from the GSM handset.
-
-The result may be retrieved from the iServiceCenterAddress member variable 
-in the TSmsProgress progress object for this operation. 
-
-The aSelection and aParameter arguments are not used by this command, except 
-that aSelection must contain at least one member, preferably the SMS Service 
-ID. 
-
-If the telephone handset is unable to supply the service centre address, then 
-the progress object for this operation will contain the error. 
-
-NOTE - ESmsMtmCommandReadServiceCenter should only be used if the telephone 
-handset or TSY module does not support reading the SMS parameters on the SIM. 
-ESmsMtmCommandReadServiceCenter should only be used if the operation 
-returned by CSmsClientMtm::ReadSimParamsL completes with KErrNotSupported.
-
-@removed	
-This command is not supported from v7.0. The function CSmsClientMtm::ReadSimParamsL
-should be used instead to obtain Service Centre number from the phone store.
-
-@see	CSmsClientMtm::ReadSimParamsL
-@see	TSmsProgress
-*/
-	ESmsMtmCommandReadServiceCenter			= KMinCommandExpected,
-
-/** 
-Sets a new service centre address (i.e. telephone number) on the GSM handset. 
-
-The new telephone number is passed in aParameter as an 8-bit descriptor containing 
-a packaged TSmsServiceCenterAddress. 
-
-The aSelection parameter argument is not used by this command, except that 
-aSelection must contain at least one member, preferably the SMS Service ID. 
-
-@removed
-This command is not supported from v7.0. The function CSmsClientMtm::WriteSimParamsL
-should be used instead to write the Service Centre number to the phone store.
-
-@see	CSmsClientMtm::WriteSimParamsL
-@see	TSmsServiceCenterAddress
-*/
-	ESmsMtmCommandWriteServiceCenter,
-
-/**
-Schedules the selected SMS messages to be sent.
-
-The aSelection argument contains the TMsvId of the SMS messages to be sent. An 
-empty selection will cause a panic in debug mode. In release mode nothing will 
-happen.
-
-The time that each message is scheduled to be sent is set by the date field in
-the TMsvEntry for that message. Each message in the selection must have the same
-scheduled time as the first message in the selection. A send task is scheduled 
-to occur at this time.
-
-In debug mode a panic will occur if all the messages in the selection do not 
-have the safe scheduled time. In release mode, the scheduled time sending all 
-the messages in the selection will be that of the last message in the selection.
-
-When the scheduled task occurs not only will the selected messages be sent but
-also any waiting SMS messages in the Outbox.
-
-If the messages are successfully sent by the scheduled task, then all the sent
-messages are moved to the Sent folder.
-
-If any message fails to be sent then the message is marked as failed. Also it
-may be re-scheduled to be sent at a later time if that particular error has been
-specified as a re-schedulable error. The message remains in its current folder.
-
-The aParameter agrument is not used.
-
-@see	CMsvSession::TransferCommandL
-
-@see	CBaseMtm::InvokeAsyncCommandL
-
-*/
-	ESmsMtmCommandScheduleCopy,
-
-/**
-Not supported by the SMS MTM.
-
-@publishedAll 
-*/
-	ESmsMtmCommandScheduleMove,
-
-/**
-Removes all messages specified in aSelection from the task scheduler list.
-
-If successful, the messages will have their SendingState() set to KMsvSendStateSuspended 
-on completion of this operation. 
-
-The aParameter argument is not used by this function. 
-
-@see	TMsvEntry::SendingState() 
-*/
-	ESmsMtmCommandDeleteSchedule,
-
-/** 
-Checks the current scheduled status of the messages specified by aSelection. 
-
-If successful, the Scheduled() and iDate members of each TMsvEntry identified 
-in the selection will be changed to represent that messages's current status. 
-
-The aParameter argument is not used by this function. 
-
-@see	TMsvEntry
-*/
-	ESmsMtmCommandCheckSchedule,
-
-/**
-Starts sending the specified selection of SMS messages.
-
-When a selection of SMS messages are scheduled to be sent using the ESmsMtmCommandScheduleCopy
-command this is the actual command that is executed the scheduled time occurs.
-
-The SMS server MTM creates a package contain this command. The package is passed
-to the task scheduler who then passes it to the schedule send exe. The exe then
-uses the package to ask the SMS server MTM to send the messages. As such this
-command should not be used be external clients.
-
-When the scheduled task occurs not only will the selected messages be sent but
-also any waiting SMS messages in the Outbox.
-
-If the messages are successfully sent by the scheduled task, then all the sent
-messages are moved to the Sent folder.
-
-If any message fails to be sent then the message is marked as failed. Also it
-may be re-scheduled to be sent at a later time if that particular error has been
-specified as a re-schedulable error. The message remains in its current folder.
-
-@publishedAll 
-*/
-	ESmsMtmCommandSendScheduledCopy,
-
-/**
-Not supported by the SMS MTM.
-
-@publishedAll 
-*/
-	ESmsMtmCommandSendScheduledMove,
-
-/**
-Reads the SMS messages on the phone store and creates a copy of those messages
-in an invisible folder under the SMS service in the message store. 
-
-If successful, the iEnumerateFolder member of the operation's progress will 
-identify the invisible folder which contains the messages read from the phone 
-store.
-
-The aSelection argument must contain at least the SMS servive ID. The aParameter 
-argument can optionally be a TPckgC containing the ID of an existing folder to
-use for the enumeration. The contents of this folder will be replaced with the
-current messages in the phone store.
-
-The operation will fail with KErrArgument if the ID in aParameter is one of the
-following - KMsvRootIndexEntryId, KMsvLocalServiceIndexEntryId, KMsvGlobalInBoxIndexEntryId,
-KMsvGlobalOutBoxIndexEntryId, KMsvDraftEntryId or KMsvSentEntryId.
-
-This command must be called before using ESmsMtmCommandCopyFromPhoneStore, 
-ESmsMtmCommandMoveFromPhoneStore or ESmsMtmCommandDeleteFromPhoneStore. 
-
-Pre v7.0, this was named ESmsMtmCommandEnumerateSim.
-
-@see	TSmsProgress
-*/
-	ESmsMtmCommandEnumeratePhoneStores,
-
-/** 
-Moves the messages identified in aSelection to the folder identified in aParameter 
-(e.g. the inbox). 
-	
-The associated SMS messages are not deleted from the phone store.
-
-The first entry ID in aSelection must be the SMS service ID. All following 
-entry IDs in the selection must then represent each message to be transferred. 
-aParameter should contain a packaged TMsvId, which identifies the folder to 
-which the messages in aSelection will be moved. 
-
-The command ESmsMtmCommandEnumeratePhoneStores must be called before using 
-this command. 
-
-Pre v7.0, this was named ESmsMtmCommandCopyFromSim.
-
-@see	TSmsMtmCommand::ESmsMtmCommandEnumeratePhoneStores
-*/
-	ESmsMtmCommandCopyFromPhoneStore,  
-
-/**
-Moves the messages identified in aSelection to the folder identified in aParameter 
-(e.g. the inbox), and then deletes the messages from the phone store. 
-
-The first entry ID in aSelection must be the SMS service ID. All following 
-entry IDs in the selection must then represent each message to be transferred. 
-aParameter should contain a packaged TMsvId, which identifies the folder to 
-which the messages in aSelection will be moved. 
-
-The command ESmsMtmCommandEnumeratePhoneStores must be called before using 
-this command. 
-
-Pre v7.0, this was named ESmsMtmCommandMoveFromSim.
-
-@see	TSmsMtmCommand::ESmsMtmCommandEnumeratePhoneStores
-*/
-	ESmsMtmCommandMoveFromPhoneStore,  
-
-/**
-Deletes the specified messages from the phone store.
-
-The first entry ID in aSelection must be the SMS service ID. All following 
-entry IDs in the selection must then represent each message to be deleted. 
-aParameter is not used.
-
-The command ESmsMtmCommandEnumeratePhoneStores must be called before using 
-this command. 
-
-Pre v7.0, this was named ESmsMtmCommandDeleteFromSim.
-
-@see	TSmsMtmCommand::ESmsMtmCommandEnumeratePhoneStores
-*/
-	ESmsMtmCommandDeleteFromPhoneStore,  
-
-/**
-Reads the SIM parameters.
-
-This should not be used in the CSmsClientMtm::InvokeAsyncFunctionL function. The
-CSmsClientMtm::ReadSimParamsL function should be used to read the SIM parameters.
-
-@see	CSmsClientMtm::ReadSimParamsL
-
-@publishedAll 
-*/
-	ESmsMtmCommandReadSimParams,
-
-/**
-Writes the specified SIM parameters.
-
-This should not be used in the CSmsClientMtm::InvokeAsyncFunctionL function. The
-CSmsClientMtm::WriteSimParamsL function should be used to write the SIM parameters.
-
-@see	CSmsClientMtm::WriteSimParamsL
-
-@publishedAll 
-*/
-	ESmsMtmCommandWriteSimParams,
-
-/**
-Copies the SMS messages identified in aSelection to the phone store.
-
-The first entry ID in aSelection must be the SMS service ID. All following 
-entry IDs in the selection must then represent each message to be copied.
-Single message with multiple recipients is copied onto SIM as multiple messages,
-one message for each recipient.Copy/Move from SIM will result in multiple messages,
-single message will not be reformed out of the multiple messages on SIM.
-
-
-Pre v7.0, this was named ESmsMtmCommandCopyToSim.
-*/
-	ESmsMtmCommandCopyToPhoneStore,  
-
-/**
-Moves the SMS messages identified in aSelection to the phone store.
-
-The first entry ID in aSelection must be the SMS service ID. All following 
-entry IDs in the selection must then represent each message to be moved.
-SSingle message with multiple recipients is moved onto SIM as multiple messages,
-one message for each recipient.Copy/Move from SIM will result in multiple messages,
-single message will not be reformed out of the multiple messages on SIM.
-
-
-Pre v7.0, this was named ESmsMtmCommandMoveToSim.
-*/
-	ESmsMtmCommandMoveToPhoneStore
-	};
-
-#endif	// __SMSCMDS_H__
--- a/messagingappbase/smsmtm/clientmtm/inc/smut.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +0,0 @@
-// Copyright (c) 1999-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:
-// smut.h 
-//
-#ifndef __SMUT_H__
-#define __SMUT_H__
-
-#include <msvstd.h>
-#include <msvids.h>
-#include <barsc.h>
-
-class CSmsMessage;
-class CContactItemField;
-class TResourceReader;
-class CMsvSession;
-class CMsvServerEntry;
-class CMsvEntry;
-class CSmsSettings;
-
-/**
-The SMS MTM UID.
-
-Used to identify the MTMs used for handling SMS messages.
-
-@publishedAll
-@released
-*/
-const TUid KUidMsgTypeSMS			= {0x1000102C};
-
-/**
-The default maximum length used when extracting a description for an SMS message.
-
-Used as default value of aMaxLength in TSmsUtilities::GetDescription. This
-function is used to extract a string to used as a suitable description field in
-the message index for a particular SMS message.
-
-The CSmsSettings provides accessors to get and set the preferred maximum
-description length.
-
-@deprecated
-This should not really be used outside of the SMS client MTM. The value provided
-by the CSmsSettings class should be used.
-
-@see	CSmsSettings::GetDescriptionLength
-*/
-const TInt KSmsDescriptionLength	= 32;
-
-/**
-The default maximum length used when extracting the sender/recipiant details for
-an SMS message.
-
-Used as default value of aMaxLength in TSmsUtilities::GetDetails. This function
-is used to extract a string to used as the details field in the message index
-for a particular SMS message.
-
-@deprecated
-This should really be used at all.
-*/
-const TInt KSmsDetailsLength		= 32;
-
-_LIT(KSmsResourceFile, "\\resource\\messaging\\SMSS.RSC");
-
-/**
-SMS Messaging utility functions.
-
-@publishedAll
-@released
-*/
-class TSmsUtilities
-	{
-public:
-
-/**
-Special SMS Message Indication Type.
-
-A special SMS message indication is used to notify of waiting services, for
-instance a voicemail message.
-
-The TSmsUtilitiesSpecialMessageType enum represents the flags for the known
-indication types.
-*/
-	enum TSmsUtilitiesSpecialMessageType
-		{
-/**
-Voice message waiting.
-*/
-		EVoiceMessageWaiting = 0,
-/**
-Fax message waiting.
-*/
-		EFaxMessageWaiting,
-/**
-E-mail message waiting.
-*/
-		EEmailMessageWaiting,
-/**
-Other message-type waiting (see 3GPP TS 23.038 [9] for definition of "other").
-*/
-		EOtherMessageWaiting,
-/**
-Mask used to obtain the mesasge indication type from the SMS data.
-*/
-		ESpecialMessageTypeMask = 0x7F
-		};
-
-	IMPORT_C static void ServiceIdL(CMsvServerEntry& aEntry, TMsvId& aFirstId, TUid aMtm = KUidMsgTypeSMS, CMsvEntrySelection* aServiceIds = NULL);
-	IMPORT_C static void ServiceIdL(CMsvEntry& aEntry, TMsvId& aFirstId, TUid aMtm = KUidMsgTypeSMS, CMsvEntrySelection* aServiceIds = NULL);
-	IMPORT_C static void ServiceIdL(CMsvSession& aSession, TMsvId& aFirstId, TUid aMtm = KUidMsgTypeSMS, CMsvEntrySelection* aServiceIds = NULL); //more efficient version of the previous one
-
-	IMPORT_C static void PopulateMsgEntry(TMsvEntry& aEntry, const CSmsMessage& aMessage, TMsvId aServiceId, TUid aMtm = KUidMsgTypeSMS);
-	IMPORT_C static void PopulateMsgEntry(TMsvEntry& aEntry, const CSmsMessage& aMessage, TMsvId aServiceId, const CSmsSettings& aSettings, TUid aMtm = KUidMsgTypeSMS);
-
-	IMPORT_C static TInt GetDetails(RFs& aFs, const CSmsMessage& aMessage, TDes& aDetails, TInt aMaxLength = KSmsDetailsLength);
-	IMPORT_C static TInt GetDetails(RFs& aFs, const TDesC& aFromAddress, TDes& aDetails, TInt aMaxLength = KSmsDetailsLength);
-	IMPORT_C static TInt GetDescription(const CSmsMessage& aMessage, TDes& aDescription, TInt aMaxLength = KSmsDescriptionLength);
-
-	IMPORT_C static RResourceFile OpenResourceFileL(RFs& aFs);
-	IMPORT_C static void ReadResourceStringL(RResourceFile aResourceFile, TInt aResourceId, TDes& aString);
-
-private:
-	static void CompareEntryL(const TMsvEntry& aEntry, TUid aMtm, TMsvId& aFirstId, CMsvEntrySelection* aServiceIds);
-	static void GetName(CContactItemField& aField, TUid aFieldType, TDes& aName);
-	static void DoGetDetailsL(RFs& aFs, const TDesC& aFromAddress, TDes& aDetails, TInt aMaxLength);
-	static void Replace(const TDesC& aOld, const TDesC& aNew, TDes& aString);
-
-	static TBool DoGetDescriptionL(const CSmsMessage& aMessage, TDes& aDescription, TInt aMaxLength);
-	static void ExtractDescriptionFromMessage(const CSmsMessage& aMessage, TDes& aDescription, TInt aMaxLength);
-
-	static TBool ValidGsmNumber(const TDesC& aTelephone);
-	};
-
-#endif	// __SMUT_H__
--- a/messagingappbase/smsmtm/clientmtm/inc/smutsimparam.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +0,0 @@
-// Copyright (c) 1999-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:
-// smutsimparam.h
-//
-/**
- * @file 
- * @publishedAll
- * @released
- */
-#ifndef __SMUTSIMPARAM_H__
-#define __SMUTSIMPARAM_H__
-
-#include <msvapi.h>
-#include <smcmmain.h>
-
-class CMobilePhoneSmspList;
-class TSmsProgress;
-
-/**
-A packaged TInt value.
-
-This is used by CSmsSimParamOperation.
-
-@see CSmsSimParamOperation::ProgressL()
-
-@publishedAll
-@released
-*/
-typedef TPckgBuf<TInt> TIntBuf;
-
-/**
-Encapsulates an operation to read/write an array of SMS parameters from a SIM.
-
-An operation of this type if returned by the SMS client MTM for the read and
-write SIM parameter operations.
-
-These operations are generated from calling the SMS client MTM APIs 
-CSmsClientMtm::ReadSimParamsL and CSmsClientMtm::WriteSimParamsL. The 
-CSmsClientMtm::InvokeAsyncFunctionL API should not be used for these operations.
-
-@see	CSmsClientMtm::ReadSimParamsL
-@see	CSmsClientMtm::WriteSimParamsL
-
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS (CSmsSimParamOperation) : public CMsvOperation
-	{
-public:
-
-	static CSmsSimParamOperation* ReadSimParamsL(TUid aMtm, TMsvId aService, CMsvSession& aMsvSession, TRequestStatus& aObserverRequestStatus);
-	static CSmsSimParamOperation* WriteSimParamsL(const CMobilePhoneSmspList& aList, TUid aMtm, TMsvId aService, CMsvSession& aMsvSession, TRequestStatus& aObserverRequestStatus);
-	virtual ~CSmsSimParamOperation();
-
-	inline const CMobilePhoneSmspList& SmspList() const;
-
-	IMPORT_C CMobilePhoneSmspList* ServiceCentersLC() const;
-	IMPORT_C const TDesC8& ProgressL();
-
-	IMPORT_C static void RestoreSimParamsL(CMsvStore& aStore, CMobilePhoneSmspList& aList);
-	IMPORT_C static void StoreSimParamsL(CMsvStore& aStore, const CMobilePhoneSmspList& aList);
-
-private:	// methods from CActive
-
-	virtual void RunL();
-	virtual void DoCancel();
-	virtual TInt RunError(TInt aError);
-
-private:
-
-	CSmsSimParamOperation(TUid aMtm, TMsvId aService, CMsvSession& aMsvSession, TRequestStatus& aObserverRequestStatus);
-
-	void DoReadSimParamsL();
-	void DoRunReadSimParamsL(/*TSmsProgress aProgress*/);
-	void DoWriteSimParamsL(const CMobilePhoneSmspList& aList);
-
-	void TransferCommandL(TInt aCommandId);
-	void Complete();
-
-private:
-
-/**
-This defines the state machine.
-*/
-	enum TReadSimParamsState
-		{
-/**
-Specifies waiting state
-*/
-		EStateWaiting,
-/**
-Specifies reading state
-*/
-		EStateReadingSimParams,	 
-/**
-Specifies writing state
-*/
-		EStateWritingSimParams
-		} iState;
-
-/**
-A list containing the SMS parameters
-*/
-	CMobilePhoneSmspList* iSimParams;	
-	TInt iError;
-	TIntBuf iProgressBuf;
-	CMsvOperation* iOperation;
-	};
-
-/**
-Gets the list of SMS parameters on the SIM, after a successfully completed 
-read operation.
-
-If the operation has not successfully completed, this function returns an 
-empty list.
-
-This function should ot be used with a write SIM parameters operation.
-
-@return
-The list of SMS parameters read from the SIM.
-
-@panic	SMCM	3
-This operation was not reading the SIM parameters. The operation was not returned
-from CSmsClientMtm::ReadSimParamsL (debug only).
-*/
-inline const CMobilePhoneSmspList& CSmsSimParamOperation::SmspList() const
-	{
-	__ASSERT_DEBUG(iState == EStateReadingSimParams, Panic(ESmscPanicUnexpectedCommand));
-	return *iSimParams;
-	}
-
-#endif // __SMUTSIMPARAM_H__
--- a/messagingappbase/smsmtm/clientmtm/inc/tmsvsmsentry.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,166 +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:
-// tmsvsmsentry.h
-//
-/**
- * @file 
- * @publishedPartner
- * @released
- */
-
-#ifndef __TMSVSMSENTRY_H__
-#define __TMSVSMSENTRY_H__
-
-#include <gsmuelem.h>
-
-/**
-A specialisation of the message server index class for SMS message entries.
-
-It provides accessers for SMS message specific data, for instance the class type
-of the SMS message.
-
-@publishedPartner
-@released
-*/
-class TMsvSmsEntry : public TMsvEntry
-	{
-public:
-
-/**
-Defines a set flags used to access message entry data specific to an SMS message.
-
-@publishedPartner
-@released
-
-*/
-	enum TMsvSmsEntryFlags
-		{
-/**
-Clears the entire set of SMS flags.
-*/
-		EMsvSmsEntryClearFlag				= 0x00000000,
-/**
-Mask for the protocol identifier data.
-*/
-		EMsvSmsEntryProtocolIdentifier		= 0x000000FF,
-/**
-Mask for the User Prompt Indicator flag.
-*/
-		EMsvSmsEntryUserPromptIndicator 	= 0x00000100,
-/**
-Mask for the SMS class data.
-*/
-		EMsvSmsEntryClass					= 0x00000E00,
-/**
-Mask for the flag indicating whether the class data has been defined.
-*/
-		EMsvSmsEntryClassDefined			= 0x00001000,
-/**
-Mask for the flag indicating whether the message ID is valid. 
-*/
-		EMsvSmsMessageValid					= 0x00002000,
-/**
-Mask for the delivery acknowledgement information.
-*/
-		EMsvSmsEntryDeliveryAckSummary		= 0x0001C000,
-/**
-Parameter defining the number of bits to be shifted in order for the SMS class
-data to be at the LSB of the data block.
-*/
-		EMsvSmsEntryClassShift				= 9,
-/**
-Parameter defining the number of bits to be shifted in order for the delivery
-acknowlwdgement information to be at the LSB of the data block.
-*/
-		EMsvSmsEntryDeliveryAckSummaryShift	= 14
-		};
-
-/**
-Defines the summary acknowledgement information.
-
-This information indicates whether the SMS message is not supplying a summary 
-for an acknowledgement, is still expecting acknowledgments or it has received 
-all expected acknowledgements.
-
-If all acknowledgements have been received the summary indicates whether all 
-the recipients have successfully acknowledged the message, all failed or there
-was a mixture of successful and failed acknowledgements from the recipients. 
-*/
-	enum TMsvSmsEntryAckSummary
-		{
-/**
-No summary information is being formed.
-*/
-		ENoAckSummary			= 0,
-/**
-The message is waiting for acknowledgements to be received for all recipients
-of this message. Some recipients may have received their acknowledgements but
-there are still some recipients that have not.
-*/
-		EPendingAcks,
-/**
-The summary indicates that the message was successfully acknowledged by all recipients.
-*/
-		EAllSuccessful,
-/**
-The summary indicates that the message failed to be acknowledged by all recipients.
-*/
-		EAllFailed,
-/**
-The summary indicates a mixture of successful and failed acknowledgements from 
-the recipients of the message. All recipients of this message have received 
-their acknowledgements.
-*/
-		EMixed
-		};
-
-public:
-	inline TMsvSmsEntry();
-	inline TMsvSmsEntry(const TMsvEntry& aEntry);
-
-	inline void SetUserPromptIndicator(TBool aUPI);
-	inline TBool UserPromptIndicator() const;
-
-	inline TUint8 ProtocolIdentifier() const;
-	inline void SetProtocolIdentifier(TSmsProtocolIdentifier aPID);
-	inline void SetProtocolIdentifier(TUint8 aPID);
-
-	inline TBool Class(TSmsDataCodingScheme::TSmsClass& aClass) const;
-	inline void SetClass(TBool aClassDefined,TSmsDataCodingScheme::TSmsClass aClass = TSmsDataCodingScheme::ESmsClass0);
-
-	IMPORT_C TMsvSmsEntryAckSummary AckSummary(TSmsAckType aAckType) const;
-	IMPORT_C void SetAckSummary(TSmsAckType aAckType, TMsvSmsEntryAckSummary aAckSummary);
-
-	IMPORT_C TBool MessageId(TInt32& aMessageId) const;
-	IMPORT_C void SetMessageId(TInt32 aMessageId, TBool aIsValid);
-	};
-
-/**
-The UID that indentifies the SMS message editor application.
-
-This is the response to the query for the KUidMsvMtmQueryEditorUidValue
-capability.
-
-@see	CSmsClientMtm::QueryCapability
-
-@publishedPartner
-@released
-*/
-const TInt KUidMsgSmsEditorAppVal=0x1000163f;
-
-
-
-#include <tmsvsmsentry.inl>
-
-#endif //__TMSVSMSENTRY_H__
--- a/messagingappbase/smsmtm/clientmtm/inc/tmsvsmsentry.inl	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +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:
-// tmsvsmsentry.inl
-//
-
-#include <smcmmain.h>
-#include <gsmumsg.h>
-
-/*
- *	TMsvSmsEntry
- */
-
-/**
-Constructor.
-
-@internalTechnology
-@released
-*/
-inline TMsvSmsEntry::TMsvSmsEntry()
-	{
-	}
-
-/**
-Copy constuctor.
-
-@param	aEntry
-The index entry to copy.
-
-@internalTechnology
-@released
-*/
-inline TMsvSmsEntry::TMsvSmsEntry(const TMsvEntry& aEntry)  
-: TMsvEntry(aEntry)
-	{
-	}
-
-/**
-Sets the User Prompt Indicator flag.
-
-@param	aUPI
-A value of True to set the flag.
-
-@internalTechnology
-@released
-*/
-inline void TMsvSmsEntry::SetUserPromptIndicator(TBool aUPI)
-	{
-	(aUPI) ? (iMtmData2 |= EMsvSmsEntryUserPromptIndicator) : (iMtmData2 &= ~EMsvSmsEntryUserPromptIndicator);
-	}
-
-/**
-Gets the User Prompt Indicator flag.
-
-@return
-A value of True if the User Prompt Indicator flag is.
-
-@internalTechnology
-@released
-*/
-inline TBool TMsvSmsEntry::UserPromptIndicator() const
-	{
-	return (iMtmData2 & EMsvSmsEntryUserPromptIndicator);
-	}
-
-/**
-Gets the Protocol Identifier data.
-
-@return
-The Protocol Identifier data.
-
-@internalTechnology
-@released
-*/
-inline TUint8 TMsvSmsEntry::ProtocolIdentifier() const
-	{
-	return STATIC_CAST(TUint8, iMtmData2 & EMsvSmsEntryProtocolIdentifier);
-	}
-
-/**
-Sets the Protocol Identifier data.
-
-@param	aPID
-The Protocol Identifier data.
-
-@internalTechnology
-@released
-*/
-inline void TMsvSmsEntry::SetProtocolIdentifier(TSmsProtocolIdentifier aPID)
-	{
-	SetProtocolIdentifier(STATIC_CAST(TUint8, aPID));
-	}
-
-/**
-Sets the Protocol Identifier data.
-
-@param	aPID
-The Protocol Identifier data.
-
-@internalTechnology
-@released
-*/
-inline void TMsvSmsEntry::SetProtocolIdentifier(TUint8 aPID)
-	{
-	iMtmData2 = (iMtmData2 & ~EMsvSmsEntryProtocolIdentifier) | (aPID & EMsvSmsEntryProtocolIdentifier);
-	}
-
-/**
-Sets the SMS class data and defined flag.
-
-@param	aClassDefined
-A value of True to set the SMS class data defined flag.
-
-@param	aClass
-The SMS class data.
-
-@internalTechnology
-@released
-*/
-inline void TMsvSmsEntry::SetClass(TBool aClassDefined, TSmsDataCodingScheme::TSmsClass aClass)
-	{
-	aClassDefined ? (iMtmData2 |= EMsvSmsEntryClassDefined) : (iMtmData2 &= ~EMsvSmsEntryClassDefined);
-	iMtmData2 = (iMtmData2 & ~EMsvSmsEntryClass) | ((aClass << EMsvSmsEntryClassShift) & EMsvSmsEntryClass);
-	}
-
-/**
-Gets the SMS class data and defined flag.
-
-@param	aClass
-An output argument with the SMS class data.
-
-@return
-A value of True if the SMS class data defined flag is set.
-
-@internalTechnology
-@released
-*/
-inline TBool TMsvSmsEntry::Class(TSmsDataCodingScheme::TSmsClass& aClass) const
-	{
-	aClass = STATIC_CAST(TSmsDataCodingScheme::TSmsClass, ((iMtmData2 & EMsvSmsEntryClass) >> EMsvSmsEntryClassShift));
-	return iMtmData2 & EMsvSmsEntryClassDefined;
-	}
-
-
--- a/messagingappbase/smsmtm/clientmtm/src/SMCMMAIN.CPP	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-// Copyright (c) 1999-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 <e32std.h>
-#include "SMCMMAIN.H"
-
--- a/messagingappbase/smsmtm/clientmtm/src/SMSCLNT.CPP	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1729 +0,0 @@
-// Copyright (c) 1999-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:
-// SMSCLNT.CPP
-//
-
-#include <txtrich.h>	// CRichText
-
-#include <msvuids.h>	// KUidMsvRootEntry etc.
-#include <mtmdef.hrh>	// KUidMtmQuerySupports etc.
-#include <mtmdef.h>		// KMsvMessagePartRecipient	etc.
-#include <msvids.h>		// KMsvGlobalOutBoxIndexEntryId etc.
-#include <msvftext.h>	// CMsvFindText
-#include <biodb.h>		// CBIODatabase
-#include <SMSS.rsg>
-#include <barsc.h>
-#include <barsread.h>
-
-#include "SMSCLNT.H"	// smsclntmtm
-#include "SMCMMAIN.H"	// panics
-#include "smscmds.h"	// ESmsMtmCommandReadServiceCenter etc.
-#include "smut.h"		// TSmsUtilities
-#include "SMUTHDR.H"	// CSmsHeader
-#include "SMUTSET.H"	// CSmsSettings
-#include <smutsimparam.h>
-#include <csmsemailfields.h>
-#include <csmsaccount.h>
-#include "csmssendmessageoperation.h"
-
-#include <msvenhancesearchsortutil.h>
-
-#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS  
-#include "msvconsts.h"
-#include <mtmuidsdef.hrh>
-#include <tmsvsmsentry.h>
-#endif
-
-
-
-/**
-The maximum number of SMS PDUs allowed in a concatenated SMS message.
-Together with KSmcmMaxCharsInMessageConcatenated7Bit, this is the response to
-the query for the KUidMtmQueryMaxTotalMsgSizeValue capability.
-@see	CSmsClientMtm::QueryCapability
-@see	KSmcmMaxCharsInMessageConcatenated7Bit
-*/
-const TInt KSmcmMaxMessageNumber=0x32;
-
-/**
-The maximum number of characters in a concatenated SMS PDU.
-Together with KSmcmMaxMessageNumber, this is the response to the query for the
-KUidMtmQueryMaxTotalMsgSizeValue capability.
-@see	CSmsClientMtm::QueryCapability
-@see	KSmcmMaxCharsInMessageConcatenated7Bit
-*/
-const TInt KSmcmMaxCharsInMessageConcatenated7Bit=0x99;
-
-/**
-The maximum number of characters in a non-concatenated SMS PDU.
-This is the response to the query for the KUidMtmQueryMaxBodySizeValue
-capability.
-@see	CSmsClientMtm::QueryCapability
-*/
-const TInt KSmcmMaxTotalMsgSize=160;
-
-/**
-The granularity of the in-memory buffer for CRichText objects.
-@see	CRichText::NewL
-*/
-const TInt KSmcmRichTextConstant=256;
-
-
-// These default subject formats are used if the resource field has not been
-// migrated to include a localised set of subject formats.
-_LIT(KSmsDefaultForwardSubjectFormat,	"Fw: %S");
-_LIT(KSmsDefaultReplySubjectFormat,		"Re: %S");
-
-/**
-Static factory constuctor.
-
-@param	aRegisteredMtmDll
-The registry information for the SMS MTM.
-
-@param	aSession
-The message server session
-
-@leave KErrArgument
-Invalid data read from the SMS resource file
-
-@internalTechnology
-
-@see	CRegisteredMtmDll
-*/
-EXPORT_C CSmsClientMtm* CSmsClientMtm::NewL(CRegisteredMtmDll& aRegisteredMtmDll,CMsvSession& aSession)
-	{
-	CSmsClientMtm* self=new(ELeave) CSmsClientMtm(aRegisteredMtmDll,aSession);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-/**
-Destructor.
-*/
-CSmsClientMtm::~CSmsClientMtm()
-	{
-	delete iServiceSettings;
-	delete iSmsHeader;
-	delete iEmailForwardSubjectFormat;
-	delete iEmailReplySubjectFormat;
-	}
-
-void CSmsClientMtm::HandleEntryEvent(enum MMsvEntryObserver::TMsvEntryEvent /*aEvent*/,TAny* ,TAny* ,TAny* )
-	{
-	}
-
-/**
-Reads SMS parameters from the SIM.
-
-It starts a new CSmsSimParamOperation, which uses the SMS Server MTM to read the 
-SMS parameters from the SIM. 
-
-If the phone is unable to supply the SMS parameters from the SIM, then the progress
-information of the CSmsSimParamOperation operation will contain an error. 
-
-@param	aObserverRequestStatus
-The request status to be completed when the read operation has completed.
-
-@return
-A SIM parameter reader operation. The read SIM parameters are stored in
-CSmsSimParamOperation::iSimParams. 
-*/
-EXPORT_C CSmsSimParamOperation* CSmsClientMtm::ReadSimParamsL(TRequestStatus& aObserverRequestStatus)
-	{
-	RestoreServiceAndSettingsL();
-
-	CMsvEntry* entry = Session().GetEntryL(iServiceId);
-	CleanupStack::PushL(entry);
-
-	CSmsSimParamOperation* op = CSmsSimParamOperation::ReadSimParamsL(entry->Entry().iMtm, iServiceId, Session(), aObserverRequestStatus);
-
-	CleanupStack::PopAndDestroy(entry);
-	return op;
-	}
-
-/**
-Writes SMS parameters to the SIM.
-
-It starts a new CSmsSimParamOperation, which uses the SMS Server to write the 
-specified SIM parameters to the SIM.
-
-If the phone is unable to write the SMS parameters to the SIM, then the progress
-information of the CSmsSimParamOperation operation will contain an error.
-
-@param	aList
-The SIM parameters to be written.
-
-@param	aObserverRequestStatus
-The request status to be completed when the write operation has completed.
-
-@return
-A SIM parameter writer operation.
-*/
-EXPORT_C CSmsSimParamOperation* CSmsClientMtm::WriteSimParamsL(const CMobilePhoneSmspList& aList, TRequestStatus& aObserverRequestStatus)
-	{
-	RestoreServiceAndSettingsL();
-
-	CMsvEntry* entry = Session().GetEntryL(iServiceId);
-	CleanupStack::PushL(entry);
-
-	CSmsSimParamOperation* op = CSmsSimParamOperation::WriteSimParamsL(aList, entry->Entry().iMtm, iServiceId, Session(), aObserverRequestStatus);
-
-	CleanupStack::PopAndDestroy(entry);
-
-	return op;
-	}
-
-/**
-Restores the SMS service ID and SMS service settings.
-
-The SMS service ID is obtained. The service settings for the obtained ID are 
-restored from the message server. The SMS service ID can be obtained using the
-CSmsClientMtm::ServiceId API and the SMS settings are accessed via the two
-CSmsClientMtm::ServiceSettings API overloads.
-
-This API should be used before using any of the other APIs that required the SMS
-service ID and SMS service settings to be set.
-
-@see	CSmsClientMtm::ServiceId
-@see	CSmsClientMtm::ServiceSettings
-*/
-EXPORT_C void CSmsClientMtm::RestoreServiceAndSettingsL()
-	{
-	if (iServiceSettings == NULL)
-		{
-		iServiceSettings = CSmsSettings::NewL();
-		}
-
-	// Let's find the right service entry!
-	TSmsUtilities::ServiceIdL(Session(), iServiceId, KUidMsgTypeSMS);
-
-	CSmsAccount* account = CSmsAccount::NewLC();
-	// just v2
-	account->LoadSettingsL(*iServiceSettings);
-	CleanupStack::PopAndDestroy(account);    
-	}
-
-
-CSmsClientMtm::CSmsClientMtm(CRegisteredMtmDll& aRegisteredMtmDll,CMsvSession& aSession)
-: CBaseMtm(aRegisteredMtmDll,aSession)
-	{
-	}
-
-void CSmsClientMtm::ConstructL()
-	{
-	SwitchCurrentEntryL(KMsvRootIndexEntryId);  //  Creates rich text
-	
-	RFs& fileSession = Session().FileSession();
-
-	iSmsHeader=CSmsHeader::NewL(CSmsPDU::ESmsSubmit,Body(),fileSession);
-
-	TRAPD(err, RestoreServiceAndSettingsL());
-
-	if (err)
-		{
-		if (err != KErrNotFound)
-			{
-			User::Leave(err);
-			}
-
-		TMsvEntry entry;
-		entry.iMtm = KUidMsgTypeSMS;
-		entry.iType = KUidMsvServiceEntry;
-		entry.SetReadOnly(EFalse);
-		entry.SetVisible(EFalse);
-		entry.iDate.UniversalTime();
-		entry.iDetails.Set(_L("Default SMS Message"));
-    
-		CMsvEntry* root = Session().GetEntryL(KMsvRootIndexEntryId);
-		root->CreateL(entry);
-		iServiceId = entry.Id();
-		delete root;
-		}
-
-	//Initialise iRealAddressOpen and iRealAddressClose from the SMS resouce file
-	RResourceFile resFile = TSmsUtilities::OpenResourceFileL(fileSession);
-	CleanupClosePushL(resFile);
-	TBuf<4> buf;
-	TSmsUtilities::ReadResourceStringL(resFile, R_ADDRESSEE_TELEPHONE_OPEN, buf);
-	if (buf.Length() > 0)
-		{
-		iRealAddressOpen = buf[0];
-		}
-	else
-		{
-		User::Leave(KErrArgument); 
-		}
-	
-	TSmsUtilities::ReadResourceStringL(resFile, R_ADDRESSEE_TELEPHONE_CLOSE, buf);
-	if (buf.Length() > 0)
-		{
-		iRealAddressClose = buf[0];
-		}
-	else
-		{
-		User::Leave(KErrArgument); 
-		}
-	iEmailForwardSubjectFormat	= ReadEmailSubjectFormatL(resFile, R_SMS_EMAIL_FORWARD_SUBJECT_FORMAT, KSmsDefaultForwardSubjectFormat);
-	iEmailReplySubjectFormat	= ReadEmailSubjectFormatL(resFile, R_SMS_EMAIL_REPLY_SUBJECT_FORMAT, KSmsDefaultReplySubjectFormat);
-
-	CleanupStack::PopAndDestroy(&resFile);
-	}
-	
-HBufC* CSmsClientMtm::ReadEmailSubjectFormatL(RResourceFile& aResourceFile, TInt aResourceId, const TDesC& aDefaultFormat)
-	{
-	HBufC* format = NULL;
-	if( aResourceFile.OwnsResourceId(aResourceId) )
-		{
-		HBufC8* buf = aResourceFile.AllocReadLC(aResourceId);
-		TResourceReader reader;
-		reader.SetBuffer(buf);
-		format = (reader.ReadTPtrC()).AllocL();
-		CleanupStack::PopAndDestroy(buf);	
-		}
-	else
-		{
-		format = aDefaultFormat.AllocL();
-		}
-	return format;
-	}
-
-CMsvOperation* CSmsClientMtm::CreateNewEntryL(TMsvEntry& aNewEntry, TMsvId aDestination,CSmsHeader& aSmsHeader,const CRichText& aBody,TRequestStatus& aCompletionStatus)
-	{
-	RestoreServiceAndSettingsL();
-
-	CMsvEntry* cEntry = CMsvEntry::NewL(Session(), aDestination, TMsvSelectionOrdering());
-	CleanupStack::PushL(cEntry);
-
-	cEntry->CreateL(aNewEntry);
-
-	const TMsvId msvid = aNewEntry.Id();
-	Session().CleanupEntryPushL(msvid);
-
-	// switch context to the new entry
-	cEntry->SetEntryL(msvid);
-	aNewEntry = cEntry->Entry(); //for the description and details fields
-
-	aSmsHeader.SetSmsSettingsL(*iServiceSettings);
-
-	// service centre was not being set 
-	//If we haven't been provided with a service centre address then use the default one
-	if(!aSmsHeader.ReplyPathProvided())
-		{
-		TInt defaultSC = iServiceSettings->DefaultServiceCenter();
-		if(defaultSC > -1)
-			{
-			aSmsHeader.SetServiceCenterAddressL( iServiceSettings->GetServiceCenter(defaultSC).Address() );	
-			}
-		}
-
-	// Check the context header to see an email message...
-	if( iSmsHeader->EmailFields().Length() > 0 )
-		{
-		// Yep - update the message as follows
-		// 1. Add the email <-> SMS gateway as the recipient of the new message.
-		// 2. Set the PID for interworking with email.
-		// 3. Set the entry description to be the email subject (if there is one).
-		// 4. Set the entry details to be the email address (if there is one).
-		DoAddRecipientL(&aSmsHeader, iSmsHeader->FromAddress(), KNullDesC);
-
-		CSmsPDU& pdu = aSmsHeader.Message().SmsPDU();
-		if( pdu.ProtocolIdentifierPresent() )
-			{
-			pdu.SetPIDType(TSmsProtocolIdentifier::ESmsPIDTelematicInterworking);
-			pdu.SetTelematicDeviceIndicator(TSmsProtocolIdentifier::ESmsTelematicDevice);
-			pdu.SetTelematicDeviceType(TSmsProtocolIdentifier::ESmsInternetElectronicMail);
-			}
-		
-		const CSmsEmailFields& fields = aSmsHeader.EmailFields();
-		if( fields.Subject().Length() > 0 )
-			{
-			// There is a subject - use this as the description
-			aNewEntry.iDescription.Set(fields.Subject());
-			}
-		if( fields.HasAddress() )
-			{
-			// There is an address - use first address as the details.
-			aNewEntry.iDetails.Set(fields.Addresses().MdcaPoint(0));			
-			}
-		}
-
-
-	CMsvStore* msvstore=cEntry->EditStoreL();
-	CleanupStack::PushL(msvstore);
-
-	aSmsHeader.StoreL(*msvstore);
-	msvstore->StoreBodyTextL(aBody);
-	msvstore->CommitL();
-
-	aNewEntry.iSize = msvstore->SizeL();
-	cEntry->ChangeL(aNewEntry);
-
-	CleanupStack::PopAndDestroy(msvstore);
-
-
-	TPckg<TMsvId> prog(msvid);
-	CMsvOperation* op = CMsvCompletedOperation::NewL(Session(), KUidMsgTypeSMS, prog, aNewEntry.iServiceId, aCompletionStatus);
-
-	// Now safe to pop the entry off the message server cleanup stack, and any
-	// other remaining resources.
-	Session().CleanupEntryPop();
-	CleanupStack::PopAndDestroy(cEntry);
-
-	return op;
-	}
-
-TBool CSmsClientMtm::ValidRecipients() const
-	{
-	TInt numrecipients = iSmsHeader->Recipients().Count();
-	TBool valid=numrecipients;
-
-	while (numrecipients-- && valid)
-		valid=ValidNumber(iSmsHeader->Recipients()[numrecipients]->Address());
-
-	return valid;
-	}
-
-TBool CSmsClientMtm::ValidNumber(const TDesC& aNumber) const
-	{
-	TBool valid=EFalse;
-	for (TInt i=0; i<aNumber.Length() && !valid; i++)  //  valid if at least one number in string
-		valid=(aNumber[i]>='0') && (aNumber[i]<='9');
-	return valid;
-	}
-
-void CSmsClientMtm::DoAddAddresseeL(const TDesC& aRealAddress, const TDesC& aAlias)
-	{
-	if (aAlias.Length())
-		{
-		HBufC* buf=HBufC::NewLC(aAlias.Length()+aRealAddress.Length()+3);
-		TPtr ptr = buf->Des();
-		ptr.Copy(aAlias);
-		ptr.Append(_L(" "));
-		ptr.Append(iRealAddressOpen);
-		ptr.Append(aRealAddress);
-		ptr.Append(iRealAddressClose);
-		iAddresseeList->AppendL(ptr);
-		CleanupStack::PopAndDestroy(buf);
-		}
-	else
-		iAddresseeList->AppendL(aRealAddress);
-	}
-
-void CSmsClientMtm::AddRecipientL(const TDesC& aRealAddress, const TDesC& aAlias)
-	{
-	DoAddRecipientL(iSmsHeader, aRealAddress, aAlias);
-	}
-
-void CSmsClientMtm::DoAddRecipientL(CSmsHeader* aSmsHeader, const TDesC& aRealAddress, const TDesC& aAlias)
-	{
-	CSmsNumber* recipient=CSmsNumber::NewL();
-	CleanupStack::PushL(recipient);
-	if ( aRealAddress.Locate('@') != KErrNotFound )
-        {
-        CSmsEmailFields* emailFields = NULL;
-        if ( aSmsHeader->EmailFields().Length() > 0 )
-            {
-            emailFields = CSmsEmailFields::NewL( aSmsHeader->EmailFields() );
-            }
-        else
-            {
-            emailFields = CSmsEmailFields::NewL();
-            }
-        CleanupStack::PushL( emailFields );
-       
-		recipient->SetEmailAddressL(aRealAddress, emailFields, aAlias);
-       
-        // Clears the CSmsHeaders EmailFields for non Email addresses
-        aSmsHeader->SetEmailFieldsL( *emailFields );
-        CleanupStack::PopAndDestroy( emailFields );
-        }
-	else
-	    {
-	    recipient->SetAddressL(aRealAddress);
-	    if (aAlias.Length() > 0)
-	    	{	
-	        recipient->SetNameL(aAlias);
-	    	}
-	    }
-    aSmsHeader->Recipients().AppendL(recipient);
-    CleanupStack::Pop(recipient);
-	}
-
-void CSmsClientMtm::ResetHeader()
-	{
-	if (iSmsHeader)
-		iSmsHeader->Recipients().ResetAndDestroy();
-
-	if (iAddresseeList)
-		iAddresseeList->Reset();
-	}
-
-void CSmsClientMtm::FindInBodyL(const TDesC& aTextToFind, const TMsvPartList& aFoundList, TMsvPartList& aResult)
-	{
-	CMsvFindText* text=CMsvFindText::NewL();
-	CleanupStack::PushL(text);
-	if (text->FindRichTextL(aTextToFind,Body(),aFoundList))
-		aResult|=KMsvMessagePartBody;
-	CleanupStack::PopAndDestroy(text);
-	}
-
-void CSmsClientMtm::FindL(const TDesC& aTextToFind, const TMsvPartList aPartList, TMsvPartList& aFoundList)
-	{
-	
-	CMsvFindText* text=CMsvFindText::NewL();
-	CleanupStack::PushL(text);
-
-	// Enhance search and sort
-  	// The setting variables are accessed by getting an instance to TMsvEnhanceSearchSortUtil  class
-  	// This is accessed here by using GetExtensionData() defined in CBaseMtm which refers 
-  	// to iExtensionData member variable
- 	TMsvEnhanceSearchSortUtil* searchsortutil = (TMsvEnhanceSearchSortUtil*)(GetExtensionData());
-		
-	if(searchsortutil != NULL)
-		{
-		// For callees other than CMsvSearchsortOpOnHeaderBody class, searchsortutil pointer will be NULL	
-		
-		TInt index=0;
-		TBool foundinname = EFalse;
-		TBool foundinaddress = EFalse;
-
-		// Retrieve the search sort setting flags
-		TUint32 searchsortsetting=searchsortutil->GetSearchSortSetting();
-		
-		if(aPartList & KMsvMessagePartTo)
-			{
-			TInt count=iSmsHeader->Recipients().Count();
-			/* 
-			Search for the To field in the the SMS header
-			First it looks in the Senders name
-			if not found, it tries to find it in the senders numbers
-			*/
-			
-			for(TInt i=0;i<count;i++)
-				{
-				if ((text->FindTextL(aTextToFind,(iSmsHeader->Recipients()).operator[](i)->Name(),aPartList)))
-					{
-					aFoundList|=KMsvMessagePartTo;
-					foundinname = ETrue;
-					index = i;
-					}
-				if(!foundinname)
-					{
-					if ((text->FindTextL(aTextToFind,(iSmsHeader->Recipients()).operator[](i)->Address(),aPartList)))
-						{
-						aFoundList|=KMsvMessagePartTo;
-						foundinaddress = ETrue;
-						index = i;
-						}
-					}
-				}
-			}
-			// Search for the From field
-		else if(aPartList & KMsvMessagePartFrom)
-			{
-			if ((text->FindTextL(aTextToFind,iSmsHeader->FromAddress(),aPartList)) 
-		 	|| (text->FindTextL(aTextToFind,iMsvEntry->Entry().iDetails,aPartList)))
-				{
-				aFoundList|=KMsvMessagePartFrom;
-				}
-			}
-			// Search for the Subject
-		else if (aPartList & KMsvMessagePartSubject)
-			{
-			if (text->FindTextL(aTextToFind,iMsvEntry->Entry().iDescription,aPartList))
-				{
-				aFoundList|=KMsvMessagePartDescription;
-				}
-			}
-		/* Copy the sort data if sorting is specified.
-		 The operations being performed could be only be sort or it could be search and sort
-		 If the operation is search and sort than copy the sort data only if the
-		 search operation succeeded	*/
-					
-		if ((aPartList & EMessagePartSort ) || ((aPartList & EMessagePartSearchSort) && (aPartList & EMessagePartLastQueryOption) && aFoundList)) 
-			{
-			if (aPartList & EMessagePartToSort )
-   				{
-   				if(foundinname) // Copy the sort data form the senders name
-   					{
-   					TPtrC ptr((iSmsHeader->Recipients()).operator[](index)->Name());
-   					SetExtensionData(&ptr);
-   					}
-   				if(foundinaddress) // Copy data from senders Address
-   					{
-   					TPtrC ptr((iSmsHeader->Recipients()).operator[](index)->Address());	
-   					SetExtensionData(&ptr);
-   					}
-   				}
-			else if(aPartList & EMessagePartFromSort )
-   				{
-   				SetExtensionData((TAny*)(iSmsHeader->FromAddress().Ptr()));
-   				}
-   			else if(aPartList & EMessagePartSubjectSort )
-   				{
-   				SetExtensionData((TAny*)&iMsvEntry->Entry().iDescription);
-				}
-			else 
-   				// Fix for DEF124605. If a different sort field is specified than
-   				// sets setting flag to EMessagePartInvalidSortField
-   				{
-   				searchsortutil->SetSearchSortSetting(EMessagePartInvalidSortField);
-   				}
-			}
-		}
-	else
-		{
-	
-		// Implementation prior to PREQ1667
-		if (aPartList & KMsvMessagePartRecipient) 		
-			{
-			TInt count=iSmsHeader->Recipients().Count();
-	
-			for(TInt i=0;i<count;i++)
-				{
-				if ((text->FindTextL(aTextToFind,(iSmsHeader->Recipients()).operator[](i)->Name(),aPartList))
-			 	|| (text->FindTextL(aTextToFind,(iSmsHeader->Recipients()).operator[](i)->Address(),aPartList)))
-					{
-					aFoundList|=KMsvMessagePartRecipient;
-					}
-				}
-			}
-		else if(aPartList & KMsvMessagePartOriginator)
-			{
-			if((text->FindTextL(aTextToFind,iSmsHeader->FromAddress(),aPartList)) 
-			 || (text->FindTextL(aTextToFind,iMsvEntry->Entry().iDetails,aPartList)))
-				{
-				aFoundList|=KMsvMessagePartOriginator;
-				}
-			}
-		else if (aPartList & KMsvMessagePartDescription)
-			{
-			if (text->FindTextL(aTextToFind,iMsvEntry->Entry().iDescription,aPartList))
-				{
-				aFoundList|=KMsvMessagePartDescription;
-				}
-			}
-		}
-	CleanupStack::PopAndDestroy(text);
-	}
-
-
-TMsvPartList CSmsClientMtm::DoFindL(const TDesC& aTextToFind, TMsvPartList aPartList)
-	{
-	__ASSERT_DEBUG(iMsvEntry, Panic(ESmscEntryNotSet));
-
-	TMsvPartList retList = 0;
-
-	// Enhance search and sort
-  	// The setting variables are accessed by getting an instance to TMsvEnhanceSearchSortUtil  class
-  	// This is accessed here by using GetExtensionData() defined in CBaseMtm which refers 
-  	// to iExtensionData member variable
-	
- 	TMsvEnhanceSearchSortUtil* searchsortutil = (TMsvEnhanceSearchSortUtil*)(GetExtensionData());
-	
-	// For callees other than CMsvSearchsortOpOnHeaderBody class, searchsortutil pointer will be NULL	
-	if(searchsortutil !=NULL)
-		{
-		TUint32 searchsortsetting=searchsortutil->GetSearchSortSetting();
-		if ((aPartList & KMsvMessagePartBody) && !(searchsortsetting & EMessagePartBodyLoaded))
-			{
-			CMsvStore* msvstore=iMsvEntry->ReadStoreL();
-			CleanupStack::PushL(msvstore);
-			msvstore->RestoreBodyTextL(Body());			
-			FindInBodyL(aTextToFind,aPartList,retList); // Find in body	
-			CleanupStack::PopAndDestroy(msvstore);
-			
-			// The message body is loaded.Set the setting variable to specify that the body is loaded
-			// If the next search is also on body, than it wont be loaded next time around
-			
-			searchsortutil->SetSearchSortSetting(EMessagePartBodyLoaded); 
-			}
-		else if( (aPartList & KMsvMessagePartTo ) || (aPartList & KMsvMessagePartFrom ) || (aPartList & KMsvMessagePartSubject))
-			{
-			// Search for To, From and Subject
-			FindL(aTextToFind,aPartList,retList); // Find in header	
-			}
-		}
-	else
-		{
-		// Search implementation Prior to PREQ1667
-		if( (aPartList & KMsvMessagePartRecipient) || (aPartList & KMsvMessagePartOriginator) || (aPartList & KMsvMessagePartDescription))
-			{
-			FindL(aTextToFind,aPartList,retList); // Find in header	
-			}
-		else if(aPartList & KMsvMessagePartBody)
-			{
-			FindInBodyL(aTextToFind,aPartList,retList); // Find in body	
-			}
-
-		}
-	return retList;
-	}
-
-/*
-Used by ForwardL() and ReplyL() for initialising the contents of the new message
-*/
-void CSmsClientMtm::BasicReplyForwardEntry(TMsvEntry& aNewEntry) const
-	{
-	aNewEntry.iMtm = KUidMsgTypeSMS;
- 	// Fix for DEF000924: Need to be able to send/cancel an sms while another is being sent
- 	aNewEntry.iRelatedId = Entry().Entry().iServiceId;
- 	aNewEntry.iServiceId = KMsvLocalServiceIndexEntryId;
- 	// End of fix
- 	aNewEntry.iType = KUidMsvMessageEntry;
-	aNewEntry.iDate.UniversalTime();
-	}
-
-/*
- *	Methods from CBaseMtm
- */
-
-/** 
-Commits cached changes to the current message context to the message store.
-
-The current context must be set to a message entry with type KUidMsvServiceEntryValue,
-KUidMsvFolderEntryValue or KUidMsvMessageEntryValue. If the current context is
-not set, or is set to an entry with a type that is not supported by this function
-then a panic will occur.
-
-Both the SMS service ID and SMS service settings must have been set or a panic
-will occur. The CSmsClientMtm::RestoreServiceAndSettingsL API can restore both
-of these items.
-
-@panic	SMCM	1
-The current context has not been set (debug only).
-
-@panic	SMCM	4
-The type of the current context is not supported.
-
-@panic	SMCM	11
-The SMS Service settings have not been set (debug only).
-
-@panic	SMCM	12
-The ID for SMS Service has not been set (debug only).
-
-@see	CSmsClientMtm::RestoreServiceAndSettingsL
-*/
-void CSmsClientMtm::SaveMessageL()
-	{
-	__ASSERT_DEBUG(iMsvEntry,Panic(ESmscEntryNotSet));
-
-	CMsvStore* msvstore=iMsvEntry->EditStoreL();
-	CleanupStack::PushL(msvstore);
-	
-	TMsvEntry entry(iMsvEntry->Entry());
-	TBool entryChanged = EFalse;
-	
-	switch (iMsvEntry->Entry().iType.iUid)
-		{
-		case KUidMsvServiceEntryValue:
-			{
-			__ASSERT_DEBUG(iServiceSettings, Panic(ESmscSettingsNotSet));
-			__ASSERT_DEBUG(iServiceId, Panic(ESmscServiceIdNotSet));
-
-			CSmsAccount* account = CSmsAccount::NewLC();
-			//just v2
-			account->SaveSettingsL(*iServiceSettings);
-			CleanupStack::PopAndDestroy(account);    
-			break;
-			}
-		case KUidMsvFolderEntryValue:
-			{
-			break;
-			}
-		case KUidMsvMessageEntryValue:
-			{
-			// since CreateMessageL creates message as in preparation and non-visible, the SaveMessageL
-			// must now make it visible and not in preparation
-
-			// If iDetails is empty, set it to be the first recipient in the header
-			if ((0 >= entry.iDetails.Length()) && (iSmsHeader->Recipients().Count() > 0))
-				{
-				CSmsNumber* recipient = iSmsHeader->Recipients().At(0);
-				if(recipient->Name().Length() > 0)
-					entry.iDetails.Set(recipient->Name());
-				else
-					entry.iDetails.Set(recipient->Address());
-				}
-			
-			// If iDescription is empty, set it to be the first part of the body text
-			if(Body().DocumentLength()>0 && 0 >= entry.iDescription.Length())
-				{
-				entry.iDescription.Set(Body().Read(0,iServiceSettings->DescriptionLength()));	
-				}
-			entry.SetVisible(ETrue);
-			entry.SetInPreparation(EFalse);	
-			entry.SetMultipleRecipients(iSmsHeader->Recipients().Count() > 1);
-			entryChanged = ETrue;
-
-			iSmsHeader->StoreL(*msvstore);
-			StoreBodyL(*msvstore);
-			break;
-			}
-		default:
-			Panic(ESmscUnrecognizedEntryType);
-		}
-	msvstore->CommitL();
-
- 	// Set the iSize member of the TMsvEntry
- 	if (iMsvEntry->HasStoreL())
- 		{
- 		const TInt size = msvstore->SizeL();		
- 		if (entry.iSize != size)
- 			{
- 			entry.iSize = size; 			
- 			entryChanged = ETrue;
- 			}
- 		}
-
-	CleanupStack::PopAndDestroy(msvstore);
-
-	if ( entryChanged )
-		{
-		// The entry info has been updated - commit to the store.		
-		iMsvEntry->ChangeL(entry);
-		}
-	}
-
-/**
-Loads the cache with the message data for the current context.
-
-The current context must be set to a message entry with type KUidMsvServiceEntryValue,
-KUidMsvFolderEntryValue or KUidMsvMessageEntryValue. If the current context is
-not set, or is set to an entry with a type that is not supported by this function
-then a panic will occur.
-
-If the current context is of type KUidMsvServiceEntryValue then the SMS service
-settings are restore from the context. The SMS service settings can be accessed
-using the overloaded CSmsClientMtm::ServiceSettings APIs .
-
-If the current context is of type KUidMsvMessageEntryValue then the SMS message
-object is restore from the context. This can be accessed using the overloaded 
-CSmsClientMtm::SmsHeader APIs.
-
-If the current context is of type KUidMsvFolderEntryValue then this function 
-does nothing.
-
-@panic	SMCM	1
-The current context has not been set (debug only).
-
-@panic	SMCM	4
-The entry type of the current context was not recognised.
-
-@see	CSmsClientMtm::SmsHeader
-@see	CSmsClientMtm::ServiceSettings
-*/
-void CSmsClientMtm::LoadMessageL()
-	{
-	__ASSERT_DEBUG(iMsvEntry,Panic(ESmscEntryNotSet));
-
-	CMsvStore* msvstore=iMsvEntry->ReadStoreL();
-	CleanupStack::PushL(msvstore);
-	switch (iMsvEntry->Entry().iType.iUid)
-		{
-		case KUidMsvServiceEntryValue:
-			{
-			RestoreServiceAndSettingsL();
-			break;
-			}
-		case KUidMsvFolderEntryValue:
-			{
-			break;
-			}
-		case KUidMsvMessageEntryValue:
-			{
-			ResetHeader();
-			Body().Reset();
-			CSmsHeader* smsheader=CSmsHeader::NewL(CSmsPDU::ESmsSubmit,Body());
-			CleanupStack::PushL(smsheader);
-			
-			smsheader->RestoreL(*msvstore);
-			// the following part inserts the recipients from header also to the smsclient
-			// the recipients are restored inside the csmsheader already
-			if (smsheader->Type()==CSmsPDU::ESmsSubmit)
-				{
-				for (TInt i=0; i<smsheader->Recipients().Count(); ++i)
-					{
-					CSmsNumber* recipient=smsheader->Recipients()[i];
-					DoAddAddresseeL(recipient->Address(),recipient->Name());
-					}
-				}
-				
-		// Get a reference to TMsvEnhanceSearchSortUtil  instance set by CMsvSearchsortOpOnHeaderBody class
-		// If advanced search and sort is being performed than do not load the body here
-		// For API's other than CMsvSearchsortOpOnHeaderBody-> FindInHeaderBodyL(), a call to LoadMessageL()
-		// loads the body.
-	
-			TMsvEnhanceSearchSortUtil* searchsortutil = (TMsvEnhanceSearchSortUtil*)(GetExtensionData());
-			if ( searchsortutil == NULL )
-				{
-				msvstore->RestoreBodyTextL(Body()); // Restore Body text
-				}
-			CleanupStack::Pop(smsheader); 
-			delete iSmsHeader;
-			iSmsHeader=smsheader;
-			break;
-			}
-		default:
-			Panic(ESmscUnrecognizedEntryType);
-		}
-	CleanupStack::PopAndDestroy(msvstore);
-	}
-/** 
-Validates the current message context.
-
-The addresses for the message are checked to be well-formed SMS addresses.
-
-The current context must be set. If the current context is not set then a panic
-will occur.
-
-@param	aPartList
-Indicates the message parts for which the validation has been requested.
-
-@return
-If valid KErrNone is returned. If invalid, the invalid parts of the message are
-identified. The return error value is the bitmask of the TMsvPartList IDs for
-each invalid part
-
-@panic	SMCM	1
-The current context has not been set (debug only).
-
-@panic	SMCM	6
-The addressee list and recipient list do not match (debug only).
-*/
-TMsvPartList CSmsClientMtm::ValidateMessage(TMsvPartList aPartList)
-	{
-	__ASSERT_DEBUG(iMsvEntry, Panic(ESmscEntryNotSet));
-	__ASSERT_DEBUG(iSmsHeader->Recipients().Count()==iAddresseeList->Count(), Panic(ESmscRecpAddresseeMiscount));
-
-	TMsvPartList partlist=TMsvPartList(0);
-	if (aPartList&KMsvMessagePartRecipient)
-		if (!ValidRecipients())  
-			partlist|=KMsvMessagePartRecipient;
-
-	return partlist;
-	}
-
-/**
-Searches the specified message part(s) for the plain-text version of the text 
-to be found.
-
-@param	aTextToFind
-The plain-text version of the text to be found. 
-
-@param	aPartList
-Indicates the message parts which should be searched. 
-
-@return
-If the text was not found, or searching is unsupported, 0. If the text was found,
-a bitmask of the TMsvPartList IDs for each part in which the text was present.
-*/
-TMsvPartList CSmsClientMtm::Find(const TDesC& aTextToFind,TMsvPartList aPartList)
-	{
-	TMsvPartList retList = 0;
-	TRAP_IGNORE(retList = DoFindL(aTextToFind, aPartList));
-	return retList;
-	}
-
-/**
-Creates a new SMS message as a reply to the current message context.
-
-The SMS in the current context must be of type SMS-DELIVER, indicating a mobile
-terminated message.
-
-The current context must be set to a message entry with type KUidMsvMessageEntryValue.
-If the current context is not set, or is set to an entry not of type
-KUidMsvMessageEntryValuethen a panic will occur.
-
-The new SMS message has the recipient set to the sender of the message in the
-current context. It has a type SMS-SUBMIT, indicating a mobile originated meesage.
-If the SMS service settings CSmsSettings::ReplyQuoted is true then the reply
-message will contain the body of the original message, including any EMS elements.
-
-@param	aDestination
-The message entry (folder) under which to create the new message.
-
-@param	aPartList
-Ignored.
-
-@param	aCompletionStatus
-The request status to be completed when the operation has finished.
-
-@return
-An operation object. If the relpy email is successful created, the operation will
-complete with KErrNone. The operation's progress information is a TPckg<TMsvId>,
-containing the TMsvId of the new SMS message. If the reply message fails to be 
-created, the operation completes with the relevant error code.
-
-@leave	KErrNotSupported
-The current context does not have a PDU type of SMS-DELIVER.
-
-@panic	SMCM	1
-The current context has not been set (debug only).
-
-@panic	SMCM	2
-The current context was not of type KUidMsvMessageEntry (debug only).
-*/
-CMsvOperation* CSmsClientMtm::ReplyL(TMsvId aDestination,TMsvPartList /*aPartList*/, TRequestStatus& aCompletionStatus)
-	{
-	LoadMessageL();
-
-	__ASSERT_DEBUG(iMsvEntry, Panic(ESmscEntryNotSet));
-	__ASSERT_DEBUG(iMsvEntry->Entry().iType==KUidMsvMessageEntry, Panic(ESmscWrongContextType));
-
-	if (iSmsHeader->Type()!=CSmsPDU::ESmsDeliver)
-		{
-		User::Leave(KErrNotSupported);
-		}
-
-	CRichText* body = CRichText::NewL(iParaFormatLayer, iCharFormatLayer,CEditableText::EFlatStorage,KSmcmRichTextConstant);
-	CleanupStack::PushL(body);
-
-	CSmsHeader* smsheader=CSmsHeader::NewL(CSmsPDU::ESmsSubmit,Body());
-	CleanupStack::PushL(smsheader);
-
-	// Check to see if we are copying the contents of the original message
-	if(iServiceSettings->ReplyQuoted() && iMsvEntry->Entry().iBioType==NULL)
-		{
-		// Copy original rich text
-		body->AppendTakingSolePictureOwnershipL(Body());
-		// Copy ems elements from original message to new message
-		iSmsHeader->Message().CopyEmsElementsL(smsheader->Message());
-		}
-		
-	if( iSmsHeader->EmailFields().Length() > 0 )
-		{
-		// The context message is an email message - set the email fields for
-		// the new message.
-		smsheader->SetReplyEmailFieldsL(iSmsHeader->EmailFields(), *iEmailReplySubjectFormat);
-		}
-	else
-		{
-		// Get the reply to address if there is one else the from address.
-		DoAddRecipientL(smsheader, iSmsHeader->ReplyAddressL(), iMsvEntry->Entry().iDetails);
-		}
-
-	if(iSmsHeader->Deliver().ReplyPath())
-		{
-		smsheader->Submit().SetServiceCenterAddressL(iSmsHeader->Deliver().ServiceCenterAddress());
-		smsheader->SetReplyPathProvided(ETrue);
-		}
-	else smsheader->SetReplyPathProvided(EFalse);
-	
-	TMsvEntry entry;
-	BasicReplyForwardEntry(entry);
-
-	CMsvOperation* operation = CreateNewEntryL(entry, aDestination, *smsheader, *body, aCompletionStatus);
-
-	CleanupStack::PopAndDestroy(2, body);
-	return operation;
-	}
-
-/** 
-Creates a SMS forwarded message from the current message context.
-
-The SMS in the current context must be of type SMS-DELIVER, a mobile terminated 
-message, or SMS-SUBMIT, a mobile originated message. 
-
-The current context must be set to a message entry with type KUidMsvMessageEntryValue.
-If the current context is not set, or is set to an entry not of type
-KUidMsvMessageEntryValuethen a panic will occur.
-
-The new SMS message will have type SMS-SUBMIT, a mobile originated message. The 
-recipient is left blank. The contents that are copied to the new message include
-the message body, iBioType and description. Also, any EMS components are also
-copied.
-
-@param	aDestination
-The message entry (folder) under which to create the new message.
-
-@param	aPartList
-Ignored.
-
-@param	aCompletionStatus
-The request status to be completed when the operation has finished.
-
-@return
-An operation object. If the forward email is successful created, the operation
-will complete with KErrNone. The operation's progress information is a 
-TPckg<TMsvId>, containing the TMsvId of the new SMS message. If the forward 
-message fails to be created, the operation completes with the relevant error code.
-
-@leave	KErrNotSupported
-The current context has a PDU type that is neither SMS-SUBMIT nor SMS-DELIVER.
-
-@panic	SMCM	1
-The current context has not been set (debug only).
-
-@panic	SMCM	2
-The current context was not of type KUidMsvMessageEntry (debug only).
-*/
-CMsvOperation* CSmsClientMtm::ForwardL(TMsvId aDestination,TMsvPartList /*aPartList*/, TRequestStatus& aCompletionStatus)
-	{
-	LoadMessageL();
-
-	__ASSERT_DEBUG(iMsvEntry, Panic(ESmscEntryNotSet));
-	__ASSERT_DEBUG(iMsvEntry->Entry().iType==KUidMsvMessageEntry, Panic(ESmscWrongContextType));
-
-	// Only forwarding of Submitted or Delivered Messages is supported - ie only
-	// SMS messages that either been sent or received. 
-	CSmsPDU::TSmsPDUType smsType = iSmsHeader->Type();
-	if (smsType!=CSmsPDU::ESmsSubmit && smsType!=CSmsPDU::ESmsDeliver)
-		User::Leave(KErrNotSupported);
-
-	CRichText* body = CRichText::NewL(iParaFormatLayer, iCharFormatLayer,CEditableText::EFlatStorage,KSmcmRichTextConstant);
-	CleanupStack::PushL(body);
-	body->AppendTakingSolePictureOwnershipL(Body());
-
-	CSmsHeader* smsheader=CSmsHeader::NewL(CSmsPDU::ESmsSubmit,Body());
-	CleanupStack::PushL(smsheader);
-
-	smsheader->SetReplyPathProvided(EFalse);
-
-	// Copy any EMS elements
-	iSmsHeader->Message().CopyEmsElementsL(smsheader->Message());
-	
-	if( iSmsHeader->EmailFields().Length() > 0 )
-		{
-		// The context message is an email message - set the email fields for
-		// the new message.
-		smsheader->SetForwardEmailFieldsL(iSmsHeader->EmailFields(), *iEmailForwardSubjectFormat);
-		}
-	
-	// Set the contents of the new TMsvEntry
-	const TMsvEntry& originalEntry = Entry().Entry();
-	TMsvEntry entry;
-	BasicReplyForwardEntry(entry);
-	entry.iBioType = originalEntry.iBioType; // added since 6.1
-	entry.iDescription.Set(originalEntry.iDescription); // added since 6.1		
-
-	CMsvOperation* operation = CreateNewEntryL(entry, aDestination,*smsheader,*body,aCompletionStatus);
-
-	CleanupStack::PopAndDestroy(2, body);
-	return operation;
-	}
-
-/**
-Adds an addressee to the current context.
-
-The current context must be an SMS messge of type SMS-SUBMIT, indicating a 
-mobile originated message. The address is added to the recipient list for the 
-message.
-
-For SMS an address is a telephone number. There is no validation done on the 
-input argument aRealAddress to ensure that it is a valid telephone number.
-
-The TSmsUtilities::GetDetails API can be used prior to this API to find the if
-a unique alias exists in the contacts database for this particular telephone 
-number.
-
-The current context must be set to a message entry with type KUidMsvMessageEntryValue.
-If the current context is set to an entry not of type KUidMsvMessageEntryValuethen
-a panic will occur.
-
-The SMS MTM maintains an addressee list that matches the recipient list in the 
-SMS message header object. If the two list cannot be maintained together then
-this function will leave and both lists are unchanged.
-
-@param	aRealAddress
-A string representing the address to be added to the recipient list for the
-current context.
-
-@leave	KErrNotSupported
-The current contxt PDU type is not SMS-SUBMIT.
-
-@panic	SMCM	2
-The current context was not of type KUidMsvMessageEntry (debug only).
-
-@panic	SMCM	6
-The addressee list and recipient list do not match (debug only).
-*/
-void CSmsClientMtm::AddAddresseeL(const TDesC& aRealAddress)
-	{
-	__ASSERT_DEBUG(iMsvEntry->Entry().iType==KUidMsvMessageEntry, Panic(ESmscWrongContextType));
-	if (iSmsHeader->Type()!=CSmsPDU::ESmsSubmit)
-		User::Leave(KErrNotSupported);
-	__ASSERT_DEBUG(iAddresseeList->Count()==iSmsHeader->Recipients().Count(),Panic(ESmscRecpAddresseeMiscount));
-	TPtr ptr(NULL,0);
-	DoAddAddresseeL(aRealAddress,ptr);
-	TRAPD(ret,AddRecipientL(aRealAddress,ptr));
-	if (ret!=KErrNone)
-		{
-		iAddresseeList->Delete(iAddresseeList->Count()-1);
-		User::Leave(ret);
-		}
-	}
-
-/** 
-Adds an addressee with an alias to the current context.
-
-The SMS message in the current context must be of type SMS-SUBMIT, indicating a
-mobile originated message. The address is added to the recipient list for the 
-message.
-
-For SMS an address is a telephone number. There is no validation done on the 
-input argument aRealAddress to ensure that it is a valid telephone number.
-
-The TSmsUtilities::GetDetails API can be used prior to this API to find the if
-a unique alias exists in the contacts database for this particular telephone 
-number.
-
-The current context must be set to a message entry with type KUidMsvMessageEntryValue.
-If the current context is set to an entry not of type KUidMsvMessageEntryValuethen
-a panic will occur.
-
-The SMS MTM maintains an addressee list that matches the recipient list in the 
-SMS message header object. If the two list cannot be maintained together then
-this function will leave and both lists are unchanged.
-
-@param	aRealAddress
-A string representing the address to be added to the recipient list for the 
-current message.
-
-@param	aAlias
-The alias information for the address.
-
-@leave	KErrNotSupported
-The current contxt PDU type is not SMS-SUBMIT.
-
-@panic	SMCM	2
-The current context was not of type KUidMsvMessageEntry (debug only).
-
-@panic	SMCM	6
-The addressee list and recipient list do not match (debug only).
-*/
-void CSmsClientMtm::AddAddresseeL(const TDesC& aRealAddress, const TDesC& aAlias)
-	{
-	__ASSERT_DEBUG(iMsvEntry->Entry().iType==KUidMsvMessageEntry, Panic(ESmscWrongContextType));
-	if (iSmsHeader->Type()!=CSmsPDU::ESmsSubmit)
-		User::Leave(KErrNotSupported);
-	__ASSERT_DEBUG(iAddresseeList->Count()==iSmsHeader->Recipients().Count(),Panic(ESmscRecpAddresseeMiscount));
-	DoAddAddresseeL(aRealAddress,aAlias);
-	TRAPD(ret,AddRecipientL(aRealAddress,aAlias));
-	if (ret!=KErrNone)
-		{
-		iAddresseeList->Delete(iAddresseeList->Count()-1);
-		User::Leave(ret);
-		}
-	}
-
-/** 
-Removes a recipient from the current address list.
-
-The recipient to be removed is specified by its index in the list of recipients.
-This function can only be used when the current context is a mobile-originated
-message (is a SMS-SUBMIT type message).
-
-The index must be valid or a panic will occur. A valid index is not negative and
-does not exceed the upper bounds of the list.
-
-The current context must be set to a message entry with type KUidMsvMessageEntryValue.
-If the current context is set to an entry not of type KUidMsvMessageEntryValuethen
-a panic will occur.
-
-The SMS MTM maintains an addressee list that matches the recipient list in the 
-SMS message header object. The address is removed from both lists.
-
-@param aIndex
-The index of recipient to be removed.
-
-@panic	SMCM	0
-The current contxt PDU type is not SMS-SUBMIT (debug only).
-
-@panic	SMCM	2
-The current context was not a mesasge type context (debug only).
-
-@panic	SMCM	5
-The specified index exceeds the recipient list range (debug only).
-
-@panic	SMCM	6
-The addressee list and recipient list do not match (debug only).
-*/
-void CSmsClientMtm::RemoveAddressee(TInt aIndex)
-	{
-	__ASSERT_DEBUG(iMsvEntry->Entry().iType==KUidMsvMessageEntry, Panic(ESmscWrongContextType));
-	__ASSERT_DEBUG(iSmsHeader->Type() == CSmsPDU::ESmsSubmit, Panic(ESmutPanicUnsupportedMsgType));
-	__ASSERT_DEBUG((aIndex>=0) && (aIndex<iAddresseeList->Count()),Panic(ESmscAddresseeIndexOutOfRange));
-	__ASSERT_DEBUG(iAddresseeList->Count()==iSmsHeader->Recipients().Count(),Panic(ESmscRecpAddresseeMiscount));
-	delete iSmsHeader->Recipients()[aIndex];
-	iSmsHeader->Recipients().Delete(aIndex);
-	iAddresseeList->Delete(aIndex);
-	}
-
-/**
-Queries if the MTM supports the capability specified by the supplied UID.
-
-@param	aCapability
-The UID of capability to be queried.
-
-@param	aResponse
-An output argument for the response value. The format of the response varies
-according to the capability. 
-
-@return
-A value of KErrNone if the specified capability is recognised and a response
-is returned. KErrNotSupported indicates that the capability is not recognised.
-
-@see	mtmuids.h
-*/
-TInt CSmsClientMtm::QueryCapability(TUid aCapability, TInt& aResponse)
-	{
-	TInt error=KErrNone;
-	aResponse=ETrue;
-	switch (aCapability.iUid)
-		{
-		case KUidMtmQueryMaxBodySizeValue:
-			{
-			aResponse=KSmcmMaxTotalMsgSize;
-			break;
-			}
-		case KUidMtmQueryMaxTotalMsgSizeValue:
-			{
-			aResponse = KSmcmMaxMessageNumber*KSmcmMaxCharsInMessageConcatenated7Bit;
-			break;
-			}
-		case KUidMtmQuerySupportedBodyValue:
-			{
-			aResponse = KMtm7BitBody + KMtm8BitBody + KMtm16BitBody;
-			break;
-			}
-		case KUidMtmQueryCanSendMsgValue:
-		case KUidMtmQueryCanReceiveMsgValue:
-		case KUidMtmQuerySupportsBioMsgValue:
-		case KUidMtmQuerySupportsSchedulingValue:
-		case KUidMtmQuerySendAsMessageSendSupportValue:
-			break;
-		case KUidMtmQueryMaxRecipientCountValue:
-			{
-			aResponse=KErrNotFound;	// not limited
-			break;
-			}
-		case KUidMsvMtmQueryEditorUidValue:
-			{
-			aResponse=KUidMsgSmsEditorAppVal;
-			break;
-			}
-		case KUidMtmQuerySupportAttachmentsValue:
-		case KUidMtmQueryOffLineAllowedValue:
-		case KUidMtmQuerySupportSubjectValue:
-		case KUidMtmQuerySendAsRequiresRenderedImageValue:
-		case KUidMtmQuerySendAsRenderingUidValue:
-		case KUidMtmQuerySupportsFolderValue:
-		case KUidMtmQuerySupportsRecipientTypeValue:
-		default:
-			error=KErrNotSupported;
-		}
-	return error;
-	}
-
-/**
-Unused for SMS.
-
-This function should not be used as it will cause a panic.
-
-@param aFunctionId
-Unused.
-
-@param aSelection
-Unused.
-
-@param aParameter
-Unused. 
-
-@panic	SMCM	3
-This command is not supported in SMS and should not be used.
-
-@internalComponent
-*/
-void CSmsClientMtm::InvokeSyncFunctionL(TInt /*aFunctionId*/,const CMsvEntrySelection& /*aSelection*/, TDes8& /*aParameter*/)
-	{
-	Panic(ESmscPanicUnexpectedCommand);
-	}
-
-/**
-Invokes asynchronous SMS-specific operations.
-
-The specified operation is performed by the SMS server MTM.
-
-If the requested command is not supported then a panic will occur. The list of
-supported commands is given by TSmsMtmCommand.
-
-The current context must be set. If the current context is not set then a panic
-will occur.
-
-@param	aFunctionId
-The ID of the operation to perform. The specific operations are defined by the
-TSmsMtmCommand enumeration.
-
-@param	aSelection
-A selection of messages, the use of which is specific to the selected operation.
-
-@param	aParameter
-A packaged object, the use of which is specific to the selected operation.
-
-@param	aCompletionStatus
-The request status to be notified when the operation completes. 
-
-@return
-An object encapsulating the requested operation if the specified operation was
-successfully started. If the operation failed to be started an completing 
-operation is returned with its status set to the relevant error code.
-
-@see	TSmsMtmCommand 
-
-@panic	SMCM	1
-The message entry has not been set (debug only).
-
-@panic	SMCM	3
-The specified operation is not supported in SMS.
-*/
-CMsvOperation* CSmsClientMtm::InvokeAsyncFunctionL(TInt aFunctionId, const CMsvEntrySelection& aSelection, TDes8& aParameter, TRequestStatus& aCompletionStatus)
-	{
-	__ASSERT_DEBUG(iMsvEntry,Panic(ESmscEntryNotSet));
-	switch (aFunctionId)
-		{
-		case KMTMStandardFunctionsSendMessage:
-			// perform a regular send with standardised progress information for SendAs2
-			return CSmsSendMessageOperation::NewL(Session(), aSelection, aParameter, aCompletionStatus);
-		case ESmsMtmCommandScheduleCopy:
-		case ESmsMtmCommandScheduleMove:
-		case ESmsMtmCommandDeleteSchedule:
-		case ESmsMtmCommandCheckSchedule:
-		case ESmsMtmCommandSendScheduledCopy:
-		case ESmsMtmCommandSendScheduledMove:
-		case ESmsMtmCommandEnumeratePhoneStores:
-		case ESmsMtmCommandDeleteFromPhoneStore:
-		case ESmsMtmCommandCopyFromPhoneStore:
-		case ESmsMtmCommandMoveFromPhoneStore:
-		case ESmsMtmCommandCopyToPhoneStore:
-		case ESmsMtmCommandMoveToPhoneStore:
-			break;
-		default:
-			Panic(ESmscPanicUnexpectedCommand);
-		}
-	return Session().TransferCommandL(aSelection,aFunctionId,(TDesC8&)aParameter, aCompletionStatus);
-	}
-
-
-/**
-Informs the MTM that the context's BIO field is being changed.
-
-The change is as a result of a call to CSendAs::SetBioTypeL(). This function is
-used by CSendAs::CreateMessageL to create a new outgoing SMS message
-
-@param	aBioTypeUid
-The new value for the BIO field.
-
-@panic	SMCM	10
-The BIO field contains the wrong value (debug only).
-*/
-EXPORT_C void CSmsClientMtm::BioTypeChangedL(TUid aBioTypeUid)
-	{
-	// Looks up the default send bearer and sets the
-	// character encoding of the Submit() accordingly.
-	RestoreServiceAndSettingsL();
-
-	CBIODatabase* bdb = CBIODatabase::NewLC(Session().FileSession());
-	TBioMsgId bioMsgId;
-	bdb->GetDefaultSendBearerL(aBioTypeUid, bioMsgId);
-
-	CSmsSettings* settings = CSmsSettings::NewL();
-	CleanupStack::PushL(settings);
-
-	settings->CopyL(*iServiceSettings);
-
-	iSmsHeader->SetBioMsgIdType(bioMsgId.iType);
-
-	TSmsDataCodingScheme::TSmsAlphabet alpha = TSmsDataCodingScheme::ESmsAlphabet8Bit;
-
-	// Set the SMS Data Encoding Scheme
-	switch (bioMsgId.iType)
-		{
-		case EBioMsgIdNbs:
-			{
-			switch (bioMsgId.iCharacterSet.iUid)
-				{
-//				case KCharacterSetIdentifierIso88591:
-				case KCharacterSetIdentifierCodePage1252:
-					{
-					alpha = TSmsDataCodingScheme::ESmsAlphabet8Bit;
-					break;
-					}
-				case KCharacterSetIdentifierSms7Bit:
-					{
-					alpha = TSmsDataCodingScheme::ESmsAlphabet7Bit;
-					break;
-					}
-				default:
-					{
-					alpha = TSmsDataCodingScheme::ESmsAlphabetUCS2;
-					break;
-					}
-				}
-			break;
-			}
-		case EBioMsgIdWap:
-		case EBioMsgIdWapSecure:
-		default:
-			{
-			//ESmsAlphabet8Bit;
-			break;
-			}
-		};
-
-	settings->SetCharacterSet(alpha);
-	iSmsHeader->SetSmsSettingsL(*settings);
-
-	// service centre was not being set 
-	TInt defaultSC = iServiceSettings->DefaultServiceCenter();
-	if(defaultSC > -1)
-		{
-		iSmsHeader->SetServiceCenterAddressL( iServiceSettings->GetServiceCenter(defaultSC).Address() );	
-		}
-
-	__ASSERT_DEBUG(iSmsHeader->BioMsgIdType() == bioMsgId.iType, Panic(ESmscBioMsgIdTypeError));
-
-	CleanupStack::PopAndDestroy(2, bdb);
-	}
-
-/** 
-Creates a new outgoing SMS message entry as a child of the current context.
-
-Used by CSendAs::CreateMessageL to create an outgoing SMS message.
-
-@param	aServiceId
-The ID of the service to own the entry (not used).
-
-@see	CSendAs::CreateMessageL
-*/
-EXPORT_C void CSmsClientMtm::CreateMessageL(TMsvId /*aServiceId*/)
-	{
-	RestoreServiceAndSettingsL();
-
- 	// Fix for DEF000924: Need to be able to send/cancel an sms while another 
-	// is being sent create an invisible blank entry.
- 	TMsvEntry entry;
- 	entry.iType = KUidMsvMessageEntry;
- 	entry.iRelatedId = iServiceId;
- 	entry.iServiceId = KMsvLocalServiceIndexEntryId;
- 	entry.iMtm = Type();
- 	entry.SetVisible(EFalse);
- 	entry.SetInPreparation(ETrue);
- 	
- 	// Fix for DEF061945: Need to initialise the iDate member of the new entry
- 	entry.iDate.UniversalTime();
- 	// store entry in folder
- 	iMsvEntry->CreateL(entry);
- 	SwitchCurrentEntryL(entry.Id());
- 	// End of fix
-
-	delete iSmsHeader;
-	iSmsHeader=NULL;
-	iSmsHeader=CSmsHeader::NewL(CSmsPDU::ESmsSubmit,Body());
-	iSmsHeader->SetSmsSettingsL(*iServiceSettings);
-
-	// service centre was not being set 
-	TInt defaultSC = iServiceSettings->DefaultServiceCenter();
-	if(defaultSC > -1)
-		{
-		if (iServiceSettings->ServiceCenterCount() > defaultSC )
-			{
-			iSmsHeader->SetServiceCenterAddressL( iServiceSettings->GetServiceCenter(defaultSC).Address() );	
-			}
-		}
- 	}
-
-
-
-
-
-/** 
-Creates a new outgoing SMS message entry as a child of the current context.
-
-Used by CSendAs::CreateMessageL to create an outgoing SMS message.
-
-@param	
-The entry with the required fields set.
-
-*/
-EXPORT_C void CSmsClientMtm::CreateMessageL(TMsvEntry& aEntry)
-	{
-	RestoreServiceAndSettingsL();
-
- 	aEntry.SetVisible(EFalse);
- 	aEntry.SetInPreparation(ETrue);
- 	aEntry.iDate.UniversalTime();
- 	
- 	// store entry in folder
- 	iMsvEntry->CreateL(aEntry);
- 	SwitchCurrentEntryL(aEntry.Id());
- 	// End of fix
-
-	delete iSmsHeader;
-	iSmsHeader=NULL;
-	iSmsHeader=CSmsHeader::NewL(CSmsPDU::ESmsSubmit,Body());
-	iSmsHeader->SetSmsSettingsL(*iServiceSettings);
-
-	// service centre was not being set 
-	TInt defaultSC = iServiceSettings->DefaultServiceCenter();
-	if(defaultSC > -1)
-		{
-		if (iServiceSettings->ServiceCenterCount() > defaultSC )
-			{
-			iSmsHeader->SetServiceCenterAddressL( iServiceSettings->GetServiceCenter(defaultSC).Address() );	
-			}
-		}
- 	}
-
-
-
-/**
-Resets the current SMS message.
-
-The recipient list in the SMS message header object is emptied. As the SMS MTM 
-maintains an addressee list that matches the recipient list in the SMS message 
-header object, this addressee list is also emptied.
-*/
-void CSmsClientMtm::ContextEntrySwitched()
-	{
-	ResetHeader();
-	}
-
-/** 
-This method is from CBaseMtm, The default implementation is available in CBaseMtm. 
-The implementation of this function assumes that the new service for setting the 
-charset encoding value for a SMS message is supported.
-TAny* is equivalent to void*.
-@param	a0				 			The collective parameters of TAny*
-@param	a1				 			The collective parameters of TAny*,Charset encoding value is actually extracted from a1.
-@param aExtensionId 	 			Uid of the extension interface.
-@return KErrNone					If charset is changed successfully in SMS settings for a message.
-@return KErrExtensionNotSupported 	If the message is other than SMS.					
-@return Other 			 			Standard system-wide error codes.
-*/
-
-EXPORT_C TInt CSmsClientMtm::Extension_(TUint aExtensionId, TAny*& a0, TAny* a1)
-	{
-	TInt ret=KErrNone;
-	switch(aExtensionId)
-		{
-		case KUIDCharacterSet:
-			{
-	    	TSmsDataCodingScheme::TSmsAlphabet tsmsAlphabet = (TSmsDataCodingScheme::TSmsAlphabet)(TUint)*(TUint*)a1;
-	    	TRAP(ret,SetMessageCharacterSetL(tsmsAlphabet));
-			return ret;
-			}
-		default:
-			{
-			// Chain to base class
-			return CBaseMtm::Extension_(aExtensionId, a0, a1);
-			}
-		}
-	}
-
-/**
-This is the actual functionality for setting the character encoding value other than 7-bit ASCII.
-TSmsDataCodingScheme is used for collecting the encoding value for setting the charset for a message.
-This setting is for per-message basis.
-@param aTsmsAlphabet 	 			Enum of Sms datacoding scheme for the character encoding value.
-@return void.
-*/
-   
-void CSmsClientMtm::SetMessageCharacterSetL(TSmsDataCodingScheme::TSmsAlphabet aTsmsAlphabet)
-	{
-	CSmsSettings* settings = CSmsSettings::NewL();
-	CleanupStack::PushL(settings);
-
-	settings->CopyL(*iServiceSettings);
-	settings->SetCharacterSet(aTsmsAlphabet);
-	iSmsHeader->SetSmsSettingsL(*settings);
-	CleanupStack::PopAndDestroy(settings);
-	}
-
-/** 
-Commits cached changes to the current message context to the message store.
-
-The current context must be set to a message entry with type KUidMsvServiceEntryValue,
-KUidMsvFolderEntryValue or KUidMsvMessageEntryValue. If the current context is
-not set, or is set to an entry with a type that is not supported by this function
-then a panic will occur.
-
-Both the SMS service ID and SMS service settings must have been set or a panic
-will occur. The CSmsClientMtm::RestoreServiceAndSettingsL API can restore both
-of these items.
-
-@panic  SMCM    1
-The current context has not been set (debug only).
-
-@panic  SMCM    4
-The type of the current context is not supported.
-
-@panic  SMCM    11
-The SMS Service settings have not been set (debug only).
-
-@panic  SMCM    12
-The ID for SMS Service has not been set (debug only).
-
-@see    CSmsClientMtm::RestoreServiceAndSettingsL
-*/
-EXPORT_C void CSmsClientMtm::SaveMessageL(CMsvStore& aEditStore, TMsvEntry& aEntry)
-    {
-    switch (aEntry.iType.iUid)
-        {
-        case KUidMsvServiceEntryValue:
-            {
-            __ASSERT_DEBUG(iServiceSettings, Panic(ESmscSettingsNotSet));
-            __ASSERT_DEBUG(iServiceId, Panic(ESmscServiceIdNotSet));
-            CSmsAccount* account = CSmsAccount::NewLC();
-            account->SaveSettingsL(*iServiceSettings);
-            CleanupStack::PopAndDestroy(account);    
-            break;
-            }
-        case KUidMsvFolderEntryValue:
-            {
-            break;
-            }
-        case KUidMsvMessageEntryValue:
-            {
-            if ((0 >= aEntry.iDetails.Length()) && (iSmsHeader->Recipients().Count() > 0))
-                {
-                CSmsNumber* recipient = iSmsHeader->Recipients().At(0);
-                if(recipient->Name().Length() > 0)
-                    aEntry.iDetails.Set(recipient->Name());
-                else
-                    aEntry.iDetails.Set(recipient->Address());
-                }
-            if(Body().DocumentLength()>0 && 0 >= aEntry.iDescription.Length())
-                {
-                aEntry.iDescription.Set(Body().Read(0,iServiceSettings->DescriptionLength()));   
-                }
-            aEntry.SetVisible(ETrue);
-            aEntry.SetInPreparation(EFalse);           
-            aEntry.SetMultipleRecipients(iSmsHeader->Recipients().Count() > 1);
-            iSmsHeader->StoreL(aEditStore);
-            StoreBodyL(aEditStore);
-            break;
-            }
-        default:
-            Panic(ESmscUnrecognizedEntryType);
-        }
-    
-    const TInt size = aEditStore.SizeL();        
-    if (aEntry.iSize != size)
-        {
-        aEntry.iSize = size;             
-        }
-    }
--- a/messagingappbase/smsmtm/clientmtm/src/SMUTHDR.CPP	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1075 +0,0 @@
-// Copyright (c) 1999-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 <smuthdr.h>
-#include <csmsemailfields.h>
-#include <gsmuieoperations.h>
-
-#include <gsmumsg.h>
-#include <msvstore.h>	
-#include <cntdb.h>
-#include <gsmunonieoperations.h>
-#include <gsmuelem.h>
-#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS  
-#include <tmsvsmsentry.h>
-#endif
-
-#if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
-#include <msvrcpt.h> 
-#endif
-	
-const TUid KUidMsvSMSHeaderStream		= {0x10001834};
-const TInt16 KMsvSmsHeaderVersion		= 1;
-const TInt KSmcmRecipientsGranularity	= 8;
-#if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
-_LIT16(KComma, ",");
-_LIT16(KDelimiter, ";");
-#endif
-
-/** 
-Allocates and constructs a new CSmsHeader object.
-
-Use this function to create a new SMS-SUBMIT, SMS-COMMAND, SMS-DELIVER or 
-SMS-STATUS-REPORT type message.
-
-@param	aType
-The Protocol Data Unit (PDU) type for the SMS message.
-
-@param	aText
-The message text.
-
-@return
-A new CSmsHeader object.
-*/
-EXPORT_C CSmsHeader* CSmsHeader::NewL(CSmsPDU::TSmsPDUType aType, CEditableText& aText)
-	{
-	CSmsHeader* self = new(ELeave) CSmsHeader();
-	CleanupStack::PushL(self);
-	self->ConstructL(aType, aText);
-	CleanupStack::Pop(self);
-	return self;
-	}
-	
-/** 
-Allocates and constructs a new CSmsHeader object.
-
-Use this function to create a new SMS-SUBMIT, SMS-COMMAND, SMS-DELIVER or 
-SMS-STATUS-REPORT type message. This version uses a previously connected
-file server session handle.
-
-@param	aType
-The Protocol Data Unit (PDU) type for the SMS message.
-
-@param	aText
-The message text.
-
-@param aFs
-Handle to an open file server session. CSmsHeader will not close the file session.
-
-@return
-A new CSmsHeader object.
-*/
-EXPORT_C CSmsHeader* CSmsHeader::NewL(CSmsPDU::TSmsPDUType aType, CEditableText& aText, RFs& aFs)
-	{
-	CSmsHeader* self = new(ELeave) CSmsHeader();
-	CleanupStack::PushL(self);
-	self->ConstructL(aType, aText, aFs);
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-/** 
-Allocates and constructs a new CSmsHeader object.
-
-Use this function to create a new SMS-DELIVER type message.
-
-@param	aMessage
-The SMS message encapsulation from the SMS stack.
-
-@return
-A new CSmsHeader object.
-*/
-EXPORT_C CSmsHeader* CSmsHeader::NewL(CSmsMessage* aMessage)
-	{
-	CSmsHeader* self = new(ELeave) CSmsHeader(aMessage);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-/**
-Destructor.
-*/
-EXPORT_C CSmsHeader::~CSmsHeader()
-	{
-	iRecipients.ResetAndDestroy();
-	delete iMessage;
-	delete iEmailFields;
-	if(iCloseFs)
-		{
-		iFs.Close();
-		}
-	}
-
-/** 
-Sets the SMS message settings for the message.
-
-This can only be used on SMS-SUBMIT, SMS-COMMAND, SMS-DELIVER or SMS-STATUS-REPORT
-type messages.
-
-NOTE - if this is an Email over SMS message then the PID of is not changed. The
-PID would have been set correctly when the email fields were set.
-
-@param	aSmsSettings
-The SMS message settings for the message
-
-@leave	KErrNotSupported
-The message PDU type was not supported, or the message conversion value was not
-supported.
-
-@panic	SMCM	0
-The message PDU is not supported (debug only).
-*/
-EXPORT_C void CSmsHeader::SetSmsSettingsL(const CSmsMessageSettings& aSmsSettings)
-	{
-	__ASSERT_DEBUG( (Type()==CSmsPDU::ESmsSubmit) || (Type()==CSmsPDU::ESmsDeliver) || (Type()==CSmsPDU::ESmsStatusReport) || (Type()==CSmsPDU::ESmsCommand), Panic(ESmutPanicUnsupportedMsgType)); 
-
-	switch(Type())
-		{
-		case(CSmsPDU::ESmsSubmit):
-			{
-			Submit().SetRejectDuplicates(aSmsSettings.RejectDuplicate());
-			Submit().SetReplyPath(aSmsSettings.ReplyPath());
-			
-			//Check if delivery report for the last segment only is required . 
-			if(aSmsSettings.LastSegmentDeliveryReport())
-				{
-				CSmsTPSRROperations& tpSRROperations = static_cast<CSmsTPSRROperations&>(iMessage->GetOperationsForNonIEL(ESmsTPSRRParameter));
-				tpSRROperations.SetSchemeL();
-				tpSRROperations.SetLastSegmentStatusReportL(ETrue);
-				}
-			else
-				{
-				Submit().SetStatusReportRequest(aSmsSettings.DeliveryReport());	
-				}
-			Submit().SetValidityPeriod(aSmsSettings.ValidityPeriod());
-			Submit().SetValidityPeriodFormat(aSmsSettings.ValidityPeriodFormat());
-			break;
-			}
-		case(CSmsPDU::ESmsCommand):
-			{
-			Command().SetStatusReportRequest(aSmsSettings.DeliveryReport());
-			break;
-			}
-		case(CSmsPDU::ESmsDeliver):
-		case(CSmsPDU::ESmsStatusReport):
-			break;
-		default:
-			{			
-			User::Leave(KErrNotSupported);
-			break;
-			}
-		};
-
-	if (Message().TextPresent())
-		SetCanConcatenate(aSmsSettings.CanConcatenate());
-
-	CSmsPDU& pdu=Message().SmsPDU();
-	if (pdu.DataCodingSchemePresent())
-		pdu.SetAlphabet(aSmsSettings.CharacterSet());
-	if (pdu.ProtocolIdentifierPresent() && iEmailFields->Length() == 0 )
-		{
-		// The email fields object for this message is empty - therefore the
-		// PID can be set. With a non-empty email fields object the PID would
-		// have been set for interworking with email and MUST not be changed.
-		pdu.SetPIDType(TSmsProtocolIdentifier::ESmsPIDTelematicInterworking);
-
-		// MessageConversion
-		switch(aSmsSettings.MessageConversion())
-			{
-			case(ESmsConvPIDNone):
-				{
-				pdu.SetTelematicDeviceIndicator(TSmsProtocolIdentifier::ESmsNoTelematicDevice);
-				break;
-				}
-			case ESmsConvFax:
-			case ESmsConvX400:
-			case ESmsConvPaging:
-			case ESmsConvMail:
-			case ESmsConvErmes:
-			case ESmsConvSpeech:
-				{
-				pdu.SetTelematicDeviceIndicator(TSmsProtocolIdentifier::ESmsTelematicDevice);
-				pdu.SetTelematicDeviceType((TSmsProtocolIdentifier::TSmsTelematicDeviceType) aSmsSettings.MessageConversion());
-				break;
-				}
-			default:
-				{
-				User::Leave(KErrNotSupported);
-				break;
-				}
-			}; 
-		}
-	}
-
-/** 
-Gets the SMS message settings for the message.
-
-This can only be used on SMS-SUBMIT type messages.
-
-@param	aSmsSettings
-The output argument with the SMS message settings.
-
-@leave	KErrNotSupoprted
-The Telematic Device type is not supported.
-
-@panic	SMCM	0
-The message PDU is not supported (debug only).
-*/
-EXPORT_C void CSmsHeader::GetSmsSettingsL(CSmsMessageSettings& aSmsSettings) const
-	{
-	__ASSERT_DEBUG( Type()==CSmsPDU::ESmsSubmit, Panic(ESmutPanicUnsupportedMsgType)); 
-	switch(Type())
-		{
-		case(CSmsPDU::ESmsSubmit):
-			{
-			aSmsSettings.SetRejectDuplicate(Submit().RejectDuplicates());
-			aSmsSettings.SetReplyPath(Submit().ReplyPath());
-			TSmsStatusReportScheme scheme = iMessage->Scheme();
-			if (scheme == ETPSRRScheme)	
-				{
-				aSmsSettings.SetLastSegmentDeliveryReport(ETrue);
-				}
-			else
-				{
-				aSmsSettings.SetDeliveryReport(Submit().StatusReportRequest());
-				}
-			aSmsSettings.SetValidityPeriod(Submit().ValidityPeriod());
-			aSmsSettings.SetValidityPeriodFormat(Submit().ValidityPeriodFormat());
-			aSmsSettings.SetCharacterSet(Submit().Alphabet());
-		
-			if (iMessage->SmsPDU().PIDType() == TSmsProtocolIdentifier::ESmsPIDTelematicInterworking)
-				{
-				if (iMessage->SmsPDU().TelematicDeviceIndicator() == TSmsProtocolIdentifier::ESmsNoTelematicDevice)
-					{
-					aSmsSettings.SetMessageConversion(ESmsConvPIDNone);
-					}
-				else //if (iMessage->SmsPDU().TelematicDeviceIndicator() == TSmsProtocolIdentifier::ESmsTelematicDevice)
-					{
-					switch (iMessage->SmsPDU().TelematicDeviceType())
-						{
-						case TSmsProtocolIdentifier::ESmsGroup3TeleFax:
-						case TSmsProtocolIdentifier::ESmsX400MessageHandlingSystem:
-						case TSmsProtocolIdentifier::ESmsNationalPagingSystem:
-						case TSmsProtocolIdentifier::ESmsInternetElectronicMail:
-						case TSmsProtocolIdentifier::ESmsERMES:
-						case TSmsProtocolIdentifier::ESmsVoiceTelephone:
-							aSmsSettings.SetMessageConversion((TSmsPIDConversion) iMessage->SmsPDU().TelematicDeviceType());
-							break;
-						default:
-							User::Leave(KErrNotSupported);
-							break;
-						}
-					}
-				}
-
-			aSmsSettings.SetCanConcatenate(CanConcatenate());
-			break;
-			}
-		default:
-			{
-			break;
-			}
-		}
-	}
-	
-/**
-Sets the email fields for the message.
-
-If the supplied email fields is not empty then the PID of the PDU of the message
-is set for interworking with email.
-
-If the supplied email fields is empty and the PID of the PDU of the message is 
-set for interworking with email then the PID is set to the default value that
-indicates no telematic device. If the PID was not set for interworking with 
-email then it is left unchanged.
-
-@param	aEmailFields
-The email fields object. A copy is made of this object.
-*/	
-EXPORT_C void CSmsHeader::SetEmailFieldsL(const CSmsEmailFields& aEmailFields)
-	{
-	__ASSERT_DEBUG( Type()==CSmsPDU::ESmsSubmit, Panic(ESmutPanicUnsupportedMsgType)); 
-
-	CSmsEmailFields* temp = CSmsEmailFields::NewL(aEmailFields);
-	delete iEmailFields;
-	iEmailFields = temp;
-	
-	CSmsPDU& pdu = Message().SmsPDU();
-	if( pdu.ProtocolIdentifierPresent() )
-		{
-		if( iEmailFields->Length() > 0 )
-			{
-			// Set the PID for interworking with email.
-			pdu.SetPIDType(TSmsProtocolIdentifier::ESmsPIDTelematicInterworking);
-			pdu.SetTelematicDeviceIndicator(TSmsProtocolIdentifier::ESmsTelematicDevice);
-			pdu.SetTelematicDeviceType(TSmsProtocolIdentifier::ESmsInternetElectronicMail);
-			}
-		else
-			{
-			// The email fields are empty - if the PID is set for interworking
-			// with email, set to indicate no telematic device.
-			if(	pdu.PIDType() == TSmsProtocolIdentifier::ESmsPIDTelematicInterworking &&
-				pdu.TelematicDeviceIndicator() == TSmsProtocolIdentifier::ESmsTelematicDevice &&
-				pdu.TelematicDeviceType() == TSmsProtocolIdentifier::ESmsInternetElectronicMail )
-				{
-				pdu.SetTelematicDeviceIndicator(TSmsProtocolIdentifier::ESmsNoTelematicDevice);
-				}
-			}
-		}
-	}
-	
-/**
-Sets the email fields for a reply message.
-
-The address field is copied from the specified email fields. The subject field 
-is formatted according to the specified subject format using the subject from 
-the specified email fields.
-
-The PID of the PDU of the message is set for interworking with email.
-
-@param	aEmailFields
-The email fields object.
-
-@param	aReplySubjectFormat
-The format of the subject field.
-
-@internalComponent
-*/
-void CSmsHeader::SetReplyEmailFieldsL(const CSmsEmailFields& aEmailFields, const TDesC& aReplySubjectFormat)
-	{
-	// Create the reply email fields - copy address and then format the subject,
-	// if one exists according to the reply prefix.
-	CSmsEmailFields* temp = CSmsEmailFields::NewL();
-	CleanupStack::PushL(temp);
-	temp->AddAddressL(aEmailFields.Addresses().MdcaPoint(0));
-	
-	SetEmailReplyForwardSubjectL(temp, aEmailFields.Subject(), aReplySubjectFormat);
-
-	CleanupStack::Pop(temp);
-	delete iEmailFields;
-	iEmailFields = temp;
-
-	// Set the PID for interworking with email.
-	CSmsPDU& pdu = Message().SmsPDU();
-	if( pdu.ProtocolIdentifierPresent() )
-		{
-		pdu.SetPIDType(TSmsProtocolIdentifier::ESmsPIDTelematicInterworking);
-		pdu.SetTelematicDeviceIndicator(TSmsProtocolIdentifier::ESmsTelematicDevice);
-		pdu.SetTelematicDeviceType(TSmsProtocolIdentifier::ESmsInternetElectronicMail);
-		}
-	}
-
-/**
-Sets the email fields for a forward message.
-
-The address field is left empty. The subject field is formatted according to the
-specified subject format using the subject from the specified email fields.
-
-The PID of the PDU of the message is set for interworking with email.
-
-@param	aEmailFields
-The email fields object.
-
-@param	aForwardSubjectFormat
-The format of the subject field.
-
-@internalComponent
-*/
-void CSmsHeader::SetForwardEmailFieldsL(const CSmsEmailFields& aEmailFields, const TDesC& aForwardSubjectFormat)
-	{
-	// Create the reply email fields - copy address and then format the subject,
-	// if one exists according to the reply prefix.
-	CSmsEmailFields* temp = CSmsEmailFields::NewL();
-	CleanupStack::PushL(temp);
-	
-	SetEmailReplyForwardSubjectL(temp, aEmailFields.Subject(), aForwardSubjectFormat);
-
-	CleanupStack::Pop(temp);
-	delete iEmailFields;
-	iEmailFields = temp;
-
-	// Set the PID for interworking with email.
-	CSmsPDU& pdu = Message().SmsPDU();
-	if( pdu.ProtocolIdentifierPresent() )
-		{
-		pdu.SetPIDType(TSmsProtocolIdentifier::ESmsPIDTelematicInterworking);
-		pdu.SetTelematicDeviceIndicator(TSmsProtocolIdentifier::ESmsTelematicDevice);
-		pdu.SetTelematicDeviceType(TSmsProtocolIdentifier::ESmsInternetElectronicMail);
-		}
-	}
-	
-void CSmsHeader::SetEmailReplyForwardSubjectL(CSmsEmailFields* aEmailFields, const TDesC& aSubject, const TDesC& aSubjectFormat)
-	{
-	TInt length = aSubject.Length();
-	if( length > 0 )
-		{
-		// Prevent a chain of the format string appearing in the subject - check
-		// to see if the format string is already the prefix of the subject.
-		TInt formatPosInSubject = KErrNotFound;
-
-		_LIT(KFormatStringSpecifier, "%S");
-		TInt formatPos = aSubjectFormat.Find(KFormatStringSpecifier);
-		if( formatPos > 0 )
-			{
-			// Look in current subject for the format string - avoid the '%'.
-			formatPosInSubject = aSubject.FindF(aSubjectFormat.Left(formatPos - 1));
-			}
-		
-		// Need to format the string if the format string is not at the start of
-		// the current subject.
-		if( formatPosInSubject != 0 )
-			{
-			// Create a buffer large enough to hold re-formated subject - need
-			// to subtract two from the prefix length (the %S).
-			length += aSubjectFormat.Length() - 2;
-			HBufC* buf = HBufC::NewLC(length);
-			TPtr ptr(buf->Des());
-			
-			// Format the reply subject and set in the email fields.
-			ptr.Format(aSubjectFormat, &aSubject);
-			aEmailFields->SetSubjectL(*buf);
-			
-			CleanupStack::PopAndDestroy(buf);
-			}
-		else
-			{
-			// Subject already contains the format string - use it.
-			aEmailFields->SetSubjectL(aSubject);
-			}
-		}
-	}
-	
-/**
-The email fields object for this message.
-
-@return
-The email fields object for this message.
-*/	
-EXPORT_C const CSmsEmailFields& CSmsHeader::EmailFields() const
-	{
-	return *iEmailFields;
-	}
-
-/** 
-Internalises the object from the specified stream.
-
-@param	aStream
-The stream to be read from.
-*/
-EXPORT_C void CSmsHeader::InternalizeL(RMsvReadStream& aStream)
-	{
-#if (!defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
-
-	aStream.ReadInt16L(); //version. Not used yet
-	
-	iRecipients.ResetAndDestroy();
-	TInt count=aStream.ReadInt32L();
-	while(count--)
-		{
-		CSmsNumber* recipient=CSmsNumber::NewL();  
-		CleanupStack::PushL(recipient);
-		recipient->InternalizeL(aStream);
-		iRecipients.AppendL(recipient);
-		CleanupStack::Pop(recipient);
-		}
-
-	iFlags = aStream.ReadUint32L();
-	iBioMsgIdType = (TBioMsgIdType) aStream.ReadInt8L();
-	iMessage->InternalizeWithoutBufferL(aStream);
-#else
-	iMessage->InternalizeWithoutBufferL(aStream);
-#endif
-	}
-
-/**
-Externalises the object to the specified stream.
-
-@param	aStream
-The stream to be writen to.
-*/
-EXPORT_C void CSmsHeader::ExternalizeL(RMsvWriteStream& aStream) const
-	{
-#if (!defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
-
-	aStream.WriteInt16L(KMsvSmsHeaderVersion);
-
-	TInt count=iRecipients.Count();
-	aStream.WriteInt32L(count);
-
-	for (TInt i=0; i<count; i++)
-		iRecipients[i]->ExternalizeL(aStream);
-
-	aStream.WriteUint32L(iFlags);
-	aStream.WriteInt8L(iBioMsgIdType);
-	iMessage->ExternalizeWithoutBufferL(aStream); 
-#else
-	iMessage->ExternalizeWithoutBufferL(aStream); 	
-#endif 	
-	}
-
-/**
-Restores the object from the message entry store.
-
-The SMS object is restored from the KUidMsvSMSHeaderStream in the supplied store.
- 
-@param	aStore
-The store from which the object is restored.
- 
-@leave	KErrNotFound
-The stream KUidMsvSMSHeaderStream does not exist in aStore.
-*/
-EXPORT_C void CSmsHeader::RestoreL(CMsvStore& aStore)
-	{
-#if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
-	ReStoreDBL(aStore);
-	RMsvReadStream in;
-	in.OpenLC(aStore,KUidMsvSMSHeaderStream);
-	InternalizeL(in);
-	CleanupStack::PopAndDestroy(&in);
-#else
-
-	RMsvReadStream in;
-	in.OpenLC(aStore,KUidMsvSMSHeaderStream);
-	InternalizeL(in);
-	CleanupStack::PopAndDestroy(&in);
-	
-	iEmailFields->RestoreL(aStore);
-	
-#endif 
-	}
-
-
-/**
-Stores the object in the message entry store.
-
-The object is written to the KUidMsvSMSHeaderStream stream. Any previous content
-is overwritten.
-
-@param	aStore
-The store to hold the stream into which the object is written.
-*/
-EXPORT_C void CSmsHeader::StoreL(CMsvStore& aStore) const
-	{
-#if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
-	StoreDbL(aStore);
-	RMsvWriteStream out;
-	out.AssignLC(aStore,KUidMsvSMSHeaderStream);
-	ExternalizeL(out);
-	out.CommitL();
-	CleanupStack::PopAndDestroy(&out);
-
-#else
-	RMsvWriteStream out;
-	out.AssignLC(aStore,KUidMsvSMSHeaderStream);
-	ExternalizeL(out);
-	out.CommitL();
-	CleanupStack::PopAndDestroy(&out);
-	
-	iEmailFields->StoreL(aStore);
-#endif
-	}
-
-
-/**
-Check  whether a CMsvStore contains an SMS header stream.
-
-@param aStore The store.
-@return ETrue if there is a   SMS header
-*/
-EXPORT_C TBool CSmsHeader::ContainsSmsHeaderL(const CMsvStore& aStore)
-    {
-    return aStore.IsPresentL(KUidMsvSMSHeaderStream);
-    }
-
-CSmsHeader::CSmsHeader(CSmsMessage* aSmsMessage)
-:	iRecipients(KSmcmRecipientsGranularity),
-	iMessage(aSmsMessage),
-	iFlags(ESmsHeaderNoFlags),
-	iBioMsgIdType(EBioMsgIdNbs),
-	iCloseFs(ETrue)
-	{
-	}
-
-void CSmsHeader::ConstructL(CSmsPDU::TSmsPDUType aType, CEditableText& aText)
-	{
-	User::LeaveIfError(iFs.Connect());
-	iMessage=CSmsMessage::NewL(iFs, aType, CSmsEditorBuffer::NewL(aText), EFalse);
-	iEmailFields = CSmsEmailFields::NewL();
-	}
-	
-void CSmsHeader::ConstructL(CSmsPDU::TSmsPDUType aType, CEditableText& aText, RFs& aFs)
-	{
-	iFs=aFs;
-	iCloseFs = EFalse;
-	iMessage=CSmsMessage::NewL(iFs, aType, CSmsEditorBuffer::NewL(aText), EFalse);
-	iEmailFields = CSmsEmailFields::NewL();
-	}
-
-void CSmsHeader::ConstructL()
-	{
-	iEmailFields = CSmsEmailFields::NewL();
-
-	// Check the PID of the SMS PDU to see if set for interworking with email.
-	CSmsPDU& pdu = Message().SmsPDU();
-	if( pdu.ProtocolIdentifierPresent() &&
-		pdu.PIDType() == TSmsProtocolIdentifier::ESmsPIDTelematicInterworking &&
-		pdu.TelematicDeviceIndicator() == TSmsProtocolIdentifier::ESmsTelematicDevice &&
-		pdu.TelematicDeviceType() == TSmsProtocolIdentifier::ESmsInternetElectronicMail )
-		{
-		__ASSERT_DEBUG( pdu.Type() == CSmsPDU::ESmsDeliver, User::Invariant() );
-		
-		// Ok, this is an email SMS - parse out the address and the optional 
-		// subject fields.
-		CSmsBufferBase& message = Message().Buffer();
-		TInt length = message.Length();
-		HBufC* buf = HBufC::NewLC(length);
-		TPtr bufPtr(buf->Des());
-		message.Extract(bufPtr, 0, length);
-		
-		TInt end = iEmailFields->ParseL(*buf);
-		
-		if( end > 0 )
-			{
-			TPtrC body((*buf).Mid(end));
-			message.Reset();
-			message.InsertL(0, body);
-			}
-		CleanupStack::PopAndDestroy(buf);
-		}
-	}
-
-void CSmsHeader::SetCanConcatenate(TBool aCanConcatenate)
-	{
-	iFlags = (iFlags & ~ESmsHeaderCanConcatenate) | (aCanConcatenate ? ESmsHeaderCanConcatenate : ESmsHeaderNoFlags);
-	}
-
-TBool CSmsHeader::CanConcatenate() const
-	{
-	return iFlags & ESmsHeaderCanConcatenate;
-	}
-
-/**
-Gets the summary information for the specified acknowledgement.
-
-If the specified acknowledgement is not recognised, then this function returns
-the default value of TMsvSmsEntryAckSummary::ENoAckSummary.
-nothing.
-
-@param
-aAckType	The requested acknowledgement summary.
-
-@return
-The acknowledgement summary information.
-
-@see
-TMsvSmsEntry::TMsvSmsEntryAckSummary
-*/
-EXPORT_C TMsvSmsEntry::TMsvSmsEntryAckSummary TMsvSmsEntry::AckSummary(TSmsAckType aAckType) const
-	{
-	TMsvSmsEntryAckSummary summary = ENoAckSummary;
-	switch( aAckType )
-		{
-	case ESmsAckTypeDelivery:
-		summary = static_cast<TMsvSmsEntryAckSummary>((iMtmData2 & EMsvSmsEntryDeliveryAckSummary) >> EMsvSmsEntryDeliveryAckSummaryShift);
-		break;
-	default:
-		// Use default summary - fail gracefully.
-		break;
-		}
-	return summary;
-	}
-
-/**
-Sets the summary information for the specified acknowlwdgement.
-
-If the specified acknowledgement is not recognised, then this function does
-nothing.
-
-@param
-aAckType	The acknowledgement summary to be set.
-
-@param
-aAckSummary	The summary information.
-
-@see
-TMsvSmsEntry::TMsvSmsEntryAckSummary
-*/
-EXPORT_C void TMsvSmsEntry::SetAckSummary(TSmsAckType aAckType, TMsvSmsEntryAckSummary aAckSummary)
-	{
-	switch( aAckType )
-		{
-	case ESmsAckTypeDelivery:
-		iMtmData2 = (iMtmData2 & ~EMsvSmsEntryDeliveryAckSummary) | ((aAckSummary << EMsvSmsEntryDeliveryAckSummaryShift) & EMsvSmsEntryDeliveryAckSummary);
-		break;
-	default:
-		// Do nothing - fail gracefully.
-		break;
-		}
-	}
-
-/**
-Gets the message log ID and a flag indicating if it is valid.
-
-The returned flag indicates whether the message log ID is valid. If it is valid
-then the message has only a single recipient that is pending a status report. In
-this case the returned message log ID refers to the recipient that is pending.
-
-If it is not valid then the message has more than one recipient that is pending 
-a status report. The message log ID should is not valid and should not be used.
-
-@param
-aMessageId	An output argument for the message log ID.
-
-@return
-A flag indicating whether the message log ID aMessageId is valid or not.
-*/
-EXPORT_C TBool TMsvSmsEntry::MessageId(TInt32& aMessageId) const
-	{
-	aMessageId = iMtmData3;
-	return iMtmData2 & EMsvSmsMessageValid;
-	}
-
-/**
-Sets the message log ID and a flag indicating if it is valid.
-
-If the message has only a single recipient that is pending a status report then
-the message log ID for that recipient can be set in the index. The flag must be
-set to true.
-
-If the message has more than one recipient that is pending a status report then
-the message log ID must not be used. The flag must be set to false.
-
-This functionality cannot be used with bio-messages. This function will panic if
-used with a bio-message.
-
-@param
-aMessageId	The message log ID. Should only be used if aIsValid is true. It has
-			a default value of zero.
-
-@param
-aIsValid	A flag indicating if the message log ID is valid. This should have
-			a value or true if the message has only a single recipient pending
-			a status report.
-			
-@panic	USER	0
-This message is a bio-message and therefore the message ID field cannot be used.
-*/
-EXPORT_C void TMsvSmsEntry::SetMessageId(TInt32 aMessageId, TBool aIsValid)
-	{
-	__ASSERT_ALWAYS( iBioType == 0, User::Invariant() );
-
-	aIsValid ? (iMtmData2 |= EMsvSmsMessageValid) : (iMtmData2 &= ~EMsvSmsMessageValid);
-	iMtmData3 = aMessageId;
-	}
-
-/** 
-Gets the reply to address if it exists, otherwise calls FromAddress().
-
-Only valid for SMS-DELIVER type messages. 
-@return
-The reply to address if it exists, otherwise the originator address as returned by FromAddress().
-*/	
-TPtrC CSmsHeader::ReplyAddressL() const
-	{
-	
-	if(Type()==CSmsPDU::ESmsDeliver)
-		{
-		//Check for a reply address field
-		CSmsReplyAddressOperations& operations = STATIC_CAST(CSmsReplyAddressOperations&,Message().GetOperationsForIEL(CSmsInformationElement::ESmsReplyAddressFormat));
-		if(!operations.ContainsReplyAddressIEL())
-			{
-			//if there is no reply to field call FromAddress()
-			return FromAddress();	
-			}	
-		//return the reply to address
-		HBufC* replyAddressHBuf=operations.GetReplyAddressL();
-		return replyAddressHBuf->Des();			
-		}	
-	else
-		{
-		return FromAddress();		
-		}
-	}
-
-#if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
-
-/**
-Stores the object in the message entry store in SQL DB.
-
-The object is written to the KUidMsvSMSHeaderStream stream. Any previous content
-is overwritten.
-
-@param	aStore
-The store to hold the stream into which the object is written.
-*/
-
-void CSmsHeader::StoreDbL(CMsvStore& aStore) const
-	{
-	_LIT(KDetails,"");
-	
-	CHeaderFields* smsHeaderFields = new(ELeave) CHeaderFields();
-	CleanupStack::PushL(smsHeaderFields);
-	smsHeaderFields->iUid = KUidMsvSMSHeaderStream;
-	
-	// 1. Header version field.
-	CFieldPair* smsHeaderVersionfield = new(ELeave) CFieldPair();
-	CleanupStack::PushL(smsHeaderVersionfield);
-	smsHeaderVersionfield->iFieldNumValue = KMsvSmsHeaderVersion;
-	smsHeaderFields->iFieldPairList.AppendL(smsHeaderVersionfield);
-	CleanupStack::Pop(smsHeaderVersionfield);
-	
-	// 2. Recipient count field.
-	CFieldPair* smsRecipientCountField = new(ELeave) CFieldPair();
-	CleanupStack::PushL(smsRecipientCountField);
-	smsRecipientCountField->iFieldNumValue = iRecipients.Count();
-	smsHeaderFields->iFieldPairList.AppendL(smsRecipientCountField);
-	CleanupStack::Pop(smsRecipientCountField);
-	
-	// 3. Recipients field.
-	TInt size = 0;	
-	for (TInt i=0; i < iRecipients.Count(); i++)
-		{
-		size += sizeof(CMsvRecipient::TRecipientStatus);
-		size += 16;		// CMsvRecipient::iError (4), iRetries(4) and iTime (8)
-		size += Align4(iRecipients[i]->Address().Size());	// CSmsNumber::iNumber
-		size += Align4(iRecipients[i]->Name().Size());		// CSmsNumber::iName
-		size += sizeof(TLogId);								// CSmsNumber::iLogId
-		size += sizeof(CSmsNumber::TSmsAckStatus);			// CSmsNumber::iDeliveryStatus
-		size += 10;											// For delimiters
-		}
-
-	RBuf recipients;
-	CleanupClosePushL(recipients);
-	recipients.CreateL(size);
-
-	for (TInt i=0; i<iRecipients.Count(); i++)
-		{		
-		recipients.AppendNum(iRecipients[i]->Status()); //0
-		recipients.Append(KComma);
-		recipients.AppendNum(iRecipients[i]->Error()); //1
-		recipients.Append(KComma);
-		recipients.AppendNum(iRecipients[i]->Retries()); //2
-		recipients.Append(KComma);
-		recipients.AppendNum(iRecipients[i]->Time().Int64()); //3
-		recipients.Append(KComma);
-	
-		recipients.Append(iRecipients[i]->Address()); //4
-		recipients.Append(KComma);
-		recipients.Append(iRecipients[i]->Name()); //5
-		recipients.Append(KComma);
-		recipients.AppendNum(iRecipients[i]->LogId()); //6
-		recipients.Append(KComma);
-		recipients.AppendNum(iRecipients[i]->AckStatus(ESmsAckTypeDelivery)); //7
-		recipients.Append(KDelimiter);
-		}
-		
-	CFieldPair* smsRecipientsField = new(ELeave) CFieldPair();
-	CleanupStack::PushL(smsRecipientsField);
-	smsRecipientsField->iFieldTextValue = recipients.AllocL();
-	smsHeaderFields->iFieldPairList.AppendL(smsRecipientsField);
-				
-	CleanupStack::Pop(smsRecipientsField);	// smsRecipientsField
-	CleanupStack::PopAndDestroy();			// recipients
-
-	// 4. SMS Flag
-	CFieldPair* smsSmsFlags = new(ELeave) CFieldPair();
-	CleanupStack::PushL(smsSmsFlags);
-	smsSmsFlags->iFieldNumValue = iFlags;
-	smsHeaderFields->iFieldPairList.AppendL(smsSmsFlags);
-	CleanupStack::Pop(smsSmsFlags);
-	
-	// 5. BIO Msg Id
-	CFieldPair* smsBioMsgIdType = new(ELeave) CFieldPair();
-	CleanupStack::PushL(smsBioMsgIdType);
-	smsBioMsgIdType->iFieldNumValue = iBioMsgIdType;
-	smsHeaderFields->iFieldPairList.AppendL(smsBioMsgIdType);
-	CleanupStack::Pop(smsBioMsgIdType);
-	
-			
-	CFieldPair* smsdetailField = new (ELeave)CFieldPair();
-	CleanupStack::PushL(smsdetailField);
-	smsdetailField->iFieldName =  KDetails().AllocL();
-	smsdetailField->iFieldType = ETextField;
-	smsdetailField->iFieldTextValue = KNullDesC().AllocL();
-	smsHeaderFields->iFieldPairList.AppendL(smsdetailField);
-	CleanupStack::Pop(smsdetailField);
-
-	TMsvWriteStore storeWriter(aStore);
-	storeWriter.AssignL(smsHeaderFields);
-	storeWriter.CommitL();
-	
-	CleanupStack::Pop(smsHeaderFields);
-	
-	// 6.  SMS-Email UID
-	// 7.  SMS-EMail HeaderVersion
-	// 8.  Subject
-	// 9.  AddressCount
-	// 10. Addresses
-
-	iEmailFields->StoreDBL(aStore);	
-	
-	}
-
-/**
-Restores the object from the message entry store in SQL DB.
-
-The SMS object is restored from the KUidMsvSMSHeaderStream in the supplied store.
- 
-@param	aStore
-The store from which the object is restored.
- 
-@leave	KErrNotFound
-The stream KUidMsvSMSHeaderStream does not exist in aStore.
-*/	
-	
-void CSmsHeader::ReStoreDBL(CMsvStore& aStore)	
-	{
-	
-	CHeaderFields* rcvHeaderRow = NULL;
-	TMsvReadStore storeReader(aStore, KUidMsvSMSHeaderStream);
-	storeReader.LoadL(rcvHeaderRow);
-
-	
-	iRecipients.ResetAndDestroy();
-	
-	TInt i = 0;
-	CFieldPair* rcvHeader = rcvHeaderRow->iFieldPairList[i];
-
-	TInt16 headerversion = rcvHeaderRow->iFieldPairList[i++]->iFieldNumValue; // header version.
-	TInt count = rcvHeaderRow->iFieldPairList[i++]->iFieldNumValue;
-	
-	HBufC* 	receipientList = rcvHeaderRow->iFieldPairList[i++]->iFieldTextValue->Des().AllocL();
-	CleanupStack::PushL(receipientList);
-	
-	TPtrC receipientListPtr = receipientList->Des();
-	GetRecipientL(receipientListPtr);
-
-	iFlags  = rcvHeaderRow->iFieldPairList[i++]->iFieldNumValue;
-	iBioMsgIdType = (TBioMsgIdType)rcvHeaderRow->iFieldPairList[i++]->iFieldNumValue ;
-
-	CleanupStack::PopAndDestroy(receipientList);
-	
-	iEmailFields->ReStoreDBL(aStore);
-	
-	}
-
-/**
-Get the recipient strring and Create the recipient.
-
-@param : aRecipientStr A TPtrC16.
-@return None.
-*/
-void CSmsHeader::GetRecipientL(TDesC16& aRecipientStrList)
-	{
-	TPtrC16 aRecipientStr = aRecipientStrList.Left(aRecipientStrList.Length());
-	
-	if(aRecipientStr.Length()>0)
-		{
-		RArray<TPtrC16> smsNumberData;
-		TInt startPos = 0;
-		TInt firstSemiColonPos = aRecipientStr.Locate(';');
-		TInt lastSemiColonPos = aRecipientStr.LocateReverse(';');
-				
-		do
-			{
-			CSmsNumber* recipientNumber=CSmsNumber::NewL();  
-			TPtrC16 str1 = aRecipientStr.Left(firstSemiColonPos+1); // First recipient
-			startPos = str1.Locate(',') ;
-			
-			while(startPos != KErrNotFound )
-				{
-				TPtrC16 str2 = str1.Left(startPos);
-				smsNumberData.Append(str2);
-				
-				startPos++;
-				str1.Set(str1.Mid(startPos, str1.Length()- startPos));
-			
-				startPos = str1.Locate(',');
-				if(startPos == KErrNotFound)
-					{
-					TPtrC16 str3;
-					str3.Set(str1.Mid(0,str1.Length()-1));
-					smsNumberData.Append(str3);
-					break;
-					}
-					
-				}
-		
-			recipientNumber->SetStatus((CMsvRecipient::TRecipientStatus)ConvertToTInt(smsNumberData[0]));
-			recipientNumber->SetError(ConvertToTInt(smsNumberData[1]));
-			recipientNumber->SetRetries(ConvertToTInt(smsNumberData[2]));
-			TInt64 time = ConvertToTInt(smsNumberData[3]);
-			recipientNumber->SetTimeValue(time);
-			
-			//CSmsNumber	
-			recipientNumber->SetAddressL(smsNumberData[4]);
-			recipientNumber->SetNameL(smsNumberData[5]);
-			
-			TLex logId(smsNumberData[6]);
-			TInt32 logIdNum;
-			logId.Val(logIdNum);
-			recipientNumber->SetLogId(logIdNum);	
-			
-			TLex ackStatus(smsNumberData[7]);
-			TInt32 ackStatusNum;
-			recipientNumber->SetAckStatus( (TSmsAckType) ackStatus.Val(ackStatusNum), CSmsNumber::ENoAckRequested);
-				
-			iRecipients.AppendL(recipientNumber);
-			smsNumberData.Reset();
-			
-			if(firstSemiColonPos != lastSemiColonPos)
-				{
-				aRecipientStr.Set(aRecipientStr.Mid(firstSemiColonPos+1,aRecipientStr.Length()-firstSemiColonPos-1));
-				firstSemiColonPos = aRecipientStr.Locate(';');
-				lastSemiColonPos = aRecipientStr.LocateReverse(';');
-				}
-			else	
-				{
-				break;	
-				}
-								
-			}while(1);
-		
-		smsNumberData.Close();				
-		}		
-	}
-
-
-/**
- * Convert a String to an Integer.
- * @param aStr A string to make Integer.
- * @return TInt A integer value 
- */
- TInt CSmsHeader::ConvertToTInt(TDesC16& aStr)
-	{
-	TLex str(aStr);
-	TInt32 string;
-	str.Val(string);
-	return string;
-	}
-
-#endif
--- a/messagingappbase/smsmtm/clientmtm/src/SMUTSET.CPP	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,849 +0,0 @@
-// Copyright (c) 1999-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 <etelmm.h>
-#include "SMCMMAIN.H"
-#include "SMUTSET.H"
-
-#include <commsdattypesv1_1.h>
-#include <commsdat.h>
-#include <txtetext.h>
-#include <csmsemailfields.h>
-#include <logwraplimits.h>
-using namespace CommsDat;
-
-
-
-// Compile time check to see if the enums RMobileSmsMessaging::TMobileSmsBearer and CSmsSettings::TMobileSmsBearer
-// are equivalent.
-
-#undef C_ASSERT
-#define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1]
-
-C_ASSERT(RMobileSmsMessaging::ESmsBearerPacketOnly==CSmsSettings::ESmsBearerPacketOnly);
-C_ASSERT(RMobileSmsMessaging::ESmsBearerCircuitOnly==CSmsSettings::ESmsBearerCircuitOnly);
-C_ASSERT(RMobileSmsMessaging::ESmsBearerPacketPreferred==CSmsSettings::ESmsBearerPacketPreferred);
-C_ASSERT(RMobileSmsMessaging::ESmsBearerCircuitPreferred==CSmsSettings::ESmsBearerCircuitPreferred);
-
-const TInt16 KMsgFileSmsMessageSettingsVersion	= 1;
-const TInt16 KMsgFileSmsNumberVersion			= 2;
-const TInt KSmcmSCAddressGranularity			= 8;
-
-
-/**
-Constructor.
-*/
-CSmsMessageSettings::CSmsMessageSettings()
-:	CBase(),
-	iValidityPeriodFormat(TSmsFirstOctet::ESmsVPFSemiOctet)
-	{
-	}
-
-/** 
-Internalises the settings from a read stream.
-
-@param	aReadStream
-The stream from which the settings should be internalised.
-*/
-EXPORT_C void CSmsMessageSettings::InternalizeL(RReadStream& aReadStream)
-	{
-	aReadStream.ReadInt16L(); // version - not used yet
-
-	iValidityPeriod		= aReadStream.ReadInt32L();
-	iValidityPeriodFormat = (TSmsFirstOctet::TSmsValidityPeriodFormat) aReadStream.ReadInt8L();
-	iAlphabet			= (TSmsDataCodingScheme::TSmsAlphabet) aReadStream.ReadInt16L();
-	iMsgFlags			= aReadStream.ReadUint32L();
-	iMessageConversion	= (TSmsPIDConversion) aReadStream.ReadInt16L();
-	}
-
-/** 
-Externalises the settings to a write stream.
-
-@param	aWriteStream
-The stream to which the settings should be externalised.
-*/
-EXPORT_C void CSmsMessageSettings::ExternalizeL(RWriteStream& aWriteStream) const
-	{
-	aWriteStream.WriteInt16L(KMsgFileSmsMessageSettingsVersion);
-	aWriteStream.WriteInt32L(iValidityPeriod.Int());
-	aWriteStream.WriteInt8L(iValidityPeriodFormat);
-	aWriteStream.WriteInt16L(iAlphabet);
-	aWriteStream.WriteUint32L(iMsgFlags);
-	aWriteStream.WriteInt16L(iMessageConversion);
-	}
-
-/** 
-Copies the settings stored in the specified object into this object.
-
-@param	aSettings
-The settings to be copied.
-*/
-EXPORT_C void CSmsMessageSettings::CopyL(const CSmsMessageSettings& aSettings)
-    {
-	iMsgFlags			= aSettings.iMsgFlags;
-	iMessageConversion	= aSettings.iMessageConversion;
-	iAlphabet			= aSettings.iAlphabet;
-	SetValidityPeriod(aSettings.ValidityPeriod());
-	SetValidityPeriodFormat(aSettings.ValidityPeriodFormat());
-    }
-
-/**
-Returns SMS message settings flag
-
-@return
-SMS message settings flag
-*/     
-TUint32 CSmsMessageSettings::MessageFlags() const
-	{
-	return iMsgFlags;
-	}
-
-/**
-Sets SMS message settings flag
-
-@param aMsgFlags
-SMS message settings flag
-*/   
-void CSmsMessageSettings::SetMessageFlags(TUint32 aMsgFlags)
-	{
-	iMsgFlags = aMsgFlags;
-	}
-
-/*
- * CSmsSettings
- */
-
-/** 
-Allocates and constructs an SMS settings object.
-
-Initialises all member data to their default values.
-
-@return
-The newly constructed SMS settings object.
-*/
-EXPORT_C CSmsSettings* CSmsSettings::NewL()
-	{
-	CSmsSettings* self = CSmsSettings::NewLC();
-	CleanupStack::Pop(self); 
-	return self;
-	}
-
-/** 
-Allocates and constructs an SMS settings object.
-
-Initialises all member data to their default values.
-
-@return
-The newly constructed SMS settings object.
-*/
-EXPORT_C CSmsSettings* CSmsSettings::NewLC()
-	{
-	CSmsSettings* self = new (ELeave) CSmsSettings();
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	return self;
-	}
-
-/**
-Constructor.
-*/
-CSmsSettings::CSmsSettings()
-:	CSmsMessageSettings(),
-	iDefaultSC(-1),
-	iStatusReportHandling(EDoNotWatchForReport),
-	iSpecialMessageHandling(EDoNotWatchForReport),
-	iCommDbAction(ENone),
-	iSmsBearerAction(ENone),
-	iSmsBearer(ESmsBearerCircuitPreferred),
-	iClass2Folder(KMsvGlobalInBoxIndexEntryId),
-	iDescriptionLength(KSmsDescriptionLength)
-	{		
-	}
-
-/** 
-Destructor. 
-*/
-EXPORT_C CSmsSettings::~CSmsSettings()
-	{
-	if (iServiceCenters)
-		{
-		iServiceCenters->ResetAndDestroy();
-	    delete iServiceCenters;
-		}
-	}
-
-/**
-Second phase construction.
-*/
-void CSmsSettings::ConstructL()
-	{
-	iServiceCenters = new (ELeave) CArrayPtrFlat<CSmsServiceCenter>(KSmcmSCAddressGranularity);
-	}
-
-
-void CSmsSettings::StoreToCommDbL() const
-	{
-	if (iCommDbAction != EStoreToCommDb && iSmsBearerAction != EStoreToCommDb)
-		return; // nothing to store to the Comm DB
-	
-	CMDBSession *dbSession = CMDBSession::NewL(CMDBSession::LatestVersion());	
-	CleanupStack::PushL(dbSession);	
-	CMDBRecordSet<CCDGlobalSettingsRecord> globalSettingsRecord(KCDTIdGlobalSettingsRecord);
-	TRAPD(err, globalSettingsRecord.LoadL(*dbSession));
-	if(err != KErrNone)
-		{
-		User::Leave(KErrNotFound);				
-		}	
-
-	if (iCommDbAction == EStoreToCommDb)
-		{
-		CCDModemBearerRecord *modemRecord = (CCDModemBearerRecord*)(CCDRecordBase::RecordFactoryL(KCDTIdModemBearerRecord));		
-		CleanupStack::PushL(modemRecord);
-		modemRecord->SetRecordId(((CCDGlobalSettingsRecord*)globalSettingsRecord.iRecords[0])->iModemForPhoneServicesAndSMS); 
-		modemRecord->LoadL(*dbSession);
-
-		if (iDefaultSC > -1 && iServiceCenters->Count())
-			{
-			const TPtrC address = GetServiceCenter(iDefaultSC).Address();			
-			modemRecord->iMessageCentreNumber.SetMaxLengthL(address.Length());
-			modemRecord->iMessageCentreNumber = address;
-			}
-		else
-			{			
-			modemRecord->iMessageCentreNumber = KNullDesC;
-			}
-
-		const TUint32 valPeriod = (TUint32) ValidityPeriod().Int();		
-		modemRecord->iMessageValidityPeriod = valPeriod;
-		
-		const TBool delReport = DeliveryReport() ? ETrue : EFalse;		
-		modemRecord->iMessageDeliveryReport = delReport;		
-		modemRecord->ModifyL(*dbSession);
-		CleanupStack::PopAndDestroy(modemRecord);
-		}
-
-	if (iSmsBearerAction == EStoreToCommDb)				
-		{
-		((CCDGlobalSettingsRecord*)globalSettingsRecord.iRecords[0])->iSMSBearer = iSmsBearer;
-		((CCDGlobalSettingsRecord*)globalSettingsRecord.iRecords[0])->iSMSBearer.ModifyL(*dbSession);		
-		}
-		
-	CleanupStack::PopAndDestroy(dbSession);
-	}
-
-
-/** 
-Gets the number of Service Centre addresses stored in this object.
-
-@return
-The number of addresses.
-*/   
-EXPORT_C TInt CSmsSettings::ServiceCenterCount() const
-	{
-	return iServiceCenters->Count();
-	}
-
-/** 
-Gets the Service Centre address at the specified index in the list.
-
-@param	aIndex
-The index of the specified address.
-
-@return
-The indexed address. 
-*/
-EXPORT_C CSmsServiceCenter& CSmsSettings::GetServiceCenter(TInt aIndex) const
-	{
-	return *iServiceCenters->At(aIndex);	
-	}
-
-/**
-Appends a service centre address (name and number) to the list.
-
-@param	aName
-The Service Centre name
-
-@param	aNumber
-The Service Centre number.
-*/	
-EXPORT_C void CSmsSettings::AddServiceCenterL(const TDesC& aName,const TDesC& aNumber)
-	{
-	
-	CSmsServiceCenter* recipient=CSmsServiceCenter::NewL();
-	CleanupStack::PushL(recipient);
-	recipient->SetNameL(aName);
-	recipient->SetAddressL(aNumber);
-
-	iServiceCenters->AppendL(recipient);
-	CleanupStack::Pop(recipient);
-
-	if (iServiceCenters->Count() == 1 || iDefaultSC < 0)
-		iDefaultSC = 0;	
-	}
-
-/** 
-Removes the service centre address with index aIndex from the array of service 
-centre addresses that are stored in the object. 
-
-@param	aIndex
-The index of the Service Centre address to remove. 
-*/
-EXPORT_C void CSmsSettings::RemoveServiceCenter(TInt aIndex)
-	{
-	delete iServiceCenters->At(aIndex);
-	iServiceCenters->Delete(aIndex);
-
-	if (iDefaultSC == aIndex)
-		{
-		iDefaultSC = iServiceCenters->Count() ? 0 : -1;
-		}
-	else if (iDefaultSC > aIndex)
-		{
-		iDefaultSC--;
-		}	
-	}
-
-/**
-Gets the index of the default service centre address for this service.
-
-@return
-The index of the default service centre address.
-*/	
-EXPORT_C TInt CSmsSettings::DefaultServiceCenter() const
-	{
-	return iDefaultSC;
-	}
-
-/** 
-Sets the index of the default service centre address for this service.
-
-@param	aDefaultSC
-An index into the list of the default service centre address.
-
-@panic	SMCM	7
-The specified index is negative or beyond the maximum index (debug only).
-*/	
-EXPORT_C void CSmsSettings::SetDefaultServiceCenter(TInt aDefaultSC)
-	{
-	__ASSERT_DEBUG(aDefaultSC>=0, Panic(ESmscDefaultSCOutOfRange));
-	__ASSERT_DEBUG(aDefaultSC<iServiceCenters->Count(), Panic(ESmscDefaultSCOutOfRange));
-
-	iDefaultSC=aDefaultSC;
-	}
-
-void CSmsSettings::RemoveSCAddresses()
-	{
-	iServiceCenters->ResetAndDestroy();
-	}
-
-/**
-Copies the SMS settings stored in the specified object into this object.
-
-@param	aSmsSettings
-The SMS Settings to be copied.
-*/
-EXPORT_C void CSmsSettings::CopyL(const CSmsSettings& aSmsSettings)
-    {
-	CSmsMessageSettings::CopyL(aSmsSettings);
-
-    iServiceCenters->ResetAndDestroy();
-	const TInt count = aSmsSettings.ServiceCenterCount();
-    for (TInt i=0; i < count; i++)
-        {
-        CSmsServiceCenter* scNumber = CSmsServiceCenter::NewL(aSmsSettings.GetServiceCenter(i));
-		CleanupStack::PushL(scNumber);
-        iServiceCenters->AppendL(scNumber);
-		CleanupStack::Pop(scNumber);
-        }
-
-	iDelivery				= aSmsSettings.iDelivery;
-	iDefaultSC				= aSmsSettings.iDefaultSC;
-	iSpecialMessageHandling	= aSmsSettings.iSpecialMessageHandling;
-	iStatusReportHandling	= aSmsSettings.iStatusReportHandling;
-	iSetFlags				= aSmsSettings.iSetFlags;
-	iCommDbAction			= aSmsSettings.iCommDbAction;
-	iSmsBearerAction		= aSmsSettings.iSmsBearerAction;
-	iSmsBearer				= aSmsSettings.iSmsBearer;
-	iClass2Folder			= aSmsSettings.iClass2Folder;
-	iDescriptionLength		= aSmsSettings.iDescriptionLength;
-    }
-   
-/**
-Returns SMS settings flag
-
-@return
-SMS settings flag
-*/  
-TUint32 CSmsSettings::SettingsFlags() const
-	{
-	return iSetFlags;
-	}
-
-/**
-Sets SMS settings flag
-
-@param aSetFlags
-SMS settings flag
-*/  
-void CSmsSettings::SetSettingsFlags(TUint32 aSetFlags)
-	{
-	iSetFlags = aSetFlags;
-	}    
-
-/*
- * CSmsNumber
- */
- 
-/**
-Creates and allocates a new CSmsNumber object.
-
-@return
-The new object.
-*/
-EXPORT_C CSmsNumber* CSmsNumber::NewL()
-	{
-	return new(ELeave) CSmsNumber();
-	}
-
-/** 
-Creates and allocates a new CSmsNumber object, copying an existing object.
-
-@param	aSmsNumber
-The object to be copied.
-
-@return
-The new object.
-*/
-EXPORT_C CSmsNumber* CSmsNumber::NewL(const CSmsNumber& aSmsNumber)
-	{
-	CSmsNumber* number=new(ELeave) CSmsNumber();
-	CleanupStack::PushL(number);
-	number->CopyL(aSmsNumber);
-	CleanupStack::Pop(number);
-	return number;
-	}
-
-/**
-Destructor.
-*/
-EXPORT_C CSmsNumber::~CSmsNumber()
-	{
-	delete iNumber;
-	delete iName;
-	}
-
-/**
-Internalises the object from a read stream.
-
-@param	aStream
-The stream from which the object should be internalised.
-*/
-EXPORT_C void CSmsNumber::InternalizeL( RReadStream& aStream)
-	{
-	TInt16 version = aStream.ReadInt16L();
-
-	CMsvRecipient::InternalizeL(aStream);
-
-	HBufC* number = HBufC::NewL(aStream, KSmcmSmsNumberMaxNumberLength);
-	delete iNumber;
-	iNumber = number;
-
-	HBufC* name = HBufC::NewL(aStream, KSmcmSmsNumberMaxNameLength);
-	delete iName;
-	iName = name;
-
-	iLogId = aStream.ReadInt32L();
-
-	if( version >= 2 )
-		{
-		iDeliveryStatus = (TSmsAckStatus) aStream.ReadInt8L();
-		}
-	else
-		{
-		iDeliveryStatus = ENoAckRequested;
-		}
-	}
-
-/**
-Externalises the object to a write stream.
-
-@param	aStream
-The stream to which the object should be externalised.
-*/
-EXPORT_C void CSmsNumber::ExternalizeL( RWriteStream& aStream) const
-	{
-	aStream.WriteInt16L(KMsgFileSmsNumberVersion);
-
-	CMsvRecipient::ExternalizeL(aStream);
-
-	aStream << Address();
-	aStream << Name();
-
-	aStream.WriteInt32L(iLogId);
-	aStream.WriteInt8L(iDeliveryStatus);
-	}
-
-/**
-Constructor.
-*/
-CSmsNumber::CSmsNumber()
-: iLogId(KLogNullId)
-	{
-	}
-
-/**
-Copies settings from another CSmsNumber object.
-
-@param	aSmsNumber
-The object to be copied.
-
-@return
-This object with the updated settings.
-*/
-EXPORT_C CSmsNumber& CSmsNumber::CopyL(const CSmsNumber& aSmsNumber)
-	{
-	SetNameL(aSmsNumber.Name());
-	SetAddressL(aSmsNumber.Address());
-	SetLogId(aSmsNumber.LogId());
-	SetAckStatus(ESmsAckTypeDelivery, aSmsNumber.AckStatus(ESmsAckTypeDelivery));
-    return *this;
-	}
-
-/**
-Gets the recipient address.
-
-The address is a telephone number. It is limited to a maximum length specified
-by KSmcmSmsNumberMaxNumberLength.
-
-@see	KSmcmSmsNumberMaxNumberLength
-
-@return	
-A descriptor with the recipient address.
-*/
-EXPORT_C TPtrC CSmsNumber::Address() const
-	{
-	TPtrC number = iNumber ? iNumber->Des() : TPtrC();
-	return number;
-	}
-
-/** 
-Gets the recipient name.
-
-@return
-A descriptor with the recipient name.
-*/
-EXPORT_C TPtrC CSmsNumber::Name() const
-	{
-	TPtrC name = iName ? iName->Des() : TPtrC();
-	return name;
-	}
-
-/**
-Sets the recipient address.
-
-The address is a telephone number. It is limited to a maximum length specified
-by KSmcmSmsNumberMaxNumberLength.
-
-@see	KSmcmSmsNumberMaxNumberLength
-
-@param	aAddress
-The recipient address.
-*/
-EXPORT_C void CSmsNumber::SetAddressL(const TDesC& aAddress)
-	{
-	TPtrC clippedNumber = LimitStringSize(aAddress, KSmcmSmsNumberMaxNumberLength);
-	HBufC* number = clippedNumber.AllocL();
-	delete iNumber;
-	iNumber = number;
-	}
-
-/**
-Sets the recipient email address, The address here is a email address.
-
-@param	aAddress
-The recipient address.
-@param	aEmailFields
-Encapsulates the address fields for Email sent over SMS.
-@param	aAlias
-*/
-
-// For address information separation (start)
-const TUint KMsgSmsAddressStartChar         ('<');
-// For address information separation (end)
-const TUint KMsgSmsAddressEndChar           ('>');
-
-void CSmsNumber::SetEmailAddressL(const TDesC& aAddress, CSmsEmailFields* aEmailFields, const TDesC& aAlias)
-	{
-    if ( aAlias.Length() > 0 )
-        {
-        HBufC* aliasBuf = HBufC::NewLC( aAddress.Length() + aAlias.Length() + 3 );
-        TPtr aliasTPtr = aliasBuf->Des();
-        aliasTPtr.Append( aAlias );
-        aliasTPtr.Append( CEditableText::ESpace );
-        aliasTPtr.Append( KMsgSmsAddressStartChar );
-        aliasTPtr.Append( aAddress );
-        aliasTPtr.Append( KMsgSmsAddressEndChar );
-        aEmailFields->AddAddressL( aliasTPtr );
-       
-        CleanupStack::PopAndDestroy( aliasBuf );
-        }
-    else
-        {
-        aEmailFields->AddAddressL( aAddress );
-        }			
-	}
-
-/**
-Sets the recipient name.
-
-The name is limited to a maximum length specified by KSmcmSmsNumberMaxNameLength.
-
-@see	KSmcmSmsNumberMaxNameLength
-
-@param	aName
-The recipient name.
-*/
-EXPORT_C void CSmsNumber::SetNameL(const TDesC& aName)
-	{
-	TPtrC clippedName = LimitStringSize(aName, KSmcmSmsNumberMaxNameLength);
-	HBufC* name = clippedName.AllocL();
-	delete iName;
-	iName = name;
-	}
-
-/**
-Gets the delivery status for this recipient.
-
-@return
-The current delivery status for this recipient.
-
-@see	CSmsNumber::TSmsDeliveryStatus
-*/
-EXPORT_C CSmsNumber::TSmsAckStatus CSmsNumber::AckStatus(TSmsAckType aAckType) const
-	{
-	TSmsAckStatus status = ENoAckRequested;
-	switch( aAckType )
-		{
-	case ESmsAckTypeDelivery:
-		status = iDeliveryStatus;
-		break;
-	default:
-		// Use the default...
-		break;
-		}
-	return status;
-	}
-	
-/**
-Sets the delivery status for this recipient.
-
-@param
-aDeliveryStatus	The new delivery status for this recipient.
-
-@see	CSmsNumber::TSmsDeliveryStatus
-*/
-EXPORT_C void CSmsNumber::SetAckStatus(TSmsAckType aAckType, TSmsAckStatus aAckStatus)
-	{
-	switch( aAckType )
-		{
-	case ESmsAckTypeDelivery:
-		iDeliveryStatus = aAckStatus;
-		break;
-	default:
-		// Do nothing - fail gracefully
-		break;
-		}
-	}
-
-/**
-Returns a limited version of the input string.
-
-The output string is limited by the maximum length specified or the actual#
-length of the input string, withever is the shortest.
-
-@param	aString
-The input string to be limited.
-
-@param	aMaxLength
-The maximum length
-
-@return
-The input string limited by the shortest value between its original length or
-the maximum length specified.
-*/
-TPtrC CSmsNumber::LimitStringSize(const TPtrC& aString, TInt aMaxLength) const
-	{
-	if (aString.Length() <= aMaxLength)
-		return aString;
-	else
-		return aString.Left(aMaxLength);
-	}
-	
-/**
-Creates and allocates a new CSmsServiceCenter object.
-
-@return
-The new object.
-*/
-EXPORT_C CSmsServiceCenter* CSmsServiceCenter::NewL()
-	{
-	return new(ELeave) CSmsServiceCenter();
-	}
-
-/** 
-Creates and allocates a new CSmsServiceCenter object, copying an existing object.
-
-@param	CSmsServiceCenter
-The object to be copied.
-
-@return
-The new object.
-*/
-EXPORT_C CSmsServiceCenter* CSmsServiceCenter::NewL(const CSmsServiceCenter& aSmsSc)
-	{
-	CSmsServiceCenter* sc = new(ELeave) CSmsServiceCenter();
-	CleanupStack::PushL(sc);
-	sc->CopyL(aSmsSc);
-	CleanupStack::Pop(sc);
-	return sc;
-	}
-
-/**
-Destructor.
-*/
-EXPORT_C CSmsServiceCenter::~CSmsServiceCenter()
-	{
-	delete iNumber;
-	delete iName;
-	}
-	
-/**
-Constructor.
-*/
-CSmsServiceCenter::CSmsServiceCenter()
-	{
-	}
-
-/**
-Copies settings from another CSmsServiceCenter object.
-
-@param	aSmsSc
-The object to be copied.
-
-@return
-This object with the updated settings.
-*/
-EXPORT_C CSmsServiceCenter& CSmsServiceCenter::CopyL(const CSmsServiceCenter& aSmsSc)
-	{
-	SetNameL(aSmsSc.Name());
-	SetAddressL(aSmsSc.Address());
-    return *this;
-	}
-
-/**
-Gets the recipient address.
-
-The address is a telephone number. It is limited to a maximum length specified
-by KSmcmSmsNumberMaxNumberLength.
-
-@see	KSmcmSmsNumberMaxNumberLength
-
-@return	
-A descriptor with the recipient address.
-*/
-EXPORT_C TPtrC CSmsServiceCenter::Address() const
-	{
-	TPtrC number = iNumber ? iNumber->Des() : TPtrC();
-	return number;
-	}
-
-/** 
-Gets the recipient name.
-
-@return
-A descriptor with the recipient name.
-*/
-EXPORT_C TPtrC CSmsServiceCenter::Name() const
-	{
-	TPtrC name = iName ? iName->Des() : TPtrC();
-	return name;
-	}
-
-/**
-Sets the recipient address.
-
-The address is a telephone number. It is limited to a maximum length specified
-by KSmcmSmsNumberMaxNumberLength.
-
-@see	KSmcmSmsNumberMaxNumberLength
-
-@param	aAddress
-The recipient address.
-*/
-EXPORT_C void CSmsServiceCenter::SetAddressL(const TDesC& aAddress)
-	{
-	TPtrC clippedNumber = LimitStringSize(aAddress, KSmcmSmsNumberMaxNumberLength);
-	HBufC* number = clippedNumber.AllocL();
-	delete iNumber;
-	iNumber = number;
-	}
-
-/**
-Sets the recipient name.
-
-The name is limited to a maximum length specified by KSmcmSmsNumberMaxNameLength.
-
-@see	KSmcmSmsNumberMaxNameLength
-
-@param	aName
-The recipient name.
-*/
-EXPORT_C void CSmsServiceCenter::SetNameL(const TDesC& aName)
-	{
-	TPtrC clippedName = LimitStringSize(aName, KSmcmSmsNumberMaxNameLength);
-	HBufC* name = clippedName.AllocL();
-	delete iName;
-	iName = name;
-	}
-	
-/**
-Returns a limited version of the input string.
-
-The output string is limited by the maximum length specified or the actual#
-length of the input string, withever is the shortest.
-
-@param	aString
-The input string to be limited.
-
-@param	aMaxLength
-The maximum length
-
-@return
-The input string limited by the shortest value between its original length or
-the maximum length specified.
-*/
-TPtrC CSmsServiceCenter::LimitStringSize(const TPtrC& aString, TInt aMaxLength) const
-	{
-	if (aString.Length() <= aMaxLength)
-		{
-		return aString;
-		}
-	else
-		{
-		return aString.Left(aMaxLength);
-		}
-	}
-	
--- a/messagingappbase/smsmtm/clientmtm/src/csmsaccount.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,450 +0,0 @@
-// Copyright (c) 2004-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 <msvuids.h>
-#include <msvids.h>
-#include <msvschedulesettings.h>
-#include <msvoffpeaktime.h>
-#include <msvsenderroraction.h>
-#include <msvsysagentaction.h>
-#include <centralrepository.h>
-#include <tmsvschedulesettingsutils.h>
-
-#include "SMUTSET.H"
-#include <csmsaccount.h>
-#include <smut.h>
-
-#if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
-	#include <msvapi.h>
-#endif
-
-const TUint32 KIncrementSC = 0x00000010;
-const TInt KMaxSettingLength = 256;
-const TInt KMaxServiceCenterId = 256;
-const TInt KSmsSettingsVersion			= 1;
-const TInt KSmsMessageSettingsVersion	= 1;
-
-
-/** 
-Allocates and constructs an SMS account object.
-
-Initialises all member data to their default values.
-
-@return
-The newly constructed SMS account object.
-*/
-EXPORT_C CSmsAccount* CSmsAccount::NewL()
-	{
-	CSmsAccount* self = CSmsAccount::NewLC();
-	CleanupStack::Pop(self);	
-	return self;
-	}
-
-/** 
-Allocates and constructs an SMS account object.
-
-Initialises all member data to their default values.
-
-@return
-The newly constructed SMS account object.
-*/
-EXPORT_C CSmsAccount* CSmsAccount::NewLC()
-	{
-	CSmsAccount* self = new (ELeave) CSmsAccount();
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	return self;
-	}
-
-/**
-Second phase construction.
-*/
-void CSmsAccount::ConstructL()
-	{
-	iRepository = CRepository::NewL(KUidMsgTypeSMS);
-	}
-
-/**
-Constructor.
-*/
-CSmsAccount::CSmsAccount()
-	{
-	}
-
-/** 
-Destructor. 
-*/
-EXPORT_C CSmsAccount::~CSmsAccount()
-	{
-	delete iRepository;
-	delete iMsvSession;
-	}
-
-/**
-Initialises the SMS settings in CenRep:
-
-1. Creates a SMS service entry in the message store
-
-2. Resets the settings in CenRep to their default values
-
-3. Populates aSmsSettings with default settings
-
-@param	aSmsSettings
-SMS service settings
-*/
-EXPORT_C void CSmsAccount::InitialiseDefaultSettingsL(CSmsSettings& aSmsSettings)
-	{
-	ResetSettings();
-	CreateSmsServiceL();	
-	LoadSettingsL(aSmsSettings);
-	}
-
-/**
-Initialises the SMS settings in CenRep:
-
-1. Creates a SMS service entry in the message store
-
-2. Resets the settings in CenRep to their default values
-
-3. Populates the supplied objects with default settings
-
-@param	aScheduleSettings
-Schedule settings
-
-@param	aOffPeakTimes
-Off Peak Times
-
-@param	aErrorActions
-Send Error Actions
-
-@param	aSysAgentActions
-System Agent Actions
-*/
-EXPORT_C void CSmsAccount::InitialiseDefaultSettingsL(CMsvScheduleSettings& aScheduleSettings, CMsvOffPeakTimes& aOffPeakTimes, CMsvSendErrorActions& aErrorActions, CMsvSysAgentActions& aSysAgentActions)
-	{
-	ResetSettings();
-	CreateSmsServiceL();	
-	LoadSettingsL(aScheduleSettings, aOffPeakTimes, aErrorActions, aSysAgentActions);
-	}
-
-/**
-Creates SMS service entry in the message store
-*/
-TMsvId CSmsAccount::CreateSmsServiceL()
-    {
-#if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
-	CreateHeaderStoreL();	
-#endif
-
-    TMsvId serviceEntryId = KMsvNullIndexEntryId;
-    CMsvEntry* root = SessionL().GetEntryL(KMsvRootIndexEntryId);
-    CleanupStack::PushL(root);
-    
-    TRAPD(error, TSmsUtilities::ServiceIdL(*root, serviceEntryId));
-    if (error == KErrNotFound)
-        {
-        TBuf<KMaxSettingLength> accountName;
-        User::LeaveIfError(iRepository->Get(ESmsAccountNameId, accountName));
-        
-	    TMsvEntry entry;
-	    entry.iMtm = KUidMsgTypeSMS;
-	    entry.iType = KUidMsvServiceEntry;
-	    entry.SetReadOnly(EFalse);
-        entry.SetVisible(EFalse);
-        entry.iDate.UniversalTime();
-        entry.iDetails.Set(accountName);
-        root->SetEntryL(KMsvRootIndexEntryId);
-        root->CreateL(entry);
-        serviceEntryId = entry.Id();
-        }
-    else
-        {
-		User::LeaveIfError(error);
-        }
-            
-    CleanupStack::PopAndDestroy(root);    
-        		
-	User::LeaveIfError(iRepository->Set(ESmsServiceId, static_cast<TInt>(serviceEntryId)));		
-    return serviceEntryId;
-    }
-    
-/**
-Resets the settings in CenRep to their default values.
-*/
-void CSmsAccount::ResetSettings()
-	{
-	iRepository->Reset();
-	}	
-
-/**
-Loads SMS Service settings from CenRep:
-
-@param	aSmsSettings
-Sms service settings
-*/
-EXPORT_C void CSmsAccount::LoadSettingsL(CSmsSettings& aSmsSettings)
-	{	
-	TInt temp = 0;
-				
-	//Load SMS Message Settings	
-	User::LeaveIfError(iRepository->Get(ESmsValidityPeriodId, temp));
-	aSmsSettings.SetValidityPeriod(TTimeIntervalMinutes(temp));
-
-	User::LeaveIfError(iRepository->Get(ESmsValidityPeriodFormatId, temp));
-	aSmsSettings.SetValidityPeriodFormat(static_cast<TSmsFirstOctet::TSmsValidityPeriodFormat>(temp));
-
-	User::LeaveIfError(iRepository->Get(ESmsAlphabetId, temp));
-	aSmsSettings.SetCharacterSet(static_cast<TSmsDataCodingScheme::TSmsAlphabet>(temp));
-
-	User::LeaveIfError(iRepository->Get(ESmsMsgFlagsId, temp));
-	aSmsSettings.SetMessageFlags(static_cast<TUint32>(temp));
-
-	User::LeaveIfError(iRepository->Get(ESmsMessageConversionId, temp));
-	aSmsSettings.SetMessageConversion(static_cast<TSmsPIDConversion>(temp));
-
-		
-	// Load SMS Service Settings
-	User::LeaveIfError(iRepository->Get(ESmsFlagsId, temp));
-	aSmsSettings.SetSettingsFlags(static_cast<TUint32>(temp));
-
-	User::LeaveIfError(iRepository->Get(ESmsStatusReportHandlingId, temp));
-	aSmsSettings.SetStatusReportHandling(static_cast<CSmsSettings::TSmsReportHandling>(temp));
-
-	User::LeaveIfError(iRepository->Get(ESmsSpecialMessageHandlingId, temp));
-	aSmsSettings.SetSpecialMessageHandling(static_cast<CSmsSettings::TSmsReportHandling>(temp));
-
-	User::LeaveIfError(iRepository->Get(ESmsCommDbActionId, temp));
-	aSmsSettings.SetCommDbAction(static_cast<CSmsSettings::TSmsSettingsCommDbAction>(temp));
-
-	User::LeaveIfError(iRepository->Get(ESmsDeliveryId, temp));
-	aSmsSettings.SetDelivery(static_cast<TSmsDelivery>(temp));
-	
-	aSmsSettings.RemoveSCAddresses();
-	User::LeaveIfError(iRepository->Get(ESmsSCAddressesCountId, temp));
-	TInt count = temp;
-
-	TUint32 scId = ESmsSCAddressesPartialId;	// 0x1000
-	TUint32 scFieldId = 0;
-	TBuf<KMaxSettingLength> scNumber;
-	TBuf<KMaxSettingLength> scName;
-	while(count--)
-		{
-		scFieldId = scId;			// 0x0 - address field
-		User::LeaveIfError(iRepository->Get(scFieldId, scNumber));
-
-		++scFieldId;	// 0x1 - name field, increment the last bit		
-		User::LeaveIfError(iRepository->Get(scFieldId, scName));				
-		
-		aSmsSettings.AddServiceCenterL(scName, scNumber);   
-		scId += KIncrementSC; // get the next SC in the list
-		}
-
-	if (aSmsSettings.ServiceCenterCount()>0)
-		{		
-		User::LeaveIfError(iRepository->Get(ESmsDefaultSCId, temp));
-		aSmsSettings.SetDefaultServiceCenter(temp);
-		}
-						
-	User::LeaveIfError(iRepository->Get(ESmsBearerActionId, temp));
-	aSmsSettings.SetSmsBearerAction(static_cast<CSmsSettings::TSmsSettingsCommDbAction>(temp));
-
-	User::LeaveIfError(iRepository->Get(ESmsBearerId, temp));
-	aSmsSettings.SetSmsBearer(static_cast<CSmsSettings::TMobileSmsBearer>(temp));
-
-	User::LeaveIfError(iRepository->Get(ESmsClass2FolderId, temp));
-	aSmsSettings.SetClass2Folder(static_cast<TMsvId>(temp));
-
-	User::LeaveIfError(iRepository->Get(ESmsDescriptionLengthId, temp));
-	aSmsSettings.SetDescriptionLength(temp);
-	TInt err = iRepository->Get(EMsgSMSTimeStampSettings, temp);
-	if(KErrNone == err )
- 		{
- 		aSmsSettings.SetUseServiceCenterTimeStampForDate(temp);
- 		}
-	}
-
-/**
-Loads Schedule Send settings from CenRep:
-
-@param	aScheduleSettings
-Schedule settings
-
-@param	aOffPeakTimes
-Off Peak Times
-
-@param	aErrorActions
-Send Error Actions
-
-@param	aSysAgentActions
-System Agent Actions
-*/
-EXPORT_C void CSmsAccount::LoadSettingsL(CMsvScheduleSettings& aScheduleSettings, CMsvOffPeakTimes& aOffPeakTimes, CMsvSendErrorActions& aErrorActions, CMsvSysAgentActions& aSysAgentActions)
-	{
-
-	TMsvScheduleSettingsUtils::LoadScheduleSettingsL(aScheduleSettings, *iRepository);
-	TMsvScheduleSettingsUtils::LoadOffPeakSettingsL(aOffPeakTimes, *iRepository);
-	TMsvScheduleSettingsUtils::LoadSendErrorSettingsL(aErrorActions, *iRepository);
-	TMsvScheduleSettingsUtils::LoadSysAgentSettingsL(aSysAgentActions, *iRepository);	
-	}
-
-/**
-Saves SMS Service settings to CenRep:
-
-@param	aSmsSettings
-Sms service settings
-*/
-EXPORT_C void CSmsAccount::SaveSettingsL(const CSmsSettings& aSmsSettings) const
-	{
-
-	User::LeaveIfError(iRepository->StartTransaction(CRepository::EReadWriteTransaction));
-	iRepository->CleanupRollbackTransactionPushL();
-	iRepository->Set(ESmsSettingsVersionId, KSmsSettingsVersion);  // Errors are ignored as the CenRep transaction fails on error.
-	
-	// Save SMS Message Settings¬
-	iRepository->Set(ESmsSettingsMesssageVersionId, KSmsMessageSettingsVersion);
-	iRepository->Set(ESmsValidityPeriodId, aSmsSettings.ValidityPeriod().Int());
-	iRepository->Set(ESmsValidityPeriodFormatId, static_cast<TInt>(aSmsSettings.ValidityPeriodFormat()));
-	iRepository->Set(ESmsAlphabetId, static_cast<TInt>(aSmsSettings.CharacterSet()));
-	iRepository->Set(ESmsMsgFlagsId, static_cast<TInt>(aSmsSettings.MessageFlags()));
-	iRepository->Set(ESmsMessageConversionId, static_cast<TInt>(aSmsSettings.MessageConversion()));
-	
-
-	// Save SMS Service Settings
-	iRepository->Set(ESmsFlagsId, static_cast<TInt>(aSmsSettings.SettingsFlags()));
-	iRepository->Set(ESmsStatusReportHandlingId, static_cast<TInt>(aSmsSettings.StatusReportHandling()));	
-	iRepository->Set(ESmsSpecialMessageHandlingId, static_cast<TInt>(aSmsSettings.SpecialMessageHandling()));		
-	iRepository->Set(ESmsCommDbActionId, static_cast<TInt>(aSmsSettings.CommDbAction()));
-	iRepository->Set(ESmsDeliveryId, static_cast<TInt>(aSmsSettings.Delivery()));
-	iRepository->Set(ESmsDefaultSCId, aSmsSettings.DefaultServiceCenter());
-
-	TInt count = aSmsSettings.ServiceCenterCount();	
-	__ASSERT_ALWAYS(count<=KMaxServiceCenterId, User::Leave(KErrOverflow));
-	iRepository->Set(ESmsSCAddressesCountId, count);
-
-	// Save list of SC
-	TUint32 scId = ESmsSCAddressesPartialId;	// 0x1000
-	TUint32 scFieldId = 0;
-	for(TInt loop=0; loop < count; ++loop)
-		{
-		scFieldId = scId;				// 0x0 - address field
-		iRepository->Set(scFieldId, aSmsSettings.GetServiceCenter(loop).Address());
-
-		++scFieldId;		// 0x1 - name field, increment the last bit
-		iRepository->Set(scFieldId, aSmsSettings.GetServiceCenter(loop).Name());
-				
-		scId += KIncrementSC;		// get the next SC in the list
-		}
-
-	iRepository->Set(ESmsBearerActionId, static_cast<TInt>(aSmsSettings.SmsBearerAction()));
-	iRepository->Set(ESmsBearerId, static_cast<TInt>(aSmsSettings.SmsBearer()));
-	iRepository->Set(ESmsClass2FolderId, static_cast<TInt>(aSmsSettings.Class2Folder()));
-	iRepository->Set(ESmsDescriptionLengthId, aSmsSettings.DescriptionLength());
-
-	TInt temp = 0;
- 	TInt err = iRepository->Get(EMsgSMSTimeStampSettings, temp);
- 	if(KErrNone == err )
- 		{
- 		temp =  (aSmsSettings.UseServiceCenterTimeStampForDate()) ? 1: 0;
-		iRepository->Set(EMsgSMSTimeStampSettings,temp);
- 		}
-	CleanupStack::Pop();
-	TUint32 errorId = 0;
-	User::LeaveIfError(iRepository->CommitTransaction(errorId));
-	
-	aSmsSettings.StoreToCommDbL();
-	}
-
-/**
-Saves Schedule Send settings to CenRep:
-
-@param	aScheduleSettings
-Schedule settings
-
-@param	aOffPeakTimes
-Off Peak Times
-
-@param	aErrorActions
-Send Error Actions
-
-@param	aSysAgentActions
-System Agent Actions
-*/
-EXPORT_C void CSmsAccount::SaveSettingsL(const CMsvScheduleSettings& aScheduleSettings, const CMsvOffPeakTimes& aOffPeakTimes, const CMsvSendErrorActions& aErrorActions, const CMsvSysAgentActions& aSysAgentActions) const
-	{
-	
-	User::LeaveIfError(iRepository->StartTransaction(CRepository::EReadWriteTransaction));
-	iRepository->CleanupRollbackTransactionPushL();
-
-	TMsvScheduleSettingsUtils::SaveScheduleSettingsL(aScheduleSettings, *iRepository);
-	TMsvScheduleSettingsUtils::SaveOffPeakSettingsL(aOffPeakTimes, *iRepository);
-	TMsvScheduleSettingsUtils::SaveSendErrorSettingsL(aErrorActions, *iRepository);
-	TMsvScheduleSettingsUtils::SaveSysAgentSettingsL(aSysAgentActions, *iRepository);	
-
-	CleanupStack::Pop();
-	TUint32 errorId = 0;
-	User::LeaveIfError(iRepository->CommitTransaction(errorId));
-	}
-
-CMsvSession& CSmsAccount::SessionL()
-	{
-	if (iMsvSession == NULL)
-		{
-		iMsvSession = CMsvSession::OpenSyncL(*this);		
-		}
-		
-	return *iMsvSession;	
-	}
-
-void CSmsAccount::HandleSessionEventL(TMsvSessionEvent aEvent, TAny* , TAny* , TAny* ) 
-    {
-  	if (aEvent == EMsvCloseSession)
-    	{
-		delete iMsvSession;
-		iMsvSession = NULL;
-    	}    	
-    }
-
-
-#if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
-/**
-* Send the header structure to message Server to create  header table.
-* @param  None.
-* @return  None.
-*/
-void CSmsAccount::CreateHeaderStoreL()
-	{
-	CMsvHeaderStore* aHeader = CMsvHeaderStore::NewL(KUidMsgTypeSMS ,SessionL());
-	CleanupStack::PushL(aHeader);
-	
-	_LIT (KSmsHeaderversion , "SmsHeadearversion");
-	aHeader->AddFieldL(KSmsHeaderversion().AllocL(),EIntegerField);
-
-	_LIT (KSmsRecipientCount , "RecipientCount");
-	aHeader->AddFieldL(KSmsRecipientCount().AllocL(),EIntegerField);
-	
-	_LIT (KRecipients , "To");
-	aHeader->AddFieldL(KRecipients().AllocL(),ETextField);
-	
-	_LIT (KSmsFlags , "SmsFlags");
-	aHeader->AddFieldL(KSmsFlags().AllocL(),EIntegerField);
-			
-	_LIT (KTextBioMsgIdType,"BioMsgIdType");
-	aHeader->AddFieldL(KTextBioMsgIdType().AllocL(),EIntegerField);
-	
-	aHeader->CreateStoreL();
-	CleanupStack::PopAndDestroy(aHeader);  //aHeader
-	}
-#endif
--- a/messagingappbase/smsmtm/clientmtm/src/csmsemailfields.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,816 +0,0 @@
-// Copyright (c) 2004-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 <csmsemailfields.h>
-
-#include <msvstore.h>
-
-const TInt KSmsEmailAddressesArrayGranularity	= 4;
-
-const TUid KUidMsvSmsEmailFieldsStream	= {0x10204C9D};
-const TInt KMsvSmsEmailFieldsVersion	= 1;
-const TUint8 KSmsEmailComma			= ',';
-const TUint8 KSmsEmailAtSign		= '@';
-const TUint8 KSmsEmailSpace 		= ' ';
-const TUint8 KSmsEmailOpenBracket	= '(';
-const TUint8 KSmsEmailCloseBracket	= ')';
-const TUint8 KSmsEmailHash			= '#';
-#if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
-_LIT16(KDelimiter, ";");
-_LIT16(KComma, ",");
-#endif
-/**
-Factory constructor.
-
-@return
-An empty email fields object.
-*/
-EXPORT_C CSmsEmailFields* CSmsEmailFields::NewL()
-	{
-	CSmsEmailFields* self = new (ELeave) CSmsEmailFields();
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-/**
-Factory copy constructor.
-
-@param	aEmailFields
-The orginal email fields object from which a copy is made.
-
-@return
-A copy of aEmailFields.
-*/
-EXPORT_C CSmsEmailFields* CSmsEmailFields::NewL(const CSmsEmailFields& aEmailFields)
-	{
-	CSmsEmailFields* self = new (ELeave) CSmsEmailFields();
-	CleanupStack::PushL(self);
-	self->ConstructL(aEmailFields);
-	CleanupStack::Pop(self);
-	return self;
-	}
-	
-/**
-Destructor.
-*/	
-EXPORT_C CSmsEmailFields::~CSmsEmailFields()
-	{
-	Reset();
-	delete iAddresses;
-	}
-	
-/**
-Resets the contents of the email fields object.
-*/
-EXPORT_C void CSmsEmailFields::Reset()
-	{
-	delete iSubject;
-	iSubject = NULL;
-	if( iAddresses!=NULL )
-		{
-		iAddresses->Reset();
-		}
-	}
-	
-/**
-The number of characters in the email fields.
-
-Calculates the number of characters that will be pre-pended to an SMS message
-when SMS is set for interworking with email. The address and subject fields are
-only valid if the their length is greater than zero.
-
-The address field is a comma separated list of addresses.
-
-It assumes that a subject will be added with the following format.
-
-@code
-
-	<address>(<subject>)<message>
-
-@endcode
-
-No validation of the contents of the fields is performed.
-
-@return
-The number of characters in the email fields.
-*/
-EXPORT_C TInt CSmsEmailFields::Length() const
-	{
-	// Get the address length and subject length
-	TInt subject = Subject().Length();
-	TInt address = 0;
-	
-	if( HasAddress() )
-		{
-		// Go through address list - there is at least one address...	
-		address = (*iAddresses)[0].Length();
-		
-		TInt count = iAddresses->Count();
-		for( TInt i=1; i < count; ++i )
-			{
-			// Any subsequent addresses are in a comma separated list - include
-			// length of comma separator.
-			address += (1 + (*iAddresses)[i].Length());
-			}
-		}
-	
-	if( subject > 0 )
-		{
-		// There is a subject - add the address and subject lengths plus the
-		// two delimiters; the '(' and ')' delimiters.
-		return (address + subject + 2);
-		}
-	if( address > 0 )
-		{
-		// There is no subject field, but there is an address field - add the
-		// address length and the single space delimiter for the end of the 
-		// address field.
-		return (address + 1);
-		}
-
-	// There is neither an address nor a subject field - return zero length.
-	return 0;
-	}
-	
-/**
-Indicates whether the address field contains at least one address
-
-@return
-A value of true if the address field contains at least one address, false if the
-address field is empty.
-*/
-EXPORT_C TBool CSmsEmailFields::HasAddress() const
-	{
-	return (iAddresses->Count() > 0);
-	}
-	
-/**
-Composes the email fields.
-
-The email fields are formatted into a buffer. The buffer is returned and left
-on the cleanup stack.
-
-If there is no address fields, then the function leaves with the error code 
-KErrCorrupt.
-
-The address field is a comma separate list of addresses.
-
-If a subject field exists then the address fields is delimited by a open bracket
-'(' and the subject is delimited by a close bracket ')'.
-
-@return
-A buffer contain the formatted email fields. A pointer to this buffer is left
-on the cleanup stack.
-
-@leave	KErrCorrupt
-The email fields has a zero-length address field.
-
-@internalTechnology
-*/
-EXPORT_C HBufC* CSmsEmailFields::ComposeLC() const
-	{
-	if( !HasAddress() )
-		{
-		User::Leave(KErrCorrupt);
-		}
-
-	HBufC* buf = HBufC::NewLC(Length());
-	TPtr ptr(buf->Des());
-	
-	// Append the addresses - must have at least one address...
-	ptr.Append((*iAddresses)[0]);
-	
-	// Append remaining addresses as comma separated list
-	TInt count = iAddresses->Count();
-	for( TInt i=1; i < count; ++i )
-		{
-		ptr.Append(KSmsEmailComma);
-		ptr.Append((*iAddresses)[i]);
-		}
-	
-	// The delimiter for the address depends on whether there is a subject.
-	if( Subject().Length() > 0 )
-		{
-		// Append open bracket '(', followed by subject and then close bracket ')'.
-		ptr.Append(KSmsEmailOpenBracket);
-		ptr.Append(*iSubject);
-		ptr.Append(KSmsEmailCloseBracket);
-		}
-	else
-		{
-		// No subject - address delimited by a space.
-		ptr.Append(KSmsEmailSpace);		
-		}
-	return buf;
-	}
-	
-/**
-Parses the given buffer for email fields.
-
-Supports the two address formats.
-
-@code
-
-	user@domain1.domain2
-
-or
-
-	User Name <user@domain1.domain2>
-
-@endcode
-
-Also, supports the two subject formats.
-
-@code
-
-	<address>(<subject>)<message>
-
-or
-	
-	<address>##<subject>#<message>
-
-@endcode
-
-The parsed address and optional subject are set in the email fields object. Any
-existing data in the object is deleted.
-
-@param	aBuffer
-The buffer to be parsed.
-
-@return
-If the email fields were successfully parsed the start position of the actual
-body text from the start of aBuffer is returned. If the email fields could not
-be parsed from aBuffer the error code KErrCorrupt is returned.
-
-@internalComponent
-*/	
-TInt CSmsEmailFields::ParseL(const TDesC& aBuffer)
-	{
-	Reset();
-	
-	// The to-address or the from-address can have following two formats - 
-	// 1. user@domain1.domain2
-	// 2. User Name <user@domain1.domain2>
-	// In the second format the <> brackets are part of the address.
-	// The address is delimited by one of the following - 
-	// 1. <space>
-	// 2. (
-	// 3. #
-	// The later two cases imply that there is a subject field. These two 
-	// delimiters are also mutually exclusive.
-	//
-	// First find the @ symbol - this will be the address.
-	TPtrC buf(aBuffer);
-	TInt pos = buf.Locate(KSmsEmailAtSign);
-	if( pos <= 0 )
-		{
-		return KErrCorrupt;
-		}
-	
-	// Found the address - search for the delimiters.
-	TInt atPos = pos;
-	buf.Set(buf.Mid(pos));
-	pos = buf.Locate(KSmsEmailSpace);
-	TInt spacePos	= pos != KErrNotFound ? pos : KMaxTInt;
-
-	pos = buf.Locate(KSmsEmailOpenBracket);
-	TInt bracketPos	= pos != KErrNotFound ? pos : KMaxTInt;
-
-	pos = buf.Locate(KSmsEmailHash);
-	TInt hashPos	= pos != KErrNotFound ? pos : KMaxTInt;
-	
-	TInt bodyPos = KErrNotFound;
-	if( spacePos < bracketPos && spacePos < hashPos )
-		{
-		// There is no subject as the <space> is the first delimiter.
-		pos = spacePos + atPos;
-		
-		// Set the start of the body text - need to move past the delimiter.
-		bodyPos = pos + 1;
-		}
-	else 
-		{
-		// The delimiter is either the # or ( - this implies a subject field.
-		TInt end = KErrNotFound;
-		if( bracketPos < hashPos )
-			{
-			// Address delimited by the bracket position;
-			pos = bracketPos + atPos;
-			
-			// Set the start of the body text - need to move past the delimiter.
-			bodyPos = pos + 1;
-			
-			// Subject has the (subject) format - find the end of the subject
-			// indicated by the closing bracket ')'. First move past delimiter.
-			buf.Set(buf.Mid(bracketPos+1));
-			end = buf.Locate(KSmsEmailCloseBracket);
-			}
-		else if( hashPos < KMaxTInt && buf[hashPos+1] == KSmsEmailHash )
-			{
-			// Address delimited by the hash position;
-			pos = hashPos + atPos;
-			
-			// Set the start of the body text - need to move past the two # 
-			// delimiters.
-			bodyPos = pos + 2;
-
-			// Subject has the ##subject# format - find the end of the subject
-			// indicated by a final hash '#'. First move past the delimiters.
-			buf.Set(buf.Mid(hashPos+2));
-			end = buf.Locate(KSmsEmailHash);
-			}
-		if( end == KErrNotFound )
-			{
-			// In this case the email fields are corrupt - one of the following
-			// has occurred - 
-			// 1. The address had no delimiter - missing <space>, # or (.
-			// 2. The subject had no delimiter - missing # or ).
-			// 3. The address has only a single delimiting #.
-			return KErrCorrupt;
-			}
-		SetSubjectL(buf.Left(end));
-		
-		// Update the start of the body text to get passed the subject - need
-		// to move past the delimiter.
-		bodyPos += end + 1;
-		}
-	// Add the address and return the position of the start of the body text.
-	AddAddressL(aBuffer.Left(pos));
-	
-	return bodyPos;	
-	}
-	
-/**
-Adds the address to the list of addresses.
-
-The address to be added must have a non-zero length. A zero-length address will
-not be added to the address list.
-
-@param	aAddress
-The address to be added.
-*/
-EXPORT_C void CSmsEmailFields::AddAddressL(const TDesC& aAddress)
-	{
-	if( aAddress.Length() > 0 )
-		{
-		iAddresses->AppendL(aAddress);
-		}
-	}
-	
-/**
-Removes the specified address.
-
-@param	aIndex
-The index for the address to be remvoed.
-*/
-EXPORT_C void CSmsEmailFields::RemoveAddress(TInt aIndex)
-	{
-	iAddresses->Delete(aIndex);
-	}
-	
-/**
-The array of email addresses.
-
-@see	MDesCArray
-
-@return
-An array of email addresses.
-*/
-EXPORT_C const MDesCArray& CSmsEmailFields::Addresses() const
-	{
-	return *iAddresses;
-	}
-	
-/**
-Sets the email subject field.
-
-Copies the contents of subject as the email subject field. If the copy is 
-unsuccessful the current contents is left unchanged.
-
-@param	aSubject
-The subject to be copied into the email field.
-*/
-EXPORT_C void CSmsEmailFields::SetSubjectL(const TDesC& aSubject)
-	{
-	HBufC* subject = aSubject.AllocL();
-	delete iSubject;
-	iSubject = subject;	
-	}
-	
-/**
-The subject field.
-
-@return
-The subject field.
-*/
-EXPORT_C const TDesC& CSmsEmailFields::Subject() const
-	{
-	return (iSubject) ? static_cast<const TDesC&>(*iSubject) : KNullDesC();
-	}
-
-/**
-Restores the email fields.
-
-If the store does not contain email fields data, the current email data is reset.
-
-@param	aStore
-The store to be read.
-
-@internalComponent
-*/
-void CSmsEmailFields::RestoreL(CMsvStore& aStore)
-	{
-	if( aStore.IsPresentL(KUidMsvSmsEmailFieldsStream) )
-		{
-		// The email fields stream exists - internalise from the stream.
-		RMsvReadStream in;
-		in.OpenLC(aStore, KUidMsvSmsEmailFieldsStream);
-		InternalizeL(in);
-		CleanupStack::PopAndDestroy(&in);	
-		}
-	else
-		{
-		// There is no stream - reset the email fields.
-		Reset();
-		}
-	}
-
-
-/**
-Stores the email fields.
-
-The email fields data will only be stored if there is at least some address or
-subject data. If there is neither address nor subject data and the store already
-contains email fields data, then this existing data is removed.
-
-@param	aStore
-The store to be written.
-
-@internalComponent
-*/
-void CSmsEmailFields::StoreL(CMsvStore& aStore) const
-	{
-	if( HasAddress() || Subject().Length() > 0 )
-		{
-		// The email fields have some data - store them.
-		RMsvWriteStream out;	
-		out.AssignLC(aStore, KUidMsvSmsEmailFieldsStream);
-		ExternalizeL(out);
-		out.CommitL();
-		CleanupStack::PopAndDestroy(&out);
-		}
-	else if( aStore.IsPresentL(KUidMsvSmsEmailFieldsStream) )
-		{
-		// Ok, the current email fields have no data, but the email fileds 
-		// stream exists - remove it.
-		aStore.Remove(KUidMsvSmsEmailFieldsStream);
-		}
-	}
-	
-/**
-Internalizes the email fields from the given stream.
-
-@param	aStream
-The stream to be read.
-*/
-void CSmsEmailFields::InternalizeL(RReadStream& aStream)
-	{
-	Reset();
-	aStream.ReadInt16L();	// read the version - to local as causes warning in EABI...
-
-	TCardinality cardinality;
-	aStream >> cardinality;
-	TInt count = cardinality;
-
-	for( TInt i = 0; i < count; ++i )
-		{
-		HBufC* buf = HBufC::NewLC(aStream, KMaxTInt);
-		AddAddressL(*buf);
-		CleanupStack::PopAndDestroy(buf);
-		}
-	iSubject = HBufC::NewL(aStream, KMaxTInt);	
-	}
-	
-/**
-Externalizes the email fields into the given stream.
-
-@param	aStream
-The stream to be written.
-*/
-void CSmsEmailFields::ExternalizeL(RWriteStream& aStream) const
-	{
-	aStream.WriteInt16L(KMsvSmsEmailFieldsVersion);
-	
-	TInt count = iAddresses->Count();	
-	aStream << TCardinality(count);
-	for( TInt i = 0; i < count; ++i )
-		{
-		aStream << (*iAddresses)[i];
-		}
-	aStream << Subject();
-	}
-
-CSmsEmailFields::CSmsEmailFields()
-: CBase()
-	{
-	}
-	
-void CSmsEmailFields::ConstructL()
-	{
-	iAddresses = new (ELeave) CDesCArrayFlat(KSmsEmailAddressesArrayGranularity); 	
-	}
-
-void CSmsEmailFields::ConstructL(const CSmsEmailFields& aEmailFields)
-	{
-	ConstructL();
-	
-	const MDesCArray& addresses = aEmailFields.Addresses();
-	TInt count = addresses.MdcaCount();
-	
-	for( TInt i=0; i < count; ++i )
-		{
-		AddAddressL(addresses.MdcaPoint(i));		
-		}
-	iSubject = aEmailFields.Subject().AllocL();
-	}
-
-#if (defined SYMBIAN_MESSAGESTORE_HEADER_BODY_USING_SQLDB)
-
-/**
-Stores the email fields in SQL DB.
-
-The email fields data will only be stored if there is at least some address or
-subject data. If there is neither address nor subject data and the store already
-contains email fields data, then this existing data is removed.
-
-@param	aStore
-The store to be written.
-
-@internalComponent
-*/
-
-void CSmsEmailFields::StoreDBL(CMsvStore& aStore) 
-	{
-	// This is the continuation of the header entry created 
-	// in CSmsHeader::StoreDbL().
-	
-	if( HasAddress() || Subject().Length() > 0 )
-		{
-		CHeaderFields* emailOverSmsHeaderFields = new (ELeave)CHeaderFields();
-		CleanupStack::PushL(emailOverSmsHeaderFields);
-		emailOverSmsHeaderFields->iUid = KUidMsvSmsEmailFieldsStream;
-
-		//----------------------EOS Info  6th Field ------------------------------	
-		CFieldPair* smsdetailField = new (ELeave)CFieldPair();
-		CleanupStack::PushL(smsdetailField);
-		
-		RBuf eosbuf;
-		CleanupClosePushL(eosbuf);
-		eosbuf.CreateL(GetBufSize()); 
-		
-		// Header version	
-		eosbuf.AppendNum(KMsvSmsEmailFieldsVersion);
-		eosbuf.Append(KDelimiter);
-			
-		// AddressCount	
-		eosbuf.AppendNum(iAddresses->Count());
-		eosbuf.Append(KDelimiter);
-
-		// Addresses
-		for (TInt i=0; i<iAddresses->Count(); i++)
-			{
-			eosbuf.Append(iAddresses->MdcaPoint(i));
-			if(i<(iAddresses->MdcaCount())-1)
-				eosbuf.Append(KComma);
-			}
-		
-		eosbuf.Append(KDelimiter);
-		
-		// Subject
-		eosbuf.Append(Subject());
-		eosbuf.Append(KDelimiter);
-		
-		HBufC* newFrom1 = HBufC::NewL(eosbuf.Length());
-		newFrom1->Des().Copy(eosbuf);
-		smsdetailField->iFieldTextValue = newFrom1;
-		emailOverSmsHeaderFields->iFieldPairList.AppendL(smsdetailField);
-		
-		eosbuf.Close();
-		CleanupStack::Pop();  // Rbuf
-		CleanupStack::Pop(smsdetailField);
-
-		
-		TMsvWriteStore storeWriter(aStore);
-		storeWriter.AssignL(emailOverSmsHeaderFields);
-		storeWriter.CommitL();
-		
-		CleanupStack::Pop(emailOverSmsHeaderFields);
-		
-		}
-	else if( aStore.IsPresentL(KUidMsvSmsEmailFieldsStream) )
-		{
-		
-		CHeaderFields* emailOverSmsHeaderFields = new (ELeave)CHeaderFields();
-		CleanupStack::PushL(emailOverSmsHeaderFields);
-		emailOverSmsHeaderFields->iUid = KUidMsvSmsEmailFieldsStream;
-
-			
-		CFieldPair* smsdetailField = new (ELeave)CFieldPair();
-		CleanupStack::PushL(smsdetailField);
-		smsdetailField->iFieldTextValue = KNullDesC().AllocL();
-		emailOverSmsHeaderFields->iFieldPairList.AppendL(smsdetailField);
-		CleanupStack::Pop(smsdetailField);
-
-		TMsvWriteStore storeWriter(aStore);
-		storeWriter.AssignL(emailOverSmsHeaderFields);
-		storeWriter.CommitL();
-
-		
-		// Ok, the current email fields have no data, but the email fileds 
-		// stream exists - remove it.
-		aStore.Remove(KUidMsvSmsEmailFieldsStream);
-		
-		CleanupStack::Pop(emailOverSmsHeaderFields);
-		}
-	}
-
-/**
-To gett he Buffer size.
-*/	
-	
-TInt CSmsEmailFields::GetBufSize()
-	{
-	TInt size  = 0;
-	
-	size += sizeof(KMsvSmsEmailFieldsVersion) + 1;  // 1 is for Delimiter
-	size += Subject().Length() + 1 ;
-	size += sizeof(iAddresses->Count()) + 1 ;
-	
-	for(TInt i=0; i<iAddresses->Count(); i++)
-		{
-		size += iAddresses->MdcaPoint(i).Length() + 1;  	// Extra byte for Comma
-		}
-
-	return size ;
-	
-	}
-
-
-
-/**
-Retrives the email fields from SQL DB.
-
-If the store does not contain email fields data, the current email data is reset.
-
-@param	aStore
-The store to be read.
-
-@internalComponent
-*/
-
-	
-void CSmsEmailFields::ReStoreDBL(CMsvStore& aStore)
-	{
-	Reset();
-	CHeaderFields* rcvEmailHeaderRow = NULL;
-	TMsvReadStore storeReader(aStore, KUidMsvSmsEmailFieldsStream);
-	TRAPD(err, storeReader.ReadL(rcvEmailHeaderRow));
-	
-	if(KErrNotFound == err)
-		{
-		return;
-		}
-	
-	TInt i = 0;  //SMS Email over SMS 	
-	HBufC* 	eosheaderinfo = rcvEmailHeaderRow->iFieldPairList[i++]->iFieldTextValue ;
-	TPtr16 eosheaderPtr = (eosheaderinfo->Des());	
-
-	//Parsing the eos string 
-	TInt firstSemiColonPos = eosheaderPtr.Locate(';');
-	TInt lastSemiColonPos = eosheaderPtr.LocateReverse(';');
-
-	RPointerArray<HBufC16> eosinfoData;
-	CleanupClosePushL(eosinfoData);
-	TInt ii = 0 ;
-
-	do
-		{
-		TPtrC16 str1 = eosheaderPtr.Left(firstSemiColonPos); // First data
-		HBufC16* tt = str1.AllocLC();
-		firstSemiColonPos++;
-		eosinfoData.AppendL(tt); 
-		CleanupStack::Pop();
-		
-		if(firstSemiColonPos != lastSemiColonPos)
-			{
-			eosheaderPtr = (eosheaderPtr.Mid(firstSemiColonPos,eosheaderPtr.Length()-(firstSemiColonPos) ));
-			firstSemiColonPos = eosheaderPtr.Locate(';');
-			lastSemiColonPos = eosheaderPtr.LocateReverse(';');
-			if(firstSemiColonPos == lastSemiColonPos)
-				{
-				TPtrC16 str1 = eosheaderPtr.Left(eosheaderPtr.Length() -1); // Last data is Subject . End with Semicolon. -1 is to remove semicolon.
-				HBufC16* tt = str1.AllocLC();
-				eosinfoData.AppendL(tt);
-				CleanupStack::Pop(); 
-				}
-			}
-		else
-			{
-			//Empty field.
-			HBufC16* tt = KNullDesC().AllocLC();
-			eosinfoData.AppendL(tt);
-			CleanupStack::Pop(); 
-			}
-		
-		ii++;	
-		}while(firstSemiColonPos != lastSemiColonPos);
-
-	TInt16 headerversion = ConvertToTInt(*eosinfoData[0]);
-	
-	TInt count = ConvertToTInt(*eosinfoData[1]);
-	
-	if(count > 0)
-		{
-		_LIT16(KSemicolon, ";");
-		HBufC16* addressesList = eosinfoData[2]->Des().AllocLC();
-		addressesList = addressesList->ReAllocL(addressesList->Length()+2);
-		TPtr16 addressesListPtr = (addressesList->Des());
-		addressesListPtr.Append(KSemicolon);
-		GetRecipientListL(addressesListPtr);
-		CleanupStack::PopAndDestroy();
-		}
-	else
-		{
-		AddAddressL(KNullDesC16);
-		}
-	
-	iSubject = eosinfoData[3]->Des().AllocL();
-	
-	
-	eosinfoData.ResetAndDestroy();
-	CleanupStack::PopAndDestroy();   //RPointerArray	
-	}
-
- /* Convert a String to an Integer.
- * @param aStr A string to make Integer.
- * @return TInt A integer value 
- */
-TInt CSmsEmailFields::ConvertToTInt(TDesC16& aStr)
-	{
-	TLex str(aStr);
-	TInt32 string;
-	str.Val(string);
-	return string;
-	}
-
-/**
-To parse the recipient address list.
-*/
-
-void CSmsEmailFields::GetRecipientListL(TDesC16& aStr)
-	{
-	TPtrC16 recvstr = aStr;
-	
-	if(KErrNotFound != recvstr.Locate(',') )
-		{ // It has multipule recipient list is :-  example@nokia.com, example@nokia.com,example@nokia.com;
-		TInt startPos = recvstr.Locate(',') ;
-		while(1)
-			{
-			TPtrC16 partstrx = recvstr.Left(startPos);
-			AddAddressL(partstrx);
-			startPos++;
-			recvstr.Set(recvstr.Mid(startPos, recvstr.Length()- startPos));
-		
-			startPos = recvstr.Locate(',');
-			if(startPos == KErrNotFound)
-				{
-				TPtrC16 partstrxy;
-				partstrxy.Set(recvstr.Mid(0,recvstr.Length()-1));
-				AddAddressL(partstrxy);
-				break;
-				}
-			}
-		
-		}
-	else  // It has one recipient  list is like this->  example@nokia.com;
-		{
-		TInt lastpos = recvstr.Locate(';');	
-		TPtrC16 partstrx = recvstr.Left(lastpos);
-		AddAddressL(partstrx);
-		}
-	}
-#endif
--- a/messagingappbase/smsmtm/clientmtm/src/csmssendmessageoperation.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-// Copyright (c) 2004-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 "csmssendmessageoperation.h"
-#include <smscmds.h>
-#include "SMUTSET.H"
-
-
-CSmsSendMessageOperation* CSmsSendMessageOperation::NewL(CMsvSession& aMsvSession, 
-														 const CMsvEntrySelection& aSelection, 
-														 const TDesC8& aParameter, 
-														 TRequestStatus& aObserverRequestStatus)
-	{
-	CSmsSendMessageOperation* self = new(ELeave) CSmsSendMessageOperation(aMsvSession, aObserverRequestStatus);
-	CleanupStack::PushL(self);
-	self->ConstructL(aSelection, aParameter);
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-void CSmsSendMessageOperation::ConstructL(const CMsvEntrySelection& aSelection, const TDesC8& aParameter)
-	{
-	iOperation = iMsvSession.TransferCommandL(aSelection, ESmsMtmCommandScheduleCopy, (TDesC8&)aParameter, iStatus);
-	// assigns iMtm, iService and sets active
-	Start(iOperation);
-	}
-
-CSmsSendMessageOperation::CSmsSendMessageOperation(CMsvSession& aMsvSession, TRequestStatus& aObserverRequestStatus) :
-	CMsvSendOperation(aMsvSession, aObserverRequestStatus)
-	{
-	}
-	
-const TDesC8& CSmsSendMessageOperation::TranslateProgress(const TDesC8& aProgress)
-	{
-	TSmsProgressBuf& progress = (TSmsProgressBuf&) aProgress;
-
-	// default progress
-	iProgress().iProgressMax = 0;
-	iProgress().iProgress = 0;
-	
-	// convert SMS progress into standard send progress
-	switch (progress().iType)	
-		{
-		case TSmsProgress::ESmsProgressTypeSending:
-		case TSmsProgress::ESmsProgressTypeScheduling:
-			iProgress().iProgressMax = progress().iMsgCount;
-			iProgress().iProgress = progress().iMsgDone;
-			iProgress().iState = ESendStateSending;
-			break;
-		default:
-			iProgress().iState = ESendStateWaitingToSend;
-			break;
-		}
-	// get error
-	iProgress().iError = progress().iError;
-
-	return iProgress;
-	}
--- a/messagingappbase/smsmtm/clientmtm/src/smut.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,951 +0,0 @@
-// Copyright (c) 1999-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:
-// smut.cpp
-//
-#include <smut.h>
-#include <gsmuieoperations.h>
-
-#include <e32std.h>
-#include <gsmumsg.h>
-#include <msvstd.h>
-#include <cntdb.h>
-#include <cntfield.h>
-#include <cntitem.h>
-#include <cntfldst.h>
-#include <msventry.h>
-#include <msvuids.h>
-#include <msvapi.h>
-#include <txtetext.h>
-#include <gsmubuf.h>
-#include <bautils.h>
-#include <barsc.h>
-#include <SMSS.rsg>
-#include <smss.hrh>
-#include <msvutils.h>
-#include "SMCMMAIN.H"
-#include "SMUTSET.H"
-
-// Used by ValidGsmNumber(). The characters that may appear at the start of a
-// valid GSM number
-_LIT(KSmsValidGsmNumberFirstChar, "+");
-
-// Used by ValidGsmNumber(). The characters that may appear after the first
-// character of a valid GSM number
-_LIT(KSmsValidGsmNumberOtherChar, "#*");
-
-const TInt KSmsValidGsmNumberMinLength = 2;
-
-/**
-Finds and returns all the Service IDs for the specified MTM.
-
-A Service ID is the entry ID for an service-type entry. The first Service ID
-for the specified MTM is returned.
-
-If the complete set of Service IDs for the MTM is required then the caller
-should provide a valid CMsvEntrySelection object in aServiceIds. The Service
-Ids are appended to this object. If the complete set is not required then the
-input/output argument aServiceIds should be set to NULL.
-
-@param	aEntry
-A server message entry that can be used by this function.
-
-@param	aFirstId
-An output argument with the first Service ID.
-
-@param	aMtm
-The specified MTM. This has a default value of KUidMsgTypeSMS.
-
-@param	aServiceIds
-An input/output argument with the complete selection of Service IDs.  This has
-a default value of NULL.
-
-@leave	KErrNotFound
-A service entry could not be found for the specified MTM.
-*/
-EXPORT_C void TSmsUtilities::ServiceIdL(CMsvServerEntry& aEntry, TMsvId& aFirstId, TUid aMtm, CMsvEntrySelection* aServiceIds)
-	{
-	aFirstId = KMsvNullIndexEntryId;
-
-	CMsvEntrySelection* selection = new (ELeave) CMsvEntrySelection();
-	CleanupStack::PushL(selection);
-
-	User::LeaveIfError(aEntry.SetEntry(KMsvRootIndexEntryId));
-
-	TMsvSelectionOrdering order;
-	order.SetShowInvisibleEntries(ETrue);
-	aEntry.SetSort(order);
-
-	// Get the children on the Root Index Entry
-	User::LeaveIfError(aEntry.GetChildrenWithType(KUidMsvServiceEntry, *selection));
-
-	TInt count = selection->Count();
-
-	// Find an entry for MTM aMtm
-	for (TInt curChild = 0; curChild < count && (aFirstId == KMsvNullIndexEntryId || aServiceIds); ++curChild)
-		{
-		User::LeaveIfError(aEntry.SetEntry(selection->At(curChild)));
-		CompareEntryL(aEntry.Entry(), aMtm, aFirstId, aServiceIds);
-		}
-
-	// Leave if no Service Entry found for MTM aMtm
-	if (aFirstId == KMsvNullIndexEntryId)
-		User::Leave(KErrNotFound);
-
-	CleanupStack::PopAndDestroy(selection);
-	}
-
-/**
-Finds and returns all the Service IDs for the specified MTM.
-
-A Service ID is the entry ID for an service-type entry. The first Service ID
-for the specified MTM is returned.
-
-If the complete set of Service IDs for the MTM is required then the caller
-should provide a valid CMsvEntrySelection object in aServiceIds. The Service
-Ids are appended to this object. If the complete set is not required then the
-input/output argument aServiceIds should be set to NULL.
-
-@param	aSession
-A message server session.
-
-@param	aFirstId
-An output argument with the first Service ID.
-
-@param	aMtm
-The specified MTM. This has a default value of KUidMsgTypeSMS.
-
-@param	aServiceIds
-An input/output argument with the complete selection of Service IDs.  This has
-a default value of NULL.
-
-@leave	KErrNotFound
-A service entry could not be found for the specified MTM.
-*/
-EXPORT_C void TSmsUtilities::ServiceIdL(CMsvSession& aSession, TMsvId& aFirstId, TUid aMtm, CMsvEntrySelection* aServiceIds)
- 	{
- 	TMsvSelectionOrdering order;
- 	order.SetShowInvisibleEntries(ETrue);
-
- 	CMsvEntry* root = CMsvEntry::NewL(aSession, KMsvRootIndexEntryId, order);
- 	CleanupStack::PushL(root);
-
- 	ServiceIdL(*root, aFirstId, aMtm, aServiceIds);
-
- 	CleanupStack::PopAndDestroy(root);
- 	}
-
-/**
-Finds and returns all the Service IDs for the specified MTM.
-
-A Service ID is the entry ID for an service-type entry. The first Service ID
-for the specified MTM is returned.
-
-If the complete set of Service IDs for the MTM is required then the caller
-should provide a valid CMsvEntrySelection object in aServiceIds. The Service
-Ids are appended to this object. If the complete set is not required then the
-input/output argument aServiceIds should be set to NULL.
-
-@param	aEntry
-A message entry that can be used by this function.
-
-@param	aFirstId
-An output argument with the first Service ID.
-
-@param	aMtm
-The specified MTM. This has a default value of KUidMsgTypeSMS.
-
-@param	aServiceIds
-An input/output argument with the complete selection of Service IDs.  This has
-a default value of NULL.
-
-@leave	KErrNotFound
-A service entry could not be found for the specified MTM.
-*/
-EXPORT_C void TSmsUtilities::ServiceIdL(CMsvEntry& aEntry, TMsvId& aFirstId, TUid aMtm, CMsvEntrySelection* aServiceIds)
-	{
-	aFirstId = KMsvNullIndexEntryId;
-
- 	TMsvSelectionOrdering order(aEntry.SortType());
- 	if (!order.ShowInvisibleEntries())
- 		{
- 		order.SetShowInvisibleEntries(ETrue);
- 		aEntry.SetSortTypeL(order);
- 		}
-
-   	aEntry.SetEntryL(KMsvRootIndexEntryId);
- 	const TInt count = aEntry.Count();
-
-	// Find an entry for MTM aMtm
-	for (TInt curChild = 0; curChild < count && (aFirstId == KMsvNullIndexEntryId || aServiceIds != NULL); ++curChild)
-		{
-		CompareEntryL(aEntry[curChild], aMtm, aFirstId, aServiceIds);
-		}
-
-	// Leave if no Service Entry found for MTM aMtm
-	if (aFirstId == KMsvNullIndexEntryId)
-		User::Leave(KErrNotFound);
-	}
-
-/**
-Populates a message index.
-
-The input data is used to set the fields in supplied message index. The affected
-fields are the entry type, MTM, entry date, Service ID and error fields. The
-date field is set from the time information in the aMessage argument.
-
-This function can be used as part of the process when creating SMS messages in
-the message store.
-
-@param	aEntry
-An input/output argument with the index entry to populate.
-
-@param	aMessage
-The SMS message object for the index entry.
-
-@param	aServiceId
-The Service ID for the message.
-
-@param	aMtm
-The specified MTM. This has a default value of KUidMsgTypeSMS.
-*/
-EXPORT_C void TSmsUtilities::PopulateMsgEntry(TMsvEntry& aEntry, const CSmsMessage& aMessage, TMsvId aServiceId, TUid aMtm)
-	{
-	aEntry.iType		= KUidMsvMessageEntry;
-	aEntry.iMtm			= aMtm;
-	aEntry.iDate		= aMessage.Time();
-	aEntry.iServiceId	= aServiceId;
-	aEntry.iError		= KErrNone;
-	}
-
-/**
-Populates a message index.
-
-The input data is used to set the fields in supplied message index. The affected
-fields are the entry type, MTM, entry date, Service ID and error fields. The
-date field is either set from the time information in the aMessage argument or from
-the service center timestamp in the PDU depending on the associated SMS setting.
-
-This function can be used as part of the process when creating SMS messages in
-the message store.
-
-@param	aEntry
-An input/output argument with the index entry to populate.
-
-@param	aMessage
-The SMS message object for the index entry.
-
-@param	aServiceId
-The Service ID for the message.
-
-@param	aSettings
-The settings for the SMS account.
-
-@param	aMtm
-The specified MTM. This has a default value of KUidMsgTypeSMS.
-*/
-EXPORT_C void TSmsUtilities::PopulateMsgEntry(TMsvEntry& aEntry, const CSmsMessage& aMessage, TMsvId aServiceId, const CSmsSettings& aSettings, TUid aMtm)
-	{
-	TSmsUtilities::PopulateMsgEntry(aEntry, aMessage, aServiceId, aMtm);
-
-	if (aSettings.UseServiceCenterTimeStampForDate())
-		{
-		const CSmsPDU& pdu = aMessage.SmsPDU();
-
-		TTime time = 0;
-		TInt gmtOffset = 0;
-
-		if (pdu.Type() == CSmsPDU::ESmsDeliver)
-			{
-			CSmsDeliver& smsDeliver =
-				const_cast<CSmsDeliver&>(static_cast<const CSmsDeliver&>(pdu));
-			smsDeliver.ServiceCenterTimeStamp(time, gmtOffset);
-			}
-		else if (pdu.Type() == CSmsPDU::ESmsStatusReport)
-			{
-			CSmsStatusReport& smsStatusReport =
-				const_cast<CSmsStatusReport&>(static_cast<const CSmsStatusReport&>(pdu));
-			smsStatusReport.ServiceCenterTimeStamp(time, gmtOffset);
-			}
-
-		if (time > 0)
-			{
-			aEntry.iDate = time;
-			}
-		}
-	}
-
-/**
-Get the SMS message recipient/sender details.
-
-The recipient/sender telephone number is extracted from the supplied message
-object. If the recipient/sender telephone number appears uniquely in the contacts
-database then the family name and given name contact details are set into the
-output argument aDetails in the format specified by the resource item
-R_SENDER_NAME_FORMAT. The buffer limit specified by aMaxLength is observed.
-
-If there is not a unique contact entry for the recipient/sender telephone number
-then aDetails will contain the orginally telephone number.
-
-@param	aFs
-A connected file server session.
-
-@param	aMessage
-The message object with the recipient/sender telephone number.
-
-@param	aDetails
-The output argument to contain the message details.
-
-@param	aMaxLength
-The maximum length of the supplied buffer in aDetails.
-
-@return
-KErrNotSupported if the message is not of type SMS-SUBMIT, SMS-DELIVER or SMS-STATUS-REPORT.
-KErrArgument if the telephone number is invalid.
-KErrNotFound if a contact could not be found.
-KErrAlreadyExists if more than one contact entry found.
-KErrNone if details is obtained successfully.
-*/
-EXPORT_C TInt TSmsUtilities::GetDetails(RFs& aFs, const CSmsMessage& aMessage, TDes& aDetails, TInt aMaxLength)
-	{
-	__ASSERT_DEBUG( aMaxLength <= aDetails.MaxLength(), User::Invariant() );
-
-	if (aMaxLength > aDetails.MaxLength())
-		{
-		aMaxLength = aDetails.MaxLength();
-		}
-
-	aDetails.Zero();
-
-	TPtrC fromAddress;
-
-	switch (aMessage.SmsPDU().Type())
-		{
-		case CSmsPDU::ESmsSubmit:
-		case CSmsPDU::ESmsDeliver:
-		case CSmsPDU::ESmsStatusReport:
-			fromAddress.Set(aMessage.SmsPDU().ToFromAddress());
-			break;
-		default:
-			return KErrNotSupported;
-		}
-
-	return GetDetails(aFs, fromAddress, aDetails, aMaxLength);
-	}
-
-/**
-Get the SMS message recipient/sender details.
-
-The recipient/sender telephone number is searched for in the contacts database.
-If a unique match is found then the family name and given name contact details
-are set into the output argument aDetails in the format specified by the
-resource item R_SENDER_NAME_FORMAT. The buffer limit specified by aMaxLength is
-observed.
-
-If a unique match is not found or the supplied telephone number is invalid, then
-aDetails will contain the orginally telephone number.
-
-@param	aFs
-A connected file server session.
-
-@param	aFromAddress
-The recipient/sender telephone number.
-
-@param	aDetails
-The output argument to contain the message details.
-
-@param	aMaxLength
-The maximum length of the supplied buffer in aDetails.
-
-@return
-KErrArgument if aFromAddress is not a valid GSM number.
-KErrNotFound if a contact could not be found.
-KErrAlreadyExists if more than one contact entry found.
-KErrNone if details is obtained successfully.
-*/
-EXPORT_C TInt TSmsUtilities::GetDetails(RFs& aFs, const TDesC& aFromAddress, TDes& aDetails, TInt aMaxLength)
-	{
-	__ASSERT_DEBUG( aMaxLength <= aDetails.MaxLength(), User::Invariant() );
-
-	if (aMaxLength > aDetails.MaxLength())
-		{
-		aMaxLength = aDetails.MaxLength();
-		}
-
-	TRAPD(err, DoGetDetailsL(aFs, aFromAddress, aDetails, aMaxLength));
-
-	if ( (err != KErrNone) || (aDetails.Length() == 0) )
-		{
-		if (aFromAddress.Length() <= aMaxLength)
-			{
-			aDetails = aFromAddress;
-			aDetails.Trim();
-			}
-		else
-			{
-			// Truncate aFromAddress so that it fits into aDetails.
-			aDetails = aFromAddress.Left(aMaxLength);
-			aDetails.Trim();
-			}
-		}
-
-	return KErrNone;
-	}
-
-/**
-Get the SMS message description.
-
-If the message is Special Message Indication SMS then the description will
-contain the appropriate localised text for the indication.
-
-If the message is a Status Report then the description will contain the
-appropriate localised text for a Status Report.
-
-If the message is a standard text message the description will contain the
-beginning section of the SMS message text itself.
-
-In all cases the buffer limit specified by aMaxLength is observered.
-
-@param	aMessage
-The SMS message object.
-
-@param	aDescription
-The output argument for the description.
-
-@param	aMaxLength
-The maximum length of the supplied buffer in aDescription.
-
-@return
-An error code if the localised text for a SMS-STATUS-REPORT message could not be
-obtained. Otherwise KErrNone is returned.
-*/
-EXPORT_C TInt TSmsUtilities::GetDescription(const CSmsMessage& aMessage, TDes& aDescription, TInt aMaxLength)
-	{
-	__ASSERT_DEBUG( aMaxLength <= aDescription.MaxLength(), User::Invariant() );
-
-	if (aMaxLength > aDescription.MaxLength())
-		{
-		aMaxLength = aDescription.MaxLength();
-		}
-
-	aDescription.Zero();
-
-	TBool gotDescription = EFalse;
-	TRAPD(err, gotDescription = DoGetDescriptionL(aMessage, aDescription, aMaxLength));
-	if(err != KErrNone || !gotDescription)
-		ExtractDescriptionFromMessage(aMessage, aDescription, aMaxLength);
-
-	return KErrNone;
-	}
-
-/**
-Opens and returns the SMS client MTM resource file.
-
-It is the responsibility of the caller to ensure that the resource file is
-closed once it is no longer required.
-
-@param	aFs
-A connected file server session.
-
-@return
-The opened resource file.
-*/
-EXPORT_C RResourceFile TSmsUtilities::OpenResourceFileL(RFs& aFs)
-	{
-	TFileName fileName(KSmsResourceFile);
-	MsvUtils::AddPathAndExtensionToResFileL(fileName);
- 	BaflUtils::NearestLanguageFile(aFs, fileName);
-
-	RResourceFile resFile;
-	resFile.OpenL(aFs, fileName);
-	return resFile;
-	}
-
-/**
-Reads the resource specified by aResourceId from the supplied resource file.
-
-The resource is returned in the output argument aString. The supplied resource
-file must be open or this function will leave.
-
-@param	aResourceFile
-The opened resource file to read the resource from.
-
-@param	aResourceId
-The ID of the resource that is required.
-
-@param	aString
-An output buffer into which the read resource is placed.
-
-@leave	KErrOverflow
-The length of the resource string is greater than the maximum allowed.
-*/
-EXPORT_C void TSmsUtilities::ReadResourceStringL(RResourceFile aResourceFile, TInt aResourceId, TDes& aString)
-
-	{
-	HBufC8* buf = aResourceFile.AllocReadLC(aResourceId);
-	TResourceReader reader;
-	reader.SetBuffer(buf);
-	
-	TPtrC resString = reader.ReadTPtrC();
-
-	if (resString.Length() <= aString.MaxLength())
-		{ 
-		aString.Copy(resString);
-		}
-	else
-		{
-		User::Leave(KErrOverflow);
-		}
-
-	CleanupStack::PopAndDestroy(buf);
-	}
-
-void TSmsUtilities::CompareEntryL(const TMsvEntry& aEntry, TUid aMtm, TMsvId& aFirstId, CMsvEntrySelection* aServiceIds)
-	{
-	if (aEntry.iType == KUidMsvServiceEntry && aEntry.iMtm == aMtm)
-		{
-		const TMsvId id = aEntry.Id();
-
-		if (aFirstId == KMsvNullIndexEntryId)
-			aFirstId = id;
-
-		if (aServiceIds)
-			aServiceIds->AppendL(id);
-		}
-	}
-
-void TSmsUtilities::DoGetDetailsL(RFs& aFs, const TDesC& aFromAddress, TDes& aDetails, TInt aMaxLength)
-	{
- 	__UHEAP_MARK;
-
- 	// Check that aFromAddress is a valid GSM telephone number
- 	if (!ValidGsmNumber(aFromAddress))
- 		User::Leave(KErrArgument);
-
- 	aDetails.Zero();
-
- 	CContactDatabase* db = CContactDatabase::OpenL();
- 	CleanupStack::PushL(db);
-
- 	// Lookup the telephone number (aFromAddress) in the contact database
- 	CContactIdArray* contactId = db->MatchPhoneNumberL(aFromAddress, KLowerSevenDigits);
- 	CleanupStack::PushL(contactId);
-	
- 	// Add the name if there is one and only one match in contacts. If there's more than
- 	// one then wouldn't know which one to choose	
- 	if (contactId->Count() <= 0)
- 		{
- 		//The telephone number (aFromAddress) was not found in the contact database.
- 		User::Leave(KErrNotFound);
-		}
- 	else if (contactId->Count() > 1)
- 		{
- 		//There's more than one telephone number match in contacts.	
- 		User::Leave(KErrAlreadyExists);
- 		}
-	
- 	CContactItem* newContact = db->ReadMinimalContactL((*contactId)[0]);
- 	CleanupStack::PushL(newContact);
-
- 	CContactItemFieldSet& fieldSet = newContact->CardFields();
-
- 	TInt count		= fieldSet.Count();
-
- 	HBufC* family	= HBufC::NewLC(aMaxLength);
- 	HBufC* given	= HBufC::NewLC(aMaxLength);
- 	TPtr familyPtr(family->Des());
- 	TPtr givenPtr(given->Des());
-
- 	// Find the Given and First Name of the contact
- 	// Order important
- 	for (TInt curField = 0; curField < count && !(familyPtr.Length() && givenPtr.Length()); curField++)
- 		{
- 		CContactItemField& field = fieldSet[curField];
-
- 		if (!familyPtr.Length())
- 			GetName(field, KUidContactFieldFamilyName, familyPtr);
-
- 		if (!givenPtr.Length())
- 			GetName(field, KUidContactFieldGivenName, givenPtr);
- 		}
-
- 	familyPtr.Trim();
- 	givenPtr.Trim();
-
- 	TInt familyLen	= familyPtr.Length();
- 	TInt givenLen	= givenPtr.Length();
-
- 	if (!familyLen && !givenLen)
- 		{
- 		//Leave if no family nor given name found
- 		User::Leave(KErrNotFound);
- 		}
- 	else if (givenLen == 0)
- 		{
- 		// The maximum length of familyPtr may be greater than
- 		// aMaxLength, so need to check its length before copying.
- 		if (familyPtr.Length() > aMaxLength)
-   			{
-   			familyPtr.Set(familyPtr.LeftTPtr(aMaxLength));
-   			}
-
- 		aDetails = familyPtr;
- 		}
- 	else if (familyLen == 0)
- 		{
- 		// The maximum length of givenPtr may be greater than
- 		// aMaxLength, so need to check its length before copying.
- 		if (givenPtr.Length() > aMaxLength)
-   			{
-   			givenPtr.Set(givenPtr.LeftTPtr(aMaxLength));
-   			}
-
- 		aDetails = givenPtr;
- 		}
- 	else
- 		{
- 		RResourceFile resFile = OpenResourceFileL(aFs);
- 		CleanupClosePushL(resFile);
- 		ReadResourceStringL(resFile, R_SENDER_NAME_FORMAT, aDetails);
- 		CleanupStack::PopAndDestroy(&resFile);
-
- 		TBuf<8> givenPlaceHolder = L_SMS_GIVEN_NAME;
- 		TBuf<8> familyPlaceHolder = L_SMS_FAMILY_NAME;
- 		TInt minLength = aDetails.Length() - givenPlaceHolder.Length() - familyPlaceHolder.Length();
-
- 		if ((familyLen + givenLen + minLength) > aMaxLength)
- 			{
- 			// The maximum length of familyPtr may be greater than
- 	   		// aMaxLength, so need to check its length before copying.
-   			if (familyPtr.Length() > aMaxLength)
-    				{
-    				familyPtr.Set(familyPtr.LeftTPtr(aMaxLength));
-    				}
- 			aDetails = familyPtr;
- 			}
- 		else
- 			{
- 			Replace(givenPlaceHolder, givenPtr, aDetails);
- 			Replace(familyPlaceHolder, familyPtr, aDetails);
- 			}
- 		}
-
- 	//Remove leading and trailing spaces
- 	aDetails.Trim();
- 	CleanupStack::PopAndDestroy(5, db);
-
- 	__UHEAP_MARKEND;
- 	}
-
- TBool TSmsUtilities::ValidGsmNumber(const TDesC& aTelephone)
- 	{
- 	// Returns ETrue if
- 	//	aTelephone is not zero length; and
- 	//	aTelephone[0] is a digit or "+"; and
- 	//	aTelephone[1..] is a digit or "*" or "#".
- 	//	aTelephone has at least 2 valid characters
- 	//Note: Returns EFalse if aTelephone contains any alpha character
- 	//      All spaces are ignored
- 	const TInt length = aTelephone.Length();
-
- 	if (length < KSmsValidGsmNumberMinLength)
- 		return EFalse;
-
- 	TPtrC KFirstChar(KSmsValidGsmNumberFirstChar);
- 	TPtrC KOtherChar(KSmsValidGsmNumberOtherChar);
- 	TBool validTel = ETrue;
- 	TInt validCharsFound = 0; //must be >= KSmsValidGsmNumberMinLength by the end
-
- 	const TText* first = aTelephone.Ptr(); //Points to the first character in aTelephone
- 	const TText* last = first + length - 1; //Points to the last character in aTelephone
-
- 	//Check each character in the telephone number
- 	while (validTel && first <= last)
- 		{
- 		TChar ch(*first);
- 		if (!ch.IsSpace()) //ignore whitespace
- 			{
- 			if (!ch.IsDigit())
- 				{
- 				//Need to create TPtrC because TDesC::Find() does not take a TChar
- 				TPtrC telCharacter(first, 1);
-
- 				if (validCharsFound)
- 					{
- 					//Check the remaining characters of the telephone number
- 					validTel = (KOtherChar.Find(telCharacter) != KErrNotFound);
- 					}
- 				else //validCharsFound == 0
- 					{
- 					//Check the first character of the telephone number
-					validTel = (KFirstChar.Find(telCharacter) != KErrNotFound);
- 					}
- 				}
- 			validCharsFound++;
- 			}
-
- 		first++; //move to the next character
- 		}
-
- 	return validTel && validCharsFound >= KSmsValidGsmNumberMinLength;
- 	}
-
- void TSmsUtilities::GetName(CContactItemField& aField, TUid aFieldType, TDes& aName)
- 	{
- 	__UHEAP_MARK;
- 	if (aField.ContentType().ContainsFieldType(aFieldType))
- 		{
- 		TPtrC name = aField.TextStorage()->Text();
- 		aName = name.Left(Min(aName.MaxLength(), name.Length()));
- 		}
- 	__UHEAP_MARKEND;
-
-	}
-
-TBool TSmsUtilities::DoGetDescriptionL(const CSmsMessage& aMessage, TDes& aDescription, TInt aMaxLength)
-// this function returns EFalse if aMessage has no special message indication data and is not an SMS_STATUS_REPORT,
-// i.e. more needs to be done to extract the description from the message
-// otherwise returns ETrue
-	{
-	TInt resourceId = 0;
-	TBuf<KSmsDescriptionLength> format;
-	TSmsMessageIndicationType messageIndicationType;
-	TExtendedSmsIndicationType extendedType;
-	TSmsMessageProfileType messageProfileType;
-	TBool toStore=EFalse;
-	TUint totalIndicationCount=0;
-	TUint totalMessageCount=0;	
-	
-	//check if the messae contains an enhanced voice mail indication
-	CSmsEnhancedVoiceMailOperations& enhancedVoiceMailOperations = STATIC_CAST(CSmsEnhancedVoiceMailOperations&,aMessage.GetOperationsForIEL(CSmsInformationElement::ESmsEnhanceVoiceMailInformation));
-	
-	if(enhancedVoiceMailOperations.ContainsEnhancedVoiceMailIEL())
-		{
-		//get a copy of the indication
-		CEnhancedVoiceMailBoxInformation* retrievedNotification=enhancedVoiceMailOperations.CopyEnhancedVoiceMailIEL();
-		TVoiceMailInfoType typeInfo=retrievedNotification->Type();
-		//check its type
-		if(typeInfo==EGsmSmsVoiceMailNotification)
-			{
-			//increment the indication count
-			++totalIndicationCount;
-			resourceId = R_MESSAGE_INDICATION_ENHANCED_VOICEMAIL_ONE;	
-			}
-		
-		TUint8 messageCount=retrievedNotification->NumberOfVoiceMessages();
-		//add the message count to the running total
-		totalMessageCount+=messageCount;
-		//if there is more that one message of this type then set the resouce id to 'many'
-		if(messageCount!=1)
-			{
-			++resourceId;	
-			}
-		
-		delete retrievedNotification;
-		}  
-		
-	//check for special message waiting indications
-	CSmsSpecialSMSMessageOperations& operations = STATIC_CAST(CSmsSpecialSMSMessageOperations&,aMessage.GetOperationsForIEL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication));
-	TUint specialMessageIndicationCount=operations.GetCountOfSpecialMessageIndicationsL();	
-	
-	if(specialMessageIndicationCount!=0)
-		{
-		//add special message indications to out indication count
-		totalIndicationCount+=specialMessageIndicationCount;	
-		
-		if(totalIndicationCount>1) 
-			{
-			//set the resource id to R_MESSAGE_INDICATION_OTHER_ONE
-			resourceId = R_MESSAGE_INDICATION_OTHER_ONE;
-			//get the total number of messages from the indicatations
-			TUint8 messageCount=0;
-			for(TInt loopCount=0;loopCount<specialMessageIndicationCount;loopCount++)
-				{
-				operations.GetMessageIndicationIEL(loopCount,toStore,messageIndicationType,extendedType,messageProfileType,messageCount);
-				totalMessageCount+=messageCount;						
-				}
-			}
-		else
-			{
-			//there is only one indication, get it's type and the number of messages it holds.
-			TUint8 messageCount=0;
-			operations.GetMessageIndicationIEL(0,toStore,messageIndicationType,
-											extendedType,messageProfileType,messageCount);	
-		
-			//add the message count to the running total
-			totalMessageCount+=messageCount;
-		
-			switch (messageIndicationType)
-				{
-				case EGsmSmsVoiceMessageWaiting:
-					resourceId = R_MESSAGE_INDICATION_VOICEMAIL_ONE;
-					break;
-				
-				case EGsmSmsFaxMessageWaiting:
-					resourceId = R_MESSAGE_INDICATION_FAX_ONE;
-					break;
-				
-				case EGsmSmsElectronicMailMessageWaiting:
-					resourceId = R_MESSAGE_INDICATION_EMAIL_ONE;
-					break;
-					
-				case EGsmSmsExtendedMessageTypeWaiting:
-					//get the extended indications type
-					if(extendedType==EGsmSmsVideoMessageWaiting)
-						{
-						resourceId = R_MESSAGE_INDICATION_VIDEOMESSAGE_ONE;	
-						}
-					else
-						{
-						resourceId = R_MESSAGE_INDICATION_OTHER_ONE;	
-						}
-					break;
-					
-				default:
-					resourceId = R_MESSAGE_INDICATION_OTHER_ONE;
-					break;
-				}	
-			}
-		//if there is more that one message waiting append 'many' to the id.
-		if(totalMessageCount!=1)
-			{
-			resourceId++;	
-			}
-		}
-
-	const CSmsPDU& smsPDU= aMessage.SmsPDU();
-	// If no Special Msg Indication found in the User Data,
-	// then check the DataCodingScheme.
-	if (totalIndicationCount==0 && smsPDU.DataCodingSchemePresent())
-		{
-		TInt bits7to4 = smsPDU.Bits7To4();
-
-		switch (bits7to4)
-			{
-			case TSmsDataCodingScheme::ESmsDCSMessageWaitingIndication7Bit:
-			case TSmsDataCodingScheme::ESmsDCSMessageWaitingIndicationUCS2:
-				{
-				if (smsPDU.IndicationState() == TSmsDataCodingScheme::ESmsIndicationActive)
-					{
-					totalIndicationCount = 1;
-
-					switch (smsPDU.IndicationType())
-						{
-						case TSmsDataCodingScheme::ESmsVoicemailMessageWaiting:
-							resourceId = R_MESSAGE_INDICATION_VOICEMAIL_ONE;
-							break;
-						case TSmsDataCodingScheme::ESmsFaxMessageWaiting:
-							resourceId = R_MESSAGE_INDICATION_FAX_ONE;
-							break;
-						case TSmsDataCodingScheme::ESmsElectronicMailMessageWaiting:
-							resourceId = R_MESSAGE_INDICATION_EMAIL_ONE;
-							break;
-						case TSmsDataCodingScheme::ESmsFaxOtherMessageWaiting:
-						default:
-							resourceId = R_MESSAGE_INDICATION_OTHER_ONE;
-							break;
-						} //end switch
-					} //end if
-				} //end case
-			default:
-				{
-				break; //do nothing
-				}
-			}
-		}
-	
-	if (totalIndicationCount!=0)
-		{
-		//Special message found.
-		//Look up the resourceID in the SMSS resource file
-
-		RFs fs;
-		User::LeaveIfError(fs.Connect());
-		CleanupClosePushL(fs);
-		RResourceFile resFile = OpenResourceFileL(fs);
-		CleanupClosePushL(resFile);
-		ReadResourceStringL(resFile, resourceId, format);
-		CleanupStack::PopAndDestroy(2, &fs);
-
-		if (totalMessageCount == 1)
-			{
-			if (format.Length() <= aMaxLength)
-				{
-				aDescription = format;
-				}
-			else
-				{
-				// Truncate format so that it fits into aDescription.
-				aDescription = format.Left(aMaxLength);
-				}
-			}
-		else if (format.Length() < aMaxLength)
-			{
-			aDescription.Zero();
-			aDescription.AppendFormat(format, totalMessageCount);
-			}
-		return ETrue;
-		}
-	else
-		{
-		if(aMessage.Type() == CSmsPDU::ESmsStatusReport)
-			{
-			// for SMS_STATUS_REPORT messages, if we cannot read the string in, then
-			// we do not attempt to extract the description from the message: return EFalse
-			RFs fs;
-			User::LeaveIfError(fs.Connect());
-			CleanupClosePushL(fs);
-			RResourceFile resFile = OpenResourceFileL(fs);
-			CleanupClosePushL(resFile);
-			ReadResourceStringL(resFile, R_TYPE_STATUS_REPORT, aDescription);
-			CleanupStack::PopAndDestroy(2, &fs);
-			return ETrue;
-			}
-		else
-			{
-			return EFalse;
-			}
-		}
-	}
-
-
-void TSmsUtilities::ExtractDescriptionFromMessage(const CSmsMessage& aMessage, TDes& aDescription, TInt aMaxLength)
-	{
-	if(aMessage.Type() != CSmsPDU::ESmsStatusReport)
-		{
-		aMessage.Buffer().Extract(aDescription, 0, Min(aMaxLength, aMessage.Buffer().Length()));
-
-		TInt length = aDescription.Length();
-
-		//replace paragraphs with spaces.
-		while(length--)
-			{
-			TText& text = aDescription[length];
-			const TChar ch(text);
-			if (ch.IsSpace() || text == CEditableText::EParagraphDelimiter)
-				text = ' ';
-			}
-
-		aDescription.TrimAll(); //removes leading trailing and multiple internal whitespace (spaces, line feeds etc)
-		}
-	}
-
-void TSmsUtilities::Replace(const TDesC& aOld, const TDesC& aNew, TDes& aString)
-	{
-	TInt find = aString.Find(aOld);
-
-	if (find != KErrNotFound)
-		{
-		aString.Replace(find, aOld.Length(), aNew);
-		}
-	}
--- a/messagingappbase/smsmtm/clientmtm/src/smutsimparam.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,468 +0,0 @@
-// Copyright (c) 1999-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:
-// smutsimparam.cpp
-//
-#include <smutsimparam.h>
-
-#include <mmlist.h>
-
-#include "SMCMMAIN.H"
-#include <smscmds.h>
-#include "SMUTSET.H"
-
-/**
-The UID for the stream into which the SIM parameters are stored.
-
-@internalComponent
-@deprecated
-Should be moved to the cpp file for this class.
-*/
-const TUid KUidMsvSimSmsParams = {0x100081BC};
-
-/**
-Creates an operation that reads the SMS parameters from the SIM.
-
-@param	aMtm
-The UID for the SMS MTM.
-
-@param	aService
-The SMS Service settings Id.
-
-@param	aMsvSession
-A message server session.
-
-@param	aObserverRequestStatus
-The observer status to be completed.
-
-@return
-The operation encapsulating reading the SIM parameters. 
-
-@post
-The SMS parameters are stored in iSimParams.
-
-@internalComponent
-*/
-CSmsSimParamOperation* CSmsSimParamOperation::ReadSimParamsL(TUid aMtm, TMsvId aService, CMsvSession& aMsvSession, TRequestStatus& aObserverRequestStatus)
-	{
-	CSmsSimParamOperation* self = new (ELeave) CSmsSimParamOperation(aMtm, aService, aMsvSession, aObserverRequestStatus);
-	CleanupStack::PushL(self);
-	
-	self->iSimParams = CMobilePhoneSmspList::NewL();
-	self->iState = EStateReadingSimParams;
-	self->DoReadSimParamsL();
-	
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-/**
-Creates an operation that writes the SMS parameters to the SIM.
-
-@param	aList
-The list of SIM parameters to be written.
-
-@param	aMtm
-The UID for the SMS MTM.
-
-@param	aService
-The SMS Service settings Id.
-
-@param	aMsvSession
-A message server session.
-
-@param	aObserverRequestStatus
-The observer status to be completed.
-
-@return
-The operation encapsulating writing the SIM parameters. 
-
-@post
-The SMS parameters are stored in the SIM.
-
-@internalComponent
-*/
-CSmsSimParamOperation* CSmsSimParamOperation::WriteSimParamsL(const CMobilePhoneSmspList& aList, TUid aMtm, TMsvId aService, CMsvSession& aMsvSession, TRequestStatus& aObserverRequestStatus)
-	{
-	CSmsSimParamOperation* self = new (ELeave) CSmsSimParamOperation(aMtm, aService, aMsvSession, aObserverRequestStatus);
-	CleanupStack::PushL(self);
-	
-	self->iSimParams = CMobilePhoneSmspList::NewL();
-	self->iState = EStateWritingSimParams;
-	self->DoWriteSimParamsL(aList);
-	
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-/** 
-Gets the operation completion/error code for reading/writing the SMS parameters.
-
-It returns a packaged TInt (TIntBuf) and not a packaged TSmsProgress.
-
-The code can be intrepreted as follows:
-
-KErrNone - the SMS parameters were successfully read/writte from/to the SIM
-
-KErrNotSupported - the telephone handset and/or TSY module does not support 
-reading/writing the SMS parameters.
-
-KErrNotFound - no SMS parameters where found on the SIM.
-
-Other system-wide error codes - may indicate a comms, telephony or memory error.
-
-@return
-A TIntBuf containing the operation completion/error code.
-*/
-EXPORT_C const TDesC8& CSmsSimParamOperation::ProgressL()
-	{
-	iProgressBuf = TIntBuf(iError);
-	return iProgressBuf;
-	}
-
-/**
-Constructor.
-*/
-CSmsSimParamOperation::CSmsSimParamOperation(TUid aMtm, TMsvId aService, CMsvSession& aMsvSession, TRequestStatus& aObserverRequestStatus)
-:	CMsvOperation(aMsvSession, EPriorityStandard, aObserverRequestStatus),
-	iError(KErrNone)
-	{
-	iService = aService;
-	iMtm = aMtm;
-	CActiveScheduler::Add(this);
-	}
-
-/**
-Destructor.
-*/
-CSmsSimParamOperation::~CSmsSimParamOperation()
-	{
-	Cancel();
-	delete iSimParams;
-	delete iOperation;
-	}
-
-/**
-Retrieves the read SIM parameters from the stream in the SMS Service entry.
-
-The read SIM parameters are placed in the member data iSimParams.
-
-@pre
-The async read SIM parameters operation is complete.
-
-@post
-The parameters are retrived from the stream in the SMS Service entry and stored
-in iSimParams.
-
-@leave	KErrNotFound
-There were no SIM parameters to read from the SIM.
-*/
-void CSmsSimParamOperation::DoRunReadSimParamsL()
-	{
-	CMsvEntry* entry = iMsvSession.GetEntryL(iService);
-	CleanupStack::PushL(entry);
-			
-	CMsvStore* store = entry->ReadStoreL();
-	CleanupStack::PushL(store);
-
-	RestoreSimParamsL(*store, *iSimParams);
-
-	const TInt count = iSimParams->Enumerate();
-
-	if (!count)
-		User::Leave(KErrNotFound);
-
-	CleanupStack::PopAndDestroy(2, entry); //entry, store
-	}
-
-/**
-Completes the observer with the value in iError.
-*/
-void CSmsSimParamOperation::Complete()
-	{
-	TRequestStatus* status = &iObserverRequestStatus;
-	User::RequestComplete(status, iError);
-	}
-
-/**
-Reads the SIM parameters from the SIM.
-
-A read SIM parameters command is transferred to the SMS server MTM. It is this
-operation that does the actual reading of SIM parameters.
-
-@post
-A ESmsMtmCommandReadSimParams comand operation is started.
-*/
-void CSmsSimParamOperation::DoReadSimParamsL()
-	{
-	TransferCommandL(ESmsMtmCommandReadSimParams);
-	}
-
-/**
-Writes the SMS parameters to the SIM.
-
-The new parameters to be stored are written to a stream in the SMS Service entry.
-A write SIM parameters command is transferred to the SMS server MTM. It is this
-operation that does the actual writing of SIM parameters.
-
-@param	aList
-A list wit the new SIM parameters.
-
-@post
-The new SIM parameters are stored in the message store and a ESmsMtmCommandWriteSimParams
-comand operation is started.
-*/
-void CSmsSimParamOperation::DoWriteSimParamsL(const CMobilePhoneSmspList& aList)
-	{
-	CMsvEntry* entry = iMsvSession.GetEntryL(iService);
-	CleanupStack::PushL(entry);
-		
-	CMsvStore* store = entry->EditStoreL();
-	CleanupStack::PushL(store);
-
-	StoreSimParamsL(*store, aList);
-
-	CleanupStack::PopAndDestroy(2, entry); 
-
-	TransferCommandL(ESmsMtmCommandWriteSimParams);
-	}
-
-/**
-Requests the specified asynchronous command from the SMS server MTM.
-
-The command Ids are defined by TSmsMtmCommand.
-
-@param	aCommandId
-The Id of the requested command.
-
-@post
-The requested command is started.
-
-@see	TSmsMtmCommand
-*/
-void CSmsSimParamOperation::TransferCommandL(TInt aCommandId)
-	{
-	CMsvEntrySelection* sel = new (ELeave) CMsvEntrySelection();
-	CleanupStack::PushL(sel);
-	sel->AppendL(iService);
-
-	delete iOperation;
-	iOperation = NULL;
-	iOperation = iMsvSession.TransferCommandL(*sel, aCommandId, TPtrC8(), iStatus);
-
-	CleanupStack::PopAndDestroy(sel);
-	iObserverRequestStatus = KRequestPending;
-	SetActive();
-	}
-
-/**
-Gets a list of Service Centre addresses.
-
-This function can only be used after a read/write SIM parameters operation has
-completed. If the CSmsSimParamOperation::ProgressL API returns any an error
-code other than KErrNone, or the SIM parameters contain no Service Centre 
-addresses, then this function returns an empty list.
-
-@return
-The list of SMS parameters that only contain Service Centre addresses. A pointer
-to the list object is left on the cleanup stack.
-*/
-EXPORT_C CMobilePhoneSmspList* CSmsSimParamOperation::ServiceCentersLC() const
-	{
-	TInt count = 0;
-	count = iSimParams->Enumerate();
-
-	CMobilePhoneSmspList* list = CMobilePhoneSmspList::NewL();
-	CleanupStack::PushL(list);
-
-	// Order important
-	for (TInt i = 0; i < count; ++i)
-		{
-		const RMobileSmsMessaging::TMobileSmspEntryV1& smspEntry = iSimParams->GetEntryL(i);
-
-		if (smspEntry.iValidParams & RMobileSmsMessaging::KSCAIncluded)
-			{
-			list->AddEntryL(smspEntry);
-			}
-		}
-	return list;
-	}
-
-/**
-Stores the contents of aList into the message store.
-
-The supplied SIM parameters are stored in the KUidMsvSimSmsParams stream of the
-message entry store specified. This should be the SMS Service entry. No checking
-is performed to verify that the store is for the SMS service entry.
-
-@param	aStore
-The message entry store to write the parameters into.
-
-@param	aList
-The SMS parameters to be written.
-
-@post
-The contents of aList are stored in the message store. 
-
-@internalTechnology
-*/
-EXPORT_C void CSmsSimParamOperation::StoreSimParamsL(CMsvStore& aStore, const CMobilePhoneSmspList& aList)
-	{
-	aStore.Remove(KUidMsvSimSmsParams);
-	
-	RMsvWriteStream writeStream;
-	writeStream.AssignLC(aStore, KUidMsvSimSmsParams);
-
-	writeStream << aList;
-	writeStream.CommitL();
-	aStore.CommitL();
-
-	CleanupStack::PopAndDestroy(&writeStream);
-	}
-
-/**
-Restores the SIM parameters from message store.
-
-The SIM parameters are restored from the KUidMsvSimSmsParams stream of the 
-message entry store specified. This should be the SMS Service entry. No checking
-is performed to verify that the store is for the SMS service entry.
-
-@param	aStore
-The message entry store to read the parameters from.
-
-@param	aList
-An output argument to conatin the restored SMS parameters.
-
-@leave	KErrNotFound
-The stream did not exist in the specified message entry store.
-
-@post
-The output argument aList contains the restored SIM parameters.
-
-@internalTechnology
-*/
-EXPORT_C void CSmsSimParamOperation::RestoreSimParamsL(CMsvStore& aStore, CMobilePhoneSmspList& aList)
-	{
-	if (aStore.IsPresentL(KUidMsvSimSmsParams))
-		{
-		RMsvReadStream readStream;
-		readStream.OpenLC(aStore, KUidMsvSimSmsParams);
-
-		readStream >> aList;
-		readStream.Close();
-
-		CleanupStack::PopAndDestroy(&readStream); 
-		}
-	else
-		{
-		User::Leave(KErrNotFound);
-		}
-	}
-
-/*
- *	Methods from CActive
- */
-
-/**
-Handles completed async operations.
-
-If the async operation was to read the SIM parameters, then the SIM parameters 
-are read from the appropriate stream in the SMS Service entry and placed in the
-parameter member iSimParams.
-
-If the async operation was to read the SIM parameters, then there is nothing 
-more to do.
-
-For both types of operation the observer for this operation is completed.
-
-@pre
-The async operation is complete
-
-@post
-The operation is complete
-
-@leave	KErrNotFound
-There were no SIM parameters to read from the SIM.
-
-@panic	SMCM	3
-There was an supported command.
-*/
-void CSmsSimParamOperation::RunL()
-	{
-	iError = iStatus.Int();
-
-	if (iError == KErrNone)
-		{
-		TSmsProgressBuf progressBuf;
-		progressBuf.Copy(iOperation->ProgressL());
-		TSmsProgress progress = progressBuf();
-
-		iError = progress.iError;
-
-		if (iError == KErrNone)
-			{
-			switch (iState)
-				{
-				case EStateReadingSimParams:
-					{
-					DoRunReadSimParamsL();
-					break;
-					}
-				case EStateWritingSimParams:
-					{
-					break;
-					}
-				default:
-					{
-					Panic(ESmscPanicUnexpectedCommand);
-					}
-				}
-			}
-		}
-	
-	Complete();
-	}
-
-/**
-Cancels any pending async request.
-
-The observer is completed with an value of KErrCancel.
-*/
-void CSmsSimParamOperation::DoCancel()
-	{
-	if (iOperation)
-		{
-		iOperation->Cancel();
-		}
-
-	iError = KErrCancel;
-	Complete();
-	}
-
-/**
-Handles leaves from RunL().
-
-The observer is completed with the leave code aError.
-
-@param	aError
-The leave code from RunL().
-
-@return
-A value of KErrNone.
-*/
-TInt CSmsSimParamOperation::RunError(TInt aError)
-	{
-	iError = aError;
-	Complete();
-	return KErrNone;
-	}
--- a/messagingappbase/smsmtm/clientmtm/test/Unittef/group/t_sms_header_and_body_Sql_migration.iby	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef __T_SMS_HEADER_AND_BODY_SQL_MIGRATION_IBY__
-#define __T_SMS_HEADER_AND_BODY_SQL_MIGRATION_IBY__
-
-#include <testexecute.iby>
-
-file=ABI_DIR\BUILD_DIR\t_sms_header_and_body_Sql_migration.exe		sys\bin\t_sms_header_and_body_Sql_migration.exe
-data=EPOCROOT##Epoc32\winscw\c\msgtest\sms\t_sms_header_and_body_Sql_migration.script TestData\Scripts\t_sms_header_and_body_Sql_migration.script
-
-#endif
--- a/messagingappbase/smsmtm/clientmtm/test/Unittef/group/t_sms_header_and_body_Sql_migration.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
-* Copyright (c) 1998-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:
-*
-*/
-
-
-
-TARGET      t_sms_header_and_body_Sql_migration.exe
-TARGETTYPE  exe
-UID             0x1000007A 0x101F6789   //????
-
-CAPABILITY ALL -TCB
-
-SOURCEPATH		../src
-SOURCE			csmsheaderbodySqlmigration.cpp
-SOURCE 			csmsheaderbodySqlstorerestore.cpp
-
-
-STATICLIBRARY	tefunit.lib
-
-USERINCLUDE   ../inc
-USERINCLUDE   ../../../inc
-
-SYSTEMINCLUDE	  /epoc32/include
-SYSTEMINCLUDE	  /epoc32/include/test
-
-
-LIBRARY		euser.lib
-LIBRARY		testexecuteutils.lib 
-LIBRARY		testexecutelogclient.lib
-LIBRARY		sqldb.lib
-LIBRARY		estor.lib
-LIBRARY		efsrv.lib
-LIBRARY		rfileloggerclient.lib 
-LIBRARY     bafl.lib etext.lib charconv.lib centralrepository.lib 
-LIBRARY     flogger.lib
-
-
-
-LIBRARY     msgs.lib smstestutils.lib msvtestutils.lib commsdat.lib 
-LIBRARY		smcm.lib esock.lib smsu.lib c32.lib gsmu.lib  etel.lib etelmm.lib
-
-
-SMPSAFE //????
--- a/messagingappbase/smsmtm/clientmtm/test/Unittef/inc/csmsheaderbodySqlstorerestore.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-// Copyright (c) 2006-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:
-// file  CTestHeaderStoreReStore.h
-// This contains Ut for Sms header migration.
-// 
-
-#include <tefunit.h>
-#include <testexecutestepbase.h>
-#include <smstestutils.h>
-#include <es_sock.h>
-
-class EntryObserver : public MMsvEntryObserver
-	{
-	public:
-		virtual void HandleEntryEventL(TMsvEntryEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);		
-	};
-	
-class SessionObserver : public MMsvSessionObserver
-	{
-	public:
-		virtual void HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/){};
-	};
-
-class CTestHeaderStoreReStore : public  CActiveTestFixture
-// WARNING: Despite being a C class, CActiveTestFixture is NOT derrived from CBase
-// ... so don't expect your data members to be zero'ed
-	{
-public:
-	CTestHeaderStoreReStore(); 
-	virtual ~CTestHeaderStoreReStore();
-	void SetupL();
-	void TearDownL();
-	
-		
-	static CTestSuite* CreateSuiteL(const TDesC& aName);
-
-	void TestStoreHeaderL();
-	void TestReStoreHeaderL();
-	void InitialiseTestL();
-	void SetRecipientsL(CSmsHeader& aHeader);
-	
-	void TestStoreReStoreSMSHeaderL();
-	void TestReStoreSMSHeaderL();
-	
-	void SetEmptyRecipientsL(CSmsHeader& aHeader);
-	
-	void TestStoreReStoreEOSSMSHeaderL();
-	void TestReStoreEOSHeaderL();
-	
-	
-	void TestStoreReStoreEmptyEOSSMSHeaderL();
-	void TestReStoreEmptyEOSHeaderL();
-
-	void TestReStoreMultipuleEOSRecipientSMSHeaderL();
-	void TestMultipuleEOSRecipientSMSHeaderL();
-	
-	void TestEmptyEOSSubjectSMSHeaderL();
-	void TestReStoreEmptySubjectSMSHeaderL();
-	
-private:
-	CSmsTestUtils* iTestUtils;
-	EntryObserver* iEntryObserver;
-	CMsvSession* iSession;
-	SessionObserver* iSessionObserver;
-	CMsvEntry* iEntry;
-	CActiveScheduler* iScheduler;
-	CTestUtilsWatcherStarter* iWatchers;
-	CMsvOperation* iOperation;
-	TMsvId iMessageId;
-	CTestActive* iTestActive;
-	CSmsHeader* iheader;
-	CSmsHeader* iReceiveheader;
-	
-
-
-};
--- a/messagingappbase/smsmtm/clientmtm/test/Unittef/script/t_sms_header_and_body_Sql_migration.script	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +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:
-//
-
-PRINT Run all t_sms_header_and_body_Sql_migration Tests 
-LOAD_SUITE t_sms_header_and_body_Sql_migration
-RUN_TEST_STEP 1000 t_sms_header_and_body_Sql_migration TEFUnit.CTestHeaderStoreReStore.*
--- a/messagingappbase/smsmtm/clientmtm/test/Unittef/src/csmsheaderbodySqlmigration.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-// Copyright (c) 2006-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:
-// file  csmsheaderbodySqlmigration.cpp
-// This contains Ut for Sms header migration.
-// 
-
-#include <ctefunitserver.h>
-#include "csmsheaderbodySqlstorerestore.h"
-
-
-_LIT(KServerName, "t_sms_header_and_body_Sql_migration");
-
-GLDEF_C const TTestName ServerName()
-	{
-	TTestName serverName(KServerName);
-	return serverName;
-	}
-
-GLDEF_C CTestSuite* CreateTestSuiteL()
-	{	
-	START_SUITE;
- 	ADD_TEST_SUITE(CTestHeaderStoreReStore);
- 	END_SUITE;
-	}
-
-GLDEF_C CTestStep* CreateTEFTestStep(const TDesC& /*aStepName*/, CTEFUnitServer& /*aServer*/)
-	{
-	// Initialise test step object to NULL if no TEF steps are assigned
-	CTestStep* testStep = NULL;
-	/*
-	if(aStepName == KSampleStep1)
-		{
-		testStep = new CSampleStep1(aServer);
-		}
-	*/
-	return testStep;
-	}
-
--- a/messagingappbase/smsmtm/clientmtm/test/Unittef/src/csmsheaderbodySqlstorerestore.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,861 +0,0 @@
-// Copyright (c) 2006-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:
-// file  CTestHeaderStoreReStore.cpp
-// This contains Ut for Sms header migration.
-// 
-
-#include "csmsheaderbodySqlstorerestore.h"
-#include <smuthdr.h>
-#include <txtrich.h>
-#include <msvuids.h>
-#include <smsuaddr.h>
-#include <csmsaccount.h>
-#include <Smut.h>
-#include <sqldb.h>
-#include <csmsemailfields.h>
-
-
-#define MY_ASSERT_TRUE(a)  \
-		INFO_PRINTF1(KFunction);   \
-		ASSERT_TRUE(a);
-#define MY_ASSERT_FALSE(a)  \
-		INFO_PRINTF1(KFunction);   \
-		ASSERT_FALSE(a);
-#define MY_ASSERT_EQUALS(a,b)  \
-		INFO_PRINTF1(KFunction);   \
-		ASSERT_EQUALS(a,b);
-
-
-
-_LIT(KDbFileName, "\\messaging.db");
-
-
-const TTimeIntervalMicroSeconds32 KWaitForWatchersToStart = 20000000;
-const TTimeIntervalMicroSeconds32 KWaitForWatchersToStartDisplayInterval = 5000000;
-
-_LIT(KMessageData, "This is a simple text message");
-_LIT(KRecipientOk,		"+44111111111");  // has to be valid number and switched on
-_LIT(KRecipientOk1,		"+44111111115");  // has to be valid number and switched on
-_LIT(KRecipientOk3,		"+44111111119");  // has to be valid number and switched on
-_LIT(KRecipientName,		"XYx"); 
-_LIT(KRecipientName1,		"Sukanta"); 
-_LIT(KRealAddress,		"XYZ@nokia.com"); 
-_LIT(KRealAddress1,		"Abc123@nokia.com"); 
-_LIT(KRealAddress11,		""); 
-_LIT(KSubject, "Subject subject");
-_LIT(KRecipientEmpty, "");
-
-
-RTest test(_L("TestStoreReStore1"));
-
-CTestHeaderStoreReStore::CTestHeaderStoreReStore()
-	{
-	}
-
-CTestHeaderStoreReStore::~CTestHeaderStoreReStore()
-	{
-	}
-
-
-void CTestHeaderStoreReStore::SetupL()
-	{
-	_LIT(KFunction, "SetupL");
-	INFO_PRINTF1(KFunction);
-	
-	TParse parse;
-	TPtrC drive = TDriveUnit(EDriveC).Name();
-	parse.Set(KDbFileName, &drive, NULL);
-	TFileName dbFile = parse.FullName();
-	RSqlDatabase::Delete(dbFile);
-
-	InitialiseTestL();
-	}
-
-void CTestHeaderStoreReStore::TearDownL()
-	{
-	_LIT(KFunction, "TearDownL");
-	INFO_PRINTF1(KFunction);
-	
-	delete iTestUtils;
-	iTestUtils = NULL;
-	
-	delete iTestActive;
-	iTestActive = NULL;
-	
-	delete iEntryObserver;
-	iEntryObserver = NULL;
-	
-	delete iSessionObserver;
-	iSessionObserver = NULL;
-	
-	delete iSession;
-	iSession = NULL;
-	
-	delete iheader;
-	iheader = NULL;
-	
-	delete iReciveheader;
-	iReciveheader = NULL;
-	}
-
-
-void EntryObserver::HandleEntryEventL(TMsvEntryEvent aEvent, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
-	{
-	switch (aEvent)
-		{
-			case EMsvEntryChanged:
-				{
-				break;
-				}
-			case EMsvNewChildren:
-				{	
-				CActiveScheduler::Stop();
-				break;
-				}
-						
-		default:
-				{
-				break;
-				}
-		}
-	}
-	
-void CTestHeaderStoreReStore::InitialiseTestL()
-	{
-	INFO_PRINTF1(_L("Initialising the test..."));
-	iTestUtils = CSmsTestUtils::NewL(test);	
-	// Notify the system agent that the phone is on.
-	iTestUtils->NotifySaPhoneOnL();
-	
-	// Restore the service settings.
-	iTestUtils->SetEntryL(iTestUtils->iSmsServiceId);
-	CSmsAccount* account = CSmsAccount::NewLC();
-	account->LoadSettingsL(*iTestUtils->iServiceSettings);
-	
-	// Remove the default service centres from the service settings
-	TInt count = iTestUtils->iServiceSettings->ServiceCenterCount();
-	while( count-- )
-		{
-		iTestUtils->iServiceSettings->RemoveServiceCenter(count);
-		}
-		
-	// Add the Vodafone service centre - store the settings.
-	iTestUtils->iServiceSettings->AddServiceCenterL(_L("Vodafone"), _L("+447785016005"));
-
-	// Set delivery options - do matching and make reports visible.	
-	iTestUtils->iServiceSettings->SetDeliveryReport(ETrue);
-	iTestUtils->iServiceSettings->SetStatusReportHandling(CSmsSettings::EMoveReportToInboxVisibleAndMatch);
-
-	account->SaveSettingsL(*iTestUtils->iServiceSettings);
-	CleanupStack::PopAndDestroy(account);
-
-	// set up an opserver to observe the inbox
-	iEntryObserver = new (ELeave) EntryObserver();
-	iSessionObserver = new (ELeave) SessionObserver();
-	iSession = CMsvSession::OpenSyncL(*iSessionObserver);
-	TMsvSelectionOrdering ordering;	
-	iEntry = CMsvEntry::NewL(*iSession, KMsvGlobalInBoxIndexEntryIdValue,ordering);
-	iEntry->AddObserverL(*iEntryObserver);
-	
-	//used for acynchronous calls
-	iTestActive=new(ELeave) CTestActive;
-	
-	INFO_PRINTF1(_L("Successfully initialised test"));
-	
-}
-
-void CTestHeaderStoreReStore::SetRecipientsL(CSmsHeader& aHeader)
-	{
-	iTestUtils->Printf(_L("--Setting single recipient\n"));
-	
-	CSmsNumber* rcpt = CSmsNumber::NewL();
-	CleanupStack::PushL(rcpt);
-	rcpt->SetAddressL(KRecipientOk);
-	rcpt->SetNameL(KRecipientName);
-	aHeader.Recipients().AppendL(rcpt);
-	CleanupStack::Pop(rcpt);
-	}
-	
-void CTestHeaderStoreReStore::SetEmptyRecipientsL(CSmsHeader& aHeader)
-	{
-	iTestUtils->Printf(_L("--Setting single recipient\n"));
-	
-	CSmsNumber* rcpt = CSmsNumber::NewL();
-	CleanupStack::PushL(rcpt);
-	rcpt->SetAddressL(KRecipientEmpty);
-	aHeader.Recipients().AppendL(rcpt);
-	CleanupStack::Pop(rcpt);
-	}
-
-void CTestHeaderStoreReStore::TestStoreHeaderL()
-	{
-	
-	_LIT(KFunction, ":Test For Store SMS Header ");
-	INFO_PRINTF1(KFunction);
-
-	
-	TMsvEntry entry;
-	entry.SetVisible(ETrue); 
-	entry.SetInPreparation(ETrue); 
-	entry.iServiceId = iTestUtils->iSmsServiceId; 
-	entry.iType = KUidMsvMessageEntry; 
-	entry.iMtm = KUidMsgTypeSMS; 
-	entry.iDate.HomeTime(); 
-	entry.iSize = 0; 
-	entry.iDescription.Set(KNullDesC); 
-	entry.iDetails.Set(KNullDesC); 
-	entry.SetSendingState(KMsvSendStateScheduled);
-	
-
-	// Create the SMS header object...
-	iheader = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils->iRichText);
-		
-	// Set the body text...
-	iTestUtils->iRichText->Reset();
-	iTestUtils->iRichText->InsertL(0, KMessageData);
-	
-	// Copy the message settings...
-	iheader->SetSmsSettingsL(*iTestUtils->iServiceSettings); 
-	
-	// Set the service centre
-	TInt defaultIndex = iTestUtils->iServiceSettings->DefaultServiceCenter();
-	iheader->SetServiceCenterAddressL(iTestUtils->iServiceSettings->GetServiceCenter(defaultIndex).Address());
-
-	// Set recipient - ask derived class
-	SetRecipientsL(*iheader);
-	
-	CSmsNumber* rcpt1 = CSmsNumber::NewL();
-	rcpt1->SetStatus((CMsvRecipient::TRecipientStatus)1);
-	rcpt1->SetError(2);
-	rcpt1->SetRetries(3);
-	TTime date;
-	date.UniversalTime();
-	rcpt1->SetTimeValue(date.Int64());
-	
-	rcpt1->SetAddressL(KRecipientOk1);
-	rcpt1->SetNameL(KRecipientName);
-	iheader->Recipients().AppendL(rcpt1);
-
-	CSmsNumber* rcpt2 = CSmsNumber::NewL();
-	rcpt2->SetAddressL(KRecipientOk3);
-	rcpt2->SetNameL(KRecipientName);
-	iheader->Recipients().AppendL(rcpt2);
-
-	CSmsNumber* rcpt3 = CSmsNumber::NewL();
-	rcpt3->SetAddressL(KRecipientOk3);
-	rcpt3->SetNameL(KRecipientName1);
-	iheader->Recipients().AppendL(rcpt3);
-
-	_LIT(KFunction1, ":Test For Store Email over SMS Header ");
-	INFO_PRINTF1(KFunction1);
-
-	
-	CSmsEmailFields* emailFields = NULL;
-    emailFields = CSmsEmailFields::NewL( iheader->EmailFields() );
-    emailFields->AddAddressL(KRealAddress);
-    emailFields->AddAddressL(KRealAddress1);
-    emailFields->SetSubjectL(KSubject);
-    iheader->SetEmailFieldsL( *emailFields );
- 
-	iTestUtils->Printf(_L("--Setting single recipient Done \n"));
-	
-	// Create the entry - set context to the global outbox.
-	iTestUtils->iMsvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);
-	iTestUtils->iMsvEntry->CreateL(entry);
-
-	// Create new store and save header information 
-	iTestUtils->iMsvEntry->SetEntryL(entry.Id()); 
-	CMsvStore* store = iTestUtils->iMsvEntry->EditStoreL();
-	CleanupStack::PushL(store); 
-	iheader->StoreL(*store);
-	store->CommitL();
-	CleanupStack::PopAndDestroy(1); //store 
-	
-	INFO_PRINTF1(_L("Successfully Message header Stored"));
-	
-	TestReStoreHeaderL();
-	}
-
-void CTestHeaderStoreReStore::TestReStoreHeaderL()
-	{
-
-	_LIT(KFunction, ":Test For ReStore SMS Header ");
-	INFO_PRINTF1(KFunction);
-
-			
-	TMsvSelectionOrdering ordering;	
-	ordering.ShowInvisibleEntries();
-	CMsvEntry* entry = CMsvEntry::NewL(*iSession, KMsvGlobalOutBoxIndexEntryId,ordering);
-	CleanupStack::PushL(entry);
-	
-	CMsvEntrySelection* msvEntrySelection;
-	msvEntrySelection=entry->ChildrenL();
-	CleanupStack::PushL(msvEntrySelection);
-	
-	// Check how many mesasges there are - should be just 1
-	TInt count = msvEntrySelection->Count();
-	INFO_PRINTF3(_L("Number of new messages: %d, should be: %d"), count, 1);
-	ASSERT_TRUE(count == 1);
-
-
-	// Restore the message
-	iReciveheader = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *iTestUtils->iRichText);
-	entry->SetEntryL((*msvEntrySelection)[0]);
-
-	CMsvStore* store = entry->ReadStoreL();
-	CleanupStack::PushL(store);	
-	iTestUtils->Printf(_L("--Restore \n"));
-	iReceiveheader->RestoreL(*store);
-	
-	//Check for a recipient count
-	
-	TInt cc= iReceiveheader->Recipients().Count();
-	ASSERT_EQUALS(cc,4);
-	
-	_LIT(KFunction1, ":Test For ReStore Email over SMS Header ");
-	INFO_PRINTF1(KFunction1);
-
-	CSmsEmailFields* emailFields = NULL;
-    emailFields = CSmsEmailFields::NewL(iReceiveheader->EmailFields());
-	
-	const MDesCArray& addresses = emailFields->Addresses();
-	count = addresses.MdcaCount();
-	ASSERT_EQUALS(count,2);
-	
-	for( TInt i=0; i < count; ++i )
-		{
-		addresses.MdcaPoint(i);		
-		}
-	
-	CleanupStack::PopAndDestroy(3,entry);	
-	INFO_PRINTF1(_L("Successfully Message header ReStored"));
-
-	}
-	
-
-void CTestHeaderStoreReStore::TestStoreReStoreSMSHeaderL()
-	{
-	
-	_LIT(KFunction, ":Test For Store SMS Header ");
-	INFO_PRINTF1(KFunction);
-
-	
-	TMsvEntry entry;
-	entry.SetVisible(ETrue); 
-	entry.SetInPreparation(ETrue); 
-	entry.iServiceId = iTestUtils->iSmsServiceId; 
-	entry.iType = KUidMsvMessageEntry; 
-	entry.iMtm = KUidMsgTypeSMS; 
-	entry.iDate.HomeTime(); 
-	entry.iSize = 0; 
-	entry.iDescription.Set(KNullDesC); 
-	entry.iDetails.Set(KNullDesC); 
-	entry.SetSendingState(KMsvSendStateScheduled);
-	
-
-	// Create the SMS header object...
-	iheader = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils->iRichText);
-		
-	// Set the body text...
-	iTestUtils->iRichText->Reset();
-	iTestUtils->iRichText->InsertL(0, KMessageData);
-	
-	// Copy the message settings...
-	iheader->SetSmsSettingsL(*iTestUtils->iServiceSettings); 
-	
-	// Set the service centre
-	TInt defaultIndex = iTestUtils->iServiceSettings->DefaultServiceCenter();
-	iheader->SetServiceCenterAddressL(iTestUtils->iServiceSettings->GetServiceCenter(defaultIndex).Address());
-
-
-	_LIT(KFunction1, ":Test For Store Email over SMS Header ");
-	INFO_PRINTF1(KFunction1);
-
-	
- 
-	iTestUtils->Printf(_L("--Setting single recipient Done \n"));
-	
-	// Create the entry - set context to the global outbox.
-	iTestUtils->iMsvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);
-	iTestUtils->iMsvEntry->CreateL(entry);
-
-	// Create new store and save header information 
-	iTestUtils->iMsvEntry->SetEntryL(entry.Id()); 
-	CMsvStore* store = iTestUtils->iMsvEntry->EditStoreL();
-	CleanupStack::PushL(store); 
-	
-	iheader->StoreL(*store);
-	
-	store->CommitL();
-	CleanupStack::PopAndDestroy(1);//Store 
-	
-	INFO_PRINTF1(_L("Successfully Message header Stored"));
-	
-	TestReStoreSMSHeaderL();
-	}
-
-void CTestHeaderStoreReStore::TestReStoreSMSHeaderL()
-	{
-
-	_LIT(KFunction, ":Test For ReStore SMS Header ");
-	INFO_PRINTF1(KFunction);
-
-			
-	TMsvSelectionOrdering ordering;	
-	ordering.ShowInvisibleEntries();
-	CMsvEntry* entry = CMsvEntry::NewL(*iSession, KMsvGlobalOutBoxIndexEntryId,ordering);
-	CleanupStack::PushL(entry);
-	
-	CMsvEntrySelection* msvEntrySelection;
-	msvEntrySelection=entry->ChildrenL();
-	CleanupStack::PushL(msvEntrySelection);
-	
-	// Check how many mesasges there are - should be just 1
-	TInt count = msvEntrySelection->Count();
-	INFO_PRINTF3(_L("Number of new messages: %d, should be: %d"), count, 1);
-	ASSERT_TRUE(count == 1);
-
-
-	// Restore the message
-	iReceiveheader = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *iTestUtils->iRichText);
-	entry->SetEntryL((*msvEntrySelection)[0]);
-
-	CMsvStore* store = entry->ReadStoreL();
-	CleanupStack::PushL(store);	
-	iTestUtils->Printf(_L("--Restore \n"));
-	iReceiveheader->RestoreL(*store);
-	
-	
-	_LIT(KFunction1, ":Test For ReStore Email over SMS Header ");
-	INFO_PRINTF1(KFunction1);
-
-	CleanupStack::PopAndDestroy(3,entry);	
-	INFO_PRINTF1(_L("Successfully Message header ReStored"));
-	}
-
-
-void CTestHeaderStoreReStore::TestStoreReStoreEOSSMSHeaderL()
-	{
-	
-	_LIT(KFunction, ":Test For Store SMS Header ");
-	INFO_PRINTF1(KFunction);
-
-	
-	TMsvEntry entry;
-	entry.SetVisible(ETrue); 
-	entry.SetInPreparation(ETrue); 
-	entry.iServiceId = iTestUtils->iSmsServiceId; 
-	entry.iType = KUidMsvMessageEntry; 
-	entry.iMtm = KUidMsgTypeSMS; 
-	entry.iDate.HomeTime(); 
-	entry.iSize = 0; 
-	entry.iDescription.Set(KNullDesC); 
-	entry.iDetails.Set(KNullDesC); 
-	entry.SetSendingState(KMsvSendStateScheduled);
-	
-
-	// Create the SMS header object...
-	iheader = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils->iRichText);
-	
-	// Set the body text...
-	iTestUtils->iRichText->Reset();
-	iTestUtils->iRichText->InsertL(0, KMessageData);
-	
-	// Copy the message settings...
-	iheader->SetSmsSettingsL(*iTestUtils->iServiceSettings); 
-	
-	// Set the service centre
-	TInt defaultIndex = iTestUtils->iServiceSettings->DefaultServiceCenter();
-	iheader->SetServiceCenterAddressL(iTestUtils->iServiceSettings->GetServiceCenter(defaultIndex).Address());
-
-	// Set recipient - ask derived class
-
-	_LIT(KFunction1, ":Test For Store Email over SMS Header ");
-	INFO_PRINTF1(KFunction1);
-
-	
-	CSmsEmailFields* emailFields = NULL;
-    emailFields = CSmsEmailFields::NewL( iheader->EmailFields() );
-    emailFields->AddAddressL(KRealAddress11);
-    iheader->SetEmailFieldsL( *emailFields );
- 
-	iTestUtils->Printf(_L("--Setting single recipient Done \n"));
-	
-	// Create the entry - set context to the global outbox.
-	iTestUtils->iMsvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);
-	iTestUtils->iMsvEntry->CreateL(entry);
-
-	// Create new store and save header information 
-	iTestUtils->iMsvEntry->SetEntryL(entry.Id()); 
-	CMsvStore* store = iTestUtils->iMsvEntry->EditStoreL();
-	CleanupStack::PushL(store); 
-	iheader->StoreL(*store);
-
-	store->CommitL();
-	CleanupStack::PopAndDestroy(1);//Store 
-	
-	INFO_PRINTF1(_L("Successfully Message header Stored"));
-	
-	TestReStoreEOSHeaderL();
-	}
-
-void CTestHeaderStoreReStore::TestReStoreEOSHeaderL()
-	{
-
-	_LIT(KFunction, ":Test For ReStore SMS Header ");
-	INFO_PRINTF1(KFunction);
-
-			
-	TMsvSelectionOrdering ordering;	
-	ordering.ShowInvisibleEntries();
-	CMsvEntry* entry = CMsvEntry::NewL(*iSession, KMsvGlobalOutBoxIndexEntryId,ordering);
-	CleanupStack::PushL(entry);
-	
-	CMsvEntrySelection* msvEntrySelection;
-	msvEntrySelection=entry->ChildrenL();
-	CleanupStack::PushL(msvEntrySelection);
-	
-	// Check how many mesasges there are - should be just 1
-	TInt count = msvEntrySelection->Count();
-	INFO_PRINTF3(_L("Number of new messages: %d, should be: %d"), count, 1);
-	ASSERT_TRUE(count == 1);
-
-
-	// Restore the message
-	iReciveheader = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *iTestUtils->iRichText);
-	entry->SetEntryL((*msvEntrySelection)[0]);
-
-	CMsvStore* store = entry->ReadStoreL();
-	CleanupStack::PushL(store);	
-	iTestUtils->Printf(_L("--Restore \n"));
-	iReciveheader->RestoreL(*store);
-	
-	CleanupStack::PopAndDestroy(3,entry);	
-	INFO_PRINTF1(_L("Successfully Message header ReStored"));
-
-	}
-
-void CTestHeaderStoreReStore::TestStoreReStoreEmptyEOSSMSHeaderL()
-	{
-	
-	_LIT(KFunction, ":Test For Store SMS Header ");
-	INFO_PRINTF1(KFunction);
-
-	
-	TMsvEntry entry;
-	entry.SetVisible(ETrue); 
-	entry.SetInPreparation(ETrue); 
-	entry.iServiceId = iTestUtils->iSmsServiceId; 
-	entry.iType = KUidMsvMessageEntry; 
-	entry.iMtm = KUidMsgTypeSMS; 
-	entry.iDate.HomeTime(); 
-	entry.iSize = 0; 
-	entry.iDescription.Set(KNullDesC); 
-	entry.iDetails.Set(KNullDesC); 
-	entry.SetSendingState(KMsvSendStateScheduled);
-	
-
-	// Create the SMS header object...
-	iheader = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils->iRichText);
-	
-	// Set the body text...
-	iTestUtils->iRichText->Reset();
-	iTestUtils->iRichText->InsertL(0, KMessageData);
-	
-	// Copy the message settings...
-	iheader->SetSmsSettingsL(*iTestUtils->iServiceSettings); 
-	
-	// Set the service centre
-	TInt defaultIndex = iTestUtils->iServiceSettings->DefaultServiceCenter();
-	iheader->SetServiceCenterAddressL(iTestUtils->iServiceSettings->GetServiceCenter(defaultIndex).Address());
-
-	_LIT(KFunction1, ":Test For Store Email over SMS Header ");
-	INFO_PRINTF1(KFunction1);
-
-	
-	CSmsEmailFields* emailFields = NULL;
-    emailFields = CSmsEmailFields::NewL( iheader->EmailFields() );
-    iheader->SetEmailFieldsL( *emailFields );
- 
-	iTestUtils->Printf(_L("--Setting single recipient Done \n"));
-	
-	// Create the entry - set context to the global outbox.
-	iTestUtils->iMsvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);
-	iTestUtils->iMsvEntry->CreateL(entry);
-
-	// Create new store and save header information 
-	iTestUtils->iMsvEntry->SetEntryL(entry.Id()); 
-	CMsvStore* store = iTestUtils->iMsvEntry->EditStoreL();
-	CleanupStack::PushL(store); 
-	iheader->StoreL(*store);
-
-	store->CommitL();
-	CleanupStack::PopAndDestroy(1);//store
-	
-	INFO_PRINTF1(_L("Successfully Message header Stored"));
-	
-	TestReStoreEmptyEOSHeaderL();
-	}
-
-void CTestHeaderStoreReStore::TestReStoreEmptyEOSHeaderL()
-	{
-
-	_LIT(KFunction, ":Test For ReStore SMS Header ");
-	INFO_PRINTF1(KFunction);
-
-			
-	TMsvSelectionOrdering ordering;	
-	ordering.ShowInvisibleEntries();
-	CMsvEntry* entry = CMsvEntry::NewL(*iSession, KMsvGlobalOutBoxIndexEntryId,ordering);
-	CleanupStack::PushL(entry);
-	
-	CMsvEntrySelection* msvEntrySelection;
-	msvEntrySelection=entry->ChildrenL();
-	CleanupStack::PushL(msvEntrySelection);
-	
-	// Check how many mesasges there are - should be just 1
-	TInt count = msvEntrySelection->Count();
-	INFO_PRINTF3(_L("Number of new messages: %d, should be: %d"), count, 1);
-	ASSERT_TRUE(count == 1);
-
-
-	// Restore the message
-	iReceiveheader = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *iTestUtils->iRichText);
-	entry->SetEntryL((*msvEntrySelection)[0]);
-
-	CMsvStore* store = entry->ReadStoreL();
-	CleanupStack::PushL(store);	
-	iTestUtils->Printf(_L("--Restore \n"));
-	iReceiveheader->RestoreL(*store);
-	
-	CleanupStack::PopAndDestroy(3,entry);	
-	INFO_PRINTF1(_L("Successfully Message header ReStored"));
-
-	}
-
-void CTestHeaderStoreReStore::TestMultipuleEOSRecipientSMSHeaderL()
-	{
-	
-	_LIT(KFunction, ":Test For Store SMS Header ");
-	INFO_PRINTF1(KFunction);
-
-	TMsvEntry entry;
-	entry.SetVisible(ETrue); 
-	entry.SetInPreparation(ETrue); 
-	entry.iServiceId = iTestUtils->iSmsServiceId; 
-	entry.iType = KUidMsvMessageEntry; 
-	entry.iMtm = KUidMsgTypeSMS; 
-	entry.iDate.HomeTime(); 
-	entry.iSize = 0; 
-	entry.iDescription.Set(KNullDesC); 
-	entry.iDetails.Set(KNullDesC); 
-	entry.SetSendingState(KMsvSendStateScheduled);
-	
-
-	// Create the SMS header object...
-	iheader = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils->iRichText);
-	
-	// Set the body text...
-	iTestUtils->iRichText->Reset();
-	iTestUtils->iRichText->InsertL(0, KMessageData);
-	
-	// Copy the message settings...
-	iheader->SetSmsSettingsL(*iTestUtils->iServiceSettings); 
-	
-	// Set the service centre
-	TInt defaultIndex = iTestUtils->iServiceSettings->DefaultServiceCenter();
-	iheader->SetServiceCenterAddressL(iTestUtils->iServiceSettings->GetServiceCenter(defaultIndex).Address());
-
-	// Set recipient - ask derived class
-
-	_LIT(KFunction1, ":Test For Store Email over SMS Header ");
-	INFO_PRINTF1(KFunction1);
-
-	
-	CSmsEmailFields* emailFields = NULL;
-    emailFields = CSmsEmailFields::NewL( iheader->EmailFields() );
-    emailFields->AddAddressL(KRealAddress);
-            
-    iheader->SetEmailFieldsL( *emailFields );
- 
-	iTestUtils->Printf(_L("--Setting single recipient Done \n"));
-	
-	// Create the entry - set context to the global outbox.
-	iTestUtils->iMsvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);
-	iTestUtils->iMsvEntry->CreateL(entry);
-
-	// Create new store and save header information 
-	iTestUtils->iMsvEntry->SetEntryL(entry.Id()); 
-	CMsvStore* store = iTestUtils->iMsvEntry->EditStoreL();
-	CleanupStack::PushL(store); 
-	iheader->StoreL(*store);
-	store->CommitL();
-	CleanupStack::PopAndDestroy(1);//store
-	
-	INFO_PRINTF1(_L("Successfully Message header Stored"));
-	
-	TestReStoreMultipuleEOSRecipientSMSHeaderL();
-	}
-
-void CTestHeaderStoreReStore::TestReStoreMultipuleEOSRecipientSMSHeaderL()
-	{
-
-	_LIT(KFunction, ":Test For ReStore SMS Header ");
-	INFO_PRINTF1(KFunction);
-
-			
-	TMsvSelectionOrdering ordering;	
-	ordering.ShowInvisibleEntries();
-	CMsvEntry* entry = CMsvEntry::NewL(*iSession, KMsvGlobalOutBoxIndexEntryId,ordering);
-	CleanupStack::PushL(entry);
-	
-	CMsvEntrySelection* msvEntrySelection;
-	msvEntrySelection=entry->ChildrenL();
-	CleanupStack::PushL(msvEntrySelection);
-	
-	// Check how many mesasges there are - should be just 1
-	TInt count = msvEntrySelection->Count();
-	INFO_PRINTF3(_L("Number of new messages: %d, should be: %d"), count, 1);
-	ASSERT_TRUE(count == 1);
-
-
-	// Restore the message
-	iReceiveheader = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *iTestUtils->iRichText);
-	entry->SetEntryL((*msvEntrySelection)[0]);
-
-	CMsvStore* store = entry->ReadStoreL();
-	CleanupStack::PushL(store);	
-	iTestUtils->Printf(_L("--Restore \n"));
-	iReceiveheader->RestoreL(*store);
-	
-
-	CleanupStack::PopAndDestroy(3,entry);	
-	INFO_PRINTF1(_L("Successfully Message header ReStored"));
-
-	}
-
-
-void CTestHeaderStoreReStore::TestEmptyEOSSubjectSMSHeaderL()
-	{
-	
-	_LIT(KFunction, ":Test For Store SMS Header ");
-	INFO_PRINTF1(KFunction);
-
-	TMsvEntry entry;
-	entry.SetVisible(ETrue); 
-	entry.SetInPreparation(ETrue); 
-	entry.iServiceId = iTestUtils->iSmsServiceId; 
-	entry.iType = KUidMsvMessageEntry; 
-	entry.iMtm = KUidMsgTypeSMS; 
-	entry.iDate.HomeTime(); 
-	entry.iSize = 0; 
-	entry.iDescription.Set(KNullDesC); 
-	entry.iDetails.Set(KNullDesC); 
-	entry.SetSendingState(KMsvSendStateScheduled);
-	
-
-	// Create the SMS header object...
-	iheader = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils->iRichText);
-	//CleanupStack::PushL(iheader);
-	
-	// Set the body text...
-	iTestUtils->iRichText->Reset();
-	iTestUtils->iRichText->InsertL(0, KMessageData);
-	
-	// Copy the message settings...
-	iheader->SetSmsSettingsL(*iTestUtils->iServiceSettings); 
-	
-	// Set the service centre
-	TInt defaultIndex = iTestUtils->iServiceSettings->DefaultServiceCenter();
-	iheader->SetServiceCenterAddressL(iTestUtils->iServiceSettings->GetServiceCenter(defaultIndex).Address());
-
-
-	_LIT(KFunction1, ":Test For Store Email over SMS Header ");
-	INFO_PRINTF1(KFunction1);
-
-	
-	CSmsEmailFields* emailFields = NULL;
-    emailFields = CSmsEmailFields::NewL( iheader->EmailFields() );
-    emailFields->SetSubjectL(KSubject);
-        
-    iheader->SetEmailFieldsL( *emailFields );
- 
-	iTestUtils->Printf(_L("--Setting single recipient Done \n"));
-	
-	// Create the entry - set context to the global outbox.
-	iTestUtils->iMsvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);
-	iTestUtils->iMsvEntry->CreateL(entry);
-
-	// Create new store and save header information 
-	iTestUtils->iMsvEntry->SetEntryL(entry.Id()); 
-	CMsvStore* store = iTestUtils->iMsvEntry->EditStoreL();
-	CleanupStack::PushL(store); 
-	iheader->StoreL(*store);
-	store->CommitL();
-	CleanupStack::PopAndDestroy(1);//store
-	
-	INFO_PRINTF1(_L("Successfully Message header Stored"));
-	
-	TestReStoreEmptySubjectSMSHeaderL();
-	}
-
-void CTestHeaderStoreReStore::TestReStoreEmptySubjectSMSHeaderL()
-	{
-
-	_LIT(KFunction, ":Test For ReStore SMS Header ");
-	INFO_PRINTF1(KFunction);
-
-			
-	TMsvSelectionOrdering ordering;	
-	ordering.ShowInvisibleEntries();
-	CMsvEntry* entry = CMsvEntry::NewL(*iSession, KMsvGlobalOutBoxIndexEntryId,ordering);
-	CleanupStack::PushL(entry);
-	
-	CMsvEntrySelection* msvEntrySelection;
-	msvEntrySelection=entry->ChildrenL();
-	CleanupStack::PushL(msvEntrySelection);
-	
-	// Check how many mesasges there are - should be just 1
-	TInt count = msvEntrySelection->Count();
-	INFO_PRINTF3(_L("Number of new messages: %d, should be: %d"), count, 1);
-	ASSERT_TRUE(count == 1);
-
-
-	// Restore the message
-	iReceiveheader = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *iTestUtils->iRichText);
-	
-	entry->SetEntryL((*msvEntrySelection)[0]);
-
-	CMsvStore* store = entry->ReadStoreL();
-	CleanupStack::PushL(store);	
-	iTestUtils->Printf(_L("--Restore \n"));
-	iReceiveheader->RestoreL(*store);
-	
-	CleanupStack::PopAndDestroy(3,entry);	
-	INFO_PRINTF1(_L("Successfully Message header ReStored"));
-
-	}
-
-
-CTestSuite* CTestHeaderStoreReStore::CreateSuiteL(const TDesC& aName)
-	{
-	SUB_SUITE;
-	ADD_ASYNC_TEST_STEP(TestStoreHeaderL);
-	ADD_ASYNC_TEST_STEP(TestStoreReStoreSMSHeaderL);
-	ADD_ASYNC_TEST_STEP(TestStoreReStoreEOSSMSHeaderL);
-	ADD_ASYNC_TEST_STEP(TestStoreReStoreEmptyEOSSMSHeaderL);
-	ADD_ASYNC_TEST_STEP(TestMultipuleEOSRecipientSMSHeaderL);
-	ADD_ASYNC_TEST_STEP(TestEmptyEOSSubjectSMSHeaderL);
-	END_SUITE;
-	}
--- a/messagingappbase/smsmtm/clientmtm/test/bwins/APIGATHERERSERVERU.DEF	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	?NewServer@@YAHXZ @ 1 NONAME ; int NewServer(void)
-
--- a/messagingappbase/smsmtm/clientmtm/test/group/smcmsuite_gsm.iby	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef __SMCMSUITE_GSM__
-#define __SMCMSUITE_GSM__
-
-file=ABI_DIR\BUILD_DIR\smcmsuite_gsm.exe	System\bin\smcmsuite_gsm.exe
-
-data=EPOCROOT##Epoc32\winscw\c\msgtest\smcmsuite_gsm\smcmsuite_gsm.script msgtest\smcmsuite_gsm\smcmsuite_gsm.script
-data=EPOCROOT##Epoc32\winscw\c\ems\pics.mbm ems\pics.mbm
-
-#endif
--- a/messagingappbase/smsmtm/clientmtm/test/group/smcmsuite_gsm.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-// Copyright (c) 2005-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:
-// smcmsuite_gsm.mmp
-//
-
-TARGET		smcmsuite_gsm.exe
-TARGETTYPE  exe
-UID    0x1000007a 0x10274038
-VENDORID 	0x70000001
-
-CAPABILITY	ALL -TCB
-
-SOURCEPATH  ../src
-SOURCE		smcmserver.cpp
-SOURCE		smcmstepbase.cpp
-SOURCE		smcmstepfind.cpp
-SOURCE		smcmstepfindalias.cpp
-SOURCE		smcmstepforward.cpp
-SOURCE		smcmstepforwardemail.cpp
-SOURCE		smcmstepinitialise.cpp
-SOURCE		smcmstepquerycapabilities.cpp
-SOURCE		smcmstepreply.cpp
-SOURCE		smcmstepreplyemail.cpp
-SOURCE		smcmstepsettings.cpp
-
-USERINCLUDE		../inc 
-SYSTEMINCLUDE 	/epoc32/include
-SYSTEMINCLUDE 	/epoc32/include/test
-SYSTEMINCLUDE 	/epoc32/include/libc
-
-LIBRARY		efsrv.lib euser.lib testexecuteutils.lib testexecutelogclient.lib 
-LIBRARY		smcm.lib msgs.lib etext.lib smstestutils.lib msvtestutils.lib gsmu.lib
-
-
-
-
-SMPSAFE
--- a/messagingappbase/smsmtm/clientmtm/test/inc/smcmserver.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-// Copyright (c) 2005-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 __SMCMSERVER_H__
-#define __SMCMSERVER_H__
-
-#include <test/testexecuteserverbase.h>
-#include <smstestutils.h>
- 
-class CSmsServer : public CTestServer
-	{
-public:
-	static CSmsServer* NewL( );
-	virtual CTestStep* CreateTestStep( const TDesC& aStepName );
-private:
-	CSmsServer( );
-	void ConstructL( const TDesC& aName );
-	};
-
-#endif //__SMCMSERVER_H__
--- a/messagingappbase/smsmtm/clientmtm/test/inc/smcmstepbase.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-// Copyright (c) 2005-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 __SMCMSTEPBASE_H__
-#define __SMCMSTEPBASE_H__
-
-#include "smcmserver.h"
-
-#include <mtmdef.h>
-#include <stdlib.h>
-#include <smsclnt.h>
-#include <systemmonitor/systemmonitor.h>
-#include <test/testexecutestepbase.h>
-#include <txtfmlyr.h>
-#include <txtrich.h>
-
-// User Data
-_LIT( KUserDataOriginal, "Welcome to the Forward and Reply test harness" );
-_LIT( KUserDataReply, "This is the reply to the original message" );
-_LIT( KUserDataForward, "This is the text added to the forward message" );
-_LIT( KUserDataFind, "This is a send test.\näöå\n Cheers, Mico\n" );
-
-// Phone numbers
-
-_LIT( KScriptItemSC1, "SC" );
-_LIT( KScriptItemSC1Def, "+447785016005" );
-
-_LIT( KScriptItemSC2, "radiolinja0" );
-_LIT( KScriptItemSC2Def, "+358508771010" );
-
-_LIT( KScriptItemSC3, "radiolinja1" );
-_LIT( KScriptItemSC3Def, "+358508771010" );
-
-const TInt KMaxBodyLength = KMsvMaxFindTextLength ;
-
-const TInt KUTC0 = 0;
-const TInt KUTCMin8 = -8;
-
-enum TMessageOperation
-	{
-	EOperationNone,
-	EOperationReply,
-	EOperationForward
-	};
-
-
-class TMessageSettings
-{
-public:
-	TMessageOperation iOperation;
-	TMsvId iOriginalBoxId;
-	CSmsPDU::TSmsPDUType iOriginalSmsPDUType;
-	TInt iOriginalBioType;
-};
-
-class CSMCMStepBase : public CTestStep
-	{
-public:
-	virtual ~CSMCMStepBase( );
-	CSMCMStepBase( );
-	virtual TVerdict doTestStepPreambleL( );
-
-protected:
-	void ChangeLocale( TInt aHours );
-
-	TMsvId CreateEmailSmsMessageL( const TDesC& aEmailMessageData );
-	TMsvId CreateMessageAndEntryL( const TDesC& aUserData, TMessageSettings aSettings );
-	HBufC* CreateRandomLC( TInt aLen ) const;
-	TVerdict PerformTestL( TMsvId aOriginalMessageId, 
-						   const TDesC& aNewText, 
-						   const TMessageSettings& aSettings );
-	TVerdict CompareMessagesL( TMsvId aOriginalMessageId, 
-							   TMsvId aTargetMessageId, 
-							   const TMessageSettings& aSettings );
-	void SetSettingsL( );
-private:
-	TMsvId PerformForwardOrReplyOperationL( TMessageOperation aOperation, 
-							  				TMsvId aInFolder );							   
-protected:
-	CClientMtmRegistry*     iClientMtmRegistry;
-	TMsvDummyObserver*      iDummyObserver;
-	CMsvSession*            iServerSession;
-	CSmsClientMtm*          iSmsClientMtm;
-	CMsvEntry*              iMsvEntry;
-	TMsvId                  iSmsServiceId;
-
-	CSmsTestUtils*			iSmsTestUtils;
-	CActiveScheduler*		iScheduler;
-	};
-
-#endif // __SMCMSTEPBASE_H__
--- a/messagingappbase/smsmtm/clientmtm/test/inc/smcmstepfind.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-// Copyright (c) 2005-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 __SMCMSTEPFIND_H__
-#define __SMCMSTEPFIND_H__
-
-#include "smcmstepbase.h"
-
-class CSMCMStepFind : public CSMCMStepBase
-	{
-public:
-	CSMCMStepFind( );
-	virtual ~CSMCMStepFind( );
-	virtual TVerdict doTestStepL( );
-	};
-
-_LIT( KSMCMStepFind, "SMCMStepFind" );	
-
-#endif //__SMCMSTEPFIND_H__
-
--- a/messagingappbase/smsmtm/clientmtm/test/inc/smcmstepfindalias.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-// Copyright (c) 2005-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 __SMCMSTEPFINDALIAS_H__
-#define __SMCMSTEPFINDALIAS_H__
-
-#include "smcmstepbase.h"
-
-class CSMCMStepFindAlias : public CSMCMStepBase
-	{
-public:
-	CSMCMStepFindAlias( );
-	virtual ~CSMCMStepFindAlias( );
-	virtual TVerdict doTestStepL( );
-	};
-
-_LIT( KSMCMStepFindAlias, "SMCMStepFindAlias" );	
-
-#endif //__SMCMSTEPFINDALIAS_H__
-
--- a/messagingappbase/smsmtm/clientmtm/test/inc/smcmstepforward.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-// Copyright (c) 2005-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 __SMCMSTEPFORWARD_H__
-#define __SMCMSTEPFORWARD_H__
-
-#include "smcmstepbase.h"
-
-class CSMCMStepForward : public CSMCMStepBase
-	{
-public:
-	CSMCMStepForward( );
-	virtual ~CSMCMStepForward( );
-	virtual TVerdict doTestStepL( );
-	TVerdict doTestForwardL( TInt aBodyLength, TInt32 aBioType );
-	};
-
-_LIT( KSMCMStepForward, "SMCMStepForward" );	
-
-
-#endif //__SMCMSTEPFORWARD_H__
-
--- a/messagingappbase/smsmtm/clientmtm/test/inc/smcmstepforwardemail.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-// Copyright (c) 2005-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 __SMCMSTEPFORWARDEMAIL_H__
-#define __SMCMSTEPFORWARDEMAIL_H__
-
-#include "smcmstepbase.h"
-
-class CSMCMStepForwardEmail : public CSMCMStepBase
-	{
-public:
-	CSMCMStepForwardEmail( );
-	virtual ~CSMCMStepForwardEmail( );
-	virtual TVerdict doTestStepL( );
-	TVerdict DoTestForwardEmailL( const TDesC& aEmailMessageData, 
-								  const TDesC& aSubject, 
-								  const TDesC& aBody );
-	TBool TestForwardBodyL( const CRichText& aBody, const TDesC& aExpected ) const;
-	};
-
-_LIT( KSMCMStepForwardEmail, "SMCMStepForwardEmail" );	
-
-
-#endif //__SMCMSTEPFORWARDEMAIL_H__
-
--- a/messagingappbase/smsmtm/clientmtm/test/inc/smcmstepinitialise.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-// Copyright (c) 2005-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 __SMCMSTEPINITIALISE_H_
-#define __SMCMSTEPINITIALISE_H_
-
-#include "smcmstepbase.h"
-
-class CSMCMStepInitialise : public CSMCMStepBase
-	{
-public:
-	CSMCMStepInitialise( );
-	virtual ~CSMCMStepInitialise( );
-	virtual TVerdict doTestStepL( );
-	};
-
-_LIT( KSMCMStepInitialise, "SMCMStepInitialise" );	
-
-#endif // __SMCMSTEPINITIALISE_H_
-
--- a/messagingappbase/smsmtm/clientmtm/test/inc/smcmstepquerycapabilities.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-// Copyright (c) 2005-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 __SMCMSTEPQUERYCAPABILITIES_H__
-#define __SMCMSTEPQUERYCAPABILITIES_H__
-
-#include "smcmstepbase.h"
-
-class CSMCMStepQueryCapabilities : public CSMCMStepBase
-	{
-public:
-	CSMCMStepQueryCapabilities( );
-	virtual ~CSMCMStepQueryCapabilities( );
-	virtual TVerdict doTestStepL( );
-	};
-
-_LIT( KSMCMStepQueryCapabilities, "SMCMStepQueryCapabilities" );	
-
-#endif // __SMCMSTEPQUERYCAPABILITIES_H__
-
--- a/messagingappbase/smsmtm/clientmtm/test/inc/smcmstepreply.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-// Copyright (c) 2005-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 __SMCMSTEPREPLY_H__
-#define __SMCMSTEPREPLY_H__
-
-#include "smcmstepbase.h"
-
-class CSMCMStepReply : public CSMCMStepBase
-	{
-public:
-	CSMCMStepReply( );
-	virtual ~CSMCMStepReply( );
-	virtual TVerdict doTestStepL( );
-	};
-
-_LIT( KSMCMStepReply, "SMCMStepReply" );	
-
-#endif // __SMCMSTEPREPLY_H__
-
--- a/messagingappbase/smsmtm/clientmtm/test/inc/smcmstepreplyemail.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Copyright (c) 2005-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 __SMCMSTEPREPLYEMAIL_H__
-#define __SMCMSTEPREPLYEMAIL_H__
-
-#include "smcmstepbase.h"
-
-class CSMCMStepReplyEmail : public CSMCMStepBase
-	{
-public:
-	CSMCMStepReplyEmail( );
-	virtual ~CSMCMStepReplyEmail( );
-	virtual TVerdict doTestStepL( );
-	TVerdict DoTestReplyEmailL( const TDesC& aEmailMessageData, 
-								const TDesC& aAddress, 
-								const TDesC& aSubject );
-	};
-
-_LIT( KSMCMStepReplyEmail, "SMCMStepReplyEmail" );	
-
-#endif // __SMCMSTEPREPLYEMAIL_H__
-
--- a/messagingappbase/smsmtm/clientmtm/test/inc/smcmstepsettings.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-// Copyright (c) 2005-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 __SMCMSTEPSETTINGS_H__
-#define __SMCMSTEPSETTINGS_H__
-
-#include "smcmstepbase.h"
-
-class CSMCMStepSettings : public CSMCMStepBase
-	{
-public:
-	CSMCMStepSettings( );
-	virtual ~CSMCMStepSettings( );
-	virtual TVerdict doTestStepL( );
-	};
-
-_LIT( KSMCMStepSettings, "SMCMStepSettings" );	
-
-#endif // __SMCMSTEPSETTINGS_H__
-
--- a/messagingappbase/smsmtm/clientmtm/test/scripts/smcmsuite_gsm.script	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +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:
-//
-//
-PRINT Run all smcmsuite_gsm Tests 
-//
-LOAD_SUITE smcmsuite_gsm -SharedData
-//
-
-RUN_TEST_STEP 100 smcmsuite_gsm SMCMStepInitialise
-
-RUN_TEST_STEP 100 smcmsuite_gsm SMCMStepSettings
-
-RUN_TEST_STEP 100 smcmsuite_gsm SMCMStepQueryCapabilities
-
-RUN_TEST_STEP 100 smcmsuite_gsm SMCMStepFind
-
-RUN_TEST_STEP 100 smcmsuite_gsm SMCMStepFindAlias
-
-RUN_TEST_STEP 100 smcmsuite_gsm SMCMStepReply
-
-RUN_TEST_STEP 100 smcmsuite_gsm SMCMStepReplyEmail
-
-RUN_TEST_STEP 100 smcmsuite_gsm SMCMStepForward
-
-RUN_TEST_STEP 100 smcmsuite_gsm SMCMStepForwardEmail
-
--- a/messagingappbase/smsmtm/clientmtm/test/src/smcmserver.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-// Copyright (c) 2005-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 "smcmserver.h"
-
-#include "smcmstepinitialise.h"
-#include "smcmstepfind.h"
-#include "smcmstepfindalias.h"
-#include "smcmstepforward.h"
-#include "smcmstepforwardemail.h"
-#include "smcmstepreply.h"
-#include "smcmstepreplyemail.h"
-#include "smcmstepquerycapabilities.h"
-#include "smcmstepsettings.h"
-
-
-_LIT(KServerName,"smcmsuite_gsm");
-
-CSmsServer::CSmsServer( )
-	{
-
-	}
-
-
-// @return - Instance of the test server
-// Called inside the MainL() function to create and start the
-// CTestServer derived server.
-CSmsServer* CSmsServer::NewL()
-	{
-	CSmsServer* server = new (ELeave) CSmsServer();
-	CleanupStack::PushL(server);
-	server->ConstructL(KServerName);
-
-	CleanupStack::Pop(server);
-	return server;
-	}
-
-void CSmsServer::ConstructL( const TDesC& aName )
-	{
-	CTestServer::ConstructL( aName );
-	}
-	
-LOCAL_C void MainL()
-	{
-	RProcess().DataCaging(RProcess::EDataCagingOn);
- 	RProcess().SecureApi(RProcess::ESecureApiOn);
-		
-	CActiveScheduler* sched=NULL;
-	sched=new(ELeave) CActiveScheduler;
-	CActiveScheduler::Install(sched);
-	CSmsServer* server = NULL;
-	// Create the CTestServer derived server
-	TRAPD(err,server = CSmsServer::NewL());
-	if(!err)
-		{
-		// Sync with the client and enter the active scheduler
-		RProcess::Rendezvous(KErrNone);
-		sched->Start();
-		}
-	delete server;
-	server = NULL;
-	delete sched;
-	}
-
-
-// @return - Standard Epoc error code on exit
-GLDEF_C TInt E32Main()
-	{
-	__UHEAP_MARK;
-	CTrapCleanup* cleanup = CTrapCleanup::New();
-	if(cleanup == NULL)
-		{
-		return KErrNoMemory;
-		}
-	TRAPD(err,MainL());
-	delete cleanup;
-	__UHEAP_MARKEND;
-	return err;
-    }
-
-
-// @return - A CTestStep derived instance
-// Implementation of CTestServer pure virtual
-CTestStep* CSmsServer::CreateTestStep(const TDesC& aStepName)
-	{
-	CTestStep* testStep = NULL;
-
-	//StaticSystemInformation
-	if( aStepName == KSMCMStepInitialise )
-		{
-		testStep = new CSMCMStepInitialise( );
-		}
-	else if ( aStepName == KSMCMStepFind )
-		{
-		testStep = new CSMCMStepFind( );
-		}
-	else if ( aStepName == KSMCMStepFindAlias )
-		{
-		testStep = new CSMCMStepFindAlias( );
-		}
-	else if ( aStepName == KSMCMStepForward )
-		{
-		testStep = new CSMCMStepForward( );
-		}
-	else if ( aStepName == KSMCMStepForwardEmail )
-		{
-		testStep = new CSMCMStepForwardEmail( );
-		}
-	else if ( aStepName == KSMCMStepQueryCapabilities )
-		{
-		testStep = new CSMCMStepQueryCapabilities( );
-		}
-	else if ( aStepName == KSMCMStepReply )
-		{
-		testStep = new CSMCMStepReply( );
-		}
-	else if ( aStepName == KSMCMStepReplyEmail )
-		{
-		testStep = new CSMCMStepReplyEmail( );
-		}
-	else if ( aStepName == KSMCMStepSettings )
-		{
-		testStep = new CSMCMStepSettings( );
-		}
-
-	return testStep;
-	
-	}
--- a/messagingappbase/smsmtm/clientmtm/test/src/smcmstepbase.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,480 +0,0 @@
-// Copyright (c) 2005-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 "smcmstepbase.h"
-
-#include <csmsaccount.h>
-#include <csmsemailfields.h>
-#include <e32math.h>
-#include <emsformatie.h>
-#include <emspictureie.h>
-#include <emstestutils.h>
-#include <f32file.h>
-#include <smuthdr.h>
-#include <mtmdef.h>
-
-RTest test( _L( "SMS Test" ) );
-
-const TInt KOneHourSeconds = 3600;
-
-// @return - TVerdict
-// Implementation of CTestStep base class virtual
-// All common initialisation to derived classes is done in here.
-TVerdict CSMCMStepBase::doTestStepPreambleL( )
-	{
-	INFO_PRINTF1( _L( "CSMCMStepBase::doTestStepPreambleL()" ) );
-	
-	ChangeLocale ( KUTC0 );
-	
-	iScheduler = new( ELeave ) CActiveScheduler;
-	CActiveScheduler::Install( iScheduler );
-
-	// need this to open a server session
-	iDummyObserver = new( ELeave ) TMsvDummyObserver;
-
-	// All the test steps will need an SMS Client MTM so we
-	// build it here	
-	iSmsTestUtils = CSmsTestUtils::NewL( test );
-	iSmsTestUtils->SetLogToFile( );
-	iSmsTestUtils->InstantiateClientMtmsL( );
-
-	//  Initialize mailbox
-	CSmsSettings* settings = CSmsSettings::NewL( );
-	CleanupStack::PushL( settings );
-	CSmsAccount* account = CSmsAccount::NewLC( );
-	TRAPD(err,account->InitialiseDefaultSettingsL( *settings ) );
-	if ( err != KErrNone )
-		{
-		User::Leave( err );
-		}
-	
-	CleanupStack::PopAndDestroy( account );
-	CleanupStack::PopAndDestroy( settings ); 
-
-	// open the server session
-	iServerSession = CMsvSession::OpenSyncL( *iDummyObserver );
-	
-	// create the Client MTM registry and get the Client MTM from it
-	iClientMtmRegistry = CClientMtmRegistry::NewL( *iServerSession );
-	iSmsClientMtm = ( CSmsClientMtm* ) iClientMtmRegistry->NewMtmL( KUidMsgTypeSMS );
-
-	// create the root entry
-	iMsvEntry = CMsvEntry::NewL( *iServerSession, 
-								 KMsvRootIndexEntryId, 
-								 TMsvSelectionOrdering( ) );
-	
-	TSmsUtilities::ServiceIdL( *iServerSession, 
-								iSmsServiceId, 
-								KUidMsgTypeSMS );
-
-	SetTestStepResult( EPass );
-
-	return TestStepResult( );
-	}
-
-CSMCMStepBase::~CSMCMStepBase( )
-	{
-	delete iSmsClientMtm;
-	delete iClientMtmRegistry;	
-
-	delete iDummyObserver; 
-	delete iServerSession; 
-
-	delete iScheduler;
-
-	}
-
-CSMCMStepBase::CSMCMStepBase( )
-	{
-	
-	}
-	
-void CSMCMStepBase::ChangeLocale( TInt aHours )
-	{
-	User::SetUTCOffset( KOneHourSeconds * aHours );	
-	}
-	
-TMsvId CSMCMStepBase::CreateEmailSmsMessageL( const TDesC& aEmailMessageData )
-	{
-	RFs fs;
- 	User::LeaveIfError( fs.Connect( ) );
- 	CleanupClosePushL( fs );
- 
- 	CSmsMessage* message = CSmsMessage::NewL( fs, 
- 											  CSmsPDU::ESmsDeliver, 
- 											  CSmsEditorBuffer::NewL( *iSmsTestUtils->iRichText ), 
- 											  EFalse );
- 	CleanupStack::PushL( message );
- 	
- 	CSmsBufferBase& buffer = message->Buffer( );
- 	buffer.Reset( );
- 	buffer.InsertL( 0, aEmailMessageData );
- 	
- 	// Set the PID for email.
- 	if( message->SmsPDU( ).ProtocolIdentifierPresent( ) )
- 		{
- 		message->SmsPDU( ).SetPIDType( TSmsProtocolIdentifier::ESmsPIDTelematicInterworking );
- 		message->SmsPDU( ).SetTelematicDeviceIndicator( TSmsProtocolIdentifier::ESmsTelematicDevice );
- 		message->SmsPDU( ).SetTelematicDeviceType( TSmsProtocolIdentifier::ESmsInternetElectronicMail );
- 		
- 		}
-
-	// Create a new SMS header ( CSmsHeader takes ownership of message )
- 	CSmsHeader* header = CSmsHeader::NewL( message );
- 	CleanupStack::Pop( message );
- 	CleanupStack::PushL( header );
- 	
- 	header->SetFromAddressL( KScriptItemRecipientsDef );
- 	header->Message( ).SetServiceCenterAddressL( KScriptItemSCDef );
-
-	// Set the entry data...
- 	TMsvEntry entry;
- 	entry.iType = KUidMsvMessageEntry;
- 	entry.SetSendingState( KMsvSendStateNotApplicable );
- 	TSmsUtilities::PopulateMsgEntry( entry, 
- 									 header->Message( ), 
- 									 iSmsTestUtils->iSmsServiceId );
-
- 	entry.iDate.UniversalTime( );
-
-	const CSmsEmailFields& fields = header->EmailFields( );
- 	// Set the details fiels to the address field.
-	if ( !fields.HasAddress( ) )
-		{
-		SetTestStepResult( EFail );
-		}
-	TInt count = fields.Addresses( ).MdcaCount( );
- 	entry.iDetails.Set( fields.Addresses( ).MdcaPoint( 0 ).Left( KSmsDetailsLength ) );			
- 	
- 	// Set the description to either the subject or the beginning part of the
- 	// body text.
- 	HBufC* desBuffer = HBufC::NewLC( iSmsClientMtm->ServiceSettings( ).DescriptionLength( ) );
- 	TPtr description( desBuffer->Des( ) );
- 	if( fields.Subject( ).Length( ) > 0 )
- 		{
- 		// There is a subject - use this as the description
- 		description.Copy( fields.Subject( ).Left( description.MaxLength( ) ) );
- 		
- 		}
- 	else
- 		{
- 		// No subject - use the beginning part of the body text.
- 		CSmsBufferBase& body = header->Message( ).Buffer( );
- 		TInt length = body.Length( );
- 		HBufC* buf = HBufC::NewLC( length );
- 		TPtr ptr( buf->Des( ) );
- 		body.Extract( ptr, 0, length );
- 
- 		description.Copy( ptr.Left( description.MaxLength( ) ) );
- 		CleanupStack::PopAndDestroy( buf );
- 		
- 		}
- 	entry.iDescription.Set( description );
-
-	// Create the entry in the inbox.
- 	iSmsTestUtils->SetEntryL( KMsvGlobalInBoxIndexEntryId );
- 	iSmsTestUtils->CreateEntryL( entry );
- 	iServerSession->CleanupEntryPushL( entry.Id( ) );
- 	
- 	// Store the header...
- 	iSmsTestUtils->SetEntryL( entry.Id( ) );
- 	CMsvStore* store = iSmsTestUtils->EditStoreL( );
- 	CleanupStack::PushL( store );
- 
- 	header->StoreL( *store );
- 
- 	// Store the body text
- 	store->StoreBodyTextL( *iSmsTestUtils->iRichText );
- 	store->CommitL( );
- 
- 	entry.iSize = store->SizeL( );
- 	entry.SetReadOnly( ETrue );
- 	iSmsTestUtils->ChangeEntryL( entry );
- 	
-	CleanupStack::PopAndDestroy( store );
- 	iServerSession->CleanupEntryPop( );
- 	CleanupStack::PopAndDestroy( 3, &fs );	// fs, header, desBuffer
- 	
- 	return entry.Id( );
-
-	}
-
-TMsvId CSMCMStepBase::CreateMessageAndEntryL( const TDesC& aUserData, TMessageSettings aSettings )
-	{
-	TMsvEntry entry;
-	entry.iType = KUidMsvMessageEntry;
-	entry.SetSendingState( KMsvSendStateUnknown );
-	entry.iDetails.Set( _L( "Alias" ) );
-	entry.iBioType = aSettings.iOriginalBioType;
-	
-	iSmsTestUtils->iRichText->Reset( );
-	iSmsTestUtils->iRichText->InsertL( 0, aUserData );
-	
-	CSmsHeader* header = NULL;
-	if ( aSettings.iOperation == EOperationNone || aSettings.iOperation == EOperationReply )
-		{
-		header = CSmsHeader::NewL( aSettings.iOriginalSmsPDUType, 
-								   *iSmsTestUtils->iRichText );	
-		}
-	else // EOperationForward
-		{
-		header = CSmsHeader::NewL( CSmsMessage::NewL( iSmsTestUtils->FileSession(), 
-													  aSettings.iOriginalSmsPDUType, 
-													  CSmsEditorBuffer::NewL( *iSmsTestUtils->iRichText ) ) );		
-			}
-	
-
-	CleanupStack::PushL( header );
-	
-	// Add formating and a picture
-	CEmsFormatIE* format = CEmsFormatIE::NewL( );
-	CleanupStack::PushL( format );
-	format->SetStartPosition(10);
-	format->SetFormatLength(10);
-	format->SetBold( ETrue );
-	header->Message( ).AddEMSInformationElementL( *format );
-	CleanupStack::PopAndDestroy( format );
-
-	CEmsPictureIE* pic = EmsTestUtils::CreatePictureL( 0 );
-	CleanupStack::PushL( pic );
-	pic->SetStartPosition( 0 );
-	header->Message().AddEMSInformationElementL( *pic );
-	CleanupStack::PopAndDestroy(pic);
-
-	header->SetFromAddressL( KScriptItemRecipientsDef );
-	header->Message().SetServiceCenterAddressL( KScriptItemSCDef );
-	
-	TTime now;
-	now.UniversalTime( );
-	
-	iSmsTestUtils->CreateMessageL( aSettings.iOriginalBoxId,
-								   entry, 
-								   *header, 
-								   *iSmsTestUtils->iRichText,
-								   now );
-	entry.SetReadOnly( ETrue );
-	
-	CleanupStack::PopAndDestroy( header );
-
-	return entry.Id( );
-	
-	}
-
-// Creates a random string of lenth aLen (is used to generate a random body)	
-HBufC* CSMCMStepBase::CreateRandomLC( TInt aLen ) const
-	{
-	HBufC* msg = HBufC::NewLC( aLen );
-	TPtr msgPtr( msg->Des( ) );
-	msgPtr.SetLength( aLen );
-	
-	TUint16* ptr = &msgPtr[ 0 ];
-	while( --aLen )
-		{
-		// Create a random character between ASCII code 65 and 128
-		*ptr++ = TUint16( Math::Random( ) % ( 128 - 65 ) +65 );
-		}
-		
-	return msg;
-	}
-
-TMsvId CSMCMStepBase::PerformForwardOrReplyOperationL( TMessageOperation aOperation, 
-										 			   TMsvId aInFolder )
-	{
-	TMsvPartList part = 0;
-	CMsvOperationWait* wait = CMsvOperationWait::NewLC( );
-	wait->Start( );
-	
-	CMsvOperation* operation = NULL;
-	
-	switch( aOperation )
-		{
-		case EOperationReply:
-			operation = iSmsClientMtm->ReplyL( aInFolder, part, wait->iStatus );
-			break;
-		case EOperationForward:
-			operation = iSmsClientMtm->ForwardL( aInFolder, part, wait->iStatus );
-			break;
-		default:
-			User::Leave( KErrNotSupported );
-			break;
-			
-		}
-	
-
-	CleanupStack::PushL( operation );
-
-	CActiveScheduler::Start( ); // Wait for operation to complete
-
-	if ( wait->iStatus.Int() != KErrNone)
-		{
-		SetTestStepResult( EFail );
-		
-		}
-
-	// Extract the TMsvId new message created using the operation
-	TPckgBuf< TMsvId > pkg;
-	pkg.Copy( operation->ProgressL( ) );
-	TMsvId messageId = pkg( );
-	
-	// Cleanup
-	CleanupStack::PopAndDestroy( 2, wait );		// operation, wait
-	
-	return( messageId );
-	
-	}
-
-
-TVerdict CSMCMStepBase::PerformTestL( TMsvId aOriginalMessageId, 
-									  const TDesC& aNewText, 
-									  const TMessageSettings& aSettings )
-	{
-	 // Lets point at the message which we'll forward
-	iSmsClientMtm->SwitchCurrentEntryL( aOriginalMessageId );
-
-	TMsvId responseMessageId = PerformForwardOrReplyOperationL( aSettings.iOperation, KMsvDraftEntryId );
-
-	// Load the newly created FORWARD message	
-	iSmsClientMtm->SwitchCurrentEntryL( responseMessageId );
-	iSmsClientMtm->LoadMessageL( );
-	
-	// Add new part of message
-	iSmsClientMtm->Body( ).InsertL( 0, aNewText );
-	iSmsClientMtm->SaveMessageL( );
-		
-	TVerdict result = CompareMessagesL( aOriginalMessageId, responseMessageId, aSettings );
-	
-	return result;	
-	}
-	
-
-TVerdict CSMCMStepBase::CompareMessagesL( TMsvId aOriginalMessageId, 
-										  TMsvId aTargetMessageId, 
-										  const TMessageSettings& aSettings )
-	{
-	__ASSERT_ALWAYS( aOriginalMessageId != aTargetMessageId, User::Panic( SMSTEST_PANIC, KSmsTestUtilsPanicCannotCompareSameIds ) );
-	
-	TVerdict result = EPass;
-	// Load the Original Message
-	iSmsClientMtm->SwitchCurrentEntryL( aOriginalMessageId );
-	iSmsClientMtm->LoadMessageL( );
-
-	TMsvEntry originalEntry = iSmsClientMtm->Entry( ).Entry( );
-
-	const CSmsHeader& originalHeader = iSmsClientMtm->SmsHeader( );
-
-	// copy original body text & description in a buffer to be used later
-	CSmsEditorBuffer* origBuffer = CSmsEditorBuffer::NewL( iSmsClientMtm->Body( ) );
-	TInt length = origBuffer->Length( );
-	TBufC< KMaxBodyLength > originalMessage;
-	
-	TPtr origMsgPtr( originalMessage.Des( ) );
-	origBuffer->Extract( origMsgPtr, 0, length );
-	
-	TBufC< CSmsBufferBase::EMaxBufLength > originalDescription;
-	TPtr origDescPtr( originalDescription.Des( ) );
-	origDescPtr.Copy( originalEntry.iDescription );
-
-	// Load the Target message
-	iSmsClientMtm->SwitchCurrentEntryL( aTargetMessageId );
-	iSmsClientMtm->LoadMessageL( );
-	
-	TMsvEntry targetEntry = iSmsClientMtm->Entry( ).Entry( );
-	
-	const CSmsHeader& targetHeader = iSmsClientMtm->SmsHeader( );
-	
-	// Compare UTC Time of original and target messages
-	if ( originalEntry.iDate >= targetEntry.iDate )
-		{
-		result = EFail;
-		
-		}
-		
-	// Applicable to both Forward and Reply
-	TBool originalTextIncluded = EFalse;
-	TMsvPartList partList = KMsvMessagePartBody;
-	if ( iSmsClientMtm->Find( originalMessage.Des( ), partList ) == KMsvMessagePartBody )
-		{
-		originalTextIncluded = ETrue;
-		
-		}
-	if ( !iSmsTestUtils->AreMessagesSameTextL( originalEntry.Id(), 
-											   targetEntry.Id(), 
-											   ETrue ) )
-		{
-		result = EFail;
-		}
-
-	if ( aSettings.iOperation == EOperationReply )
-		{
-		// nothing extra to do for a reply
-		}
-		
-	if ( aSettings.iOperation == EOperationForward )
-		{
-		TUint stateOrig = originalEntry.SendingState( );
-		TUint statetarg = targetEntry.SendingState( );
-		if ( ( originalEntry.SendingState( ) != targetEntry.SendingState( ) ) || 
-			 ( originalEntry.iBioType != targetEntry.iBioType ) || 
-			 ( originalDescription != targetEntry.iDescription) )
-			{
-			result = EFail;
-			
-			}
-		if ( !originalTextIncluded )
-			{
-			INFO_PRINTF1( _L( "Comparison Failed - Forward messages expect original text to be included" ) );
-			result = EFail;
-			
-			}
-		}
-	
-	return result;
-	
-	}
-	
-void CSMCMStepBase::SetSettingsL( )
-	{
-	CSmsSettings* settings = CSmsSettings::NewLC( );
-	
-	CSmsAccount* account = CSmsAccount::NewLC( );
-	account->InitialiseDefaultSettingsL( *settings );
-
-	settings->AddServiceCenterL( KScriptItemSC1, KScriptItemSC1Def );
-	settings->AddServiceCenterL( KScriptItemSC2, KScriptItemSC2Def );
-	settings->AddServiceCenterL( KScriptItemSC3, KScriptItemSC3Def );
-	settings->SetDefaultServiceCenter( 2 );
-	
-	settings->SetValidityPeriod( ESmsVPWeek );
-	settings->SetReplyQuoted( ETrue );
-	settings->SetRejectDuplicate( ETrue );
-	settings->SetDelivery( ESmsDeliveryImmediately );
-	settings->SetDeliveryReport( ETrue );
-	settings->SetReplyPath( EFalse );
-	settings->SetMessageConversion( ESmsConvPIDNone );
-	settings->SetCanConcatenate( ETrue );
-	settings->SetCharacterSet( TSmsDataCodingScheme::ESmsAlphabet8Bit );
-	settings->SetValidityPeriodFormat( TSmsFirstOctet::ESmsVPFSemiOctet );
-	settings->SetStatusReportHandling( CSmsSettings::EMoveReportToInboxVisible );
-	settings->SetSpecialMessageHandling( CSmsSettings::EMoveReportToInboxVisible );
-	
-	account->SaveSettingsL( *settings );
-	
-	iSmsTestUtils->iServiceSettings->CopyL( *settings);
-	
-	CleanupStack::PopAndDestroy( 2, settings );
-	
-	}
-							   
-
--- a/messagingappbase/smsmtm/clientmtm/test/src/smcmstepfind.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,259 +0,0 @@
-// Copyright (c) 2005-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:
-// All the others should pass.
-// 
-//
-
-/**
- @SYMTestCaseID MSG-SMSCLIENTMTM-0243-4
- @SYMTestType UT
- @SYMTestPriority High
- @SYMPREQ unknown
- @SYMTestCaseDesc Search for text strings in SMS (body and header fields) (ported from T_SMCM1)
- @SYMTestActions  Create an SMS and search for text strings in it
- @SYMTestExpectedResults Some find operations are not supported and thse should return the appropriate error. 
-*/
-
-#include "smcmstepfind.h"
-#include <mtmdef.h>
-
-CSMCMStepFind::CSMCMStepFind( )
-	{
-	SetTestStepName( KSMCMStepFind );
-	}
-
-CSMCMStepFind::~CSMCMStepFind( )
-	{
-	
-	}
-
-TVerdict CSMCMStepFind::doTestStepL( )
-	{
-	INFO_PRINTF1( _L( "CSMCMStepFind::doTestStepL( )" ) );
-	
-	SetTestStepResult( EPass );
-	
-	TMsvPartList partList;
-	
-	TMessageSettings settings;
-	settings.iOperation = EOperationNone;
-	settings.iOriginalBoxId = KMsvGlobalInBoxIndexEntryId;
-	settings.iOriginalSmsPDUType = CSmsPDU::ESmsSubmit;
-	settings.iOriginalBioType = 0;
-	TMsvId entryId = CreateMessageAndEntryL( KUserDataFind, settings );
-	
-	iSmsClientMtm->SwitchCurrentEntryL( entryId );
-	iSmsClientMtm->LoadMessageL( );
-	
-	// Add some recipients
-	iSmsClientMtm->AddAddresseeL( _L( "+358503367709" ), _L( "Mico3" ) );
-	iSmsClientMtm->AddAddresseeL( _L( "+358503367709" ), _L( "Mico4" ) );
-	iSmsClientMtm->AddAddresseeL( _L( "//\\" ), _L( "\n" ) );
-	iSmsClientMtm->AddAddresseeL( _L( "\n0" ), _L( "^" ) );
-	iSmsClientMtm->AddAddresseeL( _L("1234"), _L("~¨") );
-	iSmsClientMtm->AddAddresseeL( _L("äöåÖÅÖÖ¤"), _L("fdsa4324521{[]}") );
-	iSmsClientMtm->AddAddresseeL( _L("äöåÖÅÖÖ¤"), _L("") );
-	iSmsClientMtm->AddAddresseeL( _L("äöåÖÅÖÖ¤") );
-	
-	// remove recipient
-	iSmsClientMtm->RemoveAddressee( 2 );
-	
-	// Validate Message
-	partList = KMsvMessagePartRecipient;
-	
-	if ( iSmsClientMtm->ValidateMessage( partList ) == KErrNone )
-		{
-		// all the addressees should be invalid
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Invalid message context or not supported: KMsvMessagePartRecipient" ) );
-		}
-	
-	iSmsClientMtm->RemoveAddressee( iSmsClientMtm->AddresseeList( ).Count( ) - 1 );
-	iSmsClientMtm->RemoveAddressee( iSmsClientMtm->AddresseeList( ).Count( ) - 1 );
-	iSmsClientMtm->RemoveAddressee( iSmsClientMtm->AddresseeList( ).Count( ) - 1 );
-	iSmsClientMtm->RemoveAddressee( iSmsClientMtm->AddresseeList( ).Count( ) - 2 );
-	iSmsClientMtm->RemoveAddressee( iSmsClientMtm->AddresseeList( ).Count( ) - 2 );
-	
-	partList=KMsvMessagePartRecipient;			// supported
-	if ( iSmsClientMtm->ValidateMessage( partList ) != 0 )
-		{
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Invalid message context or not supported: KMsvMessagePartRecipient" ) );
-		}
-		
-	partList=KMsvMessagePartBody;				// not supported, returns 0
-	if ( iSmsClientMtm->ValidateMessage( partList ) != 0 )
-		{
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Invalid message context or not supported: KMsvMessagePartBody" ) );
-		}
-	
-	partList=KMsvMessagePartOriginator;			// not supported, returns 0
-	if ( iSmsClientMtm->ValidateMessage( partList ) != 0 )
-		{
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Invalid message context or not supported: KMsvMessagePartOriginator" ) );		
-		}
-	
-	partList=KMsvMessagePartDescription;		// not supported, returns 0
-	if ( iSmsClientMtm->ValidateMessage( partList ) != 0 )
-		{
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Invalid message context or not supported: KMsvMessagePartDescription" ) );
-		}
-	
-	partList=KMsvMessagePartDate;				// not supported, returns 0
-	if ( iSmsClientMtm->ValidateMessage( partList ) != 0 )
-		{
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Invalid message context or not supported: KMsvMessagePartDate" ) );
-		}
-	
-	partList=KMsvMessagePartAttachments;		// not supported, returns 0
-	if ( iSmsClientMtm->ValidateMessage( partList ) != 0 )
-		{
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Invalid message context or not supported: KMsvMessagePartAttachments" ) );
-		}
-	
-	partList=KMsvMessagePartBody | KMsvMessagePartRecipient;
-	if ( iSmsClientMtm->ValidateMessage( partList ) != 0 )
-		{
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Invalid message context or not supported: KMsvMessagePartBody|KMsvMessagePartRecipient" ) );
-		}
-	
-	// Find in body and recipients
-	iSmsClientMtm->AddAddresseeL( _L( "+358503367709" ), _L( "Mr. Tester" ) );
-	
-	partList=KMsvMessagePartRecipient;
-	if ( iSmsClientMtm->Find( _L( "est" ), partList ) != partList ) 
-		{
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Cannot find \"est\" in message context: KMsvMessagePartRecipient" ) );
-		}
-		
-	partList = KMsvMessagePartBody;
-	
-	if ( iSmsClientMtm->Find( _L( "end" ), partList ) != KMsvMessagePartBody )
-		{
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Cannot find \"end\" in message context: KMsvMessagePartBody" ) );
-		}
-		
-	partList = KMsvMessagePartOriginator;
-	if ( iSmsClientMtm->Find( _L( "end" ), partList ) != 0 )
-		{
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Found \"end\" in message context: KMsvMessagePartOriginator" ) );
-		}
-	
-	partList = KMsvMessagePartDescription;		// not supported, returns 0
-	if ( iSmsClientMtm->Find( _L( "end" ), partList ) != 0 )
-		{
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Found \"end\" in message context: KMsvMessagePartDescription" ) );
-		}
-	
-	partList = KMsvMessagePartDate;				// not supported, returns 0
-	if ( iSmsClientMtm->Find( _L( "end" ), partList ) != 0 )
-		{
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Found \"end\" in message context: KMsvMessagePartDate" ) );
-		}
-	
-	partList = KMsvMessagePartAttachments;		// not supported, returns 0
-	if ( iSmsClientMtm->Find( _L( "end" ), partList ) != 0 )
-		{
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Found \"end\" in message context: KMsvMessagePartAttachments" ) );
-		}
-
-	partList = KMsvMessagePartBody | KMsvMessagePartRecipient;
-	if ( iSmsClientMtm->Find( _L( "\n" ), partList ) == partList )
-		{
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Found \"\\n\" in message context: KMsvMessagePartBody|KMsvMessagePartRecipient" ) );
-		}
-
-	if ( iSmsClientMtm->Find( _L( "äöå" ), partList ) == partList )
-		{
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Found \"äöå\" in message context: KMsvMessagePartBody|KMsvMessagePartRecipient" ) );
-		}
-
-	if ( iSmsClientMtm->Find( _L( "{[}]" ), partList ) != 0 )
-		{
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Found \"{[}]\" in message context: KMsvMessagePartBody|KMsvMessagePartRecipient" ) );
-		}
-
-	if ( iSmsClientMtm->Find( _L( "\\" ), partList ) != 0 )
-		{
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Found \"\\\" in message context: KMsvMessagePartBody|KMsvMessagePartRecipient" ) );
-		}
-
-	if ( iSmsClientMtm->Find( _L( "4352316542631753dfgfdgs4t6543w563vsd4" ), partList ) != 0 )
-		{
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Found \"4352316542631753dfgfdgs4t6543w563vsd4\" in message context: KMsvMessagePartBody|KMsvMessagePartRecipient" ) );
-		}
-
-	if ( iSmsClientMtm->Find( _L( "~" ), partList ) == 0 )
-		{
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Cannot find \"~\" in message context: KMsvMessagePartBody|KMsvMessagePartRecipient" ) );
-		}
-
-	if ( iSmsClientMtm->Find( _L( " " ), partList ) == 0 )
-		{
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Cannot find \" \" in message context: KMsvMessagePartBody|KMsvMessagePartRecipient" ) );
-		}
-
-	if ( iSmsClientMtm->Find( _L( "^" ), partList ) != 0 )
-		{
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Found \"^\" in message context: KMsvMessagePartBody|KMsvMessagePartRecipient" ) );
-		}
-
-	if ( iSmsClientMtm->Find( _L( "   \"dsasaf¤;¨" ), partList ) != 0 )
-		{
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Found \"   \\\"dsasaf¤;¨\" in message context: KMsvMessagePartBody|KMsvMessagePartRecipient" ) );
-		}
-
-	if ( iSmsClientMtm->Find( _L( " " ), partList ) != 0 ) // alt+255
-		{
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Found \" \" in message context: KMsvMessagePartBody|KMsvMessagePartRecipient" ) );
-		}
-
-	if ( iSmsClientMtm->Find( _L( "¨" ), partList ) == 0 )
-		{
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Found \"¨\" in message context: KMsvMessagePartBody|KMsvMessagePartRecipient" ) );
-		}
-		
-	if ( iSmsClientMtm->Find( _L( "/\\" ), partList ) != 0 )
-		{
-		SetTestStepResult( EFail );
-		ERR_PRINTF1( _L( "Found \"/\\\" in message context: KMsvMessagePartBody|KMsvMessagePartRecipient" ) );
-		}
-		
-	return TestStepResult( );
-	
-	}
-
--- a/messagingappbase/smsmtm/clientmtm/test/src/smcmstepfindalias.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-// Copyright (c) 2005-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:
-//
-
-/**
- @SYMTestCaseID MSG-SMSCLIENTMTM-0243-5
- @SYMTestType UT
- @SYMTestPriority High
- @SYMPREQ unknown
- @SYMTestCaseDesc Search for alias in SMS (KMsvMessagePartOriginator) (ported from T_SMCM1)
- @SYMTestActions  Create an SMS and search for alias in it
- @SYMTestExpectedResults Alias which is et on creation should be find.
-*/
-
-#include "smcmstepfindalias.h"
-#include <mtmdef.h>
-
-CSMCMStepFindAlias::CSMCMStepFindAlias( )
-	{
-	SetTestStepName( KSMCMStepFindAlias );	
-	}
-	
-CSMCMStepFindAlias::~CSMCMStepFindAlias( )
-	{
-	
-	}
-	
-TVerdict CSMCMStepFindAlias::doTestStepL( )
-	{
-	INFO_PRINTF1( _L( "CSMCMStepFindAlias::doTestStepL( )" ) );
-	SetTestStepResult( EFail );
-	
-	TMessageSettings settings;
-	settings.iOperation = EOperationNone;
-	settings.iOriginalBoxId = KMsvGlobalInBoxIndexEntryId;
-	settings.iOriginalSmsPDUType = CSmsPDU::ESmsDeliver;
-	settings.iOriginalBioType = 0;
-	TMsvId entryId = CreateMessageAndEntryL( KUserDataOriginal, settings );
-	
-	iSmsClientMtm->SwitchCurrentEntryL( entryId );
-	iSmsClientMtm->LoadMessageL( );
-	
-	TMsvPartList partList;
-	partList = KMsvMessagePartOriginator;
-	
-	// Find Alias
-	if ( iSmsClientMtm->Find( _L( "Alias" ), partList ) == partList )
-		{
-		SetTestStepResult( EPass );
-		}
-	else 
-		{
-		ERR_PRINTF1( _L("\"Alias\" not found in KMsvMessagePartOriginator" ) );
-		}
-	
-	return TestStepResult( );
-		
-	}
--- a/messagingappbase/smsmtm/clientmtm/test/src/smcmstepforward.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-// Copyright (c) 2005-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:
-//
-
-/**
- @SYMTestCaseID MSG-SMSCLIENTMTM-0243-8
- @SYMTestType UT
- @SYMTestPriority High
- @SYMPREQ 234, other
- @SYMTestCaseDesc Creates a SMS with locale UTC offset 0, sets UTC offset to -8, forward the SMS
- @SYMTestActions  Checks the timestamps of original and forwarded SMS. (also check original test actions of T_SMCM1)
- @SYMTestExpectedResults The timestamp of the original SMS should be smaller than the timestamp of the forwarded SMS.
-*/
-
-
-#include "smcmstepforward.h"
-
-#include <csmsaccount.h>
-#include <e32math.h>
-
-const TInt KDecreaseBodyLengthValue = 25;
-
-CSMCMStepForward::CSMCMStepForward( )
-	{
-	SetTestStepName( KSMCMStepForward );
-	}
-	
-CSMCMStepForward::~CSMCMStepForward( )
-	{
-	
-	}
-	
-TVerdict CSMCMStepForward::doTestStepL( )
-	{
-	INFO_PRINTF1( _L( "CSMCMStepForward::doTestStepL( )" ) );
-
-	// Easier to have default EPass. Otherwise a passing test may overwrite the
-	// result of earlier failed tests (unless we use an extra boolean which is set
-	// to false if a test fails )
-	SetTestStepResult( EPass );
-	
-	SetSettingsL( );
-	
-	TInt length = KMaxBodyLength;
-	while ( length > 0 )
-		{
-		TUint32 bioType = Math( ).Random( );
-		if ( doTestForwardL( length , bioType) == EFail )
-			{
-			SetTestStepResult( EFail );
-			}
-		length -= KDecreaseBodyLengthValue;
-		}
-		
-	ChangeLocale( KUTC0 );
-
-	return TestStepResult( );
-	
-	}
-	
-TVerdict CSMCMStepForward::doTestForwardL( TInt aBodyLength, TInt32 aBioType )
-	{
-	ChangeLocale( KUTC0 );
-	
-	HBufC* originalBody = CreateRandomLC( aBodyLength );
-	
-	TMessageSettings settings;
-	settings.iOperation = EOperationForward;
-	settings.iOriginalBoxId = KMsvGlobalOutBoxIndexEntryId;
-	settings.iOriginalSmsPDUType = CSmsPDU::ESmsDeliver;
-	settings.iOriginalBioType = aBioType;
-	
-	TMsvId entryId = CreateMessageAndEntryL( *originalBody, settings );
-	
-	ChangeLocale( KUTCMin8 );
-	
-	TVerdict verdict;
-	verdict = PerformTestL( entryId, KUserDataForward, settings );
-	
-	CleanupStack::PopAndDestroy( originalBody );
-	
-	return verdict;
-	
-	}
--- a/messagingappbase/smsmtm/clientmtm/test/src/smcmstepforwardemail.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,227 +0,0 @@
-// Copyright (c) 2005-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:
-//
-
-/**
- @SYMTestCaseID MSG-SMSCLIENTMTM-0243-9
- @SYMTestType UT
- @SYMTestPriority High
- @SYMPREQ 234, other
- @SYMTestCaseDesc Creates an Email over SMS with locale UTC offset 0, sets UTC offset to -8, forward the Email over SMS
- @SYMTestActions  Checks the timestamps of original and forwarded Email over SMS. (also check original test actions of T_SMCM1)
- @SYMTestExpectedResults The timestamp of the original Email over SMS should be smaller than the timestamp of the forwarded Email over SMS.
-*/
-
-#include "smcmstepforwardemail.h"
-
-#include <csmsemailfields.h>
-#include <smuthdr.h> 
-
-CSMCMStepForwardEmail::CSMCMStepForwardEmail( )
-	{
-	SetTestStepName( KSMCMStepForwardEmail );
-	}
-	
-CSMCMStepForwardEmail::~CSMCMStepForwardEmail( )
-	{
-	
-	}
-	
-TVerdict CSMCMStepForwardEmail::doTestStepL( )
-	{
-	INFO_PRINTF1( _L( "CSMCMStepReplyEmail::doTestStepL( )" ) );
-	
-	ChangeLocale( KUTC0 );
-	
-	SetSettingsL( );
-	
-	// Easier to have default EPass. Otherwise a passing test may overwrite the
-	// result of earlier failed tests (unless we use an extra boolean which is set
-	// to false if a test fails )
-	TVerdict result = EPass;
-	SetTestStepResult( result );
-	 
- 	_LIT( KTestEmailSubject1,	"Fw: a subject" );
- 	_LIT( KTestEmailBody1,		"some body text" );
- 	_LIT( KTestEmailMessage1,	"user@domain1.domain2##a subject#some body text" );
- 	result = DoTestForwardEmailL( KTestEmailMessage1, KTestEmailSubject1, KTestEmailBody1 );
- 	if ( result == EFail )
- 		{
- 		SetTestStepResult( EFail );
- 		}
- 	
- 	// Reset Time to UTC0 for Next Test	
- 	ChangeLocale( KUTC0 );
- 
- 	_LIT( KTestEmailSubject2,	"" );
- 	_LIT( KTestEmailBody2,		"some body text" );
- 	_LIT( KTestEmailMessage2,	"user@domain1.domain2 some body text" );
- 	result = DoTestForwardEmailL( KTestEmailMessage2, KTestEmailSubject2, KTestEmailBody2 );
- 	if ( result == EFail )
- 		{
- 		SetTestStepResult( EFail );
- 		}
- 	
- 	// if locale isn't changed the log file timestamps will be out of order 
-	// as they are in local time	
- 	ChangeLocale( KUTC0 );
-
-	return TestStepResult( );
-	
-	}
-	
-TVerdict CSMCMStepForwardEmail::DoTestForwardEmailL( const TDesC& aEmailMessageData, 
-								  					 const TDesC& aSubject, 
-								  					 const TDesC& aBody )
-	{
-	TVerdict result = EPass;
-	
-	// Create an email message and then a forward message to it.
- 	TMsvId entryId = CreateEmailSmsMessageL( aEmailMessageData );
- 	iSmsTestUtils->SetEntryL( entryId );
- 	iSmsClientMtm->SwitchCurrentEntryL( entryId ); 
- 	iSmsClientMtm->LoadMessageL( );
- 	// store the original entry (to compare UTC)
-   	TMsvEntry originalEntry = iSmsClientMtm->Entry( ).Entry( );
-
-	ChangeLocale ( KUTCMin8 );
- 
- 	TMsvPartList part = 0;
- 	CMsvOperationWait* wait = CMsvOperationWait::NewLC( );
- 	CMsvOperation* op = iSmsClientMtm->ForwardL( KMsvDraftEntryId, part, wait->iStatus );
- 	CleanupStack::PushL( op );
- 	wait->Start( );
- 	CActiveScheduler::Start( );
- 
- 	TPckgBuf< TMsvId > pkg;
- 	pkg.Copy( op->ProgressL( ) );
- 	TMsvId forward = pkg( );
- 
- 	CleanupStack::PopAndDestroy( 2, wait ); // op, wait
-
- 	
- 	// Switch and load the forward message
- 	iSmsClientMtm->SwitchCurrentEntryL(forward);
- 	iSmsClientMtm->LoadMessageL();
- 	
- 	// Check the forward message...
- 	const CSmsHeader& forwardHeader = iSmsClientMtm->SmsHeader();
- 	
- 	// 1. Email fields...(address should be empty)
- 	const CSmsEmailFields& fields = forwardHeader.EmailFields();
- 	if( fields.HasAddress( ) )
- 		{
- 		result = EFail;
- 		ERR_PRINTF1( _L("CSmsEmailFields Address is not empty" ) );
- 		}
- 	if ( fields.Addresses( ).MdcaCount( ) !=0 )
- 		{
- 		result = EFail;
- 		ERR_PRINTF1( _L("CSmsEmailFields Address is not empty" ) );
- 		}
- 	if ( fields.Subject( ).Compare( aSubject ) != 0 )
- 		{
- 		result = EFail;
- 		ERR_PRINTF1( _L("CSmsEmailFields Subject is not the expected one" ) );
- 		}
- 	
- 	// 2. PID...
- 	CSmsSettings* smsset = CSmsSettings::NewL( );
- 	CleanupStack::PushL( smsset );
- 	forwardHeader.GetSmsSettingsL( *smsset );
- 	if ( smsset->MessageConversion( ) != ESmsConvMail )
- 		{
- 		result = EFail;
- 		ERR_PRINTF1( _L("Message Conversion is not ESmsConvMail" ) );
- 		}
- 	CleanupStack::PopAndDestroy( smsset );
- 	
- 	// 3. Email <-> SMS gateway (ie the recipient)
- 	const CArrayPtrFlat< CSmsNumber >& rcpts = forwardHeader.Recipients( );
- 	if ( rcpts.Count( ) != 1 )
- 		{
- 		result = EFail;
- 		ERR_PRINTF1( _L("SMS Gateway count is wrong" ) );
- 		}
- 	const CSmsNumber& rcpt = *rcpts.At( 0 );
- 	if ( rcpt.Address( ).Compare( KScriptItemRecipientsDef ) != 0 )
- 		{
- 		result = EFail;
- 		ERR_PRINTF1( _L("SMS Gateway address is wrong" ) );
- 		}
- 
- 	// 4. Description - should be the same as the subject or body text.
- 	TMsvEntry forwardEntry = iSmsClientMtm->Entry( ).Entry( );
- 	TInt maxDesLength = iSmsClientMtm->ServiceSettings( ).DescriptionLength( );
- 	if( fields.Subject( ).Length( ) )
- 		{
- 		// Description should be same as subject.
- 		if ( forwardEntry.iDescription.Compare( fields.Subject( ).Left( maxDesLength ) ) != 0)
- 			{
- 			result = EFail;
- 			ERR_PRINTF1( _L("Description does not match subject" ) );
- 			}
- 		}
- 	else
- 		{
- 		// Description should be the same as the body text.
- 		HBufC* body = HBufC::NewLC( iSmsClientMtm->Body( ).DocumentLength( ) );
- 		TPtr bodyPtr( body->Des( ) );
- 		iSmsClientMtm->Body( ).Extract( bodyPtr );
- 
- 		if ( forwardEntry.iDescription.Compare( bodyPtr.Left( maxDesLength ) ) != 0 )
- 			{
- 			result = EFail;
- 			ERR_PRINTF1( _L("Description does not match body text" ) );
- 			}
- 		CleanupStack::PopAndDestroy( body );
- 		}
- 	
- 	// 5. Details - should be the same as the address (ie empty).
- 	if( forwardEntry.iDetails.Compare( KNullDesC( ) ) != 0 )
- 		{
- 		result = EFail;
- 		ERR_PRINTF1( _L("Details do not match address" ) );
- 		}
-	
- 	// 6. Body data.
- 	if ( !TestForwardBodyL( iSmsClientMtm->Body( ), aBody) )
-		{
-		result = EFail;
-		ERR_PRINTF1( _L("Body does not" ) );
-		}
-	
-	// 7. UTC - UTC time of the original entry should be smaller than forward entry UTC time
- 	if ( originalEntry.iDate >= forwardEntry.iDate )
-		{
-		result = EFail;
-		ERR_PRINTF1( _L("UTC time is wrong" ) );
-		}
-	
-	return result;
-	}
-	
-TBool CSMCMStepForwardEmail::TestForwardBodyL( const CRichText& aBody, const TDesC& aExpected ) const
-	{
-	HBufC* body = HBufC::NewLC( aBody.DocumentLength( ) );
-	TPtr bodyPtr( body->Des( ) );
-
-	aBody.Extract( bodyPtr );
-
-	const TBool check = ( *body == aExpected );
-
-	CleanupStack::PopAndDestroy( body );
-
-	return check;
-	}
--- a/messagingappbase/smsmtm/clientmtm/test/src/smcmstepinitialise.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-// Copyright (c) 2005-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 UTC offset is et to -8 and the timestamp of the SMS service is compared against the current time
-// 
-//
-
-/**
- @SYMTestCaseID MSG-SMSCLIENTMTM-0243-1
- @SYMTestType UT
- @SYMTestPriority High
- @SYMPREQ 234
- @SYMTestCaseDesc Initialise a new SMS service and check the UTC timestamp
- @SYMTestActions  UTC offset is set to 0, then any existing SMS service is removed and a new one is created.
- @SYMTestExpectedResults The timestamp of the SMS service should be smaller than the current time.
-*/
-
-#include "smcmstepinitialise.h"
-
-CSMCMStepInitialise::CSMCMStepInitialise( )
-	{
-	SetTestStepName( KSMCMStepInitialise );
-	}
-	
-	
-CSMCMStepInitialise::~CSMCMStepInitialise( )
-	{
-		
-	}
-	
-TVerdict CSMCMStepInitialise::doTestStepL( )
-	{
-	INFO_PRINTF1( _L( "CSMCMStepInitialise::doTestStepL( )" ) );
-	
-	SetTestStepResult( EFail );
-	
-	ChangeLocale( KUTC0 );
-	
-	// first delete any old SMS service
-	iSmsTestUtils->DeleteSmsServiceL( );
-	
-	// create a new SMS service (this will be time stamped UTC)
-	TMsvId serviceId = KMsvNullIndexEntryId;
-	serviceId = iSmsTestUtils->CreateSmsServiceL( );
-	
-	iSmsTestUtils->iSmsClientMtm->SwitchCurrentEntryL( serviceId );
-	TMsvEntry serviceEntry = iSmsTestUtils->iSmsClientMtm->Entry( ).Entry( );
-
-	// Change locale to UTC -8
-	ChangeLocale( KUTCMin8 );
-	TTime now;
-	now.UniversalTime( );
-
-	// Check if current time is bigger than time when service was created
-	if ( serviceEntry.iDate < now )
-		{
-		SetTestStepResult( EPass );	
-		
-		}
-	
-	// if locale isn't changed the log file timestamps will be out of order 
-	// as they are in local time
-	ChangeLocale( KUTC0 );
-	
-	return TestStepResult( );
-	
-	}
--- a/messagingappbase/smsmtm/clientmtm/test/src/smcmstepquerycapabilities.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,245 +0,0 @@
-// Copyright (c) 2005-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:
-// KUidMtmQuerySupportedBody, KUidMtmQueryCanSendMsg, KUidMtmQueryCanReceiveMsg, 
-// KUidMtmQueryMaxRecipientCount, KUidMsvMtmQueryEditorUid, KUidMsvQuerySupportsBioMsg and 
-// KUidMsvQuerySupportsScheduling should be supported, others should return KErrNotSupported.
-// 
-//
-
-/**
- @SYMTestCaseID MSG-SMSCLIENTMTM-0243-3
- @SYMTestType UT
- @SYMTestPriority High
- @SYMPREQ unknown
- @SYMTestCaseDesc Query the capabilities of the SMS service (test ported from T_SMCM1)
- @SYMTestActions  Query different capabilities of the SMS service
- @SYMTestExpectedResults capabilities KUidMtmQueryMaxBodySize, KUidMtmQueryMaxTotalMsgSize, 
-*/
-
-
-#include "smcmstepquerycapabilities.h"
-
-#include <mtmuids.h>
-
-const TUid KUidSmcmTestNonSense = { 0x00011111 };
-
-CSMCMStepQueryCapabilities::CSMCMStepQueryCapabilities( )
-	{
-	SetTestStepName( KSMCMStepQueryCapabilities );	
-	}
-	
-CSMCMStepQueryCapabilities::~CSMCMStepQueryCapabilities( )
-	{
-	
-	}
-	
-TVerdict CSMCMStepQueryCapabilities::doTestStepL( )
-	{
-	INFO_PRINTF1( _L( "CSMCMStepQueryCapabilities::doTestStepL( )" ) );
-	
-	SetTestStepResult( EPass );
-		
-    TInt response;
-	TUint32 errorMask = 0;
-
-	if( iSmsClientMtm->QueryCapability( KUidMtmQueryMaxBodySize, response ) != KErrNone )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x1;
-		}
-		
-	if( iSmsClientMtm->QueryCapability( KUidMtmQueryMaxTotalMsgSize, response ) != KErrNone )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x2;
-		}
-		
-	if( iSmsClientMtm->QueryCapability( KUidMtmQuerySupportedBody, response ) != KErrNone )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x4;
-		}
-	if( response != KMtm7BitBody + KMtm8BitBody + KMtm16BitBody )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x4;
-		}
-
-	if( iSmsClientMtm->QueryCapability( KUidMtmQuerySupportAttachments, response ) != KErrNotSupported )
-		{
-		SetTestStepResult( EFail ); 
-		errorMask |= 0x8;
-		}
-	if( !response )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x8;
-		}
-
-	if( iSmsClientMtm->QueryCapability( KUidMtmQuerySupportSubject, response ) != KErrNotSupported )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x10;
-		}
-	if( !response )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x10;
-		}
-
-	if( iSmsClientMtm->QueryCapability( KUidMtmQuerySupportsFolder, response ) != KErrNotSupported )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x20;
-		}
-	if( !response )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x20;
-		}
-
-	if( iSmsClientMtm->QueryCapability( KUidMtmQueryOffLineAllowed, response ) != KErrNotSupported )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x40;
-		}
-	if( !response )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x40;
-		}
-
-	if( iSmsClientMtm->QueryCapability( KUidMtmQueryCanSendMsg, response ) != KErrNone )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x80;
-		}
-	if( !response )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x80;
-		}
-
-	if( iSmsClientMtm->QueryCapability( KUidMtmQueryCanReceiveMsg, response ) != KErrNone )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x100;
-		}
-	if( !response )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x100;
-		}
-
-	if( iSmsClientMtm->QueryCapability( KUidMtmQueryMaxRecipientCount, response ) != KErrNone )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x200;
-		}
-	if( response != -1 )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x200;
-		}
-
-	if( iSmsClientMtm->QueryCapability( KUidMtmQuerySendAsRequiresRenderedImage, response ) != KErrNotSupported )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x400;
-		}
-	if(!response)
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x400;
-		}
-
-	if( iSmsClientMtm->QueryCapability( KUidMtmQuerySendAsRenderingUid, response ) != KErrNotSupported )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x800;
-		}
-	if( !response )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x800;
-		}
-
-	if( iSmsClientMtm->QueryCapability( KUidMsvMtmQueryEditorUid, response ) != KErrNone )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x1000;
-		}
-	if( response != 268441151 ) // 0x1000163f in hex form
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x1000;
-		}
-
-	if( iSmsClientMtm->QueryCapability( KUidMsvQuerySupportsBioMsg, response ) != KErrNone )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x2000;
-		}
-	if( !response )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x2000;
-		}
-
-	if( iSmsClientMtm->QueryCapability( KUidMsvQuerySupportsScheduling, response ) != KErrNone )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x4000;
-		}
-	if( !response )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x4000;
-		}
-
-	if( iSmsClientMtm->QueryCapability( KUidSmcmTestNonSense, response ) != KErrNotSupported )
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x8000;
-		}
-	if( !response )	
-		{
-		SetTestStepResult( EFail );
-		errorMask |= 0x8000;
-		}
-
-	if ( errorMask != 0 )
-		{
-		ERR_PRINTF2( _L( "SMCMStepQuery Failed. ErrorMask = %x" ),errorMask);
-		INFO_PRINTF1( _L( "Bit 1:KUidMtmQueryMaxBodySize" ));
-		INFO_PRINTF1( _L( "Bit 2:KUidMtmQueryMaxTotalMsgSize" ));
-		INFO_PRINTF1( _L( "Bit 3:KUidMtmQuerySupportedBody" ));
-		INFO_PRINTF1( _L( "Bit 4:KUidMtmQuerySupportAttachments" ));
-		INFO_PRINTF1( _L( "Bit 5:KUidMtmQuerySupportSubject" ));
-		INFO_PRINTF1( _L( "Bit 6:KUidMtmQuerySupportsFolder" ));
-		INFO_PRINTF1( _L( "Bit 7:KUidMtmQueryOffLineAllowed" ));
-		INFO_PRINTF1( _L( "Bit 8:KUidMtmQueryCanSendMsg" ));
-		INFO_PRINTF1( _L( "Bit 9:KUidMtmQueryCanReceiveMsg" ));
-		INFO_PRINTF1( _L( "Bit 10:KUidMtmQueryMaxRecipientCount" ));
-		INFO_PRINTF1( _L( "Bit 11:KUidMtmQuerySendAsRequiresRenderedImage" ));
-		INFO_PRINTF1( _L( "Bit 12:KUidMtmQuerySendAsRenderingUid" ));
-		INFO_PRINTF1( _L( "Bit 13:KUidMsvMtmQueryEditorUid" ));
-		INFO_PRINTF1( _L( "Bit 14:KUidMsvQuerySupportsBioMsg" ));
-		INFO_PRINTF1( _L( "Bit 15:KUidMsvQuerySupportsScheduling" ));
-		INFO_PRINTF1( _L( "Bit 16:KUidSmcmTestNonSense" ));
-		}
-
-	return TestStepResult( );
-	
-	}
--- a/messagingappbase/smsmtm/clientmtm/test/src/smcmstepreply.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-// Copyright (c) 2005-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:
-//
-
-/**
- @SYMTestCaseID MSG-SMSCLIENTMTM-0243-6
- @SYMTestType UT
- @SYMTestPriority High
- @SYMPREQ 234, other
- @SYMTestCaseDesc Creates a SMS with locale UTC offset 0, sets UTC offset to -8, reply the SMS
- @SYMTestActions  Checks the timestamps of original and replied SMS. (also check original test actions of T_SMCM1)
- @SYMTestExpectedResults The timestamp of the original SMS should be smaller than the timestamp of the replied SMS.
-*/
-
-
-#include "smcmstepreply.h"
-
-#include <msvuids.h>
-#include <smutset.h>
-#include <smuthdr.h>
-
-#include <csmsaccount.h>
-
-CSMCMStepReply::~CSMCMStepReply( )
-	{
-	
-	}
-
-CSMCMStepReply::CSMCMStepReply( )
-	{
-	SetTestStepName( KSMCMStepReply );
-	}
-
-// @return - TVerdict code
-// Override of base class pure virtual
-TVerdict CSMCMStepReply::doTestStepL( )
-	{
-	INFO_PRINTF1( _L( "CSMCMStepReply::doTestStepL( )" ) );
-	
-	SetTestStepResult( EFail );
-	
-	ChangeLocale( KUTC0 );
-	
-	SetSettingsL( );
-	
-	TMessageSettings settings;
-	settings.iOperation = EOperationReply;
-	settings.iOriginalBoxId = KMsvGlobalInBoxIndexEntryId;
-	settings.iOriginalSmsPDUType = CSmsPDU::ESmsDeliver;
-	settings.iOriginalBioType = 0;
-	
-	TMsvId entryId = CreateMessageAndEntryL( KUserDataOriginal, settings );
-	
-	ChangeLocale( KUTCMin8 );
-	
-	SetTestStepResult( PerformTestL( entryId, KUserDataReply, settings ) );
-	
-	ChangeLocale( KUTC0 );
-
-	return TestStepResult( );
-	
-	}
-
--- a/messagingappbase/smsmtm/clientmtm/test/src/smcmstepreplyemail.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,186 +0,0 @@
-// Copyright (c) 2005-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:
-//
-
-/**
- @SYMTestCaseID MSG-SMSCLIENTMTM-0243-7
- @SYMTestType UT
- @SYMTestPriority High
- @SYMPREQ 234, other
- @SYMTestCaseDesc Creates an Email over SMS with locale UTC offset 0, sets UTC offset to -8, reply the Email over SMS
- @SYMTestActions  Checks the timestamps of original and replied Email over SMS. (also check original test actions of T_SMCM1)
- @SYMTestExpectedResults The timestamp of the original Email over SMS should be smaller than the timestamp of the replied Email over SMS.
-*/
-
-#include "smcmstepreplyemail.h"
-
-#include <csmsemailfields.h>
-#include <smuthdr.h> 
-
-CSMCMStepReplyEmail::CSMCMStepReplyEmail( )
-	{
-	SetTestStepName( KSMCMStepReplyEmail );
-	}
-	
-CSMCMStepReplyEmail::~CSMCMStepReplyEmail( )
-	{
-	
-	}
-	
-TVerdict CSMCMStepReplyEmail::doTestStepL( )
-	{
-	INFO_PRINTF1( _L( "CSMCMStepReplyEmail::doTestStepL( )" ) );
-	
-	ChangeLocale( KUTC0 );
-	
-	SetSettingsL( );
-	
-	TVerdict result = EPass;
-	SetTestStepResult( result );
-	
-	_LIT( KTestEmailAddress1,	"user@domain1.domain2" );
- 	_LIT( KTestEmailSubject1,	"Re: a subject" );
- 	_LIT( KTestEmailMessage1,	"user@domain1.domain2##a subject#some body text" );
- 	result = DoTestReplyEmailL( KTestEmailMessage1, KTestEmailAddress1, KTestEmailSubject1 );
- 	if ( result == EFail )
- 		{
- 		SetTestStepResult( EFail );
- 		}
- 
- 	// Reset Time to UTC0 for Next Test
- 	ChangeLocale( KUTC0 );
- 
- 	_LIT( KTestEmailAddress2,	"user@domain1.domain2" );
- 	_LIT( KTestEmailSubject2,	"" );
- 	_LIT( KTestEmailMessage2,	"user@domain1.domain2 some body text" );
- 	result = DoTestReplyEmailL( KTestEmailMessage2, KTestEmailAddress2, KTestEmailSubject2 );
- 	if ( result == EFail )
- 		{
- 		SetTestStepResult( EFail );
- 		}
- 	
- 	// if locale isn't changed the log file timestamps will be out of order 
-	// as they are in local time	
- 	ChangeLocale( KUTC0 );
- 
-	return TestStepResult( );
-	
-	}
-	
-TVerdict CSMCMStepReplyEmail::DoTestReplyEmailL( const TDesC& aEmailMessageData, 
-											 const TDesC& aAddress, 
-											 const TDesC& aSubject )
-	{
-	TVerdict result = EPass;
-	
-	TMsvId entrId = CreateEmailSmsMessageL( aEmailMessageData );
-
-	ChangeLocale( KUTCMin8 );
-	
-	iSmsTestUtils->SetEntryL( entrId );
- 	iSmsClientMtm->SwitchCurrentEntryL( entrId ); 
- 	iSmsClientMtm->LoadMessageL( );
- 	// store the original entry (to compare UTC)
-   	TMsvEntry originalEntry = iSmsClientMtm->Entry( ).Entry( );
-   	
- 	TMsvPartList part=0;
- 	CMsvOperationWait* wait = CMsvOperationWait::NewLC( );
- 	CMsvOperation* op = iSmsClientMtm->ReplyL( KMsvDraftEntryId, part, wait->iStatus );
- 	CleanupStack::PushL( op );
- 	wait->Start( );
- 	CActiveScheduler::Start( );
-
-	TPckgBuf< TMsvId > pkg;
- 	pkg.Copy( op->ProgressL() );
- 	TMsvId reply = pkg();
- 
- 	CleanupStack::PopAndDestroy( 2, wait ); // op, wait
- 	
- 	// Switch and load the reply message
- 	iSmsClientMtm->SwitchCurrentEntryL( reply );
- 	iSmsClientMtm->LoadMessageL( );
- 	
- 	// Check the reply message...
- 	const CSmsHeader& replyHeader = iSmsClientMtm->SmsHeader( );
-
-	// 1. Email fields...
- 	const CSmsEmailFields& fields = replyHeader.EmailFields( );
- 	if ( fields.Addresses( ).MdcaCount( ) != 1)
- 		{
- 		result = EFail;
- 		ERR_PRINTF1( _L("CSmsEmailFields Address is not present or more than one is present" ) );
- 		}
- 	if ( fields.Addresses( ).MdcaPoint( 0 ).Compare( aAddress ) != 0 )
- 		{
- 		result = EFail;
- 		ERR_PRINTF1( _L("CSmsEmailFields Address is different" ) );
- 		}
- 	if ( fields.Subject( ).Compare( aSubject ) != 0 )
- 		{
- 		result = EFail;
- 		ERR_PRINTF1( _L("CSmsEmailFields Subject is not the expected one" ) );
- 		}
- 	
- 	// 2. PID...
- 	CSmsSettings* smsset = CSmsSettings::NewL( );
- 	CleanupStack::PushL( smsset );
- 	replyHeader.GetSmsSettingsL( *smsset );
- 	if ( smsset->MessageConversion( ) != ESmsConvMail )
- 		{
- 		result = EFail;
- 		ERR_PRINTF1( _L("Message Conversion is not ESmsConvMail" ) );
- 		}
- 		
- 	CleanupStack::PopAndDestroy( smsset );
- 	
- 	// 3. Email <-> SMS gateway (i.e. the recipient)
- 	const CArrayPtrFlat< CSmsNumber >& rcpts = replyHeader.Recipients( );
- 	if ( rcpts.Count( ) != 1 )
- 		{
- 		result = EFail;
- 		ERR_PRINTF1( _L("SMS Gateway count is wrong" ) );
- 		}
- 	const CSmsNumber& rcpt = *rcpts.At( 0 );
- 	if ( rcpt.Address( ).Compare( KScriptItemRecipientsDef ) != 0 )
- 		{
- 		result = EFail;
- 		ERR_PRINTF1( _L("SMS Gateway address is wrong" ) );
- 		}
- 
- 	// 4. Description - should be the same as the subject.
- 	TMsvEntry replyEntry = iSmsClientMtm->Entry( ).Entry( );
- 	TInt maxDesLength = iSmsClientMtm->ServiceSettings( ).DescriptionLength( );
- 	if ( replyEntry.iDescription.Compare( fields.Subject( ).Left( maxDesLength ) ) != 0 )
- 		{
- 		result = EFail;
- 		ERR_PRINTF1( _L("Description does not match subject" ) );
- 		}
- 	
- 	// 5. Details - should be the same as the address.
- 	if ( replyEntry.iDetails.Compare( fields.Addresses( ).MdcaPoint( 0 ).Left( KSmsDetailsLength ) ) != 0 )
- 		{
- 		result = EFail;
- 		ERR_PRINTF1( _L("Details do not match address" ) );
- 		}
- 		
- 	// 6. UTC - UTC time of the original entry should be smaller than reply entry UTC time
- 	if ( originalEntry.iDate >= replyEntry.iDate )
-		{
-		result = EFail;
-		ERR_PRINTF1( _L("UTC time is wrong" ) );
-		}
-
-	return result;
-	}
-
--- a/messagingappbase/smsmtm/clientmtm/test/src/smcmstepsettings.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-// Copyright (c) 2005-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:
-//
-
-/**
- @SYMTestCaseID MSG-SMSCLIENTMTM-0243-2
- @SYMTestType UT
- @SYMTestPriority High
- @SYMPREQ unknown
- @SYMTestCaseDesc Create a CSmsAccount and settings (ported from T_SMCM1)
- @SYMTestActions  Save and load settings
- @SYMTestExpectedResults Test should not Leave.
-*/
-
-#include "smcmstepsettings.h"
-
-#include <csmsaccount.h>
-
-CSMCMStepSettings::CSMCMStepSettings( )
-	{
-	SetTestStepName( KSMCMStepSettings );
-	}
-
-CSMCMStepSettings::~CSMCMStepSettings( )
-	{
-	
-	}
-
-TVerdict CSMCMStepSettings::doTestStepL( )
-	{
-	INFO_PRINTF1( _L( "CSMCMStepSettings::doTestStepL( )" ) );
-	
-	SetTestStepResult( EFail );
-	
-	SetSettingsL( );
-	
-	iSmsClientMtm->Entry().SetEntryL( iSmsTestUtils->iSmsServiceId );
-	
-	CSmsAccount* account = CSmsAccount::NewLC( );
-	CSmsSettings* loadedSettings = CSmsSettings::NewLC( );
-	account->LoadSettingsL( *loadedSettings );
-
-	if ( loadedSettings->DefaultServiceCenter() == 2 )
-		{
-		SetTestStepResult( EPass );
-		
-		}
-
-	CleanupStack::PopAndDestroy( 2, account );	// loadedSettings, account
-	
-	return TestStepResult( );
-	
-	}
Binary file messagingappbase/smsmtm/conf/smsmtm.confml has changed
Binary file messagingappbase/smsmtm/conf/smsmtm_1000102c.crml has changed
--- a/messagingappbase/smsmtm/group/GtSmsMtm.hby	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-#ifndef __GTSMSMTM_HBY__
-#define __GTSMSMTM_HBY__
-
-data=MULTI_LINGUIFY(RSC DATAZ_\resource\messaging\smss  resource\messaging\smss)
-
-#endif	// __GTSMSMTM_HBY__
--- a/messagingappbase/smsmtm/group/GtSmsMtm.iby	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-// Copyright (c) 2003-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 __GTSMSMTM_IBY__
-#define __GTSMSMTM_IBY__
-
-#include <c32.iby>
-#include <esock.iby>
-#include <logeng.iby>
-#include <messageserver.iby>
-#include <scheduledsending.iby>
-#include <gtbioutils.iby>
-#include <cntmodel.iby>
-
-#include <smsstack.iby>
-file=ABI_DIR\BUILD_DIR\smcm.dll		SYSTEM_BINDIR\smcm.dll
-file=ABI_DIR\BUILD_DIR\smss.dll		SYSTEM_BINDIR\smss.dll
-
-ECOM_PLUGIN(smsgetdetdescdefault.dll, 10282fa6.rsc)
-
-//TODO: Exporting sms rsc files temporarely.needs to removed when temp changes folder is deleted
-data=DATAZ_\resource\messaging\mtm\sms.rsc		resource\messaging\mtm\sms.rsc
-
-#include "gtsmsmtm.hby"
-
-#endif
--- a/messagingappbase/smsmtm/group/messaging_sms.history.xml	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,171 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<relnotes name="SMS MTM">
-  <purpose>
-    Message Type Module (MTM) plugin to Messaging Framework, supporting sending/receiving/editing of SMS messages.
-  </purpose>
-
-  <defect number="PDEF140601 " title="AT&T Any Message Delivering to unknown port Deletion " revision="035">
-	Introduced two new APIs in CSmsSettings class to set the "Discard UnknownPort Message" flag.
-  </defect>
-
-  <defect number="DEF140106" title="cannot create SMS through techview on NE1 and NE1S " revision="034">
-   CreateHeaderTableL() requires client application to have Write Device Data capability. The function was called inappropriately.
-  </defect>
-
-  <deliverystep number="1365" name="Store Message content in SQL" osproject="SymTB101" revision="033">
-   <preq number="2073" title="Store Message content in SQL">
-    Migration of Email and SMS headers to SQL.
-   </preq>
-    <milestone project="GT0478" number="3.3.2"/>
-  </deliverystep>
-
-
-  <deliverystep number="1462" name="Splitting mixed header files for Messaging" osproject="SymTB92" revision="032">
-   <preq number="2510" title=" Splitting mixed header files for Messaging">
-    Mixed header files will now contain only published All or published Partner or internal
-   </preq>
-    <milestone project="GT0465" number="3.5"/>
-  </deliverystep>
-
-  <defect number="DEF138040" title="[StrayScanner]CSmsSimParamOperation potential for E32USER-CBase 46" revision="031">
-    resolved stray event posibility for CSmsSimParamOperation constructor.  
-  </defect>
-
-  <defect number="DEF137853" title="EUpsDecSessionYes is not handled by SMS MTM" revision="030">
-    EUpsDecYes and EUpsDecSessionYes is now handled in SMS server mtm.  
-  </defect>
-
-  <deliverystep number="1472" name="Removal of CDMA support" osproject="Sphinx" revision="029">
-    <preq number="2002" title="Removal of CDMA support">
-    Removed BiowatchersCdma and multimode component.
-    </preq>
-    <milestone project="GT0358" number="3.6"/>
-  </deliverystep>
-
-  <defect number="PDEF129150" title="SMS sending sometimes fails the wrong message " revision="028">
-    Added a condition to check the scenario when one of the sms is locked.  
-  </defect>
-
-  <defect number="PDEF128414" title="SMS messages not sent when are prepared directly in the outbox" revision="027">
-	Added a condition to check if SMS is in preparation 
-  </defect> 
-
-  <defect number="PDEF128412" title="Array out of bounds panic in SMS server mtm" revision="026">
-	Added a condition to check boundary condition 
-  </defect> 
-
-  <defect number="DEF128077" title="@prototype tags in messaging" revision="025">
-    Add proper Im tag.
-  </defect>
-
-  <defect number="DEF127379" title="Many (simple) syntax errors in messaging code " revision="024">
-    Removed the class prefix to the operator and constructor functions.   
-  </defect>
-
-  <defect number="PDEF124476" title="leaked handles in msvserver" revision="023">
-    Closed RThread handle to avoid leak
-  </defect>
-
- <deliverystep number="835" name="Messaging: New advanced APIs for searching and sorting for Message store" osproject="Sphinx" revision="022">
-   <preq number="1667" title="Enhanced search capabilities for message store">
-    For supportong new advanced APIs for searching and sorting for Message store, changes done in CSmsClientMtm::FindL
-   </preq>
-    <milestone project="GT0358" number="3.2.2"/>
-  </deliverystep>  
-
-  <defect number="PDEF119198" title="TMsvSmsEntry class has incorrect Doxygen tags " revision="021">
-	Corrected  Doxygen tags for  TMsvSmsEntry class.  
-  </defect> 
-
-  <defect number="PDEF115918" title="smuthdr.h - Function not deprecated which should be deprecated " revision="020">
-	Added tags for SMUTHDR.H file. 
-  </defect> 
-
-  <deliverystep number="808" name="Messaging: Unicode / Binary encoding for SMS in SendAs" osproject="Sphinx" revision="019">
-    <preq number="1881" title="UNICODE/Binary for SMS SendAs">
-    UNICODE/Binary for SMS SendAs
-  </preq>
-    <milestone project="GT0358" number="3.1"/>
-  </deliverystep>
-    
- <defect number="PDEF115838" title="Messaging: Crash note 'Application closed:Main!' pops up after deleting the only " revision="018">
-	Phone has to return  message main menu without crash.for that added condition 
-  </defect>  
-
-   <defect number="PDEF114726" title="V and V Ricardo: sms with v-card" revision="017">
-	CWapRecipientSend have to generate a log ID for receiving delivery reports.
-  </defect>
-
-   <defect number="DEF112582" title="SendAs2ExampleClient doesnt seem to work as expected after an API change" revision="016">
-	The iSmsHeader.Recipient.Count, value was not getting incremented, if multiple recipient were added to the message.
-  </defect>
-
-   <defect number="PDEF111041" title="st_messaging_cdmasms fails with Progress Error:-40 " revision="015">
-	The message already contains BEGIN:VCARD so,do not insert this text again.
-  </defect>
-
-  <defect number="DEF111689" title="Filename Policy non-conformance generates warnings in checksource build " revision="014">
-    Replaced the #ifdef WINS with #ifdef WINSCW 
-  </defect>
-
-  <defect number="PDEF112122" title="Documentation for KSmcmSmsNumberMaxNumberLength refers to nonexistent functions " revision="013">
-	Edited the documentation for KSmcmSmsNumberMaxNumberLength.
-  </defect>
-
-  <defect number="PDEF111996" title="Wrong function referred to in TSmsMtmCommand " revision="012">
-	Edited the documentation for TSmsMtmCommand.
-  </defect>
-
-  <defect number="PDEF111620" title="SMS reception broken due to exception in TSmsUtilities::DoGetDetailsL " revision="011">
-	Need to check if the first and given name of the contact is greater than the MaxLength and set the pointer to MaxLength.
-  </defect>
-
-  <defect number="PDEF110773" title="Wrong text in Confirm delete dialog when deleting from Draft and Sent" revision="010">
-	Needs to check whether there is any data in the body before setting iDescription to the contents.
-  </defect>
-
-  <deliverystep number="695" name="PREQ1736 to MCL" osproject="Oghma" revision="009">
-    <preq number="1736" title="SMS Class 0 and Type 0 3GPP Compliance">
-    SMS Class 0 and Type 0 3GPP Compliance
-    </preq>
-    <milestone project="GT0342" number="3.6"/>
-  </deliverystep>
-  
-  <defect number="DEF108002" title="Warnings generated with checksource build  " revision="008">
-    Added condition to differentiate the winscw and armv5 def files for case sensitive 
-  </defect>
-
-  <defect number="PDEF108923" title="Klocwork errors: messaging_sms_multimode " revision="007">
-    Increased the size of the CSmsNumber::iAckInfo array such that it can be indexed by all the values in the TSmsAckType enumeration.
-  </defect>
-  
-  <deliverystep number="601" name="Implemented user prompting while sending/recieving the messages" osproject="Oghma" revision="006">
-    <preq number="1678" title="Messaging User Prompting">
-    Messaging User Prompting
-  </preq>
-    <milestone project="GT0342" number="3.4"/>
-  </deliverystep>
-
-  <deliverystep number="500" name="Messaging file name changes to support GNU compiler for Linux" osproject="Oghma" revision="005">
-    <preq number="1182" title="GNU Make-based build system">
-    GNU Make-based build system
-  </preq>
-    <milestone project="GT0342" number="3.3"/>
-  </deliverystep>
-
-  <defect number="DEF105400" title="Add missing IM tags to Messaging public header files" revision="004">
-    Added IM tag for all given header files.
-  </defect>
-
-  <defect number="PDEF107530" title="ServerMTM statemachine problem." revision="003">
-    Don't attempt to resend an SMS if the send fails with a GSM operation not allowed error code
-  </defect>
-
-  <defect number="PDEF105775" title="SMS that has failed to be sent to some recipients are not saved" revision="002">
-    SMS saved even if send to some recipients has failed
-  </defect>
-
-  <defect number="PDEF103385" title="Messaging SMS tests failing due to use of deprecated CommDB APIs" revision="001">
-    Change method of accessing modem bearer record in CommDB database to remove use of API combination which is no longer supported
-  </defect>
-</relnotes>
--- a/messagingappbase/smsmtm/group/messaging_sms.mrp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description: 
-#
-
-component	messaging_sms
-source	\sf\app\messaging\mobilemessaging\smsmtm
-
-binary	\sf\app\messaging\mobilemessaging\smsmtm\group	all
-exports	\sf\app\messaging\mobilemessaging\smsmtm\group	
-
-notes_source	\component_defs\release.src
-
-
-ipr E 
-ipr T \sf\app\messaging\mobilemessaging\smsmtm\clientmtm\test
-ipr T \sf\app\messaging\mobilemessaging\smsmtm\test
-
--- a/messagingappbase/smsmtm/servermtm/bmarm/SMSSU.DEF	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	NewL__13CSmsServerMtmR17CRegisteredMtmDllP15CMsvServerEntry @ 1 NONAME R3UNUSED ; CSmsServerMtm::NewL(CRegisteredMtmDll &, CMsvServerEntry *)
-
--- a/messagingappbase/smsmtm/servermtm/bwins/SMSSU.DEF	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	?NewL@CSmsServerMtm@@SAPAV1@AAVCRegisteredMtmDll@@PAVCMsvServerEntry@@@Z @ 1 NONAME ; public: static class CSmsServerMtm * __cdecl CSmsServerMtm::NewL(class CRegisteredMtmDll &,class CMsvServerEntry *)
-
--- a/messagingappbase/smsmtm/servermtm/eabi/smssU.DEF	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-EXPORTS
-	_ZN13CSmsServerMtm4NewLER17CRegisteredMtmDllP15CMsvServerEntry @ 1 NONAME
-	_ZTI11CSmssActive @ 2 NONAME ; #<TI>#
-	_ZTI12CSmsSimUtils @ 3 NONAME ; #<TI>#
-	_ZTI13CSmsServerMtm @ 4 NONAME ; #<TI>#
-	_ZTI14CSmsOutboxSend @ 5 NONAME ; #<TI>#
-	_ZTI15CSmsSendSession @ 6 NONAME ; #<TI>#
-	_ZTI16CSmsScheduleSend @ 7 NONAME ; #<TI>#
-	_ZTI17CSmsRecipientSend @ 8 NONAME ; #<TI>#
-	_ZTI17CWapRecipientSend @ 9 NONAME ; #<TI>#
-	_ZTI18CSmsScheduledEntry @ 10 NONAME ; #<TI>#
-	_ZTI18CTextRecipientSend @ 11 NONAME ; #<TI>#
-	_ZTI8CSmsSend @ 12 NONAME ; #<TI>#
-	_ZTIN15CSmsSendSession12CSmsSendTypeE @ 13 NONAME ; #<TI>#
-	_ZTV11CSmssActive @ 14 NONAME ; #<VT>#
-	_ZTV12CSmsSimUtils @ 15 NONAME ; #<VT>#
-	_ZTV13CSmsServerMtm @ 16 NONAME ; #<VT>#
-	_ZTV14CSmsOutboxSend @ 17 NONAME ; #<VT>#
-	_ZTV15CSmsSendSession @ 18 NONAME ; #<VT>#
-	_ZTV16CSmsScheduleSend @ 19 NONAME ; #<VT>#
-	_ZTV17CSmsRecipientSend @ 20 NONAME ; #<VT>#
-	_ZTV17CWapRecipientSend @ 21 NONAME ; #<VT>#
-	_ZTV18CSmsScheduledEntry @ 22 NONAME ; #<VT>#
-	_ZTV18CTextRecipientSend @ 23 NONAME ; #<VT>#
-	_ZTV8CSmsSend @ 24 NONAME ; #<VT>#
-	_ZTVN15CSmsSendSession12CSmsSendTypeE @ 25 NONAME ; #<VT>#
-
--- a/messagingappbase/smsmtm/servermtm/group/SMSS.rss	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,160 +0,0 @@
-// Copyright (c) 2005-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 "smss.rls"
-#include <schsend.rh>
-#include <badef.rh>
-#include "smss.hrh"
-
-RESOURCE LBUF r_addressee_telephone_open	{txt = STRING_r_addressee_telephone_open1;}	//max 1 char
-RESOURCE LBUF r_addressee_telephone_close	{txt = STRING_r_addressee_telephone_close1;}	//max 1 char
-RESOURCE LBUF r_sender_name_format			{txt = SMS_GIVEN_NAME" "SMS_FAMILY_NAME;}
-RESOURCE LBUF r_type_status_report			{txt = STRING_r_type_status_report1;}
-
-//Special Message Indication
-
-RESOURCE LBUF r_message_indication_voicemail_one	{txt = STRING_r_message_indication_voicemail_one1;}		//max 32 chars
-RESOURCE LBUF r_message_indication_voicemail_many	{txt = STRING_r_message_indication_voicemail_many1;}	//max 32 chars
-
-RESOURCE LBUF r_message_indication_email_one		{txt = STRING_r_message_indication_email_one1;}			//max 32 chars
-RESOURCE LBUF r_message_indication_email_many		{txt = STRING_r_message_indication_email_many1;}		//max 32 chars
-
-RESOURCE LBUF r_message_indication_fax_one			{txt = STRING_r_message_indication_fax_one1;}				//max 32 chars
-RESOURCE LBUF r_message_indication_fax_many			{txt = STRING_r_message_indication_fax_many1;}			//max 32 chars
-
-RESOURCE LBUF r_message_indication_other_one		{txt = STRING_r_message_indication_other_one1;}			//max 32 chars
-RESOURCE LBUF r_message_indication_other_many		{txt = STRING_r_message_indication_other_many1;}		//max 32 chars
-
-RESOURCE SEND_ERROR_ACTIONS error_actions
-	{
-	default =
-		{
-		SEND_ERROR_ACTION
-			{
-			flags = KActionRetryLater + KRetriesFixed + KRetrySpacingStatic;
-			max_retries = 3;
-			errors =
-				{
-				SEND_ERROR {error = 0;}
-				};
-			}
-		};
-	actions =
-		{
-		SEND_ERROR_ACTION
-			{
-			flags = KActionFail;
-			errors =
-				{
-				//General Errors
-				SEND_ERROR { error = -5; },		// KErrNotSupported
-				SEND_ERROR { error = -3; },		// KErrCancel
-				
-				//SMS Errors
-				SEND_ERROR { error = -4814; },	// KErrGsmSMSOperationNotAllowed
-				SEND_ERROR { error = -5252; }	// KPKIErrKeyStoreEmpty
-				};
-			},
-		SEND_ERROR_ACTION
-			{
-			flags = KActionRetryLater + KRetriesInfinite + KRetrySpacingStatic;
-			errors =
-				{
-				//General Errors
-				SEND_ERROR { error = -4; },		// KErrNoMemory
-				SEND_ERROR { error = -26; },	// KErrDiskFull
-				SEND_ERROR { error = -42; },	// KErrBadPower
-
-				//SMS Errors
-				SEND_ERROR { error = -4529; },	// KErrGsmSMSNetworkFailure
-				SEND_ERROR { error = -4553; },	// KerrGsmSMSTemporaryFailure
-				SEND_ERROR { error = -4554; },	// KerrGsmSMSCongestion
-				SEND_ERROR { error = -4559; }	// KerrGsmSMSResourcesUnavailable
-				};
-			},
-		
-		// As per GSM 03.40 specs, its temporary Congestion error, so its better to retry later 
-		// because retry immediatly will seldom brings success.
-		SEND_ERROR_ACTION
-			{
-			flags = KActionRetryLater + KRetriesFixed + KRetrySpacingStatic;
-			max_retries = 3;
-			errors =
-				{
-				//General Errors
-				SEND_ERROR { error = -14; },	// KErrInUse
-				SEND_ERROR { error = -18; },	// KErrNotReady
-
-				//Messaging Errors
-				SEND_ERROR { error = -7000; },	// KMsvMediaUnavailable
-
-				//Socket Errors
-				SEND_ERROR { error = -190; },	// KErrNetUnreach
-
-				//SMS Errors
-				SEND_ERROR { error = -4534; },	// KerrGsmSMSMemoryCapacityExceeded
-				SEND_ERROR { error = -4539; },	// KerrGsmSMSDestinationOutOfOrder
-				SEND_ERROR { error = -4607; },	// KErrGsmSMSUnspecifiedInvalidMessage
-				SEND_ERROR { error = -4623; },	// KErrGsmSMSUnspecifiedProtocolError
-				SEND_ERROR { error = -4642; },	// KerrGsmSMSCannotReplaceShortMessage
-				SEND_ERROR { error = -4655; },	// KerrGsmSMSUnspecifiedPIDError
-				SEND_ERROR { error = -4671; },	// KerrGsmSMSUnspecifiedDCSError
-				SEND_ERROR { error = -4687; },	// KerrGsmSMSUnspecifiedCommandError
-				SEND_ERROR { error = -4704; },	// KerrGsmSMSServiceCentreBusy
-				SEND_ERROR { error = -4706; },	// KerrGsmSMSSCSystemFailure
-				SEND_ERROR { error = -4707; },	// KerrGsmSMSInvalidSMEAddress
-				SEND_ERROR { error = -4767; },	// KerrGsmSMSUnspecifiedErrorCause
-				SEND_ERROR { error = -4813; },	// KerrGsmSMSServiceOfMSReserved
-				SEND_ERROR { error = -4832; },	// KErrGsmSMSMemoryFailure
-				SEND_ERROR { error = -4833; },	// KErrGsmSMSInvalidMemoryIndex
-				SEND_ERROR { error = -4834; },	// KErrGsmSMSMemoryFull
-				SEND_ERROR { error = -4844; },	// KErrGsmSMSNetworkTimeout
-				SEND_ERROR { error = -4852; },	// KErrGsmSMSCnmaAckNotExpected
-				SEND_ERROR { error = -5012; }	// KerrGsmSMSUnknownError
-				};
-			},
-		SEND_ERROR_ACTION
-			{
-			flags = KActionRetryImmediately + KRetriesFixed + KRetrySpacingStatic;
-			max_retries = 3;
-			errors =
-				{
-				//General Errors
-				SEND_ERROR { error = -15; },	// KErrServerTerminated
-				SEND_ERROR { error = -29; },	// KErrCommsLineFail
-				SEND_ERROR { error = -30; },	// KErrCommsFrame
-				SEND_ERROR { error = -31; },	// KErrCommsOverrun 
-				SEND_ERROR { error = -32; },	// KErrCommsParity 
-				SEND_ERROR { error = -33; },	// KErrTimedOut
-
-				//ETel Errors
-				SEND_ERROR { error = -2017; },	// KErrEtelModemNotDetected
-
-				//SMS Errors
-				SEND_ERROR { error = -4533; }	// KerrGsmSMSShortMessageTransferRejected
-				};
-			}
-		};
-	}
-
-//Email SMS reply/forward format
-RESOURCE LBUF r_sms_email_forward_subject_format		{txt = STRING_r_sms_email_forward_subject_format;}	
-RESOURCE LBUF r_sms_email_reply_subject_format			{txt = STRING_r_sms_email_reply_subject_format;}
-
-RESOURCE LBUF r_message_indication_videomessage_one	        {txt = STRING_r_message_indication_videomessage_one1;}	//max 32 chars
-RESOURCE LBUF r_message_indication_videomessage_many		{txt = STRING_r_message_indication_videomessage_many1;}	//max 32 chars
-
-RESOURCE LBUF r_message_indication_enhanced_voicemail_one	{txt = STRING_r_message_indication_enhanced_voice_one1;}//max 32 chars
-RESOURCE LBUF r_message_indication_enhanced_voicemail_many	{txt = STRING_r_message_indication_enhanced_voice_many1;}//max 32 chars
--- a/messagingappbase/smsmtm/servermtm/group/smss.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-// Copyright (c) 1999-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:
-// smss.dll SMS Server MTM
-// smss.rsc SMS Server MTM resource defining error actions
-//
-
-
-
-/**
- @file
-*/
-
-#include "../../../../../../mw/messagingmw/messagingfw/msgtests/group/msgopt.mph"
-
-TARGET		smss.dll
-CAPABILITY ReadDeviceData WriteDeviceData ProtServ NetworkControl NetworkServices LocalServices ReadUserData WriteUserData
-TARGETPATH	/system/libs
-TARGETTYPE	dll
-
-#if defined(WINS)
-UID	0x10003C5E 0x10003C72
-VENDORID 0x70000001
-#else
-UID	0x10003C5E 0x10003C72
-VENDORID 0x70000001
-#endif
-
-VERSION 	10.0
-PAGED
-
-SOURCEPATH	../src
-USERINCLUDE	../inc 
-APP_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE /epoc32/include/ecom
-
-#if (defined SYMBIAN_USER_PROMPT_SERVICE)
-#endif
-
-SOURCE		SMSSMAIN.CPP
-SOURCE		SMSSSEND.CPP
-SOURCE		SMSSOUTB.CPP
-SOURCE		SMSSERV.CPP
-SOURCE		SMSSchSend.cpp
-SOURCE		SMSSendSession.cpp
-SOURCE		SMSRecipientSend.cpp
-SOURCE		TextRecipientSend.cpp
-SOURCE		WapRecipientSend.cpp
-SOURCE		smssactive.cpp
-SOURCE		SmssSimUtils.cpp
-
-LIBRARY		euser.lib
-LIBRARY		etext.lib
-LIBRARY		c32.lib
-LIBRARY		smcm.lib
-LIBRARY		msgs.lib
-LIBRARY		gsmu.lib
-LIBRARY		esock.lib
-LIBRARY		estor.lib
-LIBRARY		smsu.lib
-LIBRARY		biodb.lib
-LIBRARY		bifu.lib
-LIBRARY		etelmm.lib
-LIBRARY		centralrepository.lib
-LIBRARY		ecom.lib 
-
-#if (defined SYMBIAN_USER_PROMPT_SERVICE)
-LIBRARY upsclient.lib
-#endif
-
-#ifdef WINSCW
-DEFFILE 	SMSS.DEF
-#else
-DEFFILE		smss.DEF
-#endif
-
-#ifdef _MSG_NO_LOGGING_DEFINE
-DEBUGLIBRARY		flogger.lib
-#else
-LIBRARY		flogger.lib
-#endif
-
-LIBRARY		schsend.lib
-
-SOURCEPATH	.
-START RESOURCE	SMSS.rss
-TARGETPATH resource/messaging
-LANG	SC
-HEADER
-END
-
-START WINS
-   BASEADDRESS 0x4AB20000
-END
-
-SMPSAFE
--- a/messagingappbase/smsmtm/servermtm/group/smss.rls	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-// Copyright (c) 2005-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:
-//
-
-rls_string STRING_r_addressee_telephone_open1 "<" //max 1 char
-rls_string STRING_r_addressee_telephone_close1 ">" //max 1 char
-rls_string STRING_r_type_status_report1 "Status Report" 
-rls_string STRING_r_message_indication_voicemail_one1 "Voicemail Waiting" //max 32 chars
-rls_string STRING_r_message_indication_voicemail_many1 "%d Voicemails Waiting" //max 32 chars
-rls_string STRING_r_message_indication_email_one1 "E-Mail Waiting" //max 32 chars
-rls_string STRING_r_message_indication_email_many1 "%d E-Mails Waiting" //max 32 chars
-rls_string STRING_r_message_indication_fax_one1 "Fax Waiting" //max 32 chars
-rls_string STRING_r_message_indication_fax_many1 "%d Faxes Waiting" //max 32 chars
-rls_string STRING_r_message_indication_other_one1 "Message Waiting" //max 32 chars
-rls_string STRING_r_message_indication_other_many1 "%d Messages Waiting" //max 32 chars
-rls_string STRING_r_sms_email_forward_subject_format "Fw: %S"
-rls_string STRING_r_sms_email_reply_subject_format "Re: %S"
-rls_string STRING_r_message_indication_videomessage_one1 "Video Message Waiting"	//max 32 chars
-rls_string STRING_r_message_indication_videomessage_many1 "%d Video Messages Waiting"	//max 32 chars
-rls_string STRING_r_message_indication_enhanced_voice_one1 "Enhanced Voicemail Waiting"   //max 32 chars
-rls_string STRING_r_message_indication_enhanced_voice_many1 "%d Enhanced Voicemails Waiting"  //max 32 chars
--- a/messagingappbase/smsmtm/servermtm/inc/SMSRecipientSend.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-// Copyright (c) 1999-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 SMS_RECIPIENT_SEND_H_
-#define SMS_RECIPIENT_SEND_H_
-
-#include <msvstd.h>
-#include <es_sock.h>
-#include <biodb.h>
-#include <es_wsms.h>
-
-#include "smssactive.h"
-
-class CSmsMessage;
-class TSmsProgress;
-class CSmsEventLogger;
-class CSmsHeader;
-
-class CSmsRecipientSend : public CSmssActive
-/**
-@internalComponent
-@released
-*/
-	{
-public:
-	enum TSmsRecipientSendState
-		{
-		ESmsRecipientSendWaiting,
-		ESmsRecipientSendGetLogEvent,
-		ESmsRecipientSendAddLogEvent,
-		ESmsRecipientSendChangeLogEvent,
-		ESmsRecipientSendSendingMessage
-		};
-
-public:
-	~CSmsRecipientSend();
-	void Start(TRequestStatus& aStatus, const TMsvEntry& aEntry, CSmsHeader& aHeader, CSmsNumber& aRcpt);
-	virtual TBool AcceptMessage(const TMsvEntry& aEntry, const CSmsHeader& aHeader) const = 0;
-
-protected:
-	CSmsRecipientSend(TSmsProgress& aProgress, RFs& aFs, CMsvServerEntry& aServerEntry);
-	
-protected:
-	void ConstructL();
-	virtual TBool AcceptBioMsgId(const TBioMsgId& aBiomsgId) const = 0;
-	TInt AcceptBioType(TInt aBioType, TBioMsgIdType aBearer) const;
-	void GetDefaultSendBearerL(TInt aBioType, TBioMsgIdType aBearer, TBioMsgId& rBioMsgId) const;
-
-	void GetLogEvent();
-	void AddLogEvent();
-
-private:
-	void DoRunL();
-	void DoComplete(TInt& aStatus);
-	void DoSmssCancel();
-
-	virtual void SendMessageL() = 0;
-	virtual void StartL() = 0;
-	virtual void DoCancelSendingMessage()=0;
-
-	void ChangeLogEvent();
-
-protected:
-
-	TSmsProgress& iProgress;
-	TSmsRecipientSendState iState;
-	TPckgBuf<TUint> iSendBuffer;
-
-	CSmsHeader* iHeader;
-	CSmsNumber* iRecipient;
-	TMsvEntry	iEntry;
-
-	RSocketServ iSession;
-	RSocket iSocket;
-
-private:
-	CSmsEventLogger* iLogger;
-	};
-
-class CTextRecipientSend : public CSmsRecipientSend
-/**
-@internalComponent
-@released
-*/
-	{
-public:
-	static CTextRecipientSend* NewL(TSmsProgress& aProgress, RFs& aFs, CMsvServerEntry& aServerEntry);
-	~CTextRecipientSend();
-
-private:
-
-	CTextRecipientSend(TSmsProgress& aProgress, RFs& aFs, CMsvServerEntry& aServerEntry);
-	TBool AcceptMessage(const TMsvEntry& aEntry, const CSmsHeader& aHeader) const;
-	TBool AcceptBioMsgId(const TBioMsgId& aBiomsgId) const;
-
-	void SendMessageL();
-	void StartL();
-	void DoCancelSendingMessage();
-
-	void PrependNbsStringL(const TMsvEntry& aEntry, CSmsMessage& arMessage, HBufC*& rOldMessage);
-	void RevertBackToOldMessageL(const TDesC& aOldMessage, CSmsMessage& arMessage);
-	};
-
-class CWapRecipientSend : public CSmsRecipientSend
-/**
-@internalComponent
-@released
-*/
-	{
-public:
-	static CWapRecipientSend* NewL(TSmsProgress& aProgress, RFs& aFs, CMsvServerEntry& aServerEntry);
-	~CWapRecipientSend();
-
-private:
-	CWapRecipientSend(TSmsProgress& aProgress, RFs& aFs, CMsvServerEntry& aServerEntry);
-	TBool AcceptMessage(const TMsvEntry& aEntry, const CSmsHeader& aHeader) const;
-	TBool AcceptBioMsgId(const TBioMsgId& aBiomsgId) const;
-
-	void SendMessageL();
-	void StartL();
-	void DoCancelSendingMessage();
-
-private:
-	HBufC8* iMessage8;
-	TWapAddr iWapAddr;
-	};
-
-#endif
--- a/messagingappbase/smsmtm/servermtm/inc/SMSSERV.H	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-// Copyright (c) 1999-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 SMSSERV_H_
-#define SMSSERV_H_
-
-#include <smuthdr.h>
-#include <schedulebaseservermtm.h>
-#include <smutset.h>
-
-class CSmsOutboxSend;
-class CSmsSimUtils;
-
-class CSmsServerMtm : public CScheduleBaseServerMtm
-/**
-@internalTechnology
-@released
-*/
-	{
-public:
-	IMPORT_C static CSmsServerMtm* NewL(CRegisteredMtmDll& aRegisteredMtmDll, CMsvServerEntry* aServerEntry);
-	~CSmsServerMtm();
-
-	void CopyToLocalL(const CMsvEntrySelection& aSelection,TMsvId aDestination, TRequestStatus& aStatus);
-	void CopyFromLocalL(const CMsvEntrySelection& aSelection,TMsvId aDestination, TRequestStatus& aStatus);
-	void CopyWithinServiceL(const CMsvEntrySelection& aSelection,TMsvId aDestination, TRequestStatus& aStatus);
-	void MoveToLocalL(const CMsvEntrySelection& aSelection,TMsvId aDestination, TRequestStatus& aStatus);
-	void MoveFromLocalL(const CMsvEntrySelection& aSelection,TMsvId aDestination, TRequestStatus& aStatus);
-	void MoveWithinServiceL(const CMsvEntrySelection& aSelection,TMsvId aDestination, TRequestStatus& aStatus);
-//	void DeleteL(const CMsvEntrySelection& aSelection, TRequestStatus& aStatus);
-	void DeleteAllL(const CMsvEntrySelection& aSelection, TRequestStatus& aStatus);
-	void CreateL(TMsvEntry aNewEntry, TRequestStatus& aStatus);
-	void ChangeL(TMsvEntry aNewEntry, TRequestStatus& aStatus);
-	//
-	void StartCommandL(CMsvEntrySelection& aSelection, TInt aCommand, const TDesC8& aParameter, TRequestStatus& aStatus);
-	//
-	TBool CommandExpected();
-	//
-	const TDesC8& Progress();
-	//
-
-protected:
-	void DoCancel();
-	void DoRunL();
-	void CompleteCommand(TInt aError);
-	void DoComplete(TInt aError);
-
-//	--- Functions derived from CScheduleBaseServerMtm ---
-	TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
-	void ConstructL();
-	void RestoreScheduleSettingsL();
-private:
-	CSmsServerMtm(CRegisteredMtmDll& aRegisteredMtmDll, CMsvServerEntry* aServerEntry);
-	void RestoreSettingsL();
-	void LoadResourceFileL();
-	void FindServiceId();
-	void PopulateSchedulePackage(const TDesC8& aParameter, const TBool aMove, TMsvSchedulePackage& aPackage) const;
-	void ScheduleCommandL(CMsvEntrySelection& aSelection, TInt aCommand, const TDesC8& aParameter, TRequestStatus& aStatus);
-	void SimUtilsL(const CMsvEntrySelection& aSelection, TInt aCommand, const TDesC8& aParameter, TRequestStatus& aStatus);
-
-private:
-	TMsvId 					iSmsServiceId;
-	TSmsProgress 			iProgress;
-	TSmsProgressBuf 		iProgressBuf;	
-	CSmsOutboxSend* 		iOutboxSend;
-	CSmsSimUtils* 			iSimUtils;
-	enum TSmsServerMtmState
-		{
-		ESmsServerMtmWaiting,
-		ESmsServerMtmSending,
-		ESmsServerMtmScheduling,
-		ESmsServerMtmSimUtils
-		} iState;
-#if (defined SYMBIAN_USER_PROMPT_SERVICE)		
-	TThreadId				iClientThreadId;
-	TBool 					iHasCapability;
-#endif	
-	};
-
-#endif
--- a/messagingappbase/smsmtm/servermtm/inc/SMSSOUTB.H	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,137 +0,0 @@
-// Copyright (c) 1999-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 __SMSSOUTB_H__
-#define __SMSSOUTB_H__
-
-#include <e32base.h>
-
-#include <msventry.h>
-#include <msvsenderroraction.h>
-#include <smutset.h>
-#include <msvschedulepackage.h>
-#include "smssactive.h"
-
-#if (defined SYMBIAN_USER_PROMPT_SERVICE)
-#include <ups/upsclient.h>
-using namespace UserPromptService;
-#endif
-
-class CParaFormatLayer;
-class CCharFormatLayer;
-class CSmsSendSession;
-class CMsvScheduleSend;
-class CSmsEventLogger;
-class CSmsEditorBuffer;
-
-class CSmsOutboxSend : public CSmssActive
-/**
-@internalComponent
-@released
-*/
-	{
-public:
-	enum TSmsOutboxSendState
-		{
-		ESmsOutboxSendStateWaiting,
-		ESmsOutboxSendStateFindingOtherMessages,
-		ESmsOutboxSendStateSending,
-		ESmsOutboxSendStateReScheduling,
-		ESmsOutboxSendStateAddLogEvent,
-		ESmsOutboxSendStateGetLogEvent,
-		ESmsOutboxSendStateChangeLogEvent,
-		ESmsOutboxSendStateLogEntryComplete,
-		ESmsOutboxSendStateMovingEntry,
-		ESmsOutboxSendStateComplete,
-		ESmsOutboxSendAuthoriseState
-		};
-
-public:
-	static CSmsOutboxSend* NewL(CMsvServerEntry& aServerEntry, CMsvScheduleSend& aScheduleSend, RFs& aFs);
-	~CSmsOutboxSend();
-
-	const TSmsProgress& Progress(); 
-	
-#if (defined SYMBIAN_USER_PROMPT_SERVICE)	
-	void StartL(TRequestStatus& aStatus,const CMsvEntrySelection& aSelection, const TBool aMove, const TDesC8& aParameter, TThreadId aClientThreadId, TBool aHasCapability);
-#endif	
-
-	void Start(TRequestStatus& aStatus,const CMsvEntrySelection& aSelection, const TBool aMove, const TDesC8& aParameter);
-	
-protected:
-	void DoSmssCancel();
-
-private:
-	void DoRunL();	
-
-private:
-	CSmsOutboxSend(CMsvServerEntry& aServerEntry, CMsvScheduleSend& aScheduleSend, RFs& aFs);
-	void ConstructL();
-	void SendNextHeaderL();
-	void DoComplete(TInt& aStatus); //from CSmssActive
-	void FindOtherMessagesL(const CMsvEntrySelection& aSelection);
-
-	void MoveEntryL();
-	void LogEntry();
-	void ReScheduleFailedMessageL();
-	void DoReScheduleL(const TMsvSendErrorAction* aErrorAction = NULL);
-
-	TBool ConditionsRightForSending(TMsvSendErrorAction& rErrorAction);
-
-// Logging Functions
-	void GetLogEvent(TLogId aId);
-	void AddLogEvent();
-	void ChangeLogEvent();
-
-	TBool MessageSent() const;
-	TBool CanLogRecipient(const CSmsNumber& aNumber) const;
-	TInt GetLogStatus() const;
-
-	void FailOutstandingMessages(TInt aError, TInt aSendingState);
-	void SendHeader();
-private:
-	TSmsProgress 		iProgress;
-
-	CMsvEntrySelection* iMsvEntrySelection;
-	CSmsSendSession* 	iSendSession;
-	CSmsEventLogger* 	iLogger;
-
-	CRichText* 			iRichText;
-	CParaFormatLayer* 	iParaLayer;
-	CCharFormatLayer* 	iCharLayer;
-	CSmsEditorBuffer* 	iText;
-	CSmsHeader* 		iSmsHeader;
-
-	CMsvScheduleSend& 	iScheduleSend;
-
-	TMsvSchedulePackage iPackage;
-	TMsvEntry 			iEntry;
-	TMsvId 				iCurrentMessage;
-	TBool 				iMove;
-	TBool 				iSentFolderExists;
-	TTime 				iStartTime;
-	TBool 				iCondMet;
-	TInt 				iErr;
-		
-#if (defined SYMBIAN_USER_PROMPT_SERVICE)
-	/** For Interaction with UPS server */
-	RUpsSession 		iUpsSession;
-	RUpsSubsession 		iUpsSubsession;
-	TBool 			iHasCapability;
-	TUpsDecision 		iDecision;
-#endif	
-	};
-
-#endif	// __SMSSOUTB_H__
--- a/messagingappbase/smsmtm/servermtm/inc/SMSSPAN.H	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-// Copyright (c) 1999-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 SMSSPAN_H_
-#define SMSSPAN_H_
-
-#include <e32base.h>
-
-const TInt KSmsSessionPriority = CActive::EPriorityStandard;
-
-/**
-@internalComponent
-@released
-*/
-enum TSmssPanic
-	{
-//	KSmssPanicFileError,
-	ESmssEntryNotSet,
-	ESmssEntryAlreadySet,
-	ESmssReportNotNull,
-	ESmssWrongEntryMtmType,
-	KSmssPanicUnexpectedCommand,
-	KSmssPanicMtmAlreadyActive,
-	KSmssPanicAlreadySending,
-	KSmssPanicUnexpectedState,
-	KSmssPanicUnexpectedErrorCode,
-	KSmssPanicAlreadyUsingSimUtils,
-	KSmssPanicNoMessagesInSelection,
-	KSmssPanicDestinationFolderNotSet,
-	KSmssPanicNoSmsServiceEntry,
-	KSmssPanicBioTypeNotSet,
-	KSmssPanicSendStateOutOfRange,
-	KSmssPanicAlreadyActive,
-	KSmssPanicLogIdNotSet,
-	ESmssPanicPhoneNotFound,
-	ESmssBadState,
-	ESmssNoClass2Folder
-	};
-
-GLREF_C void Panic(TSmssPanic aPanic);
-
-#endif
--- a/messagingappbase/smsmtm/servermtm/inc/SMSSSEND.H	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-// Copyright (c) 1999-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 __SMSSSEND_H__
-#define __SMSSSEND_H__
-
-#include <msvstd.h> 
-#include "smssactive.h"
-
-class CSmsHeader;
-class TSmsProgress;
-class CSmsRecipientSend;
-class CSmsEventLogger;
-
-class CSmsSend : public CSmssActive
-/**
-@internalComponent
-@released
-*/
-	{
-public:
-		
-	static CSmsSend* NewL(TSmsProgress& aProgress, CMsvServerEntry& aServerEntry, RFs& aFs, CSmsHeader& aHeader, CRichText& aRichText, TMsvEntry& aEntry);
-	~CSmsSend();
-
-	void Start(TRequestStatus& aStatus, const TMsvId aMsvId, CSmsRecipientSend* aRecipientSend);
-
-private:
-	CSmsSend(TSmsProgress& aProgress,CMsvServerEntry& aServerEntry, RFs& aFs, CSmsHeader& aHeader, CRichText& aRichText, TMsvEntry& aEntry);
-	void OpenEntryL(const TMsvId aMsvId);
-	void SendNextRecipientL();
-	void UpdateAfterRecipientSentL(const TInt aError);
-	void UpdateEntryAfterAllSentL();
-
-private:	// method from CSmssActive
-
-	virtual void DoRunL();			
-	virtual void DoSmssCancel();
-	virtual void DoComplete(TInt& aStatus);
-
-private:
-
-	TMsvId iSmsServiceId;
-	TSmsProgress& iProgress;
-	TMsvEntry& iEntry;
-	CSmsHeader& iSmsHeader;
-	CRichText& iRichText;
-
-	enum TSmsSendState
-		{
-		ESmsSendWaiting,
-		ESmsSendOpeningEntry,
-		ESmsSendSendingEntry,
-		ESmsSendUpdatingRecipient
-		} iState;
-
-	CSmsRecipientSend* iRecipientSend;
-	CSmsEventLogger* iLogger;
-	TBool iDeliveryReports;	
-	TInt iSentRecipients;
-	TInt iLastSentIndex;
-	// Contains Failed status of a Recipient in a list of recipients.
-	TInt iRecipientFailedStatus ;
-
-	};
-
-#endif	// __SMSSSEND_H__
--- a/messagingappbase/smsmtm/servermtm/inc/SMSSchSend.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-// Copyright (c) 1999-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 SMS_SCH_SEND_H_
-#define SMS_SCH_SEND_H_
-
-#include <smuthdr.h>
-#include <msvschedulesend.h>
-#include <txtrich.h>
-
-//
-//
-//	CSmsScheduleSend Declaration
-//
-//
-
-class CSmsScheduleSend : public CMsvScheduleSend
-/**
-@internalComponent
-@released
-*/
-	{
-public:
-	static CSmsScheduleSend* NewL(CMsvServerEntry& aServerEntry);
-
-protected:
-	CSmsScheduleSend(CMsvServerEntry& aServerEntry);
-	CMsvScheduledEntry* GetMessageL(const TMsvId aId) const;
-	};
-
-//
-//
-//	CSmsScheduledEntry Declaration
-//
-//
-
-class CSmsScheduledEntry : public CMsvScheduledEntry
-/**
-@internalComponent
-@released
-*/
-	{
-public:
-	static CSmsScheduledEntry* NewL(const TMsvEntry& aEntry);
-	~CSmsScheduledEntry();
-
-	TBool CanSendToAnyRecipients(const CMsvSendErrorActions& aErrorActions, TMsvSendErrorAction& aAction);
-	TBool CanSendToAnyRecipients(const TMsvSendErrorAction& aAction);
-	void RecipientsResetRetries();
-	void RecipientsIncreaseRetries();
-	void RecipientsSetFailed();
-	TBool RecipientsAllSent() const;
-
-	void RecipientsStoreL(CMsvStore& aStore) const;
-	void RecipientsRestoreL(CMsvStore& aStore);
-
-private:
-	CSmsScheduledEntry(const TMsvEntry& aEntry);
-	void ConstructL();
-	TBool CheckRecipient(CSmsNumber& aRcpt, const TMsvSendErrorAction& aAction);
-
-	CRichText* iRichText;
-	CParaFormatLayer* iParaLayer;
-	CCharFormatLayer* iCharLayer;
-	CSmsHeader* iHeader;
-	CArrayPtrFlat<CSmsNumber>* iNumbers;
-	};
-
-
-#endif
--- a/messagingappbase/smsmtm/servermtm/inc/SMSSendSession.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-// Copyright (c) 2000-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 __SMSSENDSESSION_H__
-#define __SMSSENDSESSION_H__
-
-#include <e32base.h>
-#include <msvstd.h>
-
-#include "smssactive.h"
-
-class TSmsProgress;
-class CRichText;
-class CSmsSend;
-class CSmsRecipientSend;
-
-class CSmsSendSession : public CSmssActive
-/**
-@internalComponent
-@released
-*/
-	{
-public:
-	
-	static CSmsSendSession* NewL(TSmsProgress& aProgress, CMsvServerEntry& aServerEntry, RFs& aFs, CSmsHeader& aHeader, CRichText& aRichText, TMsvEntry& aEntry);
-	~CSmsSendSession();
-
-	void SendSms(TRequestStatus& aStatus);
-	TMsvId IncSms();
-	TMsvId Id() {return iId;}
-	void DivideMessagesL(CMsvEntrySelection& aSelection);
-
-private:
-
-	CSmsSendSession(TSmsProgress& aProgress, RFs& aFs, CMsvServerEntry& aServerEntry, CSmsHeader& aHeader);
-	void ConstructL(CRichText& aRichText, TMsvEntry& aEntry);
-	void CreateRecipientsL();
-
-	void DoSmssCancel();
-	void DoRunL();
-	void DoComplete(TInt& aStatus); //from CSmssActive
-
-	enum TSmsSendSessionState
-		{
-		ESessionSending,
-		ESessionNoMoreMessages,
-		ESessionNoSendTypes
-		} iState;
-
-	class CSmsSendType : public CBase
-		{
-	public:
-		static CSmsSendType* NewL(CSmsRecipientSend* aRecipientSend);
-		~CSmsSendType();
-
-		CSmsRecipientSend* iRecipientSend;
-		CMsvEntrySelection* iSelection;
-		TInt iCurrentMessage;
-
-	private:
-		CSmsSendType(CSmsRecipientSend* aRecipient);
-		void ConstructL();
-		};
-
-	TMsvId GetNextSms(TInt& aCurType, CSmsSendType* aSendType, TInt& aCurMsg);
-
-	CArrayPtrFlat<CSmsSendType>* iSendTypes;
-	CSmsSend* iSmsSend;
-	TSmsProgress& iProgress;
-	TInt iCurrentSendType;
-	TMsvId iId;
-	CSmsHeader& iSmsHeader;
-	};
-
-#endif	// __SMSSENDSESSION_H__
--- a/messagingappbase/smsmtm/servermtm/inc/SmssSimUtils.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,171 +0,0 @@
-// Copyright (c) 2000-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 SMSS_SIM_UTILS_H_
-#define SMSS_SIM_UTILS_H_
-
-//Includes
-
-#include <smsustrm.h>
-#include <msvstd.h>
-#include "smssactive.h"
-#include <smsuaddr.h>
-#include <csmsgetdetdescinterface.h>
-
-//Forward declarations
-
-class RSocket;
-class RSocketServ;
-class CParaFormatLayer;
-class CCharFormatLayer;
-class CSmsHeader;
-class CBIODatabase;
-
-
-//CSmsSimUtils
-const TUid KSmsSimUtilsDataUid = {0x101f747e};
-const TInt16 KSmsSimUtilsDataVersion = 1;
-
-class TSmsSimUtilsData
-/**
-@internalComponent
-@released
-*/
-	{
-	public:
-
-		inline TSmsSimUtilsData();
-		void StoreL(CMsvStore& aStore) const;
-		void RestoreL(const CMsvStore& aStore);
-		inline TBool IsPresentL(const CMsvStore& aStore) const;
-		void ExternalizeL(RWriteStream& aStream) const;
-		void InternalizeL(RReadStream& aStream);
-
-	public:
-
-		TMsvId iLastEnumerateFolder; //< Last folder used for enumerating SIM messages
-	};
-
-class CSmsSimUtils : public CSmssActive
-/**
-@internalComponent
-@released
-*/
-	{
-public:
-	static CSmsSimUtils* NewL(CMsvServerEntry& aServerEntry, RFs& aFs, TMsvId aSmsServiceId);
-	void EnumerateL(const TDesC8& aParameter, TRequestStatus& aStatus);
-
-	void DeleteFromPhoneStoreL(const CMsvEntrySelection& aSelection, TRequestStatus& aStatus);
-	void CopyFromPhoneStoreL(const CMsvEntrySelection& aSelection, const TDesC8& aParameter, TRequestStatus& aStatus);
-	void MoveFromPhoneStoreL(const CMsvEntrySelection& aSelection, const TDesC8& aParameter, TRequestStatus& aStatus);
-
-	void ReadSimParamsL(TRequestStatus& aStatus);
-	void WriteSimParamsL(TRequestStatus& aStatus);
-
-	inline const TSmsProgress& Progress(); 
-	~CSmsSimUtils();
-
-	static void ConnectL(RSocketServ& arSocketServ, RSocket& arSocket, TSmsAddrFamily aSmsAddrFamily);
-
-	//Write messages to a phone store
-	void CopyToPhoneStoreL(const CMsvEntrySelection& aSelection, const TDesC8& aParameter, TRequestStatus& aStatus);
-	void MoveToPhoneStoreL(const CMsvEntrySelection& aSelection, const TDesC8& aParameter, TRequestStatus& aStatus);
-private:
-	CSmsSimUtils(CMsvServerEntry& aServerEntry, RFs& aFs, TMsvId aSmsServiceId);
-	void ConstructL();
-
-	void ConstructHeaderAndBodyL();
-	void DoRunL();
-	void DoSmssCancel();
-	void DoComplete(TInt& aStatus); //from CSmssActive
-	void ConnectL();
-	void RetrieveMessageFromPhoneStoreL();
-	void SetupMoveDeleteL(const CMsvEntrySelection& aSelection, TRequestStatus& aStatus);
-	void DoDeleteFromPhoneStoreL();
-	void DoDeleteThenMoveFromPhoneStoreL();
-	void DeleteEachMessageFromPhoneStoreL();
-
-	void SetDestination(const TDesC8& aParameter);
-	void MoveEntriesL(const CMsvEntrySelection& aSelection, TBool aCopy=EFalse);
-	
-	//Count the messages in the phone stores
-	void CountMessagesInPhoneStoresL();
-	void CreateBioDbL();
-	TBool GetDefaultSendBearerL(TInt aBioType, TBioMsgIdType aBearer, TBioMsgId& rBioMsgId) const;
-	TUid DecodeBioMessageL(TBioMsgId& rId);
-	void EncodeBioMessageL();
-
-	void DoRunReadSimParamsL();
-
-	void DoCopyToPhoneStoreL();
-
-	void StoreSimUtilsDataL();
-	void RestoreSimUtilsDataL();
-	TMsvId CreateNewEnumerateFolderL();
-	void SetAndCleanEnumerateFolderL(const TDesC8& aParameter);
-	void DeleteChildrenL(TMsvId aId);
-	void DeleteEnumerateFolderL(TMsvId aId);
-	void LoadClass2FolderIdL();
-	void SetLocalStorageInfoL(const CMsvEntrySelection& aSelection);
-	void RestoreSmsSettingsL();
-		
-private:
-	
-	enum TSmsSimUtilsState
-		{
-		ESimUtilsStateOther,
-		ESimUtilsDeleteEachMessage,
-		EWritingToSIM,
-		EUpdatingClass2,
-		EMovingEntries,
-		ESimUtilsDeletedLastMessage
-		} iState;
-	
-	RSocket iSocket;
-	RSocketServ iSocketServ;
-	
-	TSmsProgress iProgress;
-	CMsvEntrySelection* iSelection;
-	
-	//Enumerating Messages & Reading SMS Parameters
-	TPckgBuf<TUint> iEnumerateCountBuf;
-	RSmsSocketReadStream iReadStream;
-	TMsvId iSmsServiceId;
-	
-	//Copy, Move, Delete messages from SIM
-	CParaFormatLayer* iParaFormat;
-	CCharFormatLayer* iCharFormat;
-	CRichText* iBody;
-	CSmsHeader* iHeader;
-	TMsvId iDestination;
-	CBIODatabase* iBioDb;
-	CMsvEntrySelection* iCompletedSelection;
-	TInt iRecipientCount;
-	TInt iRecipientIndex;
-	
-	//Writing messages to phone stores and writing SMS Parameters
-	RSmsSocketWriteStream iWriteStream;  //< SMS socket write stream
-	TBool iReadingSimParams;
-	TSmsSimUtilsData iSimUtilsData;
-	TMsvId iClass2Folder;
-	CSmsSettings*	iSettings;
-	TBuf8<IoctlWriteSMSBufferSize> iSlotBuffer;
-	CSmsGetDetDescInterface* iGetDetDesc;
-	};
-
-#include "SmssSimUtils.inl"
-
-#endif
--- a/messagingappbase/smsmtm/servermtm/inc/SmssSimUtils.inl	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-// Copyright (c) 2000-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 SMSS_SIM_UTILS_INL_
-#define SMSS_SIM_UTILS_INL_
-
-#include "SMSSPAN.H"
-
-inline const TSmsProgress& CSmsSimUtils::Progress()
-	{
-	return iProgress;
-	}
-
-inline TSmsSimUtilsData::TSmsSimUtilsData()
-: iLastEnumerateFolder(KErrNotFound)
-	{
-	}
-
-inline TBool TSmsSimUtilsData::IsPresentL(const CMsvStore& aStore) const
-	{
-	return aStore.IsPresentL(KSmsSimUtilsDataUid);
-	}
-
-#endif
--- a/messagingappbase/smsmtm/servermtm/inc/smss.hrh	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-// Copyright (c) 2000-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:
-//
-
-
-
-/**
- @file
- @publishedAll
- @released
-*/
-
-#ifndef SMSS_HRH_
-#define SMSS_HRH_
-
-#define SMS_GIVEN_NAME	"%A"
-#define SMS_FAMILY_NAME	"%B"
-#define L_SMS_GIVEN_NAME	_L("%A")
-#define L_SMS_FAMILY_NAME	_L("%B")
-
-#endif
--- a/messagingappbase/smsmtm/servermtm/inc/smssactive.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-// Copyright (c) 1999-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 __SMSSACTIVE_H__
-#define __SMSSACTIVE_H__
-
-#ifdef _DEBUG
-#undef _MSG_NO_LOGGING
-#endif
-
-#include <e32base.h>
-#include <bif.h>
-#include <flogger.h>
-
-#ifdef _MSG_NO_LOGGING
-#define SMSSLOG(a)
-#else
-#define SMSSLOG(a) a
-#endif
-
-class RFs;
-class CSmsMessage;
-class CMsvServerEntry;
-class TMsvEntry;
-class CSmsNumber;
-class CSmsHeader;
-
-class CSmssActive : public CActive
-/**
-@internalComponent
-@released
-*/
-	{
-public:
-	CSmssActive(RFs& aFs, CMsvServerEntry& aServerEntry, TInt aPriority = CActive::EPriorityStandard);
-
-protected:
-	
-	~CSmssActive();
-	void Queue(TRequestStatus& aStatus);
-	void RequestComplete(TRequestStatus* aStatus, TInt aError, TBool aSetActive = EFalse);
-
-	TBool CanSendMessage(const TMsvEntry& aEntry) const;
-	TBool CanSendMessageToRecipient(const TMsvEntry& aEntry, const CSmsNumber& aRcpt) const;
-	TInt Complete(TInt aStatus);
-
-	void ChangeEntryL(const TMsvEntry& aNewEntry); //< Calls iServerEntry.ChangeL
- 	void StoreHeaderL(const CSmsHeader& aNewHeader);
-
-private:
-
-	virtual TInt RunError(TInt aError); //from CActive. Calls Complete(), then completes iReport if not IsActive().
-	virtual void RunL(); //From CActive. Will leave if aStatus != KErrNone
-	virtual void DoCancel(); //From CActive. Calls DoSmssCancel(), then calls Complete(KErrCancel)
-	virtual void DoRunL() = 0; //Called by RunL() if aStatus == KErrNone
-	virtual void DoComplete(TInt& aStatus) = 0;
-	virtual void DoSmssCancel() = 0;
-
-protected:
-
-#ifndef _MSG_NO_LOGGING
-
-	//16-bit	
-	void FLog(const TDesC& aFile, const TDesC& aInputLine, TBool aIgnoreLineBreaks = ETrue);
-	void FLog(const TDesC& aInputLine, TBool aIgnoreLineBreaks = ETrue);
-	void FLogFormat(TRefByValue<const TDesC> aFormat, ...);
-	void FLogFormat(const TDesC& aFile, TRefByValue<const TDesC> aFormat, ...);
-	void FLogFormat(const TDesC& aFile, TRefByValue<const TDesC> aFormat, VA_LIST& aList);
-	
-	//8-bit
-	void FLogFormat(TRefByValue<const TDesC8> aFormat, ...);
-	void FLogFormat(const TDesC& aFile, TRefByValue<const TDesC8> aFormat, ...);
-	void FLogFormat(const TDesC& aFile, TRefByValue<const TDesC8> aFormat, VA_LIST& aList);
-	
-	TInt FLogMessage(const TMsvEntry& aEntry, const CSmsMessage& aSmsMessage, TBioMsgIdType aBearer, const TDesC& aFile);
-	TBool IsLogging(const TDesC& aFile);
-
-private:
-	void DoFLogMessageL(const TMsvEntry& aEntry, const CSmsMessage& aSmsMessage, TBioMsgIdType aBearer, const TDesC& aFile);
-	TInt ConstructFlogger(const TDesC& aFile);
-	void DoConstructFloggerL(const TDesC& aFile);
-	RFileLogger iFlogger;
-	HBufC* iLastLogFile;
-
-#else
-	TInt8 iBCSpacer[sizeof(RFileLogger)+sizeof(HBufC*)];
-#endif
-
-
-protected:
-	RFs& iFs;
-	CMsvServerEntry& iServerEntry;
-
-private:
-	TRequestStatus* iReport;
-	};
-
-#endif	// __SMSSACTIVE_H__
--- a/messagingappbase/smsmtm/servermtm/src/SMSRecipientSend.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,235 +0,0 @@
-// Copyright (c) 1999-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 <e32std.h>
-#include <e32base.h>
-#include <msventry.h>
-#include <smutset.h>
-#include <gsmubuf.h>
-#include <smsulog.h>
-#include <biodb.h>
-#include <smuthdr.h>
-
-#include "SMSRecipientSend.h"
-#include "SMSSSEND.H"
-#include "SMSSPAN.H"
-#include <smsulog.h>
-#include <logwraplimits.h>
-
-CSmsRecipientSend::~CSmsRecipientSend()
-	{
-	delete iLogger;
-
-	if (iSocket.SubSessionHandle())
-		{
-		iSocket.Close();
-		}
-
-	if (iSession.Handle())
-		{
-		iSession.Close();
-		}
-	}
-
-void CSmsRecipientSend::Start(TRequestStatus& aStatus, const TMsvEntry& aEntry, CSmsHeader& aHeader, CSmsNumber& aRecipient)
-	{
-	__ASSERT_DEBUG(iState==ESmsRecipientSendWaiting,Panic(KSmssPanicUnexpectedState));
-
-	Queue(aStatus);
-	iEntry		= aEntry;
-	iHeader		= &aHeader;
-	iRecipient	= &aRecipient;
-
-	TRAPD(err, StartL());
-
-	if (err)
-		Complete(err);
-	}
-
-CSmsRecipientSend::CSmsRecipientSend(TSmsProgress& aProgress, RFs& aFs, CMsvServerEntry& aServerEntry)
-:	CSmssActive(aFs, aServerEntry, KSmsSessionPriority),
-	iProgress(aProgress),
-	iState(ESmsRecipientSendWaiting)
-	{
-	CActiveScheduler::Add(this);
-	}
-
-void CSmsRecipientSend::ConstructL()
-	{
-	iLogger = CSmsEventLogger::NewL(iFs);
-	}
-
-void CSmsRecipientSend::DoRunL()		
-	{
-	switch (iState)
-		{
-		case ESmsRecipientSendGetLogEvent:
-			{
-			if (iLogger->iStatus == KErrNone)
-				{
-				//no log error
-				ChangeLogEvent();
-				}
-			else 
-				{
-				//Log error has occurred
-				if (-(iLogger->iStatus.Int()) == KErrNotFound)
-					{
-					AddLogEvent();
-					}
-				else
-					{
-					SendMessageL();
-					}
-				}
-			break;
-			}
-		case ESmsRecipientSendAddLogEvent:
-			{
-			TLogId logId = KLogNullId;
-
-			if (iLogger->iStatus == KErrNone)
-				{
-				//No log error has occurred
-				logId = iLogger->Event().Id();
-				}
-
-			iHeader->Message().SetLogServerId(logId);
-			iRecipient->SetLogId(logId);
-			//do not break here...
-			}
-		case ESmsRecipientSendChangeLogEvent:
-			{
-			SendMessageL();
-			break;
-			}
-		case ESmsRecipientSendSendingMessage:
-			{
-			iState = ESmsRecipientSendWaiting;
-			break;
-			}
-		case ESmsRecipientSendWaiting:
-		default:
-			Panic(KSmssPanicUnexpectedState);
-		}
-	}
-
-void CSmsRecipientSend::DoComplete(TInt& aStatus)
-	{
-	//Set the state to waiting
-	iState		= ESmsRecipientSendWaiting;
-	iHeader		= NULL;
-	iRecipient	= NULL;
-	iEntry		= TMsvEntry();
-	iProgress.iError = aStatus;
-
-	aStatus = KErrNone;
-
-	SMSSLOG(FLogFormat(_L8("CSmsRecipientSend completed with %d"), iProgress.iError));
-	}
-
-void CSmsRecipientSend::GetDefaultSendBearerL(TInt aBioType, TBioMsgIdType aBearer, TBioMsgId& rBioMsgId) const
-	{
-	CBIODatabase* bdb = CBIODatabase::NewL(iFs);
-	CleanupStack::PushL(bdb);
-
-	TInt index = 0;
-	TUid uid;
-	uid.iUid = aBioType;
-	bdb->GetBioIndexWithMsgIDL(uid, index); //leaves with KErrNotFound if aBioType does not exist in bdb
-
-	const CArrayFix<TBioMsgId>* bioIDs = bdb->BIOEntryLC(index);
-	const TInt count = bioIDs->Count();
-	TBool found = EFalse;
-
-	for (TInt i = 0; !found && i < count; i++) //order important
-		{
-		rBioMsgId = bioIDs->At(i);
-		found = (rBioMsgId.iType == aBearer && AcceptBioMsgId(rBioMsgId));
-		}
-
-	CleanupStack::PopAndDestroy(2); //bdb, bioIDs
-
-	if (!found)
-		User::Leave(KErrNotFound);
-	}
-
-TInt CSmsRecipientSend::AcceptBioType(TInt aBioType, TBioMsgIdType aBearer) const
-	{
-	TBioMsgId bioMsgId;
-	TRAPD(err, GetDefaultSendBearerL(aBioType, aBearer, bioMsgId));
-	return err;
-	}
-
-void CSmsRecipientSend::GetLogEvent()
-	{
-	TLogId id = iRecipient->LogId();
-	iHeader->Message().SetLogServerId(id);
-	iLogger->GetEvent(iStatus, id);
-	SetActive();
-	iState = ESmsRecipientSendGetLogEvent;
-	}
-
-void CSmsRecipientSend::AddLogEvent()
-	{
-	TInt logStatus = R_LOG_DEL_NONE;
-	iHeader->Message().SetLogServerId(KLogNullId);
-	
-	TLogSmsPduData data;
-	// Initialise the data members
-	data.iType		= 0;
-	data.iTotal		= 0;
-	data.iSent		= 0;
-	data.iDelivered	= 0;
-	data.iFailed	= 0;
-	data.iReceived	= 0;
-	
-	iLogger->AddEvent(iStatus, iHeader->Message(), data, &logStatus);
-	SetActive();
-	iState = ESmsRecipientSendAddLogEvent;
-	}
-
-void CSmsRecipientSend::ChangeLogEvent()
-	{
-	TInt logStatus = R_LOG_DEL_NONE;
-	TLogSmsPduData data;
-	data.iType		= 0;
-	data.iTotal		= 0;
-	data.iSent		= 0;
-	data.iDelivered	= 0;
-	data.iFailed	= 0;
-	data.iReceived	= 0;
-	iLogger->ChangeEvent(iStatus, iHeader->Message(), data, &logStatus);
-	SetActive();
-	iState = ESmsRecipientSendChangeLogEvent;
-	}
-
-void CSmsRecipientSend::DoSmssCancel()
-	{
-	switch (iState)
-		{
-		case ESmsRecipientSendGetLogEvent:
-		case ESmsRecipientSendAddLogEvent:
-		case ESmsRecipientSendChangeLogEvent:
-			SMSSLOG(FLogFormat(_L8("CSmsRecipientSend::DoSmssCancel() cancelling logging for msg %d"), iEntry.Id()));
-			iLogger->Cancel();
-			break;
-		case ESmsRecipientSendSendingMessage:
-			DoCancelSendingMessage();
-			break;
-		default:
-			break;
-		}
-	}
--- a/messagingappbase/smsmtm/servermtm/src/SMSSERV.CPP	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,432 +0,0 @@
-// Copyright (c) 1999-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:
-// SmssServ.cpp
-// 
-//
-
-#include "SMSSERV.H"
-#include "SMSSPAN.H"
-#include "SMSSOUTB.H"
-
-#include <msventry.h>
-#include <SMSS.rsg>
-#include <smscmds.h>
-#include <smut.h>
-#include <c32comm.h>
-#include "SMSSchSend.h"
-#include "SmssSimUtils.h"
-#include <centralrepository.h>
-#include <tmsvsystemprogress.h>
-
-EXPORT_C CSmsServerMtm* CSmsServerMtm::NewL(CRegisteredMtmDll& aRegisteredMtmDll, CMsvServerEntry* aServerEntry)
-	{
-	CSmsServerMtm* smsservermtm=new(ELeave) CSmsServerMtm(aRegisteredMtmDll, aServerEntry);
-	CleanupStack::PushL(smsservermtm);
-	smsservermtm->ConstructL();
-	CleanupStack::Pop();
-	return smsservermtm;
-	}
-
-CSmsServerMtm::~CSmsServerMtm()
-	{
-	Cancel();
-	delete iScheduleSend;
-	delete iOutboxSend;
-	delete iSimUtils;
-	}
-
-void CSmsServerMtm::CopyToLocalL(const CMsvEntrySelection& /*aSelection*/,TMsvId /*aDestination*/, TRequestStatus& aStatus)
-	{
-	TRequestStatus* status=&aStatus;
-	User::RequestComplete(status,KErrNotSupported);
-	}
-
-void CSmsServerMtm::CopyFromLocalL(const CMsvEntrySelection& aSelection,TMsvId /*aDestination*/, TRequestStatus& aStatus)
-	{
-	__ASSERT_ALWAYS(iServerEntry!=NULL,Panic(ESmssEntryNotSet));
-	__ASSERT_ALWAYS(!iOutboxSend, Panic(KSmssPanicMtmAlreadyActive));
-	
-	Queue(aStatus);
-	RestoreSettingsL();
-	iOutboxSend=CSmsOutboxSend::NewL(*iServerEntry, *iScheduleSend, iFs);
-	iState=ESmsServerMtmSending;
-#if (defined SYMBIAN_USER_PROMPT_SERVICE)	
-	iOutboxSend->StartL(iStatus,aSelection, EFalse, KNullDesC8, iClientThreadId, iHasCapability);
-#else
-	iOutboxSend->Start(iStatus,aSelection, EFalse, KNullDesC8);
-#endif	
-	SetActive();
-	}
-
-void CSmsServerMtm::CopyWithinServiceL(const CMsvEntrySelection& /*aSelection*/,TMsvId /*aDestination*/, TRequestStatus& aStatus)
-	{
-	TRequestStatus* status=&aStatus;
-	User::RequestComplete(status,KErrNotSupported);
-	}
-
-void CSmsServerMtm::MoveToLocalL(const CMsvEntrySelection& /*aSelection*/,TMsvId /*aDestination*/, TRequestStatus& aStatus)
-	{
-	TRequestStatus* status=&aStatus;
-	User::RequestComplete(status,KErrNotSupported);
-	}
-
-void CSmsServerMtm::MoveFromLocalL(const CMsvEntrySelection& /*aSelection*/,TMsvId /*aDestination*/, TRequestStatus& aStatus)
-	{
-	TRequestStatus* status=&aStatus;
-	User::RequestComplete(status,KErrNotSupported);
-	}
-
-void CSmsServerMtm::MoveWithinServiceL(const CMsvEntrySelection& /*aSelection*/,TMsvId /*aDestination*/, TRequestStatus& aStatus)
-	{
-	TRequestStatus* status=&aStatus;
-	User::RequestComplete(status,KErrNotSupported);
-	}
-
-void CSmsServerMtm::DeleteAllL(const CMsvEntrySelection& aSelection, TRequestStatus& aStatus)
-	{
-	iProgress = TSmsProgress();
-	iProgress.iType = TSmsProgress::ESmsProgressTypeDeleteAll;
-	iProgress.iMsgCount = aSelection.Count();
-	User::LeaveIfError(iServerEntry->SetEntry(aSelection[0]));
-	User::LeaveIfError(iServerEntry->SetEntry(iServerEntry->Entry().Parent()));
-	CMsvEntrySelection* sel = aSelection.CopyL();
-	iProgress.iError = iServerEntry->DeleteEntries(*sel);
-	delete sel;
-
-	TRequestStatus* status = &aStatus;
-	User::RequestComplete(status, KErrNone);
-	}
-
-void CSmsServerMtm::CreateL(TMsvEntry /*aNewEntry*/, TRequestStatus& aStatus)
-	{
-	TRequestStatus* status=&aStatus;
-	User::RequestComplete(status,KErrNotSupported);
-	}
-
-void CSmsServerMtm::ChangeL(TMsvEntry /*aNewEntry*/, TRequestStatus& aStatus)
-	{
-	TRequestStatus* status=&aStatus;
-	User::RequestComplete(status,KErrNotSupported);
-	}
-
-void CSmsServerMtm::StartCommandL(CMsvEntrySelection& aSelection, TInt aCommand, const TDesC8& aParameter, TRequestStatus& aStatus)
-	{
-	__ASSERT_ALWAYS(iServerEntry!=NULL,Panic(ESmssEntryNotSet));
-	__ASSERT_ALWAYS(iState==ESmsServerMtmWaiting,Panic(KSmssPanicMtmAlreadyActive));
-
-	RestoreSettingsL();	
-	iProgress = TSmsProgress();
-	TInt err = KErrNone;
-
-	switch (aCommand)
-		{
-		case ESmsMtmCommandScheduleCopy:
-		case ESmsMtmCommandScheduleMove:
-		case ESmsMtmCommandDeleteSchedule:
-		case ESmsMtmCommandCheckSchedule:
-		case ESmsMtmCommandSendScheduledCopy:
-		case ESmsMtmCommandSendScheduledMove:
-			{
-			TRAP(err, ScheduleCommandL(aSelection, aCommand, aParameter, aStatus));
-			break;
-			}
-		case ESmsMtmCommandEnumeratePhoneStores:
-		case ESmsMtmCommandDeleteFromPhoneStore:
-		case ESmsMtmCommandCopyFromPhoneStore:
-		case ESmsMtmCommandMoveFromPhoneStore:
-		case ESmsMtmCommandReadSimParams:
-		case ESmsMtmCommandWriteSimParams:
-		case ESmsMtmCommandCopyToPhoneStore:
-		case ESmsMtmCommandMoveToPhoneStore:
-			{
-			TRAP(err, SimUtilsL(aSelection, aCommand, aParameter, aStatus));
-			break;
-			}
-		default:
-			{
-			Panic(KSmssPanicUnexpectedCommand);
-			}
-		}
-
-	if (err != KErrNone)
-		{
-		iServerEntry->SetEntry(KMsvNullIndexEntryId);
-		User::Leave(err);
-		}
-	}
-
-TBool CSmsServerMtm::CommandExpected()
-	{
-	return EFalse;
-	}
-
-const TDesC8& CSmsServerMtm::Progress()
-	{
-	switch (iState)
-		{
-		case ESmsServerMtmSending:
-			{
-			iProgress = iOutboxSend->Progress();
-			break;
-			}
-		case ESmsServerMtmSimUtils:
-			{
-			iProgress = iSimUtils->Progress();
-			break;
-			}
-		default:
-			{
-			//Do not change iProgress
-			}
-		}
-
-	iProgressBuf = TSmsProgressBuf(iProgress);
-	return iProgressBuf;
-	}
-
-void CSmsServerMtm::DoCancel()
-	{
-	switch (iState)
-		{
-		case ESmsServerMtmSending:
-			{
-			iOutboxSend->Cancel();
-			break;
-			}
-		case ESmsServerMtmSimUtils:
-			{
-			iSimUtils->Cancel();
-			break;
-			}
-		case ESmsServerMtmScheduling:
-			{
-			break;
-			}
-		default:
-			{
-			Panic(KSmssPanicUnexpectedCommand);
-			}
-		}
-	CompleteCommand(KErrCancel);
-	}
-
-void CSmsServerMtm::DoRunL()
-	{
-	DoComplete(KErrNone);
-	}
-
-void CSmsServerMtm::CompleteCommand(TInt aError)
-	{
-	if (iReport)
-		{
-		switch (iState)
-			{
-			case ESmsServerMtmSending:
-				{
-				Progress();
-				delete iOutboxSend;
-				iOutboxSend=NULL;
-				break;
-				}
-			case ESmsServerMtmScheduling:
-				{
-				break;
-				}
-			case ESmsServerMtmSimUtils:
-				{
-				Progress();
-				delete iSimUtils;
-				iSimUtils = NULL;
-				break;
-				}
-			default:
-				{
-				Panic(KSmssPanicUnexpectedState);
-				}
-			}
-		if (aError != KErrNone)         //  iProgress.iError may be recording a send error 
-			{
-			iProgress.iError = aError;  //  so it shouldn't be over-written with KErrNone
-			}
-
-		User::RequestComplete(iReport, KErrNone);
-		}
-
-	iState = ESmsServerMtmWaiting;
-	iReport = NULL;
-
-	if (iServerEntry)
-		iServerEntry->SetEntry(KMsvNullIndexEntryId); //ignore error
-	}
-
-void CSmsServerMtm::DoComplete(TInt aError)
-	{
-	CompleteCommand(aError);
-	}
-
-CSmsServerMtm::CSmsServerMtm(CRegisteredMtmDll& aRegisteredMtmDll, CMsvServerEntry* aServerEntry):
-	CScheduleBaseServerMtm(aRegisteredMtmDll, aServerEntry)
-	{
-	CActiveScheduler::Add(this);
-	}
-		
-void CSmsServerMtm::ConstructL()
-	{
-	CScheduleBaseServerMtm::ConstructL();
-
-#if defined (__WINS__)
-	TInt ret=StartC32();
-	if (ret!=KErrAlreadyExists)
-		User::LeaveIfError(ret);
-#endif
-
-	iScheduleSend = CSmsScheduleSend::NewL(*iServerEntry);
-    TSmsUtilities::ServiceIdL(*iServerEntry, iSmsServiceId);
-	RestoreSettingsL();
-	}
-
-void CSmsServerMtm::RestoreSettingsL()
-	{
-	__ASSERT_ALWAYS(iServerEntry!=NULL,Panic(ESmssEntryNotSet));
-
-	User::LeaveIfError(iServerEntry->SetEntry(iSmsServiceId));
-	RestoreScheduleSettingsL();
-	User::LeaveIfError(iServerEntry->SetEntry(KMsvNullIndexEntryId));
-	}
-
-void CSmsServerMtm::LoadResourceFileL()
-	{
-	CScheduleBaseServerMtm::LoadResourceFileL(KSmsResourceFile);
-	}
-
-void CSmsServerMtm::RestoreScheduleSettingsL()
-	{
-	CRepository* repository = CRepository::NewLC(KUidMsgTypeSMS);
-	// just v2
-	CScheduleBaseServerMtm::LoadScheduleSettingsL(*repository, ETrue, ERROR_ACTIONS);
-	CleanupStack::PopAndDestroy(repository);    
-	}
-
-void CSmsServerMtm::PopulateSchedulePackage(const TDesC8& aParameter, const TBool aMove, TMsvSchedulePackage& aPackage) const
-	{
-	aPackage.iPollProgress = 3000000;
-	aPackage.iParameter = aParameter;
-	aPackage.iCommandId = aMove ? ESmsMtmCommandSendScheduledMove : ESmsMtmCommandSendScheduledCopy;
-	}
-
-void CSmsServerMtm::ScheduleCommandL(CMsvEntrySelection& aSelection, TInt aCommand, const TDesC8& aParameter, TRequestStatus& aStatus)
-	{
-	iState = ESmsServerMtmScheduling;
-	iProgress.iType = TSmsProgress::ESmsProgressTypeScheduling;
-
-	switch (aCommand)
-		{
-		case ESmsMtmCommandScheduleCopy:
-			ScheduleL(aSelection, EFalse, aParameter, aStatus);
-			break;
-		case ESmsMtmCommandScheduleMove:
-			{
-			TRequestStatus* status = &aStatus;
-			User::RequestComplete(status, KErrNotSupported);
-			break;
-			}
-		case ESmsMtmCommandDeleteSchedule:
-			iProgress.iType  = TSmsProgress::ESmsProgressTypeDeleteSchedule;
-			DeleteScheduleL(aSelection, aParameter, aStatus);
-			break;
-		case ESmsMtmCommandCheckSchedule:
-			iProgress.iType = TSmsProgress::ESmsProgressTypeCheckSchedule;
-			CheckScheduleL(aSelection, aParameter, aStatus);
-			break;
-		case ESmsMtmCommandSendScheduledCopy:
-			SendScheduledL(aSelection, EFalse, aParameter, aStatus);
-			break;
-		case ESmsMtmCommandSendScheduledMove:
-			SendScheduledL(aSelection, ETrue, aParameter, aStatus);
-			break;
-		default:
-			Panic(KSmssPanicUnexpectedCommand);
-		}
-	}
-
-void CSmsServerMtm::SimUtilsL(const CMsvEntrySelection& aSelection, TInt aCommand, const TDesC8& aParameter, TRequestStatus& aStatus)
-	{
-	__ASSERT_DEBUG(iSimUtils == NULL, Panic(KSmssPanicAlreadyUsingSimUtils));
-	
-	Queue(aStatus);
-
-	iSimUtils = CSmsSimUtils::NewL(*iServerEntry, iFs, iSmsServiceId);
-
-	iState = ESmsServerMtmSimUtils;
-
-	switch (aCommand)
-		{
-		case ESmsMtmCommandEnumeratePhoneStores:
-			iSimUtils->EnumerateL(aParameter, iStatus);
-			break;
-		case ESmsMtmCommandDeleteFromPhoneStore:
-			iSimUtils->DeleteFromPhoneStoreL(aSelection, iStatus);
-			break;
-		case ESmsMtmCommandCopyFromPhoneStore:
-			iSimUtils->CopyFromPhoneStoreL(aSelection, aParameter, iStatus);
-			break;
-		case ESmsMtmCommandMoveFromPhoneStore:
-			iSimUtils->MoveFromPhoneStoreL(aSelection, aParameter, iStatus);
-			break;
-		case ESmsMtmCommandReadSimParams:
-			iSimUtils->ReadSimParamsL(iStatus);
-			break;
-		case ESmsMtmCommandWriteSimParams:
-			iSimUtils->WriteSimParamsL(iStatus);
-			break;
-		case ESmsMtmCommandCopyToPhoneStore:
-			iSimUtils->CopyToPhoneStoreL(aSelection, aParameter, iStatus);
-			break;
-		case ESmsMtmCommandMoveToPhoneStore:
-			iSimUtils->MoveToPhoneStoreL(aSelection, aParameter, iStatus);
-			break;
-		default:
-			Panic(KSmssPanicUnexpectedCommand);
-		}
-
-	SetActive();
-	}
-
-/**
-The extension method provides a polymorphic behaviour to call the correct
-MTM.
-@param aExtensionId The Uid passed in as KUIDMsgClientThreadInfo to copy the
-					Client Thread Info.
-@return KErrNone.
-*/	
-TInt CSmsServerMtm::Extension_(TUint aExtensionId, TAny*& a0, TAny* a1)
-	{
-	switch(aExtensionId)
-		{
-#if (defined SYMBIAN_USER_PROMPT_SERVICE)		
-		case KUIDMsgClientThreadInfo:
-			{
-			iClientThreadId = *(TThreadId*) (a1);
-	    	iHasCapability = (TBool)*(TInt*)(a0);
-	    	return KErrNone;
-			}
-#endif			
-		case KUIDMsgMsvSystemProgress:
-		default:
-			{
-			// Chain to base class
-			return CBaseServerMtm::Extension_(aExtensionId, a0, a1);
-			}
-		}
-	}
--- a/messagingappbase/smsmtm/servermtm/src/SMSSMAIN.CPP	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-// Copyright (c) 1999-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 "SMSSPAN.H"
-
-_LIT(KSmssPanic, "SMSS");
-
-GLDEF_C void Panic(TSmssPanic aPanic)
-	{
-	User::Panic(KSmssPanic,aPanic);
-	}
-
-
--- a/messagingappbase/smsmtm/servermtm/src/SMSSOUTB.CPP	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,783 +0,0 @@
-// Copyright (c) 1999-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 "SMSSOUTB.H"
-#include <s32mem.h>
-#include <smuthdr.h>		
-#include <smscmds.h>
-#include <msvschedulesend.h>
-#include <msvsysagentaction.h>
-#include <txtrich.h>
-#include <logsmspdudata.h>
-#include <smsulog.h>
-#include <logwraplimits.h>
-
-#include "SMSSendSession.h"
-#include "SMSSPAN.H"
-
-CSmsOutboxSend* CSmsOutboxSend::NewL(CMsvServerEntry& aServerEntry, CMsvScheduleSend& aScheduleSend, RFs& aFs)
-	{
-	CSmsOutboxSend* outboxsend=new(ELeave) CSmsOutboxSend(aServerEntry, aScheduleSend, aFs);
-	CleanupStack::PushL(outboxsend);
-	outboxsend->ConstructL();
-	CleanupStack::Pop();
-	return outboxsend;
-	} 
-
-CSmsOutboxSend::~CSmsOutboxSend()
-	{
-	Cancel();
-	delete iSendSession;
-	delete iMsvEntrySelection;
-	delete iLogger;
-	delete iSmsHeader;
-
-	delete iRichText;
-	delete iParaLayer;
-	delete iCharLayer;
-	
-#if (defined SYMBIAN_USER_PROMPT_SERVICE)	
-	iUpsSubsession.Close();
-	iUpsSession.Close();
-#endif	
-	}
-
-
-#if (defined SYMBIAN_USER_PROMPT_SERVICE)	
-void CSmsOutboxSend::StartL(TRequestStatus& aStatus,const CMsvEntrySelection& aSelection, const TBool aMove, const TDesC8& aParameter, TThreadId aClientThreadId, TBool aHasCapability)	// kicks off the send session
-	{
-	// Connect to UPS service.....
-	User::LeaveIfError(iUpsSession.Connect());
-	
-	RThread clientThread;
- 	User::LeaveIfError(clientThread.Open(aClientThreadId));
-	CleanupClosePushL(clientThread);
- 	User::LeaveIfError(iUpsSubsession.Initialise(iUpsSession, clientThread));
-	CleanupStack::PopAndDestroy(&clientThread);
-
-	iHasCapability = aHasCapability;
-	Start(aStatus, aSelection, aMove, aParameter);
-	}
-#endif
-
-void CSmsOutboxSend::Start(TRequestStatus& aStatus,const CMsvEntrySelection& aSelection, const TBool aMove, const TDesC8& aParameter)	// kicks off the send session
-	{
-	__ASSERT_DEBUG(iProgress.iState==ESmsOutboxSendStateWaiting,Panic(KSmssPanicAlreadySending));
-	Queue(aStatus);
-
-	iPackage.iParameter = aParameter;
-	iMove = aMove;
-	iStartTime.UniversalTime(); //used by FailOutstandingMessages
-	TRAPD(err, FindOtherMessagesL(aSelection));
-	RequestComplete(&iStatus, err, ETrue);
-	}
-
-void CSmsOutboxSend::DoSmssCancel()
-	{
-	switch (iProgress.iState)
-		{
-		case ESmsOutboxSendStateWaiting:
-		case ESmsOutboxSendStateFindingOtherMessages:
-		case ESmsOutboxSendStateReScheduling:
-		case ESmsOutboxSendStateLogEntryComplete:
-		case ESmsOutboxSendStateMovingEntry:
-		case ESmsOutboxSendStateComplete:
-			{
-			break;
-			}
-#if (defined SYMBIAN_USER_PROMPT_SERVICE)			
-		case ESmsOutboxSendAuthoriseState:
-			{
-			iUpsSubsession.CancelPrompt();
-			break;
-			}
-#endif	
-		case ESmsOutboxSendStateAddLogEvent:
-		case ESmsOutboxSendStateGetLogEvent:
-		case ESmsOutboxSendStateChangeLogEvent:
-			{
-			SMSSLOG(FLogFormat(_L8("CSmsOutboxSend::DoSmssCancel() cancelling logging for msg %d"), iCurrentMessage));
-			iLogger->Cancel();
-			break;
-			}
-		case ESmsOutboxSendStateSending:
-			{
-			SMSSLOG(FLogFormat(_L8("CSmsOutboxSend::DoSmssCancel() cancelling sending for msg %d"), iCurrentMessage));
-			iSendSession->Cancel();
-			break;
-			}
-		default:
-			{
-			Panic(KSmssPanicUnexpectedState);
-			}
-		}
-
-	SMSSLOG(FLogFormat(_L8("CSmsOutboxSend::DoSmssCancel() setting sending state to SUSPENDED for unsent msgs")));
-
-	FailOutstandingMessages(KErrCancel, KMsvSendStateSuspended);
-	}
-
-void CSmsOutboxSend::FailOutstandingMessages(TInt aError, TInt aSendingState)
-	{
-	TInt count = iMsvEntrySelection->Count();
-	while (count--)
-		{
-		const TInt err = iServerEntry.SetEntry(iMsvEntrySelection->At(count));
-
-		if (err == KErrNone)
-			{
-			TMsvEntry entry(iServerEntry.Entry());
-			TBool failMsg = EFalse;
-
-			switch (entry.SendingState())
-				{
-				case KMsvSendStateSending:
-				case KMsvSendStateWaiting:
-
-					failMsg = ETrue;
-					break;
-
-				case KMsvSendStateScheduled:
-				case KMsvSendStateResend:
-
-					failMsg = (entry.iDate < iStartTime);
-					break;
-
-				default:
-
-					//failMsg = EFalse;
-					break;
-				}
-
-			if (failMsg)
-				{
-				entry.SetSendingState(aSendingState);
-				entry.iError = aError;
-				entry.SetFailed(ETrue);
-				entry.SetConnected(EFalse);
-				entry.SetScheduled(EFalse);
-				iServerEntry.ChangeEntry(entry); //ignore error
-				}
-			} //end if
-		} //end while
-	}
-
-void CSmsOutboxSend::DoRunL()		// required by PV declaration in CActive
-	{
-	switch (iProgress.iState)
-		{
-		case ESmsOutboxSendStateFindingOtherMessages:
-		case ESmsOutboxSendStateMovingEntry:
-			{
-			SendNextHeaderL();
-			break;
-			}
-#if (defined SYMBIAN_USER_PROMPT_SERVICE)			
-		case ESmsOutboxSendAuthoriseState:
-			{
-			if(iDecision == EUpsDecYes || iDecision == EUpsDecSessionYes)
-				{
-				SendHeader();	
-				}
-			else
-				{
-				// The decision from UPS server was NO, so do not send the message.
-				iProgress.iState = ESmsOutboxSendStateReScheduling;
-				iEntry = iServerEntry.Entry();
-				iEntry.SetFailed(ETrue);
-				iEntry.SetSendingState(KMsvSendStateFailed);
-				TRequestStatus* status=&iStatus;
-				iStatus=KRequestPending;
-				User::RequestComplete(status,KErrNone);
-				SetActive();
-				}
-			break;
-			}
-#endif
-		case ESmsOutboxSendStateSending:
-			{
-			if (iCurrentMessage)
-				{
-				ReScheduleFailedMessageL();
-				}
-			else
-				{
-				__ASSERT_DEBUG(iProgress.iError == KErrNotFound, Panic(KSmssPanicUnexpectedErrorCode));
-				}
-			break;
-			}
-		case ESmsOutboxSendStateReScheduling:
-			{
-			iProgress.iRcpDone = -1;
-			iProgress.iRcpCount = iSmsHeader->Recipients().Count();
-			LogEntry();
-			break;
-			}
-		case ESmsOutboxSendStateGetLogEvent:
-			{
-			if (iLogger->iStatus == KErrNone)
-				{
-				ChangeLogEvent();
-				}
-			else
-				{
-				//Log error has occurred
-				if (-(iLogger->iStatus.Int()) == KErrNotFound)
-					{
-					AddLogEvent();
-					}
-				else
-					{
-					LogEntry();
-					}
-				}
-			break;
-			}
-		case ESmsOutboxSendStateAddLogEvent:
-			{
-			TLogId logId = KLogNullId;
-
-			if (iLogger->iStatus.Int() == KErrNone)
-				{
-				//No log error has occurred
-				logId = iLogger->Event().Id();
-				}
-
-			iSmsHeader->Recipients()[iProgress.iRcpDone]->SetLogId(logId);
-			iSmsHeader->Message().SetLogServerId(logId);
-			//do not break here...
-			}
-		case ESmsOutboxSendStateChangeLogEvent:
-			{
-			LogEntry();
-			break;
-			}
-		case ESmsOutboxSendStateLogEntryComplete:
-			{
-			MoveEntryL();
-			break;
-			}
-		case ESmsOutboxSendStateComplete:
-			{
-			break;
-			}
-		case ESmsOutboxSendStateWaiting:
-		default:
-			Panic(KSmssPanicUnexpectedState);
-		}
-	}
-
-void CSmsOutboxSend::FindOtherMessagesL(const CMsvEntrySelection& aSelection)
-// Finds any other messages in the outbox that are waiting to send
-	{
-	iProgress.iState = ESmsOutboxSendStateFindingOtherMessages;
-
-	delete iMsvEntrySelection;
-	iMsvEntrySelection = NULL;
-	iMsvEntrySelection = aSelection.CopyL();
-	SMSSLOG(FLogFormat(_L8("Asked to send %d message(s)"), iMsvEntrySelection->Count()));
-
-	CMsvEntrySelection* sel = new (ELeave) CMsvEntrySelection();
-	CleanupStack::PushL(sel);
-
-	User::LeaveIfError(iServerEntry.SetEntry(KMsvGlobalOutBoxIndexEntryId));
-
-	//Find the children of the outbox for the SMS Mtm
-	User::LeaveIfError(iServerEntry.GetChildrenWithMtm(KUidMsgTypeSMS, *sel));
-
-	TInt count = sel->Count();
-
-	while (count--)
-		{
-		TMsvId id = sel->At(count);
-		User::LeaveIfError(iServerEntry.SetEntry(id));
-
-		TInt sendState = iServerEntry.Entry().SendingState();
-
-		if (sendState == KMsvSendStateWaiting || sendState == KMsvSendStateUnknown)
-			{
-			// check that the entry is not already in iMsvEntrySelection
-			TBool foundMessage = EFalse;
-			TInt numberMessages = iMsvEntrySelection->Count();
-			for(TInt a = 0; a < numberMessages; a++)
-				{
-				if(iMsvEntrySelection->At(a) == id)
-					{
-					foundMessage = ETrue;
-					break;
-					}
-				}
-
-			// only add the id of the message if it has not been found in iMsvEntrySelection
-			if(!foundMessage)
-				iMsvEntrySelection->AppendL(id);
-			}
-		}
-
-	CleanupStack::PopAndDestroy(); //sel
-
-	//Instantiate iSendSession with the updated iMsvEntrySelection
-	iSendSession = CSmsSendSession::NewL(iProgress, iServerEntry, iFs, *iSmsHeader, *iRichText, iEntry);
-	iSendSession->DivideMessagesL(*iMsvEntrySelection); //Leaves with KErrNotFound if iMsvEntrySelecion.Count() == 0 (on the way in)
-	//Leaves with KErrUnknownBioType if iMsvEntrySelection.Count() == 0 (on the way out)
-	//Leaves with another error if iServerEntry.SetEntry() failed and iMsvEntrySelection.Count() == 0 (on the way out)
-
-	iProgress.iError = KErrNone;
-	iProgress.iMsgCount = iMsvEntrySelection->Count();
-	iProgress.iMsgDone= -1;
-
-	__ASSERT_DEBUG(iProgress.iMsgCount, Panic(KSmssPanicNoMessagesInSelection));
-	SMSSLOG(FLogFormat(_L8("\tActually sending %d message(s)"), iProgress.iMsgCount));
-
-	TMsvSendErrorAction action;
-	iCondMet = ConditionsRightForSending(action); //Checks the system agent
-	if (!iCondMet)
-		{
-		SMSSLOG(FLogFormat(_L8("Conditions NOT right for sending. Scheduling all messages")));
-        iProgress.iState = ESmsOutboxSendStateComplete;
-		}
-
-	count = iMsvEntrySelection->Count();
-
-	while (count--)
-		{
-		//Should not leave at this point, as it would have left at DivideMessagesL().
-		User::LeaveIfError(iServerEntry.SetEntry(iMsvEntrySelection->At(count)));
-
-		iEntry = iServerEntry.Entry();
-
-		if (!iCondMet)
-			{
-			iEntry = iServerEntry.Entry();
-			iEntry.SetFailed(ETrue);
-			iEntry.iError = action.iError;
-			DoReScheduleL(&action);
-			}
-		else if (iEntry.SendingState() != KMsvSendStateWaiting && CanSendMessage(iEntry))
-			{
-			iEntry.SetSendingState(KMsvSendStateWaiting);
-			iServerEntry.ChangeEntry(iEntry);
-			}
-		}
-	}
-
-void CSmsOutboxSend::DoReScheduleL(const TMsvSendErrorAction* aErrorAction)
-	{
-	__ASSERT_DEBUG(iServerEntry.Entry().Id() == iEntry.Id(), Panic(ESmssEntryNotSet));
-
-	//Log the failed message
-	SMSSLOG(FLogFormat(_L8("Sending FAILED for msg %d with error %d. Attempting re-schedule"), iEntry.Id(), iEntry.iError));
-
-	CMsvEntrySelection* reSch = new (ELeave) CMsvEntrySelection();
-	CleanupStack::PushL(reSch);
-
-	reSch->AppendL(iEntry.Id());
-
-	TMsvSchedulePackage schPkg;
-	schPkg.iCommandId = iMove ? ESmsMtmCommandSendScheduledMove : ESmsMtmCommandSendScheduledCopy;
-
-	//Re-Schedule the failed message
-	iScheduleSend.ReScheduleL(*reSch, schPkg, aErrorAction);
-	
-	CleanupStack::PopAndDestroy(); //reSch
-
-	//Restore iEntry, because it may have changed while re-scheuling
-	User::LeaveIfError(iServerEntry.SetEntry(iEntry.Id()));
-	iEntry = iServerEntry.Entry();
-
-	//Restore the iSmsHeader, because it may have changed while re-scheduling
-	CMsvStore* store = iServerEntry.ReadStoreL();
-	CleanupStack::PushL(store);
-	iSmsHeader->RestoreL(*store);
-	CleanupStack::PopAndDestroy(); //store
-	}
-
-void CSmsOutboxSend::ReScheduleFailedMessageL()
-	{
-	__ASSERT_DEBUG(iCurrentMessage == iEntry.Id(), Panic(ESmssEntryNotSet));
-
-	iProgress.iState = ESmsOutboxSendStateReScheduling;
-	TInt err = KErrNone;
-
-	//Check to make sure the message still exits
-	if (iServerEntry.Entry().Id() != iEntry.Id())
-		{
-		err = iServerEntry.SetEntry(iEntry.Id());
-		if (err == KErrNone)
-			iEntry = iServerEntry.Entry();
-		else if (err != KErrNotFound)
-			User::Leave(err);
-		}
-
-	if (err == KErrNone)
-		{
-		if (!iEntry.Failed() && iProgress.iError)
-			{
-			iEntry.SetFailed(ETrue);
-			iEntry.iError = iProgress.iError;
-			}
-
-		if (iEntry.Failed() && iEntry.SendingState() != KMsvSendStateSuspended)
-			{
-			DoReScheduleL();
-			}
-		else
-			{
-			iScheduleSend.SendingCompleteL(iEntry, EFalse);
-			}
-		RequestComplete(&iStatus, KErrNone, ETrue);
-		}
-	else // err == KErrNotFound (the user has deleted the message)
-		{
-		SendNextHeaderL(); //send the next message
-		}
-	}
-
-CSmsOutboxSend::CSmsOutboxSend(CMsvServerEntry& aServerEntry, CMsvScheduleSend& aScheduleSend, RFs& aFs)
-	:CSmssActive(aFs, aServerEntry, KSmsSessionPriority),
-	iProgress(TSmsProgress::ESmsProgressTypeSending),
-	iScheduleSend(aScheduleSend)
-	{
-	CActiveScheduler::Add(this);
-	}
-
-void CSmsOutboxSend::ConstructL()
-	{
-	iLogger = CSmsEventLogger::NewL(iFs);
-
-	// stuff for the body text....
-	iParaLayer = CParaFormatLayer::NewL();
-	iCharLayer = CCharFormatLayer::NewL();
-	iRichText = CRichText::NewL( iParaLayer, iCharLayer, CEditableText::EFlatStorage, 256);
-	iSmsHeader = CSmsHeader::NewL(CSmsPDU::ESmsSubmit,*iRichText);
-
-	TInt ret = iServerEntry.SetEntry(KMsvSentEntryId);
-
-	if (ret != KErrNotFound)
-		{
-		User::LeaveIfError(ret);
-		iSentFolderExists = ETrue;
-		}
-	else
-		{
-		iSentFolderExists = EFalse;
-		}
-	}
-
-void CSmsOutboxSend::SendNextHeaderL()
-	{
-	iProgress.iMsgDone++;
-	iCurrentMessage = iSendSession->IncSms();
-
-	if(iProgress.iMsgDone >= iProgress.iMsgCount || !iCurrentMessage)
-		{
-		iProgress.iState = ESmsOutboxSendStateComplete;
-		RequestComplete(&iStatus, KErrNone, ETrue);
-		}
-	else
-		{
-		iErr = iServerEntry.SetEntry(iCurrentMessage);
-
-#if (defined SYMBIAN_USER_PROMPT_SERVICE)
-		iDecision = EUpsDecNo;		
-		iProgress.iState = ESmsOutboxSendAuthoriseState;
-		
-		//Restore the CSmsHeader
-		CMsvStore* store = iServerEntry.ReadStoreL();
-		CleanupStack::PushL(store);
-		iSmsHeader->RestoreL(*store);
-		CleanupStack::PopAndDestroy(); //store
-		
-		// Need to create a single TDesC using the the Recipient list
-		CArrayPtrFlat<CSmsNumber>& numbers = iSmsHeader->Recipients();
-		TInt size = 0;
-		TInt num = numbers.Count();
-		CSmsNumber* rcpt = NULL;
-		for(TInt i=0;i<num; ++i)
-			{
-			rcpt = numbers[i];
-			size += rcpt->Address().Size();
-			}
-		
-		_LIT16(KComma, ",");
-		
-		RBuf16 buffer;
-		buffer.Create(size+num);
-		if(num > 0)
-			{
-			rcpt = numbers[0];
-			buffer.Append(rcpt->Address());	
-			}
-		
-		for(TInt i=1;i<num; ++i)
-			{
-			buffer.Append(KComma);
-			rcpt = numbers[i];
-			buffer.Append(rcpt->Address());
-			}
-	
-		//Query the UPS server if the client thread is authorised to send messages.
-		iUpsSubsession.Authorise( iHasCapability, KUidSMSService, buffer, iDecision, iStatus);
-		SetActive();
-		buffer.Close();
-#else
-		SendHeader();
-#endif		
-		}
-	}
-
-TBool CSmsOutboxSend::ConditionsRightForSending(TMsvSendErrorAction& rErrorAction)
-	{
-	TBool retVal = ETrue;
-	
-	TRAPD(err, retVal = iScheduleSend.AgentActions().ConditionsMetL(rErrorAction));
-	//ignore the error
-
-	if (err)
-		{
-		retVal = ETrue;
-		}
-
-	return retVal;
-	}
-
-void CSmsOutboxSend::DoComplete(TInt& aError)
-	{
-	iProgress.iState = ESmsOutboxSendStateWaiting;
-
-	if (iProgress.iError == KErrNone)
-		iProgress.iError = aError;
-
-	if (iProgress.iError != KErrNone || !iCondMet)
-		FailOutstandingMessages(iProgress.iError, KMsvSendStateFailed);
-
-	SMSSLOG(FLogFormat(_L8("CSmsOutboxSend completed with %d"), iProgress.iError));
-	}
-
-void CSmsOutboxSend::MoveEntryL()
-	{
-	__ASSERT_DEBUG(iServerEntry.Entry().Id() == iEntry.Id(), Panic(ESmssEntryNotSet));
-	__ASSERT_DEBUG(iCurrentMessage == iEntry.Id(), Panic(ESmssEntryNotSet));
-
-	iProgress.iState = ESmsOutboxSendStateMovingEntry;
-	SMSSLOG(FLogFormat(_L8("MoveEntryL Msg=%d Sent=%d SentFldr=%d Move=%d"), iEntry.Id(), MessageSent(), iSentFolderExists, iMove));
-
-	if (MessageSent())
-		{
-		if (iMove)
-			{
-			User::LeaveIfError(iServerEntry.SetEntry(iEntry.Parent()));	// change context to parent of iMsvEntry
-			User::LeaveIfError(iServerEntry.DeleteEntry(iEntry.Id()));
-			}
-		else 
-			{
-			//The following members should be set already, but set them again just in case ;)
-			iEntry.SetConnected(EFalse);
-			iEntry.SetFailed(EFalse);
-			iEntry.SetSendingState(KMsvSendStateSent);
-
-			//Only update the message if it has changed
- 			if (!(iEntry == iServerEntry.Entry()))
- 				User::LeaveIfError(iServerEntry.ChangeEntry(iEntry));
-			
-			if (iSentFolderExists)
-				{
-				User::LeaveIfError(iServerEntry.SetEntry(iEntry.Parent()));
-				User::LeaveIfError(iServerEntry.MoveEntryWithinService(iEntry.Id(),KMsvSentEntryId));
-				User::LeaveIfError(iServerEntry.SetEntry(iEntry.Id()));
-				iEntry = iServerEntry.Entry();
-				}
-			}
-		}
-	else
-		{
- 		if (!(iEntry == iServerEntry.Entry()))
- 			{
-			//Store iSmsHeader. This is required because of potential changes to the recipients' LogIds.
-			CMsvStore* store = iServerEntry.EditStoreL();
-			CleanupStack::PushL(store);
-			iSmsHeader->StoreL(*store);
-			store->CommitL();
-			CleanupStack::PopAndDestroy(); //store
-			User::LeaveIfError(iServerEntry.ChangeEntry(iEntry));
-			}
-		}
-	
-	RequestComplete(&iStatus, KErrNone, ETrue);
-	}
-
-void CSmsOutboxSend::LogEntry()
-	{
-	__ASSERT_DEBUG(iServerEntry.Entry().Id() == iEntry.Id(), Panic(ESmssEntryNotSet));
-
-	iProgress.iRcpDone++;
-
-	if (!MessageSent() && iProgress.iRcpDone < iProgress.iRcpCount)
-		{
-		CSmsNumber* rcpt = iSmsHeader->Recipients()[iProgress.iRcpDone];
-
-		if (CanLogRecipient(*rcpt))
-			{
-			TLogId logId = rcpt->LogId();
-			iSmsHeader->Message().SetLogServerId(logId);
-
-			if (logId == KLogNullId) 
-				{
-				AddLogEvent();
-				}
-			else
-				{
-				GetLogEvent(logId);
-				}
-			}
-		else
-			{
-			LogEntry();
-			}
-		}
-	else
-		{
-		iProgress.iState = ESmsOutboxSendStateLogEntryComplete;
-		RequestComplete(&iStatus, KErrNone, ETrue);
-		}
-	}
-
-void CSmsOutboxSend::GetLogEvent(TLogId aId)
-	{
-	iProgress.iState = ESmsOutboxSendStateGetLogEvent;
-	iLogger->GetEvent(iStatus, aId);
-	SetActive();
-	}
-
-void CSmsOutboxSend::AddLogEvent()
-	{
-	iProgress.iState = ESmsOutboxSendStateAddLogEvent;
-	TInt logStatus = GetLogStatus();
-	TLogSmsPduData data;
-	// Initialise the data members
-	data.iType		= 0;
-	data.iTotal		= 0;
-	data.iSent		= 0;
-	data.iDelivered	= 0;
-	data.iFailed	= 0;
-	data.iReceived	= 0;
-	iLogger->AddEvent(iStatus, iSmsHeader->Message(), data, &logStatus);
-	SetActive();
-	}
-
-void CSmsOutboxSend::ChangeLogEvent()
-	{
-	__ASSERT_DEBUG(iProgress.iState == ESmsOutboxSendStateGetLogEvent, Panic(KSmssPanicUnexpectedState));
-	iProgress.iState = ESmsOutboxSendStateChangeLogEvent;
-	TInt logStatus = GetLogStatus();
-	iLogger->ChangeEvent(iStatus, iSmsHeader->Message(), iLogger->SmsPDUData(), &logStatus);
-	SetActive();
-	}
-
-TBool CSmsOutboxSend::MessageSent() const
-	{
-	TInt sendingState = iEntry.SendingState();
-	return (sendingState == KMsvSendStateSent) ||
-		(!iEntry.iError &&
-		!iEntry.Failed() &&
-		(sendingState != KMsvSendStateFailed) &&
-		(sendingState != KMsvSendStateScheduled) &&
-		(sendingState != KMsvSendStateSuspended) &&
-		(sendingState != KMsvSendStateResend));
-	}
-
-TBool CSmsOutboxSend::CanLogRecipient(const CSmsNumber& aNumber) const
-	{
-	return aNumber.Status() != CMsvRecipient::ESentSuccessfully;
-	}
-
-TInt CSmsOutboxSend::GetLogStatus() const
-	{
-	TInt logStatus = R_LOG_DEL_NONE;
-
-	switch (iEntry.SendingState())
-		{
-		case KMsvSendStateFailed:
-			{
-			logStatus = R_LOG_DEL_NOT_SENT;
-			break;
-			}
-		case KMsvSendStateScheduled:
-		case KMsvSendStateResend:
-			{
-			logStatus = R_LOG_DEL_SCHEDULED;
-			break;
-			}
-		default:
-			{
-			//do nothing
-			break;
-			}
-		}
-
-	return logStatus;
-	}
-
-const TSmsProgress& CSmsOutboxSend::Progress() // called by the UI to check on prgress through the message selection object
-	{
-	if (iProgress.iState == ESmsOutboxSendStateSending && iCurrentMessage)
-		{
-		SMSSLOG(FLogFormat(_L8("CSmsOutboxSend::Progress() called while sending msg %d"), iCurrentMessage));
-		
-		TInt err = KErrNone;
-		TMsvId oldId = iServerEntry.Entry().Id();
-
-		if (oldId != iCurrentMessage)
-			err = iServerEntry.SetEntry(iCurrentMessage);
-
-		TBool cancelSending = (err == KErrNotFound);
-
-		if (!err)
-			{
-			cancelSending = (iServerEntry.Entry().SendingState() == KMsvSendStateSuspended);
-			}
-
-		iServerEntry.SetEntry(oldId); //ignore error, because there shouldn't be one
-
-		if (cancelSending)
-			{
-			SMSSLOG(FLogFormat(_L8("Cancelled sending msg %d - state SUSPENDED"), iCurrentMessage));
-			iSendSession->Cancel();
-			}
-		}
-
-	return iProgress;
-	}
-
-
-/**
-This method actually sends the message, if a positive response is 
-returned by the UPS server.
-@param None.
-@return void.
-*/
-void CSmsOutboxSend::SendHeader()
-	{
-	if (!iErr && CanSendMessage(iServerEntry.Entry()))
-		{
-		iProgress.iState = ESmsOutboxSendStateSending;
-		iSendSession->SendSms(iStatus);
-		SetActive();
-		}
-	else
-		{
-		TRAPD(err, SendNextHeaderL());
-		}
-	}
--- a/messagingappbase/smsmtm/servermtm/src/SMSSSEND.CPP	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,348 +0,0 @@
-// Copyright (c) 2000-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:
-//
-
-#ifdef _DEBUG
-#undef _MSG_NO_LOGGING
-#endif
-
-#include "SMSSSEND.H"
-
-#include <smuthdr.h>			
-#include <msventry.h>
-#include <txtrich.h>
-#include <smutset.h>
-
-#include "SMSSPAN.H"
-#include "SMSRecipientSend.h"
-
-#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS  
-#include <tmsvsmsentry.h>
-#endif
-
-
-CSmsSend* CSmsSend::NewL(TSmsProgress& aProgress,CMsvServerEntry& aServerEntry, RFs& aFs, CSmsHeader& aHeader, CRichText& aRichText, TMsvEntry& aEntry)
-	{
-	return new(ELeave) CSmsSend(aProgress, aServerEntry, aFs, aHeader, aRichText, aEntry);
-	}
-
-CSmsSend::~CSmsSend()
-	{
-	Cancel();
-	}
-
-void CSmsSend::Start(TRequestStatus& aStatus,TMsvId aMsvId, CSmsRecipientSend* aRecipientSend)
-	{
-	__ASSERT_DEBUG(iState==ESmsSendWaiting,Panic(KSmssPanicUnexpectedState));
-
-	iRecipientSend = aRecipientSend;
-	Queue(aStatus);
-	iEntry=TMsvEntry();
-	TRAPD(err,OpenEntryL(aMsvId));
-	RequestComplete(&iStatus, err, ETrue);
-	}
-
-void CSmsSend::DoSmssCancel()
-	{
-	switch (iState)
-		{
-		case ESmsSendWaiting:
-			break;
-		case ESmsSendOpeningEntry:
-			break;
-		case ESmsSendUpdatingRecipient:				
-		case ESmsSendSendingEntry:
-			{
-			iRecipientSend->Cancel();
-			break;
-			}
-		default:
-			Panic(KSmssPanicUnexpectedState);
-		}
-	}
-
-CSmsSend::CSmsSend(TSmsProgress& aProgress, CMsvServerEntry& aServerEntry, RFs& aFs, CSmsHeader& aHeader, CRichText& aRichText, TMsvEntry& aEntry)
-:	CSmssActive(aFs, aServerEntry, KSmsSessionPriority),
-	iProgress(aProgress),
-	iEntry(aEntry),
-	iSmsHeader(aHeader),
-	iRichText(aRichText),
-	iState(ESmsSendWaiting)
-	{
-	CActiveScheduler::Add(this);
-	}
-
-void CSmsSend::DoRunL()
-	{
-	switch (iState)
-		{
-		case ESmsSendOpeningEntry:
-			{
-			SendNextRecipientL();
-			break;
-			}
-		case ESmsSendSendingEntry:
-			{
-			++iProgress.iRcpDone;
-			UpdateAfterRecipientSentL(iProgress.iError);
-			break;
-			}
-		case ESmsSendUpdatingRecipient:
-			{
-			SendNextRecipientL();
-			break;
-			}
-		case ESmsSendWaiting:
-		default:
-			Panic(KSmssPanicUnexpectedState);
-		};
-	}
-
-void CSmsSend::OpenEntryL(const TMsvId aMsvId)
-	{
-	iState = ESmsSendOpeningEntry;
-	User::LeaveIfError(iServerEntry.SetEntry(aMsvId));
-	iEntry = iServerEntry.Entry();
-	CMsvStore* msvstore = iServerEntry.ReadStoreL();
-	CleanupStack::PushL(msvstore);
-	iSmsHeader.RestoreL(*msvstore);
-	iRichText.Reset();
-	msvstore->RestoreBodyTextL(iRichText);
-
-	CleanupStack::PopAndDestroy(msvstore);
-
-	iProgress.iRcpDone	= 0;
-	iProgress.iRcpCount	= iSmsHeader.Recipients().Count();
-	
-	// Check that there is at least one recipient for this message
-	if( iProgress.iRcpCount == 0 )
-		User::Leave(KErrNotFound);
-
-	iSentRecipients = 0;
-	iLastSentIndex	= 0;
-	
-	//Check if Last Segment Staus has been requested . If so , make iDeliveryReports as ETrue 
-	//so that acknowledgement status is EPendingAck , since the last segment acknowledgement is pending .
-	CSmsSettings* smsSet = CSmsSettings::NewL();
-	CleanupStack::PushL(smsSet);
-
-	iSmsHeader.GetSmsSettingsL(*smsSet);
-	if(smsSet->LastSegmentDeliveryReport())
-		{
-		iDeliveryReports = ETrue;
-		}
-	else
-		{
-		iDeliveryReports = iSmsHeader.Submit().StatusReportRequest();
-		}
-	CleanupStack::PopAndDestroy(smsSet);
-
-	iEntry.SetConnected(ETrue);
-	iEntry.SetFailed(EFalse);
-	iEntry.SetSendingState(KMsvSendStateSending);
-	iEntry.iError = KErrNone;
-
-	ChangeEntryL(iEntry);
-	}
-
-void CSmsSend::SendNextRecipientL()
-	{
-	iState = ESmsSendSendingEntry;
-
-	if (iProgress.iRcpDone < iProgress.iRcpCount)
-		{
-		CSmsNumber& rcpt = *(iSmsHeader.Recipients()[iProgress.iRcpDone]);
-		iSmsHeader.Message().SetToFromAddressL(rcpt.Address());
-
-		//Do not send to the recipient if they failed or was successfully sent previously.
-		//Whether to send to a recipient is dependent on CSmsScheduledEntry::CheckRecipient().
-		if (CanSendMessageToRecipient(iEntry, rcpt))
-			{
-			//Move off the current entry so it isn't locked while sending
-			iServerEntry.SetEntry(KMsvNullIndexEntryId); //ignore any error
-
-			//Send the message to the recipient
-			iRecipientSend->Start(iStatus, iEntry, iSmsHeader, rcpt);
-			SetActive();
-			}
-		else
-			{
-#ifndef _MSG_NO_LOGGING
-			TPtrC addr(rcpt.Address());
-			SMSSLOG(FLogFormat(_L("Cannot send %d to %S (state %d, status %d)"), iEntry.Id(), &addr, iEntry.SendingState(), rcpt.Status()));
-#endif
-			iProgress.iRcpDone++;
-			SendNextRecipientL();
-			}
-		}
-	else
-		{
-		// Sending Complete
-		UpdateEntryAfterAllSentL();
-		}
-	}
-
-void CSmsSend::UpdateAfterRecipientSentL(const TInt aError)
-	{
-	iState = ESmsSendUpdatingRecipient;
-
-	User::LeaveIfError(iServerEntry.SetEntry(iEntry.Id()));
-	iEntry = iServerEntry.Entry();
-
-	CSmsNumber* rcpt = iSmsHeader.Recipients()[iProgress.iRcpDone - 1];
-	
-	//In a list of recipients if message send to any one of the recipient has failed 
-	//means the message should be in outbox (user can edit the message and send) and also 
-	//UI will be intimated with proper status. iProgress.iError will contain only the last
-	// recipient's status after sending all recipients. So save the all recipient's failed 
-	//status (if any) and update the same to iProgress.iError after sending a message to all recipients.
-	if(aError != KErrNone && (iProgress.iRcpCount > 1))
-		{
-		iRecipientFailedStatus = aError;
-		}
-
-	rcpt->Time().UniversalTime();
-	rcpt->SetError(aError);
-	CMsvRecipient::TRecipientStatus rcptStatus = CMsvRecipient::ESentSuccessfully;
-
-	if( aError != KErrNone )
-		{
-		if( aError == KErrCancel )
-			{
-			rcptStatus = CMsvRecipient::ENotYetSent;
-			}
-		else
-			{
-			rcptStatus = CMsvRecipient::EFailedToSend;
-			}
-
-		iEntry.iError = aError;
-		iEntry.SetFailed(ETrue);
-		}
-	else if( iDeliveryReports )
-		{
-		// Set the deliver info in the recipiant to pending ack.
-		rcpt->SetAckStatus(ESmsAckTypeDelivery, CSmsNumber::EPendingAck);
-		
-		// Update flag to indicate that a recipient has successfully sent to 
-		// and record the index of the last recipient to be sent.
-		++iSentRecipients;
-		iLastSentIndex = iProgress.iRcpDone - 1;
-		}
-
-	rcpt->SetStatus(rcptStatus);
-	StoreHeaderL(iSmsHeader);
-
-	RequestComplete(&iStatus, KErrNone, ETrue);
-	}
-
-void CSmsSend::UpdateEntryAfterAllSentL()
-	{
-	// Assumes iServerEntry is already set to iEntry.Id()
-
-	iEntry.SetConnected(EFalse);
-	
-	//if a message to last recipient is sent successfully and failed to send to some of the other recipients in 
-	//a list of recipients then update the iProgress.iError with iRecipientFailedStatus
-	if( iProgress.iError == KErrNone && iRecipientFailedStatus != KErrNone )
-		{
-		iProgress.iError = iRecipientFailedStatus;
-		}
-	iRecipientFailedStatus = KErrNone;
-
-	if( iEntry.SendingState() != KMsvSendStateSuspended )
-		{
-		TInt newSendingState = KMsvSendStateSent;
-		TBool failed = iEntry.Failed() || iEntry.iError;
-
-		if( failed )
-			{
-			if( iEntry.iError == KErrCancel )
-				{
-				newSendingState = KMsvSendStateSuspended;
-				}
-			else
-				{
-				newSendingState = KMsvSendStateFailed;
-				}
-			}
-		if( iDeliveryReports && iSentRecipients > 0 )
-			{
-			// At least one recipient has been sent and delivery reports have
-			// been requested - update the entry summary to reflect this.
-			TMsvSmsEntry& entry = static_cast<TMsvSmsEntry&>(iEntry);
-
-			// Set the message ID field only if this is not a bio-message. Need 
-			// to do this before updating the summary as the current summary 
-			// will determine if the message ID can be set.
-			if( entry.iBioType == 0 )
-				{
-				TBool validMessageId = EFalse;
-				TLogId logId = 0;
-				
-				// NOTE - need to ensure correct index information in the cases 
-				// when a message with multiple recipients only sends to one 
-				// recipient the first time and then on the re-schedule sends to
-				// one or more remaining recipients.
-				if( (iSentRecipients == 1) && (entry.AckSummary(ESmsAckTypeDelivery) != TMsvSmsEntry::EPendingAcks) )
-					{
-					if(iProgress.iRcpCount <= 0)
-						{
-						newSendingState = KMsvSendStateFailed;
-						failed =ETrue;
-						}
-					else
-						{
-						// There is now only a single recpient that is pending delivery
-						// reports - store the log ID in the index.
-						logId = iSmsHeader.Recipients()[iLastSentIndex]->LogId();
-						validMessageId = ETrue;	
-						}
-					}
-				entry.SetMessageId(logId, validMessageId);
-				}
-			// It is now safe to update the summary.
-			entry.SetAckSummary(ESmsAckTypeDelivery, TMsvSmsEntry::EPendingAcks);
-			}
-		iEntry.SetFailed(failed);
-		
-		if( newSendingState != KMsvSendStateFailed )
-			iEntry.SetSendingState(newSendingState);
-		}
-
-	ChangeEntryL(iEntry);
-	}
-
-void CSmsSend::DoComplete(TInt& aStatus)
-	{
-	//If there is an error, then update the entry accordingly.
-	if (aStatus != KErrNone)
-		{
-   		__ASSERT_DEBUG(iEntry.Connected() || iState == ESmsSendOpeningEntry, Panic(KSmssPanicUnexpectedErrorCode));
-
-		TInt err = iServerEntry.SetEntry(iEntry.Id());
-
-		if (!err)
-			{
-			iEntry = iServerEntry.Entry();
-			iEntry.iError = aStatus;
-			TRAP(err, UpdateEntryAfterAllSentL()); //ignore error
-			}
-
-		iProgress.iError = aStatus;
-		aStatus = KErrNone;
-		}
-	
-	iState = ESmsSendWaiting;
-	}
--- a/messagingappbase/smsmtm/servermtm/src/SMSSchSend.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,293 +0,0 @@
-// Copyright (c) 1999-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:
-//
-
-#ifdef _DEBUG
-#undef _MSG_NO_LOGGING
-#endif
-
-#include <msvstd.h>
-#include <msventry.h>
-
-#include "SMSSchSend.h"
-#include <smutset.h>
-
-#ifndef _MSG_NO_LOGGING
-#include <flogger.h>
-#endif
-
-/*
- *	CSmsScheduleSend Implementation
- */
- 
-CSmsScheduleSend* CSmsScheduleSend::NewL(CMsvServerEntry& aServerEntry)
-	{
-	CSmsScheduleSend* self = new (ELeave) CSmsScheduleSend(aServerEntry);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-CSmsScheduleSend::CSmsScheduleSend(CMsvServerEntry& aServerEntry)
-	: CMsvScheduleSend(aServerEntry)
-	{
-	}
-
-/*
-Returns a pointer to a newly created CSmsScheduledEntry for a specified message.
-
-The CSmsScheduledEntry encapsulates the scheduling and recipient information
-relating to the message identified by aId.
-
-@param	Id
-The ID for the specified message.
-
-@return
-A pointer to the created CSmsScheduledEntry object,
-*/
-CMsvScheduledEntry* CSmsScheduleSend::GetMessageL(const TMsvId aId) const
-	{
-	//Set the iServerEntry to the message identified by aId
-	User::LeaveIfError(iServerEntry.SetEntry(aId));
-	
-	//Create a new CSmsScheduledEntry
-	CSmsScheduledEntry* entry = CSmsScheduledEntry::NewL(iServerEntry.Entry());
-	CleanupStack::PushL(entry);
-	CMsvStore* store = iServerEntry.ReadStoreL();
-	CleanupStack::PushL(store);
-	//Restore the entry from the message's store.
-	entry->RestoreL(*store);
-
-	CleanupStack::PopAndDestroy(store);
-	CleanupStack::Pop(entry);
-
-	return entry;
-	}
-
-/*
- *	CSmsScheduledEntry Implementation
- */
-
-CSmsScheduledEntry* CSmsScheduledEntry::NewL(const TMsvEntry& aEntry)
-	{
-	CSmsScheduledEntry* self = new (ELeave) CSmsScheduledEntry(aEntry);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-CSmsScheduledEntry::CSmsScheduledEntry(const TMsvEntry& aEntry)
-	: CMsvScheduledEntry(aEntry)
-	{
-	}
-
-void CSmsScheduledEntry::ConstructL()
-	{
-	iParaLayer = CParaFormatLayer::NewL();
-	iCharLayer = CCharFormatLayer::NewL();
-	iRichText = CRichText::NewL( iParaLayer, iCharLayer, CEditableText::EFlatStorage, 256 );
-	iHeader = CSmsHeader::NewL(CSmsPDU::ESmsSubmit,*iRichText);
-	}
-
-CSmsScheduledEntry::~CSmsScheduledEntry()
-	{
-	// don't delete iRecipient
-	delete iHeader;
-	delete iRichText;
-	delete iCharLayer;
-	delete iParaLayer;
-	}
-
-void CSmsScheduledEntry::RecipientsStoreL(CMsvStore& aStore) const
-	{
-	iHeader->StoreL(aStore);
-	}
-
-void CSmsScheduledEntry::RecipientsRestoreL(CMsvStore& aStore)
-	{
-	iHeader->RestoreL(aStore);
-	}
-
-TBool CSmsScheduledEntry::CanSendToAnyRecipients(const TMsvSendErrorAction& aAction)
-	{
-	CArrayPtrFlat<CSmsNumber>& numbers = iHeader->Recipients();
-	TInt count = numbers.Count();
-
-	TBool retVal = EFalse;
-
-	while (count--)
-		{
-		CSmsNumber* rcpt = numbers[count];
-
-		retVal |= CheckRecipient(*rcpt, aAction);
-		}
-
-	return retVal;
-	}
-
-TBool CSmsScheduledEntry::RecipientsAllSent() const
-	{
-	//Returns whether all recipients of this SMS have sent successfully.
-	//If there are NO recipients, then returns EFalse.
-
-	CArrayPtrFlat<CSmsNumber>& numbers = iHeader->Recipients();
-	TInt count = numbers.Count();
-	TBool retVal = count;
-
-	while (retVal && count--)
-		{
-		CSmsNumber* rcpt = numbers[count];
-		retVal &= (rcpt->Status() == CMsvRecipient::ESentSuccessfully);
-		}
-
-	return retVal;
-	}
-
-TBool CSmsScheduledEntry::CheckRecipient(CSmsNumber& aRcpt, const TMsvSendErrorAction& aAction)
-	{
-#ifndef _MSG_NO_LOGGING
-	TPtrC address(aRcpt.Address());
-	RFileLogger::WriteFormat(KSchSendLogDir, KSchSendLogFile, EFileLoggingModeAppend,
-		_L("\t\tCSmsScheduledEntry::CheckRecipient() aRcpt %S: Status %d Retries %d, aAction: Action %d Retries %d MaxRetries %d"),
-		&address,
-		aRcpt.Status(),
-		aRcpt.Retries(),
-		aAction.iAction,
-		aAction.iRetries,
-		aAction.MaxRetries());
-#endif
-
-	TBool retVal = EFalse;
-
-	if (aRcpt.Status() != CMsvRecipient::ESentSuccessfully)
-		{
-		if (aAction.iAction == ESendActionSentAlready)
-			{
-			aRcpt.SetStatus(CMsvRecipient::ESentSuccessfully);
-			}
-		else if (aAction.iAction == ESendActionFail)
-			{
-			aRcpt.SetStatus(CMsvRecipient::EFailedToSend);
-			}
-		else if (aAction.iRetries == ESendRetriesInfinite || aRcpt.Retries() < aAction.MaxRetries())
-			{
-			aRcpt.SetStatus(CMsvRecipient::ENotYetSent);
-			retVal = ETrue;
-			}
-		else
-			{
-			aRcpt.SetStatus(CMsvRecipient::EFailedToSend);
-			}
-		}
-
-	return retVal;
-	}
-
-/**
-Returns ETrue if the message can still sent to any of its recipients.
-Otherwise returns EFalse.
-
-The appropriate error action is also returned. The error action determines if a
-particular recipient can be re-scheduled. The appropriate error action is given
-from the list of error actions, which defines the action for a particular error
-code.
-
-@param	aErrorActions
-The list of error actions that define what re-schedule is required for particular
-error codes.
-
-@param	aAction
-An output argument with the error action appropriate for the recipient send error.
-
-@return
-A boolean value indicatinng whether the message can be sent to any of its
-recipients.
-*/
-TBool CSmsScheduledEntry::CanSendToAnyRecipients(const CMsvSendErrorActions& aErrorActions, TMsvSendErrorAction& aAction)
-	{
-	CArrayPtrFlat<CSmsNumber>& numbers = iHeader->Recipients();
-	TInt count = numbers.Count();
-
-	TBool retVal = EFalse;
-
-	while (count--)
-		{
-		CSmsNumber* rcpt = numbers[count];
-
-		TMsvSendErrorAction action;
-
-		if (aErrorActions.GetSendErrorAction(rcpt->Error(), action) != KErrNone)
-			{
-			action = aErrorActions.Default();
-			}
-
-		if (CheckRecipient(*rcpt, action))
-			{
-			retVal = ETrue;
-			aAction = action;
-			}
-		}
-
-	return retVal;
-	}
-
-void CSmsScheduledEntry::RecipientsResetRetries()
-	{
-	CArrayPtrFlat<CSmsNumber>& numbers = iHeader->Recipients();
-	TInt count = numbers.Count();
-
-	while (count--)
-		{
-		CSmsNumber* rcpt = numbers[count];
-		
-		if (rcpt->Status() != CMsvRecipient::ESentSuccessfully)
-			{
-			rcpt->ResetRetries();
-			}
-		}
-	}
-
-void CSmsScheduledEntry::RecipientsIncreaseRetries()
-	{
-	CArrayPtrFlat<CSmsNumber>& numbers = iHeader->Recipients();
-	TInt count = numbers.Count();
-
-	while (count--)
-		{
-		CSmsNumber* rcpt = numbers[count];
-		
-		if (rcpt->Status() != CMsvRecipient::ESentSuccessfully)
-			{
-			rcpt->IncreaseRetries();
-			}
-		}
-	}
-
-void CSmsScheduledEntry::RecipientsSetFailed()
-	{
-	CArrayPtrFlat<CSmsNumber>& numbers = iHeader->Recipients();
-	TInt count = numbers.Count();
-
-	while (count--)
-		{
-		CSmsNumber* rcpt = numbers[count];
-		
-		if (rcpt->Status() != CMsvRecipient::ESentSuccessfully)
-			{
-			rcpt->SetStatus(CMsvRecipient::EFailedToSend);
-			}
-		}
-	}
--- a/messagingappbase/smsmtm/servermtm/src/SMSSendSession.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,303 +0,0 @@
-// Copyright (c) 1999-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 "SMSSendSession.h"
-
-#include <msventry.h>
-#include <smutset.h>
-#include <smuthdr.h>
-
-#include "SMSSPAN.H"
-#include "SMSSSEND.H"
-#include "SMSRecipientSend.h"
-
-const TInt KErrUnknownBioType = KErrNotSupported;
-
-CSmsSendSession* CSmsSendSession::NewL(TSmsProgress& aProgress, CMsvServerEntry& aServerEntry, RFs& aFs, CSmsHeader& aHeader, CRichText& aRichText, TMsvEntry& aEntry)
-	{
-	CSmsSendSession* self = new (ELeave) CSmsSendSession(aProgress, aFs, aServerEntry, aHeader);
-	CleanupStack::PushL(self);
-
-	self->ConstructL(aRichText, aEntry);
-
-	CleanupStack::Pop();
-
-	return self;
-	}
-
-CSmsSendSession::CSmsSendSession(TSmsProgress& aProgress, RFs& aFs, CMsvServerEntry& aServerEntry, CSmsHeader& aHeader)
-	: CSmssActive(aFs, aServerEntry, KSmsSessionPriority), iProgress(aProgress), iSmsHeader(aHeader)
-	{
-	CActiveScheduler::Add(this);
-	}
-
-CSmsSendSession::~CSmsSendSession()
-	{
-	if (iSendTypes)
-		iSendTypes->ResetAndDestroy();
-
-	delete iSendTypes;
-	delete iSmsSend;
-	}
-
-void CSmsSendSession::ConstructL(CRichText& aRichText, TMsvEntry& aEntry)
-	{
-	iSendTypes = new (ELeave) CArrayPtrFlat<CSmsSendType>(1);
-	iSmsSend = CSmsSend::NewL(iProgress, iServerEntry, iFs, iSmsHeader, aRichText, aEntry);
-	}
-
-void CSmsSendSession::DivideMessagesL(CMsvEntrySelection& aSelection)
-	{
-	iProgress.iMsgCount = 0;
-	TInt selCount = aSelection.Count();
-
-	if (!selCount)
-		User::Leave(KErrNotFound);
-
-	CreateRecipientsL();
-	const TInt typeCount = iSendTypes->Count();
-	TInt divideError = KErrNone; //Used later as the error code to leave with if aSelection.Count() == 0
-
-	//Order important
-	while (selCount--)
-		{
-		TMsvId id = aSelection[selCount];
-		TInt err = iServerEntry.SetEntry(id);
-    	SMSSLOG(FLogFormat(_L8("CSmsSendSession::DivideMessagesL() - switch to entry: %d, err: %d"), id, err ));
-
-		if (!err)
-			{
-			TMsvEntry entry = iServerEntry.Entry();
-
-			if(entry.InPreparation())
-				{
-		    	SMSSLOG(FLogFormat(_L8("CSmsSendSession::DivideMessagesL() - entry is in preparation - deleting it from selection array...")));
-				aSelection.Delete(selCount);
-				}
-			else
-				{   
-				//Restore the CSmsHeader
-				CMsvStore* store = NULL;
-				TInt error = KErrNone;
-				TRAP(error, store = iServerEntry.ReadStoreL());
-				if(error == KErrAccessDenied )
-					{
-		    		SMSSLOG(FLogFormat(_L8("CSmsSendSession::DivideMessagesL() - Error = -21 - deleting it from selection array...")));
-					entry.SetSendingState(KMsvSendStateWaiting);
-					iServerEntry.ChangeEntry(entry);
-					aSelection.Delete(selCount);
-					}
-				else
-					{
-					User::LeaveIfError(error);
-					CleanupStack::PushL(store);
-					iSmsHeader.RestoreL(*store);
-					CleanupStack::PopAndDestroy(); //store
-
-					TBool msgAdded = EFalse;
-
-					for(TInt curType = 0; curType < typeCount && !msgAdded; curType++)
-						{
-						CSmsSendType* smsType = iSendTypes->At(curType);
-		
-						if (smsType->iRecipientSend->AcceptMessage(entry, iSmsHeader))
-							{
-							smsType->iSelection->InsertL(0, id);
-							iProgress.iMsgCount++;
-							msgAdded = ETrue;
-							}
-						} //end for curType
-
-					if (!msgAdded)
-						{
-						SMSSLOG(FLogFormat(_L8("\tCannot send message %d - Invalid bioType (%d) and bioIdType (%d) combination"), id, entry.iBioType, iSmsHeader.BioMsgIdType()));
-
-						//Message is not going to be sent, so set failed
-						entry.SetFailed(ETrue);
-						entry.SetSendingState(KMsvSendStateFailed);
-						entry.iError = KErrUnknownBioType;
-						divideError = KErrUnknownBioType;
-						iServerEntry.ChangeEntry(entry); //ignore error?
-
-						aSelection.Delete(selCount);
-						}	
-					}
-				}
-			} 
-		else //SetEntry() failed
-			{
-			SMSSLOG(FLogFormat(_L8("\tCannot send message %d - iServerEntry.SetEntry(%d) returned error %d"), id, id, err));
-
-			if (err != KErrNotFound && err != KErrLocked)
-				User::Leave(err);
-
-			if (!divideError && divideError != KErrUnknownBioType)
-				divideError = err;
-
-			aSelection.Delete(selCount);
-			}
-		} //end for curMsg
-
-	if (!iProgress.iMsgCount)
-		{
-		SMSSLOG(FLogFormat(_L8("\tNO messages to send - CSmsSendSession::DivideMessagesL() error %d"), divideError));
-		User::Leave(divideError);
-		}
-    SMSSLOG(FLogFormat(_L8("CSmsSendSession::DivideMessagesL() - END") ));
-	}
-
-void CSmsSendSession::CreateRecipientsL()
-	{
-	SMSSLOG(FLogFormat(_L8("CSmsSendSession::CreateRecipientsL() - iServerEntry id: %d"), iServerEntry.Entry().Id() ));
-	//Create WAP and Text Recipients.
-	//Note: The order of adding rcptWap and rcptText to iSendTypes is important
-	//because rcptText->AcceptMessage() always returns ETrue, therefore rcptWap
-	//must be inserted before rcptText.
-
-	//Create a Wap Recipient
-	CWapRecipientSend* rcptWap = CWapRecipientSend::NewL(iProgress, iFs, iServerEntry);
-	CleanupStack::PushL(rcptWap);
-	CSmsSendType* smsType = CSmsSendType::NewL(rcptWap);
-	CleanupStack::PushL(smsType);
-	iSendTypes->AppendL(smsType);
-	CleanupStack::Pop(2); //rcptWap, smsType
-
-	//Create a Text Recipient
-	CTextRecipientSend* rcptText = CTextRecipientSend::NewL(iProgress, iFs, iServerEntry);
-	CleanupStack::PushL(rcptText);
-	smsType = CSmsSendType::NewL(rcptText);
-	CleanupStack::PushL(smsType);
-	iSendTypes->AppendL(smsType);
-	CleanupStack::Pop(2); //rcptText, smsType
-	}
-
-TMsvId CSmsSendSession::IncSms()
-	{
-	CSmsSendType* sendType = NULL;
-	TInt typeCount = iSendTypes->Count();
-
-	iId = 0;
-
-	if (typeCount)
-		{
-		while (iCurrentSendType < typeCount && !iId)
-			{
-			sendType = iSendTypes->At(iCurrentSendType);
-			CMsvEntrySelection& selection = *(sendType->iSelection);
-			sendType->iCurrentMessage++;
-
-			if (sendType->iCurrentMessage < selection.Count())
-				{
-				iId = selection[sendType->iCurrentMessage];
-				}
-			else
-				{
-				iCurrentSendType++;
-				}
-			}
-		}
-
-	return iId;
-	}
-
-void CSmsSendSession::SendSms(TRequestStatus& aStatus)
-	{
-	SMSSLOG(FLogFormat(_L8("CSmsSendSession::SendSms() - START - iId: %d"), iId ));
-	Queue(aStatus);
-
-	if (iId)
-		{
-		iState = ESessionSending;
-		CSmsSendType* sendType = iSendTypes->At(iCurrentSendType);
-		iSmsSend->Start(iStatus, iId, sendType->iRecipientSend);
-		}
-	else
-		{
-		iState = ESessionNoMoreMessages;
-		RequestComplete(&iStatus, KErrNotFound, EFalse);
-		}
-
-	SetActive();
-	SMSSLOG(FLogFormat(_L8("CSmsSendSession::SendSms() - END - iId: %d, iState: %d"), iId, iState ));
-	}
-
-void CSmsSendSession::DoSmssCancel()
-	{
-	SMSSLOG(FLogFormat(_L8("CSmsSendSession::DoSmssCancel() - iId: %d, iState: %d"), iId, iState ));
-	switch (iState)
-		{
-		case ESessionSending:
-			iSmsSend->Cancel();
-			break;
-		default:
-			break;
-		}
-	}
-
-void CSmsSendSession::DoRunL()
-	{
-	SMSSLOG(FLogFormat(_L8("CSmsSendSession::DoSmssCancel() - START - iId: %d, iState: %d"), iId, iState ));
-	switch (iState)
-		{
-		case ESessionSending:
-			break;
-		case ESessionNoMoreMessages:
-		case ESessionNoSendTypes:
-			iProgress.iError = KErrNotFound;
-			break;
-		default:
-			Panic(KSmssPanicUnexpectedState);
-		}
-	SMSSLOG(FLogFormat(_L8("CSmsSendSession::DoSmssCancel() - END - iId: %d, iState: %d"), iId, iState ));
-	}
-
-void CSmsSendSession::DoComplete(TInt& aStatus)
-	{
-	SMSSLOG(FLogFormat(_L8("CSmsSendSession::DoSmssCancel() - aStatus: %d, iState: %d, iProgress.iError: %d"), aStatus, iState, iProgress.iError ));
-	if (aStatus != KErrNone && iProgress.iError == KErrNone)
-		{
-		iProgress.iError = aStatus;
-		}
-
-	aStatus = KErrNone;
-	}
-
-CSmsSendSession::CSmsSendType* CSmsSendSession::CSmsSendType::NewL(CSmsRecipientSend* aRecipient)
-	{
-	CSmsSendType* self = new (ELeave) CSmsSendType(aRecipient);
-	CleanupStack::PushL(self);
-
-	self->ConstructL();
-
-	CleanupStack::Pop();
-
-	return self;
-	}
-
-CSmsSendSession::CSmsSendType::CSmsSendType(CSmsRecipientSend* aRecipient)
-: iRecipientSend(aRecipient), iCurrentMessage(-1)
-	{
-	}
-
-CSmsSendSession::CSmsSendType::~CSmsSendType()
-	{
-	delete iRecipientSend;
-	delete iSelection;
-	}
-
-void CSmsSendSession::CSmsSendType::ConstructL()
-	{
-	iSelection = new (ELeave) CMsvEntrySelection();
-	}
--- a/messagingappbase/smsmtm/servermtm/src/SmssSimUtils.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1169 +0,0 @@
-// Copyright (c) 2000-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:
-//
-
-#ifdef _DEBUG
-#undef _MSG_NO_LOGGING
-#endif
-
-#include <smutset.h>
-#include <txtrich.h>
-#include <smuthdr.h>
-#include <msventry.h>
-#include <msvuids.h>
-#include <mmlist.h>
-#include <smutsimparam.h>
-#include <biodb.h>
-#include <biouids.h>
-#include <csmsaccount.h>
-
-#include "SmssSimUtils.h"
-#include "SMSSPAN.H"
-
-//Logging constants
-
-#ifndef _MSG_NO_LOGGING
-_LIT(KDeleteFromSimLog, "DeleteFromSim.txt");
-_LIT(KEnumerateSimLog, "EnumerateSim.txt");
-_LIT(KCopyToSimLog, "CopyToSim.txt");
-#endif
-
-//CopyToSim constants
-
-
-CSmsSimUtils* CSmsSimUtils::NewL(CMsvServerEntry& aServerEntry, RFs& aFs, TMsvId aSmsServiceId)
-	{
-	CSmsSimUtils* self = new (ELeave) CSmsSimUtils(aServerEntry, aFs, aSmsServiceId);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-    return self;
-	}
-
-void CSmsSimUtils::ConstructL()
-	{
-	iSettings = CSmsSettings::NewL();
-		
-	// load ECOM interface used to create SMS details and description values.
-	iGetDetDesc = CSmsGetDetDescInterface::NewL();
-	}
-
-CSmsSimUtils::~CSmsSimUtils()
-	{
-	Cancel();
-
-	iWriteStream.Close();
-	iReadStream.Close();
-
-	iSocket.Close();
-	iSocketServ.Close();
-
-	delete iSelection;
-	delete iCompletedSelection;
-
-	delete iHeader;
-	delete iBody;
-	delete iCharFormat;
-	delete iParaFormat;
-
-	delete iBioDb;
-	delete iSettings;
-
-	delete iGetDetDesc;
-	REComSession::FinalClose();
-	}
-
-void CSmsSimUtils::ReadSimParamsL(TRequestStatus& aStatus)
-/**
-	Reads the SMS parameters from the SIM
-
-	@since			7.0
-	@param			aStatus		Indicates the completion status of a request made to 
-								a service provider. 
-	@pre 			None
-	@post			Starts the reading async operation.
- */
-	{
-	SMSSLOG(FLogFormat(_L8("Reading SMS SIM Parameters")));
-
-	Queue(aStatus);
-
-	iProgress = TSmsProgress();
-	iProgress.iType = TSmsProgress::ESmsProgressTypeReadSimParams;
-
-	ConnectL();
-
-	iSocket.Ioctl(KIoctlReadSmsParams, iStatus, NULL, KSolSmsProv);
-	
-	SetActive();
-	iReadingSimParams = ETrue;
-	}
-
-void CSmsSimUtils::WriteSimParamsL(TRequestStatus& aStatus)
-/**
-	Writes the SMS parameters to the SIM
-
-	@since			7.0
-	@param			aStatus		
-	@pre 			The parameters are stored in the message store.
-	@post			The parameters are retrived form the message store and the writing
-					async operation is started.
- */
-	{
-	SMSSLOG(FLogFormat(_L8("Writing SMS SIM Parameters")));
-
-	Queue(aStatus);
-
-	iProgress = TSmsProgress();
-	iProgress.iType = TSmsProgress::ESmsProgressTypeWriteSimParams;
-
-	CMobilePhoneSmspList* smspList = CMobilePhoneSmspList::NewL();
-	CleanupStack::PushL(smspList);
-
-	User::LeaveIfError(iServerEntry.SetEntry(iSmsServiceId));
-
-	CMsvStore* store = iServerEntry.ReadStoreL();
-	CleanupStack::PushL(store);
-
-	CSmsSimParamOperation::RestoreSimParamsL(*store, *smspList);
-
-	TInt count = 0;
-	count = smspList->Enumerate();
-
-	if (!count)
-		User::Leave(KErrNotFound);
-
-	ConnectL();
-	
-	iWriteStream << *smspList;
-	iWriteStream.CommitL(); 
-
-	CleanupStack::PopAndDestroy(2);  //smspList, store
-	User::LeaveIfError(iServerEntry.SetEntry(KMsvNullIndexEntryId));
-
-	iSocket.Ioctl(KIoctlWriteSmsParams, iStatus, NULL, KSolSmsProv);
-
-	SetActive();
-	}
-
-void CSmsSimUtils::EnumerateL(const TDesC8& aParameter, TRequestStatus& aStatus)
-	{
-	SMSSLOG(FLogFormat(_L8("Enumerate messages in SIM [param=%d]"), aParameter.Length()));
-
-	//Enumerate messages on the SIM.
-	//First obtains a count of messages on the SIM.
-
-	Queue(aStatus);
-	iProgress = TSmsProgress();
-	iProgress.iType = TSmsProgress::ESmsProgressTypeEnumeratingPhoneStores;
-
-	ConstructHeaderAndBodyL();
-	SetAndCleanEnumerateFolderL(aParameter);
-	SMSSLOG(FLogFormat(_L8("\tUsing folder %d"), iProgress.iEnumerateFolder, aParameter.Length()));
-	
-	//Obtain a count of the messages on the SIM
-	CountMessagesInPhoneStoresL();
-	}
-
-void CSmsSimUtils::SetAndCleanEnumerateFolderL(const TDesC8& aParameter)
-/**
- * 
- *
- * @param aParameter Optionally contains the ID of the folder to store the phone store messages
- */
-	{
-	iProgress.iEnumerateFolder = KErrNotFound;
-
-	//Restore the iSimUtilsData.
-	//This should be moved to a more general ContructL() if other functions other than EnumerateL() need to use this data
-	RestoreSimUtilsDataL();
-
-	//Delete messages under the last folder used to store phone-side messages
-	const TInt err = iServerEntry.SetEntry(iSimUtilsData.iLastEnumerateFolder);
-	if (err == KErrNotFound)
-		{
-		iSimUtilsData.iLastEnumerateFolder = KErrNotFound;
-		}
-	else
-		{
-		//Clean the last folder used to store phone-side messages
-		User::LeaveIfError(err);
-		DeleteChildrenL(iSimUtilsData.iLastEnumerateFolder);
-		}
-
-	if (aParameter.Length() != 0)
-		{
-		//Use the TMsvId packaged in aParameter as the folder in which to store phone-side messages
-		TPckgC<TMsvId> enumFolder(KErrNotFound);
-		enumFolder.Set(aParameter);
-		iProgress.iEnumerateFolder = enumFolder();
-		SMSSLOG(FLogFormat(_L8("\tAsked to use folder %d [last=%d]"), iProgress.iEnumerateFolder, iSimUtilsData.iLastEnumerateFolder));
-
-		switch (iProgress.iEnumerateFolder)
-			{
-			case KMsvRootIndexEntryId:
-			case KMsvLocalServiceIndexEntryId:
-			case KMsvGlobalInBoxIndexEntryId:
-			case KMsvGlobalOutBoxIndexEntryId:
-			case KMsvDraftEntryId:
-			case KMsvSentEntryId:
-				User::Leave(KErrArgument); //cannot store phone-side messages under a standard folder
-				break;
-			default:
-				break;
-			}
-
-		//Check the folder exists and delete all its children
-		User::LeaveIfError(iServerEntry.SetEntry(iProgress.iEnumerateFolder));
-		DeleteChildrenL(iProgress.iEnumerateFolder);
-		}
-	else
-		{
-		//else use the last folder used to store phone-side messages
-		iProgress.iEnumerateFolder = iSimUtilsData.iLastEnumerateFolder;
-		}
-
-	if (iProgress.iEnumerateFolder == KErrNotFound)
-		{
-		//Create a new folder if last is not found AND aParameter,Length() == 0
-		//Note: CreateNewEnumerateFolderL() sets iSimUtilsData.iLastEnumerateFolder
-		iProgress.iEnumerateFolder = CreateNewEnumerateFolderL();
-		}
-
-	if (iProgress.iEnumerateFolder != iSimUtilsData.iLastEnumerateFolder)
-		{
-		//Delete the last enumerate folder if it is under the SMS service
-		DeleteEnumerateFolderL(iSimUtilsData.iLastEnumerateFolder);
-
-		//Store the enumerate folder for next time
-		iSimUtilsData.iLastEnumerateFolder = iProgress.iEnumerateFolder;
-		StoreSimUtilsDataL();
-		}
-	}
-
-void CSmsSimUtils::DeleteEnumerateFolderL(TMsvId aId)
-/**
- * Deletes entry aId if its parent is iSmsServiceId
- */
-	{
-	SMSSLOG(FLogFormat(_L8("\tAttempting to delete enumerate folder %d"), aId));
-	const TInt err = iServerEntry.SetEntry(aId);
-	
-	if (err != KErrNotFound)
-		{
-		User::LeaveIfError(aId);
-		
-		if (iServerEntry.Entry().Parent() == iSmsServiceId)
-			{
-			SMSSLOG(FLogFormat(_L8("\tDeleting enumerate folder %d"), aId));
-			User::LeaveIfError(iServerEntry.SetEntry(iSmsServiceId));
-			User::LeaveIfError(iServerEntry.DeleteEntry(aId));
-			}
-		}
-	}
-
-void CSmsSimUtils::DeleteChildrenL(TMsvId aId)
-/**
- * Deletes all messages under parent aId
- */
-	{
-	SMSSLOG(FLogFormat(_L8("\tDeleting children from %d"), aId));
-
-	User::LeaveIfError(iServerEntry.SetEntry(aId));
-
-	TMsvSelectionOrdering order;
-	order.SetShowInvisibleEntries(ETrue);
-	iServerEntry.SetSort(order);
-
-	CMsvEntrySelection* sel = new (ELeave) CMsvEntrySelection();
-	CleanupStack::PushL(sel);
-	User::LeaveIfError(iServerEntry.GetChildren(*sel));
-
-	if (sel->Count() != 0)
-		{
-		User::LeaveIfError(iServerEntry.DeleteEntries(*sel));
-		}
-
-	CleanupStack::PopAndDestroy(sel);
-	}
-
-TMsvId CSmsSimUtils::CreateNewEnumerateFolderL()
-/**
- * Creates a new folder under the SMS service where phone-side messages will be stored
- * iSimUtilsData.iLastEnumerateFolder is set to the new folder's ID then stored against the SMS service
- *
- * @return the new folder's ID
- */
-	{
-	SMSSLOG(FLogFormat(_L8("\tCreating new folder...")));
-	User::LeaveIfError(iServerEntry.SetEntry(iSmsServiceId));
-
-	TMsvEntry entry;
-
-	//Create a new invisible folder under the local service
-	entry.SetVisible(EFalse);
-	entry.iType = KUidMsvFolderEntry;
-	entry.iMtm = KUidMsgTypeSMS;
-	entry.iServiceId = iSmsServiceId;
-	User::LeaveIfError(iServerEntry.CreateEntry(entry));
-	iSimUtilsData.iLastEnumerateFolder = entry.Id();
-
-	TRAPD(err, StoreSimUtilsDataL());
-	
-	if (err != KErrNone)
-		{
-		iServerEntry.DeleteEntry(entry.Id()); //remove the folder if StoreSimUtilsDataL() leaves
-		User::Leave(err);
-		}
-
-	return iSimUtilsData.iLastEnumerateFolder;
-	}
-
-void CSmsSimUtils::CountMessagesInPhoneStoresL()
-	{
-	SMSSLOG(FLogFormat(_L8("\tCounting Messages on SIM. Calling Ioctl KIoctlEnumerateSmsMessages")));
-
-	User::LeaveIfError(iServerEntry.SetEntry(KMsvNullIndexEntryId));
-	ConnectL();
-	CreateBioDbL();
-	iSocket.Ioctl(KIoctlEnumerateSmsMessages, iStatus, &iEnumerateCountBuf, KSolSmsProv);
-	SetActive();
-	}
-
-void CSmsSimUtils::CreateBioDbL()
-	{
-	if (iBioDb == NULL)
-		iBioDb = CBIODatabase::NewL(iFs);
-	}
-
-TBool CSmsSimUtils::GetDefaultSendBearerL(TInt aBioType, TBioMsgIdType aBearer, TBioMsgId& rBioMsgId) const
-	{
-	TInt index = 0;
-	TUid uid;
-	uid.iUid = aBioType;
-	TBool found = EFalse;
-	TRAPD(ret,iBioDb->GetBioIndexWithMsgIDL(uid, index)); //leaves with KErrNotFound if aBioType does not exist in bdb
-	if (ret==KErrNone)
-		{
-		const CArrayFix<TBioMsgId>* bioIDs = iBioDb->BIOEntryLC(index);
-		const TInt count = bioIDs->Count();
-
-		for (TInt i = 0; !found && i < count; i++) //order important
-			{
-			rBioMsgId = bioIDs->At(i);
-			found = (rBioMsgId.iType == aBearer);
-			}
-
-		CleanupStack::PopAndDestroy(); // bioIDs
-		}
-	else if (ret!=KErrNotFound)
-		User::LeaveIfError(ret);
-	return found;
-	}
-
-TUid CSmsSimUtils::DecodeBioMessageL(TBioMsgId& rId)
-	{
-	TUid biomsguid=KNullUid;
-	rId.iType=EBioMsgIdNbs;
-	// Take text off front of message
-	CSmsMessage& smsmessage=iHeader->Message();
-	const TInt length=smsmessage.Buffer().Length();
-	smsmessage.Buffer().Extract(rId.iText,0,length<KMaxBioIdText? length: KMaxBioIdText);
-	TInt originator;
-	TInt destination;
-	// Has the message got application port addressing?
-	if (smsmessage.SmsPDU().ApplicationPortAddressing(destination,originator))
-		{
-		rId.iPort=STATIC_CAST(TUint16,destination);
-		rId.iType=EBioMsgIdWap;
-		// Is it WAP?
-		if (iBioDb->IsBioMessageL(rId,biomsguid)==KErrNotFound)
-			{
-			rId.iType=EBioMsgIdWapSecure;
-			// Is it WAP secure?
-			if (iBioDb->IsBioMessageL(rId,biomsguid)==KErrNotFound)
-				{
-				rId.iType=EBioMsgIdWsp;
-				// Is it WSP?
-				if(iBioDb->IsBioMessageL(rId,biomsguid)==KErrNotFound)
-					{
-					rId.iType=EBioMsgIdWspSecure;
-					// Is it WSP secure?
-					iBioDb->IsBioMessageL(rId,biomsguid);
-					}
-				}
-			}
-		}
-	else
-		{
-		// Is it an NBS style text message?
-		TInt index=rId.iText.Locate('\r');
-		if (index==KErrNotFound)
-			index=rId.iText.Locate('\n');
-		// Look for text match in BIO database
-		if ((index>0) && (iBioDb->IsBioMessageL(EBioMsgIdNbs,rId.iText.Left(index),0,biomsguid) != KErrNotFound))
-			smsmessage.Buffer().DeleteL(0,index+1);  // Remove BIO text
-		}
-	iHeader->SetBioMsgIdType(rId.iType);
-	return biomsguid;
-	}
-
-void CSmsSimUtils::EncodeBioMessageL()
-	{
-	CSmsMessage& smsmessage=iHeader->Message();
-	TBioMsgId bioMsgId;
-	//  Is it a BIO message?  
-		if (GetDefaultSendBearerL(iServerEntry.Entry().iBioType, iHeader->BioMsgIdType(), bioMsgId))
-		{
-		switch (bioMsgId.iType)
-			{
-			case EBioMsgIdNbs:
-				{
-				// Put text on NBS message
-				TBioMsgIdText text;
-				CSmsBufferBase& buffer=smsmessage.Buffer();
-				TInt textlength=bioMsgId.iText.Length();
-				buffer.Extract(text,0,textlength<buffer.Length()? textlength: 0);
-				if (bioMsgId.iText.CompareF(text))
-					{
-					_LIT(KSmsNewLine,"\n");
-					buffer.InsertL(0,KSmsNewLine);
-					buffer.InsertL(0,bioMsgId.iText);
-					}
-				break;
-				}
-			case EBioMsgIdWap:
-			case EBioMsgIdWapSecure:
-			case EBioMsgIdWsp:
-			case EBioMsgIdWspSecure:
-				{
-				// Put port addressing on binary messages 
-				smsmessage.SmsPDU().SetApplicationPortAddressingL(ETrue,bioMsgId.iPort,bioMsgId.iPort,bioMsgId.iPort>255);
-				smsmessage.SmsPDU().SetAlphabet(TSmsDataCodingScheme::ESmsAlphabet8Bit);
-				}
-			default:
-				break;
-			}
-		}
-	}
-
-void CSmsSimUtils::SetupMoveDeleteL(const CMsvEntrySelection& aSelection, TRequestStatus& aStatus)
-	{
-	__ASSERT_DEBUG(aSelection.Count(), Panic(KSmssPanicNoMessagesInSelection));
-
-	Queue(aStatus);
-	iProgress = TSmsProgress();
-
-	if (iSelection != &aSelection)
-		{
-		delete iSelection;
-		iSelection = NULL;
-		iSelection = aSelection.CopyL();
-		iSelection->Delete(0);  // Remove the SMS service entry id
-		}
-
-	iProgress.iMsgCount = iSelection->Count();
-	}
-
-void CSmsSimUtils::DeleteEachMessageFromPhoneStoreL()
-	{
-	iState = ESimUtilsStateOther;
-
-	if (iProgress.iMsgDone < iProgress.iMsgCount)
-		{
-		ConstructHeaderAndBodyL();
-
-		const TMsvId id = iSelection->At(iProgress.iMsgDone);
-		const TInt err = iServerEntry.SetEntry(id);
-
-		if (err == KErrNone)
-			{
-			CMsvStore* store = iServerEntry.ReadStoreL();
-			CleanupStack::PushL(store);
-
-			store->RestoreBodyTextL(*iBody);
-			iHeader->RestoreL(*store);
-			CleanupStack::PopAndDestroy(); //store
-
-			iProgress.iError = KErrNone;
-
-			SMSSLOG(FLogMessage(iServerEntry.Entry(), iHeader->Message(), iHeader->BioMsgIdType(), KDeleteFromSimLog));
-			SMSSLOG(FLogFormat(_L8("\tDeleting %d from SIM (%d/%d)"), id, iProgress.iMsgDone+1, iProgress.iMsgCount));
-
-			iWriteStream << iHeader->Message();
-			iWriteStream.CommitL();
-			iSocket.Ioctl(KIoctlDeleteSmsMessage, iStatus, NULL, KSolSmsProv);
-			iState = ESimUtilsDeleteEachMessage;
-			}
-		else
-			{
-			SMSSLOG(FLogFormat(_L8("\tIgnoring %d, Error=%d"), id, err));
-			RequestComplete(&iStatus, KErrNone);
-			}
-
-		SetActive();
-		iProgress.iMsgDone++;
-		User::LeaveIfError(iServerEntry.SetEntry(KMsvNullIndexEntryId));
-		}
-	else
-		{
-		iState = ESimUtilsDeletedLastMessage;
-		}
-	}
-
-void CSmsSimUtils::ConstructHeaderAndBodyL()
-	{
-	if (!iParaFormat)
-		iParaFormat = CParaFormatLayer::NewL();
-
-	if (!iCharFormat)
-		iCharFormat = CCharFormatLayer::NewL();
-
-	if (!iBody)
-		iBody = CRichText::NewL(iParaFormat, iCharFormat);
-
-	if (!iHeader)
-		iHeader = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *iBody);
-	}
-
-void CSmsSimUtils::RestoreSimUtilsDataL()
-/**
- * Restore iSimUtilsData from the SMS service entry
- * Does not attempt to restore if the stream is not present
- */
-	{
-	User::LeaveIfError(iServerEntry.SetEntry(iSmsServiceId));
-	CMsvStore* store = iServerEntry.ReadStoreL();
-	CleanupStack::PushL(store);
-
-	if (iSimUtilsData.IsPresentL(*store))
-		{
-		iSimUtilsData.RestoreL(*store);
-		}
-
-	CleanupStack::PopAndDestroy(store);
-	}
-
-void CSmsSimUtils::StoreSimUtilsDataL()
-/**
- * Store iSimUtilsData against the SMS service entry
- */
-	{
-	User::LeaveIfError(iServerEntry.SetEntry(iSmsServiceId));
-	CMsvStore* store = iServerEntry.EditStoreL();
-	CleanupStack::PushL(store);
-	iSimUtilsData.StoreL(*store);
-	store->CommitL();
-	CleanupStack::PopAndDestroy(store);
-	}
-
-void CSmsSimUtils::DeleteFromPhoneStoreL(const CMsvEntrySelection& aSelection, TRequestStatus& aStatus)
-	{
-	SMSSLOG(FLogFormat(_L8("Deleting %d messages from SIM"), aSelection.Count()));
-
-	SetupMoveDeleteL(aSelection, aStatus);
-	DoDeleteFromPhoneStoreL();
-	}
-
-void CSmsSimUtils::DoDeleteFromPhoneStoreL()
-	{
-	iProgress.iType = TSmsProgress::ESmsProgressTypeDeleteFromPhoneStore;
-	
-	ConnectL();
-	RequestComplete(&iStatus, KErrNone, ETrue);
-	}
-
-void CSmsSimUtils::DoDeleteThenMoveFromPhoneStoreL()
-	{
-	iProgress.iType = TSmsProgress::ESmsProgressTypeMoveFromPhoneStore;
-	
-	ConnectL();
-	RequestComplete(&iStatus, KErrNone, ETrue);
-	}
-
-void CSmsSimUtils::LoadClass2FolderIdL() 
-	{
-	RestoreSmsSettingsL();
-	iClass2Folder = iSettings->Class2Folder();
-	}
-
-void CSmsSimUtils::RestoreSmsSettingsL()
-	{
-	CSmsAccount* account = CSmsAccount::NewLC();
-	// just v2
-	account->LoadSettingsL(*iSettings);
-	CleanupStack::PopAndDestroy(account);    
-	}
-
-void CSmsSimUtils::CopyToPhoneStoreL(const CMsvEntrySelection& aSelection, const TDesC8& /*aParameter*/, TRequestStatus& aStatus)
-	{
-	SMSSLOG(FLogFormat(_L8("Copying messages to SIM")));
-	
-	__ASSERT_DEBUG(aSelection.Count(), Panic(KSmssPanicNoMessagesInSelection));
-	
-	SetupMoveDeleteL(aSelection,aStatus);
-	iProgress.iType = TSmsProgress::ESmsProgressTypeCopyToPhoneStore;
-	iProgress.iMsgCount = iSelection->Count();
-	iProgress.iMsgDone = -1;
-	iState=EWritingToSIM;
-	iRecipientCount = 0;
-	iRecipientIndex = 0;
-
-	LoadClass2FolderIdL();
-
-	ConnectL();
-	ConstructHeaderAndBodyL();
-	CreateBioDbL();
-
-	DoCopyToPhoneStoreL();
-	}
-
-void CSmsSimUtils::MoveToPhoneStoreL(const CMsvEntrySelection& aSelection, const TDesC8& /*aParameter*/, TRequestStatus& aStatus)
-	{
-	SMSSLOG(FLogFormat(_L8("Moving messages to SIM")));
-	
-	__ASSERT_DEBUG(aSelection.Count(), Panic(KSmssPanicNoMessagesInSelection));
-	
-	SetupMoveDeleteL(aSelection,aStatus);
-	iProgress.iType = TSmsProgress::ESmsProgressTypeMoveToPhoneStore;
-	iProgress.iMsgCount = iSelection->Count();
-	iProgress.iMsgDone = -1;
-	iState=EWritingToSIM;
-	iRecipientCount = 0;
-	iRecipientIndex = 0;
-	
-	LoadClass2FolderIdL();
-	
-	ConnectL();
-	ConstructHeaderAndBodyL();
-	CreateBioDbL();
-	
-	DoCopyToPhoneStoreL();
-	}
-
-
-void CSmsSimUtils::DoCopyToPhoneStoreL()
-	{
-	User::LeaveIfError(iServerEntry.SetEntry(KMsvNullIndexEntryId));
-	if(iState==EWritingToSIM)
-		{
-		if (iRecipientCount == 0)
-			++iProgress.iMsgDone;
-
-		if (iProgress.iMsgDone < iProgress.iMsgCount)
-			{
-			User::LeaveIfError(iServerEntry.SetEntry(iSelection->At(iProgress.iMsgDone)));
-
-			CMsvStore* store = iServerEntry.ReadStoreL();
-			CleanupStack::PushL(store);
-
-			iHeader->RestoreL(*store);
-			iBody->Reset();
-			store->RestoreBodyTextL(*iBody);
-
-			CleanupStack::PopAndDestroy(); //store
-
-			// Set correct address on the CSmsMessage if it out going
-			CSmsMessage& smsmessage=iHeader->Message();
-			if (smsmessage.Type()==CSmsPDU::ESmsSubmit || (smsmessage.Type()==CSmsPDU::ESmsCommand))
-				{
-				// Get the count of recipients for the current message
-				if (iRecipientCount == 0)
-					{
-					iRecipientCount = iHeader->Recipients().Count();
-					iRecipientIndex = 0;
-					}
-				// Create separate copy of message for each recipient
-				if (iRecipientCount > 0)
-					{
-					CSmsNumber& rcpt = *iHeader->Recipients().At(iRecipientIndex);
-					iHeader->Message().SetToFromAddressL(rcpt.Address());
-					}
-				++iRecipientIndex;
-				// Check if all the recipients are processed
-				if (iRecipientIndex >= iRecipientCount)
-					{
-					// Yes all are done
-					iRecipientIndex = 0;
-					iRecipientCount = 0;
-					}
-				}
-			SMSSLOG(FLogMessage(iServerEntry.Entry(), iHeader->Message(), iHeader->BioMsgIdType(), KCopyToSimLog));
-
-			smsmessage.SetStorage(CSmsMessage::ESmsSIMStorage);	//Set to store on SIM
-
-			if (iServerEntry.Entry().Unread())
-				{
-				smsmessage.SetStatus(NMobileSmsStore::EStoredMessageUnread);
-				}
-			else
-				{
-				smsmessage.SetStatus(NMobileSmsStore::EStoredMessageRead);
-				}	
-
-			//  This may be a BIO message, so test and set up SMS message correctly!
-			if ((smsmessage.Type()==CSmsPDU::ESmsSubmit) || (smsmessage.Type()==CSmsPDU::ESmsDeliver))
-				EncodeBioMessageL();
-
-			iWriteStream << iHeader->Message();
-			iWriteStream.CommitL();
-			iSocket.Ioctl(KIoctlWriteSmsMessage, iStatus, &iSlotBuffer, KSolSmsProv);
-			SetActive();
-
-			// if we have a class 2 folder, and its not the current parent
-			// then update the class 2 folder with the new message one the sim
-			if(iClass2Folder!=KMsvNullIndexEntryId &&
-				iClass2Folder != iServerEntry.Entry().Parent())
-				iState=EUpdatingClass2;
-			else
-				iState=EWritingToSIM;
-			}
-		}
-	else
-		{
-		__ASSERT_DEBUG(iState==EUpdatingClass2,Panic(ESmssBadState));
-		__ASSERT_DEBUG(iClass2Folder!=KMsvNullIndexEntryId,Panic(ESmssNoClass2Folder));
-		TMsvId toCopy=iSelection->At(iProgress.iMsgDone);
-		User::LeaveIfError(iServerEntry.SetEntry(toCopy));
-
-		// Update the slot array of the CSmsMessage so that
-		// it can be deleted at a later time without the need for a re-enumeration
-		TMsvEntry entry = iServerEntry.Entry();
-		TBool wasReadOnly = entry.ReadOnly();
-
-		if (wasReadOnly)
-			{
-			entry.SetReadOnly(EFalse);
-			iServerEntry.ChangeEntry(entry);
-			}
-
-		CMsvStore* store = iServerEntry.EditStoreL();
-		CleanupStack::PushL(store);
-		iHeader->RestoreL(*store);
-		CSmsMessage& smsmessage=iHeader->Message();
-
-		smsmessage.UpdateSlotsL(iSlotBuffer);
-		smsmessage.SetStorage(CSmsMessage::ESmsSIMStorage);
-		iHeader->StoreL(*store);
-		store->CommitL();
-
-		if (wasReadOnly)
-			{
-			entry.SetReadOnly(ETrue);
-			iServerEntry.ChangeEntry(entry);
-			}
-
-		CleanupStack::PopAndDestroy(store);
-		User::LeaveIfError(iServerEntry.SetEntry(iServerEntry.Entry().Parent()));
-
-		if(iProgress.iType == TSmsProgress::ESmsProgressTypeMoveToPhoneStore) 
-			iServerEntry.MoveEntryL(toCopy,iClass2Folder,iStatus);
-		else
-			iServerEntry.CopyEntryL(toCopy,iClass2Folder,iStatus);
-
-		SetActive();
-		iState=EWritingToSIM;		
-		}
-	}
-
-void CSmsSimUtils::CopyFromPhoneStoreL(const CMsvEntrySelection& aSelection, const TDesC8& aParameter, TRequestStatus& aStatus)
-	{
-	SMSSLOG(FLogFormat(_L8("Copying messages from phone store")));
-	__ASSERT_DEBUG(aSelection.Count(), Panic(KSmssPanicNoMessagesInSelection));
-
-	SetupMoveDeleteL(aSelection, aStatus);
-	iProgress.iType = TSmsProgress::ESmsProgressTypeCopyFromPhoneStore;
-	SetDestination(aParameter);
-	MoveEntriesL(*iSelection, ETrue);
-	}
-
-void CSmsSimUtils::MoveEntriesL(const CMsvEntrySelection& aSelection, TBool aCopy)
-	{
-	// Uses the enumeration folder under the service to copy from
-	User::LeaveIfError(iServerEntry.SetEntry(aSelection[0]));
-	User::LeaveIfError(iServerEntry.SetEntry(iServerEntry.Entry().Parent()));
-	if (aCopy)
-		{
-		if (iCompletedSelection)
-			iCompletedSelection->Reset();
-		else
-			iCompletedSelection = new(ELeave) CMsvEntrySelection;
-
-		iServerEntry.CopyEntriesL(aSelection, iDestination, *iCompletedSelection, iStatus);
-		}
-	else
-		iServerEntry.MoveEntriesL(aSelection, iDestination, iStatus);
-	SetActive();
-	}
-
-void CSmsSimUtils::MoveFromPhoneStoreL(const CMsvEntrySelection& aSelection, const TDesC8& aParameter, TRequestStatus& aStatus)
-	{
-	SMSSLOG(FLogFormat(_L8("Moving messages from phone store")));
-	__ASSERT_DEBUG(aSelection.Count(), Panic(KSmssPanicNoMessagesInSelection));
-
-	SetupMoveDeleteL(aSelection, aStatus);
-	iProgress.iType = TSmsProgress::ESmsProgressTypeMoveFromPhoneStore;
-	SetDestination(aParameter);
-
-	DoDeleteThenMoveFromPhoneStoreL();
-	}
-
-void CSmsSimUtils::SetDestination(const TDesC8& aParameter)
-	{
-	TPckgBuf<TMsvId> pkg;
-	pkg.Copy(aParameter);
-	iDestination = pkg();
-	__ASSERT_DEBUG(iDestination, Panic(KSmssPanicDestinationFolderNotSet));
-	}
-
-void CSmsSimUtils::SetLocalStorageInfoL(const CMsvEntrySelection& aSelection)
-	{
-	// After a copy/move from phone store the iSlotArray and Storage members
-	// need to be reset to reflect the local storage.
-	__ASSERT_DEBUG(aSelection.Count(), Panic(KSmssPanicNoMessagesInSelection));
-	TInt count = aSelection.Count();
-	ConstructHeaderAndBodyL();
-	TBool wasReadOnly = EFalse;
-
-	while (count--)
-		{
-		// RetrieveMessageFromPhoneStoreL() may have set the TMsvEntry
-		// to read only if the message is a CSmsPDU::ESmsSubmit
-		iServerEntry.SetEntry(aSelection.At(count));
-		TMsvEntry entry = iServerEntry.Entry();
-		wasReadOnly = entry.ReadOnly();
-
-		if (wasReadOnly)
-			{
-			entry.SetReadOnly(EFalse);
-			iServerEntry.ChangeEntry(entry);
-			}
-
-		CMsvStore* store = iServerEntry.EditStoreL();
-		CleanupStack::PushL(store);
-		iHeader->RestoreL(*store);
-		CSmsMessage& smsmessage = iHeader->Message();
-
-		// Set the destination attributes
-		smsmessage.SetStorage(CSmsMessage::ESmsPhoneStorage);
-		smsmessage.iSlotArray.Reset();
-
-		iHeader->StoreL(*store);
-		store->CommitL();
-		CleanupStack::PopAndDestroy(store);
-
-		if (wasReadOnly)
-			{
-			entry.SetReadOnly(ETrue);
-			iServerEntry.ChangeEntry(entry);
-			}
-		}
-	}
-
-void CSmsSimUtils::ConnectL()
-	{
-	ConnectL(iSocketServ, iSocket, ESmsAddrLocalOperation);
-	}
-
-void CSmsSimUtils::ConnectL(RSocketServ& arSocketServ, RSocket& arSocket, TSmsAddrFamily aSmsAddrFamily)
-	{
-	if (!arSocketServ.Handle())
-		{
-		User::LeaveIfError(arSocketServ.Connect());
-		}
-
-	TProtocolDesc protoinfo;
-	TProtocolName protocolname(KSmsDatagram);
-	User::LeaveIfError(arSocketServ.FindProtocol(protocolname,protoinfo));
-
-	if (!arSocket.SubSessionHandle())
-		{
-		User::LeaveIfError(arSocket.Open(arSocketServ,protoinfo.iAddrFamily,protoinfo.iSockType,protoinfo.iProtocol));
-		}
-
-	TSmsAddr smsaddr;
-	smsaddr.SetSmsAddrFamily(aSmsAddrFamily);
-	User::LeaveIfError(arSocket.Bind(smsaddr));
-	}
-
-
-CSmsSimUtils::CSmsSimUtils(CMsvServerEntry& aServerEntry, RFs& aFs, TMsvId aSmsServiceId)
-	: CSmssActive(aFs, aServerEntry), 
-	iState(ESimUtilsStateOther), 
-	iReadStream(iSocket),
-	iSmsServiceId(aSmsServiceId),
-	iWriteStream(iSocket)
-	{
-	CActiveScheduler::Add(this);
-	}
-
-void CSmsSimUtils::DoRunReadSimParamsL()
-/**
-	Retrive and store the parameters to the message store. 
-
-	@since			7.0
-	@leave 		KErrNotFound
-	@pre 			The reading async operation is complete.
-	@post			The parameters are retrived and stored in the message store.
- */
-	{
-	iProgress.iMsgDone = iSmsServiceId;
-	
-	CMobilePhoneSmspList* smspList = CMobilePhoneSmspList::NewL();
-	CleanupStack::PushL(smspList);
-		
-	iReadStream >> *smspList;
-	
-	iProgress.iMsgCount = smspList->Enumerate();
-
-	if (!iProgress.iMsgCount)
-		User::Leave(KErrNotFound);
-
-	User::LeaveIfError(iServerEntry.SetEntry(iSmsServiceId));
-
-	CMsvStore* store = iServerEntry.EditStoreL();
-	CleanupStack::PushL(store);
-
-	CSmsSimParamOperation::StoreSimParamsL(*store, *smspList);
-
-	CleanupStack::PopAndDestroy(2); //smspList, store
-	User::LeaveIfError(iServerEntry.SetEntry(KMsvNullIndexEntryId));
-	}
-
-void CSmsSimUtils::DoRunL()
-/**
-	Handles completed async operations
-
-	@since			7.0
-	@leave		ESmscPanicUnexpectedCommand, KErrNone
-	@pre 			The async operation is complete
-	@post			The operation is complete
- */
-	{
-	switch (iProgress.iType)
-		{
-		case TSmsProgress::ESmsProgressTypeCopyFromPhoneStore:
-			{
-			__ASSERT_DEBUG(iCompletedSelection, Panic(KSmssPanicNoMessagesInSelection));
-			SetLocalStorageInfoL(*iCompletedSelection);
-			break;
-			}
-		case TSmsProgress::ESmsProgressTypeWriteSimParams:
-			{
-			break;
-			}
-		case TSmsProgress::ESmsProgressTypeReadSimParams:
-			{
-			if (iReadingSimParams)
-				{
-				iReadingSimParams = EFalse;
-				TRAP(iProgress.iError, DoRunReadSimParamsL());
-				iSocket.Ioctl(KIoctlCompleteReadSmsParams, iStatus, NULL, KSolSmsProv);
-				SetActive();
-				}
-			break;
-			}
-		case TSmsProgress::ESmsProgressTypeEnumeratingPhoneStores:
-			{
-			iProgress.iMsgCount = iEnumerateCountBuf();
-			RetrieveMessageFromPhoneStoreL();
-			break;
-			}
-		case TSmsProgress::ESmsProgressTypeDeleteFromPhoneStore:
-			{
-			DeleteEachMessageFromPhoneStoreL();
-			break;
-			}
-		case TSmsProgress::ESmsProgressTypeMoveFromPhoneStore:
-			{
-			DeleteEachMessageFromPhoneStoreL();
-
-			if (iState == ESimUtilsDeletedLastMessage)
-				{
-				// We have finished deleting the messages from the SIM so set
-				// the Storage & iSlotArray then move the entries
-				SetLocalStorageInfoL(*iSelection);
-				iState = ESimUtilsStateOther;
-				iProgress.iType = TSmsProgress::ESmsProgressTypeMovingEntries;
-				MoveEntriesL(*iSelection, EFalse);
-				}
-			break;
-			}
-		case TSmsProgress::ESmsProgressTypeCopyToPhoneStore:
-		case TSmsProgress::ESmsProgressTypeMoveToPhoneStore:
-			{
-			DoCopyToPhoneStoreL();
-			break;
-			}
-		case TSmsProgress::ESmsProgressTypeMovingEntries:
-			break;
-		default:
-			{
-			Panic(KSmssPanicUnexpectedState);
-			}
-		}
-	}
-
-void CSmsSimUtils::RetrieveMessageFromPhoneStoreL()
-	{
-	// If one message fails to be restored the rest fail 
-	if (iProgress.iMsgDone < iProgress.iMsgCount)
-		{
-		CSmsMessage& smsmessage=iHeader->Message();
-		iReadStream >> smsmessage;
-		
-		TUid biomsguid=KNullUid;
-		TBioMsgId id;
-		if ((smsmessage.Type()==CSmsPDU::ESmsSubmit) || (smsmessage.Type()==CSmsPDU::ESmsDeliver))
-			biomsguid=DecodeBioMessageL(id);
-
-		TMsvEntry entry;
-		RestoreSmsSettingsL();
-		TInt length = iSettings->DescriptionLength();
-		HBufC* buf = HBufC::NewLC(length);
-		TPtr description = buf->Des();	
-
-		if (biomsguid != KNullUid)
-			{
-			TSmsUtilities::PopulateMsgEntry(entry, smsmessage, iSmsServiceId, *iSettings, KUidBIOMessageTypeMtm);
-			
-			// BioficateEntry!!!
-			// Set up all the needed ids
-			entry.iBioType = biomsguid.iUid;
-			entry.iServiceId = KMsvLocalServiceIndexEntryId; 
-			entry.iMtm = KUidBIOMessageTypeMtm;
-
-			// Look up and set the description
-			TInt index;
-			iBioDb->GetBioIndexWithMsgIDL(biomsguid, index);
-			description.Copy(iBioDb->BifReader(index).Description().Left(length));
-			}
-		else
-			{
-			// Set the details
-			TSmsUtilities::PopulateMsgEntry(entry, smsmessage, iSmsServiceId, *iSettings);
-
-			iGetDetDesc->GetDescription(smsmessage, description, length);
-			}
-		
-		entry.iDescription.Set(description);
-
-		if (smsmessage.Status() == NMobileSmsStore::EStoredMessageUnread)
-			entry.SetUnread(ETrue);
-		else
-			entry.SetUnread(EFalse);
-				
-		TBuf<KSmsDetailsLength> details;	
-		if (iGetDetDesc->GetDetails(iFs, smsmessage, details) == KErrNone)
-			entry.iDetails.Set(details);
-
-		User::LeaveIfError(iServerEntry.SetEntry(iProgress.iEnumerateFolder));
-		User::LeaveIfError(iServerEntry.CreateEntry(entry));
-		User::LeaveIfError(iServerEntry.SetEntry(entry.Id()));
-		CMsvStore* store = iServerEntry.EditStoreL();
-		CleanupStack::PushL(store);
-		store->StoreBodyTextL(*iBody);
-		iHeader->StoreL(*store);
-		store->CommitL();
-				
-		if (iHeader->Type() != CSmsPDU::ESmsSubmit)
-			{
-			entry.SetReadOnly(ETrue);
-			}
-		
-		entry.iSize = store->SizeL();
-		CleanupStack::PopAndDestroy(store);
-		User::LeaveIfError(iServerEntry.ChangeEntry(entry));
-
-		SMSSLOG(FLogMessage(entry, iHeader->Message(), iHeader->BioMsgIdType(), KEnumerateSimLog));
-		
-		User::LeaveIfError(iServerEntry.SetEntry(KMsvNullIndexEntryId));
-
-		iSocket.Ioctl(KIoctlReadMessageSucceeded, iStatus, NULL, KSolSmsProv);
-		SetActive();
-			
-		iProgress.iMsgDone++;
-			
-		SMSSLOG(FLogFormat(_L8("\tRead %d from SIM (%d/%d)"), entry.Id(), iProgress.iMsgDone, iProgress.iMsgCount));
-			
-		CleanupStack::PopAndDestroy(buf);
-		}
-	}
-
-void CSmsSimUtils::DoComplete(TInt& aStatus)
-	{
-	if (iState == ESimUtilsDeleteEachMessage && aStatus == KErrNotFound)
-		{
-#ifndef _MSG_NO_LOGGING
-		const TMsvId id = iServerEntry.Entry().Id();
-		_LIT(KLogTxt, "\tERROR: %d NOT deleted from the SIM. Error=KErrNotFound");
-		SMSSLOG(FLogFormat(KDeleteFromSimLog, KLogTxt, id));
-		SMSSLOG(FLogFormat(KLogTxt, id));
-#endif
-
-		TRAP(iProgress.iError, DeleteEachMessageFromPhoneStoreL());
-		}
-	else if (aStatus != KErrNone)
-		{
-		iServerEntry.SetEntry(KMsvNullIndexEntryId);
-		iProgress.iError = aStatus;
-		}
-
-#ifndef _MSG_NO_LOGGING
-	if (!IsActive())
-		SMSSLOG(FLogFormat(_L8("SmsSimUtils completed. Error %d, MsgCount %d, MsgDone %d"), iProgress.iError, iProgress.iMsgCount, iProgress.iMsgDone));
-#endif
-
-	aStatus = KErrNone;
-	}
-
-void CSmsSimUtils::DoSmssCancel()
-	{
-	if (iSocket.SubSessionHandle())
-		iSocket.CancelIoctl();
-	}
-
-
-/**
- * TSmsSimUtilsData
- */
-
-void TSmsSimUtilsData::StoreL(CMsvStore& aStore) const
-	{
-	RMsvWriteStream writeStream;
-	writeStream.AssignLC(aStore, KSmsSimUtilsDataUid);
-	ExternalizeL(writeStream);
-	writeStream.CommitL();
-	CleanupStack::PopAndDestroy(&writeStream);
-	}
-
-void TSmsSimUtilsData::RestoreL(const CMsvStore& aStore)
-	{
-	RMsvReadStream readStream;
-	readStream.OpenLC(aStore, KSmsSimUtilsDataUid);
-	InternalizeL(readStream);
-	CleanupStack::PopAndDestroy(&readStream);
-	}
-
-void TSmsSimUtilsData::ExternalizeL(RWriteStream& aStream) const
-	{
-	aStream.WriteInt16L(KSmsSimUtilsDataVersion);
-	aStream.WriteInt32L(iLastEnumerateFolder);
-	}
-
-void TSmsSimUtilsData::InternalizeL(RReadStream& aStream)
-	{
-	aStream.ReadInt16L(); // version, not used until version > 1
-	iLastEnumerateFolder = aStream.ReadInt32L();
-	}
--- a/messagingappbase/smsmtm/servermtm/src/TextRecipientSend.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,200 +0,0 @@
-// Copyright (c) 1999-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 <e32std.h>
-#include <gsmumsg.h>
-#include <smutset.h>
-#include "SMSRecipientSend.h"
-
-#include <smsuaddr.h>
-#include <smsustrm.h>
-#include <smuthdr.h>
-#include <csmsemailfields.h>
-#include "SmssSimUtils.h"
-#include <msventry.h>
-#include <logwraplimits.h>
-
-#ifndef _MSG_NO_LOGGING
-_LIT(KTextRecipientSendLogFile, "TextSend.txt");
-#endif
-
-CTextRecipientSend* CTextRecipientSend::NewL(TSmsProgress& aProgress, RFs& aFs, CMsvServerEntry& aServerEntry)
-	{
-	CTextRecipientSend* self = new (ELeave) CTextRecipientSend(aProgress, aFs, aServerEntry);
-	CleanupStack::PushL(self);
-
-	self->ConstructL();
-
-	CleanupStack::Pop();
-	return self;
-	}
-
-TBool CTextRecipientSend::AcceptMessage(const TMsvEntry& aEntry, const CSmsHeader& aHeader) const
-	{
-	TBool retVal = (aHeader.BioMsgIdType() == EBioMsgIdNbs);
-
-	if (retVal && aEntry.iBioType)
-		{
-		TInt err = AcceptBioType(aEntry.iBioType, aHeader.BioMsgIdType());
-		retVal = (err == KErrNone);
-		}
-
-	return retVal;
-	}
-
-TBool CTextRecipientSend::AcceptBioMsgId(const TBioMsgId& aBioMsgId) const
-	{
-	return aBioMsgId.iType == EBioMsgIdNbs && aBioMsgId.iPort <= 0 && aBioMsgId.iText.Length();
-	}
-
-CTextRecipientSend::CTextRecipientSend(TSmsProgress& aProgress, RFs& aFs, CMsvServerEntry& aServerEntry)
-: CSmsRecipientSend(aProgress, aFs, aServerEntry)
-	{
-	}
-
-CTextRecipientSend::~CTextRecipientSend()
-	{
-	Cancel();
-	}
-
-void CTextRecipientSend::StartL()
-	{
-	if (iRecipient->LogId() == KLogNullId)
-		AddLogEvent();
-	else
-		GetLogEvent();
-	}
-
-void CTextRecipientSend::PrependNbsStringL(const TMsvEntry& aEntry, CSmsMessage& arMessage, HBufC*& rOldMessage)
-	{
-	rOldMessage = NULL;
-
-	const CSmsEmailFields& fields = iHeader->EmailFields();
-
-	if (aEntry.iBioType)
-		{
-		if( fields.HasAddress() )
-			{
-			// This is a BIO message that has email fields - not supported.
-			User::Leave(KErrNotSupported);
-			}
-			
-		CSmsBufferBase& buffer = arMessage.Buffer();
-		TInt length = buffer.Length();
-		HBufC* oldMessage = HBufC::NewLC(length);
-		TPtr oldPtr(oldMessage->Des());
-		buffer.Extract(oldPtr, 0, length);
-		
-		TBioMsgId bioMsgId;
-		GetDefaultSendBearerL(aEntry.iBioType, EBioMsgIdNbs, bioMsgId); //will leave with KErrNotFound if a bioIdType is not found
-
-		//Only prepend the nbs string if it doesn't exist already
-		if (oldMessage->FindF(bioMsgId.iText) != 0) //case insensitve
-			{
-			length += bioMsgId.iText.Length();
-			length += 1; //for the line feed
-
-			HBufC* newMessage = HBufC::NewLC(length);
-			TPtr newPtr(newMessage->Des());
-
-			newPtr.Append(bioMsgId.iText);
-			newPtr.Append(_L("\n")); //according to the Smart Messaging Spec
-			newPtr.Append(*oldMessage);
-
-			//Pre-pend the string to the CSmsMessage
-			buffer.Reset();
-			buffer.InsertL(0, newPtr);
-
-			CleanupStack::PopAndDestroy(newMessage);
-			CleanupStack::Pop(oldMessage);
-			rOldMessage = oldMessage;
-			}
-		else
-			{
-			CleanupStack::PopAndDestroy(oldMessage);
-			}
-		}
-	else
-		{
-		// Check if this is an email message - just check the email fields have
-		// a length greater than zero. The PID will have been set for email.
-		if( fields.HasAddress() )
-			{
-			__ASSERT_DEBUG( arMessage.SmsPDU().TelematicDeviceType() == TSmsProtocolIdentifier::ESmsInternetElectronicMail, User::Invariant() );
-
-			// Create the email header.
-			HBufC* buf = fields.ComposeLC();
-					
-			// Need to append the email fields to the start of the message body.
-			CSmsBufferBase& body = arMessage.Buffer();
-			body.InsertL(0, *buf);
-			CleanupStack::PopAndDestroy(buf);
-			}
-		}
-	}
-
-void CTextRecipientSend::RevertBackToOldMessageL(const TDesC& aOldMessage, CSmsMessage& arMessage)
-	{
-	CSmsBufferBase& buffer = arMessage.Buffer();
-	buffer.Reset();
-	buffer.InsertL(0, aOldMessage);
-	}
-
-void CTextRecipientSend::SendMessageL()
-	{
-	SMSSLOG(FLogFormat(_L8("CTextRecipientSend::SendMessageL() for msg %d"), iEntry.Id()));
-	//Store the header to preserve the log ID
- 	const TMsvId oldId = iServerEntry.Entry().Id();
- 	User::LeaveIfError(iServerEntry.SetEntry(iEntry.Id()));
- 	StoreHeaderL(*iHeader);
- 	iServerEntry.SetEntry(oldId); //ignore error
-
-	CSmsMessage& message = iHeader->Message();
-
-	HBufC* oldMessage = NULL;
-
-	PrependNbsStringL(iEntry, message, oldMessage);
-
-	if (oldMessage)
-		{
-		CleanupStack::PushL(oldMessage);
-		}
-
-	SMSSLOG(FLogMessage(iEntry, message, iHeader->BioMsgIdType(), KTextRecipientSendLogFile));
-
-	CSmsSimUtils::ConnectL(iSession, iSocket, ESmsAddrSendOnly);
-
-	RSmsSocketWriteStream writestream(iSocket);
-	writestream << message;
-
-	if (oldMessage)
-		{
-		RevertBackToOldMessageL(*oldMessage, message);
-		CleanupStack::PopAndDestroy(); //oldMessage
-		}
-	
-	writestream.CommitL();
-
-	iSocket.Ioctl(KIoctlSendSmsMessage, iStatus,&iSendBuffer, KSolSmsProv);
-
-	iState = ESmsRecipientSendSendingMessage;
-	SetActive();
-	}
-
-void CTextRecipientSend::DoCancelSendingMessage()
-	{
-	SMSSLOG(FLogFormat(_L8("CTextRecipientSend::DoCancelSendingMessage() while sending msg %d"), iEntry.Id()));
-	iSocket.CancelIoctl();
-	}
--- a/messagingappbase/smsmtm/servermtm/src/WapRecipientSend.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,166 +0,0 @@
-// Copyright (c) 2000-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 <e32std.h>
-#include <smuthdr.h>
-#include "SMSSPAN.H"
-#include "SMSRecipientSend.h"
-#include <logwraplimits.h>
-
-#ifndef _MSG_NO_LOGGING
-	_LIT(KWapRecipientSendLogFile, "WapSend.txt");
-#endif
-
-CWapRecipientSend* CWapRecipientSend::NewL(TSmsProgress& aProgress, RFs& aFs, CMsvServerEntry& aServerEntry)
-	{
-	CWapRecipientSend* self = new (ELeave) CWapRecipientSend(aProgress, aFs, aServerEntry);
-	CleanupStack::PushL(self);
-
-	self->ConstructL();
-
-	CleanupStack::Pop();
-	return self;
-	}
-
-TBool CWapRecipientSend::AcceptMessage(const TMsvEntry& aEntry, const CSmsHeader& aHeader) const
-	{
-	TBool retVal = (aEntry.iBioType != 0);
-
-	const TBioMsgIdType bearer = aHeader.BioMsgIdType();
-	
-	if (retVal)
-		{
-		retVal = (bearer == EBioMsgIdWap || bearer == EBioMsgIdWapSecure);
-		retVal |= (bearer == EBioMsgIdNbs && aHeader.Submit().Alphabet() == TSmsDataCodingScheme::ESmsAlphabet7Bit);
-		}
-
-	if (retVal)
-		{
-		TInt err = AcceptBioType(aEntry.iBioType, bearer);
-		retVal = (err == KErrNone);
-		}
-
-	return retVal;
-	}
-
-TBool CWapRecipientSend::AcceptBioMsgId(const TBioMsgId& aBioMsgId) const
-	{
-	TBool retVal = (aBioMsgId.iType == EBioMsgIdWap || aBioMsgId.iType == EBioMsgIdWapSecure);
-
-	if (!retVal)
-		{
-		retVal = (aBioMsgId.iType == EBioMsgIdNbs && !aBioMsgId.iText.Length());
-		}
-
-	retVal &= (aBioMsgId.iPort > 0);
-
-	return retVal;
-	}
-
-
-CWapRecipientSend::CWapRecipientSend(TSmsProgress& aProgress, RFs& aFs, CMsvServerEntry& aServerEntry)
-: CSmsRecipientSend(aProgress, aFs, aServerEntry)
-	{
-	}
-
-void CWapRecipientSend::StartL()
-	{
-	if (iRecipient->LogId() == KLogNullId)
-		{
-		AddLogEvent();
-		}
-	else
-		{
-		GetLogEvent();
-		}
-	}
-
-void CWapRecipientSend::SendMessageL()
-	{
-	SMSSLOG(FLogFormat(_L8("CWapRecipientSend::SendMessageL() for msg %d"), iEntry.Id()));
-
-	__ASSERT_DEBUG(iEntry.iBioType, Panic(KSmssPanicBioTypeNotSet));
-
-	const CSmsMessage& message = iHeader->Message();
-
-	SMSSLOG(FLogMessage(iEntry, message, iHeader->BioMsgIdType(), KWapRecipientSendLogFile));
-
-	//Convert the telephone number to a 8-bit descriptor
-	HBufC8* addr = HBufC8::NewLC(message.ToFromAddress().Length());
-	TPtr8 addrPtr(addr->Des());
-	addrPtr.Copy(message.ToFromAddress());
-
-	//Extract the message from the CSmsMessage
-	const TInt length = message.Buffer().Length();
-	HBufC* msg = HBufC::NewLC(length);
-	TPtr msgPtr(msg->Des());
-	message.Buffer().Extract(msgPtr, 0, length);
-
-	//Convert the message to 8-bit
-	delete iMessage8;
-	iMessage8 = NULL;
-	iMessage8 = HBufC8::NewL(length);
-	TPtr8 msg8Ptr(iMessage8->Des());
-	msg8Ptr.Copy(msgPtr);
-
-	//Get the port number from the BIO Database
-	TBioMsgId bioMsgId;
-	GetDefaultSendBearerL(iEntry.iBioType, iHeader->BioMsgIdType(), bioMsgId);
-	iWapAddr.SetWapAddress(*addr);
-	iWapAddr.SetPort(bioMsgId.iPort);
-
-	if (!iSession.Handle())
-		{
-		User::LeaveIfError(iSession.Connect());
-		}
-
-	if (!iSocket.SubSessionHandle())
-		{
-		User::LeaveIfError(iSocket.Open(iSession, KWAPSMSAddrFamily, KSockDatagram, KWAPSMSDatagramProtocol));
-		}
-
-	//Set the SMS Data Encoding Scheme
-	switch (iHeader->Submit().Alphabet())
-		{
-		case TSmsDataCodingScheme::ESmsAlphabet8Bit:
-			{
-			TWapSmsDataCodingScheme codingScheme = EWapSms8BitDCS;
-			User::LeaveIfError(iSocket.SetOpt(KWapSmsOptionNameDCS,KWapSmsOptionLevel,codingScheme));
-			break;
-			}
-		case TSmsDataCodingScheme::ESmsAlphabet7Bit:
-			break;
-		default:
-			User::Leave(KErrNotSupported);
-		}
-
-	//Send the message
-	iSocket.SendTo(*iMessage8, iWapAddr, 0, iStatus);
-	CleanupStack::PopAndDestroy(2); //addr, msg
-	iState = ESmsRecipientSendSendingMessage;
-	SetActive();
-	}
-
-void CWapRecipientSend::DoCancelSendingMessage()
-	{
-	SMSSLOG(FLogFormat(_L8("CWapRecipientSend::DoCancelSendingMessage() while sending msg %d"), iEntry.Id()));
-	iSocket.CancelSend();
-	}
-
-CWapRecipientSend::~CWapRecipientSend()
-	{
-	Cancel();
-	delete iMessage8;
-	}
--- a/messagingappbase/smsmtm/servermtm/src/smssactive.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,448 +0,0 @@
-// Copyright (c) 1999-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:
-//
-
-#ifdef _DEBUG
-#undef _MSG_NO_LOGGING
-#endif
-
-#include "smssactive.h"
-
-#include <gsmubuf.h>
-#include <msvstd.h>
-#include <smutset.h>
-#include <msventry.h>
-#include <smuthdr.h>
-
-#include "SMSSPAN.H"
-
-
-#ifndef _MSG_NO_LOGGING
-	#include <flogger.h>
-	_LIT(KSmssLogFile, "Smss.txt");
-	_LIT(KSmssLogDir, "Sms");
-	const TInt KSmssLogMaxLength = KLogBufferSize - 22;
-	/**
-	Names for Multimode ETel sub-sessions
-	*/
-	_LIT(KETelMeSmsStore,"S13");
-	_LIT(KETelIccSmsStore,"S14");
-	_LIT(KETelCombinedSmsStore,"S15");
-#endif
-
-
-
-CSmssActive::CSmssActive(RFs& aFs, CMsvServerEntry& aServerEntry, TInt aPriority)
-: CActive(aPriority), iFs(aFs), iServerEntry(aServerEntry)
-	{
-	}
-
-CSmssActive::~CSmssActive()
-	{
-#ifndef _MSG_NO_LOGGING
-	delete iLastLogFile;
-
-	if (iFlogger.LogValid())
-		iFlogger.CloseLog();
-
-	iFlogger.Close();
-#endif
-	}
-
-void CSmssActive::RequestComplete(TRequestStatus* aStatus, TInt aError, TBool aSetActive)
-	{
-	User::RequestComplete(aStatus, aError);
-
-	if (aSetActive)
-		{
-		SetActive();
-		}
-	}
-
-void CSmssActive::Queue(TRequestStatus& aStatus)
-//
-// call this last when an asynch operation has been requested
-//
-	{
-	__ASSERT_DEBUG(iReport==NULL, Panic(KSmssPanicAlreadyActive));
-
-	aStatus=KRequestPending;
-	iReport=&aStatus;
-	}
-
-void CSmssActive::DoCancel()
-//
-// must be called at end of derived classes DoCancel()
-//
-	{
-	DoSmssCancel();
-	TInt result=KErrCancel;
-	Complete(result);	// can be done safely as asynch reporting
-	}
-
-TInt CSmssActive::RunError(TInt aError)
-	{
-	Complete(aError);
-	return KErrNone;
-	}
-
-void CSmssActive::RunL()
-	{
-	User::LeaveIfError(iStatus.Int()); //This will be traped by RunError().
-
-	DoRunL();
-
-	if (!IsActive())
-		Complete(iStatus.Int());
-	}
-
-TInt CSmssActive::Complete(TInt aStatus)
-	{
-	if (iReport)
-		{
-		const TBool isCancelling = (aStatus == KErrCancel);
-
-		DoComplete(aStatus);
-
-		if (!IsActive() || isCancelling)
-			{
-			User::RequestComplete(iReport, aStatus);
-			iReport = NULL;
-			}
-		}
-
-	return aStatus;
-	}
-
-TBool CSmssActive::CanSendMessage(const TMsvEntry& aEntry) const
-	{
-	TBool retVal = ETrue;
-	switch (aEntry.SendingState())
-		{
-		case KMsvSendStateSuspended:
-		case KMsvSendStateSent:
-		case KMsvSendStateNotApplicable:
-			retVal = EFalse;
-			break;
-		default:
-			break;
-		}
-
-	return retVal;
-	}
-
-TBool CSmssActive::CanSendMessageToRecipient(const TMsvEntry& aEntry, const CSmsNumber& aRcpt) const
-	{
-	return (aRcpt.Status() != CMsvRecipient::ESentSuccessfully) && CanSendMessage(aEntry);
-	}
-
-#ifndef _MSG_NO_LOGGING
-TInt CSmssActive::FLogMessage(const TMsvEntry& aEntry, const CSmsMessage& aSmsMessage, TBioMsgIdType aBearer, const TDesC& aFile)
-	{
-	TRAPD(err, DoFLogMessageL(aEntry, aSmsMessage, aBearer, aFile));
-	return err;
-	}
-
-void CSmssActive::DoFLogMessageL(const TMsvEntry& aEntry, const CSmsMessage& aSmsMessage, TBioMsgIdType aBearer, const TDesC& aFile)
-	{
-	if (!IsLogging(aFile))
-		return;
-	
-	TBuf8<32> temp;
-	TBuf16<32> temp1;
-	TPtrC temp2;
-	
-	switch (aSmsMessage.Type())
-		{
-		case CSmsPDU::ESmsSubmit:
-			temp = _L8("[Submit%d]");
-			break;
-		case CSmsPDU::ESmsDeliver:
-			temp = _L8("[Deliver%d]");
-			break;
-		default:
-			temp = _L8("[Message%d]");
-			break;
-		}
-
-	FLogFormat(aFile, temp, aEntry.Id());
-
-	TInt length = aSmsMessage.Buffer().Length();
-	HBufC* hBuf = HBufC::NewLC(32 + length);
-	TPtr buf(hBuf->Des());
-	aSmsMessage.Buffer().Extract(buf, 0, length);
-	buf.Insert(0, _L("Message= "));
-	FLog(aFile, buf, EFalse);
-	CleanupStack::PopAndDestroy(hBuf);
-	hBuf = NULL;
-
-	temp2.Set(aSmsMessage.ToFromAddress());
-	FLogFormat(aFile, _L("Recipients= %S"), &temp2);
-
-	temp2.Set(aSmsMessage.ServiceCenterAddress());
-	FLogFormat(aFile, _L("SC= %S"), &temp2);
-
-	FLogFormat(aFile, _L("BioUid= %d"), aEntry.iBioType);
-
-	const CSmsPDU& pdu = aSmsMessage.SmsPDU();
-
-	if (pdu.DataCodingSchemePresent())
-		{
-		temp.Zero();
-		temp.Append(_L8("Encoding= "));
-
-		switch (pdu.Alphabet())
-			{
-			case TSmsDataCodingScheme::ESmsAlphabet7Bit:
-				temp.Append(_L8("7"));
-				break;
-			case TSmsDataCodingScheme::ESmsAlphabet8Bit:
-				temp.Append(_L8("8"));
-				break;
-			case TSmsDataCodingScheme::ESmsAlphabetUCS2:
-				temp.Append(_L8("16"));
-				break;
-			default:
-				temp.Append(_L8("Unsupported"));
-				break;
-			}
-
-		FLogFormat(aFile, temp);
-		}
-
-	if (aSmsMessage.Type() == CSmsPDU::ESmsSubmit)
-		{
-		temp.Zero();
-		temp.Append(_L8("DeliveryReport= "));
-
-		const CSmsSubmit& submit = (CSmsSubmit&) pdu;
-		if (submit.StatusReportRequest())
-			{
-			temp.Append(_L8("YES"));
-			}
-		else
-			{
-			temp.Append(_L8("NO"));
-			}
-
-		FLogFormat(aFile, temp);
-		}
-	
-	temp.Zero();
-	temp.Append(_L("Bearer= "));
-	
-	switch (aBearer)
-		{
-		case EBioMsgIdNbs:
-			temp.Append(_L("NBS"));
-			break;
-		case EBioMsgIdWap:
-			temp.Append(_L("WAP"));
-			break;
-		case EBioMsgIdWapSecure:
-			temp.Append(_L("WAPSE"));
-			break;
-		default:
-			temp.Append(_L("UnSup"));
-			break;
-		}
-
-	FLogFormat(aFile, temp);
-	
-	temp1.Zero();
-	temp1.Append(_L("Storage= "));
-
-	switch (aSmsMessage.Storage())
-		{
-		case CSmsMessage::ESmsSIMStorage:
-			temp1.Append(KETelIccSmsStore);
-			break;
-		case CSmsMessage::ESmsPhoneStorage:
-			temp1.Append(KETelMeSmsStore);
-			break;
-		case CSmsMessage::ESmsCombinedStorage:
-			temp1.Append(KETelCombinedSmsStore);
-			break;
-		case CSmsMessage::ESmsNoStorage:
-		default:
-			temp1.Append(_L("NONE"));
-		};
-
-	FLogFormat(aFile, temp1);
-	FLogFormat(aFile, KNullDesC);
-	}
-
-void CSmssActive::FLog(const TDesC& aFile, const TDesC& aInputLine, TBool aIgnoreLineBreaks)
-	{
-	if (!IsLogging(aFile))
-		return;
-
-	TPtrC str(aInputLine);
-	TInt length = str.Length();
-
-	if (aIgnoreLineBreaks)
-		{
-		//Ignore trailing spaces
-		while (length--)
-			{
-			const TChar ch(str[length]);
-			if (!ch.IsSpace())
-				{
-				break;
-				}
-			}
-
-		length++;
-		str.Set(aInputLine.Left(length));
-
-		//Break the message up and print only 255 chars at a time
-		TInt start = 0;
-
-		while (start < length)
-			{
-			TPtrC buf(str.Mid(start, Min(KSmssLogMaxLength, length - start)));
-			iFlogger.Write(buf);
-			start += KSmssLogMaxLength;
-			}
-		}
-	else
-		{
-		//Log each line in aInputLine individually
-		while (length > 0)
-			{
-			TInt find = str.Locate('\n');
-
-			if (find == KErrNotFound)
-				{
-				FLog(aFile, str, ETrue);
-				break;
-				}
-			else
-				{
-				if (find == 0)
-					FLog(aFile, KNullDesC, ETrue);
-				else
-					FLog(aFile, str.Left(find), ETrue);
-
-				if (find < length - 1)
-					str.Set(str.Mid(find + 1));
-				else
-					break;
-				}
-
-			length = str.Length();
-			}
-		}
-	}
-
-void CSmssActive::FLog(const TDesC& aInputLine, TBool aIgnoreLineBreaks)
-	{
-	FLog(KSmssLogFile, aInputLine, aIgnoreLineBreaks);
-	}
-
-void CSmssActive::FLogFormat(const TDesC& aFile, TRefByValue<const TDesC> aFormat, ...)
-	{
-	VA_LIST list;
-	VA_START(list, aFormat);
-	FLogFormat(aFile, aFormat, list);
-	}
-
-void CSmssActive::FLogFormat(const TDesC& aFile, TRefByValue<const TDesC> aFormat, VA_LIST& aList)
-	{
-	if (!IsLogging(aFile))
-		return;
-
-	iFlogger.WriteFormat(aFormat, aList);
-	}
-
-
-void CSmssActive::FLogFormat(TRefByValue<const TDesC> aFormat, ...)
-	{
-	VA_LIST list;
-	VA_START(list, aFormat);
-	FLogFormat(KSmssLogFile, aFormat, list);
-	}
-
-void CSmssActive::FLogFormat(const TDesC& aFile, TRefByValue<const TDesC8> aFormat, ...)
-	{
-	VA_LIST list;
-	VA_START(list, aFormat);
-	FLogFormat(aFile, aFormat, list);
-	}
-
-void CSmssActive::FLogFormat(const TDesC& aFile, TRefByValue<const TDesC8> aFormat, VA_LIST& aList)
-	{
-	if (!IsLogging(aFile))
-		return;
-	
-	iFlogger.WriteFormat(aFormat, aList);
-	}
-
-
-void CSmssActive::FLogFormat(TRefByValue<const TDesC8> aFormat, ...)
-	{
-	VA_LIST list;
-	VA_START(list, aFormat);
-	FLogFormat(KSmssLogFile, aFormat, list);
-	}
-
-TBool CSmssActive::IsLogging(const TDesC& aFile)
-	{
-	return (ConstructFlogger(aFile) == KErrNone);
-	}
-
-TInt CSmssActive::ConstructFlogger(const TDesC& aFile)
-	{
-	TRAPD(err, DoConstructFloggerL(aFile));
-	return err;
-	}
-
-void CSmssActive::DoConstructFloggerL(const TDesC& aFile)
-	{
-	if (iFlogger.Handle() == NULL)
-		User::LeaveIfError(iFlogger.Connect());
-
-	if (iLastLogFile == NULL || *iLastLogFile != aFile)
-		{
-		if (iFlogger.LogValid())
-			iFlogger.CloseLog();
-
-		delete iLastLogFile;
-		iLastLogFile = NULL;
-		iLastLogFile = aFile.AllocL();
-		iFlogger.CreateLog(KSmssLogDir, aFile, EFileLoggingModeAppend);
-		}
-
-	if (!iFlogger.LogValid())
-		User::Leave(KErrNotFound);
-	}
-#endif
-
-
-void CSmssActive::ChangeEntryL(const TMsvEntry& aNewEntry)
- 	{
- 	__ASSERT_DEBUG(iServerEntry.Entry().Id() == aNewEntry.Id(), Panic(ESmssEntryNotSet));
- 
- 	if (!(aNewEntry == iServerEntry.Entry()))
- 		User::LeaveIfError(iServerEntry.ChangeEntry(aNewEntry));
- 	}
- 
-void CSmssActive::StoreHeaderL(const CSmsHeader& aNewHeader)
-	{
- 	CMsvStore* msvStore = iServerEntry.EditStoreL();
- 	CleanupStack::PushL(msvStore);
- 	aNewHeader.StoreL(*msvStore);
- 	msvStore->CommitL();
- 	CleanupStack::PopAndDestroy(msvStore);
- 	}
--- a/messagingappbase/smsmtm/smsgetdetdescdefault/group/smsgetdetdescdefault.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-// Copyright (c) 2006-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:
-// Default implementation of ECOM interface to create the 
-// details and description values for an SMS.
-// 
-//
-
-/**
- @file
-*/
-
-TARGET		smsgetdetdescdefault.dll
-TARGETTYPE	PLUGIN
-
-// UIDs - UID #2 specifies an ECom dll, UID #3 is implementation specific UID
-UID		0x10009D8D 0x10282FA6
-
-CAPABILITY	All -TCB
-VENDORID 	0x70000001
-
-VERSION 	10.0
-PAGED
-
-USERINCLUDE	../inc
-APP_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE /epoc32/include/ecom
-
-SOURCEPATH	../src
-SOURCE		csmsgetdetdescdefault.cpp
-
-LIBRARY		euser.lib ecom.lib mtur.lib smcm.lib
-
-SOURCEPATH	../src
-start resource 	10282fa6.rss
-TARGET		smsgetdetdescdefault.rsc
-end
-
-SMPSAFE
--- a/messagingappbase/smsmtm/smsgetdetdescdefault/inc/csmsgetdetdescdefault.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-// Copyright (c) 2006-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 __CSMSGETDETDESCDEFAULT_H__
-#define __CSMSGETDETDESCDEFAULT_H__
-
-#include <csmsgetdetdescinterface.h>
-
-/**
-Default ECOM interface implementation for the routines used to create 
-the details and description values for an SMS.
-@internalTechnology
-@released
-*/
-class CSmsGetDetDescDefault : public CSmsGetDetDescInterface
-	{
-public:
-	static CSmsGetDetDescDefault* NewL();
-	virtual ~CSmsGetDetDescDefault();
-
-	virtual TInt GetDetails(RFs& aFs, const CSmsMessage& aMessage, TDes& aDetails, TInt aMaxLength);
-	virtual TInt GetDetails(RFs& aFs, const TDesC& aFromAddress, TDes& aDetails, TInt aMaxLength);
-	virtual TInt GetDescription(const CSmsMessage& aMessage, TDes& aDescription, TInt aMaxLength);
-
-private:
-	CSmsGetDetDescDefault();
-	};
-
-#endif // __CSMSGETDETDESCDEFAULT_H__
--- a/messagingappbase/smsmtm/smsgetdetdescdefault/src/10282fa6.rss	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-// Copyright (c) 2006-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:
-// Registry file for default implementation of sms Get Details/Description utility plugin.
-// Interfaces : CSmsGetDetDescDefault
-// 
-//
-
-#include <ecom/registryinfo.rh>
-
-RESOURCE REGISTRY_INFO theInfo
-	{
-	// The DLL UID
-	dll_uid = 0x10282FA6;
-	interfaces = 
-		{
-		INTERFACE_INFO
-			{
-			// KUidSmsGetDetDescInterface
-			interface_uid = 0x10282FA5;
-			implementations = 
-				{
-				IMPLEMENTATION_INFO
-					{
-					// Use the DLL UID.
-					implementation_uid = 0x10282FA6;
-					version_no = 1;
-					display_name = "SMS GetDetDesc Default";
-					default_data = "";
-					opaque_data = "";
-					}
-				};
-			}
-		};
-	}
-
--- a/messagingappbase/smsmtm/smsgetdetdescdefault/src/csmsgetdetdescdefault.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-// Copyright (c) 2006-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 <ecom/implementationproxy.h>
-#include "csmsgetdetdescdefault.h"
-
-// Define the implementation table for Ecom
-const TImplementationProxy ImplementationTable[] = 
-	{
-	IMPLEMENTATION_PROXY_ENTRY(0x10282FA6, CSmsGetDetDescDefault::NewL)
-	};
-
-/**
-Returns the implementation table
-
-@param aTableCount Returns the number of entries in the implementation table
-@return Ptr to implementation table
-*/
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
-	{
-	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
-
-	return ImplementationTable;
-	}
-
-/**
-Static factory constructor
-
-@return Ptr to newly created instance of the class
-*/
-CSmsGetDetDescDefault* CSmsGetDetDescDefault::NewL()
-	{
-	CSmsGetDetDescDefault* self = new (ELeave) CSmsGetDetDescDefault();	
-	return self;
-	}
-
-/**
-Class constructor
-*/
-CSmsGetDetDescDefault::CSmsGetDetDescDefault()
-	{
-	}
-
-/**
-Class destructor
-*/
-CSmsGetDetDescDefault::~CSmsGetDetDescDefault()
-	{
-	}
-
-/**
-Get the SMS message recipient/sender details.
-This default version just makes a call to TSmsUtilities::GetDetails()
-
-@param aFs A connected file server session.
-@param aMessage The SMS message object
-@param aDetails The output argument to contain the message details.
-@param aMaxLength The maximum length of the supplied buffer in aDetails.
-
-@return System wide error code
-*/
-TInt CSmsGetDetDescDefault::GetDetails(RFs& aFs, const CSmsMessage& aMessage, TDes& aDetails, TInt aMaxLength)
-	{
-	return TSmsUtilities::GetDetails(aFs, aMessage, aDetails, aMaxLength);
-	}
-
-/**
-Get the SMS message recipient/sender details.
-This default version just makes a call to TSmsUtilities::GetDetails()
-
-@param aFs A connected file server session.
-@param aFromAddress The recipient/sender telephone number.
-@param aDetails The output argument to contain the message details.
-@param aMaxLength The maximum length of the supplied buffer in aDetails.
-
-@return System wide error code
-*/
-TInt CSmsGetDetDescDefault::GetDetails(RFs& aFs, const TDesC& aFromAddress, TDes& aDetails, TInt aMaxLength)
-	{
-	return TSmsUtilities::GetDetails(aFs, aFromAddress, aDetails, aMaxLength);
-	}
-
-/**
-Get the SMS message description.
-This default version just makes a call to TSmsUtilities::GetDescription()
-
-@param aMessage The SMS message object
-@param aDescription The output argument for the description.
-@param aMaxLength The maximum length of the supplied buffer in aDescription.
-
-@return System wide error code
-*/
-TInt CSmsGetDetDescDefault::GetDescription(const CSmsMessage& aMessage, TDes& aDescription, TInt aMaxLength)
-	{
-	return TSmsUtilities::GetDescription(aMessage, aDescription, aMaxLength);
-	}
--- a/messagingappbase/smsmtm/test/class0smsnotifier/group/class0smsTxtnotifier.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies 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 0 sms text Notier
-// 
-//
-
-/**
- @file
-*/
-
-TARGET		class0smstxtnotifier.dll
-TARGETTYPE	TEXTNOTIFIER2
-
-UID	 0x101fe38b 0x2000C610  	
-VENDORID 0x70000001
-
-CAPABILITY ALL -TCB
-
-USERINCLUDE		../inc 
-SYSTEMINCLUDE	/epoc32/include
-
-SOURCEPATH	../src
-SOURCE		class0smsTxtnotifier.cpp
-
-LIBRARY		euser.lib msgs.lib efsrv.lib estor.lib
-
-TARGETPATH      /sys/bin/tnotifiers
-
-SMPSAFE
--- a/messagingappbase/smsmtm/test/class0smsnotifier/group/class0smsUINotifier.iby	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +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 __CLASS0SMSUINOTIFIER_IBY__
-#define __CLASS0SMSUINOTIFIER_IBY__
-
-REM The Class0SMS UI Notifier
-
-ECOM_PLUGIN(class0smsUInotifier.dll, 2000C382.rsc)
-
-file=ABI_DIR\DEBUG_DIR\class0smsTxtnotifier.dll                 sys\bin\tnotifiers\class0smsTxtnotifier.dll
-
-#endif
--- a/messagingappbase/smsmtm/test/class0smsnotifier/group/class0smsUInotifier.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Class0Sms UI Notier
-// 
-//
-
-/**
- @file
-*/
-
-TARGET		class0smsuinotifier.dll
-TARGETTYPE	PLUGIN
-
-USERINCLUDE	    ../inc 
-SYSTEMINCLUDE	/epoc32/include   /epoc32/include/ecom
-
-UID	 0x10009D8D 0x2000C382  
-
-VENDORID 0x70000001
-CAPABILITY ALL -TCB
-
-SOURCEPATH	../src
-SOURCE		class0smsUInotifier.cpp
-
-LIBRARY		euser.lib eiksrv.lib ecom.lib efsrv.lib smcm.lib estor.lib
-	
-
-START resource 2000C382.rss
-TARGET		class0smsuinotifier.rsc
-end
-
-#ifdef WINS 
-DEFFILE		./v2_wins.def
-#else
-DEFFILE		.\v2_eabi.def
-#endif
-
-SMPSAFE
--- a/messagingappbase/smsmtm/test/class0smsnotifier/group/v2_eabiu.def	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-EXPORTS
-	_Z24ImplementationGroupProxyRi @ 1 NONAME
-	_Z13NotifierArrayv @ 2 NONAME
-	_ZTI20CClass0SmsUINotifier @ 3 NONAME
-	_ZTV20CClass0SmsUINotifier @ 4 NONAME
-
--- a/messagingappbase/smsmtm/test/class0smsnotifier/group/v2_winsu.def	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-EXPORTS
-	?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &)
-	?NotifierArray@@YAPAV?$CArrayPtr@VMEikSrvNotifierBase2@@@@XZ @ 2 NONAME ; class CArrayPtr<class MEikSrvNotifierBase2> * NotifierArray(void)
-
--- a/messagingappbase/smsmtm/test/class0smsnotifier/inc/class0smsTxtnotifier.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// class0smsnotifier.h
-// 
-//
-
-#ifndef __CLASS0SMSNOTIFIER_H__
-#define __CLASS0SMSNOTIFIER_H__
-
-#include <twintnotifier.h>
-#include <msvapi.h>
-
-
-
-class CClass0SmsTxtNotifier : /* public CBase, */ public MNotifierBase2
-	{
-public:
-	//	Construction
-	static CClass0SmsTxtNotifier* NewL();
-	~CClass0SmsTxtNotifier();
-
-private:
-	CClass0SmsTxtNotifier();
-	void ConstructL();
-
-	//	From MNotifierBase2
-	virtual void Release();
-	virtual TNotifierInfo RegisterL();
-	virtual TNotifierInfo Info() const;
-	virtual TPtrC8 StartL(const TDesC8& aBuffer);
-	virtual void StartL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
-	virtual void Cancel();
-	virtual TPtrC8 UpdateL(const TDesC8& aBuffer);
-	void CreateFile(const TDesC8& aBuff);
-
-private:
-	TNotifierInfo iInfo;
-	RMessagePtr2  iMessage;
-	TInt		  iReplySlot;
-	TSecurityInfo iSecurityInfo;
-
-	};
-
-#endif	// __CLASS0SMSNOTIFIER_H__
-
-
--- a/messagingappbase/smsmtm/test/class0smsnotifier/inc/class0smsUInotifier.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies 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 __CLASS0SMSUINOTIFIER_H__
-#define __CLASS0SMSUINOTIFIER_H__
-
-#include <eiknotapi.h>
-#include <msvapi.h>
-#include <ecom/ecom.h>
-class CMsvEntrySelection;
-
-const TUint KCountServMajorVersionNumber=0;
-const TUint KCountServMinorVersionNumber=1;
-const TUint KCountServBuildVersionNumber=1;
-
-//_LIT(KDummyServerName, "DummyServer");
-//_LIT(KDummyServerExe, "Dummyserver.exe");
-
-
-
-class CClass0SmsUINotifier : /*public CBase, */ public MEikSrvNotifierBase2
-	{
-public:
-	//	Construction
-	static CClass0SmsUINotifier* NewL();
-	~CClass0SmsUINotifier();
-private:
-	CClass0SmsUINotifier();
-	void ConstructL();
-
-	//	From MEikSrvNotifierBase2
-	virtual void Release();
-	virtual TNotifierInfo RegisterL();
-	virtual TNotifierInfo Info() const;
-	virtual TPtrC8 StartL(const TDesC8& aBuffer);
-	virtual void StartL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
-	virtual void Cancel();
-	virtual TPtrC8 UpdateL(const TDesC8& aBuffer);
-	void CreateFile(const TDesC8& aBuffer);
-
-private:
-	TNotifierInfo iInfo;
-	RMessagePtr2  iMessage;
-	TInt		  iReplySlot;
-	TSecurityInfo iSecurityInfo;
-	};
-
-#endif	// __CLASS0SMSUINOTIFIER_H__
-
-
-
-
--- a/messagingappbase/smsmtm/test/class0smsnotifier/src/2000C382.rss	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies 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 <ecom/registryinfo.rh>
-#include "uikon.hrh"
-#include <mtmconfig.rh>
-
-RESOURCE REGISTRY_INFO theInfo
-{
-	dll_uid = 0x2000C382;
-	interfaces =
-	{
-	INTERFACE_INFO
-		{
-		interface_uid = KUikonUidPluginInterfaceNotifiers;
-		implementations =
-			{
-			IMPLEMENTATION_INFO
-				{
-				implementation_uid = 0x2000C612;
-				version_no = 1;
-				display_name = "Class0Sms UI Notifier Plugin 1";
-				default_data = "Class0Sms UI Notifier";
-				opaque_data	 = "0";
-				}
-			};
-		}
-	};
-}
-
--- a/messagingappbase/smsmtm/test/class0smsnotifier/src/class0smsTxtnotifier.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,161 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// class0smsnotifier.cpp
-// 
-//
-
-#include "class0smsTxtnotifier.h"
-#include <tmsvpackednotifierrequest.h>
-#include <gsmubuf.h>
-#include <s32mem.h>
-#include <e32base.h>
-
-
-
-/* UID of Class 0 SMS test notifier */
-const TUid KClass0SmsNotifierPluginUid  = {0x2000C382};
-const TUid KClass0SmsNotifierOutput 	= {0x2000C382};
-
-//class 0 SMS data will be writing to file
-_LIT(KTestClas0Sms, "\\logs\\testexecute\\class0sms.txt");
-
-EXPORT_C CArrayPtr<MNotifierBase2>* NotifierArray()
-	{
-	CArrayPtrFlat<MNotifierBase2>* subjects=NULL;
-	TRAPD( err, subjects=new (ELeave)CArrayPtrFlat<MNotifierBase2>(1) );
-	if( err == KErrNone )
-		{
-		TRAP( err, subjects->AppendL( CClass0SmsTxtNotifier::NewL()) );
-		return(subjects);
-		}
-	else
-		{
-		return NULL;
-		}
-	}
-
-CClass0SmsTxtNotifier* CClass0SmsTxtNotifier::NewL()
-	{
-	CClass0SmsTxtNotifier* self=new (ELeave) CClass0SmsTxtNotifier();
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-	
-void CClass0SmsTxtNotifier::ConstructL()
-	{
-	}
-
-CClass0SmsTxtNotifier::~CClass0SmsTxtNotifier()
-	{
-	}
-
-CClass0SmsTxtNotifier::CClass0SmsTxtNotifier()
-	{
-	iInfo.iUid      = KClass0SmsNotifierPluginUid;
-	iInfo.iChannel  = KClass0SmsNotifierOutput;
-	iInfo.iPriority = ENotifierPriorityHigh;
-	}
-
-void CClass0SmsTxtNotifier::Release()
-	{
-	}
-
-/**
-Called when a notifier is first loaded to allow any initial construction that is required.
- */
-CClass0SmsTxtNotifier::TNotifierInfo CClass0SmsTxtNotifier::RegisterL()
-	{
-	return iInfo;
-	}
-
-CClass0SmsTxtNotifier::TNotifierInfo CClass0SmsTxtNotifier::Info() const
-	{
-	return iInfo;
-	}
-	
-/**
-The notifier has been deactivated so resources can be freed and outstanding messages completed.
- */
-void CClass0SmsTxtNotifier::Cancel()
-	{
-	}
-
-/**
-Start the Notifier with data aBuffer. 
-
-Not used for confirm notifiers
-*/
-TPtrC8 CClass0SmsTxtNotifier::StartL(const TDesC8& aBuffer)
-	{
-	CreateFile(aBuffer);
-	return KNullDesC8(); 
-	}
-	
-/**
-Start the notifier with data aBuffer. aMessage should be completed when the notifier is deactivated.
-
-May be called multiple times if more than one client starts the notifier. The notifier is immediately 
-responsible for completing aMessage.
-*/
-void CClass0SmsTxtNotifier::StartL(const TDesC8& aBuffer, TInt /*aReplySlot*/, const RMessagePtr2& aMessage)
-	{
-	// extract the notifier request parameters
-	CreateFile(aBuffer);
-	aMessage.Complete(KErrNone);
-	}
-	
-/**
-Update a currently active notifier with data aBuffer.
-
-Not used for confirm notifiers
-*/
-TPtrC8 CClass0SmsTxtNotifier::UpdateL(const TDesC8& aBuffer)
-	{
-	CreateFile(aBuffer);
-	return KNullDesC8();
-	}
-
-
-//write received class0sms data to file
-void CClass0SmsTxtNotifier::CreateFile(const TDesC8& aBuff)
-{
-	RFs fs;
-	User::LeaveIfError(fs.Connect());
-	CleanupClosePushL(fs);
-	
-	TInt startPos, endPos;
-	TBool isLastMessage = EFalse;
-	
-	RDesReadStream readStream(aBuff);
-	CleanupClosePushL (readStream);
-		
-	startPos = readStream.ReadInt32L();
-	endPos = readStream.ReadInt32L();
-	isLastMessage = readStream.ReadInt32L();
-	
-	TBuf<1000> smsMsg1;
-	readStream >> smsMsg1;
-		
-	RFile file;
-
-	TPtrC8 smsMsg(REINTERPRET_CAST(const TUint8*, smsMsg1.Ptr()), smsMsg1.Size()); 
-	User::LeaveIfError(file.Replace(fs, KTestClas0Sms, EFileShareAny | EFileWrite));
-	file.Write(smsMsg);
-	
-	file.Close();
-	CleanupStack::PopAndDestroy(&readStream);
-	CleanupStack::PopAndDestroy(&fs);
-}
--- a/messagingappbase/smsmtm/test/class0smsnotifier/src/class0smsUInotifier.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,172 +0,0 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies 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 <ecom/ecom.h>
-#include <tmsvpackednotifierrequest.h>
-#include <ecom/implementationproxy.h>
-#include <gsmubuf.h>
-#include <s32mem.h>
-#include <e32base.h>
-#include "class0smsUInotifier.h"
-
-/* UID of Class 0 SMS test notifier */
-const TUid KClass0SmsNotifierPluginUid  = {0x2000C382};
-const TUid KClass0SmsNotifierOutput 	= {0x2000C382};
-
-//class 0 SMS data will be writing to file
-_LIT(KTestClas0Sms, "\\logs\\testexecute\\class0sms.txt");
-
-EXPORT_C CArrayPtr<MEikSrvNotifierBase2>* NotifierArray()
-	{
-	CArrayPtrFlat<MEikSrvNotifierBase2>* subjects=NULL;
-	TRAPD( err, subjects=new (ELeave)CArrayPtrFlat<MEikSrvNotifierBase2>(1) );
-	if( err == KErrNone )
-		{
-		TRAP( err, subjects->AppendL( CClass0SmsUINotifier::NewL() ) );
-		return(subjects);
-		}
-	else
-		{
-		return NULL;
-		}
-	}
-
-CClass0SmsUINotifier* CClass0SmsUINotifier::NewL()
-	{
-	CClass0SmsUINotifier* self=new (ELeave) CClass0SmsUINotifier();
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-	
-void CClass0SmsUINotifier::ConstructL()
-	{
-	}
-
-CClass0SmsUINotifier::~CClass0SmsUINotifier()
-	{
-	REComSession::FinalClose();
-	}
-
-CClass0SmsUINotifier::CClass0SmsUINotifier()
-	{
-	iInfo.iUid      = KClass0SmsNotifierPluginUid;
-	iInfo.iChannel  = KClass0SmsNotifierOutput;
-	iInfo.iPriority = ENotifierPriorityHigh;
-	}
-
-void CClass0SmsUINotifier::Release()
-	{
-	delete this;
-	}
-
-/**
-Called when a notifier is first loaded to allow any initial construction that is required.
- */
-CClass0SmsUINotifier::TNotifierInfo CClass0SmsUINotifier::RegisterL()
-	{
-	return iInfo;
-	}
-
-CClass0SmsUINotifier::TNotifierInfo CClass0SmsUINotifier::Info() const
-	{
-	return iInfo;
-	}
-	
-/**
-The notifier has been deactivated so resources can be freed and outstanding messages completed.
- */
-void CClass0SmsUINotifier::Cancel()
-	{
-	}
-
-/**
-Start the Notifier with data aBuffer. 
-
-Not used for confirm notifiers
-*/
-TPtrC8 CClass0SmsUINotifier::StartL(const TDesC8& aBuffer)
-	{
-	CreateFile(aBuffer);
-	return KNullDesC8();
-	}
-	
-/**
-Start the notifier with data aBuffer. aMessage should be completed when the notifier is deactivated.
-
-May be called multiple times if more than one client starts the notifier. The notifier is immediately 
-responsible for completing aMessage.
-*/
-void CClass0SmsUINotifier::StartL(const TDesC8& aBuffer, TInt /*aReplySlot*/, const RMessagePtr2&  aMessage)
-	{
-	CreateFile(aBuffer);
-	aMessage.Complete(KErrNone);
-	}
-	
-/**
-Update a currently active notifier with data aBuffer.
-
-Not used for confirm notifiers
-*/
-TPtrC8 CClass0SmsUINotifier::UpdateL(const TDesC8& /*aBuffer*/)
-	{
-	User::Leave(KErrNotSupported);
-	return KNullDesC8();
-	}
-
-
-//Adding ECOM SUPPORT
-const TImplementationProxy ImplementationTable[] =
-	{
-	IMPLEMENTATION_PROXY_ENTRY(0x2000C612, NotifierArray)
-	};
-
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
-	{
-	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
-	return ImplementationTable;
-	}
-
-//write received class0sms data to file
-void CClass0SmsUINotifier::CreateFile(const TDesC8& aBuff)
-{
-	RFs fs;
-	User::LeaveIfError(fs.Connect());
-	CleanupClosePushL(fs);
-	
-	TInt startPos, endPos;
-	TBool isLastMessage = EFalse;
-	
-	RDesReadStream readStream(aBuff);
-	CleanupClosePushL (readStream);
-		
-	startPos = readStream.ReadInt32L();
-	endPos = readStream.ReadInt32L();
-	isLastMessage = readStream.ReadInt32L();
-	
-	TBuf<1000> smsMsg1;
-	readStream >> smsMsg1;
-		
-	RFile file;
-
-	TPtrC8 smsMsg(REINTERPRET_CAST(const TUint8*, smsMsg1.Ptr()), smsMsg1.Size()); 
-	User::LeaveIfError(file.Replace(fs, KTestClas0Sms, EFileShareAny | EFileWrite));
-	file.Write(smsMsg);
-	
-	file.Close();
-	CleanupStack::PopAndDestroy(&readStream);
-	CleanupStack::PopAndDestroy(&fs);
-}
--- a/messagingappbase/smsmtm/test/data/ConfigFiles/14IndicationsConfig.txt	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-[test1]
-
-# Sim.tsy accepts a message sent from the emulator, checks that it is what is expected, and then ACK's.
-# The message should be of the form User name<user@domain1.domain2>
-# ie UserName<testE@test.com>(SubjectEmailTest_2_2)TestText
-
-IndicatorCheckPeriod= 1
-NetworkInfo= TEST, Network0, Test, Test, Test, 5
-RegStatus= 5,5
-
-NotifySignalStrengthChangeCap= 1
-
-SmsControlCaps= 34
-SmsTx= 35000B914411111111F10000AD1D54747A0E4ACF4161D03CDD86B3CB207A194F07B5CBF379F85C06 , +447785016005, 1, 0x0000020C, 0
-	#         r**********        ccm***********************
-	# r =Recipients= +44111111111
-	# cc = message count
-	# m = Message= UserName<testE@test.com>(SubjectEmailTest_2_2)TestText
-	# Note exta E in message to make the number of hex bytes even.
-	#  +447802000332 =  sca = service centre address and is not actually used by the sim.tsy for anything (at the moment).
-	# 1 = MsgRef
-	# 02070100 = SubmitReportPdu. Basically an ACK	
-	# SmsTx	<pdu>, <sca>, <MsgRef> <SubmitReportPdu> <ExpectedError>
-	
-#
-# Should have recieved above message from the emulator to kick off the sending of the next message.
-# This sends a simulated SMS message to the emulator.
-#
-
-SmsControlCaps= 68
-	#SmsControlCaps= caps in DECIMAL
-
-SmsPhoneStoreCaps= 0xFC000000
-	#SmsPhoneStoreCaps= TMobilePhoneCaps in the smsStore in hexadecimal
-SmsStartRxDelay= 4207, 1, 1
-
-#working simple message
-#SmsRx= 240C915348801455820004108071417314801E74657374206D6573736167652C2038626974732C206C656E677468203330, 358405202000
-#contains reply address
-#SmsRx= 640C91534880145582000410807141731480540A22080C914457382957495265706C792061646472657373206D6573736167652E20204D6573736167652077696C6C2062652073656E7420746F206F746865722061646472657373207468616E2073656E646572, 358405202000
-
-#Receive with one of each type of special message IE
-#Voice=8,Fax=3,Email=1,Enhanced=2
-SmsRx= 640C9153488014558200041080714173148071100102800801028103010282010102870254686973206D6573736167652069732061207370656369616C206D6573736167652077616974696E67206D6573736167652E20596F7520686176652061207370656369616C206D6573736167652077616974696E6720666F7220796F75203A29, 358405202000 
-
-
-
-
-	#    ******rec*******                  cc********mes**************
-	# Recipients (rec)= +44111111111
-	# Message (cc (count), mess)= TestTextE_1_2
-
-	# +447802000332 = service centre address.
-
-
--- a/messagingappbase/smsmtm/test/data/ConfigFiles/ReplyToConfig.txt	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-[test1]
-
-# Sim.tsy accepts a message sent from the emulator, checks that it is what is expected, and then ACK's.
-# The message should be of the form User name<user@domain1.domain2>
-# ie UserName<testE@test.com>(SubjectEmailTest_2_2)TestText
-
-IndicatorCheckPeriod= 1
-NetworkInfo= TEST, Network0, Test, Test, Test, 5
-RegStatus= 5,5
-
-NotifySignalStrengthChangeCap= 1
-
-SmsControlCaps= 34
-SmsTx= 35000B914411111111F10000AD1D54747A0E4ACF4161D03CDD86B3CB207A194F07B5CBF379F85C06 , +447785016005, 1, 0x0000020C, 0
-	#         r**********        ccm***********************
-	# r =Recipients= +44111111111
-	# cc = message count
-	# m = Message= UserName<testE@test.com>(SubjectEmailTest_2_2)TestText
-	# Note exta E in message to make the number of hex bytes even.
-	#  +447802000332 =  sca = service centre address and is not actually used by the sim.tsy for anything (at the moment).
-	# 1 = MsgRef
-	# 02070100 = SubmitReportPdu. Basically an ACK	
-	# SmsTx	<pdu>, <sca>, <MsgRef> <SubmitReportPdu> <ExpectedError>
-	
-#
-# Should have recieved above message from the emulator to kick off the sending of the next message.
-# This sends a simulated SMS message to the emulator.
-#
-
-SmsControlCaps= 68
-	#SmsControlCaps= caps in DECIMAL
-
-SmsPhoneStoreCaps= 0xFC000000
-	#SmsPhoneStoreCaps= TMobilePhoneCaps in the smsStore in hexadecimal
-SmsStartRxDelay= 4207, 1, 1
-
-#working simple message
-#SmsRx= 240C915348801455820004108071417314801E74657374206D6573736167652C2038626974732C206C656E677468203330, 358405202000
-#contains reply address
-SmsRx= 640C91534880145582000410807141731480540A22080C914457382957495265706C792061646472657373206D6573736167652E20204D6573736167652077696C6C2062652073656E7420746F206F746865722061646472657373207468616E2073656E646572, 358405202000
-
-#Receive with one of each type of special message IE
-#Voice=8,Fax=3,Email=1,Enhanced=2
-#SmsRx= 640C9153488014558200041080714173148071100102800801028103010282010102870254686973206D6573736167652069732061207370656369616C206D6573736167652077616974696E67206D6573736167652E20596F7520686176652061207370656369616C206D6573736167652077616974696E6720666F7220796F75203A29, 358405202000 
-
-
-
-
-	#    ******rec*******                  cc********mes**************
-	# Recipients (rec)= +44111111111
-	# Message (cc (count), mess)= TestTextE_1_2
-
-	# +447802000332 = service centre address.
-
-
--- a/messagingappbase/smsmtm/test/data/ServerMtm_ErrorRetryHandling.ini	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,474 +0,0 @@
-# ErrorCodeFromSms have the same value as the CDMA network errors specified in etelmmerr.h. These are errors that the SMS stack receive from the network and passed on to messaging
-
-#ErrorAction.Error specifies the decimal value that can be retrieved in iError of CSmsNumber. 
-#The iError is a 32-bits integer is a combined value of error class and cause code and is used for searching the appropriate error action in the smss.rsc resource file					
-#bits 0 - 7 represent the cause code
-#bit 8 and 9 represent the error class: 00 - no error, 10 - temp error, 11 - perm error  
-#if bit 10 is 1, the message is a DACK message
-#if bit 10 is 0, the message is a TACK message
-#e.g. a TACK message with error class 2 and message status code 4 is expressed as 00000110 00000100 as the lowest 16 bits
-
-[ErrorActionsTimeoutError]
-ErrorsFromSmsTotal=1
-DefaultErrorActionIndex=0
-
-ErrorCodeFromSms0=-33
-ErrorAction0.Error=-33
-ErrorAction0.Retries=0
-ErrorAction0.RetrySpacing=0
-ErrorAction0.MaxRetries=3
-ErrorAction0.Action=1
-
-[ErrorActionsErrorClass2And3]
-ErrorsFromSmsTotal=56
-DefaultErrorActionIndex=0
-
-# AddressVacant
-ErrorCodeFromSms0=-3256
-ErrorClassFromSms0=2
-ErrorAction0.Error=512
-ErrorAction0.Retries=0
-ErrorAction0.RetrySpacing=0
-ErrorAction0.MaxRetries=0
-ErrorAction0.Action=0
-
-# AddressTranslation Failure
-ErrorCodeFromSms1=-3256
-ErrorClassFromSms1=3
-ErrorAction1.Error=768
-ErrorAction1.Retries=0
-ErrorAction1.RetrySpacing=0
-ErrorAction1.MaxRetries=0
-ErrorAction1.Action=0
-
-ErrorCodeFromSms2=-3257
-ErrorClassFromSms2=2
-ErrorAction2.Error=513
-ErrorAction2.Retries=0
-ErrorAction2.RetrySpacing=0
-ErrorAction2.MaxRetries=0
-ErrorAction2.Action=0
-
-ErrorCodeFromSms3=-3257
-ErrorClassFromSms3=3
-ErrorAction3.Error=769
-ErrorAction3.Retries=0
-ErrorAction3.RetrySpacing=0
-ErrorAction3.MaxRetries=0
-ErrorAction3.Action=0
-
-ErrorCodeFromSms4=-3258
-ErrorClassFromSms4=2
-ErrorAction4.Error=514
-ErrorAction4.Retries=0
-ErrorAction4.RetrySpacing=0
-ErrorAction4.MaxRetries=0
-ErrorAction4.Action=0
-
-ErrorCodeFromSms5=-3258
-ErrorClassFromSms5=3
-ErrorAction5.Error=770
-ErrorAction5.Retries=0
-ErrorAction5.RetrySpacing=0
-ErrorAction5.MaxRetries=0
-ErrorAction5.Action=0
-
-ErrorCodeFromSms6=-3259
-ErrorClassFromSms6=2
-ErrorAction6.Error=515
-ErrorAction6.Retries=0
-ErrorAction6.RetrySpacing=0
-ErrorAction6.MaxRetries=0
-ErrorAction6.Action=0
-
-ErrorCodeFromSms7=-3259
-ErrorClassFromSms7=3
-ErrorAction7.Error=771
-ErrorAction7.Retries=0
-ErrorAction7.RetrySpacing=0
-ErrorAction7.MaxRetries=0
-ErrorAction7.Action=0
-
-ErrorCodeFromSms8=-3260
-ErrorClassFromSms8=2
-ErrorAction8.Error=516
-ErrorAction8.Retries=0
-ErrorAction8.RetrySpacing=0
-ErrorAction8.MaxRetries=0
-ErrorAction8.Action=0
-
-ErrorCodeFromSms9=-3260
-ErrorClassFromSms9=3
-ErrorAction9.Error=772
-ErrorAction9.Retries=0
-ErrorAction9.RetrySpacing=0
-ErrorAction9.MaxRetries=0
-ErrorAction9.Action=0
-
-ErrorCodeFromSms10=-3261
-ErrorClassFromSms10=2
-ErrorAction10.Error=517
-ErrorAction10.Retries=0
-ErrorAction10.RetrySpacing=0
-ErrorAction10.MaxRetries=0
-ErrorAction10.Action=0
-
-ErrorCodeFromSms11=-3261
-ErrorClassFromSms11=3
-ErrorAction11.Error=773
-ErrorAction11.Retries=0
-ErrorAction11.RetrySpacing=0
-ErrorAction11.MaxRetries=0
-ErrorAction11.Action=0
-
-ErrorCodeFromSms12=-3288
-ErrorClassFromSms12=2
-ErrorAction12.Error=544
-ErrorAction12.Retries=0
-ErrorAction12.RetrySpacing=0
-ErrorAction12.MaxRetries=0
-ErrorAction12.Action=0
-
-ErrorCodeFromSms13=-3288
-ErrorClassFromSms13=3
-ErrorAction13.Error=800
-ErrorAction13.Retries=0
-ErrorAction13.RetrySpacing=0
-ErrorAction13.MaxRetries=0
-ErrorAction13.Action=0
-
-ErrorCodeFromSms14=-3289
-ErrorClassFromSms14=2
-ErrorAction14.Error=545
-ErrorAction14.Retries=0
-ErrorAction14.RetrySpacing=0
-ErrorAction14.MaxRetries=0
-ErrorAction14.Action=0
-
-ErrorCodeFromSms15=-3289
-ErrorClassFromSms15=3
-ErrorAction15.Error=801
-ErrorAction15.Retries=0
-ErrorAction15.RetrySpacing=0
-ErrorAction15.MaxRetries=0
-ErrorAction15.Action=0
-
-ErrorCodeFromSms16=-3290
-ErrorClassFromSms16=2
-ErrorAction16.Error=546
-ErrorAction16.Retries=0
-ErrorAction16.RetrySpacing=0
-ErrorAction16.MaxRetries=0
-ErrorAction16.Action=0
-
-ErrorCodeFromSms17=-3290
-ErrorClassFromSms17=3
-ErrorAction17.Error=802
-ErrorAction17.Retries=0
-ErrorAction17.RetrySpacing=0
-ErrorAction17.MaxRetries=0
-ErrorAction17.Action=0
-
-ErrorCodeFromSms18=-3291
-ErrorClassFromSms18=2
-ErrorAction18.Error=547
-ErrorAction18.Retries=0
-ErrorAction18.RetrySpacing=0
-ErrorAction18.MaxRetries=0
-ErrorAction18.Action=0
-
-ErrorCodeFromSms19=-3291
-ErrorClassFromSms19=3
-ErrorAction19.Error=803
-ErrorAction19.Retries=0
-ErrorAction19.RetrySpacing=0
-ErrorAction19.MaxRetries=0
-ErrorAction19.Action=0
-
-ErrorCodeFromSms20=-3292
-ErrorClassFromSms20=2
-ErrorAction20.Error=548
-ErrorAction20.Retries=0
-ErrorAction20.RetrySpacing=0
-ErrorAction20.MaxRetries=0
-ErrorAction20.Action=0
-
-ErrorCodeFromSms21=-3292
-ErrorClassFromSms21=3
-ErrorAction21.Error=804
-ErrorAction21.Retries=0
-ErrorAction21.RetrySpacing=0
-ErrorAction21.MaxRetries=0
-ErrorAction21.Action=0
-
-ErrorCodeFromSms22=-3293
-ErrorClassFromSms22=2
-ErrorAction22.Error=549
-ErrorAction22.Retries=0
-ErrorAction22.RetrySpacing=0
-ErrorAction22.MaxRetries=0
-ErrorAction22.Action=0
-
-ErrorCodeFromSms23=-3293
-ErrorClassFromSms23=3
-ErrorAction23.Error=805
-ErrorAction23.Retries=0
-ErrorAction23.RetrySpacing=0
-ErrorAction23.MaxRetries=0
-ErrorAction23.Action=0
-
-ErrorCodeFromSms24=-3294
-ErrorClassFromSms24=2
-ErrorAction24.Error=550
-ErrorAction24.Retries=0
-ErrorAction24.RetrySpacing=0
-ErrorAction24.MaxRetries=0
-ErrorAction24.Action=0
-
-ErrorCodeFromSms25=-3294
-ErrorClassFromSms25=3
-ErrorAction25.Error=806
-ErrorAction25.Retries=0
-ErrorAction25.RetrySpacing=0
-ErrorAction25.MaxRetries=0
-ErrorAction25.Action=0
-
-ErrorCodeFromSms26=-3295
-ErrorClassFromSms26=2
-ErrorAction26.Error=551
-ErrorAction26.Retries=0
-ErrorAction26.RetrySpacing=0
-ErrorAction26.MaxRetries=0
-ErrorAction26.Action=0
-
-ErrorCodeFromSms27=-3295
-ErrorClassFromSms27=3
-ErrorAction27.Error=807
-ErrorAction27.Retries=0
-ErrorAction27.RetrySpacing=0
-ErrorAction27.MaxRetries=0
-ErrorAction27.Action=0
-
-ErrorCodeFromSms28=-3320
-ErrorClassFromSms28=2
-ErrorAction28.Error=576
-ErrorAction28.Retries=0
-ErrorAction28.RetrySpacing=0
-ErrorAction28.MaxRetries=0
-ErrorAction28.Action=0
-
-ErrorCodeFromSms29=-3320
-ErrorClassFromSms29=3
-ErrorAction29.Error=832
-ErrorAction29.Retries=0
-ErrorAction29.RetrySpacing=0
-ErrorAction29.MaxRetries=0
-ErrorAction29.Action=0
-
-ErrorCodeFromSms30=-3321
-ErrorClassFromSms30=2
-ErrorAction30.Error=577
-ErrorAction30.Retries=0
-ErrorAction30.RetrySpacing=0
-ErrorAction30.MaxRetries=0
-ErrorAction30.Action=0
-
-ErrorCodeFromSms31=-3321
-ErrorClassFromSms31=3
-ErrorAction31.Error=833
-ErrorAction31.Retries=0
-ErrorAction31.RetrySpacing=0
-ErrorAction31.MaxRetries=0
-ErrorAction31.Action=0
-
-ErrorCodeFromSms32=-3322
-ErrorClassFromSms32=2
-ErrorAction32.Error=578
-ErrorAction32.Retries=0
-ErrorAction32.RetrySpacing=0
-ErrorAction32.MaxRetries=0
-ErrorAction32.Action=0
-
-ErrorCodeFromSms33=-3322
-ErrorClassFromSms33=3
-ErrorAction33.Error=834
-ErrorAction33.Retries=0
-ErrorAction33.RetrySpacing=0
-ErrorAction33.MaxRetries=0
-ErrorAction33.Action=0
-
-ErrorCodeFromSms34=-3352
-ErrorClassFromSms34=2
-ErrorAction34.Error=608
-ErrorAction34.Retries=0
-ErrorAction34.RetrySpacing=0
-ErrorAction34.MaxRetries=0
-ErrorAction34.Action=0
-
-ErrorCodeFromSms35=-3352
-ErrorClassFromSms35=3
-ErrorAction35.Error=864
-ErrorAction35.Retries=0
-ErrorAction35.RetrySpacing=0
-ErrorAction35.MaxRetries=0
-ErrorAction35.Action=0
-
-ErrorCodeFromSms36=-3353
-ErrorClassFromSms36=2
-ErrorAction36.Error=609
-ErrorAction36.Retries=0
-ErrorAction36.RetrySpacing=0
-ErrorAction36.MaxRetries=0
-ErrorAction36.Action=0
-
-ErrorCodeFromSms37=-3353
-ErrorClassFromSms37=3
-ErrorAction37.Error=865
-ErrorAction37.Retries=0
-ErrorAction37.RetrySpacing=0
-ErrorAction37.MaxRetries=0
-ErrorAction37.Action=0
-
-ErrorCodeFromSms38=-3354
-ErrorClassFromSms38=2
-ErrorAction38.Error=610
-ErrorAction38.Retries=0
-ErrorAction38.RetrySpacing=0
-ErrorAction38.MaxRetries=0
-ErrorAction38.Action=0
-
-ErrorCodeFromSms39=-3354
-ErrorClassFromSms39=3
-ErrorAction39.Error=866
-ErrorAction39.Retries=0
-ErrorAction39.RetrySpacing=0
-ErrorAction39.MaxRetries=0
-ErrorAction39.Action=0
-
-ErrorCodeFromSms40=-3355
-ErrorClassFromSms40=2
-ErrorAction40.Error=611
-ErrorAction40.Retries=0
-ErrorAction40.RetrySpacing=0
-ErrorAction40.MaxRetries=0
-ErrorAction40.Action=0
-
-ErrorCodeFromSms41=-3355
-ErrorClassFromSms41=3
-ErrorAction41.Error=867
-ErrorAction41.Retries=0
-ErrorAction41.RetrySpacing=0
-ErrorAction41.MaxRetries=0
-ErrorAction41.Action=0
-
-ErrorCodeFromSms42=-3356
-ErrorClassFromSms42=2
-ErrorAction42.Error=612
-ErrorAction42.Retries=0
-ErrorAction42.RetrySpacing=0
-ErrorAction42.MaxRetries=0
-ErrorAction42.Action=0
-
-ErrorCodeFromSms43=-3356
-ErrorClassFromSms43=3
-ErrorAction43.Error=868
-ErrorAction43.Retries=0
-ErrorAction43.RetrySpacing=0
-ErrorAction43.MaxRetries=0
-ErrorAction43.Action=0
-
-ErrorCodeFromSms44=-3358
-ErrorClassFromSms44=2
-ErrorAction44.Error=614
-ErrorAction44.Retries=0
-ErrorAction44.RetrySpacing=0
-ErrorAction44.MaxRetries=0
-ErrorAction44.Action=0
-
-ErrorCodeFromSms45=-3358
-ErrorClassFromSms45=3
-ErrorAction45.Error=870
-ErrorAction45.Retries=0
-ErrorAction45.RetrySpacing=0
-ErrorAction45.MaxRetries=0
-ErrorAction45.Action=0
-
-ErrorCodeFromSms46=-3359
-ErrorClassFromSms46=2
-ErrorAction46.Error=615
-ErrorAction46.Retries=0
-ErrorAction46.RetrySpacing=0
-ErrorAction46.MaxRetries=0
-ErrorAction46.Action=0
-
-ErrorCodeFromSms47=-3359
-ErrorClassFromSms47=3
-ErrorAction47.Error=871
-ErrorAction47.Retries=0
-ErrorAction47.RetrySpacing=0
-ErrorAction47.MaxRetries=0
-ErrorAction47.Action=0
-
-ErrorCodeFromSms48=-3360
-ErrorClassFromSms48=2
-ErrorAction48.Error=616
-ErrorAction48.Retries=0
-ErrorAction48.RetrySpacing=0
-ErrorAction48.MaxRetries=0
-ErrorAction48.Action=0
-
-ErrorCodeFromSms49=-3360
-ErrorClassFromSms49=3
-ErrorAction49.Error=872
-ErrorAction49.Retries=0
-ErrorAction49.RetrySpacing=0
-ErrorAction49.MaxRetries=0
-ErrorAction49.Action=0
-
-ErrorCodeFromSms50=-3361
-ErrorClassFromSms50=2
-ErrorAction50.Error=617
-ErrorAction50.Retries=0
-ErrorAction50.RetrySpacing=0
-ErrorAction50.MaxRetries=0
-ErrorAction50.Action=0
-
-ErrorCodeFromSms51=-3361
-ErrorClassFromSms51=3
-ErrorAction51.Error=873
-ErrorAction51.Retries=0
-ErrorAction51.RetrySpacing=0
-ErrorAction51.MaxRetries=0
-ErrorAction51.Action=0
-
-ErrorCodeFromSms52=-3362
-ErrorClassFromSms52=2
-ErrorAction52.Error=618
-ErrorAction52.Retries=0
-ErrorAction52.RetrySpacing=0
-ErrorAction52.MaxRetries=0
-ErrorAction52.Action=0
-
-ErrorCodeFromSms53=-3362
-ErrorClassFromSms53=3
-ErrorAction53.Error=874
-ErrorAction53.Retries=0
-ErrorAction53.RetrySpacing=0
-ErrorAction53.MaxRetries=0
-ErrorAction53.Action=0
-
-ErrorCodeFromSms54=-3363
-ErrorClassFromSms54=2
-ErrorAction54.Error=619
-ErrorAction54.Retries=0
-ErrorAction54.RetrySpacing=0
-ErrorAction54.MaxRetries=0
-ErrorAction54.Action=0
-
-ErrorCodeFromSms55=-3363
-ErrorClassFromSms55=3
-ErrorAction55.Error=875
-ErrorAction55.Retries=0
-ErrorAction55.RetrySpacing=0
-ErrorAction55.MaxRetries=0
-ErrorAction55.Action=0
--- a/messagingappbase/smsmtm/test/data/T_SmsSendRecv.html	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,129 +0,0 @@
-<html>
-
-<head>
-<meta http-equiv="Content-Type"
-content="text/html; charset=iso-8859-1">
-<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
-<title></title>
-</head>
-
-<body>
-
-<h2>GT Messaging Test Harness T_SmsSendRecv</h2>
-
-<p><font size="2">Copyright © 2000-2002 </font><a
-href="http://www.symbian.com" target="_blank "><font size="2">Symbian
-Ltd</font></a><font size="2">. All rights reserved.</font></p>
-
-<p><strong>Test Harness:</strong> <font size="3">T_SmsSendRecv</font></p>
-
-<p><strong>Component:</strong> SMS</p>
-
-<p><strong>Owner:</strong> AA</p>
-
-<p><strong>Brief Description:</strong> Sends and waits to receive
-SMS messages specified in sendrecv.script</p>
-
-<p><strong>Detailed Description:</strong> As Above</p>
-
-<p><strong>Input Files REQUIRED:</strong></p>
-
-<blockquote>
-    <p><tt>&lt;DRIVE&gt;:\msgtest\sms\defaults.script<br>
-    &lt;DRIVE&gt;:\msgtest\sms\sendrecv.script</tt></p>
-</blockquote>
-
-<p><strong>Intermediate Files Produced:</strong> None</p>
-
-<p><strong>Output files produced:</strong> <tt>&lt;DRIVE&gt;:\msglogs\T_SmsSendRecv.&lt;PLATFORM&gt;.&lt;VARIANT&gt;.log</tt></p>
-
-<p><strong>Building Instructions:</strong></p>
-
-<blockquote>
-    <p><tt>cd \msg\smcm<br>
-    bldmake bldfiles<br>
-    abld test build</tt></p>
-</blockquote>
-
-<p><strong>Running Instructions:</strong></p>
-
-<p>All Platforms:</p>
-
-<blockquote>
-    <p>1. Build T_CreateDb test harness from COMMDB component:</p>
-    <blockquote>
-        <p><tt>cd \commdb\group<br>
-        bldmake bldfiles<br>
-        abld test build T_CreateDb</tt></p>
-    </blockquote>
-    <p>2. Run T_CreateDb and select the your modem (probably GSM
-    Mobile Phone)</p>
-    <p>3. Build the test utilities:</p>
-    <blockquote>
-        <p><tt>cd \msg\testutils\group\<br>
-        bldmake bldfiles<br>
-        abld test build</tt></p>
-    </blockquote>
-    <p>4. Build <em>this</em> test harness:</p>
-    <blockquote>
-        <p><tt>cd \msg\smcm<br>
-        bldmake bldfiles<br>
-        abld test build t_smcmrecvmanual</tt></p>
-    </blockquote>
-    <p>5. Edit <tt>\epoc32\wins\c\msgtest\sms\</tt><strong><tt>defaults.script</tt></strong>.
-    Replace the telephone number (&quot;Recipients&quot;) with <em>your</em>
-    mobile's number. You may also need to change the service
-    centre (&quot;SC&quot;) number (the default is for <a
-    href="http://www.vodafone.co.uk" target="_blank ">Vodafone UK</a>).
-    For example, change the telephone number like so:</p>
-    <blockquote>
-        <p><tt>[Defaults]<br>
-        SC= +447785016005<br>
-        Encoding= 7<br>
-        DeliveryReport= DEF<br>
-        Bearer= NBS<br>
-        </tt><font color="#FF0000"><strike><tt>Recipients= +447747065xxx</tt></strike></font><tt><br>
-        </tt><font color="#0000FF"><tt>Recipients= +447747065511</tt></font><tt><br>
-        <br>
-        endscript</tt></p>
-    </blockquote>
-</blockquote>
-
-<p>WINS Only:</p>
-
-<blockquote>
-    <p>1. Run T_CreateDb.exe (if it has not already been run) and
-    select your modem (GSM mobile phone).</p>
-    <p>2. <tt>\epoc32\release\wins\&lt;VARIANT&gt;\T_SmsSendRecv.exe</tt>
-    can be used at the command prompt or executable can be run
-    from Windows Explorer.</p>
-</blockquote>
-
-<p>Platform other than WINS:</p>
-
-<blockquote>
-    <p>1. Copy <tt>\epoc32\release\&lt;PLATFORM&gt;\&lt;VARIANT&gt;\</tt><strong><tt>T_SmsSendRecv.exe</tt></strong>
-    onto the other platform (or onto the CF card)</p>
-    <p>2. Copy <tt>\epoc32\release\&lt;PLATFORM&gt;\&lt;VARIANT&gt;\T_CreateDb</tt><strong><tt>.exe</tt></strong>
-    onto the other platform (or onto the CF card)</p>
-    <p>3. Copy <tt>\epoc32\release\&lt;PLATFORM&gt;\&lt;VARIANT&gt;\</tt><strong><tt>MsvTestUtils.DLL</tt></strong>
-    into <tt>&lt;DRIVE&gt;:\system\libs</tt> on the other
-    platform (or onto the CF card)</p>
-    <p>4. Copy <tt>\epoc32\release\&lt;PLATFORM&gt;\&lt;VARIANT&gt;\</tt><strong><tt>SmsTestUtils.DLL</tt></strong>
-    into <tt>&lt;DRIVE&gt;:\system\libs</tt> on the other
-    platform (or onto the CF card)</p>
-    <p>5. Copy <tt>\epoc32\wins\c\msgtest\sms\</tt><strong><tt>sendrecv.script</tt></strong>
-    and <strong><tt>defaults.script</tt></strong> into <tt>&lt;DRIVE&gt;:\msgtest\sms</tt>
-    on the other platform (or onto the CF card)</p>
-    <p>6. <strong>Run T_CreateDb.exe</strong> on the other
-    platform (if it has not already been run) and select your
-    modem (GSM mobile phone).</p>
-    <p>7. <strong>Run T_SmsSendRecv.exe</strong> on the other
-    platform.</p>
-</blockquote>
-
-<p><font size="2">Copyright © 2000-2002 </font><a
-href="http://www.symbian.com" target="_blank"><font size="2">Symbian
-Ltd</font></a><font size="2">. All rights reserved.</font> </p>
-</body>
-</html>
--- a/messagingappbase/smsmtm/test/data/bif/giraffe.rss	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-// Copyright (c) 1999-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:
-// 'BIO Messaging Information File (bif)' Resource file
-// 
-//
-
-
-#include <biftool2.rh>
-
-
-RESOURCE BIO_INFO_FILE
-	{
-	message_type_uid=0x10022000;
-	message_parser_name="wapp.dll";
-	message_app_uid=KUidUseDefaultApp;
-	message_appctrl_name = "iacbiocontrol.dll";
-
-	description="Giraffe Test BIF";
-
-	general_data1=0x0108;		// Flags specific to this BIO message type.
-
-	icons_filename="smcm.mbm";
-	icon_zoom_levels={1};
-
-	ids=
-		{
-		ID	
-			{
-			type=EWap;
-			confidence=ECertain;
-			character_set=KCharSetDefault;		
-			port=22000;
-			general_id_data=0;
-			},
-		ID	
-			{
-			type=EWapSecure;
-			confidence=ECertain;
-			character_set=KCharSetDefault;		
-			port=22001;
-			general_id_data=0;
-			},
-		ID	
-			{
-			type=ENbs;
-			confidence=ECertain;
-			text="Giraffe";
-			},
-		ID	
-			{
-			type=ENbs;
-			confidence=ECertain;
-			port=22003;
-			},
-		ID
-			{
-			type=EIana;
-			confidence=ECertain;
-			character_set=KCharSetDefault;	// default is ISO-8859-1, could have missed this line out
-			text="application/x-nokia.settings";
-			}
-		};
-	}
-
--- a/messagingappbase/smsmtm/test/data/bif/koala.rss	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-// Copyright (c) 1999-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:
-// 'BIO Messaging Information File (bif)' Resource file
-// 
-//
-
-#include <biftool2.rh>
-
-
-RESOURCE BIO_INFO_FILE
-	{
-	message_type_uid=0x10022001;
-	message_parser_name="wapp.dll";
-	message_app_uid=KUidUseDefaultApp;
-	message_appctrl_name = "iacbiocontrol.dll";
-
-	description="Koala Test BIF";
-
-	general_data1=0x0108;		// Flags specific to this BIO message type.
-
-	icons_filename="smcm.mbm";
-	icon_zoom_levels={1};
-
-	ids=
-		{
-		ID	
-			{
-			type=EWsp;
-			confidence=ECertain;
-			character_set=KCharSetDefault;		
-			port=22004;
-			general_id_data=0;
-			},
-		ID	
-			{
-			type=ENbs;
-			confidence=ECertain;
-			text="Koala";
-			},
-		ID
-			{
-			type=EIana;
-			confidence=ECertain;
-			character_set=KCharSetDefault;	// default is ISO-8859-1, could have missed this line out
-			text="application/x-nokia.settings";
-			}
-		};
-	}
-
Binary file messagingappbase/smsmtm/test/data/bif/smcm.bmp has changed
Binary file messagingappbase/smsmtm/test/data/ems/anims.mbm has changed
Binary file messagingappbase/smsmtm/test/data/ems/pics.mbm has changed
--- a/messagingappbase/smsmtm/test/data/script/EricssonT300.txt	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-[All]
-Defaults= defaults.script
-
-[TwoRecipients]
-Message= This message is going to my two buddies
-Recipients= Default|Default
-
-[PlainOldMessage]
-Message= Hello, this is a plain SMS message.
-
-[BigHonkingMsg]
-Message= A big message to ya!
-Ya' know.  Lots of text makes
-a message big.
-More text blah, blah, blah!
-Blah blah blah.
-And a bit more to make sure
-that this is a big honking
-howling messages.
-Yup.  A very big message!
-Okay - and then some more.
-
-[WAP:vCalendar]
-Bearer= WAP
-BioUid= 268457267
-Message=
-BEGIN:VCALENDAR
-VERSION:1.0
-BEGIN:VEVENT
-X-EPOCAGENDAENTRYTYPE:APPOINTMENT
-DESCRIPTION:ModifiedAppointment
-UID:2
-CLASS:PUBLIC
-DCREATED:19991020T000000Z
-LAST-MODIFIED:19991020T165400Z
-DTSTART:19991020T090000Z
-DTEND:19991020T100000Z
-END:VEVENT
-END:VCALENDAR
-Encoding= 8
-
-[WAP:vCard]
-Bearer= WAP
-BioUid= 268457268
-Message=
-begin:vcard 
-n:;Julia
-adr:;;;;;;
-version:2.1
-fn:Julia Blumin
-end:vcard
-
-[ReplaceTypeSMSOne]
-Message= Replace Type Message One.
-BioUid= 0
-Encoding= 7
-DeliveryReport= YES
-Bearer= NBS
-
-[ReplaceTypeSMSTwo]
-Message= Replace Type SMS Message Two replaces Message One.
-BioUid= 0
-Encoding= 7
-DeliveryReport= YES
-Bearer= NBS
-
-[SMSMessageIndication]
-Message= Send Message Indication.
-BioUid= 0
-Encoding= 7
-DeliveryReport= YES
-Bearer= NBS
-
-endscript
\ No newline at end of file
--- a/messagingappbase/smsmtm/test/data/script/Nokia8210.txt	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-[All]
-Defaults= defaults.script
-
-[Plain8BitMessage]
-Message= Hello, this is a 8-bit SMS message.
-Encoding= 8
-
-[NoStatusReport]
-Message= No status report requested.
-DeliveryReport= NO
-
-[BigHonking8Msg]
-Message= This is a big 8-bit message!
-Ya' know.  Lots of text makes
-a message big.
-More text blah, blah, blah!
-Blah blah blah.
-And a bit more to make sure
-that this is a big honking
-howling messages.
-Yup.  A very big message!
-Okay - and then some more.
-Encoding= 8
-
-[WAP:vCalendar]
-Bearer= WAP
-BioUid= 268457267
-Message=
-BEGIN:VCALENDAR
-VERSION:1.0
-BEGIN:VEVENT
-END:VEVENT
-END:VCALENDAR
-Encoding= 7
-
-[WAP:vCard]
-Bearer= WAP
-BioUid= 268457268
-Message=
-begin:vcard 
-n:;Julia
-adr:;;;;;;
-version:2.1
-fn:Julia Blumin
-end:vcard
-Encoding= 8
-
-[NBS:MboxCnfg]
-Bearer= NBS
-BioUid= 268457263
-Message= 
-password
-Mname:Demon
-Madr:Brahim@yashar.Demon.co.uk
-Mrcv:pop3.demon.co.uk
-Msnd:post.demon.co.uk
-Mpro:PO
-
-[NBS:InternetCnfg]
-Bearer= NBS
-BioUid= 268457263
-Message= 
-password
-Iname:Demon
-Itel:+44 845 2121666
-Idns1:158.152.1.58
-Idns2:158.152.1.43
-
-[NBS:ComBizCard]
-Bearer= NBS
-BioUid= 268457265
-Message= 
-Business Card
-Da Card
-Biz Cards Lmtd
-Biz Whiz
-tel 411
-tel (home) 411
-fax 411
-me@here.com
-1122 Boogie Woogie Avenue
-Big Town
-WC1 000
-United Kingdom
-
-[NBS:ComBizCardBigger]
-Bearer= NBS
-BioUid= 268457265
-Message= 
-Business Card
-Da Card
-Biz Cards Lmtd
-Biz Whiz
-tel 411
-tel (home) 411
-fax 411
-me@here.com
-1122 Boogie Woogie Avenue
-Big Town
-WC1 000
-United Kingdom
-Gubbins
-More Gubbins
-Huge heaps of Gubbins
-Mountain of Gubbins, higher than is possibly feasible.
-
-
-[NBS:EmailNotify]
-Bearer= NBS
-BioUid= 268457264
-Message= 
-10
-From: 411
-Subject: A Message Notification
-
-[NBS:InternetConfig]
-Bearer= NBS
-BioUid= 268457263
-Message= 
-password
-Mname:Demon
-Muid:yashar
-Mpwd:dig23ler
-Madr:Brahim@yashar.Demon.co.uk
-Mrcv:pop3.demon.co.uk
-Mpro:PO
-Msnd:post.demon.co.uk
-Iname:Demon
-Iuid:yashar
-Ipwd:dig23ler
-Itel:+44 845 2121666
-Idns1:158.152.1.58
-Idns2:158.152.1.43
-
-[NBS:MailboxConfig]
-Bearer= NBS
-BioUid= 268457263
-Message= 
-password
-Mname:Demon
-Madr:Brahim@yashar.Demon.co.uk
-Mrcv:pop3.demon.co.uk
-Msnd:post.demon.co.uk
-Mpro:PO
-
-endscript
\ No newline at end of file
--- a/messagingappbase/smsmtm/test/data/script/ReadMe.txt	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-T_SmsSendRecv uses a script file called sendrecv.script.
-That file describes all the messages that needs to be sent in order to complete the
-test harness. But there is no phone that is able to handle all of those messages 
-therefor additional files have been added, Nokia8210.txt and EricssonT39.txt.
-To run all test cases a Nokia 8210 over IR and a Ericsson T300 with serial cable should
- be used.
-First rename Nokia8210.txt in <drive>:\msgtest\sms to sendrecv.script.
-Run the test harness. If successful move to next step.
-Rename EricssonT300.txt in <drive>:\msgtest\sms to sendrecv.script.
-Run the test harness. If successful the complete test is completed.
--- a/messagingappbase/smsmtm/test/data/script/biofication.script	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +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:
-//
-
-[All]
-Defaults= defaults.script
-
-[NBS:InternetConfig]
-Type= Submit
-Class= 2
-Bearer= NBS
-BioUid= 268457263
-Message= 
-password
-Mname:Demon
-Muid:yashar
-Mpwd:dig23ler
-Madr:Brahim@yashar.Demon.co.uk
-Mrcv:pop3.demon.co.uk
-Mpro:PO
-Msnd:post.demon.co.uk
-Iname:Demon
-Iuid:yashar
-Ipwd:dig23ler
-Itel:+44 845 2121666
-Idns1:158.152.1.58
-Idns2:158.152.1.43
-DeliveryReport= NO
-
-[NBS:MailboxConfig]
-Type= Submit
-Class= 2
-Bearer= NBS
-BioUid= 268457263
-Message= 
-password
-Mname:Demon
-Madr:Brahim@yashar.Demon.co.uk
-Mrcv:pop3.demon.co.uk
-Msnd:post.demon.co.uk
-Mpro:PO
-DeliveryReport= NO
-
-[Message]
-Type= Submit
-Class= 2
-Message= This is a 200 char mesge
-This is a 200 char mesge
-This is a 200 char mesge
-This is a 200 char mesge
-This is a 200 char mesge
-This is a 200 char mesge
-This is a 200 char mesge
-This is a 200 char mesge
-Encoding= 7
-DeliveryReport= NO
-
-[Message]
-Type= Submit
-Class= 2
-Message= This is a 200 8bit mesge
-This is a 200 8bit mesge
-This is a 200 8bit mesge
-This is a 200 8bit mesge
-This is a 200 8bit mesge
-This is a 200 8bit mesge
-This is a 200 8bit mesge
-This is a 200 8bit mesge
-Encoding= 8
-DeliveryReport= NO
-
-[StatusReport]
-Type= SR
-Message= Message received loud and clear
-
-[VCard]
-Type= Deliver
-Bearer= WAP
-Message=
-begin:vcard
-n:;Julia
-adr:;;;;;;
-version:2.1
-email;internet:julia.blumin@symbian.com
-fn:Julia Blumin
-end:vcard
-BioUid= 268457268
-Bearer= WAP
-Encoding= 8
-
-[VCal]
-Type= Deliver
-Bearer= WAP
-Message= BEGIN:VCALENDAR
-VERSION:1.0
-BEGIN:VEVENT
-CATEGORIES:MEETING
-DTSTART:20000610T090000
-DALARM:20000610T085900;;;
-AALARM:20000610T085900;;;
-SUMMARY:B
-DESCRIPTION:Meet Santa
-END:VEVENT
-END:VCALENDAR
-BioUid= 268457267
-
-[RT]
-Type= Deliver
-Bearer= WAP
-File= tone1.rtp
-BioUid= 268457269
-Encoding= 8
-
-[Logo]
-Type= Deliver
-Bearer= WAP
-File= logo1.olp
-BioUid= 268457270
-Encoding= 8
-
-endscript
-
Binary file messagingappbase/smsmtm/test/data/script/logo1.olp has changed
--- a/messagingappbase/smsmtm/test/data/script/nbs.script	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +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:
-//
-
-[All]
-Defaults= defaults.script
-Bearer= NBS
-
-[Message]
-Message=
-1
-From: 01514876655
-Subject: Los huevos del perro (something about your dog)
-BioUid= 268457264
-Bearer= NBS
-
-[NBS:ComBizCardBigger]
-Bearer= NBS
-BioUid= 268457265
-Message= 
-Business Card
-Da Card
-Biz Cards Lmtd
-Biz Whiz
-tel 411
-tel (home) 411
-fax 411
-me@here.com
-1122 Boogie Woogie Avenue
-Big Town
-WC1 000
-United Kingdom
-Gubbins
-More Gubbins
-Huge heaps of Gubbins
-Mountain of Gubbins, higher than is possibly feasible.
-
-endscript
\ No newline at end of file
--- a/messagingappbase/smsmtm/test/data/script/sendrecv.script	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,211 +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:
-//
-
-[All]
-Defaults= defaults.script
-
-[TwoRecipients]
-Message= This message is going to my two buddies
-Recipients= Default|Default
-
-[PlainOldMessage]
-Message= Hello, this is a plain SMS message.
-
-[Plain8BitMessage]
-Message= Hello, this is a 8-bit SMS message.
-Encoding= 8
-
-[NoStatusReport]
-Message= No status report requested.
-DeliveryReport= NO
-
-[BigHonkingMsg]
-Message= A big message to ya!
-Ya' know.  Lots of text makes
-a message big.
-More text blah, blah, blah!
-Blah blah blah.
-And a bit more to make sure
-that this is a big honking
-howling messages.
-Yup.  A very big message!
-Okay - and then some more.
-
-[BigHonking8Msg]
-Message= This is a big 8-bit message!
-Ya' know.  Lots of text makes
-a message big.
-More text blah, blah, blah!
-Blah blah blah.
-And a bit more to make sure
-that this is a big honking
-howling messages.
-Yup.  A very big message!
-Okay - and then some more.
-Encoding= 8
-
-[WAP:vCalendar]
-Bearer= WAP
-BioUid= 268457267
-Message=
-BEGIN:VCALENDAR
-VERSION:1.0
-BEGIN:VEVENT
-END:VEVENT
-END:VCALENDAR
-Encoding= 7
-
-[WAP:vCalendar]
-Bearer= WAP
-BioUid= 268457267
-Message=
-BEGIN:VCALENDAR
-VERSION:1.0
-BEGIN:VEVENT
-X-EPOCAGENDAENTRYTYPE:APPOINTMENT
-DESCRIPTION:ModifiedAppointment
-UID:2
-CLASS:PUBLIC
-DCREATED:19991020T000000Z
-LAST-MODIFIED:19991020T165400Z
-DTSTART:19991020T090000Z
-DTEND:19991020T100000Z
-END:VEVENT
-END:VCALENDAR
-Encoding= 8
-
-[WAP:vCard]
-Bearer= WAP
-BioUid= 268457268
-Message=
-begin:vcard 
-n:;Julia
-adr:;;;;;;
-version:2.1
-fn:Julia Blumin
-end:vcard
-
-[WAP:vCard]
-Bearer= WAP
-BioUid= 268457268
-Message=
-begin:vcard 
-n:;Julia
-adr:;;;;;;
-version:2.1
-fn:Julia Blumin
-end:vcard
-Encoding= 8
-
-[NBS:MboxCnfg]
-Bearer= NBS
-BioUid= 268457263
-Message= 
-password
-Mname:Demon
-Madr:Brahim@yashar.Demon.co.uk
-Mrcv:pop3.demon.co.uk
-Msnd:post.demon.co.uk
-Mpro:PO
-
-[NBS:InternetCnfg]
-Bearer= NBS
-BioUid= 268457263
-Message= 
-password
-Iname:Demon
-Itel:+44 845 2121666
-Idns1:158.152.1.58
-Idns2:158.152.1.43
-
-[NBS:ComBizCard]
-Bearer= NBS
-BioUid= 268457265
-Message= 
-Business Card
-Da Card
-Biz Cards Lmtd
-Biz Whiz
-tel 411
-tel (home) 411
-fax 411
-me@here.com
-1122 Boogie Woogie Avenue
-Big Town
-WC1 000
-United Kingdom
-
-[NBS:ComBizCardBigger]
-Bearer= NBS
-BioUid= 268457265
-Message= 
-Business Card
-Da Card
-Biz Cards Lmtd
-Biz Whiz
-tel 411
-tel (home) 411
-fax 411
-me@here.com
-1122 Boogie Woogie Avenue
-Big Town
-WC1 000
-United Kingdom
-Gubbins
-More Gubbins
-Huge heaps of Gubbins
-Mountain of Gubbins, higher than is possibly feasible.
-
-
-[NBS:EmailNotify]
-Bearer= NBS
-BioUid= 268457264
-Message= 
-10
-From: 411
-Subject: A Message Notification
-
-[NBS:InternetConfig]
-Bearer= NBS
-BioUid= 268457263
-Message= 
-password
-Mname:Demon
-Muid:yashar
-Mpwd:dig23ler
-Madr:Brahim@yashar.Demon.co.uk
-Mrcv:pop3.demon.co.uk
-Mpro:PO
-Msnd:post.demon.co.uk
-Iname:Demon
-Iuid:yashar
-Ipwd:dig23ler
-Itel:+44 845 2121666
-Idns1:158.152.1.58
-Idns2:158.152.1.43
-
-[NBS:MailboxConfig]
-Bearer= NBS
-BioUid= 268457263
-Message= 
-password
-Mname:Demon
-Madr:Brahim@yashar.Demon.co.uk
-Mrcv:pop3.demon.co.uk
-Msnd:post.demon.co.uk
-Mpro:PO
-
-endscript
\ No newline at end of file
--- a/messagingappbase/smsmtm/test/data/script/sendrecv_ems.script	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +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:
-//
-
-[All]
-Defaults= defaults.script
-
-[FormatTest1]
-Message= This is a standard message with some formatting applied
-EmsFormat= 2 10 8 23 19 7 64
-
-[FormatTest2]
-Message= 
-This is a very large message which should extend over 200 characters. Formattin
-g should be applied from the start of 'Formatting' up to a certain point which 
-will be defined later. OK, NOW. Now there shouldn't be anymore formatting.
-EmsFormat= 1 70 121 23
-
-[FormatTest3]
-Message= 
-This is a very large message which should extend over 200 characters. Formattin
-g should be applied from the start of 'Formatting' up to a certain point which 
-will be defined later. OK, NOW. Now there shouldn't be anymore formatting. This
- one differs from the previous test in that it is UCS2 encoding
-EmsFormat= 1 70 121 23
-Encoding= 16
-
-[Picture]
-Message=
-This should have three EMS pictures after this message... Here's the first one:
- now the second one:  finally the third one: 
-EmsPicture= 3 80 0 100 1 124 2
-
-[Animation]
-Message=
-This should have two animations and a user defined animation. The first one can
-be found here:  Now the second:  Now the predefined one:  WOW!!
-EmsAnimation= 2 95 0 112 1
-EmsPredefAnim= 1 137 4
-
-[Sound]
-Message=
-This message should have a pre-defined sound right here:  .... and now a user d
-efined sound right here:  ....
-EmsPredefSound= 1 38 5
-EmsUserSound= 1 106 abcdefghijklmn
-
-[UserPrompt]
-Message= This is a UP message
-EmsUserPrompt= 1 0 1
-EmsPicture= 1 0 2
-
-[BigFormatWithLargePicture]
-Message= 
-This is a very large message which should test the problem when formatting get
-s spread over one PDU and there is a large picture in the middle.
-EmsFormat= 1 0 145 64
-EmsPicture= 1 15 1
-
-
-endscript
\ No newline at end of file
--- a/messagingappbase/smsmtm/test/data/script/simparameter.script	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-//
-// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-[List1]
-SmsParamMaxEntries= 3
-SmsParamEntry= 1, Vodaphone, 00, 00, 24, 07747747747, 07785016005
-SmsParamEntry= 2, BT, 00, 00, 12, 07747747747, +447802000332
-
-[List2]
-SmsParamMaxEntries= 3
-SmsParamEntry= 1, Vodaphone, , , 24, 07747747747, 07785016005
-SmsParamEntry= 2, BT, 00, , , 07747747747, +447802000332
-
-endscript
-
-# SmsParamEntry = <Index>, <Name>, <PID>, <DCS>, <Validity Period(hour)> <DA> <SCA>
--- a/messagingappbase/smsmtm/test/data/script/smcmsimtsytest_config.txt	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-[All]
-Defaults= defaults.script
-
-[Message]
-Message= Hello From Script, Encoding 7
-
-[test0]
-DiallingPauseDuration= 3
-ConnectingPauseDuration= 1
-DisconnectingPauseDuration= 5
-AnswerIncomingPauseDuration= 5
-
-SmsTx= 00, 0, 0, 00, -15
-SmsTx= 00, 0, 0, 00, -15
-SmsTx= 00, 0, 0, 00, -15
-SmsTx= 00, 0, 0, 00, -15
-SmsTx= 00, 0, 0, 00, -15
-SmsTx= 00, 0, 0, 00, -15
-SmsTx= 00, 0, 0, 00, -15
-SmsTx= 00, 0, 0, 00, -15
-SmsTx= 00, 0, 0, 00, -15
-SmsTx= 00, 0, 0, 00, -15
-SmsTx= 00, 0, 0, 00, -15
-SmsTx= 00, 0, 0, 00, -15
-SmsTx= 00, 0, 0, 00, -15
-
-# SmsTx = <pdu>, <sca>, <MsgRef>, <SubmitReportPdu>, <ExpectedError>
-
-[test1]
-DiallingPauseDuration= 3
-ConnectingPauseDuration= 1
-DisconnectingPauseDuration= 5
-AnswerIncomingPauseDuration= 5
-
-SmsTx= 00, 0, 0, 00, -2017
-SmsTx= 00, 0, 0, 00, 0
-
-# SmsTx = <pdu>, <sca>, <MsgRef>, <SubmitReportPdu>, <ExpectedError>
-
-[test2]
-
-#RxPdu1, contains:"Test message, 8bits, length 30"
-SmsRx= 240C915348801455820004108071417314801E54657374206D6573736167652C2038626974732C206C656E677468203330, 358405202000
-
-#Class 2
-SmsRx= 240C9153488014558200F6108071417314801E54657374206D6573736167652C2038626974732C206C656E677468203330, 358405202000
-SmsRx= 240C915348801455820012108071417314801E54657374206D6573736167652C2038626974732C206C656E677468203330, 358405202000
-
-#RxPdu2-16, contains:"Sest message, 8bits, length 30"
-SmsRx= 240C915348801455820004108071417314801E53657374206D6573736167652C2038626974732C206C656E677468203330, 358405202000
-#RxPdu17, contains:"test message, 8bits, length 30"
-SmsRx= 240C915348801455820004108071417314801E74657374206D6573736167652C2038626974732C206C656E677468203330, 358405202000
-SmsRxPeriod= 5
-
-
-SmsAckNackPause= 1
-SmsResumePause= 1
-
-SmsStore= S14, 10
-
-SmsStoreEntry= S14, 1, 4, 15000c915348801455820004A71E74657374206D6573736167652C2038626974732C206C656E677468203330, 44444444444
-
-SmsStoreIndividualReqPause= 1
-
-SmsStoreBatchReqPause= 2
-
-endscript
-
-[Message]
-Message= Hello From Script, 2 Recipients, Encoding 7
-Recipients= Default|Default
-
-[Message]
-Message= This is a 200 char mesge
-This is a 200 char mesge
-This is a 200 char mesge
-This is a 200 char mesge
-This is a 200 char mesge
-This is a 200 char mesge
-This is a 200 char mesge
-This is a 200 char mesge
-Encoding= 7
-
-[Message]
-Message= Hello From Script, Encoding 8
-Encoding= 8
-
-[Message]
-Message= This is a 200 8bit mesge
-This is a 200 8bit mesge
-This is a 200 8bit mesge
-This is a 200 8bit mesge
-This is a 200 8bit mesge
-This is a 200 8bit mesge
-This is a 200 8bit mesge
-This is a 200 8bit mesge
-Encoding= 8
--- a/messagingappbase/smsmtm/test/data/script/sms.script	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,169 +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:
-//
-
-[All]
-Defaults= defaults.script
-
-[Message]
-Message= Hello From Script, Encoding 7
-
-[Message]
-Message= Hello From Script, 2 Recipients, Encoding 7
-Recipients= Default|Default
-
-[Message]
-Message= This is a 200 char mesge
-This is a 200 char mesge
-This is a 200 char mesge
-This is a 200 char mesge
-This is a 200 char mesge
-This is a 200 char mesge
-This is a 200 char mesge
-This is a 200 char mesge
-Encoding= 7
-
-[Message]
-Message= Hello From Script, Encoding 8
-Encoding= 8
-
-[Message]
-Message= This is a 200 8bit mesge
-This is a 200 8bit mesge
-This is a 200 8bit mesge
-This is a 200 8bit mesge
-This is a 200 8bit mesge
-This is a 200 8bit mesge
-This is a 200 8bit mesge
-This is a 200 8bit mesge
-Encoding= 8
-
-[test0]
-DiallingPauseDuration= 3
-ConnectingPauseDuration= 1
-DisconnectingPauseDuration= 5
-AnswerIncomingPauseDuration= 5
-
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-
-# SmsTx = <pdu>, <sca>, <MsgRef>, <SubmitReportPdu>, <ExpectedError>
-
-[test1]
-DiallingPauseDuration= 3
-ConnectingPauseDuration= 1
-DisconnectingPauseDuration= 5
-AnswerIncomingPauseDuration= 5
-
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-
-# SmsTx = <pdu>, <sca>, <MsgRef>, <SubmitReportPdu>, <ExpectedError>
-
-endscript
\ No newline at end of file
--- a/messagingappbase/smsmtm/test/data/script/smsenum.script	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,175 +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:
-//
-
-[All]
-Defaults= defaults.script
-Type= Deliver
-
-[Message]
-Message= Hello From Script, Encoding 7
-
-[Message]
-Message= Hello From Script, 2 Recipients, Encoding 7
-Recipients= Default|Default
-
-[Message]
-Message= Hello From Script, Submit Type, 2 Recipients, Encoding 7
-Recipients= +919849446750|+9886269510
-Type= Submit
-
-[Message]
-Message= This is a 200 char mesge
-This is a 200 char mesge
-This is a 200 char mesge
-This is a 200 char mesge
-This is a 200 char mesge
-This is a 200 char mesge
-This is a 200 char mesge
-This is a 200 char mesge
-Encoding= 7
-
-[Message]
-Message= Hello From Script, Encoding 8
-Encoding= 8
-
-[Message]
-Message= This is a 200 8bit mesge
-This is a 200 8bit mesge
-This is a 200 8bit mesge
-This is a 200 8bit mesge
-This is a 200 8bit mesge
-This is a 200 8bit mesge
-This is a 200 8bit mesge
-This is a 200 8bit mesge
-Encoding= 8
-
-[test0]
-DiallingPauseDuration= 3
-ConnectingPauseDuration= 1
-DisconnectingPauseDuration= 5
-AnswerIncomingPauseDuration= 5
-
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-
-# SmsTx = <pdu>, <sca>, <MsgRef>, <SubmitReportPdu>, <ExpectedError>
-
-[test1]
-DiallingPauseDuration= 3
-ConnectingPauseDuration= 1
-DisconnectingPauseDuration= 5
-AnswerIncomingPauseDuration= 5
-
-SmsTx= 00, 0, 0, 00, 0
-SmsTx= 00, 0, 0, 00, 0
-
-# SmsTx = <pdu>, <sca>, <MsgRef>, <SubmitReportPdu>, <ExpectedError>
-
-endscript
--- a/messagingappbase/smsmtm/test/data/script/smssc_config.txt	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-[test0]
-DiallingPauseDuration= 3
-ConnectingPauseDuration= 1
-DisconnectingPauseDuration= 5
-AnswerIncomingPauseDuration= 5
-
-
-SmsParamEntry= 1, Vodaphone, 00, 00, 24, 447747747747, 447785016005
-SmsParamEntry= 2, BT, 00, 00, 12, 447747747747, 447802000332
-SmsParamBatchReqPause= 1
-SmsParamMaxNumSlots= 10
-
-# SmsParam = <maxnumslots>, <TelNumMaxLen>, <AlphaTagMaxLen>
-# SmsParamEntry = <Index>, <Name>, <PID>, <DCS>, <Validity Period(hour)> <DA> <SCA>
-
-
-[test1]
-DiallingPauseDuration= 3
-ConnectingPauseDuration= 1
-DisconnectingPauseDuration= 5
-AnswerIncomingPauseDuration= 5
-
-
-SmsParamEntry= 0, Vodaphone, 00, 00, 24, 447747747747, 447785016005
-#SmsParamEntry= 2, BT, 00, 00, 12, 447747747747, 447802000332
-SmsParamBatchReqPause= 0
-SmsParamMaxNumSlots= 1
-
-# SmsParam = <maxnumslots>, <TelNumMaxLen>, <AlphaTagMaxLen>
-# SmsParamEntry = <Index>, <Name>, <PID>, <DCS>, <Validity Period(hour)> <DA> <SCA>
--- a/messagingappbase/smsmtm/test/data/script/t_SmsReplyTo.script	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +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:
-//
-
-RUN_UTILS  CopyFile c:\msgtest\sms\ReplyToConfig.txt c:\config.txt
-RUN_UTILS  MakeReadWrite c:\config.txt
-
-PRINT Run all t_SmsReplyToServer Tests 
-LOAD_SUITE t_SmsReplyToServer -SharedData
-RUN_TEST_STEP  1000 t_SmsReplyToServer SmsReplyToStep1
--- a/messagingappbase/smsmtm/test/data/script/t_SmsSpecialIndications.script	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +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:
-//
-
-RUN_UTILS  CopyFile c:\msgtest\sms\14IndicationsConfig.txt c:\config.txt
-RUN_UTILS  MakeReadWrite c:\config.txt
-
-PRINT Run all t_SmsSpecialIndicationsServer Tests 
-LOAD_SUITE t_SmsSpecialIndicationsServer -SharedData
-RUN_TEST_STEP  1000 t_SmsSpecialIndicationsServer SmsSpecialIndicationsStep1
--- a/messagingappbase/smsmtm/test/data/script/t_smcs2.script	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +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:
-//
-
-PRINT Run all t_smcs2 Tests 
-LOAD_SUITE t_smcs2_server -SharedData
-RUN_TEST_STEP 1000 t_smcs2_server TestSmsEntry
-RUN_TEST_STEP 1000 t_smcs2_server TestSmsSettings
-RUN_TEST_STEP 1000 t_smcs2_server TestSmsNumber 
-RUN_TEST_STEP 1000 t_smcs2_server TestEmailFields 
-RUN_TEST_STEP 1000 t_smcs2_server TestSmsHeader
-RUN_TEST_STEP 1000 t_smcs2_server TestSmsUtilities
-RUN_TEST_STEP 1000 t_smcs2_server TestSmsEmsExtensions
\ No newline at end of file
Binary file messagingappbase/smsmtm/test/data/script/tone1.rtp has changed
Binary file messagingappbase/smsmtm/test/data/script/tone2.rtp has changed
Binary file messagingappbase/smsmtm/test/data/script/tone3.rtp has changed
--- a/messagingappbase/smsmtm/test/data/script/wap.script	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +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:
-//
-
-[All]
-Defaults= defaults.script
-Bearer= WAP
-
-[VCal]
-Message= BEGIN:VCALENDAR
-VERSION:1.0
-BEGIN:VEVENT
-CATEGORIES:MEETING
-DTSTART:20000610T090000
-DALARM:20000610T085900;;;
-AALARM:20000610T085900;;;
-SUMMARY:B
-DESCRIPTION:Meet Santa
-END:VEVENT
-END:VCALENDAR
-BioUid= 268457267
-
-[VCard]
-Message=
-begin:vcard
-n:;Julia
-adr:;;;;;;
-version:2.1
-email;internet:julia.blumin@symbian.com
-fn:Julia Blumin
-end:vcard
-BioUid= 268457268
-Bearer= WAP
-Encoding= 8
-
-[RT]
-File= tone1.rtp
-BioUid= 268457269
-Encoding= 8
-
-[Logo]
-File= logo1.olp
-BioUid= 268457270
-Encoding= 8
-
-endscript
-
-[RT]
-File= tone2.rtp
-BioUid= 268457269
-Encoding= 8
-
-[RT]
-File= c:\test\sms\tone3.rtp
-BioUid= 268457269
-Encoding= 8
--- a/messagingappbase/smsmtm/test/data/t_smcmrecvmanual.html	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-<html>
-
-<head>
-<meta http-equiv="Content-Type"
-content="text/html; charset=iso-8859-1">
-<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
-<title></title>
-</head>
-
-<body>
-
-<h2>GT Messaging Test Harness T_SmcmRecvManual</h2>
-
-<p><font size="2">Copyright © 2002 </font><a
-href="http://www.symbian.com" target="_blank "><font size="2">Symbian
-Ltd</font></a><font size="2">. All rights reserved.</font></p>
-
-<p><strong>Test Harness:</strong> <font size="3">T_SmcmRecvManual</font></p>
-
-<p><strong>Component:</strong> SMS</p>
-
-<p><strong>Owner:</strong> AA</p>
-
-<p><strong>Brief Description:</strong> Waits to receive incoming
-SMS messages. Can also start and stop the watchers, and send
-messages to itself.</p>
-
-<p><strong>Detailed Description:</strong> Enables the user to
-observe incoming SMS messages. The use can:</p>
-
-<ul>
-    <li>Start and stop the watchers</li>
-    <li>Send a short (single-part) message to themselves</li>
-    <li>Send a long (2-part) message to themselves</li>
-    <li>Send all messages in sendrecv.script to themselves.</li>
-</ul>
-
-<p><strong>Input Files REQUIRED:</strong></p>
-
-<blockquote>
-    <p><tt>&lt;DRIVE&gt;:\msgtest\sms\defaults.script<br>
-    &lt;DRIVE&gt;:\msgtest\sms\sendrecv.script</tt></p>
-</blockquote>
-
-<p><strong>Intermediate Files Produced:</strong> None</p>
-
-<p><strong>Output files produced:</strong> <tt>&lt;DRIVE&gt;:\msglogs\T_SmcmRecvManual.&lt;PLATFORM&gt;.&lt;VARIANT&gt;.log</tt></p>
-
-<p><strong>Building Instructions:</strong></p>
-
-<blockquote>
-    <p><tt>cd \msg\smcm<br>
-    bldmake bldfiles<br>
-    abld test build</tt></p>
-</blockquote>
-
-<p><strong>Running Instructions:</strong></p>
-
-<p>All Platforms:</p>
-
-<blockquote>
-    <p>1. Build T_CreateDb test harness from COMMDB component:</p>
-    <blockquote>
-        <p><tt>cd \commdb\group<br>
-        bldmake bldfiles<br>
-        abld test build t_createdb</tt></p>
-    </blockquote>
-    <p>2. Run T_CreateDb and select the your modem (probably GSM
-    Mobile Phone)</p>
-    <p>3. Build the test utilities:</p>
-    <blockquote>
-        <p><tt>cd \msg\testutils\group<br>
-        bldmake bldfiles<br>
-        abld test build</tt></p>
-    </blockquote>
-    <p>4. Build <em>this</em> test harness:</p>
-    <blockquote>
-        <p><tt>cd \msg\smcm<br>
-        bldmake bldfiles<br>
-        abld test build </tt><strong><tt>t_smcmrecvmanual</tt></strong></p>
-    </blockquote>
-    <p>5. Edit <tt>\epoc32\wins\c\msgtest\sms\</tt><strong><tt>defaults.script</tt></strong>.
-    Replace the telephone number (&quot;Recipients&quot;) with <em>your</em>
-    mobile's number. You may also need to change the service
-    centre (&quot;SC&quot;) number (the default is for <a
-    href="http://www.vodafone.co.uk" target="_blank ">Vodafone UK</a>).
-    For example, change the telephone number like so:</p>
-    <blockquote>
-        <p><tt>[Defaults]<br>
-        </tt><strong><tt>SC= +447785016005<br>
-        </tt></strong><tt>Encoding= 7<br>
-        DeliveryReport= DEF<br>
-        Bearer= NBS<br>
-        </tt><font color="#FF0000"><strike><tt>Recipients= +447747065xxx</tt></strike></font><tt><br>
-        </tt><font color="#0000FF"><tt>Recipients= +447747065511</tt></font><tt><br>
-        <br>
-        endscript</tt></p>
-    </blockquote>
-</blockquote>
-
-<p>WINS Only:</p>
-
-<blockquote>
-    <p>1. Run T_CreateDb.exe (if it has not already been run) and
-    select your modem (GSM mobile phone).</p>
-    <p>2. <tt>\epoc32\release\wins\&lt;VARIANT&gt;\T_SmcmRecvManual.exe</tt>
-    can be used at the command prompt or executable can be run
-    from Windows Explorer.</p>
-</blockquote>
-
-<p>Platform other than WINS:</p>
-
-<blockquote>
-    <p>1. Copy <tt>\epoc32\release\&lt;PLATFORM&gt;\&lt;VARIANT&gt;\</tt><strong><tt>T_SmcmRecvManual.exe</tt></strong>
-    onto the other platform (or onto the CF card)</p>
-    <p>2. Copy <tt>\epoc32\release\&lt;PLATFORM&gt;\&lt;VARIANT&gt;\</tt><strong><tt>T_CreateDb.exe</tt></strong>
-    onto the other platform (or onto the CF card)</p>
-    <p>3. Copy <tt>\epoc32\release\&lt;PLATFORM&gt;\&lt;VARIANT&gt;\</tt><strong><tt>MsvTestUtils.DLL</tt></strong>
-    into <tt>&lt;DRIVE&gt;:\system\libs</tt> on the other
-    platform (or onto the CF card)</p>
-    <p>4. Copy <tt>\epoc32\release\&lt;PLATFORM&gt;\&lt;VARIANT&gt;\</tt><strong><tt>SmsTestUtils.DLL</tt></strong>
-    into <tt>&lt;DRIVE&gt;:\system\libs</tt> on the other
-    platform (or onto the CF card)</p>
-    <p>5. Copy <tt>\epoc32\wins\c\msgtest\sms\</tt><strong><tt>sendrecv.script</tt></strong>
-    and <strong><tt>defaults.script</tt></strong> into <tt>&lt;DRIVE&gt;:\msgtest\sms</tt>
-    on the other platform (or onto the CF card)</p>
-    <p>6. <strong>Run T_CreateDb.exe</strong> on the other
-    platform (if it has not already been run) and select your
-    modem (GSM mobile phone).</p>
-    <p>7. <strong>Run T_SmcmRecvManual.exe</strong> on the other
-    platform.</p>
-</blockquote>
-
-<p><font size="2">Copyright © 2002 </font><a
-href="http://www.symbian.com" target="_blank "><font size="2">Symbian
-Ltd</font></a><font size="2">. All rights reserved.</font></p>
-</body>
-</html>
--- a/messagingappbase/smsmtm/test/group/T_CSmsSettings.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-// Copyright (c) 2003-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:
-//
-
-TARGET                  T_CSmsSettings.exe
-TARGETTYPE              exe
-
-CAPABILITY All -TCB
-USERINCLUDE				..\inc
-SOURCEPATH              ..\src
-SOURCE                  T_CSmsSettings.cpp 
-SOURCEPATH              ..\..\clientmtm\src
-SOURCE                  SmutSet.cpp
-SYSTEMINCLUDE           \epoc32\include
-LIBRARY                 euser.lib efsrv.lib conarc.lib estor.lib commdb.lib msgs.lib
-LIBRARY                 smcm.lib
-
-VENDORID 0x70000001
-
-SMPSAFE
--- a/messagingappbase/smsmtm/test/group/T_SmcmFail.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-// Copyright (c) 2000-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:
-// T_SMCM.MMP
-// 
-//
-
-target          t_smcmfail.exe
-targettype      exe
-
-CAPABILITY All -TCB
-SOURCEPATH		../src
-source          T_SmcmFail.cpp 
-userinclude     ../inc 
-systeminclude   /epoc32/include 
-library         euser.lib smcm.lib msgs.lib etext.lib
-library			smstestutils.lib msvtestutils.lib biodb.lib bifu.lib
-
-UID    0x1000007a 0x10274040
-VENDORID 0x70000001
-
-
-SMPSAFE
--- a/messagingappbase/smsmtm/test/group/T_SmsCancel.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-// Copyright (c) 1999-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:
-// t_smscancel.mmp
-//
-
-target          t_smscancel.exe
-targettype      exe
-
-CAPABILITY All -TCB
-SOURCEPATH		../src
-source          T_SmsCancel.cpp
-userinclude     ../inc 
-systeminclude   /epoc32/include
-library         euser.lib msgs.lib
-library			smstestutils.lib msvtestutils.lib
-library		esock.lib smsu.lib
-EPOCSTACKSIZE 0x8000
-
-VENDORID 0x70000001
-
-SMPSAFE
--- a/messagingappbase/smsmtm/test/group/T_SmsDeliver.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-// Copyright (c) 2003-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:
-// t_smsdeliver.mmp
-//
-
-TARGET          t_smsdeliver.exe
-TARGETTYPE      exe
-
-CAPABILITY All -TCB
-
-SOURCEPATH	../src
-SOURCE          t_smsdeliver.cpp
-
-USERINCLUDE     ../inc 
-SYSTEMINCLUDE   /epoc32/include
-
-LIBRARY         euser.lib msgs.lib smstestutils.lib msvtestutils.lib smcm.lib esock.lib smsu.lib
-LIBRARY		c32.lib gsmu.lib
-
-#ifndef WINS
-LIBRARY		etel.lib etelmm.lib 
-#endif
-
-VENDORID 0x70000001
-
-
-SMPSAFE
--- a/messagingappbase/smsmtm/test/group/T_SmsDeliverLastSegmentReport.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-// Copyright (c) 2006-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:
-// t_smsdeliverlastsegmentreport.mmp
-//
-
-TARGET          t_smsdeliverlastsegmentreport.exe
-TARGETTYPE      exe
-
-CAPABILITY All -TCB
-
-SOURCEPATH	../src
-SOURCE          t_smsdeliverlastsegmentreport.cpp
-
-USERINCLUDE     ../inc 
-SYSTEMINCLUDE   /epoc32/include
-
-LIBRARY         euser.lib smcm.lib msgs.lib etext.lib gsmu.lib
-LIBRARY			smstestutils.lib msvtestutils.lib estor.lib
-library			commsdat.lib bafl.lib efsrv.lib 
-#ifndef WINS
-LIBRARY		etel.lib etelmm.lib 
-#endif
-UID    0x1000007a 0x10274073
-
-VENDORID 0x70000001
-
-
-SMPSAFE
--- a/messagingappbase/smsmtm/test/group/T_SmsEnum.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-// Copyright (c) 1999-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:
-// t_smsenum.mmp
-//
-
-TARGET          t_smsenum.exe
-TARGETTYPE      exe
-
-CAPABILITY All -TCB
-
-SOURCEPATH		../src
-SOURCE          T_SmsEnum.cpp
-
-USERINCLUDE     ../inc 
-SYSTEMINCLUDE   /epoc32/include
-
-LIBRARY         euser.lib msgs.lib smstestutils.lib msvtestutils.lib
-LIBRARY         esock.lib smsu.lib smcm.lib etext.lib c32.lib gsmu.lib
-
-#ifndef WINS
-LIBRARY		etel.lib etelmm.lib 
-#endif
-
-VENDORID 0x70000001
-
-SMPSAFE
--- a/messagingappbase/smsmtm/test/group/T_SmsRegress.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-// Copyright (c) 2000-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:
-// t_smsregress.mmp
-//
-
-target          t_smsregress.exe
-targettype      exe
-
-CAPABILITY All -TCB
-SOURCEPATH		../src
-source          T_SmsRegress.cpp 
-userinclude     ../inc 
-systeminclude   /epoc32/include 
-library         euser.lib msgs.lib		//smcm.lib
-library			smstestutils.lib msvtestutils.lib
-library         esock.lib smsu.lib
-
-EPOCSTACKSIZE 0x8000
-
-
-VENDORID 0x70000001
-
-SMPSAFE
--- a/messagingappbase/smsmtm/test/group/T_SmsSc.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Copyright (c) 1999-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:
-// t_smssc.mmp
-//
-
-target          t_smssc.exe
-targettype      exe
-
-CAPABILITY All -TCB
-SOURCEPATH		../src
-source          T_SmsSc.cpp
-userinclude     ../inc 
-systeminclude   /epoc32/include
-library         euser.lib msgs.lib smcm.lib
-library			smstestutils.lib msvtestutils.lib
-LIBRARY			etelmm.lib
-LIBRARY			autotest.lib
-LIBRARY			testconfigfileparser.lib
-LIBRARY			efsrv.lib 
-LIBRARY			esock.lib
-library			smsu.lib
-VENDORID 0x70000001
-
-SMPSAFE
--- a/messagingappbase/smsmtm/test/group/T_SmsSendAs.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-// Copyright (c) 1999-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:
-// t_smsendas.mmp
-// 
-//
-
-target          t_smssendas.exe
-targettype      exe
-
-CAPABILITY All -TCB
-SOURCEPATH		..\src
-source          t_smssendas.cpp
-userinclude     ..\inc
-systeminclude   \epoc32\include
-library         euser.lib msgs.lib smcm.lib esock.lib
-library			smstestutils.lib msvtestutils.lib send.lib etext.lib gsmu.lib
-library			smsu.lib
-VENDORID 0x70000001
-
-SMPSAFE
--- a/messagingappbase/smsmtm/test/group/T_SmsSendNbs.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-// Copyright (c) 1999-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:
-// t_smssendnbs.mmp
-//
-
-target          t_smssendnbs.exe
-targettype      exe
-
-CAPABILITY All -TCB
-SOURCEPATH		../src
-source          T_SmsSendNbs.cpp T_SmsSendBase.cpp
-userinclude     ../inc 
-systeminclude   /epoc32/include
-library         euser.lib msgs.lib
-library			smstestutils.lib msvtestutils.lib
-library			esock.lib smsu.lib
-EPOCSTACKSIZE 0x8000
-
-VENDORID 0x70000001
-
-SMPSAFE
--- a/messagingappbase/smsmtm/test/group/T_SmsSendRecv.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-// Copyright (c) 1999-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:
-// t_smssendrecv.mmp
-//
-
-target          t_smssendrecv.exe
-targettype      exe
-
-CAPABILITY All -TCB
-SOURCEPATH		../src
-source          T_SmsSendRecv.cpp
-userinclude     ../inc 
-systeminclude   /epoc32/include
-library         euser.lib msgs.lib
-library			smstestutils.lib msvtestutils.lib smcm.lib
-LIBRARY       efsrv.lib esock.lib smsu.lib gsmu.lib
-
-SOURCEPATH	.
-
-START RESOURCE	../data/bif/koala.rss
-TARGETPATH	/msgtest/sms
-LANG		SC
-END
-
-START RESOURCE	../data/bif/giraffe.rss
-TARGETPATH	/msgtest/sms
-LANG		SC
-END
-
-START BITMAP	smcm.mbm
-TARGETPATH	/msgtest/sms
-SOURCEPATH	../data/bif
-SOURCE		2 smcm.bmp
-END
-
-EPOCSTACKSIZE 0x8000
-VENDORID 0x70000001
-
-SMPSAFE
--- a/messagingappbase/smsmtm/test/group/T_SmsSendText.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-// Copyright (c) 1999-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:
-// t_smssendtext.mmp
-//
-
-target          t_smssendtext.exe
-targettype      exe
-
-CAPABILITY All -TCB
-SOURCEPATH	../src
-source          T_SmsSendText.cpp  T_SmsSendBase.cpp
-userinclude     ../inc 
-systeminclude   /epoc32/include
-library         euser.lib msgs.lib
-library			smstestutils.lib msvtestutils.lib smcm.lib
-library			esock.lib smsu.lib efsrv.lib 
-
-EPOCSTACKSIZE 0x8000
-VENDORID 0x70000001
-
-SMPSAFE
--- a/messagingappbase/smsmtm/test/group/T_SmsSendWap.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-// Copyright (c) 1999-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:
-// t_smssendwap.mmp
-//
-
-target          t_smssendwap.exe
-targettype      exe
-
-CAPABILITY All -TCB
-SOURCEPATH		../src
-source          T_SmsSendWap.cpp  T_SmsSendBase.cpp
-userinclude     ../inc 
-systeminclude   /epoc32/include
-library         euser.lib msgs.lib esock.lib
-library			smstestutils.lib msvtestutils.lib
-library			smsu.lib
-EPOCSTACKSIZE 0x8000
-
-VENDORID 0x70000001
-
-SMPSAFE
--- a/messagingappbase/smsmtm/test/group/T_schsms.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-// Copyright (c) 1999-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:
-// t_schsms.mmp
-//
-
-target          t_schsms.exe
-targettype      exe
-
-CAPABILITY All -TCB
-SOURCEPATH		../src
-source          T_SchSms.cpp
-userinclude     ../inc 
-systeminclude   /epoc32/include
-library         euser.lib msgs.lib
-library			smstestutils.lib msvtestutils.lib
-VENDORID 0x70000001
-
-SMPSAFE
--- a/messagingappbase/smsmtm/test/group/T_smcm1.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-// Copyright (c) 2000-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:
-// t_smcm1.mmp
-//
-
-target          t_smcm1.exe
-targettype      exe
-
-CAPABILITY All -TCB
-SOURCEPATH		../src
-source          T_smcm.cpp 
-userinclude     ../inc 
-systeminclude   /epoc32/include 
-library         euser.lib smcm.lib msgs.lib etext.lib
-library			smstestutils.lib msvtestutils.lib gsmu.lib efsrv.lib
-
-UID    0x1000007a 0x10274038
-VENDORID 0x70000001
-
-SMPSAFE
--- a/messagingappbase/smsmtm/test/group/T_smcm2.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-// Copyright (c) 2000-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:
-// t_smcm2.mmp
-//
-
-target          t_smcm2.exe
-targettype      exe
-
-CAPABILITY All -TCB
-SOURCEPATH		../src
-SOURCE          T_smut.cpp
-
-SOURCEPATH		../../clientmtm/src
-SOURCE			csmsemailfields.cpp SMUTHDR.CPP
-
-USERINCLUDE		../inc 
-SYSTEMINCLUDE   /epoc32/include /epoc32/include/ecom
-LIBRARY         euser.lib smcm.lib msgs.lib etext.lib gsmu.lib
-LIBRARY			smstestutils.lib msvtestutils.lib estor.lib
-library			commsdat.lib bafl.lib efsrv.lib ecom.lib
-
-EPOCSTACKSIZE 0x8000
-
-
-UID    0x1000007a 0x10274039
-VENDORID 0x70000001
-
-SMPSAFE
--- a/messagingappbase/smsmtm/test/group/T_smcmsimtsytest.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Copyright (c) 1999-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:
-// t_smcmsimtsytest.mmp
-//
-
-target          t_smcmsimtsytest.exe
-targettype      exe
-
-CAPABILITY All -TCB
-SOURCEPATH	../src
-source          T_smcmsimtsytest.cpp  //t_smssendbase.cpp
-userinclude     ../inc 
-systeminclude   /epoc32/include
-library         euser.lib msgs.lib
-library			smstestutils.lib msvtestutils.lib
-LIBRARY			autotest.lib esock.lib efsrv.lib
-LIBRARY			smsu.lib smcm.lib testconfigfileparser.lib
-//LIBRARY		smcm.lib imut.lib fxcm.lib imcm.lib etel.lib
-
-EPOCSTACKSIZE 0x8000
-
-VENDORID 0x70000001
-
-SMPSAFE
--- a/messagingappbase/smsmtm/test/group/t_SmsReplyToServer.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-// Copyright (c) 2005-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:
-//
-
-TARGET       	t_SmsReplyToServer.exe
-TARGETTYPE  	exe
-UID             0x1000007A 0x101F777C
-VENDORID 0x70000001
-
-CAPABILITY All -TCB
-
-SOURCEPATH  	..\src
-SOURCE		t_SmsReplyToServer.cpp
-SOURCE		t_SmsReplyToStep.cpp	
-
-USERINCLUDE   	..\inc
-SYSTEMINCLUDE 	\epoc32\include
-SYSTEMINCLUDE 	\epoc32\include\test
-SYSTEMINCLUDE 	\epoc32\include\libc
-
-LIBRARY     euser.lib
-LIBRARY		testexecuteutils.lib
-LIBRARY		testexecutelogclient.lib
-LIBRARY     msgs.lib smstestutils.lib msvtestutils.lib commsdat.lib 
-LIBRARY		smcm.lib esock.lib smsu.lib c32.lib gsmu.lib  efsrv.lib etel.lib etelmm.lib
-
-
-SMPSAFE
--- a/messagingappbase/smsmtm/test/group/t_SmsSpecialIndicationsServer.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-// Copyright (c) 2005-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:
-//
-
-TARGET       	t_SmsSpecialIndicationsServer.exe
-TARGETTYPE  	exe
-UID             0x1000007A 0x101F777C
-VENDORID 0x70000001
-
-CAPABILITY All -TCB
-
-SOURCEPATH  	..\src
-SOURCE		t_SmsSpecialIndicationsServer.cpp
-SOURCE		t_SmsSpecialIndicationsStep.cpp	
-
-USERINCLUDE   	..\inc
-SYSTEMINCLUDE 	\epoc32\include
-SYSTEMINCLUDE 	\epoc32\include\test
-SYSTEMINCLUDE 	\epoc32\include\libc
-
-LIBRARY     	euser.lib testexecuteutils.lib testexecutelogclient.lib
-LIBRARY     	msgs.lib smstestutils.lib msvtestutils.lib commsdat.lib 
-LIBRARY		smcm.lib esock.lib smsu.lib c32.lib gsmu.lib  efsrv.lib etel.lib etelmm.lib
-
-
-SMPSAFE
--- a/messagingappbase/smsmtm/test/group/t_smcmrecvmanual.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-// Copyright (c) 1999-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:
-// t_smcmrecvmanual.mmp
-//
-
-target          t_smcmrecvmanual.exe
-targettype      exe
-
-CAPABILITY All -TCB
-SOURCEPATH	../src
-source          t_smcmrecvmanual.cpp
-userinclude     ../inc 
-systeminclude   /epoc32/include
-library         euser.lib msgs.lib
-library		smstestutils.lib msvtestutils.lib gsmu.lib smcm.lib
-
-VENDORID 0x70000001
-
-SMPSAFE
--- a/messagingappbase/smsmtm/test/group/t_smcs2_server.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-// Copyright (c) 2005-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:
-// Using relative paths for sourcepath and user includes
-// 
-//
-
-TARGET       t_smcs2_server.exe
-TARGETTYPE  exe
-UID             0x1000007A 0x101F777C
-VENDORID 0x70000001
-
-CAPABILITY All -TCB
-
-SOURCEPATH  ../src
-SOURCE	    t_smcs2_server.cpp t_testSmsBase_Step.cpp t_testSmsEntry_Step.cpp t_testSmsSettings_Step.cpp t_testSmsNumber_Step.cpp 
-SOURCE	    t_testSmsEmailFields_Step.cpp t_testsmsHeader_step.cpp T_smutTE.cpp  t_testSmsUtilities_Step.cpp t_testSmsEmsExtensions_step.cpp
-
-SOURCEPATH		../../clientmtm/src
-SOURCE			csmsemailfields.cpp SMUTHDR.CPP
-
-USERINCLUDE   ../inc 
-SYSTEMINCLUDE /epoc32/include
-SYSTEMINCLUDE /epoc32/include/test
-SYSTEMINCLUDE /epoc32/include/libc
-
-LIBRARY     	euser.lib
-LIBRARY		testexecuteutils.lib
-LIBRARY		testexecutelogclient.lib
-LIBRARY		efsrv.lib etext.lib bafl.lib
-LIBRARY         smcm.lib msgs.lib gsmu.lib
-LIBRARY		smstestutils.lib msvtestutils.lib estor.lib commsdat.lib
-SMPSAFE
--- a/messagingappbase/smsmtm/test/group/t_smsbiofication.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-// Copyright (c) 1999-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:
-// t_smsbiofication.mmp
-//
-
-target          t_smsbiofication.exe
-targettype      exe
-
-CAPABILITY All -TCB
-SOURCEPATH		../src
-source          t_smsbiofication.cpp
-userinclude     ../inc 
-systeminclude   /epoc32/include
-library         euser.lib msgs.lib
-library			esock.lib smsu.lib smstestutils.lib msvtestutils.lib
-VENDORID 0x70000001
-
-SMPSAFE
--- a/messagingappbase/smsmtm/test/group/t_smsdetails.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-// Copyright (c) 2004-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:
-// t_smsdetails.mmp
-//
-
-TARGET          t_smsdetails.exe
-TARGETTYPE      exe
-
-CAPABILITY All -TCB
-
-SOURCEPATH	../src
-SOURCE          t_smsdetails.cpp
-
-USERINCLUDE     ../inc 
-SYSTEMINCLUDE   /epoc32/include
-
-LIBRARY         euser.lib msgs.lib smstestutils.lib msvtestutils.lib smcm.lib esock.lib smsu.lib
-LIBRARY		c32.lib gsmu.lib
-
-#ifndef WINS
-LIBRARY		etel.lib etelmm.lib 
-#endif
-
-VENDORID 0x70000001
-
-
-SMPSAFE
--- a/messagingappbase/smsmtm/test/group/t_smsinit.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-// Copyright (c) 1999-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:
-//
-
-target          t_smsinit.exe
-targettype      exe
-
-CAPABILITY All -TCB
-SOURCEPATH		..\src
-source          t_smsinit.cpp
-userinclude     ..\inc
-systeminclude   \epoc32\include
-library         euser.lib
-library		smstestutils.lib msvtestutils.lib
-VENDORID 0x70000001
-
-SMPSAFE
--- a/messagingappbase/smsmtm/test/inc/T_SchSms.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-// Copyright (c) 1999-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 <smstestbase.h>
-
-class CSchSmsTest : public CSmsTestBase, MMsvSessionObserver
-	{
-public:
-
-	static CSchSmsTest* NewLC(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest);
-
-protected:
-	CSchSmsTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest);
-	~CSchSmsTest();
-	virtual void ConstructL();
-
-	void RunL();
-	void DoCancel();
-
-	void TestDeleteScheduleL();
-	void TestCheckScheduleL();
-
-	void ShowMenuL();
-	virtual void RunAutoL();
-
-	void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
-
-	virtual void DoRunSendingL();
-	virtual void DoRunSchedulingL();
-
-	//From CSmsTestBase
-	void DoTestSendingL(const TDesC& aScriptFile);
-	void DoTestSchedulingL(const TDesC& aScriptFile, TTimeIntervalSeconds aFromNow = 5);
-
-protected:
-	enum TSmsSendTestState
-		{
-		EStateWaiting,
-		EStateSending,
-		EStateCheckSchedule,
-		EStateDeleteSchedule
-		} iState;
-	};
--- a/messagingappbase/smsmtm/test/inc/T_SmcmFail.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-// Copyright (c) 1999-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 T_SMCMFAIL_H_
-#define T_SMCMFAIL_H_
-
-#include <e32base.h>
-#include <txtrich.h>    //CRichText
-#include <e32test.h>
-#include "smutset.h"	// sms settings
-#include "smsclnt.h"	// sms (a)sync commands
-#include <smuthdr.h>
-#include <smstestbase.h>
-
-GLDEF_D RTest				test(_L("SMCM Test Harness"));
-GLDEF_D CTrapCleanup*		theCleanup;
-
-const TMsvPartList KMsvMessagePartBody			= 0x00000001;
-const TMsvPartList KMsvMessagePartRecipient		= 0x00000002;
-const TMsvPartList KMsvMessagePartOriginator	= 0x00000004;
-const TMsvPartList KMsvMessagePartDescription	= 0x00000008;
-const TMsvPartList KMsvMessagePartDate			= 0x00000010;
-const TMsvPartList KMsvMessagePartAttachments	= 0x00000020;
-
-GLDEF_C TInt E32Main(void);
-LOCAL_C void doMainL(void);
-
-class CSmcmFailTest : public CSmsTestBase
-	{
-public:
-	static CSmcmFailTest* NewL(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest);
-	~CSmcmFailTest();
-
-private:
-	CSmcmFailTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest);
-	void ConstructL();
-
-	void RunL() {};
-	void DoCancel() {};
-
-	void ShowMenuL();
-	void RunAutoL();
-
-	//Test Functions
-	void TestSettingsFailL();
-	void TestHeaderFailL();
-	void TestNumberFailL();
-	void TestReplyFailL();
-	void TestForwardFailL();
-	void TestLoadFailL();
-	void TestSaveFailL();
-	void TestAddresseeFailL();
-	void TestBifFailL();
-
-	void CleanFolderL(TMsvId aFolder);
-
-	CRichText*			iRichText;
-	CParaFormatLayer*	iParaLayer;
-	CCharFormatLayer*	iCharLayer;
-	};
-
-
-#endif
--- a/messagingappbase/smsmtm/test/inc/T_SmsCancel.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-// Copyright (c) 1999-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 <smstestbase.h>
-#include <smsuaddr.h>
-
-class CSmsCancelTest : public CSmsTestBase, MMsvSessionObserver
-	{
-public:
-	static CSmsCancelTest* NewLC(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest);
-
-private:
-	CSmsCancelTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest);
-	~CSmsCancelTest();
-	virtual void ConstructL();
-
-	void RunL();
-	void DoCancel();
-
-	void TestCancelSendingL();
-	void TestCancelSendingAfterScheduleL();
-	void TestCancelReadScL();
-	void TestCancelWriteScL();
-	void TestCancelReadSimParamsL();
-	void TestCancelEnumerateL();
-	
-	void ShowMenuL();
-	virtual void RunAutoL();
-
-	void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
-	void CancelIfSendingL(const CMsvEntrySelection& aSelection);
-
-	virtual void DoRunSendingL();
-	virtual void DoRunSchedulingL();
-
-	RSocketServ iSocketServ;	//< A Socket Server
-	RSocket iSocket;			//< A Socket
-
-
-protected:
-	enum TSmsSendTestState
-		{
-		EStateWaiting,
-		EStateSending,
-		EStateScheduling
-		} iState;
-	};
--- a/messagingappbase/smsmtm/test/inc/T_SmsEnum.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-// Copyright (c) 1999-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 <smsclnt.h>
-#include <smuthdr.h>
-#include <smstestbase.h>
-#include <smsuaddr.h>
-
-_LIT(KSmsEnumTestName, "Enumerate and Write to SIM");
-
-class CSmsEnumTest : public CSmsTestBase
-	{
-public:
-	static CSmsEnumTest* NewLC(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest);
-	~CSmsEnumTest();
-
-private:
-	CSmsEnumTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest);
-	void ConstructL();
-
-	void RunL();
-	void DoCancel();
-
-	void TestEnumerateL(TMsvId aFolderId=KErrNotFound);
-	void TestEnumerateAndDescLengthL(TMsvId aFolderId=KErrNotFound);
-	void TestCopyFromSimL(TMsvId aFolderId=KErrNotFound);
-	void TestMoveFromSimL(TMsvId aFolderId=KErrNotFound);
-	void TestDeleteFromSimL();
-
-	void TestEnumerateAndDetailsFieldL();
-
-	void TestCopyToSimL();
-	void TestMoveToSimL(TMsvId aSourceFolderId);
-	void TestDeleteRemoteEntryL();
-
-	void TestMultipleRecipientEnumerateL();
-
-	void TestUnreadStatusL();
-	void TestReadStatusL();
-	void TestPhoneStoreStatusL(TMsvId aFolderId);
-	void TestSimStoreStatusL(TMsvId aFolderId);
-
-	void ShowMenuL();
-	void RunAutoL();
-
-	void DoRunEnumerateL();
-	void DoRunEnumerateAndDescLengthL();
-	void DoRunCopyToSim();
-	void DoRunMoveToSim();
-	void DoRunCopyMoveDeleteFromSim();
-	void DoRunClearInbox();
-
-	void ShowMenuAfterEnumerateL();
-	void CheckParentAfterEnumerateL();
-	TInt ErrorStatus();
-
-	TInt GetInboxMsgsCountL();
-	void ClearInboxL();
-	void SaveClass2FolderIdL(TMsvId aFolderId);
-
-	void TestAllEnumerateL(TMsvId aFolderId=KErrNotFound);
-	TMsvId CreateEnumerateFolderLC(TMsvId aParent);
-
-private:
-	enum TSchSmsTestState
-	/**	@enum	TSchSmsTestState
-	 *	Enum defining the states of this test harness
-	 */
-		{
-		EStateWaiting,
-		EStateEnumerating,
-		EStateEnumeratingAndDescLength,
-		EStateEnumeratingAndDetailsField,
-		EStateCopyFromSim,
-		EStateMoveFromSim,
-		EStateDeleteFromSim,
-		EStateCopyToSim,
-		EStateMoveToSim,
-		EStateClearInbox
-		} iState;
-
-	RSocketServ iSocketServ;	//< A Socket Server
-	RSocket iSocket;			//< A Socket
-	TPckgBuf<TMsvId> iLastEnumerateFolder;
-
-	CRichText* iBody;
-	CSmsHeader* iHeader;
-	CParaFormatLayer* iParaFormat;
-	CCharFormatLayer* iCharFormat;
-
-	};
--- a/messagingappbase/smsmtm/test/inc/T_SmsRegress.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +0,0 @@
-// Copyright (c) 1999-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 T_SMCM2_H_
-//#define T_SMCM2_H_
-//#include <e32base.h>
-
-//#include <s32std.h>
-//#include <txtrich.h>    //CRichText
-//#include <e32test.h>
-//#include <msvuids.h>	// ServiceEntry, FolderEntry, etc.
-//#include <mtmuids.h>	// query capabilities
-//#include "smutset.h"	// sms settings
-//#include "smuthdr.h"	// sms header
-//#include "smsclnt.h"	// sms (a)sync commands
-#include <smstestbase.h>
-//#include <commdb.h>
-#include <smsuaddr.h>
-
-GLDEF_D RTest				test(_L("SMS Regression Test Harness"));
-GLDEF_D CTrapCleanup*		theCleanup;
-
-GLDEF_C TInt E32Main(void);
-LOCAL_C void doMainL(void);
-
-class TCompare
-	{
-	public:
-		TCompare(TBool aVal = ETrue) {iValue = aVal;}
-		TCompare(const TCompare& aVal) {iValue = aVal.iValue;}
-		void operator()(TBool aResult) {iValue = iValue && aResult;}
-		operator TBool() const {return iValue;}
-		TBool iValue;
-	};
-
-class COpActiveArray;
-
-class COpActive : public CActive
-	{
-public:
-	COpActive(COpActiveArray& aParent, TMsvId aId, TInt aPriority = CActive::EPriorityStandard);
-	~COpActive();
-	CMsvOperation* iOperation;
-	TRequestStatus& Status() {SetActive(); return iStatus;}
-	TMsvId Id() const {return iId;}
-
-private:
-	void RunL();
-	void DoCancel();
-	TInt RunError(TInt aError);
-	void Complete(TInt aError);
-
-	COpActiveArray& iParent;
-	CSmsTestUtils& iSmsTest;
-	TMsvId iId;
-	};
-
-class COpActiveArray : public CArrayPtrFlat<COpActive>
-	{
-	friend class COpActive;
-
-public:
-	COpActiveArray(CSmsTestUtils& aSmsTest);
-	~COpActiveArray();
-	void Start(TRequestStatus& aStatus);
-	CSmsTestUtils& iSmsTest;
-	void Cancel();
-
-private:
-	void ActiveComplete(const CActive& aActive, TInt aError);
-
-private:
-	TRequestStatus* iReport;
-	};
-
-class CSmsRegressTest : public CSmsTestBase
-	{
-public:
-	static CSmsRegressTest* NewLC(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest);
-	~CSmsRegressTest();
-
-private:
-	CSmsRegressTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest);
-	void ConstructL();
-
-	void RunL();
-	void DoCancel();
-	TInt RunError(TInt aError);
-
-	void ShowMenuL();
-	void RunAutoL();
-
-	void Test2SMSSInstancesL();
-	void DoRunTest2SMSSInstancesL();
-
-	//TBool CompareSettings(const CSmsSettings& aLeft, const CSmsSettings& aRight, TBool aTestSC = ETrue);
-	//TBool CompareMessageSettings(const CSmsMessageSettings& aLeft, const CSmsMessageSettings& aRight);
-	//TBool CompareNumbers(const CSmsNumber& aLeft, const CSmsNumber& aRight);
-
-	enum TSmsRegressTestState
-		{
-		EIdle,
-		ETest2SMSSInstances
-		} iState;
-
-	COpActiveArray iOperations;
-	CTestUtilsWatcherStarter* iWatchers;
-
-	RSocketServ iSocketServ;	//< A Socket Server
-	RSocket iSocket;			//< A Socket
-	};
-
-
-//#endif
--- a/messagingappbase/smsmtm/test/inc/T_SmsSc.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-// Copyright (c) 1999-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 <smstestbase.h>
-#include <mmlist.h>
-
-
-class CSmsSimParamOperation;
-class CAutoTest;
-
-
-_LIT(KSmsScTestName, "Reading and Writing SIM parameters");
-
-class CSmsScTest : public CSmsTestBase
-	{
-public:
-	static CSmsScTest* NewLC(CAutoTest& aAutoTest, CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest);
-	~CSmsScTest();
-
-	void ReadInitialParamsL(TRequestStatus& aStatus);
-	void WriteOriginalParamsL(TRequestStatus& aStatus);
-	void RoundTripTestL(const CMobilePhoneSmspList& aList, TRequestStatus& aStatus);
-
-	void TestReadParamsFailL();
-	void TestWriteParamsFailL(const CMobilePhoneSmspList& aList);
-
-	//inline const CMobilePhoneSmspList& OriginalList() const {return iOriginalParams->SmspParams();}
-	inline const CSmsSimParamOperation& OriginalOperation() const {return *iOriginalParams;}
-
-	static void PrintListL(RTest& aTest, const CMobilePhoneSmspList& aList);
-	static void PrintEntry(RTest& aTest, const RMobileSmsMessaging::TMobileSmspEntryV1& aEntry);
-
-private:
-
-	CSmsScTest(CAutoTest& aAutoTest, CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest);
-
-	void WriteSimParamsL();
-	void ReadAfterWriteL();
-	
-	void DoRunReadInitialParamsL();
-	void DoRunWriteSimParamsL();
-	void DoRunReadAfterWriteL();
-	void DoRunWriteOriginalParamsL();
-
-	TBool CompareListsL(const CMobilePhoneSmspList& aWritten, const CMobilePhoneSmspList& aRead);
-	TBool CompareEntries(const RMobileSmsMessaging::TMobileSmspEntryV1& aWritten, const RMobileSmsMessaging::TMobileSmspEntryV1& aRead);
-
-	void ConstructL();
-
-	void RunL();
-	void DoCancel();
-
-	void ShowMenuL();
-	void RunAutoL();
-
-	void Queue(TRequestStatus& aStatus);
-	void Complete(TInt aError);
-	TInt RunError(TInt aError);
-
-private:
-
-	enum TSmsSendTestState
-	/**	@enum	TSmsSendTestState
-	 *	Enum defining the states of this test harness
-	 */
-		{
-		EStateWaiting,
-		EStateReadInitialParams,
-		EStateWriteSimParams,
-		EStateReadAfterWrite,
-		EStateWriteOriginalParams
-		} iState;
-
-	CSmsSimParamOperation* iOriginalParams;		//< The operation contains the original parameters
-	const CMobilePhoneSmspList* iListToWrite;	//< The list contains the new parameters to write
-	TRequestStatus* iReport;					//< A request status
-	CAutoTest& iAutoTest;						//< An auto test
-	};
--- a/messagingappbase/smsmtm/test/inc/T_SmsSendAs.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-// Copyright (c) 1999-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 <SmsTestBase.h>
-
-#include "sendas.h"
-
-#include <smsuaddr.h>
-
-class CSmsSendAsTest : public CSmsTestBase, MSendAsObserver
-	{
-public:
-	static CSmsSendAsTest* NewL(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest);
-
-private:
-	CSmsSendAsTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest);
-	~CSmsSendAsTest();
-
-	virtual void ConstructL();
-
-	void RunL();
-	void DoCancel();
-
-	void ShowMenuL();
-	void RunAutoL();
-
-	void TestSendAsL();
-	void TestSendingL();
-	void DoRunSendingL();
-
-	void DeleteChildrenL(TMsvId aParent);
-
-	TBool CapabilityOK(TUid aCapability, TBool aResponse);
-
-	void CompareHeadersL(const CSmsHeader& aHeader1, const CSmsHeader& aHeader2) const;
-	void CompareSettingsL(const CSmsMessageSettings& aS1, const CSmsMessageSettings& aS2);
-
-
-private:
-	/**	@enum	ESendAsTestState
-	 *	Enum defining the states of this test harness
-	 */
-	enum ESendAsTestState
-		{
-		EStateWaiting,
-		EStateSending
-		} iState;
-
-	RSocketServ iSocketServ;	//< A Socket Server
-	RSocket iSocket;			//< A Socket
-	};
--- a/messagingappbase/smsmtm/test/inc/T_SmsSendBase.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-// Copyright (c) 1999-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 <smstestbase.h>
-
-class CSmsSendTestBase : public CSmsTestBase, MMsvSessionObserver
-	{
-protected:
-	CSmsSendTestBase(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest);
-	~CSmsSendTestBase();
-	virtual void ConstructL();
-
-	void RunL();
-	void DoCancel();
-
-	virtual void TestSendingL() = 0;
-	virtual void TestSchedulingL() = 0;
-	
-	void ShowMenuL();
-	virtual void RunAutoL();
-
-	void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
-
-	virtual void DoRunSendingL();
-	virtual void DoRunSchedulingL();
-
-	//From CSmsTestBase
-	void DoTestSendingL(const TDesC& aScriptFile);
-	void DoTestSchedulingL(const TDesC& aScriptFile, TTimeIntervalSeconds aFromNow = 5);
-
-private:
- 	void TestForwardSentMsgL();
- 
-protected:
-	enum TSmsSendTestState
-	/**	@enum	TSmsSendTestState
-	 *	Enum defining the states of this test harness
-	 */
-		{
-		EStateWaiting,
-		EStateSending,
-		EStateScheduling,
-		EStateSchedulingThenSend,
-		EStateOther
-		} iState;
-	};
--- a/messagingappbase/smsmtm/test/inc/T_SmsSendNbs.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-// Copyright (c) 1999-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 "T_SmsSendBase.h"
-
-//SMS Scripting
-_LIT(KNbsScript, "nbs.script");
-
-class CSmsSendNbsTest : public CSmsSendTestBase
-	{
-public:
-	static CSmsSendNbsTest* NewL(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest);
-
-private:
-	CSmsSendNbsTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest);
-	void TestSendingL();
-	void TestSchedulingL();
-	};
--- a/messagingappbase/smsmtm/test/inc/T_SmsSendRecv.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +0,0 @@
-// Copyright (c) 1999-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 <smstestbase.h>
-
-#include <msvapi.h>
-#include <smsuaddr.h>
-
-_LIT(KSmsSendRecvTestName, "Send and Receive");
-
-class CEntryObserver : public CBase, public MMsvEntryObserver
-	{
-public:
-	void HandleEntryEventL(TMsvEntryEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
-	~CEntryObserver();
-public:
-
-	static CEntryObserver* NewL(CSmsTestUtils& aTestUtils, const TInt& aCurrentMessageNum);
-	const CMsvEntrySelection& Received() const {return *iReceived;}
-	TMsvId Received(TInt aItem) const {return iReceived->At(aItem);}
-	TInt Count() const {return iReceived->Count();}
-	TMsvId LastReceived() const {return Count() ? Received(Count() - 1) : KErrNotFound;}
-	TMsvId ItemReceived(TInt aItem) const {return Count() ? Received(aItem) : KErrNotFound;}
-
-private:
-
-	void CheckReceivedMessageL(TMsvId aId);
-	CEntryObserver(CSmsTestUtils& aTestUtils, const TInt& aCurrentMessageNum);
-	
-	CMsvEntrySelection* iReceived;			//< An array containing the received messages
-	const TInt& iCurrentMessageNum;			//< Number of the current message
-	CSmsTestUtils& iSmsTest;				//< Sms Test Util
-	};
-
-const TTimeIntervalMicroSeconds32 KWaitForReceiveIteration = 2000000;
-const TTimeIntervalMicroSeconds32 KMaxWaitForMsg = 90000000;
-const TTimeIntervalMicroSeconds32 KWaitForWatchersToStart = 20000000;
-
-const TTimeIntervalMicroSeconds32 KWaitForWatchersToStartDisplayInterval = 5000000;
-const TTimeIntervalMicroSeconds32 KWaitForWatchersToDie = 2000000;
-
-//Command Line Switches
-_LIT(KParseAfterReceive, "/p");
-_LIT(KSaveAfterReceive, "/s");
-_LIT(KWaitForever, "/w");
-_LIT(KTestBifs, "/b");
-_LIT(KRunEmsTests, "/e"); // if on, uses ems script instead
-
-//Test Bifs
-_LIT(KSendRecvScript, "sendrecv.script");
-_LIT(KSendRecvEmsScript, "sendrecv_ems.script");
-_LIT(KTestBif1, "Koala.rsc");
-_LIT(KTestBif2, "Giraffe.rsc");
-_LIT(KBifDir, "c:\\system\\bif\\"); 
-const TTimeIntervalMicroSeconds32 KBifWait = 4000000;
-
-class CSmsSendRecvTest : public CSmsTestBase
-	{
-public:
-	static CSmsSendRecvTest* NewLC(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest);
-	~CSmsSendRecvTest();
-
-private:
-	CSmsSendRecvTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest);
-
-	TBool WatchersAlreadyRunningL();
-
-	void TestSendingL();
-	TBool SendNextMessageL();
-	void StartWatcherL();
-	void TestWaitForReceiveL();
-	void TestParseL();
-	void DoRunTestParseL();
-
-	void TestBifsL();
-	void TestAddBifL(const TDesC& aBifName);
-	void TestRemoveBifL(const TDesC& aBifName);
-
-	void ConstructL();
-
-	void RunL();
-	void DoCancel();
-
-	TInt RunError(TInt aError);
-	void RunComplete();
-
-	void ShowMenuL();
-	void RunAutoL();
-
-	void DoRunSendingL();
-	void DoRunWaitingToReceiveL();
-	void DoWaitL();
-
-	void WaitForExtraL();
-	void DoRunWaitForExtraL();
-
-	TInt CountRecipientsL(TMsvId aId);
-	void StoreMessageL(TMsvId aId, const CSmsHeader& aHeader);
-
-	void SendMessageIndicationL(TUint8 aMessageType = TSmsUtilities::EVoiceMessageWaiting, TUint8 aMessageCount=1);
-	void SendReplaceTypeMessageL();
-	TInt GetIndexOfSectionL(const TDesC& aSectionName);
-	void TestReplyL();
- 	void SetSmsSettingsL();
-
-
-	CEntryObserver* iEntryObserver;			//< An Entry Observer
-
-	TInt iSent;								//< Total number of messages sent
-	TInt iTotal;							//< Total number of messages received
-
-	TInt iCountWaits;						//< Count to wait 
-	
-	CTestUtilsWatcherStarter* iWatchers;	//< A Watcher
-	CMsvEntry* iEntryForObserver;			//< A Msv Entry
-	TInt iCurrentMessageNum;				//< The number of the current message
-	TBool iParse;							//< A boolean
-	TBool iSaveToFile;						//< A boolean
-	TBool iWaitForever;						//< A boolean
-	TInt iMsgVCalenderIndex;				//< store the index of vCalender received message
-	
-	enum TSmsSendTestState
-	/**	@enum	TSmsSendTestState
-	 *	Enum defining the states of this test harness
-	 */
-		{
-		EStateWaiting,
-		EStateSending,
-		EStateWaitingToReceive,
-		EStateParsing,
-		EStateMessageReceived,
-		EStateWaitingToReceiveAnyExtra
-		} iState;
-
-	RSocketServ iSocketServ;	//< A Socket Server
-	RSocket iSocket;			//< A Socket
-	TBool iTestBifs;			
-	};
--- a/messagingappbase/smsmtm/test/inc/T_SmsSendText.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-// Copyright (c) 1999-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 "T_SmsSendBase.h"
-
-class CImTextServerSession;
-
-//SMS Scripting
-_LIT(KSmsScript,"sms.script");
-
-class CSmsSendTextTest : public CSmsSendTestBase
-	{
-public:
-	static CSmsSendTextTest* NewL(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest);
-	~CSmsSendTextTest();
-
-private:
-	CSmsSendTextTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest);
-	void TestSendingL();
-	void TestSchedulingL();
-	void TestSendWithDataCallL();
-	void WaitForEndOfDataCallL();
-	void TestConnectingL();
-	TBool GetDataLineInfoForPhoneL(RPhone& aPhone, RPhone::TLineInfo& aLineInfo);
-
-	void TestSendNoRecipientsL();
-
-	void RunAutoL();
-	void RunL();
-	void DoRunSendNoRecipientsL();
-
-	enum TSendTextTestState
-	/**	@enum	TSendTextTestState
-	 *	Enum defining the states of this test harness
-	 */
-		{
-		EStateWaiting,
-		EStateSendNoRecipients
-		} iSendTextTestState;
-
-	CImTextServerSession* iTextSession;		//< to establish a data call
-	};
--- a/messagingappbase/smsmtm/test/inc/T_SmsSendWap.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-// Copyright (c) 1999-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 "T_SmsSendBase.h"
-
-//SMS Scripting
-#define KWapScript _L("wap.script")
-const TTimeIntervalMicroSeconds32 KWaitForMsgToSend = 20000000;
-
-class CSmsSendWapTest : public CSmsSendTestBase
-	{
-public:
-	static CSmsSendWapTest* NewL(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest);
-
-private:
-	CSmsSendWapTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest);
-	void TestSendingL();
-	void TestSchedulingL();
-	void ConstructL();
-	void DoRunSendingL();
-	};
--- a/messagingappbase/smsmtm/test/inc/T_smcm.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-// Copyright (c) 2000-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 T_SMCM_H_
-#define T_SMCM_H_
-#include <e32base.h>
-
-#include <s32std.h>
-#include <txtrich.h>    //CRichText
-#include <e32test.h>
-#include <msvuids.h>	// ServiceEntry, FolderEntry, etc.
-#include <mtmuids.h>	// query capabilities
-#include "smutset.h"	// sms settings
-#include "smuthdr.h"	// sms header
-#include "smsclnt.h"	// sms (a)sync commands
-#include <smstestbase.h>
-
-GLDEF_D RTest				test(_L("SMCM Test Harness"));
-GLDEF_D CTrapCleanup*		theCleanup;
-
-const TUid KUidSmcmTestNonSense = {0x00011111};
-
-const TMsvPartList KMsvMessagePartBody			= 0x00000001;
-const TMsvPartList KMsvMessagePartRecipient		= 0x00000002;
-const TMsvPartList KMsvMessagePartOriginator	= 0x00000004;
-const TMsvPartList KMsvMessagePartDescription	= 0x00000008;
-const TMsvPartList KMsvMessagePartDate			= 0x00000010;
-const TMsvPartList KMsvMessagePartAttachments	= 0x00000020;
-
-GLDEF_C TInt E32Main(void);
-LOCAL_C void doMainL(void);
-
-class CSmcmTest : public CSmsTestBase
-	{
-public:
-	static CSmcmTest* NewLC(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest);
-	~CSmcmTest();
-
-private:
-	CSmcmTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest);
-	void ConstructL();
-
-	void RunL() {};
-	void DoCancel() {};
-
-	void ShowMenuL();
-	void RunAutoL();
-
-	//Test Functions
-	void TestSettingsL();
-
-	//Client Mtm Test Functions
-	void TestCapabilitiesL();
-	void TestFindL();
-	void TestFindAliasL();
-	void TestReplyL();
-	void TestReplyEmailL();
-	void DoTestReplyEmailL(const TDesC& aEmailMessageData, const TDesC& aAddress, const TDesC& aSubject);
-	TMsvId CreateEmailSmsMessageL(const TDesC& aEmailMessageData);
-	void TestForwardL();
-	void TestForwardEmailL();
-	void TestForwardL(const TMsvEntry& aEntry, TInt aBodyLength);
-	TBool TestForwardBodyL(const CRichText& aBody, const TDesC& aExpected) const;
-	void DoTestForwardEmailL(const TDesC& aEmailMessageData, const TDesC& aSubject, const TDesC& aBody);
-	TBool TestForwardEntry(const TMsvEntry& aOriginalEntry, const TMsvEntry& aForwardEntry) const;
-	HBufC* CreateRandomLC(TInt aLen) const;
-
-	void TestSyncFunctionsL();
-
-	CSmsHeader*			iSmsHeader;
-	CRichText*			iRichText;
-	CParaFormatLayer*	iParaLayer;
-	CCharFormatLayer*	iCharLayer;
-	};
-
-
-#endif
--- a/messagingappbase/smsmtm/test/inc/T_smcmsimtsytest.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-// Copyright (c) 1999-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 <smstestbase.h>
-
-class CAutoTest;
-
-class CMessageSendStates : public CBase
-	{
-	public:
-		static CMessageSendStates* NewLC(TMsvId aId);
-		static CMessageSendStates* NewL(TMsvId aId);
-		~CMessageSendStates();
-
-	private:
-		CMessageSendStates(TMsvId aId);
-		void ConstructL();
-
-	public:
-		TMsvId iId;
-		RArray<TInt> iStates;
-	};
-
-class RMessageSendStatesArray : public RPointerArray<CMessageSendStates>
-	{
-	public:
-		RMessageSendStatesArray();
-		TInt Find(TMsvId aId) const;
-		void CopyInSelectionL(const CMsvEntrySelection& aSelection);
-	};
-
-
-class CSmcmSendTest : public CActive, MMsvSessionObserver
-	{
-public:
-	static CSmcmSendTest* NewLC(CAutoTest& aAutoTest, CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt aExpectedError = KErrNone, TInt aPriority = EPriorityStandard);
-	~CSmcmSendTest();
-
-	void TestSendingL(TRequestStatus& aStatus);
-	void TestSchedulingL(TRequestStatus& aStatus);
-	void TestReceiveClass2L(TInt aTestNumber, TRequestStatus& aStatus);
-
-private:
-	CSmcmSendTest(CAutoTest& aAutoTest, CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt aExpectedError, TInt aPriority = EPriorityStandard);
-	void ConstructL();
-
-	void RunL();
-	void DoCancel();
-	
-	void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
-
-	void DoRunSendingL();
-	void DoRunSchedulingL();
-
-	CMsvSession& Session()	{return *iSmsTest.iMsvSession;}
-	CMsvEntry& MsvEntry()	{return *iSmsTest.iMsvEntry;}
-	CSmsClientMtm& Client()	{return *iSmsTest.iSmsClientMtm;}
-
-	void Queue(TRequestStatus& aStatus);
-	void Complete(TInt aError);
-	TInt RunError(TInt aError);
-
-	TBool CheckSendingStates(const RMessageSendStatesArray& sendStateArray);
-	void PrintSendingStates(const RMessageSendStatesArray& sendStateArray);
-
-	TBool CheckParentOfReceivedMessageL(const CMsvEntrySelection& aSelection);
-	void SetMessagesToReceiveL(TInt aTestNumber);
-
-	TBool CheckWatchersStartedL();
-
-	enum TSmsSendTestState
-		{
-		EStateWaiting,
-		EStateSending,
-		EStateScheduling,
-		EStateSchedulingThenSend,
-		EStateOther,
-		EStateTestReceiveClass2
-		} iState;
-
-	TRequestStatus* iReport;					//< A request status
-	CAutoTest& iAutoTest;						//< An auto test
-
-	CMsvOperation* iOperation;
-	CMsvEntrySelection* iSelection;
-	CTestTimer* iTimer;
-
-	TFileName iScriptFile;
-	CSmsTestUtils& iSmsTest;
-
-	RMessageSendStatesArray iCurrentMessages;
-	TInt iMessagesToReceive;
-	TInt iMessagesReceived;
-	CSmsSettings* iSmsSettings;
-	CTestUtilsWatcherStarter* iWatcherStarter;
-	TInt iExpectedError;
-	};
-
--- a/messagingappbase/smsmtm/test/inc/T_smut.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,173 +0,0 @@
-// Copyright (c) 1999-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 T_SMCM2_H_
-#define T_SMCM2_H_
-#include <e32base.h>
-
-#include <s32std.h>
-#include <txtrich.h>    //CRichText
-#include <e32test.h>
-#include <msvuids.h>	// ServiceEntry, FolderEntry, etc.
-#include <mtmuids.h>	// query capabilities
-#include "smutset.h"	// sms settings
-#include "smuthdr.h"	// sms header
-#include "smsclnt.h"	// sms (a)sync commands
-#include <smstestbase.h>
-#include <csmsgetdetdescinterface.h>
-
-#include <commsdattypesv1_1.h>
-#include <commsdat.h>
-using namespace CommsDat;
-
-#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS  
-#include <tmsvsmsentry.h>
-#endif
-
-class CSmsEmailFields;
-
-GLDEF_D RTest				test(_L("SMCM Test Harness"));
-GLDEF_D CTrapCleanup*		theCleanup;
-
-const TUid KUidSmcmTestNonSense = {0x00011111};
-const TUid KFileStreamId		= {0x01010101};
-
-const TMsvPartList KMsvMessagePartBody			= 0x00000001;
-const TMsvPartList KMsvMessagePartRecipient		= 0x00000002;
-const TMsvPartList KMsvMessagePartOriginator	= 0x00000004;
-const TMsvPartList KMsvMessagePartDescription	= 0x00000008;
-const TMsvPartList KMsvMessagePartDate			= 0x00000010;
-const TMsvPartList KMsvMessagePartAttachments	= 0x00000020;
-
-GLDEF_C TInt E32Main(void);
-LOCAL_C void doMainL(void);
-
-class TCompare
-	{
-	public:
-		TCompare(TBool aVal = ETrue) {iValue = aVal;}
-		TCompare(const TCompare& aVal) {iValue = aVal.iValue;}
-		void operator()(TBool aResult) {iValue = iValue && aResult;}
-		operator TBool() const {return iValue;}
-		TBool iValue;
-	};
-
-class CSmutTest : public CSmsTestBase
-	{
-public:
-	static CSmutTest* NewLC(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest);
-	~CSmutTest();
-
-private:
-	CSmutTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest);
-	void ConstructL();
-
-	void RunL() {};
-	void DoCancel() {};
-
-	void ShowMenuL();
-	void RunAutoL();
-
-	//Test Functions
-	void TestSettingsL();
-	void TestHeaderL();
-	void TestSmsUtilitiesL();
-	void TestSmsUtilities1L(CSmsHeader& aHeader);
-	void TestSmsUtilities2L(CSmsHeader& aHeader);
-	void TestSmsUtilities3L(CSmsHeader& aHeader);
-	void TestSmsUtilitiesTimeStampsL();
-	void TestInvalidTelephone(const TDesC& aTel, TDes& aDetails);
-	void TestInvalidContact(const TDesC& aTel, TDes& aDetails);
-	void TestDuplicateContact(const TDesC& aTel, TDes& aDetails);
-	void TestValidTel(const TDesC& aTel, const TDesC& aExpect1, const TDesC& aExpect2, const TDesC& aNotExpect, TDes& rDetails);
-	void TestSmsEmsExtensionsL();
-
-	void TestSmsUtilitiesBL();
-	void TestSmsUtilities4L(CSmsHeader& aHeader);
-	void TestSmsUtilities5L(CSmsHeader& aHeader);
-	void TestInvalidTelephone(CSmsGetDetDescInterface& aGetDetDesc, const TDesC& aTel, TDes& aDetails);
-	void TestInvalidContact(CSmsGetDetDescInterface& aGetDetDesc, const TDesC& aTel, TDes& aDetails);
-	void TestDuplicateContact(CSmsGetDetDescInterface& aGetDetDesc, const TDesC& aTel, TDes& aDetails);
-	void TestValidTel(CSmsGetDetDescInterface& aGetDetDesc, const TDesC& aTel, const TDesC& aExpect1, const TDesC& aExpect2, const TDesC& aNotExpect, TDes& rDetails);
-
-	//CSmsSettings utilities/tests
-	void TestSettingsStoreToCommDbL();
-	TBool CompareSettingsAndCommDbL(const CSmsSettings& aSettings) const;
-	TBool CompareSettingsAndSmsBearerL(const CSmsSettings& aSettings) const;
-//	void OpenCommDbModemTableLCC(CCommsDatabase*& rCommDb, CCommsDbTableView*& rTable) const;
-	void TestSettingsRestoreDefectL();
-	void TestRevertSettingsL();
-	TBool CompareSettings(const CSmsSettings& aLeft, const CSmsSettings& aRight, TBool aTestSC = ETrue);
-	TBool CompareMessageSettings(const CSmsMessageSettings& aLeft, const CSmsMessageSettings& aRight);
-	void TestSettingsMembersL(CSmsSettings& aSettings);
-	void TestMessageSettingsMembersL(CSmsMessageSettings& aSettings);
-	void StoreSettingsL(const CSmsSettings& aSettings);
-	void RestoreSettingsL(CSmsSettings& aSettings);
-	void StoreHeaderL(const CSmsHeader& aHeader);
-	void RestoreHeaderL(CSmsHeader& aHeader);
-	void TestStoreRestoreSettingsL(const CSmsSettings& aSettings);
-	TBool TestSmsSettingsCopyL(const CSmsSettings& aSettings);
-	TBool CompareSettingsFiles(
-		RFs& aFs, const TDesC& aCompare1, const TDesC& aCompare2
-		);
-
-	//TMsvSmsEntry
-	void TestSmsEntryL();
-	TBool CheckSmsEntry(
-					const TMsvSmsEntry& aEntry, 
-					TBool aClassExpected, 
-					TSmsDataCodingScheme::TSmsClass aClass, 
-					TUint8 aPID, 
-					TBool aUPI, 
-					TMsvSmsEntry::TMsvSmsEntryAckSummary aDeliverySummary, 
-					TBool aValidMessageId, 
-					TInt32 aMessageId) const;
-
-	TSmsProtocolIdentifier ConstructPID(TUint8 aVal) const;
-
-
-	//CSmsNumber utilities
-	void TestNumberL();
-	void StoreNumberL(const CSmsNumber& aNumber, TUid aStreamId = KFileStreamId);
-	void RestoreNumberL(CSmsNumber& rNumber, TUid aStreamId = KFileStreamId);
-	TBool CompareNumbers(const CSmsNumber& aLeft, const CSmsNumber& aRight);
-	TBool CompareServiceCenters(const CSmsServiceCenter& aLeft, const CSmsServiceCenter& aRight);
-
-	HBufC8* ConvertToBinaryLC(const TDesC8& aHex) const;
-	CSmsMessage* CreateSmsMessageLC(const TDesC8& aHexPdu) const;
-	void CheckDescriptionL(RResourceFile& aResFile, TInt aId, TRefByValue<const TDesC> aDesc, ...);
-	void TestSpecialSmsMessageIndicationPduL(RResourceFile& aResFile, TUint8 aMessageType, TUint8 aMessageCount, TInt aId);
-	void TestSpecialSmsMessageIndicationPduL(RResourceFile& aResFile, TSmsUtilities::TSmsUtilitiesSpecialMessageType aMessageType, TInt aId);
-	
-	// Test CSmsEmailFields
-	void TestEmailFieldsL();
-	void StoreEmailFieldsL(const CSmsEmailFields& aEmailFields);
-	void RestoreEmailFieldsL(CSmsEmailFields& aEmailFields);
-	void TestEmailFieldsParsePassL(const TDesC& aMessage, const TDesC& aAddress, const TDesC& aSubject, const TDesC& aBody);
-	void TestEmailFieldsParseFailL(const TDesC& aMessage);
-	void TestEmailFieldsComposeL(const TDesC& aFields, const TDesC& aAddress1, const TDesC& aAddress2, const TDesC& aSubject);
-	TBool CompareEmailFields(const CSmsEmailFields& aFields1, const CSmsEmailFields& aFields2);
-	TBool CompareEmailFieldsAddresses(const MDesCArray& aAddresses1, const MDesCArray& aAddresses2);
-	
-	CSmsHeader*			iSmsHeader;
-	CRichText*			iRichText;
-	CParaFormatLayer*	iParaLayer;
-	CCharFormatLayer*	iCharLayer;
-	CMDBSession*		iDBSession;
-	
-	};
-
-
-#endif
--- a/messagingappbase/smsmtm/test/inc/T_smutTE.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +0,0 @@
-// Copyright (c) 2005-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 T_SMUTTE_H_
-#define T_SMUTTE_H_
-
-#include <txtrich.h>    
-#include <smstestbase.h>
-#include <test/testexecutestepbase.h>
-#include <commsdattypesv1_1.h>
-#include "smuthdr.h"
-#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS  
-#include <tmsvsmsentry.h>
-#endif	
-using namespace CommsDat;
-
-const TUid KUidSmcmTestNonSense = {0x00011111};
-const TUid KFileStreamId		= {0x01010101};
-
-class TCompare
-	{
-	public:
-		TCompare(TBool aVal = ETrue) {iValue = aVal;}
-		TCompare(const TCompare& aVal) {iValue = aVal.iValue;}
-		void operator()(TBool aResult) {iValue = iValue && aResult;}
-		operator TBool() const {return iValue;}
-		TBool iValue;
-	};
-
-class CSmutTest : public CSmsTestBase
-	{
-public:
-	static CSmutTest* NewLC(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest,CTestStep& aTestStep);
-	~CSmutTest();
-	TVerdict TestSmsEntryL();
-	TVerdict TestSettingsL();
-	TVerdict TestNumberL();
-	TVerdict TestEmailFieldsL();
-	TVerdict TestHeaderL();
-	TVerdict TestSmsUtilitiesL();
-	TVerdict TestSmsEmsExtensionsL();
-private:
-	CSmutTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest,CTestStep& aTestStep);
-	void ConstructL();
-
-	void RunL() {};
-	void DoCancel() {};
-
-	void ShowMenuL();
-	void RunAutoL();
-
-	//Test Functions
-	TBool TestSmsUtilities1L(CSmsHeader& aHeader);
-	TBool TestSmsUtilities2L(CSmsHeader& aHeader);
-	TBool TestSmsUtilities3L(CSmsHeader& aHeader);
-	TBool TestInvalidTelephone(const TDesC& aTel, TDes& aDetails);
-	TBool TestInvalidContact(const TDesC& aTel, TDes& aDetails);
-	TBool TestDuplicateContact(const TDesC& aTel, TDes& aDetails);
-	TBool TestValidTel(const TDesC& aTel, const TDesC& aExpect1, const TDesC& aExpect2, const TDesC& aNotExpect, TDes& rDetails);
-	//CSmsSettings utilities/tests
-	TBool TestSettingsStoreToCommDbL();
-	TBool CompareSettingsAndCommDbL(const CSmsSettings& aSettings) const;
-	TBool CompareSettingsAndSmsBearerL(const CSmsSettings& aSettings) const;
-//	void OpenCommDbModemTableLCC(CCommsDatabase*& rCommDb, CCommsDbTableView*& rTable) const;
-	void TestSettingsRestoreDefectL();
-	void TestRevertSettingsL();
-	TBool CompareSettings(const CSmsSettings& aLeft, const CSmsSettings& aRight, TBool aTestSC = ETrue);
-	TBool CompareMessageSettings(const CSmsMessageSettings& aLeft, const CSmsMessageSettings& aRight);
-	TBool TestSettingsMembersL(CSmsSettings& aSettings);
-	TBool TestMessageSettingsMembersL(CSmsMessageSettings& aSettings);
-	void StoreSettingsL(const CSmsSettings& aSettings);
-	void RestoreSettingsL(CSmsSettings& aSettings);
-	void StoreHeaderL(const CSmsHeader& aHeader);
-	void RestoreHeaderL(CSmsHeader& aHeader);
-	TBool TestStoreRestoreSettingsL(const CSmsSettings& aSettings);
-	TBool TestSmsSettingsCopyL(const CSmsSettings& aSettings);
-	TBool CompareSettingsFiles(
-		RFs& aFs, const TDesC& aCompare1, const TDesC& aCompare2
-		);
-
-	TBool CheckSmsEntry(
-					const TMsvSmsEntry& aEntry, 
-					TBool aClassExpected, 
-					TSmsDataCodingScheme::TSmsClass aClass, 
-					TUint8 aPID, 
-					TBool aUPI, 
-					TMsvSmsEntry::TMsvSmsEntryAckSummary aDeliverySummary, 
-					TBool aValidMessageId, 
-					TInt32 aMessageId) const;
-
-	TSmsProtocolIdentifier ConstructPID(TUint8 aVal) const;
-
-	//CSmsNumber utilities
-	void StoreNumberL(const CSmsNumber& aNumber, TUid aStreamId = KFileStreamId);
-	void RestoreNumberL(CSmsNumber& rNumber, TUid aStreamId = KFileStreamId);
-	TBool CompareNumbers(const CSmsNumber& aLeft, const CSmsNumber& aRight);
-	TBool CompareServiceCenters(const CSmsServiceCenter& aLeft, const CSmsServiceCenter& aRight);
-
-	HBufC8* ConvertToBinaryLC(const TDesC8& aHex) const;
-	CSmsMessage* CreateSmsMessageLC(const TDesC8& aHexPdu) const;
-	TBool CheckDescriptionL(RResourceFile& aResFile, TInt aId, TRefByValue<const TDesC> aDesc, ...);
-	TBool TestSpecialSmsMessageIndicationPduL(RResourceFile& aResFile, TUint8 aMessageType, TUint8 aMessageCount, TInt aId);
-	TBool TestSpecialSmsMessageIndicationPduL(RResourceFile& aResFile, TSmsUtilities::TSmsUtilitiesSpecialMessageType aMessageType, TInt aId);
-	TBool TestVideoMessageIndicationPduL(RResourceFile& aResFile, CSmsHeader& aHeader, TInt aId);
-	TBool TestVideoMessageIndicationPduL(RResourceFile& aResFile, TUint8 aMessageCount, CSmsHeader& aHeader, TInt aId);
-	TBool TestEnhancedVoiceMailIndicationPduL(RResourceFile& aResFile, CSmsHeader& aHeader, TInt aId);
-	TBool TestEnhancedVoiceMailIndicationPduL(RResourceFile& aResFile, TUint8 aMessageCount, CSmsHeader& aHeader, TInt aId);
-	
-	// Test CSmsEmailFields
-	void StoreEmailFieldsL(const CSmsEmailFields& aEmailFields);
-	void RestoreEmailFieldsL(CSmsEmailFields& aEmailFields);
-	TBool TestEmailFieldsParsePassL(const TDesC& aMessage, const TDesC& aAddress, const TDesC& aSubject, const TDesC& aBody);
-	TBool TestEmailFieldsParseFailL(const TDesC& aMessage);
-	TBool TestEmailFieldsComposeL(const TDesC& aFields, const TDesC& aAddress1, const TDesC& aAddress2, const TDesC& aSubject);
-	TBool CompareEmailFields(const CSmsEmailFields& aFields1, const CSmsEmailFields& aFields2);
-	TBool CompareEmailFieldsAddresses(const MDesCArray& aAddresses1, const MDesCArray& aAddresses2);
-	
-	CSmsHeader*			iSmsHeader;
-	CRichText*			iRichText;
-	CParaFormatLayer*	iParaLayer;
-	CCharFormatLayer*	iCharLayer;
-	CMDBSession*		iDBSession;
-	CTestStep& 			iTestStep;
-	};
-
-
-#endif //T_SMUTTE_H_
--- a/messagingappbase/smsmtm/test/inc/t_SmsReplyToServer.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Copyright (c) 2005-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 __T_SMSREPLYTOSERVER_H__
-#define __T_SMSREPLYTOSERVER_H__
- 
-#include <testexecuteserverbase.h>
-
-//
-// SortUTCServer
-//
-
-class CSmsReplyToServer : public CTestServer
-	{
-public:
-	static CSmsReplyToServer* NewL();
-	virtual CTestStep* CreateTestStep(const TDesC& aStepName);
-	RFs& Fs();	
-private:
-	RFs iFs;
-	};
-#endif // __T_SMSREPLYTOSERVER_H__
-
--- a/messagingappbase/smsmtm/test/inc/t_SmsReplyToStep.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-// Copyright (c) 2005-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 __T_SMSREPLYTOSTEP_H__
-#define __T_SMSREPLYTOSTEP_H__
- 
-#include <testexecutestepbase.h>
-#include <stdlib.h>
-#include <smstestutils.h>
-#include <es_sock.h>
-
-#include "t_smsreplytoserver.h"
-
-
-class EntryObserver : public MMsvEntryObserver
-	{
-	public:
-		virtual void HandleEntryEventL(TMsvEntryEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);		
-	};
-	
-class SessionObserver : public MMsvSessionObserver
-	{
-	public:
-		virtual void HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/){};
-	};
-
-class CSmsReplyToStep : public CTestStep
-	{
-public:
-	CSmsReplyToStep();
-	~CSmsReplyToStep();
-	void InitialiseReplyToStepL();
-	virtual TVerdict doTestStepPreambleL();
-	virtual TVerdict doTestStepPostambleL();
-	virtual TVerdict doTestStepL();
-private:
-	void InitialiseSimTsyL();
-	void InitialiseTestL();
-	void StartWatcherL();
-	TBool WatchersAlreadyRunningL();
-	void CreateMessageL();
-	void SetRecipientsL(CSmsHeader& aHeader);
-	void SendMessageL();
-	TBool CheckMessageL();
-private:
-	CSmsTestUtils* iTestUtils;
-	EntryObserver* iEntryObserver;
-	CMsvSession* iSession;
-	SessionObserver* iSessionObserver;
-	CMsvEntry* iEntry;
-	CActiveScheduler* iScheduler;
-	CTestUtilsWatcherStarter* iWatchers;
-	CMsvOperation* iOperation;
-	TMsvId iMessageId;
-	CTestActive* iTestActive;
-	};
- 	
-_LIT(KSmsReplyToStep1,"SmsReplyToStep1");
-	
-#endif  // __T_SMSREPLYTOSTEP_H__
-
--- a/messagingappbase/smsmtm/test/inc/t_SmsSpecialIndicationsServer.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-// Copyright (c) 2005-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 __T_SMSSPECIALINDICATIONSSERVER_H__
-#define __T_SMSSPECIALINDICATIONSSERVER_H__
- 
-#include <testexecuteserverbase.h>
-
-
-class CSmsSpecialIndicationsServer : public CTestServer
-	{
-public:
-	static CSmsSpecialIndicationsServer* NewL();
-	virtual CTestStep* CreateTestStep(const TDesC& aStepName);
-	RFs& Fs();	
-private:
-	RFs iFs;
-	};
-#endif // __T_SMSSPECIALINDICATIONSSERVER_H__
-
--- a/messagingappbase/smsmtm/test/inc/t_SmsSpecialIndicationsStep.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-// Copyright (c) 2005-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 __T_SMSSPECIALINDICATIONSSTEP_H__
-#define __T_SMSSPECIALINDICATIONSSTEP_H__
- 
-#include <testexecutestepbase.h>
-#include <stdlib.h>
-#include <smstestutils.h>
-#include <es_sock.h>
-
-#include "t_smsreplytoserver.h"
-
-
-class EntryObserver : public MMsvEntryObserver
-	{
-	public:
-		virtual void HandleEntryEventL(TMsvEntryEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);		
-	};
-	
-class SessionObserver : public MMsvSessionObserver
-	{
-	public:
-		virtual void HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/){};
-	};
-
-class CSmsSpecialIndicationsStep : public CTestStep
-	{
-public:
-	CSmsSpecialIndicationsStep();
-	~CSmsSpecialIndicationsStep();
-	void InitialiseSpecialIndicationsStepL();
-	virtual TVerdict doTestStepPreambleL();
-	virtual TVerdict doTestStepPostambleL();
-	virtual TVerdict doTestStepL();
-private:
-	void InitialiseSimTsyL();
-	void InitialiseTestL();
-	void StartWatcherL();
-	TBool WatchersAlreadyRunningL();
-	void CreateMessageL();
-	void SetRecipientsL(CSmsHeader& aHeader);
-	void SendMessageL();
-	TBool CheckMessageL();
-private:
-	CSmsTestUtils* iTestUtils;
-	EntryObserver* iEntryObserver;
-	CMsvSession* iSession;
-	SessionObserver* iSessionObserver;
-	CMsvEntry* iEntry;
-	CActiveScheduler* iScheduler;
-	CTestUtilsWatcherStarter* iWatchers;
-	CMsvOperation* iOperation;
-	TMsvId iMessageId;
-	CTestActive* iTestActive;
-	};
- 	
-_LIT(KSmsSpecialIndicationsStep1,"SmsSpecialIndicationsStep1");
-	
-#endif  // __T_SMSSPECIALINDICATIONSSTEP_H__
-
--- a/messagingappbase/smsmtm/test/inc/t_smcmrecvmanual.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-// Copyright (c) 1999-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 <smstestbase.h>
-
-class CSmcmRecvActive;
-class CSmcmRecvOnly : public CSmsTestBase
-/**
- * Manual test harness for receiving SMS messages
- * @note Also enables the user to also send messages to themselves. Defaults.script must have the correct telephone number
- */
-	{
-public:
-	static CSmcmRecvOnly* NewLC(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest);
-	~CSmcmRecvOnly();
-
-private:
-	CSmcmRecvOnly(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest);
-
-	void ConstructL();
-
-	void RunL();
-	TInt RunError(TInt aError);
-	void DoCancel();
-	void Complete(TInt aStatus);
-
-	void ShowMenuL();
-	void MessageSubMenuL();
-
-	void TestSendingL() {};
-	void TestSchedulingL() {};
-
-	void RunAutoL();
-	void DoRunMainMenuL(TKeyCode aCode);
-	void DoRunSendingMenuL(TKeyCode aCode);
-	void DoRunSendingL();
-	void DisplayAndRead(const TDesC& aText);
-	void Read();
-	void ReshowMenu();
-
-	void SendShortMessageL();
-	void SendLongMessageL();
-	void SendReplaceTypeL();
-	void SendMessageIndicationL(TUint8 aMessageType = TSmsUtilities::EVoiceMessageWaiting, TUint8 aMessageCount=1);
-	void SendFromScriptL();
-	void ScheduleSendL(); //< Sends all messages in iSelection
-	void StoreMessageL(TMsvId aId, const CSmsHeader& aHeader);
-	TMsvId CreateMessageLC(const TDesC& aBody);
-
-private:
-
-	enum TSmcmRecvOnlyState
-		/**
-		 *
-		 */
-		{
-		EMainMenu,		//< Main menu currently displayed
-		ESendingMenu,	//< Sending menu currently displayed
-		ESending		//< Sending SMS messages
-		} iState;
-
-	CSmcmRecvActive* iRecvActive;			//< Active object that waits to receive SMS messages then displays them
-	CTestUtilsWatcherStarter* iWatchers;	//< Start and stop the watchers
-	HBufC* iRecipient;						//< Default recipient read from defaults.script
-	HBufC* iServiceCenter;					//< Default service center read from defaults.script
-	TInt iReplaceTypeCount;					//< Number of replace type messages sent
-	};
-
-class CSmcmRecvActive : public CActive, MMsvSessionObserver
-/**
- * Active object that waits to receive SMS messages then displays them
- */
-	{
-	public:
-
-		static CSmcmRecvActive* NewL(CSmsTestUtils& aSmsTest, TInt aPriority);
-		~CSmcmRecvActive();
-		void SentL(const CMsvEntrySelection& aSelection);
-		TInt UnMatched() const {return iSent->Count() - iMatched->Count();}
-		TInt Sent() const {return iSent->Count() + iMatched->Count();}
-		TInt Received() const {return iReceived->Count() + iMatched->Count();}
-		void DisplayUnmatched() const;
-
-	private:
-
-		CSmcmRecvActive(CSmsTestUtils& aSmsTest, TInt aPriority);
-		void ConstructL();
-		void RunL();
-		void DoCancel();
-		TInt RunError(TInt aError);
-		void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
-		void PrintMessageL(TMsvId aId);
-		void ProcessReceivedL();
-		TBool IsMatchL(CMsvEntry& aLeft, CMsvEntry& aRight);
-		TInt Find(const CMsvEntrySelection& aSelection, TMsvId aId) const;
-		HBufC* GetBodyTextLC(CMsvEntry& aMessage);
-		CSmsHeader* GetHeaderLC(CMsvEntry& aMessage) const;
-
-	private:
-
-		CSmsTestUtils& iSmsTest;
-		RTimer iTimer;					//< Timer used before displaying received messages
-		CMsvEntrySelection* iSelection;	//< Received messaged awaiting processing
-		CMsvEntrySelection* iSent;		//< All sent messages
-		CMsvEntrySelection* iReceived;	//< Received messages not matched with sent messages
-		CMsvEntrySelection* iMatched;	//< Received messages matched with sent messages
-	};
--- a/messagingappbase/smsmtm/test/inc/t_smcs2_server.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Copyright (c) 2005-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 __T_SMCS2_SERVER_H__
-#define __T_SMCS2_SERVER_H__
- 
-#include <test/testexecuteserverbase.h>
-	
-//
-// SortUTCServer
-//
-
-class CSchSendUTCServer : public CTestServer
-	{
-public:
-	static CSchSendUTCServer* NewL();
-	virtual CTestStep* CreateTestStep(const TDesC& aStepName);
-	RFs& Fs();	
-private:
-	RFs iFs;
-	};
-#endif //__T_SMCS2_SERVER_H__
-
--- a/messagingappbase/smsmtm/test/inc/t_smsbiofication.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-// Copyright (c) 1999-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 <smsclnt.h>
-#include <smuthdr.h>
-#include <smstestbase.h>
-#include <smsuaddr.h>
-
-_LIT(KSmsBioficationTestName, "Enumerate and Write BIO messages to SIM or phone");
-
-class CSmsBioficationTest : public CSmsTestBase
-	{
-public:
-	static CSmsBioficationTest* NewLC(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest);
-	~CSmsBioficationTest();
-
-private:
-	CSmsBioficationTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest);
-	void ConstructL();
-
-	void RunL();
-	void DoCancel();
-//  Tests
-	void TestSetupL();
-	void TestEnumerateL();
-	void TestCopyToPhoneStoreL();
-	void TestCopyFromPhoneStoreL();
-	void TestMoveFromPhoneStoreL();
-	void TestDeleteFromPhoneStoreL();
-	void TestSendL();
-	void TestDeleteEnumerationFolderL();
-	void TestCopyToPhoneStoreWithClass2FolderL();
-	void TestMoveToPhoneStoreWithClass2FolderL();
-	
-	void RunAutoL();
-	void ShowMenuL();
-
-	void RunEnumerateL();
-	void RunCopyToPhoneStoreL();
-	void RunCopyMoveDeleteFromPhoneStoreL();
-
-	void DeleteEntriesFromTestFolderL();
-	void ChangeMtmUidsL(CMsvEntrySelection& aSelection);
-	TBool CompareSelectionsL(const CMsvEntrySelection& aSelection1,const CMsvEntrySelection& aSelection2);
-	TBool CompareEntriesL(TMsvId aId1, TMsvId aId2);
-
-	void SetClass2FolderL(TMsvId aFolder);
-private:
-	enum TSchSmsTestState
-		{
-		EStateIdle,
-		EStateSettingUp,
-		EStateEnumerating,
-		EStateCopyingToPhoneStore,
-		EStateCopyingFromPhoneStore,
-		EStateMovingFromPhoneStore,
-		EStateDeletingFromPhoneStore,
-		EStateDeletingEnumerationFolder,
-		EStateSending,
-		} iState;
-	TMsvId iEnumerationFolderId;
-	TMsvId iTestFolderId;
-	CMsvEntrySelection* iTestSelection;
-	RSocketServ iSocketServ;
-	RSocket iSocket;
-	};
--- a/messagingappbase/smsmtm/test/inc/t_smsdeliver.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,373 +0,0 @@
-// Copyright (c) 2003-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 __T_SMSDELIVER_H__
-#define __T_SMSDELIVER_H__
-
-#include <e32base.h>
-#include <msvapi.h>
-#include <es_sock.h>
-#include <logwrap.h>
-
-class CSmsTestUtils;
-class CMsvEntry;
-class CSmsClientMtm;
-class CMsvSession;
-class CSmsSettings;
-class CSmsHeader;
-class CTestUtilsWatcherStarter;
-class CTestDeliverBase;
-
-class CTestEngine : public CBase
-					
-	{
-public:		// methods
-
-	static CTestEngine* NewL();
-	virtual ~CTestEngine();
-	void DoTestsL();
-	
-private:	// methods
-
-	CTestEngine();
-	void ConstructL();
-	
-	void RunTestCaseL(CTestDeliverBase& aTestCase);
-	
-	TBool WatchersAlreadyRunningL();
-	void StartWatcherL();
-
-private:	// attributes
-
-	CSmsTestUtils*	iTestUtils;
-	CTestUtilsWatcherStarter* iWatchers;
-	RSocketServ iSocketServ;
-	RSocket iSocket;
-	};
-	
-class CTestDeliverBase : public CActive,
-						 public MMsvEntryObserver
-	{
-public:
-
-	virtual ~CTestDeliverBase();
-	void Start();
-	
-private:	// methods from CActive
-
-	virtual void RunL();
-	virtual void DoCancel();
-	virtual TInt RunError(TInt aError);
-	
-private:	// methods from MMsvEntryObserver
-
-	virtual void HandleEntryEventL(TMsvEntryEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
-
-protected:
-
-	CTestDeliverBase(CSmsTestUtils& aTestUtils);
-	void ConstructL();
-
-	void CompleteSelf();
-	void ClearFoldersL();
-	void TestComplete();
-	void CreateMessageL();
-	void SendMessageL();
-	
-	CMsvSession& Session();
-	CMsvEntry& MsvEntry();
-	CSmsClientMtm& Client();
-	CSmsSettings& ServiceSettings();
-	
-protected:
-
-	CSmsTestUtils&	iTestUtils;
-	CMsvEntry*		iEntryForObserver;
-	CMsvOperation*	iOperation;
-	TMsvId			iMessageId;
-
-private:
-
-	virtual void ChangeServiceSettingsL();
-	virtual void CheckCreatedMessageL();
-	virtual TMsvId GetObserverEntry();
-
-	virtual void SetRecipientsL(CSmsHeader& aHeader) =0;
-	virtual void CheckSentMessageL() =0;
-	virtual void CheckDeliveredMessageL() =0;
-	virtual const TDesC& TestName() =0;
-
-private:
-
-	enum TDeliverTestState
-		{
-		EClearFolders,
-		EChangeServiceSettings,
-		ECreateMessage,
-		ECheckCreatedMessage,
-		ESendMessage,
-		ECheckSentMessage,
-		EPendingDeliveryReport,
-		EDone
-		};			
-	
-private:
-	
-	TDeliverTestState	iState;
-	};
-
-class CTestDeliverOneRecipientOk : public CTestDeliverBase
-	{
-public:
-
-	static CTestDeliverOneRecipientOk* NewL(CSmsTestUtils& aTestUtils);
-	virtual ~CTestDeliverOneRecipientOk();
-	
-private:	// methods from CTestDeliverBase
-
-	virtual void SetRecipientsL(CSmsHeader& aHeader);
-	virtual void CheckSentMessageL();
-	virtual void CheckDeliveredMessageL();
-	virtual const TDesC& TestName();
-
-private:
-
-	CTestDeliverOneRecipientOk(CSmsTestUtils& aTestUtils);
-	};
-	
-class CTestDeliverOneRecipientFail : public CTestDeliverBase
-	{
-public:
-
-	static CTestDeliverOneRecipientFail* NewL(CSmsTestUtils& aTestUtils);
-	virtual ~CTestDeliverOneRecipientFail();
-	
-private:	// methods from CTestDeliverBase
-
-	virtual void SetRecipientsL(CSmsHeader& aHeader);
-	virtual void CheckSentMessageL();
-	virtual void CheckDeliveredMessageL();
-	virtual const TDesC& TestName();
-	
-private:
-
-	CTestDeliverOneRecipientFail(CSmsTestUtils& aTestUtils);
-	};
-	
-class CTestDeliverMultiRecipientsOk_1 : public CTestDeliverBase
-	{
-public:
-
-	static CTestDeliverMultiRecipientsOk_1* NewL(CSmsTestUtils& aTestUtils);
-	virtual ~CTestDeliverMultiRecipientsOk_1();
-	
-private:	// methods from CTestDeliverBase
-
-	virtual void SetRecipientsL(CSmsHeader& aHeader);
-	virtual void CheckSentMessageL();
-	virtual void CheckDeliveredMessageL();
-	virtual const TDesC& TestName();
-
-private:
-
-	CTestDeliverMultiRecipientsOk_1(CSmsTestUtils& aTestUtils);
-
-private:
-	
-	TInt	iCheckCount;	
-	};
-	
-class CTestDeliverMultiRecipientsOk_2 : public CTestDeliverBase
-	{
-public:
-
-	static CTestDeliverMultiRecipientsOk_2* NewL(CSmsTestUtils& aTestUtils);
-	virtual ~CTestDeliverMultiRecipientsOk_2();
-	
-private:	// methods from CTestDeliverBase
-
-	virtual void SetRecipientsL(CSmsHeader& aHeader);
-	virtual void CheckSentMessageL();
-	virtual void CheckDeliveredMessageL();
-	virtual const TDesC& TestName();
-
-private:
-
-	CTestDeliverMultiRecipientsOk_2(CSmsTestUtils& aTestUtils);
-	};
-	
-class CTestDeliverMultiRecipientsOk_3 : public CTestDeliverBase
-	{
-public:
-
-	static CTestDeliverMultiRecipientsOk_3* NewL(CSmsTestUtils& aTestUtils);
-	virtual ~CTestDeliverMultiRecipientsOk_3();
-	
-private:	// methods from CTestDeliverBase
-
-	virtual void SetRecipientsL(CSmsHeader& aHeader);
-	virtual void CheckSentMessageL();
-	virtual void CheckDeliveredMessageL();
-	virtual const TDesC& TestName();
-
-private:
-
-	CTestDeliverMultiRecipientsOk_3(CSmsTestUtils& aTestUtils);
-
-private:
-	
-	TInt	iCheckCount;	
-	};
-	
-class CTestDeliverNoMatching : public  CTestDeliverBase
-	{
-public:
-
-	static CTestDeliverNoMatching* NewL(CSmsTestUtils& aTestUtils);
-	virtual ~CTestDeliverNoMatching();
-	
-private:	// methods from MMsvEntryObserver
-
-	virtual void HandleEntryEventL(TMsvEntryEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
-	
-private:	// methods from CTestDeliverBase
-
-	virtual void SetRecipientsL(CSmsHeader& aHeader);
-	virtual void ChangeServiceSettingsL();
-	virtual TMsvId GetObserverEntry();
-	virtual void CheckSentMessageL();
-	virtual void CheckDeliveredMessageL();
-	virtual const TDesC& TestName();
-
-private:
-
-	CTestDeliverNoMatching(CSmsTestUtils& aTestUtils);
-
-private:
-
-	TLogId	iLogId;
-	};
-
-class CTestDeliverNoStatusReports : public  CTestDeliverBase
-	{
-public:
-
-	static CTestDeliverNoStatusReports* NewL(CSmsTestUtils& aTestUtils);
-	virtual ~CTestDeliverNoStatusReports();
-
-private:	// methods from CTestDeliverBase
-
-	virtual void SetRecipientsL(CSmsHeader& aHeader);
-	virtual void ChangeServiceSettingsL();
-	virtual TMsvId GetObserverEntry();
-	virtual void CheckSentMessageL();
-	virtual void CheckDeliveredMessageL();
-	virtual const TDesC& TestName();
-	
-private:
-
-	CTestDeliverNoStatusReports(CSmsTestUtils& aTestUtils);
-	};
-
-class CTestDeliverNotSent : public  CTestDeliverBase
-	{
-public:
-
-	static CTestDeliverNotSent* NewL(CSmsTestUtils& aTestUtils);
-	virtual ~CTestDeliverNotSent();
-
-private:	// methods from CTestDeliverBase
-
-	virtual void SetRecipientsL(CSmsHeader& aHeader);
-	virtual TMsvId GetObserverEntry();
-	virtual void CheckSentMessageL();
-	virtual void CheckDeliveredMessageL();
-	virtual const TDesC& TestName();
-
-private:
-
-	CTestDeliverNotSent(CSmsTestUtils& aTestUtils);
-	};
-	
-class CTestDeliverMultiRecipientsFail_1 : public CTestDeliverBase
-	{
-public:
-
-	static CTestDeliverMultiRecipientsFail_1* NewL(CSmsTestUtils& aTestUtils);
-	virtual ~CTestDeliverMultiRecipientsFail_1();
-	
-private:	// methods from CTestDeliverBase
-
-	virtual void SetRecipientsL(CSmsHeader& aHeader);
-	virtual void CheckSentMessageL();
-	virtual void CheckDeliveredMessageL();
-	virtual const TDesC& TestName();
-
-private:
-
-	CTestDeliverMultiRecipientsFail_1(CSmsTestUtils& aTestUtils);
-
-private:
-	
-	TInt	iCheckCount;	
-	};
-	
-class CTestDeliverMultiRecipientsMixed_1 : public CTestDeliverBase
-	{
-public:
-
-	static CTestDeliverMultiRecipientsMixed_1* NewL(CSmsTestUtils& aTestUtils);
-	virtual ~CTestDeliverMultiRecipientsMixed_1();
-	
-private:	// methods from CTestDeliverBase
-
-	virtual void SetRecipientsL(CSmsHeader& aHeader);
-	virtual void CheckSentMessageL();
-	virtual void CheckDeliveredMessageL();
-	virtual const TDesC& TestName();
-
-private:
-
-	CTestDeliverMultiRecipientsMixed_1(CSmsTestUtils& aTestUtils);
-
-private:
-	
-	TInt	iCheckCount;	
-	};
-
-class CTestDeliverMultiRecipientsMixed_2 : public CTestDeliverBase
-	{
-public:
-
-	static CTestDeliverMultiRecipientsMixed_2* NewL(CSmsTestUtils& aTestUtils);
-	virtual ~CTestDeliverMultiRecipientsMixed_2();
-
-private:	// methods from CTestDeliverBase
-
-	virtual void SetRecipientsL(CSmsHeader& aHeader);
-	virtual void CheckSentMessageL();
-	virtual void CheckDeliveredMessageL();
-	virtual const TDesC& TestName();
-
-private:
-
-	CTestDeliverMultiRecipientsMixed_2(CSmsTestUtils& aTestUtils);
-
-private:
-
-	TInt	iCheckCount;
-	};
-
-#endif	// __T_SMSDELIVER_H__
--- a/messagingappbase/smsmtm/test/inc/t_smsdeliverlastsegmentreport.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-// Copyright (c) 2006-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 __T_SMSDELIVERLASTSEGMENTREPORT_H__
-#define __T_SMSDELIVERLASTSEGMENTREPORT_H__
-#include <e32base.h>
-
-#include <s32std.h>
-#include <txtrich.h>    //CRichText
-#include <e32test.h>
-#include <msvuids.h>	// ServiceEntry, FolderEntry, etc.
-#include <mtmuids.h>	// query capabilities
-#include "smutset.h"	// sms settings
-#include "smuthdr.h"	// sms header
-#include "smsclnt.h"	// sms (a)sync commands
-#include <smstestbase.h>
-
-
-GLDEF_D RTest				test(_L("SMCM Test Harness"));
-GLDEF_D CTrapCleanup*		theCleanup;
-
-LOCAL_C void doMainL(void);
-GLDEF_C TInt E32Main(void);
-
-class CSmsDeliverLastSegmentReport : public CSmsTestBase
-	{
-public:
-	static CSmsDeliverLastSegmentReport* NewLC(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest);
-	~CSmsDeliverLastSegmentReport();
-
-private:
-	CSmsDeliverLastSegmentReport(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest);
-	void ConstructL();
-
-	void RunL() {};
-	void DoCancel() {};
-
-	void ShowMenuL();
-	void RunAutoL();
-
-	//Test Functions
-	void TestSmsSettingsL();
-	void TestSmsHeaderL();
-	void TestSettingLastSegmentDeliveryReport(CSmsMessageSettings& aSettings);
-	TBool CompareSettingsFiles(
-		RFs& aFs, const TDesC& aCompare1, const TDesC& aCompare2
-		);
-private:
-	CSmsHeader*			iSmsHeader;
-	CRichText*			iRichText;
-	CParaFormatLayer*	iParaLayer;
-	CCharFormatLayer*	iCharLayer;
-};
-
-#endif
-
--- a/messagingappbase/smsmtm/test/inc/t_smsdetails.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,199 +0,0 @@
-// Copyright (c) 2004-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 __T_SMSDETAILS_H__
-#define __T_SMSDETAILS_H__
-
-#include <e32base.h>
-#include <msvapi.h>
-#include <es_sock.h>
-//#include <logwrap.h>
-
-class CSmsTestUtils;
-class CSmsClientMtm;
-class CSmsSettings;
-class CSmsHeader;
-class CTestUtilsWatcherStarter;
-class CTestDetailsBase;
-
-class MTestObserver
-	{
-public:
-
-	virtual void TestFailed() =0;
-	virtual void TestPassed() =0;
-	
-	};
-
-class CTestEngine : public CBase,
-					public MTestObserver
-					
-	{
-public:		// methods
-
-	static CTestEngine* NewL();
-	virtual ~CTestEngine();
-	void DoTestsL();
-	
-private:	// methods from MTestObserver
-
-	virtual void TestFailed();
-	virtual void TestPassed();
-	
-private:	// methods
-
-	CTestEngine();
-	void ConstructL();
-	
-	void RunTestCaseL(CTestDetailsBase& aTestCase);
-	
-	TBool WatchersAlreadyRunningL();
-	void StartWatcherL();
-
-private:	// attributes
-
-	CSmsTestUtils*				iTestUtils;
-	CTestUtilsWatcherStarter*	iWatchers;
-	RSocketServ 	iSocketServ;
-	RSocket 		iSocket;
-	
-	TInt			iTestFailCount;
-	};
-	
-class CTestDetailsBase : public CActive,
-						 public MMsvEntryObserver
-	{
-public:
-
-	virtual ~CTestDetailsBase();
-	void Start();
-	
-private:	// methods from CActive
-
-	virtual void RunL();
-	virtual void DoCancel();
-	virtual TInt RunError(TInt aError);
-	
-private:	// methods from MMsvEntryObserver
-
-	virtual void HandleEntryEventL(TMsvEntryEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
-
-protected:
-
-	CTestDetailsBase(CSmsTestUtils& aTestUtils, MTestObserver& aObserver);
-	void ConstructL();
-
-	void CompleteSelf();
-	void ClearFoldersL();
-	void Test(TBool aTest);
-	void CreateMessageL();
-	void SendMessageL();
-	
-	CMsvSession& Session();
-	CMsvEntry& MsvEntry();
-	CSmsClientMtm& Client();
-	CSmsSettings& ServiceSettings();
-	
-protected:
-
-	CSmsTestUtils&	iTestUtils;
-	MTestObserver&	iObserver;
-	CMsvEntry*		iEntryForObserver;
-	CMsvOperation*	iOperation;
-	TMsvId			iMessageId;
-
-private:
-
-	void ChangeServiceSettingsL();
-	void SetRecipientsL(CSmsHeader& aHeader);
-
-	virtual void CheckReceivedMessageL(TMsvId aMessageId) =0;
-	virtual const TDesC& TestName() =0;
-
-private:
-
-	enum TSendTestState
-		{
-		EClearFolders,
-		EChangeServiceSettings,
-		ECreateMessage,
-		ESendMessage,
-		EMessageSent,
-		EPendingReceivedMessage,
-		EDone
-		};			
-	
-private:
-	
-	TSendTestState	iState;
-	};
-	
-class CTestReceiveDetails_1 : public CTestDetailsBase
-	{
-public:
-
-	static CTestReceiveDetails_1* NewL(CSmsTestUtils& aTestUtils, MTestObserver& aObserver);
-	virtual ~CTestReceiveDetails_1();
-	
-private:	// methods from CTestSendBase
-
-	virtual void CheckReceivedMessageL(TMsvId aMessageId);
-	virtual const TDesC& TestName();
-
-private:
-	
-	CTestReceiveDetails_1(CSmsTestUtils& aTestUtils, MTestObserver& aObserver);
-
-	};
-	
-class CTestReceiveDetails_2 : public CTestDetailsBase
-	{
-public:
-
-	static CTestReceiveDetails_2* NewL(CSmsTestUtils& aTestUtils, MTestObserver& aObserver);
-	virtual ~CTestReceiveDetails_2();
-	
-private:	// methods from CTestSendBase
-
-	virtual void CheckReceivedMessageL(TMsvId aMessageId);
-	virtual const TDesC& TestName();
-
-private:
-	
-	CTestReceiveDetails_2(CSmsTestUtils& aTestUtils, MTestObserver& aObserver);
-	void ConstructL();
-
-	};
-	
-class CTestReceiveDetails_3 : public CTestDetailsBase
-	{
-public:
-
-	static CTestReceiveDetails_3* NewL(CSmsTestUtils& aTestUtils, MTestObserver& aObserver);
-	virtual ~CTestReceiveDetails_3();
-	
-private:	// methods from CTestSendBase
-
-	virtual void CheckReceivedMessageL(TMsvId aMessageId);
-	virtual const TDesC& TestName();
-
-private:
-	
-	CTestReceiveDetails_3(CSmsTestUtils& aTestUtils, MTestObserver& aObserver);
-	void ConstructL();
-	
-	};
-	
-#endif
--- a/messagingappbase/smsmtm/test/inc/t_smsinit.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-// Copyright (c) 1999-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 <SmsTestBase.h>
-
-class CSmsInit : public CSmsTestBase
-	{
-public:
-	static CSmsInit* NewL(RTest& aTest, TUint aCreationFlags);
-	~CSmsInit();
-
-private:
-	CSmsInit();
-	void ConstructL(RTest& aTest, TUint aCreationFlags);
-
-	void RunL() {};
-	void DoCancel() {};
-
-	void ShowMenuL();
-	void RunAutoL() {ShowMenuL();}
-	};
--- a/messagingappbase/smsmtm/test/inc/t_testSmsBase_Step.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-// Copyright (c) 2005-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 __T_TESTSMSENTRYBASE_STEP_H__
-#define __T_TESTSMSENTRYBASE_STEP_H__
- 
-#include <test/testexecutestepbase.h>
-#include "t_smcs2_server.h"
-#include "T_smutTE.h"
-
-#include "smuthdr.h"	// sms header
-
-class CTestSmsBaseStep : public CTestStep
-	{
-public:
-	CTestSmsBaseStep();
-	~CTestSmsBaseStep();
-	virtual TVerdict doTestStepPreambleL();
-	virtual TVerdict doTestStepPostambleL();
-	virtual TVerdict doTestStepL();
-	CSmutTest* iSmcmTest;
-private:
-	CActiveScheduler* iScheduler;
-	
-	CSmsTestUtils* iSmsTestUtils;
-	};
-	
-#endif  //__T_TESTSMSENTRYBASE_STEP_H__
-
--- a/messagingappbase/smsmtm/test/inc/t_testSmsEmailFields_Step.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Copyright (c) 2005-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 __T_TESTSMSEMAILENTRY_STEP_H__
-#define __T_TESTSMSEMAILENTRY_STEP_H__
- 
-#include <test/testexecutestepbase.h>
-#include "t_smcs2_server.h"
-#include "t_testSmsBase_Step.h"
-
-class CTestSmsEmailFieldsStep : public CTestSmsBaseStep
-	{
-public:
-	CTestSmsEmailFieldsStep();
-	~CTestSmsEmailFieldsStep();
-	virtual TVerdict doTestStepL();
-private:
-	};
- 	
-_LIT(KTestSmsEmailFields,"TestEmailFields");
-	
-#endif  //__T_TESTSMSEMAILENTRY_STEP_H__
-
--- a/messagingappbase/smsmtm/test/inc/t_testSmsEmsExtensions_step.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Copyright (c) 2005-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 __T_TESTSMSEMSEXTENSIONS_STEP_H__
-#define __T_TESTSMSEMSEXTENSIONS_STEP_H__
- 
-#include <test/testexecutestepbase.h>
-#include "t_smcs2_server.h"
-#include "t_testSmsBase_Step.h"
-
-class CTestSmsEmsExtensionsStep : public CTestSmsBaseStep
-	{
-public:
-	CTestSmsEmsExtensionsStep();
-	~CTestSmsEmsExtensionsStep();
-	virtual TVerdict doTestStepL();
-private:
-	};
- 	
-_LIT(KTestSmsEmsExtensions,"TestSmsEmsExtensions");
-	
-#endif  //__T_TESTSMSEMSEXTENSIONS_STEP_H__
-
--- a/messagingappbase/smsmtm/test/inc/t_testSmsSettings_Step.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-// Copyright (c) 2005-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 __T_TESTSMSSETTINGS_STEP_H__
-#define __T_TESTSMSSETTINGS_STEP_H__
- 
-#include <test/testexecutestepbase.h>
-#include <smstestutils.h>
-#include "t_smcs2_server.h"
-#include "t_testSmsBase_Step.h"
-	
-class CTestSmsSettingsStep : public CTestSmsBaseStep
-	{
-public:
-	CTestSmsSettingsStep();
-	~CTestSmsSettingsStep();
-	virtual TVerdict doTestStepL();
-private:
-private:
-	};
- 	
-_LIT(KTestSmsSettings,"TestSmsSettings");
-	
-#endif  //__T_TESTSMSSETTINGS_STEP_H__
-
--- a/messagingappbase/smsmtm/test/inc/t_testSmsUtilities_Step.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Copyright (c) 2005-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 __T_TESTSMSUTILITIESSTEP_STEP_H__
-#define __T_TESTSMSUTILITIESSTEP_STEP_H__
- 
-#include <test/testexecutestepbase.h>
-#include "t_smcs2_server.h"
-#include "t_testSmsBase_Step.h"
-
-class CTestSmsUtilitiesStep : public CTestSmsBaseStep
-	{
-public:
-	CTestSmsUtilitiesStep();
-	~CTestSmsUtilitiesStep();
-	virtual TVerdict doTestStepL();
-private:
-	};
- 	
-_LIT(KTestSmsUtilities,"TestSmsUtilities");
-	
-#endif  //__T_TESTSMSUTILITIESSTEP_STEP_H__
-
--- a/messagingappbase/smsmtm/test/inc/t_testsmsHeader_step.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Copyright (c) 2005-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 __T_TESTSMSHEADERSTEP_STEP_H__
-#define __T_TESTSMSHEADERSTEP_STEP_H__
- 
-#include <test/testexecutestepbase.h>
-#include "t_smcs2_server.h"
-#include "t_testSmsBase_Step.h"
-
-class CTestSmsHeaderStep : public CTestSmsBaseStep
-	{
-public:
-	CTestSmsHeaderStep();
-	~CTestSmsHeaderStep();
-	virtual TVerdict doTestStepL();
-private:
-	};
- 	
-_LIT(KTestSmsHeader,"TestSmsHeader");
-	
-#endif  //__T_TESTSMSHEADERSTEP_STEP_H__
-
--- a/messagingappbase/smsmtm/test/inc/t_testsmsentry_step.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Copyright (c) 2005-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 __T_TESTSMSENTRYSTEP_STEP_H__
-#define __T_TESTSMSENTRYSTEP_STEP_H__
- 
-#include <test/testexecutestepbase.h>
-#include "t_smcs2_server.h"
-#include "t_testSmsBase_Step.h"
-
-class CTestSmsEntryStep : public CTestSmsBaseStep
-	{
-public:
-	CTestSmsEntryStep();
-	~CTestSmsEntryStep();
-	virtual TVerdict doTestStepL();
-private:
-	};
- 	
-_LIT(KTestSmsEntry,"TestSmsEntry");
-	
-#endif  //__T_TESTSMSENTRYSTEP_STEP_H__
-
--- a/messagingappbase/smsmtm/test/inc/t_testsmsnumber_step.h	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-// Copyright (c) 2005-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 __T_TESTSMSNUMBERSTEP_STEP_H__
-#define __T_TESTSMSNUMBERSTEP_STEP_H__
- 
-#include <test/testexecutestepbase.h>
-#include "t_smcs2_server.h"
-#include "t_testSmsBase_Step.h"
-
-class CTestSmsNumberStep : public CTestSmsBaseStep
-	{
-public:
-	CTestSmsNumberStep();
-	~CTestSmsNumberStep();
-	virtual TVerdict doTestStepL();
-private:
-	};
- 	
-_LIT(KTestSmsNumber,"TestSmsNumber");
-	
-#endif  //__T_TESTSMSNUMBERSTEP_STEP_H__
-
--- a/messagingappbase/smsmtm/test/src/T_CSmsSettings.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,234 +0,0 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Class test for CSmsSettings.
-// To build: bldmake bldfiles
-// abld test build wins udeb
-// To run from windows command prompt:
-// cd epoc32\release\wins\udeb 
-// T_CSMSSETTINGS -dtextshell --
-// 
-//
- 
-
-#include <e32cons.h>
-#include <e32test.h>
-#include <s32file.h>
-
-// Message Server headers for linking to msgs.dll. 
-#include "msvapi.h"
-#include "msvids.h"
-#include "msvuids.h"
-
-// Class under test.
-#include "smutset.h"
-#include <csmsaccount.h>
-
-// Test utility classes
-class CMyScheduler : public CActiveScheduler
-	{
-private:
-	void Error(TInt aError) const;
-	};
-void CMyScheduler::Error(TInt /*aError*/) const {}
-
-
-class CObserver : public MMsvSessionObserver
-	{
-	public:
-		void HandleSessionEvent(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
-		void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
-	};
-void CObserver::HandleSessionEvent(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/) {}
-void CObserver::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)	{}
-
-
-// Test Case Prototypes
-LOCAL_C TBool TestConstructionL();
-LOCAL_C TBool TestRestoreWithNoStoreL();
-LOCAL_C TBool TestRestoreWhenOnlyExternalSettingsIsPresentL();
-LOCAL_C TBool TestRestoreWhenOnlyStoreSettingsIsPresentL();
-LOCAL_C TBool TestStoreL();
-LOCAL_C TBool TestSaveExternalL();
-LOCAL_C TBool TestRestoreWhenExternalSettingsIsMoreRecentL();
-LOCAL_C TBool TestRestoreWhenStoreSettingsIsMoreRecentL();
-
-
-// Test Harness Prototypes
-LOCAL_C void InitL();
-LOCAL_C void UninitL();
-LOCAL_C void doTest();
-LOCAL_C void doMainL();
-GLDEF_C TInt E32Main();
-
-
-// Test harness constants and global variables...
-_LIT(KTitle, "T_CSMSSETTINGS");
-_LIT(KTxtPressAnyKey, "Press any key to return.");
-CTrapCleanup* pcleanup = NULL;
-CMyScheduler* pscheduler = NULL;
-RTest test(KTitle);
-TMsvId gTestEntryId;
-RFs gFs;
-CMsvSession* pSession = NULL;
-CObserver* pObserver = NULL;
-CMsvEntry* pContext = NULL;
-const TUid KMsgFileSmsSettingsUid = {0x1000996E};
-_LIT(KExternalSettingsFilename, "c:\\system\\data\\sms_settings.dat");
-
-
-LOCAL_C TBool TestConstructionL()
-	{
-	// Test construction via NewL().
-	__UHEAP_MARK;
-	CSmsSettings* obj = NULL;
-	obj = CSmsSettings::NewL();
-	CleanupStack::PushL(obj);
-	test(obj != NULL);
-	CleanupStack::PopAndDestroy();
-	obj = NULL;
-	__UHEAP_MARKEND;
-
-	// Test for memory leaks during heap cell failure at specific allocations.
-	TInt failureRate = 0;
-	while (failureRate < 32)
-		{
-		__UHEAP_MARK;
-		__UHEAP_SETFAIL(RHeap::EDeterministic, failureRate++);
-		TRAPD(err, obj = CSmsSettings::NewL());
-		__UHEAP_RESET;
-		if (err == KErrNone)
-			{
-			delete obj;
-			obj = NULL;
-			}
-		else
-			{
-			test(err == KErrNoMemory);
-			}
-		__UHEAP_MARKEND;
-		}
-
-	return ETrue;
-	}
-
-
-LOCAL_C TBool TestRestoreWhenOnlyStoreSettingsIsPresentL()
-/**
-Calling CSmsSettings::RestoreL should return KErrNone, and the settings
-should be set to that of the store.
-*/
-	{
-	// Make sure there is no external settings.
-	gFs.Delete(KExternalSettingsFilename);
-
-	__UHEAP_MARK;
-	CSmsAccount* account = CSmsAccount::NewLC();
-
-	// Save settings to store only.
-	CSmsSettings* obj = CSmsSettings::NewL();
-	CleanupStack::PushL(obj);
-	obj->SetDescriptionLength(3446238);
-	account->SaveSettingsL(*obj);
-	CleanupStack::PopAndDestroy(obj);
-
-	// Restore settings and check it is from the store.
-	obj = CSmsSettings::NewL();
-	CleanupStack::PushL(obj);
-	
-	// Test that the settings are un-initialised.
-	test(obj->DescriptionLength() != 3446238);
-	account->LoadSettingsL(*obj);
-	
-	// Test that the settings are coming from the store.
-	test(obj->DescriptionLength() == 3446238);
-	
-	CleanupStack::PopAndDestroy(obj);
-	CleanupStack::PopAndDestroy(account);
-	__UHEAP_MARKEND;
-	
-	return ETrue;
-	}
-	
-	
-
-
-LOCAL_C void InitL()
-	{
-	// Connect to the file system...
-	TInt err = gFs.Connect();
-
-	// Connect to the Message Server...
-	pObserver = new (ELeave) CObserver();
-	CleanupStack::PushL(pObserver);
-	pSession = CMsvSession::OpenSyncL(*pObserver);
-	CleanupStack::PushL(pSession);
-
-	// Create a test entry with some dummy values so the Message Server
-	// will not panic when the entry is created in the message store...
-	pContext = CMsvEntry::NewL(*pSession, KMsvRootIndexEntryIdValue, TMsvSelectionOrdering());
-	CleanupStack::PushL(pContext);
-	TMsvEntry testEntry;
-	TUid entryMtm;
-	entryMtm.iUid = 11;
-	testEntry.iMtm = entryMtm;
-	testEntry.iServiceId = pContext->OwningService();
-	testEntry.iType = KUidMsvServiceEntry;
-
-	// Create the entry in the message store and set the current context to it...
-	pContext->CreateL(testEntry);
-	gTestEntryId = testEntry.Id();
-	pContext->SetEntryL(gTestEntryId);
-	}
-
-
-LOCAL_C void UninitL()
-	{
-	gFs.Delete(KExternalSettingsFilename);
-	pContext->SetEntryL(KMsvRootIndexEntryIdValue);
-	pContext->DeleteL(gTestEntryId);
-	CleanupStack::PopAndDestroy(pContext);
-	CleanupStack::PopAndDestroy(pSession);
-	CleanupStack::PopAndDestroy(pObserver);
-	gFs.Close();
-	}
-
-
-LOCAL_C void doTest()
-	{
-	test.Start(_L("Testing construction/destruction"));
-	test(TestConstructionL());
-	test.Next(_L("Testing RestoreL when only store settings are present"));
-	test(TestRestoreWhenOnlyStoreSettingsIsPresentL());
-	test.End();
-	}
-
-
-LOCAL_C void doMainL()
-	{
-	InitL();
-	doTest();
-	test.Getch();
-	UninitL();
-	}
-
-
-GLDEF_C TInt E32Main()
-	{
-	pcleanup = CTrapCleanup::New();
-	pscheduler = new (ELeave) CMyScheduler();
-	CActiveScheduler::Install(pscheduler);
-	TRAPD(ret,doMainL());		
-	delete pcleanup;
-	return(KErrNone);
-	}
--- a/messagingappbase/smsmtm/test/src/T_SchSms.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,278 +0,0 @@
-// Copyright (c) 1999-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 <e32test.h>
-#include <e32uid.h>
-#include <e32std.h>
-#include <smuthdr.h>
-#include "T_SchSms.h"
-
-CSchSmsTest::~CSchSmsTest()
-	{
-		if (iSmsTest.iMsvSession)
-			{
-			iSmsTest.iMsvSession->RemoveObserver(*this);
-			}
-	}
-
-
-void CSchSmsTest::TestDeleteScheduleL()
-	{
-	}
-
-void CSchSmsTest::TestCheckScheduleL()
-	{
-	}
-
-
-void CSchSmsTest::DoTestSendingL(const TDesC& aScript)
-//
-//
-//
-	{
-	CSmsTestBase::DoTestSendingL(aScript);
-	iState = EStateSending;
-	CActiveScheduler::Start();
-	}
-
-void CSchSmsTest::DoTestSchedulingL(const TDesC& aScript, TTimeIntervalSeconds aFromNow)
-	{
-	CSmsTestBase::DoTestSchedulingL(aScript, EFalse, aFromNow);
-//	iState = EStateScheduling;
-	CActiveScheduler::Start();
-	}
-
-CSchSmsTest::CSchSmsTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest)
-: CSmsTestBase(aSmsTest, aScriptFile, aCurrentTest), iState(EStateWaiting)
-	{
-	}
-
-void CSchSmsTest::RunAutoL()
-	{
-	iSmsTest.TestStart(++iNextTest, _L("Check Schedule"));
-	TestCheckScheduleL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	iSmsTest.TestStart(++iNextTest, _L("Delete Schedule"));
-	TestDeleteScheduleL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-	}
-
-void CSchSmsTest::ConstructL()
-	{
-	iSmsTest.SetLogToFile();
-
-	iSelection = new (ELeave) CMsvEntrySelection();
-
-	iSmsTest.iMsvSession->AddObserverL(*this);
-
-	CActiveScheduler::Add(this);
-	}
-
-void CSchSmsTest::HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
-	{
-	
-	if (!IsActive())
-		return;
-
-/*	switch (iState)
-		{
-		case EStateSchedulingThenSend:
-		case EStateSending:
-			{
-			TInt error = KErrNone;
-
-			DisplaySendingStatesL(*entries);
-
-			if (SendingCompleteL(error) && iState == EStateSchedulingThenSend)
-				{
-				TRequestStatus* status = &iStatus;
-				User::RequestComplete(status, error);
-				}
-			break;
-			}
-		default:
-			break;
-		}*/
-	}
-
-
-void CSchSmsTest::ShowMenuL()
-	{
-	iSmsTest.ResetMenu();
-
-	iSmsTest.AppendToMenuL(_L("Check Schedule Test"));
-	iSmsTest.AppendToMenuL(_L("Delete Schedule Test"));
-	iSmsTest.AppendToMenuL(_L("Display Log"));
-	iSmsTest.AppendToMenuL(_L("Clear Log"));
-
-	TInt result = iSmsTest.DisplayMenu(_L("SMS Send Test"));
-
-	if (result <= 0)
-		return;
-
-	switch (result)
-		{
-		case 1:
-			TestCheckScheduleL();
-			break;
-		case 2:
-			TestDeleteScheduleL();
-			break;
-		case 3:
-			DisplayLogL();
-			break;
-		case 4:
-			ClearLogL();
-			break;
-		default:
-			User::Leave(KErrArgument);
-			break;
-		}
-
-	ShowMenuL();
-	}
-
-void CSchSmsTest::RunL()
-	{
-	if (iOperation)
-		iSmsTest.SetProgressL(*iOperation);
-
-/*	switch (iState)
-		{
-		case EStateScheduling:
-			DoRunSchedulingL();
-			break;
-		case EStateSending:
-		case EStateSchedulingThenSend:
-			DoRunSendingL();
-			break;
-		default:
-			{
-			break;
-			}
-		}*/
-
-	delete iOperation;
-	iOperation = NULL;
-	}
-
-void CSchSmsTest::DoCancel()
-	{
-	if (iOperation)
-		{
-		iOperation->Cancel();
-		iSmsTest.Printf(_L("Operation Cancelled!\n"));
-		}
-	else
-		{
-		iSmsTest.Printf(_L("No operation to cancel!\n"));
-		}
-
-	delete iOperation;
-	iOperation = NULL;
-	}
-
-void CSchSmsTest::DoRunSchedulingL()
-	{
-/*	iSmsTest.Printf(_L("Scheduling completed with error %d\n"), iStatus);
-
-	TBool sent = EFalse;
-
-	if (iStatus == KErrNone)
-		{
-		iSmsTest.DisplaySendingStatesL(*iSelection);
-		TInt error = KErrNone;
-		sent = SendingCompleteL(error);
-		iStatus = error;
-		}
-	
-	if (!sent)
-		{
-		iStatus = KRequestPending;
-		SetActive();
-		iState = EStateSchedulingThenSend;
-		}
-	else
-		{
-		CActiveScheduler::Stop();
-		iState = EStateWaiting;
-		iSmsTest.Printf(_L("Scheduling completed with error %d\n"), iStatus);
-
-		if (!iSmsTest.RunAuto())
-			{
-			iSmsTest.Test().Printf(_L("\nPress any key to continue...\n"));
-			iSmsTest.Test().Getch();
-			}
-		}*/
-	}
-
-void CSchSmsTest::DoRunSendingL()
-	{
-/*	CActiveScheduler::Stop();
-	iState = EStateWaiting;
-	iSmsTest.Printf(_L("Sending completed with error %d\n"), iStatus);
-
-	if (!iSmsTest.RunAuto())
-		{
-		iSmsTest.Test().Printf(_L("\nPress any key to continue...\n"));
-		iSmsTest.Test().Getch();
-		}*/
-	}
-
-LOCAL_C void doMainL(RTest& aTest)
-	{
-	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
-	CleanupStack::PushL(scheduler);
-	CActiveScheduler::Install( scheduler );
-
-	CSmsTestUtils* smsTest = CSmsTestUtils::NewL(aTest);
-	CleanupStack::PushL(smsTest);
-	TInt nextTest = 0;
-
-
-	CSchSmsTest* schTest = CSchSmsTest::NewLC(*smsTest, KNullDesC, nextTest);
-
-	schTest->StartL();
-
-	CleanupStack::PopAndDestroy(3); //SmsTest, scheduler
-	}
-
-
-GLDEF_C TInt E32Main()
-	{
-	__UHEAP_MARK;
-	RTest test(_L("SchSms Test"));
-	test.Start(_L("Setup"));
-	CTrapCleanup* theCleanup = CTrapCleanup::New();
-	TRAPD(ret,doMainL(test));		
-	test(ret==KErrNone);
-	delete theCleanup;	
-	test.Console()->SetPos(0, 13);
-	test.End();
-	test.Close();
-	__UHEAP_MARKEND;
-	return(KErrNone);
-	}
-
-CSchSmsTest* CSchSmsTest::NewLC(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest)
-	{
-	CSchSmsTest* self = new (ELeave) CSchSmsTest(aSmsTest, aScriptFile, aCurrentTest);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	return self;
-	}
--- a/messagingappbase/smsmtm/test/src/T_SmcmFail.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,678 +0,0 @@
-// Copyright (c) 2000-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 "T_SmcmFail.h"
-#include <biodb.h>
-
-GLDEF_C TInt E32Main()
-	{	
-	__UHEAP_MARK;
-	test.Start(_L("Setup"));
-	theCleanup = CTrapCleanup::New();
-	TRAPD(ret,doMainL());		
-	test(ret==KErrNone);
-	delete theCleanup;	
-	test.Console()->SetPos(0, 13);
-	test.End();
-	test.Close();
-	__UHEAP_MARKEND;
-	return(KErrNone);
-	}
-
-LOCAL_C void doMainL()
-	{
-	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
-	CleanupStack::PushL(scheduler);
-	CActiveScheduler::Install(scheduler);
-
-	CSmsTestUtils* smsTest = CSmsTestUtils::NewL(test);
-	CleanupStack::PushL(smsTest);
-	TInt nextTest = 0;
-
-	CSmcmFailTest* SmcmTest = CSmcmFailTest::NewL(*smsTest, KNullDesC, nextTest);
-	CleanupStack::PushL(SmcmTest);
-
-	SmcmTest->StartL();
-
-	CleanupStack::PopAndDestroy(3); //SmcmTest. scheduler
-	}
-
-CSmcmFailTest::CSmcmFailTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest)
-: CSmsTestBase(aSmsTest, aScriptFile, aCurrentTest)
-	{
-	}
-
-void CSmcmFailTest::RunAutoL()
-	{
-	iSmsTest.TestStart(++iNextTest, _L("CSmsSettings Fail"));
-	TestSettingsFailL();
-	iSmsTest.TestFinish(iNextTest);
-
-	iSmsTest.TestStart(++iNextTest, _L("CSmsNumber Fail"));
-	TestNumberFailL();
-	iSmsTest.TestFinish(iNextTest);
-
-	iSmsTest.TestStart(++iNextTest, _L("CSmsHeader Fail"));
-	TestHeaderFailL();
-	iSmsTest.TestFinish(iNextTest);
-
-	iSmsTest.TestStart(++iNextTest, _L("Load Fail"));
-	TestLoadFailL(); //Cannot be done 'cause of defect in message server
-	iSmsTest.TestFinish(iNextTest);
-
-	iSmsTest.TestStart(++iNextTest, _L("Save Fail"));
-	TestSaveFailL(); //Cannot be done 'cause of defect in message server
-	iSmsTest.TestFinish(iNextTest);
-
-	iSmsTest.TestStart(++iNextTest, _L("Addressee Fail"));
-	TestAddresseeFailL(); //Cannot be done 'cause of defect in message server
-	iSmsTest.TestFinish(iNextTest);
-
-	iSmsTest.TestStart(++iNextTest, _L("Bio Fail"));
-	this->TestBifFailL();
-	iSmsTest.TestFinish(iNextTest);
-
-
-	iSmsTest.TestStart(++iNextTest, _L("Reply Fail"));
-	TestReplyFailL();
-	iSmsTest.TestFinish(iNextTest);
-
-	iSmsTest.TestStart(++iNextTest, _L("Forward Fail"));
-	TestForwardFailL(); //Cannot be done 'cause of defect in message server
-	iSmsTest.TestFinish(iNextTest);
-	}
-
-CSmcmFailTest::~CSmcmFailTest()
-	{
-	delete iRichText;
-	delete iParaLayer;
-	delete iCharLayer;
-	}
-
-void CSmcmFailTest::ConstructL()
-	{
-	iSmsTest.SetLogToFile();
-	iSmsTest.InstantiateClientMtmsL();
-
-	iSelection = new (ELeave) CMsvEntrySelection();
-	iTimer = CTestTimer::NewL();
-
-	iParaLayer =CParaFormatLayer::NewL();
-	iCharLayer = CCharFormatLayer::NewL();
-	iRichText = CRichText::NewL(iParaLayer, iCharLayer, CEditableText::EFlatStorage,256);
-
-	CActiveScheduler::Add(this);
-	}
-
-CSmcmFailTest* CSmcmFailTest::NewL(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest)
-	{
-	CSmcmFailTest* self = new (ELeave) CSmcmFailTest(aSmsTest, aScriptFile, aCurrentTest);
-	CleanupStack::PushL(self);
-
-	self->ConstructL();
-
-	CleanupStack::Pop();
-	return self;
-	}
-
-void CSmcmFailTest::ShowMenuL()
-	{
-	iSmsTest.ResetMenu();
-
-	iSmsTest.AppendToMenuL(_L("Start"));
-
-	TInt result = iSmsTest.DisplayMenu(_L("SMS Client MTM Test"));
-
-	if (result <= 0)
-		return;
-
-	switch (result)
-		{
-		case 1:
-			RunAutoL();
-			break;
-		default:
-			User::Leave(KErrArgument);
-			break;
-		}
-
-	if (!iSmsTest.RunAuto())
-		{
-		iSmsTest.Printf(_L("Press any key to continue...\n"));
-		test.Getch();
-		}
-
-	ShowMenuL();
-	}
-
-void CSmcmFailTest::TestSettingsFailL()
-	{
-	CSmsSettings* settings = NULL;
-
-	TInt error;
-	TInt failCount = 0;
-
-	//Failure Test CSmsSettings::NewL
-	do
-		{
-		__UHEAP_FAILNEXT(failCount++);
-
-		TRAP(error, settings = CSmsSettings::NewL());
-
-		__UHEAP_RESET;
-
-		if (error)
-			{
-			test(error == KErrNoMemory);
-			}
-
-		}
-	while (error);
-
-	iSmsTest.Printf(_L("CSmsSettings::NewL Fail Count %d\n"), failCount);
-	CleanupStack::PushL(settings);
-
-	failCount = 0;
-
-	//Failure Test CSmsSettings::AddServiceCenterL()
-	do
-		{
-		__UHEAP_FAILNEXT(failCount++);
-
-		TInt scCount = settings->ServiceCenterCount();
-		TRAP(error, settings->AddServiceCenterL(_L("Anthony"), _L("+44")));
-
-		__UHEAP_RESET;
-
-		if (error)
-			{
-			test(error == KErrNoMemory);
-			test(scCount == settings->ServiceCenterCount());
-			}
-		else
-			{
-			test(scCount == settings->ServiceCenterCount() - 1);
-			}
-		}
-	while (error);
-
-	iSmsTest.Printf(_L("CSmsSettings::AddSCAddress Fail Count %d\n"), failCount);
-	CSmsSettings* settings2 = CSmsSettings::NewL();
-	CleanupStack::PushL(settings2);
-	failCount = 0;
-
-	//Failure Test CSmsSettings::CopyL()
-	do
-		{
-		__UHEAP_FAILNEXT(failCount++);
-
-		TRAP(error, settings2->CopyL(*settings));
-
-		__UHEAP_RESET;
-
-		if (error)
-			{
-			test(error == KErrNoMemory);
-			}
-		}
-	while (error);
-
-	iSmsTest.Printf(_L("CSmsSettings::CopyL Fail Count %d\n"), failCount);
-
-	CleanupStack::PopAndDestroy(); //settings2
-	CleanupStack::PopAndDestroy(); //settings
-	}
-
-void CSmcmFailTest::TestHeaderFailL()
-	{
-	CSmsHeader* header = NULL;
-
-	TInt error;
-	TInt failCount = 0;
-
-	//Failure Test CSmsHeader::NewL, Deliver
-	do
-		{
-		__UHEAP_FAILNEXT(failCount++);
-
-		TRAP(error, header = CSmsHeader::NewL(CSmsPDU::ESmsDeliver,*iRichText));
-
-		__UHEAP_RESET;
-
-		if (error)
-			{
-			test(error == KErrNoMemory);
-			}
-
-		}
-	while (error);
-
-	iSmsTest.Printf(_L("CSmsHeader::NewL (Deliver) Fail Count %d\n"), failCount);
-	delete header;
-
-	failCount = 0;
-
-	//Failure Test CSmsHeader::NewL, StatusReport
-	do
-		{
-		__UHEAP_FAILNEXT(failCount++);
-
-		TRAP(error, header = CSmsHeader::NewL(CSmsPDU::ESmsStatusReport,*iRichText));
-
-		__UHEAP_RESET;
-
-		if (error)
-			{
-			test(error == KErrNoMemory);
-			}
-		}
-	while (error);
-
-	iSmsTest.Printf(_L("CSmsHeader::NewL (StatusReport) Fail Count %d\n"), failCount);
-	delete header;
-
-	failCount = 0;
-
-	//Failure Test CSmsHeader::NewL, Submit
-	do
-		{
-		__UHEAP_FAILNEXT(failCount++);
-
-		TRAP(error, header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit,*iRichText));
-
-		__UHEAP_RESET;
-
-		if (error)
-			{
-			test(error == KErrNoMemory);
-			}
-
-		}
-	while (error);
-
-	iSmsTest.Printf(_L("CSmsHeader::NewL (Submit) Fail Count %d\n"), failCount);
-	delete header;
-	}
-
-void CSmcmFailTest::TestNumberFailL()
-	{
-	CSmsNumber* number = NULL;
-
-	TInt error;
-	TInt failCount = 0;
-
-	//Failure Test CSmsNumber::NewL
-	do
-		{
-		__UHEAP_FAILNEXT(failCount++);
-
-		TRAP(error, number = CSmsNumber::NewL());
-
-		__UHEAP_RESET;
-
-		if (error)
-			{
-			test(error == KErrNoMemory);
-			}
-
-		}
-	while (error);
-
-	iSmsTest.Printf(_L("CSmsNumber::NewL Fail Count %d\n"), failCount);
-	CleanupStack::PushL(number);
-	CSmsNumber* number2 = NULL;
-
-	failCount = 0;
-
-	//Failure Test CSmsNumber::NewL,2
-	do
-		{
-		__UHEAP_FAILNEXT(failCount++);
-
-		TRAP(error, number2 = CSmsNumber::NewL(*number));
-
-		__UHEAP_RESET;
-
-		if (error)
-			{
-			test(error == KErrNoMemory);
-			}
-
-		}
-	while (error);
-
-	iSmsTest.Printf(_L("CSmsNumber::NewL (Number) Fail Count %d\n"), failCount);
-	CleanupStack::PushL(number2);
-
-	number->SetAddressL(_L("44"));
-	number->SetNameL(_L("AA"));
-
-	failCount = 0;
-
-	//Failure Test CSmsNumber::CopyL
-	do
-		{
-		__UHEAP_FAILNEXT(failCount++);
-
-		TRAP(error, number2->CopyL(*number));
-
-		__UHEAP_RESET;
-
-		if (error)
-			{
-			test(error == KErrNoMemory);
-			}
-		else
-			{
-			test(number->Name() == number2->Name());
-			test(number->Address() == number2->Address());
-			}
-		}
-	while (error);
-
-	iSmsTest.Printf(_L("CSmsNumber::CopyL Fail Count %d\n"), failCount);
-	CleanupStack::PopAndDestroy(); //number
-	CleanupStack::PopAndDestroy(); //number2
-	}
-
-
-void CSmcmFailTest::TestReplyFailL()
-	{
-	iSmsTest.Test().Next(_L("CSmsClientMtm Reply Fail"));
-
-	CMsvOperationWait* wait = CMsvOperationWait::NewLC();
-	CMsvOperation* op = NULL; 
-	TInt error;
-	TMsvPartList part=0;
-	TInt failCount = 0;
-
-	do
-		{
-		CleanFolderL(KMsvDraftEntryId);
-		CleanFolderL(KMsvGlobalOutBoxIndexEntryId);
-		CleanFolderL(KMsvGlobalInBoxIndexEntryId);
-
-		TMsvId id = iSmsTest.CreateDummyMessageToReceiveL();
-		Session().CleanupEntryPushL(id);
-		Client().SwitchCurrentEntryL(id); // Lets go to the received area
-		Client().LoadMessageL();
-	
-		__UHEAP_FAILNEXT(failCount++);
-
-		TRAP(error, op = Client().ReplyL(KMsvDraftEntryId, part, wait->iStatus));
-
-		__UHEAP_RESET;
-
-		if (error)
-			{
-			test(error == KErrNoMemory);
-
-			if (failCount % 100 == 0)
-				iSmsTest.Printf(_L("CSmsClientMtm::ReplyL still failing, count = %d\n"), failCount);
-			}
-
-		CleanupStack::PopAndDestroy(); //id
-		}
-	while (error);
-	
-	iSmsTest.Printf(_L("CSmsClientMtm::ReplyL Fail Count %d\n"), failCount);
-	CleanupStack::PushL(op);
-	wait->Start();
-	CActiveScheduler::Start();
-
-	CleanupStack::PopAndDestroy(2); //op, wait
-	}
-
-void CSmcmFailTest::CleanFolderL(TMsvId aFolder)
-	{
-	CMsvOperationWait* wait = CMsvOperationWait::NewLC();
-	CMsvOperation* op = NULL; 
-
-	iSmsTest.SetEntryL(aFolder);
-	CMsvEntrySelection* sel = MsvEntry().ChildrenL();
-
-	CleanupStack::PushL(sel);
-	if (sel->Count())
-		{
-		iSmsTest.Printf(_L("Deleting %d existing messages\n"), sel->Count());
-		op = MsvEntry().DeleteL(*sel, wait->iStatus);
-		CleanupStack::PushL(op);
-		wait->Start();
-		CActiveScheduler::Start();
-		CleanupStack::PopAndDestroy(); //op
-		}
-	CleanupStack::PopAndDestroy(2); //sel, wait
-	}
-
-void CSmcmFailTest::TestForwardFailL()
-	{
-	iSmsTest.Test().Next(_L("CSmsClientMtm Forward Fail"));
-
-	CleanFolderL(KMsvDraftEntryId);
-	CleanFolderL(KMsvGlobalOutBoxIndexEntryId);
-	CleanFolderL(KMsvGlobalInBoxIndexEntryId);
-
-	TMsvId id = iSmsTest.CreateDummyMessageToReceiveL();
-	Client().SwitchCurrentEntryL(id);
-	Client().LoadMessageL();
-
-	TMsvPartList part=0;
-
-	TInt error;
-	TInt failCount = 0;
-	CMsvOperationWait* wait = CMsvOperationWait::NewLC();
-	CMsvOperation* op = NULL; 
-
-	do
-		{
-		__UHEAP_FAILNEXT(failCount++);
-
-		TRAP(error, op = Client().ForwardL(KMsvDraftEntryId, part, wait->iStatus));
-
-		__UHEAP_RESET;
-
-		if (error)
-			{
-			test(error == KErrNoMemory);
-
-			if (failCount % 100 == 0)
-				iSmsTest.Printf(_L("CSmsClientMtm::ForwardL still failing, count = %d\n"), failCount);
-			}
-
-		}
-	while (error);
-
-	CleanupStack::PushL(op);
-	iSmsTest.Printf(_L("CSmsClientMtm::ForwardL Fail Count %d\n"), failCount);
-	wait->Start();
-	CActiveScheduler::Start();
-
-	CleanupStack::PopAndDestroy(2); //op, wait
-	}
-
-void CSmcmFailTest::TestLoadFailL()
-	{
-	iSmsTest.Test().Next(_L("CSmsClientMtm Load Fail"));
-
-	CleanFolderL(KMsvDraftEntryId);
-	CleanFolderL(KMsvGlobalOutBoxIndexEntryId);
-	CleanFolderL(KMsvGlobalInBoxIndexEntryId);
-
-	TMsvId id = iSmsTest.CreateDummyMessageToSendL();
-	Client().SwitchCurrentEntryL(id);
-	
-	TInt error;
-	TInt failCount = 0;
-
-	do
-		{
-		__UHEAP_FAILNEXT(failCount++);
-
-		TRAP(error, Client().LoadMessageL());
-
-		__UHEAP_RESET;
-
-		if (error)
-			{
-			test(error == KErrNoMemory);
-			}
-		}
-	while (error);
-
-	iSmsTest.Printf(_L("CSmsClientMtm::LoadMessageL Fail Count %d\n"), failCount);
-	}
-
-void CSmcmFailTest::TestSaveFailL()
-	{
-	iSmsTest.Test().Next(_L("CSmsClientMtm Save Fail"));
-
-	CleanFolderL(KMsvDraftEntryId);
-	CleanFolderL(KMsvGlobalOutBoxIndexEntryId);
-	CleanFolderL(KMsvGlobalInBoxIndexEntryId);
-
-	TMsvId id = iSmsTest.CreateDummyMessageToSendL();
-	Client().SwitchCurrentEntryL(id);
-	Client().LoadMessageL();
-	
-	TInt error;
-	TInt failCount = 0;
-
-	do
-		{
-		__UHEAP_FAILNEXT(failCount++);
-
-		TRAP(error, Client().SaveMessageL());
-
-		__UHEAP_RESET;
-
-		if (error)
-			{
-			test(error == KErrNoMemory);
-			}
-		}
-	while (error);
-
-	iSmsTest.Printf(_L("CSmsClientMtm::SaveMessageL Fail Count %d\n"), failCount);
-	}
-
-void CSmcmFailTest::TestAddresseeFailL()
-	{
-	iSmsTest.Test().Next(_L("CSmsClientMtm Save Fail"));
-
-	CleanFolderL(KMsvDraftEntryId);
-	CleanFolderL(KMsvGlobalOutBoxIndexEntryId);
-	CleanFolderL(KMsvGlobalInBoxIndexEntryId);
-
-	TMsvId id = iSmsTest.CreateDummyMessageToSendL();
-	Client().SwitchCurrentEntryL(id);
-	Client().LoadMessageL();
-	
-	TInt error;
-	TInt failCount = 0;
-
-	do
-		{
-		__UHEAP_FAILNEXT(failCount++);
-
-		TInt count = Client().AddresseeList().Count();
-		TRAP(error, Client().AddAddresseeL(_L("44")));
-
-		__UHEAP_RESET;
-
-		if (error)
-			{
-			test(error == KErrNoMemory);
-			test(count == Client().AddresseeList().Count());
-			}
-		else
-			{
-			test(count == Client().AddresseeList().Count() - 1);
-			}
-		}
-	while (error);
-
-	iSmsTest.Printf(_L("CSmsClientMtm Addressee1 Fail Count %d\n"), failCount);
-
-	failCount = 0;
-
-	do
-		{
-		__UHEAP_FAILNEXT(failCount++);
-
-		TInt count = Client().AddresseeList().Count();
-		TRAP(error, Client().AddAddresseeL(_L("44"), _L("AA")));
-
-		__UHEAP_RESET;
-
-		if (error)
-			{
-			test(error == KErrNoMemory);
-			test(count == Client().AddresseeList().Count());
-			}
-		else
-			{
-			test(count == Client().AddresseeList().Count() - 1);
-			}
-		}
-	while (error);
-
-	iSmsTest.Printf(_L("CSmsClientMtm Addressee2 Fail Count %d\n"), failCount);
-	}
-
-void CSmcmFailTest::TestBifFailL()
-	{
-	iSmsTest.Test().Next(_L("CSmsClientMtm Bio Fail"));
-
-	CleanFolderL(KMsvDraftEntryId);
-	CleanFolderL(KMsvGlobalOutBoxIndexEntryId);
-	CleanFolderL(KMsvGlobalInBoxIndexEntryId);
-
-	TMsvId id = iSmsTest.CreateDummyMessageToSendL();
-	Client().SwitchCurrentEntryL(id);
-	Client().LoadMessageL();
-	
-	TInt error;
-	TInt failCount = 0;
-
-	CBIODatabase* bdb = CBIODatabase::NewLC(Session().FileSession());
-
-	if (!bdb->BIOCount())
-		{
-		CleanupStack::PopAndDestroy(); //bdb
-		iSmsTest.Printf(_L("No Bio messages in Bio DB\n"));
-		return;
-		}
-
-	// Get the whole bif file class
-	const CBioInfoFileReader& reader = bdb->BifReader(0);
-
-	do
-		{
-		__UHEAP_FAILNEXT(failCount++);
-
-		TRAP(error, Client().BioTypeChangedL(reader.MessageTypeUid()));
-
-		__UHEAP_RESET;
-
-		if (error)
-			{
-			test(error == KErrNoMemory || error == KErrNotFound);
-			}
-		}
-	while (error && error != KErrNotFound);
-
-	iSmsTest.Printf(_L("CSmsClientMtm::BioTypeChangedL Fail Count %d\n"), failCount);
-	CleanupStack::PopAndDestroy(); //bdb
-	}
--- a/messagingappbase/smsmtm/test/src/T_SmsCancel.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,385 +0,0 @@
-// Copyright (c) 1999-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 <e32test.h>
-#include <e32uid.h>
-#include <e32std.h>
-#include <smuthdr.h>
-#include <smscmds.h>
-#include "T_SmsCancel.h"
-
-#define KSmsScript _L("sms.script")
-
-CSmsCancelTest::~CSmsCancelTest()
-	{
-	if (iSmsTest.iMsvSession)
-		{
-		iSmsTest.iMsvSession->RemoveObserver(*this);
-		}
-		iSocket.Close();
-		iSocketServ.Close();
-	}
-
-CSmsCancelTest::CSmsCancelTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest)
-: CSmsTestBase(aSmsTest, aScriptFile, aCurrentTest), iState(EStateWaiting)
-	{
-	}
-
-void CSmsCancelTest::RunAutoL()
-	{
-	
-	iSmsTest.TestStart(++iNextTest, _L("Cancel Sending"));
-	TestCancelSendingL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	iSmsTest.TestStart(++iNextTest, _L("Cancel Sending after Scheduling"));
-	TestCancelSendingAfterScheduleL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	iSmsTest.TestStart(++iNextTest);
-	TestCancelReadScL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	iSmsTest.TestStart(++iNextTest);
-	TestCancelWriteScL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	iSmsTest.TestStart(++iNextTest);
-	TestCancelReadSimParamsL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	iSmsTest.TestStart(++iNextTest);
-	TestCancelEnumerateL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-	}
-
-void CSmsCancelTest::ConstructL()
-	{
-	iSmsTest.SetLogToFile();
-
-	iSelection = new (ELeave) CMsvEntrySelection();
-
-	iSmsTest.iMsvSession->AddObserverL(*this);
-
-	CActiveScheduler::Add(this);
-	
-	User::LeaveIfError(iSocketServ.Connect());
-	TProtocolDesc protoinfo;
-	TProtocolName protocolname(KSmsDatagram);
-	User::LeaveIfError(iSocketServ.FindProtocol(protocolname,protoinfo));
-	User::LeaveIfError(iSocket.Open(iSocketServ,protoinfo.iAddrFamily,protoinfo.iSockType,protoinfo.iProtocol));
-	
-	TSmsAddr smsaddr;
-	smsaddr.SetSmsAddrFamily(ESmsAddrSendOnly);
-	User::LeaveIfError(iSocket.Bind(smsaddr));
-	}
-
-void CSmsCancelTest::HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* /*aArg2*/, TAny* /*aArg3*/)
-	{
-	CMsvEntrySelection* entries = NULL;
-
-	switch (aEvent)
-		{
-		case EMsvEntriesCreated:
-		case EMsvEntriesChanged:
-		case EMsvEntriesMoved:
-			entries = STATIC_CAST(CMsvEntrySelection*, aArg1);
-			break;
-		default:
-			return;
-		}
-
-	if (!IsActive())
-		return;
-
-	switch (iState)
-		{
-		case EStateSending:
-			{
-			iSmsTest.DisplaySendingStatesL(*entries);
-			CancelIfSendingL(*entries);
-
-			TInt error = KErrNone;
-
-			if (iSmsTest.SendingCompleteL(*iSelection, error) && !iOperation && iStatus == KRequestPending)
-				{
-				TRequestStatus* status = &iStatus;
-				User::RequestComplete(status, error);
-				}
-			break;
-			}
-		default:
-			break;
-		}
-	}
-
-void CSmsCancelTest::CancelIfSendingL(const CMsvEntrySelection& aSelection)
-	{
-	const TInt count = aSelection.Count();
-
-	for (TInt i = 0; i < count; i++)
-		{
-		TRAPD(err, iSmsTest.SetEntryL(aSelection[i]));
-
-		if (!err)
-			{
-			TMsvEntry entry = iSmsTest.Entry();
-
-			if (entry.SendingState() == KMsvSendStateSending)
-				{
-				if (iOperation)
-					{
-					iOperation->Cancel();
-					return;
-					}
-				else
-					{
-					entry.SetSendingState(KMsvSendStateSuspended);
-					TRAP(err, iSmsTest.ChangeEntryL(entry)); //ignore error
-
-					if (err)
-						{
-						iSmsTest.Printf(_L("Error Cancelling Entry %d: On ChangeEntryL()\n"), aSelection[i]);
-						} //end if
-					} //end if
-				} //end if
-			}
-		else
-			{
-			iSmsTest.Printf(_L("Error Cancelling Entry %d: On SetEntryL()\n"), aSelection[i]);
-			}
-		}
-	}
-
-void CSmsCancelTest::ShowMenuL()
-	{
-	iSmsTest.ResetMenu();
-
-	iSmsTest.AppendToMenuL(_L("Test Cancel Sending"));
-	iSmsTest.AppendToMenuL(_L("Test Cancel Scheduling"));
-
-	TInt result = iSmsTest.DisplayMenu(_L("SMS Cancel Test"));
-
-	if (result <= 0)
-		return;
-
-	switch (result)
-		{
-		case 1:
-			TestCancelSendingL();
-			break;
-		case 2:
-			TestCancelSendingAfterScheduleL();
-			break;
-		default:
-			User::Leave(KErrArgument);
-			break;
-		}
-
-	ShowMenuL();
-	}
-
-void CSmsCancelTest::RunL()
-	{
-	if (iOperation)
-		iSmsTest.SetProgressL(*iOperation);
-
-	switch (iState)
-		{
-		case EStateScheduling:
-			DoRunSchedulingL();
-			break;
-		case EStateSending:
-			DoRunSendingL();
-			break;
-		default:
-			{
-			break;
-			}
-		}
-
-	delete iOperation;
-	iOperation = NULL;
-	}
-
-void CSmsCancelTest::DoCancel()
-	{
-	if (iOperation)
-		{
-		iOperation->Cancel();
-		iSmsTest.Printf(_L("Operation Cancelled!\n"));
-		}
-	else
-		{
-		iSmsTest.Printf(_L("No operation to cancel!\n"));
-		}
-
-	delete iOperation;
-	iOperation = NULL;
-	}
-
-void CSmsCancelTest::DoRunSchedulingL()
-	{
-	if (iStatus == KErrNone)
-		iStatus = iSmsTest.iProgress.iError;
-
-	iSmsTest.Printf(_L("Scheduling completed with error %d\n"), iStatus);
-
-	TBool sent = EFalse;
-
-	if (iStatus == KErrNone)
-		{
-		iSmsTest.DisplaySendingStatesL(*iSelection);
-		TInt error = KErrNone;
-		sent = iSmsTest.SendingCompleteL(*iSelection, error);
-		iStatus = error;
-		}
-	
-	if (!sent)
-		{
-		iStatus = KRequestPending;
-		SetActive();
-		iState = EStateSending;
-		}
-	else
-		{
-		CActiveScheduler::Stop();
-		iState = EStateWaiting;
-		iSmsTest.Printf(_L("Scheduling completed with error %d\n"), iStatus);
-
-		if (!iSmsTest.RunAuto())
-			{
-			iSmsTest.Test().Printf(_L("\nPress any key to continue...\n"));
-			iSmsTest.Test().Getch();
-			}
-		}
-	}
-
-void CSmsCancelTest::DoRunSendingL()
-	{
-	CActiveScheduler::Stop();
-
-	if (!iOperation) //scheduled
-		{
-		TTimeIntervalMicroSeconds32 wait = 5000000;
-		iSmsTest.Printf(_L("\nWaiting %d seconds for SMSS to complete...\n\n"), wait.Int() / 1000000);
-		User::After(wait);
-		}
-
-	if (iStatus == KErrNone)
-		iStatus = iSmsTest.iProgress.iError;
-
-	iState = EStateWaiting;
-	iSmsTest.Printf(_L("Sending completed with error %d\n"), iStatus);
-
-	if (iStatus == KErrCancel)
-		{
-		iSmsTest.Printf(_L("Error %d is expected and OK\n"), iStatus);
-		iStatus = KErrNone;
-		}
-
-	iSmsTest.Printf(_L("Final Sending States of Messages:\n\n"), iStatus);
-	iSmsTest.DisplaySendingStatesL(*iSelection);
-
-	if (!iSmsTest.RunAuto())
-		{
-		iSmsTest.Test().Printf(_L("\nPress any key to continue...\n"));
-		iSmsTest.Test().Getch();
-		}
-	}
-
-RTest test(_L("SchSms Test"));
-
-
-LOCAL_C void doMainL()
-	{
-	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
-	CleanupStack::PushL(scheduler);
-	CActiveScheduler::Install( scheduler );
-
-	CSmsTestUtils* smsTest = CSmsTestUtils::NewL(test);
-	CleanupStack::PushL(smsTest);
-	TInt nextTest = 0;
-	
-	smsTest->NotifySaPhoneOnL();
-
-	CSmsCancelTest* cancelTest = CSmsCancelTest::NewLC(*smsTest, KSmsScript, nextTest);
-
-	smsTest->WaitForInitializeL();
-
-	cancelTest->StartL();
-
-	CleanupStack::PopAndDestroy(3); //SmsTest, scheduler
-	}
-
-
-GLDEF_C TInt E32Main()
-	{
-	__UHEAP_MARK;
-	test.Start(_L("Setup"));
-	CTrapCleanup* theCleanup = CTrapCleanup::New();
-	TRAPD(ret,doMainL());		
-	test(ret==KErrNone);
-	delete theCleanup;	
-	test.Console()->SetPos(0, 13);
-	test.End();
-	test.Close();
-	__UHEAP_MARKEND;
-	return(KErrNone);
-	}
-
-CSmsCancelTest* CSmsCancelTest::NewLC(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest)
-	{
-	CSmsCancelTest* self = new (ELeave) CSmsCancelTest(aSmsTest, aScriptFile, aCurrentTest);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	return self;
-	}
-
-void CSmsCancelTest::TestCancelReadScL()
-	{
-	}
-
-void CSmsCancelTest::TestCancelWriteScL()
-	{
-	}
-
-void CSmsCancelTest::TestCancelReadSimParamsL()
-	{
-	}
-
-void CSmsCancelTest::TestCancelEnumerateL()
-	{
-	}
-
-void CSmsCancelTest::TestCancelSendingL()
-	{
-	DoTestSendingL(iScriptFile);
-	iState = EStateSending;
-	CActiveScheduler::Start();
-	}
-
-void CSmsCancelTest::TestCancelSendingAfterScheduleL()
-	{
-	DoTestSchedulingL(iScriptFile);
-	iState = EStateScheduling;
-	CActiveScheduler::Start();
-	}
--- a/messagingappbase/smsmtm/test/src/T_SmsEnum.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1238 +0,0 @@
-// Copyright (c) 1999-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 <e32test.h>
-#include <e32uid.h>
-#include <e32std.h>
-#include <smuthdr.h>
-#include <smutset.h>
-#include <smscmds.h>
-#include "T_SmsEnum.h"
-#include <txtrich.h>
-#include <csmsaccount.h>
-
-RTest test(_L("T_SmsEnum Testrig"));
-CTrapCleanup* theCleanup;
-
-_LIT(KSmsScript, "smsenum.script");
-
-#if defined (__WINS__)
-_LIT(KPddName,"ECDRV");
-_LIT(KLddName,"ECOMM");
-#else	//__WINS__
-_LIT(KPddSirName,"ESIR");
-_LIT(KPddUartName,"ECUART4");
-_LIT(KLddName,"ECOMM");
-#endif	//__WINS__
-
-_LIT(KMessageData, "This is a simple text message");
-_LIT(KRecipientOk,		"+447973500446");
-
-void CSmsEnumTest::TestCopyFromSimL(TMsvId aFolderId)
-/**
-	Tests copying messages from SIM
- */
-	{
-	iSmsTest.Test().Next(_L("Copy From SIM"));
-	iState = EStateCopyFromSim;
-
-	if (aFolderId == KErrNotFound)
-		MsvEntry().SetEntryL(iSmsTest.iProgress.iEnumerateFolder);
-	else
-		MsvEntry().SetEntryL(aFolderId);
-
-	delete iSelection;
-	iSelection = NULL;
-	iSelection = MsvEntry().ChildrenL();
-	iSelection->InsertL(0,iSmsTest.iSmsServiceId);
-
-	TPckgBuf<TMsvId> pkg(KMsvGlobalInBoxIndexEntryId);
-
-	delete iOperation;
-	iOperation = NULL;
-	iOperation = Session().TransferCommandL(*iSelection, ESmsMtmCommandCopyFromPhoneStore, pkg, iStatus);
-	SetActive();
-	CActiveScheduler::Start();
-	}
-
-void CSmsEnumTest::TestMoveFromSimL(TMsvId aFolderId)
-/**
-	Tests moving messages from SIM
- */
-	{
-	iSmsTest.Test().Next(_L("Move From SIM"));
-	iState = EStateMoveFromSim;
-
-	if (aFolderId == KErrNotFound)
-		MsvEntry().SetEntryL(iSmsTest.iProgress.iEnumerateFolder);
-	else
-		MsvEntry().SetEntryL(aFolderId);
-
-	delete iSelection;
-	iSelection = NULL;
-	iSelection = MsvEntry().ChildrenL();
-	iSelection->InsertL(0,iSmsTest.iSmsServiceId);
-
-	TPckgBuf<TMsvId> pkg(KMsvGlobalInBoxIndexEntryId);
-
-	delete iOperation;
-	iOperation = NULL;
-	iOperation = Session().TransferCommandL(*iSelection, ESmsMtmCommandMoveFromPhoneStore, pkg, iStatus);
-	SetActive();
-	CActiveScheduler::Start();
-	}
-
-void CSmsEnumTest::TestDeleteFromSimL()
-/**
-	Tests deleting messages from SIM
- */
-	{
-	iSmsTest.Test().Next(_L("Delete From SIM"));
-	iState = EStateDeleteFromSim;
-
-	MsvEntry().SetEntryL(iSmsTest.iProgress.iEnumerateFolder);
-
-	delete iSelection;
-	iSelection = NULL;
-	iSelection = MsvEntry().ChildrenL();
-	iSelection->InsertL(0,iSmsTest.iSmsServiceId);
-
-	delete iOperation;
-	iOperation = NULL;
-	iOperation = Session().TransferCommandL(*iSelection, ESmsMtmCommandDeleteFromPhoneStore, TPtrC8(), iStatus);
-	SetActive();
-	CActiveScheduler::Start();
-	}
-
-TInt CSmsEnumTest::GetInboxMsgsCountL()
-/**
-	Count messages in Inbox
- */
-	{
-	MsvEntry().SetEntryL(KMsvGlobalInBoxIndexEntryId);
-
-	delete iSelection;
-	iSelection = NULL;
-	iSelection = MsvEntry().ChildrenL();
-	return iSelection->Count();
-	}
-
-void CSmsEnumTest::ClearInboxL()
-/**
-	Remove all messages from the Inbox
- */
-	{
-	iState = EStateClearInbox;
-	MsvEntry().SetEntryL(KMsvGlobalInBoxIndexEntryId);
-
-	delete iSelection;
-	iSelection = NULL;
-	iSelection = MsvEntry().ChildrenL();
-
-	if (iSelection->Count() > 0)
-		{
-		delete iOperation;
-		iOperation = NULL;
-		iOperation = MsvEntry().DeleteL(*iSelection, iStatus);
-		SetActive();
-		CActiveScheduler::Start();
-		}
-	}
-
-void CSmsEnumTest::SaveClass2FolderIdL(TMsvId aFolderId)
-/**
-	Set the class 2 folder in the service Id
-	so that it will be picked up correctly by SMSS
- */
-	{
-	MsvEntry().SetEntryL(iSmsTest.iSmsServiceId);
-	CSmsSettings *settings=CSmsSettings::NewL();
-	CleanupStack::PushL(settings);
-
-	CSmsAccount* account = CSmsAccount::NewLC();
-	TRAPD(error, account->LoadSettingsL(*settings));
-	if (error)
-		{
-		account->InitialiseDefaultSettingsL(*settings);
-		}
-
-	settings->SetClass2Folder(aFolderId);
-
-	account->SaveSettingsL(*settings);
-	CleanupStack::PopAndDestroy(account);
-	CleanupStack::PopAndDestroy(settings);
-	}
-
-TMsvId CSmsEnumTest::CreateEnumerateFolderLC(TMsvId aParent)
-	{
-	iSmsTest.SetEntryL(aParent);
-
-	TMsvEntry entry;
-	entry.SetVisible(EFalse);
-	entry.iType = KUidMsvFolderEntry;
-	entry.iMtm = KUidMsgTypeSMS;
-	entry.iServiceId = iSmsTest.iSmsServiceId;
-	iSmsTest.CreateEntryL(entry);
-
-	iSmsTest.iMsvSession->CleanupEntryPushL(entry.Id());
-	return entry.Id();
-	}
-
-void CSmsEnumTest::TestCopyToSimL()
-/**
-	Tests copying messages to SIM
- */
-	{
-	iSmsTest.Test().Next(_L("Copy to SIM"));
-	iState = EStateCopyToSim;
-
-	iSelection->Reset();
-
-	TTime now;
-	now.HomeTime();
-	iSelection->Reset();
-
-	iSmsTest.ReadScriptL(iScriptFile, KMsvGlobalOutBoxIndexEntryId, *iSelection, now);
-	iSelection->InsertL(0,iSmsTest.iSmsServiceId);
-	iSmsTest(iSelection->Count());
-
-	delete iOperation;
-	iOperation = NULL;
-	iOperation = Session().TransferCommandL(*iSelection, ESmsMtmCommandCopyToPhoneStore, TPtrC8(), iStatus);
-	SetActive();
-	CActiveScheduler::Start();
-	}
-
-void CSmsEnumTest::TestMoveToSimL(TMsvId aSourceFolderId)
-/**
-	Tests copying messages to SIM
- */
-	{
-	iSmsTest.Test().Next(_L("Move to SIM"));
-	iState = EStateMoveToSim;
-
-	MsvEntry().SetEntryL(aSourceFolderId);
-
-	delete iSelection;
-	iSelection = NULL;
-	iSelection = MsvEntry().ChildrenL();
-	iSelection->InsertL(0,iSmsTest.iSmsServiceId);
-
-	iSmsTest(iSelection->Count());
-
-	delete iOperation;
-	iOperation = NULL;
-	iOperation = Session().TransferCommandL(*iSelection, ESmsMtmCommandMoveToPhoneStore, TPtrC8(), iStatus);
-	SetActive();
-	CActiveScheduler::Start();
-	}
-
-void CSmsEnumTest::TestEnumerateL(TMsvId aFolderId)
-/**
-	Enumerates
- */
-	{
-	iSmsTest.Test().Next(_L("Enumerate SIM"));
-	iState = EStateEnumerating;
-
-	iSmsTest.Printf(_L("TestEnumerateL(%d)\n"), aFolderId);
-
-	if (aFolderId != KErrNotFound)
-		{
-		iLastEnumerateFolder() = aFolderId;
-		iLastEnumerateFolder.SetLength(4);
-		}
-	else
-		iLastEnumerateFolder.SetLength(0);
-
-	iSelection->Reset();
-	iSelection->AppendL(iSmsTest.iSmsServiceId);
-
-	delete iOperation;
-	iOperation = NULL;
-	iOperation = Session().TransferCommandL(*iSelection, ESmsMtmCommandEnumeratePhoneStores, iLastEnumerateFolder, iStatus);
-	SetActive();
-	CActiveScheduler::Start();
-	}
-
-void CSmsEnumTest::TestEnumerateAndDescLengthL(TMsvId aFolderId)
-/**
-	Tests both enumeration and changing the default description length.
-*/
-	{
-	iSmsTest.Test().Next(_L("Enumerate SIM and non-default description length"));
-	iState = EStateEnumeratingAndDescLength;
-
-	iSmsTest.Printf(_L("TestEnumerateAndDescLength(%d)\n"), aFolderId);
-
-	if (aFolderId != KErrNotFound)
-		{
-		iLastEnumerateFolder() = aFolderId;
-		iLastEnumerateFolder.SetLength(4);
-		}
-	else
-		iLastEnumerateFolder.SetLength(0);
-
-	// Set the description length - first restore the sms settings
-	iSmsTest.SetEntryL(iSmsTest.iSmsServiceId);
-
-	CSmsAccount* account = CSmsAccount::NewLC();
-	account->LoadSettingsL(*iSmsTest.iServiceSettings);
-
-	// Set the description length to 1
-	iSmsTest.iServiceSettings->SetDescriptionLength(1);
-
-	// Store the sms settings
-	account->SaveSettingsL(*iSmsTest.iServiceSettings);
-	CleanupStack::PopAndDestroy(account);
-
-	iSelection->Reset();
-	iSelection->AppendL(iSmsTest.iSmsServiceId);
-
-	delete iOperation;
-	iOperation = NULL;
-	iOperation = Session().TransferCommandL(*iSelection, ESmsMtmCommandEnumeratePhoneStores, iLastEnumerateFolder, iStatus);
-	SetActive();
-	CActiveScheduler::Start();
-	}
-
-void CSmsEnumTest::TestEnumerateAndDetailsFieldL()
-	{
-	iSmsTest.Test().Next(_L("Enumerate SIM and test that details field is ok."));
-	iState = EStateEnumeratingAndDetailsField;
-	
-	// First create deliver message in the inbox.
-	TMsvEntry entry;
-	entry.SetVisible(ETrue); 
-	entry.SetInPreparation(ETrue); 
-	entry.iServiceId = iSmsTest.iSmsServiceId; 
-	entry.iType = KUidMsvMessageEntry; 
-	entry.iMtm = KUidMsgTypeSMS; 
-	entry.iDate.HomeTime(); 
-	entry.iSize = 0; 
-	entry.iDescription.Set(KNullDesC); 
-	entry.iDetails.Set(KNullDesC); 
-	entry.SetSendingState(KMsvSendStateNotApplicable); 
-
-	// Create the SMS header object...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *iSmsTest.iRichText);
-	CleanupStack::PushL(header);
-	
-	// Set the body text...
-	iSmsTest.iRichText->Reset();
-	iSmsTest.iRichText->InsertL(0, KMessageData);
-	
-	// Copy the message settings...
-	header->SetSmsSettingsL(*iSmsTest.iServiceSettings); 
-	
-	// Set recipient - need to set directly in the CSmsMessage as this a Deliver PDU
-	header->Message().SetToFromAddressL(KRecipientOk);
-	
-	// Update entry description and details...
-	entry.iDetails.Set(header->Message().ToFromAddress());
-	entry.iDescription.Set(iSmsTest.iRichText->Read(0, iSmsTest.iServiceSettings->DescriptionLength()));
-	entry.SetInPreparation(EFalse);
-	
-	// Create the entry - set context to the global outbox.
-	MsvEntry().SetEntryL(KMsvGlobalInBoxIndexEntryId);
-	MsvEntry().CreateL(entry);
-
-	// Create new store and save header information 
-	MsvEntry().SetEntryL(entry.Id()); 
-	CMsvStore* store = MsvEntry().EditStoreL(); 
-	CleanupStack::PushL(store); 
-	header->StoreL(*store);
-	store->StoreBodyTextL(*iSmsTest.iRichText);
-	store->CommitL(); 
-	CleanupStack::PopAndDestroy(2, header); 
-	
-	// Move the message to the SIM
-
-	delete iSelection;
-	iSelection = NULL;
-	iSelection = new (ELeave) CMsvEntrySelection();
-	iSelection->AppendL(iSmsTest.iSmsServiceId);
-	iSelection->AppendL(entry.Id());
-	
-	iSmsTest(iSelection->Count());
-
-	delete iOperation;
-	iOperation = NULL;
-	iOperation = Session().TransferCommandL(*iSelection, ESmsMtmCommandMoveToPhoneStore, TPtrC8(), iStatus);
-	SetActive();
-	CActiveScheduler::Start();
-	
-	// Enumerate the SIM - first create the folder into which to enumerate
-	TMsvId folder = CreateEnumerateFolderLC(KMsvGlobalInBoxIndexEntryId);
-	
-	iLastEnumerateFolder() = folder;
-	iLastEnumerateFolder.SetLength(4);
-
-	iSelection->Reset();
-	iSelection->AppendL(iSmsTest.iSmsServiceId);
-
-	delete iOperation;
-	iOperation = NULL;
-	iOperation = Session().TransferCommandL(*iSelection, ESmsMtmCommandEnumeratePhoneStores, iLastEnumerateFolder, iStatus);
-	SetActive();
-	CActiveScheduler::Start();
-	
-	// Ok see if things are how it should be...
-	iSmsTest.SetEntryL(folder);
-	delete iSelection;
-	iSelection = NULL;
-	iSelection = MsvEntry().ChildrenL();
-	iSmsTest.Test()(iSelection->Count() == 1);
-
-	iSmsTest.SetEntryL(iSelection->At(0));
-	entry = MsvEntry().Entry();
-	iSmsTest.Test()(entry.iDetails.Length() > 0);
-	
-	// Destroy the enumerate folder
-	CleanupStack::PopAndDestroy();	
-	}
-
-void CSmsEnumTest::TestMultipleRecipientEnumerateL()
-	{
-	// Clean the existing messages
-	ClearInboxL();
-	TestEnumerateL();
-	User::LeaveIfError(iStatus.Int());
-	if (iSelection->Count())
-		{
-		TestDeleteFromSimL();
-		User::LeaveIfError(iStatus.Int());
-		}
-	
-	// Copy to SIM
-	TestCopyToSimL();
-	User::LeaveIfError(ErrorStatus());
-	// Count the number of messages to be copied onto SIM,
-	// including multiple msgs for multiple recipients.
-	TInt msgCount = 0;
-	for (TInt index=1; index < (iSelection->Count()); index++)
-		{
-		CSmsHeader* smsHeader = iSmsTest.GetHeaderLC(iSelection->At(index));
-		if (smsHeader->Message().Type() == CSmsPDU::ESmsSubmit)
-			{
-			msgCount += smsHeader->Recipients().Count();
-			}
-		else
-			{
-			++msgCount;
-			}
-		CleanupStack::PopAndDestroy(smsHeader);
-		}
-
-	TestEnumerateL();
-	User::LeaveIfError(iStatus.Int());
-	//Count the number of messages copied onto SIM
-	TInt simMsgCount = iSmsTest.iProgress.iMsgCount;
-
-	// Check msg count on SIM after copy
-	iSmsTest.Printf(_L("Count msgs on SIM: Expected msgs %d, Copied msgs %d\n"), msgCount, simMsgCount);
-	if (msgCount != simMsgCount)
-		{
-		User::LeaveIfError(KErrNotFound);
-		}
-	
-	// Clean local Inbox and copy msgs from sim
-	if (iSelection->Count())
-		{
-		ClearInboxL();
-		TestCopyFromSimL();
-		User::LeaveIfError(ErrorStatus());
-		}
-	msgCount = GetInboxMsgsCountL();
-
-	// Check msg count in local inbox after copy from SIM
-	iSmsTest.Printf(_L("Count msgs in Inbox: Expected msgs %d, Copied msgs %d\n"), simMsgCount, msgCount);
-	if (msgCount != simMsgCount)
-		{
-		User::LeaveIfError(KErrNotFound);
-		}
-
-	}
-
-
-CSmsEnumTest::CSmsEnumTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest)
-: CSmsTestBase(aSmsTest, aScriptFile, aNextTest), iState(EStateWaiting)
-	{
-	CActiveScheduler::Add(this);
-	}
-
-LOCAL_C void doMainL()
-	{
-#if defined (__WINS__)
-	User::LoadPhysicalDevice(KPddName);
-	User::LoadLogicalDevice(KLddName);
-#else	//__WINS__
-	User::LoadPhysicalDevice(KPddSirName);
-	User::LoadPhysicalDevice(KPddUartName);
-    User::LoadLogicalDevice(KLddName);
-#endif	//__WINS__
-
-	TInt r = StartC32();
-	if( (r != KErrNone) && (r != KErrAlreadyExists) )
-		test.Printf(_L("Failed to start C32 %d\n"), r);
-
-	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
-	CleanupStack::PushL(scheduler);
-	CActiveScheduler::Install( scheduler );
-
-	CSmsTestUtils* smsTest = CSmsTestUtils::NewL(test);
-	CleanupStack::PushL(smsTest);
-	TInt nextTest = 0;
-
-	smsTest->NotifySaPhoneOnL();
-
-	CSmsEnumTest* enumTest = CSmsEnumTest::NewLC(*smsTest, KSmsScript, nextTest);
-
-	smsTest->WaitForInitializeL();
-
-	enumTest->StartL();
-
-	//CleanupStack::PopAndDestroy(3); //SmsTest, scheduler
-	CleanupStack::PopAndDestroy(enumTest);
-	CleanupStack::PopAndDestroy(smsTest);
-	CleanupStack::PopAndDestroy(scheduler);
-	}
-
-GLDEF_C TInt E32Main()
-	{	
-	__UHEAP_MARK;
-	test.Start(_L("Setup"));
-	theCleanup = CTrapCleanup::New();
-	TRAPD(ret,doMainL());
-	test.Printf(_L("doMainL completed with %d\n"), ret);
-	test(ret==KErrNone);
-	delete theCleanup;	
-	test.Console()->SetPos(0, 13);
-	test.End();
-	test.Close();
-	__UHEAP_MARKEND;
-	return(KErrNone);
-	}
-
-void CSmsEnumTest::RunAutoL()
-/**
-	Runs tests in sequence, checks iStatus
- */
-	{
-	// Wait 5 seconds for everything to start up
-	User::After(5000000);
-
-	// Initial clean-up
-	iSmsTest.TestStart(++iNextTest, _L("(Cleanup) Enumerate"));
-	TestEnumerateL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	if (iSelection->Count())
-		{
-		iSmsTest.TestStart(++iNextTest, _L("(Cleanup) Delete from SIM"));
-		TestDeleteFromSimL();
-		User::LeaveIfError(iStatus.Int());
-		iSmsTest.TestFinish(iNextTest, KErrNone);
-		}
-
-	// Actual testing
-	ClearInboxL();
-	iSmsTest.TestStart(++iNextTest, _L("Enumerate - check details field"));
-	TestEnumerateAndDetailsFieldL();
-	User::LeaveIfError(ErrorStatus());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-	ClearInboxL();
-
-	iSmsTest.TestStart(++iNextTest, _L("Copy to SIM"));
-	TestCopyToSimL();
-	User::LeaveIfError(ErrorStatus());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	iSmsTest.TestStart(++iNextTest, _L("Enumerate"));
-	TestEnumerateL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-//	iSmsTest.TestStart(++iNextTest, _L("Test UnRead Status - all messages un-read after 1st enumerate"));
-//	TestUnreadStatusL();
-//	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	iSmsTest.TestStart(++iNextTest, _L("Enumerate and non-default description length"));
-	TestEnumerateAndDescLengthL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	iSmsTest.TestStart(++iNextTest, _L("Test Read Status - all messages read after 2nd enumerate"));
-	TestReadStatusL();
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	SaveClass2FolderIdL(iSmsTest.iProgress.iEnumerateFolder);
-	TMsvId class2Folder = iSmsTest.iProgress.iEnumerateFolder;
-	ClearInboxL();
-
-	if (iSelection->Count())
-		{
-		iSmsTest.TestStart(++iNextTest, _L("Move from SIM"));
-		TestMoveFromSimL(class2Folder);
-		User::LeaveIfError(ErrorStatus());
-		iSmsTest.TestFinish(iNextTest, KErrNone);
-		}
-	
-	iSmsTest.TestStart(++iNextTest, _L("Copy to SIM"));
-	TestCopyToSimL();
-	User::LeaveIfError(ErrorStatus());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	iSmsTest.TestStart(++iNextTest, _L("Test SIM store status after copy to SIM"));
-	TestSimStoreStatusL(class2Folder);
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	iSmsTest.TestStart(++iNextTest, _L("Enumerate"));
-	TestEnumerateL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	if (iSelection->Count())
-		{
-		iSmsTest.TestStart(++iNextTest, _L("Move from SIM"));
-		TestMoveFromSimL(class2Folder);
-		User::LeaveIfError(ErrorStatus());
-		iSmsTest.TestFinish(iNextTest, KErrNone);
-		}
-
-	iSmsTest.TestStart(++iNextTest, _L("Test phone store status after move from SIM"));
-	TestPhoneStoreStatusL(KMsvGlobalInBoxIndexEntryId);
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	iSmsTest.TestStart(++iNextTest, _L("Move to SIM"));
-	TestMoveToSimL(KMsvGlobalInBoxIndexEntryId);
-	User::LeaveIfError(ErrorStatus());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	iSmsTest.TestStart(++iNextTest, _L("Test SIM store status after move to SIM"));
-	TestSimStoreStatusL(class2Folder);
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	iSmsTest.TestStart(++iNextTest, _L("Copy from SIM"));
-	TestCopyFromSimL(class2Folder);
-	User::LeaveIfError(ErrorStatus());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	iSmsTest.TestStart(++iNextTest, _L("Test phone store status after copy from SIM"));
-	TestPhoneStoreStatusL(KMsvGlobalInBoxIndexEntryId);
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	// Copy to SIM, multiple recipients
-	iSmsTest.TestStart(++iNextTest, _L("Copy to SIM, multiple recipients"));
-	TestMultipleRecipientEnumerateL();
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	TestAllEnumerateL();
-	TMsvId folder = CreateEnumerateFolderLC(KMsvGlobalInBoxIndexEntryId);
-	TestAllEnumerateL(folder);
-	TestAllEnumerateL(folder);
-	folder = CreateEnumerateFolderLC(KMsvGlobalInBoxIndexEntryId);
-	TestAllEnumerateL(folder);
-	CleanupStack::PopAndDestroy(2);
-
-	iSmsTest.TestStart(++iNextTest, _L("Enumerate before move"));
-	TestEnumerateL(KErrNotFound);
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	if (iSelection->Count())
-		{
-		iSmsTest.TestStart(++iNextTest, _L("Move from SIM"));
-		TestMoveFromSimL();
-		User::LeaveIfError(iStatus.Int());
-		iSmsTest.TestFinish(iNextTest, KErrNone);
-		}
-	}
-
-void CSmsEnumTest::TestAllEnumerateL(TMsvId aFolderId)
-	{
-	iSmsTest.TestStart(++iNextTest, _L("Enumerate"));
-	TestEnumerateL(aFolderId);
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	if (iSelection->Count())
-		{
-		iSmsTest.TestStart(++iNextTest, _L("Copy from SIM"));
-		TestCopyFromSimL(aFolderId);
-		User::LeaveIfError(ErrorStatus());
-		iSmsTest.TestFinish(iNextTest, KErrNone);
-		}
-	}
-
-void CSmsEnumTest::ConstructL()
-	{
-	SetTestNameL(KSmsEnumTestName);
-	iSmsTest.SetLogToFile();
-
-	iSelection = new (ELeave) CMsvEntrySelection();
-	iTimer = CTestTimer::NewL();
-
-	User::LeaveIfError(iSocketServ.Connect());
-	TProtocolDesc protoinfo;
-	TProtocolName protocolname(KSmsDatagram);
-	User::LeaveIfError(iSocketServ.FindProtocol(protocolname,protoinfo));
-	User::LeaveIfError(iSocket.Open(iSocketServ,protoinfo.iAddrFamily,protoinfo.iSockType,protoinfo.iProtocol));
-	
-	TSmsAddr smsaddr;
-	smsaddr.SetSmsAddrFamily(ESmsAddrSendOnly);
-	User::LeaveIfError(iSocket.Bind(smsaddr));
-
-	iParaFormat = CParaFormatLayer::NewL();
-	iCharFormat = CCharFormatLayer::NewL();
-	iBody = CRichText::NewL(iParaFormat, iCharFormat);
-	iHeader = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *iBody);
-	}
-
-void CSmsEnumTest::ShowMenuL()
-	{
-	iSmsTest.ResetMenu();
-
-	iSmsTest.AppendToMenuL(_L("Enumerate SIM"));
-	iSmsTest.AppendToMenuL(_L("Copy To SIM"));
-	iSmsTest.AppendToMenuL(_L("Display Log"));
-	iSmsTest.AppendToMenuL(_L("Clear Log"));
-
-	TInt result = iSmsTest.DisplayMenu(_L("SMS Enumerate Sim Test"));
-
-	if (result <= 0)
-		return;
-
-	switch (result)
-		{
-		case 1:
-			TestEnumerateL();
-			break;
-		case 2:
-			TestCopyToSimL();
-			break;
-		case 3:
-			DisplayLogL();
-			break;
-		case 4:
-			ClearLogL();
-			break;
-		default:
-			User::Leave(KErrArgument);
-			break;
-		}
-
-	ShowMenuL();
-	}
-
-CSmsEnumTest::~CSmsEnumTest()
-	{
-	delete iBody;
-	delete iHeader;
-	delete iParaFormat;
-	delete iCharFormat;
-
-	iSocket.Close();
-	iSocketServ.Close();
-	}
-
-CSmsEnumTest* CSmsEnumTest::NewLC(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest)
-	{
-	CSmsEnumTest* self = new (ELeave) CSmsEnumTest(aSmsTest, aScriptFile, aNextTest);
-	CleanupStack::PushL(self);
-
-	self->ConstructL();
-	return self;
-	}
-
-void CSmsEnumTest::RunL()
-/**
-	Handles completed async operations
- */
-	{
-	CActiveScheduler::Stop();
-
-	iSmsTest(iStatus.Int() == KErrNone);
-
-	iSmsTest.SetProgressL(*iOperation);
-
-	switch (iState)
-		{
-		case EStateEnumerating:
-			{
-			DoRunEnumerateL();
-			break;
-			}
-		case EStateEnumeratingAndDescLength:
-			{
-			DoRunEnumerateAndDescLengthL();
-			} break;
-		case EStateCopyFromSim:
-		case EStateMoveFromSim:
-		case EStateDeleteFromSim:
-			{
-			DoRunCopyMoveDeleteFromSim();
-			break;
-			}
-		case EStateCopyToSim:
-			{
-			DoRunCopyToSim();
-			break;
-			}
-		case EStateClearInbox:
-			{
-			DoRunClearInbox();
-			break;
-			}
-		default:
-			{
-			break;
-			}
-		}
-
-	delete iOperation;
-	iOperation = NULL;
-	}
-
-TInt CSmsEnumTest::ErrorStatus()
-	{
-	if (iStatus.Int() == KErrNone)
-		return(iSmsTest.iProgress.iError);
-	else
-		return(iStatus.Int());
-	}
-
-void CSmsEnumTest::DoRunClearInbox()
-/**
-	Checks status
- */
-	{
-	TInt err = iStatus.Int();
-	iSmsTest.Printf(_L("Clear Inbox completed with error %d\n"), err);
-	iState = EStateWaiting;
-	}
-
-void CSmsEnumTest::DoRunCopyToSim()
-/**
-	Checks status
- */
-	{
-	iSmsTest.Printf(_L("Copy To SIM completed with error %d\n"), ErrorStatus());
-
-	iState = EStateWaiting;
-
-	if (!iSmsTest.RunAuto())
-		{
-		iSmsTest.Printf(_L("\nPress any key to continue...\n"));
-		iSmsTest.Test().Getch();
-		}
-	}
-
-void CSmsEnumTest::DoRunMoveToSim()
-/**
-	Checks status
- */
-	{
-	iSmsTest.Printf(_L("Move To SIM completed with error %d\n"), ErrorStatus());
-
-	iState = EStateWaiting;
-
-	if (!iSmsTest.RunAuto())
-		{
-		iSmsTest.Printf(_L("\nPress any key to continue...\n"));
-		iSmsTest.Test().Getch();
-		}
-	}
-
-void CSmsEnumTest::DoRunCopyMoveDeleteFromSim()
-/**
-	Checks status
- */
-	{
-	switch (iState)
-		{
-		case EStateCopyFromSim:
-			iSmsTest.Printf(_L("Copy From SIM completed with error %d\n"), ErrorStatus());
-			break;
-		case EStateMoveFromSim:
-			iSmsTest.Printf(_L("Move From SIM completed with error %d\n"), ErrorStatus());
-			break;
-		case EStateDeleteFromSim:
-			iSmsTest.Printf(_L("Delete From SIM completed with error %d\n"), ErrorStatus());
-			break;
-		default:
-			break;
-		}
-
-	iState = EStateWaiting;
-
-	if (!iSmsTest.RunAuto())
-		{
-		iSmsTest.Printf(_L("\nPress any key to continue...\n"));
-		iSmsTest.Test().Getch();
-		}
-	}
-
-void CSmsEnumTest::DoRunEnumerateL()
-/**
-	Checks status
- */
-	{
-	TInt err = iStatus.Int();
-
-	if (err == KErrNone)
-		{
-		err = iSmsTest.iProgress.iError;
-		iStatus = err;
-
-		if (err == KErrNone)
-			{
-			MsvEntry().SetEntryL(iSmsTest.iProgress.iEnumerateFolder);
-			delete iSelection;
-			iSelection = NULL;
-			iSelection = MsvEntry().ChildrenL();
-
-			iSmsTest.Printf(_L("%d message(s) on SIM. %d message(s) now contained in folder %d.\n"), iSmsTest.iProgress.iMsgCount, iSelection->Count(), iSmsTest.iProgress.iEnumerateFolder);
-			iSmsTest.DisplayMessagesL(*iSelection);
-			}
-		}
-
-	iSmsTest.Printf(_L("Enumerate SIM completed with %d\n"), err);
-	iState = EStateWaiting;
-
-	CheckParentAfterEnumerateL();
-
-	delete iOperation;
-	iOperation = NULL;
-
-	if (!iSmsTest.RunAuto())
-		{
-		iSmsTest.Printf(_L("\nPress any key to continue...\n"));
-		iSmsTest.Test().Getch();
-
-		if  (iSmsTest.iProgress.iMsgCount)
-			ShowMenuAfterEnumerateL();
-		}
-	}
-
-void CSmsEnumTest::DoRunEnumerateAndDescLengthL()
-	{
-	// Print out messages and check that the description is only a char in length
-	TInt err = iStatus.Int();
-
-	if (err == KErrNone)
-		{
-		err = iSmsTest.iProgress.iError;
-		iStatus = err;
-
-		if (err == KErrNone)
-			{
-			MsvEntry().SetEntryL(iSmsTest.iProgress.iEnumerateFolder);
-			delete iSelection;
-			iSelection = NULL;
-			iSelection = MsvEntry().ChildrenL();
-
-			iSmsTest.Printf(_L("%d message(s) on SIM. %d message(s) now contained in folder %d.\n"), iSmsTest.iProgress.iMsgCount, iSelection->Count(), iSmsTest.iProgress.iEnumerateFolder);
-			TInt count = iSelection->Count();
-			
-			for (TInt i = 0; i < count && err==KErrNone; ++i)
-				{
-				// Display the message and then check the description
-				TMsvId id = (*iSelection)[i];
-				iSmsTest.DisplayMessageL(id);
-
-				iSmsTest.SetEntryL(id);
-				if( iSmsTest.Entry().iDescription.Length() != 1 )
-					err = KErrCorrupt;
-				}
-			}
-		}
-
-	iSmsTest.Printf(_L("Enumerate SIM completed with %d\n"), err);
-	iState = EStateWaiting;
-
-	CheckParentAfterEnumerateL();
-
-	delete iOperation;
-	iOperation = NULL;
-
-	if (!iSmsTest.RunAuto())
-		{
-		iSmsTest.Printf(_L("\nPress any key to continue...\n"));
-		iSmsTest.Test().Getch();
-
-		if  (iSmsTest.iProgress.iMsgCount)
-			ShowMenuAfterEnumerateL();
-		}
-
-	// Restore the description length
-	iSmsTest.SetEntryL(iSmsTest.iSmsServiceId);
-
-	CSmsAccount* account = CSmsAccount::NewLC();
-	account->LoadSettingsL(*iSmsTest.iServiceSettings);
-
-	// Set the description length to default
-	iSmsTest.iServiceSettings->SetDescriptionLength(KSmsDescriptionLength);
-
-	// Store the sms settings
-	account->SaveSettingsL(*iSmsTest.iServiceSettings);
-	CleanupStack::PopAndDestroy(account);
-	}
-
-void CSmsEnumTest::CheckParentAfterEnumerateL()
-	{
-	if (iLastEnumerateFolder.Length() == 0)
-		{
-		iSmsTest.SetEntryL(iSmsTest.iProgress.iEnumerateFolder);
-		const TMsvId parent = iSmsTest.Entry().Parent();
-		if (parent != iSmsTest.iSmsServiceId)
-			{
-			iSmsTest.Printf(_L("Parent of enum folder is not the SMS service [parent=%d folder=%d service=%d]\n"),
-				parent, iSmsTest.iProgress.iEnumerateFolder, iSmsTest.iSmsServiceId);
-			User::Leave(KErrGeneral);
-			}
-		}
-	else if (iSmsTest.iProgress.iEnumerateFolder != iLastEnumerateFolder())
-		{
-		iSmsTest.Printf(_L("Folder does not match [folder=%d request=%d]\n"),
-			iSmsTest.iProgress.iEnumerateFolder, iLastEnumerateFolder());
-		User::Leave(KErrGeneral);
-		}
-	}
-
-void CSmsEnumTest::ShowMenuAfterEnumerateL()
-/**
-	Shows menu after enumerating
- */
-	{
-	iSmsTest.ResetMenu();
-
-	iSmsTest.AppendToMenuL(_L("Copy From Sim To Inbox"));
-	iSmsTest.AppendToMenuL(_L("Move From Sim To Inbox"));
-	iSmsTest.AppendToMenuL(_L("Delete From Sim"));
-
-	TInt result = iSmsTest.DisplayMenu(_L("What to do with enumerated messages?"));
-
-	if (result <= 0)
-		return;
-
-	switch (result)
-		{
-		case 1:
-			TestCopyFromSimL();
-			break;
-		case 2:
-			TestMoveFromSimL();
-			break;
-		case 3:
-			TestDeleteFromSimL();
-			break;
-		default:
-			User::Leave(KErrArgument);
-			break;
-		}
-	}
-
-void CSmsEnumTest::DoCancel()
-/**
-	Cancels the async operation
- */
-	{
-	if (iOperation)
-		{
-		iOperation->Cancel();
-		iSmsTest.Printf(_L("Operation Cancelled!\n"));
-		}
-	else
-		{
-		iSmsTest.Printf(_L("No operation to cancel!\n"));
-		}
-
-	delete iOperation;
-	iOperation = NULL;
-	}
-
-void CSmsEnumTest::TestDeleteRemoteEntryL()
-/**
-	Tests deleting remote entries 
- */
-	{
-	iSmsTest.Test().Next(_L("Test Delete Remote Entry\n"));
-
-	CMsvOperationWait* wait = CMsvOperationWait::NewLC();
-	wait->Start();
-
-	iSmsTest.SetEntryL(iSmsTest.iProgress.iEnumerateFolder);
-	iSmsTest.SetEntryL(iSmsTest.Entry().Parent());
-
-	CMsvOperation* op = iSmsTest.iMsvEntry->DeleteL(iSmsTest.iProgress.iEnumerateFolder, wait->iStatus);
-	CleanupStack::PushL(op);
-
-	CActiveScheduler::Start();
-
-	iSmsTest.Printf(_L("Remote DeleteL() completed with %d\n"), wait->iStatus.Int());
-
-	User::LeaveIfError(wait->iStatus.Int());
-
-	iSmsTest.SetProgressL(*op);
-
-	iSmsTest.Printf(_L("Operation completed with %d, msg count %d\n"), iSmsTest.iProgress.iError, iSmsTest.iProgress.iMsgCount);
-	User::LeaveIfError(iSmsTest.iProgress.iError);
-
-	CleanupStack::PopAndDestroy(2); //wait, op
-	}
-
-void CSmsEnumTest::TestUnreadStatusL()
-/**
-	Tests that the unread flag of any messaged on the SIM is propagated
-	to the entries created in the class 2 folder
-
-	These should have the Unread() flag SET after the first enumeration.
- */
-	{
-	iSmsTest.Test().Next(_L("Test Unread Status\n"));
-
-	MsvEntry().SetEntryL(iSmsTest.iProgress.iEnumerateFolder);
-
-	delete iSelection;
-	iSelection = NULL;
-	iSelection = MsvEntry().ChildrenL();
-
-	TInt count = iSelection->Count();
-	TInt status = KErrNone;
-
-	while (count--)
-		{
-		MsvEntry().SetEntryL(iSelection->At(count));
-		if (!MsvEntry().Entry().Unread())
-			{
-			status = KErrCorrupt;
-			break;
-			}
-		}
-
-	iSmsTest.Printf(_L("TestUnreadStatusL() completed with %d\n"), status);
-	User::LeaveIfError(status);
-	}
-
-void CSmsEnumTest::TestReadStatusL()
-/**
-	Tests that the unread flag of any messaged on the SIM is propagated
-	to the entries created in the class 2 folder
-
-	These should have the Unread() flag UNSET after the second enumeration.
- */
-	{
-	iSmsTest.Test().Next(_L("Test Unread Status\n"));
-
-	MsvEntry().SetEntryL(iSmsTest.iProgress.iEnumerateFolder);
-
-	delete iSelection;
-	iSelection = NULL;
-	iSelection = MsvEntry().ChildrenL();
-
-	TInt count = iSelection->Count();
-	TInt status = KErrNone;
-
-	while (count--)
-		{
-		MsvEntry().SetEntryL(iSelection->At(count));
-		if (MsvEntry().Entry().Unread())
-			{
-			status = KErrCorrupt;
-			break;
-			}
-		}
-
-	iSmsTest.Printf(_L("TestReadStatusL() completed with %d\n"), status);
-	User::LeaveIfError(status);
-	}
-
-void CSmsEnumTest::TestPhoneStoreStatusL(TMsvId aFolderId)
-/**
-	Tests that the messages in the specified folder have the storage
-	set to ESmsPhoneStorage and have no iSlotArray members.
- */
-	{
-	iSmsTest.Test().Next(_L("Test Phone Store Status\n"));
-
-	MsvEntry().SetEntryL(aFolderId);
-
-	delete iSelection;
-	iSelection = NULL;
-	iSelection = MsvEntry().ChildrenL();
-
-	TInt count = iSelection->Count();
-	TInt status = KErrNone;
-
-	while (count--)
-		{
-		MsvEntry().SetEntryL(iSelection->At(count));
-		CMsvStore* store = MsvEntry().ReadStoreL();
-		CleanupStack::PushL(store);
-		iHeader->RestoreL(*store);
-		CSmsMessage& smsmessage = iHeader->Message();
-
-		if ((smsmessage.iSlotArray.Count() > 0) ||
-		    (smsmessage.Storage() != CSmsMessage::ESmsPhoneStorage))
-			{
-			status = KErrCorrupt;
-			}
-
-		CleanupStack::PopAndDestroy(store);
-		}
-
-	iSmsTest.Printf(_L("TestPhoneStoreStatusL() completed with %d\n"), status);
-	User::LeaveIfError(status);
-	}
-
-void CSmsEnumTest::TestSimStoreStatusL(TMsvId aFolderId)
-/**
-	Tests that the messages in the specified folder have the storage
-	set to ESmsSimStorage and have at least 1 iSlotArray member.
- */
-	{
-	iSmsTest.Test().Next(_L("Test Sim Store Status\n"));
-
-	MsvEntry().SetEntryL(aFolderId);
-
-	delete iSelection;
-	iSelection = NULL;
-	iSelection = MsvEntry().ChildrenL();
-
-	TInt count = iSelection->Count();
-	TInt status = KErrNone;
-
-	while (count--)
-		{
-		MsvEntry().SetEntryL(iSelection->At(count));
-		CMsvStore* store = MsvEntry().ReadStoreL();
-		CleanupStack::PushL(store);
-		iHeader->RestoreL(*store);
-		CSmsMessage& smsmessage = iHeader->Message();
-
-		if ((smsmessage.iSlotArray.Count() < 1) ||
-		    (smsmessage.Storage() != CSmsMessage::ESmsSIMStorage))
-			{
-			status = KErrCorrupt;
-			}
-
-		CleanupStack::PopAndDestroy(store);
-		}
-
-	iSmsTest.Printf(_L("TestSimStoreStatusL() completed with %d\n"), status);
-	User::LeaveIfError(status);
-	}
--- a/messagingappbase/smsmtm/test/src/T_SmsRegress.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,405 +0,0 @@
-// Copyright (c) 2000-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 "T_SmsRegress.h"
-#include <smscmds.h>
-_LIT(KSmsScript, "sms.script");
-
-GLDEF_C TInt E32Main()
-	{	
-	__UHEAP_MARK;
-	test.Start(_L("Setup"));
-	theCleanup = CTrapCleanup::New();
-	TRAPD(ret,doMainL());		
-	test(ret==KErrNone);
-	delete theCleanup;	
-	test.Console()->SetPos(0, 13);
-	test.End();
-	test.Close();
-	__UHEAP_MARKEND;
-	return(KErrNone);
-	}
-
-LOCAL_C void doMainL()
-	{
-	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
-	CleanupStack::PushL(scheduler);
-	CActiveScheduler::Install(scheduler);
-
-	CSmsTestUtils* smsTest = CSmsTestUtils::NewL(test);
-	CleanupStack::PushL(smsTest);
-	TInt nextTest = 0;
-
-	smsTest->NotifySaPhoneOnL();
-	
-	CSmsRegressTest* SmcmTest = CSmsRegressTest::NewLC(*smsTest, KNullDesC, nextTest);
-
-	smsTest->WaitForInitializeL();
-
-	SmcmTest->StartL();
-
-	CleanupStack::PopAndDestroy(3); //SmcmTest. scheduler
-	}
-
-CSmsRegressTest::CSmsRegressTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest)
-: CSmsTestBase(aSmsTest, aScriptFile, aNextTest), iOperations(aSmsTest)
-	{
-	CActiveScheduler::Add(this);
-	}
-
-void CSmsRegressTest::RunAutoL()
-	{
-	iNextTest = 0;
-
-	iSmsTest.TestStart(++iNextTest, _L("Test2SMSSInstances"));  
-	Test2SMSSInstancesL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest);
-	}
-
-void CSmsRegressTest::Test2SMSSInstancesL()
-	{
-	TTime now;
-	now.HomeTime();
-
-	CMsvEntrySelection* sel = new (ELeave) CMsvEntrySelection;
-	CleanupStack::PushL(sel);
-
-	iSmsTest(iSmsTest.ReadScriptL(KSmsScript, KMsvGlobalOutBoxIndexEntryId, *sel, now));
-	iSmsTest.SetEntryL(KMsvGlobalOutBoxIndexEntryId);
-
-	CMsvOperationWait* wait = CMsvOperationWait::NewLC();
-	wait->Start();
-
-	CMsvOperation* op = iSmsTest.iMsvEntry->CopyL((*sel)[0], KMsvGlobalOutBoxIndexEntryId, wait->iStatus);
-	CleanupStack::PushL(op);
-	CActiveScheduler::Start();
-
-	TMsvLocalOperationProgress prog;
-	TPckgC<TMsvLocalOperationProgress> pkg(prog);
-	pkg.Set(op->ProgressL());
-	prog = pkg();
-	User::LeaveIfError(prog.iError);
-
-	const TMsvId sms1 = (*sel)[0];
-	const TMsvId sms2 = prog.iId;
-
-	CleanupStack::PopAndDestroy(2); //wait, op
-
-	_LIT(KDesc1, "Remote");
-	_LIT(KDesc2, "Local");
-
-	iSmsTest.SetEntryL(sms1);
-	TMsvEntry entry(iSmsTest.Entry());
-	entry.iDescription.Set(KDesc1);
-	iSmsTest.ChangeEntryL(entry);
-	
-	iSmsTest.SetEntryL(sms2);
-	entry = iSmsTest.Entry();
-	entry.iServiceId = KMsvLocalServiceIndexEntryId;
-	entry.iDescription.Set(KDesc2);
-	iSmsTest.ChangeEntryL(entry);
-
-	iSmsTest.Printf(_L("Test2SMSSInstancesL for 2 messages:\n"));
-	iSmsTest.DisplayMessageL(sms1);
-	iSmsTest.DisplayMessageL(sms2);
-
-	iOperations.ResetAndDestroy();
-
-	//Start first operation
-	COpActive* opActive = new (ELeave) COpActive(iOperations, sms1);
-	CleanupStack::PushL(opActive);
-	iSmsTest.SetEntryL(KMsvGlobalOutBoxIndexEntryId);
-	opActive->iOperation = iSmsTest.iMsvEntry->CopyL(opActive->Id(), iSmsTest.iSmsServiceId, opActive->Status());
-	iOperations.AppendL(opActive);
-	CleanupStack::Pop(opActive);
-	
-	//Start second operation
-	opActive = new (ELeave) COpActive(iOperations, sms2);
-	CleanupStack::PushL(opActive);
-	iSmsTest.SetEntryL(KMsvGlobalOutBoxIndexEntryId);
-	sel->Reset();
-	sel->AppendL(opActive->Id());
-	opActive->iOperation = iSmsTest.iMsvSession->TransferCommandL(*sel, ESmsMtmCommandScheduleCopy, KNullDesC8, opActive->Status());
-	iOperations.AppendL(opActive);
-	CleanupStack::Pop(opActive);
-
-	CleanupStack::PopAndDestroy(sel);
-
-	iState = ETest2SMSSInstances;
-	iOperations.Start(iStatus);
-	SetActive();
-	CActiveScheduler::Start();
-	}
-
-
-CSmsRegressTest::~CSmsRegressTest()
-	{
-	Cancel();
-	delete iWatchers;
-
-	iSocket.Close();
-	iSocketServ.Close();
-	}
-
-void CSmsRegressTest::ConstructL()
-	{
-	iSmsTest.SetLogToFile();
-	iTimer = CTestTimer::NewL();
-
-	User::LeaveIfError(iSocketServ.Connect());
-	TProtocolDesc protoinfo;
-	TProtocolName protocolname(KSmsDatagram);
-	User::LeaveIfError(iSocketServ.FindProtocol(protocolname,protoinfo));
-	User::LeaveIfError(iSocket.Open(iSocketServ,protoinfo.iAddrFamily,protoinfo.iSockType,protoinfo.iProtocol));
-	
-	TSmsAddr smsaddr;
-	smsaddr.SetSmsAddrFamily(ESmsAddrSendOnly);
-	User::LeaveIfError(iSocket.Bind(smsaddr));
-	}
-
-void CSmsRegressTest::DoCancel()
-	{
-	iOperations.Cancel();
-	iTimer->Cancel();
-	}
-
-void CSmsRegressTest::DoRunTest2SMSSInstancesL()
-	{
-	TInt count = iOperations.Count();
-	
-	while (count-- && !IsActive())
-		{
-		const COpActive& active = *iOperations[count];
-		iSmsTest.SetEntryL(active.Id());
-		const TMsvEntry& entry = iSmsTest.Entry();
-		switch (entry.SendingState())
-			{
-			case KMsvSendStateSent:
-			case KMsvSendStateFailed:
-				iSmsTest.Printf(_L("%d Complete [SendingState=%d]\n"), entry.Id(), entry.SendingState());
-				break; //do nothing
-			default:
-				iSmsTest.Printf(_L("%d Active [SendingState=%d]\n"), entry.Id(), entry.SendingState());
-				iTimer->AfterReq(2000000, iStatus);
-				SetActive();
-				break;
-			}
-		}
-	}
-
-void CSmsRegressTest::RunL()
-	{
-	User::LeaveIfError(iStatus.Int());
-
-	switch (iState)
-		{
-		case ETest2SMSSInstances:
-			DoRunTest2SMSSInstancesL();
-			break;
-		default:
-			iSmsTest(EFalse);
-			break;
-		}
-
-	if (!IsActive())
-		CActiveScheduler::Stop();
-	}
-
-TInt CSmsRegressTest::RunError(TInt aError)
-	{
-	iSmsTest.Printf(_L("CSmsRegressTest::RunError [iStatus=%d aError, iState=%d]\n"), iStatus.Int(), aError, iState);
-
-	if (iStatus.Int() == KErrNone)
-		iStatus = aError;
-
-	CActiveScheduler::Stop();
-	return KErrNone;
-	}
-
-CSmsRegressTest* CSmsRegressTest::NewLC(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest)
-	{
-	CSmsRegressTest* self = new (ELeave) CSmsRegressTest(aSmsTest, aScriptFile, aNextTest);
-	CleanupStack::PushL(self);
-
-	self->ConstructL();
-
-	return self;
-	}
-
-void CSmsRegressTest::ShowMenuL()
-	{
-	iSmsTest.ResetMenu();
-
-	iSmsTest.AppendToMenuL(_L("Start"));
-
-	TInt result = iSmsTest.DisplayMenu(_L("SMS Client MTM Test"));
-
-	if (result <= 0)
-		return;
-
-	switch (result)
-		{
-		case 1:
-			RunAutoL();
-			break;
-		default:
-			User::Leave(KErrArgument);
-			break;
-		}
-
-	if (!iSmsTest.RunAuto())
-		{
-		iSmsTest.Printf(_L("Press any key to continue...\n"));
-		iSmsTest.Test().Getch();
-		}
-
-	ShowMenuL();
-	}
-
-/*
-TBool CSmsRegressTest::CompareSettings(const CSmsSettings& aLeft, const CSmsSettings& aRight, TBool aTestSC)
-	{
-	TCompare compare(CompareMessageSettings(aLeft, aRight));
-
-	compare(aLeft.CommDbAction() == aRight.CommDbAction());
-	compare(aLeft.SmsBearerAction() == aRight.SmsBearerAction());
-	compare(aLeft.SmsBearer() == aRight.SmsBearer());
-	compare(aLeft.Delivery() == aRight.Delivery());
-	compare(CompareBools(aLeft.ReplyQuoted(), aRight.ReplyQuoted()));
-	compare(aLeft.SpecialMessageHandling() == aRight.SpecialMessageHandling());
-	compare(aLeft.StatusReportHandling() == aRight.StatusReportHandling());
-
-	if (aTestSC)
-		{
-		compare(aLeft.DefaultSC() == aRight.DefaultSC());
-		compare(aLeft.NumSCAddresses() == aRight.NumSCAddresses());
-
-		TInt count = aLeft.NumSCAddresses();
-
-		while (count--)
-			{
-			compare(CompareNumbers(aLeft.SCAddress(count), aRight.SCAddress(count)));
-			}
-		}
-
-	return compare;
-	}
-
-TBool CSmsRegressTest::CompareMessageSettings(const CSmsMessageSettings& aLeft, const CSmsMessageSettings& aRight)
-	{
-	TCompare compare(CompareBools(aLeft.CanConcatenate(), aRight.CanConcatenate()));
-	compare(aLeft.CharacterSet() == aRight.CharacterSet());
-	compare(CompareBools(aLeft.DeliveryReport(), aRight.DeliveryReport()));
-	compare(aLeft.MessageConversion() == aRight.MessageConversion());
-	compare(CompareBools(aLeft.RejectDuplicate(), aRight.RejectDuplicate()));
-	compare(CompareBools(aLeft.ReplyPath(), aRight.ReplyPath()));
-	compare(aLeft.ValidityPeriod() == aRight.ValidityPeriod());
-	compare(aLeft.ValidityPeriodFormat() == aRight.ValidityPeriodFormat());
-	return compare;
-	}
-
-TBool CSmsRegressTest::CompareNumbers(const CSmsNumber& aLeft, const CSmsNumber& aRight)
-	{
-	TCompare compare(aLeft.Name() == aRight.Name());
-	compare(aLeft.Address() == aRight.Address());
-	compare(aLeft.LogId() == aRight.LogId());
-	return compare;
-	}
-*/
-COpActive::COpActive(COpActiveArray& aParent, TMsvId aId, TInt aPriority)
-: CActive(aPriority), iParent(aParent), iSmsTest(aParent.iSmsTest), iId(aId)
-	{
-	CActiveScheduler::Add(this);
-	}
-
-COpActive::~COpActive()
-	{
-	Cancel();
-	delete iOperation;
-	}
-
-void COpActive::RunL()
-	{
-	iSmsTest.Printf(_L("COpActive::RunL [iStatus=%d]\n"), iStatus.Int());
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.SetProgressL(*iOperation);
-	iSmsTest.Printf(_L("COpActive::RunL [Progress.iError=%d]\n"), iSmsTest.iProgress.iError);
-	User::LeaveIfError(iSmsTest.iProgress.iError);
-	Complete(KErrNone);
-	}
-
-void COpActive::DoCancel()
-	{
-	iOperation->Cancel();
-	Complete(KErrCancel);
-	}
-
-TInt COpActive::RunError(TInt aError)
-	{
-	Complete(aError);
-	return KErrNone;
-	}
-
-void COpActive::Complete(TInt aError)
-	{
-	iParent.ActiveComplete(*this, aError);
-	}
-
-COpActiveArray::COpActiveArray(CSmsTestUtils& aSmsTest)
-: CArrayPtrFlat<COpActive>(1), iSmsTest(aSmsTest)
-	{
-	}
-
-COpActiveArray::~COpActiveArray()
-	{
-	Cancel();
-	ResetAndDestroy();
-	}
-
-void COpActiveArray::Cancel()
-	{
-	TInt count = Count();
-
-	while (count--)
-		At(count)->Cancel();
-	}
-
-void COpActiveArray::Start(TRequestStatus& aStatus)
-	{
-	aStatus = KRequestPending;
-	iReport = &aStatus;
-	}
-
-void COpActiveArray::ActiveComplete(const CActive& aActive, TInt aError)
-	{
-	iSmsTest.Printf(_L("COpActiveArray::ActiveComplete [Id=aActive.Id() aError=%d]\n"), &aActive, aError);
-	
-	if (iReport != NULL)
-		{
-		if (aError != KErrNone)
-			User::RequestComplete(iReport, aError);
-		else
-			{
-			TInt count = Count();
-			TBool active = EFalse;
-			while (!active && count--)
-				active = active || At(count)->IsActive();
-
-			if (!active)
-				User::RequestComplete(iReport, KErrNone);
-			}
-		}
-	}
--- a/messagingappbase/smsmtm/test/src/T_SmsSc.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1085 +0,0 @@
-// Copyright (c) 1999-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 "T_SmsSc.h"
-#include <smutsimparam.h>
-#include <smsclnt.h>
-#include <smsuaddr.h>
-
-#include <testconfigfileparser.h>
-#include <e32std.h>
-
-// Autotest library header file
-#include <autotest.h>
-
-#include <simtsy.h>
-
-// Global pointer for use by the autogTest.h macro's
-CAutoTest* gAutoTest;
-
-
-RTest gTest(_L("T_SmsSc Testrig"));
-CTrapCleanup* theCleanup;
-
-
-#define LOCAL_CHECKPOINT_CODE(a,b) a.TestCheckPointCodeL((b), (__FILE__), (__LINE__))
-#define LOCAL_CHECKPOINT(a,b) a.TestCheckPointL((b), (__FILE__), (__LINE__))
-#define LOCAL_CHECKPOINT_COMPARE(a,b,c,d) a.TestCheckPointCompareL((b),(c),(d),(__FILE__),(__LINE__))
-
-_LIT(KTestScriptFile, "SimParameter.script");
-_LIT(KTestScriptComponent, "sms");
-
-_LIT8(KListSectionStart, "list");
-_LIT8(KSmsParamEntry, "SmsParamEntry");
-_LIT8(KSmsParamMaxEntries, "SmsParamMaxEntries");
-
-const TInt KSmsParamEntryDel = ',';
-
-enum TSmsParamEntry
-/**	@enum	TSmsParamEntry
- *	Enum defining the SMS parameters
- */
-	{
-	ESmsParamIndex,
-	ESmsParamName,
-	ESmsParamPID,
-	ESmsParamDCS,
-	ESmsParamVP,
-	ESmsParamDA,
-	ESmsParamSCA
-	};
-
-/*
-void SetTestNumberL(TInt aTestNumber)
-  	{
-  	gTest.Printf(_L("Changing the Test Number to %d\n"), aTestNumber);
-	RSAVarChangeNotify notify;
-	GLOBAL_CHECKPOINT_COMPARE(notify.Connect(), KErrNone, _L("Failed to connect to System Agent Notifier"));
-	CleanupClosePushL(notify);
-  	TRAPD(ret, notify.NotifySaVarChangeL(KUidSASimTsyTestNumber,aTestNumber));
-	GLOBAL_CHECKPOINT_COMPARE(ret, KErrNone, _L("Failed to set test number"));
-	CleanupStack::PopAndDestroy(&notify);
-  	}
-*/
-CSmsScTest* NewScTestLCC(TInt aTestNumber)
-/**
-	Constructs and returns CSmsScTest object. 
-	Notifies the system agent that the phone is on.
-
-	@return		CSmsScTest*		A pointer to SmsSc test.  
- */
-	{
-	CSmsTestUtils* testUtils = CSmsTestUtils::NewL(gTest);
-	CleanupStack::PushL(testUtils);
-
-	testUtils->SetSimTsyTestNumberL(aTestNumber);
-
-	TInt nextTest = 0;
-
-	testUtils->NotifySaPhoneOnL();
-	testUtils->WaitForInitializeL();
-	return CSmsScTest::NewLC(*gAutoTest, *testUtils, KNullDesC, nextTest);
-	}
-
-RMobileSmsMessaging::TMobileSmspEntryV1 CreateEntry()
-/**
-	Creates and returns an entry. 
-
-	@return		TMobileSmspEntryV1		A SIM parameter entry. 
- */
-	{
-	RMobileSmsMessaging::TMobileSmspEntryV1 entry;
-	
-	_LIT(KSmsServiceCenterNumber, "+44778501000000");
-	entry.iServiceCentre.iTelNumber = KSmsServiceCenterNumber();
-
-//	_LIT(KSmsNumber, "123456");
-//	entry.iDestination.iTelNumber = KSmsNumber();
-
-	_LIT(KSmsText, "Vodafone");
-	entry.iText = KSmsText();
-
-	entry.iValidParams = RMobileSmsMessaging::KSCAIncluded;
-
-//	TUint8 reservedFiller = 'a';
-//	entry.iReservedFiller = reservedFiller;
-
-//	TUint8 validityPeriod = 'b';
-//	entry.iValidityPeriod = validityPeriod;
-
-//	TUint8 dcs = 'c';
-//	entry.iDcs = dcs;
-
-//	TUint8 protocolID = 'd';
-//	entry.iProtocolId = protocolID;
-
-	return entry;
-	}
-
-CMobilePhoneSmspList* NewListLC(const RMobileSmsMessaging::TMobileSmspEntryV1& aEntry, TInt aCount)
-/**
-	Return a new list with aCount entries of aEntry
-
-	@param		aEntry						A SIM parameter entry.
-	@param		aCount						An integer.
-	@return		CMobilePhoneSmspList*		A list containing the SIM Parameters.
- */
-	{
-	CMobilePhoneSmspList* list = CMobilePhoneSmspList::NewL();
-	CleanupStack::PushL(list);
-	RMobileSmsMessaging::TMobileSmspEntryV1 entry(aEntry);
-
-	for (TInt i = 0; i < aCount; ++i)
-		{
-		entry.iIndex = i;
-		list->AddEntryL(entry);
-		}
-
-	return list;
-	}
-
-void DoTest1L(CSmsScTest& aTest)
-/**
-	Reads and stores the initial SIM parameters
-
-	@param		aTest		A reference to the SmsSc test
- */
-	{
-	CMsvOperationWait* waiter = CMsvOperationWait::NewLC();
-	
-	aTest.ReadInitialParamsL(waiter->iStatus);
-	waiter->Start();
-	CActiveScheduler::Start();
-	GLOBAL_CHECKPOINT_COMPARE(waiter->iStatus.Int(), KErrNone, _L("ReadInitialParamsL completed with error"));
-
-	CleanupStack::PopAndDestroy(waiter);
-	}
-
-void Test1L()
-/**
-	Tests Reading SMS parameters from SIM
- */
-	{
-	CSmsScTest* scTest = NewScTestLCC(0);
-
-	DoTest1L(*scTest);
-
-	CleanupStack::PopAndDestroy(scTest);
-	CleanupStack::PopAndDestroy();
-	}
-
-void Test2L()
-/**
-	Tests Reading error
- */
-	{
-	// todo Request the tester on screen to remove the phone from serial/IR link
-
-	CSmsScTest* scTest = NewScTestLCC(0);
-	CMsvOperationWait* waiter = CMsvOperationWait::NewLC();
-	
-	scTest->ReadInitialParamsL(waiter->iStatus);
-	waiter->Start();
-	CActiveScheduler::Start();
-	//GLOBAL_CHECKPOINT(waiter->iStatus != KErrNone);
-	//GLOBAL_CHECKPOINT_COMPARE(waiter->iStatus != KErrNone, ETrue, _L("ReadInitialParamsL completed with error"));
-
-	CleanupStack::PopAndDestroy(3); //waiter, scTest*2
-	}
-
-void DoTest3L(CSmsScTest& aTest, CMsvOperationWait& aWaiter, TInt aMaxNumber)
-/**
-	Performs round trip tests
-
-	@param		aTest		A reference to SmsSc test
-	@param		aWaiter		A reference to MsvOperationWait
- */
-	{
-	//const TInt maxNumber = aTest.OriginalOperation().SmspList().MaxNumberEntries();
-	const RMobileSmsMessaging::TMobileSmspEntryV1 entry(CreateEntry());
-	
-	for (TInt i = 1; i <= aMaxNumber; ++i)
-		{
-		CMobilePhoneSmspList* list = NewListLC(entry, i);
-		list->SetMaxNumberEntries(aMaxNumber);
-		aTest.RoundTripTestL(*list, aWaiter.iStatus);
-		aWaiter.Start();
-		CActiveScheduler::Start();
-		CleanupStack::PopAndDestroy(list);
-		User::LeaveIfError(aWaiter.iStatus.Int());
-		}
-	}
-
-void Test3L()
-/**
-	Tests Reading and Writing parameters (Round Trip Test)
- */
-	{	
-	CSmsScTest* scTest = NewScTestLCC(1);
-	CMsvOperationWait* waiter = CMsvOperationWait::NewLC();
-	scTest->ReadInitialParamsL(waiter->iStatus);
-	waiter->Start();
-	CActiveScheduler::Start();
-	GLOBAL_CHECKPOINT_COMPARE(waiter->iStatus.Int(), KErrNone, _L("ReadInitialParamsL completed with error"));
-	
-	const TInt maxNumber = scTest->OriginalOperation().SmspList().MaxNumberEntries();
-	TRAPD(err, DoTest3L(*scTest, *waiter, maxNumber));
-
-	scTest->WriteOriginalParamsL(waiter->iStatus);
-	waiter->Start();
-	CActiveScheduler::Start();
-	GLOBAL_CHECKPOINT_COMPARE(waiter->iStatus.Int(), KErrNone, _L("WriteOriginalParamsL completed with error"));
-	User::LeaveIfError(err);
-
-	CleanupStack::PopAndDestroy(3); //scTest*2, waiter
-	}
-
-void DoTest4L(CSmsScTest& aTest, CMsvOperationWait& aWaiter, TInt aMaxNumber)
-	{
-	const RMobileSmsMessaging::TMobileSmspEntryV1 entry(CreateEntry());
-
-	CMobilePhoneSmspList* list = NewListLC(entry, aMaxNumber);
-	list->SetMaxNumberEntries(aMaxNumber);
-	aTest.RoundTripTestL(*list, aWaiter.iStatus);
-	aWaiter.Start();
-	CActiveScheduler::Start();
-	CleanupStack::PopAndDestroy(list);
-	GLOBAL_CHECKPOINT(aWaiter.iStatus != KErrNone);
-	}
-
-void Test4L()
-/**
-	Tests Writing error
- */
-	{
-	CSmsScTest* scTest = NewScTestLCC(0);
-	CMsvOperationWait* waiter = CMsvOperationWait::NewLC();
-	
-	scTest->ReadInitialParamsL(waiter->iStatus);
-	waiter->Start();
-	CActiveScheduler::Start();
-	GLOBAL_CHECKPOINT_COMPARE(waiter->iStatus.Int(), KErrNone, _L("ReadInitialParamsL completed with error"));
-
-	// Write too many parameters
-	const TInt maxNumber = scTest->OriginalOperation().SmspList().MaxNumberEntries() + 1;
-
-	TRAPD(err, DoTest4L(*scTest, *waiter, maxNumber));
-
-	scTest->WriteOriginalParamsL(waiter->iStatus);
-	waiter->Start();
-	CActiveScheduler::Start();
-	GLOBAL_CHECKPOINT_COMPARE(waiter->iStatus.Int(), KErrNone, _L("WriteOriginalParamsL completed with error"));
-	User::LeaveIfError(err);
-
-	CleanupStack::PopAndDestroy(3); //waiter, scTest*2
-	}
-
-TInt CountListsInScriptL(RFs& aFs, const TDesC& aComponent, const TDesC& aScriptFile)
-/**
-	Returns the number of lists in the script file. 
-
-	@param		aFs							Handle to file server session 
-	@param		aComponent					A descriptor
-	@param		aScriptFile					Script file
-	@return		TInt						Number of lists in the script file
- */
-	{
-	CTestConfig* file = CTestConfig::NewLC(aFs, aComponent, aScriptFile);
-
-	TInt count = 0;
-
-	FOREVER
-		{
-		TBuf8<32> sectionName(KListSectionStart);
-		sectionName.AppendNum(count+1);
-		const CTestConfigSection* section = file->Section(sectionName);
-
-		if (section != NULL)
-			count++;
-		else
-			break;
-		}
-
-	CleanupStack::PopAndDestroy(file);
-	return count;
-	}
-	
-
-CMobilePhoneSmspList* ReadFromScriptLC(RFs& aFs, const TDesC& aComponent, const TDesC& aScriptFile, TInt aListNumber, TInt aDefaultMaxNumber)
-/**
-	Reads and returns a list of parameters from the script file. 
-
-	@param		aFs							Handle to file server session 
-	@param		aComponent					A descriptor
-	@param		aScriptFile					Script file
-	@param		aListNumber					The list number in the script file 
-	@param		aDefaultMaxNumber			Maximum number of entries supported by the SIM 
-	@return		CMobilePhoneSmspList*		A list containing the parameters
- */
-	{
-	gTest.Printf(_L("ReadFromScriptLC [aComponent=%S aScript=%S aListNumber=%d"), &aComponent, &aScriptFile, aListNumber);
-
-	CMobilePhoneSmspList* list = CMobilePhoneSmspList::NewL();
-	CleanupStack::PushL(list);
-
-	CTestConfig* file = CTestConfig::NewLC(aFs, aComponent, aScriptFile);
-
-	TBuf8<32> sectionName(KListSectionStart);
-	sectionName.AppendNum(aListNumber);
-
-	const CTestConfigSection* section = file->Section(sectionName);
-
-	if (section == NULL)
-		{
-		gTest.Printf(_L("\tSection %d Not Found"), aListNumber);
-		User::Leave(KErrNotFound);
-		}
-
-	const CTestConfigItem* item = section->Item(KSmsParamMaxEntries);
-
-	TInt maxNumber = aDefaultMaxNumber;
-
-	if (item == NULL)
-		{
-		gTest.Printf(_L("\tFailed to find KSmsParamMaxEntries in script section. Setting to %d\n"), aDefaultMaxNumber);
-		}
-	else
-		{
-		maxNumber = section->ItemValue(KSmsParamMaxEntries, aDefaultMaxNumber);
-		}
-
-	if (maxNumber > aDefaultMaxNumber)
-		maxNumber = aDefaultMaxNumber;
-
-	list->SetMaxNumberEntries(maxNumber);
-
-	const TInt count = section->ItemCount(KSmsParamEntry);
-
-	if (count == 0)
-		{
-		gTest.Printf(_L("\tFailed to find KSmsParamEntry in script section\n"));
-		User::Leave(KErrNotFound);
-		}
-	
-	for (TInt i = 0; i < count && i < aDefaultMaxNumber; ++i)
-		{
-		item = section->Item(KSmsParamEntry, i);
-		__ASSERT_ALWAYS(item != NULL, User::Invariant());
-
-		const TDesC8& value = item->Value();
-
-		RMobileSmsMessaging::TMobileSmspEntryV1 entry = RMobileSmsMessaging::TMobileSmspEntryV1();
-		TPtrC8 ptrOutput(KNullDesC8);
-		TInt intOutput;
-	
-		if (CTestConfig::GetElement(value, KSmsParamEntryDel, ESmsParamIndex, intOutput) == KErrNone)
-			entry.iIndex = intOutput;
-		else
-			entry.iIndex = i;
-
-		if (CTestConfig::GetElement(value, KSmsParamEntryDel, ESmsParamName, ptrOutput) == KErrNone)
-			{
-			entry.iText.Copy(ptrOutput);
-			}
-
-		if (CTestConfig::GetElement(value, KSmsParamEntryDel, ESmsParamPID, intOutput) == KErrNone)
-			{
-			entry.iProtocolId = (TUint8)intOutput;
-			entry.iValidParams |= RMobileSmsMessaging::KProtocolIdIncluded;
-			}
-
-		if (CTestConfig::GetElement(value, KSmsParamEntryDel, ESmsParamDCS, intOutput) == KErrNone)
-			{
-			entry.iDcs = (TUint8)intOutput;
-			entry.iValidParams |= RMobileSmsMessaging::KDcsIncluded;
-			}
-
-		if (CTestConfig::GetElement(value, KSmsParamEntryDel, ESmsParamVP, intOutput) == KErrNone)
-			{
-			entry.iValidityPeriod = (TUint8)intOutput;
-			entry.iValidParams |= RMobileSmsMessaging::KValidityPeriodIncluded;
-			}
-
-		if (CTestConfig::GetElement(value, KSmsParamEntryDel, ESmsParamDA, ptrOutput) == KErrNone)
-			{
-			entry.iDestination.iTelNumber.Copy(ptrOutput);
-			entry.iValidParams |= RMobileSmsMessaging::KDestinationIncluded;
-			}
-
-		if (CTestConfig::GetElement(value, KSmsParamEntryDel, ESmsParamSCA, ptrOutput) == KErrNone)
-			{
-			entry.iServiceCentre.iTelNumber.Copy(ptrOutput);
-			entry.iValidParams |= RMobileSmsMessaging::KSCAIncluded;
-			}
-
-		list->AddEntryL(entry);
-		}
-	
-	CleanupStack::PopAndDestroy(file);
-
-	return list;
-	}
-
-void Test5L()
-/**
-	Data test (Round Trip Test using script)
- */
-	{
-	CSmsScTest* scTest = NewScTestLCC(0);
-	CMsvOperationWait* waiter = CMsvOperationWait::NewLC();
-
-	scTest->ReadInitialParamsL(waiter->iStatus);
-	waiter->Start();
-	CActiveScheduler::Start();
-	GLOBAL_CHECKPOINT_COMPARE(waiter->iStatus.Int(), KErrNone, _L("ReadInitialParamsL completed with error"));
-
-	RFs fs;
-	User::LeaveIfError(fs.Connect());
-	CleanupClosePushL(fs);
-
-	const TInt maxNumber = scTest->OriginalOperation().SmspList().MaxNumberEntries();
-	const TInt count = CountListsInScriptL(fs, KTestScriptComponent, KTestScriptFile);
-
-	TBool roundTripTests = ETrue;
-	for (TInt i = 1; i <= count; ++i)
-		{
-		CMobilePhoneSmspList* list = ReadFromScriptLC(fs, KTestScriptComponent, KTestScriptFile, i, maxNumber);
-
-		GLOBAL_CHECKPOINT(list->MaxNumberEntries() <= maxNumber);
-
-		scTest->RoundTripTestL(*list, waiter->iStatus);
-		waiter->Start();
-		CActiveScheduler::Start();
-
-		if(waiter->iStatus != KErrNone)
-			{
-			roundTripTests = EFalse;
-			break;
-			}
-
-		CleanupStack::PopAndDestroy(list);
-		}
-
-	scTest->WriteOriginalParamsL(waiter->iStatus);
-	waiter->Start();
-	CActiveScheduler::Start();
-	GLOBAL_CHECKPOINT_COMPARE(waiter->iStatus.Int(), KErrNone, _L("WriteOriginalParamsL completed with error"));
-
-	//GLOBAL_CHECKPOINT(roundTripTests);
-	GLOBAL_CHECKPOINT_COMPARE(roundTripTests, ETrue, _L("RoundTripTestL failled"));
-
-	CleanupStack::PopAndDestroy(4); //waiter, scTest*2, fs
-	}
-
-void Test6L()
-/**
-	OOM Test of CSmsClientMtm::ReadSimParamsL
- */
-	{
-	CSmsScTest* scTest = NewScTestLCC(0);
-
-	TInt failCount = 0;
-	TInt error = KErrNone;
-	_LIT(KFailCountDesc, "DoTest1L still failing, count = %d\n");
-
-	do
-		{
-		__UHEAP_FAILNEXT(failCount++);
-
-		TRAP(error, DoTest1L(*scTest));
-
-		__UHEAP_RESET;
-
-		if (error != KErrNone)
-			{
-			if (error != KErrNoMemory)
-				gTest.Printf(KFailCountDesc, failCount);
-
-			GLOBAL_CHECKPOINT_COMPARE(error, KErrNoMemory, _L("Error not KErrNoMemory"));
-
-			if (failCount % 100 == 0)
-				gTest.Printf(KFailCountDesc, failCount);
-			}
-		}
-	while (error != KErrNone);
-	
-	gTest.Printf(KFailCountDesc, failCount);
-
-	CleanupStack::PopAndDestroy(2); //scTest*2
-	}
-
-void Test7L()
-/**
-	OOM Test of CSmsClientMtm::WriteSimParamsL
- */
-	{
-	CSmsScTest* scTest = NewScTestLCC(1);
-	CMsvOperationWait* waiter = CMsvOperationWait::NewLC();
-	scTest->ReadInitialParamsL(waiter->iStatus);
-	waiter->Start();
-	CActiveScheduler::Start();
-	GLOBAL_CHECKPOINT_COMPARE(waiter->iStatus.Int(), KErrNone, _L("ReadInitialParamsL completed with error"));
-
-	TInt failCount = 0;
-	TInt error = KErrNone;
-
-	do
-		{
-		__UHEAP_FAILNEXT(failCount++);
-
-		const TInt maxNumber = 1;
-		TRAP(error, DoTest3L(*scTest, *waiter, maxNumber));
-
-		__UHEAP_RESET;
-
-		if (error != KErrNone)
-			{
-			gTest.Printf(_L("DoTest3L still failing, count = %d\n"), failCount);
-			GLOBAL_CHECKPOINT_COMPARE(error, KErrNoMemory, _L("Error not KErrNoMemory"));
-			}
-		}
-	while (error != KErrNone);
-	
-	gTest.Printf(_L("DoTest3L Fail Count %d\n"), failCount);
-
-	scTest->WriteOriginalParamsL(waiter->iStatus);
-	waiter->Start();
-	CActiveScheduler::Start();
-	GLOBAL_CHECKPOINT_COMPARE(waiter->iStatus.Int(), KErrNone, _L("WriteOriginalParamsL completed with error"));
-
-	CleanupStack::PopAndDestroy(3); //scTest*2, waiter
-	}
-
-LOCAL_C const TAutoTestCase SmsScTestCases[] =
-/**
-	Sets up an array of test functions
- */
-	{
-	{Test1L,_S("GT83-T_MESSS-001 Test Reading")},
-	//{Test2L,_S("GT83-T_MESSS-002 Test Reading Error")},
-	{Test3L,_S("GT83-T_MESSS-003 Test Reading and Writing (Round Trip Test)")},
-	{Test4L,_S("GT83-T_MESSS-004 Test Writing Error")},
-	{Test5L,_S("GT83-T_MESSS-005 Data test (Round Trip Test using script)")},
-	{Test6L,_S("GT83-T_MESSS-006 OOM test of CSmsClientMtm::ReadSimParamsL")},
-	{Test7L,_S("GT83-T_MESSS-007 OOM test of CSmsClientMtm::WriteSimParamsL")}
-	};
-
-LOCAL_C void doMainL()
-/**
-	Constructs sctive scheduler and starts off the tests
- */
-	{
-	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
-	CleanupStack::PushL(scheduler);
-	CActiveScheduler::Install( scheduler );
-
-	// Copying the config file to the root directory
-
-	RFs fs;
-	User::LeaveIfError(fs.Connect());
-	CleanupClosePushL(fs);
-	_LIT(KFileName2,"\\sms\\smssc_config.txt");
-	
-	CSmsTestUtils::CopyToSimTsyConfigFileL(fs, KFileName2);
-
-	CleanupStack::PopAndDestroy(&fs);
-
-	// Open the socket server
-
-	RSocketServ serv;
-	RSocket socket;
-
-	User::LeaveIfError(serv.Connect());
-	CleanupClosePushL(serv);
-	
-	TProtocolDesc protoinfo;
-	TProtocolName protocolname(KSmsDatagram);
-	User::LeaveIfError(serv.FindProtocol(protocolname,protoinfo));
-	User::LeaveIfError(socket.Open(serv,protoinfo.iAddrFamily,protoinfo.iSockType,protoinfo.iProtocol));
-
-	TSmsAddr smsaddr;
-	smsaddr.SetSmsAddrFamily(ESmsAddrSendOnly);
-	User::LeaveIfError(socket.Bind(smsaddr));
-
-	CleanupClosePushL(socket);
-
-	_LIT(KTestOutput,"smssc_testreport.txt");
-	_LIT8(KComponentInfo,"smcm and smss");
-	// Library defined macro
-	// Uses a global pointer instance of CAutoTest
-	GLOBAL_AUTOTEST_EXECUTE(SmsScTestCases, KTestOutput, KComponentInfo, gTest);
-
-	CleanupStack::PopAndDestroy(&socket);
-	CleanupStack::PopAndDestroy(&serv);
-	CleanupStack::PopAndDestroy(scheduler);
-	}
-
-GLDEF_C TInt E32Main()
-/**
-	Calls doMainL and checks for error
- */
-	{
-	__UHEAP_MARK;
-
-	gTest.Start(_L("Setup"));
-	theCleanup = CTrapCleanup::New();
-
-
-	TRAPD(ret,doMainL());
-
-	if (ret != KErrNone)
-		gTest.Printf(_L("Test completed with %d"), ret);
-
-	delete theCleanup;	
-	gTest.Console()->SetPos(0, 13);
-	gTest.End();
-	gTest.Close();
-	__UHEAP_MARKEND;
-	return(KErrNone);
-	}
-
-CSmsScTest::~CSmsScTest()
-/**
-	destructor
- */
-	{
-	Cancel();
-	delete iOriginalParams;
-	}
-
-void CSmsScTest::ReadInitialParamsL(TRequestStatus& aStatus)
-/**
-	Starts off the read async operation.
-
-	@param		aStatus		A request status.
- */
-	{
-	iState = EStateReadInitialParams;
-
-	delete iOperation;
-	iOperation = NULL;
-
-	iOperation = Client().ReadSimParamsL(iStatus);
-	SetActive();
-	Queue(aStatus);
-	}
-
-void CSmsScTest::RoundTripTestL(const CMobilePhoneSmspList& aListToWrite, TRequestStatus& aStatus)
-/**
-	Starts off the round trip test.
-
-	@param		aListToWrite	A list to write to the SIM.
-	@param		aStatus			Indicates the status of the operations.
- */
-	{
-	iListToWrite = &aListToWrite;
-
-//	iSmsTest.Test().Printf(_L("Starting Round Trip Test\n"));
-
-	WriteSimParamsL();
-	Queue(aStatus);
-	}
-
-void CSmsScTest::WriteSimParamsL()
-/**
-	Starts off the write async operation.
-
-	@param		aList		A list to write to the SIM.
- */
-	{
-	iState = EStateWriteSimParams;
-
-//	PrintList(iSmsTest.Test(), *iListToWrite);
-
-	delete iOperation;
-	iOperation = NULL;
-
-	iOperation = Client().WriteSimParamsL(*iListToWrite, iStatus);
-	SetActive();
-	}
-
-void CSmsScTest::ReadAfterWriteL()
-/**
-	Reading after writing to the SIM
- */
-	{
-	iSmsTest.Test().Printf(_L("Reading after writing\n"));
-	iState = EStateReadAfterWrite;
-
-	delete iOperation;
-	iOperation = NULL;
-
-	iOperation = Client().ReadSimParamsL(iStatus);
-	SetActive();
-	}
-
-void CSmsScTest::WriteOriginalParamsL(TRequestStatus& aStatus)
-/**
-	Writes the default parameters back to the SIM
-
-	@param		aStatus		Indicates the status of the write operation.
- */
-	{
-	Queue(aStatus);
-
-	iSmsTest.Test().Printf(_L("Writing original parameters back to Sim"));
-	iState = EStateWriteOriginalParams;
-
-	delete iOperation;
-	iOperation = NULL;
-
-	iOperation = Client().WriteSimParamsL(iOriginalParams->SmspList(), iStatus);
-	SetActive();
-	}
-
-CSmsScTest* CSmsScTest::NewLC(CAutoTest& aAutoTest, CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest)
-	{
-	CSmsScTest* self = new (ELeave) CSmsScTest(aAutoTest, aSmsTest, aScriptFile, aNextTest);
-	CleanupStack::PushL(self);
-
-	self->ConstructL();
-	return self;
-	}
-
-CSmsScTest::CSmsScTest(CAutoTest& aAutoTest, CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest)
-: CSmsTestBase(aSmsTest, aScriptFile, aNextTest), iState(EStateWaiting), iAutoTest(aAutoTest)
-	{
-	CActiveScheduler::Add(this);
-	}
-
-void CSmsScTest::RunAutoL()
-/**
-	Required by CSmsTestBase.
- */
-	{
-
-	}
-
-void CSmsScTest::ConstructL()
-	{
-	SetTestNameL(KSmsScTestName);
-	iSmsTest.InstantiateClientMtmsL();
-
-	iSmsTest.SetLogToFile();
-	}
-
-void CSmsScTest::ShowMenuL()
-/**
-	Required by CSmsTestBase.
- */
-	{
-	}
-
-void CSmsScTest::RunL()
-/**
-	Handles completed async operations
- */
-	{
-	iSmsTest.Test().Printf(_L("CSmsScTest::RunL [State=%d Status=%d]\n"), iState, iStatus.Int());
-
-	switch (iState)
-		{
-		case EStateReadInitialParams:
-			{
-			DoRunReadInitialParamsL();
-			break;
-			}
-		case EStateWriteSimParams:
-			{
-			DoRunWriteSimParamsL();
-			break;
-			}
-		case EStateReadAfterWrite:
-			{
-			DoRunReadAfterWriteL();
-			break;
-			}
-		case EStateWriteOriginalParams:
-			{
-			DoRunWriteOriginalParamsL();
-			break;
-			}
-		default:
-			{
-			break;
-			}
-		}
-
-	if (!IsActive())
-		Complete(iStatus.Int());
-	}
-
-void CSmsScTest::Complete(TInt aError)
-/**
-	Indicates that the operation is complete with aError.
-
-	@param		aError		error returned by the operation
- */
-	{
-	iSmsTest.Test().Printf(_L("CSmsScTest::Complete [aError=%d]\n"), aError);
-
-	if (iReport != NULL)
-		User::RequestComplete(iReport, aError);
-	}
-
-TInt CSmsScTest::RunError(TInt aError)
-/**
-
-	@param		aError		error returned by the operation
-	@return		TInt		Returns the KErrNone. 
- */
-	{
-	Complete(aError);
-	return KErrNone;
-	}
-
-void CSmsScTest::Queue(TRequestStatus& aStatus)
-/**
-
-	@param		aStatus		Indicates the status of the operation.
- */
-	{
-	__ASSERT_DEBUG(iReport==NULL, User::Invariant());
-
-	aStatus=KRequestPending;
-	iReport=&aStatus;
-	}
-
-void CSmsScTest::PrintListL(RTest& aTest, const CMobilePhoneSmspList& aList)
-/**
-	Prints aList 
-
-	@param		aTest		
-	@param		aList		A list of SIM parameters	
- */
-	{
-	//Print MaxNumber
-	aTest.Printf(_L("========= CMobilePhoneSmspList ========= \n"));
-
-	aTest.Printf(_L("MaxNumber=%d\n"), aList.MaxNumberEntries());
-
-	//Pirnt Num Entries
-	TInt count = aList.Enumerate();
-	aTest.Printf(_L("Number of entries: %d\n"), count);
-
-	//Print each entry in aList
-	for(TInt i = 0; i < count; ++i)
-		{
-		const RMobileSmsMessaging::TMobileSmspEntryV1& entry = aList.GetEntryL(i);
-		PrintEntry(aTest, entry);
-		}
-
-	aTest.Printf(_L("======= End CMobilePhoneSmspList ======= \n"));
-	}
-
-void CSmsScTest::PrintEntry(RTest& aTest, const RMobileSmsMessaging::TMobileSmspEntryV1& aEntry)
-/**
-	Prints aEntry 
-
-	@param		aTest		
-	@param		aEntry		A parameter entry.	
- */
-	{
-	aTest.Printf(_L("\t========= TMobileSmspEntryV1 =========\n"));
-
-	aTest.Printf(_L("\tIndex= %d\n\tValid= 0x%X\n"), aEntry.iIndex, aEntry.iValidParams);
-
-	if (aEntry.iValidParams & RMobileSmsMessaging::KProtocolIdIncluded)
-		aTest.Printf(_L("\tProtocolId = %d\n"), aEntry.iProtocolId);
-
-	if (aEntry.iValidParams & RMobileSmsMessaging::KDcsIncluded)
-		aTest.Printf(_L("\tDcs = %d\n"), aEntry.iDcs);
-	
-	if (aEntry.iValidParams & RMobileSmsMessaging::KValidityPeriodIncluded)
-		aTest.Printf(_L("\tValidityPeriod= %d\n"), aEntry.iValidityPeriod);
-	
-	if (aEntry.iValidParams & RMobileSmsMessaging::KDestinationIncluded)
-		aTest.Printf(_L("\tDestination = %S\n"), &aEntry.iDestination.iTelNumber);
-	
-	if (aEntry.iValidParams & RMobileSmsMessaging::KSCAIncluded)
-		aTest.Printf(_L("\tSC = %S\n"), &aEntry.iServiceCentre.iTelNumber);
-	
-	if (aEntry.iValidParams & RMobileSmsMessaging::KSCAIncluded)
-		aTest.Printf(_L("\tText = %S\n"), &aEntry.iText);
-		
-	aTest.Printf(_L("\t======= End TMobileSmspEntryV1 =======\n"));
-	}
-
-void CSmsScTest::DoRunReadInitialParamsL()
-/**
-	Checks the status, saves the operation and prints the list read.
- */
-	{
-	if (iStatus == KErrNone)
-		{
-		TIntBuf progressBuf;
-		progressBuf.Copy(iOperation->ProgressL());
-		iStatus = progressBuf();
-		}
-
-	if (iStatus == KErrNone)
-		{
-		delete iOriginalParams;
-		iOriginalParams = (CSmsSimParamOperation*) iOperation;
-		iOperation = NULL;
-
-	    PrintListL(iSmsTest.Test(), iOriginalParams->SmspList());
-		}
-
-	delete iOperation;
-	iOperation = NULL;
-	}
-
-void CSmsScTest::DoRunWriteSimParamsL()
-/**
-	Checks the status, saves the operation and calls ReadAfterWriteL.
- */
-	{
-	if (iStatus == KErrNone)
-		{
-		TIntBuf progressBuf;
-		progressBuf.Copy(iOperation->ProgressL());
-		iStatus = progressBuf();
-		}
-
-	iSmsTest.Test().Printf(_L("WriteSimParams completed with error %d\n"), iStatus);
-
-	delete iOperation;
-	iOperation = NULL;
-
-	if (iStatus == KErrNone)
-		{
-		// Reading the new parameters from Sim
-		ReadAfterWriteL();
-		}
-	}
-
-void CSmsScTest::DoRunReadAfterWriteL()
-/**
-	Checks the status, parameter list and service center list.
- */
-	{
-	if (iStatus == KErrNone)
-		{
-		TIntBuf progressBuf;
-		progressBuf.Copy(iOperation->ProgressL());
-		iStatus = progressBuf();
-		}
-
-	iSmsTest.Test().Printf(_L("ReadSimParams completed with error %d\n"), iStatus);
-	
-	if (iStatus == KErrNone)
-		{
-		CSmsSimParamOperation* op = (CSmsSimParamOperation*) iOperation;
-		
-		const CMobilePhoneSmspList& list = op->SmspList();
-		TInt count = list.Enumerate();
-
-		iSmsTest.Test().Printf(_L("ReadSimParams found:\n\t%d SMS params on SIM\n"), count);
-
-//		PrintList(iSmsTest.Test(), list);
-		LOCAL_CHECKPOINT(iAutoTest, CompareListsL(*iListToWrite, list));
-		}
-
-	delete iOperation;
-	iOperation = NULL;
-	}
-
-TBool CSmsScTest::CompareListsL(const CMobilePhoneSmspList& aWritten, const CMobilePhoneSmspList& aRead)
-/**
-	Compares two parameter lists 
-
-	@param		aWritten	A list of SIM parameters
-	@param		aRead		A list of SIM parameters	
-	@return		TBool		A boolean. 
- */
-	{
-	const TInt count = aWritten.Enumerate();
-
-	TInt ret = ETrue;
-
-	if (count < aRead.Enumerate())
-		ret = EFalse;
-
-	for (TInt i=0; i<count && ret; ++i) 
-		{   
-		const RMobileSmsMessaging::TMobileSmspEntryV1& entry1 = aWritten.GetEntryL(i);
-		const RMobileSmsMessaging::TMobileSmspEntryV1& entry2 = aRead.GetEntryL(i);
-
-		ret = CompareEntries(entry1, entry2);
-		}
-	
-	return ret;
-	}
-
-TBool CSmsScTest::CompareEntries(const RMobileSmsMessaging::TMobileSmspEntryV1& aWritten, const RMobileSmsMessaging::TMobileSmspEntryV1& aRead)
-/**
-	Compares two parameter entries 
-
-	@param		aWritten	A parameter entry
-	@param		aRead		A parameter entry	
-	@return		TBool		A boolean. 
- */
-	{
-	TBool ret = ETrue;
-
-	if ((aWritten.iValidParams & RMobileSmsMessaging::KProtocolIdIncluded) && (aRead.iValidParams & RMobileSmsMessaging::KProtocolIdIncluded) && aRead.iProtocolId != aWritten.iProtocolId)
-		ret = EFalse;
-	else if ((aWritten.iValidParams & RMobileSmsMessaging::KDcsIncluded) && (aRead.iValidParams & RMobileSmsMessaging::KDcsIncluded) && aWritten.iDcs != aRead.iDcs)
-		ret = EFalse;
-	else if ((aWritten.iValidParams & RMobileSmsMessaging::KValidityPeriodIncluded) && (aRead.iValidParams & RMobileSmsMessaging::KValidityPeriodIncluded) && aWritten.iValidityPeriod != aRead.iValidityPeriod)
-		ret = EFalse;
-	else if ((aWritten.iValidParams & RMobileSmsMessaging::KDestinationIncluded) && (aRead.iValidParams & RMobileSmsMessaging::KDestinationIncluded) && aWritten.iDestination.iTelNumber.CompareF(aRead.iDestination.iTelNumber) != 0)
-		ret = EFalse;
-	else if ((aWritten.iValidParams & RMobileSmsMessaging::KSCAIncluded) && (aRead.iValidParams & RMobileSmsMessaging::KSCAIncluded) && aWritten.iServiceCentre.iTelNumber.CompareF(aRead.iServiceCentre.iTelNumber) != 0)
-		ret = EFalse;
-	else if ((aWritten.iValidParams & RMobileSmsMessaging::KSCAIncluded) && (aRead.iValidParams & RMobileSmsMessaging::KSCAIncluded) && aWritten.iText.CompareF(aRead.iText) != 0)
-		ret = EFalse;
-
-	return ret;
-	}
-
-void CSmsScTest::DoRunWriteOriginalParamsL()
-/**
-	Checks the status
- */	
-	{
-	if (iStatus == KErrNone)
-		{
-		TIntBuf progressBuf;
-		progressBuf.Copy(iOperation->ProgressL());
-		iStatus = progressBuf();
-		}
-
-	iSmsTest.Test().Printf(_L("WriteSimParams completed with error %d\n"), iStatus);
-
-	delete iOperation;
-	iOperation = NULL;
-	}
-
-void CSmsScTest::DoCancel()
-/**
-	Cancels the async operation
- */
-	{
-	if (iOperation)
-		{
-		iOperation->Cancel();
-		iSmsTest.Test().Printf(_L("Operation Cancelled!\n"));
-		}
-
-	delete iOperation;
-	iOperation = NULL;
-	}
--- a/messagingappbase/smsmtm/test/src/T_SmsSendAs.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,431 +0,0 @@
-// Copyright (c) 1999-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 "t_smssendas.h"
-#include "smscmds.h"
-#include "smuthdr.h"
-#include <txtrich.h>
-#include <txtfmlyr.h>
-#include "smsclnt.h"
-
-RTest test(_L("T_SmsSendAs Testrig"));
-CTrapCleanup* theCleanup;
-
-_LIT(KSmsScript, "sms.script");
-_LIT(KWapScript, "wap.script");
-_LIT(KNbsScript, "nbs.script");
-
-LOCAL_C void doMainL()
-	{
-	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
-	CleanupStack::PushL(scheduler);
-	CActiveScheduler::Install( scheduler );
-
-	CSmsTestUtils* smsTest = CSmsTestUtils::NewL(test);
-	CleanupStack::PushL(smsTest);
-	TInt nextTest = 0;
-
-	smsTest->NotifySaPhoneOnL();
-
-	CSmsSendAsTest* asTest = CSmsSendAsTest::NewL(*smsTest, KNullDesC, nextTest);
-	CleanupStack::PushL(asTest);
-
-	smsTest->WaitForInitializeL();
-
-	asTest->StartL();
-
-	//CleanupStack::PopAndDestroy(3); //SmsTest, scheduler
-	CleanupStack::PopAndDestroy(asTest);
-	CleanupStack::PopAndDestroy(smsTest);
-	CleanupStack::PopAndDestroy(scheduler);
-	}
-
-GLDEF_C TInt E32Main()
-	{	
-	__UHEAP_MARK;
-	test.Start(_L("Setup"));
-	theCleanup = CTrapCleanup::New();
-	TRAPD(ret,doMainL());		
-	test(ret==KErrNone);
-	delete theCleanup;	
-	test.Console()->SetPos(0, 13);
-	test.End();
-	test.Close();
-	__UHEAP_MARKEND;
-	return(KErrNone);
-	}
-
-
-CSmsSendAsTest::~CSmsSendAsTest()
-/**
-	destructor
- */
-	{
-	iSocket.Close();
-	iSocketServ.Close();
-	}
-
-CSmsSendAsTest* CSmsSendAsTest::NewL(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest)
-	{
-	CSmsSendAsTest* self = new (ELeave) CSmsSendAsTest(aSmsTest, aScriptFile, aNextTest);
-	CleanupStack::PushL(self);
-
-	self->ConstructL();
-
-	CleanupStack::Pop();
-	return self;
-	}
-
-
-
-CSmsSendAsTest::CSmsSendAsTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest)
-: CSmsTestBase(aSmsTest, aScriptFile, aNextTest), iState(EStateWaiting)
-	{
-	}
-
-void CSmsSendAsTest::RunAutoL()
-/**
-	Runs tests in sequence, checks iStatus
- */
-	{
-	iSmsTest.TestStart(++iNextTest, _L("Test SendAs"));
-	TestSendAsL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-	
-	iSmsTest.TestStart(++iNextTest, _L("Send the messages"));
-	TestSendingL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-	}
-
-void CSmsSendAsTest::ConstructL()
-	{
-	iSmsTest.SetLogToFile();
-	iSmsTest.DeleteServicesL();
-	iSmsTest.CreateServicesL();
-
-	iSelection = new (ELeave) CMsvEntrySelection();
-	iTimer = CTestTimer::NewL();
-
-	User::LeaveIfError(iSocketServ.Connect());
-	TProtocolDesc protoinfo;
-	TProtocolName protocolname(KSmsDatagram);
-	User::LeaveIfError(iSocketServ.FindProtocol(protocolname,protoinfo));
-	User::LeaveIfError(iSocket.Open(iSocketServ,protoinfo.iAddrFamily,protoinfo.iSockType,protoinfo.iProtocol));
-
-	TSmsAddr smsaddr;
-	smsaddr.SetSmsAddrFamily(ESmsAddrSendOnly);
-	User::LeaveIfError(iSocket.Bind(smsaddr));
-
-	CActiveScheduler::Add(this);
-	}
-
-void CSmsSendAsTest::ShowMenuL()
-/**
-	Shows menu
- */
-	{
-	iSmsTest.ResetMenu();
-	iSmsTest.AppendToMenuL(_L("Test SendAs"));
-	iSmsTest.AppendToMenuL(_L("Send the messages"));
-	iSmsTest.AppendToMenuL(_L("Run auto"));
-
-	TInt result = iSmsTest.DisplayMenu(_L("SMS Service Centre Test"));
-
-	if (result <= 0)
-		return;
-
-	switch (result)
-		{
-		case 1:
-			TestSendAsL();
-			break;
-		case 2:
-			TestSendingL();
-			break;
-		case 3:
-			iSmsTest.SetRunAuto(ETrue);
-			RunAutoL();
-			break;
-		default:
-			User::Leave(KErrArgument);
-			break;
-		}
-
-	ShowMenuL();
-	}
-
-void CSmsSendAsTest::RunL()
-/**
-	Handles completed async operations
- */
-	{
-	CActiveScheduler::Stop();
-
-	switch (iState)
-		{
-		case EStateSending:
-			{
-			DoRunSendingL();
-			break;
-			}
-		default:
-			{
-			break;
-			}
-		}
-	}
-
-void CSmsSendAsTest::DoRunSendingL()
-/**
-	Checks the status
- */	
-	{
-	if (iOperation)
-		iSmsTest.SetProgressL(*iOperation);
-
-	if (iStatus == KErrNone)
-		iStatus = iSmsTest.iProgress.iError;
-
-	iSmsTest.Printf(_L("Printing completed with error %d\n"), iStatus.Int());
-
-	iSmsTest.DisplaySendingStatesL(*iSelection);
-	iState = EStateWaiting;
-
-	delete iOperation;
-	iOperation = NULL;
-	}
-
-void CSmsSendAsTest::DoCancel()
-/**
-	Cancels the async operation
- */
-	{
-	if (iOperation)
-		{
-		iOperation->Cancel();
-		iSmsTest.Printf(_L("Operation Cancelled!\n"));
-		}
-	delete iOperation;
-	iOperation = NULL;
-	}
-
-void CSmsSendAsTest::TestSendAsL()
-/**
-	Tests SendAs  
- */
-	{
-	DeleteChildrenL(KMsvGlobalOutBoxIndexEntryId);
-
-	TTime now;
-	now.HomeTime();
-
-	CMsvEntrySelection* sel = new (ELeave) CMsvEntrySelection;
-	CleanupStack::PushL(sel);
-	iSelection->Reset();
-	
-	iSmsTest(iSmsTest.ReadScriptL(KSmsScript, KMsvGlobalOutBoxIndexEntryId, *sel, now));
-	iSmsTest(iSmsTest.ReadScriptL(KWapScript, KMsvGlobalOutBoxIndexEntryId, *sel, now));
-	iSmsTest(iSmsTest.ReadScriptL(KNbsScript, KMsvGlobalOutBoxIndexEntryId, *sel, now));
-	const TInt count = sel->Count();
-
-	iSmsTest(count);
-
-	CRichText* richOld = CRichText::NewL(iSmsTest.iParaFormat, iSmsTest.iCharFormat);
-	CleanupStack::PushL(richOld);
-
-	CRichText* richNew = CRichText::NewL(iSmsTest.iParaFormat, iSmsTest.iCharFormat);
-	CleanupStack::PushL(richNew);
-
-	CSmsHeader* headerOld = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *richOld);
-	CleanupStack::PushL(headerOld);
-
-	CSmsHeader* headerNew = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *richNew);
-	CleanupStack::PushL(headerNew);
-
-	for (TInt i = 0; i < count; i++) //order important
-		{
-		//Get the existing message
-		TMsvId id = sel->At(i);
-		iSmsTest.SetEntryL(id);
-
-		TUid bioType;
-		bioType.iUid = iSmsTest.Entry().iBioType;
-
-			iSmsTest.Printf(_L("%d/%d SendAs for BioType %d\n"), i + 1, count, bioType.iUid); 
-
-			CMsvStore* store = iSmsTest.ReadStoreL();
-			CleanupStack::PushL(store);
-			headerOld->RestoreL(*store);
-			store->RestoreBodyTextL(*richOld);
-			CleanupStack::PopAndDestroy(store);
-			
-			CSendAs* sendAs = CSendAs::NewL(*this);
-			CleanupStack::PushL(sendAs);
-			
-			sendAs->SetMtmL(KUidMsgTypeSMS);
-			iSmsTest(sendAs->AvailableServices().Count());
-			sendAs->SetService(0);
-			sendAs->CreateMessageL(KMsvGlobalOutBoxIndexEntryId);
-
-			for (TInt j = 0; j < headerOld->Recipients().Count(); j++)
-				{
-				CSmsNumber* number = headerOld->Recipients()[j];
-				TPtrC name(number->Name());
-				TPtrC addr(number->Address());
-				sendAs->AddRecipientL(addr, name);
-				}
-
-			sendAs->SetBodyL(*richOld);
-
-			if (bioType.iUid != 0)
-				sendAs->SetBioTypeL(bioType);
-
-			sendAs->SaveMessageL(ETrue);
-
-			//Get the new message
-			CSmsClientMtm* mtm = REINTERPRET_CAST(CSmsClientMtm*, &sendAs->ClientMtm());
-			CMsvEntry& entry = mtm->Entry();
-			store = entry.ReadStoreL();
-			CleanupStack::PushL(store);
-			headerNew->RestoreL(*store);
-			store->RestoreBodyTextL(*richNew);
-			CleanupStack::PopAndDestroy(store);
-
-			iSmsTest.Printf(_L("\tCreated %d\n"), entry.EntryId());
-			test(id != entry.EntryId());
-			CompareHeadersL(*headerOld, *headerNew);
-
-			CSmsSettings* msgSettings = CSmsSettings::NewL();
-			CleanupStack::PushL(msgSettings);
-
-			//Check the settings are the same (except charset)
-			headerNew->GetSmsSettingsL(*msgSettings);
-			CompareSettingsL(mtm->ServiceSettings(), *msgSettings);
-			CleanupStack::PopAndDestroy(msgSettings);
-
-			iSelection->AppendL(entry.EntryId());
-
-			CleanupStack::PopAndDestroy(sendAs);
-			}
-
-	CleanupStack::PopAndDestroy(5);
-	}
-
-void CSmsSendAsTest::CompareSettingsL(const CSmsMessageSettings& aS1, const CSmsMessageSettings& aS2)
-/**
-	Compares two sms message settings 
-
-	@param		aS1			A sms message setting
-	@param		aS2			A sms message setting	
- */
-	{
-	RTest& t = iSmsTest.Test();
-	t(aS1.ValidityPeriod() == aS2.ValidityPeriod());
-	t(aS1.ValidityPeriodFormat() == aS2.ValidityPeriodFormat());
-	t(aS1.RejectDuplicate() == aS2.RejectDuplicate());
-	t(aS1.DeliveryReport() == aS2.DeliveryReport());
-	t(aS1.ReplyPath() == aS2.ReplyPath());
-	t(aS1.MessageConversion() == aS2.MessageConversion());
-	}
-
-void CSmsSendAsTest::CompareHeadersL(const CSmsHeader& aH1, const CSmsHeader& aH2) const
-/**
-	Compares two sms headers
-
-	@param		aH1			A sms message header
-	@param		aH2			A sms message header	
- */
-	{
-	RTest& t = iSmsTest.Test();
-	t(aH1.Type() == aH2.Type());
-
-	t(aH1.Recipients().Count() == aH2.Recipients().Count());
-
-	for (TInt i = 0; i < aH1.Recipients().Count(); i++)
-		{
-		CSmsNumber* number1 = aH1.Recipients()[i];
-		CSmsNumber* number2 = aH2.Recipients()[i];
-
-		t(number1->Address().Compare(number2->Address()) == 0);
-		t(number1->Name().Compare(number2->Name()) == 0);
-		}
-
-	t(aH1.FromAddress().CompareF(aH2.FromAddress()) == 0);
-
-	TInt length = aH1.Message().Buffer().Length();
-	HBufC* hBuf1 = HBufC::NewLC(length);
-	TPtr buf1 = hBuf1->Des();
-	aH1.Message().Buffer().Extract(buf1, 0, length);
-	
-	length = aH2.Message().Buffer().Length();
-	HBufC* hBuf2 = HBufC::NewLC(length);
-	TPtr buf2 = hBuf2->Des();
-	aH2.Message().Buffer().Extract(buf2, 0, length);
-
-	t(buf1.Compare(buf2) == 0);
-
-	CleanupStack::PopAndDestroy(2); //hBuf1, hBuf2
-	}
-
-void CSmsSendAsTest::TestSendingL()
-/**
-	Tests sending
- */
-	{
-	iSmsTest.Test().Next(_L("Test Sending"));
-
-	if (!iSelection->Count())
-		User::Leave(KErrNotFound);
-
-	delete iOperation;
-	iOperation = NULL;
-	iState = EStateSending;
-
-	MsvEntry().SetEntryL(KMsvGlobalOutBoxIndexEntryId);
-	iOperation = MsvEntry().CopyL(*iSelection, iSmsTest.iSmsServiceId, iStatus);
-	SetActive();
-	CActiveScheduler::Start();
-	}
-
-
-void CSmsSendAsTest::DeleteChildrenL(TMsvId aParent)
-/**
-	Deletes children
-
-	@param		aParent			A Message Id
- */
-	{
-	iSmsTest.SetEntryL(aParent);
-	CMsvEntrySelection* sel = iSmsTest.ChildrenWithMtmLC(KUidMsgTypeSMS);
-	TInt count = sel->Count();
-
-	while (count--)
-		{
-		iSmsTest.DeleteEntryL(sel->At(count));
-		}
-
-	CleanupStack::PopAndDestroy(sel);
-	}
-
-TBool CSmsSendAsTest::CapabilityOK(TUid /*aCapability*/, TBool /*aResponse*/)
-/**
-	This is required by MSendAsObserver
- */
-	{
-	return ETrue;
-	}
-
--- a/messagingappbase/smsmtm/test/src/T_SmsSendBase.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,328 +0,0 @@
-// Copyright (c) 1999-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 "T_SmsSendBase.h"
-#include <e32test.h>
-#include <e32uid.h>
-#include <e32std.h>
-#include <smuthdr.h>
-#include <txtrich.h> 
-#include <smscmds.h>
-#include <smsclnt.h>
-
-void CSmsSendTestBase::DoTestSendingL(const TDesC& aScript)
-/**
-	Tests Sending: Creates and sends sms messages defined in aScript.
-
-	@param		aScript		Script file containing sms messages 
- */
-	{
-	CSmsTestBase::DoTestSendingL(aScript);
-	iState = EStateSending;
-	CActiveScheduler::Start();
-	}
-
-void CSmsSendTestBase::DoTestSchedulingL(const TDesC& aScript, TTimeIntervalSeconds aFromNow)
-/**
-	Tests Schedule Sending: Creates and schedules sms messages defined in aScript.
-
-	@param		aScript			Script file containing sms messages 
-	@param		aFromNow		Time interval 
- */
-	{
-	CSmsTestBase::DoTestSchedulingL(aScript, EFalse, aFromNow);
-	iState = EStateScheduling;
-	CActiveScheduler::Start();
-	}
-
-CSmsSendTestBase::~CSmsSendTestBase()
-/**
-	destructor
- */
-	{
-	if (iSmsTest.iMsvSession)
-		{
-		iSmsTest.iMsvSession->RemoveObserver(*this);
-		}
-	}
-
-CSmsSendTestBase::CSmsSendTestBase(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest)
-: CSmsTestBase(aSmsTest, aScriptFile, aCurrentTest), iState(EStateWaiting)
-	{
-	}
-
-void CSmsSendTestBase::RunAutoL()
-/**
-	Runs tests in sequence, checks iStatus
- */
-	{
-	// Test sending SMSs
-	iSmsTest.TestStart(++iNextTest);
-	TestSendingL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	// Test Scheduling
-	iSmsTest.TestStart(++iNextTest);
-	TestSchedulingL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	// Test forwarding an already sent SMS
-	iSmsTest.TestStart(++iNextTest);
-	TestForwardSentMsgL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-	}
-
-void CSmsSendTestBase::ConstructL()
-	{
-	iSmsTest.SetLogToFile();
-
-	iSelection = new (ELeave) CMsvEntrySelection();
-
-	iSmsTest.iMsvSession->AddObserverL(*this);
-
-	CActiveScheduler::Add(this);
-	}
-
-void CSmsSendTestBase::HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* /*aArg2*/, TAny* /*aArg3*/)
-/**
-	Handles Session Event, used by MMsvSessionObserver
-
-	@param		aEvent		Msv Session Event
-	@param		aArg1		Argument 1
-	@param		aArg2		Argument 2 
-	@param		aArg3		Argument 3 
- */
-	{
-	CMsvEntrySelection* entries = NULL;
-
-	switch (aEvent)
-		{
-		case EMsvEntriesCreated:
-		case EMsvEntriesChanged:
-		case EMsvEntriesMoved:
-			entries = STATIC_CAST(CMsvEntrySelection*, aArg1);
-			break;
-		default:
-			return;
-		}
-
-	if (!IsActive())
-		return;
-
-	switch (iState)
-		{
-		case EStateSchedulingThenSend:
-		case EStateSending:
-			{
-			TInt error = KErrNone;
-
-			iSmsTest.DisplaySendingStatesL(*entries);
-
-			if (iSmsTest.SendingCompleteL(*iSelection, error) && iState == EStateSchedulingThenSend && iStatus == KRequestPending)
-				{
-				TRequestStatus* status = &iStatus;
-				User::RequestComplete(status, error);
-				}
-			break;
-			}
-		default:
-			break;
-		}
-	}
-
-
-void CSmsSendTestBase::ShowMenuL()
-/**
-	Shows menu
- */
-	{
-	iSmsTest.ResetMenu();
-
-	iSmsTest.AppendToMenuL(_L("Send Messages"));
-	iSmsTest.AppendToMenuL(_L("Schedule Messages"));
-	iSmsTest.AppendToMenuL(_L("Display Log"));
-	iSmsTest.AppendToMenuL(_L("Clear Log"));
-	iSmsTest.AppendToMenuL(_L("Navigate Message Store"));
-
-	TInt result = iSmsTest.DisplayMenu(_L("SMS Send Test"));
-
-	if (result <= 0)
-		return;
-
-	switch (result)
-		{
-		case 1:
-			TestSendingL();
-			break;
-		case 2:
-			TestSchedulingL();
-			break;
-		case 3:
-			DisplayLogL();
-			break;
-		case 4:
-			ClearLogL();
-			break;
-		case 5:
-			iSmsTest.NavigateMessageStoreL();
-			break;
-		default:
-			User::Leave(KErrArgument);
-			break;
-		}
-
-	ShowMenuL();
-	}
-
-void CSmsSendTestBase::RunL()
-/**
-	Handles completed async operations
- */
-	{
-	if (iOperation)
-		iSmsTest.SetProgressL(*iOperation);
-
-	switch (iState)
-		{
-		case EStateScheduling:
-			DoRunSchedulingL();
-			break;
-		case EStateSending:
-		case EStateSchedulingThenSend:
-			DoRunSendingL();
-			break;
-		default:
-			break;
-		}
-
-	delete iOperation;
-	iOperation = NULL;
-	}
-
-void CSmsSendTestBase::TestForwardSentMsgL()
-/**
-	Tests forwarding a Sent Message
- */
-	{
-	// Get all the messages in the Sent Folder
-	SmsTest().SetEntryL(KMsvSentEntryId);
-	CMsvEntrySelection* sentEntries = SmsTest().ChildrenWithMtmLC(KUidMsgTypeSMS);
-
-	// If there are any Sent Messages, then Forward the first one
-	if (sentEntries->Count())
-		{
-		// This will create and send the forwarded SMS
-		TMsvId sentId = sentEntries->At(0);
-		DoTestForwardMsgL(sentId);
-
-		iState = EStateSending;
-		CActiveScheduler::Start();
-		}
-
-	CleanupStack::PopAndDestroy(); //sentEntries
-	}
-
-void CSmsSendTestBase::DoCancel()
-	{
-	if (iOperation)
-		{
-		iOperation->Cancel();
-		iSmsTest.Printf(_L("Operation Cancelled!\n"));
-		}
-	else
-		{
-		iSmsTest.Printf(_L("No operation to cancel!\n"));
-		}
-
-	delete iOperation;
-	iOperation = NULL;
-	}
-
-void CSmsSendTestBase::DoRunSchedulingL()
-/**
-	Checks status. 
-	The message is rescheduled if sending failed.
- */
-	{
-	if (iStatus == KErrNone)
-		iStatus = iSmsTest.iProgress.iError;
-
-	iSmsTest.Printf(_L("Scheduling completed with error %d\n"), iStatus);
-
-	TBool sent = EFalse;
-
-	if (iStatus == KErrNone)
-		{
-		iSmsTest.DisplaySendingStatesL(*iSelection);
-		TInt error = KErrNone;
-		sent = iSmsTest.SendingCompleteL(*iSelection, error);
-		iStatus = error;
-		}
-	
-	if (!sent)
-		{
-		iStatus = KRequestPending;
-		SetActive();
-		iState = EStateSchedulingThenSend;
-		}
-	else
-		{
-		CActiveScheduler::Stop();
-		iState = EStateWaiting;
-		iSmsTest.Printf(_L("Scheduling completed with error %d\n"), iStatus);
-
-		if (!iSmsTest.RunAuto())
-			{
-			iSmsTest.Test().Printf(_L("\nPress any key to continue...\n"));
-			iSmsTest.Test().Getch();
-			}
-		}
-	}
-
-void CSmsSendTestBase::DoRunSendingL()
-/**
-	Checks status. 
-	The message is rescheduled if sending failed.
- */
-	{
-	if (iStatus == KErrNone)
-		iStatus = iSmsTest.iProgress.iError;
-
-	iState = EStateWaiting;
-	iSmsTest.Printf(_L("Sending completed with error %d\n"), iStatus);
-
-	TInt err = KErrNone;
-
-	if (!iSmsTest.SendingCompleteL(*iSelection, err))
-		{
-		iSmsTest.Printf(_L("Waiting for all messages to send or fail\n"), iStatus);
-		iStatus = KRequestPending;
-		SetActive();
-		iState = EStateSchedulingThenSend;
-		}
-	else
-		{
-		CActiveScheduler::Stop();
-
-		if (!iSmsTest.RunAuto())
-			{
-			iSmsTest.Test().Printf(_L("\nPress any key to continue...\n"));
-			iSmsTest.Test().Getch();
-			}
-		}
-	}
--- a/messagingappbase/smsmtm/test/src/T_SmsSendNbs.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-// Copyright (c) 1999-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 "T_SmsSendNbs.h"
-#include <smsuaddr.h>
-
-RTest test(_L("T_SmsSendNbs Testrig"));
-CTrapCleanup* theCleanup;
-
-void CSmsSendNbsTest::TestSendingL()
-/**
-	Tests Sending
- */
-	{
-	DoTestSendingL(iScriptFile);
-	}
-
-void CSmsSendNbsTest::TestSchedulingL()
-/**
-	Tests schedule sending
- */
-	{
-	DoTestSchedulingL(iScriptFile);
-	}
-
-
-CSmsSendNbsTest::CSmsSendNbsTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest)
-: CSmsSendTestBase(aSmsTest, aScriptFile, aCurrentTest)
-/**
-	Constructor
- */
-	{
-	}
-
-LOCAL_C void doMainL()
-	{
-	RSocketServ serv;
-	RSocket socket;
-
-	User::LeaveIfError(serv.Connect());
-	CleanupClosePushL(serv);
-	
-	TProtocolDesc protoinfo;
-	TProtocolName protocolname(KSmsDatagram);
-	User::LeaveIfError(serv.FindProtocol(protocolname,protoinfo));
-	User::LeaveIfError(socket.Open(serv,protoinfo.iAddrFamily,protoinfo.iSockType,protoinfo.iProtocol));
-
-	TSmsAddr smsaddr;
-	smsaddr.SetSmsAddrFamily(ESmsAddrSendOnly);
-	User::LeaveIfError(socket.Bind(smsaddr));
-
-	CleanupClosePushL(socket);
-
-	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
-	CleanupStack::PushL(scheduler);
-	CActiveScheduler::Install( scheduler );
-
-	CSmsTestUtils* smsTest = CSmsTestUtils::NewL(test);
-	CleanupStack::PushL(smsTest);
-	TInt nextTest = 0;
-
-	smsTest->NotifySaPhoneOnL();
-	smsTest->WaitForInitializeL();
-
-	CSmsSendNbsTest* nbsTest = CSmsSendNbsTest::NewL(*smsTest, KNbsScript, nextTest);
-	CleanupStack::PushL(nbsTest);
-
-	nbsTest->StartL();
-
-	CleanupStack::PopAndDestroy(3); //SmsTest, scheduler
-
-	CleanupStack::PopAndDestroy(&socket);
-	CleanupStack::PopAndDestroy(&serv);
-	}
-
-GLDEF_C TInt E32Main()
-	{	
-	__UHEAP_MARK;
-	test.Start(_L("Setup"));
-	theCleanup = CTrapCleanup::New();
-	TRAPD(ret,doMainL());		
-	test(ret==KErrNone);
-	delete theCleanup;	
-	test.Console()->SetPos(0, 13);
-	test.End();
-	test.Close();
-	__UHEAP_MARKEND;
-	return(KErrNone);
-	}
-
-CSmsSendNbsTest* CSmsSendNbsTest::NewL(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest)
-	{
-	CSmsSendNbsTest* self = new (ELeave) CSmsSendNbsTest(aSmsTest, aScriptFile, aCurrentTest);
-	CleanupStack::PushL(self);
-
-	self->ConstructL();
-
-	CleanupStack::Pop();
-	return self;
-	}
-
--- a/messagingappbase/smsmtm/test/src/T_SmsSendRecv.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1205 +0,0 @@
-// Copyright (c) 2000-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:
-// GT Messaging Test Harness T_SmsSendRecv
-// Test Harness: T_SmsSendRecv
-// Component: SMS
-// Owner: AA
-// Brief Description: Sends and waits to receive SMS messages specified in sendrecv.script
-// Detailed Description: As Above
-// Input Files REQUIRED:
-// <DRIVE>:\msgtest\sms\defaults.script
-// <DRIVE>:\msgtest\sms\sendrecv.script
-// Intermediate Files Produced: None
-// Output files produced: <DRIVE>:\msglogs\T_SmsSendRecv.<PLATFORM>.<VARIANT>.log
-// Building Instructions:
-// cd \msg\smcm
-// bldmake bldfiles
-// abld test build
-// Running Instructions:
-// All Platforms:
-// 1. Build T_DB test harness from COMMDB component:
-// cd \commdb\group
-// bldmake bldfiles
-// abld test build t_db
-// 2. Run T_DB and select the your modem (probably GSM Mobile Phone)
-// 3. Build the test utilities:
-// cd \msg\testutils\group\
-// bldmake bldfiles
-// abld test build
-// 4. Edit \epoc32\wins\c\msgtest\sms\defaults.script. Replace the telephone number ("Recipients") with your mobile's number. You may also need to change the service centre ("SC") number (the default is for Vodafone UK).
-// WINS Only:
-// 1. Run T_DB.exe (if it has not already been run) and select your modem (GSM mobile phone).
-// 2. \epoc32\release\wins\<VARIANT>\T_SmsSendRecv.exe can be used at the command prompt or executable can be run from Windows Explorer.
-// Platform other than WINS:
-// 1. Copy \epoc32\release\<PLATFORM>\<VARIANT>\T_SmsSendRecv.exe onto the other platform (or onto the CF card)
-// 2. Copy \epoc32\release\<PLATFORM>\<VARIANT>\T_DB.exe onto the other platform (or onto the CF card)
-// 3. Copy \epoc32\release\<PLATFORM>\<VARIANT>\MsvTestUtils.DLL into <DRIVE>:\system\libs on the other platform (or onto the CF card)
-// 4. Copy \epoc32\release\<PLATFORM>\<VARIANT>\SmsTestUtils.DLL into <DRIVE>:\system\libs on the other platform (or onto the CF card)
-// 5. Copy \epoc32\wins\c\msgtest\sms\sendrecv.script and defaults.script into <DRIVE>:\msgtest\sms on the other platform (or onto the CF card)
-// 6. Run T_DB.exe on the other platform (if it has not already been run) and select your modem (GSM mobile phone).
-// 7. Run T_SmsSendRecv.exe on the other platform.
-// 
-//
-
-#include "T_SmsSendRecv.h"
-#include <watcher.h>
-#include <smuthdr.h>
-#include <txtrich.h>
-#include <bioscmds.h>
-#include <biosmtm.h>
-#include <smss.rsg>
-#include <msgtestscripts.h>
-#include <smsclnt.h>
-#include <csmsaccount.h>
-
-
-RTest test(_L("T_SmsSendRecv Testrig"));
-CTrapCleanup* theCleanup;
-
-const TInt KTestDescriptionLength	= 15;
-
-LOCAL_C void doMainL()
-	{
-	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
-	CleanupStack::PushL(scheduler);
-	CActiveScheduler::Install( scheduler );
-
-	CSmsTestUtils* smsTest = CSmsTestUtils::NewL(test);
-	CleanupStack::PushL(smsTest);
-	TInt nextTest = 0;
-	
-	smsTest->NotifySaPhoneOnL();
-
-	CSmsSendRecvTest* recvTest = CSmsSendRecvTest::NewLC(*smsTest, KSendRecvScript, nextTest);
-
-	smsTest->WaitForInitializeL();
-
-	recvTest->StartL();
-
-	CleanupStack::PopAndDestroy(3); //SmsTest, scheduler
-	}
-
-GLDEF_C TInt E32Main()
-	{	
-	__UHEAP_MARK;
-	test.Start(_L("Setup"));
-	theCleanup = CTrapCleanup::New();
-	TRAPD(ret,doMainL());		
-	test(ret==KErrNone);
-	delete theCleanup;	
-	test.Console()->SetPos(0, 13);
-	test.End();
-	test.Close();
-	__UHEAP_MARKEND;
-	return(KErrNone);
-	}
-
-CEntryObserver* CEntryObserver::NewL(CSmsTestUtils& aTestUtils, const TInt& aCurrentMessageNum)
-	{
-	CEntryObserver* self = new (ELeave) CEntryObserver(aTestUtils, aCurrentMessageNum);
-	CleanupStack::PushL(self);
-	self->iReceived = new (ELeave) CMsvEntrySelection();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-CEntryObserver::CEntryObserver(CSmsTestUtils& aTestUtils, const TInt& aCurrentMessageNum)
-: CBase(), iCurrentMessageNum(aCurrentMessageNum), iSmsTest(aTestUtils)
-	{
-	}
-
-
-CEntryObserver::~CEntryObserver() 
-/**
-	destructor
- */
-	{
-	delete iReceived;
-	}
-
-void CEntryObserver::CheckReceivedMessageL(TMsvId aId)
-/**
-	Checks received message
-
-	@param		aId			A message Id
- */
-	{
-	// Restore SMS settings
-	iSmsTest.SetEntryL(iSmsTest.iSmsServiceId);
-
-	CSmsAccount* account = CSmsAccount::NewLC();
-	account->LoadSettingsL(*iSmsTest.iServiceSettings);
-	CleanupStack::PopAndDestroy(account);
-
-	iSmsTest.Printf(_L("Check last received message...\n"));
-
-	iSmsTest.DisplayMessageL(aId);
-	iSmsTest.SetEntryL(aId);
-
-	CSmsHeader* header = iSmsTest.GetHeaderLC(aId);
-
-	if (header->Type() == CSmsPDU::ESmsDeliver)
-		{
- 		CSmsDeliver& pdu = header->Deliver();
-
-		TBool found = EFalse;
-		TInt destination, originator, is16Bit;
-		destination = originator = is16Bit = 0;
-		if (pdu.UserDataPresent())
-			{
-			const CSmsUserData& userData = pdu.UserData();
-			TInt count = userData.NumInformationElements();
-			iSmsTest.Printf(_L("\tPdu contains %d information elements\n"), count);
-			while (!found && count--)
-				{
-				CSmsInformationElement& nextIE=userData.InformationElement(count);
-				switch(nextIE.Identifier())
-					{
-					case CSmsInformationElement::ESmsIEIApplicationPortAddressing8Bit:
-					case CSmsInformationElement::ESmsIEIApplicationPortAddressing16Bit:
-						{
-						pdu.ApplicationPortAddressing(destination, originator, &is16Bit);
-						found = ETrue;
-						break;
-						}
-					default:
-						break;
-					}
-				}
-			}
-		else
-			iSmsTest.Printf(_L("\tPdu contains NO user data header\n"));
-
-		if (found)
-			iSmsTest.Printf(_L("\tApplication Port Addressing: Dest %d, Origin %d, is16Bit %d\n"), destination, originator, is16Bit);
-		else
-			iSmsTest.Printf(_L("\tApplication Port Addressing: Not Found\n"));
-		}
-
-	//Check the description
-	const TMsvEntry& entry = iSmsTest.Entry();
-
-	if (entry.iBioType == 0)
-		{
-		//Test description
-		TInt descriptionLength = iSmsTest.iServiceSettings->DescriptionLength();
-		HBufC* buf = HBufC::NewLC(descriptionLength);
-		TPtr desc = buf->Des();
-		User::LeaveIfError(TSmsUtilities::GetDescription(header->Message(), desc, descriptionLength));
-
-		iSmsTest.Printf(_L("\tiDescription=\"%S\" desc=\"%S\"\n"), &entry.iDescription, &desc);
-		iSmsTest(desc.CompareF(entry.iDescription) == 0);
-		
-		if (header->Type() == CSmsPDU::ESmsStatusReport)
-			{
-			iSmsTest.ReadResourceStringL(KSmsResourceFile,  R_TYPE_STATUS_REPORT, desc);
-			iSmsTest.Printf(_L("\tiDescription=\"%S\" Res=\"%S\"\n"), &entry.iDescription, &desc);
-			iSmsTest(desc.CompareF(entry.iDescription) == 0);
-			}
-		CleanupStack::PopAndDestroy(buf);
-		}
-
-
-	CleanupStack::PopAndDestroy(header);
-	}
-
-
-void CEntryObserver::HandleEntryEventL(TMsvEntryEvent aEvent, TAny* aArg1, TAny* /*aArg2*/, TAny* /*aArg3*/)
-/**
-	Handles entry event, used by MMsvEntryObserver
-
-	@param		aEvent		Msv entry event
-	@param		aArg1		Argument 1
-	@param		aArg2		Argument 2 
-	@param		aArg3		Argument 3 
- */
-	{
-	if (aEvent == EMsvNewChildren && iCurrentMessageNum > -1)
-		{
-		CMsvEntrySelection* msgs = (CMsvEntrySelection*)aArg1;
-
-		TInt count = msgs->Count();
-
-		TInt msgRecv = 0;
-
-		while (count--)
-			{
-			TMsvId id = (*msgs)[count];
-
-			CheckReceivedMessageL(id);
-			CSmsHeader* header = iSmsTest.GetHeaderLC(id);
-
-			if (header->Type() == CSmsPDU::ESmsDeliver)
-				{
-				iReceived->AppendL(id);
-				msgRecv++;
-				}
-
-			CleanupStack::PopAndDestroy(header);
-			}
-
-		if (msgRecv)	
-			iSmsTest.Printf(_L("%d Messages Received in inbox\n"), msgRecv);
-		}
-	}
-
-CSmsSendRecvTest::~CSmsSendRecvTest()
-/**
-	destructor
- */
-	{
-	delete iEntryObserver;
-	delete iEntryForObserver;
-	delete iWatchers;
-
-	iSocket.Close();
-	iSocketServ.Close();
-	}
-
-TBool CSmsSendRecvTest::WatchersAlreadyRunningL()
-/**
-	Checks if the watchers are already running
- */
-	{
-	RSocketServ server;
-	RSocket socket;
-
-	User::LeaveIfError(server.Connect());
-	CleanupClosePushL(server);
-
-		// test if it's there... 
-	TProtocolDesc protoInfo;
-	TProtocolName protocolname;
-	protocolname.Copy(KSmsDatagram);
-	User::LeaveIfError(server.FindProtocol(protocolname,protoInfo));
-
-	User::LeaveIfError(socket.Open(server,
-										protoInfo.iAddrFamily,
-										protoInfo.iSockType, 
-										protoInfo.iProtocol));
-	CleanupClosePushL(socket);
-
-	TSmsAddr addr;
-	addr.SetSmsAddrFamily(ESmsAddrRecvAny);
-	TInt err = socket.Bind(addr);
-
-	CleanupStack::Pop(2); //server, socket
-	socket.CancelAll();
-	socket.Close();
-//	server.Close();
-	return (err == KErrAlreadyExists);
-	}
-
-void CSmsSendRecvTest::StartWatcherL()
-/**
-	Starts the watcher if it is not running
- */
-	{
-	iSmsTest.Test().Next(_L("Start the Watcher"));
-
-	if (WatchersAlreadyRunningL())
-		{
-		iSmsTest.Printf(_L("Watchers are already running\n"));
-		return;
-		}
-
-	iWatchers = CTestUtilsWatcherStarter::NewL();
-
-	TTimeIntervalMicroSeconds32 wait = KWaitForWatchersToStart;
-	while (wait.Int() > 0)
-		{
-		iSmsTest.Printf(_L("Waiting %d secs for watchers to start...\n"), wait.Int() / 1000000);
-		wait = wait.Int() - KWaitForWatchersToStartDisplayInterval.Int();
-		User::After(KWaitForWatchersToStartDisplayInterval);
-		}
-	}
-
-CSmsSendRecvTest* CSmsSendRecvTest::NewLC(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest)
-	{
-	CSmsSendRecvTest* self = new (ELeave) CSmsSendRecvTest(aSmsTest, aScriptFile, aNextTest);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	return self;
-	}
-
-
-void CSmsSendRecvTest::TestSendingL()
-/**
-	Tests sending: Creates messages as defined in the script file
- */
-	{
-	iSmsTest.Test().Next(_L("Sending"));
-
-	TTime now;
-	now.HomeTime();
-	now += (TTimeIntervalSeconds) 5;
-
-	iSelection->Reset();
-
-	iSmsTest.DeleteSmsMessagesL(KMsvGlobalOutBoxIndexEntryId);
-
-	TBool read = EFalse;
-	iSmsTest.Printf(_L("Creating msgs in outbox from script: %S\n"), &iScriptFile);
-	TRAPD(err, read = iSmsTest.ReadScriptL(iScriptFile, KMsvGlobalOutBoxIndexEntryId, *iSelection, now));
-
-	iSmsTest.Test()(!err && read);
-
-	iSmsTest.Printf(_L("Send and Receive %d messages...\n"), iSelection->Count());
-
-	TInt count = iSelection->Count();
-	iTotal = 0;
-	iSent = 0;
-	while (count--)
-		{
-		iTotal += CountRecipientsL(iSelection->At(count));
-		}
-
-	iCurrentMessageNum = -1;
-	}
-
-TInt CSmsSendRecvTest::CountRecipientsL(TMsvId aId)
-/**
-	Counts the number receipients in aId
-
-	@param		aId		A message Id 
- */
-	{
-	CSmsHeader* header = iSmsTest.GetHeaderLC(aId);
-	const TInt count = header->Recipients().Count();
-	CleanupStack::PopAndDestroy(header);
-	return count;
-	}
-
-TBool CSmsSendRecvTest::SendNextMessageL()
-/**
-	Sends the next message 
- */
-	{
-	iCurrentMessageNum++;
-	const TInt count = iSelection->Count();
-
-	if (iCurrentMessageNum < count)
-		{
-		iSmsTest.Printf(_L("Sending message %d of %d\n"), iCurrentMessageNum + 1, count);
-
-		delete iOperation;
-		iOperation = NULL;
-
-		CMsvEntrySelection* sel = new (ELeave) CMsvEntrySelection();
-		CleanupStack::PushL(sel);
-		const TMsvId id = iSelection->At(iCurrentMessageNum);
-		
-		TInt replace_msg_one_index = GetIndexOfSectionL(_L("ReplaceTypeSMSOne"));
-		TInt replace_msg_two_index = GetIndexOfSectionL(_L("ReplaceTypeSMSTwo"));
-		TInt msg_indication_index = GetIndexOfSectionL(_L("SMSMessageIndication"));
-
-		TInt vCalendar_index = GetIndexOfSectionL(_L("WAP:vCalendar"));
- 		// storing the id of vCalender message , to use it to test for replying bio messages
- 		if(vCalendar_index != KErrNotFound && vCalendar_index == (iCurrentMessageNum+1))
- 			iMsgVCalenderIndex = iCurrentMessageNum;
-
-		if(replace_msg_one_index != KErrNotFound && replace_msg_one_index == (iCurrentMessageNum+1))
-			SendReplaceTypeMessageL();
-					
-		if(replace_msg_two_index != KErrNotFound && replace_msg_two_index == (iCurrentMessageNum+1))
-			{
-			SendReplaceTypeMessageL();
-			iSmsTest.Printf(_L("This Message replaces previous Replace Type Message"));
-			}
-				
-		if(msg_indication_index != KErrNotFound && msg_indication_index == (iCurrentMessageNum+1))
-			SendMessageIndicationL();
-		
-		iSmsTest.DisplayMessageL(id);
-		sel->AppendL(id);
-		iSent += CountRecipientsL(id);
-		iSmsTest.SetEntryL(KMsvGlobalOutBoxIndexEntryId);
-		iOperation = MsvEntry().CopyL(*sel, iSmsTest.iSmsServiceId, iStatus);
-		CleanupStack::PopAndDestroy(); //sel
-	
-		iState = EStateSending;
-		SetActive();
-		CActiveScheduler::Start();
-		return ETrue;
-		}
-
-	return EFalse;
-	}
-
-TInt CSmsSendRecvTest::GetIndexOfSectionL(const TDesC& aSectionName)
-/**
- *  Returns back the index of the section
- */
-	{
-	CScriptFile* script = CScriptFile::NewLC(iSmsTest, KSmsComponent);
-	script->ReadScriptL(KSendRecvScript);
-		
-	TInt index = KErrNotFound;
-	TInt count = iSelection->Count();
-
-	for (TInt i = 0; i <= count; i++) //order important
-		{
-		CScriptSection& tempsection = *script->Sections()[i];
-		if (tempsection.SectionName().CompareF(aSectionName) == 0)
-			index = i;
-		}
-
-	CleanupStack::PopAndDestroy(script);
-	
-	return index;
-	}
-
-void CSmsSendRecvTest::SendReplaceTypeMessageL()
-/**
- *  Handles the replace type sms messages in sendrecv.script
- */
-	{	
-	iSmsTest.Printf(_L("\nSend Replace Type Message\n"));
-	const TMsvId id = iSelection->At(iCurrentMessageNum);
-	CSmsHeader* header = iSmsTest.GetHeaderLC(id);
-	CSmsSubmit& submit = header->Submit();
-	submit.SetPIDType(TSmsProtocolIdentifier::ESmsPIDShortMessageType);
-	submit.SetShortMessageType(TSmsProtocolIdentifier::ESmsReplaceShortMessageType1);
-	StoreMessageL(id, *header);
-	CleanupStack::PopAndDestroy(header);
-	}
-
-void CSmsSendRecvTest::SendMessageIndicationL(TUint8 aMessageType, TUint8 aMessageCount)
-/**
- * Sends an SMS message with Special SMS Message Indication set in the user data header.
- * 
- * @param aMessageType The type of the Special SMS Message Indication
- * @param aMessageCount The number of "messages" waiting
- */
-	{
-	iSmsTest.Printf(_L("\nSendMessageIndicationL\n"));
-	const TMsvId id = iSelection->At(iCurrentMessageNum);
-	CSmsHeader* header = iSmsTest.GetHeaderLC(id);
-	TBuf8<2> data;
-	data.SetLength(2);
-				
-	data[0] = aMessageType;
-	data[1] = aMessageCount;
-
-	header->Submit().UserData().AddInformationElementL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication, data);
-	StoreMessageL(id, *header);
-	CleanupStack::PopAndDestroy(header);
-	}
-
-void CSmsSendRecvTest::StoreMessageL(TMsvId aId, const CSmsHeader& aHeader)
-/**
- * Stores the header against a message
- *
- * @param aId ID of the message
- * @param aHeader The CSmsHeader to store against the message
- */
-	{
-	iSmsTest.SetEntryL(aId);
-	CMsvStore* store = iSmsTest.EditStoreL();
-	CleanupStack::PushL(store);
-	aHeader.StoreL(*store);
-	store->StoreBodyTextL(*iSmsTest.iRichText);
-	store->CommitL();
-	CleanupStack::PopAndDestroy(store);
-	}
-
-void CSmsSendRecvTest::TestWaitForReceiveL()
-/**
-	Waits to receive message
- */
-	{
-	iSmsTest.Test().Next(_L("Waiting to receive message"));
-	iState = EStateWaitingToReceive;
-	TRequestStatus* status = &iStatus;
-	User::RequestComplete(status, KErrNone);
-	SetActive();
-	}
-
-CSmsSendRecvTest::CSmsSendRecvTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest)
-: CSmsTestBase(aSmsTest, aScriptFile, aNextTest), iCurrentMessageNum(-1), iState(EStateWaiting)
-/**
-	Constructor
- */
-	{
-	TBuf<256> command;
-		User::CommandLine(command);
-	
-	command.Trim();
-	iParse = (command.FindF(KParseAfterReceive) != KErrNotFound);
-	iSaveToFile = (command.FindF(KSaveAfterReceive) != KErrNotFound);
-	iTestBifs = (command.FindF(KTestBifs) != KErrNotFound);
-	iWaitForever = (command.FindF(KWaitForever) != KErrNotFound);
-
-	iMsgVCalenderIndex = KErrNotFound;
-	// check to see if we want to run EMS tests
-	if (command.FindF(KRunEmsTests) != KErrNotFound)
-		{
-		iScriptFile = KSendRecvEmsScript;
-		}
-	}
-
-void CSmsSendRecvTest::RunAutoL()
-/**
-	Runs tests in sequence, checks iStatus
- */
-	{	
-	iSmsTest.TestStart(++iNextTest, _L("Start Watcher"));
-	StartWatcherL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-	
-	if (!WatchersAlreadyRunningL())
-		{
-		iSmsTest.Printf(_L("WARNING: NBS Watcher has not started yet\n"));
-		}
-
-	if (!iSmsTest.iSmokeTest && iTestBifs)
-		{
-		iSmsTest.TestStart(++iNextTest, _L("Add Remove Bifs"));
-		TestBifsL();
-		User::LeaveIfError(iStatus.Int());
-		iSmsTest.TestFinish(iNextTest, KErrNone);
-		}
-
-	if (!WatchersAlreadyRunningL())
-		{
-		iSmsTest.Printf(_L("WARNING: NBS Watcher has not started yet\n"));
-		}
-
-	// Change the description length to be shorter then the default - actual
-	// value is not important only that it is different to the default of
-	// KSmsDescriptionLength (32).
-
-	iSmsTest.Printf(_L("\nChanging the description length to %d\n"), KTestDescriptionLength);
-	
-	// Restore settings first...	
-	CSmsAccount* account = CSmsAccount::NewLC();
-	account->LoadSettingsL(*iSmsTest.iServiceSettings);
-
-	// Set the description length to 1
-	iSmsTest.iServiceSettings->SetDescriptionLength(KTestDescriptionLength);
-
-	// Store the sms settings
-	account->SaveSettingsL(*iSmsTest.iServiceSettings);
-	CleanupStack::PopAndDestroy(account);
-
-	// Ok, now start real tests...
-
-	iSmsTest.TestStart(++iNextTest, _L("Read Script"));
-	TestSendingL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	FOREVER
-		{
-		iSmsTest.TestStart(++iNextTest, _L("Send Message"));
-		TBool sendNext = SendNextMessageL();
-		if (sendNext)
-			{
-			User::LeaveIfError(iStatus.Int());
-			iSmsTest.TestFinish(iNextTest, KErrNone);
-			}
-		else
-			{
-			iSmsTest.Printf(_L("No more messages to send!"));
-			iSmsTest.TestFinish(iNextTest, KErrNone);
- 			// Testing Reply to Bio-Messages
-  			TestReplyL();
-			break;
-			}
-		}
-
-	iSmsTest.TestStart(++iNextTest, _L("Wait to receive extra message(s)"));
-	WaitForExtraL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-	iSmsTest.Printf(_L("\nDisplay Final Log:\n"));
-	DisplayLogL();
-	}
-
-void CSmsSendRecvTest::SetSmsSettingsL()
- 	{
- 	MsvEntry().SetEntryL(iSmsTest.iSmsServiceId);
- 
-// Lets create sms settings to set it for reply
- 	CSmsSettings* settings = CSmsSettings::NewL();
- 	CleanupStack::PushL(settings);
- 	
- 	settings->SetReplyQuoted(ETrue);
- 
- 	CSmsAccount* account = CSmsAccount::NewLC();
- 	account->SaveSettingsL(*settings);
- 	CleanupStack::PopAndDestroy(account);
- 
- 	iSmsTest.iServiceSettings->CopyL(*settings);
- 	CleanupStack::PopAndDestroy();  //settings
- 	}
- 
-// Now testing replying to received messages
-void CSmsSendRecvTest::TestReplyL()
- 	{
- 	// Test cannot be performed as no vCalender message received in the inbox
- 	if(iMsgVCalenderIndex == KErrNotFound)
- 		return;
- 	
-	iSmsTest.TestStart(++iNextTest, _L("CSmsClientMtm Reply"));
-	iSmsTest.Printf(_L("This test is to test Reply for bio-messages(vCalender)\n"));
-		
- 	SetSmsSettingsL();
- 
- 	iSmsTest.InstantiateClientMtmsL();
- 
- 	const TMsvId id = iEntryObserver->ItemReceived(iMsgVCalenderIndex);
-
-	if(id == KErrNotFound)
-		{
-		iSmsTest.TestFinish(iNextTest, KErrNotFound);
-		return;
-		}
- 	iSmsTest.SetEntryL(id);
- 
- 	Client().SwitchCurrentEntryL(id); // Lets point at the received message
- 	Client().LoadMessageL();
-	iSmsTest.Printf(_L("Display vCalender Message\n"));
-	iSmsTest.DisplayMessageL(id);
- 	
-	TMsvPartList part=0;
- 	CMsvOperationWait* wait = CMsvOperationWait::NewLC();
- 	// Replying the vCalender message
- 	CMsvOperation* op=Client().ReplyL(KMsvDraftEntryId, part, wait->iStatus);
- 	CleanupStack::PushL(op);
- 	wait->Start();
- 	CActiveScheduler::Start();
- 
- 	TPckgBuf<TMsvId> pkg;
- 	pkg.Copy(op->ProgressL());
- 	TMsvId progress = pkg();
- 
- 	CleanupStack::PopAndDestroy(2); //op, wait
-
-	CSmsHeader* header = iSmsTest.GetHeaderLC(progress);
-
-	// extract the replying message
-	iSmsTest.SetEntryL(progress);
-	CMsvStore* store = iSmsTest.ReadStoreL();
-	CleanupStack::PushL(store);
-	header->RestoreL(*store);
-	CleanupStack::PopAndDestroy(); //store
-
-	const CSmsBufferBase& buffer = header->Message().Buffer();
-	
-	// let's check to see if the reply message has any body in it
-	TInt bufLen=buffer.Length();
-	CleanupStack::PopAndDestroy(); //header
-	
- 	if (bufLen)
- 		{
- 		iSmsTest.Printf(_L("vCalender Reply Message having junk data\n"));
-		iSmsTest.TestFinish(iNextTest, KErrNotFound);
-		}
- 	else
-		{
- 		iSmsTest.Printf(_L("vCalender Reply Message is a Empty SMS message\n"));
-		Client().SwitchCurrentEntryL(progress);
-		Client().LoadMessageL();
-  		Client().Body().InsertL(0,_L("This is reply"));
- 		Client().SaveMessageL();
-		iSmsTest.TestFinish(iNextTest, KErrNone);
-  		}
-  	}
-
-
-void CSmsSendRecvTest::ConstructL()
-	{
-	SetTestNameL(KSmsSendRecvTestName);
-	iSmsTest.SetLogToFile();
-
-	TBuf<256> command;	
-		User::CommandLine(command);
-	
-	command.Trim();
-	iSmsTest.Printf(_L("Command Line: \"%S\" (Parse %d, Save %d, Wait %d, Bifs %d)\n"), &command, iParse, iSaveToFile, iWaitForever, iTestBifs);
-
-	iSelection = new (ELeave) CMsvEntrySelection();
-	iTimer = CTestTimer::NewL();
-	CActiveScheduler::Add(this);
-
-	iSmsTest.SetCommDbServiceCenterFromScriptL(iScriptFile);
-
-	iEntryObserver = CEntryObserver::NewL(iSmsTest, iCurrentMessageNum);
-
-	iEntryForObserver = Session().GetEntryL(KMsvGlobalInBoxIndexEntryId);
-	iEntryForObserver->AddObserverL(*iEntryObserver);
-
-	ClearLogL();
-
-	User::LeaveIfError(iSocketServ.Connect());
-	TProtocolDesc protoinfo;
-	TProtocolName protocolname(KSmsDatagram);
-	User::LeaveIfError(iSocketServ.FindProtocol(protocolname,protoinfo));
-	User::LeaveIfError(iSocket.Open(iSocketServ,protoinfo.iAddrFamily,protoinfo.iSockType,protoinfo.iProtocol));
-	
-	TSmsAddr smsaddr;
-	smsaddr.SetSmsAddrFamily(ESmsAddrSendOnly);
-	User::LeaveIfError(iSocket.Bind(smsaddr));
-	}
-
-void CSmsSendRecvTest::ShowMenuL()
-	{
-	iSmsTest.ResetMenu();
-
-	iSmsTest.AppendToMenuL(_L("Start"));
-	iSmsTest.AppendToMenuL(_L("Display Log"));
-	iSmsTest.AppendToMenuL(_L("Clear Log"));
-	iSmsTest.AppendToMenuL(_L("Navigate Message Store"));
-
-	TInt result = iSmsTest.DisplayMenu(_L("SMS Send Receive Test"));
-
-	if (result <= 0)
-		return;
-
-	switch (result)
-		{
-		case 1:
-			RunAutoL();
-			return;
-		case 2:
-			DisplayLogL();
-			break;
-		case 3:
-			ClearLogL();
-			break;
-		case 4:
-			iSmsTest.NavigateMessageStoreL();
-			break;
-		default:
-			User::Leave(KErrArgument);
-			break;
-		}
-
-	ShowMenuL();
-	}
-
-void CSmsSendRecvTest::RunComplete()
-	{
-	if (!IsActive())
-		CActiveScheduler::Stop();
-	}
-
-void CSmsSendRecvTest::RunL()
-/**
-	Handles completed async operations
- */
-	{
-	switch (iState)
-		{
-		case EStateSending:
-			{
-			DoRunSendingL();
-			delete iOperation;
-			iOperation = NULL;
-			break;
-			}
-		case EStateWaitingToReceive:
-			{
-			DoRunWaitingToReceiveL();
-			break;
-			}
-		case EStateWaitingToReceiveAnyExtra:
-			{
-			DoRunWaitForExtraL();
-			break;
-			}
-		case EStateMessageReceived:
-			{
-			TestParseL();
-			break;
-			}
-		case EStateParsing:
-			{
-			DoRunTestParseL();
-			break;
-			}
-		default:
-			{
-			break;
-			}
-		}
-
-	RunComplete();
-	}
-
-TInt CSmsSendRecvTest::RunError(TInt aError)
-	{
-	aError = CSmsTestBase::RunError(aError);
-	RunComplete();
-	return aError;
-	}
-
-void CSmsSendRecvTest::DoRunTestParseL()
-/**
-	Checks status
- */
-	{
-	TBioProgress progress;
-	TBioProgressBuf progressBuf;
-	progressBuf.Copy(iOperation->ProgressL());
-	progress = progressBuf();
-
-	if (iStatus == KErrNone)
-		iStatus = progress.iErrorCode;
-
-	delete iOperation;
-	iOperation = NULL;
-	}
-
-void CSmsSendRecvTest::TestParseL()
-/**
-	Parses BIO messages
- */
-	{
-	const TMsvId id = iEntryObserver->LastReceived();
-
-	iSmsTest.SetEntryL(id);
-
-	if (iSaveToFile)
-		{
-		iSmsTest.Printf(_L("\tSaving BIO message to file\n"));
-		iSmsTest.SaveBodyToFileL(id);
-		}
-
-	if (!iParse)
-		return;
-
-	if (!iSmsTest.Entry().iBioType)
-		return;
-
-	iState = EStateParsing;
-	
-	iSmsTest.Printf(_L("Parsing BIO message\n"));
-
-	CMsvEntrySelection* sel = new (ELeave) CMsvEntrySelection();
-	CleanupStack::PushL(sel);
-
-	sel->AppendL(id);
-
-	delete iOperation;
-	iOperation = NULL;
-	
-	iOperation = Session().TransferCommandL(*sel, KBiosMtmParse, KNullDesC8, iStatus);
-	SetActive();
-
-	CleanupStack::PopAndDestroy(sel);
-	}
-
-void CSmsSendRecvTest::DoCancel()
-	{
-	if (iOperation)
-		{
-		iOperation->Cancel();
-		iSmsTest.Printf(_L("Operation Cancelled!\n"));
-		}
-	delete iOperation;
-	iOperation = NULL;
-	}
-
-void CSmsSendRecvTest::DoRunSendingL()
-/**
-	Checks the status and displays the sending states
- */
-	{
-	if (iOperation)
-		iSmsTest.SetProgressL(*iOperation);
-
-	TInt count = iSelection->Count();
-	TBool wait = EFalse;
-
-	while (iStatus == KErrNone && count--)
-		{
-		TRAPD(err, iSmsTest.SetEntryL(iSelection->At(count)));
-
-		if (err == KErrNone)
-			{
-			TMsvEntry entry = MsvEntry().Entry();
-			iSmsTest.SetEntryL(KMsvGlobalOutBoxIndexEntryId);
-
-			TBuf<0x100> output;
-			TBuf<0x50>  nowBuf;
-
-			switch (entry.SendingState())
-				{
-				case KMsvSendStateSending:
-					output.AppendFormat(_L("Message %d Sending with error %d\n"), entry.Id(), entry.iError);
-					wait = ETrue;
-					break;
-				case KMsvSendStateResend:
-					output.AppendFormat(_L("Message %d Resend with error %d at "), entry.Id(), entry.iError);
-					entry.iDate.FormatL(nowBuf, _L("%-B%:0%J%:1%T%:2%S%:3%+B"));
-					output.Append(nowBuf);
-					output.Append(_L("\n"));
-					wait = ETrue;
-					break;
-				case KMsvSendStateScheduled:
-					output.AppendFormat(_L("Message %d Scheduled at "), entry.Id());					entry.iDate.FormatL(nowBuf, _L("%-B%:0%J%:1%T%:2%S%:3%+B"));
-					entry.iDate.FormatL(nowBuf, _L("%-B%:0%J%:1%T%:2%S%:3%+B"));
-					output.Append(nowBuf);
-					output.Append(_L("\n"));
-					wait = ETrue;
-					break;
-				case KMsvSendStateFailed:
-					output.AppendFormat(_L("Message %d Failed with error %d\n"), entry.Id(), entry.iError);
-					if (entry.iError)
-						iStatus = entry.iError;
-					else
-						iStatus = KErrGeneral;
-
-					break;
-				case KMsvSendStateWaiting:
-					output.AppendFormat(_L("Message %d Waiting with error %d\n"), entry.Id(), entry.iError);
-					wait = ETrue;
-					break;
-				case KMsvSendStateSent:
-				default:
-					break;
-					//nothing
-				}
-
-			iSmsTest.Printf(output);
-			}
-		}
-
-	if (wait)
-		{
-		iTimer->AfterReq(10000000, iStatus);
-		SetActive();
-		iState = EStateSending;
-//		CActiveScheduler::Start();
-		}
-	else
-		{
-		iSmsTest.Printf(_L("Sending completed with %d\n"), iStatus);
-		
-		if (iStatus == KErrNone)
-			{
-			TestWaitForReceiveL();
-			}
-		else
-			{
-			iState = EStateWaiting;
-			}
-		}
-	}
-
-void CSmsSendRecvTest::WaitForExtraL()
-/**
-	Waits for any extra messages to arrive 
- */
-	{
-	iSmsTest.Printf(_L("Waiting for any extra to arrive...\n"));
-	iWaitForever = EFalse;
-	iCountWaits = 0;
-	iState = EStateWaitingToReceiveAnyExtra;
-	TRequestStatus* status = &iStatus;
-	User::RequestComplete(status, KErrNone);
-	SetActive();
-	CActiveScheduler::Start();
-	}
-
-void CSmsSendRecvTest::DoRunWaitForExtraL()
-/**
-	Checks if it has received all messages sent
- */
-	{
-	iCountWaits++;
-
-	TInt recvCount = iEntryObserver->Count();
-
-	if (recvCount > iSent)
-		{
-		iSmsTest.Printf(_L("Too many messages received:\nSent %d Rcvd %d\n"), iSent, recvCount);
-		iStatus = KErrOverflow;
-		}
-	else
-		DoWaitL();
-	}
-
-void CSmsSendRecvTest::DoRunWaitingToReceiveL()
-/**
-	Checks if it has received all messages sent
- */
-	{
-	iCountWaits++;
-
-	const TInt recvCount = iEntryObserver->Count();
-
-	if (recvCount == iSent)
-		{
-		//Message received
-		if (!iSmsTest.AreMessagesSameTextL((*iSelection)[iCurrentMessageNum], iEntryObserver->Received(iSent - 1), ETrue))
-			{
-			//Do something?
-			}
-		}
-
-	if (recvCount > iSent)
-		{
-		iSmsTest.Printf(_L("Too many messages received:\nSent %d Rcvd %d\n"), iSent, recvCount);
-		iStatus = KErrOverflow;
-		}
-	else 
-		{
-		if (iTotal == recvCount || recvCount == iSent)
-			{
-			if (iTotal == recvCount)
-				iSmsTest.Printf(_L("All Messages Received!!\n"));
-
-			//Message received
-			iState = EStateMessageReceived;
-			iCountWaits = 0;
-			TRequestStatus* status = &iStatus;
-			User::RequestComplete(status, KErrNone);
-			SetActive();
-			}
-		else
-			{
-			DoWaitL();
-			}
-		}
-	}
-	
-void CSmsSendRecvTest::DoWaitL()
-/**
-	Waits to receive the messages sent
- */
-	{
-	TInt recvCount = iEntryObserver->Count();
-	
-	TInt maxCount = KMaxWaitForMsg.Int() / KWaitForReceiveIteration.Int();
-	TInt waitSecs = KWaitForReceiveIteration.Int() * (maxCount - iCountWaits) / 1000000;
-	
-	if (iWaitForever && iCountWaits <= 1)
-		{
-		iSmsTest.Printf(_L("Waiting forever to recv msg\n"));
-		}
-	else if (!iWaitForever)
-		{
-		iSmsTest.Printf(_L("Waiting %d secs to recv msg\n"), waitSecs);
-		}
-	
-	if (iWaitForever || iCountWaits < maxCount)
-		{
-		iTimer->AfterReq(KWaitForReceiveIteration, iStatus);
-		SetActive();
-		}
-	else
-		{
-		if (iSent != recvCount)
-			{
-			iSmsTest.Printf(_L("Time Out: Message NOT Received\n"));
-			iStatus = KErrTimedOut;
-			}
-		}
-	}
-	
-void CSmsSendRecvTest::TestBifsL()
-/**
-	todo Comments
- */
-	{
-	iSmsTest.Printf(_L("Remove 2 Bifs if already exist\n"));	
-	TestRemoveBifL(KTestBif1);
-	TestRemoveBifL(KTestBif2);
-	
-	//Test add bif
-	iSmsTest.Printf(_L("Test Add 2 Bifs\n"));	
-	TestAddBifL(KTestBif1);
-	TestAddBifL(KTestBif2);
-
-	//Test remove bif
-	iSmsTest.Printf(_L("Test Remove 2 Bifs\n"));	
-	TestRemoveBifL(KTestBif1);
-	TestRemoveBifL(KTestBif2);
-
-	//Test change bif
-	iSmsTest.Printf(_L("Test Change 2 Bifs\n"));	
-	TestAddBifL(KTestBif1);
-	TestAddBifL(KTestBif2);
-	TestAddBifL(KTestBif1);
-	TestAddBifL(KTestBif2);
-
-	//Test remove bif
-	iSmsTest.Printf(_L("Test Remove 2 Bifs\n"));	
-	TestRemoveBifL(KTestBif1);
-	TestRemoveBifL(KTestBif2);
-	}
-
-void CSmsSendRecvTest::TestAddBifL(const TDesC& aBifName)
-/**
-	Comments
- */
-	{
-	iSmsTest.Printf(_L("\tAdd BIF: %S\n"), &aBifName);	
-	
-	RFs& fs = iSmsTest.FileSession();
-	TInt err = fs.MkDir(KBifDir);
-
-	if (err != KErrAlreadyExists)
-		User::LeaveIfError(err);
-
-	TParse fileOut;
-	err = iSmsTest.ResolveFile(KSmsComponent, aBifName, fileOut);
-
-	if (err)
-		{
-		iSmsTest.Printf(_L("Test BIF %S not found! Continuing without this test\n"), &aBifName);
-		return;
-		}
-
-	CFileMan* fileMan = CFileMan::NewL(fs);
-	CleanupStack::PushL(fileMan);
-
-	err = fileMan->Copy(fileOut.FullName(), KBifDir);
-
-	if (err != KErrAlreadyExists)
-		User::LeaveIfError(err);
-
-	CleanupStack::PopAndDestroy(fileMan);
-
-	User::After(KBifWait);
-	}
-
-void CSmsSendRecvTest::TestRemoveBifL(const TDesC& aBifName)
-/**
-	todo Comments
- */
-	{
-	iSmsTest.Printf(_L("\tRemove Bif: %S\n"), &aBifName);	
-
-	RFs& fs = iSmsTest.FileSession();
-	TFileName fileName(KBifDir);
-	fileName.Append(aBifName);
-
-	TInt err = fs.Delete(fileName);
-
-	if (err)
-		{
-		iSmsTest.Printf(_L("\t\tfs.Delete() returned %d\n"), err);	
-		
-		if (err != KErrNotFound && err != KErrPathNotFound)
-			User::Leave(err);
-		}
-
-	User::After(KBifWait);
-	}
-
--- a/messagingappbase/smsmtm/test/src/T_SmsSendText.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,443 +0,0 @@
-// Copyright (c) 1999-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 "T_SmsSendText.h"
-#include <smuthdr.h>
-#include <txtrich.h>
-
-#include <testconfigfileparser.h>
-#include <simtsy.h>
-#include <smsuaddr.h>
-#include <e32property.h>
-#include <msvtestutils.h>
-RTest test(_L("T_SmsSendText Testrig"));
-CTrapCleanup* theCleanup;
-
-CSmsSendTextTest::~CSmsSendTextTest()
-/**
-	destructor
- */
-	{
-          //	delete iTextSession;
-	}
-
-void CSmsSendTextTest::TestSendingL()
-/**
-	Tests Sending
- */
-	{
-	DoTestSendingL(iScriptFile);
-	}
-
-void SetTestNumberL(TInt aTestNumber)
-  	{
-  	test.Printf(_L("Changing the Test Number to %d\n"), aTestNumber);
-	TInt testState;
-	TInt error = RProperty::Get(KUidSystemCategory, KUidSASimTsyTestNumberValue, testState);
-	if(KErrNone != error)
-		{
-		User::LeaveIfError(RProperty::Define(KUidSystemCategory, KUidSASimTsyTestNumberValue, RProperty::EInt));
-		}
-	User::LeaveIfError(RProperty::Set(KUidSystemCategory, KUidSASimTsyTestNumberValue, aTestNumber));
-  	}
-
-void CSmsSendTextTest::RunAutoL()
-/**
-	Runs tests in sequence, checks iStatus
- */
-	{
-	SetTestNumberL(0);
-
-	iSmsTest.TestStart(++iNextTest);
-	TestSendNoRecipientsL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	CSmsSendTestBase::RunAutoL();
-	}
-
-void CSmsSendTextTest::RunL()
-/**
-	Handles completed async operations
- */
-	{
-	if (iOperation)
-		iSmsTest.SetProgressL(*iOperation);
-
-	switch (iSendTextTestState)
-		{
-		case EStateSendNoRecipients:
-			DoRunSendNoRecipientsL();
-			break;
-		default:
-			CSmsSendTestBase::RunL();
-			break;
-		}
-	}
-
-void CSmsSendTextTest::TestSendNoRecipientsL()
-/**
-	Tests sending with no receipients.
-	The error -1 (KErrNotFound) is expected.
- */
-	{
-	iState = EStateOther;
-	iSendTextTestState = EStateSendNoRecipients;
-
-	iSmsTest.Test().Next(_L("Sending No Recipients"));
-
-	iSmsTest.DeleteSmsMessagesL(KMsvGlobalOutBoxIndexEntryId);
-
-	TTime now;
-	now.HomeTime();
-	now += (TTimeIntervalSeconds) 5;
-
-	iSelection->Reset();
-
-	TBool read = EFalse;
-	TRAPD(err, read = iSmsTest.ReadScriptL(iScriptFile, KMsvGlobalOutBoxIndexEntryId, *iSelection, now));
-
-	iSmsTest.Test()(!err && read);
-
-
-	//Remove Recipients
-	TInt count = iSelection->Count();
-
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iSmsTest.iRichText);
-	CleanupStack::PushL(header);
-
-	while (count--)
-		{
-		iSmsTest.SetEntryL(iSelection->At(count));
-		CMsvStore* store = iSmsTest.EditStoreL();
-		CleanupStack::PushL(store);
-
-		header->RestoreL(*store);
-
-		header->Recipients().ResetAndDestroy();
-
-		header->StoreL(*store);
-		store->CommitL();
-
-		CleanupStack::PopAndDestroy(); //store
-		}
-
-	CleanupStack::PopAndDestroy(); //header
-
-	iSmsTest.SetEntryL(KMsvGlobalOutBoxIndexEntryId);
-
-	delete iOperation;
-	iOperation = NULL;
-	iOperation = MsvEntry().CopyL(*iSelection, iSmsTest.iSmsServiceId, iStatus);
-		
-	SetActive();
-	CActiveScheduler::Start();
-	}
-
-void CSmsSendTextTest::DoRunSendNoRecipientsL()
-/**
-	Checks the status and error.
-	The error -1 (KErrNotFound) is expected
- */
-	{
-	CActiveScheduler::Stop();
-
-	TSmsProgress prog = iSmsTest.iProgress;
-
-	test(prog.iError == KErrNone || iStatus.Int() == KErrNone);
-	iStatus = KErrNone;
-
-	TInt error = KErrNone;
-
-	iSmsTest.DisplaySendingStatesL(*iSelection);
-	test(iSmsTest.SendingCompleteL(*iSelection, error));
-	test(error == KErrNotFound);
-
-	iState = CSmsSendTestBase::EStateWaiting;
-	iSendTextTestState = EStateWaiting;
-
-	delete iOperation;
-	iOperation = NULL;
-	}
-
-void CSmsSendTextTest::TestSchedulingL()
-/**
-	Tests schedule sending
- */
-	{
-	DoTestSchedulingL(iScriptFile);
-	}
-
-
-CSmsSendTextTest::CSmsSendTextTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest)
-: CSmsSendTestBase(aSmsTest, aScriptFile, aCurrentTest)
-/**
-	Constructor
- */
-	{
-	}
-
-LOCAL_C void doMainL()
-	{
-	// Copying the config file to the root directory
-
-	_LIT(KFileName,"config.txt");
-	_LIT(KFileName2,"\\msgtest\\sms\\sms.script");
-	
-	RFs fs;
-	User::LeaveIfError(fs.Connect());
-	CleanupClosePushL(fs);
-
-	fs.SetSessionPath(_L("c:\\"));
-	fs.Delete(KFileName);					//< Ignore Error
-
-	CFileMan* fileMan = CFileMan::NewL(fs);
-	CleanupStack::PushL(fileMan);
-
-	User::LeaveIfError(fileMan->Copy(KFileName2, KFileName));
-
-	CleanupStack::PopAndDestroy(fileMan);
-	CleanupStack::PopAndDestroy(&fs);
-
-	// Open the socket server
-
-	RSocketServ serv;
-	RSocket socket;
-
-	User::LeaveIfError(serv.Connect());
-	CleanupClosePushL(serv);
-	
-	TProtocolDesc protoinfo;
-	TProtocolName protocolname(KSmsDatagram);
-	User::LeaveIfError(serv.FindProtocol(protocolname,protoinfo));
-	User::LeaveIfError(socket.Open(serv,protoinfo.iAddrFamily,protoinfo.iSockType,protoinfo.iProtocol));
-
-	TSmsAddr smsaddr;
-	smsaddr.SetSmsAddrFamily(ESmsAddrSendOnly);
-	User::LeaveIfError(socket.Bind(smsaddr));
-
-	CleanupClosePushL(socket);
-
-	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
-	CleanupStack::PushL(scheduler);
-	CActiveScheduler::Install( scheduler );
-
-	CSmsTestUtils* smsTest = CSmsTestUtils::NewL(test);
-	CleanupStack::PushL(smsTest);
-	TInt nextTest = 0;
-
-	smsTest->NotifySaPhoneOnL();
-	smsTest->WaitForInitializeL();
-
-	CSmsSendTextTest* textTest = CSmsSendTextTest::NewL(*smsTest, KSmsScript, nextTest);
-	CleanupStack::PushL(textTest);
-
-	textTest->StartL();
-
-	CleanupStack::PopAndDestroy(3); //SmsTest, scheduler, textTest
-
-	CleanupStack::PopAndDestroy(&socket);
-	CleanupStack::PopAndDestroy(&serv);
-	}
-
-GLDEF_C TInt E32Main()
-	{	
-	__UHEAP_MARK;
-	test.Start(_L("Setup"));
-	theCleanup = CTrapCleanup::New();
-	TRAPD(ret,doMainL());		
-	test(ret==KErrNone);
-	delete theCleanup;	
-	test.Console()->SetPos(0, 13);
-	test.End();
-	test.Close();
-	__UHEAP_MARKEND;
-	return(KErrNone);
-	}
-
-CSmsSendTextTest* CSmsSendTextTest::NewL(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest)
-	{
-	CSmsSendTextTest* self = new (ELeave) CSmsSendTextTest(aSmsTest, aScriptFile, aCurrentTest);
-	CleanupStack::PushL(self);
-
-	self->ConstructL();
-
-	CleanupStack::Pop();
-	return self;
-	}
-
-/*void CSmsSendTextTest::TestSendWithDataCallL()
-	{
-	TestConnectingL();
-	DoTestSendingL(KSmsScript);
-
-	iTextSession->Disconnect();
-	WaitForEndOfDataCallL();
-	test.Printf(_L("  Waiting 10s\n"));
-	User::After(10000000);
-	delete iTextSession;
-	iTextSession = NULL;
-	}
-
-
- void CSmsSendTextTest::WaitForEndOfDataCallL()
-	{
-	// Connect to etel
-	RTelServer etel;
-	User::LeaveIfError(etel.Connect());
-	CleanupClosePushL(etel);
-
-	// Get tsy name
-	TName tsy;
-	FaxUtils::GetTsyNameL(tsy);
-
-	// Load the TSY
-	User::LeaveIfError(etel.LoadPhoneModule(tsy));
-
-	// Get phone for the TSY
-	RTelServer::TPhoneInfo info;
-	test(FaxUtils::GetPhoneInfoForTsyL(etel, tsy, info));
-
-	// Load the phone
-	RPhone phone;
-	User::LeaveIfError(phone.Open(etel, info.iName));
-	CleanupClosePushL(phone);
-
-	// Get data line info
-	RPhone::TLineInfo data;
-	test(GetDataLineInfoForPhoneL(phone, data));
-
-	// Open the phone line
-	RLine line;
-	User::LeaveIfError(line.Open(phone, data.iName));
-	CleanupClosePushL(line);
-
-	// Get line hook status
-	RCall::THookStatus hook;
-	User::LeaveIfError(line.GetHookStatus(hook));
-
-	// Wait until the line is on hook
-	if (hook == RCall::EHookStatusOff)
-		{
-		test.Printf(_L("  Waiting for data call to end\n"));
-		TRequestStatus status;
-		line.NotifyHookChange(status, hook);
-		User::WaitForRequest(status);
-		}
-
-	// Unload everything
-	CleanupStack::PopAndDestroy(2); // line, phone
-	User::LeaveIfError(etel.UnloadPhoneModule(tsy));
-	CleanupStack::PopAndDestroy(); // etel
-	}
-
-void CSmsSendTextTest::TestConnectingL()
-	{
-	// Create a waiter
-	CMsvOperationWait* wait = CMsvOperationWait::NewLC();
-
-	// Create text sever session
-	iTextSession = CImTextServerSession::NewL();
-
-	// Create a timer
-	CTestTimer* timer = CTestTimer::NewL();
-	CleanupStack::PushL(timer);
-
-	// Connect to the internet
-	const TInt maxCount = 5;
-	TInt count = maxCount;
-
-	CImIAPPreferences* pref = CImIAPPreferences::NewLC();
-
-	do
-		{
-		test.Printf(_L("  Connecting to the internet (attempt %d of %d, last error %d)\n"), maxCount - count + 1, maxCount, wait->iStatus.Int());
-		iTextSession->QueueConnectL(wait->iStatus,_L("pop3.demon.co.uk"), 110, *pref);
-		wait->Start();
-		CActiveScheduler::Start();
-		} while (wait->iStatus != KErrNone && count--);
-
-	CleanupStack::PopAndDestroy(pref);
-
-	// Receive stuff
-	while (wait->iStatus == KErrNone)
-		{
-		// Receive some text
-		test.Printf(_L("  Receiving data\n"));
-		iTextSession->QueueReceiveNextTextLine(wait->iStatus);
-		wait->Start();
-
-		// Start a timer - so we give up eventually - 10s
-		timer->After(10000000);
-		CActiveScheduler::Start();
-
-		// Did the timer complete?
-		if (!timer->IsActive())
-			{
-			// Cancel the outstanding request
-			iTextSession->Cancel();
-			CActiveScheduler::Start();
-			}
-		else
-			{
-			// Get the data
-			timer->Cancel();
-			TBuf8<1020> textLineNarrow;
-			TBuf<1024> textLineWide;
-			iTextSession->GetCurrentTextLine(textLineNarrow);
-			textLineWide.Copy(textLineNarrow);
-
-			// Make it look nice!
-			if (textLineWide.Length() > 0)
-				{
-				textLineWide.Insert(0, _L("  "));
-				textLineWide.Append(_L("\n"));
-				test.Printf(textLineWide);
-				}
-			}
-		}
-	
-	// Tidy up
-	test(wait->iStatus == KErrNone || wait->iStatus == KErrCancel);
-	CleanupStack::PopAndDestroy(2); // timer, wait
-	}
-
-
-
-TBool CSmsSendTextTest::GetDataLineInfoForPhoneL(RPhone& aPhone, RPhone::TLineInfo& aLineInfo)
-	{
-	// Get number of lines
-	TInt line;
-	User::LeaveIfError(aPhone.EnumerateLines(line));
-
-	// Iterate through all the lines
-	while(line--)
-		{
-		// Get line info
-		RPhone::TLineInfo lineInfo;
-		User::LeaveIfError(aPhone.GetLineInfo(line, lineInfo));
-
-		// Does it support fax?
-		if ((lineInfo.iLineCapsFlags & RLine::KCapsData) != 0)
-			{
-			aLineInfo = lineInfo;
-			break;
-			}
-		}
-
-	// Did we find a fax line on the phone?
-	return line >= 0;
-	}
-*/
--- a/messagingappbase/smsmtm/test/src/T_SmsSendWap.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,160 +0,0 @@
-// Copyright (c) 1999-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 "T_SmsSendWap.h"
-#include <smsuaddr.h>
-
-RTest test(_L("T_SmsSendWap Testrig"));
-CTrapCleanup* theCleanup;
-
-
-void CSmsSendWapTest::TestSendingL()
-/**
-	Tests Sending
- */
-	{
-	DoTestSendingL(iScriptFile);
-	}
-
-void CSmsSendWapTest::TestSchedulingL()
-/**
-	Tests schedule sending
- */
-	{
-//	DoTestSchedulingL(KWapScript);
-	}
-
-void CSmsSendWapTest::ConstructL()
-	{
-	CSmsSendTestBase::ConstructL();
-	iSmsTest.SetCommDbServiceCenterFromScriptL(KWapScript);
-	}
-
-
-CSmsSendWapTest::CSmsSendWapTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest)
-: CSmsSendTestBase(aSmsTest, aScriptFile, aCurrentTest)
-	{
-	}
-
-LOCAL_C void doMainL()
-	{
-	RSocketServ serv;
-	RSocket socket;
-
-	User::LeaveIfError(serv.Connect());
-	CleanupClosePushL(serv);
-	
-	TProtocolDesc protoinfo;
-	TProtocolName protocolname(KSmsDatagram);
-	User::LeaveIfError(serv.FindProtocol(protocolname,protoinfo));
-	User::LeaveIfError(socket.Open(serv,protoinfo.iAddrFamily,protoinfo.iSockType,protoinfo.iProtocol));
-
-	TSmsAddr smsaddr;
-	smsaddr.SetSmsAddrFamily(ESmsAddrSendOnly);
-	User::LeaveIfError(socket.Bind(smsaddr));
-
-	CleanupClosePushL(socket);
-	
-	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
-	CleanupStack::PushL(scheduler);
-	CActiveScheduler::Install( scheduler );
-
-	CSmsTestUtils* smsTest = CSmsTestUtils::NewL(test);
-	CleanupStack::PushL(smsTest);
-	TInt nextTest = 0;
-
-	smsTest->NotifySaPhoneOnL();
-	smsTest->WaitForInitializeL();
-
-	CSmsSendWapTest* wapTest = CSmsSendWapTest::NewL(*smsTest, KWapScript, nextTest);
-	CleanupStack::PushL(wapTest);
-
-	wapTest->StartL();
-
-	CleanupStack::PopAndDestroy(3); //SmsTest, scheduler, wapTest
-	
-	CleanupStack::PopAndDestroy(&socket);
-	CleanupStack::PopAndDestroy(&serv);
-	}
-
-GLDEF_C TInt E32Main()
-	{	
-	__UHEAP_MARK;
-	test.Start(_L("Setup"));
-	theCleanup = CTrapCleanup::New();
-	TRAPD(ret,doMainL());		
-	test(ret==KErrNone);
-	delete theCleanup;	
-	test.Console()->SetPos(0, 13);
-	test.End();
-	test.Close();
-	__UHEAP_MARKEND;
-	return(KErrNone);
-	}
-
-CSmsSendWapTest* CSmsSendWapTest::NewL(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aCurrentTest)
-	{
-	CSmsSendWapTest* self = new (ELeave) CSmsSendWapTest(aSmsTest, aScriptFile, aCurrentTest);
-	CleanupStack::PushL(self);
-
-	self->ConstructL();
-
-	CleanupStack::Pop();
-	return self;
-	}
-
-void CSmsSendWapTest::DoRunSendingL()
-/**
-	Checks status. 
-	The message is rescheduled if sending failed.
- */
-	{
-	if (iStatus == KErrNone)
-		iStatus = iSmsTest.iProgress.iError;
-
-	iSmsTest.Printf(_L("WAP sending completed with error %d\n"), iStatus.Int());
-
-	iState = EStateWaiting;
-	TInt err = KErrNone;
-
-	if (!iSmsTest.SendingCompleteL(*iSelection, err))
-		{
-		iSmsTest.Printf(_L("Waiting for all messages to send or fail\n"), iStatus);
-		iStatus = KRequestPending;
-		SetActive();
-		iState = EStateSchedulingThenSend;
-		}
-	else
-		{
-		CActiveScheduler::Stop();
-
-		iStatus = err;
-		iSmsTest.Printf(_L("Sending completed with error %d\n"), iStatus);
-
-		if (iStatus == KErrNone)
-			{
-			TTimeIntervalMicroSeconds32 wait = KWaitForMsgToSend.Int() * iSelection->Count();
-			iSmsTest.Printf(_L("Waiting %d seconds for sending to complete\nGo have a cup of tea. You deserve a break!\n"), wait.Int() / 1000000);
-			User::After(wait);
-			}
-
-		if (!iSmsTest.RunAuto())
-			{
-			iSmsTest.Test().Printf(_L("\nPress any key to continue...\n"));
-			iSmsTest.Test().Getch();
-			}
-		}
-	}
-
--- a/messagingappbase/smsmtm/test/src/T_smcm.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,869 +0,0 @@
-// Copyright (c) 2000-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 "T_smcm.h"
-#include <e32math.h>
-#include <csmsemailfields.h>
-#include <emstestutils.h>
-#include <emsformatie.h>
-#include <emspictureie.h>
-#include <csmsaccount.h>
-
-GLDEF_C TInt E32Main()
-	{	
-	__UHEAP_MARK;
-	test.Start(_L("Setup"));
-	theCleanup = CTrapCleanup::New();
-	TRAPD(ret,doMainL());		
-	test(ret==KErrNone);
-	delete theCleanup;	
-	test.Console()->SetPos(0, 13);
-	test.End();
-	test.Close();
-	__UHEAP_MARKEND;
-	return(KErrNone);
-	}
-
-LOCAL_C void doMainL()
-	{
-	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
-	CleanupStack::PushL(scheduler);
-	CActiveScheduler::Install(scheduler);
-
-	CSmsTestUtils* smsTest = CSmsTestUtils::NewL(test);
-	CleanupStack::PushL(smsTest);
-	TInt nextTest = 0;
-	
-	CSmcmTest* SmcmTest = CSmcmTest::NewLC(*smsTest, KNullDesC, nextTest);
-
-	SmcmTest->StartL();
-
-	CleanupStack::PopAndDestroy(3); //SmcmTest. scheduler
-
-	}
-
-CSmcmTest::CSmcmTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest)
-: CSmsTestBase(aSmsTest, aScriptFile, aNextTest)
-	{
-	}
-
-void CSmcmTest::RunAutoL()
-	{
-	iSmsTest.TestStart(++iNextTest, _L("CSmsSettings"));
-	TestSettingsL();
-	iSmsTest.TestFinish(iNextTest);
-
-	iSmsTest.TestStart(++iNextTest, _L("CSmsClientMtm Capabilities"));
-	TestCapabilitiesL();
-	iSmsTest.TestFinish(iNextTest);
-
-	iSmsTest.TestStart(++iNextTest, _L("CSmsClientMtm Global Find"));
-	TestFindL();
-	iSmsTest.TestFinish(iNextTest);
-
-	iSmsTest.TestStart(++iNextTest, _L("CSmsClientMtm Find Alias"));
-	TestFindAliasL();
-	iSmsTest.TestFinish(iNextTest);
-
-	iSmsTest.TestStart(++iNextTest, _L("CSmsClientMtm Reply"));
-	TestReplyL();
-	TestReplyEmailL();
-	iSmsTest.TestFinish(iNextTest);
-
-	iSmsTest.TestStart(++iNextTest, _L("CSmsClientMtm Forward"));
-	TestForwardL();
-	TestForwardEmailL();
-	iSmsTest.TestFinish(iNextTest);
-
-	iSmsTest.TestStart(++iNextTest, _L("CSmsClientMtm Async Functions"));
-// There are no async function in sms client mtm
-	iSmsTest.TestFinish(iNextTest);
-
-	iSmsTest.TestStart(++iNextTest, _L("CSmsClientMtm Sync Functions"));
-	TestSyncFunctionsL();
-	iSmsTest.TestFinish(iNextTest);
-	}
-
-CSmcmTest::~CSmcmTest()
-	{
-	delete iSmsHeader;
-	delete iRichText;
-	delete iParaLayer;
-	delete iCharLayer;
-	}
-
-void CSmcmTest::ConstructL()
-	{
-	iSmsTest.SetLogToFile();				// Lets log to a file
-	iSmsTest.InstantiateClientMtmsL();
-
-	iSelection = new (ELeave) CMsvEntrySelection();
-	iTimer = CTestTimer::NewL();
-
-	iParaLayer =CParaFormatLayer::NewL();	// Rich Text for the body part of the message
-	iCharLayer = CCharFormatLayer::NewL();
-	iRichText = CRichText::NewL(iParaLayer, iCharLayer, CEditableText::EFlatStorage,256);
-
-	CActiveScheduler::Add(this);
-	}
-
-CSmcmTest* CSmcmTest::NewLC(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest)
-	{
-	CSmcmTest* self = new (ELeave) CSmcmTest(aSmsTest, aScriptFile, aNextTest);
-	CleanupStack::PushL(self);
-
-	self->ConstructL();
-	return self;
-	}
-
-void CSmcmTest::ShowMenuL()
-	{
-	iSmsTest.ResetMenu();
-
-	iSmsTest.AppendToMenuL(_L("Start"));
-
-	TInt result = iSmsTest.DisplayMenu(_L("SMS Client MTM Test"));
-
-	if (result <= 0)
-		return;
-
-	switch (result)
-		{
-		case 1:
-			RunAutoL();
-			break;
-		default:
-			User::Leave(KErrArgument);
-			break;
-		}
-
-	if (!iSmsTest.RunAuto())
-		{
-		iSmsTest.Printf(_L("Press any key to continue...\n"));
-		iSmsTest.Test().Getch();
-		}
-
-	ShowMenuL();
-	}
-
-void CSmcmTest::TestSettingsL()
-	{
-	iSmsTest.Printf(_L("Testing Create Settings...\n"));
-	MsvEntry().SetEntryL(iSmsTest.iSmsServiceId);
-
-// Lets create sms settings (just in case it does not exist yet)
-
-	CSmsSettings* settings = CSmsSettings::NewL();
-	CleanupStack::PushL(settings);
-	CSmsAccount* account = CSmsAccount::NewLC();
-	account->InitialiseDefaultSettingsL(*settings);
-	settings->AddServiceCenterL(_L("Radiolinja0"),_L("+358508771010"));
-	settings->AddServiceCenterL(_L("Radiolinja1"),_L("+358508771010"));
-	settings->AddServiceCenterL(_L("Nokia"),_L("+358454400050"));
-	settings->SetDefaultServiceCenter(2);
-	iSmsTest(settings->DefaultServiceCenter()==2);
-	settings->SetValidityPeriod(ESmsVPWeek);
-	settings->SetReplyQuoted(ETrue);
-	settings->SetRejectDuplicate(ETrue);
-	settings->SetDelivery(ESmsDeliveryImmediately);
-	settings->SetDeliveryReport(ETrue);
-	settings->SetReplyPath(EFalse);
-	settings->SetMessageConversion(ESmsConvPIDNone);
-	settings->SetCanConcatenate(ETrue);
-	settings->SetCharacterSet(TSmsDataCodingScheme::ESmsAlphabet8Bit);
-	settings->SetValidityPeriodFormat(TSmsFirstOctet::ESmsVPFSemiOctet);
-	settings->SetStatusReportHandling(CSmsSettings::EMoveReportToInboxVisible);
-	settings->SetSpecialMessageHandling(CSmsSettings::EMoveReportToInboxVisible);
-
-	account->SaveSettingsL(*settings);
-	CleanupStack::PopAndDestroy(account);
-
-	iSmsTest.iServiceSettings->CopyL(*settings);
-	CleanupStack::PopAndDestroy(settings); 
-	}
-
-// Now we shall test the recipient handling, find and validate features
-
-void CSmcmTest::TestFindL()
-	{
-	iSmsTest.Test().Next(_L("Testing CSmsClientMtm Global Find"));
-
-// Before testing the find and validate we need a dummy message to play with
-
-	TMsvPartList partList;
-	TMsvId id = iSmsTest.CreateDummyMessageToSendL();
-	Client().SwitchCurrentEntryL(id);
-
-// Lets load the message we just created
-	Client().LoadMessageL();
-
-// And add some recipients
-	Client().AddAddresseeL(_L("+358503367709"), _L("Mico3"));
-	Client().AddAddresseeL(_L("+358503367709"), _L("Mico4"));
-	Client().AddAddresseeL(_L("//\\"), _L("\n"));
-	Client().AddAddresseeL(_L("\n0"), _L("^"));
-	Client().AddAddresseeL(_L("1234"), _L("~¨"));
-	Client().AddAddresseeL(_L("äöåÖÅÖÖ¤"), _L("fdsa4324521{[]}"));
-	Client().AddAddresseeL(_L("äöåÖÅÖÖ¤"), _L(""));
-	Client().AddAddresseeL(_L("äöåÖÅÖÖ¤"));
-	
-// Remove Recipient
-	Client().RemoveAddressee(2);
-
-// Validating Message
-	partList=KMsvMessagePartRecipient;
-	iSmsTest(Client().ValidateMessage(partList));   // All the addresses are not valid
-
-	Client().RemoveAddressee(Client().AddresseeList().Count()-1);
-	Client().RemoveAddressee(Client().AddresseeList().Count()-1);
-	Client().RemoveAddressee(Client().AddresseeList().Count()-1);
-	Client().RemoveAddressee(Client().AddresseeList().Count()-2);
-	Client().RemoveAddressee(Client().AddresseeList().Count()-2);
-
-	partList=KMsvMessagePartRecipient;			// supported
-	iSmsTest(!Client().ValidateMessage(partList));   
-	partList=KMsvMessagePartBody;				// not supported, returns 0
-	iSmsTest(!Client().ValidateMessage(partList));	
-	partList=KMsvMessagePartOriginator;			// not supported, returns 0
-	iSmsTest(!Client().ValidateMessage(partList));
-	partList=KMsvMessagePartDescription;		// not supported, returns 0
-	iSmsTest(!Client().ValidateMessage(partList));
-	partList=KMsvMessagePartDate;				// not supported, returns 0
-	iSmsTest(!Client().ValidateMessage(partList));
-	partList=KMsvMessagePartAttachments;		// not supported, returns 0
-	iSmsTest(!Client().ValidateMessage(partList));
-	partList=KMsvMessagePartBody|KMsvMessagePartRecipient;
-	iSmsTest(!Client().ValidateMessage(partList));
-	iSmsTest.Printf(_L("Test Validate Passed\n"));
-
-// Find in body and recipients
-	Client().AddAddresseeL(_L("+358503367709"), _L("Mr. Tester"));
-	partList=KMsvMessagePartRecipient;
-	iSmsTest(Client().Find(_L("est"),partList)==KMsvMessagePartRecipient);
-	partList=KMsvMessagePartBody;				
-	iSmsTest(Client().Find(_L("end"),partList)==KMsvMessagePartBody);	
-	partList=KMsvMessagePartOriginator;			
-	iSmsTest(!Client().Find(_L("end"),partList));
-	partList=KMsvMessagePartDescription;		// not supported, returns 0
-	iSmsTest(Client().Find(_L("end"),partList));
-	partList=KMsvMessagePartDate;				// not supported, returns 0
-	iSmsTest(!Client().Find(_L("end"),partList));
-	partList=KMsvMessagePartAttachments;		// not supported, returns 0
-	iSmsTest(!Client().Find(_L("end"),partList));
-	partList=KMsvMessagePartBody|KMsvMessagePartRecipient;
-//	resultList=Client().Find(_L(""),partList);		// crashes with empty string
-	iSmsTest(!Client().Find(_L("\n"),partList));
-	iSmsTest(!Client().Find(_L("äöå"),partList));
-	iSmsTest(!Client().Find(_L("{[}]"),partList));
-	iSmsTest(!Client().Find(_L("\\"),partList));
-	iSmsTest(!Client().Find(_L("4352316542631753dfgfdgs4t6543w563vsd4"),partList));
-	iSmsTest( Client().Find(_L("~"),partList));
-	iSmsTest(!Client().Find(_L("^"),partList));
-	iSmsTest(!Client().Find(_L("   \"dsasaf¤;¨"),partList));
-	iSmsTest(!Client().Find(_L("\\"),partList));
-	iSmsTest(!Client().Find(_L(" "),partList)); // alt+255
-	iSmsTest(Client().Find(_L("¨"),partList));
-	iSmsTest(!Client().Find(_L("/\\"),partList));
-	iSmsTest(!Client().Find(_L("\\ "),partList));
-	iSmsTest.Printf(_L("Test Find Passed\n"));
-	}
-
-void CSmcmTest::TestCapabilitiesL()
-	{
-// Query MTM's capabilities
-	TInt response;
-	iSmsTest(Client().QueryCapability(KUidMtmQueryMaxBodySize,response)==KErrNone);
-//	iSmsTest(response==KSmscMaxTotalMsgSize);
-	iSmsTest(Client().QueryCapability(KUidMtmQueryMaxTotalMsgSize,response)==KErrNone);
-//	iSmsTest(response==KSmcmMaxMessageNumber*KSmcmMaxCharsInMessageConcatenated7Bit);
-	iSmsTest(Client().QueryCapability(KUidMtmQuerySupportedBody,response)==KErrNone);
-	iSmsTest(response==KMtm7BitBody + KMtm8BitBody + KMtm16BitBody);
-	iSmsTest(Client().QueryCapability(KUidMtmQuerySupportAttachments,response)==KErrNotSupported);
-	iSmsTest(response);
-	iSmsTest(Client().QueryCapability(KUidMtmQuerySupportSubject,response)==KErrNotSupported);
-	iSmsTest(response);
-	iSmsTest(Client().QueryCapability(KUidMtmQuerySupportsFolder,response)==KErrNotSupported);
-	iSmsTest(response);
-	iSmsTest(Client().QueryCapability(KUidMtmQueryOffLineAllowed,response)==KErrNotSupported);
-	iSmsTest(response);
-	iSmsTest(Client().QueryCapability(KUidMtmQueryCanSendMsg,response)==KErrNone);
-	iSmsTest(response);
-	iSmsTest(Client().QueryCapability(KUidMtmQueryCanReceiveMsg,response)==KErrNone);
-	iSmsTest(response);
-	iSmsTest(Client().QueryCapability(KUidMtmQueryMaxRecipientCount,response)==KErrNone);
-	iSmsTest(response==-1);
-	iSmsTest(Client().QueryCapability(KUidMtmQuerySendAsRequiresRenderedImage,response)==KErrNotSupported);
-	iSmsTest(response);
-	iSmsTest(Client().QueryCapability(KUidMtmQuerySendAsRenderingUid,response)==KErrNotSupported);
-	iSmsTest(response);
-	iSmsTest(Client().QueryCapability(KUidMsvMtmQueryEditorUid,response)==KErrNone);
-	iSmsTest(response==268441151); // 0x1000163f in hex form
-	iSmsTest(Client().QueryCapability(KUidMsvQuerySupportsBioMsg,response)==KErrNone);
-	iSmsTest(response);
-	iSmsTest(Client().QueryCapability(KUidMsvQuerySupportsScheduling,response)==KErrNone);
-	iSmsTest(response);
-	iSmsTest(Client().QueryCapability(KUidSmcmTestNonSense,response)==KErrNotSupported);
-	iSmsTest(response);
-	iSmsTest.Printf(_L("Test Query Capabilities Passed\n"));
-	}
-
-// Now testing find alias
-void CSmcmTest::TestFindAliasL()
-	{
-	iSmsTest.Test().Next(_L("CSmsClientMtm Find Alias"));
-	iSmsTest.Printf(_L("This test is INCOMPLETE\n"));
-
-	TMsvEntry entry;
-	entry.iType=KUidMsvMessageEntry;
-	entry.SetSendingState(KMsvSendStateNotApplicable);
-	
-	// Begin extracted code
-	iSmsTest.iRichText->Reset();
-	iSmsTest.iRichText->InsertL(0,_L("Test message"));
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *iSmsTest.iRichText);
-	CleanupStack::PushL(header);
-
-	header->SetFromAddressL(KScriptItemRecipientsDef);
-	header->Message().SetServiceCenterAddressL(KScriptItemSCDef);
-
-	entry.iDetails.Set(_L("host")); //set alias
-
-	TTime now;
-	now.HomeTime();
-	iSmsTest.CreateMessageL(KMsvGlobalInBoxIndexEntryId, entry, *header, *iSmsTest.iRichText, now);
-	entry.SetReadOnly(ETrue);
-	iSmsTest.ChangeEntryL(entry);
-	TMsvId id = entry.Id();
-	CleanupStack::PopAndDestroy(header); //header
-
-	// End extracted code
-
-	iSmsTest.SetEntryL(id);
-
-	Client().SwitchCurrentEntryL(id); // Lets point at the received message
-	Client().LoadMessageL();
-
-	TMsvPartList partList;
-	partList=KMsvMessagePartOriginator;
-	//Find alias
-	iSmsTest(Client().Find(_L("host"),partList)==KMsvMessagePartOriginator);
-	iSmsTest.Printf(_L("Alias Found\n"));
-	iSmsTest.Printf(_L("Find Alias test passed\n"));
-	}
-
-// Now testing replying to received messages
-void CSmcmTest::TestReplyL()
-	{
-	iSmsTest.Test().Next(_L("CSmsClientMtm Reply"));
-	iSmsTest.Printf(_L("This test is INCOMPLETE\n"));
-
-	TMsvEntry entry;
-	entry.iType=KUidMsvMessageEntry;
-	entry.SetSendingState(KMsvSendStateNotApplicable);
-	
-	// Begin extracted code
-	iSmsTest.iRichText->Reset();
-	iSmsTest.iRichText->InsertL(0,_L("This is a test message with formatting and pictures"));
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *iSmsTest.iRichText);
-	CleanupStack::PushL(header);
-
-	// Add formatting and picture
-	CEmsFormatIE* object = CEmsFormatIE::NewL();
-	CleanupStack::PushL(object);
-	object->SetStartPosition(10);
-	object->SetFormatLength(10);
-	object->SetBold(ETrue);
-	header->Message().AddEMSInformationElementL(*object);
-	CleanupStack::PopAndDestroy(object);
-
-	CEmsPictureIE* pic = EmsTestUtils::CreatePictureL(0);
-	CleanupStack::PushL(pic);
-	pic->SetStartPosition(20);
-	header->Message().AddEMSInformationElementL(*pic);
-	CleanupStack::PopAndDestroy(pic);
-
-	header->SetFromAddressL(KScriptItemRecipientsDef);
-	header->Message().SetServiceCenterAddressL(KScriptItemSCDef);
-
-	TTime now;
-	now.HomeTime();
-	iSmsTest.CreateMessageL(KMsvGlobalInBoxIndexEntryId, entry, *header, *iSmsTest.iRichText, now);
-	entry.SetReadOnly(ETrue);
-	iSmsTest.ChangeEntryL(entry);
-	TMsvId id = entry.Id();
-	CleanupStack::PopAndDestroy(1); //header
-
-	// End extracted code
-
-	iSmsTest.SetEntryL(id);
-
-	Client().SwitchCurrentEntryL(id); // Lets point at the received message
-	Client().LoadMessageL();
-
-	TMsvPartList part=0;
-	CMsvOperationWait* wait = CMsvOperationWait::NewLC();
-	CMsvOperation* op=Client().ReplyL(KMsvDraftEntryId, part, wait->iStatus);
-	CleanupStack::PushL(op);
-	wait->Start();
-	CActiveScheduler::Start();
-
-	TPckgBuf<TMsvId> pkg;
-	pkg.Copy(op->ProgressL());
-	TMsvId progress = pkg();
-
-	CleanupStack::PopAndDestroy(2); //op, wait
-
-	// let's check to see if the inbox message and the reply are the same
-	// (this call will compare ems objects as well
-	if (!iSmsTest.AreMessagesSameTextL(id, progress, ETrue))
-		{
-		iSmsTest.Printf(_L("EMS objects do not compare!!\n"));
-		}
-	else
-		{
-		iSmsTest.Printf(_L("EMS objects compare OK.\n"));
-		}
-	
-	Client().SwitchCurrentEntryL(progress);
-	Client().LoadMessageL();
-		
-	Client().Body().InsertL(0,_L("This is reply"));
-	Client().SaveMessageL();
-	}
-	
-TMsvId CSmcmTest::CreateEmailSmsMessageL(const TDesC& aEmailMessageData)
-	{
-	RFs fs;
-	User::LeaveIfError(fs.Connect());
-	CleanupClosePushL(fs);
-
-	CSmsMessage* message = CSmsMessage::NewL(fs, CSmsPDU::ESmsDeliver, CSmsEditorBuffer::NewL(*iRichText), EFalse);
-	CleanupStack::PushL(message);
-	
-	CSmsBufferBase& buffer = message->Buffer();
-	buffer.Reset();
-	buffer.InsertL(0, aEmailMessageData);
-	
-	// Set the PID for email.
-	CSmsPDU& pdu = message->SmsPDU();
-	if( pdu.ProtocolIdentifierPresent() )
-		{
-		pdu.SetPIDType(TSmsProtocolIdentifier::ESmsPIDTelematicInterworking);
-		pdu.SetTelematicDeviceIndicator(TSmsProtocolIdentifier::ESmsTelematicDevice);
-		pdu.SetTelematicDeviceType(TSmsProtocolIdentifier::ESmsInternetElectronicMail);
-		}
-
-	// Create a new SMS header
-	CSmsHeader* header = CSmsHeader::NewL(message);
-	CleanupStack::Pop(message);
-	CleanupStack::PushL(header);
-	
-	header->SetFromAddressL(KScriptItemRecipientsDef);
-	header->Message().SetServiceCenterAddressL(KScriptItemSCDef);
-	
-	// Set the entry data...
-	TMsvEntry entry;
-	entry.iType = KUidMsvMessageEntry;
-	entry.SetSendingState(KMsvSendStateNotApplicable);
-	TSmsUtilities::PopulateMsgEntry(entry, header->Message(), iSmsTest.iSmsServiceId);
-	TTime now;
-	now.HomeTime();
-	entry.iDate = now;
-	
-	const CSmsEmailFields& fields = header->EmailFields();
-	// Set the details fiels to the address field.
-	iSmsTest(fields.HasAddress());
-	entry.iDetails.Set(fields.Addresses().MdcaPoint(0).Left(KSmsDetailsLength));			
-	
-	// Set the description to either the subject or the beginning part of the
-	// body text.
-	HBufC* desBuffer = HBufC::NewLC(Client().ServiceSettings().DescriptionLength());
-	TPtr description(desBuffer->Des());
-	if( fields.Subject().Length() > 0 )
-		{
-		// There is a subject - use this as the description
-		description.Copy(fields.Subject().Left(description.MaxLength()));
-		}
-	else
-		{
-		// No subject - use the beginning part of the body text.
-		CSmsBufferBase& body = header->Message().Buffer();
-		TInt length = body.Length();
-		HBufC* buf = HBufC::NewLC(length);
-		TPtr ptr(buf->Des());
-		body.Extract(ptr, 0, length);
-
-		description.Copy(ptr.Left(description.MaxLength()));
-		CleanupStack::PopAndDestroy(buf);
-		}
-	entry.iDescription.Set(description);
-
-	// Create the entry in the inbox.
-	iSmsTest.SetEntryL(KMsvGlobalInBoxIndexEntryId);
-	iSmsTest.CreateEntryL(entry);
-	Session().CleanupEntryPushL(entry.Id());
-	
-	// Store the header...
-	iSmsTest.SetEntryL(entry.Id());
-	CMsvStore* store = iSmsTest.EditStoreL();
-	CleanupStack::PushL(store);
-
-	header->StoreL(*store);
-
-	// Store the body text - need to insert into rich text object.
-	iSmsTest.iRichText->Reset();
-	TInt length = header->Message().Buffer().Length();
-	HBufC* buf = HBufC::NewLC(length);
-
-	TPtr ptr(buf->Des());
-	header->Message().Buffer().Extract(ptr, 0, length);
-	iSmsTest.iRichText->InsertL(0, ptr); 
-
-	store->StoreBodyTextL(*iSmsTest.iRichText);
-	store->CommitL();
-
-	entry.iSize = store->SizeL();
-	entry.SetReadOnly(ETrue);
-	iSmsTest.ChangeEntryL(entry);
-	
-	CleanupStack::PopAndDestroy(2, store); // store, buf
-	Session().CleanupEntryPop();
-	CleanupStack::PopAndDestroy(3, &fs);	// fs, header, desBuffer
-	
-	return entry.Id();
-	}
-	
-void CSmcmTest::DoTestReplyEmailL(const TDesC& aEmailMessageData, const TDesC& aAddress, const TDesC& aSubject)
-	{
-	// Create an email message and then a reply message to it.
-	TMsvId id = CreateEmailSmsMessageL(aEmailMessageData);
-	iSmsTest.SetEntryL(id);
-	Client().SwitchCurrentEntryL(id); 
-	Client().LoadMessageL();
-
-	TMsvPartList part=0;
-	CMsvOperationWait* wait = CMsvOperationWait::NewLC();
-	CMsvOperation* op=Client().ReplyL(KMsvDraftEntryId, part, wait->iStatus);
-	CleanupStack::PushL(op);
-	wait->Start();
-	CActiveScheduler::Start();
-
-	TPckgBuf<TMsvId> pkg;
-	pkg.Copy(op->ProgressL());
-	TMsvId reply = pkg();
-
-	CleanupStack::PopAndDestroy(2, wait); // op, wait
-	
-	// Switch and load the reply message
-	Client().SwitchCurrentEntryL(reply);
-	Client().LoadMessageL();
-	
-	// Check the reply message...
-	const CSmsHeader& replyHeader = Client().SmsHeader();
-	
-	// 1. Email fields...
-	const CSmsEmailFields& fields = replyHeader.EmailFields();
-	iSmsTest(fields.Addresses().MdcaCount() == 1);
-	iSmsTest(fields.Addresses().MdcaPoint(0).Compare(aAddress) == 0);
-	iSmsTest(fields.Subject().Compare(aSubject) == 0);
-	
-	// 2. PID...
-	CSmsSettings* smsset = CSmsSettings::NewL();
-	CleanupStack::PushL(smsset);
-	replyHeader.GetSmsSettingsL(*smsset);
-	iSmsTest(smsset->MessageConversion()==ESmsConvMail);
-	CleanupStack::PopAndDestroy(smsset);
-	
-	// 3. Email <-> SMS gateway (i.e. the recipient)
-	const CArrayPtrFlat<CSmsNumber>& rcpts = replyHeader.Recipients();
-	iSmsTest(rcpts.Count() == 1);
-	const CSmsNumber& rcpt = *rcpts.At(0);
-	iSmsTest(rcpt.Address().Compare(KScriptItemRecipientsDef) == 0);
-
-	// 4. Description - should be the same as the subject.
-	TMsvEntry replyEntry = Client().Entry().Entry();
-	TInt maxDesLength = Client().ServiceSettings().DescriptionLength();
-	iSmsTest(replyEntry.iDescription.Compare(fields.Subject().Left(maxDesLength)) == 0); 
-	
-	// 5. Details - should be the same as the address.
-	iSmsTest(replyEntry.iDetails.Compare(fields.Addresses().MdcaPoint(0).Left(KSmsDetailsLength)) == 0);	
-	}
-	
-void CSmcmTest::TestReplyEmailL()
-	{
-	iSmsTest.Test().Next(_L("CSmsClientMtm Reply (Email SMS"));
-
-	_LIT(KTestEmailAddress1,	"user@domain1.domain2");
-	_LIT(KTestEmailSubject1,	"Re: a subject");
-	_LIT(KTestEmailMessage1,	"user@domain1.domain2##a subject#some body text");
-	DoTestReplyEmailL(KTestEmailMessage1, KTestEmailAddress1, KTestEmailSubject1);
-
-	_LIT(KTestEmailAddress2,	"user@domain1.domain2");
-	_LIT(KTestEmailSubject2,	"");
-	_LIT(KTestEmailMessage2,	"user@domain1.domain2 some body text");
-	DoTestReplyEmailL(KTestEmailMessage2, KTestEmailAddress2, KTestEmailSubject2);
-	}
-
-TBool CSmcmTest::TestForwardBodyL(const CRichText& aBody, const TDesC& aExpected) const
-	{
-	HBufC* body = HBufC::NewLC(aBody.DocumentLength());
-	TPtr bodyPtr(body->Des());
-
-	aBody.Extract(bodyPtr);
-
-	const TBool check = (*body == aExpected);
-
-	CleanupStack::PopAndDestroy(body);
-
-	return check;
-	}
-
-TBool CSmcmTest::TestForwardEntry(const TMsvEntry& aOriginalEntry, const TMsvEntry& aForwardEntry) const
-	{
-	TBool ret =  (aOriginalEntry.SendingState()		== aForwardEntry.SendingState());
-	ret = ret && (aOriginalEntry.iBioType			== aForwardEntry.iBioType);
-	ret = ret && (aOriginalEntry.iDescription		== aForwardEntry.iDescription);
-	return ret;
-	}
-
-HBufC* CSmcmTest::CreateRandomLC(TInt aLen) const
-	{
-	HBufC* originalMsg = HBufC::NewLC(aLen);
-	TPtr originalPtr(originalMsg->Des());
-	originalPtr.SetLength(aLen);
-	TUint16* ptr = &originalPtr[0];
-	while (aLen--)
-		{
-		*ptr++ = TUint16(Math::Random() % (128 - 65) + 65);
-		}
-
-	return originalMsg;
-	}
-
-void CSmcmTest::TestForwardL(const TMsvEntry& aEntry, TInt aBodyLength)
-	{
-	//Create new message
-	_LIT(KTestForwardAddress, "+445554444333");
-	_LIT(KTestForwardName, "RonaldMcDonald");
-
-	TTime now;
-	now.HomeTime();
-	TMsvEntry originalEntry(aEntry);
-
-	//Set the body
-	HBufC* originalBody = CreateRandomLC(aBodyLength);
-	iSmsTest.iRichText->Reset();
-	iSmsTest.iRichText->InsertL(0, *originalBody);
-		
-	CSmsHeader* originalHeader = CSmsHeader::NewL(CSmsMessage::NewL(iSmsTest.FileSession(), CSmsPDU::ESmsDeliver, CSmsEditorBuffer::NewL(*iSmsTest.iRichText)));
-	CleanupStack::PushL(originalHeader);
-
-	// Add formatting and picture
-	CEmsFormatIE* object = CEmsFormatIE::NewL();
-	CleanupStack::PushL(object);
-	object->SetStartPosition(0);
-	object->SetFormatLength(5);
-	object->SetBold(ETrue);
-	originalHeader->Message().AddEMSInformationElementL(*object);
-	CleanupStack::PopAndDestroy(object);
-
-	CEmsPictureIE* pic = EmsTestUtils::CreatePictureL(0);
-	CleanupStack::PushL(pic);
-	pic->SetStartPosition(0);
-	originalHeader->Message().AddEMSInformationElementL(*pic);
-	CleanupStack::PopAndDestroy(pic);
-
-	//Add a recipient
-	CSmsNumber* originalNumber = CSmsNumber::NewL();
-	CleanupStack::PushL(originalNumber);
-	originalNumber->SetAddressL(KTestForwardAddress);
-	originalNumber->SetNameL(KTestForwardName);
-	originalHeader->Recipients().AppendL(originalNumber);
-	CleanupStack::Pop(originalNumber);
-	
-	//Create the new message
-	iSmsTest.CreateMessageL(KMsvGlobalOutBoxIndexEntryId, originalEntry, *originalHeader, *iSmsTest.iRichText, now);
-	Session().CleanupEntryPushL(originalEntry.Id());
-
-	MsvEntry().SetEntryL(originalEntry.Id());
-	originalEntry = MsvEntry().Entry();
-	// Need to secure the memory for the iDescription since the entry will change later on
-	HBufC* descBuf= originalEntry.iDescription.AllocLC();
-	originalEntry.iDescription.Set(descBuf->Ptr(), descBuf->Length());
-
-	//Switch current entry and set the message body
-	Client().SwitchCurrentEntryL(originalEntry.Id());
-	Client().LoadMessageL();
-
-	//Check body
-	iSmsTest(TestForwardBodyL(Client().Body(), *originalBody));
-	//Forward the message
-	TMsvPartList part=0;
-	CMsvOperationWait* wait = CMsvOperationWait::NewLC();
-	wait->Start();
-
-	CMsvOperation* op = Client().ForwardL(KMsvDraftEntryId, part, wait->iStatus);
-	CleanupStack::PushL(op);
-
-	CActiveScheduler::Start();
-
-	iSmsTest(wait->iStatus.Int() == KErrNone);
-
-	//Get the new message ID
-	TPckgBuf<TMsvId> pkg;
-	pkg.Copy(op->ProgressL());
-	const TMsvId progress = pkg();
-	
-	CleanupStack::PopAndDestroy(op);
-	CleanupStack::PopAndDestroy(wait);
-
-	op = NULL;
-
-	Session().CleanupEntryPushL(progress);
-
-	Client().SwitchCurrentEntryL(progress);
-	Client().LoadMessageL();
-
-	//Check the new message body
-	iSmsTest(TestForwardBodyL(Client().Body(), *originalBody));
-
-	//Check the entry
-	iSmsTest(TestForwardEntry(originalEntry, Client().Entry().Entry()));
-
-	// let's check to see if the inbox message and the forward are the same
-	// (this call will compare ems objects as well
-	if (!iSmsTest.AreMessagesSameTextL(originalEntry.Id(), progress, ETrue))
-		{
-		iSmsTest.Printf(_L("EMS objects do not compare!!\n"));
-		}
-	else
-		{
-		iSmsTest.Printf(_L("EMS objects compare OK.\n"));
-		}
-
-	CleanupStack::PopAndDestroy(); //message
-	CleanupStack::PopAndDestroy(descBuf);
-	CleanupStack::PopAndDestroy(); //message
-	CleanupStack::PopAndDestroy(originalHeader);
-	CleanupStack::PopAndDestroy(originalBody);
-	}
-
-void CSmcmTest::TestForwardL()
-	{
-	iSmsTest.Test().Next(_L("CSmsClientMtm Forward"));
-
-	TInt len=3000;
-	while (len > 0)
-		{
-		TMsvEntry entry = TMsvEntry();
-		entry.iBioType = Math().Random();
-		iSmsTest.Printf(_L("TestForward Len %d BioType %d\n"), len, entry.iBioType);
-		TestForwardL(entry, len);
-		len -= 25;
-		}
-	}
-	
-void CSmcmTest::DoTestForwardEmailL(const TDesC& aEmailMessageData, const TDesC& aSubject, const TDesC& aBody)
-	{
-	// Create an email message and then a forward message to it.
-	TMsvId id = CreateEmailSmsMessageL(aEmailMessageData);
-	iSmsTest.SetEntryL(id);
-	Client().SwitchCurrentEntryL(id); 
-	Client().LoadMessageL();
-
-	TMsvPartList part=0;
-	CMsvOperationWait* wait = CMsvOperationWait::NewLC();
-	CMsvOperation* op=Client().ForwardL(KMsvDraftEntryId, part, wait->iStatus);
-	CleanupStack::PushL(op);
-	wait->Start();
-	CActiveScheduler::Start();
-
-	TPckgBuf<TMsvId> pkg;
-	pkg.Copy(op->ProgressL());
-	TMsvId forward = pkg();
-
-	CleanupStack::PopAndDestroy(2, wait); // op, wait
-	
-	// Switch and load the forward message
-	Client().SwitchCurrentEntryL(forward);
-	Client().LoadMessageL();
-	
-	// Check the forward message...
-	const CSmsHeader& forwardHeader = Client().SmsHeader();
-	
-	// 1. Email fields...(address should be empty)
-	const CSmsEmailFields& fields = forwardHeader.EmailFields();
-	iSmsTest(!fields.HasAddress());
-	iSmsTest(fields.Addresses().MdcaCount()==0);
-	iSmsTest(fields.Subject().Compare(aSubject) == 0);
-	
-	// 2. PID...
-	CSmsSettings* smsset = CSmsSettings::NewL();
-	CleanupStack::PushL(smsset);
-	forwardHeader.GetSmsSettingsL(*smsset);
-	iSmsTest(smsset->MessageConversion()==ESmsConvMail);
-	CleanupStack::PopAndDestroy(smsset);
-	
-	// 3. Email <-> SMS gateway (ie the recipient)
-	const CArrayPtrFlat<CSmsNumber>& rcpts = forwardHeader.Recipients();
-	iSmsTest(rcpts.Count() == 1);
-	const CSmsNumber& rcpt = *rcpts.At(0);
-	iSmsTest(rcpt.Address().Compare(KScriptItemRecipientsDef) == 0);
-
-	// 4. Description - should be the same as the subject or body text.
-	TMsvEntry forwardEntry = Client().Entry().Entry();
-	TInt maxDesLength = Client().ServiceSettings().DescriptionLength();
-	if( fields.Subject().Length() )
-		{
-		// Description should be same as subject.
-		iSmsTest(forwardEntry.iDescription.Compare(fields.Subject().Left(maxDesLength)) == 0); 		
-		}
-	else
-		{
-		// Description should be the same as the body text.
-		HBufC* body = HBufC::NewLC(Client().Body().DocumentLength());
-		TPtr bodyPtr(body->Des());
-		Client().Body().Extract(bodyPtr);
-
-		iSmsTest(forwardEntry.iDescription.Compare(bodyPtr.Left(maxDesLength)) == 0);
-		CleanupStack::PopAndDestroy(body);
-		}
-	
-	// 5. Details - should be the same as the address (ie empty).
-	iSmsTest(forwardEntry.iDetails.Compare(KNullDesC())==0);
-	
-	// 6. Body data.
-	iSmsTest(TestForwardBodyL(Client().Body(), aBody));
-	}
-	
-void CSmcmTest::TestForwardEmailL()
-	{
-	iSmsTest.Test().Next(_L("CSmsClientMtm Forward (Email SMS)"));
-
-	_LIT(KTestEmailSubject1,	"Fw: a subject");
-	_LIT(KTestEmailBody1,		"some body text");
-	_LIT(KTestEmailMessage1,	"user@domain1.domain2##a subject#some body text");
-	DoTestForwardEmailL(KTestEmailMessage1, KTestEmailSubject1, KTestEmailBody1);
-
-	_LIT(KTestEmailSubject2,	"");
-	_LIT(KTestEmailBody2,		"some body text");
-	_LIT(KTestEmailMessage2,	"user@domain1.domain2 some body text");
-	DoTestForwardEmailL(KTestEmailMessage2, KTestEmailSubject2, KTestEmailBody2);
-	}
-
-void CSmcmTest::TestSyncFunctionsL()
-	{
-	iSmsTest.Test().Next(_L("Test CSmsClientMtm Sync Functions"));
-	iSmsTest.Printf(_L("This test is INCOMPLETE\n"));
-	}
--- a/messagingappbase/smsmtm/test/src/T_smcmsimtsytest.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,844 +0,0 @@
-// Copyright (c) 1999-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 "T_smcmsimtsytest.h"
-#include <e32test.h>
-#include <e32uid.h>
-#include <e32std.h>
-#include <smuthdr.h>
-#include <txtrich.h> 
-#include <smscmds.h>
-#include <smsclnt.h>
-#include <smsuaddr.h>
-
-// Autotest library header file
-#include <autotest.h>
-
-#include <testconfigfileparser.h>
-#include <simtsy.h>
-#include <csmsaccount.h>
-
-#include <e32property.h>
-
-#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS  
-#include <tmsvsmsentry.h>
-#endif
-
-// Global pointer for use by the autogTest.h macro's
-CAutoTest* gAutoTest;
-
-
-RTest gTest(_L("T_SmcmSimTsyTest Testrig"));
-TBool HasCreatedSmsService = EFalse;
-CTrapCleanup* theCleanup;
-
-#define LOCAL_CHECKPOINT_CODE(a,b) a.TestCheckPointCodeL((b), (__FILE__), (__LINE__))
-#define LOCAL_CHECKPOINT(a,b) a.TestCheckPointL((b), (__FILE__), (__LINE__))
-#define LOCAL_CHECKPOINT_COMPARE(a,b,c,d) a.TestCheckPointCompareL((b),(c),(d),(__FILE__),(__LINE__))
-
-//SMS Scripting
-_LIT(KSmsScript,"smcmsimtsytest_config.txt");
-_LIT(KSmsScriptFull,"\\msgtest\\sms\\smcmsimtsytest_config.txt");
-
-void DeleteSmsStores(RFs& aFs)
-	{
-	_LIT(KReassemblyStoreName,"C:\\System\\Data\\smsreast.dat");
-	_LIT(KSegmentationStoreName,"C:\\System\\Data\\smssegst.dat");
-	aFs.Delete(KReassemblyStoreName);
-	aFs.Delete(KSegmentationStoreName);
-	}
-
-
-CMessageSendStates::CMessageSendStates(TMsvId aId)
-	{
-	iId = aId;
-	}
-
-CMessageSendStates* CMessageSendStates::NewLC(TMsvId aId)
-	{
-	CMessageSendStates* self=new (ELeave) CMessageSendStates(aId);
-	CleanupStack::PushL(self);
-	//self->ConstructL();
-	return self;
-	}
-
-CMessageSendStates* CMessageSendStates::NewL(TMsvId aId)
-	{
-	CMessageSendStates* self = NewLC(aId);
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-void CMessageSendStates::ConstructL()
-	{
-	}
-
-CMessageSendStates::~CMessageSendStates()
-	{
-	iStates.Close();
-	}
-
-RMessageSendStatesArray::RMessageSendStatesArray()
-	{
-	}
-		
-TInt RMessageSendStatesArray::Find(TMsvId aId) const
-	{
-	const RMessageSendStatesArray& sendArray = *this;
-	TInt count = sendArray.Count();
-
-	for (TInt i=0; i<count; ++i)
-		{
-		if (sendArray[i]->iId == aId)
-			return i;
-		}
-
-	return -1;
-	}
-
-void RMessageSendStatesArray::CopyInSelectionL(const CMsvEntrySelection& aSelection)
-	{
-	ResetAndDestroy();
-	TInt count = aSelection.Count();
-
-	while (count--)
-		{
-		const TMsvId id = aSelection[count];
-		CMessageSendStates* msg = CMessageSendStates::NewLC(id);
-		User::LeaveIfError(Append(msg));
-		CleanupStack::Pop(msg);
-		}
-	}
-
-CSmcmSendTest* NewSmcmTestLCC(TInt aTestNumber, TInt aExpectedError=KErrNone)
-/**
-	Constructs and returns CSmsScTest object. 
-	Notifies the system agent that the phone is on.
-
-	@return		CSmsScTest*		A pointer to SmsSc test.  
- */
-	{
-	CSmsTestUtils* testUtils = CSmsTestUtils::NewL(gTest, HasCreatedSmsService?ETuCreateTestDirectories|ETuGoClientSide:ETuMinimalClientSide);
-	if (HasCreatedSmsService)
-		testUtils->iServiceSettings = CSmsSettings::NewL();
-	HasCreatedSmsService = ETrue;
-	CleanupStack::PushL(testUtils);
-
-	// System agent fix... this ensures that the correct test script is used by SIM.TSY
-	User::LeaveIfError(RProperty::Set(KUidSystemCategory, KUidSASimTsyTestNumberValue, aTestNumber));
-//	testUtils->SetSimTsyTestNumberL(aTestNumber);
-	testUtils->NotifySaPhoneOffL();
-	User::After(5000000); //wait for SmsProt to go to sleep
-	DeleteSmsStores(testUtils->FileSession());
-
-	TInt nextTest = 0;
-
-	testUtils->NotifySaPhoneOnL();
-	testUtils->WaitForInitializeL();
-
-	return CSmcmSendTest::NewLC(*gAutoTest, *testUtils, KSmsScript, aExpectedError, nextTest);
-	}
-
-TBool CSmcmSendTest::CheckWatchersStartedL()
-	{
-	TBool found = EFalse;
-	TFullName fullName;
-	TFindThread finder(_L("*"));
-	//
-	while(finder.Next(fullName) == KErrNone && !found)
-		{
-		// Open the thread
-		RThread thread;
-		User::LeaveIfError(thread.Open(fullName));
-
-		// Open the process which owns this thread
-		RProcess process;
-		const TInt error = thread.Process(process);
-		if (error == KErrNone)
-			{
-			const TFileName fileName(process.FileName());
-			if (fileName.Compare(_L("Z:\\System\\Libs\\watcher.exe")) == 0)
-				found = ETrue;
-			process.Close();
-			}
-		thread.Close();
-		}
-
-	return found;
-	}
-
-void CSmcmSendTest::TestReceiveClass2L(TInt aTestNumber, TRequestStatus& aStatus)
-	{
-	iState = EStateTestReceiveClass2;
-	iMessagesReceived = 0;
-	SetMessagesToReceiveL(aTestNumber);
-
-	//Set the class 2 folder
-	iSmsSettings->SetClass2Folder(KMsvGlobalOutBoxIndexEntryId);
-	iSmsTest.SetEntryL(iSmsTest.iSmsServiceId);
-	CSmsAccount* account = CSmsAccount::NewLC();
-	account->SaveSettingsL(*iSmsSettings);
-	CleanupStack::PopAndDestroy(account);
-
-	iSmsTest.Printf(_L("Waiting to recv %d msgs [test=%d inbox=%d class2=%d]\n"),
-		iMessagesToReceive, aTestNumber, KMsvGlobalInBoxIndexEntryId, iSmsSettings->Class2Folder()),
-
-	delete iWatcherStarter;
-	iWatcherStarter = NULL;
-
-	TBool watcherRunning = EFalse;
-	TRAPD(ignor, watcherRunning = CheckWatchersStartedL());
-	if (watcherRunning)
-		{
-		iSmsTest.Printf(_L("Watchers running.\n"));
-		}
-	else
-		{
-		iSmsTest.Printf(_L("Watchers not running. Starting watchers....\n"));
-		iWatcherStarter = CTestUtilsWatcherStarter::NewL(CActive::EPriorityHigh);
-		}
-
-	iStatus = KRequestPending;
-	Queue(aStatus);
-	SetActive();
-	}
-
-void CSmcmSendTest::TestSendingL(TRequestStatus& aStatus)
-	{
-	iState = EStateSending;
-
-	TTime now;
-	now.HomeTime();
-	now += (TTimeIntervalSeconds) 5;
-
-	iSmsTest.DeleteSmsMessagesL(KMsvGlobalOutBoxIndexEntryId);
-	iSelection->Reset();
-
-	// Create the test messages specified in the script file and place in the Outbox.
-	iSmsTest.Printf(_L("Creating msgs in outbox from script %S\n"), &iScriptFile);
-	TBool read = EFalse;
-	TRAPD(err, read = iSmsTest.ReadScriptL(iScriptFile, KMsvGlobalOutBoxIndexEntryId, *iSelection, now));
-
-	//iSmsTest.Test()(!err && read);
-	LOCAL_CHECKPOINT(iAutoTest, !err && read);
-
-	iSmsTest.Printf(_L("Sending %d messages...\n"), iSelection->Count());
-	iSmsTest.DisplayMessagesL(*iSelection);
-	iSmsTest.SetEntryL(KMsvGlobalOutBoxIndexEntryId);
-
-	delete iOperation;
-	iOperation = NULL;
-
-	// Send the message, by copying it to the SMS Service.
-	iCurrentMessages.ResetAndDestroy();
-	iCurrentMessages.CopyInSelectionL(*iSelection);
-
-	iOperation = MsvEntry().CopyL(*iSelection, iSmsTest.iSmsServiceId, iStatus);
-	
-	SetActive();
-	Queue(aStatus);
-	}
-
-void CSmcmSendTest::TestSchedulingL(TRequestStatus& aStatus)
-	{
-	iState = EStateScheduling;
-
-	iSmsTest.DeleteSmsMessagesL(KMsvGlobalOutBoxIndexEntryId);
-	iSelection->Reset();
-
-	TTimeIntervalSeconds fromNow = 5;
-	TTime now;
-	now.HomeTime();
-	now += fromNow;
-
-	iSmsTest.Printf(_L("Creating msgs in outbox from script %S\n"), &iScriptFile);
-	TBool read = EFalse;
-	TRAPD(err, read = iSmsTest.ReadScriptL(iScriptFile, KMsvGlobalOutBoxIndexEntryId, *iSelection, now));
-
-	//iSmsTest.Test()(!err && read);
-	LOCAL_CHECKPOINT(iAutoTest, !err && read);
-
-	iSmsTest.Printf(_L("Scheduled %d messages...\n"), iSelection->Count());
-	iSmsTest.DisplayMessagesL(*iSelection);
-	MsvEntry().SetEntryL(KMsvGlobalOutBoxIndexEntryId);
-
-	delete iOperation;
-	iOperation = NULL;
-
-	iCurrentMessages.ResetAndDestroy();
-	iCurrentMessages.CopyInSelectionL(*iSelection);
-	
-	iOperation = Session().TransferCommandL(*iSelection, ESmsMtmCommandScheduleCopy, TPtrC8(), iStatus);
-
-	SetActive();
-	Queue(aStatus);
-	}
-
-void Test1L()
-	{
-	CSmcmSendTest* smcmTest = NewSmcmTestLCC(0, KErrServerTerminated);
-
-	CMsvOperationWait* waiter = CMsvOperationWait::NewLC();
-	smcmTest->TestSendingL(waiter->iStatus);
-	waiter->Start();
-	CActiveScheduler::Start();
-	GLOBAL_CHECKPOINT_COMPARE(waiter->iStatus.Int(), KErrNone, _L("TestSendingL completed with error"));
-
-	//CleanupStack::PopAndDestroy(waiter);
-	//CleanupStack::PopAndDestroy(smcmTest);
-	//CleanupStack::PopAndDestroy();
-	CleanupStack::PopAndDestroy(3);
-	}
-
-void Test2L()
-	{
-	CSmcmSendTest* smcmTest = NewSmcmTestLCC(0, KErrServerTerminated);
-
-	CMsvOperationWait* waiter = CMsvOperationWait::NewLC();
-	smcmTest->TestSchedulingL(waiter->iStatus);
-	waiter->Start();
-	CActiveScheduler::Start();
-	GLOBAL_CHECKPOINT_COMPARE(waiter->iStatus.Int(), KErrNone, _L("TestSchedulingL completed with error"));
-
-	CleanupStack::PopAndDestroy(waiter);
-	CleanupStack::PopAndDestroy(smcmTest);
-	CleanupStack::PopAndDestroy();
-	}
-
-void Test3L()
-	{
-	CSmcmSendTest* smcmTest = NewSmcmTestLCC(2);
-
-	CMsvOperationWait* waiter = CMsvOperationWait::NewLC();
-	smcmTest->TestReceiveClass2L(2, waiter->iStatus);
-	waiter->Start();
-	CActiveScheduler::Start();
-	GLOBAL_CHECKPOINT_COMPARE(waiter->iStatus.Int(), KErrNone, _L("TestReceiveClass2L completed with error"));
-
-	CleanupStack::PopAndDestroy(waiter);
-	CleanupStack::PopAndDestroy(smcmTest);
-	CleanupStack::PopAndDestroy();
-	}
-
-
-void Test4L()
-	{
-	CMsvOperationWait* waiter = CMsvOperationWait::NewLC();
-	waiter->Start();
-
-	CTestUtilsWatcherStarter* watcherStarter = CTestUtilsWatcherStarter::NewL(waiter->iStatus, 20000000);
-	CleanupStack::PushL(watcherStarter);
-
-	CActiveScheduler::Start();
-	GLOBAL_CHECKPOINT_COMPARE(waiter->iStatus.Int(), KErrNone, _L("TestReceiveClass2L completed with error"));
-
-	CleanupStack::PopAndDestroy(watcherStarter);
-	CleanupStack::PopAndDestroy(waiter);
-	}
-
-
-CSmcmSendTest::~CSmcmSendTest()
-	{
-	Cancel();
-
-	if (iSmsTest.iMsvSession)
-		{
-		iSmsTest.iMsvSession->RemoveObserver(*this);
-		}
-
-	if (iOperation)
-		{
-		iOperation->Cancel();
-		delete iOperation;
-		iOperation = NULL;
-		}
-
-	delete iSelection;
-	iSelection = NULL;
-
-	if (iTimer)
-		{
-		iTimer->Cancel();
-		delete iTimer;
-		iTimer = NULL;
-		}
-
-	iCurrentMessages.ResetAndDestroy();
-	delete iSmsSettings;
-	delete iWatcherStarter;
-	}
-
-CSmcmSendTest::CSmcmSendTest(CAutoTest& aAutoTest, CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt aExpectedError, TInt aPriority)
-: CActive(aPriority), iState(EStateWaiting), iAutoTest(aAutoTest), iScriptFile(aScriptFile), iSmsTest(aSmsTest), iExpectedError(aExpectedError)
-	{
-	CActiveScheduler::Add(this);
-	}
-
-CSmcmSendTest* CSmcmSendTest::NewLC(CAutoTest& aAutoTest, CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt aExpectedError, TInt aPriority)
-	{
-	CSmcmSendTest* self = new (ELeave) CSmcmSendTest(aAutoTest, aSmsTest, aScriptFile, aExpectedError, aPriority);
-	CleanupStack::PushL(self);
-
-	self->ConstructL();
-
-	return self;
-	}
-
-void CSmcmSendTest::ConstructL()
-	{
-	iSmsTest.SetLogToFile();
-
-	iSelection = new (ELeave) CMsvEntrySelection();
-
-	iSmsTest.iMsvSession->AddObserverL(*this);
-	iSmsTest.InstantiateClientMtmsL();
-
-	iSmsTest.SetEntryL(iSmsTest.iSmsServiceId);
-	iSmsSettings = CSmsSettings::NewL();
-
-	CSmsAccount* account = CSmsAccount::NewLC();
-	account->LoadSettingsL(*iSmsSettings);
-	CleanupStack::PopAndDestroy(account);
-	}
-
-void CSmcmSendTest::HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* /*aArg2*/, TAny* /*aArg3*/)
-	{
-	CMsvEntrySelection* entries = NULL;
-
-	switch (aEvent)
-		{
-//		case EMsvEntriesCreated:
-		case EMsvEntriesChanged:
-		case EMsvEntriesMoved:
-			entries = STATIC_CAST(CMsvEntrySelection*, aArg1);
-			break;
-		default:
-			return;
-		}
-
-	if (!IsActive())
-		return;
-
-	TRequestStatus* status = &iStatus;
-
-	switch (iState)
-		{
-		case EStateSchedulingThenSend:
-		case EStateSending:
-			{
-			if (aEvent == EMsvEntriesCreated)
-				return;
-
-			TInt error = KErrNone;
-
-			iSmsTest.DisplaySendingStatesL(*entries);
-
-			TInt count = entries->Count();
-			
-			while (count--)
-				{
-				const TMsvId id = (*entries)[count];
-				const TInt find = iCurrentMessages.Find(id);
-				
-				if (find != KErrNotFound)
-					{
-					CMessageSendStates& messageSendStates = *iCurrentMessages[find];
-					CMsvEntry* cEntry = Session().GetEntryL(id);
-					CleanupStack::PushL(cEntry);
-					const TMsvEntry& entry = cEntry->Entry();
-					User::LeaveIfError(messageSendStates.iStates.Append(entry.SendingState()));					
-					CleanupStack::PopAndDestroy(cEntry);
-					}
-				}
-
-			if (iSmsTest.SendingCompleteL(*iSelection, error) && iState == EStateSchedulingThenSend && iStatus == KRequestPending)
-				{
-				User::RequestComplete(status, error);
-				}
-			break;
-			}
-		case EStateTestReceiveClass2:
-
-			if (aEvent != EMsvEntriesChanged)
-				return;
-
-			if (!CheckParentOfReceivedMessageL(*entries))
-				{
-				iSmsTest.Printf(_L("Parent of messages don't match\n"));
-				User::RequestComplete(status, KErrGeneral);
-				}
-			else if (iMessagesReceived >= iMessagesToReceive)
-				{
-				iSmsTest.Printf(_L("All messages received\n"));
-				User::RequestComplete(status, KErrNone);
-				}
-
-		default:
-			break;
-		}
-	}
-
-LOCAL_C const TAutoTestCase SmsScTestCases[] =
-/**
-	Sets up an array of test functions
- */
-	{
-	{Test1L,_S("Test Sending")},
-	{Test2L,_S("Test Schedule Sending")},
-	{Test3L,_S("Test Receiving Class2 Messages")},
-	{Test4L,_S("Test Start Stop Watchers")}
-	};
-
-LOCAL_C void doMainL()
-/**
-	Constructs sctive scheduler and starts off the tests
- */
-	{
-	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
-	CleanupStack::PushL(scheduler);
-	CActiveScheduler::Install( scheduler );
-	
-	// Copying the config file to the root directory
-	RFs fs;
-	User::LeaveIfError(fs.Connect());
-	CleanupClosePushL(fs);
-
-	CSmsTestUtils::CopyToSimTsyConfigFileL(fs, KSmsScriptFull);
-	DeleteSmsStores(fs);
-
-	CleanupStack::PopAndDestroy(&fs);
-
-	// Open the socket server
-
-	RSocketServ serv;
-	RSocket socket;
-
-	User::LeaveIfError(serv.Connect());
-	CleanupClosePushL(serv);
-	
-	TProtocolDesc protoinfo;
-	TProtocolName protocolname(KSmsDatagram);
-	User::LeaveIfError(serv.FindProtocol(protocolname,protoinfo));
-	User::LeaveIfError(socket.Open(serv,protoinfo.iAddrFamily,protoinfo.iSockType,protoinfo.iProtocol));
-
-	TSmsAddr smsaddr;
-	smsaddr.SetSmsAddrFamily(ESmsAddrSendOnly);
-	User::LeaveIfError(socket.Bind(smsaddr));
-
-	CleanupClosePushL(socket);
-
-	_LIT(KTestOutput,"smcmsimtsy_testreport.txt");
-	_LIT8(KComponentInfo,"smcm and smss");
-	// Library defined macro
-	// Uses a global pointer instance of CAutoTest
-	GLOBAL_AUTOTEST_EXECUTE(SmsScTestCases, KTestOutput, KComponentInfo, gTest);
-
-	CleanupStack::PopAndDestroy(&socket);
-	CleanupStack::PopAndDestroy(&serv);
-	CleanupStack::PopAndDestroy(scheduler);
-	}
-
-GLDEF_C TInt E32Main()
-/**
-	Calls doMainL and checks for error
- */
-	{
-	__UHEAP_MARK;
-
-	gTest.Start(_L("Setup"));
-	theCleanup = CTrapCleanup::New();
-
-
-	TRAPD(ret,doMainL());
-
-	if (ret != KErrNone)
-		gTest.Printf(_L("Test completed with %d"), ret);
-
-	delete theCleanup;	
-	gTest.Console()->SetPos(0, 13);
-	gTest.End();
-	gTest.Close();
-	__UHEAP_MARKEND;
-	return(KErrNone);
-	}
-
-void CSmcmSendTest::RunL()
-	{
-	if (iOperation)
-		iSmsTest.SetProgressL(*iOperation);
-
-	switch (iState)
-		{
-		case EStateScheduling:
-			DoRunSchedulingL();
-			break;
-		case EStateSending:
-		case EStateSchedulingThenSend:
-			DoRunSendingL();
-			break;
-		case EStateTestReceiveClass2:
-			break;
-		default:
-			break;
-		}
-
-	delete iOperation;
-	iOperation = NULL;
-
-	if (!IsActive())
-		Complete(iStatus.Int());
-	}
-
-void CSmcmSendTest::Complete(TInt aError)
-/**
-	Indicates that the operation is complete with aError.
-
-	@param		aError		error returned by the operation
- */
-	{
-	iSmsTest.Printf(_L("CSmsScTest::Complete [aError=%d]\n"), aError);
-	if (iExpectedError == aError && aError)
-		{
-		iSmsTest.Printf(_L("CSmsScTest::Complete [%d Expected - PASSED]\n"), aError);
-		aError = KErrNone;
-		}
-
-	if (iReport != NULL)
-		User::RequestComplete(iReport, aError);
-	}
-
-TInt CSmcmSendTest::RunError(TInt aError)
-/**
-
-	@param		aError		error returned by the operation
-	@return		TInt		Returns the KErrNone. 
- */
-	{
-	Complete(aError);
-	return KErrNone;
-	}
-
-void CSmcmSendTest::Queue(TRequestStatus& aStatus)
-/**
-
-	@param		aStatus		Indicates the status of the operation.
- */
-	{
-	__ASSERT_DEBUG(iReport==NULL, User::Invariant());
-
-	aStatus=KRequestPending;
-	iReport=&aStatus;
-	}
-
-void CSmcmSendTest::DoCancel()
-	{
-	if (iOperation)
-		{
-		iOperation->Cancel();
-		iSmsTest.Printf(_L("Operation Cancelled!\n"));
-		}
-	else	
-		{
-		iSmsTest.Printf(_L("No operation to cancel!\n"));
-		}
-
-	delete iOperation;
-	iOperation = NULL;
-	}
-
-void CSmcmSendTest::DoRunSchedulingL()
-	{
-	if (iStatus == KErrNone && iOperation != NULL)
-		iStatus = iSmsTest.iProgress.iError;
-
-	iSmsTest.Printf(_L("Scheduling completed with error %d\n"), iStatus);
-
-	TBool sent = EFalse;
-
-	if (iStatus == KErrNone)
-		{
-		iSmsTest.DisplaySendingStatesL(*iSelection);
-		TInt error = KErrNone;
-		sent = iSmsTest.SendingCompleteL(*iSelection, error);
-		iStatus = error;
-		}
-	
-	if (!sent)
-		{
-		iStatus = KRequestPending;
-		SetActive();
-		iState = EStateSchedulingThenSend;
-		}
-	else
-		{
-		iState = EStateWaiting;
-		iSmsTest.Printf(_L("Scheduling completed with error %d\n"), iStatus);
-		}
-	}
-
-void CSmcmSendTest::DoRunSendingL()
-	{
-	if (iStatus == KErrNone && iOperation != NULL)
-		iStatus = iSmsTest.iProgress.iError;
-
-	iState = EStateWaiting;
-	iSmsTest.Printf(_L("Sending completed with error %d\n"), iStatus);
-
-	TInt err = KErrNone;
-
-	if (!iSmsTest.SendingCompleteL(*iSelection, err))
-		{
-		iSmsTest.Printf(_L("Waiting for all messages to send or fail\n"), iStatus);
-		iStatus = KRequestPending;
-		SetActive();
-		iState = EStateSchedulingThenSend;
-		}
-	else
-		{
-		PrintSendingStates(iCurrentMessages);
-		LOCAL_CHECKPOINT(iAutoTest, CheckSendingStates(iCurrentMessages));
-		}
-	}
-
-TBool CSmcmSendTest::CheckSendingStates(const RMessageSendStatesArray& sendStateArray)
-	{
-	const TInt count = sendStateArray.Count();
-
-	for (TInt i=0; i < count; ++i)
-		{
-		const CMessageSendStates& sendState = *sendStateArray[i];
-		const TInt stateCount = sendState.iStates.Count();
-
-		for (TInt j=0; j < stateCount-1; ++j)
-			{
-			if (sendState.iStates[j] == KMsvSendStateFailed && (sendState.iStates[j+1] == KMsvSendStateResend || sendState.iStates[j+1] == KMsvSendStateScheduled))
-				return EFalse;
-			}
-		}
-
-	return ETrue;
-	}
-
-void CSmcmSendTest::PrintSendingStates(const RMessageSendStatesArray& sendStateArray)
-	{
-	iSmsTest.Printf(_L("=============== Sending States =============== \n\n"));
-
-	TInt count = sendStateArray.Count();
-	iSmsTest.Printf(_L("Number of messages= %d\n\n"), count);
-
-	for (TInt i=0; i < count; ++i)
-		{
-		iSmsTest.Printf(_L("================= Message %d ================\n\n"), i);
-
-		const CMessageSendStates& sendState = *sendStateArray[i];
-		TInt stateCount = sendState.iStates.Count();
-
-		for (TInt j=0; j < stateCount; ++j)
-			{
-			//iSmsTest.Printf(_L("%d\n"), sendState.iStates[j]);
-
-			switch (sendState.iStates[j])
-				{
-				case KMsvSendStateSending:
-					iSmsTest.Printf(_L("Sending %d\n"), sendState.iStates[j]);
-					break;
-				case KMsvSendStateResend:
-					iSmsTest.Printf(_L("Resend %d\n"), sendState.iStates[j]);
-					break;
-				case KMsvSendStateScheduled:
-					iSmsTest.Printf(_L("Scheduled %d\n"), sendState.iStates[j]);
-					break;
-				case KMsvSendStateFailed:
-					iSmsTest.Printf(_L("Failed %d\n"), sendState.iStates[j]);
-					break;
-				case KMsvSendStateWaiting:
-					iSmsTest.Printf(_L("Waiting %d\n"), sendState.iStates[j]);
-					break;
-				case KMsvSendStateSent:
-					iSmsTest.Printf(_L("Sent %d\n"), sendState.iStates[j]);
-					break;
-				case KMsvSendStateSuspended:
-					iSmsTest.Printf(_L("Suspended %d\n"), sendState.iStates[j]);
-					break;
-				default:
-					break;
-					}
-			}
-
-		iSmsTest.Printf(_L("============== End of Message %d =============\n\n"), i);
-		}
-
-	iSmsTest.Printf(_L("=============== End Sending States ============= \n"));
-	}
-
-
-TBool CSmcmSendTest::CheckParentOfReceivedMessageL(const CMsvEntrySelection& aSelection)
-	{
-	TInt count = aSelection.Count();
-	TBool retVal = ETrue;
-
-	while (count-- && retVal)
-		{
-		const TMsvId id = aSelection[count];
-		iSmsTest.SetEntryL(id);
-		const TMsvSmsEntry entry(iSmsTest.Entry());
-
-		if (entry.iType == KUidMsvMessageEntry && entry.iMtm == KUidMsgTypeSMS)
-			{
-			iMessagesReceived++;
-			iSmsTest.Printf(_L("%d: %d/%d received\n"),
-				id, iMessagesReceived, iMessagesToReceive);
-
-			TSmsDataCodingScheme::TSmsClass smsClass;
-			TMsvId expectedFolder = KMsvGlobalInBoxIndexEntryId;
-
-			const TBool hasClass = entry.Class(smsClass);
-
-			if (hasClass && smsClass == TSmsDataCodingScheme::ESmsClass2)
-				expectedFolder = iSmsSettings->Class2Folder();
-
-			retVal = (expectedFolder == entry.Parent());
-
-			if (!retVal)
-				{
-				iSmsTest.Printf(_L("Parent of message %d invalid [parent=%d expected=%d hasClass=%d class=%d smsSettings=%d\n"),
-					id, entry.Parent(), expectedFolder, hasClass, smsClass, iSmsSettings->Class2Folder());
-				}
-			}
-		}
-
-	return retVal;
-	}
-
-void CSmcmSendTest::SetMessagesToReceiveL(TInt aTestNumber)
-	{
-	TParse parse;
-	User::LeaveIfError(iSmsTest.ResolveFile(_L("SMS"), KSmsScript, parse));
-
-	CTestConfig* configFile = CTestConfig::NewLC(iSmsTest.FileSession(), KNullDesC, parse.FullName());
-
-	TBuf8<16> name;
-	name.AppendFormat(_L8("test%d"), aTestNumber);
-
-	const CTestConfigSection* section = configFile->Section(name);
-
-	if (configFile == NULL)
-		User::Leave(KErrNotFound);
-
-	iMessagesToReceive = section->ItemCount(_L8("SmsRx"));
-	CleanupStack::PopAndDestroy(configFile);
-	}
-
-
--- a/messagingappbase/smsmtm/test/src/T_smut.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2697 +0,0 @@
-// Copyright (c) 2000-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 "T_smut.h"
-#include <smss.rsg>
-#include <etelmm.h>
-#include <smutset.h>
-#include <csmsaccount.h>
-
-#include <csmsemailfields.h>
-
-#include <csmsgetdetdescinterface.h>
-
-
-const TUid KUidMsvSmsEmailFieldsStream	= {0x10204C9D};
-
-GLDEF_C TInt E32Main()
-	{	
-	__UHEAP_MARK;
-	test.Start(_L("Setup"));
-	theCleanup = CTrapCleanup::New();
-	TRAPD(ret,doMainL());		
-	test(ret==KErrNone);
-	delete theCleanup;	
-	test.Console()->SetPos(0, 13);
-	test.End();
-	test.Close();
-	__UHEAP_MARKEND;
-	return(KErrNone);
-	}
-
-LOCAL_C void doMainL()
-	{
-	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
-	CleanupStack::PushL(scheduler);
-	CActiveScheduler::Install(scheduler);
-
-	CSmsTestUtils* smsTest = CSmsTestUtils::NewL(test);
-	CleanupStack::PushL(smsTest);
-	TInt nextTest = 0;
-	
-	CSmutTest* SmcmTest = CSmutTest::NewLC(*smsTest, KNullDesC, nextTest);
-
-	SmcmTest->StartL();
-
-	CleanupStack::PopAndDestroy(3, scheduler);
-	}
-
-CSmutTest::CSmutTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest)
-: CSmsTestBase(aSmsTest, aScriptFile, aNextTest)
-	{
-	}
-
-void CSmutTest::RunAutoL()
-	{
-	iNextTest = 0;
-	
-	// Testing TMsvSmsEntry
-	iSmsTest.TestStart(++iNextTest, _L("TMsvSmsEntry"));
-	TestSmsEntryL();
-	iSmsTest.TestFinish(iNextTest);
-
-
-	// Testing settings (CSmsSettings)
-	iSmsTest.TestStart(++iNextTest, _L("CSmsSettings"));  
-	TestSettingsL();
-	iSmsTest.TestFinish(iNextTest);
-
-	// Testing number class (CSmsNumber)
-	iSmsTest.TestStart(++iNextTest, _L("CSmsNumber"));  
-	TestNumberL();
-	iSmsTest.TestFinish(iNextTest);
-	
-	// Testing email fields class (CSmsEmailFields)
-	iSmsTest.TestStart(++iNextTest, _L("CSmsEmailFields"));  
-	TestEmailFieldsL();
-	iSmsTest.TestFinish(iNextTest);
-
-	// Testing with header (CSmsHeader)
-	iSmsTest.TestStart(++iNextTest, _L("CSmsHeader"));
-	TestHeaderL();
-	iSmsTest.TestFinish(iNextTest);
-
-	// Testing with utility class (TSmsUtilities)
-	iSmsTest.TestStart(++iNextTest, _L("TSmsUtilities"));
-	TestSmsUtilitiesL();
-
-	// Testing with ECOM Plugin class (CSmsGetDetDescInterface)
-	iSmsTest.TestStart(++iNextTest, _L("CSmsGetDetDescInterface"));
-	TestSmsUtilitiesBL();
-
-	iSmsTest.TestFinish(iNextTest);
-
-	iSmsTest.TestStart(++iNextTest, _L("EMS Extensions"));
-	TestSmsEmsExtensionsL();
-
-	iSmsTest.TestFinish(iNextTest);
-
-	}
-
-CSmutTest::~CSmutTest()
-	{
-	delete iSmsHeader;
-	delete iRichText;
-	delete iParaLayer;
-	delete iCharLayer;
-	delete iDBSession;
-	
-	}
-
-void CSmutTest::ConstructL()
-	{
-	iSmsTest.SetLogToFile();
-
-	iSelection = new (ELeave) CMsvEntrySelection();
-	iTimer = CTestTimer::NewL();
-
-	iParaLayer =CParaFormatLayer::NewL();
-	iCharLayer = CCharFormatLayer::NewL();
-	iRichText = CRichText::NewL(iParaLayer, iCharLayer, CEditableText::EFlatStorage,256);
-	iDBSession = CMDBSession::NewL(CMDBSession::LatestVersion());	
-
-	CActiveScheduler::Add(this);
-	}
-
-CSmutTest* CSmutTest::NewLC(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest)
-	{
-	CSmutTest* self = new (ELeave) CSmutTest(aSmsTest, aScriptFile, aNextTest);
-	CleanupStack::PushL(self);
-
-	self->ConstructL();
-
-	return self;
-	}
-
-void CSmutTest::ShowMenuL()
-	{
-	iSmsTest.ResetMenu();
-
-	iSmsTest.AppendToMenuL(_L("Start"));
-	iSmsTest.AppendToMenuL(_L("Sms Utilities"));
-	iSmsTest.AppendToMenuL(_L("Sms Settings"));
-
-	TInt result = iSmsTest.DisplayMenu(_L("SMS Client MTM Test"));
-
-	if (result <= 0)
-		return;
-
-	switch (result)
-		{
-		case 1:
-			RunAutoL();
-			break;
-		case 2:
-			TestSmsUtilitiesL();
-			break;
-		case 3:
-			TestSettingsL();
-			break;
-		default:
-			User::Leave(KErrArgument);
-			break;
-		}
-
-	if (!iSmsTest.RunAuto())
-		{
-		iSmsTest.Printf(_L("Press any key to continue...\n"));
-		iSmsTest.Test().Getch();
-		}
-
-	ShowMenuL();
-	}
-
-void CSmutTest::TestSettingsL()
-	{
-	iSmsTest.Printf(_L("Testing Create Settings...\n"));
-
-	iSmsTest.SetEntryL(iSmsTest.iSmsServiceId);
-
-// First we test all the features of the class CSmsSettings
-// We give them different values and compare if it works
-
-	CSmsSettings* settings = CSmsSettings::NewL();
-	CleanupStack::PushL(settings);
-	iSmsTest(CompareSettings(*settings, *settings));
-	TestSettingsMembersL(*settings);
-	TestMessageSettingsMembersL(*settings);
-
-// Lets copy the values to a different instance
-	CSmsSettings* smsSettings=CSmsSettings::NewL();
-	CleanupStack::PushL(smsSettings);
-	smsSettings->CopyL(*settings);
-	iSmsTest(CompareSettings(*smsSettings, *settings));
-	CleanupStack::PopAndDestroy(smsSettings);
-	smsSettings = NULL;
-	iSmsTest.Printf(_L("Test CSmsSettings::CopyL() passed\n"));
-
-
-//	Lets create a sms service in the file system with these values
-	TestStoreRestoreSettingsL(*settings);
-
-// Lets make the previous test again; Lets give a settings instance some
-// values, store it, restore it and see that the values are still the same
-	CSmsSettings* set2=CSmsSettings::NewL();
-	CleanupStack::PushL(set2);
-	set2->AddServiceCenterL(_L("Radiolinja0"),_L("+358508771010"));
-	set2->AddServiceCenterL(_L("Radiolinja1"),_L("+358508771010"));
-	set2->AddServiceCenterL(_L("Radiolinja2"),_L("+358508771010"));
-	set2->AddServiceCenterL(_L("Radiolinja3"),_L("+358508771010"));
-	set2->AddServiceCenterL(_L("Radiolinja4"),_L("+358508771010"));
-	set2->SetDefaultServiceCenter(1);
-	iSmsTest(set2->DefaultServiceCenter()==1);
-// Validity Period	
-	set2->SetValidityPeriod(ESmsVPSixHours);
-	iSmsTest(set2->ValidityPeriod().Int()==ESmsVPSixHours);
-// Reply Quoted
-	set2->SetReplyQuoted(EFalse);
-	iSmsTest(!set2->ReplyQuoted());
-// Reject Duplicate 
-	set2->SetRejectDuplicate(ETrue);
-	iSmsTest(set2->RejectDuplicate());
-// Delivery Method
-	set2->SetDelivery(ESmsDeliveryUponRequest);
-	iSmsTest(set2->Delivery()==ESmsDeliveryUponRequest);
-// Delivery Report
-	set2->SetDeliveryReport(ETrue);
-	iSmsTest(set2->DeliveryReport());
-// Reply Path
-	set2->SetReplyPath(EFalse);
-	iSmsTest(!set2->ReplyPath());
-// Message Conversion
-	set2->SetMessageConversion(ESmsConvPIDNone);
-	iSmsTest(set2->MessageConversion()==ESmsConvPIDNone);
-// Can Concatenate
-	set2->SetCanConcatenate(ETrue);
-	iSmsTest(set2->CanConcatenate());
-// Character Set
-	set2->SetCharacterSet(TSmsDataCodingScheme::ESmsAlphabet8Bit);
-	iSmsTest(set2->CharacterSet()==TSmsDataCodingScheme::ESmsAlphabet8Bit);
-// Validity period format
-	set2->SetValidityPeriodFormat(TSmsFirstOctet::ESmsVPFSemiOctet);
-	iSmsTest(set2->ValidityPeriodFormat()==TSmsFirstOctet::ESmsVPFSemiOctet);
-// Status Report Handling
-	set2->SetStatusReportHandling(CSmsSettings::EMoveReportToInboxVisible);
-	iSmsTest(set2->StatusReportHandling()==CSmsSettings::EMoveReportToInboxVisible);
-// Special Message Handling
-	set2->SetSpecialMessageHandling(CSmsSettings::EMoveReportToInboxVisible);
-	iSmsTest(set2->SpecialMessageHandling()==CSmsSettings::EMoveReportToInboxVisible);
-
-	TestStoreRestoreSettingsL(*set2);
-
-	set2->SetClass2Folder(123);
-	TestStoreRestoreSettingsL(*set2);
-
-	CleanupStack::PopAndDestroy(set2);
-
-	iSmsTest.iServiceSettings->CopyL(*settings);  // Lets copy the current setting to the service settings
-
-	iSmsTest(CompareSettings(*iSmsTest.iServiceSettings, *settings));
-
-	iSmsTest.Printf(_L("CSmsSettings::CopyL() 2\n"));
-
-	CleanupStack::PopAndDestroy(settings);
-
-	iSmsTest.Printf(_L("Test Create Settings Passed\n"));
-
-	TestSettingsStoreToCommDbL();
-
-	iSmsTest.Printf(_L("TestSettingsStoreToCommDbL Passed\n"));
-
-	}
-
-
-TBool CSmutTest::CompareSettingsFiles(
-	RFs& aFs, const TDesC& aCompare1, const TDesC& aCompare2
-	)
-	{
-	TBool identical = ETrue;
-
-	RFileReadStream stream1;
-	RFileReadStream stream2;
-
-	// Open each stream for binary read.
-	stream1.Open(aFs, aCompare1, EFileStream | EFileRead);
-	stream2.Open(aFs, aCompare2, EFileStream | EFileRead);
-
-	TInt ret1 = KErrNone;
-	TInt ret2 = KErrNone;
-	TBool finished = EFalse;
-	TUint8 byte1 = 0;
-	TUint8 byte2 = 0;
-
-	while (!finished)
-		{
-		TRAP(ret1, byte1 = stream1.ReadUint8L());
-		TRAP(ret2, byte2 = stream2.ReadUint8L());
-
-		if (byte1 != byte2 || ret1 == KErrEof || ret2 == KErrEof)
-			{
-			// Either file data or lengths differ.
-			if ((byte1 != byte2) || (ret1 != ret2))
-				identical = EFalse;
-			finished = ETrue;
-			}
-		}
-
-	stream1.Close();
-	stream2.Close();
-
-	return identical;
-	}
-
-void CSmutTest::TestStoreRestoreSettingsL(const CSmsSettings& aSettings)
-	{
-	StoreSettingsL(aSettings);
-
-// Lets read the service and see it the values are still ok
-	CSmsSettings* set1=CSmsSettings::NewL();
-	CleanupStack::PushL(set1);
-
-	RestoreSettingsL(*set1);
-
-	iSmsTest(CompareSettings(*set1, aSettings));
-
-	CleanupStack::PopAndDestroy(set1);
-	}
-
-void CSmutTest::TestSettingsMembersL(CSmsSettings& aSettings)
-	{
-// Status Report Handling (what should be done to report messages)
-	aSettings.SetStatusReportHandling(CSmsSettings::EMoveReportToInboxInvisible);
-	iSmsTest(aSettings.StatusReportHandling()==CSmsSettings::EMoveReportToInboxInvisible);
-	aSettings.SetStatusReportHandling(CSmsSettings::EMoveReportToInboxVisible);
-	iSmsTest(aSettings.StatusReportHandling()==CSmsSettings::EMoveReportToInboxVisible);
-	aSettings.SetStatusReportHandling(CSmsSettings::EDiscardReport);
-	iSmsTest(aSettings.StatusReportHandling()==CSmsSettings::EDiscardReport);
-	aSettings.SetStatusReportHandling(CSmsSettings::EMoveReportToInboxInvisibleAndMatch);
-	iSmsTest(aSettings.StatusReportHandling()==CSmsSettings::EMoveReportToInboxInvisibleAndMatch);
-	aSettings.SetStatusReportHandling(CSmsSettings::EMoveReportToInboxVisibleAndMatch);
-	iSmsTest(aSettings.StatusReportHandling()==CSmsSettings::EMoveReportToInboxVisibleAndMatch);
-	aSettings.SetStatusReportHandling(CSmsSettings::EDiscardReportAndMatch);
-	iSmsTest(aSettings.StatusReportHandling()==CSmsSettings::EDiscardReportAndMatch);
-	iSmsTest.Printf(_L("Test Status Report Handling Passed\n"));
-
-// SC handling
-	aSettings.AddServiceCenterL(_L("Radiolinja0"),_L("+358508771010"));
-	aSettings.AddServiceCenterL(_L("Radiolinja1"),_L("+358508771010"));
-	aSettings.AddServiceCenterL(_L("Radiolinja2"),_L("+358508771010"));
-	aSettings.AddServiceCenterL(_L("Radiolinja3"),_L("+358508771010"));
-	aSettings.AddServiceCenterL(_L("Radiolinja4"),_L("+358508771010"));
-	iSmsTest(aSettings.GetServiceCenter(0).Name()==_L("Radiolinja0"));
-	aSettings.RemoveServiceCenter(aSettings.ServiceCenterCount()-3);
-	aSettings.RemoveServiceCenter(aSettings.ServiceCenterCount()-2);
-	iSmsTest(aSettings.GetServiceCenter(1).Name()==_L("Radiolinja1"));
-	iSmsTest(aSettings.GetServiceCenter(2).Name()==_L("Radiolinja4"));
-	iSmsTest(aSettings.GetServiceCenter(2).Address()==_L("+358508771010"));
-	aSettings.RemoveServiceCenter(aSettings.ServiceCenterCount()-1);
-	aSettings.RemoveServiceCenter(aSettings.ServiceCenterCount()-1);
-	aSettings.RemoveServiceCenter(aSettings.ServiceCenterCount()-1);
-//	aSettings.RemoveServiceCenter(aSettings.ServiceCenterCount()-1); // this would be -1
-	aSettings.AddServiceCenterL(_L("Radiolinja0"),_L("+358508771010"));
-	aSettings.AddServiceCenterL(_L("Radiolinja1"),_L("+358508771010"));
-	aSettings.AddServiceCenterL(_L("Radiolinja2"),_L("+358508771010"));
-	aSettings.SetDefaultServiceCenter(1);
-	iSmsTest(aSettings.DefaultServiceCenter()==1);
-	aSettings.SetDefaultServiceCenter(2);
-	iSmsTest(aSettings.DefaultServiceCenter()==2);
-	iSmsTest.Printf(_L("Test Default SC Passed\n"));
-
-// Special Message Handling (what should be done to special messages)
-	aSettings.SetSpecialMessageHandling(CSmsSettings::EMoveReportToInboxInvisible);
-	iSmsTest(aSettings.SpecialMessageHandling()==CSmsSettings::EMoveReportToInboxInvisible);
-	aSettings.SetSpecialMessageHandling(CSmsSettings::EMoveReportToInboxVisible);
-	iSmsTest(aSettings.SpecialMessageHandling()==CSmsSettings::EMoveReportToInboxVisible);
-	aSettings.SetSpecialMessageHandling(CSmsSettings::EDiscardReport);
-	iSmsTest(aSettings.SpecialMessageHandling()==CSmsSettings::EDiscardReport);
-	aSettings.SetSpecialMessageHandling(CSmsSettings::EMoveReportToInboxInvisibleAndMatch);
-	iSmsTest(aSettings.SpecialMessageHandling()==CSmsSettings::EMoveReportToInboxInvisibleAndMatch);
-	aSettings.SetSpecialMessageHandling(CSmsSettings::EMoveReportToInboxVisibleAndMatch);
-	iSmsTest(aSettings.SpecialMessageHandling()==CSmsSettings::EMoveReportToInboxVisibleAndMatch);
-	aSettings.SetSpecialMessageHandling(CSmsSettings::EDiscardReportAndMatch);
-	iSmsTest(aSettings.SpecialMessageHandling()==CSmsSettings::EDiscardReportAndMatch);
-	iSmsTest.Printf(_L("Test Special Message Handling Passed\n"));
-
-//CommDbAction
-	aSettings.SetCommDbAction(CSmsSettings::ENone);
-	iSmsTest(aSettings.CommDbAction() == CSmsSettings::ENone);
-	aSettings.SetCommDbAction(CSmsSettings::EStoreToCommDb);
-	iSmsTest(aSettings.CommDbAction() == CSmsSettings::EStoreToCommDb);
-	iSmsTest.Printf(_L("Test CommDb Action Passed\n"));
-
-//SmsBearerAction
-	aSettings.SetSmsBearerAction(CSmsSettings::ENone);
-	iSmsTest(aSettings.SmsBearerAction() == CSmsSettings::ENone);
-	aSettings.SetSmsBearerAction(CSmsSettings::EStoreToCommDb);
-	iSmsTest(aSettings.SmsBearerAction() == CSmsSettings::EStoreToCommDb);
-	iSmsTest.Printf(_L("Test SMS Bearer Action Passed\n"));
-
-//SmsBearer
-	aSettings.SetSmsBearer(CSmsSettings::ESmsBearerPacketOnly);
-	iSmsTest(aSettings.SmsBearer() == CSmsSettings::ESmsBearerPacketOnly);
-	aSettings.SetSmsBearer(CSmsSettings::ESmsBearerPacketOnly);
-	iSmsTest(aSettings.SmsBearer() == CSmsSettings::ESmsBearerPacketOnly);
-	aSettings.SetSmsBearer(CSmsSettings::ESmsBearerCircuitOnly);
-	iSmsTest(aSettings.SmsBearer() == CSmsSettings::ESmsBearerCircuitOnly);
-	aSettings.SetSmsBearer(CSmsSettings::ESmsBearerPacketPreferred);
-	iSmsTest(aSettings.SmsBearer() == CSmsSettings::ESmsBearerPacketPreferred);
-	aSettings.SetSmsBearer(CSmsSettings::ESmsBearerCircuitPreferred);
-	iSmsTest(aSettings.SmsBearer() == CSmsSettings::ESmsBearerCircuitPreferred);
-	iSmsTest.Printf(_L("Test SMS Bearer Passed\n"));
-
-// Reply Quoted
-	aSettings.SetReplyQuoted(EFalse);
-	iSmsTest(!aSettings.ReplyQuoted());
-	aSettings.SetReplyQuoted(ETrue);
-	iSmsTest(aSettings.ReplyQuoted());
-	iSmsTest.Printf(_L("Test Reply Quoted Passed\n"));
-
-// Delivery Method
-	aSettings.SetDelivery(ESmsDeliveryUponRequest);
-	iSmsTest(aSettings.Delivery()==ESmsDeliveryUponRequest);
-	aSettings.SetDelivery(ESmsDeliveryScheduled);
-	iSmsTest(aSettings.Delivery()==ESmsDeliveryScheduled);
-	aSettings.SetDelivery(ESmsDeliveryImmediately);
-	iSmsTest(aSettings.Delivery()==ESmsDeliveryImmediately);
-	iSmsTest.Printf(_L("Test Delivery Passed\n"));
-
-// Class2Folder
-	iSmsTest(aSettings.Class2Folder() == KMsvGlobalInBoxIndexEntryId);
-	aSettings.SetClass2Folder(1);
-	iSmsTest(aSettings.Class2Folder() == 1);
-	iSmsTest.Printf(_L("Test Class2Folder Passed\n"));	
-
-// Description length
-	iSmsTest(aSettings.DescriptionLength() == KSmsDescriptionLength);
-	aSettings.SetDescriptionLength(100);
-	iSmsTest(aSettings.DescriptionLength() == 100);
-	iSmsTest.Printf(_L("Test DescriptionLength Passed\n"));	
-	}
-
-void CSmutTest::TestMessageSettingsMembersL(CSmsMessageSettings& aSettings)
-	{
-
-// Reject Duplicate 
-	aSettings.SetRejectDuplicate(ETrue);
-	iSmsTest(aSettings.RejectDuplicate());
-	aSettings.SetRejectDuplicate(EFalse);
-	iSmsTest(!aSettings.RejectDuplicate());
-	iSmsTest.Printf(_L("Test Reject Duplicate Passed\n"));
-
-// Delivery Report
-	aSettings.SetDeliveryReport(ETrue);
-	iSmsTest(aSettings.DeliveryReport());
-	aSettings.SetDeliveryReport(EFalse);
-	iSmsTest(!aSettings.DeliveryReport());
-	iSmsTest.Printf(_L("Test Delivery Report Passed\n"));
-
-// Reply Path
-	aSettings.SetReplyPath(EFalse);
-	iSmsTest(aSettings.ReplyPath()==EFalse);
-	aSettings.SetReplyPath(ETrue);
-	iSmsTest(aSettings.ReplyPath());
-	iSmsTest.Printf(_L("Test Reply Path Passed\n"));
-
-// Validity period format
-	aSettings.SetValidityPeriodFormat(TSmsFirstOctet::ESmsVPFNone);
-	iSmsTest(aSettings.ValidityPeriodFormat()==TSmsFirstOctet::ESmsVPFNone);
-	aSettings.SetValidityPeriodFormat(TSmsFirstOctet::ESmsVPFEnhanced);
-	iSmsTest(aSettings.ValidityPeriodFormat()==TSmsFirstOctet::ESmsVPFEnhanced);
-	aSettings.SetValidityPeriodFormat(TSmsFirstOctet::ESmsVPFInteger);
-	iSmsTest(aSettings.ValidityPeriodFormat()==TSmsFirstOctet::ESmsVPFInteger);
-	aSettings.SetValidityPeriodFormat(TSmsFirstOctet::ESmsVPFSemiOctet);
-	iSmsTest(aSettings.ValidityPeriodFormat()==TSmsFirstOctet::ESmsVPFSemiOctet);
-	iSmsTest.Printf(_L("Test Validity Period Format Passed\n"));
-
-// Message Conversion (following conversions are supported)
-	aSettings.SetMessageConversion(ESmsConvFax);
-	iSmsTest(aSettings.MessageConversion()==ESmsConvFax);
-	aSettings.SetMessageConversion(ESmsConvX400);
-	iSmsTest(aSettings.MessageConversion()==ESmsConvX400);
-	aSettings.SetMessageConversion(ESmsConvPaging);
-	iSmsTest(aSettings.MessageConversion()==ESmsConvPaging);
-	aSettings.SetMessageConversion(ESmsConvMail);
-	iSmsTest(aSettings.MessageConversion()==ESmsConvMail);
-	aSettings.SetMessageConversion(ESmsConvErmes);
-	iSmsTest(aSettings.MessageConversion()==ESmsConvErmes);
-	aSettings.SetMessageConversion(ESmsConvSpeech);
-	iSmsTest(aSettings.MessageConversion()==ESmsConvSpeech);
-	aSettings.SetMessageConversion(ESmsConvPIDNone);
-	iSmsTest(aSettings.MessageConversion()==ESmsConvPIDNone);
-	iSmsTest.Printf(_L("Test Message Conversion Passed\n"));
-
-// Validity Period	
-	aSettings.SetValidityPeriod(ESmsVPHour);
-	iSmsTest(aSettings.ValidityPeriod().Int()==ESmsVPHour);
-	aSettings.SetValidityPeriod(ESmsVPSixHours);
-	iSmsTest(aSettings.ValidityPeriod().Int()==ESmsVPSixHours);
-	aSettings.SetValidityPeriod(ESmsVP24Hours);
-	iSmsTest(aSettings.ValidityPeriod().Int()==ESmsVP24Hours);
-	aSettings.SetValidityPeriod(ESmsVPMaximum);
-	iSmsTest(aSettings.ValidityPeriod().Int()==ESmsVPMaximum);
-	aSettings.SetValidityPeriod(ESmsVPWeek);
-	iSmsTest(aSettings.ValidityPeriod().Int()==ESmsVPWeek);
-	iSmsTest.Printf(_L("Test Validity Period Passed\n"));
-
-// Can Concatenate (write messages with more than 160 characters)
-	aSettings.SetCanConcatenate(ETrue);
-	iSmsTest(aSettings.CanConcatenate());
-	aSettings.SetCanConcatenate(EFalse);
-	iSmsTest(aSettings.CanConcatenate()==EFalse);
-	iSmsTest.Printf(_L("Test Can Concatenate Passed\n"));
-
-// Character Set (following character sets are supported)
-	aSettings.SetCharacterSet(TSmsDataCodingScheme::ESmsAlphabet7Bit);
-	iSmsTest(aSettings.CharacterSet()==TSmsDataCodingScheme::ESmsAlphabet7Bit);
-	aSettings.SetCharacterSet(TSmsDataCodingScheme::ESmsAlphabetUCS2);
-	iSmsTest(aSettings.CharacterSet()==TSmsDataCodingScheme::ESmsAlphabetUCS2);
-	aSettings.SetCharacterSet(TSmsDataCodingScheme::ESmsAlphabet8Bit);
-	iSmsTest(aSettings.CharacterSet()==TSmsDataCodingScheme::ESmsAlphabet8Bit);
-	iSmsTest.Printf(_L("Test Character Set Passed\n"));
-	}
-
-TBool CSmutTest::CompareSettings(const CSmsSettings& aLeft, const CSmsSettings& aRight, TBool aTestSC)
-	{
-	TCompare compare(CompareMessageSettings(aLeft, aRight));
-
-	compare(aLeft.CommDbAction() == aRight.CommDbAction());
-	compare(aLeft.SmsBearerAction() == aRight.SmsBearerAction());
-	compare(aLeft.SmsBearer() == aRight.SmsBearer());
-	compare(aLeft.Delivery() == aRight.Delivery());
-	compare(CompareBools(aLeft.ReplyQuoted(), aRight.ReplyQuoted()));
-	compare(aLeft.SpecialMessageHandling() == aRight.SpecialMessageHandling());
-	compare(aLeft.StatusReportHandling() == aRight.StatusReportHandling());
-
-	if (aTestSC)
-		{
-		compare(aLeft.DefaultServiceCenter() == aRight.DefaultServiceCenter());
-		compare(aLeft.ServiceCenterCount() == aRight.ServiceCenterCount());
-
-		TInt count = aLeft.ServiceCenterCount();
-
-		while (count--)
-			{
-			compare(CompareServiceCenters(aLeft.GetServiceCenter(count), aRight.GetServiceCenter(count)));
-			}
-		}		
-
-	compare(aLeft.Class2Folder() == aRight.Class2Folder());
-	compare(aLeft.DescriptionLength() == aRight.DescriptionLength());
-
-	return compare;
-	}
-
-TBool CSmutTest::CompareMessageSettings(const CSmsMessageSettings& aLeft, const CSmsMessageSettings& aRight)
-	{
-	TCompare compare(CompareBools(aLeft.CanConcatenate(), aRight.CanConcatenate()));
-	compare(aLeft.CharacterSet() == aRight.CharacterSet());
-	compare(CompareBools(aLeft.DeliveryReport(), aRight.DeliveryReport()));
-	compare(aLeft.MessageConversion() == aRight.MessageConversion());
-	compare(CompareBools(aLeft.RejectDuplicate(), aRight.RejectDuplicate()));
-	compare(CompareBools(aLeft.ReplyPath(), aRight.ReplyPath()));
-	compare(aLeft.ValidityPeriod() == aRight.ValidityPeriod());
-	compare(aLeft.ValidityPeriodFormat() == aRight.ValidityPeriodFormat());
-	return compare;
-	}
-
-void CSmutTest::TestSettingsRestoreDefectL()
-	{
-	//Test fix for defects EDNAALR-4KTKTD (CSmsSettings::RestoreL() should leave if stream not present)
-	//and EDNAALR-4KTKLP (CSmsSettings::InternalizeL() causes memory leak)
-
-	CSmsSettings* settings = CSmsSettings::NewL();
-	CleanupStack::PushL(settings);
-
-	//Test defect fix for EDNAALR-4KTKTD (CSmsSettings::RestoreL() should leave if stream not present)
-	const TMsvId id = iSmsTest.CreateDummyMessageToSendL();
-	Session().CleanupEntryPushL(id);
-	iSmsTest.SetEntryL(id);
-
-	iSmsTest.Printf(_L("TestSettingsRestoreDefectL Created dummy message\n"));
-
-	TRAPD(err, RestoreSettingsL(*settings));
-
-	iSmsTest.Printf(_L("TestSettingsRestoreDefectL RestoreL 1 with error %d\n"), err);
-	iSmsTest.Printf(_L("Expected %d\n"), KErrNotFound);
-	iSmsTest(err == KErrNotFound);
-
-	//Test defect fix for EDNAALR-4KTKLP (CSmsSettings::InternalizeL() causes memory leak)
-//	iSmsTest.SetEntryL(id);
-	StoreSettingsL(*settings);
-
-	iSmsTest.Printf(_L("TestSettingsRestoreDefectL StoreL 1\n"));
-
-	settings->AddServiceCenterL(_L("Unknown"), _L("447785016005"));
-
-	RestoreSettingsL(*settings);
-
-	Session().CleanupEntryPop();
-	Session().RemoveEntry(id);
-
-	CleanupStack::PopAndDestroy(settings);
-	iSmsTest.Printf(_L("TestSettingsRestoreDefectL RestoreL 2\n"));
-	}
-
-
-void CSmutTest::TestSettingsStoreToCommDbL()
-	{
-	iSmsTest.Test().Next(_L("Storing CSmsSettings to CommDb\n"));
-	iSmsTest.Printf(_L("Test Store Settings to CommDb\n"));
-
-	CSmsSettings* settings1 = CSmsSettings::NewL();
-	CleanupStack::PushL(settings1);
-
-	CSmsSettings* settings2 = CSmsSettings::NewL();
-	CleanupStack::PushL(settings2);
-
-	iSmsTest(CompareSettings(*settings1, *settings2));
-
-	settings1->SetCommDbAction(CSmsSettings::EStoreToCommDb);
-	settings1->AddServiceCenterL(_L("Vodafone"), _L("+447785016005"));
-	settings1->SetDeliveryReport(ETrue);
-	settings1->SetValidityPeriod(1000);
-
-	iSmsTest.SetEntryL(iSmsTest.iSmsServiceId);
-
-	StoreSettingsL(*settings1);
-	iSmsTest.Printf(_L("\tNew Settings...\n"));
-	iSmsTest(CompareSettingsAndCommDbL(*settings1));
-
-	settings1->GetServiceCenter(settings1->DefaultServiceCenter()).SetAddressL(_L("+3854354433"));
-
-	StoreSettingsL(*settings1);
-	iSmsTest.Printf(_L("\tSC Address Changed...\n"));
-	iSmsTest(CompareSettingsAndCommDbL(*settings1));
-	
-	settings1->SetDeliveryReport(EFalse);
-
-	StoreSettingsL(*settings1);
-	iSmsTest.Printf(_L("\tDelivery Report Changed...\n"));
-	iSmsTest(CompareSettingsAndCommDbL(*settings1));
-
-	settings1->SetValidityPeriod(2000);
-
-	StoreSettingsL(*settings1);
-	iSmsTest.Printf(_L("\tValidity Period Changed...\n"));
-	iSmsTest(CompareSettingsAndCommDbL(*settings1));
-
-	settings1->GetServiceCenter(settings1->DefaultServiceCenter()).SetAddressL(_L("+48996655888"));
-	settings1->SetDeliveryReport(ETrue);
-	settings1->SetValidityPeriod(3000);
-
-	StoreSettingsL(*settings1);
-	iSmsTest.Printf(_L("\tAll Settings Changed...\n"));
-	iSmsTest(CompareSettingsAndCommDbL(*settings1));
-
-	settings1->AddServiceCenterL(_L("Radio"), _L("+385669988"));
-	settings1->SetDefaultServiceCenter(settings1->ServiceCenterCount()-1);
-
-	StoreSettingsL(*settings1);
-	iSmsTest.Printf(_L("\tDefaultSC Changed...\n"));
-	iSmsTest(CompareSettingsAndCommDbL(*settings1));
-
-	settings1->SetCommDbAction(CSmsSettings::ENone);
-	settings1->GetServiceCenter(settings1->DefaultServiceCenter()).SetAddressL(_L("+123456789"));
-	settings1->SetDeliveryReport(EFalse);
-	settings1->SetValidityPeriod(4000);
-
-	iSmsTest.Printf(_L("\tTesting Setting Different from CommDb...\n"));
-	iSmsTest(!CompareSettingsAndCommDbL(*settings1));
-
-	TInt count = settings1->ServiceCenterCount();
-
-	while (count--)
-		{
-		settings1->RemoveServiceCenter(count);
-		}
-
-	iSmsTest.Printf(_L("\tTesting Setting Different from CommDb...\n"));
-	iSmsTest(!CompareSettingsAndCommDbL(*settings1));
-
-	iSmsTest.Printf(_L("\tRestore settings from store...\n"));
-	RestoreSettingsL(*settings2);
-	iSmsTest(CompareSettingsAndCommDbL(*settings2));
-
-//Test SMS Bearer
-
-	iSmsTest.Printf(_L("\tTest Store SMS Bearer...\n"));
-
-//Test 1
-
-	settings1->SetSmsBearerAction(CSmsSettings::EStoreToCommDb);
-	settings1->SetSmsBearer(CSmsSettings::ESmsBearerPacketOnly);
-
-	StoreSettingsL(*settings1);
-	iSmsTest(CompareSettingsAndSmsBearerL(*settings1));
-	
-//Test 2
-
-	settings1->SetSmsBearer(CSmsSettings::ESmsBearerCircuitOnly);
-	iSmsTest(!CompareSettingsAndSmsBearerL(*settings1));
-
-//Test 3
-
-	StoreSettingsL(*settings1);
-	iSmsTest(CompareSettingsAndSmsBearerL(*settings1));
-
-	RestoreSettingsL(*settings2);
-	iSmsTest(CompareSettingsAndSmsBearerL(*settings2));
-
-//Test 4
-
-	settings1->SetSmsBearerAction(CSmsSettings::ENone);
-	StoreSettingsL(*settings1);
-	iSmsTest(CompareSettingsAndSmsBearerL(*settings1));
-
-//Test 5
-
-	settings1->SetSmsBearer(CSmsSettings::ESmsBearerCircuitPreferred);
-	iSmsTest(!CompareSettingsAndSmsBearerL(*settings1));
-	StoreSettingsL(*settings1);
-	iSmsTest(!CompareSettingsAndSmsBearerL(*settings1));
-
-	CleanupStack::PopAndDestroy(2); //settings1, settings2
-	}
-
-TBool CSmutTest::CompareSettingsAndCommDbL(const CSmsSettings& aSettings) const
-	{
-	TCompare compare = ETrue;
-	TBuf<256> scAddress;
-	CMDBRecordSet<CCDGlobalSettingsRecord> globalSettingsRecord(KCDTIdGlobalSettingsRecord);
-	TRAPD(err, globalSettingsRecord.LoadL(*iDBSession));
-	if(err != KErrNone)
-		{
-		User::Leave(KErrNotFound);	
-		}
-	CCDModemBearerRecord *modemBearerRecord = static_cast<CCDModemBearerRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdModemBearerRecord));
-	CleanupStack::PushL(modemBearerRecord);
-	modemBearerRecord->SetRecordId(((CCDGlobalSettingsRecord*)globalSettingsRecord.iRecords[0])->iModemForPhoneServicesAndSMS); 
-	modemBearerRecord->LoadL(*iDBSession);
-	scAddress = modemBearerRecord->iMessageCentreNumber;
-
-	if (aSettings.DefaultServiceCenter() < 0 || !aSettings.ServiceCenterCount())
-		{
-		compare(!scAddress.Length());
-		}
-	else
-		{
-		compare(scAddress == aSettings.GetServiceCenter(aSettings.DefaultServiceCenter()).Address());
-		}
-	
-	TUint32 valPeriod = 0;
-	valPeriod = modemBearerRecord->iMessageValidityPeriod;
-	compare(valPeriod == (TUint32) aSettings.ValidityPeriod().Int());
-	
-	TBool delReport = EFalse;
-	delReport = modemBearerRecord->iMessageDeliveryReport;
-	compare(delReport ? aSettings.DeliveryReport() : !aSettings.DeliveryReport());
-
-	CleanupStack::PopAndDestroy(modemBearerRecord);	
-
-	return compare;
-	}
-
-TBool CSmutTest::CompareSettingsAndSmsBearerL(const CSmsSettings& aSettings) const
-	{
-	CMDBRecordSet<CCDGlobalSettingsRecord> globalSettingsRecord(KCDTIdGlobalSettingsRecord);
-	globalSettingsRecord.LoadL(*iDBSession);
-	TUint32 smsBearer = ((CCDGlobalSettingsRecord*)globalSettingsRecord.iRecords[0])->iSMSBearer;		
-	TCompare compare(smsBearer == (TUint32) aSettings.SmsBearer());
-	return compare;
-	}
-
-void CSmutTest::StoreNumberL(const CSmsNumber& aNumber, TUid aStreamId)
-	{
-	CMsvStore* store = iSmsTest.EditStoreL(); // lets edit the entry
-	CleanupStack::PushL(store);
-
-	RMsvWriteStream out;
-	out.AssignLC(*store, aStreamId);		// file stream id ok?
-	aNumber.ExternalizeL(out);				// lets extrenalise the instance
-	out.CommitL();
-	store->CommitL();
-
-	CleanupStack::PopAndDestroy(2, store);
-	}
-
-void CSmutTest::RestoreNumberL(CSmsNumber& rNumber, TUid aStreamId)
-	{
-	CMsvStore* store = iSmsTest.ReadStoreL(); // prepare the store for reading
-	CleanupStack::PushL(store);
-
-	RMsvReadStream in;
-	in.OpenLC(*store, aStreamId);		// lets open the store for 
-	rNumber.InternalizeL(in);				// internalising the address/name
-
-	CleanupStack::PopAndDestroy(2, store);
-	}
-
-void CSmutTest::StoreHeaderL(const CSmsHeader& aHeader)
-	{
-	CMsvStore* store = iSmsTest.EditStoreL();
-	CleanupStack::PushL(store);
-
-	aHeader.StoreL(*store);
-	store->CommitL();
-
-	CleanupStack::PopAndDestroy(store);
-	}
-
-void CSmutTest::RestoreHeaderL(CSmsHeader& aHeader)
-	{
-	CMsvStore* store = iSmsTest.ReadStoreL();
-	CleanupStack::PushL(store);
-
-	aHeader.RestoreL(*store);
-
-	CleanupStack::PopAndDestroy(store);
-	}
-
-void CSmutTest::StoreSettingsL(const CSmsSettings& aSettings)
-	{
-	CSmsAccount* account = CSmsAccount::NewLC();
-	account->SaveSettingsL(aSettings);
-	CleanupStack::PopAndDestroy(account);    
-	}
-
-void CSmutTest::RestoreSettingsL(CSmsSettings& aSettings)
-	{
-	CSmsAccount* account = CSmsAccount::NewLC();
-	account->LoadSettingsL(aSettings);
-	CleanupStack::PopAndDestroy(account);    
-	}
-
-TBool CSmutTest::CompareServiceCenters(const CSmsServiceCenter& aLeft, const CSmsServiceCenter& aRight)
-	{
-	TCompare compare(aLeft.Name() == aRight.Name());
-	compare(aLeft.Address() == aRight.Address());
-	return compare;	
-	}
-
-TBool CSmutTest::CompareNumbers(const CSmsNumber& aLeft, const CSmsNumber& aRight)
-	{
-	TCompare compare(aLeft.Name() == aRight.Name());
-	compare(aLeft.Address() == aRight.Address());
-	compare(aLeft.LogId() == aRight.LogId());
-	compare(aLeft.AckStatus(ESmsAckTypeDelivery) == aRight.AckStatus(ESmsAckTypeDelivery));	
-	return compare;
-	}
-
-void CSmutTest::TestNumberL()
-	{
-	iSmsTest.Test().Next(_L("Testing CSmsNumber"));
-	iSmsTest.Printf(_L("Preparing test CSmsNumber"));
-
-	TMsvId id=iSmsTest.CreateDummyMessageToSendL();
-	Session().CleanupEntryPushL(id);
-	iSmsTest.SetEntryL(id);
-
-	CSmsNumber* number0=CSmsNumber::NewL();  
-	CleanupStack::PushL(number0);
-
-	CSmsNumber* number=CSmsNumber::NewL();  // create the instance
-	CleanupStack::PushL(number);
-
-	// Testing the features of CSmsNumber
-	// The max length for a name is 256 characters
-	// The max length for a number is 20 characters
-
-// Lets take an ordinary number, test it, then store and restore it
-// and see if the values are still ok.
-
-	number->SetNameL(_L("Radiolinja1"));	
-	number->SetAddressL(_L("+358508771010")); 
-	number->SetLogId(123456789);	
-	number->SetAckStatus(ESmsAckTypeDelivery, CSmsNumber::EAckSuccessful);
-
-	iSmsTest(number->Name()==_L("Radiolinja1")); // name ok?
-	iSmsTest(number->Address()==_L("+358508771010")); // number ok?
-	iSmsTest(number->LogId() == 123456789);
-	iSmsTest(number->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckSuccessful);
-
-	StoreNumberL(*number);
-	RestoreNumberL(*number0);
-	iSmsTest(CompareNumbers(*number0, *number));
-	
-// Lets try the max length of the telephone address, store and
-// restore it and see if it works
-
-	number->SetNameL(_L("Whatsthemaximumlengthforthis?Whatsthemaximumlengthforthis?Whatsthemaximumlengthforthis?"));
-	number->SetAddressL(_L("+0123456789012345678"));
-	number->SetLogId(987654321);	
-	number->SetAckStatus(ESmsAckTypeDelivery, CSmsNumber::EAckError);
-
-	iSmsTest(number->Name()==_L("Whatsthemaximumlengthforthis?Whatsthemaximumlengthforthis?Whatsthemaximumlengthforthis?"));
-	iSmsTest(number->Address()==_L("+0123456789012345678"));
-	iSmsTest(number->LogId() == 987654321);
-	iSmsTest(number->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckError);
-
-	StoreNumberL(*number);
-	RestoreNumberL(*number0);
-	iSmsTest(CompareNumbers(*number, *number0));
-
-// Lets use special Scandinavian letters both in the name and
-// address, store and restore and see if they are ok
-	number->SetNameL(_L("ÖÄÅåöä"));
-	number->SetAddressL(_L("åäöÅÄÖ"));
-	number->SetLogId(123456789);	
-	number->SetAckStatus(ESmsAckTypeDelivery, CSmsNumber::EAckSuccessful);
-
-	iSmsTest(number->Name()==_L("ÖÄÅåöä"));
-	iSmsTest(number->Address()==_L("åäöÅÄÖ"));
-	iSmsTest(number->LogId() == 123456789);
-	iSmsTest(number->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckSuccessful);
-
-	StoreNumberL(*number);
-	RestoreNumberL(*number0);
-	iSmsTest(CompareNumbers(*number, *number0));
-
-//  Lets try if both the number and the name can be empty,
-//	store and restore it and see if they still match
-	number->SetNameL(_L(""));
-	number->SetAddressL(_L(""));
-	number->SetLogId(987654321);	
-	number->SetAckStatus(ESmsAckTypeDelivery, CSmsNumber::EAckError);
-
-	iSmsTest(number->Name()==_L(""));
-	iSmsTest(number->Address()==_L(""));
-	iSmsTest(number->LogId() == 987654321);
-	iSmsTest(number->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckError);
-
-	StoreNumberL(*number);
-	RestoreNumberL(*number0);
-	iSmsTest(CompareNumbers(*number, *number0));
-
-//  Lets try [alt+255] as both the name and number, store and	
-//  restore it and see if it works
-	number->SetNameL(_L(" ")); //alt+255
-	number->SetAddressL(_L(" "));
-	number->SetLogId(123456789);	
-	number->SetAckStatus(ESmsAckTypeDelivery, CSmsNumber::EAckSuccessful);
-
-	iSmsTest(number->Name()==_L(" "));
-	iSmsTest(number->Address()==_L(" "));
-	iSmsTest(number->LogId() == 123456789);
-	iSmsTest(number->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckSuccessful);
-
-	StoreNumberL(*number);
-	RestoreNumberL(*number0);
-	iSmsTest(CompareNumbers(*number, *number0));
-
-// Test CSmsNumber::CopyL()
-
-	number->SetNameL(_L("DavidCuando"));	
-	number->SetAddressL(_L("+447747065627")); 
-	number->SetLogId(118888);	
-	number->SetAckStatus(ESmsAckTypeDelivery, CSmsNumber::EPendingAck);
-
-	iSmsTest(number->Name()==_L("DavidCuando")); 
-	iSmsTest(number->Address()==_L("+447747065627")); 
-	iSmsTest(number->LogId() == 118888);
-	iSmsTest(number->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);
-
-	number0->CopyL(*number);
-	iSmsTest(CompareNumbers(*number0, *number));
-
-	CleanupStack::PopAndDestroy(2, number0);
-
-// Test NewL(CSmsNumber&)
-
-	number=CSmsNumber::NewL();  // create the instance
-	CleanupStack::PushL(number);
-
-	number->SetNameL(_L("DavidCuando"));	
-	number->SetAddressL(_L("+447747065627")); 
-	number->SetLogId(118888);	
-	number->SetAckStatus(ESmsAckTypeDelivery, CSmsNumber::EPendingAck);
-
-	iSmsTest(number->Name()==_L("DavidCuando")); 
-	iSmsTest(number->Address()==_L("+447747065627")); 
-	iSmsTest(number->LogId() == 118888);
-	iSmsTest(number->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);
-
-	number0=CSmsNumber::NewL(*number);  
-	CleanupStack::PushL(number0);
-
-	iSmsTest(CompareNumbers(*number0, *number));
-	CleanupStack::PopAndDestroy(2, number);
-
-	//Test for defect EDNMOHN-4LDDK8
-	number=CSmsNumber::NewL();  // create the instance
-	CleanupStack::PushL(number);
-
-	StoreNumberL(*number);
-	RestoreNumberL(*number);
-
-	number->SetAddressL(_L("+4477676545"));
-	//End Test for defect  EDNMOHN-4LDDK8
-
-	CleanupStack::PopAndDestroy(number);
-
-	Session().CleanupEntryPop();
-	Session().RemoveEntry(id);
-	}
-	
-void CSmutTest::StoreEmailFieldsL(const CSmsEmailFields& aEmailFields)
-	{
-	CMsvStore* store = iSmsTest.EditStoreL(); 
-	CleanupStack::PushL(store);
-
-	aEmailFields.StoreL(*store);
-	store->CommitL();
-
-	CleanupStack::PopAndDestroy(store);
-	}
-
-void CSmutTest::RestoreEmailFieldsL(CSmsEmailFields& aEmailFields)
-	{
-	CMsvStore* store = iSmsTest.ReadStoreL(); // prepare the store for reading
-	CleanupStack::PushL(store);
-	
-	aEmailFields.RestoreL(*store);
-
-	CleanupStack::PopAndDestroy(store);
-	}
-	
-TBool CSmutTest::CompareEmailFields(const CSmsEmailFields& aFields1, const CSmsEmailFields& aFields2)
-	{
-	TBool same = CompareEmailFieldsAddresses(aFields1.Addresses(), aFields2.Addresses());
-	if( same )
-		same = (aFields2.Subject().Compare(aFields1.Subject()) == 0);
-	if( same )
-		same = (!aFields2.HasAddress()&&!aFields1.HasAddress() || aFields2.HasAddress()&&aFields1.HasAddress());
-	if( same )
-		same = (aFields2.Length() == aFields1.Length());
-	return same;
-	}
-	
-TBool CSmutTest::CompareEmailFieldsAddresses(const MDesCArray& aAddresses1, const MDesCArray& aAddresses2)
-	{
-	TBool same = (aAddresses1.MdcaCount() == aAddresses2.MdcaCount());
-	if( same )
-		{
-		TInt count = aAddresses1.MdcaCount();
-		while( same && count-- > 0)
-			{
-			same = (aAddresses2.MdcaPoint(count).Compare(aAddresses1.MdcaPoint(count)) == 0);
-			}
-		}		
-	return same;
-	}
-	
-void CSmutTest::TestEmailFieldsL()
-	{
-	iSmsTest.Test().Next(_L("Testing CSmsEmailFields"));
-	iSmsTest.Printf(_L("Preparing test CSmsEmailFields"));
-
-	TMsvId id=iSmsTest.CreateDummyMessageToSendL();
-	Session().CleanupEntryPushL(id);
-	iSmsTest.SetEntryL(id);
-
-	_LIT(KTestAddress, "support@symbian.com");
-	_LIT(KTestSubject, "Happy Days!");
-	
-	// Test CSmsEmailFields::NewL()
-	CSmsEmailFields* fields1 = CSmsEmailFields::NewL();
-	CleanupStack::PushL(fields1);
-	
-	iSmsTest(fields1->Addresses().MdcaCount()==0);
-	iSmsTest(fields1->Subject().Compare(KNullDesC()) == 0);
-	iSmsTest(!fields1->HasAddress());
-	iSmsTest(fields1->Length() == 0);
-	
-	// Test address and subject accessors, has-address, length and reset methods
-	fields1->AddAddressL(KNullDesC);	// empty address - does nothing!
-	iSmsTest(fields1->Addresses().MdcaCount()==0);
-	iSmsTest(fields1->Subject().Compare(KNullDesC()) == 0);
-	iSmsTest(!fields1->HasAddress());
-	iSmsTest(fields1->Length() == 0);
-	
-	fields1->AddAddressL(KTestAddress);
-	iSmsTest(fields1->Addresses().MdcaCount()==1);	
-	iSmsTest(fields1->Addresses().MdcaPoint(0).Compare(KTestAddress) == 0);
-	iSmsTest(fields1->HasAddress());
-	iSmsTest(fields1->Length() == KTestAddress().Length() + 1);	
-
-	fields1->SetSubjectL(KTestSubject);
-	iSmsTest(fields1->HasAddress());
-	iSmsTest(fields1->Length() == KTestAddress().Length() + KTestSubject().Length() + 2);
-	
-	fields1->Reset();
-	iSmsTest(fields1->Addresses().MdcaCount()==0);
-	iSmsTest(fields1->Subject().Compare(KNullDesC()) == 0);
-	iSmsTest(!fields1->HasAddress());
-	iSmsTest(fields1->Length() == 0);
-	
-	fields1->SetSubjectL(KTestSubject);
-	iSmsTest(fields1->Subject().Compare(KTestSubject) == 0);
-	iSmsTest(!fields1->HasAddress());
-	iSmsTest(fields1->Length() == KTestSubject().Length() + 2);
-	
-	fields1->AddAddressL(KTestAddress);
-	iSmsTest(fields1->Addresses().MdcaCount()==1);	
-	iSmsTest(fields1->Addresses().MdcaPoint(0).Compare(KTestAddress) == 0);
-	iSmsTest(fields1->HasAddress());
-	iSmsTest(fields1->Length() == KTestAddress().Length() + KTestSubject().Length() + 2);
-
-	// Test multiple addresses - add empty address -> not added	
-	fields1->AddAddressL(KNullDesC);
-	iSmsTest(fields1->Addresses().MdcaCount()==1);
-	
-	_LIT(KTestAddress2, "support2@symbian.com");
-	fields1->AddAddressL(KTestAddress2);
-	iSmsTest(fields1->Addresses().MdcaCount()==2);	
-	iSmsTest(fields1->Addresses().MdcaPoint(1).Compare(KTestAddress2) == 0);
-	iSmsTest(fields1->HasAddress());
-	// NOTE - length check; 3 -> 2 for subject delimiters, 1 for address comma separtor.
-	iSmsTest(fields1->Length() == KTestAddress().Length() + KTestAddress2().Length() + KTestSubject().Length() + 3);
-	
-	// Test copy factory c'tor
-	CSmsEmailFields* fields2 = CSmsEmailFields::NewL(*fields1);
-	CleanupStack::PushL(fields2);
-
-	iSmsTest(CompareEmailFields(*fields2, *fields1));
-	
-	// Test store and restore
-	StoreEmailFieldsL(*fields1);
-	fields2->Reset();
-	RestoreEmailFieldsL(*fields2);
-
-	iSmsTest(CompareEmailFields(*fields2, *fields1));
-	
-	fields1->Reset();
-	StoreEmailFieldsL(*fields1);
-	RestoreEmailFieldsL(*fields2);
-
-	iSmsTest(CompareEmailFields(*fields2, *fields1));
-	
-	CleanupStack::PopAndDestroy(2, fields1);
-	
-	// Test parsing - expected data.
-	_LIT(KTestBodyData, "Some body text#( )#");
-
-	_LIT(KTestParseAddress1, "user1@symbian.com");
-	_LIT(KTestParseSubject1, "");
-	_LIT(KTestEmail1, "user1@symbian.com Some body text#( )#");
-	TestEmailFieldsParsePassL(KTestEmail1, KTestParseAddress1, KTestParseSubject1, KTestBodyData);
-
-	_LIT(KTestParseFullAddress1, "Some User <user1@symbian.com>");
-	_LIT(KTestEmail2, "Some User <user1@symbian.com> Some body text#( )#");
-	TestEmailFieldsParsePassL(KTestEmail2, KTestParseFullAddress1, KTestParseSubject1, KTestBodyData);
-
-	_LIT(KTestParseAddress2, "user2@symbian.com");
-	_LIT(KTestParseSubject2, "subject (2)");
-	_LIT(KTestEmail3, "user2@symbian.com##subject (2)#Some body text#( )#");
-	TestEmailFieldsParsePassL(KTestEmail3, KTestParseAddress2, KTestParseSubject2, KTestBodyData);
-
-	_LIT(KTestParseFullAddress2, "Some User <user2@symbian.com>");
-	_LIT(KTestEmail4, "Some User <user2@symbian.com>##subject (2)#Some body text#( )#");
-	TestEmailFieldsParsePassL(KTestEmail4, KTestParseFullAddress2, KTestParseSubject2, KTestBodyData);
-
-	_LIT(KTestParseAddress3, "user3@symbian.com");
-	_LIT(KTestParseSubject3, "subject #3");
-	_LIT(KTestEmail5, "user3@symbian.com(subject #3)Some body text#( )#");
-	TestEmailFieldsParsePassL(KTestEmail5, KTestParseAddress3, KTestParseSubject3, KTestBodyData);
-
-	_LIT(KTestParseFullAddress3, "Some User <user3@symbian.com>");
-	_LIT(KTestEmail6, "Some User <user3@symbian.com>(subject #3)Some body text#( )#");
-	TestEmailFieldsParsePassL(KTestEmail6, KTestParseFullAddress3, KTestParseSubject3, KTestBodyData);
-	
-	_LIT(KTestParseAddress4, "user4@symbian.com");
-	_LIT(KTestParseSubject4, "");
-	_LIT(KTestEmail7, "user4@symbian.com()Some body text#( )#");
-	TestEmailFieldsParsePassL(KTestEmail7, KTestParseAddress4, KTestParseSubject4, KTestBodyData);
-
-	_LIT(KTestParseFullAddress4, "Some User <user4@symbian.com>");
-	_LIT(KTestEmail8, "Some User <user4@symbian.com>()Some body text#( )#");
-	TestEmailFieldsParsePassL(KTestEmail8, KTestParseFullAddress4, KTestParseSubject4, KTestBodyData);
-
-	_LIT(KTestParseAddress5, "user5@symbian.com");
-	_LIT(KTestParseSubject5, "");
-	_LIT(KTestEmail9, "user5@symbian.com###Some body text#( )#");
-	TestEmailFieldsParsePassL(KTestEmail9, KTestParseAddress5, KTestParseSubject5, KTestBodyData);
-
-	_LIT(KTestParseFullAddress5, "Some User <user5@symbian.com>");
-	_LIT(KTestEmail10, "Some User <user5@symbian.com>###Some body text#( )#");
-	TestEmailFieldsParsePassL(KTestEmail10, KTestParseFullAddress5, KTestParseSubject5, KTestBodyData);
-
-	// Test parsing - corrupt but parse-able data.
-	_LIT(KTestCorruptAddress1,	"user1@symbian.com");
-	_LIT(KTestCorruptSubject1,	"smiley ;");
-	_LIT(KTestCorruptBody1,		" subject)Some body text");
-	_LIT(KTestCorruptEmail1,	"user1@symbian.com(smiley ;) subject)Some body text");
-	TestEmailFieldsParsePassL(KTestCorruptEmail1, KTestCorruptAddress1, KTestCorruptSubject1, KTestCorruptBody1);
-	
-	_LIT(KTestCorruptAddress2,	"user1@symbian.com");
-	_LIT(KTestCorruptSubject2,	"");
-	_LIT(KTestCorruptBody2,		"(bad subject)Some body text");
-	_LIT(KTestCorruptEmail2,	"user1@symbian.com (bad subject)Some body text");
-	TestEmailFieldsParsePassL(KTestCorruptEmail2, KTestCorruptAddress2, KTestCorruptSubject2, KTestCorruptBody2);
-
-	_LIT(KTestCorruptAddress3,	"user1@symbian.com");
-	_LIT(KTestCorruptSubject3,	"");
-	_LIT(KTestCorruptBody3,		"bad subject##Some body text");
-	_LIT(KTestCorruptEmail3,	"user1@symbian.com###bad subject##Some body text");
-	TestEmailFieldsParsePassL(KTestCorruptEmail3, KTestCorruptAddress3, KTestCorruptSubject3, KTestCorruptBody3);
-	
-	// Test parsing - corrupt and fail.
-	_LIT(KTestFailEmail1,	"user#domain1.domain2 Some body text");
-	TestEmailFieldsParseFailL(KTestFailEmail1);
-	
-	_LIT(KTestFailEmail2,	"user@domain1.domain2+Some+body+text");
-	TestEmailFieldsParseFailL(KTestFailEmail2);
-
-	_LIT(KTestFailEmail3,	"user@domain1.domain2##(subject)Some+body+text");
-	TestEmailFieldsParseFailL(KTestFailEmail3);
-
-	_LIT(KTestFailEmail4,	"user@domain1.domain2(##subject#Some+body+text");
-	TestEmailFieldsParseFailL(KTestFailEmail4);
-
-	_LIT(KTestFailEmail5,	"user1@symbian.com#bad subject#Some body text");
-	TestEmailFieldsParseFailL(KTestFailEmail5);
-	
-	// Test composing - ok
-	_LIT(KTestComposeAddress1,	"user1@domain1.domain2");
-	_LIT(KTestComposeSubject1,	"");
-	_LIT(KTestComposeFields1,	"user1@domain1.domain2 ");
-	TestEmailFieldsComposeL(KTestComposeFields1, KTestComposeAddress1, KNullDesC, KTestComposeSubject1);
-	
-	_LIT(KTestComposeAddress2,	"user2@domain1.domain2");
-	_LIT(KTestComposeSubject2,	"a subject");
-	_LIT(KTestComposeFields2,	"user2@domain1.domain2(a subject)");
-	TestEmailFieldsComposeL(KTestComposeFields2, KTestComposeAddress2, KNullDesC, KTestComposeSubject2);
-
-	_LIT(KTestComposeFields3,	"user1@domain1.domain2,user2@domain1.domain2 ");
-	TestEmailFieldsComposeL(KTestComposeFields3, KTestComposeAddress1, KTestComposeAddress2, KTestComposeSubject1);
-	
-	_LIT(KTestComposeFields4,	"user2@domain1.domain2,user1@domain1.domain2(a subject)");
-	TestEmailFieldsComposeL(KTestComposeFields4, KTestComposeAddress2, KTestComposeAddress1, KTestComposeSubject2);
-
-	// Testing composing - fail, no address.
-	CSmsEmailFields* fields3 = CSmsEmailFields::NewL();
-	CleanupStack::PushL(fields3);
-	
-	fields3->AddAddressL(KNullDesC);
-	fields3->SetSubjectL(KTestSubject);
-
-	fields3->ComposeLC();
-	
-	iSmsTest(err==KErrCorrupt);
-	
-	CleanupStack::PopAndDestroy(fields3);
-
-	Session().CleanupEntryPop();
-	Session().RemoveEntry(id);
-	}
-	
-void CSmutTest::TestEmailFieldsParsePassL(const TDesC& aMessage, const TDesC& aAddress, const TDesC& aSubject, const TDesC& aBody)
-	{
-	CSmsEmailFields* fields = CSmsEmailFields::NewL();
-	CleanupStack::PushL(fields);
-	
-	TInt pos = fields->ParseL(aMessage);
-	
-	TPtrC body(aMessage.Mid(pos));
-	iSmsTest(fields->HasAddress());
-	iSmsTest(fields->Addresses().MdcaCount()==1);
-	iSmsTest(fields->Addresses().MdcaPoint(0).Compare(aAddress) == 0);
-	iSmsTest(fields->Subject().Compare(aSubject) == 0);
-	iSmsTest(body.Compare(aBody) == 0);
-	
-	CleanupStack::PopAndDestroy(fields);
-	}
-
-void CSmutTest::TestEmailFieldsParseFailL(const TDesC& aMessage)
-	{
-	CSmsEmailFields* fields = CSmsEmailFields::NewL();
-	CleanupStack::PushL(fields);
-	
-	TInt pos = fields->ParseL(aMessage);
-	
-	iSmsTest(pos == KErrCorrupt);
-	
-	CleanupStack::PopAndDestroy(fields);	
-	}
-
-void CSmutTest::TestEmailFieldsComposeL(const TDesC& aFields, const TDesC& aAddress1, const TDesC& aAddress2, const TDesC& aSubject)
-	{
-	CSmsEmailFields* fields = CSmsEmailFields::NewL();
-	CleanupStack::PushL(fields);
-	
-	fields->AddAddressL(aAddress1);
-	fields->AddAddressL(aAddress2);
-	fields->SetSubjectL(aSubject);
-	HBufC* buffer = fields->ComposeLC();	
-
-	iSmsTest(aFields.Compare(*buffer) == 0);
-	
-	CleanupStack::PopAndDestroy(2, fields);	// fields, buffer
-	}
-
-void CSmutTest::TestHeaderL()
-	{
-
-// Testing class CSmsHeader
-	iSmsTest.Test().Next(_L("Testing CSmsHeader"));
-	
-// A CSmsHeader can be of 6 different types
-// First we test constructing ESmsDeliver
-	delete iSmsHeader; // deleting the previous one
-	iSmsHeader = NULL;
-	iSmsHeader=CSmsHeader::NewL(CSmsPDU::ESmsDeliver,*iRichText); // constructing
-	iSmsTest(iSmsHeader->Type()==CSmsPDU::ESmsDeliver);	// type ok?
-
-	CSmsDeliver& deliver = iSmsHeader->Deliver();  // lets get the CSmsPDU of the CSmsHeader
-	const CSmsDeliver& deliver2 = iSmsHeader->Deliver();
-
-	iSmsTest(deliver.Type() == CSmsPDU::ESmsDeliver); // Are the types ok?
-	iSmsTest(deliver2.Type() == CSmsPDU::ESmsDeliver);
-
-// Type ESmsCommand
-	delete iSmsHeader; // deleting previous
-	iSmsHeader = NULL;
-	iSmsHeader=CSmsHeader::NewL(CSmsPDU::ESmsCommand,*iRichText);
-	iSmsTest(iSmsHeader->Type()==CSmsPDU::ESmsCommand);
-
-	CSmsCommand& command=iSmsHeader->Command();
-	const CSmsCommand& command2=iSmsHeader->Command();
-
-	iSmsTest(command.Type() == CSmsPDU::ESmsCommand);
-	iSmsTest(command2.Type() == CSmsPDU::ESmsCommand);
-
-// Type ESmsStatusReport
-	delete iSmsHeader; // deleting the previous one
-	iSmsHeader = NULL;
-	iSmsHeader=CSmsHeader::NewL(CSmsPDU::ESmsStatusReport,*iRichText);
-	iSmsTest(iSmsHeader->Type()==CSmsPDU::ESmsStatusReport);
-
-	CSmsStatusReport& statusreport=iSmsHeader->StatusReport();
-	const CSmsStatusReport& statusreport2=iSmsHeader->StatusReport();
-
-	iSmsTest(statusreport.Type() == CSmsPDU::ESmsStatusReport);
-	iSmsTest(statusreport2.Type() == CSmsPDU::ESmsStatusReport);
-
-// Type ESmsSubmit
-	delete iSmsHeader; // deleting the previous one
-	iSmsHeader = NULL;
-	iSmsHeader=CSmsHeader::NewL(CSmsPDU::ESmsSubmit,*iRichText);
-	iSmsTest(iSmsHeader->Type()==CSmsPDU::ESmsSubmit);
-
-	CSmsSubmit& submit=iSmsHeader->Submit();
-	const CSmsSubmit& submit2=iSmsHeader->Submit();
-
-	iSmsTest(submit.Type() == CSmsPDU::ESmsSubmit);
-	iSmsTest(submit2.Type() == CSmsPDU::ESmsSubmit);
-
-// Lets access the CSmsMessage of our header
-	CSmsMessage& message=iSmsHeader->Message();
-	const CSmsMessage& message2=iSmsHeader->Message();
-
-	iSmsTest(message.Type() == CSmsPDU::ESmsSubmit);
-	iSmsTest(message2.Type() == CSmsPDU::ESmsSubmit);
-
-// Lets test the features of CSmsHeader with different values
-	iSmsHeader->SetReplyPathProvided(ETrue);
-	iSmsTest(iSmsHeader->ReplyPathProvided());
-	iSmsHeader->SetReplyPathProvided(EFalse);
-	iSmsTest(!iSmsHeader->ReplyPathProvided());
-
-	iSmsHeader->SetBioMsgIdType(EBioMsgIdUnknown);
-	iSmsTest(iSmsHeader->BioMsgIdType()==EBioMsgIdUnknown);
-	iSmsHeader->SetBioMsgIdType(EBioMsgIdIana);
-	iSmsTest(iSmsHeader->BioMsgIdType()==EBioMsgIdIana);
-	iSmsHeader->SetBioMsgIdType(EBioMsgIdNbs);
-	iSmsTest(iSmsHeader->BioMsgIdType()==EBioMsgIdNbs);
-	iSmsHeader->SetBioMsgIdType(EBioMsgIdWap);
-	iSmsTest(iSmsHeader->BioMsgIdType()==EBioMsgIdWap);
-	iSmsHeader->SetBioMsgIdType(EBioMsgIdWapSecure);
-	iSmsTest(iSmsHeader->BioMsgIdType()==EBioMsgIdWapSecure);
-
-// Lets set the service center number
-	iSmsHeader->SetServiceCenterAddressL(_L("+350508771010"));
-	iSmsTest(iSmsHeader->ServiceCenterAddress()==_L("+350508771010"));
-
-// Lets set one recipient for the message
-	CArrayPtrFlat<CSmsNumber>& recipients = iSmsHeader->Recipients();
-	CSmsNumber* number=CSmsNumber::NewL();
-	CleanupStack::PushL(number);
-	number->SetAddressL(_L("+358503367709"));
-	recipients.AppendL(number);
-	CleanupStack::Pop();
-
-// Setting settings of the message
-	CSmsSettings* smsset = CSmsSettings::NewL();
-	CleanupStack::PushL(smsset);
-	smsset->AddServiceCenterL(_L("Hippo"), _L("+358508771010"));
-	smsset->SetCharacterSet(TSmsDataCodingScheme::ESmsAlphabet7Bit);
-	smsset->SetDelivery(ESmsDeliveryImmediately);
-	smsset->SetDeliveryReport(EFalse);
-	smsset->SetMessageConversion(ESmsConvPIDNone);
-	smsset->SetRejectDuplicate(ETrue);
-	smsset->SetReplyPath(EFalse);
-	smsset->SetValidityPeriod(ESmsVP24Hours);
-	smsset->SetValidityPeriodFormat(TSmsFirstOctet::ESmsVPFSemiOctet);
-// And copying them to the CSmsHeader
-	iSmsHeader->SetSmsSettingsL(*smsset);
-	CleanupStack::PopAndDestroy(smsset);
-
-	CSmsSettings* smsset2 = CSmsSettings::NewL();
-	CleanupStack::PushL(smsset2);
-// Lets get the same setting from the CSmsHeader
-	iSmsHeader->GetSmsSettingsL(*smsset2);
-// And compare that they are ok!
-	iSmsTest(smsset2->CharacterSet()==TSmsDataCodingScheme::ESmsAlphabet7Bit);
-	iSmsTest(!smsset2->DeliveryReport());
-	iSmsTest(smsset2->MessageConversion()==ESmsConvPIDNone);
-	iSmsTest(smsset2->RejectDuplicate());
-	iSmsTest(!smsset2->ReplyPath());
-	iSmsTest(smsset2->ValidityPeriod().Int()==ESmsVP24Hours);
-	iSmsTest(smsset2->ValidityPeriodFormat()==TSmsFirstOctet::ESmsVPFSemiOctet);
-	CleanupStack::PopAndDestroy(smsset2);
-
-//Test Set/FromAddress()
-	iSmsHeader->SetFromAddressL(_L("+358503367709"));
-	iSmsTest(iSmsHeader->FromAddress()==_L("+358503367709"));
-	
-//Test Set/EmailFields()
-	_LIT(KTestAddress, "user@domain1.domain2");
-	_LIT(KTestSubject, "a subject");
-
-	CSmsEmailFields* fields1 = CSmsEmailFields::NewL();
-	CleanupStack::PushL(fields1);
-	
-	fields1->AddAddressL(KTestAddress);
-	fields1->SetSubjectL(KTestSubject);
-
-	// Test the PID field value - should be ESmsConvPIDNone...
-	CSmsSettings* smsset3 = CSmsSettings::NewL();
-	CleanupStack::PushL(smsset3);
-
-	iSmsHeader->GetSmsSettingsL(*smsset3);
-	iSmsTest(smsset3->MessageConversion()==ESmsConvPIDNone);
-
-	// Set the email fields - check the email fields and the PID value (should 
-	// be ESmsConvMail).
-	iSmsHeader->SetEmailFieldsL(*fields1);
-	const CSmsEmailFields& fields2 = iSmsHeader->EmailFields();
-	iSmsHeader->GetSmsSettingsL(*smsset3);
-	
-	iSmsTest(CompareEmailFields(*fields1, fields2));
-	iSmsTest(smsset3->MessageConversion()==ESmsConvMail);
-	
-	// Reset the fields and then set back in the header - should reset the PID
-	// value to ESmsConvPIDNone
-	fields1->Reset();
-	iSmsHeader->SetEmailFieldsL(*fields1);
-	
-	const CSmsEmailFields& fields3 = iSmsHeader->EmailFields();
-	iSmsHeader->GetSmsSettingsL(*smsset3);
-	
-	iSmsTest(CompareEmailFields(*fields1, fields3));
-	iSmsTest(smsset3->MessageConversion()==ESmsConvPIDNone);
-	
-	// Set the reply email fields - check email fields (both address and subject)
-	// and the PID value (should be ESmsConvMail)
-	_LIT(KEmailReplySubjectFormat,	"Re: %S");
-	_LIT(KEmailReplySubject,		"Re: a subject");
-
-	// First test with no subject...
-	fields1->AddAddressL(KTestAddress);
-	
-	iSmsHeader->SetReplyEmailFieldsL(*fields1, KEmailReplySubjectFormat);
-	const CSmsEmailFields& replyFields1 = iSmsHeader->EmailFields();
-	iSmsHeader->GetSmsSettingsL(*smsset3);
-	
-	iSmsTest(CompareEmailFieldsAddresses(replyFields1.Addresses(), fields1->Addresses()));
-	iSmsTest(replyFields1.Subject().Compare(KNullDesC) == 0);
-	iSmsTest(smsset3->MessageConversion()==ESmsConvMail);
-	
-	// Now set the subject...
-	fields1->SetSubjectL(KTestSubject);
-
-	iSmsHeader->SetReplyEmailFieldsL(*fields1, KEmailReplySubjectFormat);
-	const CSmsEmailFields& replyFields2 = iSmsHeader->EmailFields();
-	iSmsHeader->GetSmsSettingsL(*smsset3);
-	
-	iSmsTest(CompareEmailFieldsAddresses(replyFields2.Addresses(), fields1->Addresses()));
-	iSmsTest(replyFields2.Subject().Compare(KEmailReplySubject()) == 0);
-	iSmsTest(smsset3->MessageConversion()==ESmsConvMail);
-	
-	// Repeat - test for (lack of) Re: chain.
-	fields1->SetSubjectL(KEmailReplySubject);
-	
-	iSmsHeader->SetReplyEmailFieldsL(*fields1, KEmailReplySubjectFormat);
-	const CSmsEmailFields& replyFields3 = iSmsHeader->EmailFields();
-	iSmsHeader->GetSmsSettingsL(*smsset3);
-	
-	iSmsTest(CompareEmailFieldsAddresses(replyFields3.Addresses(), fields1->Addresses()));
-	iSmsTest(replyFields3.Subject().Compare(KEmailReplySubject()) == 0);
-	iSmsTest(smsset3->MessageConversion()==ESmsConvMail);
-	
-	// Set the forward email fields - check email fields (both address and subject)
-	// and the PID value (should be ESmsConvMail)
-	_LIT(KEmailForwardSubjectFormat,	"Fw: %S");
-	_LIT(KEmailForwardSubject,			"Fw: a subject");
-	
-	// First test with no subject...
-	fields1->Reset();
-	fields1->AddAddressL(KTestAddress);
-
-	iSmsHeader->SetForwardEmailFieldsL(*fields1, KEmailForwardSubjectFormat);
-	const CSmsEmailFields& forwardFields1 = iSmsHeader->EmailFields();
-	iSmsHeader->GetSmsSettingsL(*smsset3);
-	
-	iSmsTest(!forwardFields1.HasAddress());
-	iSmsTest(forwardFields1.Addresses().MdcaCount()==0);
-	iSmsTest(forwardFields1.Subject().Compare(KNullDesC) == 0);
-	iSmsTest(smsset3->MessageConversion()==ESmsConvMail);
-
-	// Now set the subject...
-	fields1->SetSubjectL(KTestSubject);
-
-	iSmsHeader->SetForwardEmailFieldsL(*fields1, KEmailForwardSubjectFormat);
-	const CSmsEmailFields& forwardFields2 = iSmsHeader->EmailFields();
-	iSmsHeader->GetSmsSettingsL(*smsset3);
-	
-	iSmsTest(!forwardFields2.HasAddress());
-	iSmsTest(forwardFields2.Addresses().MdcaCount()==0);
-	iSmsTest(forwardFields2.Subject().Compare(KEmailForwardSubject()) == 0);
-	iSmsTest(smsset3->MessageConversion()==ESmsConvMail);
-	
-	// Repeat - test for (lack of) Fw: chain.
-	fields1->SetSubjectL(KEmailForwardSubject);
-	
-	iSmsHeader->SetForwardEmailFieldsL(*fields1, KEmailForwardSubjectFormat);
-	const CSmsEmailFields& forwardFields3 = iSmsHeader->EmailFields();
-	iSmsHeader->GetSmsSettingsL(*smsset3);
-	
-	iSmsTest(!forwardFields3.HasAddress());
-	iSmsTest(forwardFields3.Addresses().MdcaCount()==0);
-	iSmsTest(forwardFields3.Subject().Compare(KEmailForwardSubject()) == 0);
-	iSmsTest(smsset3->MessageConversion()==ESmsConvMail);
-
-	// Reset the fields and set back in the header.
-	fields1->Reset();
-	iSmsHeader->SetEmailFieldsL(*fields1);
-
-	CleanupStack::PopAndDestroy(2, fields1);
-
-//Lets store and restore the CSmsHeader and test that the values are right
-	TMsvId id = iSmsTest.CreateDummyMessageToSendL();
-	Session().CleanupEntryPushL(id);
-	iSmsTest.SetEntryL(id);
-	
-	StoreHeaderL(*iSmsHeader);
-	
-	// Check that the email fields stream is not present, as there is no email
-	// fields data.
-	CMsvStore* store1 = iSmsTest.ReadStoreL();
-	CleanupStack::PushL(store1);
-	iSmsTest(!store1->IsPresentL(KUidMsvSmsEmailFieldsStream));
-	CleanupStack::PopAndDestroy(store1);
-
-	CSmsHeader* header1 = CSmsHeader::NewL(CSmsPDU::ESmsSubmit,*iRichText);
-	CleanupStack::PushL(header1);
-
-	RestoreHeaderL(*header1);
-
-//Values ok?
-	iSmsTest(iSmsHeader->Type()==header1->Type());
-	iSmsTest(!header1->ReplyPathProvided());
-	iSmsTest(header1->ServiceCenterAddress()==_L("+350508771010"));
-	iSmsTest(iSmsHeader->Recipients().Count()==header1->Recipients().Count());
-	iSmsTest(iSmsHeader->BioMsgIdType()==header1->BioMsgIdType());
-	iSmsTest(iSmsHeader->FromAddress()==header1->FromAddress());
-
-// Lets get the setting of the message
-	CSmsSettings* smsset4 = CSmsSettings::NewL();
-	CleanupStack::PushL(smsset4);
-	header1->GetSmsSettingsL(*smsset4);
-
-// And compare that they are the original values
-	iSmsTest(smsset4->CharacterSet()==TSmsDataCodingScheme::ESmsAlphabet7Bit);
-	iSmsTest(!smsset4->DeliveryReport());
-	iSmsTest(smsset4->MessageConversion()==ESmsConvPIDNone);
-	iSmsTest(smsset4->RejectDuplicate());
-	iSmsTest(!smsset4->ReplyPath());
-	iSmsTest(smsset4->ValidityPeriod().Int()==ESmsVP24Hours);
-	iSmsTest(smsset4->ValidityPeriodFormat()==TSmsFirstOctet::ESmsVPFSemiOctet);
-	
-	CleanupStack::PopAndDestroy(2, header1);
-	
-	// Test with email fields data.
-	CSmsEmailFields* fields8 = CSmsEmailFields::NewL();
-	CleanupStack::PushL(fields8);
-	fields8->AddAddressL(KTestAddress);
-	fields8->SetSubjectL(KTestSubject);
-	iSmsHeader->SetEmailFieldsL(*fields8);
-	
-	StoreHeaderL(*iSmsHeader);
-
-	// Check that the email fields stream is  present, as there is now email
-	// fields data.
-	CMsvStore* store2 = iSmsTest.EditStoreL();
-	CleanupStack::PushL(store2);
-	iSmsTest(store2->IsPresentL(KUidMsvSmsEmailFieldsStream));
-	CleanupStack::PopAndDestroy(store2);
-
-	CSmsHeader* header2 = CSmsHeader::NewL(CSmsPDU::ESmsSubmit,*iRichText);
-	CleanupStack::PushL(header2);
-
-	RestoreHeaderL(*header2);
-
-	iSmsTest(iSmsHeader->Type()==header2->Type());
-	iSmsTest(!header2->ReplyPathProvided());
-	iSmsTest(header2->ServiceCenterAddress()==_L("+350508771010"));
-	iSmsTest(iSmsHeader->Recipients().Count()==header2->Recipients().Count());
-	iSmsTest(iSmsHeader->BioMsgIdType()==header2->BioMsgIdType());
-	iSmsTest(iSmsHeader->FromAddress()==header2->FromAddress());
-
-	CSmsSettings* smsset5 = CSmsSettings::NewL();
-	CleanupStack::PushL(smsset5);
-	header2->GetSmsSettingsL(*smsset5);
-
-	iSmsTest(smsset5->CharacterSet()==TSmsDataCodingScheme::ESmsAlphabet7Bit);
-	iSmsTest(!smsset5->DeliveryReport());
-	iSmsTest(smsset5->MessageConversion()==ESmsConvMail);
-	iSmsTest(smsset5->RejectDuplicate());
-	iSmsTest(!smsset5->ReplyPath());
-	iSmsTest(smsset5->ValidityPeriod().Int()==ESmsVP24Hours);
-	iSmsTest(smsset5->ValidityPeriodFormat()==TSmsFirstOctet::ESmsVPFSemiOctet);
-	
-	const CSmsEmailFields& fields9 = iSmsHeader->EmailFields();
-	iSmsTest(CompareEmailFields(*fields8, fields9));
-	
-	CleanupStack::PopAndDestroy(3, fields8);
-	
-//Test NewL that takes a CSmsMessage - pretend it's an email message.
-	RFs fs;
-	User::LeaveIfError(fs.Connect());
-	CleanupClosePushL(fs);
-	
-	// Test un-corrupt email - add an appropriate email message
-	_LIT(KTestEmailAddress1, 	"user@domain1.domain2");
-	_LIT(KTestEmailSubject1, 	"a subject");
-	_LIT(KTestEmailBody1,		"some body text");
-	_LIT(KTestEmailMessage1,	"user@domain1.domain2##a subject#some body text");
-
-	CSmsMessage* email1 = CSmsMessage::NewL(fs, CSmsPDU::ESmsDeliver, CSmsEditorBuffer::NewL(*iRichText), EFalse);
-	CleanupStack::PushL(email1);
-	
-	CSmsBufferBase& buffer1 = email1->Buffer();
-	buffer1.Reset();
-	buffer1.InsertL(0, KTestEmailMessage1());
-	
-	// Set the PID for email.
-	CSmsPDU& pdu1 = email1->SmsPDU();
-	if( pdu1.ProtocolIdentifierPresent() )
-		{
-		pdu1.SetPIDType(TSmsProtocolIdentifier::ESmsPIDTelematicInterworking);
-		pdu1.SetTelematicDeviceIndicator(TSmsProtocolIdentifier::ESmsTelematicDevice);
-		pdu1.SetTelematicDeviceType(TSmsProtocolIdentifier::ESmsInternetElectronicMail);
-		}
-
-	// create a new SMS header
-	delete iSmsHeader;
-	iSmsHeader = NULL;
-	iSmsHeader = CSmsHeader::NewL(email1); 
-	CleanupStack::Pop(email1);
-
-	// Check that the header is correct...
-	// Email fields...
-	const CSmsEmailFields& fields10 = iSmsHeader->EmailFields();
-	iSmsTest(fields10.HasAddress());
-	iSmsTest(fields10.Addresses().MdcaCount()==1);
-	iSmsTest(fields10.Addresses().MdcaPoint(0).Compare(KTestEmailAddress1) == 0);
-	iSmsTest(fields10.Subject().Compare(KTestEmailSubject1) == 0);
-	
-	// Message body...
-	CSmsBufferBase& body1 = iSmsHeader->Message().Buffer();
-	TInt length1 = body1.Length();
-	HBufC* buf1 = HBufC::NewLC(length1);
-	TPtr bufPtr1(buf1->Des());
-	body1.Extract(bufPtr1, 0, length1);
-	
-	iSmsTest(bufPtr1.Compare(KTestEmailBody1) == 0);
-	
-	CleanupStack::PopAndDestroy(buf1);
-
-	// Test corrupt email.
-	_LIT(KTestEmailBody2,		"user@domain1.domain2##a subjectsome body text");
-	_LIT(KTestEmailMessage2,	"user@domain1.domain2##a subjectsome body text");
-
-	CSmsMessage* email2 = CSmsMessage::NewL(fs, CSmsPDU::ESmsDeliver, CSmsEditorBuffer::NewL(*iRichText), EFalse);
-	CleanupStack::PushL(email2);
-	
-	CSmsBufferBase& buffer2 = email2->Buffer();
-	buffer2.Reset();
-	buffer2.InsertL(0, KTestEmailMessage2());
-	
-	// Set the PID for email.
-	CSmsPDU& pdu2 = email2->SmsPDU();
-	if( pdu2.ProtocolIdentifierPresent() )
-		{
-		pdu2.SetPIDType(TSmsProtocolIdentifier::ESmsPIDTelematicInterworking);
-		pdu2.SetTelematicDeviceIndicator(TSmsProtocolIdentifier::ESmsTelematicDevice);
-		pdu2.SetTelematicDeviceType(TSmsProtocolIdentifier::ESmsInternetElectronicMail);
-		}
-
-	// create a new SMS header
-	delete iSmsHeader;
-	iSmsHeader = NULL;
-	iSmsHeader = CSmsHeader::NewL(email2); 
-	CleanupStack::Pop(email2);
-
-	// Check that the header is correct...
-	// Email fields...
-	const CSmsEmailFields& fields11 = iSmsHeader->EmailFields();
-	iSmsTest(!fields11.HasAddress());
-	iSmsTest(fields11.Addresses().MdcaCount()==0);
-	iSmsTest(fields11.Subject().Compare(KNullDesC) == 0);
-	iSmsTest(fields11.Length() == 0);
-	
-	// Message body...
-	CSmsBufferBase& body2 = iSmsHeader->Message().Buffer();
-	TInt length2 = body2.Length();
-	HBufC* buf2 = HBufC::NewLC(length2);
-	TPtr bufPtr2(buf2->Des());
-	body2.Extract(bufPtr2, 0, length2);
-	
-	iSmsTest(bufPtr2.Compare(KTestEmailBody2) == 0);
-	
-	CleanupStack::PopAndDestroy(buf2);
-	
-	CleanupStack::PopAndDestroy(&fs);
-
-	Session().CleanupEntryPop();
-	Session().RemoveEntry(id);
-	}
-
-_LIT(KGetDescriptionTestMessage, "Finland to win the ice hockey world champs");
-
-#include <emsuserpromptie.h>
-#include <emssoundie.h>
-_LIT8(KUserMelody, 	"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
-	  "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"); // Melody file
-
-_LIT(KTestEmsVariousMsg1,"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
-
-void CSmutTest::TestSmsEmsExtensionsL()
-// Test the modifications for EMS
-	{
-	// Set up a standard sms message first
-	iRichText->Reset();
-	iRichText->InsertL(0, KTestEmsVariousMsg1);
-	// Make a Deliver so we can get at the protocol identifier
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsDeliver,*iRichText);
-	CleanupStack::PushL(header);
-
-	// Create 2 EMS Melody objects followed by a User Prompt Indicator
-
-	// Create first Melody EMS object
-	CEmsSoundIE* object = CEmsSoundIE::NewL(KUserMelody());
-	CleanupStack::PushL(object);	
-	// Insert the sound object after the 5th byte of the message
-	object->SetStartPosition(5);
-	// Add it to the CSmsMessage
-	header->Message().AddEMSInformationElementL(*object);
-	CleanupStack::PopAndDestroy(object);	
-
-	// Create a second Melody EMS object 
-	CEmsSoundIE* object2 = CEmsSoundIE::NewL(KUserMelody());
-	CleanupStack::PushL(object2);	
-	// Insert the sound object after the 5th byte of the message
-	object2->SetStartPosition(5);
-	// Add it to the CSmsMessage
-	header->Message().AddEMSInformationElementL(*object2);
-	CleanupStack::PopAndDestroy(object2);
-
-	// Create a user prompt indicator and tell it there are 2 EMS objects
-	CEmsUserPrompt* prompt = CEmsUserPrompt::NewL(2);
-	CleanupStack::PushL(prompt);	
-	// Add it after the 5th byte of the message
-	prompt->SetStartPosition(5);
-	// Add it to the CSmsMessage
-	header->Message().AddEMSInformationElementL(*prompt);
-	CleanupStack::PopAndDestroy(prompt);
- 
-	// Test the TMsvSmsEntry derived class
-	TMsvSmsEntry entry;
-	// Check the Existing sms message for User Prompt indicator
-	const RPointerArray<const CEmsInformationElement>&  emsElements= header->Message().GetEMSInformationElementsL();
-	// Loop through the array checking for a user prompt indicator element
-	TInt i(0);
-	for(;i<emsElements.Count();i++)
-		{
-		if(emsElements[i]->Identifier() == CSmsInformationElement::ESmsEnhancedUserPromptIndicator)
-			{
-			// Set user prompt indicator bit in iMtmData2
-			entry.SetUserPromptIndicator(ETrue);
-			break;
-			}
-		}
-	// Check the user prompt indicator is set
-	if(!entry.UserPromptIndicator())
-		User::Leave(KErrCorrupt);
-	// Check we can clear it
-	entry.SetUserPromptIndicator(EFalse);
-	if(entry.UserPromptIndicator())
-		User::Leave(KErrCorrupt);
-
-	// Convenient reference to PDU
-	CSmsDeliver& pdu = STATIC_CAST(CSmsDeliver&,header->Message().SmsPDU());
-	// Set up the Protocol Identifier to read back
-	pdu.SetPIDType(TSmsProtocolIdentifier::ESmsPIDShortMessageType);
-	pdu.SetShortMessageType(TSmsProtocolIdentifier::ESmsReplaceShortMessageType1);
-
-	// Read from the pdu and set the TMsvSmsEntry copy
-	entry.SetProtocolIdentifier(*pdu.ProtocolIdentifier());
-	// Read it back and check the value
-	if(entry.ProtocolIdentifier() != *pdu.ProtocolIdentifier())
-		{
-		User::Leave(KErrCorrupt);
-		}
-
-	CleanupStack::PopAndDestroy(); //header
-
-	}
-
-void CSmutTest::TestSmsUtilitiesL()
-	{
-	iSmsTest.Test().Next(_L("Testing TSmsUtilities"));
-
-	iRichText->Reset();
-	iRichText->InsertL(0, KGetDescriptionTestMessage);
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit,*iRichText);
-	CleanupStack::PushL(header);
-
-	TestSmsUtilities1L(*header);
-	TestSmsUtilities2L(*header);
-	TestSmsUtilities3L(*header);
-
-	CleanupStack::PopAndDestroy(); //header
-
-	TestSmsUtilitiesTimeStampsL();
-	}
-
-void CSmutTest::TestSmsUtilitiesBL()
-	{
-	iSmsTest.Test().Next(_L("Testing ECOM Plugin for SMS GetDetDesc interface"));
-
-	iRichText->Reset();
-	iRichText->InsertL(0, KGetDescriptionTestMessage);
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit,*iRichText);
-	CleanupStack::PushL(header);
-
-	TestSmsUtilities4L(*header);
-	TestSmsUtilities5L(*header);
-	TestSmsUtilities3L(*header);
-
-	CleanupStack::PopAndDestroy(); //header
-	}
-
-void CSmutTest::TestSmsUtilities1L(CSmsHeader& aHeader)
-/**
- * @test Tests TSmsUtilities::GetDescription()
- */
-	{
-	iSmsTest.Printf(_L("Testing TSmsUtilities::GetDescription() - use varying values to test trucation\n"));
-
-	RResourceFile resFile;
-	iSmsTest.OpenResourceFileL(KSmsResourceFile, resFile);
-	CleanupClosePushL(resFile);
-
-//Test GetDescription()
-
-	TPtrC buf(KGetDescriptionTestMessage);
-	const TInt maxLength = buf.Length();
-	HBufC* desBuf = HBufC::NewLC(maxLength);
-	TPtr desc = desBuf->Des();
-
-	for( TInt length=1; length <= maxLength; ++length )
-		{
-		iSmsTest.Printf(_L("-> trucating to length %d\n"), length);
-
-		desc.Zero();
-		User::LeaveIfError(TSmsUtilities::GetDescription(aHeader.Message(), desc, length));
-
-		iSmsTest.Printf(_L("-> GetDescription() : %S\n"), &desc);
-		
-		iSmsTest(desc.Length()<=length);
-		iSmsTest(desc == buf.Left(desc.Length()) ); //this won't work if buf contains CEditableText::EParagraphDelimiter
-		}
-	desc.Zero();
-
-//Test Special Message Indication
-
-	CSmsPDU& pdu = aHeader.Message().SmsPDU();
-	CSmsUserData& userData = pdu.UserData();
-	TBuf8<2> msgInd;
-	msgInd.Copy(_L("AA"));
-
-	//Add information element
-	msgInd[0] = TSmsUtilities::EEmailMessageWaiting;
-	msgInd[1] = 0x00000001; //1 message
-
-	iSmsTest.Printf(_L("\tAdding information element (Email) to UD\n"));
-	userData.AddInformationElementL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication, msgInd);
-	User::LeaveIfError(TSmsUtilities::GetDescription(aHeader.Message(), desc));
-	CheckDescriptionL(resFile, R_MESSAGE_INDICATION_EMAIL_ONE, desc, 2);
-
-	// Set the maximum length of desc to be less than the description.
-	// The description should truncate to fit into desc.
-	User::LeaveIfError(TSmsUtilities::GetDescription(aHeader.Message(), desc, 10));
-	iSmsTest(desc.Length() == 10); //Check that the Length of desc is the specified max length.
-
-	TestSpecialSmsMessageIndicationPduL(resFile, TSmsUtilities::EVoiceMessageWaiting, R_MESSAGE_INDICATION_VOICEMAIL_ONE);
-	TestSpecialSmsMessageIndicationPduL(resFile, TSmsUtilities::EFaxMessageWaiting, R_MESSAGE_INDICATION_FAX_ONE);
-	TestSpecialSmsMessageIndicationPduL(resFile, TSmsUtilities::EEmailMessageWaiting, R_MESSAGE_INDICATION_EMAIL_ONE);
-	TestSpecialSmsMessageIndicationPduL(resFile, TSmsUtilities::EOtherMessageWaiting, R_MESSAGE_INDICATION_OTHER_ONE);
-
-	CleanupStack::PopAndDestroy(2, &resFile);
-
-	iSmsTest.Printf(_L("Passed\n"));
-	}
-
-CSmsMessage* CSmutTest::CreateSmsMessageLC(const TDesC8& aHexPdu) const
-	{
-	HBufC8* binaryPdu = ConvertToBinaryLC(aHexPdu);
-	TGsmSms pdu;
-	pdu.SetPdu(*binaryPdu);
-	CleanupStack::PopAndDestroy(binaryPdu);
-	CSmsMessage* message = CSmsMessage::NewL(iSmsTest.FileSession(), pdu, CSmsBuffer::NewL());
-	CleanupStack::PushL(message);
-	return message;
-	}
-
-HBufC8* CSmutTest::ConvertToBinaryLC(const TDesC8& aHex) const
-	{
-	const TInt len = aHex.Length();
-	if (len % 2 != 0)
-		User::Leave(KErrArgument);
-
-	HBufC8* pdu = HBufC8::NewLC(len / 2);
-	TPtr8 ptr(pdu->Des());
-
-	for (TInt i = 0; i < len; i += 2)
-		{
-		TLex8 lex(aHex.Mid(i, 2));
-		TUint8 val;
-		User::LeaveIfError(lex.Val(val, EHex));
-		ptr.Append(val);
-		}
-
-	return pdu;
-	}
-
-_LIT(KGetDetailsResult, "\t\tNum In: \"%S\" Name Out: \"%S\"\n");
-
-void CSmutTest::TestSmsUtilities2L(CSmsHeader& aHeader)
-	{
-//Test GetDetails
-
-	iSmsTest.Printf(_L("Test TSmsUtilities::GetDetails()\n"));
-
-	_LIT(KLongTel, "+378458932945284754456302945754938539");
-
-	_LIT(KMikkoTel, "+358503367709");
-	_LIT(KMikkoFirst, "Mikko");
-	_LIT(KMikkoLast, "Rintala");
-	_LIT(KMikkoEmail, "mikko@nokia.com");
-
-	_LIT(KUnqualifiedTel, "8503367710");
-	_LIT(KUnqualifiedTel1, "+358503367710");
-	_LIT(KUnqualifiedFirst, "Unq");
-	_LIT(KUnqualifiedLast, "Wallified");
-	_LIT(KUnqualifiedEmail, "unqalified@diysurgery.com");
-
-//	_LIT(KAnthonyTel, " + 4 "); //is valid
-	_LIT(KAnthonyTel, "+ 7 "); //is valid
-	_LIT(KAnthonyFirst, "Anthony");
-	_LIT(KAnthonyLast, "Alexander");
-	_LIT(KAnthonyEmail, "test@symbian.com");
-
-	_LIT(KHarriTel, "+8"); //is valid
-	_LIT(KHarriFirst, "HarriHarriHarriHarriHarriHarriHarri");
-	_LIT(KHarriLast, "RäisänenRäisänenRäisänenRäisänenRäisänen");
-	_LIT(KHarriEmail, "harri@nokia.com");
-
-	_LIT(KDupTel, "+44207435676");
-	_LIT(KDupFirst1, "Keval");
-	_LIT(KDupLast1, "Pindoria");
-	_LIT(KDupFirst2, "Jackie");
-	_LIT(KDupLast2, "Chan");
-	
-	_LIT(KBadTel1, "This is a bad Telephone");
-	_LIT(KBadTel2, " 5  ");
-	_LIT(KBadTel3, "5+");
-	_LIT(KBadTel4, "*5565434556");
-
-	_LIT(KBadFirst, "BadFirstName");
-	_LIT(KBadLast, "BadLastName");
-
-	_LIT(KNoNameTel, "+449005434");
-
-	_LIT(KDummy, "+44444");
-
-	TRAPD(err, iSmsTest.DeleteContactsFileL());
-	iSmsTest(err == KErrNotFound || err == KErrNone);
-
-	iSmsTest.Printf(_L("\tTesting without contacts\n"));
-
-	//Simple test
-	TPtrC testTel(KMikkoTel);
-	TBuf<KSmsDetailsLength> details;
-
-	aHeader.Message().SetToFromAddressL(testTel);
-	TSmsUtilities::GetDetails(iSmsTest.FileSession(), aHeader.Message(), details);
-	iSmsTest.Printf(KGetDetailsResult, &testTel, &details);
-	iSmsTest(testTel.FindF(details) != KErrNotFound); //details should contain testTel as there is no contact.
-
-	TestInvalidContact(testTel, details);
-
-	testTel.Set(KAnthonyTel);
-	aHeader.Message().SetToFromAddressL(testTel);
-	err = TSmsUtilities::GetDetails(iSmsTest.FileSession(), aHeader.Message(), details);
-	iSmsTest.Printf(KGetDetailsResult, &testTel, &details);
-	iSmsTest(testTel.FindF(details) != KErrNotFound); //details should contain testTel as there is no contact.
-	iSmsTest(err == KErrNone);
-
-	TestInvalidContact(testTel, details);
-
-	// Testing with long telephone number. 
-	// The telephone number should truncate to fit into details.
-	TestInvalidContact(KLongTel, details);
-	iSmsTest(details.Length() == KSmsDetailsLength); //Length of details should be the default max length.
-
-	//Add contacts
-
-	iSmsTest.Printf(_L("\tAdding Contacts\n"));
-
-		//Adding good telephone numbers
-
-		TContactItemId contId = iSmsTest.CreateContactL(KAnthonyFirst, KAnthonyLast, KAnthonyTel, KAnthonyEmail);
-		iSmsTest(contId != KNullContactId);
-
-		contId = iSmsTest.CreateContactL(KMikkoFirst, KMikkoLast, KMikkoTel, KMikkoEmail);
-		iSmsTest(contId != KNullContactId);
-
-		contId = iSmsTest.CreateContactL(KUnqualifiedFirst, KUnqualifiedLast, KUnqualifiedTel, KUnqualifiedEmail);
-		iSmsTest(contId != KNullContactId);
-
-		contId = iSmsTest.CreateContactL(KHarriFirst, KHarriLast, KHarriTel, KHarriEmail);
-		iSmsTest(contId != KNullContactId);
-
-		//Adding a duplicate telephone
-
-		contId = iSmsTest.CreateContactL(KDupFirst1, KDupLast1, KDupTel, KNullDesC);
-		iSmsTest(contId != KNullContactId);
-
-		contId = iSmsTest.CreateContactL(KDupFirst2, KDupLast2, KDupTel, KNullDesC);
-		iSmsTest(contId != KNullContactId);
-
-		//Adding bad telephone numbers
-
-		contId = iSmsTest.CreateContactL(KBadFirst, KBadLast, KBadTel1, KNullDesC);
-		iSmsTest(contId != KNullContactId);
-
-		contId = iSmsTest.CreateContactL(KBadFirst, KBadLast, KBadTel2, KNullDesC);
-		iSmsTest(contId != KNullContactId);
-
-		contId = iSmsTest.CreateContactL(KBadFirst, KBadLast, KBadTel3, KNullDesC);
-		iSmsTest(contId != KNullContactId);
-
-		contId = iSmsTest.CreateContactL(KBadFirst, KBadLast, KBadTel4, KNullDesC);
-		iSmsTest(contId != KNullContactId);
-
-		//Adding no name contact
-
-		contId = iSmsTest.CreateContactL(KNullDesC, KNullDesC, KNoNameTel, KNullDesC);
-		iSmsTest(contId != KNullContactId);
-
-	iSmsTest.Printf(_L("\tTesting with valid telephone numbers\n"));
-
-		TestValidTel(KAnthonyTel, KAnthonyFirst, KAnthonyLast, KNullDesC, details);
-		TestValidTel(KMikkoTel, KMikkoFirst, KMikkoLast, KNullDesC, details);
-		// Test below was added for INC040050. The number of digits matched
-		// against in GetDetails changed and resulted in undesirable behaviour
-		// when searching for an unqualified number with a fully qualified number.
-		TestValidTel(KUnqualifiedTel1, KUnqualifiedFirst, KUnqualifiedLast, KNullDesC, details);
-		TestValidTel(KHarriTel, _L("Räisänen"), KNullDesC, _L("Harri"), details);
-
-	iSmsTest.Printf(_L("\tTesting with invalid telephone numbers\n"));
-
-		TestInvalidTelephone(KBadTel1, details);
-		TestInvalidTelephone(KBadTel2, details);
-		TestInvalidTelephone(KBadTel3, details);
-		TestInvalidTelephone(KBadTel4, details);
-
-	iSmsTest.Printf(_L("\tTesting with duplicate telephone numbers\n"));
-
-		TestDuplicateContact(KDupTel, details);
-
-	iSmsTest.Printf(_L("\tTesting No Names telephone number\n"));
-
-		TestInvalidContact(KNoNameTel, details);
-		TestInvalidContact(KDummy, details);
-
-	iSmsTest.Printf(_L("Passed\n"));
-	}
-
-void CSmutTest::TestValidTel(const TDesC& aTel, const TDesC& aExpect1, const TDesC& aExpect2, const TDesC& aNotExpect, TDes& rDetails)
-	{
-	TInt err = TSmsUtilities::GetDetails(iSmsTest.FileSession(), aTel, rDetails);
-	iSmsTest.Printf(KGetDetailsResult, &aTel, &rDetails);
-
-	if (aExpect1.Length())
-		iSmsTest(rDetails.FindF(aExpect1) != KErrNotFound);
-
-	if (aExpect2.Length())
-		iSmsTest(rDetails.FindF(aExpect2) != KErrNotFound);
-
-	if (aNotExpect.Length())
-		iSmsTest(rDetails.FindF(aNotExpect) == KErrNotFound);
-
-	iSmsTest(err == KErrNone);
-	}
-
-void CSmutTest::TestInvalidTelephone(const TDesC& aTel, TDes& aDetails)
-	{
-	TInt err = TSmsUtilities::GetDetails(iSmsTest.FileSession(), aTel, aDetails);
-	iSmsTest.Printf(KGetDetailsResult, &aTel, &aDetails);
-	iSmsTest(aTel.FindF(aDetails) != KErrNotFound);	//aDetails should contain aTel as aTel is invalid.
-	iSmsTest(err == KErrNone);
-	}	
-
-void CSmutTest::TestInvalidContact(const TDesC& aTel, TDes& aDetails)
-	{
-	TInt err = TSmsUtilities::GetDetails(iSmsTest.FileSession(), aTel, aDetails);
-	iSmsTest.Printf(KGetDetailsResult, &aTel, &aDetails);
-	iSmsTest(aTel.FindF(aDetails) != KErrNotFound); //aDetails should contain aTel as the contact is invalid.
-	iSmsTest(err == KErrNone);
-	}
-
-void CSmutTest::TestDuplicateContact(const TDesC& aTel, TDes& aDetails)
-	{
-	TInt err = TSmsUtilities::GetDetails(iSmsTest.FileSession(), aTel, aDetails);
-	iSmsTest.Printf(KGetDetailsResult, &aTel, &aDetails);
-	iSmsTest(aTel.FindF(aDetails) != KErrNotFound); //aDetails should contain aTel as there is duplicate contact.
-	iSmsTest(err == KErrNone);
-	}
-
-void CSmutTest::TestSmsUtilities3L(CSmsHeader& aHeader)
-	{
-	iSmsTest.Printf(_L("Test TSmsUtilities::ServiceIdL()\n"));
-
-	TMsvId id2 = KMsvNullIndexEntryId;
-// First tested function is ServiceIdL()
-	TSmsUtilities::ServiceIdL(*iSmsTest.iMsvEntry, id2);
-	iSmsTest(id2 == iSmsTest.iSmsServiceId);
-	iSmsTest.Printf(_L("\tPassed\n"));
-
-	iSmsTest.Printf(_L("Test TSmsUtilities::PopulateMsgEntry()\n"));
-	TMsvEntry entry;
-	TSmsUtilities::PopulateMsgEntry(entry,aHeader.Message(), iSmsTest.iSmsServiceId);
-// todo More tests
-	iSmsTest.Printf(_L("\tPassed\n"));
-	}
-
-void CSmutTest::TestSmsUtilitiesTimeStampsL()
-	{
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsDeliver,*iRichText);
-	CleanupStack::PushL(header);
-
-	header->Message().SetTime(1);
-	CSmsDeliver& deliver = header->Deliver();
-	deliver.SetServiceCenterTimeStamp(2);
-
-	CSmsSettings* settings = CSmsSettings::NewL();
-	CleanupStack::PushL(settings);
-	RestoreSettingsL(*settings);
-
-	// Default settings should be to use the time that the SMS message time (the time
-	// that the SMS arrives at the phone) as opposed to the time it arrives at the
-	// service centre.
-
-	iSmsTest.Printf(_L("Test PopulateMsgEntry() with settings to use SMS message time\n"));
-
-	TMsvEntry entry;
-	TSmsUtilities::PopulateMsgEntry(entry, header->Message(), iSmsTest.iSmsServiceId, *settings);
-	iSmsTest(entry.iDate == 1);
-	iSmsTest.Printf(_L("\tPassed\n"));
-
-	// Now test that we use the service centre timestamp if the SMS setting flag
-	// requires us to do so.
-	iSmsTest.Printf(_L("Test PopulateMsgEntry() with settings to use service center timestamp\n"));
-
-	settings->SetUseServiceCenterTimeStampForDate(ETrue);
-
-	TSmsUtilities::PopulateMsgEntry(entry, header->Message(), iSmsTest.iSmsServiceId, *settings);
-	iSmsTest(entry.iDate == 2);
-	iSmsTest.Printf(_L("\tPassed\n"));
-	
-	CleanupStack::PopAndDestroy(2, header);
-	}
-
-void CSmutTest::TestSmsUtilities4L(CSmsHeader& aHeader)
-/**
- * @test Tests CSmsGetDetDescInterface::GetDescription() default implementation
- *
- * This is a modified version of TestSmsUtilities1L(CSmsHeader& aHeader), modified to use the 
- * CSmsGetDetDescInterface ECOM plugin interface instead of the TSmsUtilies
- * interface for ::GetDescription
- */
-	{
-	iSmsTest.Printf(_L("Testing CSmsGetDetDescInterface::GetDescription() - use varying values to test trucation\n"));
-
-	RResourceFile resFile;
-	iSmsTest.OpenResourceFileL(KSmsResourceFile, resFile);
-	CleanupClosePushL(resFile);
-	
-//Test GetDescription()
-
-	TPtrC buf(KGetDescriptionTestMessage);
-	const TInt maxLength = buf.Length();
-	HBufC* desBuf = HBufC::NewLC(maxLength); // on the CleanupStack
-	TPtr desc = desBuf->Des();
-
-	// load ECOM interface used to create SMS details and description values.
-	iSmsTest.Printf(_L("Loading ECOM Plugin...\n"));
-	CSmsGetDetDescInterface* getDetDesc = CSmsGetDetDescInterface::NewL();
-	CleanupStack::PushL(getDetDesc);
-	iSmsTest.Printf(_L("... Plugin loaded\n"));
-	
-	for( TInt length=1; length <= maxLength; ++length )
-		{
-		iSmsTest.Printf(_L("-> trucating to length %d\n"), length);
-
-		desc.Zero();
-		User::LeaveIfError(getDetDesc->GetDescription(aHeader.Message(), desc, length));
-
-		iSmsTest.Printf(_L("-> GetDescription() : %S\n"), &desc);
-		
-		iSmsTest(desc.Length()<=length);
-		iSmsTest(desc == buf.Left(desc.Length()) ); //this won't work if buf contains CEditableText::EParagraphDelimiter
-		}
-	desc.Zero();
-
-//Test Special Message Indication
-
-	CSmsPDU& pdu = aHeader.Message().SmsPDU();
-	CSmsUserData& userData = pdu.UserData();
-	TBuf8<2> msgInd;
-	msgInd.Copy(_L("AA"));
-
-	//Add information element
-	msgInd[0] = TSmsUtilities::EEmailMessageWaiting;
-	msgInd[1] = 0x00000001; //1 message
-
-	iSmsTest.Printf(_L("\tAdding information element (Email) to UD\n"));
-	userData.AddInformationElementL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication, msgInd);
-	User::LeaveIfError(getDetDesc->GetDescription(aHeader.Message(), desc));
-	CheckDescriptionL(resFile, R_MESSAGE_INDICATION_EMAIL_ONE, desc, 2);
-
-	// Set the maximum length of desc to be less than the description.
-	// The description should truncate to fit into desc.
-	User::LeaveIfError(getDetDesc->GetDescription(aHeader.Message(), desc, 10));
-	iSmsTest(desc.Length() == 10); //Check that the Length of desc is the specified max length.
-
-	TestSpecialSmsMessageIndicationPduL(resFile, TSmsUtilities::EVoiceMessageWaiting, R_MESSAGE_INDICATION_VOICEMAIL_ONE);
-	TestSpecialSmsMessageIndicationPduL(resFile, TSmsUtilities::EFaxMessageWaiting, R_MESSAGE_INDICATION_FAX_ONE);
-	TestSpecialSmsMessageIndicationPduL(resFile, TSmsUtilities::EEmailMessageWaiting, R_MESSAGE_INDICATION_EMAIL_ONE);
-	TestSpecialSmsMessageIndicationPduL(resFile, TSmsUtilities::EOtherMessageWaiting, R_MESSAGE_INDICATION_OTHER_ONE);
-	
-	CleanupStack::PopAndDestroy(getDetDesc);
-	REComSession::FinalClose();
-
-	CleanupStack::PopAndDestroy(2, &resFile);
-
-	iSmsTest.Printf(_L("Passed\n"));
-	}
-
-void CSmutTest::TestSmsUtilities5L(CSmsHeader& aHeader)
-/**
- * @test Tests CSmsGetDetDescInterface::GetDetails() default implementation
- *
- * This is a modified version of TestSmsUtilities2L(CSmsHeader& aHeader), modified to use the 
- * CSmsGetDetDescInterface ECOM plugin interface instead of the TSmsUtilies
- * interface for ::GetDetails
- */
-	{
-//Test GetDetails
-
-	iSmsTest.Printf(_L("Test CSmsGetDetDescInterface::GetDetails()\n"));
-
-	_LIT(KLongTel, "+378458932945284754456302945754938539");
-
-	_LIT(KMikkoTel, "+358503367709");
-	_LIT(KMikkoFirst, "Mikko");
-	_LIT(KMikkoLast, "Rintala");
-	_LIT(KMikkoEmail, "mikko@nokia.com");
-
-	_LIT(KUnqualifiedTel, "8503367710");
-	_LIT(KUnqualifiedTel1, "+358503367710");
-	_LIT(KUnqualifiedFirst, "Unq");
-	_LIT(KUnqualifiedLast, "Wallified");
-	_LIT(KUnqualifiedEmail, "unqalified@diysurgery.com");
-
-	_LIT(KAnthonyTel, "+ 7 "); //is valid
-	_LIT(KAnthonyFirst, "Anthony");
-	_LIT(KAnthonyLast, "Alexander");
-	_LIT(KAnthonyEmail, "test@symbian.com");
-
-	_LIT(KHarriTel, "+8"); //is valid
-	_LIT(KHarriFirst, "HarriHarriHarriHarriHarriHarriHarri");
-	_LIT(KHarriLast, "RäisänenRäisänenRäisänenRäisänenRäisänen");
-	_LIT(KHarriEmail, "harri@nokia.com");
-
-	_LIT(KDupTel, "+44207435676");
-	_LIT(KDupFirst1, "Keval");
-	_LIT(KDupLast1, "Pindoria");
-	_LIT(KDupFirst2, "Jackie");
-	_LIT(KDupLast2, "Chan");
-	
-	_LIT(KBadTel1, "This is a bad Telephone");
-	_LIT(KBadTel2, " 5  ");
-	_LIT(KBadTel3, "5+");
-	_LIT(KBadTel4, "*5565434556");
-
-	_LIT(KBadFirst, "BadFirstName");
-	_LIT(KBadLast, "BadLastName");
-
-	_LIT(KNoNameTel, "+449005434");
-
-	_LIT(KDummy, "+44444");
-	
-	// load ECOM interface used to create SMS details and description values.
-	iSmsTest.Printf(_L("Loading ECOM Plugin...\n"));
-	CSmsGetDetDescInterface* getDetDesc = CSmsGetDetDescInterface::NewL();
-	CleanupStack::PushL(getDetDesc);
-	iSmsTest.Printf(_L("... Plugin loaded\n"));
-
-
-	TRAPD(err, iSmsTest.DeleteContactsFileL());
-	iSmsTest(err == KErrNotFound || err == KErrNone);
-
-	iSmsTest.Printf(_L("\tTesting without contacts\n"));
-
-	//Simple test
-	TPtrC testTel(KMikkoTel);
-	TBuf<KSmsDetailsLength> details;
-
-	aHeader.Message().SetToFromAddressL(testTel);
-	getDetDesc->GetDetails(iSmsTest.FileSession(), aHeader.Message(), details);
-	iSmsTest.Printf(KGetDetailsResult, &testTel, &details);
-	iSmsTest(testTel.FindF(details) != KErrNotFound); //details should contain testTel as there is no contact.
-
-	TestInvalidContact(testTel, details);
-
-	testTel.Set(KAnthonyTel);
-	aHeader.Message().SetToFromAddressL(testTel);
-	err = getDetDesc->GetDetails(iSmsTest.FileSession(), aHeader.Message(), details);
-	iSmsTest.Printf(KGetDetailsResult, &testTel, &details);
-	iSmsTest(testTel.FindF(details) != KErrNotFound); //details should contain testTel as there is no contact.
-	iSmsTest(err == KErrNone);
-
-	TestInvalidContact(testTel, details);
-
-	// Testing with long telephone number. 
-	// The telephone number should truncate to fit into details.
-	TestInvalidContact(KLongTel, details);
-	iSmsTest(details.Length() == KSmsDetailsLength); //Length of details should be the default max length.
-
-	//Add contacts
-
-	iSmsTest.Printf(_L("\tAdding Contacts\n"));
-
-		//Adding good telephone numbers
-
-		TContactItemId contId = iSmsTest.CreateContactL(KAnthonyFirst, KAnthonyLast, KAnthonyTel, KAnthonyEmail);
-		iSmsTest(contId != KNullContactId);
-
-		contId = iSmsTest.CreateContactL(KMikkoFirst, KMikkoLast, KMikkoTel, KMikkoEmail);
-		iSmsTest(contId != KNullContactId);
-
-		contId = iSmsTest.CreateContactL(KUnqualifiedFirst, KUnqualifiedLast, KUnqualifiedTel, KUnqualifiedEmail);
-		iSmsTest(contId != KNullContactId);
-
-		contId = iSmsTest.CreateContactL(KHarriFirst, KHarriLast, KHarriTel, KHarriEmail);
-		iSmsTest(contId != KNullContactId);
-
-		//Adding a duplicate telephone
-
-		contId = iSmsTest.CreateContactL(KDupFirst1, KDupLast1, KDupTel, KNullDesC);
-		iSmsTest(contId != KNullContactId);
-
-		contId = iSmsTest.CreateContactL(KDupFirst2, KDupLast2, KDupTel, KNullDesC);
-		iSmsTest(contId != KNullContactId);
-
-		//Adding bad telephone numbers
-
-		contId = iSmsTest.CreateContactL(KBadFirst, KBadLast, KBadTel1, KNullDesC);
-		iSmsTest(contId != KNullContactId);
-
-		contId = iSmsTest.CreateContactL(KBadFirst, KBadLast, KBadTel2, KNullDesC);
-		iSmsTest(contId != KNullContactId);
-
-		contId = iSmsTest.CreateContactL(KBadFirst, KBadLast, KBadTel3, KNullDesC);
-		iSmsTest(contId != KNullContactId);
-
-		contId = iSmsTest.CreateContactL(KBadFirst, KBadLast, KBadTel4, KNullDesC);
-		iSmsTest(contId != KNullContactId);
-
-		//Adding no name contact
-
-		contId = iSmsTest.CreateContactL(KNullDesC, KNullDesC, KNoNameTel, KNullDesC);
-		iSmsTest(contId != KNullContactId);
-
-	iSmsTest.Printf(_L("\tTesting with valid telephone numbers\n"));
-
-		TestValidTel(*getDetDesc, KAnthonyTel, KAnthonyFirst, KAnthonyLast, KNullDesC, details);
-		TestValidTel(*getDetDesc, KMikkoTel, KMikkoFirst, KMikkoLast, KNullDesC, details);
-		// Test below was added for INC040050. The number of digits matched
-		// against in GetDetails changed and resulted in undesirable behaviour
-		// when searching for an unqualified number with a fully qualified number.
-		TestValidTel(*getDetDesc, KUnqualifiedTel1, KUnqualifiedFirst, KUnqualifiedLast, KNullDesC, details);
-		TestValidTel(*getDetDesc, KHarriTel, _L("Räisänen"), KNullDesC, _L("Harri"), details);
-
-	iSmsTest.Printf(_L("\tTesting with invalid telephone numbers\n"));
-
-		TestInvalidTelephone(*getDetDesc, KBadTel1, details);
-		TestInvalidTelephone(*getDetDesc, KBadTel2, details);
-		TestInvalidTelephone(*getDetDesc, KBadTel3, details);
-		TestInvalidTelephone(*getDetDesc, KBadTel4, details);
-
-	iSmsTest.Printf(_L("\tTesting with duplicate telephone numbers\n"));
-
-		TestDuplicateContact(*getDetDesc, KDupTel, details);
-
-	iSmsTest.Printf(_L("\tTesting No Names telephone number\n"));
-
-		TestInvalidContact(*getDetDesc, KNoNameTel, details);
-		TestInvalidContact(*getDetDesc, KDummy, details);
-	
-	CleanupStack::PopAndDestroy(getDetDesc);
-	REComSession::FinalClose();
-
-	iSmsTest.Printf(_L("Passed\n"));
-	}
-
-void CSmutTest::TestValidTel(CSmsGetDetDescInterface& aGetDetDesc, const TDesC& aTel, const TDesC& aExpect1, const TDesC& aExpect2, const TDesC& aNotExpect, TDes& rDetails)
-	{
-	TInt err = aGetDetDesc.GetDetails(iSmsTest.FileSession(), aTel, rDetails);
-	iSmsTest.Printf(KGetDetailsResult, &aTel, &rDetails);
-
-	if (aExpect1.Length())
-		iSmsTest(rDetails.FindF(aExpect1) != KErrNotFound);
-
-	if (aExpect2.Length())
-		iSmsTest(rDetails.FindF(aExpect2) != KErrNotFound);
-
-	if (aNotExpect.Length())
-		iSmsTest(rDetails.FindF(aNotExpect) == KErrNotFound);
-
-	iSmsTest(err == KErrNone);
-	}
-
-void CSmutTest::TestInvalidTelephone(CSmsGetDetDescInterface& aGetDetDesc, const TDesC& aTel, TDes& aDetails)
-	{
-	TInt err = aGetDetDesc.GetDetails(iSmsTest.FileSession(), aTel, aDetails);
-	iSmsTest.Printf(KGetDetailsResult, &aTel, &aDetails);
-	iSmsTest(aTel.FindF(aDetails) != KErrNotFound);	//aDetails should contain aTel as aTel is invalid.
-	iSmsTest(err == KErrNone);
-	}	
-
-void CSmutTest::TestInvalidContact(CSmsGetDetDescInterface& aGetDetDesc, const TDesC& aTel, TDes& aDetails)
-	{
-	TInt err = aGetDetDesc.GetDetails(iSmsTest.FileSession(), aTel, aDetails);
-	iSmsTest.Printf(KGetDetailsResult, &aTel, &aDetails);
-	iSmsTest(aTel.FindF(aDetails) != KErrNotFound); //aDetails should contain aTel as the contact is invalid.
-	iSmsTest(err == KErrNone);
-	}
-
-void CSmutTest::TestDuplicateContact(CSmsGetDetDescInterface& aGetDetDesc, const TDesC& aTel, TDes& aDetails)
-	{
-	TInt err = aGetDetDesc.GetDetails(iSmsTest.FileSession(), aTel, aDetails);
-	iSmsTest.Printf(KGetDetailsResult, &aTel, &aDetails);
-	iSmsTest(aTel.FindF(aDetails) != KErrNotFound); //aDetails should contain aTel as there is duplicate contact.
-	iSmsTest(err == KErrNone);
-	}
-
-void CSmutTest::TestSpecialSmsMessageIndicationPduL(RResourceFile& aResFile, TSmsUtilities::TSmsUtilitiesSpecialMessageType aMessageType, TInt aId)
-	{
-	iSmsTest.Printf(_L("\tTestSpecialSmsMessageIndicationPduL Type=%d..."), aMessageType);
-
-	const TUint8 KMaxCount = 0xFF;
-	for (TUint8 i = 0; i < KMaxCount; i++)
-		{
-		TInt resId = aId;
-		if (i != 1)
-			resId++;
-
-		TestSpecialSmsMessageIndicationPduL(aResFile, STATIC_CAST(TUint8, aMessageType), i, resId);
-		TestSpecialSmsMessageIndicationPduL(aResFile, STATIC_CAST(TUint8, aMessageType | 0x80), i, resId);
-		}
-
-	iSmsTest.Printf(_L("Passed\n"));
-	}
-
-void CSmutTest::TestSpecialSmsMessageIndicationPduL(RResourceFile& aResFile, TUint8 aMessageType, TUint8 aMessageCount, TInt aId)
-	{
-	_LIT8(KFaxIndicationPdu, "440B916407586704F900002010011153710406040102810200");
-	const TInt KIndicationPosition = 44;
-	TBuf<KSmsDescriptionLength> desc;
-
-	//Replace the Message Indication in this PDU
-	RMobileSmsMessaging::TMobileSmsGsmTpdu miPdu(KFaxIndicationPdu);
-	_LIT8(KFormat, "%02X%02X");
-	TPtr8 ptr(&miPdu[KIndicationPosition], 0, 4);
-	ptr.AppendFormat(KFormat, aMessageType, aMessageCount);
-
-
-	CSmsMessage* msg = CreateSmsMessageLC(miPdu);
-	User::LeaveIfError(TSmsUtilities::GetDescription(*msg, desc));
-	CleanupStack::PopAndDestroy(msg);
-
-	if (aMessageCount != 1)
-		CheckDescriptionL(aResFile, aId, desc, aMessageCount);
-	else
-		CheckDescriptionL(aResFile, aId, desc);
-	}
-
-void CSmutTest::CheckDescriptionL(RResourceFile& aResFile, TInt aId, TRefByValue<const TDesC> aDesc, ...)
-	{
-	const TDesC& ref = aDesc;
-
-	TBuf<256> resDesc;
-	TBuf<256> resString;
-
-	VA_LIST list;
-	VA_START(list, aDesc);
-
-	iSmsTest.ReadResourceStringL(aResFile, aId, resString);
-	resDesc.AppendFormatList(resString, list);
-
-	if (ref != resDesc)
-		{
-		iSmsTest.Printf(_L("\tMISMATCH Desc \"%S\" Resource \"%S\"\n"), &ref, &resDesc);
-		iSmsTest(EFalse);
-		}
-	}
-
-TBool CSmutTest::CheckSmsEntry(
-							const TMsvSmsEntry& aEntry, 
-							TBool aClassExpected, 
-							TSmsDataCodingScheme::TSmsClass aClass, 
-							TUint8 aPID, 
-							TBool aUPI, 
-							TMsvSmsEntry::TMsvSmsEntryAckSummary aDeliverySummary, 
-							TBool aValidMessageId, 
-							TInt32 aMessageId) const
-	{
-	TCompare retVal(ETrue);
-
-	TSmsDataCodingScheme::TSmsClass dummyClass;
-
-	retVal((aEntry.Class(dummyClass) && aClassExpected) || (!aEntry.Class(dummyClass) && !aClassExpected));
-
-	if (aClassExpected)
-		retVal(dummyClass == aClass);
-
-	retVal(aEntry.ProtocolIdentifier() == aPID);
-	retVal((aEntry.UserPromptIndicator() && aUPI) || (!aEntry.UserPromptIndicator() && !aUPI));
-
-	retVal(aEntry.AckSummary(ESmsAckTypeDelivery) == aDeliverySummary);
-
-	TInt32 dummyMessageId;
-
-	retVal( (aEntry.MessageId(dummyMessageId) && aValidMessageId) || (!aEntry.MessageId(dummyMessageId) && !aValidMessageId) );
-	if( aValidMessageId )
-		retVal( dummyMessageId == aMessageId );
-
-	return retVal;
-	}
-
-void CSmutTest::TestSmsEntryL()
-	{
-	iSmsTest.Test().Next(_L("Testing TMsvSmsEntry"));
-
-	TMsvSmsEntry entry;
-	iSmsTest(CheckSmsEntry(entry, EFalse, TSmsDataCodingScheme::ESmsClass0, 0, EFalse, TMsvSmsEntry::ENoAckSummary, EFalse, 0));
-
-	entry.SetUserPromptIndicator(ETrue);
-	iSmsTest(CheckSmsEntry(entry, EFalse, TSmsDataCodingScheme::ESmsClass0, 0, ETrue, TMsvSmsEntry::ENoAckSummary, EFalse, 0));
-
-	entry.SetUserPromptIndicator(EFalse);
-	iSmsTest(CheckSmsEntry(entry, EFalse, TSmsDataCodingScheme::ESmsClass0, 0, EFalse, TMsvSmsEntry::ENoAckSummary, EFalse, 0));
-
-	entry.SetProtocolIdentifier(123);
-	iSmsTest(CheckSmsEntry(entry, EFalse, TSmsDataCodingScheme::ESmsClass0, 123, EFalse, TMsvSmsEntry::ENoAckSummary, EFalse, 0));
-
-	entry.SetProtocolIdentifier(100);
-	entry.SetUserPromptIndicator(ETrue);
-	iSmsTest(CheckSmsEntry(entry, EFalse, TSmsDataCodingScheme::ESmsClass0, 100, ETrue, TMsvSmsEntry::ENoAckSummary, EFalse, 0));
-
-	entry.SetClass(ETrue, TSmsDataCodingScheme::ESmsClass0);
-	iSmsTest(CheckSmsEntry(entry, ETrue, TSmsDataCodingScheme::ESmsClass0, 100, ETrue, TMsvSmsEntry::ENoAckSummary, EFalse, 0));
-
-	entry.SetClass(ETrue, TSmsDataCodingScheme::ESmsClass1);
-	iSmsTest(CheckSmsEntry(entry, ETrue, TSmsDataCodingScheme::ESmsClass1, 100, ETrue, TMsvSmsEntry::ENoAckSummary, EFalse, 0));
-
-	entry.SetClass(ETrue, TSmsDataCodingScheme::ESmsClass2);
-	iSmsTest(CheckSmsEntry(entry, ETrue, TSmsDataCodingScheme::ESmsClass2, 100, ETrue, TMsvSmsEntry::ENoAckSummary, EFalse, 0));
-	
-	entry.SetClass(ETrue, TSmsDataCodingScheme::ESmsClass3);
-	iSmsTest(CheckSmsEntry(entry, ETrue, TSmsDataCodingScheme::ESmsClass3, 100, ETrue, TMsvSmsEntry::ENoAckSummary, EFalse, 0));
-
-	entry.SetClass(EFalse);
-	iSmsTest(CheckSmsEntry(entry, EFalse, TSmsDataCodingScheme::ESmsClass3, 100, ETrue, TMsvSmsEntry::ENoAckSummary, EFalse, 0));
-
-	entry.SetUserPromptIndicator(EFalse);
-	iSmsTest(CheckSmsEntry(entry, EFalse, TSmsDataCodingScheme::ESmsClass3, 100, EFalse, TMsvSmsEntry::ENoAckSummary, EFalse, 0));
-
-	entry.SetClass(ETrue, TSmsDataCodingScheme::ESmsClass0);
-	
-	TInt classCounter, upiCounter, classDef, deliverySummary, messageIdValid;
-	TSmsDataCodingScheme::TSmsClass tempClass;
-	TMsvSmsEntry::TMsvSmsEntryAckSummary tempDelivery;
-	TUint8 pidCounter;
-	TInt32 messageId = 123456789;
-
-	for (classCounter = 0; classCounter < 4; classCounter++)
-		{
-		for (pidCounter = 0; pidCounter < 128; pidCounter++)
-			{
-			for (upiCounter = 0; upiCounter < 2; upiCounter++)
-				{
-				for (classDef = 0; classDef < 2; classDef++)
-					{
-					for( deliverySummary = 0; deliverySummary < 5; ++deliverySummary )
-						{
-						for( messageIdValid = 0; messageIdValid < 2; ++messageIdValid)
-							{
-							entry = TMsvSmsEntry();
-							tempClass = static_cast<TSmsDataCodingScheme::TSmsClass>(classCounter);
-							tempDelivery = static_cast<TMsvSmsEntry::TMsvSmsEntryAckSummary>(deliverySummary);
-							entry.SetClass(classDef, tempClass);
-							entry.SetProtocolIdentifier(pidCounter);
-							entry.SetUserPromptIndicator(upiCounter);
-							entry.SetAckSummary(ESmsAckTypeDelivery, tempDelivery);
-							entry.SetMessageId(messageId, messageIdValid);
-							iSmsTest(CheckSmsEntry(entry, classDef, tempClass, pidCounter, upiCounter, tempDelivery, messageIdValid, messageId));
-							}
-						}
-					}
-				}
-			}
-		}
-	
-	for (classCounter = 0; classCounter < 4; classCounter++)
-		{
-		for (pidCounter = 0; pidCounter < 128; pidCounter++)
-			{
-			for (upiCounter = 0; upiCounter < 2; upiCounter++)
-				{
-				for (classDef = 0; classDef < 2; classDef++)
-					{
-					for( deliverySummary = 0; deliverySummary < 5; ++deliverySummary )
-						{
-						for( messageIdValid = 0; messageIdValid < 2; ++messageIdValid)
-							{
-							tempClass = static_cast<TSmsDataCodingScheme::TSmsClass>(classCounter);
-							tempDelivery = static_cast<TMsvSmsEntry::TMsvSmsEntryAckSummary>(deliverySummary);
-							entry.SetClass(classDef, tempClass);
-							entry.SetProtocolIdentifier(pidCounter);
-							entry.SetUserPromptIndicator(upiCounter);
-							entry.SetAckSummary(ESmsAckTypeDelivery, tempDelivery);
-							entry.SetMessageId(messageId, messageIdValid);
-							iSmsTest(CheckSmsEntry(entry, classDef, tempClass, pidCounter, upiCounter, tempDelivery, messageIdValid, messageId));
-							}
-						}
-					}
-				}
-			}
-		}
-	}
--- a/messagingappbase/smsmtm/test/src/T_smutTE.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4015 +0,0 @@
-// Copyright (c) 2005-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 <smss.rsg>
-#include <csmsaccount.h>
-#include <csmsemailfields.h>
-
-#include "T_smutTE.h"
-#include <gsmuieoperations.h>
-
-const TUid KUidMsvSmsEmailFieldsStream	= {0x10204C9D};
-const TInt KLogID1 = 123456789;
-const TInt KLogID2 = 987654321;
-const TInt KLogID3 = 118888;
-
-CSmutTest::CSmutTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest,CTestStep& aTestStep)
-: CSmsTestBase(aSmsTest, aScriptFile, aNextTest), iTestStep(aTestStep)
-	{
-	}
-
-void CSmutTest::RunAutoL()
-	{
-	}
-	
-CSmutTest::~CSmutTest()
-	{
-	delete iSmsHeader;
-	delete iRichText;
-	delete iParaLayer;
-	delete iCharLayer;
-	if(iDBSession)
-	  {
-	  iDBSession->Close();
-	  }
-	delete iDBSession;	
-	}
-
-void CSmutTest::ConstructL()
-	{
-	iSmsTest.SetLogToFile();
-
-	iSelection = new (ELeave) CMsvEntrySelection();
-	iTimer = CTestTimer::NewL();
-
-	iParaLayer =CParaFormatLayer::NewL();
-	iCharLayer = CCharFormatLayer::NewL();
-	iRichText = CRichText::NewL(iParaLayer, iCharLayer, CEditableText::EFlatStorage,256);
-	iDBSession = CMDBSession::NewL(CMDBSession::LatestVersion());	
-
-	CActiveScheduler::Add(this);
-	}
-
-CSmutTest* CSmutTest::NewLC(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest,CTestStep& aTestStep)
-	{
-	CSmutTest* self = new (ELeave) CSmutTest(aSmsTest, aScriptFile, aNextTest, aTestStep);
-	CleanupStack::PushL(self);
-
-	self->ConstructL();
-
-	return self;
-	}
-
-void CSmutTest::ShowMenuL()
-	{
-	}
-
-TVerdict CSmutTest::TestSettingsL()
-	{
-	iTestStep.INFO_PRINTF1(_L("Testing Create Settings..."));
-
-	iSmsTest.SetEntryL(iSmsTest.iSmsServiceId);
-
-	// First we test all the features of the class CSmsSettings
-	// We give them different values and compare if it works
-
-	CSmsSettings* settings = CSmsSettings::NewLC();
-	if(!CompareSettings(*settings, *settings))
-		{
-		CleanupStack::PopAndDestroy(settings);
-		return EFail;	
-		}
-	if(!TestSettingsMembersL(*settings))
-		{
-		CleanupStack::PopAndDestroy(settings);
-		return EFail;	
-		}
-	TestMessageSettingsMembersL(*settings);
-
-	// Lets copy the values to a different instance
-	CSmsSettings* smsSettings=CSmsSettings::NewLC();
-	smsSettings->CopyL(*settings);
-	if(!CompareSettings(*smsSettings, *settings))
-		{
-		CleanupStack::PopAndDestroy(2,settings);
-		return EFail;	
-		}
-	CleanupStack::PopAndDestroy(smsSettings);
-	smsSettings = NULL;
-	iTestStep.INFO_PRINTF1(_L("Test CSmsSettings::CopyL() passed"));
-
-	//	Lets create a sms service in the file system with these values
-	TestStoreRestoreSettingsL(*settings);
-
-	// Lets make the previous test again; Lets give a settings instance some
-	// values, store it, restore it and see that the values are still the same
-	CSmsSettings* set2=CSmsSettings::NewLC();
-	set2->AddServiceCenterL(_L("Radiolinja0"),_L("+358508771010"));
-	set2->AddServiceCenterL(_L("Radiolinja1"),_L("+358508771010"));
-	set2->AddServiceCenterL(_L("Radiolinja2"),_L("+358508771010"));
-	set2->AddServiceCenterL(_L("Radiolinja3"),_L("+358508771010"));
-	set2->AddServiceCenterL(_L("Radiolinja4"),_L("+358508771010"));
-	set2->SetDefaultServiceCenter(1);
-	iSmsTest(set2->DefaultServiceCenter()==1);
-	// Validity Period	
-	set2->SetValidityPeriod(ESmsVPSixHours);
-	if(set2->ValidityPeriod().Int()!=ESmsVPSixHours)
-		{
-		CleanupStack::PopAndDestroy(2,settings);
-		return EFail;	
-		}
-	// Reply Quoted
-	set2->SetReplyQuoted(EFalse);
-	if(set2->ReplyQuoted())
-		{
-		CleanupStack::PopAndDestroy(2,settings);
-		return EFail;	
-		}
-	// Reject Duplicate 
-	set2->SetRejectDuplicate(ETrue);
-	if(!set2->RejectDuplicate())
-		{
-		CleanupStack::PopAndDestroy(2,settings);
-		return EFail;	
-		}
-	// Delivery Method
-	set2->SetDelivery(ESmsDeliveryUponRequest);
-	if(set2->Delivery()!=ESmsDeliveryUponRequest)
-		{
-		CleanupStack::PopAndDestroy(2,settings);
-		return EFail;	
-		}
-	// Delivery Report
-	set2->SetDeliveryReport(ETrue);
-	if(!set2->DeliveryReport())
-		{
-		CleanupStack::PopAndDestroy(2,settings);
-		return EFail;	
-		}
-	// Reply Path
-	set2->SetReplyPath(EFalse);
-	if(set2->ReplyPath())
-		{
-		CleanupStack::PopAndDestroy(2,settings);
-		return EFail;	
-		}
-	// Message Conversion
-	set2->SetMessageConversion(ESmsConvPIDNone);
-	if(set2->MessageConversion()!=ESmsConvPIDNone)
-		{
-		CleanupStack::PopAndDestroy(2,settings);
-		return EFail;	
-		}
-	// Can Concatenate
-	set2->SetCanConcatenate(ETrue);
-	if(!set2->CanConcatenate())
-		{
-		CleanupStack::PopAndDestroy(2,settings);
-		return EFail;	
-		}
-	// Character Set
-	set2->SetCharacterSet(TSmsDataCodingScheme::ESmsAlphabet8Bit);
-	if(set2->CharacterSet()!=TSmsDataCodingScheme::ESmsAlphabet8Bit)
-		{
-		CleanupStack::PopAndDestroy(2,settings);
-		return EFail;	
-		}
-	// Validity period format
-	set2->SetValidityPeriodFormat(TSmsFirstOctet::ESmsVPFSemiOctet);
-	if(set2->ValidityPeriodFormat()!=TSmsFirstOctet::ESmsVPFSemiOctet)
-		{
-		CleanupStack::PopAndDestroy(2,settings);
-		return EFail;	
-		}
-	// Status Report Handling
-	set2->SetStatusReportHandling(CSmsSettings::EMoveReportToInboxVisible);
-	if(set2->StatusReportHandling()!=CSmsSettings::EMoveReportToInboxVisible)
-		{
-		CleanupStack::PopAndDestroy(2,settings);
-		return EFail;	
-		}
-	// Special Message Handling
-	set2->SetSpecialMessageHandling(CSmsSettings::EMoveReportToInboxVisible);
-	if(set2->SpecialMessageHandling()!=CSmsSettings::EMoveReportToInboxVisible)
-		{
-		CleanupStack::PopAndDestroy(2,settings);
-		return EFail;	
-		}
-
-	if(!TestStoreRestoreSettingsL(*set2))
-		{
-		CleanupStack::PopAndDestroy(2,settings);
-		return EFail;	
-		}
-
-	set2->SetClass2Folder(123);
-	if(!TestStoreRestoreSettingsL(*set2))
-		{
-		CleanupStack::PopAndDestroy(2,settings);
-		return EFail;	
-		}
-
-	CleanupStack::PopAndDestroy(set2);
-
-	iSmsTest.iServiceSettings->CopyL(*settings);  // Lets copy the current setting to the service settings
-
-	if(!CompareSettings(*iSmsTest.iServiceSettings, *settings))
-		{
-		CleanupStack::PopAndDestroy(settings);
-		return EFail;	
-		}
-
-	iTestStep.INFO_PRINTF1(_L("CSmsSettings::CopyL() 2"));
-	CleanupStack::PopAndDestroy(settings);
-	iTestStep.INFO_PRINTF1(_L("Test Create Settings Passed"));
-	TestSettingsStoreToCommDbL();
-	iTestStep.INFO_PRINTF1(_L("Test Create Settings Passed"));
-	return EPass;
-	}
-
-
-TBool CSmutTest::CompareSettingsFiles(
-	RFs& aFs, const TDesC& aCompare1, const TDesC& aCompare2
-	)
-	{
-	TBool identical = ETrue;
-
-	RFileReadStream stream1;
-	RFileReadStream stream2;
-
-	// Open each stream for binary read.
-	stream1.Open(aFs, aCompare1, EFileStream | EFileRead);
-	stream2.Open(aFs, aCompare2, EFileStream | EFileRead);
-
-	TInt ret1 = KErrNone;
-	TInt ret2 = KErrNone;
-	TBool finished = EFalse;
-	TUint8 byte1 = 0;
-	TUint8 byte2 = 0;
-
-	while (!finished)
-		{
-		TRAP(ret1, byte1 = stream1.ReadUint8L());
-		TRAP(ret2, byte2 = stream2.ReadUint8L());
-
-		if (byte1 != byte2 || ret1 == KErrEof || ret2 == KErrEof)
-			{
-			// Either file data or lengths differ.
-			if ((byte1 != byte2) || (ret1 != ret2))
-				identical = EFalse;
-			finished = ETrue;
-			}
-		}
-
-	stream1.Close();
-	stream2.Close();
-
-	return identical;
-	}
-
-TBool CSmutTest::TestStoreRestoreSettingsL(const CSmsSettings& aSettings)
-	{
-	StoreSettingsL(aSettings);
-
-	// Lets read the service and see it the values are still ok
-	CSmsSettings* set1=CSmsSettings::NewLC();
-
-	RestoreSettingsL(*set1);
-
-	if(!CompareSettings(*set1, aSettings))
-		{
-		CleanupStack::PopAndDestroy(set1);
-		return EFalse;	
-		}
-
-	CleanupStack::PopAndDestroy(set1);
-	
-	return ETrue;
-	}
-
-TBool CSmutTest::TestSettingsMembersL(CSmsSettings& aSettings)
-	{
-	// Status Report Handling (what should be done to report messages)
-	aSettings.SetStatusReportHandling(CSmsSettings::EMoveReportToInboxInvisible);
-	if(aSettings.StatusReportHandling()!=CSmsSettings::EMoveReportToInboxInvisible)
-		{
-		return EFalse;
-		}
-	aSettings.SetStatusReportHandling(CSmsSettings::EMoveReportToInboxVisible);
-	if(aSettings.StatusReportHandling()!=CSmsSettings::EMoveReportToInboxVisible)
-		{
-		return EFalse;	
-		}
-	aSettings.SetStatusReportHandling(CSmsSettings::EDiscardReport);
-	if(aSettings.StatusReportHandling()!=CSmsSettings::EDiscardReport)
-		{
-		return EFalse;
-		}
-	aSettings.SetStatusReportHandling(CSmsSettings::EMoveReportToInboxInvisibleAndMatch);
-	if(aSettings.StatusReportHandling()!=CSmsSettings::EMoveReportToInboxInvisibleAndMatch)
-		{
-		return EFalse;	
-		}
-	aSettings.SetStatusReportHandling(CSmsSettings::EMoveReportToInboxVisibleAndMatch);
-	if(aSettings.StatusReportHandling()!=CSmsSettings::EMoveReportToInboxVisibleAndMatch)
-		{
-		return EFalse;	
-		}
-	aSettings.SetStatusReportHandling(CSmsSettings::EDiscardReportAndMatch);
-	if(aSettings.StatusReportHandling()!=CSmsSettings::EDiscardReportAndMatch)
-		{
-		return EFalse;	
-		}
-	iTestStep.INFO_PRINTF1(_L("Test Status Report Handling Passed"));
-
-	// SC handling
-	aSettings.AddServiceCenterL(_L("Radiolinja0"),_L("+358508771010"));
-	aSettings.AddServiceCenterL(_L("Radiolinja1"),_L("+358508771010"));
-	aSettings.AddServiceCenterL(_L("Radiolinja2"),_L("+358508771010"));
-	aSettings.AddServiceCenterL(_L("Radiolinja3"),_L("+358508771010"));
-	aSettings.AddServiceCenterL(_L("Radiolinja4"),_L("+358508771010"));
-	if(aSettings.GetServiceCenter(0).Name()!=_L("Radiolinja0"))
-		{
-		return EFalse;	
-		}
-	aSettings.RemoveServiceCenter(aSettings.ServiceCenterCount()-3);
-	aSettings.RemoveServiceCenter(aSettings.ServiceCenterCount()-2);
-	if(aSettings.GetServiceCenter(1).Name()!=_L("Radiolinja1"))
-		{
-		return EFalse;	
-		}
-	if(aSettings.GetServiceCenter(2).Name()!=_L("Radiolinja4"))
-		{
-		return EFalse;	
-		}
-	if(aSettings.GetServiceCenter(2).Address()!=_L("+358508771010"))
-		{
-		return EFalse;	
-		}
-	aSettings.RemoveServiceCenter(aSettings.ServiceCenterCount()-1);
-	aSettings.RemoveServiceCenter(aSettings.ServiceCenterCount()-1);
-	aSettings.RemoveServiceCenter(aSettings.ServiceCenterCount()-1);
-	//	aSettings.RemoveServiceCenter(aSettings.ServiceCenterCount()-1); // this would be -1
-	aSettings.AddServiceCenterL(_L("Radiolinja0"),_L("+358508771010"));
-	aSettings.AddServiceCenterL(_L("Radiolinja1"),_L("+358508771010"));
-	aSettings.AddServiceCenterL(_L("Radiolinja2"),_L("+358508771010"));
-	aSettings.SetDefaultServiceCenter(1);
-	if(aSettings.DefaultServiceCenter()!=1)
-		{
-		return EFalse;	
-		}
-	aSettings.SetDefaultServiceCenter(2);
-	if(aSettings.DefaultServiceCenter()!=2)
-		{
-		return EFalse;	
-		}
-	iTestStep.INFO_PRINTF1(_L("Test Default SC Passed"));
-
-	// Special Message Handling (what should be done to special messages)
-	aSettings.SetSpecialMessageHandling(CSmsSettings::EMoveReportToInboxInvisible);
-	if(aSettings.SpecialMessageHandling()!=CSmsSettings::EMoveReportToInboxInvisible)
-		{
-		return EFalse;	
-		}
-	aSettings.SetSpecialMessageHandling(CSmsSettings::EMoveReportToInboxVisible);
-	if(aSettings.SpecialMessageHandling()!=CSmsSettings::EMoveReportToInboxVisible)
-		{
-		return EFalse;	
-		}
-	aSettings.SetSpecialMessageHandling(CSmsSettings::EDiscardReport);
-	if(aSettings.SpecialMessageHandling()!=CSmsSettings::EDiscardReport)
-		{
-		return EFalse;	
-		}
-	aSettings.SetSpecialMessageHandling(CSmsSettings::EMoveReportToInboxInvisibleAndMatch);
-	if(aSettings.SpecialMessageHandling()!=CSmsSettings::EMoveReportToInboxInvisibleAndMatch)
-		{
-		return EFalse;	
-		}
-	aSettings.SetSpecialMessageHandling(CSmsSettings::EMoveReportToInboxVisibleAndMatch);
-	if(aSettings.SpecialMessageHandling()!=CSmsSettings::EMoveReportToInboxVisibleAndMatch)
-		{
-		return EFalse;	
-		}
-	aSettings.SetSpecialMessageHandling(CSmsSettings::EDiscardReportAndMatch);
-	if(aSettings.SpecialMessageHandling()!=CSmsSettings::EDiscardReportAndMatch)
-		{
-		return EFalse;	
-		}
-	iTestStep.INFO_PRINTF1(_L("Test Special Message Handling Passed"));
-
-	//CommDbAction
-	aSettings.SetCommDbAction(CSmsSettings::ENone);
-	if(aSettings.CommDbAction() != CSmsSettings::ENone)
-		{
-		return EFalse;	
-		}
-	aSettings.SetCommDbAction(CSmsSettings::EStoreToCommDb);
-	if(aSettings.CommDbAction() != CSmsSettings::EStoreToCommDb)
-		{
-		return EFalse;	
-		}
-	iTestStep.INFO_PRINTF1(_L("Test CommDb Action Passed"));
-
-	//SmsBearerAction
-	aSettings.SetSmsBearerAction(CSmsSettings::ENone);
-	if(aSettings.SmsBearerAction() != CSmsSettings::ENone)
-		{
-		return EFalse;	
-		}
-	aSettings.SetSmsBearerAction(CSmsSettings::EStoreToCommDb);
-	if(aSettings.SmsBearerAction() != CSmsSettings::EStoreToCommDb)
-		{
-		return EFalse;	
-		}
-	iTestStep.INFO_PRINTF1(_L("Test SMS Bearer Action Passed"));
-
-	//SmsBearer
-	aSettings.SetSmsBearer(CSmsSettings::ESmsBearerPacketOnly);
-	if(aSettings.SmsBearer() != CSmsSettings::ESmsBearerPacketOnly)
-		{
-		return EFalse;	
-		}
-	aSettings.SetSmsBearer(CSmsSettings::ESmsBearerPacketOnly);
-	if(aSettings.SmsBearer() != CSmsSettings::ESmsBearerPacketOnly)
-		{
-		return EFalse;	
-		}
-	aSettings.SetSmsBearer(CSmsSettings::ESmsBearerCircuitOnly);
-	if(aSettings.SmsBearer() != CSmsSettings::ESmsBearerCircuitOnly)
-		{
-		return EFalse;	
-		}
-	aSettings.SetSmsBearer(CSmsSettings::ESmsBearerPacketPreferred);
-	if(aSettings.SmsBearer() != CSmsSettings::ESmsBearerPacketPreferred)
-		{
-		return EFalse;	
-		}
-	aSettings.SetSmsBearer(CSmsSettings::ESmsBearerCircuitPreferred);
-	if(aSettings.SmsBearer() != CSmsSettings::ESmsBearerCircuitPreferred)
-		{
-		return EFalse;	
-		}
-	iTestStep.INFO_PRINTF1(_L("Test SMS Bearer Passed"));
-
-	// Reply Quoted
-	aSettings.SetReplyQuoted(EFalse);
-	if(aSettings.ReplyQuoted())
-		{
-		return EFalse;	
-		}
-	aSettings.SetReplyQuoted(ETrue);
-	if(!aSettings.ReplyQuoted())
-		{
-		return EFalse;	
-		}
-	iTestStep.INFO_PRINTF1(_L("Test Reply Quoted Passed"));
-
-	// Delivery Method
-	aSettings.SetDelivery(ESmsDeliveryUponRequest);
-	if(aSettings.Delivery()!=ESmsDeliveryUponRequest)
-		{
-		return EFalse;	
-		}
-	aSettings.SetDelivery(ESmsDeliveryScheduled);
-	if(aSettings.Delivery()!=ESmsDeliveryScheduled)
-		{
-		return EFalse;
-		}
-	aSettings.SetDelivery(ESmsDeliveryImmediately);
-	if(aSettings.Delivery()!=ESmsDeliveryImmediately)
-		{
-		return EFalse;	
-		}
-	iTestStep.INFO_PRINTF1(_L("Test Delivery Passed"));
-
-	// Class2Folder
-	if(aSettings.Class2Folder() != KMsvGlobalInBoxIndexEntryId)
-		{
-		return EFalse;	
-		}
-	aSettings.SetClass2Folder(1);
-	if(aSettings.Class2Folder() != 1)
-		{
-		return EFalse;
-		}
-	iTestStep.INFO_PRINTF1(_L("Test Class2Folder Passed"));	
-
-	// Description length
-	if(aSettings.DescriptionLength() != KSmsDescriptionLength)
-		{
-		return EFalse;
-		}
-	aSettings.SetDescriptionLength(100);
-	if(aSettings.DescriptionLength() != 100)
-		{
-		return EFalse;
-		}
-	iTestStep.INFO_PRINTF1(_L("Test DescriptionLength Passed"));	
-	
-	return ETrue;
-	}
-
-TBool CSmutTest::TestMessageSettingsMembersL(CSmsMessageSettings& aSettings)
-	{
-
-	// Reject Duplicate 
-	aSettings.SetRejectDuplicate(ETrue);
-	if(!aSettings.RejectDuplicate())
-		{
-		return EFalse;	
-		}
-	aSettings.SetRejectDuplicate(EFalse);
-	if(aSettings.RejectDuplicate())
-		{
-		return EFalse;	
-		}
-	
-	iTestStep.INFO_PRINTF1(_L("Test Reject Duplicate Passed"));
-
-	// Delivery Report
-	aSettings.SetDeliveryReport(ETrue);
-	if(!aSettings.DeliveryReport())
-		{
-		return EFalse;	
-		}
-	aSettings.SetDeliveryReport(EFalse);
-	if(aSettings.DeliveryReport())
-		{
-		return EFalse;	
-		}
-	iTestStep.INFO_PRINTF1(_L("Test Delivery Report Passed"));
-
-	// Reply Path
-	aSettings.SetReplyPath(EFalse);
-	if(aSettings.ReplyPath()!=EFalse)
-		{
-		return EFalse;	
-		}
-	aSettings.SetReplyPath(ETrue);
-	if(!aSettings.ReplyPath())
-		{
-		return EFalse;	
-		}
-	iTestStep.INFO_PRINTF1(_L("Test Reply Path Passed"));
-
-	// Validity period format
-	aSettings.SetValidityPeriodFormat(TSmsFirstOctet::ESmsVPFNone);
-	if(aSettings.ValidityPeriodFormat()!=TSmsFirstOctet::ESmsVPFNone)
-		{
-		return EFalse;	
-		}
-	aSettings.SetValidityPeriodFormat(TSmsFirstOctet::ESmsVPFEnhanced);
-	if(aSettings.ValidityPeriodFormat()!=TSmsFirstOctet::ESmsVPFEnhanced)
-		{
-		return EFalse;	
-		}
-	aSettings.SetValidityPeriodFormat(TSmsFirstOctet::ESmsVPFInteger);
-	if(aSettings.ValidityPeriodFormat()!=TSmsFirstOctet::ESmsVPFInteger)
-		{
-		return EFalse;	
-		}
-	aSettings.SetValidityPeriodFormat(TSmsFirstOctet::ESmsVPFSemiOctet);
-	if(aSettings.ValidityPeriodFormat()!=TSmsFirstOctet::ESmsVPFSemiOctet)
-		{
-		return EFalse;	
-		}
-	iTestStep.INFO_PRINTF1(_L("Test Validity Period Format Passed"));
-
-	// Message Conversion (following conversions are supported)
-	aSettings.SetMessageConversion(ESmsConvFax);
-	if(aSettings.MessageConversion()!=ESmsConvFax)
-		{
-		return EFalse;	
-		}
-	aSettings.SetMessageConversion(ESmsConvX400);
-	if(aSettings.MessageConversion()!=ESmsConvX400)
-		{
-		return EFalse;	
-		}
-	aSettings.SetMessageConversion(ESmsConvPaging);
-	if(aSettings.MessageConversion()!=ESmsConvPaging)
-		{
-		return EFalse;	
-		}
-	aSettings.SetMessageConversion(ESmsConvMail);
-	if(aSettings.MessageConversion()!=ESmsConvMail)
-		{
-		return EFalse;	
-		}
-	aSettings.SetMessageConversion(ESmsConvErmes);
-	if(aSettings.MessageConversion()!=ESmsConvErmes)
-		{
-		return EFalse;	
-		}
-	aSettings.SetMessageConversion(ESmsConvSpeech);
-	if(aSettings.MessageConversion()!=ESmsConvSpeech)
-		{
-		return EFalse;	
-		}
-	aSettings.SetMessageConversion(ESmsConvPIDNone);
-	if(aSettings.MessageConversion()!=ESmsConvPIDNone)
-		{
-		return EFalse;	
-		}
-	iTestStep.INFO_PRINTF1(_L("Test Message Conversion Passed"));
-
-	// Validity Period	
-	aSettings.SetValidityPeriod(ESmsVPHour);
-	if(aSettings.ValidityPeriod().Int()!=ESmsVPHour)
-		{
-		return EFalse;	
-		}
-	aSettings.SetValidityPeriod(ESmsVPSixHours);
-	if(aSettings.ValidityPeriod().Int()!=ESmsVPSixHours)
-		{
-		return EFalse;	
-		}
-	aSettings.SetValidityPeriod(ESmsVP24Hours);
-	if(aSettings.ValidityPeriod().Int()!=ESmsVP24Hours)
-		{
-		return EFalse;	
-		}
-	aSettings.SetValidityPeriod(ESmsVPMaximum);
-	if(aSettings.ValidityPeriod().Int()!=ESmsVPMaximum)
-		{
-		return EFalse;	
-		}
-	aSettings.SetValidityPeriod(ESmsVPWeek);
-	if(aSettings.ValidityPeriod().Int()!=ESmsVPWeek)
-		{
-		return EFalse;	
-		}
-	iTestStep.INFO_PRINTF1(_L("Test Validity Period Passed"));
-
-	// Can Concatenate (write messages with more than 160 characters)
-	aSettings.SetCanConcatenate(ETrue);
-	if(!aSettings.CanConcatenate())
-		{
-		return EFalse;	
-		}
-	aSettings.SetCanConcatenate(EFalse);
-	if(aSettings.CanConcatenate()!=EFalse)
-		{
-		return EFalse;	
-		}
-	iTestStep.INFO_PRINTF1(_L("Test Can Concatenate Passed"));
-
-	// Character Set (following character sets are supported)
-	aSettings.SetCharacterSet(TSmsDataCodingScheme::ESmsAlphabet7Bit);
-	if(aSettings.CharacterSet()!=TSmsDataCodingScheme::ESmsAlphabet7Bit)
-		{
-		return EFalse;	
-		}
-	aSettings.SetCharacterSet(TSmsDataCodingScheme::ESmsAlphabetUCS2);
-	if(aSettings.CharacterSet()!=TSmsDataCodingScheme::ESmsAlphabetUCS2)
-		{
-		return EFalse;	
-		}
-	aSettings.SetCharacterSet(TSmsDataCodingScheme::ESmsAlphabet8Bit);
-	if(aSettings.CharacterSet()!=TSmsDataCodingScheme::ESmsAlphabet8Bit)
-		{
-		return EFalse;	
-		}
-	iTestStep.INFO_PRINTF1(_L("Test Character Set Passed"));
-	
-	return ETrue;
-	}
-
-TBool CSmutTest::CompareSettings(const CSmsSettings& aLeft, const CSmsSettings& aRight, TBool aTestSC)
-	{
-	TCompare compare(CompareMessageSettings(aLeft, aRight));
-
-	compare(aLeft.CommDbAction() == aRight.CommDbAction());
-	compare(aLeft.SmsBearerAction() == aRight.SmsBearerAction());
-	compare(aLeft.SmsBearer() == aRight.SmsBearer());
-	compare(aLeft.Delivery() == aRight.Delivery());
-	compare(CompareBools(aLeft.ReplyQuoted(), aRight.ReplyQuoted()));
-	compare(aLeft.SpecialMessageHandling() == aRight.SpecialMessageHandling());
-	compare(aLeft.StatusReportHandling() == aRight.StatusReportHandling());
-
-	if (aTestSC)
-		{
-		compare(aLeft.DefaultServiceCenter() == aRight.DefaultServiceCenter());
-		compare(aLeft.ServiceCenterCount() == aRight.ServiceCenterCount());
-
-		TInt count = aLeft.ServiceCenterCount();
-
-		while (count--)
-			{
-			compare(CompareServiceCenters(aLeft.GetServiceCenter(count), aRight.GetServiceCenter(count)));
-			}
-		}		
-
-	compare(aLeft.Class2Folder() == aRight.Class2Folder());
-	compare(aLeft.DescriptionLength() == aRight.DescriptionLength());
-
-	return compare;
-	}
-
-TBool CSmutTest::CompareMessageSettings(const CSmsMessageSettings& aLeft, const CSmsMessageSettings& aRight)
-	{
-	TCompare compare(CompareBools(aLeft.CanConcatenate(), aRight.CanConcatenate()));
-	compare(aLeft.CharacterSet() == aRight.CharacterSet());
-	compare(CompareBools(aLeft.DeliveryReport(), aRight.DeliveryReport()));
-	compare(aLeft.MessageConversion() == aRight.MessageConversion());
-	compare(CompareBools(aLeft.RejectDuplicate(), aRight.RejectDuplicate()));
-	compare(CompareBools(aLeft.ReplyPath(), aRight.ReplyPath()));
-	compare(aLeft.ValidityPeriod() == aRight.ValidityPeriod());
-	compare(aLeft.ValidityPeriodFormat() == aRight.ValidityPeriodFormat());
-	return compare;
-	}
-
-void CSmutTest::TestSettingsRestoreDefectL()
-	{
-	//Test fix for defects EDNAALR-4KTKTD (CSmsSettings::RestoreL() should leave if stream not present)
-	//and EDNAALR-4KTKLP (CSmsSettings::InternalizeL() causes memory leak)
-
-	CSmsSettings* settings = CSmsSettings::NewLC();
-
-	//Test defect fix for EDNAALR-4KTKTD (CSmsSettings::RestoreL() should leave if stream not present)
-	const TMsvId id = iSmsTest.CreateDummyMessageToSendL();
-	Session().CleanupEntryPushL(id);
-	iSmsTest.SetEntryL(id);
-
-	iTestStep.INFO_PRINTF1(_L("TestSettingsRestoreDefectL Created dummy message"));
-
-	TRAPD(err, RestoreSettingsL(*settings));
-
-	iTestStep.INFO_PRINTF2(_L("TestSettingsRestoreDefectL RestoreL 1 with error %d"), err);
-	iTestStep.INFO_PRINTF2(_L("Expected %d"), KErrNotFound);
-	iSmsTest(err == KErrNotFound);
-
-	//Test defect fix for EDNAALR-4KTKLP (CSmsSettings::InternalizeL() causes memory leak)
-	//	iSmsTest.SetEntryL(id);
-	StoreSettingsL(*settings);
-
-	iTestStep.INFO_PRINTF1(_L("TestSettingsRestoreDefectL StoreL 1"));
-
-	settings->AddServiceCenterL(_L("Unknown"), _L("447785016005"));
-
-	RestoreSettingsL(*settings);
-
-	Session().CleanupEntryPop();
-	Session().RemoveEntry(id);
-
-	CleanupStack::PopAndDestroy(settings);
-	iTestStep.INFO_PRINTF1(_L("TestSettingsRestoreDefectL RestoreL 2"));
-	}
-
-
-TBool CSmutTest::TestSettingsStoreToCommDbL()
-	{
-	iTestStep.INFO_PRINTF1(_L("Test Store Settings to CommDb"));
-	
-	CSmsSettings* settings1 = CSmsSettings::NewLC();
-	CSmsSettings* settings2 = CSmsSettings::NewLC();
-
-	if(!CompareSettings(*settings1, *settings2))
-		{
-		CleanupStack::PopAndDestroy(2,settings1);
-		return EFalse;	
-		}
-
-	settings1->SetCommDbAction(CSmsSettings::EStoreToCommDb);
-	settings1->AddServiceCenterL(_L("Vodafone"), _L("+447785016005"));
-	settings1->SetDeliveryReport(ETrue);
-	settings1->SetValidityPeriod(1000);
-
-	iSmsTest.SetEntryL(iSmsTest.iSmsServiceId);
-
-	StoreSettingsL(*settings1);
-	iTestStep.INFO_PRINTF1(_L("\tNew Settings..."));
-	if(!CompareSettingsAndCommDbL(*settings1))
-		{
-		CleanupStack::PopAndDestroy(2,settings1);
-		return EFalse;	
-		}
-
-	settings1->GetServiceCenter(settings1->DefaultServiceCenter()).SetAddressL(_L("+3854354433"));
-
-	StoreSettingsL(*settings1);
-	iTestStep.INFO_PRINTF1(_L("\tSC Address Changed..."));
-	if(!CompareSettingsAndCommDbL(*settings1))
-		{
-		CleanupStack::PopAndDestroy(2,settings1);
-		return EFalse;	
-		}
-	
-	settings1->SetDeliveryReport(EFalse);
-
-	StoreSettingsL(*settings1);
-	iTestStep.INFO_PRINTF1(_L("\tDelivery Report Changed..."));
-	if(!CompareSettingsAndCommDbL(*settings1))
-		{
-		CleanupStack::PopAndDestroy(2,settings1);
-		return EFalse;	
-		}
-
-	settings1->SetValidityPeriod(2000);
-
-	StoreSettingsL(*settings1);
-	iTestStep.INFO_PRINTF1(_L("\tValidity Period Changed..."));
-	if(!CompareSettingsAndCommDbL(*settings1))
-		{
-		CleanupStack::PopAndDestroy(2,settings1);
-		return EFalse;	
-		}
-
-	settings1->GetServiceCenter(settings1->DefaultServiceCenter()).SetAddressL(_L("+48996655888"));
-	settings1->SetDeliveryReport(ETrue);
-	settings1->SetValidityPeriod(3000);
-
-	StoreSettingsL(*settings1);
-	iTestStep.INFO_PRINTF1(_L("\tAll Settings Changed..."));
-	if(!CompareSettingsAndCommDbL(*settings1))
-		{
-		CleanupStack::PopAndDestroy(2,settings1);
-		return EFalse;	
-		}
-
-	settings1->AddServiceCenterL(_L("Radio"), _L("+385669988"));
-	settings1->SetDefaultServiceCenter(settings1->ServiceCenterCount()-1);
-
-	StoreSettingsL(*settings1);
-	iTestStep.INFO_PRINTF1(_L("\tDefaultSC Changed..."));
-	if(!CompareSettingsAndCommDbL(*settings1))
-		{
-		CleanupStack::PopAndDestroy(2,settings1);
-		return EFalse;	
-		}
-
-	settings1->SetCommDbAction(CSmsSettings::ENone);
-	settings1->GetServiceCenter(settings1->DefaultServiceCenter()).SetAddressL(_L("+123456789"));
-	settings1->SetDeliveryReport(EFalse);
-	settings1->SetValidityPeriod(4000);
-
-	iTestStep.INFO_PRINTF1(_L("\tTesting Setting Different from CommDb..."));
-	if(CompareSettingsAndCommDbL(*settings1))
-		{
-		CleanupStack::PopAndDestroy(2,settings1);
-		return EFalse;	
-		}
-
-	TInt count = settings1->ServiceCenterCount();
-
-	while (count--)
-		{
-		settings1->RemoveServiceCenter(count);
-		}
-
-	iTestStep.INFO_PRINTF1(_L("\tTesting Setting Different from CommDb..."));
-	if(CompareSettingsAndCommDbL(*settings1))
-		{
-		CleanupStack::PopAndDestroy(2,settings1);
-		return EFalse;	
-		}
-
-	iTestStep.INFO_PRINTF1(_L("\tRestore settings from store..."));
-	RestoreSettingsL(*settings2);
-	if(!CompareSettingsAndCommDbL(*settings2))
-		{
-		CleanupStack::PopAndDestroy(2,settings1);
-		return EFalse;	
-		}
-
-	//Test SMS Bearer
-
-	iTestStep.INFO_PRINTF1(_L("\tTest Store SMS Bearer..."));
-
-	//Test 1
-
-	settings1->SetSmsBearerAction(CSmsSettings::EStoreToCommDb);
-	settings1->SetSmsBearer(CSmsSettings::ESmsBearerPacketOnly);
-
-	StoreSettingsL(*settings1);
-	if(!CompareSettingsAndSmsBearerL(*settings1))
-		{
-		CleanupStack::PopAndDestroy(2,settings1);
-		return EFalse;	
-		}
-	
-	//Test 2
-
-	settings1->SetSmsBearer(CSmsSettings::ESmsBearerCircuitOnly);
-	if(CompareSettingsAndSmsBearerL(*settings1))
-		{
-		CleanupStack::PopAndDestroy(2,settings1);
-		return EFalse;	
-		}
-
-	//Test 3
-
-	StoreSettingsL(*settings1);
-	if(!CompareSettingsAndSmsBearerL(*settings1))
-		{
-		CleanupStack::PopAndDestroy(2,settings1);
-		return EFalse;	
-		}
-
-	RestoreSettingsL(*settings2);
-	if(!CompareSettingsAndSmsBearerL(*settings2))
-		{
-		return EFalse;	
-		}
-
-	//Test 4
-
-	settings1->SetSmsBearerAction(CSmsSettings::ENone);
-	StoreSettingsL(*settings1);
-	if(!CompareSettingsAndSmsBearerL(*settings1))
-		{
-		CleanupStack::PopAndDestroy(2,settings1);
-		return EFalse;	
-		}
-
-	//Test 5
-
-	settings1->SetSmsBearer(CSmsSettings::ESmsBearerCircuitPreferred);
-	if(CompareSettingsAndSmsBearerL(*settings1))
-		{
-		CleanupStack::PopAndDestroy(2,settings1);
-		return EFalse;	
-		}
-	StoreSettingsL(*settings1);
-	if(CompareSettingsAndSmsBearerL(*settings1))
-		{
-		CleanupStack::PopAndDestroy(2,settings1);
-		return EFalse;	
-		}
-
-	CleanupStack::PopAndDestroy(2,settings1); // settings2
-	
-	return ETrue;
-	}
-
-TBool CSmutTest::CompareSettingsAndCommDbL(const CSmsSettings& aSettings) const
-	{
-	TCompare compare = ETrue;
-	TBuf<256> scAddress;
-	CMDBRecordSet<CCDGlobalSettingsRecord> globalSettingsRecord(KCDTIdGlobalSettingsRecord);
-	globalSettingsRecord.LoadL(*iDBSession);
-	CCDModemBearerRecord *modemBearerRecord = static_cast<CCDModemBearerRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdModemBearerRecord));
-	CleanupStack::PushL(modemBearerRecord);
-	modemBearerRecord->SetRecordId(((CCDGlobalSettingsRecord*)globalSettingsRecord.iRecords[0])->iModemForPhoneServicesAndSMS); 
-	modemBearerRecord->LoadL(*iDBSession);
-	scAddress = modemBearerRecord->iMessageCentreNumber;
-
-	if (aSettings.DefaultServiceCenter() < 0 || !aSettings.ServiceCenterCount())
-		{
-		compare(!scAddress.Length());
-		}
-	else
-		{
-		compare(scAddress == aSettings.GetServiceCenter(aSettings.DefaultServiceCenter()).Address());
-		}
-	
-	TUint32 valPeriod = 0;
-	valPeriod = modemBearerRecord->iMessageValidityPeriod;
-	compare(valPeriod == (TUint32) aSettings.ValidityPeriod().Int());
-	
-	TBool delReport = EFalse;
-	delReport = modemBearerRecord->iMessageDeliveryReport;
-	compare(delReport ? aSettings.DeliveryReport() : !aSettings.DeliveryReport());
-
-	CleanupStack::PopAndDestroy(modemBearerRecord);	
-
-	return compare;
-	}
-
-TBool CSmutTest::CompareSettingsAndSmsBearerL(const CSmsSettings& aSettings) const
-	{
-	TUint32 smsBearer=0;
-	CMDBRecordSet<CCDGlobalSettingsRecord> globalSettingsRecord(KCDTIdGlobalSettingsRecord);
-	TRAPD(err, globalSettingsRecord.LoadL(*iDBSession));
-	if(err == KErrNone)
-		{
-		smsBearer = ((CCDGlobalSettingsRecord*)globalSettingsRecord.iRecords[0])->iSMSBearer;		
-		}	
-	TCompare compare(smsBearer == (TUint32) aSettings.SmsBearer());
-	return compare;
-	}
-
-void CSmutTest::StoreNumberL(const CSmsNumber& aNumber, TUid aStreamId)
-	{
-	CMsvStore* store = iSmsTest.EditStoreL(); // lets edit the entry
-	CleanupStack::PushL(store);
-
-	RMsvWriteStream out;
-	out.AssignLC(*store, aStreamId);		// file stream id ok?
-	aNumber.ExternalizeL(out);				// lets extrenalise the instance
-	out.CommitL();
-	store->CommitL();
-
-	CleanupStack::PopAndDestroy(2, store);
-	}
-
-void CSmutTest::RestoreNumberL(CSmsNumber& rNumber, TUid aStreamId)
-	{
-	CMsvStore* store = iSmsTest.ReadStoreL(); // prepare the store for reading
-	CleanupStack::PushL(store);
-
-	RMsvReadStream in;
-	in.OpenLC(*store, aStreamId);		// lets open the store for 
-	rNumber.InternalizeL(in);				// internalising the address/name
-
-	CleanupStack::PopAndDestroy(2, store);
-	}
-
-void CSmutTest::StoreHeaderL(const CSmsHeader& aHeader)
-	{
-	CMsvStore* store = iSmsTest.EditStoreL();
-	CleanupStack::PushL(store);
-
-	aHeader.StoreL(*store);
-	store->CommitL();
-
-	CleanupStack::PopAndDestroy(store);
-	}
-
-void CSmutTest::RestoreHeaderL(CSmsHeader& aHeader)
-	{
-	CMsvStore* store = iSmsTest.ReadStoreL();
-	CleanupStack::PushL(store);
-
-	aHeader.RestoreL(*store);
-
-	CleanupStack::PopAndDestroy(store);
-	}
-
-void CSmutTest::StoreSettingsL(const CSmsSettings& aSettings)
-	{
-	CSmsAccount* account = CSmsAccount::NewLC();
-	account->SaveSettingsL(aSettings);
-	CleanupStack::PopAndDestroy(account);    
-	}
-
-void CSmutTest::RestoreSettingsL(CSmsSettings& aSettings)
-	{
-	CSmsAccount* account = CSmsAccount::NewLC();
-	account->LoadSettingsL(aSettings);
-	CleanupStack::PopAndDestroy(account);    
-	}
-
-TBool CSmutTest::CompareServiceCenters(const CSmsServiceCenter& aLeft, const CSmsServiceCenter& aRight)
-	{
-	TCompare compare(aLeft.Name() == aRight.Name());
-	compare(aLeft.Address() == aRight.Address());
-	return compare;	
-	}
-
-TBool CSmutTest::CompareNumbers(const CSmsNumber& aLeft, const CSmsNumber& aRight)
-	{
-	TCompare compare(aLeft.Name() == aRight.Name());
-	compare(aLeft.Address() == aRight.Address());
-	compare(aLeft.LogId() == aRight.LogId());
-	compare(aLeft.AckStatus(ESmsAckTypeDelivery) == aRight.AckStatus(ESmsAckTypeDelivery));	
-	return compare;
-	}
-
-TVerdict CSmutTest::TestNumberL()
-	{
-	iTestStep.INFO_PRINTF1(_L("Testing Preparing test CSmsNumber..."));
-
-	TMsvId id=iSmsTest.CreateDummyMessageToSendL();
-	Session().CleanupEntryPushL(id);
-	iSmsTest.SetEntryL(id);
-
-	CSmsNumber* number0=CSmsNumber::NewL();  
-	CleanupStack::PushL(number0);
-
-	CSmsNumber* number=CSmsNumber::NewL();  // create the instance
-	CleanupStack::PushL(number);
-
-	// Testing the features of CSmsNumber
-	// The max length for a name is 256 characters
-	// The max length for a number is 20 characters
-
-// Lets take an ordinary number, test it, then store and restore it
-// and see if the values are still ok.
-
-	number->SetNameL(_L("Radiolinja1"));	
-	number->SetAddressL(_L("+358508771010")); 
-	number->SetLogId(KLogID1);	
-	number->SetAckStatus(ESmsAckTypeDelivery, CSmsNumber::EAckSuccessful);
-
-	if(number->Name()!=_L("Radiolinja1")) // name ok?
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	if(number->Address()!=_L("+358508771010")) // number ok?
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	if(number->LogId() != KLogID1)
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	if(number->AckStatus(ESmsAckTypeDelivery) != CSmsNumber::EAckSuccessful)
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-
-	StoreNumberL(*number);
-	RestoreNumberL(*number0);
-	if(!CompareNumbers(*number0, *number))
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;
-		}
-	
-// Lets try the max length of the telephone address, store and
-// restore it and see if it works
-
-	number->SetNameL(_L("Whatsthemaximumlengthforthis?Whatsthemaximumlengthforthis?Whatsthemaximumlengthforthis?"));
-	number->SetAddressL(_L("+0123456789012345678"));
-	number->SetLogId(KLogID2);	
-	number->SetAckStatus(ESmsAckTypeDelivery, CSmsNumber::EAckError);
-
-	if(number->Name()!=_L("Whatsthemaximumlengthforthis?Whatsthemaximumlengthforthis?Whatsthemaximumlengthforthis?"))
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	if(number->Address()!=_L("+0123456789012345678"))
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	if(number->LogId() != KLogID2)
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	if(number->AckStatus(ESmsAckTypeDelivery) != CSmsNumber::EAckError)
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-
-	StoreNumberL(*number);
-	RestoreNumberL(*number0);
-	if(!CompareNumbers(*number, *number0))
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-// Lets use special Scandinavian letters both in the name and
-// address, store and restore and see if they are ok
-	number->SetNameL(_L("ÖÄÅåöä"));
-	number->SetAddressL(_L("åäöÅÄÖ"));
-	number->SetLogId(KLogID1);	
-	number->SetAckStatus(ESmsAckTypeDelivery, CSmsNumber::EAckSuccessful);
-
-	if(number->Name()!=_L("ÖÄÅåöä"))
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	if(number->Address()!=_L("åäöÅÄÖ"))
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	if(number->LogId() != KLogID1)
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;
-		}
-	if(number->AckStatus(ESmsAckTypeDelivery) != CSmsNumber::EAckSuccessful)
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-
-	StoreNumberL(*number);
-	RestoreNumberL(*number0);
-	iSmsTest(CompareNumbers(*number, *number0));
-
-//  Lets try if both the number and the name can be empty,
-//	store and restore it and see if they still match
-	number->SetNameL(_L(""));
-	number->SetAddressL(_L(""));
-	number->SetLogId(KLogID2);	
-	number->SetAckStatus(ESmsAckTypeDelivery, CSmsNumber::EAckError);
-
-	if(number->Name()!=_L(""))
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;
-		}
-	if(number->Address()!=_L(""))
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	if(number->LogId() != KLogID2)
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	if(number->AckStatus(ESmsAckTypeDelivery) != CSmsNumber::EAckError)
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;
-		}
-
-	StoreNumberL(*number);
-	RestoreNumberL(*number0);
-	if(!CompareNumbers(*number, *number0))
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-
-//  Lets try [alt+255] as both the name and number, store and	
-//  restore it and see if it works
-	number->SetNameL(_L(" ")); //alt+255
-	number->SetAddressL(_L(" "));
-	number->SetLogId(KLogID1);	
-	number->SetAckStatus(ESmsAckTypeDelivery, CSmsNumber::EAckSuccessful);
-
-	if(number->Name()!=_L(" "))
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;		
-		}
-	if(number->Address()!=_L(" "))
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;		
-		}
-	if(number->LogId() != KLogID1)
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;		
-		}
-	if(number->AckStatus(ESmsAckTypeDelivery) != CSmsNumber::EAckSuccessful)
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;		
-		}
-
-	StoreNumberL(*number);
-	RestoreNumberL(*number0);
-	iSmsTest(CompareNumbers(*number, *number0));
-
-// Test CSmsNumber::CopyL()
-
-	number->SetNameL(_L("DavidCuando"));	
-	number->SetAddressL(_L("+447747065627")); 
-	number->SetLogId(KLogID3);	
-	number->SetAckStatus(ESmsAckTypeDelivery, CSmsNumber::EPendingAck);
-
-	if(number->Name()!=_L("DavidCuando"))
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	if(number->Address()!=_L("+447747065627"))
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;
-		}
-	if(number->LogId() != KLogID3)
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;
-		}
-	if(number->AckStatus(ESmsAckTypeDelivery) != CSmsNumber::EPendingAck)
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;
-		}
-
-	number0->CopyL(*number);
-	if(!CompareNumbers(*number0, *number))
-		{
-		CleanupStack::PopAndDestroy(2, number0);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;
-		}
-
-	CleanupStack::PopAndDestroy(2, number0);
-
-// Test NewL(CSmsNumber&)
-
-	number=CSmsNumber::NewL();  // create the instance
-	CleanupStack::PushL(number);
-
-	number->SetNameL(_L("DavidCuando"));	
-	number->SetAddressL(_L("+447747065627")); 
-	number->SetLogId(KLogID3);	
-	number->SetAckStatus(ESmsAckTypeDelivery, CSmsNumber::EPendingAck);
-
-	if(number->Name()!=_L("DavidCuando"))
-		{
-		CleanupStack::PopAndDestroy(number);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;		
-		}
-	if(number->Address()!=_L("+447747065627"))
-		{
-		CleanupStack::PopAndDestroy(number);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);		
-		return EFail;
-		}
-	if(number->LogId() != KLogID3)
-		{
-		CleanupStack::PopAndDestroy(number);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);		
-		return EFail;
-		}
-	if(number->AckStatus(ESmsAckTypeDelivery) != CSmsNumber::EPendingAck)
-		{
-		CleanupStack::PopAndDestroy(number);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);		
-		return EFail;
-		}
-
-	number0=CSmsNumber::NewL(*number);  
-	CleanupStack::PushL(number0);
-
-	if(!CompareNumbers(*number0, *number))
-		{
-		CleanupStack::PopAndDestroy(2, number);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;		
-		}
-	CleanupStack::PopAndDestroy(2, number);
-
-	//Test for defect EDNMOHN-4LDDK8
-	number=CSmsNumber::NewL();  // create the instance
-	CleanupStack::PushL(number);
-
-	StoreNumberL(*number);
-	RestoreNumberL(*number);
-
-	number->SetAddressL(_L("+4477676545"));
-	//End Test for defect  EDNMOHN-4LDDK8
-
-	CleanupStack::PopAndDestroy(number);
-
-	Session().CleanupEntryPop();
-	Session().RemoveEntry(id);
-	
-	iTestStep.INFO_PRINTF1(_L("Test CSmsNumber Passed."));
-	return EPass;
-	}
-	
-void CSmutTest::StoreEmailFieldsL(const CSmsEmailFields& aEmailFields)
-	{
-	CMsvStore* store = iSmsTest.EditStoreL(); 
-	CleanupStack::PushL(store);
-
-	aEmailFields.StoreL(*store);
-	store->CommitL();
-
-	CleanupStack::PopAndDestroy(store);
-	}
-
-void CSmutTest::RestoreEmailFieldsL(CSmsEmailFields& aEmailFields)
-	{
-	CMsvStore* store = iSmsTest.ReadStoreL(); // prepare the store for reading
-	CleanupStack::PushL(store);
-	
-	aEmailFields.RestoreL(*store);
-
-	CleanupStack::PopAndDestroy(store);
-	}
-	
-TBool CSmutTest::CompareEmailFields(const CSmsEmailFields& aFields1, const CSmsEmailFields& aFields2)
-	{
-	TBool same = CompareEmailFieldsAddresses(aFields1.Addresses(), aFields2.Addresses());
-	if( same )
-		same = (aFields2.Subject().Compare(aFields1.Subject()) == 0);
-	if( same )
-		same = (!aFields2.HasAddress()&&!aFields1.HasAddress() || aFields2.HasAddress()&&aFields1.HasAddress());
-	if( same )
-		same = (aFields2.Length() == aFields1.Length());
-	return same;
-	}
-	
-TBool CSmutTest::CompareEmailFieldsAddresses(const MDesCArray& aAddresses1, const MDesCArray& aAddresses2)
-	{
-	TBool same = (aAddresses1.MdcaCount() == aAddresses2.MdcaCount());
-	if( same )
-		{
-		TInt count = aAddresses1.MdcaCount();
-		while( same && count-- > 0)
-			{
-			same = (aAddresses2.MdcaPoint(count).Compare(aAddresses1.MdcaPoint(count)) == 0);
-			}
-		}		
-	return same;
-	}
-	
-TVerdict CSmutTest::TestEmailFieldsL()
-	{
-	iTestStep.INFO_PRINTF1(_L("Preparing test CSmsEmailFields..."));
-
-	TMsvId id=iSmsTest.CreateDummyMessageToSendL();
-	Session().CleanupEntryPushL(id);
-	iSmsTest.SetEntryL(id);
-
-	_LIT(KTestAddress, "support@symbian.com");
-	_LIT(KTestSubject, "Happy Days!");
-	
-	// Test CSmsEmailFields::NewL()
-	CSmsEmailFields* fields1 = CSmsEmailFields::NewL();
-	CleanupStack::PushL(fields1);
-	
-	if(fields1->Addresses().MdcaCount()!=0)
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;
-		}
-	if(fields1->Subject().Compare(KNullDesC()) != 0)
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	if(fields1->HasAddress())
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	if(fields1->Length() != 0)
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	
-	// Test address and subject accessors, has-address, length and reset methods
-	fields1->AddAddressL(KNullDesC);	// empty address - does nothing!
-	if(fields1->Addresses().MdcaCount()!=0)
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;		
-		}
-	if(fields1->Subject().Compare(KNullDesC()) != 0)
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;		
-		}
-	if(fields1->HasAddress())
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;		
-		}
-	if(fields1->Length() != 0)
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;		
-		}
-	
-	fields1->AddAddressL(KTestAddress);
-	if(fields1->Addresses().MdcaCount()!=1)
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	if(fields1->Addresses().MdcaPoint(0).Compare(KTestAddress) != 0)
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	if(!fields1->HasAddress())
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	if(fields1->Length() != KTestAddress().Length() + 1)
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-
-	fields1->SetSubjectL(KTestSubject);
-	if(!fields1->HasAddress())
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	if(fields1->Length() != KTestAddress().Length() + KTestSubject().Length() + 2)
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	
-	fields1->Reset();
-	if(fields1->Addresses().MdcaCount()!=0)
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	if(fields1->Subject().Compare(KNullDesC()) != 0)
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	if(fields1->HasAddress())
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	if(fields1->Length() != 0)
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	
-	fields1->SetSubjectL(KTestSubject);
-	if(fields1->Subject().Compare(KTestSubject) != 0)
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	if(fields1->HasAddress())
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	if(fields1->Length() != KTestSubject().Length() + 2)
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	
-	fields1->AddAddressL(KTestAddress);
-	if(fields1->Addresses().MdcaCount()!=1)
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;		
-		}
-	if(fields1->Addresses().MdcaPoint(0).Compare(KTestAddress) != 0)
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;		
-		}
-	if(!fields1->HasAddress())
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;		
-		}
-	if(fields1->Length() != KTestAddress().Length() + KTestSubject().Length() + 2)
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;		
-		}
-
-	// Test multiple addresses - add empty address -> not added	
-	fields1->AddAddressL(KNullDesC);
-	if(fields1->Addresses().MdcaCount()!=1)
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;		
-		}
-	
-	_LIT(KTestAddress2, "support2@symbian.com");
-	fields1->AddAddressL(KTestAddress2);
-	if(fields1->Addresses().MdcaCount()!=2)
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;		
-		}
-	if(fields1->Addresses().MdcaPoint(1).Compare(KTestAddress2) != 0)
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;		
-		}
-	if(!fields1->HasAddress())
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;		
-		}
-	// NOTE - length check; 3 -> 2 for subject delimiters, 1 for address comma separtor.
-	if(fields1->Length() != KTestAddress().Length() + KTestAddress2().Length() + KTestSubject().Length() + 3)
-		{
-		CleanupStack::PopAndDestroy(fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;		
-		}
-	
-	// Test copy factory c'tor
-	CSmsEmailFields* fields2 = CSmsEmailFields::NewL(*fields1);
-	CleanupStack::PushL(fields2);
-
-	if(!CompareEmailFields(*fields2, *fields1))
-		{
-		CleanupStack::PopAndDestroy(2,fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	
-	// Test store and restore
-	StoreEmailFieldsL(*fields1);
-	fields2->Reset();
-	RestoreEmailFieldsL(*fields2);
-
-	if(!CompareEmailFields(*fields2, *fields1))
-		{
-		CleanupStack::PopAndDestroy(2,fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	
-	fields1->Reset();
-	StoreEmailFieldsL(*fields1);
-	RestoreEmailFieldsL(*fields2);
-
-	if(!CompareEmailFields(*fields2, *fields1))
-		{
-		CleanupStack::PopAndDestroy(2,fields1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	
-	CleanupStack::PopAndDestroy(2, fields1);
-	
-	// Test parsing - expected data.
-	_LIT(KTestBodyData, "Some body text#( )#");
-
-	_LIT(KTestParseAddress1, "user1@symbian.com");
-	_LIT(KTestParseSubject1, "");
-	_LIT(KTestEmail1, "user1@symbian.com Some body text#( )#");
-	if(!TestEmailFieldsParsePassL(KTestEmail1, KTestParseAddress1, KTestParseSubject1, KTestBodyData))
-		{
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-
-	_LIT(KTestParseFullAddress1, "Some User <user1@symbian.com>");
-	_LIT(KTestEmail2, "Some User <user1@symbian.com> Some body text#( )#");
-	if(!TestEmailFieldsParsePassL(KTestEmail2, KTestParseFullAddress1, KTestParseSubject1, KTestBodyData))
-		{
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-
-	_LIT(KTestParseAddress2, "user2@symbian.com");
-	_LIT(KTestParseSubject2, "subject (2)");
-	_LIT(KTestEmail3, "user2@symbian.com##subject (2)#Some body text#( )#");
-	if(!TestEmailFieldsParsePassL(KTestEmail3, KTestParseAddress2, KTestParseSubject2, KTestBodyData))
-		{
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-
-	_LIT(KTestParseFullAddress2, "Some User <user2@symbian.com>");
-	_LIT(KTestEmail4, "Some User <user2@symbian.com>##subject (2)#Some body text#( )#");
-	if(!TestEmailFieldsParsePassL(KTestEmail4, KTestParseFullAddress2, KTestParseSubject2, KTestBodyData))
-		{
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;
-		}
-
-	_LIT(KTestParseAddress3, "user3@symbian.com");
-	_LIT(KTestParseSubject3, "subject #3");
-	_LIT(KTestEmail5, "user3@symbian.com(subject #3)Some body text#( )#");
-	if(!TestEmailFieldsParsePassL(KTestEmail5, KTestParseAddress3, KTestParseSubject3, KTestBodyData))
-		{
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-
-	_LIT(KTestParseFullAddress3, "Some User <user3@symbian.com>");
-	_LIT(KTestEmail6, "Some User <user3@symbian.com>(subject #3)Some body text#( )#");
-	if(!TestEmailFieldsParsePassL(KTestEmail6, KTestParseFullAddress3, KTestParseSubject3, KTestBodyData))
-		{
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;
-		}
-	
-	_LIT(KTestParseAddress4, "user4@symbian.com");
-	_LIT(KTestParseSubject4, "");
-	_LIT(KTestEmail7, "user4@symbian.com()Some body text#( )#");
-	if(!TestEmailFieldsParsePassL(KTestEmail7, KTestParseAddress4, KTestParseSubject4, KTestBodyData))
-		{
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;
-		}
-
-	_LIT(KTestParseFullAddress4, "Some User <user4@symbian.com>");
-	_LIT(KTestEmail8, "Some User <user4@symbian.com>()Some body text#( )#");
-	if(!TestEmailFieldsParsePassL(KTestEmail8, KTestParseFullAddress4, KTestParseSubject4, KTestBodyData))
-		{
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-
-	_LIT(KTestParseAddress5, "user5@symbian.com");
-	_LIT(KTestParseSubject5, "");
-	_LIT(KTestEmail9, "user5@symbian.com###Some body text#( )#");
-	if(!TestEmailFieldsParsePassL(KTestEmail9, KTestParseAddress5, KTestParseSubject5, KTestBodyData))
-		{
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-
-	_LIT(KTestParseFullAddress5, "Some User <user5@symbian.com>");
-	_LIT(KTestEmail10, "Some User <user5@symbian.com>###Some body text#( )#");
-	if(!TestEmailFieldsParsePassL(KTestEmail10, KTestParseFullAddress5, KTestParseSubject5, KTestBodyData))
-		{
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-
-	// Test parsing - corrupt but parse-able data.
-	_LIT(KTestCorruptAddress1,	"user1@symbian.com");
-	_LIT(KTestCorruptSubject1,	"smiley ;");
-	_LIT(KTestCorruptBody1,		" subject)Some body text");
-	_LIT(KTestCorruptEmail1,	"user1@symbian.com(smiley ;) subject)Some body text");
-	if(!TestEmailFieldsParsePassL(KTestCorruptEmail1, KTestCorruptAddress1, KTestCorruptSubject1, KTestCorruptBody1))
-		{
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	
-	_LIT(KTestCorruptAddress2,	"user1@symbian.com");
-	_LIT(KTestCorruptSubject2,	"");
-	_LIT(KTestCorruptBody2,		"(bad subject)Some body text");
-	_LIT(KTestCorruptEmail2,	"user1@symbian.com (bad subject)Some body text");
-	if(!TestEmailFieldsParsePassL(KTestCorruptEmail2, KTestCorruptAddress2, KTestCorruptSubject2, KTestCorruptBody2))
-		{
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-
-	_LIT(KTestCorruptAddress3,	"user1@symbian.com");
-	_LIT(KTestCorruptSubject3,	"");
-	_LIT(KTestCorruptBody3,		"bad subject##Some body text");
-	_LIT(KTestCorruptEmail3,	"user1@symbian.com###bad subject##Some body text");
-	if(!TestEmailFieldsParsePassL(KTestCorruptEmail3, KTestCorruptAddress3, KTestCorruptSubject3, KTestCorruptBody3))
-		{
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	
-	// Test parsing - corrupt and fail.
-	_LIT(KTestFailEmail1,	"user#domain1.domain2 Some body text");
-	if(!TestEmailFieldsParseFailL(KTestFailEmail1))
-		{
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	
-	_LIT(KTestFailEmail2,	"user@domain1.domain2+Some+body+text");
-	if(!TestEmailFieldsParseFailL(KTestFailEmail2))
-		{
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-
-	_LIT(KTestFailEmail3,	"user@domain1.domain2##(subject)Some+body+text");
-	if(!TestEmailFieldsParseFailL(KTestFailEmail3))
-		{
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;
-		}
-
-	_LIT(KTestFailEmail4,	"user@domain1.domain2(##subject#Some+body+text");
-	if(!TestEmailFieldsParseFailL(KTestFailEmail4))
-		{
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-
-	_LIT(KTestFailEmail5,	"user1@symbian.com#bad subject#Some body text");
-	if(!TestEmailFieldsParseFailL(KTestFailEmail5))
-		{
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	
-	// Test composing - ok
-	_LIT(KTestComposeAddress1,	"user1@domain1.domain2");
-	_LIT(KTestComposeSubject1,	"");
-	_LIT(KTestComposeFields1,	"user1@domain1.domain2 ");
-	if(!TestEmailFieldsComposeL(KTestComposeFields1, KTestComposeAddress1, KNullDesC, KTestComposeSubject1))
-		{
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	
-	_LIT(KTestComposeAddress2,	"user2@domain1.domain2");
-	_LIT(KTestComposeSubject2,	"a subject");
-	_LIT(KTestComposeFields2,	"user2@domain1.domain2(a subject)");
-	if(!TestEmailFieldsComposeL(KTestComposeFields2, KTestComposeAddress2, KNullDesC, KTestComposeSubject2))
-		{
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-
-	_LIT(KTestComposeFields3,	"user1@domain1.domain2,user2@domain1.domain2 ");
-	if(!TestEmailFieldsComposeL(KTestComposeFields3, KTestComposeAddress1, KTestComposeAddress2, KTestComposeSubject1))
-		{
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	
-	_LIT(KTestComposeFields4,	"user2@domain1.domain2,user1@domain1.domain2(a subject)");
-	if(!TestEmailFieldsComposeL(KTestComposeFields4, KTestComposeAddress2, KTestComposeAddress1, KTestComposeSubject2))
-		{
-			Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-
-	// Testing composing - fail, no address.
-	CSmsEmailFields* fields3 = CSmsEmailFields::NewL();
-	CleanupStack::PushL(fields3);
-	
-	fields3->AddAddressL(KNullDesC);
-	fields3->SetSubjectL(KTestSubject);
-
-	fields3->ComposeLC();
-	
-	iSmsTest(err==KErrCorrupt);
-	
-	CleanupStack::PopAndDestroy(fields3);
-
-	Session().CleanupEntryPop();
-	Session().RemoveEntry(id);
-	
-	iTestStep.INFO_PRINTF1(_L("Test EmailFields Passed"));
-	return EPass;
-	}
-	
-TBool CSmutTest::TestEmailFieldsParsePassL(const TDesC& aMessage, const TDesC& aAddress, const TDesC& aSubject, const TDesC& aBody)
-	{
-	CSmsEmailFields* fields = CSmsEmailFields::NewL();
-	CleanupStack::PushL(fields);
-	
-	TInt pos = fields->ParseL(aMessage);
-	
-	TPtrC body(aMessage.Mid(pos));
-	if(!fields->HasAddress())
-		{
-		CleanupStack::PopAndDestroy(fields);
-		return EFalse;	
-		}
-	if(fields->Addresses().MdcaCount()!=1)
-		{
-		CleanupStack::PopAndDestroy(fields);
-		return EFalse;	
-		}
-	if(fields->Addresses().MdcaPoint(0).Compare(aAddress) != 0)
-		{
-		CleanupStack::PopAndDestroy(fields);
-		return EFalse;	
-		}
-	if(fields->Subject().Compare(aSubject) != 0)
-		{
-		CleanupStack::PopAndDestroy(fields);
-		return EFalse;	
-		}
-	if(body.Compare(aBody) != 0)
-		{
-		CleanupStack::PopAndDestroy(fields);
-		return EFalse;	
-		}
-	
-	CleanupStack::PopAndDestroy(fields);
-	return ETrue;
-	}
-
-TBool CSmutTest::TestEmailFieldsParseFailL(const TDesC& aMessage)
-	{
-	CSmsEmailFields* fields = CSmsEmailFields::NewL();
-	CleanupStack::PushL(fields);
-	
-	TInt pos = fields->ParseL(aMessage);
-	
-	CleanupStack::PopAndDestroy(fields);	
-	
-	return (pos == KErrCorrupt);
-	}
-
-TBool CSmutTest::TestEmailFieldsComposeL(const TDesC& aFields, const TDesC& aAddress1, const TDesC& aAddress2, const TDesC& aSubject)
-	{
-	CSmsEmailFields* fields = CSmsEmailFields::NewL();
-	CleanupStack::PushL(fields);
-	
-	fields->AddAddressL(aAddress1);
-	fields->AddAddressL(aAddress2);
-	fields->SetSubjectL(aSubject);
-	HBufC* buffer = fields->ComposeLC();	
-	
-	TBool result = aFields.Compare(*buffer) == 0;
-	CleanupStack::PopAndDestroy(2, fields);	// fields, buffer
-		
-	return result;
-	}
-
-TVerdict CSmutTest::TestHeaderL()
-	{
-
-	// Testing class CSmsHeader
-	iTestStep.INFO_PRINTF1(_L("Testing CSmsHeader..."));
-	
-	// A CSmsHeader can be of 6 different types
-	// First we test constructing ESmsDeliver
-	delete iSmsHeader; // deleting the previous one
-	iSmsHeader = NULL;
-	iSmsHeader=CSmsHeader::NewL(CSmsPDU::ESmsDeliver,*iRichText); // constructing
-	if(iSmsHeader->Type()!=CSmsPDU::ESmsDeliver)	// type ok?
-		{
-		return EFail;	
-		}
-
-	CSmsDeliver& deliver = iSmsHeader->Deliver();  // lets get the CSmsPDU of the CSmsHeader
-	const CSmsDeliver& deliver2 = iSmsHeader->Deliver();
-
-	if(deliver.Type() != CSmsPDU::ESmsDeliver)// Are the types ok?
-		{
-		return EFail;	
-		}
-	if(deliver2.Type() != CSmsPDU::ESmsDeliver)
-		{
-		return EFail;	
-		}
-
-		
-	// Lets access the CSmsMessage of our header
-	CSmsMessage& message=iSmsHeader->Message();
-	//Get the operations
-	CSmsReplyAddressOperations& operations = STATIC_CAST(CSmsReplyAddressOperations&,message.GetOperationsForIEL(CSmsInformationElement::ESmsReplyAddressFormat));		
-	//Add address
-	TPtrC replyAddress(_L("+447583927594"));
-	operations.AddReplyAddressL(replyAddress);
-	
-	//get the address back
-	if(iSmsHeader->ReplyAddressL()!=_L("+447583927594"))
-		{
-		return EFail;		
-		}
-		
-	// Add a from address and make sure that the reply address is still used instead
-	iSmsHeader->SetFromAddressL(_L("+358503367709"));
-	//get the address back
-	if(iSmsHeader->ReplyAddressL()!=_L("+447583927594"))
-		{
-		return EFail;		
-		}
-		
-	// Type ESmsCommand
-	delete iSmsHeader; // deleting previous
-	iSmsHeader = NULL;
-	iSmsHeader=CSmsHeader::NewL(CSmsPDU::ESmsCommand,*iRichText);
-	if(iSmsHeader->Type()!=CSmsPDU::ESmsCommand)
-		{
-		return EFail;	
-		}
-
-	CSmsCommand& command=iSmsHeader->Command();
-	const CSmsCommand& command2=iSmsHeader->Command();
-
-	if(command.Type() != CSmsPDU::ESmsCommand)
-		{
-		return EFail;	
-		}
-	if(command2.Type() != CSmsPDU::ESmsCommand)
-		{
-		return EFail;	
-		}
-
-	// Type ESmsStatusReport
-	delete iSmsHeader; // deleting the previous one
-	iSmsHeader = NULL;
-	iSmsHeader=CSmsHeader::NewL(CSmsPDU::ESmsStatusReport,*iRichText);
-	if(iSmsHeader->Type()!=CSmsPDU::ESmsStatusReport)
-		{
-		return EFail;	
-		}
-
-	CSmsStatusReport& statusreport=iSmsHeader->StatusReport();
-	const CSmsStatusReport& statusreport2=iSmsHeader->StatusReport();
-
-	if(statusreport.Type() != CSmsPDU::ESmsStatusReport)
-		{
-		return EFail;	
-		}
-	if(statusreport2.Type() != CSmsPDU::ESmsStatusReport)
-		{
-		return EFail;	
-		}
-
-	// Type ESmsSubmit
-	delete iSmsHeader; // deleting the previous one
-	iSmsHeader = NULL;
-	iSmsHeader=CSmsHeader::NewL(CSmsPDU::ESmsSubmit,*iRichText);
-	if(iSmsHeader->Type()!=CSmsPDU::ESmsSubmit)
-		{
-		return EFail;	
-		}
-
-	CSmsSubmit& submit=iSmsHeader->Submit();
-	const CSmsSubmit& submit2=iSmsHeader->Submit();
-
-	if(submit.Type() != CSmsPDU::ESmsSubmit)
-		{
-		return EFail;	
-		}
-	if(submit2.Type() != CSmsPDU::ESmsSubmit)
-		{
-		return EFail;	
-		}
-
-	// Lets access the CSmsMessage of our header
-	CSmsMessage& message1=iSmsHeader->Message();
-	const CSmsMessage& message2=iSmsHeader->Message();
-
-	if(message1.Type() != CSmsPDU::ESmsSubmit)
-		{
-		return EFail;		
-		}
-	if(message2.Type() != CSmsPDU::ESmsSubmit)
-		{
-		return EFail;		
-		}
-
-	// Lets test the features of CSmsHeader with different values
-	iSmsHeader->SetReplyPathProvided(ETrue);
-	if(!iSmsHeader->ReplyPathProvided())
-		{
-		return EFail;		
-		}
-	iSmsHeader->SetReplyPathProvided(EFalse);
-	if(iSmsHeader->ReplyPathProvided())
-		{
-		return EFail;		
-		}
-
-	iSmsHeader->SetBioMsgIdType(EBioMsgIdUnknown);
-	if(iSmsHeader->BioMsgIdType()!=EBioMsgIdUnknown)
-		{
-		return EFail;		
-		}
-	iSmsHeader->SetBioMsgIdType(EBioMsgIdIana);
-	if(iSmsHeader->BioMsgIdType()!=EBioMsgIdIana)
-		{
-		return EFail;		
-		}
-	iSmsHeader->SetBioMsgIdType(EBioMsgIdNbs);
-	if(iSmsHeader->BioMsgIdType()!=EBioMsgIdNbs)
-		{
-		return EFail;		
-		}
-	iSmsHeader->SetBioMsgIdType(EBioMsgIdWap);
-	if(iSmsHeader->BioMsgIdType()!=EBioMsgIdWap)
-		{
-		return EFail;		
-		}
-	iSmsHeader->SetBioMsgIdType(EBioMsgIdWapSecure);
-	if(iSmsHeader->BioMsgIdType()!=EBioMsgIdWapSecure)
-		{
-		return EFail;		
-		}
-
-	// Lets set the service center number
-	iSmsHeader->SetServiceCenterAddressL(_L("+350508771010"));
-	if(iSmsHeader->ServiceCenterAddress()!=_L("+350508771010"))
-		{
-		return EFail;		
-		}
-
-	// Lets set one recipient for the message
-	CArrayPtrFlat<CSmsNumber>& recipients = iSmsHeader->Recipients();
-	CSmsNumber* number=CSmsNumber::NewL();
-	CleanupStack::PushL(number);
-	number->SetAddressL(_L("+358503367709"));
-	recipients.AppendL(number);
-	CleanupStack::Pop();
-
-	// Setting settings of the message
-	CSmsSettings* smsset = CSmsSettings::NewL();
-	CleanupStack::PushL(smsset);
-	smsset->AddServiceCenterL(_L("Hippo"), _L("+358508771010"));
-	smsset->SetCharacterSet(TSmsDataCodingScheme::ESmsAlphabet7Bit);
-	smsset->SetDelivery(ESmsDeliveryImmediately);
-	smsset->SetDeliveryReport(EFalse);
-	smsset->SetMessageConversion(ESmsConvPIDNone);
-	smsset->SetRejectDuplicate(ETrue);
-	smsset->SetReplyPath(EFalse);
-	smsset->SetValidityPeriod(ESmsVP24Hours);
-	smsset->SetValidityPeriodFormat(TSmsFirstOctet::ESmsVPFSemiOctet);
-	// And copying them to the CSmsHeader
-	iSmsHeader->SetSmsSettingsL(*smsset);
-	CleanupStack::PopAndDestroy(smsset);
-
-	CSmsSettings* smsset2 = CSmsSettings::NewL();
-	CleanupStack::PushL(smsset2);
-	// Lets get the same setting from the CSmsHeader
-	iSmsHeader->GetSmsSettingsL(*smsset2);
-	// And compare that they are ok!
-	if(smsset2->CharacterSet()!=TSmsDataCodingScheme::ESmsAlphabet7Bit)
-		{
-		CleanupStack::PopAndDestroy(smsset2);
-		return EFail;	
-		}
-	if(smsset2->DeliveryReport())
-		{
-		CleanupStack::PopAndDestroy(smsset2);
-		return EFail;	
-		}
-	if(smsset2->MessageConversion()!=ESmsConvPIDNone)
-		{
-		CleanupStack::PopAndDestroy(smsset2);
-		return EFail;	
-		}
-	if(!smsset2->RejectDuplicate())
-		{
-		CleanupStack::PopAndDestroy(smsset2);
-		return EFail;	
-		}
-	if(smsset2->ReplyPath())
-		{
-		CleanupStack::PopAndDestroy(smsset2);
-		return EFail;	
-		}
-	if(smsset2->ValidityPeriod().Int()!=ESmsVP24Hours)
-		{
-		CleanupStack::PopAndDestroy(smsset2);
-		return EFail;	
-		}
-	if(smsset2->ValidityPeriodFormat()!=TSmsFirstOctet::ESmsVPFSemiOctet)
-		{
-		CleanupStack::PopAndDestroy(smsset2);
-		return EFail;	
-		}
-	CleanupStack::PopAndDestroy(smsset2);
-
-	//Test Set/FromAddress()
-	iSmsHeader->SetFromAddressL(_L("+358503367709"));
-	if(iSmsHeader->ReplyAddressL()!=_L("+358503367709"))
-		{
-		return EFail;		
-		}
-	
-	//Test Set/EmailFields()
-	_LIT(KTestAddress, "user@domain1.domain2");
-	_LIT(KTestSubject, "a subject");
-
-	CSmsEmailFields* fields1 = CSmsEmailFields::NewL();
-	CleanupStack::PushL(fields1);
-	
-	fields1->AddAddressL(KTestAddress);
-	fields1->SetSubjectL(KTestSubject);
-
-	// Test the PID field value - should be ESmsConvPIDNone...
-	CSmsSettings* smsset3 = CSmsSettings::NewL();
-	CleanupStack::PushL(smsset3);
-
-	iSmsHeader->GetSmsSettingsL(*smsset3);
-	if(smsset3->MessageConversion()!=ESmsConvPIDNone)
-		{
-		CleanupStack::PopAndDestroy(2,smsset3);
-		return EFail;	
-		}
-
-	// Set the email fields - check the email fields and the PID value (should 
-	// be ESmsConvMail).
-	iSmsHeader->SetEmailFieldsL(*fields1);
-	const CSmsEmailFields& fields2 = iSmsHeader->EmailFields();
-	iSmsHeader->GetSmsSettingsL(*smsset3);
-	
-	if(!CompareEmailFields(*fields1, fields2))
-		{
-		CleanupStack::PopAndDestroy(2,smsset3);
-		return EFail;	
-		}
-	if(smsset3->MessageConversion()!=ESmsConvMail)
-		{
-		CleanupStack::PopAndDestroy(2,smsset3);
-		return EFail;		
-		}
-	
-	// Reset the fields and then set back in the header - should reset the PID
-	// value to ESmsConvPIDNone
-	fields1->Reset();
-	iSmsHeader->SetEmailFieldsL(*fields1);
-	
-	const CSmsEmailFields& fields3 = iSmsHeader->EmailFields();
-	iSmsHeader->GetSmsSettingsL(*smsset3);
-	
-	if(!CompareEmailFields(*fields1, fields3))
-		{
-		CleanupStack::PopAndDestroy(2,smsset3);
-		return EFail;	
-		}
-	if(smsset3->MessageConversion()!=ESmsConvPIDNone)
-		{
-		CleanupStack::PopAndDestroy(2,smsset3);
-		return EFail;	
-		}
-	
-	// Set the reply email fields - check email fields (both address and subject)
-	// and the PID value (should be ESmsConvMail)
-	_LIT(KEmailReplySubjectFormat,	"Re: %S");
-	_LIT(KEmailReplySubject,		"Re: a subject");
-
-	// First test with no subject...
-	fields1->AddAddressL(KTestAddress);
-	
-	iSmsHeader->SetReplyEmailFieldsL(*fields1, KEmailReplySubjectFormat);
-	const CSmsEmailFields& replyFields1 = iSmsHeader->EmailFields();
-	iSmsHeader->GetSmsSettingsL(*smsset3);
-	
-	if(!CompareEmailFieldsAddresses(replyFields1.Addresses(), fields1->Addresses()))
-		{
-		CleanupStack::PopAndDestroy(2,smsset3);
-		return EFail;	
-		}
-	if(replyFields1.Subject().Compare(KNullDesC) != 0)
-		{
-		CleanupStack::PopAndDestroy(2,smsset3);
-		return EFail;	
-		}
-	if(smsset3->MessageConversion()!=ESmsConvMail)
-		{
-		CleanupStack::PopAndDestroy(2,smsset3);
-		return EFail;	
-		}
-	
-	// Now set the subject...
-	fields1->SetSubjectL(KTestSubject);
-
-	iSmsHeader->SetReplyEmailFieldsL(*fields1, KEmailReplySubjectFormat);
-	const CSmsEmailFields& replyFields2 = iSmsHeader->EmailFields();
-	iSmsHeader->GetSmsSettingsL(*smsset3);
-	
-	if(!CompareEmailFieldsAddresses(replyFields2.Addresses(), fields1->Addresses()))
-		{
-		CleanupStack::PopAndDestroy(2,smsset3);
-		return EFail;	
-		}
-	if(replyFields2.Subject().Compare(KEmailReplySubject()) != 0)
-		{
-		CleanupStack::PopAndDestroy(2,smsset3);
-		return EFail;	
-		}
-	if(smsset3->MessageConversion()!=ESmsConvMail)
-		{
-		CleanupStack::PopAndDestroy(2,smsset3);
-		return EFail;	
-		}
-	
-	// Repeat - test for (lack of) Re: chain.
-	fields1->SetSubjectL(KEmailReplySubject);
-	
-	iSmsHeader->SetReplyEmailFieldsL(*fields1, KEmailReplySubjectFormat);
-	const CSmsEmailFields& replyFields3 = iSmsHeader->EmailFields();
-	iSmsHeader->GetSmsSettingsL(*smsset3);
-	
-	if(!CompareEmailFieldsAddresses(replyFields3.Addresses(), fields1->Addresses()))
-		{
-		CleanupStack::PopAndDestroy(2,smsset3);
-		return EFail;	
-		}
-	if(replyFields3.Subject().Compare(KEmailReplySubject()) != 0)
-		{
-		CleanupStack::PopAndDestroy(2,smsset3);
-		return EFail;	
-		}
-	if(smsset3->MessageConversion()!=ESmsConvMail)
-		{
-		CleanupStack::PopAndDestroy(2,smsset3);
-		return EFail;	
-		}
-	
-	// Set the forward email fields - check email fields (both address and subject)
-	// and the PID value (should be ESmsConvMail)
-	_LIT(KEmailForwardSubjectFormat,	"Fw: %S");
-	_LIT(KEmailForwardSubject,			"Fw: a subject");
-	
-	// First test with no subject...
-	fields1->Reset();
-	fields1->AddAddressL(KTestAddress);
-
-	iSmsHeader->SetForwardEmailFieldsL(*fields1, KEmailForwardSubjectFormat);
-	const CSmsEmailFields& forwardFields1 = iSmsHeader->EmailFields();
-	iSmsHeader->GetSmsSettingsL(*smsset3);
-	
-	if(forwardFields1.HasAddress())
-		{
-		CleanupStack::PopAndDestroy(2,smsset3);
-		return EFail;	
-		}
-	if(forwardFields1.Addresses().MdcaCount()!=0)
-		{
-		CleanupStack::PopAndDestroy(2,smsset3);
-		return EFail;	
-		}
-	if(forwardFields1.Subject().Compare(KNullDesC) != 0)
-		{
-		CleanupStack::PopAndDestroy(2,smsset3);
-		return EFail;	
-		}
-	if(smsset3->MessageConversion()!=ESmsConvMail)
-		{
-		CleanupStack::PopAndDestroy(2,smsset3);
-		return EFail;	
-		}
-
-	// Now set the subject...
-	fields1->SetSubjectL(KTestSubject);
-
-	iSmsHeader->SetForwardEmailFieldsL(*fields1, KEmailForwardSubjectFormat);
-	const CSmsEmailFields& forwardFields2 = iSmsHeader->EmailFields();
-	iSmsHeader->GetSmsSettingsL(*smsset3);
-	
-	if(forwardFields2.HasAddress())
-		{
-		CleanupStack::PopAndDestroy(2,smsset3);
-		return EFail;	
-		}
-	if(forwardFields2.Addresses().MdcaCount()!=0)
-		{
-		CleanupStack::PopAndDestroy(2,smsset3);
-		return EFail;	
-		}
-	if(forwardFields2.Subject().Compare(KEmailForwardSubject()) != 0)
-		{
-		CleanupStack::PopAndDestroy(2,smsset3);
-		return EFail;	
-		}
-	if(smsset3->MessageConversion()!=ESmsConvMail)
-		{
-		CleanupStack::PopAndDestroy(2,smsset3);
-		return EFail;	
-		}
-	
-	// Repeat - test for (lack of) Fw: chain.
-	fields1->SetSubjectL(KEmailForwardSubject);
-	
-	iSmsHeader->SetForwardEmailFieldsL(*fields1, KEmailForwardSubjectFormat);
-	const CSmsEmailFields& forwardFields3 = iSmsHeader->EmailFields();
-	iSmsHeader->GetSmsSettingsL(*smsset3);
-	
-	if(forwardFields3.HasAddress())
-		{
-		CleanupStack::PopAndDestroy(2,smsset3);
-		return EFail;	
-		}
-	if(forwardFields3.Addresses().MdcaCount()!=0)
-		{
-		CleanupStack::PopAndDestroy(2,smsset3);
-		return EFail;	
-		}
-	if(forwardFields3.Subject().Compare(KEmailForwardSubject()) != 0)
-		{
-		CleanupStack::PopAndDestroy(smsset3);
-		CleanupStack::PopAndDestroy(fields1);
-		return EFail;	
-		}
-	if(smsset3->MessageConversion()!=ESmsConvMail)
-		{
-		CleanupStack::PopAndDestroy(2,smsset3);
-		return EFail;	
-		}
-
-	// Reset the fields and set back in the header.
-	fields1->Reset();
-	iSmsHeader->SetEmailFieldsL(*fields1);
-
-	CleanupStack::PopAndDestroy(2, fields1);
-
-	//Lets store and restore the CSmsHeader and test that the values are right
-	TMsvId id = iSmsTest.CreateDummyMessageToSendL();
-	Session().CleanupEntryPushL(id);
-	iSmsTest.SetEntryL(id);
-	
-	StoreHeaderL(*iSmsHeader);
-	
-	// Check that the email fields stream is not present, as there is no email
-	// fields data.
-	CMsvStore* store1 = iSmsTest.ReadStoreL();
-	CleanupStack::PushL(store1);
-	if(store1->IsPresentL(KUidMsvSmsEmailFieldsStream))
-		{
-		CleanupStack::PopAndDestroy(store1);
-		return EFail;	
-		}
-	CleanupStack::PopAndDestroy(store1);
-
-	CSmsHeader* header1 = CSmsHeader::NewL(CSmsPDU::ESmsSubmit,*iRichText);
-	CleanupStack::PushL(header1);
-
-	RestoreHeaderL(*header1);
-
-	//Values ok?
-	if(iSmsHeader->Type()!=header1->Type())
-		{
-		CleanupStack::PopAndDestroy(header1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;
-		}
-	if(header1->ReplyPathProvided())
-		{
-		CleanupStack::PopAndDestroy(header1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	if(header1->ServiceCenterAddress()!=_L("+350508771010"))
-		{
-		CleanupStack::PopAndDestroy(header1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	if(iSmsHeader->Recipients().Count()!=header1->Recipients().Count())
-		{
-		CleanupStack::PopAndDestroy(header1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	if(iSmsHeader->BioMsgIdType()!=header1->BioMsgIdType())
-		{
-		CleanupStack::PopAndDestroy(header1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	if(iSmsHeader->ReplyAddressL()!=header1->ReplyAddressL())
-		{
-		CleanupStack::PopAndDestroy(header1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-
-	// Lets get the setting of the message
-	CSmsSettings* smsset4 = CSmsSettings::NewL();
-	CleanupStack::PushL(smsset4);
-	header1->GetSmsSettingsL(*smsset4);
-
-	// And compare that they are the original values
-	if(smsset4->CharacterSet()!=TSmsDataCodingScheme::ESmsAlphabet7Bit)
-		{
-		CleanupStack::PopAndDestroy(2,smsset4);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	if(smsset4->DeliveryReport())
-		{
-		CleanupStack::PopAndDestroy(2,smsset4);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;		
-		}
-	if(smsset4->MessageConversion()!=ESmsConvPIDNone)
-		{
-		CleanupStack::PopAndDestroy(2,smsset4);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;		
-		}
-	if(!smsset4->RejectDuplicate())
-		{
-		CleanupStack::PopAndDestroy(2,smsset4);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;		
-		}
-	if(smsset4->ReplyPath())
-		{
-		CleanupStack::PopAndDestroy(2,smsset4);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;		
-		}
-	if(smsset4->ValidityPeriod().Int()!=ESmsVP24Hours)
-		{
-		CleanupStack::PopAndDestroy(2,smsset4);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;		
-		}
-	if(smsset4->ValidityPeriodFormat()!=TSmsFirstOctet::ESmsVPFSemiOctet)
-		{
-		CleanupStack::PopAndDestroy(2,smsset4);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;		
-		}
-	
-	CleanupStack::PopAndDestroy(2, header1);
-	
-	// Test with email fields data.
-	CSmsEmailFields* fields8 = CSmsEmailFields::NewL();
-	CleanupStack::PushL(fields8);
-	fields8->AddAddressL(KTestAddress);
-	fields8->SetSubjectL(KTestSubject);
-	iSmsHeader->SetEmailFieldsL(*fields8);
-	
-	StoreHeaderL(*iSmsHeader);
-
-	// Check that the email fields stream is  present, as there is now email
-	// fields data.
-	CMsvStore* store2 = iSmsTest.EditStoreL();
-	CleanupStack::PushL(store2);
-	if(!store2->IsPresentL(KUidMsvSmsEmailFieldsStream))
-		{
-		CleanupStack::PopAndDestroy(2,store2);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	CleanupStack::PopAndDestroy(store2);
-
-	CSmsHeader* header2 = CSmsHeader::NewL(CSmsPDU::ESmsSubmit,*iRichText);
-	CleanupStack::PushL(header2);
-
-	RestoreHeaderL(*header2);
-
-	if(iSmsHeader->Type()!=header2->Type())
-		{
-		CleanupStack::PopAndDestroy(2,store2);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	if(header2->ReplyPathProvided())
-		{
-		CleanupStack::PopAndDestroy(2,store2);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	if(header2->ServiceCenterAddress()!=_L("+350508771010"))
-		{
-		CleanupStack::PopAndDestroy(2,store2);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	if(iSmsHeader->Recipients().Count()!=header2->Recipients().Count())
-		{
-		CleanupStack::PopAndDestroy(2,store2);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	if(iSmsHeader->BioMsgIdType()!=header2->BioMsgIdType())
-		{
-		CleanupStack::PopAndDestroy(2,store2);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	if(iSmsHeader->ReplyAddressL()!=header2->ReplyAddressL())
-		{
-		CleanupStack::PopAndDestroy(2,store2);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-
-	CSmsSettings* smsset5 = CSmsSettings::NewL();
-	CleanupStack::PushL(smsset5);
-	header2->GetSmsSettingsL(*smsset5);
-
-	if(smsset5->CharacterSet()!=TSmsDataCodingScheme::ESmsAlphabet7Bit)
-		{
-		CleanupStack::PopAndDestroy(2,store2);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	if(smsset5->DeliveryReport())
-		{
-		CleanupStack::PopAndDestroy(2,store2);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	if(smsset5->MessageConversion()!=ESmsConvMail)
-		{
-		CleanupStack::PopAndDestroy(2,store2);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	if(!smsset5->RejectDuplicate())
-		{
-		CleanupStack::PopAndDestroy(2,store2);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	if(smsset5->ReplyPath())
-		{
-		CleanupStack::PopAndDestroy(2,store2);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	if(smsset5->ValidityPeriod().Int()!=ESmsVP24Hours)
-		{
-		CleanupStack::PopAndDestroy(2,store2);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	if(smsset5->ValidityPeriodFormat()!=TSmsFirstOctet::ESmsVPFSemiOctet)
-		{
-		CleanupStack::PopAndDestroy(2,store2);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	
-	const CSmsEmailFields& fields9 = iSmsHeader->EmailFields();
-	if(!CompareEmailFields(*fields8, fields9))
-		{
-		CleanupStack::PopAndDestroy(2,store2);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);
-		return EFail;	
-		}
-	
-	CleanupStack::PopAndDestroy(3, fields8);
-	
-	//Test NewL that takes a CSmsMessage - pretend it's an email message.
-	RFs fs;
-	User::LeaveIfError(fs.Connect());
-	CleanupClosePushL(fs);
-	
-	// Test un-corrupt email - add an appropriate email message
-	_LIT(KTestEmailAddress1, 	"user@domain1.domain2");
-	_LIT(KTestEmailSubject1, 	"a subject");
-	_LIT(KTestEmailBody1,		"some body text");
-	_LIT(KTestEmailMessage1,	"user@domain1.domain2##a subject#some body text");
-
-	CSmsMessage* email1 = CSmsMessage::NewL(fs, CSmsPDU::ESmsDeliver, CSmsEditorBuffer::NewL(*iRichText), EFalse);
-	CleanupStack::PushL(email1);
-	
-	CSmsBufferBase& buffer1 = email1->Buffer();
-	buffer1.Reset();
-	buffer1.InsertL(0, KTestEmailMessage1());
-	
-	// Set the PID for email.
-	CSmsPDU& pdu1 = email1->SmsPDU();
-	if( pdu1.ProtocolIdentifierPresent() )
-		{
-		pdu1.SetPIDType(TSmsProtocolIdentifier::ESmsPIDTelematicInterworking);
-		pdu1.SetTelematicDeviceIndicator(TSmsProtocolIdentifier::ESmsTelematicDevice);
-		pdu1.SetTelematicDeviceType(TSmsProtocolIdentifier::ESmsInternetElectronicMail);
-		}
-
-	// create a new SMS header
-	delete iSmsHeader;
-	iSmsHeader = NULL;
-	CleanupStack::Pop(email1);
-	
-	TRAPD(err,iSmsHeader = CSmsHeader::NewL(email1))
-	if(err)
-		{
-		delete email1;	
-		}
-
-	// Check that the header is correct...
-	// Email fields...
-	const CSmsEmailFields& fields10 = iSmsHeader->EmailFields();
-	if(!fields10.HasAddress())
-		{
-		CleanupStack::PopAndDestroy(&fs);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;
-		}
-	if(fields10.Addresses().MdcaCount()!=1)
-		{
-		CleanupStack::PopAndDestroy(&fs);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	if(fields10.Addresses().MdcaPoint(0).Compare(KTestEmailAddress1) != 0)
-		{
-		CleanupStack::PopAndDestroy(&fs);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	if(fields10.Subject().Compare(KTestEmailSubject1) != 0)
-		{
-		CleanupStack::PopAndDestroy(&fs);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	
-	// Message body...
-	CSmsBufferBase& body1 = iSmsHeader->Message().Buffer();
-	TInt length1 = body1.Length();
-	HBufC* buf1 = HBufC::NewLC(length1);
-	TPtr bufPtr1(buf1->Des());
-	body1.Extract(bufPtr1, 0, length1);
-	
-	if(bufPtr1.Compare(KTestEmailBody1) != 0)
-		{
-		CleanupStack::PopAndDestroy(2,buf1);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	
-	CleanupStack::PopAndDestroy(buf1);
-
-	// Test corrupt email.
-	_LIT(KTestEmailBody2,		"user@domain1.domain2##a subjectsome body text");
-	_LIT(KTestEmailMessage2,	"user@domain1.domain2##a subjectsome body text");
-
-	CSmsMessage* email2 = CSmsMessage::NewL(fs, CSmsPDU::ESmsDeliver, CSmsEditorBuffer::NewL(*iRichText), EFalse);
-	CleanupStack::PushL(email2);
-	
-	CSmsBufferBase& buffer2 = email2->Buffer();
-	buffer2.Reset();
-	buffer2.InsertL(0, KTestEmailMessage2());
-	
-	// Set the PID for email.
-	CSmsPDU& pdu2 = email2->SmsPDU();
-	if( pdu2.ProtocolIdentifierPresent() )
-		{
-		pdu2.SetPIDType(TSmsProtocolIdentifier::ESmsPIDTelematicInterworking);
-		pdu2.SetTelematicDeviceIndicator(TSmsProtocolIdentifier::ESmsTelematicDevice);
-		pdu2.SetTelematicDeviceType(TSmsProtocolIdentifier::ESmsInternetElectronicMail);
-		}
-
-	// create a new SMS header
-	delete iSmsHeader;
-	iSmsHeader = NULL;
-	iSmsHeader = CSmsHeader::NewL(email2); 
-	CleanupStack::Pop(email2);
-
-	// Check that the header is correct...
-	// Email fields...
-	const CSmsEmailFields& fields11 = iSmsHeader->EmailFields();
-	if(fields11.HasAddress())
-		{
-		CleanupStack::PopAndDestroy(&fs);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	if(fields11.Addresses().MdcaCount()!=0)
-		{
-		CleanupStack::PopAndDestroy(&fs);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	if(fields11.Subject().Compare(KNullDesC) != 0)
-		{
-		CleanupStack::PopAndDestroy(&fs);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	if(fields11.Length() != 0)
-		{
-		CleanupStack::PopAndDestroy(&fs);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;	
-		}
-	
-	// Message body...
-	CSmsBufferBase& body2 = iSmsHeader->Message().Buffer();
-	TInt length2 = body2.Length();
-	HBufC* buf2 = HBufC::NewLC(length2);
-	TPtr bufPtr2(buf2->Des());
-	body2.Extract(bufPtr2, 0, length2);
-	
-	if(bufPtr2.Compare(KTestEmailBody2) != 0)
-		{
-		CleanupStack::PopAndDestroy(2,buf2);
-		Session().CleanupEntryPop();
-		Session().RemoveEntry(id);	
-		return EFail;		
-		}
-	
-//	delete email1;
-	CleanupStack::PopAndDestroy(buf2);
-	
-	CleanupStack::PopAndDestroy(&fs);
-
-	Session().CleanupEntryPop();
-	Session().RemoveEntry(id);
-	
-	iTestStep.INFO_PRINTF1(_L("Test CSmsHeader Passed."));
-	
-	return EPass;
-	}
-
-_LIT(KGetDescriptionTestMessage, "Finland to win the ice hockey world champs");
-
-#include <emsuserpromptie.h>
-#include <emssoundie.h>
-_LIT8(KUserMelody, 	"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
-	  "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"); // Melody file
-
-_LIT(KTestEmsVariousMsg1,"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
-
-TVerdict CSmutTest::TestSmsEmsExtensionsL()
-// Test the modifications for EMS
-	{
-	
-	iTestStep.INFO_PRINTF1(_L("Testing EMS Extensions..."));
-	
-	// Set up a standard sms message first
-	iRichText->Reset();
-	iRichText->InsertL(0, KTestEmsVariousMsg1);
-	// Make a Deliver so we can get at the protocol identifier
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsDeliver,*iRichText);
-	CleanupStack::PushL(header);
-
-	// Create 2 EMS Melody objects followed by a User Prompt Indicator
-
-	// Create first Melody EMS object
-	CEmsSoundIE* object = CEmsSoundIE::NewL(KUserMelody());
-	CleanupStack::PushL(object);	
-	// Insert the sound object after the 5th byte of the message
-	object->SetStartPosition(5);
-	// Add it to the CSmsMessage
-	header->Message().AddEMSInformationElementL(*object);
-	CleanupStack::PopAndDestroy(object);	
-
-	// Create a second Melody EMS object 
-	CEmsSoundIE* object2 = CEmsSoundIE::NewL(KUserMelody());
-	CleanupStack::PushL(object2);	
-	// Insert the sound object after the 5th byte of the message
-	object2->SetStartPosition(5);
-	// Add it to the CSmsMessage
-	header->Message().AddEMSInformationElementL(*object2);
-	CleanupStack::PopAndDestroy(object2);
-
-	// Create a user prompt indicator and tell it there are 2 EMS objects
-	CEmsUserPrompt* prompt = CEmsUserPrompt::NewL(2);
-	CleanupStack::PushL(prompt);	
-	// Add it after the 5th byte of the message
-	prompt->SetStartPosition(5);
-	// Add it to the CSmsMessage
-	header->Message().AddEMSInformationElementL(*prompt);
-	CleanupStack::PopAndDestroy(prompt);
- 
-	// Test the TMsvSmsEntry derived class
-	TMsvSmsEntry entry;
-	// Check the Existing sms message for User Prompt indicator
-	const RPointerArray<const CEmsInformationElement>&  emsElements= header->Message().GetEMSInformationElementsL();
-	// Loop through the array checking for a user prompt indicator element
-	for(TInt i=0;i<emsElements.Count();i++)
-		{
-		if(emsElements[i]->Identifier() == CSmsInformationElement::ESmsEnhancedUserPromptIndicator)
-			{
-			// Set user prompt indicator bit in iMtmData2
-			entry.SetUserPromptIndicator(ETrue);
-			break;
-			}
-		}
-	// Check the user prompt indicator is set
-	if(!entry.UserPromptIndicator())
-		{
-		iTestStep.ERR_PRINTF1(_L("Cannot set user prompt."));
-		CleanupStack::PopAndDestroy(header);
-		return EFail;
-		}
-	// Check we can clear it
-	entry.SetUserPromptIndicator(EFalse);
-	if(entry.UserPromptIndicator())
-		{
-		iTestStep.ERR_PRINTF1(_L("Cannot clear user prompt."));
-		CleanupStack::PopAndDestroy(header);
-		return EFail;	
-		}
-
-	// Convenient reference to PDU
-	CSmsDeliver& pdu = STATIC_CAST(CSmsDeliver&,header->Message().SmsPDU());
-	// Set up the Protocol Identifier to read back
-	pdu.SetPIDType(TSmsProtocolIdentifier::ESmsPIDShortMessageType);
-	pdu.SetShortMessageType(TSmsProtocolIdentifier::ESmsReplaceShortMessageType1);
-
-	// Read from the pdu and set the TMsvSmsEntry copy
-	entry.SetProtocolIdentifier(*pdu.ProtocolIdentifier());
-	// Read it back and check the value
-	if(entry.ProtocolIdentifier() != *pdu.ProtocolIdentifier())
-		{
-		iTestStep.ERR_PRINTF1(_L("TMsvSmsEntry::ProtocolIdentifier corrupt."));
-		CleanupStack::PopAndDestroy(header);
-		return EFail;
-		}
-
-	CleanupStack::PopAndDestroy(); //header
-	
-	iTestStep.INFO_PRINTF1(_L("Test EMS Extensions Passed."));
-	
-	return EPass;
-
-	}
-
-TVerdict CSmutTest::TestSmsUtilitiesL()
-	{
-	iTestStep.INFO_PRINTF1(_L("Testing TSmsUtilities...."));
-
-	iRichText->Reset();
-	iRichText->InsertL(0, KGetDescriptionTestMessage);
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit,*iRichText);
-	CleanupStack::PushL(header);
-
-	if(!TestSmsUtilities1L(*header))
-		{
-		CleanupStack::PopAndDestroy(header); //header
-		return EFail;	
-		}
-		
-	if(!TestSmsUtilities2L(*header))
-		{
-		CleanupStack::PopAndDestroy(header); //header
-		return EFail;	
-		}
-		
-	if(!TestSmsUtilities3L(*header))
-		{
-		CleanupStack::PopAndDestroy(header); //header
-		return EFail;	
-		}
-
-	CleanupStack::PopAndDestroy(); //header
-	
-	iTestStep.INFO_PRINTF1(_L("Test TSmsUtilities Passed."));
-	
-	return EPass;
-	}
-
-TBool CSmutTest::TestSmsUtilities1L(CSmsHeader& aHeader)
-/**
- * @test Tests TSmsUtilities::GetDescription()
- */
-	{
-	
-	iTestStep.INFO_PRINTF1(_L("Testing TSmsUtilities::GetDescription() - use varying values to test trucation"));
-
-	RResourceFile resFile;
-	iSmsTest.OpenResourceFileL(KSmsResourceFile, resFile);
-	CleanupClosePushL(resFile);
-
-	//Test GetDescription()
-
-	TPtrC buf(KGetDescriptionTestMessage);
-	const TInt maxLength = buf.Length();
-	HBufC* desBuf = HBufC::NewLC(maxLength);
-	TPtr desc = desBuf->Des();
-
-	for( TInt length=1; length <= maxLength; ++length )
-		{
-		iTestStep.INFO_PRINTF2(_L("-> trucating to length %d"), length);
-
-		desc.Zero();
-		User::LeaveIfError(TSmsUtilities::GetDescription(aHeader.Message(), desc, length));
-
-		iTestStep.INFO_PRINTF2(_L("-> GetDescription() : %S"), &desc);
-		
-		if(desc.Length()>length)
-			{
-			CleanupStack::PopAndDestroy(2,desBuf);
-			return EFalse;	
-			}
-		if(desc != buf.Left(desc.Length()) ) //this won't work if buf contains CEditableText::EParagraphDelimiter
-			{
-			CleanupStack::PopAndDestroy(2,desBuf);
-			return EFalse;		
-			}
-		}
-	desc.Zero();
-
-	//Test Special Message Indication
-
-	iTestStep.INFO_PRINTF1(_L("Testing Special Message Indications..."));
-
-	CSmsPDU& pdu = aHeader.Message().SmsPDU();
-	CSmsUserData& userData = pdu.UserData();
-	TBuf8<2> msgInd;
-	msgInd.Copy(_L("AA"));
-
-	//Add information element
-	msgInd[0] = TSmsUtilities::EEmailMessageWaiting;
-	msgInd[1] = 0x00000001; //1 message
-
-	iTestStep.INFO_PRINTF1(_L("\tAdding information element (Email) to UD"));
-	userData.AddInformationElementL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication, msgInd);
-	User::LeaveIfError(TSmsUtilities::GetDescription(aHeader.Message(), desc));
-	if(!CheckDescriptionL(resFile, R_MESSAGE_INDICATION_EMAIL_ONE, desc, 2))
-		{
-		CleanupStack::PopAndDestroy(2,desBuf);
-		return EFalse;	
-		}
-
-	// Set the maximum length of desc to be less than the description.
-	// The description should truncate to fit into desc.
-	User::LeaveIfError(TSmsUtilities::GetDescription(aHeader.Message(), desc, 10));
-	if(desc.Length() != 10) //Check that the Length of desc is the specified max length.
-		{
-		CleanupStack::PopAndDestroy(2,desBuf);
-		return EFalse;	
-		}
-
-	if(!TestSpecialSmsMessageIndicationPduL(resFile, TSmsUtilities::EVoiceMessageWaiting, R_MESSAGE_INDICATION_VOICEMAIL_ONE))
-		{
-		CleanupStack::PopAndDestroy(2, &resFile);
-		return EFalse;	
-		}
-	
-	if(!TestSpecialSmsMessageIndicationPduL(resFile, TSmsUtilities::EFaxMessageWaiting, R_MESSAGE_INDICATION_FAX_ONE))
-		{
-		CleanupStack::PopAndDestroy(2, &resFile);
-		return EFalse;	
-		}
-	if(!TestSpecialSmsMessageIndicationPduL(resFile, TSmsUtilities::EEmailMessageWaiting, R_MESSAGE_INDICATION_EMAIL_ONE))
-		{
-		CleanupStack::PopAndDestroy(2, &resFile);
-		return EFalse;	
-		}
-	if(!TestSpecialSmsMessageIndicationPduL(resFile, TSmsUtilities::EOtherMessageWaiting, R_MESSAGE_INDICATION_OTHER_ONE))
-		{
-		CleanupStack::PopAndDestroy(2, &resFile);
-		return EFalse;		
-		}
-			
-	//Test video message waiting indication
-	iTestStep.INFO_PRINTF1(_L("Testing video message waiting indications..."));	
-	if(!TestVideoMessageIndicationPduL(resFile, aHeader, R_MESSAGE_INDICATION_VIDEOMESSAGE_ONE))
-		{
-		CleanupStack::PopAndDestroy(2, &resFile);
-		return EFalse;		
-		}
-	
-	//Test enhanced voice mail waiting indication
-	iTestStep.INFO_PRINTF1(_L("Testing enhanced voice mail indications..."));	
-	if(!TestEnhancedVoiceMailIndicationPduL(resFile, aHeader, R_MESSAGE_INDICATION_ENHANCED_VOICEMAIL_ONE))
-		{
-		CleanupStack::PopAndDestroy(2, &resFile);
-		return EFalse;		
-		}
-	
-	//Test multiple indications.
-	iTestStep.INFO_PRINTF1(_L("Testing multiple indications..."));
-	//Add a video message waiting notification (9 video messages)
-	CSmsSpecialSMSMessageOperations& operations = STATIC_CAST(CSmsSpecialSMSMessageOperations&,aHeader.Message().GetOperationsForIEL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication));
-	
-	TBool toStore=ETrue;
-	TUint8 messageCount=9;
-	TUint8 totalMessageCount=messageCount;
-	TSmsMessageIndicationType messageIndicationType=EGsmSmsExtendedMessageTypeWaiting;
-	TExtendedSmsIndicationType extendedType=EGsmSmsVideoMessageWaiting;
-	TSmsMessageProfileType messageProfileType=EGsmSmsProfileId1;
-	
-	operations.RemoveAllSpecialMessageIndicationsL();
-	operations.AddSpecialMessageIndicationL(toStore,messageIndicationType,
-								extendedType,messageProfileType,messageCount);
-	//Add an enhanced voicemail notification (5 enhanced voice mails)
-	CSmsEnhancedVoiceMailOperations& enhancedOperations = STATIC_CAST(CSmsEnhancedVoiceMailOperations&,aHeader.Message().GetOperationsForIEL(CSmsInformationElement::ESmsEnhanceVoiceMailInformation));
-	enhancedOperations.RemoveEnhancedVoiceMailIEL();
-	//Create CEnhancedVoiceMailNotification
-	CEnhancedVoiceMailNotification* enhancedVoiceMailNotification=CEnhancedVoiceMailNotification::NewL();
-	CleanupStack::PushL(enhancedVoiceMailNotification);
-	messageCount=5;
-	totalMessageCount+=messageCount;
-	enhancedVoiceMailNotification->SetNumberOfVoiceMessages(messageCount);
-	enhancedOperations.AddEnhancedVoiceMailIEL(*enhancedVoiceMailNotification);
-	CleanupStack::PopAndDestroy(enhancedVoiceMailNotification);
-	
-	//Add an email message waiting notification (1 email)
-	msgInd[0] = TSmsUtilities::EEmailMessageWaiting;
-	msgInd[1] = 0x00000001; 
-	userData.AddInformationElementL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication, msgInd);
-	totalMessageCount++;
-	
-	//Add a fax waiting notification (2 faxes)
-	msgInd[0] = TSmsUtilities::EFaxMessageWaiting;
-	msgInd[1] = 0x00000002; 
-	userData.AddInformationElementL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication, msgInd);
-	totalMessageCount+=2;
-	
-	//Add a voice mail waiting notification (3 voice mails)
-	msgInd[0] = TSmsUtilities::EVoiceMessageWaiting;
-	msgInd[1] = 0x00000003; 
-	userData.AddInformationElementL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication, msgInd);
-	totalMessageCount+=3;
-	
-	User::LeaveIfError(TSmsUtilities::GetDescription(aHeader.Message(), desc));	
-	if(!CheckDescriptionL(resFile, R_MESSAGE_INDICATION_OTHER_MANY, desc, totalMessageCount))
-		{
-		CleanupStack::PopAndDestroy(2, &resFile);
-		return EFalse;	
-		}
-	iTestStep.INFO_PRINTF1(_L("Passed"));
-
-	CleanupStack::PopAndDestroy(2, &resFile);
-	
-	return ETrue;
-	}
-
-CSmsMessage* CSmutTest::CreateSmsMessageLC(const TDesC8& aHexPdu) const
-	{
-	HBufC8* binaryPdu = ConvertToBinaryLC(aHexPdu);
-	TGsmSms pdu;
-	pdu.SetPdu(*binaryPdu);
-	CleanupStack::PopAndDestroy(binaryPdu);
-	CSmsMessage* message = CSmsMessage::NewL(iSmsTest.FileSession(), pdu, CSmsBuffer::NewL());
-	CleanupStack::PushL(message);
-	return message;
-	}
-
-HBufC8* CSmutTest::ConvertToBinaryLC(const TDesC8& aHex) const
-	{
-	const TInt len = aHex.Length();
-	if (len % 2 != 0)
-		User::Leave(KErrArgument);
-
-	HBufC8* pdu = HBufC8::NewLC(len / 2);
-	TPtr8 ptr(pdu->Des());
-
-	for (TInt i = 0; i < len; i += 2)
-		{
-		TLex8 lex(aHex.Mid(i, 2));
-		TUint8 val;
-		User::LeaveIfError(lex.Val(val, EHex));
-		ptr.Append(val);
-		}
-
-	return pdu;
-	}
-
-_LIT(KGetDetailsResult, "\t\tNum In: \"%S\" Name Out: \"%S\"");
-
-TBool CSmutTest::TestSmsUtilities2L(CSmsHeader& aHeader)
-	{
-	//Test GetDetails
-
-	iTestStep.INFO_PRINTF1(_L("Test TSmsUtilities::GetDetails()"));
-
-	_LIT(KLongTel, "+378458932945284754456302945754938539");
-
-	_LIT(KMikkoTel, "+358503367709");
-	_LIT(KMikkoFirst, "Mikko");
-	_LIT(KMikkoLast, "Rintala");
-	_LIT(KMikkoEmail, "mikko@nokia.com");
-
-	_LIT(KUnqualifiedTel, "8503367710");
-	_LIT(KUnqualifiedTel1, "+358503367710");
-	_LIT(KUnqualifiedFirst, "Unq");
-	_LIT(KUnqualifiedLast, "Wallified");
-	_LIT(KUnqualifiedEmail, "unqalified@diysurgery.com");
-
-	//	_LIT(KAnthonyTel, " + 4 "); //is valid
-	_LIT(KAnthonyTel, "+ 7 "); //is valid
-	_LIT(KAnthonyFirst, "Anthony");
-	_LIT(KAnthonyLast, "Alexander");
-	_LIT(KAnthonyEmail, "test@symbian.com");
-
-	_LIT(KHarriTel, "+8"); //is valid
-	_LIT(KHarriFirst, "HarriHarriHarriHarriHarriHarriHarri");
-	_LIT(KHarriLast, "RäisänenRäisänenRäisänenRäisänenRäisänen");
-	_LIT(KHarriEmail, "harri@nokia.com");
-
-	_LIT(KDupTel, "+44207435676");
-	_LIT(KDupFirst1, "Keval");
-	_LIT(KDupLast1, "Pindoria");
-	_LIT(KDupFirst2, "Jackie");
-	_LIT(KDupLast2, "Chan");
-	
-	_LIT(KBadTel1, "This is a bad Telephone");
-	_LIT(KBadTel2, " 5  ");
-	_LIT(KBadTel3, "5+");
-	_LIT(KBadTel4, "*5565434556");
-
-	_LIT(KBadFirst, "BadFirstName");
-	_LIT(KBadLast, "BadLastName");
-
-	_LIT(KNoNameTel, "+449005434");
-
-	_LIT(KDummy, "+44444");
-
-	TRAPD(err, iSmsTest.DeleteContactsFileL());
-	
-	if(err != KErrNotFound && err != KErrNone)
-		{
-		return EFalse;	
-		}
-
-	iTestStep.INFO_PRINTF1(_L("\tTesting without contacts"));
-
-	//Simple test
-	TPtrC testTel(KMikkoTel);
-	TBuf<KSmsDetailsLength> details;
-
-	aHeader.Message().SetToFromAddressL(testTel);
-	TSmsUtilities::GetDetails(iSmsTest.FileSession(), aHeader.Message(), details);
-	iTestStep.INFO_PRINTF3(KGetDetailsResult, &testTel, &details);
-	if(testTel.FindF(details) == KErrNotFound) //details should contain testTel as there is no contact.
-		{
-		return EFalse;	
-		}
-
-	if(!TestInvalidContact(testTel, details))
-		{
-		return EFalse;		
-		}
-
-	testTel.Set(KAnthonyTel);
-	aHeader.Message().SetToFromAddressL(testTel);
-	err = TSmsUtilities::GetDetails(iSmsTest.FileSession(), aHeader.Message(), details);
-	iTestStep.INFO_PRINTF3(KGetDetailsResult, &testTel, &details);
-	if(testTel.FindF(details) == KErrNotFound) //details should contain testTel as there is no contact.
-		{
-		return EFalse;		
-		}
-	if(err != KErrNone)
-		{
-		return EFalse;	
-		}
-
-	if(!TestInvalidContact(testTel, details))
-		{
-		return EFalse;		
-		}
-
-	// Testing with long telephone number. 
-	// The telephone number should truncate to fit into details.
-	if(!TestInvalidContact(KLongTel, details))
-		{
-		return EFalse;		
-		}
-	if(details.Length() != KSmsDetailsLength) //Length of details should be the default max length.
-		{
-		return EFalse;	
-		}
-
-	//Add contacts
-
-	iTestStep.INFO_PRINTF1(_L("\tAdding Contacts"));
-
-	//Adding good telephone numbers
-
-	TContactItemId contId = iSmsTest.CreateContactL(KAnthonyFirst, KAnthonyLast, KAnthonyTel, KAnthonyEmail);
-	if(contId == KNullContactId)
-		{
-		return EFalse;	
-		}
-
-	contId = iSmsTest.CreateContactL(KMikkoFirst, KMikkoLast, KMikkoTel, KMikkoEmail);
-	if(contId == KNullContactId)
-		{
-		return EFalse;	
-		}
-
-	contId = iSmsTest.CreateContactL(KUnqualifiedFirst, KUnqualifiedLast, KUnqualifiedTel, KUnqualifiedEmail);
-	if(contId == KNullContactId)
-		{
-		return EFalse;	
-		}
-
-	contId = iSmsTest.CreateContactL(KHarriFirst, KHarriLast, KHarriTel, KHarriEmail);
-	if(contId == KNullContactId)
-		{
-		return EFalse;	
-		}
-
-	//Adding a duplicate telephone
-
-	contId = iSmsTest.CreateContactL(KDupFirst1, KDupLast1, KDupTel, KNullDesC);
-	if(contId == KNullContactId)
-		{
-		return EFalse;	
-		}
-
-	contId = iSmsTest.CreateContactL(KDupFirst2, KDupLast2, KDupTel, KNullDesC);
-	if(contId == KNullContactId)
-		{
-		return EFalse;	
-		}
-
-	//Adding bad telephone numbers
-
-	contId = iSmsTest.CreateContactL(KBadFirst, KBadLast, KBadTel1, KNullDesC);
-	if(contId == KNullContactId)
-		{
-		return EFalse;	
-		}
-
-	contId = iSmsTest.CreateContactL(KBadFirst, KBadLast, KBadTel2, KNullDesC);
-	if(contId == KNullContactId)
-		{
-		return EFalse;	
-		}
-
-	contId = iSmsTest.CreateContactL(KBadFirst, KBadLast, KBadTel3, KNullDesC);
-	if(contId == KNullContactId)
-		{
-		return EFalse;	
-		}
-
-	contId = iSmsTest.CreateContactL(KBadFirst, KBadLast, KBadTel4, KNullDesC);
-	if(contId == KNullContactId)
-		{
-		return EFalse;	
-		}
-
-	//Adding no name contact
-
-	contId = iSmsTest.CreateContactL(KNullDesC, KNullDesC, KNoNameTel, KNullDesC);
-	if(contId == KNullContactId)
-		{
-		return EFalse;	
-		}
-
-	iTestStep.INFO_PRINTF1(_L("\tTesting with valid telephone numbers"));
-
-	if(!TestValidTel(KAnthonyTel, KAnthonyFirst, KAnthonyLast, KNullDesC, details))
-		{
-		return EFalse;	
-		}
-		
-	if(!TestValidTel(KMikkoTel, KMikkoFirst, KMikkoLast, KNullDesC, details))
-		{
-		return EFalse;	
-		}
-	// Test below was added for INC040050. The number of digits matched
-	// against in GetDetails changed and resulted in undesirable behaviour
-	// when searching for an unqualified number with a fully qualified number.
-	if(!TestValidTel(KUnqualifiedTel1, KUnqualifiedFirst, KUnqualifiedLast, KNullDesC, details))
-		{
-		return EFalse;	
-		}
-	if(!TestValidTel(KHarriTel, _L("Räisänen"), KNullDesC, _L("Harri"), details))
-		{
-		return EFalse;	
-		}
-
-	iTestStep.INFO_PRINTF1(_L("\tTesting with invalid telephone numbers"));
-
-	if(!TestInvalidTelephone(KBadTel1, details))
-		{
-		return EFalse;	
-		}
-	if(!TestInvalidTelephone(KBadTel2, details))
-		{
-		return EFalse;		
-		}
-	if(!TestInvalidTelephone(KBadTel3, details))
-		{
-		return EFalse;		
-		}
-	if(!TestInvalidTelephone(KBadTel4, details))
-		{
-		return EFalse;		
-		}
-
-	iTestStep.INFO_PRINTF1(_L("\tTesting with duplicate telephone numbers"));
-
-	if(!TestDuplicateContact(KDupTel, details))
-		{
-		return EFalse;	
-		}
-
-	iTestStep.INFO_PRINTF1(_L("\tTesting No Names telephone number"));
-
-	if(!TestInvalidContact(KNoNameTel, details))
-		{
-		return EFalse;	
-		}
-	if(!TestInvalidContact(KDummy, details))
-		{
-		return EFalse;	
-		}
-
-	iTestStep.INFO_PRINTF1(_L("Passed"));
-	
-	return ETrue;
-	}
-
-TBool CSmutTest::TestValidTel(const TDesC& aTel, const TDesC& aExpect1, const TDesC& aExpect2, const TDesC& aNotExpect, TDes& rDetails)
-	{
-	TInt err = TSmsUtilities::GetDetails(iSmsTest.FileSession(), aTel, rDetails);
-	iTestStep.INFO_PRINTF3(KGetDetailsResult, &aTel, &rDetails);
-
-	if (aExpect1.Length())
-		{
-		if(rDetails.FindF(aExpect1) == KErrNotFound)
-			{
-			return EFalse;	
-			}	
-		}
-		
-
-	if (aExpect2.Length())
-		{
-		if(rDetails.FindF(aExpect2) == KErrNotFound)
-			{
-			return EFalse;	
-			}
-		}
-		
-
-	if (aNotExpect.Length())
-		{
-		if(rDetails.FindF(aNotExpect) != KErrNotFound)
-			{
-			return EFalse;		
-			}	
-		}
-		
-	if(err != KErrNone)
-		{
-		return EFalse;
-		}
-	
-	return ETrue;
-	}
-
-TBool CSmutTest::TestInvalidTelephone(const TDesC& aTel, TDes& aDetails)
-	{
-	TInt err = TSmsUtilities::GetDetails(iSmsTest.FileSession(), aTel, aDetails);
-	iTestStep.INFO_PRINTF3(KGetDetailsResult, &aTel, &aDetails);
-	if(aTel.FindF(aDetails) == KErrNotFound)	//aDetails should contain aTel as aTel is invalid.
-		{
-		return EFalse;	
-		}
-	if(err != KErrNone)
-		{
-		return EFalse;	
-		}
-	
-	return ETrue;
-	}	
-
-TBool CSmutTest::TestInvalidContact(const TDesC& aTel, TDes& aDetails)
-	{
-	TInt err = TSmsUtilities::GetDetails(iSmsTest.FileSession(), aTel, aDetails);
-	iTestStep.INFO_PRINTF3(KGetDetailsResult, &aTel, &aDetails);
-	
-	if(aTel.FindF(aDetails) == KErrNotFound) //aDetails should contain aTel as the contact is invalid.
-		{
-		return EFalse;
-		}
-	if(err != KErrNone)
-		{
-		return EFalse;	
-		}
-	return ETrue;
-	}
-
-TBool CSmutTest::TestDuplicateContact(const TDesC& aTel, TDes& aDetails)
-	{
-	TInt err = TSmsUtilities::GetDetails(iSmsTest.FileSession(), aTel, aDetails);
-	iTestStep.INFO_PRINTF3(KGetDetailsResult, &aTel, &aDetails);
-	if(aTel.FindF(aDetails) == KErrNotFound) //aDetails should contain aTel as there is duplicate contact.
-		{
-		return EFalse;	
-		}
-	if(err != KErrNone)
-		{
-		return EFalse;	
-		}
-	
-	return ETrue;
-	}
-
-TBool CSmutTest::TestSmsUtilities3L(CSmsHeader& aHeader)
-	{
-	iTestStep.INFO_PRINTF1(_L("Test TSmsUtilities::ServiceIdL()"));
-
-	TMsvId id2 = KMsvNullIndexEntryId;
-	// First tested function is ServiceIdL()
-	TSmsUtilities::ServiceIdL(*iSmsTest.iMsvEntry, id2);
-	if(id2 != iSmsTest.iSmsServiceId)
-		{
-		return EFalse;	
-		}
-	iTestStep.INFO_PRINTF1(_L("\tPassed"));
-
-	iTestStep.INFO_PRINTF1(_L("Test TSmsUtilities::PopulateMsgEntry()"));
-	TMsvEntry entry;
-	TSmsUtilities::PopulateMsgEntry(entry,aHeader.Message(), iSmsTest.iSmsServiceId);
-	// todo More tests
-	iTestStep.INFO_PRINTF1(_L("\tPassed"));
-	
-	return ETrue;
-	}
-
-TBool CSmutTest::TestSpecialSmsMessageIndicationPduL(RResourceFile& aResFile, TSmsUtilities::TSmsUtilitiesSpecialMessageType aMessageType, TInt aId)
-	{
-	iTestStep.INFO_PRINTF2(_L("\tTestSpecialSmsMessageIndicationPduL Type=%d..."), aMessageType);
-
-	const TUint8 KMaxCount = 0xFF;
-	for (TUint8 i = 0; i < KMaxCount; i++)
-		{
-		TInt resId = aId;
-		if (i != 1)
-			resId++;
-
-		if(!TestSpecialSmsMessageIndicationPduL(aResFile, STATIC_CAST(TUint8, aMessageType), i, resId))
-			{
-			return EFalse;	
-			}
-		if(!TestSpecialSmsMessageIndicationPduL(aResFile, STATIC_CAST(TUint8, aMessageType | 0x80), i, resId))
-			{
-			return EFalse;	
-			}
-		}
-
-	iTestStep.INFO_PRINTF1(_L("Passed"));
-	
-	return ETrue;
-	}
-
-TBool CSmutTest::TestSpecialSmsMessageIndicationPduL(RResourceFile& aResFile, TUint8 aMessageType, TUint8 aMessageCount, TInt aId)
-	{
-	_LIT8(KFaxIndicationPdu, "440B916407586704F900002010011153710406040102810200");
-	const TInt KIndicationPosition = 44;
-	TBuf<KSmsDescriptionLength> desc;
-
-	//Replace the Message Indication in this PDU
-	RMobileSmsMessaging::TMobileSmsGsmTpdu miPdu(KFaxIndicationPdu);
-	_LIT8(KFormat, "%02X%02X");
-	TPtr8 ptr(&miPdu[KIndicationPosition], 0, 4);
-	ptr.AppendFormat(KFormat, aMessageType, aMessageCount);
-
-
-	CSmsMessage* msg = CreateSmsMessageLC(miPdu);
-	User::LeaveIfError(TSmsUtilities::GetDescription(*msg, desc));
-	CleanupStack::PopAndDestroy(msg);
-	
-	if (aMessageCount != 1)
-		return CheckDescriptionL(aResFile, aId, desc, aMessageCount);
-	else
-		return CheckDescriptionL(aResFile, aId, desc);
-	}	
-	
-TBool CSmutTest::TestVideoMessageIndicationPduL(RResourceFile& aResFile, CSmsHeader& aHeader, TInt aId)
-	{
-	//remove any enhanced voice mail indications
-	CSmsEnhancedVoiceMailOperations& enhancedOperations = STATIC_CAST(CSmsEnhancedVoiceMailOperations&,aHeader.Message().GetOperationsForIEL(CSmsInformationElement::ESmsEnhanceVoiceMailInformation));
-	if(enhancedOperations.ContainsEnhancedVoiceMailIEL())
-		{
-		enhancedOperations.RemoveEnhancedVoiceMailIEL();	
-		}
-
-	const TUint8 KMaxCount = 0xFF;
-	for (TUint8 i = 0; i < KMaxCount; i++)
-		{
-		TInt resId = aId;
-		if (i != 1)
-			resId++;
-
-		if(!TestVideoMessageIndicationPduL(aResFile, i, aHeader, resId))
-			{
-			return EFalse;	
-			}
-		}
-
-	iTestStep.INFO_PRINTF1(_L("Passed"));
-	
-	return ETrue;
-	}
-	
-
-TBool CSmutTest::TestVideoMessageIndicationPduL(RResourceFile& aResFile, TUint8 aMessageCount, CSmsHeader& aHeader, TInt aId)
-	{
-	//Get the operations
-	CSmsSpecialSMSMessageOperations& operations = STATIC_CAST(CSmsSpecialSMSMessageOperations&,aHeader.Message().GetOperationsForIEL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication));
-	
-	TBool toStore=ETrue;
-	TSmsMessageIndicationType messageIndicationType=EGsmSmsExtendedMessageTypeWaiting;
-	TExtendedSmsIndicationType extendedType=EGsmSmsVideoMessageWaiting;
-	TSmsMessageProfileType messageProfileType=EGsmSmsProfileId1;
-	TBuf<KSmsDescriptionLength> desc;
-	
-	operations.RemoveAllSpecialMessageIndicationsL();
-	operations.AddSpecialMessageIndicationL(toStore,messageIndicationType,
-								extendedType,messageProfileType,aMessageCount);
-	
-	User::LeaveIfError(TSmsUtilities::GetDescription(aHeader.Message(), desc));
-	
-	if(!CheckDescriptionL(aResFile, aId, desc, aMessageCount))
-		{
-		operations.RemoveAllSpecialMessageIndicationsL();
-		return EFalse;	
-		}
-	operations.RemoveAllSpecialMessageIndicationsL();	
-	return ETrue;
-	}
-
-TBool CSmutTest::TestEnhancedVoiceMailIndicationPduL(RResourceFile& aResFile, CSmsHeader& aHeader, TInt aId)
-	{
-	//remove any special message indications
-	CSmsSpecialSMSMessageOperations& operations = STATIC_CAST(CSmsSpecialSMSMessageOperations&,aHeader.Message().GetOperationsForIEL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication));
-	operations.RemoveAllSpecialMessageIndicationsL();
-	
-	const TUint8 KMaxCount = 0xFF;
-	for (TUint8 i = 0; i < KMaxCount; i++)
-		{
-		TInt resId = aId;
-		if (i != 1)
-			resId++;
-
-		if(!TestEnhancedVoiceMailIndicationPduL(aResFile, i, aHeader, resId))
-			{
-			return EFalse;	
-			}
-		}
-
-	iTestStep.INFO_PRINTF1(_L("Passed"));
-	
-	return ETrue;
-	}
-	
-
-TBool CSmutTest::TestEnhancedVoiceMailIndicationPduL(RResourceFile& aResFile, TUint8 aMessageCount, CSmsHeader& aHeader, TInt aId)
-	{	
-	//get the operations class
-	CSmsEnhancedVoiceMailOperations& enhancedOperations = STATIC_CAST(CSmsEnhancedVoiceMailOperations&,aHeader.Message().GetOperationsForIEL(CSmsInformationElement::ESmsEnhanceVoiceMailInformation));
-	//remove any enhanced voice mail indications
-	if(enhancedOperations.ContainsEnhancedVoiceMailIEL())
-		{
-		enhancedOperations.RemoveEnhancedVoiceMailIEL();	
-		}
-	//Create CEnhancedVoiceMailNotification
-	CEnhancedVoiceMailNotification* enhancedVoiceMailNotification=CEnhancedVoiceMailNotification::NewL();
-	CleanupStack::PushL(enhancedVoiceMailNotification);
-
-	//Set the properties
-	TSmsMessageProfileType messageProfileType=EGsmSmsProfileId1;
-	enhancedVoiceMailNotification->SetProfile(messageProfileType);
-	enhancedVoiceMailNotification->SetStorage(ETrue);
-	enhancedVoiceMailNotification->SetNumberOfVoiceMessages(aMessageCount);
-	
-	enhancedOperations.AddEnhancedVoiceMailIEL(*enhancedVoiceMailNotification);
-	CleanupStack::PopAndDestroy(enhancedVoiceMailNotification);
-	
-	TBuf<KSmsDescriptionLength> desc;
-	User::LeaveIfError(TSmsUtilities::GetDescription(aHeader.Message(), desc));
-	if(!CheckDescriptionL(aResFile, aId, desc, aMessageCount))
-		{
-		return EFalse;	
-		}
-	
-	
-	return ETrue;
-	}
-	
-
-TBool CSmutTest::CheckDescriptionL(RResourceFile& aResFile, TInt aId, TRefByValue<const TDesC> aDesc, ...)
-	{
-	const TDesC& ref = aDesc;
-
-	TBuf<256> resDesc;
-	TBuf<256> resString;
-
-	VA_LIST list;
-	VA_START(list, aDesc);
-
-	iSmsTest.ReadResourceStringL(aResFile, aId, resString);
-	resDesc.AppendFormatList(resString, list);
-
-	if (ref != resDesc)
-		{
-		iTestStep.INFO_PRINTF3(_L("\tMISMATCH Desc \"%S\" Resource \"%S\""), &ref, &resDesc);
-		return EFalse;
-		}
-		
-	return ETrue;
-	}
-
-TBool CSmutTest::CheckSmsEntry(
-							const TMsvSmsEntry& aEntry, 
-							TBool aClassExpected, 
-							TSmsDataCodingScheme::TSmsClass aClass, 
-							TUint8 aPID, 
-							TBool aUPI, 
-							TMsvSmsEntry::TMsvSmsEntryAckSummary aDeliverySummary, 
-							TBool aValidMessageId, 
-							TInt32 aMessageId) const
-	{
-	TCompare retVal(ETrue);
-
-	TSmsDataCodingScheme::TSmsClass dummyClass;
-
-	retVal((aEntry.Class(dummyClass) && aClassExpected) || (!aEntry.Class(dummyClass) && !aClassExpected));
-
-	if (aClassExpected)
-		retVal(dummyClass == aClass);
-
-	retVal(aEntry.ProtocolIdentifier() == aPID);
-	retVal((aEntry.UserPromptIndicator() && aUPI) || (!aEntry.UserPromptIndicator() && !aUPI));
-
-	retVal(aEntry.AckSummary(ESmsAckTypeDelivery) == aDeliverySummary);
-
-	TInt32 dummyMessageId;
-
-	retVal( (aEntry.MessageId(dummyMessageId) && aValidMessageId) || (!aEntry.MessageId(dummyMessageId) && !aValidMessageId) );
-	if( aValidMessageId )
-		retVal( dummyMessageId == aMessageId );
-
-	return retVal;
-	}
-
-TVerdict CSmutTest::TestSmsEntryL()
-	{
-	iTestStep.INFO_PRINTF1(_L("Testing TMsvSmsEntry..."));
-
-	TMsvSmsEntry entry;
-	if(!CheckSmsEntry(entry, EFalse, TSmsDataCodingScheme::ESmsClass0, 0, EFalse, TMsvSmsEntry::ENoAckSummary, EFalse, 0))
-		{
-		return EFail;	
-		}
-
-	entry.SetUserPromptIndicator(ETrue);
-	if(!CheckSmsEntry(entry, EFalse, TSmsDataCodingScheme::ESmsClass0, 0, ETrue, TMsvSmsEntry::ENoAckSummary, EFalse, 0))
-		{
-		return EFail;	
-		}
-	entry.SetUserPromptIndicator(EFalse);
-	if(!CheckSmsEntry(entry, EFalse, TSmsDataCodingScheme::ESmsClass0, 0, EFalse, TMsvSmsEntry::ENoAckSummary, EFalse, 0))
-		{
-		return EFail;	
-		}
-	entry.SetProtocolIdentifier(123);
-	if(!CheckSmsEntry(entry, EFalse, TSmsDataCodingScheme::ESmsClass0, 123, EFalse, TMsvSmsEntry::ENoAckSummary, EFalse, 0))
-		{
-		return EFail;	
-		}
-	entry.SetProtocolIdentifier(100);
-	entry.SetUserPromptIndicator(ETrue);
-	if(!CheckSmsEntry(entry, EFalse, TSmsDataCodingScheme::ESmsClass0, 100, ETrue, TMsvSmsEntry::ENoAckSummary, EFalse, 0))
-		{
-		return EFail;	
-		}
-	entry.SetClass(ETrue, TSmsDataCodingScheme::ESmsClass0);
-	if(!CheckSmsEntry(entry, ETrue, TSmsDataCodingScheme::ESmsClass0, 100, ETrue, TMsvSmsEntry::ENoAckSummary, EFalse, 0))
-		{
-		return EFail;	
-		}
-	entry.SetClass(ETrue, TSmsDataCodingScheme::ESmsClass1);
-	if(!CheckSmsEntry(entry, ETrue, TSmsDataCodingScheme::ESmsClass1, 100, ETrue, TMsvSmsEntry::ENoAckSummary, EFalse, 0))
-		{
-		return EFail;	
-		}
-	entry.SetClass(ETrue, TSmsDataCodingScheme::ESmsClass2);
-	if(!CheckSmsEntry(entry, ETrue, TSmsDataCodingScheme::ESmsClass2, 100, ETrue, TMsvSmsEntry::ENoAckSummary, EFalse, 0))
-			{
-		return EFail;	
-		}
-	entry.SetClass(ETrue, TSmsDataCodingScheme::ESmsClass3);
-	if(!CheckSmsEntry(entry, ETrue, TSmsDataCodingScheme::ESmsClass3, 100, ETrue, TMsvSmsEntry::ENoAckSummary, EFalse, 0))
-			{
-		return EFail;	
-		}
-	entry.SetClass(EFalse);
-	if(!CheckSmsEntry(entry, EFalse, TSmsDataCodingScheme::ESmsClass3, 100, ETrue, TMsvSmsEntry::ENoAckSummary, EFalse, 0))
-		{
-		return EFail;	
-		}
-		
-	entry.SetUserPromptIndicator(EFalse);
-	if(!CheckSmsEntry(entry, EFalse, TSmsDataCodingScheme::ESmsClass3, 100, EFalse, TMsvSmsEntry::ENoAckSummary, EFalse, 0))
-			{
-		return EFail;	
-		}
-	entry.SetClass(ETrue, TSmsDataCodingScheme::ESmsClass0);
-	
-	TInt classCounter, upiCounter, classDef, deliverySummary, messageIdValid;
-	TSmsDataCodingScheme::TSmsClass tempClass;
-	TMsvSmsEntry::TMsvSmsEntryAckSummary tempDelivery;
-	TUint8 pidCounter;
-	TInt32 messageId = KLogID1;
-
-	for (classCounter = 0; classCounter < 4; classCounter++)
-		{
-		for (pidCounter = 0; pidCounter < 128; pidCounter++)
-			{
-			for (upiCounter = 0; upiCounter < 2; upiCounter++)
-				{
-				for (classDef = 0; classDef < 2; classDef++)
-					{
-					for( deliverySummary = 0; deliverySummary < 5; ++deliverySummary )
-						{
-						for( messageIdValid = 0; messageIdValid < 2; ++messageIdValid)
-							{
-							entry = TMsvSmsEntry();
-							tempClass = static_cast<TSmsDataCodingScheme::TSmsClass>(classCounter);
-							tempDelivery = static_cast<TMsvSmsEntry::TMsvSmsEntryAckSummary>(deliverySummary);
-							entry.SetClass(classDef, tempClass);
-							entry.SetProtocolIdentifier(pidCounter);
-							entry.SetUserPromptIndicator(upiCounter);
-							entry.SetAckSummary(ESmsAckTypeDelivery, tempDelivery);
-							entry.SetMessageId(messageId, messageIdValid);
-							if(!CheckSmsEntry(entry, classDef, tempClass, pidCounter, upiCounter, tempDelivery, messageIdValid, messageId))
-								{
-								return EFail;	
-								}
-							}
-						}
-					}
-				}
-			}
-		}
-	
-	for (classCounter = 0; classCounter < 4; classCounter++)
-		{
-		for (pidCounter = 0; pidCounter < 128; pidCounter++)
-			{
-			for (upiCounter = 0; upiCounter < 2; upiCounter++)
-				{
-				for (classDef = 0; classDef < 2; classDef++)
-					{
-					for( deliverySummary = 0; deliverySummary < 5; ++deliverySummary )
-						{
-						for( messageIdValid = 0; messageIdValid < 2; ++messageIdValid)
-							{
-							tempClass = static_cast<TSmsDataCodingScheme::TSmsClass>(classCounter);
-							tempDelivery = static_cast<TMsvSmsEntry::TMsvSmsEntryAckSummary>(deliverySummary);
-							entry.SetClass(classDef, tempClass);
-							entry.SetProtocolIdentifier(pidCounter);
-							entry.SetUserPromptIndicator(upiCounter);
-							entry.SetAckSummary(ESmsAckTypeDelivery, tempDelivery);
-							entry.SetMessageId(messageId, messageIdValid);
-							if(!CheckSmsEntry(entry, classDef, tempClass, pidCounter, upiCounter, tempDelivery, messageIdValid, messageId))
-								{
-								return EFail;	
-								}
-							}
-						}
-					}
-				}
-			}
-		}
-
-	iTestStep.INFO_PRINTF1(_L("Test TMsvSmsEntry Passed."));	
-	return EPass;
-	}
--- a/messagingappbase/smsmtm/test/src/t_SmsReplyToServer.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-// Copyright (c) 2005-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 "t_SmsReplyToServer.h"
-#include "t_SmsReplyToStep.h"
- 
-_LIT(KServerName,"t_SmsReplyToServer");
-
-CSmsReplyToServer* CSmsReplyToServer::NewL()
-	{
-	CSmsReplyToServer * server = new (ELeave) CSmsReplyToServer();
-	CleanupStack::PushL(server);
-	server-> ConstructL(KServerName);
-	CleanupStack::Pop(server);
-	return server;
-	}
-	
-LOCAL_C void MainL()
-	{
-	RProcess().DataCaging(RProcess::EDataCagingOn);
-	RProcess().SecureApi(RProcess::ESecureApiOn);
-	CActiveScheduler* sched=NULL;
-	sched=new(ELeave) CActiveScheduler;
-	CActiveScheduler::Install(sched);
-	CSmsReplyToServer* server = NULL;
-	// Create the CTestServer derived server
-	TRAPD(err,server = CSmsReplyToServer::NewL());
-	if(!err)
-		{
-		// Sync with the client and enter the active scheduler
-		RProcess::Rendezvous(KErrNone);
-		sched->Start();
-		}
-	delete server;
-	server = NULL;
-	delete sched;
-	}
-
-
-GLDEF_C TInt E32Main()
-	{
-	__UHEAP_MARK;
-	CTrapCleanup* cleanup = CTrapCleanup::New();
-	if(cleanup == NULL)
-		{
-		return KErrNoMemory;
-		}
-	TRAPD(err,MainL());
-	delete cleanup;
-	__UHEAP_MARKEND;
-	return err;
-    }
-    
-RFs& CSmsReplyToServer::Fs()
-	{
-	return iFs;
-	};	
-
-CTestStep* CSmsReplyToServer::CreateTestStep(const TDesC& aStepName)
-	{
-		
-	CSmsReplyToStep* testStep = NULL; 	
-	
-	if(aStepName == KSmsReplyToStep1)
-		{
-		testStep = new CSmsReplyToStep();	
-		testStep->InitialiseReplyToStepL();		
-		}
-	
-	return (CTestStep*)testStep;
-	}
--- a/messagingappbase/smsmtm/test/src/t_SmsReplyToStep.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,442 +0,0 @@
-// Copyright (c) 2005-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 <testexecutelog.h>
-#include "t_SmsReplyToStep.h"
-#include <smuthdr.h>
-#include <txtrich.h>
-#include <msvuids.h>
-#include <smsuaddr.h>
-#include <csmsaccount.h>
-#include "gsmuIEOperations.h"
-#include <CommsDatTypesV1_1.h>
-
-using namespace CommsDat;
-LOCAL_D RTest test(_L("TestTextE_1_1"));
-_LIT(KTestMessageDir,"");
-
-const TTimeIntervalMicroSeconds32 KWaitForWatchersToStart = 20000000;
-const TTimeIntervalMicroSeconds32 KWaitForWatchersToStartDisplayInterval = 5000000;
-
-_LIT(KMessageData, "This is a simple text message");
-_LIT(KRecipientOk,		"+44111111111");  // has to be valid number and switched on
-
-		
-void EntryObserver::HandleEntryEventL(TMsvEntryEvent aEvent, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
-	{
-	switch (aEvent)
-		{
-			case EMsvEntryChanged:
-				{
-				break;
-				}
-			case EMsvNewChildren:
-				{	
-				CActiveScheduler::Stop();
-				break;
-				}
-						
-		default:
-				{
-				break;
-				}
-		}
-	}
-		
-CSmsReplyToStep::CSmsReplyToStep()
-:CTestStep()
-	{	
-	}
-		
-CSmsReplyToStep::~CSmsReplyToStep()
-	{
-	delete iTestUtils;
-	delete iEntry;
-	delete iScheduler;
-	delete iEntryObserver;
-	delete iSessionObserver;
-	delete iSession;
-	delete iWatchers;
-	delete iOperation;
-	delete iTestActive;
-	test.End();
-	test.Close();
-	__UHEAP_MARKEND;
-	}
-
-void CSmsReplyToStep::InitialiseReplyToStepL()
-{
-	SetTestStepName(KSmsReplyToStep1);
-	iScheduler = new (ELeave) CActiveScheduler;
-	CActiveScheduler::Install(iScheduler);	
-}
-	
-void CSmsReplyToStep::InitialiseTestL()
-	{
-	INFO_PRINTF1(_L("Initialising the test..."));
-	iTestUtils = CSmsTestUtils::NewL(test);	
-	// Notify the system agent that the phone is on.
-	iTestUtils->NotifySaPhoneOnL();
-	
-	// Restore the service settings.
-	iTestUtils->SetEntryL(iTestUtils->iSmsServiceId);
-	CSmsAccount* account = CSmsAccount::NewLC();
-	account->LoadSettingsL(*iTestUtils->iServiceSettings);
-	
-	// Remove the default service centres from the service settings
-	TInt count = iTestUtils->iServiceSettings->ServiceCenterCount();
-	while( count-- )
-		{
-		iTestUtils->iServiceSettings->RemoveServiceCenter(count);
-		}
-		
-	// Add the Vodafone service centre - store the settings.
-	iTestUtils->iServiceSettings->AddServiceCenterL(_L("Vodafone"), _L("+447785016005"));
-
-	// Set delivery options - do matching and make reports visible.	
-	iTestUtils->iServiceSettings->SetDeliveryReport(ETrue);
-	iTestUtils->iServiceSettings->SetStatusReportHandling(CSmsSettings::EMoveReportToInboxVisibleAndMatch);
-
-	account->SaveSettingsL(*iTestUtils->iServiceSettings);
-	CleanupStack::PopAndDestroy(account);
-
-	// set up an opserver to observe the inbox
-	iEntryObserver = new (ELeave) EntryObserver();
-	iSessionObserver = new (ELeave) SessionObserver();
-	iSession = CMsvSession::OpenSyncL(*iSessionObserver);
-	TMsvSelectionOrdering ordering;	
-	iEntry = CMsvEntry::NewL(*iSession, KMsvGlobalInBoxIndexEntryIdValue,ordering);
-	iEntry->AddObserverL(*iEntryObserver);
-	
-	//used for acynchronous calls
-	iTestActive=new(ELeave) CTestActive;
-	
-	INFO_PRINTF1(_L("Successfully initialised test"));
-	
-}
-	
-void CSmsReplyToStep::InitialiseSimTsyL()
-	{
-	
-	INFO_PRINTF1(_L("Initialising the SimTsy..."));
-	
-	_LIT(KDefaultTsyName, "SIM"); 
-	HBufC* tsyName =KDefaultTsyName().AllocLC();
-
-	//Initialize TSY using the System Agent
-	TInt testState;
-	TInt testNumber=1;
-	if(KErrNone != RProperty::Get(KUidPSSimTsyCategory, KPSSimTsyTestNumber, testState))
-		{
-		User::LeaveIfError(RProperty::Define(KUidPSSimTsyCategory, KPSSimTsyTestNumber, RProperty::EInt));
-		}
-	User::LeaveIfError(RProperty::Set(KUidPSSimTsyCategory, KPSSimTsyTestNumber, testNumber));
-	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, testNumber));
-
-	RTelServer etelServer;
-	User::LeaveIfError(etelServer.Connect());
-	CleanupClosePushL(etelServer);
-	User::LeaveIfError(etelServer.LoadPhoneModule(tsyName->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(tsyName->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());
-			//Required Pause to Allow SMSStack to Complete its Async Init call to the TSY and finish its StartUp.
-			TTimeIntervalMicroSeconds32 InitPause=9000000;  
-			User::After(InitPause);							
-			
-			CleanupStack::PopAndDestroy(&iPhone);
-			}
-		}
-	
-	CleanupStack::PopAndDestroy(&etelServer);	
-
-	CMDBSession* dbSession = CMDBSession::NewL(CMDBSession::LatestVersion());
-	CleanupStack::PushL(dbSession);
-	CMDBRecordSet<CCDGlobalSettingsRecord> globalSettingsRecord(KCDTIdGlobalSettingsRecord);
-	TRAPD(err, globalSettingsRecord.LoadL(*dbSession));
-	if(err != KErrNone)
-		{
-		User::Leave(KErrNotFound);				
-		}
-	
-	CCDModemBearerRecord *modemRecord = static_cast<CCDModemBearerRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdModemBearerRecord));		
-	CleanupStack::PushL(modemRecord);
-	modemRecord->SetRecordId(((CCDGlobalSettingsRecord*)globalSettingsRecord.iRecords[0])->iModemForPhoneServicesAndSMS);
-	modemRecord->LoadL(*dbSession);
-	modemRecord->iTsyName.SetMaxLengthL(tsyName->Des().Length());
-	modemRecord->iTsyName = tsyName->Des();	
-	modemRecord->ModifyL(*dbSession);
-	CleanupStack::PopAndDestroy(3);  //tsyName, dbSession, modemRecord 	
-	
-	INFO_PRINTF1(_L("Successfully initialised the Sim Tsy"));
-	}
-	
-void CSmsReplyToStep::StartWatcherL()
-	{
-	INFO_PRINTF1(_L("Start the Watcher"));
-
-	if( WatchersAlreadyRunningL() )
-		{
-		INFO_PRINTF1(_L("Watchers are already running\n"));
-		return;
-		}
-
-	iWatchers = CTestUtilsWatcherStarter::NewL();
-
-	TTimeIntervalMicroSeconds32 wait = KWaitForWatchersToStart;
-	TBool started = EFalse;
-	while( !started && wait.Int() > 0 )
-		{
-		INFO_PRINTF2(_L("Waiting %d secs for watchers to start..."), wait.Int() / 1000000);
-		wait = wait.Int() - KWaitForWatchersToStartDisplayInterval.Int();
-		User::After(KWaitForWatchersToStartDisplayInterval);
-		started = WatchersAlreadyRunningL();
-		}
-
-	if( !WatchersAlreadyRunningL() )
-		{
-		INFO_PRINTF1(_L("WARNING: NBS Watcher has not started yet\n"));
-		}
-	}
-	
-TBool CSmsReplyToStep::WatchersAlreadyRunningL()
-	{
-	RSocketServ server;
-	RSocket socket;
-
-	User::LeaveIfError(server.Connect());
-	CleanupClosePushL(server);
-
-		// test if it's there... 
-	TProtocolDesc protoInfo;
-	TProtocolName protocolname;
-	protocolname.Copy(KSmsDatagram);
-	User::LeaveIfError(server.FindProtocol(protocolname,protoInfo));
-
-	User::LeaveIfError(socket.Open(server,
-										protoInfo.iAddrFamily,
-										protoInfo.iSockType, 
-										protoInfo.iProtocol));
-	CleanupClosePushL(socket);
-	
-
-	TSmsAddr addr;
-	addr.SetSmsAddrFamily(ESmsAddrRecvAny);
-	TInt err = socket.Bind(addr);
-
-	CleanupStack::Pop(2, &server);
-	socket.CancelAll();
-	socket.Close();
-	server.Close();
-	return (err == KErrAlreadyExists);
-	}
-
-void CSmsReplyToStep::SetRecipientsL(CSmsHeader& aHeader)
-	{
-	iTestUtils->Printf(_L("--Setting single recipient\n"));
-	
-	CSmsNumber* rcpt = CSmsNumber::NewL();
-	CleanupStack::PushL(rcpt);
-	rcpt->SetAddressL(KRecipientOk);
-	aHeader.Recipients().AppendL(rcpt);
-	CleanupStack::Pop(rcpt);
-	}
-	
-void CSmsReplyToStep::CreateMessageL()
-	{
-	INFO_PRINTF1(_L("Creating message..."));
-	
-	TMsvEntry entry;
-	entry.SetVisible(ETrue); 
-	entry.SetInPreparation(ETrue); 
-	entry.iServiceId = iTestUtils->iSmsServiceId; 
-	entry.iType = KUidMsvMessageEntry; 
-	entry.iMtm = KUidMsgTypeSMS; 
-	entry.iDate.HomeTime(); 
-	entry.iSize = 0; 
-	entry.iDescription.Set(KNullDesC); 
-	entry.iDetails.Set(KNullDesC); 
-	entry.SetSendingState(KMsvSendStateScheduled);
-
-	// Create the SMS header object...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils->iRichText);
-	CleanupStack::PushL(header);
-	
-	// Set the body text...
-	iTestUtils->iRichText->Reset();
-	iTestUtils->iRichText->InsertL(0, KMessageData);
-	
-	// Copy the message settings...
-	header->SetSmsSettingsL(*iTestUtils->iServiceSettings); 
-	
-	// Set the service centre
-	TInt defaultIndex = iTestUtils->iServiceSettings->DefaultServiceCenter();
-	header->SetServiceCenterAddressL(iTestUtils->iServiceSettings->GetServiceCenter(defaultIndex).Address());
-
-	// Set recipient - ask derived class
-	SetRecipientsL(*header);
-	
-	// Update entry description and details...
-	CArrayPtrFlat<CSmsNumber>& recipient = header->Recipients();
-	entry.iDetails.Set(recipient[0]->Address());
-	entry.iDescription.Set(iTestUtils->iRichText->Read(0, iTestUtils->iServiceSettings->DescriptionLength()));
-	entry.SetInPreparation(EFalse);
-	
-	// Create the entry - set context to the global outbox.
-	iTestUtils->iMsvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);
-	iTestUtils->iMsvEntry->CreateL(entry);
-
-	// Create new store and save header information 
-	iTestUtils->iMsvEntry->SetEntryL(entry.Id()); 
-	CMsvStore* store = iTestUtils->iMsvEntry->EditStoreL(); 
-	CleanupStack::PushL(store); 
-	header->StoreL(*store);
-	store->StoreBodyTextL(*iTestUtils->iRichText);
-	store->CommitL(); 
-	CleanupStack::PopAndDestroy(2, header); 
-	
-	iMessageId = entry.Id();
-
-	}
-	
-void CSmsReplyToStep::SendMessageL()
-	{
-	INFO_PRINTF1(_L("Sending message..."));
-
-	delete iOperation;
-	iOperation = NULL;
-
-	CMsvEntrySelection* sel = new (ELeave) CMsvEntrySelection();
-	CleanupStack::PushL(sel);
-	sel->AppendL(iMessageId);
-	iTestUtils->DisplayMessageL(iMessageId);
-	iTestUtils->iMsvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);
-	iOperation = iTestUtils->iMsvEntry->CopyL(*sel, iTestUtils->iSmsServiceId,iTestActive->iStatus);
-	iTestActive->StartL();
-	CActiveScheduler::Start();	
-	CleanupStack::PopAndDestroy(sel);
-	}
-
-TBool CSmsReplyToStep::CheckMessageL()
-	{
-
-	INFO_PRINTF1(_L("Received new message in Inbox - should be status report..."));
-		
-	TMsvSelectionOrdering ordering;	
-	ordering.ShowInvisibleEntries();
-	CMsvEntry* entry = CMsvEntry::NewL(*iSession, KMsvGlobalInBoxIndexEntryId,ordering);
-	CleanupStack::PushL(entry);
-	
-	CMsvEntrySelection* msvEntrySelection;
-	msvEntrySelection=entry->ChildrenL();
-	CleanupStack::PushL(msvEntrySelection);
-	
-	// Check how many mesasges there are - should be just 1
-	TInt count = msvEntrySelection->Count();
-	INFO_PRINTF3(_L("Number of new messages: %d, should be: %d"), count, 1);
-
-	// Restore the message
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *iTestUtils->iRichText);
-	CleanupStack::PushL(header);
-	entry->SetEntryL((*msvEntrySelection)[0]);
-
-	CMsvStore* store = entry->ReadStoreL();
-	CleanupStack::PushL(store);	
-	header->RestoreL(*store);
-	
-	if(store->HasBodyTextL())
-		{
-		store->RestoreBodyTextL(*iTestUtils->iRichText);	
-		}
-		
-	TBuf<KSmsDescriptionLength> desc;
-	User::LeaveIfError(TSmsUtilities::GetDescription(header->Message(), desc));
-	
-	//Check for a reply address field
-	CSmsReplyAddressOperations& operations = STATIC_CAST(CSmsReplyAddressOperations&,header->Message().GetOperationsForIEL(CSmsInformationElement::ESmsReplyAddressFormat));
-	TBool result=operations.ContainsReplyAddressIEL();
-
-	CleanupStack::PopAndDestroy(4,entry);	
-	return result;	
-	}
-
-TVerdict CSmsReplyToStep::doTestStepPreambleL()
-	{	
-	__UHEAP_MARK;
-	SetTestStepResult(EPass);
-	test.Start(_L("sdf"));
-	InitialiseTestL();
-	InitialiseSimTsyL();
-	StartWatcherL();
-	iTestUtils->DeleteSmsMessagesL(KMsvGlobalOutBoxIndexEntryId);
-	iTestUtils->DeleteSmsMessagesL(KMsvGlobalInBoxIndexEntryId);
-	iTestUtils->DeleteSmsMessagesL(KMsvSentEntryId);
-	CreateMessageL();
-	SendMessageL();
-	//wait for message to be received...
-	CActiveScheduler::Start();	
-
-	return TestStepResult();
-	}
-		
-
-TVerdict CSmsReplyToStep::doTestStepL()
-	{		
-	if(CheckMessageL())
-		{
-		SetTestStepResult(EPass);	
-		}
-	else
-		{
-		SetTestStepResult(EFail);			
-		}
-	
-	return TestStepResult();
-	}	
-
-TVerdict CSmsReplyToStep::doTestStepPostambleL()
-/**
- * @return - TVerdict code
- * Override of base class virtual
- */
-	{
-	return TestStepResult();
-	}
-	
-	
-
-
--- a/messagingappbase/smsmtm/test/src/t_SmsSpecialIndicationsServer.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-// Copyright (c) 2005-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 "t_smsspecialindicationsserver.h"
-#include "t_smsspecialindicationsstep.h"
- 
-_LIT(KServerName,"t_SmsSpecialIndicationsServer");
-
-CSmsSpecialIndicationsServer* CSmsSpecialIndicationsServer::NewL()
-	{
-	CSmsSpecialIndicationsServer * server = new (ELeave) CSmsSpecialIndicationsServer();
-	CleanupStack::PushL(server);
-	server-> ConstructL(KServerName);
-	CleanupStack::Pop(server);
-	return server;
-	}
-	
-LOCAL_C void MainL()
-	{
-	RProcess().DataCaging(RProcess::EDataCagingOn);
-	RProcess().SecureApi(RProcess::ESecureApiOn);
-	CActiveScheduler* sched=NULL;
-	sched=new(ELeave) CActiveScheduler;
-	CActiveScheduler::Install(sched);
-	CSmsSpecialIndicationsServer* server = NULL;
-	// Create the CTestServer derived server
-	TRAPD(err,server = CSmsSpecialIndicationsServer::NewL());
-	if(!err)
-		{
-		// Sync with the client and enter the active scheduler
-		RProcess::Rendezvous(KErrNone);
-		sched->Start();
-		}
-	delete server;
-	server = NULL;
-	delete sched;
-	}
-
-
-GLDEF_C TInt E32Main()
-	{
-	__UHEAP_MARK;
-	CTrapCleanup* cleanup = CTrapCleanup::New();
-	if(cleanup == NULL)
-		{
-		return KErrNoMemory;
-		}
-	TRAPD(err,MainL());
-	delete cleanup;
-	__UHEAP_MARKEND;
-	return err;
-    }
-    
-RFs& CSmsSpecialIndicationsServer::Fs()
-	{
-	return iFs;
-	};	
-
-CTestStep* CSmsSpecialIndicationsServer::CreateTestStep(const TDesC& aStepName)
-	{
-		
-	CSmsSpecialIndicationsStep* testStep = NULL; 	
-	
-	if(aStepName == KSmsSpecialIndicationsStep1)
-	{
-		testStep = new CSmsSpecialIndicationsStep();	
-		testStep->InitialiseSpecialIndicationsStepL();		
-	}
-	
-	return (CTestStep*)testStep;
-	}
--- a/messagingappbase/smsmtm/test/src/t_SmsSpecialIndicationsStep.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,448 +0,0 @@
-// Copyright (c) 2005-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 <testexecutelog.h>
-#include "t_smsspecialindicationsstep.h"
-#include <smuthdr.h>
-#include <txtrich.h>
-#include <msvuids.h>
-#include <smsuaddr.h>
-#include <csmsaccount.h>
-#include "gsmuieoperations.h"
-#include <commsdattypesv1_1.h>
-
-using namespace CommsDat;
-LOCAL_D RTest test(_L("TestTextE_1_1"));
-_LIT(KTestMessageDir,"");
-
-const TTimeIntervalMicroSeconds32 KWaitForWatchersToStart = 20000000;
-const TTimeIntervalMicroSeconds32 KWaitForWatchersToStartDisplayInterval = 5000000;
-
-_LIT(KMessageData, "This is a simple text message");
-_LIT(KRecipientOk,		"+44111111111");  // has to be valid number and switched on
-
-		
-void EntryObserver::HandleEntryEventL(TMsvEntryEvent aEvent, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
-	{
-	switch (aEvent)
-		{
-			case EMsvEntryChanged:
-				{
-				break;
-				}
-			case EMsvNewChildren:
-				{	
-				CActiveScheduler::Stop();
-				break;
-				}
-						
-		default:
-				{
-				break;
-				}
-		}
-	}
-		
-CSmsSpecialIndicationsStep::CSmsSpecialIndicationsStep()
-:CTestStep()
-	{	
-	}
-		
-CSmsSpecialIndicationsStep::~CSmsSpecialIndicationsStep()
-	{
-	delete iTestUtils;
-	delete iEntry;
-	delete iScheduler;
-	delete iEntryObserver;
-	delete iSessionObserver;
-	delete iSession;
-	delete iWatchers;
-	delete iOperation;
-	delete iTestActive;
-	test.End();
-	test.Close();
-	__UHEAP_MARKEND;
-	}
-
-void CSmsSpecialIndicationsStep::InitialiseSpecialIndicationsStepL()
-	{	
-	SetTestStepName(KSmsSpecialIndicationsStep1);
-	iScheduler = new (ELeave) CActiveScheduler;
-	CActiveScheduler::Install(iScheduler);
-	}	
-	
-void CSmsSpecialIndicationsStep::InitialiseTestL()
-	{
-	INFO_PRINTF1(_L("Initialising the test..."));
-	iTestUtils = CSmsTestUtils::NewL(test);	
-	// Notify the system agent that the phone is on.
-	iTestUtils->NotifySaPhoneOnL();
-	
-	// Restore the service settings.
-	iTestUtils->SetEntryL(iTestUtils->iSmsServiceId);
-	CSmsAccount* account = CSmsAccount::NewLC();
-	account->LoadSettingsL(*iTestUtils->iServiceSettings);
-	
-	// Remove the default service centres from the service settings
-	TInt count = iTestUtils->iServiceSettings->ServiceCenterCount();
-	while( count-- )
-		{
-		iTestUtils->iServiceSettings->RemoveServiceCenter(count);
-		}
-		
-	// Add the Vodafone service centre - store the settings.
-	iTestUtils->iServiceSettings->AddServiceCenterL(_L("Vodafone"), _L("+447785016005"));
-
-	// Set delivery options - do matching and make reports visible.	
-	iTestUtils->iServiceSettings->SetDeliveryReport(ETrue);
-	iTestUtils->iServiceSettings->SetStatusReportHandling(CSmsSettings::EMoveReportToInboxVisibleAndMatch);
-
-	account->SaveSettingsL(*iTestUtils->iServiceSettings);
-	CleanupStack::PopAndDestroy(account);
-
-	// set up an opserver to observe the inbox
-	iEntryObserver = new (ELeave) EntryObserver();
-	iSessionObserver = new (ELeave) SessionObserver();
-	iSession = CMsvSession::OpenSyncL(*iSessionObserver);
-	TMsvSelectionOrdering ordering;	
-	iEntry = CMsvEntry::NewL(*iSession, KMsvGlobalInBoxIndexEntryIdValue,ordering);
-	iEntry->AddObserverL(*iEntryObserver);
-	
-	//used for acynchronous calls
-	iTestActive=new(ELeave) CTestActive;
-	
-	INFO_PRINTF1(_L("Successfully initialised test"));
-	
-}
-	
-void CSmsSpecialIndicationsStep::InitialiseSimTsyL()
-	{
-	
-	INFO_PRINTF1(_L("Initialising the SimTsy..."));
-	
-	_LIT(KDefaultTsyName, "SIM"); 
-	HBufC* tsyName =KDefaultTsyName().AllocLC();
-
-	//Initialize TSY using the System Agent
-	TInt testState;
-	TInt testNumber=1;
-	if(KErrNone != RProperty::Get(KUidPSSimTsyCategory, KPSSimTsyTestNumber, testState))
-		{
-		User::LeaveIfError(RProperty::Define(KUidPSSimTsyCategory, KPSSimTsyTestNumber, RProperty::EInt));
-		}
-	User::LeaveIfError(RProperty::Set(KUidPSSimTsyCategory, KPSSimTsyTestNumber, testNumber));
-	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, testNumber));
-
-	RTelServer etelServer;
-	User::LeaveIfError(etelServer.Connect());
-	CleanupClosePushL(etelServer);
-	User::LeaveIfError(etelServer.LoadPhoneModule(tsyName->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(tsyName->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());
-			//Required Pause to Allow SMSStack to Complete its Async Init call to the TSY and finish its StartUp.
-			TTimeIntervalMicroSeconds32 InitPause=9000000;  
-			User::After(InitPause);							
-			
-			CleanupStack::PopAndDestroy(&iPhone);
-			}
-		}
-	
-	CleanupStack::PopAndDestroy(&etelServer);	
-
-	CMDBSession* dbSession = CMDBSession::NewL(CMDBSession::LatestVersion());
-	CleanupStack::PushL(dbSession);
-	CMDBRecordSet<CCDGlobalSettingsRecord> globalSettingsRecord(KCDTIdGlobalSettingsRecord);
-	TRAPD(err, globalSettingsRecord.LoadL(*dbSession));
-	if(err != KErrNone)
-		{
-		User::Leave(KErrNotFound);				
-		}
-	
-	CCDModemBearerRecord *modemRecord = static_cast<CCDModemBearerRecord*>(CCDRecordBase::RecordFactoryL(KCDTIdModemBearerRecord));		
-	CleanupStack::PushL(modemRecord);	
-	modemRecord->SetRecordId(((CCDGlobalSettingsRecord*)globalSettingsRecord.iRecords[0])->iModemForPhoneServicesAndSMS);
-	modemRecord->LoadL(*dbSession);
-	modemRecord->iTsyName.SetMaxLengthL(tsyName->Des().Length());
-	modemRecord->iTsyName = tsyName->Des();	
-	modemRecord->ModifyL(*dbSession);
-	CleanupStack::PopAndDestroy(3);  //tsyName, dbSession, modemRecord 	
-	
-	INFO_PRINTF1(_L("Successfully initialised the Sim Tsy"));
-	}
-	
-void CSmsSpecialIndicationsStep::StartWatcherL()
-	{
-	INFO_PRINTF1(_L("Start the Watcher"));
-
-	if( WatchersAlreadyRunningL() )
-		{
-		INFO_PRINTF1(_L("Watchers are already running\n"));
-		return;
-		}
-
-	iWatchers = CTestUtilsWatcherStarter::NewL();
-
-	TTimeIntervalMicroSeconds32 wait = KWaitForWatchersToStart;
-	TBool started = EFalse;
-	while( !started && wait.Int() > 0 )
-		{
-		INFO_PRINTF2(_L("Waiting %d secs for watchers to start..."), wait.Int() / 1000000);
-		wait = wait.Int() - KWaitForWatchersToStartDisplayInterval.Int();
-		User::After(KWaitForWatchersToStartDisplayInterval);
-		started = WatchersAlreadyRunningL();
-		}
-
-	if( !WatchersAlreadyRunningL() )
-		{
-		INFO_PRINTF1(_L("WARNING: NBS Watcher has not started yet\n"));
-		}
-	}
-	
-TBool CSmsSpecialIndicationsStep::WatchersAlreadyRunningL()
-	{
-	RSocketServ server;
-	RSocket socket;
-
-	User::LeaveIfError(server.Connect());
-	CleanupClosePushL(server);
-
-		// test if it's there... 
-	TProtocolDesc protoInfo;
-	TProtocolName protocolname;
-	protocolname.Copy(KSmsDatagram);
-	User::LeaveIfError(server.FindProtocol(protocolname,protoInfo));
-
-	User::LeaveIfError(socket.Open(server,
-										protoInfo.iAddrFamily,
-										protoInfo.iSockType, 
-										protoInfo.iProtocol));
-	CleanupClosePushL(socket);
-	
-
-	TSmsAddr addr;
-	addr.SetSmsAddrFamily(ESmsAddrRecvAny);
-	TInt err = socket.Bind(addr);
-
-	CleanupStack::Pop(2, &server);
-	socket.CancelAll();
-	socket.Close();
-	server.Close();
-	return (err == KErrAlreadyExists);
-	}
-
-void CSmsSpecialIndicationsStep::SetRecipientsL(CSmsHeader& aHeader)
-	{
-	iTestUtils->Printf(_L("--Setting single recipient\n"));
-	
-	CSmsNumber* rcpt = CSmsNumber::NewL();
-	CleanupStack::PushL(rcpt);
-	rcpt->SetAddressL(KRecipientOk);
-	aHeader.Recipients().AppendL(rcpt);
-	CleanupStack::Pop(rcpt);
-	}
-	
-void CSmsSpecialIndicationsStep::CreateMessageL()
-	{
-	INFO_PRINTF1(_L("Creating message..."));
-	
-	TMsvEntry entry;
-	entry.SetVisible(ETrue); 
-	entry.SetInPreparation(ETrue); 
-	entry.iServiceId = iTestUtils->iSmsServiceId; 
-	entry.iType = KUidMsvMessageEntry; 
-	entry.iMtm = KUidMsgTypeSMS; 
-	entry.iDate.HomeTime(); 
-	entry.iSize = 0; 
-	entry.iDescription.Set(KNullDesC); 
-	entry.iDetails.Set(KNullDesC); 
-	entry.SetSendingState(KMsvSendStateScheduled);
-
-	// Create the SMS header object...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils->iRichText);
-	CleanupStack::PushL(header);
-	
-	// Set the body text...
-	iTestUtils->iRichText->Reset();
-	iTestUtils->iRichText->InsertL(0, KMessageData);
-	
-	// Copy the message settings...
-	header->SetSmsSettingsL(*iTestUtils->iServiceSettings); 
-	
-	// Set the service centre
-	TInt defaultIndex = iTestUtils->iServiceSettings->DefaultServiceCenter();
-	header->SetServiceCenterAddressL(iTestUtils->iServiceSettings->GetServiceCenter(defaultIndex).Address());
-
-	// Set recipient - ask derived class
-	SetRecipientsL(*header);
-	
-	// Update entry description and details...
-	CArrayPtrFlat<CSmsNumber>& recipient = header->Recipients();
-	entry.iDetails.Set(recipient[0]->Address());
-	entry.iDescription.Set(iTestUtils->iRichText->Read(0, iTestUtils->iServiceSettings->DescriptionLength()));
-	entry.SetInPreparation(EFalse);
-	
-	// Create the entry - set context to the global outbox.
-	iTestUtils->iMsvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);
-	iTestUtils->iMsvEntry->CreateL(entry);
-
-	// Create new store and save header information 
-	iTestUtils->iMsvEntry->SetEntryL(entry.Id()); 
-	CMsvStore* store = iTestUtils->iMsvEntry->EditStoreL(); 
-	CleanupStack::PushL(store); 
-	header->StoreL(*store);
-	store->StoreBodyTextL(*iTestUtils->iRichText);
-	store->CommitL(); 
-	CleanupStack::PopAndDestroy(2, header); 
-	
-	iMessageId = entry.Id();
-
-	}
-	
-void CSmsSpecialIndicationsStep::SendMessageL()
-	{
-	INFO_PRINTF1(_L("Sending message..."));
-
-	delete iOperation;
-	iOperation = NULL;
-
-	CMsvEntrySelection* sel = new (ELeave) CMsvEntrySelection();
-	CleanupStack::PushL(sel);
-	sel->AppendL(iMessageId);
-	iTestUtils->DisplayMessageL(iMessageId);
-	iTestUtils->iMsvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);
-	iOperation = iTestUtils->iMsvEntry->CopyL(*sel, iTestUtils->iSmsServiceId,iTestActive->iStatus);
-	iTestActive->StartL();
-	CActiveScheduler::Start();	
-	CleanupStack::PopAndDestroy(sel);
-	}
-
-TBool CSmsSpecialIndicationsStep::CheckMessageL()
-	{
-
-	INFO_PRINTF1(_L("Received new message in Inbox - should be status report..."));
-		
-	TMsvSelectionOrdering ordering;	
-	ordering.ShowInvisibleEntries();
-	CMsvEntry* entry = CMsvEntry::NewL(*iSession, KMsvGlobalInBoxIndexEntryId,ordering);
-	CleanupStack::PushL(entry);
-	
-	CMsvEntrySelection* msvEntrySelection;
-	msvEntrySelection=entry->ChildrenL();
-	CleanupStack::PushL(msvEntrySelection);
-	
-	// Check how many mesasges there are - should be just 1
-	TInt count = msvEntrySelection->Count();
-	INFO_PRINTF3(_L("Number of new messages: %d, should be: %d"), count, 1);
-
-	// Restore the message
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, *iTestUtils->iRichText);
-	CleanupStack::PushL(header);
-	entry->SetEntryL((*msvEntrySelection)[0]);
-
-	CMsvStore* store = entry->ReadStoreL();
-	CleanupStack::PushL(store);	
-	header->RestoreL(*store);
-	
-	if(store->HasBodyTextL())
-		{
-		store->RestoreBodyTextL(*iTestUtils->iRichText);	
-		}
-		
-	TBuf<KSmsDescriptionLength> desc;
-	User::LeaveIfError(TSmsUtilities::GetDescription(header->Message(), desc));
-	CleanupStack::PopAndDestroy(4,entry);	
-	
-	INFO_PRINTF1(desc);
-	
-	_LIT(KMsg,"14 Messages Waiting");
-	if(desc==KMsg)
-		{
-		return ETrue;	
-		}
-	else
-		{
-		return EFalse;		
-		}	
-	}
-
-TVerdict CSmsSpecialIndicationsStep::doTestStepPreambleL()
-	{	
-	__UHEAP_MARK;
-	SetTestStepResult(EPass);
-	test.Start(_L("sdf"));
-	InitialiseTestL();
-	InitialiseSimTsyL();
-	StartWatcherL();
-	iTestUtils->DeleteSmsMessagesL(KMsvGlobalOutBoxIndexEntryId);
-	iTestUtils->DeleteSmsMessagesL(KMsvGlobalInBoxIndexEntryId);
-	iTestUtils->DeleteSmsMessagesL(KMsvSentEntryId);
-	CreateMessageL();
-	SendMessageL();
-	//wait for message to be received...
-	CActiveScheduler::Start();	
-
-	return TestStepResult();
-	}
-		
-
-TVerdict CSmsSpecialIndicationsStep::doTestStepL()
-	{		
-	if(CheckMessageL())
-		{
-		SetTestStepResult(EPass);	
-		}
-	else
-		{
-		SetTestStepResult(EFail);			
-		}
-	
-	return TestStepResult();
-	}	
-
-TVerdict CSmsSpecialIndicationsStep::doTestStepPostambleL()
-/**
- * @return - TVerdict code
- * Override of base class virtual
- */
-	{
-	return TestStepResult();
-	}
-	
-	
-
-
--- a/messagingappbase/smsmtm/test/src/t_smcmrecvmanual.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,844 +0,0 @@
-// Copyright (c) 1999-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 "t_smcmrecvmanual.h"
-#include <msvuids.h>
-#include <smuthdr.h>
-#include <smscmds.h>
-#include <msgtestscripts.h>
-#include <txtrich.h>
-
-_LIT(KSmcmRecvOnlyTestName, "Receive SMS Messages");
-_LIT(KHelpText, "\n[1] Start Watchers\n[2] Stop Watchers\n[3] Send myself message\n[D] Display Unmatched Messages\ne[X]it\n");
-_LIT(KMessageText, "\n[1] Short Message\n[2] Long Message\n[3] Message Indication\n[4] Replace Type\n[5] From sendrecv.script\n[D] Display Unmatched Messages\ne[X]it\n");
-_LIT(KSmsScript, "sendrecv.script");
-_LIT(KDefaultScript, "defaults.script");
-_LIT(KRecipients, "Recipients");
-_LIT(KServiceCenter, "SC");
-const TInt KWaitAfterRecv = 100000; //< 0.1 second
-
-RTest test(_L("T_SmcmRecvManual: Receive SMS Messages"));
-CTrapCleanup* theCleanup;
-
-LOCAL_C void doMainL()
-	{
-	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
-	CleanupStack::PushL(scheduler);
-	CActiveScheduler::Install( scheduler );
-
-	CSmsTestUtils* smsTest = CSmsTestUtils::NewL(test);
-	CleanupStack::PushL(smsTest);
-	TInt nextTest = 0;
-	
-	smsTest->NotifySaPhoneOnL();
-
-	CSmcmRecvOnly* scTest = CSmcmRecvOnly::NewLC(*smsTest, KSmsScript, nextTest);
-
-	scTest->StartL();
-
-	CActiveScheduler::Start();
-
-	CleanupStack::PopAndDestroy(3); //SmsTest, scheduler
-	}
-
-GLDEF_C TInt E32Main()
-	{	
-	__UHEAP_MARK;
-	test.Start(_L("Setup"));
-	theCleanup = CTrapCleanup::New();
-	TRAPD(ret,doMainL());		
-	test(ret==KErrNone);
-	delete theCleanup;	
-	test.Console()->SetPos(0, 13);
-	test.End();
-	test.Close();
-	__UHEAP_MARKEND;
-	return(KErrNone);
-	}
-
-CSmcmRecvOnly::~CSmcmRecvOnly()
-/**
- * CSmcmRecvOnly destructor
- */
-	{
-	Cancel();
-	delete iRecvActive;
-	delete iWatchers;
-	delete iOperation;
-	iOperation = NULL;
-
-	delete iRecipient;
-	delete iServiceCenter;
-
-	delete iSelection;
-	iSelection = NULL;
-	}
-
-CSmcmRecvOnly* CSmcmRecvOnly::NewLC(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest)
-/**
- * CSmcmRecvOnly factory function
- */
-	{
-	CSmcmRecvOnly* self = new (ELeave) CSmcmRecvOnly(aSmsTest, aScriptFile, aNextTest);
-	CleanupStack::PushL(self);
-
-	self->ConstructL();
-	return self;
-	}
-
-CSmcmRecvOnly::CSmcmRecvOnly(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest)
-: CSmsTestBase(aSmsTest, aScriptFile, aNextTest)
-/**
- * CSmcmRecvOnly constructor
- */
-	{
-	CActiveScheduler::Add(this);
-	}
-
-void CSmcmRecvOnly::DisplayAndRead(const TDesC& aText)
-/**
- * Displays aText then issues a read on the console
- */
-	{
-	iSmsTest.Printf(aText);
-	Read();
-	}
-
-void CSmcmRecvOnly::RunAutoL()
-	{
-	DisplayAndRead(KHelpText);
-	}
-
-void CSmcmRecvOnly::ConstructL()
-	{
-	iSmsTest.NotifySaPhoneOnL();
-	SetTestNameL(KSmcmRecvOnlyTestName);
-	iSmsTest.InstantiateClientMtmsL();
-
-	iSmsTest.SetLogToFile();
-	iRecvActive = CSmcmRecvActive::NewL(iSmsTest, Priority()-1);
-	iSelection = new (ELeave) CMsvEntrySelection;
-
-	User::After(1000000);
-
-	CScriptFile* script = CScriptFile::NewLC(iSmsTest, KSmsComponent);
-	script->ReadScriptL(KDefaultScript);
-
-	iRecipient = script->ItemValue(KDefaults, KRecipients, KNullDesC).AllocL();
-	iServiceCenter = script->ItemValue(KDefaults, KServiceCenter, KNullDesC).AllocL();
-
-	CleanupStack::PopAndDestroy(script);
-
-	User::After(1000000);
-
-	iSmsTest.Printf(_L("Deleting SMS messages in outbox..."));
-	iSmsTest.DeleteSmsMessagesL(KMsvGlobalOutBoxIndexEntryId);
-
-	User::After(1000000);
-	
-	iSmsTest.Printf(_L("Done\nDeleting SMS messages in sent..."));
-	iSmsTest.DeleteSmsMessagesL(KMsvSentEntryId);
-
-	User::After(1000000);
-	
-	iSmsTest.Printf(_L("Done\nDeleting SMS messages in inbox..."));
-	iSmsTest.DeleteSmsMessagesL(KMsvGlobalInBoxIndexEntryId);
-
-	iSmsTest.Printf(_L("Done\n"));
-	}
-
-void CSmcmRecvOnly::ShowMenuL()
-	{
-	RunAutoL();
-	}
-
-void CSmcmRecvOnly::DoRunMainMenuL(TKeyCode aCode)
-/**
- * Called by RunL when iState == EMainMenu, when there is a key press event.
- * Acts on the user's request.
- */
-	{
-	const TChar ch = TChar(aCode);
-	const TDesC* text = &KHelpText();
-
-	switch (ch)
-		{
-		case '1':
-
-			iSmsTest.Printf(_L("\nStarting Watchers\n"));
-
-			if (iWatchers == NULL)
-				iWatchers = CTestUtilsWatcherStarter::NewL(Priority());
-			else
-				iSmsTest.Printf(_L("OOPS: Watchers already started!!\n"));
-
-			break;
-
-		case '2':
-
-			iSmsTest.Printf(_L("\nStopping Watchers\n"));
-
-			if (iWatchers == NULL)
-				iSmsTest.Printf(_L("OOPS: Watchers not started yet!!\n"));
-			else
-				{
-				delete iWatchers;
-				iWatchers = NULL;
-				}
-			break;
-
-		case '3':
-
-			text = &KMessageText();
-			iState = ESendingMenu;
-			break;
-
-		case 'D':
-		case 'd':
-
-			iRecvActive->DisplayUnmatched();
-			break;
-
-		case 'x':
-		case 'X':
-		case EKeyEscape:
-
-			text = NULL;
-			Complete(KErrNone);
-			break;
-
-		case EKeySpace:
-
-			ReshowMenu();
-			break;
-
-		default:
-
-			Read();
-			break;
-		}
-
-	if (!IsActive() && text != NULL)
-		DisplayAndRead(*text);
-	}
-
-void CSmcmRecvOnly::Read()
-/**
- * Issues an asynchronous read on the console
- */
-	{
-	Cancel();
-	iSmsTest.Test().Console()->Read(iStatus);
-	SetActive();
-	}
-
-void CSmcmRecvOnly::SendReplaceTypeL()
-	{
-	iSmsTest.Printf(_L("\nSendReplaceTypeL\n"));
-	_LIT(KShortMessage, "Replace Type %d");
-	TBuf<64> buf;
-	buf.AppendFormat(KShortMessage, iReplaceTypeCount++);
-
-	const TMsvId id = CreateMessageLC(buf);
-
-	CSmsHeader* header = iSmsTest.GetHeaderLC(id);
-
-	CSmsSubmit& submit = header->Submit();
-	submit.SetPIDType(TSmsProtocolIdentifier::ESmsPIDShortMessageType);
-	submit.SetShortMessageType(TSmsProtocolIdentifier::ESmsReplaceShortMessageType1);
-	StoreMessageL(id, *header);
-	CleanupStack::PopAndDestroy(header);
-
-	iSelection->Reset();
-	iSelection->AppendL(id);
-	ScheduleSendL();
-	iSmsTest.iMsvSession->CleanupEntryPop(); //id
-	}
-
-void CSmcmRecvOnly::DoRunSendingMenuL(TKeyCode aCode)
-/**
- * Called by RunL when iState == ESendingMenu, when there is a key press event.
- * Acts on the user's sending request.
- */
-	{
-	const TChar ch = TChar(aCode);
-
-	switch (ch)
-		{
-		case '1':
-			SendShortMessageL();
-			break;
-		case '2':
-			SendLongMessageL();
-			break;
-		case '3':
-			SendMessageIndicationL();
-			break;
-
-		case '4':
-			SendReplaceTypeL();
-			break;
-
-		case '5':
-			SendFromScriptL();
-			break;
-
-		case 'D':
-		case 'd':
-
-			iRecvActive->DisplayUnmatched();
-			ReshowMenu();
-			break;
-
-		case 'x':
-		case 'X':
-		case EKeyEscape:
-
-			DisplayAndRead(KHelpText);
-			iState = EMainMenu;
-			break;
-
-		case EKeySpace:
-			
-			ReshowMenu();
-			break;
-
-		default:
-
-			Read();
-			break;
-		}
-	}
-
-void CSmcmRecvOnly::ReshowMenu()
-/**
- * Redisplays the current menu
- */
-	{
-	const TDesC* menu = NULL;
-
-	switch (iState)
-		{
-		case EMainMenu:
-			menu = &KHelpText();
-			break;
-		case ESendingMenu:
-			menu = &KMessageText();
-			break;
-
-		default:
-			break;
-		}
-
-	if (menu != NULL)
-		{
-		DisplayAndRead(*menu);
-		}
-	}
-
-void CSmcmRecvOnly::SendFromScriptL()
-/**
- * Sends SMS messages from sendrecv.script
- */
-	{
-	iSmsTest.Printf(_L("\nSendFromScriptL\n"));
-	iSelection->Reset();
-	TTime now;
-	now.HomeTime();
-	iSmsTest.ReadScriptL(iScriptFile, KMsvGlobalOutBoxIndexEntryId, *iSelection, now);
-	ScheduleSendL();
-	}
-
-void CSmcmRecvOnly::SendLongMessageL()
-/**
- * Sends a 2-part concatenated SMS message
- */
-	{
-	iSmsTest.Printf(_L("\nSendLongMessageL\n"));
-
-	_LIT(KLongMessage, "LungoLungoLungoLungoLungoLungoLungoLungoLungoLungoLungoLungoLungoLungoLungoLungoLungoLungoLungoLungoLungoLungoLungoLungoLungoLungoLungoLungoLungoLungoLungoLungoLungoLungoLungo");
-	const TMsvId id = CreateMessageLC(KLongMessage);
-	iSelection->Reset();
-	iSelection->AppendL(id);
-	ScheduleSendL();
-	iSmsTest.iMsvSession->CleanupEntryPop(); //id
-	}
-
-TMsvId CSmcmRecvOnly::CreateMessageLC(const TDesC& aBody)
-/**
- * Creates a message in the outbox with body text aBody
- *
- * @param aBody Body text of the new message
- * @return ID of the new message
- */
-	{
-	const TMsvId id = iSmsTest.CreateDummyMessageToSendL();
-	iSmsTest.iMsvSession->CleanupEntryPushL(id);
-
-	CSmsHeader* header = iSmsTest.GetHeaderLC(id);
-
-	header->Recipients().ResetAndDestroy();
-	CSmsNumber* number = CSmsNumber::NewL();
-	CleanupStack::PushL(number);
-	number->SetAddressL(*iRecipient);
-	number->SetNameL(*iRecipient);
-	header->Recipients().AppendL(number);
-	CleanupStack::Pop(number);
-
-	header->Submit().SetServiceCenterAddressL(*iServiceCenter);
-
-	TMsvEntry entry(iSmsTest.Entry());
-	entry.iDate.HomeTime();
-	iSmsTest.ChangeEntryL(entry);
-
-
-	_LIT(KDateFormat, " %-B%:0%J%:1%T%:2%S%.%*C4%:3%+B %D%M%Y%/0%1%/1%2%/2%3%/3");
-	TBuf<64> dateString;
-	entry.iDate.FormatL(dateString, KDateFormat);
-	iSmsTest.iRichText->Reset();
-	iSmsTest.iRichText->InsertL(0, dateString);
-	iSmsTest.iRichText->InsertL(0, aBody);
-
-	StoreMessageL(id, *header);
-
-	CleanupStack::PopAndDestroy(header);
-
-	return id;
-	}
-
-void CSmcmRecvOnly::SendShortMessageL()
-/**
- * Sends a single-part SMS message
- */
-	{
-	iSmsTest.Printf(_L("\nSendShortMessageL\n"));
-	_LIT(KShortMessage, "ridere");
-	const TMsvId id = CreateMessageLC(KShortMessage);
-	iSelection->Reset();
-	iSelection->AppendL(id);
-	ScheduleSendL();
-	iSmsTest.iMsvSession->CleanupEntryPop(); //id
-	}
-
-void CSmcmRecvOnly::StoreMessageL(TMsvId aId, const CSmsHeader& aHeader)
-/**
- * Stores the header against a message
- *
- * @param aId ID of the message
- * @param aHeader The CSmsHeader to store against the message
- */
-	{
-	iSmsTest.SetEntryL(aId);
-	CMsvStore* store = iSmsTest.EditStoreL();
-	CleanupStack::PushL(store);
-	aHeader.StoreL(*store);
-	store->StoreBodyTextL(*iSmsTest.iRichText);
-	store->CommitL();
-	CleanupStack::PopAndDestroy(store);
-	}
-
-void CSmcmRecvOnly::ScheduleSendL()
-/**
- * Sends all messages in iSelection
- * @note Messages are actually scheduled. Actual ending occurs a few seconds later.
- */
-	{
-	iState = ESending;
-	delete iOperation;
-	iOperation = NULL;
-	iOperation = iSmsTest.iMsvSession->TransferCommandL(*iSelection, ESmsMtmCommandScheduleCopy, KNullDesC8, iStatus);
-	SetActive();
-	}
-
-void CSmcmRecvOnly::SendMessageIndicationL(TUint8 aMessageType, TUint8 aMessageCount)
-/**
- * Sends an SMS message with Special SMS Message Indication set in the user data header.
- *
- * @param aMessageType The type of the Special SMS Message Indication
- * @param aMessageCount The number of "messages" waiting
- */
-	{
-	iSmsTest.Printf(_L("\nSendMessageIndicationL\n"));
-	_LIT(KShortMessage, "SMI");
-	const TMsvId id = CreateMessageLC(KShortMessage);
-
-	CSmsHeader* header = iSmsTest.GetHeaderLC(id);
-
-	TBuf8<2> data;
-	data.SetLength(2);
-	data[0] = aMessageType;
-	data[1] = aMessageCount;
-
-	header->Submit().UserData().AddInformationElementL(CSmsInformationElement::ESmsIEISpecialSMSMessageIndication, data);
-	StoreMessageL(id, *header);
-	CleanupStack::PopAndDestroy(header);
-
-	iSelection->Reset();
-	iSelection->AppendL(id);
-	ScheduleSendL();
-	iSmsTest.iMsvSession->CleanupEntryPop(); //id
-	}
-
-void CSmcmRecvOnly::DoRunSendingL()
-/**
- * Called by CSmcmRecvOnly::RunL() when sending has completed.
- * Displays the current state of all sent messages (in iSelection) and determines whether there was and error.
- */
-	{
-	iSmsTest.SetProgressL(*iOperation);
-	delete iOperation;
-	iOperation = NULL;
-
-	iSmsTest.Printf(_L("\nDoRunSendingL [iStatus=%d Progress.iError=%d]\n"), iStatus.Int(), iSmsTest.iProgress.iError);
-
-	iSmsTest.DisplaySendingStatesL(*iSelection);
-
-	TInt error = KErrNone;
-	const TBool sendingComplete = iSmsTest.SendingCompleteL(*iSelection, error);
-
-	iSmsTest.Printf(_L("[sendingCompete=%d error=%d]\n"), sendingComplete, error);
-
-	if (iStatus.Int() == KErrNone && iSmsTest.iProgress.iError == KErrNone && error == KErrNone)
-		iRecvActive->SentL(*iSelection);
-
-	iState = ESendingMenu;
-	DisplayAndRead(KMessageText);
-	}
-
-void CSmcmRecvOnly::RunL()
-	{
-	User::LeaveIfError(iStatus.Int());
-
-	const TKeyCode keyCode = iSmsTest.Test().Console()->KeyCode();
-
-	switch (iState)
-		{
-		case EMainMenu:
-			DoRunMainMenuL(keyCode);
-			break;
-		case ESendingMenu:
-			DoRunSendingMenuL(keyCode);
-			break;
-		case ESending:
-			DoRunSendingL();
-			break;
-		}
-	}
-
-TInt CSmcmRecvOnly::RunError(TInt aError)
-	{
-	Complete(aError);
-	return KErrNone;
-	}
-
-void CSmcmRecvOnly::Complete(TInt aStatus)
-	{
-	iSmsTest.Printf(_L("CSmcmRecvOnly Completed with %d\n"), aStatus);
-	CActiveScheduler::Stop();
-	}
-
-void CSmcmRecvOnly::DoCancel()
-	{
-	iSmsTest.Test().Console()->ReadCancel();
-	if (iOperation != NULL)
-		iOperation->Cancel();
-	}
-
-//
-
-CSmcmRecvActive* CSmcmRecvActive::NewL(CSmsTestUtils& aSmsTest, TInt aPriority)
-/**
- * CSmcmRecvActive factory function
- */
-	{
-	CSmcmRecvActive* self = new (ELeave) CSmcmRecvActive(aSmsTest, aPriority);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-CSmcmRecvActive::CSmcmRecvActive(CSmsTestUtils& aSmsTest, TInt aPriority)
-: CActive(aPriority), iSmsTest(aSmsTest)
-/**
- * CSmcmRecvActive constructor
- */
-	{
-	CActiveScheduler::Add(this);
-	}
-
-CSmcmRecvActive::~CSmcmRecvActive()
-/**
- * CSmcmRecvActive destructor
- */
-	{
-	Cancel();
-	iTimer.Close();
-	iSmsTest.iMsvSession->RemoveObserver(*this);
-	delete iSelection;
-	delete iReceived;
-	delete iSent;
-	delete iMatched;
-	}
-
-void CSmcmRecvActive::ConstructL()
-	{
-	User::LeaveIfError(iTimer.CreateLocal());
-	iSelection = new (ELeave) CMsvEntrySelection;
-	iSent = new (ELeave) CMsvEntrySelection;
-	iReceived = new (ELeave) CMsvEntrySelection;
-	iMatched = new (ELeave) CMsvEntrySelection;
-	iSmsTest.iMsvSession->AddObserverL(*this);
-	}
-
-void CSmcmRecvActive::HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* , TAny* )
-/**
- * Called by CMsvSession when a messaging event has occurred. It is used here to find out if any new messages have been created.
- */
-	{
-	CMsvEntrySelection* entries = NULL;
-
-	switch (aEvent)
-		{
-		case EMsvEntriesCreated:
-			entries = STATIC_CAST(CMsvEntrySelection*, aArg1);
-			break;
-		default:
-			break;
-		}
-
-	if (entries != NULL)
-		{
-		TInt count = entries->Count();
-
-		while (count--)
-			{
-			const TMsvId id = (*entries)[count];
-			iSmsTest.SetEntryL(id);
-
-			const TMsvEntry& entry = iSmsTest.Entry();
-
-			if ((entry.iMtm == KUidMsgTypeSMS || entry.iBioType != 0) && entry.iType == KUidMsvMessageEntry)
-				iSelection->AppendL(id);
-			}
-
-		if (iSelection->Count() != 0)
-			{
-			Cancel();
-			iTimer.After(iStatus, KWaitAfterRecv);
-			SetActive();
-			}
-		}
-	}
-
-void CSmcmRecvActive::RunL()
-/**
- * Called after the timer completes, which was started when a new message arrived (in CSmcmRecvActive::HandleSessionEventL()).
- * Displays all new messages then determines whether they match sent messages.
- */
-	{
-	const TInt recvCount = iReceived->Count();
-	TInt count = iSelection->Count();
-
-	while (count--)
-		{
-		const TMsvId id = (*iSelection)[0];
-		CSmsHeader* header = iSmsTest.GetHeaderLC(id);
-
-		if (header->Type() == CSmsPDU::ESmsDeliver)
-			{
-			if (Find(*iReceived, id) == KErrNotFound)
-				iReceived->AppendL(id);
-
-			PrintMessageL(id);
-			}
-
-		CleanupStack::PopAndDestroy(header);
-		iSelection->Delete(0,1);
-		}
-
-	if (recvCount != iReceived->Count())
-		ProcessReceivedL();
-	}
-
-void CSmcmRecvActive::ProcessReceivedL()
-/**
- * Determines whether received messages match the sent messages.
- * If two messages in iSent and iReceived match, then it is moved from iReceived to iMatched and deleted from iSent.
- */
-	{
-	TInt sentCount = iSent->Count();
-
-	while (sentCount--)
-		{
-		TInt recvCount = iReceived->Count();
-		
-		const TMsvId sentId = (*iSent)[sentCount];
-		CMsvEntry* sentEntry = iSmsTest.iMsvSession->GetEntryL(sentId);
-		CleanupStack::PushL(sentEntry);
-
-		while (recvCount--)
-			{
-			const TMsvId recvId = (*iReceived)[recvCount];
-			CMsvEntry* recvEntry = iSmsTest.iMsvSession->GetEntryL(recvId);
-			CleanupStack::PushL(recvEntry);
-			
-			if (IsMatchL(*sentEntry, *recvEntry))
-				{
-				iMatched->AppendL(recvId);
-				iSent->Delete(sentCount, 1);
-				iReceived->Delete(recvCount, 1);
-				}
-
-			CleanupStack::PopAndDestroy(recvEntry);
-			}
-
-		CleanupStack::PopAndDestroy(sentEntry);
-		}
-	}
-
-TBool CSmcmRecvActive::IsMatchL(CMsvEntry& aSent, CMsvEntry& aReceived)
-/**
- * Compares the body text of aSent and aReceived
- *
- * @return Returns ETrue if the body text matches
- */
-	{
-	HBufC* sentBody = GetBodyTextLC(aSent);
-	HBufC* recvBody = GetBodyTextLC(aReceived);
-	TBool retVal = (*sentBody == *recvBody);
-	CleanupStack::PopAndDestroy(recvBody);
-	CleanupStack::PopAndDestroy(sentBody);
-
-	// todo AA 28/2/2002 Is more checking required?
-
-	return retVal;
-	}
-
-CSmsHeader* CSmcmRecvActive::GetHeaderLC(CMsvEntry& aMessage) const
-/**
- * Returns the CSmsHeader restored from message aMessage.
- */
-	{
-	CSmsHeader* header = CSmsHeader::NewL(CSmsMessage::NewL(iSmsTest.FileSession(), CSmsPDU::ESmsDeliver, CSmsBuffer::NewL()));
-	CleanupStack::PushL(header);
-
-	CMsvStore* store = aMessage.ReadStoreL();
-	CleanupStack::PushL(store);
-	header->RestoreL(*store);
-	CleanupStack::PopAndDestroy(store);
-
-	return header;
-	}
-
-HBufC* CSmcmRecvActive::GetBodyTextLC(CMsvEntry& aMessage)
-/**
- * @return The body text of message aMessage
- */
-	{
-	iSmsTest.iRichText->Reset();
-	CMsvStore* store = aMessage.ReadStoreL();
-	CleanupStack::PushL(store);
-	store->RestoreBodyTextL(*iSmsTest.iRichText);
-	CleanupStack::PopAndDestroy(store);
-	
-	const TInt len = iSmsTest.iRichText->DocumentLength();
-	HBufC* buf = HBufC::NewLC(len);
-	TPtr ptr(buf->Des());
-	iSmsTest.iRichText->Extract(ptr);
-	return buf;
-	}
-
-TInt CSmcmRecvActive::Find(const CMsvEntrySelection& aSelection, TMsvId aId) const
-/**
- * Attempts to find a message in a selection (array).
- *
- * @param aSelection The selection of messages to search
- * @param aId The message to find in aSelection
- * @return The index of aId in aSelection or KErrNotFound if aId is not in aSelection
- */
-	{
-	TInt count = aSelection.Count();
-
-	while (count--)
-		{
-		const TMsvId id = aSelection[count];
-		if (id == aId)
-			return count;
-		}
-
-	return KErrNotFound;
-	}
-
-void CSmcmRecvActive::PrintMessageL(TMsvId aId)
-/**
- * Displays the received message aId
- */
-	{
-	iSmsTest.iMsvEntry->SetEntryL(KMsvGlobalInBoxIndexEntryId);
-	iSmsTest.Printf(_L("\nReceived Message #%d of %d!! Inbox Count=%d\n"), Received(), Sent(), iSmsTest.iMsvEntry->Count());
-	iSmsTest.DisplayMessageL(aId);
-	}
-
-void CSmcmRecvActive::SentL(const CMsvEntrySelection& aSelection)
-/**
- * Copies aSelection into iSent. One entry is added to iSent for every receipient of each message in aSelection.
- */
-	{
-	TInt count = aSelection.Count();
-	while (count--)
-		{
-		const TMsvId id = aSelection[count];
-		CSmsHeader* header = iSmsTest.GetHeaderLC(id);
-		TInt recptCount = header->Recipients().Count();
-
-		while (recptCount--)
-			iSent->AppendL(id);
-
-		CleanupStack::PopAndDestroy(header);
-		}
-	}
-
-TInt CSmcmRecvActive::RunError(TInt aError)
-	{
-	iSmsTest.Printf(_L("WARNING: CSmcmRecvActive::RunL() left with %d\n"), aError);
-	iTimer.After(iStatus, KWaitAfterRecv);
-	SetActive();
-	return KErrNone;
-	}
-
-void CSmcmRecvActive::DoCancel()
-	{
-	iTimer.Cancel();
-	}
-
-void CSmcmRecvActive::DisplayUnmatched() const
-/**
- * Displays all messages that are yet to be matched
- */
-	{
-	_LIT(KDisplayFormat, "\nSent %d Received %d Matched %d Unmatched %d\n");
-
-	if (iSent->Count() != 0)
-		{
-		iSmsTest.Printf(_L("\nUnmatched Messages:\n"));
-		TRAPD(err, iSmsTest.DisplaySendingStatesL(*iSent));
-		iSmsTest.Printf(_L("\n"));
-		if (err != KErrNone)
-			iSmsTest.Printf(_L("WARNING: DisplaySendingStatesL left with %d\n"), err);
-		}
-
-	iSmsTest.Printf(KDisplayFormat, Sent(), Received(), iMatched->Count(), iSent->Count());
-	}
--- a/messagingappbase/smsmtm/test/src/t_smcs2_server.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-// Copyright (c) 2005-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 "t_smcs2_server.h"
-#include "t_testsmsentry_step.h"
-#include "t_testSmsSettings_Step.h"
-#include "t_testsmsnumber_step.h"
-#include "t_testSmsEmailFields_Step.h"
-#include "t_testsmsHeader_step.h"
-#include "t_testSmsUtilities_Step.h"
-#include "t_testSmsEmsExtensions_step.h"
- 
-_LIT(KServerName,"t_smcs2_server");
-
-CSchSendUTCServer* CSchSendUTCServer::NewL()
-	{
-	CSchSendUTCServer * server = new (ELeave) CSchSendUTCServer();
-	CleanupStack::PushL(server);
-	server-> ConstructL(KServerName);
-
-	CleanupStack::Pop(server);
-	return server;
-	}
-	
-LOCAL_C void MainL()
-	{
-	CActiveScheduler* sched=NULL;
-	sched=new(ELeave) CActiveScheduler;
-	CActiveScheduler::Install(sched);
-	CleanupStack::PushL(sched);
-	CSchSendUTCServer* server = server = CSchSendUTCServer::NewL();
-	CleanupStack::PushL(server);
-	
-	RProcess::Rendezvous(KErrNone);
-	sched->Start();
-
-	CleanupStack::PopAndDestroy(2,sched);
-	}
-
-
-GLDEF_C TInt E32Main()
-	{
-	__UHEAP_MARK;
-	CTrapCleanup* cleanup = CTrapCleanup::New();
-	if(cleanup == NULL)
-		{
-		return KErrNoMemory;
-		}
-	TRAPD(err,MainL());
-	delete cleanup;
-	__UHEAP_MARKEND;
-	return err;
-    }
-    
-RFs& CSchSendUTCServer::Fs()
-	{
-	return iFs;
-	};	
-	
-CTestStep* CSchSendUTCServer::CreateTestStep(const TDesC& aStepName)
-	{
-	
-	CTestStep* testStep = NULL; 	
-	
-	if(aStepName == KTestSmsEntry)
-		testStep = new CTestSmsEntryStep();	
-	
-	if(aStepName == KTestSmsSettings)
-		testStep = new CTestSmsSettingsStep();	
-	
-	if(aStepName == KTestSmsNumber)
-		testStep = new CTestSmsNumberStep();
-	
-	if(aStepName == KTestSmsEmailFields)
-		testStep = new CTestSmsEmailFieldsStep();
-	
-	if(aStepName == KTestSmsHeader)
-		testStep = new CTestSmsHeaderStep();
-	
-	if(aStepName == KTestSmsUtilities)
-		testStep = new CTestSmsUtilitiesStep();
-	
-	if(aStepName == KTestSmsEmsExtensions)
-		testStep = new CTestSmsEmsExtensionsStep();
-		
-	return testStep;
-	}
--- a/messagingappbase/smsmtm/test/src/t_smsbiofication.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,638 +0,0 @@
-// Copyright (c) 1999-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 <e32test.h>
-#include <e32uid.h>
-#include <e32std.h>
-#include <smuthdr.h>
-#include <smscmds.h>
-#include "t_smsbiofication.h"
-#include <txtrich.h>
-#include <biouids.h>
-
-RTest test(_L("T_SmsBiofication Testrig"));
-CTrapCleanup* theCleanup;
-
-_LIT(KBioficationScript, "biofication.script");
-_LIT(KSmsTestFolderDetails, "Test folder");
-_LIT(KSmsTestFolderDescription, "Copied or moved message folder");
-
-
-CSmsBioficationTest* CSmsBioficationTest::NewLC(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest)
-	{
-	CSmsBioficationTest* self = new (ELeave) CSmsBioficationTest(aSmsTest, aScriptFile, aNextTest);
-	CleanupStack::PushL(self);
-
-	self->ConstructL();
-	return self;
-	}
-
-CSmsBioficationTest::~CSmsBioficationTest()
-	{
-	delete iTestSelection;
-
-	iSocket.Close();
-	iSocketServ.Close();
-	}
-
-CSmsBioficationTest::CSmsBioficationTest(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest)
-: CSmsTestBase(aSmsTest, aScriptFile, aNextTest), iState(EStateIdle)
-	{
-	}
-
-void CSmsBioficationTest::ConstructL()
-	{
-	SetTestNameL(KSmsBioficationTestName);
-	iSmsTest.SetLogToFile();
-
-	iSelection = new (ELeave) CMsvEntrySelection();
-	iTestSelection = new (ELeave) CMsvEntrySelection();
-	iTimer = CTestTimer::NewL();
-
-	User::LeaveIfError(iSocketServ.Connect());
-	TProtocolDesc protoinfo;
-	TProtocolName protocolname(KSmsDatagram);
-	User::LeaveIfError(iSocketServ.FindProtocol(protocolname,protoinfo));
-
-	User::LeaveIfError(iSocket.Open(iSocketServ,protoinfo.iAddrFamily,protoinfo.iSockType,protoinfo.iProtocol));
-	TSmsAddr smsaddr;
-	smsaddr.SetSmsAddrFamily(ESmsAddrSendOnly);
-	User::LeaveIfError(iSocket.Bind(smsaddr));
-
-	CActiveScheduler::Add(this);
-	}
-
-void CSmsBioficationTest::RunL()
-	{
-	CActiveScheduler::Stop();
-
-	iSmsTest(iStatus.Int() == KErrNone);
-
-	iSmsTest.SetProgressL(*iOperation);
-
-	switch (iState)
-		{
-		case EStateEnumerating:
-			{
-			RunEnumerateL();
-			break;
-			}
-		case EStateCopyingToPhoneStore:
-			{
-			RunCopyToPhoneStoreL();
-			break;
-			}
-		case EStateCopyingFromPhoneStore:
-		case EStateMovingFromPhoneStore:
-		case EStateDeletingFromPhoneStore:
-			{
-			RunCopyMoveDeleteFromPhoneStoreL();
-			break;
-			}
-		case EStateSending:
-			{
-			ChangeMtmUidsL(*iSelection);
-			break;
-			}
-		default:
-			break;
-		}
-	iState=EStateIdle;
-	}
-
-void CSmsBioficationTest::DoCancel()
-	{
-	if (iOperation)
-		{
-		iOperation->Cancel();
-		iSmsTest.Printf(_L("Operation Cancelled!\n"));
-		}
-	else
-		{
-		iSmsTest.Printf(_L("No operation to cancel!\n"));
-		}
-
-	delete iOperation;
-	iOperation = NULL;
-	}
-
-
-void CSmsBioficationTest::TestSetupL()
-	{
-	iSmsTest.Test().Next(_L("Test Setup"));
-	iState=EStateSettingUp;
-	TFullName name;
-	TFindProcess find(_L("watcher*"));
-	while (find.Next(name)==KErrNone)
-		{
-		RProcess process;
-		process.Open(find);
-		process.Terminate(KErrGeneral);
-		process.Close();
-		}
-	//  Create test folder
-	MsvEntry().SetEntryL(KMsvDraftEntryId);
-	TMsvEntry entry;
-	entry.iServiceId = iSmsTest.iSmsServiceId;
-	entry.SetVisible(ETrue);
-	entry.iMtm = KUidMsgTypeSMS;
-	entry.iDate.HomeTime();
-	entry.iType = KUidMsvFolderEntry;
-	entry.iDetails.Set(KSmsTestFolderDetails);
-	entry.iDescription.Set(KSmsTestFolderDescription);
-	MsvEntry().CreateL(entry);
-	iTestFolderId=MsvEntry().EntryId();
-
-	TTime now;
-	now.HomeTime();
-	iSmsTest.ReadScriptL(iScriptFile, KMsvNullIndexEntryId, *iSelection, now);
-	ChangeMtmUidsL(*iSelection);
-
-	iState=EStateIdle;
-
-	/*
-	User::LeaveIfError(iSocketServ.Connect());
-	TProtocolDesc protoinfo;
-	TProtocolName protocolname(KSmsDatagram);
-	User::LeaveIfError(iSocketServ.FindProtocol(protocolname,protoinfo));
-
-	User::LeaveIfError(iSocket.Open(iSocketServ,protoinfo.iAddrFamily,protoinfo.iSockType,protoinfo.iProtocol));
-	TSmsAddr smsaddr;
-	smsaddr.SetSmsAddrFamily(ESmsAddrSendOnly);
-	User::LeaveIfError(iSocket.Bind(smsaddr));
-	*/
-	}
-
-void CSmsBioficationTest::TestEnumerateL()
-	{
-	iSmsTest.Test().Next(_L("Enumerate Phone Stores"));
-	iState = EStateEnumerating;
-
-	iTestSelection->Reset();
-	iTestSelection->AppendL(iSmsTest.iSmsServiceId);
-
-	delete iOperation;
-	iOperation = NULL;
-	iOperation = Session().TransferCommandL(*iTestSelection, ESmsMtmCommandEnumeratePhoneStores, TPtrC8(), iStatus);
-	SetActive();
-	CActiveScheduler::Start();
-	}
-
-void CSmsBioficationTest::TestCopyToPhoneStoreL()
-	{
-	iSmsTest.Test().Next(_L("Copy To Phone Store"));
-	iState = EStateCopyingToPhoneStore;
-
-	delete iTestSelection;
-	iTestSelection = NULL;
-	iTestSelection=iSelection->CopyL();
-	iTestSelection->InsertL(0,iSmsTest.iSmsServiceId);
-
-	delete iOperation;
-	iOperation = NULL;
-	iOperation = Session().TransferCommandL(*iTestSelection, ESmsMtmCommandCopyToPhoneStore, TPtrC8(), iStatus);
-	SetActive();
-	CActiveScheduler::Start();
-	}
-
-void CSmsBioficationTest::TestCopyFromPhoneStoreL()
-	{
-	iSmsTest.Test().Next(_L("Copy From Phone Store"));
-	iState = EStateCopyingFromPhoneStore;
-
-	DeleteEntriesFromTestFolderL();
-
-	MsvEntry().SetEntryL(iEnumerationFolderId);
-
-	delete iTestSelection;
-	iTestSelection = NULL;
-	iTestSelection = MsvEntry().ChildrenL();
-	iTestSelection->InsertL(0,iSmsTest.iSmsServiceId);
-
-	TPckgBuf<TMsvId> pkg(iTestFolderId);
-
-	delete iOperation;
-	iOperation = NULL;
-	iOperation = Session().TransferCommandL(*iTestSelection, ESmsMtmCommandCopyFromPhoneStore, pkg, iStatus);
-	SetActive();
-	CActiveScheduler::Start();
-	}
-
-void CSmsBioficationTest::TestMoveFromPhoneStoreL()
-	{
-	iSmsTest.Test().Next(_L("Move From Phone Store"));
-	iState = EStateMovingFromPhoneStore;
-
-	DeleteEntriesFromTestFolderL();
-
-	MsvEntry().SetEntryL(iEnumerationFolderId);
-	delete iTestSelection;
-	iTestSelection = NULL;
-	iTestSelection = MsvEntry().ChildrenL();
-	iTestSelection->InsertL(0,iSmsTest.iSmsServiceId);
-
-	TPckgBuf<TMsvId> pkg(iTestFolderId);
-
-	delete iOperation;
-	iOperation = NULL;
-	iOperation = Session().TransferCommandL(*iTestSelection, ESmsMtmCommandMoveFromPhoneStore, pkg, iStatus);
-	SetActive();
-	CActiveScheduler::Start();
-	}
-
-void CSmsBioficationTest::TestDeleteFromPhoneStoreL()
-	{
-	iSmsTest.Test().Next(_L("Delete From SIM"));
-	iState = EStateDeletingFromPhoneStore;
-
-	MsvEntry().SetEntryL(iEnumerationFolderId);
-	delete iTestSelection;
-	iTestSelection = NULL;
-	iTestSelection = MsvEntry().ChildrenL();
-	iTestSelection->InsertL(0,iSmsTest.iSmsServiceId);
-
-	delete iOperation;
-	iOperation = NULL;
-	iOperation = Session().TransferCommandL(*iTestSelection, ESmsMtmCommandDeleteFromPhoneStore, TPtrC8(), iStatus);
-	SetActive();
-	CActiveScheduler::Start();
-	}
-
-void CSmsBioficationTest::TestSendL()
-	{
-	iSmsTest.Test().Next(_L("Send"));
-	iState = EStateSending;
-
-	iSmsTest.Test().Next(_L("Test Send Entry\n"));
-
-	DeleteEntriesFromTestFolderL();
-
-	for (TInt i=iSelection->Count()-1; i>=0; i--)
-		{
-		MsvEntry().SetEntryL(iSelection->At(i));
-		TMsvEntry entry=MsvEntry().Entry();
-		if (entry.Parent()!=KMsvGlobalOutBoxIndexEntryId)
-			iSelection->Delete(i);
-		else
-			{
-			entry.iMtm=KUidMsgTypeSMS;
-			MsvEntry().ChangeL(entry);
-			MsvEntry().SetEntryL(KMsvGlobalOutBoxIndexEntryId);
-			MsvEntry().CopyL(iSelection->At(i),iTestFolderId);
-			}
-		}
-
-	MsvEntry().SetEntryL(iTestFolderId);
-	delete iTestSelection;
-	iTestSelection = NULL;
-	iTestSelection = MsvEntry().ChildrenL();
-
-	delete iOperation;
-	iOperation = NULL;
-	iOperation = MsvEntry().CopyL(*iTestSelection, iSmsTest.iSmsServiceId, iStatus);
-
-	SetActive();
-	CActiveScheduler::Start();
-	}
-
-void CSmsBioficationTest::TestDeleteEnumerationFolderL()
-	{
-	iSmsTest.Test().Next(_L("Test Delete Enumeration Folder\n"));
-
-	iTestSelection->Reset();
-	CMsvOperationWait* wait = CMsvOperationWait::NewLC();
-	wait->Start();
-
-	iSmsTest.SetEntryL(iEnumerationFolderId);
-	iSmsTest.SetEntryL(iSmsTest.Entry().Parent());
-
-	CMsvOperation* op = iSmsTest.iMsvEntry->DeleteL(iEnumerationFolderId, wait->iStatus);
-	CleanupStack::PushL(op);
-
-	CActiveScheduler::Start();
-
-	iSmsTest.Printf(_L("Remote DeleteL() completed with %d\n"), wait->iStatus.Int());
-
-	User::LeaveIfError(wait->iStatus.Int());
-
-	iSmsTest.SetProgressL(*op);
-
-	iSmsTest.Printf(_L("Operation completed with %d, msg count %d\n"), iSmsTest.iProgress.iError, iSmsTest.iProgress.iMsgCount);
-	User::LeaveIfError(iSmsTest.iProgress.iError);
-
-	CleanupStack::PopAndDestroy(2); //wait, op
-	iState = EStateIdle;
-	}
-
-
-void CSmsBioficationTest::RunAutoL()
-	{
-	iSmsTest.SetLogToConsole(ETrue);
-
-	iSmsTest.TestStart(++iNextTest, _L("Test 1 - Setup"));
-	TestSetupL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	
-
-	iSmsTest.TestStart(++iNextTest, _L("Test 1 - Enumerate"));
-	TestEnumerateL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	
-
-	if (iTestSelection->Count())
-		{
-		iSmsTest.TestStart(++iNextTest, _L("Test 1 - Delete From Phone Store"));
-		TestDeleteFromPhoneStoreL();
-		User::LeaveIfError(iStatus.Int());
-		iSmsTest.TestFinish(iNextTest, KErrNone);
-		}
-
-	
-
-	iSmsTest.TestStart(++iNextTest, _L("Test 1 - Enumerate"));
-	TestEnumerateL();
-	User::LeaveIfError(iStatus.Int());
-	test(iTestSelection->Count()==0);
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	const TInt KWaitAfterEnum = 10;
-	const TInt KWaitAfterSend = 10;
-	iSmsTest.Printf(_L("Waiting %d seconds after enum...\n"), KWaitAfterEnum);
-	User::After(KWaitAfterEnum * 1000000);
-	iSmsTest.Printf(_L("Finished waiting\n"));
-
-	
-
-	iSmsTest.TestStart(++iNextTest, _L("Test 2 - Copy to Phone Store"));
-	TestCopyToPhoneStoreL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	
-
-
-	iSmsTest.TestStart(++iNextTest, _L("Test 2 - Enumerate"));
-	TestEnumerateL();
-	User::LeaveIfError(iStatus.Int());
-	test(CompareSelectionsL(*iSelection,*iTestSelection));
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	
-
-	iSmsTest.TestStart(++iNextTest, _L("Test 2 - Copy From Phone Store"));
-	TestCopyFromPhoneStoreL();
-	User::LeaveIfError(iStatus.Int());
-	test(CompareSelectionsL(*iSelection,*iTestSelection));
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	
-
-	iSmsTest.TestStart(++iNextTest, _L("Test 2 - Delete From Phone Store"));
-	TestDeleteFromPhoneStoreL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	
-
-	iSmsTest.TestStart(++iNextTest, _L("Test 2 - Enumerate"));
-	TestEnumerateL();
-	User::LeaveIfError(iStatus.Int());
-	test(iTestSelection->Count()==0);
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	
-
-	iSmsTest.TestStart(++iNextTest, _L("Test 3 - Send"));
-	TestSendL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	iSmsTest.Printf(_L("Waiting %d seconds after send...\n"), KWaitAfterSend);
-	User::After(KWaitAfterSend * 1000000);
-	iSmsTest.Printf(_L("Finished waiting\n"));
-
-	iSmsTest.TestStart(++iNextTest, _L("Test 2 - Enumerate"));
-	TestEnumerateL();
-	User::LeaveIfError(iStatus.Int());
-	test(CompareSelectionsL(*iSelection,*iTestSelection));
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	iSmsTest.TestStart(++iNextTest, _L("Test 3 - Move from Phone Store"));
-	TestMoveFromPhoneStoreL();
-	User::LeaveIfError(iStatus.Int());
-	test(CompareSelectionsL(*iSelection,*iTestSelection));
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	iSmsTest.TestStart(++iNextTest, _L("Test 2 - Enumerate"));
-	TestEnumerateL();
-	User::LeaveIfError(iStatus.Int());
-	test(iTestSelection->Count()==0);
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-
-	iSmsTest.TestStart(++iNextTest, _L("Test 2 - Delete Enumeration Folder"));
-	TestDeleteEnumerationFolderL();
-	User::LeaveIfError(iStatus.Int());
-	iSmsTest.TestFinish(iNextTest, KErrNone);
-	}
-
-void CSmsBioficationTest::ShowMenuL()
-	{
-	}
-
-void CSmsBioficationTest::DeleteEntriesFromTestFolderL()
-	{
-	MsvEntry().SetEntryL(iTestFolderId);
-	delete iTestSelection;
-	iTestSelection = NULL;
-	iTestSelection = MsvEntry().ChildrenL();
-	if (iTestSelection->Count())
-		{
-		CMsvOperationWait* wait = CMsvOperationWait::NewLC();
-		wait->Start();
-		CMsvOperation* op=MsvEntry().DeleteL(*iTestSelection,wait->iStatus);
-		CleanupStack::PushL(op);
-		CActiveScheduler::Start();
-		User::LeaveIfError(wait->iStatus.Int());
-		iSmsTest.SetProgressL(*op);
-		User::LeaveIfError(iSmsTest.iProgress.iError);
-		CleanupStack::PopAndDestroy(2); //wait, op
-		iTestSelection->Reset();
-		}
-	}
-
-void CSmsBioficationTest::ChangeMtmUidsL(CMsvEntrySelection& aSelection)
-	{
-	for (TInt i=0; i<aSelection.Count(); i++)
-		{
-		MsvEntry().SetEntryL(aSelection[i]);
-		TMsvEntry entry=MsvEntry().Entry();
-		if (entry.iBioType!=EBioMsgIdUnknown)
-			{
-			entry.iMtm=KUidBIOMessageTypeMtm;  //  The test utils do not set the correct MTM uid for BIO messages
-			MsvEntry().ChangeL(entry);
-			}
-		}
-	}
-
-TBool CSmsBioficationTest::CompareSelectionsL(const CMsvEntrySelection& aSelection1,const CMsvEntrySelection& aSelection2)
-	{
-	TInt count1=aSelection1.Count();
-	TInt count2=aSelection2.Count();
-	iSmsTest.Printf(_L("Comparing selections, 1st msg count %d, 2nd msg count %d\n"), count1,count2);
-	TBool thesame=count1==count2;
-	for (TInt i=0; thesame && (i<count1); i++)
-		{
-		CMsvEntrySelection* selection2=aSelection2.CopyLC();
-		thesame=EFalse;
-		for (TInt j=0; (!thesame) && (j<count2); j++)
-			{
-			thesame=CompareEntriesL(aSelection1[i],selection2->At(j));
-			if (thesame)
-				selection2->Delete(j);
-			}
-		CleanupStack::PopAndDestroy();
-		}
-	return thesame;
-	}
-
-TBool CSmsBioficationTest::CompareEntriesL(TMsvId aId1, TMsvId aId2)
-	{
-	TBool thesame=iSmsTest.AreMessagesSameTextL(aId1,aId2);
-	if (thesame)
-		{
-		MsvEntry().SetEntryL(aId1);
-		TMsvEntry entry1=MsvEntry().Entry();
-		MsvEntry().SetEntryL(aId2);
-		TMsvEntry entry2=MsvEntry().Entry();
-		thesame=(entry1.iBioType==entry2.iBioType) && (entry1.iMtm==entry2.iMtm);
-		}
-	return thesame;
-	}
-
-void CSmsBioficationTest::RunEnumerateL()
-	{
-	TInt err = iStatus.Int();
-
-	if (err == KErrNone)
-		{
-		err = iSmsTest.iProgress.iError;
-		iStatus = err;
-
-		if (err == KErrNone)
-			{
-			iEnumerationFolderId=iSmsTest.iProgress.iEnumerateFolder;
-			MsvEntry().SetEntryL(iEnumerationFolderId);
-			delete iTestSelection;
-			iTestSelection = NULL;
-			iTestSelection = MsvEntry().ChildrenL();
-
-			iSmsTest.Printf(_L("%d message(s) on SIM. %d message(s) now contained in folder %d.\n"), iSmsTest.iProgress.iMsgCount, iTestSelection->Count(), iEnumerationFolderId);
-			iSmsTest.DisplayMessagesL(*iTestSelection);
-			}
-		}
-
-	iSmsTest.Printf(_L("Enumerate Phone Store completed with %d\n"), err);
-	iState = EStateIdle;
-
-	delete iOperation;
-	iOperation = NULL;
-	}
-
-void CSmsBioficationTest::RunCopyToPhoneStoreL()
-	{
-	TInt err = iStatus.Int();
-
-	if (err == KErrNone)
-		{
-		err = iSmsTest.iProgress.iError;
-		}
-
-	iSmsTest.Printf(_L("Copy To SIM completed with error %d\n"), err);
-
-	iState = EStateIdle;
-	}
-
-void CSmsBioficationTest::RunCopyMoveDeleteFromPhoneStoreL()
-	{
-	TInt err = iStatus.Int();
-
-	if (err == KErrNone)
-		{
-		err = iSmsTest.iProgress.iError;
-		}
-
-	MsvEntry().SetEntryL(iTestFolderId);
-	delete iTestSelection;
-	iTestSelection = NULL;
-	iTestSelection = MsvEntry().ChildrenL();
-
-	switch (iState)
-		{
-		case EStateCopyingFromPhoneStore:
-			iSmsTest.Printf(_L("Copy From Phone Store completed with error %d\n"), err);
-			break;
-		case EStateMovingFromPhoneStore:
-			iSmsTest.Printf(_L("Move From Phone Store completed with error %d\n"), err);
-			break;
-		case EStateDeletingFromPhoneStore:
-			iSmsTest.Printf(_L("Delete From Phone Store completed with error %d\n"), err);
-			break;
-		default:
-			break;
-		}
-
-	iState = EStateIdle;
-	}
-
-LOCAL_C void doMainL()
-	{
-	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
-	CleanupStack::PushL(scheduler);
-	CActiveScheduler::Install( scheduler );
-
-	CSmsTestUtils* smsTest = CSmsTestUtils::NewL(test);
-	CleanupStack::PushL(smsTest);
-	TInt nextTest = 0;
-
-	smsTest->NotifySaPhoneOnL();
-
-	CSmsBioficationTest* bioficationTest = CSmsBioficationTest::NewLC(*smsTest, KBioficationScript, nextTest);
-
-	smsTest->WaitForInitializeL();
-
-	bioficationTest->StartL();
-
-	CleanupStack::PopAndDestroy(3); //bioficationTest, smsTest, scheduler
-	}
-
-GLDEF_C TInt E32Main()
-	{	
-	__UHEAP_MARK;
-	test.Start(_L("Setup"));
-	theCleanup = CTrapCleanup::New();
-	TRAPD(ret,doMainL());		
-	test(ret==KErrNone);
-	delete theCleanup;	
-	test.Console()->SetPos(0, 13);
-	test.End();
-	test.Close();
-	__UHEAP_MARKEND;
-	return(KErrNone);
-	}
-
--- a/messagingappbase/smsmtm/test/src/t_smsdeliver.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2380 +0,0 @@
-// Copyright (c) 2003-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 "t_smsdeliver.h"
-
-#include <e32test.h>
-#include <smutset.h>
-#include <smuthdr.h>
-#include <txtrich.h>
-#include <smstestutils.h>
-#include <msvuids.h>
-#include <smsuaddr.h>
-#include <csmsaccount.h>
-
-#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS  
-#include <tmsvsmsentry.h>
-#endif
-
-_LIT(KFailed,"Failed to complete tests.");
-_LIT(KRecipientOk,		"+447747065438");  // has to be valid number and switched on
-_LIT(KRecipientBad,		"+442071541467");
-_LIT(KRecipientFail,	"+34933753717");
-_LIT(KMessageData, "This is a simple text message");
-_LIT(KTestDeliverOneRecipientOk,		"Single recipient, deliver ok");
-_LIT(KTestDeliverOneRecipientFail, 		"Single recipient, deliver fail");
-_LIT(KTestDeliverMultiRecipientsOk_1,	"Multi (2) recipients, deliver ok"); 
-_LIT(KTestDeliverMultiRecipientsOk_2,	"Multi (2) recipients, deliver ok, but 1 fails to send");
-_LIT(KTestDeliverMultiRecipientsOk_3,	"Multi (3) recipients, deliver ok, but 1 fails to send");
-_LIT(KTestDeliverNoMatching,			"Single recipient, no matching");
-_LIT(KTestDeliverNoStatusReports,		"Single recipient, no status reports");
-_LIT(KTestDeliverNotSent,				"Single recipient, not sent");
-_LIT(KTestDeliverMultiRecipientsFail_1,	"Multi (2) recipients, deliver failure");
-_LIT(KTestDeliverMultiRecipientsMixed_1,"Multi (2) recipients, 1 deliver ok, 1 deliver failure");
-_LIT(KTestDeliverMultiRecipientsMixed_2,"Multi (2) recipients, 2 deliver failures");
-
-#if defined (__WINS__)
-_LIT(KPddName,"ECDRV");
-_LIT(KLddName,"ECOMM");
-#else	//__WINS__
-_LIT(KPddSirName,"ESIR");
-_LIT(KPddUartName,"ECUART4");
-_LIT(KLddName,"ECOMM");
-#endif	//__WINS__
-
-RTest test(_L("T_SmsDeliver Test Harness"));
-
-const TTimeIntervalMicroSeconds32 KWaitForWatchersToStart = 20000000;
-const TTimeIntervalMicroSeconds32 KWaitForWatchersToStartDisplayInterval = 5000000;
-
-LOCAL_C void DoTestsL()
-	{
-#if defined (__WINS__)
-	User::LoadPhysicalDevice(KPddName);
-	User::LoadLogicalDevice(KLddName);
-#else	//__WINS__
-	User::LoadPhysicalDevice(KPddSirName);
-	User::LoadPhysicalDevice(KPddUartName);
-    User::LoadLogicalDevice(KLddName);
-#endif	//__WINS__
-
-	TInt r = StartC32();
-	if( (r != KErrNone) && (r != KErrAlreadyExists) )
-		test.Printf(_L("Failed to start C32 %d\n"), r);
-	
-	// Create and install the active scheduler
- 	CActiveScheduler* scheduler= new (ELeave) CActiveScheduler();
-	CleanupStack::PushL(scheduler);
-	CActiveScheduler::Install(scheduler);
-
-	// Create the test engine
-	CTestEngine* testEngine = CTestEngine::NewL();
-	CleanupStack::PushL(testEngine);
-
-	// Do tests...
-	testEngine->DoTestsL();
-	
-	CleanupStack::PopAndDestroy(2, scheduler);	
-	}
-
-GLDEF_C TInt E32Main()
-	{	
-	__UHEAP_MARK;
-	CTrapCleanup* tc=CTrapCleanup::New();
-	TRAPD(err,DoTestsL());
-	if (err!=KErrNone)
-		User::Panic(KFailed, err);
-	delete tc;
-	test.Close();
-	__UHEAP_MARKEND;
-	return KErrNone;
-	}
-	
-/*
- *	CTestEngine
- */
-	
-CTestEngine* CTestEngine::NewL()
-	{
-	CTestEngine* self = new (ELeave) CTestEngine();
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-CTestEngine::~CTestEngine()
-	{
-	delete iTestUtils;
-	delete iWatchers;
-
-	iSocket.Close();
-	iSocketServ.Close();
-	}
-
-CTestEngine::CTestEngine()
-: CBase()
-	{
-	}
-	
-void CTestEngine::DoTestsL()
-	{
-
-	CTestDeliverBase* testCase = NULL;
-	
-	testCase = CTestDeliverOneRecipientOk::NewL(*iTestUtils);
-	RunTestCaseL(*testCase);
-
-	testCase = CTestDeliverMultiRecipientsOk_1::NewL(*iTestUtils);
-	RunTestCaseL(*testCase);
-
-	testCase = CTestDeliverMultiRecipientsOk_2::NewL(*iTestUtils);
-	RunTestCaseL(*testCase);
-
-	testCase = CTestDeliverMultiRecipientsOk_3::NewL(*iTestUtils);
-	RunTestCaseL(*testCase);
-
-	testCase = CTestDeliverNoMatching::NewL(*iTestUtils);
-	RunTestCaseL(*testCase);
-	
-	testCase = CTestDeliverNoStatusReports::NewL(*iTestUtils);
-	RunTestCaseL(*testCase);
-
-	testCase = CTestDeliverNotSent::NewL(*iTestUtils);
-	RunTestCaseL(*testCase);
-
-	testCase = CTestDeliverOneRecipientFail::NewL(*iTestUtils);
-	RunTestCaseL(*testCase);
-	
-	testCase = 	CTestDeliverMultiRecipientsFail_1::NewL(*iTestUtils);
-	RunTestCaseL(*testCase);
-
-	testCase = 	CTestDeliverMultiRecipientsMixed_1::NewL(*iTestUtils);
-	RunTestCaseL(*testCase);
-
-	testCase = 	CTestDeliverMultiRecipientsMixed_2::NewL(*iTestUtils);
-	RunTestCaseL(*testCase);
-	}
-	
-void CTestEngine::RunTestCaseL(CTestDeliverBase& aTestCase)
-	{
-	CleanupStack::PushL(&aTestCase);
-	aTestCase.Start();
-	CActiveScheduler::Start();
-	CleanupStack::PopAndDestroy(&aTestCase);
-	}
-
-void CTestEngine::ConstructL()
-	{
-	// This should create the SMS service, including the service settings.
-	iTestUtils = CSmsTestUtils::NewL(test);
-	
-	// Notify the system agent that the phone is on.
-	iTestUtils->NotifySaPhoneOnL();
-	
-	// Tell the tests utils to log to file
-	iTestUtils->SetLogToFile();
-	
-	// Restore the service settings.
-	iTestUtils->SetEntryL(iTestUtils->iSmsServiceId);
-	CSmsAccount* account = CSmsAccount::NewLC();
-	account->LoadSettingsL(*iTestUtils->iServiceSettings);
-	
-	// Remove the default service centres from the service settings
-	TInt count = iTestUtils->iServiceSettings->ServiceCenterCount();
-	while( count-- )
-		{
-		iTestUtils->iServiceSettings->RemoveServiceCenter(count);
-		}
-		
-	// Add the Vodafone service centre - store the settings.
-	iTestUtils->iServiceSettings->AddServiceCenterL(_L("Vodafone"), _L("+447785016005"));
-
-	// Set delivery options - do matching and make reports visible.	
-	iTestUtils->iServiceSettings->SetDeliveryReport(ETrue);
-	iTestUtils->iServiceSettings->SetStatusReportHandling(CSmsSettings::EMoveReportToInboxVisibleAndMatch);
-
-	account->SaveSettingsL(*iTestUtils->iServiceSettings);
-	CleanupStack::PopAndDestroy(account);
-	
-	// Create a session with the SMS stack - note order of the next few things
-	// is important.
-	User::LeaveIfError(iSocketServ.Connect());
-	TProtocolDesc protoinfo;
-	TProtocolName protocolname(KSmsDatagram);
-	User::LeaveIfError(iSocketServ.FindProtocol(protocolname,protoinfo));
-	User::LeaveIfError(iSocket.Open(iSocketServ,protoinfo.iAddrFamily,protoinfo.iSockType,protoinfo.iProtocol));
-	
-	TSmsAddr smsaddr;
-	smsaddr.SetSmsAddrFamily(ESmsAddrSendOnly);
-	User::LeaveIfError(iSocket.Bind(smsaddr));
-	
-	// Initialise phone...
-	iTestUtils->WaitForInitializeL();
-	
-	// Start watchers...
-	StartWatcherL();
-	}
-	
-TBool CTestEngine::WatchersAlreadyRunningL()
-	{
-	RSocketServ server;
-	RSocket socket;
-
-	User::LeaveIfError(server.Connect());
-	CleanupClosePushL(server);
-
-		// test if it's there... 
-	TProtocolDesc protoInfo;
-	TProtocolName protocolname;
-	protocolname.Copy(KSmsDatagram);
-	User::LeaveIfError(server.FindProtocol(protocolname,protoInfo));
-
-	User::LeaveIfError(socket.Open(server,
-										protoInfo.iAddrFamily,
-										protoInfo.iSockType, 
-										protoInfo.iProtocol));
-	CleanupClosePushL(socket);
-
-	TSmsAddr addr;
-	addr.SetSmsAddrFamily(ESmsAddrRecvAny);
-	TInt err = socket.Bind(addr);
-
-	CleanupStack::Pop(2, &server);
-	socket.CancelAll();
-	socket.Close();
-	server.Close();
-	return (err == KErrAlreadyExists);
-	}
-	
-void CTestEngine::StartWatcherL()
-	{
-	iTestUtils->Printf(_L("Start the Watcher"));
-
-	if( WatchersAlreadyRunningL() )
-		{
-		iTestUtils->Printf(_L("Watchers are already running\n"));
-		return;
-		}
-
-	iWatchers = CTestUtilsWatcherStarter::NewL();
-
-	TTimeIntervalMicroSeconds32 wait = KWaitForWatchersToStart;
-	TBool started = EFalse;
-	while( !started && wait.Int() > 0 )
-		{
-		iTestUtils->Printf(_L("Waiting %d secs for watchers to start...\n"), wait.Int() / 1000000);
-		wait = wait.Int() - KWaitForWatchersToStartDisplayInterval.Int();
-		User::After(KWaitForWatchersToStartDisplayInterval);
-		started = WatchersAlreadyRunningL();
-		}
-
-	if( !WatchersAlreadyRunningL() )
-		{
-		iTestUtils->Printf(_L("WARNING: NBS Watcher has not started yet\n"));
-		}
-	}
-	
-/*
- * CTestDeliverBase
- */
- 
-CTestDeliverBase::~CTestDeliverBase()
-	{
-	delete iEntryForObserver;
-	delete iOperation;
-	}	
-	
-void CTestDeliverBase::Start()
-	{
-	iTestUtils.Printf(_L("Starting %S\n"), &TestName());
-	iState = EClearFolders;
-	CompleteSelf();
-	}
-	
-CTestDeliverBase::CTestDeliverBase(CSmsTestUtils& aTestUtils)
-: CActive(CActive::EPriorityStandard), iTestUtils(aTestUtils)
-	{
-	CActiveScheduler::Add(this);
-	}
-	
-void CTestDeliverBase::ConstructL()
-	{
-	iEntryForObserver = Session().GetEntryL(KMsvGlobalInBoxIndexEntryId);
-	}
-	
-void CTestDeliverBase::CompleteSelf()
-	{
-	TRequestStatus* pStat = &iStatus;
-	User::RequestComplete(pStat, KErrNone);
-	SetActive();
-	}
-	
-CMsvSession& CTestDeliverBase::Session()
-	{
-	return *iTestUtils.iMsvSession;
-	}
-
-CMsvEntry& CTestDeliverBase::MsvEntry()
-	{
-	return *iTestUtils.iMsvEntry;
-	}
-
-CSmsClientMtm& CTestDeliverBase::Client()
-	{
-	return *iTestUtils.iSmsClientMtm;
-	}
-	
-CSmsSettings& CTestDeliverBase::ServiceSettings()
-	{
-	return *iTestUtils.iServiceSettings;
-	}
-		
-void CTestDeliverBase::ClearFoldersL()
-	{
-	iTestUtils.DeleteSmsMessagesL(KMsvGlobalOutBoxIndexEntryId);
-	iTestUtils.DeleteSmsMessagesL(KMsvGlobalInBoxIndexEntryId);
-	iTestUtils.DeleteSmsMessagesL(KMsvSentEntryId);		
-	}
-	
-void CTestDeliverBase::TestComplete()
-	{
-	iTestUtils.Printf(_L("Test Complete\n"));
-	CActiveScheduler::Stop();
-	}
-	
-void CTestDeliverBase::CreateMessageL()
-	{
-	iTestUtils.Printf(_L("Creating message...\n"));
-	
-	TMsvEntry entry;
-	entry.SetVisible(ETrue); 
-	entry.SetInPreparation(ETrue); 
-	entry.iServiceId = iTestUtils.iSmsServiceId; 
-	entry.iType = KUidMsvMessageEntry; 
-	entry.iMtm = KUidMsgTypeSMS; 
-	entry.iDate.HomeTime(); 
-	entry.iSize = 0; 
-	entry.iDescription.Set(KNullDesC); 
-	entry.iDetails.Set(KNullDesC); 
-
-	// Check send options...
-	TUint sendState = KMsvSendStateWaiting; 
-	switch( ServiceSettings().Delivery() )  
-		{ 
-	case ESmsDeliveryScheduled: 
-		sendState = KMsvSendStateScheduled; 
-		break; 
-	case ESmsDeliveryUponRequest: 
-		sendState = KMsvSendStateUponRequest; 
-		break; 
-	default: 
-		sendState = KMsvSendStateWaiting; 
-		break;
-		}
-	entry.SetSendingState(sendState); 
-
-	// Create the SMS header object...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils.iRichText);
-	CleanupStack::PushL(header);
-	
-	// Set the body text...
-	iTestUtils.iRichText->Reset();
-	iTestUtils.iRichText->InsertL(0, KMessageData);
-	
-	// Copy the message settings...
-	header->SetSmsSettingsL(ServiceSettings()); 
-	
-	// Set the service centre
-	TInt defaultIndex = ServiceSettings().DefaultServiceCenter();
-	header->SetServiceCenterAddressL(ServiceSettings().GetServiceCenter(defaultIndex).Address());
-
-	// Set recipient - ask derived class
-	SetRecipientsL(*header);
-	
-	// Update entry description and details...
-	CArrayPtrFlat<CSmsNumber>& recipient = header->Recipients();
-	entry.iDetails.Set(recipient[0]->Address());
-	entry.iDescription.Set(iTestUtils.iRichText->Read(0, ServiceSettings().DescriptionLength()));
-	entry.SetInPreparation(EFalse);
-	
-	// Create the entry - set context to the global outbox.
-	MsvEntry().SetEntryL(KMsvGlobalOutBoxIndexEntryId);
-	MsvEntry().CreateL(entry);
-
-	// Create new store and save header information 
-	MsvEntry().SetEntryL(entry.Id()); 
-	CMsvStore* store = MsvEntry().EditStoreL(); 
-	CleanupStack::PushL(store); 
-	header->StoreL(*store);
-	store->StoreBodyTextL(*iTestUtils.iRichText);
-	store->CommitL(); 
-	CleanupStack::PopAndDestroy(2, header); 
-	
-	iMessageId = entry.Id();
-	}
-	
-void CTestDeliverBase::SendMessageL()
-	{
-	iTestUtils.Printf(_L("Sending message %d\n"), iMessageId);
-
-	delete iOperation;
-	iOperation = NULL;
-
-	CMsvEntrySelection* sel = new (ELeave) CMsvEntrySelection();
-	CleanupStack::PushL(sel);
-	sel->AppendL(iMessageId);
-
-	iTestUtils.DisplayMessageL(iMessageId);
-	
-	MsvEntry().SetEntryL(KMsvGlobalOutBoxIndexEntryId);
-	iOperation = MsvEntry().CopyL(*sel, iTestUtils.iSmsServiceId, iStatus);
-	CleanupStack::PopAndDestroy(sel);
-
-	SetActive();
-	}
-	
-void CTestDeliverBase::ChangeServiceSettingsL()
-	{
-	// Restore the service settings.
-	iTestUtils.SetEntryL(iTestUtils.iSmsServiceId);
-	CSmsAccount* account = CSmsAccount::NewLC();
-	account->LoadSettingsL(*iTestUtils.iServiceSettings);
-	
-	// Set the service settings 
-	iTestUtils.iServiceSettings->SetValidityPeriod(TTimeIntervalMinutes(5));
-	iTestUtils.iServiceSettings->SetDeliveryReport(ETrue);
-	iTestUtils.iServiceSettings->SetStatusReportHandling(CSmsSettings::EMoveReportToInboxVisibleAndMatch);
-	
-	// Store the new service settings
-	account->SaveSettingsL(*iTestUtils.iServiceSettings);
-	CleanupStack::PopAndDestroy(account);
-	}
-	
-void CTestDeliverBase::CheckCreatedMessageL()
-	{
-	// Need to check the following - 
-	// 1. All recipients have correct delivery status - ENoAckRequested.
-	// 2. The index summary is correct - ENoAckSummary
-	// 3. The index message IS is invalid.
-	
-	iTestUtils.Printf(_L("Checking created message %d has correct flags set...\n"), iMessageId);
-		
-	// Restore the recipient...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils.iRichText);
-	CleanupStack::PushL(header);
-
-	MsvEntry().SetEntryL(iMessageId);
-	CMsvStore* store = iTestUtils.ReadStoreL();
-	CleanupStack::PushL(store);
-	header->RestoreL(*store);
-	CleanupStack::PopAndDestroy(store);
-	
-	TInt rcptCount = header->Recipients().Count();
-	for( TInt ii = 0; ii < rcptCount; ++ii )
-		{
-		CSmsNumber* rcpt = header->Recipients()[ii];
-		iTestUtils.Printf(_L("--Recipient %d - Delivery status -> %d - should be %d (ENoAckRequested)\n"), ii, rcpt->AckStatus(ESmsAckTypeDelivery), CSmsNumber::ENoAckRequested);
-		iTestUtils.Test()(rcpt->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::ENoAckRequested);
-		}
-		
-	TMsvSmsEntry entry = MsvEntry().Entry();
-	
-	iTestUtils.Printf(_L("--Index summary -> %d - should be %d (ENoAckSummary)\n"), entry.AckSummary(ESmsAckTypeDelivery), TMsvSmsEntry::ENoAckSummary);
-	iTestUtils.Test()(entry.AckSummary(ESmsAckTypeDelivery) == TMsvSmsEntry::ENoAckSummary);
-	
-	TLogId logId = 0;	
-	TBool validId = entry.MessageId(logId);
-	
-	iTestUtils.Printf(_L("--Index message Id validity -> %d - should be %d\n"), validId, EFalse);
-	iTestUtils.Test()(validId == EFalse);
-	
-	CleanupStack::PopAndDestroy(header);
-	}
-	
-TMsvId CTestDeliverBase::GetObserverEntry()
-	{
-	return iMessageId;
-	}
-
-// methods from CActive
-
-void CTestDeliverBase::RunL()
-	{
-	User::LeaveIfError(iStatus.Int());
-	
-	switch( iState )
-		{
-	case EClearFolders:
-		{
-		ClearFoldersL();
-		iState = EChangeServiceSettings;
-		CompleteSelf();
-		} break;
-	case EChangeServiceSettings:
-		{
-		ChangeServiceSettingsL();
-		iState = ECreateMessage;
-		CompleteSelf();
-		} break;			
-	case ECreateMessage:
-		{
-		CreateMessageL();
-		iState = ECheckCreatedMessage;
-		CompleteSelf();
-		} break;
-	case ECheckCreatedMessage:
-		{
-		CheckCreatedMessageL();
-		iState = ESendMessage;
-		CompleteSelf();
-		} break;
-	case ESendMessage:
-		{
-		SendMessageL();
-		iState = ECheckSentMessage;
-		} break;
-	case ECheckSentMessage:
-		{
-		CheckSentMessageL();
-		
-		TMsvId entryId = GetObserverEntry();
-		
-		if( entryId != KMsvNullIndexEntryId )
-			{
-			// Need to observe something - move observer entry to specified entry 
-			// and wait for it to be updated
-			iEntryForObserver->SetEntryL(entryId);
-			iEntryForObserver->AddObserverL(*this);
-			
-			iState = EPendingDeliveryReport;
-			}
-		else
-			{
-			// Not observing anything - end of test.
-			TestComplete();
-			}
-		} break;
-	case EPendingDeliveryReport:
-		{
-		// End the test...
-		TestComplete();
-		} break;			
-	default:
-		User::Invariant();
-		break;
-		}
-	}
-	
-void CTestDeliverBase::DoCancel()
-	{
-	}
-	
-TInt CTestDeliverBase::RunError(TInt /*aError*/)
-	{
-	return KErrNone;
-	}
-	
-//	methods from MMsvEntryObserver	
-	
-void CTestDeliverBase::HandleEntryEventL(TMsvEntryEvent aEvent, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/)
-	{
-	__ASSERT_DEBUG( iState == EPendingDeliveryReport, User::Invariant() );
-	
-	if( aEvent == EMsvEntryChanged )
-		{
-		iTestUtils.Printf(_L("Message entry has been updated\n"));
-
-		// Check that the sent message has been updated.
-		CheckDeliveredMessageL();
-		}
-	}
-	
-/*
- * CTestDeliverOneRecipientOk
- */
- 
- CTestDeliverOneRecipientOk* CTestDeliverOneRecipientOk::NewL(CSmsTestUtils& aTestUtils)
-	{
-	CTestDeliverOneRecipientOk* self = new (ELeave) CTestDeliverOneRecipientOk(aTestUtils);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;	
-	}
-		
-CTestDeliverOneRecipientOk::~CTestDeliverOneRecipientOk()
-	{
-	}
-	
-CTestDeliverOneRecipientOk::CTestDeliverOneRecipientOk(CSmsTestUtils& aTestUtils)
-: CTestDeliverBase(aTestUtils)
-	{
-	}
-		
-//	 methods from CTestDeliverBase
-
-void CTestDeliverOneRecipientOk::SetRecipientsL(CSmsHeader& aHeader)
-	{
-	iTestUtils.Printf(_L("--Setting single recipient\n"));
-	
-	CSmsNumber* rcpt = CSmsNumber::NewL();
-	CleanupStack::PushL(rcpt);
-	rcpt->SetAddressL(KRecipientOk);
-	aHeader.Recipients().AppendL(rcpt);
-	CleanupStack::Pop(rcpt);
-	}
-
-void CTestDeliverOneRecipientOk::CheckSentMessageL()
-	{
-	// Need to check the following - 
-	// 1. Correct number of recipients
-	// 2. The recipient has delivery status correctly set
-	// 3. The index summary is correctly set
-	// 4. The index message ID is valid.
-	// 5. The index message ID matches that of the recipient
-	
-	iTestUtils.Printf(_L("Checking sent message %d has correct flags set...\n"), iMessageId);
-		
-	// Restore the recipient...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils.iRichText);
-	CleanupStack::PushL(header);
-
-	MsvEntry().SetEntryL(iMessageId);
-	CMsvStore* store = iTestUtils.ReadStoreL();
-	CleanupStack::PushL(store);
-	header->RestoreL(*store);
-	CleanupStack::PopAndDestroy(store);
-	
-	iTestUtils.Printf(_L("--Number of recipients -> %d - should be %d\n"), header->Recipients().Count(), 1);
-	iTestUtils.Test()(header->Recipients().Count() == 1);
-	
-	CSmsNumber* rcpt = header->Recipients()[0];
-	
-	iTestUtils.Printf(_L("--Delivery status -> %d - should be %d (EPendingAck)\n"), rcpt->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EPendingAck);
-	iTestUtils.Test()(rcpt->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);
-	
-	TMsvSmsEntry entry = MsvEntry().Entry();
-	
-	iTestUtils.Printf(_L("--Index summary -> %d - should be %d (EPendingAcks)\n"), entry.AckSummary(ESmsAckTypeDelivery), TMsvSmsEntry::EPendingAcks);
-	iTestUtils.Test()(entry.AckSummary(ESmsAckTypeDelivery) == TMsvSmsEntry::EPendingAcks);
-	
-	TLogId logId = 0;	
-	TBool validId = entry.MessageId(logId);
-	
-	iTestUtils.Printf(_L("--Index message Id validity -> %d - should NOT be %d\n"), validId, EFalse);
-	iTestUtils.Test()(validId != EFalse);
-		
-	iTestUtils.Printf(_L("--Index message Id -> %d - should be %d\n"), logId, rcpt->LogId());
-	iTestUtils.Test()(logId == rcpt->LogId());
-	
-	CleanupStack::PopAndDestroy(header);
-	}
-	
-void CTestDeliverOneRecipientOk::CheckDeliveredMessageL()
-	{
-	// Need to check the following - 
-	// 1. Correct number of recipients
-	// 2. The recipient has delivery status correctly set
-	// 3. The index summary is correctly set
-	
-	iTestUtils.Printf(_L("Checking delivered message %d has correct flags set...\n"), iMessageId);
-		
-	// Restore the recipient...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils.iRichText);
-	CleanupStack::PushL(header);
-
-	MsvEntry().SetEntryL(KMsvGlobalInBoxIndexEntryId);
-	MsvEntry().SetEntryL(iMessageId);
-	CMsvStore* store = iTestUtils.ReadStoreL();
-	CleanupStack::PushL(store);
-	header->RestoreL(*store);
-	CleanupStack::PopAndDestroy(store);
-	
-	iTestUtils.Printf(_L("--Number of recipients -> %d - should be %d\n"), header->Recipients().Count(), 1);
-	iTestUtils.Test()(header->Recipients().Count() == 1);
-	
-	CSmsNumber* rcpt = header->Recipients()[0];
-	
-	iTestUtils.Printf(_L("--Delivery status -> %d - should be %d (EAckSuccessful)\n"), rcpt->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EAckSuccessful);
-	iTestUtils.Test()(rcpt->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckSuccessful);
-	
-	TMsvSmsEntry entry = MsvEntry().Entry();
-	
-	iTestUtils.Printf(_L("--Index summary -> %d - should be %d (EAllSuccessful)\n"), entry.AckSummary(ESmsAckTypeDelivery), TMsvSmsEntry::EAllSuccessful);
-	iTestUtils.Test()(entry.AckSummary(ESmsAckTypeDelivery) == TMsvSmsEntry::EAllSuccessful);
-	
-	// Test is no ended - complete self to stop.
-	CompleteSelf();		
-	
-	CleanupStack::PopAndDestroy(header);
-	}
-
-const TDesC& CTestDeliverOneRecipientOk::TestName()
-	{
-	return KTestDeliverOneRecipientOk();
-	}
-	
-/*
- * CTestDeliverOneRecipientFail
- */
- 
- CTestDeliverOneRecipientFail* CTestDeliverOneRecipientFail::NewL(CSmsTestUtils& aTestUtils)
-	{
-	CTestDeliverOneRecipientFail* self = new (ELeave) CTestDeliverOneRecipientFail(aTestUtils);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;	
-	}
-		
-CTestDeliverOneRecipientFail::~CTestDeliverOneRecipientFail()
-	{
-	}
-	
-CTestDeliverOneRecipientFail::CTestDeliverOneRecipientFail(CSmsTestUtils& aTestUtils)
-: CTestDeliverBase(aTestUtils)
-	{
-	}
-		
-//	 methods from CTestDeliverBase
-
-void CTestDeliverOneRecipientFail::SetRecipientsL(CSmsHeader& aHeader)
-	{
-	iTestUtils.Printf(_L("--Setting single recipient\n"));
-	
-	CSmsNumber* rcpt = CSmsNumber::NewL();
-	CleanupStack::PushL(rcpt);
-	rcpt->SetAddressL(KRecipientFail);
-	aHeader.Recipients().AppendL(rcpt);
-	CleanupStack::Pop(rcpt);
-	}
-	
-void CTestDeliverOneRecipientFail::CheckSentMessageL()
-	{
-	// Need to check the following - 
-	// 1. Correct number of recipients
-	// 2. The recipient has delivery status correctly set
-	// 3. The index summary is correctly set
-	// 4. The index message ID is valid.
-	// 5. The index message ID matches that of the recipient
-	
-	iTestUtils.Printf(_L("Checking sent message %d has correct flags set...\n"), iMessageId);
-		
-	// Restore the recipient...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils.iRichText);
-	CleanupStack::PushL(header);
-
-	MsvEntry().SetEntryL(iMessageId);
-	CMsvStore* store = iTestUtils.ReadStoreL();
-	CleanupStack::PushL(store);
-	header->RestoreL(*store);
-	CleanupStack::PopAndDestroy(store);
-	
-	iTestUtils.Printf(_L("--Number of recipients -> %d - should be %d\n"), header->Recipients().Count(), 1);
-	iTestUtils.Test()(header->Recipients().Count() == 1);
-	
-	CSmsNumber* rcpt = header->Recipients()[0];
-	
-	iTestUtils.Printf(_L("--Delivery status -> %d - should be %d (EPendingAck)\n"), rcpt->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EPendingAck);
-	iTestUtils.Test()(rcpt->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);
-	
-	TMsvSmsEntry entry = MsvEntry().Entry();
-	
-	iTestUtils.Printf(_L("--Index summary -> %d - should be %d (EPendingAcks)\n"), entry.AckSummary(ESmsAckTypeDelivery), TMsvSmsEntry::EPendingAcks);
-	iTestUtils.Test()(entry.AckSummary(ESmsAckTypeDelivery) == TMsvSmsEntry::EPendingAcks);
-	
-	TLogId logId = 0;	
-	TBool validId = entry.MessageId(logId);
-	
-	iTestUtils.Printf(_L("--Index message Id validity -> %d - should NOT be %d\n"), validId, EFalse);
-	iTestUtils.Test()(validId != EFalse);
-		
-	iTestUtils.Printf(_L("--Index message Id -> %d - should be %d\n"), logId, rcpt->LogId());
-	iTestUtils.Test()(logId == rcpt->LogId());
-	
-	CleanupStack::PopAndDestroy(header);
-	}
-	
-void CTestDeliverOneRecipientFail::CheckDeliveredMessageL()
-	{
-	// Need to check the following - 
-	// 1. Correct number of recipients
-	// 2. The recipient has delivery status correctly set
-	// 3. The index summary is correctly set
-	
- 	iTestUtils.Printf(_L("Checking delivered message %d has correct flags set...\n"), iMessageId);
-		
-	// Restore the recipient...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils.iRichText);
-	CleanupStack::PushL(header);
-
-	MsvEntry().SetEntryL(KMsvGlobalInBoxIndexEntryId);
-	MsvEntry().SetEntryL(iMessageId);
-	CMsvStore* store = iTestUtils.ReadStoreL();
-	CleanupStack::PushL(store);
-	header->RestoreL(*store);
-	CleanupStack::PopAndDestroy(store);
-	
-	iTestUtils.Printf(_L("--Number of recipients -> %d - should be %d\n"), header->Recipients().Count(), 1);
-	iTestUtils.Test()(header->Recipients().Count() == 1);
-	
-	CSmsNumber* rcpt = header->Recipients()[0];
-	
-	iTestUtils.Printf(_L("--Delivery status -> %d - should be %d (EAckError)\n"), rcpt->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EAckError);
-	iTestUtils.Test()(rcpt->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckError);
-	
-	iTestUtils.Printf(_L("- Recipient status -> %d - should be %d (EFailedToSend)\n"), rcpt->Status(), CMsvRecipient::EFailedToSend);
-	iTestUtils.Test()(rcpt->Status()==CMsvRecipient::EFailedToSend);
-
-	iTestUtils.Printf(_L("- Error status -> %d - should not be %d (ESmsShortMessageReceivedBySME)\n"), rcpt->Error(), TSmsStatus::ESmsShortMessageReceivedBySME);
-	iTestUtils.Test()(rcpt->Error()!= TSmsStatus::ESmsShortMessageReceivedBySME);
-	
-	TMsvSmsEntry entry = MsvEntry().Entry();
-	
-	iTestUtils.Printf(_L("--Index summary -> %d - should be %d (EAllFailed)\n"), entry.AckSummary(ESmsAckTypeDelivery), TMsvSmsEntry::EAllFailed);
-	iTestUtils.Test()(entry.AckSummary(ESmsAckTypeDelivery) == TMsvSmsEntry::EAllFailed);
-	
-	// Test is no ended - complete self to stop.
-	CompleteSelf();		
-	
-	CleanupStack::PopAndDestroy(header);
-	}
-
-const TDesC& CTestDeliverOneRecipientFail::TestName()
-	{
-	return KTestDeliverOneRecipientFail();
-	}
-	
-/*
- * CTestDeliverMultiRecipientsOk_1
- */
- 
-CTestDeliverMultiRecipientsOk_1* CTestDeliverMultiRecipientsOk_1::NewL(CSmsTestUtils& aTestUtils)
-	{
-	CTestDeliverMultiRecipientsOk_1* self = new (ELeave) CTestDeliverMultiRecipientsOk_1(aTestUtils);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;	
-	}
-		
-CTestDeliverMultiRecipientsOk_1::~CTestDeliverMultiRecipientsOk_1()
-	{
-	}
-	
-CTestDeliverMultiRecipientsOk_1::CTestDeliverMultiRecipientsOk_1(CSmsTestUtils& aTestUtils)
-: CTestDeliverBase(aTestUtils)
-	{
-	}
-	
-//	methods from CTestDeliverBase
-
-void CTestDeliverMultiRecipientsOk_1::SetRecipientsL(CSmsHeader& aHeader)
-	{
-	iTestUtils.Printf(_L("--Setting multiple (2) recipients\n"));
-	
-	CSmsNumber* rcpt0 = CSmsNumber::NewL();
-	CleanupStack::PushL(rcpt0);
-	rcpt0->SetAddressL(KRecipientOk);
-	aHeader.Recipients().AppendL(rcpt0);
-	CleanupStack::Pop(rcpt0);
-	
-	CSmsNumber* rcpt1 = CSmsNumber::NewL();
-	CleanupStack::PushL(rcpt1);
-	rcpt1->SetAddressL(KRecipientOk);
-	aHeader.Recipients().AppendL(rcpt1);
-	CleanupStack::Pop(rcpt1);
-	}
-	
-void CTestDeliverMultiRecipientsOk_1::CheckSentMessageL()
-	{
-	// Need to check the following - 
-	// 1. Correct number of recipients
-	// 2. The recipients have delivery status correctly set
-	// 3. The index summary is correctly set
-	// 4. The index message ID is valid.
-	// 5. The index message ID matches that of the recipient
-	
-	iTestUtils.Printf(_L("Checking sent message %d has correct flags set...\n"), iMessageId);
-		
-	// Restore the recipient...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils.iRichText);
-	CleanupStack::PushL(header);
-
-	MsvEntry().SetEntryL(iMessageId);
-	CMsvStore* store = iTestUtils.ReadStoreL();
-	CleanupStack::PushL(store);
-	header->RestoreL(*store);
-	CleanupStack::PopAndDestroy(store);
-	
-	iTestUtils.Printf(_L("--Number of recipients -> %d - should be %d\n"), header->Recipients().Count(), 2);
-	iTestUtils.Test()(header->Recipients().Count() == 2);
-	
-	CSmsNumber* rcpt0 = header->Recipients()[0];
-	
-	iTestUtils.Printf(_L("--Recipient 0 - Delivery status -> %d - should be %d (EPendingAck)\n"), rcpt0->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EPendingAck);
-	iTestUtils.Test()(rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);
-	
-	CSmsNumber* rcpt1 = header->Recipients()[1];
-	
-	iTestUtils.Printf(_L("--Recipient 1 - Delivery status -> %d - should be %d (EPendingAck)\n"), rcpt1->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EPendingAck);
-	iTestUtils.Test()(rcpt1->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);	
-	
-	TMsvSmsEntry entry = MsvEntry().Entry();
-	
-	iTestUtils.Printf(_L("--Index summary -> %d - should be %d (EPendingAcks)\n"), entry.AckSummary(ESmsAckTypeDelivery), TMsvSmsEntry::EPendingAcks);
-	iTestUtils.Test()(entry.AckSummary(ESmsAckTypeDelivery) == TMsvSmsEntry::EPendingAcks);
-	
-	TLogId logId = 0;	
-	TBool validId = entry.MessageId(logId);
-	
-	iTestUtils.Printf(_L("--Index message Id validity -> %d - should be %d\n"), validId, EFalse);
-	iTestUtils.Test()(validId == EFalse);
-		
-	CleanupStack::PopAndDestroy(header);
-	}
-	
-void CTestDeliverMultiRecipientsOk_1::CheckDeliveredMessageL()
-	{
-	// Need to check the following - 
-	// 1. Correct number of recipients
-	// 2. The recipient has delivery status is correctly set
-	// 3. The index summary is correctly set
-
-	iTestUtils.Printf(_L("Checking delivered message %d has correct flags set - round %d...\n"), iMessageId, ++iCheckCount);
-		
-	// Restore the recipient...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils.iRichText);
-	CleanupStack::PushL(header);
-
-	MsvEntry().SetEntryL(KMsvGlobalInBoxIndexEntryId);
-	MsvEntry().SetEntryL(iMessageId);
-	CMsvStore* store = iTestUtils.ReadStoreL();
-	CleanupStack::PushL(store);
-	header->RestoreL(*store);
-	CleanupStack::PopAndDestroy(store);
-	
-	iTestUtils.Printf(_L("--Number of recipients -> %d - should be %d\n"), header->Recipients().Count(), 2);
-	iTestUtils.Test()(header->Recipients().Count() == 2);
-	
-	CSmsNumber* rcpt0 = header->Recipients()[0];
-	CSmsNumber* rcpt1 = header->Recipients()[1];
-	
-	TMsvSmsEntry entry = MsvEntry().Entry();
-
-	if( iCheckCount == 1 )
-		{
-		// At least one of the recipients has been delivered to ok - check the 
-		// status of recipient 0 and make decisions based on that.
-		CSmsNumber* pendingRcpt = NULL;
-		
-		if( rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck )
-			{
-			// Recipient 1 delivered to first...
-			iTestUtils.Printf(_L("--Recipient 0 - Delivery status -> %d - should be %d (EPendingAck)\n"), rcpt0->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EPendingAck);
-			iTestUtils.Test()(rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);
-			
-			iTestUtils.Printf(_L("--Recipient 1 - Delivery status -> %d - should be %d (EAckSuccessful)\n"), rcpt1->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EAckSuccessful);
-			iTestUtils.Test()(rcpt1->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckSuccessful);
-			
-			pendingRcpt = rcpt0;
-			}
-		else
-			{
-			// Recipient 0 delivered to first...
-			iTestUtils.Printf(_L("--Recipient 0 - Delivery status -> %d - should be %d (EAckSuccessful)\n"), rcpt0->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EAckSuccessful);
-			iTestUtils.Test()(rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckSuccessful);
-			
-			iTestUtils.Printf(_L("--Recipient 1 - Delivery status -> %d - should be %d (EPendingAck)\n"), rcpt1->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EPendingAck);
-			iTestUtils.Test()(rcpt1->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);
-			
-			pendingRcpt = rcpt1;
-			}
-		TLogId logId = 0;	
-		TBool validId = entry.MessageId(logId);
-		
-		iTestUtils.Printf(_L("--Index message Id validity -> %d - should NOT be %d\n"), validId, EFalse);
-		iTestUtils.Test()(validId != EFalse);
-			
-		iTestUtils.Printf(_L("--Index message Id -> %d - should be %d\n"), logId, pendingRcpt->LogId());
-		iTestUtils.Test()(logId == pendingRcpt->LogId());
-		}
-	else
-		{
-		// Both recipients has been delivered to ok - check the status of both
-		// recipients
-		iTestUtils.Printf(_L("--Second check of flags -> both recipients have been delivered to\n"));
-		
-		iTestUtils.Printf(_L("--Recipient 0 - Delivery status -> %d - should be %d (EAckSuccessful)\n"), rcpt0->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EAckSuccessful);
-		iTestUtils.Test()(rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckSuccessful);
-	
-		iTestUtils.Printf(_L("--Recipient 1 - Delivery status -> %d - should be %d (EAckSuccessful)\n"), rcpt1->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EAckSuccessful);
-		iTestUtils.Test()(rcpt1->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckSuccessful);
-		
-		iTestUtils.Printf(_L("--Index summary -> %d - should be %d (EAllSuccessful)\n"), entry.AckSummary(ESmsAckTypeDelivery), TMsvSmsEntry::EAllSuccessful);
-		iTestUtils.Test()(entry.AckSummary(ESmsAckTypeDelivery) == TMsvSmsEntry::EAllSuccessful);
-
-		// Test is no ended - complete self to stop.
-		CompleteSelf();		
-		}
-	CleanupStack::PopAndDestroy(header);
-	}
-
-const TDesC& CTestDeliverMultiRecipientsOk_1::TestName()
-	{
-	return KTestDeliverMultiRecipientsOk_1();
-	}
-	
-/*
- * CTestDeliverMultiRecipientsOk_2
- */
- 
-CTestDeliverMultiRecipientsOk_2* CTestDeliverMultiRecipientsOk_2::NewL(CSmsTestUtils& aTestUtils)
-	{
-	CTestDeliverMultiRecipientsOk_2* self = new (ELeave) CTestDeliverMultiRecipientsOk_2(aTestUtils);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;	
-	}
-		
-CTestDeliverMultiRecipientsOk_2::~CTestDeliverMultiRecipientsOk_2()
-	{
-	}
-	
-CTestDeliverMultiRecipientsOk_2::CTestDeliverMultiRecipientsOk_2(CSmsTestUtils& aTestUtils)
-: CTestDeliverBase(aTestUtils)
-	{
-	}
-	
-//	methods from CTestDeliverBase
-
-void CTestDeliverMultiRecipientsOk_2::SetRecipientsL(CSmsHeader& aHeader)
-	{
-	iTestUtils.Printf(_L("--Setting multiple (2) recipients\n"));
-	
-	CSmsNumber* rcpt0 = CSmsNumber::NewL();
-	CleanupStack::PushL(rcpt0);
-	rcpt0->SetAddressL(KRecipientOk);
-	aHeader.Recipients().AppendL(rcpt0);
-	CleanupStack::Pop(rcpt0);
-	
-	CSmsNumber* rcpt1 = CSmsNumber::NewL();
-	CleanupStack::PushL(rcpt1);
-	rcpt1->SetAddressL(KRecipientBad);
-	aHeader.Recipients().AppendL(rcpt1);
-	CleanupStack::Pop(rcpt1);
-	}
-
-void CTestDeliverMultiRecipientsOk_2::CheckSentMessageL()
-	{
-	// Need to check the following - 
-	// 1. Correct number of recipients
-	// 2. The recipients have delivery status correctly set
-	// 3. The index summary is correctly set
-	// 4. The index message ID is valid.
-	// 5. The index message ID matches that of the recipient
-	
-	iTestUtils.Printf(_L("Checking sent message %d has correct flags set...\n"), iMessageId);
-		
-	// Restore the recipient...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils.iRichText);
-	CleanupStack::PushL(header);
-
-	MsvEntry().SetEntryL(iMessageId);
-	CMsvStore* store = iTestUtils.ReadStoreL();
-	CleanupStack::PushL(store);
-	header->RestoreL(*store);
-	CleanupStack::PopAndDestroy(store);
-	
-	iTestUtils.Printf(_L("--Number of recipients -> %d - should be %d\n"), header->Recipients().Count(), 2);
-	iTestUtils.Test()(header->Recipients().Count() == 2);
-	
-	CSmsNumber* rcpt0 = header->Recipients()[0];
-	
-	iTestUtils.Printf(_L("--Recipient 0 - Delivery status -> %d - should be %d (EPendingAck)\n"), rcpt0->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EPendingAck);
-	iTestUtils.Test()(rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);
-	
-	CSmsNumber* rcpt1 = header->Recipients()[1];
-	
-	iTestUtils.Printf(_L("--Recipient 1 - Delivery status -> %d - should be %d (ENoAckRequested)\n"), rcpt1->AckStatus(ESmsAckTypeDelivery), CSmsNumber::ENoAckRequested);
-	iTestUtils.Test()(rcpt1->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::ENoAckRequested);	
-	
-	TMsvSmsEntry entry = MsvEntry().Entry();
-	
-	iTestUtils.Printf(_L("--Index summary -> %d - should be %d (EPendingAcks)\n"), entry.AckSummary(ESmsAckTypeDelivery), TMsvSmsEntry::EPendingAcks);
-	iTestUtils.Test()(entry.AckSummary(ESmsAckTypeDelivery) == TMsvSmsEntry::EPendingAcks);
-	
-	TLogId logId = 0;	
-	TBool validId = entry.MessageId(logId);
-	
-	iTestUtils.Printf(_L("--Index message Id validity -> %d - should NOT be %d\n"), validId, EFalse);
-	iTestUtils.Test()(validId != EFalse);
-		
-	iTestUtils.Printf(_L("--Index message Id -> %d - should be %d\n"), logId, rcpt0->LogId());
-	iTestUtils.Test()(logId == rcpt0->LogId());
-		
-	CleanupStack::PopAndDestroy(header);
-	}
-	
-void CTestDeliverMultiRecipientsOk_2::CheckDeliveredMessageL()
-	{
-	// Need to check the following - 
-	// 1. Correct number of recipients
-	// 2. The recipient has delivery status is correctly set
-	// 3. The index summary is correctly set
-
-	iTestUtils.Printf(_L("Checking delivered message %d has correct flags set...\n"), iMessageId);
-		
-	// Restore the recipient...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils.iRichText);
-	CleanupStack::PushL(header);
-
-	MsvEntry().SetEntryL(KMsvGlobalInBoxIndexEntryId);
-	MsvEntry().SetEntryL(iMessageId);
-	CMsvStore* store = iTestUtils.ReadStoreL();
-	CleanupStack::PushL(store);
-	header->RestoreL(*store);
-	CleanupStack::PopAndDestroy(store);
-	
-	iTestUtils.Printf(_L("--Number of recipients -> %d - should be %d\n"), header->Recipients().Count(), 2);
-	iTestUtils.Test()(header->Recipients().Count() == 2);
-	
-	CSmsNumber* rcpt0 = header->Recipients()[0];
-	CSmsNumber* rcpt1 = header->Recipients()[1];
-	
-	TMsvSmsEntry entry = MsvEntry().Entry();
-
-	iTestUtils.Printf(_L("--Recipient 0 - Delivery status -> %d - should be %d (EAckSuccessful)\n"), rcpt0->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EAckSuccessful);
-	iTestUtils.Test()(rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckSuccessful);
-	
-	iTestUtils.Printf(_L("--Recipient 1 - Delivery status -> %d - should be %d (ENoAckRequested)\n"), rcpt1->AckStatus(ESmsAckTypeDelivery), CSmsNumber::ENoAckRequested);
-	iTestUtils.Test()(rcpt1->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::ENoAckRequested);
-	
-	iTestUtils.Printf(_L("--Index summary -> %d - should be %d (EAllSuccessful)\n"), entry.AckSummary(ESmsAckTypeDelivery), TMsvSmsEntry::EAllSuccessful);
-	iTestUtils.Test()(entry.AckSummary(ESmsAckTypeDelivery) == TMsvSmsEntry::EAllSuccessful);
-
-	// Test is no ended - complete self to stop.
-	CompleteSelf();		
-
-	CleanupStack::PopAndDestroy(header);
-	}
-
-const TDesC& CTestDeliverMultiRecipientsOk_2::TestName()
-	{
-	return KTestDeliverMultiRecipientsOk_2();
-	}
-	
-/*
- * CTestDeliverMultiRecipientsOk_3
- */
- 
-CTestDeliverMultiRecipientsOk_3* CTestDeliverMultiRecipientsOk_3::NewL(CSmsTestUtils& aTestUtils)
-	{
-	CTestDeliverMultiRecipientsOk_3* self = new (ELeave) CTestDeliverMultiRecipientsOk_3(aTestUtils);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;	
-	}
-		
-CTestDeliverMultiRecipientsOk_3::~CTestDeliverMultiRecipientsOk_3()
-	{
-	}
-	
-CTestDeliverMultiRecipientsOk_3::CTestDeliverMultiRecipientsOk_3(CSmsTestUtils& aTestUtils)
-: CTestDeliverBase(aTestUtils)
-	{
-	}
-	
-//	methods from CTestDeliverBase
-
-void CTestDeliverMultiRecipientsOk_3::SetRecipientsL(CSmsHeader& aHeader)
-	{
-	iTestUtils.Printf(_L("--Setting multiple (3) recipients\n"));
-	
-	CSmsNumber* rcpt0 = CSmsNumber::NewL();
-	CleanupStack::PushL(rcpt0);
-	rcpt0->SetAddressL(KRecipientOk);
-	aHeader.Recipients().AppendL(rcpt0);
-	CleanupStack::Pop(rcpt0);
-	
-	CSmsNumber* rcpt1 = CSmsNumber::NewL();
-	CleanupStack::PushL(rcpt1);
-	rcpt1->SetAddressL(KRecipientOk);
-	aHeader.Recipients().AppendL(rcpt1);
-	CleanupStack::Pop(rcpt1);
-
-	CSmsNumber* rcpt2 = CSmsNumber::NewL();
-	CleanupStack::PushL(rcpt2);
-	rcpt2->SetAddressL(KRecipientBad);
-	aHeader.Recipients().AppendL(rcpt2);
-	CleanupStack::Pop(rcpt2);
-	}
-
-void CTestDeliverMultiRecipientsOk_3::CheckSentMessageL()
-	{
-	// Need to check the following - 
-	// 1. Correct number of recipients
-	// 2. The recipients have delivery status correctly set
-	// 3. The index summary is correctly set
-	// 4. The index message ID is valid.
-	// 5. The index message ID matches that of the recipient
-	
-	iTestUtils.Printf(_L("Checking sent message %d has correct flags set...\n"), iMessageId);
-		
-	// Restore the recipient...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils.iRichText);
-	CleanupStack::PushL(header);
-
-	MsvEntry().SetEntryL(iMessageId);
-	CMsvStore* store = iTestUtils.ReadStoreL();
-	CleanupStack::PushL(store);
-	header->RestoreL(*store);
-	CleanupStack::PopAndDestroy(store);
-	
-	iTestUtils.Printf(_L("--Number of recipients -> %d - should be %d\n"), header->Recipients().Count(), 3);
-	iTestUtils.Test()(header->Recipients().Count() == 3);
-	
-	CSmsNumber* rcpt0 = header->Recipients()[0];
-	
-	iTestUtils.Printf(_L("--Recipient 0 - Delivery status -> %d - should be %d (EPendingAck)\n"), rcpt0->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EPendingAck);
-	iTestUtils.Test()(rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);
-	
-	CSmsNumber* rcpt1 = header->Recipients()[1];
-	
-	iTestUtils.Printf(_L("--Recipient 1 - Delivery status -> %d - should be %d (EPendingAck)\n"), rcpt1->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EPendingAck);
-	iTestUtils.Test()(rcpt1->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);	
-	
-	CSmsNumber* rcpt2 = header->Recipients()[2];
-	
-	iTestUtils.Printf(_L("--Recipient 2 - Delivery status -> %d - should be %d (ENoAckRequested)\n"), rcpt2->AckStatus(ESmsAckTypeDelivery), CSmsNumber::ENoAckRequested);
-	iTestUtils.Test()(rcpt2->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::ENoAckRequested);
-
-	TMsvSmsEntry entry = MsvEntry().Entry();
-	
-	iTestUtils.Printf(_L("--Index summary -> %d - should be %d (EPendingAcks)\n"), entry.AckSummary(ESmsAckTypeDelivery), TMsvSmsEntry::EPendingAcks);
-	iTestUtils.Test()(entry.AckSummary(ESmsAckTypeDelivery) == TMsvSmsEntry::EPendingAcks);
-	
-	TLogId logId = 0;	
-	TBool validId = entry.MessageId(logId);
-	
-	iTestUtils.Printf(_L("--Index message Id validity -> %d - should be %d\n"), validId, EFalse);
-	iTestUtils.Test()(validId == EFalse);
-		
-	CleanupStack::PopAndDestroy(header);
-	}
-	
-void CTestDeliverMultiRecipientsOk_3::CheckDeliveredMessageL()
-	{
-	// Need to check the following - 
-	// 1. Correct number of recipients
-	// 2. The recipient has delivery status is correctly set
-	// 3. The index summary is correctly set
-
-	iTestUtils.Printf(_L("Checking delivered message %d has correct flags set - round %d...\n"), iMessageId, ++iCheckCount);
-		
-	// Restore the recipient...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils.iRichText);
-	CleanupStack::PushL(header);
-
-	MsvEntry().SetEntryL(KMsvGlobalInBoxIndexEntryId);
-	MsvEntry().SetEntryL(iMessageId);
-	CMsvStore* store = iTestUtils.ReadStoreL();
-	CleanupStack::PushL(store);
-	header->RestoreL(*store);
-	CleanupStack::PopAndDestroy(store);
-	
-	iTestUtils.Printf(_L("--Number of recipients -> %d - should be %d\n"), header->Recipients().Count(), 3);
-	iTestUtils.Test()(header->Recipients().Count() == 3);
-	
-	CSmsNumber* rcpt0 = header->Recipients()[0];
-	CSmsNumber* rcpt1 = header->Recipients()[1];
-	CSmsNumber* rcpt2 = header->Recipients()[2];
-	
-	TMsvSmsEntry entry = MsvEntry().Entry();
-		
-	if( iCheckCount == 1 )
-		{
-		// At least one of the recipients has been delivered to ok - check the 
-		// status of recipient 0 and make decisions based on that.
-		CSmsNumber* pendingRcpt = NULL;
-		
-		if( rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck )
-			{
-			// Recipient 2 delivered to first...
-			iTestUtils.Printf(_L("--Recipient 0 - Delivery status -> %d - should be %d (EPendingAck)\n"), rcpt0->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EPendingAck);
-			iTestUtils.Test()(rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);
-			
-			iTestUtils.Printf(_L("--Recipient 1 - Delivery status -> %d - should be %d (EAckSuccessful)\n"), rcpt1->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EAckSuccessful);
-			iTestUtils.Test()(rcpt1->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckSuccessful);
-			
-			iTestUtils.Printf(_L("--Recipient 2 - Delivery status -> %d - should be %d (ENoAckRequested)\n"), rcpt2->AckStatus(ESmsAckTypeDelivery), CSmsNumber::ENoAckRequested);
-			iTestUtils.Test()(rcpt2->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::ENoAckRequested);
-			
-			pendingRcpt = rcpt0;
-			}
-		else
-			{
-			// Recipient 0 delivered to first...
-			iTestUtils.Printf(_L("--Recipient 0 - Delivery status -> %d - should be %d (EAckSuccessful)\n"), rcpt0->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EAckSuccessful);
-			iTestUtils.Test()(rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckSuccessful);
-			
-			iTestUtils.Printf(_L("--Recipient 1 - Delivery status -> %d - should be %d (EPendingAck)\n"), rcpt1->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EPendingAck);
-			iTestUtils.Test()(rcpt1->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);
-			
-			iTestUtils.Printf(_L("--Recipient 2 - Delivery status -> %d - should be %d (ENoAckRequested)\n"), rcpt2->AckStatus(ESmsAckTypeDelivery), CSmsNumber::ENoAckRequested);
-			iTestUtils.Test()(rcpt2->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::ENoAckRequested);
-			
-			pendingRcpt = rcpt1;
-			}
-		TLogId logId = 0;	
-		TBool validId = entry.MessageId(logId);
-		
-		iTestUtils.Printf(_L("--Index message Id validity -> %d - should NOT be %d\n"), validId, EFalse);
-		iTestUtils.Test()(validId != EFalse);
-			
-		iTestUtils.Printf(_L("--Index message Id -> %d - should be %d\n"), logId, pendingRcpt->LogId());
-		iTestUtils.Test()(logId == pendingRcpt->LogId());
-		}
-	else
-		{
-		// Both recipients has been delivered to ok - check the status of both
-		// recipients
-		iTestUtils.Printf(_L("--Recipient 0 - Delivery status -> %d - should be %d (EAckSuccessful)\n"), rcpt0->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EAckSuccessful);
-		iTestUtils.Test()(rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckSuccessful);
-		
-		iTestUtils.Printf(_L("--Recipient 1 - Delivery status -> %d - should be %d (EAckSuccessful)\n"), rcpt1->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EAckSuccessful);
-		iTestUtils.Test()(rcpt1->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckSuccessful);
-		
-		iTestUtils.Printf(_L("--Recipient 2 - Delivery status -> %d - should be %d (ENoAckRequested)\n"), rcpt2->AckStatus(ESmsAckTypeDelivery), CSmsNumber::ENoAckRequested);
-		iTestUtils.Test()(rcpt2->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::ENoAckRequested);
-
-		iTestUtils.Printf(_L("--Index summary -> %d - should be %d (EAllSuccessful)\n"), entry.AckSummary(ESmsAckTypeDelivery), TMsvSmsEntry::EAllSuccessful);
-		iTestUtils.Test()(entry.AckSummary(ESmsAckTypeDelivery) == TMsvSmsEntry::EAllSuccessful);
-
-		// Test is no ended - complete self to stop.
-		CompleteSelf();		
-		}
-	
-	CleanupStack::PopAndDestroy(header);
-	}
-
-const TDesC& CTestDeliverMultiRecipientsOk_3::TestName()
-	{
-	return KTestDeliverMultiRecipientsOk_3();
-	}
-	
-/*
- * CTestDeliverNoMatching
- */
- 
- CTestDeliverNoMatching* CTestDeliverNoMatching::NewL(CSmsTestUtils& aTestUtils)
-	{
-	CTestDeliverNoMatching* self = new (ELeave) CTestDeliverNoMatching(aTestUtils);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;	
-	}
-		
-CTestDeliverNoMatching::~CTestDeliverNoMatching()
-	{
-	}
-	
-CTestDeliverNoMatching::CTestDeliverNoMatching(CSmsTestUtils& aTestUtils)
-: CTestDeliverBase(aTestUtils)
-	{
-	}
-	
-//	methods from MMsvEntryObserver	
-	
-void CTestDeliverNoMatching::HandleEntryEventL(TMsvEntryEvent aEvent, TAny* aArg1, TAny* /*aArg2*/, TAny* /*aArg3*/)
-	{
-	if( aEvent == EMsvNewChildren )
-		{
-		iTestUtils.Printf(_L("Received new message in Inbox - should be status report...\n"));
-		
-		CMsvEntrySelection* sel = static_cast<CMsvEntrySelection*>(aArg1);
-
-		// Check how many mesasges there are - should be just 1
-		TInt count = sel->Count();
-
-		iTestUtils.Printf(_L("--Number of new messages -> %d - should be %d\n"), count, 1);
-		iTestUtils.Test()(count == 1);
-		
-		// Restore the message
-
-		CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils.iRichText);
-		CleanupStack::PushL(header);
-
-		MsvEntry().SetEntryL((*sel)[0]);
-		CMsvStore* store = MsvEntry().ReadStoreL();
-		CleanupStack::PushL(store);
-
-		header->RestoreL(*store);
-		iTestUtils.iRichText->Reset();
-		store->RestoreBodyTextL(*iTestUtils.iRichText);
-
-		CleanupStack::PopAndDestroy(store);
-		
-		// Check that it's a Status Report...
-		iTestUtils.Printf(_L("--Message type -> %d - should be %d\n"), header->Type(), CSmsPDU::ESmsStatusReport);
-		iTestUtils.Test()(header->Type() == CSmsPDU::ESmsStatusReport);
-		
-		// Check the message reference
-		TLogId logId = header->Message().LogServerId();
-		iTestUtils.Printf(_L("--Log Server Id -> %d - should be %d\n"), logId, iLogId);
-		iTestUtils.Test()(logId == iLogId);
-		
-		// Check the deliver status
-		CSmsStatusReport& report = header->StatusReport();
-		iTestUtils.Printf(_L("--Deliver status -> %d - should be %d (ESmsShortMessageReceivedBySME)\n"), report.Status(), TSmsStatus::ESmsShortMessageReceivedBySME);
-		iTestUtils.Test()(report.Status() == TSmsStatus::ESmsShortMessageReceivedBySME);
-		
-		CleanupStack::PopAndDestroy(header);
-		
-		// Check that the sent message has been updated.
-		CheckDeliveredMessageL();
-		}
-	}
-				
-//	 methods from CTestDeliverBase
-
-void CTestDeliverNoMatching::SetRecipientsL(CSmsHeader& aHeader)
-	{
-	iTestUtils.Printf(_L("--Setting single recipient\n"));
-	
-	CSmsNumber* rcpt = CSmsNumber::NewL();
-	CleanupStack::PushL(rcpt);
-	rcpt->SetAddressL(KRecipientOk);
-	aHeader.Recipients().AppendL(rcpt);
-	CleanupStack::Pop(rcpt);
-	}
-
-void CTestDeliverNoMatching::ChangeServiceSettingsL()
-	{
-	// Restore the service settings.
-	iTestUtils.SetEntryL(iTestUtils.iSmsServiceId);
-	CSmsAccount* account = CSmsAccount::NewLC();
-	account->LoadSettingsL(*iTestUtils.iServiceSettings);
-	
-	// Set the service settings 
-	iTestUtils.iServiceSettings->SetValidityPeriod(TTimeIntervalMinutes(5));
-	iTestUtils.iServiceSettings->SetDeliveryReport(ETrue);
-	iTestUtils.iServiceSettings->SetStatusReportHandling(CSmsSettings::EMoveReportToInboxVisible);
-	
-	// Store the new service settings
-	account->SaveSettingsL(*iTestUtils.iServiceSettings);
-	CleanupStack::PopAndDestroy(account);
-	}
-	
-TMsvId CTestDeliverNoMatching::GetObserverEntry()
-	{
-	return KMsvGlobalInBoxIndexEntryId;
-	}
-
-void CTestDeliverNoMatching::CheckSentMessageL()
-	{
-	// Need to check the following - 
-	// 1. Correct number of recipients
-	// 2. The recipient has delivery status correctly set
-	// 3. The index summary is correctly set
-	// 4. The index message ID is valid.
-	// 5. The index message ID matches that of the recipient
-	
-	iTestUtils.Printf(_L("Checking sent message %d has correct flags set...\n"), iMessageId);
-		
-	// Restore the recipient...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils.iRichText);
-	CleanupStack::PushL(header);
-
-	MsvEntry().SetEntryL(iMessageId);
-	CMsvStore* store = iTestUtils.ReadStoreL();
-	CleanupStack::PushL(store);
-	header->RestoreL(*store);
-	CleanupStack::PopAndDestroy(store);
-	
-	iTestUtils.Printf(_L("--Number of recipients -> %d - should be %d\n"), header->Recipients().Count(), 1);
-	iTestUtils.Test()(header->Recipients().Count() == 1);
-	
-	CSmsNumber* rcpt = header->Recipients()[0];
-	
-	iTestUtils.Printf(_L("--Delivery status -> %d - should be %d (EPendingAck)\n"), rcpt->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EPendingAck);
-	iTestUtils.Test()(rcpt->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);
-	
-	TMsvSmsEntry entry = MsvEntry().Entry();
-	
-	iTestUtils.Printf(_L("--Index summary -> %d - should be %d (EPendingAcks)\n"), entry.AckSummary(ESmsAckTypeDelivery), TMsvSmsEntry::EPendingAcks);
-	iTestUtils.Test()(entry.AckSummary(ESmsAckTypeDelivery) == TMsvSmsEntry::EPendingAcks);
-	
-	TLogId logId = 0;	
-	TBool validId = entry.MessageId(logId);
-	
-	iTestUtils.Printf(_L("--Index message Id validity -> %d - should NOT be %d\n"), validId, EFalse);
-	iTestUtils.Test()(validId != EFalse);
-		
-	iTestUtils.Printf(_L("--Index message Id -> %d - should be %d\n"), logId, rcpt->LogId());
-	iTestUtils.Test()(logId == rcpt->LogId());
-	
-	iLogId = rcpt->LogId();
-	
-	CleanupStack::PopAndDestroy(header);
-	}
-	
-void CTestDeliverNoMatching::CheckDeliveredMessageL()
-	{
-	// Need to check the following - 
-	// 1. Correct number of recipients
-	// 2. The recipient has delivery status correctly set
-	// 3. The index summary is correctly set
-	
-	iTestUtils.Printf(_L("Checking delivered message %d has correct flags set...\n"), iMessageId);
-		
-	// Restore the recipient...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils.iRichText);
-	CleanupStack::PushL(header);
-
-	MsvEntry().SetEntryL(KMsvGlobalInBoxIndexEntryId);
-	MsvEntry().SetEntryL(iMessageId);
-	CMsvStore* store = iTestUtils.ReadStoreL();
-	CleanupStack::PushL(store);
-	header->RestoreL(*store);
-	CleanupStack::PopAndDestroy(store);
-	
-	iTestUtils.Printf(_L("--Number of recipients -> %d - should be %d\n"), header->Recipients().Count(), 1);
-	iTestUtils.Test()(header->Recipients().Count() == 1);
-	
-	CSmsNumber* rcpt = header->Recipients()[0];
-	
-	iTestUtils.Printf(_L("--Delivery status -> %d - should be %d (EPendingAck)\n"), rcpt->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EPendingAck);
-	iTestUtils.Test()(rcpt->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);
-	
-	TMsvSmsEntry entry = MsvEntry().Entry();
-	
-	iTestUtils.Printf(_L("--Index summary -> %d - should be %d (EPendingAcks)\n"), entry.AckSummary(ESmsAckTypeDelivery), TMsvSmsEntry::EPendingAcks);
-	iTestUtils.Test()(entry.AckSummary(ESmsAckTypeDelivery) == TMsvSmsEntry::EPendingAcks);
-	
-	// Test is no ended - complete self to stop.
-	CompleteSelf();		
-	
-	CleanupStack::PopAndDestroy(header);
-	}
-
-const TDesC& CTestDeliverNoMatching::TestName()
-	{
-	return KTestDeliverNoMatching();
-	}
-	
-/*
- * CTestDeliverNoStatusReports
- */
- 
- CTestDeliverNoStatusReports* CTestDeliverNoStatusReports::NewL(CSmsTestUtils& aTestUtils)
-	{
-	CTestDeliverNoStatusReports* self = new (ELeave) CTestDeliverNoStatusReports(aTestUtils);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;	
-	}
-		
-CTestDeliverNoStatusReports::~CTestDeliverNoStatusReports()
-	{
-	}
-	
-CTestDeliverNoStatusReports::CTestDeliverNoStatusReports(CSmsTestUtils& aTestUtils)
-: CTestDeliverBase(aTestUtils)
-	{
-	}
-				
-//	 methods from CTestDeliverBase
-
-void CTestDeliverNoStatusReports::SetRecipientsL(CSmsHeader& aHeader)
-	{
-	iTestUtils.Printf(_L("--Setting single recipient\n"));
-	
-	CSmsNumber* rcpt = CSmsNumber::NewL();
-	CleanupStack::PushL(rcpt);
-	rcpt->SetAddressL(KRecipientOk);
-	aHeader.Recipients().AppendL(rcpt);
-	CleanupStack::Pop(rcpt);
-	}
-
-void CTestDeliverNoStatusReports::ChangeServiceSettingsL()
-	{
-	// Restore the service settings.
-	iTestUtils.SetEntryL(iTestUtils.iSmsServiceId);
-	CSmsAccount* account = CSmsAccount::NewLC();
-	account->LoadSettingsL(*iTestUtils.iServiceSettings);
-	
-	// Set the service settings 
-	iTestUtils.iServiceSettings->SetValidityPeriod(TTimeIntervalMinutes(5));
-	iTestUtils.iServiceSettings->SetDeliveryReport(EFalse);
-	iTestUtils.iServiceSettings->SetStatusReportHandling(CSmsSettings::EMoveReportToInboxVisibleAndMatch);
-	
-	// Store the new service settings
-	account->SaveSettingsL(*iTestUtils.iServiceSettings);
-	CleanupStack::PopAndDestroy(account);
-	}
-	
-TMsvId CTestDeliverNoStatusReports::GetObserverEntry()
-	{
-	return KMsvNullIndexEntryId;
-	}
-
-void CTestDeliverNoStatusReports::CheckSentMessageL()
-	{
-	// Need to check the following - 
-	// 1. Correct number of recipients
-	// 2. The recipient has delivery status correctly set
-	// 3. The index summary is correctly set
-	// 4. The index message ID is valid.
-	// 5. The index message ID matches that of the recipient
-	
-	iTestUtils.Printf(_L("Checking sent message %d has correct flags set...\n"), iMessageId);
-		
-	// Restore the recipient...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils.iRichText);
-	CleanupStack::PushL(header);
-
-	MsvEntry().SetEntryL(iMessageId);
-	CMsvStore* store = iTestUtils.ReadStoreL();
-	CleanupStack::PushL(store);
-	header->RestoreL(*store);
-	CleanupStack::PopAndDestroy(store);
-	
-	iTestUtils.Printf(_L("--Number of recipients -> %d - should be %d\n"), header->Recipients().Count(), 1);
-	iTestUtils.Test()(header->Recipients().Count() == 1);
-	
-	CSmsNumber* rcpt = header->Recipients()[0];
-	
-	iTestUtils.Printf(_L("--Delivery status -> %d - should be %d (ENoAckRequested)\n"), rcpt->AckStatus(ESmsAckTypeDelivery), CSmsNumber::ENoAckRequested);
-	iTestUtils.Test()(rcpt->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::ENoAckRequested);
-	
-	TMsvSmsEntry entry = MsvEntry().Entry();
-	
-	iTestUtils.Printf(_L("--Index summary -> %d - should be %d (ENoAckSummary)\n"), entry.AckSummary(ESmsAckTypeDelivery), TMsvSmsEntry::ENoAckSummary);
-	iTestUtils.Test()(entry.AckSummary(ESmsAckTypeDelivery) == TMsvSmsEntry::ENoAckSummary);
-	
-	TLogId logId = 0;	
-	TBool validId = entry.MessageId(logId);
-	
-	iTestUtils.Printf(_L("--Index message Id validity -> %d - should be %d\n"), validId, EFalse);
-	iTestUtils.Test()(validId == EFalse);
-		
-	CleanupStack::PopAndDestroy(header);
-	}
-	
-void CTestDeliverNoStatusReports::CheckDeliveredMessageL()
-	{
-	User::Invariant();
-	}
-
-const TDesC& CTestDeliverNoStatusReports::TestName()
-	{
-	return KTestDeliverNoStatusReports();
-	}
-	
-/*
- * CTestDeliverNotSent
- */
- 
- CTestDeliverNotSent* CTestDeliverNotSent::NewL(CSmsTestUtils& aTestUtils)
-	{
-	CTestDeliverNotSent* self = new (ELeave) CTestDeliverNotSent(aTestUtils);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;	
-	}
-		
-CTestDeliverNotSent::~CTestDeliverNotSent()
-	{
-	}
-	
-CTestDeliverNotSent::CTestDeliverNotSent(CSmsTestUtils& aTestUtils)
-: CTestDeliverBase(aTestUtils)
-	{
-	}
-				
-//	 methods from CTestDeliverBase
-
-void CTestDeliverNotSent::SetRecipientsL(CSmsHeader& aHeader)
-	{
-	iTestUtils.Printf(_L("--Setting single recipient\n"));
-	
-	CSmsNumber* rcpt = CSmsNumber::NewL();
-	CleanupStack::PushL(rcpt);
-	rcpt->SetAddressL(KRecipientBad);
-	aHeader.Recipients().AppendL(rcpt);
-	CleanupStack::Pop(rcpt);
-	}
-
-TMsvId CTestDeliverNotSent::GetObserverEntry()
-	{
-	return KMsvNullIndexEntryId;
-	}
-
-void CTestDeliverNotSent::CheckSentMessageL()
-	{
-	// Need to check the following - 
-	// 1. Correct number of recipients
-	// 2. The recipient has delivery status correctly set
-	// 3. The index summary is correctly set
-	// 4. The index message ID is valid.
-	// 5. The index message ID matches that of the recipient
-	
-	iTestUtils.Printf(_L("Checking sent message %d has correct flags set...\n"), iMessageId);
-		
-	// Restore the recipient...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils.iRichText);
-	CleanupStack::PushL(header);
-
-	MsvEntry().SetEntryL(iMessageId);
-	CMsvStore* store = iTestUtils.ReadStoreL();
-	CleanupStack::PushL(store);
-	header->RestoreL(*store);
-	CleanupStack::PopAndDestroy(store);
-	
-	iTestUtils.Printf(_L("--Number of recipients -> %d - should be %d\n"), header->Recipients().Count(), 1);
-	iTestUtils.Test()(header->Recipients().Count() == 1);
-	
-	CSmsNumber* rcpt = header->Recipients()[0];
-	
-	iTestUtils.Printf(_L("--Delivery status -> %d - should be %d (ENoAckRequested)\n"), rcpt->AckStatus(ESmsAckTypeDelivery), CSmsNumber::ENoAckRequested);
-	iTestUtils.Test()(rcpt->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::ENoAckRequested);
-	
-	TMsvSmsEntry entry = MsvEntry().Entry();
-	
-	iTestUtils.Printf(_L("--Index summary -> %d - should be %d (ENoAckSummary)\n"), entry.AckSummary(ESmsAckTypeDelivery), TMsvSmsEntry::ENoAckSummary);
-	iTestUtils.Test()(entry.AckSummary(ESmsAckTypeDelivery) == TMsvSmsEntry::ENoAckSummary);
-	
-	TLogId logId = 0;	
-	TBool validId = entry.MessageId(logId);
-	
-	iTestUtils.Printf(_L("--Index message Id validity -> %d - should be %d\n"), validId, EFalse);
-	iTestUtils.Test()(validId == EFalse);
-		
-	CleanupStack::PopAndDestroy(header);
-	}
-	
-void CTestDeliverNotSent::CheckDeliveredMessageL()
-	{
-	User::Invariant();
-	}
-
-const TDesC& CTestDeliverNotSent::TestName()
-	{
-	return KTestDeliverNotSent();
-	}
-
-/*
- * CTestDeliverMultiRecipientsFail_1
- */
- 
-CTestDeliverMultiRecipientsFail_1* CTestDeliverMultiRecipientsFail_1::NewL(CSmsTestUtils& aTestUtils)
-	{
-	CTestDeliverMultiRecipientsFail_1* self = new (ELeave) CTestDeliverMultiRecipientsFail_1(aTestUtils);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;	
-	}
-		
-CTestDeliverMultiRecipientsFail_1::~CTestDeliverMultiRecipientsFail_1()
-	{
-	}
-	
-CTestDeliverMultiRecipientsFail_1::CTestDeliverMultiRecipientsFail_1(CSmsTestUtils& aTestUtils)
-: CTestDeliverBase(aTestUtils)
-	{
-	}
-	
-//	methods from CTestDeliverBase
-
-void CTestDeliverMultiRecipientsFail_1::SetRecipientsL(CSmsHeader& aHeader)
-	{
-	iTestUtils.Printf(_L("--Setting multiple (3) recipients\n"));
-	
-	CSmsNumber* rcpt0 = CSmsNumber::NewL();
-	CleanupStack::PushL(rcpt0);
-	rcpt0->SetAddressL(KRecipientFail);
-	aHeader.Recipients().AppendL(rcpt0);
-	CleanupStack::Pop(rcpt0);
-	
-	CSmsNumber* rcpt1 = CSmsNumber::NewL();
-	CleanupStack::PushL(rcpt1);
-	rcpt1->SetAddressL(KRecipientFail);
-	aHeader.Recipients().AppendL(rcpt1);
-	CleanupStack::Pop(rcpt1);
-	}
-	
-void CTestDeliverMultiRecipientsFail_1::CheckSentMessageL()
-	{
-	// Need to check the following - 
-	// 1. Correct number of recipients
-	// 2. The recipients have delivery status correctly set
-	// 3. The index summary is correctly set
-	// 4. The index message ID is valid.
-	// 5. The index message ID matches that of the recipient
-	
-	iTestUtils.Printf(_L("Checking sent message %d has correct flags set...\n"), iMessageId);
-		
-	// Restore the recipient...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils.iRichText);
-	CleanupStack::PushL(header);
-
-	MsvEntry().SetEntryL(iMessageId);
-	CMsvStore* store = iTestUtils.ReadStoreL();
-	CleanupStack::PushL(store);
-	header->RestoreL(*store);
-	CleanupStack::PopAndDestroy(store);
-	
-	iTestUtils.Printf(_L("--Number of recipients -> %d - should be %d\n"), header->Recipients().Count(), 2);
-	iTestUtils.Test()(header->Recipients().Count() == 2);
-	
-	CSmsNumber* rcpt0 = header->Recipients()[0];
-	
-	iTestUtils.Printf(_L("--Recipient 0 - Delivery status -> %d - should be %d (EPendingAck)\n"), rcpt0->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EPendingAck);
-	iTestUtils.Test()(rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);
-	
-	CSmsNumber* rcpt1 = header->Recipients()[1];
-	
-	iTestUtils.Printf(_L("--Recipient 1 - Delivery status -> %d - should be %d (EPendingAck)\n"), rcpt1->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EPendingAck);
-	iTestUtils.Test()(rcpt1->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);	
-	
-	TMsvSmsEntry entry = MsvEntry().Entry();
-	
-	iTestUtils.Printf(_L("--Index summary -> %d - should be %d (EPendingAcks)\n"), entry.AckSummary(ESmsAckTypeDelivery), TMsvSmsEntry::EPendingAcks);
-	iTestUtils.Test()(entry.AckSummary(ESmsAckTypeDelivery) == TMsvSmsEntry::EPendingAcks);
-	
-	TLogId logId = 0;	
-	TBool validId = entry.MessageId(logId);
-	
-	iTestUtils.Printf(_L("--Index message Id validity -> %d - should be %d\n"), validId, EFalse);
-	iTestUtils.Test()(validId == EFalse);
-		
-	CleanupStack::PopAndDestroy(header);
-	}
-	
-void CTestDeliverMultiRecipientsFail_1::CheckDeliveredMessageL()
-	{
-	// Need to check the following - 
-	// 1. Correct number of recipients
-	// 2. The recipient has delivery status is correctly set
-	// 3. The index summary is correctly set
-
-	iTestUtils.Printf(_L("Checking delivered message %d has correct flags set - round %d...\n"), iMessageId, ++iCheckCount);
-		
-	// Restore the recipient...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils.iRichText);
-	CleanupStack::PushL(header);
-
-	MsvEntry().SetEntryL(KMsvGlobalInBoxIndexEntryId);
-	MsvEntry().SetEntryL(iMessageId);
-	CMsvStore* store = iTestUtils.ReadStoreL();
-	CleanupStack::PushL(store);
-	header->RestoreL(*store);
-	CleanupStack::PopAndDestroy(store);
-	
-	iTestUtils.Printf(_L("--Number of recipients -> %d - should be %d\n"), header->Recipients().Count(), 2);
-	iTestUtils.Test()(header->Recipients().Count() == 2);
-	
-	CSmsNumber* rcpt0 = header->Recipients()[0];
-	CSmsNumber* rcpt1 = header->Recipients()[1];
-	TMsvSmsEntry entry = MsvEntry().Entry();
-		
-	if( iCheckCount == 1 )
-		{
-		// At least one of the recipients has been delivered to ok - check the 
-		// status of recipient 0 and make decisions based on that.
-		CSmsNumber* pendingRcpt = NULL;
-		
-		if( rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck )
-			{
-			// Recipient 2 delivered to first...
-			iTestUtils.Printf(_L("--Recipient 0 - Delivery status -> %d - should be %d (EPendingAck)\n"), rcpt0->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EPendingAck);
-			iTestUtils.Test()(rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);
-			
-			iTestUtils.Printf(_L("--Recipient 1 - Delivery status -> %d - should be %d (EAckError)\n"), rcpt1->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EAckError);
-			iTestUtils.Test()(rcpt1->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckError);
-			
-			iTestUtils.Printf(_L("--Recipient 1 - Recipient status -> %d - should be %d (EFailedToSend)\n"), rcpt1->Status(), CMsvRecipient::EFailedToSend);
-			iTestUtils.Test()(rcpt1->Status()==CMsvRecipient::EFailedToSend);
-
-			iTestUtils.Printf(_L("--Recipient 1 - Error status -> %d - should not be %d (ESmsShortMessageReceivedBySME)\n"), rcpt1->Error(), TSmsStatus::ESmsShortMessageReceivedBySME);
-			iTestUtils.Test()(rcpt1->Error()!= TSmsStatus::ESmsShortMessageReceivedBySME);
-			
-			pendingRcpt = rcpt0;
-			}
-		else
-			{
-			// Recipient 0 delivered to first...
-			iTestUtils.Printf(_L("--Recipient 0 - Delivery status -> %d - should be %d (EAckError)\n"), rcpt0->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EAckError);
-			iTestUtils.Test()(rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckError);
-			
-			iTestUtils.Printf(_L("--Recipient 0 - Recipient status -> %d - should be %d (EFailedToSend)\n"), rcpt0->Status(), CMsvRecipient::EFailedToSend);
-			iTestUtils.Test()(rcpt0->Status()==CMsvRecipient::EFailedToSend);
-			
-			iTestUtils.Printf(_L("--Recipient 0 - Error status -> %d - should not be %d (ESmsShortMessageReceivedBySME)\n"), rcpt0->Error(), TSmsStatus::ESmsShortMessageReceivedBySME);
-			iTestUtils.Test()(rcpt0->Error()!= TSmsStatus::ESmsShortMessageReceivedBySME);				
-		
-			iTestUtils.Printf(_L("--Recipient 1 - Delivery status -> %d - should be %d (EPendingAck)\n"), rcpt1->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EPendingAck);
-			iTestUtils.Test()(rcpt1->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);
-			
-			pendingRcpt = rcpt1;
-			}
-		TLogId logId = 0;	
-		TBool validId = entry.MessageId(logId);
-		
-		iTestUtils.Printf(_L("--Index message Id validity -> %d - should NOT be %d\n"), validId, EFalse);
-		iTestUtils.Test()(validId != EFalse);
-			
-		iTestUtils.Printf(_L("--Index message Id -> %d - should be %d\n"), logId, pendingRcpt->LogId());
-		iTestUtils.Test()(logId == pendingRcpt->LogId());
-		}
-	else
-		{
-		// Both recipients has been delivered to ok - check the status of both
-		// recipients
-		iTestUtils.Printf(_L("--Recipient 0 - Delivery status -> %d - should be %d (EAckError)\n"), rcpt0->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EAckError);
-		iTestUtils.Test()(rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckError);
-		
-		iTestUtils.Printf(_L("--Recipient 0 - Recipient status -> %d - should be %d (EFailedToSend)\n"), rcpt0->Status(), CMsvRecipient::EFailedToSend);
-		iTestUtils.Test()(rcpt0->Status()==CMsvRecipient::EFailedToSend);
-	
-		iTestUtils.Printf(_L("--Recipient 0 - Error status -> %d - should not be %d (ESmsShortMessageReceivedBySME)\n"), rcpt0->Error(), TSmsStatus::ESmsShortMessageReceivedBySME);
-		iTestUtils.Test()(rcpt0->Error()!= TSmsStatus::ESmsShortMessageReceivedBySME);
-		
-		iTestUtils.Printf(_L("--Recipient 1 - Delivery status -> %d - should be %d (EAckError)\n"), rcpt1->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EAckError);
-		iTestUtils.Test()(rcpt1->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckError);
-		
-		iTestUtils.Printf(_L("--Recipient 1 - Recipient status -> %d - should be %d (EFailedToSend)\n"), rcpt1->Status(), CMsvRecipient::EFailedToSend);
-		iTestUtils.Test()(rcpt1->Status()==CMsvRecipient::EFailedToSend);
-				
-		iTestUtils.Printf(_L("--Recipient 1 - Error status -> %d - should not be %d (ESmsShortMessageReceivedBySME)\n"), rcpt1->Error(), TSmsStatus::ESmsShortMessageReceivedBySME);
-		iTestUtils.Test()(rcpt1->Error()!= TSmsStatus::ESmsShortMessageReceivedBySME);
-		
-		iTestUtils.Printf(_L("--Index summary -> %d - should be %d (EAllFailed)\n"), entry.AckSummary(ESmsAckTypeDelivery), TMsvSmsEntry::EAllFailed);
-		iTestUtils.Test()(entry.AckSummary(ESmsAckTypeDelivery) == TMsvSmsEntry::EAllFailed);
-
-		// Test is no ended - complete self to stop.
-		CompleteSelf();		
-		}
-	
-	CleanupStack::PopAndDestroy(header);
-	}
-
-const TDesC& CTestDeliverMultiRecipientsFail_1::TestName()
-	{
-	return KTestDeliverMultiRecipientsFail_1();
-	}
-
-/*
- * CTestDeliverMultiRecipientsMixed_1
- */
- 
-CTestDeliverMultiRecipientsMixed_1* CTestDeliverMultiRecipientsMixed_1::NewL(CSmsTestUtils& aTestUtils)
-	{
-	CTestDeliverMultiRecipientsMixed_1* self = new (ELeave) CTestDeliverMultiRecipientsMixed_1(aTestUtils);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;	
-	}
-		
-CTestDeliverMultiRecipientsMixed_1::~CTestDeliverMultiRecipientsMixed_1()
-	{
-	}
-	
-CTestDeliverMultiRecipientsMixed_1::CTestDeliverMultiRecipientsMixed_1(CSmsTestUtils& aTestUtils)
-: CTestDeliverBase(aTestUtils)
-	{
-	}
-	
-//	methods from CTestDeliverBase
-
-void CTestDeliverMultiRecipientsMixed_1::SetRecipientsL(CSmsHeader& aHeader)
-	{
-	iTestUtils.Printf(_L("--Setting multiple (3) recipients\n"));
-	
-	CSmsNumber* rcpt0 = CSmsNumber::NewL();
-	CleanupStack::PushL(rcpt0);
-	rcpt0->SetAddressL(KRecipientFail);
-	aHeader.Recipients().AppendL(rcpt0);
-	CleanupStack::Pop(rcpt0);
-	
-	CSmsNumber* rcpt1 = CSmsNumber::NewL();
-	CleanupStack::PushL(rcpt1);
-	rcpt1->SetAddressL(KRecipientOk);
-	aHeader.Recipients().AppendL(rcpt1);
-	CleanupStack::Pop(rcpt1);
-	}
-	
-void CTestDeliverMultiRecipientsMixed_1::CheckSentMessageL()
-	{
-	// Need to check the following - 
-	// 1. Correct number of recipients
-	// 2. The recipients have delivery status correctly set
-	// 3. The index summary is correctly set
-	// 4. The index message ID is valid.
-	// 5. The index message ID matches that of the recipient
-	
-	iTestUtils.Printf(_L("Checking sent message %d has correct flags set...\n"), iMessageId);
-		
-	// Restore the recipient...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils.iRichText);
-	CleanupStack::PushL(header);
-
-	MsvEntry().SetEntryL(iMessageId);
-	CMsvStore* store = iTestUtils.ReadStoreL();
-	CleanupStack::PushL(store);
-	header->RestoreL(*store);
-	CleanupStack::PopAndDestroy(store);
-	
-	iTestUtils.Printf(_L("--Number of recipients -> %d - should be %d\n"), header->Recipients().Count(), 2);
-	iTestUtils.Test()(header->Recipients().Count() == 2);
-	
-	CSmsNumber* rcpt0 = header->Recipients()[0];
-	
-	iTestUtils.Printf(_L("--Recipient 0 - Delivery status -> %d - should be %d (EPendingAck)\n"), rcpt0->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EPendingAck);
-	iTestUtils.Test()(rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);
-	
-	CSmsNumber* rcpt1 = header->Recipients()[1];
-	
-	iTestUtils.Printf(_L("--Recipient 1 - Delivery status -> %d - should be %d (EPendingAck)\n"), rcpt1->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EPendingAck);
-	iTestUtils.Test()(rcpt1->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);	
-	
-	TMsvSmsEntry entry = MsvEntry().Entry();
-	
-	iTestUtils.Printf(_L("--Index summary -> %d - should be %d (EPendingAcks)\n"), entry.AckSummary(ESmsAckTypeDelivery), TMsvSmsEntry::EPendingAcks);
-	iTestUtils.Test()(entry.AckSummary(ESmsAckTypeDelivery) == TMsvSmsEntry::EPendingAcks);
-	
-	TLogId logId = 0;	
-	TBool validId = entry.MessageId(logId);
-	
-	iTestUtils.Printf(_L("--Index message Id validity -> %d - should be %d\n"), validId, EFalse);
-	iTestUtils.Test()(validId == EFalse);
-		
-	CleanupStack::PopAndDestroy(header);
-	}
-	
-void CTestDeliverMultiRecipientsMixed_1::CheckDeliveredMessageL()
-	{
-	// Need to check the following - 
-	// 1. Correct number of recipients
-	// 2. The recipient has delivery status is correctly set
-	// 3. The index summary is correctly set
-
-	iTestUtils.Printf(_L("Checking delivered message %d has correct flags set - round %d...\n"), iMessageId, ++iCheckCount);
-		
-	// Restore the recipient...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils.iRichText);
-	CleanupStack::PushL(header);
-
-	MsvEntry().SetEntryL(KMsvGlobalInBoxIndexEntryId);
-	MsvEntry().SetEntryL(iMessageId);
-	CMsvStore* store = iTestUtils.ReadStoreL();
-	CleanupStack::PushL(store);
-	header->RestoreL(*store);
-	CleanupStack::PopAndDestroy(store);
-	
-	iTestUtils.Printf(_L("--Number of recipients -> %d - should be %d\n"), header->Recipients().Count(), 2);
-	iTestUtils.Test()(header->Recipients().Count() == 2);
-	
-	CSmsNumber* rcpt0 = header->Recipients()[0];
-	CSmsNumber* rcpt1 = header->Recipients()[1];
-	
-	TMsvSmsEntry entry = MsvEntry().Entry();
-		
-	if( iCheckCount == 1 )
-		{
-		// At least one of the recipients has been delivered to ok - check the 
-		// status of recipient 0 and make decisions based on that.
-		CSmsNumber* pendingRcpt = NULL;
-		
-		if( rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck )
-			{
-			// Recipient 2 delivered to first...
-			iTestUtils.Printf(_L("--Recipient 0 - Delivery status -> %d - should be %d (EPendingAck)\n"), rcpt0->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EPendingAck);
-			iTestUtils.Test()(rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);
-			
-			iTestUtils.Printf(_L("--Recipient 1 - Delivery status -> %d - should be %d (EAckSuccessful)\n"), rcpt1->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EAckSuccessful);
-			iTestUtils.Test()(rcpt1->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckSuccessful);
-			
-			pendingRcpt = rcpt0;
-			}
-		else
-			{
-			// Recipient 0 delivered to first...
-			iTestUtils.Printf(_L("--Recipient 0 - Delivery status -> %d - should be %d (EAckError)\n"), rcpt0->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EAckError);
-			iTestUtils.Test()(rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckError);
-			
-			iTestUtils.Printf(_L("--Recipient 0 - Recipient status -> %d - should be %d (EFailedToSend)\n"), rcpt0->Status(), CMsvRecipient::EFailedToSend);
-			iTestUtils.Test()(rcpt0->Status()==CMsvRecipient::EFailedToSend);
-
-			iTestUtils.Printf(_L("--Recipient 0 - Error status -> %d - should not be %d (ESmsShortMessageReceivedBySME)\n"), rcpt0->Error(), TSmsStatus::ESmsShortMessageReceivedBySME);
-			iTestUtils.Test()(rcpt0->Error()!= TSmsStatus::ESmsShortMessageReceivedBySME);
-			
-			iTestUtils.Printf(_L("--Recipient 1 - Delivery status -> %d - should be %d (EPendingAck)\n"), rcpt1->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EPendingAck);
-			iTestUtils.Test()(rcpt1->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);
-			
-			pendingRcpt = rcpt1;
-			}
-		TLogId logId = 0;	
-		TBool validId = entry.MessageId(logId);
-		
-		iTestUtils.Printf(_L("--Index message Id validity -> %d - should NOT be %d\n"), validId, EFalse);
-		iTestUtils.Test()(validId != EFalse);
-			
-		iTestUtils.Printf(_L("--Index message Id -> %d - should be %d\n"), logId, pendingRcpt->LogId());
-		iTestUtils.Test()(logId == pendingRcpt->LogId());
-		}
-	else
-		{
-		// Status-reports for both recipients have been received - check the 
-		// status of both recipients.
-		iTestUtils.Printf(_L("--Recipient 0 - Delivery status -> %d - should be %d (EAckError)\n"), rcpt0->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EAckError);
-		iTestUtils.Test()(rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckError);
-		
-		iTestUtils.Printf(_L("--Recipient 0 - Recipient status -> %d - should be %d (EFailedToSend)\n"), rcpt0->Status(), CMsvRecipient::EFailedToSend);
-		iTestUtils.Test()(rcpt0->Status()==CMsvRecipient::EFailedToSend);
-
-		iTestUtils.Printf(_L("--Recipient 0 - Error status -> %d - should not be %d (ESmsShortMessageReceivedBySME)\n"), rcpt0->Error(), TSmsStatus::ESmsShortMessageReceivedBySME);
-		iTestUtils.Test()(rcpt0->Error()!= TSmsStatus::ESmsShortMessageReceivedBySME);
-		
-		iTestUtils.Printf(_L("--Recipient 1 - Delivery status -> %d - should be %d (EAckSuccessful)\n"), rcpt1->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EAckSuccessful);
-		iTestUtils.Test()(rcpt1->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckSuccessful);
-		
-		iTestUtils.Printf(_L("--Index summary -> %d - should be %d (EMixed)\n"), entry.AckSummary(ESmsAckTypeDelivery), TMsvSmsEntry::EMixed);
-		iTestUtils.Test()(entry.AckSummary(ESmsAckTypeDelivery) == TMsvSmsEntry::EMixed);
-
-		// Test is no ended - complete self to stop.
-		CompleteSelf();		
-		}
-	
-	CleanupStack::PopAndDestroy(header);
-	}
-
-const TDesC& CTestDeliverMultiRecipientsMixed_1::TestName()
-	{
-	return KTestDeliverMultiRecipientsMixed_1();
-	}
-
-/*
- * CTestDeliverMultiRecipientsMixed_2
- */
-
-CTestDeliverMultiRecipientsMixed_2* CTestDeliverMultiRecipientsMixed_2::NewL(CSmsTestUtils& aTestUtils)
-	{
-	CTestDeliverMultiRecipientsMixed_2* self = new (ELeave) CTestDeliverMultiRecipientsMixed_2(aTestUtils);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-CTestDeliverMultiRecipientsMixed_2::~CTestDeliverMultiRecipientsMixed_2()
-	{
-	}
-
-CTestDeliverMultiRecipientsMixed_2::CTestDeliverMultiRecipientsMixed_2(CSmsTestUtils& aTestUtils)
-: CTestDeliverBase(aTestUtils)
-	{
-	}
-
-//	methods from CTestDeliverBase
-
-void CTestDeliverMultiRecipientsMixed_2::SetRecipientsL(CSmsHeader& aHeader)
-	{
-	iTestUtils.Printf(_L("--Setting multiple (2) recipients\n"));
-
-	CSmsNumber* rcpt0 = CSmsNumber::NewL();
-	CleanupStack::PushL(rcpt0);
-	rcpt0->SetAddressL(KRecipientFail);
-	aHeader.Recipients().AppendL(rcpt0);
-	CleanupStack::Pop(rcpt0);
-
-	CSmsNumber* rcpt1 = CSmsNumber::NewL();
-	CleanupStack::PushL(rcpt1);
-	rcpt1->SetAddressL(KRecipientFail);
-	aHeader.Recipients().AppendL(rcpt1);
-	CleanupStack::Pop(rcpt1);
-	}
-
-void CTestDeliverMultiRecipientsMixed_2::CheckSentMessageL()
-	{
-	// Need to check the following -
-	// 1. Correct number of recipients
-	// 2. The recipients have delivery status correctly set
-	// 3. The index summary is correctly set
-	// 4. The index message ID is valid.
-	// 5. The index message ID matches that of the recipient
-
-	iTestUtils.Printf(_L("Checking sent message %d has correct flags set...\n"), iMessageId);
-
-	// Restore the recipient...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils.iRichText);
-	CleanupStack::PushL(header);
-
-	MsvEntry().SetEntryL(iMessageId);
-	CMsvStore* store = iTestUtils.ReadStoreL();
-	CleanupStack::PushL(store);
-	header->RestoreL(*store);
-	CleanupStack::PopAndDestroy(store);
-
-	iTestUtils.Printf(_L("--Number of recipients -> %d - should be %d\n"), header->Recipients().Count(), 2);
-	iTestUtils.Test()(header->Recipients().Count() == 2);
-
-	CSmsNumber* rcpt0 = header->Recipients()[0];
-
-	iTestUtils.Printf(_L("--Recipient 0 - Delivery status -> %d - should be %d (EPendingAck)\n"), rcpt0->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EPendingAck);
-	iTestUtils.Test()(rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);
-
-	CSmsNumber* rcpt1 = header->Recipients()[1];
-
-	iTestUtils.Printf(_L("--Recipient 1 - Delivery status -> %d - should be %d (EPendingAck)\n"), rcpt1->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EPendingAck);
-	iTestUtils.Test()(rcpt1->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);
-
-	TMsvSmsEntry entry = MsvEntry().Entry();
-
-	iTestUtils.Printf(_L("--Index summary -> %d - should be %d (EPendingAcks)\n"), entry.AckSummary(ESmsAckTypeDelivery), TMsvSmsEntry::EPendingAcks);
-	iTestUtils.Test()(entry.AckSummary(ESmsAckTypeDelivery) == TMsvSmsEntry::EPendingAcks);
-
-	TLogId logId = 0;
-	TBool validId = entry.MessageId(logId);
-
-	iTestUtils.Printf(_L("--Index message Id validity -> %d - should be %d\n"), validId, EFalse);
-	iTestUtils.Test()(validId == EFalse);
-
-	CleanupStack::PopAndDestroy(header);
-	}
-
-void CTestDeliverMultiRecipientsMixed_2::CheckDeliveredMessageL()
-	{
-	// Need to check the following -
-	// 1. Correct number of recipients
-	// 2. The recipient has delivery status is correctly set
-	// 3. The index summary is correctly set
-
-	iTestUtils.Printf(_L("Checking delivered message %d has correct flags set - round %d...\n"), iMessageId, ++iCheckCount);
-
-	// Restore the recipient...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils.iRichText);
-	CleanupStack::PushL(header);
-
-	MsvEntry().SetEntryL(KMsvGlobalInBoxIndexEntryId);
-	MsvEntry().SetEntryL(iMessageId);
-	CMsvStore* store = iTestUtils.ReadStoreL();
-	CleanupStack::PushL(store);
-	header->RestoreL(*store);
-	CleanupStack::PopAndDestroy(store);
-
-	iTestUtils.Printf(_L("--Number of recipients -> %d - should be %d\n"), header->Recipients().Count(), 2);
-	iTestUtils.Test()(header->Recipients().Count() == 2);
-
-	CSmsNumber* rcpt0 = header->Recipients()[0];
-	CSmsNumber* rcpt1 = header->Recipients()[1];
-
-	TMsvSmsEntry entry = MsvEntry().Entry();
-
-	if( iCheckCount == 1 )
-		{
-		// At least one of the recipients has been delivered to ok - check the
-		// status of recipient 0 and make decisions based on that.
-		CSmsNumber* pendingRcpt = NULL;
-
-		if( rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck )
-			{
-			// Recipient 2 delivered to first...
-			iTestUtils.Printf(_L("--Recipient 0 - Delivery status -> %d - should be %d (EPendingAck)\n"), rcpt0->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EPendingAck);
-			iTestUtils.Test()(rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);
-
-			iTestUtils.Printf(_L("--Recipient 1 - Delivery status -> %d - should be %d (EAckError)\n"), rcpt1->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EAckError);
-			iTestUtils.Test()(rcpt1->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckError);
-
-			iTestUtils.Printf(_L("--Recipient 1 - Recipient status -> %d - should be %d (EFailedToSend)\n"), rcpt1->Status(), CMsvRecipient::EFailedToSend);
-			iTestUtils.Test()(rcpt1->Status()==CMsvRecipient::EFailedToSend);
-
-			iTestUtils.Printf(_L("--Recipient 1 - Error status -> %d - should not be %d (ESmsShortMessageReceivedBySME)\n"), rcpt1->Error(), TSmsStatus::ESmsShortMessageReceivedBySME);
-			iTestUtils.Test()(rcpt1->Error()!= TSmsStatus::ESmsShortMessageReceivedBySME);
-		
-
-			pendingRcpt = rcpt0;
-			}
-		else
-			{
-			// Recipient 0 delivered to first...
-			iTestUtils.Printf(_L("--Recipient 0 - Delivery status -> %d - should be %d (EAckError)\n"), rcpt0->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EAckError);
-			iTestUtils.Test()(rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckError);
-
-			iTestUtils.Printf(_L("--Recipient 0 - Recipient status -> %d - should be %d (EFailedToSend)\n"), rcpt0->Status(), CMsvRecipient::EFailedToSend);
-			iTestUtils.Test()(rcpt0->Status()==CMsvRecipient::EFailedToSend);
-
-			iTestUtils.Printf(_L("--Recipient 0 - Error status -> %d - should not be %d (ESmsShortMessageReceivedBySME)\n"), rcpt0->Error(), TSmsStatus::ESmsShortMessageReceivedBySME);
-			iTestUtils.Test()(rcpt0->Error()!= TSmsStatus::ESmsShortMessageReceivedBySME);
-			
-			iTestUtils.Printf(_L("--Recipient 1 - Delivery status -> %d - should be %d (EPendingAck)\n"), rcpt1->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EPendingAck);
-			iTestUtils.Test()(rcpt1->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EPendingAck);
-
-			pendingRcpt = rcpt1;
-			}
-		TLogId logId = 0;
-		TBool validId = entry.MessageId(logId);
-
-		iTestUtils.Printf(_L("--Index message Id validity -> %d - should NOT be %d\n"), validId, EFalse);
-		iTestUtils.Test()(validId != EFalse);
-
-		iTestUtils.Printf(_L("--Index message Id -> %d - should be %d\n"), logId, pendingRcpt->LogId());
-		iTestUtils.Test()(logId == pendingRcpt->LogId());
-		}
-	else
-		{
-		// Status-reports for both recipients have been received - check the
-		// status of both recipients.
-		iTestUtils.Printf(_L("--Recipient 0 - Delivery status -> %d - should be %d (EAckError)\n"), rcpt0->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EAckError);
-		iTestUtils.Test()(rcpt0->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckError);
-
-		iTestUtils.Printf(_L("--Recipient 0 - Recipient status -> %d - should be %d (EFailedToSend)\n"), rcpt0->Status(), CMsvRecipient::EFailedToSend);
-		iTestUtils.Test()(rcpt0->Status()==CMsvRecipient::EFailedToSend);
-
-		iTestUtils.Printf(_L("--Recipient 0 - Error status -> %d - should not be %d (ESmsShortMessageReceivedBySME)\n"), rcpt0->Error(), TSmsStatus::ESmsShortMessageReceivedBySME);
-		iTestUtils.Test()(rcpt0->Error()!= TSmsStatus::ESmsShortMessageReceivedBySME);
-		
-		iTestUtils.Printf(_L("--Recipient 1 - Delivery status -> %d - should be %d (EAckError)\n"), rcpt1->AckStatus(ESmsAckTypeDelivery), CSmsNumber::EAckError);
-		iTestUtils.Test()(rcpt1->AckStatus(ESmsAckTypeDelivery) == CSmsNumber::EAckError);
-		
-		iTestUtils.Printf(_L("--Recipient 1 - Recipient status -> %d - should be %d (EFailedToSend)\n"), rcpt1->Status(), CMsvRecipient::EFailedToSend);
-		iTestUtils.Test()(rcpt1->Status()==CMsvRecipient::EFailedToSend);
-
-		iTestUtils.Printf(_L("--Recipient 1 - Error status -> %d - should not be %d (ESmsShortMessageReceivedBySME)\n"), rcpt1->Error(), TSmsStatus::ESmsShortMessageReceivedBySME);
-		iTestUtils.Test()(rcpt1->Error()!= TSmsStatus::ESmsShortMessageReceivedBySME);
-		
-		iTestUtils.Printf(_L("--Index summary -> %d - should be %d (EAllFailed)\n"), entry.AckSummary(ESmsAckTypeDelivery), TMsvSmsEntry::EAllFailed);
-		iTestUtils.Test()(entry.AckSummary(ESmsAckTypeDelivery) == TMsvSmsEntry::EAllFailed);
-
-		// Test is no ended - complete self to stop.
-		CompleteSelf();
-		}
-
-	CleanupStack::PopAndDestroy(header);
-	}
-
-const TDesC& CTestDeliverMultiRecipientsMixed_2::TestName()
-	{
-	return KTestDeliverMultiRecipientsMixed_2();
-	}
--- a/messagingappbase/smsmtm/test/src/t_smsdeliverlastsegmentreport.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,226 +0,0 @@
-// Copyright (c) 2006-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 "t_smsdeliverlastsegmentreport.h"
-#include <smss.rsg>
-#include <etelmm.h>
-#include <smstestutils.h>
-
-
-
-
-GLDEF_C TInt E32Main()
-	{	
-	__UHEAP_MARK;
-	test.Start(_L("Setup"));
-	theCleanup = CTrapCleanup::New();
-	if(theCleanup == NULL)
-		{
-		return KErrNoMemory;			
-		}
-	TRAPD(ret,doMainL());
-	delete theCleanup;	
-	test.Printf(_L("Completed with return code %d"),ret);
-	test.End();
-	test.Close();
-	__UHEAP_MARKEND;
-	return ret;
-	}
-
-LOCAL_C void doMainL()
-	{
-	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
-	CleanupStack::PushL(scheduler);
-	CActiveScheduler::Install(scheduler);
-
-	CSmsTestUtils* smsTest = CSmsTestUtils::NewLC(test);
-	TInt nextTest = 0;
-	
-	CSmsDeliverLastSegmentReport* lastSegReport = CSmsDeliverLastSegmentReport::NewLC(*smsTest, KNullDesC, nextTest);
-
-	lastSegReport->StartL();
-
-	CleanupStack::PopAndDestroy(3, scheduler);
-	}
-
-CSmsDeliverLastSegmentReport::CSmsDeliverLastSegmentReport(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest)
-: CSmsTestBase(aSmsTest, aScriptFile, aNextTest)
-	{
-	}
-
-void CSmsDeliverLastSegmentReport::RunAutoL()
-	{
-	// Testing settings (CSmsSettings)
-	iSmsTest.TestStart(++iNextTest, _L("CSmsSettings"));  
-	TestSmsSettingsL();
-	iSmsTest.TestFinish(iNextTest);
-
-	// Testing number class (CSmsHeader)
-	iSmsTest.TestStart(++iNextTest, _L("CSmsHeader"));  
-	TestSmsHeaderL();
-	
-	iSmsTest.TestFinish(iNextTest);
-
-	}
-
-CSmsDeliverLastSegmentReport::~CSmsDeliverLastSegmentReport()
-	{
-	delete iSmsHeader;
-	delete iRichText;
-	delete iParaLayer;
-	delete iCharLayer;
-	}
-
-
-void CSmsDeliverLastSegmentReport::ConstructL()
-	{
-	iSmsTest.SetLogToFile();
-
-	iSelection = new (ELeave) CMsvEntrySelection();
-	iTimer = CTestTimer::NewL();
-
-	iParaLayer =CParaFormatLayer::NewL();
-	iCharLayer = CCharFormatLayer::NewL();
-	iRichText = CRichText::NewL(iParaLayer, iCharLayer, CEditableText::EFlatStorage,256);
-	
-	CActiveScheduler::Add(this);
-	}
-
-CSmsDeliverLastSegmentReport* CSmsDeliverLastSegmentReport::NewLC(CSmsTestUtils& aSmsTest, const TDesC& aScriptFile, TInt& aNextTest)
-	{
-	CSmsDeliverLastSegmentReport* self = new (ELeave) CSmsDeliverLastSegmentReport(aSmsTest, aScriptFile, aNextTest);
-	CleanupStack::PushL(self);
-
-	self->ConstructL();
-
-	return self;
-	}
-
-void CSmsDeliverLastSegmentReport::ShowMenuL()
-	{
-	iSmsTest.ResetMenu();
-
-	iSmsTest.AppendToMenuL(_L("Start"));
-	RunAutoL();
-	
-	if (!iSmsTest.RunAuto())
-		{
-		iSmsTest.Printf(_L("Press any key to continue...\n"));
-		iSmsTest.Test().Getch();
-		}
-
-	}
-
-void CSmsDeliverLastSegmentReport::TestSmsSettingsL()
-	{
-	iSmsTest.Printf(_L("Testing Create Settings...\n"));
-
-	iSmsTest.SetEntryL(iSmsTest.iSmsServiceId);
-// First we test all the last segment delivery report feature of the class CSmsSettings
-// We give it different values and compare if it works
-
-	CSmsSettings* settings = CSmsSettings::NewLC();
-		
-	TestSettingLastSegmentDeliveryReport(*settings);
-
-	iSmsTest.Printf(_L("Test Create Settings Passed\n"));
-
-	CleanupStack::PopAndDestroy(settings);
-
-}
-
-
-
-void CSmsDeliverLastSegmentReport::TestSettingLastSegmentDeliveryReport(CSmsMessageSettings& aSettings)
-	{
-
-// Reject Duplicate 
-
-// Delivery Report
-	aSettings.SetLastSegmentDeliveryReport(ETrue); 
-	iSmsTest(aSettings.LastSegmentDeliveryReport());
-	aSettings.SetLastSegmentDeliveryReport(EFalse);
-	iSmsTest(!aSettings.LastSegmentDeliveryReport());
-	aSettings.SetLastSegmentDeliveryReport(ETrue);
-	
-	iSmsTest.Printf(_L("Test Last Segment Delivery Report Passed\n"));
-
-// Can Concatenate (write messages with more than 160 characters)
-	aSettings.SetCanConcatenate(ETrue);
-	iSmsTest(aSettings.CanConcatenate());
-	aSettings.SetCanConcatenate(EFalse);
-	iSmsTest(aSettings.CanConcatenate()==EFalse);
-	iSmsTest.Printf(_L("Test Can Concatenate Passed\n"));
-
-	}
-
-
-
-
-void CSmsDeliverLastSegmentReport::TestSmsHeaderL()
-	{
-
-// Testing class CSmsHeader
-	iSmsTest.Test().Next(_L("Testing CSmsHeader"));
-	
-// First we test constructing ESmsDeliver
-	delete iSmsHeader; // deleting the previous one
-	iSmsHeader = NULL;
-	iSmsHeader=CSmsHeader::NewL(CSmsPDU::ESmsDeliver,*iRichText); // constructing
-	iSmsTest(iSmsHeader->Type()==CSmsPDU::ESmsDeliver);	// type ok?
-
-	CSmsDeliver& deliver = iSmsHeader->Deliver();  // lets get the CSmsPDU of the CSmsHeader
-	iSmsTest(deliver.Type() == CSmsPDU::ESmsDeliver); // Are the types ok?
-	
-
-// Type ESmsStatusReport
-	delete iSmsHeader; // deleting the previous one
-	iSmsHeader = NULL;
-	iSmsHeader=CSmsHeader::NewL(CSmsPDU::ESmsStatusReport,*iRichText);
-	iSmsTest(iSmsHeader->Type()==CSmsPDU::ESmsStatusReport);
-
-	CSmsStatusReport& statusreport=iSmsHeader->StatusReport();
-	iSmsTest(statusreport.Type() == CSmsPDU::ESmsStatusReport);
-
-// Type ESmsSubmit
-	delete iSmsHeader; // deleting the previous one
-	iSmsHeader = NULL;
-	iSmsHeader=CSmsHeader::NewL(CSmsPDU::ESmsSubmit,*iRichText);
-	iSmsTest(iSmsHeader->Type()==CSmsPDU::ESmsSubmit);
-
-	CSmsSubmit& submit=iSmsHeader->Submit();
-	iSmsTest(submit.Type() == CSmsPDU::ESmsSubmit);
-
-// Lets access the CSmsMessage of our header
-	CSmsMessage& message=iSmsHeader->Message();
-	iSmsTest(message.Type() == CSmsPDU::ESmsSubmit);
-
-// Setting settings of the message
-	CSmsSettings* smsSet = CSmsSettings::NewLC();
-	smsSet->SetLastSegmentDeliveryReport(ETrue);
-	
-	// And copying them to the CSmsHeader
-	iSmsHeader->SetSmsSettingsL(*smsSet);
-	
-	// Lets get the same setting from the CSmsHeader
-	iSmsHeader->GetSmsSettingsL(*smsSet);
-	
-	// And compare that they are ok!
-	iSmsTest(smsSet->LastSegmentDeliveryReport());
-	
-	CleanupStack::PopAndDestroy();
-	}
-
--- a/messagingappbase/smsmtm/test/src/t_smsdetails.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,698 +0,0 @@
-// Copyright (c) 2004-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 "t_smsdetails.h"
-
-#include <e32test.h>
-#include <smutset.h>
-#include <smuthdr.h>
-#include <txtrich.h>
-#include <smstestutils.h>
-#include <msvuids.h>
-#include <smsuaddr.h>
-#include <csmsaccount.h>
-
-#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS  
-#include <tmsvsmsentry.h>
-#endif
-
-_LIT(KFailed,"Failed to complete tests.");
-_LIT(KRecipientOk,		"+447747065441");  // has to be the number of SIM in the data blok
-_LIT(KMessageData, "This is a simple text message");
-
-_LIT(KFirstName,	"Joe");
-_LIT(KLastName,		"Bloggs");
-_LIT(KContactInfo,	"Joe Bloggs");
-
-_LIT(KTestReceiveDetails_1,	"Test receive details - number not in contacts database.");
-_LIT(KTestReceiveDetails_2,	"Test receive details - number in contacts database.");
-_LIT(KTestReceiveDetails_3,	"Test receive details - number duplicated in contacts database.");
-
-#if defined (__WINS__)
-_LIT(KPddName,"ECDRV");
-_LIT(KLddName,"ECOMM");
-#else	//__WINS__
-_LIT(KPddSirName,"ESIR");
-_LIT(KPddUartName,"ECUART4");
-_LIT(KLddName,"ECOMM");
-#endif	//__WINS__
-
-RTest test(_L("T_SmsDetails Test Harness"));
-
-const TTimeIntervalMicroSeconds32 KWaitForWatchersToStart = 20000000;
-const TTimeIntervalMicroSeconds32 KWaitForWatchersToStartDisplayInterval = 5000000;
-
-LOCAL_C void DoTestsL()
-	{
-#if defined (__WINS__)
-	User::LoadPhysicalDevice(KPddName);
-	User::LoadLogicalDevice(KLddName);
-#else	//__WINS__
-	User::LoadPhysicalDevice(KPddSirName);
-	User::LoadPhysicalDevice(KPddUartName);
-    User::LoadLogicalDevice(KLddName);
-#endif	//__WINS__
-
-	TInt r = StartC32();
-	if( (r != KErrNone) && (r != KErrAlreadyExists) )
-		test.Printf(_L("Failed to start C32 %d\n"), r);
-	
-	// Create and install the active scheduler
- 	CActiveScheduler* scheduler= new (ELeave) CActiveScheduler();
-	CleanupStack::PushL(scheduler);
-	CActiveScheduler::Install(scheduler);
-
-	// Create the test engine
-	CTestEngine* testEngine = CTestEngine::NewL();
-	CleanupStack::PushL(testEngine);
-
-	// Do tests...
-	testEngine->DoTestsL();
-	
-	CleanupStack::PopAndDestroy(2, scheduler);	
-	}
-
-GLDEF_C TInt E32Main()
-	{	
-	__UHEAP_MARK;
-	CTrapCleanup* tc=CTrapCleanup::New();
-	TRAPD(err,DoTestsL());
-	if (err!=KErrNone)
-		User::Panic(KFailed, err);
-	delete tc;
-	test.Close();
-	__UHEAP_MARKEND;
-	return KErrNone;
-	}
-	
-/*
- *	CTestEngine
- */
-	
-CTestEngine* CTestEngine::NewL()
-	{
-	CTestEngine* self = new (ELeave) CTestEngine();
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;
-	}
-
-CTestEngine::~CTestEngine()
-	{
-	delete iTestUtils;
-	delete iWatchers;
-
-	iSocket.Close();
-	iSocketServ.Close();
-	}
-
-CTestEngine::CTestEngine()
-: CBase()
-	{
-	}
-	
-void CTestEngine::DoTestsL()
-	{
-	CTestDetailsBase* testCase = NULL;
-	
-	testCase = 	CTestReceiveDetails_1::NewL(*iTestUtils, *this);
-	RunTestCaseL(*testCase);
-
-	testCase = 	CTestReceiveDetails_2::NewL(*iTestUtils, *this);
-	RunTestCaseL(*testCase);
-
-	testCase = 	CTestReceiveDetails_3::NewL(*iTestUtils, *this);
-	RunTestCaseL(*testCase);
-	
-	if( iTestFailCount > 0 )
-		iTestUtils->Printf(_L("Test Complete -> %d Failures\n"), iTestFailCount);
-	else
-		iTestUtils->Printf(_L("Test Complete -> Passed\n"));
-	}
-	
-void CTestEngine::RunTestCaseL(CTestDetailsBase& aTestCase)
-	{
-	CleanupStack::PushL(&aTestCase);
-	aTestCase.Start();
-	CActiveScheduler::Start();
-	CleanupStack::PopAndDestroy(&aTestCase);
-	}
-
-void CTestEngine::ConstructL()
-	{
-	// This should create the SMS service, including the service settings.
-	iTestUtils = CSmsTestUtils::NewL(test);
-	
-	// Remove the contacts database file
-	iTestUtils->DeleteContactsFileL();
-	
-	// Notify the system agent that the phone is on.
-	iTestUtils->NotifySaPhoneOnL();
-	
-	// Tell the tests utils to log to file
-	iTestUtils->SetLogToFile();
-	
-	// Restore the service settings.
-	iTestUtils->SetEntryL(iTestUtils->iSmsServiceId);
-	CSmsAccount* account = CSmsAccount::NewLC();
-	account->LoadSettingsL(*iTestUtils->iServiceSettings);
-
-	// Remove the default service centres from the service settings
-	TInt count = iTestUtils->iServiceSettings->ServiceCenterCount();
-	while( count-- )
-		{
-		iTestUtils->iServiceSettings->RemoveServiceCenter(count);
-		}
-		
-	// Add the Vodafone service centre - store the settings.
-	iTestUtils->iServiceSettings->AddServiceCenterL(_L("Vodafone"), _L("+447785016005"));
-
-	// Set delivery options - do matching and make reports visible.	
-	iTestUtils->iServiceSettings->SetDeliveryReport(ETrue);
-	iTestUtils->iServiceSettings->SetStatusReportHandling(CSmsSettings::EMoveReportToInboxVisibleAndMatch);
-	
-	account->SaveSettingsL(*iTestUtils->iServiceSettings);
-	CleanupStack::PopAndDestroy(account);
-
-	// Create a session with the SMS stack - note order of the next few things
-	// is important.
-	User::LeaveIfError(iSocketServ.Connect());
-	TProtocolDesc protoinfo;
-	TProtocolName protocolname(KSmsDatagram);
-	User::LeaveIfError(iSocketServ.FindProtocol(protocolname,protoinfo));
-	User::LeaveIfError(iSocket.Open(iSocketServ,protoinfo.iAddrFamily,protoinfo.iSockType,protoinfo.iProtocol));
-	
-	TSmsAddr smsaddr;
-	smsaddr.SetSmsAddrFamily(ESmsAddrSendOnly);
-	User::LeaveIfError(iSocket.Bind(smsaddr));
-	
-	// Initialise phone...
-	iTestUtils->WaitForInitializeL();
-	
-	// Start watchers...
-	StartWatcherL();
-	}
-	
-TBool CTestEngine::WatchersAlreadyRunningL()
-	{
-	RSocketServ server;
-	RSocket socket;
-
-	User::LeaveIfError(server.Connect());
-	CleanupClosePushL(server);
-
-		// test if it's there... 
-	TProtocolDesc protoInfo;
-	TProtocolName protocolname;
-	protocolname.Copy(KSmsDatagram);
-	User::LeaveIfError(server.FindProtocol(protocolname,protoInfo));
-
-	User::LeaveIfError(socket.Open(server,
-										protoInfo.iAddrFamily,
-										protoInfo.iSockType, 
-										protoInfo.iProtocol));
-	CleanupClosePushL(socket);
-
-	TSmsAddr addr;
-	addr.SetSmsAddrFamily(ESmsAddrRecvAny);
-	TInt err = socket.Bind(addr);
-
-	CleanupStack::Pop(2, &server);
-	socket.CancelAll();
-	socket.Close();
-	server.Close();
-	return (err == KErrAlreadyExists);
-	}
-	
-void CTestEngine::StartWatcherL()
-	{
-	iTestUtils->Printf(_L("Start the Watcher"));
-
-	if( WatchersAlreadyRunningL() )
-		{
-		iTestUtils->Printf(_L("Watchers are already running\n"));
-		return;
-		}
-
-	iWatchers = CTestUtilsWatcherStarter::NewL();
-
-	TTimeIntervalMicroSeconds32 wait = KWaitForWatchersToStart;
-	TBool started = EFalse;
-	while( !started && wait.Int() > 0 )
-		{
-		iTestUtils->Printf(_L("Waiting %d secs for watchers to start...\n"), wait.Int() / 1000000);
-		wait = wait.Int() - KWaitForWatchersToStartDisplayInterval.Int();
-		User::After(KWaitForWatchersToStartDisplayInterval);
-		started = WatchersAlreadyRunningL();
-		}
-
-	if( !WatchersAlreadyRunningL() )
-		{
-		iTestUtils->Printf(_L("WARNING: NBS Watcher has not started yet\n"));
-		}
-	}
-	
-//	methods from MTestObserver
-
-void CTestEngine::TestFailed()
-	{
-	iTestUtils->Printf(_L("!!Test Failed\n"));
-	++iTestFailCount;
-	CActiveScheduler::Stop();
-	}
-	
-void CTestEngine::TestPassed()
-	{
-	iTestUtils->Printf(_L("!!Test Complete\n"));
-	CActiveScheduler::Stop();
-	}
-	
-/*
- * CTestDetailsBase
- */
- 
-CTestDetailsBase::~CTestDetailsBase()
-	{
-	Cancel();
-	
-	delete iEntryForObserver;
-	delete iOperation;
-	}	
-	
-void CTestDetailsBase::Start()
-	{
-	iTestUtils.Printf(_L("Starting %S\n"), &TestName());
-	iState = EClearFolders;
-	CompleteSelf();
-	}
-	
-CTestDetailsBase::CTestDetailsBase(CSmsTestUtils& aTestUtils, MTestObserver& aObserver)
-: CActive(CActive::EPriorityStandard), iTestUtils(aTestUtils), iObserver(aObserver)
-	{
-	CActiveScheduler::Add(this);
-	}
-	
-void CTestDetailsBase::ConstructL()
-	{
-	iEntryForObserver = Session().GetEntryL(KMsvGlobalInBoxIndexEntryId);
-	}
-	
-void CTestDetailsBase::CompleteSelf()
-	{
-	TRequestStatus* pStat = &iStatus;
-	User::RequestComplete(pStat, KErrNone);
-	SetActive();
-	}
-	
-CMsvSession& CTestDetailsBase::Session()
-	{
-	return *iTestUtils.iMsvSession;
-	}
-
-CMsvEntry& CTestDetailsBase::MsvEntry()
-	{
-	return *iTestUtils.iMsvEntry;
-	}
-
-CSmsClientMtm& CTestDetailsBase::Client()
-	{
-	return *iTestUtils.iSmsClientMtm;
-	}
-	
-CSmsSettings& CTestDetailsBase::ServiceSettings()
-	{
-	return *iTestUtils.iServiceSettings;
-	}
-	
-void CTestDetailsBase::Test(TBool aTest)
-	{
-	if( !aTest )
-		iObserver.TestFailed();
-	}
-		
-void CTestDetailsBase::ClearFoldersL()
-	{
-	iTestUtils.DeleteSmsMessagesL(KMsvGlobalOutBoxIndexEntryId);
-	iTestUtils.DeleteSmsMessagesL(KMsvGlobalInBoxIndexEntryId);
-	iTestUtils.DeleteSmsMessagesL(KMsvSentEntryId);		
-	}
-		
-void CTestDetailsBase::CreateMessageL()
-	{
-	iTestUtils.Printf(_L("Creating message...\n"));
-	
-	TMsvEntry entry;
-	entry.SetVisible(ETrue); 
-	entry.SetInPreparation(ETrue); 
-	entry.iServiceId = iTestUtils.iSmsServiceId; 
-	entry.iType = KUidMsvMessageEntry; 
-	entry.iMtm = KUidMsgTypeSMS; 
-	entry.iDate.HomeTime(); 
-	entry.iSize = 0; 
-	entry.iDescription.Set(KNullDesC); 
-	entry.iDetails.Set(KNullDesC); 
-
-	// Check send options...
-	TUint sendState = KMsvSendStateWaiting; 
-	switch( ServiceSettings().Delivery() )  
-		{ 
-	case ESmsDeliveryScheduled: 
-		sendState = KMsvSendStateScheduled; 
-		break; 
-	case ESmsDeliveryUponRequest: 
-		sendState = KMsvSendStateUponRequest; 
-		break; 
-	default: 
-		sendState = KMsvSendStateWaiting; 
-		break;
-		}
-	entry.SetSendingState(sendState); 
-
-	// Create the SMS header object...
-	CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils.iRichText);
-	CleanupStack::PushL(header);
-	
-	// Set the body text...
-	iTestUtils.iRichText->Reset();
-	iTestUtils.iRichText->InsertL(0, KMessageData);
-	
-	// Copy the message settings...
-	header->SetSmsSettingsL(ServiceSettings()); 
-	
-	// Set the service centre
-	TInt defaultIndex = ServiceSettings().DefaultServiceCenter();
-	header->SetServiceCenterAddressL(ServiceSettings().GetServiceCenter(defaultIndex).Address());
-	
-	// Set recipient - ask derived class
-	SetRecipientsL(*header);
-	
-	// Update entry description and details...
-	CArrayPtrFlat<CSmsNumber>& recipient = header->Recipients();
-	entry.iDetails.Set(recipient[0]->Address());
-	entry.iDescription.Set(iTestUtils.iRichText->Read(0, ServiceSettings().DescriptionLength()));
-	entry.SetInPreparation(EFalse);
-	
-	// Create the entry - set context to the global outbox.
-	MsvEntry().SetEntryL(KMsvGlobalOutBoxIndexEntryId);
-	MsvEntry().CreateL(entry);
-
-	// Create new store and save header information 
-	MsvEntry().SetEntryL(entry.Id()); 
-	CMsvStore* store = MsvEntry().EditStoreL(); 
-	CleanupStack::PushL(store); 
-	header->StoreL(*store);
-	store->StoreBodyTextL(*iTestUtils.iRichText);
-	store->CommitL(); 
-	CleanupStack::PopAndDestroy(2, header); 
-	
-	iMessageId = entry.Id();
-	}
-	
-void CTestDetailsBase::SetRecipientsL(CSmsHeader& aHeader)
-	{
-	CSmsNumber* rcpt0 = CSmsNumber::NewL();
-	CleanupStack::PushL(rcpt0);
-	rcpt0->SetAddressL(KRecipientOk);
-	aHeader.Recipients().AppendL(rcpt0);
-	CleanupStack::Pop(rcpt0);
-	}
-
-void CTestDetailsBase::SendMessageL()
-	{
-	iTestUtils.Printf(_L("Sending message %d\n"), iMessageId);
-
-	delete iOperation;
-	iOperation = NULL;
-
-	CMsvEntrySelection* sel = new (ELeave) CMsvEntrySelection();
-	CleanupStack::PushL(sel);
-	sel->AppendL(iMessageId);
-
-	iTestUtils.DisplayMessageL(iMessageId);
-	
-	MsvEntry().SetEntryL(KMsvGlobalOutBoxIndexEntryId);
-	iOperation = MsvEntry().CopyL(*sel, iTestUtils.iSmsServiceId, iStatus);
-	CleanupStack::PopAndDestroy(sel);
-
-	SetActive();
-	}
-	
-void CTestDetailsBase::ChangeServiceSettingsL()
-	{
-	// Restore the service settings.
-	iTestUtils.SetEntryL(iTestUtils.iSmsServiceId);
-	CSmsAccount* account = CSmsAccount::NewLC();
-	account->LoadSettingsL(*iTestUtils.iServiceSettings);
-	
-	// Set the service settings 
-	iTestUtils.iServiceSettings->SetValidityPeriod(TTimeIntervalMinutes(5));
-	iTestUtils.iServiceSettings->SetDeliveryReport(ETrue);
-	iTestUtils.iServiceSettings->SetStatusReportHandling(CSmsSettings::EMoveReportToInboxVisibleAndMatch);
-	
-	// Store the new service settings
-	account->SaveSettingsL(*iTestUtils.iServiceSettings);
-	CleanupStack::PopAndDestroy(account);
-	}
-	
-// methods from CActive
-
-void CTestDetailsBase::RunL()
-	{
-	User::LeaveIfError(iStatus.Int());
-	
-	switch( iState )
-		{
-	case EClearFolders:
-		{
-		ClearFoldersL();
-		iState = EChangeServiceSettings;
-		CompleteSelf();
-		} break;
-	case EChangeServiceSettings:
-		{
-		ChangeServiceSettingsL();
-		iState = ECreateMessage;
-		CompleteSelf();
-		} break;			
-	case ECreateMessage:
-		{
-		CreateMessageL();
-		iState = ESendMessage;
-		CompleteSelf();
-		} break;
-	case ESendMessage:
-		{
-		SendMessageL();
-		iState = EMessageSent;
-		} break;
-	case EMessageSent:
-		{
-		// Observer the in-box.
-		iEntryForObserver->SetEntryL(KMsvGlobalInBoxIndexEntryId);
-		iEntryForObserver->AddObserverL(*this);
-		
-		iState = EPendingReceivedMessage;
-		} break;
-	case EPendingReceivedMessage:
-		{
-		// End the test...
-		iObserver.TestPassed();
-		} break;			
-	default:
-		User::Invariant();
-		break;
-		}
-	}
-	
-void CTestDetailsBase::DoCancel()
-	{
-	}
-	
-TInt CTestDetailsBase::RunError(TInt /*aError*/)
-	{
-	return KErrNone;
-	}
-	
-//	methods from MMsvEntryObserver	
-	
-void CTestDetailsBase::HandleEntryEventL(TMsvEntryEvent aEvent, TAny* aArg1, TAny* /*aArg2*/, TAny* /*aArg3*/)
-	{
-	__ASSERT_DEBUG( iState == EPendingReceivedMessage, User::Invariant() );
-	
-	if( aEvent == EMsvNewChildren )
-		{
-		iTestUtils.Printf(_L("Message received in in-box...\n"));
-		
-		CMsvEntrySelection* sel = (CMsvEntrySelection*)(aArg1);
-		
-		for( TInt ii=0; ii < sel->Count(); ++ii )
-			{
-			CheckReceivedMessageL(sel->At(ii));	
-			}
-			
-		// Test should be over - complete-self.
-		CompleteSelf();
-		}
-	}
-	
-/*
- * CTestReceiveDetails_1
- */
- 
-CTestReceiveDetails_1* CTestReceiveDetails_1::NewL(CSmsTestUtils& aTestUtils, MTestObserver& aObserver)
-	{
-	CTestReceiveDetails_1* self = new (ELeave) CTestReceiveDetails_1(aTestUtils, aObserver);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;	
-	}
-
-CTestReceiveDetails_1::~CTestReceiveDetails_1()
-	{
-	}
-	
-CTestReceiveDetails_1::CTestReceiveDetails_1(CSmsTestUtils& aTestUtils, MTestObserver& aObserver)
-: CTestDetailsBase(aTestUtils, aObserver)
-	{
-	}
-
-// methods from CTestSendBase
-
-void CTestReceiveDetails_1::CheckReceivedMessageL(TMsvId aMessageId)
-	{
-	iTestUtils.Printf(_L("Checking received message %d has correct details\n"), aMessageId);
-	
-	// Need to see that the details contains a telephone number
-	MsvEntry().SetEntryL(KMsvGlobalInBoxIndexEntryId);
-	MsvEntry().SetEntryL(aMessageId);
-	TMsvSmsEntry entry = MsvEntry().Entry();
-	
-	// Recipient 2 delivered to first...
-	iTestUtils.Printf(_L("->Details info is %S - should be %S\n"), &entry.iDetails, &KRecipientOk());
-	Test(entry.iDetails.CompareF(KRecipientOk()) == 0);	
-	}
-
-const TDesC& CTestReceiveDetails_1::TestName()
-	{
-	return KTestReceiveDetails_1();
-	}
-
-/*
- * CTestReceiveDetails_2
- */
- 
-CTestReceiveDetails_2* CTestReceiveDetails_2::NewL(CSmsTestUtils& aTestUtils, MTestObserver& aObserver)
-	{
-	CTestReceiveDetails_2* self = new (ELeave) CTestReceiveDetails_2(aTestUtils, aObserver);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;	
-	}
-
-CTestReceiveDetails_2::~CTestReceiveDetails_2()
-	{
-	}
-	
-CTestReceiveDetails_2::CTestReceiveDetails_2(CSmsTestUtils& aTestUtils, MTestObserver& aObserver)
-: CTestDetailsBase(aTestUtils, aObserver)
-	{
-	}
-	
-void CTestReceiveDetails_2::ConstructL()
-	{
-	CTestDetailsBase::ConstructL();
-	
-	// Add contact to database...
-	TContactItemId contId = iTestUtils.CreateContactL(KFirstName, KLastName, KRecipientOk, KNullDesC);
-	if( contId == KNullContactId )
-		User::Leave(KErrCorrupt);
-	}
-
-// methods from CTestSendBase
-
-void CTestReceiveDetails_2::CheckReceivedMessageL(TMsvId aMessageId)
-	{
-	iTestUtils.Printf(_L("Checking received message %d has correct details\n"), aMessageId);
-	
-	// Need to see that the details contains a telephone number
-	MsvEntry().SetEntryL(KMsvGlobalInBoxIndexEntryId);
-	MsvEntry().SetEntryL(aMessageId);
-	TMsvSmsEntry entry = MsvEntry().Entry();
-	
-	// Recipient 2 delivered to first...
-	iTestUtils.Printf(_L("->Details info is %S - should be %S\n"), &entry.iDetails, &KContactInfo());
-	Test(entry.iDetails.CompareF(KContactInfo()) == 0);
-	}
-
-const TDesC& CTestReceiveDetails_2::TestName()
-	{
-	return KTestReceiveDetails_2();
-	}
-	
-/*
- * CTestReceiveDetails_3
- */
- 
-CTestReceiveDetails_3* CTestReceiveDetails_3::NewL(CSmsTestUtils& aTestUtils, MTestObserver& aObserver)
-	{
-	CTestReceiveDetails_3* self = new (ELeave) CTestReceiveDetails_3(aTestUtils, aObserver);
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop(self);
-	return self;	
-	}
-
-CTestReceiveDetails_3::~CTestReceiveDetails_3()
-	{
-	}
-	
-CTestReceiveDetails_3::CTestReceiveDetails_3(CSmsTestUtils& aTestUtils, MTestObserver& aObserver)
-: CTestDetailsBase(aTestUtils, aObserver)
-	{
-	}
-	
-void CTestReceiveDetails_3::ConstructL()
-	{
-	CTestDetailsBase::ConstructL();
-	
-	// Add contact to database - this is a duplicate...
-	TContactItemId contId = iTestUtils.CreateContactL(KFirstName, KLastName, KRecipientOk, KNullDesC);
-	if( contId == KNullContactId )
-		User::Leave(KErrCorrupt);
-	}
-
-// methods from CTestSendBase
-
-void CTestReceiveDetails_3::CheckReceivedMessageL(TMsvId aMessageId)
-	{
-	iTestUtils.Printf(_L("Checking received message %d has correct details\n"), aMessageId);
-	
-	// Need to see that the details contains a telephone number
-	MsvEntry().SetEntryL(KMsvGlobalInBoxIndexEntryId);
-	MsvEntry().SetEntryL(aMessageId);
-	TMsvSmsEntry entry = MsvEntry().Entry();
-	
-	// Recipient 2 delivered to first...
-	iTestUtils.Printf(_L("->Details info is %S - should be %S\n"), &entry.iDetails, &KRecipientOk());
-	Test(entry.iDetails.CompareF(KRecipientOk()) == 0);
-	}
-
-const TDesC& CTestReceiveDetails_3::TestName()
-	{
-	return KTestReceiveDetails_3();
-	}
--- a/messagingappbase/smsmtm/test/src/t_smsinit.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-// Copyright (c) 1999-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 <e32test.h>
-#include <e32std.h>
-#include "t_smsinit.h"
-
-RTest test(_L("T_SmsInit Testrig"));
-CTrapCleanup* theCleanup;
-
-LOCAL_C void doMainL()
-	{
-	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
-	CleanupStack::PushL(scheduler);
-	CActiveScheduler::Install( scheduler );
-
-	CSmsInit* SmsTest = CSmsInit::NewL(test, ETuCreateTestDirectories);
-	CleanupStack::PushL(SmsTest);
-
-	SmsTest->StartL();
-
-	CleanupStack::PopAndDestroy(2); //SmsTest, scheduler
-	}
-
-GLDEF_C TInt E32Main()
-	{	
-	__UHEAP_MARK;
-	test.Start(_L("Setup"));
-	theCleanup = CTrapCleanup::New();
-	TRAPD(ret,doMainL());		
-	test(ret==KErrNone);
-	delete theCleanup;	
-	test.Console()->SetPos(0, 13);
-	test.End();
-	test.Close();
-	__UHEAP_MARKEND;
-	return(KErrNone);
-	}
-
-CSmsInit::CSmsInit()
-: CSmsTestBase()
-	{
-	}
-
-void CSmsInit::ConstructL(RTest& aTest, TUint aCreationFlags)
-	{
-	iSmsTest = CSmsTestUtils::NewL(aTest, aCreationFlags);
-	}
-
-void CSmsInit::ShowMenuL()
-	{
-	iSmsTest->ResetMenu();
-
-	iSmsTest->AppendToMenuL(_L("Create SMS MTM Dat File"));
-	iSmsTest->AppendToMenuL(_L("Install SMS MTM Group"));
-	iSmsTest->AppendToMenuL(_L("Both of the Above (Create Dat File and Install MTM Group)"));
-	iSmsTest->AppendToMenuL(_L("Replace/Create Sms Service"));
-	iSmsTest->AppendToMenuL(_L("All of the Above"));
-
-	TInt result = iSmsTest->DisplayMenu(_L("SMS Initialisation"));
-
-	if (result <= 0)
-		return;
-
-	if (result == 1 || result == 3 || result == 5)
-		{
-		iSmsTest->Printf(_L("Creating SMS MTM Dat File\n"));
-		iSmsTest->CreateServerMtmRegsL();
-		}
-
-	if (result != 1)
-		{
-		iSmsTest->Printf(_L("Going Client Side\n"));
-		iSmsTest->GoClientSideL();
-		}
-
-	if (result != 1 && result != 4)
-		{
-		iSmsTest->Printf(_L("Installing SMS MTM Group\n"));
-		iSmsTest->InstallMtmGroupsL();
-		}
-
-	if (result == 4 || result == 5)
-		{
-		iSmsTest->Printf(_L("Replacing/Creating Sms Service\n"));
-		iSmsTest->DeleteServicesL();
-		iSmsTest->CreateServicesL();
-		}
-
-	iSmsTest->Test().Printf(_L("\nPress any key to continue..."));
-	iSmsTest->Test().Getch();
-
-	ShowMenuL();
-	}
-
-CSmsInit::~CSmsInit()
-	{
-	}
-
-CSmsInit* CSmsInit::NewL(RTest& aTest, TUint aCreationFlags)
-	{
-	CSmsInit* self = new (ELeave) CSmsInit();
-	CleanupStack::PushL(self);
-
-	self->ConstructL(aTest, aCreationFlags);
-
-	CleanupStack::Pop();
-	return self;
-	}
--- a/messagingappbase/smsmtm/test/src/t_testSmsBase_Step.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-// Copyright (c) 2005-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 <test/testexecutelog.h>
-#include "t_testSmsBase_Step.h"
-
-GLDEF_D RTest				test(_L("SMCM Test Harness"));
-
-CTestSmsBaseStep::CTestSmsBaseStep()
-	{
-	}
-		
-CTestSmsBaseStep::~CTestSmsBaseStep()
-	{
-	delete iSmcmTest;	
-	delete iSmsTestUtils;
-	delete iScheduler;
-	}
-
-TVerdict CTestSmsBaseStep::doTestStepPreambleL()
-	{
-	SetTestStepResult(EPass);
-	
-	// Create and install the active scheduler
- 	iScheduler = new (ELeave) CActiveScheduler();
-	CActiveScheduler::Install(iScheduler);
-	
-	iSmsTestUtils = CSmsTestUtils::NewL(test);
-	TInt nextTest=0;
-	iSmcmTest = CSmutTest::NewLC(*iSmsTestUtils, KNullDesC, nextTest,*this);
-	CleanupStack::Pop(iSmcmTest);
-	
-	return TestStepResult();
-	}		
-
-TVerdict CTestSmsBaseStep::doTestStepL()
-	{			
-	SetTestStepResult(EPass);
-	return TestStepResult();
-	}	
-
-TVerdict CTestSmsBaseStep::doTestStepPostambleL()
-/**
- * @return - TVerdict code
- * Override of base class virtual
- */
-	{
-	return TestStepResult();
-	}
-	
-	
-
-
--- a/messagingappbase/smsmtm/test/src/t_testSmsEmailFields_Step.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-// Copyright (c) 2005-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 <test/testexecutelog.h>
-#include "t_testSmsEmailFields_Step.h"
-
-CTestSmsEmailFieldsStep::CTestSmsEmailFieldsStep()
-	{
-	// Call base class method to set up the human readable name for logging
-	SetTestStepName(KTestSmsEmailFields);
-	}
-		
-CTestSmsEmailFieldsStep::~CTestSmsEmailFieldsStep()
-	{
-	}		
-
-TVerdict CTestSmsEmailFieldsStep::doTestStepL()
-	{			
-	SetTestStepResult(iSmcmTest->TestEmailFieldsL());
-	return TestStepResult();
-	}	
-
-	
-	
-
-
--- a/messagingappbase/smsmtm/test/src/t_testSmsEmsExtensions_step.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-// Copyright (c) 2005-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 <test/testexecutelog.h>
-#include "t_testSmsEmsExtensions_step.h"
-
-CTestSmsEmsExtensionsStep::CTestSmsEmsExtensionsStep()
-	{
-	// Call base class method to set up the human readable name for logging
-	SetTestStepName(KTestSmsEmsExtensions);
-	}
-		
-CTestSmsEmsExtensionsStep::~CTestSmsEmsExtensionsStep()
-	{
-	}		
-
-TVerdict CTestSmsEmsExtensionsStep::doTestStepL()
-	{			
-	SetTestStepResult(iSmcmTest->TestSmsEmsExtensionsL());
-	return TestStepResult();
-	}	
-
-	
-	
-
-
--- a/messagingappbase/smsmtm/test/src/t_testSmsEntry_Step.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-// Copyright (c) 2005-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 <test/testexecutelog.h>
-#include "t_testsmsentry_step.h"
-
-CTestSmsEntryStep::CTestSmsEntryStep()
-	{
-	// Call base class method to set up the human readable name for logging
-	SetTestStepName(KTestSmsEntry);
-	}
-		
-CTestSmsEntryStep::~CTestSmsEntryStep()
-	{
-	}		
-
-TVerdict CTestSmsEntryStep::doTestStepL()
-	{			
-	SetTestStepResult(iSmcmTest->TestSmsEntryL());
-	return TestStepResult();
-	}	
-
-	
-	
-
-
--- a/messagingappbase/smsmtm/test/src/t_testSmsNumber_Step.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-// Copyright (c) 2005-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 <test/testexecutelog.h>
-#include "t_testsmsnumber_step.h"
-
-CTestSmsNumberStep::CTestSmsNumberStep()
-	{
-	// Call base class method to set up the human readable name for logging
-	SetTestStepName(KTestSmsNumber);
-	}
-		
-CTestSmsNumberStep::~CTestSmsNumberStep()
-	{
-	}		
-
-TVerdict CTestSmsNumberStep::doTestStepL()
-	{			
-	SetTestStepResult(iSmcmTest->TestNumberL());
-	return TestStepResult();
-	}	
-
-	
-	
-
-
--- a/messagingappbase/smsmtm/test/src/t_testSmsSettings_Step.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-// Copyright (c) 2005-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 <test/testexecutelog.h>
-#include "t_testSmsSettings_Step.h"
-
-CTestSmsSettingsStep::CTestSmsSettingsStep()
-	{
-	// Call base class method to set up the human readable name for logging
-	SetTestStepName(KTestSmsSettings);
-	}
-		
-CTestSmsSettingsStep::~CTestSmsSettingsStep()
-	{
-	}		
-
-TVerdict CTestSmsSettingsStep::doTestStepL()
-	{			
-	SetTestStepResult(iSmcmTest->TestSettingsL());
-	return TestStepResult();
-	}	
-
-
-	
-
-
--- a/messagingappbase/smsmtm/test/src/t_testSmsUtilities_Step.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-// Copyright (c) 2005-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 <test/testexecutelog.h>
-#include "t_testSmsUtilities_Step.h"
-
-CTestSmsUtilitiesStep::CTestSmsUtilitiesStep()
-	{
-	// Call base class method to set up the human readable name for logging
-	SetTestStepName(KTestSmsUtilities);
-	}
-		
-CTestSmsUtilitiesStep::~CTestSmsUtilitiesStep()
-	{
-	}		
-
-TVerdict CTestSmsUtilitiesStep::doTestStepL()
-	{			
-	SetTestStepResult(iSmcmTest->TestSmsUtilitiesL());
-	return TestStepResult();
-	}	
-
-	
-	
-
-
--- a/messagingappbase/smsmtm/test/src/t_testsmsHeader_step.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-// Copyright (c) 2005-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 <test/testexecutelog.h>
-#include "t_testsmsHeader_step.h"
-
-CTestSmsHeaderStep::CTestSmsHeaderStep()
-	{
-	// Call base class method to set up the human readable name for logging
-	SetTestStepName(KTestSmsHeader);
-	}
-		
-CTestSmsHeaderStep::~CTestSmsHeaderStep()
-	{
-	}		
-
-TVerdict CTestSmsHeaderStep::doTestStepL()
-	{			
-	SetTestStepResult(iSmcmTest->TestHeaderL());
-	return TestStepResult();
-	}	
-
-	
-	
-
-
--- a/messagingappbase/smsmtm/test/testrom/t_smcm.iby	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +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:
-*
-*/
-
-REM
-REM T_SMCM.IBY
-REM
-
-REM data
-
-data=EPOCROOT##epoc32\wins\C\sms\SimParameter.script	System\MsgTest\sms\SimParameter.script
-data=EPOCROOT##epoc32\wins\C\sms\smssc_config.txt		System\MsgTest\sms\smssc_config.txt
-
-
-data=EPOCROOT##epoc32\wins\C\msgtest\sms\sms.script					System\MsgTest\msgtest\sms\sms.script
-data=EPOCROOT##epoc32\wins\C\msgtest\sms\smsenum.script					System\MsgTest\msgtest\sms\smsenum.script
-data=EPOCROOT##epoc32\wins\C\msgtest\sms\wap.script				System\MsgTest\msgtest\sms\wap.script
-data=EPOCROOT##epoc32\wins\C\msgtest\sms\nbs.script				System\MsgTest\msgtest\sms\nbs.script
-data=EPOCROOT##epoc32\wins\C\msgtest\sms\biofication.script		System\MsgTest\msgtest\sms\biofication.script
-data=EPOCROOT##epoc32\wins\C\msgtest\sms\smcmsimtsytest_config.txt	System\MsgTest\msgtest\sms\smcmsimtsytest_config.txt
-data=EPOCROOT##epoc32\wins\C\msgtest\sms\sendrecv.script			System\MsgTest\msgtest\sms\sendrecv.script
-data=EPOCROOT##epoc32\wins\C\msgtest\sms\Nokia8210.txt				System\MsgTest\msgtest\sms\Nokia8210.txt
-data=EPOCROOT##epoc32\wins\C\msgtest\sms\EricssonT300.txt			System\MsgTest\msgtest\sms\EricssonT300.txt
-data=EPOCROOT##epoc32\wins\C\msgtest\sms\logo1.olp					System\MsgTest\msgtest\sms\logo1.olp
-data=EPOCROOT##epoc32\wins\C\msgtest\sms\tone1.rtp					System\MsgTest\msgtest\sms\tone1.rtp
-data=EPOCROOT##epoc32\wins\C\msgtest\sms\tone2.rtp					System\MsgTest\msgtest\sms\tone2.rtp
-data=EPOCROOT##epoc32\wins\C\msgtest\sms\tone3.rtp					System\MsgTest\msgtest\sms\tone3.rtp
-data=EPOCROOT##epoc32\wins\C\msgtest\sms\t_smssendrecv.html		System\MsgTest\msgtest\sms\t_smssendrecv.html
-
-
-data=EPOCROOT##epoc32\wins\C\ems\anims.mbm		System\MsgTest\ems\anims.mbm
-data=EPOCROOT##epoc32\wins\C\ems\pics.mbm		System\MsgTest\ems\pics.mbm
-
-
-REM harnesses
-file=ABI_DIR\BUILD_DIR\T_SMCM1.exe				System\MsgTest\T_SMCM1.exe
-file=ABI_DIR\BUILD_DIR\T_SMCM2.exe				System\MsgTest\T_SMCM2.exe
-file=ABI_DIR\BUILD_DIR\T_SMCMFAIL.exe  			System\MsgTest\T_SMCMFAIL.exe
-file=ABI_DIR\BUILD_DIR\T_SMSCANCEL.exe			System\MsgTest\T_SMSCANCEL.exe
-file=ABI_DIR\BUILD_DIR\T_SMSSENDRECV.exe   		System\MsgTest\T_SMSSENDRECV.exe
-file=ABI_DIR\BUILD_DIR\T_SMSBIOFICATION.exe	 	System\MsgTest\T_SMSBIOFICATION.exe
-
--- a/messagingappbase/smsmtm/test/testrom/t_smcm_prepare_for_test.bat	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-rem Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
-rem All rights reserved.
-rem This component and the accompanying materials are made available
-rem under the terms of "Eclipse Public License v1.0"
-rem which accompanies this distribution, and is available
-rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
-rem
-rem Initial Contributors:
-rem Nokia Corporation - initial contribution.
-rem
-rem Contributors:
-rem
-rem Description:
-rem
-
-REM NOTE! Do not use tabs here!
-md c:\sms
-md c:\MsgTest
-md c:\MsgTest\sms
-
-copy z:\System\MsgTest\sms\SimParameter.script c:\sms\SimParameter.script
-copy z:\System\MsgTest\sms\smssc_config.txt c:\sms\smssc_config.txt
-attrib c:\sms\*.* -r
-
-copy z:\System\MsgTest\msgtest\sms\sms.script c:\msgtest\sms\sms.script
-copy z:\System\MsgTest\msgtest\sms\smsenum.script c:\msgtest\sms\smsenum.script
-copy z:\System\MsgTest\msgtest\sms\\wap.script c:\msgtest\sms\wap.script
-copy z:\System\MsgTest\msgtest\sms\\nbs.script c:\msgtest\sms\nbs.script
-copy z:\System\MsgTest\msgtest\sms\\biofication.script c:\msgtest\sms\biofication.script
-copy z:\System\MsgTest\msgtest\sms\\smcmsimtsytest_config.txt c:\msgtest\sms\smcmsimtsytest_config.txt
-copy z:\System\MsgTest\msgtest\sms\\sendrecv.script c:\msgtest\sms\sendrecv.script
-copy z:\System\MsgTest\msgtest\sms\\Nokia8210.txt c:\msgtest\sms\Nokia8210.txt
-copy z:\System\MsgTest\msgtest\sms\\EricssonT300.txt c:\msgtest\sms\EricssonT300.txt
-copy z:\System\MsgTest\msgtest\sms\\logo1.olp c:\msgtest\sms\logo1.olp
-copy z:\System\MsgTest\msgtest\sms\\tone1.rtp c:\msgtest\sms\tone1.rtp
-copy z:\System\MsgTest\msgtest\sms\\tone2.rtp c:\msgtest\sms\tone2.rtp
-copy z:\System\MsgTest\msgtest\sms\\tone3.rtp c:\msgtest\sms\tone3.rtp
-copy z:\System\MsgTest\msgtest\sms\\t_smssendrecv.html c:\msgtest\sms\t_smssendrecv.html
-attrib c:\msgtest\sms\*.* -r
-
-
-
-
Binary file mmsengine/conf/messaging.confml has changed
Binary file mmsengine/conf/messaging_101F87EB.crml has changed
Binary file mmsengine/conf/messaging_101F87EC.crml has changed
Binary file mmsengine/conf/messaging_101F87ED.crml has changed
Binary file mmsengine/conf/messaging_101F87EE.crml has changed
Binary file mmsengine/conf/messaging_101F87EF.crml has changed
Binary file mmsengine/conf/messaging_101F8873.crml has changed
Binary file mmsengine/conf/messaging_101F8F28.crml has changed
Binary file mmsengine/conf/messaging_102071F2.crml has changed
Binary file mmsengine/conf/messaging_102072E2.crml has changed
Binary file mmsengine/conf/messaging_102072E5.crml has changed
Binary file mmsengine/conf/messaging_102824A0.crml has changed
Binary file mmsengine/conf/messaging_1028281E.crml has changed
--- a/mmsengine/mmscodec/src/mmsdecode.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/mmsengine/mmscodec/src/mmsdecode.cpp	Mon May 03 12:29:07 2010 +0300
@@ -3656,10 +3656,6 @@
     // The header has been set to KMmsTextHeader to indicate that the field value
     // is still available.
 
-    if ( ( header < 0 ) && ( iPosition < iLength ) )
-        {
-        SkipFieldValue();
-        }
 
     return header;
     }
--- a/mmsengine/mmsconf/messaging_mmssettings-config.history.xml	Fri Apr 16 14:56:15 2010 +0300
+++ b/mmsengine/mmsconf/messaging_mmssettings-config.history.xml	Mon May 03 12:29:07 2010 +0300
@@ -3,6 +3,10 @@
   <purpose>
   </purpose>
 
+  <defect number="DEF143456" title="version attribute is incorrect in crml file" revision="03">
+    version attribute is changed to 1 from mmssettings_10202d4c.crml file
+  </defect>
+  
   <defect number="DEF139515" title="mmssettings-config does not conform to the standard sysdef model" revision="02">
     messaging_mmssettings-config is made a new component under mmsengine.
   </defect>
Binary file mmsengine/mmsconf/mmssettings_10202d4c.crml has changed
--- a/mmsengine/mmsconninit/src/mmsconninit.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/mmsengine/mmsconninit/src/mmsconninit.cpp	Mon May 03 12:29:07 2010 +0300
@@ -824,7 +824,7 @@
             TMmsConnInitLogger::Log( _L("- Timer completed - retry %d"), iRetryCount );
 #endif
             }
-        for( iIndex = iIndex; iIndex < iArray->Count(); ++iIndex )
+        for( ; iIndex < iArray->Count(); ++iIndex )
             {
             // index is safe
             if( ( FindIapL( iArray->At( iIndex ), ap ) ) )
--- a/mmsengine/mmsengine.pro	Fri Apr 16 14:56:15 2010 +0300
+++ b/mmsengine/mmsengine.pro	Mon May 03 12:29:07 2010 +0300
@@ -49,23 +49,7 @@
     "./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_101fb0d9.crml               APP_LAYER_CRML(mmsengine_101fb0d9.crml)" \
-    "./conf/messaging.confml APP_LAYER_CONFML(messaging.confml)" \
-		"./conf/messaging_101F87EB.crml APP_LAYER_CRML(messaging_101F87EB.crml)" \
-		"./conf/messaging_101F87EC.crml APP_LAYER_CRML(messaging_101F87EC.crml)" \
-		"./conf/messaging_101F87ED.crml APP_LAYER_CRML(messaging_101F87ED.crml)" \
-		"./conf/messaging_101F87EE.crml APP_LAYER_CRML(messaging_101F87EE.crml)" \
-		"./conf/messaging_101F87EF.crml APP_LAYER_CRML(messaging_101F87EF.crml)" \
-		"./conf/messaging_101F8873.crml APP_LAYER_CRML(messaging_101F8873.crml)" \
-		"./conf/messaging_102071F2.crml APP_LAYER_CRML(messaging_102071F2.crml)" \
-		"./conf/messaging_102072E2.crml APP_LAYER_CRML(messaging_102072E2.crml)" \
-		"./conf/messaging_102072E5.crml APP_LAYER_CRML(messaging_102072E5.crml)" \
-		"./conf/messaging_102824A0.crml APP_LAYER_CRML(messaging_102824A0.crml)" \
-		"./conf/messaging_1028281E.crml APP_LAYER_CRML(messaging_1028281E.crml)" \
-		"./conf/messaging_101F8F28.crml APP_LAYER_CRML(messaging_101F8F28.crml)"
-    
-    
-    
+    "./conf/mmsengine_101fb0d9.crml               APP_LAYER_CRML(mmsengine_101fb0d9.crml)"    
 }
 
 symbian {
--- a/mmsengine/mmsmessage/src/mmsheaders.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/mmsengine/mmsmessage/src/mmsheaders.cpp	Mon May 03 12:29:07 2010 +0300
@@ -351,21 +351,21 @@
         stream.AssignLC( aStore, KUidMmsApplicationInfoStream ); // pushes 'stream' to the stack
         length = ApplicId().Length();
         stream.WriteInt32L( length );
-        if ( length > 0 )
+        if ( length > 0 && iApplicationId )
             {
             stream << iApplicationId->Des();
             }
         
         length = ReplyApplicId().Length();
         stream.WriteInt32L( length );
-        if ( length > 0 )
+        if ( length > 0 && iReplyToApplicationId )
             {
             stream << iReplyToApplicationId->Des();
             }
         
         length = AuxApplicInfo().Length();
         stream.WriteInt32L( length );
-        if ( length > 0 )
+        if ( length > 0 && iApplicationInfo )
             {
             stream << iApplicationInfo->Des();
             }
@@ -387,14 +387,14 @@
 
         length = RecommendedRetrievalModeText().Length();
         stream.WriteInt32L( length );
-        if ( length > 0 )
+        if ( length > 0 && iRecommendedRetrievalModeText )
             {
             stream << iRecommendedRetrievalModeText->Des();
             }
             
         length = ReplaceCancelId().Length();
         stream.WriteInt32L( length );
-        if ( length > 0 )
+        if ( length > 0 && iReplaceCancelId )
             {
             stream << iReplaceCancelId->Des();
             }
--- a/mmsengine/mmspushhandler/src/CMmsPushHandler.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/mmsengine/mmspushhandler/src/CMmsPushHandler.cpp	Mon May 03 12:29:07 2010 +0300
@@ -172,14 +172,16 @@
     // If memory runs out, tough luck..
     //
     TPtrC8 messageBodyPtr;
-    iPushMsg->GetMessageBody( messageBodyPtr );
-    iBody = messageBodyPtr.Alloc();
-    if ( !iBody )
+    if ( iPushMsg->GetMessageBody( messageBodyPtr ) )
         {
-        LOGTEXT( _L("HandleMessageL(): Out of memory when allocating body buffer") );
-        // Commit suicide - the caller expects it even if we leave
-        iPluginKiller->KillPushPlugin();
-        User::Leave( KErrNoMemory );
+        iBody = messageBodyPtr.Alloc();
+        if ( !iBody )
+            {
+        	LOGTEXT( _L("HandleMessageL(): Out of memory when allocating body buffer") );
+        	// Commit suicide - the caller expects it even if we leave
+        	iPluginKiller->KillPushPlugin();
+        	User::Leave( KErrNoMemory );
+            }
         }
     
     //
--- a/mmsengine/mmsserver/src/mmsmmboxlist.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/mmsengine/mmsserver/src/mmsmmboxlist.cpp	Mon May 03 12:29:07 2010 +0300
@@ -135,8 +135,13 @@
     // When iError not equal to KErrNone, the operation will complete after running through RunL
     if ( iError == KErrNone )
         {
-        iServerEntry->GetChildrenWithMtm( KUidMsgMMSNotification, *iOldNotifications );
-        iOldQuotaEntryId = OldQuotaEntryL();
+        TInt err;
+        err = iServerEntry->GetChildrenWithMtm( KUidMsgMMSNotification, *iOldNotifications );
+        if (err != KErrNone)
+            {
+            return;
+            }
+			iOldQuotaEntryId = OldQuotaEntryL();
         }
     else
         {
--- a/mmsengine/mmsserversettings/bld/MmsRegistry.rss	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/*
-* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 MMS MTM info resource.
-*
-*/
-
-
-
-//  INCLUDES
-#include <mtmconfig.rh>
-#include <mmsui.loc>
-
-
-//  CONSTANTS  
-// none
-
-//  MACROS  
-// none
-
-
-//  RESOURCE DEFINITIONS 
-// ---------------------------------------------------------
-//   
-//    
-//    MTM info resource for MMS
-//
-// ---------------------------------------------------------
-//
-#include <e32capability.h>
-
-RESOURCE MTM_INFO_FILE
-    {
-    mtm_type_uid = 0x100058E1;
-    technology_type_uid = 0x100058E2;
-    components = 
-        {
-        MTM_COMPONENT_V2
-            {
-            human_readable_name = qtn_mce_inbox_write_mms;
-            component_uid = KUidMtmServerComponentVal;
-            entry_point = 1;
-            version = VERSION_V2 {};
-            filename = "mmssrv.dll";
-            },
-        MTM_COMPONENT_V2
-            {
-            human_readable_name = qtn_mce_inbox_write_mms;
-            component_uid = KUidMtmClientComponentVal;
-            entry_point = 1;
-            version = VERSION_V2 {};
-            filename = "mmscli.dll";
-            },
-        MTM_COMPONENT_V2
-            {
-            human_readable_name = qtn_mce_inbox_write_mms;
-            component_uid = KUidMtmUiComponentVal;
-            entry_point = 1;
-            version = VERSION_V2 {};
-            filename = "mmsui.dll";
-            },
-        MTM_COMPONENT_V2
-            {
-            human_readable_name = qtn_mce_inbox_write_mms;
-            component_uid = KUidMtmUiDataComponentVal;
-            entry_point = 2;
-            version = VERSION_V2 {};
-            filename = "mmsui.dll";
-            }
-        };
-    }
-
-RESOURCE MTM_CAPABILITIES
-    {
-    send_capability = 1;
-    body_capability = 0;
-    }
-
-RESOURCE MTM_SECURITY_CAPABILITY_SET
-    {
-    capabilities = { ECapabilityNetworkServices };
-    }
-
-// End of File
--- a/mmsengine/mmsserversettings/bld/NotRegistry.rss	Fri Apr 16 14:56:15 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
-* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies 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 Notification MTM info resource.
-*
-*/
-
-
-
-//  INCLUDES
-#include <mtmconfig.rh>
-#include <mmsui.loc>
-
-
-//  CONSTANTS  
-// none
-
-//  MACROS  
-// none
-
-
-//  RESOURCE DEFINITIONS 
-// ---------------------------------------------------------
-//   
-//    
-//    MTM info resource for MMS
-//
-// ---------------------------------------------------------
-//
-#include <e32capability.h>
-
-RESOURCE MTM_INFO_FILE
-    {
-    mtm_type_uid = 0x100059C8;
-    technology_type_uid = 0x100058E2;
-    components = 
-        {
-        MTM_COMPONENT_V2
-            {
-            human_readable_name = qtn_mce_inbox_write_mms;
-            component_uid = KUidMtmServerComponentVal;
-            entry_point = 1;
-            version = VERSION_V2 {};
-            filename = "mmssrv.dll";
-            },
-        MTM_COMPONENT_V2
-            {
-            human_readable_name = qtn_mce_inbox_write_mms;
-            component_uid = KUidMtmClientComponentVal;
-            entry_point = 2;
-            version = VERSION_V2 {};
-            filename = "mmscli.dll";
-            },
-        MTM_COMPONENT_V2
-            {
-            human_readable_name = qtn_mce_inbox_write_mms;
-            component_uid = KUidMtmUiComponentVal;
-            entry_point = 2;
-            version = VERSION_V2 {};
-            filename = "notui.dll";
-            },
-        MTM_COMPONENT_V2
-            {
-            human_readable_name = qtn_mce_inbox_write_mms;
-            component_uid = KUidMtmUiDataComponentVal;
-            entry_point = 1;
-            version = VERSION_V2 {};
-            filename = "notui.dll";
-            }
-        };
-    }
-
-RESOURCE MTM_CAPABILITIES
-    {
-    send_capability = 1;
-    body_capability = 0;
-    }
-
-RESOURCE MTM_SECURITY_CAPABILITY_SET
-    {
-    capabilities = { ECapabilityNetworkServices };
-    }
-
-
-// End of File
--- a/mmsengine/mmsserversettings/bld/mmsserversettings.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ b/mmsengine/mmsserversettings/bld/mmsserversettings.mmp	Mon May 03 12:29:07 2010 +0300
@@ -28,18 +28,6 @@
 VERSION 	10.0
 PAGED
 
-START RESOURCE  NotRegistry.rss
-TARGET          not.rsc
-TARGETPATH      MTM_INFO_FILE_DIR
-LANGUAGE_IDS
-END
-
-START RESOURCE  MmsRegistry.rss
-TARGET          mms.rsc
-TARGETPATH      MTM_INFO_FILE_DIR
-LANGUAGE_IDS
-END
-
 SOURCEPATH      ../src
 
 SOURCE          mmsaccount.cpp mmssettings.cpp mmsschedulesettingsutils.cpp mmsmessagestoreutils.cpp mmsregisteredapplications.cpp
--- a/mmsengine/mmssettings/group/mmsgenericsettings.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ b/mmsengine/mmssettings/group/mmsgenericsettings.mmp	Mon May 03 12:29:07 2010 +0300
@@ -24,8 +24,6 @@
 TARGETPATH    	/system/libs
 TARGETTYPE 		dll
 
-VERSION 	10.0
-PAGED
 
 SOURCEPATH	../src
 SOURCE		cmmsaccounts.cpp cmmssettings.cpp
--- a/mmsengine/mmssettings/src/cmmssettings.cpp	Fri Apr 16 14:56:15 2010 +0300
+++ b/mmsengine/mmssettings/src/cmmssettings.cpp	Mon May 03 12:29:07 2010 +0300
@@ -682,23 +682,21 @@
 The MMS Settings to be copied.
 */
 EXPORT_C void CMmsSettings::CopyL(const CMmsSettings& aMmsSettings)
-{
-    iMmsSettingsFlags = aMmsSettings.iMmsSettingsFlags;
-    iApplicationId = aMmsSettings.iApplicationId;
-
-    delete iAddress;
-    iAddress = NULL;
-
-    iAddress = aMmsSettings.Address().AllocL();
-
-    iCreationMode = aMmsSettings.iCreationMode;
-
-    TInt count = aMmsSettings.ProxyCount();
-    iProxy.Reset();
-    for (TInt loop = 0; loop < count; ++loop)
-    {
-        iProxy.Append(aMmsSettings.GetProxy(loop));
-    }
+	{
+	iMmsSettingsFlags		= aMmsSettings.iMmsSettingsFlags;
+	iApplicationId 			= aMmsSettings.iApplicationId;
+	
+	delete iAddress;
+	iAddress	=	aMmsSettings.Address().AllocL();
+	
+	iCreationMode 			= aMmsSettings.iCreationMode;
+	
+	TInt count = aMmsSettings.ProxyCount();
+	iProxy.Reset();
+	for(TInt loop=0; loop < count; ++loop)
+		{
+		iProxy.Append(aMmsSettings.GetProxy(loop));
+		}
 
 	count = aMmsSettings.NapIdCount();
 	iNapId.Reset();
--- a/mmsengine/mmssettings/test/group/T_MmsSettings.mmp	Fri Apr 16 14:56:15 2010 +0300
+++ b/mmsengine/mmssettings/test/group/T_MmsSettings.mmp	Mon May 03 12:29:07 2010 +0300
@@ -21,7 +21,8 @@
 SOURCEPATH		../src
 USERINCLUDE		../inc 
 SOURCE        T_MmsSettings.cpp
-SYSTEMINCLUDE /epoc32/include
+APP_LAYER_SYSTEMINCLUDE_SYMBIAN
+USERINCLUDE		../../../../../../mw/messagingmw/messagingfw/msgtest/testutils/base/inc
 LIBRARY       euser.lib efsrv.lib
 LIBRARY       msvtestutils.lib
 LIBRARY		mmsgenericsettings.lib 
--- a/mmsengine/mmssettings/test/inc/T_MmsSettings.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/mmsengine/mmssettings/test/inc/T_MmsSettings.h	Mon May 03 12:29:07 2010 +0300
@@ -17,7 +17,7 @@
 #define __T_MMSSETTINGS_H__
 
 #include <e32base.h>
-#include <msvtestutilsbase.h>
+#include "msvtestutilsbase.h"
 #include <mtclreg.h>
 #include <msvids.h>
 #include <msvuids.h>
--- a/mmsengine/rom/MmsEngine.iby	Fri Apr 16 14:56:15 2010 +0300
+++ b/mmsengine/rom/MmsEngine.iby	Mon May 03 12:29:07 2010 +0300
@@ -22,9 +22,6 @@
 // backup registration for cen rep
 data=DATAZ_\private\100058DB\backup_registration.xml private\100058DB\backup_registration.xml
 
-//TODO: Exporting mms & not rsc files 
-data=DATAZ_\resource\messaging\mtm\mms.rsc    resource\messaging\mtm\mms.rsc
-data=DATAZ_\resource\messaging\mtm\not.rsc    resource\messaging\mtm\not.rsc
 
 // Message connection initiator needed by MMS Engine
 file=ABI_DIR\BUILD_DIR\mmsconninit.dll           SHARED_LIB_DIR\mmsconninit.dll
--- a/msg_plat/conversation_services_client_api/inc/ccsrequesthandler.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/msg_plat/conversation_services_client_api/inc/ccsrequesthandler.h	Mon May 03 12:29:07 2010 +0300
@@ -301,6 +301,13 @@
      * @param aContactId Contact Id.
      */
     IMPORT_C void MarkMessagingHistoryReadL ( TInt aContactId );
+	
+	  /**
+     * Get the conversation for a message.
+     * @param Message Id.
+     * @return CCsClientConversation
+     */
+    IMPORT_C CCsClientConversation* GetConversationFromMessageIdL ( TInt aMessageId );
     
 protected: // Functions from base classes
 
--- a/msg_plat/conversation_services_client_api/inc/rcssession.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/msg_plat/conversation_services_client_api/inc/rcssession.h	Mon May 03 12:29:07 2010 +0300
@@ -242,6 +242,13 @@
             TPtr8 aResultsBuffer);
     
     /**
+     * GetConversation
+     * @param aMessageId message Id.
+     * @return aResultsBuffer Pointer to the results buffer.
+     */
+    void GetConversationFromMessageIdL(TInt aMessageId, TPtr8 aResultsBuffer);
+    
+    /**
      * MarkConversationReadL.
      * This function sends the request to conversation server
      * to mark a conversation as read.
--- a/msg_plat/conversation_services_utilities_api/inc/ccsclientconversation.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/msg_plat/conversation_services_utilities_api/inc/ccsclientconversation.h	Mon May 03 12:29:07 2010 +0300
@@ -76,57 +76,23 @@
             TCsConversationEntryID aEnryId);
 
     /**
-     * GetFirstName
-     * Provides the Conversation first name of this object
+     * GetDisplayName
+     * Provides the Conversation display name of this object
      *
-     * @return Instance of Conversation first name of this object
+     * @return Instance of Conversation display name of this object
      */
-    IMPORT_C HBufC* GetFirstName() const;
-
-    /**
-     * SetFirstNameL
-     * Sets the Conversation first name of this object
-     *  
-     * @param aFirstName Instance of Conversation first name
-     */
-    IMPORT_C void SetFirstNameL(
-            const HBufC* aFirstName);
-
-    /**
-     * GetLastName
-     * Provides the Conversation last name of this object
-     *
-     * @return Instance of Conversation last name of this object
-     */
-    IMPORT_C HBufC* GetLastName() const;
+    IMPORT_C HBufC* GetDisplayName() const;
 
     /**
-     * SetLastNameL
-     * Sets the Conversation last name of this object
+     * SetDisplayNameL
+     * Sets the Conversation display name of this object
      *  
-     * @param aLastName Instance of Conversation last name
+     * @param aDisplayName Instance of Conversation display name
      */
-    IMPORT_C void SetLastNameL(
-            const HBufC* aLastName);
+    IMPORT_C void SetDisplayNameL(
+            const HBufC* aDisplayName);
 
     /**
-     * GetNickName
-     * Provides the Conversation nick name of this object
-     *
-     * @return Instance of Conversation nick name of this object
-     */
-    IMPORT_C HBufC* GetNickName() const;
-    
-    /**
-     * SetNickNameL
-     * Sets the Conversation nick name of this object
-     *  
-     * @param aNickName Instance of Conversation nick name
-     */
-    IMPORT_C void SetNickNameL(
-            const HBufC* aNickName);
-    
-    /**
      * GetContactId
      * Provides the Contact Id for the conversation
      *
@@ -277,22 +243,10 @@
     TCsConversationEntryID iConversationEntryID;
 
     /**
-     * iFirstName
-     * First name of conversation
+     * iDisplayName
+     * Display name of conversation
      */
-    HBufC*  iFirstName;
-
-    /**
-     * iLastName
-     * Last name of conversation
-     */
-    HBufC*  iLastName;
-    
-    /**
-     * iNickName
-     * Last name of conversation
-     */
-    HBufC*  iNickName;
+    HBufC*  iDisplayName;
 
     /**
      * iContactId
--- a/msg_plat/conversation_services_utilities_api/inc/ccsdefs.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/msg_plat/conversation_services_utilities_api/inc/ccsdefs.h	Mon May 03 12:29:07 2010 +0300
@@ -119,6 +119,7 @@
      EUserDeleteConversation,
      EGetConversationId,
      EGetConversationIdFromAddress,
+     EGetConversationFromMessageId,
      EUserMarkReadConversation
 };
 
@@ -146,6 +147,7 @@
     ERefreshConversationEvent,
     EGetConversationIdComplete,
     EGetConversationIdFromAddressComplete,
+    EGetConversationFromMessageIdComplete,
     EUserMarkReadConversationComplete    
 };
 
--- a/msg_plat/messaging_history_api/inc/msgitem.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/msg_plat/messaging_history_api/inc/msgitem.h	Mon May 03 12:29:07 2010 +0300
@@ -139,15 +139,15 @@
     
     /*
      * isAttributeSet
-     * @return MsgAttribute
+     * @return true, if set
      */
-    MsgAttribute isAttributeSet(MsgAttribute attribute) const;
+    bool isAttributeSet(MsgAttribute attribute) const;
     
     /*
      * setId
      * @param id, message id
      */
-    void setId(const int id);
+    void setId(int id);
     
     /*
      * setPhoneNumber
--- a/msg_plat/shareui_api/inc/shareuidialog.h	Fri Apr 16 14:56:15 2010 +0300
+++ b/msg_plat/shareui_api/inc/shareuidialog.h	Mon May 03 12:29:07 2010 +0300
@@ -11,8 +11,8 @@
 *
 * Contributors:
 *
-* Description: 
-*
+* Description:  Offers message creation and sending services.
+ *
 */
 
 #include <shareui.h>